@legendapp/list 1.0.3 → 1.0.4
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 +3 -0
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.js +87 -39
- package/index.mjs +87 -39
- package/keyboard-controller.d.mts +133 -133
- package/keyboard-controller.d.ts +133 -133
- package/package.json +1 -1
package/README.md
CHANGED
package/index.d.mts
CHANGED
|
@@ -57,7 +57,7 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
|
|
|
57
57
|
getEstimatedItemSize?: (index: number, item: ItemT) => number;
|
|
58
58
|
/**
|
|
59
59
|
* Ratio of initial container pool size to data length (e.g., 0.5 for half).
|
|
60
|
-
* @default
|
|
60
|
+
* @default 2
|
|
61
61
|
*/
|
|
62
62
|
initialContainerPoolRatio?: number | undefined;
|
|
63
63
|
/**
|
|
@@ -276,7 +276,7 @@ interface InternalState {
|
|
|
276
276
|
queuedCalculateItemsInView: number | undefined;
|
|
277
277
|
lastBatchingAction: number;
|
|
278
278
|
ignoreScrollFromCalcTotal?: boolean;
|
|
279
|
-
|
|
279
|
+
disableScrollJumpsFrom?: number;
|
|
280
280
|
scrollingToOffset?: number | undefined;
|
|
281
281
|
averageSizes: Record<string, {
|
|
282
282
|
num: number;
|
package/index.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof Scroll
|
|
|
57
57
|
getEstimatedItemSize?: (index: number, item: ItemT) => number;
|
|
58
58
|
/**
|
|
59
59
|
* Ratio of initial container pool size to data length (e.g., 0.5 for half).
|
|
60
|
-
* @default
|
|
60
|
+
* @default 2
|
|
61
61
|
*/
|
|
62
62
|
initialContainerPoolRatio?: number | undefined;
|
|
63
63
|
/**
|
|
@@ -276,7 +276,7 @@ interface InternalState {
|
|
|
276
276
|
queuedCalculateItemsInView: number | undefined;
|
|
277
277
|
lastBatchingAction: number;
|
|
278
278
|
ignoreScrollFromCalcTotal?: boolean;
|
|
279
|
-
|
|
279
|
+
disableScrollJumpsFrom?: number;
|
|
280
280
|
scrollingToOffset?: number | undefined;
|
|
281
281
|
averageSizes: Record<string, {
|
|
282
282
|
num: number;
|
package/index.js
CHANGED
|
@@ -159,6 +159,9 @@ function warnDevOnce(id, text) {
|
|
|
159
159
|
function roundSize(size) {
|
|
160
160
|
return Math.floor(size * 8) / 8;
|
|
161
161
|
}
|
|
162
|
+
function isNullOrUndefined(value) {
|
|
163
|
+
return value === null || value === void 0;
|
|
164
|
+
}
|
|
162
165
|
var symbolFirst = Symbol();
|
|
163
166
|
function useInit(cb) {
|
|
164
167
|
const refValue = React2.useRef(symbolFirst);
|
|
@@ -335,20 +338,28 @@ var Container = ({
|
|
|
335
338
|
forceLayoutRender((v) => v + 1);
|
|
336
339
|
}, []);
|
|
337
340
|
const onLayout = (event) => {
|
|
338
|
-
|
|
341
|
+
var _a, _b;
|
|
342
|
+
if (!isNullOrUndefined(itemKey)) {
|
|
339
343
|
const layout = event.nativeEvent.layout;
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
344
|
+
let size = roundSize(layout[horizontal ? "width" : "height"]);
|
|
345
|
+
const doUpdate = () => {
|
|
346
|
+
refLastSize.current = size;
|
|
347
|
+
updateItemSize(itemKey, size);
|
|
348
|
+
};
|
|
349
|
+
if (IsNewArchitecture || size > 0) {
|
|
350
|
+
doUpdate();
|
|
351
|
+
} else {
|
|
352
|
+
(_b = (_a = ref.current) == null ? void 0 : _a.measure) == null ? void 0 : _b.call(_a, (x, y, width, height) => {
|
|
353
|
+
size = roundSize(horizontal ? width : height);
|
|
354
|
+
doUpdate();
|
|
355
|
+
});
|
|
343
356
|
}
|
|
344
|
-
refLastSize.current = size;
|
|
345
|
-
updateItemSize(itemKey, size);
|
|
346
357
|
}
|
|
347
358
|
};
|
|
348
359
|
if (IsNewArchitecture) {
|
|
349
360
|
React2.useLayoutEffect(() => {
|
|
350
361
|
var _a, _b;
|
|
351
|
-
if (itemKey
|
|
362
|
+
if (!isNullOrUndefined(itemKey)) {
|
|
352
363
|
const measured = (_b = (_a = ref.current) == null ? void 0 : _a.unstable_getBoundingClientRect) == null ? void 0 : _b.call(_a);
|
|
353
364
|
if (measured) {
|
|
354
365
|
const size = Math.floor(measured[horizontal ? "width" : "height"] * 8) / 8;
|
|
@@ -360,7 +371,7 @@ var Container = ({
|
|
|
360
371
|
}, [itemKey, layoutRenderCount]);
|
|
361
372
|
} else {
|
|
362
373
|
React2.useEffect(() => {
|
|
363
|
-
if (itemKey) {
|
|
374
|
+
if (!isNullOrUndefined(itemKey)) {
|
|
364
375
|
const timeout = setTimeout(() => {
|
|
365
376
|
if (refLastSize.current) {
|
|
366
377
|
updateItemSize(itemKey, refLastSize.current);
|
|
@@ -1227,6 +1238,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1227
1238
|
}
|
|
1228
1239
|
return map;
|
|
1229
1240
|
};
|
|
1241
|
+
const disableScrollJumps = (timeout) => {
|
|
1242
|
+
const state = refState.current;
|
|
1243
|
+
state.disableScrollJumpsFrom = state.scroll - state.scrollAdjustHandler.getAppliedAdjust();
|
|
1244
|
+
setTimeout(() => {
|
|
1245
|
+
state.disableScrollJumpsFrom = void 0;
|
|
1246
|
+
}, timeout);
|
|
1247
|
+
};
|
|
1230
1248
|
const getElementPositionBelowAchor = (id) => {
|
|
1231
1249
|
var _a;
|
|
1232
1250
|
const state = refState.current;
|
|
@@ -1305,6 +1323,18 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1305
1323
|
}
|
|
1306
1324
|
}
|
|
1307
1325
|
}, []);
|
|
1326
|
+
const checkAllSizesKnown = React2.useCallback(() => {
|
|
1327
|
+
const { startBuffered, endBuffered, sizesKnown } = refState.current;
|
|
1328
|
+
if (endBuffered !== null) {
|
|
1329
|
+
let areAllKnown = true;
|
|
1330
|
+
for (let i = startBuffered; areAllKnown && i <= endBuffered; i++) {
|
|
1331
|
+
const key = getId(i);
|
|
1332
|
+
areAllKnown && (areAllKnown = sizesKnown.has(key));
|
|
1333
|
+
}
|
|
1334
|
+
return areAllKnown;
|
|
1335
|
+
}
|
|
1336
|
+
return false;
|
|
1337
|
+
}, []);
|
|
1308
1338
|
const calculateItemsInView = React2.useCallback(() => {
|
|
1309
1339
|
var _a;
|
|
1310
1340
|
const state = refState.current;
|
|
@@ -1315,8 +1345,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1315
1345
|
positions,
|
|
1316
1346
|
columns,
|
|
1317
1347
|
scrollAdjustHandler,
|
|
1318
|
-
scrollVelocity: speed
|
|
1319
|
-
disableAveragesForScrolls
|
|
1348
|
+
scrollVelocity: speed
|
|
1320
1349
|
} = state;
|
|
1321
1350
|
if (!data || scrollLength === 0) {
|
|
1322
1351
|
return;
|
|
@@ -1327,7 +1356,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1327
1356
|
const previousScrollAdjust = scrollAdjustHandler.getAppliedAdjust();
|
|
1328
1357
|
const scrollExtra = Math.max(-16, Math.min(16, speed)) * 16;
|
|
1329
1358
|
let scrollState = state.scroll;
|
|
1330
|
-
const useAverageSize = !
|
|
1359
|
+
const useAverageSize = !state.disableScrollJumpsFrom;
|
|
1331
1360
|
if (!state.queuedInitialLayout && initialScrollIndex) {
|
|
1332
1361
|
const updatedOffset = calculateOffsetForIndex(initialScrollIndex);
|
|
1333
1362
|
scrollState = updatedOffset;
|
|
@@ -1466,6 +1495,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1466
1495
|
const prevNumContainers = ctx.values.get("numContainers");
|
|
1467
1496
|
let numContainers = prevNumContainers;
|
|
1468
1497
|
let didWarnMoreContainers = false;
|
|
1498
|
+
const allocatedContainers = /* @__PURE__ */ new Set();
|
|
1469
1499
|
for (let i = startBuffered; i <= endBuffered; i++) {
|
|
1470
1500
|
let isContained = false;
|
|
1471
1501
|
const id = getId(i);
|
|
@@ -1481,38 +1511,44 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1481
1511
|
let furthestIndex = -1;
|
|
1482
1512
|
let furthestDistance = 0;
|
|
1483
1513
|
for (let u = 0; u < numContainers; u++) {
|
|
1514
|
+
if (allocatedContainers.has(u)) {
|
|
1515
|
+
continue;
|
|
1516
|
+
}
|
|
1484
1517
|
const key = peek$(ctx, `containerItemKey${u}`);
|
|
1485
1518
|
if (key === void 0) {
|
|
1486
1519
|
furthestIndex = u;
|
|
1487
1520
|
break;
|
|
1488
1521
|
}
|
|
1489
|
-
const
|
|
1522
|
+
const index2 = state.indexByKey.get(key);
|
|
1490
1523
|
const pos = peek$(ctx, `containerPosition${u}`).top;
|
|
1491
|
-
if (
|
|
1524
|
+
if (isNullOrUndefined(index2) || pos === POSITION_OUT_OF_VIEW) {
|
|
1525
|
+
furthestIndex = u;
|
|
1526
|
+
break;
|
|
1527
|
+
}
|
|
1528
|
+
if (index2 < startBuffered || index2 > endBuffered) {
|
|
1492
1529
|
const distance = Math.abs(pos - top2);
|
|
1493
|
-
if (
|
|
1530
|
+
if (index2 < 0 || pos === POSITION_OUT_OF_VIEW || distance > furthestDistance) {
|
|
1494
1531
|
furthestDistance = distance;
|
|
1495
1532
|
furthestIndex = u;
|
|
1496
1533
|
}
|
|
1497
1534
|
}
|
|
1498
1535
|
}
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1536
|
+
const containerId = furthestIndex >= 0 ? furthestIndex : numContainers;
|
|
1537
|
+
set$(ctx, `containerItemKey${containerId}`, id);
|
|
1538
|
+
const index = state.indexByKey.get(id);
|
|
1539
|
+
set$(ctx, `containerItemData${containerId}`, data[index]);
|
|
1540
|
+
allocatedContainers.add(containerId);
|
|
1541
|
+
if (furthestIndex === -1) {
|
|
1505
1542
|
numContainers++;
|
|
1506
1543
|
set$(ctx, `containerItemKey${containerId}`, id);
|
|
1507
|
-
const
|
|
1508
|
-
set$(ctx, `containerItemData${containerId}`, data[
|
|
1544
|
+
const index2 = state.indexByKey.get(id);
|
|
1545
|
+
set$(ctx, `containerItemData${containerId}`, data[index2]);
|
|
1509
1546
|
set$(ctx, `containerPosition${containerId}`, ANCHORED_POSITION_OUT_OF_VIEW);
|
|
1510
1547
|
set$(ctx, `containerColumn${containerId}`, -1);
|
|
1511
1548
|
if (__DEV__ && !didWarnMoreContainers && numContainers > peek$(ctx, "numContainersPooled")) {
|
|
1512
1549
|
didWarnMoreContainers = true;
|
|
1513
1550
|
console.warn(
|
|
1514
|
-
"[legend-list] No container to recycle, so creating one on demand. This can be a minor performance issue and is likely caused by the estimatedItemSize being too large. Consider decreasing estimatedItemSize.
|
|
1515
|
-
numContainers
|
|
1551
|
+
"[legend-list] No container to recycle, so creating one on demand. This can be a minor performance issue and is likely caused by the estimatedItemSize being too large. Consider decreasing estimatedItemSize or increasing initialContainerPoolRatio."
|
|
1516
1552
|
);
|
|
1517
1553
|
}
|
|
1518
1554
|
}
|
|
@@ -1569,12 +1605,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1569
1605
|
}
|
|
1570
1606
|
}
|
|
1571
1607
|
if (!state.queuedInitialLayout && endBuffered !== null) {
|
|
1572
|
-
|
|
1573
|
-
for (let i = startBuffered; areAllKnown && i <= endBuffered; i++) {
|
|
1574
|
-
const key = getId(i);
|
|
1575
|
-
areAllKnown && (areAllKnown = state.sizesKnown.has(key));
|
|
1576
|
-
}
|
|
1577
|
-
if (areAllKnown) {
|
|
1608
|
+
if (checkAllSizesKnown()) {
|
|
1578
1609
|
setDidLayout();
|
|
1579
1610
|
}
|
|
1580
1611
|
}
|
|
@@ -1726,7 +1757,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1726
1757
|
if (state) {
|
|
1727
1758
|
state.data = dataProp;
|
|
1728
1759
|
if (!isFirst2) {
|
|
1729
|
-
|
|
1760
|
+
disableScrollJumps(2e3);
|
|
1730
1761
|
refState.current.scrollForNextCalculateItemsInView = void 0;
|
|
1731
1762
|
const numContainers = peek$(ctx, "numContainers");
|
|
1732
1763
|
for (let i = 0; i < numContainers; i++) {
|
|
@@ -1943,7 +1974,17 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1943
1974
|
});
|
|
1944
1975
|
const updateItemSize = React2.useCallback((itemKey, size, fromFixGaps) => {
|
|
1945
1976
|
const state = refState.current;
|
|
1946
|
-
const {
|
|
1977
|
+
const {
|
|
1978
|
+
sizes,
|
|
1979
|
+
indexByKey,
|
|
1980
|
+
sizesKnown,
|
|
1981
|
+
data,
|
|
1982
|
+
rowHeights,
|
|
1983
|
+
startBuffered,
|
|
1984
|
+
endBuffered,
|
|
1985
|
+
averageSizes,
|
|
1986
|
+
queuedInitialLayout
|
|
1987
|
+
} = state;
|
|
1947
1988
|
if (!data) {
|
|
1948
1989
|
return;
|
|
1949
1990
|
}
|
|
@@ -1952,7 +1993,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1952
1993
|
state.minIndexSizeChanged = state.minIndexSizeChanged !== void 0 ? Math.min(state.minIndexSizeChanged, index) : index;
|
|
1953
1994
|
const prevSize = getItemSize(itemKey, index, data);
|
|
1954
1995
|
let needsCalculate = false;
|
|
1955
|
-
|
|
1996
|
+
let needsUpdateContainersDidLayout = false;
|
|
1956
1997
|
sizesKnown.set(itemKey, size);
|
|
1957
1998
|
const itemType = "";
|
|
1958
1999
|
let averages = averageSizes[itemType];
|
|
@@ -1991,7 +2032,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1991
2032
|
);
|
|
1992
2033
|
}, 1e3);
|
|
1993
2034
|
}
|
|
1994
|
-
|
|
2035
|
+
state.scrollForNextCalculateItemsInView = void 0;
|
|
1995
2036
|
addTotalSize(itemKey, diff, 0);
|
|
1996
2037
|
doMaintainScrollAtEnd(false);
|
|
1997
2038
|
if (onItemSizeChanged) {
|
|
@@ -2004,11 +2045,14 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2004
2045
|
});
|
|
2005
2046
|
}
|
|
2006
2047
|
}
|
|
2048
|
+
if (!queuedInitialLayout && checkAllSizesKnown()) {
|
|
2049
|
+
needsUpdateContainersDidLayout = true;
|
|
2050
|
+
}
|
|
2007
2051
|
const isInView = index >= startBuffered && index <= endBuffered;
|
|
2008
|
-
if (needsUpdateContainersDidLayout || !fromFixGaps && needsCalculate && isInView) {
|
|
2052
|
+
if (needsUpdateContainersDidLayout || !fromFixGaps && needsCalculate && (isInView || !queuedInitialLayout)) {
|
|
2009
2053
|
const scrollVelocity = state.scrollVelocity;
|
|
2010
2054
|
let didCalculate = false;
|
|
2011
|
-
if ((Number.isNaN(scrollVelocity) || Math.abs(scrollVelocity) < 1) && (!waitForInitialLayout || needsUpdateContainersDidLayout)) {
|
|
2055
|
+
if ((Number.isNaN(scrollVelocity) || Math.abs(scrollVelocity) < 1) && (!waitForInitialLayout || needsUpdateContainersDidLayout || queuedInitialLayout)) {
|
|
2012
2056
|
if (Date.now() - state.lastBatchingAction < 500) {
|
|
2013
2057
|
if (!state.queuedCalculateItemsInView) {
|
|
2014
2058
|
state.queuedCalculateItemsInView = requestAnimationFrame(() => {
|
|
@@ -2066,6 +2110,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2066
2110
|
if (state.ignoreScrollFromCalcTotal && newScroll !== 0) {
|
|
2067
2111
|
return;
|
|
2068
2112
|
}
|
|
2113
|
+
if (state.disableScrollJumpsFrom !== void 0) {
|
|
2114
|
+
const scrollMinusAdjust = newScroll - state.scrollAdjustHandler.getAppliedAdjust();
|
|
2115
|
+
if (Math.abs(scrollMinusAdjust - state.disableScrollJumpsFrom) > 200) {
|
|
2116
|
+
return;
|
|
2117
|
+
}
|
|
2118
|
+
state.disableScrollJumpsFrom = void 0;
|
|
2119
|
+
}
|
|
2069
2120
|
state.hasScrolled = true;
|
|
2070
2121
|
state.lastBatchingAction = Date.now();
|
|
2071
2122
|
const currentTime = performance.now();
|
|
@@ -2100,9 +2151,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2100
2151
|
if (!fromSelf) {
|
|
2101
2152
|
(_d = state.onScroll) == null ? void 0 : _d.call(state, event);
|
|
2102
2153
|
}
|
|
2103
|
-
if (state.disableAveragesForScrolls) {
|
|
2104
|
-
state.disableAveragesForScrolls--;
|
|
2105
|
-
}
|
|
2106
2154
|
},
|
|
2107
2155
|
[]
|
|
2108
2156
|
);
|
package/index.mjs
CHANGED
|
@@ -138,6 +138,9 @@ function warnDevOnce(id, text) {
|
|
|
138
138
|
function roundSize(size) {
|
|
139
139
|
return Math.floor(size * 8) / 8;
|
|
140
140
|
}
|
|
141
|
+
function isNullOrUndefined(value) {
|
|
142
|
+
return value === null || value === void 0;
|
|
143
|
+
}
|
|
141
144
|
var symbolFirst = Symbol();
|
|
142
145
|
function useInit(cb) {
|
|
143
146
|
const refValue = useRef(symbolFirst);
|
|
@@ -314,20 +317,28 @@ var Container = ({
|
|
|
314
317
|
forceLayoutRender((v) => v + 1);
|
|
315
318
|
}, []);
|
|
316
319
|
const onLayout = (event) => {
|
|
317
|
-
|
|
320
|
+
var _a, _b;
|
|
321
|
+
if (!isNullOrUndefined(itemKey)) {
|
|
318
322
|
const layout = event.nativeEvent.layout;
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
323
|
+
let size = roundSize(layout[horizontal ? "width" : "height"]);
|
|
324
|
+
const doUpdate = () => {
|
|
325
|
+
refLastSize.current = size;
|
|
326
|
+
updateItemSize(itemKey, size);
|
|
327
|
+
};
|
|
328
|
+
if (IsNewArchitecture || size > 0) {
|
|
329
|
+
doUpdate();
|
|
330
|
+
} else {
|
|
331
|
+
(_b = (_a = ref.current) == null ? void 0 : _a.measure) == null ? void 0 : _b.call(_a, (x, y, width, height) => {
|
|
332
|
+
size = roundSize(horizontal ? width : height);
|
|
333
|
+
doUpdate();
|
|
334
|
+
});
|
|
322
335
|
}
|
|
323
|
-
refLastSize.current = size;
|
|
324
|
-
updateItemSize(itemKey, size);
|
|
325
336
|
}
|
|
326
337
|
};
|
|
327
338
|
if (IsNewArchitecture) {
|
|
328
339
|
useLayoutEffect(() => {
|
|
329
340
|
var _a, _b;
|
|
330
|
-
if (itemKey
|
|
341
|
+
if (!isNullOrUndefined(itemKey)) {
|
|
331
342
|
const measured = (_b = (_a = ref.current) == null ? void 0 : _a.unstable_getBoundingClientRect) == null ? void 0 : _b.call(_a);
|
|
332
343
|
if (measured) {
|
|
333
344
|
const size = Math.floor(measured[horizontal ? "width" : "height"] * 8) / 8;
|
|
@@ -339,7 +350,7 @@ var Container = ({
|
|
|
339
350
|
}, [itemKey, layoutRenderCount]);
|
|
340
351
|
} else {
|
|
341
352
|
useEffect(() => {
|
|
342
|
-
if (itemKey) {
|
|
353
|
+
if (!isNullOrUndefined(itemKey)) {
|
|
343
354
|
const timeout = setTimeout(() => {
|
|
344
355
|
if (refLastSize.current) {
|
|
345
356
|
updateItemSize(itemKey, refLastSize.current);
|
|
@@ -1206,6 +1217,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1206
1217
|
}
|
|
1207
1218
|
return map;
|
|
1208
1219
|
};
|
|
1220
|
+
const disableScrollJumps = (timeout) => {
|
|
1221
|
+
const state = refState.current;
|
|
1222
|
+
state.disableScrollJumpsFrom = state.scroll - state.scrollAdjustHandler.getAppliedAdjust();
|
|
1223
|
+
setTimeout(() => {
|
|
1224
|
+
state.disableScrollJumpsFrom = void 0;
|
|
1225
|
+
}, timeout);
|
|
1226
|
+
};
|
|
1209
1227
|
const getElementPositionBelowAchor = (id) => {
|
|
1210
1228
|
var _a;
|
|
1211
1229
|
const state = refState.current;
|
|
@@ -1284,6 +1302,18 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1284
1302
|
}
|
|
1285
1303
|
}
|
|
1286
1304
|
}, []);
|
|
1305
|
+
const checkAllSizesKnown = useCallback(() => {
|
|
1306
|
+
const { startBuffered, endBuffered, sizesKnown } = refState.current;
|
|
1307
|
+
if (endBuffered !== null) {
|
|
1308
|
+
let areAllKnown = true;
|
|
1309
|
+
for (let i = startBuffered; areAllKnown && i <= endBuffered; i++) {
|
|
1310
|
+
const key = getId(i);
|
|
1311
|
+
areAllKnown && (areAllKnown = sizesKnown.has(key));
|
|
1312
|
+
}
|
|
1313
|
+
return areAllKnown;
|
|
1314
|
+
}
|
|
1315
|
+
return false;
|
|
1316
|
+
}, []);
|
|
1287
1317
|
const calculateItemsInView = useCallback(() => {
|
|
1288
1318
|
var _a;
|
|
1289
1319
|
const state = refState.current;
|
|
@@ -1294,8 +1324,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1294
1324
|
positions,
|
|
1295
1325
|
columns,
|
|
1296
1326
|
scrollAdjustHandler,
|
|
1297
|
-
scrollVelocity: speed
|
|
1298
|
-
disableAveragesForScrolls
|
|
1327
|
+
scrollVelocity: speed
|
|
1299
1328
|
} = state;
|
|
1300
1329
|
if (!data || scrollLength === 0) {
|
|
1301
1330
|
return;
|
|
@@ -1306,7 +1335,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1306
1335
|
const previousScrollAdjust = scrollAdjustHandler.getAppliedAdjust();
|
|
1307
1336
|
const scrollExtra = Math.max(-16, Math.min(16, speed)) * 16;
|
|
1308
1337
|
let scrollState = state.scroll;
|
|
1309
|
-
const useAverageSize = !
|
|
1338
|
+
const useAverageSize = !state.disableScrollJumpsFrom;
|
|
1310
1339
|
if (!state.queuedInitialLayout && initialScrollIndex) {
|
|
1311
1340
|
const updatedOffset = calculateOffsetForIndex(initialScrollIndex);
|
|
1312
1341
|
scrollState = updatedOffset;
|
|
@@ -1445,6 +1474,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1445
1474
|
const prevNumContainers = ctx.values.get("numContainers");
|
|
1446
1475
|
let numContainers = prevNumContainers;
|
|
1447
1476
|
let didWarnMoreContainers = false;
|
|
1477
|
+
const allocatedContainers = /* @__PURE__ */ new Set();
|
|
1448
1478
|
for (let i = startBuffered; i <= endBuffered; i++) {
|
|
1449
1479
|
let isContained = false;
|
|
1450
1480
|
const id = getId(i);
|
|
@@ -1460,38 +1490,44 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1460
1490
|
let furthestIndex = -1;
|
|
1461
1491
|
let furthestDistance = 0;
|
|
1462
1492
|
for (let u = 0; u < numContainers; u++) {
|
|
1493
|
+
if (allocatedContainers.has(u)) {
|
|
1494
|
+
continue;
|
|
1495
|
+
}
|
|
1463
1496
|
const key = peek$(ctx, `containerItemKey${u}`);
|
|
1464
1497
|
if (key === void 0) {
|
|
1465
1498
|
furthestIndex = u;
|
|
1466
1499
|
break;
|
|
1467
1500
|
}
|
|
1468
|
-
const
|
|
1501
|
+
const index2 = state.indexByKey.get(key);
|
|
1469
1502
|
const pos = peek$(ctx, `containerPosition${u}`).top;
|
|
1470
|
-
if (
|
|
1503
|
+
if (isNullOrUndefined(index2) || pos === POSITION_OUT_OF_VIEW) {
|
|
1504
|
+
furthestIndex = u;
|
|
1505
|
+
break;
|
|
1506
|
+
}
|
|
1507
|
+
if (index2 < startBuffered || index2 > endBuffered) {
|
|
1471
1508
|
const distance = Math.abs(pos - top2);
|
|
1472
|
-
if (
|
|
1509
|
+
if (index2 < 0 || pos === POSITION_OUT_OF_VIEW || distance > furthestDistance) {
|
|
1473
1510
|
furthestDistance = distance;
|
|
1474
1511
|
furthestIndex = u;
|
|
1475
1512
|
}
|
|
1476
1513
|
}
|
|
1477
1514
|
}
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1515
|
+
const containerId = furthestIndex >= 0 ? furthestIndex : numContainers;
|
|
1516
|
+
set$(ctx, `containerItemKey${containerId}`, id);
|
|
1517
|
+
const index = state.indexByKey.get(id);
|
|
1518
|
+
set$(ctx, `containerItemData${containerId}`, data[index]);
|
|
1519
|
+
allocatedContainers.add(containerId);
|
|
1520
|
+
if (furthestIndex === -1) {
|
|
1484
1521
|
numContainers++;
|
|
1485
1522
|
set$(ctx, `containerItemKey${containerId}`, id);
|
|
1486
|
-
const
|
|
1487
|
-
set$(ctx, `containerItemData${containerId}`, data[
|
|
1523
|
+
const index2 = state.indexByKey.get(id);
|
|
1524
|
+
set$(ctx, `containerItemData${containerId}`, data[index2]);
|
|
1488
1525
|
set$(ctx, `containerPosition${containerId}`, ANCHORED_POSITION_OUT_OF_VIEW);
|
|
1489
1526
|
set$(ctx, `containerColumn${containerId}`, -1);
|
|
1490
1527
|
if (__DEV__ && !didWarnMoreContainers && numContainers > peek$(ctx, "numContainersPooled")) {
|
|
1491
1528
|
didWarnMoreContainers = true;
|
|
1492
1529
|
console.warn(
|
|
1493
|
-
"[legend-list] No container to recycle, so creating one on demand. This can be a minor performance issue and is likely caused by the estimatedItemSize being too large. Consider decreasing estimatedItemSize.
|
|
1494
|
-
numContainers
|
|
1530
|
+
"[legend-list] No container to recycle, so creating one on demand. This can be a minor performance issue and is likely caused by the estimatedItemSize being too large. Consider decreasing estimatedItemSize or increasing initialContainerPoolRatio."
|
|
1495
1531
|
);
|
|
1496
1532
|
}
|
|
1497
1533
|
}
|
|
@@ -1548,12 +1584,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1548
1584
|
}
|
|
1549
1585
|
}
|
|
1550
1586
|
if (!state.queuedInitialLayout && endBuffered !== null) {
|
|
1551
|
-
|
|
1552
|
-
for (let i = startBuffered; areAllKnown && i <= endBuffered; i++) {
|
|
1553
|
-
const key = getId(i);
|
|
1554
|
-
areAllKnown && (areAllKnown = state.sizesKnown.has(key));
|
|
1555
|
-
}
|
|
1556
|
-
if (areAllKnown) {
|
|
1587
|
+
if (checkAllSizesKnown()) {
|
|
1557
1588
|
setDidLayout();
|
|
1558
1589
|
}
|
|
1559
1590
|
}
|
|
@@ -1705,7 +1736,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1705
1736
|
if (state) {
|
|
1706
1737
|
state.data = dataProp;
|
|
1707
1738
|
if (!isFirst2) {
|
|
1708
|
-
|
|
1739
|
+
disableScrollJumps(2e3);
|
|
1709
1740
|
refState.current.scrollForNextCalculateItemsInView = void 0;
|
|
1710
1741
|
const numContainers = peek$(ctx, "numContainers");
|
|
1711
1742
|
for (let i = 0; i < numContainers; i++) {
|
|
@@ -1922,7 +1953,17 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1922
1953
|
});
|
|
1923
1954
|
const updateItemSize = useCallback((itemKey, size, fromFixGaps) => {
|
|
1924
1955
|
const state = refState.current;
|
|
1925
|
-
const {
|
|
1956
|
+
const {
|
|
1957
|
+
sizes,
|
|
1958
|
+
indexByKey,
|
|
1959
|
+
sizesKnown,
|
|
1960
|
+
data,
|
|
1961
|
+
rowHeights,
|
|
1962
|
+
startBuffered,
|
|
1963
|
+
endBuffered,
|
|
1964
|
+
averageSizes,
|
|
1965
|
+
queuedInitialLayout
|
|
1966
|
+
} = state;
|
|
1926
1967
|
if (!data) {
|
|
1927
1968
|
return;
|
|
1928
1969
|
}
|
|
@@ -1931,7 +1972,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1931
1972
|
state.minIndexSizeChanged = state.minIndexSizeChanged !== void 0 ? Math.min(state.minIndexSizeChanged, index) : index;
|
|
1932
1973
|
const prevSize = getItemSize(itemKey, index, data);
|
|
1933
1974
|
let needsCalculate = false;
|
|
1934
|
-
|
|
1975
|
+
let needsUpdateContainersDidLayout = false;
|
|
1935
1976
|
sizesKnown.set(itemKey, size);
|
|
1936
1977
|
const itemType = "";
|
|
1937
1978
|
let averages = averageSizes[itemType];
|
|
@@ -1970,7 +2011,7 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1970
2011
|
);
|
|
1971
2012
|
}, 1e3);
|
|
1972
2013
|
}
|
|
1973
|
-
|
|
2014
|
+
state.scrollForNextCalculateItemsInView = void 0;
|
|
1974
2015
|
addTotalSize(itemKey, diff, 0);
|
|
1975
2016
|
doMaintainScrollAtEnd(false);
|
|
1976
2017
|
if (onItemSizeChanged) {
|
|
@@ -1983,11 +2024,14 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1983
2024
|
});
|
|
1984
2025
|
}
|
|
1985
2026
|
}
|
|
2027
|
+
if (!queuedInitialLayout && checkAllSizesKnown()) {
|
|
2028
|
+
needsUpdateContainersDidLayout = true;
|
|
2029
|
+
}
|
|
1986
2030
|
const isInView = index >= startBuffered && index <= endBuffered;
|
|
1987
|
-
if (needsUpdateContainersDidLayout || !fromFixGaps && needsCalculate && isInView) {
|
|
2031
|
+
if (needsUpdateContainersDidLayout || !fromFixGaps && needsCalculate && (isInView || !queuedInitialLayout)) {
|
|
1988
2032
|
const scrollVelocity = state.scrollVelocity;
|
|
1989
2033
|
let didCalculate = false;
|
|
1990
|
-
if ((Number.isNaN(scrollVelocity) || Math.abs(scrollVelocity) < 1) && (!waitForInitialLayout || needsUpdateContainersDidLayout)) {
|
|
2034
|
+
if ((Number.isNaN(scrollVelocity) || Math.abs(scrollVelocity) < 1) && (!waitForInitialLayout || needsUpdateContainersDidLayout || queuedInitialLayout)) {
|
|
1991
2035
|
if (Date.now() - state.lastBatchingAction < 500) {
|
|
1992
2036
|
if (!state.queuedCalculateItemsInView) {
|
|
1993
2037
|
state.queuedCalculateItemsInView = requestAnimationFrame(() => {
|
|
@@ -2045,6 +2089,13 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2045
2089
|
if (state.ignoreScrollFromCalcTotal && newScroll !== 0) {
|
|
2046
2090
|
return;
|
|
2047
2091
|
}
|
|
2092
|
+
if (state.disableScrollJumpsFrom !== void 0) {
|
|
2093
|
+
const scrollMinusAdjust = newScroll - state.scrollAdjustHandler.getAppliedAdjust();
|
|
2094
|
+
if (Math.abs(scrollMinusAdjust - state.disableScrollJumpsFrom) > 200) {
|
|
2095
|
+
return;
|
|
2096
|
+
}
|
|
2097
|
+
state.disableScrollJumpsFrom = void 0;
|
|
2098
|
+
}
|
|
2048
2099
|
state.hasScrolled = true;
|
|
2049
2100
|
state.lastBatchingAction = Date.now();
|
|
2050
2101
|
const currentTime = performance.now();
|
|
@@ -2079,9 +2130,6 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
2079
2130
|
if (!fromSelf) {
|
|
2080
2131
|
(_d = state.onScroll) == null ? void 0 : _d.call(state, event);
|
|
2081
2132
|
}
|
|
2082
|
-
if (state.disableAveragesForScrolls) {
|
|
2083
|
-
state.disableAveragesForScrolls--;
|
|
2084
|
-
}
|
|
2085
2133
|
},
|
|
2086
2134
|
[]
|
|
2087
2135
|
);
|
|
@@ -1,141 +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" | "removeClippedSubviews"> & {
|
|
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
|
-
removeClippedSubviews?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
138
|
-
scrollEventThrottle?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
139
14
|
decelerationRate?: number | "fast" | "normal" | react_native_reanimated.SharedValue<number | "fast" | "normal" | undefined> | undefined;
|
|
140
15
|
horizontal?: boolean | react_native_reanimated.SharedValue<boolean | null | undefined> | null | undefined;
|
|
141
16
|
invertStickyHeaders?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
@@ -149,6 +24,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
149
24
|
onMomentumScrollBegin?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
|
|
150
25
|
pagingEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
151
26
|
scrollEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
27
|
+
removeClippedSubviews?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
152
28
|
showsHorizontalScrollIndicator?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
153
29
|
showsVerticalScrollIndicator?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
154
30
|
stickyHeaderHiddenOnScroll?: 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,141 +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" | "removeClippedSubviews"> & {
|
|
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
|
-
removeClippedSubviews?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
138
|
-
scrollEventThrottle?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
139
14
|
decelerationRate?: number | "fast" | "normal" | react_native_reanimated.SharedValue<number | "fast" | "normal" | undefined> | undefined;
|
|
140
15
|
horizontal?: boolean | react_native_reanimated.SharedValue<boolean | null | undefined> | null | undefined;
|
|
141
16
|
invertStickyHeaders?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
@@ -149,6 +24,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_nati
|
|
|
149
24
|
onMomentumScrollBegin?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
|
|
150
25
|
pagingEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
151
26
|
scrollEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
27
|
+
removeClippedSubviews?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
152
28
|
showsHorizontalScrollIndicator?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
153
29
|
showsVerticalScrollIndicator?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
154
30
|
stickyHeaderHiddenOnScroll?: 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