@team-monolith/cds 1.4.0 → 1.4.2

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.
@@ -39,7 +39,7 @@ export default function Plugins(props) {
39
39
  };
40
40
  return (_jsxs(_Fragment, { children: [_jsx(RichTextPlugin, { contentEditable: _jsx(ScrollArea, { children: _jsx(FloatingAnchor, Object.assign({ ref: onRef }, { children: _jsx(StyledContentEditable, {}) })) }), placeholder: _jsx("div", { children: "\uB0B4\uC6A9\uC744 \uC785\uB825 \uD574 \uC8FC\uC138\uC694." }), ErrorBoundary: LexicalErrorBoundary }), _jsx(OnChangePlugin, { onChange: (editorState) => {
41
41
  onChange(editorState.toJSON());
42
- } }), _jsx(HistoryPlugin, {}), _jsx(AutoFocusPlugin, {}), floatingAnchorElem && (_jsxs(_Fragment, { children: [_jsx(ComponentAdderPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingTextFormatToolbarPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingLinkEditorPlugin, { anchorElem: floatingAnchorElem, isLinkEditMode: isLinkEditMode, setIsLinkEditMode: setIsLinkEditMode })] })), !isEditable && _jsx(LexicalClickableLinkPlugin, {}), _jsx(MarkdownShortcutPlugin, { transformers: CODLE_TRANSFORMERS }), _jsx(ComponentPickerMenuPlugin, {}), _jsx(ListPlugin, {}), _jsx(TabIndentationPlugin, {}), _jsx(HorizontalRulePlugin, {}), _jsx(ImagesPlugin, {}), _jsx(TablePlugin, {}), _jsx(LinkPlugin, {}), _jsx(ListMaxIndentLevelPlugin, { maxDepth: 5 })] }));
42
+ } }), _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 })] }));
43
43
  }
44
44
  const ScrollArea = styled.div `
45
45
  min-height: 150px;
@@ -1,2 +1,3 @@
1
1
  export * from "./LexicalEditor";
2
2
  export * from "./nodes/ImageNode";
3
+ export * from "./plugins/MarkdownTransformers";
@@ -1,2 +1,3 @@
1
1
  export * from "./LexicalEditor";
2
2
  export * from "./nodes/ImageNode";
3
+ export * from "./plugins/MarkdownTransformers";
@@ -74,7 +74,14 @@ export function ComponentAdderPlugin(props) {
74
74
  const nodes = selection.getNodes();
75
75
  const isAllNodesNotMatched = nodes.every((node) => {
76
76
  const nodeAndParents = [node, ...node.getParents()];
77
- return (nodeAndParents[nodeAndParents.length - 2].getKey() !== nodeKey);
77
+ const maybeTopNode = nodeAndParents[nodeAndParents.length - 2];
78
+ // 선택된 노드 자체가 Root Node라면
79
+ // maybeTopNode가 undefined가 됩니다.
80
+ // 다른 노드를 선택한 것으로 간주하고 true(not matched)를 반환합니다.
81
+ if (!maybeTopNode) {
82
+ return true;
83
+ }
84
+ return maybeTopNode.getKey() !== nodeKey;
78
85
  });
79
86
  if (isAllNodesNotMatched) {
80
87
  setQuery("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,