@ixfx/components 0.5.15 → 0.5.17

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 (62) hide show
  1. package/bundle/index.d.ts +17 -4
  2. package/bundle/index.d.ts.map +1 -1
  3. package/bundle/index.js +482 -103
  4. package/bundle/index.js.map +1 -1
  5. package/dist/ac-text.js +2 -2
  6. package/dist/checkbox.js +1 -1
  7. package/dist/{colour-picker-DGso9ZOp.js → colour-picker-DbypcEp6.js} +2 -2
  8. package/dist/{colour-picker-DGso9ZOp.js.map → colour-picker-DbypcEp6.js.map} +1 -1
  9. package/dist/colour-picker.js +1 -1
  10. package/dist/crumb-navigation-DFqTzElw.js +1149 -0
  11. package/dist/crumb-navigation-DFqTzElw.js.map +1 -0
  12. package/dist/crumbs.d.ts +16 -3
  13. package/dist/crumbs.d.ts.map +1 -1
  14. package/dist/crumbs.js +1 -821
  15. package/dist/data-display.js +1 -1
  16. package/dist/editable-label.js +1 -1
  17. package/dist/{fallbacks-pNMOMx38.js → fallbacks-DPgPEqo8.js} +51 -1
  18. package/dist/{fallbacks-pNMOMx38.js.map → fallbacks-DPgPEqo8.js.map} +1 -1
  19. package/dist/{icon-B22XVlCt.js → icon-DG9Lm3LT.js} +2 -2
  20. package/dist/{icon-B22XVlCt.js.map → icon-DG9Lm3LT.js.map} +1 -1
  21. package/dist/icons.js +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +16 -14
  25. package/dist/index.js.map +1 -1
  26. package/dist/labelled-radial-input.js +2 -2
  27. package/dist/{menu-nuOIUD9K.js → menu-B8gE2MSo.js} +4 -4
  28. package/dist/{menu-nuOIUD9K.js.map → menu-B8gE2MSo.js.map} +1 -1
  29. package/dist/{menu-item-BBTZnjAR.js → menu-item-BYRvfyXK.js} +5 -4
  30. package/dist/menu-item-BYRvfyXK.js.map +1 -0
  31. package/dist/menu-item-DSyf9f_L.d.ts.map +1 -1
  32. package/dist/menu.js +2 -2
  33. package/dist/miller.js +1 -1
  34. package/dist/narrowed-text.js +1 -1
  35. package/dist/panel.js +2 -2
  36. package/dist/polar-pad.js +1 -1
  37. package/dist/{radial-input-DxCrt_NE.js → radial-input-CVxGH-Cp.js} +2 -2
  38. package/dist/{radial-input-DxCrt_NE.js.map → radial-input-CVxGH-Cp.js.map} +1 -1
  39. package/dist/radial-input.js +1 -1
  40. package/dist/range-input.js +1 -1
  41. package/dist/range.js +1 -1
  42. package/dist/selecthorizontal.js +1 -1
  43. package/dist/{slider-input-DFpG23bS.js → slider-input-CzmSVgm7.js} +2 -2
  44. package/dist/{slider-input-DFpG23bS.js.map → slider-input-CzmSVgm7.js.map} +1 -1
  45. package/dist/slider-input.js +1 -1
  46. package/dist/split-layout.js +1 -1
  47. package/dist/swipe.js +1 -1
  48. package/dist/{tab-list-DhkVhRQc.js → tab-list-6W5CgXix.js} +2 -2
  49. package/dist/{tab-list-DhkVhRQc.js.map → tab-list-6W5CgXix.js.map} +1 -1
  50. package/dist/{tab-list-BohmbvqF.d.ts → tab-list-ih-0I0NE.d.ts} +2 -2
  51. package/dist/{tab-list-BohmbvqF.d.ts.map → tab-list-ih-0I0NE.d.ts.map} +1 -1
  52. package/dist/tabs.d.ts +1 -1
  53. package/dist/tabs.js +1 -1
  54. package/dist/{tree-CL-txefQ.js → tree-BtiiDX1a.js} +2 -2
  55. package/dist/{tree-CL-txefQ.js.map → tree-BtiiDX1a.js.map} +1 -1
  56. package/dist/tree.js +1 -1
  57. package/dist/xy-pad.js +1 -1
  58. package/docs-user/crumbs.md +38 -9
  59. package/docs-user/tabs.md +19 -2
  60. package/package.json +1 -1
  61. package/dist/crumbs.js.map +0 -1
  62. package/dist/menu-item-BBTZnjAR.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tab-list-DhkVhRQc.js","names":["#items","#syncIndicatorColors","#isVertical","#selectPrevious","#selectNext","#dragState","#abortDrag","#endDrag","#containerEl","#suppressNextClick","#findDragTarget","#onPointerMove","#onPointerUp","#onPointerCancel","#beginDrag","#computeGapIndex","#commitDrag","#containerClass","#computeCaretStyle","#onKeyUp","#onSlotClick","#onPointerDown","#onKeyDown","#onWheel","#onSlotChange","#isSelected","#createGhost","customElement"],"sources":["../src/util/drag-ghost.ts","../src/tabs/tab-list.ts"],"sourcesContent":["/**\n * Theme-aware floating element helper.\n *\n * Creates a `position: fixed`, `pointer-events: none` element anchored to a\n * source element's theme container, then exposes imperative `move` / `destroy`\n * hooks. Used by `ixfx-tab-list` for its drag-ghost; intended to be reusable\n * by future drag/detach features.\n *\n * Theme container lookup mirrors `tooltip-controller.ts` so the floating\n * element still inherits the right CSS custom properties when the source lives\n * inside a `.theme-dark` / `.theme-light` subtree (used by the loader iframes).\n */\nlet stylesInjected = false;\n\nfunction injectGhostStyles(): void {\n if (stylesInjected)\n return;\n stylesInjected = true;\n const style = document.createElement(`style`);\n style.textContent = `\n .ixfx-drag-ghost {\n position: fixed;\n top: 0;\n left: 0;\n pointer-events: none;\n z-index: 10000;\n will-change: transform;\n opacity: 0.9;\n display: inline-flex;\n align-items: center;\n gap: var(--space-xs, 4px);\n padding: var(--padding, var(--space-m, 8px)) calc(2 * var(--padding, var(--space-m, 8px)));\n background: var(--surface-4);\n color: var(--surface-4-text);\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-m, 6px);\n font-family: inherit;\n font-size: inherit;\n font-weight: 500;\n white-space: nowrap;\n max-width: 240px;\n overflow: hidden;\n text-overflow: ellipsis;\n box-shadow: var(--shadow-m);\n }\n .ixfx-drag-ghost ixfx-icon {\n flex-shrink: 0;\n }\n `;\n document.head.appendChild(style);\n}\n\nexport interface DragGhost {\n /** Position the ghost at (x, y) viewport coords, anchored around the source center. */\n move: (x: number, y: number) => void;\n /** Remove the ghost from the DOM. Idempotent. */\n destroy: () => void;\n /** The underlying ghost element (rarely needed outside this module). */\n readonly element: HTMLElement;\n}\n\nexport interface CreateDragGhostOptions {\n /** Content element to mount inside the ghost. Will be appended on create. */\n content: HTMLElement;\n /**\n * Anchor element — used to find the theme container and to compute the\n * initial offset so the ghost appears centered under the source on first move.\n */\n anchor: HTMLElement;\n /** Optional class name appended to the ghost wrapper for custom styling. */\n className?: string;\n}\n\n/**\n * Create a theme-aware floating ghost element.\n *\n * The ghost is appended to the closest `.theme-dark` / `.theme-light` ancestor\n * of `anchor`, falling back to `document.body`. This preserves CSS variable\n * inheritance for theming.\n */\nexport function createDragGhost(opts: CreateDragGhostOptions): DragGhost {\n injectGhostStyles();\n\n const ghost = document.createElement(`div`);\n ghost.className = `ixfx-drag-ghost`;\n if (opts.className)\n ghost.classList.add(opts.className);\n ghost.appendChild(opts.content);\n\n // Place ghost off-screen until first `move()` call\n ghost.style.transform = `translate3d(-9999px, -9999px, 0)`;\n\n const targetDoc = opts.anchor.ownerDocument;\n const themeContainer = opts.anchor.closest(`.theme-dark, .theme-light`);\n if (themeContainer) {\n themeContainer.appendChild(ghost);\n } else {\n targetDoc.body.appendChild(ghost);\n }\n\n // Anchor offset: distance from the source's top-left to its center.\n const anchorRect = opts.anchor.getBoundingClientRect();\n const offsetX = anchorRect.width / 2;\n const offsetY = anchorRect.height / 2;\n\n return {\n element: ghost,\n move(x: number, y: number): void {\n ghost.style.transform = `translate3d(${x - offsetX}px, ${y - offsetY}px, 0)`;\n },\n destroy(): void {\n ghost.remove();\n },\n };\n}\n","import type { PropertyValues } from \"lit\";\nimport type { DragGhost } from \"../util/drag-ghost.js\";\nimport type { TabListItemElement } from \"./tab-list-item.js\";\nimport { css, html, LitElement, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { themeFallbacks } from \"../styles/fallbacks.js\";\nimport { safeCustomElement as customElement } from \"../util/custom-elements.js\";\nimport { createDragGhost } from \"../util/drag-ghost.js\";\n\n/**\n * Events\n * 'change' - new tab selected { previous:string, selected:string, for:string }\n * 'reorder' - tab moved within the list { id:string, fromIndex:number, toIndex:number }\n */\nexport type TabListChangeDetail = {\n readonly previous: string | undefined;\n readonly selected: string;\n readonly for: string;\n};\n\nexport type TabListChangeEvent = CustomEvent<TabListChangeDetail>;\n\nexport type TabListReorderDetail = {\n readonly id: string;\n readonly fromIndex: number;\n readonly toIndex: number;\n};\n\nexport type TabListReorderEvent = CustomEvent<TabListReorderDetail>;\n\nexport type TabListDragMode = `off` | `reorder`;\n\n/** Pointer movement threshold (px) before a press becomes a drag. */\nconst DRAG_THRESHOLD_PX = 5;\n\n@customElement(`ixfx-tab-list`)\nexport class TabListElement extends LitElement {\n @property({ type: String })\n orientation: `horizontal` | `vertical-stack` | `vertical-side` = `horizontal`;\n\n @property({ type: Boolean })\n flip = false;\n\n @property({ type: Boolean })\n scrollable = false;\n\n @property({ type: String, attribute: `drag-mode` })\n dragMode: TabListDragMode = `off`;\n\n #items: TabListItemElement[] = [];\n\n // ── Drag state (not reactive) ────────────────────────────────────────\n #dragState: {\n pointerId: number;\n source: TabListItemElement;\n fromIndex: number;\n startX: number;\n startY: number;\n active: boolean;\n ghost: DragGhost | null;\n gapIndex: number | undefined;\n } | null = null;\n\n #suppressNextClick = false;\n\n get #isVertical(): boolean {\n return this.orientation === `vertical-stack` || this.orientation === `vertical-side`;\n }\n\n get #containerClass(): string {\n const base = this.scrollable ? `${this.orientation} scrollable` : this.orientation;\n return this.dragMode === `reorder` ? `${base} reorder` : base;\n }\n\n override render() {\n const caretStyle = this.#computeCaretStyle();\n return html`\n <div\n tabindex=0\n @keyup=${this.#onKeyUp}\n @click=${this.#onSlotClick}\n @pointerdown=${this.#onPointerDown}\n @keydown=${this.#onKeyDown}\n @wheel=${this.#onWheel}\n id=\"container\"\n class=${this.#containerClass}\n >\n <slot @slotchange=${this.#onSlotChange}></slot>\n ${caretStyle\n ? html`<div class=\"drop-caret\" style=${caretStyle}></div>`\n : nothing}\n </div>`;\n }\n\n #onSlotChange = () => {\n this.updateComplete.then(() => {\n this.#items = (this.shadowRoot?.querySelector(`slot`) as HTMLSlotElement)\n ?.assignedElements({ flatten: true }) as TabListItemElement[] ?? [];\n this.#syncIndicatorColors();\n });\n };\n\n override firstUpdated() {\n this.updateComplete.then(() => {\n if (this.#items.length > 0) {\n this.#syncIndicatorColors();\n }\n });\n }\n\n override updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n this.classList.toggle(`scrollable`, this.scrollable);\n if (changedProperties.has(`dragMode`)) {\n this.toggleAttribute(`drag-mode`, this.dragMode !== `off`);\n }\n }\n\n #syncIndicatorColors() {\n for (const item of this.#items) {\n item.style.setProperty(`--indicator-color-bottom`, `transparent`);\n item.style.setProperty(`--indicator-color-top`, `transparent`);\n item.style.setProperty(`--indicator-color-left`, `transparent`);\n item.style.setProperty(`--indicator-color-right`, `transparent`);\n\n if (item.hasAttribute(`selected`)) {\n if (this.orientation === `horizontal` && !this.flip) {\n item.style.setProperty(`--indicator-color-bottom`, `var(--accent)`);\n } else if (this.orientation === `horizontal` && this.flip) {\n item.style.setProperty(`--indicator-color-top`, `var(--accent)`);\n } else if (this.#isVertical && !this.flip) {\n item.style.setProperty(`--indicator-color-right`, `var(--accent)`);\n } else if (this.#isVertical && this.flip) {\n item.style.setProperty(`--indicator-color-left`, `var(--accent)`);\n }\n }\n }\n }\n\n #onKeyUp = (event: KeyboardEvent) => {\n const key = event.key;\n if (this.#isVertical) {\n if (key === `ArrowUp`) {\n this.#selectPrevious();\n } else if (key === `ArrowDown`) {\n this.#selectNext();\n }\n } else {\n if (key === `ArrowRight`) {\n this.#selectNext();\n } else if (key === `ArrowLeft`) {\n this.#selectPrevious();\n }\n }\n };\n\n // Escape during drag aborts it (and tears down listeners / releases capture)\n #onKeyDown = (event: KeyboardEvent): void => {\n const state = this.#dragState;\n if (event.key !== `Escape` || !state?.active)\n return;\n event.preventDefault();\n const pointerId = state.pointerId;\n this.#abortDrag();\n this.#endDrag(pointerId);\n };\n\n /**\n * Translate vertical wheel deltas into horizontal scroll on a scrollable\n * horizontal list (and vice-versa for vertical lists). Without this, the\n * default browser behaviour only scrolls horizontally with Shift+wheel or a\n * physical horizontal wheel — neither of which most users reach for on a\n * VS Code-style tab strip.\n *\n * Only kicks in when the list is actually scrollable (overflow content\n * present), and is a no-op when nothing is scrollable in that direction.\n */\n #onWheel = (event: WheelEvent): void => {\n if (!this.scrollable)\n return;\n const el = this.#containerEl;\n if (!el)\n return;\n\n if (!this.#isVertical) {\n // Horizontal list: vertical wheel → horizontal scroll.\n if (event.deltaY === 0 || el.scrollWidth <= el.clientWidth)\n return;\n const prev = el.scrollLeft;\n el.scrollLeft = prev + event.deltaY;\n if (el.scrollLeft !== prev)\n event.preventDefault();\n } else {\n // Vertical list: vertical wheel is already native; only intervene when\n // a horizontal wheel is supplied (e.g. trackpad two-finger horizontal).\n if (event.deltaX === 0 || el.scrollHeight <= el.clientHeight)\n return;\n const prev = el.scrollTop;\n el.scrollTop = prev + event.deltaX;\n if (el.scrollTop !== prev)\n event.preventDefault();\n }\n };\n\n getSelectedElement() {\n for (const el of this.#items) {\n if (this.#isSelected(el))\n return el;\n }\n // Fallback: #items may not be populated yet (slotchange hasn't fired).\n // Query the slot directly to find the selected element.\n const slot = this.shadowRoot?.querySelector(`slot`);\n if (slot) {\n const els = (slot as HTMLSlotElement).assignedElements({ flatten: true });\n for (const el of els) {\n if (this.#isSelected(el as HTMLElement))\n return el as TabListItemElement;\n }\n }\n }\n\n #isSelected(el: HTMLElement) {\n const v = el.getAttribute(`selected`);\n if (v === null)\n return false;\n return (el.hasAttribute(`selected`));\n }\n\n selectElement(el: HTMLElement) {\n const existing = this.getSelectedElement();\n if (existing) {\n existing.removeAttribute(`selected`);\n existing.style.setProperty(`--indicator-color-bottom`, `transparent`);\n existing.style.setProperty(`--indicator-color-top`, `transparent`);\n existing.style.setProperty(`--indicator-color-left`, `transparent`);\n existing.style.setProperty(`--indicator-color-right`, `transparent`);\n }\n\n el.setAttribute(`selected`, ``);\n\n if (this.orientation === `horizontal` && !this.flip) {\n el.style.setProperty(`--indicator-color-bottom`, `var(--accent)`);\n } else if (this.orientation === `horizontal` && this.flip) {\n el.style.setProperty(`--indicator-color-top`, `var(--accent)`);\n } else if (this.#isVertical && !this.flip) {\n el.style.setProperty(`--indicator-color-right`, `var(--accent)`);\n } else if (this.#isVertical && this.flip) {\n el.style.setProperty(`--indicator-color-left`, `var(--accent)`);\n }\n }\n\n #selectNext() {\n let found = false;\n for (const el of this.#items) {\n if (this.#isSelected(el) && !found) {\n found = true;\n } else if (found) {\n this.selectElement(el);\n break;\n }\n }\n }\n\n #selectPrevious() {\n let prev: HTMLElement | undefined;\n for (const el of this.#items) {\n if (this.#isSelected(el) && prev) {\n this.selectElement(prev);\n } else {\n prev = el;\n }\n }\n }\n\n #onSlotClick = (event: MouseEvent) => {\n if (this.#suppressNextClick) {\n this.#suppressNextClick = false;\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n this.focus();\n const t = (event.target as HTMLElement).closest(`ixfx-tab-list-item`);\n if (!t)\n return;\n const previous = this.getSelectedElement();\n this.selectElement(t);\n\n const forId = t.getAttribute(`for`);\n const previousId = previous?.id;\n this.dispatchEvent(new CustomEvent<TabListChangeDetail>(`change`, {\n bubbles: true,\n detail: {\n previous: previousId,\n selected: t.id,\n for: forId ?? ``,\n },\n }));\n };\n\n // ── Drag handling ────────────────────────────────────────────────────\n\n /**\n * Walk composedPath looking for the nearest ancestor tab-list-item, but bail\n * if the path goes through a `.close-btn` or `.toolbar` (so close/toolbar\n * buttons always win — same delegation pattern used by tooltip-controller).\n */\n #findDragTarget(event: PointerEvent): TabListItemElement | null {\n if (this.dragMode === `off`)\n return null;\n\n const path = event.composedPath();\n let item: TabListItemElement | null = null;\n for (const node of path) {\n if (!(node instanceof HTMLElement))\n continue;\n if (node.classList.contains(`close-btn`) || node.classList.contains(`toolbar`)) {\n return null;\n }\n if (!item && node.tagName === `IXFX-TAB-LIST-ITEM`) {\n item = node as TabListItemElement;\n }\n }\n return item;\n }\n\n #onPointerDown = (event: PointerEvent): void => {\n if (this.dragMode !== `reorder`)\n return;\n if (event.button !== 0)\n return;\n const target = this.#findDragTarget(event);\n if (!target)\n return;\n\n const fromIndex = this.#items.indexOf(target);\n if (fromIndex < 0)\n return;\n\n // Don't capture the pointer yet — doing so on pointerdown would redirect\n // the trailing click event to the capture target (the container), so the\n // click handler would see a container DIV as its target instead of the\n // tab-list-item and `closest('ixfx-tab-list-item')` would return null.\n // We capture only once the drag actually activates (#beginDrag). Until\n // then, an ordinary press still produces a normal click on the tab.\n\n this.#dragState = {\n pointerId: event.pointerId,\n source: target,\n fromIndex,\n startX: event.clientX,\n startY: event.clientY,\n active: false,\n ghost: null,\n gapIndex: undefined,\n };\n\n // Listen at window level for move/up so we don't lose events if the\n // pointer exits the host before pointerup fires.\n window.addEventListener(`pointermove`, this.#onPointerMove);\n window.addEventListener(`pointerup`, this.#onPointerUp);\n window.addEventListener(`pointercancel`, this.#onPointerCancel);\n };\n\n #onPointerMove = (event: PointerEvent): void => {\n const state = this.#dragState;\n if (!state || event.pointerId !== state.pointerId)\n return;\n\n const dx = event.clientX - state.startX;\n const dy = event.clientY - state.startY;\n const distance = Math.hypot(dx, dy);\n\n if (!state.active) {\n if (distance < DRAG_THRESHOLD_PX)\n return;\n this.#beginDrag(event);\n }\n\n state.ghost?.move(event.clientX, event.clientY);\n\n const gap = this.#computeGapIndex(event.clientX, event.clientY);\n if (gap !== state.gapIndex) {\n state.gapIndex = gap;\n this.requestUpdate();\n }\n };\n\n #onPointerUp = (event: PointerEvent): void => {\n const state = this.#dragState;\n if (!state || event.pointerId !== state.pointerId)\n return;\n\n if (state.active) {\n const gap = this.#computeGapIndex(event.clientX, event.clientY);\n this.#commitDrag(state.source, state.fromIndex, gap);\n }\n this.#endDrag(event.pointerId);\n };\n\n #onPointerCancel = (event: PointerEvent): void => {\n const state = this.#dragState;\n if (!state || event.pointerId !== state.pointerId)\n return;\n this.#abortDrag();\n this.#endDrag(event.pointerId);\n };\n\n #beginDrag(event: PointerEvent): void {\n const state = this.#dragState;\n if (!state || state.active)\n return;\n\n // Now that we know we're dragging, capture the pointer so pointermove/up\n // events keep flowing even if the pointer leaves the host element.\n try {\n this.#containerEl?.setPointerCapture(event.pointerId);\n } catch {\n // setPointerCapture can throw if pointer is already captured elsewhere;\n // fall through — window listeners still catch move/up.\n }\n\n state.active = true;\n state.source.setAttribute(`drag-source`, ``);\n\n state.ghost = this.#createGhost(state.source);\n if (state.ghost) {\n state.ghost.move(event.clientX, event.clientY);\n }\n }\n\n #abortDrag(): void {\n const state = this.#dragState;\n if (!state)\n return;\n state.source.removeAttribute(`drag-source`);\n if (state.gapIndex !== undefined) {\n state.gapIndex = undefined;\n this.requestUpdate();\n }\n // Caller is responsible for invoking #endDrag to release pointer capture,\n // tear down listeners, and destroy the ghost.\n }\n\n #endDrag(pointerId: number): void {\n const state = this.#dragState;\n if (!state)\n return;\n\n state.ghost?.destroy();\n state.ghost = null;\n this.#dragState = null;\n\n window.removeEventListener(`pointermove`, this.#onPointerMove);\n window.removeEventListener(`pointerup`, this.#onPointerUp);\n window.removeEventListener(`pointercancel`, this.#onPointerCancel);\n\n try {\n this.#containerEl?.releasePointerCapture(pointerId);\n } catch { /* already released */ }\n\n // #dragState is a private field, not a Lit-reactive property — setting it\n // to null doesn't trigger a re-render on its own. Without this, the caret\n // (and any other drag-time UI) would remain in the DOM after the drag\n // ends, even though the next render would clear them.\n this.requestUpdate();\n }\n\n #commitDrag(source: TabListItemElement, fromIndex: number, gapIndex: number | undefined): void {\n source.removeAttribute(`drag-source`);\n\n // gapIndex is an index into the without-source siblings array: 0 = before\n // the first sibling, siblings.length = after the last. The siblings array\n // already excludes source, so we can insert directly at that position\n // using siblings[gapIndex] as the reference (or null to append).\n const siblings = this.#items.filter(el => el !== source);\n const target = gapIndex === undefined\n ? siblings.length\n : Math.max(0, Math.min(gapIndex, siblings.length));\n\n const parent = source.parentNode;\n if (!parent)\n return;\n\n const ref = siblings[target] ?? null;\n parent.insertBefore(source, ref);\n\n const toIndex = Array.prototype.indexOf.call(parent.children, source);\n if (toIndex === fromIndex) {\n // Dropped in the same gap the item already occupies — no reorder, and no\n // click suppression (a real click on the same tab is still meaningful).\n return;\n }\n\n // Refresh cached #items so subsequent drags / queries see the new order\n // (slotchange does NOT fire on reorder, only on add/remove).\n this.#items = (this.shadowRoot?.querySelector(`slot`) as HTMLSlotElement)\n ?.assignedElements({ flatten: true }) as TabListItemElement[] ?? [];\n this.#syncIndicatorColors();\n\n // A real reorder just happened. The trailing click event (which the\n // browser still fires after pointerup) would re-select whatever is under\n // the release point — not what the user wanted. Suppress it.\n this.#suppressNextClick = true;\n\n this.dispatchEvent(new CustomEvent<TabListReorderDetail>(`reorder`, {\n bubbles: true,\n detail: {\n id: source.id,\n fromIndex,\n toIndex,\n },\n }));\n }\n\n #createGhost(source: TabListItemElement): DragGhost | null {\n const content = document.createElement(`span`);\n content.style.display = `inline-flex`;\n content.style.alignItems = `center`;\n content.style.gap = `var(--space-xs, 4px)`;\n content.style.minWidth = `0`;\n\n const iconName = source.iconName;\n if (iconName) {\n const icon = document.createElement(`ixfx-icon`) as HTMLElement & { name: string };\n icon.name = iconName;\n content.appendChild(icon);\n }\n\n // Reconstruct label text from light-DOM children that aren't slotted.\n // We want the text content of the source item, excluding `slot=\"toolbar\"`\n // descendants (the close button lives inside the item's shadow DOM, not\n // its light DOM, so it isn't part of childNodes here).\n const label = document.createElement(`span`);\n label.textContent = (source.textContent ?? ``).trim();\n label.style.overflow = `hidden`;\n label.style.textOverflow = `ellipsis`;\n label.style.whiteSpace = `nowrap`;\n content.appendChild(label);\n\n try {\n return createDragGhost({ anchor: source, content });\n } catch {\n return null;\n }\n }\n\n /**\n * Compute the index of the gap nearest the pointer, ignoring the source item.\n * Returns 0..#items.length-1; undefined if no siblings.\n *\n * Per the plan: drag-mode=\"reorder\" has \"no sense of breaking out\", so the\n * perpendicular axis is ignored — the pointer always resolves to some gap.\n */\n #computeGapIndex(clientX: number, clientY: number): number | undefined {\n const state = this.#dragState;\n if (!state)\n return undefined;\n const siblings = this.#items.filter(el => el !== state.source);\n if (siblings.length === 0)\n return 0;\n\n const useX = !this.#isVertical;\n\n let bestGap = 0;\n let bestDist = Infinity;\n\n // For each sibling, decide: gap is \"before this sibling\" or \"after\" based\n // on which side of the midpoint the pointer is on. Pick the gap whose\n // position (the midpoint if \"before\", the edge if \"after\") is closest to\n // the pointer on the relevant axis.\n for (let i = 0; i < siblings.length; i++) {\n const rect = siblings[i].getBoundingClientRect();\n const start = useX ? rect.left : rect.top;\n const end = useX ? rect.right : rect.bottom;\n const mid = (start + end) / 2;\n const pos = useX ? clientX : clientY;\n\n // Two candidate gaps: before this sibling (at `start`) and after (at `end`).\n // \"Before\" gap index = i; \"after\" gap index = i + 1.\n const dStart = Math.abs(pos - start);\n const dMid = Math.abs(pos - mid);\n const dEnd = Math.abs(pos - end);\n\n // Heuristic: if pointer is left/above midpoint, prefer the \"before\" gap;\n // otherwise prefer the \"after\" gap. Within those, the closer edge wins.\n const preferBefore = pos < mid;\n if (preferBefore) {\n // Gap i (before this sibling)\n if (dStart < bestDist) {\n bestDist = dStart;\n bestGap = i;\n }\n } else {\n // Gap i+1 (after this sibling)\n if (dEnd < bestDist) {\n bestDist = dEnd;\n bestGap = i + 1;\n }\n }\n // The midpoint-distance is mostly redundant with the above but handles\n // ties near the boundary cleanly — no-op for the chosen gap.\n void dMid;\n }\n\n return bestGap;\n }\n\n #computeCaretStyle(): string | undefined {\n const state = this.#dragState;\n if (!state?.active || state.gapIndex === undefined)\n return undefined;\n\n const siblings = this.#items.filter(el => el !== state.source);\n if (siblings.length === 0)\n return undefined;\n\n const useX = !this.#isVertical;\n const containerRect = this.#containerEl?.getBoundingClientRect();\n if (!containerRect)\n return undefined;\n\n const gap = Math.max(0, Math.min(state.gapIndex, siblings.length));\n let rect: DOMRect | null = null;\n if (gap < siblings.length) {\n rect = siblings[gap].getBoundingClientRect();\n } else {\n // After the last sibling: use its trailing edge\n const last = siblings[siblings.length - 1].getBoundingClientRect();\n rect = last;\n }\n\n if (useX) {\n const x = (gap < siblings.length ? rect.left : rect.right) - containerRect.left;\n const y = 0;\n const h = containerRect.height;\n const w = 2;\n return `transform: translate(${x - w / 2}px, ${y}px); width: ${w}px; height: ${h}px;`;\n } else {\n const y = (gap < siblings.length ? rect.top : rect.bottom) - containerRect.top;\n const x = 0;\n const w = containerRect.width;\n const h = 2;\n return `transform: translate(${x}px, ${y - h / 2}px); width: ${w}px; height: ${h}px;`;\n }\n }\n\n get #containerEl(): HTMLElement | null {\n return this.shadowRoot?.getElementById(`container`) ?? null;\n }\n\n static styles = [themeFallbacks, css`\n :host {\n display: inline-block;\n --activated-colour: var(--accent);\n --colour: var(--surface-3-text);\n --scroll-max-height: 200px;\n --allow-overflow: hidden;\n color: var(--colour);\n border: var(--border, none);\n border-color: var(--surface-5);\n border-radius: var(--radius-l, 8px) var(--radius-l, 8px) 0 0;\n\n }\n :host(.scrollable) {\n max-height: var(--scroll-max-height);\n }\n text {\n user-select:none;\n }\n #container {\n display:flex;\n position: relative;\n }\n #container.horizontal {\n flex-direction: row;\n overflow: hidden;\n }\n #container.horizontal.scrollable {\n overflow-x: auto;\n --allow-overflow: visible;\n }\n #container.horizontal.scrollable ::slotted(ixfx-tab-list-item) {\n flex-shrink: 0;\n }\n #container.vertical-stack {\n flex-direction: column;\n }\n #container.vertical-stack.flip {\n flex-direction: column-reverse;\n }\n #container.vertical-stack.scrollable {\n overflow-y: auto;\n max-height: var(--scroll-max-height);\n --allow-overflow: visible;\n }\n #container.vertical-side {\n flex-direction: column;\n }\n #container.vertical-side.flip {\n flex-direction: column-reverse;\n }\n #container.vertical-side.scrollable {\n overflow-y: auto;\n max-height: var(--scroll-max-height);\n --allow-overflow: visible;\n }\n\n ::slotted(ixfx-tab-list-item) {\n flex: 1 1 auto;\n min-width: 0;\n }\n\n #container.vertical-side ::slotted(ixfx-tab-list-item) {\n writing-mode: vertical-lr;\n text-orientation: mixed;\n }\n #container.vertical-side.flip ::slotted(ixfx-tab-list-item) {\n writing-mode: vertical-rl;\n text-orientation: mixed;\n }\n\n /* Drag affordances — opt-in via drag-mode=\"reorder\" on the host (list). */\n #container.reorder ::slotted(ixfx-tab-list-item) {\n cursor: grab;\n }\n :host([drag-mode]) ::slotted(ixfx-tab-list-item[drag-source]) {\n cursor: grabbing;\n opacity: 0.4;\n transition: opacity var(--transition, 0.15s ease-out);\n }\n\n /* Insertion caret shown during an active drag. */\n .drop-caret {\n position: absolute;\n background: var(--accent);\n border-radius: 1px;\n pointer-events: none;\n z-index: 1;\n }\n\n ::slotted(.activated) {\n --colour: var(--activated-colour);\n }\n `];\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"ixfx-tab-list\": TabListElement;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAYA,IAAI,iBAAiB;AAErB,SAAS,oBAA0B;CACjC,IAAI,gBACF;CACF,iBAAiB;CACjB,MAAM,QAAQ,SAAS,cAAc,OAAO;CAC5C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BpB,SAAS,KAAK,YAAY,KAAK;AACjC;;;;;;;;AA8BA,SAAgB,gBAAgB,MAAyC;CACvE,kBAAkB;CAElB,MAAM,QAAQ,SAAS,cAAc,KAAK;CAC1C,MAAM,YAAY;CAClB,IAAI,KAAK,WACP,MAAM,UAAU,IAAI,KAAK,SAAS;CACpC,MAAM,YAAY,KAAK,OAAO;CAG9B,MAAM,MAAM,YAAY;CAExB,MAAM,YAAY,KAAK,OAAO;CAC9B,MAAM,iBAAiB,KAAK,OAAO,QAAQ,2BAA2B;CACtE,IAAI,gBACF,eAAe,YAAY,KAAK;MAEhC,UAAU,KAAK,YAAY,KAAK;CAIlC,MAAM,aAAa,KAAK,OAAO,sBAAsB;CACrD,MAAM,UAAU,WAAW,QAAQ;CACnC,MAAM,UAAU,WAAW,SAAS;CAEpC,OAAO;EACL,SAAS;EACT,KAAK,GAAW,GAAiB;GAC/B,MAAM,MAAM,YAAY,eAAe,IAAI,QAAQ,MAAM,IAAI,QAAQ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AM,IAAI,cAAc;GACxB,MAAM,IAAI;GACV,OAAO,wBAAwB,IAAI,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE;EACnF,OAAO;GACL,MAAM,KAAK,MAAM,SAAS,SAAS,KAAK,MAAM,KAAK,UAAU,cAAc;GAC3E,MAAM,IAAI;GACV,MAAM,IAAI,cAAc;GACxB,MAAM,IAAI;GACV,OAAO,wBAAwB,EAAE,MAAM,IAAI,IAAI,EAAE,cAAc,EAAE,cAAc,EAAE;EACnF;CACF;CAEA,IAAIA,eAAmC;EACrC,OAAO,KAAK,YAAY,eAAe,WAAW,KAAK;CACzD;;EAEgB,KAAA,SAAA,CAAC,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FnC;;AACH;AArsBG,WAAA,CAAA,SAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,eAAA,WAAA,eAAA,KAAA,CAAA;AAGzB,WAAA,CAAA,SAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,GAAA,eAAA,WAAA,QAAA,KAAA,CAAA;AAG1B,WAAA,CAAA,SAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,GAAA,eAAA,WAAA,cAAA,KAAA,CAAA;AAG1B,WAAA,CAAA,SAAS;CAAE,MAAM;CAAQ,WAAW;AAAY,CAAC,CAAA,GAAA,eAAA,WAAA,YAAA,KAAA,CAAA;AAXnDmB,iBAAAA,WAAAA,CAAAA,kBAAc,eAAe,CAAA,GAAA,cAAA"}
