@team-monolith/cds 1.63.2 → 1.63.3
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.
|
@@ -3,7 +3,7 @@ import { SerializedEditorState, SerializedLexicalNode } from "lexical";
|
|
|
3
3
|
export interface LexicalEditorProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
contentEditableClassName?: string;
|
|
6
|
-
value?:
|
|
6
|
+
value?: SerializedEditorState<SerializedLexicalNode>;
|
|
7
7
|
onChange?: (blocks: SerializedEditorState<SerializedLexicalNode>) => void;
|
|
8
8
|
/** editable. 수정 모드 / 읽기 모드 여부
|
|
9
9
|
* initialConfig에 전달되므로 마운트 된 이후 수정해도 반영되지 않음
|
|
@@ -8,14 +8,6 @@ import { LexicalCustomConfigContext } from "./LexicalCustomConfigContext";
|
|
|
8
8
|
import _ from "lodash";
|
|
9
9
|
function validateValue(value) {
|
|
10
10
|
var _a, _b;
|
|
11
|
-
if (value && typeof value !== "object") {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
// value = {
|
|
15
|
-
// root: {
|
|
16
|
-
// children: any[]
|
|
17
|
-
// }
|
|
18
|
-
// }
|
|
19
11
|
// value.root.children must be non-empty array
|
|
20
12
|
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)) {
|
|
21
13
|
return false;
|
|
@@ -30,6 +22,9 @@ function isCleanlyEqual(oldObj, newObj) {
|
|
|
30
22
|
}
|
|
31
23
|
/** 객체 내에 undefined value를 갖는 key를 재귀적으로 모두 제거합니다. */
|
|
32
24
|
function getCleanObject(obj) {
|
|
25
|
+
if (!obj || typeof obj !== "object") {
|
|
26
|
+
return obj;
|
|
27
|
+
}
|
|
33
28
|
const newObj = Object.assign({}, obj);
|
|
34
29
|
for (const key in newObj) {
|
|
35
30
|
if (newObj[key] === undefined) {
|
|
@@ -50,7 +45,7 @@ export function LexicalEditor(props) {
|
|
|
50
45
|
nodes,
|
|
51
46
|
// 마운트 된 이후 editable 수정해도 theme에 반영되지 않음 유의
|
|
52
47
|
theme: getTheme(theme, editable),
|
|
53
|
-
editorState: validateValue(value) ? JSON.stringify(value) : undefined,
|
|
48
|
+
editorState: value && validateValue(value) ? JSON.stringify(value) : undefined,
|
|
54
49
|
editable: editable,
|
|
55
50
|
};
|
|
56
51
|
/** onChangeHandler 도입 배경
|
|
@@ -79,7 +79,7 @@ export const TABLE = {
|
|
|
79
79
|
}
|
|
80
80
|
output.push(`| ${rowOutput.join(" | ")} |`);
|
|
81
81
|
if (isHeaderRow) {
|
|
82
|
-
output.push(`| ${rowOutput.map((
|
|
82
|
+
output.push(`| ${rowOutput.map(() => "---").join(" | ")} |`);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
return output.join("\n");
|