@legendapp/list 3.3.6 → 3.3.8
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 +8 -0
- package/animated.d.ts +17 -1
- package/keyboard-legacy.d.ts +3 -1
- package/keyboard.d.ts +3 -1
- package/package.json +1 -1
- package/react-native.d.ts +17 -1
- package/react-native.js +98 -31
- package/react-native.mjs +98 -31
- package/react-native.web.d.ts +17 -1
- package/react-native.web.js +53 -24
- package/react-native.web.mjs +53 -24
- package/react.d.ts +17 -1
- package/react.js +53 -24
- package/react.mjs +53 -24
- package/reanimated.d.ts +17 -1
- package/reanimated.js +8 -4
- package/reanimated.mjs +8 -4
- package/section-list.d.ts +17 -1
package/reanimated.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ interface MaintainVisibleContentPositionNormalized<ItemT = any> {
|
|
|
9
9
|
shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
type ListenerType = "activeStickyIndex" | "alignItemsAtEndPadding" | "anchoredEndSpaceSize" | "containerLayoutEpoch" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemIndex${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
|
|
12
|
+
type ListenerType = "activeStickyIndex" | "alignItemsAtEndPadding" | "anchoredEndSpaceSize" | "containerLayoutEpoch" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemIndex${number}` | `containerItemKey${number}` | `containerLayoutReady${number}` | `containerPosition${number}` | `containerSticky${number}`;
|
|
13
13
|
type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "anchoredEndSpaceSize" | "footerSize" | "headerSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
|
|
14
14
|
type ListenerTypeValueMap = {
|
|
15
15
|
activeStickyIndex: number;
|
|
@@ -48,6 +48,8 @@ type ListenerTypeValueMap = {
|
|
|
48
48
|
adaptiveRender: "normal" | "light";
|
|
49
49
|
} & {
|
|
50
50
|
[K in ListenerType as K extends `containerItemKey${number}` ? K : never]: string;
|
|
51
|
+
} & {
|
|
52
|
+
[K in ListenerType as K extends `containerLayoutReady${number}` ? K : never]: boolean;
|
|
51
53
|
} & {
|
|
52
54
|
[K in ListenerType as K extends `containerItemData${number}` ? K : never]: any;
|
|
53
55
|
} & {
|
|
@@ -349,6 +351,20 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
349
351
|
* Configures the adaptive render signal. Items can use this to render a lighter version while scrolling quickly.
|
|
350
352
|
*/
|
|
351
353
|
experimental_adaptiveRender?: AdaptiveRenderConfig;
|
|
354
|
+
/**
|
|
355
|
+
* Keeps a newly recycled item laid out but invisible until its size has been measured, so it is never painted at
|
|
356
|
+
* the estimated position it was recycled to. Only applies on the new architecture.
|
|
357
|
+
*
|
|
358
|
+
* This trades a possible flash at the wrong position for an extra render and native commit per recycled row, so it
|
|
359
|
+
* is worth enabling only for lists with dynamically sized items whose estimates are visibly wrong. Items with a
|
|
360
|
+
* size from `getFixedItemSize`, or with an already measured size, are exact and render immediately either way.
|
|
361
|
+
*
|
|
362
|
+
* Sticky headers are intentionally excluded. They are painted from a scroll-driven interpolation rather than the
|
|
363
|
+
* committed position, so hiding them would blink a header out mid-scroll without preventing a flash.
|
|
364
|
+
*
|
|
365
|
+
* @default false
|
|
366
|
+
*/
|
|
367
|
+
experimental_hideItemsUntilMeasured?: boolean;
|
|
352
368
|
/**
|
|
353
369
|
* Function to call when the user pulls to refresh.
|
|
354
370
|
*/
|
package/reanimated.js
CHANGED
|
@@ -113,7 +113,10 @@ var ReanimatedPositionViewSticky = typedMemo(function ReanimatedPositionViewStic
|
|
|
113
113
|
var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent(props) {
|
|
114
114
|
const ctx = useStateContext();
|
|
115
115
|
const { id, horizontal, style, refView, children, recycleItems, layoutTransition, ...rest } = props;
|
|
116
|
-
const [positionValue = POSITION_OUT_OF_VIEW] = useArr$([
|
|
116
|
+
const [positionValue = POSITION_OUT_OF_VIEW, layoutReady = true] = useArr$([
|
|
117
|
+
`containerPosition${id}`,
|
|
118
|
+
`containerLayoutReady${id}`
|
|
119
|
+
]);
|
|
117
120
|
const prevItemKeyRef = React__namespace.useRef(void 0);
|
|
118
121
|
let shouldSkipTransitionForRecycleReuse = false;
|
|
119
122
|
if (recycleItems && layoutTransition) {
|
|
@@ -127,8 +130,8 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent(
|
|
|
127
130
|
prevItemKeyRef.current = void 0;
|
|
128
131
|
}
|
|
129
132
|
const viewStyle = React__namespace.useMemo(
|
|
130
|
-
() => [style, horizontal ? { left: positionValue } : { top: positionValue }],
|
|
131
|
-
[horizontal, positionValue, style]
|
|
133
|
+
() => [style, horizontal ? { left: positionValue } : { top: positionValue }, !layoutReady && { opacity: 0 }],
|
|
134
|
+
[horizontal, layoutReady, positionValue, style]
|
|
132
135
|
);
|
|
133
136
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
134
137
|
Reanimated__default.default.View,
|
|
@@ -136,7 +139,8 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent(
|
|
|
136
139
|
layout: shouldSkipTransitionForRecycleReuse ? void 0 : layoutTransition,
|
|
137
140
|
ref: refView,
|
|
138
141
|
style: viewStyle,
|
|
139
|
-
...rest
|
|
142
|
+
...rest,
|
|
143
|
+
pointerEvents: layoutReady ? void 0 : "none"
|
|
140
144
|
},
|
|
141
145
|
children
|
|
142
146
|
);
|
package/reanimated.mjs
CHANGED
|
@@ -89,7 +89,10 @@ var ReanimatedPositionViewSticky = typedMemo(function ReanimatedPositionViewStic
|
|
|
89
89
|
var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent(props) {
|
|
90
90
|
const ctx = useStateContext();
|
|
91
91
|
const { id, horizontal, style, refView, children, recycleItems, layoutTransition, ...rest } = props;
|
|
92
|
-
const [positionValue = POSITION_OUT_OF_VIEW] = useArr$([
|
|
92
|
+
const [positionValue = POSITION_OUT_OF_VIEW, layoutReady = true] = useArr$([
|
|
93
|
+
`containerPosition${id}`,
|
|
94
|
+
`containerLayoutReady${id}`
|
|
95
|
+
]);
|
|
93
96
|
const prevItemKeyRef = React.useRef(void 0);
|
|
94
97
|
let shouldSkipTransitionForRecycleReuse = false;
|
|
95
98
|
if (recycleItems && layoutTransition) {
|
|
@@ -103,8 +106,8 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent(
|
|
|
103
106
|
prevItemKeyRef.current = void 0;
|
|
104
107
|
}
|
|
105
108
|
const viewStyle = React.useMemo(
|
|
106
|
-
() => [style, horizontal ? { left: positionValue } : { top: positionValue }],
|
|
107
|
-
[horizontal, positionValue, style]
|
|
109
|
+
() => [style, horizontal ? { left: positionValue } : { top: positionValue }, !layoutReady && { opacity: 0 }],
|
|
110
|
+
[horizontal, layoutReady, positionValue, style]
|
|
108
111
|
);
|
|
109
112
|
return /* @__PURE__ */ React.createElement(
|
|
110
113
|
Reanimated.View,
|
|
@@ -112,7 +115,8 @@ var ReanimatedPositionView = typedMemo(function ReanimatedPositionViewComponent(
|
|
|
112
115
|
layout: shouldSkipTransitionForRecycleReuse ? void 0 : layoutTransition,
|
|
113
116
|
ref: refView,
|
|
114
117
|
style: viewStyle,
|
|
115
|
-
...rest
|
|
118
|
+
...rest,
|
|
119
|
+
pointerEvents: layoutReady ? void 0 : "none"
|
|
116
120
|
},
|
|
117
121
|
children
|
|
118
122
|
);
|
package/section-list.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ interface MaintainVisibleContentPositionNormalized<ItemT = any> {
|
|
|
65
65
|
shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
type ListenerType = "activeStickyIndex" | "alignItemsAtEndPadding" | "anchoredEndSpaceSize" | "containerLayoutEpoch" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemIndex${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
|
|
68
|
+
type ListenerType = "activeStickyIndex" | "alignItemsAtEndPadding" | "anchoredEndSpaceSize" | "containerLayoutEpoch" | "debugComputedScroll" | "debugRawScroll" | "extraData" | "footerSize" | "headerSize" | "lastItemKeys" | "lastPositionUpdate" | "maintainVisibleContentPosition" | "numColumns" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "scrollAdjust" | "scrollAdjustPending" | "scrollAdjustUserOffset" | "scrollSize" | "snapToOffsets" | "stylePaddingTop" | "totalSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemIndex${number}` | `containerItemKey${number}` | `containerLayoutReady${number}` | `containerPosition${number}` | `containerSticky${number}`;
|
|
69
69
|
type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "anchoredEndSpaceSize" | "footerSize" | "headerSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "adaptiveRender" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
|
|
70
70
|
type ListenerTypeValueMap = {
|
|
71
71
|
activeStickyIndex: number;
|
|
@@ -104,6 +104,8 @@ type ListenerTypeValueMap = {
|
|
|
104
104
|
adaptiveRender: "normal" | "light";
|
|
105
105
|
} & {
|
|
106
106
|
[K in ListenerType as K extends `containerItemKey${number}` ? K : never]: string;
|
|
107
|
+
} & {
|
|
108
|
+
[K in ListenerType as K extends `containerLayoutReady${number}` ? K : never]: boolean;
|
|
107
109
|
} & {
|
|
108
110
|
[K in ListenerType as K extends `containerItemData${number}` ? K : never]: any;
|
|
109
111
|
} & {
|
|
@@ -405,6 +407,20 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
405
407
|
* Configures the adaptive render signal. Items can use this to render a lighter version while scrolling quickly.
|
|
406
408
|
*/
|
|
407
409
|
experimental_adaptiveRender?: AdaptiveRenderConfig;
|
|
410
|
+
/**
|
|
411
|
+
* Keeps a newly recycled item laid out but invisible until its size has been measured, so it is never painted at
|
|
412
|
+
* the estimated position it was recycled to. Only applies on the new architecture.
|
|
413
|
+
*
|
|
414
|
+
* This trades a possible flash at the wrong position for an extra render and native commit per recycled row, so it
|
|
415
|
+
* is worth enabling only for lists with dynamically sized items whose estimates are visibly wrong. Items with a
|
|
416
|
+
* size from `getFixedItemSize`, or with an already measured size, are exact and render immediately either way.
|
|
417
|
+
*
|
|
418
|
+
* Sticky headers are intentionally excluded. They are painted from a scroll-driven interpolation rather than the
|
|
419
|
+
* committed position, so hiding them would blink a header out mid-scroll without preventing a flash.
|
|
420
|
+
*
|
|
421
|
+
* @default false
|
|
422
|
+
*/
|
|
423
|
+
experimental_hideItemsUntilMeasured?: boolean;
|
|
408
424
|
/**
|
|
409
425
|
* Function to call when the user pulls to refresh.
|
|
410
426
|
*/
|