mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-23 11:50:36 +03:00
build an add optimize terser compress
This commit is contained in:
@@ -1176,7 +1176,7 @@ const createTrinsicLifecycle = (lifecycleHub) => {
|
|||||||
const createPaddingLifecycle = (lifecycleHub) => {
|
const createPaddingLifecycle = (lifecycleHub) => {
|
||||||
const { _structureSetup, _setLifecycleCommunication } = lifecycleHub;
|
const { _structureSetup, _setLifecycleCommunication } = lifecycleHub;
|
||||||
const { _host, _padding, _viewport } = _structureSetup._targetObj;
|
const { _host, _padding, _viewport } = _structureSetup._targetObj;
|
||||||
const { _update: updatePaddingCache, _current: currentPaddingCache } = createCache(() => topRightBottomLeft(_host, 'padding'), {
|
const { _update: updatePaddingCache, _current: currentPaddingCache } = createCache(topRightBottomLeft.bind(0, _host, 'padding'), {
|
||||||
_equal: equalTRBL,
|
_equal: equalTRBL,
|
||||||
_initialValue: topRightBottomLeft(),
|
_initialValue: topRightBottomLeft(),
|
||||||
});
|
});
|
||||||
@@ -1275,11 +1275,11 @@ const createOverflowLifecycle = (lifecycleHub) => {
|
|||||||
const { _structureSetup, _doViewportArrange, _getLifecycleCommunication, _setLifecycleCommunication } = lifecycleHub;
|
const { _structureSetup, _doViewportArrange, _getLifecycleCommunication, _setLifecycleCommunication } = lifecycleHub;
|
||||||
const { _host, _viewport, _viewportArrange } = _structureSetup._targetObj;
|
const { _host, _viewport, _viewportArrange } = _structureSetup._targetObj;
|
||||||
const { _update: updateViewportSizeFraction, _current: getCurrentViewportSizeFraction } = createCache(
|
const { _update: updateViewportSizeFraction, _current: getCurrentViewportSizeFraction } = createCache(
|
||||||
() => sizeFraction(_viewport),
|
sizeFraction.bind(0, _viewport),
|
||||||
whCacheOptions
|
whCacheOptions
|
||||||
);
|
);
|
||||||
const { _update: updateViewportScrollSizeCache, _current: getCurrentViewportScrollSizeCache } = createCache(
|
const { _update: updateViewportScrollSizeCache, _current: getCurrentViewportScrollSizeCache } = createCache(
|
||||||
() => scrollSize(_viewport),
|
scrollSize.bind(0, _viewport),
|
||||||
whCacheOptions
|
whCacheOptions
|
||||||
);
|
);
|
||||||
const { _update: updateOverflowAmountCache, _current: getCurrentOverflowAmountCache } = createCache(
|
const { _update: updateOverflowAmountCache, _current: getCurrentOverflowAmountCache } = createCache(
|
||||||
@@ -1302,9 +1302,9 @@ const createOverflowLifecycle = (lifecycleHub) => {
|
|||||||
const hostSizeFraction = sizeFraction(_host);
|
const hostSizeFraction = sizeFraction(_host);
|
||||||
const hostClientSize = clientSize(_host);
|
const hostClientSize = clientSize(_host);
|
||||||
const paddingVertical = paddingAbsolute || style(_viewport, 'boxSizing') === 'content-box' ? padding.b + padding.t : 0;
|
const paddingVertical = paddingAbsolute || style(_viewport, 'boxSizing') === 'content-box' ? padding.b + padding.t : 0;
|
||||||
const fractionalcleintHeight = hostClientSize.h + (abs$1(hostSizeFraction.h) < 1 ? hostSizeFraction.h : 0);
|
const fractionalClientHeight = hostClientSize.h + (abs$1(hostSizeFraction.h) < 1 ? hostSizeFraction.h : 0);
|
||||||
style(_viewport, {
|
style(_viewport, {
|
||||||
height: fractionalcleintHeight + (_overflowScroll.x ? _scrollbarsHideOffset.x : 0) - paddingVertical,
|
height: fractionalClientHeight + (_overflowScroll.x ? _scrollbarsHideOffset.x : 0) - paddingVertical,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1630,7 +1630,7 @@ const createSizeObserver = (target, onSizeChangedCallback, options) => {
|
|||||||
const shrinkElement = observerElementChildrenRoot.lastChild;
|
const shrinkElement = observerElementChildrenRoot.lastChild;
|
||||||
const expandElement = observerElementChildrenRoot.firstChild;
|
const expandElement = observerElementChildrenRoot.firstChild;
|
||||||
const expandElementChild = expandElement == null ? void 0 : expandElement.firstChild;
|
const expandElementChild = expandElement == null ? void 0 : expandElement.firstChild;
|
||||||
let cacheSize = offsetSize(listenerElement);
|
let cacheSize = offsetSize(observerElementChildrenRoot);
|
||||||
let currSize = cacheSize;
|
let currSize = cacheSize;
|
||||||
let isDirty = false;
|
let isDirty = false;
|
||||||
let rAFId;
|
let rAFId;
|
||||||
@@ -1652,7 +1652,7 @@ const createSizeObserver = (target, onSizeChangedCallback, options) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onScroll = (scrollEvent) => {
|
const onScroll = (scrollEvent) => {
|
||||||
currSize = offsetSize(listenerElement);
|
currSize = offsetSize(observerElementChildrenRoot);
|
||||||
isDirty = !scrollEvent || !equalWH(currSize, cacheSize);
|
isDirty = !scrollEvent || !equalWH(currSize, cacheSize);
|
||||||
|
|
||||||
if (scrollEvent) {
|
if (scrollEvent) {
|
||||||
@@ -1679,7 +1679,7 @@ const createSizeObserver = (target, onSizeChangedCallback, options) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (observeDirectionChange) {
|
if (observeDirectionChange) {
|
||||||
directionIsRTLCache = createCache(() => directionIsRTL(sizeObserver));
|
directionIsRTLCache = createCache(directionIsRTL.bind(0, sizeObserver));
|
||||||
const { _update: updateDirectionIsRTLCache } = directionIsRTLCache;
|
const { _update: updateDirectionIsRTLCache } = directionIsRTLCache;
|
||||||
push(
|
push(
|
||||||
offListeners,
|
offListeners,
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+11
-22
@@ -1293,15 +1293,10 @@
|
|||||||
_padding = _structureSetup$_targ._padding,
|
_padding = _structureSetup$_targ._padding,
|
||||||
_viewport = _structureSetup$_targ._viewport;
|
_viewport = _structureSetup$_targ._viewport;
|
||||||
|
|
||||||
var _createCache = createCache(
|
var _createCache = createCache(topRightBottomLeft.bind(0, _host, 'padding'), {
|
||||||
function () {
|
_equal: equalTRBL,
|
||||||
return topRightBottomLeft(_host, 'padding');
|
_initialValue: topRightBottomLeft(),
|
||||||
},
|
}),
|
||||||
{
|
|
||||||
_equal: equalTRBL,
|
|
||||||
_initialValue: topRightBottomLeft(),
|
|
||||||
}
|
|
||||||
),
|
|
||||||
updatePaddingCache = _createCache._update,
|
updatePaddingCache = _createCache._update,
|
||||||
currentPaddingCache = _createCache._current;
|
currentPaddingCache = _createCache._current;
|
||||||
|
|
||||||
@@ -1424,15 +1419,11 @@
|
|||||||
_viewport = _structureSetup$_targ._viewport,
|
_viewport = _structureSetup$_targ._viewport,
|
||||||
_viewportArrange = _structureSetup$_targ._viewportArrange;
|
_viewportArrange = _structureSetup$_targ._viewportArrange;
|
||||||
|
|
||||||
var _createCache = createCache(function () {
|
var _createCache = createCache(sizeFraction.bind(0, _viewport), whCacheOptions),
|
||||||
return sizeFraction(_viewport);
|
|
||||||
}, whCacheOptions),
|
|
||||||
updateViewportSizeFraction = _createCache._update,
|
updateViewportSizeFraction = _createCache._update,
|
||||||
getCurrentViewportSizeFraction = _createCache._current;
|
getCurrentViewportSizeFraction = _createCache._current;
|
||||||
|
|
||||||
var _createCache2 = createCache(function () {
|
var _createCache2 = createCache(scrollSize.bind(0, _viewport), whCacheOptions),
|
||||||
return scrollSize(_viewport);
|
|
||||||
}, whCacheOptions),
|
|
||||||
updateViewportScrollSizeCache = _createCache2._update,
|
updateViewportScrollSizeCache = _createCache2._update,
|
||||||
getCurrentViewportScrollSizeCache = _createCache2._current;
|
getCurrentViewportScrollSizeCache = _createCache2._current;
|
||||||
|
|
||||||
@@ -1463,9 +1454,9 @@
|
|||||||
var hostSizeFraction = sizeFraction(_host);
|
var hostSizeFraction = sizeFraction(_host);
|
||||||
var hostClientSize = clientSize(_host);
|
var hostClientSize = clientSize(_host);
|
||||||
var paddingVertical = paddingAbsolute || style(_viewport, 'boxSizing') === 'content-box' ? padding.b + padding.t : 0;
|
var paddingVertical = paddingAbsolute || style(_viewport, 'boxSizing') === 'content-box' ? padding.b + padding.t : 0;
|
||||||
var fractionalcleintHeight = hostClientSize.h + (abs$1(hostSizeFraction.h) < 1 ? hostSizeFraction.h : 0);
|
var fractionalClientHeight = hostClientSize.h + (abs$1(hostSizeFraction.h) < 1 ? hostSizeFraction.h : 0);
|
||||||
style(_viewport, {
|
style(_viewport, {
|
||||||
height: fractionalcleintHeight + (_overflowScroll.x ? _scrollbarsHideOffset.x : 0) - paddingVertical,
|
height: fractionalClientHeight + (_overflowScroll.x ? _scrollbarsHideOffset.x : 0) - paddingVertical,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1871,7 +1862,7 @@
|
|||||||
var shrinkElement = observerElementChildrenRoot.lastChild;
|
var shrinkElement = observerElementChildrenRoot.lastChild;
|
||||||
var expandElement = observerElementChildrenRoot.firstChild;
|
var expandElement = observerElementChildrenRoot.firstChild;
|
||||||
var expandElementChild = expandElement == null ? void 0 : expandElement.firstChild;
|
var expandElementChild = expandElement == null ? void 0 : expandElement.firstChild;
|
||||||
var cacheSize = offsetSize(listenerElement);
|
var cacheSize = offsetSize(observerElementChildrenRoot);
|
||||||
var currSize = cacheSize;
|
var currSize = cacheSize;
|
||||||
var isDirty = false;
|
var isDirty = false;
|
||||||
var rAFId;
|
var rAFId;
|
||||||
@@ -1893,7 +1884,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
var onScroll = function onScroll(scrollEvent) {
|
var onScroll = function onScroll(scrollEvent) {
|
||||||
currSize = offsetSize(listenerElement);
|
currSize = offsetSize(observerElementChildrenRoot);
|
||||||
isDirty = !scrollEvent || !equalWH(currSize, cacheSize);
|
isDirty = !scrollEvent || !equalWH(currSize, cacheSize);
|
||||||
|
|
||||||
if (scrollEvent) {
|
if (scrollEvent) {
|
||||||
@@ -1920,9 +1911,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (observeDirectionChange) {
|
if (observeDirectionChange) {
|
||||||
directionIsRTLCache = createCache(function () {
|
directionIsRTLCache = createCache(directionIsRTL.bind(0, sizeObserver));
|
||||||
return directionIsRTL(sizeObserver);
|
|
||||||
});
|
|
||||||
var _directionIsRTLCache = directionIsRTLCache,
|
var _directionIsRTLCache = directionIsRTLCache,
|
||||||
updateDirectionIsRTLCache = _directionIsRTLCache._update;
|
updateDirectionIsRTLCache = _directionIsRTLCache._update;
|
||||||
push(
|
push(
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -276,6 +276,9 @@ const rollupConfig = (config = {}, { project = process.cwd(), overwrite = {}, si
|
|||||||
regex: /^_/,
|
regex: /^_/,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
compress: {
|
||||||
|
evaluate: false,
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user