vlist 1.9.1 → 2.0.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.
Files changed (108) hide show
  1. package/README.github.md +104 -97
  2. package/README.md +46 -33
  3. package/dist/constants.d.ts +11 -6
  4. package/dist/core/create.d.ts +10 -0
  5. package/dist/core/dom.d.ts +8 -0
  6. package/dist/core/hooks.d.ts +16 -0
  7. package/dist/core/index.d.ts +17 -0
  8. package/dist/core/pipeline.d.ts +51 -0
  9. package/dist/core/pool.d.ts +9 -0
  10. package/dist/core/scroll.d.ts +32 -0
  11. package/dist/core/sizes.d.ts +8 -0
  12. package/dist/core/state.d.ts +47 -0
  13. package/dist/core/types.d.ts +187 -0
  14. package/dist/{builder → core}/velocity.d.ts +1 -1
  15. package/dist/index.d.ts +28 -19
  16. package/dist/index.js +1 -1
  17. package/dist/internals.d.ts +11 -7
  18. package/dist/internals.js +1 -1
  19. package/dist/plugins/a11y/index.d.ts +2 -0
  20. package/dist/plugins/a11y/plugin.d.ts +13 -0
  21. package/dist/{features → plugins}/async/index.d.ts +1 -1
  22. package/dist/{features → plugins}/async/manager.d.ts +5 -1
  23. package/dist/plugins/async/plugin.d.ts +48 -0
  24. package/dist/plugins/autosize/index.d.ts +5 -0
  25. package/dist/plugins/autosize/plugin.d.ts +19 -0
  26. package/dist/plugins/grid/index.d.ts +7 -0
  27. package/dist/plugins/grid/plugin.d.ts +23 -0
  28. package/dist/{features → plugins}/groups/index.d.ts +1 -1
  29. package/dist/plugins/groups/plugin.d.ts +22 -0
  30. package/dist/plugins/masonry/index.d.ts +8 -0
  31. package/dist/plugins/masonry/plugin.d.ts +32 -0
  32. package/dist/plugins/page/index.d.ts +5 -0
  33. package/dist/plugins/page/plugin.d.ts +21 -0
  34. package/dist/plugins/scale/index.d.ts +5 -0
  35. package/dist/plugins/scale/plugin.d.ts +24 -0
  36. package/dist/plugins/scrollbar/index.d.ts +7 -0
  37. package/dist/plugins/scrollbar/plugin.d.ts +20 -0
  38. package/dist/plugins/selection/index.d.ts +6 -0
  39. package/dist/plugins/selection/plugin.d.ts +16 -0
  40. package/dist/{features → plugins}/selection/state.d.ts +8 -0
  41. package/dist/plugins/snapshots/index.d.ts +5 -0
  42. package/dist/plugins/snapshots/plugin.d.ts +17 -0
  43. package/dist/plugins/sortable/index.d.ts +6 -0
  44. package/dist/plugins/sortable/plugin.d.ts +34 -0
  45. package/dist/{features → plugins}/table/index.d.ts +1 -1
  46. package/dist/plugins/table/plugin.d.ts +20 -0
  47. package/dist/plugins/transition/index.d.ts +5 -0
  48. package/dist/plugins/transition/plugin.d.ts +22 -0
  49. package/dist/size.json +1 -1
  50. package/dist/utils/padding.d.ts +2 -4
  51. package/dist/vlist-grid.css +1 -1
  52. package/dist/vlist-masonry.css +1 -1
  53. package/dist/vlist-table.css +1 -1
  54. package/dist/vlist.css +1 -1
  55. package/package.json +9 -4
  56. package/dist/builder/a11y.d.ts +0 -16
  57. package/dist/builder/api.d.ts +0 -21
  58. package/dist/builder/context.d.ts +0 -36
  59. package/dist/builder/core.d.ts +0 -16
  60. package/dist/builder/data.d.ts +0 -71
  61. package/dist/builder/dom.d.ts +0 -15
  62. package/dist/builder/index.d.ts +0 -25
  63. package/dist/builder/materialize.d.ts +0 -166
  64. package/dist/builder/pool.d.ts +0 -10
  65. package/dist/builder/range.d.ts +0 -10
  66. package/dist/builder/scroll.d.ts +0 -24
  67. package/dist/builder/types.d.ts +0 -512
  68. package/dist/features/async/feature.d.ts +0 -72
  69. package/dist/features/autosize/feature.d.ts +0 -34
  70. package/dist/features/autosize/index.d.ts +0 -2
  71. package/dist/features/grid/feature.d.ts +0 -48
  72. package/dist/features/grid/index.d.ts +0 -9
  73. package/dist/features/groups/feature.d.ts +0 -75
  74. package/dist/features/masonry/feature.d.ts +0 -45
  75. package/dist/features/masonry/index.d.ts +0 -9
  76. package/dist/features/page/feature.d.ts +0 -109
  77. package/dist/features/page/index.d.ts +0 -9
  78. package/dist/features/scale/feature.d.ts +0 -42
  79. package/dist/features/scale/index.d.ts +0 -10
  80. package/dist/features/scrollbar/feature.d.ts +0 -81
  81. package/dist/features/scrollbar/index.d.ts +0 -8
  82. package/dist/features/selection/feature.d.ts +0 -91
  83. package/dist/features/selection/index.d.ts +0 -7
  84. package/dist/features/snapshots/feature.d.ts +0 -79
  85. package/dist/features/snapshots/index.d.ts +0 -9
  86. package/dist/features/sortable/feature.d.ts +0 -101
  87. package/dist/features/sortable/index.d.ts +0 -6
  88. package/dist/features/table/feature.d.ts +0 -67
  89. package/dist/features/transition/feature.d.ts +0 -30
  90. package/dist/features/transition/index.d.ts +0 -9
  91. /package/dist/{features → plugins}/async/placeholder.d.ts +0 -0
  92. /package/dist/{features → plugins}/async/sparse.d.ts +0 -0
  93. /package/dist/{features → plugins}/grid/layout.d.ts +0 -0
  94. /package/dist/{features → plugins}/grid/renderer.d.ts +0 -0
  95. /package/dist/{features → plugins}/grid/types.d.ts +0 -0
  96. /package/dist/{features → plugins}/groups/async-bridge.d.ts +0 -0
  97. /package/dist/{features → plugins}/groups/layout.d.ts +0 -0
  98. /package/dist/{features → plugins}/groups/sticky.d.ts +0 -0
  99. /package/dist/{features → plugins}/groups/types.d.ts +0 -0
  100. /package/dist/{features → plugins}/masonry/layout.d.ts +0 -0
  101. /package/dist/{features → plugins}/masonry/renderer.d.ts +0 -0
  102. /package/dist/{features → plugins}/masonry/types.d.ts +0 -0
  103. /package/dist/{features → plugins}/scrollbar/controller.d.ts +0 -0
  104. /package/dist/{features → plugins}/scrollbar/scrollbar.d.ts +0 -0
  105. /package/dist/{features → plugins}/table/header.d.ts +0 -0
  106. /package/dist/{features → plugins}/table/layout.d.ts +0 -0
  107. /package/dist/{features → plugins}/table/renderer.d.ts +0 -0
  108. /package/dist/{features → plugins}/table/types.d.ts +0 -0
