@ones-editor/editor 3.1.7-beta.ONES22303310.2 → 3.1.7-beta.ONES22303310.3

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
@@ -48638,6 +48638,8 @@ ${codeText}
48638
48638
  }
48639
48639
  function resetScrollbarCore(scrollCore, scrollWrap) {
48640
48640
  const scrollContainer = getScrollContainer(scrollWrap);
48641
+ if (!scrollContainer || !getContainerOption(scrollCore, getContainer(scrollContainer)))
48642
+ return;
48641
48643
  const scrollbarContainer = getScrollbarContainer(scrollContainer);
48642
48644
  const { scrollWidth, clientWidth } = getElementScrollSize(scrollContainer);
48643
48645
  const { paddingLeft, paddingRight } = getScrollWrapPaddingSize(scrollWrap);
@@ -48654,7 +48656,7 @@ ${codeText}
48654
48656
  }
48655
48657
  function debounceByArgs(func, wait) {
48656
48658
  const debouncers = /* @__PURE__ */ new Map();
48657
- return function(...args) {
48659
+ const debounced = function(...args) {
48658
48660
  var _a;
48659
48661
  const scrollWrap = args[1];
48660
48662
  let key = (scrollWrap == null ? void 0 : scrollWrap.genId) || "";
@@ -48666,17 +48668,30 @@ ${codeText}
48666
48668
  if (!debouncers.has(key)) {
48667
48669
  debouncers.set(key, debounce__default.default(
48668
48670
  (...innerArgs) => {
48669
- const result = func.apply(this, innerArgs);
48670
- if (scrollWrap)
48671
- scrollWrap.genId = void 0;
48672
- debouncers.delete(key);
48673
- return result;
48671
+ try {
48672
+ return func.apply(this, innerArgs);
48673
+ } finally {
48674
+ if (scrollWrap)
48675
+ scrollWrap.genId = void 0;
48676
+ debouncers.delete(key);
48677
+ }
48674
48678
  },
48675
48679
  wait
48676
48680
  ));
48677
48681
  }
48678
48682
  return (_a = debouncers.get(key)) == null ? void 0 : _a.apply(this, args);
48679
48683
  };
48684
+ debounced.cancel = (scrollWrap) => {
48685
+ var _a, _b;
48686
+ const target = scrollWrap;
48687
+ const key = target.genId;
48688
+ if (!key)
48689
+ return;
48690
+ (_b = (_a = debouncers.get(key)) == null ? void 0 : _a.cancel) == null ? void 0 : _b.call(_a);
48691
+ debouncers.delete(key);
48692
+ target.genId = void 0;
48693
+ };
48694
+ return debounced;
48680
48695
  }
48681
48696
  const resetScrollbar = debounceByArgs(resetScrollbarCore, 50);
48682
48697
  function resetScrollbarLeft(scrollContainer, scrollbarContainer) {
@@ -49171,6 +49186,7 @@ ${codeText}
49171
49186
  }
49172
49187
  unbindCore(scrollContainer, scrollWrap) {
49173
49188
  var _a, _b, _c, _d, _e, _f;
49189
+ resetScrollbar.cancel(scrollWrap);
49174
49190
  if (!this.boundContainers.delete(scrollContainer))
49175
49191
  return;
49176
49192
  const scrollbarContainer = getScrollbarContainer(scrollContainer);
@@ -97388,7 +97404,7 @@ ${JSON.stringify(error2, null, 2)}`);
97388
97404
  }
97389
97405
  }
97390
97406
  });
97391
- editor.version = "3.1.7-beta.ONES22303310.2";
97407
+ editor.version = "3.1.7-beta.ONES22303310.3";
97392
97408
  return editor;
97393
97409
  }
97394
97410
  function isDoc(doc2) {
@@ -97529,7 +97545,7 @@ ${JSON.stringify(error2, null, 2)}`);
97529
97545
  OnesEditorDropTarget.register(editor);
97530
97546
  OnesEditorTocProvider.register(editor);
97531
97547
  OnesEditorExclusiveBlock.register(editor);
97532
- editor.version = "3.1.7-beta.ONES22303310.2";
97548
+ editor.version = "3.1.7-beta.ONES22303310.3";
97533
97549
  return editor;
97534
97550
  } catch (error2) {
97535
97551
  if (editorForCleanup) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "3.1.7-beta.ONES22303310.2",
3
+ "version": "3.1.7-beta.ONES22303310.3",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {