what-core 0.14.0 → 0.15.0
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/LICENSE +21 -0
- package/README.md +64 -38
- package/a11y.d.ts +128 -0
- package/data.d.ts +294 -0
- package/dist/a11y.js +510 -0
- package/dist/a11y.min.js +413 -0
- package/dist/actions.js +158 -0
- package/dist/actions.min.js +112 -0
- package/dist/animation.js +481 -0
- package/dist/animation.min.js +295 -0
- package/dist/async.js +180 -0
- package/dist/async.min.js +134 -0
- package/dist/components.js +577 -0
- package/dist/components.min.js +413 -0
- package/dist/data.js +1212 -0
- package/dist/data.min.js +918 -0
- package/dist/diagnostics.js +187 -0
- package/dist/diagnostics.min.js +134 -0
- package/dist/dom.js +796 -0
- package/dist/dom.min.js +603 -0
- package/dist/entries/a11y.js +43 -0
- package/dist/entries/a11y.min.js +43 -0
- package/dist/entries/data.js +29 -0
- package/dist/entries/data.min.js +29 -0
- package/dist/entries/dom.js +45 -0
- package/dist/entries/dom.min.js +45 -0
- package/dist/entries/form.js +31 -0
- package/dist/entries/form.min.js +31 -0
- package/dist/entries/internal.js +123 -0
- package/dist/entries/internal.min.js +123 -0
- package/dist/entries/motion.js +23 -0
- package/dist/entries/motion.min.js +23 -0
- package/dist/entries/ui.js +25 -0
- package/dist/entries/ui.min.js +25 -0
- package/dist/env.js +5 -0
- package/dist/env.min.js +5 -0
- package/dist/errors.js +1518 -0
- package/dist/errors.min.js +548 -0
- package/dist/form.js +936 -0
- package/dist/form.min.js +703 -0
- package/dist/guardrails.js +84 -0
- package/dist/guardrails.min.js +55 -0
- package/dist/h.js +232 -0
- package/dist/h.min.js +171 -0
- package/dist/head.js +241 -0
- package/dist/head.min.js +207 -0
- package/dist/helpers.js +126 -0
- package/dist/helpers.min.js +98 -0
- package/dist/hooks.js +255 -0
- package/dist/hooks.min.js +153 -0
- package/dist/hot.js +215 -0
- package/dist/hot.min.js +24 -0
- package/dist/hydration-data.js +495 -0
- package/dist/hydration-data.min.js +371 -0
- package/dist/import-changes.js +273 -0
- package/dist/import-changes.min.js +272 -0
- package/dist/index.js +95 -0
- package/dist/index.min.js +95 -227
- package/dist/jsx-dev-runtime.js +10 -0
- package/dist/jsx-dev-runtime.min.js +10 -1
- package/dist/jsx-runtime.js +27 -0
- package/dist/jsx-runtime.min.js +15 -1
- package/dist/live.js +54 -0
- package/dist/live.min.js +49 -0
- package/dist/markup-rules.js +250 -0
- package/dist/markup-rules.min.js +213 -0
- package/dist/reactive.js +3334 -0
- package/dist/reactive.min.js +2033 -0
- package/dist/render.js +4746 -0
- package/dist/render.min.js +2797 -1
- package/dist/scheduler.js +225 -0
- package/dist/scheduler.min.js +162 -0
- package/dist/selector.js +11 -0
- package/dist/selector.min.js +10 -0
- package/dist/server-context.js +148 -0
- package/dist/server-context.min.js +121 -0
- package/dist/skeleton.js +342 -0
- package/dist/skeleton.min.js +310 -0
- package/dist/store.js +72 -0
- package/dist/store.min.js +50 -0
- package/dist/testing.js +720 -0
- package/dist/testing.min.js +458 -1
- package/dist/vnode-adoption.js +19 -0
- package/dist/vnode-adoption.min.js +19 -0
- package/dist/vnode-renderer.js +61 -0
- package/dist/vnode-renderer.min.js +47 -0
- package/dom.d.ts +44 -0
- package/form.d.ts +218 -0
- package/hot.d.ts +35 -0
- package/index.d.ts +421 -736
- package/internal.d.ts +284 -0
- package/jsx-runtime.d.ts +160 -137
- package/markup-rules.d.ts +83 -0
- package/motion.d.ts +156 -0
- package/package.json +117 -3
- package/render.d.ts +278 -29
- package/src/a11y.js +64 -59
- package/src/actions.js +226 -0
- package/src/animation.js +105 -57
- package/src/async.js +259 -0
- package/src/components.js +495 -144
- package/src/data.js +1410 -1159
- package/src/diagnostics.js +263 -0
- package/src/dom.js +1159 -872
- package/src/entries/a11y.js +24 -0
- package/src/entries/data.js +17 -0
- package/src/entries/dom.js +29 -0
- package/src/entries/form.js +16 -0
- package/src/entries/internal.js +63 -0
- package/src/entries/motion.js +13 -0
- package/src/entries/ui.js +13 -0
- package/src/env-development.js +12 -0
- package/src/env.js +33 -0
- package/src/errors.js +1144 -168
- package/src/form.js +723 -225
- package/src/guardrails.js +38 -126
- package/src/h.js +227 -152
- package/src/head.js +189 -19
- package/src/helpers.js +47 -75
- package/src/hooks.js +233 -248
- package/src/hot.js +316 -0
- package/src/hydration-data.js +859 -16
- package/src/import-changes.js +156 -0
- package/src/index.js +38 -188
- package/src/jsx-dev-runtime.js +7 -14
- package/src/jsx-runtime.js +25 -9
- package/src/live.js +80 -0
- package/src/markup-rules.js +387 -0
- package/src/reactive.js +4400 -862
- package/src/render.js +6502 -2570
- package/src/scheduler.js +56 -21
- package/src/selector.js +31 -0
- package/src/server-context.js +252 -22
- package/src/skeleton.js +22 -12
- package/src/store.js +17 -31
- package/src/testing.js +389 -63
- package/src/vnode-adoption.js +48 -0
- package/src/vnode-renderer.js +114 -0
- package/testing.d.ts +81 -1
- package/ui.d.ts +20 -0
- package/dist/chunk-6YOUZ6T4.min.js +0 -1
- package/dist/chunk-FN6HXME3.min.js +0 -11
- package/dist/chunk-VKZY7JPN.min.js +0 -1
- package/src/agent-context.js +0 -127
- package/src/warnings.js +0 -193
package/dist/dom.min.js
ADDED
|
@@ -0,0 +1,603 @@
|
|
|
1
|
+
// src/dom.js
|
|
2
|
+
import { effect as te, untrack as U, createRoot as ne, getOwner as k, onCleanup as re, _currentComponent as oe, _serverComponentOwner as ie, _enterFrame as ue, _exitFrame as fe, _isDisposed as se, _tracking as ce, runWithOwner as le, _runOwned as ae } from "./reactive.min.js";
|
|
3
|
+
import { _renderComponent as de, _region as j, _signalKeyed as pe, _listFragment as _e, _valuesToNodes as me, _toFunctionComponent as he, _adoptDetached as ge, _isDomNode as v, _afterWalk as x, _installOptionsChanged as z, applyRef as be, setClassList as we, setStyle as ye, _writeClass as $e } from "./render.min.js";
|
|
4
|
+
import { REFUSED_ATTRS as Ce, URL_ATTRS as xe, ATTRIBUTE_VALUE_TYPES as W, isAriaAttr as Ze, isEnumeratedAttr as Ne, isUnsafeUrl as Oe, selectedOptions as Ee } from "./markup-rules.min.js";
|
|
5
|
+
import { isVNode as Pe, SVG_TAG as Se } from "./vnode-renderer.min.js";
|
|
6
|
+
var Ae = "http://www.w3.org/2000/svg";
|
|
7
|
+
function D(e) {
|
|
8
|
+
if (e.length <= 2) return !1;
|
|
9
|
+
let t = e.charCodeAt(0), n = e.charCodeAt(1);
|
|
10
|
+
return (t === 111 || t === 79) && (n === 110 || n === 78);
|
|
11
|
+
}
|
|
12
|
+
function Te(e, t) {
|
|
13
|
+
let n = e.toLowerCase();
|
|
14
|
+
return Ce.has(n) || xe.has(n) && Oe(t);
|
|
15
|
+
}
|
|
16
|
+
function tt(e) {
|
|
17
|
+
let t = null;
|
|
18
|
+
for (let n of e) {
|
|
19
|
+
let r = (
|
|
20
|
+
/** @type {any} */
|
|
21
|
+
n._rangeEnd
|
|
22
|
+
);
|
|
23
|
+
if (!r || r.parentNode !== n.parentNode) continue;
|
|
24
|
+
t || (t = e.slice());
|
|
25
|
+
let o = (
|
|
26
|
+
/** @type {any[]} */
|
|
27
|
+
t
|
|
28
|
+
);
|
|
29
|
+
for (let u = n.nextSibling; u && (o.push(u), u !== r); u = u.nextSibling)
|
|
30
|
+
;
|
|
31
|
+
}
|
|
32
|
+
return t || e;
|
|
33
|
+
}
|
|
34
|
+
function nt(e, t) {
|
|
35
|
+
return t = Re(t, "mount"), ne((n) => {
|
|
36
|
+
let r = Le(t, n);
|
|
37
|
+
t.textContent = "";
|
|
38
|
+
let o = me(e, t, [], !1);
|
|
39
|
+
ge(o);
|
|
40
|
+
for (let u = 0; u < o.length; u++) t.appendChild(o[u]);
|
|
41
|
+
return r;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function Re(e, t) {
|
|
45
|
+
let n = typeof e == "string" ? document.querySelector(e) : e;
|
|
46
|
+
if (n == null || typeof n.nodeType != "number")
|
|
47
|
+
throw Object.assign(new Error(`[what] ${t}() got no container element`), { code: "ERR_MOUNT_TARGET_MISSING" });
|
|
48
|
+
return n;
|
|
49
|
+
}
|
|
50
|
+
var b = /* @__PURE__ */ new WeakMap();
|
|
51
|
+
function Le(e, t) {
|
|
52
|
+
let n = b.get(e), r = () => {
|
|
53
|
+
b.get(e) === r ? (b.delete(e), t(), e.textContent = "") : t();
|
|
54
|
+
};
|
|
55
|
+
return b.set(e, r), n !== void 0 && n(), r;
|
|
56
|
+
}
|
|
57
|
+
function y(e, t, n) {
|
|
58
|
+
if (e == null || typeof e == "boolean" || typeof e == "symbol")
|
|
59
|
+
return document.createComment("");
|
|
60
|
+
if (typeof e == "string" || typeof e == "number")
|
|
61
|
+
return document.createTextNode(String(e));
|
|
62
|
+
if (v(e))
|
|
63
|
+
return e;
|
|
64
|
+
if (typeof e == "function")
|
|
65
|
+
return e._lazyChildren ? y(e(), t, n) : e._mapArray ? _e(e) : j(e, n);
|
|
66
|
+
if (Array.isArray(e)) {
|
|
67
|
+
let r = document.createDocumentFragment();
|
|
68
|
+
for (let o of e) {
|
|
69
|
+
let u = y(o, t, n);
|
|
70
|
+
u && r.appendChild(u);
|
|
71
|
+
}
|
|
72
|
+
return r;
|
|
73
|
+
}
|
|
74
|
+
return Pe(e) ? typeof e.key == "function" ? j(pe(e), n) : typeof e.tag == "function" ? ke(e, t, n) : e.tag === "__errorBoundary" || e.tag === "__portal" ? e.props.mount(e, t) : e.tag === "__suspense" ? e.props.boundary.mount(e, t) : ve(e, t, n) : document.createTextNode(String(e));
|
|
75
|
+
}
|
|
76
|
+
function rt() {
|
|
77
|
+
return oe();
|
|
78
|
+
}
|
|
79
|
+
function ot(e, t) {
|
|
80
|
+
let n = ie(e, t);
|
|
81
|
+
return n._parentCtx = t !== void 0 ? t : je(n), ue(n), n;
|
|
82
|
+
}
|
|
83
|
+
function je(e) {
|
|
84
|
+
for (let t = e.owner; t != null; t = t.owner)
|
|
85
|
+
if (t.Component !== void 0) return t;
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
function it(e) {
|
|
89
|
+
fe(e);
|
|
90
|
+
}
|
|
91
|
+
function ut(e, t) {
|
|
92
|
+
return le(e, t);
|
|
93
|
+
}
|
|
94
|
+
var $ = !1, O = null;
|
|
95
|
+
function ft(e) {
|
|
96
|
+
O = e;
|
|
97
|
+
}
|
|
98
|
+
var d = !1;
|
|
99
|
+
function st(e, t, n, r) {
|
|
100
|
+
let o = arguments.length > 3;
|
|
101
|
+
if (Ve(e, t)) {
|
|
102
|
+
let i = o ? () => {
|
|
103
|
+
let f = e[t];
|
|
104
|
+
return f === void 0 ? r : f;
|
|
105
|
+
} : () => e[t];
|
|
106
|
+
return i._forward = !0, i;
|
|
107
|
+
}
|
|
108
|
+
$ = !0;
|
|
109
|
+
let u = d;
|
|
110
|
+
d = n === 1;
|
|
111
|
+
try {
|
|
112
|
+
let i = e[t];
|
|
113
|
+
return o && i === void 0 ? r : i;
|
|
114
|
+
} finally {
|
|
115
|
+
$ = !1, d = u;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
var m = /* @__PURE__ */ Symbol.for("what-core.props.v1"), G = { value: !0 }, De = { enumerable: !1 };
|
|
119
|
+
function H(e) {
|
|
120
|
+
return Object.defineProperty(e, m, G);
|
|
121
|
+
}
|
|
122
|
+
function ct(e) {
|
|
123
|
+
return Object.getPrototypeOf(e) === null ? Object.defineProperty(Object.setPrototypeOf(e, Object.prototype), m, G) : (Object.prototype.propertyIsEnumerable.call(e, m) && Object.defineProperty(e, m, De), e);
|
|
124
|
+
}
|
|
125
|
+
function A(e) {
|
|
126
|
+
return e[m] > 0 || Object.getPrototypeOf(e) === null;
|
|
127
|
+
}
|
|
128
|
+
function Ve(e, t) {
|
|
129
|
+
if (e == null || typeof e != "object" || !A(e)) return !1;
|
|
130
|
+
let n = Object.getOwnPropertyDescriptor(e, t);
|
|
131
|
+
return n === void 0 ? e[m] === 2 : n.get !== void 0 && /** @type {any} */
|
|
132
|
+
n.get._lazy !== !0;
|
|
133
|
+
}
|
|
134
|
+
function Ie(e, t) {
|
|
135
|
+
if (e == null) return {};
|
|
136
|
+
let n = A(e);
|
|
137
|
+
if (!n && !t) return { ...e };
|
|
138
|
+
let r = {}, o = !1;
|
|
139
|
+
for (let u in e)
|
|
140
|
+
Object.hasOwn(e, u) && !(t && t.includes(u)) && Me(r, e, u, n) && (o = !0);
|
|
141
|
+
return o ? H(r) : r;
|
|
142
|
+
}
|
|
143
|
+
function Me(e, t, n, r) {
|
|
144
|
+
let o = r ? (
|
|
145
|
+
/** @type {PropertyDescriptor} */
|
|
146
|
+
Object.getOwnPropertyDescriptor(t, n).get
|
|
147
|
+
) : void 0;
|
|
148
|
+
return o ? (Object.defineProperty(e, n, { get: o, enumerable: !0, configurable: !0 }), !0) : (B(e, n, t[n]), !1);
|
|
149
|
+
}
|
|
150
|
+
function B(e, t, n) {
|
|
151
|
+
t in e ? Object.defineProperty(e, t, { value: n, writable: !0, enumerable: !0, configurable: !0 }) : e[t] = n;
|
|
152
|
+
}
|
|
153
|
+
function lt(e) {
|
|
154
|
+
let t = d;
|
|
155
|
+
d = !0;
|
|
156
|
+
try {
|
|
157
|
+
return e();
|
|
158
|
+
} finally {
|
|
159
|
+
d = t;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function at() {
|
|
163
|
+
let e = d;
|
|
164
|
+
return d = !1, e;
|
|
165
|
+
}
|
|
166
|
+
function Fe(e, t, n, r) {
|
|
167
|
+
let o = [null], u = (i, f) => {
|
|
168
|
+
o.length === 1 && !A(t) && H(t);
|
|
169
|
+
let c = o.push(f, void 0, 0, null) - 4, s = function() {
|
|
170
|
+
let _ = $;
|
|
171
|
+
return $ = !1, q(o, c, _);
|
|
172
|
+
};
|
|
173
|
+
s._lazy = !0, Object.defineProperty(t, i, { get: s, enumerable: !0, configurable: !0 });
|
|
174
|
+
};
|
|
175
|
+
if (n && (e._deferChildren ? t.children = n : u("children", n)), r) for (let i in r) u(i, r[i]);
|
|
176
|
+
return o.length === 1 ? null : (i) => {
|
|
177
|
+
o[0] = i;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
var V = {}, N = 3;
|
|
181
|
+
function q(e, t, n) {
|
|
182
|
+
let r = e[0], o = e[t + 1], u = e[t + 2];
|
|
183
|
+
if (u === N) return n ? o : o();
|
|
184
|
+
if (n)
|
|
185
|
+
return u !== 1 && (o = I(e[t], r !== null && k() === null ? r : null)), e[t + 1] = E(o) ? V : o, e[t + 2] = o?._forward ? N : 2, o;
|
|
186
|
+
if (u === 0) {
|
|
187
|
+
let i = () => I(e[t], r);
|
|
188
|
+
if (o = e[t + 1] = O === null ? i() : O(i), e[t + 2] = 1, o?._forward) return e[t + 2] = N, o();
|
|
189
|
+
}
|
|
190
|
+
if (o !== V && (r === null || !E(o))) return o;
|
|
191
|
+
if (e[t + 3] === null) {
|
|
192
|
+
let i = () => q(e, t, !0);
|
|
193
|
+
i._lazyChildren = !0, e[t + 3] = [i];
|
|
194
|
+
}
|
|
195
|
+
return e[t + 3];
|
|
196
|
+
}
|
|
197
|
+
function I(e, t) {
|
|
198
|
+
return t !== null ? ae(t, e) : U(e);
|
|
199
|
+
}
|
|
200
|
+
function E(e) {
|
|
201
|
+
return v(e) || Array.isArray(e) && e.some(E);
|
|
202
|
+
}
|
|
203
|
+
var Ue = /* @__PURE__ */ Symbol.for("what.navigation.signal.v1");
|
|
204
|
+
function dt(e) {
|
|
205
|
+
if (e == null) return !1;
|
|
206
|
+
let t = e[Ue];
|
|
207
|
+
return typeof t != "function" ? !1 : (t(e), !0);
|
|
208
|
+
}
|
|
209
|
+
var K = () => null;
|
|
210
|
+
function pt() {
|
|
211
|
+
K = Fe;
|
|
212
|
+
}
|
|
213
|
+
function ke(e, t, n) {
|
|
214
|
+
let { props: r, children: o } = e, u = he(e.tag), i = Ie(r);
|
|
215
|
+
o.length > 0 && B(i, "children", o.length === 1 ? o[0] : o);
|
|
216
|
+
let f = r && r._$lazyChildren, c = r && r._$slots, s = f || c ? K(u, i, f, c) : null;
|
|
217
|
+
return de(u, i, s, n);
|
|
218
|
+
}
|
|
219
|
+
function _t(e, t) {
|
|
220
|
+
let { container: n } = e.props, r = e.children;
|
|
221
|
+
if (!n)
|
|
222
|
+
return console.warn("[what] Portal: target container not found"), document.createComment("portal:empty");
|
|
223
|
+
let o = [];
|
|
224
|
+
for (let u of r) {
|
|
225
|
+
let i = y(u, n);
|
|
226
|
+
if (i) {
|
|
227
|
+
if (i.nodeType === 11)
|
|
228
|
+
for (let f = i.firstChild; f !== null; f = f.nextSibling) o.push(f);
|
|
229
|
+
else
|
|
230
|
+
o.push(i);
|
|
231
|
+
n.appendChild(i);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return re(() => {
|
|
235
|
+
for (let u of o)
|
|
236
|
+
u.parentNode && u.parentNode.removeChild(u);
|
|
237
|
+
}), document.createComment("portal");
|
|
238
|
+
}
|
|
239
|
+
function ve(e, t, n) {
|
|
240
|
+
let { tag: r, props: o, children: u } = e, i = n || Se.test(r), f = i ? document.createElementNS(Ae, r) : document.createElement(r);
|
|
241
|
+
for (let s in o)
|
|
242
|
+
s === "key" || s === "children" || (s === "ref" ? be(o.ref, f) : Z(f, s, o[s], i));
|
|
243
|
+
if (r === "noscript") return f;
|
|
244
|
+
let c = i && r !== "foreignObject";
|
|
245
|
+
for (let s = 0; s < u.length; s++) {
|
|
246
|
+
let _ = y(u[s], f, c);
|
|
247
|
+
_ && f.appendChild(_);
|
|
248
|
+
}
|
|
249
|
+
return f;
|
|
250
|
+
}
|
|
251
|
+
function ze(e, t, n) {
|
|
252
|
+
let r = e.tagName;
|
|
253
|
+
if (r === "OPTION" || r === "SELECT")
|
|
254
|
+
return h !== null ? h(e, r, t, n) : !1;
|
|
255
|
+
if (r === "INPUT" && t === "checked") {
|
|
256
|
+
let o = n == null ? void 0 : !!n;
|
|
257
|
+
e._$checked !== o && (e.checked = (e._$checked = o) === !0);
|
|
258
|
+
} else if (r === "INPUT" && t === "defaultChecked") {
|
|
259
|
+
if (e.defaultChecked = !!n, n && e.type === "radio" && e._$checked === void 0 && e.form)
|
|
260
|
+
for (let o of p(e.form, "elements")) o._$checked && o.name === e.name && (o.checked = !0);
|
|
261
|
+
} else {
|
|
262
|
+
if (t !== "value" && t !== "defaultValue" || (r === "INPUT" ? W.has(e.type) : r !== "TEXTAREA"))
|
|
263
|
+
return !1;
|
|
264
|
+
if (t === "defaultValue")
|
|
265
|
+
e.defaultValue = n == null ? "" : String(n);
|
|
266
|
+
else {
|
|
267
|
+
let o = n == null ? void 0 : String(n);
|
|
268
|
+
e._$value !== o && (e._$value = o, (e.type === "file" ? !o : o === void 0 || e.type !== "number" || e.validity.badInput || (e.value || NaN) != +o) && X(e, o ?? ""));
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return !0;
|
|
272
|
+
}
|
|
273
|
+
function X(e, t) {
|
|
274
|
+
let n = e._$seen, r = n === e.value;
|
|
275
|
+
e.value = t, e._$seen = r ? e.value : n;
|
|
276
|
+
}
|
|
277
|
+
var h = null;
|
|
278
|
+
function mt() {
|
|
279
|
+
h = T;
|
|
280
|
+
}
|
|
281
|
+
function ht(e) {
|
|
282
|
+
h === null && (e.tagName === "SELECT" || e.tagName === "OPTION") && (h = T);
|
|
283
|
+
}
|
|
284
|
+
function T(e, t, n, r) {
|
|
285
|
+
if (t === "OPTION")
|
|
286
|
+
if (n === "value")
|
|
287
|
+
r == null ? e.removeAttribute("value") : e.value = r, R(e);
|
|
288
|
+
else if (n === "selected" || n === "defaultSelected")
|
|
289
|
+
e.defaultSelected = !!r, C(e);
|
|
290
|
+
else return !1;
|
|
291
|
+
else if (n === "defaultValue") qe(e, r);
|
|
292
|
+
else if (n === "value") Y(e, r);
|
|
293
|
+
else return !1;
|
|
294
|
+
return !0;
|
|
295
|
+
}
|
|
296
|
+
function gt(e) {
|
|
297
|
+
if (!ce()) return;
|
|
298
|
+
e._$kept = !0;
|
|
299
|
+
let t = e.ownerDocument.defaultView || globalThis.window;
|
|
300
|
+
if (!(!t || t._$controlled)) {
|
|
301
|
+
t._$controlled = !0;
|
|
302
|
+
for (let n of ["input", "change", "compositionend", "reset"])
|
|
303
|
+
t.addEventListener(n, M, !0), t.addEventListener(n, M);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
function M(e) {
|
|
307
|
+
let t = e.composedPath()[0];
|
|
308
|
+
e.type !== "reset" && (e.isComposing || !t?._$kept || e.type !== "change" && (t.options || t.type === "checkbox" || t.type === "radio")) || (e.eventPhase === 1 ? setTimeout(P, 0, t) : queueMicrotask(() => P(t)));
|
|
309
|
+
}
|
|
310
|
+
function We(e, t) {
|
|
311
|
+
let n = e.target, r = e.type === "change", o = "selectionStart" in n && !n.files && !W.has(n.type);
|
|
312
|
+
e._$change ??= o ? n.value !== n._$seen : r, e._$change && t(e), o && (n._$seen = r && e.isTrusted ? void 0 : n.value, Ge(n));
|
|
313
|
+
}
|
|
314
|
+
function Ge(e) {
|
|
315
|
+
let t = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e), "value"), n = t?.set;
|
|
316
|
+
n === void 0 || Object.hasOwn(e, "value") || Object.defineProperty(e, "value", {
|
|
317
|
+
configurable: !0,
|
|
318
|
+
get: (
|
|
319
|
+
/** @type {PropertyDescriptor} */
|
|
320
|
+
t.get
|
|
321
|
+
),
|
|
322
|
+
set(r) {
|
|
323
|
+
n.call(this, r), this._$seen = void 0;
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
function P(e) {
|
|
328
|
+
if (e.localName === "form") {
|
|
329
|
+
for (let r of p(e, "elements")) r._$kept && P(r);
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
let t = e._$value;
|
|
333
|
+
if (t !== void 0 && (e._$select ? e._$select(e, t) : !e.files && e.value !== t && (e.type !== "number" || !e.validity.badInput && (e.value || NaN) != +t) && X(e, t)), e._$checked === void 0) return;
|
|
334
|
+
let n = e.type !== "radio" || !e.name ? [e] : e.form ? p(e.form, "elements") : e.getRootNode().querySelectorAll("input[type=radio]");
|
|
335
|
+
for (let r of n)
|
|
336
|
+
r._$kept && r._$checked !== void 0 && r.type === e.type && r.name === e.name && (r.checked = r._$checked);
|
|
337
|
+
}
|
|
338
|
+
function Y(e, t) {
|
|
339
|
+
if (t == null && e._$value === void 0) return;
|
|
340
|
+
Q = C, e._$value = t ?? void 0, e._$select = Y, z(R);
|
|
341
|
+
let n = e._$selectWrite = (e._$selectWrite || 0) + 1;
|
|
342
|
+
if (!g(e, t, "selected")) {
|
|
343
|
+
let r = () => e._$selectWrite === n && g(e, t, "selected");
|
|
344
|
+
x(r) || queueMicrotask(r);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
function g(e, t, n) {
|
|
348
|
+
let r = [...e.options], o = r.map((i) => i.value);
|
|
349
|
+
e._$marked = [r, o];
|
|
350
|
+
let u = Ee(o, t);
|
|
351
|
+
for (let i = 0; i < r.length; i++) r[i][n] !== u[i] && (r[i][n] = u[i]);
|
|
352
|
+
return n === "selected" && !e.multiple && !u.includes(!0) && (e.selectedIndex = -1), o.length > 0 && [t].flat().every((i) => o.includes(String(i)));
|
|
353
|
+
}
|
|
354
|
+
function C(e) {
|
|
355
|
+
let t = e.closest("select");
|
|
356
|
+
t !== null && J(t, !0);
|
|
357
|
+
}
|
|
358
|
+
function R(e, t) {
|
|
359
|
+
let n = e.localName;
|
|
360
|
+
if (t === 1 && n === "option" && e.hasAttribute("value")) return;
|
|
361
|
+
let r = n === "select" ? e : n === "optgroup" || n === "option" ? e.closest("select") : null;
|
|
362
|
+
r !== null && J(r, !1);
|
|
363
|
+
}
|
|
364
|
+
function J(e, t) {
|
|
365
|
+
if (e._$refollow !== void 0) {
|
|
366
|
+
e._$refollow ||= t;
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
e._$refollow = t;
|
|
370
|
+
let n = () => {
|
|
371
|
+
let r = e._$refollow;
|
|
372
|
+
e._$refollow = void 0, (r || He(e)) && Be(e);
|
|
373
|
+
};
|
|
374
|
+
x(n) || n();
|
|
375
|
+
}
|
|
376
|
+
function He(e) {
|
|
377
|
+
let t = e._$marked;
|
|
378
|
+
if (t === void 0) return !0;
|
|
379
|
+
let [n, r] = t, o = e.options;
|
|
380
|
+
if (o.length !== n.length) return !0;
|
|
381
|
+
for (let u = 0; u < n.length; u++)
|
|
382
|
+
if (o[u] !== n[u] || o[u].value !== r[u]) return !0;
|
|
383
|
+
return !1;
|
|
384
|
+
}
|
|
385
|
+
function Be(e) {
|
|
386
|
+
if (e._$value !== void 0) g(e, e._$value, "selected");
|
|
387
|
+
else if (e._$default !== void 0 && !e._$chosen && !e._$following) {
|
|
388
|
+
e._$following = !0;
|
|
389
|
+
let t = () => {
|
|
390
|
+
e._$following = !1, e._$value === void 0 && !e._$chosen && g(e, e._$default, "defaultSelected");
|
|
391
|
+
};
|
|
392
|
+
x(t) || t();
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
var Q = null;
|
|
396
|
+
function qe(e, t) {
|
|
397
|
+
if (t == null) return;
|
|
398
|
+
e._$default === void 0 && e.addEventListener("change", () => {
|
|
399
|
+
e._$chosen = !0;
|
|
400
|
+
}), e._$default = t, Q = C, z(R);
|
|
401
|
+
let n = () => {
|
|
402
|
+
e._$default === t && (g(e, t, "defaultSelected"), C(e));
|
|
403
|
+
};
|
|
404
|
+
n(), x(n) || queueMicrotask(n);
|
|
405
|
+
}
|
|
406
|
+
function bt(e, t, n) {
|
|
407
|
+
if (e.type !== "radio") {
|
|
408
|
+
let i = Ke(e);
|
|
409
|
+
i !== null && t.push(i);
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
let r = e.form !== null ? p(e.form, "elements") : e.ownerDocument.getElementsByName(e.name), o = [];
|
|
413
|
+
for (let i of r)
|
|
414
|
+
i.localName !== "input" || i.type !== "radio" || i.name !== e.name || i.form !== e.form || n.has(i) || (n.add(i), o.push(i));
|
|
415
|
+
if (o.length === 0 || o.every((i) => i.checked === i.hasAttribute("checked"))) return;
|
|
416
|
+
let u = w(o);
|
|
417
|
+
o.forEach((i, f) => {
|
|
418
|
+
i.checked !== u[f].checked && t.push([i, i.checked]);
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
function w(e) {
|
|
422
|
+
let t = e[0].ownerDocument, n = t.createElement("form"), r = e.map((o) => S(o, t));
|
|
423
|
+
return p(n, "append")(...r), p(n, "reset")(), r;
|
|
424
|
+
}
|
|
425
|
+
function S(e, t) {
|
|
426
|
+
let n = t.createElement(e.localName);
|
|
427
|
+
for (let r of e.getAttributeNames()) r !== "is" && n.setAttribute(r, e.getAttribute(r));
|
|
428
|
+
if (e.localName === "textarea") n.textContent = e.defaultValue;
|
|
429
|
+
else if (e.localName === "select") {
|
|
430
|
+
let r = null, o = null;
|
|
431
|
+
for (let u of e.options) {
|
|
432
|
+
let i = u.parentElement, f = n;
|
|
433
|
+
i !== e && i !== null && i.localName === "optgroup" && (i !== r && (r = i, o = n.appendChild(S(i, t))), f = o), f.appendChild(S(u, t)).textContent = u.text;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
return n;
|
|
437
|
+
}
|
|
438
|
+
function Ke(e) {
|
|
439
|
+
if (e.type === "file" || e.type === "image") return null;
|
|
440
|
+
if (e.tagName === "SELECT") {
|
|
441
|
+
let [t] = w([e]), n = [...e.options], r = n.map((u) => u.selected), o = t.options;
|
|
442
|
+
return r.some((u, i) => u !== o[i].selected) ? (e._$chosen = !0, [e, n, r]) : null;
|
|
443
|
+
}
|
|
444
|
+
return e.type === "checkbox" ? e.checked === e.hasAttribute("checked") ? null : e.checked !== w([e])[0].checked ? [e, e.checked] : null : e.value === (e.tagName === "TEXTAREA" ? e.defaultValue : e.getAttribute("value") ?? "") ? null : e.value !== w([e])[0].value ? [e, e.value] : null;
|
|
445
|
+
}
|
|
446
|
+
function wt(e) {
|
|
447
|
+
for (let [t, n, r] of e)
|
|
448
|
+
r !== void 0 ? (n.forEach((o, u) => {
|
|
449
|
+
r[u] || (o.selected = !1);
|
|
450
|
+
}), n.forEach((o, u) => {
|
|
451
|
+
r[u] && (o.selected = !0);
|
|
452
|
+
}), !t.multiple && !r.includes(!0) && (t.selectedIndex = -1)) : n === !1 ? t.checked = !1 : n !== !0 && t.value !== n && (t.value = n);
|
|
453
|
+
for (let [t, n] of e) n === !0 && (t.checked = !0);
|
|
454
|
+
}
|
|
455
|
+
function F(e, t) {
|
|
456
|
+
for (let n = e; n !== null; n = Object.getPrototypeOf(n)) {
|
|
457
|
+
let r = Object.getOwnPropertyDescriptor(n, t);
|
|
458
|
+
if (r !== void 0) return r.writable === !0 || r.set !== void 0;
|
|
459
|
+
}
|
|
460
|
+
return !1;
|
|
461
|
+
}
|
|
462
|
+
function Z(e, t, n, r) {
|
|
463
|
+
if (t !== "__proto__") {
|
|
464
|
+
if (t === "classList") {
|
|
465
|
+
we(e, n);
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
if (typeof n == "function" && !D(t) && t !== "ref") {
|
|
469
|
+
te(() => {
|
|
470
|
+
Z(e, t, n(), r);
|
|
471
|
+
});
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
if (D(t)) {
|
|
475
|
+
if (typeof n != "function" && n != null) return;
|
|
476
|
+
let o = t.slice(2), u = !1;
|
|
477
|
+
o.endsWith("Capture") && !o.endsWith("PointerCapture") && (o = o.slice(0, -7), u = !0);
|
|
478
|
+
let i = o.toLowerCase();
|
|
479
|
+
i === "doubleclick" && (i = "dblclick");
|
|
480
|
+
let f = u ? i + "_capture" : i, c = i === "change" ? ["input", i] : [i], s = e._events?.[f];
|
|
481
|
+
if (s && s._original === n) return;
|
|
482
|
+
if (s) for (let l of c) e.removeEventListener(l, s, u);
|
|
483
|
+
if (n == null) return;
|
|
484
|
+
e._events || (e._events = {});
|
|
485
|
+
let _ = k(), L = n._eventOpts || u || void 0, a = (l) => {
|
|
486
|
+
if (_ !== null && se(_)) {
|
|
487
|
+
for (let ee of c) e.removeEventListener(ee, a, L);
|
|
488
|
+
e._events[f] === a && delete e._events[f];
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
return l.nativeEvent || (l.nativeEvent = l), U(() => i === "change" ? We(l, a._handler) : a._handler(l));
|
|
492
|
+
};
|
|
493
|
+
a._handler = n, a._original = n, e._events[f] = a;
|
|
494
|
+
for (let l of c) e.addEventListener(l, a, L);
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
if (Te(t, n)) {
|
|
498
|
+
e.removeAttribute(t), typeof console < "u" && console.warn(`[what] Blocked unsafe URL in "${t}" attribute:`, n);
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
if (t === "className" || t === "class") {
|
|
502
|
+
$e(e, n, r);
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
if (t === "style") {
|
|
506
|
+
ye(e, n);
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
if (t === "dangerouslySetInnerHTML" || t === "innerHTML") {
|
|
510
|
+
if (t === "innerHTML" && !(n && typeof n == "object" && "__html" in n))
|
|
511
|
+
return;
|
|
512
|
+
let o = n?.__html ?? "";
|
|
513
|
+
e.innerHTML = o;
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
if (h = T, !ze(e, t, n)) {
|
|
517
|
+
if (n == null) {
|
|
518
|
+
if (F(e, t))
|
|
519
|
+
try {
|
|
520
|
+
e[t] = "";
|
|
521
|
+
} catch {
|
|
522
|
+
}
|
|
523
|
+
e.removeAttribute(t);
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
if (Ne(t)) {
|
|
527
|
+
e.setAttribute(t, typeof n == "boolean" ? String(n) : n);
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
if (typeof n == "boolean") {
|
|
531
|
+
n ? e.setAttribute(t, "") : e.removeAttribute(t);
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
if (r) {
|
|
535
|
+
n === !1 || n == null ? e.removeAttribute(t) : e.setAttribute(t, n === !0 ? "" : String(n));
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
F(e, t) ? e[t] = n : e.setAttribute(t, n);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
function p(e, t) {
|
|
543
|
+
let n = Reflect.get(Object.getPrototypeOf(e), t, e);
|
|
544
|
+
return typeof n == "function" ? n.bind(e) : n;
|
|
545
|
+
}
|
|
546
|
+
function yt(e, t) {
|
|
547
|
+
let n = [...p(e, "elements")], r = n.map((u) => [u._$value, u._$checked]), o = (u) => {
|
|
548
|
+
try {
|
|
549
|
+
u();
|
|
550
|
+
} catch (i) {
|
|
551
|
+
t(i);
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
o(p(e, "reset")), n.forEach((u, i) => {
|
|
555
|
+
let [f, c] = r[i];
|
|
556
|
+
f !== void 0 && o(() => u._$select ? u._$select(u, f) : u.value = f), c !== void 0 && o(() => {
|
|
557
|
+
u.checked = c;
|
|
558
|
+
});
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
export {
|
|
562
|
+
m as PROPS,
|
|
563
|
+
ot as _beginComponentSSR,
|
|
564
|
+
bt as _changedFields,
|
|
565
|
+
gt as _controlFields,
|
|
566
|
+
Me as _copyProp,
|
|
567
|
+
Ie as _copyProps,
|
|
568
|
+
it as _endComponentSSR,
|
|
569
|
+
p as _formMember,
|
|
570
|
+
dt as _handleNavigationSignal,
|
|
571
|
+
Fe as _installLazyChildren,
|
|
572
|
+
mt as _installSelects,
|
|
573
|
+
pt as _installVNodeLazyProps,
|
|
574
|
+
Ze as _isAriaAttr,
|
|
575
|
+
D as _isEventProp,
|
|
576
|
+
Ve as _isLiveProp,
|
|
577
|
+
A as _isOwnProps,
|
|
578
|
+
Te as _isUnsafeAttr,
|
|
579
|
+
tt as _liveRegionNodes,
|
|
580
|
+
H as _markProps,
|
|
581
|
+
Re as _mountTarget,
|
|
582
|
+
We as _onChange,
|
|
583
|
+
ct as _ownProps,
|
|
584
|
+
st as _place,
|
|
585
|
+
lt as _placeFlat,
|
|
586
|
+
yt as _resetForm,
|
|
587
|
+
wt as _restoreFields,
|
|
588
|
+
ut as _runInComponentSSR,
|
|
589
|
+
Q as _selectionKeeper,
|
|
590
|
+
ht as _selectsFor,
|
|
591
|
+
ze as _setFieldProp,
|
|
592
|
+
ft as _setOutsideRead,
|
|
593
|
+
B as _setOwnProp,
|
|
594
|
+
Z as _setVNodeProp,
|
|
595
|
+
P as _showControlled,
|
|
596
|
+
at as _takeFlat,
|
|
597
|
+
Le as _trackRoot,
|
|
598
|
+
F as _writableProp,
|
|
599
|
+
y as createDOM,
|
|
600
|
+
_t as createPortalDOM,
|
|
601
|
+
rt as getCurrentComponent,
|
|
602
|
+
nt as mount
|
|
603
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// src/entries/a11y.js
|
|
2
|
+
import {
|
|
3
|
+
useFocus,
|
|
4
|
+
useFocusRestore,
|
|
5
|
+
useFocusTrap,
|
|
6
|
+
FocusTrap,
|
|
7
|
+
announce,
|
|
8
|
+
announceAssertive,
|
|
9
|
+
SkipLink,
|
|
10
|
+
useAriaExpanded,
|
|
11
|
+
useAriaSelected,
|
|
12
|
+
useAriaChecked,
|
|
13
|
+
useRovingTabIndex,
|
|
14
|
+
VisuallyHidden,
|
|
15
|
+
LiveRegion,
|
|
16
|
+
useIds,
|
|
17
|
+
useDescribedBy,
|
|
18
|
+
useLabelledBy,
|
|
19
|
+
Keys,
|
|
20
|
+
onKey,
|
|
21
|
+
onKeys
|
|
22
|
+
} from "../a11y.js";
|
|
23
|
+
export {
|
|
24
|
+
FocusTrap,
|
|
25
|
+
Keys,
|
|
26
|
+
LiveRegion,
|
|
27
|
+
SkipLink,
|
|
28
|
+
VisuallyHidden,
|
|
29
|
+
announce,
|
|
30
|
+
announceAssertive,
|
|
31
|
+
onKey,
|
|
32
|
+
onKeys,
|
|
33
|
+
useAriaChecked,
|
|
34
|
+
useAriaExpanded,
|
|
35
|
+
useAriaSelected,
|
|
36
|
+
useDescribedBy,
|
|
37
|
+
useFocus,
|
|
38
|
+
useFocusRestore,
|
|
39
|
+
useFocusTrap,
|
|
40
|
+
useIds,
|
|
41
|
+
useLabelledBy,
|
|
42
|
+
useRovingTabIndex
|
|
43
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// src/entries/a11y.js
|
|
2
|
+
import {
|
|
3
|
+
useFocus as u,
|
|
4
|
+
useFocusRestore as n,
|
|
5
|
+
useFocusTrap as o,
|
|
6
|
+
FocusTrap as i,
|
|
7
|
+
announce as a,
|
|
8
|
+
announceAssertive as d,
|
|
9
|
+
SkipLink as r,
|
|
10
|
+
useAriaExpanded as c,
|
|
11
|
+
useAriaSelected as y,
|
|
12
|
+
useAriaChecked as l,
|
|
13
|
+
useRovingTabIndex as p,
|
|
14
|
+
VisuallyHidden as t,
|
|
15
|
+
LiveRegion as A,
|
|
16
|
+
useIds as F,
|
|
17
|
+
useDescribedBy as b,
|
|
18
|
+
useLabelledBy as k,
|
|
19
|
+
Keys as v,
|
|
20
|
+
onKey as x,
|
|
21
|
+
onKeys as K
|
|
22
|
+
} from "../a11y.min.js";
|
|
23
|
+
export {
|
|
24
|
+
i as FocusTrap,
|
|
25
|
+
v as Keys,
|
|
26
|
+
A as LiveRegion,
|
|
27
|
+
r as SkipLink,
|
|
28
|
+
t as VisuallyHidden,
|
|
29
|
+
a as announce,
|
|
30
|
+
d as announceAssertive,
|
|
31
|
+
x as onKey,
|
|
32
|
+
K as onKeys,
|
|
33
|
+
l as useAriaChecked,
|
|
34
|
+
c as useAriaExpanded,
|
|
35
|
+
y as useAriaSelected,
|
|
36
|
+
b as useDescribedBy,
|
|
37
|
+
u as useFocus,
|
|
38
|
+
n as useFocusRestore,
|
|
39
|
+
o as useFocusTrap,
|
|
40
|
+
F as useIds,
|
|
41
|
+
k as useLabelledBy,
|
|
42
|
+
p as useRovingTabIndex
|
|
43
|
+
};
|