@legendapp/list 3.3.10 → 3.4.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 +17 -0
- package/animated.d.ts +6 -0
- package/keyboard.d.ts +1 -1
- package/keyboard.js +2 -4
- package/keyboard.mjs +2 -4
- package/package.json +1 -1
- package/react-native.d.ts +6 -0
- package/react-native.js +715 -536
- package/react-native.mjs +715 -536
- package/react-native.web.d.ts +8 -0
- package/react-native.web.js +547 -342
- package/react-native.web.mjs +547 -342
- package/react.d.ts +8 -0
- package/react.js +547 -342
- package/react.mjs +547 -342
- package/reanimated.d.ts +6 -0
- package/section-list.d.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## 3.4.0
|
|
2
|
+
|
|
3
|
+
- Feat: Add `onReady`, called after each initial placement and scroll cycle completes, including cycles restarted by a `dataKey` change.
|
|
4
|
+
- Fix: End-following and animated programmatic scrolling now stay aligned through footer, viewport, and native layout changes, while user dragging cancels queued follow requests.
|
|
5
|
+
- Fix: `onStartReached` and `onEndReached` callbacks now fire reliably after layout and dataset resets, including short lists and gestures that cross a threshold over multiple events.
|
|
6
|
+
- Fix: Numeric `initialScrollIndex` values that target the last row now include the footer when opening at the end.
|
|
7
|
+
- Perf: Fast scrolling now prepares rows in the direction you are moving, including upward and end-aligned scrolling, so the next content is ready sooner.
|
|
8
|
+
|
|
9
|
+
## 3.3.11
|
|
10
|
+
|
|
11
|
+
- Fix: `scrollToEnd` and `maintainScrollAtEnd` keep reaching the end as content changes, while scrolling away or requesting another position cancels automatic following.
|
|
12
|
+
- Fix: Switching datasets cancels old scroll requests so they cannot override the new dataset's initial position.
|
|
13
|
+
- Fix: `anchoredEndSpace` shrinks excess blank space as rows are measured instead of waiting for every remaining row.
|
|
14
|
+
- Fix: Resizing the chat composer preserves the combined keyboard and composer spacing.
|
|
15
|
+
- Fix: Web scroll adjustments no longer leave extra padding at the end of the list.
|
|
16
|
+
- Fix: Web row reordering happens sooner when idle and preserves focus, animations, and embedded content state in browsers that support state-preserving moves.
|
|
17
|
+
|
|
1
18
|
## 3.3.10
|
|
2
19
|
|
|
3
20
|
- Fix: Changing `dataKey` no longer loses the new dataset's initial scroll position when React retries a render.
|
package/animated.d.ts
CHANGED
|
@@ -333,6 +333,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
333
333
|
onLoad?: (info: {
|
|
334
334
|
elapsedTimeInMs: number;
|
|
335
335
|
}) => void;
|
|
336
|
+
/**
|
|
337
|
+
* Called after layout and initial scrolling complete, including after a
|
|
338
|
+
* dataKey reset. Unlike onLoad, this runs for each initial placement cycle.
|
|
339
|
+
* Ordinary data updates do not trigger it unless they restart initial placement.
|
|
340
|
+
*/
|
|
341
|
+
onReady?: () => void;
|
|
336
342
|
/**
|
|
337
343
|
* Called when list layout metrics change.
|
|
338
344
|
*/
|
package/keyboard.d.ts
CHANGED
|
@@ -281,7 +281,7 @@ type KeyboardChatComposerInsetListRef = {
|
|
|
281
281
|
type KeyboardChatComposerRef = {
|
|
282
282
|
current: Pick<View, "measure"> | null;
|
|
283
283
|
};
|
|
284
|
-
declare function useKeyboardChatComposerInset(
|
|
284
|
+
declare function useKeyboardChatComposerInset(_listRef: KeyboardChatComposerInsetListRef, composerRef: KeyboardChatComposerRef, initialHeight?: number): {
|
|
285
285
|
contentInsetEndAdjustment: SharedValue<number>;
|
|
286
286
|
onComposerLayout: (event: LayoutChangeEvent) => void;
|
|
287
287
|
};
|
package/keyboard.js
CHANGED
|
@@ -33,19 +33,17 @@ if (typeof __DEV__ !== "undefined" && __DEV__ && !reactNativeKeyboardController.
|
|
|
33
33
|
"[legend-list] KeyboardAwareLegendList requires a recent react-native-keyboard-controller with KeyboardChatScrollView. Please upgrade react-native-keyboard-controller to at least 1.21.7."
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
|
-
function useKeyboardChatComposerInset(
|
|
36
|
+
function useKeyboardChatComposerInset(_listRef, composerRef, initialHeight = 0) {
|
|
37
37
|
const contentInsetEndAdjustment = reactNativeReanimated.useSharedValue(initialHeight);
|
|
38
38
|
const lastHeightRef = React.useRef(void 0);
|
|
39
39
|
const reportHeight = React.useCallback(
|
|
40
40
|
(height) => {
|
|
41
|
-
var _a;
|
|
42
41
|
if (Number.isFinite(height) && height !== lastHeightRef.current) {
|
|
43
42
|
lastHeightRef.current = height;
|
|
44
43
|
contentInsetEndAdjustment.value = height;
|
|
45
|
-
(_a = listRef.current) == null ? void 0 : _a.reportContentInset({ bottom: height });
|
|
46
44
|
}
|
|
47
45
|
},
|
|
48
|
-
[contentInsetEndAdjustment
|
|
46
|
+
[contentInsetEndAdjustment]
|
|
49
47
|
);
|
|
50
48
|
React.useLayoutEffect(() => {
|
|
51
49
|
var _a;
|
package/keyboard.mjs
CHANGED
|
@@ -12,19 +12,17 @@ if (typeof __DEV__ !== "undefined" && __DEV__ && !KeyboardChatScrollView) {
|
|
|
12
12
|
"[legend-list] KeyboardAwareLegendList requires a recent react-native-keyboard-controller with KeyboardChatScrollView. Please upgrade react-native-keyboard-controller to at least 1.21.7."
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
|
-
function useKeyboardChatComposerInset(
|
|
15
|
+
function useKeyboardChatComposerInset(_listRef, composerRef, initialHeight = 0) {
|
|
16
16
|
const contentInsetEndAdjustment = useSharedValue(initialHeight);
|
|
17
17
|
const lastHeightRef = useRef(void 0);
|
|
18
18
|
const reportHeight = useCallback(
|
|
19
19
|
(height) => {
|
|
20
|
-
var _a;
|
|
21
20
|
if (Number.isFinite(height) && height !== lastHeightRef.current) {
|
|
22
21
|
lastHeightRef.current = height;
|
|
23
22
|
contentInsetEndAdjustment.value = height;
|
|
24
|
-
(_a = listRef.current) == null ? void 0 : _a.reportContentInset({ bottom: height });
|
|
25
23
|
}
|
|
26
24
|
},
|
|
27
|
-
[contentInsetEndAdjustment
|
|
25
|
+
[contentInsetEndAdjustment]
|
|
28
26
|
);
|
|
29
27
|
useLayoutEffect(() => {
|
|
30
28
|
var _a;
|
package/package.json
CHANGED
package/react-native.d.ts
CHANGED
|
@@ -333,6 +333,12 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
333
333
|
onLoad?: (info: {
|
|
334
334
|
elapsedTimeInMs: number;
|
|
335
335
|
}) => void;
|
|
336
|
+
/**
|
|
337
|
+
* Called after layout and initial scrolling complete, including after a
|
|
338
|
+
* dataKey reset. Unlike onLoad, this runs for each initial placement cycle.
|
|
339
|
+
* Ordinary data updates do not trigger it unless they restart initial placement.
|
|
340
|
+
*/
|
|
341
|
+
onReady?: () => void;
|
|
336
342
|
/**
|
|
337
343
|
* Called when list layout metrics change.
|
|
338
344
|
*/
|