@ones-editor/editor 4.0.7-beta.h1474.3 → 4.0.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
@@ -48921,6 +48921,8 @@ ${codeText}
48921
48921
  }
48922
48922
  function resetScrollbarCore(scrollCore, scrollWrap) {
48923
48923
  const scrollContainer = getScrollContainer(scrollWrap);
48924
+ if (!scrollContainer || !getContainerOption(scrollCore, getContainer(scrollContainer)))
48925
+ return;
48924
48926
  const scrollbarContainer = getScrollbarContainer(scrollContainer);
48925
48927
  const { scrollWidth, clientWidth } = getElementScrollSize(scrollContainer);
48926
48928
  const { paddingLeft, paddingRight } = getScrollWrapPaddingSize(scrollWrap);
@@ -48937,7 +48939,7 @@ ${codeText}
48937
48939
  }
48938
48940
  function debounceByArgs(func, wait) {
48939
48941
  const debouncers = /* @__PURE__ */ new Map();
48940
- return function(...args) {
48942
+ const debounced = function(...args) {
48941
48943
  var _a;
48942
48944
  const scrollWrap = args[1];
48943
48945
  let key = (scrollWrap == null ? void 0 : scrollWrap.genId) || "";
@@ -48949,17 +48951,30 @@ ${codeText}
48949
48951
  if (!debouncers.has(key)) {
48950
48952
  debouncers.set(key, debounce__default.default(
48951
48953
  (...innerArgs) => {
48952
- const result = func.apply(this, innerArgs);
48953
- if (scrollWrap)
48954
- scrollWrap.genId = void 0;
48955
- debouncers.delete(key);
48956
- return result;
48954
+ try {
48955
+ return func.apply(this, innerArgs);
48956
+ } finally {
48957
+ if (scrollWrap)
48958
+ scrollWrap.genId = void 0;
48959
+ debouncers.delete(key);
48960
+ }
48957
48961
  },
48958
48962
  wait
48959
48963
  ));
48960
48964
  }
48961
48965
  return (_a = debouncers.get(key)) == null ? void 0 : _a.apply(this, args);
48962
48966
  };
48967
+ debounced.cancel = (scrollWrap) => {
48968
+ var _a, _b;
48969
+ const target = scrollWrap;
48970
+ const key = target.genId;
48971
+ if (!key)
48972
+ return;
48973
+ (_b = (_a = debouncers.get(key)) == null ? void 0 : _a.cancel) == null ? void 0 : _b.call(_a);
48974
+ debouncers.delete(key);
48975
+ target.genId = void 0;
48976
+ };
48977
+ return debounced;
48963
48978
  }
48964
48979
  const resetScrollbar = debounceByArgs(resetScrollbarCore, 50);
48965
48980
  function resetScrollbarLeft(scrollContainer, scrollbarContainer) {
@@ -49454,6 +49469,7 @@ ${codeText}
49454
49469
  }
49455
49470
  unbindCore(scrollContainer, scrollWrap) {
49456
49471
  var _a, _b, _c, _d, _e, _f;
49472
+ resetScrollbar.cancel(scrollWrap);
49457
49473
  if (!this.boundContainers.delete(scrollContainer))
49458
49474
  return;
49459
49475
  const scrollbarContainer = getScrollbarContainer(scrollContainer);
@@ -74225,10 +74241,11 @@ ${codeText}
74225
74241
  createTableBorderBar(editor, tableBlock);
74226
74242
  }
74227
74243
  function hideTableBorderBar(editor, tableBlock) {
74244
+ var _a, _b;
74228
74245
  assert(logger$14, isTableBlock(tableBlock), "invalid table block");
74229
- const tools = getTableTools(editor, tableBlock);
74246
+ const tools = (_a = getBlockContent(tableBlock).querySelector("div[data-type=table-content]")) == null ? void 0 : _a.querySelector(":scope >div[data-type=table-tools]");
74230
74247
  const blockTools = getBlockTools(tableBlock);
74231
- const topTableBorderBar = tools.querySelectorAll(".table-border-bar-container");
74248
+ const topTableBorderBar = (_b = tools == null ? void 0 : tools.querySelectorAll(".table-border-bar-container")) != null ? _b : [];
74232
74249
  const leftTableBorderBar = blockTools.querySelectorAll(".table-border-bar-container");
74233
74250
  topTableBorderBar.forEach((elem) => {
74234
74251
  editor.domEvents.removeEventListener(elem, "click", handleBorderBarClicked);
@@ -97861,7 +97878,7 @@ ${JSON.stringify(error2, null, 2)}`);
97861
97878
  }
97862
97879
  }
97863
97880
  });
97864
- editor.version = "4.0.7-beta.h1474.3";
97881
+ editor.version = "4.0.7";
97865
97882
  return editor;
97866
97883
  }
97867
97884
  function isDoc(doc2) {
@@ -97997,7 +98014,7 @@ ${JSON.stringify(error2, null, 2)}`);
97997
98014
  OnesEditorDropTarget.register(editor);
97998
98015
  OnesEditorTocProvider.register(editor);
97999
98016
  OnesEditorExclusiveBlock.register(editor);
98000
- editor.version = "4.0.7-beta.h1474.3";
98017
+ editor.version = "4.0.7";
98001
98018
  return editor;
98002
98019
  } catch (error2) {
98003
98020
  try {
@@ -98140,7 +98157,7 @@ ${JSON.stringify(error2, null, 2)}`);
98140
98157
  }
98141
98158
  }
98142
98159
  });
98143
- editor.version = "4.0.7-beta.h1474.3";
98160
+ editor.version = "4.0.7";
98144
98161
  return editor;
98145
98162
  }
98146
98163
  const emojis$1 = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "4.0.7-beta.h1474.3",
3
+ "version": "4.0.7",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {