@seafile/sdoc-editor 3.0.19 → 3.0.20

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.
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports["default"] = void 0;
8
+ var _slate = require("@seafile/slate");
8
9
  var _deepCopy = _interopRequireDefault(require("deep-copy"));
9
10
  var _helper = require("../cursor/helper");
10
11
  var _eventBus = _interopRequireDefault(require("../utils/event-bus"));
@@ -49,7 +50,23 @@ var withSocketIO = function withSocketIO(editor, options) {
49
50
  });
50
51
  _socketManager.onReceiveLocalOperations(updateOperations);
51
52
  }
52
- _socketManager.sendCursorLocation(editor.selection);
53
+
54
+ // Initially collapse the collaborator‘s selections to start point
55
+ var newCursor = editor.selection;
56
+ var _editor$selection = editor.selection,
57
+ anchor = _editor$selection.anchor,
58
+ focus = _editor$selection.focus;
59
+ if (!_slate.Point.equals(anchor, focus)) {
60
+ var frontPoint = _slate.Editor.start(editor, {
61
+ anchor: anchor,
62
+ focus: focus
63
+ });
64
+ newCursor = {
65
+ anchor: frontPoint,
66
+ focus: frontPoint
67
+ };
68
+ }
69
+ _socketManager.sendCursorLocation(newCursor);
53
70
  }
54
71
 
55
72
  // dispatch editor change event
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "3.0.19",
3
+ "version": "3.0.20",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -19,7 +19,7 @@
19
19
  "dependencies": {
20
20
  "@seafile/comment-editor": "1.0.1",
21
21
  "@seafile/print-js": "1.6.6",
22
- "@seafile/react-image-lightbox": "^5.0.0",
22
+ "@seafile/react-image-lightbox": "^5.0.1",
23
23
  "@seafile/slate": "0.91.8",
24
24
  "@seafile/slate-history": "0.86.2",
25
25
  "@seafile/slate-hyperscript": "0.81.7",
@@ -71,5 +71,5 @@
71
71
  "publishConfig": {
72
72
  "access": "public"
73
73
  },
74
- "gitHead": "b907c4b69345ee5af6ea3ac848af17066826b568"
74
+ "gitHead": "5a3ddcce75b3a16e0c8bd28e8461a139fbca0898"
75
75
  }