@textbus/platform-browser 4.5.0 → 5.0.0-alpha.1

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.
@@ -1,6 +1,6 @@
1
1
  import 'reflect-metadata';
2
- import { Slot, Textbus, Adapter, Controller, Selection, RootComponentRef, Scheduler, ContentType, Event, invokeListener, Keyboard, Commander, makeError, NativeSelectionBridge, FocusManager, Component, Registry } from '@textbus/core';
3
- import { Subject, filter, fromEvent, delay, Subscription, distinctUntilChanged, merge, map, Observable } from '@tanbo/stream';
2
+ import { Slot, Textbus, Adapter, Controller, Selection, RootComponentRef, ContentType, Event, invokeListener, Keyboard, Commander, Scheduler, makeError, NativeSelectionBridge, FocusManager, Component, Registry } from '@textbus/core';
3
+ import { Subject, filter, fromEvent, Subscription, distinctUntilChanged, merge, map, Observable } from '@tanbo/stream';
4
4
  import { InjectionToken, Injectable, Inject, Optional } from '@viewfly/core';
5
5
 
6
6
  function createElement(tagName, options = {}) {
@@ -383,7 +383,7 @@ class DomAdapter extends Adapter {
383
383
  * Textbus PC 端选区桥接实现
384
384
  */
385
385
  let SelectionBridge = class SelectionBridge {
386
- constructor(config, textbus, controller, selection, rootComponentRef, input, scheduler, domAdapter) {
386
+ constructor(config, textbus, controller, selection, rootComponentRef, input, domAdapter) {
387
387
  Object.defineProperty(this, "config", {
388
388
  enumerable: true,
389
389
  configurable: true,
@@ -408,12 +408,6 @@ let SelectionBridge = class SelectionBridge {
408
408
  writable: true,
409
409
  value: input
410
410
  });
411
- Object.defineProperty(this, "scheduler", {
412
- enumerable: true,
413
- configurable: true,
414
- writable: true,
415
- value: scheduler
416
- });
417
411
  Object.defineProperty(this, "domAdapter", {
418
412
  enumerable: true,
419
413
  configurable: true,
@@ -798,15 +792,7 @@ let SelectionBridge = class SelectionBridge {
798
792
  }
799
793
  }));
800
794
  }
801
- let isUpdating = false;
802
- this.subs.push(this.scheduler.onDocChange.subscribe(() => {
803
- isUpdating = true;
804
- }), this.scheduler.onDocChanged.pipe(delay()).subscribe(() => {
805
- isUpdating = false;
806
- }), fromEvent(document, 'selectionchange').pipe().subscribe(() => {
807
- if (isUpdating) {
808
- return;
809
- }
795
+ this.subs.push(fromEvent(document, 'selectionchange').pipe().subscribe(() => {
810
796
  if (this.syncSelectionFromNativeSelectionChange) {
811
797
  this.syncSelection(connector);
812
798
  }
@@ -1064,7 +1050,6 @@ SelectionBridge = __decorate([
1064
1050
  Selection,
1065
1051
  RootComponentRef,
1066
1052
  Input,
1067
- Scheduler,
1068
1053
  DomAdapter])
1069
1054
  ], SelectionBridge);
1070
1055
 
package/bundles/index.js CHANGED
@@ -385,7 +385,7 @@ class DomAdapter extends core$1.Adapter {
385
385
  * Textbus PC 端选区桥接实现
386
386
  */
387
387
  exports.SelectionBridge = class SelectionBridge {
388
- constructor(config, textbus, controller, selection, rootComponentRef, input, scheduler, domAdapter) {
388
+ constructor(config, textbus, controller, selection, rootComponentRef, input, domAdapter) {
389
389
  Object.defineProperty(this, "config", {
390
390
  enumerable: true,
391
391
  configurable: true,
@@ -410,12 +410,6 @@ exports.SelectionBridge = class SelectionBridge {
410
410
  writable: true,
411
411
  value: input
412
412
  });
413
- Object.defineProperty(this, "scheduler", {
414
- enumerable: true,
415
- configurable: true,
416
- writable: true,
417
- value: scheduler
418
- });
419
413
  Object.defineProperty(this, "domAdapter", {
420
414
  enumerable: true,
421
415
  configurable: true,
@@ -800,15 +794,7 @@ exports.SelectionBridge = class SelectionBridge {
800
794
  }
801
795
  }));
802
796
  }
803
- let isUpdating = false;
804
- this.subs.push(this.scheduler.onDocChange.subscribe(() => {
805
- isUpdating = true;
806
- }), this.scheduler.onDocChanged.pipe(stream.delay()).subscribe(() => {
807
- isUpdating = false;
808
- }), stream.fromEvent(document, 'selectionchange').pipe().subscribe(() => {
809
- if (isUpdating) {
810
- return;
811
- }
797
+ this.subs.push(stream.fromEvent(document, 'selectionchange').pipe().subscribe(() => {
812
798
  if (this.syncSelectionFromNativeSelectionChange) {
813
799
  this.syncSelection(connector);
814
800
  }
@@ -1066,7 +1052,6 @@ exports.SelectionBridge = __decorate([
1066
1052
  core$1.Selection,
1067
1053
  core$1.RootComponentRef,
1068
1054
  Input,
1069
- core$1.Scheduler,
1070
1055
  DomAdapter])
1071
1056
  ], exports.SelectionBridge);
1072
1057
 
@@ -1,5 +1,5 @@
1
1
  import { Observable } from '@tanbo/stream';
2
- import { NativeSelectionBridge, NativeSelectionConnector, SelectionPosition, AbstractSelection, RootComponentRef, Controller, Selection, Textbus, Scheduler } from '@textbus/core';
2
+ import { NativeSelectionBridge, NativeSelectionConnector, SelectionPosition, AbstractSelection, RootComponentRef, Controller, Selection, Textbus } from '@textbus/core';
3
3
  import { Rect } from './_utils/uikit';
4
4
  import { Input } from './types';
5
5
  import { ViewOptions } from './browser-module';
@@ -12,7 +12,6 @@ export declare class SelectionBridge implements NativeSelectionBridge {
12
12
  private selection;
13
13
  private rootComponentRef;
14
14
  private input;
15
- private scheduler;
16
15
  private domAdapter;
17
16
  onSelectionChange: Observable<Range | null>;
18
17
  nativeSelection: globalThis.Selection;
@@ -26,7 +25,7 @@ export declare class SelectionBridge implements NativeSelectionBridge {
26
25
  private docContainer;
27
26
  private cacheCaretPositionTimer;
28
27
  private oldCaretPosition;
29
- constructor(config: ViewOptions, textbus: Textbus, controller: Controller, selection: Selection, rootComponentRef: RootComponentRef, input: Input, scheduler: Scheduler, domAdapter: DomAdapter);
28
+ constructor(config: ViewOptions, textbus: Textbus, controller: Controller, selection: Selection, rootComponentRef: RootComponentRef, input: Input, domAdapter: DomAdapter);
30
29
  connect(connector: NativeSelectionConnector): void;
31
30
  disConnect(): void;
32
31
  getRect(location: SelectionPosition): Rect | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/platform-browser",
3
- "version": "4.5.0",
3
+ "version": "5.0.0-alpha.1",
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,14 +26,14 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@tanbo/stream": "^1.2.7",
29
- "@textbus/core": "^4.5.0",
30
- "@viewfly/core": "^1.2.3"
29
+ "@textbus/core": "^5.0.0-alpha.1",
30
+ "@viewfly/core": "^2.0.0-alpha.3"
31
31
  },
32
32
  "devDependencies": {
33
- "@rollup/plugin-commonjs": "^28.0.2",
34
- "@rollup/plugin-typescript": "^12.1.2",
33
+ "@rollup/plugin-commonjs": "^23.0.2",
34
+ "@rollup/plugin-typescript": "^9.0.2",
35
35
  "rimraf": "^3.0.2",
36
- "rollup": "4.22.4",
36
+ "rollup": "^3.2.5",
37
37
  "tslib": "^2.4.1"
38
38
  },
39
39
  "author": {
@@ -47,5 +47,5 @@
47
47
  "bugs": {
48
48
  "url": "https://github.com/textbus/textbus.git/issues"
49
49
  },
50
- "gitHead": "327e764487545a35d97eae525b61307642b8f386"
50
+ "gitHead": "97fad583844a41a761a107ff8500039c178ec321"
51
51
  }