@oxog/scrollex 1.1.0 → 1.1.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/CHANGELOG.md +12 -1
- package/README.md +22 -5
- package/dist/{chunk-ND5PV5MU.cjs → chunk-MEEFAXSA.cjs} +7 -6
- package/dist/chunk-MEEFAXSA.cjs.map +1 -0
- package/dist/{chunk-CIB3EBBJ.js → chunk-VLA5K5HH.js} +7 -6
- package/dist/chunk-VLA5K5HH.js.map +1 -0
- package/dist/index.cjs +117 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +97 -10
- package/dist/index.js.map +1 -1
- package/dist/plugins/index.cjs +12 -12
- package/dist/plugins/index.cjs.map +1 -1
- package/dist/plugins/index.d.cts +1 -1
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +4 -4
- package/dist/plugins/index.js.map +1 -1
- package/dist/{scroll-controller-D5AV1E2p.d.cts → scroll-controller-CBna5Yim.d.cts} +24 -3
- package/dist/{scroll-controller-D5AV1E2p.d.ts → scroll-controller-CBna5Yim.d.ts} +24 -3
- package/package.json +1 -1
- package/dist/chunk-CIB3EBBJ.js.map +0 -1
- package/dist/chunk-ND5PV5MU.cjs.map +0 -1
package/dist/plugins/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMEEFAXSA_cjs = require('../chunk-MEEFAXSA.cjs');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
@@ -15,16 +15,16 @@ function masonryRenderer(options) {
|
|
|
15
15
|
} = options;
|
|
16
16
|
let kernel = null;
|
|
17
17
|
let virtualItems = [];
|
|
18
|
-
let columnCount = typeof columns === "number" ?
|
|
18
|
+
let columnCount = typeof columns === "number" ? chunkMEEFAXSA_cjs.normalizeColumnCount(columns) : 1;
|
|
19
19
|
let columnWidth = 0;
|
|
20
20
|
let columnHeights = [];
|
|
21
21
|
let totalHeight = 0;
|
|
22
22
|
const layoutCache = /* @__PURE__ */ new Map();
|
|
23
23
|
function calculateColumns(containerWidth) {
|
|
24
24
|
if (typeof columns === "number") {
|
|
25
|
-
columnCount =
|
|
25
|
+
columnCount = chunkMEEFAXSA_cjs.normalizeColumnCount(columns);
|
|
26
26
|
} else {
|
|
27
|
-
columnCount =
|
|
27
|
+
columnCount = chunkMEEFAXSA_cjs.autoColumnCount(containerWidth, minColumnWidth, gap);
|
|
28
28
|
}
|
|
29
29
|
columnWidth = (containerWidth - (columnCount - 1) * gap) / columnCount;
|
|
30
30
|
}
|
|
@@ -623,7 +623,7 @@ function scrollRestoration(options) {
|
|
|
623
623
|
const horizontal = kernel.getOptions().direction === "horizontal";
|
|
624
624
|
const viewport = kernel.getViewport();
|
|
625
625
|
const target = horizontal ? state.scrollLeft : state.scrollTop;
|
|
626
|
-
const maxScroll = kernel.getTotalSize() - (horizontal ? viewport.width : viewport.height);
|
|
626
|
+
const maxScroll = kernel.getTotalSize() + (kernel.getOptions().scrollMargin ?? 0) - (horizontal ? viewport.width : viewport.height);
|
|
627
627
|
if (target > maxScroll + 1) {
|
|
628
628
|
awaitingContent = true;
|
|
629
629
|
return;
|
|
@@ -667,7 +667,7 @@ function scrollRestoration(options) {
|
|
|
667
667
|
install(k) {
|
|
668
668
|
kernel = k;
|
|
669
669
|
if (saveOnScroll) {
|
|
670
|
-
debouncedSave =
|
|
670
|
+
debouncedSave = chunkMEEFAXSA_cjs.debounce(save, debounceMs);
|
|
671
671
|
}
|
|
672
672
|
if (restoreOnMount && restoredKernels.get(k) !== key) {
|
|
673
673
|
restoreFrame = requestAnimationFrame(() => {
|
|
@@ -1130,7 +1130,7 @@ function debugPanel(options = {}) {
|
|
|
1130
1130
|
const horizontal = kernel.getOptions().direction === "horizontal";
|
|
1131
1131
|
const viewport = kernel.getViewport();
|
|
1132
1132
|
const scrollOffset = horizontal ? scrollPos.scrollLeft : scrollPos.scrollTop;
|
|
1133
|
-
const maxScroll = kernel.getTotalSize() - (horizontal ? viewport.width : viewport.height);
|
|
1133
|
+
const maxScroll = kernel.getTotalSize() + (kernel.getOptions().scrollMargin ?? 0) - (horizontal ? viewport.width : viewport.height);
|
|
1134
1134
|
state.stats = {
|
|
1135
1135
|
...state.stats,
|
|
1136
1136
|
memoryUsage,
|
|
@@ -1654,23 +1654,23 @@ function EventsPanel({ eventLog, onClear }) {
|
|
|
1654
1654
|
|
|
1655
1655
|
Object.defineProperty(exports, "autoMeasurerPlugin", {
|
|
1656
1656
|
enumerable: true,
|
|
1657
|
-
get: function () { return
|
|
1657
|
+
get: function () { return chunkMEEFAXSA_cjs.autoMeasurerPlugin; }
|
|
1658
1658
|
});
|
|
1659
1659
|
Object.defineProperty(exports, "gridRendererPlugin", {
|
|
1660
1660
|
enumerable: true,
|
|
1661
|
-
get: function () { return
|
|
1661
|
+
get: function () { return chunkMEEFAXSA_cjs.gridRendererPlugin; }
|
|
1662
1662
|
});
|
|
1663
1663
|
Object.defineProperty(exports, "infiniteLoaderPlugin", {
|
|
1664
1664
|
enumerable: true,
|
|
1665
|
-
get: function () { return
|
|
1665
|
+
get: function () { return chunkMEEFAXSA_cjs.infiniteLoaderPlugin; }
|
|
1666
1666
|
});
|
|
1667
1667
|
Object.defineProperty(exports, "listRendererPlugin", {
|
|
1668
1668
|
enumerable: true,
|
|
1669
|
-
get: function () { return
|
|
1669
|
+
get: function () { return chunkMEEFAXSA_cjs.listRendererPlugin; }
|
|
1670
1670
|
});
|
|
1671
1671
|
Object.defineProperty(exports, "scrollControllerPlugin", {
|
|
1672
1672
|
enumerable: true,
|
|
1673
|
-
get: function () { return
|
|
1673
|
+
get: function () { return chunkMEEFAXSA_cjs.scrollControllerPlugin; }
|
|
1674
1674
|
});
|
|
1675
1675
|
exports.DebugPanelOverlay = DebugPanelOverlay;
|
|
1676
1676
|
exports.bidirectional = bidirectional;
|