@legendapp/list 1.0.0-beta.46 → 1.0.0-beta.48
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/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/index.js +100 -19
- package/index.mjs +100 -19
- package/keyboard-controller.d.mts +129 -129
- package/keyboard-controller.d.ts +129 -129
- package/package.json +1 -1
package/index.d.mts
CHANGED
|
@@ -508,6 +508,6 @@ declare const LegendList: <T>(props: Omit<react_native.ScrollViewProps, "content
|
|
|
508
508
|
declare function useViewability(callback: ViewabilityCallback, configId?: string): void;
|
|
509
509
|
declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void;
|
|
510
510
|
declare function useRecyclingEffect(effect: (info: LegendListRecyclingState<unknown>) => void | (() => void)): void;
|
|
511
|
-
declare function useRecyclingState(valueOrFun: ((info: LegendListRecyclingState<unknown>) => any) | any): [
|
|
511
|
+
declare function useRecyclingState(valueOrFun: ((info: LegendListRecyclingState<unknown>) => any) | any): any[];
|
|
512
512
|
|
|
513
513
|
export { type AnchoredPosition, type ColumnWrapperStyle, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, type ScrollState, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
|
package/index.d.ts
CHANGED
|
@@ -508,6 +508,6 @@ declare const LegendList: <T>(props: Omit<react_native.ScrollViewProps, "content
|
|
|
508
508
|
declare function useViewability(callback: ViewabilityCallback, configId?: string): void;
|
|
509
509
|
declare function useViewabilityAmount(callback: ViewabilityAmountCallback): void;
|
|
510
510
|
declare function useRecyclingEffect(effect: (info: LegendListRecyclingState<unknown>) => void | (() => void)): void;
|
|
511
|
-
declare function useRecyclingState(valueOrFun: ((info: LegendListRecyclingState<unknown>) => any) | any): [
|
|
511
|
+
declare function useRecyclingState(valueOrFun: ((info: LegendListRecyclingState<unknown>) => any) | any): any[];
|
|
512
512
|
|
|
513
513
|
export { type AnchoredPosition, type ColumnWrapperStyle, type InternalState, LegendList, type LegendListProps, type LegendListPropsBase, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type OnViewableItemsChanged, type ScrollState, type TypedForwardRef, type TypedMemo, type ViewAmountToken, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, type ViewableRange, typedForwardRef, typedMemo, useRecyclingEffect, useRecyclingState, useViewability, useViewabilityAmount };
|
package/index.js
CHANGED
|
@@ -38,7 +38,8 @@ function StateProvider({ children }) {
|
|
|
38
38
|
mapViewabilityValues: /* @__PURE__ */ new Map(),
|
|
39
39
|
mapViewabilityAmountCallbacks: /* @__PURE__ */ new Map(),
|
|
40
40
|
mapViewabilityAmountValues: /* @__PURE__ */ new Map(),
|
|
41
|
-
columnWrapperStyle: void 0
|
|
41
|
+
columnWrapperStyle: void 0,
|
|
42
|
+
viewRefs: /* @__PURE__ */ new Map()
|
|
42
43
|
}));
|
|
43
44
|
return /* @__PURE__ */ React6__namespace.createElement(ContextState.Provider, { value }, children);
|
|
44
45
|
}
|
|
@@ -213,8 +214,8 @@ function useRecyclingEffect(effect) {
|
|
|
213
214
|
}, [index, value]);
|
|
214
215
|
}
|
|
215
216
|
function useRecyclingState(valueOrFun) {
|
|
216
|
-
const { index, value } = React6.useContext(ContextContainer);
|
|
217
|
-
const
|
|
217
|
+
const { index, value, triggerLayout } = React6.useContext(ContextContainer);
|
|
218
|
+
const [state, setState_] = React6.useState(
|
|
218
219
|
() => typeof valueOrFun === "function" ? valueOrFun({
|
|
219
220
|
index,
|
|
220
221
|
item: value,
|
|
@@ -222,11 +223,18 @@ function useRecyclingState(valueOrFun) {
|
|
|
222
223
|
prevItem: void 0
|
|
223
224
|
}) : valueOrFun
|
|
224
225
|
);
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
const setState = React6.useCallback(
|
|
227
|
+
(newState) => {
|
|
228
|
+
setState_(newState);
|
|
229
|
+
triggerLayout();
|
|
230
|
+
},
|
|
231
|
+
[triggerLayout]
|
|
232
|
+
);
|
|
233
|
+
useRecyclingEffect((state2) => {
|
|
234
|
+
const newState = typeof valueOrFun === "function" ? valueOrFun(state2) : valueOrFun;
|
|
235
|
+
setState_(newState);
|
|
228
236
|
});
|
|
229
|
-
return
|
|
237
|
+
return [state, setState];
|
|
230
238
|
}
|
|
231
239
|
var LeanViewComponent = React6__namespace.forwardRef((props, ref) => {
|
|
232
240
|
return React6__namespace.createElement("RCTView", { ...props, ref });
|
|
@@ -243,9 +251,9 @@ var ANCHORED_POSITION_OUT_OF_VIEW = {
|
|
|
243
251
|
};
|
|
244
252
|
var ENABLE_DEVMODE = __DEV__ && false;
|
|
245
253
|
var ENABLE_DEBUG_VIEW = __DEV__ && false;
|
|
254
|
+
var IsNewArchitecture = global.nativeFabricUIManager != null;
|
|
246
255
|
|
|
247
256
|
// src/Container.tsx
|
|
248
|
-
var isNewArchitecture = global.nativeFabricUIManager != null;
|
|
249
257
|
var Container = ({
|
|
250
258
|
id,
|
|
251
259
|
recycleItems,
|
|
@@ -265,6 +273,8 @@ var Container = ({
|
|
|
265
273
|
const data = use$(`containerItemData${id}`);
|
|
266
274
|
const extraData = use$("extraData");
|
|
267
275
|
const refLastSize = React6.useRef();
|
|
276
|
+
const ref = React6.useRef(null);
|
|
277
|
+
const [layoutRenderCount, forceLayoutRender] = React6.useState(0);
|
|
268
278
|
const otherAxisPos = numColumns > 1 ? `${(column - 1) / numColumns * 100}%` : 0;
|
|
269
279
|
const otherAxisSize = numColumns > 1 ? `${1 / numColumns * 100}%` : void 0;
|
|
270
280
|
let paddingStyles;
|
|
@@ -303,6 +313,9 @@ var Container = ({
|
|
|
303
313
|
[itemKey, data, extraData]
|
|
304
314
|
);
|
|
305
315
|
const { index, renderedItem } = renderedItemInfo || {};
|
|
316
|
+
const triggerLayout = React6.useCallback(() => {
|
|
317
|
+
forceLayoutRender((v) => v + 1);
|
|
318
|
+
}, []);
|
|
306
319
|
const onLayout = (event) => {
|
|
307
320
|
if (itemKey !== void 0) {
|
|
308
321
|
const layout = event.nativeEvent.layout;
|
|
@@ -311,8 +324,7 @@ var Container = ({
|
|
|
311
324
|
updateItemSize(itemKey, size);
|
|
312
325
|
}
|
|
313
326
|
};
|
|
314
|
-
|
|
315
|
-
if (isNewArchitecture) {
|
|
327
|
+
if (IsNewArchitecture) {
|
|
316
328
|
React6.useLayoutEffect(() => {
|
|
317
329
|
var _a, _b;
|
|
318
330
|
if (itemKey !== void 0) {
|
|
@@ -324,7 +336,7 @@ var Container = ({
|
|
|
324
336
|
}
|
|
325
337
|
}
|
|
326
338
|
}
|
|
327
|
-
}, [itemKey]);
|
|
339
|
+
}, [itemKey, layoutRenderCount]);
|
|
328
340
|
} else {
|
|
329
341
|
React6.useEffect(() => {
|
|
330
342
|
if (itemKey) {
|
|
@@ -339,10 +351,10 @@ var Container = ({
|
|
|
339
351
|
}
|
|
340
352
|
}, [itemKey]);
|
|
341
353
|
}
|
|
342
|
-
const contextValue = React6.useMemo(
|
|
343
|
-
(
|
|
344
|
-
|
|
345
|
-
);
|
|
354
|
+
const contextValue = React6.useMemo(() => {
|
|
355
|
+
ctx.viewRefs.set(id, ref);
|
|
356
|
+
return { containerId: id, itemKey, index, value: data, triggerLayout };
|
|
357
|
+
}, [id, itemKey, index, data]);
|
|
346
358
|
const contentFragment = /* @__PURE__ */ React6__namespace.default.createElement(React6__namespace.default.Fragment, { key: recycleItems ? void 0 : itemKey }, /* @__PURE__ */ React6__namespace.default.createElement(ContextContainer.Provider, { value: contextValue }, renderedItem, renderedItemInfo && ItemSeparatorComponent && !lastItemKeys.includes(itemKey) && /* @__PURE__ */ React6__namespace.default.createElement(ItemSeparatorComponent, { leadingItem: renderedItemInfo.item })));
|
|
347
359
|
if (maintainVisibleContentPosition) {
|
|
348
360
|
const anchorStyle = position.type === "top" ? { position: "absolute", top: 0, left: 0, right: 0 } : { position: "absolute", bottom: 0, left: 0, right: 0 };
|
|
@@ -394,7 +406,6 @@ var Containers = typedMemo(function Containers2({
|
|
|
394
406
|
}) {
|
|
395
407
|
const ctx = useStateContext();
|
|
396
408
|
const columnWrapperStyle = ctx.columnWrapperStyle;
|
|
397
|
-
use$("numColumns");
|
|
398
409
|
const numContainers = use$("numContainersPooled");
|
|
399
410
|
const animSize = useValue$(
|
|
400
411
|
"totalSizeWithScrollAdjust",
|
|
@@ -1179,6 +1190,70 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1179
1190
|
}
|
|
1180
1191
|
return res;
|
|
1181
1192
|
};
|
|
1193
|
+
const fixGaps = React6.useCallback(() => {
|
|
1194
|
+
var _a;
|
|
1195
|
+
const state = refState.current;
|
|
1196
|
+
const { data, scrollLength, positions, startBuffered, endBuffered } = state;
|
|
1197
|
+
if (!data || scrollLength === 0) {
|
|
1198
|
+
return;
|
|
1199
|
+
}
|
|
1200
|
+
const numContainers = ctx.values.get("numContainers");
|
|
1201
|
+
let numMeasurements = 0;
|
|
1202
|
+
for (let i = 0; i < numContainers; i++) {
|
|
1203
|
+
const itemKey = peek$(ctx, `containerItemKey${i}`);
|
|
1204
|
+
const isSizeKnown = refState.current.sizesKnown.get(itemKey);
|
|
1205
|
+
if (itemKey && !isSizeKnown) {
|
|
1206
|
+
const containerRef = ctx.viewRefs.get(i);
|
|
1207
|
+
if (containerRef) {
|
|
1208
|
+
let measured;
|
|
1209
|
+
(_a = containerRef.current) == null ? void 0 : _a.measure((x, y, width, height) => {
|
|
1210
|
+
measured = { width, height };
|
|
1211
|
+
});
|
|
1212
|
+
numMeasurements++;
|
|
1213
|
+
if (measured) {
|
|
1214
|
+
const size = Math.floor(measured[horizontal ? "width" : "height"] * 8) / 8;
|
|
1215
|
+
updateItemSize(
|
|
1216
|
+
itemKey,
|
|
1217
|
+
size,
|
|
1218
|
+
/*fromFixGaps*/
|
|
1219
|
+
true
|
|
1220
|
+
);
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
if (numMeasurements > 0) {
|
|
1226
|
+
let top;
|
|
1227
|
+
const diffs = /* @__PURE__ */ new Map();
|
|
1228
|
+
for (let i = startBuffered; i <= endBuffered; i++) {
|
|
1229
|
+
const id = getId(i);
|
|
1230
|
+
if (top === void 0) {
|
|
1231
|
+
top = positions.get(id);
|
|
1232
|
+
}
|
|
1233
|
+
if (positions.get(id) !== top) {
|
|
1234
|
+
diffs.set(id, top - positions.get(id));
|
|
1235
|
+
positions.set(id, top);
|
|
1236
|
+
}
|
|
1237
|
+
const size = getItemSize(id, i, data[i]);
|
|
1238
|
+
const bottom = top + size;
|
|
1239
|
+
top = bottom;
|
|
1240
|
+
}
|
|
1241
|
+
for (let i = 0; i < numContainers; i++) {
|
|
1242
|
+
const itemKey = peek$(ctx, `containerItemKey${i}`);
|
|
1243
|
+
const diff = diffs.get(itemKey);
|
|
1244
|
+
if (diff) {
|
|
1245
|
+
const prevPos = peek$(ctx, `containerPosition${i}`);
|
|
1246
|
+
const newPos = prevPos.top + diff;
|
|
1247
|
+
if (prevPos.top !== newPos) {
|
|
1248
|
+
const pos = { ...prevPos };
|
|
1249
|
+
pos.relativeCoordinate += diff;
|
|
1250
|
+
pos.top += diff;
|
|
1251
|
+
set$(ctx, `containerPosition${i}`, pos);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
}, []);
|
|
1182
1257
|
const calculateItemsInView = React6.useCallback(() => {
|
|
1183
1258
|
var _a;
|
|
1184
1259
|
const state = refState.current;
|
|
@@ -1819,9 +1894,9 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1819
1894
|
useInit(() => {
|
|
1820
1895
|
doInitialAllocateContainers();
|
|
1821
1896
|
});
|
|
1822
|
-
const updateItemSize = React6.useCallback((itemKey, size) => {
|
|
1897
|
+
const updateItemSize = React6.useCallback((itemKey, size, fromFixGaps) => {
|
|
1823
1898
|
const state = refState.current;
|
|
1824
|
-
const { sizes, indexByKey, sizesKnown, data, rowHeights } = state;
|
|
1899
|
+
const { sizes, indexByKey, sizesKnown, data, rowHeights, startBuffered, endBuffered } = state;
|
|
1825
1900
|
if (!data) {
|
|
1826
1901
|
return;
|
|
1827
1902
|
}
|
|
@@ -1883,8 +1958,10 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1883
1958
|
});
|
|
1884
1959
|
}
|
|
1885
1960
|
}
|
|
1886
|
-
|
|
1961
|
+
const isInView = index >= startBuffered && index <= endBuffered;
|
|
1962
|
+
if (!fromFixGaps && needsCalculate && isInView) {
|
|
1887
1963
|
const scrollVelocity = state.scrollVelocity;
|
|
1964
|
+
let didCalculate = false;
|
|
1888
1965
|
if ((Number.isNaN(scrollVelocity) || Math.abs(scrollVelocity) < 1) && (!waitForInitialLayout || state.numPendingInitialLayout < 0)) {
|
|
1889
1966
|
if (Date.now() - state.lastBatchingAction < 500) {
|
|
1890
1967
|
if (!state.queuedCalculateItemsInView) {
|
|
@@ -1895,8 +1972,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1895
1972
|
}
|
|
1896
1973
|
} else {
|
|
1897
1974
|
calculateItemsInView();
|
|
1975
|
+
didCalculate = true;
|
|
1898
1976
|
}
|
|
1899
1977
|
}
|
|
1978
|
+
if (!didCalculate && IsNewArchitecture) {
|
|
1979
|
+
fixGaps();
|
|
1980
|
+
}
|
|
1900
1981
|
}
|
|
1901
1982
|
}, []);
|
|
1902
1983
|
const onLayout = React6.useCallback((event) => {
|
package/index.mjs
CHANGED
|
@@ -17,7 +17,8 @@ function StateProvider({ children }) {
|
|
|
17
17
|
mapViewabilityValues: /* @__PURE__ */ new Map(),
|
|
18
18
|
mapViewabilityAmountCallbacks: /* @__PURE__ */ new Map(),
|
|
19
19
|
mapViewabilityAmountValues: /* @__PURE__ */ new Map(),
|
|
20
|
-
columnWrapperStyle: void 0
|
|
20
|
+
columnWrapperStyle: void 0,
|
|
21
|
+
viewRefs: /* @__PURE__ */ new Map()
|
|
21
22
|
}));
|
|
22
23
|
return /* @__PURE__ */ React6.createElement(ContextState.Provider, { value }, children);
|
|
23
24
|
}
|
|
@@ -192,8 +193,8 @@ function useRecyclingEffect(effect) {
|
|
|
192
193
|
}, [index, value]);
|
|
193
194
|
}
|
|
194
195
|
function useRecyclingState(valueOrFun) {
|
|
195
|
-
const { index, value } = useContext(ContextContainer);
|
|
196
|
-
const
|
|
196
|
+
const { index, value, triggerLayout } = useContext(ContextContainer);
|
|
197
|
+
const [state, setState_] = useState(
|
|
197
198
|
() => typeof valueOrFun === "function" ? valueOrFun({
|
|
198
199
|
index,
|
|
199
200
|
item: value,
|
|
@@ -201,11 +202,18 @@ function useRecyclingState(valueOrFun) {
|
|
|
201
202
|
prevItem: void 0
|
|
202
203
|
}) : valueOrFun
|
|
203
204
|
);
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
205
|
+
const setState = useCallback(
|
|
206
|
+
(newState) => {
|
|
207
|
+
setState_(newState);
|
|
208
|
+
triggerLayout();
|
|
209
|
+
},
|
|
210
|
+
[triggerLayout]
|
|
211
|
+
);
|
|
212
|
+
useRecyclingEffect((state2) => {
|
|
213
|
+
const newState = typeof valueOrFun === "function" ? valueOrFun(state2) : valueOrFun;
|
|
214
|
+
setState_(newState);
|
|
207
215
|
});
|
|
208
|
-
return
|
|
216
|
+
return [state, setState];
|
|
209
217
|
}
|
|
210
218
|
var LeanViewComponent = React6.forwardRef((props, ref) => {
|
|
211
219
|
return React6.createElement("RCTView", { ...props, ref });
|
|
@@ -222,9 +230,9 @@ var ANCHORED_POSITION_OUT_OF_VIEW = {
|
|
|
222
230
|
};
|
|
223
231
|
var ENABLE_DEVMODE = __DEV__ && false;
|
|
224
232
|
var ENABLE_DEBUG_VIEW = __DEV__ && false;
|
|
233
|
+
var IsNewArchitecture = global.nativeFabricUIManager != null;
|
|
225
234
|
|
|
226
235
|
// src/Container.tsx
|
|
227
|
-
var isNewArchitecture = global.nativeFabricUIManager != null;
|
|
228
236
|
var Container = ({
|
|
229
237
|
id,
|
|
230
238
|
recycleItems,
|
|
@@ -244,6 +252,8 @@ var Container = ({
|
|
|
244
252
|
const data = use$(`containerItemData${id}`);
|
|
245
253
|
const extraData = use$("extraData");
|
|
246
254
|
const refLastSize = useRef();
|
|
255
|
+
const ref = useRef(null);
|
|
256
|
+
const [layoutRenderCount, forceLayoutRender] = useState(0);
|
|
247
257
|
const otherAxisPos = numColumns > 1 ? `${(column - 1) / numColumns * 100}%` : 0;
|
|
248
258
|
const otherAxisSize = numColumns > 1 ? `${1 / numColumns * 100}%` : void 0;
|
|
249
259
|
let paddingStyles;
|
|
@@ -282,6 +292,9 @@ var Container = ({
|
|
|
282
292
|
[itemKey, data, extraData]
|
|
283
293
|
);
|
|
284
294
|
const { index, renderedItem } = renderedItemInfo || {};
|
|
295
|
+
const triggerLayout = useCallback(() => {
|
|
296
|
+
forceLayoutRender((v) => v + 1);
|
|
297
|
+
}, []);
|
|
285
298
|
const onLayout = (event) => {
|
|
286
299
|
if (itemKey !== void 0) {
|
|
287
300
|
const layout = event.nativeEvent.layout;
|
|
@@ -290,8 +303,7 @@ var Container = ({
|
|
|
290
303
|
updateItemSize(itemKey, size);
|
|
291
304
|
}
|
|
292
305
|
};
|
|
293
|
-
|
|
294
|
-
if (isNewArchitecture) {
|
|
306
|
+
if (IsNewArchitecture) {
|
|
295
307
|
useLayoutEffect(() => {
|
|
296
308
|
var _a, _b;
|
|
297
309
|
if (itemKey !== void 0) {
|
|
@@ -303,7 +315,7 @@ var Container = ({
|
|
|
303
315
|
}
|
|
304
316
|
}
|
|
305
317
|
}
|
|
306
|
-
}, [itemKey]);
|
|
318
|
+
}, [itemKey, layoutRenderCount]);
|
|
307
319
|
} else {
|
|
308
320
|
useEffect(() => {
|
|
309
321
|
if (itemKey) {
|
|
@@ -318,10 +330,10 @@ var Container = ({
|
|
|
318
330
|
}
|
|
319
331
|
}, [itemKey]);
|
|
320
332
|
}
|
|
321
|
-
const contextValue = useMemo(
|
|
322
|
-
(
|
|
323
|
-
|
|
324
|
-
);
|
|
333
|
+
const contextValue = useMemo(() => {
|
|
334
|
+
ctx.viewRefs.set(id, ref);
|
|
335
|
+
return { containerId: id, itemKey, index, value: data, triggerLayout };
|
|
336
|
+
}, [id, itemKey, index, data]);
|
|
325
337
|
const contentFragment = /* @__PURE__ */ React6__default.createElement(React6__default.Fragment, { key: recycleItems ? void 0 : itemKey }, /* @__PURE__ */ React6__default.createElement(ContextContainer.Provider, { value: contextValue }, renderedItem, renderedItemInfo && ItemSeparatorComponent && !lastItemKeys.includes(itemKey) && /* @__PURE__ */ React6__default.createElement(ItemSeparatorComponent, { leadingItem: renderedItemInfo.item })));
|
|
326
338
|
if (maintainVisibleContentPosition) {
|
|
327
339
|
const anchorStyle = position.type === "top" ? { position: "absolute", top: 0, left: 0, right: 0 } : { position: "absolute", bottom: 0, left: 0, right: 0 };
|
|
@@ -373,7 +385,6 @@ var Containers = typedMemo(function Containers2({
|
|
|
373
385
|
}) {
|
|
374
386
|
const ctx = useStateContext();
|
|
375
387
|
const columnWrapperStyle = ctx.columnWrapperStyle;
|
|
376
|
-
use$("numColumns");
|
|
377
388
|
const numContainers = use$("numContainersPooled");
|
|
378
389
|
const animSize = useValue$(
|
|
379
390
|
"totalSizeWithScrollAdjust",
|
|
@@ -1158,6 +1169,70 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1158
1169
|
}
|
|
1159
1170
|
return res;
|
|
1160
1171
|
};
|
|
1172
|
+
const fixGaps = useCallback(() => {
|
|
1173
|
+
var _a;
|
|
1174
|
+
const state = refState.current;
|
|
1175
|
+
const { data, scrollLength, positions, startBuffered, endBuffered } = state;
|
|
1176
|
+
if (!data || scrollLength === 0) {
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1179
|
+
const numContainers = ctx.values.get("numContainers");
|
|
1180
|
+
let numMeasurements = 0;
|
|
1181
|
+
for (let i = 0; i < numContainers; i++) {
|
|
1182
|
+
const itemKey = peek$(ctx, `containerItemKey${i}`);
|
|
1183
|
+
const isSizeKnown = refState.current.sizesKnown.get(itemKey);
|
|
1184
|
+
if (itemKey && !isSizeKnown) {
|
|
1185
|
+
const containerRef = ctx.viewRefs.get(i);
|
|
1186
|
+
if (containerRef) {
|
|
1187
|
+
let measured;
|
|
1188
|
+
(_a = containerRef.current) == null ? void 0 : _a.measure((x, y, width, height) => {
|
|
1189
|
+
measured = { width, height };
|
|
1190
|
+
});
|
|
1191
|
+
numMeasurements++;
|
|
1192
|
+
if (measured) {
|
|
1193
|
+
const size = Math.floor(measured[horizontal ? "width" : "height"] * 8) / 8;
|
|
1194
|
+
updateItemSize(
|
|
1195
|
+
itemKey,
|
|
1196
|
+
size,
|
|
1197
|
+
/*fromFixGaps*/
|
|
1198
|
+
true
|
|
1199
|
+
);
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
if (numMeasurements > 0) {
|
|
1205
|
+
let top;
|
|
1206
|
+
const diffs = /* @__PURE__ */ new Map();
|
|
1207
|
+
for (let i = startBuffered; i <= endBuffered; i++) {
|
|
1208
|
+
const id = getId(i);
|
|
1209
|
+
if (top === void 0) {
|
|
1210
|
+
top = positions.get(id);
|
|
1211
|
+
}
|
|
1212
|
+
if (positions.get(id) !== top) {
|
|
1213
|
+
diffs.set(id, top - positions.get(id));
|
|
1214
|
+
positions.set(id, top);
|
|
1215
|
+
}
|
|
1216
|
+
const size = getItemSize(id, i, data[i]);
|
|
1217
|
+
const bottom = top + size;
|
|
1218
|
+
top = bottom;
|
|
1219
|
+
}
|
|
1220
|
+
for (let i = 0; i < numContainers; i++) {
|
|
1221
|
+
const itemKey = peek$(ctx, `containerItemKey${i}`);
|
|
1222
|
+
const diff = diffs.get(itemKey);
|
|
1223
|
+
if (diff) {
|
|
1224
|
+
const prevPos = peek$(ctx, `containerPosition${i}`);
|
|
1225
|
+
const newPos = prevPos.top + diff;
|
|
1226
|
+
if (prevPos.top !== newPos) {
|
|
1227
|
+
const pos = { ...prevPos };
|
|
1228
|
+
pos.relativeCoordinate += diff;
|
|
1229
|
+
pos.top += diff;
|
|
1230
|
+
set$(ctx, `containerPosition${i}`, pos);
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
}, []);
|
|
1161
1236
|
const calculateItemsInView = useCallback(() => {
|
|
1162
1237
|
var _a;
|
|
1163
1238
|
const state = refState.current;
|
|
@@ -1798,9 +1873,9 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1798
1873
|
useInit(() => {
|
|
1799
1874
|
doInitialAllocateContainers();
|
|
1800
1875
|
});
|
|
1801
|
-
const updateItemSize = useCallback((itemKey, size) => {
|
|
1876
|
+
const updateItemSize = useCallback((itemKey, size, fromFixGaps) => {
|
|
1802
1877
|
const state = refState.current;
|
|
1803
|
-
const { sizes, indexByKey, sizesKnown, data, rowHeights } = state;
|
|
1878
|
+
const { sizes, indexByKey, sizesKnown, data, rowHeights, startBuffered, endBuffered } = state;
|
|
1804
1879
|
if (!data) {
|
|
1805
1880
|
return;
|
|
1806
1881
|
}
|
|
@@ -1862,8 +1937,10 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1862
1937
|
});
|
|
1863
1938
|
}
|
|
1864
1939
|
}
|
|
1865
|
-
|
|
1940
|
+
const isInView = index >= startBuffered && index <= endBuffered;
|
|
1941
|
+
if (!fromFixGaps && needsCalculate && isInView) {
|
|
1866
1942
|
const scrollVelocity = state.scrollVelocity;
|
|
1943
|
+
let didCalculate = false;
|
|
1867
1944
|
if ((Number.isNaN(scrollVelocity) || Math.abs(scrollVelocity) < 1) && (!waitForInitialLayout || state.numPendingInitialLayout < 0)) {
|
|
1868
1945
|
if (Date.now() - state.lastBatchingAction < 500) {
|
|
1869
1946
|
if (!state.queuedCalculateItemsInView) {
|
|
@@ -1874,8 +1951,12 @@ var LegendListInner = typedForwardRef(function LegendListInner2(props, forwarded
|
|
|
1874
1951
|
}
|
|
1875
1952
|
} else {
|
|
1876
1953
|
calculateItemsInView();
|
|
1954
|
+
didCalculate = true;
|
|
1877
1955
|
}
|
|
1878
1956
|
}
|
|
1957
|
+
if (!didCalculate && IsNewArchitecture) {
|
|
1958
|
+
fixGaps();
|
|
1959
|
+
}
|
|
1879
1960
|
}
|
|
1880
1961
|
}, []);
|
|
1881
1962
|
const onLayout = useCallback((event) => {
|
|
@@ -1,137 +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
|
-
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
58
|
-
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
59
|
-
waitForInitialLayout?: boolean;
|
|
60
|
-
} & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<react_native.ScrollViewProps, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
|
|
61
|
-
alignItemsAtEnd?: boolean;
|
|
62
|
-
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
63
|
-
data: readonly T[];
|
|
64
|
-
drawDistance?: number;
|
|
65
|
-
estimatedItemSize?: number;
|
|
66
|
-
extraData?: any;
|
|
67
|
-
getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
|
|
68
|
-
initialContainerPoolRatio?: number | undefined;
|
|
69
|
-
initialScrollOffset?: number;
|
|
70
|
-
initialScrollIndex?: number;
|
|
71
|
-
ItemSeparatorComponent?: React.ComponentType<{
|
|
72
|
-
leadingItem: T;
|
|
73
|
-
}> | undefined;
|
|
74
|
-
keyExtractor?: ((item: T, index: number) => string) | undefined;
|
|
75
|
-
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
76
|
-
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
77
|
-
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
78
|
-
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
79
|
-
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
80
|
-
maintainScrollAtEnd?: boolean;
|
|
81
|
-
maintainScrollAtEndThreshold?: number;
|
|
82
|
-
maintainVisibleContentPosition?: boolean;
|
|
83
|
-
numColumns?: number;
|
|
84
|
-
onEndReached?: ((info: {
|
|
85
|
-
distanceFromEnd: number;
|
|
86
|
-
}) => void) | null | undefined;
|
|
87
|
-
onEndReachedThreshold?: number | null | undefined;
|
|
88
|
-
onItemSizeChanged?: ((info: {
|
|
89
|
-
size: number;
|
|
90
|
-
previous: number;
|
|
91
|
-
index: number;
|
|
92
|
-
itemKey: string;
|
|
93
|
-
itemData: T;
|
|
94
|
-
}) => void) | undefined;
|
|
95
|
-
onRefresh?: () => void;
|
|
96
|
-
onStartReached?: ((info: {
|
|
97
|
-
distanceFromStart: number;
|
|
98
|
-
}) => void) | null | undefined;
|
|
99
|
-
onStartReachedThreshold?: number | null | undefined;
|
|
100
|
-
onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
|
|
101
|
-
progressViewOffset?: number;
|
|
102
|
-
recycleItems?: boolean;
|
|
103
|
-
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
104
|
-
refreshing?: boolean;
|
|
105
|
-
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
|
|
106
|
-
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
107
|
-
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
108
|
-
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
109
|
-
waitForInitialLayout?: boolean;
|
|
110
|
-
} & 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"> & {
|
|
111
11
|
getEstimatedItemSize?: ((index: number, item: ItemT_1) => number) | undefined;
|
|
112
|
-
ItemSeparatorComponent?: React.ComponentType<{
|
|
113
|
-
leadingItem: ItemT_1;
|
|
114
|
-
}> | undefined;
|
|
115
12
|
keyExtractor?: ((item: ItemT_1, index: number) => string) | undefined;
|
|
116
|
-
onItemSizeChanged?: ((info: {
|
|
117
|
-
size: number;
|
|
118
|
-
previous: number;
|
|
119
|
-
index: number;
|
|
120
|
-
itemKey: string;
|
|
121
|
-
itemData: ItemT_1;
|
|
122
|
-
}) => void) | undefined;
|
|
123
|
-
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | undefined;
|
|
124
13
|
animatedProps?: Partial<{
|
|
125
|
-
contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
|
|
126
|
-
contentInset?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
|
|
127
|
-
maintainVisibleContentPosition?: {
|
|
128
|
-
autoscrollToTopThreshold?: number | null | undefined;
|
|
129
|
-
minIndexForVisible: number;
|
|
130
|
-
} | react_native_reanimated.SharedValue<{
|
|
131
|
-
autoscrollToTopThreshold?: number | null | undefined;
|
|
132
|
-
minIndexForVisible: number;
|
|
133
|
-
} | null | undefined> | null | undefined;
|
|
134
|
-
stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
|
|
135
14
|
decelerationRate?: number | "fast" | "normal" | react_native_reanimated.SharedValue<number | "fast" | "normal" | undefined> | undefined;
|
|
136
15
|
horizontal?: boolean | react_native_reanimated.SharedValue<boolean | null | undefined> | null | undefined;
|
|
137
16
|
invertStickyHeaders?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
@@ -154,6 +33,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
|
|
|
154
33
|
snapToOffsets?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
|
|
155
34
|
snapToStart?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
156
35
|
snapToEnd?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
36
|
+
stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
|
|
157
37
|
disableIntervalMomentum?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
158
38
|
disableScrollViewPanResponder?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
159
39
|
StickyHeaderComponent?: React.ComponentType<any> | react_native_reanimated.SharedValue<React.ComponentType<any> | undefined> | undefined;
|
|
@@ -257,8 +137,17 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
|
|
|
257
137
|
bouncesZoom?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
258
138
|
canCancelContentTouches?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
259
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;
|
|
260
142
|
contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes" | react_native_reanimated.SharedValue<"always" | "never" | "automatic" | "scrollableAxes" | undefined> | undefined;
|
|
261
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;
|
|
262
151
|
maximumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
263
152
|
minimumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
264
153
|
onScrollAnimationEnd?: (() => void) | react_native_reanimated.SharedValue<(() => void) | undefined> | undefined;
|
|
@@ -267,7 +156,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
|
|
|
267
156
|
scrollIndicatorInsets?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
|
|
268
157
|
scrollToOverflowEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
269
158
|
scrollsToTop?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
270
|
-
snapToAlignment?: "
|
|
159
|
+
snapToAlignment?: "center" | "start" | "end" | react_native_reanimated.SharedValue<"center" | "start" | "end" | undefined> | undefined;
|
|
271
160
|
onScrollToTop?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
|
|
272
161
|
zoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
273
162
|
endFillColor?: react_native.ColorValue | react_native_reanimated.SharedValue<react_native.ColorValue | undefined> | undefined;
|
|
@@ -277,8 +166,8 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
|
|
|
277
166
|
fadingEdgeLength?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
278
167
|
persistentScrollbar?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
279
168
|
} & {
|
|
280
|
-
contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
|
|
281
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>>>;
|
|
282
171
|
indicatorStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<"default" | "black" | "white" | undefined>>;
|
|
283
172
|
} & {
|
|
284
173
|
layout?: react_native_reanimated.BaseAnimationBuilder | react_native_reanimated.LayoutAnimationFunction | typeof react_native_reanimated.BaseAnimationBuilder;
|
|
@@ -288,9 +177,120 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
|
|
|
288
177
|
sharedTransitionTag?: string;
|
|
289
178
|
sharedTransitionStyle?: react_native_reanimated.SharedTransition;
|
|
290
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;
|
|
291
191
|
} & {
|
|
292
192
|
ref?: React.Ref<LegendListRef>;
|
|
293
|
-
}) => React.ReactElement | null)
|
|
193
|
+
}) => React.ReactElement | null) | (<T>(props: Omit<react_native.ScrollViewProps, "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
|
+
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
241
|
+
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
242
|
+
waitForInitialLayout?: boolean;
|
|
243
|
+
} & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<react_native.ScrollViewProps, "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
244
|
+
alignItemsAtEnd?: boolean;
|
|
245
|
+
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
246
|
+
data: readonly T[];
|
|
247
|
+
drawDistance?: number;
|
|
248
|
+
estimatedItemSize?: number;
|
|
249
|
+
extraData?: any;
|
|
250
|
+
getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
|
|
251
|
+
initialContainerPoolRatio?: number | undefined;
|
|
252
|
+
initialScrollOffset?: number;
|
|
253
|
+
initialScrollIndex?: number;
|
|
254
|
+
ItemSeparatorComponent?: React.ComponentType<{
|
|
255
|
+
leadingItem: T;
|
|
256
|
+
}> | undefined;
|
|
257
|
+
keyExtractor?: ((item: T, index: number) => string) | undefined;
|
|
258
|
+
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
259
|
+
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
260
|
+
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
261
|
+
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
262
|
+
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
263
|
+
maintainScrollAtEnd?: boolean;
|
|
264
|
+
maintainScrollAtEndThreshold?: number;
|
|
265
|
+
maintainVisibleContentPosition?: boolean;
|
|
266
|
+
numColumns?: number;
|
|
267
|
+
onEndReached?: ((info: {
|
|
268
|
+
distanceFromEnd: number;
|
|
269
|
+
}) => void) | null | undefined;
|
|
270
|
+
onEndReachedThreshold?: number | null | undefined;
|
|
271
|
+
onItemSizeChanged?: ((info: {
|
|
272
|
+
size: number;
|
|
273
|
+
previous: number;
|
|
274
|
+
index: number;
|
|
275
|
+
itemKey: string;
|
|
276
|
+
itemData: T;
|
|
277
|
+
}) => void) | undefined;
|
|
278
|
+
onRefresh?: () => void;
|
|
279
|
+
onStartReached?: ((info: {
|
|
280
|
+
distanceFromStart: number;
|
|
281
|
+
}) => void) | null | undefined;
|
|
282
|
+
onStartReachedThreshold?: number | null | undefined;
|
|
283
|
+
onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
|
|
284
|
+
progressViewOffset?: number;
|
|
285
|
+
recycleItems?: boolean;
|
|
286
|
+
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
287
|
+
refreshing?: boolean;
|
|
288
|
+
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
|
|
289
|
+
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
290
|
+
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
291
|
+
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
292
|
+
waitForInitialLayout?: boolean;
|
|
293
|
+
} & React.RefAttributes<LegendListRef>) => React.ReactNode)> = <T>(props: Omit<react_native.ScrollViewProps, "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
294
294
|
alignItemsAtEnd?: boolean;
|
|
295
295
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
296
296
|
data: readonly T[];
|
|
@@ -340,7 +340,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
|
|
|
340
340
|
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
341
341
|
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
342
342
|
waitForInitialLayout?: boolean;
|
|
343
|
-
} & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<react_native.ScrollViewProps, "
|
|
343
|
+
} & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<react_native.ScrollViewProps, "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
344
344
|
alignItemsAtEnd?: boolean;
|
|
345
345
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
346
346
|
data: readonly ItemT[];
|
package/keyboard-controller.d.ts
CHANGED
|
@@ -1,137 +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
|
-
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
58
|
-
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
59
|
-
waitForInitialLayout?: boolean;
|
|
60
|
-
} & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<react_native.ScrollViewProps, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices"> & {
|
|
61
|
-
alignItemsAtEnd?: boolean;
|
|
62
|
-
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
63
|
-
data: readonly T[];
|
|
64
|
-
drawDistance?: number;
|
|
65
|
-
estimatedItemSize?: number;
|
|
66
|
-
extraData?: any;
|
|
67
|
-
getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
|
|
68
|
-
initialContainerPoolRatio?: number | undefined;
|
|
69
|
-
initialScrollOffset?: number;
|
|
70
|
-
initialScrollIndex?: number;
|
|
71
|
-
ItemSeparatorComponent?: React.ComponentType<{
|
|
72
|
-
leadingItem: T;
|
|
73
|
-
}> | undefined;
|
|
74
|
-
keyExtractor?: ((item: T, index: number) => string) | undefined;
|
|
75
|
-
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
76
|
-
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
77
|
-
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
78
|
-
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
79
|
-
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
80
|
-
maintainScrollAtEnd?: boolean;
|
|
81
|
-
maintainScrollAtEndThreshold?: number;
|
|
82
|
-
maintainVisibleContentPosition?: boolean;
|
|
83
|
-
numColumns?: number;
|
|
84
|
-
onEndReached?: ((info: {
|
|
85
|
-
distanceFromEnd: number;
|
|
86
|
-
}) => void) | null | undefined;
|
|
87
|
-
onEndReachedThreshold?: number | null | undefined;
|
|
88
|
-
onItemSizeChanged?: ((info: {
|
|
89
|
-
size: number;
|
|
90
|
-
previous: number;
|
|
91
|
-
index: number;
|
|
92
|
-
itemKey: string;
|
|
93
|
-
itemData: T;
|
|
94
|
-
}) => void) | undefined;
|
|
95
|
-
onRefresh?: () => void;
|
|
96
|
-
onStartReached?: ((info: {
|
|
97
|
-
distanceFromStart: number;
|
|
98
|
-
}) => void) | null | undefined;
|
|
99
|
-
onStartReachedThreshold?: number | null | undefined;
|
|
100
|
-
onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
|
|
101
|
-
progressViewOffset?: number;
|
|
102
|
-
recycleItems?: boolean;
|
|
103
|
-
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
104
|
-
refreshing?: boolean;
|
|
105
|
-
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
|
|
106
|
-
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
107
|
-
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
108
|
-
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
109
|
-
waitForInitialLayout?: boolean;
|
|
110
|
-
} & 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"> & {
|
|
111
11
|
getEstimatedItemSize?: ((index: number, item: ItemT_1) => number) | undefined;
|
|
112
|
-
ItemSeparatorComponent?: React.ComponentType<{
|
|
113
|
-
leadingItem: ItemT_1;
|
|
114
|
-
}> | undefined;
|
|
115
12
|
keyExtractor?: ((item: ItemT_1, index: number) => string) | undefined;
|
|
116
|
-
onItemSizeChanged?: ((info: {
|
|
117
|
-
size: number;
|
|
118
|
-
previous: number;
|
|
119
|
-
index: number;
|
|
120
|
-
itemKey: string;
|
|
121
|
-
itemData: ItemT_1;
|
|
122
|
-
}) => void) | undefined;
|
|
123
|
-
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<ItemT_1>) => React.ReactNode) | undefined;
|
|
124
13
|
animatedProps?: Partial<{
|
|
125
|
-
contentOffset?: react_native.PointProp | react_native_reanimated.SharedValue<react_native.PointProp | undefined> | undefined;
|
|
126
|
-
contentInset?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
|
|
127
|
-
maintainVisibleContentPosition?: {
|
|
128
|
-
autoscrollToTopThreshold?: number | null | undefined;
|
|
129
|
-
minIndexForVisible: number;
|
|
130
|
-
} | react_native_reanimated.SharedValue<{
|
|
131
|
-
autoscrollToTopThreshold?: number | null | undefined;
|
|
132
|
-
minIndexForVisible: number;
|
|
133
|
-
} | null | undefined> | null | undefined;
|
|
134
|
-
stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
|
|
135
14
|
decelerationRate?: number | "fast" | "normal" | react_native_reanimated.SharedValue<number | "fast" | "normal" | undefined> | undefined;
|
|
136
15
|
horizontal?: boolean | react_native_reanimated.SharedValue<boolean | null | undefined> | null | undefined;
|
|
137
16
|
invertStickyHeaders?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
@@ -154,6 +33,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
|
|
|
154
33
|
snapToOffsets?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
|
|
155
34
|
snapToStart?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
156
35
|
snapToEnd?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
36
|
+
stickyHeaderIndices?: number[] | react_native_reanimated.SharedValue<number[] | undefined> | undefined;
|
|
157
37
|
disableIntervalMomentum?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
158
38
|
disableScrollViewPanResponder?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
159
39
|
StickyHeaderComponent?: React.ComponentType<any> | react_native_reanimated.SharedValue<React.ComponentType<any> | undefined> | undefined;
|
|
@@ -257,8 +137,17 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
|
|
|
257
137
|
bouncesZoom?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
258
138
|
canCancelContentTouches?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
259
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;
|
|
260
142
|
contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes" | react_native_reanimated.SharedValue<"always" | "never" | "automatic" | "scrollableAxes" | undefined> | undefined;
|
|
261
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;
|
|
262
151
|
maximumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
263
152
|
minimumZoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
264
153
|
onScrollAnimationEnd?: (() => void) | react_native_reanimated.SharedValue<(() => void) | undefined> | undefined;
|
|
@@ -267,7 +156,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
|
|
|
267
156
|
scrollIndicatorInsets?: Insets | react_native_reanimated.SharedValue<Insets | undefined> | undefined;
|
|
268
157
|
scrollToOverflowEnabled?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
269
158
|
scrollsToTop?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
270
|
-
snapToAlignment?: "
|
|
159
|
+
snapToAlignment?: "center" | "start" | "end" | react_native_reanimated.SharedValue<"center" | "start" | "end" | undefined> | undefined;
|
|
271
160
|
onScrollToTop?: ((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | react_native_reanimated.SharedValue<((event: react_native.NativeSyntheticEvent<react_native.NativeScrollEvent>) => void) | undefined> | undefined;
|
|
272
161
|
zoomScale?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
273
162
|
endFillColor?: react_native.ColorValue | react_native_reanimated.SharedValue<react_native.ColorValue | undefined> | undefined;
|
|
@@ -277,8 +166,8 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
|
|
|
277
166
|
fadingEdgeLength?: number | react_native_reanimated.SharedValue<number | undefined> | undefined;
|
|
278
167
|
persistentScrollbar?: boolean | react_native_reanimated.SharedValue<boolean | undefined> | undefined;
|
|
279
168
|
} & {
|
|
280
|
-
contentContainerStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<react_native.StyleProp<react_native.ViewStyle>>>;
|
|
281
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>>>;
|
|
282
171
|
indicatorStyle?: react_native.StyleProp<react_native_reanimated.AnimatedStyle<"default" | "black" | "white" | undefined>>;
|
|
283
172
|
} & {
|
|
284
173
|
layout?: react_native_reanimated.BaseAnimationBuilder | react_native_reanimated.LayoutAnimationFunction | typeof react_native_reanimated.BaseAnimationBuilder;
|
|
@@ -288,9 +177,120 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
|
|
|
288
177
|
sharedTransitionTag?: string;
|
|
289
178
|
sharedTransitionStyle?: react_native_reanimated.SharedTransition;
|
|
290
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;
|
|
291
191
|
} & {
|
|
292
192
|
ref?: React.Ref<LegendListRef>;
|
|
293
|
-
}) => React.ReactElement | null)
|
|
193
|
+
}) => React.ReactElement | null) | (<T>(props: Omit<react_native.ScrollViewProps, "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
|
+
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
241
|
+
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
242
|
+
waitForInitialLayout?: boolean;
|
|
243
|
+
} & React.RefAttributes<LegendListRef>) => React.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<react_native.ScrollViewProps, "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
244
|
+
alignItemsAtEnd?: boolean;
|
|
245
|
+
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
246
|
+
data: readonly T[];
|
|
247
|
+
drawDistance?: number;
|
|
248
|
+
estimatedItemSize?: number;
|
|
249
|
+
extraData?: any;
|
|
250
|
+
getEstimatedItemSize?: ((index: number, item: T) => number) | undefined;
|
|
251
|
+
initialContainerPoolRatio?: number | undefined;
|
|
252
|
+
initialScrollOffset?: number;
|
|
253
|
+
initialScrollIndex?: number;
|
|
254
|
+
ItemSeparatorComponent?: React.ComponentType<{
|
|
255
|
+
leadingItem: T;
|
|
256
|
+
}> | undefined;
|
|
257
|
+
keyExtractor?: ((item: T, index: number) => string) | undefined;
|
|
258
|
+
ListEmptyComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
259
|
+
ListFooterComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
260
|
+
ListFooterComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
261
|
+
ListHeaderComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
262
|
+
ListHeaderComponentStyle?: react_native.StyleProp<react_native.ViewStyle> | undefined;
|
|
263
|
+
maintainScrollAtEnd?: boolean;
|
|
264
|
+
maintainScrollAtEndThreshold?: number;
|
|
265
|
+
maintainVisibleContentPosition?: boolean;
|
|
266
|
+
numColumns?: number;
|
|
267
|
+
onEndReached?: ((info: {
|
|
268
|
+
distanceFromEnd: number;
|
|
269
|
+
}) => void) | null | undefined;
|
|
270
|
+
onEndReachedThreshold?: number | null | undefined;
|
|
271
|
+
onItemSizeChanged?: ((info: {
|
|
272
|
+
size: number;
|
|
273
|
+
previous: number;
|
|
274
|
+
index: number;
|
|
275
|
+
itemKey: string;
|
|
276
|
+
itemData: T;
|
|
277
|
+
}) => void) | undefined;
|
|
278
|
+
onRefresh?: () => void;
|
|
279
|
+
onStartReached?: ((info: {
|
|
280
|
+
distanceFromStart: number;
|
|
281
|
+
}) => void) | null | undefined;
|
|
282
|
+
onStartReachedThreshold?: number | null | undefined;
|
|
283
|
+
onViewableItemsChanged?: _legendapp_list.OnViewableItemsChanged | undefined;
|
|
284
|
+
progressViewOffset?: number;
|
|
285
|
+
recycleItems?: boolean;
|
|
286
|
+
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
287
|
+
refreshing?: boolean;
|
|
288
|
+
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React.ReactNode) | undefined;
|
|
289
|
+
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
290
|
+
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
291
|
+
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
292
|
+
waitForInitialLayout?: boolean;
|
|
293
|
+
} & React.RefAttributes<LegendListRef>) => React.ReactNode)> = <T>(props: Omit<react_native.ScrollViewProps, "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
294
294
|
alignItemsAtEnd?: boolean;
|
|
295
295
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
296
296
|
data: readonly T[];
|
|
@@ -340,7 +340,7 @@ declare const LegendList: <ItemT, ListT extends (<T>(props: Omit<react_native.Sc
|
|
|
340
340
|
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
341
341
|
viewabilityConfigCallbackPairs?: _legendapp_list.ViewabilityConfigCallbackPairs | undefined;
|
|
342
342
|
waitForInitialLayout?: boolean;
|
|
343
|
-
} & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<react_native.ScrollViewProps, "
|
|
343
|
+
} & React.RefAttributes<LegendListRef>) => React.ReactNode>(props: Omit<react_native.ScrollViewProps, "stickyHeaderIndices" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
344
344
|
alignItemsAtEnd?: boolean;
|
|
345
345
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
346
346
|
data: readonly ItemT[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legendapp/list",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.48",
|
|
4
4
|
"description": "Legend List aims to be a drop-in replacement for FlatList with much better performance and supporting dynamically sized items.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"private": false,
|