@textbus/collaborate 2.0.0-beta.7 → 2.0.0-beta.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  import { Observable } from '@tanbo/stream';
2
- import { RootComponentRef, Starter, Translator, Registry, Selection, SelectionPaths, History, Renderer } from '@textbus/core';
2
+ import { History, Registry, Renderer, RootComponentRef, Selection, SelectionPaths, Starter, Translator } from '@textbus/core';
3
3
  import { Doc as YDoc } from 'yjs';
4
4
  import { CollaborateCursor, RemoteSelection } from './collaborate-cursor';
5
5
  export declare class Collaborate implements History {
@@ -8,10 +8,11 @@ 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 { merge, microTask, Subject } from '@tanbo/stream';
12
- import { RootComponentRef, Starter, Translator, Registry, Selection, Renderer, Slot, makeError } from '@textbus/core';
13
- import { Doc as YDoc, Map as YMap, Text as YText, Array as YArray, UndoManager } from 'yjs';
11
+ import { microTask, Subject } from '@tanbo/stream';
12
+ import { ContentType, makeError, Registry, Renderer, RootComponentRef, Selection, Slot, Starter, Translator } from '@textbus/core';
13
+ import { Array as YArray, Doc as YDoc, Map as YMap, Text as YText, UndoManager } from 'yjs';
14
14
  import { CollaborateCursor } from './collaborate-cursor';
15
+ import { createUnknownComponent } from './unknown.component';
15
16
  const collaborateErrorFn = makeError('Collaborate');
16
17
  let Collaborate = class Collaborate {
17
18
  constructor(rootComponentRef, collaborateCursor, translator, renderer, registry, selection, starter) {
@@ -219,7 +220,9 @@ let Collaborate = class Collaborate {
219
220
  trackedOrigins: new Set([this.yDoc])
220
221
  });
221
222
  this.syncContent(root, rootComponent.slots.get(0));
222
- this.subscriptions.push(merge(rootComponent.changeMarker.onForceChange, rootComponent.changeMarker.onChange).pipe(microTask()).subscribe(() => {
223
+ this.subscriptions.push(rootComponent.changeMarker.onForceChange.pipe(microTask()).subscribe(() => {
224
+ this.renderer.render();
225
+ }), rootComponent.changeMarker.onChange.pipe(microTask()).subscribe(() => {
223
226
  this.yDoc.transact(() => {
224
227
  this.updateRemoteActions.forEach(fn => {
225
228
  fn();
@@ -255,7 +258,8 @@ let Collaborate = class Collaborate {
255
258
  }
256
259
  else {
257
260
  const sharedComponent = action.insert;
258
- const component = this.createComponentBySharedComponent(sharedComponent);
261
+ const canInsertInlineComponent = slot.schema.includes(ContentType.InlineComponent);
262
+ const component = this.createComponentBySharedComponent(sharedComponent, canInsertInlineComponent);
259
263
  this.syncSlots(sharedComponent.get('slots'), component);
260
264
  this.syncComponent(sharedComponent, component);
261
265
  slot.insert(component);
@@ -347,6 +351,11 @@ let Collaborate = class Collaborate {
347
351
  }
348
352
  });
349
353
  });
354
+ sub.add(slot.onChildComponentRemove.subscribe(components => {
355
+ components.forEach(c => {
356
+ this.cleanSubscriptionsByComponent(c);
357
+ });
358
+ }));
350
359
  this.contentSyncCaches.set(slot, () => {
351
360
  content.unobserve(syncRemote);
352
361
  sub.unsubscribe();
@@ -382,9 +391,11 @@ let Collaborate = class Collaborate {
382
391
  const slots = component.slots;
383
392
  const syncRemote = (ev, tr) => {
384
393
  this.runRemoteUpdate(tr, () => {
394
+ let index = 0;
385
395
  ev.delta.forEach(action => {
386
396
  if (Reflect.has(action, 'retain')) {
387
397
  slots.retain(action.retain);
398
+ index += action.retain;
388
399
  }
389
400
  else if (action.insert) {
390
401
  action.insert.forEach(item => {
@@ -392,10 +403,11 @@ let Collaborate = class Collaborate {
392
403
  slots.insert(slot);
393
404
  this.syncContent(item.get('content'), slot);
394
405
  this.syncSlot(item, slot);
406
+ index++;
395
407
  });
396
408
  }
397
409
  else if (action.delete) {
398
- slots.retain(slots.index);
410
+ slots.retain(index);
399
411
  slots.delete(action.delete);
400
412
  }
401
413
  });
@@ -417,14 +429,16 @@ let Collaborate = class Collaborate {
417
429
  index++;
418
430
  }
419
431
  else if (action.type === 'delete') {
420
- slots.slice(index, index + action.count).forEach(slot => {
421
- this.cleanSubscriptionsBySlot(slot);
422
- });
423
432
  remoteSlots.delete(index, action.count);
424
433
  }
425
434
  });
426
435
  });
427
436
  });
437
+ sub.add(slots.onChildSlotRemove.subscribe(slots => {
438
+ slots.forEach(slot => {
439
+ this.cleanSubscriptionsBySlot(slot);
440
+ });
441
+ }));
428
442
  this.slotsSyncCaches.set(component, () => {
429
443
  remoteSlots.unobserve(syncRemote);
430
444
  sub.unsubscribe();
@@ -512,7 +526,7 @@ let Collaborate = class Collaborate {
512
526
  this.syncSlot(sharedSlot, slot);
513
527
  return sharedSlot;
514
528
  }
515
- createComponentBySharedComponent(yMap) {
529
+ createComponentBySharedComponent(yMap, canInsertInlineComponent) {
516
530
  const sharedSlots = yMap.get('slots');
517
531
  const slots = [];
518
532
  sharedSlots.forEach(sharedSlot => {
@@ -536,7 +550,7 @@ let Collaborate = class Collaborate {
536
550
  });
537
551
  return instance;
538
552
  }
539
- throw collaborateErrorFn(`cannot find component factory \`${name}\`.`);
553
+ return createUnknownComponent(name, canInsertInlineComponent).createInstance(this.starter);
540
554
  }
541
555
  createSlotBySharedSlot(sharedSlot) {
542
556
  const content = sharedSlot.get('content');
@@ -554,7 +568,8 @@ let Collaborate = class Collaborate {
554
568
  }
555
569
  else {
556
570
  const sharedComponent = action.insert;
557
- const component = this.createComponentBySharedComponent(sharedComponent);
571
+ const canInsertInlineComponent = slot.schema.includes(ContentType.InlineComponent);
572
+ const component = this.createComponentBySharedComponent(sharedComponent, canInsertInlineComponent);
558
573
  slot.insert(component);
559
574
  this.syncSlots(sharedComponent.get('slots'), component);
560
575
  this.syncComponent(sharedComponent, component);
@@ -612,4 +627,4 @@ function makeFormats(registry, attrs) {
612
627
  }
613
628
  return formats;
614
629
  }
615
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sbGFib3JhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29sbGFib3JhdGUudHMiXSwibmF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ICAgICAgIGZuKClcbiAgICAgICAgICB9KVxuICAgICAgICAgIHRoaXMudXBkYXRlUmVtb3RlQWN0aW9ucyA9IFtdXG4gICAgICAgIH0sIHRoaXMueURvYylcbiAgICAgICAgdGhpcy5yZW5kZXJlci5yZW5kZXIoKVxuICAgICAgICB0aGlzLnNlbGVjdGlvbi5yZXN0b3JlKClcbiAgICAgIH0pXG4gICAgKVxuICB9XG5cbiAgcHJpdmF0ZSBzeW5jQ29udGVudChjb250ZW50OiBZVGV4dCwgc2xvdDogU2xvdCkge1xuICAgIGNvbnN0IHN5bmNSZW1vdGUgPSAoZXYsIHRyKSA9PiB7XG4gICAgICB0aGlzLnJ1blJlbW90ZVVwZGF0ZSh0ciwgKCkgPT4ge1xuICAgICAgICBzbG90LnJldGFpbigwKVxuICAgICAgICBldi5kZWx0YS5mb3JFYWNoKGFjdGlvbiA9PiB7XG4gICAgICAgICAgaWYgKFJlZmxlY3QuaGFzKGFjdGlvbiwgJ3JldGFpbicpKSB7XG4gICAgICAgICAgICBpZiAoYWN0aW9uLmF0dHJpYnV0ZXMpIHtcbiAgICAgICAgICAgICAgY29uc3QgZm9ybWF0cyA9IG1ha2VGb3JtYXRzKHRoaXMucmVnaXN0cnksIGFjdGlvbi5hdHRyaWJ1dGVzKVxuICAgICAgICAgICAgICBpZiAoZm9ybWF0cy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBzbG90LnJldGFpbihhY3Rpb24ucmV0YWluISwgZm9ybWF0cylcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgc2xvdC5yZXRhaW4oYWN0aW9uLnJldGFpbilcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5pbnNlcnQpIHtcbiAgICAgICAgICAgIGNvbnN0IGluZGV4ID0gc2xvdC5pbmRleFxuICAgICAgICAgICAgbGV0IGxlbmd0aCA9IDFcbiAgICAgICAgICAgIGlmICh0e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HJhZnQgPT4ge1xuICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKGRyYWZ0LCBhY3Rpb24uYXR0cmlidXRlcylcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfVxuICAgICAgICB9KVxuICAgICAgfSlcbiAgICB9XG4gICAgY29udGVudC5vYnNlcnZlKHN5bmNSZW1vdGUpXG5cbiAgICBjb25zdCBzdWIgPSBzbG90Lm9uQ29udGVudENoYW5nZS5zdWJzY3JpYmUoYWN0aW9ucyA9PiB7XG4gICAgICB0aGlzLnJ1bkxvY2FsVXBkYXRlKCgpID0+IHtcbiAgICAgICAgbGV0IG9mZnNldCA9IDBcbiAgICAgICAgbGV0IGxlbmd0aCA9IDBcbiAgICAgICAgZm9yIChjb25zdCBhY3Rpb24gb2YgYWN0aW9ucykge1xuICAgICAgICAgIGlmIChhY3Rpb24udHlwZSA9PT0gJ3JldGFpbicpIHtcbiAgICAgICAgICAgIGNvbnN0IGZvcm1hdHMgPSBhY3Rpb24uZm9ybWF0c1xuICAgICAgICAgICAgaWYgKGZvcm1hdHMpIHtcbiAgICAgICAgICAgICAgY29uc3Qga2V5cyA9IE9iamVjdC5rZXlzKGZvcm1hdHMpXG4gICAgICAgICAgICAgIGxldCBsZW5ndGggPSBrZXlzLmxlbmd0aFxuICAgICAgICAgICAgICBrZXlzLmZvckVhY2goa2V5ID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMucmVnaXN0cnkuZ2V0Rm9ybWF0dGVyKGtleSkpIHtcbiAgICAgICAgICAgICAgICAgIGxlbmd0aC0tXG4gICAgICAgICAgICAgICAgICBSZWZsZWN0LmRlbGV0ZVByb3BlcnR5KGZvcm1hdHMsIGtleSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIGlmIChsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBjb250ZW50LmZvcm1hdChvZmZzZXQsIGFjdGlvbi5vZmZzZXQsIGZvcm1hdHMpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIG9mZnNldCA9IGFjdGlvbi5vZmZzZXRcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi50eXBlID09PSAnaW5zZXJ0Jykge1xuICAgICAgICAgICAgY29uc3QgZGVsdGEgPSBjb250ZW50LnRvRGVsdGEoKVxuICAgICAgICAgICAgY29uc3QgaXNFbXB0eSA9IGRlbHRhLmxlbmd0aCA9PT0gMSAmJiBkZWx0YVswXS5pbnNlcnQgPT09IFNsb3QuZW1wdHlQbGFjZWhvbGRlclxuICAgICAgICAgICAgaWYgKHR5cGVvZiBhY3Rpb24uY29udGVudCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgbGVuZ3RoID0gYWN0aW9uLmNvbnRlbnQubGVuZ3RoXG4gICAgICAgICAgICAgIGNvbnRlbnQuaW5zZXJ0KG9mZnNldCwgYWN0aW9uLmNvbnRlbnQpXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBsZW5ndGggPSAxXG4gICAgICAgICAgICAgIGNvbnN0IGNvbXBvbmVudCA9IHNsb3QuZ2V0Q29udGVudEF0SW5kZXgob2Zmc2V0KSBhcyBDb21wb25lbnRJbnN0YW5jZVxuICAgICAgICAgICAgICBjb25zdCBzaGFyZWRDb21wb25lbnQgPSB0aGlzLmNyZWF0ZVNoYXJlZENvbXBvbmVudEJ5Q29tcG9uZW50KGNvbXBvbmVudClcbiAgICAgICAgICAgICAgY29udGVudC5pbnNlcnRFbWJlZChvZmZzZXQsIHNoYXJlZENvbXBvbmVudClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChhY3Rpb24uZm9ybWF0cykge1xuICAgICAgICAgICAgICBjb250ZW50LmZvcm1hdChvZmZzZXQsIGxlbmd0aCwgYWN0aW9uLmZvcm1hdHMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNFbXB0eSAmJiBvZmZzZXQgPT09IDApIHtcbiAgICAgICAgICAgICAgY29udGVudC5kZWxldGUoY29udGVudC5sZW5ndGggLSAxLCAxKVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgb2Zmc2V0ICs9IGxlbmd0aFxuICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLnR5cGUgPT09ICdkZWxldGUnKSB7XG4gICAgICAgICAgICBjb25zdCBkZWx0YSA9IGNvbnRlbnQudG9EZWx0YSgpXG4gICAgICAgICAgICBjb250ZW50LmRlbGV0ZShvZmZzZXQsIGFjdGlvbi5jb3VudClcbiAgICAgICAgICAgIGlmIChjb250ZW50Lmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICBjb250ZW50Lmluc2VydCgwLCAnXFxuJywgZGVsdGFbMF0/LmF0dHJpYnV0ZXMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KVxuICAgIH0pXG4gICAgdGhpcy5jb250ZW50U3luY0NhY2hlcy5zZXQoc2xvdCwgKCkgPT4ge1xuICAgICAgY29udGVudC51bm9ic2VydmUoc3luY1JlbW90ZSlcbiAgICAgIHN1Yi51bnN1YnNjcmliZSgpXG4gICAgfSlcbiAgfVxuXG4gIHByaXZhdGUgc3luY1Nsb3QocmVtb3RlU2xvdDogWU1hcDxhbnk+LCBzbG90OiBTbG90KSB7XG4gICAgY29uc3Qgc3luY1JlbW90ZSA9IChldiwgdHIpID0+IHtcbiAgICAgIHRoaXMucnVuUmVtb3RlVXBkYXRlKHRyLCAoKSA9PiB7XG4gICAgICAgIGV2LmtleXNDaGFuZ2VkLmZvckVhY2goa2V5ID0+IHtcbiAgICAgICAgICBpZiAoa2V5ID09PSAnc3RhdGUnKSB7XG4gICAgICAgICAgICBjb25zdCBzdGF0ZSA9IChldi50YXJnZXQgYXMgWU1hcDxhbnk+KS5nZXQoJ3N0YXRlJylcbiAgICAgICAgICAgIHNsb3Q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G4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uaW5zZXJ0KSB7XG4gICAgICAgICAgICAoYWN0aW9uLmluc2VydCBhcyBBcnJheTxZTWFwPGFueT4+KS5mb3JFYWNoKGl0ZW0gPT4ge1xuICAgICAgICAgICAgICBjb25zdCBzbG90ID0gdGhpcy5jcmVhdGVTbG90QnlTaGFyZWRTbG90KGl0ZW0pXG4gICAgICAgICAgICAgIHNsb3RzLmluc2VydChzbG90KVxuICAgICAgICAgICAgICB0aGlzLnN5bmNDb250ZW50KGl0ZW0uZ2V0KCdjb250ZW50JyksIHNsb3QpXG4gICAgICAgICAgICAgIHRoaXMuc3luY1Nsb3QoaXRlbSwgc2xvdClcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uZGVsZXRlKSB7XG4gICAgICAgICAgICBzbG90cy5yZXRhaW4oc2xvdHMuaW5kZXgpXG4gICAgICAgICAgICBzbG90cy5kZWxldGUoYWN0aW9uLmRlbGV0ZSlcbiAgICAgICAgICB9XG4gICAgICAgIH0pXG4gICAgICB9KVxuICAgIH1cbiAgICByZW1vdGVTbG90cy5vYnNlcnZlKHN5bmNSZW1vdGUpXG5cbiAgICBjb25zdCBzdWIgPSBzbG90cy5vbkNoYW5nZS5zdWJzY3JpYmUob3BlcmF0aW9ucyA9PiB7XG4gICAgICB0aGlzLnJ1bkxvY2FsVXBkYXRlKCgpID0+IHtcbiAgICAgICAgY29uc3QgYXBwbHlBY3Rpb25zID0gb3BlcmF0aW9ucy5hcHBseVxuICAgICAgICBsZXQgaW5kZXg6IG51bWJlclxuICAgICAgICBhcHBseUFjdGlvbnMuZm9yRWFjaChhY3Rpb24gPT4ge1xuICAgICAgICAgIGlmIChhY3Rpb24udHlwZSA9PT0gJ3JldGFpbicpIHtcbiAgICAgICAgICAgIGluZGV4ID0gYWN0aW9uLm9mZnNldFxuICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLnR5cGUgPT09ICdp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RlbnQnKVxuICAgIGNvbnN0IHJvb3RDb21wb25lbnQgPSB0aGlzLnJvb3RDb21wb25lbnRSZWYuY29tcG9uZW50IVxuICAgIHRoaXMubWFuYWdlciA9IG5ldyBVbmRvTWFuYWdlcihyb290LCB7XG4gICAgICB0cmFja2VkT3JpZ2luczogbmV3IFNldDxhbnk+KFt0aGlzLnlEb2NdKVxuICAgIH0pXG4gICAgdGhpcy5zeW5jQ29udGVudChyb290LCByb290Q29tcG9uZW50LnNsb3RzLmdldCgwKSEpXG5cbiAgICB0aGlzLnN1YnNjcmlwdGlvbnMucHVzaChcbiAgICAgIHJvb3RDb21wb25lbnQuY2hhbmdlTWFya2VyLm9uRm9yY2VDaGFuZ2UucGlwZShcbiAgICAgICAgbWljcm9UYXNrKClcbiAgICAgICkuc3Vic2NyaWJlKCgpID0+IHtcbiAgICAgICAgdGhpcy5yZW5kZXJlci5yZW5kZXIoKVxuICAgICAgfSksXG4gICAgICByb290Q29tcG9uZW50LmNoYW5nZU1hcmtlci5vbkNoYW5nZS5waXBlKFxuICAgICAgICBtaWNyb1Rhc2soKVxuICAgICAgKS5zdWJzY3JpYmUoKCkgPT4ge1xuICAgICAgICB0aGlzLnlEb2MudHJhbnNhY3QoKCkgPT4ge1xuICAgICAgICAgIHRoaXMudXBkYXRlUmVtb3RlQWN0aW9ucy5mb3JFYWNoKGZuID0+IHtcbiAgICAgICAgICAgIGZuKClcbiAgICAgICAgICB9KVxuICAgICAgICAgIHRoaXMudXBkYXRlUmVtb3RlQWN0aW9ucyA9IFtdXG4gICAgICAgIH0sIHRoaXMueURvYylcbiAgICAgICAgdGhpcy5yZW5kZXJlci5yZW5kZXIoKVxuICAgICAgICB0aGlzLnNlbGVjdGlvbi5yZXN0b3JlKClcbiAgICAgIH0pXG4gICAgKVxuICB9XG5cbiAgcHJpdmF0ZSBzeW5jQ29udGVudChjb250ZW50OiBZVGV4dCwgc2xvdDogU2xvdCkge1xuICAgIGNvbnN0IHN5bmNSZW1vdGUgP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lbnQub2JzZXJ2ZShzeW5jUmVtb3RlKVxuXG4gICAgY29uc3Qgc3ViID0gc2xvdC5vbkNvbnRlbnRDaGFuZ2Uuc3Vic2NyaWJlKGFjdGlvbnMgPT4ge1xuICAgICAgdGhpcy5ydW5Mb2NhbFVwZGF0ZSgoKSA9PiB7XG4gICAgICAgIGxldCBvZmZzZXQgPSAwXG4gICAgICAgIGxldCBsZW5ndGggPSAwXG4gICAgICAgIGZvciAoY29uc3QgYWN0aW9uIG9mIGFjdGlvbnMpIHtcbiAgICAgICAgICBpZiAoYWN0aW9uLnR5cGUgPT09ICdyZXRhaW4nKSB7XG4gICAgICAgICAgICBjb25zdCBmb3JtYXRzID0gYWN0aW9uLmZvcm1hdHNcbiAgICAgICAgICAgIGlmIChmb3JtYXRzKSB7XG4gICAgICAgICAgICAgIGNvbnN0IGtleXMgPSBPYmplY3Qua2V5cyhmb3JtYXRzKVxuICAgICAgICAgICAgICBsZXQgbGVuZ3RoID0ga2V5cy5sZW5ndGhcbiAgICAgICAgICAgICAga2V5cy5mb3JFYWNoKGtleSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLnJlZ2lzdHJ5LmdldEZvcm1hdHRlcihrZXkpKSB7XG4gICAgICAgICAgICAgICAgICBsZW5ndGgtLVxuICAgICAgICAgICAgICAgICAgUmVmbGVjdC5kZWxldGVQcm9wZXJ0eShmb3JtYXRzLCBrZXkpXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICBpZiAobGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgY29udGVudC5mb3JtYXQob2Zmc2V0LCBhY3Rpb24ub2Zmc2V0LCBmb3JtYXRzKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBvZmZzZXQgPSBhY3Rpb24ub2Zmc2V0XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24udHlwZSA9PT0gJ2luc2VydCcpIHtcbiAgICAgICAgICAgIGNvbnN0IGRlbHRhID0gY29udGVudC50b0RlbHRhKClcbiAgICAgICAgICAgIGNvbnN0IGlzRW1wdHkgPSBkZWx0YS5sZW5ndGggPT09IDEgJiYgZGVsdGFbMF0uaW5zZXJ0ID09PSBTbG90LmVtcHR5UGxhY2Vob2xkZXJcbiAgICAgICAgICAgIGlmICh0eXBlb2YgYWN0aW9uLmNvbnRlbnQgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIGxlbmd0aCA9IGFjdGlvbi5jb250ZW50Lmxlbmd0aFxuICAgICAgICAgICAgICBjb250ZW50Lmluc2VydChvZmZzZXQsIGFjdGlvbi5jb250ZW50KVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgbGVuZ3RoID0gMVxuICAgICAgICAgICAgICBjb25zdCBjb21wb25lbnQgPSBzbG90LmdldENvbnRlbnRBdEluZGV4KG9mZnNldCkgYXMgQ29tcG9uZW50SW5zdGFuY2VcbiAgICAgICAgICAgICAgY29uc3Qgc2hhcmVkQ29tcG9uZW50ID0gdGhpcy5jcmVhdGVTaGFyZWRDb21wb25lbnRCeUNvbXBvbmVudChjb21wb25lbnQpXG4gICAgICAgICAgICAgIGNvbnRlbnQuaW5zZXJ0RW1iZWQob2Zmc2V0LCBzaGFyZWRDb21wb25lbnQpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoYWN0aW9uLmZvcm1hdHMpIHtcbiAgICAgICAgICAgICAgY29udGVudC5mb3JtYXQob2Zmc2V0LCBsZW5ndGgsIGFjdGlvbi5mb3JtYXRzKVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzRW1wdHkgJiYgb2Zmc2V0ID09PSAwKSB7XG4gICAgICAgICAgICAgIGNvbnRlbnQuZGVsZXRlKGNvbnRlbnQubGVuZ3RoIC0gMSwgMSlcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG9mZnNldCArPSBsZW5ndGhcbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi50eXBlID09PSAnZGVsZXRlJykge1xuICAgICAgICAgICAgY29uc3QgZGVsdGEgPSBjb250ZW50LnRvRGVsdGEoKVxuICAgICAgICAgICAgY29udGVudC5kZWxldGUob2Zmc2V0LCBhY3Rpb24uY291bnQpXG4gICAgICAgICAgICBpZiAoY29udGVudC5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgY29udGVudC5pbnNlcnQoMCwgJ1xcbicsIGRlbHRhWzBdPy5hdHRyaWJ1dGVzKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSlcbiAgICB9KVxuXG4gICAgc3ViLmFkZChzbG90Lm9uQ2hpbGRDb21wb25lbnRSZW1vdmUuc3Vic2NyaWJlKGNvbXBvbmVudHMgPT4ge1xuICAgICAgY29tcG9uZW50cy5mb3JFYWNoKGMgPT4ge1xuICAgICAgICB0aGlzLmNsZWFuU3Vic2NyaXB0aW9uc0J5Q29tcG9uZW50KGMpXG4gICAgICB9KVxuICAgIH0pKVxuICAgIHRoaXMuY29udGVudFN5bmNDYWNoZXMuc2V0KHNsb3QsICgpID0+IHtcbiAgICAgIGNvbnRlbnQudW5vYnNlcnZlKHN5bmNSZW1vdGUpXG4gICAgICBzdWIudW5zdWJzY3JpYmUoKVxuICAgIH0pXG4gIH1cblxuICBwcml2YXRlIHN5bmNTbG90KHJlbW90ZVNsb3Q6IFlNYXA8YW55Piwgc2xvdDogU2xvdCkge1xuICAgIGNvbnN0IHN5bmNSZW1vdGUgPSAoZXYsIHRyKSA9PiB7XG4gICAgICB0aGlzLnJ1blJlbW90ZVVwZGF0ZSh0ciwgKCkgPT4ge1xuICAgICAgICBldi5rZXlzQ2hhbmdlZC5mb3JFYWNoKGtleSA9PiB7XG4gICAgICAgICAgaWYgKGtleSA9PT0gJ3N0YXRlJykge1xuICAgICAgICAgICAgY29uc3Qgc3RhdGUgPS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uaGFzKGFjdGlvbiwgJ3JldGFpbicpKSB7XG4gICAgICAgICAgICBzbG90cy5yZXRhaW4oYWN0aW9uLnJldGFpbiEpXG4gICAgICAgICAgICBpbmRleCArPSBhY3Rpb24ucmV0YWluXG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24uaW5zZXJ0KSB7XG4gICAgICAgICAgICAoYWN0aW9uLmluc2VydCBhcyBBcnJheTxZTWFwPGFueT4+KS5mb3JFYWNoKGl0ZW0gPT4ge1xuICAgICAgICAgICAgICBjb25zdCBzbG90ID0gdGhpcy5jcmVhdGVTbG90QnlTaGFyZWRTbG90KGl0ZW0pXG4gICAgICAgICAgICAgIHNsb3RzLmluc2VydChzbG90KVxuICAgICAgICAgICAgICB0aGlzLnN5bmNDb250ZW50KGl0ZW0uZ2V0KCdjb250ZW50JyksIHNsb3QpXG4gICAgICAgICAgICAgIHRoaXMuc3luY1Nsb3QoaXRlbSwgc2xvdClcbiAgICAgICAgICAgICAgaW5kZXgrK1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5kZWxldGUpIHtcbiAgICAgICAgICAgIHNsb3RzLnJldGFpbihpbmRleClcbiAgICAgICAgICAgIHNsb3RzLmRlbGV0ZShhY3Rpb24uZGVsZXRlKVxuICAgICAgICAgIH1cbiAgICAgICAgfSlcbiAgICAgIH0pXG4gICAgfVxuICAgIHJlbW90ZVNsb3RzLm9ic2VydmUoc3luY1JlbW90ZSlcblxuICAgIGNvbnN0IHN1YiA9IHNsb3RzLm9uQ2hhbmdlLnN1YnNjcmliZShvcGVyYXRpb25zID0+IHtcbiAgICAgIHRoaXMucnVuTG9jYWxVcGRhdGUoKCkgPT4ge1xuICAgICAgICBjb25zdCBhcHBseUFjdGlvbnMgPSBvcGVyYXRpb25zLmFwcGx5XG4gICAgICAgIGxldCBpbmRleDogbnVtYmVyXG4gICAgICAgIGFwcGx5QWN0aW9ucy5mb3JFYWNoKGFjdGlvbiA9PiB7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b24uYXR0cmlidXRlcykpXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgY29uc3Qgc2hhcmVkQ29tcG9uZW50ID0gYWN0aW9uLmluc2VydCBhcyBZTWFwPGFueT5cbiAgICAgICAgICBjb25zdCBjYW5JbnNlcnRJbmxpbmVDb21wb25lbnQgPSBzbG90LnNjaGVtYS5pbmNsdWRlcyhDb250ZW50VHlwZS5JbmxpbmVDb21wb25lbnQpXG4gICAgICAgICAgY29uc3QgY29tcG9uZW50ID0gdGhpcy5jcmVhdGVDb21wb25lbnRCeVNoYXJlZENvbXBvbmVudChzaGFyZWRDb21wb25lbnQsIGNhbkluc2VydElubGluZUNvbXBvbmVudClcbiAgICAgICAgICBzbG90Lmluc2VydChjb21wb25lbnQpXG4gICAgICAgICAgdGhpcy5zeW5jU2xvdHMoc2hhcmVkQ29tcG9uZW50LmdldCgnc2xvdHMnKSwgY29tcG9uZW50KVxuICAgICAgICAgIHRoaXMuc3luY0NvbXBvbmVudChzaGFyZWRDb21wb25lbnQsIGNvbXBvbmVudClcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdGhyb3cgY29sbGFib3JhdGVFcnJvckZuKCd1bmV4cGVjdGVkIGRlbHRhIGFjdGlvbi4nKVxuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gc2xvdFxuICB9XG5cbiAgcHJpdmF0ZSBjbGVhblN1YnNjcmlwdGlvbnNCeVNsb3Qoc2xvdDogU2xvdCkge1xuICAgIFt0aGlzLmNvbnRlbnRTeW5jQ2FjaGVzLmdldChzbG90KSwgdGhpcy5zbG90U3RhdGVTeW5jQ2FjaGVzLmdldChzbG90KV0uZm9yRWFjaChmbiA9PiB7XG4gICAgICBpZiAoZm4pIHtcbiAgICAgICAgZm4oKVxuICAgICAgfVxuICAgIH0pXG4gICAgc2xvdC5zbGljZUNvbnRlbnQoKS5mb3JFYWNoKGkgPT4ge1xuICAgICAgaWYgKHR5cGVvZiBpICE9PSAnc3RyaW5nJykge1xuICAgICAgICB0aGlzLmNsZWFuU3Vic2NyaXB0aW9uc0J5Q29tcG9uZW50KGkpXG4gICAgICB9XG4gICAgfSlcbiAgfVxuXG4gIHByaXZhdGUgY2xlYW5TdWJzY3JpcHRpb25zQnlDb21wb25lbnQoY29tcG9uZW50OiBDb21wb25lbnRJbnN0YW5jZSkge1xuICAgIFt0aGlzLnNsb3RzU3luY0NhY2hlcy5nZXQoY29tcG9uZW50KSwgdGhpcy5jb21wb25lbnRTdGF0ZVN5bmNDYWNoZXMuZ2V0KGNvbXBvbmVudCldLmZvckVhY2goZm4gPT4ge1xuICAgICAgaWYgKGZuKSB7XG4gICAgICAgIGZuKClcbiAgICAgIH1cbiAgICB9KVxuICAgIGNvbXBvbmVudC5zbG90cy50b0FycmF5KCkuZm9yRWFjaChzbG90ID0+IHtcbiAgICAgIHRoaXMuY2xlYW5TdWJzY3JpcHRpb25zQnlTbG90KHNsb3QpXG4gICAgfSlcbiAgfVxufVxuXG5mdW5jdGlvbiBtYWtlRm9ybWF0cyhyZWdpc3RyeTogUmVnaXN0cnksIGF0dHJzPzogYW55KSB7XG4gIGNvbnN0IGZvcm1hdHM6IEZvcm1hdHMgPSBbXVxuICBpZiAoYXR0cnMpIHtcbiAgICBPYmplY3Qua2V5cyhhdHRycykubWFwKGtleSA9PiB7XG4gICAgICBjb25zdCBmb3JtYXR0ZXIgPSByZWdpc3RyeS5nZXRGb3JtYXR0ZXIoa2V5KVxuICAgICAgaWYgKGZvcm1hdHRlcikge1xuICAgICAgICBmb3JtYXRzLnB1c2goW2Zvcm1hdHRlciwgYXR0cnNba2V5XV0pXG4gICAgICB9XG4gICAgfSlcbiAgfVxuICByZXR1cm4gZm9ybWF0c1xufVxuIl19
@@ -0,0 +1 @@
1
+ export declare function createUnknownComponent(factoryName: string, canInsertInlineComponent: boolean): any;
@@ -0,0 +1,22 @@
1
+ import { ContentType, defineComponent, VElement } from '@textbus/core';
2
+ export function createUnknownComponent(factoryName, canInsertInlineComponent) {
3
+ const unknownComponent = defineComponent({
4
+ type: canInsertInlineComponent ? ContentType.InlineComponent : ContentType.BlockComponent,
5
+ name: 'UnknownComponent',
6
+ setup() {
7
+ console.error(`cannot find component factory \`${factoryName}\`.`);
8
+ return {
9
+ render() {
10
+ return VElement.createElement('textbus-unknown-component', {
11
+ style: {
12
+ display: canInsertInlineComponent ? 'inline' : 'block',
13
+ color: '#f00'
14
+ }
15
+ }, unknownComponent.name);
16
+ }
17
+ };
18
+ }
19
+ });
20
+ return unknownComponent;
21
+ }
22
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW5rbm93bi5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdW5rbm93bi5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFdBQVcsRUFBRSxlQUFlLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBRXRFLE1BQU0sVUFBVSxzQkFBc0IsQ0FBQyxXQUFtQixFQUFFLHdCQUFpQztJQUMzRixNQUFNLGdCQUFnQixHQUFHLGVBQWUsQ0FBQztRQUN2QyxJQUFJLEVBQUUsd0JBQXdCLENBQUMsQ0FBQyxDQUFDLFdBQVcsQ0FBQyxlQUFlLENBQUMsQ0FBQyxDQUFDLFdBQVcsQ0FBQyxjQUFjO1FBQ3pGLElBQUksRUFBRSxrQkFBa0I7UUFDeEIsS0FBSztZQUNILE9BQU8sQ0FBQyxLQUFLLENBQUMsbUNBQW1DLFdBQVcsS0FBSyxDQUFDLENBQUE7WUFDbEUsT0FBTztnQkFDTCxNQUFNO29CQUNKLE9BQU8sUUFBUSxDQUFDLGFBQWEsQ0FBQywyQkFBMkIsRUFBRTt3QkFDekQsS0FBSyxFQUFFOzRCQUNMLE9BQU8sRUFBRSx3QkFBd0IsQ0FBQyxDQUFDLENBQUMsUUFBUSx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AgICBjb2xvcjogJyNmMDAnXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSwgdW5rbm93bkNvbXBvbmVudC5uYW1lKVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9KVxuICByZXR1cm4gdW5rbm93bkNvbXBvbmVudFxufVxuIl19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/collaborate",
3
- "version": "2.0.0-beta.7",
3
+ "version": "2.0.0-beta.8",
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.6",
31
- "@textbus/core": "^2.0.0-beta.6",
30
+ "@textbus/browser": "^2.0.0-beta.8",
31
+ "@textbus/core": "^2.0.0-beta.8",
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": "0f21f01012a2efc210dbf393b55393c961197b5d"
47
+ "gitHead": "86920afac46123a6939d789f0bb3334f8318be58"
48
48
  }
@@ -1,24 +1,24 @@
1
1
  import { Injectable } from '@tanbo/di'
2
- import { merge, microTask, Observable, Subject, Subscription } from '@tanbo/stream'
2
+ import { microTask, Observable, Subject, Subscription } from '@tanbo/stream'
3
3
  import {
4
- RootComponentRef,
5
- Starter,
6
- Translator,
4
+ ComponentInstance,
5
+ ContentType,
6
+ Formats,
7
+ History,
8
+ makeError,
7
9
  Registry,
10
+ Renderer,
11
+ RootComponentRef,
8
12
  Selection,
9
13
  SelectionPaths,
10
- History, Renderer, Slot, ComponentInstance, makeError, Formats
14
+ Slot,
15
+ Starter,
16
+ Translator
11
17
  } from '@textbus/core'
12
- import {
13
- Doc as YDoc,
14
- Map as YMap,
15
- Text as YText,
16
- Array as YArray,
17
- UndoManager,
18
- Transaction
19
- } from 'yjs'
18
+ import { Array as YArray, Doc as YDoc, Map as YMap, Text as YText, Transaction, UndoManager } from 'yjs'
20
19
 
21
20
  import { CollaborateCursor, RemoteSelection } from './collaborate-cursor'
21
+ import { createUnknownComponent } from './unknown.component'
22
22
 
23
23
  const collaborateErrorFn = makeError('Collaborate')
24
24
 
@@ -117,10 +117,12 @@ export class Collaborate implements History {
117
117
  this.syncContent(root, rootComponent.slots.get(0)!)
118
118
 
119
119
  this.subscriptions.push(
120
- merge(
121
- rootComponent.changeMarker.onForceChange,
122
- rootComponent.changeMarker.onChange
123
- ).pipe(
120
+ rootComponent.changeMarker.onForceChange.pipe(
121
+ microTask()
122
+ ).subscribe(() => {
123
+ this.renderer.render()
124
+ }),
125
+ rootComponent.changeMarker.onChange.pipe(
124
126
  microTask()
125
127
  ).subscribe(() => {
126
128
  this.yDoc.transact(() => {
@@ -157,7 +159,8 @@ export class Collaborate implements History {
157
159
  slot.insert(action.insert, makeFormats(this.registry, action.attributes))
158
160
  } else {
159
161
  const sharedComponent = action.insert as YMap<any>
160
- const component = this.createComponentBySharedComponent(sharedComponent)
162
+ const canInsertInlineComponent = slot.schema.includes(ContentType.InlineComponent)
163
+ const component = this.createComponentBySharedComponent(sharedComponent, canInsertInlineComponent)
161
164
  this.syncSlots(sharedComponent.get('slots'), component)
162
165
  this.syncComponent(sharedComponent, component)
163
166
  slot.insert(component)
@@ -243,6 +246,12 @@ export class Collaborate implements History {
243
246
  }
244
247
  })
245
248
  })
249
+
250
+ sub.add(slot.onChildComponentRemove.subscribe(components => {
251
+ components.forEach(c => {
252
+ this.cleanSubscriptionsByComponent(c)
253
+ })
254
+ }))
246
255
  this.contentSyncCaches.set(slot, () => {
247
256
  content.unobserve(syncRemote)
248
257
  sub.unsubscribe()
@@ -281,18 +290,21 @@ export class Collaborate implements History {
281
290
  const slots = component.slots
282
291
  const syncRemote = (ev, tr) => {
283
292
  this.runRemoteUpdate(tr, () => {
293
+ let index = 0
284
294
  ev.delta.forEach(action => {
285
295
  if (Reflect.has(action, 'retain')) {
286
296
  slots.retain(action.retain!)
297
+ index += action.retain
287
298
  } else if (action.insert) {
288
299
  (action.insert as Array<YMap<any>>).forEach(item => {
289
300
  const slot = this.createSlotBySharedSlot(item)
290
301
  slots.insert(slot)
291
302
  this.syncContent(item.get('content'), slot)
292
303
  this.syncSlot(item, slot)
304
+ index++
293
305
  })
294
306
  } else if (action.delete) {
295
- slots.retain(slots.index)
307
+ slots.retain(index)
296
308
  slots.delete(action.delete)
297
309
  }
298
310
  })
@@ -313,15 +325,18 @@ export class Collaborate implements History {
313
325
  remoteSlots.insert(index, [sharedSlot])
314
326
  index++
315
327
  } else if (action.type === 'delete') {
316
- slots.slice(index, index + action.count).forEach(slot => {
317
- this.cleanSubscriptionsBySlot(slot)
318
- })
319
328
  remoteSlots.delete(index, action.count)
320
329
  }
321
330
  })
322
331
  })
323
332
  })
324
333
 
334
+ sub.add(slots.onChildSlotRemove.subscribe(slots => {
335
+ slots.forEach(slot => {
336
+ this.cleanSubscriptionsBySlot(slot)
337
+ })
338
+ }))
339
+
325
340
  this.slotsSyncCaches.set(component, () => {
326
341
  remoteSlots.unobserve(syncRemote)
327
342
  sub.unsubscribe()
@@ -414,7 +429,7 @@ export class Collaborate implements History {
414
429
  return sharedSlot
415
430
  }
416
431
 
417
- private createComponentBySharedComponent(yMap: YMap<any>): ComponentInstance {
432
+ private createComponentBySharedComponent(yMap: YMap<any>, canInsertInlineComponent: boolean): ComponentInstance {
418
433
  const sharedSlots = yMap.get('slots') as YArray<YMap<any>>
419
434
  const slots: Slot[] = []
420
435
  sharedSlots.forEach(sharedSlot => {
@@ -438,7 +453,7 @@ export class Collaborate implements History {
438
453
  })
439
454
  return instance
440
455
  }
441
- throw collaborateErrorFn(`cannot find component factory \`${name}\`.`)
456
+ return createUnknownComponent(name, canInsertInlineComponent).createInstance(this.starter)
442
457
  }
443
458
 
444
459
  private createSlotBySharedSlot(sharedSlot: YMap<any>): Slot {
@@ -458,7 +473,8 @@ export class Collaborate implements History {
458
473
  slot.insert(action.insert, makeFormats(this.registry, action.attributes))
459
474
  } else {
460
475
  const sharedComponent = action.insert as YMap<any>
461
- const component = this.createComponentBySharedComponent(sharedComponent)
476
+ const canInsertInlineComponent = slot.schema.includes(ContentType.InlineComponent)
477
+ const component = this.createComponentBySharedComponent(sharedComponent, canInsertInlineComponent)
462
478
  slot.insert(component)
463
479
  this.syncSlots(sharedComponent.get('slots'), component)
464
480
  this.syncComponent(sharedComponent, component)
@@ -0,0 +1,22 @@
1
+ import { ContentType, defineComponent, VElement } from '@textbus/core'
2
+
3
+ export function createUnknownComponent(factoryName: string, canInsertInlineComponent: boolean) {
4
+ const unknownComponent = defineComponent({
5
+ type: canInsertInlineComponent ? ContentType.InlineComponent : ContentType.BlockComponent,
6
+ name: 'UnknownComponent',
7
+ setup() {
8
+ console.error(`cannot find component factory \`${factoryName}\`.`)
9
+ return {
10
+ render() {
11
+ return VElement.createElement('textbus-unknown-component', {
12
+ style: {
13
+ display: canInsertInlineComponent ? 'inline' : 'block',
14
+ color: '#f00'
15
+ }
16
+ }, unknownComponent.name)
17
+ }
18
+ }
19
+ }
20
+ })
21
+ return unknownComponent
22
+ }