@textbus/collaborate 5.0.0-alpha.2 → 5.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -521,6 +521,8 @@ let Collaborate = class Collaborate {
521
521
  return;
522
522
  }
523
523
  const content = subDocument.getText('content');
524
+ const data = subDocument.getMap('data');
525
+ this.syncLocalMapToSharedMap(localSlot.data, data);
524
526
  this.initSharedSlotByLocalSlot(content, localSlot);
525
527
  this.syncSlot(content, localSlot);
526
528
  this.addSubModelEvent.next({
@@ -572,11 +574,13 @@ let Collaborate = class Collaborate {
572
574
  const schema = sharedSlot.getAttribute('schema');
573
575
  if (type === 'async') {
574
576
  const metadata = sharedSlot.getAttribute('metadata');
575
- const slot = new AsyncSlot(schema || [], {});
577
+ const slot = new AsyncSlot(schema || [], {}, {});
576
578
  this.syncSharedMapToLocalMap(metadata, slot.metadata);
577
579
  const loadedSubDocument = this.subModelLoader.getLoadedModelBySlot(slot);
578
580
  if (loadedSubDocument) {
579
581
  const subContent = loadedSubDocument.getText('content');
582
+ const data = loadedSubDocument.getMap('data');
583
+ this.syncSharedMapToLocalMap(data, slot.data);
580
584
  this.syncRootSlot(loadedSubDocument, subContent, slot);
581
585
  this.addSubModelEvent.next({
582
586
  yDoc: loadedSubDocument,
@@ -594,6 +598,8 @@ let Collaborate = class Collaborate {
594
598
  }
595
599
  slot.loader.markAsLoaded();
596
600
  const subContent = subDocument.getText('content');
601
+ const data = subDocument.getMap('data');
602
+ this.syncSharedMapToLocalMap(data, slot.data);
597
603
  this.syncRootSlot(subDocument, subContent, slot);
598
604
  this.addSubModelEvent.next({
599
605
  yDoc: subDocument,
package/bundles/index.js CHANGED
@@ -523,6 +523,8 @@ exports.Collaborate = class Collaborate {
523
523
  return;
524
524
  }
525
525
  const content = subDocument.getText('content');
526
+ const data = subDocument.getMap('data');
527
+ this.syncLocalMapToSharedMap(localSlot.data, data);
526
528
  this.initSharedSlotByLocalSlot(content, localSlot);
527
529
  this.syncSlot(content, localSlot);
528
530
  this.addSubModelEvent.next({
@@ -574,11 +576,13 @@ exports.Collaborate = class Collaborate {
574
576
  const schema = sharedSlot.getAttribute('schema');
575
577
  if (type === 'async') {
576
578
  const metadata = sharedSlot.getAttribute('metadata');
577
- const slot = new core.AsyncSlot(schema || [], {});
579
+ const slot = new core.AsyncSlot(schema || [], {}, {});
578
580
  this.syncSharedMapToLocalMap(metadata, slot.metadata);
579
581
  const loadedSubDocument = this.subModelLoader.getLoadedModelBySlot(slot);
580
582
  if (loadedSubDocument) {
581
583
  const subContent = loadedSubDocument.getText('content');
584
+ const data = loadedSubDocument.getMap('data');
585
+ this.syncSharedMapToLocalMap(data, slot.data);
582
586
  this.syncRootSlot(loadedSubDocument, subContent, slot);
583
587
  this.addSubModelEvent.next({
584
588
  yDoc: loadedSubDocument,
@@ -596,6 +600,8 @@ exports.Collaborate = class Collaborate {
596
600
  }
597
601
  slot.loader.markAsLoaded();
598
602
  const subContent = subDocument.getText('content');
603
+ const data = subDocument.getMap('data');
604
+ this.syncSharedMapToLocalMap(data, slot.data);
599
605
  this.syncRootSlot(subDocument, subContent, slot);
600
606
  this.addSubModelEvent.next({
601
607
  yDoc: subDocument,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/collaborate",
3
- "version": "5.0.0-alpha.2",
3
+ "version": "5.0.0-alpha.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/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "@hocuspocus/provider": "^2.15.2",
29
29
  "@tanbo/stream": "^1.2.7",
30
- "@textbus/core": "^5.0.0-alpha.2",
30
+ "@textbus/core": "^5.0.0-alpha.3",
31
31
  "@viewfly/core": "^2.0.0-alpha.3",
32
32
  "y-websocket": "^2.1.0",
33
33
  "yjs": "^13.6.23"
@@ -50,5 +50,5 @@
50
50
  "bugs": {
51
51
  "url": "https://github.com/textbus/textbus.git/issues"
52
52
  },
53
- "gitHead": "97907867dcabead654d9269cbf241da769c17dbd"
53
+ "gitHead": "2a056b755365c23f31ca71abac859edd7e065d85"
54
54
  }