@legendapp/list 3.0.0-beta.20 → 3.0.0-beta.22
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/animated.native.d.mts +9 -0
- package/animated.native.d.ts +9 -0
- package/animated.native.js +9 -0
- package/animated.native.mjs +7 -0
- package/index.d.mts +33 -2
- package/index.d.ts +33 -2
- package/index.js +197 -24
- package/index.mjs +197 -24
- package/index.native.d.mts +802 -0
- package/index.native.d.ts +802 -0
- package/index.native.js +197 -23
- package/index.native.mjs +197 -23
- package/keyboard-controller.native.d.mts +12 -0
- package/keyboard-controller.native.d.ts +12 -0
- package/keyboard-controller.native.js +69 -0
- package/keyboard-controller.native.mjs +48 -0
- package/keyboard.js +148 -15
- package/keyboard.mjs +149 -16
- package/keyboard.native.d.mts +16 -0
- package/keyboard.native.d.ts +16 -0
- package/keyboard.native.js +361 -0
- package/keyboard.native.mjs +339 -0
- package/package.json +1 -1
- package/reanimated.native.d.mts +18 -0
- package/reanimated.native.d.ts +18 -0
- package/reanimated.native.js +89 -0
- package/reanimated.native.mjs +65 -0
- package/section-list.native.d.mts +112 -0
- package/section-list.native.d.ts +112 -0
- package/section-list.native.js +293 -0
- package/section-list.native.mjs +271 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as _legendapp_list from '@legendapp/list';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Animated } from 'react-native';
|
|
4
|
+
|
|
5
|
+
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: _legendapp_list.LegendListProps<T> & React.RefAttributes<_legendapp_list.LegendListRef>) => React.ReactNode) & {
|
|
6
|
+
displayName?: string;
|
|
7
|
+
}>;
|
|
8
|
+
|
|
9
|
+
export { AnimatedLegendList };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as _legendapp_list from '@legendapp/list';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Animated } from 'react-native';
|
|
4
|
+
|
|
5
|
+
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: _legendapp_list.LegendListProps<T> & React.RefAttributes<_legendapp_list.LegendListRef>) => React.ReactNode) & {
|
|
6
|
+
displayName?: string;
|
|
7
|
+
}>;
|
|
8
|
+
|
|
9
|
+
export { AnimatedLegendList };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var reactNative = require('react-native');
|
|
4
|
+
var list = require('@legendapp/list');
|
|
5
|
+
|
|
6
|
+
// src/integrations/animated.tsx
|
|
7
|
+
var AnimatedLegendList = reactNative.Animated.createAnimatedComponent(list.LegendList);
|
|
8
|
+
|
|
9
|
+
exports.AnimatedLegendList = AnimatedLegendList;
|
package/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import { ComponentProps, Key, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
3
|
-
import { View, ScrollView, Animated, LayoutRectangle,
|
|
3
|
+
import { View, ScrollView, Animated, LayoutRectangle, Insets, ScrollViewProps, ScrollViewComponent, ScrollResponderMixin, StyleProp, ViewStyle, NativeSyntheticEvent, NativeScrollEvent } from 'react-native';
|
|
4
4
|
import Reanimated from 'react-native-reanimated';
|
|
5
5
|
|
|
6
6
|
type AnimatedValue = number;
|
|
@@ -119,6 +119,11 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
119
119
|
* @default false
|
|
120
120
|
*/
|
|
121
121
|
alignItemsAtEnd?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Keeps selected items mounted even when they scroll out of view.
|
|
124
|
+
* @default undefined
|
|
125
|
+
*/
|
|
126
|
+
alwaysRender?: AlwaysRenderConfig;
|
|
122
127
|
/**
|
|
123
128
|
* Style applied to each column's wrapper view.
|
|
124
129
|
*/
|
|
@@ -255,6 +260,10 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
255
260
|
itemKey: string;
|
|
256
261
|
itemData: ItemT;
|
|
257
262
|
}) => void;
|
|
263
|
+
/**
|
|
264
|
+
* Called when list layout metrics change.
|
|
265
|
+
*/
|
|
266
|
+
onMetricsChange?: (metrics: LegendListMetrics) => void;
|
|
258
267
|
/**
|
|
259
268
|
* Function to call when the user pulls to refresh.
|
|
260
269
|
*/
|
|
@@ -374,6 +383,12 @@ interface StickyHeaderConfig {
|
|
|
374
383
|
*/
|
|
375
384
|
backdropComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
376
385
|
}
|
|
386
|
+
interface AlwaysRenderConfig {
|
|
387
|
+
top?: number;
|
|
388
|
+
bottom?: number;
|
|
389
|
+
indices?: number[];
|
|
390
|
+
keys?: string[];
|
|
391
|
+
}
|
|
377
392
|
interface MaintainScrollAtEndOptions {
|
|
378
393
|
onLayout?: boolean;
|
|
379
394
|
onItemLayout?: boolean;
|
|
@@ -384,6 +399,11 @@ interface ColumnWrapperStyle {
|
|
|
384
399
|
gap?: number;
|
|
385
400
|
columnGap?: number;
|
|
386
401
|
}
|
|
402
|
+
interface LegendListMetrics {
|
|
403
|
+
alignItemsAtEndPadding: number;
|
|
404
|
+
headerSize: number;
|
|
405
|
+
footerSize: number;
|
|
406
|
+
}
|
|
387
407
|
type LegendListProps<ItemT = any> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
|
|
388
408
|
interface ThresholdSnapshot {
|
|
389
409
|
scrollPosition: number;
|
|
@@ -446,6 +466,8 @@ interface InternalState {
|
|
|
446
466
|
loadStartTime: number;
|
|
447
467
|
maintainingScrollAtEnd?: boolean;
|
|
448
468
|
minIndexSizeChanged: number | undefined;
|
|
469
|
+
contentInsetOverride?: Partial<Insets> | null;
|
|
470
|
+
nativeContentInset?: Insets;
|
|
449
471
|
nativeMarginTop: number;
|
|
450
472
|
needsOtherAxisSize?: boolean;
|
|
451
473
|
otherAxisSize?: number;
|
|
@@ -495,6 +517,9 @@ interface InternalState {
|
|
|
495
517
|
props: {
|
|
496
518
|
alignItemsAtEnd: boolean;
|
|
497
519
|
animatedProps: StylesAsSharedValue<ScrollViewProps>;
|
|
520
|
+
alwaysRender: AlwaysRenderConfig | undefined;
|
|
521
|
+
alwaysRenderIndicesArr: number[];
|
|
522
|
+
alwaysRenderIndicesSet: Set<number>;
|
|
498
523
|
contentInset: Insets | undefined;
|
|
499
524
|
data: readonly any[];
|
|
500
525
|
dataVersion: Key | undefined;
|
|
@@ -558,6 +583,7 @@ type LegendListState = {
|
|
|
558
583
|
positions: Map<string, number>;
|
|
559
584
|
scroll: number;
|
|
560
585
|
scrollLength: number;
|
|
586
|
+
scrollVelocity: number;
|
|
561
587
|
sizeAtIndex: (index: number) => number;
|
|
562
588
|
sizes: Map<string, number>;
|
|
563
589
|
start: number;
|
|
@@ -663,6 +689,11 @@ type LegendListRef = {
|
|
|
663
689
|
* @param enabled - If true, scroll processing is enabled.
|
|
664
690
|
*/
|
|
665
691
|
setScrollProcessingEnabled(enabled: boolean): void;
|
|
692
|
+
/**
|
|
693
|
+
* Reports an externally measured content inset. Pass null/undefined to clear.
|
|
694
|
+
* Values are merged on top of props/animated/native insets.
|
|
695
|
+
*/
|
|
696
|
+
reportContentInset(inset?: Partial<Insets> | null): void;
|
|
666
697
|
};
|
|
667
698
|
interface ViewToken<ItemT = any> {
|
|
668
699
|
containerId: number;
|
|
@@ -768,4 +799,4 @@ declare function useListScrollSize(): {
|
|
|
768
799
|
};
|
|
769
800
|
declare function useSyncLayout(): () => void;
|
|
770
801
|
|
|
771
|
-
export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InitialScrollAnchor, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type LegendListState, type MaintainScrollAtEndOptions, type MaintainVisibleContentPositionConfig, type MaintainVisibleContentPositionNormalized, type OnViewableItemsChanged, type ScrollIndexWithOffset, type ScrollIndexWithOffsetAndContentOffset, type ScrollIndexWithOffsetPosition, type ScrollTarget, type StickyHeaderConfig, type ThresholdSnapshot, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
|
|
802
|
+
export { type AlwaysRenderConfig, type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InitialScrollAnchor, type InternalState, LegendList, type LegendListMetrics, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type LegendListState, type MaintainScrollAtEndOptions, type MaintainVisibleContentPositionConfig, type MaintainVisibleContentPositionNormalized, type OnViewableItemsChanged, type ScrollIndexWithOffset, type ScrollIndexWithOffsetAndContentOffset, type ScrollIndexWithOffsetPosition, type ScrollTarget, type StickyHeaderConfig, type ThresholdSnapshot, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import { ComponentProps, Key, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
3
|
-
import { View, ScrollView, Animated, LayoutRectangle,
|
|
3
|
+
import { View, ScrollView, Animated, LayoutRectangle, Insets, ScrollViewProps, ScrollViewComponent, ScrollResponderMixin, StyleProp, ViewStyle, NativeSyntheticEvent, NativeScrollEvent } from 'react-native';
|
|
4
4
|
import Reanimated from 'react-native-reanimated';
|
|
5
5
|
|
|
6
6
|
type AnimatedValue = number;
|
|
@@ -119,6 +119,11 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
119
119
|
* @default false
|
|
120
120
|
*/
|
|
121
121
|
alignItemsAtEnd?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Keeps selected items mounted even when they scroll out of view.
|
|
124
|
+
* @default undefined
|
|
125
|
+
*/
|
|
126
|
+
alwaysRender?: AlwaysRenderConfig;
|
|
122
127
|
/**
|
|
123
128
|
* Style applied to each column's wrapper view.
|
|
124
129
|
*/
|
|
@@ -255,6 +260,10 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
255
260
|
itemKey: string;
|
|
256
261
|
itemData: ItemT;
|
|
257
262
|
}) => void;
|
|
263
|
+
/**
|
|
264
|
+
* Called when list layout metrics change.
|
|
265
|
+
*/
|
|
266
|
+
onMetricsChange?: (metrics: LegendListMetrics) => void;
|
|
258
267
|
/**
|
|
259
268
|
* Function to call when the user pulls to refresh.
|
|
260
269
|
*/
|
|
@@ -374,6 +383,12 @@ interface StickyHeaderConfig {
|
|
|
374
383
|
*/
|
|
375
384
|
backdropComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
376
385
|
}
|
|
386
|
+
interface AlwaysRenderConfig {
|
|
387
|
+
top?: number;
|
|
388
|
+
bottom?: number;
|
|
389
|
+
indices?: number[];
|
|
390
|
+
keys?: string[];
|
|
391
|
+
}
|
|
377
392
|
interface MaintainScrollAtEndOptions {
|
|
378
393
|
onLayout?: boolean;
|
|
379
394
|
onItemLayout?: boolean;
|
|
@@ -384,6 +399,11 @@ interface ColumnWrapperStyle {
|
|
|
384
399
|
gap?: number;
|
|
385
400
|
columnGap?: number;
|
|
386
401
|
}
|
|
402
|
+
interface LegendListMetrics {
|
|
403
|
+
alignItemsAtEndPadding: number;
|
|
404
|
+
headerSize: number;
|
|
405
|
+
footerSize: number;
|
|
406
|
+
}
|
|
387
407
|
type LegendListProps<ItemT = any> = LegendListPropsBase<ItemT, ComponentProps<typeof ScrollView>>;
|
|
388
408
|
interface ThresholdSnapshot {
|
|
389
409
|
scrollPosition: number;
|
|
@@ -446,6 +466,8 @@ interface InternalState {
|
|
|
446
466
|
loadStartTime: number;
|
|
447
467
|
maintainingScrollAtEnd?: boolean;
|
|
448
468
|
minIndexSizeChanged: number | undefined;
|
|
469
|
+
contentInsetOverride?: Partial<Insets> | null;
|
|
470
|
+
nativeContentInset?: Insets;
|
|
449
471
|
nativeMarginTop: number;
|
|
450
472
|
needsOtherAxisSize?: boolean;
|
|
451
473
|
otherAxisSize?: number;
|
|
@@ -495,6 +517,9 @@ interface InternalState {
|
|
|
495
517
|
props: {
|
|
496
518
|
alignItemsAtEnd: boolean;
|
|
497
519
|
animatedProps: StylesAsSharedValue<ScrollViewProps>;
|
|
520
|
+
alwaysRender: AlwaysRenderConfig | undefined;
|
|
521
|
+
alwaysRenderIndicesArr: number[];
|
|
522
|
+
alwaysRenderIndicesSet: Set<number>;
|
|
498
523
|
contentInset: Insets | undefined;
|
|
499
524
|
data: readonly any[];
|
|
500
525
|
dataVersion: Key | undefined;
|
|
@@ -558,6 +583,7 @@ type LegendListState = {
|
|
|
558
583
|
positions: Map<string, number>;
|
|
559
584
|
scroll: number;
|
|
560
585
|
scrollLength: number;
|
|
586
|
+
scrollVelocity: number;
|
|
561
587
|
sizeAtIndex: (index: number) => number;
|
|
562
588
|
sizes: Map<string, number>;
|
|
563
589
|
start: number;
|
|
@@ -663,6 +689,11 @@ type LegendListRef = {
|
|
|
663
689
|
* @param enabled - If true, scroll processing is enabled.
|
|
664
690
|
*/
|
|
665
691
|
setScrollProcessingEnabled(enabled: boolean): void;
|
|
692
|
+
/**
|
|
693
|
+
* Reports an externally measured content inset. Pass null/undefined to clear.
|
|
694
|
+
* Values are merged on top of props/animated/native insets.
|
|
695
|
+
*/
|
|
696
|
+
reportContentInset(inset?: Partial<Insets> | null): void;
|
|
666
697
|
};
|
|
667
698
|
interface ViewToken<ItemT = any> {
|
|
668
699
|
containerId: number;
|
|
@@ -768,4 +799,4 @@ declare function useListScrollSize(): {
|
|
|
768
799
|
};
|
|
769
800
|
declare function useSyncLayout(): () => void;
|
|
770
801
|
|
|
771
|
-
export { type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InitialScrollAnchor, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type LegendListState, type MaintainScrollAtEndOptions, type MaintainVisibleContentPositionConfig, type MaintainVisibleContentPositionNormalized, type OnViewableItemsChanged, type ScrollIndexWithOffset, type ScrollIndexWithOffsetAndContentOffset, type ScrollIndexWithOffsetPosition, type ScrollTarget, type StickyHeaderConfig, type ThresholdSnapshot, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
|
|
802
|
+
export { type AlwaysRenderConfig, type ColumnWrapperStyle, type GetRenderedItem, type GetRenderedItemResult, type InitialScrollAnchor, type InternalState, LegendList, type LegendListMetrics, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type LegendListState, type MaintainScrollAtEndOptions, type MaintainVisibleContentPositionConfig, type MaintainVisibleContentPositionNormalized, type OnViewableItemsChanged, type ScrollIndexWithOffset, type ScrollIndexWithOffsetAndContentOffset, type ScrollIndexWithOffsetPosition, type ScrollTarget, type StickyHeaderConfig, type ThresholdSnapshot, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
|