@textbus/collaborate 4.0.0-alpha.5 → 4.0.0-alpha.51
Sign up to get free protection for your applications and to get access to all the features.
- package/bundles/collaborate-module.d.ts +10 -1
- package/bundles/collaborate.d.ts +55 -64
- package/bundles/index.esm.js +344 -317
- package/bundles/index.js +340 -313
- package/bundles/public-api.d.ts +1 -0
- package/bundles/user-activity.d.ts +23 -0
- package/package.json +7 -7
@@ -1,5 +1,14 @@
|
|
1
|
-
import { Module } from '@textbus/core';
|
1
|
+
import { Module, Textbus } from '@textbus/core';
|
2
2
|
import { Provider } from '@viewfly/core';
|
3
|
+
import { UserInfo } from './user-activity';
|
4
|
+
export interface CollaborateConfig {
|
5
|
+
url: string;
|
6
|
+
roomName: string;
|
7
|
+
userinfo: UserInfo;
|
8
|
+
}
|
3
9
|
export declare class CollaborateModule implements Module {
|
10
|
+
config: CollaborateConfig;
|
4
11
|
providers: Provider[];
|
12
|
+
constructor(config: CollaborateConfig);
|
13
|
+
setup(textbus: Textbus): Promise<(() => void) | void> | (() => void) | void;
|
5
14
|
}
|
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,56 @@ 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
|
+
* @private
|
64
|
+
*/
|
65
|
+
private syncArray;
|
66
|
+
/**
|
67
|
+
* 双向同步对象
|
68
|
+
* @param sharedObject
|
69
|
+
* @param localObject
|
70
|
+
* @private
|
71
|
+
*/
|
72
|
+
private syncObject;
|
73
|
+
private runLocalUpdate;
|
74
|
+
private runRemoteUpdate;
|
83
75
|
}
|
84
|
-
export {};
|