@sylwellsoftware/fray 0.7.0 → 1.0.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.
Files changed (110) hide show
  1. package/README.md +264 -204
  2. package/colors/README.md +26 -23
  3. package/colors/gray/colors.css +1 -42
  4. package/colors/green/colors.css +1 -42
  5. package/colors/iceblue/colors.css +5 -43
  6. package/colors/ocean/colors.css +1 -42
  7. package/colors/orange/colors.css +1 -42
  8. package/colors/purple/colors.css +1 -42
  9. package/colors/red/colors.css +1 -42
  10. package/colors/yellow/colors.css +1 -42
  11. package/dist/Components/Placeholder.d.ts +1 -2
  12. package/dist/Components/Placeholder.d.ts.map +1 -1
  13. package/dist/Components/component.d.ts +15 -7
  14. package/dist/Components/component.d.ts.map +1 -1
  15. package/dist/Components/data/descriptionList.d.ts +3 -1
  16. package/dist/Components/data/descriptionList.d.ts.map +1 -1
  17. package/dist/Components/data/listview/listview.d.ts +1 -2
  18. package/dist/Components/data/listview/listview.d.ts.map +1 -1
  19. package/dist/Components/data/table/DataTable.d.ts +1 -1
  20. package/dist/Components/data/table/DataTable.d.ts.map +1 -1
  21. package/dist/Components/data/table/FilterPanel.d.ts +2 -4
  22. package/dist/Components/data/table/FilterPanel.d.ts.map +1 -1
  23. package/dist/Components/data/table/TableHeader.d.ts +2 -0
  24. package/dist/Components/data/table/TableHeader.d.ts.map +1 -1
  25. package/dist/Components/data/table/TableHeaderCell.d.ts +1 -1
  26. package/dist/Components/data/table/TableHeaderCell.d.ts.map +1 -1
  27. package/dist/Components/data/treeview/treeitem.d.ts +1 -0
  28. package/dist/Components/data/treeview/treeitem.d.ts.map +1 -1
  29. package/dist/Components/data/treeview/treeview.d.ts +2 -1
  30. package/dist/Components/data/treeview/treeview.d.ts.map +1 -1
  31. package/dist/Components/dialog/dialog.d.ts +6 -2
  32. package/dist/Components/dialog/dialog.d.ts.map +1 -1
  33. package/dist/Components/layout/header.d.ts +19 -0
  34. package/dist/Components/layout/header.d.ts.map +1 -0
  35. package/dist/Components/layout/panel.d.ts +7 -3
  36. package/dist/Components/layout/panel.d.ts.map +1 -1
  37. package/dist/Components/layout/sidebar.d.ts +4 -0
  38. package/dist/Components/layout/sidebar.d.ts.map +1 -1
  39. package/dist/Components/layout/splitView.d.ts +1 -1
  40. package/dist/Components/layout/splitView.d.ts.map +1 -1
  41. package/dist/Components/layout/tabpanel/tab.d.ts +1 -0
  42. package/dist/Components/layout/tabpanel/tab.d.ts.map +1 -1
  43. package/dist/Components/layout/tabpanel/tabline.d.ts +1 -2
  44. package/dist/Components/layout/tabpanel/tabline.d.ts.map +1 -1
  45. package/dist/Components/layout/tabpanel/tabpanel.d.ts +1 -1
  46. package/dist/Components/layout/tabpanel/tabpanel.d.ts.map +1 -1
  47. package/dist/Components/lineinputs/CheckableControl.d.ts +7 -0
  48. package/dist/Components/lineinputs/CheckableControl.d.ts.map +1 -0
  49. package/dist/Components/lineinputs/LabeledInputControl.d.ts +7 -0
  50. package/dist/Components/lineinputs/LabeledInputControl.d.ts.map +1 -0
  51. package/dist/Components/lineinputs/SelectControl.d.ts +7 -0
  52. package/dist/Components/lineinputs/SelectControl.d.ts.map +1 -0
  53. package/dist/Components/lineinputs/checkbox/Checkbox.d.ts +11 -5
  54. package/dist/Components/lineinputs/checkbox/Checkbox.d.ts.map +1 -1
  55. package/dist/Components/lineinputs/checkbox/QuadCheckbox.d.ts +1 -2
  56. package/dist/Components/lineinputs/checkbox/QuadCheckbox.d.ts.map +1 -1
  57. package/dist/Components/lineinputs/checkbox/TriCheckbox.d.ts +1 -2
  58. package/dist/Components/lineinputs/checkbox/TriCheckbox.d.ts.map +1 -1
  59. package/dist/Components/lineinputs/dropdown.d.ts +7 -6
  60. package/dist/Components/lineinputs/dropdown.d.ts.map +1 -1
  61. package/dist/Components/lineinputs/label.d.ts +14 -0
  62. package/dist/Components/lineinputs/label.d.ts.map +1 -0
  63. package/dist/Components/lineinputs/radio.d.ts +20 -7
  64. package/dist/Components/lineinputs/radio.d.ts.map +1 -1
  65. package/dist/Components/lineinputs/textbox.d.ts +7 -6
  66. package/dist/Components/lineinputs/textbox.d.ts.map +1 -1
  67. package/dist/Components/lineinputs/toggle.d.ts +10 -3
  68. package/dist/Components/lineinputs/toggle.d.ts.map +1 -1
  69. package/dist/Components/menu/button.d.ts +6 -3
  70. package/dist/Components/menu/button.d.ts.map +1 -1
  71. package/dist/Components/menu/toolbar.d.ts +1 -1
  72. package/dist/Components/menu/toolbar.d.ts.map +1 -1
  73. package/dist/Components/status/progressBar.d.ts +1 -1
  74. package/dist/Components/status/progressBar.d.ts.map +1 -1
  75. package/dist/Components/theme/stylesheetPicker.d.ts +6 -7
  76. package/dist/Components/theme/stylesheetPicker.d.ts.map +1 -1
  77. package/dist/index.d.ts +3 -1
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +2539 -1839
  80. package/dist/index.js.map +1 -1
  81. package/dist/{jsx-dev-runtime-Kf1Dhu-y.js → jsx-dev-runtime-CRDpvXOH.js} +481 -472
  82. package/dist/jsx-dev-runtime-CRDpvXOH.js.map +1 -0
  83. package/dist/jsx-dev-runtime.js +1 -1
  84. package/dist/jsx-runtime.js +1 -1
  85. package/dist/routing/RouteLink.d.ts +1 -0
  86. package/dist/routing/RouteLink.d.ts.map +1 -1
  87. package/dist/routing/RouteQuery.d.ts +1 -0
  88. package/dist/routing/RouteQuery.d.ts.map +1 -1
  89. package/dist/routing/RouteScope.d.ts +1 -0
  90. package/dist/routing/RouteScope.d.ts.map +1 -1
  91. package/dist/routing/RouteValue.d.ts +1 -0
  92. package/dist/routing/RouteValue.d.ts.map +1 -1
  93. package/dist/runtime.d.ts +5 -13
  94. package/dist/runtime.d.ts.map +1 -1
  95. package/dist/styling/styleRegistry.d.ts +0 -4
  96. package/dist/styling/styleRegistry.d.ts.map +1 -1
  97. package/dist/styling/theme.d.ts +14 -2
  98. package/dist/styling/theme.d.ts.map +1 -1
  99. package/package.json +5 -6
  100. package/styles/structural.css +888 -398
  101. package/themes/README.md +30 -72
  102. package/themes/base.css +311 -0
  103. package/themes/java/theme.css +14 -423
  104. package/themes/minimal/theme.css +3 -419
  105. package/themes/shiny/theme.css +127 -508
  106. package/dist/jsx-dev-runtime-Kf1Dhu-y.js.map +0 -1
  107. package/dist/styling/baseStyleDefinitions.d.ts +0 -75
  108. package/dist/styling/baseStyleDefinitions.d.ts.map +0 -1
  109. package/themes/dark.css +0 -98
  110. package/themes/light.css +0 -98
