@textbus/collaborate 3.0.0-alpha.9 → 3.0.0-y.0
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.
- package/bundles/collaborate.d.ts +15 -10
- package/bundles/index.esm.js +775 -0
- package/bundles/index.js +778 -0
- package/bundles/public-api.d.ts +0 -1
- package/package.json +15 -9
- package/bundles/collaborate-cursor.d.ts +0 -42
- package/bundles/collaborate-cursor.js +0 -273
- package/bundles/collaborate.js +0 -717
- 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,
|
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';
|
2
|
+
import { AbstractSelection, ComponentInstance, Controller, Registry, History, RootComponentRef, Scheduler, Selection, SelectionPaths, Slot, Starter } from '@textbus/core';
|
3
|
+
import { Array as YArray, Doc as YDoc, Map as YMap, RelativePosition, Text as YText, Transaction, UndoManager, Item } from 'yjs';
|
5
4
|
interface CursorPosition {
|
6
5
|
anchor: RelativePosition;
|
7
6
|
focus: RelativePosition;
|
@@ -19,16 +18,20 @@ interface UpdateItem {
|
|
19
18
|
record: boolean;
|
20
19
|
action(): void;
|
21
20
|
}
|
21
|
+
export declare abstract class CustomUndoManagerConfig {
|
22
|
+
abstract captureTransaction?(arg0: Transaction): boolean;
|
23
|
+
abstract deleteFilter?(arg0: Item): boolean;
|
24
|
+
}
|
22
25
|
export declare class Collaborate implements History {
|
23
26
|
protected stackSize: number;
|
24
27
|
protected rootComponentRef: RootComponentRef;
|
25
|
-
protected collaborateCursor: CollaborateCursor;
|
26
28
|
protected controller: Controller;
|
27
29
|
protected scheduler: Scheduler;
|
28
|
-
protected
|
30
|
+
protected registry: Registry;
|
29
31
|
protected selection: Selection;
|
30
32
|
protected starter: Starter;
|
31
|
-
|
33
|
+
protected undoManagerConfig: CustomUndoManagerConfig;
|
34
|
+
onLocalChangesApplied: Observable<void>;
|
32
35
|
yDoc: YDoc;
|
33
36
|
onBack: Observable<void>;
|
34
37
|
onForward: Observable<void>;
|
@@ -47,19 +50,21 @@ export declare class Collaborate implements History {
|
|
47
50
|
protected slotStateSyncCaches: WeakMap<Slot<any>, () => void>;
|
48
51
|
protected slotsSyncCaches: WeakMap<ComponentInstance<import("@textbus/core").ComponentExtends, any, unknown>, () => void>;
|
49
52
|
protected componentStateSyncCaches: WeakMap<ComponentInstance<import("@textbus/core").ComponentExtends, any, unknown>, () => void>;
|
53
|
+
protected localChangesAppliedEvent: Subject<void>;
|
50
54
|
protected selectionChangeEvent: Subject<SelectionPaths>;
|
51
55
|
protected contentMap: ContentMap;
|
52
56
|
protected updateRemoteActions: Array<UpdateItem>;
|
53
57
|
protected noRecord: {};
|
54
|
-
|
58
|
+
protected historyItems: Array<CursorPosition | null>;
|
59
|
+
protected index: number;
|
60
|
+
constructor(stackSize: number, rootComponentRef: RootComponentRef, controller: Controller, scheduler: Scheduler, registry: Registry, selection: Selection, starter: Starter, undoManagerConfig: CustomUndoManagerConfig);
|
55
61
|
listen(): void;
|
56
|
-
updateRemoteSelection(paths: RemoteSelection[]): void;
|
57
62
|
back(): void;
|
58
63
|
forward(): void;
|
59
64
|
clear(): void;
|
60
65
|
destroy(): void;
|
61
66
|
protected syncRootComponent(root: YMap<any>, rootComponent: ComponentInstance): void;
|
62
|
-
protected
|
67
|
+
protected getAbstractSelection(position: CursorPosition): AbstractSelection | null;
|
63
68
|
protected getRelativeCursorLocation(): CursorPosition | null;
|
64
69
|
protected syncSlotContent(content: YText, slot: Slot): void;
|
65
70
|
protected syncSlotState(remoteSlot: YMap<any>, slot: Slot): void;
|
@@ -69,7 +74,7 @@ export declare class Collaborate implements History {
|
|
69
74
|
protected runRemoteUpdate(tr: Transaction, fn: () => void): void;
|
70
75
|
protected createSharedComponentByComponent(component: ComponentInstance): YMap<any>;
|
71
76
|
protected createSharedSlotBySlot(slot: Slot): YMap<any>;
|
72
|
-
protected createComponentBySharedComponent(yMap: YMap<any
|
77
|
+
protected createComponentBySharedComponent(yMap: YMap<any>): ComponentInstance;
|
73
78
|
protected createSlotBySharedSlot(sharedSlot: YMap<any>): Slot;
|
74
79
|
protected cleanSubscriptionsBySlot(slot: Slot): void;
|
75
80
|
protected cleanSubscriptionsByComponent(component: ComponentInstance): void;
|