@sylwellsoftware/fray 0.6.0 → 0.7.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/README.md +164 -3
- package/dist/Components/component.d.ts.map +1 -1
- package/dist/Components/layout/tabpanel/tab.d.ts +2 -0
- package/dist/Components/layout/tabpanel/tab.d.ts.map +1 -1
- package/dist/Components/layout/tabpanel/tabline.d.ts.map +1 -1
- package/dist/Components/layout/tabpanel/tabpanel.d.ts +9 -1
- package/dist/Components/layout/tabpanel/tabpanel.d.ts.map +1 -1
- package/dist/Components/lineinputs/checkbox/Checkbox.d.ts +0 -1
- package/dist/Components/lineinputs/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Components/lineinputs/radio.d.ts +51 -0
- package/dist/Components/lineinputs/radio.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2065 -841
- package/dist/index.js.map +1 -1
- package/dist/{jsx-dev-runtime-CqunwZ8j.js → jsx-dev-runtime-Kf1Dhu-y.js} +277 -252
- package/dist/jsx-dev-runtime-Kf1Dhu-y.js.map +1 -0
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/routing/RouteLink.d.ts +17 -0
- package/dist/routing/RouteLink.d.ts.map +1 -0
- package/dist/routing/RouteQuery.d.ts +18 -0
- package/dist/routing/RouteQuery.d.ts.map +1 -0
- package/dist/routing/RouteScope.d.ts +17 -0
- package/dist/routing/RouteScope.d.ts.map +1 -0
- package/dist/routing/RouteValue.d.ts +18 -0
- package/dist/routing/RouteValue.d.ts.map +1 -0
- package/dist/routing/navigationAdapter.d.ts +33 -0
- package/dist/routing/navigationAdapter.d.ts.map +1 -0
- package/dist/routing/route.d.ts +64 -0
- package/dist/routing/route.d.ts.map +1 -0
- package/dist/routing/router.d.ts +109 -0
- package/dist/routing/router.d.ts.map +1 -0
- package/dist/runtime.d.ts +5 -0
- package/dist/runtime.d.ts.map +1 -1
- package/package.json +3 -3
- package/styles/structural.css +166 -34
- package/themes/dark.css +13 -1
- package/themes/java/theme.css +14 -2
- package/themes/light.css +13 -1
- package/themes/minimal/theme.css +14 -2
- package/themes/shiny/theme.css +95 -87
- package/dist/jsx-dev-runtime-CqunwZ8j.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var he = Object.defineProperty;
|
|
2
|
+
var de = (e, t, n) => t in e ? he(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var a = (e, t, n) => de(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
const D = {
|
|
5
5
|
after: {
|
|
6
6
|
content: '""',
|
|
@@ -74,9 +74,9 @@ const D = {
|
|
|
74
74
|
let me = 1;
|
|
75
75
|
class Q {
|
|
76
76
|
constructor(t = `runtime-${me++}`) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
a(this, "id");
|
|
78
|
+
a(this, "cssFragments", /* @__PURE__ */ new Set());
|
|
79
|
+
a(this, "baseStyleMap", /* @__PURE__ */ new Map());
|
|
80
80
|
if (typeof t != "string") throw new TypeError("StyleRegistry id must be a string");
|
|
81
81
|
this.id = t;
|
|
82
82
|
}
|
|
@@ -90,11 +90,11 @@ class Q {
|
|
|
90
90
|
const r = typeof n == "string" ? [n] : n;
|
|
91
91
|
if (!Array.isArray(r))
|
|
92
92
|
throw new TypeError("Base style names must be a string or array");
|
|
93
|
-
for (const
|
|
94
|
-
if (!Object.hasOwn(D,
|
|
95
|
-
throw new Error(`Unknown Fray base style: ${String(
|
|
96
|
-
const
|
|
97
|
-
o.add(t.trim()), this.baseStyleMap.set(
|
|
93
|
+
for (const i of r) {
|
|
94
|
+
if (!Object.hasOwn(D, i))
|
|
95
|
+
throw new Error(`Unknown Fray base style: ${String(i)}`);
|
|
96
|
+
const s = i, o = this.baseStyleMap.get(s) ?? /* @__PURE__ */ new Set();
|
|
97
|
+
o.add(t.trim()), this.baseStyleMap.set(s, o);
|
|
98
98
|
}
|
|
99
99
|
return this;
|
|
100
100
|
}
|
|
@@ -122,12 +122,12 @@ class Q {
|
|
|
122
122
|
generateBaseStyleCSS() {
|
|
123
123
|
let t = "";
|
|
124
124
|
for (const [n, r] of this.baseStyleMap) {
|
|
125
|
-
const { properties:
|
|
126
|
-
t += U(n, o,
|
|
127
|
-
for (const [
|
|
125
|
+
const { properties: i, variants: s } = ge(D[n]), o = [...r];
|
|
126
|
+
t += U(n, o, i);
|
|
127
|
+
for (const [c, l] of Object.entries(s))
|
|
128
128
|
t += U(
|
|
129
|
-
`${n}${
|
|
130
|
-
o.map((u) => we(u,
|
|
129
|
+
`${n}${c}`,
|
|
130
|
+
o.map((u) => we(u, c)),
|
|
131
131
|
l
|
|
132
132
|
);
|
|
133
133
|
}
|
|
@@ -150,8 +150,8 @@ class Q {
|
|
|
150
150
|
const n = `style[${K}="${Se(this.id)}"]`;
|
|
151
151
|
let r = t.head.querySelector(n);
|
|
152
152
|
r == null && (r = t.createElement("style"), r.setAttribute(K, this.id), t.head.prepend(r));
|
|
153
|
-
const
|
|
154
|
-
return r.textContent !==
|
|
153
|
+
const i = this.generateCSS();
|
|
154
|
+
return r.textContent !== i && (r.textContent = i), r;
|
|
155
155
|
}
|
|
156
156
|
reset() {
|
|
157
157
|
this.cssFragments.clear(), this.baseStyleMap.clear();
|
|
@@ -164,20 +164,20 @@ const be = new Q("");
|
|
|
164
164
|
function ge(e) {
|
|
165
165
|
const t = {};
|
|
166
166
|
let n = {};
|
|
167
|
-
for (const [r,
|
|
167
|
+
for (const [r, i] of Object.entries(e))
|
|
168
168
|
if (r === "variants") {
|
|
169
|
-
if (typeof
|
|
169
|
+
if (typeof i != "object")
|
|
170
170
|
throw new TypeError("Base style variants must be declaration maps");
|
|
171
|
-
n =
|
|
172
|
-
} else if (typeof
|
|
173
|
-
t[r] =
|
|
171
|
+
n = i;
|
|
172
|
+
} else if (typeof i == "string")
|
|
173
|
+
t[r] = i;
|
|
174
174
|
else
|
|
175
175
|
throw new TypeError(`Base style property ${r} must be a string`);
|
|
176
176
|
return { properties: t, variants: n };
|
|
177
177
|
}
|
|
178
178
|
function U(e, t, n) {
|
|
179
179
|
if (t.length === 0 || Object.keys(n).length === 0) return "";
|
|
180
|
-
const r = Object.entries(n).map(([
|
|
180
|
+
const r = Object.entries(n).map(([i, s]) => ` ${i}: ${s};`).join(`
|
|
181
181
|
`);
|
|
182
182
|
return `/* ${e} */
|
|
183
183
|
${t.join(`,
|
|
@@ -202,18 +202,18 @@ function Ue(e) {
|
|
|
202
202
|
return X.add(t), t;
|
|
203
203
|
}
|
|
204
204
|
function We(e, t) {
|
|
205
|
-
if (
|
|
205
|
+
if (x(e), typeof t != "function")
|
|
206
206
|
throw new TypeError(`Service provider "${e.name}" requires a factory function`);
|
|
207
207
|
const n = Object.freeze({ key: e, create: t });
|
|
208
208
|
return ee.add(n), n;
|
|
209
209
|
}
|
|
210
210
|
class te {
|
|
211
211
|
constructor(t = []) {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
212
|
+
a(this, "providers", /* @__PURE__ */ new Map());
|
|
213
|
+
a(this, "instances", /* @__PURE__ */ new Map());
|
|
214
|
+
a(this, "creationOrder", []);
|
|
215
|
+
a(this, "resolving", []);
|
|
216
|
+
a(this, "disposed", !1);
|
|
217
217
|
if (!Array.isArray(t))
|
|
218
218
|
throw new TypeError("ServiceScope providers must be an array");
|
|
219
219
|
for (const n of t) {
|
|
@@ -226,21 +226,21 @@ class te {
|
|
|
226
226
|
return this.disposed;
|
|
227
227
|
}
|
|
228
228
|
has(t) {
|
|
229
|
-
return this.assertActive(),
|
|
229
|
+
return this.assertActive(), x(t), this.providers.has(t);
|
|
230
230
|
}
|
|
231
231
|
require(t) {
|
|
232
|
-
if (this.assertActive(),
|
|
232
|
+
if (this.assertActive(), x(t), this.instances.has(t)) return this.instances.get(t);
|
|
233
233
|
const n = this.providers.get(t);
|
|
234
234
|
if (n == null) throw new Error(`Service "${t.name}" is not registered`);
|
|
235
235
|
const r = this.resolving.indexOf(t);
|
|
236
236
|
if (r >= 0) {
|
|
237
|
-
const
|
|
238
|
-
throw new Error(`Circular service dependency: ${
|
|
237
|
+
const i = [...this.resolving.slice(r), t].map((s) => s.name).join(" -> ");
|
|
238
|
+
throw new Error(`Circular service dependency: ${i}`);
|
|
239
239
|
}
|
|
240
240
|
this.resolving.push(t);
|
|
241
241
|
try {
|
|
242
|
-
const
|
|
243
|
-
return this.instances.set(t,
|
|
242
|
+
const i = n.create(this);
|
|
243
|
+
return this.instances.set(t, i), this.creationOrder.push(t), i;
|
|
244
244
|
} finally {
|
|
245
245
|
this.resolving.pop();
|
|
246
246
|
}
|
|
@@ -252,10 +252,10 @@ class te {
|
|
|
252
252
|
for (const n of [...this.creationOrder].reverse()) {
|
|
253
253
|
const r = this.instances.get(n);
|
|
254
254
|
try {
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
} catch (
|
|
258
|
-
t.push(
|
|
255
|
+
const i = Ce(r);
|
|
256
|
+
i != null && i.call(r);
|
|
257
|
+
} catch (i) {
|
|
258
|
+
t.push(i);
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
if (this.instances.clear(), this.creationOrder.length = 0, this.resolving.length = 0, t.length === 1) throw t[0];
|
|
@@ -272,19 +272,19 @@ function ve(e = []) {
|
|
|
272
272
|
function Ee(e) {
|
|
273
273
|
return e != null && (typeof e == "object" || typeof e == "function") && X.has(e);
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function x(e) {
|
|
276
276
|
if (!Ee(e)) throw new TypeError("Expected a service key created by defineService()");
|
|
277
277
|
}
|
|
278
278
|
function Re(e) {
|
|
279
279
|
if (e == null || typeof e != "object" && typeof e != "function" || !ee.has(e))
|
|
280
280
|
throw new TypeError("Expected a service provider created by provideService()");
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Ce(e) {
|
|
283
283
|
if (e == null || typeof e != "object" && typeof e != "function") return null;
|
|
284
284
|
const t = Reflect.get(e, "dispose");
|
|
285
285
|
return typeof t == "function" ? t : null;
|
|
286
286
|
}
|
|
287
|
-
const
|
|
287
|
+
const je = /* @__PURE__ */ new Set([
|
|
288
288
|
"annotation-xml",
|
|
289
289
|
"color-profile",
|
|
290
290
|
"font-face",
|
|
@@ -294,31 +294,35 @@ const Te = /* @__PURE__ */ new Set([
|
|
|
294
294
|
"font-face-name",
|
|
295
295
|
"missing-glyph"
|
|
296
296
|
]);
|
|
297
|
-
class
|
|
297
|
+
class L {
|
|
298
298
|
constructor(t = {}, n = ye()) {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
299
|
+
a(this, "elementPrefix");
|
|
300
|
+
a(this, "elementNameOverrides");
|
|
301
|
+
a(this, "styleRegistry");
|
|
302
|
+
a(this, "services");
|
|
303
|
+
a(this, "router");
|
|
304
|
+
a(this, "routedRoots", /* @__PURE__ */ new WeakSet());
|
|
303
305
|
if (t == null || typeof t != "object" || Array.isArray(t))
|
|
304
306
|
throw new TypeError("FrayRuntime options must be an object");
|
|
305
307
|
const r = t.elementNames ?? {};
|
|
306
308
|
if (r == null || typeof r != "object" || Array.isArray(r))
|
|
307
309
|
throw new TypeError("Fray elementNames must be an object");
|
|
308
|
-
const
|
|
309
|
-
|
|
310
|
-
const
|
|
311
|
-
if (
|
|
310
|
+
const i = r.prefix === void 0 ? "fray" : r.prefix;
|
|
311
|
+
i !== null && P(i, "Fray element prefix");
|
|
312
|
+
const s = r.overrides ?? {};
|
|
313
|
+
if (s == null || typeof s != "object" || Array.isArray(s))
|
|
312
314
|
throw new TypeError("Fray element-name overrides must be an object");
|
|
313
|
-
for (const [o,
|
|
314
|
-
P(o, "Fray component host name"), Z(
|
|
315
|
-
if (this.elementPrefix =
|
|
315
|
+
for (const [o, c] of Object.entries(s))
|
|
316
|
+
P(o, "Fray component host name"), Z(c);
|
|
317
|
+
if (this.elementPrefix = i, this.elementNameOverrides = Object.freeze({ ...s }), this.styleRegistry = n, this.services = t.services ?? ve(), !(this.services instanceof te))
|
|
316
318
|
throw new TypeError("Fray services must be a ServiceScope");
|
|
319
|
+
if (this.router = t.router ?? null, this.router != null && (typeof this.router != "object" || typeof this.router.openScope != "function" || typeof this.router.completeScope != "function"))
|
|
320
|
+
throw new TypeError("Fray router must be a BrowserRouter");
|
|
317
321
|
}
|
|
318
322
|
resolveElementName(t, n = null) {
|
|
319
323
|
P(t, "Fray component host name");
|
|
320
|
-
const
|
|
321
|
-
return Z(
|
|
324
|
+
const i = this.elementNameOverrides[t] ?? (this.elementPrefix == null ? n ?? t : `${this.elementPrefix}-${t}`);
|
|
325
|
+
return Z(i), i;
|
|
322
326
|
}
|
|
323
327
|
resolveHostSelector(t, n, r = null) {
|
|
324
328
|
if (typeof t != "string") throw new TypeError("Host selector must be a string");
|
|
@@ -333,7 +337,15 @@ class M {
|
|
|
333
337
|
return r._setRuntime(this), r;
|
|
334
338
|
}
|
|
335
339
|
mount(t, n, r = null) {
|
|
336
|
-
|
|
340
|
+
t._setRuntime(this);
|
|
341
|
+
let i = null;
|
|
342
|
+
this.router != null && !this.routedRoots.has(t) && (this.routedRoots.add(t), i = this.router.openScope(this.router.root, t), t.onCleanup(i));
|
|
343
|
+
try {
|
|
344
|
+
t.mount(n, r), this.router != null && i != null && this.router.completeScope(this.router.root, t);
|
|
345
|
+
} catch (s) {
|
|
346
|
+
throw i == null || i(), s;
|
|
347
|
+
}
|
|
348
|
+
return t;
|
|
337
349
|
}
|
|
338
350
|
registerStyles(t) {
|
|
339
351
|
if (t == null || typeof t.registerStyles != "function")
|
|
@@ -345,18 +357,18 @@ class M {
|
|
|
345
357
|
}
|
|
346
358
|
}
|
|
347
359
|
function Ze(e = {}) {
|
|
348
|
-
return new
|
|
360
|
+
return new L(e);
|
|
349
361
|
}
|
|
350
|
-
const W = new
|
|
362
|
+
const W = new L({}, be);
|
|
351
363
|
function P(e, t) {
|
|
352
364
|
if (typeof e != "string" || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))
|
|
353
365
|
throw new TypeError(`${t} must be a lowercase kebab-case name`);
|
|
354
366
|
}
|
|
355
367
|
function Z(e) {
|
|
356
|
-
if (P(e, "Fray element name"), !e.includes("-") ||
|
|
368
|
+
if (P(e, "Fray element name"), !e.includes("-") || je.has(e))
|
|
357
369
|
throw new TypeError(`Fray element name must be a non-reserved name containing a hyphen: ${e}`);
|
|
358
370
|
}
|
|
359
|
-
const A = Symbol.for("@sylwellsoftware/fray.Fragment"), ne = /* @__PURE__ */ new WeakSet(),
|
|
371
|
+
const A = Symbol.for("@sylwellsoftware/fray.Fragment"), ne = /* @__PURE__ */ new WeakSet(), Te = /* @__PURE__ */ new Set([
|
|
360
372
|
"allowFullScreen",
|
|
361
373
|
"async",
|
|
362
374
|
"autoFocus",
|
|
@@ -405,43 +417,45 @@ function O(e, t = null, ...n) {
|
|
|
405
417
|
if (typeof r != "object" || Array.isArray(r))
|
|
406
418
|
throw new TypeError("VNode props must be an object or null");
|
|
407
419
|
const {
|
|
408
|
-
children:
|
|
409
|
-
key:
|
|
420
|
+
children: i,
|
|
421
|
+
key: s = null,
|
|
410
422
|
...o
|
|
411
423
|
} = r;
|
|
412
424
|
return {
|
|
413
425
|
type: e,
|
|
414
|
-
key:
|
|
426
|
+
key: s,
|
|
415
427
|
props: {
|
|
416
428
|
...o,
|
|
417
|
-
children: re([
|
|
429
|
+
children: re([i, n])
|
|
418
430
|
}
|
|
419
431
|
};
|
|
420
432
|
}
|
|
421
433
|
function Ge(e, ...t) {
|
|
422
|
-
return e.reduce((n, r,
|
|
434
|
+
return e.reduce((n, r, i) => n + r + String(t[i] ?? ""), "");
|
|
423
435
|
}
|
|
424
|
-
const
|
|
436
|
+
const d = class d {
|
|
425
437
|
constructor(t = {}) {
|
|
426
|
-
|
|
427
|
-
|
|
438
|
+
a(this, "props");
|
|
439
|
+
a(this, "dom", null);
|
|
428
440
|
/** @internal */
|
|
429
|
-
|
|
441
|
+
a(this, "_rendered", null);
|
|
430
442
|
/** @internal */
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
443
|
+
a(this, "_childComponents", /* @__PURE__ */ new Set());
|
|
444
|
+
a(this, "initialized", !1);
|
|
445
|
+
a(this, "mounted", !1);
|
|
446
|
+
a(this, "destroyed", !1);
|
|
447
|
+
a(this, "updating", !1);
|
|
448
|
+
a(this, "updateRequested", !1);
|
|
449
|
+
a(this, "cleanupFunctions", /* @__PURE__ */ new Set());
|
|
450
|
+
a(this, "watched", /* @__PURE__ */ new Map());
|
|
451
|
+
a(this, "renderReadSubscriptions", /* @__PURE__ */ new Map());
|
|
452
|
+
a(this, "collectingRenderReads", null);
|
|
441
453
|
/** @internal */
|
|
442
|
-
|
|
454
|
+
a(this, "_runtime", W);
|
|
455
|
+
/** @internal Route lineage inherited by nested routed components. */
|
|
456
|
+
a(this, "_routeContext", null);
|
|
443
457
|
/** JSX component for this instance's runtime-configured custom host. */
|
|
444
|
-
|
|
458
|
+
a(this, "Host", ({
|
|
445
459
|
children: t = [],
|
|
446
460
|
...n
|
|
447
461
|
}) => this.host(n, t));
|
|
@@ -451,7 +465,7 @@ const h = class h {
|
|
|
451
465
|
}
|
|
452
466
|
static new(...t) {
|
|
453
467
|
const n = new this(...t);
|
|
454
|
-
if (!(n instanceof
|
|
468
|
+
if (!(n instanceof d))
|
|
455
469
|
throw new TypeError("Component.new() requires a Component constructor");
|
|
456
470
|
return n.mount();
|
|
457
471
|
}
|
|
@@ -461,11 +475,11 @@ const h = class h {
|
|
|
461
475
|
static registerStyles(t = W, n = /* @__PURE__ */ new Set()) {
|
|
462
476
|
if (n.has(this)) return;
|
|
463
477
|
n.add(this);
|
|
464
|
-
const r = this.hostName ?? null,
|
|
465
|
-
this.css && t.styleRegistry.registerCSS(r == null ? this.css : t.resolveHostCSS(this.css, r,
|
|
466
|
-
const
|
|
467
|
-
for (const [o,
|
|
468
|
-
t.styleRegistry.registerBaseStyle(r == null ? o : t.resolveHostSelector(o, r,
|
|
478
|
+
const r = this.hostName ?? null, i = this.standaloneHostName ?? null;
|
|
479
|
+
this.css && t.styleRegistry.registerCSS(r == null ? this.css : t.resolveHostCSS(this.css, r, i));
|
|
480
|
+
const s = De(this.baseStyles);
|
|
481
|
+
for (const [o, c] of s)
|
|
482
|
+
t.styleRegistry.registerBaseStyle(r == null ? o : t.resolveHostSelector(o, r, i), c);
|
|
469
483
|
for (const o of this.dependencies ?? [])
|
|
470
484
|
o.registerStyles(t, n);
|
|
471
485
|
}
|
|
@@ -477,25 +491,36 @@ const h = class h {
|
|
|
477
491
|
}
|
|
478
492
|
/** Render this component's configured custom host element. */
|
|
479
493
|
host(t = null, ...n) {
|
|
480
|
-
const r = this.constructor,
|
|
481
|
-
if (
|
|
494
|
+
const r = this.constructor, i = r.hostName;
|
|
495
|
+
if (i == null)
|
|
482
496
|
throw new Error(`${this.constructor.name} does not declare a custom host name`);
|
|
483
497
|
return O(this._runtime.resolveElementName(
|
|
484
|
-
|
|
498
|
+
i,
|
|
485
499
|
r.standaloneHostName
|
|
486
500
|
), {
|
|
487
501
|
...t,
|
|
488
|
-
"data-fray-component":
|
|
502
|
+
"data-fray-component": i
|
|
489
503
|
}, ...n);
|
|
490
504
|
}
|
|
491
505
|
/** @internal Assign an immutable application runtime before initialization or mounting. */
|
|
492
506
|
_setRuntime(t) {
|
|
493
|
-
|
|
507
|
+
var n;
|
|
508
|
+
if (!(t instanceof L))
|
|
494
509
|
throw new TypeError("Component runtime must be a FrayRuntime");
|
|
495
510
|
if (t === this._runtime) return this;
|
|
496
511
|
if (this.initialized || this.mounted || this._rendered != null)
|
|
497
512
|
throw new Error("Cannot change a component runtime after initialization");
|
|
498
|
-
return this._runtime = t, this;
|
|
513
|
+
return this._runtime = t, this._routeContext == null && (this._routeContext = ((n = t.router) == null ? void 0 : n.root) ?? null), this;
|
|
514
|
+
}
|
|
515
|
+
/** @internal Assign contextual route lineage before initialization. */
|
|
516
|
+
_setRouteContext(t) {
|
|
517
|
+
if (this.initialized || this.mounted || this._rendered != null)
|
|
518
|
+
throw new Error("Cannot change a component route context after initialization");
|
|
519
|
+
return this._routeContext = t, this;
|
|
520
|
+
}
|
|
521
|
+
/** @internal Route lineage inherited by component children. */
|
|
522
|
+
_routeContextForChildren() {
|
|
523
|
+
return this._routeContext;
|
|
499
524
|
}
|
|
500
525
|
mount(t = null, n = null) {
|
|
501
526
|
if (this.destroyed) throw new Error("Cannot mount a destroyed component");
|
|
@@ -522,7 +547,7 @@ const h = class h {
|
|
|
522
547
|
} finally {
|
|
523
548
|
this.collectingRenderReads = null;
|
|
524
549
|
}
|
|
525
|
-
this._rendered =
|
|
550
|
+
this._rendered = M(this._rendered, r, this), this.dom = ae(this._rendered), this.reconcileRenderReads(n), this.afterUpdate(this.dom);
|
|
526
551
|
} while (this.updateRequested && !this.destroyed);
|
|
527
552
|
} finally {
|
|
528
553
|
this.updating = !1;
|
|
@@ -543,8 +568,8 @@ const h = class h {
|
|
|
543
568
|
if (n == null || typeof n.subscribe != "function")
|
|
544
569
|
throw new TypeError("watch requires emitter-like values");
|
|
545
570
|
if (this.watched.has(n)) continue;
|
|
546
|
-
const r = n.subscribe(({ event:
|
|
547
|
-
this.mounted && !this.destroyed && this.update(
|
|
571
|
+
const r = n.subscribe(({ event: i }) => {
|
|
572
|
+
this.mounted && !this.destroyed && this.update(i);
|
|
548
573
|
}, { emitCurrent: !1 });
|
|
549
574
|
this.watched.set(n, r), this.onCleanup(() => {
|
|
550
575
|
r(), this.watched.delete(n);
|
|
@@ -589,14 +614,14 @@ const h = class h {
|
|
|
589
614
|
);
|
|
590
615
|
return this._runtime.services.require(t);
|
|
591
616
|
}
|
|
592
|
-
listen(t, n, r,
|
|
617
|
+
listen(t, n, r, i) {
|
|
593
618
|
if (t == null || typeof t.addEventListener != "function")
|
|
594
619
|
throw new TypeError("listen target must be an EventTarget");
|
|
595
|
-
const
|
|
596
|
-
return t.addEventListener(n,
|
|
620
|
+
const s = r;
|
|
621
|
+
return t.addEventListener(n, s, i), this.onCleanup(() => t.removeEventListener(n, s, i)), this;
|
|
597
622
|
}
|
|
598
623
|
registerChild(t) {
|
|
599
|
-
if (!(t instanceof
|
|
624
|
+
if (!(t instanceof d))
|
|
600
625
|
throw new TypeError("registerChild requires a Component");
|
|
601
626
|
return this._childComponents.add(t), t;
|
|
602
627
|
}
|
|
@@ -627,27 +652,27 @@ const h = class h {
|
|
|
627
652
|
t.has(n) || (r(), this.renderReadSubscriptions.delete(n));
|
|
628
653
|
for (const n of t) {
|
|
629
654
|
if (this.watched.has(n) || this.renderReadSubscriptions.has(n)) continue;
|
|
630
|
-
const r = n.subscribe(({ event:
|
|
631
|
-
this.mounted && !this.destroyed && this.update(
|
|
655
|
+
const r = n.subscribe(({ event: i }) => {
|
|
656
|
+
this.mounted && !this.destroyed && this.update(i);
|
|
632
657
|
}, { emitCurrent: !1 });
|
|
633
658
|
this.renderReadSubscriptions.set(n, r);
|
|
634
659
|
}
|
|
635
660
|
}
|
|
636
661
|
};
|
|
637
|
-
|
|
638
|
-
let m =
|
|
662
|
+
a(d, "dependencies", []), a(d, "requiredServices", []), a(d, "css", ""), a(d, "hostName", null), a(d, "standaloneHostName", null);
|
|
663
|
+
let m = d;
|
|
639
664
|
function R(e) {
|
|
640
665
|
return Array.isArray(e) ? O(A, null, e) : e == null || typeof e == "boolean" ? O(A) : e;
|
|
641
666
|
}
|
|
642
667
|
function re(e) {
|
|
643
668
|
const t = [], n = (r) => {
|
|
644
669
|
if (Array.isArray(r))
|
|
645
|
-
for (const
|
|
670
|
+
for (const i of r) n(i);
|
|
646
671
|
else r != null && typeof r != "boolean" && t.push(r);
|
|
647
672
|
};
|
|
648
673
|
return n(e), t;
|
|
649
674
|
}
|
|
650
|
-
function
|
|
675
|
+
function C(e, t) {
|
|
651
676
|
if (typeof e == "string" || typeof e == "number")
|
|
652
677
|
return {
|
|
653
678
|
kind: "text",
|
|
@@ -657,18 +682,18 @@ function j(e, t) {
|
|
|
657
682
|
owner: t
|
|
658
683
|
};
|
|
659
684
|
if (k(e)) {
|
|
660
|
-
const
|
|
661
|
-
if (Object.is(
|
|
685
|
+
const s = document.createComment("fray-emitter-start"), o = document.createComment("fray-emitter-end"), c = e.get();
|
|
686
|
+
if (Object.is(c, e))
|
|
662
687
|
throw new TypeError("A Fray emitter child cannot render itself");
|
|
663
688
|
const l = document.createDocumentFragment();
|
|
664
|
-
l.append(
|
|
665
|
-
const u =
|
|
689
|
+
l.append(s, o);
|
|
690
|
+
const u = C(R(c), t);
|
|
666
691
|
H(l, u, o);
|
|
667
692
|
const p = {
|
|
668
693
|
kind: "emitter",
|
|
669
694
|
key: null,
|
|
670
695
|
source: e,
|
|
671
|
-
start:
|
|
696
|
+
start: s,
|
|
672
697
|
end: o,
|
|
673
698
|
child: u,
|
|
674
699
|
unsubscribe: () => {
|
|
@@ -678,11 +703,11 @@ function j(e, t) {
|
|
|
678
703
|
return p.unsubscribe = e.subscribe(({ value: b }) => {
|
|
679
704
|
if (Object.is(b, e))
|
|
680
705
|
throw new TypeError("A Fray emitter child cannot render itself");
|
|
681
|
-
p.child =
|
|
706
|
+
p.child = M(p.child, R(b), t);
|
|
682
707
|
}, { emitCurrent: !1 }), p;
|
|
683
708
|
}
|
|
684
709
|
if (e instanceof m)
|
|
685
|
-
return e._setRuntime(t._runtime), e.mount(), t.registerChild(e), {
|
|
710
|
+
return e._setRuntime(t._runtime), e._setRouteContext(t._routeContextForChildren()), e.mount(), t.registerChild(e), {
|
|
686
711
|
kind: "component",
|
|
687
712
|
key: ce(e.props),
|
|
688
713
|
type: e.constructor,
|
|
@@ -694,32 +719,32 @@ function j(e, t) {
|
|
|
694
719
|
};
|
|
695
720
|
if (!y(e))
|
|
696
721
|
throw new TypeError(`Invalid Fray child: ${J(e)}`);
|
|
697
|
-
const { type: n, key: r = null, props:
|
|
722
|
+
const { type: n, key: r = null, props: i } = e;
|
|
698
723
|
if (n === A) {
|
|
699
|
-
const
|
|
724
|
+
const s = document.createComment("fray-fragment-start"), o = document.createComment("fray-fragment-end"), c = {
|
|
700
725
|
kind: "fragment",
|
|
701
726
|
key: r,
|
|
702
727
|
type: n,
|
|
703
|
-
start:
|
|
728
|
+
start: s,
|
|
704
729
|
end: o,
|
|
705
730
|
children: [],
|
|
706
731
|
owner: t
|
|
707
732
|
}, l = document.createDocumentFragment();
|
|
708
|
-
return l.append(
|
|
733
|
+
return l.append(s, o), c.children = $(
|
|
709
734
|
l,
|
|
710
735
|
[],
|
|
711
|
-
|
|
736
|
+
i.children,
|
|
712
737
|
t,
|
|
713
738
|
o,
|
|
714
|
-
|
|
715
|
-
),
|
|
739
|
+
s
|
|
740
|
+
), c;
|
|
716
741
|
}
|
|
717
742
|
if (typeof n == "string") {
|
|
718
|
-
const
|
|
743
|
+
const s = document.createElement(n), o = {
|
|
719
744
|
kind: "element",
|
|
720
745
|
key: r,
|
|
721
746
|
type: n,
|
|
722
|
-
node:
|
|
747
|
+
node: s,
|
|
723
748
|
props: {},
|
|
724
749
|
listeners: /* @__PURE__ */ new Map(),
|
|
725
750
|
liveProps: /* @__PURE__ */ new Map(),
|
|
@@ -728,45 +753,45 @@ function j(e, t) {
|
|
|
728
753
|
children: [],
|
|
729
754
|
owner: t
|
|
730
755
|
};
|
|
731
|
-
return oe(o,
|
|
756
|
+
return oe(o, i), o.children = $(s, [], i.children, t), o;
|
|
732
757
|
}
|
|
733
758
|
if (ue(n)) {
|
|
734
|
-
const
|
|
735
|
-
|
|
759
|
+
const s = i, o = Y(s), c = new n(o);
|
|
760
|
+
c._setRuntime(t._runtime), c._setRouteContext(t._routeContextForChildren());
|
|
736
761
|
const l = {
|
|
737
762
|
kind: "component",
|
|
738
763
|
key: r,
|
|
739
764
|
type: n,
|
|
740
|
-
instance:
|
|
765
|
+
instance: c,
|
|
741
766
|
prebuilt: !1,
|
|
742
767
|
props: o,
|
|
743
768
|
liveProps: /* @__PURE__ */ new Map(),
|
|
744
769
|
owner: t
|
|
745
770
|
};
|
|
746
|
-
return
|
|
771
|
+
return se(l, s), c.mount(), t.registerChild(c), l;
|
|
747
772
|
}
|
|
748
773
|
if (typeof n == "function") {
|
|
749
|
-
const
|
|
774
|
+
const s = n, o = i, c = Y(o), l = R(s(c)), u = {
|
|
750
775
|
kind: "function",
|
|
751
776
|
key: r,
|
|
752
|
-
type:
|
|
753
|
-
props:
|
|
777
|
+
type: s,
|
|
778
|
+
props: c,
|
|
754
779
|
sourceProps: o,
|
|
755
780
|
liveProps: /* @__PURE__ */ new Map(),
|
|
756
|
-
child:
|
|
781
|
+
child: C(l, t),
|
|
757
782
|
owner: t
|
|
758
783
|
};
|
|
759
784
|
return Oe(u), u;
|
|
760
785
|
}
|
|
761
786
|
throw new TypeError(`Unsupported vnode type: ${J(n)}`);
|
|
762
787
|
}
|
|
763
|
-
function
|
|
764
|
-
if (e == null) return
|
|
765
|
-
if (le(e, t)) return
|
|
766
|
-
const r =
|
|
767
|
-
return
|
|
788
|
+
function M(e, t, n) {
|
|
789
|
+
if (e == null) return C(t, n);
|
|
790
|
+
if (le(e, t)) return ie(e, t, n);
|
|
791
|
+
const r = C(t, n), i = ae(e), s = (i == null ? void 0 : i.parentNode) ?? null;
|
|
792
|
+
return s && H(s, r, i), g(e, !0), r;
|
|
768
793
|
}
|
|
769
|
-
function
|
|
794
|
+
function ie(e, t, n) {
|
|
770
795
|
return e.kind === "text" ? (typeof t != "string" && typeof t != "number" || Object.is(e.value, t) || (e.value = t, e.node.data = String(t)), e) : e.kind === "emitter" ? (!k(t) || e.source !== t, e) : e.kind === "component" ? (t instanceof m || y(t) && Ae(e, t.props), e) : y(t) ? e.kind === "function" ? ($e(e, t.props), e) : e.kind === "fragment" ? (e.children = $(
|
|
771
796
|
e.start.parentNode,
|
|
772
797
|
e.children,
|
|
@@ -784,232 +809,232 @@ function se(e, t, n) {
|
|
|
784
809
|
function Y(e) {
|
|
785
810
|
return Object.fromEntries(Object.entries(e).map(([t, n]) => [
|
|
786
811
|
t,
|
|
787
|
-
|
|
812
|
+
j(n) ? n.emitter.get() : n
|
|
788
813
|
]));
|
|
789
814
|
}
|
|
790
|
-
function
|
|
791
|
-
|
|
815
|
+
function se(e, t) {
|
|
816
|
+
q(e.liveProps, t, (n, r) => {
|
|
792
817
|
e.props = { ...e.props, [n]: r }, e.instance.setProps(e.props);
|
|
793
818
|
}), e.props = V(e.liveProps, t), e.instance.setProps(e.props);
|
|
794
819
|
}
|
|
795
820
|
function Ae(e, t) {
|
|
796
|
-
|
|
821
|
+
se(e, t);
|
|
797
822
|
}
|
|
798
823
|
function Oe(e) {
|
|
799
|
-
|
|
800
|
-
e.props = { ...e.props, [t]: n },
|
|
824
|
+
q(e.liveProps, e.sourceProps, (t, n) => {
|
|
825
|
+
e.props = { ...e.props, [t]: n }, z(e);
|
|
801
826
|
}), e.props = V(e.liveProps, e.sourceProps);
|
|
802
827
|
}
|
|
803
828
|
function $e(e, t) {
|
|
804
|
-
e.sourceProps = t,
|
|
805
|
-
e.props = { ...e.props, [n]: r },
|
|
806
|
-
}), e.props = V(e.liveProps, t),
|
|
829
|
+
e.sourceProps = t, q(e.liveProps, t, (n, r) => {
|
|
830
|
+
e.props = { ...e.props, [n]: r }, z(e);
|
|
831
|
+
}), e.props = V(e.liveProps, t), z(e);
|
|
807
832
|
}
|
|
808
|
-
function
|
|
833
|
+
function z(e) {
|
|
809
834
|
const t = R(e.type(e.props));
|
|
810
|
-
e.child =
|
|
811
|
-
}
|
|
812
|
-
function
|
|
813
|
-
for (const [r,
|
|
814
|
-
const
|
|
815
|
-
|
|
816
|
-
}
|
|
817
|
-
for (const [r,
|
|
818
|
-
if (!
|
|
819
|
-
const
|
|
820
|
-
source:
|
|
821
|
-
value:
|
|
835
|
+
e.child = M(e.child, t, e.owner);
|
|
836
|
+
}
|
|
837
|
+
function q(e, t, n) {
|
|
838
|
+
for (const [r, i] of e) {
|
|
839
|
+
const s = t[r];
|
|
840
|
+
j(s) && s.emitter === i.source || (i.unsubscribe(), e.delete(r));
|
|
841
|
+
}
|
|
842
|
+
for (const [r, i] of Object.entries(t)) {
|
|
843
|
+
if (!j(i) || e.has(r)) continue;
|
|
844
|
+
const s = {
|
|
845
|
+
source: i.emitter,
|
|
846
|
+
value: i.emitter.get(),
|
|
822
847
|
unsubscribe: () => {
|
|
823
848
|
}
|
|
824
849
|
};
|
|
825
|
-
|
|
826
|
-
e.get(r) ===
|
|
827
|
-
}, { emitCurrent: !1 }), e.set(r,
|
|
850
|
+
s.unsubscribe = i.emitter.subscribe(({ value: o }) => {
|
|
851
|
+
e.get(r) === s && (s.value = o, n(r, o));
|
|
852
|
+
}, { emitCurrent: !1 }), e.set(r, s);
|
|
828
853
|
}
|
|
829
854
|
}
|
|
830
855
|
function V(e, t) {
|
|
831
856
|
return Object.fromEntries(Object.entries(t).map(([n, r]) => {
|
|
832
|
-
var
|
|
857
|
+
var i;
|
|
833
858
|
return [
|
|
834
859
|
n,
|
|
835
|
-
|
|
860
|
+
j(r) ? ((i = e.get(n)) == null ? void 0 : i.value) ?? r.emitter.get() : r
|
|
836
861
|
];
|
|
837
862
|
}));
|
|
838
863
|
}
|
|
839
|
-
function $(e, t, n, r,
|
|
864
|
+
function $(e, t, n, r, i = null, s = null) {
|
|
840
865
|
if (e == null) throw new Error("Cannot patch a detached fragment range");
|
|
841
|
-
const o = re(n),
|
|
866
|
+
const o = re(n), c = /* @__PURE__ */ new Map(), l = [];
|
|
842
867
|
for (const f of t)
|
|
843
|
-
f.key == null ? l.push(f) :
|
|
868
|
+
f.key == null ? l.push(f) : c.has(f.key) || c.set(f.key, f);
|
|
844
869
|
const u = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), b = [];
|
|
845
870
|
let pe = 0;
|
|
846
871
|
for (const f of o) {
|
|
847
|
-
const
|
|
848
|
-
if (
|
|
849
|
-
if (u.has(
|
|
850
|
-
u.add(
|
|
872
|
+
const h = E(f);
|
|
873
|
+
if (h != null) {
|
|
874
|
+
if (u.has(h)) throw new Error(`Duplicate sibling key: ${String(h)}`);
|
|
875
|
+
u.add(h);
|
|
851
876
|
}
|
|
852
|
-
const
|
|
853
|
-
|
|
877
|
+
const T = h == null ? l[pe++] : c.get(h);
|
|
878
|
+
T && le(T, f) ? (p.add(T), b.push(ie(T, f, r))) : b.push(C(f, r));
|
|
854
879
|
}
|
|
855
880
|
for (const f of t)
|
|
856
881
|
p.has(f) || g(f, !0);
|
|
857
|
-
let v =
|
|
882
|
+
let v = s ? s.nextSibling : e.firstChild;
|
|
858
883
|
for (const f of b)
|
|
859
|
-
for (const
|
|
860
|
-
|
|
884
|
+
for (const h of w(f))
|
|
885
|
+
h === v ? v = v.nextSibling : (e.insertBefore(h, v ?? i), v = h.nextSibling);
|
|
861
886
|
return b;
|
|
862
887
|
}
|
|
863
888
|
function oe(e, t) {
|
|
864
|
-
const { children: n, ...r } = t,
|
|
889
|
+
const { children: n, ...r } = t, i = e.props, s = /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(r)]);
|
|
865
890
|
for (const o of ["value", "checked"])
|
|
866
891
|
if (Object.hasOwn(r, o) && Object.hasOwn(r, `bind:${o}`))
|
|
867
892
|
throw new Error(`${o} and bind:${o} cannot be used together`);
|
|
868
|
-
for (const o of
|
|
869
|
-
const
|
|
870
|
-
if (
|
|
893
|
+
for (const o of s) {
|
|
894
|
+
const c = i[o], l = r[o];
|
|
895
|
+
if (Me(o))
|
|
871
896
|
ke(e, o, l);
|
|
872
897
|
else if (o === "ref")
|
|
873
|
-
|
|
874
|
-
else if (
|
|
875
|
-
Fe(e, o, l);
|
|
876
|
-
else if (T(l))
|
|
898
|
+
c !== l && _e(e, l);
|
|
899
|
+
else if (Le(o))
|
|
877
900
|
Ne(e, o, l);
|
|
901
|
+
else if (j(l))
|
|
902
|
+
Fe(e, o, l);
|
|
878
903
|
else {
|
|
879
904
|
const u = e.liveProps.get(o);
|
|
880
905
|
u && (u.unsubscribe(), e.liveProps.delete(o));
|
|
881
|
-
const p = (u == null ? void 0 : u.value) ??
|
|
906
|
+
const p = (u == null ? void 0 : u.value) ?? c;
|
|
882
907
|
Object.is(p, l) || S(e.node, o, p, l);
|
|
883
908
|
}
|
|
884
909
|
}
|
|
885
910
|
e.props = { ...r };
|
|
886
911
|
}
|
|
887
|
-
function
|
|
912
|
+
function Fe(e, t, n) {
|
|
888
913
|
const r = e.liveProps.get(t);
|
|
889
914
|
if ((r == null ? void 0 : r.source) === n.emitter) return;
|
|
890
915
|
r == null || r.unsubscribe();
|
|
891
|
-
const
|
|
892
|
-
S(e.node, t, (r == null ? void 0 : r.value) ?? e.props[t],
|
|
893
|
-
const
|
|
916
|
+
const i = n.emitter.get();
|
|
917
|
+
S(e.node, t, (r == null ? void 0 : r.value) ?? e.props[t], i);
|
|
918
|
+
const s = {
|
|
894
919
|
source: n.emitter,
|
|
895
|
-
value:
|
|
920
|
+
value: i,
|
|
896
921
|
unsubscribe: () => {
|
|
897
922
|
}
|
|
898
923
|
};
|
|
899
|
-
|
|
900
|
-
const
|
|
901
|
-
|
|
902
|
-
}, { emitCurrent: !1 }), e.liveProps.set(t,
|
|
924
|
+
s.unsubscribe = n.emitter.subscribe(({ value: o }) => {
|
|
925
|
+
const c = s.value;
|
|
926
|
+
s.value = o, Object.is(c, o) || S(e.node, t, c, o);
|
|
927
|
+
}, { emitCurrent: !1 }), e.liveProps.set(t, s);
|
|
903
928
|
}
|
|
904
929
|
function ke(e, t, n) {
|
|
905
|
-
const r = t.slice(5),
|
|
930
|
+
const r = t.slice(5), i = e.nativeBindings.get(t);
|
|
906
931
|
if (n == null) {
|
|
907
|
-
|
|
932
|
+
i && (i.unsubscribe(), e.node.removeEventListener(i.eventName, i.listener), e.nativeBindings.delete(t), S(e.node, r, i.value, void 0));
|
|
908
933
|
return;
|
|
909
934
|
}
|
|
910
|
-
if (
|
|
911
|
-
|
|
912
|
-
const
|
|
913
|
-
S(e.node, r,
|
|
914
|
-
const
|
|
935
|
+
if (qe(n, t), (i == null ? void 0 : i.source) === n) return;
|
|
936
|
+
i && (i.unsubscribe(), e.node.removeEventListener(i.eventName, i.listener)), Ve(e.node, r);
|
|
937
|
+
const s = He(e.node, r), o = n.get();
|
|
938
|
+
S(e.node, r, i == null ? void 0 : i.value, o);
|
|
939
|
+
const c = () => {
|
|
915
940
|
n.set(Reflect.get(e.node, r), `${t} changed`);
|
|
916
941
|
}, l = {
|
|
917
942
|
source: n,
|
|
918
943
|
value: o,
|
|
919
|
-
eventName:
|
|
920
|
-
listener:
|
|
944
|
+
eventName: s,
|
|
945
|
+
listener: c,
|
|
921
946
|
unsubscribe: () => {
|
|
922
947
|
}
|
|
923
948
|
};
|
|
924
949
|
l.unsubscribe = n.subscribe(({ value: u }) => {
|
|
925
950
|
const p = l.value;
|
|
926
951
|
l.value = u, Object.is(p, u) || S(e.node, r, p, u);
|
|
927
|
-
}, { emitCurrent: !1 }), e.node.addEventListener(
|
|
952
|
+
}, { emitCurrent: !1 }), e.node.addEventListener(s, c), e.nativeBindings.set(t, l);
|
|
928
953
|
}
|
|
929
|
-
function
|
|
930
|
-
const r = t.slice(2).toLowerCase(),
|
|
931
|
-
if (
|
|
954
|
+
function Ne(e, t, n) {
|
|
955
|
+
const r = t.slice(2).toLowerCase(), i = e.listeners.get(t);
|
|
956
|
+
if (i && i !== n && (e.node.removeEventListener(r, i), e.listeners.delete(t)), n != null && typeof n != "function")
|
|
932
957
|
throw new TypeError(`${t} must be a function or null`);
|
|
933
|
-
if (typeof n == "function" &&
|
|
934
|
-
const
|
|
935
|
-
e.node.addEventListener(r,
|
|
958
|
+
if (typeof n == "function" && i !== n) {
|
|
959
|
+
const s = n;
|
|
960
|
+
e.node.addEventListener(r, s), e.listeners.set(t, s);
|
|
936
961
|
}
|
|
937
962
|
}
|
|
938
|
-
function
|
|
939
|
-
if (
|
|
963
|
+
function _e(e, t) {
|
|
964
|
+
if (B(e.ref, null), t != null && typeof t != "function" && typeof t != "object")
|
|
940
965
|
throw new TypeError("ref must be a function, object, or null");
|
|
941
|
-
e.ref = t,
|
|
966
|
+
e.ref = t, B(e.ref, e.node);
|
|
942
967
|
}
|
|
943
968
|
function S(e, t, n, r) {
|
|
944
969
|
if (t === "class" || t === "className") {
|
|
945
|
-
|
|
970
|
+
N(e, "class", r);
|
|
946
971
|
return;
|
|
947
972
|
}
|
|
948
973
|
if (t === "for" || t === "htmlFor") {
|
|
949
|
-
|
|
974
|
+
N(e, "for", r);
|
|
950
975
|
return;
|
|
951
976
|
}
|
|
952
977
|
if (t === "dataset") {
|
|
953
|
-
|
|
978
|
+
xe(e, n, r);
|
|
954
979
|
return;
|
|
955
980
|
}
|
|
956
981
|
if (t === "style") {
|
|
957
|
-
|
|
982
|
+
ze(e, n, r);
|
|
958
983
|
return;
|
|
959
984
|
}
|
|
960
985
|
if (t === "dangerouslySetInnerHTML")
|
|
961
986
|
throw new Error("dangerouslySetInnerHTML is not supported");
|
|
962
|
-
const
|
|
963
|
-
if (
|
|
964
|
-
const
|
|
965
|
-
|
|
987
|
+
const i = Be(t);
|
|
988
|
+
if (Te.has(i)) {
|
|
989
|
+
const s = !!r;
|
|
990
|
+
i in e && Reflect.set(e, i, s), e.toggleAttribute(_(t), s);
|
|
966
991
|
return;
|
|
967
992
|
}
|
|
968
|
-
if (Pe.has(
|
|
969
|
-
const
|
|
970
|
-
Object.is(Reflect.get(e,
|
|
993
|
+
if (Pe.has(i) && i in e) {
|
|
994
|
+
const s = r ?? (i === "value" ? "" : !1);
|
|
995
|
+
Object.is(Reflect.get(e, i), s) || Reflect.set(e, i, s), r == null && e.removeAttribute(_(t));
|
|
971
996
|
return;
|
|
972
997
|
}
|
|
973
|
-
|
|
998
|
+
N(e, _(t), r);
|
|
974
999
|
}
|
|
975
|
-
function
|
|
976
|
-
const r =
|
|
977
|
-
for (const
|
|
978
|
-
const o = s
|
|
979
|
-
o == null ? delete e.dataset[
|
|
1000
|
+
function xe(e, t, n) {
|
|
1001
|
+
const r = F(t, "dataset"), i = F(n, "dataset");
|
|
1002
|
+
for (const s of /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(i)])) {
|
|
1003
|
+
const o = i[s];
|
|
1004
|
+
o == null ? delete e.dataset[s] : e.dataset[s] = String(o);
|
|
980
1005
|
}
|
|
981
1006
|
}
|
|
982
|
-
function
|
|
1007
|
+
function ze(e, t, n) {
|
|
983
1008
|
if (typeof n == "string") {
|
|
984
1009
|
e.style.cssText = n;
|
|
985
1010
|
return;
|
|
986
1011
|
}
|
|
987
|
-
const r = typeof t == "string" ? {} :
|
|
1012
|
+
const r = typeof t == "string" ? {} : F(t, "style"), i = F(n, "style");
|
|
988
1013
|
typeof t == "string" && (e.style.cssText = "");
|
|
989
|
-
for (const
|
|
990
|
-
const o = s
|
|
991
|
-
|
|
1014
|
+
for (const s of /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(i)])) {
|
|
1015
|
+
const o = i[s];
|
|
1016
|
+
s.startsWith("--") ? o == null ? e.style.removeProperty(s) : e.style.setProperty(s, String(o)) : Reflect.set(e.style, s, o == null ? "" : String(o));
|
|
992
1017
|
}
|
|
993
1018
|
}
|
|
994
|
-
function
|
|
1019
|
+
function F(e, t) {
|
|
995
1020
|
if (e == null) return {};
|
|
996
1021
|
if (typeof e != "object" || Array.isArray(e))
|
|
997
1022
|
throw new TypeError(`${t} must be an object or null`);
|
|
998
1023
|
return e;
|
|
999
1024
|
}
|
|
1000
|
-
function
|
|
1025
|
+
function N(e, t, n) {
|
|
1001
1026
|
n == null || n === !1 ? e.removeAttribute(t) : n === !0 ? e.setAttribute(t, "") : e.setAttribute(t, String(n));
|
|
1002
1027
|
}
|
|
1003
|
-
function
|
|
1028
|
+
function Be(e) {
|
|
1004
1029
|
return e === "readonly" ? "readOnly" : e === "autofocus" ? "autoFocus" : e;
|
|
1005
1030
|
}
|
|
1006
|
-
function
|
|
1031
|
+
function _(e) {
|
|
1007
1032
|
return e === "className" ? "class" : e === "htmlFor" ? "for" : /^aria[A-Z]/.test(e) || /^data[A-Z]/.test(e) ? G(e) : e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
|
|
1008
1033
|
}
|
|
1009
1034
|
function G(e) {
|
|
1010
1035
|
return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
|
|
1011
1036
|
}
|
|
1012
|
-
function
|
|
1037
|
+
function B(e, t) {
|
|
1013
1038
|
e != null && (typeof e == "function" ? e(t) : e.current = t);
|
|
1014
1039
|
}
|
|
1015
1040
|
function g(e, t) {
|
|
@@ -1029,7 +1054,7 @@ function g(e, t) {
|
|
|
1029
1054
|
return;
|
|
1030
1055
|
}
|
|
1031
1056
|
if (e.kind === "element") {
|
|
1032
|
-
|
|
1057
|
+
B(e.ref, null);
|
|
1033
1058
|
for (const [n, r] of e.listeners)
|
|
1034
1059
|
e.node.removeEventListener(n.slice(2).toLowerCase(), r);
|
|
1035
1060
|
e.listeners.clear();
|
|
@@ -1084,13 +1109,13 @@ function y(e) {
|
|
|
1084
1109
|
function ue(e) {
|
|
1085
1110
|
return typeof e == "function" && (e === m || e.prototype instanceof m);
|
|
1086
1111
|
}
|
|
1087
|
-
function
|
|
1112
|
+
function Le(e) {
|
|
1088
1113
|
return /^on[A-Z]/.test(e);
|
|
1089
1114
|
}
|
|
1090
|
-
function
|
|
1115
|
+
function Me(e) {
|
|
1091
1116
|
return e === "bind:value" || e === "bind:checked";
|
|
1092
1117
|
}
|
|
1093
|
-
function
|
|
1118
|
+
function j(e) {
|
|
1094
1119
|
return e != null && typeof e == "object" && ne.has(e);
|
|
1095
1120
|
}
|
|
1096
1121
|
function k(e) {
|
|
@@ -1099,7 +1124,7 @@ function k(e) {
|
|
|
1099
1124
|
function I(e, t) {
|
|
1100
1125
|
if (!k(e)) throw new TypeError(`${t} requires a readable emitter`);
|
|
1101
1126
|
}
|
|
1102
|
-
function
|
|
1127
|
+
function qe(e, t) {
|
|
1103
1128
|
if (I(e, t), typeof Reflect.get(e, "set") != "function")
|
|
1104
1129
|
throw new TypeError(`${t} requires a writable emitter`);
|
|
1105
1130
|
}
|
|
@@ -1154,21 +1179,21 @@ export {
|
|
|
1154
1179
|
A as F,
|
|
1155
1180
|
te as S,
|
|
1156
1181
|
Je as a,
|
|
1157
|
-
|
|
1182
|
+
L as b,
|
|
1158
1183
|
Ge as c,
|
|
1159
1184
|
Q as d,
|
|
1160
1185
|
Ze as e,
|
|
1161
1186
|
ve as f,
|
|
1162
1187
|
ye as g,
|
|
1163
|
-
|
|
1188
|
+
O as h,
|
|
1164
1189
|
y as i,
|
|
1165
1190
|
fe as j,
|
|
1166
|
-
|
|
1167
|
-
|
|
1191
|
+
W as k,
|
|
1192
|
+
Ue as l,
|
|
1168
1193
|
Qe as m,
|
|
1169
1194
|
Ye as n,
|
|
1170
1195
|
Xe as o,
|
|
1171
1196
|
We as p,
|
|
1172
1197
|
be as s
|
|
1173
1198
|
};
|
|
1174
|
-
//# sourceMappingURL=jsx-dev-runtime-
|
|
1199
|
+
//# sourceMappingURL=jsx-dev-runtime-Kf1Dhu-y.js.map
|