@seafile/sdoc-editor 2.0.189 → 2.0.190
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.
|
@@ -65,23 +65,9 @@ var EditableArticle = function EditableArticle(_ref) {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
// Remove linked block overlay style when operating
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return n.linked_block === true;
|
|
72
|
-
}
|
|
73
|
-
}),
|
|
74
|
-
_Editor$nodes2 = (0, _slicedToArray2["default"])(_Editor$nodes, 1),
|
|
75
|
-
linkedNodeEntry = _Editor$nodes2[0];
|
|
76
|
-
if (linkedNodeEntry) {
|
|
77
|
-
var _linkedNodeEntry = (0, _slicedToArray2["default"])(linkedNodeEntry, 2),
|
|
78
|
-
node = _linkedNodeEntry[0],
|
|
79
|
-
path = _linkedNodeEntry[1];
|
|
80
|
-
var linkedDomNode = _slateReact.ReactEditor.toDOMNode(editor, node);
|
|
81
|
-
linkedDomNode.classList.remove('linked-block-highlight-overlay');
|
|
82
|
-
_slate.Transforms.unsetNodes(editor, ['linked_block'], {
|
|
83
|
-
at: path
|
|
84
|
-
});
|
|
68
|
+
var highlightedNode = document.querySelector('.linked-block-highlight-overlay');
|
|
69
|
+
if (highlightedNode) {
|
|
70
|
+
highlightedNode.classList.remove('linked-block-highlight-overlay');
|
|
85
71
|
}
|
|
86
72
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
73
|
}, []);
|
|
@@ -354,14 +340,14 @@ var EditableArticle = function EditableArticle(_ref) {
|
|
|
354
340
|
editor.oldSelection = (0, _objectSpread2["default"])({}, selection);
|
|
355
341
|
|
|
356
342
|
// Do not scroll into view, when focus on image
|
|
357
|
-
var _Editor$
|
|
343
|
+
var _Editor$nodes = _slate.Editor.nodes(editor, {
|
|
358
344
|
match: function match(n) {
|
|
359
345
|
return [_constants2.IMAGE, _constants2.IMAGE_BLOCK].includes(n.type);
|
|
360
346
|
},
|
|
361
347
|
at: selection
|
|
362
348
|
}),
|
|
363
|
-
_Editor$
|
|
364
|
-
imageNodeEntry = _Editor$
|
|
349
|
+
_Editor$nodes2 = (0, _slicedToArray2["default"])(_Editor$nodes, 1),
|
|
350
|
+
imageNodeEntry = _Editor$nodes2[0];
|
|
365
351
|
if (imageNodeEntry) return;
|
|
366
352
|
var focusedNode = _slate.Node.get(editor, selection.focus.path);
|
|
367
353
|
var domNode = _slateReact.ReactEditor.toDOMNode(editor, focusedNode);
|
|
@@ -53,22 +53,17 @@ var LinkHover = function LinkHover(_ref) {
|
|
|
53
53
|
_Editor$nodes2 = (0, _slicedToArray2["default"])(_Editor$nodes, 1),
|
|
54
54
|
linkedNodeEntry = _Editor$nodes2[0];
|
|
55
55
|
if (linkedNodeEntry) {
|
|
56
|
-
var
|
|
57
|
-
node = _linkedNodeEntry[0],
|
|
58
|
-
path = _linkedNodeEntry[1];
|
|
56
|
+
var node = linkedNodeEntry[0];
|
|
59
57
|
var linkedDomNode = _slateReact.ReactEditor.toDOMNode(editor, node);
|
|
60
58
|
linkedDomNode.classList.add('linked-block-highlight-overlay');
|
|
61
|
-
_slate.Transforms.setNodes(editor, {
|
|
62
|
-
linked_block: true
|
|
63
|
-
}, {
|
|
64
|
-
at: path
|
|
65
|
-
});
|
|
66
59
|
|
|
67
60
|
// Scroll linked node to view if not in current view
|
|
68
61
|
if (!(0, _helpers.isNodeInCurrentView)(linkedDomNode)) {
|
|
69
62
|
linkedDomNode.scrollIntoView();
|
|
70
63
|
}
|
|
71
64
|
}
|
|
65
|
+
|
|
66
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
67
|
}, [linked_id]);
|
|
73
68
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react["default"].createElement("div", {
|
|
74
69
|
id: "link-op-menu",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.190",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "759cb457e2ad7e89ef7c4bcb94a539b7fc387136"
|
|
75
75
|
}
|