@legendapp/list 3.0.0-beta.5 → 3.0.0-beta.50
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/.DS_Store +0 -0
- package/CHANGELOG.md +19 -0
- package/README.md +9 -2
- package/animated.d.ts +657 -5
- package/animated.js +2 -2
- package/animated.mjs +1 -1
- package/index.d.ts +1316 -11
- package/index.js +4009 -1279
- package/index.mjs +4008 -1280
- package/index.native.js +3772 -1337
- package/index.native.mjs +3758 -1325
- package/keyboard-chat.d.ts +228 -0
- package/keyboard-chat.js +97 -0
- package/keyboard-chat.mjs +76 -0
- package/keyboard-test.d.ts +216 -0
- package/keyboard-test.js +39 -0
- package/keyboard-test.mjs +18 -0
- package/keyboard.d.ts +216 -8
- package/keyboard.js +355 -64
- package/keyboard.mjs +358 -66
- package/package.json +68 -1
- package/{types-YNdphn_A.d.mts → react-native.d.ts} +306 -263
- package/react-native.js +6003 -0
- package/react-native.mjs +5974 -0
- package/{types-YNdphn_A.d.ts → react-native.web.d.ts} +367 -261
- package/react-native.web.js +6537 -0
- package/react-native.web.mjs +6508 -0
- package/react.d.ts +776 -0
- package/react.js +6537 -0
- package/react.mjs +6508 -0
- package/reanimated.d.ts +679 -8
- package/reanimated.js +230 -29
- package/reanimated.mjs +232 -31
- package/section-list.d.ts +661 -5
- package/section-list.js +50 -3675
- package/section-list.mjs +48 -3674
- package/animated.d.mts +0 -9
- package/index.d.mts +0 -23
- package/index.native.d.mts +0 -23
- package/index.native.d.ts +0 -23
- package/keyboard-controller.d.mts +0 -12
- package/keyboard-controller.d.ts +0 -12
- package/keyboard-controller.js +0 -69
- package/keyboard-controller.mjs +0 -48
- package/keyboard.d.mts +0 -13
- package/reanimated.d.mts +0 -18
- package/section-list.d.mts +0 -113
- package/section-list.native.d.mts +0 -113
- package/section-list.native.d.ts +0 -113
- package/section-list.native.js +0 -3711
- package/section-list.native.mjs +0 -3690
package/keyboard.d.ts
CHANGED
|
@@ -1,13 +1,221 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Insets } from 'react-native';
|
|
3
|
-
import {
|
|
4
|
-
import { LegendListRef } from '@legendapp/list';
|
|
2
|
+
import { ScrollViewComponent, ScrollResponderMixin, Insets as Insets$1 } from 'react-native';
|
|
3
|
+
import { ScrollEvent, ScrollHandlerProcessed } from 'react-native-reanimated';
|
|
5
4
|
import { AnimatedLegendListProps } from '@legendapp/list/reanimated';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
interface MaintainVisibleContentPositionNormalized<ItemT = any> {
|
|
7
|
+
data: boolean;
|
|
8
|
+
size: boolean;
|
|
9
|
+
shouldRestorePosition?: (item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type ListenerType = "activeStickyIndex" | "anchoredEndSpaceSize" | "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" | `containerColumn${number}` | `containerSpan${number}` | `containerItemData${number}` | `containerItemKey${number}` | `containerPosition${number}` | `containerSticky${number}`;
|
|
13
|
+
type LegendListListenerType = Extract<ListenerType, "activeStickyIndex" | "anchoredEndSpaceSize" | "footerSize" | "headerSize" | "isAtEnd" | "isAtStart" | "isNearEnd" | "isNearStart" | "isWithinMaintainScrollAtEndThreshold" | "lastItemKeys" | "lastPositionUpdate" | "numContainers" | "numContainersPooled" | "otherAxisSize" | "readyToRender" | "snapToOffsets" | "totalSize">;
|
|
14
|
+
type ListenerTypeValueMap = {
|
|
15
|
+
activeStickyIndex: number;
|
|
16
|
+
anchoredEndSpaceSize: number;
|
|
17
|
+
animatedScrollY: any;
|
|
18
|
+
debugComputedScroll: number;
|
|
19
|
+
debugRawScroll: number;
|
|
20
|
+
extraData: any;
|
|
21
|
+
footerSize: number;
|
|
22
|
+
headerSize: number;
|
|
23
|
+
isAtEnd: boolean;
|
|
24
|
+
isAtStart: boolean;
|
|
25
|
+
isNearEnd: boolean;
|
|
26
|
+
isNearStart: boolean;
|
|
27
|
+
isWithinMaintainScrollAtEndThreshold: boolean;
|
|
28
|
+
lastItemKeys: string[];
|
|
29
|
+
lastPositionUpdate: number;
|
|
30
|
+
maintainVisibleContentPosition: MaintainVisibleContentPositionNormalized;
|
|
31
|
+
numColumns: number;
|
|
32
|
+
numContainers: number;
|
|
33
|
+
numContainersPooled: number;
|
|
34
|
+
otherAxisSize: number;
|
|
35
|
+
readyToRender: boolean;
|
|
36
|
+
scrollAdjust: number;
|
|
37
|
+
scrollAdjustPending: number;
|
|
38
|
+
scrollAdjustUserOffset: number;
|
|
39
|
+
scrollSize: {
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
};
|
|
43
|
+
snapToOffsets: number[];
|
|
44
|
+
stylePaddingTop: number;
|
|
45
|
+
totalSize: number;
|
|
46
|
+
} & {
|
|
47
|
+
[K in ListenerType as K extends `containerItemKey${number}` ? K : never]: string;
|
|
48
|
+
} & {
|
|
49
|
+
[K in ListenerType as K extends `containerItemData${number}` ? K : never]: any;
|
|
50
|
+
} & {
|
|
51
|
+
[K in ListenerType as K extends `containerPosition${number}` ? K : never]: number;
|
|
52
|
+
} & {
|
|
53
|
+
[K in ListenerType as K extends `containerColumn${number}` ? K : never]: number;
|
|
54
|
+
} & {
|
|
55
|
+
[K in ListenerType as K extends `containerSpan${number}` ? K : never]: number;
|
|
56
|
+
} & {
|
|
57
|
+
[K in ListenerType as K extends `containerSticky${number}` ? K : never]: boolean;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
interface Insets {
|
|
61
|
+
top: number;
|
|
62
|
+
left: number;
|
|
63
|
+
bottom: number;
|
|
64
|
+
right: number;
|
|
65
|
+
}
|
|
66
|
+
type LegendListState = {
|
|
67
|
+
activeStickyIndex: number;
|
|
68
|
+
contentLength: number;
|
|
69
|
+
data: readonly any[];
|
|
70
|
+
elementAtIndex: (index: number) => any;
|
|
71
|
+
end: number;
|
|
72
|
+
endBuffered: number;
|
|
73
|
+
isAtEnd: boolean;
|
|
74
|
+
isAtStart: boolean;
|
|
75
|
+
isNearEnd: boolean;
|
|
76
|
+
isNearStart: boolean;
|
|
77
|
+
isEndReached: boolean;
|
|
78
|
+
isStartReached: boolean;
|
|
79
|
+
isWithinMaintainScrollAtEndThreshold: boolean;
|
|
80
|
+
listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
|
|
81
|
+
listenToPosition: (key: string, callback: (value: number) => void) => () => void;
|
|
82
|
+
positionAtIndex: (index: number) => number;
|
|
83
|
+
positionByKey: (key: string) => number | undefined;
|
|
84
|
+
scroll: number;
|
|
85
|
+
scrollLength: number;
|
|
86
|
+
scrollVelocity: number;
|
|
87
|
+
sizeAtIndex: (index: number) => number;
|
|
88
|
+
sizes: Map<string, number>;
|
|
89
|
+
start: number;
|
|
90
|
+
startBuffered: number;
|
|
91
|
+
};
|
|
92
|
+
type LegendListRef$1 = {
|
|
93
|
+
/**
|
|
94
|
+
* Displays the scroll indicators momentarily.
|
|
95
|
+
*/
|
|
96
|
+
flashScrollIndicators(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Returns the native ScrollView component reference.
|
|
99
|
+
*/
|
|
100
|
+
getNativeScrollRef(): any;
|
|
101
|
+
/**
|
|
102
|
+
* Returns the scroll responder instance for handling scroll events.
|
|
103
|
+
*/
|
|
104
|
+
getScrollableNode(): any;
|
|
105
|
+
/**
|
|
106
|
+
* Returns the ScrollResponderMixin for advanced scroll handling.
|
|
107
|
+
*/
|
|
108
|
+
getScrollResponder(): any;
|
|
109
|
+
/**
|
|
110
|
+
* Returns the internal state of the scroll virtualization.
|
|
111
|
+
*/
|
|
112
|
+
getState(): LegendListState;
|
|
113
|
+
/**
|
|
114
|
+
* Scrolls a specific index into view.
|
|
115
|
+
* @param params - Parameters for scrolling.
|
|
116
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
117
|
+
* @param params.index - The index to scroll to.
|
|
118
|
+
*/
|
|
119
|
+
scrollIndexIntoView(params: {
|
|
120
|
+
animated?: boolean | undefined;
|
|
121
|
+
index: number;
|
|
122
|
+
}): Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Scrolls a specific index into view.
|
|
125
|
+
* @param params - Parameters for scrolling.
|
|
126
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
127
|
+
* @param params.item - The item to scroll to.
|
|
128
|
+
*/
|
|
129
|
+
scrollItemIntoView(params: {
|
|
130
|
+
animated?: boolean | undefined;
|
|
131
|
+
item: any;
|
|
132
|
+
}): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Scrolls to the end of the list.
|
|
135
|
+
* @param options - Options for scrolling.
|
|
136
|
+
* @param options.animated - If true, animates the scroll. Default: true.
|
|
137
|
+
* @param options.viewOffset - Offset from the target position.
|
|
138
|
+
*/
|
|
139
|
+
scrollToEnd(options?: {
|
|
140
|
+
animated?: boolean | undefined;
|
|
141
|
+
viewOffset?: number | undefined;
|
|
142
|
+
}): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* Scrolls to a specific index in the list.
|
|
145
|
+
* @param params - Parameters for scrolling.
|
|
146
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
147
|
+
* @param params.index - The index to scroll to.
|
|
148
|
+
* @param params.viewOffset - Offset from the target position.
|
|
149
|
+
* @param params.viewPosition - Position of the item in the viewport (0 to 1).
|
|
150
|
+
*/
|
|
151
|
+
scrollToIndex(params: {
|
|
152
|
+
animated?: boolean | undefined;
|
|
153
|
+
index: number;
|
|
154
|
+
viewOffset?: number | undefined;
|
|
155
|
+
viewPosition?: number | undefined;
|
|
156
|
+
}): Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Scrolls to a specific item in the list.
|
|
159
|
+
* @param params - Parameters for scrolling.
|
|
160
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
161
|
+
* @param params.item - The item to scroll to.
|
|
162
|
+
* @param params.viewOffset - Offset from the target position.
|
|
163
|
+
* @param params.viewPosition - Position of the item in the viewport (0 to 1).
|
|
164
|
+
*/
|
|
165
|
+
scrollToItem(params: {
|
|
166
|
+
animated?: boolean | undefined;
|
|
167
|
+
item: any;
|
|
168
|
+
viewOffset?: number | undefined;
|
|
169
|
+
viewPosition?: number | undefined;
|
|
170
|
+
}): Promise<void>;
|
|
171
|
+
/**
|
|
172
|
+
* Scrolls to a specific offset in pixels.
|
|
173
|
+
* @param params - Parameters for scrolling.
|
|
174
|
+
* @param params.offset - The pixel offset to scroll to.
|
|
175
|
+
* @param params.animated - If true, animates the scroll. Default: true.
|
|
176
|
+
*/
|
|
177
|
+
scrollToOffset(params: {
|
|
178
|
+
offset: number;
|
|
179
|
+
animated?: boolean | undefined;
|
|
180
|
+
}): Promise<void>;
|
|
181
|
+
/**
|
|
182
|
+
* Sets or adds to the offset of the visible content anchor.
|
|
183
|
+
* @param value - The offset to set or add.
|
|
184
|
+
* @param animated - If true, uses Animated to animate the change.
|
|
185
|
+
*/
|
|
186
|
+
setVisibleContentAnchorOffset(value: number | ((val: number) => number)): void;
|
|
187
|
+
/**
|
|
188
|
+
* Sets whether scroll processing is enabled.
|
|
189
|
+
* @param enabled - If true, scroll processing is enabled.
|
|
190
|
+
*/
|
|
191
|
+
setScrollProcessingEnabled(enabled: boolean): void;
|
|
192
|
+
/**
|
|
193
|
+
* Clears internal virtualization caches.
|
|
194
|
+
* @param options - Cache clearing options.
|
|
195
|
+
* @param options.mode - `sizes` clears measurement caches. `full` also clears key/position caches.
|
|
196
|
+
*/
|
|
197
|
+
clearCaches(options?: {
|
|
198
|
+
mode?: "sizes" | "full";
|
|
199
|
+
}): void;
|
|
200
|
+
/**
|
|
201
|
+
* Reports an externally measured content inset. Pass null/undefined to clear.
|
|
202
|
+
* Values are merged on top of props/animated/native insets.
|
|
203
|
+
*/
|
|
204
|
+
reportContentInset(inset?: Partial<Insets> | null): void;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
type LegendListRef = Omit<LegendListRef$1, "getNativeScrollRef" | "getScrollResponder" | "reportContentInset"> & {
|
|
208
|
+
getNativeScrollRef(): React.ElementRef<typeof ScrollViewComponent>;
|
|
209
|
+
getScrollResponder(): ScrollResponderMixin;
|
|
210
|
+
reportContentInset(inset?: Partial<Insets$1> | null): void;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
type KeyboardOnScrollCallback = (event: ScrollEvent) => void;
|
|
214
|
+
type KeyboardOnScrollHandler = KeyboardOnScrollCallback | ScrollHandlerProcessed<Record<string, unknown>>;
|
|
215
|
+
declare const KeyboardAvoidingLegendList: <ItemT>(props: Omit<AnimatedLegendListProps<ItemT>, "onScroll" | "automaticallyAdjustContentInsets" | "contentInset"> & {
|
|
216
|
+
onScroll?: KeyboardOnScrollHandler;
|
|
217
|
+
contentInset?: Insets$1 | undefined;
|
|
10
218
|
safeAreaInsetBottom?: number;
|
|
11
|
-
} & React.RefAttributes<LegendListRef>) => React.
|
|
219
|
+
} & React.RefAttributes<LegendListRef>) => React.ReactElement | null;
|
|
12
220
|
|
|
13
|
-
export { KeyboardAvoidingLegendList
|
|
221
|
+
export { KeyboardAvoidingLegendList };
|