@lobehub/editor 2.2.0 → 3.1.0
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.
|
@@ -21,9 +21,14 @@ export var useEditable = function useEditable() {
|
|
|
21
21
|
var updateEditable = function updateEditable(newEditable) {
|
|
22
22
|
setEditable(newEditable);
|
|
23
23
|
};
|
|
24
|
+
var handleInitialized = function handleInitialized() {
|
|
25
|
+
setEditable(editor.isEditable());
|
|
26
|
+
};
|
|
24
27
|
editor.on('editableChange', updateEditable);
|
|
28
|
+
editor.on('initialized', handleInitialized);
|
|
25
29
|
return function () {
|
|
26
30
|
editor.off('editableChange', updateEditable);
|
|
31
|
+
editor.off('initialized', handleInitialized);
|
|
27
32
|
};
|
|
28
33
|
}, [editor]);
|
|
29
34
|
return {
|
|
@@ -195,7 +195,7 @@ var LinkEdit = /*#__PURE__*/memo(function (_ref) {
|
|
|
195
195
|
}
|
|
196
196
|
return false;
|
|
197
197
|
}, COMMAND_PRIORITY_NORMAL));
|
|
198
|
-
}, []);
|
|
198
|
+
}, [editor]);
|
|
199
199
|
if (!linkNodeRef.current || !editable) return null;
|
|
200
200
|
return /*#__PURE__*/_jsxs(Block, {
|
|
201
201
|
className: styles.linkEdit,
|
|
@@ -106,6 +106,7 @@ var LinkToolbar = /*#__PURE__*/memo(function (_ref) {
|
|
|
106
106
|
var node = getSelectedNode(selection);
|
|
107
107
|
var parent = node.getParent();
|
|
108
108
|
var isLink = $isLinkNode(parent) || $isLinkNode(node);
|
|
109
|
+
if (isLink === state.current.isLink) return;
|
|
109
110
|
state.current.isLink = isLink;
|
|
110
111
|
if (isLink) {
|
|
111
112
|
var _linkNode = $isLinkNode(parent) ? parent : node;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/editor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@shikijs/engine-javascript": "^3.20.0",
|
|
46
46
|
"@xmldom/xmldom": "^0.8.11",
|
|
47
47
|
"ahooks": "^3.9.6",
|
|
48
|
-
"antd-style": "^
|
|
48
|
+
"antd-style": "^4.0.0",
|
|
49
49
|
"debug": "^4.4.3",
|
|
50
50
|
"eventemitter3": "^5.0.1",
|
|
51
51
|
"fuse.js": "^7.1.0",
|
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
"lexical": "^0.39.0",
|
|
54
54
|
"lodash-es": "^4.17.22",
|
|
55
55
|
"lucide-react": "^0.562.0",
|
|
56
|
-
"motion": "^12.23.26",
|
|
57
56
|
"polished": "^4.3.1",
|
|
58
57
|
"re-resizable": "^6.11.2",
|
|
59
58
|
"react-error-boundary": "^6.0.0",
|
|
@@ -65,8 +64,9 @@
|
|
|
65
64
|
"use-merge-value": "^1.2.0"
|
|
66
65
|
},
|
|
67
66
|
"peerDependencies": {
|
|
68
|
-
"@lobehub/ui": "^
|
|
67
|
+
"@lobehub/ui": "^4.0.0",
|
|
69
68
|
"antd": "^6.1.1",
|
|
69
|
+
"motion": "^12.0.0",
|
|
70
70
|
"react": "^19.0.0",
|
|
71
71
|
"react-dom": "^19.0.0"
|
|
72
72
|
}
|