@ones-editor/editor 2.9.8-beta.4 → 2.9.8-beta.6

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
@@ -31957,6 +31957,7 @@ ${codeText}
31957
31957
  __publicField(this, "settingsProvider");
31958
31958
  __publicField(this, "_readonly", false);
31959
31959
  __publicField(this, "_scrollable", true);
31960
+ __publicField(this, "_destroyed", false);
31960
31961
  __publicField(this, "getColor", (index2) => {
31961
31962
  const colors = this.options.colors;
31962
31963
  if (colors.length === 0) {
@@ -32096,6 +32097,10 @@ ${codeText}
32096
32097
  this.domEvents.destroy();
32097
32098
  this.removeAllListeners();
32098
32099
  this.inputHandlers.destroy();
32100
+ this._destroyed = true;
32101
+ }
32102
+ get destroyed() {
32103
+ return this._destroyed;
32099
32104
  }
32100
32105
  focus(options) {
32101
32106
  this.input.focus(options);
@@ -32387,11 +32392,17 @@ ${codeText}
32387
32392
  this.emit("change", Array.from(this.users.values()));
32388
32393
  }, 300);
32389
32394
  }
32390
- getSimpleCursors(blockId) {
32395
+ getSimpleCursors(blockId, excludeUserId) {
32391
32396
  const ret = /* @__PURE__ */ new Map();
32392
32397
  Array.from(this.cursors.values()).filter((message) => {
32393
32398
  const ret2 = message.range.anchor.blockId === blockId && isSimpleRange(message.range);
32394
- return ret2;
32399
+ if (!ret2) {
32400
+ return false;
32401
+ }
32402
+ if (excludeUserId && excludeUserId === message.user.userId) {
32403
+ return false;
32404
+ }
32405
+ return true;
32395
32406
  }).forEach((message) => {
32396
32407
  const offset = message.range.focus.offset;
32397
32408
  let users = ret.get(offset);
@@ -40163,7 +40174,7 @@ ${codeText}
40163
40174
  assert(logger$2S, typeof blockIndex === "number", "invalid path blockIndex");
40164
40175
  const blockData = editor.doc.getBlockData(containerId, blockIndex);
40165
40176
  const length = getTextLength(blockText);
40166
- const cursorMessages = remoteUsers.getSimpleCursors(blockData.id);
40177
+ const cursorMessages = remoteUsers.getSimpleCursors(blockData.id, editor.doc.getUser().userId);
40167
40178
  cursorMessages.forEach((messages, offset) => {
40168
40179
  if (offset > length) {
40169
40180
  offset = length;
@@ -95008,7 +95019,7 @@ ${JSON.stringify(error2, null, 2)}`);
95008
95019
  }
95009
95020
  }
95010
95021
  });
95011
- editor.version = "2.9.8-beta.4";
95022
+ editor.version = "2.9.8-beta.6";
95012
95023
  return editor;
95013
95024
  }
95014
95025
  function isDoc(doc2) {
@@ -95140,7 +95151,7 @@ ${JSON.stringify(error2, null, 2)}`);
95140
95151
  OnesEditorDropTarget.register(editor);
95141
95152
  OnesEditorTocProvider.register(editor);
95142
95153
  OnesEditorExclusiveBlock.register(editor);
95143
- editor.version = "2.9.8-beta.4";
95154
+ editor.version = "2.9.8-beta.6";
95144
95155
  return editor;
95145
95156
  }
95146
95157
  async function showDocVersions(editor, options, serverUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "2.9.8-beta.4",
3
+ "version": "2.9.8-beta.6",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {