@mhmo91/schmancy 0.4.44 → 0.4.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/ai/dialog.md +1 -1
  2. package/dist/ai/dialog.md +1 -1
  3. package/dist/{avatar-N8UvQjsm.cjs → avatar-By_6fdSR.cjs} +2 -2
  4. package/dist/{avatar-N8UvQjsm.cjs.map → avatar-By_6fdSR.cjs.map} +1 -1
  5. package/dist/{avatar-DbQohKTF.js → avatar-DZ45SZ_3.js} +17 -17
  6. package/dist/{avatar-DbQohKTF.js.map → avatar-DZ45SZ_3.js.map} +1 -1
  7. package/dist/badge.cjs +1 -1
  8. package/dist/badge.js +1 -1
  9. package/dist/content-drawer.cjs +1 -1
  10. package/dist/content-drawer.js +1 -1
  11. package/dist/{date-range-CREpHqxO.cjs → date-range-CVkBXQxc.cjs} +2 -2
  12. package/dist/{date-range-CREpHqxO.cjs.map → date-range-CVkBXQxc.cjs.map} +1 -1
  13. package/dist/{date-range-B7VG8UXD.js → date-range-Cnrrl6_Q.js} +2 -2
  14. package/dist/{date-range-B7VG8UXD.js.map → date-range-Cnrrl6_Q.js.map} +1 -1
  15. package/dist/date-range.cjs +1 -1
  16. package/dist/date-range.js +1 -1
  17. package/dist/{dialog-content-ClfiDTji.cjs → dialog-content-Dm9ywkp4.cjs} +2 -2
  18. package/dist/{dialog-content-ClfiDTji.cjs.map → dialog-content-Dm9ywkp4.cjs.map} +1 -1
  19. package/dist/{dialog-content-Cc7LNx1o.js → dialog-content-MhUhElif.js} +2 -2
  20. package/dist/{dialog-content-Cc7LNx1o.js.map → dialog-content-MhUhElif.js.map} +1 -1
  21. package/dist/dialog-service-LvOr2E3k.js +132 -0
  22. package/dist/dialog-service-LvOr2E3k.js.map +1 -0
  23. package/dist/dialog-service-iRGqMSDe.cjs +2 -0
  24. package/dist/dialog-service-iRGqMSDe.cjs.map +1 -0
  25. package/dist/dialog.cjs +1 -1
  26. package/dist/dialog.js +2 -2
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.js +177 -177
  29. package/dist/nav-drawer.cjs +1 -1
  30. package/dist/nav-drawer.js +1 -1
  31. package/dist/sheet-DMP3Pfe5.js +228 -0
  32. package/dist/sheet-DMP3Pfe5.js.map +1 -0
  33. package/dist/sheet-Dsx7bpof.cjs +52 -0
  34. package/dist/sheet-Dsx7bpof.cjs.map +1 -0
  35. package/dist/sheet.cjs +1 -1
  36. package/dist/sheet.js +5 -6
  37. package/dist/sheet.js.map +1 -1
  38. package/dist/teleport.cjs +1 -1
  39. package/dist/teleport.js +1 -1
  40. package/dist/theme.cjs +1 -1
  41. package/dist/theme.component-Bl4uy-_0.js +738 -0
  42. package/dist/theme.component-Bl4uy-_0.js.map +1 -0
  43. package/dist/theme.component-Dnf9PdX8.cjs +3 -0
  44. package/dist/theme.component-Dnf9PdX8.cjs.map +1 -0
  45. package/dist/theme.js +1 -1
  46. package/dist/{typewriter-DMKxup-I.js → typewriter-CnloNIdN.js} +6 -6
  47. package/dist/{typewriter-DMKxup-I.js.map → typewriter-CnloNIdN.js.map} +1 -1
  48. package/dist/typewriter.js +1 -1
  49. package/package.json +1 -1
  50. package/types/src/sheet/sheet.d.ts +0 -1
  51. package/types/src/sheet/sheet.service.d.ts +32 -118
  52. package/dist/dialog-events--DuMbZ8T.cjs +0 -2
  53. package/dist/dialog-events--DuMbZ8T.cjs.map +0 -1
  54. package/dist/dialog-events-mjOcyPQ-.js +0 -6
  55. package/dist/dialog-events-mjOcyPQ-.js.map +0 -1
  56. package/dist/dialog-service-BZZK8N6A.cjs +0 -2
  57. package/dist/dialog-service-BZZK8N6A.cjs.map +0 -1
  58. package/dist/dialog-service-DFMlRcXf.js +0 -128
  59. package/dist/dialog-service-DFMlRcXf.js.map +0 -1
  60. package/dist/sheet-BY3YdE4E.js +0 -149
  61. package/dist/sheet-BY3YdE4E.js.map +0 -1
  62. package/dist/sheet-BY85jX0R.cjs +0 -54
  63. package/dist/sheet-BY85jX0R.cjs.map +0 -1
  64. package/dist/sheet.service-CNz7lXHC.cjs +0 -3
  65. package/dist/sheet.service-CNz7lXHC.cjs.map +0 -1
  66. package/dist/sheet.service-DSvFe5PY.js +0 -842
  67. package/dist/sheet.service-DSvFe5PY.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet-DMP3Pfe5.js","sources":["../src/sheet/header.ts","../src/sheet/sheet.service.ts","../src/sheet/sheet.ts","../src/sheet/hook.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-sheet-header')\nexport default class SchmancySheetHeader extends TailwindElement(css``) {\n\trender() {\n\t\treturn html`\n\t\t\t<sch-flex class=\"absolute top-0 left-0 md:left-[unset] md:right-0\">\n\t\t\t\t<div class=\"block md:hidden flex-1 justify-start items-start\">\n\t\t\t\t\t<slot name=\"back\">\n\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span class=\"text-[24px]\">&#8592; </span>\n\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"hidden md:block flex-1 justify-end items-end\">\n\t\t\t\t\t<slot name=\"actions\">\n\t\t\t\t\t\t<schmancy-icon-button\n\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tclose\n\t\t\t\t\t\t</schmancy-icon-button>\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\t\t\t</sch-flex>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet-header': SchmancySheetHeader\n\t}\n}\n","import {\n\tdefaultIfEmpty,\n\tdelay,\n\tforkJoin,\n\tfromEvent,\n\tmap,\n\tmergeMap,\n\tof,\n\tSubject,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n\ttimer\n} from 'rxjs'\nimport { ThemeHereIAm, ThemeHereIAmEvent, ThemeWhereAreYou } from '../theme/theme.component'\nimport SchmancySheet from './sheet'\n\nexport enum SchmancySheetPosition {\n\tSide = 'side',\n\tBottom = 'bottom',\n}\n\nexport type SheetConfig = {\n\tcomponent: HTMLElement\n\tuid?: string\n\tposition?: SchmancySheetPosition\n\tpersist?: boolean\n\tclose?: () => void\n\tlock?: boolean // Controls both ESC and overlay click dismissal\n\thandleHistory?: boolean // Controls browser back button behavior\n\ttitle?: string\n\theader?: 'hidden' | 'visible'\n\tonBeforeOpen?: (component: HTMLElement) => void\n\tonAfterOpen?: (component: HTMLElement) => void\n}\n\n// Keep old name for backward compatibility\ntype BottomSheeetTarget = SheetConfig\n\n// Events for communication between bottom-sheet component and bottom-sheet.service\nexport type SheetWhereAreYouRickyEvent = CustomEvent<{\n\tuid: string\n}>\nexport const SheetWhereAreYouRicky = 'are-you-there-sheet'\n\nexport type SheetHereMortyEvent = CustomEvent<{\n\tsheet?: SchmancySheet\n\ttheme?: HTMLElement\n}>\nexport const SheetHereMorty = 'yes-here'\n\n// Function to determine the position based on screen size\nconst getPosition = (): SchmancySheetPosition => {\n\treturn window.innerWidth >= 768 ? SchmancySheetPosition.Side : SchmancySheetPosition.Bottom // Adjust 768 as needed for your breakpoint\n}\n\nclass BottomSheetService {\n\tbottomSheet = new Subject<BottomSheeetTarget>()\n\t$dismiss = new Subject<string>()\n\t// Track currently open sheets\n\tprivate activeSheets = new Set<string>()\n\t// Track sheet components for retrieval\n\tprivate sheetComponents = new Map<string, HTMLElement>()\n\t// To track if we've set up the popstate listener\n\tprivate popStateListenerActive = false\n\n\tconstructor() {\n\t\tthis.setupSheetOpeningLogic()\n\t\tthis.setupSheetDismissLogic()\n\t\tthis.setupPopStateListener()\n\t}\n\n\t/**\n\t * Sets up the main sheet opening logic\n\t */\n\tprivate setupSheetOpeningLogic() {\n\t\tthis.bottomSheet\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\t// First check for existing sheet\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(50)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t// Then find theme container\n\t\t\t\t\t\tfromEvent<ThemeHereIAmEvent>(window, ThemeHereIAm).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail.theme),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\t// Determine uid - use provided uid or component tagName\n\t\t\t\t\t\t\t\tconst uid = target.uid ?? target.component.tagName\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// First ask for existing sheet\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(SheetWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t// Then ask for theme container\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(ThemeWhereAreYou),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\n\t\t\t\tmap(([existingSheet, theme, target]) => {\n\t\t\t\t\tlet sheet = existingSheet?.sheet\n\t\t\t\t\tlet targetContainer: HTMLElement\n\t\t\t\t\t\n\t\t\t\t\tif (sheet) {\n\t\t\t\t\t\t// Use existing sheet\n\t\t\t\t\t\tconsole.log('Found existing sheet:', sheet)\n\t\t\t\t\t\ttargetContainer = sheet.parentElement as HTMLElement\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Determine container - use theme from discovery or fallback\n\t\t\t\t\t\ttargetContainer = theme || \n\t\t\t\t\t\t document.querySelector('schmancy-theme') as HTMLElement || \n\t\t\t\t\t\t document.body\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Create new sheet\n\t\t\t\t\t\tconst uid = target.uid ?? target.component.tagName\n\t\t\t\t\t\tconsole.log('Creating new sheet for uid:', uid)\n\t\t\t\t\t\tsheet = document.createElement('schmancy-sheet')\n\t\t\t\t\t\tsheet.setAttribute('uid', uid)\n\t\t\t\t\t\ttargetContainer.appendChild(sheet)\n\t\t\t\t\t}\n\n\t\t\t\t\ttarget.lock && sheet.setAttribute('lock', 'true')\n\n\t\t\t\t\t// Use the dynamic position function here\n\t\t\t\t\tconst position = target.position || getPosition()\n\t\t\t\t\tsheet.setAttribute('position', position)\n\n\t\t\t\t\ttarget.title && sheet.setAttribute('title', target.title)\n\t\t\t\t\ttarget.persist && sheet.setAttribute('persist', String(target.persist))\n\t\t\t\t\ttarget.header && sheet.setAttribute('header', target.header)\n\n\t\t\t\t\t// Handle history logic if the property exists\n\t\t\t\t\tif (target.handleHistory !== undefined) {\n\t\t\t\t\t\tsheet.setAttribute('handleHistory', String(target.handleHistory))\n\t\t\t\t\t}\n\n\t\t\t\t\tdocument.body.style.overflow = 'hidden' // lock the scroll of the host\n\t\t\t\t\treturn { target, sheet: sheet as SchmancySheet }\n\t\t\t\t}),\n\t\t\t\tdelay(20),\n\t\t\t\ttap(({ target, sheet }) => {\n\t\t\t\t\t// Call onBeforeOpen callback if provided\n\t\t\t\t\tif (target.onBeforeOpen) {\n\t\t\t\t\t\ttarget.onBeforeOpen(target.component)\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Handle HTMLElement components\n\t\t\t\t\tconst assignedElements = sheet?.shadowRoot\n\t\t\t\t\t\t?.querySelector('slot')\n\t\t\t\t\t\t?.assignedElements() || []\n\t\t\t\t\t\n\t\t\t\t\tconsole.log('Assigned elements in sheet:', assignedElements.map(e => (e as HTMLElement).tagName))\n\t\t\t\t\t\n\t\t\t\t\tconst existingComponent = assignedElements.find(e => (e as HTMLElement).tagName === target.component.tagName)\n\t\t\t\t\t\n\t\t\t\t\tif (!existingComponent) {\n\t\t\t\t\t\t// Need to append the component\n\t\t\t\t\t\tconsole.log('Component not found, will append:', target.component.tagName)\n\t\t\t\t\t\tsheet?.appendChild(target.component)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log('Component already exists, reusing:', target.component.tagName)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tdelay(1),\n\t\t\t\ttap(({ target, sheet }) => {\n\t\t\t\t\tsheet?.setAttribute('open', 'true')\n\n\t\t\t\t\t// Add to active sheets tracking\n\t\t\t\t\tconst uid = target.uid ?? \n\t\t\t\t\t\t(target.component instanceof HTMLElement ? target.component.tagName : `sheet-${Date.now()}`)\n\t\t\t\t\tthis.activeSheets.add(uid)\n\t\t\t\t\tthis.sheetComponents.set(uid, target.component)\n\n\t\t\t\t\t// Handle history integration - default to true if not specified\n\t\t\t\t\tconst shouldHandleHistory = target.handleHistory !== false\n\n\t\t\t\t\tif (shouldHandleHistory) {\n\t\t\t\t\t\t// Use history state to track this specific sheet\n\t\t\t\t\t\tconst historyState = {\n\t\t\t\t\t\t\tschmancySheet: true,\n\t\t\t\t\t\t\tuid: uid,\n\t\t\t\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Push a new history state\n\t\t\t\t\t\thistory.pushState(historyState, '', window.location.href)\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Call onAfterOpen callback if provided\n\t\t\t\t\tif (target.onAfterOpen) {\n\t\t\t\t\t\ttarget.onAfterOpen(target.component)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set up close event listener (always, not just for new sheets)\n\t\t\t\t\tfromEvent<CustomEvent>(sheet, 'close')\n\t\t\t\t\t\t.pipe(take(1))\n\t\t\t\t\t\t.pipe(delay(300))\n\t\t\t\t\t\t.subscribe(_ => {\n\t\t\t\t\t\t\t// Use the sheet reference directly, not e.target\n\t\t\t\t\t\t\tconst sheetElement = sheet as SchmancySheet\n\t\t\t\t\t\t\tconsole.log('Close event fired for sheet:', sheetElement)\n\n\t\t\t\t\t\t\t// Remove from active sheets tracking\n\t\t\t\t\t\t\tif (sheetElement) {\n\t\t\t\t\t\t\t\tconst uid = sheetElement.getAttribute('uid')\n\t\t\t\t\t\t\t\tif (uid) {\n\t\t\t\t\t\t\t\t\tthis.activeSheets.delete(uid)\n\t\t\t\t\t\t\t\t\tthis.sheetComponents.delete(uid)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Only keep sheet if persist is explicitly set to a truthy value\n\t\t\t\t\t\t\t\tconst persistAttr = sheetElement.getAttribute('persist')\n\t\t\t\t\t\t\t\tconst shouldRemove = !persistAttr || persistAttr === 'false'\n\t\t\t\t\t\t\t\tconsole.log('Sheet close - persist:', persistAttr, 'shouldRemove:', shouldRemove)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (shouldRemove) {\n\t\t\t\t\t\t\t\t\tconsole.log('Removing sheet from DOM:', uid)\n\t\t\t\t\t\t\t\t\tsheetElement.remove()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdocument.body.style.overflow = 'auto' // unlock the scroll of the host\n\t\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Sets up the sheet closing/dismissal logic\n\t */\n\tprivate setupSheetDismissLogic() {\n\t\tthis.$dismiss\n\t\t\t.pipe(\n\t\t\t\tmergeMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(SheetWhereAreYouRicky, { detail: { uid } }))\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([response, uid]) => {\n\t\t\t\t\tconsole.log('Dismiss called for uid:', uid, 'Found sheet:', !!response?.sheet)\n\t\t\t\t\tif (response?.sheet) {\n\t\t\t\t\t\tresponse.sheet.closeSheet()\n\t\t\t\t\t\tthis.activeSheets.delete(uid)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log('No sheet found to dismiss for uid:', uid)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Sets up the popstate listener to handle browser back button\n\t */\n\tprivate setupPopStateListener() {\n\t\tif (this.popStateListenerActive) return\n\n\t\tfromEvent<PopStateEvent>(window, 'popstate').subscribe(event => {\n\t\t\t// If we have active sheets, close the most recently opened one\n\t\t\tif (this.activeSheets.size > 0) {\n\t\t\t\t// Get the last sheet (Set maintains insertion order)\n\t\t\t\tconst lastSheet = Array.from(this.activeSheets).pop()\n\t\t\t\tif (lastSheet) {\n\t\t\t\t\tthis.dismiss(lastSheet)\n\n\t\t\t\t\t// Prevent default navigation behavior by pushing a new state\n\t\t\t\t\t// This effectively cancels out the back navigation\n\t\t\t\t\tif (event.state && event.state.schmancySheet) {\n\t\t\t\t\t\thistory.pushState({}, '', window.location.href)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tthis.popStateListenerActive = true\n\t}\n\n\t/**\n\t * Dismiss a sheet by uid, or dismiss the most recently opened sheet if no uid provided\n\t */\n\tdismiss(uid?: string) {\n\t\tif (!uid && this.activeSheets.size > 0) {\n\t\t\t// Get the last sheet opened (Set maintains insertion order)\n\t\t\tconst sheetsArray = Array.from(this.activeSheets)\n\t\t\tuid = sheetsArray[sheetsArray.length - 1]\n\t\t}\n\t\t\n\t\tif (uid) {\n\t\t\tthis.$dismiss.next(uid)\n\t\t}\n\t}\n\n\t/**\n\t * Open a sheet with the given target configuration\n\t */\n\topen(target: BottomSheeetTarget) {\n\t\tthis.bottomSheet.next(target)\n\t}\n\n\t/**\n\t * Check if a sheet is currently open by uid\n\t */\n\tisOpen(uid: string): boolean {\n\t\treturn this.activeSheets.has(uid)\n\t}\n\n\t/**\n\t * Close all open sheets\n\t */\n\tcloseAll() {\n\t\t// Copy the set to avoid modification during iteration\n\t\tArray.from(this.activeSheets).forEach(uid => {\n\t\t\tthis.dismiss(uid)\n\t\t})\n\t}\n\n\t/**\n\t * Gets the component instance for a given sheet\n\t * @param uid - The unique identifier of the sheet\n\t * @returns The component instance, or undefined if not found\n\t */\n\tgetComponent<T extends HTMLElement = HTMLElement>(uid: string): T | undefined {\n\t\treturn this.sheetComponents.get(uid) as T | undefined\n\t}\n}\nexport const sheet = new BottomSheetService()","import { $LitElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property, queryAssignedElements } from 'lit/decorators.js'\nimport { cache } from 'lit/directives/cache.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { fromEvent, merge, of, take, takeUntil, tap } from 'rxjs'\nimport { on } from './hook'\nimport style from './sheet.scss?inline'\nimport {\n\tSchmancySheetPosition,\n\tSheetHereMorty,\n\tSheetWhereAreYouRicky,\n\tSheetWhereAreYouRickyEvent,\n\tsheet,\n} from './sheet.service'\n\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(style) {\n\t@property({ type: String, reflect: true }) uid!: string\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) header: 'hidden' | 'visible' = 'visible'\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) lock = false\n\t@property({ type: Boolean, reflect: true }) handleHistory = true\n\t@property({ type: String, reflect: true }) title = ''\n\n\t// Use ref directive instead of @query\n\tprivate sheetRef = createRef<HTMLDivElement>()\n\t@queryAssignedElements({ flatten: true }) private assignedElements!: HTMLElement[]\n\n\t@property() focusAttribute = 'autofocus'\n\tprivate lastFocusedElement: HTMLElement | null = null\n\n\t@on('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\t// Use native inert attribute to prevent focus outside sheet\n\t\t\tthis.setBackgroundInert(true)\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.setBackgroundInert(false)\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button - only if handleHistory is true\n\t\tconst popState$ = this.handleHistory\n\t\t\t? fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\t\t\ttap(e => {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\tthis.closeSheet()\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t: of(null).pipe(take(0)) // Empty observable if handleHistory is false\n\n\t\t// Handle ESC key - listen on the sheet element for better event capture\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(this, 'keydown').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.lock && this.open) {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle inter-component communication\n\t\tconst rickyComm$ = fromEvent<SheetWhereAreYouRickyEvent>(window, SheetWhereAreYouRicky).pipe(\n\t\t\ttap(e => {\n\t\t\t\tif (e.detail.uid === this.uid)\n\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent(SheetHereMorty, {\n\t\t\t\t\t\t\tdetail: { sheet: this },\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, rickyComm$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate setBackgroundInert(inert: boolean) {\n\t\t// Get all sibling elements and make them inert\n\t\tconst parent = this.parentElement\n\t\tif (parent) {\n\t\t\tArray.from(parent.children).forEach(child => {\n\t\t\t\tif (child !== this && child instanceof HTMLElement) {\n\t\t\t\t\tif (inert) {\n\t\t\t\t\t\tchild.setAttribute('inert', '')\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchild.removeAttribute('inert')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\t// Also handle body's direct children if sheet is attached to body\n\t\tif (this.parentElement === document.body) {\n\t\t\tArray.from(document.body.children).forEach(child => {\n\t\t\t\tif (child !== this && child !== parent && child instanceof HTMLElement) {\n\t\t\t\t\tif (inert) {\n\t\t\t\t\t\tchild.setAttribute('inert', '')\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchild.removeAttribute('inert')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n\n\tsetIsSheetShown(isShown: boolean) {\n\t\tthis.sheetRef.value?.setAttribute('aria-hidden', String(!isShown))\n\t\tthis.sheetRef.value?.setAttribute('aria-modal', String(isShown))\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\tprivate getFocusElement(): HTMLElement | null {\n\t\tconst selector = `[${this.focusAttribute}]`\n\t\treturn (this.assignedElements.find(el => el.matches(selector) || el.querySelector(selector)) as HTMLElement) ?? null\n\t}\n\n\toverride focus() {\n\t\t// First try native autofocus attribute\n\t\tconst autofocusElement = this.querySelector('[autofocus]') as HTMLElement\n\t\tif (autofocusElement) {\n\t\t\tautofocusElement.focus()\n\t\t\treturn\n\t\t}\n\n\t\t// Fallback to custom focus attribute\n\t\tthis.getFocusElement()?.focus()\n\t}\n\n\tprivate handleOverlayClick = (e: Event) => {\n\t\te.stopPropagation()\n\t\tif (!this.lock) {\n\t\t\tsheet.dismiss(this.uid)\n\t\t}\n\t}\n\n\tprivate handleHeaderDismiss = (e: CustomEvent) => {\n\t\te.stopPropagation()\n\t\tsheet.dismiss(this.uid)\n\t}\n\n\trender() {\n\t\tconst sheetClasses = {\n\t\t\tsheet: true,\n\t\t\t'sheet--open': this.open,\n\t\t\t'sheet--locked': this.lock,\n\t\t}\n\n\t\tconst overlayClasses = {\n\t\t\toverlay: true,\n\t\t\t'overlay--interactive': !this.lock,\n\t\t}\n\n\t\treturn html`\n\t\t\t<div\n\t\t\t\tclass=${classMap(sheetClasses)}\n\t\t\t\trole=\"dialog\"\n\t\t\t\taria-labelledby=${ifDefined(this.header !== 'hidden' ? 'sheet-title' : undefined)}\n\t\t\t\taria-hidden=${!this.open}\n\t\t\t\taria-modal=${this.open}\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t${ref(this.sheetRef)}\n\t\t\t>\n\t\t\t\t<div class=${classMap(overlayClasses)} @click=${this.lock ? undefined : this.handleOverlayClick}></div>\n\t\t\t\t<schmancy-grid\n\t\t\t\t\trows=${this.header === 'hidden' ? '1fr' : 'auto 1fr'}\n\t\t\t\t\tclass=\"content w-full\"\n\t\t\t\t\tdata-position=${this.position}\n\t\t\t\t>\n\t\t\t\t\t${cache(\n\t\t\t\t\t\tthis.header !== 'hidden'\n\t\t\t\t\t\t\t? html`<schmancy-sheet-header\n\t\t\t\t\t\t\t\t\tclass=\"sticky top-0 z-50 w-full\"\n\t\t\t\t\t\t\t\t\t@dismiss=${this.handleHeaderDismiss}\n\t\t\t\t\t\t\t\t\tid=\"sheet-title\"\n\t\t\t\t\t\t\t\t\ttitle=${ifDefined(this.title || undefined)}\n\t\t\t\t\t\t\t\t></schmancy-sheet-header>`\n\t\t\t\t\t\t\t: '',\n\t\t\t\t\t)}\n\n\t\t\t\t\t<schmancy-surface rounded=\"left\" fill=\"all\" id=\"body\" class=\"overflow-auto\" type=\"surface\">\n\t\t\t\t\t\t<schmancy-scroll> <slot></slot></schmancy-scroll>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</schmancy-grid>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n","// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n\twaitUntilFirstUpdate?: boolean\n}\n\nexport function on(propName: string, options?: WatchOptions) {\n\treturn (protoOrDescriptor: any, name: string): any => {\n\t\tconst { willUpdate } = protoOrDescriptor\n\n\t\toptions = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n\t\tprotoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n\t\t\twillUpdate.call(this, changedProps)\n\n\t\t\tif (changedProps.has(propName)) {\n\t\t\t\tconst oldValue = changedProps.get(propName)\n\t\t\t\tconst newValue = this[propName]\n\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tif (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n\t\t\t\t\t\tthis[name].call(this, oldValue, newValue)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["SchmancySheetHeader","TailwindElement","css","render","html","this","dispatchEvent","CustomEvent","bubbles","composed","customElement","SchmancySheetPosition","SheetWhereAreYouRicky","SheetHereMorty","sheet","constructor","bottomSheet","Subject","$dismiss","activeSheets","Set","sheetComponents","Map","popStateListenerActive","setupSheetOpeningLogic","setupSheetDismissLogic","setupPopStateListener","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","ThemeHereIAm","theme","of","target","tap","uid","component","tagName","ThemeWhereAreYou","existingSheet","targetContainer","parentElement","document","querySelector","body","createElement","setAttribute","appendChild","lock","position","innerWidth","title","persist","String","header","handleHistory","style","overflow","delay","onBeforeOpen","shadowRoot","assignedElements","find","HTMLElement","Date","now","add","set","historyState","schmancySheet","timestamp","history","pushState","location","href","onAfterOpen","take","subscribe","_","sheetElement","getAttribute","delete","persistAttr","remove","mergeMap","response","closeSheet","event","size","lastSheet","Array","from","pop","dismiss","state","sheetsArray","length","next","has","closeAll","forEach","get","SchmancySheet","$LitElement","super","arguments","open","Side","sheetRef","createRef","focusAttribute","lastFocusedElement","handleOverlayClick","stopPropagation","handleHeaderDismiss","_oldValue","newValue","activeElement","setBackgroundInert","focus","connectedCallback","setupEventListeners","disconnectedCallback","disconnecting","popState$","preventDefault","keyUp$","key","rickyComm$","merge","inert","parent","children","child","removeAttribute","isShown","value","getFocusElement","selector","el","matches","autofocusElement","sheetClasses","overlayClasses","overlay","classMap","ifDefined","ref","cache","propName","options","__decorateClass","property","type","reflect","prototype","Boolean","queryAssignedElements","flatten","protoOrDescriptor","name","willUpdate","Object","assign","waitUntilFirstUpdate","changedProps","call","oldValue","hasUpdated"],"mappings":";;;;;;;;;;;;AAKA,IAAqBA,IAArB,cAAiDC,EAAgBC,GAAA,EAAA;AAAA,EAChE,SAAAC;AACC,WAAOC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,gBAKO,MAAA;AACRC,WAAKC,cACJ,IAAIC,YAAY,WAAW,EAC1BC,SAAAA,IACAC,UAAAA,GAAU,CAAA,CAAA;AAAA,IAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAaJ,MAAA;AACRJ,WAAKC,cACJ,IAAIC,YAAY,WAAW,EAC1BC,SAAAA,IACAC,UAAAA,GAAU,CAAA,CAAA;AAAA,IAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWnB;AAAA;AAvCoBT;;;GAArB,CADCU,EAAc,uBAAA,CAAA,GACMV,CAAAA;ACad,IAAKW,KAAAA,QACXA,EAAA,OAAO,QACPA,EAAA,SAAS,UAFEA,IAAAA,KAAA,CAAA,CAAA;AA0BL,MAAMC,IAAwB,uBAMxBC,IAAiB,YA2SjBC,IAAQ,IApSrB,MAAA;AAAA,EAUC,cAAAC;AATAV,SAAAW,cAAc,IAAIC,KAClBZ,KAAAa,WAAW,IAAID,KAEf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,EAAWK,KAAKzK,MAAMwK,CAAAA,GAElBA,EAAanE,IAAImD,CAAAA,GAAW;AAC/B,YAAMkB,IAAWF,EAAahE,IAAIgD,CAAAA,GAC5BjC,IAAWvH,KAAKwJ,CAAAA;AAElBkB,MAAAA,MAAanD,MACXkC,GAASc,wBAAAA,CAAwBvK,KAAK2K,cAC1C3K,KAAKmK,GAAMM,KAAKzK,MAAM0K,GAAUnD,CAAAA;AAAAA,IAGnC;AAAA,EACD;KDlBmBd,EAkBpBqD,WAAA,gBAAA,CAAA,GAlBoBrD,IAArBiD,EAAA,CADCrJ,EAAc,oBACMoG,CAAAA;"}
@@ -0,0 +1,52 @@
1
+ "use strict";const i=require("rxjs"),b=require("lit/directives/class-map.js");require("lit/directives/style-map.js");const k=require("./tailwind.mixin-DVKI3qb9.cjs"),d=require("lit/decorators.js"),u=require("lit"),A=require("./litElement.mixin-B01R2oT7.cjs"),x=require("lit/directives/cache.js"),g=require("lit/directives/if-defined.js"),w=require("lit/directives/ref.js"),E=require("./theme.component-Dnf9PdX8.cjs");var C=Object.getOwnPropertyDescriptor;let S=class extends k.TailwindElement(u.css``){render(){return u.html`
2
+ <sch-flex class="absolute top-0 left-0 md:left-[unset] md:right-0">
3
+ <div class="block md:hidden flex-1 justify-start items-start">
4
+ <slot name="back">
5
+ <schmancy-button
6
+ @click=${()=>{this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0}))}}
7
+ >
8
+ <span class="text-[24px]">&#8592; </span>
9
+ </schmancy-button>
10
+ </slot>
11
+ </div>
12
+
13
+ <div class="hidden md:block flex-1 justify-end items-end">
14
+ <slot name="actions">
15
+ <schmancy-icon-button
16
+ @click=${()=>{this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0}))}}
17
+ >
18
+ close
19
+ </schmancy-icon-button>
20
+ </slot>
21
+ </div>
22
+ </sch-flex>
23
+ `}};S=((t,e,s,n)=>{for(var o,r=n>1?void 0:n?C(e,s):e,h=t.length-1;h>=0;h--)(o=t[h])&&(r=o(r)||r);return r})([d.customElement("schmancy-sheet-header")],S);var v=(t=>(t.Side="side",t.Bottom="bottom",t))(v||{});const m="are-you-there-sheet",y="yes-here",p=new class{constructor(){this.bottomSheet=new i.Subject,this.$dismiss=new i.Subject,this.activeSheets=new Set,this.sheetComponents=new Map,this.popStateListenerActive=!1,this.setupSheetOpeningLogic(),this.setupSheetDismissLogic(),this.setupPopStateListener()}setupSheetOpeningLogic(){this.bottomSheet.pipe(i.switchMap(t=>i.forkJoin([i.fromEvent(window,y).pipe(i.takeUntil(i.timer(50)),i.map(e=>e.detail),i.defaultIfEmpty(void 0)),i.fromEvent(window,E.ThemeHereIAm).pipe(i.takeUntil(i.timer(100)),i.map(e=>e.detail.theme),i.defaultIfEmpty(void 0)),i.of(t).pipe(i.tap(()=>{const e=t.uid??t.component.tagName;window.dispatchEvent(new CustomEvent(m,{detail:{uid:e}})),window.dispatchEvent(new CustomEvent(E.ThemeWhereAreYou))}))])),i.map(([t,e,s])=>{let n,o=t?.sheet;if(o)n=o.parentElement;else{n=e||document.querySelector("schmancy-theme")||document.body;const h=s.uid??s.component.tagName;o=document.createElement("schmancy-sheet"),o.setAttribute("uid",h),n.appendChild(o)}s.lock&&o.setAttribute("lock","true");const r=s.position||(window.innerWidth>=768?"side":"bottom");return o.setAttribute("position",r),s.title&&o.setAttribute("title",s.title),s.persist&&o.setAttribute("persist",String(s.persist)),s.header&&o.setAttribute("header",s.header),s.handleHistory!==void 0&&o.setAttribute("handleHistory",String(s.handleHistory)),document.body.style.overflow="hidden",{target:s,sheet:o}}),i.delay(20),i.tap(({target:t,sheet:e})=>{t.onBeforeOpen&&t.onBeforeOpen(t.component),(e?.shadowRoot?.querySelector("slot")?.assignedElements()||[]).find(s=>s.tagName===t.component.tagName)||e?.appendChild(t.component)}),i.delay(1),i.tap(({target:t,sheet:e})=>{e?.setAttribute("open","true");const s=t.uid??(t.component instanceof HTMLElement?t.component.tagName:`sheet-${Date.now()}`);if(this.activeSheets.add(s),this.sheetComponents.set(s,t.component),t.handleHistory!==!1){const n={schmancySheet:!0,uid:s,timestamp:Date.now()};history.pushState(n,"",window.location.href)}t.onAfterOpen&&t.onAfterOpen(t.component),i.fromEvent(e,"close").pipe(i.take(1)).pipe(i.delay(300)).subscribe(n=>{const o=e;if(o){const r=o.getAttribute("uid");r&&(this.activeSheets.delete(r),this.sheetComponents.delete(r));const h=o.getAttribute("persist");(!h||h==="false")&&o.remove()}document.body.style.overflow="auto"})})).subscribe()}setupSheetDismissLogic(){this.$dismiss.pipe(i.mergeMap(t=>i.forkJoin([i.fromEvent(window,y).pipe(i.takeUntil(i.timer(100)),i.map(e=>e.detail),i.defaultIfEmpty(void 0)),i.of(t).pipe(i.tap(()=>{window.dispatchEvent(new CustomEvent(m,{detail:{uid:t}}))}))])),i.tap(([t,e])=>{t?.sheet&&(t.sheet.closeSheet(),this.activeSheets.delete(e))})).subscribe()}setupPopStateListener(){this.popStateListenerActive||(i.fromEvent(window,"popstate").subscribe(t=>{if(this.activeSheets.size>0){const e=Array.from(this.activeSheets).pop();e&&(this.dismiss(e),t.state&&t.state.schmancySheet&&history.pushState({},"",window.location.href))}}),this.popStateListenerActive=!0)}dismiss(t){if(!t&&this.activeSheets.size>0){const e=Array.from(this.activeSheets);t=e[e.length-1]}t&&this.$dismiss.next(t)}open(t){this.bottomSheet.next(t)}isOpen(t){return this.activeSheets.has(t)}closeAll(){Array.from(this.activeSheets).forEach(t=>{this.dismiss(t)})}getComponent(t){return this.sheetComponents.get(t)}};var $=Object.defineProperty,O=Object.getOwnPropertyDescriptor,c=(t,e,s,n)=>{for(var o,r=n>1?void 0:n?O(e,s):e,h=t.length-1;h>=0;h--)(o=t[h])&&(r=(n?o(e,s,r):o(r))||r);return n&&r&&$(e,s,r),r};let a=class extends A.$LitElement(":host{--overlay-color: var(--schmancy-sys-color-surface-dim);--transition-timing: cubic-bezier(.16, 1, .3, 1);--transition-duration: .25s;--sheet-radius: 0;--max-height: 100vh}.sheet{position:fixed;inset:0;z-index:999;display:flex;visibility:visible;transition:visibility var(--transition-duration) var(--transition-timing)}.sheet[aria-hidden=true]{visibility:hidden;pointer-events:none}.sheet[aria-hidden=true] .content{transform:translateY(100%)}.sheet[aria-hidden=true] .content[data-position=side]{transform:translate(100%)}.sheet[aria-hidden=true] .overlay{opacity:0}.overlay{position:absolute;inset:0;background:var(--overlay-color);opacity:.8;transition:opacity var(--transition-duration) var(--transition-timing)}.content{z-index:1;transition:transform var(--transition-duration) var(--transition-timing);overflow:hidden}.content[data-position=side]{height:100vh;height:100%;min-width:320px;max-width:90vw;width:fit-content;margin-left:auto}.content[data-position=side] #body{max-height:100vh}.content[data-position=bottom]{width:100%;margin-top:auto;border-radius:16px 16px 0 0;max-height:90vh}.content[data-position=bottom] #body{max-height:90vh}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}"){constructor(){super(...arguments),this.open=!1,this.header="visible",this.position=v.Side,this.persist=!1,this.lock=!1,this.handleHistory=!0,this.title="",this.sheetRef=w.createRef(),this.focusAttribute="autofocus",this.lastFocusedElement=null,this.handleOverlayClick=t=>{t.stopPropagation(),this.lock||p.dismiss(this.uid)},this.handleHeaderDismiss=t=>{t.stopPropagation(),p.dismiss(this.uid)}}onOpenChange(t,e){e?(this.lastFocusedElement=document.activeElement,this.setBackgroundInert(!0),this.focus()):(this.setBackgroundInert(!1),this.lastFocusedElement?.focus(),this.lastFocusedElement=null)}connectedCallback(){super.connectedCallback(),this.setupEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.disconnecting.next(!0)}setupEventListeners(){const t=this.handleHistory?i.fromEvent(window,"popstate").pipe(i.tap(n=>{n.preventDefault(),this.closeSheet()})):i.of(null).pipe(i.take(0)),e=i.fromEvent(this,"keydown").pipe(i.tap(n=>{n.key==="Escape"&&!this.lock&&this.open&&(n.preventDefault(),n.stopPropagation(),p.dismiss(this.uid))})),s=i.fromEvent(window,m).pipe(i.tap(n=>{n.detail.uid===this.uid&&this.dispatchEvent(new CustomEvent(y,{detail:{sheet:this},bubbles:!0,composed:!0}))}));i.merge(t,e,s).pipe(i.takeUntil(this.disconnecting)).subscribe()}setBackgroundInert(t){const e=this.parentElement;e&&Array.from(e.children).forEach(s=>{s!==this&&s instanceof HTMLElement&&(t?s.setAttribute("inert",""):s.removeAttribute("inert"))}),this.parentElement===document.body&&Array.from(document.body.children).forEach(s=>{s!==this&&s!==e&&s instanceof HTMLElement&&(t?s.setAttribute("inert",""):s.removeAttribute("inert"))})}setIsSheetShown(t){this.sheetRef.value?.setAttribute("aria-hidden",String(!t)),this.sheetRef.value?.setAttribute("aria-modal",String(t))}closeSheet(){this.open=!1,this.dispatchEvent(new CustomEvent("close"))}getFocusElement(){const t=`[${this.focusAttribute}]`;return this.assignedElements.find(e=>e.matches(t)||e.querySelector(t))??null}focus(){const t=this.querySelector("[autofocus]");t?t.focus():this.getFocusElement()?.focus()}render(){const t={sheet:!0,"sheet--open":this.open,"sheet--locked":this.lock},e={overlay:!0,"overlay--interactive":!this.lock};return u.html`
24
+ <div
25
+ class=${b.classMap(t)}
26
+ role="dialog"
27
+ aria-labelledby=${g.ifDefined(this.header!=="hidden"?"sheet-title":void 0)}
28
+ aria-hidden=${!this.open}
29
+ aria-modal=${this.open}
30
+ tabindex="0"
31
+ ${w.ref(this.sheetRef)}
32
+ >
33
+ <div class=${b.classMap(e)} @click=${this.lock?void 0:this.handleOverlayClick}></div>
34
+ <schmancy-grid
35
+ rows=${this.header==="hidden"?"1fr":"auto 1fr"}
36
+ class="content w-full"
37
+ data-position=${this.position}
38
+ >
39
+ ${x.cache(this.header!=="hidden"?u.html`<schmancy-sheet-header
40
+ class="sticky top-0 z-50 w-full"
41
+ @dismiss=${this.handleHeaderDismiss}
42
+ id="sheet-title"
43
+ title=${g.ifDefined(this.title||void 0)}
44
+ ></schmancy-sheet-header>`:"")}
45
+
46
+ <schmancy-surface rounded="left" fill="all" id="body" class="overflow-auto" type="surface">
47
+ <schmancy-scroll> <slot></slot></schmancy-scroll>
48
+ </schmancy-surface>
49
+ </schmancy-grid>
50
+ </div>
51
+ `}};var l,f;c([d.property({type:String,reflect:!0})],a.prototype,"uid",2),c([d.property({type:Boolean,reflect:!0})],a.prototype,"open",2),c([d.property({type:String,reflect:!0})],a.prototype,"header",2),c([d.property({type:String,reflect:!0})],a.prototype,"position",2),c([d.property({type:Boolean,reflect:!0})],a.prototype,"persist",2),c([d.property({type:Boolean,reflect:!0})],a.prototype,"lock",2),c([d.property({type:Boolean,reflect:!0})],a.prototype,"handleHistory",2),c([d.property({type:String,reflect:!0})],a.prototype,"title",2),c([d.queryAssignedElements({flatten:!0})],a.prototype,"assignedElements",2),c([d.property()],a.prototype,"focusAttribute",2),c([(l="open",(t,e)=>{const{willUpdate:s}=t;f=Object.assign({waitUntilFirstUpdate:!1},f),t.willUpdate=function(n){if(s.call(this,n),n.has(l)){const o=n.get(l),r=this[l];o!==r&&(f?.waitUntilFirstUpdate&&!this.hasUpdated||this[e].call(this,o,r))}}})],a.prototype,"onOpenChange",1),a=c([d.customElement("schmancy-sheet")],a),exports.SchmancySheetPosition=v,exports.SheetHereMorty=y,exports.SheetWhereAreYouRicky=m,exports.sheet=p;
52
+ //# sourceMappingURL=sheet-Dsx7bpof.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet-Dsx7bpof.cjs","sources":["../src/sheet/header.ts","../src/sheet/sheet.service.ts","../src/sheet/sheet.ts","../src/sheet/hook.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-sheet-header')\nexport default class SchmancySheetHeader extends TailwindElement(css``) {\n\trender() {\n\t\treturn html`\n\t\t\t<sch-flex class=\"absolute top-0 left-0 md:left-[unset] md:right-0\">\n\t\t\t\t<div class=\"block md:hidden flex-1 justify-start items-start\">\n\t\t\t\t\t<slot name=\"back\">\n\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span class=\"text-[24px]\">&#8592; </span>\n\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"hidden md:block flex-1 justify-end items-end\">\n\t\t\t\t\t<slot name=\"actions\">\n\t\t\t\t\t\t<schmancy-icon-button\n\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tclose\n\t\t\t\t\t\t</schmancy-icon-button>\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\t\t\t</sch-flex>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet-header': SchmancySheetHeader\n\t}\n}\n","import {\n\tdefaultIfEmpty,\n\tdelay,\n\tforkJoin,\n\tfromEvent,\n\tmap,\n\tmergeMap,\n\tof,\n\tSubject,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n\ttimer\n} from 'rxjs'\nimport { ThemeHereIAm, ThemeHereIAmEvent, ThemeWhereAreYou } from '../theme/theme.component'\nimport SchmancySheet from './sheet'\n\nexport enum SchmancySheetPosition {\n\tSide = 'side',\n\tBottom = 'bottom',\n}\n\nexport type SheetConfig = {\n\tcomponent: HTMLElement\n\tuid?: string\n\tposition?: SchmancySheetPosition\n\tpersist?: boolean\n\tclose?: () => void\n\tlock?: boolean // Controls both ESC and overlay click dismissal\n\thandleHistory?: boolean // Controls browser back button behavior\n\ttitle?: string\n\theader?: 'hidden' | 'visible'\n\tonBeforeOpen?: (component: HTMLElement) => void\n\tonAfterOpen?: (component: HTMLElement) => void\n}\n\n// Keep old name for backward compatibility\ntype BottomSheeetTarget = SheetConfig\n\n// Events for communication between bottom-sheet component and bottom-sheet.service\nexport type SheetWhereAreYouRickyEvent = CustomEvent<{\n\tuid: string\n}>\nexport const SheetWhereAreYouRicky = 'are-you-there-sheet'\n\nexport type SheetHereMortyEvent = CustomEvent<{\n\tsheet?: SchmancySheet\n\ttheme?: HTMLElement\n}>\nexport const SheetHereMorty = 'yes-here'\n\n// Function to determine the position based on screen size\nconst getPosition = (): SchmancySheetPosition => {\n\treturn window.innerWidth >= 768 ? SchmancySheetPosition.Side : SchmancySheetPosition.Bottom // Adjust 768 as needed for your breakpoint\n}\n\nclass BottomSheetService {\n\tbottomSheet = new Subject<BottomSheeetTarget>()\n\t$dismiss = new Subject<string>()\n\t// Track currently open sheets\n\tprivate activeSheets = new Set<string>()\n\t// Track sheet components for retrieval\n\tprivate sheetComponents = new Map<string, HTMLElement>()\n\t// To track if we've set up the popstate listener\n\tprivate popStateListenerActive = false\n\n\tconstructor() {\n\t\tthis.setupSheetOpeningLogic()\n\t\tthis.setupSheetDismissLogic()\n\t\tthis.setupPopStateListener()\n\t}\n\n\t/**\n\t * Sets up the main sheet opening logic\n\t */\n\tprivate setupSheetOpeningLogic() {\n\t\tthis.bottomSheet\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\t// First check for existing sheet\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(50)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t// Then find theme container\n\t\t\t\t\t\tfromEvent<ThemeHereIAmEvent>(window, ThemeHereIAm).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail.theme),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\t// Determine uid - use provided uid or component tagName\n\t\t\t\t\t\t\t\tconst uid = target.uid ?? target.component.tagName\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// First ask for existing sheet\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(SheetWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t// Then ask for theme container\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(ThemeWhereAreYou),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\n\t\t\t\tmap(([existingSheet, theme, target]) => {\n\t\t\t\t\tlet sheet = existingSheet?.sheet\n\t\t\t\t\tlet targetContainer: HTMLElement\n\t\t\t\t\t\n\t\t\t\t\tif (sheet) {\n\t\t\t\t\t\t// Use existing sheet\n\t\t\t\t\t\tconsole.log('Found existing sheet:', sheet)\n\t\t\t\t\t\ttargetContainer = sheet.parentElement as HTMLElement\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Determine container - use theme from discovery or fallback\n\t\t\t\t\t\ttargetContainer = theme || \n\t\t\t\t\t\t document.querySelector('schmancy-theme') as HTMLElement || \n\t\t\t\t\t\t document.body\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Create new sheet\n\t\t\t\t\t\tconst uid = target.uid ?? target.component.tagName\n\t\t\t\t\t\tconsole.log('Creating new sheet for uid:', uid)\n\t\t\t\t\t\tsheet = document.createElement('schmancy-sheet')\n\t\t\t\t\t\tsheet.setAttribute('uid', uid)\n\t\t\t\t\t\ttargetContainer.appendChild(sheet)\n\t\t\t\t\t}\n\n\t\t\t\t\ttarget.lock && sheet.setAttribute('lock', 'true')\n\n\t\t\t\t\t// Use the dynamic position function here\n\t\t\t\t\tconst position = target.position || getPosition()\n\t\t\t\t\tsheet.setAttribute('position', position)\n\n\t\t\t\t\ttarget.title && sheet.setAttribute('title', target.title)\n\t\t\t\t\ttarget.persist && sheet.setAttribute('persist', String(target.persist))\n\t\t\t\t\ttarget.header && sheet.setAttribute('header', target.header)\n\n\t\t\t\t\t// Handle history logic if the property exists\n\t\t\t\t\tif (target.handleHistory !== undefined) {\n\t\t\t\t\t\tsheet.setAttribute('handleHistory', String(target.handleHistory))\n\t\t\t\t\t}\n\n\t\t\t\t\tdocument.body.style.overflow = 'hidden' // lock the scroll of the host\n\t\t\t\t\treturn { target, sheet: sheet as SchmancySheet }\n\t\t\t\t}),\n\t\t\t\tdelay(20),\n\t\t\t\ttap(({ target, sheet }) => {\n\t\t\t\t\t// Call onBeforeOpen callback if provided\n\t\t\t\t\tif (target.onBeforeOpen) {\n\t\t\t\t\t\ttarget.onBeforeOpen(target.component)\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Handle HTMLElement components\n\t\t\t\t\tconst assignedElements = sheet?.shadowRoot\n\t\t\t\t\t\t?.querySelector('slot')\n\t\t\t\t\t\t?.assignedElements() || []\n\t\t\t\t\t\n\t\t\t\t\tconsole.log('Assigned elements in sheet:', assignedElements.map(e => (e as HTMLElement).tagName))\n\t\t\t\t\t\n\t\t\t\t\tconst existingComponent = assignedElements.find(e => (e as HTMLElement).tagName === target.component.tagName)\n\t\t\t\t\t\n\t\t\t\t\tif (!existingComponent) {\n\t\t\t\t\t\t// Need to append the component\n\t\t\t\t\t\tconsole.log('Component not found, will append:', target.component.tagName)\n\t\t\t\t\t\tsheet?.appendChild(target.component)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log('Component already exists, reusing:', target.component.tagName)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tdelay(1),\n\t\t\t\ttap(({ target, sheet }) => {\n\t\t\t\t\tsheet?.setAttribute('open', 'true')\n\n\t\t\t\t\t// Add to active sheets tracking\n\t\t\t\t\tconst uid = target.uid ?? \n\t\t\t\t\t\t(target.component instanceof HTMLElement ? target.component.tagName : `sheet-${Date.now()}`)\n\t\t\t\t\tthis.activeSheets.add(uid)\n\t\t\t\t\tthis.sheetComponents.set(uid, target.component)\n\n\t\t\t\t\t// Handle history integration - default to true if not specified\n\t\t\t\t\tconst shouldHandleHistory = target.handleHistory !== false\n\n\t\t\t\t\tif (shouldHandleHistory) {\n\t\t\t\t\t\t// Use history state to track this specific sheet\n\t\t\t\t\t\tconst historyState = {\n\t\t\t\t\t\t\tschmancySheet: true,\n\t\t\t\t\t\t\tuid: uid,\n\t\t\t\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Push a new history state\n\t\t\t\t\t\thistory.pushState(historyState, '', window.location.href)\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Call onAfterOpen callback if provided\n\t\t\t\t\tif (target.onAfterOpen) {\n\t\t\t\t\t\ttarget.onAfterOpen(target.component)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set up close event listener (always, not just for new sheets)\n\t\t\t\t\tfromEvent<CustomEvent>(sheet, 'close')\n\t\t\t\t\t\t.pipe(take(1))\n\t\t\t\t\t\t.pipe(delay(300))\n\t\t\t\t\t\t.subscribe(_ => {\n\t\t\t\t\t\t\t// Use the sheet reference directly, not e.target\n\t\t\t\t\t\t\tconst sheetElement = sheet as SchmancySheet\n\t\t\t\t\t\t\tconsole.log('Close event fired for sheet:', sheetElement)\n\n\t\t\t\t\t\t\t// Remove from active sheets tracking\n\t\t\t\t\t\t\tif (sheetElement) {\n\t\t\t\t\t\t\t\tconst uid = sheetElement.getAttribute('uid')\n\t\t\t\t\t\t\t\tif (uid) {\n\t\t\t\t\t\t\t\t\tthis.activeSheets.delete(uid)\n\t\t\t\t\t\t\t\t\tthis.sheetComponents.delete(uid)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Only keep sheet if persist is explicitly set to a truthy value\n\t\t\t\t\t\t\t\tconst persistAttr = sheetElement.getAttribute('persist')\n\t\t\t\t\t\t\t\tconst shouldRemove = !persistAttr || persistAttr === 'false'\n\t\t\t\t\t\t\t\tconsole.log('Sheet close - persist:', persistAttr, 'shouldRemove:', shouldRemove)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (shouldRemove) {\n\t\t\t\t\t\t\t\t\tconsole.log('Removing sheet from DOM:', uid)\n\t\t\t\t\t\t\t\t\tsheetElement.remove()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdocument.body.style.overflow = 'auto' // unlock the scroll of the host\n\t\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Sets up the sheet closing/dismissal logic\n\t */\n\tprivate setupSheetDismissLogic() {\n\t\tthis.$dismiss\n\t\t\t.pipe(\n\t\t\t\tmergeMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(SheetWhereAreYouRicky, { detail: { uid } }))\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([response, uid]) => {\n\t\t\t\t\tconsole.log('Dismiss called for uid:', uid, 'Found sheet:', !!response?.sheet)\n\t\t\t\t\tif (response?.sheet) {\n\t\t\t\t\t\tresponse.sheet.closeSheet()\n\t\t\t\t\t\tthis.activeSheets.delete(uid)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log('No sheet found to dismiss for uid:', uid)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Sets up the popstate listener to handle browser back button\n\t */\n\tprivate setupPopStateListener() {\n\t\tif (this.popStateListenerActive) return\n\n\t\tfromEvent<PopStateEvent>(window, 'popstate').subscribe(event => {\n\t\t\t// If we have active sheets, close the most recently opened one\n\t\t\tif (this.activeSheets.size > 0) {\n\t\t\t\t// Get the last sheet (Set maintains insertion order)\n\t\t\t\tconst lastSheet = Array.from(this.activeSheets).pop()\n\t\t\t\tif (lastSheet) {\n\t\t\t\t\tthis.dismiss(lastSheet)\n\n\t\t\t\t\t// Prevent default navigation behavior by pushing a new state\n\t\t\t\t\t// This effectively cancels out the back navigation\n\t\t\t\t\tif (event.state && event.state.schmancySheet) {\n\t\t\t\t\t\thistory.pushState({}, '', window.location.href)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tthis.popStateListenerActive = true\n\t}\n\n\t/**\n\t * Dismiss a sheet by uid, or dismiss the most recently opened sheet if no uid provided\n\t */\n\tdismiss(uid?: string) {\n\t\tif (!uid && this.activeSheets.size > 0) {\n\t\t\t// Get the last sheet opened (Set maintains insertion order)\n\t\t\tconst sheetsArray = Array.from(this.activeSheets)\n\t\t\tuid = sheetsArray[sheetsArray.length - 1]\n\t\t}\n\t\t\n\t\tif (uid) {\n\t\t\tthis.$dismiss.next(uid)\n\t\t}\n\t}\n\n\t/**\n\t * Open a sheet with the given target configuration\n\t */\n\topen(target: BottomSheeetTarget) {\n\t\tthis.bottomSheet.next(target)\n\t}\n\n\t/**\n\t * Check if a sheet is currently open by uid\n\t */\n\tisOpen(uid: string): boolean {\n\t\treturn this.activeSheets.has(uid)\n\t}\n\n\t/**\n\t * Close all open sheets\n\t */\n\tcloseAll() {\n\t\t// Copy the set to avoid modification during iteration\n\t\tArray.from(this.activeSheets).forEach(uid => {\n\t\t\tthis.dismiss(uid)\n\t\t})\n\t}\n\n\t/**\n\t * Gets the component instance for a given sheet\n\t * @param uid - The unique identifier of the sheet\n\t * @returns The component instance, or undefined if not found\n\t */\n\tgetComponent<T extends HTMLElement = HTMLElement>(uid: string): T | undefined {\n\t\treturn this.sheetComponents.get(uid) as T | undefined\n\t}\n}\nexport const sheet = new BottomSheetService()","import { $LitElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property, queryAssignedElements } from 'lit/decorators.js'\nimport { cache } from 'lit/directives/cache.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { fromEvent, merge, of, take, takeUntil, tap } from 'rxjs'\nimport { on } from './hook'\nimport style from './sheet.scss?inline'\nimport {\n\tSchmancySheetPosition,\n\tSheetHereMorty,\n\tSheetWhereAreYouRicky,\n\tSheetWhereAreYouRickyEvent,\n\tsheet,\n} from './sheet.service'\n\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(style) {\n\t@property({ type: String, reflect: true }) uid!: string\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) header: 'hidden' | 'visible' = 'visible'\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) lock = false\n\t@property({ type: Boolean, reflect: true }) handleHistory = true\n\t@property({ type: String, reflect: true }) title = ''\n\n\t// Use ref directive instead of @query\n\tprivate sheetRef = createRef<HTMLDivElement>()\n\t@queryAssignedElements({ flatten: true }) private assignedElements!: HTMLElement[]\n\n\t@property() focusAttribute = 'autofocus'\n\tprivate lastFocusedElement: HTMLElement | null = null\n\n\t@on('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\t// Use native inert attribute to prevent focus outside sheet\n\t\t\tthis.setBackgroundInert(true)\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.setBackgroundInert(false)\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button - only if handleHistory is true\n\t\tconst popState$ = this.handleHistory\n\t\t\t? fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\t\t\ttap(e => {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\tthis.closeSheet()\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t: of(null).pipe(take(0)) // Empty observable if handleHistory is false\n\n\t\t// Handle ESC key - listen on the sheet element for better event capture\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(this, 'keydown').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.lock && this.open) {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle inter-component communication\n\t\tconst rickyComm$ = fromEvent<SheetWhereAreYouRickyEvent>(window, SheetWhereAreYouRicky).pipe(\n\t\t\ttap(e => {\n\t\t\t\tif (e.detail.uid === this.uid)\n\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent(SheetHereMorty, {\n\t\t\t\t\t\t\tdetail: { sheet: this },\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, rickyComm$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate setBackgroundInert(inert: boolean) {\n\t\t// Get all sibling elements and make them inert\n\t\tconst parent = this.parentElement\n\t\tif (parent) {\n\t\t\tArray.from(parent.children).forEach(child => {\n\t\t\t\tif (child !== this && child instanceof HTMLElement) {\n\t\t\t\t\tif (inert) {\n\t\t\t\t\t\tchild.setAttribute('inert', '')\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchild.removeAttribute('inert')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\t// Also handle body's direct children if sheet is attached to body\n\t\tif (this.parentElement === document.body) {\n\t\t\tArray.from(document.body.children).forEach(child => {\n\t\t\t\tif (child !== this && child !== parent && child instanceof HTMLElement) {\n\t\t\t\t\tif (inert) {\n\t\t\t\t\t\tchild.setAttribute('inert', '')\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchild.removeAttribute('inert')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n\n\tsetIsSheetShown(isShown: boolean) {\n\t\tthis.sheetRef.value?.setAttribute('aria-hidden', String(!isShown))\n\t\tthis.sheetRef.value?.setAttribute('aria-modal', String(isShown))\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\tprivate getFocusElement(): HTMLElement | null {\n\t\tconst selector = `[${this.focusAttribute}]`\n\t\treturn (this.assignedElements.find(el => el.matches(selector) || el.querySelector(selector)) as HTMLElement) ?? null\n\t}\n\n\toverride focus() {\n\t\t// First try native autofocus attribute\n\t\tconst autofocusElement = this.querySelector('[autofocus]') as HTMLElement\n\t\tif (autofocusElement) {\n\t\t\tautofocusElement.focus()\n\t\t\treturn\n\t\t}\n\n\t\t// Fallback to custom focus attribute\n\t\tthis.getFocusElement()?.focus()\n\t}\n\n\tprivate handleOverlayClick = (e: Event) => {\n\t\te.stopPropagation()\n\t\tif (!this.lock) {\n\t\t\tsheet.dismiss(this.uid)\n\t\t}\n\t}\n\n\tprivate handleHeaderDismiss = (e: CustomEvent) => {\n\t\te.stopPropagation()\n\t\tsheet.dismiss(this.uid)\n\t}\n\n\trender() {\n\t\tconst sheetClasses = {\n\t\t\tsheet: true,\n\t\t\t'sheet--open': this.open,\n\t\t\t'sheet--locked': this.lock,\n\t\t}\n\n\t\tconst overlayClasses = {\n\t\t\toverlay: true,\n\t\t\t'overlay--interactive': !this.lock,\n\t\t}\n\n\t\treturn html`\n\t\t\t<div\n\t\t\t\tclass=${classMap(sheetClasses)}\n\t\t\t\trole=\"dialog\"\n\t\t\t\taria-labelledby=${ifDefined(this.header !== 'hidden' ? 'sheet-title' : undefined)}\n\t\t\t\taria-hidden=${!this.open}\n\t\t\t\taria-modal=${this.open}\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t${ref(this.sheetRef)}\n\t\t\t>\n\t\t\t\t<div class=${classMap(overlayClasses)} @click=${this.lock ? undefined : this.handleOverlayClick}></div>\n\t\t\t\t<schmancy-grid\n\t\t\t\t\trows=${this.header === 'hidden' ? '1fr' : 'auto 1fr'}\n\t\t\t\t\tclass=\"content w-full\"\n\t\t\t\t\tdata-position=${this.position}\n\t\t\t\t>\n\t\t\t\t\t${cache(\n\t\t\t\t\t\tthis.header !== 'hidden'\n\t\t\t\t\t\t\t? html`<schmancy-sheet-header\n\t\t\t\t\t\t\t\t\tclass=\"sticky top-0 z-50 w-full\"\n\t\t\t\t\t\t\t\t\t@dismiss=${this.handleHeaderDismiss}\n\t\t\t\t\t\t\t\t\tid=\"sheet-title\"\n\t\t\t\t\t\t\t\t\ttitle=${ifDefined(this.title || undefined)}\n\t\t\t\t\t\t\t\t></schmancy-sheet-header>`\n\t\t\t\t\t\t\t: '',\n\t\t\t\t\t)}\n\n\t\t\t\t\t<schmancy-surface rounded=\"left\" fill=\"all\" id=\"body\" class=\"overflow-auto\" type=\"surface\">\n\t\t\t\t\t\t<schmancy-scroll> <slot></slot></schmancy-scroll>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</schmancy-grid>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n","// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n\twaitUntilFirstUpdate?: boolean\n}\n\nexport function on(propName: string, options?: WatchOptions) {\n\treturn (protoOrDescriptor: any, name: string): any => {\n\t\tconst { willUpdate } = protoOrDescriptor\n\n\t\toptions = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n\t\tprotoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n\t\t\twillUpdate.call(this, changedProps)\n\n\t\t\tif (changedProps.has(propName)) {\n\t\t\t\tconst oldValue = changedProps.get(propName)\n\t\t\t\tconst newValue = this[propName]\n\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tif (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n\t\t\t\t\t\tthis[name].call(this, oldValue, newValue)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["SchmancySheetHeader","TailwindElement","css","render","html","this","dispatchEvent","CustomEvent","bubbles","composed","customElement","SchmancySheetPosition","SheetWhereAreYouRicky","SheetHereMorty","sheet","constructor","bottomSheet","Subject","$dismiss","activeSheets","Set","sheetComponents","Map","popStateListenerActive","setupSheetOpeningLogic","setupSheetDismissLogic","setupPopStateListener","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","ThemeHereIAm","theme","of","target","tap","uid","component","tagName","ThemeWhereAreYou","existingSheet","targetContainer","parentElement","document","querySelector","body","createElement","setAttribute","appendChild","lock","position","innerWidth","title","persist","String","header","handleHistory","style","overflow","delay","onBeforeOpen","shadowRoot","assignedElements","find","HTMLElement","Date","now","add","set","historyState","schmancySheet","timestamp","history","pushState","location","href","onAfterOpen","take","subscribe","_","sheetElement","getAttribute","delete","persistAttr","remove","mergeMap","response","closeSheet","event","size","lastSheet","Array","from","pop","dismiss","state","sheetsArray","length","next","has","closeAll","forEach","get","SchmancySheet","$LitElement","super","arguments","open","Side","sheetRef","createRef","focusAttribute","lastFocusedElement","handleOverlayClick","stopPropagation","handleHeaderDismiss","_oldValue","newValue","activeElement","setBackgroundInert","focus","connectedCallback","setupEventListeners","disconnectedCallback","disconnecting","popState$","preventDefault","keyUp$","key","rickyComm$","merge","inert","parent","children","child","removeAttribute","isShown","value","getFocusElement","selector","el","matches","autofocusElement","sheetClasses","overlayClasses","overlay","classMap","ifDefined","ref","cache","propName","options","__decorateClass","property","type","reflect","prototype","Boolean","queryAssignedElements","flatten","protoOrDescriptor","name","willUpdate","Object","assign","waitUntilFirstUpdate","changedProps","call","oldValue","hasUpdated"],"mappings":"ucAKA,IAAqBA,EAArB,cAAiDC,EAAAA,gBAAgBC,EAAAA,OAChE,QAAAC,CACC,OAAOC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,gBAKO,IAA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qD,UAAA,OAAA,GACAJ,EAAA,CAA3CC,EAAAA,SAAS,CAAEC,KAAMG,QAASF,QAAAA,EAAS,CAAA,CAAA,EAPhBpD,EAOwBqD,UAAA,gBAAA,GACDJ,EAAA,CAA1CC,EAAAA,SAAS,CAAEC,KAAMpG,OAAQqG,QAAAA,EAAS,CAAA,CAAA,EARfpD,EAQuBqD,UAAA,QAAA,GAIOJ,EAAA,CAAjDM,wBAAsB,CAAEC,UAAS,CAAA,CAAA,EAZdxD,EAY8BqD,UAAA,mBAAA,CAAA,EAEtCJ,EAAA,CAAXC,EAAAA,SAAAA,CAAAA,EAdmBlD,EAcRqD,UAAA,iBAAA,GAIZJ,EAAA,ECnBkBF,EDkBd,OCjBG,CAACU,EAAwBC,IAAAA,CAC/B,KAAA,CAAMC,WAAEA,CAAAA,EAAeF,EAEvBT,EAAUY,OAAOC,OAAO,CAAEC,uBAAsB,EAASd,CAAAA,EAEzDS,EAAkBE,WAAa,SAAUI,EAAAA,CAGxC,GAFAJ,EAAWK,KAAKzK,KAAMwK,CAAAA,EAElBA,EAAanE,IAAImD,CAAAA,EAAW,CAC/B,MAAMkB,EAAWF,EAAahE,IAAIgD,CAAAA,EAC5BjC,EAAWvH,KAAKwJ,CAAAA,EAElBkB,IAAanD,IACXkC,GAASc,sBAAAA,CAAwBvK,KAAK2K,YAC1C3K,KAAKmK,CAAAA,EAAMM,KAAKzK,KAAM0K,EAAUnD,GAGnC,CACD,CAAA,EAAA,EDlBmBd,EAkBpBqD,UAAA,eAAA,GAlBoBrD,EAArBiD,EAAA,CADCrJ,EAAAA,cAAc,gBAAA,CAAA,EACMoG"}
package/dist/sheet.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./sheet-BY85jX0R.cjs");const e=require("./sheet.service-CNz7lXHC.cjs");exports.SchmancySheetPosition=e.SchmancySheetPosition,exports.SheetHereMorty=e.SheetHereMorty,exports.SheetWhereAreYouRicky=e.SheetWhereAreYouRicky,exports.sheet=e.sheet;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sheet-Dsx7bpof.cjs");exports.SchmancySheetPosition=e.SchmancySheetPosition,exports.SheetHereMorty=e.SheetHereMorty,exports.SheetWhereAreYouRicky=e.SheetWhereAreYouRicky,exports.sheet=e.sheet;
2
2
  //# sourceMappingURL=sheet.cjs.map
package/dist/sheet.js CHANGED
@@ -1,9 +1,8 @@
1
- import "./sheet-BY3YdE4E.js";
2
- import { S as r, b as s, a, s as h } from "./sheet.service-DSvFe5PY.js";
1
+ import { S as t, b as a, a as h, s as o } from "./sheet-DMP3Pfe5.js";
3
2
  export {
4
- r as SchmancySheetPosition,
5
- s as SheetHereMorty,
6
- a as SheetWhereAreYouRicky,
7
- h as sheet
3
+ t as SchmancySheetPosition,
4
+ a as SheetHereMorty,
5
+ h as SheetWhereAreYouRicky,
6
+ o as sheet
8
7
  };
9
8
  //# sourceMappingURL=sheet.js.map
package/dist/sheet.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sheet.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"sheet.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/dist/teleport.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-N8UvQjsm.cjs");exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.teleport=e.teleport;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-By_6fdSR.cjs");exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.teleport=e.teleport;
2
2
  //# sourceMappingURL=teleport.cjs.map
package/dist/teleport.js CHANGED
@@ -1,4 +1,4 @@
1
- import { H as o, q as t, W as a, t as s } from "./avatar-DbQohKTF.js";
1
+ import { H as o, q as t, W as a, t as s } from "./avatar-DZ45SZ_3.js";
2
2
  export {
3
3
  o as HereMorty,
4
4
  t as SchmancyTeleportation,
package/dist/theme.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sheet.service-CNz7lXHC.cjs"),m=require("./theme.interface-Xg5Zi46a.cjs");Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>e.SchmancyThemeComponent}),exports.ThemeHereIAm=e.ThemeHereIAm,exports.ThemeWhereAreYou=e.ThemeWhereAreYou,exports.formateTheme=e.formateTheme,exports.tailwindStyles=e.tailwindStyles,exports.SchmancyTheme=m.SchmancyTheme;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./theme.component-Dnf9PdX8.cjs"),m=require("./theme.interface-Xg5Zi46a.cjs");Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>e.SchmancyThemeComponent}),exports.ThemeHereIAm=e.ThemeHereIAm,exports.ThemeWhereAreYou=e.ThemeWhereAreYou,exports.formateTheme=e.formateTheme,exports.tailwindStyles=e.tailwindStyles,exports.SchmancyTheme=m.SchmancyTheme;
2
2
  //# sourceMappingURL=theme.cjs.map