@vireo-ai/trellis-ui 0.1.62 → 0.1.63

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 (64) hide show
  1. package/package.json +2 -1
  2. package/packages/client/skills/compose-trellis-ui/SKILL.md +84 -0
  3. package/packages/client/skills/compose-trellis-ui/references/project-ui.md +40 -0
  4. package/packages/client/src/styles/generated/theme-fonts.css +1 -1
  5. package/packages/client/src/styles/generated/theme-palette.css +1 -1
  6. package/packages/client/src/styles/generated/theme-runtime.css +34 -28
  7. package/packages/client/src/styles/theme-support.css +7 -0
  8. package/packages/client/types/components/import-flow/contract.d.ts +1 -0
  9. package/packages/client/types/core.d.ts +1 -1
  10. package/packages/client/types/runtime/index.d.ts +1 -1
  11. package/packages/client/types/runtime/theme.d.ts +6 -4
  12. package/packages/client/types/runtime/ui.d.ts +2 -0
  13. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/build-metadata.json +13 -13
  14. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/sortable-CgP1efhO.js +2 -0
  15. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/{sortable-Do3a0LA9.js.map → sortable-CgP1efhO.js.map} +1 -1
  16. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/sortable.js +2 -2
  17. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-sortable-Bm1phXnj.js → capability-sortable-CpUAUTdh.js} +2 -2
  18. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-sortable-Bm1phXnj.js.map → capability-sortable-CpUAUTdh.js.map} +1 -1
  19. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-CVVSxrtG.js +4 -0
  20. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-CVVSxrtG.js.map +1 -0
  21. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/{data-grid-Dm3rQfQ_.js → data-grid-Cr9kEoo9.js} +2 -2
  22. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/{data-grid-Dm3rQfQ_.js.map → data-grid-Cr9kEoo9.js.map} +1 -1
  23. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/data-grid.js +2 -2
  24. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/core-CbDVD_pk.js +2 -0
  25. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/core-CbDVD_pk.js.map +1 -0
  26. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/core.js +2 -2
  27. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/logical-entry-manifest.json +10 -8
  28. package/packages/theme-engine/README.md +28 -0
  29. package/packages/theme-engine/dist/trellis.js +69 -6
  30. package/packages/theme-engine/generated/knobs/v1/color-alpha.json +1 -1
  31. package/packages/theme-engine/generated/knobs/v1/color-foundations.json +1 -1
  32. package/packages/theme-engine/generated/knobs/v1/color-ink.json +1 -1
  33. package/packages/theme-engine/generated/knobs/v1/color-lighting.json +1 -1
  34. package/packages/theme-engine/generated/knobs/v1/color-normalization.json +1 -1
  35. package/packages/theme-engine/generated/knobs/v1/color-ramps.json +1 -1
  36. package/packages/theme-engine/generated/knobs/v1/composition.json +1 -1
  37. package/packages/theme-engine/generated/knobs/v1/depth.json +1 -1
  38. package/packages/theme-engine/generated/knobs/v1/edges.json +1 -1
  39. package/packages/theme-engine/generated/knobs/v1/index.json +177 -3
  40. package/packages/theme-engine/generated/knobs/v1/manifest.json +18 -3
  41. package/packages/theme-engine/generated/knobs/v1/radii.json +1 -1
  42. package/packages/theme-engine/generated/knobs/v1/semantic-actions.json +1 -1
  43. package/packages/theme-engine/generated/knobs/v1/semantic-disabled.json +1 -1
  44. package/packages/theme-engine/generated/knobs/v1/semantic-disclosure.json +1 -1
  45. package/packages/theme-engine/generated/knobs/v1/semantic-intents.json +1 -1
  46. package/packages/theme-engine/generated/knobs/v1/semantic-scrim.json +1 -1
  47. package/packages/theme-engine/generated/knobs/v1/semantic-selection.json +1 -1
  48. package/packages/theme-engine/generated/knobs/v1/semantic-structure.json +1 -1
  49. package/packages/theme-engine/generated/knobs/v1/semantic-text-selection.json +372 -0
  50. package/packages/theme-engine/generated/knobs/v1/sizing-anatomy.json +1 -1
  51. package/packages/theme-engine/generated/knobs/v1/sizing-controls.json +1 -1
  52. package/packages/theme-engine/generated/knobs/v1/sizing-measures.json +1 -1
  53. package/packages/theme-engine/generated/knobs/v1/spacing.json +1 -1
  54. package/packages/theme-engine/generated/knobs/v1/substrates.json +1 -1
  55. package/packages/theme-engine/generated/knobs/v1/surfaces.json +1 -1
  56. package/packages/theme-engine/generated/knobs/v1/typography-anatomy.json +1 -1
  57. package/packages/theme-engine/generated/knobs/v1/typography-fonts.json +1 -1
  58. package/packages/theme-engine/generated/knobs/v1/typography-scale.json +1 -1
  59. package/packages/theme-engine/generated/schemas/theme-config-v1.json +51 -0
  60. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/sortable-Do3a0LA9.js +0 -2
  61. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-CZ7fEQL2.js +0 -4
  62. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-CZ7fEQL2.js.map +0 -1
  63. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/core-CX4J7tsN.js +0 -2
  64. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/core-CX4J7tsN.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-CbDVD_pk.js","names":[],"sources":["../../../../../../../client/src/directives/animate.ts","../../../../../../../client/src/directives/request.ts","../../../../../../../client/src/directives/transition.ts","../../../../../../../client/src/runtime/morph-engine.ts","../../../../../../../client/src/runtime/confirm.ts","../../../../../../../client/src/runtime/manifest.ts","../../../../../../../client/src/core.ts"],"sourcesContent":["import type Alpine from 'alpinejs';\nimport {motionValue, type DOMKeyframesDefinition, type MotionValue} from 'motion';\nimport {animateProperties} from '@client/motion/properties';\nimport {getAnimationOptions, createAnimationScope} from '@client/motion/registry';\nimport {setAnimationPaused} from '@client/motion/lifecycle';\nimport {registerDomInvalidationOwner} from '@client/runtime/dom-invalidation';\nimport {warn} from '@client/utils';\n\ntype NumberDefinition = {\n value: number;\n format?: Intl.NumberFormatOptions;\n locales?: Intl.LocalesArgument;\n};\n\nconst numberDefinition = (input: unknown): {value: number; formatter: Intl.NumberFormat} => {\n const definition = typeof input === 'number' ? {value: input} : input as NumberDefinition;\n if (!definition || typeof definition !== 'object' || typeof definition.value !== 'number' || !Number.isFinite(definition.value)) {\n throw new TypeError('x-ui-animate:number requires a finite number or {value, format?, locales?}.');\n }\n return {\n value: definition.value,\n formatter: new Intl.NumberFormat(definition.locales, definition.format ?? {maximumFractionDigits: 0}),\n };\n};\n\nconst registerAnimateDirective = (AlpineInstance: Alpine.Alpine): void => {\n AlpineInstance.directive('ui-animate', AlpineInstance.skipDuringClone((element, {value: binding, expression}, utilities) => {\n if (binding && binding !== 'number' && binding !== 'paused') {\n warn(`Unknown x-ui-animate binding: ${binding}`, element);\n return;\n }\n const evaluator = utilities.evaluateLater(expression);\n const controller = new AbortController();\n let initialized = false;\n let previous = '';\n let numeric: MotionValue<number> | undefined;\n let numericTarget: number | undefined;\n let formatter: Intl.NumberFormat;\n let controls: {stop(): void} | undefined;\n let numericScope: ReturnType<typeof createAnimationScope> | undefined;\n let unsubscribe: (() => void) | undefined;\n const apply = (input: unknown): void => {\n if (controller.signal.aborted) return;\n try {\n if (binding === 'paused') {\n setAnimationPaused(element, Boolean(input));\n return;\n }\n if (binding === 'number') {\n const next = numberDefinition(input);\n formatter = next.formatter;\n if (!numeric) {\n numeric = motionValue(next.value);\n unsubscribe = numeric.on('change', (value) => { element.textContent = formatter.format(value); });\n }\n element.textContent = formatter.format(numeric.get());\n if (initialized && next.value !== numericTarget) {\n controls?.stop();\n numericScope?.dispose();\n numericScope = createAnimationScope(element, getAnimationOptions(element), controller.signal, 'presence');\n controls = numericScope.animate(numeric, next.value);\n }\n numericTarget = next.value;\n initialized = true;\n return;\n }\n if (!input || typeof input !== 'object' || Array.isArray(input)) {\n throw new TypeError('x-ui-animate requires a Motion keyframes object.');\n }\n // Read nested arrays while the Alpine effect is active, including\n // in-place updates to a reactive targets object.\n const keyframes = Object.fromEntries(Object.entries(input).map(([property, value]) => [\n property, Array.isArray(value) ? [...value] : value,\n ])) as DOMKeyframesDefinition;\n const signature = JSON.stringify(keyframes);\n if (initialized && signature === previous) return;\n controls = animateProperties(element, keyframes, {\n signal: controller.signal,\n transition: initialized ? getAnimationOptions(element) ?? {} : {duration: 0},\n });\n previous = signature;\n initialized = true;\n } catch (error) {\n warn(error instanceof Error ? error.message : String(error), element);\n }\n };\n const refresh = (): void => { evaluator(apply); };\n utilities.effect(refresh);\n const unregister = registerDomInvalidationOwner(element, {invalidateDom: refresh});\n utilities.cleanup(() => {\n unregister();\n controller.abort();\n controls?.stop();\n numericScope?.dispose();\n unsubscribe?.();\n numeric?.destroy();\n if (binding === 'paused') setAnimationPaused(element, false);\n });\n }));\n};\n\nexport {registerAnimateDirective};\n","import type Alpine from 'alpinejs';\nimport {registerRequestRuntime, requestWithAlpine, type RequestOptions} from '@client/runtime/engine/request';\nimport {\n navigateWithAlpine,\n prepareNativeFragmentNavigation,\n registerNavigationRuntime,\n type NavigationOptions,\n} from '@client/runtime/engine/navigation';\nimport {isPlainRecord, warn} from '../utils';\n\ntype RequestDirectiveContext = Pick<Alpine.DirectiveData, 'expression'>;\ntype RequestDirectiveOptions = NavigationOptions & Record<string, unknown>;\ntype AnchorClick = {\n destination: URL;\n type: 'enhance' | 'native-fragment';\n};\n\nconst REQUEST_ROOT_SELECTOR = '[x-ui-request], [x-ui-request\\\\.navigate]';\nconst OPTION_KEYS = new Set(['data', 'extra', 'headers', 'history', 'method']);\nconst CLICK_MODIFIER_KEYS: Array<keyof MouseEvent> = ['altKey', 'ctrlKey', 'metaKey', 'shiftKey'];\nconst nativeFormSubmissions = new WeakSet<HTMLFormElement>();\n\nconst readOptions = (\n el: Element,\n {expression}: RequestDirectiveContext,\n utilities: Alpine.DirectiveUtilities,\n): RequestDirectiveOptions | null => {\n if (!expression?.trim()) return {};\n\n const evaluated = utilities.Alpine.evaluate(el, expression);\n if (!isPlainRecord(evaluated)) {\n warn('x-ui-request: expression must evaluate to an object');\n return null;\n }\n\n Object.keys(evaluated).forEach((key) => {\n if (!OPTION_KEYS.has(key)) warn('x-ui-request: unknown option key', key);\n });\n\n return evaluated as RequestDirectiveOptions;\n};\n\nconst submitterFrom = (event: SubmitEvent): HTMLElement | null => (\n event.submitter instanceof HTMLElement ? event.submitter : null\n);\n\nconst shouldEnhanceFormSubmit = (form: HTMLFormElement, event: SubmitEvent, submitter: HTMLElement | null): boolean => {\n if (event.defaultPrevented) return false;\n if ((submitter?.getAttribute('formmethod') || form.getAttribute('method'))?.toLowerCase() === 'dialog') return false;\n if (form.getAttribute('target')) return false;\n if (submitter?.getAttribute('formtarget')) return false;\n\n if (!form.noValidate && !form.checkValidity()) {\n form.reportValidity();\n return false;\n }\n\n return true;\n};\n\nconst samePageHashOnly = (url: URL): boolean => (\n url.hash !== ''\n && url.origin === window.location.origin\n && url.pathname === window.location.pathname\n && url.search === window.location.search\n);\n\nconst anchorClickFrom = (anchor: HTMLAnchorElement, event: MouseEvent, navigate: boolean): AnchorClick | null => {\n if (event.defaultPrevented) return null;\n if (event.button !== 0) return null;\n if (navigate && CLICK_MODIFIER_KEYS.some((key) => event[key])) return null;\n if (anchor.hasAttribute('download')) return null;\n if (anchor.getAttribute('target')) return null;\n\n const destination = new URL(anchor.href, document.baseURI);\n if (destination.origin !== window.location.origin) return null;\n if (samePageHashOnly(destination)) {\n return navigate ? {destination, type: 'native-fragment'} : null;\n }\n return {destination, type: 'enhance'};\n};\n\nconst registerFormDirective = (\n AlpineInstance: Alpine.Alpine,\n form: HTMLFormElement,\n directive: RequestDirectiveContext,\n utilities: Alpine.DirectiveUtilities,\n behavior: {navigate: boolean},\n): void => {\n const onSubmit = (event: SubmitEvent): void => {\n if (nativeFormSubmissions.delete(form)) return;\n const submitter = submitterFrom(event);\n if (!shouldEnhanceFormSubmit(form, event, submitter)) return;\n\n const options = readOptions(form, directive, utilities);\n if (!options) return;\n\n event.preventDefault();\n if (behavior.navigate) {\n navigateWithAlpine(AlpineInstance, form.action, form, {\n ...options,\n source: form,\n submitter,\n });\n return;\n }\n void requestWithAlpine(AlpineInstance, undefined, {\n ...options,\n source: form,\n submitter,\n }).then((result) => {\n if (result.type !== 'unavailable') return;\n nativeFormSubmissions.add(form);\n form.requestSubmit(submitter ?? undefined);\n }).catch((error: unknown) => warn('x-ui-request: request failed', error));\n };\n\n form.addEventListener('submit', onSubmit);\n utilities.cleanup?.(() => form.removeEventListener('submit', onSubmit));\n};\n\nconst registerAnchorDirective = (\n AlpineInstance: Alpine.Alpine,\n anchor: HTMLAnchorElement,\n directive: RequestDirectiveContext,\n utilities: Alpine.DirectiveUtilities,\n behavior: {navigate: boolean},\n): void => {\n const onClick = (event: MouseEvent): void => {\n const click = anchorClickFrom(anchor, event, behavior.navigate);\n if (!click) return;\n if (click.type === 'native-fragment') {\n prepareNativeFragmentNavigation(click.destination);\n return;\n }\n\n const options = readOptions(anchor, directive, utilities);\n if (!options) return;\n\n event.preventDefault();\n if (behavior.navigate) {\n navigateWithAlpine(AlpineInstance, click.destination, anchor, options);\n return;\n }\n void requestWithAlpine(AlpineInstance, anchor.href, {\n ...options,\n method: options.method ?? 'GET',\n source: anchor,\n }).then((result) => {\n if (result.type === 'unavailable') window.location.assign(anchor.href);\n }).catch((error: unknown) => warn('x-ui-request: request failed', error));\n };\n\n anchor.addEventListener('click', onClick);\n utilities.cleanup?.(() => anchor.removeEventListener('click', onClick));\n};\n\nconst registerRequestDirective = (AlpineInstance: Alpine.Alpine): void => {\n AlpineInstance.addRootSelector(() => REQUEST_ROOT_SELECTOR);\n registerRequestRuntime(AlpineInstance);\n registerNavigationRuntime(AlpineInstance);\n\n AlpineInstance.directive('ui-request', (el, {expression, modifiers}, utilities) => {\n const directive = {expression};\n\n if (el instanceof HTMLFormElement) {\n registerFormDirective(AlpineInstance, el, directive, utilities, {\n navigate: modifiers.includes('navigate'),\n });\n return;\n }\n\n if (el instanceof HTMLAnchorElement) {\n registerAnchorDirective(AlpineInstance, el, directive, utilities, {\n navigate: modifiers.includes('navigate'),\n });\n return;\n }\n\n warn('x-ui-request: directive only supports forms and anchors', el);\n });\n};\n\nexport {registerRequestDirective};\n","import type Alpine from 'alpinejs';\nimport {\n findAlpineMachineOwner,\n type AlpineMachineOwner,\n} from '@client/runtime/alpine-machine';\nimport type {TransitionContext} from '@client/runtime/transition-coordinator';\nimport {warn} from '@client/utils';\n\ntype TransitionEvaluator = ReturnType<Alpine.DirectiveUtilities['evaluateLater']>;\n\nconst evaluateTransition = <TProps, TData, TElement>(\n evaluator: TransitionEvaluator,\n transition: TransitionContext<TProps, TData, TElement>,\n): unknown => {\n let synchronous = true;\n let completedSynchronously = false;\n let result: unknown;\n let resolve!: (value: unknown) => void;\n const pending = new Promise<unknown>((resolvePromise) => {\n resolve = resolvePromise;\n });\n\n evaluator((value) => {\n if (synchronous) {\n completedSynchronously = true;\n result = value;\n return;\n }\n resolve(value);\n }, {scope: {$transition: transition}});\n synchronous = false;\n\n return completedSynchronously ? result : pending;\n};\n\nconst registerTransitionDirective = (AlpineInstance: Alpine.Alpine): void => {\n AlpineInstance.directive(\n 'ui-transition',\n AlpineInstance.skipDuringClone((el, {value: name, expression}, utilities) => {\n if (!name) {\n warn('x-ui-transition requires a transition name', el);\n return;\n }\n\n const owner = findAlpineMachineOwner(AlpineInstance, el);\n if (!owner) {\n warn(`x-ui-transition:${name} requires an owning Trellis machine`, el);\n return;\n }\n\n const evaluator = expression?.trim() ? utilities.evaluateLater(expression) : null;\n const unregister = owner.onTransition(name, (transition) => (\n evaluator ? evaluateTransition(evaluator, transition) : undefined\n ), el as Parameters<AlpineMachineOwner['onTransition']>[2]);\n utilities.cleanup(unregister);\n }),\n );\n};\n\nexport {registerTransitionDirective};\n","import type Alpine from 'alpinejs';\n\n// This engine adapts behavior and matching ideas from Alpine Morph, Morphlex, Idiomorph, and Datastar.\n// See THIRD_PARTY_NOTICES.md for provenance and license notices.\n\ntype Skip = () => void;\ntype ChildrenOnly = () => void;\ntype SkipChildren = () => void;\ntype SkipUntil = (predicate: (node: Node) => boolean) => void;\ntype UpdatingHook = (\n from: Node,\n to: Node,\n childrenOnly: ChildrenOnly,\n skip: Skip,\n skipChildren: SkipChildren,\n skipUntil: SkipUntil,\n) => void;\ntype SkippableNodeHook = (node: Node, skip: Skip) => void;\ntype PruningPolicy = 'after-root-hook' | 'before-descendant-hook';\n\ntype MorphOptions = {\n key?: (element: Element) => unknown;\n lookahead?: boolean;\n updating?: UpdatingHook;\n updated?: (from: Node, to: Node) => void;\n removing?: SkippableNodeHook;\n removed?: (node: Node) => void;\n remove?: (node: Node) => void;\n adding?: SkippableNodeHook;\n added?: (node: Node) => void;\n};\n\ntype MorphAlpine = Omit<Alpine.Alpine, 'cloneNode' | 'closestDataStack'> & {\n cloneNode(from: Element, to: Element): void;\n closestDataStack(node: Node): unknown;\n morph(from: Element, toHtml: Element | string, options?: MorphOptions): Element;\n morphBetween(\n startMarker: Comment,\n endMarker: Comment,\n toHtml: Element | string,\n options?: MorphOptions,\n ): void;\n};\n\ntype AlpineNode = Node & {\n _x_bindings?: {id?: string};\n _x_dataStack?: unknown;\n _x_currentIfEl?: AlpineNode;\n _x_lastRenderedEl?: AlpineNode;\n _x_lookup?: Map<unknown, AlpineNode>;\n _x_teleport?: AlpineNode;\n _x_transitioning?: unknown;\n _x_isShown?: boolean;\n};\n\ntype Parent = Node & {\n children: Iterable<Element>;\n firstChild: ChildNode | null;\n insertBefore(node: Node, before: Node | null): Node;\n};\n\nconst noop = (): void => {};\nlet alpineInstance: MorphAlpine | undefined;\n\nclass Block {\n constructor(\n readonly startComment: Comment,\n readonly endComment: Comment,\n ) {}\n\n get children(): Element[] {\n const children: Element[] = [];\n let node = this.startComment.nextSibling;\n while (node && node !== this.endComment) {\n if (node instanceof Element) children.push(node);\n node = node.nextSibling;\n }\n return children;\n }\n\n get firstChild(): ChildNode | null {\n const first = this.startComment.nextSibling;\n return first === this.endComment ? null : first;\n }\n\n appendChild(node: Node): Node {\n this.endComment.before(node);\n return node;\n }\n\n insertBefore(node: Node, reference: Node | null): Node {\n ((reference ?? this.endComment) as ChildNode).before(node);\n return node;\n }\n\n nextNode(reference: Node): ChildNode | null {\n const next = reference.nextSibling;\n return next === this.endComment ? null : next;\n }\n}\n\nconst nextSibling = (parent: Parent | Block, node: Node): ChildNode | null => (\n parent instanceof Block ? parent.nextNode(node) : node.nextSibling\n);\n\nconst createElement = (html: string): Element => {\n const template = document.createElement('template');\n template.innerHTML = html;\n const element = template.content.firstElementChild;\n if (!element) throw new Error('Morph HTML must contain a root element.');\n return element;\n};\n\nconst setIncomingAttribute = (target: Element, incoming: Attr): void => {\n if (incoming.namespaceURI) {\n target.setAttributeNodeNS(incoming.cloneNode() as Attr);\n } else if (incoming.name.includes('@')) {\n target.setAttributeNode(incoming.cloneNode() as Attr);\n } else {\n target.setAttribute(incoming.name, incoming.value);\n }\n};\n\nconst shouldSkip = (hook: SkippableNodeHook, node: Node): boolean => {\n let skip = false;\n hook(node, () => { skip = true; });\n return skip;\n};\n\nconst isConditionalStart = (node: Node | null): boolean => (\n node?.nodeType === Node.COMMENT_NODE && node.textContent === '[if BLOCK]><![endif]'\n);\n\nconst isConditionalEnd = (node: Node | null): boolean => (\n node?.nodeType === Node.COMMENT_NODE && node.textContent === '[if ENDBLOCK]><![endif]'\n);\n\nconst conditionalEnd = (parent: Parent | Block, start: Node): Comment => {\n let depth = 0;\n let node: Node | null = start;\n while ((node = nextSibling(parent, node))) {\n if (isConditionalStart(node)) depth += 1;\n else if (isConditionalEnd(node) && depth > 0) depth -= 1;\n else if (isConditionalEnd(node)) return node as Comment;\n }\n throw new Error('Unclosed conditional morph block.');\n};\n\ntype OwnedRange = {\n start: AlpineNode;\n end: AlpineNode;\n};\n\nconst ownedRange = (start: AlpineNode): OwnedRange => {\n let end = start;\n if (start._x_lastRenderedEl) end = start._x_lastRenderedEl;\n else if (start._x_currentIfEl) end = ownedRange(start._x_currentIfEl).end;\n else if (start._x_lookup?.size) {\n const owned = new Set(start._x_lookup.values());\n let sibling = start.nextSibling as AlpineNode | null;\n while (sibling && owned.has(sibling)) {\n end = ownedRange(sibling).end;\n sibling = end.nextSibling as AlpineNode | null;\n }\n }\n return {start, end};\n};\n\nconst afterOwnedRange = (parent: Parent | Block, range: OwnedRange): AlpineNode | null => (\n nextSibling(parent, range.end) as AlpineNode | null\n);\n\nconst isServerEqual = (from: AlpineNode, to: AlpineNode): boolean => {\n if (from.nodeType !== to.nodeType || from.nodeName !== to.nodeName) return false;\n if (from.nodeType === Node.TEXT_NODE || from.nodeType === Node.COMMENT_NODE) {\n return from.nodeValue === to.nodeValue;\n }\n if (from instanceof HTMLTemplateElement && to instanceof HTMLTemplateElement) {\n const fromTemplate = from as HTMLTemplateElement & AlpineNode;\n const toTemplate = to as HTMLTemplateElement & AlpineNode;\n if (fromTemplate._x_teleport) {\n const incomingTeleport = toTemplate._x_teleport ?? to.content.firstElementChild;\n return Boolean(incomingTeleport && isServerEqual(fromTemplate._x_teleport, incomingTeleport as AlpineNode));\n }\n return from.isEqualNode(to);\n }\n if (from instanceof Element && to instanceof Element) {\n if (from.attributes.length !== to.attributes.length) return false;\n for (const {name, value} of from.attributes) {\n if (to.getAttribute(name) !== value) return false;\n }\n }\n\n let fromChild = from.firstChild as AlpineNode | null;\n let toChild = to.firstChild as AlpineNode | null;\n while (fromChild && toChild) {\n if (!isServerEqual(fromChild, toChild)) return false;\n fromChild = ownedRange(fromChild).end.nextSibling as AlpineNode | null;\n toChild = toChild.nextSibling as AlpineNode | null;\n }\n return fromChild === null && toChild === null;\n};\n\nconst moveOwnedRangeBefore = (parent: Parent | Block, range: OwnedRange, before: Node | null): void => {\n if (range.start === before || afterOwnedRange(parent, range) === before) return;\n let node: Node | null = range.start;\n while (node) {\n const next: ChildNode | null = node.nextSibling;\n parent.insertBefore(node, before);\n if (node === range.end) break;\n node = next;\n }\n};\n\nconst seedDynamicId = (to: AlpineNode, from: AlpineNode | null): void => {\n const id = from?._x_bindings?.id;\n if (!id || !(to instanceof Element)) return;\n to.setAttribute('id', id);\n (to as HTMLElement).id = id;\n};\n\nconst buildDescendantCorrespondence = (\n fromElements: Element[],\n toElements: Element[],\n getKey: (node: Node | null) => unknown,\n): WeakMap<Node, symbol> => {\n const correspondence = new WeakMap<Node, symbol>();\n const fromDirectKeys = fromElements.map(getKey).filter(Boolean);\n const toDirectKeys = toElements.map(getKey).filter(Boolean);\n const directKeysReordered = fromDirectKeys.length >= 2\n && fromDirectKeys.length === toDirectKeys.length\n && new Set(fromDirectKeys).size === fromDirectKeys.length\n && fromDirectKeys.some((key, index) => key !== toDirectKeys[index])\n && fromDirectKeys.every((key) => toDirectKeys.includes(key));\n if (!directKeysReordered) return correspondence;\n\n const idCounts = (elements: Element[]): Map<string, number> => {\n const counts = new Map<string, number>();\n const count = (element: Element): void => {\n if (element.id) counts.set(element.id, (counts.get(element.id) ?? 0) + 1);\n };\n for (const element of elements) {\n count(element);\n element.querySelectorAll('[id]').forEach(count);\n }\n return counts;\n };\n const fromIdCounts = idCounts(fromElements);\n const toIdCounts = idCounts(toElements);\n const tokens = new Map<string, symbol>();\n for (const [id, count] of fromIdCounts) {\n if (count === 1 && toIdCounts.get(id) === 1) tokens.set(id, Symbol(id));\n }\n\n const indexDescendant = (element: Element): void => {\n if (getKey(element)) return;\n for (const descendant of element.querySelectorAll('[id]')) {\n const token = tokens.get(descendant.id);\n if (!token) continue;\n correspondence.set(element, token);\n return;\n }\n };\n fromElements.forEach(indexDescendant);\n toElements.forEach(indexDescendant);\n return correspondence;\n};\n\nconst createContext = (options: MorphOptions = {}) => {\n const context = {\n key: options.key ?? ((element: Element) => element.getAttribute('key')),\n lookahead: options.lookahead ?? false,\n updating: options.updating ?? noop,\n updated: options.updated ?? noop,\n removing: options.removing ?? noop,\n removed: options.removed ?? noop,\n remove: options.remove ?? ((node: Node) => { node.parentNode?.removeChild(node); }),\n adding: options.adding ?? noop,\n added: options.added ?? noop,\n skipUntilCondition: null as ((node: Node) => boolean) | null,\n };\n\n const getKey = (node: Node | null): unknown => (\n node instanceof Element ? context.key(node) : null\n );\n\n const requiresReplacement = (from: Node, to: Node): boolean => (\n from.nodeType !== to.nodeType\n || from.nodeName !== to.nodeName\n || getKey(from) !== getKey(to)\n || (from instanceof Element\n && to instanceof Element\n && from.getAttribute('x-data') !== to.getAttribute('x-data'))\n );\n\n const insertNodeBefore = (\n parent: Parent | Block,\n source: Node,\n before: Node | null,\n ): {inserted: false; node: null} | {inserted: true; node: AlpineNode} => {\n if (shouldSkip(context.adding, source)) return {inserted: false, node: null};\n const clone = source.cloneNode(true);\n parent.insertBefore(clone, before);\n context.added(clone);\n return {inserted: true, node: clone as AlpineNode};\n };\n\n const removeNode = (node: Node): boolean => {\n if (shouldSkip(context.removing, node)) return false;\n context.remove(node);\n context.removed(node);\n return true;\n };\n\n const removeOwnedRange = (range: OwnedRange): boolean => {\n if (shouldSkip(context.removing, range.start)) return false;\n context.remove(range.start);\n context.removed(range.start);\n return true;\n };\n\n const replaceNode = (from: Node, to: Node): boolean => {\n if (shouldSkip(context.removing, from)) return false;\n const clone = to.cloneNode(true);\n if (shouldSkip(context.adding, clone)) return false;\n from.parentNode?.insertBefore(clone, from);\n context.remove(from);\n context.removed(from);\n context.added(clone);\n return true;\n };\n\n const patchAttributes = (from: AlpineNode & Element, to: Element): boolean => {\n if (from._x_transitioning) return false;\n if ((from._x_isShown && !(to as AlpineNode)._x_isShown)\n || (!from._x_isShown && (to as AlpineNode)._x_isShown)) return false;\n\n let changed = false;\n const existing = Array.from(from.attributes);\n for (let index = existing.length - 1; index >= 0; index -= 1) {\n const name = existing[index]!.name;\n if (to.hasAttribute(name)) continue;\n if (name === 'open' && from instanceof HTMLDialogElement && from.open) from.close();\n else from.removeAttribute(name);\n changed = true;\n }\n const incoming = Array.from(to.attributes);\n for (let index = incoming.length - 1; index >= 0; index -= 1) {\n const attribute = incoming[index]!;\n const {name, value} = attribute;\n if (from.getAttribute(name) === value) continue;\n setIncomingAttribute(from, attribute);\n changed = true;\n }\n return changed;\n };\n\n let patchChildren: (from: Parent | Block, to: Parent | Block) => boolean;\n\n const patchNode = (from: AlpineNode, to: AlpineNode, pruning: PruningPolicy): boolean => {\n if (from instanceof Element && from.hasAttribute('data-ui-ignore-morph')) return false;\n if (requiresReplacement(from, to)) return replaceNode(from, to);\n if (pruning === 'before-descendant-hook'\n && from.nodeType !== Node.COMMENT_NODE\n && isServerEqual(from, to)) return false;\n\n let childrenOnly = false;\n let skipChildren = false;\n let skip = false;\n const skipUntil = (predicate: (node: Node) => boolean): void => {\n context.skipUntilCondition = predicate;\n };\n context.updating(\n from,\n to,\n () => { childrenOnly = true; },\n () => { skip = true; },\n () => { skipChildren = true; },\n skipUntil,\n );\n if (skip) return false;\n\n // Descendants that are server-identical are opaque. The root is checked only\n // after its hook has had the opportunity to mutate the incoming tree.\n if (isServerEqual(from, to)) return false;\n\n let changed = false;\n if (from.nodeType === Node.ELEMENT_NODE && alpineInstance) {\n alpineInstance.cloneNode(from as Element, to as Element);\n if (from._x_teleport && to._x_teleport) {\n changed = patch(from._x_teleport, to._x_teleport) || changed;\n }\n }\n\n if (to.nodeType === Node.TEXT_NODE || to.nodeType === Node.COMMENT_NODE) {\n if (from.nodeValue === to.nodeValue) return false;\n from.nodeValue = to.nodeValue;\n context.updated(from, to);\n return true;\n }\n\n if (!childrenOnly) changed = patchAttributes(from as AlpineNode & Element, to as Element) || changed;\n if (!skipChildren) changed = patchChildren(from as unknown as Parent, to as unknown as Parent) || changed;\n if (changed) context.updated(from, to);\n return changed;\n };\n\n const patch = (from: AlpineNode, to: AlpineNode): boolean => (\n patchNode(from, to, 'before-descendant-hook')\n );\n const patchRoot = (from: AlpineNode, to: AlpineNode): boolean => (\n patchNode(from, to, 'after-root-hook')\n );\n\n patchChildren = (from: Parent | Block, to: Parent | Block): boolean => {\n const fromElements = Array.from(from.children);\n const toElements = Array.from(to.children);\n const correspondence = buildDescendantCorrespondence(fromElements, toElements, getKey);\n\n const childKey = (node: Node | null): unknown => (\n node ? getKey(node) || correspondence.get(node) : null\n );\n const keyed = new Map<unknown, AlpineNode>();\n for (const element of fromElements) {\n const key = childKey(element);\n if (key) keyed.set(key, element as AlpineNode);\n }\n\n let changed = false;\n let currentFrom = from.firstChild as AlpineNode | null;\n let currentTo = to.firstChild as AlpineNode | null;\n\n incoming: while (currentTo) {\n seedDynamicId(currentTo, currentFrom);\n\n if (context.skipUntilCondition) {\n const fromDone = !currentFrom || context.skipUntilCondition(currentFrom);\n const toDone = context.skipUntilCondition(currentTo);\n if (fromDone && toDone) context.skipUntilCondition = null;\n else {\n if (!fromDone && currentFrom) currentFrom = afterOwnedRange(from, ownedRange(currentFrom));\n if (!toDone) currentTo = nextSibling(to, currentTo) as AlpineNode | null;\n continue;\n }\n }\n\n if (!currentFrom) {\n const addition = insertNodeBefore(from, currentTo, null);\n changed = addition.inserted || changed;\n currentTo = nextSibling(to, currentTo) as AlpineNode | null;\n continue;\n }\n\n if (isConditionalStart(currentFrom) && isConditionalStart(currentTo)) {\n const fromEnd = conditionalEnd(from, currentFrom);\n const toEnd = conditionalEnd(to, currentTo);\n changed = patchChildren(new Block(currentFrom as Comment, fromEnd), new Block(currentTo as Comment, toEnd)) || changed;\n currentFrom = nextSibling(from, fromEnd) as AlpineNode | null;\n currentTo = nextSibling(to, toEnd) as AlpineNode | null;\n continue;\n } else {\n if (context.lookahead\n && currentFrom instanceof Element\n && !currentFrom.isEqualNode(currentTo)) {\n let lookahead = nextSibling(to, currentTo) as AlpineNode | null;\n while (lookahead) {\n if (lookahead instanceof Element && currentFrom.isEqualNode(lookahead)) {\n const addition = insertNodeBefore(from, currentTo, currentFrom);\n if (!addition.inserted) {\n currentTo = nextSibling(to, currentTo) as AlpineNode | null;\n continue incoming;\n }\n currentFrom = addition.node;\n changed = true;\n break;\n }\n lookahead = nextSibling(to, lookahead) as AlpineNode | null;\n }\n }\n\n const toKey = childKey(currentTo);\n const fromKey = childKey(currentFrom);\n if (toKey !== fromKey) {\n const keyedMatch = toKey ? keyed.get(toKey) : undefined;\n if (keyedMatch) {\n moveOwnedRangeBefore(from, ownedRange(keyedMatch), currentFrom);\n currentFrom = keyedMatch;\n changed = true;\n } else if (toKey || fromKey) {\n const addition = insertNodeBefore(from, currentTo, currentFrom);\n if (!addition.inserted) {\n currentTo = nextSibling(to, currentTo) as AlpineNode | null;\n continue;\n }\n currentFrom = addition.node;\n changed = true;\n }\n }\n\n const afterFrom = afterOwnedRange(from, ownedRange(currentFrom));\n changed = patch(currentFrom, currentTo) || changed;\n currentFrom = afterFrom;\n }\n\n currentTo = nextSibling(to, currentTo) as AlpineNode | null;\n }\n\n while (currentFrom) {\n const range = ownedRange(currentFrom);\n const after = afterOwnedRange(from, range);\n changed = (range.end === range.start ? removeNode(currentFrom) : removeOwnedRange(range)) || changed;\n currentFrom = after;\n }\n return changed;\n };\n\n return {patchChildren, patchRoot};\n};\n\nconst morph = (from: Element, toHtml: Element | string, options: MorphOptions = {}): Element => {\n const to = (typeof toHtml === 'string' ? createElement(toHtml) : toHtml) as AlpineNode & Element;\n const source = from as AlpineNode & Element;\n if (alpineInstance?.closestDataStack && !source._x_dataStack) {\n to._x_dataStack = alpineInstance.closestDataStack(source);\n if (to._x_dataStack) alpineInstance.cloneNode(source, to);\n }\n createContext(options).patchRoot(source, to);\n return from;\n};\n\nconst morphBetween = (\n startMarker: Comment,\n endMarker: Comment,\n toHtml: Element | string,\n options: MorphOptions = {},\n): void => {\n const fromContainer = startMarker.parentNode as AlpineNode & Parent;\n const toContainer = typeof toHtml === 'string'\n ? (() => {\n const container = document.createElement('div');\n container.insertAdjacentHTML('beforeend', toHtml);\n return container;\n })()\n : toHtml;\n const toStart = document.createComment('[morph-start]');\n const toEnd = document.createComment('[morph-end]');\n toContainer.insertBefore(toStart, toContainer.firstChild);\n toContainer.appendChild(toEnd);\n if (alpineInstance?.closestDataStack) {\n (toContainer as AlpineNode)._x_dataStack = alpineInstance.closestDataStack(fromContainer);\n if ((toContainer as AlpineNode)._x_dataStack) alpineInstance.cloneNode(fromContainer as unknown as Element, toContainer);\n }\n createContext(options).patchChildren(\n new Block(startMarker, endMarker),\n new Block(toStart, toEnd),\n );\n};\n\nconst trellisMorph = (AlpineInstance: Alpine.Alpine): void => {\n const instance = AlpineInstance as MorphAlpine;\n alpineInstance = instance;\n instance.morph = morph;\n instance.morphBetween = morphBetween;\n};\n\nexport {morph, morphBetween};\nexport default trellisMorph;\n","type SubmitterElement = HTMLButtonElement | HTMLInputElement;\n\ntype ConfirmProceed = () => void;\ntype ConfirmCancel = () => void;\n\ntype ConfirmEventDetail = {\n form: HTMLFormElement;\n message: string;\n submitter: SubmitterElement | null;\n triggeringEvent: SubmitEvent;\n proceed: ConfirmProceed;\n cancel: ConfirmCancel;\n};\n\ntype ConfirmRuntimeOptions = {\n root?: Document;\n};\n\nconst DEFAULT_CONFIRM_MESSAGE = 'Are you sure?';\n\nlet removeSubmitListener: (() => void) | null = null;\nconst bypassedForms = new WeakSet<HTMLFormElement>();\n\nconst isSubmitterElement = (value: unknown): value is SubmitterElement => (\n value instanceof HTMLButtonElement || value instanceof HTMLInputElement\n);\n\nconst confirmMessageFor = ({form, submitter}: {\n form: HTMLFormElement;\n submitter: SubmitterElement | null;\n}): string | null => {\n const submitterMessage = submitter?.dataset.uiConfirm;\n if (submitterMessage !== undefined) return submitterMessage || DEFAULT_CONFIRM_MESSAGE;\n\n const formMessage = form.dataset.uiConfirm;\n if (formMessage !== undefined) return formMessage || DEFAULT_CONFIRM_MESSAGE;\n\n return null;\n};\n\nconst queueConfirmedSubmit = ({form, submitter}: {\n form: HTMLFormElement;\n submitter: SubmitterElement | null;\n}): void => {\n // Chromium can retain the form's submission guard through the current microtask checkpoint.\n window.setTimeout(() => {\n if (!form.isConnected || (submitter && submitter.form !== form)) return;\n\n bypassedForms.add(form);\n try {\n form.requestSubmit(submitter ?? undefined);\n } finally {\n bypassedForms.delete(form);\n }\n }, 0);\n};\n\nconst handleSubmit = (event: SubmitEvent): void => {\n const form = event.target;\n if (!(form instanceof HTMLFormElement)) return;\n\n if (bypassedForms.has(form)) {\n bypassedForms.delete(form);\n return;\n }\n\n const submitter = isSubmitterElement(event.submitter) ? event.submitter : null;\n const message = confirmMessageFor({form, submitter});\n if (message === null) return;\n\n event.preventDefault();\n\n let settled = false;\n const proceed = (): void => {\n if (settled) return;\n settled = true;\n queueConfirmedSubmit({form, submitter});\n };\n const cancel = (): void => {\n settled = true;\n };\n const confirmEvent = new CustomEvent<ConfirmEventDetail>('ui:confirm', {\n bubbles: true,\n cancelable: true,\n detail: {\n form,\n message,\n submitter,\n triggeringEvent: event,\n proceed,\n cancel,\n },\n });\n\n form.dispatchEvent(confirmEvent);\n if (confirmEvent.defaultPrevented) return;\n\n if (window.confirm(message)) {\n proceed();\n } else {\n cancel();\n }\n};\n\nconst registerConfirm = ({root = document}: ConfirmRuntimeOptions = {}): void => {\n if (removeSubmitListener) return;\n\n root.addEventListener('submit', handleSubmit as EventListener, {capture: true});\n removeSubmitListener = (): void => root.removeEventListener('submit', handleSubmit as EventListener, {capture: true});\n};\n\nconst unregisterConfirm = (): void => {\n removeSubmitListener?.();\n removeSubmitListener = null;\n};\n\nexport {registerConfirm, unregisterConfirm};\nexport type {ConfirmCancel, ConfirmEventDetail, ConfirmProceed, ConfirmRuntimeOptions};\n","import type {CodecFn} from './codecs';\n\ntype PropKind = 'string' | 'number' | 'boolean' | 'enum' | 'json';\n\ntype ManifestProp = {\n type: PropKind;\n default?: unknown;\n values?: readonly string[];\n description?: string;\n initialOnly?: boolean;\n};\n\ntype ManifestPart = {\n selector: string;\n description: string;\n};\n\ntype ManifestToken = {\n name: string;\n description: string;\n};\n\ntype ManifestAcceptedEvent = {\n description: string;\n detail?: Record<string, string>;\n};\n\ntype ComponentManifestMeta = {\n group?: string;\n};\n\ntype ComponentManifestFields = {\n name: string;\n title: string;\n description: string;\n meta?: ComponentManifestMeta;\n slots?: Record<string, string>;\n events?: Record<string, string>;\n acceptedEvents?: Record<string, ManifestAcceptedEvent>;\n parts?: Record<string, ManifestPart>;\n tokens?: readonly ManifestToken[];\n};\n\ntype ManualComponentManifest = ComponentManifestFields & {\n props?: Record<string, ManifestProp>;\n propSchema?: never;\n};\n\ntype SchemaComponentManifest = ComponentManifestFields & {\n props: Record<string, ManifestProp>;\n propSchema: Record<string, CodecFn<unknown>>;\n};\n\ntype ComponentManifest = ManualComponentManifest | SchemaComponentManifest;\n\ntype ManifestPropDetails = Pick<ManifestProp, 'description'> & {\n name?: string;\n initialOnly?: boolean;\n};\n\ntype SchemaPropDetails<T extends Record<string, CodecFn<unknown>>> = {\n [K in keyof T]?: ManifestPropDetails;\n};\n\ntype DefineManifestOptions<T extends ManualComponentManifest> = {\n manifest: T & {propSchema?: never};\n};\n\ntype PropsFromSchemaOptions<T extends Record<string, CodecFn<unknown>>> = {\n schema: T;\n details: SchemaPropDetails<T>;\n};\n\ntype DefineSchemaManifestOptions<\n TSchema extends Record<string, CodecFn<unknown>>,\n TManifest extends ComponentManifestFields,\n> = {\n schema: TSchema;\n details: SchemaPropDetails<TSchema>;\n templateProps?: Record<string, ManifestProp>;\n templatePropsPosition?: 'before' | 'after';\n manifest: TManifest & {props?: never; propSchema?: never};\n};\n\nconst toSnake = (value: string): string => value.replace(/([A-Z])/g, '_$1').toLowerCase();\n\nconst defineManifest = <const T extends ManualComponentManifest>({manifest}: DefineManifestOptions<T>): Readonly<T> => {\n if ('propSchema' in manifest) throw new Error('Manual manifests cannot supply propSchema.');\n return Object.freeze(manifest);\n};\n\nconst propsFromSchema = <const T extends Record<string, CodecFn<unknown>>>({\n schema,\n details,\n}: PropsFromSchemaOptions<T>): Record<string, ManifestProp> => {\n const props: Record<string, ManifestProp> = {};\n\n Object.entries(schema).forEach(([schemaKey, codec]) => {\n const propDetails = details[schemaKey as keyof T] ?? {};\n const meta = codec.meta;\n const propName = propDetails.name ?? toSnake(schemaKey);\n if (propName in props) {\n throw new Error(`Schema property ${schemaKey} resolves to duplicate manifest property ${propName}.`);\n }\n const prop: ManifestProp = {\n type: meta.type,\n default: meta.default,\n };\n\n if (meta.values) prop.values = meta.values;\n if (propDetails.description) prop.description = propDetails.description;\n if (propDetails.initialOnly) prop.initialOnly = true;\n\n props[propName] = prop;\n });\n\n return props;\n};\n\nconst defineSchemaManifest = <\n const TSchema extends Record<string, CodecFn<unknown>>,\n const TManifest extends ComponentManifestFields,\n>({\n schema,\n details,\n templateProps = {},\n templatePropsPosition = 'after',\n manifest,\n}: DefineSchemaManifestOptions<TSchema, TManifest>): Readonly<TManifest & {\n props: Record<string, ManifestProp>;\n propSchema: TSchema;\n}> => {\n const schemaProps = propsFromSchema({schema, details});\n Object.keys(templateProps).forEach((propName) => {\n if (propName in schemaProps) {\n throw new Error(`Template prop ${propName} collides with schema property ${propName}.`);\n }\n });\n\n const props = templatePropsPosition === 'before'\n ? {...templateProps, ...schemaProps}\n : {...schemaProps, ...templateProps};\n const {name, title, description, meta, ...rest} = manifest;\n const result = {\n name,\n title,\n description,\n ...(meta ? {meta} : {}),\n propSchema: schema,\n props,\n ...rest,\n } as TManifest & {props: Record<string, ManifestProp>; propSchema: TSchema};\n\n return Object.freeze(result);\n};\n\nexport {defineManifest, defineSchemaManifest, propsFromSchema};\nexport type {\n ComponentManifest,\n DefineManifestOptions,\n DefineSchemaManifestOptions,\n ManualComponentManifest,\n ManifestPart,\n ManifestProp,\n ManifestPropDetails,\n ManifestAcceptedEvent,\n ComponentManifestMeta,\n ManifestToken,\n PropsFromSchemaOptions,\n PropKind,\n SchemaPropDetails,\n SchemaComponentManifest,\n};\n","import type {Alpine as AlpineType} from 'alpinejs';\n\nimport {registerAnimateDirective} from './directives/animate';\nimport {registerAnimationLifecycle} from './motion/lifecycle';\nimport {registerRequestDirective} from './directives/request';\nimport {registerTransitionDirective} from './directives/transition';\nimport morph from './runtime/morph-engine';\nimport {setPropReactivity} from './runtime/codecs';\nimport {registerConfirm} from './runtime/confirm';\nimport {registerStream} from './runtime/engine/stream';\nimport {registerUiMagic, ui} from './runtime/ui';\n\ntype CoreRuntimePlugin = (AlpineInstance: AlpineType) => void;\nconst registered = new WeakSet<AlpineType>();\n\nconst coreRuntime: CoreRuntimePlugin = (AlpineInstance): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n setPropReactivity(AlpineInstance.reactive);\n AlpineInstance.plugin(morph);\n registerAnimationLifecycle(async () => { await AlpineInstance.nextTick(); });\n registerUiMagic(AlpineInstance);\n registerAnimateDirective(AlpineInstance);\n registerTransitionDirective(AlpineInstance);\n registerConfirm();\n registerRequestDirective(AlpineInstance);\n registerStream(AlpineInstance);\n};\n\nexport {coreRuntime, ui};\nexport default coreRuntime;\nexport type {CoreRuntimePlugin};\nexport {\n bool,\n createAlpineMachine,\n createMachine,\n decodeProps,\n defineAlpineData,\n defineManifest,\n defineSchemaManifest,\n defineProps,\n defineStyles,\n json,\n mergeBindings,\n number,\n oneOf,\n propsFromSchema,\n resolveStyle,\n string,\n createTransitionCoordinator,\n defineHook,\n} from './runtime';\nexport type {\n AlpineMachine,\n AlpineMachineOwner,\n AlpinePropsChangedEvent,\n AlpineDataFactory,\n AlpineDataRegistrar,\n CodecFn,\n ComponentManifest,\n CreateAlpineMachineOptions,\n DecodePropsOptions,\n Machine,\n MachineConfig,\n MachineEffect,\n MachineEffectList,\n MachineEffectRef,\n MachineEntry,\n MachineEvent,\n MachineEventObject,\n MachineGuard,\n MachineOptions,\n MachineReducer,\n MachineReducerList,\n MachineReducerRef,\n MachineScope,\n MachineSnapshot,\n MachineStateConfig,\n MachineStateValue,\n MachineTransition,\n MachineTransitionDefinition,\n MachineUpdate,\n DefineManifestOptions,\n DefineSchemaManifestOptions,\n DefineStylesOptions,\n ManifestPart,\n ManifestProp,\n ManifestPropDetails,\n ManifestToken,\n ManualComponentManifest,\n MachineFactoryScope,\n BindingInput,\n PropState,\n PropsFromSchemaOptions,\n MergeBindingsOptions,\n ResolveStyleOptions,\n SchemaPropDetails,\n SchemaComponentManifest,\n SchemaToProps,\n StyleDefinition,\n StylePart,\n StyleProps,\n TrellisAlpineComponent,\n AnyTransitionHook,\n TransitionCallback,\n TransitionContext,\n TransitionCoordinator,\n TransitionCoordinatorOptions,\n TransitionEventCreator,\n TransitionForHook,\n TransitionHookDefinition,\n UiGetOptions,\n UiRequestOptions,\n UiRuntime,\n UiTheme,\n ThemeMode,\n ResolvedThemeMode,\n} from './runtime';\nexport {registerTransitionDirective} from './directives/transition';\n\nexport type {AnimationRecipe, AnimationPhase, AnimationContext} from './motion/registry';\nexport type {MotionConfiguration} from './motion/config';\n"],"mappings":"orBAcA,IAAM,GAAoB,GAAkE,CACxF,IAAM,EAAa,OAAO,GAAU,SAAW,CAAC,MAAO,CAAK,EAAI,EAChE,GAAI,CAAC,GAAc,OAAO,GAAe,UAAY,OAAO,EAAW,OAAU,UAAY,CAAC,OAAO,SAAS,EAAW,KAAK,EAC1H,MAAU,UAAU,6EAA6E,EAErG,MAAO,CACH,MAAO,EAAW,MAClB,UAAW,IAAI,KAAK,aAAa,EAAW,QAAS,EAAW,QAAU,CAAC,sBAAuB,CAAC,CAAC,CACxG,CACJ,EAEM,GAA4B,GAAwC,CACtE,EAAe,UAAU,aAAc,EAAe,iBAAiB,EAAS,CAAC,MAAO,EAAS,cAAa,IAAc,CACxH,GAAI,GAAW,IAAY,UAAY,IAAY,SAAU,CACzD,EAAK,iCAAiC,IAAW,CAAO,EACxD,MACJ,CACA,IAAM,EAAY,EAAU,cAAc,CAAU,EAC9C,EAAa,IAAI,gBACnB,EAAc,GACd,EAAW,GACX,EACA,EACA,EACA,EACA,EACA,EACE,EAAS,GAAyB,CAChC,MAAW,OAAO,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,OAAO,EAAK,EAC3B,EAA2B,SAAY,CAAE,MAAM,EAAe,SAAS,CAAG,CAAC,EAC3E,EAAgB,CAAc,EAC9B,GAAyB,CAAc,EACvC,EAA4B,CAAc,EAC1C,EAAgB,EAChB,GAAyB,CAAc,EACvC,GAAe,CAAc,EACjC"}
@@ -1,2 +1,2 @@
1
- export * from "./core-CX4J7tsN.js";
2
- export {default} from "./core-CX4J7tsN.js";
1
+ export * from "./core-CbDVD_pk.js";
2
+ export {default} from "./core-CbDVD_pk.js";
@@ -49,10 +49,10 @@
49
49
  ]
50
50
  },
51
51
  "trellis:sortable": {
52
- "file": "capabilities/sortable-Do3a0LA9.js",
52
+ "file": "capabilities/sortable-CgP1efhO.js",
53
53
  "imports": [
54
54
  "bridge-B7apK0M-.js",
55
- "chunks/capability-sortable-Bm1phXnj.js",
55
+ "chunks/capability-sortable-CpUAUTdh.js",
56
56
  "chunks/codecs-CQ7olTJL.js",
57
57
  "chunks/common-DnEHZCqy.js",
58
58
  "chunks/dom-DiTFTWeR.js",
@@ -68,9 +68,10 @@
68
68
  "chunks/machine-Do4tL7nc.js",
69
69
  "chunks/morph-Cq3V_23_.js",
70
70
  "chunks/object-SRW-YaCA.js",
71
+ "chunks/preferences-BZyZ-kK6.js",
71
72
  "chunks/preload-helper-BZ1Pz5am.js",
72
73
  "chunks/properties-D8pFWF8g.js",
73
- "chunks/ui-CZ7fEQL2.js",
74
+ "chunks/ui-CVVSxrtG.js",
74
75
  "chunks/warn-BbGtqbh1.js"
75
76
  ]
76
77
  },
@@ -125,12 +126,12 @@
125
126
  ]
126
127
  },
127
128
  "trellis:data-grid": {
128
- "file": "components/data-grid-Dm3rQfQ_.js",
129
+ "file": "components/data-grid-Cr9kEoo9.js",
129
130
  "imports": [
130
131
  "bridge-B7apK0M-.js",
131
132
  "chunks/alpine-data-Dvc_bXq6.js",
132
133
  "chunks/capability-resizable-DPMSJ1AR.js",
133
- "chunks/capability-sortable-Bm1phXnj.js",
134
+ "chunks/capability-sortable-CpUAUTdh.js",
134
135
  "chunks/cleanup-manager-D9QiZF_Q.js",
135
136
  "chunks/codecs-CQ7olTJL.js",
136
137
  "chunks/common-DnEHZCqy.js",
@@ -150,10 +151,11 @@
150
151
  "chunks/machine-Do4tL7nc.js",
151
152
  "chunks/morph-Cq3V_23_.js",
152
153
  "chunks/object-SRW-YaCA.js",
154
+ "chunks/preferences-BZyZ-kK6.js",
153
155
  "chunks/preload-helper-BZ1Pz5am.js",
154
156
  "chunks/properties-D8pFWF8g.js",
155
157
  "chunks/scroll-area-schema-DZgYyysJ.js",
156
- "chunks/ui-CZ7fEQL2.js",
158
+ "chunks/ui-CVVSxrtG.js",
157
159
  "chunks/virtualizer-size-CTy2gO64.js",
158
160
  "chunks/warn-BbGtqbh1.js"
159
161
  ]
@@ -604,7 +606,7 @@
604
606
  ]
605
607
  },
606
608
  "trellis:core": {
607
- "file": "core-CX4J7tsN.js",
609
+ "file": "core-CbDVD_pk.js",
608
610
  "imports": [
609
611
  "bridge-B7apK0M-.js",
610
612
  "chunks/alpine-data-Dvc_bXq6.js",
@@ -625,7 +627,7 @@
625
627
  "chunks/preload-helper-BZ1Pz5am.js",
626
628
  "chunks/properties-D8pFWF8g.js",
627
629
  "chunks/styles-CX2j92ex.js",
628
- "chunks/ui-CZ7fEQL2.js",
630
+ "chunks/ui-CVVSxrtG.js",
629
631
  "chunks/warn-BbGtqbh1.js"
630
632
  ]
631
633
  }
@@ -226,6 +226,34 @@ When changing an axis, move its schema, defaults, resolution, focused generator,
226
226
  boundary tests together. Add cross-axis coordination only in orchestration. Never hand-edit `dist/` or
227
227
  `packages/client/src/styles/generated/`.
228
228
 
229
+ ## Text selection
230
+
231
+ `semantic.roles.textSelection` controls the browser's `::selection` highlight independently of selected component
232
+ states. The default uses accent step 9 at 25% opacity and uses the browser's `currentColor` text ink. Background and
233
+ foreground references resolve through the active appearance's palette; opacity ranges from `0` to `1`.
234
+
235
+ ```json
236
+ {
237
+ "semantic": {
238
+ "roles": {
239
+ "strategy": "functional-role-graph",
240
+ "version": 1,
241
+ "textSelection": {
242
+ "background": {"family": "neutral", "color": {"kind": "step", "step": 12}},
243
+ "opacity": 1,
244
+ "foreground": {"family": "neutral", "color": {"kind": "step", "step": 1}}
245
+ }
246
+ }
247
+ }
248
+ }
249
+ ```
250
+
251
+ This example uses opposing ends of the neutral palette for an opaque highlight. Set `foreground` to `"inherit"`
252
+ to restore the surrounding text color. Explicit foregrounds are preserved as authored; choose a readable pair.
253
+ The compiler emits `--background-text-selection` and, for an explicit foreground, `--color-text-selection-ink`.
254
+ The single global rule in `theme-support.css` consumes these tokens, falling back to `currentColor` for inherited ink.
255
+ The knob catalog exposes these controls in the Text selection group, including Text selection intensity for opacity.
256
+
229
257
  ## Dismiss control radius
230
258
 
231
259
  `radius.dismiss` selects the shared shape of standalone Card, Modal, and Toast dismiss controls. It defaults to
@@ -3066,6 +3066,13 @@ var addAppearanceTokens = (group, appearance) => {
3066
3066
  "focus-width"
3067
3067
  ], token("dimension", dimensionValue(output.focus.width), `--color-intent-${intentName}-focus-width`, "runtime"));
