keits 0.0.4 → 0.1.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/README.md +93 -79
- package/dist/dev/api.js +8 -3
- package/dist/dev/forms.js +10 -5
- package/dist/dev/index.js +28 -35
- package/dist/dev/router.js +24 -7
- package/dist/dev/shared/{computed-3UO-KiH1.js → computed-DrF8O8b4.js} +1 -1
- package/dist/dev/shared/element-Bgf6SNbW.js +21 -0
- package/dist/dev/shared/{graph-D6-x_CWC.js → graph-SIvYLXSv.js} +62 -3
- package/dist/dev/shared/hydrate-g_akkVyT.js +588 -0
- package/dist/dev/shared/{element-CQPqagu1.js → insert-DadcXJL8.js} +116 -86
- package/dist/dev/shared/mount-BtpMEhSZ.js +23 -0
- package/dist/dev/shared/{owner-Dmge21OW.js → owner-BuwIoI4j.js} +12 -2
- package/dist/dev/shared/render-context-k2uu_dM_.js +34 -0
- package/dist/dev/shared/render-effect-Uk9dDmuU.js +32 -0
- package/dist/dev/shared/{resource-CbXVATvq.js → resource-DlgzdtcG.js} +24 -33
- package/dist/dev/shared/{signal-BOXkY-Iv.js → signal-B3xOKbVm.js} +1 -1
- package/dist/dev/shared/{store-BzUN1qE5.js → store-0vEg2bQV.js} +7 -3
- package/dist/dev/shared/unsafe-keys-CB1P22No.js +8 -0
- package/dist/dev/static.js +76 -0
- package/dist/dev/svg.js +2 -1
- package/dist/dev/testing.js +236 -0
- package/dist/dev/vite.js +141 -0
- package/dist/prod/api.js +76 -71
- package/dist/prod/forms.js +89 -84
- package/dist/prod/index.js +58 -66
- package/dist/prod/router.js +86 -73
- package/dist/prod/shared/{computed-CAPpOLCY.js → computed-BjqJ6Pps.js} +1 -1
- package/dist/prod/shared/element-B-0tH1YW.js +15 -0
- package/dist/prod/shared/{graph-C_aA46c6.js → graph-CR2WKbwr.js} +107 -63
- package/dist/prod/shared/hydrate-DhHCtdOz.js +480 -0
- package/dist/prod/shared/insert-CbcOsYmu.js +192 -0
- package/dist/prod/shared/mount-BEAO35S_.js +18 -0
- package/dist/prod/shared/owner-DBi3odT4.js +67 -0
- package/dist/prod/shared/render-context-DF8lr1uu.js +30 -0
- package/dist/prod/shared/render-effect-UFDi2Pfh.js +25 -0
- package/dist/prod/shared/resource-Ch5tVseZ.js +91 -0
- package/dist/prod/shared/signal-BDMlfa0Z.js +16 -0
- package/dist/prod/shared/store-CvW0DbmK.js +110 -0
- package/dist/prod/shared/unsafe-keys-C5PMlerl.js +7 -0
- package/dist/prod/static.js +48 -0
- package/dist/prod/svg.js +3 -2
- package/dist/prod/testing.js +161 -0
- package/dist/prod/vite.js +106 -0
- package/dist/types/async/render-context.d.ts +10 -0
- package/dist/types/core/effect.d.ts +1 -0
- package/dist/types/core/graph.d.ts +11 -0
- package/dist/types/core/owner.d.ts +1 -0
- package/dist/types/core/unsafe-keys.d.ts +2 -0
- package/dist/types/dom/hooks.d.ts +4 -0
- package/dist/types/dom/props.d.ts +2 -0
- package/dist/types/dom/types.d.ts +5 -0
- package/dist/types/router/index.d.ts +1 -0
- package/dist/types/router/match.d.ts +1 -0
- package/dist/types/router/types.d.ts +1 -0
- package/dist/types/static/head.d.ts +36 -0
- package/dist/types/static/hydrate.d.ts +3 -0
- package/dist/types/static/index.d.ts +4 -0
- package/dist/types/static/island.d.ts +14 -0
- package/dist/types/static/json.d.ts +1 -0
- package/dist/types/static/render.d.ts +11 -0
- package/dist/types/static/server-dom.d.ts +100 -0
- package/dist/types/testing/index.d.ts +69 -0
- package/dist/types/vite/index.d.ts +24 -0
- package/package.json +35 -8
- package/dist/dev/shared/render-effect-kOGnLNbL.js +0 -26
- package/dist/prod/shared/element-DGyQ01Vs.js +0 -164
- package/dist/prod/shared/owner-6BFHIPR9.js +0 -59
- package/dist/prod/shared/render-effect-DjaUT3Cn.js +0 -23
- package/dist/prod/shared/resource-CNC2DBO3.js +0 -109
- package/dist/prod/shared/signal-DGrl3r9T.js +0 -16
- package/dist/prod/shared/store-Dcscpk_h.js +0 -109
package/dist/prod/forms.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { t as e } from "./shared/computed-
|
|
2
|
-
import {
|
|
3
|
-
import { t as r } from "./shared/signal-
|
|
4
|
-
import { n as i, r as a } from "./shared/store-
|
|
1
|
+
import { t as e } from "./shared/computed-BjqJ6Pps.js";
|
|
2
|
+
import { i as t, x as n } from "./shared/graph-CR2WKbwr.js";
|
|
3
|
+
import { t as r } from "./shared/signal-BDMlfa0Z.js";
|
|
4
|
+
import { n as i, r as a } from "./shared/store-CvW0DbmK.js";
|
|
5
|
+
import { t as o } from "./shared/unsafe-keys-C5PMlerl.js";
|
|
5
6
|
// src/forms/paths.ts
|
|
6
|
-
function
|
|
7
|
+
function s(e, t) {
|
|
7
8
|
if (t === "") return e;
|
|
8
9
|
let n = e;
|
|
9
10
|
for (let e of t.split(".")) {
|
|
@@ -12,24 +13,26 @@ function o(e, t) {
|
|
|
12
13
|
}
|
|
13
14
|
return n;
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
let r = t.split(".")
|
|
16
|
+
function c(e, t, n) {
|
|
17
|
+
let r = t.split(".");
|
|
18
|
+
if (r.some((e) => o.has(e))) throw Error(`[keits/forms] "${t}" is not a field path: "__proto__", "constructor" and "prototype" aren't allowed.`);
|
|
19
|
+
let i = r.pop(), a = e;
|
|
17
20
|
r.forEach((e, t) => {
|
|
18
21
|
let n = a[e];
|
|
19
22
|
typeof n == "object" && n || (n = /^\d+$/.test(r[t + 1] ?? i) ? [] : {}, a[e] = n, n = a[e]), a = n;
|
|
20
23
|
}), a[i] = n;
|
|
21
24
|
}
|
|
22
|
-
function
|
|
25
|
+
function l(e, t) {
|
|
23
26
|
if (Object.is(e, t)) return !0;
|
|
24
27
|
if (e instanceof Date && t instanceof Date) return e.getTime() === t.getTime();
|
|
25
28
|
if (e === null || t === null || typeof e != "object" || typeof t != "object" || Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
26
29
|
let n = Object.keys(e);
|
|
27
|
-
return n.length === Object.keys(t).length && n.every((n) =>
|
|
30
|
+
return n.length === Object.keys(t).length && n.every((n) => l(e[n], t[n]));
|
|
28
31
|
}
|
|
29
|
-
function
|
|
32
|
+
function u(e, t) {
|
|
30
33
|
return t === "" || e === t || e.startsWith(`${t}.`);
|
|
31
34
|
}
|
|
32
|
-
function
|
|
35
|
+
function d(e, t, n) {
|
|
33
36
|
let r = {}, i = `${t}.`;
|
|
34
37
|
for (let [t, a] of Object.entries(e)) {
|
|
35
38
|
if (!t.startsWith(i)) {
|
|
@@ -41,7 +44,7 @@ function u(e, t, n) {
|
|
|
41
44
|
}
|
|
42
45
|
return r;
|
|
43
46
|
}
|
|
44
|
-
function
|
|
47
|
+
function f(e) {
|
|
45
48
|
let t = {}, n = (e, n) => {
|
|
46
49
|
let r = Array.isArray(n) ? n.find((e) => typeof e == "string") : n;
|
|
47
50
|
typeof r == "string" && !(e in t) && (t[e] = r);
|
|
@@ -65,9 +68,9 @@ function d(e) {
|
|
|
65
68
|
return Object.keys(t).length === 0 && n("", o), t;
|
|
66
69
|
}
|
|
67
70
|
// src/forms/form.ts
|
|
68
|
-
function
|
|
69
|
-
let [
|
|
70
|
-
let e =
|
|
71
|
+
function p(o) {
|
|
72
|
+
let [p, v] = i(structuredClone(o.initial)), [y, b] = i({}), [x, S] = i({}), [C, w] = i({}), T = r(structuredClone(o.initial), { equals: !1 }), E = r(0), D = r(!1), O = r(!1), k = 0, A = 0, j = (e) => typeof e == "function" ? e() : e, M = () => structuredClone(a(p)), N = () => {
|
|
73
|
+
let e = M(), t = [
|
|
71
74
|
{},
|
|
72
75
|
{},
|
|
73
76
|
{}
|
|
@@ -75,14 +78,14 @@ function f(f) {
|
|
|
75
78
|
errors: {},
|
|
76
79
|
output: void 0
|
|
77
80
|
}, r = [], i = (e, t) => {
|
|
78
|
-
|
|
81
|
+
_(e) ? r.push(e.then(t)) : t(e);
|
|
79
82
|
};
|
|
80
|
-
for (let [n, r] of Object.entries(
|
|
83
|
+
for (let [n, r] of Object.entries(o.fields ?? {})) i(r(s(e, n), e), (e) => {
|
|
81
84
|
e && (t[0][n] = e);
|
|
82
85
|
});
|
|
83
|
-
|
|
86
|
+
o.validate && i(o.validate(e), (e) => {
|
|
84
87
|
for (let [n, r] of Object.entries(e ?? {})) typeof r == "string" && (t[1][n] = r);
|
|
85
|
-
}),
|
|
88
|
+
}), o.schema && i(o.schema["~standard"].validate(e), (e) => {
|
|
86
89
|
if (e.issues === void 0) n.output = e.value;
|
|
87
90
|
else for (let n of e.issues) {
|
|
88
91
|
let e = (n.path ?? []).map((e) => String(typeof e == "object" ? e.key : e)).join(".");
|
|
@@ -94,52 +97,52 @@ function f(f) {
|
|
|
94
97
|
return n;
|
|
95
98
|
};
|
|
96
99
|
return r.length === 0 ? a() : Promise.all(r).then(a);
|
|
97
|
-
},
|
|
98
|
-
let e = ++k,
|
|
99
|
-
|
|
100
|
-
}),
|
|
101
|
-
return
|
|
102
|
-
},
|
|
100
|
+
}, P = () => {
|
|
101
|
+
let e = ++k, n = (n) => (e === k && t(() => {
|
|
102
|
+
h(b, n.errors), O.set(!1);
|
|
103
|
+
}), n), r = N();
|
|
104
|
+
return _(r) ? (O.set(!0), r.then(n)) : n(r);
|
|
105
|
+
}, F = (e) => {
|
|
103
106
|
S((t) => {
|
|
104
|
-
for (let n of Object.keys(t)) (
|
|
105
|
-
}),
|
|
106
|
-
},
|
|
107
|
-
v((
|
|
108
|
-
}),
|
|
109
|
-
v((
|
|
110
|
-
Array.isArray(
|
|
111
|
-
}), w((t) =>
|
|
112
|
-
...
|
|
107
|
+
for (let n of Object.keys(t)) (u(n, e) || u(e, n)) && delete t[n];
|
|
108
|
+
}), P();
|
|
109
|
+
}, I = (e, n) => t(() => {
|
|
110
|
+
v((t) => c(t, e, n)), F(e);
|
|
111
|
+
}), L = (e) => w((t) => void (t[e] = !0)), R = (e, n, r) => t(() => {
|
|
112
|
+
v((t) => {
|
|
113
|
+
Array.isArray(s(t, e)) || c(t, e, []), n(s(t, e));
|
|
114
|
+
}), w((t) => m(t, {
|
|
115
|
+
...d(a(t), e, r),
|
|
113
116
|
[e]: !0
|
|
114
|
-
})), S((t) =>
|
|
115
|
-
}),
|
|
116
|
-
values:
|
|
117
|
-
value: (e) =>
|
|
118
|
-
set: (e, t) =>
|
|
119
|
-
update: (e) =>
|
|
120
|
-
v(e),
|
|
117
|
+
})), S((t) => m(t, d(a(t), e, r))), P();
|
|
118
|
+
}), z = () => E() > 0, B = (e) => e === "" ? z() : C[e] === !0 || z(), V = e(() => Object.keys(y).length === 0), H = e(() => !l(p, T())), U = {
|
|
119
|
+
values: p,
|
|
120
|
+
value: (e) => s(p, j(e)),
|
|
121
|
+
set: (e, t) => I(e, t),
|
|
122
|
+
update: (e) => t(() => {
|
|
123
|
+
v(e), F("");
|
|
121
124
|
}),
|
|
122
|
-
bind(e,
|
|
123
|
-
let r = () =>
|
|
125
|
+
bind(e, t = {}) {
|
|
126
|
+
let r = () => j(e), i = () => s(p, r()), a = {
|
|
124
127
|
name: r,
|
|
125
|
-
onblur: () =>
|
|
126
|
-
"aria-invalid": () =>
|
|
127
|
-
},
|
|
128
|
-
return c !== void 0 && Array.isArray(
|
|
128
|
+
onblur: () => L(r()),
|
|
129
|
+
"aria-invalid": () => U.error(r()) ? "true" : void 0
|
|
130
|
+
}, o = n(i), c = t.value;
|
|
131
|
+
return c !== void 0 && Array.isArray(o) ? {
|
|
129
132
|
...a,
|
|
130
133
|
type: "checkbox",
|
|
131
134
|
value: () => c,
|
|
132
135
|
checked: () => i().includes(c),
|
|
133
136
|
onchange: (e) => {
|
|
134
|
-
let
|
|
135
|
-
|
|
137
|
+
let t = n(i).filter((e) => e !== c);
|
|
138
|
+
I(r(), e.currentTarget.checked ? [...t, c] : t);
|
|
136
139
|
}
|
|
137
|
-
} : c === void 0 ? typeof
|
|
140
|
+
} : c === void 0 ? typeof o == "boolean" ? {
|
|
138
141
|
...a,
|
|
139
142
|
type: "checkbox",
|
|
140
143
|
checked: () => i() === !0,
|
|
141
|
-
onchange: (e) =>
|
|
142
|
-
} : typeof
|
|
144
|
+
onchange: (e) => I(r(), e.currentTarget.checked)
|
|
145
|
+
} : typeof o == "number" ? {
|
|
143
146
|
...a,
|
|
144
147
|
value: () => {
|
|
145
148
|
let e = i();
|
|
@@ -147,62 +150,64 @@ function f(f) {
|
|
|
147
150
|
},
|
|
148
151
|
oninput: (e) => {
|
|
149
152
|
let t = e.currentTarget.value;
|
|
150
|
-
|
|
153
|
+
I(r(), t.trim() === "" ? NaN : Number(t));
|
|
151
154
|
}
|
|
152
155
|
} : {
|
|
153
156
|
...a,
|
|
154
157
|
value: () => String(i() ?? ""),
|
|
155
|
-
oninput: (e) =>
|
|
158
|
+
oninput: (e) => I(r(), e.currentTarget.value)
|
|
156
159
|
} : {
|
|
157
160
|
...a,
|
|
158
161
|
type: "radio",
|
|
159
162
|
value: () => c,
|
|
160
163
|
checked: () => i() === c,
|
|
161
|
-
onchange: () =>
|
|
164
|
+
onchange: () => I(r(), c)
|
|
162
165
|
};
|
|
163
166
|
},
|
|
164
167
|
error(e = "") {
|
|
165
|
-
let t =
|
|
166
|
-
return (
|
|
168
|
+
let t = j(e);
|
|
169
|
+
return (B(t) ? y[t] : void 0) ?? x[t];
|
|
167
170
|
},
|
|
168
|
-
touched: (e) => C[
|
|
169
|
-
touch: (e) =>
|
|
170
|
-
dirty: (e) => e === void 0 ?
|
|
171
|
-
valid: () =>
|
|
171
|
+
touched: (e) => C[j(e)] === !0,
|
|
172
|
+
touch: (e) => L(e),
|
|
173
|
+
dirty: (e) => e === void 0 ? H() : !l(s(p, j(e)), s(T(), j(e))),
|
|
174
|
+
valid: () => V(),
|
|
172
175
|
validating: () => O(),
|
|
173
176
|
submitting: () => D(),
|
|
174
|
-
submitted:
|
|
177
|
+
submitted: z,
|
|
175
178
|
array(e) {
|
|
176
179
|
return {
|
|
177
|
-
items: () =>
|
|
178
|
-
add: (t, n) =>
|
|
179
|
-
remove: (t) =>
|
|
180
|
-
move: (t, n) =>
|
|
180
|
+
items: () => s(p, e) ?? [],
|
|
181
|
+
add: (t, n) => R(e, (e) => n === void 0 ? e.push(t) : e.splice(n, 0, t), (e) => n === void 0 || e < n ? e : e + 1),
|
|
182
|
+
remove: (t) => R(e, (e) => e.splice(t, 1), (e) => e === t ? -1 : e > t ? e - 1 : e),
|
|
183
|
+
move: (t, n) => R(e, (e) => e.splice(n, 0, ...e.splice(t, 1)), (e) => e === t ? n : t < n ? e > t && e <= n ? e - 1 : e : e >= n && e < t ? e + 1 : e)
|
|
181
184
|
};
|
|
182
185
|
},
|
|
183
186
|
setErrors(e) {
|
|
184
187
|
let t;
|
|
185
|
-
if (
|
|
188
|
+
if (g(e)) {
|
|
186
189
|
if (e.status !== 400 && e.status !== 422) return !1;
|
|
187
|
-
t =
|
|
190
|
+
t = f(e.body);
|
|
188
191
|
} else {
|
|
189
192
|
t = {};
|
|
190
193
|
for (let [n, r] of Object.entries(e)) typeof r == "string" && (t[n] = r);
|
|
191
194
|
}
|
|
192
|
-
return Object.keys(t).length !== 0 && (S((e) =>
|
|
195
|
+
return Object.keys(t).length !== 0 && (S((e) => m(e, t)), !0);
|
|
193
196
|
},
|
|
194
197
|
submit(e) {
|
|
195
198
|
return async (r) => {
|
|
196
|
-
if (r?.preventDefault(),
|
|
199
|
+
if (r?.preventDefault(), n(D)) return !1;
|
|
197
200
|
let i = r?.currentTarget instanceof Element ? r.currentTarget : null, a = () => i?.querySelector("[aria-invalid=\"true\"]")?.focus();
|
|
198
|
-
|
|
199
|
-
E.set(
|
|
201
|
+
t(() => {
|
|
202
|
+
E.set(n(E) + 1), D.set(!0), S((e) => m(e, {}));
|
|
200
203
|
});
|
|
201
204
|
try {
|
|
202
|
-
let t =
|
|
203
|
-
|
|
205
|
+
let t = M(), n = await P();
|
|
206
|
+
if (Object.keys(n.errors).length > 0) return a(), !1;
|
|
207
|
+
let r = A;
|
|
208
|
+
return await e(o.schema ? n.output : t), A === r && T.set(() => t), !0;
|
|
204
209
|
} catch (e) {
|
|
205
|
-
if (
|
|
210
|
+
if (U.setErrors(e)) return a(), !1;
|
|
206
211
|
throw e;
|
|
207
212
|
} finally {
|
|
208
213
|
D.set(!1);
|
|
@@ -210,28 +215,28 @@ function f(f) {
|
|
|
210
215
|
};
|
|
211
216
|
},
|
|
212
217
|
reset(e) {
|
|
213
|
-
let r = structuredClone(e ??
|
|
214
|
-
|
|
215
|
-
v((e) =>
|
|
218
|
+
let r = structuredClone(e ?? n(T));
|
|
219
|
+
A++, t(() => {
|
|
220
|
+
v((e) => m(e, structuredClone(r))), T.set(() => r), w((e) => m(e, {})), S((e) => m(e, {})), E.set(0), P();
|
|
216
221
|
});
|
|
217
222
|
}
|
|
218
223
|
};
|
|
219
|
-
return
|
|
224
|
+
return P(), U;
|
|
220
225
|
}
|
|
221
|
-
function
|
|
226
|
+
function m(e, t) {
|
|
222
227
|
for (let n of Object.keys(e)) n in t || delete e[n];
|
|
223
228
|
Object.assign(e, t);
|
|
224
229
|
}
|
|
225
|
-
function
|
|
230
|
+
function h(e, t) {
|
|
226
231
|
e((e) => {
|
|
227
232
|
for (let n of Object.keys(e)) n in t || delete e[n];
|
|
228
233
|
for (let [n, r] of Object.entries(t)) e[n] !== r && (e[n] = r);
|
|
229
234
|
});
|
|
230
235
|
}
|
|
231
|
-
function
|
|
236
|
+
function g(e) {
|
|
232
237
|
return typeof e == "object" && !!e && typeof e.status == "number" && "body" in e;
|
|
233
238
|
}
|
|
234
|
-
function
|
|
239
|
+
function _(e) {
|
|
235
240
|
return typeof e?.then == "function";
|
|
236
241
|
}
|
|
237
|
-
export {
|
|
242
|
+
export { p as form };
|
package/dist/prod/index.js
CHANGED
|
@@ -1,46 +1,35 @@
|
|
|
1
|
-
import { t as e } from "./shared/signal-
|
|
2
|
-
import { n as t, t as n } from "./shared/render-effect-
|
|
3
|
-
import { t as r } from "./shared/computed-
|
|
4
|
-
import { a as i,
|
|
5
|
-
import { a as
|
|
6
|
-
import { a as
|
|
7
|
-
import { n as
|
|
8
|
-
import {
|
|
1
|
+
import { t as e } from "./shared/signal-BDMlfa0Z.js";
|
|
2
|
+
import { n as t, t as n } from "./shared/render-effect-UFDi2Pfh.js";
|
|
3
|
+
import { t as r } from "./shared/computed-BjqJ6Pps.js";
|
|
4
|
+
import { a as i, d as a, i as o, p as s, t as c, x as l } from "./shared/graph-CR2WKbwr.js";
|
|
5
|
+
import { a as u, c as d, n as f, o as p, r as m, s as h, t as g } from "./shared/owner-DBi3odT4.js";
|
|
6
|
+
import { a as _, i as v, o as y } from "./shared/render-context-DF8lr1uu.js";
|
|
7
|
+
import { n as ee, r as te, t as ne } from "./shared/store-CvW0DbmK.js";
|
|
8
|
+
import { n as b } from "./shared/element-B-0tH1YW.js";
|
|
9
|
+
import { l as re, r as x, s as S, t as C } from "./shared/insert-CbcOsYmu.js";
|
|
10
|
+
import { t as ie } from "./shared/mount-BEAO35S_.js";
|
|
11
|
+
import { n as w, t as T } from "./shared/resource-Ch5tVseZ.js";
|
|
9
12
|
// src/core/env.ts
|
|
10
|
-
var
|
|
11
|
-
// src/dom/mount.ts
|
|
12
|
-
function It(e, t) {
|
|
13
|
-
if (t === null) throw Error("[keits] no target");
|
|
14
|
-
let n = b.marker(), r = b.marker();
|
|
15
|
-
t.append(n, r);
|
|
16
|
-
let i = d((n) => (x(t, e(), r), n));
|
|
17
|
-
return () => {
|
|
18
|
-
i();
|
|
19
|
-
let e = n;
|
|
20
|
-
for (; e !== null;) {
|
|
21
|
-
let t = e === r ? null : e.nextSibling;
|
|
22
|
-
e.remove(), e = t;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
13
|
+
var E = typeof window > "u", D = /* @__PURE__ */ b("a"), O = /* @__PURE__ */ b("abbr"), k = /* @__PURE__ */ b("address"), A = /* @__PURE__ */ b("area"), j = /* @__PURE__ */ b("article"), M = /* @__PURE__ */ b("aside"), N = /* @__PURE__ */ b("audio"), P = /* @__PURE__ */ b("b"), F = /* @__PURE__ */ b("base"), I = /* @__PURE__ */ b("bdi"), L = /* @__PURE__ */ b("bdo"), R = /* @__PURE__ */ b("blockquote"), z = /* @__PURE__ */ b("body"), B = /* @__PURE__ */ b("br"), V = /* @__PURE__ */ b("button"), H = /* @__PURE__ */ b("canvas"), U = /* @__PURE__ */ b("caption"), W = /* @__PURE__ */ b("cite"), G = /* @__PURE__ */ b("code"), K = /* @__PURE__ */ b("col"), q = /* @__PURE__ */ b("colgroup"), J = /* @__PURE__ */ b("data"), Y = /* @__PURE__ */ b("datalist"), ae = /* @__PURE__ */ b("dd"), oe = /* @__PURE__ */ b("del"), se = /* @__PURE__ */ b("details"), ce = /* @__PURE__ */ b("dfn"), le = /* @__PURE__ */ b("dialog"), ue = /* @__PURE__ */ b("div"), de = /* @__PURE__ */ b("dl"), fe = /* @__PURE__ */ b("dt"), pe = /* @__PURE__ */ b("em"), me = /* @__PURE__ */ b("embed"), he = /* @__PURE__ */ b("fieldset"), ge = /* @__PURE__ */ b("figcaption"), _e = /* @__PURE__ */ b("figure"), ve = /* @__PURE__ */ b("footer"), ye = /* @__PURE__ */ b("form"), be = /* @__PURE__ */ b("h1"), xe = /* @__PURE__ */ b("h2"), Se = /* @__PURE__ */ b("h3"), Ce = /* @__PURE__ */ b("h4"), we = /* @__PURE__ */ b("h5"), Te = /* @__PURE__ */ b("h6"), Ee = /* @__PURE__ */ b("head"), De = /* @__PURE__ */ b("header"), Oe = /* @__PURE__ */ b("hgroup"), ke = /* @__PURE__ */ b("hr"), Ae = /* @__PURE__ */ b("html"), je = /* @__PURE__ */ b("i"), Me = /* @__PURE__ */ b("iframe"), Ne = /* @__PURE__ */ b("img"), Pe = /* @__PURE__ */ b("input"), Fe = /* @__PURE__ */ b("ins"), Ie = /* @__PURE__ */ b("kbd"), Le = /* @__PURE__ */ b("label"), Re = /* @__PURE__ */ b("legend"), ze = /* @__PURE__ */ b("li"), Be = /* @__PURE__ */ b("link"), Ve = /* @__PURE__ */ b("main"), He = /* @__PURE__ */ b("map"), Ue = /* @__PURE__ */ b("mark"), We = /* @__PURE__ */ b("menu"), Ge = /* @__PURE__ */ b("meta"), Ke = /* @__PURE__ */ b("meter"), qe = /* @__PURE__ */ b("nav"), Je = /* @__PURE__ */ b("noscript"), Ye = /* @__PURE__ */ b("object"), Xe = /* @__PURE__ */ b("ol"), Ze = /* @__PURE__ */ b("optgroup"), Qe = /* @__PURE__ */ b("option"), $e = /* @__PURE__ */ b("output"), et = /* @__PURE__ */ b("p"), tt = /* @__PURE__ */ b("picture"), nt = /* @__PURE__ */ b("pre"), rt = /* @__PURE__ */ b("progress"), it = /* @__PURE__ */ b("q"), at = /* @__PURE__ */ b("rp"), ot = /* @__PURE__ */ b("rt"), st = /* @__PURE__ */ b("ruby"), ct = /* @__PURE__ */ b("s"), lt = /* @__PURE__ */ b("samp"), ut = /* @__PURE__ */ b("script"), dt = /* @__PURE__ */ b("search"), ft = /* @__PURE__ */ b("section"), pt = /* @__PURE__ */ b("select"), mt = /* @__PURE__ */ b("slot"), ht = /* @__PURE__ */ b("small"), gt = /* @__PURE__ */ b("source"), _t = /* @__PURE__ */ b("span"), vt = /* @__PURE__ */ b("strong"), yt = /* @__PURE__ */ b("style"), bt = /* @__PURE__ */ b("sub"), xt = /* @__PURE__ */ b("summary"), St = /* @__PURE__ */ b("sup"), Ct = /* @__PURE__ */ b("table"), wt = /* @__PURE__ */ b("tbody"), Tt = /* @__PURE__ */ b("td"), Et = /* @__PURE__ */ b("template"), Dt = /* @__PURE__ */ b("textarea"), Ot = /* @__PURE__ */ b("tfoot"), kt = /* @__PURE__ */ b("th"), At = /* @__PURE__ */ b("thead"), jt = /* @__PURE__ */ b("time"), Mt = /* @__PURE__ */ b("title"), Nt = /* @__PURE__ */ b("tr"), Pt = /* @__PURE__ */ b("track"), Ft = /* @__PURE__ */ b("u"), It = /* @__PURE__ */ b("ul"), X = /* @__PURE__ */ b("var"), Lt = /* @__PURE__ */ b("video"), Rt = /* @__PURE__ */ b("wbr");
|
|
26
14
|
// src/dom/unsafe.ts
|
|
27
|
-
function
|
|
15
|
+
function zt(e) {
|
|
16
|
+
if (S.html !== void 0) return S.html(e);
|
|
28
17
|
let t = document.createElement("template");
|
|
29
18
|
return t.innerHTML = e, t.content;
|
|
30
19
|
}
|
|
31
20
|
// src/flow/range.ts
|
|
32
21
|
function Z(e, t) {
|
|
33
|
-
return
|
|
22
|
+
return f((n) => {
|
|
34
23
|
let r = e();
|
|
35
|
-
if (
|
|
24
|
+
if (Bt(r)) return {
|
|
36
25
|
item: t,
|
|
37
26
|
index: null,
|
|
38
27
|
dispose: n,
|
|
39
28
|
first: r,
|
|
40
29
|
last: r
|
|
41
30
|
};
|
|
42
|
-
let i =
|
|
43
|
-
return i.append(a, o),
|
|
31
|
+
let i = S.fragment(), a = S.marker(), o = S.marker();
|
|
32
|
+
return i.append(a, o), C(i, r, o), {
|
|
44
33
|
item: t,
|
|
45
34
|
index: null,
|
|
46
35
|
dispose: n,
|
|
@@ -49,7 +38,7 @@ function Z(e, t) {
|
|
|
49
38
|
};
|
|
50
39
|
});
|
|
51
40
|
}
|
|
52
|
-
function
|
|
41
|
+
function Bt(e) {
|
|
53
42
|
return typeof e == "object" && !!e && e.nodeType === 1;
|
|
54
43
|
}
|
|
55
44
|
function Q(e, t, n) {
|
|
@@ -72,8 +61,8 @@ function $(e) {
|
|
|
72
61
|
}
|
|
73
62
|
}
|
|
74
63
|
// src/flow/for.ts
|
|
75
|
-
function
|
|
76
|
-
let a =
|
|
64
|
+
function Vt(t, r, i) {
|
|
65
|
+
let a = S.marker(), o = S.fragment();
|
|
77
66
|
o.append(a);
|
|
78
67
|
let s = [], l = null;
|
|
79
68
|
c(() => {
|
|
@@ -87,7 +76,7 @@ function Rt(t, r, i) {
|
|
|
87
76
|
let t = a.parentNode;
|
|
88
77
|
if (e.length === 0) {
|
|
89
78
|
for (let e of s) $(e);
|
|
90
|
-
s = [], l === null && i?.fallback && (l = Z(i.fallback, null), Q(t, l, a));
|
|
79
|
+
s = [], l === null && i?.fallback && (l = Z(i.fallback, null), Q(t, l, a)), x(t);
|
|
91
80
|
return;
|
|
92
81
|
}
|
|
93
82
|
l !== null && ($(l), l = null);
|
|
@@ -106,12 +95,12 @@ function Rt(t, r, i) {
|
|
|
106
95
|
c[t] = l;
|
|
107
96
|
}
|
|
108
97
|
for (let e = 0; e < s.length; e++) r[e] || $(s[e]);
|
|
109
|
-
let u =
|
|
98
|
+
let u = Ht(c), f = a;
|
|
110
99
|
for (let e = o.length - 1; e >= 0; e--) {
|
|
111
100
|
let n = o[e];
|
|
112
101
|
u.has(e) || Q(t, n, f), f = n.first;
|
|
113
102
|
}
|
|
114
|
-
s = o;
|
|
103
|
+
s = o, x(t);
|
|
115
104
|
}
|
|
116
105
|
function d(t, n) {
|
|
117
106
|
let i = () => {}, a = Z(() => {
|
|
@@ -122,7 +111,7 @@ function Rt(t, r, i) {
|
|
|
122
111
|
}
|
|
123
112
|
return o;
|
|
124
113
|
}
|
|
125
|
-
function
|
|
114
|
+
function Ht(e) {
|
|
126
115
|
let t = [], n = Array(e.length);
|
|
127
116
|
for (let r = 0; r < e.length; r++) {
|
|
128
117
|
let i = e[r];
|
|
@@ -139,51 +128,54 @@ function zt(e) {
|
|
|
139
128
|
return r;
|
|
140
129
|
}
|
|
141
130
|
// src/flow/if.ts
|
|
142
|
-
function
|
|
143
|
-
let i = r(e),
|
|
144
|
-
return () =>
|
|
131
|
+
function Ut(e, t, n) {
|
|
132
|
+
let i = r(e), a = r(() => !!i()), o = i;
|
|
133
|
+
return () => a() ? l(() => t(o)) : n ? l(n) : null;
|
|
145
134
|
}
|
|
146
135
|
// src/flow/show.ts
|
|
147
|
-
function
|
|
136
|
+
function Wt(e, t) {
|
|
148
137
|
let r = t.style.display;
|
|
149
138
|
return n(() => {
|
|
150
139
|
e() ? t.style.display = r : t.style.display = "none";
|
|
151
140
|
}), t;
|
|
152
141
|
}
|
|
153
142
|
// src/flow/switch.ts
|
|
154
|
-
function
|
|
143
|
+
function Gt(e, t, n) {
|
|
155
144
|
let i = r(e);
|
|
156
145
|
return () => {
|
|
157
146
|
let e = t[i()] ?? n;
|
|
158
|
-
return e ?
|
|
147
|
+
return e ? l(e) : null;
|
|
159
148
|
};
|
|
160
149
|
}
|
|
161
150
|
// src/flow/dynamic.ts
|
|
162
|
-
function
|
|
151
|
+
function Kt(e, t) {
|
|
163
152
|
let n = r(e);
|
|
164
153
|
return () => {
|
|
165
154
|
let e = n();
|
|
166
|
-
return e ?
|
|
155
|
+
return e ? l(() => e(t)) : null;
|
|
167
156
|
};
|
|
168
157
|
}
|
|
169
158
|
// src/flow/catch.ts
|
|
170
|
-
function
|
|
159
|
+
function qt(t, n) {
|
|
171
160
|
let r = e(null), i = () => r.set(null);
|
|
172
161
|
return () => {
|
|
173
162
|
let e = r();
|
|
174
|
-
return
|
|
175
|
-
let e =
|
|
176
|
-
return
|
|
163
|
+
return l(e === null ? () => g(() => {
|
|
164
|
+
let e = S.fragment();
|
|
165
|
+
return C(e, t()), e;
|
|
177
166
|
}, (e) => r.set({ error: e })) : () => n(e.error, i));
|
|
178
167
|
};
|
|
179
168
|
}
|
|
180
169
|
// src/flow/portal.ts
|
|
181
|
-
function
|
|
182
|
-
if (
|
|
170
|
+
function Jt(e, t) {
|
|
171
|
+
if (a()) return s(), null;
|
|
183
172
|
let n = t === void 0 ? document.body : t;
|
|
184
173
|
if (n === null) throw Error("[keits] no target");
|
|
185
|
-
let r =
|
|
186
|
-
|
|
174
|
+
let r = S.marker(), i = S.marker();
|
|
175
|
+
n.append(r, i);
|
|
176
|
+
let o = f((t) => (re(() => C(n, l(e), i)), t));
|
|
177
|
+
return c(() => {
|
|
178
|
+
o();
|
|
187
179
|
let e = r;
|
|
188
180
|
for (; e !== null;) {
|
|
189
181
|
let t = e === i ? null : e.nextSibling;
|
|
@@ -192,42 +184,42 @@ function Gt(e, t) {
|
|
|
192
184
|
}), null;
|
|
193
185
|
}
|
|
194
186
|
// src/flow/suspense.ts
|
|
195
|
-
function
|
|
196
|
-
let
|
|
197
|
-
|
|
198
|
-
|
|
187
|
+
function Yt(t, r) {
|
|
188
|
+
let a = e(0), o = /* @__PURE__ */ new Set(), s = { wait(e, t) {
|
|
189
|
+
o.has(e) || (o.add(e), a.set((e) => e + 1), t(() => {
|
|
190
|
+
o.delete(e), a.set((e) => e - 1);
|
|
199
191
|
}));
|
|
200
|
-
} }, u =
|
|
192
|
+
} }, u = S.fragment(), d = S.marker(), f = S.marker();
|
|
201
193
|
u.append(d, f);
|
|
202
|
-
let { release: p } = i(() => _(
|
|
194
|
+
let { release: p } = i(() => _(w, s, () => C(u, l(t), f))), m = {
|
|
203
195
|
item: null,
|
|
204
196
|
index: null,
|
|
205
197
|
dispose: () => {},
|
|
206
198
|
first: d,
|
|
207
199
|
last: f
|
|
208
|
-
}, h =
|
|
200
|
+
}, h = S.marker(), g = S.fragment();
|
|
209
201
|
g.append(h);
|
|
210
202
|
let v = null;
|
|
211
203
|
return c(() => v?.dispose()), n(() => {
|
|
212
|
-
let e =
|
|
213
|
-
|
|
204
|
+
let e = a() > 0;
|
|
205
|
+
l(() => {
|
|
214
206
|
let t = h.parentNode;
|
|
215
207
|
e ? (Q(u, m, null), v === null && (v = Z(r, null), Q(t, v, h))) : (v !== null && ($(v), v = null), Q(t, m, h), p());
|
|
216
208
|
});
|
|
217
209
|
}), g;
|
|
218
210
|
}
|
|
219
211
|
// src/async/lazy.ts
|
|
220
|
-
function
|
|
212
|
+
function Xt(e) {
|
|
221
213
|
let t, n, r = () => n ??= Promise.resolve(e()).then((e) => t = e.default, (e) => {
|
|
222
214
|
throw n = void 0, e;
|
|
223
215
|
});
|
|
224
216
|
return Object.assign((e) => {
|
|
225
|
-
if (t !== void 0) return
|
|
226
|
-
let n =
|
|
217
|
+
if (t !== void 0) return l(() => t(e));
|
|
218
|
+
let n = T(() => t ?? r());
|
|
227
219
|
return () => {
|
|
228
220
|
let t = n();
|
|
229
|
-
return t ?
|
|
221
|
+
return t ? l(() => t(e)) : null;
|
|
230
222
|
};
|
|
231
223
|
}, { preload: r });
|
|
232
224
|
}
|
|
233
|
-
export {
|
|
225
|
+
export { D as $a, O as $abbr, k as $address, A as $area, j as $article, M as $aside, N as $audio, P as $b, F as $base, I as $bdi, L as $bdo, R as $blockquote, z as $body, B as $br, V as $button, H as $canvas, U as $caption, qt as $catch, W as $cite, G as $code, K as $col, q as $colgroup, J as $data, Y as $datalist, ae as $dd, oe as $del, se as $details, ce as $dfn, le as $dialog, ue as $div, de as $dl, fe as $dt, Kt as $dynamic, pe as $em, me as $embed, he as $fieldset, ge as $figcaption, _e as $figure, ve as $footer, Vt as $for, ye as $form, be as $h1, xe as $h2, Se as $h3, Ce as $h4, we as $h5, Te as $h6, Ee as $head, De as $header, Oe as $hgroup, ke as $hr, Ae as $html, je as $i, Ut as $if, Me as $iframe, Ne as $img, Pe as $input, Fe as $ins, Ie as $kbd, Le as $label, Re as $legend, ze as $li, Be as $link, Ve as $main, He as $map, Ue as $mark, We as $menu, Ge as $meta, Ke as $meter, qe as $nav, Je as $noscript, Ye as $object, Xe as $ol, Ze as $optgroup, Qe as $option, $e as $output, et as $p, tt as $picture, Jt as $portal, nt as $pre, rt as $progress, it as $q, at as $rp, ot as $rt, st as $ruby, ct as $s, lt as $samp, ut as $script, dt as $search, ft as $section, pt as $select, Wt as $show, mt as $slot, ht as $small, gt as $source, _t as $span, vt as $strong, yt as $style, bt as $sub, xt as $summary, St as $sup, Yt as $suspense, Gt as $switch, Ct as $table, wt as $tbody, Tt as $td, Et as $template, Dt as $textarea, Ot as $tfoot, kt as $th, At as $thead, jt as $time, Mt as $title, Nt as $tr, Pt as $track, Ft as $u, It as $ul, X as $var, Lt as $video, Rt as $wbr, o as batch, g as catchError, r as computed, v as createContext, f as createRoot, t as effect, m as getOwner, b as html, C as insert, E as isServer, a as isStaticRender, Xt as lazy, ie as mount, u as onCleanup, p as onMount, _ as provide, ne as reconcile, h as renderStatic, T as resource, d as runWithOwner, e as signal, ee as store, zt as unsafeHTML, l as untrack, te as unwrap, y as useContext };
|