@ixfx/components 0.7.5 → 0.8.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/bundle/index.d.ts +256 -17
- package/bundle/index.d.ts.map +1 -1
- package/bundle/index.js +1461 -165
- package/bundle/index.js.map +1 -1
- package/dist/ac-token.js +1 -1
- package/dist/{data-grid-CtJ35v8L.d.ts → data-grid-D-z7bx5-.d.ts} +2 -2
- package/dist/{data-grid-CtJ35v8L.d.ts.map → data-grid-D-z7bx5-.d.ts.map} +1 -1
- package/dist/data-grid.d.ts +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/{detail-list-BS5dRDda.d.ts → detail-list-_ZJHYEBr.d.ts} +3 -3
- package/dist/{detail-list-BS5dRDda.d.ts.map → detail-list-_ZJHYEBr.d.ts.map} +1 -1
- package/dist/detail-list.d.ts +2 -2
- package/dist/detail-list.js +1 -1
- package/dist/grid-list-nRUQOcEL.js +1537 -0
- package/dist/grid-list-nRUQOcEL.js.map +1 -0
- package/dist/{grid-list-D-GbghSH.d.ts → grid-list-u33vmKzb.d.ts} +116 -15
- package/dist/grid-list-u33vmKzb.d.ts.map +1 -0
- package/dist/grid-list.d.ts +1 -1
- package/dist/grid-list.js +1 -993
- package/dist/{incr-search-DpbSJtgj.js → incr-search-C05WjbZh.js} +40 -3
- package/dist/incr-search-C05WjbZh.js.map +1 -0
- package/dist/incr-search.d.ts +2 -2
- package/dist/incr-search.js +2 -2
- package/dist/{index-CBS4z1v-.d.ts → index-h6gxtfHH.d.ts} +34 -2
- package/dist/index-h6gxtfHH.d.ts.map +1 -0
- package/dist/index.d.ts +60 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +342 -15
- package/dist/index.js.map +1 -1
- package/dist/led.d.ts +33 -1
- package/dist/led.d.ts.map +1 -1
- package/dist/led.js +157 -13
- package/dist/led.js.map +1 -1
- package/dist/miller.d.ts +1 -1
- package/dist/miller.js +1 -1
- package/dist/narrowed-text.js +1 -1
- package/dist/panel.d.ts +3 -1
- package/dist/panel.d.ts.map +1 -1
- package/dist/panel.js +31 -1
- package/dist/panel.js.map +1 -1
- package/dist/plots.d.ts +2 -2
- package/dist/plots.js +1 -1
- package/dist/{titlebar-Bj5pfdw_.d.ts → titlebar-YQ-jVQoS.d.ts} +2 -2
- package/dist/{titlebar-Bj5pfdw_.d.ts.map → titlebar-YQ-jVQoS.d.ts.map} +1 -1
- package/dist/titlebar.d.ts +1 -1
- package/dist/titlebar.js +83 -1
- package/dist/titlebar.js.map +1 -1
- package/dist/{tree-DAii2A1g.js → tree-Chptss7I.js} +2 -2
- package/dist/{tree-DAii2A1g.js.map → tree-Chptss7I.js.map} +1 -1
- package/dist/tree.d.ts +1 -1
- package/dist/tree.js +1 -1
- package/dist/{vertical-list-DwtCPy1b.d.ts → vertical-list-CFuFDygi.d.ts} +2 -2
- package/dist/{vertical-list-DwtCPy1b.d.ts.map → vertical-list-CFuFDygi.d.ts.map} +1 -1
- package/dist/vertical-list.d.ts +1 -1
- package/dist/vertical-list.js +1 -1
- package/dist/{xy-axis-5KhVTNoX.d.ts → xy-axis-BfP9hKLj.d.ts} +25 -2
- package/dist/{xy-axis-5KhVTNoX.d.ts.map → xy-axis-BfP9hKLj.d.ts.map} +1 -1
- package/dist/{xy-axis-VrX8dmvS.js → xy-axis-DzM1brBZ.js} +141 -8
- package/dist/xy-axis-DzM1brBZ.js.map +1 -0
- package/docs-user/grid-list.md +99 -14
- package/docs-user/index.json +3 -3
- package/docs-user/led.md +37 -7
- package/docs-user/llms.txt +1 -1
- package/docs-user/panel.md +68 -13
- package/docs-user/titlebar.md +3 -4
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/dist/grid-list-D-GbghSH.d.ts.map +0 -1
- package/dist/grid-list.js.map +0 -1
- package/dist/incr-search-DpbSJtgj.js.map +0 -1
- package/dist/index-CBS4z1v-.d.ts.map +0 -1
- package/dist/xy-axis-VrX8dmvS.js.map +0 -1
package/docs-user/panel.md
CHANGED
|
@@ -24,8 +24,9 @@ The header chrome is an `ixfx-titlebar` (see [`ixfx-titlebar`](../titlebar/READM
|
|
|
24
24
|
| `title` | string | `''` | Panel title text |
|
|
25
25
|
| `icon-name` | string | `''` | Icon name from the registry |
|
|
26
26
|
| `closable` | boolean | `false` | Shows a close button that removes the panel |
|
|
27
|
+
| `keep-toolbar` | boolean | `false` | Keep the toolbar visible even when collapsed |
|
|
27
28
|
| `toggle-interaction` | `'implicit'` \| `'explicit'` \| `'disabled'` | `'implicit'` | How users can toggle the panel (see below) |
|
|
28
|
-
| `variant` | `'titlebar'` \| `'midline'`
|
|
29
|
+
| `variant` | `'titlebar'` \| `'midline'` \| `'tree'` | `'titlebar'` | Visual style of the panel |
|
|
29
30
|
|
|
30
31
|
### Toggle interaction modes
|
|
31
32
|
|
|
@@ -49,10 +50,10 @@ Set `collapsible` to `false` (via property binding or JS — `collapsible` defau
|
|
|
49
50
|
|
|
50
51
|
### Slots
|
|
51
52
|
|
|
52
|
-
| Slot | Description
|
|
53
|
-
|
|
54
|
-
| default | Panel content (shown when expanded)
|
|
55
|
-
| `toolbar` | Buttons or other elements in the title bar toolbar |
|
|
53
|
+
| Slot | Description |
|
|
54
|
+
|-------------|-----------------------------------------------------------------|
|
|
55
|
+
| default | Panel content (shown when expanded) |
|
|
56
|
+
| `toolbar` | Buttons or other elements in the title bar toolbar (hidden when collapsed by default; set `keep-toolbar` to always show) |
|
|
56
57
|
|
|
57
58
|
### Events
|
|
58
59
|
|
|
@@ -113,6 +114,20 @@ A lightweight, minimal style with a horizontal line running through the title te
|
|
|
113
114
|
- The line is visible between the title text and toolbar buttons
|
|
114
115
|
- Useful for section headers or metadata display
|
|
115
116
|
|
|
117
|
+
### `tree` variant
|
|
118
|
+
|
|
119
|
+
A VS Code explorer / Outline style with a minimal inline title bar:
|
|
120
|
+
|
|
121
|
+
```html
|
|
122
|
+
<ixfx-panel title="Explorer" variant="tree" icon-name="folder">
|
|
123
|
+
<p>Content here</p>
|
|
124
|
+
</ixfx-panel>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
- Caret is shown first, followed by the icon and title inline (no debossed line)
|
|
128
|
+
- Transparent background and border; minimal padding
|
|
129
|
+
- Toolbar is hidden when the panel is collapsed — set `keep-toolbar` to always show it
|
|
130
|
+
|
|
116
131
|
---
|
|
117
132
|
|
|
118
133
|
## Vertical orientation
|
|
@@ -189,18 +204,19 @@ Use the `collapsed` attribute to start the panel in collapsed state:
|
|
|
189
204
|
|
|
190
205
|
## `ixfx-panel-group`
|
|
191
206
|
|
|
192
|
-
A container component that manages multiple panels with
|
|
207
|
+
A container component that manages multiple panels with flexible open behavior.
|
|
193
208
|
|
|
194
209
|
### Properties / attributes
|
|
195
210
|
|
|
196
211
|
| Attribute / Property | Type | Default | Description |
|
|
197
212
|
|------------------------|---------------------------------------------------|----------------|---------------------------------------------------------------|
|
|
213
|
+
| `accordion` | boolean | `false` | Restrict to one open panel at a time |
|
|
214
|
+
| `allow-reorder` | boolean | `false` | Enable drag-and-drop reordering of panels via their titlebars |
|
|
215
|
+
| `collapsible` | boolean | `true` | Collapse behaviour propagated to child panels |
|
|
216
|
+
| `gap` | string | (unset) | Explicit gap between panels; sets `--group-gap` when provided |
|
|
198
217
|
| `orientation` | `'horizontal'` \| `'vertical'` | `'horizontal'` | Layout direction of the group |
|
|
199
|
-
| `variant` | `'titlebar'` \| `'midline'` | `'titlebar'` | Visual style applied to all child panels |
|
|
200
218
|
| `toggle-interaction` | `'implicit'` \| `'explicit'` \| `'disabled'` | `'implicit'` | Toggle behavior applied to all child panels |
|
|
201
|
-
| `
|
|
202
|
-
| `collapsible` | boolean | `true` | Collapse behaviour propagated to child panels |
|
|
203
|
-
| `gap` | string | `'var(--space-m)'` | CSS gap between panels |
|
|
219
|
+
| `variant` | `'titlebar'` \| `'midline'` \| `'tree'` | `'titlebar'` | Visual style applied to all child panels |
|
|
204
220
|
|
|
205
221
|
### Group orientation vs child panel orientation
|
|
206
222
|
|
|
@@ -231,14 +247,53 @@ Explicit attributes on child panels take precedence over group-propagated values
|
|
|
231
247
|
</ixfx-panel-group>
|
|
232
248
|
```
|
|
233
249
|
|
|
234
|
-
By default,
|
|
250
|
+
By default, multiple panels can be open at the same time. Add `accordion` to restrict it to one open panel at a time:
|
|
235
251
|
|
|
236
252
|
```html
|
|
237
|
-
<ixfx-panel-group orientation="horizontal"
|
|
253
|
+
<ixfx-panel-group orientation="horizontal" accordion>
|
|
238
254
|
<!-- panels -->
|
|
239
255
|
</ixfx-panel-group>
|
|
240
256
|
```
|
|
241
257
|
|
|
258
|
+
### Reordering
|
|
259
|
+
|
|
260
|
+
Set `allow-reorder` to let users rearrange panels by dragging their titlebars (pointer-only in v1; keyboard reorder is not included):
|
|
261
|
+
|
|
262
|
+
```html
|
|
263
|
+
<ixfx-panel-group orientation="vertical" allow-reorder>
|
|
264
|
+
<ixfx-panel title="Panel 1">...</ixfx-panel>
|
|
265
|
+
<ixfx-panel title="Panel 2">...</ixfx-panel>
|
|
266
|
+
</ixfx-panel-group>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Dragging starts anywhere on the titlebar except interactive chrome (buttons, toolbar slot, caret/close) — those controls always win over dragging. A drop-caret marks the insertion point and a floating ghost styled like the titlebar follows the pointer. Text selection is suppressed for the duration of the drag. Press <kbd>Esc</kbd> to abort a drag. The trailing click after a real reorder is swallowed so the panel doesn't also collapse/expand.
|
|
270
|
+
|
|
271
|
+
#### Events
|
|
272
|
+
|
|
273
|
+
| Event | Detail | Description |
|
|
274
|
+
|-----------|-------------------------------------------------|--------------------------------------|
|
|
275
|
+
| `reorder` | `{ fromIndex, toIndex, panel }` | Fired after panels are reordered |
|
|
276
|
+
|
|
277
|
+
`fromIndex` / `toIndex` are positions in the group's real light-DOM `children` (which may include non-panel elements), not positions in the filtered panel list.
|
|
278
|
+
|
|
279
|
+
```js
|
|
280
|
+
group.addEventListener('reorder', e => {
|
|
281
|
+
console.log('Moved from', e.detail.fromIndex, 'to', e.detail.toIndex);
|
|
282
|
+
});
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Group gap
|
|
286
|
+
|
|
287
|
+
The space between panels is controlled by the `--group-gap` CSS custom property, falling back to `var(--space-l)` when unset:
|
|
288
|
+
|
|
289
|
+
```css
|
|
290
|
+
ixfx-panel-group {
|
|
291
|
+
--group-gap: var(--space-xl);
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Alternatively set the `gap` property/attribute for the same effect (it mirrors its value into `--group-gap`).
|
|
296
|
+
|
|
242
297
|
### Group-propagated properties
|
|
243
298
|
|
|
244
299
|
When you set `variant`, `toggle-interaction` or `collapsible` on the group, those values are automatically applied to all child panels that don't have an explicit value set. This simplifies declaration when all panels in a group share the same styling:
|
|
@@ -256,7 +311,7 @@ When you set `variant`, `toggle-interaction` or `collapsible` on the group, thos
|
|
|
256
311
|
## TypeScript types
|
|
257
312
|
|
|
258
313
|
```ts
|
|
259
|
-
import type { PanelOrientation, PanelVariant, PanelToggleInteraction, PanelToggleDetail, PanelGroupOrientation } from 'ixfxfun-components';
|
|
314
|
+
import type { PanelOrientation, PanelVariant, PanelToggleInteraction, PanelToggleDetail, PanelGroupOrientation, PanelGroupReorderDetail } from 'ixfxfun-components';
|
|
260
315
|
// Canonical titlebar types (Panel* are aliases):
|
|
261
316
|
import type { TitlebarOrientation, TitlebarVariant, TitlebarToggleInteraction, TitlebarToggleDetail } from 'ixfxfun-components';
|
|
262
317
|
```
|
package/docs-user/titlebar.md
CHANGED
|
@@ -23,7 +23,7 @@ Standalone titlebar chrome extracted from `ixfx-panel`: title text, icon, toolba
|
|
|
23
23
|
| `title` | string | `''` | Title text |
|
|
24
24
|
| `icon-name` | string | `''` | Icon name from the registry |
|
|
25
25
|
| `orientation` | `'horizontal'` \| `'vertical'` | `'horizontal'` | Layout direction of the bar |
|
|
26
|
-
| `variant` | `'titlebar'` \| `'midline'`
|
|
26
|
+
| `variant` | `'titlebar'` \| `'midline'` \| `'tree'` | `'titlebar'` | Visual style (same variants as `ixfx-panel`) |
|
|
27
27
|
| `closable` | boolean | `false` | Shows a close button that fires `close` |
|
|
28
28
|
| `collapsible` | boolean | `false` | Shows the caret and enables toggle behaviour (opt-in) |
|
|
29
29
|
| `collapsed` | boolean | `false` | Collapsed state (controls caret rotation / label) |
|
|
@@ -79,11 +79,10 @@ Built-in icon names: `check`, `chevron-down`, `chevron-right`, `close`.
|
|
|
79
79
|
|
|
80
80
|
## Visual variants
|
|
81
81
|
|
|
82
|
-
Same `titlebar` (default) and `midline` styles as `ixfx-panel`, including vertical orientation support:
|
|
82
|
+
Same `titlebar` (default) and `midline` styles as `ixfx-panel`, including vertical orientation support. The `tree` variant renders caret, icon and title in a compact inline layout with transparent chrome, matching VS Code explorer / Outline style:
|
|
83
83
|
|
|
84
84
|
```html
|
|
85
|
-
<ixfx-titlebar title="
|
|
86
|
-
<ixfx-titlebar title="Device" orientation="vertical" icon-name="server" collapsible></ixfx-titlebar>
|
|
85
|
+
<ixfx-titlebar title="Explorer" variant="tree" icon-name="folder" collapsible></ixfx-titlebar>
|
|
87
86
|
```
|
|
88
87
|
|
|
89
88
|
---
|
package/llms.txt
CHANGED
|
@@ -30,7 +30,7 @@ import '@ixfx/components/data-grid';
|
|
|
30
30
|
- [labelled-radial-input](docs-user/labelled-radial-input.md): A composite radial input that pairs an editable label (`ixfx-editable-number`) with a rotary dial (`ixfx-radial-input`). The two controls are always in sync — turning the dial updates the number, and
|
|
31
31
|
- [labelled-range-input](docs-user/labelled-range-input.md): A composite range input that pairs an editable label (`ixfx-editable-number`) with a slider (`ixfx-range-input`). The two controls are always in sync — dragging the slider updates the number, and edit
|
|
32
32
|
- [labelled-slider-input](docs-user/labelled-slider-input.md): A composite slider input that pairs an editable label (`ixfx-editable-number`) with a slider (`ixfx-slider-input`). The two controls are always in sync — dragging the slider updates the number, and ed
|
|
33
|
-
- [led](docs-user/led.md): An LED indicator component with color mixing and
|
|
33
|
+
- [led](docs-user/led.md): An LED indicator component with color mixing and brightness, blink, and pulse modes.
|
|
34
34
|
- [menu](docs-user/menu.md): A custom menu system built on native HTML popovers with keyboard navigation, tickled focus management, and command routing.
|
|
35
35
|
- [miller](docs-user/miller.md): A Miller column component displays hierarchical data as multiple vertical columns, like macOS Finder or email clients. Each column shows the children of the selected item in the previous column.
|
|
36
36
|
- [narrowed-text](docs-user/narrowed-text.md): A filtered text selection component with inline search. Shows slotted items filtered by a query string as the user types.
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grid-list-D-GbghSH.d.ts","names":[],"sources":["../src/grid-list/types.ts","../src/interaction/list-selection-controller.ts","../src/grid-list/grid-list.ts"],"mappings":";;;;;;;;;;;;;;;;;KA8BY;;KAGA;;KAGA;;;;;;;;KASA;;;;;;;;KASA;UAEK;WACN,UAAU,YAAY;WACtB,UAAU,YAAY;;WAEtB,cAAc;;KAGb,sBAAsB,YAAY;UAE7B;WACN,MAAM;;KAGL,wBAAwB,YAAY;UAE/B;WACN,MAAM;;KAGL,yBAAyB,YAAY;UAEhC;WACN,MAAM;;KAGL,sBAAsB,YAAY;UAE7B;EACf,eAAe;EACf,iBAAiB;EACjB,mBAAmB;EACnB,eAAe;;KAGL;WACD;;KAGC,8BAA8B,YAAY;UAErC,oCAAoC;EACnD,6BAA6B;;;;;KC9FnB;WACD;WACA;WACA;;KAGC;WACD,eAAe;WACf,iBAAiB;;;;;;;;KAShB,8BAA8B;;WAE/B,gCAAgC;;WAEhC,eAAe,MAAM;;WAErB,gBAAgB;;;;;;WAMhB,WAAW,UAAU,YAAY,IAAI,UAAU,YAAY;;;;;WAK3D,UAAU,MAAM;;;iBAIX,YAAY,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;cA4BrB,wBAAwB;;EAKvB,YAAA,QAAQ,8BAA8B;;MAK9C,YAAY,YAAY;;;;;;MASxB,gBAAgB;;MAehB,UAAU;;EAKd;;EAKA;;EAQA,QAAQ,MAAM;;EAUd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,oBAAoB;EAEtB,iBACE,cACA,UAAU,oCACV,oBAAoB"}
|
package/dist/grid-list.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"grid-list.js","names":["#items","#itemWrap","#cancelScrollRaf","#scrollRaf","#emitViewportChange","#currentWindow","#scrollItemIntoView","#onCellActivate","#searchRegistry","#effectiveSearchModes","#unregisterSearchCommands","#mutationObserver","#onChildrenChanged","#syncSearchCommands","#resizeObserver","#reflowTimer","#syncItems","#noteChildMutation","#entering","#viewportRef","#zoomAnchor","#applyZoomAnchor","#slotNameFor","#slotNames","#slotSeq","#rowHeight","#onScroll","#renderCell","#captionFor","#onCellClick","customElement"],"sources":["../src/grid-list/grid-list.ts"],"sourcesContent":["/* eslint-disable ts/no-unsafe-declaration-merging */\nimport type { CommandRegistry } from '@clinth/ui-commands';\nimport type { PropertyValues } from 'lit';\nimport type { ListSearchMode } from '../incr-search/index.js';\nimport type { ListInteractionMode, ListSelectionMode } from '../interaction/list-selection-types.js';\nimport type {\n GridListActivateDetail,\n GridListCaptionAlign,\n GridListCaptionBackdrop,\n GridListCaptionPosition,\n GridListCaptionStyle,\n GridListFullElementEventMap,\n GridListItemClickDetail,\n GridListOrientation,\n GridListSelectDetail,\n GridListTickleDetail,\n GridListViewportChangeDetail,\n} from './types.js';\nimport { createCommandRegistry } from '@clinth/ui-commands';\nimport { css, html, LitElement } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { createRef, ref } from 'lit/directives/ref.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport {\n createElementListSearchAdapter,\n LIST_SEARCH_MODES,\n ListSearchController,\n listSearchStyles,\n registerListSearchCommands,\n} from '../incr-search/index.js';\nimport { listItemFadeKeyframes, tickledItemStyles, tickledStyles } from '../interaction/index.js';\nimport { keyForElement } from '../interaction/keyed-list.js';\nimport { ListSelectionController } from '../interaction/list-selection-controller.js';\nimport { TickledController } from '../interaction/tickled-controller.js';\nimport { themeFallbacks } from '../styles/fallbacks.js';\nimport { scrollFadeStyles } from '../styles/scroll-fade.js';\nimport { safeCustomElement as customElement } from '../util/custom-elements.js';\n\nexport type {\n GridListActivateDetail,\n GridListActivateEvent,\n GridListCaptionAlign,\n GridListCaptionBackdrop,\n GridListCaptionPosition,\n GridListCaptionStyle,\n GridListElementEventMap,\n GridListFullElementEventMap,\n GridListItemClickDetail,\n GridListItemClickEvent,\n GridListOrientation,\n GridListSelectDetail,\n GridListSelectEvent,\n GridListTickleDetail,\n GridListTickleEvent,\n GridListViewportChangeDetail,\n GridListViewportChangeEvent,\n ListInteractionMode,\n ListSelectionMode,\n} from './types.js';\n\ntype GridWindow = {\n readonly cols: number;\n readonly rows: number;\n /** Spacer height in px (vertical orientations); 0 when CSS controls it. */\n readonly totalHeight: number;\n /** Spacer width in px (`row` orientation); 0 when CSS controls it. */\n readonly totalWidth: number;\n readonly startIndex: number;\n readonly endIndex: number;\n /** Distance between the left edges of adjacent columns (item width + gap). */\n readonly colStride: number;\n /** Distance between the top edges of adjacent rows (row height + gap). */\n readonly rowStride: number;\n /** `true` for `row` orientation — the list scrolls along the x axis. */\n readonly horizontal: boolean;\n};\n\nconst ITEM_SELECTOR = `:scope > *`;\n\nconst MIN_ITEM_SIZE = 16;\n\n/**\n * How long the host keeps the `[reflowing]` attribute after items are inserted\n * mid-list — long enough for the cell move-transition and the enter animation\n * to finish. Kept a touch above the default `--grid-list-item-move-duration`.\n */\nconst REFLOW_WINDOW_MS = 320;\n\n// `itemWidth` is the square's width; `rowHeight` is the full cell height\n// (square, plus the caption band in `labelled` style). `scrollOffset` is\n// `scrollTop` for `grid`/`column` and `scrollLeft` for `row`.\nfunction computeGridWindow(\n count: number,\n itemWidth: number,\n rowHeight: number,\n gap: number,\n viewportWidth: number,\n viewportHeight: number,\n scrollOffset: number,\n orientation: GridListOrientation,\n overscan = 2,\n): GridWindow {\n const w = Math.max(1, itemWidth);\n const h = Math.max(1, rowHeight);\n const g = Math.max(0, gap);\n const colStride = w + g;\n const rowStride = h + g;\n const offset = Math.max(0, scrollOffset);\n\n if (orientation === `row`) {\n const rows = count === 0 ? 0 : 1;\n const totalWidth = count === 0 ? 0 : (count - 1) * colStride + w;\n if (count === 0 || viewportWidth <= 0) {\n return { cols: count, rows, totalHeight: 0, totalWidth, startIndex: 0, endIndex: 0, colStride, rowStride, horizontal: true };\n }\n const firstVisible = Math.max(0, Math.floor(offset / colStride));\n const lastVisible = Math.ceil((offset + viewportWidth) / colStride);\n return {\n cols: count,\n rows,\n totalHeight: 0,\n totalWidth,\n startIndex: Math.max(0, firstVisible - overscan),\n endIndex: Math.min(count, lastVisible + overscan),\n colStride,\n rowStride,\n horizontal: true,\n };\n }\n\n const cols = orientation === `column`\n ? 1\n : Math.max(1, Math.floor((Math.max(0, viewportWidth) + g) / colStride));\n const rows = count === 0 ? 0 : Math.ceil(count / cols);\n const totalHeight = rows === 0 ? 0 : (rows - 1) * rowStride + h;\n\n if (count === 0 || viewportHeight <= 0) {\n return { cols, rows, totalHeight, totalWidth: 0, startIndex: 0, endIndex: 0, colStride, rowStride, horizontal: false };\n }\n\n const firstVisibleRow = Math.max(0, Math.floor(offset / rowStride));\n const lastVisibleRow = Math.ceil((offset + viewportHeight) / rowStride);\n const rowStart = Math.max(0, firstVisibleRow - overscan);\n const rowEnd = Math.min(rows, lastVisibleRow + overscan);\n\n return {\n cols,\n rows,\n totalHeight,\n totalWidth: 0,\n startIndex: rowStart * cols,\n endIndex: Math.min(count, rowEnd * cols),\n colStride,\n rowStride,\n horizontal: false,\n };\n}\n\nfunction columnOf(index: number, cols: number): number {\n return cols <= 1 ? 0 : index % cols;\n}\n\nfunction rowOf(index: number, cols: number): number {\n return cols <= 1 ? index : Math.floor(index / cols);\n}\n\n@customElement(`ixfx-grid-list`)\nexport class GridListElement extends LitElement {\n static override styles = [\n themeFallbacks,\n tickledStyles,\n tickledItemStyles,\n // Both axes are registered; `render()` applies whichever one matches the\n // current orientation to the viewport (see the `scroll-fade-*` class there).\n scrollFadeStyles(`x`),\n scrollFadeStyles(`y`),\n listItemFadeKeyframes,\n listSearchStyles,\n css`\n :host {\n --grid-list-item-bg: var(--item-bg);\n --grid-list-radius: var(--radius-m);\n --grid-list-gap: var(--space-xs);\n position: relative;\n display: block;\n height: 100%;\n min-height: 2em;\n overflow: hidden;\n user-select: none;\n background: var(--surface-3);\n color: var(--surface-3-text);\n border-radius: var(--radius-s);\n border: 1px solid var(--border);\n }\n :host(:focus-visible) {\n outline: 2px solid var(--accent);\n outline-offset: -2px;\n }\n .viewport {\n position: relative;\n height: 100%;\n overflow-y: auto;\n overflow-x: hidden;\n }\n :host([orientation=\"row\"]) .viewport {\n overflow-x: auto;\n overflow-y: hidden;\n }\n .spacer {\n position: relative;\n width: 100%;\n }\n .cell {\n position: absolute;\n inset: 0 auto auto 0;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n align-items: stretch;\n contain: layout style;\n border-radius: var(--grid-list-radius);\n }\n\n /* The square that holds the slotted content. */\n .thumb {\n position: relative;\n flex: 1;\n min-height: 0;\n display: flex;\n align-items: stretch;\n box-sizing: border-box;\n overflow: hidden;\n border-radius: 0;\n background: transparent;\n border: 1px solid transparent;\n transition: background var(--transition), border-color var(--transition);\n }\n .thumb ::slotted(*) {\n flex: 1;\n min-width: 0;\n min-height: 0;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n }\n .thumb ::slotted(*:empty)::after {\n content: \"Empty\";\n color: var(--surface-muted-text);\n font-size: var(--text-s);\n }\n ::slotted([hidden]) {\n display: none !important;\n }\n\n /* Selection / cursor wash — sits over the slotted content so it reads\n on photos and arbitrary DOM alike. */\n .thumb::after {\n content: \"\";\n position: absolute;\n inset: 0;\n pointer-events: none;\n border-radius: inherit;\n background: var(--accent);\n opacity: 0;\n transition: opacity var(--transition, 0.1s ease-out);\n }\n .cell.selected .thumb::after {\n opacity: 0.18;\n }\n\n /* ---- Caption (base) ---- */\n .caption {\n box-sizing: border-box;\n flex: none;\n padding: 3px 6px;\n font-size: var(--text-s, 0.8rem);\n line-height: 1.3;\n text-align: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: var(--surface-3-text);\n }\n :host([caption-align=\"left\"]) .caption { text-align: left; }\n :host([caption-align=\"right\"]) .caption { text-align: right; }\n\n /* ---- Box modes (hidden / under / overlaid): the cell is one box with a\n single selection outline ---- */\n :host(:not([caption-style=\"separate\"])) .cell {\n background: var(--grid-list-item-bg);\n border: 1px solid transparent;\n overflow: hidden;\n transition: background var(--transition), border-color var(--transition);\n }\n :host(:not([caption-style=\"separate\"])) .cell:hover,\n :host(:not([caption-style=\"separate\"])) .cell.tickled {\n background: var(--item-bg-tickled);\n border: var(--item-border-tickled);\n }\n :host(:not([caption-style=\"separate\"])) .cell.selected {\n outline: 2px solid var(--accent);\n outline-offset: -2px;\n }\n :host(:not([caption-style=\"separate\"])) .cell.selected.tickled {\n background: var(--item-bg-selected-tickled);\n outline: 2px dashed var(--surface-3);\n outline-offset: -2px;\n }\n\n /* under: caption is a strip inside the box, below the content */\n :host([caption-style=\"under\"]) .caption {\n border-top: 1px solid var(--border, rgba(128, 128, 128, 0.3));\n background: var(--surface-4, transparent);\n }\n\n /* overlaid: caption floats over the content */\n :host([caption-style=\"overlaid\"]) .caption {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n color: #fff;\n }\n :host([caption-style=\"overlaid\"][caption-position=\"top\"]) .caption {\n top: 0;\n bottom: auto;\n }\n :host([caption-style=\"overlaid\"][caption-position=\"middle\"]) .caption {\n top: 50%;\n bottom: auto;\n transform: translateY(-50%);\n }\n /* overlaid backdrop */\n :host([caption-style=\"overlaid\"][caption-backdrop=\"scrim\"]) .caption {\n background: rgba(0, 0, 0, 0.55);\n }\n :host([caption-style=\"overlaid\"][caption-backdrop=\"gradient\"]) .caption {\n background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));\n padding-block: 10px 4px;\n }\n :host([caption-style=\"overlaid\"][caption-backdrop=\"gradient\"][caption-position=\"top\"]) .caption {\n background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));\n padding-block: 4px 10px;\n }\n :host([caption-style=\"overlaid\"][caption-backdrop=\"gradient\"][caption-position=\"middle\"]) .caption {\n background: rgba(0, 0, 0, 0.5);\n padding-block: 3px;\n }\n :host([caption-style=\"overlaid\"][caption-backdrop=\"blur\"]) .caption {\n background: rgba(20, 20, 20, 0.3);\n backdrop-filter: blur(6px);\n -webkit-backdrop-filter: blur(6px);\n }\n :host([caption-style=\"overlaid\"][caption-backdrop=\"none\"]) .caption {\n background: none;\n text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.7);\n }\n\n /* ---- separate mode: square + detached caption, each highlighted ---- */\n :host([caption-style=\"separate\"]) .thumb {\n flex: none;\n border-radius: var(--grid-list-radius);\n background: var(--grid-list-item-bg);\n border: 1px solid transparent;\n }\n :host([caption-style=\"separate\"]) .cell:hover .thumb,\n :host([caption-style=\"separate\"]) .cell.tickled .thumb {\n background: var(--item-bg-tickled);\n border: var(--item-border-tickled);\n }\n :host([caption-style=\"separate\"]) .caption {\n display: flex;\n align-items: center;\n align-self: center;\n max-width: 100%;\n margin-top: 4px;\n border-radius: var(--radius-s, 4px);\n }\n :host([caption-style=\"separate\"][caption-align=\"left\"]) .caption { align-self: flex-start; }\n :host([caption-style=\"separate\"][caption-align=\"right\"]) .caption { align-self: flex-end; }\n :host([caption-style=\"separate\"]) .cell.selected .thumb {\n outline: 2px solid var(--accent);\n outline-offset: 2px;\n }\n :host([caption-style=\"separate\"]) .cell.selected.tickled .thumb {\n background: var(--item-bg-selected-tickled);\n outline: 2px dashed var(--surface-3);\n outline-offset: 2px;\n }\n :host([caption-style=\"separate\"]) .cell.selected .caption {\n background: var(--accent);\n color: var(--accent-text, #000);\n }\n :host([caption-style=\"separate\"]) .cell.tickled .caption {\n background: var(--item-bg-tickled);\n outline: var(--item-border-tickled);\n }\n :host([caption-style=\"separate\"]) .cell.selected.tickled .caption {\n background: var(--item-bg-selected-tickled);\n outline: 2px dashed var(--surface-3);\n outline-offset: -2px;\n }\n\n /* ---- Insertion / removal animation ----\n Active only while the host carries [reflowing] — the ~0.3s window after\n the child list changes mid-list (see #noteChildMutation). Kept out of\n the base rules so it never fires during scroll virtualisation, where\n cells are recycled to wildly different positions every frame. Placed\n last so it wins over the earlier cell transition rule regardless of\n specificity. Survivors slide to their new slot; a freshly inserted cell\n also fades in. (A removed item's element is already gone, so there's\n nothing left to fade — the gap simply closes as the others slide.) */\n :host([reflowing]) .cell {\n transition:\n transform var(--grid-list-item-move-duration, 200ms) cubic-bezier(0.2, 0, 0, 1),\n background var(--transition),\n border-color var(--transition);\n }\n .cell.entering {\n animation: ixfx-list-item-in var(--grid-list-item-move-duration, 200ms) ease both;\n }\n @media (prefers-reduced-motion: reduce) {\n :host([reflowing]) .cell { transition: background var(--transition), border-color var(--transition); }\n .cell.entering { animation: none; }\n }\n `,\n ];\n\n @property({ type: String, attribute: `selection-mode` })\n selectionMode: ListSelectionMode = `single`;\n\n @property({ type: String, attribute: `interaction-mode` })\n interactionMode: ListInteractionMode = `standard`;\n\n @property({ type: Number, attribute: `item-size` })\n itemSize = 160;\n\n @property({ type: Number })\n gap = 8;\n\n /**\n * Layout / scroll direction.\n * - `grid` (default): items wrap across as many columns as fit, scrolls vertically.\n * - `row`: a single row of items, scrolls horizontally.\n * - `column`: a single column of items, scrolls vertically.\n */\n @property({ type: String, reflect: true })\n orientation: GridListOrientation = `grid`;\n\n /**\n * How the caption relates to the content — see {@link GridListCaptionStyle}.\n * - `hidden`: no caption.\n * - `separate`: detached label below the square, each highlighted on its own.\n * - `under` (default): one box, content on top, caption strip below it inside.\n * - `overlaid`: caption floats over the content.\n */\n @property({ type: String, attribute: `caption-style`, reflect: true })\n captionStyle: GridListCaptionStyle = `under`;\n\n /** Horizontal alignment of the caption text: `left`, `middle` (default), `right`. */\n @property({ type: String, attribute: `caption-align`, reflect: true })\n captionAlign: GridListCaptionAlign = `middle`;\n\n /** `overlaid` only — vertical placement: `top`, `middle`, `bottom` (default). */\n @property({ type: String, attribute: `caption-position`, reflect: true })\n captionPosition: GridListCaptionPosition = `bottom`;\n\n /** `overlaid` only — backdrop behind the caption: `scrim` (default), `gradient`, `blur`, `none`. */\n @property({ type: String, attribute: `caption-backdrop`, reflect: true })\n captionBackdrop: GridListCaptionBackdrop = `scrim`;\n\n /**\n * Height reserved for the caption in `separate` / `under` styles, in pixels.\n * Ignored by `overlaid` and `hidden`.\n */\n @property({ type: Number, attribute: `caption-height` })\n captionHeight = 24;\n\n @property({ type: String, attribute: `item-wrap` })\n itemWrap: `stop` | `wrap` = `stop`;\n\n /**\n * Predicate used by incremental filter-search (and callable directly). Items\n * for which it returns `false` are removed from layout and navigation.\n */\n @property({ attribute: false })\n filterPredicate: ((el: Element) => boolean) | undefined;\n\n /**\n * Space-separated subset of `navigate select filter` — limits which\n * incremental-search modes are offered (as commands and in-popover switches).\n * Unset ⇒ all three; empty ⇒ search disabled. See `docs/infra-incremental.md`.\n */\n @property({ type: String, attribute: `search-modes`, reflect: true })\n searchModes: string | undefined;\n\n @state() private _scrollTop = 0;\n @state() private _scrollLeft = 0;\n @state() private _viewportHeight = 0;\n @state() private _viewportWidth = 0;\n\n #viewportRef = createRef<HTMLDivElement>();\n\n #resizeObserver?: ResizeObserver;\n #mutationObserver?: MutationObserver;\n #scrollRaf = 0;\n #items: Element[] = [];\n #itemWrap: `stop` | `wrap` = `stop`;\n\n /** Items added mid-list that are still playing their enter animation. */\n #entering = new Set<Element>();\n /** Timer that ends the `[reflowing]` window opened by a mid-list insertion. */\n #reflowTimer = 0;\n\n /**\n * When cell geometry changes (zoom), the item nearest the viewport centre is\n * captured here in `willUpdate` and the scroll position is corrected in\n * `updated` so that item stays put — rather than the grid anchoring to its\n * top-left corner.\n */\n #zoomAnchor?: { index: number; lineFrac: number };\n\n /**\n * Per-item slot name. Each cell renders its own named `<slot>` and the\n * matching light-DOM child carries `slot=\"<name>\"`, so a child is projected\n * into exactly one cell. (A single unnamed slot would collapse every child\n * into the first cell.)\n */\n #slotNames = new WeakMap<Element, string>();\n #slotSeq = 0;\n\n readonly selection = new ListSelectionController<Element>({\n getOrderedItems: () => this._getVisibleItems(),\n isSelectable: () => true,\n getModes: () => ({ selectionMode: this.selectionMode, interactionMode: this.interactionMode }),\n getKey: keyForElement,\n onChange: (selected, previous) => {\n this._syncItemStates();\n // ListSelectionController isn't a reactive controller, so nudge Lit to\n // re-render the cells with updated `selected` classes.\n this.requestUpdate();\n this._dispatch<GridListSelectDetail>(`list-select`, {\n selected,\n previous,\n selectedKeys: this.selection.selectedKeys,\n });\n },\n });\n\n readonly tickled = new TickledController<Element>(this, {\n getItems: () =>\n this.#items.map(el => ({\n id: el,\n enabled: !el.hasAttribute(`not-checked`),\n })),\n onTickle: (id) => {\n if (id !== undefined) {\n this._dispatch<GridListTickleDetail>(`list-tickle`, { item: id });\n }\n },\n onStateChange: () => this._syncItemStates(),\n itemWrap: this.#itemWrap,\n });\n\n /** Incremental search (navigate / select / filter). See `docs/infra-incremental.md`. */\n readonly search = new ListSearchController<Element>(this, {\n adapter: createElementListSearchAdapter(this, {\n itemSelector: ITEM_SELECTOR,\n getLabel: el =>\n el.getAttribute(`data-label`)\n ?? el.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()\n ?? el.getAttribute(`data-search-label`)\n ?? el.textContent?.trim()\n ?? ``,\n highlightKey: `grid-list-search`,\n }),\n });\n\n #searchRegistry: CommandRegistry<unknown> | undefined;\n #unregisterSearchCommands: (() => void) | undefined;\n\n /** Command registry carrying this grid's `list.search.*` commands. */\n get registry(): CommandRegistry<unknown> | undefined {\n return this.#searchRegistry;\n }\n\n /** Effective search modes: this component's capability (all three) ∩ the `search-modes` attribute. */\n #effectiveSearchModes(): ListSearchMode[] {\n const raw = this.searchModes?.trim();\n if (raw === undefined)\n return [...LIST_SEARCH_MODES];\n const requested = new Set(raw.split(/\\s+/));\n return LIST_SEARCH_MODES.filter(m => requested.has(m));\n }\n\n #syncSearchCommands(): void {\n if (!this.#searchRegistry)\n return;\n this.search.setModes(this.#effectiveSearchModes());\n this.#unregisterSearchCommands?.();\n this.#unregisterSearchCommands = registerListSearchCommands(this.#searchRegistry, this.search);\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (!this.hasAttribute(`tabindex`)) {\n this.tabIndex = 0;\n }\n // Reflect caption defaults up-front so the `:host([caption-*])` style rules\n // apply even when the consumer never sets the attributes.\n for (const [attr, value] of [\n [`caption-style`, this.captionStyle],\n [`caption-align`, this.captionAlign],\n [`caption-position`, this.captionPosition],\n [`caption-backdrop`, this.captionBackdrop],\n ] as const) {\n if (!this.hasAttribute(attr)) {\n this.setAttribute(attr, value);\n }\n }\n this.addEventListener(`keydown`, this._onKeyDown as EventListener);\n this.#mutationObserver ??= new MutationObserver(records => this.#onChildrenChanged(records));\n this.#mutationObserver.observe(this, { childList: true, attributeFilter: [`hidden`] });\n this.#searchRegistry ??= createCommandRegistry();\n this.#syncSearchCommands();\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener(`keydown`, this._onKeyDown as EventListener);\n this.#resizeObserver?.disconnect();\n this.#resizeObserver = undefined;\n this.#mutationObserver?.disconnect();\n this.#cancelScrollRaf();\n this.#unregisterSearchCommands?.();\n this.#unregisterSearchCommands = undefined;\n this.#searchRegistry = undefined;\n if (this.#reflowTimer) {\n clearTimeout(this.#reflowTimer);\n this.#reflowTimer = 0;\n }\n }\n\n #onChildrenChanged(records?: MutationRecord[]): void {\n const previousLength = this.#items.length;\n this.#syncItems();\n this._syncItemStates();\n this.#noteChildMutation(previousLength, records);\n this.requestUpdate();\n void this.updateComplete.then(() => this.#emitViewportChange());\n }\n\n /**\n * When the child list changes mid-list — not a first populate or a wholesale\n * replace — mark any newcomers for an enter animation and open a short\n * `[reflowing]` window so the cells that shift slide to their new position\n * instead of snapping. Removals get the same window (the survivors slide to\n * close the gap). The window is bounded in time so the transform transition\n * never bleeds into scroll virtualisation.\n *\n * Reads the `MutationRecord`s directly rather than diffing `#items`, because a\n * `requestUpdate()` between the DOM change and this callback (e.g. a caller\n * that clears the selection before removing) lets `updated()` re-sync `#items`\n * first, which would hide the change from a naive diff.\n */\n #noteChildMutation(previousLength: number, records?: MutationRecord[]): void {\n if (!this.hasUpdated || !records || records.length === 0)\n return;\n const currentSet = new Set(this.#items);\n const added: Element[] = [];\n let removedCount = 0;\n for (const record of records) {\n for (const node of record.addedNodes) {\n if (node.nodeType === Node.ELEMENT_NODE && currentSet.has(node as Element))\n added.push(node as Element);\n }\n for (const node of record.removedNodes) {\n if (node.nodeType === Node.ELEMENT_NODE)\n removedCount++;\n }\n }\n // Nothing to animate, a first populate, or a wholesale replace (every\n // current item is new) — leave it alone.\n if (added.length === 0 && removedCount === 0)\n return;\n if (previousLength === 0 && removedCount === 0)\n return;\n if (added.length > 0 && added.length === this.#items.length)\n return;\n for (const el of added)\n this.#entering.add(el);\n this.toggleAttribute(`reflowing`, true);\n if (this.#reflowTimer)\n clearTimeout(this.#reflowTimer);\n this.#reflowTimer = window.setTimeout(() => {\n this.#reflowTimer = 0;\n this.#entering.clear();\n this.toggleAttribute(`reflowing`, false);\n this.requestUpdate();\n }, REFLOW_WINDOW_MS);\n }\n\n #emitViewportChange(): void {\n this._dispatch<GridListViewportChangeDetail>(`grid-list-viewport-change`, {\n visibleKeys: this.visibleKeys(),\n });\n }\n\n protected override firstUpdated(): void {\n const el = this.#viewportRef.value;\n if (!el)\n return;\n this._viewportWidth = el.clientWidth;\n this._viewportHeight = el.clientHeight;\n this.#resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n this._viewportWidth = entry.contentRect.width;\n this._viewportHeight = entry.contentRect.height;\n }\n });\n this.#resizeObserver.observe(el);\n this.#syncItems();\n this.requestUpdate();\n }\n\n protected override willUpdate(changed: PropertyValues<this>): void {\n if (changed.has(`searchModes`)) {\n this.#syncSearchCommands();\n }\n if (changed.has(`filterPredicate`)) {\n this.#syncItems();\n }\n if (changed.has(`itemSize`) || changed.has(`gap`)) {\n this.itemSize = Math.max(MIN_ITEM_SIZE, Math.round(this.itemSize));\n this.gap = Math.max(0, Math.round(this.gap));\n }\n if (changed.has(`captionHeight`)) {\n this.captionHeight = Math.max(0, Math.round(this.captionHeight));\n }\n if (changed.has(`itemWrap`)) {\n this.#itemWrap = this.itemWrap;\n }\n\n const geometryChanged = changed.has(`itemSize`) || changed.has(`gap`)\n || changed.has(`captionStyle`) || changed.has(`captionHeight`)\n || changed.has(`orientation`);\n if (geometryChanged && this.hasUpdated && this.#items.length > 0) {\n const prevOrientation = (changed.get(`orientation`) as GridListOrientation | undefined) ?? this.orientation;\n const horizontal = prevOrientation === `row`;\n const prevOffset = horizontal ? this._scrollLeft : this._scrollTop;\n const prevExtent = horizontal ? this._viewportWidth : this._viewportHeight;\n if (prevExtent > 0 && prevOffset > 1) {\n const prevItemSize = (changed.get(`itemSize`) as number | undefined) ?? this.itemSize;\n const prevGap = (changed.get(`gap`) as number | undefined) ?? this.gap;\n const prevCaptionStyle = (changed.get(`captionStyle`) as GridListCaptionStyle | undefined) ?? this.captionStyle;\n const prevCaptionHeight = (changed.get(`captionHeight`) as number | undefined) ?? this.captionHeight;\n const prevBand = prevCaptionStyle === `separate` || prevCaptionStyle === `under`;\n const prevRowHeight = prevItemSize + (prevBand ? prevCaptionHeight : 0);\n const prev = computeGridWindow(\n this.#items.length,\n prevItemSize,\n prevRowHeight,\n prevGap,\n this._viewportWidth,\n this._viewportHeight,\n prevOffset,\n prevOrientation,\n );\n const mainStride = horizontal ? prev.colStride : prev.rowStride;\n const centerLine = (prevOffset + prevExtent / 2) / mainStride;\n const lineFloor = Math.max(0, Math.floor(centerLine));\n const index = horizontal\n ? Math.min(this.#items.length - 1, lineFloor)\n : Math.min(\n this.#items.length - 1,\n lineFloor * prev.cols + Math.max(0, Math.floor((prev.cols - 1) / 2)),\n );\n this.#zoomAnchor = { index, lineFrac: centerLine - lineFloor };\n }\n }\n }\n\n /** Full cell height: the square, plus a caption band in `separate` / `under`. */\n #rowHeight(): number {\n const captionBand = this.captionStyle === `separate` || this.captionStyle === `under`;\n return this.itemSize + (captionBand ? this.captionHeight : 0);\n }\n\n #captionFor(el: Element): string {\n return (\n el.getAttribute(`data-label`)\n ?? el.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()\n ?? ``\n );\n }\n\n protected override updated(changed: PropertyValues<this>): void {\n super.updated(changed);\n this.#syncItems();\n if (changed.has(`selectionMode`) || changed.has(`interactionMode`)) {\n this.selection.clearAnchor();\n }\n if (changed.has(`orientation`)) {\n // Reset the axis that's no longer scrollable so a later switch back\n // doesn't inherit a stale offset.\n const vp = this.#viewportRef.value;\n if (vp) {\n if (this.orientation === `row`) {\n vp.scrollTop = 0;\n this._scrollTop = 0;\n } else {\n vp.scrollLeft = 0;\n this._scrollLeft = 0;\n }\n }\n }\n this.#applyZoomAnchor();\n }\n\n /** Re-anchor the scroll so the item captured in `willUpdate` stays centred. */\n #applyZoomAnchor(): void {\n if (!this.#zoomAnchor)\n return;\n const { index, lineFrac } = this.#zoomAnchor;\n this.#zoomAnchor = undefined;\n\n const vp = this.#viewportRef.value;\n if (!vp)\n return;\n const win = this.#currentWindow();\n\n if (win.horizontal) {\n if (this._viewportWidth <= 0)\n return;\n const targetCenter = (index + lineFrac) * win.colStride;\n const maxScroll = Math.max(0, win.totalWidth - this._viewportWidth);\n const next = Math.min(maxScroll, Math.max(0, targetCenter - this._viewportWidth / 2));\n if (Math.abs(vp.scrollLeft - next) > 0.5) {\n vp.scrollLeft = next;\n this._scrollLeft = next;\n }\n return;\n }\n\n if (this._viewportHeight <= 0)\n return;\n const line = win.cols > 0 ? Math.floor(index / win.cols) : 0;\n const targetCenter = (line + lineFrac) * win.rowStride;\n const maxScroll = Math.max(0, win.totalHeight - this._viewportHeight);\n const next = Math.min(maxScroll, Math.max(0, targetCenter - this._viewportHeight / 2));\n if (Math.abs(vp.scrollTop - next) > 0.5) {\n vp.scrollTop = next;\n this._scrollTop = next;\n }\n }\n\n #syncItems(): void {\n this.#items = Array.from(this.querySelectorAll(ITEM_SELECTOR)).filter(el =>\n !(el as HTMLElement).hidden\n && (this.filterPredicate === undefined || this.filterPredicate(el)),\n );\n for (const el of this.#items) {\n const name = this.#slotNameFor(el);\n if (el.getAttribute(`slot`) !== name) {\n el.setAttribute(`slot`, name);\n }\n }\n }\n\n #slotNameFor(el: Element): string {\n let name = this.#slotNames.get(el);\n if (name === undefined) {\n this.#slotSeq += 1;\n name = `gl-item-${this.#slotSeq}`;\n this.#slotNames.set(el, name);\n }\n return name;\n }\n\n private _getVisibleItems(): Element[] {\n return this.#items.filter((el) => {\n if ((el as HTMLElement).hidden)\n return false;\n return true;\n });\n }\n\n get count(): number {\n return this.#items.length;\n }\n\n /**\n * Number of cells currently rendered in the shadow DOM. With virtualization\n * this is roughly the visible rows plus overscan, regardless of how large\n * `count` is — useful for demos/diagnostics.\n */\n get renderedCount(): number {\n return this.renderRoot.querySelectorAll(`.cell`).length;\n }\n\n get selectedItems(): ReadonlySet<Element> {\n return this.selection.selected;\n }\n\n /** The selection as stable `data-key` / `data-value` strings. */\n get selectedKeys(): ReadonlySet<string> {\n return this.selection.selectedKeys;\n }\n\n select(item: Element): void {\n this.selection.replace(item);\n }\n\n selectMany(items: Iterable<Element>): void {\n this.selection.selectMany(items);\n }\n\n deselect(item: Element): void {\n this.selection.deselect(item);\n }\n\n clearSelection(): void {\n this.selection.clear();\n }\n\n selectAll(): void {\n if (this.selection.canSelectAll()) {\n this.selection.selectAll();\n }\n }\n\n /**\n * Replace the selection with the items carrying these keys. Unknown keys are\n * ignored; survives the host rebuilding the item set. Requires each item to\n * have a `data-key` (or `data-value`).\n */\n selectKeys(keys: Iterable<string>): void {\n this.selection.selectKeys(keys, key => this.getItem(key));\n }\n\n /** Add items by key to the selection (multi-select modes only). */\n addSelectedKeys(keys: Iterable<string>): void {\n this.selection.addKeys(keys, key => this.getItem(key));\n }\n\n /** Remove items by key from the selection. */\n removeSelectedKeys(keys: Iterable<string>): void {\n this.selection.removeKeys(keys, key => this.getItem(key));\n }\n\n /** Move the cursor to the item with this key and scroll it into view. */\n focusKey(key: string): void {\n const el = this.getItem(key);\n if (!el)\n return;\n this.tickled.focus(el);\n this.#scrollItemIntoView(el);\n }\n\n /** The key of the item under the cursor, or `undefined`. */\n get tickledKey(): string | undefined {\n const id = this.tickled.tickledId;\n return id ? keyForElement(id) : undefined;\n }\n\n getItem(key: string): Element | undefined {\n return this.#items.find(el => keyForElement(el) === key);\n }\n\n getItemByIndex(index: number): Element | undefined {\n return this.#items[index];\n }\n\n getKey(item: Element): string | undefined {\n return keyForElement(item);\n }\n\n visibleKeys(): string[] {\n const win = this.#currentWindow();\n const slice = this.#items.slice(win.startIndex, win.endIndex);\n return slice\n .map(el => keyForElement(el))\n .filter((k): k is string => k !== undefined);\n }\n\n /** Adjust the scroll offset so `el` is fully within the viewport. */\n #scrollItemIntoView(el: Element): void {\n const index = this.#items.indexOf(el);\n const vp = this.#viewportRef.value;\n if (index < 0 || !vp)\n return;\n const win = this.#currentWindow();\n\n if (win.horizontal) {\n const left = index * win.colStride;\n const right = left + this.itemSize;\n const viewLeft = vp.scrollLeft;\n let next = viewLeft;\n if (left < viewLeft)\n next = left;\n else if (right > viewLeft + this._viewportWidth)\n next = right - this._viewportWidth;\n if (next !== viewLeft) {\n vp.scrollLeft = next;\n this._scrollLeft = next;\n }\n return;\n }\n\n const row = win.cols > 0 ? Math.floor(index / win.cols) : 0;\n const top = row * win.rowStride;\n const bottom = top + this.#rowHeight();\n const viewTop = vp.scrollTop;\n let next = viewTop;\n if (top < viewTop)\n next = top;\n else if (bottom > viewTop + this._viewportHeight)\n next = bottom - this._viewportHeight;\n if (next !== viewTop) {\n vp.scrollTop = next;\n this._scrollTop = next;\n }\n }\n\n private _syncItemStates(): void {\n for (const el of this.#items) {\n el.toggleAttribute(`data-tickled`, this.tickled.isTickled(el));\n el.toggleAttribute(`data-selected`, this.selection.selected.has(el));\n }\n this.setAttribute(`data-input-mode`, this.tickled.inputMode);\n }\n\n private _dispatch<T>(name: string, detail: T): void {\n this.dispatchEvent(\n new CustomEvent<T>(name, {\n detail,\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n protected override render(): ReturnType<typeof html> {\n const win = this.#currentWindow();\n const slice = this.#items.slice(win.startIndex, win.endIndex);\n const spacerStyle = win.horizontal\n ? `width:${win.totalWidth}px;height:100%`\n : `height:${win.totalHeight}px`;\n // Fade the edge that can still be scrolled towards (see ../styles/scroll-fade.ts).\n const scrollFade = win.horizontal ? `scroll-fade-x` : `scroll-fade-y`;\n return html`\n <div\n class=\"viewport ${scrollFade}\"\n part=\"viewport\"\n ${ref(this.#viewportRef)}\n data-input-mode=${this.tickled.inputMode}\n @scroll=${this.#onScroll}\n >\n <div class=\"spacer\" style=${spacerStyle}>\n ${repeat(\n slice,\n el => this.#slotNameFor(el),\n (el, i) => this.#renderCell(el, win.startIndex + i, win),\n )}\n </div>\n </div>\n ${this.search.renderField()}\n `;\n }\n\n #renderCell(el: Element, index: number, win: GridWindow): ReturnType<typeof html> {\n const selected = this.selection.selected.has(el);\n const tickled = this.tickled.isTickled(el);\n const entering = this.#entering.has(el);\n const style = this.captionStyle;\n const separate = style === `separate`;\n const caption = style === `hidden` ? `` : this.#captionFor(el);\n const showCaption = caption !== ``;\n const cellHeight = win.rowStride - this.gap;\n const x = win.horizontal ? index * win.colStride : columnOf(index, win.cols) * win.colStride;\n // `row`: a single row, vertically centred in the viewport.\n const y = win.horizontal\n ? Math.max(0, (this._viewportHeight - cellHeight) / 2)\n : rowOf(index, win.cols) * win.rowStride;\n const thumbStyle = separate ? `height:${this.itemSize}px` : ``;\n const captionCss = separate\n ? `height:${Math.max(0, this.captionHeight - 4)}px`\n : style === `under`\n ? `height:${this.captionHeight}px`\n : ``;\n return html`\n <div\n class=\"cell${selected ? ` selected` : ``}${tickled ? ` tickled` : ``}${entering ? ` entering` : ``}\"\n part=\"item\"\n style=\"width:${this.itemSize}px;height:${cellHeight}px;transform:translate(${x}px,${y}px)\"\n data-index=${index}\n @click=${(e: MouseEvent) => this.#onCellClick(e, el)}\n @dblclick=${() => this.#onCellActivate(el)}\n @pointerenter=${() => this.tickled.handlePointerEnter(el)}\n >\n <div class=\"thumb\" part=\"thumb\" style=${thumbStyle}>\n <slot name=${this.#slotNameFor(el)}></slot>\n </div>\n ${showCaption\n ? html`<div class=\"caption\" part=\"caption\" style=${captionCss}>${caption}</div>`\n : ``}\n </div>\n `;\n }\n\n #onScroll = (e: Event): void => {\n const el = e.target as HTMLDivElement;\n this.#cancelScrollRaf();\n this.#scrollRaf = requestAnimationFrame(() => {\n this.#scrollRaf = 0;\n this._scrollTop = el.scrollTop;\n this._scrollLeft = el.scrollLeft;\n this.#emitViewportChange();\n });\n };\n\n #cancelScrollRaf(): void {\n if (this.#scrollRaf !== 0) {\n cancelAnimationFrame(this.#scrollRaf);\n this.#scrollRaf = 0;\n }\n }\n\n #onCellClick(e: MouseEvent, item: Element): void {\n this.selection.handleClick(item, e);\n this._dispatch<GridListItemClickDetail>(`list-item-click`, { item });\n }\n\n #onCellActivate(item: Element): void {\n if (this.interactionMode !== `manual`) {\n this.selection.replace(item);\n }\n this._dispatch<GridListActivateDetail>(`list-activate`, { item });\n }\n\n #currentWindow(): GridWindow {\n return computeGridWindow(\n this.#items.length,\n this.itemSize,\n this.#rowHeight(),\n this.gap,\n this._viewportWidth,\n this._viewportHeight,\n this.orientation === `row` ? this._scrollLeft : this._scrollTop,\n this.orientation,\n );\n }\n\n private _onKeyDown = (e: KeyboardEvent): void => {\n if ((e.ctrlKey || e.metaKey) && e.key === `f`) {\n return;\n }\n if ((e.ctrlKey || e.metaKey) && e.key === `a`) {\n if (this.selection.canSelectAll()) {\n e.preventDefault();\n this.selection.selectAll();\n }\n return;\n }\n\n const count = this.#items.length;\n if (count === 0)\n return;\n\n const win = this.#currentWindow();\n const move = (delta: number): void => {\n const from = this.tickled.tickledId\n ? this.#items.indexOf(this.tickled.tickledId)\n : -1;\n const nextIndex = Math.max(0, Math.min(count - 1, from + delta));\n const next = this.#items[nextIndex];\n if (next) {\n this.tickled.handleKeyboardNavigation(next);\n this.#scrollItemIntoView(next);\n }\n };\n\n // In `grid` a vertical arrow jumps a whole row; in `row`/`column` every\n // arrow just steps one item along the single line.\n const perLine = this.orientation === `grid` ? win.cols : 1;\n\n switch (e.key) {\n case `ArrowLeft`:\n move(-1);\n break;\n case `ArrowRight`:\n move(1);\n break;\n case `ArrowUp`:\n move(-perLine);\n break;\n case `ArrowDown`:\n move(perLine);\n break;\n case `Home`:\n this.tickled.handleKeyboardNavigation(`first`);\n if (this.tickled.tickledId) {\n this.#scrollItemIntoView(this.tickled.tickledId);\n }\n break;\n case `End`:\n this.tickled.handleKeyboardNavigation(`last`);\n if (this.tickled.tickledId) {\n this.#scrollItemIntoView(this.tickled.tickledId);\n }\n break;\n case `PageUp`:\n case `PageDown`: {\n const mainExtent = win.horizontal ? this._viewportWidth : this._viewportHeight;\n const mainStride = win.horizontal ? win.colStride : win.rowStride;\n const visibleLines = Math.max(1, Math.floor(mainExtent / mainStride));\n move((e.key === `PageDown` ? 1 : -1) * visibleLines * perLine);\n break;\n }\n case `Enter`: {\n const id = this.tickled.tickledId;\n if (id) {\n e.preventDefault();\n this._dispatch<GridListItemClickDetail>(`list-item-click`, { item: id });\n this.#onCellActivate(id);\n }\n break;\n }\n case ` `: {\n const id = this.tickled.tickledId;\n if (id) {\n e.preventDefault();\n this.selection.handleSpace(id);\n }\n break;\n }\n case `Escape`:\n this.selection.clear();\n break;\n default:\n return;\n }\n e.preventDefault();\n };\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ixfx-grid-list': GridListElement;\n }\n}\n\nexport interface GridListElement {\n addEventListener<K extends keyof GridListFullElementEventMap>(\n type: K,\n listener: (this: GridListElement, ev: GridListFullElementEventMap[K]) => void,\n options?: boolean | AddEventListenerOptions,\n ): void;\n addEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions,\n ): void;\n}\n"],"mappings":";;;;;;;;;;;;;;;AA6EA,MAAM,gBAAgB;AAEtB,MAAM,gBAAgB;;;;;;AAOtB,MAAM,mBAAmB;AAKzB,SAAS,kBACP,OACA,WACA,WACA,KACA,eACA,gBACA,cACA,aACA,WAAW,GACC;CACZ,MAAM,IAAI,KAAK,IAAI,GAAG,SAAS;CAC/B,MAAM,IAAI,KAAK,IAAI,GAAG,SAAS;CAC/B,MAAM,IAAI,KAAK,IAAI,GAAG,GAAG;CACzB,MAAM,YAAY,IAAI;CACtB,MAAM,YAAY,IAAI;CACtB,MAAM,SAAS,KAAK,IAAI,GAAG,YAAY;CAEvC,IAAI,gBAAgB,OAAO;EACzB,MAAM,OAAO,UAAU,IAAI,IAAI;EAC/B,MAAM,aAAa,UAAU,IAAI,KAAK,QAAQ,KAAK,YAAY;EAC/D,IAAI,UAAU,KAAK,iBAAiB,GAClC,OAAO;GAAE,MAAM;GAAO;GAAM,aAAa;GAAG;GAAY,YAAY;GAAG,UAAU;GAAG;GAAW;GAAW,YAAY;EAAK;EAE7H,MAAM,eAAe,KAAK,IAAI,GAAG,KAAK,MAAM,SAAS,SAAS,CAAC;EAC/D,MAAM,cAAc,KAAK,MAAM,SAAS,iBAAiB,SAAS;EAClE,OAAO;GACL,MAAM;GACN;GACA,aAAa;GACb;GACA,YAAY,KAAK,IAAI,GAAG,eAAe,QAAQ;GAC/C,UAAU,KAAK,IAAI,OAAO,cAAc,QAAQ;GAChD;GACA;GACA,YAAY;EACd;CACF;CAEA,MAAM,OAAO,gBAAgB,WACzB,IACA,KAAK,IAAI,GAAG,KAAK,OAAO,KAAK,IAAI,GAAG,aAAa,IAAI,KAAK,SAAS,CAAC;CACxE,MAAM,OAAO,UAAU,IAAI,IAAI,KAAK,KAAK,QAAQ,IAAI;CACrD,MAAM,cAAc,SAAS,IAAI,KAAK,OA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AAgB,SAAS;AAAK,CAAC,CAAA,GAAA,gBAAA,WAAA,eAAA,KAAA,CAAA;AAGnE,WAAA,CAAA,MAAM,CAAA,GAAA,gBAAA,WAAA,cAAA,KAAA,CAAA;AACN,WAAA,CAAA,MAAM,CAAA,GAAA,gBAAA,WAAA,eAAA,KAAA,CAAA;AACN,WAAA,CAAA,MAAM,CAAA,GAAA,gBAAA,WAAA,mBAAA,KAAA,CAAA;AACN,WAAA,CAAA,MAAM,CAAA,GAAA,gBAAA,WAAA,kBAAA,KAAA,CAAA;AA/URK,kBAAAA,WAAAA,CAAAA,kBAAc,gBAAgB,CAAA,GAAA,eAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"incr-search-DpbSJtgj.js","names":["FzfAny","DEFAULT_HIGHLIGHT_KEY","#el","#opts","#search","#labelMap","#onInput","#onKeydown","#unsub","#onStateChange","#root","#selector","#map","#observer","#dirty","#rebuild","#host","#adapter","#modes","#mode","#placeholder","#search","#unsub","#onState","#open","#query","#matches","#matchIndex","#observer","#teardownEffects","#focusInput","#filterActive","#applyMode","#currentItems","#cycle","#itemFor","#itemByKey","#onInput","#onKeydown","#highlightKey","#applyHighlights"],"sources":["../src/incr-search/fuzzy.ts","../src/incr-search/ac-adapter.ts","../src/incr-search/incr-search.ts","../src/incr-search/controller-tree.ts","../src/interaction/keyed-list.ts","../src/incr-search/element-list-search-adapter.ts","../src/incr-search/element-search.ts","../src/incr-search/list-search-commands.ts","../src/incr-search/list-search-controller.ts","../src/incr-search/list-search-styles.ts","../src/incr-search/tree-list-search-adapter.ts"],"sourcesContent":["import type { FuzzySearch, FuzzySearchOptions, IncrSearchResult } from './types.js';\nimport { Fzf } from 'fzf';\n\nfunction defaultSelector<T>(item: T): string {\n if (typeof item === `string`)\n return item;\n const r = item as Record<string, unknown>;\n if (typeof r.label === `string`)\n return r.label;\n if (typeof r.key === `string`)\n return r.key;\n if (typeof r.value === `string`)\n return r.value;\n return String(item);\n}\n\nexport function createFuzzySearch<T>(\n items: readonly T[],\n options: FuzzySearchOptions<T> = {},\n): FuzzySearch<T> {\n const selector = options.selector ?? defaultSelector<T>;\n // fzf uses a conditional SyncOptionsTuple<T> rest-parameter overload that TypeScript\n // cannot narrow through a spread when T is generic.\n const FzfAny = Fzf as new (list: readonly T[], opts: any) => { find: (q: string) => Array<{ item: T; positions: ReadonlySet<number>; score: number }> };\n const fzf = new FzfAny(items as readonly T[], { selector, ...(options.fzf ?? {}) });\n\n const find = (query: string): ReadonlyArray<IncrSearchResult<T>> => {\n if (!query.trim()) {\n return items.map(item => ({\n item,\n positions: new Set<number>(),\n score: 0,\n }));\n }\n return fzf.find(query).map(r => ({\n item: r.item,\n positions: r.positions,\n score: r.score,\n }));\n };\n\n return { find, items };\n}\n","import type { FuzzySearchOptions } from './types.js';\nimport { createFuzzySearch } from './fuzzy.js';\n\n/**\n * Creates an ixfx-ac-text-compatible `completionProvider` function from a\n * static item list. Uses synchronous fuzzy search wrapped in a Promise so it\n * fits the async provider signature.\n *\n * Each returned item has `positions` populated with matched character indices,\n * which `ixfx-ac-text` uses to render CSS Custom Highlights on the label.\n *\n * Empty query returns all items in original order (no positions).\n * A cancelled signal causes the returned promise to reject with an AbortError.\n */\nexport function createAcCompletionProvider<T extends { label: string }>(\n items: readonly T[],\n options: Pick<FuzzySearchOptions<T>, `selector`> = {},\n): (query: string, signal: AbortSignal) => Promise<Array<T & { positions: ReadonlySet<number> }>> {\n const selector = options.selector ?? ((item: T) => item.label);\n const fuzzy = createFuzzySearch(items, { selector });\n\n return (\n query: string,\n signal: AbortSignal,\n ): Promise<Array<T & { positions: ReadonlySet<number> }>> =>\n new Promise((resolve, reject) => {\n if (signal.aborted) {\n reject(new DOMException(`Aborted`, `AbortError`));\n return;\n }\n\n const results = fuzzy.find(query).map(r => ({ ...r.item, positions: r.positions }));\n\n if (signal.aborted) {\n reject(new DOMException(`Aborted`, `AbortError`));\n return;\n }\n\n resolve(results);\n });\n}\n","import type {\n IncrSearch,\n IncrSearchChangeCallback,\n IncrSearchOptions,\n IncrSearchState,\n} from './types.js';\nimport { createFuzzySearch } from './fuzzy.js';\n\nfunction buildState<T>(results: ReturnType<ReturnType<typeof createFuzzySearch<T>>[`find`]>, query: string): IncrSearchState<T> {\n const positionsByItem = new Map<T, ReadonlySet<number>>();\n for (const r of results) {\n positionsByItem.set(r.item, r.positions);\n }\n return Object.freeze({\n query,\n results: Object.freeze([...results]),\n positionsByItem,\n });\n}\n\nexport function createIncrSearch<T>(options: IncrSearchOptions<T> = {}): IncrSearch<T> {\n let items: readonly T[] = options.items ?? [];\n let query = ``;\n let fuzzy = createFuzzySearch(items, { selector: options.selector, fzf: options.fzf });\n let state: IncrSearchState<T> = buildState(fuzzy.find(query), query);\n let disposed = false;\n\n const observers = new Set<IncrSearchChangeCallback<T>>();\n\n if (options.onChange) {\n observers.add(options.onChange);\n }\n\n const notify = (s: IncrSearchState<T>): void => {\n for (const cb of observers) {\n cb(s);\n }\n };\n\n const run = async (q: string, signal?: AbortSignal): Promise<IncrSearchState<T>> => {\n // Yield to the microtask queue for a consistent async interface\n await Promise.resolve();\n if (signal?.aborted || disposed) {\n return state;\n }\n const results = fuzzy.find(q);\n if (signal?.aborted || disposed) {\n return state;\n }\n state = buildState(results, q);\n notify(state);\n return state;\n };\n\n return {\n get state() {\n return state;\n },\n\n async setItems(newItems: readonly T[], signal?: AbortSignal): Promise<void> {\n items = newItems;\n fuzzy = createFuzzySearch(items, { selector: options.selector, fzf: options.fzf });\n await run(query, signal);\n },\n\n async setQuery(q: string, signal?: AbortSignal): Promise<IncrSearchState<T>> {\n query = q;\n return run(q, signal);\n },\n\n async clearQuery(): Promise<void> {\n query = ``;\n await run(``, undefined);\n },\n\n onChange(cb: IncrSearchChangeCallback<T>): () => void {\n observers.add(cb);\n cb(state);\n return () => {\n observers.delete(cb);\n };\n },\n\n dispose(): void {\n disposed = true;\n observers.clear();\n items = [];\n },\n };\n}\n","import type { FzfOptions } from 'fzf';\nimport type { TreeSearchHost } from '../common/searchable.js';\nimport type { TreeNode } from '../common/types.js';\nimport type { IncrSearchState } from './types.js';\nimport { applyHighlights, buildHighlightTargets, clearHighlights } from './highlight.js';\nimport { createIncrSearch } from './incr-search.js';\n\nconst DEFAULT_HIGHLIGHT_KEY = `incr-search-highlight`;\n\nexport type IncrSearchTreeOptions = {\n selector: (item: { node: TreeNode; depth: number }) => string;\n /**\n * CSS selector for the label elements inside the shadow root.\n * Defaults to `.tree-label` (suitable for ixfx-tree-list).\n * Use `.label` for ixfx-miller-list.\n */\n labelSelector?: string;\n highlightKey?: string;\n input?: HTMLInputElement;\n fzf?: Partial<FzfOptions<{ node: TreeNode; depth: number }>>;\n};\n\ntype SearchItem = { node: TreeNode; depth: number };\n\n/**\n * External-input filter-search controller for `TreeSearchHost` components.\n *\n * @deprecated `ixfx-tree-list` / `ixfx-miller-list` now have a built-in\n * incremental-search popover with navigate / select / filter modes — invoke\n * `el.registry.invoke('list.search.filter')` (see `docs/infra-incremental.md`)\n * instead of wiring an external `<input>`. This class remains for existing\n * consumers and covers filter mode only.\n *\n * @example Using with ixfx-tree-list:\n * ```typescript\n * const ctrl = new IncrSearchTreeController(myTreeList, {\n * selector: item => item.node.item.label,\n * });\n * ctrl.connect();\n * ```\n *\n * @example Using with ixfx-miller-list (different label selector):\n * ```typescript\n * const ctrl = new IncrSearchTreeController(myMillerList, {\n * selector: item => item.node.item.label,\n * labelSelector: '.label',\n * });\n * ctrl.connect();\n * ```\n */\nexport class IncrSearchTreeController {\n #el: TreeSearchHost;\n #opts: IncrSearchTreeOptions;\n #search: ReturnType<typeof createIncrSearch<SearchItem>>;\n #unsub: (() => void) | undefined;\n #labelMap = new Map<string, SearchItem>();\n\n constructor(el: TreeSearchHost, opts: IncrSearchTreeOptions) {\n this.#el = el;\n this.#opts = opts;\n this.#search = createIncrSearch<SearchItem>({\n selector: opts.selector,\n fzf: opts.fzf,\n });\n }\n\n connect(): void {\n this.disconnect();\n\n const items = this.#el.getNodes();\n for (const item of items) {\n this.#labelMap.set(this.#opts.selector(item), item);\n }\n void this.#search.setItems(items);\n\n if (this.#opts.input) {\n this.#opts.input.addEventListener(`input`, this.#onInput);\n this.#opts.input.addEventListener(`keydown`, this.#onKeydown);\n }\n\n this.#unsub = this.#search.onChange(state => this.#onStateChange(state));\n }\n\n disconnect(): void {\n if (this.#unsub) {\n this.#unsub();\n this.#unsub = undefined;\n }\n if (this.#opts.input) {\n this.#opts.input.removeEventListener(`input`, this.#onInput);\n this.#opts.input.removeEventListener(`keydown`, this.#onKeydown);\n }\n this.#el.filterPredicate = undefined;\n clearHighlights({ key: this.#opts.highlightKey ?? DEFAULT_HIGHLIGHT_KEY });\n this.#labelMap.clear();\n }\n\n async setQuery(query: string): Promise<void> {\n await this.#search.setQuery(query);\n }\n\n async clearQuery(): Promise<void> {\n await this.#search.clearQuery();\n }\n\n #onInput = () => {\n const value = this.#opts.input?.value ?? ``;\n void this.setQuery(value);\n };\n\n #onKeydown = (e: KeyboardEvent) => {\n if (e.key === `Escape` && this.#opts.input) {\n this.#opts.input.value = ``;\n void this.clearQuery();\n }\n };\n\n #onStateChange(state: IncrSearchState<SearchItem>): void {\n const matched = new Set(state.results.map(r => r.item.node.item.key));\n const hasQuery = state.query.trim().length > 0;\n this.#el.filterPredicate = hasQuery && matched.size > 0\n ? (node: TreeNode, _depth: number) => matched.has(node.item.key)\n : undefined;\n\n const key = this.#opts.highlightKey ?? DEFAULT_HIGHLIGHT_KEY;\n if (!this.#el.shadowRoot)\n return;\n\n if (!state.query.trim()) {\n clearHighlights({ key });\n return;\n }\n\n const labelSelector = this.#opts.labelSelector ?? `.tree-label`;\n const targets = buildHighlightTargets(\n this.#el.shadowRoot,\n labelSelector,\n state.positionsByItem,\n (labelEl) => {\n const text = labelEl.textContent ?? ``;\n return this.#labelMap.get(text);\n },\n labelEl => labelEl.textContent ?? ``,\n );\n applyHighlights(targets, { key });\n }\n}\n","/**\n * Helpers for key-based selection on the Element-flavoured list components\n * (`ixfx-vertical-list`, `ixfx-detail-list`, `ixfx-grid-list`).\n *\n * A \"key\" is a stable string the host puts on each item element — `data-key`\n * (preferred) or `data-value`. It survives the host rebuilding the item set\n * (re-fetch, re-sort, filter) where raw `Element` references do not.\n */\n\n/**\n * The stable key for an item element: `data-key`, then `data-value`, else\n * `undefined`.\n */\nexport function keyForElement(el: Element): string | undefined {\n return el.getAttribute(`data-key`) ?? el.getAttribute(`data-value`) ?? undefined;\n}\n\n/**\n * A lazily-built key → element index over a container. Rebuilt on first use\n * and after any child-list mutation under `root`; `invalidate()` forces a\n * rebuild on the next `get()`.\n *\n * ```ts\n * #keyIndex = new KeyedElementIndex(this);\n * // ...\n * const el = this.#keyIndex.get(`row-42`);\n * // on disconnect:\n * this.#keyIndex.dispose();\n * ```\n */\nexport class KeyedElementIndex {\n readonly #root: Element;\n readonly #selector: string;\n readonly #map = new Map<string, Element>();\n #dirty = true;\n readonly #observer: MutationObserver;\n\n /**\n * @param root Container whose descendants are indexed.\n * @param itemSelector Which descendants count as items (default: any `[data-key]`).\n */\n constructor(root: Element, itemSelector = `[data-key]`) {\n this.#root = root;\n this.#selector = itemSelector;\n this.#observer = new MutationObserver(() => {\n this.#dirty = true;\n });\n this.#observer.observe(root, { childList: true, subtree: true });\n }\n\n /** The element with this key, or `undefined`. First match wins on duplicates. */\n get(key: string): Element | undefined {\n if (this.#dirty) {\n this.#rebuild();\n }\n return this.#map.get(key);\n }\n\n /** Force a rebuild on the next `get()` — e.g. after a `data-key` attribute change. */\n invalidate(): void {\n this.#dirty = true;\n }\n\n /** Stop observing and drop the cache. */\n dispose(): void {\n this.#observer.disconnect();\n this.#map.clear();\n }\n\n #rebuild(): void {\n this.#map.clear();\n for (const el of this.#root.querySelectorAll(this.#selector)) {\n const key = keyForElement(el);\n if (key !== undefined && !this.#map.has(key)) {\n this.#map.set(key, el);\n }\n }\n this.#dirty = false;\n }\n}\n","import type { ListSearchAdapter } from './list-search-controller.js';\nimport { keyForElement } from '../interaction/keyed-list.js';\n\n/**\n * The slice of a list component the element adapter drives. `ixfx-grid-list`,\n * `ixfx-vertical-list` and `ixfx-detail-list` all satisfy it.\n */\nexport interface ElementListSearchHost extends HTMLElement {\n focusKey: (key: string) => void;\n selectKeys: (keys: Iterable<string>) => void;\n}\n\nexport interface ElementListSearchAdapterOptions {\n /** Selector for item elements, relative to the host. Default `:scope > *`. */\n itemSelector?: string;\n getLabel?: (el: Element) => string;\n getKey?: (el: Element) => string;\n /** `CSS.highlights` registry key for matched-character highlights. */\n highlightKey?: string;\n}\n\nfunction defaultLabel(el: Element): string {\n return el.getAttribute(`data-search-label`) ?? el.textContent?.trim() ?? ``;\n}\n\n/**\n * A {@link ListSearchAdapter} over the light-DOM item elements of a list\n * component. Filter mode toggles `hidden` (only on elements it hid itself, so a\n * consumer's own `hidden` items are left alone). Highlights are painted on the\n * item elements in the light DOM — the consuming page styles\n * `::highlight(<highlightKey>)`. See `docs/infra-incremental.md`.\n */\nexport function createElementListSearchAdapter(\n host: ElementListSearchHost,\n options: ElementListSearchAdapterOptions = {},\n): ListSearchAdapter<Element> {\n const itemSelector = options.itemSelector ?? `:scope > *`;\n const getLabel = options.getLabel ?? defaultLabel;\n const getKey = options.getKey ?? (el => keyForElement(el) ?? defaultLabel(el));\n const hidden = new Set<Element>();\n\n const items = (): Element[] => Array.from(host.querySelectorAll(itemSelector));\n\n return {\n getItems: items,\n getLabel,\n getKey,\n focusItem: (el) => {\n if (el)\n host.focusKey(getKey(el));\n },\n activateItem: (el) => {\n el.dispatchEvent(new MouseEvent(`click`, { bubbles: true, composed: true }));\n },\n selectItems: (els) => {\n host.selectKeys(els.map(getKey));\n },\n applyFilter: (matched) => {\n if (matched === undefined) {\n for (const el of hidden)\n (el as HTMLElement).hidden = false;\n hidden.clear();\n return;\n }\n for (const el of items()) {\n if (matched.has(getKey(el))) {\n if (hidden.delete(el))\n (el as HTMLElement).hidden = false;\n } else {\n (el as HTMLElement).hidden = true;\n hidden.add(el);\n }\n }\n },\n highlightRoot: () => host,\n highlightSelector: itemSelector,\n highlightKeyOf: el => getKey(el),\n highlightText: getLabel,\n highlightKey: options.highlightKey,\n container: () => host,\n };\n}\n","import type {\n ElementIncrSearchOptions,\n IncrSearchChangeCallback,\n IncrSearchState,\n} from './types.js';\nimport { applyHighlights, buildHighlightTargets, clearHighlights } from './highlight.js';\nimport { createIncrSearch } from './incr-search.js';\n\ntype ElementItem = { readonly key: string; readonly label: string };\n\nconst defaultGetLabel = (el: Element): string => el.textContent?.trim() ?? ``;\n\nfunction defaultGetKey(el: Element): string {\n return el.getAttribute(`data-key`)\n ?? el.getAttribute(`data-value`)\n ?? el.textContent?.trim()\n ?? ``;\n}\n\nexport type ElementIncrSearch = {\n readonly setQuery: (query: string, signal?: AbortSignal) => Promise<void>;\n readonly clearQuery: () => Promise<void>;\n readonly refresh: () => void;\n readonly onChange: (cb: IncrSearchChangeCallback<ElementItem>) => () => void;\n readonly dispose: () => void;\n};\n\n/**\n * DOM filter-search over a container's item elements (sets `hidden` on\n * non-matches, applies highlights).\n *\n * @deprecated The list components (`ixfx-grid-list`, `ixfx-vertical-list`,\n * `ixfx-detail-list`, …) now have a built-in navigate / select / filter search\n * popover — see `docs/infra-incremental.md` and `ListSearchController`. Kept for\n * standalone / non-component use.\n */\nexport function createElementIncrSearch(opts: ElementIncrSearchOptions): ElementIncrSearch {\n const {\n container,\n itemSelector,\n getLabel = defaultGetLabel,\n getKey = defaultGetKey,\n labelSelector,\n highlightKey,\n } = opts;\n\n // Map from key → element reference for highlight lookup\n let elementByKey = new Map<string, Element>();\n\n const search = createIncrSearch<ElementItem>({\n selector: item => item.label,\n fzf: opts.fzf,\n });\n\n const updateVisibility = (state: IncrSearchState<ElementItem>): void => {\n const matchedKeys = new Set(state.results.map(r => r.item.key));\n const hasQuery = state.query.trim().length > 0;\n\n for (const [key, el] of elementByKey) {\n (el as HTMLElement).hidden = hasQuery ? !matchedKeys.has(key) : false;\n }\n };\n\n const updateHighlights = (state: IncrSearchState<ElementItem>): void => {\n if (!state.query.trim()) {\n clearHighlights({ key: highlightKey });\n return;\n }\n\n const sel = labelSelector ?? itemSelector;\n const targets = buildHighlightTargets(\n container,\n sel,\n state.positionsByItem,\n (el) => {\n const key = getKey(el);\n // Find the ElementItem whose key matches this element's key\n const result = state.results.find(r => r.item.key === key);\n return result?.item;\n },\n el => getLabel(el),\n );\n applyHighlights(targets, { key: highlightKey });\n };\n\n const unsubscribeState = search.onChange((state) => {\n updateVisibility(state);\n updateHighlights(state);\n opts.onChange?.(state);\n });\n\n let refreshPending = false;\n\n const refresh = (): void => {\n if (refreshPending)\n return;\n refreshPending = true;\n void Promise.resolve().then(() => {\n refreshPending = false;\n elementByKey = new Map<string, Element>();\n const els = container.querySelectorAll(itemSelector);\n const items: ElementItem[] = [];\n for (const el of els) {\n const key = getKey(el);\n elementByKey.set(key, el);\n items.push({ key, label: getLabel(el) });\n }\n void search.setItems(items);\n });\n };\n\n const observer = new MutationObserver(() => refresh());\n observer.observe(container, { childList: true, subtree: false });\n\n refresh();\n\n return {\n async setQuery(query, signal) {\n await search.setQuery(query, signal);\n },\n\n async clearQuery() {\n await search.clearQuery();\n },\n\n refresh,\n\n onChange(cb) {\n return search.onChange(cb);\n },\n\n dispose() {\n observer.disconnect();\n unsubscribeState();\n search.dispose();\n clearHighlights({ key: highlightKey });\n },\n };\n}\n","import type { CommandRegistry } from '@clinth/ui-commands';\nimport type { ListSearchController, ListSearchMode } from './list-search-controller.js';\n\n/** Command ids registered by {@link registerListSearchCommands}, keyed by mode. */\nexport const LIST_SEARCH_COMMAND_IDS: Readonly<Record<ListSearchMode, string>> = {\n navigate: `list.search.navigate`,\n select: `list.search.select`,\n filter: `list.search.filter`,\n};\n\nconst LABELS: Readonly<Record<ListSearchMode, { label: string; description: string }>> = {\n navigate: { label: `Find`, description: `Type to move the cursor to the best match` },\n select: { label: `Find & Select`, description: `Type to select every matching item` },\n filter: { label: `Filter`, description: `Type to hide items that don't match` },\n};\n\nexport interface RegisterListSearchCommandsOptions {\n /**\n * Prefix for command ids, e.g. `grid-list` ⇒ `grid-list.search.filter`. When\n * omitted the shared ids from {@link LIST_SEARCH_COMMAND_IDS} are used so a\n * single dispatch (`ixfx-grouped-item-lister.dispatch('list.search.filter')`)\n * fans out to every list.\n */\n idPrefix?: string;\n}\n\n/**\n * Register one command per mode the controller offers (see\n * `controller.registeredModes`). Each command opens the search popover in its\n * mode. Returns a function that unregisters them again — call it from\n * `disconnectedCallback`. See `docs/infra-incremental.md`.\n */\nexport function registerListSearchCommands<T>(\n registry: CommandRegistry<unknown>,\n controller: ListSearchController<T>,\n options: RegisterListSearchCommandsOptions = {},\n): () => void {\n const id = (mode: ListSearchMode): string =>\n options.idPrefix ? `${options.idPrefix}.search.${mode}` : LIST_SEARCH_COMMAND_IDS[mode];\n\n const registered: string[] = [];\n for (const mode of controller.registeredModes) {\n const commandId = id(mode);\n if (registry.has(commandId))\n continue;\n registry.register({\n id: commandId,\n label: LABELS[mode].label,\n description: LABELS[mode].description,\n execute: () => controller.open(mode),\n });\n registered.push(commandId);\n }\n\n return () => {\n for (const commandId of registered)\n registry.unregister(commandId);\n };\n}\n","import type { FzfOptions } from 'fzf';\nimport type { ReactiveController, ReactiveControllerHost, TemplateResult } from 'lit';\nimport type { IncrSearchResult, IncrSearchState } from './types.js';\nimport { html, nothing } from 'lit';\nimport { applyHighlights, buildHighlightTargets, clearHighlights } from './highlight.js';\nimport { createIncrSearch } from './incr-search.js';\n\n/**\n * The three things incremental search can do to a list / tree component. See\n * `docs/infra-incremental.md`.\n *\n * - `navigate` — move the cursor to the best match; ↑/↓ cycle between matches;\n * Enter activates the current match and closes.\n * - `select` — (re)select every item whose label matches, live as you type.\n * - `filter` — hide items that don't match; restored when the popover closes.\n */\nexport type ListSearchMode = `navigate` | `select` | `filter`;\n\n/** Canonical order — used for the switch-row and to normalise a requested set. */\nexport const LIST_SEARCH_MODES: readonly ListSearchMode[] = [`navigate`, `select`, `filter`];\n\nconst DEFAULT_HIGHLIGHT_KEY = `incr-search-highlight`;\nconst INPUT_CLASS = `list-search-input`;\n\ntype SearchItem = { readonly key: string; readonly label: string };\n\n/**\n * Everything {@link ListSearchController} needs to drive a specific host. One is\n * supplied per component; `createElementListSearchAdapter` and\n * `createTreeListSearchAdapter` cover the common shapes.\n */\nexport interface ListSearchAdapter<TItem> {\n /** All searchable items, in display order. */\n getItems: () => readonly TItem[];\n /** Text matched against the query. */\n getLabel: (item: TItem) => string;\n /** Stable identity for an item. */\n getKey: (item: TItem) => string;\n /** `navigate`: move the cursor to `item` and reveal it. `undefined` = no-op. */\n focusItem: (item: TItem | undefined) => void;\n /** `navigate` + Enter: activate `item` (falls back to `focusItem`). */\n activateItem?: (item: TItem) => void;\n /** `select` / \"Select matches\": replace the selection with `items`. */\n selectItems: (items: readonly TItem[]) => void;\n /** `filter`: hide items whose key is not in `matchedKeys`; `undefined` clears the filter. */\n applyFilter: (matchedKeys: ReadonlySet<string> | undefined) => void;\n /** Where matched-character highlights are painted (usually the shadow root). */\n highlightRoot?: () => ShadowRoot | Element | null | undefined;\n /** CSS selector for the label elements inside {@link highlightRoot}. */\n highlightSelector?: string;\n /** Given a label element, the key of the item it belongs to. */\n highlightKeyOf?: (labelEl: Element) => string | undefined;\n /** Text of a label element as fzf saw it (defaults to `el.textContent`). */\n highlightText?: (labelEl: Element) => string;\n /** `CSS.highlights` registry key. Defaults to `incr-search-highlight`. */\n highlightKey?: string;\n /** Element whose child-list mutations should trigger a `refresh()`. */\n container?: () => Element | null | undefined;\n}\n\nexport interface ListSearchControllerOptions<TItem> {\n adapter: ListSearchAdapter<TItem>;\n /**\n * Modes this instance offers, as entry points and as in-popover switch\n * targets. The controller intersects this with {@link LIST_SEARCH_MODES}, so\n * pass the intersection of the component's own capability and any\n * consumer-set `search-modes`. Empty ⇒ search disabled. Default: all three.\n */\n modes?: readonly ListSearchMode[];\n fzf?: Partial<FzfOptions<SearchItem>>;\n placeholder?: string;\n}\n\nexport type ListSearchHost = ReactiveControllerHost & HTMLElement & {\n renderRoot?: DocumentFragment | HTMLElement;\n};\n\n/**\n * Shared brain for the three-mode incremental-search popover. A Lit\n * `ReactiveController`: the host adds `listSearchStyles` to `static styles`,\n * drops `${controller.renderField()}` into `render()`, and registers the\n * commands with {@link registerListSearchCommands}. See `docs/infra-incremental.md`.\n */\nexport class ListSearchController<TItem> implements ReactiveController {\n #host: ListSearchHost;\n #adapter: ListSearchAdapter<TItem>;\n #modes: readonly ListSearchMode[];\n #placeholder: string;\n #search: ReturnType<typeof createIncrSearch<SearchItem>>;\n #unsub: (() => void) | undefined;\n #observer: MutationObserver | undefined;\n\n #itemByKey = new Map<string, TItem>();\n\n #open = false;\n #mode: ListSearchMode = `filter`;\n #query = ``;\n #matchIndex = 0;\n #matches: ReadonlyArray<IncrSearchResult<SearchItem>> = [];\n /** Whether a filter has been pushed to the adapter and still needs undoing. */\n #filterActive = false;\n\n constructor(host: ListSearchHost, options: ListSearchControllerOptions<TItem>) {\n this.#host = host;\n host.addController(this);\n this.#adapter = options.adapter;\n const requested = new Set(options.modes ?? LIST_SEARCH_MODES);\n this.#modes = LIST_SEARCH_MODES.filter(m => requested.has(m));\n this.#mode = this.#modes[0] ?? `filter`;\n this.#placeholder = options.placeholder ?? `Search…`;\n this.#search = createIncrSearch<SearchItem>({ selector: i => i.label, fzf: options.fzf });\n this.#unsub = this.#search.onChange(state => this.#onState(state));\n }\n\n // --- Public surface ---\n\n /** `false` when no modes are available — the host should register no commands and render no field. */\n get enabled(): boolean {\n return this.#modes.length > 0;\n }\n\n /** The modes actually offered (component capability ∩ consumer request). */\n get registeredModes(): readonly ListSearchMode[] {\n return this.#modes;\n }\n\n /**\n * Replace the offered mode set (normalised to {@link LIST_SEARCH_MODES}\n * order). If the current mode is dropped the popover closes and falls back to\n * the first remaining mode. Callers should re-run\n * {@link registerListSearchCommands} afterwards.\n */\n setModes(modes: readonly ListSearchMode[]): void {\n const set = new Set(modes);\n this.#modes = LIST_SEARCH_MODES.filter(m => set.has(m));\n if (!this.#modes.includes(this.#mode)) {\n if (this.#open)\n this.close();\n this.#mode = this.#modes[0] ?? `filter`;\n }\n this.#host.requestUpdate();\n }\n\n get isOpen(): boolean {\n return this.#open;\n }\n\n get mode(): ListSearchMode {\n return this.#mode;\n }\n\n get query(): string {\n return this.#query;\n }\n\n get matchCount(): number {\n return this.#matches.length;\n }\n\n get matchIndex(): number {\n return this.#matchIndex;\n }\n\n // --- ReactiveController lifecycle ---\n\n hostConnected(): void {\n const container = this.#adapter.container?.();\n if (container) {\n this.#observer = new MutationObserver(() => this.refresh());\n this.#observer.observe(container, { childList: true, subtree: false });\n }\n this.refresh();\n }\n\n hostDisconnected(): void {\n this.#observer?.disconnect();\n this.#observer = undefined;\n if (this.#open)\n this.#teardownEffects();\n this.#open = false;\n this.#unsub?.();\n this.#unsub = undefined;\n this.#search.dispose();\n }\n\n // --- Commands / actions ---\n\n /** Open the popover in `mode` (clamped to the available set). */\n open(mode: ListSearchMode): void {\n if (!this.enabled)\n return;\n this.#mode = this.#modes.includes(mode) ? mode : this.#modes[0];\n this.#open = true;\n this.#query = ``;\n this.#matchIndex = 0;\n this.#matches = [];\n this.refresh();\n void this.#search.setQuery(``);\n this.#host.requestUpdate();\n void this.#host.updateComplete.then(() => this.#focusInput());\n }\n\n /** Close the popover, restoring any live filter. Selection / cursor stay put. */\n close(): void {\n if (!this.#open)\n return;\n this.#open = false;\n this.#teardownEffects();\n this.#query = ``;\n this.#matches = [];\n void this.#search.clearQuery();\n this.#host.requestUpdate();\n this.#host.focus();\n }\n\n setQuery(query: string): void {\n this.#query = query;\n this.#matchIndex = 0;\n void this.#search.setQuery(query);\n }\n\n /** Re-interpret the current query under a new mode (undoing the old mode's effect). */\n switchMode(next: ListSearchMode): void {\n if (!this.#modes.includes(next) || next === this.#mode)\n return;\n if (this.#mode === `filter` && this.#filterActive) {\n this.#adapter.applyFilter(undefined);\n this.#filterActive = false;\n }\n this.#mode = next;\n this.#applyMode();\n this.#host.requestUpdate();\n void this.#host.updateComplete.then(() => this.#focusInput());\n }\n\n /** One-shot: turn the current match set into the selection, staying in the current mode. */\n selectMatches(): void {\n if (!this.#modes.includes(`select`))\n return;\n this.#adapter.selectItems(this.#currentItems());\n this.#host.requestUpdate();\n }\n\n nextMatch(): void {\n this.#cycle(1);\n }\n\n prevMatch(): void {\n this.#cycle(-1);\n }\n\n /** Enter: in `navigate` activate the current match; then close. */\n commit(): void {\n if (this.#mode === `navigate`) {\n const item = this.#itemFor(this.#matches[this.#matchIndex]);\n if (item) {\n if (this.#adapter.activateItem)\n this.#adapter.activateItem(item);\n else\n this.#adapter.focusItem(item);\n }\n }\n this.close();\n }\n\n /** Rebuild the searchable item set from the adapter. Called on open and on container mutation. */\n refresh(): void {\n this.#itemByKey.clear();\n const items: SearchItem[] = [];\n for (const it of this.#adapter.getItems()) {\n const key = this.#adapter.getKey(it);\n this.#itemByKey.set(key, it);\n items.push({ key, label: this.#adapter.getLabel(it) });\n }\n void this.#search.setItems(items);\n }\n\n // --- Rendering ---\n\n /** Popover markup. Pair with `listSearchStyles` in the host's `static styles`. */\n renderField(): TemplateResult | typeof nothing {\n if (!this.enabled)\n return nothing;\n const hasQuery = this.#query.trim().length > 0;\n const others = this.#modes.filter(m => m !== this.#mode);\n const showSelectMatches = this.#modes.includes(`select`) && this.#mode !== `select`;\n return html`\n <div class=\"list-search\" part=\"search\" ?hidden=${!this.#open}>\n <div class=\"list-search-row\">\n <span class=\"list-search-mode\">${this.#mode}</span>\n <input\n class=${INPUT_CLASS}\n type=\"text\"\n part=\"search-input\"\n placeholder=${this.#placeholder}\n .value=${this.#query}\n @input=${this.#onInput}\n @keydown=${this.#onKeydown}\n />\n ${hasQuery\n ? html`<span class=\"list-search-count\">${this.#matches.length === 0 ? `0` : this.#matchIndex + 1} / ${this.#matches.length}</span>`\n : nothing}\n ${this.#mode === `navigate` && this.#matches.length > 1\n ? html`\n <button class=\"list-search-icon-btn\" title=\"Previous match (↑)\" @click=${() => this.prevMatch()}>‹</button>\n <button class=\"list-search-icon-btn\" title=\"Next match (↓)\" @click=${() => this.nextMatch()}>›</button>\n `\n : nothing}\n <button class=\"list-search-icon-btn\" title=\"Close (Esc)\" @click=${() => this.close()}>✕</button>\n </div>\n ${others.length > 0 || showSelectMatches\n ? html`\n <div class=\"list-search-switch\">\n ${others.map(m => html`<button class=\"list-search-btn\" @click=${() => this.switchMode(m)}>${m}</button>`)}\n ${showSelectMatches\n ? html`<button class=\"list-search-btn\" @click=${() => this.selectMatches()}>Select matches</button>`\n : nothing}\n </div>\n `\n : nothing}\n </div>\n `;\n }\n\n // --- Internals ---\n\n #focusInput(): void {\n this.#host.renderRoot?.querySelector<HTMLInputElement>(`.${INPUT_CLASS}`)?.focus();\n }\n\n #onInput = (e: Event): void => {\n this.setQuery((e.target as HTMLInputElement).value);\n };\n\n #onKeydown = (e: KeyboardEvent): void => {\n switch (e.key) {\n case `Escape`:\n e.preventDefault();\n e.stopPropagation();\n this.close();\n break;\n case `Enter`:\n e.preventDefault();\n e.stopPropagation();\n this.commit();\n break;\n case `ArrowDown`:\n if (this.#mode === `navigate`) {\n e.preventDefault();\n this.nextMatch();\n }\n break;\n case `ArrowUp`:\n if (this.#mode === `navigate`) {\n e.preventDefault();\n this.prevMatch();\n }\n break;\n default:\n break;\n }\n };\n\n #cycle(delta: number): void {\n if (this.#matches.length === 0)\n return;\n const n = this.#matches.length;\n this.#matchIndex = (this.#matchIndex + delta + n) % n;\n if (this.#mode === `navigate`)\n this.#adapter.focusItem(this.#itemFor(this.#matches[this.#matchIndex]));\n this.#host.requestUpdate();\n }\n\n #itemFor(match: IncrSearchResult<SearchItem> | undefined): TItem | undefined {\n return match ? this.#itemByKey.get(match.item.key) : undefined;\n }\n\n #currentItems(): TItem[] {\n return this.#matches\n .map(m => this.#itemFor(m))\n .filter((x): x is TItem => x !== undefined);\n }\n\n get #highlightKey(): string {\n return this.#adapter.highlightKey ?? DEFAULT_HIGHLIGHT_KEY;\n }\n\n #onState(state: IncrSearchState<SearchItem>): void {\n if (!this.#open)\n return;\n const hasQuery = state.query.trim().length > 0;\n this.#matches = hasQuery ? [...state.results] : [];\n if (this.#matchIndex >= this.#matches.length)\n this.#matchIndex = 0;\n this.#applyMode();\n this.#host.requestUpdate();\n }\n\n #applyMode(): void {\n const hasQuery = this.#query.trim().length > 0;\n\n if (!hasQuery) {\n if (this.#filterActive) {\n this.#adapter.applyFilter(undefined);\n this.#filterActive = false;\n }\n this.#applyHighlights();\n return;\n }\n\n switch (this.#mode) {\n case `navigate`:\n this.#adapter.focusItem(this.#itemFor(this.#matches[this.#matchIndex]));\n break;\n case `select`:\n this.#adapter.selectItems(this.#currentItems());\n break;\n case `filter`:\n this.#adapter.applyFilter(new Set(this.#matches.map(m => m.item.key)));\n this.#filterActive = true;\n break;\n }\n this.#applyHighlights();\n }\n\n #applyHighlights(): void {\n const root = this.#adapter.highlightRoot?.();\n const selector = this.#adapter.highlightSelector;\n const keyOf = this.#adapter.highlightKeyOf;\n if (!root || !selector || !keyOf)\n return;\n if (this.#query.trim().length === 0) {\n clearHighlights({ key: this.#highlightKey });\n return;\n }\n const state = this.#search.state;\n const targets = buildHighlightTargets(\n root,\n selector,\n state.positionsByItem,\n (el) => {\n const key = keyOf(el);\n return key === undefined ? undefined : state.results.find(r => r.item.key === key)?.item;\n },\n this.#adapter.highlightText ?? (el => el.textContent ?? ``),\n );\n // Highlights are cosmetic — never let a bad range (label / positions\n // mismatch) surface as an unhandled rejection through the async engine.\n try {\n applyHighlights(targets, { key: this.#highlightKey });\n } catch {\n clearHighlights({ key: this.#highlightKey });\n }\n }\n\n #teardownEffects(): void {\n if (this.#filterActive) {\n this.#adapter.applyFilter(undefined);\n this.#filterActive = false;\n }\n clearHighlights({ key: this.#highlightKey });\n }\n}\n","import { css } from 'lit';\n\n/**\n * Styles for the incremental-search popover rendered by\n * `ListSearchController.renderField()`. Add to a component's `static styles`;\n * the class names are the contract between this fragment and `renderField()`.\n *\n * The host must give the popover a positioned ancestor (a wrapper with\n * `position: relative`, or `:host { position: relative }`). Tunables:\n * `--list-search-inset` (default `8px`) offsets it from the top-right corner.\n *\n * See `docs/infra-incremental.md`.\n */\nexport const listSearchStyles = css`\n .list-search {\n position: absolute;\n top: var(--list-search-inset, 8px);\n right: var(--list-search-inset, 8px);\n z-index: 20;\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 6px;\n box-sizing: border-box;\n background: var(--surface-4, #2a2a2a);\n color: var(--surface-3-text, inherit);\n border: 1px solid var(--border, #444);\n border-radius: var(--radius-m, 6px);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);\n font-size: var(--text-s, 0.85em);\n }\n\n .list-search[hidden] {\n display: none;\n }\n\n .list-search-row {\n display: flex;\n align-items: center;\n gap: 4px;\n }\n\n .list-search-mode {\n flex: none;\n padding: 1px 7px;\n border-radius: 999px;\n font-weight: 600;\n text-transform: capitalize;\n background: var(--accent, #60a5fa);\n color: var(--accent-text, #000);\n }\n\n .list-search-input {\n flex: 1;\n min-width: 140px;\n background: transparent;\n border: none;\n outline: none;\n color: inherit;\n font: inherit;\n }\n\n .list-search-count {\n flex: none;\n opacity: 0.6;\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n }\n\n .list-search-switch {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n }\n\n .list-search-btn {\n padding: 1px 7px;\n background: var(--surface-3, #333);\n color: inherit;\n border: 1px solid var(--border, #444);\n border-radius: var(--radius-s, 4px);\n cursor: pointer;\n font: inherit;\n text-transform: capitalize;\n }\n\n .list-search-btn:hover {\n background: var(--item-bg-tickled, #444);\n }\n\n .list-search-icon-btn {\n flex: none;\n padding: 0 2px;\n background: transparent;\n border: none;\n color: var(--surface-muted-text, #888);\n cursor: pointer;\n font-size: 1.1em;\n line-height: 1;\n }\n\n .list-search-icon-btn:hover {\n color: inherit;\n }\n`;\n","import type { TreeSearchHost } from '../common/tree-component.js';\nimport type { TreeNode } from '../common/types.js';\nimport type { ListSearchAdapter } from './list-search-controller.js';\n\ntype TreeSearchItem = { node: TreeNode; depth: number };\n\nexport interface TreeListSearchAdapterOptions {\n /** Label-element selector inside the shadow root. Default `.tree-label`; `ixfx-miller-list` uses `.label`. */\n labelSelector?: string;\n /** `CSS.highlights` registry key for matched-character highlights. */\n highlightKey?: string;\n getLabel?: (item: TreeSearchItem) => string;\n}\n\n/**\n * A {@link ListSearchAdapter} over any `TreeSearchHost` (`ixfx-tree-list`,\n * `ixfx-miller-list`, `ixfx-crumb-navigation`). Navigate reveals the match\n * (expands its ancestors, moves the cursor); select drives `selectMany`; filter\n * sets `filterPredicate`. The item set is the whole tree — `getNodes()` returns\n * every node regardless of expansion or an active filter — so refining a query\n * can always re-surface a node. See `docs/infra-incremental.md`.\n */\nexport function createTreeListSearchAdapter(\n host: TreeSearchHost,\n options: TreeListSearchAdapterOptions = {},\n): ListSearchAdapter<TreeSearchItem> {\n const getLabel = options.getLabel ?? ((item: TreeSearchItem) => item.node.item.label);\n\n return {\n getItems: () => host.getNodes(),\n getLabel,\n getKey: item => item.node.item.key,\n focusItem: (item) => {\n if (item)\n host.revealKey(item.node.item.key);\n },\n activateItem: (item) => {\n host.revealKey(item.node.item.key);\n host.select(item.node);\n },\n selectItems: (items) => {\n host.selectMany(items.map(i => i.node));\n },\n applyFilter: (matched) => {\n host.filterPredicate = matched === undefined\n ? undefined\n : (node: TreeNode) => matched.has(node.item.key);\n },\n highlightRoot: () => host.shadowRoot,\n highlightSelector: options.labelSelector ?? `.tree-label`,\n highlightKeyOf: el => (el.closest(`[data-key]`) as HTMLElement | null)?.dataset.key,\n highlightKey: options.highlightKey,\n };\n}\n"],"mappings":";;;;AAGA,SAAS,gBAAmB,MAAiB;CAC3C,IAAI,OAAO,SAAS,UAClB,OAAO;CACT,MAAM,IAAI;CACV,IAAI,OAAO,EAAE,UAAU,UACrB,OAAO,EAAE;CACX,IAAI,OAAO,EAAE,QAAQ,UACnB,OAAO,EAAE;CACX,IAAI,OAAO,EAAE,UAAU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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-CBS4z1v-.d.ts","names":[],"sources":["../src/incr-search/types.ts","../src/incr-search/ac-adapter.ts","../src/incr-search/controller-tree.ts","../src/incr-search/list-search-controller.ts","../src/incr-search/element-list-search-adapter.ts","../src/incr-search/element-search.ts","../src/incr-search/fuzzy.ts","../src/incr-search/highlight.ts","../src/incr-search/incr-search.ts","../src/incr-search/list-search-commands.ts","../src/incr-search/list-search-styles.ts","../src/incr-search/tree-list-search-adapter.ts"],"mappings":";;;;;;KAGY,iBAAiB;WAClB,MAAM;WACN,WAAW;WACX;;KAIC,gBAAgB;WACjB;WACA,SAAS,cAAc,iBAAiB;WAExC,iBAAiB,YAAY,GAAG;;KAG/B,yBAAyB,MAAM,OAAO,gBAAgB;KAEtD,kBAAkB;WACnB,iBAAiB;WACjB,YAAY,MAAM;WAClB,MAAM,QAAQ,WAAW;WACzB,WAAW,yBAAyB;;KAInC,WAAW;WACZ,WAAW,gBAAgB,KAAK,SAAS,gBAAgB;WACzD,WAAW,eAAe,SAAS,gBAAgB,QAAQ,gBAAgB;WAC3E,kBAAkB;WAClB,OAAO,gBAAgB;WACvB,WAAW,IAAI,yBAAyB;WACxC;;KAGC,mBAAmB;WACpB,YAAY,MAAM;WAClB,MAAM,QAAQ,WAAW;;KAGxB,YAAY;WACb,OAAO,kBAAkB,cAAc,iBAAiB;WACxD,gBAAgB;;KAIf;WACD,SAAS;WACT;WACA,WAAW;;KAGV;WACD;;KAGC;WACD,WAAW;WACX;WACA,YAAY,IAAI;WAChB,UAAU,IAAI;WACd;WACA;WACA,MAAM,QAAQ;IAAa;IAAa;;WACxC,WAAW;IAA2B;IAAa;;;;;;;;;;;;;;;;iBCnD9C,2BAA2B;EAAY;GACrD,gBAAgB,KAChB,UAAS,KAAK,mBAAmB,mBAC/B,eAAe,QAAQ,gBAAgB,QAAQ,MAAM;EAAM,WAAW;;;;KCR9D;EACV,WAAW;IAAQ,MAAM;IAAU;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