@mhmo91/schmancy 0.2.105 → 0.2.107

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 (56) hide show
  1. package/dist/area.cjs +1 -1
  2. package/dist/area.component-8AQUkma0.js +119 -0
  3. package/dist/area.component-8AQUkma0.js.map +1 -0
  4. package/dist/area.component-nkE9S6b3.cjs +8 -0
  5. package/dist/area.component-nkE9S6b3.cjs.map +1 -0
  6. package/dist/area.js +1 -1
  7. package/dist/card.cjs +1 -1
  8. package/dist/card.js +1 -1
  9. package/dist/{chips-CR5QTRYd.js → chips-BL6vlm9-.js} +12 -12
  10. package/dist/{chips-CR5QTRYd.js.map → chips-BL6vlm9-.js.map} +1 -1
  11. package/dist/chips.js +1 -1
  12. package/dist/content-drawer.cjs +1 -1
  13. package/dist/content-drawer.js +1 -1
  14. package/dist/{delay-DE7SE2Lx.cjs → delay-_tsTZ2IL.cjs} +2 -2
  15. package/dist/{delay-DE7SE2Lx.cjs.map → delay-_tsTZ2IL.cjs.map} +1 -1
  16. package/dist/delay.cjs +1 -1
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.js +40 -41
  19. package/dist/index.js.map +1 -1
  20. package/dist/nav-drawer.cjs +1 -1
  21. package/dist/nav-drawer.js +1 -1
  22. package/dist/notification.cjs +1 -1
  23. package/dist/notification.js +5 -6
  24. package/dist/notification.js.map +1 -1
  25. package/dist/outlet-IKjizKaN.cjs +30 -0
  26. package/dist/outlet-IKjizKaN.cjs.map +1 -0
  27. package/dist/outlet-Us3Wi-TE.js +81 -0
  28. package/dist/outlet-Us3Wi-TE.js.map +1 -0
  29. package/dist/rxjs-utils.js +4 -4
  30. package/dist/teleport.cjs +1 -1
  31. package/dist/{teleport.component-CLtX4xnl.cjs → teleport.component-CH--tF4H.cjs} +2 -2
  32. package/dist/{teleport.component-CLtX4xnl.cjs.map → teleport.component-CH--tF4H.cjs.map} +1 -1
  33. package/dist/{teleport.component-BbJ2RCj-.js → teleport.component-Kcn8tqQF.js} +9 -10
  34. package/dist/{teleport.component-BbJ2RCj-.js.map → teleport.component-Kcn8tqQF.js.map} +1 -1
  35. package/dist/teleport.js +1 -1
  36. package/dist/{typewriter-SgYEA2OC.js → typewriter-Dn4nHKtu.js} +11 -11
  37. package/dist/{typewriter-SgYEA2OC.js.map → typewriter-Dn4nHKtu.js.map} +1 -1
  38. package/dist/{typewriter-CAmStzUa.cjs → typewriter-I6nigRrM.cjs} +2 -2
  39. package/dist/{typewriter-CAmStzUa.cjs.map → typewriter-I6nigRrM.cjs.map} +1 -1
  40. package/dist/typewriter.cjs +1 -1
  41. package/dist/typewriter.js +1 -1
  42. package/package.json +1 -1
  43. package/types/src/area/area.component.d.ts +64 -4
  44. package/types/src/area/router.types.d.ts +1 -1
  45. package/dist/_notification-BMl7x5RW.cjs +0 -2
  46. package/dist/_notification-BMl7x5RW.cjs.map +0 -1
  47. package/dist/_notification-D5MEzxBs.js +0 -21
  48. package/dist/_notification-D5MEzxBs.js.map +0 -1
  49. package/dist/area.component-Bd-yUYxJ.js +0 -107
  50. package/dist/area.component-Bd-yUYxJ.js.map +0 -1
  51. package/dist/area.component-DaAJvOaf.cjs +0 -8
  52. package/dist/area.component-DaAJvOaf.cjs.map +0 -1
  53. package/dist/outlet-B16Pt3na.js +0 -62
  54. package/dist/outlet-B16Pt3na.js.map +0 -1
  55. package/dist/outlet-CT1apG_R.cjs +0 -30
  56. package/dist/outlet-CT1apG_R.cjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"area.component-Bd-yUYxJ.js","sources":["../src/area/area.service.ts","../src/area/router.types.ts","../src/area/area.component.ts"],"sourcesContent":["import { ReplaySubject, Subject, bufferTime, fromEvent, map, of, tap, timeout, zip } from 'rxjs'\nimport { SchmancyTeleportation } from '../teleport'\nimport { ActiveRoute, RouteAction } from './router.types'\n\nexport const routerHistory = new Subject<RouteAction>()\n\nexport const FINDING_MORTIES = 'FINDING_MORTIES'\nexport const HERE_RICKY = 'HERE_RICKY'\nexport type HERE_RICKY_EVENT = CustomEvent<{\n\tcomponent: SchmancyTeleportation\n}>\nexport type FINDING_MORTIES_EVENT = CustomEvent<{\n\tcomponent: SchmancyTeleportation\n}>\n\nclass AreaService {\n\tprivate static instance: AreaService\n\tpublic prettyURL = false\n\tpublic mode: 'SILENT' | 'HISTORY' = 'HISTORY'\n\tpublic request = new ReplaySubject<RouteAction>(1)\n\tpublic current = new Map<string, ActiveRoute>()\n\tpublic $current = new ReplaySubject<Map<string, ActiveRoute>>(1)\n\tpublic enableHistoryMode = true\n\tprivate findingMortiesEvent = new CustomEvent<FINDING_MORTIES_EVENT['detail']>(FINDING_MORTIES)\n\n\tconstructor() {\n\t\tthis.$current.next(this.current)\n\t}\n\n\tfind() {\n\t\treturn zip([\n\t\t\tfromEvent<HERE_RICKY_EVENT>(window, HERE_RICKY).pipe(\n\t\t\t\tmap(e => e.detail),\n\t\t\t\tbufferTime(0),\n\t\t\t\ttap(console.log),\n\t\t\t),\n\t\t\tof(1).pipe(tap(() => window.dispatchEvent(this.findingMortiesEvent))),\n\t\t]).pipe(\n\t\t\tmap(([component]) => component),\n\t\t\ttimeout(1),\n\t\t)\n\t}\n\n\tpush(r: RouteAction) {\n\t\tthis.request.next(r)\n\t}\n\n\tpop(name: string) {\n\t\tconst newState = JSON.parse(JSON.stringify(area.state))\n\t\tdelete newState[name]\n\t\tconsole.log(area.state, newState)\n\t\thistory.replaceState(null, '', encodeURIComponent(JSON.stringify(newState)))\n\t}\n\tstatic getInstance() {\n\t\tif (!AreaService.instance) {\n\t\t\tAreaService.instance = new AreaService()\n\t\t}\n\t\treturn AreaService.instance\n\t}\n\n\tget state() {\n\t\tconst pathname = location.pathname.split('/').pop()\n\t\tlet areaState = {}\n\t\ttry {\n\t\t\tareaState = pathname ? JSON.parse(decodeURIComponent(pathname)) : {}\n\t\t} catch {\n\t\t\tareaState = {}\n\t\t}\n\t\treturn areaState\n\t}\n}\n\nexport const area = AreaService.getInstance()\nexport default area\n","export type RouteAction = {\n\tcomponent: CustomElementConstructor | string | Promise<NodeModule> | HTMLElement | Promise<NodeModule>\n\tarea: string\n\tstate?: object\n\thistoryStrategy?: THistoryStrategy\n\tclearQueryParams?: string[] | null\n}\n\nexport type ActiveRoute = {\n\tcomponent: string\n\tarea: string\n\tstate?: object\n}\n\nexport type THistoryStrategy = 'push' | 'replace' | 'pop' | 'silent'\n\nexport enum HISTORY_STRATEGY {\n\tpush = 'push',\n\treplace = 'replace',\n\tpop = 'pop',\n\tsilent = 'silent',\n}\n","import { $LitElement } from '@mixins/index'\nimport { TemplateResult, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport {\n\tEMPTY,\n\tbufferTime,\n\tcatchError,\n\tdistinctUntilChanged,\n\tfilter,\n\tfrom,\n\tfromEvent,\n\tmap,\n\tmerge,\n\tof,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n\ttimeout,\n} from 'rxjs'\nimport { isPresent } from 'ts-is-present'\nimport area from './area.service'\nimport { HISTORY_STRATEGY, RouteAction } from './router.types'\n\ntype TRouteArea = {\n\tcomponent: string\n\tstate: object | undefined\n}\n\n@customElement('schmancy-area')\nexport class SchmancyArea extends $LitElement(css`\n\t:host {\n\t\tposition: relative;\n\t\tdisplay: block;\n\t\tinset: 0;\n\t}\n`) {\n\t/**\n\t * The name of the router outlet\n\t * @attr\n\t * @type {string}\n\t * @public\n\t * @required\n\t */\n\t@property() name!: string\n\n\t@property() default!: string | Promise<NodeModule> | CustomElementConstructor | TemplateResult<1>\n\n\t/**\n\t *\n\t * @param pathname pathname from the browser location API\n\t * @param historyStrategy the history strategy to use for the route like PUSH, REPLACE, or SILENT\n\t * @returns rxjs pipes that will return the component to render and the history strategy to use\n\t */\n\tgetComponentFromPathname(pathname: string, historyStrategy: HISTORY_STRATEGY) {\n\t\treturn of(pathname).pipe(\n\t\t\tmap(path => path.split('/').pop() ?? ''),\n\t\t\tmap(path => decodeURIComponent(path)),\n\t\t\tmap(path => JSON.parse(path)),\n\t\t\tmap(routes => routes[this.name] as TRouteArea),\n\t\t\tmap(component =>\n\t\t\t\t!component && this.default\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcomponent: this.default,\n\t\t\t\t\t\t\tstate: undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\t: component,\n\t\t\t),\n\t\t\tfilter(x => isPresent(x)),\n\t\t\tmap((component: TRouteArea) => ({\n\t\t\t\tarea: this.name,\n\t\t\t\tcomponent: component.component ?? this.default,\n\t\t\t\tstate: component.state,\n\t\t\t\thistoryStrategy,\n\t\t\t})),\n\t\t\tmap(x => x as RouteAction),\n\t\t\tcatchError(() => {\n\t\t\t\treturn this.default\n\t\t\t\t\t? of({\n\t\t\t\t\t\t\tarea: this.name,\n\t\t\t\t\t\t\tcomponent: this.default,\n\t\t\t\t\t\t\thistoryStrategy,\n\t\t\t\t\t\t} as RouteAction)\n\t\t\t\t\t: EMPTY\n\t\t\t}),\n\t\t)\n\t}\n\n\tprotected firstUpdated(): void {\n\t\tif (!this.name) {\n\t\t\t// TOOD: maybe enforce this to be unique\n\t\t\tthrow new Error('Area name or default component not set')\n\t\t}\n\n\t\t// active outlet changes\n\t\tmerge(\n\t\t\t// 1) initial load from location.pathname\n\t\t\tof(location.pathname).pipe(\n\t\t\t\tswitchMap(pathname => this.getComponentFromPathname(pathname, HISTORY_STRATEGY.silent)),\n\t\t\t\tmap(route => route as RouteAction),\n\t\t\t\ttake(1),\n\t\t\t),\n\t\t\t// 2) requests to change the route for this area\n\t\t\tarea.request.pipe(filter(({ area }) => area === this.name)),\n\t\t\t// 3) popstate events (back, forward)\n\t\t\tfromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\t\tmap(e => (e.target as Window).location.pathname),\n\t\t\t\tswitchMap(pathname => this.getComponentFromPathname(pathname, HISTORY_STRATEGY.silent)),\n\t\t\t\tmap(route => route as RouteAction),\n\t\t\t),\n\t\t)\n\t\t\t.pipe(\n\t\t\t\tfilter(request => !!request.component),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\tdistinctUntilChanged((a, b) => {\n\t\t\t\t\tlet aComponent, bComponent\n\t\t\t\t\tif (typeof a.component === 'function') return false\n\t\t\t\t\telse if (typeof a.component === 'string') aComponent = a.component\n\n\t\t\t\t\tif (typeof b.component === 'function') return false\n\t\t\t\t\telse if (typeof b.component === 'string') bComponent = b.component\n\n\t\t\t\t\treturn bComponent?.replaceAll('-', '').toLowerCase() === aComponent?.replaceAll('-', '').toLowerCase()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.pipe(\n\t\t\t\tswitchMap(route => {\n\t\t\t\t\tconst c = route.component\n\t\t\t\t\tif (c instanceof Promise) {\n\t\t\t\t\t\t// Dynamic import module\n\t\t\t\t\t\treturn from(c).pipe(map(x => ({ component: x.exports.default as CustomElementConstructor, route })))\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Already a string, function, or element\n\t\t\t\t\t\treturn of({ component: c, route })\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tmap(({ component, route }) => {\n\t\t\t\t\tif (typeof component === 'string') {\n\t\t\t\t\t\t// Tag name\n\t\t\t\t\t\treturn { component: document.createElement(component), route }\n\t\t\t\t\t} else if (component instanceof HTMLElement) {\n\t\t\t\t\t\t// Already an element instance\n\t\t\t\t\t\treturn { component, route }\n\t\t\t\t\t} else if (typeof component === 'function') {\n\t\t\t\t\t\t// Custom element constructor\n\t\t\t\t\t\treturn { component: new component(), route }\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tdistinctUntilChanged((prev, curr) => prev.component.tagName === curr.component.tagName),\n\t\t\t\t// create the new view and add it to the DOM\n\t\t\t\tmap(({ component, route }) => {\n\t\t\t\t\tconst oldView = this.shadowRoot?.children[0]\n\t\t\t\t\tconst oldViewExists = !!oldView\n\n\t\t\t\t\t// Remove the old view (if any)\n\t\t\t\t\toldView.remove()\n\t\t\t\t\t// Native Web Animations API - fade in\n\t\t\t\t\t// \"ease: cubic-bezier(0.25, 0.8, 0.25, 1)\" was used in the old code\n\t\t\t\t\tcomponent.classList.add('opacity-0')\n\t\t\t\t\tthis.shadowRoot?.append(component)\n\t\t\t\t\tcomponent.animate([{ opacity: 0 }, { opacity: 1 }], {\n\t\t\t\t\t\tduration: oldViewExists ? 150 : 100,\n\t\t\t\t\t\teasing: 'cubic-bezier(0.25, 0.8, 0.25, 1)',\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t})\n\n\t\t\t\t\t// Insert the new view\n\n\t\t\t\t\treturn { component, route }\n\t\t\t\t}),\n\t\t\t\ttap(({ component, route }) => {\n\t\t\t\t\t// Handle history updates\n\t\t\t\t\tif (typeof route.historyStrategy === 'undefined' || route.historyStrategy === 'push') {\n\t\t\t\t\t\thistory.pushState(route.state, '', this.newPath(component.tagName, route))\n\t\t\t\t\t} else if (route.historyStrategy && ['replace', 'pop'].includes(route.historyStrategy)) {\n\t\t\t\t\t\thistory.replaceState(route.state, '', this.newPath(component.tagName, route))\n\t\t\t\t\t}\n\t\t\t\t\tarea.current.set(this.name, {\n\t\t\t\t\t\tcomponent: component.tagName,\n\t\t\t\t\t\tstate: route.state,\n\t\t\t\t\t\tarea: this.name,\n\t\t\t\t\t})\n\n\t\t\t\t\tarea.$current.next(area.current)\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tnewPath(tag: string, route: RouteAction) {\n\t\tconst oldPathname = location.pathname.split('/').pop()\n\t\tlet oldAreaState = {}\n\t\ttry {\n\t\t\toldAreaState = oldPathname ? JSON.parse(decodeURIComponent(oldPathname)) : {}\n\t\t} catch {\n\t\t\toldAreaState = {}\n\t\t}\n\t\troute.state = route.state ?? {}\n\t\tconst queryParams = route.clearQueryParams ? this.queryParamClear(route.clearQueryParams) : document.location.search\n\n\t\treturn encodeURIComponent(\n\t\t\tJSON.stringify({\n\t\t\t\t...oldAreaState,\n\t\t\t\t[this.name]: { component: tag.toLowerCase(), state: route.state },\n\t\t\t}),\n\t\t).concat(`${queryParams}`)\n\t}\n\n\tqueryParamClear(params?: string[]) {\n\t\tif (!params) {\n\t\t\treturn ''\n\t\t}\n\t\t// get query params from url\n\t\tconst urlParams = new URLSearchParams(location.search)\n\t\t// remove query params\n\t\tparams.forEach(param => urlParams.delete(param))\n\t\t// update url\n\t\tif (urlParams.toString() === '') return ''\n\t\treturn `?${urlParams.toString()}`\n\t}\n\n\tcheckForTeleportationRequests() {\n\t\treturn fromEvent<CustomEvent>(window, 'FLIP_REQUEST').pipe(\n\t\t\tmap(e => e.detail),\n\t\t\tbufferTime(0),\n\t\t\ttap(() => {\n\t\t\t\tthis.dispatchEvent(new CustomEvent('FLIP_STARTED'))\n\t\t\t}),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t\ttimeout(0),\n\t\t\tcatchError(() => of(null)),\n\t\t)\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\trender() {\n\t\treturn html` <slot> </slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-area': SchmancyArea\n\t}\n}\n"],"names":["routerHistory","Subject","FINDING_MORTIES","HERE_RICKY","AreaService","constructor","this","prettyURL","mode","request","ReplaySubject","current","Map","$current","enableHistoryMode","findingMortiesEvent","CustomEvent","next","find","zip","fromEvent","window","pipe","map","e","detail","bufferTime","tap","console","log","of","dispatchEvent","component","timeout","r","name","newState","JSON","parse","stringify","area","state","history","replaceState","encodeURIComponent","instance","pathname","location","split","pop","areaState","decodeURIComponent","getInstance","HISTORY_STRATEGY","SchmancyArea","$LitElement","css","historyStrategy","path","routes","default","filter","x","isPresent","catchError","EMPTY","firstUpdated","Error","merge","switchMap","getComponentFromPathname","silent","route","take","target","takeUntil","disconnecting","distinctUntilChanged","a","b","aComponent","bComponent","replaceAll","toLowerCase","c","Promise","from","exports","document","createElement","HTMLElement","prev","curr","tagName","oldView","shadowRoot","children","oldViewExists","remove","classList","add","append","animate","opacity","duration","easing","fill","pushState","newPath","includes","set","subscribe","tag","oldPathname","oldAreaState","queryParams","clearQueryParams","queryParamClear","search","concat","params","urlParams","URLSearchParams","forEach","param","delete","toString","checkForTeleportationRequests","disconnectedCallback","super","html","__decorateClass","property","prototype","customElement"],"mappings":";;;;;;;;AAIa,MAAAA,IAAgB,IAAIC,KAEpBC,IAAkB,mBAClBC,IAAa;AAQ1B,MAAMC,EAAAA;AAAAA,EAUL,cAAAC;AARAC,SAAOC,YAAAA,IACPD,KAAOE,OAA6B,WAC7BF,KAAAG,UAAU,IAAIC,EAA2B,CAAA,GACzCJ,KAAAK,8BAAcC,OACdN,KAAAO,WAAW,IAAIH,EAAwC,IAC9DJ,KAAOQ,oBAAAA,IACCR,KAAAS,sBAAsB,IAAIC,YAA6Cd,CAAAA,GAGzEI,KAAAO,SAASI,KAAKX,KAAKK,OAAO;AAAA,EAAA;AAAA,EAGhC,OAAAO;AACC,WAAOC,EAAI,CACVC,EAA4BC,QAAQlB,CAAYmB,EAAAA,KAC/CC,EAASC,CAAAA,MAAAA,EAAEC,MAAAA,GACXC,EAAW,CAAA,GACXC,EAAIC,QAAQC,GAEbC,CAAAA,GAAAA,EAAG,GAAGR,KAAKK,EAAI,MAAMN,OAAOU,cAAczB,KAAKS,mBAC7CO,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,KACFC,EAAI,CAAA,CAAES,CAAeA,MAAAA,CAAAA,GACrBC,EAAQ,CAAA,CAAA;AAAA,EACT;AAAA,EAGD,KAAKC,GACC5B;AAAAA,SAAAG,QAAQQ,KAAKiB,CAAC;AAAA,EAAA;AAAA,EAGpB,IAAIC,GACH;AAAA,UAAMC,IAAWC,KAAKC,MAAMD,KAAKE,UAAUC,EAAKC;WACzCL,EAASD,CAAAA,GAERO,QAAAC,aAAa,MAAM,IAAIC,mBAAmBP,KAAKE,UAAUH,CAAAA,CAAAA,CAAA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AA;AAAA,EAAA;AAAA,EAG1B,gBAAgBK,GACf;AAAA,QAAA,CAAKA,EACG,QAAA;AAGR,UAAMC,IAAY,IAAIC,gBAAgB3E,SAASuE,MAI/C;AAAA,WAFAE,EAAOG,QAAQC,CAAAA,MAASH,EAAUI,OAAOD,CAAAA,CAAAA,GAErCH,EAAUK,SAA0B,MAAX,KAAW,KACjC,IAAIL,EAAUK,SAAU,CAAA;AAAA,EAAA;AAAA,EAGhC,gCAAAC;AACQ,WAAA3G,EAAuBC,QAAQ,cAAgBC,EAAAA,KACrDC,EAASC,OAAAA,EAAEC,MAAAA,GACXC,EAAW,CAAA,GACXC,EAAI,MAAA;AACHrB,WAAKyB,cAAc,IAAIf,YAAY,cAAe,CAAA;AAAA,IAAA,CAAA,GAEnD2D,EAAUrE,KAAKsE,aACf3C,GAAAA,EAAQ,CACR+B,GAAAA,EAAW,MAAMlC,EAAG,IACrB,CAAA,CAAA;AAAA,EAAA;AAAA,EAGD,uBAAAkG;AACCC,UAAMD,qBAAAA,GACD1H,KAAAsE,cAAc3D,KAAK,EAAA;AAAA,EAAI;AAAA,EAG7B,SACQ;AAAA,WAAAiH;AAAAA,EAAA;AArMIC;AAAAA,EAAA,CAAXC,EAAAA,CAAAA,GAdW9E,EAcA+E,WAAA,QAAA,CAAA,GAEAF,EAAA,CAAXC,EAhBW9E,CAAAA,GAAAA,EAgBA+E,WAAA,WAAA,CAhBA/E,GAAAA,IAAN6E,EAAA,CADNG,EAAc,eAAA,CAAA,GACFhF;"}
