@ones-editor/editor 3.1.7-beta.h1473.3 → 3.1.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
|
@@ -48837,6 +48837,8 @@ ${codeText}
|
|
|
48837
48837
|
}
|
|
48838
48838
|
function resetScrollbarCore(scrollCore, scrollWrap) {
|
|
48839
48839
|
const scrollContainer = getScrollContainer(scrollWrap);
|
|
48840
|
+
if (!scrollContainer || !getContainerOption(scrollCore, getContainer(scrollContainer)))
|
|
48841
|
+
return;
|
|
48840
48842
|
const scrollbarContainer = getScrollbarContainer(scrollContainer);
|
|
48841
48843
|
const { scrollWidth, clientWidth } = getElementScrollSize(scrollContainer);
|
|
48842
48844
|
const { paddingLeft, paddingRight } = getScrollWrapPaddingSize(scrollWrap);
|
|
@@ -48853,7 +48855,7 @@ ${codeText}
|
|
|
48853
48855
|
}
|
|
48854
48856
|
function debounceByArgs(func, wait) {
|
|
48855
48857
|
const debouncers = /* @__PURE__ */ new Map();
|
|
48856
|
-
|
|
48858
|
+
const debounced = function(...args) {
|
|
48857
48859
|
var _a;
|
|
48858
48860
|
const scrollWrap = args[1];
|
|
48859
48861
|
let key = (scrollWrap == null ? void 0 : scrollWrap.genId) || "";
|
|
@@ -48865,17 +48867,30 @@ ${codeText}
|
|
|
48865
48867
|
if (!debouncers.has(key)) {
|
|
48866
48868
|
debouncers.set(key, debounce__default.default(
|
|
48867
48869
|
(...innerArgs) => {
|
|
48868
|
-
|
|
48869
|
-
|
|
48870
|
-
|
|
48871
|
-
|
|
48872
|
-
|
|
48870
|
+
try {
|
|
48871
|
+
return func.apply(this, innerArgs);
|
|
48872
|
+
} finally {
|
|
48873
|
+
if (scrollWrap)
|
|
48874
|
+
scrollWrap.genId = void 0;
|
|
48875
|
+
debouncers.delete(key);
|
|
48876
|
+
}
|
|
48873
48877
|
},
|
|
48874
48878
|
wait
|
|
48875
48879
|
));
|
|
48876
48880
|
}
|
|
48877
48881
|
return (_a = debouncers.get(key)) == null ? void 0 : _a.apply(this, args);
|
|
48878
48882
|
};
|
|
48883
|
+
debounced.cancel = (scrollWrap) => {
|
|
48884
|
+
var _a, _b;
|
|
48885
|
+
const target = scrollWrap;
|
|
48886
|
+
const key = target.genId;
|
|
48887
|
+
if (!key)
|
|
48888
|
+
return;
|
|
48889
|
+
(_b = (_a = debouncers.get(key)) == null ? void 0 : _a.cancel) == null ? void 0 : _b.call(_a);
|
|
48890
|
+
debouncers.delete(key);
|
|
48891
|
+
target.genId = void 0;
|
|
48892
|
+
};
|
|
48893
|
+
return debounced;
|
|
48879
48894
|
}
|
|
48880
48895
|
const resetScrollbar = debounceByArgs(resetScrollbarCore, 50);
|
|
48881
48896
|
function resetScrollbarLeft(scrollContainer, scrollbarContainer) {
|
|
@@ -49370,6 +49385,7 @@ ${codeText}
|
|
|
49370
49385
|
}
|
|
49371
49386
|
unbindCore(scrollContainer, scrollWrap) {
|
|
49372
49387
|
var _a, _b, _c, _d, _e, _f;
|
|
49388
|
+
resetScrollbar.cancel(scrollWrap);
|
|
49373
49389
|
if (!this.boundContainers.delete(scrollContainer))
|
|
49374
49390
|
return;
|
|
49375
49391
|
const scrollbarContainer = getScrollbarContainer(scrollContainer);
|
|
@@ -74118,10 +74134,11 @@ ${codeText}
|
|
|
74118
74134
|
createTableBorderBar(editor, tableBlock);
|
|
74119
74135
|
}
|
|
74120
74136
|
function hideTableBorderBar(editor, tableBlock) {
|
|
74137
|
+
var _a, _b;
|
|
74121
74138
|
assert(logger$14, isTableBlock(tableBlock), "invalid table block");
|
|
74122
|
-
const tools =
|
|
74139
|
+
const tools = (_a = getBlockContent(tableBlock).querySelector("div[data-type=table-content]")) == null ? void 0 : _a.querySelector(":scope >div[data-type=table-tools]");
|
|
74123
74140
|
const blockTools = getBlockTools(tableBlock);
|
|
74124
|
-
const topTableBorderBar = tools.querySelectorAll(".table-border-bar-container");
|
|
74141
|
+
const topTableBorderBar = (_b = tools == null ? void 0 : tools.querySelectorAll(".table-border-bar-container")) != null ? _b : [];
|
|
74125
74142
|
const leftTableBorderBar = blockTools.querySelectorAll(".table-border-bar-container");
|
|
74126
74143
|
topTableBorderBar.forEach((elem) => {
|
|
74127
74144
|
editor.domEvents.removeEventListener(elem, "click", handleBorderBarClicked);
|
|
@@ -97716,7 +97733,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
97716
97733
|
}
|
|
97717
97734
|
}
|
|
97718
97735
|
});
|
|
97719
|
-
editor.version = "3.1.7
|
|
97736
|
+
editor.version = "3.1.7";
|
|
97720
97737
|
return editor;
|
|
97721
97738
|
}
|
|
97722
97739
|
function isDoc(doc2) {
|
|
@@ -97857,7 +97874,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
97857
97874
|
OnesEditorDropTarget.register(editor);
|
|
97858
97875
|
OnesEditorTocProvider.register(editor);
|
|
97859
97876
|
OnesEditorExclusiveBlock.register(editor);
|
|
97860
|
-
editor.version = "3.1.7
|
|
97877
|
+
editor.version = "3.1.7";
|
|
97861
97878
|
return editor;
|
|
97862
97879
|
} catch (error2) {
|
|
97863
97880
|
if (editorForCleanup) {
|