@ones-editor/editor 1.1.18-beta.15 → 1.1.18-beta.16

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.
package/dist/index.js CHANGED
@@ -34474,22 +34474,21 @@ ${codeText}
34474
34474
  __publicField(this, "reauthFunc");
34475
34475
  __publicField(this, "clientId", genId());
34476
34476
  __publicField(this, "getDoc", async () => {
34477
- const fetchDoc = (doc22) => new Promise((resolve, reject) => {
34478
- doc22.fetch((err) => {
34479
- if (err)
34480
- reject(err);
34481
- else
34482
- resolve();
34483
- });
34484
- });
34485
34477
  assert(logger$2p, !this.doc, "This websocket has opened a doc.");
34486
34478
  await this.connection.init(this.auth);
34487
34479
  const doc2 = this.connection.get(this.auth.appId, this.auth.docId);
34488
34480
  this.doc = doc2;
34489
- await fetchDoc(doc2);
34490
- logger$2p.debug(doc2);
34491
34481
  return doc2;
34492
34482
  });
34483
+ __publicField(this, "fetchDoc", (doc2) => new Promise((resolve, reject) => {
34484
+ doc2.fetch((err) => {
34485
+ if (err)
34486
+ reject(err);
34487
+ else
34488
+ resolve();
34489
+ });
34490
+ logger$2p.debug(doc2);
34491
+ }));
34493
34492
  this.auth = auth;
34494
34493
  const url = `${serverUrl}/${this.auth.appId}/${this.auth.docId}`;
34495
34494
  types.register(json1__namespace.type);
@@ -35639,6 +35638,8 @@ ${codeText}
35639
35638
  const client = new ShareDBClient(options.auth, options.serverUrl, options.reauthFunc);
35640
35639
  const doc2 = await client.getDoc();
35641
35640
  const shareDBDoc = new ShareDBDoc(client, doc2, options.disableLogout);
35641
+ shareDBDoc.initEvents();
35642
+ await client.fetchDoc(doc2);
35642
35643
  if (doc2.type === null) {
35643
35644
  if (options.autoCreateDoc === false) {
35644
35645
  const error2 = new Error("doc not exists");
@@ -35649,7 +35650,6 @@ ${codeText}
35649
35650
  }
35650
35651
  await shareDBDoc.initPresence();
35651
35652
  await shareDBDoc.subscribe();
35652
- shareDBDoc.initEvents();
35653
35653
  return shareDBDoc;
35654
35654
  } catch (err) {
35655
35655
  logger$2k.error(err);
@@ -77130,7 +77130,7 @@ ${data.flowchartText}
77130
77130
  }
77131
77131
  }
77132
77132
  });
77133
- editor.version = "1.1.18-beta.15";
77133
+ editor.version = "1.1.18-beta.16";
77134
77134
  if (Logger$2.level === LogLevel.DEBUG) {
77135
77135
  window.setReauthFail = (fail) => {
77136
77136
  window.isReauthError = fail;
@@ -77218,7 +77218,7 @@ ${data.flowchartText}
77218
77218
  });
77219
77219
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
77220
77220
  OnesEditorToolbar.register(editor);
77221
- editor.version = "1.1.18-beta.15";
77221
+ editor.version = "1.1.18-beta.16";
77222
77222
  return editor;
77223
77223
  }
77224
77224
  async function showDocVersions(editor, options, serverUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "1.1.18-beta.15",
3
+ "version": "1.1.18-beta.16",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",