@seafile/sdoc-editor 2.0.142 → 2.0.144
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.
|
@@ -245,15 +245,33 @@ var insertHtmlTransferredNodes = exports.insertHtmlTransferredNodes = function i
|
|
|
245
245
|
// Insert paragraph nodes
|
|
246
246
|
if (childNode.type === _constants.PARAGRAPH) {
|
|
247
247
|
if (childNode.children.length > 1) {
|
|
248
|
-
|
|
249
|
-
|
|
248
|
+
// Temporary array: Merge links and adjacent content
|
|
249
|
+
var currentParagraphChildren = [];
|
|
250
|
+
childNode.children.forEach(function (textNode) {
|
|
251
|
+
var _textNode$text;
|
|
252
|
+
if (textNode.type !== 'link' && !(textNode !== null && textNode !== void 0 && (_textNode$text = textNode.text) !== null && _textNode$text !== void 0 && _textNode$text.trim())) {
|
|
253
|
+
if (currentParagraphChildren.length > 0) {
|
|
254
|
+
var p = (0, _core.generateEmptyElement)(_constants.PARAGRAPH);
|
|
255
|
+
p.children = [].concat(currentParagraphChildren);
|
|
256
|
+
_slate.Transforms.insertNodes(editor, p, {
|
|
257
|
+
at: nextPath
|
|
258
|
+
});
|
|
259
|
+
nextPath = _slate.Path.next(nextPath);
|
|
260
|
+
currentParagraphChildren.length = 0;
|
|
261
|
+
}
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
currentParagraphChildren.push(textNode);
|
|
265
|
+
});
|
|
266
|
+
// Process the remaining nodes after traversal is completed
|
|
267
|
+
if (currentParagraphChildren.length > 0) {
|
|
250
268
|
var p = (0, _core.generateEmptyElement)(_constants.PARAGRAPH);
|
|
251
|
-
p.children
|
|
269
|
+
p.children = currentParagraphChildren;
|
|
252
270
|
_slate.Transforms.insertNodes(editor, p, {
|
|
253
271
|
at: nextPath
|
|
254
272
|
});
|
|
255
273
|
nextPath = _slate.Path.next(nextPath);
|
|
256
|
-
}
|
|
274
|
+
}
|
|
257
275
|
} else {
|
|
258
276
|
_slate.Transforms.insertNodes(editor, childNode, {
|
|
259
277
|
at: nextPath
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = void 0;
|
|
8
|
+
var _deepCopy = _interopRequireDefault(require("deep-copy"));
|
|
8
9
|
var _helper = require("../cursor/helper");
|
|
9
10
|
var _eventBus = _interopRequireDefault(require("../utils/event-bus"));
|
|
10
11
|
var _socketManager2 = _interopRequireDefault(require("./socket-manager"));
|
|
@@ -35,7 +36,7 @@ var withSocketIO = function withSocketIO(editor, options) {
|
|
|
35
36
|
if (JSON.stringify(operations) === JSON.stringify(lastOperations)) {
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
|
-
lastOperations = operations;
|
|
39
|
+
lastOperations = (0, _deepCopy["default"])(operations);
|
|
39
40
|
if (!newEditor.isRemote && operations.length > 0) {
|
|
40
41
|
var isAllSetSelection = operations.every(function (operation) {
|
|
41
42
|
return operation.type === 'set_selection';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.144",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"license": "ISC",
|
|
18
18
|
"description": "",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@seafile/comment-editor": "
|
|
20
|
+
"@seafile/comment-editor": "0.0.7",
|
|
21
21
|
"@seafile/print-js": "1.6.6",
|
|
22
22
|
"@seafile/react-image-lightbox": "4.0.2",
|
|
23
23
|
"@seafile/slate": "0.91.8",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "78d3e159dd5dc5d5d2339f6d93ceedecfa21ba61"
|
|
75
75
|
}
|