@textbus/collaborate 2.1.3 → 2.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,7 @@
1
1
  import { Observable } from '@tanbo/stream';
2
- import { ComponentInitData, ComponentInstance, Controller, History, Registry, RootComponentRef, Scheduler, Selection, SelectionPaths, Starter, Translator } from '@textbus/core';
2
+ import { Controller, History, Registry, RootComponentRef, Scheduler, Selection, SelectionPaths, Starter, Translator } from '@textbus/core';
3
3
  import { Doc as YDoc } from 'yjs';
4
4
  import { CollaborateCursor, RemoteSelection } from './collaborate-cursor';
5
- export declare abstract class TranslatorFallback {
6
- abstract createComponentByData(name: string, data: ComponentInitData): ComponentInstance | null;
7
- }
8
5
  export declare class Collaborate implements History {
9
6
  private stackSize;
10
7
  private rootComponentRef;
@@ -15,7 +12,6 @@ export declare class Collaborate implements History {
15
12
  private registry;
16
13
  private selection;
17
14
  private starter;
18
- private translatorFallback;
19
15
  onSelectionChange: Observable<SelectionPaths>;
20
16
  yDoc: YDoc;
21
17
  onBack: Observable<void>;
@@ -39,7 +35,7 @@ export declare class Collaborate implements History {
39
35
  private contentMap;
40
36
  private updateRemoteActions;
41
37
  private noRecord;
42
- constructor(stackSize: number, rootComponentRef: RootComponentRef, collaborateCursor: CollaborateCursor, controller: Controller, scheduler: Scheduler, translator: Translator, registry: Registry, selection: Selection, starter: Starter, translatorFallback: TranslatorFallback);
38
+ constructor(stackSize: number, rootComponentRef: RootComponentRef, collaborateCursor: CollaborateCursor, controller: Controller, scheduler: Scheduler, translator: Translator, registry: Registry, selection: Selection, starter: Starter);
43
39
  listen(): void;
44
40
  updateRemoteSelection(paths: RemoteSelection[]): void;
45
41
  back(): void;
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
- import { Inject, Injectable, Optional } from '@tanbo/di';
13
+ import { Inject, Injectable } from '@tanbo/di';
14
14
  import { delay, filter, map, Subject } from '@tanbo/stream';
15
15
  import { ChangeOrigin, ContentType, Controller, HISTORY_STACK_SIZE, makeError, Registry, RootComponentRef, Scheduler, Selection, Slot, Starter, Translator } from '@textbus/core';
16
16
  import { Array as YArray, Doc as YDoc, Map as YMap, Text as YText, UndoManager, createAbsolutePositionFromRelativePosition, createRelativePositionFromTypeIndex } from 'yjs';
@@ -55,10 +55,8 @@ class ContentMap {
55
55
  }
56
56
  }
57
57
  }
58
- export class TranslatorFallback {
59
- }
60
58
  let Collaborate = class Collaborate {
61
- constructor(stackSize, rootComponentRef, collaborateCursor, controller, scheduler, translator, registry, selection, starter, translatorFallback) {
59
+ constructor(stackSize, rootComponentRef, collaborateCursor, controller, scheduler, translator, registry, selection, starter) {
62
60
  this.stackSize = stackSize;
63
61
  this.rootComponentRef = rootComponentRef;
64
62
  this.collaborateCursor = collaborateCursor;
@@ -68,7 +66,6 @@ let Collaborate = class Collaborate {
68
66
  this.registry = registry;
69
67
  this.selection = selection;
70
68
  this.starter = starter;
71
- this.translatorFallback = translatorFallback;
72
69
  this.yDoc = new YDoc();
73
70
  this.backEvent = new Subject();
74
71
  this.forwardEvent = new Subject();
@@ -272,7 +269,7 @@ let Collaborate = class Collaborate {
272
269
  ev.delta.forEach(action => {
273
270
  if (Reflect.has(action, 'retain')) {
274
271
  if (action.attributes) {
275
- const formats = makeFormats(this.registry, action.attributes);
272
+ const formats = remoteFormatsToLocal(this.registry, action.attributes);
276
273
  if (formats.length) {
277
274
  slot.retain(action.retain, formats);
278
275
  }
@@ -287,7 +284,7 @@ let Collaborate = class Collaborate {
287
284
  let length = 1;
288
285
  if (typeof action.insert === 'string') {
289
286
  length = action.insert.length;
290
- slot.insert(action.insert, makeFormats(this.registry, action.attributes));
287
+ slot.insert(action.insert, remoteFormatsToLocal(this.registry, action.attributes));
291
288
  }
292
289
  else {
293
290
  const sharedComponent = action.insert;
@@ -342,7 +339,18 @@ let Collaborate = class Collaborate {
342
339
  if (action.type === 'retain') {
343
340
  const formats = action.formats;
344
341
  if (formats) {
345
- content.format(offset, action.offset, localFormatToRemote(formats, this.registry));
342
+ const keys = Object.keys(formats);
343
+ let length = keys.length;
344
+ keys.forEach(key => {
345
+ const formatter = this.registry.getFormatter(key);
346
+ if (!formatter) {
347
+ length--;
348
+ Reflect.deleteProperty(formats, key);
349
+ }
350
+ });
351
+ if (length) {
352
+ content.format(offset, action.offset, formats);
353
+ }
346
354
  }
347
355
  else {
348
356
  offset = action.offset;
@@ -353,12 +361,12 @@ let Collaborate = class Collaborate {
353
361
  const isEmpty = delta.length === 1 && delta[0].insert === Slot.emptyPlaceholder;
354
362
  if (typeof action.content === 'string') {
355
363
  length = action.content.length;
356
- content.insert(offset, action.content, localFormatToRemote(action.formats || {}, this.registry));
364
+ content.insert(offset, action.content, action.formats || {});
357
365
  }
358
366
  else {
359
367
  length = 1;
360
368
  const sharedComponent = this.createSharedComponentByComponent(action.ref);
361
- content.insertEmbed(offset, sharedComponent, localFormatToRemote(action.formats || {}, this.registry));
369
+ content.insertEmbed(offset, sharedComponent, action.formats || {});
362
370
  }
363
371
  if (isEmpty && offset === 0) {
364
372
  content.delete(content.length - 1, 1);
@@ -545,9 +553,14 @@ let Collaborate = class Collaborate {
545
553
  sharedSlot.set('content', sharedContent);
546
554
  let offset = 0;
547
555
  slot.toDelta().forEach(i => {
548
- let formats;
556
+ let formats = {};
549
557
  if (i.formats) {
550
- formats = formatsToRemote(i.formats);
558
+ i.formats.forEach(item => {
559
+ formats[item[0].name] = item[1];
560
+ });
561
+ }
562
+ else {
563
+ formats = null;
551
564
  }
552
565
  if (typeof i.insert === 'string') {
553
566
  sharedContent.insert(offset, i.insert, formats);
@@ -571,16 +584,10 @@ let Collaborate = class Collaborate {
571
584
  });
572
585
  const name = yMap.get('name');
573
586
  const state = yMap.get('state');
574
- let instance = this.translator.createComponentByData(name, {
587
+ const instance = this.translator.createComponentByData(name, {
575
588
  state,
576
589
  slots
577
590
  });
578
- if (!instance) {
579
- instance = this.translatorFallback.createComponentByData(name, {
580
- state,
581
- slots
582
- });
583
- }
584
591
  if (instance) {
585
592
  instance.slots.toArray().forEach((slot, index) => {
586
593
  let sharedSlot = sharedSlots.get(index);
@@ -607,13 +614,13 @@ let Collaborate = class Collaborate {
607
614
  for (const action of delta) {
608
615
  if (action.insert) {
609
616
  if (typeof action.insert === 'string') {
610
- slot.insert(action.insert, makeFormats(this.registry, action.attributes));
617
+ slot.insert(action.insert, remoteFormatsToLocal(this.registry, action.attributes));
611
618
  }
612
619
  else {
613
620
  const sharedComponent = action.insert;
614
621
  const canInsertInlineComponent = slot.schema.includes(ContentType.InlineComponent);
615
622
  const component = this.createComponentBySharedComponent(sharedComponent, canInsertInlineComponent);
616
- slot.insert(component, makeFormats(this.registry, action.attributes));
623
+ slot.insert(component, remoteFormatsToLocal(this.registry, action.attributes));
617
624
  this.syncSlots(sharedComponent.get('slots'), component);
618
625
  this.syncComponent(sharedComponent, component);
619
626
  }
@@ -651,7 +658,6 @@ let Collaborate = class Collaborate {
651
658
  Collaborate = __decorate([
652
659
  Injectable(),
653
660
  __param(0, Inject(HISTORY_STACK_SIZE)),
654
- __param(9, Optional()),
655
661
  __metadata("design:paramtypes", [Number, RootComponentRef,
656
662
  CollaborateCursor,
657
663
  Controller,
@@ -659,54 +665,14 @@ Collaborate = __decorate([
659
665
  Translator,
660
666
  Registry,
661
667
  Selection,
662
- Starter,
663
- TranslatorFallback])
668
+ Starter])
664
669
  ], Collaborate);
665
670
  export { Collaborate };
666
- function formatsToRemote(formats) {
667
- const result = {};
668
- for (const item of formats) {
669
- const [formatter, values] = item;
670
- if (typeof formatter.createValueIdIfOverlap === 'function') {
671
- if (Array.isArray(values)) {
672
- values.forEach(value => {
673
- const valueId = formatter.createValueIdIfOverlap(value);
674
- result[`${formatter.name}:${valueId}`] = value;
675
- });
676
- break;
677
- }
678
- }
679
- result[formatter.name] = values;
680
- }
681
- return result;
682
- }
683
- function localFormatToRemote(formats, registry) {
684
- const keys = Object.keys(formats);
685
- const result = {};
686
- for (const key of keys) {
687
- const formatter = registry.getFormatter(key);
688
- if (!formatter) {
689
- break;
690
- }
691
- if (typeof formatter.createValueIdIfOverlap === 'function') {
692
- const values = formats[key];
693
- if (Array.isArray(values)) {
694
- values.forEach(value => {
695
- const valueId = formatter.createValueIdIfOverlap(value);
696
- result[`${formatter.name}:${valueId}`] = value;
697
- });
698
- break;
699
- }
700
- }
701
- result[key] = formats[key];
702
- }
703
- return result;
704
- }
705
- function makeFormats(registry, attrs) {
671
+ function remoteFormatsToLocal(registry, attrs) {
706
672
  const formats = [];
707
673
  if (attrs) {
708
674
  Object.keys(attrs).forEach(key => {
709
- const formatter = registry.getFormatter(key.split(':')[0]);
675
+ const formatter = registry.getFormatter(key);
710
676
  if (formatter) {
711
677
  formats.push([formatter, attrs[key]]);
712
678
  }
@@ -714,4 +680,4 @@ function makeFormats(registry, attrs) {
714
680
  }
715
681
  return formats;
716
682
  }
717
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sbGFib3JhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29sbGFib3JhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsUUFBUSxFQUFFLE1BQU0sV0FBVyxDQUFBO0FBQ3hELE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLEdBQUcsRUFBYyxPQUFPLEVBQWdCLE1BQU0sZUFBZSxDQUFBO0FBQ3JGLE9BQU8sRUFDTCxZQUFZLEVBRVosV0FBVyxFQUFFLFVBQVUsRUFFZCxrQkFBa0IsRUFDM0IsU0FBUyxFQUNULFFBQVEsRUFDUixnQkFBZ0IsRUFDaEIsU0FBUyxFQUNULFNBQVMsRUFFVCxJQUFJLEVBQ0osT0FBTyxFQUNQLFVBQVUsR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5zdWJzY3JpcHRpb25zLnB1c2goXG4gICAgICB0aGlzLnNlbGVjdGlvbi5vbkNoYW5nZS5zdWJzY3JpYmUoKCkgPT4ge1xuICAgICAgICBjb25zdCBwYXRocyA9IHRoaXMuc2VsZWN0aW9uLmdldFBhdGhzKClcbiAgICAgICAgdGhpcy5zZWxlY3Rpb25DaGFuZ2VFdmVudC5uZXh0KHBhdGhzKVxuICAgICAgfSksXG4gICAgICB0aGlzLnNjaGVkdWxlci5vbkRvY0NoYW5nZWQucGlwZShcbiAgICAgICAgbWFwKGl0ZW0gPT4ge1xuICAgICAgICAgIHJldHVybiBpdGVtLmZpbHRlcihpID0+IHtcbiAgICAgICAgICAgIHJldHVybiBpLmZyb20gIT09IENoYW5nZU9yaWdpbi5SZW1vdGVcbiAgICAgICAgICB9KVxuICAgICAgICB9KSxcbiAgICAgICAgZmlsdGVyKGl0ZW0gPT4ge1xuICAgICAgICAgIHJldHVybiBpdGVtLmxlbmd0aFxuICAgICAgICB9KVxuICAgICAgKS5zdWJzY3JpYmUoKCkgPT4ge1xuICAgICAgICBjb25zdCB1cGRhdGVzOiBVcGRhdGVbXSA9IFtdXG5cbiAgICAgICAgbGV0IHVwZGF0ZTogVXBkYXRlIHwgbnVsbCA9IG51bGxcblxuICAgICAgICBmb3IgKGNvbnN0IGl0ZW0gb2YgdGhpcy51cGRhdGVSZW1vdGVBY3Rpb25zKSB7XG4gICAgICAgICAgaWYgKCF1cGRhdGUpIHtcbiAgICAgICAgICAgIHVwZGF0ZSA9IHtcbiAgICAgICAgICAgICAgcmVjb3JkOiBpdGVtLnJlY29yZCxcbiAgICAgICAgICAgICAgYWN0aW9uczogW11cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHVwZGF0ZXMucHVzaCh1cGRhdGUpXG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICh1cGRhdGUucmVjb3JkID09PSBpdGVtLnJlY29yZCkge1xuICAgICAgICAgICAgdXBkYXRlLmFjdGlvbnMucHVzaChpdGVtLmFjdGlvbilcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXBkYXRlID0ge1xuICAgICAgICAgICAgICByZWNvcmQ6IGl0ZW0ucmVjb3JkLFxuICAgICAgICAgICAgICBhY3Rpb25zOiBbaXRlbS5hY3Rpb25dXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB1cGRhdGVzLnB1c2godXBkYXRlKVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMudXBkYXRlUmVtb3RlQWN0aW9ucyA9IFtdXG5cbiAgICAgICAgZm9yIChjb25zdCBpdGVtIG9mIHVwZGF0ZXMpIHtcbiAgICAgICAgICB0aGlzLnlEb2MudHJhbnNhY3QoKCkgPT4ge1xuICAgICAgICAgICAgaXRlbS5hY3Rpb25zLmZvckVhY2goZm4gPT4ge1xuICAgICAgICAgICAgICBmbigpXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH0sIGl0ZW0ucmVjb3JkID8gdGhpcy55RG9jIDogdGhpcy5ub1JlY29yZClcbiAgICAgICAgfVxuICAgICAgfSlcbiAgICApXG4gICAgdGhpcy5zeW5jUm9vdENvbXBvbmVudChyb290LCByb290Q29tcG9uZW50KVxuICB9XG5cbiAgdXBkYXRlUmVtb3RlU2VsZWN0aW9uKHBhdGhzOiBSZW1vdGVTZWxlY3Rpb25bXSkge1xuICAgIHRoaXMuY29sbGFib3JhdGVDdXJzb3IuZHJhdyhwYXRocylcbiAgfVxuXG4gIGJhY2soKSB7XG4gICAgaWYgKHRoaXMuY2FuQmFjaykge1xuICAgICAgdGhpcy5tYW5hZ2VyPy51bmRvKClcbiAgICAgIHRoaXMuYmFja0V2ZW50Lm5leHQoKVxuICAgIH1cbiAgfVxuXG4gIGZvcndhcmQoKSB7XG4gICAgaWYgKHRoaXMuY2FuRm9yd2FyZCkge1xuICAgICAgdGhpcy5tYW5hZ2VyPy5yZWRvKClcbiAgICAgIHRoaXMuZm9yd2FyZEV2ZW50Lm5le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AgICAgICAgICAgICBpZiAoZm9ybWF0cy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBzbG90LnJldGFpbihhY3Rpb24ucmV0YWluISwgZm9ybWF0cylcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBzbG90LnJldGFpbihzbG90LmluZGV4ICsgYWN0aW9uLnJldGFpbilcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHNsb3QucmV0YWluKGFjdGlvbi5yZXRhaW4pXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uaW5zZXJ0KSB7XG4gICAgICAgICAgICBjb25zdCBpbmRleCA9IHNsb3QuaW5kZXhcbiAgICAgICAgICAgIGxldCBsZW5ndGggPSAxXG4gICAgICAgICAgICBpZiAodHlwZW9mIGFjdGlvbi5pbnNlcnQgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIGxlbmd0aCA9IGFjdGlvbi5pbnNlcnQubGVuZ3RoXG4gICAgICAgICAgICAgIHNsb3QuaW5zZXJ0KGFjdGlvbi5pbnNlcnQsIG1ha2VGb3JtYXRzKHRoaXMucmVnaXN0cnksIGFjdGlvbi5hdHRyaWJ1dGVzKSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGNvbnN0IHNoYXJlZENvbXBvbmVudCA9IGFjdGlvbi5pbnNlcnQgYXMgWU1hcDxhbnk+XG4gICAgICAgICAgICAgIGNvbnN0IGNhbkluc2VydElubGluZUNvbXBvbmVudCA9IHNsb3Quc2NoZW1hLmluY2x1ZGVzKENvbnRlbnRUeXBlLklubGluZUNvbXBvbmVudClcbiAgICAgICAgICAgICAgY29uc3QgY29tcG9uZW50ID0gdGhpcy5jcmVhdGVDb21wb25lbnRCeVNoYXJlZENvbXBvbmVudChzaGFyZWRDb21wb25lbnQsIGNhbkluc2VydElubGluZUNvbXBvbmVudClcbiAgICAgICAgICAgICAgdGhpcy5zeW5jU2xvdHMoc2hhcmVkQ29tcG9uZW50LmdldCgnc2xvdHMnKSwgY29tcG9uZW50KVxuICAgICAgICAgICAgICB0aGlzLnN5bmNDb21wb25lbnQoc2hhcmVkQ29tcG9uZW50LCBjb21wb25lbnQpXG4gICAgICAgICAgICAgIHNsb3QuaW5zZXJ0KGNvbXBvbmVudClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aGlzLnNlbGVjdGlvbi5pc1NlbGVjdGVkKSB7XG4gICAgICAgICAgICAgIGlmIChzbG90ID09PSB0aGlzLnNlbGVjdGlvbi5hbmNob3JTbG90ICYmIHRoaXMuc2VsZWN0aW9uLmFuY2hvck9mZnNldCEgPiBpbmRleCkge1xuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0aW9uLnNldEFuY2hvcihzbG90LCB0aGlzLnNlbGVjdGlvbi5hbmNob3JPZmZzZXQhICsgbGVuZ3RoKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGlmIChzbG90ID09PSB0aGlzLnNlbGVjdGlvbi5mb2N1c1Nsb3QgJiYgdGhpcy5zZWxlY3Rpb24uZm9jdXNPZmZzZXQhID4gaW5kZXgpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdGlvbi5zZXRGb2N1cyhzbG90LCB0aGlzLnNlbGVjdGlvbi5mb2N1c09mZnNldCEgKyBsZW5ndGgpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5kZWxldGUpIHtcbiAgICAgICAgICAgIGNvbnN0IGluZGV4ID0gc2xvdC5pbmRleFxuICAgICAgICAgICAgc2xvdC5yZXRhaW4oc2xvdC5pbmRleClcbiAgICAgICAgICAgIHNsb3QuZGVsZXRlKGFjdGlvbi5kZWxldGUpXG4gICAgICAgICAgICBpZiAodGhpcy5zZWxlY3Rpb24uaXNTZWxlY3RlZCkge1xuICAgICAgICAgICAgICBpZiAoc2xvdCA9PT0gd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gICAgICAgICAgICBsZW5ndGggPSAxXG4gICAgICAgICAgICAgIGNvbnN0IHNoYXJlZENvbXBvbmVudCA9IHRoaXMuY3JlYXRlU2hhcmVkQ29tcG9uZW50QnlDb21wb25lbnQoYWN0aW9uLnJlZiBhcyBDb21wb25lbnRJbnN0YW5jZSlcbiAgICAgICAgICAgICAgY29udGVudC5pbnNlcnRFbWJlZChvZmZzZXQsIHNoYXJlZENvbXBvbmVudCwgbG9jYWxGb3JtYXRUb1JlbW90ZShhY3Rpb24uZm9ybWF0cyB8fCB7fSwgdGhpcy5yZWdpc3RyeSkpXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChpc0VtcHR5ICYmIG9mZnNldCA9PT0gMCkge1xuICAgICAgICAgICAgICBjb250ZW50LmRlbGV0ZShjb250ZW50Lmxlbmd0aCAtIDEsIDEpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBvZmZzZXQgKz0gbGVuZ3RoXG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24udHlwZSA9PT0gJ2RlbGV0ZScpIHtcbiAgICAgICAgICAgIGNvbnN0IGRlbHRhID0gY29udGVudC50b0RlbHRhKClcbiAgICAgICAgICAgIGlmIChjb250ZW50Lmxlbmd0aCkge1xuICAgICAgICAgICAgICBjb250ZW50LmRlbGV0ZShvZmZzZXQsIGFjdGlvbi5jb3VudClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjb250ZW50Lmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICBjb250ZW50Lmluc2VydCgwLCAnXFxuJywgZGVsdGFbMF0/LmF0dHJpYnV0ZXMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KVxuICAgIH0pXG5cbiAgICBzdWIuYWRkKHNsb3Qub25DaGlsZENvbXBvbmVudFJlbW92ZS5zdWJzY3JpYmUoY29tcG9uZW50cyA9PiB7XG4gICAgICBjb21wb25lbnRzLmZvckVh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iBpdGVtLmxlbmd0aFxuICAgICAgICB9KVxuICAgICAgKS5zdWJzY3JpYmUoKCkgPT4ge1xuICAgICAgICBjb25zdCB1cGRhdGVzOiBVcGRhdGVbXSA9IFtdXG5cbiAgICAgICAgbGV0IHVwZGF0ZTogVXBkYXRlIHwgbnVsbCA9IG51bGxcblxuICAgICAgICBmb3IgKGNvbnN0IGl0ZW0gb2YgdGhpcy51cGRhdGVSZW1vdGVBY3Rpb25zKSB7XG4gICAgICAgICAgaWYgKCF1cGRhdGUpIHtcbiAgICAgICAgICAgIHVwZGF0ZSA9IHtcbiAgICAgICAgICAgICAgcmVjb3JkOiBpdGVtLnJlY29yZCxcbiAgICAgICAgICAgICAgYWN0aW9uczogW11cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHVwZGF0ZXMucHVzaCh1cGRhdGUpXG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICh1cGRhdGUucmVjb3JkID09PSBpdGVtLnJlY29yZCkge1xuICAgICAgICAgICAgdXBkYXRlLmFjdGlvbnMucHVzaChpdGVtLmFjdGlvbilcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXBkYXRlID0ge1xuICAgICAgICAgICAgICByZWNvcmQ6IGl0ZW0ucmVjb3JkLFxuICAgICAgICAgICAgICBhY3Rpb25zOiBbaXRlbS5hY3Rpb25dXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB1cGRhdGVzLnB1c2godXBkYXRlKVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMudXBkYXRlUmVtb3RlQWN0aW9ucyA9IFtdXG5cbiAgICAgICAgZm9yIChjb25zdCBpdGVtIG9mIHVwZGF0ZXMpIHtcbiAgICAgICAgICB0aGlzLnlEb2MudHJhbnNhY3QoKCkgPT4ge1xuICAgICAgICAgICAgaXRlbS5hY3Rpb25zLmZvckVhY2goZm4gPT4ge1xuICAgICAgICAgICAgICBmbigpXG4gICAgICAgICAgICB9KVxuICAgICA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ICB9XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiBudWxsXG4gIH1cblxuICBwcml2YXRlIHN5bmNDb250ZW50KGNvbnRlbnQ6IFlUZXh0LCBzbG90OiBTbG90KSB7XG4gICAgdGhpcy5jb250ZW50TWFwLnNldChzbG90LCBjb250ZW50KVxuICAgIGNvbnN0IHN5bmNSZW1vdGUgPSAoZXYsIHRyKSA9PiB7XG4gICAgICB0aGlzLnJ1blJlbW90ZVVwZGF0ZSh0ciwgKCkgPT4ge1xuICAgICAgICBzbG90LnJldGFpbigwKVxuICAgICAgICBldi5kZWx0YS5mb3JFYWNoKGFjdGlvbiA9PiB7XG4gICAgICAgICAgaWYgKFJlZmxlY3QuaGFzKGFjdGlvbiwgJ3JldGFpbicpKSB7XG4gICAgICAgICAgICBpZiAoYWN0aW9uLmF0dHJpYnV0ZXMpIHtcbiAgICAgICAgICAgICAgY29uc3QgZm9ybWF0cyA9IHJlbW90ZUZvcm1hdHNUb0xvY2FsKHRoaXMucmVnaXN0cnksIGFjdGlvbi5hdHRyaWJ1dGVzKVxuICAgICAgICAgICAgICBpZiAoZm9ybWF0cy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBzbG90LnJldGFpbihhY3Rpb24ucmV0YWluISwgZm9ybWF0cylcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBzbG90LnJldGFpbihzbG90LmluZGV4ICsgYWN0aW9uLnJldGFpbilcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHNsb3QucmV0YWluKGFjdGlvbi5yZXRhaW4pXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uaW5zZXJ0KSB7XG4gICAgICAgICAgICBjb25zdCBpbmRleCA9IHNsb3QuaW5kZXhcbiAgICAgICAgICAgIGxldCBsZW5ndGggPSAxXG4gICAgICAgICAgICBpZiAodHlwZW9mIGFjdGlvbi5pbnNlcnQgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIGxlbmd0aCA9IGFjdGlvbi5pbnNlcnQubGVuZ3RoXG4gICAgICAgICAgICAgIHNsb3QuaW5zZXJ0KGFjdGlvbi5pbnNlcnQsIHJlbW90ZUZvcm1hdHNUb0xvY2FsKHRoaXMucmVnaXN0cnksIGFjdGlvbi5hdHRyaWJ1dGVzKSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGNvbnN0IHNoYXJlZENvbXBvbmVudCA9IGFjdGlvbi5pbnNlcnQgYXMgWU1hcDxhbnk+XG4gICAgICAgICAgICAgIGNvbnN0IGNhbkluc2VydElubGluZUNvbXBvbmVudCA9IHNsb3Quc2NoZW1hLmluY2x1ZGVzKENvbnRlbnRUeXBlLklubGluZUNvbXBvbmVudClcbiAgICAgICAgICAgICAgY29uc3QgY29tcG9uZW50ID0gdGhpcy5jcmVhdGVDb21wb25lbnRCeVNoYXJlZENvbXBvbmVudChzaGFyZWRDb21wb25lbnQsIGNhbkluc2VydElubGluZUNvbXBvbmVudClcbiAgICAgICAgICAgICAgdGhpcy5zeW5jU2xvdHMoc2hhcmVkQ29tcG9uZW50LmdldCgnc2xvdHMnKSwgY29tcG9uZW50KVxuICAgICAgICAgICAgICB0aGlzLnN5bmNDb21wb25lbnQoc2hhcmVkQ29tcG9uZW50LCBjb21wb25lbnQpXG4gICAgICAgICAgICAgIHNsb3QuaW5zZXJ0KGNvbXBvbmVudClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aGlzLnNlbGVjdGlvbi5pc1NlbGVjdGVkKSB7XG4gICAgICAgICAgICAgIGlmIChzbG90ID09PSB0aGlzLnNlbGVjdGlvbi5hbmNob3JTbG90ICYmIHRoaXMuc2VsZWN0aW9uLmFuY2hvck9mZnNldCEgPiBpbmRleCkge1xuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0aW9uLnNldEFuY2hvcihzbG90LCB0aGlzLnNlbGVjdGlvbi5hbmNob3JPZmZzZXQhICs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RlKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uYXR0cmlidXRlcykge1xuICAgICAgICAgICAgc2xvdC51cGRhdGVTdGF0ZShkcmFmdCA9PiB7XG4gICAgICAgICAgICAgIGlmICh0eXBlb2YgZHJhZnQgPT09ICdvYmplY3QnICYmIGRyYWZ0ICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihkcmFmdCwgYWN0aW9uLmF0dHJpYnV0ZXMpXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGFjdGlvbi5hdHRyaWJ1dGVzXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfVxuICAgICAgICB9KVxuICAgICAgfSlcbiAgICB9XG4gICAgY29udGVudC5vYnNlcnZlKHN5bmNSZW1vdGUpXG5cbiAgICBjb25zdCBzdWIgPSBzbG90Lm9uQ29udGVudENoYW5nZS5zdWJzY3JpYmUoYWN0aW9ucyA9PiB7XG4gICAgICB0aGlzLnJ1bkxvY2FsVXBkYXRlKCgpID0+IHtcbiAgICAgICAgbGV0IG9mZnNldCA9IDBcbiAgICAgICAgbGV0IGxlbmd0aCA9IDBcbiAgICAgICAgZm9yIChjb25zdCBhY3Rpb24gb2YgYWN0aW9ucykge1xuICAgICAgICAgIGlmIChhY3Rpb24udHlwZSA9PT0gJ3JldGFpbicpIHtcbiAgICAgICAgICAgIGNvbnN0IGZvcm1hdHMgPSBhY3Rpb24uZm9ybWF0c1xuICAgICAgICAgICAgaWYgKGZvcm1hdHMpIHtcbiAgICAgICAgICAgICAgY29uc3Qga2V5cyA9IE9iamVjdC5rZXlzKGZvcm1hdHMpXG4gICAgICAgICAgICAgIGxldCBsZW5ndGggPSBrZXlzLmxlbmd0aFxuICAgICAgICAgICAgICBrZXlzLmZvckVhY2goa2V5ID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBmb3JtYXR0ZXIgPSB0aGlzLnJlZ2lzdHJ5LmdldEZvcm1hdHRlcihrZXkpXG4gICAgICAgICAgICAgICAgaWYgKCFmb3JtYXR0ZXIpIHtcbiAgICAgICAgICAgICAgICAgIGxlbmd0aC0tXG4gICAgICAgICAgICAgICAgICBSZWZsZWN0LmRlbGV0ZVByb3BlcnR5KGZvcm1hdHMsIGtleSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIGlmIChsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBjb250ZW50LmZvcm1hdChvZmZzZXQsIGFjdGlvbi5vZmZzZXQsIGZvcm1hdHMpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIG9mZnNldCA9IGFjdGlvbi5vZmZzZXRcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi50eXBlID09PSAnaW5zZXJ0Jykge1xuICAgICAgICAgICAgY29uc3QgZGVsdGEgPSBjb250ZW50LnRvRGVsdGEoKVxuICAgICAgICAgICAgY29uc3QgaXNFbXB0eSA9IGRlbHRhLmxlbmd0aCA9PT0gMSAmJiBkZWx0YVswXS5pbnNlcnQgPT09IFNsb3QuZW1wdHlQbGFjZWhvbGRlclxuICAgICAgICAgICAgaWYgKHR5cGVvZiBhY3Rpb24uY29udGVudCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgbGVuZ3RoID0gYWN0aW9uLmNvbnRlbnQubGVuZ3RoXG4gICAgICAgICAgICAgIGNvbnRlbnQuaW5zZXJ0KG9mZnNldCwgYWN0aW9uLmNvbnRlbnQsIGFjdGlvbi5mb3JtYXRzIHx8IHt9KVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgbGVuZ3RoID0gMVxuICAgICAgICAgICAgICBjb25zdCBzaGFyZWRDb21wb25lbnQgPSB0aGlzLmNyZWF0ZVNoYXJlZENvbXBvbmVudEJ5Q29tcG9uZW50KGFjdGlvbi5yZWYgYXMgQ29tcG9uZW50SW5zdGFuY2UpXG4gICAgICAgICAgICAgIGNvbnRlbnQuaW5zZXJ0RW1iZWQob2Zmc2V0LCBzaGFyZWRDb21wb25lbnQsIGFjdGlvbi5mb3JtYXRzIHx8IHt9KVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoaXNFbXB0eSAmJiBvZmZzZXQgPT09IDApIHtcbiAgICAgICAgICAgICAgY29udGVudC5kZWxldGUoY29udGVudC5sZW5ndGggLSAxLCAxKVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgb2Zmc2V0ICs9IGxlbmd0aFxuICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLnR5cGUgPT09ICdkZWxldGUnKSB7XG4gICAgICAgICAgICBjb25zdCBkZWx0YSA9IGNvbnRlbnQudG9EZWx0YSgpXG4gICAgICAgICAgICBpZiAoY29udGVudC5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgY29udGVudC5kZWxldGUob2Zmc2V0LCBhY3Rpb24uY291bnQpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY29udGVudC5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgY29udGVudC5pbnNlcnQoMCwgJ1xcbicsIGRlbHRhWzBdPy5hdHRyaWJ1dGVzKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSlcbiAgICB9KVxuXG4gICAgc3ViLmFkZChzbG90Lm9uQ2hpbGRDb21wb25lbnRSZW1vdmUuc3Vic2NyaWJlKGNvbXBvbmVudHMgPT4ge1xuICAgICAgY29tcG9uZW50cy5mb3JFYWNoKGMgPT4ge1xuICAgICAgICB0aGlzLmNsZWFuU3Vic2NyaXB0aW9uc0J5Q29tcG9uZW50KGMpXG4gICAgICB9KVxuICAgIH0pKVxuICAgIHRoaXMuY29udGV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c2xvdClcbiAgICAgICAgICAgICAgaW5kZXgrK1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5kZWxldGUpIHtcbiAgICAgICAgICAgIHNsb3RzLnJldGFpbihpbmRleClcbiAgICAgICAgICAgIHNsb3RzLmRlbGV0ZShhY3Rpb24uZGVsZXRlKVxuICAgICAgICAgIH1cbiAgICAgICAgfSlcbiAgICAgIH0pXG4gICAgfVxuICAgIHJlbW90ZVNsb3RzLm9ic2VydmUoc3luY1JlbW90ZSlcblxuICAgIGNvbnN0IHN1YiA9IHNsb3RzLm9uQ2hhbmdlLnN1YnNjcmliZShvcGVyYXRpb25zID0+IHtcbiAgICAgIHRoaXMucnVuTG9jYWxVcGRhdGUoKCkgPT4ge1xuICAgICAgICBjb25zdCBhcHBseUFjdGlvbnMgPSBvcGVyYXRpb25zLmFwcGx5XG4gICAgICAgIGxldCBpbmRleDogbnVtYmVyXG4gICAgICAgIGFwcGx5QWN0aW9ucy5mb3JFYWNoKGFjdGlvbiA9PiB7XG4gICAgICAgICAgaWYgKGFjdGlvbi50eXBlID09PSAncmV0YWluJykge1xuICAgICAgICAgICAgaW5kZXggPSBhY3Rpb24ub2Zmc2V0XG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24udHlwZSA9PT0gJ2luc2VydFNsb3QnKSB7XG4gICAgICAgICAgICBjb25zdCBzaGFyZWRTbG90ID0gdGhpcy5jcmVhdGVTaGFyZWRTbG90QnlTbG90KGFjdGlvbi5yZWYpXG4gICAgICAgICAgICByZW1vdGVTbG90cy5pbnNlcnQoaW5kZXgsIFtzaGFyZWRTbG90XSlcbiAgICAgICAgICAgIGluZGV4KytcbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi50eXBlID09PSAnZGVsZXRlJykge1xuICAgICAgICAgICAgcmVtb3RlU2xvdHMuZGVsZXRlKGluZGV4LCBhY3Rpb24uY291bnQpXG4gICAgICAgICAgfVxuICAgICAgICB9KV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tYXRzXG59XG4iXX0=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/collaborate",
3
- "version": "2.1.3",
3
+ "version": "2.1.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.3",
29
29
  "@tanbo/stream": "^1.1.8",
30
- "@textbus/browser": "^2.1.3",
31
- "@textbus/core": "^2.1.2",
30
+ "@textbus/browser": "^2.1.4",
31
+ "@textbus/core": "^2.1.4",
32
32
  "reflect-metadata": "^0.1.13",
33
33
  "y-protocols": "^1.0.5",
34
34
  "yjs": "^13.5.39"
@@ -44,5 +44,5 @@
44
44
  "bugs": {
45
45
  "url": "https://github.com/textbus/textbus.git/issues"
46
46
  },
47
- "gitHead": "60220a29cdf8569dffab44d01201533571a94459"
47
+ "gitHead": "c7d145f1db9aac1ba13708f6cb6147b56be0c6b2"
48
48
  }
@@ -1,11 +1,13 @@
1
- import { Inject, Injectable, Optional } from '@tanbo/di'
1
+ import { Inject, Injectable } from '@tanbo/di'
2
2
  import { delay, filter, map, Observable, Subject, Subscription } from '@tanbo/stream'
3
3
  import {
4
- ChangeOrigin, ComponentInitData,
4
+ ChangeOrigin,
5
5
  ComponentInstance,
6
- ContentType, Controller,
6
+ ContentType,
7
+ Controller,
7
8
  Formats,
8
- History, HISTORY_STACK_SIZE,
9
+ History,
10
+ HISTORY_STACK_SIZE,
9
11
  makeError,
10
12
  Registry,
11
13
  RootComponentRef,
@@ -80,10 +82,6 @@ class ContentMap {
80
82
  }
81
83
  }
82
84
 
83
- export abstract class TranslatorFallback {
84
- abstract createComponentByData(name: string, data: ComponentInitData): ComponentInstance | null
85
- }
86
-
87
85
  interface Update {
88
86
  record: boolean
89
87
  actions: Array<() => void>
@@ -141,8 +139,7 @@ export class Collaborate implements History {
141
139
  private translator: Translator,
142
140
  private registry: Registry,
143
141
  private selection: Selection,
144
- private starter: Starter,
145
- @Optional() private translatorFallback: TranslatorFallback) {
142
+ private starter: Starter) {
146
143
  this.onSelectionChange = this.selectionChangeEvent.asObservable().pipe(delay())
147
144
  this.onBack = this.backEvent.asObservable()
148
145
  this.onForward = this.forwardEvent.asObservable()
@@ -335,7 +332,7 @@ export class Collaborate implements History {
335
332
  ev.delta.forEach(action => {
336
333
  if (Reflect.has(action, 'retain')) {
337
334
  if (action.attributes) {
338
- const formats = makeFormats(this.registry, action.attributes)
335
+ const formats = remoteFormatsToLocal(this.registry, action.attributes)
339
336
  if (formats.length) {
340
337
  slot.retain(action.retain!, formats)
341
338
  }
@@ -348,7 +345,7 @@ export class Collaborate implements History {
348
345
  let length = 1
349
346
  if (typeof action.insert === 'string') {
350
347
  length = action.insert.length
351
- slot.insert(action.insert, makeFormats(this.registry, action.attributes))
348
+ slot.insert(action.insert, remoteFormatsToLocal(this.registry, action.attributes))
352
349
  } else {
353
350
  const sharedComponent = action.insert as YMap<any>
354
351
  const canInsertInlineComponent = slot.schema.includes(ContentType.InlineComponent)
@@ -399,7 +396,18 @@ export class Collaborate implements History {
399
396
  if (action.type === 'retain') {
400
397
  const formats = action.formats
401
398
  if (formats) {
402
- content.format(offset, action.offset, localFormatToRemote(formats, this.registry))
399
+ const keys = Object.keys(formats)
400
+ let length = keys.length
401
+ keys.forEach(key => {
402
+ const formatter = this.registry.getFormatter(key)
403
+ if (!formatter) {
404
+ length--
405
+ Reflect.deleteProperty(formats, key)
406
+ }
407
+ })
408
+ if (length) {
409
+ content.format(offset, action.offset, formats)
410
+ }
403
411
  } else {
404
412
  offset = action.offset
405
413
  }
@@ -408,11 +416,11 @@ export class Collaborate implements History {
408
416
  const isEmpty = delta.length === 1 && delta[0].insert === Slot.emptyPlaceholder
409
417
  if (typeof action.content === 'string') {
410
418
  length = action.content.length
411
- content.insert(offset, action.content, localFormatToRemote(action.formats || {}, this.registry))
419
+ content.insert(offset, action.content, action.formats || {})
412
420
  } else {
413
421
  length = 1
414
422
  const sharedComponent = this.createSharedComponentByComponent(action.ref as ComponentInstance)
415
- content.insertEmbed(offset, sharedComponent, localFormatToRemote(action.formats || {}, this.registry))
423
+ content.insertEmbed(offset, sharedComponent, action.formats || {})
416
424
  }
417
425
 
418
426
  if (isEmpty && offset === 0) {
@@ -605,9 +613,13 @@ export class Collaborate implements History {
605
613
  sharedSlot.set('content', sharedContent)
606
614
  let offset = 0
607
615
  slot.toDelta().forEach(i => {
608
- let formats
616
+ let formats: any = {}
609
617
  if (i.formats) {
610
- formats = formatsToRemote(i.formats)
618
+ i.formats.forEach(item => {
619
+ formats[item[0].name] = item[1]
620
+ })
621
+ } else {
622
+ formats = null
611
623
  }
612
624
  if (typeof i.insert === 'string') {
613
625
  sharedContent.insert(offset, i.insert, formats)
@@ -631,16 +643,10 @@ export class Collaborate implements History {
631
643
  })
632
644
  const name = yMap.get('name')
633
645
  const state = yMap.get('state')
634
- let instance = this.translator.createComponentByData(name, {
646
+ const instance = this.translator.createComponentByData(name, {
635
647
  state,
636
648
  slots
637
649
  })
638
- if (!instance) {
639
- instance = this.translatorFallback.createComponentByData(name, {
640
- state,
641
- slots
642
- })
643
- }
644
650
  if (instance) {
645
651
  instance.slots.toArray().forEach((slot, index) => {
646
652
  let sharedSlot = sharedSlots.get(index)
@@ -670,12 +676,12 @@ export class Collaborate implements History {
670
676
  for (const action of delta) {
671
677
  if (action.insert) {
672
678
  if (typeof action.insert === 'string') {
673
- slot.insert(action.insert, makeFormats(this.registry, action.attributes))
679
+ slot.insert(action.insert, remoteFormatsToLocal(this.registry, action.attributes))
674
680
  } else {
675
681
  const sharedComponent = action.insert as YMap<any>
676
682
  const canInsertInlineComponent = slot.schema.includes(ContentType.InlineComponent)
677
683
  const component = this.createComponentBySharedComponent(sharedComponent, canInsertInlineComponent)
678
- slot.insert(component, makeFormats(this.registry, action.attributes))
684
+ slot.insert(component, remoteFormatsToLocal(this.registry, action.attributes))
679
685
  this.syncSlots(sharedComponent.get('slots'), component)
680
686
  this.syncComponent(sharedComponent, component)
681
687
  }
@@ -712,54 +718,11 @@ export class Collaborate implements History {
712
718
  }
713
719
  }
714
720
 
715
- function formatsToRemote(formats: Formats) {
716
- const result: Record<string, any> = {}
717
-
718
- for (const item of formats) {
719
- const [formatter, values] = item
720
- if (typeof formatter.createValueIdIfOverlap === 'function') {
721
- if (Array.isArray(values)) {
722
- values.forEach(value => {
723
- const valueId = (formatter.createValueIdIfOverlap as any)(value)
724
- result[`${formatter.name}:${valueId}`] = value
725
- })
726
- break
727
- }
728
- }
729
- result[formatter.name] = values
730
- }
731
- return result
732
- }
733
-
734
- function localFormatToRemote(formats: Record<string, any>, registry: Registry) {
735
- const keys = Object.keys(formats)
736
- const result: Record<string, any> = {}
737
-
738
- for (const key of keys) {
739
- const formatter = registry.getFormatter(key)
740
- if (!formatter) {
741
- break
742
- }
743
- if (typeof formatter.createValueIdIfOverlap === 'function') {
744
- const values = formats[key]
745
- if (Array.isArray(values)) {
746
- values.forEach(value => {
747
- const valueId = (formatter.createValueIdIfOverlap as any)(value)
748
- result[`${formatter.name}:${valueId}`] = value
749
- })
750
- break
751
- }
752
- }
753
- result[key] = formats[key]
754
- }
755
- return result
756
- }
757
-
758
- function makeFormats(registry: Registry, attrs?: any) {
721
+ function remoteFormatsToLocal(registry: Registry, attrs?: any,) {
759
722
  const formats: Formats = []
760
723
  if (attrs) {
761
724
  Object.keys(attrs).forEach(key => {
762
- const formatter = registry.getFormatter(key.split(':')[0])
725
+ const formatter = registry.getFormatter(key)
763
726
  if (formatter) {
764
727
  formats.push([formatter, attrs[key]])
765
728
  }