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

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
@@ -34350,9 +34350,7 @@ ${codeText}
34350
34350
  this.events.emit("writeConflictError", error2);
34351
34351
  }
34352
34352
  emitMaxUsersError() {
34353
- const err = new Error(MaxUserError.msg);
34354
- err.code = MaxUserError.err;
34355
- this.events.emit("maxUsersError", err);
34353
+ this.events.emit("maxUsersError");
34356
34354
  this.end(false);
34357
34355
  }
34358
34356
  handleMessage(message) {
@@ -35637,6 +35635,10 @@ ${codeText}
35637
35635
  static async load(options) {
35638
35636
  try {
35639
35637
  const client = new ShareDBClient(options.auth, options.serverUrl, options.reauthFunc);
35638
+ client.onMaxUsersError(() => {
35639
+ var _a;
35640
+ return (_a = options.onMaxUsersError) == null ? void 0 : _a.call(options);
35641
+ });
35640
35642
  const doc2 = await client.getDoc();
35641
35643
  const shareDBDoc = new ShareDBDoc(client, doc2, options.disableLogout);
35642
35644
  if (doc2.type === null) {
@@ -35683,12 +35685,6 @@ ${codeText}
35683
35685
  return (_a = cb.onAuthRecover) == null ? void 0 : _a.call(cb);
35684
35686
  });
35685
35687
  });
35686
- this.client.onMaxUsersError((err) => {
35687
- this.callbacks.forEach((cb) => {
35688
- var _a;
35689
- return (_a = cb.onError) == null ? void 0 : _a.call(cb, err);
35690
- });
35691
- });
35692
35688
  this.client.onWriteConflictError(this.handleWriteConflictError);
35693
35689
  }
35694
35690
  clearEvents() {
@@ -76994,7 +76990,8 @@ ${data.flowchartText}
76994
76990
  },
76995
76991
  serverUrl: options.serverUrl,
76996
76992
  reauthFunc,
76997
- disableLogout: options.disableLogout
76993
+ disableLogout: options.disableLogout,
76994
+ onMaxUsersError: options.onMaxUsersError
76998
76995
  };
76999
76996
  const doc2 = await ShareDBDoc.load(docOptions);
77000
76997
  const editor = createEditor(root2, doc2, {
@@ -77130,7 +77127,7 @@ ${data.flowchartText}
77130
77127
  }
77131
77128
  }
77132
77129
  });
77133
- editor.version = "1.1.18-beta.15";
77130
+ editor.version = "1.1.18-beta.17";
77134
77131
  if (Logger$2.level === LogLevel.DEBUG) {
77135
77132
  window.setReauthFail = (fail) => {
77136
77133
  window.isReauthError = fail;
@@ -77218,7 +77215,7 @@ ${data.flowchartText}
77218
77215
  });
77219
77216
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
77220
77217
  OnesEditorToolbar.register(editor);
77221
- editor.version = "1.1.18-beta.15";
77218
+ editor.version = "1.1.18-beta.17";
77222
77219
  return editor;
77223
77220
  }
77224
77221
  async function showDocVersions(editor, options, serverUrl) {
package/dist/types.d.ts CHANGED
@@ -62,6 +62,7 @@ export interface CreateOnesEditorOptions {
62
62
  applyContentPlaceholder?: (editor: OnesEditor) => boolean;
63
63
  };
64
64
  onReauth?: (userId: string, docId: string, permission: OnesEditorUserPermission) => Promise<string>;
65
+ onMaxUsersError?: () => void;
65
66
  user: {
66
67
  userId: string;
67
68
  displayName: string;
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.17",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",