wrec 0.22.4 → 0.22.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -110,6 +110,23 @@ Here are the steps:
110
110
  MyCounter.define('my-counter');
111
111
  ```
112
112
 
113
+ Property definitions can also constrain string values to an allowed set:
114
+
115
+ ```js
116
+ class TrafficLight extends Wrec {
117
+ static properties = {
118
+ color: {
119
+ type: String,
120
+ values: ['red', 'yellow', 'green'],
121
+ value: 'red'
122
+ }
123
+ };
124
+ }
125
+ ```
126
+
127
+ With that configuration, the `color` attribute and property can only be set
128
+ to one of those strings.
129
+
113
130
  1. Create the file `index.html` containing the following.
114
131
 
115
132
  ```html
@@ -130,6 +147,17 @@ Here are the steps:
130
147
 
131
148
  1. Click the "-" and "+" buttons to verify that the component is working.
132
149
 
150
+ ## SSR Support
151
+
152
+ Server-side rendering (SSR) is supported.
153
+ This requires importing from "wrec/ssr" instead of "wrec".
154
+ That bundle is much larger because it bundles the node-html-parser package.
155
+ However, the size increase is not likely an issue
156
+ because it is used on the server-side rather than downloaded to web browsers.
157
+
158
+ For an example of using wrec with SSR, see
159
+ https://github.com/mvolkmann/web-component-book-code/tree/main/ch15/wrec-ssr-demo.
160
+
133
161
  ## Examples
134
162
 
135
163
  To run the examples in the `src/examples` directory:
@@ -214,3 +242,5 @@ to share state across multiple wrec components.
214
242
  state.name; // to see current value of "name" property
215
243
  state.name = 'Earth'; // to modify "name" property
216
244
  ```
245
+
246
+ `traffic-light.html` demonstrates a property with an enumerated value.
@@ -1,3 +1,5 @@
1
+ declare type AnyClass = new (...args: any[]) => any;
2
+
1
3
  declare type ChangeListener = {
2
4
  changed: (statePath: string, componentProperty: string, newValue: unknown, oldValue: unknown, state: WrecState) => void;
3
5
  };
@@ -15,6 +17,15 @@ declare const HTMLElementBase: {
15
17
 
16
18
  declare type LooseObject = Record<string, unknown>;
17
19
 
20
+ declare type PropertyConfig = {
21
+ computed?: string;
22
+ dispatch?: boolean;
23
+ required?: boolean;
24
+ type: AnyClass;
25
+ value?: any;
26
+ values?: string[];
27
+ };
28
+
18
29
  declare type StringToAny = Record<string, any>;
19
30
 
20
31
  declare type StringToString = Record<string, string>;
@@ -28,7 +39,7 @@ export declare abstract class Wrec extends HTMLElementBase implements ChangeList
28
39
  private static elementName;
29
40
  static formAssociated: boolean;
30
41
  static html: string;
31
- static properties: StringToAny;
42
+ static properties: Record<string, PropertyConfig>;
32
43
  private static propToComputedMap;
33
44
  private static propToExprsMap;
34
45
  private static template;
package/dist/wrec.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ declare type AnyClass = new (...args: any[]) => any;
2
+
1
3
  export declare type ChangeListener = {
2
4
  changed: (statePath: string, componentProperty: string, newValue: unknown, oldValue: unknown, state: WrecState) => void;
3
5
  };
@@ -15,6 +17,15 @@ declare const HTMLElementBase: {
15
17
 
16
18
  declare type LooseObject = Record<string, unknown>;
17
19
 
20
+ declare type PropertyConfig = {
21
+ computed?: string;
22
+ dispatch?: boolean;
23
+ required?: boolean;
24
+ type: AnyClass;
25
+ value?: any;
26
+ values?: string[];
27
+ };
28
+
18
29
  declare type StringToAny = Record<string, any>;
19
30
 
20
31
  declare type StringToString = Record<string, string>;
@@ -28,7 +39,7 @@ export declare abstract class Wrec extends HTMLElementBase implements ChangeList
28
39
  private static elementName;
29
40
  static formAssociated: boolean;
30
41
  static html: string;
31
- static properties: StringToAny;
42
+ static properties: Record<string, PropertyConfig>;
32
43
  private static propToComputedMap;
33
44
  private static propToExprsMap;
34
45
  private static template;
package/dist/wrec.es.js CHANGED
@@ -1,50 +1,50 @@
1
- var V = (n) => {
2
- throw TypeError(n);
1
+ var B = (r) => {
2
+ throw TypeError(r);
3
3
  };
4
- var O = (n, t, e) => t.has(n) || V("Cannot " + e);
5
- var p = (n, t, e) => (O(n, t, "read from private field"), e ? e.call(n) : t.get(n)), b = (n, t, e) => t.has(n) ? V("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), w = (n, t, e, s) => (O(n, t, "write to private field"), s ? s.call(n, e) : t.set(n, e), e), B = (n, t, e) => (O(n, t, "access private method"), e);
4
+ var O = (r, t, e) => t.has(r) || B("Cannot " + e);
5
+ var u = (r, t, e) => (O(r, t, "read from private field"), e ? e.call(r) : t.get(r)), b = (r, t, e) => t.has(r) ? B("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), w = (r, t, e, s) => (O(r, t, "write to private field"), s ? s.call(r, e) : t.set(r, e), e), V = (r, t, e) => (O(r, t, "access private method"), e);
6
6
  import W from "xss";
7
- function K(n, t, e = "") {
7
+ function Z(r, t, e = "") {
8
8
  const s = /* @__PURE__ */ new WeakMap(), o = {
9
9
  // Intercept property reads.
10
10
  // This creates nested proxies lazily.
11
- get(i, r) {
12
- const c = Reflect.get(i, r);
11
+ get(i, n) {
12
+ const c = Reflect.get(i, n);
13
13
  if (c === null || typeof c != "object") return c;
14
14
  const a = s.get(c);
15
15
  if (a) return a;
16
- const h = e ? `${e}.${r}` : r, f = K(c, t, h);
16
+ const h = e ? `${e}.${n}` : n, f = Z(c, t, h);
17
17
  return s.set(c, f), f;
18
18
  },
19
19
  // Intercept property writes.
20
- set(i, r, c) {
21
- const a = Reflect.get(i, r);
20
+ set(i, n, c) {
21
+ const a = Reflect.get(i, n);
22
22
  if (a !== c) {
23
- Reflect.set(i, r, c);
24
- const h = e ? `${e}.${r}` : r;
23
+ Reflect.set(i, n, c);
24
+ const h = e ? `${e}.${n}` : n;
25
25
  t(h, a, c);
26
26
  }
27
27
  return !0;
28
28
  }
29
29
  };
30
- return new Proxy(n, o);
30
+ return new Proxy(r, o);
31
31
  }
32
- function Z(n) {
32
+ function U(r) {
33
33
  const t = {};
34
- for (const [e, s] of Object.entries(n)) {
34
+ for (const [e, s] of Object.entries(r)) {
35
35
  const o = typeof s == "object" && s !== null;
36
- t[e] = o ? Z(s) : s;
36
+ t[e] = o ? U(s) : s;
37
37
  }
38
38
  return t;
39
39
  }
40
40
  const P = typeof window < "u" && typeof window.document < "u";
41
41
  let z = class extends Error {
42
42
  };
43
- var y, N, d, v, C, g, $, U;
43
+ var y, R, d, v, C, g, N, Y;
44
44
  const T = class T {
45
45
  constructor(t, e, s) {
46
- b(this, $);
47
- b(this, N, /* @__PURE__ */ Symbol("objectId"));
46
+ b(this, N);
47
+ b(this, R, /* @__PURE__ */ Symbol("objectId"));
48
48
  // This cannot be replaced by a WeakMap<ChangeListener, Set<string>>
49
49
  // because there is no way to iterate over the keys of a WeakMap.
50
50
  b(this, d, []);
@@ -52,16 +52,16 @@ const T = class T {
52
52
  b(this, C);
53
53
  b(this, g);
54
54
  if (!t) throw new z("name cannot be empty");
55
- if (p(T, y).has(t))
55
+ if (u(T, y).has(t))
56
56
  throw new z(`WrecState with name "${t}" already exists`);
57
- if (w(this, v, t), w(this, C, e), w(this, g, K({}, B(this, $, U).bind(this))), e && P) {
57
+ if (w(this, v, t), w(this, C, e), w(this, g, Z({}, V(this, N, Y).bind(this))), e && P) {
58
58
  const o = sessionStorage.getItem("wrec-state-" + t), i = o ? JSON.parse(o) : void 0;
59
59
  i && (s = i);
60
60
  }
61
61
  if (s)
62
62
  for (const [o, i] of Object.entries(s))
63
63
  this.addProperty(o, i);
64
- p(T, y).set(t, this);
64
+ u(T, y).set(t, this);
65
65
  }
66
66
  // This static method is useful for accessing a specific WrecState object
67
67
  // from the DevTools console. For example:
@@ -74,22 +74,22 @@ const T = class T {
74
74
  // state.color = 'blue';
75
75
  // state.team.leader.name = 'Mark';
76
76
  static get(t) {
77
- return p(this, y).get(t);
77
+ return u(this, y).get(t);
78
78
  }
79
79
  /**
80
80
  * @param listener - object that has a "changed" method
81
81
  * @param map - map from state property paths to component properties
82
82
  */
83
83
  addListener(t, e = {}) {
84
- const s = p(this, d).find(
84
+ const s = u(this, d).find(
85
85
  (o) => o.listenerRef.deref() === t
86
86
  );
87
87
  if (s) {
88
88
  const { propertyMap: o } = s;
89
- for (const [i, r] of Object.entries(e))
90
- o[i] = r;
89
+ for (const [i, n] of Object.entries(e))
90
+ o[i] = n;
91
91
  } else
92
- p(this, d).push({
92
+ u(this, d).push({
93
93
  listenerRef: new WeakRef(t),
94
94
  propertyMap: e
95
95
  });
@@ -98,38 +98,38 @@ const T = class T {
98
98
  Object.defineProperty(this, t, {
99
99
  enumerable: !0,
100
100
  get() {
101
- return p(this, g)[t];
101
+ return u(this, g)[t];
102
102
  },
103
103
  set(s) {
104
- p(this, g)[t] = s;
104
+ u(this, g)[t] = s;
105
105
  }
106
- }), p(this, g)[t] = e;
106
+ }), u(this, g)[t] = e;
107
107
  }
108
108
  get id() {
109
- return p(this, N);
109
+ return u(this, R);
110
110
  }
111
111
  // This is useful for debugging from the DevTools console.
112
112
  // For example: state.log()
113
113
  log() {
114
- console.log("WrecState:", p(this, v));
115
- for (const [t, e] of Object.entries(p(this, g)))
114
+ console.log("WrecState:", u(this, v));
115
+ for (const [t, e] of Object.entries(u(this, g)))
116
116
  console.log(` ${t} = ${JSON.stringify(e)}`);
117
117
  }
118
118
  removeListener(t) {
119
- w(this, d, p(this, d).filter((e) => e.listenerRef.deref() !== t));
119
+ w(this, d, u(this, d).filter((e) => e.listenerRef.deref() !== t));
120
120
  }
121
121
  };
122
- y = new WeakMap(), N = new WeakMap(), d = new WeakMap(), v = new WeakMap(), C = new WeakMap(), g = new WeakMap(), $ = new WeakSet(), U = function(t, e, s) {
122
+ y = new WeakMap(), R = new WeakMap(), d = new WeakMap(), v = new WeakMap(), C = new WeakMap(), g = new WeakMap(), N = new WeakSet(), Y = function(t, e, s) {
123
123
  const o = /* @__PURE__ */ new Set();
124
- for (const i of p(this, d)) {
125
- const r = i.listenerRef.deref();
126
- if (!r)
124
+ for (const i of u(this, d)) {
125
+ const n = i.listenerRef.deref();
126
+ if (!n)
127
127
  o.add(i);
128
- else if (P && r instanceof HTMLElement && !r.isConnected)
128
+ else if (P && n instanceof HTMLElement && !n.isConnected)
129
129
  o.add(i);
130
130
  else {
131
131
  const { propertyMap: c } = i, a = Object.keys(c);
132
- (a.length === 0 || a.includes(t)) && r.changed(
132
+ (a.length === 0 || a.includes(t)) && n.changed(
133
133
  t,
134
134
  c[t],
135
135
  s,
@@ -138,43 +138,43 @@ y = new WeakMap(), N = new WeakMap(), d = new WeakMap(), v = new WeakMap(), C =
138
138
  );
139
139
  }
140
140
  }
141
- w(this, d, p(this, d).filter(
141
+ w(this, d, u(this, d).filter(
142
142
  (i) => !o.has(i)
143
143
  ));
144
144
  }, b(T, y, /* @__PURE__ */ new Map()), P && window.addEventListener("beforeunload", () => {
145
- for (const [t, e] of p(T, y).entries())
146
- if (p(e, C)) {
147
- const s = Z(e);
145
+ for (const [t, e] of u(T, y).entries())
146
+ if (u(e, C)) {
147
+ const s = U(e);
148
148
  sessionStorage.setItem("wrec-state-" + t, JSON.stringify(s));
149
149
  }
150
150
  });
151
- let _ = T;
152
- P && process.env.NODE_ENV === "development" && (window.WrecState = _);
153
- function q(n, t) {
154
- let e = n;
151
+ let F = T;
152
+ P && process.env.NODE_ENV === "development" && (window.WrecState = F);
153
+ function q(r, t) {
154
+ let e = r;
155
155
  for (const s of t.split("."))
156
156
  e = e[s];
157
157
  return e;
158
158
  }
159
- function st(n, t, e) {
159
+ function ot(r, t, e) {
160
160
  const s = t.split("."), o = s.length - 1;
161
- let i = n;
162
- s.forEach((r, c) => {
163
- c === o ? i[r] = e : i = i[r];
161
+ let i = r;
162
+ s.forEach((n, c) => {
163
+ c === o ? i[n] = e : i = i[n];
164
164
  });
165
165
  }
166
- const ot = /* @__PURE__ */ new Set(["input", "label", "option", "th"]), J = "__WREC", X = "__";
167
- function it(n) {
166
+ const it = /* @__PURE__ */ new Set(["input", "label", "option", "th"]), J = "__WREC", X = "__";
167
+ function nt(r) {
168
168
  const t = {
169
169
  allowCommentTag: !0,
170
170
  onTag: (o, i) => {
171
- if (ot.has(o)) return i;
171
+ if (it.has(o)) return i;
172
172
  },
173
- onTagAttr(o, i, r) {
173
+ onTagAttr(o, i, n) {
174
174
  if (i.startsWith("on")) return "";
175
175
  },
176
- safeAttrValue(o, i, r) {
177
- return i === "class" || o === "a" && i === "href" && !r.startsWith("javascript") || o === "img" && i === "src" ? r : "";
176
+ safeAttrValue(o, i, n) {
177
+ return i === "class" || o === "a" && i === "href" && !n.startsWith("javascript") || o === "img" && i === "src" ? n : "";
178
178
  },
179
179
  stripIgnoreTagBody: ["script", "style", "iframe"],
180
180
  whiteList: {
@@ -183,32 +183,32 @@ function it(n) {
183
183
  span: ["class"]
184
184
  }
185
185
  }, e = [];
186
- n = n.replace(/<!--[\s\S]*?-->/g, (o) => {
186
+ r = r.replace(/<!--[\s\S]*?-->/g, (o) => {
187
187
  let i = "";
188
188
  do
189
189
  i = J + e.length + X;
190
- while (n.includes(i));
190
+ while (r.includes(i));
191
191
  return e.push(o), i;
192
192
  });
193
- let s = W(n, t);
193
+ let s = W(r, t);
194
194
  return e.forEach((o, i) => {
195
- const r = new RegExp(
195
+ const n = new RegExp(
196
196
  `${J}${i}${X}`,
197
197
  "g"
198
198
  );
199
- s = s.replace(r, o);
199
+ s = s.replace(n, o);
200
200
  }), s;
201
201
  }
202
- const nt = /* @__PURE__ */ new Set([
202
+ const rt = /* @__PURE__ */ new Set([
203
203
  "class",
204
204
  "disabled",
205
205
  "hidden",
206
206
  "id",
207
207
  "tabindex",
208
208
  "title"
209
- ]), rt = globalThis.HTMLElement ?? class {
210
- }, F = globalThis.customElements ?? {
211
- get: (n) => {
209
+ ]), ct = globalThis.HTMLElement ?? class {
210
+ }, _ = globalThis.customElements ?? {
211
+ get: (r) => {
212
212
  },
213
213
  getName: () => "",
214
214
  define: () => {
@@ -221,96 +221,96 @@ const nt = /* @__PURE__ */ new Set([
221
221
  };
222
222
  class E extends Error {
223
223
  }
224
- const ct = /([a-zA-Z-]+)\s*:\s*([^;}]+)/g, Y = "a-zA-Z_$", at = Y + "0-9", S = `[${Y}][${at}]*`, ft = /<!--\s*(.*?)\s*-->/, ht = /<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g, L = new RegExp(`^this\\.${S}$`), j = new RegExp(`this\\.${S}(\\.${S})*`, "g"), G = new RegExp(`this\\.${S}(\\.${S})*`), lt = 5;
225
- function pt(n) {
226
- return n instanceof HTMLButtonElement || n instanceof HTMLFieldSetElement || n instanceof HTMLInputElement || n instanceof HTMLSelectElement || n instanceof HTMLTextAreaElement || n instanceof u;
224
+ const at = /([a-zA-Z-]+)\s*:\s*([^;}]+)/g, G = "a-zA-Z_$", ft = G + "0-9", S = `[${G}][${ft}]*`, ht = /<!--\s*(.*?)\s*-->/, lt = /<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g, j = new RegExp(`^this\\.${S}$`), L = new RegExp(`this\\.${S}(\\.${S})*`, "g"), Q = new RegExp(`this\\.${S}(\\.${S})*`), ut = 5;
225
+ function pt(r) {
226
+ return r instanceof HTMLButtonElement || r instanceof HTMLFieldSetElement || r instanceof HTMLInputElement || r instanceof HTMLSelectElement || r instanceof HTMLTextAreaElement || r instanceof p;
227
227
  }
228
- function wt(n, t, e) {
229
- const s = document.createElement(n);
228
+ function Et(r, t, e) {
229
+ const s = document.createElement(r);
230
230
  if (t)
231
231
  for (const [o, i] of Object.entries(t))
232
232
  s.setAttribute(o, i);
233
233
  return e && (s.innerHTML = e), s;
234
234
  }
235
- const ut = (n) => n === String ? "" : n === Number ? 0 : n === Boolean ? !1 : n === Array ? [] : n === Object ? {} : void 0;
236
- function R(n) {
235
+ const K = (r) => Array.isArray(r.values) && r.values.length > 0 ? r.values[0] : dt(r.type), dt = (r) => r === String ? "" : r === Number ? 0 : r === Boolean ? !1 : r === Array ? [] : r === Object ? {} : void 0;
236
+ function $(r) {
237
237
  const t = [];
238
- let e = n.firstElementChild;
238
+ let e = r.firstElementChild;
239
239
  for (; e; )
240
- t.push(e), e.shadowRoot && t.push(...R(e.shadowRoot)), e.firstElementChild && t.push(...R(e)), e = e.nextElementSibling;
240
+ t.push(e), e.shadowRoot && t.push(...$(e.shadowRoot)), e.firstElementChild && t.push(...$(e)), e = e.nextElementSibling;
241
241
  return t;
242
242
  }
243
- const M = (n) => n.substring(lt).split(".")[0];
244
- function Q(n, t) {
245
- let e = n[0];
243
+ const M = (r) => r.substring(ut).split(".")[0];
244
+ function tt(r, t) {
245
+ let e = r[0];
246
246
  return t.forEach((s, o) => {
247
- e += s + n[o + 1];
247
+ e += s + r[o + 1];
248
248
  }), e;
249
249
  }
250
- function I(n) {
251
- const t = typeof n;
250
+ function I(r) {
251
+ const t = typeof r;
252
252
  return t === "string" || t === "number" || t === "boolean";
253
253
  }
254
- function A(n) {
255
- return n.localName === "textarea";
254
+ function A(r) {
255
+ return r.localName === "textarea";
256
256
  }
257
- function D(n) {
258
- const { localName: t } = n;
257
+ function D(r) {
258
+ const { localName: t } = r;
259
259
  return t === "input" || t === "select";
260
260
  }
261
- const dt = (n) => n.replace(/<!--[\s\S]*?-->/g, "");
262
- function tt(n, t, e, s) {
263
- return n.slice(0, t) + s + n.slice(t + e);
261
+ const mt = (r) => r.replace(/<!--[\s\S]*?-->/g, "");
262
+ function et(r, t, e, s) {
263
+ return r.slice(0, t) + s + r.slice(t + e);
264
264
  }
265
- function H(n) {
266
- const t = Number(n);
267
- if (isNaN(t)) throw new E(`can't convert "${n}" to a number`);
265
+ function H(r) {
266
+ const t = Number(r);
267
+ if (isNaN(t)) throw new E(`can't convert "${r}" to a number`);
268
268
  return t;
269
269
  }
