@mhmo91/schmancy 0.10.16 → 0.10.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.
- package/dist/active-host-BP0zy_Y9.js.map +1 -1
- package/dist/agent/flow-CvG1fLW5.js.map +1 -1
- package/dist/agent/schmancy.agent.js +3704 -3704
- package/dist/agent/schmancy.agent.js.map +1 -1
- package/dist/agent/vendor-material-color-DcL7ZPxx.js.map +1 -1
- package/dist/animation-DCznELuT.js.map +1 -1
- package/dist/area-ChxsDTu_.js.map +1 -1
- package/dist/area-Qt6yUnuA.cjs.map +1 -1
- package/dist/audio-DS43uoRA.js.map +1 -1
- package/dist/autocomplete-CXvUjMD-.js.map +1 -1
- package/dist/autocomplete-Ck2zbdF9.cjs.map +1 -1
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +1 -1
- package/dist/avatar.js.map +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/boat-Bj0wVcZi.js.map +1 -1
- package/dist/breadcrumb.js.map +1 -1
- package/dist/busy-CyZSBnZP.js.map +1 -1
- package/dist/button.js.map +1 -1
- package/dist/card-nYZCKmOO.js.map +1 -1
- package/dist/checkbox-DiUrZiyc.js.map +1 -1
- package/dist/chips-CfPFXv7Z.js.map +1 -1
- package/dist/chips-DK6m-VCM.cjs.map +1 -1
- package/dist/connectivity.js.map +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/cursor-glow-Cs2XLDB9.js.map +1 -1
- package/dist/date-range-DA6anfcF.cjs.map +1 -1
- package/dist/date-range-DjlF2u7o.js.map +1 -1
- package/dist/date-range-inline-BfYK795W.cjs.map +1 -1
- package/dist/date-range-inline-n7y_H6PJ.js.map +1 -1
- package/dist/delay.js.map +1 -1
- package/dist/details-BdAVsLl-.cjs.map +1 -1
- package/dist/details-CS_ToAOj.js.map +1 -1
- package/dist/directives.cjs.map +1 -1
- package/dist/directives.js.map +1 -1
- package/dist/discovery.js.map +1 -1
- package/dist/divider-COLK0RbT.js.map +1 -1
- package/dist/dropdown.js.map +1 -1
- package/dist/expand-D9LzmpoV.js.map +1 -1
- package/dist/expand-r2sATPUJ.cjs.map +1 -1
- package/dist/{form-DhjedCWm.js → form-D1iJOLVb.js} +9 -0
- package/dist/{form-DhjedCWm.js.map → form-D1iJOLVb.js.map} +1 -1
- package/dist/form-D9K1GhlP.cjs +42 -0
- package/dist/{form-g5c70rac.cjs.map → form-D9K1GhlP.cjs.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +9 -2
- package/dist/handover/agent-runtime-followups.md +1 -1
- package/dist/handover/agent-runtime-v1.md +3 -3
- package/dist/hashContent-dJrI-9sc.js.map +1 -1
- package/dist/{icons-1HIENBco.cjs.map → icons-BXp4vbnW.cjs.map} +1 -1
- package/dist/{icons-3y0kr1aB.js.map → icons-COrlmBPB.js.map} +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/{iframe-CjqYuZG5.cjs.map → iframe-BwXj6mLp.cjs.map} +1 -1
- package/dist/{iframe-Z5gTK-gd.js.map → iframe-CPNsIy7k.js.map} +1 -1
- package/dist/iframe.cjs +1 -1
- package/dist/iframe.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +32 -32
- package/dist/{input-BtcIhu0Q.cjs.map → input-BGrF2qVq.cjs.map} +1 -1
- package/dist/{input-B-fw6f_r.js.map → input-C1SnMNuQ.js.map} +1 -1
- package/dist/input-chip-CtQ0pH5b.js.map +1 -1
- package/dist/input-chip-DZktYohr.cjs.map +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/json.cjs +1 -1
- package/dist/json.js +1 -1
- package/dist/json.js.map +1 -1
- package/dist/kbd.js.map +1 -1
- package/dist/layout-BH28sKGc.js.map +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +1 -1
- package/dist/lazy-D-bO2r4m.js.map +1 -1
- package/dist/{lightbox-BL3LWp-P.js.map → lightbox-CLwpaiai.js.map} +1 -1
- package/dist/{lightbox-BHTZOn8K.cjs.map → lightbox-Ck6BpN5u.cjs.map} +1 -1
- package/dist/lightbox.cjs +1 -1
- package/dist/lightbox.js +1 -1
- package/dist/{list-DLJL1JQj.js.map → list-Bmce1Rb8.js.map} +1 -1
- package/dist/{list-CHYa5VGY.cjs.map → list-EmRwSpTU.cjs.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/magnetic-DxvoEz8_.js.map +1 -1
- package/dist/{menu-BNq93w6X.js.map → menu-BA_B7QOG.js.map} +1 -1
- package/dist/{menu-DAikvkeV.cjs.map → menu-BTU3wGP6.cjs.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/mixins-BOOu6q2n.cjs.map +1 -1
- package/dist/mixins-BWb9_e1s.js.map +1 -1
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/navigation-bar.cjs +1 -1
- package/dist/navigation-bar.js +1 -1
- package/dist/navigation-rail.js.map +1 -1
- package/dist/{notification-Dy2azMyt.cjs → notification-CliGbcfU.cjs} +1 -1
- package/dist/{notification-Dy2azMyt.cjs.map → notification-CliGbcfU.cjs.map} +1 -1
- package/dist/{notification-CUmb9c3Y.js → notification-R2_Mf1HR.js} +1 -1
- package/dist/{notification-CUmb9c3Y.js.map → notification-R2_Mf1HR.js.map} +1 -1
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-DFvQ551b.js.map → option-DU1X4SDu.js.map} +1 -1
- package/dist/{option-CDgIKifG.cjs.map → option-Db98Ndzv.cjs.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/overlay-stack-BR4iYivO.js.map +1 -1
- package/dist/overlay.cjs.map +1 -1
- package/dist/overlay.confirm-body-uFp-0Zfh.js.map +1 -1
- package/dist/overlay.js.map +1 -1
- package/dist/overlay.service-1YWfUD2S.cjs.map +1 -1
- package/dist/overlay.service-BcF12kGb.js.map +1 -1
- package/dist/page.cjs +1 -1
- package/dist/page.js +1 -1
- package/dist/page.js.map +1 -1
- package/dist/{progress-bLbGRuQ1.js.map → progress-C9Y2D5cm.js.map} +1 -1
- package/dist/{progress-C02sWkmE.cjs.map → progress-DiVTGAXa.cjs.map} +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +1 -1
- package/dist/{radio-group-DA4eIGCj.js.map → radio-group-CAzjBI2n.js.map} +1 -1
- package/dist/{radio-group-BA-jRct5.cjs.map → radio-group-DIRJyYv6.cjs.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/range.js.map +1 -1
- package/dist/reduced-motion-D7LqTUMn.js.map +1 -1
- package/dist/{rxjs-utils-kWPShgKu.cjs.map → rxjs-utils-BKB2UM_j.cjs.map} +1 -1
- package/dist/{rxjs-utils-D9U4MW0Q.js.map → rxjs-utils-Dv9T9IpA.js.map} +1 -1
- package/dist/rxjs-utils.cjs +1 -1
- package/dist/rxjs-utils.js +1 -1
- package/dist/{scroll-CG5up5oy.js.map → scroll-BFHUtZOa.js.map} +1 -1
- package/dist/{scroll-D8vBF_gY.cjs.map → scroll-nIZyoEMt.cjs.map} +1 -1
- package/dist/search-MvIBA93K.js.map +1 -1
- package/dist/{select-BrK1BJoU.js → select-7WqaUWBU.js} +1 -1
- package/dist/{select-BrK1BJoU.js.map → select-7WqaUWBU.js.map} +1 -1
- package/dist/{select-Dh2j7Qc-.cjs → select-DTuf6p6T.cjs} +1 -1
- package/dist/{select-Dh2j7Qc-.cjs.map → select-DTuf6p6T.cjs.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/skeleton.js.map +1 -1
- package/dist/skills/SKILL.md +3 -0
- package/dist/skills/schmancy/SKILL.md +3 -0
- package/dist/slider.js.map +1 -1
- package/dist/sound.service-BIN2W7Rv.js.map +1 -1
- package/dist/splash-screen-BcjjJSlK.js.map +1 -1
- package/dist/{src-B2-CU8fu.cjs → src-BbMJeLk9.cjs} +1 -1
- package/dist/{src-B2-CU8fu.cjs.map → src-BbMJeLk9.cjs.map} +1 -1
- package/dist/{src-DvywUq7l.js → src-DCu_mEk4.js} +18 -18
- package/dist/{src-DvywUq7l.js.map → src-DCu_mEk4.js.map} +1 -1
- package/dist/state-avic94Ft.cjs.map +1 -1
- package/dist/state-nm8yzMPp.js.map +1 -1
- package/dist/steps.js.map +1 -1
- package/dist/surface-BtMMHKol.js.map +1 -1
- package/dist/switch.js.map +1 -1
- package/dist/table.js.map +1 -1
- package/dist/{tabs-CikPr7by.js.map → tabs-81ADWQqa.js.map} +1 -1
- package/dist/{tabs-CitVls3_.cjs.map → tabs-DnG3K0bu.cjs.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{textarea-DVkwQSis.js.map → textarea-3mWewuAf.js.map} +1 -1
- package/dist/{textarea-CqV1wvmB.cjs.map → textarea-BenjiTXB.cjs.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-BIWS4TOW.js → theme-CFPJW933.js} +1 -1
- package/dist/{theme-BIWS4TOW.js.map → theme-CFPJW933.js.map} +1 -1
- package/dist/{theme-DMgjiKda.cjs → theme-DNymrucy.cjs} +1 -1
- package/dist/{theme-DMgjiKda.cjs.map → theme-DNymrucy.cjs.map} +1 -1
- package/dist/theme-button-DC_shZ_7.js.map +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/{theme.interface-C8OHheXg.js.map → theme.interface-C2XNgsLB.js.map} +1 -1
- package/dist/{theme.interface-CYo4UpWK.cjs.map → theme.interface-D4NeufQA.cjs.map} +1 -1
- package/dist/theme.js +2 -2
- package/dist/theme.service-BOWIT_5k.js.map +1 -1
- package/dist/tooltip.js.map +1 -1
- package/dist/tree.js.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/typewriter.cjs.map +1 -1
- package/dist/typewriter.js.map +1 -1
- package/dist/typography.js.map +1 -1
- package/dist/utils-Cj_nRRyx.js.map +1 -1
- package/dist/visually-hidden.js.map +1 -1
- package/dist/window-BTecgE_U.js.map +1 -1
- package/package.json +1 -1
- package/skills/schmancy/SKILL.md +3 -0
- package/src/form/fields/index.ts +9 -0
- package/src/form/index.ts +1 -0
- package/types/src/form/fields/index.d.ts +9 -0
- package/types/src/form/index.d.ts +1 -0
- package/dist/form-g5c70rac.cjs +0 -42
- /package/dist/{icons-1HIENBco.cjs → icons-BXp4vbnW.cjs} +0 -0
- /package/dist/{icons-3y0kr1aB.js → icons-COrlmBPB.js} +0 -0
- /package/dist/{iframe-CjqYuZG5.cjs → iframe-BwXj6mLp.cjs} +0 -0
- /package/dist/{iframe-Z5gTK-gd.js → iframe-CPNsIy7k.js} +0 -0
- /package/dist/{input-BtcIhu0Q.cjs → input-BGrF2qVq.cjs} +0 -0
- /package/dist/{input-B-fw6f_r.js → input-C1SnMNuQ.js} +0 -0
- /package/dist/{lightbox-BL3LWp-P.js → lightbox-CLwpaiai.js} +0 -0
- /package/dist/{lightbox-BHTZOn8K.cjs → lightbox-Ck6BpN5u.cjs} +0 -0
- /package/dist/{list-DLJL1JQj.js → list-Bmce1Rb8.js} +0 -0
- /package/dist/{list-CHYa5VGY.cjs → list-EmRwSpTU.cjs} +0 -0
- /package/dist/{menu-BNq93w6X.js → menu-BA_B7QOG.js} +0 -0
- /package/dist/{menu-DAikvkeV.cjs → menu-BTU3wGP6.cjs} +0 -0
- /package/dist/{option-DFvQ551b.js → option-DU1X4SDu.js} +0 -0
- /package/dist/{option-CDgIKifG.cjs → option-Db98Ndzv.cjs} +0 -0
- /package/dist/{progress-bLbGRuQ1.js → progress-C9Y2D5cm.js} +0 -0
- /package/dist/{progress-C02sWkmE.cjs → progress-DiVTGAXa.cjs} +0 -0
- /package/dist/{radio-group-DA4eIGCj.js → radio-group-CAzjBI2n.js} +0 -0
- /package/dist/{radio-group-BA-jRct5.cjs → radio-group-DIRJyYv6.cjs} +0 -0
- /package/dist/{rxjs-utils-kWPShgKu.cjs → rxjs-utils-BKB2UM_j.cjs} +0 -0
- /package/dist/{rxjs-utils-D9U4MW0Q.js → rxjs-utils-Dv9T9IpA.js} +0 -0
- /package/dist/{scroll-CG5up5oy.js → scroll-BFHUtZOa.js} +0 -0
- /package/dist/{scroll-D8vBF_gY.cjs → scroll-nIZyoEMt.cjs} +0 -0
- /package/dist/{tabs-CikPr7by.js → tabs-81ADWQqa.js} +0 -0
- /package/dist/{tabs-CitVls3_.cjs → tabs-DnG3K0bu.cjs} +0 -0
- /package/dist/{textarea-DVkwQSis.js → textarea-3mWewuAf.js} +0 -0
- /package/dist/{textarea-CqV1wvmB.cjs → textarea-BenjiTXB.cjs} +0 -0
- /package/dist/{theme.interface-C8OHheXg.js → theme.interface-C2XNgsLB.js} +0 -0
- /package/dist/{theme.interface-CYo4UpWK.cjs → theme.interface-D4NeufQA.cjs} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overlay.service-BcF12kGb.js","names":[],"sources":["../src/overlay/overlay.stack.ts","../src/overlay/overlay.service.ts"],"sourcesContent":["import { BehaviorSubject, distinctUntilChanged, map, Observable } from 'rxjs'\nimport type { OverlayEntry } from './overlay.types'\n\n/**\n * Overlay stack — single source of truth for \"what is currently open.\"\n *\n * A module-scope BehaviorSubject matching the `schmancy` skill's\n * \"contexts at module scope; many small contexts beat one monolith\"\n * guidance. Reactive pipelines inside the overlay service and public\n * `openOverlays$` observable project off this.\n *\n * Scroll lock and the stack-aware inert manager are both derived from\n * the stack state — no separate mutable counter variables. Honors rxjs\n * SUBSCRIPTION_IS_STATE: the stack IS the state; scroll lock / inert\n * are declarative projections.\n */\n\nconst stack$$ = new BehaviorSubject<readonly OverlayEntry[]>([])\n\n/** Public read-only stream of the current stack. Emits on every push/pop. */\nexport const stack$: Observable<readonly OverlayEntry[]> = stack$$.asObservable()\n\n/** Synchronous snapshot. Use only when a component can't subscribe. */\nexport function currentStack(): readonly OverlayEntry[] {\n\treturn stack$$.value\n}\n\n/** Append an entry (top of stack). */\nexport function pushEntry(entry: OverlayEntry): void {\n\tstack$$.next([...stack$$.value, entry])\n}\n\n/** Remove by id. No-op if the id is not in the stack. */\nexport function removeEntry(id: string): void {\n\tconst current = stack$$.value\n\tconst next = current.filter((e) => e.id !== id)\n\tif (next.length !== current.length) {\n\t\tstack$$.next(next)\n\t}\n}\n\n/** Clear the entire stack. Used by dismissAll(). */\nexport function clearStack(): void {\n\tif (stack$$.value.length > 0) {\n\t\tstack$$.next([])\n\t}\n}\n\n/* ---------------- scroll lock -------------------------------------------- */\n\n/**\n * Ref-counted body scroll lock. Active whenever ANY modal-tier overlay is\n * in the stack. Popover-tier (Tier 1/2) overlays do NOT lock body scroll —\n * a menu / share card / picker shouldn't freeze the page scroll behind it\n * (that's platform UX convention).\n *\n * Subscription is idempotent — subscribing multiple times won't stack\n * effects, because it's a distinctUntilChanged boolean projection.\n *\n * Inner overlay close does NOT release the lock while an outer modal is\n * still open (this was the pre-existing bug in sheet.service.ts).\n */\nlet scrollLockActive = false\nlet previousOverflow = ''\nlet previousScrollbarGutter = ''\n\nstack$$\n\t.pipe(\n\t\tmap((s) => s.some((e) => e.modal)),\n\t\tdistinctUntilChanged(),\n\t)\n\t.subscribe((shouldLock) => {\n\t\tif (typeof document === 'undefined') return\n\n\t\tif (shouldLock && !scrollLockActive) {\n\t\t\tpreviousOverflow = document.documentElement.style.overflow\n\t\t\tpreviousScrollbarGutter = document.documentElement.style.getPropertyValue('scrollbar-gutter')\n\t\t\tdocument.documentElement.style.overflow = 'hidden'\n\t\t\tdocument.documentElement.style.setProperty('scrollbar-gutter', 'stable')\n\t\t\tscrollLockActive = true\n\t\t} else if (!shouldLock && scrollLockActive) {\n\t\t\tdocument.documentElement.style.overflow = previousOverflow\n\t\t\tif (previousScrollbarGutter) {\n\t\t\t\tdocument.documentElement.style.setProperty('scrollbar-gutter', previousScrollbarGutter)\n\t\t\t} else {\n\t\t\t\tdocument.documentElement.style.removeProperty('scrollbar-gutter')\n\t\t\t}\n\t\t\tpreviousOverflow = ''\n\t\t\tpreviousScrollbarGutter = ''\n\t\t\tscrollLockActive = false\n\t\t}\n\t})\n\n/* ---------------- stack-aware inert -------------------------------------- */\n\n/**\n * When the first modal overlay opens, mark every sibling outside the\n * overlay host subtree as `inert` so AT and keyboard focus can't reach\n * them. Restored when the last modal overlay closes.\n *\n * Note: native `<dialog>.showModal()` already inerts the rest of the\n * document automatically. We keep this as a safety net for:\n * - anchored (popover) overlays which are non-modal by design but may\n * carry `modal: true` as the escape hatch;\n * - stacked overlays where an inner modal opens above a non-modal —\n * the sibling-inert is a no-op but we still guarantee the invariant.\n *\n * Callers that don't want inert (anchored/menu overlays) skip registration\n * via `markNonModal(id)`.\n */\nconst modalIds = new Set<string>()\nconst inertedSiblings = new Set<HTMLElement>()\n\nexport function markModal(id: string, hostContainer: HTMLElement): void {\n\tmodalIds.add(id)\n\tif (modalIds.size === 1) {\n\t\tapplyInert(hostContainer)\n\t}\n}\n\nexport function unmarkModal(id: string): void {\n\tmodalIds.delete(id)\n\tif (modalIds.size === 0) {\n\t\treleaseInert()\n\t}\n}\n\nfunction applyInert(hostContainer: HTMLElement): void {\n\tconst parent = hostContainer.parentElement ?? document.body\n\tfor (let i = 0; i < parent.children.length; i++) {\n\t\tconst child = parent.children[i]\n\t\tif (child !== hostContainer && child instanceof HTMLElement && !child.inert) {\n\t\t\tchild.inert = true\n\t\t\tinertedSiblings.add(child)\n\t\t}\n\t}\n}\n\nfunction releaseInert(): void {\n\tfor (const el of inertedSiblings) {\n\t\tel.inert = false\n\t}\n\tinertedSiblings.clear()\n}\n\n/* ---------------- overlayEvents multicast helper ------------------------- */\n\n/**\n * Returns an Observable of `tagName` elements currently in the stack.\n * The overlayEvents public helper composes `fromEvent` over this stream\n * via switchMap to tap events without owning the overlay lifecycle.\n *\n * Stays alive across open/close cycles — the caller owns completion via\n * `takeUntil(this.disconnecting)`, matching the house rxjs convention.\n */\nexport function elementsByTag$(tagName: string): Observable<readonly HTMLElement[]> {\n\tconst lower = tagName.toLowerCase()\n\treturn stack$$.pipe(\n\t\tmap((entries) => {\n\t\t\tconst matches: HTMLElement[] = []\n\t\t\tfor (const entry of entries) {\n\t\t\t\tconst inner = entry.element.querySelector<HTMLElement>(lower)\n\t\t\t\tif (inner) matches.push(inner)\n\t\t\t}\n\t\t\treturn matches\n\t\t}),\n\t\tdistinctUntilChanged((a, b) => a.length === b.length && a.every((el, i) => el === b[i])),\n\t)\n}\n","import {\n\tBehaviorSubject,\n\tdefer,\n\tdefaultIfEmpty,\n\tdistinctUntilChanged,\n\tEMPTY,\n\tfilter,\n\tfirstValueFrom,\n\tfromEvent,\n\tmap,\n\tmerge,\n\tObservable,\n\tSubject,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n} from 'rxjs'\nimport type { THistoryStrategy } from '../area/router.types'\nimport { SchmancyOverlay } from './overlay.component'\nimport {\n\tclearStack,\n\tcurrentStack,\n\telementsByTag$,\n\tmarkModal,\n\tpushEntry,\n\tremoveEntry,\n\tstack$ as internalStack$,\n\tunmarkModal,\n} from './overlay.stack'\nimport type {\n\tCloseReason,\n\tOverlayConfirmOptions,\n\tContent,\n\tOverlayEntry,\n\tOverlayPromptOptions,\n\tShowOptions,\n} from './overlay.types'\n\n/**\n * Public read-only stream of the current overlay stack. Subscribe to\n * observe stack changes — e.g. to update a breadcrumb, show a \"close\n * all\" button, or gate another action while any overlay is open.\n *\n * Emits synchronously with the current snapshot on subscribe. Never\n * completes — the caller owns teardown via `takeUntil(this.disconnecting)`.\n */\nexport const openOverlays$: Observable<readonly OverlayEntry[]> = internalStack$\n\n/* ======================================================================= *\n * ambient event capture *\n * ======================================================================= *\n * Novel: callers do not need to pass `anchor: event` manually. The service\n * listens to pointerdown / click / keydown at capture phase on the document\n * and remembers the most-recent user gesture. When show() is invoked\n * synchronously (or shortly after) in response to that gesture, the remembered\n * event becomes the default anchor. This matches the \"anchored is the novel\n * default\" principle without forcing callers to thread events through\n * handlers.\n *\n * Staleness guard: an event older than AMBIENT_ANCHOR_MAX_AGE_MS is ignored.\n * Timer-driven or async show() calls that don't originate from a user gesture\n * fall through to centered / sheet layout.\n */\nconst AMBIENT_ANCHOR_MAX_AGE_MS = 750\n\ninterface AmbientAnchor {\n\tevent: MouseEvent\n\tcapturedAt: number\n}\n\n/**\n * BehaviorSubject projected off three document-level event streams,\n * merged as Observables per rxjs principle 3 (every async source\n * lifted into fromEvent). Keydown activations synthesize a MouseEvent\n * at the focused element's bounding rect so the anchor path can\n * carry keyboard-triggered opens uniformly.\n *\n * The singleton subscribe has no explicit teardown — the module's\n * lifetime IS the subscription's lifetime, which is the correct\n * SUBSCRIPTION_IS_STATE shape for a document-level event sink.\n */\nconst ambientAnchor$ = new BehaviorSubject<AmbientAnchor | null>(null)\n\nif (typeof document !== 'undefined') {\n\tconst pointerdown$ = fromEvent<PointerEvent>(document, 'pointerdown', { capture: true, passive: true }).pipe(\n\t\tmap((e): AmbientAnchor => ({ event: e, capturedAt: performance.now() })),\n\t)\n\tconst click$ = fromEvent<MouseEvent>(document, 'click', { capture: true, passive: true }).pipe(\n\t\tmap((e): AmbientAnchor => ({ event: e, capturedAt: performance.now() })),\n\t)\n\tconst keydown$ = fromEvent<KeyboardEvent>(document, 'keydown', { capture: true }).pipe(\n\t\tfilter((e) => e.target instanceof Element),\n\t\tmap((e): AmbientAnchor => {\n\t\t\tconst rect = (e.target as Element).getBoundingClientRect()\n\t\t\tconst synthetic = new MouseEvent('click', {\n\t\t\t\tclientX: rect.left + rect.width / 2,\n\t\t\t\tclientY: rect.top + rect.height / 2,\n\t\t\t\tbubbles: true,\n\t\t\t})\n\t\t\treturn { event: synthetic, capturedAt: performance.now() }\n\t\t}),\n\t)\n\n\tmerge(pointerdown$, click$, keydown$).subscribe((ambient) => ambientAnchor$.next(ambient))\n}\n\nfunction ambientAnchor(): MouseEvent | undefined {\n\tconst cur = ambientAnchor$.value\n\tif (!cur) return undefined\n\tif (performance.now() - cur.capturedAt > AMBIENT_ANCHOR_MAX_AGE_MS) return undefined\n\treturn cur.event\n}\n\n\n/* ======================================================================= *\n * show *\n * ======================================================================= */\n\n/**\n * Open an overlay containing `content`. Returns a cold Observable — the\n * overlay mounts on subscribe and dismisses on unsubscribe. Emits at\n * most one value (the result from content's `close` event) then completes.\n *\n * The subscription IS the overlay lifecycle. `takeUntil(this.disconnecting)`\n * on the caller's side means the overlay auto-dismisses when the caller\n * unmounts — no handles to track, no leaks.\n *\n * **Anchored is the novel default.** When triggered by a user event, pass\n * it as `anchor` — the overlay blooms from the point of attention. Falls\n * back to centered or sheet when the viewport / content makes that the\n * better layout (see overlay.layout.ts).\n *\n * @example\n * show(MyEditor, { props: { id }, anchor: event })\n * .pipe(takeUntil(this.disconnecting))\n * .subscribe(saved => saved && this.store.persist(saved))\n */\nexport function show<T = void>(\n\tcontent: Content,\n\toptions: ShowOptions = {},\n): Observable<T | undefined> {\n\treturn defer(() => {\n\t\t// Resolve anchor at subscribe time: caller's explicit anchor wins,\n\t\t// otherwise the ambient gesture captured by ambientAnchor$ fills in.\n\t\tconst resolvedOptions: ShowOptions = {\n\t\t\t...options,\n\t\t\tanchor: options.anchor ?? ambientAnchor(),\n\t\t}\n\n\t\treturn new Observable<T | undefined>((subscriber) => {\n\t\t\tlet el: SchmancyOverlay | null = null\n\t\t\tlet entry: OverlayEntry | null = null\n\t\t\tlet historyPushed = false\n\t\t\tlet settled = false\n\n\t\t\tconst teardown$ = new Subject<void>()\n\n\t\t\tconst mount = async () => {\n\t\t\t\ttry {\n\t\t\t\t\t// Create and append the overlay element.\n\t\t\t\t\tel = document.createElement('schmancy-overlay') as SchmancyOverlay\n\t\t\t\t\t;(document.body ?? document.documentElement).appendChild(el)\n\t\t\t\t\tawait el.updateComplete\n\n\t\t\t\t\t// Open it — mount content, resolve layout, animate in.\n\t\t\t\t\tawait el.open(content, resolvedOptions)\n\n\t\t\t\t\t// Register with the stack (post-open so layout, modal, tier are all\n\t\t\t\t\t// resolved by the element).\n\t\t\t\t\tconst id = generateId()\n\t\t\t\t\tentry = {\n\t\t\t\t\t\tid,\n\t\t\t\t\t\telement: el,\n\t\t\t\t\t\tlayout: el.layout,\n\t\t\t\t\t\tmodal: el.modal,\n\t\t\t\t\t\ttier: el.tier,\n\t\t\t\t\t}\n\t\t\t\t\tpushEntry(entry)\n\n\t\t\t\t\t// Register modality for the stack-aware inert manager when modal.\n\t\t\t\t\tif (el.modal && el.parentElement) {\n\t\t\t\t\t\tmarkModal(id, el)\n\t\t\t\t\t}\n\n\t\t\t\t\t// History integration — push a sentinel unless silent.\n\t\t\t\t\tconst strategy: THistoryStrategy = resolvedOptions.historyStrategy ?? 'push'\n\t\t\t\t\tif (strategy === 'push') {\n\t\t\t\t\t\thistory.pushState({ __schmancyOverlayId: id }, '', location.href)\n\t\t\t\t\t\thistoryPushed = true\n\t\t\t\t\t} else if (strategy === 'replace') {\n\t\t\t\t\t\thistory.replaceState({ __schmancyOverlayId: id }, '', location.href)\n\t\t\t\t\t}\n\n\t\t\t\t\t// popstate — close this overlay when the user hits back past us.\n\t\t\t\t\t// If another overlay's popstate fires first, that's fine; each overlay\n\t\t\t\t\t// handles its own via this listener.\n\t\t\t\t\tif (historyPushed) {\n\t\t\t\t\t\tfromEvent<PopStateEvent>(window, 'popstate')\n\t\t\t\t\t\t\t.pipe(take(1), takeUntil(teardown$))\n\t\t\t\t\t\t\t.subscribe(() => {\n\t\t\t\t\t\t\t\t// Avoid double-pop on teardown — set settled so the\n\t\t\t\t\t\t\t\t// teardown fn doesn't call history.back() again.\n\t\t\t\t\t\t\t\tsettled = true\n\t\t\t\t\t\t\t\tvoid el?.close('popstate')\n\t\t\t\t\t\t\t})\n\t\t\t\t\t}\n\n\t\t\t\t\t// Subscribe to the element's internal close$ — the single source of\n\t\t\t\t\t// truth for lifecycle completion. Emits reason + optional result.\n\t\t\t\t\tel.closed$.pipe(take(1), takeUntil(teardown$)).subscribe(({ result }) => {\n\t\t\t\t\t\tsettled = true\n\t\t\t\t\t\tsubscriber.next(result as T | undefined)\n\t\t\t\t\t\tsubscriber.complete()\n\t\t\t\t\t})\n\t\t\t\t} catch (err) {\n\t\t\t\t\tsubscriber.error(err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid mount()\n\n\t\t\treturn () => {\n\t\t\t\tteardown$.next()\n\t\t\t\tteardown$.complete()\n\n\t\t\t\t// Unsubscribe path — caller cancelled. Tear down the overlay.\n\t\t\t\tif (el && !settled) {\n\t\t\t\t\tvoid el.close('programmatic')\n\t\t\t\t}\n\n\t\t\t\t// Clean up registry entries.\n\t\t\t\tif (entry) {\n\t\t\t\t\tunmarkModal(entry.id)\n\t\t\t\t\tremoveEntry(entry.id)\n\t\t\t\t}\n\n\t\t\t\t// Pop history if we pushed one and it's still current.\n\t\t\t\tif (historyPushed && !settled) {\n\t\t\t\t\t// Check before calling — if the user already popped, this is a noop.\n\t\t\t\t\tif (history.state?.__schmancyOverlayId === entry?.id) {\n\t\t\t\t\t\thistory.back()\n\t\t\t\t\t}\n\t\t\t\t\thistoryPushed = false\n\t\t\t\t}\n\n\t\t\t\t// Remove element after exit animation has had a chance to play.\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tel?.remove()\n\t\t\t\t\tel = null\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t})\n}\n\n/* ======================================================================= *\n * confirm / prompt sugar *\n * ======================================================================= */\n\n/**\n * Yes/no confirmation dialog. Returns a Promise that resolves with the\n * user's choice. `variant: 'danger'` flips to destructive styling and\n * `role=\"alertdialog\"`.\n */\nexport async function confirm(options: OverlayConfirmOptions = {}): Promise<boolean> {\n\t// Lazy-import the confirm body so push-only callers don't ship these\n\t// deps. The module is small; one-shot import penalty is fine.\n\tconst { SchmancyOverlayPromptBody } = await import('./overlay.confirm-body')\n\n\tconst result = await firstValueFrom(\n\t\tshow<boolean>(SchmancyOverlayPromptBody, {\n\t\t\tanchor: options.anchor,\n\t\t\tsignal: options.signal,\n\t\t\tprops: {\n\t\t\t\tmode: 'confirm',\n\t\t\t\theading: options.title,\n\t\t\t\tsubtitle: options.subtitle,\n\t\t\t\tmessage: options.message,\n\t\t\t\tconfirmText: options.confirmText ?? 'Confirm',\n\t\t\t\tcancelText: options.cancelText ?? 'Cancel',\n\t\t\t\tvariant: options.variant ?? 'default',\n\t\t\t},\n\t\t}).pipe(defaultIfEmpty(false as boolean | undefined)),\n\t)\n\treturn result === true\n}\n\n/**\n * Input prompt dialog. Returns the entered string, or `null` if the user\n * cancels or dismisses.\n */\nexport async function prompt(options: OverlayPromptOptions = {}): Promise<string | null> {\n\tconst { SchmancyOverlayPromptBody } = await import('./overlay.confirm-body')\n\n\tconst result = await firstValueFrom(\n\t\tshow<string | null>(SchmancyOverlayPromptBody, {\n\t\t\tanchor: options.anchor,\n\t\t\tsignal: options.signal,\n\t\t\tprops: {\n\t\t\t\tmode: 'prompt',\n\t\t\t\theading: options.title,\n\t\t\t\tsubtitle: options.subtitle,\n\t\t\t\tmessage: options.message,\n\t\t\t\tlabel: options.label,\n\t\t\t\tdefaultValue: options.defaultValue ?? '',\n\t\t\t\tplaceholder: options.placeholder,\n\t\t\t\tinputType: options.inputType ?? 'text',\n\t\t\t\tpattern: options.pattern,\n\t\t\t\trequired: options.required ?? false,\n\t\t\t\tconfirmText: options.confirmText ?? 'OK',\n\t\t\t\tcancelText: options.cancelText ?? 'Cancel',\n\t\t\t},\n\t\t}).pipe(defaultIfEmpty(null as string | null | undefined)),\n\t)\n\treturn typeof result === 'string' ? result : null\n}\n\n/* ======================================================================= *\n * overlayEvents *\n * ======================================================================= */\n\n/**\n * Subscribe to custom events emitted from any currently-open overlay\n * whose content matches `tagName`. Inspired by `area.on(name)` — keyed\n * by tag name (stable across HMR / lazy chunks) rather than a uid or\n * class reference.\n *\n * The returned Observable never completes on its own — the caller owns\n * teardown via `takeUntil(this.disconnecting)`. During gaps where no\n * matching overlay is open, no events are emitted; when an instance\n * mounts, events flow.\n *\n * Stacked instances of the same content merge their event streams.\n */\nexport function overlayEvents<E extends Event = CustomEvent>(\n\ttagName: string,\n\teventName: string,\n): Observable<E> {\n\treturn elementsByTag$(tagName).pipe(\n\t\tdistinctUntilChanged((a, b) => a.length === b.length && a.every((el, i) => el === b[i])),\n\t\tswitchMap((elements) =>\n\t\t\telements.length === 0 ? EMPTY : merge(...elements.map((el) => fromEvent<E>(el, eventName))),\n\t\t),\n\t\tmap((e) => e),\n\t)\n}\n\n/* ======================================================================= *\n * dismissAll *\n * ======================================================================= */\n\n/**\n * Close every currently-open overlay. LIFO order. Imperative — use for\n * app-level flows like logout or route reset.\n */\nexport function dismissAll(): void {\n\tconst stack = [...currentStack()]\n\t// LIFO: close top-of-stack first.\n\tfor (let i = stack.length - 1; i >= 0; i--) {\n\t\tconst entry = stack[i]\n\t\tconst overlay = entry.element as SchmancyOverlay\n\t\tvoid overlay.close('programmatic')\n\t}\n\tclearStack()\n}\n\n/* ======================================================================= *\n * helpers *\n * ======================================================================= */\n\nfunction generateId(): string {\n\t// 8-char base36 is enough entropy for session-scoped uniqueness.\n\treturn 'ov_' + Math.random().toString(36).slice(2, 10) + Date.now().toString(36)\n}\n\n// Re-export the close reason type for consumers who want to narrow on it.\nexport type { CloseReason }\n"],"mappings":";AAiBA,IAAM,IAAU,IAAI,EAAyC,EAAA,CAAA,EAGhD,IAA8C,EAAQ,cAAA,EA0C/D,IAAA,CAAmB,GACnB,IAAmB,IACnB,IAA0B;AAE9B,EACE,KACA,GAAK,MAAM,EAAE,MAAM,MAAM,EAAE,MAAA,CAAA,EAC3B,GAAA,CAAA,CAEA,WAAW,MAAA;AACa,CAAA,OAAb,WAAa,QAEpB,KAAA,CAAe,KAClB,IAAmB,SAAS,gBAAgB,MAAM,UAClD,IAA0B,SAAS,gBAAgB,MAAM,iBAAiB,mBAAA,EAC1E,SAAS,gBAAg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AG,YAAY,YAAY,KAAA;CAAA,EAAA,CAAA,EAE/C,EAAyB,UAAU,WAAW,EAAE,SAAA,CAAS,GAAA,CAAA,CAAQ,KACjF,GAAQ,MAAM,EAAE,kBAAkB,QAAA,EAClC,GAAK,MAAA;CACJ,IAAM,IAAQ,EAAE,OAAmB,uBAAA;AAMnC,QAAO;EAAE,OAAO,IALM,WAAW,SAAS;GACzC,SAAS,EAAK,OAAO,EAAK,QAAQ;GAClC,SAAS,EAAK,MAAM,EAAK,SAAS;GAClC,SAAA,CAAS;GAAA,CAAA;EAEiB,YAAY,YAAY,KAAA;EAAA;EAAA,CAAA,CAAA,CAIf,WAAW,MAAY,EAAe,KAAK,EAAA,CAAA;AAAA,SAAA,KAAA,GAAA,KAAA,GAAA,KAAA,GAAA,KAAA,GAAA,KAAA,GAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"overlay.service-BcF12kGb.js","names":[],"sources":["../src/overlay/overlay.stack.ts","../src/overlay/overlay.service.ts"],"sourcesContent":["import { BehaviorSubject, distinctUntilChanged, map, Observable } from 'rxjs'\nimport type { OverlayEntry } from './overlay.types'\n\n/**\n * Overlay stack — single source of truth for \"what is currently open.\"\n *\n * A module-scope BehaviorSubject matching the `schmancy` skill's\n * \"contexts at module scope; many small contexts beat one monolith\"\n * guidance. Reactive pipelines inside the overlay service and public\n * `openOverlays$` observable project off this.\n *\n * Scroll lock and the stack-aware inert manager are both derived from\n * the stack state — no separate mutable counter variables. Honors rxjs\n * SUBSCRIPTION_IS_STATE: the stack IS the state; scroll lock / inert\n * are declarative projections.\n */\n\nconst stack$$ = new BehaviorSubject<readonly OverlayEntry[]>([])\n\n/** Public read-only stream of the current stack. Emits on every push/pop. */\nexport const stack$: Observable<readonly OverlayEntry[]> = stack$$.asObservable()\n\n/** Synchronous snapshot. Use only when a component can't subscribe. */\nexport function currentStack(): readonly OverlayEntry[] {\n\treturn stack$$.value\n}\n\n/** Append an entry (top of stack). */\nexport function pushEntry(entry: OverlayEntry): void {\n\tstack$$.next([...stack$$.value, entry])\n}\n\n/** Remove by id. No-op if the id is not in the stack. */\nexport function removeEntry(id: string): void {\n\tconst current = stack$$.value\n\tconst next = current.filter((e) => e.id !== id)\n\tif (next.length !== current.length) {\n\t\tstack$$.next(next)\n\t}\n}\n\n/** Clear the entire stack. Used by dismissAll(). */\nexport function clearStack(): void {\n\tif (stack$$.value.length > 0) {\n\t\tstack$$.next([])\n\t}\n}\n\n/* ---------------- scroll lock -------------------------------------------- */\n\n/**\n * Ref-counted body scroll lock. Active whenever ANY modal-tier overlay is\n * in the stack. Popover-tier (Tier 1/2) overlays do NOT lock body scroll —\n * a menu / share card / picker shouldn't freeze the page scroll behind it\n * (that's platform UX convention).\n *\n * Subscription is idempotent — subscribing multiple times won't stack\n * effects, because it's a distinctUntilChanged boolean projection.\n *\n * Inner overlay close does NOT release the lock while an outer modal is\n * still open (this was the pre-existing bug in sheet.service.ts).\n */\nlet scrollLockActive = false\nlet previousOverflow = ''\nlet previousScrollbarGutter = ''\n\nstack$$\n\t.pipe(\n\t\tmap((s) => s.some((e) => e.modal)),\n\t\tdistinctUntilChanged(),\n\t)\n\t.subscribe((shouldLock) => {\n\t\tif (typeof document === 'undefined') return\n\n\t\tif (shouldLock && !scrollLockActive) {\n\t\t\tpreviousOverflow = document.documentElement.style.overflow\n\t\t\tpreviousScrollbarGutter = document.documentElement.style.getPropertyValue('scrollbar-gutter')\n\t\t\tdocument.documentElement.style.overflow = 'hidden'\n\t\t\tdocument.documentElement.style.setProperty('scrollbar-gutter', 'stable')\n\t\t\tscrollLockActive = true\n\t\t} else if (!shouldLock && scrollLockActive) {\n\t\t\tdocument.documentElement.style.overflow = previousOverflow\n\t\t\tif (previousScrollbarGutter) {\n\t\t\t\tdocument.documentElement.style.setProperty('scrollbar-gutter', previousScrollbarGutter)\n\t\t\t} else {\n\t\t\t\tdocument.documentElement.style.removeProperty('scrollbar-gutter')\n\t\t\t}\n\t\t\tpreviousOverflow = ''\n\t\t\tpreviousScrollbarGutter = ''\n\t\t\tscrollLockActive = false\n\t\t}\n\t})\n\n/* ---------------- stack-aware inert -------------------------------------- */\n\n/**\n * When the first modal overlay opens, mark every sibling outside the\n * overlay host subtree as `inert` so AT and keyboard focus can't reach\n * them. Restored when the last modal overlay closes.\n *\n * Note: native `<dialog>.showModal()` already inerts the rest of the\n * document automatically. We keep this as a safety net for:\n * - anchored (popover) overlays which are non-modal by design but may\n * carry `modal: true` as the escape hatch;\n * - stacked overlays where an inner modal opens above a non-modal —\n * the sibling-inert is a no-op but we still guarantee the invariant.\n *\n * Callers that don't want inert (anchored/menu overlays) skip registration\n * via `markNonModal(id)`.\n */\nconst modalIds = new Set<string>()\nconst inertedSiblings = new Set<HTMLElement>()\n\nexport function markModal(id: string, hostContainer: HTMLElement): void {\n\tmodalIds.add(id)\n\tif (modalIds.size === 1) {\n\t\tapplyInert(hostContainer)\n\t}\n}\n\nexport function unmarkModal(id: string): void {\n\tmodalIds.delete(id)\n\tif (modalIds.size === 0) {\n\t\treleaseInert()\n\t}\n}\n\nfunction applyInert(hostContainer: HTMLElement): void {\n\tconst parent = hostContainer.parentElement ?? document.body\n\tfor (let i = 0; i < parent.children.length; i++) {\n\t\tconst child = parent.children[i]\n\t\tif (child !== hostContainer && child instanceof HTMLElement && !child.inert) {\n\t\t\tchild.inert = true\n\t\t\tinertedSiblings.add(child)\n\t\t}\n\t}\n}\n\nfunction releaseInert(): void {\n\tfor (const el of inertedSiblings) {\n\t\tel.inert = false\n\t}\n\tinertedSiblings.clear()\n}\n\n/* ---------------- overlayEvents multicast helper ------------------------- */\n\n/**\n * Returns an Observable of `tagName` elements currently in the stack.\n * The overlayEvents public helper composes `fromEvent` over this stream\n * via switchMap to tap events without owning the overlay lifecycle.\n *\n * Stays alive across open/close cycles — the caller owns completion via\n * `takeUntil(this.disconnecting)`, matching the house rxjs convention.\n */\nexport function elementsByTag$(tagName: string): Observable<readonly HTMLElement[]> {\n\tconst lower = tagName.toLowerCase()\n\treturn stack$$.pipe(\n\t\tmap((entries) => {\n\t\t\tconst matches: HTMLElement[] = []\n\t\t\tfor (const entry of entries) {\n\t\t\t\tconst inner = entry.element.querySelector<HTMLElement>(lower)\n\t\t\t\tif (inner) matches.push(inner)\n\t\t\t}\n\t\t\treturn matches\n\t\t}),\n\t\tdistinctUntilChanged((a, b) => a.length === b.length && a.every((el, i) => el === b[i])),\n\t)\n}\n","import {\n\tBehaviorSubject,\n\tdefer,\n\tdefaultIfEmpty,\n\tdistinctUntilChanged,\n\tEMPTY,\n\tfilter,\n\tfirstValueFrom,\n\tfromEvent,\n\tmap,\n\tmerge,\n\tObservable,\n\tSubject,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n} from 'rxjs'\nimport type { THistoryStrategy } from '../area/router.types'\nimport { SchmancyOverlay } from './overlay.component'\nimport {\n\tclearStack,\n\tcurrentStack,\n\telementsByTag$,\n\tmarkModal,\n\tpushEntry,\n\tremoveEntry,\n\tstack$ as internalStack$,\n\tunmarkModal,\n} from './overlay.stack'\nimport type {\n\tCloseReason,\n\tOverlayConfirmOptions,\n\tContent,\n\tOverlayEntry,\n\tOverlayPromptOptions,\n\tShowOptions,\n} from './overlay.types'\n\n/**\n * Public read-only stream of the current overlay stack. Subscribe to\n * observe stack changes — e.g. to update a breadcrumb, show a \"close\n * all\" button, or gate another action while any overlay is open.\n *\n * Emits synchronously with the current snapshot on subscribe. Never\n * completes — the caller owns teardown via `takeUntil(this.disconnecting)`.\n */\nexport const openOverlays$: Observable<readonly OverlayEntry[]> = internalStack$\n\n/* ======================================================================= *\n * ambient event capture *\n * ======================================================================= *\n * Novel: callers do not need to pass `anchor: event` manually. The service\n * listens to pointerdown / click / keydown at capture phase on the document\n * and remembers the most-recent user gesture. When show() is invoked\n * synchronously (or shortly after) in response to that gesture, the remembered\n * event becomes the default anchor. This matches the \"anchored is the novel\n * default\" principle without forcing callers to thread events through\n * handlers.\n *\n * Staleness guard: an event older than AMBIENT_ANCHOR_MAX_AGE_MS is ignored.\n * Timer-driven or async show() calls that don't originate from a user gesture\n * fall through to centered / sheet layout.\n */\nconst AMBIENT_ANCHOR_MAX_AGE_MS = 750\n\ninterface AmbientAnchor {\n\tevent: MouseEvent\n\tcapturedAt: number\n}\n\n/**\n * BehaviorSubject projected off three document-level event streams,\n * merged as Observables per rxjs principle 3 (every async source\n * lifted into fromEvent). Keydown activations synthesize a MouseEvent\n * at the focused element's bounding rect so the anchor path can\n * carry keyboard-triggered opens uniformly.\n *\n * The singleton subscribe has no explicit teardown — the module's\n * lifetime IS the subscription's lifetime, which is the correct\n * SUBSCRIPTION_IS_STATE shape for a document-level event sink.\n */\nconst ambientAnchor$ = new BehaviorSubject<AmbientAnchor | null>(null)\n\nif (typeof document !== 'undefined') {\n\tconst pointerdown$ = fromEvent<PointerEvent>(document, 'pointerdown', { capture: true, passive: true }).pipe(\n\t\tmap((e): AmbientAnchor => ({ event: e, capturedAt: performance.now() })),\n\t)\n\tconst click$ = fromEvent<MouseEvent>(document, 'click', { capture: true, passive: true }).pipe(\n\t\tmap((e): AmbientAnchor => ({ event: e, capturedAt: performance.now() })),\n\t)\n\tconst keydown$ = fromEvent<KeyboardEvent>(document, 'keydown', { capture: true }).pipe(\n\t\tfilter((e) => e.target instanceof Element),\n\t\tmap((e): AmbientAnchor => {\n\t\t\tconst rect = (e.target as Element).getBoundingClientRect()\n\t\t\tconst synthetic = new MouseEvent('click', {\n\t\t\t\tclientX: rect.left + rect.width / 2,\n\t\t\t\tclientY: rect.top + rect.height / 2,\n\t\t\t\tbubbles: true,\n\t\t\t})\n\t\t\treturn { event: synthetic, capturedAt: performance.now() }\n\t\t}),\n\t)\n\n\tmerge(pointerdown$, click$, keydown$).subscribe((ambient) => ambientAnchor$.next(ambient))\n}\n\nfunction ambientAnchor(): MouseEvent | undefined {\n\tconst cur = ambientAnchor$.value\n\tif (!cur) return undefined\n\tif (performance.now() - cur.capturedAt > AMBIENT_ANCHOR_MAX_AGE_MS) return undefined\n\treturn cur.event\n}\n\n\n/* ======================================================================= *\n * show *\n * ======================================================================= */\n\n/**\n * Open an overlay containing `content`. Returns a cold Observable — the\n * overlay mounts on subscribe and dismisses on unsubscribe. Emits at\n * most one value (the result from content's `close` event) then completes.\n *\n * The subscription IS the overlay lifecycle. `takeUntil(this.disconnecting)`\n * on the caller's side means the overlay auto-dismisses when the caller\n * unmounts — no handles to track, no leaks.\n *\n * **Anchored is the novel default.** When triggered by a user event, pass\n * it as `anchor` — the overlay blooms from the point of attention. Falls\n * back to centered or sheet when the viewport / content makes that the\n * better layout (see overlay.layout.ts).\n *\n * @example\n * show(MyEditor, { props: { id }, anchor: event })\n * .pipe(takeUntil(this.disconnecting))\n * .subscribe(saved => saved && this.store.persist(saved))\n */\nexport function show<T = void>(\n\tcontent: Content,\n\toptions: ShowOptions = {},\n): Observable<T | undefined> {\n\treturn defer(() => {\n\t\t// Resolve anchor at subscribe time: caller's explicit anchor wins,\n\t\t// otherwise the ambient gesture captured by ambientAnchor$ fills in.\n\t\tconst resolvedOptions: ShowOptions = {\n\t\t\t...options,\n\t\t\tanchor: options.anchor ?? ambientAnchor(),\n\t\t}\n\n\t\treturn new Observable<T | undefined>((subscriber) => {\n\t\t\tlet el: SchmancyOverlay | null = null\n\t\t\tlet entry: OverlayEntry | null = null\n\t\t\tlet historyPushed = false\n\t\t\tlet settled = false\n\n\t\t\tconst teardown$ = new Subject<void>()\n\n\t\t\tconst mount = async () => {\n\t\t\t\ttry {\n\t\t\t\t\t// Create and append the overlay element.\n\t\t\t\t\tel = document.createElement('schmancy-overlay') as SchmancyOverlay\n\t\t\t\t\t;(document.body ?? document.documentElement).appendChild(el)\n\t\t\t\t\tawait el.updateComplete\n\n\t\t\t\t\t// Open it — mount content, resolve layout, animate in.\n\t\t\t\t\tawait el.open(content, resolvedOptions)\n\n\t\t\t\t\t// Register with the stack (post-open so layout, modal, tier are all\n\t\t\t\t\t// resolved by the element).\n\t\t\t\t\tconst id = generateId()\n\t\t\t\t\tentry = {\n\t\t\t\t\t\tid,\n\t\t\t\t\t\telement: el,\n\t\t\t\t\t\tlayout: el.layout,\n\t\t\t\t\t\tmodal: el.modal,\n\t\t\t\t\t\ttier: el.tier,\n\t\t\t\t\t}\n\t\t\t\t\tpushEntry(entry)\n\n\t\t\t\t\t// Register modality for the stack-aware inert manager when modal.\n\t\t\t\t\tif (el.modal && el.parentElement) {\n\t\t\t\t\t\tmarkModal(id, el)\n\t\t\t\t\t}\n\n\t\t\t\t\t// History integration — push a sentinel unless silent.\n\t\t\t\t\tconst strategy: THistoryStrategy = resolvedOptions.historyStrategy ?? 'push'\n\t\t\t\t\tif (strategy === 'push') {\n\t\t\t\t\t\thistory.pushState({ __schmancyOverlayId: id }, '', location.href)\n\t\t\t\t\t\thistoryPushed = true\n\t\t\t\t\t} else if (strategy === 'replace') {\n\t\t\t\t\t\thistory.replaceState({ __schmancyOverlayId: id }, '', location.href)\n\t\t\t\t\t}\n\n\t\t\t\t\t// popstate — close this overlay when the user hits back past us.\n\t\t\t\t\t// If another overlay's popstate fires first, that's fine; each overlay\n\t\t\t\t\t// handles its own via this listener.\n\t\t\t\t\tif (historyPushed) {\n\t\t\t\t\t\tfromEvent<PopStateEvent>(window, 'popstate')\n\t\t\t\t\t\t\t.pipe(take(1), takeUntil(teardown$))\n\t\t\t\t\t\t\t.subscribe(() => {\n\t\t\t\t\t\t\t\t// Avoid double-pop on teardown — set settled so the\n\t\t\t\t\t\t\t\t// teardown fn doesn't call history.back() again.\n\t\t\t\t\t\t\t\tsettled = true\n\t\t\t\t\t\t\t\tvoid el?.close('popstate')\n\t\t\t\t\t\t\t})\n\t\t\t\t\t}\n\n\t\t\t\t\t// Subscribe to the element's internal close$ — the single source of\n\t\t\t\t\t// truth for lifecycle completion. Emits reason + optional result.\n\t\t\t\t\tel.closed$.pipe(take(1), takeUntil(teardown$)).subscribe(({ result }) => {\n\t\t\t\t\t\tsettled = true\n\t\t\t\t\t\tsubscriber.next(result as T | undefined)\n\t\t\t\t\t\tsubscriber.complete()\n\t\t\t\t\t})\n\t\t\t\t} catch (err) {\n\t\t\t\t\tsubscriber.error(err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid mount()\n\n\t\t\treturn () => {\n\t\t\t\tteardown$.next()\n\t\t\t\tteardown$.complete()\n\n\t\t\t\t// Unsubscribe path — caller cancelled. Tear down the overlay.\n\t\t\t\tif (el && !settled) {\n\t\t\t\t\tvoid el.close('programmatic')\n\t\t\t\t}\n\n\t\t\t\t// Clean up registry entries.\n\t\t\t\tif (entry) {\n\t\t\t\t\tunmarkModal(entry.id)\n\t\t\t\t\tremoveEntry(entry.id)\n\t\t\t\t}\n\n\t\t\t\t// Pop history if we pushed one and it's still current.\n\t\t\t\tif (historyPushed && !settled) {\n\t\t\t\t\t// Check before calling — if the user already popped, this is a noop.\n\t\t\t\t\tif (history.state?.__schmancyOverlayId === entry?.id) {\n\t\t\t\t\t\thistory.back()\n\t\t\t\t\t}\n\t\t\t\t\thistoryPushed = false\n\t\t\t\t}\n\n\t\t\t\t// Remove element after exit animation has had a chance to play.\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tel?.remove()\n\t\t\t\t\tel = null\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t})\n}\n\n/* ======================================================================= *\n * confirm / prompt sugar *\n * ======================================================================= */\n\n/**\n * Yes/no confirmation dialog. Returns a Promise that resolves with the\n * user's choice. `variant: 'danger'` flips to destructive styling and\n * `role=\"alertdialog\"`.\n */\nexport async function confirm(options: OverlayConfirmOptions = {}): Promise<boolean> {\n\t// Lazy-import the confirm body so push-only callers don't ship these\n\t// deps. The module is small; one-shot import penalty is fine.\n\tconst { SchmancyOverlayPromptBody } = await import('./overlay.confirm-body')\n\n\tconst result = await firstValueFrom(\n\t\tshow<boolean>(SchmancyOverlayPromptBody, {\n\t\t\tanchor: options.anchor,\n\t\t\tsignal: options.signal,\n\t\t\tprops: {\n\t\t\t\tmode: 'confirm',\n\t\t\t\theading: options.title,\n\t\t\t\tsubtitle: options.subtitle,\n\t\t\t\tmessage: options.message,\n\t\t\t\tconfirmText: options.confirmText ?? 'Confirm',\n\t\t\t\tcancelText: options.cancelText ?? 'Cancel',\n\t\t\t\tvariant: options.variant ?? 'default',\n\t\t\t},\n\t\t}).pipe(defaultIfEmpty(false as boolean | undefined)),\n\t)\n\treturn result === true\n}\n\n/**\n * Input prompt dialog. Returns the entered string, or `null` if the user\n * cancels or dismisses.\n */\nexport async function prompt(options: OverlayPromptOptions = {}): Promise<string | null> {\n\tconst { SchmancyOverlayPromptBody } = await import('./overlay.confirm-body')\n\n\tconst result = await firstValueFrom(\n\t\tshow<string | null>(SchmancyOverlayPromptBody, {\n\t\t\tanchor: options.anchor,\n\t\t\tsignal: options.signal,\n\t\t\tprops: {\n\t\t\t\tmode: 'prompt',\n\t\t\t\theading: options.title,\n\t\t\t\tsubtitle: options.subtitle,\n\t\t\t\tmessage: options.message,\n\t\t\t\tlabel: options.label,\n\t\t\t\tdefaultValue: options.defaultValue ?? '',\n\t\t\t\tplaceholder: options.placeholder,\n\t\t\t\tinputType: options.inputType ?? 'text',\n\t\t\t\tpattern: options.pattern,\n\t\t\t\trequired: options.required ?? false,\n\t\t\t\tconfirmText: options.confirmText ?? 'OK',\n\t\t\t\tcancelText: options.cancelText ?? 'Cancel',\n\t\t\t},\n\t\t}).pipe(defaultIfEmpty(null as string | null | undefined)),\n\t)\n\treturn typeof result === 'string' ? result : null\n}\n\n/* ======================================================================= *\n * overlayEvents *\n * ======================================================================= */\n\n/**\n * Subscribe to custom events emitted from any currently-open overlay\n * whose content matches `tagName`. Inspired by `area.on(name)` — keyed\n * by tag name (stable across HMR / lazy chunks) rather than a uid or\n * class reference.\n *\n * The returned Observable never completes on its own — the caller owns\n * teardown via `takeUntil(this.disconnecting)`. During gaps where no\n * matching overlay is open, no events are emitted; when an instance\n * mounts, events flow.\n *\n * Stacked instances of the same content merge their event streams.\n */\nexport function overlayEvents<E extends Event = CustomEvent>(\n\ttagName: string,\n\teventName: string,\n): Observable<E> {\n\treturn elementsByTag$(tagName).pipe(\n\t\tdistinctUntilChanged((a, b) => a.length === b.length && a.every((el, i) => el === b[i])),\n\t\tswitchMap((elements) =>\n\t\t\telements.length === 0 ? EMPTY : merge(...elements.map((el) => fromEvent<E>(el, eventName))),\n\t\t),\n\t\tmap((e) => e),\n\t)\n}\n\n/* ======================================================================= *\n * dismissAll *\n * ======================================================================= */\n\n/**\n * Close every currently-open overlay. LIFO order. Imperative — use for\n * app-level flows like logout or route reset.\n */\nexport function dismissAll(): void {\n\tconst stack = [...currentStack()]\n\t// LIFO: close top-of-stack first.\n\tfor (let i = stack.length - 1; i >= 0; i--) {\n\t\tconst entry = stack[i]\n\t\tconst overlay = entry.element as SchmancyOverlay\n\t\tvoid overlay.close('programmatic')\n\t}\n\tclearStack()\n}\n\n/* ======================================================================= *\n * helpers *\n * ======================================================================= */\n\nfunction generateId(): string {\n\t// 8-char base36 is enough entropy for session-scoped uniqueness.\n\treturn 'ov_' + Math.random().toString(36).slice(2, 10) + Date.now().toString(36)\n}\n\n// Re-export the close reason type for consumers who want to narrow on it.\nexport type { CloseReason }\n"],"mappings":";AAiBA,IAAM,IAAU,IAAI,EAAyC,EAAA,CAAA,EAGhD,IAA8C,EAAQ,cAAA,EA0C/D,IAAA,CAAmB,GACnB,IAAmB,IACnB,IAA0B;AAE9B,EACE,KACA,GAAK,MAAM,EAAE,MAAM,MAAM,EAAE,MAAA,CAAA,EAC3B,GAAA,CAAA,CAEA,WAAW,MAAA;CACa,AAAA,OAAb,WAAa,QAEpB,KAAA,CAAe,KAClB,IAAmB,SAAS,gBAAgB,MAAM,UAClD,IAA0B,SAAS,gBAAgB,MAAM,iBAAiB,mBAAA,EAC1E,SAAS,gBAAgB,MAAM,WAAW,UAC1C,SAAS,gBAAgB,MAAM,YAAY,oBAAoB,SAAA,EAC/D,IAAA,CAAmB,KAAA,CACR,KAAc,MACzB,SAAS,gBAAgB,MAAM,WAAW,GACtC,IACH,SAAS,gBAAgB,MA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MAAA;CACJ,IAAM,IAAQ,EAAE,OAAmB,uBAAA;CAMnC,OAAO;EAAE,OAAO,IALM,WAAW,SAAS;GACzC,SAAS,EAAK,OAAO,EAAK,QAAQ;GAClC,SAAS,EAAK,MAAM,EAAK,SAAS;GAClC,SAAA,CAAS;GAAA,CAAA;EAEiB,YAAY,YAAY,KAAA;EAAA;EAAA,CAAA,CAAA,CAIf,WAAW,MAAY,EAAe,KAAK,EAAA,CAAA;AAAA,SAAA,KAAA,GAAA,KAAA,GAAA,KAAA,GAAA,KAAA,GAAA,KAAA,GAAA,KAAA"}
|
package/dist/page.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-BOOu6q2n.cjs`),t=require(`./active-host-jH3iloCR.cjs`),n=require(`./theme.service-DkdH1t60.cjs`),r=require(`./layout-Delq-QvR.cjs`);require(`./scroll-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk-CncqDLb2.cjs`);const e=require(`./mixins-BOOu6q2n.cjs`),t=require(`./active-host-jH3iloCR.cjs`),n=require(`./theme.service-DkdH1t60.cjs`),r=require(`./layout-Delq-QvR.cjs`);require(`./scroll-nIZyoEMt.cjs`);let i=require(`rxjs`),a=require(`rxjs/operators`),o=require(`lit/decorators.js`),s=require(`lit`);var c=class extends e.c{constructor(...e){super(...e),this.rows=`auto_1fr_auto`,this.showScrollbar=!1,this.noSelect=!1,this.heightDisconnecting$=new i.Subject}static{this.styles=[s.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
box-sizing: border-box;
|
package/dist/page.js
CHANGED
|
@@ -2,7 +2,7 @@ import { c as e } from "./mixins-BWb9_e1s.js";
|
|
|
2
2
|
import { a as t } from "./active-host-BP0zy_Y9.js";
|
|
3
3
|
import { n } from "./theme.service-BOWIT_5k.js";
|
|
4
4
|
import { t as r } from "./layout-BH28sKGc.js";
|
|
5
|
-
import "./scroll-
|
|
5
|
+
import "./scroll-BFHUtZOa.js";
|
|
6
6
|
import { EMPTY as i, Subject as a, combineLatest as o, fromEvent as s, merge as c, timer as l } from "rxjs";
|
|
7
7
|
import { debounceTime as u, distinctUntilChanged as d, map as f, startWith as p, switchMap as m, takeUntil as h, tap as g } from "rxjs/operators";
|
|
8
8
|
import { customElement as _, property as v } from "lit/decorators.js";
|
package/dist/page.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","names":[],"sources":["../src/page/page.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport '../layout/scroll/scroll'\nimport { Subject, fromEvent, merge, EMPTY, timer, combineLatest } from 'rxjs'\nimport { debounceTime, switchMap, takeUntil, distinctUntilChanged, map, tap, startWith } from 'rxjs/operators'\nimport { theme } from '../theme/theme.service'\nimport { fromResizeObserver } from '../directives/layout'\n\n/**\n * Native mobile-like page container.\n * Prevents double-tap zoom, pull-to-refresh, rubber-banding.\n * Automatically fills remaining viewport height.\n *\n * @element schmancy-page\n *\n * @example\n * html`\n * <schmancy-page rows=\"1fr_2fr_auto\">\n * <header>App Bar</header>\n * <main>Scrollable content</main>\n * <footer>Navigation</footer>\n * </schmancy-page>\n * `\n */\n@customElement('schmancy-page')\nexport class SchmancyPage extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: block;\n\t\tbox-sizing: border-box;\n\t\ttouch-action: pan-x pan-y;\n\t\toverscroll-behavior: none;\n\t\t-webkit-tap-highlight-color: transparent;\n\t}\n`]\n\n\t/** Custom grid-template-rows using underscores (e.g. \"1fr_2fr_auto\") */\n\t@property({ type: String })\n\trows = 'auto_1fr_auto'\n\n\t@property({ type: Boolean, attribute: 'show-scrollbar' })\n\tshowScrollbar = false\n\n\t@property({ type: Boolean, attribute: 'no-select' })\n\tnoSelect = false\n\n\tprivate heightDisconnecting$ = new Subject<void>()\n\n\tprivate calculateHeight(): number {\n\t\tconst viewportHeight = window.visualViewport?.height ?? window.innerHeight\n\t\tconst topOffset = this.getBoundingClientRect().top\n\t\treturn Math.max(0, viewportHeight - topOffset)\n\t}\n\n\tprivate applyHeight(height: number, bottomPadding: number) {\n\t\tthis.style.height = `${height}px`\n\t\tthis.style.paddingBottom = `${bottomPadding}px`\n\t}\n\n\tprivate setupHeightStream() {\n\t\t// Shared resize stream\n\t\tconst windowResize$ = fromEvent(window, 'resize', { passive: true })\n\t\tconst viewportEvents$ = window.visualViewport\n\t\t\t? merge(\n\t\t\t\t\tfromEvent(window.visualViewport, 'resize', { passive: true }),\n\t\t\t\t\tfromEvent(window.visualViewport, 'scroll', { passive: true })\n\t\t\t\t)\n\t\t\t: windowResize$\n\t\tconst orientation$ = fromEvent(window, 'orientationchange')\n\t\tconst focusOut$ = fromEvent(document, 'focusout', { passive: true }).pipe(\n\t\t\tswitchMap(() => timer(100))\n\t\t)\n\n\t\tconst globalEvents$ = merge(windowResize$, viewportEvents$, orientation$, focusOut$).pipe(\n\t\t\tdebounceTime(16)\n\t\t)\n\n\t\t// Parent resize detects layout shifts\n\t\tconst parentResize$ = this.parentElement\n\t\t\t? fromResizeObserver(this.parentElement)\n\t\t\t: EMPTY\n\n\t\t// Combine all sources, calculate height and padding, dedupe, apply\n\t\tcombineLatest([\n\t\t\tmerge(parentResize$, globalEvents$).pipe(startWith(null)),\n\t\t\ttheme.bottomOffset$,\n\t\t\ttheme.fullscreen$\n\t\t]).pipe(\n\t\t\tmap(([, bottomOffset, isFullscreen]) => ({\n\t\t\t\theight: this.calculateHeight(),\n\t\t\t\tpadding: isFullscreen ? 0 : bottomOffset\n\t\t\t})),\n\t\t\tdistinctUntilChanged((a, b) => a.height === b.height && a.padding === b.padding),\n\t\t\ttap(({ height, padding }) => this.applyHeight(height, padding)),\n\t\t\ttakeUntil(this.heightDisconnecting$)\n\t\t).subscribe()\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\t// Auto-assign semantic elements to slots\n\t\tthis.querySelectorAll(':scope > header').forEach(el => el.setAttribute('slot', 'header'))\n\t\tthis.querySelectorAll(':scope > footer').forEach(el => el.setAttribute('slot', 'footer'))\n\t\t// Setup fullHeight on host\n\t\tthis.setupHeightStream()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.heightDisconnecting$.next()\n\t}\n\n\tprotected render() {\n\t\treturn html`\n\t\t\t<section\n\t\t\t\tclass=${this.classMap({\n\t\t\t\t\t'grid overflow-hidden h-full': true,\n\t\t\t\t\t'select-none': this.noSelect,\n\t\t\t\t})}\n\t\t\t\tstyle=\"grid-template-rows: ${this.rows.replace(/_/g, ' ')}\"\n\t\t\t>\n\t\t\t\t<slot name=\"header\"></slot>\n\t\t\t\t<schmancy-scroll ?hide=${!this.showScrollbar}><slot></slot></schmancy-scroll>\n\t\t\t\t<schmancy-scroll ?hide=${!this.showScrollbar}>\n\t\t\t\t\t<slot name=\"footer\"></slot>\n\t\t\t\t</schmancy-scroll>\n\t\t\t</section>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-page': SchmancyPage\n\t}\n}\n"],"mappings":";;;;;;;;;AA0BO,IAAA,IAAA,cAA2B,EAAA;CAAA,YAAA,GAAA,GAAA;
|
|
1
|
+
{"version":3,"file":"page.js","names":[],"sources":["../src/page/page.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport '../layout/scroll/scroll'\nimport { Subject, fromEvent, merge, EMPTY, timer, combineLatest } from 'rxjs'\nimport { debounceTime, switchMap, takeUntil, distinctUntilChanged, map, tap, startWith } from 'rxjs/operators'\nimport { theme } from '../theme/theme.service'\nimport { fromResizeObserver } from '../directives/layout'\n\n/**\n * Native mobile-like page container.\n * Prevents double-tap zoom, pull-to-refresh, rubber-banding.\n * Automatically fills remaining viewport height.\n *\n * @element schmancy-page\n *\n * @example\n * html`\n * <schmancy-page rows=\"1fr_2fr_auto\">\n * <header>App Bar</header>\n * <main>Scrollable content</main>\n * <footer>Navigation</footer>\n * </schmancy-page>\n * `\n */\n@customElement('schmancy-page')\nexport class SchmancyPage extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: block;\n\t\tbox-sizing: border-box;\n\t\ttouch-action: pan-x pan-y;\n\t\toverscroll-behavior: none;\n\t\t-webkit-tap-highlight-color: transparent;\n\t}\n`]\n\n\t/** Custom grid-template-rows using underscores (e.g. \"1fr_2fr_auto\") */\n\t@property({ type: String })\n\trows = 'auto_1fr_auto'\n\n\t@property({ type: Boolean, attribute: 'show-scrollbar' })\n\tshowScrollbar = false\n\n\t@property({ type: Boolean, attribute: 'no-select' })\n\tnoSelect = false\n\n\tprivate heightDisconnecting$ = new Subject<void>()\n\n\tprivate calculateHeight(): number {\n\t\tconst viewportHeight = window.visualViewport?.height ?? window.innerHeight\n\t\tconst topOffset = this.getBoundingClientRect().top\n\t\treturn Math.max(0, viewportHeight - topOffset)\n\t}\n\n\tprivate applyHeight(height: number, bottomPadding: number) {\n\t\tthis.style.height = `${height}px`\n\t\tthis.style.paddingBottom = `${bottomPadding}px`\n\t}\n\n\tprivate setupHeightStream() {\n\t\t// Shared resize stream\n\t\tconst windowResize$ = fromEvent(window, 'resize', { passive: true })\n\t\tconst viewportEvents$ = window.visualViewport\n\t\t\t? merge(\n\t\t\t\t\tfromEvent(window.visualViewport, 'resize', { passive: true }),\n\t\t\t\t\tfromEvent(window.visualViewport, 'scroll', { passive: true })\n\t\t\t\t)\n\t\t\t: windowResize$\n\t\tconst orientation$ = fromEvent(window, 'orientationchange')\n\t\tconst focusOut$ = fromEvent(document, 'focusout', { passive: true }).pipe(\n\t\t\tswitchMap(() => timer(100))\n\t\t)\n\n\t\tconst globalEvents$ = merge(windowResize$, viewportEvents$, orientation$, focusOut$).pipe(\n\t\t\tdebounceTime(16)\n\t\t)\n\n\t\t// Parent resize detects layout shifts\n\t\tconst parentResize$ = this.parentElement\n\t\t\t? fromResizeObserver(this.parentElement)\n\t\t\t: EMPTY\n\n\t\t// Combine all sources, calculate height and padding, dedupe, apply\n\t\tcombineLatest([\n\t\t\tmerge(parentResize$, globalEvents$).pipe(startWith(null)),\n\t\t\ttheme.bottomOffset$,\n\t\t\ttheme.fullscreen$\n\t\t]).pipe(\n\t\t\tmap(([, bottomOffset, isFullscreen]) => ({\n\t\t\t\theight: this.calculateHeight(),\n\t\t\t\tpadding: isFullscreen ? 0 : bottomOffset\n\t\t\t})),\n\t\t\tdistinctUntilChanged((a, b) => a.height === b.height && a.padding === b.padding),\n\t\t\ttap(({ height, padding }) => this.applyHeight(height, padding)),\n\t\t\ttakeUntil(this.heightDisconnecting$)\n\t\t).subscribe()\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\t// Auto-assign semantic elements to slots\n\t\tthis.querySelectorAll(':scope > header').forEach(el => el.setAttribute('slot', 'header'))\n\t\tthis.querySelectorAll(':scope > footer').forEach(el => el.setAttribute('slot', 'footer'))\n\t\t// Setup fullHeight on host\n\t\tthis.setupHeightStream()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.heightDisconnecting$.next()\n\t}\n\n\tprotected render() {\n\t\treturn html`\n\t\t\t<section\n\t\t\t\tclass=${this.classMap({\n\t\t\t\t\t'grid overflow-hidden h-full': true,\n\t\t\t\t\t'select-none': this.noSelect,\n\t\t\t\t})}\n\t\t\t\tstyle=\"grid-template-rows: ${this.rows.replace(/_/g, ' ')}\"\n\t\t\t>\n\t\t\t\t<slot name=\"header\"></slot>\n\t\t\t\t<schmancy-scroll ?hide=${!this.showScrollbar}><slot></slot></schmancy-scroll>\n\t\t\t\t<schmancy-scroll ?hide=${!this.showScrollbar}>\n\t\t\t\t\t<slot name=\"footer\"></slot>\n\t\t\t\t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A;GACb,SAAS,IAAe,IAAI;GAAA,EAAA,EAE7B,GAAsB,GAAG,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,QAAA,EACxE,GAAA,EAAO,QAAA,GAAQ,SAAA,QAAc,KAAK,YAAY,GAAQ,EAAA,CAAA,EACtD,EAAU,KAAK,qBAAA,CAAA,CACd,WAAA;;CAGH,oBAAA;EACC,MAAM,mBAAA,EAEN,KAAK,iBAAiB,kBAAA,CAAmB,SAAQ,MAAM,EAAG,aAAa,QAAQ,SAAA,CAAA,EAC/E,KAAK,iBAAiB,kBAAA,CAAmB,SAAQ,MAAM,EAAG,aAAa,QAAQ,SAAA,CAAA,EAE/E,KAAK,mBAAA;;CAGN,uBAAA;EACC,MAAM,sBAAA,EACN,KAAK,qBAAqB,MAAA;;CAG3B,SAAA;EACC,OAAO,CAAI;;YAED,KAAK,SAAS;GACrB,+BAAA,CAA+B;GAC/B,eAAe,KAAK;GAAA,CAAA,CAAA;iCAEQ,KAAK,KAAK,QAAQ,MAAM,IAAA,CAAA;;;8BAG3B,KAAK,cAAA;8BACL,KAAK,cAAA;;;;;;;GAtFjC,EAAS,EAAE,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,QAAA,KAAA,EAAA,EAAA,EAAA,CAG1B,EAAS;CAAE,MAAM;CAAS,WAAW;CAAA,CAAA,CAAA,EAAmB,EAAA,WAAA,iBAAA,KAAA,EAAA,EAAA,EAAA,CAGxD,EAAS;CAAE,MAAM;CAAS,WAAW;CAAA,CAAA,CAAA,EAAc,EAAA,WAAA,YAAA,KAAA,EAAA,EAAA,IAAA,EAAA,CAnBpD,EAAc,gBAAA,CAAA,EAAgB,EAAA;AAAA,SAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-
|
|
1
|
+
{"version":3,"file":"progress-C9Y2D5cm.js","names":[],"sources":["../src/progress/progress.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { styleMap } from 'lit/directives/style-map.js'\n\n@customElement('schmancy-progress')\nexport default class SchmancyProgress extends SchmancyElement {\n static styles = [css`\n :host {\n display: block;\n }\n\n /* Blackbird-style indeterminate animation with organic easing */\n @keyframes indeterminate {\n 0% {\n left: -30%;\n width: 20%;\n opacity: 0.6;\n }\n 25% {\n width: 35%;\n opacity: 1;\n }\n 50% {\n left: 40%;\n width: 30%;\n }\n 75% {\n width: 25%;\n opacity: 0.9;\n }\n 100% {\n left: 100%;\n width: 20%;\n opacity: 0.6;\n }\n }\n\n .indeterminate-animation {\n animation: indeterminate 1.8s cubic-bezier(0.34, 1.2, 0.64, 1) infinite;\n }\n`]\n\n @property({ type: Number, reflect: true })\n value = 0\n\n @property({ type: Number, reflect: true })\n max = 100\n\n @property({ type: Boolean, reflect: true })\n indeterminate = false\n\n // M3 aligned track heights: xs=1px, sm=2px, md=4px, lg=8px\n @property({ type: String, reflect: true })\n size: 'xs' | 'sm' | 'md' | 'lg' = 'md'\n\n @property({ type: String, reflect: true })\n color: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' = 'primary'\n\n @property({ type: Boolean, reflect: true })\n glass = false\n\n private get percentage(): number {\n if (this.indeterminate) return 0\n return Math.min(100, Math.max(0, (this.value / this.max) * 100))\n }\n\n protected render() {\n const containerClasses = {\n 'w-full': true,\n 'relative': true,\n 'overflow-hidden': true,\n 'rounded-full': true,\n 'h-px': this.size === 'xs', // 1px - M3 linear indicator track\n 'h-0.5': this.size === 'sm', // 2px\n 'h-1': this.size === 'md', // 4px - M3 default\n 'h-2': this.size === 'lg', // 8px\n // Glass effect background\n 'backdrop-blur-xl': this.glass,\n 'backdrop-saturate-150': this.glass,\n 'bg-surface-container/20': this.glass && !this.indeterminate,\n 'bg-surface-container': !this.glass,\n 'shadow-[inset_0_1px_2px_0_rgba(0,0,0,0.1)]': this.glass,\n 'border': this.glass,\n 'border-outline/20': this.glass\n }\n\n const barClasses = {\n 'h-full': true,\n 'rounded-full': true,\n 'transition-all': true,\n 'duration-300': true,\n 'ease-in-out': true,\n 'relative': true,\n 'bg-primary-default': this.color === 'primary' && !this.glass,\n 'bg-secondary-default': this.color === 'secondary' && !this.glass,\n 'bg-tertiary-default': this.color === 'tertiary' && !this.glass,\n 'bg-error-default': this.color === 'error' && !this.glass,\n 'bg-success-default': this.color === 'success' && !this.glass,\n 'absolute': this.indeterminate,\n 'indeterminate-animation': this.indeterminate\n }\n\n const barStyles = this.indeterminate \n ? {} \n : { width: `${this.percentage}%` }\n\n // Glass effect bar classes\n const glassBarClasses = {\n 'backdrop-blur-sm': this.glass,\n 'shadow-[0_0_20px_rgba(0,0,0,0.1)]': this.glass,\n // Use semi-transparent background colors for glass effect\n 'bg-primary-default/70': this.glass && this.color === 'primary',\n 'bg-secondary-default/70': this.glass && this.color === 'secondary',\n 'bg-tertiary-default/70': this.glass && this.color === 'tertiary',\n 'bg-error-default/70': this.glass && this.color === 'error',\n 'bg-success-default/70': this.glass && this.color === 'success',\n }\n\n return html`\n <div class=\"${classMap(containerClasses)}\">\n <div \n class=\"${classMap({...barClasses, ...glassBarClasses})}\"\n style=\"${styleMap(barStyles)}\"\n role=\"progressbar\"\n aria-valuenow=\"${this.value}\"\n aria-valuemin=\"0\"\n aria-valuemax=\"${this.max}\"\n >\n ${this.glass ? html`\n <!-- Glass shine effect -->\n <div class=\"absolute inset-0 bg-linear-to-b from-surface-on/20 to-transparent rounded-full\"></div>\n ` : ''}\n </div>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'schmancy-progress': SchmancyProgress\n }\n}\n"],"mappings":";;;;;;AAOe,IAAA,IAAA,cAA+B,EAAA;CAAA,YAAA,GAAA,GAAA;EAAA,MAAA,GAAA,EAAA,EAAA,KAAA,QAsCpC,GAAA,KAAA,MAGF,KAAA,KAAA,gBAAA,CAGU,GAAA,KAAA,OAIkB,MAAA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GACxD,0BAA0B,KAAK,SAAS,KAAK,UAAU;GACvD,uBAAuB,KAAK,SAAS,KAAK,UAAU;GACpD,yBAAyB,KAAK,SAAS,KAAK,UAAU;GAAV;EAG9C,OAAO,CAAI;oBACK,EAAS,EAAA,CAAA;;mBAEV,EAAS;GAAA,GAAI;GAAA,GAAe;GAAA,CAAA,CAAA;mBAC5B,EAAS,EAAA,CAAA;;2BAED,KAAK,MAAA;;2BAEL,KAAK,IAAA;;YAEpB,KAAK,QAAQ,CAAI;;;cAGf,GAAA;;;;;;GAzFX,EAAS;CAAE,MAAM;CAAQ,SAAA,CAAS;CAAA,CAAA,CAAA,EAAO,EAAA,WAAA,SAAA,KAAA,EAAA,EAAA,EAAA,CAGzC,EAAS;CAAE,MAAM;CAAQ,SAAA,CAAS;CAAA,CAAA,CAAA,EAAO,EAAA,WAAA,OAAA,KAAA,EAAA,EAAA,EAAA,CAGzC,EAAS;CAAE,MAAM;CAAS,SAAA,CAAS;CAAA,CAAA,CAAA,EAAO,EAAA,WAAA,iBAAA,KAAA,EAAA,EAAA,EAAA,CAI1C,EAAS;CAAE,MAAM;CAAQ,SAAA,CAAS;CAAA,CAAA,CAAA,EAAO,EAAA,WAAA,QAAA,KAAA,EAAA,EAAA,EAAA,CAGzC,EAAS;CAAE,MAAM;CAAQ,SAAA,CAAS;CAAA,CAAA,CAAA,EAAO,EAAA,WAAA,SAAA,KAAA,EAAA,EAAA,EAAA,CAGzC,EAAS;CAAE,MAAM;CAAS,SAAA,CAAS;CAAA,CAAA,CAAA,EAAO,EAAA,WAAA,SAAA,KAAA,EAAA,EAAA,IAAA,EAAA,CAtD5C,EAAc,oBAAA,CAAA,EAAoB,EAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-
|
|
1
|
+
{"version":3,"file":"progress-DiVTGAXa.cjs","names":[],"sources":["../src/progress/progress.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { styleMap } from 'lit/directives/style-map.js'\n\n@customElement('schmancy-progress')\nexport default class SchmancyProgress extends SchmancyElement {\n static styles = [css`\n :host {\n display: block;\n }\n\n /* Blackbird-style indeterminate animation with organic easing */\n @keyframes indeterminate {\n 0% {\n left: -30%;\n width: 20%;\n opacity: 0.6;\n }\n 25% {\n width: 35%;\n opacity: 1;\n }\n 50% {\n left: 40%;\n width: 30%;\n }\n 75% {\n width: 25%;\n opacity: 0.9;\n }\n 100% {\n left: 100%;\n width: 20%;\n opacity: 0.6;\n }\n }\n\n .indeterminate-animation {\n animation: indeterminate 1.8s cubic-bezier(0.34, 1.2, 0.64, 1) infinite;\n }\n`]\n\n @property({ type: Number, reflect: true })\n value = 0\n\n @property({ type: Number, reflect: true })\n max = 100\n\n @property({ type: Boolean, reflect: true })\n indeterminate = false\n\n // M3 aligned track heights: xs=1px, sm=2px, md=4px, lg=8px\n @property({ type: String, reflect: true })\n size: 'xs' | 'sm' | 'md' | 'lg' = 'md'\n\n @property({ type: String, reflect: true })\n color: 'primary' | 'secondary' | 'tertiary' | 'error' | 'success' = 'primary'\n\n @property({ type: Boolean, reflect: true })\n glass = false\n\n private get percentage(): number {\n if (this.indeterminate) return 0\n return Math.min(100, Math.max(0, (this.value / this.max) * 100))\n }\n\n protected render() {\n const containerClasses = {\n 'w-full': true,\n 'relative': true,\n 'overflow-hidden': true,\n 'rounded-full': true,\n 'h-px': this.size === 'xs', // 1px - M3 linear indicator track\n 'h-0.5': this.size === 'sm', // 2px\n 'h-1': this.size === 'md', // 4px - M3 default\n 'h-2': this.size === 'lg', // 8px\n // Glass effect background\n 'backdrop-blur-xl': this.glass,\n 'backdrop-saturate-150': this.glass,\n 'bg-surface-container/20': this.glass && !this.indeterminate,\n 'bg-surface-container': !this.glass,\n 'shadow-[inset_0_1px_2px_0_rgba(0,0,0,0.1)]': this.glass,\n 'border': this.glass,\n 'border-outline/20': this.glass\n }\n\n const barClasses = {\n 'h-full': true,\n 'rounded-full': true,\n 'transition-all': true,\n 'duration-300': true,\n 'ease-in-out': true,\n 'relative': true,\n 'bg-primary-default': this.color === 'primary' && !this.glass,\n 'bg-secondary-default': this.color === 'secondary' && !this.glass,\n 'bg-tertiary-default': this.color === 'tertiary' && !this.glass,\n 'bg-error-default': this.color === 'error' && !this.glass,\n 'bg-success-default': this.color === 'success' && !this.glass,\n 'absolute': this.indeterminate,\n 'indeterminate-animation': this.indeterminate\n }\n\n const barStyles = this.indeterminate \n ? {} \n : { width: `${this.percentage}%` }\n\n // Glass effect bar classes\n const glassBarClasses = {\n 'backdrop-blur-sm': this.glass,\n 'shadow-[0_0_20px_rgba(0,0,0,0.1)]': this.glass,\n // Use semi-transparent background colors for glass effect\n 'bg-primary-default/70': this.glass && this.color === 'primary',\n 'bg-secondary-default/70': this.glass && this.color === 'secondary',\n 'bg-tertiary-default/70': this.glass && this.color === 'tertiary',\n 'bg-error-default/70': this.glass && this.color === 'error',\n 'bg-success-default/70': this.glass && this.color === 'success',\n }\n\n return html`\n <div class=\"${classMap(containerClasses)}\">\n <div \n class=\"${classMap({...barClasses, ...glassBarClasses})}\"\n style=\"${styleMap(barStyles)}\"\n role=\"progressbar\"\n aria-valuenow=\"${this.value}\"\n aria-valuemin=\"0\"\n aria-valuemax=\"${this.max}\"\n >\n ${this.glass ? html`\n <!-- Glass shine effect -->\n <div class=\"absolute inset-0 bg-linear-to-b from-surface-on/20 to-transparent rounded-full\"></div>\n ` : ''}\n </div>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'schmancy-progress': SchmancyProgress\n }\n}\n"],"mappings":"uPAOe,IAAA,EAAA,cAA+B,EAAA,CAAA,CAAA,YAAA,GAAA,EAAA,CAAA,MAAA,GAAA,EAAA,CAAA,KAAA,MAsCpC,EAAA,KAAA,IAGF,IAAA,KAAA,cAAA,CAGU,EAAA,KAAA,KAIkB,KAAA,KAAA,MAGkC,UAAA,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CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import "./progress-
|
|
1
|
+
import "./progress-C9Y2D5cm.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-
|
|
1
|
+
{"version":3,"file":"radio-group-CAzjBI2n.js","names":[],"sources":["../src/form/fields/radio-group/radio-group.scss?inline","../src/form/fields/radio-group/radio-group.ts","../src/form/fields/radio-group/radio-button.ts"],"sourcesContent":[":host {\n\tdisplay: inherit;\n\tposition: inherit;\n}\n","import { html, unsafeCSS } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { Subject, fromEvent, takeUntil } from 'rxjs'\nimport style from './radio-group.scss?inline'\nimport { SchmancyElement } from '@mixins/index'\nimport { when } from 'lit/directives/when.js'\nimport { FormFieldMixin } from '@mixins/formField.mixin'\n\nexport type SchmancyRadioGroupOption = {\n\tlabel: string\n\tvalue: string\n}\nexport type SchmancyRadioGroupChangeEvent = CustomEvent<{\n\tvalue: string\n}>\n@customElement('schmancy-radio-group')\nexport class RadioGroup extends FormFieldMixin(SchmancyElement) {\n\tstatic styles = [unsafeCSS(style)];\n\t@property({ type: String }) override label = ''\n\t@property({ type: String }) override name = ''\n\t@property({ type: String }) override value = ''\n\t@property({ type: Array }) options: SchmancyRadioGroupOption[] = []\n\t@property({ type: Boolean }) override required: boolean = false\n\tprivate selection$ = new Subject<string>()\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.selection$.pipe(takeUntil(this.disconnecting)).subscribe(value => {\n\t\t\tthis.value = value\n\t\t\tthis.emitChange({ value })\n\t\t\t// Update all child radio buttons\n\t\t\tthis.updateChildRadioButtons()\n\t\t})\n\n\t\t// Listen for radio button clicks from children\n\t\tfromEvent<CustomEvent>(this, 'radio-button-click')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe((e: CustomEvent) => {\n\t\t\t\tthis.selection$.next(e.detail.value)\n\t\t\t})\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\t// Subscriptions are automatically cleaned up via takeUntil(this.disconnecting)\n\t\tthis.selection$?.complete()\n\t}\n\t\n\tprivate handleSelection(value: string) {\n\t\tthis.selection$.next(value)\n\t}\n\t\n\tprivate updateChildRadioButtons() {\n\t\t// Update child radio buttons checked state\n\t\tconst radioButtons = this.querySelectorAll('schmancy-radio-button')\n\t\tradioButtons.forEach(button => {\n\t\t\tconst buttonValue = button.getAttribute('value')\n\t\t\tif (buttonValue === this.value) {\n\t\t\t\tbutton.setAttribute('checked', '')\n\t\t\t} else {\n\t\t\t\tbutton.removeAttribute('checked')\n\t\t\t}\n\t\t})\n\t}\n\t\n\t// For backwards compatibility with direct option setting\n\tupdated(changedProperties: Map<string, unknown>) {\n\t\tsuper.updated(changedProperties)\n\t\tif (changedProperties.has('value')) {\n\t\t\tthis.updateChildRadioButtons()\n\t\t}\n\t}\n\n\trender() {\n\t\t// Check if we have any slotted radio buttons\n\t\tconst hasSlottedContent = this.childElementCount > 0\n\t\t\n\t\treturn html`\n\t\t\t<div class=\"grid gap-4\">\n\t\t\t\t${when(this.label, () => html` <label class=\"text-base font-semibold text-surface-on\">${this.label}</label> `)}\n\t\t\t\t\n\t\t\t\t${hasSlottedContent ? \n\t\t\t\t\thtml`<slot></slot>` :\n\t\t\t\t\tthis.options?.map(option => html`\n\t\t\t\t\t\t<div class=\"flex items-center\">\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t.required=${this.required}\n\t\t\t\t\t\t\t\tid=${option.value}\n\t\t\t\t\t\t\t\tclass=\"h-4 w-4 border-outline text-primary-default focus:ring-primary-default\"\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tname=${this.name}\n\t\t\t\t\t\t\t\t.value=${option.value}\n\t\t\t\t\t\t\t\t.checked=${option.value === this.value}\n\t\t\t\t\t\t\t\t@change=${() => this.handleSelection(option.value)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<label for=${option.value} class=\"ml-3 block text-sm font-medium leading-6 text-surface-on\">\n\t\t\t\t\t\t\t\t${option.label || option.value}\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`)\n\t\t\t\t}\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-radio-group': RadioGroup\n\t}\n}\n","import { SchmancyElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { FormFieldMixin } from '@mixins/formField.mixin'\nimport { fromEvent, takeUntil } from 'rxjs'\n\n/**\n * Radio button component for use within radio groups.\n *\n * @prop {string} name - Name attribute for grouping radio buttons\n * @prop {string} value - Value of this radio button\n * @prop {boolean} checked - Whether the radio button is selected\n * @prop {boolean} disabled - Whether the radio button is disabled\n */\n@customElement('schmancy-radio-button')\nexport class RadioButton extends FormFieldMixin(SchmancyElement) {\n\t@property({ type: String }) override value = ''\n\t@property({ type: Boolean, reflect: true }) checked = false\n\t@property({ type: Boolean }) override disabled = false\n\t@property({ type: String }) override name = ''\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\t// Listen for click events\n\t\tfromEvent<MouseEvent>(this, 'click')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(this.handleClick)\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\t// Event listeners are automatically cleaned up via takeUntil(this.disconnecting)\n\t}\n\n\tprivate handleClick() {\n\t\tif (this.disabled) return\n\n\t\t// Find parent radio-group if exists\n\t\tconst radioGroup = this.closest('schmancy-radio-group')\n\t\tif (radioGroup) {\n\t\t\t// Let the radio-group handle the change\n\t\t\tconst event = new CustomEvent('radio-button-click', {\n\t\t\t\tdetail: { value: this.value },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t})\n\t\t\tthis.dispatchEvent(event)\n\t\t} else {\n\t\t\t// Standalone usage\n\t\t\tthis.checked = true\n\t\t\tthis.emitChange({ value: this.value })\n\t\t}\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<label class=\"relative flex items-start cursor-pointer\">\n\t\t\t\t<div class=\"flex items-center h-6\">\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\tclass=\"h-4 w-4 text-primary-default focus:ring-primary-container border-outline\"\n\t\t\t\t\t\t.value=${this.value}\n\t\t\t\t\t\t.checked=${this.checked}\n\t\t\t\t\t\t.disabled=${this.disabled}\n\t\t\t\t\t\t.name=${this.name}\n\t\t\t\t\t\t@change=${() => {}}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"ml-3\">\n\t\t\t\t\t<slot name=\"label\"></slot>\n\t\t\t\t</div>\n\t\t\t</label>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-radio-button': RadioButton\n\t}\n}\n"],"mappings":";;;;;;ICgBO,IAAA,cAAyB,EAAe,EAAA,CAAA;CAAA,YAAA,GAAA,GAAA;EAAA,MAAA,GAAA,EAAA,EAAA,KAAA,QAED,IAAA,KAAA,OACD,IAAA,KAAA,QACC,IAAA,KAAA,UACoB,EAAA,EAAA,KAAA,WAAA,CACP,GAAA,KAAA,aACrC,IAAI,GAAA;;CAAA;EAAA,KAAA,SANT,CAAC,EAAA,0CAAA,CAAA;;CAQjB,oBAAA;EACC,MAAM,mBAAA,EACN,KAAK,WAAW,KAAK,EAAU,KAAK,cAAA,CAAA,CAAgB,WAAU,MAAA;GAC7D,KAAK,QAAQ,GACb,KAAK,WAAW,EAAE,OAAA,GAAA,CAAA,EAElB,KAAK,yBAAA;IAAA,EAIN,EAAuB,MAAM,qBAAA,CAC3B,KAAK,EAAU,KAAK,cAAA,CAAA,CACpB,WAAW,MAAA;GACX,KAAK,WAAW,KAAK,EAAE,OAAO,MAAA;IAAA;;CAIjC,uBAAA;EACC,MAAM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|
|
1
|
-
{"version":3,"file":"radio-group-
|
|
1
|
+
{"version":3,"file":"radio-group-DIRJyYv6.cjs","names":[],"sources":["../src/form/fields/radio-group/radio-group.scss?inline","../src/form/fields/radio-group/radio-group.ts","../src/form/fields/radio-group/radio-button.ts"],"sourcesContent":[":host {\n\tdisplay: inherit;\n\tposition: inherit;\n}\n","import { html, unsafeCSS } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { Subject, fromEvent, takeUntil } from 'rxjs'\nimport style from './radio-group.scss?inline'\nimport { SchmancyElement } from '@mixins/index'\nimport { when } from 'lit/directives/when.js'\nimport { FormFieldMixin } from '@mixins/formField.mixin'\n\nexport type SchmancyRadioGroupOption = {\n\tlabel: string\n\tvalue: string\n}\nexport type SchmancyRadioGroupChangeEvent = CustomEvent<{\n\tvalue: string\n}>\n@customElement('schmancy-radio-group')\nexport class RadioGroup extends FormFieldMixin(SchmancyElement) {\n\tstatic styles = [unsafeCSS(style)];\n\t@property({ type: String }) override label = ''\n\t@property({ type: String }) override name = ''\n\t@property({ type: String }) override value = ''\n\t@property({ type: Array }) options: SchmancyRadioGroupOption[] = []\n\t@property({ type: Boolean }) override required: boolean = false\n\tprivate selection$ = new Subject<string>()\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.selection$.pipe(takeUntil(this.disconnecting)).subscribe(value => {\n\t\t\tthis.value = value\n\t\t\tthis.emitChange({ value })\n\t\t\t// Update all child radio buttons\n\t\t\tthis.updateChildRadioButtons()\n\t\t})\n\n\t\t// Listen for radio button clicks from children\n\t\tfromEvent<CustomEvent>(this, 'radio-button-click')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe((e: CustomEvent) => {\n\t\t\t\tthis.selection$.next(e.detail.value)\n\t\t\t})\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\t// Subscriptions are automatically cleaned up via takeUntil(this.disconnecting)\n\t\tthis.selection$?.complete()\n\t}\n\t\n\tprivate handleSelection(value: string) {\n\t\tthis.selection$.next(value)\n\t}\n\t\n\tprivate updateChildRadioButtons() {\n\t\t// Update child radio buttons checked state\n\t\tconst radioButtons = this.querySelectorAll('schmancy-radio-button')\n\t\tradioButtons.forEach(button => {\n\t\t\tconst buttonValue = button.getAttribute('value')\n\t\t\tif (buttonValue === this.value) {\n\t\t\t\tbutton.setAttribute('checked', '')\n\t\t\t} else {\n\t\t\t\tbutton.removeAttribute('checked')\n\t\t\t}\n\t\t})\n\t}\n\t\n\t// For backwards compatibility with direct option setting\n\tupdated(changedProperties: Map<string, unknown>) {\n\t\tsuper.updated(changedProperties)\n\t\tif (changedProperties.has('value')) {\n\t\t\tthis.updateChildRadioButtons()\n\t\t}\n\t}\n\n\trender() {\n\t\t// Check if we have any slotted radio buttons\n\t\tconst hasSlottedContent = this.childElementCount > 0\n\t\t\n\t\treturn html`\n\t\t\t<div class=\"grid gap-4\">\n\t\t\t\t${when(this.label, () => html` <label class=\"text-base font-semibold text-surface-on\">${this.label}</label> `)}\n\t\t\t\t\n\t\t\t\t${hasSlottedContent ? \n\t\t\t\t\thtml`<slot></slot>` :\n\t\t\t\t\tthis.options?.map(option => html`\n\t\t\t\t\t\t<div class=\"flex items-center\">\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t.required=${this.required}\n\t\t\t\t\t\t\t\tid=${option.value}\n\t\t\t\t\t\t\t\tclass=\"h-4 w-4 border-outline text-primary-default focus:ring-primary-default\"\n\t\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\t\tname=${this.name}\n\t\t\t\t\t\t\t\t.value=${option.value}\n\t\t\t\t\t\t\t\t.checked=${option.value === this.value}\n\t\t\t\t\t\t\t\t@change=${() => this.handleSelection(option.value)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<label for=${option.value} class=\"ml-3 block text-sm font-medium leading-6 text-surface-on\">\n\t\t\t\t\t\t\t\t${option.label || option.value}\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`)\n\t\t\t\t}\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-radio-group': RadioGroup\n\t}\n}\n","import { SchmancyElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { FormFieldMixin } from '@mixins/formField.mixin'\nimport { fromEvent, takeUntil } from 'rxjs'\n\n/**\n * Radio button component for use within radio groups.\n *\n * @prop {string} name - Name attribute for grouping radio buttons\n * @prop {string} value - Value of this radio button\n * @prop {boolean} checked - Whether the radio button is selected\n * @prop {boolean} disabled - Whether the radio button is disabled\n */\n@customElement('schmancy-radio-button')\nexport class RadioButton extends FormFieldMixin(SchmancyElement) {\n\t@property({ type: String }) override value = ''\n\t@property({ type: Boolean, reflect: true }) checked = false\n\t@property({ type: Boolean }) override disabled = false\n\t@property({ type: String }) override name = ''\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\t// Listen for click events\n\t\tfromEvent<MouseEvent>(this, 'click')\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe(this.handleClick)\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\t// Event listeners are automatically cleaned up via takeUntil(this.disconnecting)\n\t}\n\n\tprivate handleClick() {\n\t\tif (this.disabled) return\n\n\t\t// Find parent radio-group if exists\n\t\tconst radioGroup = this.closest('schmancy-radio-group')\n\t\tif (radioGroup) {\n\t\t\t// Let the radio-group handle the change\n\t\t\tconst event = new CustomEvent('radio-button-click', {\n\t\t\t\tdetail: { value: this.value },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t})\n\t\t\tthis.dispatchEvent(event)\n\t\t} else {\n\t\t\t// Standalone usage\n\t\t\tthis.checked = true\n\t\t\tthis.emitChange({ value: this.value })\n\t\t}\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<label class=\"relative flex items-start cursor-pointer\">\n\t\t\t\t<div class=\"flex items-center h-6\">\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\tclass=\"h-4 w-4 text-primary-default focus:ring-primary-container border-outline\"\n\t\t\t\t\t\t.value=${this.value}\n\t\t\t\t\t\t.checked=${this.checked}\n\t\t\t\t\t\t.disabled=${this.disabled}\n\t\t\t\t\t\t.name=${this.name}\n\t\t\t\t\t\t@change=${() => {}}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"ml-3\">\n\t\t\t\t\t<slot name=\"label\"></slot>\n\t\t\t\t</div>\n\t\t\t</label>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-radio-button': RadioButton\n\t}\n}\n"],"mappings":"+NCgBO,EAAA,cAAyB,EAAA,EAAe,EAAA,EAAA,AAAA,CAAA,YAAA,GAAA,EAAA,CAAA,MAAA,GAAA,EAAA,CAAA,KAAA,MAED,GAAA,KAAA,KACD,GAAA,KAAA,MACC,GAAA,KAAA,QACoB,EAAA,CAAA,KAAA,SAAA,CACP,EAAA,KAAA,WACrC,IAAI,EAAA,QAAA,OAAA,KAAA,OANT,EAAA,EAAA,EAAA,WAAA,0CAAA,CAAA,CAQhB,mBAAA,CACC,MAAM,mBAAA,CACN,KAAK,WAAW,MAAA,EAAA,EAAA,WAAe,KAAK,cAAA,CAAA,CAAgB,UAAU,GAAA,CAC7D,KAAK,MAAQ,EACb,KAAK,WAAW,CAAE,MAAA,EAAA,CAAA,CAElB,KAAK,yBAAA,EAAA,EAIN,EAAA,EAAA,WAAuB,KAAM,qBAAA,CAC3B,MAAA,EAAA,EAAA,WAAe,KAAK,cAAA,CAAA,CACpB,UAAW,GAAA,CACX,KAAK,WAAW,KAAK,EAAE,OAAO,MAAA,EAAA,CAIjC,sBAAA,CACC,MAAM,sBAAA,CAEN,KAAK,YAAY,UAAA,CAGlB,gBAAwB,E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A,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eALb,wBAAA,CAAA,CAAwB,EAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA"}
|
package/dist/radio-group.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./radio-group-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./radio-group-DIRJyYv6.cjs`);Object.defineProperty(exports,`RadioButton`,{enumerable:!0,get:function(){return e.t}}),Object.defineProperty(exports,`RadioGroup`,{enumerable:!0,get:function(){return e.n}});
|
package/dist/radio-group.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./radio-group-
|
|
1
|
+
import { n as e, t } from "./radio-group-CAzjBI2n.js";
|
|
2
2
|
export { t as RadioButton, e as RadioGroup };
|
package/dist/range.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range.js","names":[],"sources":["../src/form/fields/range/range.ts"],"sourcesContent":["import { css, html, type PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { SchmancyFormField } from '@mixins/index'\n\nexport type SchmancyRangeChangeEvent = CustomEvent<{ value: number }>\n\n/**\n * @element schmancy-range\n * Range input (numeric slider).\n * @fires change - Fires on value change with `{ value: number }`.\n */\n@customElement('schmancy-range')\nexport class SchmancyRange extends SchmancyFormField(css`\n\tinput[type='range'] {\n\t\t-webkit-appearance: none;\n\t\tappearance: none;\n\t\twidth: 100%;\n\t\theight: 4px;\n\t\tborder-radius: 2px;\n\t\tbackground: linear-gradient(\n\t\t\tto right,\n\t\t\tvar(--color-primary, #6750a4) 0%,\n\t\t\tvar(--color-primary, #6750a4) var(--range-progress, 0%),\n\t\t\tcolor-mix(in srgb, var(--color-primary, #6750a4) 30%, transparent) var(--range-progress, 0%),\n\t\t\tcolor-mix(in srgb, var(--color-primary, #6750a4) 30%, transparent) 100%\n\t\t);\n\t\toutline: none;\n\t\tcursor: pointer;\n\t}\n\tinput[type='range']:disabled {\n\t\topacity: 0.38;\n\t\tcursor: not-allowed;\n\t}\n\tinput[type='range']::-webkit-slider-thumb {\n\t\t-webkit-appearance: none;\n\t\tappearance: none;\n\t\twidth: 20px;\n\t\theight: 20px;\n\t\tborder-radius: 50%;\n\t\tbackground: var(--color-primary, #6750a4);\n\t\tcursor: pointer;\n\t\ttransition: box-shadow 0.1s ease;\n\t}\n\tinput[type='range']::-webkit-slider-thumb:hover {\n\t\tbox-shadow: 0 0 0 8px color-mix(in srgb, var(--color-primary, #6750a4) 12%, transparent);\n\t}\n\tinput[type='range']::-moz-range-thumb {\n\t\twidth: 20px;\n\t\theight: 20px;\n\t\tborder-radius: 50%;\n\t\tborder: none;\n\t\tbackground: var(--color-primary, #6750a4);\n\t\tcursor: pointer;\n\t}\n`) {\n\t// `formAssociated`, `internals`, `name`, `disabled`, `required`, `id`,\n\t// `label`, `error`, `validationMessage`, `validateOn`, touched/dirty/submitted,\n\t// `markTouched/markSubmitted`, `formResetCallback`, FIELD_CONNECT_EVENT\n\t// dispatch — all from the mixin.\n\n\t@property({ type: Number }) min: number = 0\n\t@property({ type: Number }) max: number = 1\n\t@property({ type: Number }) step: number = 0.01\n\n\t/** Numeric value — narrowed override of the mixin's wide value union. */\n\t@property({ type: Number, reflect: true })\n\toverride value: number = 0\n\n\tprivate get progress(): string {\n\t\treturn `${((this.value - this.min) / (this.max - this.min)) * 100}%`\n\t}\n\n\toverride willUpdate(changed: PropertyValues): void {\n\t\tsuper.willUpdate(changed)\n\t\tif (changed.has('value') || changed.has('name')) {\n\t\t\tthis.internals?.setFormValue(String(this.value))\n\t\t}\n\t}\n\n\t/** FormData contributes the value as a string (native range input convention). */\n\toverride toFormEntries(): Array<[string, FormDataEntryValue]> {\n\t\tif (!this.name || this.disabled) return []\n\t\treturn [[this.name, String(this.value)]]\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"flex flex-col gap-1 w-full\">\n\t\t\t\t${when(\n\t\t\t\t\tthis.label,\n\t\t\t\t\t() => html`\n\t\t\t\t\t\t<div class=\"flex justify-between items-center\">\n\t\t\t\t\t\t\t<schmancy-typography type=\"label\" token=\"sm\" class=\"text-surface-on\">${this.label}</schmancy-typography>\n\t\t\t\t\t\t\t<schmancy-typography type=\"label\" token=\"sm\" class=\"text-surface-on opacity-60\">${this.value}</schmancy-typography>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t)}\n\t\t\t\t<input\n\t\t\t\t\ttype=\"range\"\n\t\t\t\t\t.min=${String(this.min)}\n\t\t\t\t\t.max=${String(this.max)}\n\t\t\t\t\t.step=${String(this.step)}\n\t\t\t\t\t.value=${String(this.value)}\n\t\t\t\t\t?disabled=${this.disabled}\n\t\t\t\t\taria-label=${this.label || 'Range'}\n\t\t\t\t\taria-valuetext=${String(this.value)}\n\t\t\t\t\tstyle=\"--range-progress: ${this.progress}\"\n\t\t\t\t\t@input=${(e: Event) => {\n\t\t\t\t\t\tthis.value = Number((e.target as HTMLInputElement).value)\n\t\t\t\t\t\tthis.markTouched()\n\t\t\t\t\t\tthis.emitChange({ value: this.value })\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-range': SchmancyRange\n\t}\n}\n"],"mappings":";;;;;AAaO,IAAA,IAAA,cAA4B,EAAkB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAgDb,GAAA,KAAA,MACA,GAAA,KAAA,OACC,KAAA,KAAA,QAIlB;;CAEzB,IAAA,WAAY;
|
|
1
|
+
{"version":3,"file":"range.js","names":[],"sources":["../src/form/fields/range/range.ts"],"sourcesContent":["import { css, html, type PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { when } from 'lit/directives/when.js'\nimport { SchmancyFormField } from '@mixins/index'\n\nexport type SchmancyRangeChangeEvent = CustomEvent<{ value: number }>\n\n/**\n * @element schmancy-range\n * Range input (numeric slider).\n * @fires change - Fires on value change with `{ value: number }`.\n */\n@customElement('schmancy-range')\nexport class SchmancyRange extends SchmancyFormField(css`\n\tinput[type='range'] {\n\t\t-webkit-appearance: none;\n\t\tappearance: none;\n\t\twidth: 100%;\n\t\theight: 4px;\n\t\tborder-radius: 2px;\n\t\tbackground: linear-gradient(\n\t\t\tto right,\n\t\t\tvar(--color-primary, #6750a4) 0%,\n\t\t\tvar(--color-primary, #6750a4) var(--range-progress, 0%),\n\t\t\tcolor-mix(in srgb, var(--color-primary, #6750a4) 30%, transparent) var(--range-progress, 0%),\n\t\t\tcolor-mix(in srgb, var(--color-primary, #6750a4) 30%, transparent) 100%\n\t\t);\n\t\toutline: none;\n\t\tcursor: pointer;\n\t}\n\tinput[type='range']:disabled {\n\t\topacity: 0.38;\n\t\tcursor: not-allowed;\n\t}\n\tinput[type='range']::-webkit-slider-thumb {\n\t\t-webkit-appearance: none;\n\t\tappearance: none;\n\t\twidth: 20px;\n\t\theight: 20px;\n\t\tborder-radius: 50%;\n\t\tbackground: var(--color-primary, #6750a4);\n\t\tcursor: pointer;\n\t\ttransition: box-shadow 0.1s ease;\n\t}\n\tinput[type='range']::-webkit-slider-thumb:hover {\n\t\tbox-shadow: 0 0 0 8px color-mix(in srgb, var(--color-primary, #6750a4) 12%, transparent);\n\t}\n\tinput[type='range']::-moz-range-thumb {\n\t\twidth: 20px;\n\t\theight: 20px;\n\t\tborder-radius: 50%;\n\t\tborder: none;\n\t\tbackground: var(--color-primary, #6750a4);\n\t\tcursor: pointer;\n\t}\n`) {\n\t// `formAssociated`, `internals`, `name`, `disabled`, `required`, `id`,\n\t// `label`, `error`, `validationMessage`, `validateOn`, touched/dirty/submitted,\n\t// `markTouched/markSubmitted`, `formResetCallback`, FIELD_CONNECT_EVENT\n\t// dispatch — all from the mixin.\n\n\t@property({ type: Number }) min: number = 0\n\t@property({ type: Number }) max: number = 1\n\t@property({ type: Number }) step: number = 0.01\n\n\t/** Numeric value — narrowed override of the mixin's wide value union. */\n\t@property({ type: Number, reflect: true })\n\toverride value: number = 0\n\n\tprivate get progress(): string {\n\t\treturn `${((this.value - this.min) / (this.max - this.min)) * 100}%`\n\t}\n\n\toverride willUpdate(changed: PropertyValues): void {\n\t\tsuper.willUpdate(changed)\n\t\tif (changed.has('value') || changed.has('name')) {\n\t\t\tthis.internals?.setFormValue(String(this.value))\n\t\t}\n\t}\n\n\t/** FormData contributes the value as a string (native range input convention). */\n\toverride toFormEntries(): Array<[string, FormDataEntryValue]> {\n\t\tif (!this.name || this.disabled) return []\n\t\treturn [[this.name, String(this.value)]]\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"flex flex-col gap-1 w-full\">\n\t\t\t\t${when(\n\t\t\t\t\tthis.label,\n\t\t\t\t\t() => html`\n\t\t\t\t\t\t<div class=\"flex justify-between items-center\">\n\t\t\t\t\t\t\t<schmancy-typography type=\"label\" token=\"sm\" class=\"text-surface-on\">${this.label}</schmancy-typography>\n\t\t\t\t\t\t\t<schmancy-typography type=\"label\" token=\"sm\" class=\"text-surface-on opacity-60\">${this.value}</schmancy-typography>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t)}\n\t\t\t\t<input\n\t\t\t\t\ttype=\"range\"\n\t\t\t\t\t.min=${String(this.min)}\n\t\t\t\t\t.max=${String(this.max)}\n\t\t\t\t\t.step=${String(this.step)}\n\t\t\t\t\t.value=${String(this.value)}\n\t\t\t\t\t?disabled=${this.disabled}\n\t\t\t\t\taria-label=${this.label || 'Range'}\n\t\t\t\t\taria-valuetext=${String(this.value)}\n\t\t\t\t\tstyle=\"--range-progress: ${this.progress}\"\n\t\t\t\t\t@input=${(e: Event) => {\n\t\t\t\t\t\tthis.value = Number((e.target as HTMLInputElement).value)\n\t\t\t\t\t\tthis.markTouched()\n\t\t\t\t\t\tthis.emitChange({ value: this.value })\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-range': SchmancyRange\n\t}\n}\n"],"mappings":";;;;;AAaO,IAAA,IAAA,cAA4B,EAAkB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAgDb,GAAA,KAAA,MACA,GAAA,KAAA,OACC,KAAA,KAAA,QAIlB;;CAEzB,IAAA,WAAY;EACX,QAAY,KAAK,QAAQ,KAAK,QAAQ,KAAK,MAAM,KAAK,OAAQ,MAAvD;;CAGR,WAAoB,GAAA;EACnB,MAAM,WAAW,EAAA,GACb,EAAQ,IAAI,QAAA,IAAY,EAAQ,IAAI,OAAA,KACvC,KAAK,WAAW,aAAa,OAAO,KAAK,MAAA,CAAA;;CAK3C,gBAAA;EACC,OAAA,CAAK,KAAK,QAAQ,KAAK,WAAiB,EAAA,GACjC,CAAC,CAAC,KAAK,MAAM,OAAO,KAAK,MAAA,CAAA,CAAA;;CAGjC,SAAA;EACC,OAAO,CAAI;;MAEP,EACD,KAAK,aACC,CAAI;;8EAE+D,KAAK,MAAA;yFACM,KAAK,MAAA;;;;;YAMlF,OAAO,KAAK,IAAA,CAAA;YACZ,OAAO,KAAK,IAAA,CAAA;aACX,OAAO,KAAK,KAAA,CAAA;cACX,OAAO,KAAK,MAAA,CAAA;iBACT,KAAK,SAAA;kBACJ,KAAK,SAAS,QAAA;sBACV,OAAO,KAAK,MAAA,CAAA;gCACF,KAAK,SAAA;eACtB,MAAA;GACT,KAAK,QAAQ,OAAQ,EAAE,OAA4B,MAAA,EACnD,KAAK,aAAA,EACL,KAAK,WAAW,EAAE,OAAO,KAAK,OAAA,CAAA;IAAA;;;;;;GAlDlC,EAAS,EAAE,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,OAAA,KAAA,EAAA,EAAA,EAAA,CAC1B,EAAS,EAAE,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,OAAA,KAAA,EAAA,EAAA,EAAA,CAC1B,EAAS,EAAE,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,QAAA,KAAA,EAAA,EAAA,EAAA,CAG1B,EAAS;CAAE,MAAM;CAAQ,SAAA,CAAS;CAAA,CAAA,CAAA,EAAO,EAAA,WAAA,SAAA,KAAA,EAAA,EAAA,IAAA,EAAA,CAtD1C,EAAc,iBAAA,CAAA,EAAiB,EAAA;AAAA,SAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reduced-motion-D7LqTUMn.js","names":[],"sources":["../src/directives/reduced-motion.ts"],"sourcesContent":["import { BehaviorSubject, fromEvent } from 'rxjs'\nimport { map, startWith } from 'rxjs/operators'\n\n/**\n * Shared reactive reduced-motion preference.\n *\n * All physics directives observe this — if the user toggles reduced motion\n * while the page is open, directives respond immediately.\n *\n * @example\n * ```ts\n * import { reducedMotion$ } from './reduced-motion'\n * if (reducedMotion$.value) return // skip animation\n * ```\n */\nconst mediaQuery = typeof window !== 'undefined'\n\t? window.matchMedia('(prefers-reduced-motion: reduce)')\n\t: undefined\n\nexport const reducedMotion$ = new BehaviorSubject<boolean>(mediaQuery?.matches ?? false)\n\n// Reactively listen for changes via RxJS\nif (mediaQuery) {\n\tfromEvent<MediaQueryListEvent>(mediaQuery, 'change').pipe(\n\t\tmap(e => e.matches),\n\t\tstartWith(mediaQuery.matches),\n\t).subscribe(matches => {\n\t\treducedMotion$.next(matches)\n\t})\n}\n"],"mappings":";;AAeA,IAAM,IAA+B,OAAX,SAAW,MAClC,OAAO,WAAW,mCAAA,GAAA,KAClB,GAEU,IAAiB,IAAI,EAAyB,GAAY,WAAA,CAAW,EAAA;AAG9E,KACH,EAA+B,GAAY,SAAA,CAAU,KACpD,GAAI,MAAK,EAAE,QAAA,EACX,EAAU,EAAW,QAAA,CAAA,CACpB,WAAU,MAAA;
|
|
1
|
+
{"version":3,"file":"reduced-motion-D7LqTUMn.js","names":[],"sources":["../src/directives/reduced-motion.ts"],"sourcesContent":["import { BehaviorSubject, fromEvent } from 'rxjs'\nimport { map, startWith } from 'rxjs/operators'\n\n/**\n * Shared reactive reduced-motion preference.\n *\n * All physics directives observe this — if the user toggles reduced motion\n * while the page is open, directives respond immediately.\n *\n * @example\n * ```ts\n * import { reducedMotion$ } from './reduced-motion'\n * if (reducedMotion$.value) return // skip animation\n * ```\n */\nconst mediaQuery = typeof window !== 'undefined'\n\t? window.matchMedia('(prefers-reduced-motion: reduce)')\n\t: undefined\n\nexport const reducedMotion$ = new BehaviorSubject<boolean>(mediaQuery?.matches ?? false)\n\n// Reactively listen for changes via RxJS\nif (mediaQuery) {\n\tfromEvent<MediaQueryListEvent>(mediaQuery, 'change').pipe(\n\t\tmap(e => e.matches),\n\t\tstartWith(mediaQuery.matches),\n\t).subscribe(matches => {\n\t\treducedMotion$.next(matches)\n\t})\n}\n"],"mappings":";;AAeA,IAAM,IAA+B,OAAX,SAAW,MAClC,OAAO,WAAW,mCAAA,GAAA,KAClB,GAEU,IAAiB,IAAI,EAAyB,GAAY,WAAA,CAAW,EAAA;AAG9E,KACH,EAA+B,GAAY,SAAA,CAAU,KACpD,GAAI,MAAK,EAAE,QAAA,EACX,EAAU,EAAW,QAAA,CAAA,CACpB,WAAU,MAAA;CACX,EAAe,KAAK,EAAA;EAAA;AAAA,SAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxjs-utils-
|
|
1
|
+
{"version":3,"file":"rxjs-utils-BKB2UM_j.cjs","names":[],"sources":["../src/rxjs-utils/mutation-observer.ts","../node_modules/ts-is-present/lib/index.js","../src/rxjs-utils/waitForElements.ts"],"sourcesContent":["import { Observable } from 'rxjs'\n\nexport const mutationObserver = (\n\ttarget: HTMLElement,\n\tconfig: MutationObserverInit = {\n\t\tattributes: true,\n\t\tchildList: true,\n\t\tsubtree: true,\n\t},\n): Observable<MutationRecord[]> => {\n\treturn new Observable(observer => {\n\t\tconst mutation = new MutationObserver(mutations => {\n\t\t\tobserver.next(mutations)\n\t\t})\n\t\tmutation.observe(target, config)\n\t\tconst unsubscribe = () => {\n\t\t\tmutation.disconnect()\n\t\t}\n\t\treturn unsubscribe\n\t})\n}\nexport default mutationObserver\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hasValueAtKey = exports.hasPresentKey = exports.isFilled = exports.isDefined = exports.isPresent = void 0;\nfunction isPresent(t) {\n return t !== undefined && t !== null;\n}\nexports.isPresent = isPresent;\nfunction isDefined(t) {\n return t !== undefined;\n}\nexports.isDefined = isDefined;\nfunction isFilled(t) {\n return t !== null;\n}\nexports.isFilled = isFilled;\n/**\n * Returns a function that can be used to filter down objects\n * to the ones that have a defined non-null value under the key `k`.\n *\n * @example\n * ```ts\n * const filesWithUrl = files.filter(file => file.url);\n * files[0].url // In this case, TS might still treat this as undefined/null\n *\n * const filesWithUrl = files.filter(hasPresentKey(\"url\"));\n * files[0].url // TS will know that this is present\n * ```\n *\n * See https://github.com/microsoft/TypeScript/issues/16069\n * why is that useful.\n */\nfunction hasPresentKey(k) {\n return function (a) {\n return a[k] !== undefined && a[k] !== null;\n };\n}\nexports.hasPresentKey = hasPresentKey;\n/**\n * Returns a function that can be used to filter down objects\n * to the ones that have a specific value V under a key `k`.\n *\n * @example\n * ```ts\n * type File = { type: \"image\", imageUrl: string } | { type: \"pdf\", pdfUrl: string };\n * const files: File[] = [];\n *\n * const imageFiles = files.filter(file => file.type === \"image\");\n * files[0].type // In this case, TS will still treat it as `\"image\" | \"pdf\"`\n *\n * const filesWithUrl = files.filter(hasValueKey(\"type\", \"image\" as const));\n * files[0].type // TS will now know that this is \"image\"\n * files[0].imageUrl // TS will know this is present, because already it excluded the other union members.\n *\n * Note: the cast `as const` is necessary, otherwise TS will only know that type is a string.\n * ```\n *\n * See https://github.com/microsoft/TypeScript/issues/16069\n * why is that useful.\n */\nfunction hasValueAtKey(k, v) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (a) {\n return a[k] === v;\n };\n}\nexports.hasValueAtKey = hasValueAtKey;\n//# sourceMappingURL=index.js.map","import { filter, map, startWith, take, tap, timeout } from 'rxjs'\nimport { isPresent } from 'ts-is-present'\nimport observeOnMutation from './mutation-observer'\n\n/**\n * @returns An observable that emits the elements when they are found\n * @description This function is useful when you want to wait for multiple elements to appear\n * @example waitForElements(['button', 'input']).subscribe(([button, input]) => button.click())\n * @returns\n */\nexport default function waitForElements(\n /**\n * @param selectors The selectors to use to find the elements\n * @type { string[] }\n * @description The order of the elements in the array is the same as the order of the elements in the emitted array\n */\n selectors: string[],\n /**\n * @param timeoutAfter How long to wait for the elements to appear before throwing an error\n * @default 5000\n * @type { number | undefined }\n * @description If you don't want to wait for the elements to appear, pass `undefined` as the second argument\n */\n timeoutAfter = 5000,\n) {\n return observeOnMutation(document.body).pipe(\n startWith(document.body),\n filter(() => selectors.every(s => !!document.querySelector(s))),\n take(1),\n map(() => selectors.map(s => document.querySelector(s)).filter(isPresent)), // why filter again? see https://github.com/Microsoft/TypeScript/issues/16069\n map(elements => {\n if (elements.length === selectors.length) {\n return elements\n } else {\n throw new Error('Not all elements were found')\n }\n }),\n timeoutAfter ? timeout(timeoutAfter) : tap(),\n )\n}\n"],"x_google_ignoreList":[1],"mappings":"8DAEA,IAAa,GACZ,EACA,EAA+B,CAC9B,WAAA,CAAY,EACZ,UAAA,CAAW,EACX,QAAA,CAAS,EAAA,GAGH,IAAI,EAAA,WAAW,GAAA,CACrB,IAAM,EAAW,IAAI,iBAAiB,GAAA,CACrC,EAAS,KAAK,EAAA,EAAA,CAMf,OAJA,EAAS,QAAQ,EAAQ,EAAA,KACnB,CACL,EAAS,YAAA,GAAA,CAAA,EAAA,EAAA,GAAA,CCfZ,OAAO,eAAe,EAAS,IAAc,CAAE,MAAA,CAAO,EAAA,CAAA,CACtD,EAAQ,cAAgB,EAAQ,cAAgB,EAAQ,SAAW,EAAQ,UAAY,EAAQ,UAAA,IAAiB,GAIhH,EAAQ,UAHR,SAAmB,EAAA,CACf,OAAO,GAAA,MAMX,EAAQ,UAHR,SAAmB,EAAA,CACf,OAAO,IAAP,IAAa,IAMjB,EAAQ,SAHR,SAAkB,EAAA,CACd,OAAO,IAAM,MAwBjB,EAAQ,cALR,SAAuB,EAAA,CACnB,OAAO,SAAU,EAAA,CACb,OAAO,EAAE,KAAT,IAAgB,IAAa,EAAE,KAAO,OAgC9C,EAAQ,cANR,SAAuB,EAAG,EAAA,CAEtB,OAAO,SAAU,EAAA,CACb,OAAO,EAAE,KAAO,KAAA,EAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxjs-utils-
|
|
1
|
+
{"version":3,"file":"rxjs-utils-Dv9T9IpA.js","names":[],"sources":["../src/rxjs-utils/mutation-observer.ts","../node_modules/ts-is-present/lib/index.js","../src/rxjs-utils/waitForElements.ts"],"sourcesContent":["import { Observable } from 'rxjs'\n\nexport const mutationObserver = (\n\ttarget: HTMLElement,\n\tconfig: MutationObserverInit = {\n\t\tattributes: true,\n\t\tchildList: true,\n\t\tsubtree: true,\n\t},\n): Observable<MutationRecord[]> => {\n\treturn new Observable(observer => {\n\t\tconst mutation = new MutationObserver(mutations => {\n\t\t\tobserver.next(mutations)\n\t\t})\n\t\tmutation.observe(target, config)\n\t\tconst unsubscribe = () => {\n\t\t\tmutation.disconnect()\n\t\t}\n\t\treturn unsubscribe\n\t})\n}\nexport default mutationObserver\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hasValueAtKey = exports.hasPresentKey = exports.isFilled = exports.isDefined = exports.isPresent = void 0;\nfunction isPresent(t) {\n return t !== undefined && t !== null;\n}\nexports.isPresent = isPresent;\nfunction isDefined(t) {\n return t !== undefined;\n}\nexports.isDefined = isDefined;\nfunction isFilled(t) {\n return t !== null;\n}\nexports.isFilled = isFilled;\n/**\n * Returns a function that can be used to filter down objects\n * to the ones that have a defined non-null value under the key `k`.\n *\n * @example\n * ```ts\n * const filesWithUrl = files.filter(file => file.url);\n * files[0].url // In this case, TS might still treat this as undefined/null\n *\n * const filesWithUrl = files.filter(hasPresentKey(\"url\"));\n * files[0].url // TS will know that this is present\n * ```\n *\n * See https://github.com/microsoft/TypeScript/issues/16069\n * why is that useful.\n */\nfunction hasPresentKey(k) {\n return function (a) {\n return a[k] !== undefined && a[k] !== null;\n };\n}\nexports.hasPresentKey = hasPresentKey;\n/**\n * Returns a function that can be used to filter down objects\n * to the ones that have a specific value V under a key `k`.\n *\n * @example\n * ```ts\n * type File = { type: \"image\", imageUrl: string } | { type: \"pdf\", pdfUrl: string };\n * const files: File[] = [];\n *\n * const imageFiles = files.filter(file => file.type === \"image\");\n * files[0].type // In this case, TS will still treat it as `\"image\" | \"pdf\"`\n *\n * const filesWithUrl = files.filter(hasValueKey(\"type\", \"image\" as const));\n * files[0].type // TS will now know that this is \"image\"\n * files[0].imageUrl // TS will know this is present, because already it excluded the other union members.\n *\n * Note: the cast `as const` is necessary, otherwise TS will only know that type is a string.\n * ```\n *\n * See https://github.com/microsoft/TypeScript/issues/16069\n * why is that useful.\n */\nfunction hasValueAtKey(k, v) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function (a) {\n return a[k] === v;\n };\n}\nexports.hasValueAtKey = hasValueAtKey;\n//# sourceMappingURL=index.js.map","import { filter, map, startWith, take, tap, timeout } from 'rxjs'\nimport { isPresent } from 'ts-is-present'\nimport observeOnMutation from './mutation-observer'\n\n/**\n * @returns An observable that emits the elements when they are found\n * @description This function is useful when you want to wait for multiple elements to appear\n * @example waitForElements(['button', 'input']).subscribe(([button, input]) => button.click())\n * @returns\n */\nexport default function waitForElements(\n /**\n * @param selectors The selectors to use to find the elements\n * @type { string[] }\n * @description The order of the elements in the array is the same as the order of the elements in the emitted array\n */\n selectors: string[],\n /**\n * @param timeoutAfter How long to wait for the elements to appear before throwing an error\n * @default 5000\n * @type { number | undefined }\n * @description If you don't want to wait for the elements to appear, pass `undefined` as the second argument\n */\n timeoutAfter = 5000,\n) {\n return observeOnMutation(document.body).pipe(\n startWith(document.body),\n filter(() => selectors.every(s => !!document.querySelector(s))),\n take(1),\n map(() => selectors.map(s => document.querySelector(s)).filter(isPresent)), // why filter again? see https://github.com/Microsoft/TypeScript/issues/16069\n map(elements => {\n if (elements.length === selectors.length) {\n return elements\n } else {\n throw new Error('Not all elements were found')\n }\n }),\n timeoutAfter ? timeout(timeoutAfter) : tap(),\n )\n}\n"],"x_google_ignoreList":[1],"mappings":";;AAEA,IAAa,KACZ,GACA,IAA+B;CAC9B,YAAA,CAAY;CACZ,WAAA,CAAW;CACX,SAAA,CAAS;CAAA,KAGH,IAAI,GAAW,MAAA;CACrB,IAAM,IAAW,IAAI,kBAAiB,MAAA;EACrC,EAAS,KAAK,EAAA;GAAA;CAMf,OAJA,EAAS,QAAQ,GAAQ,EAAA,QACnB;EACL,EAAS,YAAA;;EAAA;AAAA,GAAA,MAAA;CCfZ,OAAO,eAAe,GAAS,KAAc,EAAE,OAAA,CAAO,GAAA,CAAA,EACtD,EAAQ,gBAAgB,EAAQ,gBAAgB,EAAQ,WAAW,EAAQ,YAAY,EAAQ,YAAA,KAAiB,GAIhH,EAAQ,YAHR,SAAmB,GAAA;EACf,OAAO,KAAA;IAMX,EAAQ,YAHR,SAAmB,GAAA;EACf,OAAO,MAAP,KAAa;IAMjB,EAAQ,WAHR,SAAkB,GAAA;EACd,OAAO,MAAM;IAwBjB,EAAQ,gBALR,SAAuB,GAAA;EACnB,OAAO,SAAU,GAAA;GACb,OAAO,EAAE,OAAT,KAAgB,KAAa,EAAE,OAAO;;IAgC9C,EAAQ,gBANR,SAAuB,GAAG,GAAA;EAEtB,OAAO,SAAU,GAAA;GACb,OAAO,EAAE,OAAO;;;EAAA,EAAA;AAAA,SAAA,KAAA"}
|
package/dist/rxjs-utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./rxjs-utils-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./rxjs-utils-BKB2UM_j.cjs`);exports.mutationObserver=e.t;
|
package/dist/rxjs-utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./rxjs-utils-
|
|
1
|
+
import { t as e } from "./rxjs-utils-Dv9T9IpA.js";
|
|
2
2
|
export { e as mutationObserver };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-CG5up5oy.js","names":[],"sources":["../src/layout/scroll/scroll.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { debounceTime, filter, fromEvent, takeUntil } from 'rxjs'\n\n/**\n * Custom scroll event interface for the SchmancyScroll component.\n * Contains detailed information about the scroll state.\n */\nexport interface SchmancyScrollEvent\n\textends CustomEvent<{\n\t\t/** Current scroll position from the top */\n\t\tscrollTop: number\n\t\t/** Total scrollable height of the content */\n\t\tscrollHeight: number\n\t\t/** Visible height of the container */\n\t\tclientHeight: number\n\t\t/** Original scroll event */\n\t\te: Event\n\t\t/** Current scroll position from the left (for horizontal scrolling) */\n\t\tscrollLeft?: number\n\t\t/** Total scrollable width of the content (for horizontal scrolling) */\n\t\tscrollWidth?: number\n\t\t/** Visible width of the container (for horizontal scrolling) */\n\t\tclientWidth?: number\n\t}> {}\n\n/**\n * Command event interface for controlling SchmancyScroll components\n */\nexport interface SchmancyScrollCommandEvent\n\textends CustomEvent<{\n\t\t/** Target component name */\n\t\tname: string\n\t\t/** Command action to perform */\n\t\taction: 'scrollTo'\n\t\t/** Scroll position for scrollTo action */\n\t\ttop: number\n\t\t/** Horizontal scroll position for scrollTo action (optional) */\n\t\tleft?: number\n\t}> {}\n\n// Augment the HTMLElementEventMap to include our custom events\ndeclare global {\n\tinterface HTMLElementEventMap {\n\t\tscroll: SchmancyScrollEvent\n\t\t'schmancy-scroll-command': SchmancyScrollCommandEvent\n\t}\n}\n\n/**\n * A custom scrollable container with enhanced features.\n *\n * @fires {SchmancyScrollEvent} scroll - Fired when scrolling occurs (with a configurable debounce)\n * @slot - Default slot for content to be scrolled\n * @csspart scroller - The inner scrollable div element\n *\n * @example\n * ```html\n * <schmancy-scroll hide name=\"main-content\">\n * <div>Scrollable content goes here</div>\n * </schmancy-scroll>\n * ```\n *\n * @example\n * ```html\n * <schmancy-scroll direction=\"horizontal\" hide name=\"image-carousel\">\n * <div class=\"flex\">\n * <img src=\"image1.jpg\" alt=\"Image 1\">\n * <img src=\"image2.jpg\" alt=\"Image 2\">\n * </div>\n * </schmancy-scroll>\n * ```\n *\n * @example Programmatic scroll with Lit ref\n * ```typescript\n * private scrollRef = createRef<HTMLElement>()\n *\n * // In template:\n * html`<schmancy-scroll ${ref(this.scrollRef)}>...</schmancy-scroll>`\n *\n * // Scroll to top (smooth — host has scroll-behavior: smooth):\n * this.scrollRef.value?.scrollTo({ top: 0 })\n * ```\n */\n@customElement('schmancy-scroll')\nexport class SchmancyScroll extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\t/* Flexible sizing for different layout contexts */\n\t\twidth: 100%;\n\t\tmin-height: 0; /* Allow flex shrinking */\n\t\tflex: 1; /* Grow in flex containers */\n\t\tbox-sizing: border-box; /* Ensures proper sizing */\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\tscroll-behavior: smooth;\n\t\toverscroll-behavior-x: contain;\n\t\toverscroll-behavior-y: auto;\n\t}\n\t/* Fallback for non-flex contexts */\n\t:host(.explicit-height) {\n\t\theight: 100%;\n\t\tflex: none;\n\t}\n\t:host([hide]) {\n\t\t-ms-overflow-style: none; /* IE and Edge */\n\t\tscrollbar-width: none; /* Firefox */\n\t}\n\t:host([hide])::-webkit-scrollbar {\n\t\tdisplay: none; /* Chrome, Safari, and Opera */\n\t}\n`];\n\t/**\n\t * Determines whether the scrollbar is hidden.\n\t *\n\t * When `hide` is true, the host element's scrollbars are hidden\n\t * in supported browsers using CSS.\n\t *\n\t * @attr hide\n\t * @example <schmancy-scroll hide></schmancy-scroll>\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic hide = false\n\n\t/**\n\t * Optional name identifier for the component.\n\t * Used for targeting this specific component with global events.\n\t *\n\t * @attr name\n\t * @example <schmancy-scroll name=\"main-content\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic name?: string\n\n\t/**\n\t * Direction of scrolling: vertical, horizontal, or both.\n\t * - vertical: Only allows vertical scrolling\n\t * - horizontal: Only allows horizontal scrolling\n\t * - both: Allows both horizontal and vertical scrolling (default)\n\t *\n\t * @attr direction\n\t * @example <schmancy-scroll direction=\"horizontal\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic direction: 'vertical' | 'horizontal' | 'both' = 'both'\n\n\t/**\n\t * Reference to the scrollable element (the host element itself)\n\t * @public\n\t */\n\tget scroller(): HTMLElement {\n\t\treturn this\n\t}\n\n\t/**\n\t * Debounce time in milliseconds for the scroll event.\n\t * Higher values reduce the frequency of scroll events being dispatched.\n\t *\n\t * @attr debounce\n\t * @example <schmancy-scroll debounce=\"50\"></schmancy-scroll>\n\t */\n\t@property({ type: Number })\n\tpublic debounce = 10\n\n\t/**\n\t * Scrolls the container to the specified position\n\t * @param options - ScrollToOptions or a number representing the top position\n\t * @param top - For backward compatibility, if options is a number, this is treated as \"behavior\"\n\t */\n\tpublic override scrollTo(options?: ScrollToOptions | number, top?: number): void {\n\t\tif (typeof options === 'number') {\n\t\t\tsuper.scrollTo({ top: options, behavior: top ? 'smooth' : 'auto' })\n\t\t} else if (options) {\n\t\t\tsuper.scrollTo(options)\n\t\t} else {\n\t\t\tsuper.scrollTo({ top: 0, left: 0, behavior: 'auto' })\n\t\t}\n\t}\n\n\t/**\n\t * Scrolls the container horizontally to the specified position\n\t * @param left - The horizontal position to scroll to (in pixels)\n\t * @param behavior - The scroll behavior ('auto' or 'smooth')\n\t */\n\tpublic scrollToLeft(left: number, behavior: ScrollBehavior = 'auto'): void {\n\t\tsuper.scrollTo({ left, behavior })\n\t}\n\n\t/**\n\t * Called when the component is connected to the DOM\n\t * Applies scrolling styles directly to the host element\n\t * @protected\n\t */\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.updateScrollingStyles()\n\t\tthis.updateLayoutContext()\n\t\t// Set the part attribute on the host element\n\t\tthis.setAttribute('part', 'scroller')\n\t}\n\n\t/**\n\t * Updates the overflow styles based on the direction property\n\t * @private\n\t */\n\tprivate updateScrollingStyles(): void {\n\t\t// Apply overflow styles based on direction\n\t\tif (this.direction === 'horizontal') {\n\t\t\tthis.style.setProperty('overflow-y', 'hidden')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t} else if (this.direction === 'vertical') {\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'hidden')\n\t\t} else {\n\t\t\t// both\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t}\n\t}\n\n\t/**\n\t * Updates the layout context based on parent container type\n\t * @private\n\t */\n\tprivate updateLayoutContext(): void {\n\t\t// Use requestAnimationFrame to ensure DOM is fully rendered\n\t\trequestAnimationFrame(() => {\n\t\t\t// Check if parent is a flex container\n\t\t\tconst parent = this.parentElement\n\t\t\tif (parent) {\n\t\t\t\tconst parentStyles = getComputedStyle(parent)\n\t\t\t\tconst isFlexParent = parentStyles.display === 'flex' || parentStyles.display === 'inline-flex'\n\n\t\t\t\t// For debugging - remove in production\n\t\t\t\tconsole.debug('schmancy-scroll parent detection:', {\n\t\t\t\t\tparent: parent.tagName,\n\t\t\t\t\tdisplay: parentStyles.display,\n\t\t\t\t\tisFlexParent,\n\t\t\t\t})\n\n\t\t\t\t// Apply appropriate class based on parent layout\n\t\t\t\tif (isFlexParent) {\n\t\t\t\t\tthis.classList.remove('explicit-height')\n\t\t\t\t} else {\n\t\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Default to explicit height if no parent\n\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Called when properties change\n\t * @protected\n\t */\n\tprotected updated(changedProperties: Map<string | number | symbol, unknown>): void {\n\t\tsuper.updated(changedProperties)\n\t\t// Update styles if direction changes\n\t\tif (changedProperties.has('direction')) {\n\t\t\tthis.updateScrollingStyles()\n\t\t}\n\t\t// Always update layout context in case parent layout changed\n\t\tthis.updateLayoutContext()\n\t}\n\n\t/**\n\t * Called after the component's first update\n\t * Sets up the scroll event listener with debouncing\n\t * @protected\n\t */\n\tprotected firstUpdated(): void {\n\t\t// Set up scroll event listening with debounce\n\t\tfromEvent(this.scroller, 'scroll', {\n\t\t\tpassive: true,\n\t\t})\n\t\t\t.pipe(\n\t\t\t\tdebounceTime(this.debounce),\n\t\t\t\ttakeUntil(this.disconnecting), // Unsubscribe when the element is destroyed\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\t// Always include the original required properties for backward compatibility\n\t\t\t\tconst scrollTop = this.scroller.scrollTop\n\t\t\t\tconst scrollHeight = this.scroller.scrollHeight\n\t\t\t\tconst clientHeight = this.scroller.clientHeight\n\n\t\t\t\t// Include horizontal scroll information as optional properties\n\t\t\t\tconst scrollLeft = this.scroller.scrollLeft\n\t\t\t\tconst scrollWidth = this.scroller.scrollWidth\n\t\t\t\tconst clientWidth = this.scroller.clientWidth\n\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('scroll', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t// Original required properties first\n\t\t\t\t\t\t\tscrollTop,\n\t\t\t\t\t\t\tscrollHeight,\n\t\t\t\t\t\t\tclientHeight,\n\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t// New optional properties last\n\t\t\t\t\t\t\tscrollLeft,\n\t\t\t\t\t\t\tscrollWidth,\n\t\t\t\t\t\t\tclientWidth,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}) as SchmancyScrollEvent,\n\t\t\t\t)\n\t\t\t})\n\n\t\t// Set up global command event listener\n\t\tfromEvent<SchmancyScrollCommandEvent>(window, '@schmancy:scrollTo')\n\t\t\t.pipe(\n\t\t\t\t// Only process events targeting this component by name\n\t\t\t\tfilter(e => this.name !== undefined && e.detail.name === this.name),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\tif (e.detail.action === 'scrollTo' && typeof e.detail.top === 'number') {\n\t\t\t\t\tconst options: ScrollToOptions = {\n\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\ttop: e.detail.top, // Required for backward compatibility\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add optional left position if provided\n\t\t\t\t\tif (typeof e.detail.left === 'number') {\n\t\t\t\t\t\toptions.left = e.detail.left\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.scrollTo(options)\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\t/**\n\t * Renders the component template\n\t * @returns {TemplateResult} The template to render\n\t * @protected\n\t */\n\tprotected render() {\n\t\t// Only render the slot, all styling is applied to the host\n\t\treturn html`<slot></slot>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-scroll': SchmancyScroll\n\t}\n}\n"],"mappings":";;;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,MAAM;CAAQ,SAAA,CAAS;CAAA,CAAA,CAAA,EAAO,EAAA,WAAA,aAAA,KAAA,EAAA,EAAA,EAAA,CAkBzC,EAAS,EAAE,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,YAAA,KAAA,EAAA,EAAA,IAAA,EAAA,CA7E3B,EAAc,kBAAA,CAAA,EAAkB,EAAA;AAAA,SAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"scroll-BFHUtZOa.js","names":[],"sources":["../src/layout/scroll/scroll.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { debounceTime, filter, fromEvent, takeUntil } from 'rxjs'\n\n/**\n * Custom scroll event interface for the SchmancyScroll component.\n * Contains detailed information about the scroll state.\n */\nexport interface SchmancyScrollEvent\n\textends CustomEvent<{\n\t\t/** Current scroll position from the top */\n\t\tscrollTop: number\n\t\t/** Total scrollable height of the content */\n\t\tscrollHeight: number\n\t\t/** Visible height of the container */\n\t\tclientHeight: number\n\t\t/** Original scroll event */\n\t\te: Event\n\t\t/** Current scroll position from the left (for horizontal scrolling) */\n\t\tscrollLeft?: number\n\t\t/** Total scrollable width of the content (for horizontal scrolling) */\n\t\tscrollWidth?: number\n\t\t/** Visible width of the container (for horizontal scrolling) */\n\t\tclientWidth?: number\n\t}> {}\n\n/**\n * Command event interface for controlling SchmancyScroll components\n */\nexport interface SchmancyScrollCommandEvent\n\textends CustomEvent<{\n\t\t/** Target component name */\n\t\tname: string\n\t\t/** Command action to perform */\n\t\taction: 'scrollTo'\n\t\t/** Scroll position for scrollTo action */\n\t\ttop: number\n\t\t/** Horizontal scroll position for scrollTo action (optional) */\n\t\tleft?: number\n\t}> {}\n\n// Augment the HTMLElementEventMap to include our custom events\ndeclare global {\n\tinterface HTMLElementEventMap {\n\t\tscroll: SchmancyScrollEvent\n\t\t'schmancy-scroll-command': SchmancyScrollCommandEvent\n\t}\n}\n\n/**\n * A custom scrollable container with enhanced features.\n *\n * @fires {SchmancyScrollEvent} scroll - Fired when scrolling occurs (with a configurable debounce)\n * @slot - Default slot for content to be scrolled\n * @csspart scroller - The inner scrollable div element\n *\n * @example\n * ```html\n * <schmancy-scroll hide name=\"main-content\">\n * <div>Scrollable content goes here</div>\n * </schmancy-scroll>\n * ```\n *\n * @example\n * ```html\n * <schmancy-scroll direction=\"horizontal\" hide name=\"image-carousel\">\n * <div class=\"flex\">\n * <img src=\"image1.jpg\" alt=\"Image 1\">\n * <img src=\"image2.jpg\" alt=\"Image 2\">\n * </div>\n * </schmancy-scroll>\n * ```\n *\n * @example Programmatic scroll with Lit ref\n * ```typescript\n * private scrollRef = createRef<HTMLElement>()\n *\n * // In template:\n * html`<schmancy-scroll ${ref(this.scrollRef)}>...</schmancy-scroll>`\n *\n * // Scroll to top (smooth — host has scroll-behavior: smooth):\n * this.scrollRef.value?.scrollTo({ top: 0 })\n * ```\n */\n@customElement('schmancy-scroll')\nexport class SchmancyScroll extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\t/* Flexible sizing for different layout contexts */\n\t\twidth: 100%;\n\t\tmin-height: 0; /* Allow flex shrinking */\n\t\tflex: 1; /* Grow in flex containers */\n\t\tbox-sizing: border-box; /* Ensures proper sizing */\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\tscroll-behavior: smooth;\n\t\toverscroll-behavior-x: contain;\n\t\toverscroll-behavior-y: auto;\n\t}\n\t/* Fallback for non-flex contexts */\n\t:host(.explicit-height) {\n\t\theight: 100%;\n\t\tflex: none;\n\t}\n\t:host([hide]) {\n\t\t-ms-overflow-style: none; /* IE and Edge */\n\t\tscrollbar-width: none; /* Firefox */\n\t}\n\t:host([hide])::-webkit-scrollbar {\n\t\tdisplay: none; /* Chrome, Safari, and Opera */\n\t}\n`];\n\t/**\n\t * Determines whether the scrollbar is hidden.\n\t *\n\t * When `hide` is true, the host element's scrollbars are hidden\n\t * in supported browsers using CSS.\n\t *\n\t * @attr hide\n\t * @example <schmancy-scroll hide></schmancy-scroll>\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic hide = false\n\n\t/**\n\t * Optional name identifier for the component.\n\t * Used for targeting this specific component with global events.\n\t *\n\t * @attr name\n\t * @example <schmancy-scroll name=\"main-content\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic name?: string\n\n\t/**\n\t * Direction of scrolling: vertical, horizontal, or both.\n\t * - vertical: Only allows vertical scrolling\n\t * - horizontal: Only allows horizontal scrolling\n\t * - both: Allows both horizontal and vertical scrolling (default)\n\t *\n\t * @attr direction\n\t * @example <schmancy-scroll direction=\"horizontal\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic direction: 'vertical' | 'horizontal' | 'both' = 'both'\n\n\t/**\n\t * Reference to the scrollable element (the host element itself)\n\t * @public\n\t */\n\tget scroller(): HTMLElement {\n\t\treturn this\n\t}\n\n\t/**\n\t * Debounce time in milliseconds for the scroll event.\n\t * Higher values reduce the frequency of scroll events being dispatched.\n\t *\n\t * @attr debounce\n\t * @example <schmancy-scroll debounce=\"50\"></schmancy-scroll>\n\t */\n\t@property({ type: Number })\n\tpublic debounce = 10\n\n\t/**\n\t * Scrolls the container to the specified position\n\t * @param options - ScrollToOptions or a number representing the top position\n\t * @param top - For backward compatibility, if options is a number, this is treated as \"behavior\"\n\t */\n\tpublic override scrollTo(options?: ScrollToOptions | number, top?: number): void {\n\t\tif (typeof options === 'number') {\n\t\t\tsuper.scrollTo({ top: options, behavior: top ? 'smooth' : 'auto' })\n\t\t} else if (options) {\n\t\t\tsuper.scrollTo(options)\n\t\t} else {\n\t\t\tsuper.scrollTo({ top: 0, left: 0, behavior: 'auto' })\n\t\t}\n\t}\n\n\t/**\n\t * Scrolls the container horizontally to the specified position\n\t * @param left - The horizontal position to scroll to (in pixels)\n\t * @param behavior - The scroll behavior ('auto' or 'smooth')\n\t */\n\tpublic scrollToLeft(left: number, behavior: ScrollBehavior = 'auto'): void {\n\t\tsuper.scrollTo({ left, behavior })\n\t}\n\n\t/**\n\t * Called when the component is connected to the DOM\n\t * Applies scrolling styles directly to the host element\n\t * @protected\n\t */\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.updateScrollingStyles()\n\t\tthis.updateLayoutContext()\n\t\t// Set the part attribute on the host element\n\t\tthis.setAttribute('part', 'scroller')\n\t}\n\n\t/**\n\t * Updates the overflow styles based on the direction property\n\t * @private\n\t */\n\tprivate updateScrollingStyles(): void {\n\t\t// Apply overflow styles based on direction\n\t\tif (this.direction === 'horizontal') {\n\t\t\tthis.style.setProperty('overflow-y', 'hidden')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t} else if (this.direction === 'vertical') {\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'hidden')\n\t\t} else {\n\t\t\t// both\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t}\n\t}\n\n\t/**\n\t * Updates the layout context based on parent container type\n\t * @private\n\t */\n\tprivate updateLayoutContext(): void {\n\t\t// Use requestAnimationFrame to ensure DOM is fully rendered\n\t\trequestAnimationFrame(() => {\n\t\t\t// Check if parent is a flex container\n\t\t\tconst parent = this.parentElement\n\t\t\tif (parent) {\n\t\t\t\tconst parentStyles = getComputedStyle(parent)\n\t\t\t\tconst isFlexParent = parentStyles.display === 'flex' || parentStyles.display === 'inline-flex'\n\n\t\t\t\t// For debugging - remove in production\n\t\t\t\tconsole.debug('schmancy-scroll parent detection:', {\n\t\t\t\t\tparent: parent.tagName,\n\t\t\t\t\tdisplay: parentStyles.display,\n\t\t\t\t\tisFlexParent,\n\t\t\t\t})\n\n\t\t\t\t// Apply appropriate class based on parent layout\n\t\t\t\tif (isFlexParent) {\n\t\t\t\t\tthis.classList.remove('explicit-height')\n\t\t\t\t} else {\n\t\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Default to explicit height if no parent\n\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Called when properties change\n\t * @protected\n\t */\n\tprotected updated(changedProperties: Map<string | number | symbol, unknown>): void {\n\t\tsuper.updated(changedProperties)\n\t\t// Update styles if direction changes\n\t\tif (changedProperties.has('direction')) {\n\t\t\tthis.updateScrollingStyles()\n\t\t}\n\t\t// Always update layout context in case parent layout changed\n\t\tthis.updateLayoutContext()\n\t}\n\n\t/**\n\t * Called after the component's first update\n\t * Sets up the scroll event listener with debouncing\n\t * @protected\n\t */\n\tprotected firstUpdated(): void {\n\t\t// Set up scroll event listening with debounce\n\t\tfromEvent(this.scroller, 'scroll', {\n\t\t\tpassive: true,\n\t\t})\n\t\t\t.pipe(\n\t\t\t\tdebounceTime(this.debounce),\n\t\t\t\ttakeUntil(this.disconnecting), // Unsubscribe when the element is destroyed\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\t// Always include the original required properties for backward compatibility\n\t\t\t\tconst scrollTop = this.scroller.scrollTop\n\t\t\t\tconst scrollHeight = this.scroller.scrollHeight\n\t\t\t\tconst clientHeight = this.scroller.clientHeight\n\n\t\t\t\t// Include horizontal scroll information as optional properties\n\t\t\t\tconst scrollLeft = this.scroller.scrollLeft\n\t\t\t\tconst scrollWidth = this.scroller.scrollWidth\n\t\t\t\tconst clientWidth = this.scroller.clientWidth\n\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('scroll', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t// Original required properties first\n\t\t\t\t\t\t\tscrollTop,\n\t\t\t\t\t\t\tscrollHeight,\n\t\t\t\t\t\t\tclientHeight,\n\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t// New optional properties last\n\t\t\t\t\t\t\tscrollLeft,\n\t\t\t\t\t\t\tscrollWidth,\n\t\t\t\t\t\t\tclientWidth,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}) as SchmancyScrollEvent,\n\t\t\t\t)\n\t\t\t})\n\n\t\t// Set up global command event listener\n\t\tfromEvent<SchmancyScrollCommandEvent>(window, '@schmancy:scrollTo')\n\t\t\t.pipe(\n\t\t\t\t// Only process events targeting this component by name\n\t\t\t\tfilter(e => this.name !== undefined && e.detail.name === this.name),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\tif (e.detail.action === 'scrollTo' && typeof e.detail.top === 'number') {\n\t\t\t\t\tconst options: ScrollToOptions = {\n\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\ttop: e.detail.top, // Required for backward compatibility\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add optional left position if provided\n\t\t\t\t\tif (typeof e.detail.left === 'number') {\n\t\t\t\t\t\toptions.left = e.detail.left\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.scrollTo(options)\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\t/**\n\t * Renders the component template\n\t * @returns {TemplateResult} The template to render\n\t * @protected\n\t */\n\tprotected render() {\n\t\t// Only render the slot, all styling is applied to the host\n\t\treturn html`<slot></slot>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-scroll': SchmancyScroll\n\t}\n}\n"],"mappings":";;;;;AAsFO,IAAA,IAAA,cAA6B,EAAA;CAAA,YAAA,GAAA,GAAA;EAAA,MAAA,GAAA,EAAA,EAAA,KAAA,OAAA,CAqCrB,GAAA,KAAA,YAsByC,QAAA,KAAA,WAkBrC;;CAAA;EAAA,KAAA,SA5EF,CAAC,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEpB,IAAA,WAAI;EACH,OAAO;;CAkBR,SAAyB,GAAoC,GAAA;EACrC,AAAA,OAAZ,KAAY,WACtB,MAAM,SAAS;GAAE,KAAK;G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