@ones-editor/editor 2.8.16 → 2.8.17-beta.1
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
|
@@ -47441,7 +47441,7 @@ ${codeText}
|
|
|
47441
47441
|
}
|
|
47442
47442
|
function getSizeAsScale(element, num) {
|
|
47443
47443
|
const scale = getElementScale(element);
|
|
47444
|
-
return num / scale;
|
|
47444
|
+
return Math.round(num / scale);
|
|
47445
47445
|
}
|
|
47446
47446
|
function getScrollWrapPaddingSize(scrollWrap) {
|
|
47447
47447
|
const computedStyle = window.getComputedStyle(scrollWrap);
|
|
@@ -47526,7 +47526,7 @@ ${codeText}
|
|
|
47526
47526
|
}
|
|
47527
47527
|
return scrollbarContainer;
|
|
47528
47528
|
}
|
|
47529
|
-
function
|
|
47529
|
+
function resetScrollbarCore(scrollCore, scrollWrap) {
|
|
47530
47530
|
const scrollContainer = getScrollContainer(scrollWrap);
|
|
47531
47531
|
const scrollbarContainer = getScrollbarContainer(scrollContainer);
|
|
47532
47532
|
const { scrollWidth, clientWidth } = getElementScrollSize(scrollContainer);
|
|
@@ -47537,9 +47537,12 @@ ${codeText}
|
|
|
47537
47537
|
fixScrollWrapLeftBoundary(scrollCore, scrollContainer);
|
|
47538
47538
|
const overflowWidth = scrollWidth - clientWidth;
|
|
47539
47539
|
assert(logger$2l, scrollbarContainer.firstElementChild instanceof HTMLDivElement, "invalid child for scroll bar");
|
|
47540
|
-
|
|
47541
|
-
scrollbarContainer.
|
|
47540
|
+
const width = getSizeAsScale(scrollContainer, originWidth + maxRight - paddingLeft - paddingRight);
|
|
47541
|
+
scrollbarContainer.style.width = `${width}px`;
|
|
47542
|
+
const childWidth = getSizeAsScale(scrollContainer, originWidth + maxRight + overflowWidth - paddingLeft - paddingRight);
|
|
47543
|
+
scrollbarContainer.firstElementChild.style.width = `${childWidth}px`;
|
|
47542
47544
|
}
|
|
47545
|
+
const resetScrollbar = debounce__default.default(resetScrollbarCore, 50);
|
|
47543
47546
|
function resetScrollbarLeft(scrollContainer, scrollbarContainer) {
|
|
47544
47547
|
const scrollWrap = getContainerScrollArea(scrollContainer);
|
|
47545
47548
|
const { paddingLeft } = getScrollWrapPaddingSize(scrollWrap);
|
|
@@ -47715,6 +47718,7 @@ ${codeText}
|
|
|
47715
47718
|
class ContainerResizeObserver {
|
|
47716
47719
|
constructor(scrollCore, callback) {
|
|
47717
47720
|
__publicField(this, "resizeObserver");
|
|
47721
|
+
__publicField(this, "lastWidth", 0);
|
|
47718
47722
|
__publicField(this, "handleResizeEntry", (entry) => {
|
|
47719
47723
|
const scrollContainer = entry.target;
|
|
47720
47724
|
const scrollWrap = getContainerScrollArea(scrollContainer);
|
|
@@ -47724,6 +47728,11 @@ ${codeText}
|
|
|
47724
47728
|
this.callback(scrollContainer);
|
|
47725
47729
|
});
|
|
47726
47730
|
__publicField(this, "handleContentResize", (entries) => {
|
|
47731
|
+
const width = Math.round(entries[0].contentRect.width);
|
|
47732
|
+
if (width === this.lastWidth) {
|
|
47733
|
+
return;
|
|
47734
|
+
}
|
|
47735
|
+
this.lastWidth = width;
|
|
47727
47736
|
entries.forEach((entry) => {
|
|
47728
47737
|
const container = this.containers.get(getContainer(entry.target));
|
|
47729
47738
|
if (container) {
|
|
@@ -92975,7 +92984,7 @@ ${data2.plantumlText}
|
|
|
92975
92984
|
}
|
|
92976
92985
|
}
|
|
92977
92986
|
});
|
|
92978
|
-
editor.version = "2.8.
|
|
92987
|
+
editor.version = "2.8.17-beta.1";
|
|
92979
92988
|
return editor;
|
|
92980
92989
|
}
|
|
92981
92990
|
function isDoc(doc2) {
|
|
@@ -93088,7 +93097,7 @@ ${data2.plantumlText}
|
|
|
93088
93097
|
}
|
|
93089
93098
|
});
|
|
93090
93099
|
OnesEditorToolbar.register(editor);
|
|
93091
|
-
editor.version = "2.8.
|
|
93100
|
+
editor.version = "2.8.17-beta.1";
|
|
93092
93101
|
return editor;
|
|
93093
93102
|
}
|
|
93094
93103
|
async function showDocVersions(editor, options, serverUrl) {
|