@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.mjs
CHANGED
|
@@ -218,7 +218,7 @@ var _a;
|
|
|
218
218
|
var envMode = typeof process !== "undefined" && typeof process.env === "object" && process.env ? (_a = process.env.NODE_ENV) != null ? _a : process.env.MODE : void 0;
|
|
219
219
|
var processDev = typeof envMode === "string" ? envMode.toLowerCase() !== "production" : void 0;
|
|
220
220
|
var _a2;
|
|
221
|
-
var IS_DEV = (_a2 =
|
|
221
|
+
var IS_DEV = (_a2 = processDev != null ? processDev : metroDev) != null ? _a2 : false;
|
|
222
222
|
|
|
223
223
|
// src/constants.ts
|
|
224
224
|
var POSITION_OUT_OF_VIEW = -1e7;
|
|
@@ -291,7 +291,7 @@ function useValue$(key, params) {
|
|
|
291
291
|
useMemo(() => {
|
|
292
292
|
let prevValue;
|
|
293
293
|
let didQueueTask = false;
|
|
294
|
-
listen$(ctx, key, (
|
|
294
|
+
listen$(ctx, key, () => {
|
|
295
295
|
const newValue = getNewValue();
|
|
296
296
|
if (delay !== void 0) {
|
|
297
297
|
const fn = () => {
|
|
@@ -320,7 +320,6 @@ function useValue$(key, params) {
|
|
|
320
320
|
}, []);
|
|
321
321
|
return animValue;
|
|
322
322
|
}
|
|
323
|
-
var typedForwardRef = forwardRef;
|
|
324
323
|
var typedMemo = memo;
|
|
325
324
|
var getComponent = (Component) => {
|
|
326
325
|
if (React2.isValidElement(Component)) {
|
|
@@ -395,10 +394,7 @@ var PositionViewSticky = typedMemo(function PositionViewSticky2({
|
|
|
395
394
|
const stickyPosition = animatedScrollY.interpolate({
|
|
396
395
|
extrapolateLeft: "clamp",
|
|
397
396
|
extrapolateRight: "extend",
|
|
398
|
-
inputRange: [
|
|
399
|
-
stickyStart,
|
|
400
|
-
stickyStart + 5e3
|
|
401
|
-
],
|
|
397
|
+
inputRange: [stickyStart, stickyStart + 5e3],
|
|
402
398
|
outputRange: [position, position + 5e3]
|
|
403
399
|
});
|
|
404
400
|
return horizontal ? [{ translateX: stickyPosition }] : [{ translateY: stickyPosition }];
|
|
@@ -616,6 +612,8 @@ function useOnLayoutSync({
|
|
|
616
612
|
}
|
|
617
613
|
var Platform2 = Platform;
|
|
618
614
|
var PlatformAdjustBreaksScroll = Platform2.OS === "android";
|
|
615
|
+
var typedForwardRef = forwardRef;
|
|
616
|
+
var typedMemo2 = memo;
|
|
619
617
|
|
|
620
618
|
// src/utils/isInMVCPActiveMode.native.ts
|
|
621
619
|
function isInMVCPActiveMode(state) {
|
|
@@ -623,7 +621,7 @@ function isInMVCPActiveMode(state) {
|
|
|
623
621
|
}
|
|
624
622
|
|
|
625
623
|
// src/components/Container.tsx
|
|
626
|
-
var Container =
|
|
624
|
+
var Container = typedMemo2(function Container2({
|
|
627
625
|
id,
|
|
628
626
|
recycleItems,
|
|
629
627
|
horizontal,
|
|
@@ -634,6 +632,7 @@ var Container = typedMemo(function Container2({
|
|
|
634
632
|
}) {
|
|
635
633
|
const ctx = useStateContext();
|
|
636
634
|
const { columnWrapperStyle, animatedScrollY } = ctx;
|
|
635
|
+
const stickyPositionComponentInternal = ctx.state.props.stickyPositionComponentInternal;
|
|
637
636
|
const [column = 0, span = 1, data, itemKey, numColumns = 1, extraData, isSticky] = useArr$([
|
|
638
637
|
`containerColumn${id}`,
|
|
639
638
|
`containerSpan${id}`,
|
|
@@ -786,7 +785,7 @@ var Container = typedMemo(function Container2({
|
|
|
786
785
|
}
|
|
787
786
|
}, [itemKey]);
|
|
788
787
|
}
|
|
789
|
-
const PositionComponent = isSticky ? PositionViewSticky : PositionView;
|
|
788
|
+
const PositionComponent = isSticky ? stickyPositionComponentInternal ? stickyPositionComponentInternal : PositionViewSticky : PositionView;
|
|
790
789
|
return /* @__PURE__ */ React2.createElement(
|
|
791
790
|
PositionComponent,
|
|
792
791
|
{
|
|
@@ -897,7 +896,7 @@ var LayoutView = ({ onLayoutChange, refView, ...rest }) => {
|
|
|
897
896
|
};
|
|
898
897
|
|
|
899
898
|
// src/components/ListComponent.tsx
|
|
900
|
-
var ListComponent =
|
|
899
|
+
var ListComponent = typedMemo2(function ListComponent2({
|
|
901
900
|
canRender,
|
|
902
901
|
style,
|
|
903
902
|
contentContainerStyle,
|
|
@@ -928,7 +927,9 @@ var ListComponent = typedMemo(function ListComponent2({
|
|
|
928
927
|
const ctx = useStateContext();
|
|
929
928
|
const maintainVisibleContentPosition = ctx.state.props.maintainVisibleContentPosition;
|
|
930
929
|
const ScrollComponent = renderScrollComponent ? useMemo(
|
|
931
|
-
() => React2.forwardRef(
|
|
930
|
+
() => React2.forwardRef(
|
|
931
|
+
(props, ref) => renderScrollComponent({ ...props, ref })
|
|
932
|
+
),
|
|
932
933
|
[renderScrollComponent]
|
|
933
934
|
) : ListComponentScrollView;
|
|
934
935
|
const SnapOrScroll = snapToIndices ? SnapWrapper : ScrollComponent;
|
|
@@ -1121,12 +1122,15 @@ function calculateOffsetWithOffsetPosition(ctx, offsetParam, params) {
|
|
|
1121
1122
|
}
|
|
1122
1123
|
|
|
1123
1124
|
// src/core/clampScrollOffset.ts
|
|
1124
|
-
function clampScrollOffset(ctx, offset) {
|
|
1125
|
+
function clampScrollOffset(ctx, offset, scrollTarget) {
|
|
1125
1126
|
const state = ctx.state;
|
|
1126
1127
|
const contentSize = getContentSize(ctx);
|
|
1127
1128
|
let clampedOffset = offset;
|
|
1128
1129
|
if (Number.isFinite(contentSize) && Number.isFinite(state.scrollLength) && (Platform2.OS !== "android" || state.lastLayout)) {
|
|
1129
|
-
const
|
|
1130
|
+
const baseMaxOffset = Math.max(0, contentSize - state.scrollLength);
|
|
1131
|
+
const viewOffset = scrollTarget == null ? void 0 : scrollTarget.viewOffset;
|
|
1132
|
+
const extraEndOffset = typeof viewOffset === "number" && viewOffset < 0 ? -viewOffset : 0;
|
|
1133
|
+
const maxOffset = baseMaxOffset + extraEndOffset;
|
|
1130
1134
|
clampedOffset = Math.min(offset, maxOffset);
|
|
1131
1135
|
}
|
|
1132
1136
|
clampedOffset = Math.max(0, clampedOffset);
|
|
@@ -1221,7 +1225,7 @@ function checkAtBottom(ctx) {
|
|
|
1221
1225
|
function checkAtTop(ctx) {
|
|
1222
1226
|
var _a3;
|
|
1223
1227
|
const state = ctx == null ? void 0 : ctx.state;
|
|
1224
|
-
if (!state || state.initialScroll) {
|
|
1228
|
+
if (!state || state.initialScroll || state.scrollingTo) {
|
|
1225
1229
|
return;
|
|
1226
1230
|
}
|
|
1227
1231
|
const {
|
|
@@ -1265,14 +1269,22 @@ function setInitialRenderState(ctx, {
|
|
|
1265
1269
|
didInitialScroll
|
|
1266
1270
|
}) {
|
|
1267
1271
|
const { state } = ctx;
|
|
1272
|
+
const {
|
|
1273
|
+
loadStartTime,
|
|
1274
|
+
props: { onLoad }
|
|
1275
|
+
} = state;
|
|
1268
1276
|
if (didLayout) {
|
|
1269
1277
|
state.didContainersLayout = true;
|
|
1270
1278
|
}
|
|
1271
1279
|
if (didInitialScroll) {
|
|
1272
1280
|
state.didFinishInitialScroll = true;
|
|
1273
1281
|
}
|
|
1274
|
-
|
|
1282
|
+
const isReadyToRender = Boolean(state.didContainersLayout && state.didFinishInitialScroll);
|
|
1283
|
+
if (isReadyToRender && !peek$(ctx, "readyToRender")) {
|
|
1275
1284
|
set$(ctx, "readyToRender", true);
|
|
1285
|
+
if (onLoad) {
|
|
1286
|
+
onLoad({ elapsedTimeInMs: Date.now() - loadStartTime });
|
|
1287
|
+
}
|
|
1276
1288
|
}
|
|
1277
1289
|
}
|
|
1278
1290
|
|
|
@@ -1311,8 +1323,12 @@ function checkFinishedScrollFrame(ctx) {
|
|
|
1311
1323
|
state.animFrameCheckFinishedScroll = void 0;
|
|
1312
1324
|
const scroll = state.scrollPending;
|
|
1313
1325
|
const adjust = state.scrollAdjustHandler.getAdjust();
|
|
1314
|
-
const clampedTargetOffset = clampScrollOffset(
|
|
1315
|
-
|
|
1326
|
+
const clampedTargetOffset = clampScrollOffset(
|
|
1327
|
+
ctx,
|
|
1328
|
+
scrollingTo.offset - (scrollingTo.viewOffset || 0),
|
|
1329
|
+
scrollingTo
|
|
1330
|
+
);
|
|
1331
|
+
const maxOffset = clampScrollOffset(ctx, scroll, scrollingTo);
|
|
1316
1332
|
const diff1 = Math.abs(scroll - clampedTargetOffset);
|
|
1317
1333
|
const diff2 = Math.abs(diff1 - adjust);
|
|
1318
1334
|
const isNotOverscrolled = Math.abs(scroll - maxOffset) < 1;
|
|
@@ -1379,7 +1395,7 @@ function scrollTo(ctx, params) {
|
|
|
1379
1395
|
clearTimeout(ctx.state.timeoutCheckFinishedScrollFallback);
|
|
1380
1396
|
}
|
|
1381
1397
|
let offset = precomputedWithViewOffset ? scrollTargetOffset : calculateOffsetWithOffsetPosition(ctx, scrollTargetOffset, scrollTarget);
|
|
1382
|
-
offset = clampScrollOffset(ctx, offset);
|
|
1398
|
+
offset = clampScrollOffset(ctx, offset, scrollTarget);
|
|
1383
1399
|
state.scrollHistory.length = 0;
|
|
1384
1400
|
if (!noScrollingTo) {
|
|
1385
1401
|
state.scrollingTo = scrollTarget;
|
|
@@ -1532,7 +1548,7 @@ function ensureInitialAnchor(ctx) {
|
|
|
1532
1548
|
}
|
|
1533
1549
|
const availableSpace = Math.max(0, scrollLength - size);
|
|
1534
1550
|
const desiredOffset = calculateOffsetForIndex(ctx, anchor.index) - ((_a3 = anchor.viewOffset) != null ? _a3 : 0) - ((_b = anchor.viewPosition) != null ? _b : 0) * availableSpace;
|
|
1535
|
-
const clampedDesiredOffset = clampScrollOffset(ctx, desiredOffset);
|
|
1551
|
+
const clampedDesiredOffset = clampScrollOffset(ctx, desiredOffset, anchor);
|
|
1536
1552
|
const delta = clampedDesiredOffset - scroll;
|
|
1537
1553
|
if (Math.abs(delta) <= INITIAL_ANCHOR_TOLERANCE) {
|
|
1538
1554
|
const settledTicks = ((_c = anchor.settledTicks) != null ? _c : 0) + 1;
|
|
@@ -1619,6 +1635,7 @@ function prepareMVCP(ctx, dataChanged) {
|
|
|
1619
1635
|
const idsInViewWithPositions = [];
|
|
1620
1636
|
const scrollTarget = scrollingTo == null ? void 0 : scrollingTo.index;
|
|
1621
1637
|
const scrollingToViewPosition = scrollingTo == null ? void 0 : scrollingTo.viewPosition;
|
|
1638
|
+
const isEndAnchoredScrollTarget = scrollTarget !== void 0 && state.props.data.length > 0 && scrollTarget >= state.props.data.length - 1 && (scrollingToViewPosition != null ? scrollingToViewPosition : 0) > 0;
|
|
1622
1639
|
const shouldMVCP = dataChanged ? mvcpData : mvcpScroll;
|
|
1623
1640
|
const indexByKey = state.indexByKey;
|
|
1624
1641
|
if (shouldMVCP) {
|
|
@@ -1687,7 +1704,7 @@ function prepareMVCP(ctx, dataChanged) {
|
|
|
1687
1704
|
if (newPosition !== void 0) {
|
|
1688
1705
|
const totalSize = getContentSize(ctx);
|
|
1689
1706
|
let diff = newPosition - prevPosition;
|
|
1690
|
-
if (diff !== 0 && state.scroll + state.scrollLength > totalSize) {
|
|
1707
|
+
if (diff !== 0 && isEndAnchoredScrollTarget && state.scroll + state.scrollLength > totalSize) {
|
|
1691
1708
|
if (diff > 0) {
|
|
1692
1709
|
diff = Math.max(0, totalSize - state.scroll - state.scrollLength);
|
|
1693
1710
|
} else {
|
|
@@ -2372,26 +2389,16 @@ function scrollToIndex(ctx, { index, viewOffset = 0, animated = true, viewPositi
|
|
|
2372
2389
|
// src/utils/setDidLayout.ts
|
|
2373
2390
|
function setDidLayout(ctx) {
|
|
2374
2391
|
const state = ctx.state;
|
|
2375
|
-
const {
|
|
2376
|
-
loadStartTime,
|
|
2377
|
-
initialScroll,
|
|
2378
|
-
props: { onLoad }
|
|
2379
|
-
} = state;
|
|
2392
|
+
const { initialScroll } = state;
|
|
2380
2393
|
state.queuedInitialLayout = true;
|
|
2381
2394
|
checkAtBottom(ctx);
|
|
2382
|
-
const setIt = () => {
|
|
2383
|
-
setInitialRenderState(ctx, { didLayout: true });
|
|
2384
|
-
if (onLoad) {
|
|
2385
|
-
onLoad({ elapsedTimeInMs: Date.now() - loadStartTime });
|
|
2386
|
-
}
|
|
2387
|
-
};
|
|
2388
2395
|
if ((initialScroll == null ? void 0 : initialScroll.index) !== void 0) {
|
|
2389
2396
|
const target = initialScroll;
|
|
2390
2397
|
const runScroll = () => scrollToIndex(ctx, { ...target, animated: false });
|
|
2391
2398
|
runScroll();
|
|
2392
2399
|
requestAnimationFrame(runScroll);
|
|
2393
2400
|
}
|
|
2394
|
-
|
|
2401
|
+
setInitialRenderState(ctx, { didLayout: true });
|
|
2395
2402
|
}
|
|
2396
2403
|
|
|
2397
2404
|
// src/core/calculateItemsInView.ts
|
|
@@ -3116,7 +3123,7 @@ function onScroll(ctx, event) {
|
|
|
3116
3123
|
}
|
|
3117
3124
|
let newScroll = event.nativeEvent.contentOffset[state.props.horizontal ? "x" : "y"];
|
|
3118
3125
|
if (state.scrollingTo && state.scrollingTo.offset >= newScroll) {
|
|
3119
|
-
const maxOffset = clampScrollOffset(ctx, newScroll);
|
|
3126
|
+
const maxOffset = clampScrollOffset(ctx, newScroll, state.scrollingTo);
|
|
3120
3127
|
if (newScroll !== maxOffset && Math.abs(newScroll - maxOffset) > 1) {
|
|
3121
3128
|
newScroll = maxOffset;
|
|
3122
3129
|
scrollTo(ctx, {
|
|
@@ -3169,7 +3176,7 @@ var ScrollAdjustHandler = class {
|
|
|
3169
3176
|
if ((scrollTarget == null ? void 0 : scrollTarget.index) !== void 0) {
|
|
3170
3177
|
const currentOffset = calculateOffsetForIndex(this.ctx, scrollTarget.index);
|
|
3171
3178
|
targetScroll = calculateOffsetWithOffsetPosition(this.ctx, currentOffset, scrollTarget);
|
|
3172
|
-
targetScroll = clampScrollOffset(this.ctx, targetScroll);
|
|
3179
|
+
targetScroll = clampScrollOffset(this.ctx, targetScroll, scrollTarget);
|
|
3173
3180
|
} else {
|
|
3174
3181
|
targetScroll = clampScrollOffset(this.ctx, state.scroll + pending);
|
|
3175
3182
|
}
|
|
@@ -3370,8 +3377,9 @@ function getWindowSize() {
|
|
|
3370
3377
|
}
|
|
3371
3378
|
var StyleSheet = StyleSheet$1;
|
|
3372
3379
|
function useStickyScrollHandler(stickyHeaderIndices, horizontal, ctx, onScroll2) {
|
|
3380
|
+
const shouldUseRnAnimatedEngine = !ctx.state.props.stickyPositionComponentInternal;
|
|
3373
3381
|
return useMemo(() => {
|
|
3374
|
-
if (stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.length) {
|
|
3382
|
+
if ((stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.length) && shouldUseRnAnimatedEngine) {
|
|
3375
3383
|
const { animatedScrollY } = ctx;
|
|
3376
3384
|
return Animated.event(
|
|
3377
3385
|
[
|
|
@@ -3388,7 +3396,7 @@ function useStickyScrollHandler(stickyHeaderIndices, horizontal, ctx, onScroll2)
|
|
|
3388
3396
|
);
|
|
3389
3397
|
}
|
|
3390
3398
|
return onScroll2;
|
|
3391
|
-
}, [stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.join(","), horizontal]);
|
|
3399
|
+
}, [stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.join(","), horizontal, shouldUseRnAnimatedEngine]);
|
|
3392
3400
|
}
|
|
3393
3401
|
|
|
3394
3402
|
// src/utils/createColumnWrapperStyle.ts
|
|
@@ -3424,7 +3432,30 @@ function createImperativeHandle(ctx) {
|
|
|
3424
3432
|
}
|
|
3425
3433
|
};
|
|
3426
3434
|
const refScroller = state.refScroller;
|
|
3435
|
+
const clearCaches = (options) => {
|
|
3436
|
+
var _a3, _b;
|
|
3437
|
+
const mode = (_a3 = options == null ? void 0 : options.mode) != null ? _a3 : "sizes";
|
|
3438
|
+
state.sizes.clear();
|
|
3439
|
+
state.sizesKnown.clear();
|
|
3440
|
+
for (const key in state.averageSizes) {
|
|
3441
|
+
delete state.averageSizes[key];
|
|
3442
|
+
}
|
|
3443
|
+
state.minIndexSizeChanged = 0;
|
|
3444
|
+
state.scrollForNextCalculateItemsInView = void 0;
|
|
3445
|
+
state.pendingTotalSize = void 0;
|
|
3446
|
+
state.totalSize = 0;
|
|
3447
|
+
set$(ctx, "totalSize", 0);
|
|
3448
|
+
if (mode === "full") {
|
|
3449
|
+
state.indexByKey.clear();
|
|
3450
|
+
state.idCache.length = 0;
|
|
3451
|
+
state.positions.clear();
|
|
3452
|
+
state.columns.clear();
|
|
3453
|
+
state.columnSpans.clear();
|
|
3454
|
+
}
|
|
3455
|
+
(_b = state.triggerCalculateItemsInView) == null ? void 0 : _b.call(state, { forceFullItemPositions: true });
|
|
3456
|
+
};
|
|
3427
3457
|
return {
|
|
3458
|
+
clearCaches,
|
|
3428
3459
|
flashScrollIndicators: () => refScroller.current.flashScrollIndicators(),
|
|
3429
3460
|
getNativeScrollRef: () => refScroller.current,
|
|
3430
3461
|
getScrollableNode: () => refScroller.current.getScrollableNode(),
|
|
@@ -3585,8 +3616,8 @@ function normalizeMaintainVisibleContentPosition(value) {
|
|
|
3585
3616
|
if (value && typeof value === "object") {
|
|
3586
3617
|
return {
|
|
3587
3618
|
data: (_a3 = value.data) != null ? _a3 : false,
|
|
3588
|
-
|
|
3589
|
-
|
|
3619
|
+
shouldRestorePosition: value.shouldRestorePosition,
|
|
3620
|
+
size: (_b = value.size) != null ? _b : true
|
|
3590
3621
|
};
|
|
3591
3622
|
}
|
|
3592
3623
|
if (value === false) {
|
|
@@ -3658,7 +3689,7 @@ function useThrottledOnScroll(originalHandler, scrollEventThrottle) {
|
|
|
3658
3689
|
}
|
|
3659
3690
|
|
|
3660
3691
|
// src/components/LegendList.tsx
|
|
3661
|
-
var LegendList =
|
|
3692
|
+
var LegendList = typedMemo2(
|
|
3662
3693
|
// biome-ignore lint/nursery/noShadow: const function name shadowing is intentional
|
|
3663
3694
|
typedForwardRef(function LegendList2(props, forwardedRef) {
|
|
3664
3695
|
const { children, data: dataProp, renderItem: renderItemProp, ...restProps } = props;
|
|
@@ -3739,7 +3770,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3739
3770
|
...rest
|
|
3740
3771
|
} = props;
|
|
3741
3772
|
const animatedPropsInternal = props.animatedPropsInternal;
|
|
3742
|
-
const
|
|
3773
|
+
const stickyPositionComponentInternal = props.stickyPositionComponentInternal;
|
|
3774
|
+
const {
|
|
3775
|
+
childrenMode,
|
|
3776
|
+
stickyPositionComponentInternal: _stickyPositionComponentInternal,
|
|
3777
|
+
...restProps
|
|
3778
|
+
} = rest;
|
|
3743
3779
|
const contentContainerStyleBase = StyleSheet.flatten(contentContainerStyleProp);
|
|
3744
3780
|
const shouldFlexGrow = alignItemsAtEnd && (horizontal ? (contentContainerStyleBase == null ? void 0 : contentContainerStyleBase.minWidth) == null : (contentContainerStyleBase == null ? void 0 : contentContainerStyleBase.minHeight) == null);
|
|
3745
3781
|
const contentContainerStyle = {
|
|
@@ -3915,6 +3951,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3915
3951
|
snapToIndices,
|
|
3916
3952
|
stickyIndicesArr: stickyHeaderIndices != null ? stickyHeaderIndices : [],
|
|
3917
3953
|
stickyIndicesSet: useMemo(() => new Set(stickyHeaderIndices != null ? stickyHeaderIndices : []), [stickyHeaderIndices == null ? void 0 : stickyHeaderIndices.join(",")]),
|
|
3954
|
+
stickyPositionComponentInternal,
|
|
3918
3955
|
stylePaddingBottom: stylePaddingBottomState,
|
|
3919
3956
|
stylePaddingTop: stylePaddingTopState,
|
|
3920
3957
|
suggestEstimatedItemSize: !!suggestEstimatedItemSize
|
|
@@ -3968,7 +4005,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
3968
4005
|
} else {
|
|
3969
4006
|
const baseOffset = initialScroll.index !== void 0 ? calculateOffsetForIndex(ctx, initialScroll.index) : 0;
|
|
3970
4007
|
const resolvedOffset = calculateOffsetWithOffsetPosition(ctx, baseOffset, initialScroll);
|
|
3971
|
-
const clampedOffset = clampScrollOffset(ctx, resolvedOffset);
|
|
4008
|
+
const clampedOffset = clampScrollOffset(ctx, resolvedOffset, initialScroll);
|
|
3972
4009
|
const updatedInitialScroll = { ...initialScroll, contentOffset: clampedOffset };
|
|
3973
4010
|
refState.current.initialScroll = updatedInitialScroll;
|
|
3974
4011
|
state.initialScroll = updatedInitialScroll;
|
|
@@ -4124,7 +4161,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
4124
4161
|
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
|
4125
4162
|
ListComponent,
|
|
4126
4163
|
{
|
|
4127
|
-
...
|
|
4164
|
+
...restProps,
|
|
4128
4165
|
alignItemsAtEnd,
|
|
4129
4166
|
canRender,
|
|
4130
4167
|
contentContainerStyle,
|
|
@@ -4161,4 +4198,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
4161
4198
|
), IS_DEV && ENABLE_DEBUG_VIEW);
|
|
4162
4199
|
});
|
|
4163
4200
|
|
|
4164
|
-
|
|
4201
|
+
// src/index.ts
|
|
4202
|
+
var LegendList3 = LegendList;
|
|
4203
|
+
if (IS_DEV) {
|
|
4204
|
+
console.warn(
|
|
4205
|
+
"[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."
|
|
4206
|
+
);
|
|
4207
|
+
}
|
|
4208
|
+
|
|
4209
|
+
export { LegendList3 as LegendList, typedForwardRef, typedMemo2 as typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
|