@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.
- package/dist/area.cjs +1 -1
- package/dist/area.component-8AQUkma0.js +119 -0
- package/dist/area.component-8AQUkma0.js.map +1 -0
- package/dist/area.component-nkE9S6b3.cjs +8 -0
- package/dist/area.component-nkE9S6b3.cjs.map +1 -0
- package/dist/area.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{chips-CR5QTRYd.js → chips-BL6vlm9-.js} +12 -12
- package/dist/{chips-CR5QTRYd.js.map → chips-BL6vlm9-.js.map} +1 -1
- package/dist/chips.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/{delay-DE7SE2Lx.cjs → delay-_tsTZ2IL.cjs} +2 -2
- package/dist/{delay-DE7SE2Lx.cjs.map → delay-_tsTZ2IL.cjs.map} +1 -1
- package/dist/delay.cjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +40 -41
- package/dist/index.js.map +1 -1
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +5 -6
- package/dist/notification.js.map +1 -1
- package/dist/outlet-IKjizKaN.cjs +30 -0
- package/dist/outlet-IKjizKaN.cjs.map +1 -0
- package/dist/outlet-Us3Wi-TE.js +81 -0
- package/dist/outlet-Us3Wi-TE.js.map +1 -0
- package/dist/rxjs-utils.js +4 -4
- package/dist/teleport.cjs +1 -1
- package/dist/{teleport.component-CLtX4xnl.cjs → teleport.component-CH--tF4H.cjs} +2 -2
- package/dist/{teleport.component-CLtX4xnl.cjs.map → teleport.component-CH--tF4H.cjs.map} +1 -1
- package/dist/{teleport.component-BbJ2RCj-.js → teleport.component-Kcn8tqQF.js} +9 -10
- package/dist/{teleport.component-BbJ2RCj-.js.map → teleport.component-Kcn8tqQF.js.map} +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{typewriter-SgYEA2OC.js → typewriter-Dn4nHKtu.js} +11 -11
- package/dist/{typewriter-SgYEA2OC.js.map → typewriter-Dn4nHKtu.js.map} +1 -1
- package/dist/{typewriter-CAmStzUa.cjs → typewriter-I6nigRrM.cjs} +2 -2
- package/dist/{typewriter-CAmStzUa.cjs.map → typewriter-I6nigRrM.cjs.map} +1 -1
- package/dist/typewriter.cjs +1 -1
- package/dist/typewriter.js +1 -1
- package/package.json +1 -1
- package/types/src/area/area.component.d.ts +64 -4
- package/types/src/area/router.types.d.ts +1 -1
- package/dist/_notification-BMl7x5RW.cjs +0 -2
- package/dist/_notification-BMl7x5RW.cjs.map +0 -1
- package/dist/_notification-D5MEzxBs.js +0 -21
- package/dist/_notification-D5MEzxBs.js.map +0 -1
- package/dist/area.component-Bd-yUYxJ.js +0 -107
- package/dist/area.component-Bd-yUYxJ.js.map +0 -1
- package/dist/area.component-DaAJvOaf.cjs +0 -8
- package/dist/area.component-DaAJvOaf.cjs.map +0 -1
- package/dist/outlet-B16Pt3na.js +0 -62
- package/dist/outlet-B16Pt3na.js.map +0 -1
- package/dist/outlet-CT1apG_R.cjs +0 -30
- package/dist/outlet-CT1apG_R.cjs.map +0 -1
package/dist/area.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./area.component-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./area.component-nkE9S6b3.cjs");exports.FINDING_MORTIES=e.FINDING_MORTIES,exports.HERE_RICKY=e.HERE_RICKY,exports.HISTORY_STRATEGY=e.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>e.SchmancyArea}),exports.area=e.area,exports.routerHistory=e.routerHistory;
|
|
2
2
|
//# sourceMappingURL=area.cjs.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Subject as I, ReplaySubject as E, zip as b, fromEvent as C, of as i, map as a, bufferTime as N, tap as u, timeout as v, catchError as g, EMPTY as P, filter as f, merge as O, switchMap as y, take as F, takeUntil as w, distinctUntilChanged as R, from as U } from "rxjs";
|
|
2
|
+
import "lit/directives/class-map.js";
|
|
3
|
+
import "lit/directives/style-map.js";
|
|
4
|
+
import { $ as M } from "./litElement.mixin-B43tuAsM.js";
|
|
5
|
+
import "./tailwind.mixin-ECkyl80C.js";
|
|
6
|
+
import { css as T, html as L } from "lit";
|
|
7
|
+
import { property as S, customElement as $ } from "lit/decorators.js";
|
|
8
|
+
import { l as J } from "./index-CuY8m6ta.js";
|
|
9
|
+
const B = new I(), x = "FINDING_MORTIES", k = "HERE_RICKY";
|
|
10
|
+
class p {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.prettyURL = !1, this.mode = "HISTORY", this.request = new E(1), this.current = /* @__PURE__ */ new Map(), this.$current = new E(1), this.enableHistoryMode = !0, this.findingMortiesEvent = new CustomEvent(x), this.$current.next(this.current);
|
|
13
|
+
}
|
|
14
|
+
find() {
|
|
15
|
+
return b([C(window, k).pipe(a((t) => t.detail), N(0), u(console.log)), i(1).pipe(u(() => window.dispatchEvent(this.findingMortiesEvent)))]).pipe(a(([t]) => t), v(1));
|
|
16
|
+
}
|
|
17
|
+
push(t) {
|
|
18
|
+
this.request.next(t);
|
|
19
|
+
}
|
|
20
|
+
pop(t) {
|
|
21
|
+
const n = JSON.parse(JSON.stringify(m.state));
|
|
22
|
+
delete n[t], history.replaceState(null, "", encodeURIComponent(JSON.stringify(n)));
|
|
23
|
+
}
|
|
24
|
+
static getInstance() {
|
|
25
|
+
return p.instance || (p.instance = new p()), p.instance;
|
|
26
|
+
}
|
|
27
|
+
get state() {
|
|
28
|
+
const t = location.pathname.split("/").pop();
|
|
29
|
+
let n = {};
|
|
30
|
+
try {
|
|
31
|
+
n = t ? JSON.parse(decodeURIComponent(t)) : {};
|
|
32
|
+
} catch {
|
|
33
|
+
n = {};
|
|
34
|
+
}
|
|
35
|
+
return n;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const m = p.getInstance();
|
|
39
|
+
var h = ((e) => (e.push = "push", e.replace = "replace", e.pop = "pop", e.silent = "silent", e))(h || {}), q = Object.defineProperty, A = Object.getOwnPropertyDescriptor, l = (e, t, n, o) => {
|
|
40
|
+
for (var r, s = o > 1 ? void 0 : o ? A(t, n) : t, d = e.length - 1; d >= 0; d--) (r = e[d]) && (s = (o ? r(t, n, s) : r(s)) || s);
|
|
41
|
+
return o && s && q(t, n, s), s;
|
|
42
|
+
};
|
|
43
|
+
let c = class extends M(T`
|
|
44
|
+
:host {
|
|
45
|
+
position: relative;
|
|
46
|
+
display: block;
|
|
47
|
+
inset: 0;
|
|
48
|
+
}
|
|
49
|
+
`) {
|
|
50
|
+
constructor() {
|
|
51
|
+
super(...arguments), this.mappings = [];
|
|
52
|
+
}
|
|
53
|
+
getComponentFromMappings(e, t) {
|
|
54
|
+
return i(location.pathname).pipe(a((n) => {
|
|
55
|
+
const o = e.find((s) => s.pathname === n);
|
|
56
|
+
if (!o) throw new Error(`No mapping found for pathname: ${n}`);
|
|
57
|
+
const r = o.routes.find((s) => s.area === this.name);
|
|
58
|
+
if (!r) throw new Error(`No route found for area: ${this.name} in pathname: ${n}`);
|
|
59
|
+
return r;
|
|
60
|
+
}), a((n) => ({ area: this.name, component: n.component || this.default, state: n.state, historyStrategy: t })), g(() => this.default ? i({ area: this.name, component: this.default, historyStrategy: t }) : P));
|
|
61
|
+
}
|
|
62
|
+
getComponentFromPathname(e, t) {
|
|
63
|
+
return i(e).pipe(a((n) => n.split("/").pop() ?? ""), a((n) => decodeURIComponent(n)), a((n) => JSON.parse(n)), a((n) => n[this.name]), a((n) => !n && this.default ? { component: this.default, state: void 0 } : n), f((n) => J.isPresent(n)), a((n) => ({ area: this.name, component: n.component ?? this.default, state: n.state, historyStrategy: t })), a((n) => n), g(() => this.default ? i({ area: this.name, component: this.default, historyStrategy: t }) : P));
|
|
64
|
+
}
|
|
65
|
+
firstUpdated() {
|
|
66
|
+
if (!this.name) throw new Error("Area name or default component not set");
|
|
67
|
+
O(i(location.pathname).pipe(y((e) => this.mappings && this.mappings.length ? this.getComponentFromMappings(this.mappings, h.silent) : this.getComponentFromPathname(e, h.silent)), F(1)), m.request.pipe(f(({ area: e }) => e === this.name)), C(window, "popstate").pipe(a((e) => e.target.location.pathname), y((e) => this.mappings && this.mappings.length ? this.getComponentFromMappings(this.mappings, h.silent) : this.getComponentFromPathname(e, h.silent)))).pipe(f((e) => !!e.component), w(this.disconnecting), R((e, t) => {
|
|
68
|
+
let n, o;
|
|
69
|
+
return typeof e.component != "function" && (typeof e.component == "string" && (n = e.component), typeof t.component != "function" && (typeof t.component == "string" && (o = t.component), (o == null ? void 0 : o.replaceAll("-", "").toLowerCase()) === (n == null ? void 0 : n.replaceAll("-", "").toLowerCase())));
|
|
70
|
+
})).pipe(y((e) => {
|
|
71
|
+
const t = e.component;
|
|
72
|
+
return t instanceof Promise ? U(t).pipe(a((n) => ({ component: n.exports.default, route: e }))) : i({ component: t, route: e });
|
|
73
|
+
}), a(({ component: e, route: t }) => typeof e == "string" ? { component: document.createElement(e), route: t } : e instanceof HTMLElement ? { component: e, route: t } : typeof e == "function" ? { component: new e(), route: t } : void 0), R((e, t) => e.component.tagName === t.component.tagName), a(({ component: e, route: t }) => {
|
|
74
|
+
var r, s;
|
|
75
|
+
const n = (r = this.shadowRoot) == null ? void 0 : r.children[0], o = !!n;
|
|
76
|
+
return n.remove(), e.classList.add("opacity-0"), (s = this.shadowRoot) == null || s.append(e), e.animate([{ opacity: 0 }, { opacity: 1 }], { duration: o ? 150 : 100, easing: "cubic-bezier(0.25, 0.8, 0.25, 1)", fill: "forwards" }), { component: e, route: t };
|
|
77
|
+
}), u(({ component: e, route: t }) => {
|
|
78
|
+
t.historyStrategy === void 0 || t.historyStrategy === "push" ? history.pushState(t.state, "", this.newPath(e.tagName, t)) : t.historyStrategy && ["replace", "pop"].includes(t.historyStrategy) && history.replaceState(t.state, "", this.newPath(e.tagName, t)), m.current.set(this.name, { component: e.tagName, state: t.state, area: this.name }), m.$current.next(m.current);
|
|
79
|
+
}), w(this.disconnecting)).subscribe();
|
|
80
|
+
}
|
|
81
|
+
newPath(e, t) {
|
|
82
|
+
const n = location.pathname.split("/").pop();
|
|
83
|
+
let o = {};
|
|
84
|
+
try {
|
|
85
|
+
o = n ? JSON.parse(decodeURIComponent(n)) : {};
|
|
86
|
+
} catch {
|
|
87
|
+
o = {};
|
|
88
|
+
}
|
|
89
|
+
t.state = t.state ?? {};
|
|
90
|
+
const r = t.clearQueryParams ? this.queryParamClear(t.clearQueryParams) : document.location.search;
|
|
91
|
+
return encodeURIComponent(JSON.stringify({ ...o, [this.name]: { component: e.toLowerCase(), state: t.state } })).concat(`${r}`);
|
|
92
|
+
}
|
|
93
|
+
queryParamClear(e) {
|
|
94
|
+
if (!e) return "";
|
|
95
|
+
const t = new URLSearchParams(location.search);
|
|
96
|
+
return e.forEach((n) => t.delete(n)), t.toString() === "" ? "" : `?${t.toString()}`;
|
|
97
|
+
}
|
|
98
|
+
checkForTeleportationRequests() {
|
|
99
|
+
return C(window, "FLIP_REQUEST").pipe(a((e) => e.detail), N(0), u(() => {
|
|
100
|
+
this.dispatchEvent(new CustomEvent("FLIP_STARTED"));
|
|
101
|
+
}), w(this.disconnecting), v(0), g(() => i(null)));
|
|
102
|
+
}
|
|
103
|
+
disconnectedCallback() {
|
|
104
|
+
super.disconnectedCallback(), this.disconnecting.next(!0);
|
|
105
|
+
}
|
|
106
|
+
render() {
|
|
107
|
+
return L` <slot> </slot> `;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
l([S()], c.prototype, "name", 2), l([S()], c.prototype, "default", 2), l([S({ type: Array })], c.prototype, "mappings", 2), c = l([$("schmancy-area")], c);
|
|
111
|
+
export {
|
|
112
|
+
x as F,
|
|
113
|
+
k as H,
|
|
114
|
+
c as S,
|
|
115
|
+
m as a,
|
|
116
|
+
h as b,
|
|
117
|
+
B as r
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=area.component-8AQUkma0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"area.component-8AQUkma0.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 | HTMLElement\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\n/**\n * Type describing the route for an area.\n */\ntype TRouteArea = {\n\tcomponent: string\n\tstate: object | undefined\n}\n\n/**\n * Type for a mapping entry. Each mapping specifies a pathname and an array of route definitions.\n * Each route definition contains an area name, a component (or promise/constructor/template),\n * and optionally, a state.\n */\nexport type AreaPathnames = {\n\tpathname: string\n\troutes: Array<{\n\t\tarea: string\n\t\tcomponent: string | Promise<NodeModule> | CustomElementConstructor | TemplateResult<1>\n\t\tstate?: object\n\t}>\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/**\n\t * The default component to use if no matching route is found.\n\t */\n\t@property() default!: string | Promise<NodeModule> | CustomElementConstructor | TemplateResult<1>\n\n\t/**\n\t * An optional array of route mappings that can be passed into the component.\n\t * Each mapping specifies a pathname and an array of routes mapping area names to components.\n\t *\n\t * Example:\n\t * [\n\t * {\n\t * pathname: '/home',\n\t * routes: [\n\t * { area: 'main', component: 'home-view', state: { foo: 'bar' } },\n\t * { area: 'sidebar', component: 'menu-view' }\n\t * ]\n\t * },\n\t * {\n\t * pathname: '/about',\n\t * routes: [\n\t * { area: 'main', component: 'about-view' },\n\t * { area: 'sidebar', component: 'info-view' }\n\t * ]\n\t * }\n\t * ]\n\t */\n\t@property({ type: Array })\n\tmappings: AreaPathnames[] = []\n\n\t/**\n\t * New API: Returns an observable emitting a RouteAction based on the passed mappings.\n\t *\n\t * It looks for a mapping that matches the current location’s pathname, then selects\n\t * the route whose area matches this component’s name.\n\t *\n\t * @param mappings - Array of route mapping objects.\n\t * @param historyStrategy - The history strategy to use (e.g. PUSH, REPLACE, SILENT).\n\t * @returns An RxJS Observable that emits a RouteAction.\n\t */\n\tpublic getComponentFromMappings(mappings: AreaPathnames[], historyStrategy: HISTORY_STRATEGY) {\n\t\treturn of(location.pathname).pipe(\n\t\t\tmap(currentPath => {\n\t\t\t\tconst mapping = mappings.find(m => m.pathname === currentPath)\n\t\t\t\tif (!mapping) {\n\t\t\t\t\tthrow new Error(`No mapping found for pathname: ${currentPath}`)\n\t\t\t\t}\n\t\t\t\tconst routeForArea = mapping.routes.find(route => route.area === this.name)\n\t\t\t\tif (!routeForArea) {\n\t\t\t\t\tthrow new Error(`No route found for area: ${this.name} in pathname: ${currentPath}`)\n\t\t\t\t}\n\t\t\t\treturn routeForArea\n\t\t\t}),\n\t\t\tmap(\n\t\t\t\troute =>\n\t\t\t\t\t({\n\t\t\t\t\t\tarea: this.name,\n\t\t\t\t\t\tcomponent: route.component || this.default,\n\t\t\t\t\t\tstate: route.state,\n\t\t\t\t\t\thistoryStrategy,\n\t\t\t\t\t}) as RouteAction,\n\t\t\t),\n\t\t\tcatchError(() =>\n\t\t\t\tthis.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\t/**\n\t * Existing API: Returns an observable that emits a RouteAction based on the provided pathname.\n\t *\n\t * @param pathname - Pathname from the browser location API.\n\t * @param historyStrategy - The history strategy to use for the route (PUSH, REPLACE, SILENT).\n\t * @returns An observable emitting the RouteAction.\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// TODO: 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// The route resolution now checks for a non-empty mappings property.\n\t\t// If mappings are provided, they override the normal parsing logic for the current URL.\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 => {\n\t\t\t\t\tif (this.mappings && this.mappings.length) {\n\t\t\t\t\t\treturn this.getComponentFromMappings(this.mappings, HISTORY_STRATEGY.silent)\n\t\t\t\t\t}\n\t\t\t\t\treturn this.getComponentFromPathname(pathname, HISTORY_STRATEGY.silent)\n\t\t\t\t}),\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 => {\n\t\t\t\t\tif (this.mappings && this.mappings.length) {\n\t\t\t\t\t\treturn this.getComponentFromMappings(this.mappings, HISTORY_STRATEGY.silent)\n\t\t\t\t\t}\n\t\t\t\t\treturn this.getComponentFromPathname(pathname, HISTORY_STRATEGY.silent)\n\t\t\t\t}),\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(\n\t\t\t\t\t\t\tmap(x => ({\n\t\t\t\t\t\t\t\tcomponent: x.exports.default as CustomElementConstructor,\n\t\t\t\t\t\t\t\troute,\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t)\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\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\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\t/**\n\t * Computes a new URL path for the given component and route.\n\t */\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\t/**\n\t * Removes specified query parameters from the current URL.\n\t */\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\tif (urlParams.toString() === '') return ''\n\t\treturn `?${urlParams.toString()}`\n\t}\n\n\t/**\n\t * Checks for teleportation requests (FLIP_REQUEST events) and dispatches a FLIP_STARTED event.\n\t */\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","super","arguments","mappings","historyStrategy","currentPath","mapping","m","Error","routeForArea","routes","route","default","catchError","EMPTY","path","filter","x","isPresent","firstUpdated","merge","switchMap","length","getComponentFromMappings","silent","getComponentFromPathname","take","target","takeUntil","disconnecting","distinctUntilChanged","a","b","aComponent","bComponent","replaceAll","toLowerCase","c","Promise","from","exports","t","o","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","disconnectedCallback","render","html","__decorateClass","property","prototype","type","Array","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,OAAAA,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;AA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,KAAW,KACjC,IAAIL,EAAUK,SAAU,CAAA;AAAA,EAAA;AAAA,EAMhC,gCACQ;AAAA,WAAArH,EAAuBC,QAAQ,cAAgBC,EAAAA,KACrDC,EAASC,CAAAA,MAAAA,EAAEC,MACXC,GAAAA,EAAW,CACXC,GAAAA,EAAI;AACHrB,WAAKyB,cAAc,IAAIf,YAAY;IAAe,CAEnDoE,GAAAA,EAAU9E,KAAK+E,aAAAA,GACfpD,EAAQ,CACRoC,GAAAA,EAAW,MAAMvC,EAAG;EACrB;AAAA,EAGD,uBACC2B;AAAAA,UAAMiF,wBACDpI,KAAA+E,cAAcpE,KAAK,EAAA;AAAA,EAAI;AAAA,EAG7B,SAAA0H;AACQ,WAAAC;AAAAA,EAAA;AAjSIC;AAAAA,EAAA,CAAXC,EAAAA,CAAAA,GAdWxF,EAcAyF,WAAA,QAAA,CAKAF,GAAAA,EAAA,CAAXC,EAnBWxF,CAAAA,GAAAA,EAmBAyF,WAAA,WAAA,IAyBZF,EAAA,CADCC,EAAS,EAAEE,MAAMC,MA3CN3F,CAAAA,CAAAA,GAAAA,EA4CZyF,WAAA,YAAA,IA5CYzF,IAANuF,EAAA,CADNK,EAAc,mBACF5F;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";const t=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const y=require("./litElement.mixin-9sOZ1KTq.cjs");require("./tailwind.mixin-DFM3jd9q.cjs");const l=require("lit"),m=require("lit/decorators.js"),g=require("./index-DyJ0oDpR.cjs"),S=new t.Subject,d="FINDING_MORTIES",f="HERE_RICKY";class c{constructor(){this.prettyURL=!1,this.mode="HISTORY",this.request=new t.ReplaySubject(1),this.current=new Map,this.$current=new t.ReplaySubject(1),this.enableHistoryMode=!0,this.findingMortiesEvent=new CustomEvent(d),this.$current.next(this.current)}find(){return t.zip([t.fromEvent(window,f).pipe(t.map(e=>e.detail),t.bufferTime(0),t.tap(console.log)),t.of(1).pipe(t.tap(()=>window.dispatchEvent(this.findingMortiesEvent)))]).pipe(t.map(([e])=>e),t.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 c.instance||(c.instance=new c),c.instance}get state(){const e=location.pathname.split("/").pop();let o={};try{o=e?JSON.parse(decodeURIComponent(e)):{}}catch{o={}}return o}}const s=c.getInstance();var p=(n=>(n.push="push",n.replace="replace",n.pop="pop",n.silent="silent",n))(p||{}),w=Object.defineProperty,E=Object.getOwnPropertyDescriptor,h=(n,e,o,a)=>{for(var i,r=a>1?void 0:a?E(e,o):e,u=n.length-1;u>=0;u--)(i=n[u])&&(r=(a?i(e,o,r):i(r))||r);return a&&r&&w(e,o,r),r};exports.SchmancyArea=class extends y.$LitElement(l.css`
|
|
2
|
+
:host {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: block;
|
|
5
|
+
inset: 0;
|
|
6
|
+
}
|
|
7
|
+
`){constructor(){super(...arguments),this.mappings=[]}getComponentFromMappings(n,e){return t.of(location.pathname).pipe(t.map(o=>{const a=n.find(r=>r.pathname===o);if(!a)throw new Error(`No mapping found for pathname: ${o}`);const i=a.routes.find(r=>r.area===this.name);if(!i)throw new Error(`No route found for area: ${this.name} in pathname: ${o}`);return i}),t.map(o=>({area:this.name,component:o.component||this.default,state:o.state,historyStrategy:e})),t.catchError(()=>this.default?t.of({area:this.name,component:this.default,historyStrategy:e}):t.EMPTY))}getComponentFromPathname(n,e){return t.of(n).pipe(t.map(o=>o.split("/").pop()??""),t.map(o=>decodeURIComponent(o)),t.map(o=>JSON.parse(o)),t.map(o=>o[this.name]),t.map(o=>!o&&this.default?{component:this.default,state:void 0}:o),t.filter(o=>g.libExports.isPresent(o)),t.map(o=>({area:this.name,component:o.component??this.default,state:o.state,historyStrategy:e})),t.map(o=>o),t.catchError(()=>this.default?t.of({area:this.name,component:this.default,historyStrategy:e}):t.EMPTY))}firstUpdated(){if(!this.name)throw new Error("Area name or default component not set");t.merge(t.of(location.pathname).pipe(t.switchMap(n=>this.mappings&&this.mappings.length?this.getComponentFromMappings(this.mappings,p.silent):this.getComponentFromPathname(n,p.silent)),t.take(1)),s.request.pipe(t.filter(({area:n})=>n===this.name)),t.fromEvent(window,"popstate").pipe(t.map(n=>n.target.location.pathname),t.switchMap(n=>this.mappings&&this.mappings.length?this.getComponentFromMappings(this.mappings,p.silent):this.getComponentFromPathname(n,p.silent)))).pipe(t.filter(n=>!!n.component),t.takeUntil(this.disconnecting),t.distinctUntilChanged((n,e)=>{let o,a;return typeof n.component!="function"&&(typeof n.component=="string"&&(o=n.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(t.switchMap(n=>{const e=n.component;return e instanceof Promise?t.from(e).pipe(t.map(o=>({component:o.exports.default,route:n}))):t.of({component:e,route:n})}),t.map(({component:n,route:e})=>typeof n=="string"?{component:document.createElement(n),route:e}:n instanceof HTMLElement?{component:n,route:e}:typeof n=="function"?{component:new n,route:e}:void 0),t.distinctUntilChanged((n,e)=>n.component.tagName===e.component.tagName),t.map(({component:n,route:e})=>{var i,r;const o=(i=this.shadowRoot)==null?void 0:i.children[0],a=!!o;return o.remove(),n.classList.add("opacity-0"),(r=this.shadowRoot)==null||r.append(n),n.animate([{opacity:0},{opacity:1}],{duration:a?150:100,easing:"cubic-bezier(0.25, 0.8, 0.25, 1)",fill:"forwards"}),{component:n,route:e}}),t.tap(({component:n,route:e})=>{e.historyStrategy===void 0||e.historyStrategy==="push"?history.pushState(e.state,"",this.newPath(n.tagName,e)):e.historyStrategy&&["replace","pop"].includes(e.historyStrategy)&&history.replaceState(e.state,"",this.newPath(n.tagName,e)),s.current.set(this.name,{component:n.tagName,state:e.state,area:this.name}),s.$current.next(s.current)}),t.takeUntil(this.disconnecting)).subscribe()}newPath(n,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:n.toLowerCase(),state:e.state}})).concat(`${i}`)}queryParamClear(n){if(!n)return"";const e=new URLSearchParams(location.search);return n.forEach(o=>e.delete(o)),e.toString()===""?"":`?${e.toString()}`}checkForTeleportationRequests(){return t.fromEvent(window,"FLIP_REQUEST").pipe(t.map(n=>n.detail),t.bufferTime(0),t.tap(()=>{this.dispatchEvent(new CustomEvent("FLIP_STARTED"))}),t.takeUntil(this.disconnecting),t.timeout(0),t.catchError(()=>t.of(null)))}disconnectedCallback(){super.disconnectedCallback(),this.disconnecting.next(!0)}render(){return l.html` <slot> </slot> `}},h([m.property()],exports.SchmancyArea.prototype,"name",2),h([m.property()],exports.SchmancyArea.prototype,"default",2),h([m.property({type:Array})],exports.SchmancyArea.prototype,"mappings",2),exports.SchmancyArea=h([m.customElement("schmancy-area")],exports.SchmancyArea),exports.FINDING_MORTIES=d,exports.HERE_RICKY=f,exports.HISTORY_STRATEGY=p,exports.area=s,exports.routerHistory=S;
|
|
8
|
+
//# sourceMappingURL=area.component-nkE9S6b3.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"area.component-nkE9S6b3.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 | HTMLElement\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\n/**\n * Type describing the route for an area.\n */\ntype TRouteArea = {\n\tcomponent: string\n\tstate: object | undefined\n}\n\n/**\n * Type for a mapping entry. Each mapping specifies a pathname and an array of route definitions.\n * Each route definition contains an area name, a component (or promise/constructor/template),\n * and optionally, a state.\n */\nexport type AreaPathnames = {\n\tpathname: string\n\troutes: Array<{\n\t\tarea: string\n\t\tcomponent: string | Promise<NodeModule> | CustomElementConstructor | TemplateResult<1>\n\t\tstate?: object\n\t}>\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/**\n\t * The default component to use if no matching route is found.\n\t */\n\t@property() default!: string | Promise<NodeModule> | CustomElementConstructor | TemplateResult<1>\n\n\t/**\n\t * An optional array of route mappings that can be passed into the component.\n\t * Each mapping specifies a pathname and an array of routes mapping area names to components.\n\t *\n\t * Example:\n\t * [\n\t * {\n\t * pathname: '/home',\n\t * routes: [\n\t * { area: 'main', component: 'home-view', state: { foo: 'bar' } },\n\t * { area: 'sidebar', component: 'menu-view' }\n\t * ]\n\t * },\n\t * {\n\t * pathname: '/about',\n\t * routes: [\n\t * { area: 'main', component: 'about-view' },\n\t * { area: 'sidebar', component: 'info-view' }\n\t * ]\n\t * }\n\t * ]\n\t */\n\t@property({ type: Array })\n\tmappings: AreaPathnames[] = []\n\n\t/**\n\t * New API: Returns an observable emitting a RouteAction based on the passed mappings.\n\t *\n\t * It looks for a mapping that matches the current location’s pathname, then selects\n\t * the route whose area matches this component’s name.\n\t *\n\t * @param mappings - Array of route mapping objects.\n\t * @param historyStrategy - The history strategy to use (e.g. PUSH, REPLACE, SILENT).\n\t * @returns An RxJS Observable that emits a RouteAction.\n\t */\n\tpublic getComponentFromMappings(mappings: AreaPathnames[], historyStrategy: HISTORY_STRATEGY) {\n\t\treturn of(location.pathname).pipe(\n\t\t\tmap(currentPath => {\n\t\t\t\tconst mapping = mappings.find(m => m.pathname === currentPath)\n\t\t\t\tif (!mapping) {\n\t\t\t\t\tthrow new Error(`No mapping found for pathname: ${currentPath}`)\n\t\t\t\t}\n\t\t\t\tconst routeForArea = mapping.routes.find(route => route.area === this.name)\n\t\t\t\tif (!routeForArea) {\n\t\t\t\t\tthrow new Error(`No route found for area: ${this.name} in pathname: ${currentPath}`)\n\t\t\t\t}\n\t\t\t\treturn routeForArea\n\t\t\t}),\n\t\t\tmap(\n\t\t\t\troute =>\n\t\t\t\t\t({\n\t\t\t\t\t\tarea: this.name,\n\t\t\t\t\t\tcomponent: route.component || this.default,\n\t\t\t\t\t\tstate: route.state,\n\t\t\t\t\t\thistoryStrategy,\n\t\t\t\t\t}) as RouteAction,\n\t\t\t),\n\t\t\tcatchError(() =>\n\t\t\t\tthis.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\t/**\n\t * Existing API: Returns an observable that emits a RouteAction based on the provided pathname.\n\t *\n\t * @param pathname - Pathname from the browser location API.\n\t * @param historyStrategy - The history strategy to use for the route (PUSH, REPLACE, SILENT).\n\t * @returns An observable emitting the RouteAction.\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// TODO: 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// The route resolution now checks for a non-empty mappings property.\n\t\t// If mappings are provided, they override the normal parsing logic for the current URL.\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 => {\n\t\t\t\t\tif (this.mappings && this.mappings.length) {\n\t\t\t\t\t\treturn this.getComponentFromMappings(this.mappings, HISTORY_STRATEGY.silent)\n\t\t\t\t\t}\n\t\t\t\t\treturn this.getComponentFromPathname(pathname, HISTORY_STRATEGY.silent)\n\t\t\t\t}),\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 => {\n\t\t\t\t\tif (this.mappings && this.mappings.length) {\n\t\t\t\t\t\treturn this.getComponentFromMappings(this.mappings, HISTORY_STRATEGY.silent)\n\t\t\t\t\t}\n\t\t\t\t\treturn this.getComponentFromPathname(pathname, HISTORY_STRATEGY.silent)\n\t\t\t\t}),\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(\n\t\t\t\t\t\t\tmap(x => ({\n\t\t\t\t\t\t\t\tcomponent: x.exports.default as CustomElementConstructor,\n\t\t\t\t\t\t\t\troute,\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t)\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\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\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\t/**\n\t * Computes a new URL path for the given component and route.\n\t */\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\t/**\n\t * Removes specified query parameters from the current URL.\n\t */\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\tif (urlParams.toString() === '') return ''\n\t\treturn `?${urlParams.toString()}`\n\t}\n\n\t/**\n\t * Checks for teleportation requests (FLIP_REQUEST events) and dispatches a FLIP_STARTED event.\n\t */\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","super","arguments","mappings","historyStrategy","currentPath","mapping","find","m","Error","routeForArea","routes","route","default","catchError","EMPTY","path","filter","x","isPresent","libExports","merge","switchMap","length","getComponentFromMappings","silent","getComponentFromPathname","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","disconnectedCallback","html","__decorateClass","property","prototype","type","Array","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,IA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|
|
1
|
-
"use strict";require("./teleport.component-
|
|
1
|
+
"use strict";require("./teleport.component-CH--tF4H.cjs");
|
|
2
2
|
//# sourceMappingURL=card.cjs.map
|
package/dist/card.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./teleport.component-
|
|
1
|
+
import "./teleport.component-Kcn8tqQF.js";
|
|
2
2
|
//# sourceMappingURL=card.js.map
|
|
@@ -126,13 +126,13 @@ class q extends x {
|
|
|
126
126
|
return n`<span class="shadow"></span>`;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
const
|
|
129
|
+
const K = b`:host,.shadow,.shadow::before,.shadow::after{border-radius:inherit;inset:0;position:absolute;transition-duration:inherit;transition-property:inherit;transition-timing-function:inherit}:host{display:flex;pointer-events:none;transition-property:box-shadow,opacity}.shadow::before,.shadow::after{content:"";transition-property:box-shadow,opacity;--_level: var(--md-elevation-level, 0);--_shadow-color: var(--md-elevation-shadow-color, var(--md-sys-color-shadow, #000))}.shadow::before{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 3,1) + 2*clamp(0,var(--_level) - 4,1))) calc(1px*(2*clamp(0,var(--_level),1) + clamp(0,var(--_level) - 2,1) + clamp(0,var(--_level) - 4,1))) 0px var(--_shadow-color);opacity:.3}.shadow::after{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 1,1) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(3*clamp(0,var(--_level),2) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(clamp(0,var(--_level),4) + 2*clamp(0,var(--_level) - 4,1))) var(--_shadow-color);opacity:.15}
|
|
130
130
|
`;
|
|
131
131
|
let I = class extends q {
|
|
132
132
|
};
|
|
133
|
-
I.styles = [
|
|
133
|
+
I.styles = [K], I = c([C("md-elevation")], I);
|
|
134
134
|
const k = "aria-label-remove";
|
|
135
|
-
class
|
|
135
|
+
class U extends v {
|
|
136
136
|
get ariaLabelRemove() {
|
|
137
137
|
if (this.hasAttribute(k)) return this.getAttribute(k);
|
|
138
138
|
const { ariaLabel: e } = this;
|
|
@@ -167,7 +167,7 @@ class G extends v {
|
|
|
167
167
|
}, { once: !0 }));
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function G({ ariaLabel: t, disabled: e, focusListener: a, tabbable: r = !1 }) {
|
|
171
171
|
return n`
|
|
172
172
|
<span id="remove-label" hidden aria-hidden="true">Remove</span>
|
|
173
173
|
<button
|
|
@@ -175,7 +175,7 @@ function K({ ariaLabel: t, disabled: e, focusListener: a, tabbable: r = !1 }) {
|
|
|
175
175
|
aria-label=${t || g}
|
|
176
176
|
aria-labelledby=${t ? g : "remove-label label"}
|
|
177
177
|
tabindex=${r ? g : -1}
|
|
178
|
-
@click=${
|
|
178
|
+
@click=${M}
|
|
179
179
|
@focus=${a}>
|
|
180
180
|
<md-focus-ring part="trailing-focus-ring"></md-focus-ring>
|
|
181
181
|
<md-ripple ?disabled=${e}></md-ripple>
|
|
@@ -191,10 +191,10 @@ function K({ ariaLabel: t, disabled: e, focusListener: a, tabbable: r = !1 }) {
|
|
|
191
191
|
</button>
|
|
192
192
|
`;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function M(t) {
|
|
195
195
|
this.disabled || this.softDisabled || (t.stopPropagation(), !this.dispatchEvent(new Event("remove", { cancelable: !0 })) || this.remove());
|
|
196
196
|
}
|
|
197
|
-
class m extends
|
|
197
|
+
class m extends U {
|
|
198
198
|
constructor() {
|
|
199
199
|
super(...arguments), this.elevated = !1, this.removable = !1, this.selected = !1, this.hasSelectedIcon = !1;
|
|
200
200
|
}
|
|
@@ -230,7 +230,7 @@ class m extends G {
|
|
|
230
230
|
` : super.renderLeadingIcon();
|
|
231
231
|
}
|
|
232
232
|
renderTrailingAction(e) {
|
|
233
|
-
return this.removable ?
|
|
233
|
+
return this.removable ? G({ focusListener: e, ariaLabel: this.ariaLabelRemove, disabled: this.disabled || this.softDisabled }) : g;
|
|
234
234
|
}
|
|
235
235
|
renderOutline() {
|
|
236
236
|
return this.elevated ? n`<md-elevation part="elevation"></md-elevation>` : super.renderOutline();
|
|
@@ -242,14 +242,14 @@ class m extends G {
|
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
c([s({ type: Boolean })], m.prototype, "elevated", void 0), c([s({ type: Boolean })], m.prototype, "removable", void 0), c([s({ type: Boolean, reflect: !0 })], m.prototype, "selected", void 0), c([s({ type: Boolean, reflect: !0, attribute: "has-selected-icon" })], m.prototype, "hasSelectedIcon", void 0), c([E(".primary.action")], m.prototype, "primaryAction", void 0), c([E(".trailing.action")], m.prototype, "trailingAction", void 0);
|
|
245
|
-
const
|
|
246
|
-
`,
|
|
245
|
+
const Z = b`:host{--_container-height: var(--md-filter-chip-container-height, 32px);--_disabled-label-text-color: var(--md-filter-chip-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filter-chip-disabled-label-text-opacity, 0.38);--_elevated-container-elevation: var(--md-filter-chip-elevated-container-elevation, 1);--_elevated-container-shadow-color: var(--md-filter-chip-elevated-container-shadow-color, var(--md-sys-color-shadow, #000));--_elevated-disabled-container-color: var(--md-filter-chip-elevated-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_elevated-disabled-container-elevation: var(--md-filter-chip-elevated-disabled-container-elevation, 0);--_elevated-disabled-container-opacity: var(--md-filter-chip-elevated-disabled-container-opacity, 0.12);--_elevated-focus-container-elevation: var(--md-filter-chip-elevated-focus-container-elevation, 1);--_elevated-hover-container-elevation: var(--md-filter-chip-elevated-hover-container-elevation, 2);--_elevated-pressed-container-elevation: var(--md-filter-chip-elevated-pressed-container-elevation, 1);--_elevated-selected-container-color: var(--md-filter-chip-elevated-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_label-text-font: var(--md-filter-chip-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-filter-chip-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-filter-chip-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-filter-chip-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_selected-focus-label-text-color: var(--md-filter-chip-selected-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-label-text-color: var(--md-filter-chip-selected-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-state-layer-color: var(--md-filter-chip-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-state-layer-opacity: var(--md-filter-chip-selected-hover-state-layer-opacity, 0.08);--_selected-label-text-color: var(--md-filter-chip-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-label-text-color: var(--md-filter-chip-selected-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-state-layer-color: var(--md-filter-chip-selected-pressed-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_selected-pressed-state-layer-opacity: var(--md-filter-chip-selected-pressed-state-layer-opacity, 0.12);--_elevated-container-color: var(--md-filter-chip-elevated-container-color, var(--md-sys-color-surface-container-low, #f7f2fa));--_disabled-outline-color: var(--md-filter-chip-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-filter-chip-disabled-outline-opacity, 0.12);--_disabled-selected-container-color: var(--md-filter-chip-disabled-selected-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-selected-container-opacity: var(--md-filter-chip-disabled-selected-container-opacity, 0.12);--_focus-outline-color: var(--md-filter-chip-focus-outline-color, var(--md-sys-color-on-surface-variant, #49454f));--_outline-color: var(--md-filter-chip-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-filter-chip-outline-width, 1px);--_selected-container-color: var(--md-filter-chip-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_selected-outline-width: var(--md-filter-chip-selected-outline-width, 0px);--_focus-label-text-color: var(--md-filter-chip-focus-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-label-text-color: var(--md-filter-chip-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filter-chip-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-opacity: var(--md-filter-chip-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-filter-chip-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-label-text-color: var(--md-filter-chip-pressed-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-color: var(--md-filter-chip-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-opacity: var(--md-filter-chip-pressed-state-layer-opacity, 0.12);--_icon-size: var(--md-filter-chip-icon-size, 18px);--_disabled-leading-icon-color: var(--md-filter-chip-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-filter-chip-disabled-leading-icon-opacity, 0.38);--_selected-focus-leading-icon-color: var(--md-filter-chip-selected-focus-leading-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-leading-icon-color: var(--md-filter-chip-selected-hover-leading-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-leading-icon-color: var(--md-filter-chip-selected-leading-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-leading-icon-color: var(--md-filter-chip-selected-pressed-leading-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_focus-leading-icon-color: var(--md-filter-chip-focus-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-leading-icon-color: var(--md-filter-chip-hover-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_leading-icon-color: var(--md-filter-chip-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_pressed-leading-icon-color: var(--md-filter-chip-pressed-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_disabled-trailing-icon-color: var(--md-filter-chip-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-icon-opacity: var(--md-filter-chip-disabled-trailing-icon-opacity, 0.38);--_selected-focus-trailing-icon-color: var(--md-filter-chip-selected-focus-trailing-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-trailing-icon-color: var(--md-filter-chip-selected-hover-trailing-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-trailing-icon-color: var(--md-filter-chip-selected-pressed-trailing-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-trailing-icon-color: var(--md-filter-chip-selected-trailing-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_focus-trailing-icon-color: var(--md-filter-chip-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-filter-chip-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-trailing-icon-color: var(--md-filter-chip-pressed-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-color: var(--md-filter-chip-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_container-shape-start-start: var(--md-filter-chip-container-shape-start-start, var(--md-filter-chip-container-shape, var(--md-sys-shape-corner-small, 8px)));--_container-shape-start-end: var(--md-filter-chip-container-shape-start-end, var(--md-filter-chip-container-shape, var(--md-sys-shape-corner-small, 8px)));--_container-shape-end-end: var(--md-filter-chip-container-shape-end-end, var(--md-filter-chip-container-shape, var(--md-sys-shape-corner-small, 8px)));--_container-shape-end-start: var(--md-filter-chip-container-shape-end-start, var(--md-filter-chip-container-shape, var(--md-sys-shape-corner-small, 8px)));--_leading-space: var(--md-filter-chip-leading-space, 16px);--_trailing-space: var(--md-filter-chip-trailing-space, 16px);--_icon-label-space: var(--md-filter-chip-icon-label-space, 8px);--_with-leading-icon-leading-space: var(--md-filter-chip-with-leading-icon-leading-space, 8px);--_with-trailing-icon-trailing-space: var(--md-filter-chip-with-trailing-icon-trailing-space, 8px)}.selected.elevated::before{background:var(--_elevated-selected-container-color)}.checkmark{height:var(--_icon-size);width:var(--_icon-size)}.disabled .checkmark{opacity:var(--_disabled-leading-icon-opacity)}@media(forced-colors: active){.disabled .checkmark{opacity:1}}
|
|
246
|
+
`, H = b`.selected{--md-ripple-hover-color: var(--_selected-hover-state-layer-color);--md-ripple-hover-opacity: var(--_selected-hover-state-layer-opacity);--md-ripple-pressed-color: var(--_selected-pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_selected-pressed-state-layer-opacity)}:where(.selected)::before{background:var(--_selected-container-color)}:where(.selected) .outline{border-width:var(--_selected-outline-width)}:where(.selected.disabled)::before{background:var(--_disabled-selected-container-color);opacity:var(--_disabled-selected-container-opacity)}:where(.selected) .label{color:var(--_selected-label-text-color)}:where(.selected:hover) .label{color:var(--_selected-hover-label-text-color)}:where(.selected:focus) .label{color:var(--_selected-focus-label-text-color)}:where(.selected:active) .label{color:var(--_selected-pressed-label-text-color)}:where(.selected) .leading.icon{color:var(--_selected-leading-icon-color)}:where(.selected:hover) .leading.icon{color:var(--_selected-hover-leading-icon-color)}:where(.selected:focus) .leading.icon{color:var(--_selected-focus-leading-icon-color)}:where(.selected:active) .leading.icon{color:var(--_selected-pressed-leading-icon-color)}@media(forced-colors: active){:where(.selected:not(.elevated))::before{border:1px solid CanvasText}:where(.selected) .outline{border-width:1px}}
|
|
247
247
|
`, Y = b`:host{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end);display:inline-flex;height:var(--_container-height);cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}:host(:is([disabled],[soft-disabled])){pointer-events:none}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) 0}md-focus-ring{--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}.container{border-radius:inherit;box-sizing:border-box;display:flex;height:100%;position:relative;width:100%}.container::before{border-radius:inherit;content:"";inset:0;pointer-events:none;position:absolute}.container:not(.disabled){cursor:pointer}.container.disabled{pointer-events:none}.cell{display:flex}.action{align-items:baseline;appearance:none;background:none;border:none;border-radius:inherit;display:flex;outline:none;padding:0;position:relative;text-decoration:none}.primary.action{min-width:0;padding-inline-start:var(--_leading-space);padding-inline-end:var(--_trailing-space)}.has-icon .primary.action{padding-inline-start:var(--_with-leading-icon-leading-space)}.touch{height:48px;inset:50% 0 0;position:absolute;transform:translateY(-50%);width:100%}:host([touch-target=none]) .touch{display:none}.outline{border:var(--_outline-width) solid var(--_outline-color);border-radius:inherit;inset:0;pointer-events:none;position:absolute}:where(:focus) .outline{border-color:var(--_focus-outline-color)}:where(.disabled) .outline{border-color:var(--_disabled-outline-color);opacity:var(--_disabled-outline-opacity)}md-ripple{border-radius:inherit}.label,.icon,.touch{z-index:1}.label{align-items:center;color:var(--_label-text-color);display:flex;font-family:var(--_label-text-font);font-size:var(--_label-text-size);font-weight:var(--_label-text-weight);height:100%;line-height:var(--_label-text-line-height);overflow:hidden;user-select:none}.label-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:where(:hover) .label{color:var(--_hover-label-text-color)}:where(:focus) .label{color:var(--_focus-label-text-color)}:where(:active) .label{color:var(--_pressed-label-text-color)}:where(.disabled) .label{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.icon{align-self:center;display:flex;fill:currentColor;position:relative}.icon ::slotted(:first-child){font-size:var(--_icon-size);height:var(--_icon-size);width:var(--_icon-size)}.leading.icon{color:var(--_leading-icon-color)}.leading.icon ::slotted(*),.leading.icon svg{margin-inline-end:var(--_icon-label-space)}:where(:hover) .leading.icon{color:var(--_hover-leading-icon-color)}:where(:focus) .leading.icon{color:var(--_focus-leading-icon-color)}:where(:active) .leading.icon{color:var(--_pressed-leading-icon-color)}:where(.disabled) .leading.icon{color:var(--_disabled-leading-icon-color);opacity:var(--_disabled-leading-icon-opacity)}@media(forced-colors: active){:where(.disabled) :is(.label,.outline,.leading.icon){color:GrayText;opacity:1}}a,button{text-transform:inherit}a,button:not(:disabled,[aria-disabled=true]){cursor:inherit}
|
|
248
248
|
`, J = b`.trailing.action{align-items:center;justify-content:center;padding-inline-start:var(--_icon-label-space);padding-inline-end:var(--_with-trailing-icon-trailing-space)}.trailing.action :is(md-ripple,md-focus-ring){border-radius:50%;height:calc(1.3333333333*var(--_icon-size));width:calc(1.3333333333*var(--_icon-size))}.trailing.action md-focus-ring{inset:unset}.has-trailing .primary.action{padding-inline-end:0}.trailing.icon{color:var(--_trailing-icon-color);height:var(--_icon-size);width:var(--_icon-size)}:where(:hover) .trailing.icon{color:var(--_hover-trailing-icon-color)}:where(:focus) .trailing.icon{color:var(--_focus-trailing-icon-color)}:where(:active) .trailing.icon{color:var(--_pressed-trailing-icon-color)}:where(.disabled) .trailing.icon{color:var(--_disabled-trailing-icon-color);opacity:var(--_disabled-trailing-icon-opacity)}:where(.selected) .trailing.icon{color:var(--_selected-trailing-icon-color)}:where(.selected:hover) .trailing.icon{color:var(--_selected-hover-trailing-icon-color)}:where(.selected:focus) .trailing.icon{color:var(--_selected-focus-trailing-icon-color)}:where(.selected:active) .trailing.icon{color:var(--_selected-pressed-trailing-icon-color)}@media(forced-colors: active){.trailing.icon{color:ButtonText}:where(.disabled) .trailing.icon{color:GrayText;opacity:1}}
|
|
249
249
|
`;
|
|
250
250
|
let L = class extends m {
|
|
251
251
|
};
|
|
252
|
-
L.styles = [Y, j, J,
|
|
252
|
+
L.styles = [Y, j, J, H, Z], L = c([C("md-filter-chip")], L);
|
|
253
253
|
var N = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, u = (t, e, a, r) => {
|
|
254
254
|
for (var i, l = r > 1 ? void 0 : r ? Q(e, a) : e, o = t.length - 1; o >= 0; o--) (i = t[o]) && (l = (r ? i(e, a, l) : i(l)) || l);
|
|
255
255
|
return r && l && N(e, a, l), l;
|
|
@@ -333,4 +333,4 @@ let f = class extends D(b``) {
|
|
|
333
333
|
}
|
|
334
334
|
};
|
|
335
335
|
y([E("md-chip-set")], f.prototype, "chipSet", 2), y([s({ type: Boolean, reflect: !0 })], f.prototype, "multi", 2), y([s({ type: Array, reflect: !0 })], f.prototype, "values", 2), y([s({ type: String, reflect: !0 })], f.prototype, "value", 2), y([O({ selector: "schmancy-chip", flatten: !0 })], f.prototype, "chips", 2), f = y([C("schmancy-chips")], f);
|
|
336
|
-
//# sourceMappingURL=chips-
|
|
336
|
+
//# sourceMappingURL=chips-BL6vlm9-.js.map
|