@mdxeditor/editor 3.0.4 → 3.0.6
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.
|
@@ -522,10 +522,8 @@ const corePlugin = realmPlugin({
|
|
|
522
522
|
theme: lexicalTheme
|
|
523
523
|
});
|
|
524
524
|
newEditor.update(() => {
|
|
525
|
-
const markdown = params == null ? void 0 : params.initialMarkdown.trim();
|
|
526
|
-
|
|
527
|
-
tryImportingMarkdown(r, $getRoot(), markdown);
|
|
528
|
-
}
|
|
525
|
+
const markdown = (params == null ? void 0 : params.initialMarkdown.trim()) ?? "";
|
|
526
|
+
tryImportingMarkdown(r, $getRoot(), markdown);
|
|
529
527
|
const autoFocusValue = params == null ? void 0 : params.autoFocus;
|
|
530
528
|
if (autoFocusValue) {
|
|
531
529
|
if (autoFocusValue === true) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TOGGLE_LINK_COMMAND, $isLinkNode } from "@lexical/link";
|
|
1
|
+
import { $createLinkNode, TOGGLE_LINK_COMMAND, $isLinkNode } from "@lexical/link";
|
|
2
2
|
import { KEY_ESCAPE_COMMAND, COMMAND_PRIORITY_LOW, KEY_MODIFIER_COMMAND, $getSelection, $isRangeSelection, COMMAND_PRIORITY_HIGH, $createTextNode, $insertNodes } from "lexical";
|
|
3
3
|
import { IS_APPLE } from "../../utils/detectMac.js";
|
|
4
4
|
import { getSelectionRectangle, getSelectedNode } from "../../utils/lexicalHelpers.js";
|
|
@@ -89,15 +89,17 @@ const linkDialogState$ = Cell({ type: "inactive" }, (r) => {
|
|
|
89
89
|
editor == null ? void 0 : editor.update(
|
|
90
90
|
() => {
|
|
91
91
|
if (!getLinkNodeInSelection(selection)) {
|
|
92
|
-
const node = $
|
|
92
|
+
const node = $createLinkNode(url, { title });
|
|
93
|
+
node.append($createTextNode(linkContent));
|
|
93
94
|
$insertNodes([node]);
|
|
94
95
|
node.select();
|
|
95
96
|
}
|
|
96
97
|
},
|
|
97
98
|
{ discrete: true }
|
|
98
99
|
);
|
|
100
|
+
} else {
|
|
101
|
+
editor == null ? void 0 : editor.dispatchCommand(TOGGLE_LINK_COMMAND, { url, title });
|
|
99
102
|
}
|
|
100
|
-
editor == null ? void 0 : editor.dispatchCommand(TOGGLE_LINK_COMMAND, { url, title });
|
|
101
103
|
r.pub(linkDialogState$, {
|
|
102
104
|
type: "preview",
|
|
103
105
|
linkNodeKey: state.linkNodeKey,
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"*.css"
|
|
12
12
|
],
|
|
13
13
|
"type": "module",
|
|
14
|
-
"version": "3.0.
|
|
14
|
+
"version": "3.0.6",
|
|
15
15
|
"description": "React component for rich text markdown editing",
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "vite build",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dev": "LADLE=true ladle dev",
|
|
21
21
|
"typecheck": "tsc --noEmit",
|
|
22
22
|
"lint": "eslint src --ext .ts,.tsx",
|
|
23
|
-
"test": "vitest",
|
|
23
|
+
"test": "NODE_ENV=development vitest",
|
|
24
24
|
"semantic-release": "semantic-release",
|
|
25
25
|
"image-upload-backend": "node ./src/examples/file-backend.js"
|
|
26
26
|
},
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"@codemirror/state": "^6.4.0",
|
|
43
43
|
"@codemirror/view": "^6.23.0",
|
|
44
44
|
"@codesandbox/sandpack-react": "^2.10.0",
|
|
45
|
-
"@lexical/clipboard": "^0.14.
|
|
46
|
-
"@lexical/link": "^0.14.
|
|
47
|
-
"@lexical/list": "^0.14.
|
|
48
|
-
"@lexical/markdown": "^0.14.
|
|
49
|
-
"@lexical/plain-text": "^0.14.
|
|
50
|
-
"@lexical/react": "^0.14.
|
|
51
|
-
"@lexical/rich-text": "^0.14.
|
|
52
|
-
"@lexical/selection": "^0.14.
|
|
53
|
-
"@lexical/utils": "^0.14.
|
|
45
|
+
"@lexical/clipboard": "^0.14.5",
|
|
46
|
+
"@lexical/link": "^0.14.5",
|
|
47
|
+
"@lexical/list": "^0.14.5",
|
|
48
|
+
"@lexical/markdown": "^0.14.5",
|
|
49
|
+
"@lexical/plain-text": "^0.14.5",
|
|
50
|
+
"@lexical/react": "^0.14.5",
|
|
51
|
+
"@lexical/rich-text": "^0.14.5",
|
|
52
|
+
"@lexical/selection": "^0.14.5",
|
|
53
|
+
"@lexical/utils": "^0.14.5",
|
|
54
54
|
"@mdxeditor/gurx": "^1.1.1",
|
|
55
55
|
"@radix-ui/colors": "^3.0.0",
|
|
56
56
|
"@radix-ui/react-dialog": "^1.0.5",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"codemirror": "^6.0.1",
|
|
66
66
|
"downshift": "^7.6.0",
|
|
67
67
|
"js-yaml": "4.1.0",
|
|
68
|
-
"lexical": "^0.14.
|
|
68
|
+
"lexical": "^0.14.5",
|
|
69
69
|
"mdast-util-directive": "^3.0.0",
|
|
70
70
|
"mdast-util-from-markdown": "^2.0.0",
|
|
71
71
|
"mdast-util-frontmatter": "^2.0.1",
|