@textbus/collaborate 2.0.0-beta.1 → 2.0.0-beta.4
Sign up to get free protection for your applications and to get access to all the features.
- package/bundles/collaborate.js +23 -4
- package/package.json +4 -4
- package/src/collaborate.ts +21 -3
package/bundles/collaborate.js
CHANGED
@@ -236,7 +236,15 @@ let Collaborate = class Collaborate {
|
|
236
236
|
slot.retain(0);
|
237
237
|
ev.delta.forEach(action => {
|
238
238
|
if (Reflect.has(action, 'retain')) {
|
239
|
-
|
239
|
+
if (action.attributes) {
|
240
|
+
const formats = makeFormats(this.registry, action.attributes);
|
241
|
+
if (formats.length) {
|
242
|
+
slot.retain(action.retain, formats);
|
243
|
+
}
|
244
|
+
}
|
245
|
+
else {
|
246
|
+
slot.retain(action.retain);
|
247
|
+
}
|
240
248
|
}
|
241
249
|
else if (action.insert) {
|
242
250
|
const index = slot.index;
|
@@ -290,8 +298,19 @@ let Collaborate = class Collaborate {
|
|
290
298
|
let length = 0;
|
291
299
|
for (const action of actions) {
|
292
300
|
if (action.type === 'retain') {
|
293
|
-
|
294
|
-
|
301
|
+
const formats = action.formats;
|
302
|
+
if (formats) {
|
303
|
+
const keys = Object.keys(formats);
|
304
|
+
let length = keys.length;
|
305
|
+
keys.forEach(key => {
|
306
|
+
if (!this.registry.getFormatter(key)) {
|
307
|
+
length--;
|
308
|
+
Reflect.deleteProperty(formats, key);
|
309
|
+
}
|
310
|
+
});
|
311
|
+
if (length) {
|
312
|
+
content.format(offset, action.offset, formats);
|
313
|
+
}
|
295
314
|
}
|
296
315
|
else {
|
297
316
|
offset = action.offset;
|
@@ -589,4 +608,4 @@ function makeFormats(registry, attrs) {
|
|
589
608
|
}
|
590
609
|
return formats;
|
591
610
|
}
|
592
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sbGFib3JhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29sbGFib3JhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncy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Uge1xuICAgICAgICAgICAgICBsZW5ndGggPSAxXG4gICAgICAgICAgICAgIGNvbnN0IGNvbXBvbmVudCA9IHNsb3QuZ2V0Q29udGVudEF0SW5kZXgob2Zmc2V0KSBhcyBDb21wb25lbnRJbnN0YW5jZVxuICAgICAgICAgICAgICBjb25zdCBzaGFyZWRDb21wb25lbnQgPSB0aGlzLmNyZWF0ZVNoYXJlZENvbXBvbmVudEJ5Q29tcG9uZW50KGNvbXBvbmVudClcbiAgICAgICAgICAgICAgY29udGVudC5pbnNlcnRFbWJlZChvZmZzZXQsIHNoYXJlZENvbXBvbmVudClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChhY3Rpb24uZm9ybWF0cykge1xuICAgICAgICAgICAgICBjb250ZW50LmZvcm1hdChvZmZzZXQsIGxlbmd0aCwgYWN0aW9uLmZvcm1hdHMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNFbXB0eSAmJiBvZmZzZXQgPT09IDApIHtcbiAgICAgICAgICAgICAgY29udGVudC5kZWxldGUoY29udGVudC5sZW5ndGggLSAxLCAxKVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgb2Zmc2V0ICs9IGxlbmd0aFxuICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLnR5cGUgPT09ICdkZWxldGUnKSB7XG4gICAgICAgICAgICBjb25zdCBkZWx0YSA9IGNvbnRlbnQudG9EZWx0YSgpXG4gICAgICAgICAgICBjb250ZW50LmRlbGV0ZShvZmZzZXQsIGFjdGlvbi5jb3VudClcbiAgICAgICAgICAgIGlmIChjb250ZW50Lmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICBjb250ZW50Lmluc2VydCgwLCAnXFxuJywgZGVsdGFbMF0/LmF0dHJpYnV0ZXMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KVxuICAgIH0pXG4gICAgdGhpcy5jb250ZW50U3luY0NhY2hlcy5zZX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0pXG4gICAgICB9KVxuICAgIH1cbiAgICByZW1vdGVTbG90cy5vYnNlcnZlKHN5bmNSZW1vdGUpXG5cbiAgICBjb25zdCBzdWIgPSBzbG90cy5vbkNoYW5nZS5zdWJzY3JpYmUob3BlcmF0aW9ucyA9PiB7XG4gICAgICB0aGlzLnJ1bkxvY2FsVXBkYXRlKCgpID0+IHtcbiAgICAgICAgY29uc3QgYXBwbHlBY3Rpb25zID0gb3BlcmF0aW9ucy5hcHBseVxuICAgICAgICBsZXQgaW5kZXg6IG51bWJlclxuICAgICAgICBhcHBseUFjdGlvbnMuZm9yRWFjaChhY3Rpb24gPT4ge1xuICAgICAgICAgIGlmIChhY3Rpb24udHlwZSA9PT0gJ3JldGFpbicpIHtcbiAgICAgICAgICAgIGluZGV4ID0gYWN0aW9uLm9mZnNldFxuICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLnR5cGUgPT09ICdpbnNlcnRTbG90Jykge1xuICAgICAgICAgICAgY29uc3Qgc2xvdCA9IHNsb3RzLmdldChpbmRleCkhXG4gICAgICAgICAgICBjb25zdCBzaGFyZWRTbG90ID0gdGhpcy5jcmVhdGVTaGFyZWRTbG90QnlTbG90KHNsb3QpXG4gICAgICAgICAgICByZW1vdGVTbG90cy5pbnNlcnQoaW5kZXgsIFtzaGFyZWRTbG90XSlcbiAgICAgICAgICAgIGluZGV4KytcbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi50eXBlID09PSAnZGVsZXRlJykge1xuICAgICAgICAgICAgc2xvdHMuc2xpY2UoaW5kZXgsIGluZGV4ICsgYWN0aW9uLmNvdW50KS5mb3JFYWNoKHNsb3QgPT4ge1xuICAgICAgICAgICAgICB0aGlzLmNsZWFuU3Vic2NyaXB0aW9uc0J5U2xvdChzbG90KVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIHJlbW90ZVNsb3RzLmRlbGV0ZShpbmRleCwgYWN0aW9uLmNvdW50KVxuICAgICAgICAgIH1cbiAgICAgICAg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LnN1YnNjcmlwdGlvbnMuZm9yRWFjaChpID0+IGkudW5zdWJzY3JpYmUoKSlcbiAgfVxuXG4gIHByaXZhdGUgbGlzdGVuMigpIHtcbiAgICBjb25zdCByb290ID0gdGhpcy55RG9jLmdldFRleHQoJ2NvbnRlbnQnKVxuICAgIGNvbnN0IHJvb3RDb21wb25lbnQgPSB0aGlzLnJvb3RDb21wb25lbnRSZWYuY29tcG9uZW50IVxuICAgIHRoaXMubWFuYWdlciA9IG5ldyBVbmRvTWFuYWdlcihyb290LCB7XG4gICAgICB0cmFja2VkT3JpZ2luczogbmV3IFNldDxhbnk+KFt0aGlzLnlEb2NdKVxuICAgIH0pXG4gICAgdGhpcy5zeW5jQ29udGVudChyb290LCByb290Q29tcG9uZW50LnNsb3RzLmdldCgwKSEpXG5cbiAgICB0aGlzLnN1YnNjcmlwdGlvbnMucHVzaChcbiAgICAgIG1lcmdlKFxuICAgICAgICByb290Q29tcG9uZW50LmNoYW5nZU1hcmtlci5vbkZvcmNlQ2hhbmdlLFxuICAgICAgICByb290Q29tcG9uZW50LmNoYW5nZU1hcmtlci5vbkNoYW5nZVxuICAgICAgKS5waXBlKFxuICAgICAgICBtaWNyb1Rhc2soKVxuICAgICAgKS5zdWJzY3JpYmUoKCkgPT4ge1xuICAgICAgICB0aGlzLnlEb2MudHJhbnNhY3QoKCkgPT4ge1xuICAgICAgICAgIHRoaXMudXBkYXRlUmVtb3RlQWN0aW9ucy5mb3JFYWNoKGZuID0+IHtcbiAgICAgICAgICAgIGZuKClcbiAgICAgICAgICB9KVxuICAgICAgICAgIHRoaXMudXBkYXRlUmVtb3RlQWN0aW9ucyA9IFtdXG4gICAgICAgIH0sIHRoaXMueURvYylcbiAgICAgICAgdGhpcy5yZW5kZXJlci5yZW5kZXIoKVxuICAgICAgICB0aGlzLnNlbGVjdGlvbi5yZXN0b3JlKClcbiAgICAgIH0pXG4gICAgKVxuICB9XG5cbiAgcHJpdmF0ZSBzeW5jQ29udGVudChjb250ZW50O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9ucyA9PiB7XG4gICAgICB0aGlzLnJ1bkxvY2FsVXBkYXRlKCgpID0+IHtcbiAgICAgICAgbGV0IG9mZnNldCA9IDBcbiAgICAgICAgbGV0IGxlbmd0aCA9IDBcbiAgICAgICAgZm9yIChjb25zdCBhY3Rpb24gb2YgYWN0aW9ucykge1xuICAgICAgICAgIGlmIChhY3Rpb24udHlwZSA9PT0gJ3JldGFpbicpIHtcbiAgICAgICAgICAgIGNvbnN0IGZvcm1hdHMgPSBhY3Rpb24uZm9ybWF0c1xuICAgICAgICAgICAgaWYgKGZvcm1hdHMpIHtcbiAgICAgICAgICAgICAgY29uc3Qga2V5cyA9IE9iamVjdC5rZXlzKGZvcm1hdHMpXG4gICAgICAgICAgICAgIGxldCBsZW5ndGggPSBrZXlzLmxlbmd0aFxuICAgICAgICAgICAgICBrZXlzLmZvckVhY2goa2V5ID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMucmVnaXN0cnkuZ2V0Rm9ybWF0dGVyKGtleSkpIHtcbiAgICAgICAgICAgICAgICAgIGxlbmd0aC0tXG4gICAgICAgICAgICAgICAgICBSZWZsZWN0LmRlbGV0ZVByb3BlcnR5KGZvcm1hdHMsIGtleSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIGlmIChsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBjb250ZW50LmZvcm1hdChvZmZzZXQsIGFjdGlvbi5vZmZzZXQsIGZvcm1hdHMpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIG9mZnNldCA9IGFjdGlvbi5vZmZzZXRcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi50eXBlID09PSAnaW5zZXJ0Jykge1xuICAgICAgICAgICAgY29uc3QgZGVsdGEgPSBjb250ZW50LnRvRGVsdGEoKVxuICAgICAgICAgICAgY29uc3QgaXNFbXB0eSA9IGRlbHRhLmxlbmd0aCA9PT0gMSAmJiBkZWx0YVswXS5pbnNlcnQgPT09IFNsb3QuZW1wdHlQbGFjZWhvbGRlclxuICAgICAgICAgICAgaWYgKHR5cGVvZiBhY3Rpb24uY29udGVudCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgbGVuZ3RoID0gYWN0aW9uLmNvbnRlbnQubGVuZ3RoXG4gICAgICAgICAgICAgIGNvbnRlbnQuaW5zZXJ0KG9mZnNldCwgYWN0aW9uLmNvbnRlbnQpXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBsZW5ndGggPSAxXG4gICAgICAgICAgICAgIGNvbnN0IGNvbXBvbmVudCA9IHNsb3QuZ2V0Q29udGVudEF0SW5kZXgob2Zmc2V0KSBhcyBDb21wb25lbnRJbnN0YW5jZVxuICAgICAgICAgICAgICBjb25zdCBzaGFyZWRDb21wb25lbnQgPSB0aGlzLmNyZWF0ZVNoYXJlZENvbXBvbmVudEJ5Q29tcG9uZW50KGNvbXBvbmVudClcbiAgICAgICAgICAgICAgY29udGVudC5pbnNlcnRFbWJlZChvZmZzZXQsIHNoYXJlZENvbXBvbmVudClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChhY3Rpb24uZm9ybWF0cykge1xuICAgICAgICAgICAgICBjb250ZW50LmZvcm1hdChvZmZzZXQsIGxlbmd0aCwgYWN0aW9uLmZvcm1hdHMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNFbXB0eSAmJiBvZmZzZXQgPT09IDApIHtcbiAgICAgICAgICAgICAgY29udGVudC5kZWxldGUoY29udGVudC5sZW5ndGggLSAxLCAxKVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgb2Zmc2V0ICs9IGxlbmd0aFxuICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLnR5cGUgPT09ICdkZWxldGUnKSB7XG4gICAgICAgICAgICBjb25zdCBkZWx0YSA9IGNvbn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AgICAgICB0aGlzLnN5bmNDb250ZW50KGl0ZW0uZ2V0KCdjb250ZW50JyksIHNsb3QpXG4gICAgICAgICAgICAgIHRoaXMuc3luY1Nsb3QoaXRlbSwgc2xvdClcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZGVsZXRlKSB7XG4gICAgICAgICAgICBzbG90cy5yZXRhaW4oc2xvdHMuaW5kZXgpXG4gICAgICAgICAgICBzbG90cy5kZWxldGUoYWN0aW9uLmRlbGV0ZSlcbiAgICAgICAgICB9XG4gICAgICAgIH0pXG4gICAgICB9KVxuICAgIH1cbiAgICByZW1vdGVTbG90cy5vYnNlcnZlKHN5bmNSZW1vdGUpXG5cbiAgICBjb25zdCBzdWIgPSBzbG90cy5vbkNoYW5nZS5zdWJzY3JpYmUob3BlcmF0aW9ucyA9PiB7XG4gICAgICB0aGlzLnJ1bkxvY2FsVXBkYXRlKCgpID0+IHtcbiAgICAgICAgY29uc3QgYXBwbHlBY3Rpb25zID0gb3BlcmF0aW9ucy5hcHBseVxuICAgICAgICBsZXQgaW5kZXg6IG51bWJlclxuICAgICAgICBhcHBseUFjdGlvbnMuZm9yRWFjaChhY3Rpb24gPT4ge1xuICAgICAgICAgIGlmIChhY3Rpb24udHlwZSA9PT0gJ3JldGFpbicpIHtcbiAgICAgICAgICAgIGluZGV4ID0gYWN0aW9uLm9mZnNldFxuICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLnR5cGUgPT09ICdpbnNlcnRTbG90Jykge1xuICAgICAgICAgICAgY29uc3Qgc2xvdCA9IHNsb3RzLmdldChpbmRleCkhXG4gICAgICAgICAgICBjb25zdCBzaGFyZWRTbG90ID0gdGhpcy5jcmVhdGVTaGFyZWRTbG90QnlTbG90KHNsb3QpXG4gICAgICAgICAgICByZW1vdGVTbG90cy5pbnNlcnQoaW5kZXgsIFtzaGFyZWRTbG90XSlcbiAgICAgICAgICAgIGluZGV4KytcbiAgICAgICAgICB9IGVs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gICAgICAgIGZvcm1hdHMucHVzaChbZm9ybWF0dGVyLCBhdHRyc1trZXldXSlcbiAgICAgIH1cbiAgICB9KVxuICB9XG4gIHJldHVybiBmb3JtYXRzXG59XG4iXX0=
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@textbus/collaborate",
|
3
|
-
"version": "2.0.0-beta.
|
3
|
+
"version": "2.0.0-beta.4",
|
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",
|
@@ -27,8 +27,8 @@
|
|
27
27
|
"dependencies": {
|
28
28
|
"@tanbo/di": "^1.1.0",
|
29
29
|
"@tanbo/stream": "^1.0.0",
|
30
|
-
"@textbus/browser": "^2.0.0-beta.
|
31
|
-
"@textbus/core": "^2.0.0-beta.
|
30
|
+
"@textbus/browser": "^2.0.0-beta.4",
|
31
|
+
"@textbus/core": "^2.0.0-beta.4",
|
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": "81d69ab7d830e36737120e065ccfcf32eca22492"
|
48
48
|
}
|
package/src/collaborate.ts
CHANGED
@@ -141,7 +141,14 @@ export class Collaborate implements History {
|
|
141
141
|
slot.retain(0)
|
142
142
|
ev.delta.forEach(action => {
|
143
143
|
if (Reflect.has(action, 'retain')) {
|
144
|
-
|
144
|
+
if (action.attributes) {
|
145
|
+
const formats = makeFormats(this.registry, action.attributes)
|
146
|
+
if (formats.length) {
|
147
|
+
slot.retain(action.retain!, formats)
|
148
|
+
}
|
149
|
+
} else {
|
150
|
+
slot.retain(action.retain)
|
151
|
+
}
|
145
152
|
} else if (action.insert) {
|
146
153
|
const index = slot.index
|
147
154
|
let length = 1
|
@@ -191,8 +198,19 @@ export class Collaborate implements History {
|
|
191
198
|
let length = 0
|
192
199
|
for (const action of actions) {
|
193
200
|
if (action.type === 'retain') {
|
194
|
-
|
195
|
-
|
201
|
+
const formats = action.formats
|
202
|
+
if (formats) {
|
203
|
+
const keys = Object.keys(formats)
|
204
|
+
let length = keys.length
|
205
|
+
keys.forEach(key => {
|
206
|
+
if (!this.registry.getFormatter(key)) {
|
207
|
+
length--
|
208
|
+
Reflect.deleteProperty(formats, key)
|
209
|
+
}
|
210
|
+
})
|
211
|
+
if (length) {
|
212
|
+
content.format(offset, action.offset, formats)
|
213
|
+
}
|
196
214
|
} else {
|
197
215
|
offset = action.offset
|
198
216
|
}
|