@mhmo91/schmancy 0.6.1 → 0.6.2

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 (38) hide show
  1. package/dist/{avatar-Bp8OELqy.js → avatar-BMmeU44n.js} +4 -4
  2. package/dist/{avatar-Bp8OELqy.js.map → avatar-BMmeU44n.js.map} +1 -1
  3. package/dist/{avatar-gH9_xHZs.cjs → avatar-BqI1dN1B.cjs} +2 -2
  4. package/dist/{avatar-gH9_xHZs.cjs.map → avatar-BqI1dN1B.cjs.map} +1 -1
  5. package/dist/badge.cjs +1 -1
  6. package/dist/badge.js +1 -1
  7. package/dist/content-drawer.cjs +1 -1
  8. package/dist/content-drawer.js +1 -1
  9. package/dist/{email-recipients-DPpv0qRr.js → email-recipients-4TQJPQKu.js} +2 -2
  10. package/dist/{email-recipients-DPpv0qRr.js.map → email-recipients-4TQJPQKu.js.map} +1 -1
  11. package/dist/{email-recipients-Uogc-X_3.cjs → email-recipients-H0_FxRAQ.cjs} +2 -2
  12. package/dist/{email-recipients-Uogc-X_3.cjs.map → email-recipients-H0_FxRAQ.cjs.map} +1 -1
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.js +4 -4
  15. package/dist/mailbox.cjs +1 -1
  16. package/dist/mailbox.js +1 -1
  17. package/dist/nav-drawer.cjs +1 -1
  18. package/dist/nav-drawer.js +1 -1
  19. package/dist/navigation-bar.cjs +1 -1
  20. package/dist/navigation-bar.js +1 -1
  21. package/dist/{sheet-D5-XmZs5.js → sheet-9Eb7YGq-.js} +2 -2
  22. package/dist/{sheet-D5-XmZs5.js.map → sheet-9Eb7YGq-.js.map} +1 -1
  23. package/dist/{sheet-CcVGEdfr.cjs → sheet-DEJQhNgI.cjs} +2 -2
  24. package/dist/{sheet-CcVGEdfr.cjs.map → sheet-DEJQhNgI.cjs.map} +1 -1
  25. package/dist/sheet.cjs +1 -1
  26. package/dist/sheet.js +2 -2
  27. package/dist/sheet.service-B7zfNaO4.cjs +2 -0
  28. package/dist/sheet.service-B7zfNaO4.cjs.map +1 -0
  29. package/dist/sheet.service-ufuyuYea.js +80 -0
  30. package/dist/sheet.service-ufuyuYea.js.map +1 -0
  31. package/dist/teleport.cjs +1 -1
  32. package/dist/teleport.js +1 -1
  33. package/package.json +1 -1
  34. package/readme.md +5 -4
  35. package/dist/sheet.service-C66WNur0.js +0 -80
  36. package/dist/sheet.service-C66WNur0.js.map +0 -1
  37. package/dist/sheet.service-iUShtJp1.cjs +0 -2
  38. package/dist/sheet.service-iUShtJp1.cjs.map +0 -1
package/readme.md CHANGED
@@ -90,8 +90,7 @@ import '@mhmo91/schmancy/select'
90
90
 
91
91
  ### 📚 User Documentation
92
92
 
