@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.
- package/bundles/collaborate.d.ts +9 -9
- package/bundles/index.esm.js +758 -0
- package/bundles/index.js +760 -0
- package/bundles/public-api.d.ts +0 -1
- package/package.json +14 -8
- package/bundles/collaborate-cursor.d.ts +0 -42
- package/bundles/collaborate-cursor.js +0 -273
- package/bundles/collaborate.js +0 -713
- package/bundles/public-api.js +0 -16
- package/bundles/unknown.component.d.ts +0 -1
- package/bundles/unknown.component.js +0 -22
package/bundles/collaborate.d.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import { Observable, Subject, Subscription } from '@tanbo/stream';
|
2
|
-
import { ComponentInstance, Controller,
|
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
|
26
|
+
protected registry: Registry;
|
29
27
|
protected selection: Selection;
|
30
28
|
protected starter: Starter;
|
31
|
-
|
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
|
-
|
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
|
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
|
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;
|