@sylwellsoftware/fray 0.4.0 → 0.6.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 +51 -27
- package/colors/README.md +28 -13
- package/colors/gray/colors.css +54 -26
- package/colors/green/colors.css +54 -26
- package/colors/iceblue/colors.css +54 -26
- package/colors/ocean/colors.css +54 -26
- package/colors/orange/colors.css +54 -26
- package/colors/purple/colors.css +54 -26
- package/colors/red/colors.css +54 -26
- package/colors/yellow/colors.css +54 -26
- package/dist/Components/data/descriptionList.d.ts.map +1 -1
- package/dist/Components/data/listview/listview.d.ts.map +1 -1
- package/dist/Components/data/table/DataTable.d.ts.map +1 -1
- package/dist/Components/data/table/FilterPanel.d.ts.map +1 -1
- package/dist/Components/data/table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Components/data/treeview/treeview.d.ts.map +1 -1
- package/dist/Components/dialog/dialog.d.ts.map +1 -1
- package/dist/Components/layout/panel.d.ts +0 -1
- package/dist/Components/layout/panel.d.ts.map +1 -1
- package/dist/Components/layout/sidebar.d.ts +0 -1
- package/dist/Components/layout/sidebar.d.ts.map +1 -1
- package/dist/Components/layout/tabpanel/tabline.d.ts.map +1 -1
- package/dist/Components/layout/tabpanel/tabpanel.d.ts.map +1 -1
- package/dist/Components/lineinputs/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Components/lineinputs/dropdown.d.ts.map +1 -1
- package/dist/Components/lineinputs/textbox.d.ts.map +1 -1
- package/dist/Components/lineinputs/toggle.d.ts.map +1 -1
- package/dist/Components/menu/toolbar.d.ts +0 -1
- package/dist/Components/menu/toolbar.d.ts.map +1 -1
- package/dist/Components/status/progressBar.d.ts.map +1 -1
- package/dist/Components/theme/stylesheetPicker.d.ts.map +1 -1
- package/dist/index.js +1226 -1421
- package/dist/index.js.map +1 -1
- package/dist/{jsx-dev-runtime-pzseD2Sz.js → jsx-dev-runtime-CqunwZ8j.js} +404 -486
- package/dist/jsx-dev-runtime-CqunwZ8j.js.map +1 -0
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/styling/baseStyleDefinitions.d.ts +0 -82
- package/dist/styling/baseStyleDefinitions.d.ts.map +1 -1
- package/dist/styling/theme.d.ts +3 -3
- package/dist/styling/theme.d.ts.map +1 -1
- package/package.json +3 -3
- package/styles/structural.css +72 -413
- package/themes/README.md +68 -66
- package/themes/dark.css +48 -1
- package/themes/java/theme.css +410 -135
- package/themes/light.css +48 -1
- package/themes/minimal/theme.css +408 -125
- package/themes/shiny/theme.css +484 -294
- package/dist/jsx-dev-runtime-pzseD2Sz.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var he = (e, t,
|
|
3
|
-
var c = (e, t,
|
|
1
|
+
var de = Object.defineProperty;
|
|
2
|
+
var he = (e, t, n) => t in e ? de(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var c = (e, t, n) => he(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
const D = {
|
|
5
5
|
after: {
|
|
6
6
|
content: '""',
|
|
@@ -16,48 +16,19 @@ const D = {
|
|
|
16
16
|
display: "flex",
|
|
17
17
|
"flex-flow": "row nowrap",
|
|
18
18
|
position: "relative",
|
|
19
|
-
"
|
|
20
|
-
"font-size": "var(--fray-font-size, var(--ui-font-size))",
|
|
21
|
-
"min-height": "var(--fray-control-min-height, 2rem)",
|
|
22
|
-
color: "var(--fray-ui-color, var(--ui-text-color))",
|
|
23
|
-
"border-radius": "var(--fray-radius-md, var(--ui-border-radius))",
|
|
19
|
+
"min-height": "var(--control-min-height, 2rem)",
|
|
24
20
|
"box-sizing": "border-box"
|
|
25
21
|
},
|
|
26
22
|
input: {
|
|
27
|
-
background: "var(--fray-input-background, var(--ui-input-bg))",
|
|
28
|
-
color: "var(--fray-input-color, var(--fray-ui-color, var(--ui-text-color)))",
|
|
29
|
-
padding: "var(--ui-padding-v, 0.25rem) var(--ui-padding-h, 0.5rem)",
|
|
30
23
|
"pointer-events": "all",
|
|
31
|
-
border: "var(--fray-input-border, var(--ui-input-border))",
|
|
32
24
|
width: "var(--input-width, 15rem)",
|
|
33
|
-
"box-shadow": "var(--fray-input-shadow, var(--input-shadow, none))",
|
|
34
25
|
"box-sizing": "border-box",
|
|
35
|
-
"white-space": "nowrap"
|
|
36
|
-
variants: {
|
|
37
|
-
":focus-visible": {
|
|
38
|
-
outline: "2px solid transparent",
|
|
39
|
-
"outline-offset": "1px",
|
|
40
|
-
"border-color": "var(--fray-color-focus, var(--ui-accent-color))",
|
|
41
|
-
"box-shadow": "var(--fray-focus-ring, 0 0 0 2px var(--ui-accent-color-highlight))"
|
|
42
|
-
},
|
|
43
|
-
":disabled": {
|
|
44
|
-
background: "var(--fray-input-background-disabled, var(--ui-input-bg-disabled))",
|
|
45
|
-
"border-color": "var(--fray-color-border, var(--ui-input-border-disabled))",
|
|
46
|
-
color: "var(--fray-input-color-disabled, var(--ui-input-text-color-disabled))",
|
|
47
|
-
cursor: "not-allowed"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
26
|
+
"white-space": "nowrap"
|
|
50
27
|
},
|
|
51
28
|
inputlike: {
|
|
52
|
-
background: "var(--fray-input-background, var(--ui-input-bg))",
|
|
53
|
-
color: "var(--fray-input-color, var(--fray-ui-color, var(--ui-text-color)))",
|
|
54
|
-
padding: "var(--ui-padding-v, 0.25rem) var(--ui-padding-h, 0.5rem)",
|
|
55
29
|
"pointer-events": "all",
|
|
56
|
-
border: "var(--fray-input-border, var(--ui-input-border))",
|
|
57
|
-
"box-shadow": "var(--fray-input-shadow, var(--input-shadow, none))",
|
|
58
30
|
"box-sizing": "border-box",
|
|
59
|
-
"white-space": "nowrap"
|
|
60
|
-
"border-radius": "var(--fray-radius-md, var(--ui-border-radius))"
|
|
31
|
+
"white-space": "nowrap"
|
|
61
32
|
},
|
|
62
33
|
labeledinput: {
|
|
63
34
|
display: "flex",
|
|
@@ -65,17 +36,6 @@ const D = {
|
|
|
65
36
|
"align-items": "center",
|
|
66
37
|
gap: ".5em"
|
|
67
38
|
},
|
|
68
|
-
label: {
|
|
69
|
-
color: "var(--fray-ui-color, var(--ui-text-color))",
|
|
70
|
-
"font-size": "var(--fray-font-size, var(--ui-font-size))"
|
|
71
|
-
},
|
|
72
|
-
disabled: {
|
|
73
|
-
"border-color": "var(--fray-color-border, var(--ui-input-border-disabled))",
|
|
74
|
-
color: "var(--fray-input-color-disabled, var(--ui-input-text-color-disabled))"
|
|
75
|
-
},
|
|
76
|
-
error: {
|
|
77
|
-
color: "var(--fray-color-error, var(--error-color))"
|
|
78
|
-
},
|
|
79
39
|
working: {
|
|
80
40
|
display: "inline",
|
|
81
41
|
position: "absolute",
|
|
@@ -84,32 +44,14 @@ const D = {
|
|
|
84
44
|
animation: "fray-placeholder-progress 0.8s linear infinite",
|
|
85
45
|
"background-repeat": "repeat",
|
|
86
46
|
"background-size": "2rem 2rem",
|
|
87
|
-
"background-image": "var(--
|
|
47
|
+
"background-image": "var(--working-background-image)",
|
|
88
48
|
border: "0 solid transparent",
|
|
89
49
|
"border-radius": "inherit",
|
|
90
50
|
"box-sizing": "border-box"
|
|
91
51
|
},
|
|
92
|
-
panel: {
|
|
93
|
-
background: "var(--fray-panel-background, var(--panel-bg))",
|
|
94
|
-
border: "var(--fray-panel-border, var(--panel-border))",
|
|
95
|
-
"border-radius": "var(--fray-panel-radius, var(--panel-radius))",
|
|
96
|
-
"box-shadow": "var(--fray-panel-shadow, var(--panel-shadow))",
|
|
97
|
-
color: "var(--fray-panel-color, var(--panel-color))"
|
|
98
|
-
},
|
|
99
|
-
sectionheader: {
|
|
100
|
-
"box-shadow": "var(--fray-section-header-shadow, var(--fray-header-shadow, var(--sectionheader-shadow)))",
|
|
101
|
-
background: "var(--fray-section-header-background, var(--fray-header-background, var(--sectionheader-bg)))",
|
|
102
|
-
color: "var(--fray-section-header-color, var(--fray-header-color, var(--sectionheader-color)))",
|
|
103
|
-
border: "var(--fray-section-header-border, var(--fray-header-border, 0 solid transparent))"
|
|
104
|
-
},
|
|
105
52
|
uiline: {
|
|
106
53
|
"box-sizing": "border-box",
|
|
107
|
-
"
|
|
108
|
-
"font-size": "var(--fray-font-size, var(--ui-font-size))",
|
|
109
|
-
"min-height": "var(--fray-control-min-height, 2rem)",
|
|
110
|
-
color: "var(--fray-ui-color, var(--ui-text-color))",
|
|
111
|
-
padding: "var(--ui-padding-v, 0.25rem) var(--ui-padding-h, 0.5rem)",
|
|
112
|
-
"border-radius": "var(--fray-radius-md, var(--ui-border-radius))",
|
|
54
|
+
"min-height": "var(--control-min-height, 2rem)",
|
|
113
55
|
cursor: "pointer",
|
|
114
56
|
"user-select": "none"
|
|
115
57
|
},
|
|
@@ -119,43 +61,19 @@ const D = {
|
|
|
119
61
|
},
|
|
120
62
|
button: {
|
|
121
63
|
"box-sizing": "border-box",
|
|
122
|
-
background: "var(--fray-button-background, var(--button-background))",
|
|
123
|
-
border: "var(--fray-button-border, var(--button-border))",
|
|
124
|
-
"box-shadow": "var(--fray-button-shadow, var(--button-shadow))",
|
|
125
|
-
color: "var(--fray-button-color, var(--button-color))",
|
|
126
64
|
cursor: "default",
|
|
127
65
|
"user-select": "none",
|
|
128
66
|
variants: {
|
|
129
|
-
":hover": {
|
|
130
|
-
background: "var(--fray-button-background-hover, var(--button-background-hover))",
|
|
131
|
-
"box-shadow": "var(--fray-button-shadow, var(--button-shadow))"
|
|
132
|
-
},
|
|
133
|
-
":focus-visible": {
|
|
134
|
-
outline: "2px solid transparent",
|
|
135
|
-
"outline-offset": "1px",
|
|
136
|
-
border: "1px solid var(--fray-color-focus, var(--ui-accent-color))",
|
|
137
|
-
"box-shadow": "var(--fray-focus-ring, 0 0 0 2px var(--ui-accent-color-highlight))"
|
|
138
|
-
},
|
|
139
67
|
":disabled": {
|
|
140
|
-
background: "var(--fray-button-background-disabled, var(--button-background-disabled))",
|
|
141
|
-
border: "var(--button-border-disabled, var(--fray-button-border))",
|
|
142
|
-
color: "var(--fray-input-color-disabled, var(--ui-input-text-color-disabled))",
|
|
143
68
|
cursor: "not-allowed",
|
|
144
69
|
"pointer-events": "none"
|
|
145
70
|
}
|
|
146
71
|
}
|
|
147
|
-
},
|
|
148
|
-
toolbar: {
|
|
149
|
-
background: "var(--fray-toolbar-background, var(--toolbar-bg))",
|
|
150
|
-
border: "var(--fray-toolbar-border, var(--toolbar-border))",
|
|
151
|
-
"border-radius": "var(--toolbar-radius, var(--fray-radius-md))",
|
|
152
|
-
"box-shadow": "var(--fray-toolbar-shadow, var(--toolbar-shadow))",
|
|
153
|
-
color: "var(--fray-toolbar-color, var(--toolbar-color))"
|
|
154
72
|
}
|
|
155
73
|
}, K = "data-fray-structural-styles";
|
|
156
|
-
let
|
|
74
|
+
let me = 1;
|
|
157
75
|
class Q {
|
|
158
|
-
constructor(t = `runtime-${
|
|
76
|
+
constructor(t = `runtime-${me++}`) {
|
|
159
77
|
c(this, "id");
|
|
160
78
|
c(this, "cssFragments", /* @__PURE__ */ new Set());
|
|
161
79
|
c(this, "baseStyleMap", /* @__PURE__ */ new Map());
|
|
@@ -166,17 +84,17 @@ class Q {
|
|
|
166
84
|
if (typeof t != "string") throw new TypeError("Component CSS must be a string");
|
|
167
85
|
return t.trim().length > 0 && this.cssFragments.add(t.trim()), this;
|
|
168
86
|
}
|
|
169
|
-
registerBaseStyle(t,
|
|
87
|
+
registerBaseStyle(t, n) {
|
|
170
88
|
if (typeof t != "string" || t.trim().length === 0)
|
|
171
89
|
throw new TypeError("Base style selector must be a non-empty string");
|
|
172
|
-
const
|
|
173
|
-
if (!Array.isArray(
|
|
90
|
+
const r = typeof n == "string" ? [n] : n;
|
|
91
|
+
if (!Array.isArray(r))
|
|
174
92
|
throw new TypeError("Base style names must be a string or array");
|
|
175
|
-
for (const
|
|
176
|
-
if (!Object.hasOwn(D,
|
|
177
|
-
throw new Error(`Unknown Fray base style: ${String(
|
|
178
|
-
const
|
|
179
|
-
o.add(t.trim()), this.baseStyleMap.set(
|
|
93
|
+
for (const s of r) {
|
|
94
|
+
if (!Object.hasOwn(D, s))
|
|
95
|
+
throw new Error(`Unknown Fray base style: ${String(s)}`);
|
|
96
|
+
const i = s, o = this.baseStyleMap.get(i) ?? /* @__PURE__ */ new Set();
|
|
97
|
+
o.add(t.trim()), this.baseStyleMap.set(i, o);
|
|
180
98
|
}
|
|
181
99
|
return this;
|
|
182
100
|
}
|
|
@@ -203,13 +121,13 @@ class Q {
|
|
|
203
121
|
}
|
|
204
122
|
generateBaseStyleCSS() {
|
|
205
123
|
let t = "";
|
|
206
|
-
for (const [
|
|
207
|
-
const { properties:
|
|
208
|
-
t += U(
|
|
209
|
-
for (const [a, l] of Object.entries(
|
|
124
|
+
for (const [n, r] of this.baseStyleMap) {
|
|
125
|
+
const { properties: s, variants: i } = ge(D[n]), o = [...r];
|
|
126
|
+
t += U(n, o, s);
|
|
127
|
+
for (const [a, l] of Object.entries(i))
|
|
210
128
|
t += U(
|
|
211
|
-
`${
|
|
212
|
-
o.map((u) =>
|
|
129
|
+
`${n}${a}`,
|
|
130
|
+
o.map((u) => we(u, a)),
|
|
213
131
|
l
|
|
214
132
|
);
|
|
215
133
|
}
|
|
@@ -229,11 +147,11 @@ class Q {
|
|
|
229
147
|
injectAll(t = globalThis.document) {
|
|
230
148
|
if ((t == null ? void 0 : t.head) == null)
|
|
231
149
|
throw new TypeError("StyleRegistry.injectAll requires a document with a head");
|
|
232
|
-
const
|
|
233
|
-
let
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
return
|
|
150
|
+
const n = `style[${K}="${Se(this.id)}"]`;
|
|
151
|
+
let r = t.head.querySelector(n);
|
|
152
|
+
r == null && (r = t.createElement("style"), r.setAttribute(K, this.id), t.head.prepend(r));
|
|
153
|
+
const s = this.generateCSS();
|
|
154
|
+
return r.textContent !== s && (r.textContent = s), r;
|
|
237
155
|
}
|
|
238
156
|
reset() {
|
|
239
157
|
this.cssFragments.clear(), this.baseStyleMap.clear();
|
|
@@ -242,38 +160,38 @@ class Q {
|
|
|
242
160
|
function ye() {
|
|
243
161
|
return new Q();
|
|
244
162
|
}
|
|
245
|
-
const
|
|
163
|
+
const be = new Q("");
|
|
246
164
|
function ge(e) {
|
|
247
165
|
const t = {};
|
|
248
|
-
let
|
|
249
|
-
for (const [
|
|
250
|
-
if (
|
|
251
|
-
if (typeof
|
|
166
|
+
let n = {};
|
|
167
|
+
for (const [r, s] of Object.entries(e))
|
|
168
|
+
if (r === "variants") {
|
|
169
|
+
if (typeof s != "object")
|
|
252
170
|
throw new TypeError("Base style variants must be declaration maps");
|
|
253
|
-
|
|
254
|
-
} else if (typeof
|
|
255
|
-
t[
|
|
171
|
+
n = s;
|
|
172
|
+
} else if (typeof s == "string")
|
|
173
|
+
t[r] = s;
|
|
256
174
|
else
|
|
257
|
-
throw new TypeError(`Base style property ${
|
|
258
|
-
return { properties: t, variants:
|
|
175
|
+
throw new TypeError(`Base style property ${r} must be a string`);
|
|
176
|
+
return { properties: t, variants: n };
|
|
259
177
|
}
|
|
260
|
-
function U(e, t,
|
|
261
|
-
if (t.length === 0 || Object.keys(
|
|
262
|
-
const
|
|
178
|
+
function U(e, t, n) {
|
|
179
|
+
if (t.length === 0 || Object.keys(n).length === 0) return "";
|
|
180
|
+
const r = Object.entries(n).map(([s, i]) => ` ${s}: ${i};`).join(`
|
|
263
181
|
`);
|
|
264
182
|
return `/* ${e} */
|
|
265
183
|
${t.join(`,
|
|
266
184
|
`)} {
|
|
267
|
-
${
|
|
185
|
+
${r}
|
|
268
186
|
}
|
|
269
187
|
|
|
270
188
|
`;
|
|
271
189
|
}
|
|
272
|
-
function
|
|
273
|
-
const
|
|
274
|
-
return
|
|
190
|
+
function we(e, t) {
|
|
191
|
+
const n = e.indexOf("::");
|
|
192
|
+
return n < 0 ? `${e}${t}` : `${e.slice(0, n)}${t}${e.slice(n)}`;
|
|
275
193
|
}
|
|
276
|
-
function
|
|
194
|
+
function Se(e) {
|
|
277
195
|
return e.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
|
|
278
196
|
}
|
|
279
197
|
const X = /* @__PURE__ */ new WeakSet(), ee = /* @__PURE__ */ new WeakSet();
|
|
@@ -284,10 +202,10 @@ function Ue(e) {
|
|
|
284
202
|
return X.add(t), t;
|
|
285
203
|
}
|
|
286
204
|
function We(e, t) {
|
|
287
|
-
if (
|
|
205
|
+
if (_(e), typeof t != "function")
|
|
288
206
|
throw new TypeError(`Service provider "${e.name}" requires a factory function`);
|
|
289
|
-
const
|
|
290
|
-
return ee.add(
|
|
207
|
+
const n = Object.freeze({ key: e, create: t });
|
|
208
|
+
return ee.add(n), n;
|
|
291
209
|
}
|
|
292
210
|
class te {
|
|
293
211
|
constructor(t = []) {
|
|
@@ -298,31 +216,31 @@ class te {
|
|
|
298
216
|
c(this, "disposed", !1);
|
|
299
217
|
if (!Array.isArray(t))
|
|
300
218
|
throw new TypeError("ServiceScope providers must be an array");
|
|
301
|
-
for (const
|
|
302
|
-
if (Re(
|
|
303
|
-
throw new Error(`Service "${
|
|
304
|
-
this.providers.set(
|
|
219
|
+
for (const n of t) {
|
|
220
|
+
if (Re(n), this.providers.has(n.key))
|
|
221
|
+
throw new Error(`Service "${n.key.name}" is registered more than once`);
|
|
222
|
+
this.providers.set(n.key, n);
|
|
305
223
|
}
|
|
306
224
|
}
|
|
307
225
|
get isDisposed() {
|
|
308
226
|
return this.disposed;
|
|
309
227
|
}
|
|
310
228
|
has(t) {
|
|
311
|
-
return this.assertActive(),
|
|
229
|
+
return this.assertActive(), _(t), this.providers.has(t);
|
|
312
230
|
}
|
|
313
231
|
require(t) {
|
|
314
|
-
if (this.assertActive(),
|
|
315
|
-
const
|
|
316
|
-
if (
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
319
|
-
const
|
|
320
|
-
throw new Error(`Circular service dependency: ${
|
|
232
|
+
if (this.assertActive(), _(t), this.instances.has(t)) return this.instances.get(t);
|
|
233
|
+
const n = this.providers.get(t);
|
|
234
|
+
if (n == null) throw new Error(`Service "${t.name}" is not registered`);
|
|
235
|
+
const r = this.resolving.indexOf(t);
|
|
236
|
+
if (r >= 0) {
|
|
237
|
+
const s = [...this.resolving.slice(r), t].map((i) => i.name).join(" -> ");
|
|
238
|
+
throw new Error(`Circular service dependency: ${s}`);
|
|
321
239
|
}
|
|
322
240
|
this.resolving.push(t);
|
|
323
241
|
try {
|
|
324
|
-
const
|
|
325
|
-
return this.instances.set(t,
|
|
242
|
+
const s = n.create(this);
|
|
243
|
+
return this.instances.set(t, s), this.creationOrder.push(t), s;
|
|
326
244
|
} finally {
|
|
327
245
|
this.resolving.pop();
|
|
328
246
|
}
|
|
@@ -331,13 +249,13 @@ class te {
|
|
|
331
249
|
if (this.disposed) return;
|
|
332
250
|
this.disposed = !0;
|
|
333
251
|
const t = [];
|
|
334
|
-
for (const
|
|
335
|
-
const
|
|
252
|
+
for (const n of [...this.creationOrder].reverse()) {
|
|
253
|
+
const r = this.instances.get(n);
|
|
336
254
|
try {
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
} catch (
|
|
340
|
-
t.push(
|
|
255
|
+
const s = je(r);
|
|
256
|
+
s != null && s.call(r);
|
|
257
|
+
} catch (s) {
|
|
258
|
+
t.push(s);
|
|
341
259
|
}
|
|
342
260
|
}
|
|
343
261
|
if (this.instances.clear(), this.creationOrder.length = 0, this.resolving.length = 0, t.length === 1) throw t[0];
|
|
@@ -348,13 +266,13 @@ class te {
|
|
|
348
266
|
if (this.disposed) throw new Error("ServiceScope has been disposed");
|
|
349
267
|
}
|
|
350
268
|
}
|
|
351
|
-
function
|
|
269
|
+
function ve(e = []) {
|
|
352
270
|
return new te(e);
|
|
353
271
|
}
|
|
354
272
|
function Ee(e) {
|
|
355
273
|
return e != null && (typeof e == "object" || typeof e == "function") && X.has(e);
|
|
356
274
|
}
|
|
357
|
-
function
|
|
275
|
+
function _(e) {
|
|
358
276
|
if (!Ee(e)) throw new TypeError("Expected a service key created by defineService()");
|
|
359
277
|
}
|
|
360
278
|
function Re(e) {
|
|
@@ -376,46 +294,46 @@ const Te = /* @__PURE__ */ new Set([
|
|
|
376
294
|
"font-face-name",
|
|
377
295
|
"missing-glyph"
|
|
378
296
|
]);
|
|
379
|
-
class
|
|
380
|
-
constructor(t = {},
|
|
297
|
+
class M {
|
|
298
|
+
constructor(t = {}, n = ye()) {
|
|
381
299
|
c(this, "elementPrefix");
|
|
382
300
|
c(this, "elementNameOverrides");
|
|
383
301
|
c(this, "styleRegistry");
|
|
384
302
|
c(this, "services");
|
|
385
303
|
if (t == null || typeof t != "object" || Array.isArray(t))
|
|
386
304
|
throw new TypeError("FrayRuntime options must be an object");
|
|
387
|
-
const
|
|
388
|
-
if (
|
|
305
|
+
const r = t.elementNames ?? {};
|
|
306
|
+
if (r == null || typeof r != "object" || Array.isArray(r))
|
|
389
307
|
throw new TypeError("Fray elementNames must be an object");
|
|
390
|
-
const
|
|
391
|
-
|
|
392
|
-
const
|
|
393
|
-
if (
|
|
308
|
+
const s = r.prefix === void 0 ? "fray" : r.prefix;
|
|
309
|
+
s !== null && P(s, "Fray element prefix");
|
|
310
|
+
const i = r.overrides ?? {};
|
|
311
|
+
if (i == null || typeof i != "object" || Array.isArray(i))
|
|
394
312
|
throw new TypeError("Fray element-name overrides must be an object");
|
|
395
|
-
for (const [o, a] of Object.entries(
|
|
396
|
-
|
|
397
|
-
if (this.elementPrefix =
|
|
313
|
+
for (const [o, a] of Object.entries(i))
|
|
314
|
+
P(o, "Fray component host name"), Z(a);
|
|
315
|
+
if (this.elementPrefix = s, this.elementNameOverrides = Object.freeze({ ...i }), this.styleRegistry = n, this.services = t.services ?? ve(), !(this.services instanceof te))
|
|
398
316
|
throw new TypeError("Fray services must be a ServiceScope");
|
|
399
317
|
}
|
|
400
|
-
resolveElementName(t,
|
|
401
|
-
|
|
402
|
-
const
|
|
403
|
-
return Z(
|
|
318
|
+
resolveElementName(t, n = null) {
|
|
319
|
+
P(t, "Fray component host name");
|
|
320
|
+
const s = this.elementNameOverrides[t] ?? (this.elementPrefix == null ? n ?? t : `${this.elementPrefix}-${t}`);
|
|
321
|
+
return Z(s), s;
|
|
404
322
|
}
|
|
405
|
-
resolveHostSelector(t,
|
|
323
|
+
resolveHostSelector(t, n, r = null) {
|
|
406
324
|
if (typeof t != "string") throw new TypeError("Host selector must be a string");
|
|
407
|
-
return t.replaceAll("&", this.resolveElementName(
|
|
325
|
+
return t.replaceAll("&", this.resolveElementName(n, r));
|
|
408
326
|
}
|
|
409
|
-
resolveHostCSS(t,
|
|
327
|
+
resolveHostCSS(t, n, r = null) {
|
|
410
328
|
if (typeof t != "string") throw new TypeError("Host CSS must be a string");
|
|
411
|
-
return t.replaceAll("&", this.resolveElementName(
|
|
329
|
+
return t.replaceAll("&", this.resolveElementName(n, r));
|
|
412
330
|
}
|
|
413
|
-
create(t, ...
|
|
414
|
-
const
|
|
415
|
-
return
|
|
331
|
+
create(t, ...n) {
|
|
332
|
+
const r = new t(...n);
|
|
333
|
+
return r._setRuntime(this), r;
|
|
416
334
|
}
|
|
417
|
-
mount(t,
|
|
418
|
-
return t._setRuntime(this), t.mount(
|
|
335
|
+
mount(t, n, r = null) {
|
|
336
|
+
return t._setRuntime(this), t.mount(n, r), t;
|
|
419
337
|
}
|
|
420
338
|
registerStyles(t) {
|
|
421
339
|
if (t == null || typeof t.registerStyles != "function")
|
|
@@ -427,18 +345,18 @@ class L {
|
|
|
427
345
|
}
|
|
428
346
|
}
|
|
429
347
|
function Ze(e = {}) {
|
|
430
|
-
return new
|
|
348
|
+
return new M(e);
|
|
431
349
|
}
|
|
432
|
-
const W = new
|
|
433
|
-
function
|
|
350
|
+
const W = new M({}, be);
|
|
351
|
+
function P(e, t) {
|
|
434
352
|
if (typeof e != "string" || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))
|
|
435
353
|
throw new TypeError(`${t} must be a lowercase kebab-case name`);
|
|
436
354
|
}
|
|
437
355
|
function Z(e) {
|
|
438
|
-
if (
|
|
356
|
+
if (P(e, "Fray element name"), !e.includes("-") || Te.has(e))
|
|
439
357
|
throw new TypeError(`Fray element name must be a non-reserved name containing a hyphen: ${e}`);
|
|
440
358
|
}
|
|
441
|
-
const
|
|
359
|
+
const A = Symbol.for("@sylwellsoftware/fray.Fragment"), ne = /* @__PURE__ */ new WeakSet(), Ce = /* @__PURE__ */ new Set([
|
|
442
360
|
"allowFullScreen",
|
|
443
361
|
"async",
|
|
444
362
|
"autoFocus",
|
|
@@ -462,7 +380,7 @@ const P = Symbol.for("@sylwellsoftware/fray.Fragment"), re = /* @__PURE__ */ new
|
|
|
462
380
|
"required",
|
|
463
381
|
"reversed",
|
|
464
382
|
"selected"
|
|
465
|
-
]),
|
|
383
|
+
]), Pe = /* @__PURE__ */ new Set([
|
|
466
384
|
"checked",
|
|
467
385
|
"defaultChecked",
|
|
468
386
|
"defaultValue",
|
|
@@ -480,28 +398,28 @@ const P = Symbol.for("@sylwellsoftware/fray.Fragment"), re = /* @__PURE__ */ new
|
|
|
480
398
|
function Ye(e) {
|
|
481
399
|
I(e, "live");
|
|
482
400
|
const t = Object.freeze({ emitter: e });
|
|
483
|
-
return
|
|
401
|
+
return ne.add(t), t;
|
|
484
402
|
}
|
|
485
|
-
function
|
|
486
|
-
const
|
|
487
|
-
if (typeof
|
|
403
|
+
function O(e, t = null, ...n) {
|
|
404
|
+
const r = t ?? {};
|
|
405
|
+
if (typeof r != "object" || Array.isArray(r))
|
|
488
406
|
throw new TypeError("VNode props must be an object or null");
|
|
489
407
|
const {
|
|
490
|
-
children:
|
|
491
|
-
key:
|
|
408
|
+
children: s,
|
|
409
|
+
key: i = null,
|
|
492
410
|
...o
|
|
493
|
-
} =
|
|
411
|
+
} = r;
|
|
494
412
|
return {
|
|
495
413
|
type: e,
|
|
496
|
-
key:
|
|
414
|
+
key: i,
|
|
497
415
|
props: {
|
|
498
416
|
...o,
|
|
499
|
-
children:
|
|
417
|
+
children: re([s, n])
|
|
500
418
|
}
|
|
501
419
|
};
|
|
502
420
|
}
|
|
503
421
|
function Ge(e, ...t) {
|
|
504
|
-
return e.reduce((
|
|
422
|
+
return e.reduce((n, r, s) => n + r + String(t[s] ?? ""), "");
|
|
505
423
|
}
|
|
506
424
|
const h = class h {
|
|
507
425
|
constructor(t = {}) {
|
|
@@ -525,31 +443,31 @@ const h = class h {
|
|
|
525
443
|
/** JSX component for this instance's runtime-configured custom host. */
|
|
526
444
|
c(this, "Host", ({
|
|
527
445
|
children: t = [],
|
|
528
|
-
...
|
|
529
|
-
}) => this.host(
|
|
446
|
+
...n
|
|
447
|
+
}) => this.host(n, t));
|
|
530
448
|
if (t == null || typeof t != "object" || Array.isArray(t))
|
|
531
449
|
throw new TypeError(`${this.constructor.name} props must be an object`);
|
|
532
450
|
this.props = t;
|
|
533
451
|
}
|
|
534
452
|
static new(...t) {
|
|
535
|
-
const
|
|
536
|
-
if (!(
|
|
453
|
+
const n = new this(...t);
|
|
454
|
+
if (!(n instanceof h))
|
|
537
455
|
throw new TypeError("Component.new() requires a Component constructor");
|
|
538
|
-
return
|
|
456
|
+
return n.mount();
|
|
539
457
|
}
|
|
540
458
|
static get baseStyles() {
|
|
541
459
|
return {};
|
|
542
460
|
}
|
|
543
|
-
static registerStyles(t = W,
|
|
544
|
-
if (
|
|
545
|
-
|
|
546
|
-
const
|
|
547
|
-
this.css && t.styleRegistry.registerCSS(
|
|
548
|
-
const
|
|
549
|
-
for (const [o, a] of
|
|
550
|
-
t.styleRegistry.registerBaseStyle(
|
|
461
|
+
static registerStyles(t = W, n = /* @__PURE__ */ new Set()) {
|
|
462
|
+
if (n.has(this)) return;
|
|
463
|
+
n.add(this);
|
|
464
|
+
const r = this.hostName ?? null, s = this.standaloneHostName ?? null;
|
|
465
|
+
this.css && t.styleRegistry.registerCSS(r == null ? this.css : t.resolveHostCSS(this.css, r, s));
|
|
466
|
+
const i = De(this.baseStyles);
|
|
467
|
+
for (const [o, a] of i)
|
|
468
|
+
t.styleRegistry.registerBaseStyle(r == null ? o : t.resolveHostSelector(o, r, s), a);
|
|
551
469
|
for (const o of this.dependencies ?? [])
|
|
552
|
-
o.registerStyles(t,
|
|
470
|
+
o.registerStyles(t, n);
|
|
553
471
|
}
|
|
554
472
|
/** One-time setup hook. Constructors must not subscribe or render. */
|
|
555
473
|
initialize() {
|
|
@@ -558,31 +476,31 @@ const h = class h {
|
|
|
558
476
|
throw new Error(`${this.constructor.name} must implement render()`);
|
|
559
477
|
}
|
|
560
478
|
/** Render this component's configured custom host element. */
|
|
561
|
-
host(t = null, ...
|
|
562
|
-
const
|
|
563
|
-
if (
|
|
479
|
+
host(t = null, ...n) {
|
|
480
|
+
const r = this.constructor, s = r.hostName;
|
|
481
|
+
if (s == null)
|
|
564
482
|
throw new Error(`${this.constructor.name} does not declare a custom host name`);
|
|
565
|
-
return
|
|
566
|
-
|
|
567
|
-
|
|
483
|
+
return O(this._runtime.resolveElementName(
|
|
484
|
+
s,
|
|
485
|
+
r.standaloneHostName
|
|
568
486
|
), {
|
|
569
487
|
...t,
|
|
570
|
-
"data-fray-component":
|
|
571
|
-
}, ...
|
|
488
|
+
"data-fray-component": s
|
|
489
|
+
}, ...n);
|
|
572
490
|
}
|
|
573
491
|
/** @internal Assign an immutable application runtime before initialization or mounting. */
|
|
574
492
|
_setRuntime(t) {
|
|
575
|
-
if (!(t instanceof
|
|
493
|
+
if (!(t instanceof M))
|
|
576
494
|
throw new TypeError("Component runtime must be a FrayRuntime");
|
|
577
495
|
if (t === this._runtime) return this;
|
|
578
496
|
if (this.initialized || this.mounted || this._rendered != null)
|
|
579
497
|
throw new Error("Cannot change a component runtime after initialization");
|
|
580
498
|
return this._runtime = t, this;
|
|
581
499
|
}
|
|
582
|
-
mount(t = null,
|
|
500
|
+
mount(t = null, n = null) {
|
|
583
501
|
if (this.destroyed) throw new Error("Cannot mount a destroyed component");
|
|
584
|
-
let
|
|
585
|
-
return this.initialized || (this.validateRequiredServices(), this.initialized = !0, this.initialize()), this.mounted || (this.mounted = !0, this.update(),
|
|
502
|
+
let r = !1;
|
|
503
|
+
return this.initialized || (this.validateRequiredServices(), this.initialized = !0, this.initialize()), this.mounted || (this.mounted = !0, this.update(), r = !0), t != null && (Ie(t), H(t, this._rendered, n)), r && this.afterMount(this.dom), this;
|
|
586
504
|
}
|
|
587
505
|
attachTo(t) {
|
|
588
506
|
return this.mount(t), this;
|
|
@@ -596,15 +514,15 @@ const h = class h {
|
|
|
596
514
|
try {
|
|
597
515
|
do {
|
|
598
516
|
this.updateRequested = !1;
|
|
599
|
-
const
|
|
600
|
-
this.collectingRenderReads =
|
|
601
|
-
let
|
|
517
|
+
const n = /* @__PURE__ */ new Set();
|
|
518
|
+
this.collectingRenderReads = n;
|
|
519
|
+
let r;
|
|
602
520
|
try {
|
|
603
|
-
|
|
521
|
+
r = R(this.render());
|
|
604
522
|
} finally {
|
|
605
523
|
this.collectingRenderReads = null;
|
|
606
524
|
}
|
|
607
|
-
this._rendered =
|
|
525
|
+
this._rendered = q(this._rendered, r, this), this.dom = ae(this._rendered), this.reconcileRenderReads(n), this.afterUpdate(this.dom);
|
|
608
526
|
} while (this.updateRequested && !this.destroyed);
|
|
609
527
|
} finally {
|
|
610
528
|
this.updating = !1;
|
|
@@ -621,15 +539,15 @@ const h = class h {
|
|
|
621
539
|
afterUpdate(t) {
|
|
622
540
|
}
|
|
623
541
|
watch(...t) {
|
|
624
|
-
for (const
|
|
625
|
-
if (
|
|
542
|
+
for (const n of t) {
|
|
543
|
+
if (n == null || typeof n.subscribe != "function")
|
|
626
544
|
throw new TypeError("watch requires emitter-like values");
|
|
627
|
-
if (this.watched.has(
|
|
628
|
-
const
|
|
629
|
-
this.mounted && !this.destroyed && this.update(
|
|
545
|
+
if (this.watched.has(n)) continue;
|
|
546
|
+
const r = n.subscribe(({ event: s }) => {
|
|
547
|
+
this.mounted && !this.destroyed && this.update(s);
|
|
630
548
|
}, { emitCurrent: !1 });
|
|
631
|
-
this.watched.set(
|
|
632
|
-
|
|
549
|
+
this.watched.set(n, r), this.onCleanup(() => {
|
|
550
|
+
r(), this.watched.delete(n);
|
|
633
551
|
});
|
|
634
552
|
}
|
|
635
553
|
return this;
|
|
@@ -655,27 +573,27 @@ const h = class h {
|
|
|
655
573
|
return t(), () => {
|
|
656
574
|
};
|
|
657
575
|
this.cleanupFunctions.add(t);
|
|
658
|
-
let
|
|
576
|
+
let n = !0;
|
|
659
577
|
return () => {
|
|
660
|
-
|
|
578
|
+
n && (n = !1, this.cleanupFunctions.delete(t), t());
|
|
661
579
|
};
|
|
662
580
|
}
|
|
663
581
|
/** Resolve one explicitly declared application service from this component's runtime. */
|
|
664
582
|
requireService(t) {
|
|
665
583
|
if (!this.initialized)
|
|
666
584
|
throw new Error("Components may resolve services during initialize() or later");
|
|
667
|
-
const
|
|
668
|
-
if (!
|
|
585
|
+
const n = this.constructor;
|
|
586
|
+
if (!n.requiredServices.includes(t))
|
|
669
587
|
throw new Error(
|
|
670
|
-
`${
|
|
588
|
+
`${n.name} must declare service "${t.name}" in requiredServices`
|
|
671
589
|
);
|
|
672
590
|
return this._runtime.services.require(t);
|
|
673
591
|
}
|
|
674
|
-
listen(t,
|
|
592
|
+
listen(t, n, r, s) {
|
|
675
593
|
if (t == null || typeof t.addEventListener != "function")
|
|
676
594
|
throw new TypeError("listen target must be an EventTarget");
|
|
677
|
-
const
|
|
678
|
-
return t.addEventListener(
|
|
595
|
+
const i = r;
|
|
596
|
+
return t.addEventListener(n, i, s), this.onCleanup(() => t.removeEventListener(n, i, s)), this;
|
|
679
597
|
}
|
|
680
598
|
registerChild(t) {
|
|
681
599
|
if (!(t instanceof h))
|
|
@@ -693,9 +611,9 @@ const h = class h {
|
|
|
693
611
|
}
|
|
694
612
|
validateRequiredServices() {
|
|
695
613
|
const t = this.constructor;
|
|
696
|
-
for (const
|
|
697
|
-
if (!this._runtime.services.has(
|
|
698
|
-
throw new Error(`${t.name} requires unregistered service "${
|
|
614
|
+
for (const n of t.requiredServices)
|
|
615
|
+
if (!this._runtime.services.has(n))
|
|
616
|
+
throw new Error(`${t.name} requires unregistered service "${n.name}"`);
|
|
699
617
|
}
|
|
700
618
|
onDestroy() {
|
|
701
619
|
}
|
|
@@ -705,29 +623,29 @@ const h = class h {
|
|
|
705
623
|
this.collectingRenderReads.add(t);
|
|
706
624
|
}
|
|
707
625
|
reconcileRenderReads(t) {
|
|
708
|
-
for (const [
|
|
709
|
-
t.has(
|
|
710
|
-
for (const
|
|
711
|
-
if (this.watched.has(
|
|
712
|
-
const
|
|
713
|
-
this.mounted && !this.destroyed && this.update(
|
|
626
|
+
for (const [n, r] of this.renderReadSubscriptions)
|
|
627
|
+
t.has(n) || (r(), this.renderReadSubscriptions.delete(n));
|
|
628
|
+
for (const n of t) {
|
|
629
|
+
if (this.watched.has(n) || this.renderReadSubscriptions.has(n)) continue;
|
|
630
|
+
const r = n.subscribe(({ event: s }) => {
|
|
631
|
+
this.mounted && !this.destroyed && this.update(s);
|
|
714
632
|
}, { emitCurrent: !1 });
|
|
715
|
-
this.renderReadSubscriptions.set(
|
|
633
|
+
this.renderReadSubscriptions.set(n, r);
|
|
716
634
|
}
|
|
717
635
|
}
|
|
718
636
|
};
|
|
719
637
|
c(h, "dependencies", []), c(h, "requiredServices", []), c(h, "css", ""), c(h, "hostName", null), c(h, "standaloneHostName", null);
|
|
720
|
-
let
|
|
638
|
+
let m = h;
|
|
721
639
|
function R(e) {
|
|
722
|
-
return Array.isArray(e) ? A
|
|
640
|
+
return Array.isArray(e) ? O(A, null, e) : e == null || typeof e == "boolean" ? O(A) : e;
|
|
723
641
|
}
|
|
724
|
-
function
|
|
725
|
-
const t = [],
|
|
726
|
-
if (Array.isArray(
|
|
727
|
-
for (const
|
|
728
|
-
else
|
|
642
|
+
function re(e) {
|
|
643
|
+
const t = [], n = (r) => {
|
|
644
|
+
if (Array.isArray(r))
|
|
645
|
+
for (const s of r) n(s);
|
|
646
|
+
else r != null && typeof r != "boolean" && t.push(r);
|
|
729
647
|
};
|
|
730
|
-
return
|
|
648
|
+
return n(e), t;
|
|
731
649
|
}
|
|
732
650
|
function j(e, t) {
|
|
733
651
|
if (typeof e == "string" || typeof e == "number")
|
|
@@ -738,32 +656,32 @@ function j(e, t) {
|
|
|
738
656
|
node: document.createTextNode(String(e)),
|
|
739
657
|
owner: t
|
|
740
658
|
};
|
|
741
|
-
if (
|
|
742
|
-
const
|
|
659
|
+
if (k(e)) {
|
|
660
|
+
const i = document.createComment("fray-emitter-start"), o = document.createComment("fray-emitter-end"), a = e.get();
|
|
743
661
|
if (Object.is(a, e))
|
|
744
662
|
throw new TypeError("A Fray emitter child cannot render itself");
|
|
745
663
|
const l = document.createDocumentFragment();
|
|
746
|
-
l.append(
|
|
664
|
+
l.append(i, o);
|
|
747
665
|
const u = j(R(a), t);
|
|
748
666
|
H(l, u, o);
|
|
749
|
-
const
|
|
667
|
+
const p = {
|
|
750
668
|
kind: "emitter",
|
|
751
669
|
key: null,
|
|
752
670
|
source: e,
|
|
753
|
-
start:
|
|
671
|
+
start: i,
|
|
754
672
|
end: o,
|
|
755
673
|
child: u,
|
|
756
674
|
unsubscribe: () => {
|
|
757
675
|
},
|
|
758
676
|
owner: t
|
|
759
677
|
};
|
|
760
|
-
return
|
|
761
|
-
if (Object.is(
|
|
678
|
+
return p.unsubscribe = e.subscribe(({ value: b }) => {
|
|
679
|
+
if (Object.is(b, e))
|
|
762
680
|
throw new TypeError("A Fray emitter child cannot render itself");
|
|
763
|
-
|
|
764
|
-
}, { emitCurrent: !1 }),
|
|
681
|
+
p.child = q(p.child, R(b), t);
|
|
682
|
+
}, { emitCurrent: !1 }), p;
|
|
765
683
|
}
|
|
766
|
-
if (e instanceof
|
|
684
|
+
if (e instanceof m)
|
|
767
685
|
return e._setRuntime(t._runtime), e.mount(), t.registerChild(e), {
|
|
768
686
|
kind: "component",
|
|
769
687
|
key: ce(e.props),
|
|
@@ -776,32 +694,32 @@ function j(e, t) {
|
|
|
776
694
|
};
|
|
777
695
|
if (!y(e))
|
|
778
696
|
throw new TypeError(`Invalid Fray child: ${J(e)}`);
|
|
779
|
-
const { type:
|
|
780
|
-
if (
|
|
781
|
-
const
|
|
697
|
+
const { type: n, key: r = null, props: s } = e;
|
|
698
|
+
if (n === A) {
|
|
699
|
+
const i = document.createComment("fray-fragment-start"), o = document.createComment("fray-fragment-end"), a = {
|
|
782
700
|
kind: "fragment",
|
|
783
|
-
key:
|
|
784
|
-
type:
|
|
785
|
-
start:
|
|
701
|
+
key: r,
|
|
702
|
+
type: n,
|
|
703
|
+
start: i,
|
|
786
704
|
end: o,
|
|
787
705
|
children: [],
|
|
788
706
|
owner: t
|
|
789
707
|
}, l = document.createDocumentFragment();
|
|
790
|
-
return l.append(
|
|
708
|
+
return l.append(i, o), a.children = $(
|
|
791
709
|
l,
|
|
792
710
|
[],
|
|
793
|
-
|
|
711
|
+
s.children,
|
|
794
712
|
t,
|
|
795
713
|
o,
|
|
796
|
-
|
|
714
|
+
i
|
|
797
715
|
), a;
|
|
798
716
|
}
|
|
799
|
-
if (typeof
|
|
800
|
-
const
|
|
717
|
+
if (typeof n == "string") {
|
|
718
|
+
const i = document.createElement(n), o = {
|
|
801
719
|
kind: "element",
|
|
802
|
-
key:
|
|
803
|
-
type:
|
|
804
|
-
node:
|
|
720
|
+
key: r,
|
|
721
|
+
type: n,
|
|
722
|
+
node: i,
|
|
805
723
|
props: {},
|
|
806
724
|
listeners: /* @__PURE__ */ new Map(),
|
|
807
725
|
liveProps: /* @__PURE__ */ new Map(),
|
|
@@ -810,384 +728,384 @@ function j(e, t) {
|
|
|
810
728
|
children: [],
|
|
811
729
|
owner: t
|
|
812
730
|
};
|
|
813
|
-
return oe(o,
|
|
731
|
+
return oe(o, s), o.children = $(i, [], s.children, t), o;
|
|
814
732
|
}
|
|
815
|
-
if (ue(
|
|
816
|
-
const
|
|
733
|
+
if (ue(n)) {
|
|
734
|
+
const i = s, o = Y(i), a = new n(o);
|
|
817
735
|
a._setRuntime(t._runtime);
|
|
818
736
|
const l = {
|
|
819
737
|
kind: "component",
|
|
820
|
-
key:
|
|
821
|
-
type:
|
|
738
|
+
key: r,
|
|
739
|
+
type: n,
|
|
822
740
|
instance: a,
|
|
823
741
|
prebuilt: !1,
|
|
824
742
|
props: o,
|
|
825
743
|
liveProps: /* @__PURE__ */ new Map(),
|
|
826
744
|
owner: t
|
|
827
745
|
};
|
|
828
|
-
return
|
|
746
|
+
return ie(l, i), a.mount(), t.registerChild(a), l;
|
|
829
747
|
}
|
|
830
|
-
if (typeof
|
|
831
|
-
const
|
|
748
|
+
if (typeof n == "function") {
|
|
749
|
+
const i = n, o = s, a = Y(o), l = R(i(a)), u = {
|
|
832
750
|
kind: "function",
|
|
833
|
-
key:
|
|
834
|
-
type:
|
|
751
|
+
key: r,
|
|
752
|
+
type: i,
|
|
835
753
|
props: a,
|
|
836
754
|
sourceProps: o,
|
|
837
755
|
liveProps: /* @__PURE__ */ new Map(),
|
|
838
756
|
child: j(l, t),
|
|
839
757
|
owner: t
|
|
840
758
|
};
|
|
841
|
-
return
|
|
759
|
+
return Oe(u), u;
|
|
842
760
|
}
|
|
843
|
-
throw new TypeError(`Unsupported vnode type: ${J(
|
|
761
|
+
throw new TypeError(`Unsupported vnode type: ${J(n)}`);
|
|
844
762
|
}
|
|
845
|
-
function
|
|
846
|
-
if (e == null) return j(t,
|
|
847
|
-
if (le(e, t)) return
|
|
848
|
-
const
|
|
849
|
-
return
|
|
763
|
+
function q(e, t, n) {
|
|
764
|
+
if (e == null) return j(t, n);
|
|
765
|
+
if (le(e, t)) return se(e, t, n);
|
|
766
|
+
const r = j(t, n), s = ae(e), i = (s == null ? void 0 : s.parentNode) ?? null;
|
|
767
|
+
return i && H(i, r, s), g(e, !0), r;
|
|
850
768
|
}
|
|
851
|
-
function
|
|
852
|
-
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" ? (
|
|
769
|
+
function se(e, t, n) {
|
|
770
|
+
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 = $(
|
|
853
771
|
e.start.parentNode,
|
|
854
772
|
e.children,
|
|
855
773
|
t.props.children,
|
|
856
|
-
|
|
774
|
+
n,
|
|
857
775
|
e.end,
|
|
858
776
|
e.start
|
|
859
|
-
), e) : (oe(e, t.props), e.children =
|
|
777
|
+
), e) : (oe(e, t.props), e.children = $(
|
|
860
778
|
e.node,
|
|
861
779
|
e.children,
|
|
862
780
|
t.props.children,
|
|
863
|
-
|
|
781
|
+
n
|
|
864
782
|
), e) : e;
|
|
865
783
|
}
|
|
866
784
|
function Y(e) {
|
|
867
|
-
return Object.fromEntries(Object.entries(e).map(([t,
|
|
785
|
+
return Object.fromEntries(Object.entries(e).map(([t, n]) => [
|
|
868
786
|
t,
|
|
869
|
-
T(
|
|
787
|
+
T(n) ? n.emitter.get() : n
|
|
870
788
|
]));
|
|
871
789
|
}
|
|
872
|
-
function
|
|
873
|
-
|
|
874
|
-
e.props = { ...e.props, [
|
|
790
|
+
function ie(e, t) {
|
|
791
|
+
x(e.liveProps, t, (n, r) => {
|
|
792
|
+
e.props = { ...e.props, [n]: r }, e.instance.setProps(e.props);
|
|
875
793
|
}), e.props = V(e.liveProps, t), e.instance.setProps(e.props);
|
|
876
794
|
}
|
|
877
|
-
function
|
|
878
|
-
|
|
795
|
+
function Ae(e, t) {
|
|
796
|
+
ie(e, t);
|
|
879
797
|
}
|
|
880
|
-
function
|
|
881
|
-
|
|
882
|
-
e.props = { ...e.props, [t]:
|
|
798
|
+
function Oe(e) {
|
|
799
|
+
x(e.liveProps, e.sourceProps, (t, n) => {
|
|
800
|
+
e.props = { ...e.props, [t]: n }, B(e);
|
|
883
801
|
}), e.props = V(e.liveProps, e.sourceProps);
|
|
884
802
|
}
|
|
885
|
-
function
|
|
886
|
-
e.sourceProps = t,
|
|
887
|
-
e.props = { ...e.props, [
|
|
888
|
-
}), e.props = V(e.liveProps, t),
|
|
803
|
+
function $e(e, t) {
|
|
804
|
+
e.sourceProps = t, x(e.liveProps, t, (n, r) => {
|
|
805
|
+
e.props = { ...e.props, [n]: r }, B(e);
|
|
806
|
+
}), e.props = V(e.liveProps, t), B(e);
|
|
889
807
|
}
|
|
890
|
-
function
|
|
808
|
+
function B(e) {
|
|
891
809
|
const t = R(e.type(e.props));
|
|
892
|
-
e.child =
|
|
893
|
-
}
|
|
894
|
-
function
|
|
895
|
-
for (const [
|
|
896
|
-
const
|
|
897
|
-
T(
|
|
898
|
-
}
|
|
899
|
-
for (const [
|
|
900
|
-
if (!T(
|
|
901
|
-
const
|
|
902
|
-
source:
|
|
903
|
-
value:
|
|
810
|
+
e.child = q(e.child, t, e.owner);
|
|
811
|
+
}
|
|
812
|
+
function x(e, t, n) {
|
|
813
|
+
for (const [r, s] of e) {
|
|
814
|
+
const i = t[r];
|
|
815
|
+
T(i) && i.emitter === s.source || (s.unsubscribe(), e.delete(r));
|
|
816
|
+
}
|
|
817
|
+
for (const [r, s] of Object.entries(t)) {
|
|
818
|
+
if (!T(s) || e.has(r)) continue;
|
|
819
|
+
const i = {
|
|
820
|
+
source: s.emitter,
|
|
821
|
+
value: s.emitter.get(),
|
|
904
822
|
unsubscribe: () => {
|
|
905
823
|
}
|
|
906
824
|
};
|
|
907
|
-
|
|
908
|
-
e.get(
|
|
909
|
-
}, { emitCurrent: !1 }), e.set(
|
|
825
|
+
i.unsubscribe = s.emitter.subscribe(({ value: o }) => {
|
|
826
|
+
e.get(r) === i && (i.value = o, n(r, o));
|
|
827
|
+
}, { emitCurrent: !1 }), e.set(r, i);
|
|
910
828
|
}
|
|
911
829
|
}
|
|
912
830
|
function V(e, t) {
|
|
913
|
-
return Object.fromEntries(Object.entries(t).map(([
|
|
914
|
-
var
|
|
831
|
+
return Object.fromEntries(Object.entries(t).map(([n, r]) => {
|
|
832
|
+
var s;
|
|
915
833
|
return [
|
|
916
|
-
|
|
917
|
-
T(
|
|
834
|
+
n,
|
|
835
|
+
T(r) ? ((s = e.get(n)) == null ? void 0 : s.value) ?? r.emitter.get() : r
|
|
918
836
|
];
|
|
919
837
|
}));
|
|
920
838
|
}
|
|
921
|
-
function
|
|
839
|
+
function $(e, t, n, r, s = null, i = null) {
|
|
922
840
|
if (e == null) throw new Error("Cannot patch a detached fragment range");
|
|
923
|
-
const o =
|
|
841
|
+
const o = re(n), a = /* @__PURE__ */ new Map(), l = [];
|
|
924
842
|
for (const f of t)
|
|
925
843
|
f.key == null ? l.push(f) : a.has(f.key) || a.set(f.key, f);
|
|
926
|
-
const u = /* @__PURE__ */ new Set(),
|
|
927
|
-
let
|
|
844
|
+
const u = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), b = [];
|
|
845
|
+
let pe = 0;
|
|
928
846
|
for (const f of o) {
|
|
929
|
-
const
|
|
930
|
-
if (
|
|
931
|
-
if (u.has(
|
|
932
|
-
u.add(
|
|
847
|
+
const d = E(f);
|
|
848
|
+
if (d != null) {
|
|
849
|
+
if (u.has(d)) throw new Error(`Duplicate sibling key: ${String(d)}`);
|
|
850
|
+
u.add(d);
|
|
933
851
|
}
|
|
934
|
-
const
|
|
935
|
-
|
|
852
|
+
const C = d == null ? l[pe++] : a.get(d);
|
|
853
|
+
C && le(C, f) ? (p.add(C), b.push(se(C, f, r))) : b.push(j(f, r));
|
|
936
854
|
}
|
|
937
855
|
for (const f of t)
|
|
938
|
-
|
|
939
|
-
let
|
|
940
|
-
for (const f of
|
|
941
|
-
for (const
|
|
942
|
-
|
|
943
|
-
return
|
|
856
|
+
p.has(f) || g(f, !0);
|
|
857
|
+
let v = i ? i.nextSibling : e.firstChild;
|
|
858
|
+
for (const f of b)
|
|
859
|
+
for (const d of w(f))
|
|
860
|
+
d === v ? v = v.nextSibling : (e.insertBefore(d, v ?? s), v = d.nextSibling);
|
|
861
|
+
return b;
|
|
944
862
|
}
|
|
945
863
|
function oe(e, t) {
|
|
946
|
-
const { children:
|
|
864
|
+
const { children: n, ...r } = t, s = e.props, i = /* @__PURE__ */ new Set([...Object.keys(s), ...Object.keys(r)]);
|
|
947
865
|
for (const o of ["value", "checked"])
|
|
948
|
-
if (Object.hasOwn(
|
|
866
|
+
if (Object.hasOwn(r, o) && Object.hasOwn(r, `bind:${o}`))
|
|
949
867
|
throw new Error(`${o} and bind:${o} cannot be used together`);
|
|
950
|
-
for (const o of
|
|
951
|
-
const a =
|
|
952
|
-
if (
|
|
953
|
-
|
|
868
|
+
for (const o of i) {
|
|
869
|
+
const a = s[o], l = r[o];
|
|
870
|
+
if (qe(o))
|
|
871
|
+
ke(e, o, l);
|
|
954
872
|
else if (o === "ref")
|
|
955
|
-
a !== l &&
|
|
956
|
-
else if (
|
|
957
|
-
|
|
873
|
+
a !== l && ze(e, l);
|
|
874
|
+
else if (Me(o))
|
|
875
|
+
Fe(e, o, l);
|
|
958
876
|
else if (T(l))
|
|
959
|
-
|
|
877
|
+
Ne(e, o, l);
|
|
960
878
|
else {
|
|
961
879
|
const u = e.liveProps.get(o);
|
|
962
880
|
u && (u.unsubscribe(), e.liveProps.delete(o));
|
|
963
|
-
const
|
|
964
|
-
Object.is(
|
|
881
|
+
const p = (u == null ? void 0 : u.value) ?? a;
|
|
882
|
+
Object.is(p, l) || S(e.node, o, p, l);
|
|
965
883
|
}
|
|
966
884
|
}
|
|
967
|
-
e.props = { ...
|
|
968
|
-
}
|
|
969
|
-
function
|
|
970
|
-
const
|
|
971
|
-
if ((
|
|
972
|
-
|
|
973
|
-
const
|
|
974
|
-
|
|
975
|
-
const
|
|
976
|
-
source:
|
|
977
|
-
value:
|
|
885
|
+
e.props = { ...r };
|
|
886
|
+
}
|
|
887
|
+
function Ne(e, t, n) {
|
|
888
|
+
const r = e.liveProps.get(t);
|
|
889
|
+
if ((r == null ? void 0 : r.source) === n.emitter) return;
|
|
890
|
+
r == null || r.unsubscribe();
|
|
891
|
+
const s = n.emitter.get();
|
|
892
|
+
S(e.node, t, (r == null ? void 0 : r.value) ?? e.props[t], s);
|
|
893
|
+
const i = {
|
|
894
|
+
source: n.emitter,
|
|
895
|
+
value: s,
|
|
978
896
|
unsubscribe: () => {
|
|
979
897
|
}
|
|
980
898
|
};
|
|
981
|
-
|
|
982
|
-
const a =
|
|
983
|
-
|
|
984
|
-
}, { emitCurrent: !1 }), e.liveProps.set(t,
|
|
985
|
-
}
|
|
986
|
-
function
|
|
987
|
-
const
|
|
988
|
-
if (
|
|
989
|
-
|
|
899
|
+
i.unsubscribe = n.emitter.subscribe(({ value: o }) => {
|
|
900
|
+
const a = i.value;
|
|
901
|
+
i.value = o, Object.is(a, o) || S(e.node, t, a, o);
|
|
902
|
+
}, { emitCurrent: !1 }), e.liveProps.set(t, i);
|
|
903
|
+
}
|
|
904
|
+
function ke(e, t, n) {
|
|
905
|
+
const r = t.slice(5), s = e.nativeBindings.get(t);
|
|
906
|
+
if (n == null) {
|
|
907
|
+
s && (s.unsubscribe(), e.node.removeEventListener(s.eventName, s.listener), e.nativeBindings.delete(t), S(e.node, r, s.value, void 0));
|
|
990
908
|
return;
|
|
991
909
|
}
|
|
992
|
-
if (
|
|
993
|
-
|
|
994
|
-
const
|
|
995
|
-
|
|
910
|
+
if (xe(n, t), (s == null ? void 0 : s.source) === n) return;
|
|
911
|
+
s && (s.unsubscribe(), e.node.removeEventListener(s.eventName, s.listener)), Ve(e.node, r);
|
|
912
|
+
const i = He(e.node, r), o = n.get();
|
|
913
|
+
S(e.node, r, s == null ? void 0 : s.value, o);
|
|
996
914
|
const a = () => {
|
|
997
|
-
|
|
915
|
+
n.set(Reflect.get(e.node, r), `${t} changed`);
|
|
998
916
|
}, l = {
|
|
999
|
-
source:
|
|
917
|
+
source: n,
|
|
1000
918
|
value: o,
|
|
1001
|
-
eventName:
|
|
919
|
+
eventName: i,
|
|
1002
920
|
listener: a,
|
|
1003
921
|
unsubscribe: () => {
|
|
1004
922
|
}
|
|
1005
923
|
};
|
|
1006
|
-
l.unsubscribe =
|
|
1007
|
-
const
|
|
1008
|
-
l.value = u, Object.is(
|
|
1009
|
-
}, { emitCurrent: !1 }), e.node.addEventListener(
|
|
1010
|
-
}
|
|
1011
|
-
function
|
|
1012
|
-
const
|
|
1013
|
-
if (
|
|
924
|
+
l.unsubscribe = n.subscribe(({ value: u }) => {
|
|
925
|
+
const p = l.value;
|
|
926
|
+
l.value = u, Object.is(p, u) || S(e.node, r, p, u);
|
|
927
|
+
}, { emitCurrent: !1 }), e.node.addEventListener(i, a), e.nativeBindings.set(t, l);
|
|
928
|
+
}
|
|
929
|
+
function Fe(e, t, n) {
|
|
930
|
+
const r = t.slice(2).toLowerCase(), s = e.listeners.get(t);
|
|
931
|
+
if (s && s !== n && (e.node.removeEventListener(r, s), e.listeners.delete(t)), n != null && typeof n != "function")
|
|
1014
932
|
throw new TypeError(`${t} must be a function or null`);
|
|
1015
|
-
if (typeof
|
|
1016
|
-
const
|
|
1017
|
-
e.node.addEventListener(
|
|
933
|
+
if (typeof n == "function" && s !== n) {
|
|
934
|
+
const i = n;
|
|
935
|
+
e.node.addEventListener(r, i), e.listeners.set(t, i);
|
|
1018
936
|
}
|
|
1019
937
|
}
|
|
1020
|
-
function
|
|
1021
|
-
if (
|
|
938
|
+
function ze(e, t) {
|
|
939
|
+
if (L(e.ref, null), t != null && typeof t != "function" && typeof t != "object")
|
|
1022
940
|
throw new TypeError("ref must be a function, object, or null");
|
|
1023
|
-
e.ref = t,
|
|
941
|
+
e.ref = t, L(e.ref, e.node);
|
|
1024
942
|
}
|
|
1025
|
-
function
|
|
943
|
+
function S(e, t, n, r) {
|
|
1026
944
|
if (t === "class" || t === "className") {
|
|
1027
|
-
|
|
945
|
+
F(e, "class", r);
|
|
1028
946
|
return;
|
|
1029
947
|
}
|
|
1030
948
|
if (t === "for" || t === "htmlFor") {
|
|
1031
|
-
|
|
949
|
+
F(e, "for", r);
|
|
1032
950
|
return;
|
|
1033
951
|
}
|
|
1034
952
|
if (t === "dataset") {
|
|
1035
|
-
|
|
953
|
+
_e(e, n, r);
|
|
1036
954
|
return;
|
|
1037
955
|
}
|
|
1038
956
|
if (t === "style") {
|
|
1039
|
-
|
|
957
|
+
Be(e, n, r);
|
|
1040
958
|
return;
|
|
1041
959
|
}
|
|
1042
960
|
if (t === "dangerouslySetInnerHTML")
|
|
1043
961
|
throw new Error("dangerouslySetInnerHTML is not supported");
|
|
1044
|
-
const
|
|
1045
|
-
if (
|
|
1046
|
-
const
|
|
1047
|
-
|
|
962
|
+
const s = Le(t);
|
|
963
|
+
if (Ce.has(s)) {
|
|
964
|
+
const i = !!r;
|
|
965
|
+
s in e && Reflect.set(e, s, i), e.toggleAttribute(z(t), i);
|
|
1048
966
|
return;
|
|
1049
967
|
}
|
|
1050
|
-
if (
|
|
1051
|
-
const
|
|
1052
|
-
Object.is(Reflect.get(e,
|
|
968
|
+
if (Pe.has(s) && s in e) {
|
|
969
|
+
const i = r ?? (s === "value" ? "" : !1);
|
|
970
|
+
Object.is(Reflect.get(e, s), i) || Reflect.set(e, s, i), r == null && e.removeAttribute(z(t));
|
|
1053
971
|
return;
|
|
1054
972
|
}
|
|
1055
|
-
|
|
973
|
+
F(e, z(t), r);
|
|
1056
974
|
}
|
|
1057
|
-
function
|
|
1058
|
-
const
|
|
1059
|
-
for (const
|
|
1060
|
-
const o = i
|
|
1061
|
-
o == null ? delete e.dataset[
|
|
975
|
+
function _e(e, t, n) {
|
|
976
|
+
const r = N(t, "dataset"), s = N(n, "dataset");
|
|
977
|
+
for (const i of /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(s)])) {
|
|
978
|
+
const o = s[i];
|
|
979
|
+
o == null ? delete e.dataset[i] : e.dataset[i] = String(o);
|
|
1062
980
|
}
|
|
1063
981
|
}
|
|
1064
|
-
function
|
|
1065
|
-
if (typeof
|
|
1066
|
-
e.style.cssText =
|
|
982
|
+
function Be(e, t, n) {
|
|
983
|
+
if (typeof n == "string") {
|
|
984
|
+
e.style.cssText = n;
|
|
1067
985
|
return;
|
|
1068
986
|
}
|
|
1069
|
-
const
|
|
987
|
+
const r = typeof t == "string" ? {} : N(t, "style"), s = N(n, "style");
|
|
1070
988
|
typeof t == "string" && (e.style.cssText = "");
|
|
1071
|
-
for (const
|
|
1072
|
-
const o = i
|
|
1073
|
-
|
|
989
|
+
for (const i of /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(s)])) {
|
|
990
|
+
const o = s[i];
|
|
991
|
+
i.startsWith("--") ? o == null ? e.style.removeProperty(i) : e.style.setProperty(i, String(o)) : Reflect.set(e.style, i, o == null ? "" : String(o));
|
|
1074
992
|
}
|
|
1075
993
|
}
|
|
1076
|
-
function
|
|
994
|
+
function N(e, t) {
|
|
1077
995
|
if (e == null) return {};
|
|
1078
996
|
if (typeof e != "object" || Array.isArray(e))
|
|
1079
997
|
throw new TypeError(`${t} must be an object or null`);
|
|
1080
998
|
return e;
|
|
1081
999
|
}
|
|
1082
|
-
function
|
|
1083
|
-
|
|
1000
|
+
function F(e, t, n) {
|
|
1001
|
+
n == null || n === !1 ? e.removeAttribute(t) : n === !0 ? e.setAttribute(t, "") : e.setAttribute(t, String(n));
|
|
1084
1002
|
}
|
|
1085
|
-
function
|
|
1003
|
+
function Le(e) {
|
|
1086
1004
|
return e === "readonly" ? "readOnly" : e === "autofocus" ? "autoFocus" : e;
|
|
1087
1005
|
}
|
|
1088
|
-
function
|
|
1006
|
+
function z(e) {
|
|
1089
1007
|
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()}`);
|
|
1090
1008
|
}
|
|
1091
1009
|
function G(e) {
|
|
1092
1010
|
return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
|
|
1093
1011
|
}
|
|
1094
|
-
function
|
|
1012
|
+
function L(e, t) {
|
|
1095
1013
|
e != null && (typeof e == "function" ? e(t) : e.current = t);
|
|
1096
1014
|
}
|
|
1097
1015
|
function g(e, t) {
|
|
1098
1016
|
if (e.kind === "emitter") {
|
|
1099
1017
|
if (e.unsubscribe(), g(e.child, !1), t)
|
|
1100
|
-
for (const
|
|
1018
|
+
for (const n of w(e)) n.remove();
|
|
1101
1019
|
return;
|
|
1102
1020
|
}
|
|
1103
1021
|
if (e.kind === "component") {
|
|
1104
|
-
for (const
|
|
1022
|
+
for (const n of e.liveProps.values()) n.unsubscribe();
|
|
1105
1023
|
e.liveProps.clear(), e.owner._childComponents.delete(e.instance), e.instance.destroy();
|
|
1106
1024
|
return;
|
|
1107
1025
|
}
|
|
1108
1026
|
if (e.kind === "function") {
|
|
1109
|
-
for (const
|
|
1027
|
+
for (const n of e.liveProps.values()) n.unsubscribe();
|
|
1110
1028
|
e.liveProps.clear(), g(e.child, t);
|
|
1111
1029
|
return;
|
|
1112
1030
|
}
|
|
1113
1031
|
if (e.kind === "element") {
|
|
1114
|
-
|
|
1115
|
-
for (const [
|
|
1116
|
-
e.node.removeEventListener(
|
|
1032
|
+
L(e.ref, null);
|
|
1033
|
+
for (const [n, r] of e.listeners)
|
|
1034
|
+
e.node.removeEventListener(n.slice(2).toLowerCase(), r);
|
|
1117
1035
|
e.listeners.clear();
|
|
1118
|
-
for (const
|
|
1036
|
+
for (const n of e.liveProps.values()) n.unsubscribe();
|
|
1119
1037
|
e.liveProps.clear();
|
|
1120
|
-
for (const
|
|
1121
|
-
|
|
1038
|
+
for (const n of e.nativeBindings.values())
|
|
1039
|
+
n.unsubscribe(), e.node.removeEventListener(n.eventName, n.listener);
|
|
1122
1040
|
e.nativeBindings.clear();
|
|
1123
|
-
for (const
|
|
1041
|
+
for (const n of e.children) g(n, !1);
|
|
1124
1042
|
t && e.node.remove();
|
|
1125
1043
|
return;
|
|
1126
1044
|
}
|
|
1127
1045
|
if (e.kind === "fragment") {
|
|
1128
|
-
for (const
|
|
1046
|
+
for (const n of e.children) g(n, !1);
|
|
1129
1047
|
if (t)
|
|
1130
|
-
for (const
|
|
1048
|
+
for (const n of w(e)) n.remove();
|
|
1131
1049
|
return;
|
|
1132
1050
|
}
|
|
1133
1051
|
t && e.node.remove();
|
|
1134
1052
|
}
|
|
1135
|
-
function H(e, t,
|
|
1053
|
+
function H(e, t, n = null) {
|
|
1136
1054
|
if (t != null)
|
|
1137
|
-
for (const
|
|
1055
|
+
for (const r of w(t)) e.insertBefore(r, n);
|
|
1138
1056
|
}
|
|
1139
|
-
function
|
|
1057
|
+
function w(e) {
|
|
1140
1058
|
if (e == null) return [];
|
|
1141
1059
|
if (e.kind === "text" || e.kind === "element") return [e.node];
|
|
1142
|
-
if (e.kind === "component") return
|
|
1143
|
-
if (e.kind === "function") return
|
|
1060
|
+
if (e.kind === "component") return w(e.instance._rendered);
|
|
1061
|
+
if (e.kind === "function") return w(e.child);
|
|
1144
1062
|
const t = [];
|
|
1145
|
-
let
|
|
1146
|
-
for (;
|
|
1147
|
-
|
|
1063
|
+
let n = e.start;
|
|
1064
|
+
for (; n && (t.push(n), n !== e.end); )
|
|
1065
|
+
n = n.nextSibling;
|
|
1148
1066
|
return t;
|
|
1149
1067
|
}
|
|
1150
1068
|
function ae(e) {
|
|
1151
|
-
return
|
|
1069
|
+
return w(e)[0] ?? null;
|
|
1152
1070
|
}
|
|
1153
1071
|
function E(e) {
|
|
1154
|
-
return e instanceof
|
|
1072
|
+
return e instanceof m ? ce(e.props) : y(e) ? e.key : null;
|
|
1155
1073
|
}
|
|
1156
1074
|
function ce(e) {
|
|
1157
1075
|
const t = e.key;
|
|
1158
1076
|
return typeof t == "string" || typeof t == "number" ? t : null;
|
|
1159
1077
|
}
|
|
1160
1078
|
function le(e, t) {
|
|
1161
|
-
return e.kind === "text" ? typeof t == "string" || typeof t == "number" : e.kind === "emitter" ?
|
|
1079
|
+
return e.kind === "text" ? typeof t == "string" || typeof t == "number" : e.kind === "emitter" ? k(t) && e.source === t : e.kind === "component" ? t instanceof m ? e.instance === t : y(t) && ue(t.type) && e.type === t.type && e.key === E(t) : e.kind === "function" ? y(t) && e.type === t.type && e.key === E(t) : e.kind === "fragment" ? y(t) && t.type === A && e.key === E(t) : y(t) && typeof t.type == "string" && e.type === t.type && e.key === E(t);
|
|
1162
1080
|
}
|
|
1163
1081
|
function y(e) {
|
|
1164
1082
|
return e != null && typeof e == "object" && Object.hasOwn(e, "type");
|
|
1165
1083
|
}
|
|
1166
1084
|
function ue(e) {
|
|
1167
|
-
return typeof e == "function" && (e ===
|
|
1085
|
+
return typeof e == "function" && (e === m || e.prototype instanceof m);
|
|
1168
1086
|
}
|
|
1169
|
-
function
|
|
1087
|
+
function Me(e) {
|
|
1170
1088
|
return /^on[A-Z]/.test(e);
|
|
1171
1089
|
}
|
|
1172
|
-
function
|
|
1090
|
+
function qe(e) {
|
|
1173
1091
|
return e === "bind:value" || e === "bind:checked";
|
|
1174
1092
|
}
|
|
1175
1093
|
function T(e) {
|
|
1176
|
-
return e != null && typeof e == "object" &&
|
|
1094
|
+
return e != null && typeof e == "object" && ne.has(e);
|
|
1177
1095
|
}
|
|
1178
|
-
function
|
|
1096
|
+
function k(e) {
|
|
1179
1097
|
return (typeof e != "object" || e == null) && typeof e != "function" ? !1 : typeof Reflect.get(e, "get") == "function" && typeof Reflect.get(e, "getFetchState") == "function" && typeof Reflect.get(e, "getError") == "function" && typeof Reflect.get(e, "subscribe") == "function";
|
|
1180
1098
|
}
|
|
1181
1099
|
function I(e, t) {
|
|
1182
|
-
if (
|
|
1100
|
+
if (!k(e)) throw new TypeError(`${t} requires a readable emitter`);
|
|
1183
1101
|
}
|
|
1184
|
-
function
|
|
1102
|
+
function xe(e, t) {
|
|
1185
1103
|
if (I(e, t), typeof Reflect.get(e, "set") != "function")
|
|
1186
1104
|
throw new TypeError(`${t} requires a writable emitter`);
|
|
1187
1105
|
}
|
|
1188
1106
|
function Ve(e, t) {
|
|
1189
|
-
const
|
|
1190
|
-
if (!(t === "checked" ?
|
|
1107
|
+
const n = e.localName;
|
|
1108
|
+
if (!(t === "checked" ? n === "input" : n === "input" || n === "textarea" || n === "select")) throw new TypeError(`bind:${t} is not supported on ${n}`);
|
|
1191
1109
|
}
|
|
1192
1110
|
function He(e, t) {
|
|
1193
1111
|
return t === "value" && e.localName !== "select" ? "input" : "change";
|
|
@@ -1209,48 +1127,48 @@ function De(e) {
|
|
|
1209
1127
|
return e.map((t) => {
|
|
1210
1128
|
if (!Array.isArray(t) || t.length < 2 || typeof t[0] != "string")
|
|
1211
1129
|
throw new TypeError("Component baseStyles entries must be selector/style tuples");
|
|
1212
|
-
const
|
|
1213
|
-
if (typeof
|
|
1130
|
+
const n = t[1];
|
|
1131
|
+
if (typeof n != "string" && (!Array.isArray(n) || n.some((r) => typeof r != "string")))
|
|
1214
1132
|
throw new TypeError("Component base style names must be strings");
|
|
1215
|
-
return [t[0],
|
|
1133
|
+
return [t[0], n];
|
|
1216
1134
|
});
|
|
1217
1135
|
if (typeof e != "object")
|
|
1218
1136
|
throw new TypeError("Component baseStyles must be an object or tuple array");
|
|
1219
|
-
return Object.entries(e).map(([t,
|
|
1137
|
+
return Object.entries(e).map(([t, n]) => [
|
|
1220
1138
|
t,
|
|
1221
|
-
|
|
1139
|
+
n
|
|
1222
1140
|
]);
|
|
1223
1141
|
}
|
|
1224
|
-
function fe(e, t,
|
|
1225
|
-
const
|
|
1226
|
-
return
|
|
1142
|
+
function fe(e, t, n) {
|
|
1143
|
+
const r = t == null ? {} : { ...t };
|
|
1144
|
+
return n !== void 0 && (r.key = n), O(e, r);
|
|
1227
1145
|
}
|
|
1228
1146
|
const Je = fe, Qe = fe;
|
|
1229
1147
|
function Xe(e) {
|
|
1230
|
-
if (!(e instanceof
|
|
1148
|
+
if (!(e instanceof m))
|
|
1231
1149
|
throw new TypeError("createPrebuiltElement requires a Component instance");
|
|
1232
1150
|
return e;
|
|
1233
1151
|
}
|
|
1234
1152
|
export {
|
|
1235
|
-
|
|
1236
|
-
|
|
1153
|
+
m as C,
|
|
1154
|
+
A as F,
|
|
1237
1155
|
te as S,
|
|
1238
1156
|
Je as a,
|
|
1239
|
-
|
|
1157
|
+
M as b,
|
|
1240
1158
|
Ge as c,
|
|
1241
1159
|
Q as d,
|
|
1242
1160
|
Ze as e,
|
|
1243
|
-
|
|
1161
|
+
ve as f,
|
|
1244
1162
|
ye as g,
|
|
1245
1163
|
W as h,
|
|
1246
1164
|
y as i,
|
|
1247
1165
|
fe as j,
|
|
1248
1166
|
Ue as k,
|
|
1249
|
-
|
|
1167
|
+
O as l,
|
|
1250
1168
|
Qe as m,
|
|
1251
1169
|
Ye as n,
|
|
1252
1170
|
Xe as o,
|
|
1253
1171
|
We as p,
|
|
1254
|
-
|
|
1172
|
+
be as s
|
|
1255
1173
|
};
|
|
1256
|
-
//# sourceMappingURL=jsx-dev-runtime-
|
|
1174
|
+
//# sourceMappingURL=jsx-dev-runtime-CqunwZ8j.js.map
|