@textbus/collaborate 3.0.0-alpha.54 → 3.0.0-alpha.56

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.
@@ -353,7 +353,7 @@ let Collaborate = class Collaborate {
353
353
  this.syncComponentState(sharedComponent, component);
354
354
  slot.insert(component);
355
355
  }
356
- if (this.selection.isSelected) {
356
+ if (this.selection.isSelected && tr.origin !== this.manager) {
357
357
  if (slot === this.selection.anchorSlot && this.selection.anchorOffset > index) {
358
358
  this.selection.setAnchor(slot, this.selection.anchorOffset + length);
359
359
  }
@@ -364,9 +364,8 @@ let Collaborate = class Collaborate {
364
364
  }
365
365
  else if (action.delete) {
366
366
  const index = slot.index;
367
- slot.retain(slot.index);
368
367
  slot.delete(action.delete);
369
- if (this.selection.isSelected) {
368
+ if (this.selection.isSelected && tr.origin !== this.manager) {
370
369
  if (slot === this.selection.anchorSlot && this.selection.anchorOffset >= index) {
371
370
  this.selection.setAnchor(slot, this.selection.startOffset - action.delete);
372
371
  }
package/bundles/index.js CHANGED
@@ -355,7 +355,7 @@ exports.Collaborate = class Collaborate {
355
355
  this.syncComponentState(sharedComponent, component);
356
356
  slot.insert(component);
357
357
  }
358
- if (this.selection.isSelected) {
358
+ if (this.selection.isSelected && tr.origin !== this.manager) {
359
359
  if (slot === this.selection.anchorSlot && this.selection.anchorOffset > index) {
360
360
  this.selection.setAnchor(slot, this.selection.anchorOffset + length);
361
361
  }
@@ -366,9 +366,8 @@ exports.Collaborate = class Collaborate {
366
366
  }
367
367
  else if (action.delete) {
368
368
  const index = slot.index;
369
- slot.retain(slot.index);
370
369
  slot.delete(action.delete);
371
- if (this.selection.isSelected) {
370
+ if (this.selection.isSelected && tr.origin !== this.manager) {
372
371
  if (slot === this.selection.anchorSlot && this.selection.anchorOffset >= index) {
373
372
  this.selection.setAnchor(slot, this.selection.startOffset - action.delete);
374
373
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/collaborate",
3
- "version": "3.0.0-alpha.54",
3
+ "version": "3.0.0-alpha.56",
4
4
  "description": "Textbus is a rich text editor and framework that is highly customizable and extensible to achieve rich wysiwyg effects.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "@tanbo/di": "^1.1.4",
29
29
  "@tanbo/stream": "^1.1.9",
30
- "@textbus/core": "^3.0.0-alpha.54",
30
+ "@textbus/core": "^3.0.0-alpha.56",
31
31
  "reflect-metadata": "^0.1.13",
32
32
  "y-protocols": "^1.0.5",
33
33
  "yjs": "^13.5.39"
@@ -50,5 +50,5 @@
50
50
  "bugs": {
51
51
  "url": "https://github.com/textbus/textbus.git/issues"
52
52
  },
53
- "gitHead": "6f100a7b1704dd8f97f172a26ed0fa25e25bb79e"
53
+ "gitHead": "3aac2e89aea2760d540786b741a0eda211a35d81"
54
54
  }