@@ -1,223 +1,155 @@
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
- const D = {
5
- after: {
6
- content: '""',
7
- display: "block",
8
- position: "absolute",
9
- top: "0",
10
- left: "0",
11
- width: "100%",
12
- height: "100%",
13
- "pointer-events": "none"
14
- },
15
- inputline: {
16
- display: "flex",
17
- "flex-flow": "row nowrap",
18
- position: "relative",
19
- "min-height": "var(--control-min-height, 2rem)",
20
- "box-sizing": "border-box"
21
- },
22
- input: {
23
- "pointer-events": "all",
24
- width: "var(--input-width, 15rem)",
25
- "box-sizing": "border-box",
26
- "white-space": "nowrap"
27
- },
28
- inputlike: {
29
- "pointer-events": "all",
30
- "box-sizing": "border-box",
31
- "white-space": "nowrap"
32
- },
33
- labeledinput: {
34
- display: "flex",
35
- "flex-flow": "row nowrap",
36
- "align-items": "center",
37
- gap: ".5em"
38
- },
39
- working: {
40
- display: "inline",
41
- position: "absolute",
42
- "z-index": "1",
43
- margin: "auto",
44
- animation: "fray-placeholder-progress 0.8s linear infinite",
45
- "background-repeat": "repeat",
46
- "background-size": "2rem 2rem",
47
- "background-image": "var(--working-background-image)",
48
- border: "0 solid transparent",
49
- "border-radius": "inherit",
50
- "box-sizing": "border-box"
51
- },
52
- uiline: {
53
- "box-sizing": "border-box",
54
- "min-height": "var(--control-min-height, 2rem)",
55
- cursor: "pointer",
56
- "user-select": "none"
57
- },
58
- noselect: {
59
- "user-select": "var(--noselect-user-select)",
60
- cursor: "var(--noselect-cursor)"
61
- },
62
- button: {
63
- "box-sizing": "border-box",
64
- cursor: "default",
65
- "user-select": "none",
66
- variants: {
67
- ":disabled": {
68
- cursor: "not-allowed",
69
- "pointer-events": "none"
70
- }
71
- }
72
- }
73
- }, K = "data-fray-structural-styles";
74
- let me = 1;
75
- class Q {
76
- constructor(t = `runtime-${me++}`) {
77
- a(this, "id");
78
- a(this, "cssFragments", /* @__PURE__ */ new Set());
79
- a(this, "baseStyleMap", /* @__PURE__ */ new Map());
1
+ var ye = Object.defineProperty;
2
+ var be = (e, t, n) => t in e ? ye(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var l = (e, t, n) => be(e, typeof t != "symbol" ? t + "" : t, n);
4
+ const D = "data-fray-structural-styles";
5
+ let ge = 1;
6
+ class G {
7
+ constructor(t = `runtime-${ge++}`) {
8
+ l(this, "id");
9
+ l(this, "cssFragments", /* @__PURE__ */ new Map());
80
10
  if (typeof t != "string") throw new TypeError("StyleRegistry id must be a string");
81
11
  this.id = t;
82
12
  }
83
13
  registerCSS(t) {
84
14
  if (typeof t != "string") throw new TypeError("Component CSS must be a string");
85
- return t.trim().length > 0 && this.cssFragments.add(t.trim()), this;
86
- }
87
- registerBaseStyle(t, n) {
88
- if (typeof t != "string" || t.trim().length === 0)
89
- throw new TypeError("Base style selector must be a non-empty string");
90
- const r = typeof n == "string" ? [n] : n;
91
- if (!Array.isArray(r))
92
- throw new TypeError("Base style names must be a string or array");
93
- for (const i of r) {
94
- if (!Object.hasOwn(D, i))
95
- throw new Error(`Unknown Fray base style: ${String(i)}`);
96
- const s = i, o = this.baseStyleMap.get(s) ?? /* @__PURE__ */ new Set();
97
- o.add(t.trim()), this.baseStyleMap.set(s, o);
98
- }
99
- return this;
15
+ const n = t.trim();
16
+ return n.length > 0 && this.cssFragments.set(`raw:${n}`, { kind: "raw", css: n }), this;
100
17
  }
101
- generateRootCSS() {
102
- return `*, *::before, *::after {
103
- box-sizing: border-box;
104
- }
105
-
106
- @media (prefers-reduced-motion: reduce) {
107
- *, *::before, *::after {
108
- scroll-behavior: auto !important;
109
- animation-duration: 0.01ms !important;
110
- animation-iteration-count: 1 !important;
111
- transition-duration: 0.01ms !important;
112
- }
113
- }
114
-
115
- @media (forced-colors: active) {
116
- :focus-visible {
117
- outline: 2px solid Highlight !important;
118
- outline-offset: 2px !important;
119
- }
120
- }`;
121
- }
122
- generateBaseStyleCSS() {
123
- let t = "";
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))
128
- t += U(
129
- `${n}${c}`,
130
- o.map((u) => we(u, c)),
131
- l
132
- );
133
- }
134
- return t.trim();
18
+ /** @internal Collect a host-relative component template without resolving it yet. */
19
+ registerHostCSS(t, n) {
20
+ if (typeof t != "string") throw new TypeError("Component CSS must be a string");
21
+ if (typeof n != "string" || n.trim().length === 0)
22
+ throw new TypeError("Component CSS host must be a non-empty selector");
23
+ const r = t.trim();
24
+ if (r.length === 0) return this;
25
+ if (!r.includes("&")) return this.registerCSS(r);
26
+ const i = `host:${r}`, s = this.cssFragments.get(i);
27
+ return s == null ? this.cssFragments.set(i, {
28
+ kind: "host",
29
+ css: r,
30
+ hosts: /* @__PURE__ */ new Set([n.trim()])
31
+ }) : s.kind === "host" && s.hosts.add(n.trim()), this;
135
32
  }
136
33
  generateCSS() {
137
- return [
138
- this.generateRootCSS(),
139
- this.generateBaseStyleCSS(),
140
- [...this.cssFragments].join(`
141
-
142
- `)
143
- ].filter(Boolean).join(`
34
+ return [...this.cssFragments.values()].map((t) => t.kind === "raw" ? t.css : J(t.css, [...t.hosts])).join(`
144
35
 
145
36
  `);
146
37
  }
147
38
  injectAll(t = globalThis.document) {
148
39
  if ((t == null ? void 0 : t.head) == null)
149
40
  throw new TypeError("StyleRegistry.injectAll requires a document with a head");
150
- const n = `style[${K}="${Se(this.id)}"]`;
41
+ const n = `style[${D}="${ve(this.id)}"]`;
151
42
  let r = t.head.querySelector(n);
152
- r == null && (r = t.createElement("style"), r.setAttribute(K, this.id), t.head.prepend(r));
43
+ r == null && (r = t.createElement("style"), r.setAttribute(D, this.id), t.head.prepend(r));
153
44
  const i = this.generateCSS();
154
45
  return r.textContent !== i && (r.textContent = i), r;
155
46
  }
156
47
  reset() {
157
- this.cssFragments.clear(), this.baseStyleMap.clear();
158
- }
159
- }
160
- function ye() {
161
- return new Q();
162
- }
163
- const be = new Q("");
164
- function ge(e) {
165
- const t = {};
166
- let n = {};
167
- for (const [r, i] of Object.entries(e))
168
- if (r === "variants") {
169
- if (typeof i != "object")
170
- throw new TypeError("Base style variants must be declaration maps");
171
- n = i;
172
- } else if (typeof i == "string")
173
- t[r] = i;
174
- else
175
- throw new TypeError(`Base style property ${r} must be a string`);
176
- return { properties: t, variants: n };
177
- }
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(`
181
- `);
182
- return `/* ${e} */
183
- ${t.join(`,
184
- `)} {
185
- ${r}
186
- }
187
-
188
- `;
48
+ this.cssFragments.clear();
49
+ }
189
50
  }
190
- function we(e, t) {
191
- const n = e.indexOf("::");
192
- return n < 0 ? `${e}${t}` : `${e.slice(0, n)}${t}${e.slice(n)}`;
51
+ function we() {
52
+ return new G();
193
53
  }
194
- function Se(e) {
54
+ const Se = new G("");
55
+ function ve(e) {
195
56
  return e.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
196
57
  }
197
- const X = /* @__PURE__ */ new WeakSet(), ee = /* @__PURE__ */ new WeakSet();
198
- function Ue(e) {
58
+ function J(e, t) {
59
+ let n = "", r = 0;
60
+ for (; r < e.length; ) {
61
+ const i = Re(e, r);
62
+ if (i < 0) return n + e.slice(r);
63
+ const s = Te(e, i);
64
+ if (s < 0) return n + e.slice(r);
65
+ const o = e.slice(r, i), a = e.slice(i + 1, s), c = o.trim();
66
+ n += c.startsWith("@") ? `${o}{${J(a, t)}}` : `${Ee(o, t)}{${a}}`, r = s + 1;
67
+ }
68
+ return n;
69
+ }
70
+ function Ee(e, t) {
71
+ var o, a, c;
72
+ if (t.length === 1 || !e.includes("&"))
73
+ return t.length === 1 ? e.replaceAll("&", t[0]) : e;
74
+ const n = ((o = e.match(/^\s*/)) == null ? void 0 : o[0]) ?? "", r = ((a = e.match(/\s*$/)) == null ? void 0 : a[0]) ?? "", i = Ce(e.trim()), s = ((c = n.match(/(?:^|\n)([ \t]*)$/)) == null ? void 0 : c[1]) ?? "";
75
+ return n + i.flatMap((u) => u.includes("&") ? t.map((p) => u.replaceAll("&", p)) : [u]).join(`,
76
+ ${s}`) + r;
77
+ }
78
+ function Ce(e) {
79
+ const t = [];
80
+ let n = 0, r = 0, i = 0, s = null;
81
+ for (let o = 0; o < e.length; o += 1) {
82
+ const a = e[o];
83
+ if (s != null) {
84
+ a === "\\" ? o += 1 : a === s && (s = null);
85
+ continue;
86
+ }
87
+ a === '"' || a === "'" ? s = a : a === "(" ? r += 1 : a === ")" ? r -= 1 : a === "[" ? i += 1 : a === "]" ? i -= 1 : a === "," && r === 0 && i === 0 && (t.push(e.slice(n, o).trim()), n = o + 1);
88
+ }
89
+ return t.push(e.slice(n).trim()), t.filter(Boolean);
90
+ }
91
+ function Re(e, t) {
92
+ for (let n = t; n < e.length; n += 1) {
93
+ const r = e[n];
94
+ if (r === '"' || r === "'")
95
+ n = Q(e, n);
96
+ else if (r === "/" && e[n + 1] === "*")
97
+ n = X(e, n);
98
+ else if (r === "{")
99
+ return n;
100
+ }
101
+ return -1;
102
+ }
103
+ function Te(e, t) {
104
+ let n = 1;
105
+ for (let r = t + 1; r < e.length; r += 1) {
106
+ const i = e[r];
107
+ if (i === '"' || i === "'")
108
+ r = Q(e, r);
109
+ else if (i === "/" && e[r + 1] === "*")
110
+ r = X(e, r);
111
+ else if (i === "{")
112
+ n += 1;
113
+ else if (i === "}" && --n === 0)
114
+ return r;
115
+ }
116
+ return -1;
117
+ }
118
+ function Q(e, t) {
119
+ const n = e[t];
120
+ for (let r = t + 1; r < e.length; r += 1)
121
+ if (e[r] === "\\") r += 1;
122
+ else if (e[r] === n) return r;
123
+ return e.length;
124
+ }
125
+ function X(e, t) {
126
+ const n = e.indexOf("*/", t + 2);
127
+ return n < 0 ? e.length : n + 1;
128
+ }
129
+ const ee = /* @__PURE__ */ new WeakSet(), te = /* @__PURE__ */ new WeakSet();
130
+ function et(e) {
199
131
  if (typeof e != "string" || e.trim() === "")
200
132
  throw new TypeError("Service name must be a non-empty string");
201
133
  const t = Object.freeze({ name: e.trim() });
202
- return X.add(t), t;
134
+ return ee.add(t), t;
203
135
  }
204
- function We(e, t) {
205
- if (x(e), typeof t != "function")
136
+ function tt(e, t) {
137
+ if (z(e), typeof t != "function")
206
138
  throw new TypeError(`Service provider "${e.name}" requires a factory function`);
207
139
  const n = Object.freeze({ key: e, create: t });
208
- return ee.add(n), n;
140
+ return te.add(n), n;
209
141
  }
210
- class te {
142
+ class ne {
211
143
  constructor(t = []) {
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);
144
+ l(this, "providers", /* @__PURE__ */ new Map());
145
+ l(this, "instances", /* @__PURE__ */ new Map());
146
+ l(this, "creationOrder", []);
147
+ l(this, "resolving", []);
148
+ l(this, "disposed", !1);
217
149
  if (!Array.isArray(t))
218
150
  throw new TypeError("ServiceScope providers must be an array");
219
151
  for (const n of t) {
220
- if (Re(n), this.providers.has(n.key))
152
+ if (Pe(n), this.providers.has(n.key))
221
153
  throw new Error(`Service "${n.key.name}" is registered more than once`);
222
154
  this.providers.set(n.key, n);
223
155
  }
@@ -226,10 +158,10 @@ class te {
226
158
  return this.disposed;
227
159
  }
228
160
  has(t) {
229
- return this.assertActive(), x(t), this.providers.has(t);
161
+ return this.assertActive(), z(t), this.providers.has(t);
230
162
  }
231
163
  require(t) {
232
- if (this.assertActive(), x(t), this.instances.has(t)) return this.instances.get(t);
164
+ if (this.assertActive(), z(t), this.instances.has(t)) return this.instances.get(t);
233
165
  const n = this.providers.get(t);
234
166
  if (n == null) throw new Error(`Service "${t.name}" is not registered`);
235
167
  const r = this.resolving.indexOf(t);
@@ -252,7 +184,7 @@ class te {
252
184
  for (const n of [...this.creationOrder].reverse()) {
253
185
  const r = this.instances.get(n);
254
186
  try {
255
- const i = Ce(r);
187
+ const i = Oe(r);
256
188
  i != null && i.call(r);
257
189
  } catch (i) {
258
190
  t.push(i);
@@ -266,25 +198,25 @@ class te {
266
198
  if (this.disposed) throw new Error("ServiceScope has been disposed");
267
199
  }
268
200
  }
269
- function ve(e = []) {
270
- return new te(e);
201
+ function je(e = []) {
202
+ return new ne(e);
271
203
  }
272
- function Ee(e) {
273
- return e != null && (typeof e == "object" || typeof e == "function") && X.has(e);
204
+ function Ae(e) {
205
+ return e != null && (typeof e == "object" || typeof e == "function") && ee.has(e);
274
206
  }
275
- function x(e) {
276
- if (!Ee(e)) throw new TypeError("Expected a service key created by defineService()");
207
+ function z(e) {
208
+ if (!Ae(e)) throw new TypeError("Expected a service key created by defineService()");
277
209
  }
278
- function Re(e) {
279
- if (e == null || typeof e != "object" && typeof e != "function" || !ee.has(e))
210
+ function Pe(e) {
211
+ if (e == null || typeof e != "object" && typeof e != "function" || !te.has(e))
280
212
  throw new TypeError("Expected a service provider created by provideService()");
281
213
  }
282
- function Ce(e) {
214
+ function Oe(e) {
283
215
  if (e == null || typeof e != "object" && typeof e != "function") return null;
284
216
  const t = Reflect.get(e, "dispose");
285
217
  return typeof t == "function" ? t : null;
286
218
  }
287
- const je = /* @__PURE__ */ new Set([
219
+ const _e = /* @__PURE__ */ new Set([
288
220
  "annotation-xml",
289
221
  "color-profile",
290
222
  "font-face",
@@ -294,43 +226,34 @@ const je = /* @__PURE__ */ new Set([
294
226
  "font-face-name",
295
227
  "missing-glyph"
296
228
  ]);
297
- class L {
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());
229
+ class B {
230
+ constructor(t = {}, n = we()) {
231
+ l(this, "styleRegistry");
232
+ l(this, "services");
233
+ l(this, "router");
234
+ l(this, "routedRoots", /* @__PURE__ */ new WeakSet());
305
235
  if (t == null || typeof t != "object" || Array.isArray(t))
306
236
  throw new TypeError("FrayRuntime options must be an object");
307
- const r = t.elementNames ?? {};
308
- if (r == null || typeof r != "object" || Array.isArray(r))
309
- throw new TypeError("Fray elementNames must be an object");
310
- const i = r.prefix === void 0 ? "fray" : r.prefix;
311
- i !== null && P(i, "Fray element prefix");
312
- const s = r.overrides ?? {};
313
- if (s == null || typeof s != "object" || Array.isArray(s))
314
- throw new TypeError("Fray element-name overrides must be an object");
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))
237
+ if (Object.hasOwn(t, "elementNames"))
238
+ throw new TypeError("FrayRuntime no longer supports configurable element names");
239
+ if (this.styleRegistry = n, this.services = t.services ?? je(), !(this.services instanceof ne))
318
240
  throw new TypeError("Fray services must be a ServiceScope");
319
241
  if (this.router = t.router ?? null, this.router != null && (typeof this.router != "object" || typeof this.router.openScope != "function" || typeof this.router.completeScope != "function"))
320
242
  throw new TypeError("Fray router must be a BrowserRouter");
321
243
  }
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}`);
325
- return Z(i), i;
244
+ /** Resolve a fixed one-hyphen public host name for a built-in component. */
245
+ resolveElementName(t) {
246
+ re(t, "Fray component host name");
247
+ const n = `fray-${t.replaceAll("-", "")}`;
248
+ return Fe(n), n;
326
249
  }
327
- resolveHostSelector(t, n, r = null) {
250
+ resolveHostSelector(t, n) {
328
251
  if (typeof t != "string") throw new TypeError("Host selector must be a string");
329
- return t.replaceAll("&", this.resolveElementName(n, r));
252
+ return t.replaceAll("&", this.resolveElementName(n));
330
253
  }
331
- resolveHostCSS(t, n, r = null) {
254
+ resolveHostCSS(t, n) {
332
255
  if (typeof t != "string") throw new TypeError("Host CSS must be a string");
333
- return t.replaceAll("&", this.resolveElementName(n, r));
256
+ return t.replaceAll("&", this.resolveElementName(n));
334
257
  }
335
258
  create(t, ...n) {
336
259
  const r = new t(...n);
@@ -356,19 +279,19 @@ class L {
356
279
  return this.styleRegistry.injectAll(t);
357
280
  }
358
281
  }
359
- function Ze(e = {}) {
360
- return new L(e);
282
+ function nt(e = {}) {
283
+ return new B(e);
361
284
  }
362
- const W = new L({}, be);
363
- function P(e, t) {
285
+ const K = new B({}, Se);
286
+ function re(e, t) {
364
287
  if (typeof e != "string" || !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e))
365
288
  throw new TypeError(`${t} must be a lowercase kebab-case name`);
366
289
  }
367
- function Z(e) {
368
- if (P(e, "Fray element name"), !e.includes("-") || je.has(e))
290
+ function Fe(e) {
291
+ if (re(e, "Fray element name"), !e.includes("-") || _e.has(e))
369
292
  throw new TypeError(`Fray element name must be a non-reserved name containing a hyphen: ${e}`);
370
293
  }
371
- const A = Symbol.for("@sylwellsoftware/fray.Fragment"), ne = /* @__PURE__ */ new WeakSet(), Te = /* @__PURE__ */ new Set([
294
+ const P = Symbol.for("@sylwellsoftware/fray.Fragment"), ie = /* @__PURE__ */ new WeakSet(), Ne = /* @__PURE__ */ new Set([
372
295
  "allowFullScreen",
373
296
  "async",
374
297
  "autoFocus",
@@ -392,7 +315,7 @@ const A = Symbol.for("@sylwellsoftware/fray.Fragment"), ne = /* @__PURE__ */ new
392
315
  "required",
393
316
  "reversed",
394
317
  "selected"
395
- ]), Pe = /* @__PURE__ */ new Set([
318
+ ]), $e = /* @__PURE__ */ new Set([
396
319
  "checked",
397
320
  "defaultChecked",
398
321
  "defaultValue",
@@ -406,11 +329,11 @@ const A = Symbol.for("@sylwellsoftware/fray.Fragment"), ne = /* @__PURE__ */ new
406
329
  "selectedIndex",
407
330
  "tabIndex",
408
331
  "value"
409
- ]);
410
- function Ye(e) {
411
- I(e, "live");
332
+ ]), U = "data-fray";
333
+ function rt(e) {
334
+ H(e, "live");
412
335
  const t = Object.freeze({ emitter: e });
413
- return ne.add(t), t;
336
+ return ie.add(t), t;
414
337
  }
415
338
  function O(e, t = null, ...n) {
416
339
  const r = t ?? {};
@@ -426,36 +349,38 @@ function O(e, t = null, ...n) {
426
349
  key: s,
427
350
  props: {
428
351
  ...o,
429
- children: re([i, n])
352
+ children: se([i, n])
430
353
  }
431
354
  };
432
355
  }
433
- function Ge(e, ...t) {
356
+ function ke(e, ...t) {
434
357
  return e.reduce((n, r, i) => n + r + String(t[i] ?? ""), "");
435
358
  }
436
- const d = class d {
359
+ const m = class m {
437
360
  constructor(t = {}) {
438
- a(this, "props");
439
- a(this, "dom", null);
361
+ l(this, "props");
362
+ l(this, "dom", null);
440
363
  /** @internal */
441
- a(this, "_rendered", null);
364
+ l(this, "_rendered", null);
442
365
  /** @internal */
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);
366
+ l(this, "_childComponents", /* @__PURE__ */ new Set());
367
+ /** @internal Component ancestry used to enforce structural invariants. */
368
+ l(this, "_parentComponent", null);
369
+ l(this, "initialized", !1);
370
+ l(this, "mounted", !1);
371
+ l(this, "destroyed", !1);
372
+ l(this, "updating", !1);
373
+ l(this, "updateRequested", !1);
374
+ l(this, "cleanupFunctions", /* @__PURE__ */ new Set());
375
+ l(this, "watched", /* @__PURE__ */ new Map());
376
+ l(this, "renderReadSubscriptions", /* @__PURE__ */ new Map());
377
+ l(this, "collectingRenderReads", null);
453
378
  /** @internal */
454
- a(this, "_runtime", W);
379
+ l(this, "_runtime", K);
455
380
  /** @internal Route lineage inherited by nested routed components. */
456
- a(this, "_routeContext", null);
381
+ l(this, "_routeContext", null);
457
382
  /** JSX component for this instance's runtime-configured custom host. */
458
- a(this, "Host", ({
383
+ l(this, "Host", ({
459
384
  children: t = [],
460
385
  ...n
461
386
  }) => this.host(n, t));
@@ -465,23 +390,23 @@ const d = class d {
465
390
  }
466
391
  static new(...t) {
467
392
  const n = new this(...t);
468
- if (!(n instanceof d))
393
+ if (!(n instanceof m))
469
394
  throw new TypeError("Component.new() requires a Component constructor");
470
395
  return n.mount();
471
396
  }
472
- static get baseStyles() {
473
- return {};
474
- }
475
- static registerStyles(t = W, n = /* @__PURE__ */ new Set()) {
397
+ static registerStyles(t = K, n = /* @__PURE__ */ new Set()) {
476
398
  if (n.has(this)) return;
477
399
  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));
480
- const s = De(this.baseStyles);
481
- for (const [o, c] of s)
482
- t.styleRegistry.registerBaseStyle(r == null ? o : t.resolveHostSelector(o, r, i), c);
483
- for (const o of this.dependencies ?? [])
484
- o.registerStyles(t, n);
400
+ const r = this.hostName ?? null, i = Je(this);
401
+ for (const s of i)
402
+ Object.hasOwn(s, "css") && s.css && (r == null ? t.styleRegistry.registerCSS(s.css) : t.styleRegistry.registerHostCSS(
403
+ s.css,
404
+ t.resolveElementName(r)
405
+ ));
406
+ for (const s of i)
407
+ if (Object.hasOwn(s, "dependencies"))
408
+ for (const o of s.dependencies ?? [])
409
+ o.registerStyles(t, n);
485
410
  }
486
411
  /** One-time setup hook. Constructors must not subscribe or render. */
487
412
  initialize() {
@@ -491,21 +416,24 @@ const d = class d {
491
416
  }
492
417
  /** Render this component's configured custom host element. */
493
418
  host(t = null, ...n) {
494
- const r = this.constructor, i = r.hostName;
419
+ const i = this.constructor.hostName;
495
420
  if (i == null)
496
421
  throw new Error(`${this.constructor.name} does not declare a custom host name`);
497
- return O(this._runtime.resolveElementName(
498
- i,
499
- r.standaloneHostName
500
- ), {
501
- ...t,
422
+ const {
423
+ class: s,
424
+ className: o,
425
+ ...a
426
+ } = t ?? {}, c = o ?? s, u = this.props.island === !0 ? Qe(c, "island") : c;
427
+ return O(this._runtime.resolveElementName(i), {
428
+ ...a,
429
+ ...u == null ? {} : { className: u },
502
430
  "data-fray-component": i
503
431
  }, ...n);
504
432
  }
505
433
  /** @internal Assign an immutable application runtime before initialization or mounting. */
506
434
  _setRuntime(t) {
507
435
  var n;
508
- if (!(t instanceof L))
436
+ if (!(t instanceof B))
509
437
  throw new TypeError("Component runtime must be a FrayRuntime");
510
438
  if (t === this._runtime) return this;
511
439
  if (this.initialized || this.mounted || this._rendered != null)
@@ -522,10 +450,17 @@ const d = class d {
522
450
  _routeContextForChildren() {
523
451
  return this._routeContext;
524
452
  }
453
+ /** @internal Assign the renderer-owned component ancestry. */
454
+ _setParentComponent(t) {
455
+ if (this._parentComponent != null && this._parentComponent !== t)
456
+ throw new Error("A component instance cannot move between component owners");
457
+ return this._parentComponent = t, this.validateIslandAncestry(this.props), this;
458
+ }
525
459
  mount(t = null, n = null) {
526
460
  if (this.destroyed) throw new Error("Cannot mount a destroyed component");
461
+ this.validateIslandAncestry(this.props);
527
462
  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;
463
+ return this.initialized || (this.validateRequiredServices(), this.initialized = !0, this.initialize()), this.mounted || (this.mounted = !0, this.update(), r = !0), t != null && (Ge(t), V(t, this._rendered, n)), r && this.afterMount(this.dom), this;
529
464
  }
530
465
  attachTo(t) {
531
466
  return this.mount(t), this;
@@ -547,7 +482,7 @@ const d = class d {
547
482
  } finally {
548
483
  this.collectingRenderReads = null;
549
484
  }
550
- this._rendered = M(this._rendered, r, this), this.dom = ae(this._rendered), this.reconcileRenderReads(n), this.afterUpdate(this.dom);
485
+ this._rendered = M(this._rendered, r, this), this.dom = ue(this._rendered), this.reconcileRenderReads(n), this.afterUpdate(this.dom);
551
486
  } while (this.updateRequested && !this.destroyed);
552
487
  } finally {
553
488
  this.updating = !1;
@@ -557,7 +492,7 @@ const d = class d {
557
492
  setProps(t) {
558
493
  if (t == null || typeof t != "object" || Array.isArray(t))
559
494
  throw new TypeError(`${this.constructor.name} props must be an object`);
560
- return this.props = t, this.mounted && this.update(), this;
495
+ return this.validateIslandAncestry(t), this.props = t, this.mounted && this.update(), this;
561
496
  }
562
497
  afterMount(t) {
563
498
  }
@@ -621,7 +556,7 @@ const d = class d {
621
556
  return t.addEventListener(n, s, i), this.onCleanup(() => t.removeEventListener(n, s, i)), this;
622
557
  }
623
558
  registerChild(t) {
624
- if (!(t instanceof d))
559
+ if (!(t instanceof m))
625
560
  throw new TypeError("registerChild requires a Component");
626
561
  return this._childComponents.add(t), t;
627
562
  }
@@ -640,10 +575,26 @@ const d = class d {
640
575
  if (!this._runtime.services.has(n))
641
576
  throw new Error(`${t.name} requires unregistered service "${n.name}"`);
642
577
  }
578
+ validateIslandAncestry(t) {
579
+ if (!k(t)) return;
580
+ if (this.hasIslandDescendant())
581
+ throw new Error("An island component cannot contain another island");
582
+ let n = this._parentComponent;
583
+ for (; n != null; ) {
584
+ if (k(n.props))
585
+ throw new Error("An island component cannot be nested inside another island");
586
+ n = n._parentComponent;
587
+ }
588
+ }
589
+ hasIslandDescendant() {
590
+ for (const t of this._childComponents)
591
+ if (k(t.props) || t.hasIslandDescendant()) return !0;
592
+ return !1;
593
+ }
643
594
  onDestroy() {
644
595
  }
645
596
  trackRenderRead(t) {
646
- if (I(t, "Component.read"), this.collectingRenderReads == null)
597
+ if (H(t, "Component.read"), this.collectingRenderReads == null)
647
598
  throw new Error("Component.read() and snapshot() may only be called during render()");
648
599
  this.collectingRenderReads.add(t);
649
600
  }
@@ -659,12 +610,57 @@ const d = class d {
659
610
  }
660
611
  }
661
612
  };
662
- a(d, "dependencies", []), a(d, "requiredServices", []), a(d, "css", ""), a(d, "hostName", null), a(d, "standaloneHostName", null);
663
- let m = d;
613
+ l(m, "dependencies", []), l(m, "requiredServices", []), /** Component `live()` bindings are opt-in; subclasses declare their allowlist. */
614
+ l(m, "liveProps", []), l(m, "css", ke`
615
+ .fray-fill-horizontal,
616
+ .fray-fill-vertical {
617
+ box-sizing: border-box;
618
+ background: var(--application-background);
619
+ }
620
+
621
+ .fray-fill-horizontal {
622
+ width: 100vw;
623
+ max-width: 100vw;
624
+ min-width: 0;
625
+ overflow-x: auto;
626
+ }
627
+
628
+ .fray-fill-vertical {
629
+ height: 100vh;
630
+ max-height: 100vh;
631
+ min-height: 0;
632
+ overflow-y: auto;
633
+ }
634
+
635
+ .island {
636
+ box-sizing: border-box;
637
+ min-width: 0;
638
+ min-height: 0;
639
+ margin: var(--island-margin);
640
+ padding: var(--island-padding);
641
+ background: var(--island-background);
642
+ border: var(--island-border);
643
+ border-radius: var(--island-radius);
644
+ box-shadow: var(--island-shadow);
645
+ }
646
+
647
+ .fray-fill-horizontal.island,
648
+ .fray-fill-horizontal .island {
649
+ max-width: calc(100% - (2 * var(--island-margin)));
650
+ overflow-x: auto;
651
+ }
652
+
653
+ .fray-fill-vertical.island,
654
+ .fray-fill-vertical .island {
655
+ max-height: calc(100% - (2 * var(--island-margin)));
656
+ overflow-y: auto;
657
+ }
658
+ `), l(m, "hostName", null);
659
+ let d = m;
664
660
  function R(e) {
665
- return Array.isArray(e) ? O(A, null, e) : e == null || typeof e == "boolean" ? O(A) : e;
661
+ return Array.isArray(e) ? O(P, null, e) : e == null || typeof e == "boolean" ? O(P) : e;
666
662
  }
667
- function re(e) {
663
+ function se(e) {
668
664
  const t = [], n = (r) => {
669
665
  if (Array.isArray(r))
670
666
  for (const i of r) n(i);
@@ -672,7 +668,7 @@ function re(e) {
672
668
  };
673
669
  return n(e), t;
674
670
  }
675
- function C(e, t) {
671
+ function T(e, t) {
676
672
  if (typeof e == "string" || typeof e == "number")
677
673
  return {
678
674
  kind: "text",
@@ -681,14 +677,14 @@ function C(e, t) {
681
677
  node: document.createTextNode(String(e)),
682
678
  owner: t
683
679
  };
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))
680
+ if (N(e)) {
681
+ const s = document.createComment("fray-emitter-start"), o = document.createComment("fray-emitter-end"), a = e.get();
682
+ if (Object.is(a, e))
687
683
  throw new TypeError("A Fray emitter child cannot render itself");
688
- const l = document.createDocumentFragment();
689
- l.append(s, o);
690
- const u = C(R(c), t);
691
- H(l, u, o);
684
+ const c = document.createDocumentFragment();
685
+ c.append(s, o);
686
+ const u = T(R(a), t);
687
+ V(c, u, o);
692
688
  const p = {
693
689
  kind: "emitter",
694
690
  key: null,
@@ -706,10 +702,10 @@ function C(e, t) {
706
702
  p.child = M(p.child, R(b), t);
707
703
  }, { emitCurrent: !1 }), p;
708
704
  }
709
- if (e instanceof m)
710
- return e._setRuntime(t._runtime), e._setRouteContext(t._routeContextForChildren()), e.mount(), t.registerChild(e), {
705
+ if (e instanceof d)
706
+ return e._setRuntime(t._runtime), e._setRouteContext(t._routeContextForChildren()), e._setParentComponent(t), e.mount(), t.registerChild(e), {
711
707
  kind: "component",
712
- key: ce(e.props),
708
+ key: fe(e.props),
713
709
  type: e.constructor,
714
710
  instance: e,
715
711
  prebuilt: !0,
@@ -718,10 +714,10 @@ function C(e, t) {
718
714
  owner: t
719
715
  };
720
716
  if (!y(e))
721
- throw new TypeError(`Invalid Fray child: ${J(e)}`);
717
+ throw new TypeError(`Invalid Fray child: ${Y(e)}`);
722
718
  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 = {
719
+ if (n === P) {
720
+ const s = document.createComment("fray-fragment-start"), o = document.createComment("fray-fragment-end"), a = {
725
721
  kind: "fragment",
726
722
  key: r,
727
723
  type: n,
@@ -729,15 +725,15 @@ function C(e, t) {
729
725
  end: o,
730
726
  children: [],
731
727
  owner: t
732
- }, l = document.createDocumentFragment();
733
- return l.append(s, o), c.children = $(
734
- l,
728
+ }, c = document.createDocumentFragment();
729
+ return c.append(s, o), a.children = _(
730
+ c,
735
731
  [],
736
732
  i.children,
737
733
  t,
738
734
  o,
739
735
  s
740
- ), c;
736
+ ), a;
741
737
  }
742
738
  if (typeof n == "string") {
743
739
  const s = document.createElement(n), o = {
@@ -753,94 +749,108 @@ function C(e, t) {
753
749
  children: [],
754
750
  owner: t
755
751
  };
756
- return oe(o, i), o.children = $(s, [], i.children, t), o;
757
- }
758
- if (ue(n)) {
759
- const s = i, o = Y(s), c = new n(o);
760
- c._setRuntime(t._runtime), c._setRouteContext(t._routeContextForChildren());
761
- const l = {
752
+ return ce(o, i), o.children = _(s, [], i.children, t), o;
753
+ }
754
+ if (he(n)) {
755
+ const s = i;
756
+ le(n, s);
757
+ const o = W(s), a = new n(o);
758
+ a._setRuntime(t._runtime), a._setRouteContext(t._routeContextForChildren()), a._setParentComponent(t);
759
+ const c = {
762
760
  kind: "component",
763
761
  key: r,
764
762
  type: n,
765
- instance: c,
763
+ instance: a,
766
764
  prebuilt: !1,
767
765
  props: o,
768
766
  liveProps: /* @__PURE__ */ new Map(),
769
767
  owner: t
770
768
  };
771
- return se(l, s), c.mount(), t.registerChild(c), l;
769
+ return ae(c, s), a.mount(), t.registerChild(a), c;
772
770
  }
773
771
  if (typeof n == "function") {
774
- const s = n, o = i, c = Y(o), l = R(s(c)), u = {
772
+ const s = n, o = i, a = W(o), c = R(s(a)), u = {
775
773
  kind: "function",
776
774
  key: r,
777
775
  type: s,
778
- props: c,
776
+ props: a,
779
777
  sourceProps: o,
780
778
  liveProps: /* @__PURE__ */ new Map(),
781
- child: C(l, t),
779
+ child: T(c, t),
782
780
  owner: t
783
781
  };
784
- return Oe(u), u;
782
+ return Le(u), u;
785
783
  }
786
- throw new TypeError(`Unsupported vnode type: ${J(n)}`);
784
+ throw new TypeError(`Unsupported vnode type: ${Y(n)}`);
787
785
  }
788
786
  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;
787
+ if (e == null) return T(t, n);
788
+ if (pe(e, t)) return oe(e, t, n);
789
+ const r = T(t, n), i = ue(e), s = (i == null ? void 0 : i.parentNode) ?? null;
790
+ return s && V(s, r, i), g(e, !0), r;
793
791
  }
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 = $(
792
+ function oe(e, t, n) {
793
+ 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" ? (!N(t) || e.source !== t, e) : e.kind === "component" ? (t instanceof d || y(t) && ze(e, t.props), e) : y(t) ? e.kind === "function" ? (qe(e, t.props), e) : e.kind === "fragment" ? (e.children = _(
796
794
  e.start.parentNode,
797
795
  e.children,
798
796
  t.props.children,
799
797
  n,
800
798
  e.end,
801
799
  e.start
802
- ), e) : (oe(e, t.props), e.children = $(
800
+ ), e) : (ce(e, t.props), e.children = _(
803
801
  e.node,
804
802
  e.children,
805
803
  t.props.children,
806
804
  n
807
805
  ), e) : e;
808
806
  }
809
- function Y(e) {
807
+ function W(e) {
810
808
  return Object.fromEntries(Object.entries(e).map(([t, n]) => [
811
809
  t,
812
- j(n) ? n.emitter.get() : n
810
+ v(n) ? n.emitter.get() : n
813
811
  ]));
814
812
  }
815
- function se(e, t) {
816
- q(e.liveProps, t, (n, r) => {
813
+ function ae(e, t) {
814
+ x(e.liveProps, t, (n, r) => {
817
815
  e.props = { ...e.props, [n]: r }, e.instance.setProps(e.props);
818
- }), e.props = V(e.liveProps, t), e.instance.setProps(e.props);
816
+ }), e.props = I(e.liveProps, t), e.instance.setProps(e.props);
819
817
  }
820
- function Ae(e, t) {
821
- se(e, t);
818
+ function ze(e, t) {
819
+ le(e.type, t), ae(e, t);
822
820
  }
823
- function Oe(e) {
824
- q(e.liveProps, e.sourceProps, (t, n) => {
825
- e.props = { ...e.props, [t]: n }, z(e);
826
- }), e.props = V(e.liveProps, e.sourceProps);
821
+ function le(e, t) {
822
+ const n = Reflect.get(e, "liveProps");
823
+ if (n == null) return;
824
+ if (!Array.isArray(n) || n.some((i) => typeof i != "string"))
825
+ throw new TypeError(`${e.name || "Component"}.liveProps must be an array`);
826
+ const r = new Set(n);
827
+ for (const [i, s] of Object.entries(t))
828
+ if (v(s) && !r.has(i))
829
+ throw new TypeError(
830
+ `${e.name || "Component"} prop "${i}" does not support live()`
831
+ );
827
832
  }
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);
833
+ function Le(e) {
834
+ x(e.liveProps, e.sourceProps, (t, n) => {
835
+ e.props = { ...e.props, [t]: n }, L(e);
836
+ }), e.props = I(e.liveProps, e.sourceProps);
832
837
  }
833
- function z(e) {
838
+ function qe(e, t) {
839
+ e.sourceProps = t, x(e.liveProps, t, (n, r) => {
840
+ e.props = { ...e.props, [n]: r }, L(e);
841
+ }), e.props = I(e.liveProps, t), L(e);
842
+ }
843
+ function L(e) {
834
844
  const t = R(e.type(e.props));
835
845
  e.child = M(e.child, t, e.owner);
836
846
  }
837
- function q(e, t, n) {
847
+ function x(e, t, n) {
838
848
  for (const [r, i] of e) {
839
849
  const s = t[r];
840
- j(s) && s.emitter === i.source || (i.unsubscribe(), e.delete(r));
850
+ v(s) && s.emitter === i.source || (i.unsubscribe(), e.delete(r));
841
851
  }
842
852
  for (const [r, i] of Object.entries(t)) {
843
- if (!j(i) || e.has(r)) continue;
853
+ if (!v(i) || e.has(r)) continue;
844
854
  const s = {
845
855
  source: i.emitter,
846
856
  value: i.emitter.get(),
@@ -852,64 +862,66 @@ function q(e, t, n) {
852
862
  }, { emitCurrent: !1 }), e.set(r, s);
853
863
  }
854
864
  }
855
- function V(e, t) {
865
+ function I(e, t) {
856
866
  return Object.fromEntries(Object.entries(t).map(([n, r]) => {
857
867
  var i;
858
868
  return [
859
869
  n,
860
- j(r) ? ((i = e.get(n)) == null ? void 0 : i.value) ?? r.emitter.get() : r
870
+ v(r) ? ((i = e.get(n)) == null ? void 0 : i.value) ?? r.emitter.get() : r
861
871
  ];
862
872
  }));
863
873
  }
864
- function $(e, t, n, r, i = null, s = null) {
874
+ function _(e, t, n, r, i = null, s = null) {
865
875
  if (e == null) throw new Error("Cannot patch a detached fragment range");
866
- const o = re(n), c = /* @__PURE__ */ new Map(), l = [];
876
+ const o = se(n), a = /* @__PURE__ */ new Map(), c = [];
867
877
  for (const f of t)
868
- f.key == null ? l.push(f) : c.has(f.key) || c.set(f.key, f);
878
+ f.key == null ? c.push(f) : a.has(f.key) || a.set(f.key, f);
869
879
  const u = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), b = [];
870
- let pe = 0;
880
+ let me = 0;
871
881
  for (const f of o) {
872
- const h = E(f);
882
+ const h = C(f);
873
883
  if (h != null) {
874
884
  if (u.has(h)) throw new Error(`Duplicate sibling key: ${String(h)}`);
875
885
  u.add(h);
876
886
  }
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));
887
+ const j = h == null ? c[me++] : a.get(h);
888
+ j && pe(j, f) ? (p.add(j), b.push(oe(j, f, r))) : b.push(T(f, r));
879
889
  }
880
890
  for (const f of t)
881
891
  p.has(f) || g(f, !0);
882
- let v = s ? s.nextSibling : e.firstChild;
892
+ let E = s ? s.nextSibling : e.firstChild;
883
893
  for (const f of b)
884
894
  for (const h of w(f))
885
- h === v ? v = v.nextSibling : (e.insertBefore(h, v ?? i), v = h.nextSibling);
895
+ h === E ? E = E.nextSibling : (e.insertBefore(h, E ?? i), E = h.nextSibling);
886
896
  return b;
887
897
  }
888
- function oe(e, t) {
889
- const { children: n, ...r } = t, i = e.props, s = /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(r)]);
890
- for (const o of ["value", "checked"])
891
- if (Object.hasOwn(r, o) && Object.hasOwn(r, `bind:${o}`))
892
- throw new Error(`${o} and bind:${o} cannot be used together`);
893
- for (const o of s) {
894
- const c = i[o], l = r[o];
895
- if (Me(o))
896
- ke(e, o, l);
897
- else if (o === "ref")
898
- c !== l && _e(e, l);
899
- else if (Le(o))
900
- Ne(e, o, l);
901
- else if (j(l))
902
- Fe(e, o, l);
898
+ function ce(e, t) {
899
+ const n = Object.fromEntries(Object.entries(t).filter(
900
+ ([s]) => s !== "children" && A(s) !== U
901
+ )), r = e.props, i = /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(n)]);
902
+ for (const s of ["value", "checked"])
903
+ if (Object.hasOwn(n, s) && Object.hasOwn(n, `bind:${s}`))
904
+ throw new Error(`${s} and bind:${s} cannot be used together`);
905
+ for (const s of i) {
906
+ const o = r[s], a = n[s];
907
+ if (Ue(s))
908
+ Me(e, s, a);
909
+ else if (s === "ref")
910
+ o !== a && Ie(e, a);
911
+ else if (Ke(s))
912
+ xe(e, s, a);
913
+ else if (v(a))
914
+ Be(e, s, a);
903
915
  else {
904
- const u = e.liveProps.get(o);
905
- u && (u.unsubscribe(), e.liveProps.delete(o));
906
- const p = (u == null ? void 0 : u.value) ?? c;
907
- Object.is(p, l) || S(e.node, o, p, l);
916
+ const c = e.liveProps.get(s);
917
+ c && (c.unsubscribe(), e.liveProps.delete(s));
918
+ const u = (c == null ? void 0 : c.value) ?? o;
919
+ Object.is(u, a) || S(e.node, s, u, a);
908
920
  }
909
921
  }
910
- e.props = { ...r };
922
+ e.node.setAttribute(U, ""), e.props = { ...n };
911
923
  }
912
- function Fe(e, t, n) {
924
+ function Be(e, t, n) {
913
925
  const r = e.liveProps.get(t);
914
926
  if ((r == null ? void 0 : r.source) === n.emitter) return;
915
927
  r == null || r.unsubscribe();
@@ -922,36 +934,36 @@ function Fe(e, t, n) {
922
934
  }
923
935
  };
924
936
  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);
937
+ const a = s.value;
938
+ s.value = o, Object.is(a, o) || S(e.node, t, a, o);
927
939
  }, { emitCurrent: !1 }), e.liveProps.set(t, s);
928
940
  }
929
- function ke(e, t, n) {
941
+ function Me(e, t, n) {
930
942
  const r = t.slice(5), i = e.nativeBindings.get(t);
931
943
  if (n == null) {
932
944
  i && (i.unsubscribe(), e.node.removeEventListener(i.eventName, i.listener), e.nativeBindings.delete(t), S(e.node, r, i.value, void 0));
933
945
  return;
934
946
  }
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();
947
+ if (We(n, t), (i == null ? void 0 : i.source) === n) return;
948
+ i && (i.unsubscribe(), e.node.removeEventListener(i.eventName, i.listener)), Ze(e.node, r);
949
+ const s = Ye(e.node, r), o = n.get();
938
950
  S(e.node, r, i == null ? void 0 : i.value, o);
939
- const c = () => {
951
+ const a = () => {
940
952
  n.set(Reflect.get(e.node, r), `${t} changed`);
941
- }, l = {
953
+ }, c = {
942
954
  source: n,
943
955
  value: o,
944
956
  eventName: s,
945
- listener: c,
957
+ listener: a,
946
958
  unsubscribe: () => {
947
959
  }
948
960
  };
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);
961
+ c.unsubscribe = n.subscribe(({ value: u }) => {
962
+ const p = c.value;
963
+ c.value = u, Object.is(p, u) || S(e.node, r, p, u);
964
+ }, { emitCurrent: !1 }), e.node.addEventListener(s, a), e.nativeBindings.set(t, c);
953
965
  }
954
- function Ne(e, t, n) {
966
+ function xe(e, t, n) {
955
967
  const r = t.slice(2).toLowerCase(), i = e.listeners.get(t);
956
968
  if (i && i !== n && (e.node.removeEventListener(r, i), e.listeners.delete(t)), n != null && typeof n != "function")
957
969
  throw new TypeError(`${t} must be a function or null`);
@@ -960,51 +972,51 @@ function Ne(e, t, n) {
960
972
  e.node.addEventListener(r, s), e.listeners.set(t, s);
961
973
  }
962
974
  }
963
- function _e(e, t) {
964
- if (B(e.ref, null), t != null && typeof t != "function" && typeof t != "object")
975
+ function Ie(e, t) {
976
+ if (q(e.ref, null), t != null && typeof t != "function" && typeof t != "object")
965
977
  throw new TypeError("ref must be a function, object, or null");
966
- e.ref = t, B(e.ref, e.node);
978
+ e.ref = t, q(e.ref, e.node);
967
979
  }
968
980
  function S(e, t, n, r) {
969
981
  if (t === "class" || t === "className") {
970
- N(e, "class", r);
982
+ $(e, "class", r);
971
983
  return;
972
984
  }
973
985
  if (t === "for" || t === "htmlFor") {
974
- N(e, "for", r);
986
+ $(e, "for", r);
975
987
  return;
976
988
  }
977
989
  if (t === "dataset") {
978
- xe(e, n, r);
990
+ Ve(e, n, r);
979
991
  return;
980
992
  }
981
993
  if (t === "style") {
982
- ze(e, n, r);
994
+ He(e, n, r);
983
995
  return;
984
996
  }
985
997
  if (t === "dangerouslySetInnerHTML")
986
998
  throw new Error("dangerouslySetInnerHTML is not supported");
987
- const i = Be(t);
988
- if (Te.has(i)) {
999
+ const i = De(t);
1000
+ if (Ne.has(i)) {
989
1001
  const s = !!r;
990
- i in e && Reflect.set(e, i, s), e.toggleAttribute(_(t), s);
1002
+ i in e && Reflect.set(e, i, s), e.toggleAttribute(A(t), s);
991
1003
  return;
992
1004
  }
993
- if (Pe.has(i) && i in e) {
1005
+ if ($e.has(i) && i in e) {
994
1006
  const s = r ?? (i === "value" ? "" : !1);
995
- Object.is(Reflect.get(e, i), s) || Reflect.set(e, i, s), r == null && e.removeAttribute(_(t));
1007
+ Object.is(Reflect.get(e, i), s) || Reflect.set(e, i, s), r == null && e.removeAttribute(A(t));
996
1008
  return;
997
1009
  }
998
- N(e, _(t), r);
1010
+ $(e, A(t), r);
999
1011
  }
1000
- function xe(e, t, n) {
1012
+ function Ve(e, t, n) {
1001
1013
  const r = F(t, "dataset"), i = F(n, "dataset");
1002
1014
  for (const s of /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(i)])) {
1003
1015
  const o = i[s];
1004
1016
  o == null ? delete e.dataset[s] : e.dataset[s] = String(o);
1005
1017
  }
1006
1018
  }
1007
- function ze(e, t, n) {
1019
+ function He(e, t, n) {
1008
1020
  if (typeof n == "string") {
1009
1021
  e.style.cssText = n;
1010
1022
  return;
@@ -1022,19 +1034,19 @@ function F(e, t) {
1022
1034
  throw new TypeError(`${t} must be an object or null`);
1023
1035
  return e;
1024
1036
  }
1025
- function N(e, t, n) {
1037
+ function $(e, t, n) {
1026
1038
  n == null || n === !1 ? e.removeAttribute(t) : n === !0 ? e.setAttribute(t, "") : e.setAttribute(t, String(n));
1027
1039
  }
1028
- function Be(e) {
1040
+ function De(e) {
1029
1041
  return e === "readonly" ? "readOnly" : e === "autofocus" ? "autoFocus" : e;
1030
1042
  }
1031
- function _(e) {
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()}`);
1043
+ function A(e) {
1044
+ 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) ? Z(e) : e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
1033
1045
  }
1034
- function G(e) {
1046
+ function Z(e) {
1035
1047
  return e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
1036
1048
  }
1037
- function B(e, t) {
1049
+ function q(e, t) {
1038
1050
  e != null && (typeof e == "function" ? e(t) : e.current = t);
1039
1051
  }
1040
1052
  function g(e, t) {
@@ -1054,7 +1066,7 @@ function g(e, t) {
1054
1066
  return;
1055
1067
  }
1056
1068
  if (e.kind === "element") {
1057
- B(e.ref, null);
1069
+ q(e.ref, null);
1058
1070
  for (const [n, r] of e.listeners)
1059
1071
  e.node.removeEventListener(n.slice(2).toLowerCase(), r);
1060
1072
  e.listeners.clear();
@@ -1075,7 +1087,7 @@ function g(e, t) {
1075
1087
  }
1076
1088
  t && e.node.remove();
1077
1089
  }
1078
- function H(e, t, n = null) {
1090
+ function V(e, t, n = null) {
1079
1091
  if (t != null)
1080
1092
  for (const r of w(t)) e.insertBefore(r, n);
1081
1093
  }
@@ -1090,110 +1102,107 @@ function w(e) {
1090
1102
  n = n.nextSibling;
1091
1103
  return t;
1092
1104
  }
1093
- function ae(e) {
1105
+ function ue(e) {
1094
1106
  return w(e)[0] ?? null;
1095
1107
  }
1096
- function E(e) {
1097
- return e instanceof m ? ce(e.props) : y(e) ? e.key : null;
1108
+ function C(e) {
1109
+ return e instanceof d ? fe(e.props) : y(e) ? e.key : null;
1098
1110
  }
1099
- function ce(e) {
1111
+ function fe(e) {
1100
1112
  const t = e.key;
1101
1113
  return typeof t == "string" || typeof t == "number" ? t : null;
1102
1114
  }
1103
- function le(e, t) {
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);
1115
+ function pe(e, t) {
1116
+ return e.kind === "text" ? typeof t == "string" || typeof t == "number" : e.kind === "emitter" ? N(t) && e.source === t : e.kind === "component" ? t instanceof d ? e.instance === t : y(t) && he(t.type) && e.type === t.type && e.key === C(t) : e.kind === "function" ? y(t) && e.type === t.type && e.key === C(t) : e.kind === "fragment" ? y(t) && t.type === P && e.key === C(t) : y(t) && typeof t.type == "string" && e.type === t.type && e.key === C(t);
1105
1117
  }
1106
1118
  function y(e) {
1107
1119
  return e != null && typeof e == "object" && Object.hasOwn(e, "type");
1108
1120
  }
1109
- function ue(e) {
1110
- return typeof e == "function" && (e === m || e.prototype instanceof m);
1121
+ function he(e) {
1122
+ return typeof e == "function" && (e === d || e.prototype instanceof d);
1111
1123
  }
1112
- function Le(e) {
1124
+ function Ke(e) {
1113
1125
  return /^on[A-Z]/.test(e);
1114
1126
  }
1115
- function Me(e) {
1127
+ function Ue(e) {
1116
1128
  return e === "bind:value" || e === "bind:checked";
1117
1129
  }
1118
- function j(e) {
1119
- return e != null && typeof e == "object" && ne.has(e);
1130
+ function v(e) {
1131
+ return e != null && typeof e == "object" && ie.has(e);
1120
1132
  }
1121
- function k(e) {
1133
+ function N(e) {
1122
1134
  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";
1123
1135
  }
1124
- function I(e, t) {
1125
- if (!k(e)) throw new TypeError(`${t} requires a readable emitter`);
1136
+ function H(e, t) {
1137
+ if (!N(e)) throw new TypeError(`${t} requires a readable emitter`);
1126
1138
  }
1127
- function qe(e, t) {
1128
- if (I(e, t), typeof Reflect.get(e, "set") != "function")
1139
+ function We(e, t) {
1140
+ if (H(e, t), typeof Reflect.get(e, "set") != "function")
1129
1141
  throw new TypeError(`${t} requires a writable emitter`);
1130
1142
  }
1131
- function Ve(e, t) {
1143
+ function Ze(e, t) {
1132
1144
  const n = e.localName;
1133
1145
  if (!(t === "checked" ? n === "input" : n === "input" || n === "textarea" || n === "select")) throw new TypeError(`bind:${t} is not supported on ${n}`);
1134
1146
  }
1135
- function He(e, t) {
1147
+ function Ye(e, t) {
1136
1148
  return t === "value" && e.localName !== "select" ? "input" : "change";
1137
1149
  }
1138
- function Ie(e) {
1150
+ function Ge(e) {
1139
1151
  if (e == null || typeof e != "object" && typeof e != "function" || typeof Reflect.get(e, "insertBefore") != "function")
1140
1152
  throw new TypeError("Component parent must be a DOM ParentNode");
1141
1153
  }
1142
- function J(e) {
1154
+ function Y(e) {
1143
1155
  try {
1144
1156
  return String(e);
1145
1157
  } catch {
1146
1158
  return Object.prototype.toString.call(e);
1147
1159
  }
1148
1160
  }
1149
- function De(e) {
1150
- if (e == null) return [];
1151
- if (Array.isArray(e))
1152
- return e.map((t) => {
1153
- if (!Array.isArray(t) || t.length < 2 || typeof t[0] != "string")
1154
- throw new TypeError("Component baseStyles entries must be selector/style tuples");
1155
- const n = t[1];
1156
- if (typeof n != "string" && (!Array.isArray(n) || n.some((r) => typeof r != "string")))
1157
- throw new TypeError("Component base style names must be strings");
1158
- return [t[0], n];
1159
- });
1160
- if (typeof e != "object")
1161
- throw new TypeError("Component baseStyles must be an object or tuple array");
1162
- return Object.entries(e).map(([t, n]) => [
1163
- t,
1164
- n
1165
- ]);
1161
+ function Je(e) {
1162
+ const t = [];
1163
+ let n = e;
1164
+ for (; n != null && typeof n == "function" && (t.unshift(n), n !== d); )
1165
+ n = Object.getPrototypeOf(n);
1166
+ return t;
1167
+ }
1168
+ function Qe(...e) {
1169
+ return [...new Set(e.flatMap((t) => typeof t == "string" ? t.split(/\s+/) : []).filter(Boolean))].join(" ");
1170
+ }
1171
+ function k(e) {
1172
+ if (e.island === !0) return !0;
1173
+ const t = e.className ?? e.class;
1174
+ return typeof t == "string" && t.split(/\s+/).includes("island");
1166
1175
  }
1167
- function fe(e, t, n) {
1176
+ function de(e, t, n) {
1168
1177
  const r = t == null ? {} : { ...t };
1169
1178
  return n !== void 0 && (r.key = n), O(e, r);
1170
1179
  }
1171
- const Je = fe, Qe = fe;
1172
- function Xe(e) {
1173
- if (!(e instanceof m))
1180
+ const it = de, st = de;
1181
+ function ot(e) {
1182
+ if (!(e instanceof d))
1174
1183
  throw new TypeError("createPrebuiltElement requires a Component instance");
1175
1184
  return e;
1176
1185
  }
1177
1186
  export {
1178
- m as C,
1179
- A as F,
1180
- te as S,
1181
- Je as a,
1182
- L as b,
1183
- Ge as c,
1184
- Q as d,
1185
- Ze as e,
1186
- ve as f,
1187
- ye as g,
1187
+ d as C,
1188
+ P as F,
1189
+ ne as S,
1190
+ it as a,
1191
+ B as b,
1192
+ ke as c,
1193
+ G as d,
1194
+ nt as e,
1195
+ je as f,
1196
+ we as g,
1188
1197
  O as h,
1189
1198
  y as i,
1190
- fe as j,
1191
- W as k,
1192
- Ue as l,
1193
- Qe as m,
1194
- Ye as n,
1195
- Xe as o,
1196
- We as p,
1197
- be as s
1199
+ de as j,
1200
+ K as k,
1201
+ et as l,
1202
+ st as m,
1203
+ rt as n,
1204
+ ot as o,
1205
+ tt as p,
1206
+ Se as s
1198
1207
  };
1199
- //# sourceMappingURL=jsx-dev-runtime-Kf1Dhu-y.js.map
1208
+ //# sourceMappingURL=jsx-dev-runtime-CRDpvXOH.js.map