@@ -0,0 +1,7 @@
1
+ /**
2
+ * vlist v2 — Scrollbar Plugin
3
+ */
4
+ export { scrollbar, type ScrollbarPluginConfig } from "./plugin";
5
+ export { createScrollbar, type Scrollbar, type ScrollbarConfig, type ScrollCallback, } from "./scrollbar";
6
+ export { createScrollController, rafThrottle, isAtBottom, isAtTop, getScrollPercentage, isRangeVisible, type ScrollController, } from "./controller";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * vlist v2 — Scrollbar Plugin
3
+ *
4
+ * Replaces the native scrollbar with a custom, cross-browser consistent scrollbar.
5
+ * Priority 15 — runs after layout plugins (10) but before selection (50).
6
+ *
7
+ * Uses the v1 scrollbar UI component directly — it's standalone DOM/events code
8
+ * with no framework dependencies. This plugin wires it into the v2 lifecycle:
9
+ * - onAfterScroll hook → update thumb position
10
+ * - onResize hook → update thumb/track bounds
11
+ * - destroy → cleanup
12
+ */
13
+ import type { VListItem } from "../../types";
14
+ import type { VListPlugin } from "../../core/types";
15
+ import { type ScrollbarConfig } from "./scrollbar";
16
+ export interface ScrollbarPluginConfig extends ScrollbarConfig {
17
+ gutter?: boolean;
18
+ }
19
+ export declare function scrollbar<T extends VListItem = VListItem>(config?: ScrollbarPluginConfig): VListPlugin<T>;
20
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * vlist v2 — Selection Plugin
3
+ */
4
+ export { selection, type SelectionPluginConfig } from "./plugin";
5
+ export { createSelectionState, selectOne, toggleOne, selectRange, selectRangeMut, selectAllItems, moveFocus, getSelectedArray, getSelectedItems, getSelectedItemsMut, type SelectionState, selectItems, deselectItems, toggleSelection, selectAll, clearSelection, isSelected, getSelectedIds, getSelectionCount, isSelectionEmpty, selectFocused, moveFocusUp, moveFocusDown, moveFocusToFirst, moveFocusToLast, moveFocusByPage, claimPlaceholderSelection, setFocusedIndex, } from "./state";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * vlist v2 — Selection Plugin
3
+ *
4
+ * Manages selection state, click/keyboard handlers, ARIA attributes.
5
+ * Adapted from v1 withSelection feature + a11y.ts to the v2 plugin interface.
6
+ */
7
+ import type { VListItem, SelectionMode } from "../../types";
8
+ import type { VListPlugin } from "../../core/types";
9
+ export interface SelectionPluginConfig {
10
+ mode?: SelectionMode;
11
+ initial?: Array<string | number>;
12
+ followFocus?: boolean;
13
+ focusOnClick?: boolean;
14
+ }
15
+ export declare function selection<T extends VListItem = VListItem>(config?: SelectionPluginConfig): VListPlugin<T>;
16
+ //# sourceMappingURL=plugin.d.ts.map
@@ -112,4 +112,12 @@ export declare const selectFocused: <T extends VListItem>(state: SelectionState,
112
112
  * Pure function - returns new state
113
113
  */
114
114
  export declare const selectRange: <T extends VListItem>(state: SelectionState, items: T[], fromIndex: number, toIndex: number, mode: SelectionMode) => SelectionState;
115
+ export declare function selectOne(selected: Set<string | number>, id: string | number, mode: SelectionMode): void;
116
+ export declare function toggleOne(selected: Set<string | number>, id: string | number, mode: SelectionMode): void;
117
+ export declare function selectAllItems<T extends VListItem>(selected: Set<string | number>, items: readonly T[]): void;
118
+ export declare function selectRangeMut<T extends VListItem>(selected: Set<string | number>, items: readonly T[], fromIndex: number, toIndex: number): void;
119
+ export declare function moveFocus(state: SelectionState, delta: number, totalItems: number, reverse?: boolean): void;
120
+ export declare function getSelectedArray(selected: Set<string | number>): Array<string | number>;
121
+ export { getSelectedItems as getSelectedItemsImmutable };
122
+ export declare function getSelectedItemsMut<T extends VListItem>(selected: Set<string | number>, items: readonly T[]): T[];
115
123
  //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * vlist/snapshots - Scroll Save/Restore
3
+ */
4
+ export { snapshots, type SnapshotsPluginConfig } from "./plugin";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * vlist v2 — Snapshots Plugin
3
+ *
4
+ * Scroll save/restore for SPA navigation and tab switching.
5
+ * Captures the first visible item index + sub-pixel offset,
6
+ * surviving list recreation and compression mode changes.
7
+ *
8
+ * Priority: 50 (runs late — needs other plugins initialized)
9
+ */
10
+ import type { VListItem, ScrollSnapshot } from "../../types";
11
+ import type { VListPlugin } from "../../core/types";
12
+ export interface SnapshotsPluginConfig {
13
+ restore?: ScrollSnapshot;
14
+ autoSave?: string;
15
+ }
16
+ export declare function snapshots<T extends VListItem = VListItem>(config?: SnapshotsPluginConfig): VListPlugin<T>;
17
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * vlist - Sortable Domain
3
+ * Drag-and-drop reordering for virtual lists
4
+ */
5
+ export { sortable, type SortablePluginConfig } from "./plugin";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,34 @@
1
+ /**
2
+ * vlist v2 — Sortable Plugin
3
+ *
4
+ * Drag-and-drop reordering for virtual lists.
5
+ * Priority 30 — runs after layout plugins and scrollbar, before selection.
6
+ *
7
+ * Features:
8
+ * - Pointer drag-and-drop with ghost element
9
+ * - Keyboard reordering (Space to grab, arrows to move, Space to drop, Escape to cancel)
10
+ * - Items shift via CSS transforms during drag
11
+ * - Auto-scroll when dragging near viewport edges
12
+ * - ARIA attributes and live region announcements
13
+ * - Emits sort:start, sort:end, sort:cancel events
14
+ *
15
+ * The plugin is purely visual during drag — it does NOT reorder data.
16
+ * On drop, it emits `sort:end` with `{ fromIndex, toIndex }`.
17
+ * The consumer reorders their data and calls `setItems()`.
18
+ *
19
+ * Restrictions:
20
+ * - Cannot be combined with grid, masonry, table, or scale plugins
21
+ */
22
+ import type { VListItem } from "../../types";
23
+ import type { VListPlugin } from "../../core/types";
24
+ export interface SortablePluginConfig {
25
+ handle?: string;
26
+ ghostClass?: string;
27
+ shiftDuration?: number;
28
+ edgeScrollZone?: number;
29
+ edgeScrollSpeed?: number;
30
+ dragThreshold?: number;
31
+ ghostContainer?: HTMLElement;
32
+ }
33
+ export declare function sortable<T extends VListItem = VListItem>(config?: SortablePluginConfig): VListPlugin<T>;
34
+ //# sourceMappingURL=plugin.d.ts.map
@@ -2,7 +2,7 @@
2
2
  * vlist - Table Domain
3
3
  * Data table layout with columns, resizable headers, and cell rendering
4
4
  */
5
- export { withTable, type TableFeatureConfig } from "./feature";
5
+ export { table, type TablePluginConfig } from "./plugin";
6
6
  export { createTableLayout } from "./layout";
7
7
  export { createTableHeader } from "./header";
8
8
  export { createTableRenderer, type TableRendererInstance } from "./renderer";
@@ -0,0 +1,20 @@
1
+ /**
2
+ * vlist v2 — Table Plugin
3
+ *
4
+ * Switches from list layout to a data table with columns, resizable headers,
5
+ * sticky header row, and cell-based rendering.
6
+ *
7
+ * Priority 10 — runs before selection (50) so layout is ready.
8
+ *
9
+ * Restrictions:
10
+ * - Cannot be combined with grid or masonry plugins
11
+ * - Cannot be combined with horizontal orientation
12
+ * - Cannot be combined with reverse mode
13
+ */
14
+ import type { VListItem } from "../../types";
15
+ import type { VListPlugin } from "../../core/types";
16
+ import type { TableConfig } from "./types";
17
+ export interface TablePluginConfig<T extends VListItem = VListItem> extends TableConfig<T> {
18
+ }
19
+ export declare function table<T extends VListItem = VListItem>(config: TablePluginConfig<T>): VListPlugin<T>;
20
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1,5 @@
1
+ /**
2
+ * vlist/transition — FLIP-based enter/exit animations
3
+ */
4
+ export { transition, type TransitionPluginConfig, type TransitionTiming } from "./plugin";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * vlist v2 — Transition Plugin
3
+ *
4
+ * FLIP-based enter/exit animations for insertItem and removeItem.
5
+ * Without this plugin, insert/remove are instantaneous.
6
+ *
7
+ * Priority: 45 (before selection, after most layout plugins)
8
+ */
9
+ import type { VListItem } from "../../types";
10
+ import type { VListPlugin } from "../../core/types";
11
+ export interface TransitionTiming {
12
+ duration?: number;
13
+ easing?: string;
14
+ }
15
+ export interface TransitionPluginConfig {
16
+ duration?: number;
17
+ easing?: string;
18
+ insert?: TransitionTiming | false;
19
+ remove?: TransitionTiming | false;
20
+ }
21
+ export declare function transition<T extends VListItem = VListItem>(config?: TransitionPluginConfig): VListPlugin<T>;
22
+ //# sourceMappingURL=plugin.d.ts.map
package/dist/size.json CHANGED
@@ -1 +1 @@
1
- {"base":{"minified":"29.9","gzipped":"11.3","minBytes":30593,"gzBytes":11560},"withGrid":{"minified":"42.6","gzipped":"15.4","minBytes":43664,"gzBytes":15748},"withMasonry":{"minified":"40.0","gzipped":"14.8","minBytes":40966,"gzBytes":15126},"withGroups":{"minified":"45.0","gzipped":"16.0","minBytes":46049,"gzBytes":16380},"withAsync":{"minified":"42.8","gzipped":"15.9","minBytes":43778,"gzBytes":16270},"withSelection":{"minified":"40.2","gzipped":"14.1","minBytes":41139,"gzBytes":14484},"withScale":{"minified":"42.2","gzipped":"14.9","minBytes":43190,"gzBytes":15284},"withScrollbar":{"minified":"36.1","gzipped":"13.1","minBytes":36957,"gzBytes":13447},"withPage":{"minified":"32.0","gzipped":"12.0","minBytes":32717,"gzBytes":12274},"withSnapshots":{"minified":"33.6","gzipped":"12.5","minBytes":34430,"gzBytes":12811},"withTable":{"minified":"48.6","gzipped":"17.1","minBytes":49802,"gzBytes":17530},"withSortable":{"minified":"39.0","gzipped":"14.2","minBytes":39976,"gzBytes":14528},"withAutoSize":{"minified":"32.4","gzipped":"12.2","minBytes":33192,"gzBytes":12447},"withTransition":{"minified":"37.3","gzipped":"13.4","minBytes":38184,"gzBytes":13722}}
1
+ {"base":{"minified":"21.5","gzipped":"7.8","minBytes":22029,"gzBytes":7991},"a11y":{"minified":"24.5","gzipped":"8.9","minBytes":25124,"gzBytes":9125},"selection":{"minified":"29.8","gzipped":"10.2","minBytes":30498,"gzBytes":10467},"data":{"minified":"34.3","gzipped":"12.5","minBytes":35172,"gzBytes":12764},"scrollbar":{"minified":"28.7","gzipped":"9.8","minBytes":29341,"gzBytes":10061},"sortable":{"minified":"30.9","gzipped":"10.7","minBytes":31632,"gzBytes":10979},"groups":{"minified":"32.8","gzipped":"11.5","minBytes":33587,"gzBytes":11806},"scale":{"minified":"34.7","gzipped":"11.7","minBytes":35515,"gzBytes":11963},"page":{"minified":"23.9","gzipped":"8.6","minBytes":24507,"gzBytes":8767},"snapshots":{"minified":"25.1","gzipped":"9.1","minBytes":25737,"gzBytes":9297},"transition":{"minified":"28.2","gzipped":"9.6","minBytes":28912,"gzBytes":9870},"autosize":{"minified":"23.4","gzipped":"8.5","minBytes":23920,"gzBytes":8688},"grid":{"minified":"27.5","gzipped":"9.9","minBytes":28162,"gzBytes":10133},"table":{"minified":"39.7","gzipped":"13.6","minBytes":40615,"gzBytes":13922},"masonry":{"minified":"31.2","gzipped":"11.4","minBytes":31980,"gzBytes":11626}}
@@ -1,12 +1,10 @@
1
1
  /**
2
2
  * vlist/utils — Padding Resolution
3
3
  * Shared helpers for resolving the CSS-shorthand padding config into
4
- * concrete pixel values. Used by core (to apply CSS) and by features
4
+ * concrete pixel values. Used by core (to apply CSS) and by plugins
5
5
  * (to subtract cross-axis padding from container dimensions).
6
6
  */
7
- import type { BuilderConfig } from "../builder/types";
8
- /** Padding config — re-exported from BuilderConfig for convenience */
9
- export type PaddingConfig = NonNullable<BuilderConfig["padding"]>;
7
+ export type PaddingConfig = number | [number, number] | [number, number, number, number];
10
8
  /** Resolved padding — all four sides in pixels */
11
9
  export interface ResolvedPadding {
12
10
  readonly top: number;
@@ -1 +1 @@
1
- .vlist--grid .vlist-items{contain:layout style}.vlist-grid-item{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;padding:var(--vlist-item-padding-y) var(--vlist-item-padding-x);background-color:var(--vlist-bg);cursor:default;user-select:none;transition:background-color var(--vlist-transition-duration) var(--vlist-transition-timing);contain:content;box-sizing:border-box;overflow:hidden}.vlist--grid .vlist-item{right:auto;border-bottom:none}.vlist--scrolling .vlist-grid-item{transition:none}.vlist--selectable .vlist-grid-item{cursor:pointer}.vlist--selectable .vlist-grid-item:hover{background-color:var(--vlist-bg-hover)}.vlist-grid-item.vlist-item--odd{background:var(--vlist-bg-striped)}.vlist-grid-item.vlist-item--selected{background-color:var(--vlist-bg-selected)}.vlist-grid-item.vlist-item--odd.vlist-item--selected{background:var(--vlist-bg-selected)}.vlist--selectable .vlist-grid-item.vlist-item--selected:hover{background-color:var(--vlist-bg-selected-hover)}.vlist--selectable .vlist-grid-item.vlist-item--odd.vlist-item--selected:hover{background:var(--vlist-bg-selected-hover)}.vlist-grid-item.vlist-item--focused{outline:2px solid var(--vlist-focus-ring,#3b82f6);outline-offset:-2px;z-index:1}
1
+ .vlist--grid .vlist-content{contain:layout style}.vlist-grid-item{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;padding:var(--vlist-item-padding-y) var(--vlist-item-padding-x);background-color:var(--vlist-bg);cursor:default;user-select:none;transition:background-color var(--vlist-transition-duration) var(--vlist-transition-timing);contain:content;box-sizing:border-box;overflow:hidden}.vlist--grid .vlist-item{right:auto;border-bottom:none}.vlist--scrolling .vlist-grid-item{transition:none}.vlist--selectable .vlist-grid-item{cursor:pointer}.vlist--selectable .vlist-grid-item:hover{background-color:var(--vlist-bg-hover)}.vlist-grid-item.vlist-item--odd{background:var(--vlist-bg-striped)}.vlist-grid-item.vlist-item--selected{background-color:var(--vlist-bg-selected)}.vlist-grid-item.vlist-item--odd.vlist-item--selected{background:var(--vlist-bg-selected)}.vlist--selectable .vlist-grid-item.vlist-item--selected:hover{background-color:var(--vlist-bg-selected-hover)}.vlist--selectable .vlist-grid-item.vlist-item--odd.vlist-item--selected:hover{background:var(--vlist-bg-selected-hover)}.vlist-grid-item.vlist-item--focused{outline:2px solid var(--vlist-focus-ring,#3b82f6);outline-offset:-2px;z-index:1}
@@ -1 +1 @@
1
- .vlist--masonry .vlist-items{contain:layout style}.vlist-masonry-item{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;padding:var(--vlist-item-padding-y) var(--vlist-item-padding-x);background-color:var(--vlist-bg);cursor:default;user-select:none;transition:background-color var(--vlist-transition-duration) var(--vlist-transition-timing);contain:content;box-sizing:border-box;overflow:hidden}.vlist--masonry .vlist-item{right:auto;border-bottom:none}.vlist--scrolling .vlist-masonry-item{transition:none}.vlist--selectable .vlist-masonry-item{cursor:pointer}.vlist--selectable .vlist-masonry-item:hover{background-color:var(--vlist-bg-hover)}.vlist-masonry-item.vlist-item--odd{background:var(--vlist-bg-striped)}.vlist-masonry-item.vlist-item--selected{background-color:var(--vlist-bg-selected)}.vlist-masonry-item.vlist-item--odd.vlist-item--selected{background:var(--vlist-bg-selected)}.vlist--selectable .vlist-masonry-item.vlist-item--selected:hover{background-color:var(--vlist-bg-selected-hover)}.vlist--selectable .vlist-masonry-item.vlist-item--odd.vlist-item--selected:hover{background:var(--vlist-bg-selected-hover)}.vlist-masonry-item.vlist-item--focused{outline:2px solid var(--vlist-focus-ring,#3b82f6);outline-offset:-2px;z-index:1}
1
+ .vlist--masonry .vlist-content{contain:layout style}.vlist-masonry-item{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;padding:var(--vlist-item-padding-y) var(--vlist-item-padding-x);background-color:var(--vlist-bg);cursor:default;user-select:none;transition:background-color var(--vlist-transition-duration) var(--vlist-transition-timing);contain:content;box-sizing:border-box;overflow:hidden}.vlist--masonry .vlist-item{right:auto;border-bottom:none}.vlist--scrolling .vlist-masonry-item{transition:none}.vlist--selectable .vlist-masonry-item{cursor:pointer}.vlist--selectable .vlist-masonry-item:hover{background-color:var(--vlist-bg-hover)}.vlist-masonry-item.vlist-item--odd{background:var(--vlist-bg-striped)}.vlist-masonry-item.vlist-item--selected{background-color:var(--vlist-bg-selected)}.vlist-masonry-item.vlist-item--odd.vlist-item--selected{background:var(--vlist-bg-selected)}.vlist--selectable .vlist-masonry-item.vlist-item--selected:hover{background-color:var(--vlist-bg-selected-hover)}.vlist--selectable .vlist-masonry-item.vlist-item--odd.vlist-item--selected:hover{background:var(--vlist-bg-selected-hover)}.vlist-masonry-item.vlist-item--focused{outline:2px solid var(--vlist-focus-ring,#3b82f6);outline-offset:-2px;z-index:1}
@@ -1 +1 @@
1
- .vlist--table{display:flex;flex-direction:column;overflow:hidden;min-height:inherit}.vlist--table .vlist-viewport{flex:1;min-height:0;height:auto;overflow:auto}.vlist--table .vlist-table-header{position:static}.vlist--table .vlist-scrollbar-hover{top:var(--vlist-table-header-height,0px);height:calc(100% - var(--vlist-table-header-height,0px))}.vlist--table .vlist-viewport--custom-scrollbar::-webkit-scrollbar{display:block;width:0}.vlist--table .vlist-items{contain:layout style}.vlist-table-header{position:absolute;top:0;left:0;right:0;z-index:5;overflow:hidden;display:flex;align-items:stretch;box-sizing:border-box;will-change:scroll-position;contain:layout style;background-color:var(--vlist-bg,#ffffff);border-bottom:1px solid var(--vlist-border,#e5e7eb);font-weight:600;font-size:0.8125rem;letter-spacing:0.01em;color:var(--vlist-text-muted,#6b7280)}.vlist-table-header-scroll{position:relative;display:flex;align-items:stretch;height:100%;min-width:100%;flex-shrink:0}.vlist-table-header-cell{position:relative;display:flex;align-items:center;height:100%;box-sizing:border-box;flex-shrink:0;user-select:none;padding-left:var(--vlist-item-padding-x,0.75rem);padding-right:var(--vlist-item-padding-x,0.75rem);border-right:1px solid transparent;transition:background-color 0.15s ease}.vlist-table-header-cell:hover{background-color:var(--vlist-bg-hover,rgba(0,0,0,0.04))}.vlist-table-header-cell--sortable{cursor:pointer}.vlist-table-header-cell--sortable:active{background-color:var(--vlist-bg-selected,rgba(59,130,246,0.12))}.vlist-table-header-cell--center{justify-content:center}.vlist-table-header-cell--right{justify-content:flex-end}.vlist-table-header-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;pointer-events:none}.vlist-table-header-sort{margin-left:4px;flex-shrink:0;opacity:0;font-size:0.7em;transition:opacity 0.15s ease;pointer-events:none;color:var(--vlist-text-muted,#6b7280)}.vlist-table-header-resize{position:absolute;top:0;right:-3px;bottom:0;width:5px;cursor:col-resize;z-index:2;touch-action:none;opacity:0;transition:opacity 0.15s ease}.vlist-table-header-resize::after{content:"";position:absolute;top:0;bottom:0;left:50%;width:1px;transform:translateX(-50%);background-color:var(--vlist-border,#e5e7eb);transition:background-color 0.15s ease}.vlist-table-header-resize:hover::after{background-color:var(--vlist-focus-ring,#3b82f6)}.vlist-table-header-cell:hover .vlist-table-header-resize{opacity:1}.vlist-table-header-resize--active{opacity:1}.vlist-table-header-resize--active::after{background-color:var(--vlist-border-selected,#3b82f6)}.vlist--col-resizing,.vlist--col-resizing *{cursor:col-resize !important;user-select:none !important}.vlist-table-row{position:absolute;top:0;left:0;display:flex;box-sizing:border-box;contain:content;border-bottom:none;background-color:var(--vlist-bg,#ffffff);cursor:default;user-select:none;transition:background-color var(--vlist-transition-duration,150ms) var(--vlist-transition-timing,ease-in-out);will-change:transform}.vlist--scrolling .vlist-table-row{transition:none}.vlist-table-row.vlist-item--odd{background:var( --vlist-bg-striped,var(--vlist-bg-hover,rgba(0,0,0,0.02)) )}.vlist--selectable .vlist-table-row{cursor:pointer}.vlist--selectable .vlist-table-row:hover{background-color:var(--vlist-bg-hover,rgba(0,0,0,0.04))}.vlist-table-row.vlist-item--selected{background-color:var(--vlist-bg-selected,rgba(59,130,246,0.12))}.vlist-table-row.vlist-item--odd.vlist-item--selected{background:var(--vlist-bg-selected,rgba(59,130,246,0.12))}.vlist--selectable .vlist-table-row.vlist-item--selected:hover{background-color:var(--vlist-bg-selected-hover,rgba(59,130,246,0.18))}.vlist--selectable .vlist-table-row.vlist-item--odd.vlist-item--selected:hover{background:var(--vlist-bg-selected-hover,rgba(59,130,246,0.18))}.vlist-table-row.vlist-item--focused{outline:2px solid var(--vlist-focus-ring,#3b82f6);outline-offset:-2px;z-index:1}.vlist-table-cell{position:absolute;top:0;bottom:0;display:flex;align-items:center;box-sizing:border-box;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-left:var(--vlist-item-padding-x,0.75rem);padding-right:var(--vlist-item-padding-x,0.75rem);font-size:0.875rem;color:var(--vlist-text,#111827)}.vlist-table-cell--center{text-align:center;justify-content:center}.vlist-table-cell--right{text-align:right;justify-content:flex-end}.vlist--table-row-borders .vlist-table-row{border-bottom:1px solid var(--vlist-border,#e5e7eb)}.vlist--table-col-borders .vlist-table-cell{border-right:1px solid var(--vlist-border,#e5e7eb)}.vlist--table-col-borders .vlist-table-header-cell{border-right-color:var(--vlist-border,#e5e7eb)}.vlist-table-group-header{display:flex;align-items:center;background-color:var(--vlist-group-header-bg,#f3f4f6);cursor:default}.vlist-table-group-header-content{flex:1;min-width:0;font-size:0.75rem;font-weight:600;letter-spacing:0.03em;text-transform:uppercase;color:var(--vlist-text-muted,#6b7280);border-bottom:1px solid var(--vlist-border)}.vlist--table-row-borders .vlist-table-group-header{border-bottom:1px solid var(--vlist-border)}.vlist--table.vlist--grouped .vlist-sticky-header{order:1;z-index:4;border-bottom:none}.vlist--table.vlist--grouped .vlist-viewport{order:2}[data-theme-mode="dark"] .vlist-table-header,.dark .vlist-table-header{background-color:var(--vlist-bg,#111827);color:var(--vlist-text-muted,#9ca3af);border-bottom-color:var(--vlist-border,#374151)}[data-theme-mode="dark"] .vlist-table-header-cell:hover,.dark .vlist-table-header-cell:hover{background-color:var(--vlist-bg-hover,rgba(255,255,255,0.06))}[data-theme-mode="dark"] .vlist-table-header-resize::after,.dark .vlist-table-header-resize::after{background-color:var(--vlist-border,#374151)}[data-theme-mode="dark"] .vlist-table-header-resize:hover::after,.dark .vlist-table-header-resize:hover::after{background-color:var(--vlist-focus-ring,#3b82f6)}[data-theme-mode="dark"] .vlist-table-group-header,.dark .vlist-table-group-header{background-color:var(--vlist-group-header-bg,#1f2937)}[data-theme-mode="dark"] .vlist-table-group-header-content,.dark .vlist-table-group-header-content{color:var(--vlist-text-muted,#9ca3af)}@media (prefers-color-scheme:dark){:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]) .vlist-table-header{background-color:var(--vlist-bg,#111827);color:var(--vlist-text-muted,#9ca3af);border-bottom-color:var(--vlist-border,#374151)}:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]) .vlist-table-header-cell:hover{background-color:var(--vlist-bg-hover,rgba(255,255,255,0.06))}:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]) .vlist-table-header-resize::after{background-color:var(--vlist-border,#374151)}:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]) .vlist-table-header-resize:hover::after{background-color:var(--vlist-focus-ring,#3b82f6)}:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]) .vlist-table-group-header{background-color:var(--vlist-group-header-bg,#1f2937)}:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]) .vlist-table-group-header-content{color:var(--vlist-text-muted,#9ca3af)}}.vlist-table-row.vlist-item--placeholder .vlist-table-cell{color:transparent}.vlist-table-row.vlist-item--placeholder .vlist-table-cell>*{color:transparent;background-color:var(--vlist-border,#e5e7eb);border-radius:4px;animation:vlist-placeholder-pulse 2s ease-in-out infinite;line-height:1;min-width:1em}.vlist-table-row.vlist-item--placeholder .vlist-table-cell>*>*{visibility:hidden}.vlist-table-row.vlist-item--placeholder .vlist-table-cell>*[style]{background:var(--vlist-border,#e5e7eb) !important;color:transparent !important}[data-theme-mode="dark"] .vlist--table-row-borders .vlist-table-group-header,.dark .vlist--table-row-borders .vlist-table-group-header{border-top-color:var(--vlist-border,#374151)}@media (prefers-color-scheme:dark){:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]) .vlist--table-row-borders .vlist-table-group-header{border-top-color:var(--vlist-border,#374151)}}
1
+ .vlist--table{display:flex;flex-direction:column;overflow:hidden;min-height:inherit}.vlist--table .vlist-viewport{flex:1;min-height:0;height:auto;overflow:auto}.vlist--table .vlist-table-header{position:static}.vlist--table .vlist-scrollbar__hover{top:var(--vlist-table-header-height,0px);height:calc(100% - var(--vlist-table-header-height,0px))}.vlist--table .vlist-viewport--custom-scrollbar::-webkit-scrollbar{display:block;width:0}.vlist--table .vlist-content{contain:layout style}.vlist-table-header{position:absolute;top:0;left:0;right:0;z-index:5;overflow:hidden;display:flex;align-items:stretch;box-sizing:border-box;will-change:scroll-position;contain:layout style;background-color:var(--vlist-bg,#ffffff);border-bottom:1px solid var(--vlist-border,#e5e7eb);font-weight:600;font-size:0.8125rem;letter-spacing:0.01em;color:var(--vlist-text-muted,#6b7280)}.vlist-table-header-scroll{position:relative;display:flex;align-items:stretch;height:100%;min-width:100%;flex-shrink:0}.vlist-table-header-cell{position:relative;display:flex;align-items:center;height:100%;box-sizing:border-box;flex-shrink:0;user-select:none;padding-left:var(--vlist-item-padding-x,0.75rem);padding-right:var(--vlist-item-padding-x,0.75rem);border-right:1px solid transparent;transition:background-color 0.15s ease}.vlist-table-header-cell:hover{background-color:var(--vlist-bg-hover,rgba(0,0,0,0.04))}.vlist-table-header-cell--sortable{cursor:pointer}.vlist-table-header-cell--sortable:active{background-color:var(--vlist-bg-selected,rgba(59,130,246,0.12))}.vlist-table-header-cell--center{justify-content:center}.vlist-table-header-cell--right{justify-content:flex-end}.vlist-table-header-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;pointer-events:none}.vlist-table-header-sort{margin-left:4px;flex-shrink:0;opacity:0;font-size:0.7em;transition:opacity 0.15s ease;pointer-events:none;color:var(--vlist-text-muted,#6b7280)}.vlist-table-header-resize{position:absolute;top:0;right:-3px;bottom:0;width:5px;cursor:col-resize;z-index:2;touch-action:none;opacity:0;transition:opacity 0.15s ease}.vlist-table-header-resize::after{content:"";position:absolute;top:0;bottom:0;left:50%;width:1px;transform:translateX(-50%);background-color:var(--vlist-border,#e5e7eb);transition:background-color 0.15s ease}.vlist-table-header-resize:hover::after{background-color:var(--vlist-focus-ring,#3b82f6)}.vlist-table-header-cell:hover .vlist-table-header-resize{opacity:1}.vlist-table-header-resize--active{opacity:1}.vlist-table-header-resize--active::after{background-color:var(--vlist-border-selected,#3b82f6)}.vlist--col-resizing,.vlist--col-resizing *{cursor:col-resize !important;user-select:none !important}.vlist-table-row{position:absolute;top:0;left:0;display:flex;box-sizing:border-box;contain:content;border-bottom:none;background-color:var(--vlist-bg,#ffffff);cursor:default;user-select:none;transition:background-color var(--vlist-transition-duration,150ms) var(--vlist-transition-timing,ease-in-out);will-change:transform}.vlist--scrolling .vlist-table-row{transition:none}.vlist-table-row.vlist-item--odd{background:var( --vlist-bg-striped,var(--vlist-bg-hover,rgba(0,0,0,0.02)) )}.vlist--selectable .vlist-table-row{cursor:pointer}.vlist--selectable .vlist-table-row:hover{background-color:var(--vlist-bg-hover,rgba(0,0,0,0.04))}.vlist-table-row.vlist-item--selected{background-color:var(--vlist-bg-selected,rgba(59,130,246,0.12))}.vlist-table-row.vlist-item--odd.vlist-item--selected{background:var(--vlist-bg-selected,rgba(59,130,246,0.12))}.vlist--selectable .vlist-table-row.vlist-item--selected:hover{background-color:var(--vlist-bg-selected-hover,rgba(59,130,246,0.18))}.vlist--selectable .vlist-table-row.vlist-item--odd.vlist-item--selected:hover{background:var(--vlist-bg-selected-hover,rgba(59,130,246,0.18))}.vlist-table-row.vlist-item--focused{outline:2px solid var(--vlist-focus-ring,#3b82f6);outline-offset:-2px;z-index:1}.vlist-table-cell{position:absolute;top:0;bottom:0;display:flex;align-items:center;box-sizing:border-box;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-left:var(--vlist-item-padding-x,0.75rem);padding-right:var(--vlist-item-padding-x,0.75rem);font-size:0.875rem;color:var(--vlist-text,#111827)}.vlist-table-cell--center{text-align:center;justify-content:center}.vlist-table-cell--right{text-align:right;justify-content:flex-end}.vlist--table-row-borders .vlist-table-row{border-bottom:1px solid var(--vlist-border,#e5e7eb)}.vlist--table-col-borders .vlist-table-cell{border-right:1px solid var(--vlist-border,#e5e7eb)}.vlist--table-col-borders .vlist-table-header-cell{border-right-color:var(--vlist-border,#e5e7eb)}.vlist-table-group-header{display:flex;align-items:center;background-color:var(--vlist-group-header-bg,#f3f4f6);cursor:default}.vlist-table-group-header-content{flex:1;min-width:0;font-size:0.75rem;font-weight:600;letter-spacing:0.03em;text-transform:uppercase;color:var(--vlist-text-muted,#6b7280);border-bottom:1px solid var(--vlist-border)}.vlist--table-row-borders .vlist-table-group-header{border-bottom:1px solid var(--vlist-border)}.vlist--table.vlist--grouped .vlist-sticky-header{order:1;z-index:4;border-bottom:none}.vlist--table.vlist--grouped .vlist-viewport{order:2}[data-theme-mode="dark"] .vlist-table-header,.dark .vlist-table-header{background-color:var(--vlist-bg,#111827);color:var(--vlist-text-muted,#9ca3af);border-bottom-color:var(--vlist-border,#374151)}[data-theme-mode="dark"] .vlist-table-header-cell:hover,.dark .vlist-table-header-cell:hover{background-color:var(--vlist-bg-hover,rgba(255,255,255,0.06))}[data-theme-mode="dark"] .vlist-table-header-resize::after,.dark .vlist-table-header-resize::after{background-color:var(--vlist-border,#374151)}[data-theme-mode="dark"] .vlist-table-header-resize:hover::after,.dark .vlist-table-header-resize:hover::after{background-color:var(--vlist-focus-ring,#3b82f6)}[data-theme-mode="dark"] .vlist-table-group-header,.dark .vlist-table-group-header{background-color:var(--vlist-group-header-bg,#1f2937)}[data-theme-mode="dark"] .vlist-table-group-header-content,.dark .vlist-table-group-header-content{color:var(--vlist-text-muted,#9ca3af)}@media (prefers-color-scheme:dark){:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]) .vlist-table-header{background-color:var(--vlist-bg,#111827);color:var(--vlist-text-muted,#9ca3af);border-bottom-color:var(--vlist-border,#374151)}:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]) .vlist-table-header-cell:hover{background-color:var(--vlist-bg-hover,rgba(255,255,255,0.06))}:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]) .vlist-table-header-resize::after{background-color:var(--vlist-border,#374151)}:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]) .vlist-table-header-resize:hover::after{background-color:var(--vlist-focus-ring,#3b82f6)}:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]) .vlist-table-group-header{background-color:var(--vlist-group-header-bg,#1f2937)}:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]) .vlist-table-group-header-content{color:var(--vlist-text-muted,#9ca3af)}}.vlist-table-row.vlist-item--placeholder .vlist-table-cell{color:transparent}.vlist-table-row.vlist-item--placeholder .vlist-table-cell>*{color:transparent;background-color:var(--vlist-border,#e5e7eb);border-radius:4px;animation:vlist-placeholder-pulse 2s ease-in-out infinite;line-height:1;min-width:1em}.vlist-table-row.vlist-item--placeholder .vlist-table-cell>*>*{visibility:hidden}.vlist-table-row.vlist-item--placeholder .vlist-table-cell>*[style]{background:var(--vlist-border,#e5e7eb) !important;color:transparent !important}[data-theme-mode="dark"] .vlist--table-row-borders .vlist-table-group-header,.dark .vlist--table-row-borders .vlist-table-group-header{border-top-color:var(--vlist-border,#374151)}@media (prefers-color-scheme:dark){:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]) .vlist--table-row-borders .vlist-table-group-header{border-top-color:var(--vlist-border,#374151)}}
package/dist/vlist.css CHANGED
@@ -1 +1 @@
1
- @keyframes vlist-fade-in{from{opacity:0.6}to{opacity:1}}@keyframes vlist-placeholder-pulse{0%,100%{opacity:0.6}50%{opacity:0.4}}:root{--vlist-scrollbar-width:8px;--vlist-scrollbar-track-color:transparent;--vlist-scrollbar-radius:4px;--vlist-custom-scrollbar-width:8px;--vlist-custom-scrollbar-track-color:transparent;--vlist-custom-scrollbar-radius:4px;--vlist-custom-scrollbar-padding-top:2px;--vlist-custom-scrollbar-padding-right:2px;--vlist-custom-scrollbar-padding-bottom:2px;--vlist-custom-scrollbar-padding-left:2px;--vlist-custom-scrollbar-min-thumb-size:15px;--vlist-item-padding-x:1rem;--vlist-item-padding-y:0.75rem;--vlist-border-radius:0.5rem;--vlist-transition-duration:150ms;--vlist-transition-timing:ease-in-out;--vlist-bg:#ffffff;--vlist-bg-hover:rgba(0,0,0,0.04);--vlist-bg-striped:rgba(0,0,0,0.02);--vlist-bg-selected:rgba(59,130,246,0.12);--vlist-bg-selected-hover:rgba(59,130,246,0.18);--vlist-border:#e5e7eb;--vlist-border-selected:#3b82f6;--vlist-text:#111827;--vlist-text-muted:#6b7280;--vlist-focus-ring:#3b82f6;--vlist-group-header-bg:#f3f4f6;--vlist-scrollbar-thumb-color:#d1d5db;--vlist-scrollbar-thumb-hover-color:#9ca3af;--vlist-custom-scrollbar-thumb-color:rgba(0,0,0,0.2);--vlist-custom-scrollbar-thumb-hover-color:rgba(0,0,0,0.3);--vlist-placeholder-bg:rgba(0,0,0,0.2)}[data-theme-mode="dark"]{--vlist-bg:#111827;--vlist-bg-hover:rgba(255,255,255,0.06);--vlist-bg-striped:rgba(255,255,255,0.02);--vlist-bg-selected:rgba(59,130,246,0.2);--vlist-bg-selected-hover:rgba(59,130,246,0.28);--vlist-border:#374151;--vlist-border-selected:#3b82f6;--vlist-text:#f9fafb;--vlist-text-muted:#9ca3af;--vlist-focus-ring:#3b82f6;--vlist-group-header-bg:#1e2433;--vlist-scrollbar-thumb-color:#4b5563;--vlist-scrollbar-thumb-hover-color:#6b7280;--vlist-custom-scrollbar-thumb-color:rgba(255,255,255,0.2);--vlist-custom-scrollbar-thumb-hover-color:rgba(255,255,255,0.3);--vlist-placeholder-bg:rgba(255,255,255,0.3)}@media (prefers-color-scheme:dark){:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]){--vlist-bg:#111827;--vlist-bg-hover:rgba(255,255,255,0.06);--vlist-bg-striped:rgba(255,255,255,0.02);--vlist-bg-selected:rgba(59,130,246,0.2);--vlist-bg-selected-hover:rgba(59,130,246,0.28);--vlist-border:#374151;--vlist-border-selected:#3b82f6;--vlist-text:#f9fafb;--vlist-text-muted:#9ca3af;--vlist-focus-ring:#3b82f6;--vlist-group-header-bg:#1e2433;--vlist-scrollbar-thumb-color:#4b5563;--vlist-scrollbar-thumb-hover-color:#6b7280;--vlist-custom-scrollbar-thumb-color:rgba(255,255,255,0.2);--vlist-custom-scrollbar-thumb-hover-color:rgba(255,255,255,0.3);--vlist-placeholder-bg:rgba(255,255,255,0.3)}}.dark{--vlist-bg:#111827;--vlist-bg-hover:rgba(255,255,255,0.06);--vlist-bg-striped:rgba(255,255,255,0.02);--vlist-bg-selected:rgba(59,130,246,0.2);--vlist-bg-selected-hover:rgba(59,130,246,0.28);--vlist-border:#374151;--vlist-border-selected:#3b82f6;--vlist-text:#f9fafb;--vlist-text-muted:#9ca3af;--vlist-focus-ring:#3b82f6;--vlist-group-header-bg:#1e2433;--vlist-scrollbar-thumb-color:#4b5563;--vlist-scrollbar-thumb-hover-color:#6b7280;--vlist-custom-scrollbar-thumb-color:rgba(255,255,255,0.2);--vlist-custom-scrollbar-thumb-hover-color:rgba(255,255,255,0.3);--vlist-placeholder-bg:rgba(255,255,255,0.3)}.vlist{position:relative;width:100%;height:100%;box-sizing:border-box;overflow:hidden;background-color:var(--vlist-bg);color:var(--vlist-text);color-scheme:light;border:1px solid var(--vlist-border);border-radius:var(--vlist-border-radius);outline:none}[data-theme-mode="dark"] .vlist,.dark .vlist{color-scheme:dark}@media (prefers-color-scheme:dark){:root:not([data-theme-mode="light"]) .vlist{color-scheme:dark}}.vlist:focus,.vlist:focus-visible,.vlist-items:focus,.vlist-items:focus-visible{outline:none}.vlist-viewport{width:100%;height:100%;overflow:auto;scrollbar-color:var(--vlist-scrollbar-thumb-color) var(--vlist-scrollbar-track-color)}@supports (-moz-appearance:none) and (scrollbar-width:1px){.vlist-viewport{scrollbar-width:var(--vlist-scrollbar-width)}}.vlist-viewport::-webkit-scrollbar{width:var(--vlist-scrollbar-width);height:var(--vlist-scrollbar-width)}.vlist-viewport::-webkit-scrollbar-track{background:var(--vlist-scrollbar-track-color)}.vlist-viewport::-webkit-scrollbar-thumb{background-color:var(--vlist-scrollbar-thumb-color);border-radius:var(--vlist-scrollbar-radius)}.vlist-viewport::-webkit-scrollbar-thumb:hover{background-color:var(--vlist-scrollbar-thumb-hover-color)}.vlist-content{position:relative;width:100%}.vlist-items{position:relative;width:100%;contain:layout style}.vlist-item,.vlist-group-header{position:absolute;top:0;left:0;right:0;display:flex;align-items:center;background-color:var(--vlist-bg);cursor:default;user-select:none;opacity:1;transition:background-color var(--vlist-transition-duration) var(--vlist-transition-timing),opacity var(--vlist-transition-duration) var(--vlist-transition-timing);contain:content;box-sizing:border-box;will-change:transform}.vlist--scrolling .vlist-item,.vlist--settling .vlist-item,.vlist--scrolling .vlist-group-header,.vlist--settling .vlist-group-header{transition:none}.vlist--selectable .vlist-item{cursor:pointer}.vlist--selectable .vlist-item:hover{background-color:var(--vlist-bg-hover)}.vlist-item.vlist-item--odd{background:var(--vlist-bg-striped)}.vlist-item.vlist-item--selected{background-color:var(--vlist-bg-selected)}.vlist-item.vlist-item--odd.vlist-item--selected{background:var(--vlist-bg-selected)}.vlist-item.vlist-item--selected:hover{background-color:var(--vlist-bg-selected-hover)}.vlist-item.vlist-item--odd.vlist-item--selected:hover{background:var(--vlist-bg-selected-hover)}.vlist-item.vlist-item--focused{outline:2px solid var(--vlist-focus-ring,#3b82f6);outline-offset:-2px;z-index:1}.vlist-item--replaced{animation:vlist-fade-in 0.3s ease-out}.vlist-item--placeholder{opacity:0.6;animation:vlist-placeholder-pulse 2s ease-in-out infinite}.vlist-item.vlist-item--selected.vlist-item--focused{outline-color:var(--vlist-border-selected)}.vlist-scrollbar{position:absolute;top:var(--vlist-custom-scrollbar-padding-top);right:var(--vlist-custom-scrollbar-padding-right);bottom:var(--vlist-custom-scrollbar-padding-bottom);width:var(--vlist-custom-scrollbar-width);background-color:var(--vlist-custom-scrollbar-track-color);opacity:0;transition:opacity 0.2s ease-out;z-index:10;pointer-events:none}.vlist-scrollbar-hover{position:absolute;top:0;right:0;height:100%;z-index:9;pointer-events:auto}.vlist-scrollbar-hover--horizontal{top:auto;right:auto;bottom:0;left:0;width:100%;height:auto}.vlist-scrollbar--visible{opacity:1;pointer-events:auto}.vlist-scrollbar-thumb{position:absolute;top:0;left:0;right:0;width:100%;background-color:var(--vlist-custom-scrollbar-thumb-color);border-radius:var(--vlist-custom-scrollbar-radius);cursor:pointer;transition:background-color 0.15s ease-out}.vlist-scrollbar-thumb:hover{background-color:var(--vlist-custom-scrollbar-thumb-hover-color)}.vlist-scrollbar--dragging{opacity:1;pointer-events:auto}.vlist-scrollbar--dragging .vlist-scrollbar-thumb{background-color:var(--vlist-custom-scrollbar-thumb-hover-color)}.vlist-group-header{cursor:default;background-color:var(--vlist-group-header-bg,#f3f4f6);z-index:1;overflow:hidden}.vlist-group-header:hover{background-color:var(--vlist-group-header-bg,#f3f4f6)}.vlist-sticky-header{left:0;right:0;background-color:var(--vlist-group-header-bg,#f3f4f6)}.vlist--horizontal{overflow:hidden}.vlist--horizontal .vlist-viewport{overflow-x:auto;overflow-y:hidden}.vlist--horizontal .vlist-content{height:100%;width:auto}.vlist--horizontal .vlist-items{height:100%;width:auto}.vlist--horizontal .vlist-item,.vlist--horizontal .vlist-group-header{position:absolute;top:0;bottom:0;left:0;right:auto;display:flex;align-items:center;justify-content:center;border-bottom:none;border-right:1px solid var(--vlist-border)}.vlist-scrollbar--horizontal{top:auto;left:var(--vlist-custom-scrollbar-padding-left);right:var(--vlist-custom-scrollbar-padding-right);bottom:var(--vlist-custom-scrollbar-padding-bottom);width:auto;height:var(--vlist-custom-scrollbar-width)}.vlist-scrollbar--horizontal .vlist-scrollbar-thumb{top:0;left:0;width:auto;height:100%}.vlist-viewport--gutter{padding-right:calc( var(--vlist-custom-scrollbar-padding-right) + var(--vlist-custom-scrollbar-width) + var(--vlist-custom-scrollbar-padding-left) )}.vlist--horizontal .vlist-viewport--gutter{padding-right:0;padding-bottom:calc( var(--vlist-custom-scrollbar-padding-bottom) + var(--vlist-custom-scrollbar-width) + var(--vlist-custom-scrollbar-padding-top) )}.vlist-viewport--custom-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.vlist-viewport--custom-scrollbar::-webkit-scrollbar{display:none}.vlist-viewport--no-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.vlist-viewport--no-scrollbar::-webkit-scrollbar{display:none}.vlist-viewport--gutter-stable{scrollbar-gutter:stable}.vlist-sort-ghost{opacity:0.85;box-shadow:0 4px 16px rgba(0,0,0,0.18);cursor:grabbing}.vlist-item--drag-source{opacity:0 !important;pointer-events:none}.vlist--sorting{cursor:grabbing;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}.vlist-item--kb-sorting{outline:2px solid var(--vlist-focus-ring,#3b82f6);outline-offset:-2px;background-color:var(--vlist-bg-selected);z-index:1}
1
+ @keyframes vlist-fade-in{from{opacity:0.6}to{opacity:1}}@keyframes vlist-placeholder-pulse{0%,100%{opacity:0.6}50%{opacity:0.4}}:root{--vlist-scrollbar-width:8px;--vlist-scrollbar-track-color:transparent;--vlist-scrollbar-radius:4px;--vlist-custom-scrollbar-width:8px;--vlist-custom-scrollbar-track-color:transparent;--vlist-custom-scrollbar-radius:4px;--vlist-custom-scrollbar-padding-top:2px;--vlist-custom-scrollbar-padding-right:2px;--vlist-custom-scrollbar-padding-bottom:2px;--vlist-custom-scrollbar-padding-left:2px;--vlist-custom-scrollbar-min-thumb-size:15px;--vlist-item-padding-x:1rem;--vlist-item-padding-y:0.75rem;--vlist-border-radius:0.5rem;--vlist-transition-duration:150ms;--vlist-transition-timing:ease-in-out;--vlist-bg:#ffffff;--vlist-bg-hover:rgba(0,0,0,0.04);--vlist-bg-striped:rgba(0,0,0,0.02);--vlist-bg-selected:rgba(59,130,246,0.12);--vlist-bg-selected-hover:rgba(59,130,246,0.18);--vlist-border:#e5e7eb;--vlist-border-selected:#3b82f6;--vlist-text:#111827;--vlist-text-muted:#6b7280;--vlist-focus-ring:#3b82f6;--vlist-group-header-bg:#f3f4f6;--vlist-scrollbar-thumb-color:#d1d5db;--vlist-scrollbar-thumb-hover-color:#9ca3af;--vlist-custom-scrollbar-thumb-color:rgba(0,0,0,0.2);--vlist-custom-scrollbar-thumb-hover-color:rgba(0,0,0,0.3);--vlist-placeholder-bg:rgba(0,0,0,0.2);--vlist-placeholder-bg-strong:rgba(0,0,0,0.24)}[data-theme-mode="dark"]{--vlist-bg:#111827;--vlist-bg-hover:rgba(255,255,255,0.06);--vlist-bg-striped:rgba(255,255,255,0.02);--vlist-bg-selected:rgba(59,130,246,0.2);--vlist-bg-selected-hover:rgba(59,130,246,0.28);--vlist-border:#374151;--vlist-border-selected:#3b82f6;--vlist-text:#f9fafb;--vlist-text-muted:#9ca3af;--vlist-focus-ring:#3b82f6;--vlist-group-header-bg:#1e2433;--vlist-scrollbar-thumb-color:#4b5563;--vlist-scrollbar-thumb-hover-color:#6b7280;--vlist-custom-scrollbar-thumb-color:rgba(255,255,255,0.2);--vlist-custom-scrollbar-thumb-hover-color:rgba(255,255,255,0.3);--vlist-placeholder-bg:rgba(255,255,255,0.3);--vlist-placeholder-bg-strong:rgba(255,255,255,0.35)}@media (prefers-color-scheme:dark){:root:not([data-theme-mode="light"]):not([data-theme-mode="dark"]){--vlist-bg:#111827;--vlist-bg-hover:rgba(255,255,255,0.06);--vlist-bg-striped:rgba(255,255,255,0.02);--vlist-bg-selected:rgba(59,130,246,0.2);--vlist-bg-selected-hover:rgba(59,130,246,0.28);--vlist-border:#374151;--vlist-border-selected:#3b82f6;--vlist-text:#f9fafb;--vlist-text-muted:#9ca3af;--vlist-focus-ring:#3b82f6;--vlist-group-header-bg:#1e2433;--vlist-scrollbar-thumb-color:#4b5563;--vlist-scrollbar-thumb-hover-color:#6b7280;--vlist-custom-scrollbar-thumb-color:rgba(255,255,255,0.2);--vlist-custom-scrollbar-thumb-hover-color:rgba(255,255,255,0.3);--vlist-placeholder-bg:rgba(255,255,255,0.3);--vlist-placeholder-bg-strong:rgba(255,255,255,0.35)}}.dark{--vlist-bg:#111827;--vlist-bg-hover:rgba(255,255,255,0.06);--vlist-bg-striped:rgba(255,255,255,0.02);--vlist-bg-selected:rgba(59,130,246,0.2);--vlist-bg-selected-hover:rgba(59,130,246,0.28);--vlist-border:#374151;--vlist-border-selected:#3b82f6;--vlist-text:#f9fafb;--vlist-text-muted:#9ca3af;--vlist-focus-ring:#3b82f6;--vlist-group-header-bg:#1e2433;--vlist-scrollbar-thumb-color:#4b5563;--vlist-scrollbar-thumb-hover-color:#6b7280;--vlist-custom-scrollbar-thumb-color:rgba(255,255,255,0.2);--vlist-custom-scrollbar-thumb-hover-color:rgba(255,255,255,0.3);--vlist-placeholder-bg:rgba(255,255,255,0.3);--vlist-placeholder-bg-strong:rgba(255,255,255,0.35)}.vlist{position:relative;width:100%;height:100%;box-sizing:border-box;overflow:hidden;background-color:var(--vlist-bg);color:var(--vlist-text);color-scheme:light;border:1px solid var(--vlist-border);border-radius:var(--vlist-border-radius);outline:none}[data-theme-mode="dark"] .vlist,.dark .vlist{color-scheme:dark}@media (prefers-color-scheme:dark){:root:not([data-theme-mode="light"]) .vlist{color-scheme:dark}}.vlist:focus,.vlist:focus-visible,.vlist-content:focus,.vlist-content:focus-visible{outline:none}.vlist-viewport{width:100%;height:100%;overflow:auto;scrollbar-color:var(--vlist-scrollbar-thumb-color) var(--vlist-scrollbar-track-color)}@supports (-moz-appearance:none) and (scrollbar-width:1px){.vlist-viewport{scrollbar-width:var(--vlist-scrollbar-width)}}.vlist-viewport::-webkit-scrollbar{width:var(--vlist-scrollbar-width);height:var(--vlist-scrollbar-width)}.vlist-viewport::-webkit-scrollbar-track{background:var(--vlist-scrollbar-track-color)}.vlist-viewport::-webkit-scrollbar-thumb{background-color:var(--vlist-scrollbar-thumb-color);border-radius:var(--vlist-scrollbar-radius)}.vlist-viewport::-webkit-scrollbar-thumb:hover{background-color:var(--vlist-scrollbar-thumb-hover-color)}.vlist-content{position:relative;width:100%;contain:layout style}.vlist-item,.vlist-group-header{position:absolute;top:0;left:0;right:0;display:flex;align-items:center;background-color:var(--vlist-bg);cursor:default;user-select:none;opacity:1;transition:background-color var(--vlist-transition-duration) var(--vlist-transition-timing),opacity var(--vlist-transition-duration) var(--vlist-transition-timing);contain:content;box-sizing:border-box;will-change:transform}.vlist--scrolling .vlist-item,.vlist--settling .vlist-item,.vlist--scrolling .vlist-group-header,.vlist--settling .vlist-group-header{transition:none}.vlist--selectable .vlist-item{cursor:pointer}.vlist--selectable .vlist-item:hover{background-color:var(--vlist-bg-hover)}.vlist-item.vlist-item--odd{background:var(--vlist-bg-striped)}.vlist-item.vlist-item--selected{background-color:var(--vlist-bg-selected)}.vlist-item.vlist-item--odd.vlist-item--selected{background:var(--vlist-bg-selected)}.vlist-item.vlist-item--selected:hover{background-color:var(--vlist-bg-selected-hover)}.vlist-item.vlist-item--odd.vlist-item--selected:hover{background:var(--vlist-bg-selected-hover)}.vlist-item.vlist-item--focused{outline:2px solid var(--vlist-focus-ring,#3b82f6);outline-offset:-2px;z-index:1}.vlist-item--replaced{animation:vlist-fade-in 0.3s ease-out}.vlist-item--placeholder{opacity:0.6;animation:vlist-placeholder-pulse 2s ease-in-out infinite}.vlist-item--placeholder *:not(:has(*)){color:transparent;background-color:var(--vlist-placeholder-bg);border-radius:4px;width:fit-content;line-height:1.2;transform:scaleY(0.8)}.vlist-item--placeholder:is(strong,b,h1,h2,h3,h4):not(:has(*)){background-color:var(--vlist-placeholder-bg-strong)}.vlist-item.vlist-item--selected.vlist-item--focused{outline-color:var(--vlist-border-selected)}.vlist-scrollbar{position:absolute;top:var(--vlist-custom-scrollbar-padding-top);right:var(--vlist-custom-scrollbar-padding-right);bottom:var(--vlist-custom-scrollbar-padding-bottom);width:var(--vlist-custom-scrollbar-width);background-color:var(--vlist-custom-scrollbar-track-color);opacity:0;transition:opacity 0.2s ease-out;z-index:10;pointer-events:none}.vlist-scrollbar__hover{position:absolute;top:0;right:0;height:100%;z-index:9;pointer-events:auto}.vlist-scrollbar__hover--horizontal{top:auto;right:auto;bottom:0;left:0;width:100%;height:auto}.vlist-scrollbar--visible{opacity:1;pointer-events:auto}.vlist-scrollbar__thumb{position:absolute;top:0;left:0;right:0;width:100%;background-color:var(--vlist-custom-scrollbar-thumb-color);border-radius:var(--vlist-custom-scrollbar-radius);cursor:pointer;transition:background-color 0.15s ease-out}.vlist-scrollbar__thumb:hover{background-color:var(--vlist-custom-scrollbar-thumb-hover-color)}.vlist-scrollbar--dragging{opacity:1;pointer-events:auto}.vlist-scrollbar--dragging .vlist-scrollbar__thumb{background-color:var(--vlist-custom-scrollbar-thumb-hover-color)}.vlist-group-header{cursor:default;background-color:var(--vlist-group-header-bg,#f3f4f6);z-index:1;overflow:hidden}.vlist-group-header:hover{background-color:var(--vlist-group-header-bg,#f3f4f6)}.vlist-sticky-header{left:0;right:0;background-color:var(--vlist-group-header-bg,#f3f4f6)}.vlist--horizontal{overflow:hidden}.vlist--horizontal .vlist-viewport{overflow-x:auto;overflow-y:hidden}.vlist--horizontal .vlist-content{height:100%;width:auto}.vlist--horizontal .vlist-item,.vlist--horizontal .vlist-group-header{position:absolute;top:0;bottom:0;left:0;right:auto;display:flex;align-items:center;justify-content:center;border-bottom:none;border-right:1px solid var(--vlist-border)}.vlist-scrollbar--horizontal{top:auto;left:var(--vlist-custom-scrollbar-padding-left);right:var(--vlist-custom-scrollbar-padding-right);bottom:var(--vlist-custom-scrollbar-padding-bottom);width:auto;height:var(--vlist-custom-scrollbar-width)}.vlist-scrollbar--horizontal .vlist-scrollbar__thumb{top:0;left:0;width:auto;height:100%}.vlist-viewport--gutter{padding-right:calc( var(--vlist-custom-scrollbar-padding-right) + var(--vlist-custom-scrollbar-width) + var(--vlist-custom-scrollbar-padding-left) )}.vlist--horizontal .vlist-viewport--gutter{padding-right:0;padding-bottom:calc( var(--vlist-custom-scrollbar-padding-bottom) + var(--vlist-custom-scrollbar-width) + var(--vlist-custom-scrollbar-padding-top) )}.vlist-viewport--custom-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.vlist-viewport--custom-scrollbar::-webkit-scrollbar{display:none}.vlist-viewport--no-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.vlist-viewport--no-scrollbar::-webkit-scrollbar{display:none}.vlist-viewport--gutter-stable{scrollbar-gutter:stable}.vlist-sort-ghost{opacity:0.85;box-shadow:0 4px 16px rgba(0,0,0,0.18);cursor:grabbing}.vlist-item--drag-source{opacity:0 !important;pointer-events:none}.vlist--sorting{cursor:grabbing;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}.vlist--sorting *{cursor:inherit !important}.vlist-item--kb-sorting{outline:2px solid var(--vlist-focus-ring,#3b82f6);outline-offset:-2px;background-color:var(--vlist-bg-selected);z-index:1}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vlist",
3
- "version": "1.9.1",
3
+ "version": "2.0.1",
4
4
  "description": "Lightweight, high-performance virtual list with zero dependencies",
5
5
  "author": {
6
6
  "name": "Floor IO",
@@ -47,8 +47,7 @@
47
47
  "./package.json": "./package.json"
48
48
  },
49
49
  "files": [
50
- "dist/index.js",
51
- "dist/internals.js",
50
+ "dist/**/*.js",
52
51
  "dist/**/*.d.ts",
53
52
  "dist/**/*.css",
54
53
  "dist/size.json",
@@ -63,9 +62,13 @@
63
62
  "test": "bun test",
64
63
  "test:changed": "bun test --changed",
65
64
  "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json",
65
+ "bench": "bun run scripts/bench.ts",
66
+ "bench:quick": "bun run scripts/bench.ts --quick",
67
+ "bench:full": "bun run scripts/bench.ts --full",
68
+ "bench:compare": "bun run scripts/bench.ts --quick --compare",
66
69
  "size": "bun run scripts/measure-size.ts",
67
70
  "release": "bun run scripts/release.ts",
68
- "prepublishOnly": "bun run build --types && cp README.md README.github.md && cp npm-readme.md README.md",
71
+ "prepublishOnly": "bun run build -- --types && cp README.md README.github.md && cp npm-readme.md README.md",
69
72
  "postpublish": "cp README.github.md README.md && rm README.github.md"
70
73
  },
71
74
  "bugs": {
@@ -73,8 +76,10 @@
73
76
  },
74
77
  "homepage": "https://vlist.io",
75
78
  "devDependencies": {
79
+ "@happy-dom/global-registrator": "^20.9.0",
76
80
  "@types/bun": "^1.0.0",
77
81
  "@types/jsdom": "^27.0.0",
82
+ "happy-dom": "^20.9.0",
78
83
  "jsdom": "^28.0.0",
79
84
  "typescript": "^5.0.0"
80
85
  }
@@ -1,16 +0,0 @@
1
- /**
2
- * vlist/builder -- Baseline ARIA keyboard navigation
3
- *
4
- * Extracted from core.ts to reduce the base bundle size.
5
- * Implements the WAI-ARIA listbox pattern: arrow keys move focus,
6
- * Space/Enter selects, click selects + focuses.
7
- */
8
- import type { VListItem } from "../types";
9
- import type { MRefs } from "./materialize";
10
- import type { DOMStructure } from "./dom";
11
- /**
12
- * Wire up baseline single-select ARIA keyboard navigation.
13
- * Registers focus/blur listeners, keydown handler, click handler, and destroy cleanup.
14
- */
15
- export declare const setupBaselineA11y: <T extends VListItem>($: MRefs<T>, dom: DOMStructure, cp: string, ap: string, hz: boolean, ps: number, pe: number, wr: boolean, methods: Map<string, Function>, rendered: Map<number, HTMLElement>, keydownHandlers: Array<(event: KeyboardEvent) => void>, clickHandlers: Array<(event: MouseEvent) => void>, destroyHandlers: Array<() => void>, foc: boolean) => void;
16
- //# sourceMappingURL=a11y.d.ts.map
@@ -1,21 +0,0 @@
1
- /**
2
- * vlist/builder — Public API Assembly
3
- *
4
- * Constructs the public VList API object, base data method wrappers,
5
- * scroll methods (cancelScroll, animateScroll, scrollToIndex), event
6
- * subscription (on/off), and the destroy teardown.
7
- *
8
- * Extracted from core.ts materialize() — pure wiring with no hot-path
9
- * implications. All mutable state accessed via the `$` refs bag.
10
- *
11
- * Uses positional parameters (not a deps object) so the minifier can
12
- * rename every argument — no long property-name strings in the bundle.
13
- */
14
- import type { VListItem, VListEvents } from "../types";
15
- import type { Emitter } from "../events/emitter";
16
- import type { DOMStructure } from "./dom";
17
- import type { createElementPool } from "./pool";
18
- import type { BuilderContext, VListFeature, VList } from "./types";
19
- import type { MRefs } from "./materialize";
20
- export declare const createApi: <T extends VListItem = VListItem>($: MRefs<T>, dom: DOMStructure, emitter: Emitter<VListEvents<T>>, rendered: Map<number, HTMLElement>, pool: ReturnType<typeof createElementPool>, methods: Map<string, Function>, sortedFeatures: VListFeature<T>[], destroyHandlers: Array<() => void>, ctx: BuilderContext<T>, isReverse: boolean, wrapEnabled: boolean, handleClick: (event: MouseEvent) => void, handleDblClick: (event: MouseEvent) => void, handleContextMenu: (event: MouseEvent) => void, handleKeydown: (event: KeyboardEvent) => void, onScrollFrame: () => void, resizeObserver: ResizeObserver, disconnectItemObserver: () => void, clearIdleTimer: () => void) => VList<T>;
21
- //# sourceMappingURL=api.d.ts.map
@@ -1,36 +0,0 @@
1
- /**
2
- * vlist/builder - BuilderContext Factory
3
- * Central state container that features receive during setup.
4
- *
5
- * The BuilderContext provides access to all core components plus
6
- * registration points for handlers, methods, and cleanup callbacks.
7
- */
8
- import type { VListItem, VListEvents } from "../types";
9
- import type { SizeCache } from "../rendering/sizes";
10
- import type { Renderer, DOMStructure } from "../rendering/renderer";
11
- import type { SimpleDataManager } from "./data";
12
- import type { ScrollController } from "../features/scrollbar/controller";
13
- import type { Emitter } from "../events/emitter";
14
- import type { BuilderConfig, BuilderContext, BuilderState, ResolvedBuilderConfig } from "./types";
15
- /** Options for creating a BuilderContext */
16
- export interface CreateBuilderContextOptions<T extends VListItem = VListItem> {
17
- rawConfig: BuilderConfig<T>;
18
- resolvedConfig: ResolvedBuilderConfig;
19
- dom: DOMStructure;
20
- sizeCache: SizeCache;
21
- dataManager: SimpleDataManager<T>;
22
- scrollController: ScrollController;
23
- renderer: Renderer<T>;
24
- emitter: Emitter<VListEvents<T>>;
25
- initialState: BuilderState;
26
- initialSizeConfig: number | ((index: number) => number);
27
- }
28
- /**
29
- * Create a BuilderContext from individual components.
30
- *
31
- * The context acts as the central hub that features wire into.
32
- * Unlike VListContext (used by the monolithic factory), BuilderContext
33
- * exposes registration arrays and replacement methods for features.
34
- */
35
- export declare const createBuilderContext: <T extends VListItem = VListItem>(options: CreateBuilderContextOptions<T>) => BuilderContext<T>;
36
- //# sourceMappingURL=context.d.ts.map
@@ -1,16 +0,0 @@
1
- /**
2
- * vlist/builder — Composable virtual list builder
3
- *
4
- * Pure utilities (velocity, DOM, pool, range, scroll) live in sibling files.
5
- * Size cache and emitter are reused from rendering/ and events/ modules.
6
- * Bun.build inlines everything into a single bundle automatically.
7
- *
8
- * Features compose functionality *around* the hot path via extension points:
9
- * afterScroll, clickHandlers, keydownHandlers, resizeHandlers, destroyHandlers,
10
- * and the methods Map for public API extension.
11
- */
12
- import type { VListItem } from "../types";
13
- import type { BuilderConfig, VListBuilder } from "./types";
14
- export type { CompressionState } from "../rendering/viewport";
15
- export declare const vlist: <T extends VListItem = VListItem>(config: BuilderConfig<T>) => VListBuilder<T>;
16
- //# sourceMappingURL=core.d.ts.map
@@ -1,71 +0,0 @@
1
- /**
2
- * vlist/builder - Lightweight In-Memory Data Manager
3
- *
4
- * A minimal data manager that stores items in a plain array.
5
- * No sparse storage, no placeholders, no async adapter support.
6
- *
7
- * This keeps the builder core small (~12 KB). When the user installs
8
- * withData(), that feature replaces this manager with the full
9
- * adapter-backed data manager from src/data/manager.ts.
10
- */
11
- import type { VListItem, Range } from "../types";
12
- /** Minimal data state */
13
- export interface SimpleDataState<_T extends VListItem = VListItem> {
14
- total: number;
15
- cached: number;
16
- isLoading: boolean;
17
- pendingRanges: Range[];
18
- error: Error | undefined;
19
- hasMore: boolean;
20
- cursor: string | undefined;
21
- }
22
- /**
23
- * SimpleDataManager — the same interface as the full DataManager,
24
- * but backed by a plain array instead of sparse storage + placeholders.
25
- *
26
- * Only the methods used by the builder core and features are implemented.
27
- * Adapter-related methods (loadRange, ensureRange, loadInitial, loadMore,
28
- * reload, evictDistant) are no-ops or stubs.
29
- */
30
- export interface SimpleDataManager<T extends VListItem = VListItem> {
31
- getState: () => SimpleDataState<T>;
32
- getTotal: () => number;
33
- getCached: () => number;
34
- getIsLoading: () => boolean;
35
- getHasMore: () => boolean;
36
- getStorage: () => unknown;
37
- getPlaceholders: () => unknown;
38
- getItem: (index: number) => T | undefined;
39
- getIndexById: (id: string | number) => number;
40
- isItemLoaded: (index: number) => boolean;
41
- getItemsInRange: (start: number, end: number) => T[];
42
- setTotal: (total: number) => void;
43
- setItems: (items: T[], offset?: number, total?: number) => void;
44
- updateItem: (index: number, updates: Partial<T>) => boolean;
45
- insertItem: (item: T, index: number) => void;
46
- removeItem: (id: string | number) => boolean;
47
- loadRange: (start: number, end: number) => Promise<void>;
48
- ensureRange: (start: number, end: number) => Promise<void>;
49
- loadInitial: () => Promise<void>;
50
- loadMore: (direction?: "down" | "up") => Promise<boolean>;
51
- reload: () => Promise<void>;
52
- evictDistant: (visibleStart: number, visibleEnd: number) => void;
53
- clear: () => void;
54
- reset: () => void;
55
- }
56
- export interface SimpleDataManagerConfig<T extends VListItem = VListItem> {
57
- initialItems?: T[];
58
- initialTotal?: number;
59
- onStateChange?: (state: SimpleDataState<T>) => void;
60
- onItemsLoaded?: (items: T[], offset: number, total: number) => void;
61
- }
62
- /**
63
- * Create a lightweight in-memory data manager.
64
- *
65
- * Items are stored in a plain array. ID lookups use a Map.
66
- * No sparse storage, no placeholders, no chunking, no eviction.
67
- *
68
- * ~1 KB minified vs ~8 KB for the full data manager.
69
- */
70
- export declare const createSimpleDataManager: <T extends VListItem = VListItem>(config?: SimpleDataManagerConfig<T>) => SimpleDataManager<T>;
71
- //# sourceMappingURL=data.d.ts.map
@@ -1,15 +0,0 @@
1
- /**
2
- * vlist/builder — DOM Structure
3
- * Container resolution and DOM scaffold creation for the virtual list.
4
- */
5
- export interface DOMStructure {
6
- root: HTMLElement;
7
- viewport: HTMLElement;
8
- content: HTMLElement;
9
- items: HTMLElement;
10
- /** Visually-hidden live region for screen reader range announcements */
11
- liveRegion: HTMLElement;
12
- }
13
- export declare const resolveContainer: (container: HTMLElement | string) => HTMLElement;
14
- export declare const createDOMStructure: (container: HTMLElement, classPrefix: string, ariaLabel?: string, horizontal?: boolean, interactive?: boolean) => DOMStructure;
15
- //# sourceMappingURL=dom.d.ts.map
@@ -1,25 +0,0 @@
1
- /**
2
- * vlist/builder - Composable Virtual List Builder
3
- * Pick only the features you need, pay only for what you ship.
4
- *
5
- * @example
6
- * ```ts
7
- * import { vlist } from 'vlist/builder'
8
- * import { withSelection } from 'vlist/selection'
9
- * import { withScrollbar } from 'vlist/scroll'
10
- *
11
- * const list = vlist({
12
- * container: '#app',
13
- * item: { height: 48, template: renderItem },
14
- * items: data,
15
- * })
16
- * .use(withSelection({ mode: 'multiple' }))
17
- * .use(withScrollbar())
18
- * .build()
19
- * ```
20
- *
21
- * @packageDocumentation
22
- */
23
- export { vlist } from "./core";
24
- export type { VListBuilder, VList, BuilderConfig, VListConfig, VListFeature, FeatureFactory, BuilderContext, ReloadOptions, BuilderState, ResolvedBuilderConfig, } from "./types";
25
- //# sourceMappingURL=index.d.ts.map