@mdxeditor/editor 3.44.1 → 3.44.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.
package/dist/index.d.ts CHANGED
@@ -1137,6 +1137,7 @@ export declare const editorInFocus$: NodeRef<EditorInFocus | null>;
1137
1137
  export declare interface EditorInFocus {
1138
1138
  editorType: string;
1139
1139
  rootNode: LexicalNode | null;
1140
+ editorRef: unknown;
1140
1141
  }
1141
1142
 
1142
1143
  /**
@@ -1169,7 +1170,7 @@ export declare const EmptyTextNodeIndex: TextNodeIndex;
1169
1170
 
1170
1171
  /* Excluded from this release type: ExportLexicalTreeOptions */
1171
1172
 
1172
- /* Excluded from this release type: exportLexicalTreeToMdast */
1173
+ export declare function exportLexicalTreeToMdast({ root, visitors, jsxComponentDescriptors, jsxIsAvailable, addImportStatements }: ExportLexicalTreeOptions): Mdast.Root;
1173
1174
 
1174
1175
  /* Excluded from this release type: exportMarkdownFromLexical */
1175
1176
 
@@ -1465,7 +1466,7 @@ export declare type ImageUploadHandler = ((image: File) => Promise<string>) | nu
1465
1466
 
1466
1467
  /* Excluded from this release type: importMarkdownToLexical */
1467
1468
 
1468
- /* Excluded from this release type: importMdastTreeToLexical */
1469
+ export declare function importMdastTreeToLexical({ root, mdastRoot, visitors, ...descriptors }: MdastTreeImportOptions): void;
1469
1470
 
1470
1471
  export declare interface ImportPoint {
1471
1472
  append(node: LexicalNode): void;
@@ -1706,7 +1707,7 @@ export declare function isMdastHTMLNode(node: Mdast.Nodes): node is MdastHTMLNod
1706
1707
  */
1707
1708
  export declare function isMdastJsxNode(node: Mdast.Nodes): node is MdastJsx;
1708
1709
 
1709
- /* Excluded from this release type: isPartOftheEditorUI */
1710
+ export declare function isPartOftheEditorUI(element: HTMLElement | null, editorRoot: HTMLElement): boolean;
1710
1711
 
1711
1712
  /**
1712
1713
  * returns a function which calls all passed functions in the passed order.
@@ -2341,7 +2342,7 @@ export declare const MultipleChoiceToggleGroup: default_2.FC<{
2341
2342
 
2342
2343
  export declare const muteChange$: NodeRef<boolean>;
2343
2344
 
2344
- /* Excluded from this release type: NESTED_EDITOR_UPDATED_COMMAND */
2345
+ export declare const NESTED_EDITOR_UPDATED_COMMAND: LexicalCommand<undefined>;
2345
2346
 
2346
2347
  /* Excluded from this release type: nestedEditorChildren$ */
2347
2348
 
@@ -133,7 +133,7 @@ const NestedLexicalEditor = function(props) {
133
133
  editor.registerCommand(
134
134
  FOCUS_COMMAND,
135
135
  () => {
136
- setEditorInFocus({ editorType: "lexical", rootNode: lexicalNode });
136
+ setEditorInFocus({ editorType: "lexical", rootNode: lexicalNode, editorRef: editor });
137
137
  return false;
138
138
  },
139
139
  COMMAND_PRIORITY_LOW
@@ -163,7 +163,7 @@ const NestedLexicalEditor = function(props) {
163
163
  editor.registerCommand(
164
164
  SELECTION_CHANGE_COMMAND,
165
165
  () => {
166
- setEditorInFocus({ editorType: "lexical", rootNode: lexicalNode });
166
+ setEditorInFocus({ editorType: "lexical", rootNode: lexicalNode, editorRef: editor });
167
167
  return false;
168
168
  },
169
169
  COMMAND_PRIORITY_HIGH
@@ -196,7 +196,9 @@ const activeEditorSubscriptions$ = Cell([], (r) => {
196
196
  const rootEditorSubscriptions$ = Cell([], (r) => {
197
197
  r.pipe(r.combine(rootEditorSubscriptions$, rootEditor$), rebind());
198
198
  });
199
- const editorInFocus$ = Cell(null);
199
+ const editorInFocus$ = Cell(null, noop, (prev, next) => {
200
+ return Boolean(prev && next && prev.editorRef === next.editorRef);
201
+ });
200
202
  const onBlur$ = Signal();
201
203
  const iconComponentFor$ = Cell((name) => {
202
204
  throw new Error(`No icon component for ${name}`);
@@ -241,7 +243,8 @@ const createRootEditorSubscription$ = Appender(rootEditorSubscriptions$, (r, sig
241
243
  theActiveEditor.getEditorState().read(() => {
242
244
  r.pub(editorInFocus$, {
243
245
  rootNode: $getRoot(),
244
- editorType: "lexical"
246
+ editorType: "lexical",
247
+ editorRef: theActiveEditor
245
248
  });
246
249
  });
247
250
  }
@@ -13,7 +13,8 @@ function useCodeMirrorRef(nodeKey, editorType, language, focusEmitter) {
13
13
  const onFocusHandler = React__default.useCallback(() => {
14
14
  setEditorInFocus({
15
15
  editorType,
16
- rootNode: lexicalNode
16
+ rootNode: lexicalNode,
17
+ editorRef: codeMirrorRef.current
17
18
  });
18
19
  }, [editorType, lexicalNode, setEditorInFocus]);
19
20
  const onKeyDownHandler = React__default.useCallback(
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "*.css"
12
12
  ],
13
13
  "type": "module",
14
- "version": "3.44.1",
14
+ "version": "3.44.3",
15
15
  "description": "React component for rich text markdown editing",
16
16
  "scripts": {
17
17
  "build": "vite build",
@@ -53,7 +53,7 @@
53
53
  "@lexical/rich-text": "^0.35.0",
54
54
  "@lexical/selection": "^0.35.0",
55
55
  "@lexical/utils": "^0.35.0",
56
- "@mdxeditor/gurx": "^1.1.4",
56
+ "@mdxeditor/gurx": "^1.2.4",
57
57
  "@radix-ui/colors": "^3.0.0",
58
58
  "@radix-ui/react-dialog": "^1.1.11",
59
59
  "@radix-ui/react-icons": "^1.3.2",