@textbus/collaborate 4.0.0-alpha.8 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/bundles/collaborate-module.d.ts +12 -1
- package/bundles/collaborate.d.ts +55 -64
- package/bundles/connectors/_api.d.ts +2 -0
- package/bundles/connectors/hocuspocus-connector.d.ts +13 -0
- package/bundles/connectors/y-websocket-connector.d.ts +13 -0
- package/bundles/index.esm.js +400 -320
- package/bundles/index.js +400 -317
- package/bundles/public-api.d.ts +3 -0
- package/bundles/sync-connector.d.ts +24 -0
- package/bundles/user-activity.d.ts +23 -0
- package/package.json +8 -8
package/bundles/public-api.d.ts
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
import { Observable } from '@tanbo/stream';
|
2
|
+
/**
|
3
|
+
* 协作通信通用接口
|
4
|
+
*/
|
5
|
+
export declare abstract class SyncConnector {
|
6
|
+
/**
|
7
|
+
* 当文档加载完成时触发的观察者
|
8
|
+
*/
|
9
|
+
abstract onLoad: Observable<void>;
|
10
|
+
/**
|
11
|
+
* 当文档 awareness 状态变更时触发的观察者
|
12
|
+
*/
|
13
|
+
abstract onStateChange: Observable<any>;
|
14
|
+
/**
|
15
|
+
* 设置 awareness 状态
|
16
|
+
* @param key 状态的 key
|
17
|
+
* @param data 状态值
|
18
|
+
*/
|
19
|
+
abstract setLocalStateField(key: string, data: Record<string, any>): void;
|
20
|
+
/**
|
21
|
+
* 当文档销毁时调用
|
22
|
+
*/
|
23
|
+
abstract onDestroy(): void;
|
24
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { Observable } from '@tanbo/stream';
|
2
|
+
import { Selection, SelectionPaths } from '@textbus/core';
|
3
|
+
import { SyncConnector } from './sync-connector';
|
4
|
+
export interface UserInfo {
|
5
|
+
username: string;
|
6
|
+
color: string;
|
7
|
+
id: string;
|
8
|
+
}
|
9
|
+
export interface ActivityInfo extends UserInfo {
|
10
|
+
selection: SelectionPaths;
|
11
|
+
}
|
12
|
+
export declare class UserActivity {
|
13
|
+
private syncConnector;
|
14
|
+
private selection;
|
15
|
+
onStateChange: Observable<ActivityInfo[]>;
|
16
|
+
onUserChange: Observable<UserInfo[]>;
|
17
|
+
private stateChangeEvent;
|
18
|
+
private userChangeEvent;
|
19
|
+
private subscription;
|
20
|
+
constructor(syncConnector: SyncConnector, selection: Selection);
|
21
|
+
init(userinfo: UserInfo): void;
|
22
|
+
destroy(): void;
|
23
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@textbus/collaborate",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.1",
|
4
4
|
"description": "Textbus is a rich text editor and framework that is highly customizable and extensible to achieve rich wysiwyg effects.",
|
5
5
|
"main": "./bundles/index.js",
|
6
6
|
"module": "./bundles/index.esm.js",
|
@@ -25,12 +25,12 @@
|
|
25
25
|
"typescript editor"
|
26
26
|
],
|
27
27
|
"dependencies": {
|
28
|
-
"@
|
29
|
-
"@
|
30
|
-
"@
|
31
|
-
"
|
32
|
-
"y-
|
33
|
-
"yjs": "^13.6.
|
28
|
+
"@hocuspocus/provider": "^2.13.6",
|
29
|
+
"@tanbo/stream": "^1.2.5",
|
30
|
+
"@textbus/core": "^4.0.1",
|
31
|
+
"@viewfly/core": "^1.0.0-alpha.22",
|
32
|
+
"y-websocket": "^1.4.3",
|
33
|
+
"yjs": "^13.6.14"
|
34
34
|
},
|
35
35
|
"devDependencies": {
|
36
36
|
"@rollup/plugin-commonjs": "^23.0.2",
|
@@ -50,5 +50,5 @@
|
|
50
50
|
"bugs": {
|
51
51
|
"url": "https://github.com/textbus/textbus.git/issues"
|
52
52
|
},
|
53
|
-
"gitHead": "
|
53
|
+
"gitHead": "650431b993553439e58d48949bd9cadda23fb147"
|
54
54
|
}
|