@capillaryjs/capillary-ui 1.0.0 → 1.2.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/CHANGELOG.md +18 -3
- package/README.md +42 -13
- package/dist/Components/component.d.ts +12 -2
- package/dist/Components/component.d.ts.map +1 -1
- package/dist/Components/data/listview/listview.d.ts +3 -3
- 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/TableHeader.d.ts.map +1 -1
- package/dist/Components/data/table/TableHeaderCell.d.ts +1 -0
- package/dist/Components/data/table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Components/data/treeview/treeview.d.ts +2 -2
- package/dist/Components/data/treeview/treeview.d.ts.map +1 -1
- package/dist/index.js +912 -897
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +3 -3
- package/dist/{jsx-dev-runtime-D3UnwrKT.js → jsx-runtime-BD_q3rPg.js} +639 -490
- package/dist/jsx-runtime-BD_q3rPg.js.map +1 -0
- package/dist/jsx-runtime.js +2 -2
- package/dist/runtime.d.ts +4 -0
- package/dist/runtime.d.ts.map +1 -1
- package/package.json +3 -3
- package/styles/structural.css +19 -5
- package/themes/minimal/theme.css +3 -2
- package/dist/jsx-dev-runtime-D3UnwrKT.js.map +0 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
var Te = Object.defineProperty;
|
|
2
|
+
var je = (e, t, n) => t in e ? Te(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var c = (e, t, n) => je(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { defaultDiagnosticScope as Pe, Diagnostics as u, diagnosticInfo as Ae, EventBubble as $e } from "@capillaryjs/capillary";
|
|
5
|
+
const G = "data-cap-structural-styles";
|
|
6
|
+
let ke = 1;
|
|
7
|
+
class re {
|
|
8
|
+
constructor(t = `runtime-${ke++}`) {
|
|
9
|
+
c(this, "id");
|
|
10
|
+
c(this, "cssFragments", /* @__PURE__ */ new Map());
|
|
10
11
|
if (typeof t != "string") throw new TypeError("StyleRegistry id must be a string");
|
|
11
12
|
this.id = t;
|
|
12
13
|
}
|
|
@@ -20,136 +21,136 @@ class J {
|
|
|
20
21
|
if (typeof t != "string") throw new TypeError("Component CSS must be a string");
|
|
21
22
|
if (typeof n != "string" || n.trim().length === 0)
|
|
22
23
|
throw new TypeError("Component CSS host must be a non-empty selector");
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
if (!
|
|
26
|
-
const
|
|
27
|
-
return s == null ? this.cssFragments.set(
|
|
24
|
+
const i = t.trim();
|
|
25
|
+
if (i.length === 0) return this;
|
|
26
|
+
if (!i.includes("&")) return this.registerCSS(i);
|
|
27
|
+
const r = `host:${i}`, s = this.cssFragments.get(r);
|
|
28
|
+
return s == null ? this.cssFragments.set(r, {
|
|
28
29
|
kind: "host",
|
|
29
|
-
css:
|
|
30
|
+
css: i,
|
|
30
31
|
hosts: /* @__PURE__ */ new Set([n.trim()])
|
|
31
32
|
}) : s.kind === "host" && s.hosts.add(n.trim()), this;
|
|
32
33
|
}
|
|
33
34
|
generateCSS() {
|
|
34
|
-
return [...this.cssFragments.values()].map((t) => t.kind === "raw" ? t.css :
|
|
35
|
+
return [...this.cssFragments.values()].map((t) => t.kind === "raw" ? t.css : se(t.css, [...t.hosts])).join(`
|
|
35
36
|
|
|
36
37
|
`);
|
|
37
38
|
}
|
|
38
39
|
injectAll(t = globalThis.document) {
|
|
39
40
|
if ((t == null ? void 0 : t.head) == null)
|
|
40
41
|
throw new TypeError("StyleRegistry.injectAll requires a document with a head");
|
|
41
|
-
const n = `style[${
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
return
|
|
42
|
+
const n = `style[${G}="${Ne(this.id)}"]`;
|
|
43
|
+
let i = t.head.querySelector(n);
|
|
44
|
+
i == null && (i = t.createElement("style"), i.setAttribute(G, this.id), t.head.prepend(i));
|
|
45
|
+
const r = this.generateCSS();
|
|
46
|
+
return i.textContent !== r && (i.textContent = r), i;
|
|
46
47
|
}
|
|
47
48
|
reset() {
|
|
48
49
|
this.cssFragments.clear();
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
-
return new
|
|
52
|
+
function ze() {
|
|
53
|
+
return new re();
|
|
53
54
|
}
|
|
54
|
-
const
|
|
55
|
-
function
|
|
55
|
+
const _e = new re("");
|
|
56
|
+
function Ne(e) {
|
|
56
57
|
return e.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
-
let n = "",
|
|
60
|
-
for (;
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
const s =
|
|
64
|
-
if (s < 0) return n + e.slice(
|
|
65
|
-
const o = e.slice(
|
|
66
|
-
n +=
|
|
59
|
+
function se(e, t) {
|
|
60
|
+
let n = "", i = 0;
|
|
61
|
+
for (; i < e.length; ) {
|
|
62
|
+
const r = Ue(e, i);
|
|
63
|
+
if (r < 0) return n + e.slice(i);
|
|
64
|
+
const s = Fe(e, r);
|
|
65
|
+
if (s < 0) return n + e.slice(i);
|
|
66
|
+
const o = e.slice(i, r), a = e.slice(r + 1, s), l = o.trim();
|
|
67
|
+
n += l.startsWith("@") ? `${o}{${se(a, t)}}` : `${Ie(o, t)}{${a}}`, i = s + 1;
|
|
67
68
|
}
|
|
68
69
|
return n;
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
var o, a,
|
|
71
|
+
function Ie(e, t) {
|
|
72
|
+
var o, a, l;
|
|
72
73
|
if (t.length === 1 || !e.includes("&"))
|
|
73
74
|
return t.length === 1 ? e.replaceAll("&", t[0]) : e;
|
|
74
|
-
const n = ((o = e.match(/^\s*/)) == null ? void 0 : o[0]) ?? "",
|
|
75
|
-
return n +
|
|
76
|
-
${s}`) +
|
|
75
|
+
const n = ((o = e.match(/^\s*/)) == null ? void 0 : o[0]) ?? "", i = ((a = e.match(/\s*$/)) == null ? void 0 : a[0]) ?? "", r = Me(e.trim()), s = ((l = n.match(/(?:^|\n)([ \t]*)$/)) == null ? void 0 : l[1]) ?? "";
|
|
76
|
+
return n + r.flatMap((f) => f.includes("&") ? t.map((p) => f.replaceAll("&", p)) : [f]).join(`,
|
|
77
|
+
${s}`) + i;
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
+
function Me(e) {
|
|
79
80
|
const t = [];
|
|
80
|
-
let n = 0,
|
|
81
|
+
let n = 0, i = 0, r = 0, s = null;
|
|
81
82
|
for (let o = 0; o < e.length; o += 1) {
|
|
82
83
|
const a = e[o];
|
|
83
84
|
if (s != null) {
|
|
84
85
|
a === "\\" ? o += 1 : a === s && (s = null);
|
|
85
86
|
continue;
|
|
86
87
|
}
|
|
87
|
-
a === '"' || a === "'" ? s = a : a === "(" ?
|
|
88
|
+
a === '"' || a === "'" ? s = a : a === "(" ? i += 1 : a === ")" ? i -= 1 : a === "[" ? r += 1 : a === "]" ? r -= 1 : a === "," && i === 0 && r === 0 && (t.push(e.slice(n, o).trim()), n = o + 1);
|
|
88
89
|
}
|
|
89
90
|
return t.push(e.slice(n).trim()), t.filter(Boolean);
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
+
function Ue(e, t) {
|
|
92
93
|
for (let n = t; n < e.length; n += 1) {
|
|
93
|
-
const
|
|
94
|
-
if (
|
|
95
|
-
n =
|
|
96
|
-
else if (
|
|
97
|
-
n =
|
|
98
|
-
else if (
|
|
94
|
+
const i = e[n];
|
|
95
|
+
if (i === '"' || i === "'")
|
|
96
|
+
n = oe(e, n);
|
|
97
|
+
else if (i === "/" && e[n + 1] === "*")
|
|
98
|
+
n = ae(e, n);
|
|
99
|
+
else if (i === "{")
|
|
99
100
|
return n;
|
|
100
101
|
}
|
|
101
102
|
return -1;
|
|
102
103
|
}
|
|
103
|
-
function
|
|
104
|
+
function Fe(e, t) {
|
|
104
105
|
let n = 1;
|
|
105
|
-
for (let
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
108
|
-
|
|
109
|
-
else if (
|
|
110
|
-
|
|
111
|
-
else if (
|
|
106
|
+
for (let i = t + 1; i < e.length; i += 1) {
|
|
107
|
+
const r = e[i];
|
|
108
|
+
if (r === '"' || r === "'")
|
|
109
|
+
i = oe(e, i);
|
|
110
|
+
else if (r === "/" && e[i + 1] === "*")
|
|
111
|
+
i = ae(e, i);
|
|
112
|
+
else if (r === "{")
|
|
112
113
|
n += 1;
|
|
113
|
-
else if (
|
|
114
|
-
return
|
|
114
|
+
else if (r === "}" && --n === 0)
|
|
115
|
+
return i;
|
|
115
116
|
}
|
|
116
117
|
return -1;
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
+
function oe(e, t) {
|
|
119
120
|
const n = e[t];
|
|
120
|
-
for (let
|
|
121
|
-
if (e[
|
|
122
|
-
else if (e[
|
|
121
|
+
for (let i = t + 1; i < e.length; i += 1)
|
|
122
|
+
if (e[i] === "\\") i += 1;
|
|
123
|
+
else if (e[i] === n) return i;
|
|
123
124
|
return e.length;
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
+
function ae(e, t) {
|
|
126
127
|
const n = e.indexOf("*/", t + 2);
|
|
127
128
|
return n < 0 ? e.length : n + 1;
|
|
128
129
|
}
|
|
129
|
-
const
|
|
130
|
-
function
|
|
130
|
+
const le = /* @__PURE__ */ new WeakSet(), ce = /* @__PURE__ */ new WeakSet();
|
|
131
|
+
function yt(e) {
|
|
131
132
|
if (typeof e != "string" || e.trim() === "")
|
|
132
133
|
throw new TypeError("Service name must be a non-empty string");
|
|
133
134
|
const t = Object.freeze({ name: e.trim() });
|
|
134
|
-
return
|
|
135
|
+
return le.add(t), t;
|
|
135
136
|
}
|
|
136
|
-
function
|
|
137
|
-
if (
|
|
137
|
+
function wt(e, t) {
|
|
138
|
+
if (x(e), typeof t != "function")
|
|
138
139
|
throw new TypeError(`Service provider "${e.name}" requires a factory function`);
|
|
139
140
|
const n = Object.freeze({ key: e, create: t });
|
|
140
|
-
return
|
|
141
|
+
return ce.add(n), n;
|
|
141
142
|
}
|
|
142
|
-
class
|
|
143
|
+
class ue {
|
|
143
144
|
constructor(t = []) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
c(this, "providers", /* @__PURE__ */ new Map());
|
|
146
|
+
c(this, "instances", /* @__PURE__ */ new Map());
|
|
147
|
+
c(this, "creationOrder", []);
|
|
148
|
+
c(this, "resolving", []);
|
|
149
|
+
c(this, "disposed", !1);
|
|
149
150
|
if (!Array.isArray(t))
|
|
150
151
|
throw new TypeError("ServiceScope providers must be an array");
|
|
151
152
|
for (const n of t) {
|
|
152
|
-
if (
|
|
153
|
+
if (Be(n), this.providers.has(n.key))
|
|
153
154
|
throw new Error(`Service "${n.key.name}" is registered more than once`);
|
|
154
155
|
this.providers.set(n.key, n);
|
|
155
156
|
}
|
|
@@ -158,21 +159,21 @@ class re {
|
|
|
158
159
|
return this.disposed;
|
|
159
160
|
}
|
|
160
161
|
has(t) {
|
|
161
|
-
return this.assertActive(),
|
|
162
|
+
return this.assertActive(), x(t), this.providers.has(t);
|
|
162
163
|
}
|
|
163
164
|
require(t) {
|
|
164
|
-
if (this.assertActive(),
|
|
165
|
+
if (this.assertActive(), x(t), this.instances.has(t)) return this.instances.get(t);
|
|
165
166
|
const n = this.providers.get(t);
|
|
166
167
|
if (n == null) throw new Error(`Service "${t.name}" is not registered`);
|
|
167
|
-
const
|
|
168
|
-
if (
|
|
169
|
-
const
|
|
170
|
-
throw new Error(`Circular service dependency: ${
|
|
168
|
+
const i = this.resolving.indexOf(t);
|
|
169
|
+
if (i >= 0) {
|
|
170
|
+
const r = [...this.resolving.slice(i), t].map((s) => s.name).join(" -> ");
|
|
171
|
+
throw new Error(`Circular service dependency: ${r}`);
|
|
171
172
|
}
|
|
172
173
|
this.resolving.push(t);
|
|
173
174
|
try {
|
|
174
|
-
const
|
|
175
|
-
return this.instances.set(t,
|
|
175
|
+
const r = n.create(this);
|
|
176
|
+
return this.instances.set(t, r), this.creationOrder.push(t), r;
|
|
176
177
|
} finally {
|
|
177
178
|
this.resolving.pop();
|
|
178
179
|
}
|
|
@@ -182,12 +183,12 @@ class re {
|
|
|
182
183
|
this.disposed = !0;
|
|
183
184
|
const t = [];
|
|
184
185
|
for (const n of [...this.creationOrder].reverse()) {
|
|
185
|
-
const
|
|
186
|
+
const i = this.instances.get(n);
|
|
186
187
|
try {
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
} catch (
|
|
190
|
-
t.push(
|
|
188
|
+
const r = Ve(i);
|
|
189
|
+
r != null && r.call(i);
|
|
190
|
+
} catch (r) {
|
|
191
|
+
t.push(r);
|
|
191
192
|
}
|
|
192
193
|
}
|
|
193
194
|
if (this.instances.clear(), this.creationOrder.length = 0, this.resolving.length = 0, t.length === 1) throw t[0];
|
|
@@ -198,25 +199,25 @@ class re {
|
|
|
198
199
|
if (this.disposed) throw new Error("ServiceScope has been disposed");
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
|
-
function
|
|
202
|
-
return new
|
|
202
|
+
function xe(e = []) {
|
|
203
|
+
return new ue(e);
|
|
203
204
|
}
|
|
204
|
-
function
|
|
205
|
-
return e != null && (typeof e == "object" || typeof e == "function") &&
|
|
205
|
+
function qe(e) {
|
|
206
|
+
return e != null && (typeof e == "object" || typeof e == "function") && le.has(e);
|
|
206
207
|
}
|
|
207
|
-
function
|
|
208
|
-
if (!
|
|
208
|
+
function x(e) {
|
|
209
|
+
if (!qe(e)) throw new TypeError("Expected a service key created by defineService()");
|
|
209
210
|
}
|
|
210
|
-
function
|
|
211
|
-
if (e == null || typeof e != "object" && typeof e != "function" || !
|
|
211
|
+
function Be(e) {
|
|
212
|
+
if (e == null || typeof e != "object" && typeof e != "function" || !ce.has(e))
|
|
212
213
|
throw new TypeError("Expected a service provider created by provideService()");
|
|
213
214
|
}
|
|
214
|
-
function
|
|
215
|
+
function Ve(e) {
|
|
215
216
|
if (e == null || typeof e != "object" && typeof e != "function") return null;
|
|
216
217
|
const t = Reflect.get(e, "dispose");
|
|
217
218
|
return typeof t == "function" ? t : null;
|
|
218
219
|
}
|
|
219
|
-
const
|
|
220
|
+
const P = Object.freeze({
|
|
220
221
|
breadcrumbLabel: "Breadcrumb",
|
|
221
222
|
checkboxOptionLabel: "Option",
|
|
222
223
|
checkboxStateLabel: (e, t) => `${e}: ${t}`,
|
|
@@ -261,40 +262,40 @@ const T = Object.freeze({
|
|
|
261
262
|
treeViewLoadError: "Unable to load tree items",
|
|
262
263
|
treeViewLoading: "Loading tree items…"
|
|
263
264
|
});
|
|
264
|
-
class
|
|
265
|
+
class fe {
|
|
265
266
|
constructor(t, n) {
|
|
266
|
-
|
|
267
|
-
|
|
267
|
+
c(this, "locale");
|
|
268
|
+
c(this, "messages");
|
|
268
269
|
this.locale = t, this.messages = n, Object.freeze(this);
|
|
269
270
|
}
|
|
270
271
|
message(t) {
|
|
271
272
|
return this.messages[t];
|
|
272
273
|
}
|
|
273
274
|
}
|
|
274
|
-
const
|
|
275
|
+
const De = new fe(
|
|
275
276
|
void 0,
|
|
276
|
-
|
|
277
|
+
P
|
|
277
278
|
);
|
|
278
|
-
function
|
|
279
|
-
if (e == null) return
|
|
279
|
+
function He(e) {
|
|
280
|
+
if (e == null) return De;
|
|
280
281
|
if (typeof e != "object" || Array.isArray(e))
|
|
281
282
|
throw new TypeError("Capillary UI localization must be an object");
|
|
282
|
-
const t =
|
|
283
|
+
const t = We(e.locale), n = e.messages;
|
|
283
284
|
if (n != null && (typeof n != "object" || Array.isArray(n)))
|
|
284
285
|
throw new TypeError("Capillary UI localization messages must be an object");
|
|
285
|
-
const
|
|
286
|
+
const i = { ...P };
|
|
286
287
|
if (n != null)
|
|
287
|
-
for (const
|
|
288
|
-
const s = n[
|
|
288
|
+
for (const r of Object.keys(P)) {
|
|
289
|
+
const s = n[r];
|
|
289
290
|
if (s === void 0) continue;
|
|
290
|
-
const o =
|
|
291
|
+
const o = P[r];
|
|
291
292
|
if (typeof s != typeof o)
|
|
292
|
-
throw new TypeError(`Capillary UI localization message "${
|
|
293
|
-
Object.assign(
|
|
293
|
+
throw new TypeError(`Capillary UI localization message "${r}" has the wrong type`);
|
|
294
|
+
Object.assign(i, { [r]: s });
|
|
294
295
|
}
|
|
295
|
-
return new
|
|
296
|
+
return new fe(t, Object.freeze(i));
|
|
296
297
|
}
|
|
297
|
-
function
|
|
298
|
+
function We(e) {
|
|
298
299
|
if (typeof e != "string" || e.trim() === "")
|
|
299
300
|
throw new TypeError("Capillary UI localization locale must be a non-empty BCP 47 language tag");
|
|
300
301
|
try {
|
|
@@ -303,7 +304,7 @@ function $e(e) {
|
|
|
303
304
|
throw new RangeError(`Invalid Capillary UI localization locale: ${e}`, { cause: t });
|
|
304
305
|
}
|
|
305
306
|
}
|
|
306
|
-
const
|
|
307
|
+
const Ke = /* @__PURE__ */ new Set([
|
|
307
308
|
"annotation-xml",
|
|
308
309
|
"color-profile",
|
|
309
310
|
"font-face",
|
|
@@ -313,27 +314,28 @@ const Ne = /* @__PURE__ */ new Set([
|
|
|
313
314
|
"font-face-name",
|
|
314
315
|
"missing-glyph"
|
|
315
316
|
]);
|
|
316
|
-
class
|
|
317
|
-
constructor(t = {}, n =
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
317
|
+
class V {
|
|
318
|
+
constructor(t = {}, n = ze()) {
|
|
319
|
+
c(this, "styleRegistry");
|
|
320
|
+
c(this, "services");
|
|
321
|
+
c(this, "router");
|
|
322
|
+
c(this, "localization");
|
|
323
|
+
c(this, "diagnosticScope");
|
|
324
|
+
c(this, "routedRoots", /* @__PURE__ */ new WeakSet());
|
|
323
325
|
if (t == null || typeof t != "object" || Array.isArray(t))
|
|
324
326
|
throw new TypeError("CapillaryUiRuntime options must be an object");
|
|
325
327
|
if (Object.hasOwn(t, "elementNames"))
|
|
326
328
|
throw new TypeError("CapillaryUiRuntime no longer supports configurable element names");
|
|
327
|
-
if (this.styleRegistry = n, this.localization =
|
|
329
|
+
if (this.styleRegistry = n, this.diagnosticScope = t.diagnosticScope ?? Pe, this.localization = He(t.localization), this.services = t.services ?? xe(), !(this.services instanceof ue))
|
|
328
330
|
throw new TypeError("Capillary UI services must be a ServiceScope");
|
|
329
331
|
if (this.router = t.router ?? null, this.router != null && (typeof this.router != "object" || typeof this.router.openScope != "function" || typeof this.router.completeScope != "function"))
|
|
330
332
|
throw new TypeError("Capillary UI router must be a BrowserRouter");
|
|
331
333
|
}
|
|
332
334
|
/** Resolve a fixed one-hyphen public host name for a built-in component. */
|
|
333
335
|
resolveElementName(t) {
|
|
334
|
-
|
|
336
|
+
pe(t, "Capillary UI component host name");
|
|
335
337
|
const n = `cap-${t.replaceAll("-", "")}`;
|
|
336
|
-
return
|
|
338
|
+
return Ye(n), n;
|
|
337
339
|
}
|
|
338
340
|
resolveHostSelector(t, n) {
|
|
339
341
|
if (typeof t != "string") throw new TypeError("Host selector must be a string");
|
|
@@ -344,17 +346,17 @@ class M {
|
|
|
344
346
|
return t.replaceAll("&", this.resolveElementName(n));
|
|
345
347
|
}
|
|
346
348
|
create(t, ...n) {
|
|
347
|
-
const
|
|
348
|
-
return
|
|
349
|
+
const i = u.withScope(this.diagnosticScope, () => new t(...n));
|
|
350
|
+
return i._setRuntime(this), i;
|
|
349
351
|
}
|
|
350
|
-
mount(t, n,
|
|
352
|
+
mount(t, n, i = null) {
|
|
351
353
|
t._setRuntime(this);
|
|
352
|
-
let
|
|
353
|
-
this.router != null && !this.routedRoots.has(t) && (this.routedRoots.add(t),
|
|
354
|
+
let r = null;
|
|
355
|
+
this.router != null && !this.routedRoots.has(t) && (this.routedRoots.add(t), r = this.router.openScope(this.router.root, t), t.onCleanup(r));
|
|
354
356
|
try {
|
|
355
|
-
t.mount(n,
|
|
357
|
+
t.mount(n, i), this.router != null && r != null && this.router.completeScope(this.router.root, t);
|
|
356
358
|
} catch (s) {
|
|
357
|
-
throw
|
|
359
|
+
throw r == null || r(), s;
|
|
358
360
|
}
|
|
359
361
|
return t;
|
|
360
362
|
}
|
|
@@ -367,19 +369,19 @@ class M {
|
|
|
367
369
|
return this.styleRegistry.injectAll(t);
|
|
368
370
|
}
|
|
369
371
|
}
|
|
370
|
-
function
|
|
371
|
-
return new
|
|
372
|
+
function St(e = {}) {
|
|
373
|
+
return new V(e);
|
|
372
374
|
}
|
|
373
|
-
const
|
|
374
|
-
function
|
|
375
|
+
const J = new V({}, _e);
|
|
376
|
+
function pe(e, t) {
|
|
375
377
|
if (typeof e != "string" || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))
|
|
376
378
|
throw new TypeError(`${t} must be a lowercase kebab-case name`);
|
|
377
379
|
}
|
|
378
|
-
function
|
|
379
|
-
if (
|
|
380
|
+
function Ye(e) {
|
|
381
|
+
if (pe(e, "Capillary UI element name"), !e.includes("-") || Ke.has(e))
|
|
380
382
|
throw new TypeError(`Capillary UI element name must be a non-reserved name containing a hyphen: ${e}`);
|
|
381
383
|
}
|
|
382
|
-
const
|
|
384
|
+
const $ = Symbol.for("@capillaryjs/capillary-ui.Fragment"), de = /* @__PURE__ */ new WeakSet(), Ze = /* @__PURE__ */ new Set([
|
|
383
385
|
"allowFullScreen",
|
|
384
386
|
"async",
|
|
385
387
|
"autoFocus",
|
|
@@ -403,7 +405,7 @@ const P = Symbol.for("@capillaryjs/capillary-ui.Fragment"), oe = /* @__PURE__ */
|
|
|
403
405
|
"required",
|
|
404
406
|
"reversed",
|
|
405
407
|
"selected"
|
|
406
|
-
]),
|
|
408
|
+
]), Ge = /* @__PURE__ */ new Set([
|
|
407
409
|
"checked",
|
|
408
410
|
"defaultChecked",
|
|
409
411
|
"defaultValue",
|
|
@@ -417,58 +419,58 @@ const P = Symbol.for("@capillaryjs/capillary-ui.Fragment"), oe = /* @__PURE__ */
|
|
|
417
419
|
"selectedIndex",
|
|
418
420
|
"tabIndex",
|
|
419
421
|
"value"
|
|
420
|
-
]),
|
|
421
|
-
function
|
|
422
|
-
|
|
422
|
+
]), Q = "data-cap";
|
|
423
|
+
function vt(e) {
|
|
424
|
+
Z(e, "live");
|
|
423
425
|
const t = Object.freeze({ emitter: e });
|
|
424
|
-
return
|
|
426
|
+
return de.add(t), t;
|
|
425
427
|
}
|
|
426
|
-
function
|
|
427
|
-
const
|
|
428
|
-
if (typeof
|
|
428
|
+
function k(e, t = null, ...n) {
|
|
429
|
+
const i = t ?? {};
|
|
430
|
+
if (typeof i != "object" || Array.isArray(i))
|
|
429
431
|
throw new TypeError("VNode props must be an object or null");
|
|
430
432
|
const {
|
|
431
|
-
children:
|
|
433
|
+
children: r,
|
|
432
434
|
key: s = null,
|
|
433
435
|
...o
|
|
434
|
-
} =
|
|
436
|
+
} = i;
|
|
435
437
|
return {
|
|
436
438
|
type: e,
|
|
437
439
|
key: s,
|
|
438
440
|
props: {
|
|
439
441
|
...o,
|
|
440
|
-
children:
|
|
442
|
+
children: he([r, n])
|
|
441
443
|
}
|
|
442
444
|
};
|
|
443
445
|
}
|
|
444
|
-
function
|
|
445
|
-
return e.reduce((n,
|
|
446
|
+
function Je(e, ...t) {
|
|
447
|
+
return e.reduce((n, i, r) => n + i + String(t[r] ?? ""), "");
|
|
446
448
|
}
|
|
447
449
|
const h = class h {
|
|
448
450
|
constructor(t = {}) {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
+
c(this, "props");
|
|
452
|
+
c(this, "dom", null);
|
|
451
453
|
/** @internal */
|
|
452
|
-
|
|
454
|
+
c(this, "_rendered", null);
|
|
453
455
|
/** @internal */
|
|
454
|
-
|
|
456
|
+
c(this, "_childComponents", /* @__PURE__ */ new Set());
|
|
455
457
|
/** @internal Component ancestry used to enforce structural invariants. */
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
458
|
+
c(this, "_parentComponent", null);
|
|
459
|
+
c(this, "initialized", !1);
|
|
460
|
+
c(this, "mounted", !1);
|
|
461
|
+
c(this, "destroyed", !1);
|
|
462
|
+
c(this, "updating", !1);
|
|
463
|
+
c(this, "updateRequested", !1);
|
|
464
|
+
c(this, "cleanupFunctions", /* @__PURE__ */ new Set());
|
|
465
|
+
c(this, "watched", /* @__PURE__ */ new Map());
|
|
466
|
+
c(this, "renderReadSubscriptions", /* @__PURE__ */ new Map());
|
|
467
|
+
c(this, "collectingRenderReads", null);
|
|
466
468
|
/** @internal */
|
|
467
|
-
|
|
469
|
+
c(this, "_runtime", J);
|
|
468
470
|
/** @internal Route lineage inherited by nested routed components. */
|
|
469
|
-
|
|
471
|
+
c(this, "_routeContext", null);
|
|
470
472
|
/** JSX component for this instance's runtime-configured custom host. */
|
|
471
|
-
|
|
473
|
+
c(this, "Host", ({
|
|
472
474
|
children: t = [],
|
|
473
475
|
...n
|
|
474
476
|
}) => this.host(n, t));
|
|
@@ -482,20 +484,33 @@ const h = class h {
|
|
|
482
484
|
throw new TypeError("Component.new() requires a Component constructor");
|
|
483
485
|
return n.mount();
|
|
484
486
|
}
|
|
485
|
-
static registerStyles(t =
|
|
487
|
+
static registerStyles(t = J, n = /* @__PURE__ */ new Set()) {
|
|
486
488
|
if (n.has(this)) return;
|
|
487
489
|
n.add(this);
|
|
488
|
-
const
|
|
489
|
-
for (const s of
|
|
490
|
-
Object.hasOwn(s, "css") && s.css && (
|
|
490
|
+
const i = this.hostName ?? null, r = ht(this);
|
|
491
|
+
for (const s of r)
|
|
492
|
+
Object.hasOwn(s, "css") && s.css && (i == null ? t.styleRegistry.registerCSS(s.css) : t.styleRegistry.registerHostCSS(
|
|
491
493
|
s.css,
|
|
492
|
-
t.resolveElementName(
|
|
494
|
+
t.resolveElementName(i)
|
|
493
495
|
));
|
|
494
|
-
for (const s of
|
|
496
|
+
for (const s of r)
|
|
495
497
|
if (Object.hasOwn(s, "dependencies"))
|
|
496
498
|
for (const o of s.dependencies ?? [])
|
|
497
499
|
o.registerStyles(t, n);
|
|
498
500
|
}
|
|
501
|
+
get diagnosticScope() {
|
|
502
|
+
var t;
|
|
503
|
+
return this.constructor.diagnosticScope ?? ((t = this._parentComponent) == null ? void 0 : t.diagnosticScope) ?? this._runtime.diagnosticScope;
|
|
504
|
+
}
|
|
505
|
+
[Ae]() {
|
|
506
|
+
return {
|
|
507
|
+
kind: "component",
|
|
508
|
+
label: T(this),
|
|
509
|
+
scope: this.diagnosticScope,
|
|
510
|
+
sources: [...this.watched.keys(), ...this.renderReadSubscriptions.keys()],
|
|
511
|
+
targets: [...this._childComponents]
|
|
512
|
+
};
|
|
513
|
+
}
|
|
499
514
|
/** One-time setup hook. Constructors must not subscribe or render. */
|
|
500
515
|
initialize() {
|
|
501
516
|
}
|
|
@@ -504,25 +519,25 @@ const h = class h {
|
|
|
504
519
|
}
|
|
505
520
|
/** Render this component's configured custom host element. */
|
|
506
521
|
host(t = null, ...n) {
|
|
507
|
-
const
|
|
508
|
-
if (
|
|
522
|
+
const i = this.constructor, r = i.hostName;
|
|
523
|
+
if (r == null)
|
|
509
524
|
throw new Error(`${this.constructor.name} does not declare a custom host name`);
|
|
510
525
|
const {
|
|
511
526
|
class: s,
|
|
512
527
|
className: o,
|
|
513
528
|
...a
|
|
514
|
-
} = t ?? {},
|
|
515
|
-
return
|
|
529
|
+
} = t ?? {}, l = o ?? s, f = this.props.island === !0 ? mt(l, "island") : l;
|
|
530
|
+
return k(this._runtime.resolveElementName(r), {
|
|
516
531
|
...a,
|
|
517
|
-
...
|
|
518
|
-
"data-cap-component":
|
|
519
|
-
...
|
|
532
|
+
...f == null ? {} : { className: f },
|
|
533
|
+
"data-cap-component": r,
|
|
534
|
+
...i.dataSurface == null ? {} : { "data-cap-surface": i.dataSurface }
|
|
520
535
|
}, ...n);
|
|
521
536
|
}
|
|
522
537
|
/** @internal Assign an immutable application runtime before initialization or mounting. */
|
|
523
538
|
_setRuntime(t) {
|
|
524
539
|
var n;
|
|
525
|
-
if (!(t instanceof
|
|
540
|
+
if (!(t instanceof V))
|
|
526
541
|
throw new TypeError("Component runtime must be a CapillaryUiRuntime");
|
|
527
542
|
if (t === this._runtime) return this;
|
|
528
543
|
if (this.initialized || this.mounted || this._rendered != null)
|
|
@@ -548,8 +563,8 @@ const h = class h {
|
|
|
548
563
|
mount(t = null, n = null) {
|
|
549
564
|
if (this.destroyed) throw new Error("Cannot mount a destroyed component");
|
|
550
565
|
this.validateIslandAncestry(this.props);
|
|
551
|
-
let
|
|
552
|
-
return this.initialized || (this.validateRequiredServices(), this.initialized = !0, this.initialize()), this.mounted || (this.mounted = !0, this.update(),
|
|
566
|
+
let i = !1;
|
|
567
|
+
return this.initialized || (this.validateRequiredServices(), this.initialized = !0, u.withScope(this.diagnosticScope, () => this.initialize())), this.mounted || (this.mounted = !0, this.update(), i = !0), t != null && (dt(t), Y(t, this._rendered, n)), i && this.afterMount(this.dom), this;
|
|
553
568
|
}
|
|
554
569
|
attachTo(t) {
|
|
555
570
|
return this.mount(t), this;
|
|
@@ -560,19 +575,37 @@ const h = class h {
|
|
|
560
575
|
if (this.updating)
|
|
561
576
|
return this.updateRequested = !0, this;
|
|
562
577
|
this.updating = !0;
|
|
578
|
+
const n = u.event(this, "consumer", {
|
|
579
|
+
parent: t instanceof $e ? t : u.currentEvent,
|
|
580
|
+
cause: "component render",
|
|
581
|
+
outcome: "started"
|
|
582
|
+
});
|
|
563
583
|
try {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
584
|
+
u.withEvent(n, () => {
|
|
585
|
+
do {
|
|
586
|
+
this.updateRequested = !1;
|
|
587
|
+
const i = /* @__PURE__ */ new Set();
|
|
588
|
+
this.collectingRenderReads = i;
|
|
589
|
+
let r;
|
|
590
|
+
try {
|
|
591
|
+
r = u.withScope(this.diagnosticScope, () => L(this.render()));
|
|
592
|
+
} finally {
|
|
593
|
+
this.collectingRenderReads = null;
|
|
594
|
+
}
|
|
595
|
+
this._rendered = D(this._rendered, r, this), this.dom = ve(this._rendered), this.reconcileRenderReads(i), this.afterUpdate(this.dom);
|
|
596
|
+
} while (this.updateRequested && !this.destroyed);
|
|
597
|
+
}), n && u.event(this, "consumer", {
|
|
598
|
+
parent: n,
|
|
599
|
+
cause: "component rendered",
|
|
600
|
+
outcome: "succeeded"
|
|
601
|
+
});
|
|
602
|
+
} catch (i) {
|
|
603
|
+
throw n && u.event(this, "consumer", {
|
|
604
|
+
parent: n,
|
|
605
|
+
cause: "component render failed",
|
|
606
|
+
outcome: "failed",
|
|
607
|
+
error: i
|
|
608
|
+
}), i;
|
|
576
609
|
} finally {
|
|
577
610
|
this.updating = !1;
|
|
578
611
|
}
|
|
@@ -592,11 +625,11 @@ const h = class h {
|
|
|
592
625
|
if (n == null || typeof n.subscribe != "function")
|
|
593
626
|
throw new TypeError("watch requires emitter-like values");
|
|
594
627
|
if (this.watched.has(n)) continue;
|
|
595
|
-
const
|
|
596
|
-
this.mounted && !this.destroyed && this.update(
|
|
597
|
-
}, { emitCurrent: !1 });
|
|
598
|
-
this.watched.set(n,
|
|
599
|
-
|
|
628
|
+
const i = n.subscribe(({ event: r }) => {
|
|
629
|
+
this.mounted && !this.destroyed && this.update(r);
|
|
630
|
+
}, { emitCurrent: !1, diagnosticTarget: this });
|
|
631
|
+
this.watched.set(n, i), this.onCleanup(() => {
|
|
632
|
+
i(), this.watched.delete(n);
|
|
600
633
|
});
|
|
601
634
|
}
|
|
602
635
|
return this;
|
|
@@ -646,24 +679,39 @@ const h = class h {
|
|
|
646
679
|
capillaryUiMessage(t) {
|
|
647
680
|
return this.localization.message(t);
|
|
648
681
|
}
|
|
649
|
-
listen(t, n,
|
|
682
|
+
listen(t, n, i, r) {
|
|
650
683
|
if (t == null || typeof t.addEventListener != "function")
|
|
651
684
|
throw new TypeError("listen target must be an EventTarget");
|
|
652
|
-
const s =
|
|
653
|
-
|
|
685
|
+
const s = {};
|
|
686
|
+
u.configure(s, {
|
|
687
|
+
kind: "interaction",
|
|
688
|
+
label: `${T(this)}: ${n}`,
|
|
689
|
+
scope: this.diagnosticScope
|
|
690
|
+
});
|
|
691
|
+
const o = (a) => K(
|
|
692
|
+
s,
|
|
693
|
+
this.diagnosticScope,
|
|
694
|
+
a,
|
|
695
|
+
o,
|
|
696
|
+
n,
|
|
697
|
+
() => i(a)
|
|
698
|
+
);
|
|
699
|
+
return t.addEventListener(n, o, r), this.onCleanup(() => {
|
|
700
|
+
t.removeEventListener(n, o, r), u.dispose(s);
|
|
701
|
+
}), this;
|
|
654
702
|
}
|
|
655
703
|
registerChild(t) {
|
|
656
704
|
if (!(t instanceof h))
|
|
657
705
|
throw new TypeError("registerChild requires a Component");
|
|
658
|
-
return this._childComponents.add(t), t;
|
|
706
|
+
return this._childComponents.add(t), u.active && u.inspect(this), t;
|
|
659
707
|
}
|
|
660
708
|
destroy() {
|
|
661
709
|
if (!this.destroyed) {
|
|
662
|
-
this.destroyed = !0, this.mounted = !1;
|
|
710
|
+
this.destroyed = !0, this.mounted = !1, u.dispose(this);
|
|
663
711
|
for (const t of [...this.cleanupFunctions]) t();
|
|
664
712
|
this.cleanupFunctions.clear(), this.watched.clear();
|
|
665
713
|
for (const t of this.renderReadSubscriptions.values()) t();
|
|
666
|
-
this.renderReadSubscriptions.clear(), this.collectingRenderReads = null, this._rendered &&
|
|
714
|
+
this.renderReadSubscriptions.clear(), this.collectingRenderReads = null, this._rendered && w(this._rendered, !0), this._rendered = null, this.dom = null, this._childComponents.clear(), this.onDestroy();
|
|
667
715
|
}
|
|
668
716
|
}
|
|
669
717
|
validateRequiredServices() {
|
|
@@ -673,42 +721,42 @@ const h = class h {
|
|
|
673
721
|
throw new Error(`${t.name} requires unregistered service "${n.name}"`);
|
|
674
722
|
}
|
|
675
723
|
validateIslandAncestry(t) {
|
|
676
|
-
if (!
|
|
724
|
+
if (!F(t)) return;
|
|
677
725
|
if (this.hasIslandDescendant())
|
|
678
726
|
throw new Error("An island component cannot contain another island");
|
|
679
727
|
let n = this._parentComponent;
|
|
680
728
|
for (; n != null; ) {
|
|
681
|
-
if (
|
|
729
|
+
if (F(n.props))
|
|
682
730
|
throw new Error("An island component cannot be nested inside another island");
|
|
683
731
|
n = n._parentComponent;
|
|
684
732
|
}
|
|
685
733
|
}
|
|
686
734
|
hasIslandDescendant() {
|
|
687
735
|
for (const t of this._childComponents)
|
|
688
|
-
if (
|
|
736
|
+
if (F(t.props) || t.hasIslandDescendant()) return !0;
|
|
689
737
|
return !1;
|
|
690
738
|
}
|
|
691
739
|
onDestroy() {
|
|
692
740
|
}
|
|
693
741
|
trackRenderRead(t) {
|
|
694
|
-
if (
|
|
742
|
+
if (Z(t, "Component.read"), this.collectingRenderReads == null)
|
|
695
743
|
throw new Error("Component.read() and snapshot() may only be called during render()");
|
|
696
744
|
this.collectingRenderReads.add(t);
|
|
697
745
|
}
|
|
698
746
|
reconcileRenderReads(t) {
|
|
699
|
-
for (const [n,
|
|
700
|
-
t.has(n) || (
|
|
747
|
+
for (const [n, i] of this.renderReadSubscriptions)
|
|
748
|
+
t.has(n) || (i(), this.renderReadSubscriptions.delete(n));
|
|
701
749
|
for (const n of t) {
|
|
702
750
|
if (this.watched.has(n) || this.renderReadSubscriptions.has(n)) continue;
|
|
703
|
-
const
|
|
704
|
-
this.mounted && !this.destroyed && this.update(
|
|
705
|
-
}, { emitCurrent: !1 });
|
|
706
|
-
this.renderReadSubscriptions.set(n,
|
|
751
|
+
const i = n.subscribe(({ event: r }) => {
|
|
752
|
+
this.mounted && !this.destroyed && this.update(r);
|
|
753
|
+
}, { emitCurrent: !1, diagnosticTarget: this });
|
|
754
|
+
this.renderReadSubscriptions.set(n, i);
|
|
707
755
|
}
|
|
708
756
|
}
|
|
709
757
|
};
|
|
710
|
-
|
|
711
|
-
|
|
758
|
+
c(h, "dependencies", []), c(h, "requiredServices", []), /** Component `live()` bindings are opt-in; subclasses declare their allowlist. */
|
|
759
|
+
c(h, "liveProps", []), c(h, "css", Je`
|
|
712
760
|
.cap-fill-horizontal,
|
|
713
761
|
.cap-fill-vertical {
|
|
714
762
|
box-sizing: border-box;
|
|
@@ -808,17 +856,19 @@ l(h, "liveProps", []), l(h, "css", Me`
|
|
|
808
856
|
label[data-cap] {
|
|
809
857
|
user-select: none;
|
|
810
858
|
}
|
|
811
|
-
`),
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
859
|
+
`), c(h, "hostName", null), /** Override for a diagnostic-tool subtree; ordinary components inherit their owner/runtime. */
|
|
860
|
+
c(h, "diagnosticScope", null), /** Optional stable display name for bundled application components. Built-ins use their host name. */
|
|
861
|
+
c(h, "diagnosticLabel", null), /** Optional host-level data surface marker for parent composition. */
|
|
862
|
+
c(h, "dataSurface", null);
|
|
863
|
+
let b = h;
|
|
864
|
+
function L(e) {
|
|
865
|
+
return Array.isArray(e) ? k($, null, e) : e == null || typeof e == "boolean" ? k($) : e;
|
|
866
|
+
}
|
|
867
|
+
function he(e) {
|
|
868
|
+
const t = [], n = (i) => {
|
|
869
|
+
if (Array.isArray(i))
|
|
870
|
+
for (const r of i) n(r);
|
|
871
|
+
else i != null && typeof i != "boolean" && t.push(i);
|
|
822
872
|
};
|
|
823
873
|
return n(e), t;
|
|
824
874
|
}
|
|
@@ -831,35 +881,35 @@ function O(e, t) {
|
|
|
831
881
|
node: document.createTextNode(String(e)),
|
|
832
882
|
owner: t
|
|
833
883
|
};
|
|
834
|
-
if (
|
|
884
|
+
if (I(e)) {
|
|
835
885
|
const s = document.createComment("cap-emitter-start"), o = document.createComment("cap-emitter-end"), a = e.get();
|
|
836
886
|
if (Object.is(a, e))
|
|
837
887
|
throw new TypeError("A Capillary UI emitter child cannot render itself");
|
|
838
|
-
const
|
|
839
|
-
|
|
840
|
-
const
|
|
841
|
-
|
|
888
|
+
const l = document.createDocumentFragment();
|
|
889
|
+
l.append(s, o);
|
|
890
|
+
const f = O(L(a), t);
|
|
891
|
+
Y(l, f, o);
|
|
842
892
|
const p = {
|
|
843
893
|
kind: "emitter",
|
|
844
894
|
key: null,
|
|
845
895
|
source: e,
|
|
846
896
|
start: s,
|
|
847
897
|
end: o,
|
|
848
|
-
child:
|
|
898
|
+
child: f,
|
|
849
899
|
unsubscribe: () => {
|
|
850
900
|
},
|
|
851
901
|
owner: t
|
|
852
902
|
};
|
|
853
|
-
return p.unsubscribe = e
|
|
854
|
-
if (Object.is(
|
|
903
|
+
return p.unsubscribe = N(e, p, t, "reactive child", (y) => {
|
|
904
|
+
if (Object.is(y, e))
|
|
855
905
|
throw new TypeError("A Capillary UI emitter child cannot render itself");
|
|
856
|
-
p.child =
|
|
857
|
-
}
|
|
906
|
+
p.child = D(p.child, L(y), t);
|
|
907
|
+
}), p;
|
|
858
908
|
}
|
|
859
|
-
if (e instanceof
|
|
909
|
+
if (e instanceof b)
|
|
860
910
|
return e._setRuntime(t._runtime), e._setRouteContext(t._routeContextForChildren()), e._setParentComponent(t), e.mount(), t.registerChild(e), {
|
|
861
911
|
kind: "component",
|
|
862
|
-
key:
|
|
912
|
+
key: Ee(e.props),
|
|
863
913
|
type: e.constructor,
|
|
864
914
|
instance: e,
|
|
865
915
|
prebuilt: !0,
|
|
@@ -867,23 +917,23 @@ function O(e, t) {
|
|
|
867
917
|
liveProps: /* @__PURE__ */ new Map(),
|
|
868
918
|
owner: t
|
|
869
919
|
};
|
|
870
|
-
if (!
|
|
871
|
-
throw new TypeError(`Invalid Capillary UI child: ${
|
|
872
|
-
const { type: n, key:
|
|
873
|
-
if (n ===
|
|
920
|
+
if (!g(e))
|
|
921
|
+
throw new TypeError(`Invalid Capillary UI child: ${ie(e)}`);
|
|
922
|
+
const { type: n, key: i = null, props: r } = e;
|
|
923
|
+
if (n === $) {
|
|
874
924
|
const s = document.createComment("cap-fragment-start"), o = document.createComment("cap-fragment-end"), a = {
|
|
875
925
|
kind: "fragment",
|
|
876
|
-
key:
|
|
926
|
+
key: i,
|
|
877
927
|
type: n,
|
|
878
928
|
start: s,
|
|
879
929
|
end: o,
|
|
880
930
|
children: [],
|
|
881
931
|
owner: t
|
|
882
|
-
},
|
|
883
|
-
return
|
|
884
|
-
|
|
932
|
+
}, l = document.createDocumentFragment();
|
|
933
|
+
return l.append(s, o), a.children = z(
|
|
934
|
+
l,
|
|
885
935
|
[],
|
|
886
|
-
|
|
936
|
+
r.children,
|
|
887
937
|
t,
|
|
888
938
|
o,
|
|
889
939
|
s
|
|
@@ -892,7 +942,7 @@ function O(e, t) {
|
|
|
892
942
|
if (typeof n == "string") {
|
|
893
943
|
const s = document.createElement(n), o = {
|
|
894
944
|
kind: "element",
|
|
895
|
-
key:
|
|
945
|
+
key: i,
|
|
896
946
|
type: n,
|
|
897
947
|
node: s,
|
|
898
948
|
props: {},
|
|
@@ -903,16 +953,19 @@ function O(e, t) {
|
|
|
903
953
|
children: [],
|
|
904
954
|
owner: t
|
|
905
955
|
};
|
|
906
|
-
return
|
|
956
|
+
return we(o, r), o.children = z(s, [], r.children, t), o;
|
|
907
957
|
}
|
|
908
|
-
if (
|
|
909
|
-
const s =
|
|
910
|
-
|
|
911
|
-
const o =
|
|
958
|
+
if (Re(n)) {
|
|
959
|
+
const s = r;
|
|
960
|
+
ge(n, s);
|
|
961
|
+
const o = X(s), a = u.withScope(
|
|
962
|
+
n.diagnosticScope ?? t.diagnosticScope,
|
|
963
|
+
() => new n(o)
|
|
964
|
+
);
|
|
912
965
|
a._setRuntime(t._runtime), a._setRouteContext(t._routeContextForChildren()), a._setParentComponent(t);
|
|
913
|
-
const
|
|
966
|
+
const l = {
|
|
914
967
|
kind: "component",
|
|
915
|
-
key:
|
|
968
|
+
key: i,
|
|
916
969
|
type: n,
|
|
917
970
|
instance: a,
|
|
918
971
|
prebuilt: !1,
|
|
@@ -920,191 +973,218 @@ function O(e, t) {
|
|
|
920
973
|
liveProps: /* @__PURE__ */ new Map(),
|
|
921
974
|
owner: t
|
|
922
975
|
};
|
|
923
|
-
return
|
|
976
|
+
return be(l, s), a.mount(), t.registerChild(a), l;
|
|
924
977
|
}
|
|
925
978
|
if (typeof n == "function") {
|
|
926
|
-
const s = n, o =
|
|
979
|
+
const s = n, o = r, a = X(o), l = s === Reflect.get(t, "Host") ? null : {};
|
|
980
|
+
l && u.configure(l, {
|
|
981
|
+
kind: "component",
|
|
982
|
+
label: String(Reflect.get(s, "diagnosticLabel") ?? s.name ?? "Function component"),
|
|
983
|
+
scope: t.diagnosticScope,
|
|
984
|
+
sources: [t]
|
|
985
|
+
});
|
|
986
|
+
const f = ye(l, () => O(L(s(a)), t)), p = {
|
|
927
987
|
kind: "function",
|
|
928
|
-
key:
|
|
988
|
+
key: i,
|
|
929
989
|
type: s,
|
|
930
990
|
props: a,
|
|
931
991
|
sourceProps: o,
|
|
932
992
|
liveProps: /* @__PURE__ */ new Map(),
|
|
933
|
-
child:
|
|
993
|
+
child: f,
|
|
994
|
+
diagnosticSubject: l,
|
|
934
995
|
owner: t
|
|
935
996
|
};
|
|
936
|
-
return
|
|
997
|
+
return Xe(p), p;
|
|
937
998
|
}
|
|
938
|
-
throw new TypeError(`Unsupported vnode type: ${
|
|
999
|
+
throw new TypeError(`Unsupported vnode type: ${ie(n)}`);
|
|
939
1000
|
}
|
|
940
|
-
function
|
|
1001
|
+
function D(e, t, n) {
|
|
941
1002
|
if (e == null) return O(t, n);
|
|
942
|
-
if (
|
|
943
|
-
const
|
|
944
|
-
return s &&
|
|
1003
|
+
if (Ce(e, t)) return me(e, t, n);
|
|
1004
|
+
const i = O(t, n), r = ve(e), s = (r == null ? void 0 : r.parentNode) ?? null;
|
|
1005
|
+
return s && Y(s, i, r), w(e, !0), i;
|
|
945
1006
|
}
|
|
946
|
-
function
|
|
947
|
-
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" ? (!
|
|
1007
|
+
function me(e, t, n) {
|
|
1008
|
+
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" ? (!I(t) || e.source !== t, e) : e.kind === "component" ? (t instanceof b || g(t) && Qe(e, t.props), e) : g(t) ? e.kind === "function" ? (et(e, t.props), e) : e.kind === "fragment" ? (e.children = z(
|
|
948
1009
|
e.start.parentNode,
|
|
949
1010
|
e.children,
|
|
950
1011
|
t.props.children,
|
|
951
1012
|
n,
|
|
952
1013
|
e.end,
|
|
953
1014
|
e.start
|
|
954
|
-
), e) : (
|
|
1015
|
+
), e) : (we(e, t.props), e.children = z(
|
|
955
1016
|
e.node,
|
|
956
1017
|
e.children,
|
|
957
1018
|
t.props.children,
|
|
958
1019
|
n
|
|
959
1020
|
), e) : e;
|
|
960
1021
|
}
|
|
961
|
-
function
|
|
1022
|
+
function X(e) {
|
|
962
1023
|
return Object.fromEntries(Object.entries(e).map(([t, n]) => [
|
|
963
1024
|
t,
|
|
964
|
-
|
|
1025
|
+
E(n) ? n.emitter.get() : n
|
|
965
1026
|
]));
|
|
966
1027
|
}
|
|
967
|
-
function
|
|
968
|
-
|
|
969
|
-
e.props = { ...e.props, [n]:
|
|
970
|
-
}), e.props =
|
|
1028
|
+
function be(e, t) {
|
|
1029
|
+
H(e.liveProps, t, e.instance, T(e.instance), (n, i) => {
|
|
1030
|
+
e.props = { ...e.props, [n]: i }, e.instance.setProps(e.props);
|
|
1031
|
+
}), e.props = W(e.liveProps, t), e.instance.setProps(e.props);
|
|
971
1032
|
}
|
|
972
|
-
function
|
|
973
|
-
|
|
1033
|
+
function Qe(e, t) {
|
|
1034
|
+
ge(e.type, t), be(e, t);
|
|
974
1035
|
}
|
|
975
|
-
function
|
|
1036
|
+
function ge(e, t) {
|
|
976
1037
|
const n = Reflect.get(e, "liveProps");
|
|
977
1038
|
if (n == null) return;
|
|
978
|
-
if (!Array.isArray(n) || n.some((
|
|
1039
|
+
if (!Array.isArray(n) || n.some((r) => typeof r != "string"))
|
|
979
1040
|
throw new TypeError(`${e.name || "Component"}.liveProps must be an array`);
|
|
980
|
-
const
|
|
981
|
-
for (const [
|
|
982
|
-
if (
|
|
1041
|
+
const i = new Set(n);
|
|
1042
|
+
for (const [r, s] of Object.entries(t))
|
|
1043
|
+
if (E(s) && !i.has(r))
|
|
983
1044
|
throw new TypeError(
|
|
984
|
-
`${e.name || "Component"} prop "${
|
|
1045
|
+
`${e.name || "Component"} prop "${r}" does not support live()`
|
|
985
1046
|
);
|
|
986
1047
|
}
|
|
987
|
-
function
|
|
988
|
-
|
|
989
|
-
e.props = { ...e.props, [t]: n },
|
|
990
|
-
}), e.props =
|
|
991
|
-
}
|
|
992
|
-
function
|
|
993
|
-
e.sourceProps = t,
|
|
994
|
-
e.props = { ...e.props, [n]:
|
|
995
|
-
}), e.props =
|
|
996
|
-
}
|
|
997
|
-
function
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1048
|
+
function Xe(e) {
|
|
1049
|
+
H(e.liveProps, e.sourceProps, e.owner, e.type.diagnosticLabel ?? e.type.name, (t, n) => {
|
|
1050
|
+
e.props = { ...e.props, [t]: n }, q(e);
|
|
1051
|
+
}), e.props = W(e.liveProps, e.sourceProps);
|
|
1052
|
+
}
|
|
1053
|
+
function et(e, t) {
|
|
1054
|
+
e.sourceProps = t, H(e.liveProps, t, e.owner, e.type.diagnosticLabel ?? e.type.name, (n, i) => {
|
|
1055
|
+
e.props = { ...e.props, [n]: i }, q(e);
|
|
1056
|
+
}), e.props = W(e.liveProps, t), q(e);
|
|
1057
|
+
}
|
|
1058
|
+
function q(e) {
|
|
1059
|
+
ye(e.diagnosticSubject, () => {
|
|
1060
|
+
const t = L(e.type(e.props));
|
|
1061
|
+
e.child = D(e.child, t, e.owner);
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1064
|
+
function ye(e, t) {
|
|
1065
|
+
if (!e) return t();
|
|
1066
|
+
const n = u.event(e, "consumer", { cause: "function component render", outcome: "started" });
|
|
1067
|
+
try {
|
|
1068
|
+
const i = n ? u.withEvent(n, t) : t();
|
|
1069
|
+
return n && u.event(e, "consumer", { parent: n, cause: "function component rendered", outcome: "succeeded" }), i;
|
|
1070
|
+
} catch (i) {
|
|
1071
|
+
throw n && u.event(e, "consumer", { parent: n, cause: "function component failed", outcome: "failed", error: i }), i;
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
function H(e, t, n, i, r) {
|
|
1075
|
+
for (const [s, o] of e) {
|
|
1076
|
+
const a = t[s];
|
|
1077
|
+
E(a) && a.emitter === o.source || (o.unsubscribe(), e.delete(s));
|
|
1078
|
+
}
|
|
1079
|
+
for (const [s, o] of Object.entries(t)) {
|
|
1080
|
+
if (!E(o) || e.has(s)) continue;
|
|
1081
|
+
const a = {
|
|
1082
|
+
source: o.emitter,
|
|
1083
|
+
value: o.emitter.get(),
|
|
1011
1084
|
unsubscribe: () => {
|
|
1012
1085
|
}
|
|
1013
1086
|
};
|
|
1014
|
-
|
|
1015
|
-
e.get(
|
|
1016
|
-
}
|
|
1087
|
+
a.unsubscribe = N(o.emitter, a, n, `${i}.${s}`, (l) => {
|
|
1088
|
+
e.get(s) === a && (a.value = l, r(s, l));
|
|
1089
|
+
}), e.set(s, a);
|
|
1017
1090
|
}
|
|
1018
1091
|
}
|
|
1019
|
-
function
|
|
1020
|
-
return Object.fromEntries(Object.entries(t).map(([n,
|
|
1021
|
-
var
|
|
1092
|
+
function W(e, t) {
|
|
1093
|
+
return Object.fromEntries(Object.entries(t).map(([n, i]) => {
|
|
1094
|
+
var r;
|
|
1022
1095
|
return [
|
|
1023
1096
|
n,
|
|
1024
|
-
|
|
1097
|
+
E(i) ? ((r = e.get(n)) == null ? void 0 : r.value) ?? i.emitter.get() : i
|
|
1025
1098
|
];
|
|
1026
1099
|
}));
|
|
1027
1100
|
}
|
|
1028
|
-
function z(e, t, n,
|
|
1101
|
+
function z(e, t, n, i, r = null, s = null) {
|
|
1029
1102
|
if (e == null) throw new Error("Cannot patch a detached fragment range");
|
|
1030
|
-
const o =
|
|
1031
|
-
for (const
|
|
1032
|
-
|
|
1033
|
-
const
|
|
1034
|
-
let
|
|
1035
|
-
for (const
|
|
1036
|
-
const
|
|
1037
|
-
if (
|
|
1038
|
-
if (
|
|
1039
|
-
|
|
1103
|
+
const o = he(n), a = /* @__PURE__ */ new Map(), l = [];
|
|
1104
|
+
for (const d of t)
|
|
1105
|
+
d.key == null ? l.push(d) : a.has(d.key) || a.set(d.key, d);
|
|
1106
|
+
const f = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), y = [];
|
|
1107
|
+
let Oe = 0;
|
|
1108
|
+
for (const d of o) {
|
|
1109
|
+
const m = R(d);
|
|
1110
|
+
if (m != null) {
|
|
1111
|
+
if (f.has(m)) throw new Error(`Duplicate sibling key: ${String(m)}`);
|
|
1112
|
+
f.add(m);
|
|
1040
1113
|
}
|
|
1041
|
-
const
|
|
1042
|
-
|
|
1043
|
-
}
|
|
1044
|
-
for (const
|
|
1045
|
-
p.has(
|
|
1046
|
-
let
|
|
1047
|
-
for (const
|
|
1048
|
-
for (const
|
|
1049
|
-
|
|
1050
|
-
return
|
|
1051
|
-
}
|
|
1052
|
-
function
|
|
1114
|
+
const j = m == null ? l[Oe++] : a.get(m);
|
|
1115
|
+
j && Ce(j, d) ? (p.add(j), y.push(me(j, d, i))) : y.push(O(d, i));
|
|
1116
|
+
}
|
|
1117
|
+
for (const d of t)
|
|
1118
|
+
p.has(d) || w(d, !0);
|
|
1119
|
+
let C = s ? s.nextSibling : e.firstChild;
|
|
1120
|
+
for (const d of y)
|
|
1121
|
+
for (const m of S(d))
|
|
1122
|
+
m === C ? C = C.nextSibling : (e.insertBefore(m, C ?? r), C = m.nextSibling);
|
|
1123
|
+
return y;
|
|
1124
|
+
}
|
|
1125
|
+
function we(e, t) {
|
|
1053
1126
|
const n = Object.fromEntries(Object.entries(t).filter(
|
|
1054
|
-
([s]) => s !== "children" &&
|
|
1055
|
-
)),
|
|
1127
|
+
([s]) => s !== "children" && A(s) !== Q
|
|
1128
|
+
)), i = e.props, r = /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(n)]);
|
|
1056
1129
|
for (const s of ["value", "checked"])
|
|
1057
1130
|
if (Object.hasOwn(n, s) && Object.hasOwn(n, `bind:${s}`))
|
|
1058
1131
|
throw new Error(`${s} and bind:${s} cannot be used together`);
|
|
1059
|
-
for (const s of
|
|
1060
|
-
const o =
|
|
1061
|
-
if (
|
|
1062
|
-
|
|
1132
|
+
for (const s of r) {
|
|
1133
|
+
const o = i[s], a = n[s];
|
|
1134
|
+
if (ct(s))
|
|
1135
|
+
nt(e, s, a);
|
|
1063
1136
|
else if (s === "ref")
|
|
1064
|
-
o !== a &&
|
|
1065
|
-
else if (
|
|
1066
|
-
|
|
1067
|
-
else if (
|
|
1068
|
-
|
|
1137
|
+
o !== a && rt(e, a);
|
|
1138
|
+
else if (lt(s))
|
|
1139
|
+
it(e, s, a);
|
|
1140
|
+
else if (E(a))
|
|
1141
|
+
tt(e, s, a);
|
|
1069
1142
|
else {
|
|
1070
|
-
const
|
|
1071
|
-
|
|
1072
|
-
const
|
|
1073
|
-
Object.is(
|
|
1143
|
+
const l = e.liveProps.get(s);
|
|
1144
|
+
l && (l.unsubscribe(), e.liveProps.delete(s));
|
|
1145
|
+
const f = (l == null ? void 0 : l.value) ?? o;
|
|
1146
|
+
Object.is(f, a) || v(e.node, s, f, a);
|
|
1074
1147
|
}
|
|
1075
1148
|
}
|
|
1076
|
-
e.node.setAttribute(
|
|
1149
|
+
e.node.setAttribute(Q, ""), e.props = { ...n };
|
|
1077
1150
|
}
|
|
1078
|
-
function
|
|
1079
|
-
const
|
|
1080
|
-
if ((
|
|
1081
|
-
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1151
|
+
function tt(e, t, n) {
|
|
1152
|
+
const i = e.liveProps.get(t);
|
|
1153
|
+
if ((i == null ? void 0 : i.source) === n.emitter) return;
|
|
1154
|
+
i == null || i.unsubscribe();
|
|
1155
|
+
const r = n.emitter.get();
|
|
1156
|
+
v(e.node, t, (i == null ? void 0 : i.value) ?? e.props[t], r);
|
|
1084
1157
|
const s = {
|
|
1085
1158
|
source: n.emitter,
|
|
1086
|
-
value:
|
|
1159
|
+
value: r,
|
|
1087
1160
|
unsubscribe: () => {
|
|
1088
1161
|
}
|
|
1089
1162
|
};
|
|
1090
|
-
s.unsubscribe = n.emitter.
|
|
1163
|
+
s.unsubscribe = N(n.emitter, s, e.owner, `${e.type}.${t}`, (o) => {
|
|
1091
1164
|
const a = s.value;
|
|
1092
|
-
s.value = o, Object.is(a, o) ||
|
|
1093
|
-
}
|
|
1165
|
+
s.value = o, Object.is(a, o) || v(e.node, t, a, o);
|
|
1166
|
+
}), e.liveProps.set(t, s);
|
|
1094
1167
|
}
|
|
1095
|
-
function
|
|
1096
|
-
const
|
|
1168
|
+
function nt(e, t, n) {
|
|
1169
|
+
const i = t.slice(5), r = e.nativeBindings.get(t);
|
|
1097
1170
|
if (n == null) {
|
|
1098
|
-
|
|
1171
|
+
r && (r.unsubscribe(), e.node.removeEventListener(r.eventName, r.listener), e.nativeBindings.delete(t), v(e.node, i, r.value, void 0));
|
|
1099
1172
|
return;
|
|
1100
1173
|
}
|
|
1101
|
-
if (
|
|
1102
|
-
|
|
1103
|
-
const s =
|
|
1104
|
-
|
|
1105
|
-
const a = () => {
|
|
1106
|
-
|
|
1107
|
-
|
|
1174
|
+
if (ut(n, t), (r == null ? void 0 : r.source) === n) return;
|
|
1175
|
+
r && (r.unsubscribe(), e.node.removeEventListener(r.eventName, r.listener)), ft(e.node, i);
|
|
1176
|
+
const s = pt(e.node, i), o = n.get();
|
|
1177
|
+
v(e.node, i, r == null ? void 0 : r.value, o);
|
|
1178
|
+
const a = (f) => {
|
|
1179
|
+
K(
|
|
1180
|
+
Se(e, s),
|
|
1181
|
+
e.owner.diagnosticScope,
|
|
1182
|
+
f,
|
|
1183
|
+
a,
|
|
1184
|
+
`${t} changed`,
|
|
1185
|
+
() => n.set(Reflect.get(e.node, i), `${t} changed`)
|
|
1186
|
+
);
|
|
1187
|
+
}, l = {
|
|
1108
1188
|
source: n,
|
|
1109
1189
|
value: o,
|
|
1110
1190
|
eventName: s,
|
|
@@ -1112,73 +1192,142 @@ function He(e, t, n) {
|
|
|
1112
1192
|
unsubscribe: () => {
|
|
1113
1193
|
}
|
|
1114
1194
|
};
|
|
1115
|
-
|
|
1116
|
-
const p =
|
|
1117
|
-
|
|
1118
|
-
}
|
|
1119
|
-
}
|
|
1120
|
-
function
|
|
1121
|
-
const
|
|
1122
|
-
if (
|
|
1195
|
+
l.unsubscribe = N(n, l, e.owner, `${e.type}.${t}`, (f) => {
|
|
1196
|
+
const p = l.value;
|
|
1197
|
+
l.value = f, Object.is(p, f) || v(e.node, i, p, f);
|
|
1198
|
+
}), e.node.addEventListener(s, a), e.nativeBindings.set(t, l);
|
|
1199
|
+
}
|
|
1200
|
+
function it(e, t, n) {
|
|
1201
|
+
const i = t.slice(2).toLowerCase(), r = e.listeners.get(t), s = r ? te.get(r) ?? r : null;
|
|
1202
|
+
if (r && s !== n && (e.node.removeEventListener(i, r), e.listeners.delete(t)), n != null && typeof n != "function")
|
|
1123
1203
|
throw new TypeError(`${t} must be a function or null`);
|
|
1124
|
-
if (typeof n == "function" &&
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1127
|
-
|
|
1204
|
+
if (typeof n == "function" && s !== n) {
|
|
1205
|
+
const o = (a) => K(
|
|
1206
|
+
Se(e, i),
|
|
1207
|
+
e.owner.diagnosticScope,
|
|
1208
|
+
a,
|
|
1209
|
+
o,
|
|
1210
|
+
i,
|
|
1211
|
+
() => n.call(e.node, a)
|
|
1212
|
+
);
|
|
1213
|
+
te.set(o, n), e.node.addEventListener(i, o), e.listeners.set(t, o);
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
const ee = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap();
|
|
1217
|
+
function K(e, t, n, i, r, s) {
|
|
1218
|
+
return u.withScope(t, () => {
|
|
1219
|
+
if (!u.active) return s();
|
|
1220
|
+
let o = M.get(n);
|
|
1221
|
+
return (!o || o.listeners.has(i)) && (o = { event: u.event(e, "interaction", { cause: r, outcome: "started" }), listeners: /* @__PURE__ */ new Set() }, M.set(n, o), queueMicrotask(() => M.delete(n))), o.listeners.add(i), u.withEvent(o.event, s);
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
function Se(e, t) {
|
|
1225
|
+
var r;
|
|
1226
|
+
let n = ee.get(e);
|
|
1227
|
+
n || (n = /* @__PURE__ */ new Map(), ee.set(e, n));
|
|
1228
|
+
let i = n.get(t);
|
|
1229
|
+
if (!i) {
|
|
1230
|
+
i = {};
|
|
1231
|
+
const s = e.node.getAttribute("aria-label") ?? e.node.getAttribute("name") ?? ((r = e.node.textContent) == null ? void 0 : r.trim().slice(0, 80)) ?? "";
|
|
1232
|
+
u.configure(i, {
|
|
1233
|
+
kind: "interaction",
|
|
1234
|
+
label: `${T(e.owner)}: ${e.type} ${s} ${t}`.trim(),
|
|
1235
|
+
scope: e.owner.diagnosticScope
|
|
1236
|
+
}), n.set(t, i);
|
|
1237
|
+
}
|
|
1238
|
+
return i;
|
|
1239
|
+
}
|
|
1240
|
+
function N(e, t, n, i, r) {
|
|
1241
|
+
u.configure(t, {
|
|
1242
|
+
kind: "binding",
|
|
1243
|
+
label: `${T(n)}: ${i}`,
|
|
1244
|
+
scope: n.diagnosticScope,
|
|
1245
|
+
sources: [e]
|
|
1246
|
+
});
|
|
1247
|
+
const s = e.subscribe(({ value: o, event: a }) => {
|
|
1248
|
+
const l = u.event(t, "consumer", {
|
|
1249
|
+
parent: a,
|
|
1250
|
+
cause: "binding update",
|
|
1251
|
+
value: o,
|
|
1252
|
+
outcome: "started"
|
|
1253
|
+
});
|
|
1254
|
+
try {
|
|
1255
|
+
u.withEvent(l, () => r(o)), l && u.event(t, "consumer", {
|
|
1256
|
+
parent: l,
|
|
1257
|
+
cause: "binding updated",
|
|
1258
|
+
value: o,
|
|
1259
|
+
outcome: "succeeded"
|
|
1260
|
+
});
|
|
1261
|
+
} catch (f) {
|
|
1262
|
+
throw l && u.event(t, "consumer", {
|
|
1263
|
+
parent: l,
|
|
1264
|
+
cause: "binding update failed",
|
|
1265
|
+
outcome: "failed",
|
|
1266
|
+
error: f
|
|
1267
|
+
}), f;
|
|
1268
|
+
}
|
|
1269
|
+
}, { emitCurrent: !1, diagnosticTarget: t });
|
|
1270
|
+
return () => {
|
|
1271
|
+
s(), u.dispose(t);
|
|
1272
|
+
};
|
|
1273
|
+
}
|
|
1274
|
+
function T(e) {
|
|
1275
|
+
const t = e.constructor;
|
|
1276
|
+
return t.diagnosticLabel ?? t.hostName ?? t.name;
|
|
1128
1277
|
}
|
|
1129
|
-
function
|
|
1130
|
-
if (
|
|
1278
|
+
function rt(e, t) {
|
|
1279
|
+
if (B(e.ref, null), t != null && typeof t != "function" && typeof t != "object")
|
|
1131
1280
|
throw new TypeError("ref must be a function, object, or null");
|
|
1132
|
-
e.ref = t,
|
|
1281
|
+
e.ref = t, B(e.ref, e.node);
|
|
1133
1282
|
}
|
|
1134
|
-
function
|
|
1283
|
+
function v(e, t, n, i) {
|
|
1135
1284
|
if (t === "class" || t === "className") {
|
|
1136
|
-
|
|
1285
|
+
U(e, "class", i);
|
|
1137
1286
|
return;
|
|
1138
1287
|
}
|
|
1139
1288
|
if (t === "for" || t === "htmlFor") {
|
|
1140
|
-
|
|
1289
|
+
U(e, "for", i);
|
|
1141
1290
|
return;
|
|
1142
1291
|
}
|
|
1143
1292
|
if (t === "dataset") {
|
|
1144
|
-
|
|
1293
|
+
st(e, n, i);
|
|
1145
1294
|
return;
|
|
1146
1295
|
}
|
|
1147
1296
|
if (t === "style") {
|
|
1148
|
-
|
|
1297
|
+
ot(e, n, i);
|
|
1149
1298
|
return;
|
|
1150
1299
|
}
|
|
1151
1300
|
if (t === "dangerouslySetInnerHTML")
|
|
1152
1301
|
throw new Error("dangerouslySetInnerHTML is not supported");
|
|
1153
|
-
const
|
|
1154
|
-
if (
|
|
1155
|
-
const s = !!
|
|
1156
|
-
|
|
1302
|
+
const r = at(t);
|
|
1303
|
+
if (Ze.has(r)) {
|
|
1304
|
+
const s = !!i;
|
|
1305
|
+
r in e && Reflect.set(e, r, s), e.toggleAttribute(A(t), s);
|
|
1157
1306
|
return;
|
|
1158
1307
|
}
|
|
1159
|
-
if (
|
|
1160
|
-
const s =
|
|
1161
|
-
Object.is(Reflect.get(e,
|
|
1308
|
+
if (Ge.has(r) && r in e) {
|
|
1309
|
+
const s = i ?? (r === "value" ? "" : !1);
|
|
1310
|
+
Object.is(Reflect.get(e, r), s) || Reflect.set(e, r, s), i == null && e.removeAttribute(A(t));
|
|
1162
1311
|
return;
|
|
1163
1312
|
}
|
|
1164
|
-
|
|
1313
|
+
U(e, A(t), i);
|
|
1165
1314
|
}
|
|
1166
|
-
function
|
|
1167
|
-
const
|
|
1168
|
-
for (const s of /* @__PURE__ */ new Set([...Object.keys(
|
|
1169
|
-
const o =
|
|
1315
|
+
function st(e, t, n) {
|
|
1316
|
+
const i = _(t, "dataset"), r = _(n, "dataset");
|
|
1317
|
+
for (const s of /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(r)])) {
|
|
1318
|
+
const o = r[s];
|
|
1170
1319
|
o == null ? delete e.dataset[s] : e.dataset[s] = String(o);
|
|
1171
1320
|
}
|
|
1172
1321
|
}
|
|
1173
|
-
function
|
|
1322
|
+
function ot(e, t, n) {
|
|
1174
1323
|
if (typeof n == "string") {
|
|
1175
1324
|
e.style.cssText = n;
|
|
1176
1325
|
return;
|
|
1177
1326
|
}
|
|
1178
|
-
const
|
|
1327
|
+
const i = typeof t == "string" ? {} : _(t, "style"), r = _(n, "style");
|
|
1179
1328
|
typeof t == "string" && (e.style.cssText = "");
|
|
1180
|
-
for (const s of /* @__PURE__ */ new Set([...Object.keys(
|
|
1181
|
-
const o =
|
|
1329
|
+
for (const s of /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(r)])) {
|
|
1330
|
+
const o = r[s];
|
|
1182
1331
|
s.startsWith("--") ? o == null ? e.style.removeProperty(s) : e.style.setProperty(s, String(o)) : Reflect.set(e.style, s, o == null ? "" : String(o));
|
|
1183
1332
|
}
|
|
1184
1333
|
}
|
|
@@ -1188,25 +1337,25 @@ function _(e, t) {
|
|
|
1188
1337
|
throw new TypeError(`${t} must be an object or null`);
|
|
1189
1338
|
return e;
|
|
1190
1339
|
}
|
|
1191
|
-
function
|
|
1340
|
+
function U(e, t, n) {
|
|
1192
1341
|
n == null || n === !1 ? e.removeAttribute(t) : n === !0 ? e.setAttribute(t, "") : e.setAttribute(t, String(n));
|
|
1193
1342
|
}
|
|
1194
|
-
function
|
|
1343
|
+
function at(e) {
|
|
1195
1344
|
return e === "readonly" ? "readOnly" : e === "autofocus" ? "autoFocus" : e;
|
|
1196
1345
|
}
|
|
1197
|
-
function
|
|
1198
|
-
return e === "className" ? "class" : e === "htmlFor" ? "for" : e === "minLength" ? "minlength" : e === "maxLength" ? "maxlength" : e === "autoComplete" ? "autocomplete" : e === "inputMode" ? "inputmode" : /^aria[A-Z]/.test(e) || /^data[A-Z]/.test(e) ?
|
|
1346
|
+
function A(e) {
|
|
1347
|
+
return e === "className" ? "class" : e === "htmlFor" ? "for" : e === "minLength" ? "minlength" : e === "maxLength" ? "maxlength" : e === "autoComplete" ? "autocomplete" : e === "inputMode" ? "inputmode" : /^aria[A-Z]/.test(e) || /^data[A-Z]/.test(e) ? ne(e) : e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
|
|
1199
1348
|
}
|
|
1200
|
-
function
|
|
1349
|
+
function ne(e) {
|
|
1201
1350
|
return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
|
|
1202
1351
|
}
|
|
1203
|
-
function
|
|
1352
|
+
function B(e, t) {
|
|
1204
1353
|
e != null && (typeof e == "function" ? e(t) : e.current = t);
|
|
1205
1354
|
}
|
|
1206
|
-
function
|
|
1355
|
+
function w(e, t) {
|
|
1207
1356
|
if (e.kind === "emitter") {
|
|
1208
|
-
if (e.unsubscribe(),
|
|
1209
|
-
for (const n of
|
|
1357
|
+
if (e.unsubscribe(), w(e.child, !1), t)
|
|
1358
|
+
for (const n of S(e)) n.remove();
|
|
1210
1359
|
return;
|
|
1211
1360
|
}
|
|
1212
1361
|
if (e.kind === "component") {
|
|
@@ -1216,147 +1365,147 @@ function g(e, t) {
|
|
|
1216
1365
|
}
|
|
1217
1366
|
if (e.kind === "function") {
|
|
1218
1367
|
for (const n of e.liveProps.values()) n.unsubscribe();
|
|
1219
|
-
e.liveProps.clear(),
|
|
1368
|
+
e.liveProps.clear(), e.diagnosticSubject && u.dispose(e.diagnosticSubject), w(e.child, t);
|
|
1220
1369
|
return;
|
|
1221
1370
|
}
|
|
1222
1371
|
if (e.kind === "element") {
|
|
1223
|
-
|
|
1224
|
-
for (const [n,
|
|
1225
|
-
e.node.removeEventListener(n.slice(2).toLowerCase(),
|
|
1372
|
+
B(e.ref, null);
|
|
1373
|
+
for (const [n, i] of e.listeners)
|
|
1374
|
+
e.node.removeEventListener(n.slice(2).toLowerCase(), i);
|
|
1226
1375
|
e.listeners.clear();
|
|
1227
1376
|
for (const n of e.liveProps.values()) n.unsubscribe();
|
|
1228
1377
|
e.liveProps.clear();
|
|
1229
1378
|
for (const n of e.nativeBindings.values())
|
|
1230
1379
|
n.unsubscribe(), e.node.removeEventListener(n.eventName, n.listener);
|
|
1231
1380
|
e.nativeBindings.clear();
|
|
1232
|
-
for (const n of e.children)
|
|
1381
|
+
for (const n of e.children) w(n, !1);
|
|
1233
1382
|
t && e.node.remove();
|
|
1234
1383
|
return;
|
|
1235
1384
|
}
|
|
1236
1385
|
if (e.kind === "fragment") {
|
|
1237
|
-
for (const n of e.children)
|
|
1386
|
+
for (const n of e.children) w(n, !1);
|
|
1238
1387
|
if (t)
|
|
1239
|
-
for (const n of
|
|
1388
|
+
for (const n of S(e)) n.remove();
|
|
1240
1389
|
return;
|
|
1241
1390
|
}
|
|
1242
1391
|
t && e.node.remove();
|
|
1243
1392
|
}
|
|
1244
|
-
function
|
|
1393
|
+
function Y(e, t, n = null) {
|
|
1245
1394
|
if (t != null)
|
|
1246
|
-
for (const
|
|
1395
|
+
for (const i of S(t)) e.insertBefore(i, n);
|
|
1247
1396
|
}
|
|
1248
|
-
function
|
|
1397
|
+
function S(e) {
|
|
1249
1398
|
if (e == null) return [];
|
|
1250
1399
|
if (e.kind === "text" || e.kind === "element") return [e.node];
|
|
1251
|
-
if (e.kind === "component") return
|
|
1252
|
-
if (e.kind === "function") return
|
|
1400
|
+
if (e.kind === "component") return S(e.instance._rendered);
|
|
1401
|
+
if (e.kind === "function") return S(e.child);
|
|
1253
1402
|
const t = [];
|
|
1254
1403
|
let n = e.start;
|
|
1255
1404
|
for (; n && (t.push(n), n !== e.end); )
|
|
1256
1405
|
n = n.nextSibling;
|
|
1257
1406
|
return t;
|
|
1258
1407
|
}
|
|
1259
|
-
function
|
|
1260
|
-
return
|
|
1408
|
+
function ve(e) {
|
|
1409
|
+
return S(e)[0] ?? null;
|
|
1261
1410
|
}
|
|
1262
|
-
function
|
|
1263
|
-
return e instanceof
|
|
1411
|
+
function R(e) {
|
|
1412
|
+
return e instanceof b ? Ee(e.props) : g(e) ? e.key : null;
|
|
1264
1413
|
}
|
|
1265
|
-
function
|
|
1414
|
+
function Ee(e) {
|
|
1266
1415
|
const t = e.key;
|
|
1267
1416
|
return typeof t == "string" || typeof t == "number" ? t : null;
|
|
1268
1417
|
}
|
|
1269
|
-
function
|
|
1270
|
-
return e.kind === "text" ? typeof t == "string" || typeof t == "number" : e.kind === "emitter" ?
|
|
1418
|
+
function Ce(e, t) {
|
|
1419
|
+
return e.kind === "text" ? typeof t == "string" || typeof t == "number" : e.kind === "emitter" ? I(t) && e.source === t : e.kind === "component" ? t instanceof b ? e.instance === t : g(t) && Re(t.type) && e.type === t.type && e.key === R(t) : e.kind === "function" ? g(t) && e.type === t.type && e.key === R(t) : e.kind === "fragment" ? g(t) && t.type === $ && e.key === R(t) : g(t) && typeof t.type == "string" && e.type === t.type && e.key === R(t);
|
|
1271
1420
|
}
|
|
1272
|
-
function
|
|
1421
|
+
function g(e) {
|
|
1273
1422
|
return e != null && typeof e == "object" && Object.hasOwn(e, "type");
|
|
1274
1423
|
}
|
|
1275
|
-
function
|
|
1276
|
-
return typeof e == "function" && (e ===
|
|
1424
|
+
function Re(e) {
|
|
1425
|
+
return typeof e == "function" && (e === b || e.prototype instanceof b);
|
|
1277
1426
|
}
|
|
1278
|
-
function
|
|
1427
|
+
function lt(e) {
|
|
1279
1428
|
return /^on[A-Z]/.test(e);
|
|
1280
1429
|
}
|
|
1281
|
-
function
|
|
1430
|
+
function ct(e) {
|
|
1282
1431
|
return e === "bind:value" || e === "bind:checked";
|
|
1283
1432
|
}
|
|
1284
|
-
function
|
|
1285
|
-
return e != null && typeof e == "object" &&
|
|
1433
|
+
function E(e) {
|
|
1434
|
+
return e != null && typeof e == "object" && de.has(e);
|
|
1286
1435
|
}
|
|
1287
|
-
function
|
|
1436
|
+
function I(e) {
|
|
1288
1437
|
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";
|
|
1289
1438
|
}
|
|
1290
|
-
function
|
|
1291
|
-
if (!
|
|
1439
|
+
function Z(e, t) {
|
|
1440
|
+
if (!I(e)) throw new TypeError(`${t} requires a readable emitter`);
|
|
1292
1441
|
}
|
|
1293
|
-
function
|
|
1294
|
-
if (
|
|
1442
|
+
function ut(e, t) {
|
|
1443
|
+
if (Z(e, t), typeof Reflect.get(e, "set") != "function")
|
|
1295
1444
|
throw new TypeError(`${t} requires a writable emitter`);
|
|
1296
1445
|
}
|
|
1297
|
-
function
|
|
1446
|
+
function ft(e, t) {
|
|
1298
1447
|
const n = e.localName;
|
|
1299
1448
|
if (!(t === "checked" ? n === "input" : n === "input" || n === "textarea" || n === "select")) throw new TypeError(`bind:${t} is not supported on ${n}`);
|
|
1300
1449
|
}
|
|
1301
|
-
function
|
|
1450
|
+
function pt(e, t) {
|
|
1302
1451
|
return t === "value" && e.localName !== "select" ? "input" : "change";
|
|
1303
1452
|
}
|
|
1304
|
-
function
|
|
1453
|
+
function dt(e) {
|
|
1305
1454
|
if (e == null || typeof e != "object" && typeof e != "function" || typeof Reflect.get(e, "insertBefore") != "function")
|
|
1306
1455
|
throw new TypeError("Component parent must be a DOM ParentNode");
|
|
1307
1456
|
}
|
|
1308
|
-
function
|
|
1457
|
+
function ie(e) {
|
|
1309
1458
|
try {
|
|
1310
1459
|
return String(e);
|
|
1311
1460
|
} catch {
|
|
1312
1461
|
return Object.prototype.toString.call(e);
|
|
1313
1462
|
}
|
|
1314
1463
|
}
|
|
1315
|
-
function
|
|
1464
|
+
function ht(e) {
|
|
1316
1465
|
const t = [];
|
|
1317
1466
|
let n = e;
|
|
1318
|
-
for (; n != null && typeof n == "function" && (t.unshift(n), n !==
|
|
1467
|
+
for (; n != null && typeof n == "function" && (t.unshift(n), n !== b); )
|
|
1319
1468
|
n = Object.getPrototypeOf(n);
|
|
1320
1469
|
return t;
|
|
1321
1470
|
}
|
|
1322
|
-
function
|
|
1471
|
+
function mt(...e) {
|
|
1323
1472
|
return [...new Set(e.flatMap((t) => typeof t == "string" ? t.split(/\s+/) : []).filter(Boolean))].join(" ");
|
|
1324
1473
|
}
|
|
1325
|
-
function
|
|
1474
|
+
function F(e) {
|
|
1326
1475
|
if (e.island === !0) return !0;
|
|
1327
1476
|
const t = e.className ?? e.class;
|
|
1328
1477
|
return typeof t == "string" && t.split(/\s+/).includes("island");
|
|
1329
1478
|
}
|
|
1330
|
-
function
|
|
1331
|
-
const
|
|
1332
|
-
return n !== void 0 && (
|
|
1479
|
+
function Le(e, t, n) {
|
|
1480
|
+
const i = t == null ? {} : { ...t };
|
|
1481
|
+
return n !== void 0 && (i.key = n), k(e, i);
|
|
1333
1482
|
}
|
|
1334
|
-
const
|
|
1335
|
-
function
|
|
1336
|
-
if (!(e instanceof
|
|
1483
|
+
const Et = Le, Ct = Le;
|
|
1484
|
+
function Rt(e) {
|
|
1485
|
+
if (!(e instanceof b))
|
|
1337
1486
|
throw new TypeError("createPrebuiltElement requires a Component instance");
|
|
1338
1487
|
return e;
|
|
1339
1488
|
}
|
|
1340
1489
|
export {
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1490
|
+
b as C,
|
|
1491
|
+
$ as F,
|
|
1492
|
+
ue as S,
|
|
1493
|
+
Le as a,
|
|
1494
|
+
Et as b,
|
|
1495
|
+
Je as c,
|
|
1496
|
+
V as d,
|
|
1497
|
+
re as e,
|
|
1498
|
+
St as f,
|
|
1499
|
+
xe as g,
|
|
1500
|
+
k as h,
|
|
1501
|
+
g as i,
|
|
1502
|
+
Ct as j,
|
|
1503
|
+
ze as k,
|
|
1504
|
+
J as l,
|
|
1505
|
+
yt as m,
|
|
1506
|
+
vt as n,
|
|
1507
|
+
Rt as o,
|
|
1508
|
+
wt as p,
|
|
1509
|
+
_e as s
|
|
1361
1510
|
};
|
|
1362
|
-
//# sourceMappingURL=jsx-
|
|
1511
|
+
//# sourceMappingURL=jsx-runtime-BD_q3rPg.js.map
|