|
|
@@ -8,6 +8,7 @@ import {
|
|
|
useRef,
|
|
|
useState,
|
|
|
} from 'react';
|
|
|
+import { GROWI_RENDERING_ATTR } from '@growi/core/dist/consts';
|
|
|
import { debounce } from 'throttle-debounce';
|
|
|
|
|
|
import type { IGraphViewerGlobal } from '..';
|
|
|
@@ -127,7 +128,7 @@ export const DrawioViewer = memo((props: DrawioViewerProps): JSX.Element => {
|
|
|
useEffect(() => {
|
|
|
if (error != null) {
|
|
|
onRenderingUpdated?.(null);
|
|
|
- drawioContainerRef.current?.removeAttribute('data-growi-rendering');
|
|
|
+ drawioContainerRef.current?.removeAttribute(GROWI_RENDERING_ATTR);
|
|
|
}
|
|
|
}, [error, onRenderingUpdated]);
|
|
|
|
|
|
@@ -144,7 +145,7 @@ export const DrawioViewer = memo((props: DrawioViewerProps): JSX.Element => {
|
|
|
if (mxgraphData != null) {
|
|
|
const mxgraph = JSON.parse(mxgraphData);
|
|
|
onRenderingUpdated?.(mxgraph.xml);
|
|
|
- drawioContainerRef.current?.removeAttribute('data-growi-rendering');
|
|
|
+ drawioContainerRef.current?.removeAttribute(GROWI_RENDERING_ATTR);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -184,7 +185,7 @@ export const DrawioViewer = memo((props: DrawioViewerProps): JSX.Element => {
|
|
|
className={`drawio-viewer ${styles['drawio-viewer']} p-2`}
|
|
|
data-begin-line-number-of-markdown={bol}
|
|
|
data-end-line-number-of-markdown={eol}
|
|
|
- data-growi-rendering="true"
|
|
|
+ {...{ [GROWI_RENDERING_ATTR]: 'true' }}
|
|
|
>
|
|
|
{/* show error */}
|
|
|
{error != null && (
|