@textbus/platform-browser 5.0.0-alpha.13 → 5.0.0-alpha.15

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.
@@ -552,8 +552,8 @@ let SelectionBridge = class SelectionBridge {
552
552
  nativeRange.collapse();
553
553
  return getLayoutRectByRange(nativeRange);
554
554
  }
555
- restore(abstractSelection, formLocal) {
556
- this.changeFromUser = formLocal;
555
+ restore(abstractSelection, fromLocal) {
556
+ this.changeFromUser = fromLocal;
557
557
  if (this.ignoreSelectionChange || !this.connector) {
558
558
  return;
559
559
  }
@@ -611,6 +611,10 @@ let SelectionBridge = class SelectionBridge {
611
611
  this.listen(this.connector);
612
612
  }
613
613
  };
614
+ if (fromLocal) {
615
+ Promise.resolve().then(bind);
616
+ return;
617
+ }
614
618
  if (typeof requestIdleCallback === 'function') {
615
619
  requestIdleCallback(bind);
616
620
  }
@@ -803,7 +807,7 @@ let SelectionBridge = class SelectionBridge {
803
807
  isUpdating = true;
804
808
  }), this.scheduler.onDocChanged.pipe(delay()).subscribe(() => {
805
809
  isUpdating = false;
806
- }), fromEvent(document, 'selectionchange').pipe().subscribe(() => {
810
+ }), fromEvent(document, 'selectionchange').subscribe(() => {
807
811
  if (isUpdating) {
808
812
  return;
809
813
  }
package/bundles/index.js CHANGED
@@ -554,8 +554,8 @@ exports.SelectionBridge = class SelectionBridge {
554
554
  nativeRange.collapse();
555
555
  return getLayoutRectByRange(nativeRange);
556
556
  }
557
- restore(abstractSelection, formLocal) {
558
- this.changeFromUser = formLocal;
557
+ restore(abstractSelection, fromLocal) {
558
+ this.changeFromUser = fromLocal;
559
559
  if (this.ignoreSelectionChange || !this.connector) {
560
560
  return;
561
561
  }
@@ -613,6 +613,10 @@ exports.SelectionBridge = class SelectionBridge {
613
613
  this.listen(this.connector);
614
614
  }
615
615
  };
616
+ if (fromLocal) {
617
+ Promise.resolve().then(bind);
618
+ return;
619
+ }
616
620
  if (typeof requestIdleCallback === 'function') {
617
621
  requestIdleCallback(bind);
618
622
  }
@@ -805,7 +809,7 @@ exports.SelectionBridge = class SelectionBridge {
805
809
  isUpdating = true;
806
810
  }), this.scheduler.onDocChanged.pipe(stream.delay()).subscribe(() => {
807
811
  isUpdating = false;
808
- }), stream.fromEvent(document, 'selectionchange').pipe().subscribe(() => {
812
+ }), stream.fromEvent(document, 'selectionchange').subscribe(() => {
809
813
  if (isUpdating) {
810
814
  return;
811
815
  }
@@ -30,7 +30,7 @@ export declare class SelectionBridge implements NativeSelectionBridge {
30
30
  connect(connector: NativeSelectionConnector): void;
31
31
  disConnect(): void;
32
32
  getRect(location: SelectionPosition): Rect | null;
33
- restore(abstractSelection: AbstractSelection | null, formLocal: boolean): void;
33
+ restore(abstractSelection: AbstractSelection | null, fromLocal: boolean): void;
34
34
  destroy(): void;
35
35
  getPositionByRange(abstractSelection: AbstractSelection): {
36
36
  focus: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/platform-browser",
3
- "version": "5.0.0-alpha.13",
3
+ "version": "5.0.0-alpha.15",
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",
@@ -26,8 +26,8 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@tanbo/stream": "^1.2.7",
29
- "@textbus/core": "^5.0.0-alpha.13",
30
- "@viewfly/core": "^2.0.0-alpha.3"
29
+ "@textbus/core": "^5.0.0-alpha.14",
30
+ "@viewfly/core": "^2.0.0-alpha.6"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@rollup/plugin-commonjs": "^28.0.2",
@@ -47,5 +47,5 @@
47
47
  "bugs": {
48
48
  "url": "https://github.com/textbus/textbus.git/issues"
49
49
  },
50
- "gitHead": "f1a791231a3a855ff9558ea7413f8479dcb23cf3"
50
+ "gitHead": "0f3c64c5c6105a2e4207ab772e64d3acb801d22a"
51
51
  }