{"version":3,"names":["createRenderEffect","createSignal","untrack","readOption","SNAPSHOT_KEYS","snapshotKeys","resetLayoutStyles","useAnimationsFinished","useTransitionStatus","createMountTransition","open","options","enterMeasureReady","setEnterMeasureReady","ownedWrite","name","isOpen","wasOpen","mounted","transitionStatus","setMounted","ownedPanelElement","setOwnedPanelElement","panelElement","panelRef","_el","el","height","setHeight","undefined","width","setWidth","runOnceOpenAnimationsFinish","runOnceCloseAnimationsFinish","measure","scrollHeight","scrollWidth","measureForOpen","restoreLayout","nextHeight","nextWidth","offsetHeight","isMounted","status","cancelled","outerId","innerId","queueMicrotask","requestAnimationFrame","cancelAnimationFrame","abortController","AbortController","signal","abort","enabled","hiddenUntilFound","handler","event","onBeforematch","addEventListener","removeEventListener","keepMounted","shouldRender","hidden","prefix","cssVarPrefix","heightVar","widthVar","dimensionStyle","h","w","mergePanelProps","userProps","base","Object","defineProperties","assign","ref","get","enumerable","configurable","style","api","MOUNT_TRANSITION_SNAPSHOT_KEYS"],"sources":["use-mount-transition.ts"],"sourcesContent":["import type { JSX } from \"@solidjs/web\";\nimport {\n\ttype Accessor,\n\tcreateRenderEffect,\n\tcreateSignal,\n\tuntrack,\n} from \"solid-js\";\nimport { type MaybeAccessor, readOption } from \"../maybe-accessor\";\nimport {\n\tSNAPSHOT_KEYS,\n\ttype Snapshottable,\n\tsnapshotKeys,\n} from \"../observability/snapshot\";\nimport { resetLayoutStyles } from \"../reset-layout-styles\";\nimport { useAnimationsFinished } from \"../use-animations-finished\";\nimport {\n\ttype TransitionStatus,\n\tuseTransitionStatus,\n} from \"../use-transition-status/use-transition-status\";\n\n/** Props that `mergePanelProps` injects onto the panel element. */\nexport interface MountPanelProps {\n\tref: (el: HTMLElement | null) => void;\n\thidden: true | \"until-found\" | undefined;\n\tstyle: JSX.CSSProperties;\n}\n\n/**\n * Options for {@link createMountTransition}.\n */\nexport interface MountTransitionOptions {\n\t/**\n\t * When provided the helper reads but does not own the panel element signal;\n\t * `panelRef` becomes a no-op. When absent the helper creates its own internal\n\t * element signal and `panelRef` must be attached to the panel DOM element.\n\t */\n\tpanelElement?: Accessor<HTMLElement | null>;\n\t/**\n\t * Keep the panel element in the DOM even when closed.\n\t *\n\t * **What this does NOT control: exit animations.** Exit animations are\n\t * honored automatically regardless of `keepMounted`. The state machine\n\t * always waits for CSS animations/transitions on the panel element to\n\t * settle before flipping `mounted` → `false`. The two values differ\n\t * only in **what happens after the exit animation finishes**:\n\t *\n\t * - `keepMounted: false` (default): panel unmounts via `<Show when={shouldRender()}>`.\n\t *   `mounted` flips to `false`, `shouldRender` flips to `false`,\n\t *   the element leaves the DOM. Re-mounts on next open.\n\t * - `keepMounted: true`: panel stays in the DOM with `hidden={true}`.\n\t *   `mounted` flips to `false` but `shouldRender` stays `true`.\n\t *   The element is hidden via the `hidden` attribute instead of\n\t *   removed.\n\t *\n\t * Either way, the consumer's CSS exit transition (keyed off `data-state` /\n\t * `data-ending-style` / measured CSS vars) plays to completion first.\n\t * @default false\n\t */\n\tkeepMounted?: MaybeAccessor<boolean>;\n\t/**\n\t * Use `hidden=\"until-found\"` so the browser's built-in find-in-page can\n\t * reveal the panel. Overrides `keepMounted` (forces it true) — the\n\t * element must remain in the DOM for the browser's find-in-page to\n\t * locate matched content.\n\t * @default false\n\t */\n\thiddenUntilFound?: MaybeAccessor<boolean>;\n\t/**\n\t * Called when the `beforematch` event fires on the panel element\n\t * (only relevant when `hiddenUntilFound` is true). The caller is\n\t * responsible for setting open=true in this callback.\n\t */\n\tonBeforematch?: (event: Event) => void;\n\t/**\n\t * Prefix for the dimension CSS custom properties emitted in\n\t * `mergePanelProps().style`. Resolves to `--{prefix}-height` and\n\t * `--{prefix}-width`. Defaults to `\"collapsible-panel\"` for\n\t * backwards-compatibility with the existing Collapsible CSS contract;\n\t * new compounds (Tooltip, Dialog, Popover, Menu) should pass their\n\t * own (e.g. `\"tooltip-popup\"`) so consumer CSS stays\n\t * namespace-clean. The leading `--` is added by the helper.\n\t *\n\t * @default \"collapsible-panel\"\n\t */\n\tcssVarPrefix?: string;\n}\n\n/**\n * Return value of {@link createMountTransition}.\n */\nexport interface MountTransition {\n\t/** True while the panel is mounted (during enter and while open, + exit animation). */\n\tmounted: Accessor<boolean>;\n\t/**\n\t * True when the panel element should be in the DOM.\n\t * `mounted || keepMounted || hiddenUntilFound`\n\t */\n\tshouldRender: Accessor<boolean>;\n\t/** Enter/exit animation phase. */\n\ttransitionStatus: Accessor<TransitionStatus>;\n\t/** Measured height (undefined = auto / settled). */\n\theight: Accessor<number | undefined>;\n\t/** Measured width (undefined = auto / settled). */\n\twidth: Accessor<number | undefined>;\n\t/**\n\t * The `hidden` attribute value to apply to the panel element:\n\t * - `true` → hidden (panel is closed and fully unmounted or keepMounted)\n\t * - `\"until-found\"` → hiddenUntilFound mode\n\t * - `undefined` → no hidden attribute (panel is open)\n\t */\n\thidden: Accessor<true | \"until-found\" | undefined>;\n\t/**\n\t * Ref callback to bind to the panel element. No-op when `panelElement` was\n\t * passed in via options (caller owns the ref).\n\t */\n\tpanelRef: (el: HTMLElement | null) => void;\n\t/**\n\t * Merges mount-lifecycle props (ref, hidden, CSS vars) into a user prop bag.\n\t * Designed for easy composition inside a wrapper component's JSX spread.\n\t *\n\t * Returns a shallow-merged object whose getters stay reactive, so Solid's\n\t * compiled spread sees live values on each flush.\n\t *\n\t * @example\n\t * ```tsx\n\t * <div {...m.mergePanelProps(props)} />\n\t * ```\n\t */\n\tmergePanelProps: <P extends object>(userProps?: P) => P & MountPanelProps;\n}\n\n/**\n * Reusable animation-lifecycle primitive for any animated compound surface\n * (Collapsible, Dialog, Popover, Tooltip, etc.).\n *\n * Extracts:\n * - `useTransitionStatus` state machine (mounted / transitionStatus)\n * - Panel measurement (scrollHeight / scrollWidth → CSS vars)\n * - Exit-animation wait via `useAnimationsFinished`\n * - `beforematch` listener for `hiddenUntilFound`\n *\n * The caller owns the `open` signal; this helper wraps the rest.\n *\n * ### Design deviation from recommended signature\n *\n * The recommended interface included `setMounted` as an escape hatch. This\n * implementation omits it from the public surface — `setMounted` is an\n * internal implementation detail of the exit-animation path and should not be\n * called directly by callers. If callers need it, they should re-implement the\n * exit-animation logic. This keeps the surface smaller.\n *\n * `mergePanelProps` replaces the proposed `mergePanelProps<P>` function — same\n * idea, slightly renamed for clarity. The returned object uses getters so\n * Solid's compiled spread stays reactive after the merge.\n *\n * ### Solid 2 notes\n *\n * - `panelElement` signal uses `ownedWrite: true` so the ref callback (unowned\n *   scope) can write — same pattern as `renderElement`'s host-capture signal.\n * - Dimension signals use `ownedWrite: true` for the same reason (writes from\n *   animation-finished callbacks).\n * - Effects are `createRenderEffect` so dimension writes are synchronous with\n *   DOM updates (no paint flash).\n */\nexport function createMountTransition(\n\topen: Accessor<boolean>,\n\toptions: MountTransitionOptions = {},\n): MountTransition {\n\t// Enter settle must not drop `data-starting-style` until measured height is\n\t// committed — otherwise `--*-height` stays `0px`/`auto` and open is instant.\n\tconst [enterMeasureReady, setEnterMeasureReady] = createSignal(false, {\n\t\townedWrite: true,\n\t\tname: \"mount-transition.enterMeasureReady\",\n\t});\n\n\tcreateRenderEffect(\n\t\t() => open(),\n\t\t(isOpen, wasOpen) => {\n\t\t\t// Only reset on false → true. Resetting on every `open === true`\n\t\t\t// re-apply would clear `enterMeasureReady` right after measure commits.\n\t\t\tif (isOpen && wasOpen !== true) {\n\t\t\t\tsetEnterMeasureReady(false);\n\t\t\t}\n\t\t},\n\t);\n\n\t// ── Transition state machine ──────────────────────────────────────────────\n\t// idle-state enabled (stays at \"idle\" while open) + deferred ending (fires\n\t// on next frame after close). Matches the Collapsible root's call signature.\n\tconst { mounted, transitionStatus, setMounted } = useTransitionStatus(\n\t\topen,\n\t\t() => true,\n\t\t() => true,\n\t\tenterMeasureReady,\n\t);\n\n\t// ── Panel element reference ───────────────────────────────────────────────\n\t// If the caller passes in a pre-owned accessor we read from it; otherwise\n\t// we create our own signal.\n\tconst [ownedPanelElement, setOwnedPanelElement] =\n\t\tcreateSignal<HTMLElement | null>(null, {\n\t\t\townedWrite: true,\n\t\t\tname: \"mount-transition.panelElement\",\n\t\t});\n\n\tconst panelElement: Accessor<HTMLElement | null> =\n\t\toptions.panelElement ?? ownedPanelElement;\n\n\tconst panelRef = options.panelElement\n\t\t? (_el: HTMLElement | null): void => {}\n\t\t: (el: HTMLElement | null): void => {\n\t\t\t\tsetOwnedPanelElement(el);\n\t\t\t};\n\n\t// ── Dimensions ───────────────────────────────────────────────────────────\n\tconst [height, setHeight] = createSignal<number | undefined>(undefined, {\n\t\townedWrite: true,\n\t\tname: \"mount-transition.height\",\n\t});\n\tconst [width, setWidth] = createSignal<number | undefined>(undefined, {\n\t\townedWrite: true,\n\t\tname: \"mount-transition.width\",\n\t});\n\n\t// Open settle mirrors React `useOpenChangeComplete({ open: true })`:\n\t// wait for `[data-starting-style]` removal before probing animations.\n\t// Close uses `false` for `waitForStartingStyleRemoved` and\n\t// `treatAbortedAsFinished: false` — matches `useCollapsiblePanel`.\n\tconst runOnceOpenAnimationsFinish = useAnimationsFinished(panelElement, true);\n\tconst runOnceCloseAnimationsFinish = useAnimationsFinished(\n\t\tpanelElement,\n\t\tfalse,\n\t\tfalse,\n\t);\n\n\tfunction measure(el: HTMLElement): void {\n\t\tsetHeight(el.scrollHeight);\n\t\tsetWidth(el.scrollWidth);\n\t}\n\n\t/**\n\t * Measure expanded size for the enter animation. Returns `true` when a\n\t * non-zero size was committed (or dimensions were already settled).\n\t * Mirrors React `useCollapsiblePanel` open pass: `resetLayoutStyles` then\n\t * `getDimensions`.\n\t */\n\tfunction measureForOpen(el: HTMLElement): boolean {\n\t\t// Drop stale `0` from the previous close cycle so the first open frame\n\t\t// does not lock `--*-height` to `0px` before we read scroll sizes.\n\t\tif (untrack(height) === 0) {\n\t\t\tsetHeight(undefined);\n\t\t\tsetWidth(undefined);\n\t\t}\n\n\t\tconst restoreLayout = resetLayoutStyles(el);\n\t\tconst nextHeight = el.scrollHeight;\n\t\tconst nextWidth = el.scrollWidth;\n\t\trestoreLayout();\n\n\t\tif (nextHeight === 0 && nextWidth === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tsetHeight(nextHeight);\n\t\tsetWidth(nextWidth);\n\t\t// Commit the starting frame (height: 0 via `data-starting-style`)\n\t\t// before `useTransitionStatus` advances to idle on the next rAF(s).\n\t\tvoid el.offsetHeight;\n\t\tsetEnterMeasureReady(true);\n\t\treturn true;\n\t}\n\n\t// Enter: measure natural size during `\"starting\"` so the CSS var transitions\n\t// from 0 → natural height. Mirrors React `useCollapsiblePanel` which only\n\t// measures while `transitionStatus === 'starting'`. Measuring on every\n\t// `open+mounted` tick would fight the post-animation clear to `auto`.\n\t//\n\t// Solid mounts conditional panel DOM in the same commit as `starting`; the\n\t// first synchronous read often sees `scrollHeight === 0` because the ref\n\t// fires before the subtree is connected (especially under `<Show>`). By the\n\t// end of the flush the element IS connected, so a microtask retry lands in\n\t// the SAME frame as the click — matching React's layout-effect timing. This\n\t// keeps simultaneous enter/exit transitions in lockstep (accordion item\n\t// switch: total height stays constant). rAF retries remain as fallback for\n\t// layouts that genuinely need a frame.\n\tcreateRenderEffect(\n\t\t() => ({\n\t\t\tisOpen: open(),\n\t\t\tisMounted: mounted(),\n\t\t\tstatus: transitionStatus(),\n\t\t\tel: panelElement(),\n\t\t}),\n\t\t({ isOpen, isMounted, status, el }) => {\n\t\t\tif (!el || !isOpen || !isMounted || status !== \"starting\") {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif (measureForOpen(el)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tlet cancelled = false;\n\t\t\tlet outerId = 0;\n\t\t\tlet innerId = 0;\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tif (cancelled || measureForOpen(el)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\touterId = requestAnimationFrame(() => {\n\t\t\t\t\tif (measureForOpen(el)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tinnerId = requestAnimationFrame(() => {\n\t\t\t\t\t\tif (!measureForOpen(el)) {\n\t\t\t\t\t\t\t// Empty panel or layout never reported a size — still\n\t\t\t\t\t\t\t// advance so we do not stick in `starting` forever.\n\t\t\t\t\t\t\tsetEnterMeasureReady(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn () => {\n\t\t\t\tcancelled = true;\n\t\t\t\tif (outerId !== 0) cancelAnimationFrame(outerId);\n\t\t\t\tif (innerId !== 0) cancelAnimationFrame(innerId);\n\t\t\t};\n\t\t},\n\t);\n\n\t// Exit: capture current size as starting frame, wait for anim, then collapse.\n\t// When no panel element is registered, runOnceAnimationsFinish returns early\n\t// (null-element check in useAnimationsFinished) without calling the callback.\n\t// In that case setMounted(false) never fires and the panel stays \"mounted\"\n\t// indefinitely — which is acceptable because there's nothing to animate or\n\t// hide. Callers that need unmount without a panel element should pass an open\n\t// signal that never reaches false while the panel is absent.\n\tcreateRenderEffect(\n\t\t() => ({ isOpen: open(), el: panelElement() }),\n\t\t({ isOpen, el }) => {\n\t\t\tif (!el) return;\n\t\t\tif (!isOpen && untrack(mounted)) {\n\t\t\t\tmeasure(el);\n\t\t\t\trunOnceCloseAnimationsFinish(() => {\n\t\t\t\t\tsetHeight(0);\n\t\t\t\t\tsetWidth(0);\n\t\t\t\t\tsetMounted(false);\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t);\n\n\t// Once open and enter animations settle, clear dimensions so the panel\n\t// reverts to auto sizing (resize-aware). Mirrors React\n\t// `useOpenChangeComplete({ enabled: open && mounted && status === 'idle' })`.\n\t// Clearing while still in `\"starting\"` drops the measured CSS var before the\n\t// browser paints the 0 → natural-height transition.\n\tcreateRenderEffect(\n\t\t() => ({\n\t\t\tisOpen: open(),\n\t\t\tisMounted: mounted(),\n\t\t\tstatus: transitionStatus(),\n\t\t}),\n\t\t({ isOpen, isMounted, status }) => {\n\t\t\tif (!isOpen || !isMounted || status !== \"idle\") {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst el = untrack(panelElement);\n\t\t\tif (!el) return undefined;\n\t\t\tconst abortController = new AbortController();\n\t\t\trunOnceOpenAnimationsFinish(() => {\n\t\t\t\tif (!open()) return;\n\t\t\t\tsetHeight(undefined);\n\t\t\t\tsetWidth(undefined);\n\t\t\t}, abortController.signal);\n\t\t\treturn () => {\n\t\t\t\tabortController.abort();\n\t\t\t};\n\t\t},\n\t);\n\n\t// ── beforematch listener ──────────────────────────────────────────────────\n\tcreateRenderEffect(\n\t\t() => ({\n\t\t\tel: panelElement(),\n\t\t\tenabled: readOption(options.hiddenUntilFound ?? false),\n\t\t}),\n\t\t({ el, enabled }) => {\n\t\t\tif (!el || !enabled) return undefined;\n\t\t\tconst handler = (event: Event): void => {\n\t\t\t\toptions.onBeforematch?.(event);\n\t\t\t};\n\t\t\tel.addEventListener(\"beforematch\", handler);\n\t\t\treturn () => {\n\t\t\t\tel.removeEventListener(\"beforematch\", handler);\n\t\t\t};\n\t\t},\n\t);\n\n\t// ── Derived accessors ─────────────────────────────────────────────────────\n\tconst keepMounted = (): boolean => readOption(options.keepMounted ?? false);\n\tconst hiddenUntilFound = (): boolean =>\n\t\treadOption(options.hiddenUntilFound ?? false);\n\n\tconst shouldRender = (): boolean =>\n\t\tmounted() || keepMounted() || hiddenUntilFound();\n\n\t/**\n\t * `hidden` semantics:\n\t * - Open panel → `undefined` (no attribute)\n\t * - hiddenUntilFound + closed → `\"until-found\"` (special browser value)\n\t * - keepMounted + closed (after anim) → `true`\n\t * - Unmounted (`!shouldRender`) → irrelevant; element isn't in the DOM\n\t */\n\tconst hidden = (): true | \"until-found\" | undefined => {\n\t\tif (open()) return undefined;\n\t\tif (!mounted()) {\n\t\t\t// Fully settled closed state\n\t\t\tif (hiddenUntilFound()) return \"until-found\";\n\t\t\tif (keepMounted()) return true;\n\t\t\t// Element should not render at all; this value won't be used.\n\t\t\treturn true;\n\t\t}\n\t\t// Still mounted (exit animation in progress)\n\t\treturn undefined;\n\t};\n\n\t// ── CSS var style bag ────────────────────────────────────────────────────\n\tconst prefix = options.cssVarPrefix ?? \"collapsible-panel\";\n\tconst heightVar = `--${prefix}-height`;\n\tconst widthVar = `--${prefix}-width`;\n\n\tfunction dimensionStyle(): JSX.CSSProperties {\n\t\tconst h = height();\n\t\tconst w = width();\n\t\treturn {\n\t\t\t[heightVar]: h === undefined ? \"auto\" : `${h}px`,\n\t\t\t[widthVar]: w === undefined ? \"auto\" : `${w}px`,\n\t\t};\n\t}\n\n\tfunction mergePanelProps<P extends object>(\n\t\tuserProps?: P,\n\t): P & MountPanelProps {\n\t\tconst base = (userProps ?? {}) as P;\n\t\treturn Object.defineProperties(Object.assign({}, base), {\n\t\t\tref: { get: () => panelRef, enumerable: true, configurable: true },\n\t\t\thidden: { get: hidden, enumerable: true, configurable: true },\n\t\t\tstyle: { get: dimensionStyle, enumerable: true, configurable: true },\n\t\t}) as P & MountPanelProps;\n\t}\n\n\tconst api: MountTransition = {\n\t\tmounted,\n\t\tshouldRender,\n\t\ttransitionStatus,\n\t\theight,\n\t\twidth,\n\t\thidden,\n\t\tpanelRef,\n\t\tmergePanelProps,\n\t};\n\t(api as MountTransition & Snapshottable)[SNAPSHOT_KEYS] =\n\t\tMOUNT_TRANSITION_SNAPSHOT_KEYS;\n\treturn api;\n}\n\nconst MOUNT_TRANSITION_SNAPSHOT_KEYS = snapshotKeys<MountTransition>(\n\t\"mounted\",\n\t\"shouldRender\",\n\t\"transitionStatus\",\n\t\"height\",\n\t\"width\",\n\t\"hidden\",\n);\n"],"mappings":"AACA,SAECA,kBAAkB,EAClBC,YAAY,EACZC,OAAO,QACD,UAAU;AACjB,SAA6BC,UAAU,QAAQ,mBAAmB;AAClE,SACCC,aAAa,EAEbC,YAAY,QACN,2BAA2B;AAClC,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,qBAAqB,QAAQ,4BAA4B;AAClE,SAECC,mBAAmB,QACb,gDAAgD;;AAEvD;;AAOA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