@textbus/collaborate 4.5.0 → 4.5.1

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.
@@ -1708,6 +1708,7 @@ class MultipleDocumentCollaborateModule {
1708
1708
  setup(textbus) {
1709
1709
  const messageBus = textbus.get(MessageBus, null);
1710
1710
  const connector = textbus.get(SyncConnector);
1711
+ const collab = textbus.get(Collaborate);
1711
1712
  if (messageBus) {
1712
1713
  const selection = textbus.get(Selection);
1713
1714
  connector.setLocalStateField('message', messageBus.get(textbus));
@@ -1719,7 +1720,10 @@ class MultipleDocumentCollaborateModule {
1719
1720
  messageBus.consume(states, textbus);
1720
1721
  }));
1721
1722
  }
1722
- return connector.onLoad.toPromise();
1723
+ return connector.onLoad.toPromise().then(() => {
1724
+ var _a, _b;
1725
+ return (_b = (_a = this.config).beforeSync) === null || _b === void 0 ? void 0 : _b.call(_a, collab.yDoc);
1726
+ });
1723
1727
  }
1724
1728
  onDestroy(textbus) {
1725
1729
  this.subscription.unsubscribe();
package/bundles/index.js CHANGED
@@ -1710,6 +1710,7 @@ class MultipleDocumentCollaborateModule {
1710
1710
  setup(textbus) {
1711
1711
  const messageBus = textbus.get(MessageBus, null);
1712
1712
  const connector = textbus.get(SyncConnector);
1713
+ const collab = textbus.get(exports.Collaborate);
1713
1714
  if (messageBus) {
1714
1715
  const selection = textbus.get(core.Selection);
1715
1716
  connector.setLocalStateField('message', messageBus.get(textbus));
@@ -1721,7 +1722,10 @@ class MultipleDocumentCollaborateModule {
1721
1722
  messageBus.consume(states, textbus);
1722
1723
  }));
1723
1724
  }
1724
- return connector.onLoad.toPromise();
1725
+ return connector.onLoad.toPromise().then(() => {
1726
+ var _a, _b;
1727
+ return (_b = (_a = this.config).beforeSync) === null || _b === void 0 ? void 0 : _b.call(_a, collab.yDoc);
1728
+ });
1725
1729
  }
1726
1730
  onDestroy(textbus) {
1727
1731
  this.subscription.unsubscribe();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/collaborate",
3
- "version": "4.5.0",
3
+ "version": "4.5.1",
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",
@@ -50,5 +50,5 @@
50
50
  "bugs": {
51
51
  "url": "https://github.com/textbus/textbus.git/issues"
52
52
  },
53
- "gitHead": "327e764487545a35d97eae525b61307642b8f386"
53
+ "gitHead": "badc41649d7dbf25bc832bcbf37e02936ee5a847"
54
54
  }