@textbus/collaborate 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/bundles/index.esm.js +4 -4
- package/bundles/index.js +4 -4
- package/bundles/sync-connector.d.ts +14 -0
- package/package.json +3 -3
package/bundles/index.esm.js
CHANGED
@@ -619,7 +619,7 @@ let Collaborate = class Collaborate {
|
|
619
619
|
sharedSlot.removeAttribute(action.name);
|
620
620
|
}
|
621
621
|
}
|
622
|
-
});
|
622
|
+
}, true);
|
623
623
|
});
|
624
624
|
this.slotMap.set(localSlot, sharedSlot);
|
625
625
|
localSlot.__changeMarker__.destroyCallbacks.push(() => {
|
@@ -684,7 +684,7 @@ let Collaborate = class Collaborate {
|
|
684
684
|
break;
|
685
685
|
}
|
686
686
|
}
|
687
|
-
});
|
687
|
+
}, !localArray.__changeMarker__.irrevocableUpdate);
|
688
688
|
});
|
689
689
|
const syncRemote = (ev, tr) => {
|
690
690
|
this.runRemoteUpdate(tr, () => {
|
@@ -745,14 +745,14 @@ let Collaborate = class Collaborate {
|
|
745
745
|
break;
|
746
746
|
}
|
747
747
|
}
|
748
|
-
});
|
748
|
+
}, !localObject.__changeMarker__.irrevocableUpdate);
|
749
749
|
});
|
750
750
|
localObject.__changeMarker__.destroyCallbacks.push(function () {
|
751
751
|
sharedObject.unobserve(syncRemote);
|
752
752
|
sub.unsubscribe();
|
753
753
|
});
|
754
754
|
}
|
755
|
-
runLocalUpdate(fn, record
|
755
|
+
runLocalUpdate(fn, record) {
|
756
756
|
if (this.updateFromRemote) {
|
757
757
|
return;
|
758
758
|
}
|
package/bundles/index.js
CHANGED
@@ -621,7 +621,7 @@ exports.Collaborate = class Collaborate {
|
|
621
621
|
sharedSlot.removeAttribute(action.name);
|
622
622
|
}
|
623
623
|
}
|
624
|
-
});
|
624
|
+
}, true);
|
625
625
|
});
|
626
626
|
this.slotMap.set(localSlot, sharedSlot);
|
627
627
|
localSlot.__changeMarker__.destroyCallbacks.push(() => {
|
@@ -686,7 +686,7 @@ exports.Collaborate = class Collaborate {
|
|
686
686
|
break;
|
687
687
|
}
|
688
688
|
}
|
689
|
-
});
|
689
|
+
}, !localArray.__changeMarker__.irrevocableUpdate);
|
690
690
|
});
|
691
691
|
const syncRemote = (ev, tr) => {
|
692
692
|
this.runRemoteUpdate(tr, () => {
|
@@ -747,14 +747,14 @@ exports.Collaborate = class Collaborate {
|
|
747
747
|
break;
|
748
748
|
}
|
749
749
|
}
|
750
|
-
});
|
750
|
+
}, !localObject.__changeMarker__.irrevocableUpdate);
|
751
751
|
});
|
752
752
|
localObject.__changeMarker__.destroyCallbacks.push(function () {
|
753
753
|
sharedObject.unobserve(syncRemote);
|
754
754
|
sub.unsubscribe();
|
755
755
|
});
|
756
756
|
}
|
757
|
-
runLocalUpdate(fn, record
|
757
|
+
runLocalUpdate(fn, record) {
|
758
758
|
if (this.updateFromRemote) {
|
759
759
|
return;
|
760
760
|
}
|
@@ -3,8 +3,22 @@ import { Observable } from '@tanbo/stream';
|
|
3
3
|
* 协作通信通用接口
|
4
4
|
*/
|
5
5
|
export declare abstract class SyncConnector {
|
6
|
+
/**
|
7
|
+
* 当文档加载完成时触发的观察者
|
8
|
+
*/
|
6
9
|
abstract onLoad: Observable<void>;
|
10
|
+
/**
|
11
|
+
* 当文档 awareness 状态变更时触发的观察者
|
12
|
+
*/
|
7
13
|
abstract onStateChange: Observable<any>;
|
14
|
+
/**
|
15
|
+
* 设置 awareness 状态
|
16
|
+
* @param key 状态的 key
|
17
|
+
* @param data 状态值
|
18
|
+
*/
|
8
19
|
abstract setLocalStateField(key: string, data: Record<string, any>): void;
|
20
|
+
/**
|
21
|
+
* 当文档销毁时调用
|
22
|
+
*/
|
9
23
|
abstract onDestroy(): void;
|
10
24
|
}
|
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",
|
@@ -27,7 +27,7 @@
|
|
27
27
|
"dependencies": {
|
28
28
|
"@hocuspocus/provider": "^2.13.6",
|
29
29
|
"@tanbo/stream": "^1.2.5",
|
30
|
-
"@textbus/core": "^4.0.
|
30
|
+
"@textbus/core": "^4.0.1",
|
31
31
|
"@viewfly/core": "^1.0.0-alpha.22",
|
32
32
|
"y-websocket": "^1.4.3",
|
33
33
|
"yjs": "^13.6.14"
|
@@ -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
|
}
|