@textbus/collaborate 2.0.0-beta.3 → 2.0.0-beta.33

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,13 +8,14 @@ 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';
14
- import { CollaborateCursor } from './collab/_api';
11
+ import { delay, Subject } from '@tanbo/stream';
12
+ import { ContentType, makeError, Registry, RootComponentRef, Scheduler, 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
+ import { CollaborateCursor } from './collaborate-cursor';
15
+ import { createUnknownComponent } from './unknown.component';
15
16
  const collaborateErrorFn = makeError('Collaborate');
16
17
  let Collaborate = class Collaborate {
17
- constructor(rootComponentRef, collaborateCursor, translator, renderer, registry, selection, starter) {
18
+ constructor(rootComponentRef, collaborateCursor, scheduler, translator, registry, selection, starter) {
18
19
  Object.defineProperty(this, "rootComponentRef", {
19
20
  enumerable: true,
20
21
  configurable: true,
@@ -27,17 +28,17 @@ let Collaborate = class Collaborate {
27
28
  writable: true,
28
29
  value: collaborateCursor
29
30
  });
30
- Object.defineProperty(this, "translator", {
31
+ Object.defineProperty(this, "scheduler", {
31
32
  enumerable: true,
32
33
  configurable: true,
33
34
  writable: true,
34
- value: translator
35
+ value: scheduler
35
36
  });
36
- Object.defineProperty(this, "renderer", {
37
+ Object.defineProperty(this, "translator", {
37
38
  enumerable: true,
38
39
  configurable: true,
39
40
  writable: true,
40
- value: renderer
41
+ value: translator
41
42
  });
42
43
  Object.defineProperty(this, "registry", {
43
44
  enumerable: true,
@@ -171,7 +172,7 @@ let Collaborate = class Collaborate {
171
172
  writable: true,
172
173
  value: []
173
174
  });
174
- this.onSelectionChange = this.selectionChangeEvent.asObservable();
175
+ this.onSelectionChange = this.selectionChangeEvent.asObservable().pipe(delay());
175
176
  this.onBack = this.backEvent.asObservable();
176
177
  this.onForward = this.forwardEvent.asObservable();
177
178
  this.onChange = this.changeEvent.asObservable();
@@ -186,12 +187,11 @@ let Collaborate = class Collaborate {
186
187
  return (_a = this.manager) === null || _a === void 0 ? void 0 : _a.canRedo();
187
188
  }
188
189
  setup() {
189
- this.subscriptions.push(this.starter.onReady.subscribe(() => {
190
- this.listen2();
191
- }), this.selection.onChange.subscribe(() => {
190
+ this.subscriptions.push(this.selection.onChange.subscribe(() => {
192
191
  const paths = this.selection.getPaths();
193
192
  this.selectionChangeEvent.next(paths);
194
193
  }));
194
+ this.syncRootComponent();
195
195
  }
196
196
  updateRemoteSelection(paths) {
197
197
  this.collaborateCursor.draw(paths);
@@ -201,33 +201,36 @@ let Collaborate = class Collaborate {
201
201
  }
202
202
  back() {
203
203
  if (this.canBack) {
204
+ this.scheduler.stopBroadcastChanges = true;
204
205
  this.manager.undo();
206
+ this.scheduler.stopBroadcastChanges = false;
205
207
  }
206
208
  }
207
209
  forward() {
208
210
  if (this.canForward) {
211
+ this.scheduler.stopBroadcastChanges = true;
209
212
  this.manager.redo();
213
+ this.scheduler.stopBroadcastChanges = false;
210
214
  }
211
215
  }
212
216
  destroy() {
213
217
  this.subscriptions.forEach(i => i.unsubscribe());
218
+ this.collaborateCursor.destroy();
214
219
  }
215
- listen2() {
220
+ syncRootComponent() {
216
221
  const root = this.yDoc.getText('content');
217
222
  const rootComponent = this.rootComponentRef.component;
218
223
  this.manager = new UndoManager(root, {
219
224
  trackedOrigins: new Set([this.yDoc])
220
225
  });
221
226
  this.syncContent(root, rootComponent.slots.get(0));
222
- this.subscriptions.push(merge(rootComponent.changeMarker.onForceChange, rootComponent.changeMarker.onChange).pipe(microTask()).subscribe(() => {
227
+ this.subscriptions.push(this.scheduler.onDocChange.subscribe(() => {
223
228
  this.yDoc.transact(() => {
224
229
  this.updateRemoteActions.forEach(fn => {
225
230
  fn();
226
231
  });
227
232
  this.updateRemoteActions = [];
228
233
  }, this.yDoc);
229
- this.renderer.render();
230
- this.selection.restore();
231
234
  }));
232
235
  }
233
236
  syncContent(content, slot) {
@@ -255,17 +258,18 @@ 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);
262
266
  }
263
267
  if (this.selection.isSelected) {
264
- if (slot === this.selection.startSlot && this.selection.startOffset >= index) {
265
- this.selection.setStart(slot, this.selection.startOffset + length);
268
+ if (slot === this.selection.anchorSlot && this.selection.anchorOffset > index) {
269
+ this.selection.setAnchor(slot, this.selection.anchorOffset + length);
266
270
  }
267
- if (slot === this.selection.endSlot && this.selection.endOffset >= index) {
268
- this.selection.setEnd(slot, this.selection.endOffset + length);
271
+ if (slot === this.selection.focusSlot && this.selection.focusOffset > index) {
272
+ this.selection.setFocus(slot, this.selection.focusOffset + length);
269
273
  }
270
274
  }
271
275
  }
@@ -274,11 +278,11 @@ let Collaborate = class Collaborate {
274
278
  slot.retain(slot.index);
275
279
  slot.delete(action.delete);
276
280
  if (this.selection.isSelected) {
277
- if (slot === this.selection.startSlot && this.selection.startOffset >= index) {
278
- this.selection.setStart(slot, this.selection.startOffset - action.delete);
281
+ if (slot === this.selection.anchorSlot && this.selection.anchorOffset >= index) {
282
+ this.selection.setAnchor(slot, this.selection.startOffset - action.delete);
279
283
  }
280
- if (slot === this.selection.endSlot && this.selection.endOffset >= index) {
281
- this.selection.setEnd(slot, this.selection.endOffset - action.delete);
284
+ if (slot === this.selection.focusSlot && this.selection.focusOffset >= index) {
285
+ this.selection.setFocus(slot, this.selection.focusOffset - action.delete);
282
286
  }
283
287
  }
284
288
  }
@@ -321,7 +325,7 @@ let Collaborate = class Collaborate {
321
325
  const isEmpty = delta.length === 1 && delta[0].insert === Slot.emptyPlaceholder;
322
326
  if (typeof action.content === 'string') {
323
327
  length = action.content.length;
324
- content.insert(offset, action.content);
328
+ content.insert(offset, action.content, action.formats || {});
325
329
  }
326
330
  else {
327
331
  length = 1;
@@ -329,9 +333,6 @@ let Collaborate = class Collaborate {
329
333
  const sharedComponent = this.createSharedComponentByComponent(component);
330
334
  content.insertEmbed(offset, sharedComponent);
331
335
  }
332
- if (action.formats) {
333
- content.format(offset, length, action.formats);
334
- }
335
336
  if (isEmpty && offset === 0) {
336
337
  content.delete(content.length - 1, 1);
337
338
  }
@@ -347,6 +348,11 @@ let Collaborate = class Collaborate {
347
348
  }
348
349
  });
349
350
  });
351
+ sub.add(slot.onChildComponentRemove.subscribe(components => {
352
+ components.forEach(c => {
353
+ this.cleanSubscriptionsByComponent(c);
354
+ });
355
+ }));
350
356
  this.contentSyncCaches.set(slot, () => {
351
357
  content.unobserve(syncRemote);
352
358
  sub.unsubscribe();
@@ -382,9 +388,11 @@ let Collaborate = class Collaborate {
382
388
  const slots = component.slots;
383
389
  const syncRemote = (ev, tr) => {
384
390
  this.runRemoteUpdate(tr, () => {
391
+ let index = 0;
385
392
  ev.delta.forEach(action => {
386
393
  if (Reflect.has(action, 'retain')) {
387
- slots.retain(action.retain);
394
+ index += action.retain;
395
+ slots.retain(index);
388
396
  }
389
397
  else if (action.insert) {
390
398
  action.insert.forEach(item => {
@@ -392,10 +400,11 @@ let Collaborate = class Collaborate {
392
400
  slots.insert(slot);
393
401
  this.syncContent(item.get('content'), slot);
394
402
  this.syncSlot(item, slot);
403
+ index++;
395
404
  });
396
405
  }
397
406
  else if (action.delete) {
398
- slots.retain(slots.index);
407
+ slots.retain(index);
399
408
  slots.delete(action.delete);
400
409
  }
401
410
  });
@@ -417,14 +426,16 @@ let Collaborate = class Collaborate {
417
426
  index++;
418
427
  }
419
428
  else if (action.type === 'delete') {
420
- slots.slice(index, index + action.count).forEach(slot => {
421
- this.cleanSubscriptionsBySlot(slot);
422
- });
423
429
  remoteSlots.delete(index, action.count);
424
430
  }
425
431
  });
426
432
  });
427
433
  });
434
+ sub.add(slots.onChildSlotRemove.subscribe(slots => {
435
+ slots.forEach(slot => {
436
+ this.cleanSubscriptionsBySlot(slot);
437
+ });
438
+ }));
428
439
  this.slotsSyncCaches.set(component, () => {
429
440
  remoteSlots.unobserve(syncRemote);
430
441
  sub.unsubscribe();
@@ -465,7 +476,7 @@ let Collaborate = class Collaborate {
465
476
  return;
466
477
  }
467
478
  this.updateFromRemote = true;
468
- fn();
479
+ this.scheduler.remoteUpdateTransact(fn);
469
480
  this.updateFromRemote = false;
470
481
  }
471
482
  createSharedComponentByComponent(component) {
@@ -512,7 +523,7 @@ let Collaborate = class Collaborate {
512
523
  this.syncSlot(sharedSlot, slot);
513
524
  return sharedSlot;
514
525
  }
515
- createComponentBySharedComponent(yMap) {
526
+ createComponentBySharedComponent(yMap, canInsertInlineComponent) {
516
527
  const sharedSlots = yMap.get('slots');
517
528
  const slots = [];
518
529
  sharedSlots.forEach(sharedSlot => {
@@ -526,13 +537,17 @@ let Collaborate = class Collaborate {
526
537
  });
527
538
  if (instance) {
528
539
  instance.slots.toArray().forEach((slot, index) => {
529
- const sharedSlot = sharedSlots.get(index);
540
+ let sharedSlot = sharedSlots.get(index);
541
+ if (!sharedSlot) {
542
+ sharedSlot = this.createSharedSlotBySlot(slot);
543
+ sharedSlots.push([sharedSlot]);
544
+ }
530
545
  this.syncSlot(sharedSlot, slot);
531
546
  this.syncContent(sharedSlot.get('content'), slot);
532
547
  });
533
548
  return instance;
534
549
  }
535
- throw collaborateErrorFn(`cannot find component factory \`${name}\`.`);
550
+ return createUnknownComponent(name, canInsertInlineComponent).createInstance(this.starter);
536
551
  }
537
552
  createSlotBySharedSlot(sharedSlot) {
538
553
  const content = sharedSlot.get('content');
@@ -550,7 +565,8 @@ let Collaborate = class Collaborate {
550
565
  }
551
566
  else {
552
567
  const sharedComponent = action.insert;
553
- const component = this.createComponentBySharedComponent(sharedComponent);
568
+ const canInsertInlineComponent = slot.schema.includes(ContentType.InlineComponent);
569
+ const component = this.createComponentBySharedComponent(sharedComponent, canInsertInlineComponent);
554
570
  slot.insert(component);
555
571
  this.syncSlots(sharedComponent.get('slots'), component);
556
572
  this.syncComponent(sharedComponent, component);
@@ -589,8 +605,8 @@ Collaborate = __decorate([
589
605
  Injectable(),
590
606
  __metadata("design:paramtypes", [RootComponentRef,
591
607
  CollaborateCursor,
608
+ Scheduler,
592
609
  Translator,
593
- Renderer,
594
610
  Registry,
595
611
  Selection,
596
612
  Starter])
@@ -599,7 +615,7 @@ export { Collaborate };
599
615
  function makeFormats(registry, attrs) {
600
616
  const formats = [];
601
617
  if (attrs) {
602
- Object.keys(attrs).map(key => {
618
+ Object.keys(attrs).forEach(key => {
603
619
  const formatter = registry.getFormatter(key);
604
620
  if (formatter) {
605
621
  formats.push([formatter, attrs[key]]);
@@ -608,4 +624,4 @@ function makeFormats(registry, attrs) {
608
624
  }
609
625
  return formats;
610
626
  }
611
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sbGFib3JhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29sbGFib3JhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLFdBQVcsQ0FBQTtBQUN0QyxPQUFPLEVBQUUsS0FBSyxFQUFFLFNBQVMsRUFBYyxPQUFPLEVBQWdCLE1BQU0sZUFBZSxDQUFBO0FBQ25GLE9BQU8sRUFDTCxnQkFBZ0IsRUFDaEIsT0FBTyxFQUNQLFVBQVUsRUFDVix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b21wb25lbnRSZWYuY29tcG9uZW50IVxuICAgIHRoaXMubWFuYWdlciA9IG5ldyBVbmRvTWFuYWdlcihyb290LCB7XG4gICAgICB0cmFja2VkT3JpZ2luczogbmV3IFNldDxhbnk+KFt0aGlzLnlEb2NdKVxuICAgIH0pXG4gICAgdGhpcy5zeW5jQ29udGVudChyb290LCByb290Q29tcG9uZW50LnNsb3RzLmdldCgwKSEpXG5cbiAgICB0aGlzLnN1YnNjcmlwdGlvbnMucHVzaChcbiAgICAgIG1lcmdlKFxuICAgICAgICByb290Q29tcG9uZW50LmNoYW5nZU1hcmtlci5vbkZvcmNlQ2hhbmdlLFxuICAgICAgICByb290Q29tcG9uZW50LmNoYW5nZU1hcmtlci5vbkNoYW5nZVxuICAgICAgKS5waXBlKFxuICAgICAgICBtaWNyb1Rhc2soKVxuICAgICAgKS5zdWJzY3JpYmUoKCkgPT4ge1xuICAgICAgICB0aGlzLnlEb2MudHJhbnNhY3QoKCkgPT4ge1xuICAgICAgICAgIHRoaXMudXBkYXRlUmVtb3RlQWN0aW9ucy5mb3JFYWNoKGZuID0+IHtcbiAgICAgICAgICAgIGZuKClcbiAgICAgICAgICB9KVxuICAgICAgICAgIHRoaXMudXBkYXRlUmVtb3RlQWN0aW9ucyA9IFtdXG4gICAgICAgIH0sIHRoaXMueURvYylcbiAgICAgICAgdGhpcy5yZW5kZXJlci5yZW5kZXIoKVxuICAgICAgICB0aGlzLnNlbGVjdGlvbi5yZXN0b3JlKClcbiAgICAgIH0pXG4gICAgKVxuICB9XG5cbiAgcHJpdmF0ZSBzeW5jQ29udGVudChjb250ZW50OiBZVGV4dCwgc2xvdDogU2xvdCkge1xuICAgIGNvbnN0IHN5bmNSZW1vdGUgPSAoZXYsIHRyKSA9PiB7XG4gICAgICB0aGlzLnJ1blJlbW90ZVVwZGF0ZSh0ciwgKCkgPT4ge1xuICAgICAgICBzbG90LnJldGFpbigwKVxuICAgICAgICBldi5kZWx0YS5mb3JFYWNoKGFjdGlvbiA9PiB7XG4gICAgICAgICAgaWYgKFJlZmxlY3QuaGFzKGFjdGlvbiwgJ3JldGFpbicpKSB7XG4gICAgICAgICAgICBpZiAoYWN0aW9uLmF0dHJpYnV0ZXMpIHtcbiAgICAgICAgICAgICAgY29uc3QgZm9ybWF0cyA9IG1ha2VGb3JtYXRzKHRoaXMucmVnaXN0cnksIGFjdGlvbi5hdHRyaWJ1dGVzKVxuICAgICAgICAgICAgICBpZiAoZm9ybWF0cy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBzbG90LnJldGFpbihhY3Rpb24ucmV0YWluISwgZm9ybWF0cylcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgc2xvdC5yZXRhaW4oYWN0aW9uLnJldGFpbilcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5pbnNlcnQpIHtcbiAgICAgICAgICAgIGNvbnN0IGluZGV4ID0gc2xvdC5pbmRleFxuICAgICAgICAgICAgbGV0IGxlbmd0aCA9IDFcbiAgICAgICAgICAgIGlmICh0eXBlb2YgYWN0aW9uLmluc2VydCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgbGVuZ3RoID0gYWN0aW9uLmluc2VydC5sZW5ndGhcbiAgICAgICAgICAgICAgc2xvdC5pbnNlcnQoYWN0aW9uLmluc2VydCwgbWFrZUZvcm1hdHModGhpcy5yZWdpc3RyeSwgYWN0aW9uLmF0dHJpYnV0ZXMpKVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgY29uc3Qgc2hhcmVkQ29tcG9uZW50ID0gYWN0aW9uLmluc2VydCBhcyBZTWFwPGFueT5cbiAgICAgICAgICAgICAgY29uc3QgY29tcG9uZW50ID0gdGhpcy5jcmVhdGVDb21wb25lbnRCeVNoYXJlZENvbXBvbmVudChzaGFyZWRDb21wb25lbnQpXG4gICAgICAgICAgICAgIHRoaXMuc3luY1Ns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T0gJ3JldGFpbicpIHtcbiAgICAgICAgICAgIGNvbnN0IGZvcm1hdHMgPSBhY3Rpb24uZm9ybWF0c1xuICAgICAgICAgICAgaWYgKGZvcm1hdHMpIHtcbiAgICAgICAgICAgICAgY29uc3Qga2V5cyA9IE9iamVjdC5rZXlzKGZvcm1hdHMpXG4gICAgICAgICAgICAgIGxldCBsZW5ndGggPSBrZXlzLmxlbmd0aFxuICAgICAgICAgICAgICBrZXlzLmZvckVhY2goa2V5ID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMucmVnaXN0cnkuZ2V0Rm9ybWF0dGVyKGtleSkpIHtcbiAgICAgICAgICAgICAgICAgIGxlbmd0aC0tXG4gICAgICAgICAgICAgICAgICBSZWZsZWN0LmRlbGV0ZVByb3BlcnR5KGZvcm1hdHMsIGtleSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIGlmIChsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBjb250ZW50LmZvcm1hdChvZmZzZXQsIGFjdGlvbi5vZmZzZXQsIGZvcm1hdHMpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIG9mZnNldCA9IGFjdGlvbi5vZmZzZXRcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi50eXBlID09PSAnaW5zZXJ0Jykge1xuICAgICAgICAgICAgY29uc3QgZGVsdGEgPSBjb250ZW50LnRvRGVsdGEoKVxuICAgICAgICAgICAgY29uc3QgaXNFbXB0eSA9IGRlbHRhLmxlbmd0aCA9PT0gMSAmJiBkZWx0YVswXS5pbnNlcnQgPT09IFNsb3QuZW1wdHlQbGFjZWhvbGRlclxuICAgICAgICAgICAgaWYgKHR5cGVvZiBhY3Rpb24uY29udGVudCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgbGVuZ3RoID0gYWN0aW9uLmNvbnRlbnQubGVuZ3RoXG4gICAgICAgICAgICAgIGNvbnRlbnQuaW5zZXJ0KG9mZnNldCwgYWN0aW9uLmNvbnRlbnQpXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBsZW5ndGggPSAxXG4gICAgICAgICAgICAgIGNvbnN0IGNvbXBvbmVudCA9IHNsb3QuZ2V0Q29udGVudEF0SW5kZXgob2Zmc2V0KSBhcyBDb21wb25lbnRJbnN0YW5jZVxuICAgICAgICAgICAgICBjb25zdCBzaGFyZWRDb21wb25lbnQgPSB0aGlzLmNyZWF0ZVNoYXJlZENvbXBvbmVudEJ5Q29tcG9uZW50KGNvbXBvbmVudClcbiAgICAgICAgICAgICAgY29udGVudC5pbnNlcnRFbWJlZChvZmZzZXQsIHNoYXJlZENvbXBvbmVudClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChhY3Rpb24uZm9ybWF0cykge1xuICAgICAgICAgICAgICBjb250ZW50LmZvcm1hdChvZmZzZXQsIGxlbmd0aCwgYWN0aW9uLmZvcm1hdHMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNFbXB0eSAmJiBvZmZzZXQgPT09IDApIHtcbiAgICAgICAgICAgICAgY29udGVudC5kZWxldGUoY29udGVudC5sZW5ndGggLSAxLCAxKVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgb2Zmc2V0ICs9IGxlbmd0aFxuICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLnR5cGUgPT09ICdkZWxldGUnKSB7XG4gICAgICAgICAgICBjb25zdCBkZWx0YSA9IGNvbnRlbnQudG9EZWx0YSgpXG4gICAgICAgICAgICBjb250ZW50LmRlbGV0ZShvZmZzZXQsIGFjdGlvbi5jb3VudClcbiAgICAgICAgICAgIGlmIChjb250ZW50Lmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICBjb250ZW50Lmluc2VydCgwLCAnXFxuJywgZGVsdGFbMF0/LmF0dHJpYnV0ZX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y5yZXRhaW4oc2xvdHMuaW5kZXgpXG4gICAgICAgICAgICBzbG90cy5kZWxldGUoYWN0aW9uLmRlbGV0ZSlcbiAgICAgICAgICB9XG4gICAgICAgIH0pXG4gICAgICB9KVxuICAgIH1cbiAgICByZW1vdGVTbG90cy5vYnNlcnZlKHN5bmNSZW1vdGUpXG5cbiAgICBjb25zdCBzdWIgPSBzbG90cy5vbkNoYW5nZS5zdWJzY3JpYmUob3BlcmF0aW9ucyA9PiB7XG4gICAgICB0aGlzLnJ1bkxvY2FsVXBkYXRlKCgpID0+IHtcbiAgICAgICAgY29uc3QgYXBwbHlBY3Rpb25zID0gb3BlcmF0aW9ucy5hcHBseVxuICAgICAgICBsZXQgaW5kZXg6IG51bWJlclxuICAgICAgICBhcHBseUFjdGlvbnMuZm9yRWFjaChhY3Rpb24gPT4ge1xuICAgICAgICAgIGlmIChhY3Rpb24udHlwZSA9PT0gJ3JldGFpbicpIHtcbiAgICAgICAgICAgIGluZGV4ID0gYWN0aW9uLm9mZnNldFxuICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLnR5cGUgPT09ICdpbnNlcnRTbG90Jykge1xuICAgICAgICAgICAgY29uc3Qgc2xvdCA9IHNsb3RzLmdldChpbmRleCkhXG4gICAgICAgICAgICBjb25zdCBzaGFyZWRTbG90ID0gdGhpcy5jcmVhdGVTaGFyZWRTbG90QnlTbG90KHNsb3QpXG4gICAgICAgICAgICByZW1vdGVTbG90cy5pbnNlcnQoaW5kZXgsIFtzaGFyZWRTbG90XSlcbiAgICAgICAgICAgIGluZGV4KytcbiAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi50eXBlID09PSAnZGVsZXRlJykge1xuICAgICAgICAgICAgc2xvdHMuc2xpY2UoaW5kZXgsIGluZGV4ICsgYWN0aW9uLmNvdW50KS5mb3JFYWNoKHNsb3QgPT4ge1xuICAgICAgICAgICAgICB0aGlzLmNsZWFuU3Vic2NyaXB0aW9uc0J5U2xvdChzbG90KVxuICAg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uZ3RoKSB7XG4gICAgICAgICAgICAgICAgY29udGVudC5mb3JtYXQob2Zmc2V0LCBhY3Rpb24ub2Zmc2V0LCBmb3JtYXRzKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBvZmZzZXQgPSBhY3Rpb24ub2Zmc2V0XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIGlmIChhY3Rpb24udHlwZSA9PT0gJ2luc2VydCcpIHtcbiAgICAgICAgICAgIGNvbnN0IGRlbHRhID0gY29udGVudC50b0RlbHRhKClcbiAgICAgICAgICAgIGNvbnN0IGlzRW1wdHkgPSBkZWx0YS5sZW5ndGggPT09IDEgJiYgZGVsdGFbMF0uaW5zZXJ0ID09PSBTbG90LmVtcHR5UGxhY2Vob2xkZXJcbiAgICAgICAgICAgIGlmICh0eXBlb2YgYWN0aW9uLmNvbnRlbnQgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIGxlbmd0aCA9IGFjdGlvbi5jb250ZW50Lmxlbmd0aFxuICAgICAgICAgICAgICBjb250ZW50Lmluc2VydChvZmZzZXQsIGFjdGlvbi5jb250ZW50LCBhY3Rpb24uZm9ybWF0cyB8fCB7fSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGxlbmd0aCA9IDFcbiAgICAgICAgICAgICAgY29uc3QgY29tcG9uZW50ID0gc2xvdC5nZXRDb250ZW50QXRJbmRleChvZmZzZXQpIGFzIENvbXBvbmVudEluc3RhbmNlXG4gICAgICAgICAgICAgIGNvbnN0IHNoYXJlZENvbXBvbmVudCA9IHRoaXMuY3JlYXRlU2hhcmVkQ29tcG9uZW50QnlDb21wb25lbnQoY29tcG9uZW50KVxuICAgICAgICAgICAgICBjb250ZW50Lmluc2VydEVtYmVkKG9mZnNldCwgc2hhcmVkQ29tcG9uZW50KVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoaXNFbXB0eSAmJiBvZmZzZXQgPT09IDApIHtcbiAgICAgICAgICAgICAgY29udGVudC5kZWxldGUoY29udGVudC5sZW5ndGggLSAxLCAxKVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgb2Zmc2V0ICs9IGxlbmd0aFxuICAgICAgICAgIH0gZWxzZSBpZiAoYWN0aW9uLnR5cGUgPT09ICdkZWxldGUnKSB7XG4gICAgICAgICAgICBjb25zdCBkZWx0YSA9IGNvbnRlbnQudG9EZWx0YSgpXG4gICAgICAgICAgICBjb250ZW50LmRlbGV0ZShvZmZzZXQsIGFjdGlvbi5jb3VudClcbiAgICAgICAgICAgIGlmIChjb250ZW50Lmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICBjb250ZW50Lmluc2VydCgwLCAnXFxuJywgZGVsdGFbMF0/LmF0dHJpYnV0ZXMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KVxuICAgIH0pXG5cbiAgICBzdWIuYWRkKHNsb3Qub25DaGlsZENvbXBvbmVudFJlbW92ZS5zdWJzY3JpYmUoY29tcG9uZW50cyA9PiB7XG4gICAgICBjb21wb25lbnRzLmZvckVhY2goYyA9PiB7XG4gICAgICAgIHRoaXMuY2xlYW5TdWJzY3JpcHRpb25zQnlDb21wb25lbnQoYylcbiAgICAgIH0pXG4gICAgfSkpXG4gICAgdGhpcy5jb250ZW50U3luY0NhY2hlcy5zZXQoc2xvdCwgKCkgPT4ge1xuICAgICAgY29udGVudC51bm9ic2VydmUoc3luY1JlbW90ZSlcbiAgICAgIHN1Yi51bnN1YnNjcmliZSgpXG4gICAgfSlcbiAgfVxuXG4gIHByaXZhdGUgc3luY1Nsb3QocmVtb3RlU2xvdDogWU1hcDxhbnk+LCBzbG90OiBTbG90KSB7XG4gICAgY29uc3Qgc3luY1JlbW90ZSA9IChldiwgdHIpID0+IHtcbiAgICAgIHRoaXMucnVuUmVtb3RlVXBkYXRlKHRyLCAoKSA9PiB7XG4gICAgICAgIG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HMucHVzaChbZm9ybWF0dGVyLCBhdHRyc1trZXldXSlcbiAgICAgIH1cbiAgICB9KVxuICB9XG4gIHJldHVybiBmb3JtYXRzXG59XG4iXX0=
@@ -0,0 +1,9 @@
1
+ import { Plugin } from '@textbus/core';
2
+ import { Injector } from '@tanbo/di';
3
+ export declare class FixedCaretPlugin implements Plugin {
4
+ scrollContainer: HTMLElement;
5
+ private subscriptions;
6
+ constructor(scrollContainer: HTMLElement);
7
+ setup(injector: Injector): void;
8
+ onDestroy(): void;
9
+ }
@@ -0,0 +1,41 @@
1
+ import { Renderer, Scheduler } from '@textbus/core';
2
+ import { Caret } from '@textbus/browser';
3
+ import { Subscription } from '@tanbo/stream';
4
+ export class FixedCaretPlugin {
5
+ constructor(scrollContainer) {
6
+ Object.defineProperty(this, "scrollContainer", {
7
+ enumerable: true,
8
+ configurable: true,
9
+ writable: true,
10
+ value: scrollContainer
11
+ });
12
+ Object.defineProperty(this, "subscriptions", {
13
+ enumerable: true,
14
+ configurable: true,
15
+ writable: true,
16
+ value: new Subscription()
17
+ });
18
+ }
19
+ setup(injector) {
20
+ const scheduler = injector.get(Scheduler);
21
+ const caret = injector.get(Caret);
22
+ const renderer = injector.get(Renderer);
23
+ let isChanged = false;
24
+ let caretPosition = null;
25
+ renderer.onViewChecked.subscribe(() => {
26
+ isChanged = true;
27
+ });
28
+ this.subscriptions.add(caret.onPositionChange.subscribe(position => {
29
+ if (isChanged && caretPosition && position && !scheduler.hasLocalUpdate) {
30
+ const offset = position.top - caretPosition.top;
31
+ this.scrollContainer.scrollTop += offset;
32
+ isChanged = false;
33
+ }
34
+ caretPosition = position;
35
+ }));
36
+ }
37
+ onDestroy() {
38
+ this.subscriptions.unsubscribe();
39
+ }
40
+ }
41
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZml4ZWQtY2FyZXQucGx1Z2luLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2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W5kZXJlcilcblxuICAgIGxldCBpc0NoYW5nZWQgPSBmYWxzZVxuICAgIGxldCBjYXJldFBvc2l0aW9uOiBDYXJldFBvc2l0aW9uIHwgbnVsbCA9IG51bGxcbiAgICByZW5kZXJlci5vblZpZXdDaGVja2VkLnN1YnNjcmliZSgoKSA9PiB7XG4gICAgICBpc0NoYW5nZWQgPSB0cnVlXG4gICAgfSlcbiAgICB0aGlzLnN1YnNjcmlwdGlvbnMuYWRkKGNhcmV0Lm9uUG9zaXRpb25DaGFuZ2Uuc3Vic2NyaWJlKHBvc2l0aW9uID0+IHtcbiAgICAgIGlmIChpc0NoYW5nZWQgJiYgY2FyZXRQb3NpdGlvbiAmJiBwb3NpdGlvbiAmJiAhc2NoZWR1bGVyLmhhc0xvY2FsVXBkYXRlKSB7XG4gICAgICAgIGNvbnN0IG9mZnNldCA9IHBvc2l0aW9uLnRvcCAtIGNhcmV0UG9zaXRpb24udG9wXG4gICAgICAgIHRoaXMuc2Nyb2xsQ29udGFpbmVyLnNjcm9sbFRvcCArPSBvZmZzZXRcbiAgICAgICAgaXNDaGFuZ2VkID0gZmFsc2VcbiAgICAgIH1cbiAgICAgIGNhcmV0UG9zaXRpb24gPSBwb3NpdGlvblxuICAgIH0pKVxuICB9XG5cbiAgb25EZXN0cm95KCkge1xuICAgIHRoaXMuc3Vic2NyaXB0aW9ucy51bnN1YnNjcmliZSgpXG4gIH1cbn1cbiJdfQ==
@@ -1,2 +1,5 @@
1
- export * from './collab/_api';
1
+ import { Module } from '@textbus/core';
2
2
  export * from './collaborate';
3
+ export * from './collaborate-cursor';
4
+ export * from './fixed-caret.plugin';
5
+ export declare const collaborateModule: Module;
@@ -1,3 +1,17 @@
1
- export * from './collab/_api';
1
+ import { History } from '@textbus/core';
2
+ import { Collaborate } from './collaborate';
3
+ import { CollaborateCursor } from './collaborate-cursor';
2
4
  export * from './collaborate';
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsZUFBZSxDQUFBO0FBQzdCLGNBQWMsZUFBZSxDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9jb2xsYWIvX2FwaSdcbmV4cG9ydCAqIGZyb20gJy4vY29sbGFib3JhdGUnXG4iXX0=
5
+ export * from './collaborate-cursor';
6
+ export * from './fixed-caret.plugin';
7
+ export const collaborateModule = {
8
+ providers: [
9
+ Collaborate,
10
+ CollaborateCursor,
11
+ {
12
+ provide: History,
13
+ useClass: Collaborate
14
+ }
15
+ ]
16
+ };
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxPQUFPLEVBQVUsTUFBTSxlQUFlLENBQUE7QUFFL0MsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGVBQWUsQ0FBQTtBQUMzQyxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQTtBQUV4RCxjQUFjLGVBQWUsQ0FBQTtBQUM3QixjQUFjLHNCQUFzQixDQUFBO0FBQ3BDLGNBQWMsc0JBQXNCLENBQUE7QUFFcEMsTUFBTSxDQUFDLE1BQU0saUJBQWlCLEdBQVc7SUFDdkMsU0FBUyxFQUFFO1FBQ1QsV0FBVztRQUNYLGlCQUFpQjtRQUNqQjtZQUNFLE9BQU8sRUFBRSxPQUFPO1lBQ2hCLFFBQVEsRUFBRSxXQUFXO1NBQ3RCO0tBQ0Y7Q0FDRixDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgSGlzdG9yeSwgTW9kdWxlIH0gZnJvbSAnQHRleHRidXMvY29yZSdcblxuaW1wb3J0IHsgQ29sbGFib3JhdGUgfSBmcm9tICcuL2NvbGxhYm9yYXRlJ1xuaW1wb3J0IHsgQ29sbGFib3JhdGVDdXJzb3IgfSBmcm9tICcuL2NvbGxhYm9yYXRlLWN1cnNvcidcblxuZXhwb3J0ICogZnJvbSAnLi9jb2xsYWJvcmF0ZSdcbmV4cG9ydCAqIGZyb20gJy4vY29sbGFib3JhdGUtY3Vyc29yJ1xuZXhwb3J0ICogZnJvbSAnLi9maXhlZC1jYXJldC5wbHVnaW4nXG5cbmV4cG9ydCBjb25zdCBjb2xsYWJvcmF0ZU1vZHVsZTogTW9kdWxlID0ge1xuICBwcm92aWRlcnM6IFtcbiAgICBDb2xsYWJvcmF0ZSxcbiAgICBDb2xsYWJvcmF0ZUN1cnNvcixcbiAgICB7XG4gICAgICBwcm92aWRlOiBIaXN0b3J5LFxuICAgICAgdXNlQ2xhc3M6IENvbGxhYm9yYXRlXG4gICAgfVxuICBdXG59XG4iXX0=
@@ -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,e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gJ0B0ZXh0YnVzL2NvcmUnXG5cbmV4cG9ydCBmdW5jdGlvbiBjcmVhdGVVbmtub3duQ29tcG9uZW50KGZhY3RvcnlOYW1lOiBzdHJpbmcsIGNhbkluc2VydElubGluZUNvbXBvbmVudDogYm9vbGVhbikge1xuICBjb25zdCB1bmtub3duQ29tcG9uZW50ID0gZGVmaW5lQ29tcG9uZW50KHtcbiAgICB0eXBlOiBjYW5JbnNlcnRJbmxpbmVDb21wb25lbnQgPyBDb250ZW50VHlwZS5JbmxpbmVDb21wb25lbnQgOiBDb250ZW50VHlwZS5CbG9ja0NvbXBvbmVudCxcbiAgICBuYW1lOiAnVW5rbm93bkNvbXBvbmVudCcsXG4gICAgc2V0dXAoKSB7XG4gICAgICBjb25zb2xlLmVycm9yKGBjYW5ub3QgZmluZCBjb21wb25lbnQgZmFjdG9yeSBcXGAke2ZhY3RvcnlOYW1lfVxcYC5gKVxuICAgICAgcmV0dXJuIHtcbiAgICAgICAgcmVuZGVyKCkge1xuICAgICAgICAgIHJldHVybiBWRWxlbWVudC5jcmVhdGVFbGVtZW50KCd0ZXh0YnVzLXVua25vd24tY29tcG9uZW50Jywge1xuICAgICAgICAgICAgc3R5bGU6IHtcbiAgICAgICAgICAgICAgZGlzcGxheTogY2FuSW5zZXJ0SW5saW5lQ29tcG9uZW50ID8gJ2lubGluZScgOiAnYmxvY2snLFxuICAgICAgICAgICAgICBjb2xvcjogJyNmMDAnXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSwgdW5rbm93bkNvbXBvbmVudC5uYW1lKVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9KVxuICByZXR1cm4gdW5rbm93bkNvbXBvbmVudFxufVxuIl19