@textbus/collaborate 4.0.0-alpha.24 → 4.0.0-alpha.26
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 +57 -64
- package/bundles/index.esm.js +269 -308
- package/bundles/index.js +267 -306
- package/package.json +3 -3
package/bundles/collaborate.d.ts
CHANGED
|
@@ -1,38 +1,17 @@
|
|
|
1
|
-
import { Observable
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
interface CursorPosition {
|
|
5
|
-
anchor: RelativePosition;
|
|
6
|
-
focus: RelativePosition;
|
|
7
|
-
}
|
|
8
|
-
declare class ContentMap {
|
|
9
|
-
private slotAndYTextMap;
|
|
10
|
-
private yTextAndSLotMap;
|
|
11
|
-
set(key: Slot, value: YText): void;
|
|
12
|
-
set(key: YText, value: Slot): void;
|
|
13
|
-
get(key: Slot): YText | null;
|
|
14
|
-
get(key: YText): Slot | null;
|
|
15
|
-
delete(key: Slot | YText): void;
|
|
16
|
-
}
|
|
17
|
-
interface UpdateItem {
|
|
18
|
-
record: boolean;
|
|
19
|
-
action(): void;
|
|
20
|
-
}
|
|
1
|
+
import { Observable } from '@tanbo/stream';
|
|
2
|
+
import { Registry, History, RootComponentRef, Scheduler, Selection } from '@textbus/core';
|
|
3
|
+
import { Doc as YDoc, Transaction, Item } from 'yjs';
|
|
21
4
|
export declare abstract class CustomUndoManagerConfig {
|
|
22
5
|
abstract captureTransaction?(arg0: Transaction): boolean;
|
|
23
6
|
abstract deleteFilter?(arg0: Item): boolean;
|
|
24
7
|
}
|
|
25
|
-
interface CollaborateHistorySelectionPosition {
|
|
26
|
-
before: CursorPosition | null;
|
|
27
|
-
after: CursorPosition | null;
|
|
28
|
-
}
|
|
29
8
|
export declare class Collaborate implements History {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
9
|
+
private stackSize;
|
|
10
|
+
private rootComponentRef;
|
|
11
|
+
private scheduler;
|
|
12
|
+
private registry;
|
|
13
|
+
private selection;
|
|
14
|
+
private undoManagerConfig;
|
|
36
15
|
onLocalChangesApplied: Observable<void>;
|
|
37
16
|
yDoc: YDoc;
|
|
38
17
|
onBack: Observable<void>;
|
|
@@ -41,44 +20,58 @@ export declare class Collaborate implements History {
|
|
|
41
20
|
onPush: Observable<void>;
|
|
42
21
|
get canBack(): boolean;
|
|
43
22
|
get canForward(): boolean;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
protected updateRemoteActions: Array<UpdateItem>;
|
|
59
|
-
protected noRecord: {};
|
|
60
|
-
protected historyItems: Array<CollaborateHistorySelectionPosition>;
|
|
61
|
-
protected index: number;
|
|
23
|
+
private backEvent;
|
|
24
|
+
private forwardEvent;
|
|
25
|
+
private changeEvent;
|
|
26
|
+
private pushEvent;
|
|
27
|
+
private manager;
|
|
28
|
+
private subscriptions;
|
|
29
|
+
private updateFromRemote;
|
|
30
|
+
private localChangesAppliedEvent;
|
|
31
|
+
private selectionChangeEvent;
|
|
32
|
+
private slotMap;
|
|
33
|
+
private updateRemoteActions;
|
|
34
|
+
private noRecord;
|
|
35
|
+
private historyItems;
|
|
36
|
+
private index;
|
|
62
37
|
constructor(stackSize: number, rootComponentRef: RootComponentRef, scheduler: Scheduler, registry: Registry, selection: Selection, undoManagerConfig: CustomUndoManagerConfig);
|
|
63
38
|
listen(): void;
|
|
64
39
|
back(): void;
|
|
65
40
|
forward(): void;
|
|
66
41
|
clear(): void;
|
|
67
42
|
destroy(): void;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
43
|
+
private syncRootComponent;
|
|
44
|
+
private syncSharedMapToLocalMap;
|
|
45
|
+
private createLocalMapBySharedMap;
|
|
46
|
+
private createLocalArrayBySharedArray;
|
|
47
|
+
private syncLocalMapToSharedMap;
|
|
48
|
+
private createSharedMapByLocalMap;
|
|
49
|
+
private createSharedArrayByLocalArray;
|
|
50
|
+
private createSharedSlotByLocalSlot;
|
|
51
|
+
private createLocalSlotBySharedSlot;
|
|
52
|
+
private createSharedModelByLocalModel;
|
|
53
|
+
private createLocalModelBySharedByModel;
|
|
54
|
+
private getAbstractSelection;
|
|
55
|
+
private getRelativeCursorLocation;
|
|
56
|
+
private syncSlot;
|
|
57
|
+
private createSharedComponentByLocalComponent;
|
|
58
|
+
private createLocalComponentBySharedComponent;
|
|
59
|
+
/**
|
|
60
|
+
* 双向同步数组
|
|
61
|
+
* @param sharedArray
|
|
62
|
+
* @param localArray
|
|
63
|
+
* @param parent
|
|
64
|
+
* @private
|
|
65
|
+
*/
|
|
66
|
+
private syncArray;
|
|
67
|
+
/**
|
|
68
|
+
* 双向同步对象
|
|
69
|
+
* @param sharedObject
|
|
70
|
+
* @param localObject
|
|
71
|
+
* @param parent
|
|
72
|
+
* @private
|
|
73
|
+
*/
|
|
74
|
+
private syncObject;
|
|
75
|
+
private runLocalUpdate;
|
|
76
|
+
private runRemoteUpdate;
|
|
83
77
|
}
|
|
84
|
-
export {};
|