@team-monolith/cds 1.63.1 → 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?: any;
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((_) => "---").join(" | ")} |`);
82
+ output.push(`| ${rowOutput.map(() => "---").join(" | ")} |`);
83
83
  }
84
84
  }
85
85
  return output.join("\n");
@@ -177,11 +177,11 @@ const mapToTableCells = (textContent) => {
177
177
  const SHEET_INPUT = {
178
178
  type: "element",
179
179
  dependencies: [SheetInputNode],
180
- export: (node, traverseChildren) => {
180
+ export: (node) => {
181
181
  if (!$isSheetInputNode(node)) {
182
182
  return null;
183
183
  }
184
- return "```\n" + node.getValue() + "```\n";
184
+ return "```\n" + node.getValue() + "\n```\n";
185
185
  },
186
186
  // replace는 사실 상 구현하지 않습니다.
187
187
  // 따라서 regExp도 절대 검색되지 않는 값으로 설정합니다.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.63.1",
3
+ "version": "1.63.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,