@@ -1,8 +0,0 @@
1
- "use strict";const n=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const f=require("./litElement.mixin-9sOZ1KTq.cjs");require("./tailwind.mixin-DFM3jd9q.cjs");const u=require("lit"),h=require("lit/decorators.js"),g=require("./index-DyJ0oDpR.cjs"),S=new n.Subject,d="FINDING_MORTIES",y="HERE_RICKY";class p{constructor(){this.prettyURL=!1,this.mode="HISTORY",this.request=new n.ReplaySubject(1),this.current=new Map,this.$current=new n.ReplaySubject(1),this.enableHistoryMode=!0,this.findingMortiesEvent=new CustomEvent(d),this.$current.next(this.current)}find(){return n.zip([n.fromEvent(window,y).pipe(n.map(e=>e.detail),n.bufferTime(0),n.tap(console.log)),n.of(1).pipe(n.tap(()=>window.dispatchEvent(this.findingMortiesEvent)))]).pipe(n.map(([e])=>e),n.timeout(1))}push(e){this.request.next(e)}pop(e){const o=JSON.parse(JSON.stringify(s.state));delete o[e],history.replaceState(null,"",encodeURIComponent(JSON.stringify(o)))}static getInstance(){return p.instance||(p.instance=new p),p.instance}get state(){const e=location.pathname.split("/").pop();let o={};try{o=e?JSON.parse(decodeURIComponent(e)):{}}catch{o={}}return o}}const s=p.getInstance();var c=(t=>(t.push="push",t.replace="replace",t.pop="pop",t.silent="silent",t))(c||{}),w=Object.defineProperty,E=Object.getOwnPropertyDescriptor,l=(t,e,o,a)=>{for(var i,r=a>1?void 0:a?E(e,o):e,m=t.length-1;m>=0;m--)(i=t[m])&&(r=(a?i(e,o,r):i(r))||r);return a&&r&&w(e,o,r),r};exports.SchmancyArea=class extends f.$LitElement(u.css`
2
- :host {
3
- position: relative;
4
- display: block;
5
- inset: 0;
6
- }
7
- `){getComponentFromPathname(t,e){return n.of(t).pipe(n.map(o=>o.split("/").pop()??""),n.map(o=>decodeURIComponent(o)),n.map(o=>JSON.parse(o)),n.map(o=>o[this.name]),n.map(o=>!o&&this.default?{component:this.default,state:void 0}:o),n.filter(o=>g.libExports.isPresent(o)),n.map(o=>({area:this.name,component:o.component??this.default,state:o.state,historyStrategy:e})),n.map(o=>o),n.catchError(()=>this.default?n.of({area:this.name,component:this.default,historyStrategy:e}):n.EMPTY))}firstUpdated(){if(!this.name)throw new Error("Area name or default component not set");n.merge(n.of(location.pathname).pipe(n.switchMap(t=>this.getComponentFromPathname(t,c.silent)),n.map(t=>t),n.take(1)),s.request.pipe(n.filter(({area:t})=>t===this.name)),n.fromEvent(window,"popstate").pipe(n.map(t=>t.target.location.pathname),n.switchMap(t=>this.getComponentFromPathname(t,c.silent)),n.map(t=>t))).pipe(n.filter(t=>!!t.component),n.takeUntil(this.disconnecting),n.distinctUntilChanged((t,e)=>{let o,a;return typeof t.component!="function"&&(typeof t.component=="string"&&(o=t.component),typeof e.component!="function"&&(typeof e.component=="string"&&(a=e.component),(a==null?void 0:a.replaceAll("-","").toLowerCase())===(o==null?void 0:o.replaceAll("-","").toLowerCase())))})).pipe(n.switchMap(t=>{const e=t.component;return e instanceof Promise?n.from(e).pipe(n.map(o=>({component:o.exports.default,route:t}))):n.of({component:e,route:t})}),n.map(({component:t,route:e})=>typeof t=="string"?{component:document.createElement(t),route:e}:t instanceof HTMLElement?{component:t,route:e}:typeof t=="function"?{component:new t,route:e}:void 0),n.distinctUntilChanged((t,e)=>t.component.tagName===e.component.tagName),n.map(({component:t,route:e})=>{var i,r;const o=(i=this.shadowRoot)==null?void 0:i.children[0],a=!!o;return o.remove(),t.classList.add("opacity-0"),(r=this.shadowRoot)==null||r.append(t),t.animate([{opacity:0},{opacity:1}],{duration:a?150:100,easing:"cubic-bezier(0.25, 0.8, 0.25, 1)",fill:"forwards"}),{component:t,route:e}}),n.tap(({component:t,route:e})=>{e.historyStrategy===void 0||e.historyStrategy==="push"?history.pushState(e.state,"",this.newPath(t.tagName,e)):e.historyStrategy&&["replace","pop"].includes(e.historyStrategy)&&history.replaceState(e.state,"",this.newPath(t.tagName,e)),s.current.set(this.name,{component:t.tagName,state:e.state,area:this.name}),s.$current.next(s.current)}),n.takeUntil(this.disconnecting)).subscribe()}newPath(t,e){const o=location.pathname.split("/").pop();let a={};try{a=o?JSON.parse(decodeURIComponent(o)):{}}catch{a={}}e.state=e.state??{};const i=e.clearQueryParams?this.queryParamClear(e.clearQueryParams):document.location.search;return encodeURIComponent(JSON.stringify({...a,[this.name]:{component:t.toLowerCase(),state:e.state}})).concat(`${i}`)}queryParamClear(t){if(!t)return"";const e=new URLSearchParams(location.search);return t.forEach(o=>e.delete(o)),e.toString()===""?"":`?${e.toString()}`}checkForTeleportationRequests(){return n.fromEvent(window,"FLIP_REQUEST").pipe(n.map(t=>t.detail),n.bufferTime(0),n.tap(()=>{this.dispatchEvent(new CustomEvent("FLIP_STARTED"))}),n.takeUntil(this.disconnecting),n.timeout(0),n.catchError(()=>n.of(null)))}disconnectedCallback(){super.disconnectedCallback(),this.disconnecting.next(!0)}render(){return u.html` <slot> </slot> `}},l([h.property()],exports.SchmancyArea.prototype,"name",2),l([h.property()],exports.SchmancyArea.prototype,"default",2),exports.SchmancyArea=l([h.customElement("schmancy-area")],exports.SchmancyArea),exports.FINDING_MORTIES=d,exports.HERE_RICKY=y,exports.HISTORY_STRATEGY=c,exports.area=s,exports.routerHistory=S;
8
- //# sourceMappingURL=area.component-DaAJvOaf.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"area.component-DaAJvOaf.cjs","sources":["../src/area/area.service.ts","../src/area/router.types.ts","../src/area/area.component.ts"],"sourcesContent":["import { ReplaySubject, Subject, bufferTime, fromEvent, map, of, tap, timeout, zip } from 'rxjs'\nimport { SchmancyTeleportation } from '../teleport'\nimport { ActiveRoute, RouteAction } from './router.types'\n\nexport const routerHistory = new Subject<RouteAction>()\n\nexport const FINDING_MORTIES = 'FINDING_MORTIES'\nexport const HERE_RICKY = 'HERE_RICKY'\nexport type HERE_RICKY_EVENT = CustomEvent<{\n\tcomponent: SchmancyTeleportation\n}>\nexport type FINDING_MORTIES_EVENT = CustomEvent<{\n\tcomponent: SchmancyTeleportation\n}>\n\nclass AreaService {\n\tprivate static instance: AreaService\n\tpublic prettyURL = false\n\tpublic mode: 'SILENT' | 'HISTORY' = 'HISTORY'\n\tpublic request = new ReplaySubject<RouteAction>(1)\n\tpublic current = new Map<string, ActiveRoute>()\n\tpublic $current = new ReplaySubject<Map<string, ActiveRoute>>(1)\n\tpublic enableHistoryMode = true\n\tprivate findingMortiesEvent = new CustomEvent<FINDING_MORTIES_EVENT['detail']>(FINDING_MORTIES)\n\n\tconstructor() {\n\t\tthis.$current.next(this.current)\n\t}\n\n\tfind() {\n\t\treturn zip([\n\t\t\tfromEvent<HERE_RICKY_EVENT>(window, HERE_RICKY).pipe(\n\t\t\t\tmap(e => e.detail),\n\t\t\t\tbufferTime(0),\n\t\t\t\ttap(console.log),\n\t\t\t),\n\t\t\tof(1).pipe(tap(() => window.dispatchEvent(this.findingMortiesEvent))),\n\t\t]).pipe(\n\t\t\tmap(([component]) => component),\n\t\t\ttimeout(1),\n\t\t)\n\t}\n\n\tpush(r: RouteAction) {\n\t\tthis.request.next(r)\n\t}\n\n\tpop(name: string) {\n\t\tconst newState = JSON.parse(JSON.stringify(area.state))\n\t\tdelete newState[name]\n\t\tconsole.log(area.state, newState)\n\t\thistory.replaceState(null, '', encodeURIComponent(JSON.stringify(newState)))\n\t}\n\tstatic getInstance() {\n\t\tif (!AreaService.instance) {\n\t\t\tAreaService.instance = new AreaService()\n\t\t}\n\t\treturn AreaService.instance\n\t}\n\n\tget state() {\n\t\tconst pathname = location.pathname.split('/').pop()\n\t\tlet areaState = {}\n\t\ttry {\n\t\t\tareaState = pathname ? JSON.parse(decodeURIComponent(pathname)) : {}\n\t\t} catch {\n\t\t\tareaState = {}\n\t\t}\n\t\treturn areaState\n\t}\n}\n\nexport const area = AreaService.getInstance()\nexport default area\n","export type RouteAction = {\n\tcomponent: CustomElementConstructor | string | Promise<NodeModule> | HTMLElement | Promise<NodeModule>\n\tarea: string\n\tstate?: object\n\thistoryStrategy?: THistoryStrategy\n\tclearQueryParams?: string[] | null\n}\n\nexport type ActiveRoute = {\n\tcomponent: string\n\tarea: string\n\tstate?: object\n}\n\nexport type THistoryStrategy = 'push' | 'replace' | 'pop' | 'silent'\n\nexport enum HISTORY_STRATEGY {\n\tpush = 'push',\n\treplace = 'replace',\n\tpop = 'pop',\n\tsilent = 'silent',\n}\n","import { $LitElement } from '@mixins/index'\nimport { TemplateResult, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport {\n\tEMPTY,\n\tbufferTime,\n\tcatchError,\n\tdistinctUntilChanged,\n\tfilter,\n\tfrom,\n\tfromEvent,\n\tmap,\n\tmerge,\n\tof,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n\ttimeout,\n} from 'rxjs'\nimport { isPresent } from 'ts-is-present'\nimport area from './area.service'\nimport { HISTORY_STRATEGY, RouteAction } from './router.types'\n\ntype TRouteArea = {\n\tcomponent: string\n\tstate: object | undefined\n}\n\n@customElement('schmancy-area')\nexport class SchmancyArea extends $LitElement(css`\n\t:host {\n\t\tposition: relative;\n\t\tdisplay: block;\n\t\tinset: 0;\n\t}\n`) {\n\t/**\n\t * The name of the router outlet\n\t * @attr\n\t * @type {string}\n\t * @public\n\t * @required\n\t */\n\t@property() name!: string\n\n\t@property() default!: string | Promise<NodeModule> | CustomElementConstructor | TemplateResult<1>\n\n\t/**\n\t *\n\t * @param pathname pathname from the browser location API\n\t * @param historyStrategy the history strategy to use for the route like PUSH, REPLACE, or SILENT\n\t * @returns rxjs pipes that will return the component to render and the history strategy to use\n\t */\n\tgetComponentFromPathname(pathname: string, historyStrategy: HISTORY_STRATEGY) {\n\t\treturn of(pathname).pipe(\n\t\t\tmap(path => path.split('/').pop() ?? ''),\n\t\t\tmap(path => decodeURIComponent(path)),\n\t\t\tmap(path => JSON.parse(path)),\n\t\t\tmap(routes => routes[this.name] as TRouteArea),\n\t\t\tmap(component =>\n\t\t\t\t!component && this.default\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tcomponent: this.default,\n\t\t\t\t\t\t\tstate: undefined,\n\t\t\t\t\t\t}\n\t\t\t\t\t: component,\n\t\t\t),\n\t\t\tfilter(x => isPresent(x)),\n\t\t\tmap((component: TRouteArea) => ({\n\t\t\t\tarea: this.name,\n\t\t\t\tcomponent: component.component ?? this.default,\n\t\t\t\tstate: component.state,\n\t\t\t\thistoryStrategy,\n\t\t\t})),\n\t\t\tmap(x => x as RouteAction),\n\t\t\tcatchError(() => {\n\t\t\t\treturn this.default\n\t\t\t\t\t? of({\n\t\t\t\t\t\t\tarea: this.name,\n\t\t\t\t\t\t\tcomponent: this.default,\n\t\t\t\t\t\t\thistoryStrategy,\n\t\t\t\t\t\t} as RouteAction)\n\t\t\t\t\t: EMPTY\n\t\t\t}),\n\t\t)\n\t}\n\n\tprotected firstUpdated(): void {\n\t\tif (!this.name) {\n\t\t\t// TOOD: maybe enforce this to be unique\n\t\t\tthrow new Error('Area name or default component not set')\n\t\t}\n\n\t\t// active outlet changes\n\t\tmerge(\n\t\t\t// 1) initial load from location.pathname\n\t\t\tof(location.pathname).pipe(\n\t\t\t\tswitchMap(pathname => this.getComponentFromPathname(pathname, HISTORY_STRATEGY.silent)),\n\t\t\t\tmap(route => route as RouteAction),\n\t\t\t\ttake(1),\n\t\t\t),\n\t\t\t// 2) requests to change the route for this area\n\t\t\tarea.request.pipe(filter(({ area }) => area === this.name)),\n\t\t\t// 3) popstate events (back, forward)\n\t\t\tfromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\t\tmap(e => (e.target as Window).location.pathname),\n\t\t\t\tswitchMap(pathname => this.getComponentFromPathname(pathname, HISTORY_STRATEGY.silent)),\n\t\t\t\tmap(route => route as RouteAction),\n\t\t\t),\n\t\t)\n\t\t\t.pipe(\n\t\t\t\tfilter(request => !!request.component),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\tdistinctUntilChanged((a, b) => {\n\t\t\t\t\tlet aComponent, bComponent\n\t\t\t\t\tif (typeof a.component === 'function') return false\n\t\t\t\t\telse if (typeof a.component === 'string') aComponent = a.component\n\n\t\t\t\t\tif (typeof b.component === 'function') return false\n\t\t\t\t\telse if (typeof b.component === 'string') bComponent = b.component\n\n\t\t\t\t\treturn bComponent?.replaceAll('-', '').toLowerCase() === aComponent?.replaceAll('-', '').toLowerCase()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.pipe(\n\t\t\t\tswitchMap(route => {\n\t\t\t\t\tconst c = route.component\n\t\t\t\t\tif (c instanceof Promise) {\n\t\t\t\t\t\t// Dynamic import module\n\t\t\t\t\t\treturn from(c).pipe(map(x => ({ component: x.exports.default as CustomElementConstructor, route })))\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Already a string, function, or element\n\t\t\t\t\t\treturn of({ component: c, route })\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tmap(({ component, route }) => {\n\t\t\t\t\tif (typeof component === 'string') {\n\t\t\t\t\t\t// Tag name\n\t\t\t\t\t\treturn { component: document.createElement(component), route }\n\t\t\t\t\t} else if (component instanceof HTMLElement) {\n\t\t\t\t\t\t// Already an element instance\n\t\t\t\t\t\treturn { component, route }\n\t\t\t\t\t} else if (typeof component === 'function') {\n\t\t\t\t\t\t// Custom element constructor\n\t\t\t\t\t\treturn { component: new component(), route }\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tdistinctUntilChanged((prev, curr) => prev.component.tagName === curr.component.tagName),\n\t\t\t\t// create the new view and add it to the DOM\n\t\t\t\tmap(({ component, route }) => {\n\t\t\t\t\tconst oldView = this.shadowRoot?.children[0]\n\t\t\t\t\tconst oldViewExists = !!oldView\n\n\t\t\t\t\t// Remove the old view (if any)\n\t\t\t\t\toldView.remove()\n\t\t\t\t\t// Native Web Animations API - fade in\n\t\t\t\t\t// \"ease: cubic-bezier(0.25, 0.8, 0.25, 1)\" was used in the old code\n\t\t\t\t\tcomponent.classList.add('opacity-0')\n\t\t\t\t\tthis.shadowRoot?.append(component)\n\t\t\t\t\tcomponent.animate([{ opacity: 0 }, { opacity: 1 }], {\n\t\t\t\t\t\tduration: oldViewExists ? 150 : 100,\n\t\t\t\t\t\teasing: 'cubic-bezier(0.25, 0.8, 0.25, 1)',\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t})\n\n\t\t\t\t\t// Insert the new view\n\n\t\t\t\t\treturn { component, route }\n\t\t\t\t}),\n\t\t\t\ttap(({ component, route }) => {\n\t\t\t\t\t// Handle history updates\n\t\t\t\t\tif (typeof route.historyStrategy === 'undefined' || route.historyStrategy === 'push') {\n\t\t\t\t\t\thistory.pushState(route.state, '', this.newPath(component.tagName, route))\n\t\t\t\t\t} else if (route.historyStrategy && ['replace', 'pop'].includes(route.historyStrategy)) {\n\t\t\t\t\t\thistory.replaceState(route.state, '', this.newPath(component.tagName, route))\n\t\t\t\t\t}\n\t\t\t\t\tarea.current.set(this.name, {\n\t\t\t\t\t\tcomponent: component.tagName,\n\t\t\t\t\t\tstate: route.state,\n\t\t\t\t\t\tarea: this.name,\n\t\t\t\t\t})\n\n\t\t\t\t\tarea.$current.next(area.current)\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tnewPath(tag: string, route: RouteAction) {\n\t\tconst oldPathname = location.pathname.split('/').pop()\n\t\tlet oldAreaState = {}\n\t\ttry {\n\t\t\toldAreaState = oldPathname ? JSON.parse(decodeURIComponent(oldPathname)) : {}\n\t\t} catch {\n\t\t\toldAreaState = {}\n\t\t}\n\t\troute.state = route.state ?? {}\n\t\tconst queryParams = route.clearQueryParams ? this.queryParamClear(route.clearQueryParams) : document.location.search\n\n\t\treturn encodeURIComponent(\n\t\t\tJSON.stringify({\n\t\t\t\t...oldAreaState,\n\t\t\t\t[this.name]: { component: tag.toLowerCase(), state: route.state },\n\t\t\t}),\n\t\t).concat(`${queryParams}`)\n\t}\n\n\tqueryParamClear(params?: string[]) {\n\t\tif (!params) {\n\t\t\treturn ''\n\t\t}\n\t\t// get query params from url\n\t\tconst urlParams = new URLSearchParams(location.search)\n\t\t// remove query params\n\t\tparams.forEach(param => urlParams.delete(param))\n\t\t// update url\n\t\tif (urlParams.toString() === '') return ''\n\t\treturn `?${urlParams.toString()}`\n\t}\n\n\tcheckForTeleportationRequests() {\n\t\treturn fromEvent<CustomEvent>(window, 'FLIP_REQUEST').pipe(\n\t\t\tmap(e => e.detail),\n\t\t\tbufferTime(0),\n\t\t\ttap(() => {\n\t\t\t\tthis.dispatchEvent(new CustomEvent('FLIP_STARTED'))\n\t\t\t}),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t\ttimeout(0),\n\t\t\tcatchError(() => of(null)),\n\t\t)\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\trender() {\n\t\treturn html` <slot> </slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-area': SchmancyArea\n\t}\n}\n"],"names":["routerHistory","Subject","FINDING_MORTIES","HERE_RICKY","AreaService","constructor","this","prettyURL","mode","request","ReplaySubject","current","Map","$current","enableHistoryMode","findingMortiesEvent","CustomEvent","next","zip","fromEvent","window","pipe","map","e","detail","bufferTime","tap","console","log","of","dispatchEvent","component","timeout","r","name","newState","JSON","parse","stringify","area","state","history","replaceState","encodeURIComponent","getInstance","instance","pathname","location","split","pop","areaState","decodeURIComponent","HISTORY_STRATEGY","SchmancyArea","$LitElement","css","historyStrategy","path","routes","default","filter","x","isPresent","libExports","catchError","EMPTY","Error","merge","switchMap","getComponentFromPathname","silent","route","take","target","takeUntil","disconnecting","distinctUntilChanged","a","b","aComponent","bComponent","replaceAll","toLowerCase","c","Promise","from","exports","document","createElement","HTMLElement","prev","curr","tagName","oldView","shadowRoot","children","oldViewExists","remove","classList","add","append","animate","opacity","duration","easing","fill","pushState","newPath","includes","set","subscribe","tag","oldPathname","oldAreaState","queryParams","clearQueryParams","queryParamClear","search","concat","params","urlParams","URLSearchParams","forEach","param","delete","toString","super","disconnectedCallback","html","__decorateClass","property","prototype","customElement"],"mappings":"qSAIaA,EAAAA,EAAgB,IAAIC,EAAqBA,QAEzCC,EAAkB,kBAClBC,EAAa,aAQ1B,MAAMC,CAAAA,CAUL,aAAAC,CARAC,KAAOC,UAAAA,GACPD,KAAOE,KAA6B,UAC7BF,KAAAG,QAAU,IAAIC,EAAAA,cAA2B,CACzCJ,EAAAA,KAAAK,YAAcC,IACdN,K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,CAGD,sBACCiG,CAAAA,MAAMC,qBACDzH,EAAAA,KAAAqE,cAAc1D,KAAAA,EAAS,CAAA,CAG7B,QACQ,CAAA,OAAA+G,EAAAA,sBAAA,CAAA,EArMIC,EAAA,CAAXC,EAASA,SAdE7E,CAAAA,EAAAA,qBAcA8E,UAAA,OAAA,CAAA,EAEAF,EAAA,CAAXC,EAASA,SAhBE7E,CAAAA,EAAAA,qBAgBA8E,UAAA,UAAA,CAAA,EAhBA9E,QAANA,aAAA4E,EAAA,CADNG,EAAAA,cAAc,eAAA,CAAA,EACF/E"}
@@ -1,62 +0,0 @@
1
- import "rxjs";
2
- import "lit/directives/class-map.js";
3
- import "lit/directives/style-map.js";
4
- import { T as p } from "./tailwind.mixin-ECkyl80C.js";
5
- import { html as m } from "lit";
6
- import { property as u, customElement as d } from "lit/decorators.js";
7
- var v = Object.defineProperty, f = Object.getOwnPropertyDescriptor, a = (n, e, i, r) => {
8
- for (var s, t = r > 1 ? void 0 : r ? f(e, i) : e, o = n.length - 1; o >= 0; o--) (s = n[o]) && (t = (r ? s(e, i, t) : s(t)) || t);
9
- return r && t && v(e, i, t), t;
10
- };
11
- let c = class extends p() {
12
- constructor() {
13
- super(...arguments), this.type = "success";
14
- }
15
- render() {
16
- return m`
17
- <div
18
- class="pointer-events-auto w-full max-w-sm
19
- rounded-lg bg-surface-container shadow-lg
20
- ring-1 ring-outlineVariant ring-opacity-5 p-3"
21
- >
22
- <!-- Icon + Text + Close Button, etc. -->
23
- <div class="flex items-center">
24
- <!-- Icon -->
25
- <div class="shrink-0 mr-2">
26
- <!-- Show different icons depending on this.type -->
27
- <!-- e.g., success, error, etc. -->
28
- </div>
29
-
30
- <!-- Text slot -->
31
- <div class="flex-1">
32
- <slot></slot>
33
- </div>
34
-
35
- <!-- Close -->
36
- <schmancy-icon-button
37
- @click=${() => this.dispatchEvent(new CustomEvent("close"))}
38
- variant="outlined"
39
- class="ml-2 text-sm"
40
- >Close</schmancy-icon-button
41
- >
42
- </div>
43
- </div>
44
- `;
45
- }
46
- };
47
- a([u({ type: String })], c.prototype, "type", 2), c = a([d("schmancy-notification")], c);
48
- var g = Object.getOwnPropertyDescriptor;
49
- let l = class extends p() {
50
- render() {
51
- return m` <slot></slot> `;
52
- }
53
- };
54
- l = ((n, e, i, r) => {
55
- for (var s, t = r > 1 ? void 0 : r ? g(e, i) : e, o = n.length - 1; o >= 0; o--) (s = n[o]) && (t = s(t) || t);
56
- return t;
57
- })([d("schmancy-notification-outlet")], l);
58
- export {
59
- c as S,
60
- l as a
61
- };
62
- //# sourceMappingURL=outlet-B16Pt3na.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"outlet-B16Pt3na.js","sources":["../src/notification/notification.ts","../src/notification/outlet.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('schmancy-notification')\nexport class SchmancyNotification extends TailwindElement() {\n\t@property({ type: String })\n\ttype: 'success' | 'error' | 'warning' | 'info' = 'success'\n\n\trender() {\n\t\treturn html`\n\t\t\t<div\n\t\t\t\tclass=\"pointer-events-auto w-full max-w-sm\n rounded-lg bg-surface-container shadow-lg\n ring-1 ring-outlineVariant ring-opacity-5 p-3\"\n\t\t\t>\n\t\t\t\t<!-- Icon + Text + Close Button, etc. -->\n\t\t\t\t<div class=\"flex items-center\">\n\t\t\t\t\t<!-- Icon -->\n\t\t\t\t\t<div class=\"shrink-0 mr-2\">\n\t\t\t\t\t\t<!-- Show different icons depending on this.type -->\n\t\t\t\t\t\t<!-- e.g., success, error, etc. -->\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Text slot -->\n\t\t\t\t\t<div class=\"flex-1\">\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Close -->\n\t\t\t\t\t<schmancy-icon-button\n\t\t\t\t\t\t@click=${() => this.dispatchEvent(new CustomEvent('close'))}\n\t\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\t\tclass=\"ml-2 text-sm\"\n\t\t\t\t\t\t>Close</schmancy-icon-button\n\t\t\t\t\t>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification': SchmancyNotification\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-notification-outlet')\nexport class SchmancyNotificationOutlet extends TailwindElement() {\n\trender() {\n\t\treturn html` <slot></slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification-outlet': SchmancyNotificationOutlet\n\t}\n}\n"],"names":["SchmancyNotification","TailwindElement","constructor","super","arguments","this","type","render","html","dispatchEvent","CustomEvent","__decorateClass","property","String","prototype","customElement","SchmancyNotificationOutlet"],"mappings":";;;;;;;;;;AAKa,IAAAA,IAAN,cAAmCC;EAAnC,cAAAC;AAAAC,UAAAC,GAAAA,SAAAA,GAE2CC,KAAAC,OAAA;AAAA,EAAA;AAAA,EAEjD,SAAAC;AACQ,WAAAC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,eAqBM,MAAMH,KAAKI,cAAc,IAAIC,YAAY,OAAA,CAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAS;AAAA;AAxBhEC,EAAA,CADCC,EAAS,EAAEN,MAAMO,OADNb,CAAAA,CAAAA,GAAAA,EAEZc,WAAA,QAAA,CAFYd,GAAAA,IAANW,EAAA,CADNI,EAAc,uBACFf,CAAAA,GAAAA,CAAAA;;ACAA,IAAAgB,IAAN,cAAyCf,EAC/C,EAAA;AAAA,EAAA,SACQ;AAAA,WAAAO;AAAAA,EAAA;AAAA;AAFIQ;;;GAAN,CADND,EAAc,8BAAA,CAAA,GACFC;"}
@@ -1,30 +0,0 @@
1
- "use strict";require("rxjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const l=require("./tailwind.mixin-DFM3jd9q.cjs"),u=require("lit"),s=require("lit/decorators.js");var m=Object.defineProperty,d=Object.getOwnPropertyDescriptor,a=(c,e,o,i)=>{for(var r,t=i>1?void 0:i?d(e,o):e,n=c.length-1;n>=0;n--)(r=c[n])&&(t=(i?r(e,o,t):r(t))||t);return i&&t&&m(e,o,t),t};exports.SchmancyNotification=class extends l.TailwindElement(){constructor(){super(...arguments),this.type="success"}render(){return u.html`
2
- <div
3
- class="pointer-events-auto w-full max-w-sm
4
- rounded-lg bg-surface-container shadow-lg
5
- ring-1 ring-outlineVariant ring-opacity-5 p-3"
6
- >
7
- <!-- Icon + Text + Close Button, etc. -->
8
- <div class="flex items-center">
9
- <!-- Icon -->
10
- <div class="shrink-0 mr-2">
11
- <!-- Show different icons depending on this.type -->
12
- <!-- e.g., success, error, etc. -->
13
- </div>
14
-
15
- <!-- Text slot -->
16
- <div class="flex-1">
17
- <slot></slot>
18
- </div>
19
-
20
- <!-- Close -->
21
- <schmancy-icon-button
22
- @click=${()=>this.dispatchEvent(new CustomEvent("close"))}
23
- variant="outlined"
24
- class="ml-2 text-sm"
25
- >Close</schmancy-icon-button
26
- >
27
- </div>
28
- </div>
29
- `}},a([s.property({type:String})],exports.SchmancyNotification.prototype,"type",2),exports.SchmancyNotification=a([s.customElement("schmancy-notification")],exports.SchmancyNotification);var h=Object.getOwnPropertyDescriptor;exports.SchmancyNotificationOutlet=class extends l.TailwindElement(){render(){return u.html` <slot></slot> `}},exports.SchmancyNotificationOutlet=((c,e,o,i)=>{for(var r,t=i>1?void 0:i?h(e,o):e,n=c.length-1;n>=0;n--)(r=c[n])&&(t=r(t)||t);return t})([s.customElement("schmancy-notification-outlet")],exports.SchmancyNotificationOutlet);
30
- //# sourceMappingURL=outlet-CT1apG_R.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"outlet-CT1apG_R.cjs","sources":["../src/notification/notification.ts","../src/notification/outlet.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('schmancy-notification')\nexport class SchmancyNotification extends TailwindElement() {\n\t@property({ type: String })\n\ttype: 'success' | 'error' | 'warning' | 'info' = 'success'\n\n\trender() {\n\t\treturn html`\n\t\t\t<div\n\t\t\t\tclass=\"pointer-events-auto w-full max-w-sm\n rounded-lg bg-surface-container shadow-lg\n ring-1 ring-outlineVariant ring-opacity-5 p-3\"\n\t\t\t>\n\t\t\t\t<!-- Icon + Text + Close Button, etc. -->\n\t\t\t\t<div class=\"flex items-center\">\n\t\t\t\t\t<!-- Icon -->\n\t\t\t\t\t<div class=\"shrink-0 mr-2\">\n\t\t\t\t\t\t<!-- Show different icons depending on this.type -->\n\t\t\t\t\t\t<!-- e.g., success, error, etc. -->\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Text slot -->\n\t\t\t\t\t<div class=\"flex-1\">\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<!-- Close -->\n\t\t\t\t\t<schmancy-icon-button\n\t\t\t\t\t\t@click=${() => this.dispatchEvent(new CustomEvent('close'))}\n\t\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\t\tclass=\"ml-2 text-sm\"\n\t\t\t\t\t\t>Close</schmancy-icon-button\n\t\t\t\t\t>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification': SchmancyNotification\n\t}\n}\n","import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\n@customElement('schmancy-notification-outlet')\nexport class SchmancyNotificationOutlet extends TailwindElement() {\n\trender() {\n\t\treturn html` <slot></slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-notification-outlet': SchmancyNotificationOutlet\n\t}\n}\n"],"names":["SchmancyNotification","TailwindElement","constructor","super","arguments","this","type","html","dispatchEvent","CustomEvent","__decorateClass","property","String","prototype","customElement","SchmancyNotificationOutlet"],"mappings":"4YAKaA,QAAAA,qBAAN,cAAmCC,EAAAA,kBAAnC,aAAAC,CAAAC,SAAAC,SAE2CC,EAAAA,KAAAC,KAAA,SAAA,CAEjD,QACQ,CAAA,OAAAC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,eAqBM,IAAMF,KAAKG,cAAc,IAAIC,YAAY,OAAA,CAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAAS,CAAA,EAxBhEC,EAAA,CADCC,WAAS,CAAEL,KAAMM,MADNZ,CAAAA,CAAAA,EAAAA,6BAEZa,UAAA,OAAA,CAFYb,EAAAA,QAANA,qBAAAU,EAAA,CADNI,EAAAA,cAAc,uBACFd,CAAAA,EAAAA,oECAAe,QAAAA,2BAAN,cAAyCd,EAAAA,gBAAAA,CAAAA,CAC/C,QACQ,CAAA,OAAAM,EAAAA,qBAAA,GAFIQ,QAANA,iIAAA,CADND,EAAAA,cAAc,iCACFC"}