@ixfx/components 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/bundle/index.d.ts +53 -11
  2. package/bundle/index.d.ts.map +1 -1
  3. package/bundle/index.js +74 -17
  4. package/bundle/index.js.map +1 -1
  5. package/dist/ac-text.js +1 -1
  6. package/dist/ac-token.js +1 -1
  7. package/dist/crumbs.js +3 -3
  8. package/dist/data-grid.js +3 -3
  9. package/dist/detail-list.js +1 -1
  10. package/dist/{grid-list-u33vmKzb.d.ts → grid-list-C1T6WlEp.d.ts} +20 -3
  11. package/dist/grid-list-C1T6WlEp.d.ts.map +1 -0
  12. package/dist/{grid-list-nRUQOcEL.js → grid-list-bmBWq6P-.js} +47 -18
  13. package/dist/grid-list-bmBWq6P-.js.map +1 -0
  14. package/dist/grid-list.d.ts +2 -2
  15. package/dist/grid-list.js +1 -1
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.js +7 -7
  18. package/dist/{interaction-Cr13azbM.js → interaction-B9AAlsFO.js} +1 -1
  19. package/dist/{menu-Bg90Qr0B.js → menu-BDrTh6oo.js} +3 -3
  20. package/dist/{menu-Bg90Qr0B.js.map → menu-BDrTh6oo.js.map} +1 -1
  21. package/dist/{menu-item-Bx-Fs7jq.js → menu-item-B6pKg2Qq.js} +3 -3
  22. package/dist/{menu-item-Bx-Fs7jq.js.map → menu-item-B6pKg2Qq.js.map} +1 -1
  23. package/dist/menu.js +2 -2
  24. package/dist/miller.d.ts +1 -1
  25. package/dist/miller.js +2 -2
  26. package/dist/narrowed-text.js +2 -2
  27. package/dist/plots.d.ts +2 -2
  28. package/dist/plots.js +1 -1
  29. package/dist/select-horiz.js +2 -2
  30. package/dist/{tickled-controller-Bn3YdQsM.d.ts → tickled-controller-C1ZsHpyg.d.ts} +10 -1
  31. package/dist/tickled-controller-C1ZsHpyg.d.ts.map +1 -0
  32. package/dist/{tickled-controller-C66DgJHl.js → tickled-controller-Dh1Uh_vG.js} +4 -1
  33. package/dist/tickled-controller-Dh1Uh_vG.js.map +1 -0
  34. package/dist/{tree-Chptss7I.js → tree-4Jv28Nig.js} +3 -3
  35. package/dist/{tree-Chptss7I.js.map → tree-4Jv28Nig.js.map} +1 -1
  36. package/dist/tree.d.ts +1 -1
  37. package/dist/tree.js +1 -1
  38. package/dist/vertical-list.js +1 -1
  39. package/dist/{xy-axis-DzM1brBZ.js → xy-axis-CrrVdDFe.js} +28 -3
  40. package/dist/xy-axis-CrrVdDFe.js.map +1 -0
  41. package/dist/{xy-axis-BfP9hKLj.d.ts → xy-axis-DQqd2yXJ.d.ts} +28 -12
  42. package/dist/{xy-axis-BfP9hKLj.d.ts.map → xy-axis-DQqd2yXJ.d.ts.map} +1 -1
  43. package/docs-user/grid-list.md +45 -0
  44. package/docs-user/index.json +2 -2
  45. package/docs-user/infra-tickled.md +2 -0
  46. package/package.json +1 -1
  47. package/dist/grid-list-nRUQOcEL.js.map +0 -1
  48. package/dist/grid-list-u33vmKzb.d.ts.map +0 -1
  49. package/dist/tickled-controller-Bn3YdQsM.d.ts.map +0 -1
  50. package/dist/tickled-controller-C66DgJHl.js.map +0 -1
  51. package/dist/xy-axis-DzM1brBZ.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"grid-list-nRUQOcEL.js","names":["ITEM_SELECTOR","#host","#effectiveIndices","#items","#itemKey","#keysCache","#captionFor","#predicate","#searchKeys","#recomputeEffective","#slotNames","#seq","#syntheticKeys","#adapter","#sourceElement","#source","#emitSelect","#emitItemEvent","#itemWrap","#cancelScrollRaf","#scrollRaf","#emitViewportChange","#currentWindow","#scrollItemIntoView","#onCellActivate","#searchMode","#searchFilterKeys","#searchRegistry","#effectiveSearchModes","#unregisterSearchCommands","#syncAriaMultiselectable","#mutationObserver","#onChildrenChanged","#ensureSearch","#syncSearchCommands","#resizeObserver","#reflowTimer","#items","#syncItems","#noteChildMutation","#entering","#rebuildSource","#viewportRef","#measureViewport","#applyFilters","#zoomAnchor","#captureCentreAnchor","#applyZoomAnchor","#rawIndexOfKey","#windowKeys","#rowHeight","#selectedSnapshot","#onScroll","#renderDataCells","#renderElementCells","#renderDataCell","#onCellClick","#renderCell","#captionFor","customElement"],"sources":["../src/grid-list/grid-list-source.ts","../src/grid-list/grid-list.ts"],"sourcesContent":["import type { GridListDataAdapter } from './types.js';\nimport { html } from 'lit';\nimport { keyForElement } from '../interaction/keyed-list.js';\n\n/**\n * Uniform view over a grid-list's items, in either mode:\n *\n * - element mode ({@link ElementGridListSource}) — light-DOM children projected\n * through named `<slot>`s;\n * - data mode ({@link DataGridListSource}) — a plain array plus a\n * {@link GridListDataAdapter}.\n *\n * Everything else in `GridListElement` addresses items by **effective index**\n * (0…`count`, after `[hidden]` / filter / search) and **key**, and never\n * branches on the mode.\n */\nexport interface GridListSource {\n /** After `[hidden]`, the filter predicate and the live search filter. */\n readonly count: number;\n /** Before the filter predicate / search filter (element mode still drops `[hidden]`). */\n readonly rawCount: number;\n\n /** Effective index → key. Includes synthetic keys for keyless light-DOM items. */\n keyAt(index: number): string;\n /** Effective index of `key`, or `-1`. First match wins on duplicates. */\n indexOfKey(key: string): number;\n /** Every effective key, in order (synthetic keys included). */\n keys(): string[];\n\n /** Caption text for a cell. */\n labelAt(index: number): string;\n /** Raw (unfiltered) index → key — used by search, which sees the whole collection. */\n rawKeyAt(index: number): string;\n /** Raw (unfiltered) index → fzf haystack (falls back to the label). */\n rawSearchTextAt(index: number): string;\n\n /** `false` for `not-checked` / `disabled` items. */\n isSelectable(index: number): boolean;\n\n /** Lit-renderable cell content (element mode: a named `<slot>`; data mode: `adapter.render`). */\n renderCellContent(index: number): unknown;\n\n /** Push the current filter predicate / search-filter key set; recomputes the effective order. */\n setFilters(opts: { predicate?: ((index: number) => boolean) | undefined; searchKeys?: ReadonlySet<string> | undefined }): void;\n /** Re-read the underlying data. */\n refresh(): void;\n\n /** The Element for `key`, if this source has one. */\n resolveKeyToElement(key: string): Element | undefined;\n /** The data value for `key`, if this source has one. */\n resolveKeyToData(key: string): unknown;\n}\n\nconst ITEM_SELECTOR = `:scope > *`;\nconst SYNTHETIC_PREFIX = `gl-auto-`;\n\n/** Whether `key` is an auto-assigned key for a keyless light-DOM item. */\nexport function isSyntheticKey(key: string): boolean {\n return key.startsWith(SYNTHETIC_PREFIX);\n}\n\nfunction warnDuplicateKeys(keys: readonly string[]): void {\n const seen = new Set<string>();\n const dupes = new Set<string>();\n for (const k of keys) {\n if (isSyntheticKey(k))\n continue;\n if (seen.has(k))\n dupes.add(k);\n else\n seen.add(k);\n }\n if (dupes.size > 0) {\n console.warn(\n `ixfx-grid-list: duplicate item key(s) ${[...dupes].map(k => `\"${k}\"`).join(`, `)} — the first occurrence wins for key-based operations.`,\n );\n }\n}\n\nexport class ElementGridListSource implements GridListSource {\n readonly #host: HTMLElement;\n #items: Element[] = [];\n #slotNames = new WeakMap<Element, string>();\n #syntheticKeys = new WeakMap<Element, string>();\n #seq = 0;\n #predicate: ((index: number) => boolean) | undefined;\n #searchKeys: ReadonlySet<string> | undefined;\n #effectiveIndices: number[] = [];\n #keysCache: string[] | undefined;\n\n constructor(host: HTMLElement) {\n this.#host = host;\n this.refresh();\n }\n\n get count(): number {\n return this.#effectiveIndices.length;\n }\n\n get rawCount(): number {\n return this.#items.length;\n }\n\n keyAt(index: number): string {\n const eff = this.#effectiveIndices[index];\n return eff === undefined ? `` : this.#itemKey(this.#items[eff]);\n }\n\n indexOfKey(key: string): number {\n return this.#effectiveIndices.findIndex(i => this.#itemKey(this.#items[i]) === key);\n }\n\n keys(): string[] {\n this.#keysCache ??= this.#effectiveIndices.map(i => this.#itemKey(this.#items[i]));\n return this.#keysCache;\n }\n\n labelAt(index: number): string {\n const eff = this.#effectiveIndices[index];\n return eff === undefined ? `` : this.#captionFor(this.#items[eff]);\n }\n\n rawKeyAt(index: number): string {\n const el = this.#items[index];\n return el === undefined ? `` : this.#itemKey(el);\n }\n\n rawSearchTextAt(index: number): string {\n const el = this.#items[index];\n if (el === undefined)\n return ``;\n return (\n el.getAttribute(`data-search-label`)\n ?? el.getAttribute(`data-label`)\n ?? el.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()\n ?? el.textContent?.trim()\n ?? ``\n );\n }\n\n isSelectable(index: number): boolean {\n const eff = this.#effectiveIndices[index];\n return eff !== undefined && !this.#items[eff].hasAttribute(`not-checked`);\n }\n\n renderCellContent(index: number): unknown {\n const eff = this.#effectiveIndices[index];\n if (eff === undefined)\n return undefined;\n return html`<slot name=${this.slotNameFor(this.#items[eff])}></slot>`;\n }\n\n setFilters(opts: { predicate?: ((index: number) => boolean) | undefined; searchKeys?: ReadonlySet<string> | undefined }): void {\n if (`predicate` in opts)\n this.#predicate = opts.predicate;\n if (`searchKeys` in opts)\n this.#searchKeys = opts.searchKeys;\n this.#recomputeEffective();\n }\n\n refresh(): void {\n this.#items = Array.from(this.#host.querySelectorAll(ITEM_SELECTOR)).filter(\n el => !(el as HTMLElement).hidden,\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 warnDuplicateKeys(this.#items.map(el => this.#itemKey(el)));\n this.#recomputeEffective();\n }\n\n /** Effective-order elements — the array `GridListElement` renders and slices. */\n effectiveElements(): Element[] {\n return this.#effectiveIndices.map(i => this.#items[i]);\n }\n\n /** Raw-order element at `index`, or `undefined`. */\n rawElementAt(index: number): Element | undefined {\n return this.#items[index];\n }\n\n /** Stable per-element `<slot>` name. */\n slotNameFor(el: Element): string {\n let name = this.#slotNames.get(el);\n if (name === undefined) {\n this.#seq += 1;\n name = `gl-item-${this.#seq}`;\n this.#slotNames.set(el, name);\n }\n return name;\n }\n\n resolveKeyToElement(key: string): Element | undefined {\n if (isSyntheticKey(key))\n return this.#items.find(el => this.#syntheticKeys.get(el) === key);\n return this.#items.find(el => keyForElement(el) === key);\n }\n\n resolveKeyToData(_key: string): undefined {\n return undefined;\n }\n\n #recomputeEffective(): void {\n const effective: number[] = [];\n for (let i = 0; i < this.#items.length; i++) {\n if (this.#predicate !== undefined && !this.#predicate(i))\n continue;\n if (this.#searchKeys !== undefined) {\n const key = this.#itemKey(this.#items[i]);\n if (!isSyntheticKey(key) && !this.#searchKeys.has(key))\n continue;\n }\n effective.push(i);\n }\n this.#effectiveIndices = effective;\n this.#keysCache = undefined;\n }\n\n #itemKey(el: Element): string {\n const userKey = keyForElement(el);\n if (userKey !== undefined)\n return userKey;\n let synthetic = this.#syntheticKeys.get(el);\n if (synthetic === undefined) {\n this.#seq += 1;\n synthetic = `${SYNTHETIC_PREFIX}${this.#seq}`;\n this.#syntheticKeys.set(el, synthetic);\n }\n return synthetic;\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\nexport class DataGridListSource<T> implements GridListSource {\n #items: readonly T[];\n readonly #adapter: GridListDataAdapter<T>;\n #predicate: ((index: number) => boolean) | undefined;\n #searchKeys: ReadonlySet<string> | undefined;\n #effectiveIndices: number[] = [];\n #keysCache: string[] | undefined;\n\n constructor(items: readonly T[], adapter: GridListDataAdapter<T>) {\n this.#items = items;\n this.#adapter = adapter;\n warnDuplicateKeys(items.map((it, i) => adapter.key(it, i)));\n this.#recomputeEffective();\n }\n\n get count(): number {\n return this.#effectiveIndices.length;\n }\n\n get rawCount(): number {\n return this.#items.length;\n }\n\n keyAt(index: number): string {\n const eff = this.#effectiveIndices[index];\n return eff === undefined ? `` : this.#adapter.key(this.#items[eff], eff);\n }\n\n indexOfKey(key: string): number {\n return this.#effectiveIndices.findIndex(i => this.#adapter.key(this.#items[i], i) === key);\n }\n\n keys(): string[] {\n this.#keysCache ??= this.#effectiveIndices.map(i => this.#adapter.key(this.#items[i], i));\n return this.#keysCache;\n }\n\n labelAt(index: number): string {\n const eff = this.#effectiveIndices[index];\n if (eff === undefined)\n return ``;\n return this.#adapter.label?.(this.#items[eff], eff) ?? this.#adapter.key(this.#items[eff], eff);\n }\n\n rawKeyAt(index: number): string {\n return index < 0 || index >= this.#items.length ? `` : this.#adapter.key(this.#items[index], index);\n }\n\n rawSearchTextAt(index: number): string {\n if (index < 0 || index >= this.#items.length)\n return ``;\n const item = this.#items[index];\n return this.#adapter.searchableText?.(item, index) ?? this.#adapter.label?.(item, index) ?? ``;\n }\n\n isSelectable(index: number): boolean {\n const eff = this.#effectiveIndices[index];\n return eff !== undefined && !this.#adapter.disabled?.(this.#items[eff], eff);\n }\n\n renderCellContent(index: number): unknown {\n const eff = this.#effectiveIndices[index];\n return eff === undefined ? undefined : this.#adapter.render(this.#items[eff], eff);\n }\n\n setFilters(opts: { predicate?: ((index: number) => boolean) | undefined; searchKeys?: ReadonlySet<string> | undefined }): void {\n if (`predicate` in opts)\n this.#predicate = opts.predicate;\n if (`searchKeys` in opts)\n this.#searchKeys = opts.searchKeys;\n this.#recomputeEffective();\n }\n\n refresh(): void {\n this.#recomputeEffective();\n }\n\n /** Raw-order item at `index`, or `undefined`. */\n rawItemAt(index: number): T | undefined {\n return this.#items[index];\n }\n\n /** Effective-order item at `index`, or `undefined`. */\n getItemAt(index: number): T | undefined {\n const eff = this.#effectiveIndices[index];\n return eff === undefined ? undefined : this.#items[eff];\n }\n\n resolveKeyToElement(_key: string): undefined {\n return undefined;\n }\n\n resolveKeyToData(key: string): T | undefined {\n const idx = this.#items.findIndex((item, i) => this.#adapter.key(item, i) === key);\n return idx >= 0 ? this.#items[idx] : undefined;\n }\n\n #recomputeEffective(): void {\n const effective: number[] = [];\n for (let i = 0; i < this.#items.length; i++) {\n if (this.#predicate !== undefined && !this.#predicate(i))\n continue;\n if (this.#searchKeys !== undefined && !this.#searchKeys.has(this.#adapter.key(this.#items[i], i)))\n continue;\n effective.push(i);\n }\n this.#effectiveIndices = effective;\n this.#keysCache = undefined;\n }\n}\n","/* eslint-disable ts/no-unsafe-declaration-merging */\nimport type { CommandRegistry } from '@clinth/ui-commands';\nimport type { PropertyValues } from 'lit';\nimport type { DataListSearchItem, ListSearchMode } from '../incr-search/index.js';\nimport type { ListInteractionMode, ListSelectionMode } from '../interaction/list-selection-types.js';\nimport type { GridListSource } from './grid-list-source.js';\nimport type {\n GridListCaptionAlign,\n GridListCaptionBackdrop,\n GridListCaptionPosition,\n GridListCaptionStyle,\n GridListDataAdapter as GridListDataAdapterType,\n GridListFullElementEventMap,\n GridListItemClickDetail,\n GridListOrientation,\n GridListSelectDetail,\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 createDataListSearchAdapter,\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';\nimport { DataGridListSource, ElementGridListSource, isSyntheticKey } from './grid-list-source.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<T = unknown> 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 /* Consumer control over the native scrollbar (both orientations): set\n --grid-list-scrollbar-width to \"none\" to hide it or \"thin\" to slim it.\n The container is also exposed as ::part(viewport). */\n scrollbar-width: var(--grid-list-scrollbar-width, auto);\n scrollbar-gutter: var(--grid-list-scrollbar-gutter, auto);\n scrollbar-color: var(--grid-list-scrollbar-color, auto);\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 * Element-mode filter predicate (also driven by incremental filter-search).\n * Light-DOM items for which it returns `false` are removed from layout and\n * navigation. For data mode use {@link itemFilterPredicate}.\n */\n @property({ attribute: false })\n filterPredicate: ((el: Element) => boolean) | undefined;\n\n /**\n * Data-mode filter predicate. Items for which it returns `false` are removed\n * from layout and navigation without any element being materialised.\n */\n @property({ attribute: false })\n itemFilterPredicate: ((item: T, index: number) => 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 /**\n * Data items for data-backed mode. When set along with `itemAdapter`, the\n * component operates in data mode instead of element mode.\n */\n @property({ attribute: false })\n items: readonly T[] = [];\n\n /**\n * Adapter for data-backed mode. When set, the component renders items from\n * the `items` array using this adapter instead of projecting light-DOM children.\n */\n @property({ attribute: false })\n itemAdapter: GridListDataAdapterType<T> | 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 * The active view over the items. Element mode projects light-DOM children\n * through named `<slot>`s (owned by {@link ElementGridListSource}); data mode\n * renders from {@link items} via {@link itemAdapter}. Everything else here\n * addresses items by effective index + key and never branches on the mode.\n *\n * Initialised eagerly (element mode) so the public getters — `count`,\n * `selectedKeys`, … — are safe to touch before the first Lit update. The\n * first `willUpdate` rebuilds it once the light DOM / `itemAdapter` is known.\n */\n #sourceElement: ElementGridListSource | undefined = new ElementGridListSource(this);\n #source: GridListSource = this.#sourceElement!;\n\n readonly selection = new ListSelectionController<string>({\n getOrderedItems: () => this.#source.keys(),\n isSelectable: (k) => {\n const i = this.#source.indexOfKey(k);\n return i >= 0 && this.#source.isSelectable(i);\n },\n getModes: () => ({ selectionMode: this.selectionMode, interactionMode: this.interactionMode }),\n getKey: k => k,\n onChange: (selected, previous) => {\n this._syncItemStates();\n this.requestUpdate();\n this.#emitSelect(selected, previous);\n },\n });\n\n readonly tickled = new TickledController<string>(this, {\n // `keys()` is in effective order, so position === effective index — avoid a\n // per-key `indexOfKey` lookup (that would make this O(n²) for large lists).\n getItems: () =>\n this.#source.keys().map((k, i) => ({\n id: k,\n enabled: this.#source.isSelectable(i),\n })),\n onTickle: (k) => {\n if (k !== undefined)\n this.#emitItemEvent(`list-tickle`, k);\n },\n onStateChange: () => this._syncItemStates(),\n itemWrap: this.#itemWrap,\n });\n\n /**\n * Incremental search (navigate / select / filter). Element- or data-backed\n * depending on the mode; the mode-agnostic surface (`renderField`, `open`,\n * `close`, `setModes`, …) is the same either way. See `docs/infra-incremental.md`.\n */\n search!: ListSearchController<unknown>;\n\n #searchMode: `element` | `data` | undefined;\n #searchFilterKeys: ReadonlySet<string> | undefined;\n\n /** (Re)build {@link search} for the current mode; a no-op if it already matches. */\n #ensureSearch(): void {\n const mode = this.itemAdapter !== undefined ? `data` : `element`;\n if (this.#searchMode === mode && this.search !== undefined)\n return;\n\n const previous = this.search as ListSearchController<unknown> | undefined;\n if (previous) {\n previous.hostDisconnected();\n this.removeController(previous);\n }\n\n this.search = (mode === `data`\n ? new ListSearchController<DataListSearchItem>(this, {\n adapter: createDataListSearchAdapter(this, {\n rawCount: () => this.#source?.rawCount ?? 0,\n rawKeyAt: i => this.#source?.rawKeyAt(i) ?? ``,\n rawSearchTextAt: i => this.#source?.rawSearchTextAt(i) ?? ``,\n onFilterChange: (keys) => {\n this.#searchFilterKeys = keys;\n this.#source?.setFilters({ searchKeys: keys });\n this.requestUpdate();\n void this.updateComplete.then(() => this.#emitViewportChange());\n },\n onActivate: key => this.#onCellActivate(key),\n getHighlightRoot: () => this.renderRoot as ShadowRoot | Element,\n }),\n })\n : 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 })) as ListSearchController<unknown>;\n this.#searchMode = mode;\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 || !this.search)\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 if (!this.hasAttribute(`role`)) {\n this.setAttribute(`role`, `listbox`);\n }\n this.#syncAriaMultiselectable();\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.#ensureSearch();\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 // Prune selection / cursor for elements that were actually removed. Read the\n // records directly rather than diffing `keys()` before/after: a pending\n // `requestUpdate()` can let `updated()` re-sync the source before this\n // callback runs, which would hide the removal from a diff.\n const removedKeys: string[] = [];\n for (const record of records ?? []) {\n for (const node of record.removedNodes) {\n if (node.nodeType !== Node.ELEMENT_NODE)\n continue;\n const key = keyForElement(node as Element);\n if (key !== undefined)\n removedKeys.push(key);\n }\n }\n if (removedKeys.length > 0) {\n const present = new Set(this.#source.keys());\n const gone = removedKeys.filter(k => !present.has(k));\n if (gone.length > 0)\n this.selection.removeKeys(gone, k => k);\n const tickledId = this.tickled.tickledId;\n if (tickledId && gone.includes(tickledId))\n this.tickled.focus(undefined);\n }\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 renderedKeys: this.renderedKeys(),\n visibleKeys: this.visibleKeys(),\n });\n }\n\n protected override firstUpdated(): void {\n if (!this.#source)\n this.#rebuildSource();\n const el = this.#viewportRef.value;\n if (!el)\n return;\n this.#resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const w = entry.contentRect.width;\n const h = entry.contentRect.height;\n // A zero-sized observation (e.g. an inactive dock tab) must never\n // replace the last usable geometry — see #measureViewport / refreshLayout.\n if (w <= 0 || h <= 0)\n return;\n this._viewportWidth = w;\n this._viewportHeight = h;\n }\n });\n this.#resizeObserver.observe(el);\n this.#measureViewport(false);\n this.#syncItems();\n this.requestUpdate();\n }\n\n /** (Re)construct {@link #source} for the current mode and re-apply the filters. */\n #rebuildSource(): void {\n if (this.itemAdapter !== undefined) {\n this.#source = new DataGridListSource<T>(this.items, this.itemAdapter);\n this.#sourceElement = undefined;\n } else {\n this.#sourceElement = new ElementGridListSource(this);\n this.#source = this.#sourceElement;\n }\n this.#applyFilters();\n if (this.#searchFilterKeys)\n this.#source.setFilters({ searchKeys: this.#searchFilterKeys });\n }\n\n /** Push the current filter predicate into whichever source is active. */\n #applyFilters(): void {\n if (this.#source instanceof ElementGridListSource) {\n const fp = this.filterPredicate;\n const src = this.#source;\n src.setFilters({ predicate: fp ? i => fp(src.rawElementAt(i)!) : undefined });\n this.#items = src.effectiveElements();\n } else if (this.#source instanceof DataGridListSource) {\n const ip = this.itemFilterPredicate;\n const src = this.#source as DataGridListSource<T>;\n src.setFilters({ predicate: ip ? i => ip(src.rawItemAt(i) as T, i) : undefined });\n }\n }\n\n protected override willUpdate(changed: PropertyValues<this>): void {\n if (changed.has(`searchModes`)) {\n this.#syncSearchCommands();\n }\n if (changed.has(`filterPredicate`) || changed.has(`itemFilterPredicate`)) {\n this.#applyFilters();\n void this.updateComplete.then(() => this.#emitViewportChange());\n }\n\n const dataModeChanged = changed.has(`items`) || changed.has(`itemAdapter`);\n if (dataModeChanged) {\n this.#zoomAnchor = undefined;\n const prevKeys = this.#source?.keys() ?? [];\n const modeFlipped = (this.itemAdapter !== undefined)\n !== (this.#source instanceof DataGridListSource);\n this.#rebuildSource();\n const nextKeys = this.#source.keys();\n const nextKeySet = new Set(nextKeys);\n const removedKeys = prevKeys.filter(k => !nextKeySet.has(k));\n if (removedKeys.length > 0)\n this.selection.removeKeys(removedKeys, k => k);\n const tickledId = this.tickled.tickledId;\n if (tickledId && !nextKeySet.has(tickledId))\n this.tickled.focus(undefined);\n this._syncItemStates();\n // No requestUpdate() here — we're already in willUpdate, the render that\n // follows picks up the rebuilt source.\n void this.updateComplete.then(() => this.#emitViewportChange());\n if (modeFlipped) {\n this.#ensureSearch();\n this.#syncSearchCommands();\n }\n this.search?.refresh();\n }\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.#source.count > 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 this.#captureCentreAnchor(prevOffset, prevExtent, prevItemSize, prevGap, prevCaptionStyle, prevCaptionHeight, prevOrientation);\n }\n }\n }\n\n #syncAriaMultiselectable(): void {\n this.setAttribute(\n `aria-multiselectable`,\n this.selection.canSelectMultiple() ? `true` : `false`,\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 this.#syncAriaMultiselectable();\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 const vp = this.#viewportRef.value;\n if (vp) {\n if (Math.abs(vp.scrollTop - this._scrollTop) > 0.5) {\n vp.scrollTop = this._scrollTop;\n }\n if (Math.abs(vp.scrollLeft - this._scrollLeft) > 0.5) {\n vp.scrollLeft = this._scrollLeft;\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 #captureCentreAnchor(prevOffset: number, prevExtent: number, prevItemSize: number, prevGap: number, prevCaptionStyle: GridListCaptionStyle, prevCaptionHeight: number, prevOrientation: GridListOrientation): void {\n const count = this.#source?.count ?? 0;\n if (count === 0)\n return;\n const prevBand = prevCaptionStyle === `separate` || prevCaptionStyle === `under`;\n const prevRowHeight = prevItemSize + (prevBand ? prevCaptionHeight : 0);\n const horizontal = prevOrientation === `row`;\n const prev = computeGridWindow(\n count,\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(count - 1, lineFloor)\n : Math.min(\n count - 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 * Re-read the viewport after an ancestor's visibility/layout changed.\n * Safe while hidden (zero-sized reads are ignored); forces a repaint of the\n * virtual window even when the size is unchanged.\n */\n refreshLayout(): void {\n this.#measureViewport(true);\n }\n\n /** Alias of {@link refreshLayout}. */\n remeasure(): void {\n this.#measureViewport(true);\n }\n\n #measureViewport(forceRender = false): void {\n const vp = this.#viewportRef.value;\n if (!vp)\n return;\n const w = vp.clientWidth;\n const h = vp.clientHeight;\n if (w <= 0 || h <= 0)\n return;\n const horizontal = this.orientation === `row`;\n const changed = w !== this._viewportWidth || h !== this._viewportHeight;\n if (changed) {\n const prevOffset = horizontal ? this._scrollLeft : this._scrollTop;\n const prevExtent = horizontal ? w : h;\n this.#captureCentreAnchor(\n prevOffset,\n prevExtent,\n this.itemSize,\n this.gap,\n this.captionStyle,\n this.captionHeight,\n this.orientation,\n );\n this._viewportWidth = w;\n this._viewportHeight = h;\n }\n if (forceRender && !changed) {\n this.#captureCentreAnchor(\n horizontal ? this._scrollLeft : this._scrollTop,\n horizontal ? w : h,\n this.itemSize,\n this.gap,\n this.captionStyle,\n this.captionHeight,\n this.orientation,\n );\n this.requestUpdate();\n }\n if (changed || forceRender) {\n void this.updateComplete.then(() => this.#emitViewportChange());\n }\n }\n\n /**\n * Element mode only: re-read the light DOM into the source and refresh the\n * `#items` cache + filter. A no-op in data mode (the source is rebuilt through\n * `#rebuildSource` when `items` / `itemAdapter` change).\n */\n #syncItems(): void {\n if (this.#source instanceof ElementGridListSource) {\n this.#source.refresh();\n this.#applyFilters();\n }\n }\n\n get count(): number {\n return this.#source.count;\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 const els = new Set<Element>();\n for (const key of this.selection.selectedKeys) {\n const el = this.#source.resolveKeyToElement(key);\n if (el)\n els.add(el);\n }\n return els;\n }\n\n /**\n * The selection as stable `data-key` / `data-value` strings. Auto-assigned\n * keys for keyless light-DOM items are omitted (they are not a stable contract\n * for the consumer).\n */\n get selectedKeys(): ReadonlySet<string> {\n const out = new Set<string>();\n for (const k of this.selection.selectedKeys) {\n if (!isSyntheticKey(k))\n out.add(k);\n }\n return out;\n }\n\n select(item: Element): void {\n const key = keyForElement(item);\n if (key)\n this.selection.replace(key);\n }\n\n selectMany(items: Iterable<Element>): void {\n const keys: string[] = [];\n for (const item of items) {\n const key = keyForElement(item);\n if (key)\n keys.push(key);\n }\n this.selection.selectMany(keys);\n }\n\n deselect(item: Element): void {\n const key = keyForElement(item);\n if (key)\n this.selection.deselect(key);\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, k => k);\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, k => k);\n }\n\n /** Remove items by key from the selection. */\n removeSelectedKeys(keys: Iterable<string>): void {\n this.selection.removeKeys(keys, k => k);\n }\n\n /**\n * Data mode only: raw index of `key` in `this.items`, or `-1`. Data-mode keys\n * come straight from the adapter, so this is exact even under a filter/search.\n */\n #rawIndexOfKey(key: string): number {\n const adapter = this.itemAdapter;\n if (!adapter)\n return -1;\n return this.items.findIndex((it, i) => adapter.key(it, i) === key);\n }\n\n /**\n * Data mode: replace the whole item array. Selection and cursor keep any key\n * that is still present; keys that vanish are dropped (one `list-select`).\n * A no-op in element mode.\n */\n setItems(items: readonly T[]): void {\n if (this.itemAdapter)\n this.items = items;\n }\n\n /**\n * Data mode: append items to the end. Scroll position, selection and cursor\n * are untouched; appended items don't play the mid-list `[reflowing]` slide.\n * A no-op in element mode.\n */\n appendItems(items: readonly T[]): void {\n if (this.itemAdapter && items.length > 0)\n this.items = [...this.items, ...items];\n }\n\n /**\n * Data mode: replace the item carrying `key`. A visible cell re-renders in\n * place (the keyed subtree is kept); an offscreen item shows its new content\n * when scrolled into view. Scroll and selection are untouched. Unknown keys\n * are ignored.\n */\n updateItem(key: string, item: T): void {\n if (!this.itemAdapter)\n return;\n const idx = this.#rawIndexOfKey(key);\n if (idx < 0)\n return;\n const next = [...this.items];\n next[idx] = item;\n this.items = next;\n }\n\n /**\n * Data mode: remove the items carrying these keys. Removed keys are dropped\n * from selection and cursor (via the `items` change). A no-op in element mode.\n */\n removeItems(keys: Iterable<string>): void {\n if (!this.itemAdapter)\n return;\n const adapter = this.itemAdapter;\n const keySet = new Set(keys);\n this.items = this.items.filter((it, i) => !keySet.has(adapter.key(it, i)));\n }\n\n /**\n * Data mode: drop every item. Selection and cursor are reset and one\n * `list-select` with empty sets is emitted. A no-op in element mode.\n */\n clearItems(): void {\n if (!this.itemAdapter)\n return;\n this.selection.reset();\n this.tickled.focus(undefined);\n this.items = [];\n this.#emitSelect(new Set(), new Set());\n }\n\n /** Move the cursor to the item with this key and scroll it into view. */\n focusKey(key: string): void {\n const index = this.#source.indexOfKey(key);\n if (index < 0)\n return;\n this.tickled.focus(key);\n this.#scrollItemIntoView(key);\n }\n\n /** The key of the item under the cursor, or `undefined`. */\n get tickledKey(): string | undefined {\n return this.tickled.tickledId;\n }\n\n /** Element mode: the light-DOM element carrying `key`, or `undefined`. */\n getItem(key: string): Element | undefined {\n return this.#source.resolveKeyToElement(key);\n }\n\n /** Element mode: the light-DOM element at effective index `index`. */\n getItemByIndex(index: number): Element | undefined {\n return this.#items[index];\n }\n\n /** Data mode: the data value carrying `key`, or `undefined`. */\n getData(key: string): T | undefined {\n return this.#source.resolveKeyToData(key) as T | undefined;\n }\n\n getKey(item: Element): string | undefined {\n return keyForElement(item);\n }\n\n /**\n * Keys of items in the rendered window (viewport + overscan) — the priority\n * set for prefetching. Use {@link visibleKeys} for the strict viewport\n * intersection. Auto-assigned keyless-item keys are omitted.\n */\n renderedKeys(): string[] {\n return this.#windowKeys(this.#currentWindow());\n }\n\n /**\n * Keys of items actually intersecting the viewport (no overscan).\n * Auto-assigned keyless-item keys are omitted.\n */\n visibleKeys(): string[] {\n return this.#windowKeys(this.#currentWindow(true));\n }\n\n #windowKeys(win: GridWindow): string[] {\n return this.#source\n .keys()\n .slice(win.startIndex, win.endIndex)\n .filter(k => !isSyntheticKey(k));\n }\n\n #currentWindow(noOverscan = false): GridWindow {\n const overscan = noOverscan ? 0 : 2;\n return computeGridWindow(\n this.#source.count,\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 overscan,\n );\n }\n\n /** Adjust the scroll offset so `key` is fully within the viewport. */\n #scrollItemIntoView(key: string): void {\n const index = this.#source.indexOfKey(key);\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 const selected = this.selection.selectedKeys;\n for (const el of this.#items) {\n const key = keyForElement(el);\n el.toggleAttribute(`data-tickled`, key !== undefined && this.tickled.isTickled(key));\n el.toggleAttribute(`data-selected`, key !== undefined && selected.has(key));\n }\n this.setAttribute(`data-input-mode`, this.tickled.inputMode);\n }\n\n #emitSelect(selected: ReadonlySet<string>, previous: ReadonlySet<string>): void {\n const selectedEls = new Set<Element>();\n const previousEls = new Set<Element>();\n for (const key of selected) {\n const el = this.#source.resolveKeyToElement(key);\n if (el)\n selectedEls.add(el);\n }\n for (const key of previous) {\n const el = this.#source.resolveKeyToElement(key);\n if (el)\n previousEls.add(el);\n }\n this._dispatch<GridListSelectDetail>(`list-select`, {\n selected: selectedEls,\n previous: previousEls,\n selectedKeys: this.selectedKeys,\n previousKeys: new Set([...previous].filter(k => !isSyntheticKey(k))),\n });\n }\n\n #emitItemEvent(name: `list-tickle` | `list-item-click` | `list-activate`, key: string): void {\n const index = this.#source.indexOfKey(key);\n const element = this.#source.resolveKeyToElement(key);\n const item = element ?? this.#source.resolveKeyToData(key);\n this._dispatch<GridListItemClickDetail>(name, { item, key, index, element });\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 /** Selected keys, snapshotted once per render so the cell renderers don't each rebuild the set. */\n #selectedSnapshot: ReadonlySet<string> = new Set();\n\n protected override render(): ReturnType<typeof html> {\n const win = this.#currentWindow();\n this.#selectedSnapshot = this.selection.selectedKeys;\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 ${this.#source instanceof DataGridListSource\n ? this.#renderDataCells(win)\n : this.#renderElementCells(win)}\n </div>\n </div>\n ${this.search?.renderField()}\n `;\n }\n\n #renderDataCells(win: GridWindow): ReturnType<typeof html> {\n const slice = Array.from({ length: win.endIndex - win.startIndex }, (_, i) => win.startIndex + i);\n return repeat(\n slice,\n index => this.#source.keyAt(index),\n index => this.#renderDataCell(index, win),\n ) as ReturnType<typeof html>;\n }\n\n #renderDataCell(index: number, win: GridWindow): ReturnType<typeof html> {\n const key = this.#source.keyAt(index);\n const selected = this.#selectedSnapshot.has(key);\n const tickled = this.tickled.isTickled(key);\n const style = this.captionStyle;\n const separate = style === `separate`;\n const caption = style === `hidden` ? `` : this.#source.labelAt(index);\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 const y = win.horizontal\n ? Math.max(0, (this._viewportHeight - cellHeight) / 2)\n : rowOf(index, win.cols) * win.rowStride;\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` : ``}\"\n part=\"item${selected ? ` selected` : ``}${tickled ? ` tickled` : ``}\"\n role=\"option\"\n aria-selected=${selected ? `true` : `false`}\n style=\"width:${this.itemSize}px;height:${cellHeight}px;transform:translate(${x}px,${y}px)\"\n data-index=${index}\n data-key=${key}\n ?data-selected=${selected}\n ?data-tickled=${tickled}\n @click=${(e: MouseEvent) => this.#onCellClick(e, key)}\n @dblclick=${() => this.#onCellActivate(key)}\n @pointerenter=${() => this.tickled.handlePointerEnter(key)}\n >\n <div class=\"content\" part=\"content\">${this.#source.renderCellContent(index)}</div>\n ${showCaption\n ? html`<div class=\"caption\" part=\"caption\" style=${captionCss} title=${caption}>${caption}</div>`\n : ``}\n </div>\n `;\n }\n\n #renderElementCells(win: GridWindow): ReturnType<typeof html> {\n const slice = this.#items.slice(win.startIndex, win.endIndex);\n return repeat(\n slice,\n (_el, i) => this.#source.keyAt(win.startIndex + i),\n (el, i) => this.#renderCell(el, win.startIndex + i, win),\n ) as ReturnType<typeof html>;\n }\n\n #renderCell(el: Element, index: number, win: GridWindow): ReturnType<typeof html> {\n const key = this.#source.keyAt(index);\n const selected = this.#selectedSnapshot.has(key);\n const tickled = this.tickled.isTickled(key);\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${selected ? ` selected` : ``}${tickled ? ` tickled` : ``}\"\n role=\"option\"\n aria-selected=${selected ? `true` : `false`}\n style=\"width:${this.itemSize}px;height:${cellHeight}px;transform:translate(${x}px,${y}px)\"\n data-index=${index}\n data-key=${key}\n ?data-selected=${selected}\n ?data-tickled=${tickled}\n @click=${(e: MouseEvent) => this.#onCellClick(e, key)}\n @dblclick=${() => this.#onCellActivate(key)}\n @pointerenter=${() => this.tickled.handlePointerEnter(key)}\n >\n <div class=\"thumb\" part=\"thumb\" style=${thumbStyle}>\n ${this.#source.renderCellContent(index)}\n </div>\n ${showCaption\n ? html`<div class=\"caption\" part=\"caption\" style=${captionCss} title=${caption}>${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, key: string): void {\n this.selection.handleClick(key, e);\n this.#emitItemEvent(`list-item-click`, key);\n }\n\n #onCellActivate(key: string): void {\n if (this.interactionMode !== `manual`) {\n this.selection.replace(key);\n }\n this.#emitItemEvent(`list-activate`, key);\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.#source.count;\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.#source.indexOfKey(this.tickled.tickledId)\n : -1;\n const nextIndex = Math.max(0, Math.min(count - 1, from + delta));\n const nextKey = this.#source.keyAt(nextIndex);\n if (nextKey) {\n this.tickled.handleKeyboardNavigation(nextKey);\n this.#scrollItemIntoView(nextKey);\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.#emitItemEvent(`list-item-click`, 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":";;;;;;;;;;;;;;;AAqDA,MAAMA,kBAAgB;AACtB,MAAM,mBAAmB;;AAGzB,SAAgB,eAAe,KAAsB;CACnD,OAAO,IAAI,WAAW,gBAAgB;AACxC;AAEA,SAAS,kBAAkB,MAA+B;CACxD,MAAM,uBAAO,IAAI,IAAY;CAC7B,MAAM,wBAAQ,IAAI,IAAY;CAC9B,KAAK,MAAM,KAAK,MAAM;EACpB,IAAI,eAAe,CAAC,GAClB;EACF,IAAI,KAAK,IAAI,CAAC,GACZ,MAAM,IAAI,CAAC;OAEX,KAAK,IAAI,CAAC;CACd;CACA,IAAI,MAAM,OAAO,GACf,QAAQ,KACN,yCAAyC,CAAC,GAAG,KAAK,CAAC,CAAC,KAAI,MAAK,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE,uDACpF;AAEJ;AAEA,IAAa,wBAAb,MAA6D;CAC3D;CACA,SAAoB,CAAC;CACrB,6BAAa,IAAI,QAAyB;CAC1C,iCAAiB,IAAI,QAAyB;CAC9C,OAAO;CACP;CACA;CACA,oBAA8B,CAAC;CAC/B;CAEA,YAAY,MAAmB;EAC7B,KAAKC,QAAQ;EAC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AA;AAQjD,WAAA,CAAA,SAAS,EAAE,WAAW,MAAM,CAAC,CAAA,GAAA,gBAAA,WAAA,mBAAA,KAAA,CAAA;AAO7B,WAAA,CAAA,SAAS,EAAE,WAAW,MAAM,CAAC,CAAA,GAAA,gBAAA,WAAA,uBAAA,KAAA,CAAA;AAQ7B,WAAA,CAAA,SAAS;CAAE,MAAM;CAAQ,WAAW;CAAgB,SAAS;AAAK,CAAC,CAAA,GAAA,gBAAA,WAAA,eAAA,KAAA,CAAA;AAOnE,WAAA,CAAA,SAAS,EAAE,WAAW,MAAM,CAAC,CAAA,GAAA,gBAAA,WAAA,SAAA,KAAA,CAAA;AAO7B,WAAA,CAAA,SAAS,EAAE,WAAW,MAAM,CAAC,CAAA,GAAA,gBAAA,WAAA,eAAA,KAAA,CAAA;AAG7B,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;AA3WR0C,kBAAAA,WAAAA,CAAAA,kBAAc,gBAAgB,CAAA,GAAA,eAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"grid-list-u33vmKzb.d.ts","names":[],"sources":["../src/grid-list/types.ts","../src/interaction/list-selection-controller.ts","../src/grid-list/grid-list.ts"],"mappings":";;;;;;;;;;KAuBY,oBAAoB;EAC9B,MAAM,MAAM,GAAG;EACf,SAAS,MAAM,GAAG;EAClB,SAAS,MAAM,GAAG;EAClB,YAAY,MAAM,GAAG;EACrB,kBAAkB,MAAM,GAAG;;;;;;;;;;;;;KA0BjB;;KAGA;;KAGA;;;;;;;;KASA;;;;;;;;KASA;UAEK;WACN,UAAU,YAAY;WACtB,UAAU,YAAY;WACtB,cAAc;W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;;;;;EAO1C,YAAY,IAAI;;;;;;;;;;;;;;;;;;;;;;;EAwBhB;;;;EAKA,mBAAmB;;;;;;EAOnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0DW,kBAAkB,uBAAuB;UAC5C;UACA;UACA;UACA;iBAEO;iBACA;iBACA;iBACA;0BAES;EAIZ,YAAA,MAAM,wBAAwB,QAAQ,wBAAwB;EAO1E;EAOA;;;;MAUI,aAAa;;;;MAOb,aAAa;;;;;MAQb,WAAW;;;;;;EASf,MAAM,IAAI;;;;EAOV,UAAU,IAAI;;;;;;iBASC;;;;;aAiBJ;;;;;;EASX,mBAAmB,IAAI;;;;;;EAiCvB,mBAAmB,IAAI;;;;;;;EAYvB,yBAAyB,oDAAoD;;;;;EAkE7E,WAAW,IAAI;;;;;;EAmBf;;;;;EAmBA,aAAa,MAAM"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tickled-controller-C66DgJHl.js","names":[],"sources":["../src/interaction/tickled-controller.ts"],"sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Represents an item that can be tickled (highlighted via hover or keyboard navigation)\n */\nexport type TickledItem<T = unknown> = {\n /**\n * Unique identifier for the item (e.g., index, id, path)\n */\n readonly id: T;\n\n /**\n * Whether the item is currently enabled/interactive\n */\n readonly enabled?: boolean;\n};\n\n/**\n * Input mode determines which mechanism controls the tickled state\n */\nexport type InputMode = `keyboard` | `mouse`;\n\n/**\n * Configuration for TickledController\n */\nexport type TickledControllerConfig<T> = {\n /**\n * Function to retrieve all items that can be tickled\n */\n getItems: () => ReadonlyArray<TickledItem<T>>;\n\n /**\n * Optional callback when an item becomes tickled\n * Use this for side effects like opening submenus\n * @param id - The id of the newly tickled item, or undefined if nothing is tickled\n */\n onTickle?: (id: T | undefined) => void;\n\n /**\n * Optional callback fired after any state change (tickled id or input mode)\n * Use this to sync DOM attributes for slotted content that can't use reactive rendering\n *\n * For components that render items directly, this is usually not needed as\n * Lit's reactive rendering will handle updates automatically via requestUpdate()\n *\n * @example\n * ```ts\n * onStateChange: () => {\n * // Sync data-tickled attributes for slotted items\n * const items = this.getItems();\n * items.forEach((item, i) => {\n * if (this.tickled.isTickled(i)) {\n * item.setAttribute('data-tickled', '');\n * } else {\n * item.removeAttribute('data-tickled');\n * }\n * });\n * }\n * ```\n */\n onStateChange?: () => void;\n\n /**\n * Optional initial input mode (defaults to 'mouse')\n */\n initialInputMode?: InputMode;\n\n /**\n * Whether keyboard navigation wraps from last to first and vice versa.\n * - 'stop' (default): navigation stops at the boundary\n * - 'wrap': navigation wraps around\n */\n itemWrap?: `stop` | `wrap`;\n};\n\n/**\n * ReactiveController that manages \"tickled\" state for interactive lists.\n *\n * A \"tickled\" item is one that is under active attention via hover (mouse mode)\n * or keyboard focus (keyboard mode). Only one item can be tickled at a time.\n *\n * The input mode determines which mechanism controls tickled state:\n * - Mouse mode: hover controls tickled, keyboard navigation ignored\n * - Keyboard mode: keyboard navigation controls tickled, hover ignored\n *\n * Last interaction wins - any mouse hover switches to mouse mode, any keyboard\n * navigation switches to keyboard mode.\n *\n * ## Global Mouse Tracking\n *\n * This controller uses a single, ref-counted global `pointermove` listener (shared\n * across all instances) to track actual mouse movement. This prevents `pointerenter`\n * events caused by content scrolling from incorrectly switching to mouse mode when\n * the user is actually using keyboard navigation. The listener is attached when the\n * first host connects and removed once the last host disconnects.\n *\n * @example\n * ```ts\n * class MyList extends LitElement {\n * private tickled = new TickledController(this, {\n * getItems: () => this.items.map((item, i) => ({ id: i, enabled: !item.disabled })),\n * onTickle: (id) => {\n * // Optional: perform side effect when item is tickled\n * console.log('Tickled item:', id);\n * }\n * });\n *\n * render() {\n * return html`\n * <ul @pointerleave=${(e) => this.tickled.handlePointerLeave(e)}>\n * ${this.items.map((item, i) => html`\n * <li\n * class=\"item ${this.tickled.isTickled(i) ? 'tickled' : ''}\"\n * @pointerenter=${() => this.tickled.handlePointerEnter(i)}\n * >${item.label}</li>\n * `)}\n * </ul>\n * `;\n * }\n *\n * private handleKeyDown(e: KeyboardEvent) {\n * if (e.key === 'ArrowDown') {\n * this.tickled.handleKeyboardNavigation('next');\n * } else if (e.key === 'ArrowUp') {\n * this.tickled.handleKeyboardNavigation('previous');\n * }\n * }\n * }\n * ```\n */\nexport class TickledController<T = number> implements ReactiveController {\n private host: ReactiveControllerHost;\n private config: TickledControllerConfig<T>;\n private _tickledId: T | undefined = undefined;\n private _inputMode: InputMode;\n\n private static _lastMouseClientX: number = Number.NaN;\n private static _lastMouseClientY: number = Number.NaN;\n private static _mouseMovedSinceKeyboard: boolean = true;\n private static _listenerRefCount: number = 0;\n\n private static readonly _onGlobalPointerMove = (e: PointerEvent): void => {\n TickledController.handleGlobalPointerMove(e.clientX, e.clientY);\n };\n\n constructor(host: ReactiveControllerHost, config: TickledControllerConfig<T>) {\n this.host = host;\n this.config = config;\n this._inputMode = config.initialInputMode ?? `mouse`;\n host.addController(this);\n }\n\n hostConnected(): void {\n if (TickledController._listenerRefCount === 0) {\n document.addEventListener(`pointermove`, TickledController._onGlobalPointerMove, { passive: true });\n }\n TickledController._listenerRefCount++;\n }\n\n hostDisconnected(): void {\n TickledController._listenerRefCount--;\n if (TickledController._listenerRefCount === 0) {\n document.removeEventListener(`pointermove`, TickledController._onGlobalPointerMove);\n }\n }\n\n /**\n * Get the current input mode\n */\n get inputMode(): InputMode {\n return this._inputMode;\n }\n\n /**\n * Get the currently tickled item id\n */\n get tickledId(): T | undefined {\n return this._tickledId;\n }\n\n /**\n * The item currently under the cursor, or `undefined`. Alias of `tickledId`\n * for parity with other controllers.\n */\n get current(): T | undefined {\n return this._tickledId;\n }\n\n /**\n * Move the cursor programmatically (e.g. to reveal a match or re-seat it\n * after the item set changed). Does not change the input mode. Alias of\n * `setTickled`.\n */\n focus(id: T | undefined): void {\n this.setTickled(id);\n }\n\n /**\n * Check if a specific item is tickled\n */\n isTickled(id: T): boolean {\n return this._tickledId === id;\n }\n\n /**\n * Handle global pointer move event.\n * Called automatically by the global listener.\n * Tracks mouse movement to distinguish real hover from content scrolling.\n */\n private static handleGlobalPointerMove(clientX: number, clientY: number): void {\n if (!Number.isNaN(TickledController._lastMouseClientX)) {\n if (\n clientX !== TickledController._lastMouseClientX\n || clientY !== TickledController._lastMouseClientY\n ) {\n TickledController._mouseMovedSinceKeyboard = true;\n }\n }\n TickledController._lastMouseClientX = clientX;\n TickledController._lastMouseClientY = clientY;\n }\n\n /**\n * Check if actual mouse movement has occurred since last keyboard interaction.\n * Used to distinguish real hover/leave from content-scrolling-induced events.\n */\n static get hasMouseMovedSinceKeyboard(): boolean {\n return TickledController._mouseMovedSinceKeyboard;\n }\n\n /**\n * Handle pointer enter event on an item (mouse hover).\n * Only processes if actual mouse movement is detected (not content scrolling).\n * Switches to mouse mode and tickles the item.\n */\n handlePointerEnter(id: T): void {\n if (!TickledController._mouseMovedSinceKeyboard) {\n return;\n }\n\n const items = this.config.getItems();\n const item = items.find(item => item.id === id);\n if (item && item.enabled === false) {\n return;\n }\n\n const modeChanged = this._inputMode !== `mouse`;\n this._inputMode = `mouse`;\n\n const previousId = this._tickledId;\n this._tickledId = id;\n\n this.host.requestUpdate();\n\n if (previousId !== id && this.config.onTickle) {\n this.config.onTickle(id);\n }\n\n if ((previousId !== id || modeChanged) && this.config.onStateChange) {\n this.config.onStateChange();\n }\n }\n\n /**\n * Handle pointer leave event on an item.\n * Only clears tickled state if actual mouse movement is detected.\n * @param _e The pointer event (not used, but kept for API compatibility)\n */\n handlePointerLeave(_e: PointerEvent): void {\n if (TickledController._mouseMovedSinceKeyboard) {\n this.clearTickled();\n }\n }\n\n /**\n * Handle keyboard navigation.\n * Switches to keyboard mode and moves tickled state.\n *\n * @param direction - 'next', 'previous', 'first', 'last', or specific id\n */\n handleKeyboardNavigation(direction: `next` | `previous` | `first` | `last` | T): void {\n const modeChanged = this._inputMode !== `keyboard`;\n this._inputMode = `keyboard`;\n\n const items = this.config.getItems();\n const enabledItems = items.filter(item => item.enabled !== false);\n\n if (enabledItems.length === 0) {\n return;\n }\n\n let newId: T | undefined;\n\n if (direction === `first`) {\n newId = enabledItems[0].id;\n } else if (direction === `last`) {\n newId = enabledItems.at(-1)?.id;\n } else if (direction === `next` || direction === `previous`) {\n const currentIndex = enabledItems.findIndex(item => item.id === this._tickledId);\n const wrap = this.config.itemWrap === `wrap`;\n\n if (currentIndex === -1) {\n newId = direction === `next` ? enabledItems[0].id : enabledItems.at(-1)?.id;\n } else {\n const delta = direction === `next` ? 1 : -1;\n let newIndex = currentIndex + delta;\n\n if (newIndex >= 0 && newIndex < enabledItems.length) {\n newId = enabledItems[newIndex].id;\n } else if (wrap) {\n // Wrap around\n if (newIndex < 0) {\n newIndex = enabledItems.length - 1;\n } else {\n newIndex = 0;\n }\n newId = enabledItems[newIndex].id;\n }\n // If newIndex is out of bounds and wrap is disabled, keep current tickled item\n }\n } else {\n const item = enabledItems.find(item => item.id === direction);\n if (item) {\n newId = item.id;\n }\n }\n\n if (newId !== undefined) {\n const previousId = this._tickledId;\n this._tickledId = newId;\n this.host.requestUpdate();\n\n if (previousId !== newId && this.config.onTickle) {\n this.config.onTickle(newId);\n }\n\n if ((previousId !== newId || modeChanged) && this.config.onStateChange) {\n this.config.onStateChange();\n }\n }\n }\n\n /**\n * Manually set the tickled item (useful for programmatic control).\n * Does NOT change input mode.\n */\n setTickled(id: T | undefined): void {\n const previousId = this._tickledId;\n this._tickledId = id;\n this.host.requestUpdate();\n\n if (previousId !== id && this.config.onTickle) {\n this.config.onTickle(id);\n }\n\n if (previousId !== id && this.config.onStateChange) {\n this.config.onStateChange();\n }\n }\n\n /**\n * Clear the tickled state (e.g., on pointer leave).\n * Note: For pointer leave events, prefer using handlePointerLeave() which\n * checks for actual mouse movement.\n */\n clearTickled(): void {\n if (this._tickledId !== undefined) {\n this._tickledId = undefined;\n this.host.requestUpdate();\n\n if (this.config.onTickle) {\n this.config.onTickle(undefined);\n }\n\n if (this.config.onStateChange) {\n this.config.onStateChange();\n }\n }\n }\n\n /**\n * Manually set the input mode.\n * When switching to keyboard mode, resets the mouse movement tracking.\n */\n setInputMode(mode: InputMode): void {\n if (this._inputMode !== mode) {\n this._inputMode = mode;\n this.host.requestUpdate();\n\n if (mode === `keyboard`) {\n TickledController._mouseMovedSinceKeyboard = false;\n }\n\n if (this.config.onStateChange) {\n this.config.onStateChange();\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkIA,IAAa,oBAAb,MAAa,kBAA4D;;EAM5B,KAAA,oBAAA;;;EACA,KAAA,oBAAA;;;EACQ,KAAA,2BAAA;;;EACR,KAAA,oBAAA;;;EAEK,KAAA,wBAAA,MAA0B;GACxE,kBAAkB,wBAAwB,EAAE,SAAS,EAAE,OAAO;EAChE;;CAEA,YAAY,MAA8B,QAAoC;EAZ1C,KAAA,aAAA,KAAA;EAalC,KAAK,OAAO;EACZ,KAAK,SAAS;EACd,KAAK,aAAa,OAAO,oBAAoB;EAC7C,KAAK,cAAc,IAAI;CACzB;CAEA,gBAAsB;EACpB,IAAI,kBAAkB,sBAAsB,GAC1C,SAAS,iBAAiB,eAAe,kBAAkB,sBAAsB,EAAE,SAAS,KAAK,CAAC;EAEpG,kBAAkB;CACpB;CAEA,mBAAyB;EACvB,kBAAkB;EAClB,IAAI,kBAAkB,sBAAsB,GAC1C,SAAS,oBAAoB,eAAe,kBAAkB,oBAAoB;CAEtF;;;;CAKA,IAAI,YAAuB;EACzB,OAAO,KAAK;CACd;;;;CAKA,IAAI,YAA2B;EAC7B,OAAO,KAAK;CACd;;;;;CAMA,IAAI,UAAyB;EAC3B,OAAO,KAAK;CACd;;;;;;CAOA,MAAM,IAAyB;EAC7B,KAAK,WAAW,EAAE;CACpB;;;;CAKA,UAAU,IAAgB;EACxB,OAAO,KAAK,eAAe;CAC7B;;;;;;CAOA,OAAe,wBAAwB,SAAiB,SAAuB;EAC7E,IAAI,CAAC,OAA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