@textbus/collaborate 3.0.0-alpha.4 → 3.0.0-alpha.40

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,6 @@
1
1
  import { Observable, Subject, Subscription } from '@tanbo/stream';
2
- import { ComponentInstance, Controller, Factory, History, RootComponentRef, Scheduler, Selection, SelectionPaths, Slot, Starter } from '@textbus/core';
2
+ import { AbstractSelection, ComponentInstance, Controller, Registry, History, RootComponentRef, Scheduler, Selection, SelectionPaths, Slot, Starter } from '@textbus/core';
3
3
  import { Array as YArray, Doc as YDoc, Map as YMap, RelativePosition, Text as YText, Transaction, UndoManager } from 'yjs';
4
- import { CollaborateCursor, RemoteSelection } from './collaborate-cursor';
5
4
  interface CursorPosition {
6
5
  anchor: RelativePosition;
7
6
  focus: RelativePosition;
@@ -22,13 +21,12 @@ interface UpdateItem {
22
21
  export declare class Collaborate implements History {
23
22
  protected stackSize: number;
24
23
  protected rootComponentRef: RootComponentRef;
25
- protected collaborateCursor: CollaborateCursor;
26
24
  protected controller: Controller;
27
25
  protected scheduler: Scheduler;
28
- protected factory: Factory;
26
+ protected registry: Registry;
29
27
  protected selection: Selection;
30
28
  protected starter: Starter;
31
- onSelectionChange: Observable<SelectionPaths>;
29
+ onLocalChangesApplied: Observable<void>;
32
30
  yDoc: YDoc;
33
31
  onBack: Observable<void>;
34
32
  onForward: Observable<void>;
@@ -47,19 +45,21 @@ export declare class Collaborate implements History {
47
45
  protected slotStateSyncCaches: WeakMap<Slot<any>, () => void>;
48
46
  protected slotsSyncCaches: WeakMap<ComponentInstance<import("@textbus/core").ComponentExtends, any, unknown>, () => void>;
49
47
  protected componentStateSyncCaches: WeakMap<ComponentInstance<import("@textbus/core").ComponentExtends, any, unknown>, () => void>;
48
+ protected localChangesAppliedEvent: Subject<void>;
50
49
  protected selectionChangeEvent: Subject<SelectionPaths>;
51
50
  protected contentMap: ContentMap;
52
51
  protected updateRemoteActions: Array<UpdateItem>;
53
52
  protected noRecord: {};
54
- constructor(stackSize: number, rootComponentRef: RootComponentRef, collaborateCursor: CollaborateCursor, controller: Controller, scheduler: Scheduler, factory: Factory, selection: Selection, starter: Starter);
53
+ protected historyItems: Array<CursorPosition | null>;
54
+ protected index: number;
55
+ constructor(stackSize: number, rootComponentRef: RootComponentRef, controller: Controller, scheduler: Scheduler, registry: Registry, selection: Selection, starter: Starter);
55
56
  listen(): void;
56
- updateRemoteSelection(paths: RemoteSelection[]): void;
57
57
  back(): void;
58
58
  forward(): void;
59
59
  clear(): void;
60
60
  destroy(): void;
61
61
  protected syncRootComponent(root: YMap<any>, rootComponent: ComponentInstance): void;
62
- protected restoreCursorLocation(position: CursorPosition): void;
62
+ protected getAbstractSelection(position: CursorPosition): AbstractSelection | null;
63
63
  protected getRelativeCursorLocation(): CursorPosition | null;
64
64
  protected syncSlotContent(content: YText, slot: Slot): void;
65
65
  protected syncSlotState(remoteSlot: YMap<any>, slot: Slot): void;
@@ -69,7 +69,7 @@ export declare class Collaborate implements History {
69
69
  protected runRemoteUpdate(tr: Transaction, fn: () => void): void;
70
70
  protected createSharedComponentByComponent(component: ComponentInstance): YMap<any>;
71
71
  protected createSharedSlotBySlot(slot: Slot): YMap<any>;
72
- protected createComponentBySharedComponent(yMap: YMap<any>, canInsertInlineComponent: boolean): ComponentInstance;
72
+ protected createComponentBySharedComponent(yMap: YMap<any>): ComponentInstance;
73
73
  protected createSlotBySharedSlot(sharedSlot: YMap<any>): Slot;
74
74
  protected cleanSubscriptionsBySlot(slot: Slot): void;
75
75
  protected cleanSubscriptionsByComponent(component: ComponentInstance): void;