@ones-editor/editor 2.2.27 → 2.2.28
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
|
@@ -45895,7 +45895,7 @@ ${codeText}
|
|
|
45895
45895
|
}
|
|
45896
45896
|
function getSizeAsScale(element, num) {
|
|
45897
45897
|
const scale = getElementScale(element);
|
|
45898
|
-
return num / scale;
|
|
45898
|
+
return Math.round(num / scale);
|
|
45899
45899
|
}
|
|
45900
45900
|
function getScrollWrapPaddingSize(scrollWrap) {
|
|
45901
45901
|
const computedStyle = window.getComputedStyle(scrollWrap);
|
|
@@ -45980,7 +45980,7 @@ ${codeText}
|
|
|
45980
45980
|
}
|
|
45981
45981
|
return scrollbarContainer;
|
|
45982
45982
|
}
|
|
45983
|
-
function
|
|
45983
|
+
function resetScrollbarCore(scrollCore, scrollWrap) {
|
|
45984
45984
|
const scrollContainer = getScrollContainer(scrollWrap);
|
|
45985
45985
|
const scrollbarContainer = getScrollbarContainer(scrollContainer);
|
|
45986
45986
|
const { scrollWidth, clientWidth } = getElementScrollSize(scrollContainer);
|
|
@@ -45991,9 +45991,12 @@ ${codeText}
|
|
|
45991
45991
|
fixScrollWrapLeftBoundary(scrollCore, scrollContainer);
|
|
45992
45992
|
const overflowWidth = scrollWidth - clientWidth;
|
|
45993
45993
|
assert(logger$2h, scrollbarContainer.firstElementChild instanceof HTMLDivElement, "invalid child for scroll bar");
|
|
45994
|
-
|
|
45995
|
-
scrollbarContainer.
|
|
45994
|
+
const width = getSizeAsScale(scrollContainer, originWidth + maxRight - paddingLeft - paddingRight);
|
|
45995
|
+
scrollbarContainer.style.width = `${width}px`;
|
|
45996
|
+
const childWidth = getSizeAsScale(scrollContainer, originWidth + maxRight + overflowWidth - paddingLeft - paddingRight);
|
|
45997
|
+
scrollbarContainer.firstElementChild.style.width = `${childWidth}px`;
|
|
45996
45998
|
}
|
|
45999
|
+
const resetScrollbar = debounce__default.default(resetScrollbarCore, 50);
|
|
45997
46000
|
function resetScrollbarLeft(scrollContainer, scrollbarContainer) {
|
|
45998
46001
|
const scrollWrap = getContainerScrollArea(scrollContainer);
|
|
45999
46002
|
const { paddingLeft } = getScrollWrapPaddingSize(scrollWrap);
|
|
@@ -46169,6 +46172,7 @@ ${codeText}
|
|
|
46169
46172
|
class ContainerResizeObserver {
|
|
46170
46173
|
constructor(scrollCore, callback) {
|
|
46171
46174
|
__publicField(this, "resizeObserver");
|
|
46175
|
+
__publicField(this, "lastWidth", 0);
|
|
46172
46176
|
__publicField(this, "handleResizeEntry", (entry) => {
|
|
46173
46177
|
const scrollContainer = entry.target;
|
|
46174
46178
|
const scrollWrap = getContainerScrollArea(scrollContainer);
|
|
@@ -46178,6 +46182,11 @@ ${codeText}
|
|
|
46178
46182
|
this.callback(scrollContainer);
|
|
46179
46183
|
});
|
|
46180
46184
|
__publicField(this, "handleContentResize", (entries) => {
|
|
46185
|
+
const width = Math.round(entries[0].contentRect.width);
|
|
46186
|
+
if (width === this.lastWidth) {
|
|
46187
|
+
return;
|
|
46188
|
+
}
|
|
46189
|
+
this.lastWidth = width;
|
|
46181
46190
|
entries.forEach((entry) => {
|
|
46182
46191
|
const container = this.containers.get(getContainer(entry.target));
|
|
46183
46192
|
if (container) {
|
|
@@ -88668,7 +88677,7 @@ ${data2.flowchartText}
|
|
|
88668
88677
|
}
|
|
88669
88678
|
}
|
|
88670
88679
|
});
|
|
88671
|
-
editor.version = "2.2.
|
|
88680
|
+
editor.version = "2.2.28";
|
|
88672
88681
|
return editor;
|
|
88673
88682
|
}
|
|
88674
88683
|
function isDoc(doc2) {
|
|
@@ -88763,7 +88772,7 @@ ${data2.flowchartText}
|
|
|
88763
88772
|
});
|
|
88764
88773
|
editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
|
|
88765
88774
|
OnesEditorToolbar.register(editor);
|
|
88766
|
-
editor.version = "2.2.
|
|
88775
|
+
editor.version = "2.2.28";
|
|
88767
88776
|
return editor;
|
|
88768
88777
|
}
|
|
88769
88778
|
async function showDocVersions(editor, options, serverUrl) {
|