@legendapp/list 3.0.0-beta.52 → 3.0.0-beta.54

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/reanimated.d.ts CHANGED
@@ -155,7 +155,10 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
155
155
  */
156
156
  extraData?: any;
157
157
  /**
158
- * In case you have distinct item sizes, you can provide a function to get the size of an item.
158
+ * Optional per-item size estimate used before a row is measured.
159
+ *
160
+ * @deprecated Prefer a single `estimatedItemSize` for initial size hints, or `getFixedItemSize`
161
+ * when item sizes are known exactly.
159
162
  */
160
163
  getEstimatedItemSize?: (item: ItemT, index: number, type: TItemType) => number;
161
164
  /**
@@ -173,8 +176,9 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
173
176
  leadingItem: ItemT;
174
177
  }>;
175
178
  /**
176
- * Ratio of initial container pool size to data length (e.g., 0.5 for half).
177
- * @default 2
179
+ * Ratio used to size the initial recycled container pool.
180
+ * @deprecated The list now manages spare container capacity automatically.
181
+ * @default 3
178
182
  */
179
183
  initialContainerPoolRatio?: number | undefined;
180
184
  /**
@@ -249,6 +253,11 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
249
253
  * Keeps an item visually anchored to the start by adding trailing space when the content below it underflows.
250
254
  */
251
255
  anchoredEndSpace?: AnchoredEndSpaceConfig;
256
+ /**
257
+ * Adjusts the effective end content inset for web lists without replacing the base contentInset.
258
+ * The adjustment is also rendered as real content padding so the browser scroll range includes it.
259
+ */
260
+ contentInsetEndAdjustment?: number;
252
261
  /**
253
262
  * Number of columns to render items in.
254
263
  * @default 1
@@ -350,12 +359,6 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
350
359
  * Array of item indices to use as snap points.
351
360
  */
352
361
  snapToIndices?: number[];
353
- /**
354
- * This will log a suggested estimatedItemSize.
355
- * @required
356
- * @default false
357
- */
358
- suggestEstimatedItemSize?: boolean;
359
362
  /**
360
363
  * Configuration for determining item viewability.
361
364
  */
@@ -444,6 +447,10 @@ interface LegendListMetrics {
444
447
  headerSize: number;
445
448
  footerSize: number;
446
449
  }
