@legendapp/list 3.1.1 → 3.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 +10 -0
- package/animated.d.ts +17 -3
- package/package.json +1 -1
- package/react-native.d.ts +17 -3
- package/react-native.js +2060 -1965
- package/react-native.mjs +2060 -1965
- package/react-native.web.d.ts +17 -3
- package/react-native.web.js +4789 -4679
- package/react-native.web.mjs +4789 -4679
- package/react.d.ts +17 -3
- package/react.js +4789 -4679
- package/react.mjs +4789 -4679
- package/reanimated.d.ts +17 -3
- package/section-list.d.ts +17 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 3.2.0
|
|
2
|
+
|
|
3
|
+
- Feat: Add `onFirstVisibleItemChanged` so apps can track the item at the top of the viewport without setting up full viewability callbacks.
|
|
4
|
+
- Feat: Add `experimental_adaptiveRender.initialMode` for choosing whether adaptive rendering starts in `normal` or `light` mode before the list is ready.
|
|
5
|
+
- Perf: On Fabric, replacement container measurements are batched into the same layout pass, so scroll anchoring and item positioning recalculate once instead of once per pending row.
|
|
6
|
+
|
|
7
|
+
## 3.1.2
|
|
8
|
+
|
|
9
|
+
- Fix: On Android, end-aligned lists could double apply scroll clamping during MVCP and be slightly underscrolled
|
|
10
|
+
|
|
1
11
|
## 3.1.1
|
|
2
12
|
|
|
3
13
|
- Fix: `maintainScrollAtEnd` now stays pinned when a `ListFooterComponent` appears, disappears, or changes size, so chat typing indicators and other dynamic footers do not leave the list slightly above the end. If you use an explicit `maintainScrollAtEnd.on` config, add `footerLayout` to opt into footer size changes.
|
package/animated.d.ts
CHANGED
|
@@ -93,19 +93,24 @@ type ViewStyle = Record<string, unknown>;
|
|
|
93
93
|
type StyleProp<T> = T | T[] | null | undefined | false;
|
|
94
94
|
type AdaptiveRender = "normal" | "light";
|
|
95
95
|
interface AdaptiveRenderConfig {
|
|
96
|
+
/**
|
|
97
|
+
* Mode to use before the list is ready to render.
|
|
98
|
+
* @default "normal"
|
|
99
|
+
*/
|
|
100
|
+
initialMode?: AdaptiveRender;
|
|
96
101
|
/**
|
|
97
102
|
* Scroll velocity in pixels per millisecond above which items should switch to light mode.
|
|
98
|
-
* @default
|
|
103
|
+
* @default 3 native, 6 web
|
|
99
104
|
*/
|
|
100
105
|
enterVelocity?: number;
|
|
101
106
|
/**
|
|
102
107
|
* Scroll velocity in pixels per millisecond below which items can return to normal mode.
|
|
103
|
-
* @default 1
|
|
108
|
+
* @default 1 native, 3 web
|
|
104
109
|
*/
|
|
105
110
|
exitVelocity?: number;
|
|
106
111
|
/**
|
|
107
112
|
* Time to wait without velocity above exitVelocity before returning to normal mode.
|
|
108
|
-
* @default
|
|
113
|
+
* @default 250
|
|
109
114
|
*/
|
|
110
115
|
exitDelay?: number;
|
|
111
116
|
/**
|
|
@@ -321,6 +326,15 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
321
326
|
* Called when list layout metrics change.
|
|
322
327
|
*/
|
|
323
328
|
onMetricsChange?: (metrics: LegendListMetrics) => void;
|
|
329
|
+
/**
|
|
330
|
+
* Called when the first visible item changes. This is emitted from the core range calculation and is cheaper than
|
|
331
|
+
* viewability tracking when you only need to follow the item at the top of the viewport.
|
|
332
|
+
*/
|
|
333
|
+
onFirstVisibleItemChanged?: (info: {
|
|
334
|
+
index: number;
|
|
335
|
+
item: ItemT;
|
|
336
|
+
key: string;
|
|
337
|
+
}) => void;
|
|
324
338
|
/**
|
|
325
339
|
* Configures the adaptive render signal. Items can use this to render a lighter version while scrolling quickly.
|
|
326
340
|
*/
|
package/package.json
CHANGED
package/react-native.d.ts
CHANGED
|
@@ -93,19 +93,24 @@ type ViewStyle = Record<string, unknown>;
|
|
|
93
93
|
type StyleProp<T> = T | T[] | null | undefined | false;
|
|
94
94
|
type AdaptiveRender = "normal" | "light";
|
|
95
95
|
interface AdaptiveRenderConfig {
|
|
96
|
+
/**
|
|
97
|
+
* Mode to use before the list is ready to render.
|
|
98
|
+
* @default "normal"
|
|
99
|
+
*/
|
|
100
|
+
initialMode?: AdaptiveRender;
|
|
96
101
|
/**
|
|
97
102
|
* Scroll velocity in pixels per millisecond above which items should switch to light mode.
|
|
98
|
-
* @default
|
|
103
|
+
* @default 3 native, 6 web
|
|
99
104
|
*/
|
|
100
105
|
enterVelocity?: number;
|
|
101
106
|
/**
|
|
102
107
|
* Scroll velocity in pixels per millisecond below which items can return to normal mode.
|
|
103
|
-
* @default 1
|
|
108
|
+
* @default 1 native, 3 web
|
|
104
109
|
*/
|
|
105
110
|
exitVelocity?: number;
|
|
106
111
|
/**
|
|
107
112
|
* Time to wait without velocity above exitVelocity before returning to normal mode.
|
|
108
|
-
* @default
|
|
113
|
+
* @default 250
|
|
109
114
|
*/
|
|
110
115
|
exitDelay?: number;
|
|
111
116
|
/**
|
|
@@ -321,6 +326,15 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
321
326
|
* Called when list layout metrics change.
|
|
322
327
|
*/
|
|
323
328
|
onMetricsChange?: (metrics: LegendListMetrics) => void;
|
|
329
|
+
/**
|
|
330
|
+
* Called when the first visible item changes. This is emitted from the core range calculation and is cheaper than
|
|
331
|
+
* viewability tracking when you only need to follow the item at the top of the viewport.
|
|
332
|
+
*/
|
|
333
|
+
onFirstVisibleItemChanged?: (info: {
|
|
334
|
+
index: number;
|
|
335
|
+
item: ItemT;
|
|
336
|
+
key: string;
|
|
337
|
+
}) => void;
|
|
324
338
|
/**
|
|
325
339
|
* Configures the adaptive render signal. Items can use this to render a lighter version while scrolling quickly.
|
|
326
340
|
*/
|