3068
3068
  }
3069
+ const textSelection = appearance.semantic.textSelection;
3070
+ put(group, ["background", "text-selection"], colorToken(textSelection.background.color, "--background-text-selection", "runtime"));
3071
+ if (textSelection.foreground !== "inherit") put(group, [
3072
+ "color",
3073
+ "text-selection",
3074
+ "ink"
3075
+ ], colorToken(textSelection.foreground.color, "--color-text-selection-ink", "runtime"));
3069
3076
  const interactions = appearance.semantic.interactions;
3070
3077
  for (const name of Object.keys(interactions.selection.treatments).sort()) {
3071
3078
  const treatment = interactions.selection.treatments[name];
@@ -5466,6 +5473,15 @@ var SemanticColorReferenceSchema = Type.Union([Type.Object({
5466
5473
  kind: Type.Literal("alpha-step"),
5467
5474
  step: RadixStepSchema
5468
5475
  }, closed$1)]);
5476
+ var TextSelectionColorSchema = Type.Object({
5477
+ family: SemanticFamilySchema,
5478
+ color: SemanticColorReferenceSchema
5479
+ }, closed$1);
5480
+ var TextSelectionSchema = Type.Object({
5481
+ background: Type.Optional(TextSelectionColorSchema),
5482
+ opacity: Type.Optional(Type.Number(unit)),
5483
+ foreground: Type.Optional(Type.Union([Type.Literal("inherit"), TextSelectionColorSchema]))
5484
+ }, closed$1);
5469
5485
  var MinimumDeltaEStrengthSchema = Type.Object({
5470
5486
  kind: Type.Literal("minimum-delta-e"),
5471
5487
  minimum: Type.Number({
@@ -5608,6 +5624,7 @@ var InteractionConfigV3Schema = Type.Object({
5608
5624
  }, closed$1);
5609
5625
  var SemanticConfigSchema = Type.Object({
5610
5626
  roles: Type.Optional(Type.Object({
5627
+ textSelection: Type.Optional(TextSelectionSchema),
5611
5628
  strategy: Type.Literal("functional-role-graph"),
5612
5629
  version: Type.Literal(1),
5613
5630
  structure: Type.Optional(Type.Object({ separator: Type.Optional(Type.Object({
@@ -11536,6 +11553,17 @@ var selectionTreatmentDefaults = (family) => ({
11536
11553
  });
11537
11554
  var BASELINE_SEMANTIC = {
11538
11555
  roles: {
11556
+ textSelection: {
11557
+ background: {
11558
+ family: "accent",
11559
+ color: {
11560
+ kind: "step",
11561
+ step: 9
11562
+ }
11563
+ },
11564
+ opacity: .25,
11565
+ foreground: "inherit"
11566
+ },
11539
11567
  strategy: "functional-role-graph",
11540
11568
  version: 1,
11541
11569
  structure: { separator: {
@@ -12926,14 +12954,28 @@ var resolveSemantic = (config, diagnostics) => {
12926
12954
  requested: profile.family,
12927
12955
  message: `Semantic intent ${intentName} references an undeclared palette family.`
12928
12956
  });
12929
- const separator = semantic.roles.structure.separator.color;
12930
- if (!available.has(separator.family)) diagnostics.push({
12957
+ const textSelection = semantic.roles.textSelection;
12958
+ const roleColors = [
12959
+ {
12960
+ path: "structure/separator/color",
12961
+ reference: semantic.roles.structure.separator.color
12962
+ },
12963
+ {
12964
+ path: "textSelection/background",
12965
+ reference: textSelection.background
12966
+ },
12967
+ ...textSelection.foreground === "inherit" ? [] : [{
12968
+ path: "textSelection/foreground",
12969
+ reference: textSelection.foreground
12970
+ }]
12971
+ ];
12972
+ for (const { path, reference } of roleColors) if (!available.has(reference.family)) diagnostics.push({
12931
12973
  severity: "error",
12932
12974
  code: "config.semantic-family-missing",
12933
12975
  stage: "config",
12934
- path: "/semantic/roles/structure/separator/color/family",
12935
- requested: separator.family,
12936
- message: "The structural separator references an undeclared palette family."
12976
+ path: `/semantic/roles/${path}/family`,
12977
+ requested: reference.family,
12978
+ message: `Semantic role ${path} references an undeclared palette family.`
12937
12979
  });
12938
12980
  const layers = [
12939
12981
  ["actions/hover", semantic.interactions.actions.hover],
@@ -14885,6 +14927,16 @@ var generateSemanticRoles = (appearance, families, config, surfaces, familyAppea
14885
14927
  output
14886
14928
  };
14887
14929
  }
14930
+ const textSelectionConfig = config.roles.textSelection;
14931
+ const selectionBackground = semanticColor(families, textSelectionConfig.background.family, textSelectionConfig.background.color, surfaces, textSelectionConfig.opacity);
14932
+ const selectionForeground = textSelectionConfig.foreground === "inherit" ? "inherit" : semanticColor(families, textSelectionConfig.foreground.family, textSelectionConfig.foreground.color, surfaces);
14933
+ if (selectionBackground === void 0 || selectionForeground === void 0) diagnostics.push({
14934
+ severity: "error",
14935
+ code: "semantic.reference-unresolved",
14936
+ stage: "semantic",
14937
+ path: "/semantic/roles/textSelection",
14938
+ message: "Text selection could not resolve every configured color reference."
14939
+ });
14888
14940
  const interactionDiagnosticStart = diagnostics.length;
14889
14941
  const interactions = interactionOutput(config.interactions, families, surfaces, familyAppearances, diagnostics);
14890
14942
  if (interactions === void 0 && !diagnostics.slice(interactionDiagnosticStart).some(({ severity }) => severity === "error")) diagnostics.push({
@@ -14900,6 +14952,10 @@ var generateSemanticRoles = (appearance, families, config, surfaces, familyAppea
14900
14952
  } : {
14901
14953
  ok: true,
14902
14954
  value: {
14955
+ textSelection: {
14956
+ background: selectionBackground,
14957
+ foreground: selectionForeground
14958
+ },
14903
14959
  structure,
14904
14960
  intents,
14905
14961
  interactions,
@@ -15038,6 +15094,8 @@ var validateGeneratedColorTheme = (theme) => {
15038
15094
  }))))) diagnostics.push(error("validation.soft-ink-contrast", `${appearancePath}/semantic/intents/${intent}/soft/${field}`, "Soft ink must meet minimum contrast on every rest, hover and pressed surface.", appearance, intentOutput.family));
15039
15095
  }
15040
15096
  if (!Number.isFinite(generated.semantic.structure.separatorMutedOpacity)) diagnostics.push(error("validation.semantic-output-missing", `${appearancePath}/semantic/structure`, "Semantic structure is incomplete.", appearance));
15097
+ const textSelection = generated.semantic.textSelection;
15098
+ if (!validOklch(textSelection.background.color) || textSelection.foreground !== "inherit" && !validOklch(textSelection.foreground.color)) diagnostics.push(error("validation.color-domain", `${appearancePath}/semantic/textSelection`, "Text selection contains an invalid color channel.", appearance));
15041
15099
  for (const [name, treatment] of Object.entries(generated.semantic.interactions.selection.treatments)) {
15042
15100
  const policy = resolvedFamily(theme, treatment.family, appearance)?.policies.pairing;
15043
15101
  if (!(policy !== void 0 && Object.values(generated.surfaces.substrates).every((substrate) => substrate.levels.every((surface) => [treatment.background, treatment.backgroundHover].every((layer) => {
@@ -16284,7 +16342,11 @@ var appearanceRegistry = (document, scope) => {
16284
16342
  for (let level = 0; level <= 8; level += 1) variables.push(`--shadow-elevation-${level}`);
16285
16343
  variables.push("--color-interaction-disabled-ink");
16286
16344
  }
16287
- return registry([...new Set(variables)]);
16345
+ const unique = [...new Set(variables)];
16346
+ const colors = unique.filter((name) => name.startsWith("--color-"));
16347
+ const shadows = unique.filter((name) => name.startsWith("--shadow-"));
16348
+ const shadowRegistry = shadows.length === 0 ? "" : `@theme reference {\n${shadows.map((name) => ` ${name}: var(${name});`).join("\n")}\n}`;
16349
+ return [registry(colors), shadowRegistry].filter(Boolean).join("\n\n");
16288
16350
  };
16289
16351
  var invariantTokenDeclarations = (document) => tokenDeclarations(document, "invariant", ["invariant"]);
16290
16352
  var invariantRegistry = (document) => {
@@ -16531,6 +16593,7 @@ var TRELLIS_DEFAULT_THEME_CONFIG = {
16531
16593
  sizing: BASELINE_SIZING,
16532
16594
  semantic: {
16533
16595
  roles: {
16596
+ textSelection: BASELINE_SEMANTIC.roles.textSelection,
16534
16597
  strategy: "functional-role-graph",
16535
16598
  version: 1,
16536
16599
  structure: { separator: {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 1,
3
3
  "schemaVersion": 1,
4
- "catalogFingerprint": "db4b2840ff19cd0b",
4
+ "catalogFingerprint": "9ef60c7d772b280e",
5
5
  "group": {
6
6
  "id": "color-alpha",
7
7
  "axis": "color",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 1,
3
3
  "schemaVersion": 1,
4
- "catalogFingerprint": "db4b2840ff19cd0b",
4
+ "catalogFingerprint": "9ef60c7d772b280e",
5
5
  "group": {
6
6
  "id": "color-foundations",
7
7
  "axis": "color",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 1,
3
3
  "schemaVersion": 1,
4
- "catalogFingerprint": "db4b2840ff19cd0b",
4
+ "catalogFingerprint": "9ef60c7d772b280e",
5
5
  "group": {
6
6
  "id": "color-ink",
7
7
  "axis": "color",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 1,
3
3
  "schemaVersion": 1,
4
- "catalogFingerprint": "db4b2840ff19cd0b",
4
+ "catalogFingerprint": "9ef60c7d772b280e",
5
5
  "group": {
6
6
  "id": "color-lighting",
7
7
  "axis": "color",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 1,
3
3
  "schemaVersion": 1,
4
- "catalogFingerprint": "db4b2840ff19cd0b",
4
+ "catalogFingerprint": "9ef60c7d772b280e",
5
5
  "group": {
6
6
  "id": "color-normalization",
7
7
  "axis": "color",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 1,
3
3
  "schemaVersion": 1,
4
- "catalogFingerprint": "db4b2840ff19cd0b",
4
+ "catalogFingerprint": "9ef60c7d772b280e",
5
5
  "group": {
6
6
  "id": "color-ramps",
7
7
  "axis": "color",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 1,
3
3
  "schemaVersion": 1,
4
- "catalogFingerprint": "db4b2840ff19cd0b",
4
+ "catalogFingerprint": "9ef60c7d772b280e",
5
5
  "group": {
6
6
  "id": "composition",
7
7
  "axis": "composition",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 1,
3
3
  "schemaVersion": 1,
4
- "catalogFingerprint": "db4b2840ff19cd0b",
4
+ "catalogFingerprint": "9ef60c7d772b280e",
5
5
  "group": {
6
6
  "id": "depth",
7
7
  "axis": "depth",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 1,
3
3
  "schemaVersion": 1,
4
- "catalogFingerprint": "db4b2840ff19cd0b",
4
+ "catalogFingerprint": "9ef60c7d772b280e",
5
5
  "group": {
6
6
  "id": "edges",
7
7
  "axis": "edge",