450
+ interface LegendListAverageItemSize {
451
+ average: number;
452
+ count: number;
453
+ }
447
454
  interface LegendListRenderItemProps<ItemT, TItemType extends string | number | undefined = string | number | undefined> {
448
455
  data: readonly ItemT[];
449
456
  extraData: any;
@@ -465,6 +472,7 @@ type LegendListState = {
465
472
  isEndReached: boolean;
466
473
  isStartReached: boolean;
467
474
  isWithinMaintainScrollAtEndThreshold: boolean;
475
+ getAverageItemSizes: () => Record<string, LegendListAverageItemSize>;
468
476
  listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
469
477
  listenToPosition: (key: string, callback: (value: number) => void) => () => void;
470
478
  positionAtIndex: (index: number) => number;
@@ -642,7 +650,7 @@ interface ViewabilityConfig {
642
650
  waitForInteraction?: boolean | undefined;
643
651
  }
644
652
 
645
- type LegendListPropsOverrides<ItemT, TItemType extends string | undefined> = Omit<LegendListPropsBase<ItemT, ScrollViewProps, TItemType>, "anchoredEndSpace" | "onScroll" | "refScrollView" | "renderScrollComponent" | "ListHeaderComponentStyle" | "ListFooterComponentStyle"> & {
653
+ type LegendListPropsOverrides<ItemT, TItemType extends string | undefined> = Omit<LegendListPropsBase<ItemT, ScrollViewProps, TItemType>, "anchoredEndSpace" | "contentInsetEndAdjustment" | "onScroll" | "refScrollView" | "renderScrollComponent" | "ListHeaderComponentStyle" | "ListFooterComponentStyle"> & {
646
654
  onScroll?: (event: NativeSyntheticEvent$1<NativeScrollEvent$1>) => void;
647
655
  refScrollView?: React.Ref<ScrollView>;
648
656
  renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement<ScrollViewProps>;
package/reanimated.js CHANGED
@@ -50,7 +50,7 @@ var ReanimatedScrollBridge = typedMemo(function ReanimatedScrollBridgeComponent(
50
50
  const combinedRef = useCombinedRef(animatedScrollRef, forwardedRef);
51
51
  const ScrollComponent = React__namespace.useMemo(
52
52
  () => renderScrollComponent ? React__namespace.forwardRef(
53
- (scrollViewProps, ref) => renderScrollComponent({ ...scrollViewProps, ref })
53
+ (scrollViewProps, ref) => renderScrollComponent({ ...scrollViewProps, ref, scrollEventThrottle: 1 })
54
54
  ) : Reanimated__default.default.ScrollView,
55
55
  [renderScrollComponent]
56
56
  );
package/reanimated.mjs CHANGED
@@ -26,7 +26,7 @@ var ReanimatedScrollBridge = typedMemo(function ReanimatedScrollBridgeComponent(
26
26
  const combinedRef = useCombinedRef(animatedScrollRef, forwardedRef);
27
27
  const ScrollComponent = React.useMemo(
28
28
  () => renderScrollComponent ? React.forwardRef(
29
- (scrollViewProps, ref) => renderScrollComponent({ ...scrollViewProps, ref })
29
+ (scrollViewProps, ref) => renderScrollComponent({ ...scrollViewProps, ref, scrollEventThrottle: 1 })
30
30
  ) : Reanimated.ScrollView,
31
31
  [renderScrollComponent]
32
32
  );
package/section-list.d.ts CHANGED
@@ -211,7 +211,10 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
211
211
  */
212
212
  extraData?: any;
213
213
  /**
214
- * In case you have distinct item sizes, you can provide a function to get the size of an item.
214
+ * Optional per-item size estimate used before a row is measured.
215
+ *
216
+ * @deprecated Prefer a single `estimatedItemSize` for initial size hints, or `getFixedItemSize`
217
+ * when item sizes are known exactly.
215
218
  */
216
219
  getEstimatedItemSize?: (item: ItemT, index: number, type: TItemType) => number;
217
220
  /**
@@ -229,8 +232,9 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
229
232
  leadingItem: ItemT;
230
233
  }>;
231
234
  /**
232
- * Ratio of initial container pool size to data length (e.g., 0.5 for half).
233
- * @default 2
235
+ * Ratio used to size the initial recycled container pool.
236
+ * @deprecated The list now manages spare container capacity automatically.
237
+ * @default 3
234
238
  */
235
239
  initialContainerPoolRatio?: number | undefined;
236
240
  /**
@@ -305,6 +309,11 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
305
309
  * Keeps an item visually anchored to the start by adding trailing space when the content below it underflows.
306
310
  */
307
311
  anchoredEndSpace?: AnchoredEndSpaceConfig;
312
+ /**
313
+ * Adjusts the effective end content inset for web lists without replacing the base contentInset.
314
+ * The adjustment is also rendered as real content padding so the browser scroll range includes it.
315
+ */
316
+ contentInsetEndAdjustment?: number;
308
317
  /**
309
318
  * Number of columns to render items in.
310
319
  * @default 1
@@ -406,12 +415,6 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
406
415
  * Array of item indices to use as snap points.
407
416
  */
408
417
  snapToIndices?: number[];
409
- /**
410
- * This will log a suggested estimatedItemSize.
411
- * @required
412
- * @default false
413
- */
414
- suggestEstimatedItemSize?: boolean;
415
418
  /**
416
419
  * Configuration for determining item viewability.
417
420
  */
@@ -500,6 +503,10 @@ interface LegendListMetrics {
500
503
  headerSize: number;
501
504
  footerSize: number;
502
505
  }
506
+ interface LegendListAverageItemSize {
507
+ average: number;
508
+ count: number;
509
+ }
503
510
  interface LegendListRenderItemProps<ItemT, TItemType extends string | number | undefined = string | number | undefined> {
504
511
  data: readonly ItemT[];
505
512
  extraData: any;
@@ -521,6 +528,7 @@ type LegendListState = {
521
528
  isEndReached: boolean;
522
529
  isStartReached: boolean;
523
530
  isWithinMaintainScrollAtEndThreshold: boolean;
531
+ getAverageItemSizes: () => Record<string, LegendListAverageItemSize>;
524
532
  listen: <T extends LegendListListenerType>(listenerType: T, callback: (value: ListenerTypeValueMap[T]) => void) => () => void;
525
533
  listenToPosition: (key: string, callback: (value: number) => void) => () => void;
526
534
  positionAtIndex: (index: number) => number;
@@ -698,7 +706,7 @@ interface ViewabilityConfig {
698
706
  waitForInteraction?: boolean | undefined;
699
707
  }
700
708
 
701
- type LegendListPropsOverrides<ItemT, TItemType extends string | undefined> = Omit<LegendListPropsBase<ItemT, ScrollViewProps, TItemType>, "anchoredEndSpace" | "onScroll" | "refScrollView" | "renderScrollComponent" | "ListHeaderComponentStyle" | "ListFooterComponentStyle"> & {
709
+ type LegendListPropsOverrides<ItemT, TItemType extends string | undefined> = Omit<LegendListPropsBase<ItemT, ScrollViewProps, TItemType>, "anchoredEndSpace" | "contentInsetEndAdjustment" | "onScroll" | "refScrollView" | "renderScrollComponent" | "ListHeaderComponentStyle" | "ListFooterComponentStyle"> & {
702
710
  onScroll?: (event: NativeSyntheticEvent$1<NativeScrollEvent$1>) => void;
703
711
  refScrollView?: React.Ref<ScrollView>;
704
712
  renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement<ScrollViewProps>;