@legendapp/list 3.0.0-beta.13 → 3.0.0-beta.15

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.
@@ -76,7 +76,7 @@ declare class ScrollAdjustHandler {
76
76
  constructor(ctx: StateContext);
77
77
  requestAdjust(add: number): void;
78
78
  getAdjust(): number;
79
- commitPendingAdjust(): void;
79
+ commitPendingAdjust(scrollTarget: ScrollTarget): void;
80
80
  }
81
81
 
82
82
  type BaseSharedValue<T = number> = {
@@ -223,7 +223,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
223
223
  /**
224
224
  * Maintains visibility of content.
225
225
  * - scroll (default: true) stabilizes during size/layout changes while scrolling.
226
- * - dataChanged (default: false) stabilizes when the data array changes; passing true also sets the RN maintainVisibleContentPosition prop.
226
+ * - data (default: false) stabilizes when the data array changes; passing true also sets the RN maintainVisibleContentPosition prop.
227
227
  * - undefined (default) enables scroll stabilization but skips data-change anchoring.
228
228
  * - true enables both behaviors; false disables both.
229
229
  */
@@ -340,18 +340,36 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
340
340
  * @deprecated Use stickyHeaderIndices instead for parity with React Native.
341
341
  */
342
342
  stickyIndices?: number[];
343
+ /**
344
+ * Configuration for sticky headers.
345
+ * @default undefined
346
+ */
347
+ stickyHeaderConfig?: StickyHeaderConfig;
343
348
  getItemType?: (item: ItemT, index: number) => TItemType;
344
349
  getFixedItemSize?: (index: number, item: ItemT, type: TItemType) => number | undefined;
345
350
  itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
346
351
  }
347
352
  type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView> | ComponentProps<typeof Reanimated.ScrollView>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps<TScrollView> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
348
353
  interface MaintainVisibleContentPositionConfig {
349
- dataChanged?: boolean;
350
- scroll?: boolean;
354
+ data?: boolean;
355
+ size?: boolean;
351
356
  }
352
357
  interface MaintainVisibleContentPositionNormalized {
353
- dataChanged: boolean;
354
- scroll: boolean;
358
+ data: boolean;
359
+ size: boolean;
360
+ }
361
+ interface StickyHeaderConfig {
362
+ /**
363
+ * Specifies how far from the top edge sticky headers should start sticking.
364
+ * Useful for scenarios with a fixed navbar or header, where sticky elements pin below it..
365
+ * @default 0
366
+ */
367
+ offset?: number;
368
+ /**
369
+ * Component to render as a backdrop behind the sticky header.
370
+ * @default undefined
371
+ */
372
+ backdropComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
355
373
  }
