impact-nova 2.6.3 → 3.0.0-alpha.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.
- package/dist/components/data/ag-grid-react/ag-grid-cell-components.d.ts +9 -0
- package/dist/components/data/ag-grid-react/ag-grid-list.d.ts +16 -0
- package/dist/components/data/ag-grid-react/ag-grid-list.js +23 -0
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +7 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/list-select-cell-editor.d.ts +14 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/list-select-cell-editor.js +70 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/select-cell-editor.d.ts +10 -5
- package/dist/components/data/ag-grid-react/cell-renderers/editors/select-cell-editor.js +73 -41
- package/dist/components/data/ag-grid-react/cell-renderers/index.d.ts +7 -0
- package/dist/components/data/ag-grid-react/cell-renderers/index.js +42 -36
- package/dist/components/data/ag-grid-react/cell-renderers/list-select-display-renderer.d.ts +19 -0
- package/dist/components/data/ag-grid-react/cell-renderers/list-select-display-renderer.js +89 -0
- package/dist/components/data/ag-grid-react/cell-renderers/select-ai-insight-affordance.d.ts +28 -0
- package/dist/components/data/ag-grid-react/cell-renderers/select-ai-insight-affordance.js +96 -0
- package/dist/components/data/ag-grid-react/cell-renderers/select-display-renderer.d.ts +30 -10
- package/dist/components/data/ag-grid-react/cell-renderers/select-display-renderer.js +72 -24
- package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.d.ts +42 -0
- package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.js +86 -0
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +162 -146
- package/dist/components/data/data-table/data-table.js +85 -82
- package/dist/components/data/data-table/data-table.types.d.ts +5 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +2 -3
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +2 -3
- package/dist/components/data/expandable-list-item/sku-next-page-coordinator.d.ts +14 -0
- package/dist/components/data/expandable-list-item/sku-strip-lookahead.d.ts +26 -0
- package/dist/components/data/expandable-list-item/useServerSkuInfinitePages.d.ts +10 -0
- package/dist/components/data/expandable-list-item/useSkuStripVirtualizer.d.ts +30 -0
- package/dist/components/data/expandable-list-item/virtualized-responsive-grid.catalog.d.ts +81 -0
- package/dist/components/data/expandable-list-item/virtualized-responsive-grid.item-grid.d.ts +1 -0
- package/dist/components/data/expandable-list-item/virtualized-responsive-grid.product-card.d.ts +7 -0
- package/dist/components/data/expandable-list-item/virtualized-responsive-grid.sku-picker.d.ts +2 -0
- package/dist/components/data-display/chart/chart-heatmap-demos.d.ts +3 -0
- package/dist/components/data-display/chart/chart-heatmap-play.d.ts +9 -0
- package/dist/components/data-display/chart/chart.category-cluster-heatmap.stories-data.d.ts +22 -0
- package/dist/components/data-display/chart/chart.diverging-heatmap.stories-data.d.ts +43 -0
- package/dist/components/data-display/chart/chart.js +100 -93
- package/dist/components/data-display/chart/chart.types.d.ts +10 -0
- package/dist/components/data-display/chart/chart.utils.d.ts +14 -2
- package/dist/components/data-display/chart/chart.utils.js +132 -35
- package/dist/components/data-display/chart/index.js +15 -13
- package/dist/components/data-display/chart/resolve-highcharts-options.js +19 -14
- package/dist/components/data-display/globe-map/globe-map.d.ts +8 -0
- package/dist/components/data-display/globe-map/globe-map.js +161 -0
- package/dist/components/data-display/globe-map/globe-map.stories-data.d.ts +12 -0
- package/dist/components/data-display/globe-map/globe-map.types.d.ts +83 -0
- package/dist/components/data-display/globe-map/globe-map.utils.d.ts +115 -0
- package/dist/components/data-display/globe-map/globe-map.utils.js +259 -0
- package/dist/components/data-display/globe-map/globe-map.variants.d.ts +19 -0
- package/dist/components/data-display/globe-map/globe-map.variants.js +80 -0
- package/dist/components/data-display/globe-map/index.d.ts +2 -0
- package/dist/components/data-display/globe-map/index.js +10 -0
- package/dist/components/data-display/globe-map/internals/globe-countries-110m.json.d.ts +4 -0
- package/dist/components/data-display/globe-map/internals/globe-countries-110m.json.js +7 -0
- package/dist/components/data-display/globe-map/internals/globe-map-context.d.ts +25 -0
- package/dist/components/data-display/globe-map/internals/globe-map-context.js +19 -0
- package/dist/components/data-display/globe-map/internals/globe-map-legend.d.ts +2 -0
- package/dist/components/data-display/globe-map/internals/globe-map-legend.js +51 -0
- package/dist/components/data-display/globe-map/internals/globe-map-point-card-carousel.d.ts +6 -0
- package/dist/components/data-display/globe-map/internals/globe-map-point-card-carousel.js +119 -0
- package/dist/components/data-display/globe-map/internals/globe-map-point-card.d.ts +2 -0
- package/dist/components/data-display/globe-map/internals/globe-map-point-card.js +106 -0
- package/dist/components/data-display/globe-map/internals/globe-map-scene.d.ts +17 -0
- package/dist/components/data-display/globe-map/internals/globe-map-scene.js +218 -0
- package/dist/components/data-display/globe-map/internals/globe-map-tooltip.d.ts +2 -0
- package/dist/components/data-display/globe-map/internals/globe-map-tooltip.js +33 -0
- package/dist/components/data-display/globe-map/internals/use-globe-map-scene.d.ts +45 -0
- package/dist/components/data-display/globe-map/internals/use-globe-map-scene.js +270 -0
- package/dist/components/data-display/hex-tilemap/hex-tilemap.d.ts +9 -0
- package/dist/components/data-display/hex-tilemap/hex-tilemap.js +94 -0
- package/dist/components/data-display/hex-tilemap/hex-tilemap.stories-data.d.ts +7 -0
- package/dist/components/data-display/hex-tilemap/hex-tilemap.types.d.ts +43 -0
- package/dist/components/data-display/hex-tilemap/hex-tilemap.variants.d.ts +11 -0
- package/dist/components/data-display/hex-tilemap/hex-tilemap.variants.js +47 -0
- package/dist/components/data-display/hex-tilemap/index.d.ts +2 -0
- package/dist/components/data-display/hex-tilemap/index.js +12 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-camera.d.ts +40 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-camera.js +103 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-country-lattices.d.ts +9 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-country-lattices.js +1387 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-geometry.d.ts +21 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-geometry.js +82 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-lattice.d.ts +18 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-lattice.js +47 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-layout.d.ts +10 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-layout.js +35 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-new-zealand-grid.d.ts +31 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-new-zealand-grid.js +138 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-regions.d.ts +6 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-regions.js +18 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-context.d.ts +24 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-context.js +19 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-legend.d.ts +2 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-legend.js +51 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-tooltip.d.ts +2 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-tooltip.js +36 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-viewport.d.ts +3 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-viewport.js +147 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-zoom.d.ts +13 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-zoom.js +99 -0
- package/dist/components/data-display/hex-tilemap/internals/hex-world-grid.d.ts +8 -0
- package/dist/components/data-display/hex-tilemap/internals/use-hex-camera.d.ts +27 -0
- package/dist/components/data-display/hex-tilemap/internals/use-hex-camera.js +137 -0
- package/dist/components/data-display/notch-card/index.d.ts +2 -0
- package/dist/components/data-display/notch-card/index.js +6 -0
- package/dist/components/data-display/notch-card/notch-card.d.ts +7 -0
- package/dist/components/data-display/notch-card/notch-card.js +151 -0
- package/dist/components/data-display/notch-card/notch-card.path.d.ts +19 -0
- package/dist/components/data-display/notch-card/notch-card.path.js +118 -0
- package/dist/components/data-display/notch-card/notch-card.types.d.ts +15 -0
- package/dist/components/data-display/notch-card/notch-card.variants.d.ts +15 -0
- package/dist/components/data-display/notch-card/notch-card.variants.js +86 -0
- package/dist/components/feedback/hover-card/hover-card.d.ts +3 -1
- package/dist/components/feedback/hover-card/hover-card.js +28 -24
- package/dist/components/feedback/tooltip/overflow-tooltip.d.ts +1 -1
- package/dist/components/feedback/tooltip/overflow-tooltip.js +63 -57
- package/dist/components/feedback/tooltip/overflow-tooltip.types.d.ts +4 -0
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +2 -3
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/flows/filter-strip/index.d.ts +1 -0
- package/dist/components/flows/filter-strip/index.js +4 -2
- package/dist/components/flows/iris-chat/index.d.ts +10 -0
- package/dist/components/flows/iris-chat/index.js +55 -0
- package/dist/components/flows/iris-chat/iris-chat-artifact.d.ts +4 -0
- package/dist/components/flows/iris-chat/iris-chat-artifact.js +125 -0
- package/dist/components/flows/iris-chat/iris-chat-composer.d.ts +3 -0
- package/dist/components/flows/iris-chat/iris-chat-composer.js +297 -0
- package/dist/components/flows/iris-chat/iris-chat-context.d.ts +14 -0
- package/dist/components/flows/iris-chat/iris-chat-context.js +23 -0
- package/dist/components/flows/iris-chat/iris-chat-icons.d.ts +18 -0
- package/dist/components/flows/iris-chat/iris-chat-icons.js +176 -0
- package/dist/components/flows/iris-chat/iris-chat-markdown.d.ts +3 -0
- package/dist/components/flows/iris-chat/iris-chat-markdown.js +62 -0
- package/dist/components/flows/iris-chat/iris-chat-menu.d.ts +15 -0
- package/dist/components/flows/iris-chat/iris-chat-menu.js +259 -0
- package/dist/components/flows/iris-chat/iris-chat-prompt.d.ts +3 -0
- package/dist/components/flows/iris-chat/iris-chat-prompt.js +46 -0
- package/dist/components/flows/iris-chat/iris-chat-thinking.d.ts +12 -0
- package/dist/components/flows/iris-chat/iris-chat-thinking.js +202 -0
- package/dist/components/flows/iris-chat/iris-chat-thread.d.ts +37 -0
- package/dist/components/flows/iris-chat/iris-chat-thread.js +493 -0
- package/dist/components/flows/iris-chat/iris-chat.d.ts +43 -0
- package/dist/components/flows/iris-chat/iris-chat.js +336 -0
- package/dist/components/flows/iris-chat/iris-chat.types.d.ts +208 -0
- package/dist/components/flows/iris-chat/iris-chat.variants.d.ts +14 -0
- package/dist/components/flows/iris-chat/iris-chat.variants.js +78 -0
- package/dist/components/flows/iris-chat/read-iris-greeting-period.d.ts +4 -0
- package/dist/components/flows/iris-chat/read-iris-greeting-period.js +16 -0
- package/dist/components/flows/wizard/index.d.ts +2 -2
- package/dist/components/flows/wizard/index.js +17 -13
- package/dist/components/flows/wizard/wizard-context.d.ts +6 -1
- package/dist/components/flows/wizard/wizard-context.js +15 -7
- package/dist/components/flows/wizard/wizard.d.ts +22 -4
- package/dist/components/flows/wizard/wizard.js +278 -174
- package/dist/components/flows/wizard/wizard.types.d.ts +40 -0
- package/dist/components/forms/choice-card/assets/featured-backdrop-baked.webp.js +4 -0
- package/dist/components/forms/choice-card/assets/featured-noise.webp.js +4 -0
- package/dist/components/forms/choice-card/choice-card-featured-arcs.d.ts +4 -0
- package/dist/components/forms/choice-card/choice-card-featured-arcs.js +42 -0
- package/dist/components/forms/choice-card/choice-card-featured-backdrop.d.ts +4 -0
- package/dist/components/forms/choice-card/choice-card-featured-backdrop.js +45 -0
- package/dist/components/forms/choice-card/choice-card-indicator.variants.d.ts +8 -0
- package/dist/components/forms/choice-card/choice-card-indicator.variants.js +5 -0
- package/dist/components/forms/choice-card/choice-card-percent.d.ts +11 -0
- package/dist/components/forms/choice-card/choice-card-percent.js +80 -0
- package/dist/components/forms/choice-card/choice-card.d.ts +40 -3
- package/dist/components/forms/choice-card/choice-card.js +651 -170
- package/dist/components/forms/choice-card/choice-card.types.d.ts +40 -0
- package/dist/components/forms/choice-card/choice-card.variants.d.ts +7 -0
- package/dist/components/forms/choice-card/choice-card.variants.js +100 -0
- package/dist/components/forms/choice-card/index.d.ts +2 -1
- package/dist/components/forms/choice-card/index.js +27 -10
- package/dist/components/forms/select/components/SelectTriggerValue.js +2 -3
- package/dist/components/forms/select/components/Submenu.js +2 -3
- package/dist/components/layout/header/header.d.ts +3 -2
- package/dist/components/layout/header/header.js +67 -47
- package/dist/components/layout/header/header.types.d.ts +1 -0
- package/dist/components/primitives/iris/iris-agent-cursor.d.ts +3 -0
- package/dist/components/primitives/iris/iris-agent-cursor.js +89 -0
- package/dist/components/primitives/iris/iris-alan-gradient-icon.d.ts +5 -0
- package/dist/components/primitives/iris/iris-alan-gradient-icon.js +69 -0
- package/dist/components/primitives/iris/iris-control-context.d.ts +15 -0
- package/dist/components/primitives/iris/iris-control-context.js +44 -0
- package/dist/components/primitives/iris/iris-control-region.d.ts +10 -0
- package/dist/components/primitives/iris/iris-control-region.js +102 -0
- package/dist/components/primitives/iris/iris-control.types.d.ts +24 -0
- package/dist/components/primitives/iris/iris-control.variants.d.ts +4 -0
- package/dist/components/primitives/iris/iris-control.variants.js +20 -0
- package/dist/components/primitives/iris/iris.d.ts +24 -0
- package/dist/components/primitives/iris/iris.js +232 -0
- package/dist/components/primitives/iris/iris.types.d.ts +35 -0
- package/dist/components/primitives/iris/iris.variants.d.ts +30 -0
- package/dist/components/primitives/iris/iris.variants.js +120 -0
- package/dist/components/primitives/stepper/internals/pipeline-current-mark.d.ts +6 -0
- package/dist/components/primitives/stepper/internals/pipeline-current-mark.js +35 -0
- package/dist/components/primitives/stepper/internals/rail-status-dot.d.ts +13 -0
- package/dist/components/primitives/stepper/internals/rail-status-dot.js +70 -0
- package/dist/components/primitives/stepper/internals/step-hit-target.d.ts +15 -0
- package/dist/components/primitives/stepper/internals/step-hit-target.js +51 -0
- package/dist/components/primitives/stepper/internals/step-model.d.ts +3 -0
- package/dist/components/primitives/stepper/internals/step-model.js +10 -0
- package/dist/components/primitives/stepper/internals/stepper-compact.d.ts +5 -0
- package/dist/components/primitives/stepper/internals/stepper-compact.js +68 -0
- package/dist/components/primitives/stepper/internals/stepper-pipeline.d.ts +7 -0
- package/dist/components/primitives/stepper/internals/stepper-pipeline.js +87 -0
- package/dist/components/primitives/stepper/internals/stepper-rail.d.ts +5 -0
- package/dist/components/primitives/stepper/internals/stepper-rail.js +105 -0
- package/dist/components/primitives/stepper/internals/stepper-summary.d.ts +5 -0
- package/dist/components/primitives/stepper/internals/stepper-summary.js +103 -0
- package/dist/components/primitives/stepper/internals/stepper-track.d.ts +8 -0
- package/dist/components/primitives/stepper/internals/stepper-track.js +170 -0
- package/dist/components/primitives/stepper/stepper.d.ts +1 -0
- package/dist/components/primitives/stepper/stepper.js +134 -52
- package/dist/components/primitives/stepper/stepper.types.d.ts +17 -0
- package/dist/components/primitives/stepper/stepper.variants.d.ts +26 -0
- package/dist/components/primitives/stepper/stepper.variants.js +165 -5
- package/dist/components/primitives/tabs/tabs.d.ts +4 -1
- package/dist/components/primitives/tabs/tabs.js +131 -59
- package/dist/components/primitives/tabs/tabs.types.d.ts +5 -1
- package/dist/i18n/defaultMessages.d.ts +100 -0
- package/dist/i18n/defaultMessages.js +118 -21
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/locales/de.js +99 -2
- package/dist/i18n/locales/es.js +99 -2
- package/dist/i18n/locales/hi.js +99 -2
- package/dist/i18n/locales/kn.js +99 -2
- package/dist/impact-nova-components.css +972 -2
- package/dist/impact-nova-tokens.scss +109 -1
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +585 -551
- package/dist/lib/virtualized/directional-range-extractor.d.ts +26 -0
- package/dist/lib/virtualized/directional-range-extractor.js +39 -0
- package/dist/lib/virtualized/index.d.ts +3 -0
- package/dist/lib/virtualized/index.js +35 -27
- package/dist/lib/virtualized/scroll-seek.d.ts +61 -0
- package/dist/lib/virtualized/scroll-seek.js +61 -0
- package/dist/lib/virtualized/usePaintedRangeVirtualizer.d.ts +19 -0
- package/dist/lib/virtualized/usePaintedRangeVirtualizer.js +30 -0
- package/dist/lib/virtualized/useResponsiveColumnCount.d.ts +35 -0
- package/dist/lib/virtualized/useResponsiveColumnCount.js +51 -0
- package/dist/lib/virtualized/useScrollSeekPaintedRange.d.ts +13 -0
- package/dist/lib/virtualized/useScrollSeekPaintedRange.js +45 -0
- package/dist/lib/virtualized/useVirtualizedList.d.ts +7 -0
- package/dist/lib/virtualized/useVirtualizedList.js +89 -87
- package/dist/lib/virtualized/useVirtualizedRows.d.ts +9 -2
- package/dist/lib/virtualized/useVirtualizedRows.js +15 -13
- package/dist/lib/virtualized/virtualized.types.d.ts +2 -0
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/dist/tailwind.config.js +3 -1
- package/dist/theme/tailwind-colors.js +2 -1
- package/package.json +39 -4
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Range } from '@tanstack/virtual-core';
|
|
2
|
+
export type VirtualScrollDirection = "forward" | "backward" | null;
|
|
3
|
+
export type DirectionalRangeExtractorOptions = {
|
|
4
|
+
/** Extra strips kept above and below the viewport so travel is already painted. */
|
|
5
|
+
travelExtra?: number;
|
|
6
|
+
/**
|
|
7
|
+
* How close the visible range may get to the sticky window edge before the
|
|
8
|
+
* window is remapped. Larger values mean more compositor-only scrolling
|
|
9
|
+
* (Google Sheets / Instagram) and fewer React remounts.
|
|
10
|
+
*/
|
|
11
|
+
hysteresis?: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Spreadsheet-style virtual window:
|
|
15
|
+
* 1. Keep extra rows above so scrolling up is already painted.
|
|
16
|
+
* 2. Hold a **sticky** index range (hysteresis) so pixel scrolling does not
|
|
17
|
+
* remount rows — the native scroller just slides over already-painted DOM.
|
|
18
|
+
* 3. Remap only when the visible range nears the sticky edge.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createDirectionalRangeExtractor(options?: number | DirectionalRangeExtractorOptions): (range: Range) => number[];
|
|
21
|
+
/**
|
|
22
|
+
* Sticky painted window for strip grids. `travelExtra` stays 0 so TanStack
|
|
23
|
+
* `overscan` remains the only buffer; hysteresis is below typical grid overscan
|
|
24
|
+
* (6–12) so the window actually sticks instead of remapping every scroll.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createStickyStripRangeExtractor(options?: DirectionalRangeExtractorOptions): (range: Range) => number[];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
function m(e = {}) {
|
|
2
|
+
return typeof e == "number" ? { travelExtra: e, hysteresis: 8 } : {
|
|
3
|
+
travelExtra: e.travelExtra ?? 8,
|
|
4
|
+
hysteresis: e.hysteresis ?? 8
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
function y(e, c) {
|
|
8
|
+
const s = [];
|
|
9
|
+
for (let t = e; t <= c; t += 1)
|
|
10
|
+
s.push(t);
|
|
11
|
+
return s;
|
|
12
|
+
}
|
|
13
|
+
function f(e = {}) {
|
|
14
|
+
const { travelExtra: c, hysteresis: s } = m(e);
|
|
15
|
+
let t = 0, r = -1, i = -1, a = -1, o = [];
|
|
16
|
+
return (n) => {
|
|
17
|
+
const d = Math.max(
|
|
18
|
+
0,
|
|
19
|
+
n.startIndex - n.overscan - c
|
|
20
|
+
), x = Math.min(
|
|
21
|
+
n.count - 1,
|
|
22
|
+
n.endIndex + n.overscan + c
|
|
23
|
+
), l = r < 0, u = n.startIndex - t, h = r - n.endIndex, v = t > 0 && u < s, E = r < n.count - 1 && h < s, I = r > n.count - 1;
|
|
24
|
+
return (l || v || E || I) && (t = d, r = x), t = Math.max(0, Math.min(t, n.count - 1)), r = Math.max(
|
|
25
|
+
t,
|
|
26
|
+
Math.min(r, n.count - 1)
|
|
27
|
+
), (t !== i || r !== a) && (i = t, a = r, o = y(t, r)), o;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function M(e = {}) {
|
|
31
|
+
return f({
|
|
32
|
+
travelExtra: e.travelExtra ?? 0,
|
|
33
|
+
hysteresis: e.hysteresis ?? 4
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
f as createDirectionalRangeExtractor,
|
|
38
|
+
M as createStickyStripRangeExtractor
|
|
39
|
+
};
|
|
@@ -6,6 +6,9 @@ export { useVirtualizedRows, type UseVirtualizedRowsOptions } from './useVirtual
|
|
|
6
6
|
export { useVirtualizedList, type UseVirtualizedListOptions, type UseVirtualizedListResult, } from './useVirtualizedList';
|
|
7
7
|
export { buildSectionedFlatList, type DataSectionBlock, type HeaderSectionBlock, type SectionBlock, type SectionedFlatList, type SectionedFlatRow, } from './sectioned';
|
|
8
8
|
export { useDebouncedValue } from './useDebouncedValue';
|
|
9
|
+
export { createDirectionalRangeExtractor, createStickyStripRangeExtractor, type DirectionalRangeExtractorOptions, type VirtualScrollDirection, } from './directional-range-extractor';
|
|
10
|
+
export { useScrollSeekPaintedRange } from './useScrollSeekPaintedRange';
|
|
11
|
+
export { getResponsiveColumnCount, useResponsiveColumnCount, type ResponsiveColumnCountInput, type UseResponsiveColumnCountOptions, } from './useResponsiveColumnCount';
|
|
9
12
|
export { useDataGridVirtualRows, type DataGridVirtualRowsResult, } from './useDataGrid';
|
|
10
13
|
export { VirtualizedListProvider, useVirtualizedListContext, type VirtualizedListContextValue, } from './virtualized-list-context';
|
|
11
14
|
export { getVisibleReadyRowIds } from './virtualized-list-utils';
|
|
@@ -1,35 +1,43 @@
|
|
|
1
|
-
import { getSelectionCountsFromState as
|
|
1
|
+
import { getSelectionCountsFromState as r } from "./selection-counts.js";
|
|
2
2
|
import { useDataSource as o } from "./useDataSource.js";
|
|
3
3
|
import { useRowState as s } from "./useRowState.js";
|
|
4
4
|
import { useVirtualizedRows as l } from "./useVirtualizedRows.js";
|
|
5
|
-
import { useVirtualizedList as
|
|
6
|
-
import { buildSectionedFlatList as
|
|
7
|
-
import { useDebouncedValue as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
5
|
+
import { useVirtualizedList as n } from "./useVirtualizedList.js";
|
|
6
|
+
import { buildSectionedFlatList as V } from "./sectioned.js";
|
|
7
|
+
import { useDebouncedValue as x } from "./useDebouncedValue.js";
|
|
8
|
+
import { createDirectionalRangeExtractor as L, createStickyStripRangeExtractor as c } from "./directional-range-extractor.js";
|
|
9
|
+
import { useScrollSeekPaintedRange as S } from "./useScrollSeekPaintedRange.js";
|
|
10
|
+
import { getResponsiveColumnCount as C, useResponsiveColumnCount as g } from "./useResponsiveColumnCount.js";
|
|
11
|
+
import { useDataGridVirtualRows as D } from "./useDataGrid.js";
|
|
12
|
+
import { VirtualizedListProvider as k, useVirtualizedListContext as v } from "./virtualized-list-context.js";
|
|
13
|
+
import { getVisibleReadyRowIds as I } from "./virtualized-list-utils.js";
|
|
14
|
+
import { VirtualizedList as y, VirtualizedListContent as A, VirtualizedListFooter as E, VirtualizedListHeader as H, VirtualizedListHeaderActions as P, VirtualizedListItem as G, VirtualizedListItemSkeleton as j, VirtualizedListSearch as q, VirtualizedListSelectAll as B, VirtualizedListShell as J, VirtualizedListViewport as K } from "./virtualized-list-parts.js";
|
|
12
15
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
y as VirtualizedList,
|
|
17
|
+
A as VirtualizedListContent,
|
|
18
|
+
E as VirtualizedListFooter,
|
|
19
|
+
H as VirtualizedListHeader,
|
|
20
|
+
P as VirtualizedListHeaderActions,
|
|
21
|
+
G as VirtualizedListItem,
|
|
22
|
+
j as VirtualizedListItemSkeleton,
|
|
23
|
+
k as VirtualizedListProvider,
|
|
24
|
+
q as VirtualizedListSearch,
|
|
25
|
+
B as VirtualizedListSelectAll,
|
|
26
|
+
J as VirtualizedListShell,
|
|
27
|
+
K as VirtualizedListViewport,
|
|
28
|
+
V as buildSectionedFlatList,
|
|
29
|
+
L as createDirectionalRangeExtractor,
|
|
30
|
+
c as createStickyStripRangeExtractor,
|
|
31
|
+
C as getResponsiveColumnCount,
|
|
32
|
+
r as getSelectionCountsFromState,
|
|
33
|
+
I as getVisibleReadyRowIds,
|
|
34
|
+
D as useDataGridVirtualRows,
|
|
29
35
|
o as useDataSource,
|
|
30
|
-
|
|
36
|
+
x as useDebouncedValue,
|
|
37
|
+
g as useResponsiveColumnCount,
|
|
31
38
|
s as useRowState,
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
S as useScrollSeekPaintedRange,
|
|
40
|
+
n as useVirtualizedList,
|
|
41
|
+
v as useVirtualizedListContext,
|
|
34
42
|
l as useVirtualizedRows
|
|
35
43
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type ScrollSeekSample = {
|
|
2
|
+
scrollOffset: number;
|
|
3
|
+
isScrolling: boolean;
|
|
4
|
+
/** Milliseconds timestamp. Defaults to `performance.now()`. */
|
|
5
|
+
nowMs?: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* react-virtuoso scroll-seek:
|
|
9
|
+
* a fast flick renders cheap placeholders instead of heavy cells, then the
|
|
10
|
+
* real cells paint once scrolling stops. Slow wheel ticks stay on real cells.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createScrollSeekTracker(): {
|
|
13
|
+
/** Exponential moving average, px/ms. Zero while the scroller is idle. */
|
|
14
|
+
readonly smoothedVelocityPxPerMs: number;
|
|
15
|
+
update(sample: ScrollSeekSample): boolean;
|
|
16
|
+
};
|
|
17
|
+
declare const OVERSCAN_REVEAL_STRIPS_PER_FRAME = 2;
|
|
18
|
+
export type StripWindow = {
|
|
19
|
+
scrollOffset: number | null;
|
|
20
|
+
isScrolling?: boolean;
|
|
21
|
+
scrollRect: {
|
|
22
|
+
height: number;
|
|
23
|
+
} | null;
|
|
24
|
+
getVirtualItems: () => ReadonlyArray<{
|
|
25
|
+
index: number;
|
|
26
|
+
start: number;
|
|
27
|
+
end: number;
|
|
28
|
+
}>;
|
|
29
|
+
getVirtualIndexes: () => number[];
|
|
30
|
+
};
|
|
31
|
+
export type PaintedRangeSeekController = {
|
|
32
|
+
scrollSeekRef: {
|
|
33
|
+
current: boolean;
|
|
34
|
+
};
|
|
35
|
+
warmedStripIndexesRef: {
|
|
36
|
+
current: Set<number>;
|
|
37
|
+
};
|
|
38
|
+
revealFrameRef: {
|
|
39
|
+
current: number;
|
|
40
|
+
};
|
|
41
|
+
scrollSeekTracker: ReturnType<typeof createScrollSeekTracker>;
|
|
42
|
+
scheduleOverscanReveal: (instance: StripWindow) => void;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Shared flick → placeholder → staged overscan warmup used by SKU strips and By Item.
|
|
46
|
+
* Returns true when seek state flips so the painted-range virtualizer can commit.
|
|
47
|
+
*/
|
|
48
|
+
export declare function syncPaintedRangeSeek(controller: PaintedRangeSeekController, instance: StripWindow): boolean;
|
|
49
|
+
/** Strips that intersect the viewport. Overscan stays out of the first card commit. */
|
|
50
|
+
export declare function visibleVirtualIndexes(instance: StripWindow): Set<number>;
|
|
51
|
+
export declare function mergeWarmedStripIndexes(options: {
|
|
52
|
+
previous: ReadonlySet<number>;
|
|
53
|
+
visible: ReadonlySet<number>;
|
|
54
|
+
virtualIndexes: readonly number[];
|
|
55
|
+
}): Set<number>;
|
|
56
|
+
export declare function nextOverscanStripIndexes(options: {
|
|
57
|
+
warmed: ReadonlySet<number>;
|
|
58
|
+
virtualIndexes: readonly number[];
|
|
59
|
+
limit: number;
|
|
60
|
+
}): number[];
|
|
61
|
+
export { OVERSCAN_REVEAL_STRIPS_PER_FRAME };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
function l() {
|
|
2
|
+
let e = 0, t = -1, r = !1, s = 0;
|
|
3
|
+
return {
|
|
4
|
+
/** Exponential moving average, px/ms. Zero while the scroller is idle. */
|
|
5
|
+
get smoothedVelocityPxPerMs() {
|
|
6
|
+
return s;
|
|
7
|
+
},
|
|
8
|
+
update(n) {
|
|
9
|
+
const i = n.nowMs ?? performance.now(), a = Math.abs(n.scrollOffset - e), f = t < 0 ? 0 : i - t, d = f > 0 && f < 100 ? a / f : 0;
|
|
10
|
+
return f > 0 && f < 100 && (s = s * 0.65 + d * 0.35), e = n.scrollOffset, t = i, n.isScrolling ? f === 0 || f > 100 ? a >= 180 && (r = !0) : (a >= 180 || d >= 2.5) && (r = !0) : (r = !1, s = 0), r;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
const o = 2;
|
|
15
|
+
function _(e, t) {
|
|
16
|
+
const r = e.scrollSeekTracker.update({
|
|
17
|
+
scrollOffset: t.scrollOffset ?? 0,
|
|
18
|
+
isScrolling: t.isScrolling ?? !1
|
|
19
|
+
}), s = e.scrollSeekRef.current;
|
|
20
|
+
r ? (e.revealFrameRef.current && cancelAnimationFrame(e.revealFrameRef.current), e.revealFrameRef.current = 0) : s ? (e.warmedStripIndexesRef.current = c(t), e.scheduleOverscanReveal(t)) : e.warmedStripIndexesRef.current.size === 0 ? e.warmedStripIndexesRef.current = new Set(t.getVirtualIndexes()) : (e.warmedStripIndexesRef.current = u({
|
|
21
|
+
previous: e.warmedStripIndexesRef.current,
|
|
22
|
+
visible: c(t),
|
|
23
|
+
virtualIndexes: t.getVirtualIndexes()
|
|
24
|
+
}), S({
|
|
25
|
+
warmed: e.warmedStripIndexesRef.current,
|
|
26
|
+
virtualIndexes: t.getVirtualIndexes(),
|
|
27
|
+
limit: 1
|
|
28
|
+
}).length > 0 && e.scheduleOverscanReveal(t));
|
|
29
|
+
const n = r !== s;
|
|
30
|
+
return e.scrollSeekRef.current = r, n;
|
|
31
|
+
}
|
|
32
|
+
function c(e) {
|
|
33
|
+
const t = e.scrollRect?.height ?? 0;
|
|
34
|
+
if (t <= 0) return new Set(e.getVirtualIndexes());
|
|
35
|
+
const r = e.scrollOffset ?? 0, s = r + t, n = /* @__PURE__ */ new Set();
|
|
36
|
+
for (const i of e.getVirtualItems())
|
|
37
|
+
i.start < s && i.end > r && n.add(i.index);
|
|
38
|
+
return n;
|
|
39
|
+
}
|
|
40
|
+
function u(e) {
|
|
41
|
+
const t = new Set(e.virtualIndexes), r = /* @__PURE__ */ new Set();
|
|
42
|
+
for (const s of e.previous)
|
|
43
|
+
t.has(s) && r.add(s);
|
|
44
|
+
for (const s of e.visible) r.add(s);
|
|
45
|
+
return r;
|
|
46
|
+
}
|
|
47
|
+
function S(e) {
|
|
48
|
+
const t = [];
|
|
49
|
+
for (const r of e.virtualIndexes)
|
|
50
|
+
if (!e.warmed.has(r) && (t.push(r), t.length >= e.limit))
|
|
51
|
+
break;
|
|
52
|
+
return t;
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
o as OVERSCAN_REVEAL_STRIPS_PER_FRAME,
|
|
56
|
+
l as createScrollSeekTracker,
|
|
57
|
+
u as mergeWarmedStripIndexes,
|
|
58
|
+
S as nextOverscanStripIndexes,
|
|
59
|
+
_ as syncPaintedRangeSeek,
|
|
60
|
+
c as visibleVirtualIndexes
|
|
61
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Virtualizer } from '@tanstack/virtual-core';
|
|
2
|
+
import { ReactVirtualizerOptions } from '@tanstack/react-virtual';
|
|
3
|
+
export type PaintedRangeVirtualizerOptions<TScrollElement extends Element, TItemElement extends Element> = Omit<ReactVirtualizerOptions<TScrollElement, TItemElement>, "observeElementRect" | "observeElementOffset" | "scrollToFn"> & Partial<Pick<ReactVirtualizerOptions<TScrollElement, TItemElement>, "observeElementRect" | "observeElementOffset" | "scrollToFn">> & {
|
|
4
|
+
/**
|
|
5
|
+
* When true, React commits when the painted index window changes.
|
|
6
|
+
* Pixel scrolling inside that window stays on the compositor.
|
|
7
|
+
*/
|
|
8
|
+
rerenderWhenPaintedRangeChanges?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Runs before the React commit. Return true to commit even when the
|
|
11
|
+
* index window is unchanged (scroll-seek placeholders).
|
|
12
|
+
*/
|
|
13
|
+
onBeforeRender?: (instance: Virtualizer<TScrollElement, TItemElement>) => boolean | void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* TanStack Virtual adapter that can skip React commits while a sticky
|
|
17
|
+
* range-extractor window is unchanged.
|
|
18
|
+
*/
|
|
19
|
+
export declare function usePaintedRangeVirtualizer<TScrollElement extends Element, TItemElement extends Element>(options: PaintedRangeVirtualizerOptions<TScrollElement, TItemElement>): Virtualizer<TScrollElement, TItemElement>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { elementScroll as p, observeElementOffset as R, observeElementRect as h, Virtualizer as v } from "@tanstack/virtual-core";
|
|
2
|
+
import { useReducer as E, useRef as S, useState as b, useLayoutEffect as f } from "react";
|
|
3
|
+
import { flushSync as O } from "react-dom";
|
|
4
|
+
function $(t) {
|
|
5
|
+
const e = t.getVirtualIndexes();
|
|
6
|
+
return e.length === 0 ? `empty:${t.options.count}` : `${e[0]}:${e[e.length - 1]}:${e.length}:${t.options.count}`;
|
|
7
|
+
}
|
|
8
|
+
function z(t) {
|
|
9
|
+
const {
|
|
10
|
+
useFlushSync: e = !0,
|
|
11
|
+
rerenderWhenPaintedRangeChanges: a = !1,
|
|
12
|
+
onBeforeRender: g,
|
|
13
|
+
...n
|
|
14
|
+
} = t, s = E(() => ({}), {})[1], u = S(""), l = {
|
|
15
|
+
...n,
|
|
16
|
+
observeElementRect: n.observeElementRect ?? h,
|
|
17
|
+
observeElementOffset: n.observeElementOffset ?? R,
|
|
18
|
+
scrollToFn: n.scrollToFn ?? p,
|
|
19
|
+
onChange: (o, i) => {
|
|
20
|
+
const m = g?.(o) === !0, c = $(o), d = c !== u.current;
|
|
21
|
+
d && (u.current = c), (!a || d || m) && (e && i ? O(s) : s()), n.onChange?.(o, i);
|
|
22
|
+
}
|
|
23
|
+
}, [r] = b(
|
|
24
|
+
() => new v(l)
|
|
25
|
+
);
|
|
26
|
+
return r.setOptions(l), f(() => r._didMount(), [r]), f(() => r._willUpdate()), r;
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
z as usePaintedRangeVirtualizer
|
|
30
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export type ResponsiveColumnCountInput = {
|
|
3
|
+
containerWidth: number;
|
|
4
|
+
minimumColumnWidth: number;
|
|
5
|
+
columnGap?: number;
|
|
6
|
+
maximumColumnCount?: number;
|
|
7
|
+
minimumColumnCount?: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* How many equal columns fit in `containerWidth` given a minimum card width and gutter.
|
|
11
|
+
*
|
|
12
|
+
* `floor((width + gap) / (minimumColumnWidth + gap))` — the extra gap term lets the last
|
|
13
|
+
* column sit flush without requiring a trailing gutter.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getResponsiveColumnCount(input: ResponsiveColumnCountInput): number;
|
|
16
|
+
export type UseResponsiveColumnCountOptions = {
|
|
17
|
+
containerRef: RefObject<Element | null>;
|
|
18
|
+
minimumColumnWidth: number;
|
|
19
|
+
columnGap?: number;
|
|
20
|
+
maximumColumnCount?: number;
|
|
21
|
+
minimumColumnCount?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Changes when the measured element may be replaced, for example a view
|
|
24
|
+
* toggle that unmounts the scroller. A detached element reports width 0;
|
|
25
|
+
* that reading is ignored so the last real column count stays in place
|
|
26
|
+
* until the new element is measured.
|
|
27
|
+
*/
|
|
28
|
+
observationKey?: string | number | boolean;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Measures `containerRef` with ResizeObserver and returns how many columns currently fit.
|
|
32
|
+
* Pair with {@link useVirtualizedList} by virtualizing **strips**:
|
|
33
|
+
* `rowCount = ceil(itemCount / columnCount)`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useResponsiveColumnCount(options: UseResponsiveColumnCountOptions): number;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useState as l, useLayoutEffect as a } from "react";
|
|
2
|
+
function C(m) {
|
|
3
|
+
const o = Math.max(0, m.columnGap ?? 0), n = Math.max(1, Math.floor(m.minimumColumnCount ?? 1)), u = m.maximumColumnCount === void 0 ? Number.POSITIVE_INFINITY : Math.max(n, Math.floor(m.maximumColumnCount));
|
|
4
|
+
if (m.containerWidth <= 0 || m.minimumColumnWidth <= 0)
|
|
5
|
+
return n;
|
|
6
|
+
const t = Math.floor(
|
|
7
|
+
(m.containerWidth + o) / (m.minimumColumnWidth + o)
|
|
8
|
+
);
|
|
9
|
+
return Math.min(u, Math.max(n, t));
|
|
10
|
+
}
|
|
11
|
+
function c(m) {
|
|
12
|
+
const [o, n] = l(
|
|
13
|
+
() => C({
|
|
14
|
+
containerWidth: m.containerRef.current?.clientWidth ?? 0,
|
|
15
|
+
minimumColumnWidth: m.minimumColumnWidth,
|
|
16
|
+
columnGap: m.columnGap,
|
|
17
|
+
maximumColumnCount: m.maximumColumnCount,
|
|
18
|
+
minimumColumnCount: m.minimumColumnCount
|
|
19
|
+
})
|
|
20
|
+
);
|
|
21
|
+
return a(() => {
|
|
22
|
+
const u = m.containerRef.current;
|
|
23
|
+
if (!u) return;
|
|
24
|
+
const t = () => {
|
|
25
|
+
const i = u.clientWidth;
|
|
26
|
+
i <= 0 || n(
|
|
27
|
+
C({
|
|
28
|
+
containerWidth: i,
|
|
29
|
+
minimumColumnWidth: m.minimumColumnWidth,
|
|
30
|
+
columnGap: m.columnGap,
|
|
31
|
+
maximumColumnCount: m.maximumColumnCount,
|
|
32
|
+
minimumColumnCount: m.minimumColumnCount
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
t();
|
|
37
|
+
const e = new ResizeObserver(t);
|
|
38
|
+
return e.observe(u), () => e.disconnect();
|
|
39
|
+
}, [
|
|
40
|
+
m.containerRef,
|
|
41
|
+
m.minimumColumnWidth,
|
|
42
|
+
m.columnGap,
|
|
43
|
+
m.maximumColumnCount,
|
|
44
|
+
m.minimumColumnCount,
|
|
45
|
+
m.observationKey
|
|
46
|
+
]), o;
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
C as getResponsiveColumnCount,
|
|
50
|
+
c as useResponsiveColumnCount
|
|
51
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StripWindow } from './scroll-seek';
|
|
2
|
+
/**
|
|
3
|
+
* Owns flick placeholders and staged overscan warmup for a painted-range virtualizer.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useScrollSeekPaintedRange(): {
|
|
6
|
+
scrollSeekRef: import('react').RefObject<boolean>;
|
|
7
|
+
warmedStripIndexesRef: import('react').RefObject<Set<number>>;
|
|
8
|
+
scrollSeekTracker: {
|
|
9
|
+
readonly smoothedVelocityPxPerMs: number;
|
|
10
|
+
update(sample: import('./scroll-seek').ScrollSeekSample): boolean;
|
|
11
|
+
};
|
|
12
|
+
applyPaintedRangeSeek: (instance: StripWindow) => boolean;
|
|
13
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useRef as s, useMemo as d, useState as R, useCallback as m, useEffect as k } from "react";
|
|
2
|
+
import { createScrollSeekTracker as p, syncPaintedRangeSeek as x, nextOverscanStripIndexes as v, OVERSCAN_REVEAL_STRIPS_PER_FRAME as A } from "./scroll-seek.js";
|
|
3
|
+
function I() {
|
|
4
|
+
const n = s(!1), r = s(/* @__PURE__ */ new Set()), e = s(0), t = d(() => p(), []), [, f] = R(0), o = m((c) => {
|
|
5
|
+
e.current && cancelAnimationFrame(e.current);
|
|
6
|
+
const u = () => {
|
|
7
|
+
if (e.current = 0, n.current) return;
|
|
8
|
+
const i = v({
|
|
9
|
+
warmed: r.current,
|
|
10
|
+
virtualIndexes: c.getVirtualIndexes(),
|
|
11
|
+
limit: A
|
|
12
|
+
});
|
|
13
|
+
if (i.length === 0) return;
|
|
14
|
+
const l = new Set(r.current);
|
|
15
|
+
for (const a of i) l.add(a);
|
|
16
|
+
r.current = l, f((a) => a + 1), e.current = requestAnimationFrame(u);
|
|
17
|
+
};
|
|
18
|
+
e.current = requestAnimationFrame(u);
|
|
19
|
+
}, []);
|
|
20
|
+
k(() => () => {
|
|
21
|
+
e.current && cancelAnimationFrame(e.current);
|
|
22
|
+
}, []);
|
|
23
|
+
const S = m(
|
|
24
|
+
(c) => x(
|
|
25
|
+
{
|
|
26
|
+
scrollSeekRef: n,
|
|
27
|
+
warmedStripIndexesRef: r,
|
|
28
|
+
revealFrameRef: e,
|
|
29
|
+
scrollSeekTracker: t,
|
|
30
|
+
scheduleOverscanReveal: o
|
|
31
|
+
},
|
|
32
|
+
c
|
|
33
|
+
),
|
|
34
|
+
[o, t]
|
|
35
|
+
);
|
|
36
|
+
return {
|
|
37
|
+
scrollSeekRef: n,
|
|
38
|
+
warmedStripIndexesRef: r,
|
|
39
|
+
scrollSeekTracker: t,
|
|
40
|
+
applyPaintedRangeSeek: S
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
I as useScrollSeekPaintedRange
|
|
45
|
+
};
|
|
@@ -14,6 +14,13 @@ export type UseVirtualizedListOptions<TData, TScrollElement extends Element = HT
|
|
|
14
14
|
onEndReached?: () => void;
|
|
15
15
|
/** When false, `onEndReached` is not invoked (e.g. no further pages). */
|
|
16
16
|
hasMore?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* When true, React only commits when the painted index window changes.
|
|
19
|
+
* Pixel scrolling stays on the compositor until the sticky window remaps.
|
|
20
|
+
*/
|
|
21
|
+
rerenderWhenPaintedRangeChanges?: boolean;
|
|
22
|
+
/** Runs before the React commit. Return true to commit anyway. */
|
|
23
|
+
onBeforeRender?: (instance: Virtualizer<TScrollElement, TItemElement>) => boolean | void;
|
|
17
24
|
} & Omit<Partial<ReactVirtualizerOptions<TScrollElement, TItemElement>>, "count" | "getScrollElement" | "estimateSize" | "overscan" | "getItemKey" | "onChange"> & {
|
|
18
25
|
/** Merged with the internal handler that powers `onEndReached`. */
|
|
19
26
|
onChange?: ReactVirtualizerOptions<TScrollElement, TItemElement>["onChange"];
|