@team-monolith/cds 1.4.7 → 1.4.8

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.
@@ -11,4 +11,4 @@ export interface LexicalEditorProps {
11
11
  /** 외부에서 플러그인을 주입하는 경우 활용함 */
12
12
  children?: JSX.Element | string | (JSX.Element | string)[];
13
13
  }
14
- export declare function LexicalEditor(props: LexicalEditorProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function LexicalEditor(props: LexicalEditorProps): JSX.Element;
@@ -10,6 +10,22 @@ import { HorizontalRuleNode } from "@lexical/react/LexicalHorizontalRuleNode";
10
10
  import { getTheme } from "./theme";
11
11
  import { useTheme } from "@emotion/react";
12
12
  import Plugins from "./Plugins";
13
+ function validateValue(value) {
14
+ var _a, _b;
15
+ if (value && typeof value !== "object") {
16
+ return false;
17
+ }
18
+ // value = {
19
+ // root: {
20
+ // children: any[]
21
+ // }
22
+ // }
23
+ // value.root.children must be non-empty array
24
+ if (!((_b = (_a = value === null || value === void 0 ? void 0 : value.root) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.length)) {
25
+ return false;
26
+ }
27
+ return true;
28
+ }
13
29
  export function LexicalEditor(props) {
14
30
  const { className, value, onChange, editable = true, children } = props;
15
31
  const theme = useTheme();
@@ -32,7 +48,7 @@ export function LexicalEditor(props) {
32
48
  HorizontalRuleNode,
33
49
  ],
34
50
  theme: getTheme(theme),
35
- editorState: value ? JSON.stringify(value) : undefined,
51
+ editorState: validateValue(value) ? JSON.stringify(value) : undefined,
36
52
  editable: editable,
37
53
  };
38
54
  return (_jsxs(LexicalComposer, Object.assign({ initialConfig: initialConfig }, { children: [_jsx(Plugins, { className: className, onChange: onChange }), _jsx(_Fragment, { children: children })] })));
@@ -1,7 +1,8 @@
1
+ /// <reference types="react" />
1
2
  import { LexicalEditor } from "lexical";
2
3
  export interface InsertImageDialogProps {
3
4
  open: boolean;
4
5
  activeEditor: LexicalEditor;
5
6
  onClose: () => void;
6
7
  }
7
- export declare function InsertImageDialog(props: InsertImageDialogProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function InsertImageDialog(props: InsertImageDialogProps): JSX.Element;
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { InsertImagePayload } from ".";
2
3
  export interface InsertImageUploadedDialogBodyProps {
3
4
  onClick: (payload: InsertImagePayload) => void;
4
5
  }
5
- export declare function InsertImageUploadedDialogBody(props: InsertImageUploadedDialogBodyProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function InsertImageUploadedDialogBody(props: InsertImageUploadedDialogBodyProps): JSX.Element;
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { InsertImagePayload } from ".";
2
3
  export interface InsertImageUriDialogBodyProps {
3
4
  onClick: (payload: InsertImagePayload) => void;
4
5
  }
5
- export declare function InsertImageUriDialogBody(props: InsertImageUriDialogBodyProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function InsertImageUriDialogBody(props: InsertImageUriDialogBodyProps): JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { EditorCore } from "@react-editor-js/core";
2
3
  export interface ReactEditorJSProps {
3
4
  className?: string;
@@ -12,4 +13,4 @@ export interface ReactEditorJSProps {
12
13
  /** 초기화시 콜백 */
13
14
  onInitialize?: (instance: EditorCore) => void;
14
15
  }
15
- export declare function ReactEditorJS(props: ReactEditorJSProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function ReactEditorJS(props: ReactEditorJSProps): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,