270
- function et(n, t, e) {
270
+ function st(r, t, e) {
271
271
  const [s, o] = t.split(":");
272
272
  if (I(e))
273
273
  if (typeof e == "boolean") {
274
- e ? n.setAttribute(s, s) : n.removeAttribute(s);
275
- const i = u.getPropName(s);
276
- n[i] = e;
274
+ e ? r.setAttribute(s, s) : r.removeAttribute(s);
275
+ const i = p.getPropName(s);
276
+ r[i] = e;
277
277
  } else {
278
- const i = n.getAttribute(t), r = String(e);
279
- i !== r && (n.setAttribute(s, r), s === "value" && D(n) && (n.value = r));
278
+ const i = r.getAttribute(t), n = String(e);
279
+ i !== n && (r.setAttribute(s, n), s === "value" && D(r) && (r.value = n));
280
280
  }
281
281
  else {
282
- const i = u.getPropName(t);
283
- n[i] = e;
282
+ const i = p.getPropName(t);
283
+ r[i] = e;
284
284
  }
285
285
  }
286
- function k(n, t, e) {
286
+ function k(r, t, e) {
287
287
  const [s, o] = t.split(":");
288
- n instanceof CSSStyleRule ? n.style.setProperty(s, e) : (et(n, s, e), s === "value" && D(n) && (n.value = e));
288
+ r instanceof CSSStyleRule ? r.style.setProperty(s, e) : (st(r, s, e), s === "value" && D(r) && (r.value = e));
289
289
  }
290
- async function mt(n) {
290
+ async function bt(r) {
291
291
  const t = /* @__PURE__ */ new Set();
292
- for (const s of R(n.content)) {
292
+ for (const s of $(r.content)) {
293
293
  const { localName: o } = s;
294
294
  o.includes("-") && t.add(o);
295
295
  }
296
296
  function e(s) {
297
297
  return new Promise((o, i) => {
298
298
  setTimeout(() => {
299
- const r = `custom element <${s}> not defined`;
300
- i(new Error(r));
299
+ const n = `custom element <${s}> not defined`;
300
+ i(new Error(n));
301
301
  }, 1e3);
302
302
  });
303
303
  }
304
304
  return Promise.all(
305
305
  [...t].map(
306
306
  async (s) => Promise.race([
307
- F.whenDefined(s),
307
+ _.whenDefined(s),
308
308
  e(s)
309
309
  ])
310
310
  )
311
311
  );
312
312
  }
313
- class u extends rt {
313
+ class p extends ct {
314
314
  // There is one instance of `attrToPropMap`, `properties`, `propToAttrMap`,
315
315
  // `propToComputedMap`, and `propToExprsMap` per Wrec subclass,
316
316
  // not one for only the Wrec class.
@@ -366,7 +366,7 @@ class u extends rt {
366
366
  // in the formAssociatedCallback method
367
367
  // so they can be restored in the formResetCallback method.
368
368
  #l = {};
369
- #p = null;
369
+ #u = null;
370
370
  // This is a map from properties in this web component
371
371
  // to corresponding properties in a parent web component.
372
372
  // This must be an instance property because
@@ -374,15 +374,15 @@ class u extends rt {
374
374
  // to the properties of different parent components.
375
375
  // This is used to update a parent property
376
376
  // when the corresponding child property value changes.
377
- #u = /* @__PURE__ */ new Map();
377
+ #p = /* @__PURE__ */ new Map();
378
378
  // This is a map from component properties to state bindings.
379
379
  // It must be instance-specific because each component instance
380
380
  // can bind the same property to a different WrecState/path.
381
381
  #m = /* @__PURE__ */ new Map();
382
382
  static define(t) {
383
- if (this.elementName = t, F.get(t))
383
+ if (this.elementName = t, _.get(t))
384
384
  throw new E(`custom element ${t} is already defined`);
385
- F.define(t, this);
385
+ _.define(t, this);
386
386
  }
387
387
  constructor() {
388
388
  super(), this.attachShadow({ mode: "open" });
@@ -391,12 +391,12 @@ class u extends rt {
391
391
  }
392
392
  attributeChangedCallback(t, e, s) {
393
393
  t === "disabled" && this.#g();
394
- const o = u.getPropName(t);
394
+ const o = p.getPropName(t);
395
395
  if (this.#r(o)) {
396
- const i = this.#S(o, String(s));
396
+ const i = this.#S(o, s);
397
397
  this[o] = i;
398
- const r = this.#h[o];
399
- r && this.setFormValue(r, String(i)), this.propertyChangedCallback(o, e, s);
398
+ const n = this.#h[o];
399
+ n && this.setFormValue(n, String(i)), this.propertyChangedCallback(o, e, s);
400
400
  }
401
401
  }
402
402
  // This applies multiple property changes and only updates
@@ -410,14 +410,14 @@ class u extends rt {
410
410
  for (const f of h)
411
411
  s.add(f);
412
412
  }
413
- const o = this.#t.propToComputedMap, i = /* @__PURE__ */ new Set(), r = {};
413
+ const o = this.#t.propToComputedMap, i = /* @__PURE__ */ new Set(), n = {};
414
414
  for (const c of Object.keys(t)) {
415
415
  const a = o.get(c) || [];
416
416
  for (const [h, f] of a)
417
- i.add(h), r[h] = f;
417
+ i.add(h), n[h] = f;
418
418
  }
419
419
  for (const c of i) {
420
- const a = r[c];
420
+ const a = n[c];
421
421
  this[c] = this.#s(a);
422
422
  const h = e.get(c) ?? [];
423
423
  for (const f of h)
@@ -426,7 +426,7 @@ class u extends rt {
426
426
  for (; ; ) {
427
427
  let c = !1;
428
428
  for (const a of i) {
429
- const h = r[a], f = this.#s(h), l = this[a];
429
+ const h = n[a], f = this.#s(h), l = this[a];
430
430
  JSON.stringify(f) !== JSON.stringify(l) && (this[a] = f, c = !0);
431
431
  }
432
432
  if (!c) break;
@@ -436,7 +436,7 @@ class u extends rt {
436
436
  async #x() {
437
437
  const t = this.#t;
438
438
  let { template: e } = t;
439
- e || (e = t.template = document.createElement("template"), e.innerHTML = t.buildHTML()), await mt(e), this.shadowRoot.replaceChildren(e.content.cloneNode(!0));
439
+ e || (e = t.template = document.createElement("template"), e.innerHTML = t.buildHTML()), await bt(e), this.shadowRoot.replaceChildren(e.content.cloneNode(!0));
440
440
  }
441
441
  static buildHTML() {
442
442
  let t = `<style>
@@ -451,7 +451,7 @@ class u extends rt {
451
451
  this[e] = s;
452
452
  }
453
453
  connectedCallback() {
454
- this.#_(), this.#R(), this.#x().then(() => {
454
+ this.#F(), this.#$(), this.#x().then(() => {
455
455
  this.hasAttribute("disabled") && this.#g(), this.#C(this.shadowRoot), this.#w(this.shadowRoot), this.#P();
456
456
  });
457
457
  }
@@ -460,7 +460,7 @@ class u extends rt {
460
460
  for (const [s, { computed: o }] of Object.entries(e))
461
461
  o && (this[s] = this.#s(o));
462
462
  }
463
- #R() {
463
+ #$() {
464
464
  const t = this.#t, { observedAttributes: e, properties: s } = t;
465
465
  for (const [o, i] of Object.entries(s))
466
466
  i.computed || this.#b(o, i, e);
@@ -470,12 +470,12 @@ class u extends rt {
470
470
  #b(t, e, s) {
471
471
  if (t === "class" || t === "style")
472
472
  throw new E(`"${t}" is a reserved property`);
473
- const o = u.getAttrName(t), i = this.hasAttribute(o);
473
+ const o = p.getAttrName(t), i = this.hasAttribute(o);
474
474
  e.required && !i && this.#e(this, o, "is a required attribute");
475
- let r = e.value;
476
- this.hasOwnProperty(t) && (r = this[t], delete this[t]);
477
- const { type: c } = e, a = c === Boolean ? r || i : s.includes(o) && i ? this.#A(t, o) : r || ut(c), h = "#" + t;
478
- this[h] = a, e.computed && this.#L(t, e), Object.defineProperty(this, t, {
475
+ let n = e.value;
476
+ this.hasOwnProperty(t) && (n = this[t], delete this[t]);
477
+ const { type: c } = e, a = c === Boolean ? n || i : s.includes(o) && i ? this.#A(t, o) : n ?? K(e), h = "#" + t;
478
+ this[h] = a, e.computed && this.#j(t, e), Object.defineProperty(this, t, {
479
479
  enumerable: !0,
480
480
  get() {
481
481
  return this[h];
@@ -486,7 +486,7 @@ class u extends rt {
486
486
  if (f === l) return;
487
487
  this.#I(t, c, f), this[h] = f;
488
488
  const m = this.#m.get(t);
489
- m && st(m.state, m.stateProp, f), this.#j(t, c, f, o), this.#f || (this.#H(t), this.#M(t)), this.#k(t, f);
489
+ m && ot(m.state, m.stateProp, f), this.#L(t, c, f, o), this.#f || (this.#H(t), this.#M(t)), this.#k(t, f);
490
490
  const x = this.#h[t];
491
491
  x && this.setFormValue(x, String(f)), this.propertyChangedCallback(t, l, f), e.dispatch && this.dispatch("change", {
492
492
  tagName: this.localName,
@@ -498,12 +498,12 @@ class u extends rt {
498
498
  });
499
499
  }
500
500
  #g() {
501
- const t = this.hasAttribute("disabled"), e = R(this.shadowRoot);
501
+ const t = this.hasAttribute("disabled"), e = $(this.shadowRoot);
502
502
  for (const s of e)
503
503
  pt(s) && (s.disabled = t);
504
504
  }
505
505
  disconnectedCallback() {
506
- this.#o.clear(), this.#l.clear(), this.#u.clear();
506
+ this.#o.clear(), this.#l.clear(), this.#p.clear();
507
507
  }
508
508
  dispatch(t, e) {
509
509
  this.dispatchEvent(
@@ -519,17 +519,17 @@ class u extends rt {
519
519
  displayIfSet(t, e = "block") {
520
520
  return `display: ${t ? e : "none"}`;
521
521
  }
522
- #N(t) {
523
- const e = t instanceof u;
522
+ #R(t) {
523
+ const e = t instanceof p;
524
524
  for (const s of t.getAttributeNames()) {
525
525
  const o = t.getAttribute(s), i = this.#T(t, o);
526
526
  if (i) {
527
- const r = this[i];
528
- r === void 0 && this.#a(t, s, i);
527
+ const n = this[i];
528
+ n === void 0 && this.#a(t, s, i);
529
529
  let [c, a] = s.split(":");
530
- const h = u.getPropName(c);
531
- t[h] = r, c === "value" && (a ? (t["on" + a] === void 0 && this.#e(t, s, "refers to an unsupported event name"), t.setAttribute(c, this[i])) : a = "change"), e && t.#u.set(
532
- u.getPropName(c),
530
+ const h = p.getPropName(c);
531
+ t[h] = n, c === "value" && (a ? (t["on" + a] === void 0 && this.#e(t, s, "refers to an unsupported event name"), t.setAttribute(c, this[i])) : a = "change"), e && t.#p.set(
532
+ p.getPropName(c),
533
533
  i
534
534
  );
535
535
  }
@@ -543,8 +543,8 @@ class u extends rt {
543
543
  if (i instanceof HTMLElement)
544
544
  this.#v(i, s);
545
545
  else if (!(i instanceof CSSStyleRule)) {
546
- const { element: r, attrName: c } = i;
547
- r instanceof CSSStyleRule ? r.style.setProperty(c, s) : k(r, c, s);
546
+ const { element: n, attrName: c } = i;
547
+ n instanceof CSSStyleRule ? n.style.setProperty(c, s) : k(n, c, s);
548
548
  }
549
549
  }
550
550
  }
@@ -555,24 +555,24 @@ class u extends rt {
555
555
  `const {${Object.keys(e).join(",")}} = context; return ${t};`
556
556
  ).call(this, e);
557
557
  }
558
- #$(t) {
558
+ #N(t) {
559
559
  const { localName: e } = t;
560
560
  if (e === "style") {
561
561
  const { sheet: s } = t, o = s?.cssRules ?? [], i = Array.from(o);
562
- for (const r of i)
563
- if (r.constructor === CSSStyleRule) {
564
- const c = Array.from(r.style);
562
+ for (const n of i)
563
+ if (n.constructor === CSSStyleRule) {
564
+ const c = Array.from(n.style);
565
565
  for (const a of c)
566
566
  if (a.startsWith("--")) {
567
- const h = r.style.getPropertyValue(a);
568
- this.#c(h, r, a);
567
+ const h = n.style.getPropertyValue(a);
568
+ this.#c(h, n, a);
569
569
  }
570
570
  }
571
571
  } else {
572
572
  let s = "";
573
573
  if (A(t)) {
574
574
  this.#c(t.textContent, t);
575
- const o = t.textContent?.match(ft);
575
+ const o = t.textContent?.match(ht);
576
576
  o && (s = o[1]);
577
577
  } else {
578
578
  const o = Array.from(t.childNodes).find(
@@ -593,30 +593,30 @@ class u extends rt {
593
593
  formAssociatedCallback() {
594
594
  let t = this.getAttribute("form-assoc");
595
595
  if (!t) {
596
- const r = this.getAttribute("name");
597
- if (r)
596
+ const n = this.getAttribute("name");
597
+ if (n)
598
598
  if (this.#r("value"))
599
- t = `value:${r}`;
599
+ t = `value:${n}`;
600
600
  else
601
601
  return;
602
602
  else
603
603
  return;
604
604
  }
605
605
  const e = {}, s = t.split(",");
606
- for (const r of s) {
607
- const [c, a] = r.split(":");
606
+ for (const n of s) {
607
+ const [c, a] = n.split(":");
608
608
  e[c.trim()] = a.trim();
609
609
  }
610
- this.#h = e, this.#i = new FormData(), this.#p = this.attachInternals(), this.#p.setFormValue(this.#i);
610
+ this.#h = e, this.#i = new FormData(), this.#u = this.attachInternals(), this.#u.setFormValue(this.#i);
611
611
  const o = Object.keys(this.#t.properties), i = this.#l;
612
- for (const r of o)
613
- i[r] = this[r];
612
+ for (const n of o)
613
+ i[n] = this[n];
614
614
  }
615
615
  formResetCallback() {
616
616
  const t = this.#l;
617
617
  for (const e of Object.keys(t)) {
618
618
  let s = t[e];
619
- L.test(s) && (s = this.#s(s)), this[e] = s;
619
+ j.test(s) && (s = this.#s(s)), this[e] = s;
620
620
  }
621
621
  }
622
622
  static getAttrName(t) {
@@ -630,10 +630,10 @@ class u extends rt {
630
630
  #O(t, e, s) {
631
631
  if (s.length !== 1) return;
632
632
  const [o] = s;
633
- if (!L.test(o)) return;
633
+ if (!j.test(o)) return;
634
634
  const i = D(t) || A(t);
635
- let [r, c] = (e ?? "").split(":");
636
- if (!(i && r === "value" || A(t))) return;
635
+ let [n, c] = (e ?? "").split(":");
636
+ if (!(i && n === "value" || A(t))) return;
637
637
  c ? t["on" + c] === void 0 && this.#e(t, e, "refers to an unsupported event name") : c = "change";
638
638
  const h = M(o);
639
639
  t.addEventListener(c, (f) => {
@@ -652,7 +652,7 @@ class u extends rt {
652
652
  #w(t) {
653
653
  const e = Array.from(t.querySelectorAll("*"));
654
654
  for (const s of e)
655
- this.#N(s), s.firstElementChild || this.#$(s);
655
+ this.#R(s), s.firstElementChild || this.#N(s);
656
656
  }
657
657
  // formAssociated is only needed when the component is inside a form.
658
658
  #E() {
@@ -666,7 +666,7 @@ class u extends rt {
666
666
  }
667
667
  static get observedAttributes() {
668
668
  const t = Object.keys(this.properties || {}).map(
669
- (e) => u.getAttrName(e)
669
+ (e) => p.getAttrName(e)
670
670
  );
671
671
  return t.includes("disabled") || t.push("disabled"), t;
672
672
  }
@@ -674,7 +674,7 @@ class u extends rt {
674
674
  propertyChangedCallback(t, e, s) {
675
675
  }
676
676
  #T(t, e) {
677
- if (!e || !L.test(e)) return;
677
+ if (!e || !j.test(e)) return;
678
678
  const s = M(e);
679
679
  return this[s] === void 0 && this.#a(t, "", s), s;
680
680
  }
@@ -682,20 +682,20 @@ class u extends rt {
682
682
  const e = this.#t.propToExprsMap.get(t) || [];
683
683
  this.#y(e);
684
684
  }
685
- #L(t, e) {
685
+ #j(t, e) {
686
686
  const { computed: s, uses: o } = e, i = this.#t.propToComputedMap;
687
- function r(a, h) {
687
+ function n(a, h) {
688
688
  let f = i.get(a);
689
689
  f || (f = [], i.set(a, f)), f.push([t, h]);
690
690
  }
691
- const c = s.match(j) || [];
691
+ const c = s.match(L) || [];
692
692
  for (const a of c) {
693
693
  const h = M(a);
694
- this[h] === void 0 && this.#a(null, t, h), typeof this[h] != "function" && r(h, s);
694
+ this[h] === void 0 && this.#a(null, t, h), typeof this[h] != "function" && n(h, s);
695
695
  }
696
696
  if (o)
697
697
  for (const a of o.split(","))
698
- r(a.trim(), s);
698
+ n(a.trim(), s);
699
699
  }
700
700
  // WARNING: Do not place untrusted JavaScript expressions
701
701
  // in attribute values or the text content of elements!
@@ -723,8 +723,8 @@ class u extends rt {
723
723
  h.filter((m) => m !== f)
724
724
  );
725
725
  }
726
- let r = this.#o.get(t);
727
- r || (r = [], this.#o.set(t, r)), r.push(s ? { element: e, attrName: s } : e), e instanceof HTMLElement && this.#O(e, s, o);
726
+ let n = this.#o.get(t);
727
+ n || (n = [], this.#o.set(t, n)), n.push(s ? { element: e, attrName: s } : e), e instanceof HTMLElement && this.#O(e, s, o);
728
728
  const c = this.#s(t);
729
729
  s ? k(e, s, c) : this.#v(e, c);
730
730
  }
@@ -734,7 +734,7 @@ class u extends rt {
734
734
  this.hasAttribute(t) || this.setAttribute(t, e);
735
735
  }
736
736
  setFormValue(t, e) {
737
- !this.#i || !I(e) || (this.#i.set(t, e), this.#p?.setFormValue(this.#i));
737
+ !this.#i || !I(e) || (this.#i.set(t, e), this.#u?.setFormValue(this.#i));
738
738
  }
739
739
  static ssr(t = {}) {
740
740
  throw new E('Import Wrec from "wrec/ssr" to use the ssr method.');
@@ -752,27 +752,35 @@ class u extends rt {
752
752
  return this.#S(t, this.getAttribute(e));
753
753
  }
754
754
  #S(t, e) {
755
- if (e?.match(j)) return e;
756
- const s = this.#t, { type: o } = s.properties[t];
757
- if (o || this.#e(null, t, "does not specify its type"), o === String) return e;
758
- if (o === Number) return H(e);
759
- if (o === Boolean) {
755
+ if (e?.match(L)) return e;
756
+ const o = this.#t.properties[t], { type: i, values: n } = o;
757
+ if (i || this.#e(null, t, "does not specify its type"), e === null)
758
+ return i === Boolean ? !1 : K(o);
759
+ if (i === String) {
760
+ if (n && !n.includes(e)) {
761
+ const c = n.map((a) => `"${a}"`).join(", ");
762
+ this.#e(null, t, `must be one of ${c}`);
763
+ }
764
+ return e;
765
+ }
766
+ if (i === Number) return H(e);
767
+ if (i === Boolean) {
760
768
  if (e === "true") return !0;
761
769
  if (e === "false" || e === "null") return !1;
762
- const i = u.getAttrName(t);
763
- return e && e !== i && this.#e(
770
+ const c = p.getAttrName(t);
771
+ return e && e !== c && this.#e(
764
772
  null,
765
773
  t,
766
774
  "is a Boolean attribute, so its value must match attribute name or be missing"
767
- ), e === "" || e === i;
775
+ ), e === "" || e === c;
768
776
  }
769
777
  }
770
778
  // Updates the matching attribute for a property.
771
779
  // VS Code thinks this is never called, but it is called by #defineProp.
772
- #j(t, e, s, o) {
780
+ #L(t, e, s, o) {
773
781
  if (I(s)) {
774
782
  const i = e === Boolean ? this.hasAttribute(o) : this.#A(t, o);
775
- s !== i && et(this, o || t, s);
783
+ s !== i && st(this, o || t, s);
776
784
  }
777
785
  }
778
786
  // Updates all computed properties that reference this property.
@@ -796,21 +804,21 @@ class u extends rt {
796
804
  if (t instanceof HTMLElement && A(t))
797
805
  t.value = i;
798
806
  else if (s && o === "string" && i.trim().startsWith("<")) {
799
- const r = it(i);
800
- t.innerHTML = r, this.#C(t), this.#w(t);
807
+ const n = nt(i);
808
+ t.innerHTML = n, this.#C(t), this.#w(t);
801
809
  } else s && (t.textContent = i);
802
810
  }
803
811
  // Update corresponding parent web component property if bound to one.
804
812
  // VS Code thinks this is never called, but it is called by #defineProp.
805
813
  #k(t, e) {
806
- const s = this.#u.get(t);
814
+ const s = this.#p.get(t);
807
815
  if (!s) return;
808
816
  const o = this.getRootNode();
809
817
  if (!(o instanceof ShadowRoot)) return;
810
818
  const { host: i } = o;
811
819
  if (!i) return;
812
- const r = i;
813
- r[s] = e;
820
+ const n = i;
821
+ n[s] = e;
814
822
  }
815
823
  /**
816
824
  * @param state - WrecState object
@@ -823,7 +831,7 @@ class u extends rt {
823
831
  for (const s of Object.keys(t))
824
832
  e[s] = s;
825
833
  }
826
- this.#F(t, e);
834
+ this.#_(t, e);
827
835
  for (const [s, o] of Object.entries(e))
828
836
  if (this.#r(o)) {
829
837
  const i = q(t, s);
@@ -831,15 +839,15 @@ class u extends rt {
831
839
  }
832
840
  t.addListener(this, e);
833
841
  }
834
- #_() {
842
+ #F() {
835
843
  const t = new Set(Object.keys(this.#t.properties));
836
844
  for (const e of this.getAttributeNames())
837
- if (!nt.has(e) && !e.startsWith("on")) {
845
+ if (!rt.has(e) && !e.startsWith("on")) {
838
846
  if (e === "form-assoc") {
839
847
  this.#E();
840
848
  continue;
841
849
  }
842
- if (!t.has(u.getPropName(e))) {
850
+ if (!t.has(p.getPropName(e))) {
843
851
  if (e === "name") {
844
852
  this.#E();
845
853
  continue;
@@ -849,14 +857,14 @@ class u extends rt {
849
857
  }
850
858
  }
851
859
  #d(t, e, s) {
852
- const o = s.match(j);
860
+ const o = s.match(L);
853
861
  if (o)
854
862
  return o.forEach((i) => {
855
- const r = M(i);
856
- this[r] === void 0 && this.#a(t, e, r);
863
+ const n = M(i);
864
+ this[n] === void 0 && this.#a(t, e, n);
857
865
  }), o;
858
866
  }
859
- #F(t, e) {
867
+ #_(t, e) {
860
868
  for (const [s, o] of Object.entries(e)) {
861
869
  let i = q(t, s);
862
870
  i === void 0 && this.#e(this, void 0, `invalid state path "${s}"`), i = this[o], this.#r(o) || this.#e(
@@ -869,20 +877,25 @@ class u extends rt {
869
877
  // When type is an array, this can't validate the type of the array elements.
870
878
  // This is called by #defineProp.
871
879
  #I(t, e, s) {
880
+ const { values: o } = this.#t.properties[t];
881
+ if (o) {
882
+ let n;
883
+ e !== String ? n = "declares allowed values, but its type is not String" : typeof s != "string" ? n = `value is a ${typeof s}, but type is String` : o.includes(s) || (n = `must be one of ${o.map((a) => `"${a}"`).join(", ")}`), n && this.#e(null, t, n);
884
+ }
872
885
  if (s instanceof e) return;
873
- let o = typeof s;
874
- if (o === "object") {
875
- const { constructor: i } = s;
876
- o = i.name, i !== e && this.#e(
886
+ let i = typeof s;
887
+ if (i === "object") {
888
+ const { constructor: n } = s;
889
+ i = n.name, n !== e && this.#e(
877
890
  null,
878
891
  t,
879
- `was set to a ${o}, but must be a ${e.name}`
892
+ `was set to a ${i}, but must be a ${e.name}`
880
893
  );
881
894
  }
882
- o !== e.name.toLowerCase() && this.#e(
895
+ i !== e.name.toLowerCase() && this.#e(
883
896
  null,
884
897
  t,
885
- `was set to a ${o}, but must be a ${e.name}`
898
+ `was set to a ${i}, but must be a ${e.name}`
886
899
  );
887
900
  }
888
901
  #C(t) {
@@ -890,14 +903,14 @@ class u extends rt {
890
903
  for (const s of e) {
891
904
  const o = [];
892
905
  for (const i of Array.from(s.attributes)) {
893
- const r = i.name;
894
- if (r.startsWith("on")) {
895
- let c = r.slice(2);
906
+ const n = i.name;
907
+ if (n.startsWith("on")) {
908
+ let c = n.slice(2);
896
909
  c = c[0].toLowerCase() + c.slice(1).toLowerCase();
897
910
  const a = i.value;
898
- this.#d(s, r, a);
911
+ this.#d(s, n, a);
899
912
  let h;
900
- typeof this[a] == "function" ? h = (f) => this[a](f) : (this.#d(s, r, a), h = () => this.#s(a)), s.addEventListener(c, h), o.push(r);
913
+ typeof this[a] == "function" ? h = (f) => this[a](f) : (this.#d(s, n, a), h = () => this.#s(a)), s.addEventListener(c, h), o.push(n);
901
914
  }
902
915
  }
903
916
  for (const i of o)
@@ -905,40 +918,40 @@ class u extends rt {
905
918
  }
906
919
  }
907
920
  }
908
- function Et(n, ...t) {
909
- let e = Q(n, t);
921
+ function Tt(r, ...t) {
922
+ let e = tt(r, t);
910
923
  for (; ; ) {
911
- const s = ct.exec(e);
924
+ const s = at.exec(e);
912
925
  if (!s) break;
913
926
  const o = s[2];
914
- if (G.test(o)) {
927
+ if (Q.test(o)) {
915
928
  const i = s[1];
916
929
  if (!i.startsWith("--")) {
917
- const r = `--${i}: ${o};
930
+ const n = `--${i}: ${o};
918
931
  ${i}: var(--${i})`;
919
- e = tt(e, s.index, s[0].length, r);
932
+ e = et(e, s.index, s[0].length, n);
920
933
  }
921
934
  }
922
935
  }
923
936
  return e;
924
937
  }
925
- function Tt(n, ...t) {
926
- let e = Q(n, t);
938
+ function Mt(r, ...t) {
939
+ let e = tt(r, t);
927
940
  for (; ; ) {
928
- const s = ht.exec(e);
941
+ const s = lt.exec(e);
929
942
  if (!s || s[1] === "style") break;
930
- const o = dt(s[2]);
931
- if (G.test(o)) {
932
- const i = `<!-- ${o.trim()} -->`, r = s.index + s[0].indexOf(">") + 1;
933
- e = tt(e, r, o.length, i);
943
+ const o = mt(s[2]);
944
+ if (Q.test(o)) {
945
+ const i = `<!-- ${o.trim()} -->`, n = s.index + s[0].indexOf(">") + 1;
946
+ e = et(e, n, o.length, i);
934
947
  }
935
948
  }
936
949
  return e;
937
950
  }
938
951
  export {
939
- u as Wrec,
940
- _ as WrecState,
941
- wt as createElement,
942
- Et as css,
943
- Tt as html
952
+ p as Wrec,
953
+ F as WrecState,
954
+ Et as createElement,
955
+ Tt as css,
956
+ Mt as html
944
957
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "wrec",
3
3
  "description": "a small library that greatly simplifies building web components",
4
4
  "author": "R. Mark Volkmann",
5
- "version": "0.22.4",
5
+ "version": "0.22.6",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",