@ones-editor/editor 0.0.7-beta.55 → 0.0.7-beta.56

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
@@ -25962,14 +25962,7 @@ var __publicField = (obj, key, value) => {
25962
25962
  }
25963
25963
  localUpdateBlockData(containerId, blockIndex, delta, newRange) {
25964
25964
  assert(logger$2B, !this.editor.readonly, "editor is readonly");
25965
- const block = this.editor.getBlockByIndex(containerId, blockIndex);
25966
- if (!this.editor.isBlockWritable(block)) {
25967
- const deletedKeys = Array.from(delta.delete).filter((key) => key !== "comments");
25968
- const insertedKeys = Object.keys(delta.insert).filter((key) => key !== "comments");
25969
- if (deletedKeys.length > 0 || insertedKeys.length > 0) {
25970
- assert(logger$2B, false, `block is not writable, comment supported only, ${JSON.stringify(delta)}}`);
25971
- }
25972
- }
25965
+ this.editor.getBlockByIndex(containerId, blockIndex);
25973
25966
  const oldData = cloneDeep__default.default(this.getBlockData(containerId, blockIndex));
25974
25967
  const newData = cloneDeep__default.default(applyBlockDataDelta(oldData, delta));
25975
25968
  this.localEvents.forEach((event) => event.onBeforeUpdateBlockData(containerId, oldData.id, oldData, newData, newRange));
@@ -33375,6 +33368,9 @@ var __publicField = (obj, key, value) => {
33375
33368
  this.ws.addEventListener(event, callback);
33376
33369
  }
33377
33370
  }
33371
+ onAuthError(callback) {
33372
+ this.events.addListener("error", callback);
33373
+ }
33378
33374
  onWriteConflictError(callback) {
33379
33375
  this.events.addListener("writeConflictError", callback);
33380
33376
  }
@@ -33485,6 +33481,9 @@ var __publicField = (obj, key, value) => {
33485
33481
  }
33486
33482
  });
33487
33483
  }
33484
+ onAuthError(callback) {
33485
+ this.connection.onAuthError(callback);
33486
+ }
33488
33487
  onWriteConflictError(callback) {
33489
33488
  this.connection.onWriteConflictError(callback);
33490
33489
  }
@@ -34592,6 +34591,12 @@ var __publicField = (obj, key, value) => {
34592
34591
  this.doc.on("nothing pending", this.handleNothingPending);
34593
34592
  this.doc.on("create", this.handleCreate);
34594
34593
  this.doc.on("del", this.handleDel);
34594
+ this.client.onAuthError((err) => {
34595
+ this.callbacks.forEach((cb) => {
34596
+ var _a;
34597
+ return (_a = cb.onError) == null ? void 0 : _a.call(cb, err);
34598
+ });
34599
+ });
34595
34600
  this.client.onWriteConflictError(this.handleWriteConflictError);
34596
34601
  }
34597
34602
  clearEvents() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "0.0.7-beta.55",
3
+ "version": "0.0.7-beta.56",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",