@textbus/collaborate 2.0.0-alpha.63 → 2.0.0-alpha.64
Sign up to get free protection for your applications and to get access to all the features.
- package/bundles/collaborate.js +4 -7
- package/package.json +5 -5
- package/src/collaborate.ts +4 -9
package/bundles/collaborate.js
CHANGED
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
9
|
};
|
10
10
|
import { Injectable } from '@tanbo/di';
|
11
|
-
import {
|
11
|
+
import { filter, microTask, Subject } from '@tanbo/stream';
|
12
12
|
import { RootComponentRef, Starter, Translator, Registry, Selection, Renderer } from '@textbus/core';
|
13
13
|
import { Doc as YDoc, UndoManager } from 'yjs';
|
14
14
|
import { LocalToRemote } from './collab/local-to-remote';
|
@@ -211,17 +211,14 @@ let Collaborate = class Collaborate {
|
|
211
211
|
this.selection.restore();
|
212
212
|
this.updateFromSelf = true;
|
213
213
|
});
|
214
|
-
const operations = [];
|
215
214
|
this.subscriptions.push(this.rootComponentRef.component.changeMarker.onChange.pipe(filter(() => {
|
216
215
|
return this.updateFromSelf;
|
217
|
-
}),
|
218
|
-
|
219
|
-
}), debounceTime(1)).subscribe(() => {
|
216
|
+
}), microTask()).subscribe((operations) => {
|
217
|
+
console.log(operations);
|
220
218
|
this.yDoc.transact(() => {
|
221
219
|
operations.forEach(operation => {
|
222
220
|
this.localToRemote.transform(operation, root);
|
223
221
|
});
|
224
|
-
operations.length = 0;
|
225
222
|
}, this.yDoc);
|
226
223
|
this.renderer.render();
|
227
224
|
this.selection.restore();
|
@@ -239,4 +236,4 @@ Collaborate = __decorate([
|
|
239
236
|
Starter])
|
240
237
|
], Collaborate);
|
241
238
|
export { Collaborate };
|
242
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sbGFib3JhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29sbGFib3Jh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yYXRpb25zOiBPcGVyYXRpb25bXSA9IFtdXG4gICAgdGhpcy5zdWJzY3JpcHRpb25zLnB1c2goXG4gICAgICB0aGlzLnJvb3RDb21wb25lbnRSZWYuY29tcG9uZW50LmNoYW5nZU1hcmtlci5vbkNoYW5nZS5waXBlKFxuICAgICAgICBmaWx0ZXIoKCkgPT4ge1xuICAgICAgICAgIHJldHVybiB0aGlzLnVwZGF0ZUZyb21TZWxmXG4gICAgICAgIH0pLFxuICAgICAgICB0YXAob3AgPT4ge1xuICAgICAgICAgIG9wZXJhdGlvbnMucHVzaChvcClcbiAgICAgICAgfSksXG4gICAgICAgIGRlYm91bmNlVGltZSgxKVxuICAgICAgKS5zdWJzY3JpYmUoKCkgPT4ge1xuICAgICAgICB0aGlzLnlEb2MudHJhbnNhY3QoKCkgPT4ge1xuICAgICAgICAgIG9wZXJhdGlvbnMuZm9yRWFjaChvcGVyYXRpb24gPT4ge1xuICAgICAgICAgICAgdGhpcy5sb2NhbFRvUmVtb3RlLnRyYW5zZm9ybShvcGVyYXRpb24sIHJvb3QpXG4gICAgICAgICAgfSlcbiAgICAgICAgICBvcGVyYXRpb25zLmxlbmd0aCA9IDBcbiAgICAgICAgfSwgdGhpcy55RG9jKVxuICAgICAgICB0aGlzLnJlbmRlcmVyLnJlbmRlcigpXG4gICAgICAgIHRoaXMuc2VsZWN0aW9uLnJlc3RvcmUoKVxuICAgICAgfSlcbiAgICApXG4gIH1cbn1cbiJdfQ==
|
239
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sbGFib3JhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29sbGFib3JhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLFdBQVcsQ0FBQTtBQUN0QyxPQUFPLEVBQUUsTUFBTSxFQUFFLF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jLnRyYW5zYWN0KCgpID0+IHtcbiAgICAgICAgICBvcGVyYXRpb25zLmZvckVhY2gob3BlcmF0aW9uID0+IHtcbiAgICAgICAgICAgIHRoaXMubG9jYWxUb1JlbW90ZS50cmFuc2Zvcm0ob3BlcmF0aW9uLCByb290KVxuICAgICAgICAgIH0pXG4gICAgICAgIH0sIHRoaXMueURvYylcbiAgICAgICAgdGhpcy5yZW5kZXJlci5yZW5kZXIoKVxuICAgICAgICB0aGlzLnNlbGVjdGlvbi5yZXN0b3JlKClcbiAgICAgIH0pXG4gICAgKVxuICB9XG59XG4iXX0=
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@textbus/collaborate",
|
3
|
-
"version": "2.0.0-alpha.
|
3
|
+
"version": "2.0.0-alpha.64",
|
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/public-api.js",
|
6
6
|
"module": "./bundles/public-api.js",
|
@@ -26,9 +26,9 @@
|
|
26
26
|
],
|
27
27
|
"dependencies": {
|
28
28
|
"@tanbo/di": "^1.0.7",
|
29
|
-
"@tanbo/stream": "^0.0
|
30
|
-
"@textbus/browser": "^2.0.0-alpha.
|
31
|
-
"@textbus/core": "^2.0.0-alpha.
|
29
|
+
"@tanbo/stream": "^1.0.0",
|
30
|
+
"@textbus/browser": "^2.0.0-alpha.64",
|
31
|
+
"@textbus/core": "^2.0.0-alpha.64",
|
32
32
|
"reflect-metadata": "^0.1.13",
|
33
33
|
"y-protocols": "^1.0.5",
|
34
34
|
"yjs": "^13.5.27"
|
@@ -44,5 +44,5 @@
|
|
44
44
|
"bugs": {
|
45
45
|
"url": "https://github.com/textbus/textbus.git/issues"
|
46
46
|
},
|
47
|
-
"gitHead": "
|
47
|
+
"gitHead": "0b4acbfb933b743d8ae9fe36ec10a9b790680390"
|
48
48
|
}
|
package/src/collaborate.ts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
import { Injectable } from '@tanbo/di'
|
2
|
-
import {
|
2
|
+
import { filter, microTask, Observable, Subject, Subscription } from '@tanbo/stream'
|
3
3
|
import {
|
4
4
|
RootComponentRef,
|
5
5
|
Starter,
|
6
|
-
Operation,
|
7
6
|
Translator,
|
8
7
|
Registry,
|
9
8
|
Selection,
|
@@ -114,22 +113,18 @@ export class Collaborate implements History {
|
|
114
113
|
this.selection.restore()
|
115
114
|
this.updateFromSelf = true
|
116
115
|
})
|
117
|
-
const operations: Operation[] = []
|
118
116
|
this.subscriptions.push(
|
119
117
|
this.rootComponentRef.component.changeMarker.onChange.pipe(
|
120
118
|
filter(() => {
|
121
119
|
return this.updateFromSelf
|
122
120
|
}),
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
debounceTime(1)
|
127
|
-
).subscribe(() => {
|
121
|
+
microTask()
|
122
|
+
).subscribe((operations) => {
|
123
|
+
console.log(operations)
|
128
124
|
this.yDoc.transact(() => {
|
129
125
|
operations.forEach(operation => {
|
130
126
|
this.localToRemote.transform(operation, root)
|
131
127
|
})
|
132
|
-
operations.length = 0
|
133
128
|
}, this.yDoc)
|
134
129
|
this.renderer.render()
|
135
130
|
this.selection.restore()
|