@legendapp/list 3.1.1 → 3.2.0

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.
@@ -116,19 +116,24 @@ type ViewStyle = Record<string, unknown>;
116
116
  type StyleProp<T> = T | T[] | null | undefined | false;
117
117
  type AdaptiveRender = "normal" | "light";
118
118
  interface AdaptiveRenderConfig {
119
+ /**
120
+ * Mode to use before the list is ready to render.
121
+ * @default "normal"
122
+ */
123
+ initialMode?: AdaptiveRender;
119
124
  /**
120
125
  * Scroll velocity in pixels per millisecond above which items should switch to light mode.
121
- * @default 4
126
+ * @default 3 native, 6 web
122
127
  */
123
128
  enterVelocity?: number;
124
129
  /**
125
130
  * Scroll velocity in pixels per millisecond below which items can return to normal mode.
126
- * @default 1
131
+ * @default 1 native, 3 web
127
132
  */
128
133
  exitVelocity?: number;
129
134
  /**
130
135
  * Time to wait without velocity above exitVelocity before returning to normal mode.
131
- * @default 1000
136
+ * @default 250
132
137
  */
133
138
  exitDelay?: number;
134
139
  /**
@@ -344,6 +349,15 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
344
349
  * Called when list layout metrics change.
345
350
  */
346
351
  onMetricsChange?: (metrics: LegendListMetrics) => void;
352
+ /**
353
+ * Called when the first visible item changes. This is emitted from the core range calculation and is cheaper than
354
+ * viewability tracking when you only need to follow the item at the top of the viewport.
355
+ */
356
+ onFirstVisibleItemChanged?: (info: {
357
+ index: number;
358
+ item: ItemT;
359
+ key: string;
360
+ }) => void;
347
361
  /**
348
362
  * Configures the adaptive render signal. Items can use this to render a lighter version while scrolling quickly.
349
363
  */