356
374
  interface MaintainScrollAtEndOptions {
357
375
  onLayout?: boolean;
@@ -731,4 +749,4 @@ type GetRenderedItemResult<ItemT> = {
731
749
  };
732
750
  type GetRenderedItem = (key: string) => GetRenderedItemResult<any> | null;
733
751
 
734
- export { type ColumnWrapperStyle as C, type GetRenderedItemResult as G, type InternalState as I, type LegendListProps as L, type MaintainVisibleContentPositionConfig as M, type OnViewableItemsChanged as O, type ScrollTarget as S, type ThresholdSnapshot as T, type ViewabilityCallback as V, type LegendListRef as a, type ViewabilityAmountCallback as b, type LegendListRecyclingState as c, type LegendListPropsBase as d, type MaintainVisibleContentPositionNormalized as e, type MaintainScrollAtEndOptions as f, type ViewableRange as g, type LegendListRenderItemProps as h, type LegendListState as i, type ViewToken as j, type ViewAmountToken as k, type ViewabilityConfigCallbackPair as l, type ViewabilityConfigCallbackPairs as m, type ViewabilityConfig as n, type TypedForwardRef as o, type TypedMemo as p, typedMemo as q, type ScrollIndexWithOffset as r, type ScrollIndexWithOffsetPosition as s, typedForwardRef as t, type ScrollIndexWithOffsetAndContentOffset as u, type InitialScrollAnchor as v, type GetRenderedItem as w };
752
+ export { type ColumnWrapperStyle as C, type GetRenderedItemResult as G, type InternalState as I, type LegendListProps as L, type MaintainVisibleContentPositionConfig as M, type OnViewableItemsChanged as O, type StickyHeaderConfig as S, type ThresholdSnapshot as T, type ViewabilityCallback as V, type LegendListRef as a, type ViewabilityAmountCallback as b, type LegendListRecyclingState as c, type LegendListPropsBase as d, type MaintainVisibleContentPositionNormalized as e, type MaintainScrollAtEndOptions as f, type ScrollTarget as g, type ViewableRange as h, type LegendListRenderItemProps as i, type LegendListState as j, type ViewToken as k, type ViewAmountToken as l, type ViewabilityConfigCallbackPair as m, type ViewabilityConfigCallbackPairs as n, type ViewabilityConfig as o, type TypedForwardRef as p, type TypedMemo as q, typedMemo as r, type ScrollIndexWithOffset as s, typedForwardRef as t, type ScrollIndexWithOffsetPosition as u, type ScrollIndexWithOffsetAndContentOffset as v, type InitialScrollAnchor as w, type GetRenderedItem as x };
@@ -76,7 +76,7 @@ declare class ScrollAdjustHandler {
76
76
  constructor(ctx: StateContext);
77
77
  requestAdjust(add: number): void;
78
78
  getAdjust(): number;
79
- commitPendingAdjust(): void;
79
+ commitPendingAdjust(scrollTarget: ScrollTarget): void;
80
80
  }
81
81
 
82
82
  type BaseSharedValue<T = number> = {
@@ -223,7 +223,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
223
223
  /**
224
224
  * Maintains visibility of content.
225
225
  * - scroll (default: true) stabilizes during size/layout changes while scrolling.
226
- * - dataChanged (default: false) stabilizes when the data array changes; passing true also sets the RN maintainVisibleContentPosition prop.
226
+ * - data (default: false) stabilizes when the data array changes; passing true also sets the RN maintainVisibleContentPosition prop.
227
227
  * - undefined (default) enables scroll stabilization but skips data-change anchoring.
228
228
  * - true enables both behaviors; false disables both.
229
229
  */
@@ -340,18 +340,36 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
340
340
  * @deprecated Use stickyHeaderIndices instead for parity with React Native.
341
341
  */
342
342
  stickyIndices?: number[];
343
+ /**
344
+ * Configuration for sticky headers.
345
+ * @default undefined
346
+ */
347
+ stickyHeaderConfig?: StickyHeaderConfig;
343
348
  getItemType?: (item: ItemT, index: number) => TItemType;
344
349
  getFixedItemSize?: (index: number, item: ItemT, type: TItemType) => number | undefined;
345
350
  itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
346
351
  }
347
352
  type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView> | ComponentProps<typeof Reanimated.ScrollView>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps<TScrollView> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
348
353
  interface MaintainVisibleContentPositionConfig {
349
- dataChanged?: boolean;
350
- scroll?: boolean;
354
+ data?: boolean;
355
+ size?: boolean;
351
356
  }
352
357
  interface MaintainVisibleContentPositionNormalized {
353
- dataChanged: boolean;
354
- scroll: boolean;
358
+ data: boolean;
359
+ size: boolean;
360
+ }
361
+ interface StickyHeaderConfig {
362
+ /**
363
+ * Specifies how far from the top edge sticky headers should start sticking.
364
+ * Useful for scenarios with a fixed navbar or header, where sticky elements pin below it..
365
+ * @default 0
366
+ */
367
+ offset?: number;
368
+ /**
369
+ * Component to render as a backdrop behind the sticky header.
370
+ * @default undefined
371
+ */
372
+ backdropComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
355
373
  }
356
374
  interface MaintainScrollAtEndOptions {
357
375
  onLayout?: boolean;
@@ -731,4 +749,4 @@ type GetRenderedItemResult<ItemT> = {
731
749
  };
732
750
  type GetRenderedItem = (key: string) => GetRenderedItemResult<any> | null;
733
751
 
734
- export { type ColumnWrapperStyle as C, type GetRenderedItemResult as G, type InternalState as I, type LegendListProps as L, type MaintainVisibleContentPositionConfig as M, type OnViewableItemsChanged as O, type ScrollTarget as S, type ThresholdSnapshot as T, type ViewabilityCallback as V, type LegendListRef as a, type ViewabilityAmountCallback as b, type LegendListRecyclingState as c, type LegendListPropsBase as d, type MaintainVisibleContentPositionNormalized as e, type MaintainScrollAtEndOptions as f, type ViewableRange as g, type LegendListRenderItemProps as h, type LegendListState as i, type ViewToken as j, type ViewAmountToken as k, type ViewabilityConfigCallbackPair as l, type ViewabilityConfigCallbackPairs as m, type ViewabilityConfig as n, type TypedForwardRef as o, type TypedMemo as p, typedMemo as q, type ScrollIndexWithOffset as r, type ScrollIndexWithOffsetPosition as s, typedForwardRef as t, type ScrollIndexWithOffsetAndContentOffset as u, type InitialScrollAnchor as v, type GetRenderedItem as w };
752
+ export { type ColumnWrapperStyle as C, type GetRenderedItemResult as G, type InternalState as I, type LegendListProps as L, type MaintainVisibleContentPositionConfig as M, type OnViewableItemsChanged as O, type StickyHeaderConfig as S, type ThresholdSnapshot as T, type ViewabilityCallback as V, type LegendListRef as a, type ViewabilityAmountCallback as b, type LegendListRecyclingState as c, type LegendListPropsBase as d, type MaintainVisibleContentPositionNormalized as e, type MaintainScrollAtEndOptions as f, type ScrollTarget as g, type ViewableRange as h, type LegendListRenderItemProps as i, type LegendListState as j, type ViewToken as k, type ViewAmountToken as l, type ViewabilityConfigCallbackPair as m, type ViewabilityConfigCallbackPairs as n, type ViewabilityConfig as o, type TypedForwardRef as p, type TypedMemo as q, typedMemo as r, type ScrollIndexWithOffset as s, typedForwardRef as t, type ScrollIndexWithOffsetPosition as u, type ScrollIndexWithOffsetAndContentOffset as v, type InitialScrollAnchor as w, type GetRenderedItem as x };