@team-monolith/cds 0.31.9 → 0.31.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/patterns/LexicalEditor/LexicalEditor.d.ts +2 -2
- package/dist/patterns/LexicalEditor/LexicalEditor.js +1 -1
- package/dist/patterns/LexicalEditor/Plugins.d.ts +1 -1
- package/dist/patterns/LexicalEditor/Plugins.js +1 -1
- package/dist/patterns/LexicalEditor/nodes/ImageComponent.js +2 -1
- package/package.json +1 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { SerializedEditorState, SerializedLexicalNode } from "lexical";
|
|
3
3
|
export interface LexicalEditorProps {
|
|
4
4
|
className?: string;
|
|
5
|
-
value
|
|
6
|
-
onChange
|
|
5
|
+
value?: any;
|
|
6
|
+
onChange?: (blocks: SerializedEditorState<SerializedLexicalNode>) => void;
|
|
7
7
|
/** editable. 수정 모드 / 읽기 모드 여부
|
|
8
8
|
* initialConfig에 전달되므로 마운트 된 이후 수정해도 반영되지 않음
|
|
9
9
|
*/
|
|
@@ -32,7 +32,7 @@ export function LexicalEditor(props) {
|
|
|
32
32
|
HorizontalRuleNode,
|
|
33
33
|
],
|
|
34
34
|
theme: getTheme(theme),
|
|
35
|
-
editorState: JSON.stringify(value),
|
|
35
|
+
editorState: value ? JSON.stringify(value) : undefined,
|
|
36
36
|
editable: editable,
|
|
37
37
|
};
|
|
38
38
|
return (_jsxs(LexicalComposer, Object.assign({ initialConfig: initialConfig }, { children: [_jsx(Plugins, { className: className, onChange: onChange }), _jsx(_Fragment, { children: children })] })));
|
|
@@ -6,6 +6,6 @@ import { ReactElement } from "react";
|
|
|
6
6
|
import { SerializedEditorState, SerializedLexicalNode } from "lexical";
|
|
7
7
|
export interface PluginsProps {
|
|
8
8
|
className?: string;
|
|
9
|
-
onChange
|
|
9
|
+
onChange?: (blocks: SerializedEditorState<SerializedLexicalNode>) => void;
|
|
10
10
|
}
|
|
11
11
|
export default function Plugins(props: PluginsProps): ReactElement;
|
|
@@ -38,7 +38,7 @@ export default function Plugins(props) {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
return (_jsxs(_Fragment, { children: [_jsx(RichTextPlugin, { contentEditable: _jsx(ScrollArea, Object.assign({ className: className }, { children: _jsx(FloatingAnchor, Object.assign({ ref: onRef }, { children: _jsx(StyledContentEditable, { isEditable: isEditable }) })) })), placeholder: null, ErrorBoundary: LexicalErrorBoundary }), _jsx(OnChangePlugin, { onChange: (editorState) => {
|
|
41
|
-
onChange(editorState.toJSON());
|
|
41
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(editorState.toJSON());
|
|
42
42
|
},
|
|
43
43
|
// ignore 하지 않으면 Form에서 수정하지 않았는데 Dirty로 처리됨.
|
|
44
44
|
ignoreSelectionChange: true }), _jsx(AutoFocusPlugin, {}), isEditable && (_jsxs(_Fragment, { children: [_jsx(TabIndentationPlugin, {}), _jsx(ComponentPickerMenuPlugin, {}), _jsx(MarkdownShortcutPlugin, { transformers: CODLE_TRANSFORMERS }), _jsx(HistoryPlugin, {})] })), floatingAnchorElem && isEditable && (_jsxs(_Fragment, { children: [_jsx(ComponentAdderPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingTextFormatToolbarPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingLinkEditorPlugin, { anchorElem: floatingAnchorElem, isLinkEditMode: isLinkEditMode, setIsLinkEditMode: setIsLinkEditMode })] })), !isEditable && _jsx(LexicalClickableLinkPlugin, {}), _jsx(ListPlugin, {}), _jsx(HorizontalRulePlugin, {}), _jsx(ImagesPlugin, {}), _jsx(TablePlugin, {}), _jsx(LinkPlugin, {}), _jsx(ListMaxIndentLevelPlugin, { maxDepth: 5 })] }));
|
|
@@ -23,7 +23,8 @@ function LazyImage({ altText, className, imageRef, src, width, height, maxWidth,
|
|
|
23
23
|
useSuspenseImage(src);
|
|
24
24
|
return (_jsx("img", { className: className || undefined, src: src, alt: altText, ref: imageRef, style: {
|
|
25
25
|
height,
|
|
26
|
-
|
|
26
|
+
// 이미지로 인해 좌우로 스크롤이 생기는 것을 방지
|
|
27
|
+
maxWidth: `min(${maxWidth}px, 100%)`,
|
|
27
28
|
width,
|
|
28
29
|
}, draggable: "false" }));
|
|
29
30
|
}
|