From e1d52607e14226b4253cf8e893a39d7af20025f1 Mon Sep 17 00:00:00 2001 From: fantasticit Date: Thu, 12 May 2022 20:50:24 +0800 Subject: [PATCH] tiptap: fix flow style --- .../client/src/components/resizeable/resizeable.tsx | 4 +++- .../client/src/tiptap/core/wrappers/flow/index.tsx | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/client/src/components/resizeable/resizeable.tsx b/packages/client/src/components/resizeable/resizeable.tsx index 75a8d510..0819ffcd 100644 --- a/packages/client/src/components/resizeable/resizeable.tsx +++ b/packages/client/src/components/resizeable/resizeable.tsx @@ -14,6 +14,7 @@ interface IProps { onChange?: (arg: ISize) => void; onChangeEnd?: (arg: ISize) => void; className?: string; + style?: React.CSSProperties; } const MIN_WIDTH = 50; @@ -42,6 +43,7 @@ export const Resizeable: React.FC = ({ className, onChange, onChangeEnd, + style = {}, children, }) => { const $container = useRef(null); @@ -126,7 +128,7 @@ export const Resizeable: React.FC = ({ id="js-resizeable-container" className={cls(className, styles.resizable)} ref={$container} - style={{ width, height }} + style={{ ...style, width, height }} > {isEditable && ( <> diff --git a/packages/client/src/tiptap/core/wrappers/flow/index.tsx b/packages/client/src/tiptap/core/wrappers/flow/index.tsx index 98f32d38..7ed23011 100644 --- a/packages/client/src/tiptap/core/wrappers/flow/index.tsx +++ b/packages/client/src/tiptap/core/wrappers/flow/index.tsx @@ -10,7 +10,7 @@ import { getEditorContainerDOMSize } from 'tiptap/prose-utils'; import { Flow } from 'tiptap/core/extensions/flow'; import styles from './index.module.scss'; -const INHERIT_SIZE_STYLE = { width: '100%', height: '100%', maxWidth: '100%', overflow: 'hidden', padding: '1rem' }; +const INHERIT_SIZE_STYLE = { width: '100%', height: '100%', maxWidth: '100%', overflow: 'hidden' }; const ICON_STYLE = { fontSize: '0.85em' }; export const FlowWrapper = ({ editor, node, updateAttributes }) => { @@ -100,7 +100,14 @@ export const FlowWrapper = ({ editor, node, updateAttributes }) => { return ( - +