mirror of https://github.com/fantasticit/think.git
tiptap: fix render flow
This commit is contained in:
parent
9cd1a06f53
commit
94f3fd7981
|
@ -20,6 +20,7 @@ export const FlowWrapper = ({ editor, node, updateAttributes }) => {
|
||||||
const $container = useRef<HTMLElement>();
|
const $container = useRef<HTMLElement>();
|
||||||
|
|
||||||
const graphData = useMemo(() => {
|
const graphData = useMemo(() => {
|
||||||
|
if (!data) return null;
|
||||||
const content = data.replace(/<!--.*?-->/gs, '').trim();
|
const content = data.replace(/<!--.*?-->/gs, '').trim();
|
||||||
const config = JSON.stringify({
|
const config = JSON.stringify({
|
||||||
'lightbox': false,
|
'lightbox': false,
|
||||||
|
@ -90,7 +91,9 @@ export const FlowWrapper = ({ editor, node, updateAttributes }) => {
|
||||||
<NodeViewWrapper className={cls(styles.wrap, isActive && styles.isActive)}>
|
<NodeViewWrapper className={cls(styles.wrap, isActive && styles.isActive)}>
|
||||||
<Resizeable isEditable={isEditable} width={width} height={height} maxWidth={maxWidth} onChangeEnd={onResize}>
|
<Resizeable isEditable={isEditable} width={width} height={height} maxWidth={maxWidth} onChangeEnd={onResize}>
|
||||||
<div className={cls(styles.renderWrap, 'render-wrapper')} style={INHERIT_SIZE_STYLE}>
|
<div className={cls(styles.renderWrap, 'render-wrapper')} style={INHERIT_SIZE_STYLE}>
|
||||||
|
{graphData && (
|
||||||
<div className="mxgraph" style={{ width, height }} ref={setMxgraph} data-mxgraph={graphData}></div>
|
<div className="mxgraph" style={{ width, height }} ref={setMxgraph} data-mxgraph={graphData}></div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.toolbarWrap}>
|
<div className={styles.toolbarWrap}>
|
||||||
|
|
Loading…
Reference in New Issue