@mdxeditor/editor 3.21.0 → 3.21.1

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.
@@ -162,6 +162,7 @@ const linkDialogState$ = Cell({ type: "inactive" }, (r) => {
162
162
  rectangle: getSelectionRectangle(activeEditor)
163
163
  };
164
164
  } else {
165
+ console.log("setting to inactive");
165
166
  return { type: "inactive" };
166
167
  }
167
168
  } else {
@@ -190,30 +191,32 @@ const openLinkEditDialog$ = Action((r) => {
190
191
  ),
191
192
  ([, selection, editor]) => {
192
193
  editor == null ? void 0 : editor.focus(() => {
193
- editor.getEditorState().read(() => {
194
- const node = getLinkNodeInSelection(selection);
195
- const rectangle = getSelectionRectangle(editor);
196
- if (node) {
197
- r.pub(linkDialogState$, {
198
- type: "edit",
199
- initialUrl: node.getURL(),
200
- initialTitle: node.getTitle() ?? "",
201
- url: node.getURL(),
202
- title: node.getTitle() ?? "",
203
- linkNodeKey: node.getKey(),
204
- rectangle
205
- });
206
- } else {
207
- r.pub(linkDialogState$, {
208
- type: "edit",
209
- initialUrl: "",
210
- initialTitle: "",
211
- title: "",
212
- url: "",
213
- linkNodeKey: "",
214
- rectangle
215
- });
216
- }
194
+ setTimeout(() => {
195
+ editor.getEditorState().read(() => {
196
+ const node = getLinkNodeInSelection(selection);
197
+ const rectangle = getSelectionRectangle(editor);
198
+ if (node) {
199
+ r.pub(linkDialogState$, {
200
+ type: "edit",
201
+ initialUrl: node.getURL(),
202
+ initialTitle: node.getTitle() ?? "",
203
+ url: node.getURL(),
204
+ title: node.getTitle() ?? "",
205
+ linkNodeKey: node.getKey(),
206
+ rectangle
207
+ });
208
+ } else {
209
+ r.pub(linkDialogState$, {
210
+ type: "edit",
211
+ initialUrl: "",
212
+ initialTitle: "",
213
+ title: "",
214
+ url: "",
215
+ linkNodeKey: "",
216
+ rectangle
217
+ });
218
+ }
219
+ });
217
220
  });
218
221
  });
219
222
  }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "*.css"
12
12
  ],
13
13
  "type": "module",
14
- "version": "3.21.0",
14
+ "version": "3.21.1",
15
15
  "description": "React component for rich text markdown editing",
16
16
  "scripts": {
17
17
  "build": "vite build",