aptechka 0.11.9 → 0.11.10
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/client-lib/instantiate-C7JiqF_y.cjs +1 -0
- package/client-lib/instantiate-DHwz5QVl.js +152 -0
- package/client-lib/jsx/ComponentElement.d.ts +1 -1
- package/client-lib/jsx/index.cjs +1 -1
- package/client-lib/jsx/index.js +2 -2
- package/client-lib/router/index.cjs +1 -1
- package/client-lib/router/index.js +1 -1
- package/package.json +1 -1
- package/client-lib/instantiate-B0Un_kqY.js +0 -136
- package/client-lib/instantiate-DV6kxhZl.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var T=Object.defineProperty,_=Object.defineProperties;var F=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var g=(t,e,n)=>e in t?T(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,C=(t,e)=>{for(var n in e||(e={}))M.call(e,n)&&g(t,n,e[n]);if(y)for(var n of y(e))R.call(e,n)&&g(t,n,e[n]);return t},k=(t,e)=>_(t,F(e));var D=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var o=(t,e,n)=>(D(t,e,"read from private field"),n?n.call(t):e.get(t)),u=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)};var A=(t,e,n)=>new Promise((c,d)=>{var m=s=>{try{l(n.next(s))}catch(h){d(h)}},i=s=>{try{l(n.throw(s))}catch(h){d(h)}},l=s=>s.done?c(s.value):Promise.resolve(s.value).then(m,i);l((n=n.apply(t,e)).next())});const w=require("./ElementConstructor-khLPmQ9V.cjs"),j=require("./object-CCiXnER2.cjs"),H=require("./string-DhgS_iFl.cjs"),r=require("./globals-bYKki-b9.cjs");require("./Store-Cr3VaD9G.cjs");require("./ticker/index.cjs");var x,f,a,E,v;class I extends HTMLElement{constructor(n){var i;super();u(this,x,new Set);u(this,f,new Set);u(this,a,new Map);u(this,E,()=>{r.contextStack.value.unshift(o(this,a))});u(this,v,()=>{r.contextStack.value=r.contextStack.value.filter(n=>n!==o(this,a))});const c=r.currentComponentElement.value;r.currentComponentElement.value=this,o(this,E).call(this);const d=n==null?void 0:n.tag(k(C({},n.attributes),{this:this})),m=(i=r.nextComponentAttributes.value)!=null&&i.lightChildren?"lightChildren":"children";new w.ElementConstructor(this,k(C({},r.nextComponentAttributes.value),{[m]:d})),r.currentComponentElement.value=c,r.nextComponentAttributes.value=null,o(this,v).call(this)}addConnectCallback(n){o(this,x).add(n)}addDisconnectCallback(n){o(this,f).add(n)}createContext(n,c){o(this,a).set(n,c)}connectedCallback(){r.currentComponentElement.value=this,o(this,x).forEach(n=>A(this,null,function*(){const c=yield n(this);this.isConnected&&c&&o(this,f).add(c)})),r.currentComponentElement.value=null,this.addEventListener("beforeChildrenChange",o(this,E)),this.addEventListener("afterChildrenChange",o(this,v))}disconnectedCallback(){o(this,f).forEach(n=>{n(this)}),this.removeEventListener("beforeChildrenChange",o(this,E)),this.removeEventListener("afterChildrenChange",o(this,v))}}x=new WeakMap,f=new WeakMap,a=new WeakMap,E=new WeakMap,v=new WeakMap;function q(t,e,...n){var i;n=n.flat().filter(l=>l!=null);const c=[],d=[];e=e||{},c.push(...n.reverse());const m=t==="instance";if(m&&e.from&&(t=e.from,e==null||delete e.from),typeof t=="function")if(m){let l=null;return j.isESClass(t)?l=new t:l=t(),delete e.children,()=>new w.ElementConstructor(l,e).node}else{if(e.children=c.reverse(),t===p)return p(e.children);const l={noCustomElement:t.noCustomElement,onlyRegister:e.__register};if(e==null||delete e.__register,l.noCustomElement){const S=t(C({},e));return()=>S}const s=`e-${H.camelToKebab(t.name)}`;let h=customElements.get(s);return h||(h=(i=class extends I{constructor(L){super(l.onlyRegister?{tag:t,attributes:e}:L)}},i.formAssociated=t.formAssociated,i),customElements.define(s,h)),()=>l.onlyRegister?h:new h({tag:t,attributes:e})}for(;c.length;){const l=c.pop();Array.isArray(l)?c.push(...l):l!=null&&d.push(l)}if(t==="component"){const l=p(d);return r.nextComponentAttributes.value=e,l.node}else{const l=e!=null&&e.lightChildren?"lightChildren":"children";return e==null||delete e.children,t?new w.ElementConstructor(t,k(C({},e),{[l]:d})):null}}function p(t){return new w.ElementConstructor(document.createDocumentFragment(),{children:t})}function K(t,e){const n=e==null?void 0:e.children,c=e==null?void 0:e.attributes;return q(t,C({},c),n)()}exports.Fragment=p;exports.h=q;exports.instantiate=K;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
var F = Object.defineProperty, M = Object.defineProperties;
|
|
2
|
+
var R = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var A = Object.getOwnPropertySymbols;
|
|
4
|
+
var D = Object.prototype.hasOwnProperty, H = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var L = (l, e, n) => e in l ? F(l, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : l[e] = n, m = (l, e) => {
|
|
6
|
+
for (var n in e || (e = {}))
|
|
7
|
+
D.call(e, n) && L(l, n, e[n]);
|
|
8
|
+
if (A)
|
|
9
|
+
for (var n of A(e))
|
|
10
|
+
H.call(e, n) && L(l, n, e[n]);
|
|
11
|
+
return l;
|
|
12
|
+
}, w = (l, e) => M(l, R(e));
|
|
13
|
+
var I = (l, e, n) => {
|
|
14
|
+
if (!e.has(l))
|
|
15
|
+
throw TypeError("Cannot " + n);
|
|
16
|
+
};
|
|
17
|
+
var s = (l, e, n) => (I(l, e, "read from private field"), n ? n.call(l) : e.get(l)), f = (l, e, n) => {
|
|
18
|
+
if (e.has(l))
|
|
19
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
20
|
+
e instanceof WeakSet ? e.add(l) : e.set(l, n);
|
|
21
|
+
};
|
|
22
|
+
var T = (l, e, n) => new Promise((o, t) => {
|
|
23
|
+
var d = (h) => {
|
|
24
|
+
try {
|
|
25
|
+
c(n.next(h));
|
|
26
|
+
} catch (r) {
|
|
27
|
+
t(r);
|
|
28
|
+
}
|
|
29
|
+
}, i = (h) => {
|
|
30
|
+
try {
|
|
31
|
+
c(n.throw(h));
|
|
32
|
+
} catch (r) {
|
|
33
|
+
t(r);
|
|
34
|
+
}
|
|
35
|
+
}, c = (h) => h.done ? o(h.value) : Promise.resolve(h.value).then(d, i);
|
|
36
|
+
c((n = n.apply(l, e)).next());
|
|
37
|
+
});
|
|
38
|
+
import { E as x } from "./ElementConstructor-Be8H1POO.js";
|
|
39
|
+
import { i as K } from "./object-D6MVWB4l.js";
|
|
40
|
+
import { c as $ } from "./string-f0Dnk0L1.js";
|
|
41
|
+
import { c as E, n as k, a as y } from "./globals-DMjysUXI.js";
|
|
42
|
+
import "./Store-Qr3SNOSf.js";
|
|
43
|
+
import "./ticker/index.js";
|
|
44
|
+
var p, C, a, u, v;
|
|
45
|
+
class j extends HTMLElement {
|
|
46
|
+
constructor(n) {
|
|
47
|
+
var i;
|
|
48
|
+
super();
|
|
49
|
+
f(this, p, /* @__PURE__ */ new Set());
|
|
50
|
+
f(this, C, /* @__PURE__ */ new Set());
|
|
51
|
+
f(this, a, /* @__PURE__ */ new Map());
|
|
52
|
+
f(this, u, () => {
|
|
53
|
+
y.value.unshift(s(this, a));
|
|
54
|
+
});
|
|
55
|
+
f(this, v, () => {
|
|
56
|
+
y.value = y.value.filter(
|
|
57
|
+
(n) => n !== s(this, a)
|
|
58
|
+
);
|
|
59
|
+
});
|
|
60
|
+
const o = E.value;
|
|
61
|
+
E.value = this, s(this, u).call(this);
|
|
62
|
+
const t = n == null ? void 0 : n.tag(w(m({}, n.attributes), {
|
|
63
|
+
this: this
|
|
64
|
+
})), d = (i = k.value) != null && i.lightChildren ? "lightChildren" : "children";
|
|
65
|
+
new x(this, w(m({}, k.value), {
|
|
66
|
+
[d]: t
|
|
67
|
+
})), E.value = o, k.value = null, s(this, v).call(this);
|
|
68
|
+
}
|
|
69
|
+
addConnectCallback(n) {
|
|
70
|
+
s(this, p).add(n);
|
|
71
|
+
}
|
|
72
|
+
addDisconnectCallback(n) {
|
|
73
|
+
s(this, C).add(n);
|
|
74
|
+
}
|
|
75
|
+
createContext(n, o) {
|
|
76
|
+
s(this, a).set(n, o);
|
|
77
|
+
}
|
|
78
|
+
connectedCallback() {
|
|
79
|
+
E.value = this, s(this, p).forEach((n) => T(this, null, function* () {
|
|
80
|
+
const o = yield n(this);
|
|
81
|
+
this.isConnected && o && s(this, C).add(o);
|
|
82
|
+
})), E.value = null, this.addEventListener("beforeChildrenChange", s(this, u)), this.addEventListener("afterChildrenChange", s(this, v));
|
|
83
|
+
}
|
|
84
|
+
disconnectedCallback() {
|
|
85
|
+
s(this, C).forEach((n) => {
|
|
86
|
+
n(this);
|
|
87
|
+
}), this.removeEventListener("beforeChildrenChange", s(this, u)), this.removeEventListener("afterChildrenChange", s(this, v));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
p = new WeakMap(), C = new WeakMap(), a = new WeakMap(), u = new WeakMap(), v = new WeakMap();
|
|
91
|
+
function q(l, e, ...n) {
|
|
92
|
+
var i;
|
|
93
|
+
n = n.flat().filter((c) => c != null);
|
|
94
|
+
const o = [], t = [];
|
|
95
|
+
e = e || {}, o.push(...n.reverse());
|
|
96
|
+
const d = l === "instance";
|
|
97
|
+
if (d && e.from && (l = e.from, e == null || delete e.from), typeof l == "function")
|
|
98
|
+
if (d) {
|
|
99
|
+
let c = null;
|
|
100
|
+
return K(l) ? c = new l() : c = l(), delete e.children, () => new x(c, e).node;
|
|
101
|
+
} else {
|
|
102
|
+
if (e.children = o.reverse(), l === g)
|
|
103
|
+
return g(e.children);
|
|
104
|
+
const c = {
|
|
105
|
+
noCustomElement: l.noCustomElement,
|
|
106
|
+
onlyRegister: e.__register
|
|
107
|
+
};
|
|
108
|
+
if (e == null || delete e.__register, c.noCustomElement) {
|
|
109
|
+
const S = l(m({}, e));
|
|
110
|
+
return () => S;
|
|
111
|
+
}
|
|
112
|
+
const h = `e-${$(l.name)}`;
|
|
113
|
+
let r = customElements.get(h);
|
|
114
|
+
return r || (r = (i = class extends j {
|
|
115
|
+
constructor(_) {
|
|
116
|
+
super(
|
|
117
|
+
c.onlyRegister ? {
|
|
118
|
+
tag: l,
|
|
119
|
+
attributes: e
|
|
120
|
+
} : _
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
}, i.formAssociated = l.formAssociated, i), customElements.define(h, r)), () => c.onlyRegister ? r : new r({ tag: l, attributes: e });
|
|
124
|
+
}
|
|
125
|
+
for (; o.length; ) {
|
|
126
|
+
const c = o.pop();
|
|
127
|
+
Array.isArray(c) ? o.push(...c) : c != null && t.push(c);
|
|
128
|
+
}
|
|
129
|
+
if (l === "component") {
|
|
130
|
+
const c = g(t);
|
|
131
|
+
return k.value = e, c.node;
|
|
132
|
+
} else {
|
|
133
|
+
const c = e != null && e.lightChildren ? "lightChildren" : "children";
|
|
134
|
+
return e == null || delete e.children, l ? new x(l, w(m({}, e), {
|
|
135
|
+
[c]: t
|
|
136
|
+
})) : null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function g(l) {
|
|
140
|
+
return new x(document.createDocumentFragment(), {
|
|
141
|
+
children: l
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function Q(l, e) {
|
|
145
|
+
const n = e == null ? void 0 : e.children, o = e == null ? void 0 : e.attributes;
|
|
146
|
+
return (/* @__PURE__ */ q(l, m({}, o), n))();
|
|
147
|
+
}
|
|
148
|
+
export {
|
|
149
|
+
g as F,
|
|
150
|
+
q as h,
|
|
151
|
+
Q as i
|
|
152
|
+
};
|
|
@@ -4,7 +4,7 @@ export interface ComponentElementParameters {
|
|
|
4
4
|
[key: string]: any;
|
|
5
5
|
};
|
|
6
6
|
}
|
|
7
|
-
export type ComponentConnectCallback = (e: ComponentElement) => void | (() => void) | ComponentDisconnectCallback;
|
|
7
|
+
export type ComponentConnectCallback = (e: ComponentElement) => void | (() => void) | Promise<void> | Promise<() => void> | ComponentDisconnectCallback;
|
|
8
8
|
export type ComponentDisconnectCallback = (e: ComponentElement) => void | Promise<void>;
|
|
9
9
|
export declare class ComponentElement extends HTMLElement {
|
|
10
10
|
#private;
|
package/client-lib/jsx/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var g=Object.defineProperty,R=Object.defineProperties;var p=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var f=(t,e,n)=>e in t?g(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,i=(t,e)=>{for(var n in e||(e={}))E.call(e,n)&&f(t,n,e[n]);if(h)for(var n of h(e))x.call(e,n)&&f(t,n,e[n]);return t},m=(t,e)=>R(t,p(e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../instantiate-
|
|
1
|
+
"use strict";var g=Object.defineProperty,R=Object.defineProperties;var p=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var f=(t,e,n)=>e in t?g(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,i=(t,e)=>{for(var n in e||(e={}))E.call(e,n)&&f(t,n,e[n]);if(h)for(var n of h(e))x.call(e,n)&&f(t,n,e[n]);return t},m=(t,e)=>R(t,p(e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../instantiate-C7JiqF_y.cjs"),o=require("../globals-bYKki-b9.cjs");require("../Store-Cr3VaD9G.cjs");require("../ticker/index.cjs");const d=require("../_createStore-C75y9luu.cjs"),w=require("../tags-BdW7ATzD.cjs"),C=require("../createStylesheet-BBBiyAsF.cjs"),S=require("../onConnect-DGP866cj.cjs");function q(t,e){((e==null?void 0:e.containerElement)||document.body).appendChild(a.instantiate(t,e))}function v(t,e=null,...n){return a.h(t,m(i({},e),{__register:!0}),...n)}function T(){return o.currentComponentElement.value.attachInternals()}function b(t){return o.currentComponentElement.value.attachShadow(i({mode:"open"},t))}function _(t){o.currentComponentElement.value.shadowRoot&&o.currentComponentElement.value.shadowRoot.adoptedStyleSheets.push(C.createStylesheet(t)),S.onConnect(e=>{if(e.shadowRoot)return;const n=e.getRootNode();if(n===document){const c=w.style(t).node;if(![...document.head.querySelectorAll("style")].find(r=>r.outerHTML===c.outerHTML))return document.head.appendChild(c),()=>{c.remove()}}else if(n instanceof ShadowRoot){const c=C.createStylesheet(t),s=[];return n.adoptedStyleSheets.filter(r=>{const y=Array.from(r.cssRules);Array.from(c.cssRules).filter(u=>!y.find(l=>l.cssText===u.cssText)).forEach(u=>{const l=r.insertRule(u.cssText);s.push(()=>{r.deleteRule(l)})})}),()=>{s.forEach(r=>r())}}})}function M(t){const e=o.contextStack.value.find(n=>n.has(t));if(e)return e.get(t)}function A(t,e){o.currentComponentElement.value.createContext(t,e)}function D(t){return{current:t}}function I(t,e){const n=t.subscribe(e);d.onDisconnect(()=>{n()})}exports.Fragment=a.Fragment;exports.h=a.h;exports.instantiate=a.instantiate;exports.currentComponentElement=o.currentComponentElement;exports._createStore=d._createStore;exports.onDisconnect=d.onDisconnect;exports.onConnect=S.onConnect;exports.attachInternals=T;exports.attachShadow=b;exports.attachStylesheet=_;exports.createContext=A;exports.createRef=D;exports.getContext=M;exports.onStoreChange=I;exports.register=v;exports.render=q;
|
package/client-lib/jsx/index.js
CHANGED
|
@@ -10,8 +10,8 @@ var f = (t, e, n) => e in t ? p(t, e, { enumerable: !0, configurable: !0, writab
|
|
|
10
10
|
S.call(e, n) && f(t, n, e[n]);
|
|
11
11
|
return t;
|
|
12
12
|
}, d = (t, e) => y(t, R(e));
|
|
13
|
-
import { i as C, h as g } from "../instantiate-
|
|
14
|
-
import { F as V } from "../instantiate-
|
|
13
|
+
import { i as C, h as g } from "../instantiate-DHwz5QVl.js";
|
|
14
|
+
import { F as V } from "../instantiate-DHwz5QVl.js";
|
|
15
15
|
import { c as a, a as w } from "../globals-DMjysUXI.js";
|
|
16
16
|
import "../Store-Qr3SNOSf.js";
|
|
17
17
|
import "../ticker/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Z=(a,e)=>(e=Symbol[a])?e:Symbol.for("Symbol."+a);var K=(a,e,s)=>{if(!e.has(a))throw TypeError("Cannot "+s)};var t=(a,e,s)=>(K(a,e,"read from private field"),s?s.call(a):e.get(a)),r=(a,e,s)=>{if(e.has(a))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(a):e.set(a,s)},n=(a,e,s,i)=>(K(a,e,"write to private field"),i?i.call(a,s):e.set(a,s),s);var W=(a,e,s)=>(K(a,e,"access private method"),s);var M=(a,e,s)=>new Promise((i,h)=>{var o=u=>{try{f(s.next(u))}catch(w){h(w)}},c=u=>{try{f(s.throw(u))}catch(w){h(w)}},f=u=>u.done?i(u.value):Promise.resolve(u.value).then(o,c);f((s=s.apply(a,e)).next())});var Y=(a,e,s)=>(e=a[Z("asyncIterator")])?e.call(a):(a=a[Z("iterator")](),e={},s=(i,h)=>(h=a[i])&&(e[i]=o=>new Promise((c,f,u)=>(o=h.call(a,o),u=o.done,Promise.resolve(o.value).then(w=>c({value:w,done:u}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("urlpattern-polyfill"),rt=require("../notifier/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),ht=require("../function-MthRj-GJ.cjs"),F=require("../url-C3dWnJQg.cjs"),ot=require("../instantiate-
|
|
1
|
+
"use strict";var Z=(a,e)=>(e=Symbol[a])?e:Symbol.for("Symbol."+a);var K=(a,e,s)=>{if(!e.has(a))throw TypeError("Cannot "+s)};var t=(a,e,s)=>(K(a,e,"read from private field"),s?s.call(a):e.get(a)),r=(a,e,s)=>{if(e.has(a))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(a):e.set(a,s)},n=(a,e,s,i)=>(K(a,e,"write to private field"),i?i.call(a,s):e.set(a,s),s);var W=(a,e,s)=>(K(a,e,"access private method"),s);var M=(a,e,s)=>new Promise((i,h)=>{var o=u=>{try{f(s.next(u))}catch(w){h(w)}},c=u=>{try{f(s.throw(u))}catch(w){h(w)}},f=u=>u.done?i(u.value):Promise.resolve(u.value).then(o,c);f((s=s.apply(a,e)).next())});var Y=(a,e,s)=>(e=a[Z("asyncIterator")])?e.call(a):(a=a[Z("iterator")](),e={},s=(i,h)=>(h=a[i])&&(e[i]=o=>new Promise((c,f,u)=>(o=h.call(a,o),u=o.done,Promise.resolve(o.value).then(w=>c({value:w,done:u}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("urlpattern-polyfill"),rt=require("../notifier/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),ht=require("../function-MthRj-GJ.cjs"),F=require("../url-C3dWnJQg.cjs"),ot=require("../instantiate-C7JiqF_y.cjs"),$=require("../object-CCiXnER2.cjs");var R,O,A,p,d,v,S,L,b,E,x,et;class ct{constructor(e,s){r(this,x);r(this,R,void 0);r(this,O,void 0);r(this,A,void 0);r(this,p,void 0);r(this,d,void 0);r(this,v,void 0);r(this,S,void 0);r(this,L,null);r(this,b,[]);r(this,E,[]);n(this,R,e),n(this,O,s),n(this,A,new URLPattern({pathname:t(this,R)})),n(this,p,null),n(this,d,null),n(this,v,!1),n(this,S,null),tt.isBrowser&&n(this,L,new MutationObserver(i=>{i[0].addedNodes.forEach(o=>{t(this,p)?t(this,E).push(o):t(this,b).push(o)})}))}get pattern(){return t(this,R)}get urlPattern(){return t(this,A)}get isActive(){return t(this,v)}get element(){return t(this,d)}get nest(){return t(this,S)}testPathname(e){return this.urlPattern.test({pathname:e})}render(e,s){return M(this,null,function*(){var i,h;if(t(this,L).observe(document.head,{childList:!0,subtree:!0}),t(this,p))t(this,b).forEach(o=>{document.head.appendChild(o)});else{const o=yield t(this,O).call(this);if(n(this,E,[...t(this,b)]),typeof o.default=="function"&&(n(this,p,o.default),$.isESClass(o.default))){const c="e-"+((i=t(this,p))==null?void 0:i.name.toLowerCase());customElements.get(c)||customElements.define(c,o.default)}}if(yield W(this,x,et).call(this),t(this,p)){const o=t(this,A).exec({pathname:s}),c=(o==null?void 0:o.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),u={pathnameParams:c,searchParams:f};$.isESClass(t(this,p))?n(this,d,new(t(this,p))(u)):n(this,d,ot.instantiate(t(this,p),{attributes:u})),e.appendChild(t(this,d)),n(this,S,t(this,d).querySelector("[data-nest]")||((h=t(this,d).shadowRoot)==null?void 0:h.querySelector("[data-nest]"))||t(this,d).shadowRoot||t(this,d)),n(this,v,!0)}t(this,L).disconnect()})}close(){var e;t(this,L).disconnect(),(e=t(this,d))==null||e.remove(),n(this,v,!1),t(this,E).forEach(s=>document.head.removeChild(s)),n(this,E,[])}getAnchorElements(){var s;let e=[];return t(this,d)&&(e=[...t(this,d).querySelectorAll("a")]),(s=t(this,d))!=null&&s.shadowRoot&&(e=[...e,...t(this,d).shadowRoot.querySelectorAll("a")]),e}}R=new WeakMap,O=new WeakMap,A=new WeakMap,p=new WeakMap,d=new WeakMap,v=new WeakMap,S=new WeakMap,L=new WeakMap,b=new WeakMap,E=new WeakMap,x=new WeakSet,et=function(){return M(this,null,function*(){const e=t(this,b).filter(c=>c instanceof HTMLElement?c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK":!1);try{for(var s=Y(e),i,h,o;i=!(h=yield s.next()).done;i=!1){const c=h.value;yield new Promise(f=>{c.onload=()=>{f()}})}}catch(h){o=[h]}finally{try{i&&(h=s.return)&&(yield h.call(s))}finally{if(o)throw o[0]}}})};var k,m,P,U,q,j;class lt{constructor(e,s){r(this,k,void 0);r(this,m,void 0);r(this,P,void 0);r(this,U,void 0);r(this,q,void 0);r(this,j,e=>{e.preventDefault(),t(this,k).links.forEach(s=>{var i;t(this,P)===t(s,P)||(i=t(s,q))!=null&&i.includes(t(this,P))?t(s,m).classList.add("clicked"):t(s,m).classList.remove("clicked")}),t(this,k).navigate(t(this,P),t(this,U))});var o,c;n(this,k,e),n(this,m,s),n(this,P,t(this,m).getAttribute("href")||"/"),n(this,U,t(this,m).getAttribute("data-history-action")||"push"),t(this,m).addEventListener("click",t(this,j));const i=e.normalizePath(t(this,P)),h=e.normalizePath(location.pathname);n(this,q,(o=t(this,m).getAttribute("data-match-paths"))==null?void 0:o.split(",").map(f=>e.normalizePath(f.trim()).pathname)),t(this,m).hasAttribute("data-include")?h.pathname.includes(i.pathname)&&t(this,m).classList.add("current"):i.pathname===h.pathname||(c=t(this,q))!=null&&c.includes(h.pathname)?(t(this,m).classList.add("current"),t(this,m).classList.add("clicked")):t(this,m).classList.remove("clicked")}destroy(){t(this,m).removeEventListener("click",t(this,j)),t(this,m).classList.remove("current")}}k=new WeakMap,m=new WeakMap,P=new WeakMap,U=new WeakMap,q=new WeakMap,j=new WeakMap;globalThis.URLPattern=at.URLPattern;var C,N,g,z,T,y,H,B,I,_,st,D;class ut{constructor(e){r(this,_);r(this,C,null);r(this,N,null);r(this,g,[]);r(this,z,null);r(this,T,[]);r(this,y,void 0);r(this,H,null);r(this,B,new rt.Notifier);r(this,I,ht.debounce(()=>{const e=s=>s.split("/").length;n(this,g,t(this,g).sort((s,i)=>e(s.pattern)-e(i.pattern))),this.navigate(location.pathname)},0));r(this,D,e=>{e.state&&this.navigate(e.state,"none")});tt.isBrowser&&(e!=null&&e.base?n(this,N,F.normalizeBase(e.base)):n(this,N,"/"),n(this,C,(e==null?void 0:e.rootElement)||document.body),addEventListener("popstate",t(this,D)))}get currentPathname(){return t(this,H)}get candidatePathname(){return t(this,y)}get routes(){return t(this,g)}get links(){return t(this,T)}navigationEvent(e){return t(this,B).subscribe(e)}defineRoute(e,s){const i=new ct(e,s);t(this,g).push(i),t(this,I).call(this)}navigate(e,s="push"){return M(this,null,function*(){var Q,V;const i=this.normalizePath(e);let{pathname:h,hash:o,parameters:c,leaf:f}=i;if(t(this,y)===h||t(this,H)===h)return;n(this,y,h);const u=t(this,g).filter(l=>l.isActive),w=t(this,g).filter(l=>!u.includes(l)&&l.testPathname(f)),it=u.filter(l=>!l.testPathname(f)),G=u.filter(l=>l.testPathname(f));let J=!0;if(this.preprocessor)try{yield new Promise((l,nt)=>{var X;(X=this.preprocessor)==null||X.call(this,{path:i,resolve:l,reject:nt})})}catch(l){l?console.error(l):console.log("Route change canceled"),J=!1}if(J&&t(this,y)===h){n(this,z,G[G.length-1]),it.forEach(l=>{l.close()}),n(this,H,h),F.changeHistory(s,h,c,o);try{for(var ft=Y(w),pt,gt,Pt;pt=!(gt=yield ft.next()).done;pt=!1){const l=gt.value;yield l.render(((Q=t(this,z))==null?void 0:Q.nest)||t(this,C),h),n(this,z,l)}}catch(gt){Pt=[gt]}finally{try{pt&&(gt=ft.return)&&(yield gt.call(ft))}finally{if(Pt)throw Pt[0]}}W(this,_,st).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:h}),t(this,B).notify({pathname:h})}})}normalizePath(e){return F.splitPath(e,t(this,N))}}C=new WeakMap,N=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,y=new WeakMap,H=new WeakMap,B=new WeakMap,I=new WeakMap,_=new WeakSet,st=function(){const e=t(this,g).filter(i=>i.isActive),s=Array.from(new Set([...t(this,C).querySelectorAll("a"),...e.map(i=>i.getAnchorElements()).flat()].filter(i=>{var h;return(h=i.getAttribute("href"))==null?void 0:h.startsWith("/")})));t(this,T).forEach(i=>{i.destroy()}),n(this,T,s.map(i=>new lt(this,i)))},D=new WeakMap;exports.Router=ut;
|
|
@@ -31,7 +31,7 @@ import { Notifier as nt } from "../notifier/index.js";
|
|
|
31
31
|
import { i as _ } from "../browser-0zX67oeU.js";
|
|
32
32
|
import { d as ht } from "../function-C10DGppn.js";
|
|
33
33
|
import { n as rt, c as ot, s as ct } from "../url-DMNfW7uN.js";
|
|
34
|
-
import { i as lt } from "../instantiate-
|
|
34
|
+
import { i as lt } from "../instantiate-DHwz5QVl.js";
|
|
35
35
|
import { i as Z } from "../object-D6MVWB4l.js";
|
|
36
36
|
var y, U, A, p, m, L, k, v, E, R, M, tt;
|
|
37
37
|
class ut {
|
package/package.json
CHANGED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
var _ = Object.defineProperty, F = Object.defineProperties;
|
|
2
|
-
var M = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var A = Object.getOwnPropertySymbols;
|
|
4
|
-
var R = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var L = (n, e, l) => e in n ? _(n, e, { enumerable: !0, configurable: !0, writable: !0, value: l }) : n[e] = l, r = (n, e) => {
|
|
6
|
-
for (var l in e || (e = {}))
|
|
7
|
-
R.call(e, l) && L(n, l, e[l]);
|
|
8
|
-
if (A)
|
|
9
|
-
for (var l of A(e))
|
|
10
|
-
D.call(e, l) && L(n, l, e[l]);
|
|
11
|
-
return n;
|
|
12
|
-
}, p = (n, e) => F(n, M(e));
|
|
13
|
-
var H = (n, e, l) => {
|
|
14
|
-
if (!e.has(n))
|
|
15
|
-
throw TypeError("Cannot " + l);
|
|
16
|
-
};
|
|
17
|
-
var o = (n, e, l) => (H(n, e, "read from private field"), l ? l.call(n) : e.get(n)), i = (n, e, l) => {
|
|
18
|
-
if (e.has(n))
|
|
19
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
20
|
-
e instanceof WeakSet ? e.add(n) : e.set(n, l);
|
|
21
|
-
};
|
|
22
|
-
import { E as k } from "./ElementConstructor-Be8H1POO.js";
|
|
23
|
-
import { i as I } from "./object-D6MVWB4l.js";
|
|
24
|
-
import { c as K } from "./string-f0Dnk0L1.js";
|
|
25
|
-
import { c as u, n as w, a as y } from "./globals-DMjysUXI.js";
|
|
26
|
-
import "./Store-Qr3SNOSf.js";
|
|
27
|
-
import "./ticker/index.js";
|
|
28
|
-
var v, t, d, m, f;
|
|
29
|
-
class $ extends HTMLElement {
|
|
30
|
-
constructor(l) {
|
|
31
|
-
var h;
|
|
32
|
-
super();
|
|
33
|
-
i(this, v, /* @__PURE__ */ new Set());
|
|
34
|
-
i(this, t, /* @__PURE__ */ new Set());
|
|
35
|
-
i(this, d, /* @__PURE__ */ new Map());
|
|
36
|
-
i(this, m, () => {
|
|
37
|
-
y.value.unshift(o(this, d));
|
|
38
|
-
});
|
|
39
|
-
i(this, f, () => {
|
|
40
|
-
y.value = y.value.filter(
|
|
41
|
-
(l) => l !== o(this, d)
|
|
42
|
-
);
|
|
43
|
-
});
|
|
44
|
-
const s = u.value;
|
|
45
|
-
u.value = this, o(this, m).call(this);
|
|
46
|
-
const C = l == null ? void 0 : l.tag(p(r({}, l.attributes), {
|
|
47
|
-
this: this
|
|
48
|
-
})), E = (h = w.value) != null && h.lightChildren ? "lightChildren" : "children";
|
|
49
|
-
new k(this, p(r({}, w.value), {
|
|
50
|
-
[E]: C
|
|
51
|
-
})), u.value = s, w.value = null, o(this, f).call(this);
|
|
52
|
-
}
|
|
53
|
-
addConnectCallback(l) {
|
|
54
|
-
o(this, v).add(l);
|
|
55
|
-
}
|
|
56
|
-
addDisconnectCallback(l) {
|
|
57
|
-
o(this, t).add(l);
|
|
58
|
-
}
|
|
59
|
-
createContext(l, s) {
|
|
60
|
-
o(this, d).set(l, s);
|
|
61
|
-
}
|
|
62
|
-
connectedCallback() {
|
|
63
|
-
u.value = this, o(this, v).forEach((l) => {
|
|
64
|
-
const s = l(this);
|
|
65
|
-
s && o(this, t).add(s);
|
|
66
|
-
}), u.value = null, this.addEventListener("beforeChildrenChange", o(this, m)), this.addEventListener("afterChildrenChange", o(this, f));
|
|
67
|
-
}
|
|
68
|
-
disconnectedCallback() {
|
|
69
|
-
o(this, t).forEach((l) => {
|
|
70
|
-
l(this);
|
|
71
|
-
}), this.removeEventListener("beforeChildrenChange", o(this, m)), this.removeEventListener("afterChildrenChange", o(this, f));
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
v = new WeakMap(), t = new WeakMap(), d = new WeakMap(), m = new WeakMap(), f = new WeakMap();
|
|
75
|
-
function j(n, e, ...l) {
|
|
76
|
-
var h;
|
|
77
|
-
l = l.flat().filter((c) => c != null);
|
|
78
|
-
const s = [], C = [];
|
|
79
|
-
e = e || {}, s.push(...l.reverse());
|
|
80
|
-
const E = n === "instance";
|
|
81
|
-
if (E && e.from && (n = e.from, e == null || delete e.from), typeof n == "function")
|
|
82
|
-
if (E) {
|
|
83
|
-
let c = null;
|
|
84
|
-
return I(n) ? c = new n() : c = n(), delete e.children, () => new k(c, e).node;
|
|
85
|
-
} else {
|
|
86
|
-
if (e.children = s.reverse(), n === g)
|
|
87
|
-
return g(e.children);
|
|
88
|
-
const c = {
|
|
89
|
-
noCustomElement: n.noCustomElement,
|
|
90
|
-
onlyRegister: e.__register
|
|
91
|
-
};
|
|
92
|
-
if (e == null || delete e.__register, c.noCustomElement) {
|
|
93
|
-
const T = n(r({}, e));
|
|
94
|
-
return () => T;
|
|
95
|
-
}
|
|
96
|
-
const x = `e-${K(n.name)}`;
|
|
97
|
-
let a = customElements.get(x);
|
|
98
|
-
return a || (a = (h = class extends $ {
|
|
99
|
-
constructor(S) {
|
|
100
|
-
super(
|
|
101
|
-
c.onlyRegister ? {
|
|
102
|
-
tag: n,
|
|
103
|
-
attributes: e
|
|
104
|
-
} : S
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
}, h.formAssociated = n.formAssociated, h), customElements.define(x, a)), () => c.onlyRegister ? a : new a({ tag: n, attributes: e });
|
|
108
|
-
}
|
|
109
|
-
for (; s.length; ) {
|
|
110
|
-
const c = s.pop();
|
|
111
|
-
Array.isArray(c) ? s.push(...c) : c != null && C.push(c);
|
|
112
|
-
}
|
|
113
|
-
if (n === "component") {
|
|
114
|
-
const c = g(C);
|
|
115
|
-
return w.value = e, c.node;
|
|
116
|
-
} else {
|
|
117
|
-
const c = e != null && e.lightChildren ? "lightChildren" : "children";
|
|
118
|
-
return e == null || delete e.children, n ? new k(n, p(r({}, e), {
|
|
119
|
-
[c]: C
|
|
120
|
-
})) : null;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
function g(n) {
|
|
124
|
-
return new k(document.createDocumentFragment(), {
|
|
125
|
-
children: n
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
function P(n, e) {
|
|
129
|
-
const l = e == null ? void 0 : e.children, s = e == null ? void 0 : e.attributes;
|
|
130
|
-
return (/* @__PURE__ */ j(n, r({}, s), l))();
|
|
131
|
-
}
|
|
132
|
-
export {
|
|
133
|
-
g as F,
|
|
134
|
-
j as h,
|
|
135
|
-
P as i
|
|
136
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var L=Object.defineProperty,T=Object.defineProperties;var _=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var y=(n,e,l)=>e in n?L(n,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[e]=l,i=(n,e)=>{for(var l in e||(e={}))F.call(e,l)&&y(n,l,e[l]);if(g)for(var l of g(e))M.call(e,l)&&y(n,l,e[l]);return n},x=(n,e)=>T(n,_(e));var R=(n,e,l)=>{if(!e.has(n))throw TypeError("Cannot "+l)};var c=(n,e,l)=>(R(n,e,"read from private field"),l?l.call(n):e.get(n)),h=(n,e,l)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,l)};const p=require("./ElementConstructor-khLPmQ9V.cjs"),D=require("./object-CCiXnER2.cjs"),j=require("./string-DhgS_iFl.cjs"),r=require("./globals-bYKki-b9.cjs");require("./Store-Cr3VaD9G.cjs");require("./ticker/index.cjs");var a,d,m,C,u;class H extends HTMLElement{constructor(l){var s;super();h(this,a,new Set);h(this,d,new Set);h(this,m,new Map);h(this,C,()=>{r.contextStack.value.unshift(c(this,m))});h(this,u,()=>{r.contextStack.value=r.contextStack.value.filter(l=>l!==c(this,m))});const o=r.currentComponentElement.value;r.currentComponentElement.value=this,c(this,C).call(this);const f=l==null?void 0:l.tag(x(i({},l.attributes),{this:this})),v=(s=r.nextComponentAttributes.value)!=null&&s.lightChildren?"lightChildren":"children";new p.ElementConstructor(this,x(i({},r.nextComponentAttributes.value),{[v]:f})),r.currentComponentElement.value=o,r.nextComponentAttributes.value=null,c(this,u).call(this)}addConnectCallback(l){c(this,a).add(l)}addDisconnectCallback(l){c(this,d).add(l)}createContext(l,o){c(this,m).set(l,o)}connectedCallback(){r.currentComponentElement.value=this,c(this,a).forEach(l=>{const o=l(this);o&&c(this,d).add(o)}),r.currentComponentElement.value=null,this.addEventListener("beforeChildrenChange",c(this,C)),this.addEventListener("afterChildrenChange",c(this,u))}disconnectedCallback(){c(this,d).forEach(l=>{l(this)}),this.removeEventListener("beforeChildrenChange",c(this,C)),this.removeEventListener("afterChildrenChange",c(this,u))}}a=new WeakMap,d=new WeakMap,m=new WeakMap,C=new WeakMap,u=new WeakMap;function A(n,e,...l){var s;l=l.flat().filter(t=>t!=null);const o=[],f=[];e=e||{},o.push(...l.reverse());const v=n==="instance";if(v&&e.from&&(n=e.from,e==null||delete e.from),typeof n=="function")if(v){let t=null;return D.isESClass(n)?t=new n:t=n(),delete e.children,()=>new p.ElementConstructor(t,e).node}else{if(e.children=o.reverse(),n===k)return k(e.children);const t={noCustomElement:n.noCustomElement,onlyRegister:e.__register};if(e==null||delete e.__register,t.noCustomElement){const q=n(i({},e));return()=>q}const w=`e-${j.camelToKebab(n.name)}`;let E=customElements.get(w);return E||(E=(s=class extends H{constructor(S){super(t.onlyRegister?{tag:n,attributes:e}:S)}},s.formAssociated=n.formAssociated,s),customElements.define(w,E)),()=>t.onlyRegister?E:new E({tag:n,attributes:e})}for(;o.length;){const t=o.pop();Array.isArray(t)?o.push(...t):t!=null&&f.push(t)}if(n==="component"){const t=k(f);return r.nextComponentAttributes.value=e,t.node}else{const t=e!=null&&e.lightChildren?"lightChildren":"children";return e==null||delete e.children,n?new p.ElementConstructor(n,x(i({},e),{[t]:f})):null}}function k(n){return new p.ElementConstructor(document.createDocumentFragment(),{children:n})}function I(n,e){const l=e==null?void 0:e.children,o=e==null?void 0:e.attributes;return A(n,i({},o),l)()}exports.Fragment=k;exports.h=A;exports.instantiate=I;
|