@legendapp/list 3.2.0 → 3.3.1

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.
@@ -115,6 +115,7 @@ interface NativeSyntheticEvent<T> {
115
115
  type ViewStyle = Record<string, unknown>;
116
116
  type StyleProp<T> = T | T[] | null | undefined | false;
117
117
  type AdaptiveRender = "normal" | "light";
118
+ type AdaptiveRenderChangeReason = "initial" | "ready" | "scroll";
118
119
  interface AdaptiveRenderConfig {
119
120
  /**
120
121
  * Mode to use before the list is ready to render.
@@ -139,7 +140,7 @@ interface AdaptiveRenderConfig {
139
140
  /**
140
141
  * Called when the list-level adaptive render changes.
141
142
  */
142
- onChange?: (mode: AdaptiveRender) => void;
143
+ onChange?: (mode: AdaptiveRender, reason: AdaptiveRenderChangeReason) => void;
143
144
  }
144
145
  type BaseScrollViewProps<TScrollView> = Omit<TScrollView, "contentOffset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children" | "onScroll">;
145
146
  interface DataModeProps<ItemT, TItemType extends string | undefined> {
@@ -181,6 +182,11 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
181
182
  * Style applied to each column's wrapper view.
182
183
  */
183
184
  columnWrapperStyle?: ColumnWrapperStyle;
185
+ /**
186
+ * Identity token for the dataset represented by `data`.
187
+ * Change this when replacing the current dataset with a different logical dataset.
188
+ */
189
+ dataKey?: Key;
184
190
  /**
185
191
  * Version token that forces the list to treat data as updated even when the array reference is stable.
186
192
  * Increment or change this when mutating the data array in place.
@@ -826,4 +832,4 @@ declare function useSyncLayout(): () => void;
826
832
 
827
833
  declare const LegendList: LegendListComponent;
828
834
 
829
- export { type AdaptiveRender, type AdaptiveRenderConfig, type AlwaysRenderConfig, type AnchoredEndSpaceConfig, type ColumnWrapperStyle, type Insets, type LayoutRectangle, LegendList, type LegendListAverageItemSize, type LegendListComponent, type LegendListMetrics, type LegendListProps, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type LegendListState, type MaintainScrollAtEndOnOptions, type MaintainScrollAtEndOptions, type MaintainVisibleContentPositionConfig, type NativeScrollEvent, type NativeSyntheticEvent, type OnViewableItemsChanged, type OnViewableItemsChangedInfo, type ScrollIndexWithOffset, type ScrollIndexWithOffsetAndContentOffset, type ScrollIndexWithOffsetPosition, type StickyHeaderConfig, type StyleProp, type ViewAmountToken, type ViewStyle, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, useAdaptiveRender, useAdaptiveRenderChange, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };
835
+ export { type AdaptiveRender, type AdaptiveRenderChangeReason, type AdaptiveRenderConfig, type AlwaysRenderConfig, type AnchoredEndSpaceConfig, type ColumnWrapperStyle, type Insets, type LayoutRectangle, LegendList, type LegendListAverageItemSize, type LegendListComponent, type LegendListMetrics, type LegendListProps, type LegendListRecyclingState, type LegendListRef, type LegendListRenderItemProps, type LegendListState, type MaintainScrollAtEndOnOptions, type MaintainScrollAtEndOptions, type MaintainVisibleContentPositionConfig, type NativeScrollEvent, type NativeSyntheticEvent, type OnViewableItemsChanged, type OnViewableItemsChangedInfo, type ScrollIndexWithOffset, type ScrollIndexWithOffsetAndContentOffset, type ScrollIndexWithOffsetPosition, type StickyHeaderConfig, type StyleProp, type ViewAmountToken, type ViewStyle, type ViewToken, type ViewabilityAmountCallback, type ViewabilityCallback, type ViewabilityConfig, type ViewabilityConfigCallbackPair, type ViewabilityConfigCallbackPairs, useAdaptiveRender, useAdaptiveRenderChange, useIsLastItem, useListScrollSize, useRecyclingEffect, useRecyclingState, useSyncLayout, useViewability, useViewabilityAmount };