@ones-editor/editor 5.0.8-beta.h1475.3 → 5.0.8-beta.h1475.4

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
@@ -49125,6 +49125,8 @@ ${codeText}
49125
49125
  }
49126
49126
  function resetScrollbarCore(scrollCore, scrollWrap) {
49127
49127
  const scrollContainer = getScrollContainer(scrollWrap);
49128
+ if (!scrollContainer || !getContainerOption(scrollCore, getContainer(scrollContainer)))
49129
+ return;
49128
49130
  const scrollbarContainer = getScrollbarContainer(scrollContainer);
49129
49131
  const { scrollWidth, clientWidth } = getElementScrollSize(scrollContainer);
49130
49132
  const { paddingLeft, paddingRight } = getScrollWrapPaddingSize(scrollWrap);
@@ -49141,7 +49143,7 @@ ${codeText}
49141
49143
  }
49142
49144
  function debounceByArgs(func, wait) {
49143
49145
  const debouncers = /* @__PURE__ */ new Map();
49144
- return function(...args) {
49146
+ const debounced = function(...args) {
49145
49147
  var _a;
49146
49148
  const scrollWrap = args[1];
49147
49149
  let key = (scrollWrap == null ? void 0 : scrollWrap.genId) || "";
@@ -49153,17 +49155,30 @@ ${codeText}
49153
49155
  if (!debouncers.has(key)) {
49154
49156
  debouncers.set(key, debounce__default.default(
49155
49157
  (...innerArgs) => {
49156
- const result = func.apply(this, innerArgs);
49157
- if (scrollWrap)
49158
- scrollWrap.genId = void 0;
49159
- debouncers.delete(key);
49160
- return result;
49158
+ try {
49159
+ return func.apply(this, innerArgs);
49160
+ } finally {
49161
+ if (scrollWrap)
49162
+ scrollWrap.genId = void 0;
49163
+ debouncers.delete(key);
49164
+ }
49161
49165
  },
49162
49166
  wait
49163
49167
  ));
49164
49168
  }
49165
49169
  return (_a = debouncers.get(key)) == null ? void 0 : _a.apply(this, args);
49166
49170
  };
49171
+ debounced.cancel = (scrollWrap) => {
49172
+ var _a, _b;
49173
+ const target = scrollWrap;
49174
+ const key = target.genId;
49175
+ if (!key)
49176
+ return;
49177
+ (_b = (_a = debouncers.get(key)) == null ? void 0 : _a.cancel) == null ? void 0 : _b.call(_a);
49178
+ debouncers.delete(key);
49179
+ target.genId = void 0;
49180
+ };
49181
+ return debounced;
49167
49182
  }
49168
49183
  const resetScrollbar = debounceByArgs(resetScrollbarCore, 50);
49169
49184
  function resetScrollbarLeft(scrollContainer, scrollbarContainer) {
@@ -49658,6 +49673,7 @@ ${codeText}
49658
49673
  }
49659
49674
  unbindCore(scrollContainer, scrollWrap) {
49660
49675
  var _a, _b, _c, _d, _e, _f;
49676
+ resetScrollbar.cancel(scrollWrap);
49661
49677
  if (!this.boundContainers.delete(scrollContainer))
49662
49678
  return;
49663
49679
  const scrollbarContainer = getScrollbarContainer(scrollContainer);
@@ -74512,10 +74528,11 @@ ${codeText}
74512
74528
  createTableBorderBar(editor, tableBlock);
74513
74529
  }
74514
74530
  function hideTableBorderBar(editor, tableBlock) {
74531
+ var _a, _b;
74515
74532
  assert(logger$14, isTableBlock(tableBlock), "invalid table block");
74516
- const tools = getTableTools(editor, tableBlock);
74533
+ const tools = (_a = getBlockContent(tableBlock).querySelector("div[data-type=table-content]")) == null ? void 0 : _a.querySelector(":scope >div[data-type=table-tools]");
74517
74534
  const blockTools = getBlockTools(tableBlock);
74518
- const topTableBorderBar = tools.querySelectorAll(".table-border-bar-container");
74535
+ const topTableBorderBar = (_b = tools == null ? void 0 : tools.querySelectorAll(".table-border-bar-container")) != null ? _b : [];
74519
74536
  const leftTableBorderBar = blockTools.querySelectorAll(".table-border-bar-container");
74520
74537
  topTableBorderBar.forEach((elem) => {
74521
74538
  editor.domEvents.removeEventListener(elem, "click", handleBorderBarClicked);
@@ -98373,7 +98390,7 @@ ${JSON.stringify(error2, null, 2)}`);
98373
98390
  }
98374
98391
  }
98375
98392
  });
98376
- editor.version = "5.0.8-beta.h1475.3";
98393
+ editor.version = "5.0.8-beta.h1475.4";
98377
98394
  return editor;
98378
98395
  }
98379
98396
  function isDoc(doc2) {
@@ -98509,7 +98526,7 @@ ${JSON.stringify(error2, null, 2)}`);
98509
98526
  OnesEditorDropTarget.register(editor);
98510
98527
  OnesEditorTocProvider.register(editor);
98511
98528
  OnesEditorExclusiveBlock.register(editor);
98512
- editor.version = "5.0.8-beta.h1475.3";
98529
+ editor.version = "5.0.8-beta.h1475.4";
98513
98530
  return editor;
98514
98531
  } catch (error2) {
98515
98532
  try {
@@ -98652,7 +98669,7 @@ ${JSON.stringify(error2, null, 2)}`);
98652
98669
  }
98653
98670
  }
98654
98671
  });
98655
- editor.version = "5.0.8-beta.h1475.3";
98672
+ editor.version = "5.0.8-beta.h1475.4";
98656
98673
  return editor;
98657
98674
  }
98658
98675
  const emojis$1 = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "5.0.8-beta.h1475.3",
3
+ "version": "5.0.8-beta.h1475.4",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {