aptechka 0.83.0 → 0.83.1
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/lib/Composed-C-TV9te3.cjs +1 -0
- package/lib/Composed-DyAWjEXE.js +121 -0
- package/lib/{LocalLinks-DRAQ-fxE.js → LocalLinks-DFZFpbjs.js} +1 -1
- package/lib/jsx/h.d.ts +15 -0
- package/lib/jsx/hydrate.d.ts +1 -0
- package/lib/jsx/index.cjs +1 -1
- package/lib/jsx/index.d.ts +4 -1
- package/lib/jsx/index.js +312 -87
- package/lib/jsx/integrations/astro/client.cjs +1 -0
- package/lib/jsx/integrations/astro/client.d.ts +2 -0
- package/lib/jsx/integrations/astro/client.js +50 -0
- package/lib/jsx/integrations/astro/index.cjs +1 -0
- package/lib/jsx/integrations/astro/index.d.ts +2 -0
- package/lib/jsx/integrations/astro/index.js +54 -0
- package/lib/jsx/integrations/astro/server.cjs +1 -0
- package/lib/jsx/integrations/astro/server.d.ts +3 -0
- package/lib/jsx/integrations/astro/server.js +35 -0
- package/lib/jsx/plugins/vite.d.ts +21 -0
- package/lib/jsx/render.d.ts +1 -1
- package/lib/jsx/type.d.ts +190 -221
- package/lib/jsx/utils/children/createElement.d.ts +1 -0
- package/lib/jsx/utils/children/hydrateTextNode.d.ts +1 -0
- package/lib/local-links/index.js +1 -1
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +71 -71
- package/lib/{morph-D_ybmXWR.js → morph-BQErz7qP.js} +8 -8
- package/lib/render-DQs7rIoN.cjs +1 -0
- package/lib/render-D_0FCWEu.js +18 -0
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +2 -2
- package/lib/spa/index.js +2 -2
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +6 -7
- package/lib/utils/index.js +1 -1
- package/lib/utils/polyfills.d.ts +1 -1
- package/lib/vite-C-i3hVDL.js +75 -0
- package/lib/vite-DzanPumM.cjs +44 -0
- package/package.json +29 -4
- package/lib/Composed-C-mnUGX6.js +0 -70
- package/lib/Composed-RFcm2x5c.cjs +0 -1
- package/lib/DerivedArray-DdCR-Oy7.cjs +0 -1
- package/lib/DerivedArray-opbeygTL.js +0 -59
- package/lib/jsx/plugins/hmr.d.ts +0 -13
- package/lib/render-1u700s93.js +0 -212
- package/lib/render-BIOfUddT.cjs +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";function r(t){const n=t!=null&&t.__dev?"@packages":"aptechka";return{name:"jsx-hmr-plugin",apply:"serve",transform(o,e){if((e.endsWith(".jsx")||e.endsWith(".tsx"))&&!e.endsWith("render.tsx")){let l=o;return l+=`
|
|
2
|
+
|
|
3
|
+
if (import.meta.hot) {
|
|
4
|
+
import.meta.hot.accept(async (Module) => {
|
|
5
|
+
const { render } = await import('${n}/jsx')
|
|
6
|
+
const { camelToKebab } = await import('${n}/utils')
|
|
7
|
+
for (const key in Module) {
|
|
8
|
+
if (Object.prototype.hasOwnProperty.call(Module, key)) {
|
|
9
|
+
if (typeof Module[key] === 'function') {
|
|
10
|
+
const tag = \`e-\${camelToKebab(Module[key].name)}\`
|
|
11
|
+
const foundedElements = [...document.querySelectorAll(tag)]
|
|
12
|
+
|
|
13
|
+
foundedElements.forEach((el) => {
|
|
14
|
+
const nestElements = el.querySelectorAll('[data-nest]')
|
|
15
|
+
|
|
16
|
+
const container = document.createElement('div')
|
|
17
|
+
|
|
18
|
+
render(container, Module[key], el.__props__)
|
|
19
|
+
const componentElement = container.firstElementChild
|
|
20
|
+
|
|
21
|
+
if (componentElement) {
|
|
22
|
+
el.dispatchEvent(new CustomEvent('__hmrInstanceReplace', {
|
|
23
|
+
'detail': {
|
|
24
|
+
element: componentElement
|
|
25
|
+
}
|
|
26
|
+
}))
|
|
27
|
+
|
|
28
|
+
el.replaceWith(componentElement)
|
|
29
|
+
|
|
30
|
+
componentElement
|
|
31
|
+
.querySelectorAll('[data-nest]')
|
|
32
|
+
.forEach((el, i) => {
|
|
33
|
+
if (nestElements[i]) {
|
|
34
|
+
el.replaceWith(nestElements[i])
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
`,{code:l,map:null}}return null},config(o,e){return{esbuild:{jsxFactory:"h",jsxFragment:"Fragment",jsxInject:`import { h, Fragment } from '${n}/jsx'`},define:{__JSX_HMR_DEV__:e.command==="serve"}}}}}exports.aptechkaVite=r;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aptechka",
|
|
3
|
-
"version": "0.83.
|
|
3
|
+
"version": "0.83.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/denisavitski/aptechka.git"
|
|
@@ -128,6 +128,21 @@
|
|
|
128
128
|
"require": "./lib/jsx/index.cjs",
|
|
129
129
|
"default": "./lib/jsx/index.js"
|
|
130
130
|
},
|
|
131
|
+
"./jsx/integrations/astro": {
|
|
132
|
+
"types": "./lib/jsx/integrations/astro/index.d.ts",
|
|
133
|
+
"require": "./lib/jsx/integrations/astro/index.cjs",
|
|
134
|
+
"default": "./lib/jsx/integrations/astro/index.js"
|
|
135
|
+
},
|
|
136
|
+
"./jsx/integrations/astro/client": {
|
|
137
|
+
"types": "./lib/jsx/integrations/astro/client.d.ts",
|
|
138
|
+
"require": "./lib/jsx/integrations/astro/client.cjs",
|
|
139
|
+
"default": "./lib/jsx/integrations/astro/client.js"
|
|
140
|
+
},
|
|
141
|
+
"./jsx/integrations/astro/server": {
|
|
142
|
+
"types": "./lib/jsx/integrations/astro/server.d.ts",
|
|
143
|
+
"require": "./lib/jsx/integrations/astro/server.cjs",
|
|
144
|
+
"default": "./lib/jsx/integrations/astro/server.js"
|
|
145
|
+
},
|
|
131
146
|
"./ladder": {
|
|
132
147
|
"types": "./lib/ladder/index.d.ts",
|
|
133
148
|
"require": "./lib/ladder/index.cjs",
|
|
@@ -355,6 +370,15 @@
|
|
|
355
370
|
"jsx": [
|
|
356
371
|
"lib/jsx/index.d.ts"
|
|
357
372
|
],
|
|
373
|
+
"jsx/integrations/astro": [
|
|
374
|
+
"lib/jsx/integrations/astro/index.d.ts"
|
|
375
|
+
],
|
|
376
|
+
"jsx/integrations/astro/client": [
|
|
377
|
+
"lib/jsx/integrations/astro/client.d.ts"
|
|
378
|
+
],
|
|
379
|
+
"jsx/integrations/astro/server": [
|
|
380
|
+
"lib/jsx/integrations/astro/server.d.ts"
|
|
381
|
+
],
|
|
358
382
|
"ladder": [
|
|
359
383
|
"lib/ladder/index.d.ts"
|
|
360
384
|
],
|
|
@@ -459,12 +483,13 @@
|
|
|
459
483
|
"devDependencies": {
|
|
460
484
|
"@types/node": "^24.3.0",
|
|
461
485
|
"@types/three": "^0.179.0",
|
|
486
|
+
"astro": "^5.13.5",
|
|
487
|
+
"csstype": "^3.1.3",
|
|
488
|
+
"prettier-plugin-organize-imports": "^4.2.0",
|
|
462
489
|
"tsx": "^4.20.5",
|
|
463
490
|
"vite": "^7.1.3",
|
|
464
491
|
"vite-plugin-dts": "^4.5.4",
|
|
465
|
-
"vite-plugin-htmc": "0.1.17"
|
|
466
|
-
"prettier-plugin-organize-imports": "^4.2.0",
|
|
467
|
-
"csstype": "^3.1.3"
|
|
492
|
+
"vite-plugin-htmc": "0.1.17"
|
|
468
493
|
},
|
|
469
494
|
"dependencies": {
|
|
470
495
|
"construct-style-sheets-polyfill": "^3.1.0",
|
package/lib/Composed-C-mnUGX6.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
var m = (e) => {
|
|
2
|
-
throw TypeError(e);
|
|
3
|
-
};
|
|
4
|
-
var p = (e, r, s) => r.has(e) || m("Cannot " + s);
|
|
5
|
-
var t = (e, r, s) => (p(e, r, "read from private field"), s ? s.call(e) : r.get(e)), h = (e, r, s) => r.has(e) ? m("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, s), o = (e, r, s, c) => (p(e, r, "write to private field"), c ? c.call(e, s) : r.set(e, s), s);
|
|
6
|
-
import { S as d } from "./Store-ZThXYBQd.js";
|
|
7
|
-
import { d as g } from "./function-C10DGppn.js";
|
|
8
|
-
import "construct-style-sheets-polyfill";
|
|
9
|
-
import "./index-e9eDuagL.js";
|
|
10
|
-
var a;
|
|
11
|
-
class R extends d {
|
|
12
|
-
constructor(s, c, u) {
|
|
13
|
-
super(null, u);
|
|
14
|
-
h(this, a);
|
|
15
|
-
o(this, a, s.subscribe((b) => {
|
|
16
|
-
this.current = c(b.current);
|
|
17
|
-
}));
|
|
18
|
-
}
|
|
19
|
-
close() {
|
|
20
|
-
super.close(), t(this, a).call(this);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
a = new WeakMap();
|
|
24
|
-
var l, i, n;
|
|
25
|
-
class S extends d {
|
|
26
|
-
constructor(s, c, u) {
|
|
27
|
-
super(s, u);
|
|
28
|
-
h(this, l);
|
|
29
|
-
h(this, i);
|
|
30
|
-
h(this, n, 0);
|
|
31
|
-
o(this, i, new d(!1)), o(this, l, c), u != null && u.manualControl || this.refetch();
|
|
32
|
-
}
|
|
33
|
-
get isPending() {
|
|
34
|
-
return t(this, i);
|
|
35
|
-
}
|
|
36
|
-
refetch() {
|
|
37
|
-
t(this, i).current = !0, o(this, n, t(this, n) + 1);
|
|
38
|
-
const s = t(this, n);
|
|
39
|
-
t(this, l).call(this).then((c) => {
|
|
40
|
-
s === t(this, n) && (t(this, i).current = !1, this.current = c);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
l = new WeakMap(), i = new WeakMap(), n = new WeakMap();
|
|
45
|
-
var f;
|
|
46
|
-
class v extends d {
|
|
47
|
-
constructor(s, c, u) {
|
|
48
|
-
super(null, u);
|
|
49
|
-
h(this, f, []);
|
|
50
|
-
const b = g(() => {
|
|
51
|
-
this.current = c();
|
|
52
|
-
}, 0);
|
|
53
|
-
s.forEach((x) => {
|
|
54
|
-
t(this, f).push(
|
|
55
|
-
x.subscribe(() => {
|
|
56
|
-
b();
|
|
57
|
-
})
|
|
58
|
-
);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
close() {
|
|
62
|
-
super.close(), t(this, f).forEach((s) => s());
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
f = new WeakMap();
|
|
66
|
-
export {
|
|
67
|
-
v as C,
|
|
68
|
-
R as D,
|
|
69
|
-
S as R
|
|
70
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var x=s=>{throw TypeError(s)};var S=(s,r,e)=>r.has(s)||x("Cannot "+e);var t=(s,r,e)=>(S(s,r,"read from private field"),e?e.call(s):r.get(s)),n=(s,r,e)=>r.has(s)?x("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,e),o=(s,r,e,c)=>(S(s,r,"write to private field"),c?c.call(s,e):r.set(s,e),e);const a=require("./Store-Blf4msDz.cjs"),q=require("./function-MthRj-GJ.cjs");require("construct-style-sheets-polyfill");require("./index-OE2INULi.cjs");var l;class g extends a.Store{constructor(e,c,u){super(null,u);n(this,l);o(this,l,e.subscribe(b=>{this.current=c(b.current)}))}close(){super.close(),t(this,l).call(this)}}l=new WeakMap;var d,i,h;class m extends a.Store{constructor(e,c,u){super(e,u);n(this,d);n(this,i);n(this,h,0);o(this,i,new a.Store(!1)),o(this,d,c),u!=null&&u.manualControl||this.refetch()}get isPending(){return t(this,i)}refetch(){t(this,i).current=!0,o(this,h,t(this,h)+1);const e=t(this,h);t(this,d).call(this).then(c=>{e===t(this,h)&&(t(this,i).current=!1,this.current=c)})}}d=new WeakMap,i=new WeakMap,h=new WeakMap;var f;class C extends a.Store{constructor(e,c,u){super(null,u);n(this,f,[]);const b=q.debounce(()=>{this.current=c()},0);e.forEach(p=>{t(this,f).push(p.subscribe(()=>{b()}))})}close(){super.close(),t(this,f).forEach(e=>e())}}f=new WeakMap;exports.Composed=C;exports.Derived=g;exports.Resource=m;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var g=e=>{throw TypeError(e)};var D=(e,r,s)=>r.has(e)||g("Cannot "+s);var d=(e,r,s)=>(D(e,r,"read from private field"),s?s.call(e):r.get(e)),h=(e,r,s)=>r.has(e)?g("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,s),f=(e,r,s,i)=>(D(e,r,"write to private field"),i?i.call(e,s):r.set(e,s),s);const j=require("./Store-Blf4msDz.cjs");var v,b;class p extends j.Store{constructor(s,i,t){super(null,t);h(this,v);h(this,b);f(this,b,!!(t!=null&&t.revalidateAll)),f(this,v,s.subscribe(l=>{this.current=l.current.map((u,a,o)=>{var c,n;return!d(this,b)&&((c=this.current)!=null&&c.length)&&((n=l.previous)!=null&&n.length)&&l.previous[a]===u?this.current[a]:i(u,a,o)})}))}close(){super.close(),d(this,v).call(this)}}v=new WeakMap,b=new WeakMap;var k,A;class x extends j.Store{constructor(s,i,t){super(null,t);h(this,k);h(this,A);f(this,A,!!(t!=null&&t.revalidateAll)),f(this,k,s.subscribe(l=>{this.current=l.current.map((u,a,o)=>{var n;if(!d(this,A)){const S=(n=l.previous)==null?void 0:n.find(y=>y.key===u.key&&JSON.stringify(y)===JSON.stringify(u));if(S){const y=this.current.find(_=>typeof _=="object"&&_&&"__key"in _&&_.__key===S.key);if(y)return y}}const c=i(u,a,o);return c&&typeof c=="object"&&(c.__key=u.key),c})}))}close(){super.close(),d(this,k).call(this)}}k=new WeakMap,A=new WeakMap;exports.DerivedArray=p;exports.DerivedKeyedArray=x;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
var p = (e) => {
|
|
2
|
-
throw TypeError(e);
|
|
3
|
-
};
|
|
4
|
-
var S = (e, r, s) => r.has(e) || p("Cannot " + s);
|
|
5
|
-
var f = (e, r, s) => (S(e, r, "read from private field"), s ? s.call(e) : r.get(e)), y = (e, r, s) => r.has(e) ? p("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, s), d = (e, r, s, c) => (S(e, r, "write to private field"), c ? c.call(e, s) : r.set(e, s), s);
|
|
6
|
-
import { S as m } from "./Store-ZThXYBQd.js";
|
|
7
|
-
var b, v;
|
|
8
|
-
class j extends m {
|
|
9
|
-
constructor(s, c, t) {
|
|
10
|
-
super(null, t);
|
|
11
|
-
y(this, b);
|
|
12
|
-
y(this, v);
|
|
13
|
-
d(this, v, !!(t != null && t.revalidateAll)), d(this, b, s.subscribe((i) => {
|
|
14
|
-
this.current = i.current.map((u, a, o) => {
|
|
15
|
-
var l, n;
|
|
16
|
-
return !f(this, v) && ((l = this.current) != null && l.length) && ((n = i.previous) != null && n.length) && i.previous[a] === u ? this.current[a] : c(u, a, o);
|
|
17
|
-
});
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
close() {
|
|
21
|
-
super.close(), f(this, b).call(this);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
b = new WeakMap(), v = new WeakMap();
|
|
25
|
-
var k, A;
|
|
26
|
-
class I extends m {
|
|
27
|
-
constructor(s, c, t) {
|
|
28
|
-
super(null, t);
|
|
29
|
-
y(this, k);
|
|
30
|
-
y(this, A);
|
|
31
|
-
d(this, A, !!(t != null && t.revalidateAll)), d(this, k, s.subscribe((i) => {
|
|
32
|
-
this.current = i.current.map((u, a, o) => {
|
|
33
|
-
var n;
|
|
34
|
-
if (!f(this, A)) {
|
|
35
|
-
const g = (n = i.previous) == null ? void 0 : n.find(
|
|
36
|
-
(h) => h.key === u.key && JSON.stringify(h) === JSON.stringify(u)
|
|
37
|
-
);
|
|
38
|
-
if (g) {
|
|
39
|
-
const h = this.current.find(
|
|
40
|
-
(_) => typeof _ == "object" && _ && "__key" in _ && _.__key === g.key
|
|
41
|
-
);
|
|
42
|
-
if (h)
|
|
43
|
-
return h;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const l = c(u, a, o);
|
|
47
|
-
return l && typeof l == "object" && (l.__key = u.key), l;
|
|
48
|
-
});
|
|
49
|
-
}));
|
|
50
|
-
}
|
|
51
|
-
close() {
|
|
52
|
-
super.close(), f(this, k).call(this);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
k = new WeakMap(), A = new WeakMap();
|
|
56
|
-
export {
|
|
57
|
-
j as D,
|
|
58
|
-
I as a
|
|
59
|
-
};
|
package/lib/jsx/plugins/hmr.d.ts
DELETED
package/lib/render-1u700s93.js
DELETED
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
var O = Object.defineProperty, R = Object.defineProperties;
|
|
2
|
-
var q = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var w = Object.getOwnPropertySymbols;
|
|
4
|
-
var B = Object.prototype.hasOwnProperty, K = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var N = (r) => {
|
|
6
|
-
throw TypeError(r);
|
|
7
|
-
};
|
|
8
|
-
var L = (r, s, t) => s in r ? O(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t, m = (r, s) => {
|
|
9
|
-
for (var t in s || (s = {}))
|
|
10
|
-
B.call(s, t) && L(r, t, s[t]);
|
|
11
|
-
if (w)
|
|
12
|
-
for (var t of w(s))
|
|
13
|
-
K.call(s, t) && L(r, t, s[t]);
|
|
14
|
-
return r;
|
|
15
|
-
}, D = (r, s) => R(r, q(s));
|
|
16
|
-
var F = (r, s, t) => s.has(r) || N("Cannot " + t);
|
|
17
|
-
var d = (r, s, t) => (F(r, s, "read from private field"), t ? t.call(r) : s.get(r)), g = (r, s, t) => s.has(r) ? N("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(r) : s.set(r, t), C = (r, s, t, e) => (F(r, s, "write to private field"), e ? e.call(r, t) : s.set(r, t), t);
|
|
18
|
-
import { S as l } from "./Store-ZThXYBQd.js";
|
|
19
|
-
import { c as M } from "./string-BlMQbe8b.js";
|
|
20
|
-
import { d as J, p as X } from "./morph-D_ybmXWR.js";
|
|
21
|
-
import "construct-style-sheets-polyfill";
|
|
22
|
-
import "./index-e9eDuagL.js";
|
|
23
|
-
import { connector as $ } from "./connector/index.js";
|
|
24
|
-
import { a as z } from "./DerivedArray-opbeygTL.js";
|
|
25
|
-
const Q = { current: null };
|
|
26
|
-
var b, u;
|
|
27
|
-
class U extends HTMLElement {
|
|
28
|
-
constructor() {
|
|
29
|
-
super();
|
|
30
|
-
g(this, b, []);
|
|
31
|
-
g(this, u, []);
|
|
32
|
-
Q.current = this;
|
|
33
|
-
}
|
|
34
|
-
addConnectCallback(t) {
|
|
35
|
-
d(this, b).push(t);
|
|
36
|
-
}
|
|
37
|
-
addDisconnectCallback(t) {
|
|
38
|
-
d(this, u).push(t);
|
|
39
|
-
}
|
|
40
|
-
connectedCallback() {
|
|
41
|
-
d(this, b).forEach((t) => {
|
|
42
|
-
const e = t(this);
|
|
43
|
-
e && d(this, u).push(e);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
disconnectedCallback() {
|
|
47
|
-
d(this, u).forEach((t) => {
|
|
48
|
-
t(this);
|
|
49
|
-
}), C(this, b, []), C(this, u, []);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
b = new WeakMap(), u = new WeakMap();
|
|
53
|
-
function E(r, s, t) {
|
|
54
|
-
const e = s.subscribe((c) => {
|
|
55
|
-
t(c);
|
|
56
|
-
});
|
|
57
|
-
$.subscribe(r, {
|
|
58
|
-
disconnectCallback: () => {
|
|
59
|
-
e();
|
|
60
|
-
},
|
|
61
|
-
maxWaitSec: 20,
|
|
62
|
-
unsubscribeAfterDisconnect: !0
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
function W(r, s) {
|
|
66
|
-
s && (s instanceof l ? E(r, s, (t) => {
|
|
67
|
-
t.previous && r.classList.remove(t.previous.toString()), t.current && r.classList.add(t.current.toString());
|
|
68
|
-
}) : typeof s == "object" && !Array.isArray(s) ? Object.entries(s).forEach(([t, e]) => {
|
|
69
|
-
e instanceof l ? E(r, e, (c) => {
|
|
70
|
-
r.classList.toggle(t, !!c.current);
|
|
71
|
-
}) : e && r.classList.add(t);
|
|
72
|
-
}) : Array.isArray(s) ? s.forEach((t) => {
|
|
73
|
-
typeof t == "string" ? r.classList.add(t) : W(r, t);
|
|
74
|
-
}) : s.toString().split(" ").map((t) => r.classList.add(t.trim())));
|
|
75
|
-
}
|
|
76
|
-
function V(r, s) {
|
|
77
|
-
s && (typeof s == "object" ? Object.entries(s).forEach(([t, e]) => {
|
|
78
|
-
e instanceof l ? E(r, e, (c) => {
|
|
79
|
-
var o;
|
|
80
|
-
r.style[t] = (o = c.current) == null ? void 0 : o.toString();
|
|
81
|
-
}) : (typeof e == "number" || typeof e == "string" || typeof e == "boolean") && (r.style[t] = e.toString());
|
|
82
|
-
}) : typeof s == "string" && (r.style = s));
|
|
83
|
-
}
|
|
84
|
-
function A(r, s, t) {
|
|
85
|
-
s === "ref" && t ? Array.isArray(t) ? t.forEach((e) => {
|
|
86
|
-
typeof e == "object" && "value" in e && (e.value = r);
|
|
87
|
-
}) : typeof t == "object" && "value" in t && (t.value = r) : s === "className" || s === "class" ? W(r, t) : s === "style" ? V(r, t) : typeof t == "number" ? s === "tabIndex" ? r.setAttribute("tabindex", t.toString()) : A(r, s, t.toString()) : typeof t == "string" ? s === "htmlFor" ? r.setAttribute("for", t) : r.setAttribute(s, t) : typeof t == "boolean" ? t ? r.setAttribute(s, "") : r.removeAttribute(s) : t instanceof l && E(r, t, (e) => {
|
|
88
|
-
s in r ? r[s] = e.current : A(r, s, e.current);
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
function Y(r, s) {
|
|
92
|
-
for (const [t, e] of Object.entries(s != null ? s : {}))
|
|
93
|
-
typeof e == "function" && t.startsWith("on") ? r.addEventListener(
|
|
94
|
-
t.replace("on", "").toLowerCase(),
|
|
95
|
-
e
|
|
96
|
-
) : A(r, t, e);
|
|
97
|
-
}
|
|
98
|
-
function H(r) {
|
|
99
|
-
const s = [];
|
|
100
|
-
return r.forEach((t) => {
|
|
101
|
-
t != null && (typeof t == "number" ? s.push(t.toString()) : Array.isArray(t) ? t.forEach((e) => {
|
|
102
|
-
s.push(...H(e));
|
|
103
|
-
}) : s.push(t));
|
|
104
|
-
}), s;
|
|
105
|
-
}
|
|
106
|
-
function Z(r, s) {
|
|
107
|
-
const t = [...r.childNodes].filter((n) => n.__storeId === s.id), e = s.current, c = Array.isArray(e) ? e : [e], o = [];
|
|
108
|
-
if (c.forEach((n) => {
|
|
109
|
-
let i = null;
|
|
110
|
-
typeof n == "boolean" || typeof n == "number" || typeof n == "string" ? i = document.createTextNode(n.toString()) : n instanceof Node && (i = n), i && (i.__storeId = s.id, o.push(i));
|
|
111
|
-
}), s instanceof z) {
|
|
112
|
-
const n = [];
|
|
113
|
-
o.forEach((i, f) => {
|
|
114
|
-
const a = t.find(
|
|
115
|
-
(h) => h.__key === i.__key
|
|
116
|
-
);
|
|
117
|
-
a ? a.isEqualNode(i) ? n.push(a) : (a.replaceWith(i), n.push(i)) : (n.push(i), r.appendChild(i));
|
|
118
|
-
}), t.forEach((i) => {
|
|
119
|
-
n.includes(i) || i.remove();
|
|
120
|
-
});
|
|
121
|
-
} else
|
|
122
|
-
o.forEach((n, i) => {
|
|
123
|
-
var a;
|
|
124
|
-
const f = t[i];
|
|
125
|
-
if (f)
|
|
126
|
-
f.isEqualNode(n) || (f.replaceWith(n), t[i] = n);
|
|
127
|
-
else {
|
|
128
|
-
const h = t[t.length - 1];
|
|
129
|
-
h ? (a = h.parentNode) == null || a.insertBefore(
|
|
130
|
-
n,
|
|
131
|
-
h.nextSibling
|
|
132
|
-
) : r.appendChild(n);
|
|
133
|
-
}
|
|
134
|
-
}), t.slice(o.length).forEach((n) => {
|
|
135
|
-
n.remove();
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
class _ {
|
|
139
|
-
constructor(s, t, e) {
|
|
140
|
-
this.tag = s, this.attributes = t, this.children = e;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
class y extends _ {
|
|
144
|
-
}
|
|
145
|
-
class S extends _ {
|
|
146
|
-
}
|
|
147
|
-
class I extends _ {
|
|
148
|
-
}
|
|
149
|
-
function p(r, s, t, e = !1) {
|
|
150
|
-
const c = H(t);
|
|
151
|
-
Y(r, s), c.forEach((o) => {
|
|
152
|
-
if (o instanceof l)
|
|
153
|
-
E(r, o, () => {
|
|
154
|
-
Z(r, o);
|
|
155
|
-
});
|
|
156
|
-
else if (o instanceof y)
|
|
157
|
-
o.tag === "shadow" && r.shadowRoot ? p(
|
|
158
|
-
r.shadowRoot,
|
|
159
|
-
o.attributes,
|
|
160
|
-
o.children
|
|
161
|
-
) : p(r, o.attributes, o.children);
|
|
162
|
-
else if (o instanceof S) {
|
|
163
|
-
let n = null;
|
|
164
|
-
o.tag === "svg" ? (n = document.createElementNS(
|
|
165
|
-
"http://www.w3.org/2000/svg",
|
|
166
|
-
"svg"
|
|
167
|
-
), p(n, o.attributes, o.children, !0)) : n = e ? document.createElementNS("http://www.w3.org/2000/svg", o.tag) : document.createElement(o.tag), p(n, o.attributes, o.children, e), r.append(n);
|
|
168
|
-
} else if (o instanceof I) {
|
|
169
|
-
const n = document.createElement(o.tag);
|
|
170
|
-
p(n, o.attributes, o.children);
|
|
171
|
-
const i = J(document.head, n);
|
|
172
|
-
X(document.head, i);
|
|
173
|
-
} else
|
|
174
|
-
r.append(o);
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
function G(r, s, ...t) {
|
|
178
|
-
var e;
|
|
179
|
-
if (typeof r == "string")
|
|
180
|
-
return r === "component" ? new y(r, s, t) : r === "shadow" ? new y(r, s, t) : r === "head" ? new I(r, s, t) : new S(r, s, t);
|
|
181
|
-
{
|
|
182
|
-
if (r === P)
|
|
183
|
-
return P(t);
|
|
184
|
-
if (r.template)
|
|
185
|
-
return r(m({}, s));
|
|
186
|
-
const c = `e-${M(r.name)}`;
|
|
187
|
-
let o = customElements.get(c);
|
|
188
|
-
o || (o = (e = class extends U {
|
|
189
|
-
constructor() {
|
|
190
|
-
super();
|
|
191
|
-
}
|
|
192
|
-
}, e.formAssociated = r.formAssociated, e), customElements.define(c, o));
|
|
193
|
-
const n = new o(), i = D(m({}, s), {
|
|
194
|
-
children: t
|
|
195
|
-
}), f = r(i);
|
|
196
|
-
return __JSX_HMR_DEV__ && (n.__props__ = i), (f instanceof y || f instanceof S) && (f != null && f.children || f.attributes) && p(n, f.attributes, f.children), n;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
function P(r) {
|
|
200
|
-
const s = document.createDocumentFragment();
|
|
201
|
-
return p(s, void 0, r), s;
|
|
202
|
-
}
|
|
203
|
-
function et(r, s, t) {
|
|
204
|
-
const e = /* @__PURE__ */ G(s, m({}, t));
|
|
205
|
-
return r.append(e), e;
|
|
206
|
-
}
|
|
207
|
-
export {
|
|
208
|
-
P as F,
|
|
209
|
-
Q as a,
|
|
210
|
-
G as h,
|
|
211
|
-
et as r
|
|
212
|
-
};
|
package/lib/render-BIOfUddT.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var B=Object.defineProperty,K=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var q=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var N=e=>{throw TypeError(e)};var L=(e,r,t)=>r in e?B(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,y=(e,r)=>{for(var t in r||(r={}))J.call(r,t)&&L(e,t,r[t]);if(q)for(var t of q(r))X.call(r,t)&&L(e,t,r[t]);return e},D=(e,r)=>K(e,M(r));var F=(e,r,t)=>r.has(e)||N("Cannot "+t);var d=(e,r,t)=>(F(e,r,"read from private field"),t?t.call(e):r.get(e)),S=(e,r,t)=>r.has(e)?N("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,t),C=(e,r,t,s)=>(F(e,r,"write to private field"),s?s.call(e,t):r.set(e,t),t);const l=require("./Store-Blf4msDz.cjs"),$=require("./string-DUXXtU8v.cjs"),P=require("./morph-B6sGhLCi.cjs");require("construct-style-sheets-polyfill");require("./index-OE2INULi.cjs");const z=require("./connector/index.cjs"),Q=require("./DerivedArray-DdCR-Oy7.cjs"),W={current:null};var b,p;class U extends HTMLElement{constructor(){super();S(this,b,[]);S(this,p,[]);W.current=this}addConnectCallback(t){d(this,b).push(t)}addDisconnectCallback(t){d(this,p).push(t)}connectedCallback(){d(this,b).forEach(t=>{const s=t(this);s&&d(this,p).push(s)})}disconnectedCallback(){d(this,p).forEach(t=>{t(this)}),C(this,b,[]),C(this,p,[])}}b=new WeakMap,p=new WeakMap;function E(e,r,t){const s=r.subscribe(f=>{t(f)});z.connector.subscribe(e,{disconnectCallback:()=>{s()},maxWaitSec:20,unsubscribeAfterDisconnect:!0})}function H(e,r){r&&(r instanceof l.Store?E(e,r,t=>{t.previous&&e.classList.remove(t.previous.toString()),t.current&&e.classList.add(t.current.toString())}):typeof r=="object"&&!Array.isArray(r)?Object.entries(r).forEach(([t,s])=>{s instanceof l.Store?E(e,s,f=>{e.classList.toggle(t,!!f.current)}):s&&e.classList.add(t)}):Array.isArray(r)?r.forEach(t=>{typeof t=="string"?e.classList.add(t):H(e,t)}):r.toString().split(" ").map(t=>e.classList.add(t.trim())))}function V(e,r){r&&(typeof r=="object"?Object.entries(r).forEach(([t,s])=>{s instanceof l.Store?E(e,s,f=>{var n;e.style[t]=(n=f.current)==null?void 0:n.toString()}):(typeof s=="number"||typeof s=="string"||typeof s=="boolean")&&(e.style[t]=s.toString())}):typeof r=="string"&&(e.style=r))}function A(e,r,t){r==="ref"&&t?Array.isArray(t)?t.forEach(s=>{typeof s=="object"&&"value"in s&&(s.value=e)}):typeof t=="object"&&"value"in t&&(t.value=e):r==="className"||r==="class"?H(e,t):r==="style"?V(e,t):typeof t=="number"?r==="tabIndex"?e.setAttribute("tabindex",t.toString()):A(e,r,t.toString()):typeof t=="string"?r==="htmlFor"?e.setAttribute("for",t):e.setAttribute(r,t):typeof t=="boolean"?t?e.setAttribute(r,""):e.removeAttribute(r):t instanceof l.Store&&E(e,t,s=>{r in e?e[r]=s.current:A(e,r,s.current)})}function Y(e,r){for(const[t,s]of Object.entries(r!=null?r:{}))typeof s=="function"&&t.startsWith("on")?e.addEventListener(t.replace("on","").toLowerCase(),s):A(e,t,s)}function I(e){const r=[];return e.forEach(t=>{t!=null&&(typeof t=="number"?r.push(t.toString()):Array.isArray(t)?t.forEach(s=>{r.push(...I(s))}):r.push(t))}),r}function Z(e,r){const t=[...e.childNodes].filter(o=>o.__storeId===r.id),s=r.current,f=Array.isArray(s)?s:[s],n=[];if(f.forEach(o=>{let i=null;typeof o=="boolean"||typeof o=="number"||typeof o=="string"?i=document.createTextNode(o.toString()):o instanceof Node&&(i=o),i&&(i.__storeId=r.id,n.push(i))}),r instanceof Q.DerivedKeyedArray){const o=[];n.forEach((i,c)=>{const a=t.find(h=>h.__key===i.__key);a?a.isEqualNode(i)?o.push(a):(a.replaceWith(i),o.push(i)):(o.push(i),e.appendChild(i))}),t.forEach(i=>{o.includes(i)||i.remove()})}else n.forEach((o,i)=>{var a;const c=t[i];if(c)c.isEqualNode(o)||(c.replaceWith(o),t[i]=o);else{const h=t[t.length-1];h?(a=h.parentNode)==null||a.insertBefore(o,h.nextSibling):e.appendChild(o)}}),t.slice(n.length).forEach(o=>{o.remove()})}class w{constructor(r,t,s){this.tag=r,this.attributes=t,this.children=s}}class g extends w{}class _ extends w{}class O extends w{}function u(e,r,t,s=!1){const f=I(t);Y(e,r),f.forEach(n=>{if(n instanceof l.Store)E(e,n,()=>{Z(e,n)});else if(n instanceof g)n.tag==="shadow"&&e.shadowRoot?u(e.shadowRoot,n.attributes,n.children):u(e,n.attributes,n.children);else if(n instanceof _){let o=null;n.tag==="svg"?(o=document.createElementNS("http://www.w3.org/2000/svg","svg"),u(o,n.attributes,n.children,!0)):o=s?document.createElementNS("http://www.w3.org/2000/svg",n.tag):document.createElement(n.tag),u(o,n.attributes,n.children,s),e.append(o)}else if(n instanceof O){const o=document.createElement(n.tag);u(o,n.attributes,n.children);const i=P.diff(document.head,o);P.patch(document.head,i)}else e.append(n)})}function R(e,r,...t){var s;if(typeof e=="string")return e==="component"?new g(e,r,t):e==="shadow"?new g(e,r,t):e==="head"?new O(e,r,t):new _(e,r,t);{if(e===m)return m(t);if(e.template)return e(y({},r));const f=`e-${$.camelToKebab(e.name)}`;let n=customElements.get(f);n||(n=(s=class extends U{constructor(){super()}},s.formAssociated=e.formAssociated,s),customElements.define(f,n));const o=new n,i=D(y({},r),{children:t}),c=e(i);return __JSX_HMR_DEV__&&(o.__props__=i),(c instanceof g||c instanceof _)&&(c!=null&&c.children||c.attributes)&&u(o,c.attributes,c.children),o}}function m(e){const r=document.createDocumentFragment();return u(r,void 0,e),r}function G(e,r,t){const s=R(r,y({},t));return e.append(s),s}exports.Fragment=m;exports.activeComponent=W;exports.h=R;exports.render=G;
|