@ones-editor/editor 1.1.10-beta.5 → 1.1.10-beta.7

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
@@ -8043,6 +8043,7 @@ var __publicField = (obj, key, value) => {
8043
8043
  reject(err);
8044
8044
  input2.remove();
8045
8045
  };
8046
+ document.body.append(input2);
8046
8047
  input2.click();
8047
8048
  });
8048
8049
  }
@@ -34355,6 +34356,7 @@ ${codeText}
34355
34356
  Connection.apply(this.connection, [this.ws]);
34356
34357
  }
34357
34358
  async handleAuthError() {
34359
+ var _a, _b;
34358
34360
  if (this.reauthFunc) {
34359
34361
  if (this.retryCount >= 5 || !this.enabled) {
34360
34362
  logger$2p.warn("retry auth times exceed 5, broadcast auth error");
@@ -34363,6 +34365,7 @@ ${codeText}
34363
34365
  if (!this.enabled) {
34364
34366
  return;
34365
34367
  }
34368
+ (_a = this.ws) == null ? void 0 : _a.close();
34366
34369
  this.retryCount += 1;
34367
34370
  logger$2p.info(`retrying re-auth attempt no. ${this.retryCount}`);
34368
34371
  try {
@@ -34370,13 +34373,15 @@ ${codeText}
34370
34373
  const newAuth = await this.reauthFunc();
34371
34374
  await this.auth(newAuth);
34372
34375
  const pingOptions = this.pingOptions;
34376
+ (_b = this.ws) == null ? void 0 : _b.reconnect();
34373
34377
  this.connection._initializeHandshake = function handshake() {
34374
34378
  this.send({ a: "hs", id: this.id, auth: newAuth, options: { ping: pingOptions } });
34375
34379
  };
34376
34380
  }
34377
34381
  } catch (err) {
34378
34382
  logger$2p.error(err);
34379
- setTimeout(() => this.handleAuthError(), 2 * this.retryCount * 1e3);
34383
+ const maxInterval = 30 * 1e3;
34384
+ setTimeout(() => this.handleAuthError(), Math.min(2 * this.retryCount * 1e3, maxInterval));
34380
34385
  }
34381
34386
  }
34382
34387
  }
@@ -75633,7 +75638,7 @@ ${data.flowchartText}
75633
75638
  }
75634
75639
  }
75635
75640
  });
75636
- editor.version = "1.1.10-beta.5";
75641
+ editor.version = "1.1.10-beta.7";
75637
75642
  return editor;
75638
75643
  }
75639
75644
  function isDoc(doc2) {
@@ -75706,7 +75711,7 @@ ${data.flowchartText}
75706
75711
  });
75707
75712
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
75708
75713
  OnesEditorToolbar.register(editor);
75709
- editor.version = "1.1.10-beta.5";
75714
+ editor.version = "1.1.10-beta.7";
75710
75715
  return editor;
75711
75716
  }
75712
75717
  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.10-beta.5",
3
+ "version": "1.1.10-beta.7",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",