@seafile/sdoc-editor 2.0.94 → 2.0.95
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.
|
@@ -196,11 +196,6 @@ var EditableArticle = function EditableArticle(_ref) {
|
|
|
196
196
|
|
|
197
197
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
198
198
|
}, [scrollRef]);
|
|
199
|
-
var onCompositionEnd = (0, _react.useCallback)(function (event) {
|
|
200
|
-
if (event.data && _commonUtils.isMobile) {
|
|
201
|
-
editor.insertText(event.data);
|
|
202
|
-
}
|
|
203
|
-
}, []);
|
|
204
199
|
var handleScrollIntoView = (0, _react.useCallback)(function (editor, domRange) {
|
|
205
200
|
try {
|
|
206
201
|
var selection = editor.selection;
|
|
@@ -241,7 +236,6 @@ var EditableArticle = function EditableArticle(_ref) {
|
|
|
241
236
|
onCut: eventProxy.onCut,
|
|
242
237
|
onCopy: eventProxy.onCopy,
|
|
243
238
|
onCompositionStart: eventProxy.onCompositionStart,
|
|
244
|
-
onCompositionEnd: onCompositionEnd,
|
|
245
239
|
id: "sdoc-editor",
|
|
246
240
|
"aria-label": "textbox"
|
|
247
241
|
})), /*#__PURE__*/_react["default"].createElement(_extension.SideToolbar, null), showComment && /*#__PURE__*/_react["default"].createElement(_comment["default"], {
|
|
@@ -12,6 +12,7 @@ var withSocketIO = function withSocketIO(editor, options) {
|
|
|
12
12
|
var onChange = editor.onChange;
|
|
13
13
|
var newEditor = editor;
|
|
14
14
|
var socketManager = null;
|
|
15
|
+
var lastOperations = null;
|
|
15
16
|
var user = options.config.user;
|
|
16
17
|
newEditor.user = user;
|
|
17
18
|
newEditor.openConnection = function () {
|
|
@@ -30,6 +31,11 @@ var withSocketIO = function withSocketIO(editor, options) {
|
|
|
30
31
|
var document = options.document,
|
|
31
32
|
config = options.config;
|
|
32
33
|
var operations = newEditor.operations;
|
|
34
|
+
// mobile: If the operation is exactly the same as the previous one, return directly
|
|
35
|
+
if (JSON.stringify(operations) === JSON.stringify(lastOperations)) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
lastOperations = operations;
|
|
33
39
|
if (!newEditor.isRemote && operations.length > 0) {
|
|
34
40
|
var isAllSetSelection = operations.every(function (operation) {
|
|
35
41
|
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.95",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "bdaa45d04ea4395c841fbdf07b5588d79324d3a3"
|
|
74
74
|
}
|