@ckeditor/ckeditor5-utils 48.5.2 → 48.5.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 +20 -13
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -916,8 +916,8 @@ function formatConsoleArguments(errorName, data) {
|
|
|
916
916
|
/**
|
|
917
917
|
* @module utils/version
|
|
918
918
|
*/
|
|
919
|
-
const version = "48.5.
|
|
920
|
-
const releaseDate = new Date(2026,
|
|
919
|
+
const version = "48.5.3";
|
|
920
|
+
const releaseDate = new Date(2026, 9, 27);
|
|
921
921
|
/* v8 ignore next -- @preserve */
|
|
922
922
|
if (globalThis.CKEDITOR_VERSION)
|
|
923
923
|
/**
|
|
@@ -1135,8 +1135,10 @@ function EmitterMixin(base) {
|
|
|
1135
1135
|
if (!emitters || emitter && !emitterInfo || event && !eventCallbacks) return;
|
|
1136
1136
|
if (callback) {
|
|
1137
1137
|
removeEventListener(this, emitter, event, callback);
|
|
1138
|
-
if (eventCallbacks.indexOf(callback) !== -1)
|
|
1139
|
-
|
|
1138
|
+
if (eventCallbacks.indexOf(callback) !== -1) {
|
|
1139
|
+
if (eventCallbacks.length === 1) delete emitterInfo.callbacks[event];
|
|
1140
|
+
else removeEventListener(this, emitter, event, callback);
|
|
1141
|
+
}
|
|
1140
1142
|
} else if (eventCallbacks) {
|
|
1141
1143
|
while (callback = eventCallbacks.pop()) removeEventListener(this, emitter, event, callback);
|
|
1142
1144
|
delete emitterInfo.callbacks[event];
|
|
@@ -2614,11 +2616,12 @@ var Rect = class Rect {
|
|
|
2614
2616
|
writable: true,
|
|
2615
2617
|
enumerable: false
|
|
2616
2618
|
});
|
|
2617
|
-
if (isDomElement(source) || isSourceRange)
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2619
|
+
if (isDomElement(source) || isSourceRange) {
|
|
2620
|
+
if (isSourceRange) {
|
|
2621
|
+
const rangeRects = Rect.getDomRangeRects(source);
|
|
2622
|
+
copyRectProperties(this, Rect.getBoundingRect(rangeRects));
|
|
2623
|
+
} else copyRectProperties(this, source.getBoundingClientRect());
|
|
2624
|
+
} else if (isWindow(source)) {
|
|
2622
2625
|
const { innerWidth, innerHeight } = source;
|
|
2623
2626
|
copyRectProperties(this, {
|
|
2624
2627
|
top: 0,
|
|
@@ -3652,8 +3655,10 @@ function scrollWindowToShowRect({ window, rect, alignToTop, forceScroll, viewpor
|
|
|
3652
3655
|
if (forceScrollToTop) scrollY -= viewportRect.top - rect.top + viewportOffset.top;
|
|
3653
3656
|
else if (!allRectsFitInViewport) {
|
|
3654
3657
|
if (isAbove(targetShiftedUpRect, viewportRect)) scrollY -= viewportRect.top - rect.top + viewportOffset.top;
|
|
3655
|
-
else if (isBelow(targetShiftedDownRect, viewportRect))
|
|
3656
|
-
|
|
3658
|
+
else if (isBelow(targetShiftedDownRect, viewportRect)) {
|
|
3659
|
+
if (alignToTop) scrollY += rect.top - viewportRect.top - viewportOffset.top;
|
|
3660
|
+
else scrollY += rect.bottom - viewportRect.bottom + viewportOffset.bottom;
|
|
3661
|
+
}
|
|
3657
3662
|
}
|
|
3658
3663
|
if (!allRectsFitInViewport) {
|
|
3659
3664
|
if (isLeftOf(rect, viewportRect)) scrollX -= viewportRect.left - rect.left + viewportOffset.left;
|
|
@@ -3690,8 +3695,10 @@ function scrollAncestorsToShowRect({ parent, getRect, alignToTop, forceScroll, a
|
|
|
3690
3695
|
if (forceScrollToTop) parent.scrollTop -= parentRect.top - targetRect.top + ancestorOffset;
|
|
3691
3696
|
else if (!targetFitsInTarget) {
|
|
3692
3697
|
if (isAbove(targetRect, parentRect)) parent.scrollTop -= parentRect.top - targetRect.top + ancestorOffset;
|
|
3693
|
-
else if (isBelow(targetRect, parentRect))
|
|
3694
|
-
|
|
3698
|
+
else if (isBelow(targetRect, parentRect)) {
|
|
3699
|
+
if (alignToTop) parent.scrollTop += targetRect.top - parentRect.top - ancestorOffset;
|
|
3700
|
+
else parent.scrollTop += targetRect.bottom - parentRect.bottom + ancestorOffset;
|
|
3701
|
+
}
|
|
3695
3702
|
}
|
|
3696
3703
|
if (!targetFitsInTarget) {
|
|
3697
3704
|
if (isLeftOf(targetRect, parentRect)) parent.scrollLeft -= parentRect.left - targetRect.left + ancestorOffset;
|