1
+ {"version":3,"file":"tab-list-6W5CgXix.js","names":["#items","#syncIndicatorColors","#isVertical","#selectPrevious","#selectNext","#dragState","#abortDrag","#endDrag","#containerEl","#suppressNextClick","#findDragTarget","#onPointerMove","#onPointerUp","#onPointerCancel","#beginDrag","#computeGapIndex","#commitDrag","#containerClass","#computeCaretStyle","#onKeyUp","#onSlotClick","#onPointerDown","#onKeyDown","#onWheel","#onSlotChange","#isSelected","#createGhost","customElement"],"sources":["../src/util/drag-ghost.ts","../src/tabs/tab-list.ts"],"sourcesContent":["/**\n * Theme-aware floating element helper.\n *\n * Creates a `position: fixed`, `pointer-events: none` element anchored to a\n * source element's theme container, then exposes imperative `move` / `destroy`\n * hooks. Used by `ixfx-tab-list` for its drag-ghost; intended to be reusable\n * by future drag/detach features.\n *\n * Theme container lookup mirrors `tooltip-controller.ts` so the floating\n * element still inherits the right CSS custom properties when the source lives\n * inside a `.theme-dark` / `.theme-light` subtree (used by the loader iframes).\n */\nlet stylesInjected = false;\n\nfunction injectGhostStyles(): void {\n if (stylesInjected)\n return;\n stylesInjected = true;\n const style = document.createElement(`style`);\n style.textContent = `\n .ixfx-drag-ghost {\n position: fixed;\n top: 0;\n left: 0;\n pointer-events: none;\n z-index: 10000;\n will-change: transform;\n opacity: 0.9;\n display: inline-flex;\n align-items: center;\n gap: var(--space-xs, 4px);\n padding: var(--padding, var(--space-m, 8px)) calc(2 * var(--padding, var(--space-m, 8px)));\n background: var(--surface-4);\n color: var(--surface-4-text);\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-m, 6px);\n font-family: inherit;\n font-size: inherit;\n font-weight: 500;\n white-space: nowrap;\n max-width: 240px;\n overflow: hidden;\n text-overflow: ellipsis;\n box-shadow: var(--shadow-m);\n }\n .ixfx-drag-ghost ixfx-icon {\n flex-shrink: 0;\n }\n `;\n document.head.appendChild(style);\n}\n\nexport interface DragGhost {\n /** Position the ghost at (x, y) viewport coords, anchored around the source center. */\n move: (x: number, y: number) => void;\n /** Remove the ghost from the DOM. Idempotent. */\n destroy: () => void;\n /** The underlying ghost element (rarely needed outside this module). */\n readonly element: HTMLElement;\n}\n\nexport interface CreateDragGhostOptions {\n /** Content element to mount inside the ghost. Will be appended on create. */\n content: HTMLElement;\n /**\n * Anchor element — used to find the theme container and to compute the\n * initial offset so the ghost appears centered under the source on first move.\n */\n anchor: HTMLElement;\n /** Optional class name appended to the ghost wrapper for custom styling. */\n className?: string;\n}\n\n/**\n * Create a theme-aware floating ghost element.\n *\n * The ghost is appended to the closest `.theme-dark` / `.theme-light` ancestor\n * of `anchor`, falling back to `document.body`. This preserves CSS variable\n * inheritance for theming.\n */\nexport function createDragGhost(opts: CreateDragGhostOptions): DragGhost {\n injectGhostStyles();\n\n const ghost = document.createElement(`div`);\n ghost.className = `ixfx-drag-ghost`;\n if (opts.className)\n ghost.classList.add(opts.className);\n ghost.appendChild(opts.content);\n\n // Place ghost off-screen until first `move()` call\n ghost.style.transform = `translate3d(-9999px, -9999px, 0)`;\n\n const targetDoc = opts.anchor.ownerDocument;\n const themeContainer = opts.anchor.closest(`.theme-dark, .theme-light`);\n if (themeContainer) {\n themeContainer.appendChild(ghost);\n } else {\n targetDoc.body.appendChild(ghost);\n }\n\n // Anchor offset: distance from the source's top-left to its center.\n const anchorRect = opts.anchor.getBoundingClientRect();\n const offsetX = anchorRect.width / 2;\n const offsetY = anchorRect.height / 2;\n\n return {\n element: ghost,\n move(x: number, y: number): void {\n ghost.style.transform = `translate3d(${x - offsetX}px, ${y - offsetY}px, 0)`;\n },\n destroy(): void {\n ghost.remove();\n },\n };\n}\n","import type { PropertyValues } from \"lit\";\nimport type { DragGhost } from \"../util/drag-ghost.js\";\nimport type { TabListItemElement } from \"./tab-list-item.js\";\nimport { css, html, LitElement, nothing } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { themeFallbacks } from \"../styles/fallbacks.js\";\nimport { safeCustomElement as customElement } from \"../util/custom-elements.js\";\nimport { createDragGhost } from \"../util/drag-ghost.js\";\n\n/**\n * Events\n * 'change' - new tab selected { previous:string, selected:string, for:string }\n * 'reorder' - tab moved within the list { id:string, fromIndex:number, toIndex:number }\n */\nexport type TabListChangeDetail = {\n readonly previous: string | undefined;\n readonly selected: string;\n readonly for: string;\n};\n\nexport type TabListChangeEvent = CustomEvent<TabListChangeDetail>;\n\nexport type TabListReorderDetail = {\n readonly id: string;\n readonly fromIndex: number;\n readonly toIndex: number;\n};\n\nexport type TabListReorderEvent = CustomEvent<TabListReorderDetail>;\n\nexport type TabListDragMode = `off` | `reorder`;\n\n/** Pointer movement threshold (px) before a press becomes a drag. */\nconst DRAG_THRESHOLD_PX = 5;\n\n@customElement(`ixfx-tab-list`)\nexport class TabListElement extends LitElement {\n @property({ type: String })\n orientation: `horizontal` | `vertical-stack` | `vertical-side` = `horizontal`;\n\n @property({ type: Boolean })\n flip = false;\n\n @property({ type: Boolean })\n scrollable = false;\n\n @property({ type: String, attribute: `drag-mode` })\n dragMode: TabListDragMode = `off`;\n\n #items: TabListItemElement[] = [];\n\n // ── Drag state (not reactive) ────────────────────────────────────────\n #dragState: {\n pointerId: number;\n source: TabListItemElement;\n fromIndex: number;\n startX: number;\n startY: number;\n active: boolean;\n ghost: DragGhost | null;\n gapIndex: number | undefined;\n } | null = null;\n\n #suppressNextClick = false;\n\n get #isVertical(): boolean {\n return this.orientation === `vertical-stack` || this.orientation === `vertical-side`;\n }\n\n get #containerClass(): string {\n const base = this.scrollable ? `${this.orientation} scrollable` : this.orientation;\n return this.dragMode === `reorder` ? `${base} reorder` : base;\n }\n\n override render() {\n const caretStyle = this.#computeCaretStyle();\n return html`\n <div\n tabindex=0\n @keyup=${this.#onKeyUp}\n @click=${this.#onSlotClick}\n @pointerdown=${this.#onPointerDown}\n @keydown=${this.#onKeyDown}\n @wheel=${this.#onWheel}\n id=\"container\"\n class=${this.#containerClass}\n >\n <slot @slotchange=${this.#onSlotChange}></slot>\n ${caretStyle\n ? html`<div class=\"drop-caret\" style=${caretStyle}></div>`\n : nothing}\n </div>`;\n }\n\n #onSlotChange = () => {\n this.updateComplete.then(() => {\n this.#items = (this.shadowRoot?.querySelector(`slot`) as HTMLSlotElement)\n ?.assignedElements({ flatten: true }) as TabListItemElement[] ?? [];\n this.#syncIndicatorColors();\n });\n };\n\n override firstUpdated() {\n this.updateComplete.then(() => {\n if (this.#items.length > 0) {\n this.#syncIndicatorColors();\n }\n });\n }\n\n override updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n this.classList.toggle(`scrollable`, this.scrollable);\n if (changedProperties.has(`dragMode`)) {\n this.toggleAttribute(`drag-mode`, this.dragMode !== `off`);\n }\n }\n\n #syncIndicatorColors() {\n for (const item of this.#items) {\n item.style.setProperty(`--indicator-color-bottom`, `transparent`);\n item.style.setProperty(`--indicator-color-top`, `transparent`);\n item.style.setProperty(`--indicator-color-left`, `transparent`);\n item.style.setProperty(`--indicator-color-right`, `transparent`);\n\n if (item.hasAttribute(`selected`)) {\n if (this.orientation === `horizontal` && !this.flip) {\n item.style.setProperty(`--indicator-color-bottom`, `var(--accent)`);\n } else if (this.orientation === `horizontal` && this.flip) {\n item.style.setProperty(`--indicator-color-top`, `var(--accent)`);\n } else if (this.#isVertical && !this.flip) {\n item.style.setProperty(`--indicator-color-right`, `var(--accent)`);\n } else if (this.#isVertical && this.flip) {\n item.style.setProperty(`--indicator-color-left`, `var(--accent)`);\n }\n }\n }\n }\n\n #onKeyUp = (event: KeyboardEvent) => {\n const key = event.key;\n if (this.#isVertical) {\n if (key === `ArrowUp`) {\n this.#selectPrevious();\n } else if (key === `ArrowDown`) {\n this.#selectNext();\n }\n } else {\n if (key === `ArrowRight`) {\n this.#selectNext();\n } else if (key === `ArrowLeft`) {\n this.#selectPrevious();\n }\n }\n };\n\n // Escape during drag aborts it (and tears down listeners / releases capture)\n #onKeyDown = (event: KeyboardEvent): void => {\n const state = this.#dragState;\n if (event.key !== `Escape` || !state?.active)\n return;\n event.preventDefault();\n const pointerId = state.pointerId;\n this.#abortDrag();\n this.#endDrag(pointerId);\n };\n\n /**\n * Translate vertical wheel deltas into horizontal scroll on a scrollable\n * horizontal list (and vice-versa for vertical lists). Without this, the\n * default browser behaviour only scrolls horizontally with Shift+wheel or a\n * physical horizontal wheel — neither of which most users reach for on a\n * VS Code-style tab strip.\n *\n * Only kicks in when the list is actually scrollable (overflow content\n * present), and is a no-op when nothing is scrollable in that direction.\n */\n #onWheel = (event: WheelEvent): void => {\n if (!this.scrollable)\n return;\n const el = this.#containerEl;\n if (!el)\n return;\n\n if (!this.#isVertical) {\n // Horizontal list: vertical wheel → horizontal scroll.\n if (event.deltaY === 0 || el.scrollWidth <= el.clientWidth)\n return;\n const prev = el.scrollLeft;\n el.scrollLeft = prev + event.deltaY;\n if (el.scrollLeft !== prev)\n event.preventDefault();\n } else {\n // Vertical list: vertical wheel is already native; only intervene when\n // a horizontal wheel is supplied (e.g. trackpad two-finger horizontal).\n if (event.deltaX === 0 || el.scrollHeight <= el.clientHeight)\n return;\n const prev = el.scrollTop;\n el.scrollTop = prev + event.deltaX;\n if (el.scrollTop !== prev)\n event.preventDefault();\n }\n };\n\n getSelectedElement() {\n for (const el of this.#items) {\n if (this.#isSelected(el))\n return el;\n }\n // Fallback: #items may not be populated yet (slotchange hasn't fired).\n // Query the slot directly to find the selected element.\n const slot = this.shadowRoot?.querySelector(`slot`);\n if (slot) {\n const els = (slot as HTMLSlotElement).assignedElements({ flatten: true });\n for (const el of els) {\n if (this.#isSelected(el as HTMLElement))\n return el as TabListItemElement;\n }\n }\n }\n\n #isSelected(el: HTMLElement) {\n const v = el.getAttribute(`selected`);\n if (v === null)\n return false;\n return (el.hasAttribute(`selected`));\n }\n\n selectElement(el: HTMLElement) {\n const existing = this.getSelectedElement();\n if (existing) {\n existing.removeAttribute(`selected`);\n existing.style.setProperty(`--indicator-color-bottom`, `transparent`);\n existing.style.setProperty(`--indicator-color-top`, `transparent`);\n existing.style.setProperty(`--indicator-color-left`, `transparent`);\n existing.style.setProperty(`--indicator-color-right`, `transparent`);\n }\n\n el.setAttribute(`selected`, ``);\n\n if (this.orientation === `horizontal` && !this.flip) {\n el.style.setProperty(`--indicator-color-bottom`, `var(--accent)`);\n } else if (this.orientation === `horizontal` && this.flip) {\n el.style.setProperty(`--indicator-color-top`, `var(--accent)`);\n } else if (this.#isVertical && !this.flip) {\n el.style.setProperty(`--indicator-color-right`, `var(--accent)`);\n } else if (this.#isVertical && this.flip) {\n el.style.setProperty(`--indicator-color-left`, `var(--accent)`);\n }\n }\n\n #selectNext() {\n let found = false;\n for (const el of this.#items) {\n if (this.#isSelected(el) && !found) {\n found = true;\n } else if (found) {\n this.selectElement(el);\n break;\n }\n }\n }\n\n #selectPrevious() {\n let prev: HTMLElement | undefined;\n for (const el of this.#items) {\n if (this.#isSelected(el) && prev) {\n this.selectElement(prev);\n } else {\n prev = el;\n }\n }\n }\n\n #onSlotClick = (event: MouseEvent) => {\n if (this.#suppressNextClick) {\n this.#suppressNextClick = false;\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n this.focus();\n const t = (event.target as HTMLElement).closest(`ixfx-tab-list-item`);\n if (!t)\n return;\n const previous = this.getSelectedElement();\n this.selectElement(t);\n\n const forId = t.getAttribute(`for`);\n const previousId = previous?.id;\n this.dispatchEvent(new CustomEvent<TabListChangeDetail>(`change`, {\n bubbles: true,\n detail: {\n previous: previousId,\n selected: t.id,\n for: forId ?? ``,\n },\n }));\n };\n\n // ── Drag handling ────────────────────────────────────────────────────\n\n /**\n * Walk composedPath looking for the nearest ancestor tab-list-item, but bail\n * if the path goes through a `.close-btn` or `.toolbar` (so close/toolbar\n * buttons always win — same delegation pattern used by tooltip-controller).\n */\n #findDragTarget(event: PointerEvent): TabListItemElement | null {\n if (this.dragMode === `off`)\n return null;\n\n const path = event.composedPath();\n let item: TabListItemElement | null = null;\n for (const node of path) {\n if (!(node instanceof HTMLElement))\n continue;\n if (node.classList.contains(`close-btn`) || node.classList.contains(`toolbar`)) {\n return null;\n }\n if (!item && node.tagName === `IXFX-TAB-LIST-ITEM`) {\n item = node as TabListItemElement;\n }\n }\n return item;\n }\n\n #onPointerDown = (event: PointerEvent): void => {\n if (this.dragMode !== `reorder`)\n return;\n if (event.button !== 0)\n return;\n const target = this.#findDragTarget(event);\n if (!target)\n return;\n\n const fromIndex = this.#items.indexOf(target);\n if (fromIndex < 0)\n return;\n\n // Don't capture the pointer yet — doing so on pointerdown would redirect\n // the trailing click event to the capture target (the container), so the\n // click handler would see a container DIV as its target instead of the\n // tab-list-item and `closest('ixfx-tab-list-item')` would return null.\n // We capture only once the drag actually activates (#beginDrag). Until\n // then, an ordinary press still produces a normal click on the tab.\n\n this.#dragState = {\n pointerId: event.pointerId,\n source: target,\n fromIndex,\n startX: event.clientX,\n startY: event.clientY,\n active: false,\n ghost: null,\n gapIndex: undefined,\n };\n\n // Listen at window level for move/up so we don't lose events if the\n // pointer exits the host before pointerup fires.\n window.addEventListener(`pointermove`, this.#onPointerMove);\n window.addEventListener(`pointerup`, this.#onPointerUp);\n window.addEventListener(`pointercancel`, this.#onPointerCancel);\n };\n\n #onPointerMove = (event: PointerEvent): void => {\n const state = this.#dragState;\n if (!state || event.pointerId !== state.pointerId)\n return;\n\n const dx = event.clientX - state.startX;\n const dy = event.clientY - state.startY;\n const distance = Math.hypot(dx, dy);\n\n if (!state.active) {\n if (distance < DRAG_THRESHOLD_PX)\n return;\n this.#beginDrag(event);\n }\n\n state.ghost?.move(event.clientX, event.clientY);\n\n const gap = this.#computeGapIndex(event.clientX, event.clientY);\n if (gap !== state.gapIndex) {\n state.gapIndex = gap;\n this.requestUpdate();\n }\n };\n\n #onPointerUp = (event: PointerEvent): void => {\n const state = this.#dragState;\n if (!state || event.pointerId !== state.pointerId)\n return;\n\n if (state.active) {\n const gap = this.#computeGapIndex(event.clientX, event.clientY);\n this.#commitDrag(state.source, state.fromIndex, gap);\n }\n this.#endDrag(event.pointerId);\n };\n\n #onPointerCancel = (event: PointerEvent): void => {\n const state = this.#dragState;\n if (!state || event.pointerId !== state.pointerId)\n return;\n this.#abortDrag();\n this.#endDrag(event.pointerId);\n };\n\n #beginDrag(event: PointerEvent): void {\n const state = this.#dragState;\n if (!state || state.active)\n return;\n\n // Now that we know we're dragging, capture the pointer so pointermove/up\n // events keep flowing even if the pointer leaves the host element.\n try {\n this.#containerEl?.setPointerCapture(event.pointerId);\n } catch {\n // setPointerCapture can throw if pointer is already captured elsewhere;\n // fall through — window listeners still catch move/up.\n }\n\n state.active = true;\n state.source.setAttribute(`drag-source`, ``);\n\n state.ghost = this.#createGhost(state.source);\n if (state.ghost) {\n state.ghost.move(event.clientX, event.clientY);\n }\n }\n\n #abortDrag(): void {\n const state = this.#dragState;\n if (!state)\n return;\n state.source.removeAttribute(`drag-source`);\n if (state.gapIndex !== undefined) {\n state.gapIndex = undefined;\n this.requestUpdate();\n }\n // Caller is responsible for invoking #endDrag to release pointer capture,\n // tear down listeners, and destroy the ghost.\n }\n\n #endDrag(pointerId: number): void {\n const state = this.#dragState;\n if (!state)\n return;\n\n state.ghost?.destroy();\n state.ghost = null;\n this.#dragState = null;\n\n window.removeEventListener(`pointermove`, this.#onPointerMove);\n window.removeEventListener(`pointerup`, this.#onPointerUp);\n window.removeEventListener(`pointercancel`, this.#onPointerCancel);\n\n try {\n this.#containerEl?.releasePointerCapture(pointerId);\n } catch { /* already released */ }\n\n // #dragState is a private field, not a Lit-reactive property — setting it\n // to null doesn't trigger a re-render on its own. Without this, the caret\n // (and any other drag-time UI) would remain in the DOM after the drag\n // ends, even though the next render would clear them.\n this.requestUpdate();\n }\n\n #commitDrag(source: TabListItemElement, fromIndex: number, gapIndex: number | undefined): void {\n source.removeAttribute(`drag-source`);\n\n // gapIndex is an index into the without-source siblings array: 0 = before\n // the first sibling, siblings.length = after the last. The siblings array\n // already excludes source, so we can insert directly at that position\n // using siblings[gapIndex] as the reference (or null to append).\n const siblings = this.#items.filter(el => el !== source);\n const target = gapIndex === undefined\n ? siblings.length\n : Math.max(0, Math.min(gapIndex, siblings.length));\n\n const parent = source.parentNode;\n if (!parent)\n return;\n\n const ref = siblings[target] ?? null;\n parent.insertBefore(source, ref);\n\n const toIndex = Array.prototype.indexOf.call(parent.children, source);\n if (toIndex === fromIndex) {\n // Dropped in the same gap the item already occupies — no reorder, and no\n // click suppression (a real click on the same tab is still meaningful).\n return;\n }\n\n // Refresh cached #items so subsequent drags / queries see the new order\n // (slotchange does NOT fire on reorder, only on add/remove).\n this.#items = (this.shadowRoot?.querySelector(`slot`) as HTMLSlotElement)\n ?.assignedElements({ flatten: true }) as TabListItemElement[] ?? [];\n this.#syncIndicatorColors();\n\n // A real reorder just happened. The trailing click event (which the\n // browser still fires after pointerup) would re-select whatever is under\n // the release point — not what the user wanted. Suppress it.\n this.#suppressNextClick = true;\n\n this.dispatchEvent(new CustomEvent<TabListReorderDetail>(`reorder`, {\n bubbles: true,\n detail: {\n id: source.id,\n fromIndex,\n toIndex,\n },\n }));\n }\n\n #createGhost(source: TabListItemElement): DragGhost | null {\n const content = document.createElement(`span`);\n content.style.display = `inline-flex`;\n content.style.alignItems = `center`;\n content.style.gap = `var(--space-xs, 4px)`;\n content.style.minWidth = `0`;\n\n const iconName = source.iconName;\n if (iconName) {\n const icon = document.createElement(`ixfx-icon`) as HTMLElement & { name: string };\n icon.name = iconName;\n content.appendChild(icon);\n }\n\n // Reconstruct label text from light-DOM children that aren't slotted.\n // We want the text content of the source item, excluding `slot=\"toolbar\"`\n // descendants (the close button lives inside the item's shadow DOM, not\n // its light DOM, so it isn't part of childNodes here).\n const label = document.createElement(`span`);\n label.textContent = (source.textContent ?? ``).trim();\n label.style.overflow = `hidden`;\n label.style.textOverflow = `ellipsis`;\n label.style.whiteSpace = `nowrap`;\n content.appendChild(label);\n\n try {\n return createDragGhost({ anchor: source, content });\n } catch {\n return null;\n }\n }\n\n /**\n * Compute the index of the gap nearest the pointer, ignoring the source item.\n * Returns 0..#items.length-1; undefined if no siblings.\n *\n * Per the plan: drag-mode=\"reorder\" has \"no sense of breaking out\", so the\n * perpendicular axis is ignored — the pointer always resolves to some gap.\n */\n #computeGapIndex(clientX: number, clientY: number): number | undefined {\n const state = this.#dragState;\n if (!state)\n return undefined;\n const siblings = this.#items.filter(el => el !== state.source);\n if (siblings.length === 0)\n return 0;\n\n const useX = !this.#isVertical;\n\n let bestGap = 0;\n let bestDist = Infinity;\n\n // For each sibling, decide: gap is \"before this sibling\" or \"after\" based\n // on which side of the midpoint the pointer is on. Pick the gap whose\n // position (the midpoint if \"before\", the edge if \"after\") is closest to\n // the pointer on the relevant axis.\n for (let i = 0; i < siblings.length; i++) {\n const rect = siblings[i].getBoundingClientRect();\n const start = useX ? rect.left : rect.top;\n const end = useX ? rect.right : rect.bottom;\n const mid = (start + end) / 2;\n const pos = useX ? clientX : clientY;\n\n // Two candidate gaps: before this sibling (at `start`) and after (at `end`).\n // \"Before\" gap index = i; \"after\" gap index = i + 1.\n const dStart = Math.abs(pos - start);\n const dMid = Math.abs(pos - mid);\n const dEnd = Math.abs(pos - end);\n\n // Heuristic: if pointer is left/above midpoint, prefer the \"before\" gap;\n // otherwise prefer the \"after\" gap. Within those, the closer edge wins.\n const preferBefore = pos < mid;\n if (preferBefore) {\n // Gap i (before this sibling)\n if (dStart < bestDist) {\n bestDist = dStart;\n bestGap = i;\n }\n } else {\n // Gap i+1 (after this sibling)\n if (dEnd < bestDist) {\n bestDist = dEnd;\n bestGap = i + 1;\n }\n }\n // The midpoint-distance is mostly redundant with the above but handles\n // ties near the boundary cleanly — no-op for the chosen gap.\n void dMid;\n }\n\n return bestGap;\n }\n\n #computeCaretStyle(): string | undefined {\n const state = this.#dragState;\n if (!state?.active || state.gapIndex === undefined)\n return undefined;\n\n const siblings = this.#items.filter(el => el !== state.source);\n if (siblings.length === 0)\n return undefined;\n\n const useX = !this.#isVertical;\n const containerRect = this.#containerEl?.getBoundingClientRect();\n if (!containerRect)\n return undefined;\n\n const gap = Math.max(0, Math.min(state.gapIndex, siblings.length));\n let rect: DOMRect | null = null;\n if (gap < siblings.length) {\n rect = siblings[gap].getBoundingClientRect();\n } else {\n // After the last sibling: use its trailing edge\n const last = siblings[siblings.length - 1].getBoundingClientRect();\n rect = last;\n }\n\n if (useX) {\n const x = (gap < siblings.length ? rect.left : rect.right) - containerRect.left;\n const y = 0;\n const h = containerRect.height;\n const w = 2;\n return `transform: translate(${x - w / 2}px, ${y}px); width: ${w}px; height: ${h}px;`;\n } else {\n const y = (gap < siblings.length ? rect.top : rect.bottom) - containerRect.top;\n const x = 0;\n const w = containerRect.width;\n const h = 2;\n return `transform: translate(${x}px, ${y - h / 2}px); width: ${w}px; height: ${h}px;`;\n }\n }\n\n get #containerEl(): HTMLElement | null {\n return this.shadowRoot?.getElementById(`container`) ?? null;\n }\n\n static styles = [themeFallbacks, css`\n :host {\n display: inline-block;\n --activated-colour: var(--accent);\n --colour: var(--surface-3-text);\n --scroll-max-height: 200px;\n --allow-overflow: hidden;\n color: var(--colour);\n border: var(--border, none);\n border-color: var(--surface-5);\n border-radius: var(--radius-l, 8px) var(--radius-l, 8px) 0 0;\n\n }\n :host(.scrollable) {\n max-height: var(--scroll-max-height);\n }\n text {\n user-select:none;\n }\n #container {\n display:flex;\n position: relative;\n }\n #container.horizontal {\n flex-direction: row;\n overflow: hidden;\n }\n #container.horizontal.scrollable {\n overflow-x: auto;\n --allow-overflow: visible;\n }\n #container.horizontal.scrollable ::slotted(ixfx-tab-list-item) {\n flex-shrink: 0;\n }\n #container.vertical-stack {\n flex-direction: column;\n }\n #container.vertical-stack.flip {\n flex-direction: column-reverse;\n }\n #container.vertical-stack.scrollable {\n overflow-y: auto;\n max-height: var(--scroll-max-height);\n --allow-overflow: visible;\n }\n #container.vertical-side {\n flex-direction: column;\n }\n #container.vertical-side.flip {\n flex-direction: column-reverse;\n }\n #container.vertical-side.scrollable {\n overflow-y: auto;\n max-height: var(--scroll-max-height);\n --allow-overflow: visible;\n }\n\n ::slotted(ixfx-tab-list-item) {\n flex: 1 1 auto;\n min-width: 0;\n }\n\n #container.vertical-side ::slotted(ixfx-tab-list-item) {\n writing-mode: vertical-lr;\n text-orientation: mixed;\n }\n #container.vertical-side.flip ::slotted(ixfx-tab-list-item) {\n writing-mode: vertical-rl;\n text-orientation: mixed;\n }\n\n /* Drag affordances — opt-in via drag-mode=\"reorder\" on the host (list). */\n #container.reorder ::slotted(ixfx-tab-list-item) {\n cursor: grab;\n }\n :host([drag-mode]) ::slotted(ixfx-tab-list-item[drag-source]) {\n cursor: grabbing;\n opacity: 0.4;\n transition: opacity var(--transition, 0.15s ease-out);\n }\n\n /* Insertion caret shown during an active drag. */\n .drop-caret {\n position: absolute;\n background: var(--accent);\n border-radius: 1px;\n pointer-events: none;\n z-index: 1;\n }\n\n ::slotted(.activated) {\n --colour: var(--activated-colour);\n }\n `];\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"ixfx-tab-list\": TabListElement;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAYA,IAAI,iBAAiB;AAErB,SAAS,oBAA0B;CACjC,IAAI,gBACF;CACF,iBAAiB;CACjB,MAAM,QAAQ,SAAS,cAAc,OAAO;CAC5C,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BpB,SAAS,KAAK,YAAY,KAAK;AACjC;;;;;;;;AA8BA,SAAgB,gBAAgB,MAAyC;CACvE,kBAAkB;CAElB,MAAM,QAAQ,SAAS,cAAc,KAAK;CAC1C,MAAM,YAAY;CAClB,IAAI,KAAK,WACP,MAAM,UAAU,IAAI,KAAK,SAAS;CACpC,MAAM,YAAY,KAAK,OAAO;CAG9B,MAAM,MAAM,YAAY;CAExB,MAAM,YAAY,KAAK,OAAO;CAC9B,MAAM,iBAAiB,KAAK,OAAO,QAAQ,2BAA2B;CACtE,IAAI,gBACF,eAAe,YAAY,KAAK;MAEhC,UAAU,KAAK,YAAY,KAAK;CAIlC,MAAM,aAAa,KAAK,OAAO,sBAAsB;CACrD,MAAM,UAAU,WAAW,QAAQ;CACnC,MAAM,UAAU,WAAW,SAAS;CAEpC,OAAO;EACL,SAAS;EACT,KAAK,GAAW,GAAiB;GAC/B,MAAM,MAAM,YAAY,eAAe,IAAI,QAAQ,MAAM,IAAI,QAAQ;EACvE;EACA,UAAgB;GACd,MAAM,OAAO;EACf;CACF;AACF;;;;ACjFA,MAAM,oBAAoB;AAGnB,IAAM,iBAAN,MAAM,uBAA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ACnF,OAAO;GACL,MAAM,KAAK,MAAM,SAAS,SAAS,KAAK,MAAM,KAAK,UAAU,cAAc;GAC3E,MAAM,IAAI;GACV,MAAM,IAAI,cAAc;GACxB,MAAM,IAAI;GACV,OAAO,wBAAwB,EAAE,MAAM,IAAI,IAAI,EAAE,cAAc,EAAE,cAAc,EAAE;EACnF;CACF;CAEA,IAAIA,eAAmC;EACrC,OAAO,KAAK,YAAY,eAAe,WAAW,KAAK;CACzD;;EAEgB,KAAA,SAAA,CAAC,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FnC;;AACH;AArsBG,WAAA,CAAA,SAAS,EAAE,MAAM,OAAO,CAAC,CAAA,GAAA,eAAA,WAAA,eAAA,KAAA,CAAA;AAGzB,WAAA,CAAA,SAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,GAAA,eAAA,WAAA,QAAA,KAAA,CAAA;AAG1B,WAAA,CAAA,SAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,GAAA,eAAA,WAAA,cAAA,KAAA,CAAA;AAG1B,WAAA,CAAA,SAAS;CAAE,MAAM;CAAQ,WAAW;AAAY,CAAC,CAAA,GAAA,eAAA,WAAA,YAAA,KAAA,CAAA;AAXnDmB,iBAAAA,WAAAA,CAAAA,kBAAc,eAAe,CAAA,GAAA,cAAA"}
@@ -6,7 +6,7 @@ import { CommandRegistry } from "@clinth/ui-commands";
6
6
  * CSS vars (can be overridden per-instance):
7
7
  * --selected-colour: text colour when selected
8
8
  * --selected-border-width: border width
9
- * --padding
9
+ * --ixfx-tab-padding: padding for the tab content (default: var(--space-m))
10
10
  */
11
11
  declare class TabListItemElement extends LitElement {
12
12
  closeable: boolean;
@@ -71,4 +71,4 @@ declare global {
71
71
  }
72
72
  //#endregion
73
73
  export { TabListReorderDetail as a, TabListElement as i, TabListChangeEvent as n, TabListReorderEvent as o, TabListDragMode as r, TabListItemElement as s, TabListChangeDetail as t };
74
- //# sourceMappingURL=tab-list-BohmbvqF.d.ts.map
74
+ //# sourceMappingURL=tab-list-ih-0I0NE.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tab-list-BohmbvqF.d.ts","names":[],"sources":["../src/tabs/tab-list-item.ts","../src/tabs/tab-list.ts"],"mappings":";;;;;;;;;;cAgBa,2BAA2B;EAEtC;EAGA;EAGA;EAGA;EAGA,UAAU;UAEO;UACT;UACA;EAEC;EAQA;EAQA,QAAQ,SAAS;UAQlB;UAUA;EAWC,wBAAM;UAyBP;SAWQ,sBAAM;;QA4GhB;YACI;IACR,sBAAsB;;;;;;;;;;KCrNd;WACD;WACA;WACA;;KAGC,qBAAqB,YAAY;KAEjC;WACD;WACA;WACA;;KAGC,sBAAsB,YAAY;KAElC;cAMC,uBAAuB;;EAElC;EAGA;EAGA;EAGA,UAAU;EA2BD,wBAAM;EA4BN;EAQA,QAAQ,mBAAmB;EA8FpC,sBAAkB;EAwBlB,cAAc,IAAI;SAwaX,sBAAM;;QAgGP;YACI;IACR,iBAAiB"}
1
+ {"version":3,"file":"tab-list-ih-0I0NE.d.ts","names":[],"sources":["../src/tabs/tab-list-item.ts","../src/tabs/tab-list.ts"],"mappings":";;;;;;;;;;cAgBa,2BAA2B;EAEtC;EAGA;EAGA;EAGA;EAGA,UAAU;UAEO;UACT;UACA;EAEC;EAQA;EAQA,QAAQ,SAAS;UAQlB;UAUA;EAWC,wBAAM;UAyBP;SAWQ,sBAAM;;QA4GhB;YACI;IACR,sBAAsB;;;;;;;;;;KCrNd;WACD;WACA;WACA;;KAGC,qBAAqB,YAAY;KAEjC;WACD;WACA;WACA;;KAGC,sBAAsB,YAAY;KAElC;cAMC,uBAAuB;;EAElC;EAGA;EAGA;EAGA,UAAU;EA2BD,wBAAM;EA4BN;EAQA,QAAQ,mBAAmB;EA8FpC,sBAAkB;EAwBlB,cAAc,IAAI;SAwaX,sBAAM;;QAgGP;YACI;IACR,iBAAiB"}
package/dist/tabs.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as TabListReorderDetail, i as TabListElement, n as TabListChangeEvent, o as TabListReorderEvent, r as TabListDragMode, t as TabListChangeDetail } from "./tab-list-BohmbvqF.js";
1
+ import { a as TabListReorderDetail, i as TabListElement, n as TabListChangeEvent, o as TabListReorderEvent, r as TabListDragMode, t as TabListChangeDetail } from "./tab-list-ih-0I0NE.js";
2
2
  export { TabListChangeDetail, TabListChangeEvent, TabListDragMode, TabListElement, TabListReorderDetail, TabListReorderEvent };
package/dist/tabs.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as TabListElement } from "./tab-list-DhkVhRQc.js";
1
+ import { t as TabListElement } from "./tab-list-6W5CgXix.js";
2
2
  export { TabListElement };
@@ -1,5 +1,5 @@
1
1
  import { n as tickledStyles, r as TickledController, t as tickledItemStyles } from "./tickled-styles-fNDdqf6l.js";
2
- import { t as themeFallbacks } from "./fallbacks-pNMOMx38.js";
2
+ import { t as themeFallbacks } from "./fallbacks-DPgPEqo8.js";
3
3
  import { n as safeCustomElement, t as __decorate } from "./decorate-VRK8rslU.js";
4
4
  import "./interaction-D6efrBLo.js";
5
5
  import { t as collectDataResult } from "./data-provider-35TyWclX.js";
@@ -1418,4 +1418,4 @@ var TreeController = class {
1418
1418
  //#endregion
1419
1419
  export { TreeDataModel as i, TreeListElement as n, TreeBaseElement as r, TreeController as t };
1420
1420
 
1421
- //# sourceMappingURL=tree-CL-txefQ.js.map
1421
+ //# sourceMappingURL=tree-BtiiDX1a.js.map