@legendapp/list 1.0.0 → 1.0.2
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/README.md +2 -0
- package/animated.d.mts +1 -1
- package/animated.d.ts +1 -1
- package/index.d.mts +3 -3
- package/index.d.ts +3 -3
- package/index.js +33 -42
- package/index.mjs +33 -42
- package/keyboard-controller.d.mts +132 -132
- package/keyboard-controller.d.ts +132 -132
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
**Legend List** is a high-performance list component for **React Native**, written purely in Typescript with no native dependencies. It is a drop-in replacement for `FlatList` and `FlashList` with better performance, especially when handling dynamically sized items.
|
|
4
4
|
|
|
5
|
+
<video src="https://github.com/user-attachments/assets/8641e305-ab06-4fb3-a96a-fd220df84985"></video>
|
|
6
|
+
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
## 🤔 Why Legend List?
|
package/animated.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import * as _legendapp_list from '@legendapp/list';
|
|
|
3
3
|
import * as react_native from 'react-native';
|
|
4
4
|
import { Animated } from 'react-native';
|
|
5
5
|
|
|
6
|
-
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "
|
|
6
|
+
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "maintainVisibleContentPosition" | "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset"> & {
|
|
7
7
|
alignItemsAtEnd?: boolean;
|
|
8
8
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
9
9
|
data: readonly T[];
|
package/animated.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as _legendapp_list from '@legendapp/list';
|
|
|
3
3
|
import * as react_native from 'react-native';
|
|
4
4
|
import { Animated } from 'react-native';
|
|
5
5
|
|
|
6
|
-
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "
|
|
6
|
+
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "maintainVisibleContentPosition" | "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset"> & {
|
|
7
7
|
alignItemsAtEnd?: boolean;
|
|
8
8
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
9
9
|
data: readonly T[];
|
package/index.d.mts
CHANGED
|
@@ -20,7 +20,7 @@ declare class ScrollAdjustHandler {
|
|
|
20
20
|
unPauseAdjust(): boolean;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof react_native_reanimated__default.ScrollView>> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
|
|
23
|
+
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof react_native_reanimated__default.ScrollView>> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
|
|
24
24
|
/**
|
|
25
25
|
* If true, aligns items at the end of the list.
|
|
26
26
|
* @default false
|
|
@@ -272,11 +272,11 @@ interface InternalState {
|
|
|
272
272
|
} | undefined;
|
|
273
273
|
enableScrollForNextCalculateItemsInView: boolean;
|
|
274
274
|
minIndexSizeChanged: number | undefined;
|
|
275
|
-
numPendingInitialLayout: number;
|
|
276
275
|
queuedInitialLayout?: boolean | undefined;
|
|
277
276
|
queuedCalculateItemsInView: number | undefined;
|
|
278
277
|
lastBatchingAction: number;
|
|
279
278
|
ignoreScrollFromCalcTotal?: boolean;
|
|
279
|
+
disableAveragesForScrolls?: number;
|
|
280
280
|
scrollingToOffset?: number | undefined;
|
|
281
281
|
averageSizes: Record<string, {
|
|
282
282
|
num: number;
|
|
@@ -462,7 +462,7 @@ type TypedMemo = <T extends React.ComponentType<any>>(Component: T, propsAreEqua
|
|
|
462
462
|
};
|
|
463
463
|
declare const typedMemo: TypedMemo;
|
|
464
464
|
|
|
465
|
-
declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "
|
|
465
|
+
declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "maintainVisibleContentPosition" | "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset"> & {
|
|
466
466
|
alignItemsAtEnd?: boolean;
|
|
467
467
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
468
468
|
data: readonly T[];
|
package/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare class ScrollAdjustHandler {
|
|
|
20
20
|
unPauseAdjust(): boolean;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof react_native_reanimated__default.ScrollView>> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
|
|
23
|
+
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof react_native_reanimated__default.ScrollView>> = Omit<TScrollView, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews"> & {
|
|
24
24
|
/**
|
|
25
25
|
* If true, aligns items at the end of the list.
|
|
26
26
|
* @default false
|
|
@@ -272,11 +272,11 @@ interface InternalState {
|
|
|
272
272
|
} | undefined;
|
|
273
273
|
enableScrollForNextCalculateItemsInView: boolean;
|
|
274
274
|
minIndexSizeChanged: number | undefined;
|
|
275
|
-
numPendingInitialLayout: number;
|
|
276
275
|
queuedInitialLayout?: boolean | undefined;
|
|
277
276
|
queuedCalculateItemsInView: number | undefined;
|
|
278
277
|
lastBatchingAction: number;
|
|
279
278
|
ignoreScrollFromCalcTotal?: boolean;
|
|
279
|
+
disableAveragesForScrolls?: number;
|
|
280
280
|
scrollingToOffset?: number | undefined;
|
|
281
281
|
averageSizes: Record<string, {
|
|
282
282
|
num: number;
|
|
@@ -462,7 +462,7 @@ type TypedMemo = <T extends React.ComponentType<any>>(Component: T, propsAreEqua
|
|
|
462
462
|
};
|
|
463
463
|
declare const typedMemo: TypedMemo;
|
|
464
464
|
|
|
465
|
-
declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "
|
|
465
|
+
declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "maintainVisibleContentPosition" | "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset"> & {
|
|
466
466
|
alignItemsAtEnd?: boolean;
|
|
467
467
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
468
468
|
data: readonly T[];
|
package/index.js
CHANGED
|
@@ -338,6 +338,9 @@ var Container = ({
|
|
|
338
338
|
if (itemKey !== void 0) {
|
|
339
339
|
const layout = event.nativeEvent.layout;
|
|
340
340
|
const size = roundSize(layout[horizontal ? "width" : "height"]);
|
|
341
|
+
if (!IsNewArchitecture && size === 0 && layout.x === 0 && layout.y === 0) {
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
341
344
|
refLastSize.current = size;
|
|
342
345
|
updateItemSize(itemKey, size);
|
|
343
346
|
}
|
|
@@ -958,24 +961,27 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
958
961
|
return `${ret}`;
|
|
959
962
|
};
|
|
960
963
|
const getItemSize = (key, index, data, useAverageSize = false) => {
|
|
964
|
+
var _a;
|
|
961
965
|
const state = refState.current;
|
|
962
966
|
const sizeKnown = state.sizesKnown.get(key);
|
|
963
|
-
|
|
964
|
-
return sizeKnown;
|
|
965
|
-
}
|
|
967
|
+
const sizePrevious = state.sizes.get(key);
|
|
966
968
|
let size;
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
}
|
|
970
|
-
if (size === void 0 && useAverageSize) {
|
|
969
|
+
const numColumns = peek$(ctx, "numColumns");
|
|
970
|
+
if (sizeKnown === void 0 && !getEstimatedItemSize && numColumns === 1 && useAverageSize) {
|
|
971
971
|
const itemType = "";
|
|
972
972
|
const average = state.averageSizes[itemType];
|
|
973
973
|
if (average) {
|
|
974
974
|
size = roundSize(average.avg);
|
|
975
|
+
if (size !== sizePrevious) {
|
|
976
|
+
addTotalSize(key, size - sizePrevious, 0);
|
|
977
|
+
}
|
|
975
978
|
}
|
|
976
979
|
}
|
|
980
|
+
if (size === void 0 && sizePrevious !== void 0) {
|
|
981
|
+
return sizePrevious;
|
|
982
|
+
}
|
|
977
983
|
if (size === void 0) {
|
|
978
|
-
size = estimatedItemSize != null ?
|
|
984
|
+
size = (_a = getEstimatedItemSize ? getEstimatedItemSize(index, data) : estimatedItemSize) != null ? _a : DEFAULT_ITEM_SIZE;
|
|
979
985
|
}
|
|
980
986
|
state.sizes.set(key, size);
|
|
981
987
|
return size;
|
|
@@ -999,7 +1005,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
999
1005
|
} else if (estimatedItemSize) {
|
|
1000
1006
|
offset = index * estimatedItemSize;
|
|
1001
1007
|
}
|
|
1002
|
-
|
|
1008
|
+
const adjust = peek$(ctx, "containersDidLayout") ? ((_a = refState.current) == null ? void 0 : _a.scrollAdjustHandler.getAppliedAdjust()) || 0 : 0;
|
|
1009
|
+
return offset / numColumnsProp - adjust;
|
|
1003
1010
|
}
|
|
1004
1011
|
return 0;
|
|
1005
1012
|
};
|
|
@@ -1045,7 +1052,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1045
1052
|
scrollForNextCalculateItemsInView: void 0,
|
|
1046
1053
|
enableScrollForNextCalculateItemsInView: true,
|
|
1047
1054
|
minIndexSizeChanged: 0,
|
|
1048
|
-
numPendingInitialLayout: 0,
|
|
1049
1055
|
queuedCalculateItemsInView: 0,
|
|
1050
1056
|
lastBatchingAction: Date.now(),
|
|
1051
1057
|
averageSizes: {},
|
|
@@ -1128,6 +1134,9 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1128
1134
|
queueMicrotask(() => {
|
|
1129
1135
|
scrollToIndex({ index: initialScrollIndex, animated: false });
|
|
1130
1136
|
requestAnimationFrame(() => {
|
|
1137
|
+
if (!IsNewArchitecture) {
|
|
1138
|
+
scrollToIndex({ index: initialScrollIndex, animated: false });
|
|
1139
|
+
}
|
|
1131
1140
|
set$(ctx, "containersDidLayout", true);
|
|
1132
1141
|
});
|
|
1133
1142
|
});
|
|
@@ -1306,7 +1315,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1306
1315
|
positions,
|
|
1307
1316
|
columns,
|
|
1308
1317
|
scrollAdjustHandler,
|
|
1309
|
-
scrollVelocity: speed
|
|
1318
|
+
scrollVelocity: speed,
|
|
1319
|
+
disableAveragesForScrolls
|
|
1310
1320
|
} = state;
|
|
1311
1321
|
if (!data || scrollLength === 0) {
|
|
1312
1322
|
return;
|
|
@@ -1317,6 +1327,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1317
1327
|
const previousScrollAdjust = scrollAdjustHandler.getAppliedAdjust();
|
|
1318
1328
|
const scrollExtra = Math.max(-16, Math.min(16, speed)) * 16;
|
|
1319
1329
|
let scrollState = state.scroll;
|
|
1330
|
+
const useAverageSize = !disableAveragesForScrolls;
|
|
1320
1331
|
if (!state.queuedInitialLayout && initialScrollIndex) {
|
|
1321
1332
|
const updatedOffset = calculateOffsetForIndex(initialScrollIndex);
|
|
1322
1333
|
scrollState = updatedOffset;
|
|
@@ -1368,13 +1379,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1368
1379
|
}
|
|
1369
1380
|
const top2 = newPosition || positions.get(id);
|
|
1370
1381
|
if (top2 !== void 0) {
|
|
1371
|
-
const size = getItemSize(
|
|
1372
|
-
id,
|
|
1373
|
-
i,
|
|
1374
|
-
data[i],
|
|
1375
|
-
/*useAverageSize*/
|
|
1376
|
-
true
|
|
1377
|
-
);
|
|
1382
|
+
const size = getItemSize(id, i, data[i], useAverageSize);
|
|
1378
1383
|
const bottom = top2 + size;
|
|
1379
1384
|
if (bottom > scroll - scrollBuffer) {
|
|
1380
1385
|
loopStart = i;
|
|
@@ -1404,13 +1409,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1404
1409
|
};
|
|
1405
1410
|
for (let i = Math.max(0, loopStart); i < data.length; i++) {
|
|
1406
1411
|
const id = getId(i);
|
|
1407
|
-
const size = getItemSize(
|
|
1408
|
-
id,
|
|
1409
|
-
i,
|
|
1410
|
-
data[i],
|
|
1411
|
-
/*useAverageSize*/
|
|
1412
|
-
true
|
|
1413
|
-
);
|
|
1412
|
+
const size = getItemSize(id, i, data[i], useAverageSize);
|
|
1414
1413
|
maxSizeInRow = Math.max(maxSizeInRow, size);
|
|
1415
1414
|
if (top === void 0 || id === ((_a = state.anchorElement) == null ? void 0 : _a.id)) {
|
|
1416
1415
|
top = getInitialTop(i);
|
|
@@ -1568,9 +1567,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1568
1567
|
}
|
|
1569
1568
|
}
|
|
1570
1569
|
}
|
|
1571
|
-
if (state.numPendingInitialLayout === 0) {
|
|
1572
|
-
state.numPendingInitialLayout = state.endBuffered - state.startBuffered + 1;
|
|
1573
|
-
}
|
|
1574
1570
|
if (!state.queuedInitialLayout && endBuffered !== null) {
|
|
1575
1571
|
let areAllKnown = true;
|
|
1576
1572
|
for (let i = startBuffered; areAllKnown && i <= endBuffered; i++) {
|
|
@@ -1708,8 +1704,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1708
1704
|
}
|
|
1709
1705
|
const { scrollLength, scroll } = refState.current;
|
|
1710
1706
|
const distanceFromTop = scroll;
|
|
1711
|
-
|
|
1712
|
-
refState.current.isAtTop = distanceFromTopAbs < 0;
|
|
1707
|
+
refState.current.isAtTop = distanceFromTop <= 0;
|
|
1713
1708
|
refState.current.isStartReached = checkThreshold(
|
|
1714
1709
|
distanceFromTop,
|
|
1715
1710
|
false,
|
|
@@ -1730,6 +1725,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1730
1725
|
if (state) {
|
|
1731
1726
|
state.data = dataProp;
|
|
1732
1727
|
if (!isFirst2) {
|
|
1728
|
+
state.disableAveragesForScrolls = 2;
|
|
1733
1729
|
refState.current.scrollForNextCalculateItemsInView = void 0;
|
|
1734
1730
|
const numContainers = peek$(ctx, "numContainers");
|
|
1735
1731
|
for (let i = 0; i < numContainers; i++) {
|
|
@@ -1955,15 +1951,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1955
1951
|
state.minIndexSizeChanged = state.minIndexSizeChanged !== void 0 ? Math.min(state.minIndexSizeChanged, index) : index;
|
|
1956
1952
|
const prevSize = getItemSize(itemKey, index, data);
|
|
1957
1953
|
let needsCalculate = false;
|
|
1958
|
-
|
|
1959
|
-
if (state.numPendingInitialLayout > 0) {
|
|
1960
|
-
state.numPendingInitialLayout--;
|
|
1961
|
-
if (state.numPendingInitialLayout === 0) {
|
|
1962
|
-
needsCalculate = true;
|
|
1963
|
-
state.numPendingInitialLayout = -1;
|
|
1964
|
-
needsUpdateContainersDidLayout = true;
|
|
1965
|
-
}
|
|
1966
|
-
}
|
|
1954
|
+
const needsUpdateContainersDidLayout = !peek$(ctx, "containersDidLayout");
|
|
1967
1955
|
sizesKnown.set(itemKey, size);
|
|
1968
1956
|
const itemType = "";
|
|
1969
1957
|
let averages = averageSizes[itemType];
|
|
@@ -1975,7 +1963,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1975
1963
|
}
|
|
1976
1964
|
averages.avg = (averages.avg * averages.num + size) / (averages.num + 1);
|
|
1977
1965
|
averages.num++;
|
|
1978
|
-
if (!prevSize || Math.abs(prevSize - size) > 0.
|
|
1966
|
+
if (!prevSize || Math.abs(prevSize - size) > 0.1) {
|
|
1979
1967
|
let diff;
|
|
1980
1968
|
needsCalculate = true;
|
|
1981
1969
|
if (numColumns > 1) {
|
|
@@ -2019,7 +2007,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2019
2007
|
if (needsUpdateContainersDidLayout || !fromFixGaps && needsCalculate && isInView) {
|
|
2020
2008
|
const scrollVelocity = state.scrollVelocity;
|
|
2021
2009
|
let didCalculate = false;
|
|
2022
|
-
if ((Number.isNaN(scrollVelocity) || Math.abs(scrollVelocity) < 1) && (!waitForInitialLayout ||
|
|
2010
|
+
if ((Number.isNaN(scrollVelocity) || Math.abs(scrollVelocity) < 1) && (!waitForInitialLayout || needsUpdateContainersDidLayout)) {
|
|
2023
2011
|
if (Date.now() - state.lastBatchingAction < 500) {
|
|
2024
2012
|
if (!state.queuedCalculateItemsInView) {
|
|
2025
2013
|
state.queuedCalculateItemsInView = requestAnimationFrame(() => {
|
|
@@ -2032,7 +2020,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2032
2020
|
didCalculate = true;
|
|
2033
2021
|
}
|
|
2034
2022
|
}
|
|
2035
|
-
if (!didCalculate && IsNewArchitecture) {
|
|
2023
|
+
if (!didCalculate && !needsUpdateContainersDidLayout && IsNewArchitecture) {
|
|
2036
2024
|
fixGaps();
|
|
2037
2025
|
}
|
|
2038
2026
|
}
|
|
@@ -2111,6 +2099,9 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2111
2099
|
if (!fromSelf) {
|
|
2112
2100
|
(_d = state.onScroll) == null ? void 0 : _d.call(state, event);
|
|
2113
2101
|
}
|
|
2102
|
+
if (state.disableAveragesForScrolls) {
|
|
2103
|
+
state.disableAveragesForScrolls--;
|
|
2104
|
+
}
|
|
2114
2105
|
},
|
|
2115
2106
|
[]
|
|
2116
2107
|
);
|
package/index.mjs
CHANGED
|
@@ -317,6 +317,9 @@ var Container = ({
|
|
|
317
317
|
if (itemKey !== void 0) {
|
|
318
318
|
const layout = event.nativeEvent.layout;
|
|
319
319
|
const size = roundSize(layout[horizontal ? "width" : "height"]);
|
|
320
|
+
if (!IsNewArchitecture && size === 0 && layout.x === 0 && layout.y === 0) {
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
320
323
|
refLastSize.current = size;
|
|
321
324
|
updateItemSize(itemKey, size);
|
|
322
325
|
}
|
|
@@ -937,24 +940,27 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
937
940
|
return `${ret}`;
|
|
938
941
|
};
|
|
939
942
|
const getItemSize = (key, index, data, useAverageSize = false) => {
|
|
943
|
+
var _a;
|
|
940
944
|
const state = refState.current;
|
|
941
945
|
const sizeKnown = state.sizesKnown.get(key);
|
|
942
|
-
|
|
943
|
-
return sizeKnown;
|
|
944
|
-
}
|
|
946
|
+
const sizePrevious = state.sizes.get(key);
|
|
945
947
|
let size;
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
}
|
|
949
|
-
if (size === void 0 && useAverageSize) {
|
|
948
|
+
const numColumns = peek$(ctx, "numColumns");
|
|
949
|
+
if (sizeKnown === void 0 && !getEstimatedItemSize && numColumns === 1 && useAverageSize) {
|
|
950
950
|
const itemType = "";
|
|
951
951
|
const average = state.averageSizes[itemType];
|
|
952
952
|
if (average) {
|
|
953
953
|
size = roundSize(average.avg);
|
|
954
|
+
if (size !== sizePrevious) {
|
|
955
|
+
addTotalSize(key, size - sizePrevious, 0);
|
|
956
|
+
}
|
|
954
957
|
}
|
|
955
958
|
}
|
|
959
|
+
if (size === void 0 && sizePrevious !== void 0) {
|
|
960
|
+
return sizePrevious;
|
|
961
|
+
}
|
|
956
962
|
if (size === void 0) {
|
|
957
|
-
size = estimatedItemSize != null ?
|
|
963
|
+
size = (_a = getEstimatedItemSize ? getEstimatedItemSize(index, data) : estimatedItemSize) != null ? _a : DEFAULT_ITEM_SIZE;
|
|
958
964
|
}
|
|
959
965
|
state.sizes.set(key, size);
|
|
960
966
|
return size;
|
|
@@ -978,7 +984,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
978
984
|
} else if (estimatedItemSize) {
|
|
979
985
|
offset = index * estimatedItemSize;
|
|
980
986
|
}
|
|
981
|
-
|
|
987
|
+
const adjust = peek$(ctx, "containersDidLayout") ? ((_a = refState.current) == null ? void 0 : _a.scrollAdjustHandler.getAppliedAdjust()) || 0 : 0;
|
|
988
|
+
return offset / numColumnsProp - adjust;
|
|
982
989
|
}
|
|
983
990
|
return 0;
|
|
984
991
|
};
|
|
@@ -1024,7 +1031,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1024
1031
|
scrollForNextCalculateItemsInView: void 0,
|
|
1025
1032
|
enableScrollForNextCalculateItemsInView: true,
|
|
1026
1033
|
minIndexSizeChanged: 0,
|
|
1027
|
-
numPendingInitialLayout: 0,
|
|
1028
1034
|
queuedCalculateItemsInView: 0,
|
|
1029
1035
|
lastBatchingAction: Date.now(),
|
|
1030
1036
|
averageSizes: {},
|
|
@@ -1107,6 +1113,9 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1107
1113
|
queueMicrotask(() => {
|
|
1108
1114
|
scrollToIndex({ index: initialScrollIndex, animated: false });
|
|
1109
1115
|
requestAnimationFrame(() => {
|
|
1116
|
+
if (!IsNewArchitecture) {
|
|
1117
|
+
scrollToIndex({ index: initialScrollIndex, animated: false });
|
|
1118
|
+
}
|
|
1110
1119
|
set$(ctx, "containersDidLayout", true);
|
|
1111
1120
|
});
|
|
1112
1121
|
});
|
|
@@ -1285,7 +1294,8 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1285
1294
|
positions,
|
|
1286
1295
|
columns,
|
|
1287
1296
|
scrollAdjustHandler,
|
|
1288
|
-
scrollVelocity: speed
|
|
1297
|
+
scrollVelocity: speed,
|
|
1298
|
+
disableAveragesForScrolls
|
|
1289
1299
|
} = state;
|
|
1290
1300
|
if (!data || scrollLength === 0) {
|
|
1291
1301
|
return;
|
|
@@ -1296,6 +1306,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1296
1306
|
const previousScrollAdjust = scrollAdjustHandler.getAppliedAdjust();
|
|
1297
1307
|
const scrollExtra = Math.max(-16, Math.min(16, speed)) * 16;
|
|
1298
1308
|
let scrollState = state.scroll;
|
|
1309
|
+
const useAverageSize = !disableAveragesForScrolls;
|
|
1299
1310
|
if (!state.queuedInitialLayout && initialScrollIndex) {
|
|
1300
1311
|
const updatedOffset = calculateOffsetForIndex(initialScrollIndex);
|
|
1301
1312
|
scrollState = updatedOffset;
|
|
@@ -1347,13 +1358,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1347
1358
|
}
|
|
1348
1359
|
const top2 = newPosition || positions.get(id);
|
|
1349
1360
|
if (top2 !== void 0) {
|
|
1350
|
-
const size = getItemSize(
|
|
1351
|
-
id,
|
|
1352
|
-
i,
|
|
1353
|
-
data[i],
|
|
1354
|
-
/*useAverageSize*/
|
|
1355
|
-
true
|
|
1356
|
-
);
|
|
1361
|
+
const size = getItemSize(id, i, data[i], useAverageSize);
|
|
1357
1362
|
const bottom = top2 + size;
|
|
1358
1363
|
if (bottom > scroll - scrollBuffer) {
|
|
1359
1364
|
loopStart = i;
|
|
@@ -1383,13 +1388,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1383
1388
|
};
|
|
1384
1389
|
for (let i = Math.max(0, loopStart); i < data.length; i++) {
|
|
1385
1390
|
const id = getId(i);
|
|
1386
|
-
const size = getItemSize(
|
|
1387
|
-
id,
|
|
1388
|
-
i,
|
|
1389
|
-
data[i],
|
|
1390
|
-
/*useAverageSize*/
|
|
1391
|
-
true
|
|
1392
|
-
);
|
|
1391
|
+
const size = getItemSize(id, i, data[i], useAverageSize);
|
|
1393
1392
|
maxSizeInRow = Math.max(maxSizeInRow, size);
|
|
1394
1393
|
if (top === void 0 || id === ((_a = state.anchorElement) == null ? void 0 : _a.id)) {
|
|
1395
1394
|
top = getInitialTop(i);
|
|
@@ -1547,9 +1546,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1547
1546
|
}
|
|
1548
1547
|
}
|
|
1549
1548
|
}
|
|
1550
|
-
if (state.numPendingInitialLayout === 0) {
|
|
1551
|
-
state.numPendingInitialLayout = state.endBuffered - state.startBuffered + 1;
|
|
1552
|
-
}
|
|
1553
1549
|
if (!state.queuedInitialLayout && endBuffered !== null) {
|
|
1554
1550
|
let areAllKnown = true;
|
|
1555
1551
|
for (let i = startBuffered; areAllKnown && i <= endBuffered; i++) {
|
|
@@ -1687,8 +1683,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1687
1683
|
}
|
|
1688
1684
|
const { scrollLength, scroll } = refState.current;
|
|
1689
1685
|
const distanceFromTop = scroll;
|
|
1690
|
-
|
|
1691
|
-
refState.current.isAtTop = distanceFromTopAbs < 0;
|
|
1686
|
+
refState.current.isAtTop = distanceFromTop <= 0;
|
|
1692
1687
|
refState.current.isStartReached = checkThreshold(
|
|
1693
1688
|
distanceFromTop,
|
|
1694
1689
|
false,
|
|
@@ -1709,6 +1704,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1709
1704
|
if (state) {
|
|
1710
1705
|
state.data = dataProp;
|
|
1711
1706
|
if (!isFirst2) {
|
|
1707
|
+
state.disableAveragesForScrolls = 2;
|
|
1712
1708
|
refState.current.scrollForNextCalculateItemsInView = void 0;
|
|
1713
1709
|
const numContainers = peek$(ctx, "numContainers");
|
|
1714
1710
|
for (let i = 0; i < numContainers; i++) {
|
|
@@ -1934,15 +1930,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1934
1930
|
state.minIndexSizeChanged = state.minIndexSizeChanged !== void 0 ? Math.min(state.minIndexSizeChanged, index) : index;
|
|
1935
1931
|
const prevSize = getItemSize(itemKey, index, data);
|
|
1936
1932
|
let needsCalculate = false;
|
|
1937
|
-
|
|
1938
|
-
if (state.numPendingInitialLayout > 0) {
|
|
1939
|
-
state.numPendingInitialLayout--;
|
|
1940
|
-
if (state.numPendingInitialLayout === 0) {
|
|
1941
|
-
needsCalculate = true;
|
|
1942
|
-
state.numPendingInitialLayout = -1;
|
|
1943
|
-
needsUpdateContainersDidLayout = true;
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1933
|
+
const needsUpdateContainersDidLayout = !peek$(ctx, "containersDidLayout");
|
|
1946
1934
|
sizesKnown.set(itemKey, size);
|
|
1947
1935
|
const itemType = "";
|
|
1948
1936
|
let averages = averageSizes[itemType];
|
|
@@ -1954,7 +1942,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1954
1942
|
}
|
|
1955
1943
|
averages.avg = (averages.avg * averages.num + size) / (averages.num + 1);
|
|
1956
1944
|
averages.num++;
|
|
1957
|
-
if (!prevSize || Math.abs(prevSize - size) > 0.
|
|
1945
|
+
if (!prevSize || Math.abs(prevSize - size) > 0.1) {
|
|
1958
1946
|
let diff;
|
|
1959
1947
|
needsCalculate = true;
|
|
1960
1948
|
if (numColumns > 1) {
|
|
@@ -1998,7 +1986,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1998
1986
|
if (needsUpdateContainersDidLayout || !fromFixGaps && needsCalculate && isInView) {
|
|
1999
1987
|
const scrollVelocity = state.scrollVelocity;
|
|
2000
1988
|
let didCalculate = false;
|
|
2001
|
-
if ((Number.isNaN(scrollVelocity) || Math.abs(scrollVelocity) < 1) && (!waitForInitialLayout ||
|
|
1989
|
+
if ((Number.isNaN(scrollVelocity) || Math.abs(scrollVelocity) < 1) && (!waitForInitialLayout || needsUpdateContainersDidLayout)) {
|
|
2002
1990
|
if (Date.now() - state.lastBatchingAction < 500) {
|
|
2003
1991
|
if (!state.queuedCalculateItemsInView) {
|
|
2004
1992
|
state.queuedCalculateItemsInView = requestAnimationFrame(() => {
|
|
@@ -2011,7 +1999,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2011
1999
|
didCalculate = true;
|
|
2012
2000
|
}
|
|
2013
2001
|
}
|
|
2014
|
-
if (!didCalculate && IsNewArchitecture) {
|
|
2002
|
+
if (!didCalculate && !needsUpdateContainersDidLayout && IsNewArchitecture) {
|
|
2015
2003
|
fixGaps();
|
|
2016
2004
|
}
|
|
2017
2005
|
}
|
|
@@ -2090,6 +2078,9 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2090
2078
|
if (!fromSelf) {
|
|
2091
2079
|
(_d = state.onScroll) == null ? void 0 : _d.call(state, event);
|
|
2092
2080
|
}
|
|
2081
|
+
if (state.disableAveragesForScrolls) {
|
|
2082
|
+
state.disableAveragesForScrolls--;
|
|
2083
|
+
}
|
|
2093
2084
|
},
|
|
2094
2085
|
[]
|
|
2095
2086
|
);
|
|
@@ -1,140 +1,16 @@
|
|
|
1
|
-
import * as react_native_reanimated_lib_typescript_layoutReanimation_animationBuilder_Keyframe from 'react-native-reanimated/lib/typescript/layoutReanimation/animationBuilder/Keyframe';
|
|
2
|
-
import * as react_native_reanimated from 'react-native-reanimated';
|
|
3
|
-
import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
|
|
4
1
|
import * as _legendapp_list from '@legendapp/list';
|
|
5
2
|
import { LegendListRef } from '@legendapp/list';
|
|
3
|
+
import * as react_native_reanimated_lib_typescript_layoutReanimation_animationBuilder_Keyframe from 'react-native-reanimated/lib/typescript/layoutReanimation/animationBuilder/Keyframe';
|
|
6
4
|
import * as react_native from 'react-native';
|
|
7
5
|
import { Insets } from 'react-native';
|
|
6
|
+
import * as react_native_reanimated from 'react-native-reanimated';
|
|
7
|
+
import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
|
|
10
|
-
declare const LegendList: <ItemT, ListT extends (<
|
|
11
|
-
alignItemsAtEnd?: boolean;
|
|
12
|
-
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
13
|
-
data: readonly T[];
|
|
14
|
-
drawDistance?: number;
|
|
15
|
-
estimatedItemSize?: number;
|
|
16
|
-
extraData?: any;
|
|
17
|
-
getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
|
|
18
|
-
initialContainerPoolRatio?: number | undefined;
|
|
19
|
-
initialScrollOffset?: number;
|
|
20
|
-
initialScrollIndex?: number;
|
|
21
|
-
ItemSeparatorComponent?: React.ComponentType<{
|
|
22
|
-
leadingItem: T;
|
|
23
|
-
}> | undefined;
|
|
24
|
-
keyExtractor?: ((item: T, index: number) => string) | undefined;
|
|
25
|
-
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
26
|
-
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
27
|
-
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
28
|
-
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
29
|
-
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
30
|
-
maintainScrollAtEnd?: boolean;
|
|
31
|
-
maintainScrollAtEndThreshold?: number;
|
|
32
|
-
maintainVisibleContentPosition?: boolean;
|
|
33
|
-
numColumns?: number;
|
|
34
|
-
onEndReached?: ((info: {
|
|
35
|
-
distanceFromEnd: number;
|
|
36
|
-
}) => void) | null | undefined;
|
|
37
|
-
onEndReachedThreshold?: number | null | undefined;
|
|
38
|
-
onItemSizeChanged?: ((info: {
|
|
39
|
-
size: number;
|
|
40
|
-
previous: number;
|
|
41
|
-
index: number;
|
|
42
|
-
itemKey: string;
|
|
43
|
-
itemData: T;
|
|
44
|
-
}) => void) | undefined;
|
|
45
|
-
onRefresh?: () => void;
|
|
46
|
-
onStartReached?: ((info: {
|
|
47
|
-
distanceFromStart: number;
|
|
48
|
-
}) => void) | null | undefined;
|
|
49
|
-
onStartReachedThreshold?: number | null | undefined;
|
|
50
|
-
onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
|
|
51
|
-
progressViewOffset?: number;
|
|
52
|
-
recycleItems?: boolean;
|
|
53
|
-
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
54
|
-
refreshing?: boolean;
|
|
55
|
-
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
|
|
56
|
-
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
57
|
-
suggestEstimatedItemSize?: boolean;
|
|
58
|
-
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
59
|
-
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
60
|
-
waitForInitialLayout?: boolean;
|
|
61
|
-
} & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
|
|
62
|
-
alignItemsAtEnd?: boolean;
|
|
63
|
-
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
64
|
-
data: readonly T[];
|
|
65
|
-
drawDistance?: number;
|
|
66
|
-
estimatedItemSize?: number;
|
|
67
|
-
extraData?: any;
|
|
68
|
-
getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
|
|
69
|
-
initialContainerPoolRatio?: number | undefined;
|
|
70
|
-
initialScrollOffset?: number;
|
|
71
|
-
initialScrollIndex?: number;
|
|
72
|
-
ItemSeparatorComponent?: React.ComponentType<{
|
|
73
|
-
leadingItem: T;
|
|
74
|
-
}> | undefined;
|
|
75
|
-
keyExtractor?: ((item: T, index: number) => string) | undefined;
|
|
76
|
-
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
77
|
-
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
78
|
-
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
79
|
-
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
80
|
-
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
81
|
-
maintainScrollAtEnd?: boolean;
|
|
82
|
-
maintainScrollAtEndThreshold?: number;
|
|
83
|
-
maintainVisibleContentPosition?: boolean;
|
|
84
|
-
numColumns?: number;
|
|
85
|
-
onEndReached?: ((info: {
|
|
86
|
-
distanceFromEnd: number;
|
|
87
|
-
}) => void) | null | undefined;
|
|
88
|
-
onEndReachedThreshold?: number | null | undefined;
|
|
89
|
-
onItemSizeChanged?: ((info: {
|
|
90
|
-
size: number;
|
|
91
|
-
previous: number;
|
|
92
|
-
index: number;
|
|
93
|
-
itemKey: string;
|
|
94
|
-
itemData: T;
|
|
95
|
-
}) => void) | undefined;
|
|
96
|
-
onRefresh?: () => void;
|
|
97
|
-
onStartReached?: ((info: {
|
|
98
|
-
distanceFromStart: number;
|
|
99
|
-
}) => void) | null | undefined;
|
|
100
|
-
onStartReachedThreshold?: number | null | undefined;
|
|
101
|
-
onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
|
|
102
|
-
progressViewOffset?: number;
|
|
103
|
-
recycleItems?: boolean;
|
|
104
|
-
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
105
|
-
refreshing?: boolean;
|
|
106
|
-
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
|
|
107
|
-
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
108
|
-
suggestEstimatedItemSize?: boolean;
|
|
109
|
-
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
110
|
-
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
111
|
-
waitForInitialLayout?: boolean;
|
|
112
|
-
} & React.RefAttributes<LegendListRef>) => React.ReactNode)> | (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
|
|
10
|
+
declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
|
|
113
11
|
getEstimatedItemSize?: ((index: number, item: ItemT_1) => number) | undefined;
|
|
114
|
-
ItemSeparatorComponent?: React.ComponentType<{
|
|
115
|
-
leadingItem: ItemT_1;
|
|
116
|
-
}> | undefined;
|
|
117
12
|
keyExtractor?: ((item: ItemT_1, index: number) => string) | undefined;
|
|
118
|
-
onItemSizeChanged?: ((info: {
|
|
119
|
-
size: number;
|
|
120
|
-
previous: number;
|
|
121
|
-
index: number;
|
|
122
|
-
itemKey: string;
|
|
123
|
-
itemData: ItemT_1;
|
|
124
|
-
}) => void) | undefined;
|
|
125
|
-
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | undefined;
|
|
126
13
|
animatedProps?: Partial<{
|
|
127
|
-
contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
|
|
128
|
-
contentInset?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
|
|
129
|
-
maintainVisibleContentPosition?: {
|
|
130
|
-
autoscrollToTopThreshold?: number | null | undefined;
|
|
131
|
-
minIndexForVisible: number;
|
|
132
|
-
} | react_native_reanimated.SharedValue<{
|
|
133
|
-
autoscrollToTopThreshold?: number | null | undefined;
|
|
134
|
-
minIndexForVisible: number;
|
|
135
|
-
} | null | undefined> | null | undefined;
|
|
136
|
-
stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
|
|
137
|
-
scrollEventThrottle?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
138
14
|
decelerationRate?: number | "fast" | "normal" | react_native_reanimated.SharedValue<number | "fast" | "normal" | undefined> | undefined;
|
|
139
15
|
horizontal?: boolean | react_native_reanimated.SharedValue<boolean | null | undefined> | null | undefined;
|
|
140
16
|
invertStickyHeaders?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
@@ -157,6 +33,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
157
33
|
snapToOffsets?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
|
|
158
34
|
snapToStart?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
159
35
|
snapToEnd?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
36
|
+
stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
|
|
160
37
|
disableIntervalMomentum?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
161
38
|
disableScrollViewPanResponder?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
162
39
|
StickyHeaderComponent?: React.ComponentType<any> | react_native_reanimated.SharedValue<React.ComponentType<any> | undefined> | undefined;
|
|
@@ -260,16 +137,26 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
260
137
|
bouncesZoom?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
261
138
|
canCancelContentTouches?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
262
139
|
centerContent?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
140
|
+
contentInset?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
|
|
141
|
+
contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
|
|
263
142
|
contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes" | react_native_reanimated.SharedValue<"always" | "never" | "automatic" | "scrollableAxes" | undefined> | undefined;
|
|
264
143
|
directionalLockEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
144
|
+
maintainVisibleContentPosition?: {
|
|
145
|
+
autoscrollToTopThreshold?: number | null | undefined;
|
|
146
|
+
minIndexForVisible: number;
|
|
147
|
+
} | react_native_reanimated.SharedValue<{
|
|
148
|
+
autoscrollToTopThreshold?: number | null | undefined;
|
|
149
|
+
minIndexForVisible: number;
|
|
150
|
+
} | null | undefined> | null | undefined;
|
|
265
151
|
maximumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
266
152
|
minimumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
267
153
|
onScrollAnimationEnd?: (() => void) | react_native_reanimated.SharedValue<(() => void) | undefined> | undefined;
|
|
268
154
|
pinchGestureEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
155
|
+
scrollEventThrottle?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
269
156
|
scrollIndicatorInsets?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
|
|
270
157
|
scrollToOverflowEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
271
158
|
scrollsToTop?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
272
|
-
snapToAlignment?: "
|
|
159
|
+
snapToAlignment?: "center" | "start" | "end" | react_native_reanimated.SharedValue<"center" | "start" | "end" | undefined> | undefined;
|
|
273
160
|
onScrollToTop?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
|
|
274
161
|
zoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
275
162
|
endFillColor?: react_native.ColorValue | react_native_reanimated.SharedValue<react_native.ColorValue | undefined> | undefined;
|
|
@@ -279,8 +166,8 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
279
166
|
fadingEdgeLength?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
280
167
|
persistentScrollbar?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
281
168
|
} & {
|
|
282
|
-
contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
|
|
283
169
|
style?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
|
|
170
|
+
contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
|
|
284
171
|
indicatorStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<"default" | "black" | "white" | undefined>>;
|
|
285
172
|
} & {
|
|
286
173
|
layout?: react_native_reanimated.BaseAnimationBuilder | react_native_reanimated.LayoutAnimationFunction | typeof react_native_reanimated.BaseAnimationBuilder;
|
|
@@ -290,9 +177,122 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
290
177
|
sharedTransitionTag?: string;
|
|
291
178
|
sharedTransitionStyle?: react_native_reanimated.SharedTransition;
|
|
292
179
|
}> | undefined;
|
|
180
|
+
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | undefined;
|
|
181
|
+
onItemSizeChanged?: ((info: {
|
|
182
|
+
size: number;
|
|
183
|
+
previous: number;
|
|
184
|
+
index: number;
|
|
185
|
+
itemKey: string;
|
|
186
|
+
itemData: ItemT_1;
|
|
187
|
+
}) => void) | undefined;
|
|
188
|
+
ItemSeparatorComponent?: React.ComponentType<{
|
|
189
|
+
leadingItem: ItemT_1;
|
|
190
|
+
}> | undefined;
|
|
293
191
|
} & {
|
|
294
192
|
ref?: React.Ref<LegendListRef>;
|
|
295
|
-
}) => React.ReactElement | null)
|
|
193
|
+
}) => React.ReactElement | null) | (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
194
|
+
alignItemsAtEnd?: boolean;
|
|
195
|
+
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
196
|
+
data: readonly T[];
|
|
197
|
+
drawDistance?: number;
|
|
198
|
+
estimatedItemSize?: number;
|
|
199
|
+
extraData?: any;
|
|
200
|
+
getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
|
|
201
|
+
initialContainerPoolRatio?: number | undefined;
|
|
202
|
+
initialScrollOffset?: number;
|
|
203
|
+
initialScrollIndex?: number;
|
|
204
|
+
ItemSeparatorComponent?: React.ComponentType<{
|
|
205
|
+
leadingItem: T;
|
|
206
|
+
}> | undefined;
|
|
207
|
+
keyExtractor?: ((item: T, index: number) => string) | undefined;
|
|
208
|
+
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
209
|
+
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
210
|
+
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
211
|
+
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
212
|
+
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
213
|
+
maintainScrollAtEnd?: boolean;
|
|
214
|
+
maintainScrollAtEndThreshold?: number;
|
|
215
|
+
maintainVisibleContentPosition?: boolean;
|
|
216
|
+
numColumns?: number;
|
|
217
|
+
onEndReached?: ((info: {
|
|
218
|
+
distanceFromEnd: number;
|
|
219
|
+
}) => void) | null | undefined;
|
|
220
|
+
onEndReachedThreshold?: number | null | undefined;
|
|
221
|
+
onItemSizeChanged?: ((info: {
|
|
222
|
+
size: number;
|
|
223
|
+
previous: number;
|
|
224
|
+
index: number;
|
|
225
|
+
itemKey: string;
|
|
226
|
+
itemData: T;
|
|
227
|
+
}) => void) | undefined;
|
|
228
|
+
onRefresh?: () => void;
|
|
229
|
+
onStartReached?: ((info: {
|
|
230
|
+
distanceFromStart: number;
|
|
231
|
+
}) => void) | null | undefined;
|
|
232
|
+
onStartReachedThreshold?: number | null | undefined;
|
|
233
|
+
onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
|
|
234
|
+
progressViewOffset?: number;
|
|
235
|
+
recycleItems?: boolean;
|
|
236
|
+
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
237
|
+
refreshing?: boolean;
|
|
238
|
+
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
|
|
239
|
+
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
240
|
+
suggestEstimatedItemSize?: boolean;
|
|
241
|
+
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
242
|
+
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
243
|
+
waitForInitialLayout?: boolean;
|
|
244
|
+
} & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
245
|
+
alignItemsAtEnd?: boolean;
|
|
246
|
+
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
247
|
+
data: readonly T[];
|
|
248
|
+
drawDistance?: number;
|
|
249
|
+
estimatedItemSize?: number;
|
|
250
|
+
extraData?: any;
|
|
251
|
+
getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
|
|
252
|
+
initialContainerPoolRatio?: number | undefined;
|
|
253
|
+
initialScrollOffset?: number;
|
|
254
|
+
initialScrollIndex?: number;
|
|
255
|
+
ItemSeparatorComponent?: React.ComponentType<{
|
|
256
|
+
leadingItem: T;
|
|
257
|
+
}> | undefined;
|
|
258
|
+
keyExtractor?: ((item: T, index: number) => string) | undefined;
|
|
259
|
+
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
260
|
+
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
261
|
+
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
262
|
+
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
263
|
+
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
264
|
+
maintainScrollAtEnd?: boolean;
|
|
265
|
+
maintainScrollAtEndThreshold?: number;
|
|
266
|
+
maintainVisibleContentPosition?: boolean;
|
|
267
|
+
numColumns?: number;
|
|
268
|
+
onEndReached?: ((info: {
|
|
269
|
+
distanceFromEnd: number;
|
|
270
|
+
}) => void) | null | undefined;
|
|
271
|
+
onEndReachedThreshold?: number | null | undefined;
|
|
272
|
+
onItemSizeChanged?: ((info: {
|
|
273
|
+
size: number;
|
|
274
|
+
previous: number;
|
|
275
|
+
index: number;
|
|
276
|
+
itemKey: string;
|
|
277
|
+
itemData: T;
|
|
278
|
+
}) => void) | undefined;
|
|
279
|
+
onRefresh?: () => void;
|
|
280
|
+
onStartReached?: ((info: {
|
|
281
|
+
distanceFromStart: number;
|
|
282
|
+
}) => void) | null | undefined;
|
|
283
|
+
onStartReachedThreshold?: number | null | undefined;
|
|
284
|
+
onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
|
|
285
|
+
progressViewOffset?: number;
|
|
286
|
+
recycleItems?: boolean;
|
|
287
|
+
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
288
|
+
refreshing?: boolean;
|
|
289
|
+
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
|
|
290
|
+
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
291
|
+
suggestEstimatedItemSize?: boolean;
|
|
292
|
+
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
293
|
+
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
294
|
+
waitForInitialLayout?: boolean;
|
|
295
|
+
} & React.RefAttributes<LegendListRef>) => React.ReactNode)> = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
296
296
|
alignItemsAtEnd?: boolean;
|
|
297
297
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
298
298
|
data: readonly T[];
|
|
@@ -343,7 +343,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
343
343
|
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
344
344
|
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
345
345
|
waitForInitialLayout?: boolean;
|
|
346
|
-
} & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "
|
|
346
|
+
} & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
347
347
|
alignItemsAtEnd?: boolean;
|
|
348
348
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
349
349
|
data: readonly ItemT[];
|
package/keyboard-controller.d.ts
CHANGED
|
@@ -1,140 +1,16 @@
|
|
|
1
|
-
import * as react_native_reanimated_lib_typescript_layoutReanimation_animationBuilder_Keyframe from 'react-native-reanimated/lib/typescript/layoutReanimation/animationBuilder/Keyframe';
|
|
2
|
-
import * as react_native_reanimated from 'react-native-reanimated';
|
|
3
|
-
import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
|
|
4
1
|
import * as _legendapp_list from '@legendapp/list';
|
|
5
2
|
import { LegendListRef } from '@legendapp/list';
|
|
3
|
+
import * as react_native_reanimated_lib_typescript_layoutReanimation_animationBuilder_Keyframe from 'react-native-reanimated/lib/typescript/layoutReanimation/animationBuilder/Keyframe';
|
|
6
4
|
import * as react_native from 'react-native';
|
|
7
5
|
import { Insets } from 'react-native';
|
|
6
|
+
import * as react_native_reanimated from 'react-native-reanimated';
|
|
7
|
+
import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
|
|
10
|
-
declare const LegendList: <ItemT, ListT extends (<
|
|
11
|
-
alignItemsAtEnd?: boolean;
|
|
12
|
-
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
13
|
-
data: readonly T[];
|
|
14
|
-
drawDistance?: number;
|
|
15
|
-
estimatedItemSize?: number;
|
|
16
|
-
extraData?: any;
|
|
17
|
-
getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
|
|
18
|
-
initialContainerPoolRatio?: number | undefined;
|
|
19
|
-
initialScrollOffset?: number;
|
|
20
|
-
initialScrollIndex?: number;
|
|
21
|
-
ItemSeparatorComponent?: React.ComponentType<{
|
|
22
|
-
leadingItem: T;
|
|
23
|
-
}> | undefined;
|
|
24
|
-
keyExtractor?: ((item: T, index: number) => string) | undefined;
|
|
25
|
-
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
26
|
-
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
27
|
-
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
28
|
-
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
29
|
-
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
30
|
-
maintainScrollAtEnd?: boolean;
|
|
31
|
-
maintainScrollAtEndThreshold?: number;
|
|
32
|
-
maintainVisibleContentPosition?: boolean;
|
|
33
|
-
numColumns?: number;
|
|
34
|
-
onEndReached?: ((info: {
|
|
35
|
-
distanceFromEnd: number;
|
|
36
|
-
}) => void) | null | undefined;
|
|
37
|
-
onEndReachedThreshold?: number | null | undefined;
|
|
38
|
-
onItemSizeChanged?: ((info: {
|
|
39
|
-
size: number;
|
|
40
|
-
previous: number;
|
|
41
|
-
index: number;
|
|
42
|
-
itemKey: string;
|
|
43
|
-
itemData: T;
|
|
44
|
-
}) => void) | undefined;
|
|
45
|
-
onRefresh?: () => void;
|
|
46
|
-
onStartReached?: ((info: {
|
|
47
|
-
distanceFromStart: number;
|
|
48
|
-
}) => void) | null | undefined;
|
|
49
|
-
onStartReachedThreshold?: number | null | undefined;
|
|
50
|
-
onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
|
|
51
|
-
progressViewOffset?: number;
|
|
52
|
-
recycleItems?: boolean;
|
|
53
|
-
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
54
|
-
refreshing?: boolean;
|
|
55
|
-
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
|
|
56
|
-
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
57
|
-
suggestEstimatedItemSize?: boolean;
|
|
58
|
-
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
59
|
-
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
60
|
-
waitForInitialLayout?: boolean;
|
|
61
|
-
} & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
|
|
62
|
-
alignItemsAtEnd?: boolean;
|
|
63
|
-
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
64
|
-
data: readonly T[];
|
|
65
|
-
drawDistance?: number;
|
|
66
|
-
estimatedItemSize?: number;
|
|
67
|
-
extraData?: any;
|
|
68
|
-
getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
|
|
69
|
-
initialContainerPoolRatio?: number | undefined;
|
|
70
|
-
initialScrollOffset?: number;
|
|
71
|
-
initialScrollIndex?: number;
|
|
72
|
-
ItemSeparatorComponent?: React.ComponentType<{
|
|
73
|
-
leadingItem: T;
|
|
74
|
-
}> | undefined;
|
|
75
|
-
keyExtractor?: ((item: T, index: number) => string) | undefined;
|
|
76
|
-
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
77
|
-
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
78
|
-
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
79
|
-
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
80
|
-
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
81
|
-
maintainScrollAtEnd?: boolean;
|
|
82
|
-
maintainScrollAtEndThreshold?: number;
|
|
83
|
-
maintainVisibleContentPosition?: boolean;
|
|
84
|
-
numColumns?: number;
|
|
85
|
-
onEndReached?: ((info: {
|
|
86
|
-
distanceFromEnd: number;
|
|
87
|
-
}) => void) | null | undefined;
|
|
88
|
-
onEndReachedThreshold?: number | null | undefined;
|
|
89
|
-
onItemSizeChanged?: ((info: {
|
|
90
|
-
size: number;
|
|
91
|
-
previous: number;
|
|
92
|
-
index: number;
|
|
93
|
-
itemKey: string;
|
|
94
|
-
itemData: T;
|
|
95
|
-
}) => void) | undefined;
|
|
96
|
-
onRefresh?: () => void;
|
|
97
|
-
onStartReached?: ((info: {
|
|
98
|
-
distanceFromStart: number;
|
|
99
|
-
}) => void) | null | undefined;
|
|
100
|
-
onStartReachedThreshold?: number | null | undefined;
|
|
101
|
-
onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
|
|
102
|
-
progressViewOffset?: number;
|
|
103
|
-
recycleItems?: boolean;
|
|
104
|
-
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
105
|
-
refreshing?: boolean;
|
|
106
|
-
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
|
|
107
|
-
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
108
|
-
suggestEstimatedItemSize?: boolean;
|
|
109
|
-
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
110
|
-
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
111
|
-
waitForInitialLayout?: boolean;
|
|
112
|
-
} & React.RefAttributes<LegendListRef>) => React.ReactNode)> | (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
|
|
10
|
+
declare const LegendList: <ItemT, ListT extends (<ItemT_1>(props: Omit<_legendapp_list_reanimated.AnimatedLegendListPropsBase<ItemT_1>, "refLegendList"> & {
|
|
113
11
|
getEstimatedItemSize?: ((index: number, item: ItemT_1) => number) | undefined;
|
|
114
|
-
ItemSeparatorComponent?: React.ComponentType<{
|
|
115
|
-
leadingItem: ItemT_1;
|
|
116
|
-
}> | undefined;
|
|
117
12
|
keyExtractor?: ((item: ItemT_1, index: number) => string) | undefined;
|
|
118
|
-
onItemSizeChanged?: ((info: {
|
|
119
|
-
size: number;
|
|
120
|
-
previous: number;
|
|
121
|
-
index: number;
|
|
122
|
-
itemKey: string;
|
|
123
|
-
itemData: ItemT_1;
|
|
124
|
-
}) => void) | undefined;
|
|
125
|
-
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | undefined;
|
|
126
13
|
animatedProps?: Partial<{
|
|
127
|
-
contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
|
|
128
|
-
contentInset?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
|
|
129
|
-
maintainVisibleContentPosition?: {
|
|
130
|
-
autoscrollToTopThreshold?: number | null | undefined;
|
|
131
|
-
minIndexForVisible: number;
|
|
132
|
-
} | react_native_reanimated.SharedValue<{
|
|
133
|
-
autoscrollToTopThreshold?: number | null | undefined;
|
|
134
|
-
minIndexForVisible: number;
|
|
135
|
-
} | null | undefined> | null | undefined;
|
|
136
|
-
stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
|
|
137
|
-
scrollEventThrottle?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
138
14
|
decelerationRate?: number | "fast" | "normal" | react_native_reanimated.SharedValue<number | "fast" | "normal" | undefined> | undefined;
|
|
139
15
|
horizontal?: boolean | react_native_reanimated.SharedValue<boolean | null | undefined> | null | undefined;
|
|
140
16
|
invertStickyHeaders?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
@@ -157,6 +33,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
157
33
|
snapToOffsets?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
|
|
158
34
|
snapToStart?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
159
35
|
snapToEnd?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
36
|
+
stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
|
|
160
37
|
disableIntervalMomentum?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
161
38
|
disableScrollViewPanResponder?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
162
39
|
StickyHeaderComponent?: React.ComponentType<any> | react_native_reanimated.SharedValue<React.ComponentType<any> | undefined> | undefined;
|
|
@@ -260,16 +137,26 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
260
137
|
bouncesZoom?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
261
138
|
canCancelContentTouches?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
262
139
|
centerContent?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
140
|
+
contentInset?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
|
|
141
|
+
contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
|
|
263
142
|
contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes" | react_native_reanimated.SharedValue<"always" | "never" | "automatic" | "scrollableAxes" | undefined> | undefined;
|
|
264
143
|
directionalLockEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
144
|
+
maintainVisibleContentPosition?: {
|
|
145
|
+
autoscrollToTopThreshold?: number | null | undefined;
|
|
146
|
+
minIndexForVisible: number;
|
|
147
|
+
} | react_native_reanimated.SharedValue<{
|
|
148
|
+
autoscrollToTopThreshold?: number | null | undefined;
|
|
149
|
+
minIndexForVisible: number;
|
|
150
|
+
} | null | undefined> | null | undefined;
|
|
265
151
|
maximumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
266
152
|
minimumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
267
153
|
onScrollAnimationEnd?: (() => void) | react_native_reanimated.SharedValue<(() => void) | undefined> | undefined;
|
|
268
154
|
pinchGestureEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
155
|
+
scrollEventThrottle?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
269
156
|
scrollIndicatorInsets?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
|
|
270
157
|
scrollToOverflowEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
271
158
|
scrollsToTop?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
272
|
-
snapToAlignment?: "
|
|
159
|
+
snapToAlignment?: "center" | "start" | "end" | react_native_reanimated.SharedValue<"center" | "start" | "end" | undefined> | undefined;
|
|
273
160
|
onScrollToTop?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
|
|
274
161
|
zoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
275
162
|
endFillColor?: react_native.ColorValue | react_native_reanimated.SharedValue<react_native.ColorValue | undefined> | undefined;
|
|
@@ -279,8 +166,8 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
279
166
|
fadingEdgeLength?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
280
167
|
persistentScrollbar?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
281
168
|
} & {
|
|
282
|
-
contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
|
|
283
169
|
style?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
|
|
170
|
+
contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
|
|
284
171
|
indicatorStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<"default" | "black" | "white" | undefined>>;
|
|
285
172
|
} & {
|
|
286
173
|
layout?: react_native_reanimated.BaseAnimationBuilder | react_native_reanimated.LayoutAnimationFunction | typeof react_native_reanimated.BaseAnimationBuilder;
|
|
@@ -290,9 +177,122 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
290
177
|
sharedTransitionTag?: string;
|
|
291
178
|
sharedTransitionStyle?: react_native_reanimated.SharedTransition;
|
|
292
179
|
}> | undefined;
|
|
180
|
+
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | undefined;
|
|
181
|
+
onItemSizeChanged?: ((info: {
|
|
182
|
+
size: number;
|
|
183
|
+
previous: number;
|
|
184
|
+
index: number;
|
|
185
|
+
itemKey: string;
|
|
186
|
+
itemData: ItemT_1;
|
|
187
|
+
}) => void) | undefined;
|
|
188
|
+
ItemSeparatorComponent?: React.ComponentType<{
|
|
189
|
+
leadingItem: ItemT_1;
|
|
190
|
+
}> | undefined;
|
|
293
191
|
} & {
|
|
294
192
|
ref?: React.Ref<LegendListRef>;
|
|
295
|
-
}) => React.ReactElement | null)
|
|
193
|
+
}) => React.ReactElement | null) | (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
194
|
+
alignItemsAtEnd?: boolean;
|
|
195
|
+
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
196
|
+
data: readonly T[];
|
|
197
|
+
drawDistance?: number;
|
|
198
|
+
estimatedItemSize?: number;
|
|
199
|
+
extraData?: any;
|
|
200
|
+
getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
|
|
201
|
+
initialContainerPoolRatio?: number | undefined;
|
|
202
|
+
initialScrollOffset?: number;
|
|
203
|
+
initialScrollIndex?: number;
|
|
204
|
+
ItemSeparatorComponent?: React.ComponentType<{
|
|
205
|
+
leadingItem: T;
|
|
206
|
+
}> | undefined;
|
|
207
|
+
keyExtractor?: ((item: T, index: number) => string) | undefined;
|
|
208
|
+
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
209
|
+
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
210
|
+
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
211
|
+
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
212
|
+
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
213
|
+
maintainScrollAtEnd?: boolean;
|
|
214
|
+
maintainScrollAtEndThreshold?: number;
|
|
215
|
+
maintainVisibleContentPosition?: boolean;
|
|
216
|
+
numColumns?: number;
|
|
217
|
+
onEndReached?: ((info: {
|
|
218
|
+
distanceFromEnd: number;
|
|
219
|
+
}) => void) | null | undefined;
|
|
220
|
+
onEndReachedThreshold?: number | null | undefined;
|
|
221
|
+
onItemSizeChanged?: ((info: {
|
|
222
|
+
size: number;
|
|
223
|
+
previous: number;
|
|
224
|
+
index: number;
|
|
225
|
+
itemKey: string;
|
|
226
|
+
itemData: T;
|
|
227
|
+
}) => void) | undefined;
|
|
228
|
+
onRefresh?: () => void;
|
|
229
|
+
onStartReached?: ((info: {
|
|
230
|
+
distanceFromStart: number;
|
|
231
|
+
}) => void) | null | undefined;
|
|
232
|
+
onStartReachedThreshold?: number | null | undefined;
|
|
233
|
+
onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
|
|
234
|
+
progressViewOffset?: number;
|
|
235
|
+
recycleItems?: boolean;
|
|
236
|
+
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
237
|
+
refreshing?: boolean;
|
|
238
|
+
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
|
|
239
|
+
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
240
|
+
suggestEstimatedItemSize?: boolean;
|
|
241
|
+
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
242
|
+
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
243
|
+
waitForInitialLayout?: boolean;
|
|
244
|
+
} & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
245
|
+
alignItemsAtEnd?: boolean;
|
|
246
|
+
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
247
|
+
data: readonly T[];
|
|
248
|
+
drawDistance?: number;
|
|
249
|
+
estimatedItemSize?: number;
|
|
250
|
+
extraData?: any;
|
|
251
|
+
getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
|
|
252
|
+
initialContainerPoolRatio?: number | undefined;
|
|
253
|
+
initialScrollOffset?: number;
|
|
254
|
+
initialScrollIndex?: number;
|
|
255
|
+
ItemSeparatorComponent?: React.ComponentType<{
|
|
256
|
+
leadingItem: T;
|
|
257
|
+
}> | undefined;
|
|
258
|
+
keyExtractor?: ((item: T, index: number) => string) | undefined;
|
|
259
|
+
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
260
|
+
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
261
|
+
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
262
|
+
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
263
|
+
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
264
|
+
maintainScrollAtEnd?: boolean;
|
|
265
|
+
maintainScrollAtEndThreshold?: number;
|
|
266
|
+
maintainVisibleContentPosition?: boolean;
|
|
267
|
+
numColumns?: number;
|
|
268
|
+
onEndReached?: ((info: {
|
|
269
|
+
distanceFromEnd: number;
|
|
270
|
+
}) => void) | null | undefined;
|
|
271
|
+
onEndReachedThreshold?: number | null | undefined;
|
|
272
|
+
onItemSizeChanged?: ((info: {
|
|
273
|
+
size: number;
|
|
274
|
+
previous: number;
|
|
275
|
+
index: number;
|
|
276
|
+
itemKey: string;
|
|
277
|
+
itemData: T;
|
|
278
|
+
}) => void) | undefined;
|
|
279
|
+
onRefresh?: () => void;
|
|
280
|
+
onStartReached?: ((info: {
|
|
281
|
+
distanceFromStart: number;
|
|
282
|
+
}) => void) | null | undefined;
|
|
283
|
+
onStartReachedThreshold?: number | null | undefined;
|
|
284
|
+
onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
|
|
285
|
+
progressViewOffset?: number;
|
|
286
|
+
recycleItems?: boolean;
|
|
287
|
+
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
288
|
+
refreshing?: boolean;
|
|
289
|
+
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
|
|
290
|
+
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
291
|
+
suggestEstimatedItemSize?: boolean;
|
|
292
|
+
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
293
|
+
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
294
|
+
waitForInitialLayout?: boolean;
|
|
295
|
+
} & React.RefAttributes<LegendListRef>) => React.ReactNode)> = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
296
296
|
alignItemsAtEnd?: boolean;
|
|
297
297
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
298
298
|
data: readonly T[];
|
|
@@ -343,7 +343,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
343
343
|
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
344
344
|
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
345
345
|
waitForInitialLayout?: boolean;
|
|
346
|
-
} & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "
|
|
346
|
+
} & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
347
347
|
alignItemsAtEnd?: boolean;
|
|
348
348
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
349
349
|
data: readonly ItemT[];
|
package/package.json
CHANGED