@oxog/scrollex 1.1.1 → 1.2.0
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 +25 -1
- package/dist/{chunk-VLA5K5HH.js → chunk-2AWRSNQN.js} +7 -7
- package/dist/chunk-2AWRSNQN.js.map +1 -0
- package/dist/{chunk-MEEFAXSA.cjs → chunk-CTKEJZGD.cjs} +7 -7
- package/dist/chunk-CTKEJZGD.cjs.map +1 -0
- package/dist/index.cjs +25 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/plugins/index.cjs +16 -14
- package/dist/plugins/index.cjs.map +1 -1
- package/dist/plugins/index.d.cts +3 -4
- package/dist/plugins/index.d.ts +3 -4
- package/dist/plugins/index.js +8 -6
- package/dist/plugins/index.js.map +1 -1
- package/dist/{scroll-controller-CBna5Yim.d.cts → scroll-controller-U4Zov88U.d.cts} +1 -2
- package/dist/{scroll-controller-CBna5Yim.d.ts → scroll-controller-U4Zov88U.d.ts} +1 -2
- package/package.json +23 -10
- package/dist/chunk-MEEFAXSA.cjs.map +0 -1
- package/dist/chunk-VLA5K5HH.js.map +0 -1
package/dist/plugins/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkCTKEJZGD_cjs = require('../chunk-CTKEJZGD.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" ? chunkCTKEJZGD_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 = chunkCTKEJZGD_cjs.normalizeColumnCount(columns);
|
|
26
26
|
} else {
|
|
27
|
-
columnCount =
|
|
27
|
+
columnCount = chunkCTKEJZGD_cjs.autoColumnCount(containerWidth, minColumnWidth, gap);
|
|
28
28
|
}
|
|
29
29
|
columnWidth = (containerWidth - (columnCount - 1) * gap) / columnCount;
|
|
30
30
|
}
|
|
@@ -570,8 +570,9 @@ function scrollRestoration(options) {
|
|
|
570
570
|
};
|
|
571
571
|
if (includeIndex) {
|
|
572
572
|
const keyboardNav2 = kernel.getPlugin("keyboard-nav");
|
|
573
|
-
|
|
574
|
-
|
|
573
|
+
const navApi = keyboardNav2?.api;
|
|
574
|
+
if (navApi?.getFocusedIndex) {
|
|
575
|
+
const focusedIndex = navApi.getFocusedIndex();
|
|
575
576
|
if (focusedIndex !== null) {
|
|
576
577
|
state.focusedIndex = focusedIndex;
|
|
577
578
|
}
|
|
@@ -607,8 +608,9 @@ function scrollRestoration(options) {
|
|
|
607
608
|
kernel.scrollTo(kernel.getOptions().direction === "horizontal" ? state.scrollLeft : state.scrollTop);
|
|
608
609
|
if (includeIndex && state.focusedIndex !== void 0) {
|
|
609
610
|
const keyboardNav2 = kernel.getPlugin("keyboard-nav");
|
|
610
|
-
|
|
611
|
-
|
|
611
|
+
const navApi = keyboardNav2?.api;
|
|
612
|
+
if (navApi?.setFocusedIndex) {
|
|
613
|
+
navApi.setFocusedIndex(state.focusedIndex);
|
|
612
614
|
}
|
|
613
615
|
}
|
|
614
616
|
return true;
|
|
@@ -667,7 +669,7 @@ function scrollRestoration(options) {
|
|
|
667
669
|
install(k) {
|
|
668
670
|
kernel = k;
|
|
669
671
|
if (saveOnScroll) {
|
|
670
|
-
debouncedSave =
|
|
672
|
+
debouncedSave = chunkCTKEJZGD_cjs.debounce(save, debounceMs);
|
|
671
673
|
}
|
|
672
674
|
if (restoreOnMount && restoredKernels.get(k) !== key) {
|
|
673
675
|
restoreFrame = requestAnimationFrame(() => {
|
|
@@ -1654,23 +1656,23 @@ function EventsPanel({ eventLog, onClear }) {
|
|
|
1654
1656
|
|
|
1655
1657
|
Object.defineProperty(exports, "autoMeasurerPlugin", {
|
|
1656
1658
|
enumerable: true,
|
|
1657
|
-
get: function () { return
|
|
1659
|
+
get: function () { return chunkCTKEJZGD_cjs.autoMeasurerPlugin; }
|
|
1658
1660
|
});
|
|
1659
1661
|
Object.defineProperty(exports, "gridRendererPlugin", {
|
|
1660
1662
|
enumerable: true,
|
|
1661
|
-
get: function () { return
|
|
1663
|
+
get: function () { return chunkCTKEJZGD_cjs.gridRendererPlugin; }
|
|
1662
1664
|
});
|
|
1663
1665
|
Object.defineProperty(exports, "infiniteLoaderPlugin", {
|
|
1664
1666
|
enumerable: true,
|
|
1665
|
-
get: function () { return
|
|
1667
|
+
get: function () { return chunkCTKEJZGD_cjs.infiniteLoaderPlugin; }
|
|
1666
1668
|
});
|
|
1667
1669
|
Object.defineProperty(exports, "listRendererPlugin", {
|
|
1668
1670
|
enumerable: true,
|
|
1669
|
-
get: function () { return
|
|
1671
|
+
get: function () { return chunkCTKEJZGD_cjs.listRendererPlugin; }
|
|
1670
1672
|
});
|
|
1671
1673
|
Object.defineProperty(exports, "scrollControllerPlugin", {
|
|
1672
1674
|
enumerable: true,
|
|
1673
|
-
get: function () { return
|
|
1675
|
+
get: function () { return chunkCTKEJZGD_cjs.scrollControllerPlugin; }
|
|
1674
1676
|
});
|
|
1675
1677
|
exports.DebugPanelOverlay = DebugPanelOverlay;
|
|
1676
1678
|
exports.bidirectional = bidirectional;
|