@sylwellsoftware/fray 0.5.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 +198 -30
- 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/component.d.ts.map +1 -1
- 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/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/dropdown.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/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.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2485 -1456
- package/dist/index.js.map +1 -1
- package/dist/{jsx-dev-runtime-pzseD2Sz.js → jsx-dev-runtime-Kf1Dhu-y.js} +412 -469
- 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/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 +220 -429
- package/themes/README.md +68 -66
- package/themes/dark.css +60 -1
- package/themes/java/theme.css +422 -135
- package/themes/light.css +60 -1
- package/themes/minimal/theme.css +420 -125
- package/themes/shiny/theme.css +492 -294
- package/dist/jsx-dev-runtime-pzseD2Sz.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: '""',
|
|
@@ -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,46 +61,22 @@ 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-${
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
76
|
+
constructor(t = `runtime-${me++}`) {
|
|
77
|
+
a(this, "id");
|
|
78
|
+
a(this, "cssFragments", /* @__PURE__ */ new Set());
|
|
79
|
+
a(this, "baseStyleMap", /* @__PURE__ */ new Map());
|
|
162
80
|
if (typeof t != "string") throw new TypeError("StyleRegistry id must be a string");
|
|
163
81
|
this.id = t;
|
|
164
82
|
}
|
|
@@ -166,13 +84,13 @@ 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 i of
|
|
93
|
+
for (const i of r) {
|
|
176
94
|
if (!Object.hasOwn(D, i))
|
|
177
95
|
throw new Error(`Unknown Fray base style: ${String(i)}`);
|
|
178
96
|
const s = i, o = this.baseStyleMap.get(s) ?? /* @__PURE__ */ new Set();
|
|
@@ -203,13 +121,13 @@ class Q {
|
|
|
203
121
|
}
|
|
204
122
|
generateBaseStyleCSS() {
|
|
205
123
|
let t = "";
|
|
206
|
-
for (const [
|
|
207
|
-
const { properties: i, variants: s } = ge(D[
|
|
208
|
-
t += U(
|
|
209
|
-
for (const [
|
|
124
|
+
for (const [n, r] of this.baseStyleMap) {
|
|
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))
|
|
210
128
|
t += U(
|
|
211
|
-
`${
|
|
212
|
-
o.map((u) =>
|
|
129
|
+
`${n}${c}`,
|
|
130
|
+
o.map((u) => we(u, c)),
|
|
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
|
-
|
|
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));
|
|
235
153
|
const i = this.generateCSS();
|
|
236
|
-
return
|
|
154
|
+
return r.textContent !== i && (r.textContent = i), 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 (
|
|
166
|
+
let n = {};
|
|
167
|
+
for (const [r, i] of Object.entries(e))
|
|
168
|
+
if (r === "variants") {
|
|
251
169
|
if (typeof i != "object")
|
|
252
170
|
throw new TypeError("Base style variants must be declaration maps");
|
|
253
|
-
|
|
171
|
+
n = i;
|
|
254
172
|
} else if (typeof i == "string")
|
|
255
|
-
t[
|
|
173
|
+
t[r] = i;
|
|
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(([i, s]) => ` ${i}: ${s};`).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,44 +202,44 @@ function Ue(e) {
|
|
|
284
202
|
return X.add(t), t;
|
|
285
203
|
}
|
|
286
204
|
function We(e, t) {
|
|
287
|
-
if (
|
|
205
|
+
if (x(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 = []) {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
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);
|
|
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(), x(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 i = [...this.resolving.slice(
|
|
232
|
+
if (this.assertActive(), x(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 i = [...this.resolving.slice(r), t].map((s) => s.name).join(" -> ");
|
|
320
238
|
throw new Error(`Circular service dependency: ${i}`);
|
|
321
239
|
}
|
|
322
240
|
this.resolving.push(t);
|
|
323
241
|
try {
|
|
324
|
-
const i =
|
|
242
|
+
const i = n.create(this);
|
|
325
243
|
return this.instances.set(t, i), this.creationOrder.push(t), i;
|
|
326
244
|
} finally {
|
|
327
245
|
this.resolving.pop();
|
|
@@ -331,11 +249,11 @@ 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 i =
|
|
338
|
-
i != null && i.call(
|
|
255
|
+
const i = Ce(r);
|
|
256
|
+
i != null && i.call(r);
|
|
339
257
|
} catch (i) {
|
|
340
258
|
t.push(i);
|
|
341
259
|
}
|
|
@@ -348,25 +266,25 @@ 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 x(e) {
|
|
358
276
|
if (!Ee(e)) throw new TypeError("Expected a service key created by defineService()");
|
|
359
277
|
}
|
|
360
278
|
function Re(e) {
|
|
361
279
|
if (e == null || typeof e != "object" && typeof e != "function" || !ee.has(e))
|
|
362
280
|
throw new TypeError("Expected a service provider created by provideService()");
|
|
363
281
|
}
|
|
364
|
-
function
|
|
282
|
+
function Ce(e) {
|
|
365
283
|
if (e == null || typeof e != "object" && typeof e != "function") return null;
|
|
366
284
|
const t = Reflect.get(e, "dispose");
|
|
367
285
|
return typeof t == "function" ? t : null;
|
|
368
286
|
}
|
|
369
|
-
const
|
|
287
|
+
const je = /* @__PURE__ */ new Set([
|
|
370
288
|
"annotation-xml",
|
|
371
289
|
"color-profile",
|
|
372
290
|
"font-face",
|
|
@@ -377,45 +295,57 @@ const Te = /* @__PURE__ */ new Set([
|
|
|
377
295
|
"missing-glyph"
|
|
378
296
|
]);
|
|
379
297
|
class L {
|
|
380
|
-
constructor(t = {},
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
298
|
+
constructor(t = {}, n = ye()) {
|
|
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());
|
|
385
305
|
if (t == null || typeof t != "object" || Array.isArray(t))
|
|
386
306
|
throw new TypeError("FrayRuntime options must be an object");
|
|
387
|
-
const
|
|
388
|
-
if (
|
|
307
|
+
const r = t.elementNames ?? {};
|
|
308
|
+
if (r == null || typeof r != "object" || Array.isArray(r))
|
|
389
309
|
throw new TypeError("Fray elementNames must be an object");
|
|
390
|
-
const i =
|
|
391
|
-
i !== null &&
|
|
392
|
-
const s =
|
|
310
|
+
const i = r.prefix === void 0 ? "fray" : r.prefix;
|
|
311
|
+
i !== null && P(i, "Fray element prefix");
|
|
312
|
+
const s = r.overrides ?? {};
|
|
393
313
|
if (s == null || typeof s != "object" || Array.isArray(s))
|
|
394
314
|
throw new TypeError("Fray element-name overrides must be an object");
|
|
395
|
-
for (const [o,
|
|
396
|
-
|
|
397
|
-
if (this.elementPrefix = i, this.elementNameOverrides = Object.freeze({ ...s }), this.styleRegistry =
|
|
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))
|
|
398
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");
|
|
399
321
|
}
|
|
400
|
-
resolveElementName(t,
|
|
401
|
-
|
|
402
|
-
const i = this.elementNameOverrides[t] ?? (this.elementPrefix == null ?
|
|
322
|
+
resolveElementName(t, n = null) {
|
|
323
|
+
P(t, "Fray component host name");
|
|
324
|
+
const i = this.elementNameOverrides[t] ?? (this.elementPrefix == null ? n ?? t : `${this.elementPrefix}-${t}`);
|
|
403
325
|
return Z(i), i;
|
|
404
326
|
}
|
|
405
|
-
resolveHostSelector(t,
|
|
327
|
+
resolveHostSelector(t, n, r = null) {
|
|
406
328
|
if (typeof t != "string") throw new TypeError("Host selector must be a string");
|
|
407
|
-
return t.replaceAll("&", this.resolveElementName(
|
|
329
|
+
return t.replaceAll("&", this.resolveElementName(n, r));
|
|
408
330
|
}
|
|
409
|
-
resolveHostCSS(t,
|
|
331
|
+
resolveHostCSS(t, n, r = null) {
|
|
410
332
|
if (typeof t != "string") throw new TypeError("Host CSS must be a string");
|
|
411
|
-
return t.replaceAll("&", this.resolveElementName(
|
|
333
|
+
return t.replaceAll("&", this.resolveElementName(n, r));
|
|
412
334
|
}
|
|
413
|
-
create(t, ...
|
|
414
|
-
const
|
|
415
|
-
return
|
|
335
|
+
create(t, ...n) {
|
|
336
|
+
const r = new t(...n);
|
|
337
|
+
return r._setRuntime(this), r;
|
|
416
338
|
}
|
|
417
|
-
mount(t,
|
|
418
|
-
|
|
339
|
+
mount(t, n, r = null) {
|
|
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;
|
|
419
349
|
}
|
|
420
350
|
registerStyles(t) {
|
|
421
351
|
if (t == null || typeof t.registerStyles != "function")
|
|
@@ -429,16 +359,16 @@ class L {
|
|
|
429
359
|
function Ze(e = {}) {
|
|
430
360
|
return new L(e);
|
|
431
361
|
}
|
|
432
|
-
const W = new L({},
|
|
433
|
-
function
|
|
362
|
+
const W = new L({}, be);
|
|
363
|
+
function P(e, t) {
|
|
434
364
|
if (typeof e != "string" || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))
|
|
435
365
|
throw new TypeError(`${t} must be a lowercase kebab-case name`);
|
|
436
366
|
}
|
|
437
367
|
function Z(e) {
|
|
438
|
-
if (
|
|
368
|
+
if (P(e, "Fray element name"), !e.includes("-") || je.has(e))
|
|
439
369
|
throw new TypeError(`Fray element name must be a non-reserved name containing a hyphen: ${e}`);
|
|
440
370
|
}
|
|
441
|
-
const
|
|
371
|
+
const A = Symbol.for("@sylwellsoftware/fray.Fragment"), ne = /* @__PURE__ */ new WeakSet(), Te = /* @__PURE__ */ new Set([
|
|
442
372
|
"allowFullScreen",
|
|
443
373
|
"async",
|
|
444
374
|
"autoFocus",
|
|
@@ -462,7 +392,7 @@ const P = Symbol.for("@sylwellsoftware/fray.Fragment"), re = /* @__PURE__ */ new
|
|
|
462
392
|
"required",
|
|
463
393
|
"reversed",
|
|
464
394
|
"selected"
|
|
465
|
-
]),
|
|
395
|
+
]), Pe = /* @__PURE__ */ new Set([
|
|
466
396
|
"checked",
|
|
467
397
|
"defaultChecked",
|
|
468
398
|
"defaultValue",
|
|
@@ -480,76 +410,78 @@ const P = Symbol.for("@sylwellsoftware/fray.Fragment"), re = /* @__PURE__ */ new
|
|
|
480
410
|
function Ye(e) {
|
|
481
411
|
I(e, "live");
|
|
482
412
|
const t = Object.freeze({ emitter: e });
|
|
483
|
-
return
|
|
413
|
+
return ne.add(t), t;
|
|
484
414
|
}
|
|
485
|
-
function
|
|
486
|
-
const
|
|
487
|
-
if (typeof
|
|
415
|
+
function O(e, t = null, ...n) {
|
|
416
|
+
const r = t ?? {};
|
|
417
|
+
if (typeof r != "object" || Array.isArray(r))
|
|
488
418
|
throw new TypeError("VNode props must be an object or null");
|
|
489
419
|
const {
|
|
490
420
|
children: i,
|
|
491
421
|
key: s = null,
|
|
492
422
|
...o
|
|
493
|
-
} =
|
|
423
|
+
} = r;
|
|
494
424
|
return {
|
|
495
425
|
type: e,
|
|
496
426
|
key: s,
|
|
497
427
|
props: {
|
|
498
428
|
...o,
|
|
499
|
-
children:
|
|
429
|
+
children: re([i, n])
|
|
500
430
|
}
|
|
501
431
|
};
|
|
502
432
|
}
|
|
503
433
|
function Ge(e, ...t) {
|
|
504
|
-
return e.reduce((
|
|
434
|
+
return e.reduce((n, r, i) => n + r + String(t[i] ?? ""), "");
|
|
505
435
|
}
|
|
506
|
-
const
|
|
436
|
+
const d = class d {
|
|
507
437
|
constructor(t = {}) {
|
|
508
|
-
|
|
509
|
-
|
|
438
|
+
a(this, "props");
|
|
439
|
+
a(this, "dom", null);
|
|
510
440
|
/** @internal */
|
|
511
|
-
|
|
441
|
+
a(this, "_rendered", null);
|
|
512
442
|
/** @internal */
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
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);
|
|
523
453
|
/** @internal */
|
|
524
|
-
|
|
454
|
+
a(this, "_runtime", W);
|
|
455
|
+
/** @internal Route lineage inherited by nested routed components. */
|
|
456
|
+
a(this, "_routeContext", null);
|
|
525
457
|
/** JSX component for this instance's runtime-configured custom host. */
|
|
526
|
-
|
|
458
|
+
a(this, "Host", ({
|
|
527
459
|
children: t = [],
|
|
528
|
-
...
|
|
529
|
-
}) => this.host(
|
|
460
|
+
...n
|
|
461
|
+
}) => this.host(n, t));
|
|
530
462
|
if (t == null || typeof t != "object" || Array.isArray(t))
|
|
531
463
|
throw new TypeError(`${this.constructor.name} props must be an object`);
|
|
532
464
|
this.props = t;
|
|
533
465
|
}
|
|
534
466
|
static new(...t) {
|
|
535
|
-
const
|
|
536
|
-
if (!(
|
|
467
|
+
const n = new this(...t);
|
|
468
|
+
if (!(n instanceof d))
|
|
537
469
|
throw new TypeError("Component.new() requires a Component constructor");
|
|
538
|
-
return
|
|
470
|
+
return n.mount();
|
|
539
471
|
}
|
|
540
472
|
static get baseStyles() {
|
|
541
473
|
return {};
|
|
542
474
|
}
|
|
543
|
-
static registerStyles(t = W,
|
|
544
|
-
if (
|
|
545
|
-
|
|
546
|
-
const
|
|
547
|
-
this.css && t.styleRegistry.registerCSS(
|
|
475
|
+
static registerStyles(t = W, n = /* @__PURE__ */ new Set()) {
|
|
476
|
+
if (n.has(this)) return;
|
|
477
|
+
n.add(this);
|
|
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));
|
|
548
480
|
const s = De(this.baseStyles);
|
|
549
|
-
for (const [o,
|
|
550
|
-
t.styleRegistry.registerBaseStyle(
|
|
481
|
+
for (const [o, c] of s)
|
|
482
|
+
t.styleRegistry.registerBaseStyle(r == null ? o : t.resolveHostSelector(o, r, i), c);
|
|
551
483
|
for (const o of this.dependencies ?? [])
|
|
552
|
-
o.registerStyles(t,
|
|
484
|
+
o.registerStyles(t, n);
|
|
553
485
|
}
|
|
554
486
|
/** One-time setup hook. Constructors must not subscribe or render. */
|
|
555
487
|
initialize() {
|
|
@@ -558,31 +490,42 @@ const h = class h {
|
|
|
558
490
|
throw new Error(`${this.constructor.name} must implement render()`);
|
|
559
491
|
}
|
|
560
492
|
/** Render this component's configured custom host element. */
|
|
561
|
-
host(t = null, ...
|
|
562
|
-
const
|
|
493
|
+
host(t = null, ...n) {
|
|
494
|
+
const r = this.constructor, i = r.hostName;
|
|
563
495
|
if (i == null)
|
|
564
496
|
throw new Error(`${this.constructor.name} does not declare a custom host name`);
|
|
565
|
-
return
|
|
497
|
+
return O(this._runtime.resolveElementName(
|
|
566
498
|
i,
|
|
567
|
-
|
|
499
|
+
r.standaloneHostName
|
|
568
500
|
), {
|
|
569
501
|
...t,
|
|
570
502
|
"data-fray-component": i
|
|
571
|
-
}, ...
|
|
503
|
+
}, ...n);
|
|
572
504
|
}
|
|
573
505
|
/** @internal Assign an immutable application runtime before initialization or mounting. */
|
|
574
506
|
_setRuntime(t) {
|
|
507
|
+
var n;
|
|
575
508
|
if (!(t instanceof L))
|
|
576
509
|
throw new TypeError("Component runtime must be a FrayRuntime");
|
|
577
510
|
if (t === this._runtime) return this;
|
|
578
511
|
if (this.initialized || this.mounted || this._rendered != null)
|
|
579
512
|
throw new Error("Cannot change a component runtime after initialization");
|
|
580
|
-
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;
|
|
581
514
|
}
|
|
582
|
-
|
|
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;
|
|
524
|
+
}
|
|
525
|
+
mount(t = null, n = null) {
|
|
583
526
|
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(),
|
|
527
|
+
let r = !1;
|
|
528
|
+
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
529
|
}
|
|
587
530
|
attachTo(t) {
|
|
588
531
|
return this.mount(t), this;
|
|
@@ -596,15 +539,15 @@ const h = class h {
|
|
|
596
539
|
try {
|
|
597
540
|
do {
|
|
598
541
|
this.updateRequested = !1;
|
|
599
|
-
const
|
|
600
|
-
this.collectingRenderReads =
|
|
601
|
-
let
|
|
542
|
+
const n = /* @__PURE__ */ new Set();
|
|
543
|
+
this.collectingRenderReads = n;
|
|
544
|
+
let r;
|
|
602
545
|
try {
|
|
603
|
-
|
|
546
|
+
r = R(this.render());
|
|
604
547
|
} finally {
|
|
605
548
|
this.collectingRenderReads = null;
|
|
606
549
|
}
|
|
607
|
-
this._rendered = M(this._rendered,
|
|
550
|
+
this._rendered = M(this._rendered, r, this), this.dom = ae(this._rendered), this.reconcileRenderReads(n), this.afterUpdate(this.dom);
|
|
608
551
|
} while (this.updateRequested && !this.destroyed);
|
|
609
552
|
} finally {
|
|
610
553
|
this.updating = !1;
|
|
@@ -621,15 +564,15 @@ const h = class h {
|
|
|
621
564
|
afterUpdate(t) {
|
|
622
565
|
}
|
|
623
566
|
watch(...t) {
|
|
624
|
-
for (const
|
|
625
|
-
if (
|
|
567
|
+
for (const n of t) {
|
|
568
|
+
if (n == null || typeof n.subscribe != "function")
|
|
626
569
|
throw new TypeError("watch requires emitter-like values");
|
|
627
|
-
if (this.watched.has(
|
|
628
|
-
const
|
|
570
|
+
if (this.watched.has(n)) continue;
|
|
571
|
+
const r = n.subscribe(({ event: i }) => {
|
|
629
572
|
this.mounted && !this.destroyed && this.update(i);
|
|
630
573
|
}, { emitCurrent: !1 });
|
|
631
|
-
this.watched.set(
|
|
632
|
-
|
|
574
|
+
this.watched.set(n, r), this.onCleanup(() => {
|
|
575
|
+
r(), this.watched.delete(n);
|
|
633
576
|
});
|
|
634
577
|
}
|
|
635
578
|
return this;
|
|
@@ -655,30 +598,30 @@ const h = class h {
|
|
|
655
598
|
return t(), () => {
|
|
656
599
|
};
|
|
657
600
|
this.cleanupFunctions.add(t);
|
|
658
|
-
let
|
|
601
|
+
let n = !0;
|
|
659
602
|
return () => {
|
|
660
|
-
|
|
603
|
+
n && (n = !1, this.cleanupFunctions.delete(t), t());
|
|
661
604
|
};
|
|
662
605
|
}
|
|
663
606
|
/** Resolve one explicitly declared application service from this component's runtime. */
|
|
664
607
|
requireService(t) {
|
|
665
608
|
if (!this.initialized)
|
|
666
609
|
throw new Error("Components may resolve services during initialize() or later");
|
|
667
|
-
const
|
|
668
|
-
if (!
|
|
610
|
+
const n = this.constructor;
|
|
611
|
+
if (!n.requiredServices.includes(t))
|
|
669
612
|
throw new Error(
|
|
670
|
-
`${
|
|
613
|
+
`${n.name} must declare service "${t.name}" in requiredServices`
|
|
671
614
|
);
|
|
672
615
|
return this._runtime.services.require(t);
|
|
673
616
|
}
|
|
674
|
-
listen(t,
|
|
617
|
+
listen(t, n, r, i) {
|
|
675
618
|
if (t == null || typeof t.addEventListener != "function")
|
|
676
619
|
throw new TypeError("listen target must be an EventTarget");
|
|
677
|
-
const s =
|
|
678
|
-
return t.addEventListener(
|
|
620
|
+
const s = r;
|
|
621
|
+
return t.addEventListener(n, s, i), this.onCleanup(() => t.removeEventListener(n, s, i)), this;
|
|
679
622
|
}
|
|
680
623
|
registerChild(t) {
|
|
681
|
-
if (!(t instanceof
|
|
624
|
+
if (!(t instanceof d))
|
|
682
625
|
throw new TypeError("registerChild requires a Component");
|
|
683
626
|
return this._childComponents.add(t), t;
|
|
684
627
|
}
|
|
@@ -693,9 +636,9 @@ const h = class h {
|
|
|
693
636
|
}
|
|
694
637
|
validateRequiredServices() {
|
|
695
638
|
const t = this.constructor;
|
|
696
|
-
for (const
|
|
697
|
-
if (!this._runtime.services.has(
|
|
698
|
-
throw new Error(`${t.name} requires unregistered service "${
|
|
639
|
+
for (const n of t.requiredServices)
|
|
640
|
+
if (!this._runtime.services.has(n))
|
|
641
|
+
throw new Error(`${t.name} requires unregistered service "${n.name}"`);
|
|
699
642
|
}
|
|
700
643
|
onDestroy() {
|
|
701
644
|
}
|
|
@@ -705,31 +648,31 @@ const h = class h {
|
|
|
705
648
|
this.collectingRenderReads.add(t);
|
|
706
649
|
}
|
|
707
650
|
reconcileRenderReads(t) {
|
|
708
|
-
for (const [
|
|
709
|
-
t.has(
|
|
710
|
-
for (const
|
|
711
|
-
if (this.watched.has(
|
|
712
|
-
const
|
|
651
|
+
for (const [n, r] of this.renderReadSubscriptions)
|
|
652
|
+
t.has(n) || (r(), this.renderReadSubscriptions.delete(n));
|
|
653
|
+
for (const n of t) {
|
|
654
|
+
if (this.watched.has(n) || this.renderReadSubscriptions.has(n)) continue;
|
|
655
|
+
const r = n.subscribe(({ event: i }) => {
|
|
713
656
|
this.mounted && !this.destroyed && this.update(i);
|
|
714
657
|
}, { emitCurrent: !1 });
|
|
715
|
-
this.renderReadSubscriptions.set(
|
|
658
|
+
this.renderReadSubscriptions.set(n, r);
|
|
716
659
|
}
|
|
717
660
|
}
|
|
718
661
|
};
|
|
719
|
-
|
|
720
|
-
let
|
|
662
|
+
a(d, "dependencies", []), a(d, "requiredServices", []), a(d, "css", ""), a(d, "hostName", null), a(d, "standaloneHostName", null);
|
|
663
|
+
let m = d;
|
|
721
664
|
function R(e) {
|
|
722
|
-
return Array.isArray(e) ? A
|
|
665
|
+
return Array.isArray(e) ? O(A, null, e) : e == null || typeof e == "boolean" ? O(A) : e;
|
|
723
666
|
}
|
|
724
|
-
function
|
|
725
|
-
const t = [],
|
|
726
|
-
if (Array.isArray(
|
|
727
|
-
for (const i of
|
|
728
|
-
else
|
|
667
|
+
function re(e) {
|
|
668
|
+
const t = [], n = (r) => {
|
|
669
|
+
if (Array.isArray(r))
|
|
670
|
+
for (const i of r) n(i);
|
|
671
|
+
else r != null && typeof r != "boolean" && t.push(r);
|
|
729
672
|
};
|
|
730
|
-
return
|
|
673
|
+
return n(e), t;
|
|
731
674
|
}
|
|
732
|
-
function
|
|
675
|
+
function C(e, t) {
|
|
733
676
|
if (typeof e == "string" || typeof e == "number")
|
|
734
677
|
return {
|
|
735
678
|
kind: "text",
|
|
@@ -738,15 +681,15 @@ function j(e, t) {
|
|
|
738
681
|
node: document.createTextNode(String(e)),
|
|
739
682
|
owner: t
|
|
740
683
|
};
|
|
741
|
-
if (
|
|
742
|
-
const s = document.createComment("fray-emitter-start"), o = document.createComment("fray-emitter-end"),
|
|
743
|
-
if (Object.is(
|
|
684
|
+
if (k(e)) {
|
|
685
|
+
const s = document.createComment("fray-emitter-start"), o = document.createComment("fray-emitter-end"), c = e.get();
|
|
686
|
+
if (Object.is(c, e))
|
|
744
687
|
throw new TypeError("A Fray emitter child cannot render itself");
|
|
745
688
|
const l = document.createDocumentFragment();
|
|
746
689
|
l.append(s, o);
|
|
747
|
-
const u =
|
|
690
|
+
const u = C(R(c), t);
|
|
748
691
|
H(l, u, o);
|
|
749
|
-
const
|
|
692
|
+
const p = {
|
|
750
693
|
kind: "emitter",
|
|
751
694
|
key: null,
|
|
752
695
|
source: e,
|
|
@@ -757,14 +700,14 @@ function j(e, t) {
|
|
|
757
700
|
},
|
|
758
701
|
owner: t
|
|
759
702
|
};
|
|
760
|
-
return
|
|
761
|
-
if (Object.is(
|
|
703
|
+
return p.unsubscribe = e.subscribe(({ value: b }) => {
|
|
704
|
+
if (Object.is(b, e))
|
|
762
705
|
throw new TypeError("A Fray emitter child cannot render itself");
|
|
763
|
-
|
|
764
|
-
}, { emitCurrent: !1 }),
|
|
706
|
+
p.child = M(p.child, R(b), t);
|
|
707
|
+
}, { emitCurrent: !1 }), p;
|
|
765
708
|
}
|
|
766
|
-
if (e instanceof
|
|
767
|
-
return e._setRuntime(t._runtime), e.mount(), t.registerChild(e), {
|
|
709
|
+
if (e instanceof m)
|
|
710
|
+
return e._setRuntime(t._runtime), e._setRouteContext(t._routeContextForChildren()), e.mount(), t.registerChild(e), {
|
|
768
711
|
kind: "component",
|
|
769
712
|
key: ce(e.props),
|
|
770
713
|
type: e.constructor,
|
|
@@ -776,31 +719,31 @@ function j(e, t) {
|
|
|
776
719
|
};
|
|
777
720
|
if (!y(e))
|
|
778
721
|
throw new TypeError(`Invalid Fray child: ${J(e)}`);
|
|
779
|
-
const { type:
|
|
780
|
-
if (
|
|
781
|
-
const s = document.createComment("fray-fragment-start"), o = document.createComment("fray-fragment-end"),
|
|
722
|
+
const { type: n, key: r = null, props: i } = e;
|
|
723
|
+
if (n === A) {
|
|
724
|
+
const s = document.createComment("fray-fragment-start"), o = document.createComment("fray-fragment-end"), c = {
|
|
782
725
|
kind: "fragment",
|
|
783
|
-
key:
|
|
784
|
-
type:
|
|
726
|
+
key: r,
|
|
727
|
+
type: n,
|
|
785
728
|
start: s,
|
|
786
729
|
end: o,
|
|
787
730
|
children: [],
|
|
788
731
|
owner: t
|
|
789
732
|
}, l = document.createDocumentFragment();
|
|
790
|
-
return l.append(s, o),
|
|
733
|
+
return l.append(s, o), c.children = $(
|
|
791
734
|
l,
|
|
792
735
|
[],
|
|
793
736
|
i.children,
|
|
794
737
|
t,
|
|
795
738
|
o,
|
|
796
739
|
s
|
|
797
|
-
),
|
|
740
|
+
), c;
|
|
798
741
|
}
|
|
799
|
-
if (typeof
|
|
800
|
-
const s = document.createElement(
|
|
742
|
+
if (typeof n == "string") {
|
|
743
|
+
const s = document.createElement(n), o = {
|
|
801
744
|
kind: "element",
|
|
802
|
-
key:
|
|
803
|
-
type:
|
|
745
|
+
key: r,
|
|
746
|
+
type: n,
|
|
804
747
|
node: s,
|
|
805
748
|
props: {},
|
|
806
749
|
listeners: /* @__PURE__ */ new Map(),
|
|
@@ -810,94 +753,94 @@ function j(e, t) {
|
|
|
810
753
|
children: [],
|
|
811
754
|
owner: t
|
|
812
755
|
};
|
|
813
|
-
return oe(o, i), o.children =
|
|
756
|
+
return oe(o, i), o.children = $(s, [], i.children, t), o;
|
|
814
757
|
}
|
|
815
|
-
if (ue(
|
|
816
|
-
const s = i, o = Y(s),
|
|
817
|
-
|
|
758
|
+
if (ue(n)) {
|
|
759
|
+
const s = i, o = Y(s), c = new n(o);
|
|
760
|
+
c._setRuntime(t._runtime), c._setRouteContext(t._routeContextForChildren());
|
|
818
761
|
const l = {
|
|
819
762
|
kind: "component",
|
|
820
|
-
key:
|
|
821
|
-
type:
|
|
822
|
-
instance:
|
|
763
|
+
key: r,
|
|
764
|
+
type: n,
|
|
765
|
+
instance: c,
|
|
823
766
|
prebuilt: !1,
|
|
824
767
|
props: o,
|
|
825
768
|
liveProps: /* @__PURE__ */ new Map(),
|
|
826
769
|
owner: t
|
|
827
770
|
};
|
|
828
|
-
return se(l, s),
|
|
771
|
+
return se(l, s), c.mount(), t.registerChild(c), l;
|
|
829
772
|
}
|
|
830
|
-
if (typeof
|
|
831
|
-
const s =
|
|
773
|
+
if (typeof n == "function") {
|
|
774
|
+
const s = n, o = i, c = Y(o), l = R(s(c)), u = {
|
|
832
775
|
kind: "function",
|
|
833
|
-
key:
|
|
776
|
+
key: r,
|
|
834
777
|
type: s,
|
|
835
|
-
props:
|
|
778
|
+
props: c,
|
|
836
779
|
sourceProps: o,
|
|
837
780
|
liveProps: /* @__PURE__ */ new Map(),
|
|
838
|
-
child:
|
|
781
|
+
child: C(l, t),
|
|
839
782
|
owner: t
|
|
840
783
|
};
|
|
841
|
-
return
|
|
784
|
+
return Oe(u), u;
|
|
842
785
|
}
|
|
843
|
-
throw new TypeError(`Unsupported vnode type: ${J(
|
|
786
|
+
throw new TypeError(`Unsupported vnode type: ${J(n)}`);
|
|
844
787
|
}
|
|
845
|
-
function M(e, t,
|
|
846
|
-
if (e == null) return
|
|
847
|
-
if (le(e, t)) return ie(e, t,
|
|
848
|
-
const
|
|
849
|
-
return s && H(s,
|
|
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;
|
|
850
793
|
}
|
|
851
|
-
function ie(e, t,
|
|
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" ? (
|
|
794
|
+
function ie(e, t, n) {
|
|
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 = $(
|
|
853
796
|
e.start.parentNode,
|
|
854
797
|
e.children,
|
|
855
798
|
t.props.children,
|
|
856
|
-
|
|
799
|
+
n,
|
|
857
800
|
e.end,
|
|
858
801
|
e.start
|
|
859
|
-
), e) : (oe(e, t.props), e.children =
|
|
802
|
+
), e) : (oe(e, t.props), e.children = $(
|
|
860
803
|
e.node,
|
|
861
804
|
e.children,
|
|
862
805
|
t.props.children,
|
|
863
|
-
|
|
806
|
+
n
|
|
864
807
|
), e) : e;
|
|
865
808
|
}
|
|
866
809
|
function Y(e) {
|
|
867
|
-
return Object.fromEntries(Object.entries(e).map(([t,
|
|
810
|
+
return Object.fromEntries(Object.entries(e).map(([t, n]) => [
|
|
868
811
|
t,
|
|
869
|
-
|
|
812
|
+
j(n) ? n.emitter.get() : n
|
|
870
813
|
]));
|
|
871
814
|
}
|
|
872
815
|
function se(e, t) {
|
|
873
|
-
q(e.liveProps, t, (
|
|
874
|
-
e.props = { ...e.props, [
|
|
816
|
+
q(e.liveProps, t, (n, r) => {
|
|
817
|
+
e.props = { ...e.props, [n]: r }, e.instance.setProps(e.props);
|
|
875
818
|
}), e.props = V(e.liveProps, t), e.instance.setProps(e.props);
|
|
876
819
|
}
|
|
877
|
-
function
|
|
820
|
+
function Ae(e, t) {
|
|
878
821
|
se(e, t);
|
|
879
822
|
}
|
|
880
|
-
function
|
|
881
|
-
q(e.liveProps, e.sourceProps, (t,
|
|
882
|
-
e.props = { ...e.props, [t]:
|
|
823
|
+
function Oe(e) {
|
|
824
|
+
q(e.liveProps, e.sourceProps, (t, n) => {
|
|
825
|
+
e.props = { ...e.props, [t]: n }, z(e);
|
|
883
826
|
}), e.props = V(e.liveProps, e.sourceProps);
|
|
884
827
|
}
|
|
885
|
-
function
|
|
886
|
-
e.sourceProps = t, q(e.liveProps, t, (
|
|
887
|
-
e.props = { ...e.props, [
|
|
888
|
-
}), e.props = V(e.liveProps, t),
|
|
828
|
+
function $e(e, 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);
|
|
889
832
|
}
|
|
890
|
-
function
|
|
833
|
+
function z(e) {
|
|
891
834
|
const t = R(e.type(e.props));
|
|
892
835
|
e.child = M(e.child, t, e.owner);
|
|
893
836
|
}
|
|
894
|
-
function q(e, t,
|
|
895
|
-
for (const [
|
|
896
|
-
const s = t[
|
|
897
|
-
|
|
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));
|
|
898
841
|
}
|
|
899
|
-
for (const [
|
|
900
|
-
if (!
|
|
842
|
+
for (const [r, i] of Object.entries(t)) {
|
|
843
|
+
if (!j(i) || e.has(r)) continue;
|
|
901
844
|
const s = {
|
|
902
845
|
source: i.emitter,
|
|
903
846
|
value: i.emitter.get(),
|
|
@@ -905,187 +848,187 @@ function q(e, t, r) {
|
|
|
905
848
|
}
|
|
906
849
|
};
|
|
907
850
|
s.unsubscribe = i.emitter.subscribe(({ value: o }) => {
|
|
908
|
-
e.get(
|
|
909
|
-
}, { emitCurrent: !1 }), e.set(
|
|
851
|
+
e.get(r) === s && (s.value = o, n(r, o));
|
|
852
|
+
}, { emitCurrent: !1 }), e.set(r, s);
|
|
910
853
|
}
|
|
911
854
|
}
|
|
912
855
|
function V(e, t) {
|
|
913
|
-
return Object.fromEntries(Object.entries(t).map(([
|
|
856
|
+
return Object.fromEntries(Object.entries(t).map(([n, r]) => {
|
|
914
857
|
var i;
|
|
915
858
|
return [
|
|
916
|
-
|
|
917
|
-
|
|
859
|
+
n,
|
|
860
|
+
j(r) ? ((i = e.get(n)) == null ? void 0 : i.value) ?? r.emitter.get() : r
|
|
918
861
|
];
|
|
919
862
|
}));
|
|
920
863
|
}
|
|
921
|
-
function
|
|
864
|
+
function $(e, t, n, r, i = null, s = null) {
|
|
922
865
|
if (e == null) throw new Error("Cannot patch a detached fragment range");
|
|
923
|
-
const o =
|
|
866
|
+
const o = re(n), c = /* @__PURE__ */ new Map(), l = [];
|
|
924
867
|
for (const f of t)
|
|
925
|
-
f.key == null ? l.push(f) :
|
|
926
|
-
const u = /* @__PURE__ */ new Set(),
|
|
927
|
-
let
|
|
868
|
+
f.key == null ? l.push(f) : c.has(f.key) || c.set(f.key, f);
|
|
869
|
+
const u = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), b = [];
|
|
870
|
+
let pe = 0;
|
|
928
871
|
for (const f of o) {
|
|
929
|
-
const
|
|
930
|
-
if (
|
|
931
|
-
if (u.has(
|
|
932
|
-
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);
|
|
933
876
|
}
|
|
934
|
-
const
|
|
935
|
-
|
|
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));
|
|
936
879
|
}
|
|
937
880
|
for (const f of t)
|
|
938
|
-
|
|
939
|
-
let
|
|
940
|
-
for (const f of
|
|
941
|
-
for (const
|
|
942
|
-
|
|
943
|
-
return
|
|
881
|
+
p.has(f) || g(f, !0);
|
|
882
|
+
let v = s ? s.nextSibling : e.firstChild;
|
|
883
|
+
for (const f of b)
|
|
884
|
+
for (const h of w(f))
|
|
885
|
+
h === v ? v = v.nextSibling : (e.insertBefore(h, v ?? i), v = h.nextSibling);
|
|
886
|
+
return b;
|
|
944
887
|
}
|
|
945
888
|
function oe(e, t) {
|
|
946
|
-
const { children:
|
|
889
|
+
const { children: n, ...r } = t, i = e.props, s = /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(r)]);
|
|
947
890
|
for (const o of ["value", "checked"])
|
|
948
|
-
if (Object.hasOwn(
|
|
891
|
+
if (Object.hasOwn(r, o) && Object.hasOwn(r, `bind:${o}`))
|
|
949
892
|
throw new Error(`${o} and bind:${o} cannot be used together`);
|
|
950
893
|
for (const o of s) {
|
|
951
|
-
const
|
|
894
|
+
const c = i[o], l = r[o];
|
|
952
895
|
if (Me(o))
|
|
953
|
-
|
|
896
|
+
ke(e, o, l);
|
|
954
897
|
else if (o === "ref")
|
|
955
|
-
|
|
898
|
+
c !== l && _e(e, l);
|
|
956
899
|
else if (Le(o))
|
|
957
900
|
Ne(e, o, l);
|
|
958
|
-
else if (
|
|
959
|
-
|
|
901
|
+
else if (j(l))
|
|
902
|
+
Fe(e, o, l);
|
|
960
903
|
else {
|
|
961
904
|
const u = e.liveProps.get(o);
|
|
962
905
|
u && (u.unsubscribe(), e.liveProps.delete(o));
|
|
963
|
-
const
|
|
964
|
-
Object.is(
|
|
906
|
+
const p = (u == null ? void 0 : u.value) ?? c;
|
|
907
|
+
Object.is(p, l) || S(e.node, o, p, l);
|
|
965
908
|
}
|
|
966
909
|
}
|
|
967
|
-
e.props = { ...
|
|
910
|
+
e.props = { ...r };
|
|
968
911
|
}
|
|
969
|
-
function
|
|
970
|
-
const
|
|
971
|
-
if ((
|
|
972
|
-
|
|
973
|
-
const i =
|
|
974
|
-
|
|
912
|
+
function Fe(e, t, n) {
|
|
913
|
+
const r = e.liveProps.get(t);
|
|
914
|
+
if ((r == null ? void 0 : r.source) === n.emitter) return;
|
|
915
|
+
r == null || r.unsubscribe();
|
|
916
|
+
const i = n.emitter.get();
|
|
917
|
+
S(e.node, t, (r == null ? void 0 : r.value) ?? e.props[t], i);
|
|
975
918
|
const s = {
|
|
976
|
-
source:
|
|
919
|
+
source: n.emitter,
|
|
977
920
|
value: i,
|
|
978
921
|
unsubscribe: () => {
|
|
979
922
|
}
|
|
980
923
|
};
|
|
981
|
-
s.unsubscribe =
|
|
982
|
-
const
|
|
983
|
-
s.value = o, Object.is(
|
|
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);
|
|
984
927
|
}, { emitCurrent: !1 }), e.liveProps.set(t, s);
|
|
985
928
|
}
|
|
986
|
-
function
|
|
987
|
-
const
|
|
988
|
-
if (
|
|
989
|
-
i && (i.unsubscribe(), e.node.removeEventListener(i.eventName, i.listener), e.nativeBindings.delete(t),
|
|
929
|
+
function ke(e, t, n) {
|
|
930
|
+
const r = t.slice(5), i = e.nativeBindings.get(t);
|
|
931
|
+
if (n == null) {
|
|
932
|
+
i && (i.unsubscribe(), e.node.removeEventListener(i.eventName, i.listener), e.nativeBindings.delete(t), S(e.node, r, i.value, void 0));
|
|
990
933
|
return;
|
|
991
934
|
}
|
|
992
|
-
if (qe(
|
|
993
|
-
i && (i.unsubscribe(), e.node.removeEventListener(i.eventName, i.listener)), Ve(e.node,
|
|
994
|
-
const s = He(e.node,
|
|
995
|
-
|
|
996
|
-
const
|
|
997
|
-
|
|
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 = () => {
|
|
940
|
+
n.set(Reflect.get(e.node, r), `${t} changed`);
|
|
998
941
|
}, l = {
|
|
999
|
-
source:
|
|
942
|
+
source: n,
|
|
1000
943
|
value: o,
|
|
1001
944
|
eventName: s,
|
|
1002
|
-
listener:
|
|
945
|
+
listener: c,
|
|
1003
946
|
unsubscribe: () => {
|
|
1004
947
|
}
|
|
1005
948
|
};
|
|
1006
|
-
l.unsubscribe =
|
|
1007
|
-
const
|
|
1008
|
-
l.value = u, Object.is(
|
|
1009
|
-
}, { emitCurrent: !1 }), e.node.addEventListener(s,
|
|
1010
|
-
}
|
|
1011
|
-
function Ne(e, t,
|
|
1012
|
-
const
|
|
1013
|
-
if (i && i !==
|
|
949
|
+
l.unsubscribe = n.subscribe(({ value: u }) => {
|
|
950
|
+
const p = l.value;
|
|
951
|
+
l.value = u, Object.is(p, u) || S(e.node, r, p, u);
|
|
952
|
+
}, { emitCurrent: !1 }), e.node.addEventListener(s, c), e.nativeBindings.set(t, l);
|
|
953
|
+
}
|
|
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")
|
|
1014
957
|
throw new TypeError(`${t} must be a function or null`);
|
|
1015
|
-
if (typeof
|
|
1016
|
-
const s =
|
|
1017
|
-
e.node.addEventListener(
|
|
958
|
+
if (typeof n == "function" && i !== n) {
|
|
959
|
+
const s = n;
|
|
960
|
+
e.node.addEventListener(r, s), e.listeners.set(t, s);
|
|
1018
961
|
}
|
|
1019
962
|
}
|
|
1020
|
-
function
|
|
963
|
+
function _e(e, t) {
|
|
1021
964
|
if (B(e.ref, null), t != null && typeof t != "function" && typeof t != "object")
|
|
1022
965
|
throw new TypeError("ref must be a function, object, or null");
|
|
1023
966
|
e.ref = t, B(e.ref, e.node);
|
|
1024
967
|
}
|
|
1025
|
-
function
|
|
968
|
+
function S(e, t, n, r) {
|
|
1026
969
|
if (t === "class" || t === "className") {
|
|
1027
|
-
N(e, "class",
|
|
970
|
+
N(e, "class", r);
|
|
1028
971
|
return;
|
|
1029
972
|
}
|
|
1030
973
|
if (t === "for" || t === "htmlFor") {
|
|
1031
|
-
N(e, "for",
|
|
974
|
+
N(e, "for", r);
|
|
1032
975
|
return;
|
|
1033
976
|
}
|
|
1034
977
|
if (t === "dataset") {
|
|
1035
|
-
|
|
978
|
+
xe(e, n, r);
|
|
1036
979
|
return;
|
|
1037
980
|
}
|
|
1038
981
|
if (t === "style") {
|
|
1039
|
-
|
|
982
|
+
ze(e, n, r);
|
|
1040
983
|
return;
|
|
1041
984
|
}
|
|
1042
985
|
if (t === "dangerouslySetInnerHTML")
|
|
1043
986
|
throw new Error("dangerouslySetInnerHTML is not supported");
|
|
1044
987
|
const i = Be(t);
|
|
1045
|
-
if (
|
|
1046
|
-
const s = !!
|
|
1047
|
-
i in e && Reflect.set(e, i, s), e.toggleAttribute(
|
|
988
|
+
if (Te.has(i)) {
|
|
989
|
+
const s = !!r;
|
|
990
|
+
i in e && Reflect.set(e, i, s), e.toggleAttribute(_(t), s);
|
|
1048
991
|
return;
|
|
1049
992
|
}
|
|
1050
|
-
if (
|
|
1051
|
-
const s =
|
|
1052
|
-
Object.is(Reflect.get(e, i), s) || Reflect.set(e, i, s),
|
|
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));
|
|
1053
996
|
return;
|
|
1054
997
|
}
|
|
1055
|
-
N(e,
|
|
998
|
+
N(e, _(t), r);
|
|
1056
999
|
}
|
|
1057
|
-
function
|
|
1058
|
-
const
|
|
1059
|
-
for (const s of /* @__PURE__ */ new Set([...Object.keys(
|
|
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)])) {
|
|
1060
1003
|
const o = i[s];
|
|
1061
1004
|
o == null ? delete e.dataset[s] : e.dataset[s] = String(o);
|
|
1062
1005
|
}
|
|
1063
1006
|
}
|
|
1064
|
-
function
|
|
1065
|
-
if (typeof
|
|
1066
|
-
e.style.cssText =
|
|
1007
|
+
function ze(e, t, n) {
|
|
1008
|
+
if (typeof n == "string") {
|
|
1009
|
+
e.style.cssText = n;
|
|
1067
1010
|
return;
|
|
1068
1011
|
}
|
|
1069
|
-
const
|
|
1012
|
+
const r = typeof t == "string" ? {} : F(t, "style"), i = F(n, "style");
|
|
1070
1013
|
typeof t == "string" && (e.style.cssText = "");
|
|
1071
|
-
for (const s of /* @__PURE__ */ new Set([...Object.keys(
|
|
1014
|
+
for (const s of /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(i)])) {
|
|
1072
1015
|
const o = i[s];
|
|
1073
1016
|
s.startsWith("--") ? o == null ? e.style.removeProperty(s) : e.style.setProperty(s, String(o)) : Reflect.set(e.style, s, o == null ? "" : String(o));
|
|
1074
1017
|
}
|
|
1075
1018
|
}
|
|
1076
|
-
function
|
|
1019
|
+
function F(e, t) {
|
|
1077
1020
|
if (e == null) return {};
|
|
1078
1021
|
if (typeof e != "object" || Array.isArray(e))
|
|
1079
1022
|
throw new TypeError(`${t} must be an object or null`);
|
|
1080
1023
|
return e;
|
|
1081
1024
|
}
|
|
1082
|
-
function N(e, t,
|
|
1083
|
-
|
|
1025
|
+
function N(e, t, n) {
|
|
1026
|
+
n == null || n === !1 ? e.removeAttribute(t) : n === !0 ? e.setAttribute(t, "") : e.setAttribute(t, String(n));
|
|
1084
1027
|
}
|
|
1085
1028
|
function Be(e) {
|
|
1086
1029
|
return e === "readonly" ? "readOnly" : e === "autofocus" ? "autoFocus" : e;
|
|
1087
1030
|
}
|
|
1088
|
-
function
|
|
1031
|
+
function _(e) {
|
|
1089
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()}`);
|
|
1090
1033
|
}
|
|
1091
1034
|
function G(e) {
|
|
@@ -1097,74 +1040,74 @@ function B(e, t) {
|
|
|
1097
1040
|
function g(e, t) {
|
|
1098
1041
|
if (e.kind === "emitter") {
|
|
1099
1042
|
if (e.unsubscribe(), g(e.child, !1), t)
|
|
1100
|
-
for (const
|
|
1043
|
+
for (const n of w(e)) n.remove();
|
|
1101
1044
|
return;
|
|
1102
1045
|
}
|
|
1103
1046
|
if (e.kind === "component") {
|
|
1104
|
-
for (const
|
|
1047
|
+
for (const n of e.liveProps.values()) n.unsubscribe();
|
|
1105
1048
|
e.liveProps.clear(), e.owner._childComponents.delete(e.instance), e.instance.destroy();
|
|
1106
1049
|
return;
|
|
1107
1050
|
}
|
|
1108
1051
|
if (e.kind === "function") {
|
|
1109
|
-
for (const
|
|
1052
|
+
for (const n of e.liveProps.values()) n.unsubscribe();
|
|
1110
1053
|
e.liveProps.clear(), g(e.child, t);
|
|
1111
1054
|
return;
|
|
1112
1055
|
}
|
|
1113
1056
|
if (e.kind === "element") {
|
|
1114
1057
|
B(e.ref, null);
|
|
1115
|
-
for (const [
|
|
1116
|
-
e.node.removeEventListener(
|
|
1058
|
+
for (const [n, r] of e.listeners)
|
|
1059
|
+
e.node.removeEventListener(n.slice(2).toLowerCase(), r);
|
|
1117
1060
|
e.listeners.clear();
|
|
1118
|
-
for (const
|
|
1061
|
+
for (const n of e.liveProps.values()) n.unsubscribe();
|
|
1119
1062
|
e.liveProps.clear();
|
|
1120
|
-
for (const
|
|
1121
|
-
|
|
1063
|
+
for (const n of e.nativeBindings.values())
|
|
1064
|
+
n.unsubscribe(), e.node.removeEventListener(n.eventName, n.listener);
|
|
1122
1065
|
e.nativeBindings.clear();
|
|
1123
|
-
for (const
|
|
1066
|
+
for (const n of e.children) g(n, !1);
|
|
1124
1067
|
t && e.node.remove();
|
|
1125
1068
|
return;
|
|
1126
1069
|
}
|
|
1127
1070
|
if (e.kind === "fragment") {
|
|
1128
|
-
for (const
|
|
1071
|
+
for (const n of e.children) g(n, !1);
|
|
1129
1072
|
if (t)
|
|
1130
|
-
for (const
|
|
1073
|
+
for (const n of w(e)) n.remove();
|
|
1131
1074
|
return;
|
|
1132
1075
|
}
|
|
1133
1076
|
t && e.node.remove();
|
|
1134
1077
|
}
|
|
1135
|
-
function H(e, t,
|
|
1078
|
+
function H(e, t, n = null) {
|
|
1136
1079
|
if (t != null)
|
|
1137
|
-
for (const
|
|
1080
|
+
for (const r of w(t)) e.insertBefore(r, n);
|
|
1138
1081
|
}
|
|
1139
|
-
function
|
|
1082
|
+
function w(e) {
|
|
1140
1083
|
if (e == null) return [];
|
|
1141
1084
|
if (e.kind === "text" || e.kind === "element") return [e.node];
|
|
1142
|
-
if (e.kind === "component") return
|
|
1143
|
-
if (e.kind === "function") return
|
|
1085
|
+
if (e.kind === "component") return w(e.instance._rendered);
|
|
1086
|
+
if (e.kind === "function") return w(e.child);
|
|
1144
1087
|
const t = [];
|
|
1145
|
-
let
|
|
1146
|
-
for (;
|
|
1147
|
-
|
|
1088
|
+
let n = e.start;
|
|
1089
|
+
for (; n && (t.push(n), n !== e.end); )
|
|
1090
|
+
n = n.nextSibling;
|
|
1148
1091
|
return t;
|
|
1149
1092
|
}
|
|
1150
1093
|
function ae(e) {
|
|
1151
|
-
return
|
|
1094
|
+
return w(e)[0] ?? null;
|
|
1152
1095
|
}
|
|
1153
1096
|
function E(e) {
|
|
1154
|
-
return e instanceof
|
|
1097
|
+
return e instanceof m ? ce(e.props) : y(e) ? e.key : null;
|
|
1155
1098
|
}
|
|
1156
1099
|
function ce(e) {
|
|
1157
1100
|
const t = e.key;
|
|
1158
1101
|
return typeof t == "string" || typeof t == "number" ? t : null;
|
|
1159
1102
|
}
|
|
1160
1103
|
function le(e, t) {
|
|
1161
|
-
return e.kind === "text" ? typeof t == "string" || typeof t == "number" : e.kind === "emitter" ?
|
|
1104
|
+
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
1105
|
}
|
|
1163
1106
|
function y(e) {
|
|
1164
1107
|
return e != null && typeof e == "object" && Object.hasOwn(e, "type");
|
|
1165
1108
|
}
|
|
1166
1109
|
function ue(e) {
|
|
1167
|
-
return typeof e == "function" && (e ===
|
|
1110
|
+
return typeof e == "function" && (e === m || e.prototype instanceof m);
|
|
1168
1111
|
}
|
|
1169
1112
|
function Le(e) {
|
|
1170
1113
|
return /^on[A-Z]/.test(e);
|
|
@@ -1172,22 +1115,22 @@ function Le(e) {
|
|
|
1172
1115
|
function Me(e) {
|
|
1173
1116
|
return e === "bind:value" || e === "bind:checked";
|
|
1174
1117
|
}
|
|
1175
|
-
function
|
|
1176
|
-
return e != null && typeof e == "object" &&
|
|
1118
|
+
function j(e) {
|
|
1119
|
+
return e != null && typeof e == "object" && ne.has(e);
|
|
1177
1120
|
}
|
|
1178
|
-
function
|
|
1121
|
+
function k(e) {
|
|
1179
1122
|
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
1123
|
}
|
|
1181
1124
|
function I(e, t) {
|
|
1182
|
-
if (
|
|
1125
|
+
if (!k(e)) throw new TypeError(`${t} requires a readable emitter`);
|
|
1183
1126
|
}
|
|
1184
1127
|
function qe(e, t) {
|
|
1185
1128
|
if (I(e, t), typeof Reflect.get(e, "set") != "function")
|
|
1186
1129
|
throw new TypeError(`${t} requires a writable emitter`);
|
|
1187
1130
|
}
|
|
1188
1131
|
function Ve(e, t) {
|
|
1189
|
-
const
|
|
1190
|
-
if (!(t === "checked" ?
|
|
1132
|
+
const n = e.localName;
|
|
1133
|
+
if (!(t === "checked" ? n === "input" : n === "input" || n === "textarea" || n === "select")) throw new TypeError(`bind:${t} is not supported on ${n}`);
|
|
1191
1134
|
}
|
|
1192
1135
|
function He(e, t) {
|
|
1193
1136
|
return t === "value" && e.localName !== "select" ? "input" : "change";
|
|
@@ -1209,48 +1152,48 @@ function De(e) {
|
|
|
1209
1152
|
return e.map((t) => {
|
|
1210
1153
|
if (!Array.isArray(t) || t.length < 2 || typeof t[0] != "string")
|
|
1211
1154
|
throw new TypeError("Component baseStyles entries must be selector/style tuples");
|
|
1212
|
-
const
|
|
1213
|
-
if (typeof
|
|
1155
|
+
const n = t[1];
|
|
1156
|
+
if (typeof n != "string" && (!Array.isArray(n) || n.some((r) => typeof r != "string")))
|
|
1214
1157
|
throw new TypeError("Component base style names must be strings");
|
|
1215
|
-
return [t[0],
|
|
1158
|
+
return [t[0], n];
|
|
1216
1159
|
});
|
|
1217
1160
|
if (typeof e != "object")
|
|
1218
1161
|
throw new TypeError("Component baseStyles must be an object or tuple array");
|
|
1219
|
-
return Object.entries(e).map(([t,
|
|
1162
|
+
return Object.entries(e).map(([t, n]) => [
|
|
1220
1163
|
t,
|
|
1221
|
-
|
|
1164
|
+
n
|
|
1222
1165
|
]);
|
|
1223
1166
|
}
|
|
1224
|
-
function fe(e, t,
|
|
1225
|
-
const
|
|
1226
|
-
return
|
|
1167
|
+
function fe(e, t, n) {
|
|
1168
|
+
const r = t == null ? {} : { ...t };
|
|
1169
|
+
return n !== void 0 && (r.key = n), O(e, r);
|
|
1227
1170
|
}
|
|
1228
1171
|
const Je = fe, Qe = fe;
|
|
1229
1172
|
function Xe(e) {
|
|
1230
|
-
if (!(e instanceof
|
|
1173
|
+
if (!(e instanceof m))
|
|
1231
1174
|
throw new TypeError("createPrebuiltElement requires a Component instance");
|
|
1232
1175
|
return e;
|
|
1233
1176
|
}
|
|
1234
1177
|
export {
|
|
1235
|
-
|
|
1236
|
-
|
|
1178
|
+
m as C,
|
|
1179
|
+
A as F,
|
|
1237
1180
|
te as S,
|
|
1238
1181
|
Je as a,
|
|
1239
1182
|
L as b,
|
|
1240
1183
|
Ge as c,
|
|
1241
1184
|
Q as d,
|
|
1242
1185
|
Ze as e,
|
|
1243
|
-
|
|
1186
|
+
ve as f,
|
|
1244
1187
|
ye as g,
|
|
1245
|
-
|
|
1188
|
+
O as h,
|
|
1246
1189
|
y as i,
|
|
1247
1190
|
fe as j,
|
|
1248
|
-
|
|
1249
|
-
|
|
1191
|
+
W as k,
|
|
1192
|
+
Ue as l,
|
|
1250
1193
|
Qe as m,
|
|
1251
1194
|
Ye as n,
|
|
1252
1195
|
Xe as o,
|
|
1253
1196
|
We as p,
|
|
1254
|
-
|
|
1197
|
+
be as s
|
|
1255
1198
|
};
|
|
1256
|
-
//# sourceMappingURL=jsx-dev-runtime-
|
|
1199
|
+
//# sourceMappingURL=jsx-dev-runtime-Kf1Dhu-y.js.map
|