93
- - **[GitHub Wiki](https://github.com/mhmo91/schmancy/wiki)** - Comprehensive guides, examples, and API reference
94
- - **[Component Demos](https://schmancy-demo.netlify.app)** - Interactive examples and live playground
93
+ **[Interactive Component Demos](https://schmancy.samwa.ai/)** - Explore all components with live examples and code snippets
95
94
 
96
95
  ### 🤖 AI-Assisted Development
97
96
 
@@ -249,7 +248,7 @@ yarn test:coverage # With coverage report
249
248
 
250
249
  ### Project Structure
251
250
 
252
- ```
251
+ ```plaintext
253
252
  schmancy/
254
253
  ├── src/ # Library source code
255
254
  │ ├── Button/ # Component directories
@@ -274,6 +273,7 @@ We welcome contributions! Please:
274
273
  5. Ensure tests pass and types are correct
275
274
  6. Submit a pull request
276
275
 
276
+
277
277
  ## Browser Support
278
278
 
279
279
  Schmancy supports all modern browsers that implement the Web Components standard:
@@ -282,6 +282,7 @@ Schmancy supports all modern browsers that implement the Web Components standard
282
282
  - Firefox 88+
283
283
  - Safari 14+
284
284
 
285
+
285
286
  ## License
286
287
 
287
288
  Apache License 2.0 - see [LICENSE](LICENSE) file for details.
@@ -299,7 +300,7 @@ Built with:
299
300
  - **npm Package**: [@mhmo91/schmancy](https://www.npmjs.com/package/@mhmo91/schmancy)
300
301
  - **GitHub Repository**: [mhmo91/schmancy](https://github.com/mhmo91/schmancy)
301
302
  - **Issue Tracker**: [GitHub Issues](https://github.com/mhmo91/schmancy/issues)
302
- - **Documentation Wiki**: [GitHub Wiki](https://github.com/mhmo91/schmancy/wiki)
303
+ - **Demo Site**: [Component Demos](https://schmancy.samwa.ai/)
303
304
 
304
305
  ---
305
306
 
@@ -1,80 +0,0 @@
1
- import { Subject as b, switchMap as f, forkJoin as l, fromEvent as o, of as w, takeUntil as r, timer as d, map as p, defaultIfEmpty as u, tap as n, delay as m, take as y, mergeMap as g } from "rxjs";
2
- import { a as A, T as E } from "./theme.events-CPSLaOlR.js";
3
- var L = ((e) => (e.Side = "side", e.Bottom = "bottom", e))(L || {});
4
- const S = "are-you-there-sheet", v = "yes-here", C = new class {
5
- constructor() {
6
- this.bottomSheet = new b(), this.$dismiss = new b(), this.activeSheets = /* @__PURE__ */ new Set(), this.popStateListenerActive = !1, this.setupSheetOpeningLogic(), this.setupSheetDismissLogic(), this.setupPopStateListener();
7
- }
8
- setupSheetOpeningLogic() {
9
- this.bottomSheet.pipe(f((e) => l([o(window, v).pipe(r(d(50)), p((t) => t.detail), u(void 0)), o(window, A).pipe(r(d(50)), p((t) => t.detail.theme), u(void 0)), w(e).pipe(n(() => {
10
- const t = e.uid ?? `sheet-${Date.now()}`;
11
- window.dispatchEvent(new CustomEvent(S, { detail: { uid: t }, bubbles: !0, composed: !0 })), window.dispatchEvent(new CustomEvent(E, { bubbles: !0, composed: !0 }));
12
- }))])), p(([e, t, i]) => {
13
- let a, s = e?.sheet;
14
- if (s) a = s.parentElement;
15
- else {
16
- a = t || document.querySelector("schmancy-theme") || document.body;
17
- const c = i.uid ?? `sheet-${Date.now()}`;
18
- s = document.createElement("schmancy-sheet"), s.setAttribute("uid", c), a.appendChild(s);
19
- }
20
- i.lock && s.setAttribute("lock", "true");
21
- const h = i.position || (window.innerWidth >= 768 ? "side" : "bottom");
22
- return s.setAttribute("position", h), i.persist && s.setAttribute("persist", String(i.persist)), document.body.style.overflow = "hidden", { target: i, sheet: s };
23
- }), m(20), n(({ target: e, sheet: t }) => {
24
- window.dispatchEvent(new CustomEvent("schmancy-sheet-render", { detail: { component: e.component, uid: t.getAttribute("uid") }, bubbles: !0, composed: !0 }));
25
- }), m(1), n(({ target: e, sheet: t }) => {
26
- t?.setAttribute("open", "true");
27
- const i = e.uid ?? `sheet-${Date.now()}`;
28
- this.activeSheets.add(i), o(t, "close").pipe(y(1)).pipe(m(300)).subscribe((a) => {
29
- const s = t;
30
- if (s) {
31
- const h = s.getAttribute("uid");
32
- h && this.activeSheets.delete(h);
33
- const c = s.getAttribute("persist");
34
- (!c || c === "false") && s.remove();
35
- }
36
- document.body.style.overflow = "auto";
37
- });
38
- })).subscribe();
39
- }
40
- setupSheetDismissLogic() {
41
- this.$dismiss.pipe(g((e) => l([o(window, v).pipe(r(d(100)), p((t) => t.detail), u(void 0)), w(e).pipe(n(() => {
42
- window.dispatchEvent(new CustomEvent(S, { detail: { uid: e } }));
43
- }))])), n(([e, t]) => {
44
- e?.sheet && (e.sheet.closeSheet(), this.activeSheets.delete(t));
45
- })).subscribe();
46
- }
47
- setupPopStateListener() {
48
- this.popStateListenerActive || (o(window, "popstate").subscribe((e) => {
49
- if (this.activeSheets.size > 0) {
50
- const t = Array.from(this.activeSheets).pop();
51
- t && (this.dismiss(t), e.state && e.state.schmancySheet && history.pushState({}, "", window.location.href));
52
- }
53
- }), this.popStateListenerActive = !0);
54
- }
55
- dismiss(e) {
56
- if (!e && this.activeSheets.size > 0) {
57
- const t = Array.from(this.activeSheets);
58
- e = t[t.length - 1];
59
- }
60
- e && this.$dismiss.next(e);
61
- }
62
- open(e) {
63
- this.bottomSheet.next(e);
64
- }
65
- isOpen(e) {
66
- return this.activeSheets.has(e);
67
- }
68
- closeAll() {
69
- Array.from(this.activeSheets).forEach((e) => {
70
- this.dismiss(e);
71
- });
72
- }
73
- }();
74
- export {
75
- L as S,
76
- S as a,
77
- v as b,
78
- C as s
79
- };
80
- //# sourceMappingURL=sheet.service-C66WNur0.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sheet.service-C66WNur0.js","sources":["../src/sheet/sheet.service.ts"],"sourcesContent":["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 { ComponentType } from '../area/router.types'\nimport { ThemeHereIAm, ThemeHereIAmEvent, ThemeWhereAreYou } from '../theme/theme.events'\nimport SchmancySheet from './sheet'\n\nexport enum SchmancySheetPosition {\n\tSide = 'side',\n\tBottom = 'bottom',\n}\n\nexport type SheetConfig = {\n\tcomponent: ComponentType\n\tuid?: string\n\tposition?: SchmancySheetPosition\n\tpersist?: boolean\n\tclose?: () => void\n\tlock?: boolean // Controls both ESC and overlay click dismissal\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// 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(50)),\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 generate one\n\t\t\t\t\t\t\t\tconst uid = target.uid ?? `sheet-${Date.now()}`\n\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\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\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\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]),\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\n\t\t\t\t\tif (sheet) {\n\t\t\t\t\t\t// Use existing 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 || (document.querySelector('schmancy-theme') as HTMLElement) || document.body\n\n\t\t\t\t\t\t// Create new sheet\n\t\t\t\t\t\tconst uid = target.uid ?? `sheet-${Date.now()}`\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.persist && sheet.setAttribute('persist', String(target.persist))\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// Dispatch render event - sheet component will use area router to handle component\n\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent('schmancy-sheet-render', {\n\t\t\t\t\t\t\tdetail: { component: target.component, uid: sheet.getAttribute('uid') },\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\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 ?? `sheet-${Date.now()}`\n\t\t\t\t\tthis.activeSheets.add(uid)\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\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}\n\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\n\t\t\t\t\t\t\t\tif (shouldRemove) {\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\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\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}\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\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}\nexport const sheet = new BottomSheetService()\n"],"names":["SchmancySheetPosition","SheetWhereAreYouRicky","SheetHereMorty","sheet","this","bottomSheet","Subject","$dismiss","activeSheets","Set","popStateListenerActive","setupSheetOpeningLogic","setupSheetDismissLogic","setupPopStateListener","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","ThemeHereIAm","theme","of","target","tap","uid","Date","now","dispatchEvent","CustomEvent","bubbles","composed","ThemeWhereAreYou","existingSheet","targetContainer","parentElement","document","querySelector","body","createElement","setAttribute","appendChild","lock","position","innerWidth","persist","String","style","overflow","delay","component","getAttribute","add","take","subscribe","_","sheetElement","delete","persistAttr","remove","mergeMap","response","closeSheet","event","size","lastSheet","Array","from","pop","dismiss","state","schmancySheet","history","pushState","location","href","sheetsArray","length","next","has","forEach"],"mappings":";;AAmBO,IAAKA,KAAAA,CAAAA,OACXA,EAAA,OAAO,QACPA,EAAA,SAAS,UAFEA,IAAAA,KAAA,CAAA,CAAA;AAuBL,MAAMC,IAAwB,uBAMxBC,IAAiB,YAkPjBC,IAAQ,IA3OrB,MAAA;AAAA,EAQC;AAPAC,SAAAC,cAAc,IAAIC,KAClBF,KAAAG,WAAW,IAAID,KAEfF,KAAQI,mCAAmBC,OAE3BL,KAAQM,yBAAAA,IAG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AAA,EAErB;AAAA,EAKA,KAAKF,GAAAA;AACJxB,SAAKC,YAAY8E,KAAKvD,CAAAA;AAAAA,EACvB;AAAA,EAKA,OAAOE,GAAAA;AACN,WAAO1B,KAAKI,aAAa4E,IAAItD,CAAAA;AAAAA,EAC9B;AAAA,EAKA;AAECyC,UAAMC,KAAKpE,KAAKI,YAAAA,EAAc6E,QAAQvD,CAAAA,MAAAA;AACrC1B,WAAKsE,QAAQ5C,CAAAA;AAAAA,IAAAA,CAAAA;AAAAA,EAEf;AAAA;"}
@@ -1,2 +0,0 @@
1
- "use strict";const e=require("rxjs"),p=require("./theme.events-Car6U_SQ.cjs");var d=(t=>(t.Side="side",t.Bottom="bottom",t))(d||{});const a="are-you-there-sheet",c="yes-here",m=new class{constructor(){this.bottomSheet=new e.Subject,this.$dismiss=new e.Subject,this.activeSheets=new Set,this.popStateListenerActive=!1,this.setupSheetOpeningLogic(),this.setupSheetDismissLogic(),this.setupPopStateListener()}setupSheetOpeningLogic(){this.bottomSheet.pipe(e.switchMap(t=>e.forkJoin([e.fromEvent(window,c).pipe(e.takeUntil(e.timer(50)),e.map(i=>i.detail),e.defaultIfEmpty(void 0)),e.fromEvent(window,p.ThemeHereIAm).pipe(e.takeUntil(e.timer(50)),e.map(i=>i.detail.theme),e.defaultIfEmpty(void 0)),e.of(t).pipe(e.tap(()=>{const i=t.uid??`sheet-${Date.now()}`;window.dispatchEvent(new CustomEvent(a,{detail:{uid:i},bubbles:!0,composed:!0})),window.dispatchEvent(new CustomEvent(p.ThemeWhereAreYou,{bubbles:!0,composed:!0}))}))])),e.map(([t,i,o])=>{let n,s=t?.sheet;if(s)n=s.parentElement;else{n=i||document.querySelector("schmancy-theme")||document.body;const r=o.uid??`sheet-${Date.now()}`;s=document.createElement("schmancy-sheet"),s.setAttribute("uid",r),n.appendChild(s)}o.lock&&s.setAttribute("lock","true");const h=o.position||(window.innerWidth>=768?"side":"bottom");return s.setAttribute("position",h),o.persist&&s.setAttribute("persist",String(o.persist)),document.body.style.overflow="hidden",{target:o,sheet:s}}),e.delay(20),e.tap(({target:t,sheet:i})=>{window.dispatchEvent(new CustomEvent("schmancy-sheet-render",{detail:{component:t.component,uid:i.getAttribute("uid")},bubbles:!0,composed:!0}))}),e.delay(1),e.tap(({target:t,sheet:i})=>{i?.setAttribute("open","true");const o=t.uid??`sheet-${Date.now()}`;this.activeSheets.add(o),e.fromEvent(i,"close").pipe(e.take(1)).pipe(e.delay(300)).subscribe(n=>{const s=i;if(s){const h=s.getAttribute("uid");h&&this.activeSheets.delete(h);const r=s.getAttribute("persist");(!r||r==="false")&&s.remove()}document.body.style.overflow="auto"})})).subscribe()}setupSheetDismissLogic(){this.$dismiss.pipe(e.mergeMap(t=>e.forkJoin([e.fromEvent(window,c).pipe(e.takeUntil(e.timer(100)),e.map(i=>i.detail),e.defaultIfEmpty(void 0)),e.of(t).pipe(e.tap(()=>{window.dispatchEvent(new CustomEvent(a,{detail:{uid:t}}))}))])),e.tap(([t,i])=>{t?.sheet&&(t.sheet.closeSheet(),this.activeSheets.delete(i))})).subscribe()}setupPopStateListener(){this.popStateListenerActive||(e.fromEvent(window,"popstate").subscribe(t=>{if(this.activeSheets.size>0){const i=Array.from(this.activeSheets).pop();i&&(this.dismiss(i),t.state&&t.state.schmancySheet&&history.pushState({},"",window.location.href))}}),this.popStateListenerActive=!0)}dismiss(t){if(!t&&this.activeSheets.size>0){const i=Array.from(this.activeSheets);t=i[i.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)})}};exports.SchmancySheetPosition=d,exports.SheetHereMorty=c,exports.SheetWhereAreYouRicky=a,exports.sheet=m;
2
- //# sourceMappingURL=sheet.service-iUShtJp1.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sheet.service-iUShtJp1.cjs","sources":["../src/sheet/sheet.service.ts"],"sourcesContent":["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 { ComponentType } from '../area/router.types'\nimport { ThemeHereIAm, ThemeHereIAmEvent, ThemeWhereAreYou } from '../theme/theme.events'\nimport SchmancySheet from './sheet'\n\nexport enum SchmancySheetPosition {\n\tSide = 'side',\n\tBottom = 'bottom',\n}\n\nexport type SheetConfig = {\n\tcomponent: ComponentType\n\tuid?: string\n\tposition?: SchmancySheetPosition\n\tpersist?: boolean\n\tclose?: () => void\n\tlock?: boolean // Controls both ESC and overlay click dismissal\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// 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(50)),\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 generate one\n\t\t\t\t\t\t\t\tconst uid = target.uid ?? `sheet-${Date.now()}`\n\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\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\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\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]),\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\n\t\t\t\t\tif (sheet) {\n\t\t\t\t\t\t// Use existing 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 || (document.querySelector('schmancy-theme') as HTMLElement) || document.body\n\n\t\t\t\t\t\t// Create new sheet\n\t\t\t\t\t\tconst uid = target.uid ?? `sheet-${Date.now()}`\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.persist && sheet.setAttribute('persist', String(target.persist))\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// Dispatch render event - sheet component will use area router to handle component\n\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent('schmancy-sheet-render', {\n\t\t\t\t\t\t\tdetail: { component: target.component, uid: sheet.getAttribute('uid') },\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\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 ?? `sheet-${Date.now()}`\n\t\t\t\t\tthis.activeSheets.add(uid)\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\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}\n\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\n\t\t\t\t\t\t\t\tif (shouldRemove) {\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\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\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}\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\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}\nexport const sheet = new BottomSheetService()\n"],"names":["SchmancySheetPosition","SheetWhereAreYouRicky","SheetHereMorty","sheet","constructor","this","bottomSheet","Subject","$dismiss","activeSheets","Set","popStateListenerActive","setupSheetOpeningLogic","setupSheetDismissLogic","setupPopStateListener","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","ThemeHereIAm","theme","of","target","tap","uid","Date","now","dispatchEvent","CustomEvent","bubbles","composed","ThemeWhereAreYou","existingSheet","targetContainer","parentElement","document","querySelector","body","createElement","setAttribute","appendChild","lock","position","innerWidth","persist","String","style","overflow","delay","component","getAttribute","add","take","subscribe","_","sheetElement","delete","persistAttr","remove","mergeMap","response","closeSheet","event","size","lastSheet","Array","from","pop","dismiss","state","schmancySheet","history","pushState","location","href","sheetsArray","length","next","has","closeAll","forEach"],"mappings":"8EAmBO,IAAKA,GAAAA,IACXA,EAAA,KAAO,OACPA,EAAA,OAAS,SAFEA,IAAAA,GAAA,CAAA,CAAA,EAuBL,MAAMC,EAAwB,sBAMxBC,EAAiB,WAkPjBC,EAAQ,IA3OrB,KAAA,CAQC,aAAAC,CAPAC,KAAAC,YAAc,IAAIC,UAClBF,KAAAG,SAAW,IAAID,UAEfF,KAAQI,iBAAmBC,IAE3BL,KAAQM,uBAAAA,GAGPN,KAAKO,uBAAAA,EACLP,KAAKQ,uBAAAA,EACLR,KAAKS,sBAAAA,CACN,CAKQ,wBAAAF,CACPP,KAAKC,YACHS,KACAC,EA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