@legendapp/list 3.0.0-beta.32 → 3.0.0-beta.33
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/README.md +7 -1
- package/animated.d.ts +600 -6
- package/animated.js +2 -2
- package/animated.mjs +1 -1
- package/index.d.ts +454 -108
- package/index.js +81 -32
- package/index.mjs +81 -32
- package/index.native.js +89 -44
- package/index.native.mjs +88 -43
- package/keyboard-controller.d.ts +611 -6
- package/keyboard-controller.js +2 -2
- package/keyboard-controller.mjs +1 -1
- package/keyboard.d.ts +204 -8
- package/keyboard.js +66 -52
- package/keyboard.mjs +69 -54
- package/{index.d.mts → list-react-native.d.ts} +95 -32
- package/list-react-native.js +4234 -0
- package/list-react-native.mjs +4204 -0
- package/{index.native.d.mts → list-react.d.ts} +355 -40
- package/list-react.js +4426 -0
- package/list-react.mjs +4396 -0
- package/package.json +52 -1
- package/reanimated.d.ts +595 -7
- package/reanimated.js +156 -11
- package/reanimated.mjs +153 -8
- package/section-list.d.ts +610 -14
- package/section-list.js +6 -6
- package/section-list.mjs +1 -1
- package/animated.d.mts +0 -9
- package/animated.native.d.mts +0 -9
- package/animated.native.d.ts +0 -9
- package/animated.native.js +0 -9
- package/animated.native.mjs +0 -7
- package/index.native.d.ts +0 -817
- package/keyboard-controller.d.mts +0 -12
- package/keyboard-controller.native.d.mts +0 -12
- package/keyboard-controller.native.d.ts +0 -12
- package/keyboard-controller.native.js +0 -69
- package/keyboard-controller.native.mjs +0 -48
- package/keyboard.d.mts +0 -13
- package/keyboard.native.d.mts +0 -13
- package/keyboard.native.d.ts +0 -13
- package/keyboard.native.js +0 -399
- package/keyboard.native.mjs +0 -377
- package/reanimated.d.mts +0 -18
- package/reanimated.native.d.mts +0 -18
- package/reanimated.native.d.ts +0 -18
- package/reanimated.native.js +0 -89
- package/reanimated.native.mjs +0 -65
- package/section-list.d.mts +0 -112
- package/section-list.native.d.mts +0 -112
- package/section-list.native.d.ts +0 -112
- package/section-list.native.js +0 -293
- package/section-list.native.mjs +0 -271
package/index.native.js
CHANGED
|
@@ -239,7 +239,7 @@ var _a;
|
|
|
239
239
|
var envMode = typeof process !== "undefined" && typeof process.env === "object" && process.env ? (_a = process.env.NODE_ENV) != null ? _a : process.env.MODE : void 0;
|
|
240
240
|
var processDev = typeof envMode === "string" ? envMode.toLowerCase() !== "production" : void 0;
|
|
241
241
|
var _a2;
|
|
242
|
-
var IS_DEV = (_a2 =
|
|
242
|
+
var IS_DEV = (_a2 = processDev != null ? processDev : metroDev) != null ? _a2 : false;
|
|
243
243
|
|
|
244
244
|
// src/constants.ts
|
|
245
245
|
var POSITION_OUT_OF_VIEW = -1e7;
|
|
@@ -312,7 +312,7 @@ function useValue$(key, params) {
|
|
|
312
312
|
React2.useMemo(() => {
|
|
313
313
|
let prevValue;
|
|
314
314
|
let didQueueTask = false;
|
|
315
|
-
listen$(ctx, key, (
|
|
315
|
+
listen$(ctx, key, () => {
|
|
316
316
|
const newValue = getNewValue();
|
|
317
317
|
if (delay !== void 0) {
|
|
318
318
|
const fn = () => {
|
|
@@ -341,7 +341,6 @@ function useValue$(key, params) {
|
|
|
341
341
|
}, []);
|
|
342
342
|
return animValue;
|
|
343
343
|
}
|
|
344
|
-
var typedForwardRef = React2.forwardRef;
|
|
345
344
|
var typedMemo = React2.memo;
|
|
346
345
|
var getComponent = (Component) => {
|
|
347
346
|
if (React2__namespace.isValidElement(Component)) {
|
|
@@ -416,10 +415,7 @@ var PositionViewSticky = typedMemo(function PositionViewSticky2({
|
|
|
416
415
|
const stickyPosition = animatedScrollY.interpolate({
|
|
417
416
|
extrapolateLeft: "clamp",
|
|
418
417
|
extrapolateRight: "extend",
|
|
419
|
-
inputRange: [
|
|
420
|
-
stickyStart,
|
|
421
|
-
stickyStart + 5e3
|
|
422
|
-
],
|
|
418
|
+
inputRange: [stickyStart, stickyStart + 5e3],
|
|
423
419
|
outputRange: [position, position + 5e3]
|
|
424
420
|
});
|
|
425
421
|
return horizontal ? [{ translateX: stickyPosition }] : [{ translateY: stickyPosition }];
|
|
@@ -637,6 +633,8 @@ function useOnLayoutSync({
|
|
|
637
633
|
}
|
|
638
634
|
var Platform2 = reactNative.Platform;
|
|
639
635
|
var PlatformAdjustBreaksScroll = Platform2.OS === "android";
|
|
636
|
+
var typedForwardRef = React2.forwardRef;
|
|
637
|
+
var typedMemo2 = React2.memo;
|
|
640
638
|
|
|
641
639
|
// src/utils/isInMVCPActiveMode.native.ts
|
|
642
640
|
function isInMVCPActiveMode(state) {
|
|
@@ -644,7 +642,7 @@ function isInMVCPActiveMode(state) {
|
|
|
644
642
|
}
|
|
645
643
|
|
|
646
644
|
// src/components/Container.tsx
|
|
647
|
-
var Container =
|
|
645
|
+
var Container = typedMemo2(function Container2({
|
|
648
646
|
id,
|
|
649
647
|
recycleItems,
|
|
650
648
|
horizontal,
|
|
@@ -655,6 +653,7 @@ var Container = typedMemo(function Container2({
|
|
|
655
653
|
}) {
|
|
656
654
|
const ctx = useStateContext();
|
|
657
655
|
const { columnWrapperStyle, animatedScrollY } = ctx;
|
|
656
|
+
const stickyPositionComponentInternal = ctx.state.props.stickyPositionComponentInternal;
|
|
658
657
|
const [column = 0, span = 1, data, itemKey, numColumns = 1, extraData, isSticky] = useArr$([
|
|
659
658
|
`containerColumn${id}`,
|
|
660
659
|
`containerSpan${id}`,
|
|
@@ -807,7 +806,7 @@ var Container = typedMemo(function Container2({
|
|
|
807
806
|
}
|
|
808
807
|
}, [itemKey]);
|
|
809
808
|
}
|
|
810
|
-
const PositionComponent = isSticky ? PositionViewSticky : PositionView;
|
|
809
|
+
const PositionComponent = isSticky ? stickyPositionComponentInternal ? stickyPositionComponentInternal : PositionViewSticky : PositionView;
|
|
811
810
|
return /* @__PURE__ */ React2__namespace.createElement(
|
|
812
811
|
PositionComponent,
|
|
813
812
|
{
|
|
@@ -918,7 +917,7 @@ var LayoutView = ({ onLayoutChange, refView, ...rest }) => {
|
|
|
918
917
|
};
|
|
919
918
|
|
|
920
919
|
// src/components/ListComponent.tsx
|
|
921
|
-
var ListComponent =
|
|
920
|
+
var ListComponent = typedMemo2(function ListComponent2({
|
|
922
921
|
canRender,
|
|
923
922
|
style,
|
|
924
923
|
contentContainerStyle,
|
|
@@ -949,7 +948,9 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
949
948
|
const ctx = useStateContext();
|
|
950
949
|
const maintainVisibleContentPosition = ctx.state.props.maintainVisibleContentPosition;
|
|
951
950
|
const ScrollComponent = renderScrollComponent ? React2.useMemo(
|
|
952
|
-
() => React2__namespace.forwardRef(
|
|
951
|
+
() => React2__namespace.forwardRef(
|
|
952
|
+
(props, ref) => renderScrollComponent({ ...props, ref })
|
|
953
|
+
),
|
|
953
954
|
[renderScrollComponent]
|
|
954
955
|
) : ListComponentScrollView;
|
|
955
956
|
const SnapOrScroll = snapToIndices ? SnapWrapper : ScrollComponent;
|
|
@@ -1142,12 +1143,15 @@ function calculateOffsetWithOffsetPosition(ctx, offsetParam, params) {
|
|
|
1142
1143
|
}
|
|
1143
1144
|
|
|
1144
1145
|
// src/core/clampScrollOffset.ts
|
|
1145
|
-
function clampScrollOffset(ctx, offset) {
|
|
1146
|
+
function clampScrollOffset(ctx, offset, scrollTarget) {
|
|
1146
1147
|
const state = ctx.state;
|
|
1147
1148
|
const contentSize = getContentSize(ctx);
|
|
1148
1149
|
let clampedOffset = offset;
|
|
1149
1150
|
if (Number.isFinite(contentSize) && Number.isFinite(state.scrollLength) && (Platform2.OS !== "android" || state.lastLayout)) {
|
|
1150
|
-
const
|
|
1151
|
+
const baseMaxOffset = Math.max(0, contentSize - state.scrollLength);
|
|
1152
|
+
const viewOffset = scrollTarget == null ? void 0 : scrollTarget.viewOffset;
|
|
1153
|
+
const extraEndOffset = typeof viewOffset === "number" && viewOffset < 0 ? -viewOffset : 0;
|
|
1154
|
+
const maxOffset = baseMaxOffset + extraEndOffset;
|
|
1151
1155
|
clampedOffset = Math.min(offset, maxOffset);
|
|
1152
1156
|
}
|
|
1153
1157
|
clampedOffset = Math.max(0, clampedOffset);
|
|
@@ -1242,7 +1246,7 @@ function checkAtBottom(ctx) {
|
|
|
1242
1246
|
function checkAtTop(ctx) {
|
|
1243
1247
|
var _a3;
|
|
1244
1248
|
const state = ctx == null ? void 0 : ctx.state;
|
|
1245
|
-
if (!state || state.initialScroll) {
|
|
1249
|
+
if (!state || state.initialScroll || state.scrollingTo) {
|
|
1246
1250
|
return;
|
|
1247
1251
|
}
|
|
1248
1252
|
const {
|
|
@@ -1286,14 +1290,22 @@ function setInitialRenderState(ctx, {
|
|
|
1286
1290
|
didInitialScroll
|
|
1287
1291
|
}) {
|
|
1288
1292
|
const { state } = ctx;
|
|
1293
|
+
const {
|
|
1294
|
+
loadStartTime,
|
|
1295
|
+
props: { onLoad }
|
|
1296
|
+
} = state;
|
|
1289
1297
|
if (didLayout) {
|
|
1290
1298
|
state.didContainersLayout = true;
|
|
1291
1299
|
}
|
|
1292
1300
|
if (didInitialScroll) {
|
|
1293
1301
|
state.didFinishInitialScroll = true;
|
|
1294
1302
|
}
|
|
1295
|
-
|
|
1303
|
+
const isReadyToRender = Boolean(state.didContainersLayout && state.didFinishInitialScroll);
|
|
1304
|
+
if (isReadyToRender && !peek$(ctx, "readyToRender")) {
|
|
1296
1305
|
set$(ctx, "readyToRender", true);
|
|
1306
|
+
if (onLoad) {
|
|
1307
|
+
onLoad({ elapsedTimeInMs: Date.now() - loadStartTime });
|
|
1308
|
+
}
|
|
1297
1309
|
}
|
|
1298
1310
|
}
|
|
1299
1311
|
|
|
@@ -1332,8 +1344,12 @@ function checkFinishedScrollFrame(ctx) {
|
|
|
1332
1344
|
state.animFrameCheckFinishedScroll = void 0;
|
|
1333
1345
|
const scroll = state.scrollPending;
|
|
1334
1346
|
const adjust = state.scrollAdjustHandler.getAdjust();
|
|
1335
|
-
const clampedTargetOffset = clampScrollOffset(
|
|
1336
|
-
|
|
1347
|
+
const clampedTargetOffset = clampScrollOffset(
|
|
1348
|
+
ctx,
|
|
1349
|
+
scrollingTo.offset - (scrollingTo.viewOffset || 0),
|
|
1350
|
+
scrollingTo
|
|
1351
|
+
);
|
|
1352
|
+
const maxOffset = clampScrollOffset(ctx, scroll, scrollingTo);
|
|
1337
1353
|
const diff1 = Math.abs(scroll - clampedTargetOffset);
|
|
1338
1354
|
const diff2 = Math.abs(diff1 - adjust);
|
|
1339
1355
|
const isNotOverscrolled = Math.abs(scroll - maxOffset) < 1;
|
|
@@ -1400,7 +1416,7 @@ function scrollTo(ctx, params) {
|
|
|
1400
1416
|
clearTimeout(ctx.state.timeoutCheckFinishedScrollFallback);
|
|
1401
1417
|
}
|
|
1402
1418
|
let offset = precomputedWithViewOffset ? scrollTargetOffset : calculateOffsetWithOffsetPosition(ctx, scrollTargetOffset, scrollTarget);
|
|
1403
|
-
offset = clampScrollOffset(ctx, offset);
|
|
1419
|
+
offset = clampScrollOffset(ctx, offset, scrollTarget);
|
|
1404
1420
|
state.scrollHistory.length = 0;
|
|
1405
1421
|
if (!noScrollingTo) {
|
|
1406
1422
|
state.scrollingTo = scrollTarget;
|
|
@@ -1553,7 +1569,7 @@ function ensureInitialAnchor(ctx) {
|
|
|
1553
1569
|
}
|
|
1554
1570
|
const availableSpace = Math.max(0, scrollLength - size);
|
|
1555
1571
|
const desiredOffset = calculateOffsetForIndex(ctx, anchor.index) - ((_a3 = anchor.viewOffset) != null ? _a3 : 0) - ((_b = anchor.viewPosition) != null ? _b : 0) * availableSpace;
|
|
1556
|
-
const clampedDesiredOffset = clampScrollOffset(ctx, desiredOffset);
|
|
1572
|
+
const clampedDesiredOffset = clampScrollOffset(ctx, desiredOffset, anchor);
|
|
1557
1573
|
const delta = clampedDesiredOffset - scroll;
|
|
1558
1574
|
if (Math.abs(delta) <= INITIAL_ANCHOR_TOLERANCE) {
|
|
1559
1575
|
const settledTicks = ((_c = anchor.settledTicks) != null ? _c : 0) + 1;
|
|
@@ -1640,6 +1656,7 @@ function prepareMVCP(ctx, dataChanged) {
|
|
|
1640
1656
|
const idsInViewWithPositions = [];
|
|
1641
1657
|
const scrollTarget = scrollingTo == null ? void 0 : scrollingTo.index;
|
|
1642
1658
|
const scrollingToViewPosition = scrollingTo == null ? void 0 : scrollingTo.viewPosition;
|
|
1659
|
+
const isEndAnchoredScrollTarget = scrollTarget !== void 0 && state.props.data.length > 0 && scrollTarget >= state.props.data.length - 1 && (scrollingToViewPosition != null ? scrollingToViewPosition : 0) > 0;
|
|
1643
1660
|
const shouldMVCP = dataChanged ? mvcpData : mvcpScroll;
|
|
1644
1661
|
const indexByKey = state.indexByKey;
|
|
1645
1662
|
if (shouldMVCP) {
|
|
@@ -1708,7 +1725,7 @@ function prepareMVCP(ctx, dataChanged) {
|
|
|
1708
1725
|
if (newPosition !== void 0) {
|
|
1709
1726
|
const totalSize = getContentSize(ctx);
|
|
1710
1727
|
let diff = newPosition - prevPosition;
|
|
1711
|
-
if (diff !== 0 && state.scroll + state.scrollLength > totalSize) {
|
|
1728
|
+
if (diff !== 0 && isEndAnchoredScrollTarget && state.scroll + state.scrollLength > totalSize) {
|
|
1712
1729
|
if (diff > 0) {
|
|
1713
1730
|
diff = Math.max(0, totalSize - state.scroll - state.scrollLength);
|
|
1714
1731
|
} else {
|
|
@@ -2393,26 +2410,16 @@ function scrollToIndex(ctx, { index, viewOffset = 0, animated = true, viewPositi
|
|
|
2393
2410
|
// src/utils/setDidLayout.ts
|
|
2394
2411
|
function setDidLayout(ctx) {
|
|
2395
2412
|
const state = ctx.state;
|
|
2396
|
-
const {
|
|
2397
|
-
loadStartTime,
|
|
2398
|
-
initialScroll,
|
|
2399
|
-
props: { onLoad }
|
|
2400
|
-
} = state;
|
|
2413
|
+
const { initialScroll } = state;
|
|
2401
2414
|
state.queuedInitialLayout = true;
|
|
2402
2415
|
checkAtBottom(ctx);
|
|
2403
|
-
const setIt = () => {
|
|
2404
|
-
setInitialRenderState(ctx, { didLayout: true });
|
|
2405
|
-
if (onLoad) {
|
|
2406
|
-
onLoad({ elapsedTimeInMs: Date.now() - loadStartTime });
|
|
2407
|
-
}
|
|
2408
|
-
};
|
|
2409
2416
|
if ((initialScroll == null ? void 0 : initialScroll.index) !== void 0) {
|
|
2410
2417
|
const target = initialScroll;
|
|
2411
2418
|
const runScroll = () => scrollToIndex(ctx, { ...target, animated: false });
|
|
2412
2419
|
runScroll();
|
|
2413
2420
|
requestAnimationFrame(runScroll);
|
|
2414
2421
|
}
|
|
2415
|
-
|
|
2422
|
+
setInitialRenderState(ctx, { didLayout: true });
|
|
2416
2423
|
}
|
|
2417
2424
|
|
|
2418
2425
|
// src/core/calculateItemsInView.ts
|
|
@@ -3137,7 +3144,7 @@ function onScroll(ctx, event) {
|
|
|
3137
3144
|
}
|
|
3138
3145
|
let newScroll = event.nativeEvent.contentOffset[state.props.horizontal ? "x" : "y"];
|
|
3139
3146
|
if (state.scrollingTo && state.scrollingTo.offset >= newScroll) {
|
|
3140
|
-
const maxOffset = clampScrollOffset(ctx, newScroll);
|
|
3147
|
+
const maxOffset = clampScrollOffset(ctx, newScroll, state.scrollingTo);
|
|
3141
3148
|
if (newScroll !== maxOffset && Math.abs(newScroll - maxOffset) > 1) {
|
|
3142
3149
|
newScroll = maxOffset;
|
|
3143
3150
|
scrollTo(ctx, {
|
|
@@ -3190,7 +3197,7 @@ var ScrollAdjustHandler = class {
|
|
|
3190
3197
|
if ((scrollTarget == null ? void 0 : scrollTarget.index) !== void 0) {
|
|
3191
3198
|
const currentOffset = calculateOffsetForIndex(this.ctx, scrollTarget.index);
|
|
3192
3199
|
targetScroll = calculateOffsetWithOffsetPosition(this.ctx, currentOffset, scrollTarget);
|
|
3193
|
-
targetScroll = clampScrollOffset(this.ctx, targetScroll);
|
|
3200
|
+
targetScroll = clampScrollOffset(this.ctx, targetScroll, scrollTarget);
|
|
3194
3201
|
} else {
|
|
3195
3202
|
targetScroll = clampScrollOffset(this.ctx, state.scroll + pending);
|
|
3196
3203
|
}
|
|
@@ -3391,8 +3398,9 @@ function getWindowSize() {
|
|
|
3391
3398
|
}
|
|
3392
3399
|
var StyleSheet = reactNative.StyleSheet;
|
|
3393
3400
|
function useStickyScrollHandler(stickyHeaderIndices, horizontal, ctx, onScroll2) {
|
|
3401
|
+
const shouldUseRnAnimatedEngine = !ctx.state.props.stickyPositionComponentInternal;
|
|
3394
3402
|
return React2.useMemo(() => {
|
|
3395
|
-
if (stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.length) {
|
|
3403
|
+
if ((stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.length) && shouldUseRnAnimatedEngine) {
|
|
3396
3404
|
const { animatedScrollY } = ctx;
|
|
3397
3405
|
return reactNative.Animated.event(
|
|
3398
3406
|
[
|
|
@@ -3409,7 +3417,7 @@ function useStickyScrollHandler(stickyHeaderIndices, horizontal, ctx, onScroll2)
|
|
|
3409
3417
|
);
|
|
3410
3418
|
}
|
|
3411
3419
|
return onScroll2;
|
|
3412
|
-
}, [stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.join(","), horizontal]);
|
|
3420
|
+
}, [stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.join(","), horizontal, shouldUseRnAnimatedEngine]);
|
|
3413
3421
|
}
|
|
3414
3422
|
|
|
3415
3423
|
// src/utils/createColumnWrapperStyle.ts
|
|
@@ -3445,7 +3453,30 @@ function createImperativeHandle(ctx) {
|
|
|
3445
3453
|
}
|
|
3446
3454
|
};
|
|
3447
3455
|
const refScroller = state.refScroller;
|
|
3456
|
+
const clearCaches = (options) => {
|
|
3457
|
+
var _a3, _b;
|
|
3458
|
+
const mode = (_a3 = options == null ? void 0 : options.mode) != null ? _a3 : "sizes";
|
|
3459
|
+
state.sizes.clear();
|
|
3460
|
+
state.sizesKnown.clear();
|
|
3461
|
+
for (const key in state.averageSizes) {
|
|
3462
|
+
delete state.averageSizes[key];
|
|
3463
|
+
}
|
|
3464
|
+
state.minIndexSizeChanged = 0;
|
|
3465
|
+
state.scrollForNextCalculateItemsInView = void 0;
|
|
3466
|
+
state.pendingTotalSize = void 0;
|
|
3467
|
+
state.totalSize = 0;
|
|
3468
|
+
set$(ctx, "totalSize", 0);
|
|
3469
|
+
if (mode === "full") {
|
|
3470
|
+
state.indexByKey.clear();
|
|
3471
|
+
state.idCache.length = 0;
|
|
3472
|
+
state.positions.clear();
|
|
3473
|
+
state.columns.clear();
|
|
3474
|
+
state.columnSpans.clear();
|
|
3475
|
+
}
|
|
3476
|
+
(_b = state.triggerCalculateItemsInView) == null ? void 0 : _b.call(state, { forceFullItemPositions: true });
|
|
3477
|
+
};
|
|
3448
3478
|
return {
|
|
3479
|
+
clearCaches,
|
|
3449
3480
|
flashScrollIndicators: () => refScroller.current.flashScrollIndicators(),
|
|
3450
3481
|
getNativeScrollRef: () => refScroller.current,
|
|
3451
3482
|
getScrollableNode: () => refScroller.current.getScrollableNode(),
|
|
@@ -3606,8 +3637,8 @@ function normalizeMaintainVisibleContentPosition(value) {
|
|
|
3606
3637
|
if (value && typeof value === "object") {
|
|
3607
3638
|
return {
|
|
3608
3639
|
data: (_a3 = value.data) != null ? _a3 : false,
|
|
3609
|
-
|
|
3610
|
-
|
|
3640
|
+
shouldRestorePosition: value.shouldRestorePosition,
|
|
3641
|
+
size: (_b = value.size) != null ? _b : true
|
|
3611
3642
|
};
|
|
3612
3643
|
}
|
|
3613
3644
|
if (value === false) {
|
|
@@ -3679,7 +3710,7 @@ function useThrottledOnScroll(originalHandler, scrollEventThrottle) {
|
|
|
3679
3710
|
}
|
|
3680
3711
|
|
|
3681
3712
|
// src/components/LegendList.tsx
|
|
3682
|
-
var LegendList =
|
|
3713
|
+
var LegendList = typedMemo2(
|
|
3683
3714
|
// biome-ignore lint/nursery/noShadow: const function name shadowing is intentional
|
|
3684
3715
|
typedForwardRef(function LegendList2(props, forwardedRef) {
|
|
3685
3716
|
const { children, data: dataProp, renderItem: renderItemProp, ...restProps } = props;
|
|
@@ -3760,7 +3791,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3760
3791
|
...rest
|
|
3761
3792
|
} = props;
|
|
3762
3793
|
const animatedPropsInternal = props.animatedPropsInternal;
|
|
3763
|
-
const
|
|
3794
|
+
const stickyPositionComponentInternal = props.stickyPositionComponentInternal;
|
|
3795
|
+
const {
|
|
3796
|
+
childrenMode,
|
|
3797
|
+
stickyPositionComponentInternal: _stickyPositionComponentInternal,
|
|
3798
|
+
...restProps
|
|
3799
|
+
} = rest;
|
|
3764
3800
|
const contentContainerStyleBase = StyleSheet.flatten(contentContainerStyleProp);
|
|
3765
3801
|
const shouldFlexGrow = alignItemsAtEnd && (horizontal ? (contentContainerStyleBase == null ? void 0 : contentContainerStyleBase.minWidth) == null : (contentContainerStyleBase == null ? void 0 : contentContainerStyleBase.minHeight) == null);
|
|
3766
3802
|
const contentContainerStyle = {
|
|
@@ -3936,6 +3972,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3936
3972
|
snapToIndices,
|
|
3937
3973
|
stickyIndicesArr: stickyHeaderIndices != null ? stickyHeaderIndices : [],
|
|
3938
3974
|
stickyIndicesSet: React2.useMemo(() => new Set(stickyHeaderIndices != null ? stickyHeaderIndices : []), [stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.join(",")]),
|
|
3975
|
+
stickyPositionComponentInternal,
|
|
3939
3976
|
stylePaddingBottom: stylePaddingBottomState,
|
|
3940
3977
|
stylePaddingTop: stylePaddingTopState,
|
|
3941
3978
|
suggestEstimatedItemSize: !!suggestEstimatedItemSize
|
|
@@ -3989,7 +4026,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3989
4026
|
} else {
|
|
3990
4027
|
const baseOffset = initialScroll.index !== void 0 ? calculateOffsetForIndex(ctx, initialScroll.index) : 0;
|
|
3991
4028
|
const resolvedOffset = calculateOffsetWithOffsetPosition(ctx, baseOffset, initialScroll);
|
|
3992
|
-
const clampedOffset = clampScrollOffset(ctx, resolvedOffset);
|
|
4029
|
+
const clampedOffset = clampScrollOffset(ctx, resolvedOffset, initialScroll);
|
|
3993
4030
|
const updatedInitialScroll = { ...initialScroll, contentOffset: clampedOffset };
|
|
3994
4031
|
refState.current.initialScroll = updatedInitialScroll;
|
|
3995
4032
|
state.initialScroll = updatedInitialScroll;
|
|
@@ -4145,7 +4182,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
4145
4182
|
return /* @__PURE__ */ React2__namespace.createElement(React2__namespace.Fragment, null, /* @__PURE__ */ React2__namespace.createElement(
|
|
4146
4183
|
ListComponent,
|
|
4147
4184
|
{
|
|
4148
|
-
...
|
|
4185
|
+
...restProps,
|
|
4149
4186
|
alignItemsAtEnd,
|
|
4150
4187
|
canRender,
|
|
4151
4188
|
contentContainerStyle,
|
|
@@ -4182,9 +4219,17 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
4182
4219
|
), IS_DEV && ENABLE_DEBUG_VIEW);
|
|
4183
4220
|
});
|
|
4184
4221
|
|
|
4185
|
-
|
|
4222
|
+
// src/index.ts
|
|
4223
|
+
var LegendList3 = LegendList;
|
|
4224
|
+
if (IS_DEV) {
|
|
4225
|
+
console.warn(
|
|
4226
|
+
"[legend-list] Legend List 3.0 deprecates the root import (@legendapp/list) because it now supports both react and react-native. The root import is fully functional, but please switch to platform-specific imports for strict platform types:\n - React Native: @legendapp/list/react-native\n - React: @legendapp/list/react\nSee README for details."
|
|
4227
|
+
);
|
|
4228
|
+
}
|
|
4229
|
+
|
|
4230
|
+
exports.LegendList = LegendList3;
|
|
4186
4231
|
exports.typedForwardRef = typedForwardRef;
|
|
4187
|
-
exports.typedMemo =
|
|
4232
|
+
exports.typedMemo = typedMemo2;
|
|
4188
4233
|
exports.useIsLastItem = useIsLastItem;
|
|
4189
4234
|
exports.useListScrollSize = useListScrollSize;
|
|
4190
4235
|
exports.useRecyclingEffect = useRecyclingEffect;
|