wrec 0.17.3 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -102,7 +102,7 @@ Here are the steps:
102
102
  1. Create the file `index.html` containing the following.
103
103
 
104
104
  ```html
105
- <!DOCTYPE html>
105
+ <!doctype html>
106
106
  <html lang="en">
107
107
  <head>
108
108
  <script src="my-counter.js" type="module"></script>
package/dist/wrec.es.js CHANGED
@@ -1,10 +1,10 @@
1
- function R(r, t) {
1
+ function M(r, t) {
2
2
  let e = r;
3
3
  for (const s of t.split("."))
4
4
  e = e[s];
5
5
  return e;
6
6
  }
7
- function O(r, t, e) {
7
+ function H(r, t, e) {
8
8
  const s = t.split("."), o = s.length - 1;
9
9
  let i = r;
10
10
  s.forEach((n, h) => {
@@ -13,9 +13,9 @@ function O(r, t, e) {
13
13
  }
14
14
  class m extends Error {
15
15
  }
16
- const k = /([a-zA-Z-]+)\s*:\s*([^;}]+)/g, P = "a-zA-Z_$", F = P + "0-9", b = `[${P}][${F}]*`, j = /<!--\s*(.*?)\s*-->/, _ = /<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g, A = new RegExp(`^this\\.${b}$`), y = new RegExp(`this\\.${b}(\\.${b})*`, "g"), N = new RegExp(`this\\.${b}(\\.${b})*`), V = /* @__PURE__ */ new Set(["class", "style"]), $ = 5;
16
+ const O = /([a-zA-Z-]+)\s*:\s*([^;}]+)/g, P = "a-zA-Z_$", F = P + "0-9", b = `[${P}][${F}]*`, j = /<!--\s*(.*?)\s*-->/, V = /<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g, A = new RegExp(`^this\\.${b}$`), E = new RegExp(`this\\.${b}(\\.${b})*`, "g"), N = new RegExp(`this\\.${b}(\\.${b})*`), _ = /* @__PURE__ */ new Set(["class", "style"]), $ = 5;
17
17
  function I(r) {
18
- return r instanceof HTMLButtonElement || r instanceof HTMLFieldSetElement || r instanceof HTMLInputElement || r instanceof HTMLSelectElement || r instanceof HTMLTextAreaElement || r instanceof l;
18
+ return r instanceof HTMLButtonElement || r instanceof HTMLFieldSetElement || r instanceof HTMLInputElement || r instanceof HTMLSelectElement || r instanceof HTMLTextAreaElement || r instanceof u;
19
19
  }
20
20
  function q(r, t, e) {
21
21
  const s = document.createElement(r);
@@ -32,21 +32,21 @@ function w(r) {
32
32
  t.push(e), e.shadowRoot && t.push(...w(e.shadowRoot)), e.firstElementChild && t.push(...w(e)), e = e.nextElementSibling;
33
33
  return t;
34
34
  }
35
- const E = (r) => r.substring($).split(".")[0];
35
+ const g = (r) => r.substring($).split(".")[0];
36
36
  function x(r, t) {
37
37
  let e = r[0];
38
38
  return t.forEach((s, o) => {
39
39
  e += s + r[o + 1];
40
40
  }), e;
41
41
  }
42
- function S(r) {
42
+ function T(r) {
43
43
  const t = typeof r;
44
44
  return t === "string" || t === "number" || t === "boolean";
45
45
  }
46
46
  function d(r) {
47
47
  return r.localName === "textarea";
48
48
  }
49
- function v(r) {
49
+ function R(r) {
50
50
  const { localName: t } = r;
51
51
  return t === "input" || t === "select";
52
52
  }
@@ -54,32 +54,32 @@ const B = (r) => r.replace(/<!--[\s\S]*?-->/g, "");
54
54
  function L(r, t, e, s) {
55
55
  return r.slice(0, t) + s + r.slice(t + e);
56
56
  }
57
- function C(r) {
57
+ function S(r) {
58
58
  const t = Number(r);
59
59
  if (isNaN(t)) throw new m(`can't convert "${r}" to a number`);
60
60
  return t;
61
61
  }
62
- function H(r, t, e) {
62
+ function k(r, t, e) {
63
63
  const [s, o] = t.split(":");
64
- if (S(e))
64
+ if (T(e))
65
65
  if (typeof e == "boolean") {
66
66
  e ? r.setAttribute(s, s) : r.removeAttribute(s);
67
- const i = l.getPropName(s);
67
+ const i = u.getPropName(s);
68
68
  r[i] = e;
69
69
  } else {
70
70
  const i = r.getAttribute(t), n = String(e);
71
- i !== n && (r.setAttribute(s, n), s === "value" && v(r) && (r.value = n));
71
+ i !== n && (r.setAttribute(s, n), s === "value" && R(r) && (r.value = n));
72
72
  }
73
73
  else {
74
- const i = l.getPropName(t);
74
+ const i = u.getPropName(t);
75
75
  r[i] = e;
76
76
  }
77
77
  }
78
- function T(r, t, e) {
78
+ function C(r, t, e) {
79
79
  const [s, o] = t.split(":");
80
- r instanceof CSSRule ? r.style.setProperty(s, e) : (H(r, s, e), s === "value" && v(r) && (r.value = e));
80
+ r instanceof CSSRule ? r.style.setProperty(s, e) : (k(r, s, e), s === "value" && R(r) && (r.value = e));
81
81
  }
82
- class l extends HTMLElement {
82
+ class u extends HTMLElement {
83
83
  // This is used to lookup the camelCase property name
84
84
  // that corresponds to a kebab-case attribute name.
85
85
  static #p = /* @__PURE__ */ new Map();
@@ -113,6 +113,7 @@ class l extends HTMLElement {
113
113
  // This map cannot be private.
114
114
  //static propToExprsMap: Map<string, string[]> | null = null;
115
115
  static propToExprsMap;
116
+ static stylesheet = null;
116
117
  static template = null;
117
118
  #t = this.constructor;
118
119
  // This is a map from expressions to references to them
@@ -120,7 +121,7 @@ class l extends HTMLElement {
120
121
  // attribute values, and CSS property values.
121
122
  // Each component instance needs its own map.
122
123
  #s = /* @__PURE__ */ new Map();
123
- #a = {};
124
+ #c = {};
124
125
  #i;
125
126
  // For components that set `formAssociated` to true,
126
127
  // this stores in the initial value of each property
@@ -135,7 +136,7 @@ class l extends HTMLElement {
135
136
  // to the properties of different parent components.
136
137
  // This is used to update a parent property
137
138
  // when the corresponding child property value changes.
138
- #u = /* @__PURE__ */ new Map();
139
+ #l = /* @__PURE__ */ new Map();
139
140
  constructor() {
140
141
  super(), this.attachShadow({ mode: "open" });
141
142
  const t = this.#t;
@@ -143,62 +144,72 @@ class l extends HTMLElement {
143
144
  }
144
145
  attributeChangedCallback(t, e, s) {
145
146
  t === "disabled" && this.#m();
146
- const o = l.getPropName(t);
147
- if (this.#n(o)) {
148
- const i = this.#y(o, String(s));
147
+ const o = u.getPropName(t);
148
+ if (this.#r(o)) {
149
+ const i = this.#E(o, String(s));
149
150
  this[o] = i;
150
- const n = this.#a[o];
151
+ const n = this.#c[o];
151
152
  n && this.setFormValue(n, String(i)), this.propertyChangedCallback(o, e, s);
152
153
  }
153
154
  }
154
155
  #w() {
156
+ if (!this.shadowRoot) return;
155
157
  const t = this.#t;
156
- let e = t.template;
157
- if (!e) {
158
- e = t.template = document.createElement("template");
159
- let s = "<style> :host([hidden]) { display: none; } ";
160
- t.css && (s += t.css), s += "</style>", s += t.html, e.innerHTML = s;
158
+ if (t.css) {
159
+ let s = t.stylesheet;
160
+ if (!s) {
161
+ s = t.stylesheet = new CSSStyleSheet();
162
+ const o = `:host([hidden]) { display: none; } ${t.css}`;
163
+ s.replaceSync(o);
164
+ }
165
+ this.shadowRoot.adoptedStyleSheets = [s];
161
166
  }
162
- this.shadowRoot?.replaceChildren(e.content.cloneNode(!0));
167
+ let e = t.template;
168
+ e || (e = t.template = document.createElement("template"), e.innerHTML = t.html), this.shadowRoot.replaceChildren(e.content.cloneNode(!0));
163
169
  }
164
170
  changed(t, e, s) {
165
171
  this[e] = s;
166
172
  }
167
173
  connectedCallback() {
168
- this.#O(), this.#v(), this.#w(), this.hasAttribute("disabled") && this.#m(), requestAnimationFrame(() => {
169
- this.shadowRoot && (this.#T(this.shadowRoot), this.#b(this.shadowRoot)), this.#S();
174
+ this.#O(), this.#R(), this.#w(), this.hasAttribute("disabled") && this.#m(), requestAnimationFrame(() => {
175
+ if (this.shadowRoot) {
176
+ this.#C(this.shadowRoot), this.#b(this.shadowRoot);
177
+ for (const t of this.shadowRoot.adoptedStyleSheets)
178
+ this.#$(t);
179
+ }
180
+ this.#T();
170
181
  });
171
182
  }
172
- #S() {
183
+ #T() {
173
184
  const t = this.#t, { properties: e } = t;
174
185
  for (const [s, { computed: o }] of Object.entries(e))
175
186
  o && (this[s] = this.#o(o));
176
187
  }
177
- #v() {
188
+ #R() {
178
189
  const t = this.#t, { observedAttributes: e, properties: s } = t;
179
190
  for (const [o, i] of Object.entries(s))
180
- this.#M(o, i, e);
191
+ this.#v(o, i, e);
181
192
  }
182
- #M(t, e, s) {
183
- const o = l.getAttrName(t), i = this.hasAttribute(o);
193
+ #v(t, e, s) {
194
+ const o = u.getAttrName(t), i = this.hasAttribute(o);
184
195
  e.required && !i && this.#e(this, t, "is a required attribute");
185
196
  let n = e.value;
186
197
  this.hasOwnProperty(t) && (n = this[t], delete this[t]);
187
- const { type: h } = e, c = h === Boolean ? n || i : s.includes(o) && i ? this.#A(t, o) : n || D(h), f = "#" + t;
188
- this[f] = c, e.computed && this.#$(t, e), Object.defineProperty(this, t, {
198
+ const { type: h } = e, a = h === Boolean ? n || i : s.includes(o) && i ? this.#A(t, o) : n || D(h), f = "#" + t;
199
+ this[f] = a, e.computed && this.#x(t, e), Object.defineProperty(this, t, {
189
200
  enumerable: !0,
190
201
  get() {
191
202
  return this[f];
192
203
  },
193
- set(a) {
194
- h === Number && typeof a == "string" && (a = C(a));
195
- const u = this[f];
196
- if (a === u) return;
197
- this.#F(t, h, a), this[f] = a;
198
- const { state: p, stateProp: g } = this.#t.properties[t];
199
- g && O(p, g, a), this.#L(t), this.#x(t, h, a, o), this.#E(t), this.#H(t, a);
200
- const M = this.#a[t];
201
- M && this.setFormValue(M, String(a)), this.propertyChangedCallback(t, u, a), e.dispatch && this.dispatch("change", { [t]: a });
204
+ set(c) {
205
+ h === Number && typeof c == "string" && (c = S(c));
206
+ const l = this[f];
207
+ if (c === l) return;
208
+ this.#j(t, h, c), this[f] = c;
209
+ const { state: p, stateProp: y } = this.#t.properties[t];
210
+ y && H(p, y, c), this.#k(t), this.#L(t, h, c, o), this.#g(t), this.#H(t, c);
211
+ const v = this.#c[t];
212
+ v && this.setFormValue(v, String(c)), this.propertyChangedCallback(t, l, c), e.dispatch && this.dispatch("change", { [t]: c });
202
213
  }
203
214
  });
204
215
  }
@@ -208,7 +219,7 @@ class l extends HTMLElement {
208
219
  I(s) && (s.disabled = t);
209
220
  }
210
221
  disconnectedCallback() {
211
- this.#s.clear(), this.#f.clear(), this.#u.clear();
222
+ this.#s.clear(), this.#f.clear(), this.#l.clear();
212
223
  }
213
224
  dispatch(t, e) {
214
225
  this.dispatchEvent(
@@ -229,20 +240,20 @@ class l extends HTMLElement {
229
240
  static elementName() {
230
241
  return this.name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
231
242
  }
232
- #R(t) {
233
- const e = t instanceof l;
243
+ #M(t) {
244
+ const e = t instanceof u;
234
245
  for (const s of t.getAttributeNames()) {
235
- const o = t.getAttribute(s), i = this.#g(t, o);
246
+ const o = t.getAttribute(s), i = this.#y(t, o);
236
247
  if (i) {
237
248
  const n = this[i];
238
- n === void 0 && this.#c(t, s, i), t[i] = n;
239
- let [h, c] = s.split(":");
240
- h === "value" && (c ? (t["on" + c] === void 0 && this.#e(t, s, "refers to an unsupported event name"), t.setAttribute(h, this[i])) : c = "change"), e && t.#u.set(
241
- l.getPropName(h),
249
+ n === void 0 && this.#a(t, s, i), t[i] = n;
250
+ let [h, a] = s.split(":");
251
+ h === "value" && (a ? (t["on" + a] === void 0 && this.#e(t, s, "refers to an unsupported event name"), t.setAttribute(h, this[i])) : a = "change"), e && t.#l.set(
252
+ u.getPropName(h),
242
253
  i
243
254
  );
244
255
  }
245
- this.#r(o, t, s);
256
+ this.#n(o, t, s);
246
257
  }
247
258
  }
248
259
  #o(t) {
@@ -256,16 +267,16 @@ class l extends HTMLElement {
256
267
  for (const n of i)
257
268
  if (n.constructor === CSSStyleRule) {
258
269
  const h = Array.from(n.style);
259
- for (const c of h)
260
- if (c.startsWith("--")) {
261
- const f = n.style.getPropertyValue(c);
262
- this.#r(f, n, c);
270
+ for (const a of h)
271
+ if (a.startsWith("--")) {
272
+ const f = n.style.getPropertyValue(a);
273
+ this.#n(f, n, a);
263
274
  }
264
275
  }
265
276
  } else {
266
277
  let s = "";
267
278
  if (d(t)) {
268
- this.#r(t.textContent, t);
279
+ this.#n(t.textContent, t);
269
280
  const o = t.textContent?.match(j);
270
281
  o && (s = o[1]);
271
282
  } else {
@@ -275,8 +286,8 @@ class l extends HTMLElement {
275
286
  o && (s = o.textContent?.trim() ?? "");
276
287
  }
277
288
  if (s) {
278
- const o = this.#g(t, s);
279
- o && d(t) ? t.textContent = this[o] : this.#r(s, t);
289
+ const o = this.#y(t, s);
290
+ o && d(t) ? t.textContent = this[o] : this.#n(s, t);
280
291
  }
281
292
  }
282
293
  }
@@ -289,7 +300,7 @@ class l extends HTMLElement {
289
300
  if (!t) {
290
301
  const n = this.getAttribute("name");
291
302
  if (n)
292
- if (this.#n("value"))
303
+ if (this.#r("value"))
293
304
  t = `value:${n}`;
294
305
  else
295
306
  return;
@@ -298,10 +309,10 @@ class l extends HTMLElement {
298
309
  }
299
310
  const e = {}, s = t.split(",");
300
311
  for (const n of s) {
301
- const [h, c] = n.split(":");
302
- e[h.trim()] = c.trim();
312
+ const [h, a] = n.split(":");
313
+ e[h.trim()] = a.trim();
303
314
  }
304
- this.#a = e, this.#i = new FormData(), this.#h = this.attachInternals(), this.#h.setFormValue(this.#i);
315
+ this.#c = e, this.#i = new FormData(), this.#h = this.attachInternals(), this.#h.setFormValue(this.#i);
305
316
  const o = Object.keys(this.#t.properties), i = this.#f;
306
317
  for (const n of o)
307
318
  i[n] = this[n];
@@ -314,60 +325,71 @@ class l extends HTMLElement {
314
325
  }
315
326
  }
316
327
  static getAttrName(t) {
317
- let e = l.#d.get(t);
318
- return e || (e = t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), l.#d.set(t, e)), e;
328
+ let e = u.#d.get(t);
329
+ return e || (e = t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), u.#d.set(t, e)), e;
319
330
  }
320
331
  static getPropName(t) {
321
- let e = l.#p.get(t);
322
- return e || (e = t.replace(/-([a-z])/g, (s, o) => o.toUpperCase()), l.#p.set(t, e)), e;
332
+ let e = u.#p.get(t);
333
+ return e || (e = t.replace(/-([a-z])/g, (s, o) => o.toUpperCase()), u.#p.set(t, e)), e;
323
334
  }
324
335
  #N(t, e, s) {
325
336
  if (s.length !== 1) return;
326
337
  const [o] = s;
327
338
  if (!A.test(o)) return;
328
- const i = v(t) || d(t);
339
+ const i = R(t) || d(t);
329
340
  let [n, h] = (e ?? "").split(":");
330
341
  if (!(i && n === "value" || d(t))) return;
331
342
  h ? t["on" + h] === void 0 && this.#e(t, e, "refers to an unsupported event name") : h = "change";
332
- const f = E(o);
333
- t.addEventListener(h, (a) => {
334
- const { target: u } = a;
335
- if (!u) return;
336
- const p = u.value, { type: g } = this.#t.properties[f];
337
- this[f] = g === Number ? C(p) : p, this.#E(f);
343
+ const f = g(o);
344
+ t.addEventListener(h, (c) => {
345
+ const { target: l } = c;
346
+ if (!l) return;
347
+ const p = l.value, { type: y } = this.#t.properties[f];
348
+ this[f] = y === Number ? S(p) : p, this.#g(f);
338
349
  });
339
350
  }
340
- #n(t) {
351
+ #r(t) {
341
352
  return !!this.#t.properties[t];
342
353
  }
343
354
  #b(t) {
344
355
  const e = Array.from(t.querySelectorAll("*"));
345
356
  for (const s of e)
346
- this.#R(s), s.firstElementChild || this.#P(s);
357
+ this.#M(s), s.firstElementChild || this.#P(s);
358
+ }
359
+ #$(t) {
360
+ const e = t.cssRules || t.rules;
361
+ for (const s of Array.from(e))
362
+ if (s instanceof CSSStyleRule) {
363
+ for (const o of Array.from(s.style))
364
+ if (o.startsWith("--")) {
365
+ const i = s.style.getPropertyValue(o);
366
+ this.#n(i, s, o);
367
+ }
368
+ }
347
369
  }
348
370
  static get observedAttributes() {
349
- const t = Object.keys(this.properties || {}).map(l.getAttrName);
371
+ const t = Object.keys(this.properties || {}).map(u.getAttrName);
350
372
  return t.includes("disabled") || t.push("disabled"), t;
351
373
  }
352
374
  // Subclasses can override this to add functionality.
353
375
  propertyChangedCallback(t, e, s) {
354
376
  }
355
- #g(t, e) {
377
+ #y(t, e) {
356
378
  if (!e || !A.test(e)) return;
357
- const s = E(e);
358
- return this[s] === void 0 && this.#c(t, "", s), s;
379
+ const s = g(e);
380
+ return this[s] === void 0 && this.#a(t, "", s), s;
359
381
  }
360
- #E(t) {
382
+ #g(t) {
361
383
  const o = this.#t.propToExprsMap.get(t) || [];
362
384
  for (const i of o) {
363
385
  let n = this.#o(i);
364
386
  const h = this.#s.get(i) ?? [];
365
- for (const c of h)
366
- if (c instanceof HTMLElement)
367
- this.#C(c, n);
368
- else if (!(c instanceof CSSStyleRule)) {
369
- const { element: f, attrName: a } = c;
370
- f instanceof CSSStyleRule ? f.style.setProperty(a, n) : T(f, a, n);
387
+ for (const a of h)
388
+ if (a instanceof HTMLElement)
389
+ this.#S(a, n);
390
+ else if (!(a instanceof CSSStyleRule)) {
391
+ const { element: f, attrName: c } = a;
392
+ f instanceof CSSStyleRule ? f.style.setProperty(c, n) : C(f, c, n);
371
393
  }
372
394
  }
373
395
  }
@@ -375,51 +397,51 @@ class l extends HTMLElement {
375
397
  const t = this.elementName();
376
398
  customElements.get(t) || customElements.define(t, this);
377
399
  }
378
- #$(t, e) {
400
+ #x(t, e) {
379
401
  const { computed: s, uses: o } = e, i = this.#t.propToComputedMap;
380
- function n(c, f) {
381
- let a = i.get(c);
382
- a || (a = [], i.set(c, a)), a.push([t, f]);
402
+ function n(a, f) {
403
+ let c = i.get(a);
404
+ c || (c = [], i.set(a, c)), c.push([t, f]);
383
405
  }
384
- const h = s.match(y) || [];
385
- for (const c of h) {
386
- const f = c.substring($);
387
- this[f] === void 0 && this.#c(null, t, f), typeof this[f] != "function" && n(f, s);
406
+ const h = s.match(E) || [];
407
+ for (const a of h) {
408
+ const f = a.substring($);
409
+ this[f] === void 0 && this.#a(null, t, f), typeof this[f] != "function" && n(f, s);
388
410
  }
389
411
  if (o)
390
- for (const c of o.split(","))
391
- n(c, s);
412
+ for (const a of o.split(","))
413
+ n(a, s);
392
414
  }
393
415
  // WARNING: Do not place untrusted JavaScript expressions
394
416
  // in attribute values or the text content of elements!
395
- #r(t, e, s = void 0) {
417
+ #n(t, e, s = void 0) {
396
418
  if (!t) return;
397
- const o = this.#l(e, s, t);
419
+ const o = this.#u(e, s, t);
398
420
  if (!o) {
399
- const c = t.replaceAll("this..", "this.");
400
- s ? T(e, s, c) : "textContent" in e && (e.textContent = c);
421
+ const a = t.replaceAll("this..", "this.");
422
+ s ? C(e, s, a) : "textContent" in e && (e.textContent = a);
401
423
  return;
402
424
  }
403
425
  const i = this.#t;
404
- o.forEach((c) => {
405
- const f = E(c);
426
+ o.forEach((a) => {
427
+ const f = g(a);
406
428
  if (typeof this[f] == "function") return;
407
- const a = i.propToExprsMap;
408
- let u = a.get(f);
409
- u || (u = [], a.set(f, u)), u.includes(t) || u.push(t);
429
+ const c = i.propToExprsMap;
430
+ let l = c.get(f);
431
+ l || (l = [], c.set(f, l)), l.includes(t) || l.push(t);
410
432
  });
411
- for (const [c, f] of this.#s.entries())
412
- for (const a of f) {
413
- const u = a instanceof HTMLElement || a instanceof CSSStyleRule ? a : a.element;
414
- u instanceof CSSStyleRule || u.isConnected || this.#s.set(
415
- c,
416
- f.filter((p) => p !== a)
433
+ for (const [a, f] of this.#s.entries())
434
+ for (const c of f) {
435
+ const l = c instanceof HTMLElement || c instanceof CSSStyleRule ? c : c.element;
436
+ l instanceof CSSStyleRule || l.isConnected || this.#s.set(
437
+ a,
438
+ f.filter((p) => p !== c)
417
439
  );
418
440
  }
419
441
  let n = this.#s.get(t);
420
442
  n || (n = [], this.#s.set(t, n)), n.push(s ? { element: e, attrName: s } : e), e instanceof HTMLElement && this.#N(e, s, o);
421
443
  const h = this.#o(t);
422
- s ? T(e, s, h) : this.#C(e, h);
444
+ s ? C(e, s, h) : this.#S(e, h);
423
445
  }
424
446
  // This follows the best practice
425
447
  // "Do not override author-set, global attributes."
@@ -427,7 +449,7 @@ class l extends HTMLElement {
427
449
  this.hasAttribute(t) || this.setAttribute(t, e);
428
450
  }
429
451
  setFormValue(t, e) {
430
- !this.#i || !S(e) || (this.#i.set(t, e), this.#h?.setFormValue(this.#i));
452
+ !this.#i || !T(e) || (this.#i.set(t, e), this.#h?.setFormValue(this.#i));
431
453
  }
432
454
  #e(t, e, s) {
433
455
  const o = this.#t, i = t instanceof HTMLElement ? t.localName : "CSS rule";
@@ -435,17 +457,17 @@ class l extends HTMLElement {
435
457
  `component ${o.elementName()}` + (t ? `, element "${i}"` : "") + (e ? `, attribute "${e}"` : "") + ` ${s}`
436
458
  );
437
459
  }
438
- #c(t, e, s) {
460
+ #a(t, e, s) {
439
461
  this.#e(t, e, `refers to missing property "${s}"`);
440
462
  }
441
463
  #A(t, e) {
442
- return this.#y(t, this.getAttribute(e));
464
+ return this.#E(t, this.getAttribute(e));
443
465
  }
444
- #y(t, e) {
445
- if (e?.match(y)) return e;
466
+ #E(t, e) {
467
+ if (e?.match(E)) return e;
446
468
  const s = this.#t, { type: o } = s.properties[t];
447
469
  if (o || this.#e(null, t, "does not specify its type"), o === String) return e;
448
- if (o === Number) return C(e);
470
+ if (o === Number) return S(e);
449
471
  if (o === Boolean)
450
472
  return e === "true" ? !0 : e === "false" || e === "null" ? !1 : (e && e !== t && this.#e(
451
473
  null,
@@ -455,32 +477,32 @@ class l extends HTMLElement {
455
477
  }
456
478
  // Updates the matching attribute for a property if there is one.
457
479
  // VS Code thinks this is never called, but it is called by #defineProp.
458
- #x(t, e, s, o) {
459
- if (S(s) && this.hasAttribute(o)) {
480
+ #L(t, e, s, o) {
481
+ if (T(s) && this.hasAttribute(o)) {
460
482
  const i = e === Boolean ? this.hasAttribute(o) : this.#A(t, o);
461
- s !== i && H(this, t, s);
483
+ s !== i && k(this, t, s);
462
484
  }
463
485
  }
464
486
  // Updates all computed properties that reference this property.
465
487
  // VS Code thinks this is never called, but it is called by #defineProp.
466
- #L(t) {
488
+ #k(t) {
467
489
  const s = this.#t.propToComputedMap.get(t) || [];
468
490
  for (const [o, i] of s)
469
491
  this[o] = this.#o(i);
470
492
  }
471
- #C(t, e) {
493
+ #S(t, e) {
472
494
  if (e === void 0) return;
473
495
  const s = t instanceof HTMLElement, o = typeof e;
474
496
  o !== "string" && o !== "number" && this.#e(
475
497
  t,
476
498
  void 0,
477
499
  " computed content is not a string or number"
478
- ), t instanceof HTMLElement && d(t) ? t.value = e : s && o === "string" && e.trim().startsWith("<") ? (t.innerHTML = e, this.#T(t), this.#b(t)) : s && (t.textContent = e);
500
+ ), t instanceof HTMLElement && d(t) ? t.value = e : s && o === "string" && e.trim().startsWith("<") ? (t.innerHTML = e, this.#C(t), this.#b(t)) : s && (t.textContent = e);
479
501
  }
480
502
  // Update corresponding parent web component property if bound to one.
481
503
  // VS Code thinks this is never called, but it is called by #defineProp.
482
504
  #H(t, e) {
483
- const s = this.#u.get(t);
505
+ const s = this.#l.get(t);
484
506
  if (!s) return;
485
507
  const o = this.getRootNode();
486
508
  if (!(o instanceof ShadowRoot)) return;
@@ -500,10 +522,10 @@ class l extends HTMLElement {
500
522
  for (const s of Object.keys(t))
501
523
  e[s] = s;
502
524
  }
503
- this.#k(t, e);
525
+ this.#F(t, e);
504
526
  for (const [s, o] of Object.entries(e))
505
- if (this.#n(o)) {
506
- const i = R(t, s);
527
+ if (this.#r(o)) {
528
+ const i = M(t, s);
507
529
  i !== void 0 && (this[o] = i);
508
530
  const n = this.#t.properties[o];
509
531
  n.state = t, n.stateProp = s;
@@ -513,7 +535,7 @@ class l extends HTMLElement {
513
535
  #O() {
514
536
  const t = this.#t, e = new Set(Object.keys(t.properties));
515
537
  for (const o of e)
516
- V.has(o) && this.#e(
538
+ _.has(o) && this.#e(
517
539
  null,
518
540
  "",
519
541
  `property "${o}" is not allowed because it is a reserved attribute`
@@ -528,7 +550,7 @@ class l extends HTMLElement {
528
550
  );
529
551
  continue;
530
552
  }
531
- if (!e.has(l.getPropName(o))) {
553
+ if (!e.has(u.getPropName(o))) {
532
554
  if (o === "name") {
533
555
  if (t.formAssociated) continue;
534
556
  throw new m(
@@ -539,20 +561,20 @@ class l extends HTMLElement {
539
561
  }
540
562
  }
541
563
  }
542
- #l(t, e, s) {
543
- const o = s.match(y);
564
+ #u(t, e, s) {
565
+ const o = s.match(E);
544
566
  if (o)
545
567
  return o.forEach((i) => {
546
- const n = E(i);
547
- this[n] === void 0 && this.#c(t, e, n);
568
+ const n = g(i);
569
+ this[n] === void 0 && this.#a(t, e, n);
548
570
  }), o;
549
571
  }
550
- #k(t, e) {
572
+ #F(t, e) {
551
573
  for (const [s, o] of Object.entries(e)) {
552
- let i = R(t, s);
574
+ let i = M(t, s);
553
575
  if (i === void 0)
554
576
  throw new m(`invalid state path "${s}"`);
555
- i = this[o], this.#n(o) || this.#e(
577
+ i = this[o], this.#r(o) || this.#e(
556
578
  null,
557
579
  o,
558
580
  "refers to missing property in useState map"
@@ -560,7 +582,7 @@ class l extends HTMLElement {
560
582
  }
561
583
  }
562
584
  // When type is an array, this can't validate the type of the array elements.
563
- #F(t, e, s) {
585
+ #j(t, e, s) {
564
586
  if (s instanceof e) return;
565
587
  let o = typeof s;
566
588
  if (o === "object") {
@@ -577,7 +599,7 @@ class l extends HTMLElement {
577
599
  `was set to a ${o}, but must be a ${e.name}`
578
600
  );
579
601
  }
580
- #T(t) {
602
+ #C(t) {
581
603
  const e = Array.from(t.querySelectorAll("*"));
582
604
  for (const s of e) {
583
605
  const o = [];
@@ -586,10 +608,10 @@ class l extends HTMLElement {
586
608
  if (n.startsWith("on")) {
587
609
  let h = n.slice(2);
588
610
  h = h[0].toLowerCase() + h.slice(1).toLowerCase();
589
- const c = i.value;
590
- this.#l(s, n, c);
611
+ const a = i.value;
612
+ this.#u(s, n, a);
591
613
  let f;
592
- typeof this[c] == "function" ? f = (a) => this[c](a) : (this.#l(s, n, c), f = () => this.#o(c)), s.addEventListener(h, f), o.push(n);
614
+ typeof this[a] == "function" ? f = (c) => this[a](c) : (this.#u(s, n, a), f = () => this.#o(a)), s.addEventListener(h, f), o.push(n);
593
615
  }
594
616
  }
595
617
  for (const i of o)
@@ -600,7 +622,7 @@ class l extends HTMLElement {
600
622
  function z(r, ...t) {
601
623
  let e = x(r, t);
602
624
  for (; ; ) {
603
- const s = k.exec(e);
625
+ const s = O.exec(e);
604
626
  if (!s) break;
605
627
  const o = s[2];
606
628
  if (N.test(o)) {
@@ -617,7 +639,7 @@ function z(r, ...t) {
617
639
  function Z(r, ...t) {
618
640
  let e = x(r, t);
619
641
  for (; ; ) {
620
- const s = _.exec(e);
642
+ const s = V.exec(e);
621
643
  if (!s || s[1] === "style") break;
622
644
  const o = B(s[2]);
623
645
  if (N.test(o)) {
@@ -628,7 +650,7 @@ function Z(r, ...t) {
628
650
  return e;
629
651
  }
630
652
  export {
631
- l as Wrec,
653
+ u as Wrec,
632
654
  q as createElement,
633
655
  z as css,
634
656
  Z as html
package/dist/wrec.js CHANGED
@@ -193,6 +193,7 @@ export class Wrec extends HTMLElement {
193
193
  // This map cannot be private.
194
194
  //static propToExprsMap: Map<string, string[]> | null = null;
195
195
  static propToExprsMap;
196
+ static stylesheet = null;
196
197
  static template = null;
197
198
  #ctor = this.constructor;
198
199
  // This is a map from expressions to references to them
@@ -244,20 +245,26 @@ export class Wrec extends HTMLElement {
244
245
  }
245
246
  }
246
247
  #buildDOM() {
248
+ if (!this.shadowRoot)
249
+ return;
247
250
  const ctor = this.#ctor;
251
+ if (ctor.css) {
252
+ let stylesheet = ctor.stylesheet;
253
+ if (!stylesheet) {
254
+ stylesheet = ctor.stylesheet = new CSSStyleSheet();
255
+ // Include a CSS rule that respects the "hidden" attribute.
256
+ // This is a web.dev custom element best practice.
257
+ const css = `:host([hidden]) { display: none; } ${ctor.css}`;
258
+ stylesheet.replaceSync(css);
259
+ }
260
+ this.shadowRoot.adoptedStyleSheets = [stylesheet];
261
+ }
248
262
  let template = ctor.template;
249
263
  if (!template) {
250
264
  template = ctor.template = document.createElement('template');
251
- // Include a CSS rule that respects the "hidden" attribute.
252
- // This is a web.dev custom element best practice.
253
- let text = '<style> :host([hidden]) { display: none; } ';
254
- if (ctor.css)
255
- text += ctor.css;
256
- text += '</style>';
257
- text += ctor.html;
258
- template.innerHTML = text;
265
+ template.innerHTML = ctor.html;
259
266
  }
260
- this.shadowRoot?.replaceChildren(template.content.cloneNode(true));
267
+ this.shadowRoot.replaceChildren(template.content.cloneNode(true));
261
268
  }
262
269
  changed(statePath, componentProp, newValue) {
263
270
  this[componentProp] = newValue;
@@ -273,6 +280,9 @@ export class Wrec extends HTMLElement {
273
280
  if (this.shadowRoot) {
274
281
  this.#wireEvents(this.shadowRoot);
275
282
  this.#makeReactive(this.shadowRoot);
283
+ for (const styleSheet of this.shadowRoot.adoptedStyleSheets) {
284
+ this.#makeReactiveStyleSheet(styleSheet);
285
+ }
276
286
  }
277
287
  this.#computeProps();
278
288
  });
@@ -603,6 +613,19 @@ export class Wrec extends HTMLElement {
603
613
  }
604
614
  */
605
615
  }
616
+ #makeReactiveStyleSheet(styleSheet) {
617
+ const rules = styleSheet.cssRules || styleSheet.rules;
618
+ for (const rule of Array.from(rules)) {
619
+ if (rule instanceof CSSStyleRule) {
620
+ for (const prop of Array.from(rule.style)) {
621
+ if (prop.startsWith('--')) {
622
+ const value = rule.style.getPropertyValue(prop);
623
+ this.#registerPlaceholders(value, rule, prop);
624
+ }
625
+ }
626
+ }
627
+ }
628
+ }
606
629
  static get observedAttributes() {
607
630
  const keys = Object.keys(this.properties || {}).map(Wrec.getAttrName);
608
631
  if (!keys.includes('disabled'))
@@ -656,6 +679,7 @@ export class Wrec extends HTMLElement {
656
679
  static register() {
657
680
  const elementName = this.elementName();
658
681
  if (!customElements.get(elementName)) {
682
+ // "as any" is needed here because Wrec is an abstract class.
659
683
  customElements.define(elementName, this);
660
684
  }
661
685
  }
package/dist/wrec.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"wrec.js","sourceRoot":"","sources":["../src/wrec.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,YAAY,CAAC;AActD,MAAM,SAAU,SAAQ,KAAK;CAAG;AAEhC,MAAM,eAAe,GAAG,8BAA8B,CAAC;AACvD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,setPathValue}from"./paths.js";class WrecError extends Error{}const CSS_PROPERTY_RE=/([a-zA-Z-]+)\s*:\s*([^;}]+)/g,FIRST_CHAR="a-zA-Z_$",OTHER_CHAR="a-zA-Z_$0-9",IDENTIFIER=`[a-zA-Z_$][${OTHER_CHAR}]*`,HTML_COMMENT_TEXT_RE=/<!--\s*(.*?)\s*-->/,HTML_ELEMENT_TEXT_RE=/<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g,REF_RE=new RegExp(`^this\\.${IDENTIFIER}$`),REFS_RE=new RegExp(`this\\.${IDENTIFIER}(\\.${IDENTIFIER})*`,"g"),REFS_TEST_RE=new RegExp(`this\\.${IDENTIFIER}(\\.${IDENTIFIER})*`),RESERVED_ATTRS=new Set(["class","style"]),SKIP=5;function canDisable(t){return t instanceof HTMLButtonElement||t instanceof HTMLFieldSetElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof Wrec}export function createElement(t,e,s){const r=document.createElement(t);if(e)for(const[t,s]of Object.entries(e))r.setAttribute(t,s);return s&&(r.innerHTML=s),r}const defaultForType=t=>t===String?"":t===Number?0:t!==Boolean&&(t===Array?[]:t===Object?{}:void 0);function getAllDescendants(t){const e=[];let s=t.firstElementChild;for(;s;)e.push(s),s.shadowRoot&&e.push(...getAllDescendants(s.shadowRoot)),s.firstElementChild&&e.push(...getAllDescendants(s)),s=s.nextElementSibling;return e}function getElementById(t,e){if(t.id===e)return t;const{shadowRoot:s}=t;if(s)for(const t of Array.from(s.children)){const s=getElementById(t,e);if(s)return s}for(const s of Array.from(t.children)){const t=getElementById(s,e);if(t)return t}return null}const getPropName=t=>t.substring(5).split(".")[0];function interpolate(t,e){let s=t[0];return e.forEach((e,r)=>{s+=e+t[r+1]}),s}function isPrimitive(t){const e=typeof t;return"string"===e||"number"===e||"boolean"===e}function isTextArea(t){return"textarea"===t.localName}function isValueElement(t){const{localName:e}=t;return"input"===e||"select"===e}const removeHtmlComments=t=>t.replace(/<!--[\s\S]*?-->/g,"");function replace(t,e,s,r){return t.slice(0,e)+r+t.slice(e+s)}function stringToNumber(t){const e=Number(t);if(isNaN(e))throw new WrecError(`can't convert "${t}" to a number`);return e}function updateAttribute(t,e,s){const[r,o]=e.split(":");if(isPrimitive(s))if("boolean"==typeof s){s?t.setAttribute(r,r):t.removeAttribute(r);t[Wrec.getPropName(r)]=s}else{const o=t.getAttribute(e),i=String(s);o!==i&&(t.setAttribute(r,i),"value"===r&&isValueElement(t)&&(t.value=i))}else{t[Wrec.getPropName(e)]=s}}function updateValue(t,e,s){const[r,o]=e.split(":");t instanceof CSSRule?t.style.setProperty(r,s):(updateAttribute(t,r,s),"value"===r&&isValueElement(t)&&(t.value=s))}export class Wrec extends HTMLElement{static#t=new Map;static#e=new Map;static css="";static formAssociated=!1;static html="";static properties;static propToComputedMap;static propToExprsMap;static template=null;#s=this.constructor;#r=new Map;#o={};#i;#n={};#a=null;#c=new Map;constructor(){super(),this.attachShadow({mode:"open"});const t=this.#s;t.properties||(t.properties={}),t.propToComputedMap||(t.propToComputedMap=new Map),t.propToExprsMap||(t.propToExprsMap=new Map)}attributeChangedCallback(t,e,s){"disabled"===t&&this.#l();const r=Wrec.getPropName(t);if(this.#p(r)){const t=this.#h(r,String(s));this[r]=t;const o=this.#o[r];o&&this.setFormValue(o,String(t)),this.propertyChangedCallback(r,e,s)}}#u(){const t=this.#s;let e=t.template;if(!e){e=t.template=document.createElement("template");let s="<style> :host([hidden]) { display: none; } ";t.css&&(s+=t.css),s+="</style>",s+=t.html,e.innerHTML=s}this.shadowRoot?.replaceChildren(e.content.cloneNode(!0))}changed(t,e,s){this[e]=s}connectedCallback(){this.#f(),this.#d(),this.#u(),this.hasAttribute("disabled")&&this.#l(),requestAnimationFrame(()=>{this.shadowRoot&&(this.#m(this.shadowRoot),this.#E(this.shadowRoot)),this.#b()})}#b(){const t=this.#s,{properties:e}=t;for(const[t,{computed:s}]of Object.entries(e))s&&(this[t]=this.#g(s))}#d(){const t=this.#s,{observedAttributes:e,properties:s}=t;for(const[t,r]of Object.entries(s))this.#y(t,r,e)}#y(t,e,s){const r=Wrec.getAttrName(t),o=this.hasAttribute(r);e.required&&!o&&this.#T(this,t,"is a required attribute");let i=e.value;this.hasOwnProperty(t)&&(i=this[t],delete this[t]);const{type:n}=e,a=n===Boolean?i||o:s.includes(r)&&o?this.#R(t,r):i||defaultForType(n),c="#"+t;this[c]=a,e.computed&&this.#w(t,e),Object.defineProperty(this,t,{enumerable:!0,get(){return this[c]},set(s){n===Number&&"string"==typeof s&&(s=stringToNumber(s));const o=this[c];if(s===o)return;this.#A(t,n,s),this[c]=s;const{state:i,stateProp:a}=this.#s.properties[t];a&&setPathValue(i,a,s),this.#v(t),this.#M(t,n,s,r),this.#S(t),this.#P(t,s);const l=this.#o[t];l&&this.setFormValue(l,String(s)),this.propertyChangedCallback(t,o,s),e.dispatch&&this.dispatch("change",{[t]:s})}})}#l(){const t=this.hasAttribute("disabled"),e=getAllDescendants(this.shadowRoot);for(const s of e)canDisable(s)&&(s.disabled=t)}disconnectedCallback(){this.#r.clear(),this.#n.clear(),this.#c.clear()}dispatch(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}displayIfSet(t,e="block"){return`display: ${t?e:"none"}`}static elementName(){return this.name.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}#x(t){const e=t instanceof Wrec;for(const s of t.getAttributeNames()){const r=t.getAttribute(s),o=this.#C(t,r);if(o){const r=this[o];void 0===r&&this.#N(t,s,o),t[o]=r;let[i,n]=s.split(":");if("value"===i)if(n){if(void 0===t["on"+n]){const e="refers to an unsupported event name";this.#T(t,s,e)}t.setAttribute(i,this[o])}else n="change";e&&t.#c.set(Wrec.getPropName(i),o)}this.#I(r,t,s)}}#g(t){const e=new Function("return "+t).call(this);return Array.isArray(e)?e.join(""):e}#_(t){const{localName:e}=t;if("style"===e){const{sheet:e}=t,s=e?.cssRules??[],r=Array.from(s);for(const t of r)if(t.constructor===CSSStyleRule){const e=Array.from(t.style);for(const s of e)if(s.startsWith("--")){const e=t.style.getPropertyValue(s);this.#I(e,t,s)}}}else{let e="";if(isTextArea(t)){this.#I(t.textContent,t);const s=t.textContent?.match(HTML_COMMENT_TEXT_RE);s&&(e=s[1])}else{const s=Array.from(t.childNodes).find(t=>t.nodeType===Node.COMMENT_NODE);s&&(e=s.textContent?.trim()??"")}if(e){const s=this.#C(t,e);s&&isTextArea(t)?t.textContent=this[s]:this.#I(e,t)}}}formAssociatedCallback(){let t=this.getAttribute("form-assoc");if(!t){const e=this.getAttribute("name");if(!e)return;if(!this.#p("value"))return;t=`value:${e}`}const e={},s=t.split(",");for(const t of s){const[s,r]=t.split(":");e[s.trim()]=r.trim()}this.#o=e,this.#i=new FormData,this.#a=this.attachInternals(),this.#a.setFormValue(this.#i);const r=Object.keys(this.#s.properties),o=this.#n;for(const t of r)o[t]=this[t]}formResetCallback(){const t=this.#n;for(const e of Object.keys(t)){let s=t[e];REF_RE.test(s)&&(s=this.#g(s)),this[e]=s}}static getAttrName(t){let e=Wrec.#e.get(t);return e||(e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wrec.#e.set(t,e)),e}static getPropName(t){let e=Wrec.#t.get(t);return e||(e=t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()),Wrec.#t.set(t,e)),e}#O(t,e,s){if(1!==s.length)return;const[r]=s;if(!REF_RE.test(r))return;const o=isValueElement(t)||isTextArea(t);let[i,n]=(e??"").split(":");if(!(o&&"value"===i||isTextArea(t)))return;if(n){if(void 0===t["on"+n]){const s="refers to an unsupported event name";this.#T(t,e,s)}}else n="change";const a=getPropName(r);t.addEventListener(n,t=>{const{target:e}=t;if(!e)return;const s=e.value,{type:r}=this.#s.properties[a];this[a]=r===Number?stringToNumber(s):s,this.#S(a)})}#p(t){return Boolean(this.#s.properties[t])}#E(t){const e=Array.from(t.querySelectorAll("*"));for(const t of e)this.#x(t),t.firstElementChild||this.#_(t)}static get observedAttributes(){const t=Object.keys(this.properties||{}).map(Wrec.getAttrName);return t.includes("disabled")||t.push("disabled"),t}propertyChangedCallback(t,e,s){}#C(t,e){if(!e||!REF_RE.test(e))return;const s=getPropName(e);return void 0===this[s]&&this.#N(t,"",s),s}#S(t){const e=this.#s.propToExprsMap.get(t)||[];for(const t of e){let e=this.#g(t);const s=this.#r.get(t)??[];for(const t of s)if(t instanceof HTMLElement)this.#$(t,e);else if(t instanceof CSSStyleRule);else{const{element:s,attrName:r}=t;s instanceof CSSStyleRule?s.style.setProperty(r,e):updateValue(s,r,e)}}}static register(){const t=this.elementName();customElements.get(t)||customElements.define(t,this)}#w(t,e){const{computed:s,uses:r}=e,o=this.#s.propToComputedMap;function i(e,s){let r=o.get(e);r||(r=[],o.set(e,r)),r.push([t,s])}const n=s.match(REFS_RE)||[];for(const e of n){const r=e.substring(5);void 0===this[r]&&this.#N(null,t,r),"function"!=typeof this[r]&&i(r,s)}if(r)for(const t of r.split(","))i(t,s)}#I(t,e,s=void 0){if(!t)return;const r=this.#W(e,s,t);if(!r){const r=t.replaceAll("this..","this.");return void(s?updateValue(e,s,r):"textContent"in e&&(e.textContent=r))}const o=this.#s;r.forEach(e=>{const s=getPropName(e);if("function"==typeof this[s])return;const r=o.propToExprsMap;let i=r.get(s);i||(i=[],r.set(s,i)),i.includes(t)||i.push(t)});for(const[t,e]of this.#r.entries())for(const s of e){const r=s instanceof HTMLElement||s instanceof CSSStyleRule?s:s.element;r instanceof CSSStyleRule||(r.isConnected||this.#r.set(t,e.filter(t=>t!==s)))}let i=this.#r.get(t);i||(i=[],this.#r.set(t,i)),i.push(s?{element:e,attrName:s}:e),e instanceof HTMLElement&&this.#O(e,s,r);const n=this.#g(t);s?updateValue(e,s,n):this.#$(e,n)}setAttributeSafe(t,e){this.hasAttribute(t)||this.setAttribute(t,e)}setFormValue(t,e){this.#i&&isPrimitive(e)&&(this.#i.set(t,e),this.#a?.setFormValue(this.#i))}#T(t,e,s){const r=this.#s,o=t instanceof HTMLElement?t.localName:"CSS rule";throw new WrecError(`component ${r.elementName()}`+(t?`, element "${o}"`:"")+(e?`, attribute "${e}"`:"")+` ${s}`)}#N(t,e,s){this.#T(t,e,`refers to missing property "${s}"`)}#R(t,e){return this.#h(t,this.getAttribute(e))}#h(t,e){if(e?.match(REFS_RE))return e;const s=this.#s,{type:r}=s.properties[t];return r||this.#T(null,t,"does not specify its type"),r===String?e:r===Number?stringToNumber(e):r===Boolean?"true"===e||"false"!==e&&"null"!==e&&(e&&e!==t&&this.#T(null,t,"is a Boolean attribute, so its value must match attribute name or be missing"),e===t):void 0}#M(t,e,s,r){if(isPrimitive(s)&&this.hasAttribute(r)){s!==(e===Boolean?this.hasAttribute(r):this.#R(t,r))&&updateAttribute(this,t,s)}}#v(t){const e=this.#s.propToComputedMap.get(t)||[];for(const[t,s]of e)this[t]=this.#g(s)}#$(t,e){if(void 0===e)return;const s=t instanceof HTMLElement,r=typeof e;"string"!==r&&"number"!==r&&this.#T(t,void 0," computed content is not a string or number"),t instanceof HTMLElement&&isTextArea(t)?t.value=e:s&&"string"===r&&e.trim().startsWith("<")?(t.innerHTML=e,this.#m(t),this.#E(t)):s&&(t.textContent=e)}#P(t,e){const s=this.#c.get(t);if(!s)return;const r=this.getRootNode();if(!(r instanceof ShadowRoot))return;const{host:o}=r;if(!o)return;o[s]=e}useState(t,e){if(!e){e={};for(const s of Object.keys(t))e[s]=s}this.#H(t,e);for(const[s,r]of Object.entries(e))if(this.#p(r)){const e=getPathValue(t,s);void 0!==e&&(this[r]=e);const o=this.#s.properties[r];o.state=t,o.stateProp=s}t.addListener(this,e)}#f(){const t=this.#s,e=new Set(Object.keys(t.properties));for(const t of e)RESERVED_ATTRS.has(t)&&this.#T(null,"",`property "${t}" is not allowed because it is a reserved attribute`);const s=this.#s.name;for(const r of this.getAttributeNames())if("class"!==r&&"id"!==r&&"disabled"!==r&&!r.startsWith("on"))if("form-assoc"!==r){if(!e.has(Wrec.getPropName(r))){if("name"===r){if(t.formAssociated)continue;throw new WrecError(`name attribute requires "static formAssociated = true;" in class ${s}`)}this.#T(null,r,"is not a supported attribute")}}else if(!t.formAssociated)throw new WrecError(`add "static formAssociated = true;" to class ${s}`)}#W(t,e,s){const r=s.match(REFS_RE);if(r)return r.forEach(s=>{const r=getPropName(s);void 0===this[r]&&this.#N(t,e,r)}),r}#H(t,e){for(const[s,r]of Object.entries(e)){let e=getPathValue(t,s);if(void 0===e)throw new WrecError(`invalid state path "${s}"`);e=this[r],this.#p(r)||this.#T(null,r,"refers to missing property in useState map")}}#A(t,e,s){if(s instanceof e)return;let r=typeof s;if("object"===r){const{constructor:o}=s;r=o.name,o!==e&&this.#T(null,t,`was set to a ${r}, but must be a ${e.name}`)}r!==e.name.toLowerCase()&&this.#T(null,t,`was set to a ${r}, but must be a ${e.name}`)}#m(t){const e=Array.from(t.querySelectorAll("*"));for(const t of e){const e=[];for(const s of Array.from(t.attributes)){const r=s.name;if(r.startsWith("on")){let o=r.slice(2);o=o[0].toLowerCase()+o.slice(1).toLowerCase();const i=s.value;let n;this.#W(t,r,i),"function"==typeof this[i]?n=t=>this[i](t):(this.#W(t,r,i),n=()=>this.#g(i)),t.addEventListener(o,n),e.push(r)}}for(const s of e)t.removeAttribute(s)}}}export function css(t,...e){let s=interpolate(t,e);for(;;){const t=CSS_PROPERTY_RE.exec(s);if(!t)break;const e=t[2];if(REFS_TEST_RE.test(e)){const r=t[1];if(!r.startsWith("--")){const o=`--${r}: ${e};\n ${r}: var(--${r});`;s=replace(s,t.index,t[0].length,o)}}}return s}export function html(t,...e){let s=interpolate(t,e);for(;;){const t=HTML_ELEMENT_TEXT_RE.exec(s);if(!t||"style"===t[1])break;const e=removeHtmlComments(t[2]);if(REFS_TEST_RE.test(e)){const r=`\x3c!-- ${e.trim()} --\x3e`;s=replace(s,t.index+t[0].indexOf(">")+1,e.length,r)}}return s}import{createDeepProxy,proxyToPlainObject}from"./proxies.js";const inBrowser="undefined"!=typeof window&&void 0!==window.document;class WrecError extends Error{}export class WrecState{static#L=new Map;static{inBrowser&&window.addEventListener("beforeunload",()=>{for(const[t,e]of this.#L.entries())if(e.#F){const s=proxyToPlainObject(e);sessionStorage.setItem("wrec-state-"+t,JSON.stringify(s))}})}static get(t){return this.#L.get(t)}#V=Symbol("objectId");#D=[];#j;#F;#k;constructor(t,e,s){if(!t)throw new WrecError("name cannot be empty");if(WrecState.#L.has(t))throw new WrecError(`WrecState with name "${t}" already exists`);if(this.#j=t,this.#F=e,this.#k=createDeepProxy({},this.#B.bind(this)),e&&inBrowser){const e=sessionStorage.getItem("wrec-state-"+t),r=e?JSON.parse(e):void 0;r&&(s=r)}if(s)for(const[t,e]of Object.entries(s))this.addProperty(t,e);WrecState.#L.set(t,this)}addListener(t,e={}){const s=this.#D.find(e=>e.listenerRef.deref()===t);if(s){const{propertyMap:t}=s;for(const[s,r]of Object.entries(e))t[s]=r}else this.#D.push({listenerRef:new WeakRef(t),propertyMap:e})}addProperty(t,e){Object.defineProperty(this,t,{enumerable:!0,get(){return this.#k[t]},set(e){this.#k[t]=e}}),this.#k[t]=e}get id(){return this.#V}log(){console.log("WrecState:",this.#j);for(const[t,e]of Object.entries(this.#k))console.log(` ${t} = ${JSON.stringify(e)}`)}#B(t,e,s){const r=new Set;for(const o of this.#D){const i=o.listenerRef.deref();if(i)if(inBrowser&&i instanceof HTMLElement&&!i.isConnected)r.add(o);else{const{propertyMap:r}=o,n=Object.keys(r);(0===n.length||n.includes(t))&&i.changed(t,r[t],s,e,this)}else r.add(o)}this.#D=this.#D.filter(t=>!r.has(t))}removeListener(t){this.#D=this.#D.filter(e=>e.listenerRef.deref()!==t)}}if(inBrowser){"development"===process.env.NODE_ENV&&(window.WrecState=WrecState)}
1
+ import{getPathValue,setPathValue}from"./paths.js";class WrecError extends Error{}const CSS_PROPERTY_RE=/([a-zA-Z-]+)\s*:\s*([^;}]+)/g,FIRST_CHAR="a-zA-Z_$",OTHER_CHAR="a-zA-Z_$0-9",IDENTIFIER=`[a-zA-Z_$][${OTHER_CHAR}]*`,HTML_COMMENT_TEXT_RE=/<!--\s*(.*?)\s*-->/,HTML_ELEMENT_TEXT_RE=/<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g,REF_RE=new RegExp(`^this\\.${IDENTIFIER}$`),REFS_RE=new RegExp(`this\\.${IDENTIFIER}(\\.${IDENTIFIER})*`,"g"),REFS_TEST_RE=new RegExp(`this\\.${IDENTIFIER}(\\.${IDENTIFIER})*`),RESERVED_ATTRS=new Set(["class","style"]),SKIP=5;function canDisable(t){return t instanceof HTMLButtonElement||t instanceof HTMLFieldSetElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof Wrec}export function createElement(t,e,s){const r=document.createElement(t);if(e)for(const[t,s]of Object.entries(e))r.setAttribute(t,s);return s&&(r.innerHTML=s),r}const defaultForType=t=>t===String?"":t===Number?0:t!==Boolean&&(t===Array?[]:t===Object?{}:void 0);function getAllDescendants(t){const e=[];let s=t.firstElementChild;for(;s;)e.push(s),s.shadowRoot&&e.push(...getAllDescendants(s.shadowRoot)),s.firstElementChild&&e.push(...getAllDescendants(s)),s=s.nextElementSibling;return e}function getElementById(t,e){if(t.id===e)return t;const{shadowRoot:s}=t;if(s)for(const t of Array.from(s.children)){const s=getElementById(t,e);if(s)return s}for(const s of Array.from(t.children)){const t=getElementById(s,e);if(t)return t}return null}const getPropName=t=>t.substring(5).split(".")[0];function interpolate(t,e){let s=t[0];return e.forEach((e,r)=>{s+=e+t[r+1]}),s}function isPrimitive(t){const e=typeof t;return"string"===e||"number"===e||"boolean"===e}function isTextArea(t){return"textarea"===t.localName}function isValueElement(t){const{localName:e}=t;return"input"===e||"select"===e}const removeHtmlComments=t=>t.replace(/<!--[\s\S]*?-->/g,"");function replace(t,e,s,r){return t.slice(0,e)+r+t.slice(e+s)}function stringToNumber(t){const e=Number(t);if(isNaN(e))throw new WrecError(`can't convert "${t}" to a number`);return e}function updateAttribute(t,e,s){const[r,o]=e.split(":");if(isPrimitive(s))if("boolean"==typeof s){s?t.setAttribute(r,r):t.removeAttribute(r);t[Wrec.getPropName(r)]=s}else{const o=t.getAttribute(e),i=String(s);o!==i&&(t.setAttribute(r,i),"value"===r&&isValueElement(t)&&(t.value=i))}else{t[Wrec.getPropName(e)]=s}}function updateValue(t,e,s){const[r,o]=e.split(":");t instanceof CSSRule?t.style.setProperty(r,s):(updateAttribute(t,r,s),"value"===r&&isValueElement(t)&&(t.value=s))}export class Wrec extends HTMLElement{static#t=new Map;static#e=new Map;static css="";static formAssociated=!1;static html="";static properties;static propToComputedMap;static propToExprsMap;static stylesheet=null;static template=null;#s=this.constructor;#r=new Map;#o={};#i;#n={};#a=null;#c=new Map;constructor(){super(),this.attachShadow({mode:"open"});const t=this.#s;t.properties||(t.properties={}),t.propToComputedMap||(t.propToComputedMap=new Map),t.propToExprsMap||(t.propToExprsMap=new Map)}attributeChangedCallback(t,e,s){"disabled"===t&&this.#l();const r=Wrec.getPropName(t);if(this.#p(r)){const t=this.#h(r,String(s));this[r]=t;const o=this.#o[r];o&&this.setFormValue(o,String(t)),this.propertyChangedCallback(r,e,s)}}#u(){if(!this.shadowRoot)return;const t=this.#s;if(t.css){let e=t.stylesheet;if(!e){e=t.stylesheet=new CSSStyleSheet;const s=`:host([hidden]) { display: none; } ${t.css}`;e.replaceSync(s)}this.shadowRoot.adoptedStyleSheets=[e]}let e=t.template;e||(e=t.template=document.createElement("template"),e.innerHTML=t.html),this.shadowRoot.replaceChildren(e.content.cloneNode(!0))}changed(t,e,s){this[e]=s}connectedCallback(){this.#f(),this.#d(),this.#u(),this.hasAttribute("disabled")&&this.#l(),requestAnimationFrame(()=>{if(this.shadowRoot){this.#m(this.shadowRoot),this.#E(this.shadowRoot);for(const t of this.shadowRoot.adoptedStyleSheets)this.#b(t)}this.#y()})}#y(){const t=this.#s,{properties:e}=t;for(const[t,{computed:s}]of Object.entries(e))s&&(this[t]=this.#g(s))}#d(){const t=this.#s,{observedAttributes:e,properties:s}=t;for(const[t,r]of Object.entries(s))this.#R(t,r,e)}#R(t,e,s){const r=Wrec.getAttrName(t),o=this.hasAttribute(r);e.required&&!o&&this.#T(this,t,"is a required attribute");let i=e.value;this.hasOwnProperty(t)&&(i=this[t],delete this[t]);const{type:n}=e,a=n===Boolean?i||o:s.includes(r)&&o?this.#w(t,r):i||defaultForType(n),c="#"+t;this[c]=a,e.computed&&this.#S(t,e),Object.defineProperty(this,t,{enumerable:!0,get(){return this[c]},set(s){n===Number&&"string"==typeof s&&(s=stringToNumber(s));const o=this[c];if(s===o)return;this.#A(t,n,s),this[c]=s;const{state:i,stateProp:a}=this.#s.properties[t];a&&setPathValue(i,a,s),this.#v(t),this.#M(t,n,s,r),this.#P(t),this.#x(t,s);const l=this.#o[t];l&&this.setFormValue(l,String(s)),this.propertyChangedCallback(t,o,s),e.dispatch&&this.dispatch("change",{[t]:s})}})}#l(){const t=this.hasAttribute("disabled"),e=getAllDescendants(this.shadowRoot);for(const s of e)canDisable(s)&&(s.disabled=t)}disconnectedCallback(){this.#r.clear(),this.#n.clear(),this.#c.clear()}dispatch(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}displayIfSet(t,e="block"){return`display: ${t?e:"none"}`}static elementName(){return this.name.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}#C(t){const e=t instanceof Wrec;for(const s of t.getAttributeNames()){const r=t.getAttribute(s),o=this.#N(t,r);if(o){const r=this[o];void 0===r&&this.#I(t,s,o),t[o]=r;let[i,n]=s.split(":");if("value"===i)if(n){if(void 0===t["on"+n]){const e="refers to an unsupported event name";this.#T(t,s,e)}t.setAttribute(i,this[o])}else n="change";e&&t.#c.set(Wrec.getPropName(i),o)}this.#_(r,t,s)}}#g(t){const e=new Function("return "+t).call(this);return Array.isArray(e)?e.join(""):e}#$(t){const{localName:e}=t;if("style"===e){const{sheet:e}=t,s=e?.cssRules??[],r=Array.from(s);for(const t of r)if(t.constructor===CSSStyleRule){const e=Array.from(t.style);for(const s of e)if(s.startsWith("--")){const e=t.style.getPropertyValue(s);this.#_(e,t,s)}}}else{let e="";if(isTextArea(t)){this.#_(t.textContent,t);const s=t.textContent?.match(HTML_COMMENT_TEXT_RE);s&&(e=s[1])}else{const s=Array.from(t.childNodes).find(t=>t.nodeType===Node.COMMENT_NODE);s&&(e=s.textContent?.trim()??"")}if(e){const s=this.#N(t,e);s&&isTextArea(t)?t.textContent=this[s]:this.#_(e,t)}}}formAssociatedCallback(){let t=this.getAttribute("form-assoc");if(!t){const e=this.getAttribute("name");if(!e)return;if(!this.#p("value"))return;t=`value:${e}`}const e={},s=t.split(",");for(const t of s){const[s,r]=t.split(":");e[s.trim()]=r.trim()}this.#o=e,this.#i=new FormData,this.#a=this.attachInternals(),this.#a.setFormValue(this.#i);const r=Object.keys(this.#s.properties),o=this.#n;for(const t of r)o[t]=this[t]}formResetCallback(){const t=this.#n;for(const e of Object.keys(t)){let s=t[e];REF_RE.test(s)&&(s=this.#g(s)),this[e]=s}}static getAttrName(t){let e=Wrec.#e.get(t);return e||(e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wrec.#e.set(t,e)),e}static getPropName(t){let e=Wrec.#t.get(t);return e||(e=t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()),Wrec.#t.set(t,e)),e}#O(t,e,s){if(1!==s.length)return;const[r]=s;if(!REF_RE.test(r))return;const o=isValueElement(t)||isTextArea(t);let[i,n]=(e??"").split(":");if(!(o&&"value"===i||isTextArea(t)))return;if(n){if(void 0===t["on"+n]){const s="refers to an unsupported event name";this.#T(t,e,s)}}else n="change";const a=getPropName(r);t.addEventListener(n,t=>{const{target:e}=t;if(!e)return;const s=e.value,{type:r}=this.#s.properties[a];this[a]=r===Number?stringToNumber(s):s,this.#P(a)})}#p(t){return Boolean(this.#s.properties[t])}#E(t){const e=Array.from(t.querySelectorAll("*"));for(const t of e)this.#C(t),t.firstElementChild||this.#$(t)}#b(t){const e=t.cssRules||t.rules;for(const t of Array.from(e))if(t instanceof CSSStyleRule)for(const e of Array.from(t.style))if(e.startsWith("--")){const s=t.style.getPropertyValue(e);this.#_(s,t,e)}}static get observedAttributes(){const t=Object.keys(this.properties||{}).map(Wrec.getAttrName);return t.includes("disabled")||t.push("disabled"),t}propertyChangedCallback(t,e,s){}#N(t,e){if(!e||!REF_RE.test(e))return;const s=getPropName(e);return void 0===this[s]&&this.#I(t,"",s),s}#P(t){const e=this.#s.propToExprsMap.get(t)||[];for(const t of e){let e=this.#g(t);const s=this.#r.get(t)??[];for(const t of s)if(t instanceof HTMLElement)this.#W(t,e);else if(t instanceof CSSStyleRule);else{const{element:s,attrName:r}=t;s instanceof CSSStyleRule?s.style.setProperty(r,e):updateValue(s,r,e)}}}static register(){const t=this.elementName();customElements.get(t)||customElements.define(t,this)}#S(t,e){const{computed:s,uses:r}=e,o=this.#s.propToComputedMap;function i(e,s){let r=o.get(e);r||(r=[],o.set(e,r)),r.push([t,s])}const n=s.match(REFS_RE)||[];for(const e of n){const r=e.substring(5);void 0===this[r]&&this.#I(null,t,r),"function"!=typeof this[r]&&i(r,s)}if(r)for(const t of r.split(","))i(t,s)}#_(t,e,s=void 0){if(!t)return;const r=this.#H(e,s,t);if(!r){const r=t.replaceAll("this..","this.");return void(s?updateValue(e,s,r):"textContent"in e&&(e.textContent=r))}const o=this.#s;r.forEach(e=>{const s=getPropName(e);if("function"==typeof this[s])return;const r=o.propToExprsMap;let i=r.get(s);i||(i=[],r.set(s,i)),i.includes(t)||i.push(t)});for(const[t,e]of this.#r.entries())for(const s of e){const r=s instanceof HTMLElement||s instanceof CSSStyleRule?s:s.element;r instanceof CSSStyleRule||(r.isConnected||this.#r.set(t,e.filter(t=>t!==s)))}let i=this.#r.get(t);i||(i=[],this.#r.set(t,i)),i.push(s?{element:e,attrName:s}:e),e instanceof HTMLElement&&this.#O(e,s,r);const n=this.#g(t);s?updateValue(e,s,n):this.#W(e,n)}setAttributeSafe(t,e){this.hasAttribute(t)||this.setAttribute(t,e)}setFormValue(t,e){this.#i&&isPrimitive(e)&&(this.#i.set(t,e),this.#a?.setFormValue(this.#i))}#T(t,e,s){const r=this.#s,o=t instanceof HTMLElement?t.localName:"CSS rule";throw new WrecError(`component ${r.elementName()}`+(t?`, element "${o}"`:"")+(e?`, attribute "${e}"`:"")+` ${s}`)}#I(t,e,s){this.#T(t,e,`refers to missing property "${s}"`)}#w(t,e){return this.#h(t,this.getAttribute(e))}#h(t,e){if(e?.match(REFS_RE))return e;const s=this.#s,{type:r}=s.properties[t];return r||this.#T(null,t,"does not specify its type"),r===String?e:r===Number?stringToNumber(e):r===Boolean?"true"===e||"false"!==e&&"null"!==e&&(e&&e!==t&&this.#T(null,t,"is a Boolean attribute, so its value must match attribute name or be missing"),e===t):void 0}#M(t,e,s,r){if(isPrimitive(s)&&this.hasAttribute(r)){s!==(e===Boolean?this.hasAttribute(r):this.#w(t,r))&&updateAttribute(this,t,s)}}#v(t){const e=this.#s.propToComputedMap.get(t)||[];for(const[t,s]of e)this[t]=this.#g(s)}#W(t,e){if(void 0===e)return;const s=t instanceof HTMLElement,r=typeof e;"string"!==r&&"number"!==r&&this.#T(t,void 0," computed content is not a string or number"),t instanceof HTMLElement&&isTextArea(t)?t.value=e:s&&"string"===r&&e.trim().startsWith("<")?(t.innerHTML=e,this.#m(t),this.#E(t)):s&&(t.textContent=e)}#x(t,e){const s=this.#c.get(t);if(!s)return;const r=this.getRootNode();if(!(r instanceof ShadowRoot))return;const{host:o}=r;if(!o)return;o[s]=e}useState(t,e){if(!e){e={};for(const s of Object.keys(t))e[s]=s}this.#L(t,e);for(const[s,r]of Object.entries(e))if(this.#p(r)){const e=getPathValue(t,s);void 0!==e&&(this[r]=e);const o=this.#s.properties[r];o.state=t,o.stateProp=s}t.addListener(this,e)}#f(){const t=this.#s,e=new Set(Object.keys(t.properties));for(const t of e)RESERVED_ATTRS.has(t)&&this.#T(null,"",`property "${t}" is not allowed because it is a reserved attribute`);const s=this.#s.name;for(const r of this.getAttributeNames())if("class"!==r&&"id"!==r&&"disabled"!==r&&!r.startsWith("on"))if("form-assoc"!==r){if(!e.has(Wrec.getPropName(r))){if("name"===r){if(t.formAssociated)continue;throw new WrecError(`name attribute requires "static formAssociated = true;" in class ${s}`)}this.#T(null,r,"is not a supported attribute")}}else if(!t.formAssociated)throw new WrecError(`add "static formAssociated = true;" to class ${s}`)}#H(t,e,s){const r=s.match(REFS_RE);if(r)return r.forEach(s=>{const r=getPropName(s);void 0===this[r]&&this.#I(t,e,r)}),r}#L(t,e){for(const[s,r]of Object.entries(e)){let e=getPathValue(t,s);if(void 0===e)throw new WrecError(`invalid state path "${s}"`);e=this[r],this.#p(r)||this.#T(null,r,"refers to missing property in useState map")}}#A(t,e,s){if(s instanceof e)return;let r=typeof s;if("object"===r){const{constructor:o}=s;r=o.name,o!==e&&this.#T(null,t,`was set to a ${r}, but must be a ${e.name}`)}r!==e.name.toLowerCase()&&this.#T(null,t,`was set to a ${r}, but must be a ${e.name}`)}#m(t){const e=Array.from(t.querySelectorAll("*"));for(const t of e){const e=[];for(const s of Array.from(t.attributes)){const r=s.name;if(r.startsWith("on")){let o=r.slice(2);o=o[0].toLowerCase()+o.slice(1).toLowerCase();const i=s.value;let n;this.#H(t,r,i),"function"==typeof this[i]?n=t=>this[i](t):(this.#H(t,r,i),n=()=>this.#g(i)),t.addEventListener(o,n),e.push(r)}}for(const s of e)t.removeAttribute(s)}}}export function css(t,...e){let s=interpolate(t,e);for(;;){const t=CSS_PROPERTY_RE.exec(s);if(!t)break;const e=t[2];if(REFS_TEST_RE.test(e)){const r=t[1];if(!r.startsWith("--")){const o=`--${r}: ${e};\n ${r}: var(--${r});`;s=replace(s,t.index,t[0].length,o)}}}return s}export function html(t,...e){let s=interpolate(t,e);for(;;){const t=HTML_ELEMENT_TEXT_RE.exec(s);if(!t||"style"===t[1])break;const e=removeHtmlComments(t[2]);if(REFS_TEST_RE.test(e)){const r=`\x3c!-- ${e.trim()} --\x3e`;s=replace(s,t.index+t[0].indexOf(">")+1,e.length,r)}}return s}import{createDeepProxy,proxyToPlainObject}from"./proxies.js";const inBrowser="undefined"!=typeof window&&void 0!==window.document;class WrecError extends Error{}export class WrecState{static#V=new Map;static{inBrowser&&window.addEventListener("beforeunload",()=>{for(const[t,e]of this.#V.entries())if(e.#F){const s=proxyToPlainObject(e);sessionStorage.setItem("wrec-state-"+t,JSON.stringify(s))}})}static get(t){return this.#V.get(t)}#D=Symbol("objectId");#j=[];#k;#F;#B;constructor(t,e,s){if(!t)throw new WrecError("name cannot be empty");if(WrecState.#V.has(t))throw new WrecError(`WrecState with name "${t}" already exists`);if(this.#k=t,this.#F=e,this.#B=createDeepProxy({},this.#z.bind(this)),e&&inBrowser){const e=sessionStorage.getItem("wrec-state-"+t),r=e?JSON.parse(e):void 0;r&&(s=r)}if(s)for(const[t,e]of Object.entries(s))this.addProperty(t,e);WrecState.#V.set(t,this)}addListener(t,e={}){const s=this.#j.find(e=>e.listenerRef.deref()===t);if(s){const{propertyMap:t}=s;for(const[s,r]of Object.entries(e))t[s]=r}else this.#j.push({listenerRef:new WeakRef(t),propertyMap:e})}addProperty(t,e){Object.defineProperty(this,t,{enumerable:!0,get(){return this.#B[t]},set(e){this.#B[t]=e}}),this.#B[t]=e}get id(){return this.#D}log(){console.log("WrecState:",this.#k);for(const[t,e]of Object.entries(this.#B))console.log(` ${t} = ${JSON.stringify(e)}`)}#z(t,e,s){const r=new Set;for(const o of this.#j){const i=o.listenerRef.deref();if(i)if(inBrowser&&i instanceof HTMLElement&&!i.isConnected)r.add(o);else{const{propertyMap:r}=o,n=Object.keys(r);(0===n.length||n.includes(t))&&i.changed(t,r[t],s,e,this)}else r.add(o)}this.#j=this.#j.filter(t=>!r.has(t))}removeListener(t){this.#j=this.#j.filter(e=>e.listenerRef.deref()!==t)}}if(inBrowser){"development"===process.env.NODE_ENV&&(window.WrecState=WrecState)}
package/dist/wrec.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(p,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(p=typeof globalThis<"u"?globalThis:p||self,d(p.wrec={}))})(this,(function(p){"use strict";function d(r,t){let e=r;for(const s of t.split("."))e=e[s];return e}function k(r,t,e){const s=t.split("."),o=s.length-1;let i=r;s.forEach((n,h)=>{h===o?i[n]=e:i=i[n]})}class b extends Error{}const j=/([a-zA-Z-]+)\s*:\s*([^;}]+)/g,P="a-zA-Z_$",F=P+"0-9",g=`[${P}][${F}]*`,_=/<!--\s*(.*?)\s*-->/,V=/<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g,T=new RegExp(`^this\\.${g}$`),C=new RegExp(`this\\.${g}(\\.${g})*`,"g"),N=new RegExp(`this\\.${g}(\\.${g})*`),I=new Set(["class","style"]),$=5;function D(r){return r instanceof HTMLButtonElement||r instanceof HTMLFieldSetElement||r instanceof HTMLInputElement||r instanceof HTMLSelectElement||r instanceof HTMLTextAreaElement||r instanceof u}function B(r,t,e){const s=document.createElement(r);if(t)for(const[o,i]of Object.entries(t))s.setAttribute(o,i);return e&&(s.innerHTML=e),s}const q=r=>r===String?"":r===Number?0:r===Boolean?!1:r===Array?[]:r===Object?{}:void 0;function w(r){const t=[];let e=r.firstElementChild;for(;e;)t.push(e),e.shadowRoot&&t.push(...w(e.shadowRoot)),e.firstElementChild&&t.push(...w(e)),e=e.nextElementSibling;return t}const A=r=>r.substring($).split(".")[0];function x(r,t){let e=r[0];return t.forEach((s,o)=>{e+=s+r[o+1]}),e}function S(r){const t=typeof r;return t==="string"||t==="number"||t==="boolean"}function E(r){return r.localName==="textarea"}function v(r){const{localName:t}=r;return t==="input"||t==="select"}const z=r=>r.replace(/<!--[\s\S]*?-->/g,"");function L(r,t,e,s){return r.slice(0,t)+s+r.slice(t+e)}function M(r){const t=Number(r);if(isNaN(t))throw new b(`can't convert "${r}" to a number`);return t}function O(r,t,e){const[s,o]=t.split(":");if(S(e))if(typeof e=="boolean"){e?r.setAttribute(s,s):r.removeAttribute(s);const i=u.getPropName(s);r[i]=e}else{const i=r.getAttribute(t),n=String(e);i!==n&&(r.setAttribute(s,n),s==="value"&&v(r)&&(r.value=n))}else{const i=u.getPropName(t);r[i]=e}}function R(r,t,e){const[s,o]=t.split(":");r instanceof CSSRule?r.style.setProperty(s,e):(O(r,s,e),s==="value"&&v(r)&&(r.value=e))}class u extends HTMLElement{static#p=new Map;static#d=new Map;static css="";static formAssociated=!1;static html="";static properties;static propToComputedMap;static propToExprsMap;static template=null;#t=this.constructor;#s=new Map;#a={};#i;#f={};#h=null;#u=new Map;constructor(){super(),this.attachShadow({mode:"open"});const t=this.#t;t.properties||(t.properties={}),t.propToComputedMap||(t.propToComputedMap=new Map),t.propToExprsMap||(t.propToExprsMap=new Map)}attributeChangedCallback(t,e,s){t==="disabled"&&this.#m();const o=u.getPropName(t);if(this.#n(o)){const i=this.#y(o,String(s));this[o]=i;const n=this.#a[o];n&&this.setFormValue(n,String(i)),this.propertyChangedCallback(o,e,s)}}#w(){const t=this.#t;let e=t.template;if(!e){e=t.template=document.createElement("template");let s="<style> :host([hidden]) { display: none; } ";t.css&&(s+=t.css),s+="</style>",s+=t.html,e.innerHTML=s}this.shadowRoot?.replaceChildren(e.content.cloneNode(!0))}changed(t,e,s){this[e]=s}connectedCallback(){this.#H(),this.#v(),this.#w(),this.hasAttribute("disabled")&&this.#m(),requestAnimationFrame(()=>{this.shadowRoot&&(this.#C(this.shadowRoot),this.#b(this.shadowRoot)),this.#S()})}#S(){const t=this.#t,{properties:e}=t;for(const[s,{computed:o}]of Object.entries(e))o&&(this[s]=this.#o(o))}#v(){const t=this.#t,{observedAttributes:e,properties:s}=t;for(const[o,i]of Object.entries(s))this.#M(o,i,e)}#M(t,e,s){const o=u.getAttrName(t),i=this.hasAttribute(o);e.required&&!i&&this.#e(this,t,"is a required attribute");let n=e.value;this.hasOwnProperty(t)&&(n=this[t],delete this[t]);const{type:h}=e,c=h===Boolean?n||i:s.includes(o)&&i?this.#A(t,o):n||q(h),f="#"+t;this[f]=c,e.computed&&this.#$(t,e),Object.defineProperty(this,t,{enumerable:!0,get(){return this[f]},set(a){h===Number&&typeof a=="string"&&(a=M(a));const l=this[f];if(a===l)return;this.#j(t,h,a),this[f]=a;const{state:m,stateProp:y}=this.#t.properties[t];y&&k(m,y,a),this.#L(t),this.#x(t,h,a,o),this.#E(t),this.#O(t,a);const H=this.#a[t];H&&this.setFormValue(H,String(a)),this.propertyChangedCallback(t,l,a),e.dispatch&&this.dispatch("change",{[t]:a})}})}#m(){const t=this.hasAttribute("disabled"),e=w(this.shadowRoot);for(const s of e)D(s)&&(s.disabled=t)}disconnectedCallback(){this.#s.clear(),this.#f.clear(),this.#u.clear()}dispatch(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}displayIfSet(t,e="block"){return`display: ${t?e:"none"}`}static elementName(){return this.name.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}#R(t){const e=t instanceof u;for(const s of t.getAttributeNames()){const o=t.getAttribute(s),i=this.#g(t,o);if(i){const n=this[i];n===void 0&&this.#c(t,s,i),t[i]=n;let[h,c]=s.split(":");h==="value"&&(c?(t["on"+c]===void 0&&this.#e(t,s,"refers to an unsupported event name"),t.setAttribute(h,this[i])):c="change"),e&&t.#u.set(u.getPropName(h),i)}this.#r(o,t,s)}}#o(t){const e=new Function("return "+t).call(this);return Array.isArray(e)?e.join(""):e}#P(t){const{localName:e}=t;if(e==="style"){const{sheet:s}=t,o=s?.cssRules??[],i=Array.from(o);for(const n of i)if(n.constructor===CSSStyleRule){const h=Array.from(n.style);for(const c of h)if(c.startsWith("--")){const f=n.style.getPropertyValue(c);this.#r(f,n,c)}}}else{let s="";if(E(t)){this.#r(t.textContent,t);const o=t.textContent?.match(_);o&&(s=o[1])}else{const o=Array.from(t.childNodes).find(i=>i.nodeType===Node.COMMENT_NODE);o&&(s=o.textContent?.trim()??"")}if(s){const o=this.#g(t,s);o&&E(t)?t.textContent=this[o]:this.#r(s,t)}}}formAssociatedCallback(){let t=this.getAttribute("form-assoc");if(!t){const n=this.getAttribute("name");if(n)if(this.#n("value"))t=`value:${n}`;else return;else return}const e={},s=t.split(",");for(const n of s){const[h,c]=n.split(":");e[h.trim()]=c.trim()}this.#a=e,this.#i=new FormData,this.#h=this.attachInternals(),this.#h.setFormValue(this.#i);const o=Object.keys(this.#t.properties),i=this.#f;for(const n of o)i[n]=this[n]}formResetCallback(){const t=this.#f;for(const e of Object.keys(t)){let s=t[e];T.test(s)&&(s=this.#o(s)),this[e]=s}}static getAttrName(t){let e=u.#d.get(t);return e||(e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u.#d.set(t,e)),e}static getPropName(t){let e=u.#p.get(t);return e||(e=t.replace(/-([a-z])/g,(s,o)=>o.toUpperCase()),u.#p.set(t,e)),e}#N(t,e,s){if(s.length!==1)return;const[o]=s;if(!T.test(o))return;const i=v(t)||E(t);let[n,h]=(e??"").split(":");if(!(i&&n==="value"||E(t)))return;h?t["on"+h]===void 0&&this.#e(t,e,"refers to an unsupported event name"):h="change";const f=A(o);t.addEventListener(h,a=>{const{target:l}=a;if(!l)return;const m=l.value,{type:y}=this.#t.properties[f];this[f]=y===Number?M(m):m,this.#E(f)})}#n(t){return!!this.#t.properties[t]}#b(t){const e=Array.from(t.querySelectorAll("*"));for(const s of e)this.#R(s),s.firstElementChild||this.#P(s)}static get observedAttributes(){const t=Object.keys(this.properties||{}).map(u.getAttrName);return t.includes("disabled")||t.push("disabled"),t}propertyChangedCallback(t,e,s){}#g(t,e){if(!e||!T.test(e))return;const s=A(e);return this[s]===void 0&&this.#c(t,"",s),s}#E(t){const o=this.#t.propToExprsMap.get(t)||[];for(const i of o){let n=this.#o(i);const h=this.#s.get(i)??[];for(const c of h)if(c instanceof HTMLElement)this.#T(c,n);else if(!(c instanceof CSSStyleRule)){const{element:f,attrName:a}=c;f instanceof CSSStyleRule?f.style.setProperty(a,n):R(f,a,n)}}}static register(){const t=this.elementName();customElements.get(t)||customElements.define(t,this)}#$(t,e){const{computed:s,uses:o}=e,i=this.#t.propToComputedMap;function n(c,f){let a=i.get(c);a||(a=[],i.set(c,a)),a.push([t,f])}const h=s.match(C)||[];for(const c of h){const f=c.substring($);this[f]===void 0&&this.#c(null,t,f),typeof this[f]!="function"&&n(f,s)}if(o)for(const c of o.split(","))n(c,s)}#r(t,e,s=void 0){if(!t)return;const o=this.#l(e,s,t);if(!o){const c=t.replaceAll("this..","this.");s?R(e,s,c):"textContent"in e&&(e.textContent=c);return}const i=this.#t;o.forEach(c=>{const f=A(c);if(typeof this[f]=="function")return;const a=i.propToExprsMap;let l=a.get(f);l||(l=[],a.set(f,l)),l.includes(t)||l.push(t)});for(const[c,f]of this.#s.entries())for(const a of f){const l=a instanceof HTMLElement||a instanceof CSSStyleRule?a:a.element;l instanceof CSSStyleRule||l.isConnected||this.#s.set(c,f.filter(m=>m!==a))}let n=this.#s.get(t);n||(n=[],this.#s.set(t,n)),n.push(s?{element:e,attrName:s}:e),e instanceof HTMLElement&&this.#N(e,s,o);const h=this.#o(t);s?R(e,s,h):this.#T(e,h)}setAttributeSafe(t,e){this.hasAttribute(t)||this.setAttribute(t,e)}setFormValue(t,e){!this.#i||!S(e)||(this.#i.set(t,e),this.#h?.setFormValue(this.#i))}#e(t,e,s){const o=this.#t,i=t instanceof HTMLElement?t.localName:"CSS rule";throw new b(`component ${o.elementName()}`+(t?`, element "${i}"`:"")+(e?`, attribute "${e}"`:"")+` ${s}`)}#c(t,e,s){this.#e(t,e,`refers to missing property "${s}"`)}#A(t,e){return this.#y(t,this.getAttribute(e))}#y(t,e){if(e?.match(C))return e;const s=this.#t,{type:o}=s.properties[t];if(o||this.#e(null,t,"does not specify its type"),o===String)return e;if(o===Number)return M(e);if(o===Boolean)return e==="true"?!0:e==="false"||e==="null"?!1:(e&&e!==t&&this.#e(null,t,"is a Boolean attribute, so its value must match attribute name or be missing"),e===t)}#x(t,e,s,o){if(S(s)&&this.hasAttribute(o)){const i=e===Boolean?this.hasAttribute(o):this.#A(t,o);s!==i&&O(this,t,s)}}#L(t){const s=this.#t.propToComputedMap.get(t)||[];for(const[o,i]of s)this[o]=this.#o(i)}#T(t,e){if(e===void 0)return;const s=t instanceof HTMLElement,o=typeof e;o!=="string"&&o!=="number"&&this.#e(t,void 0," computed content is not a string or number"),t instanceof HTMLElement&&E(t)?t.value=e:s&&o==="string"&&e.trim().startsWith("<")?(t.innerHTML=e,this.#C(t),this.#b(t)):s&&(t.textContent=e)}#O(t,e){const s=this.#u.get(t);if(!s)return;const o=this.getRootNode();if(!(o instanceof ShadowRoot))return;const{host:i}=o;if(!i)return;const n=i;n[s]=e}useState(t,e){if(!e){e={};for(const s of Object.keys(t))e[s]=s}this.#k(t,e);for(const[s,o]of Object.entries(e))if(this.#n(o)){const i=d(t,s);i!==void 0&&(this[o]=i);const n=this.#t.properties[o];n.state=t,n.stateProp=s}t.addListener(this,e)}#H(){const t=this.#t,e=new Set(Object.keys(t.properties));for(const o of e)I.has(o)&&this.#e(null,"",`property "${o}" is not allowed because it is a reserved attribute`);const s=this.#t.name;for(const o of this.getAttributeNames())if(o!=="class"&&o!=="id"&&o!=="disabled"&&!o.startsWith("on")){if(o==="form-assoc"){if(!t.formAssociated)throw new b(`add "static formAssociated = true;" to class ${s}`);continue}if(!e.has(u.getPropName(o))){if(o==="name"){if(t.formAssociated)continue;throw new b(`name attribute requires "static formAssociated = true;" in class ${s}`)}this.#e(null,o,"is not a supported attribute")}}}#l(t,e,s){const o=s.match(C);if(o)return o.forEach(i=>{const n=A(i);this[n]===void 0&&this.#c(t,e,n)}),o}#k(t,e){for(const[s,o]of Object.entries(e)){let i=d(t,s);if(i===void 0)throw new b(`invalid state path "${s}"`);i=this[o],this.#n(o)||this.#e(null,o,"refers to missing property in useState map")}}#j(t,e,s){if(s instanceof e)return;let o=typeof s;if(o==="object"){const{constructor:i}=s;o=i.name,i!==e&&this.#e(null,t,`was set to a ${o}, but must be a ${e.name}`)}o!==e.name.toLowerCase()&&this.#e(null,t,`was set to a ${o}, but must be a ${e.name}`)}#C(t){const e=Array.from(t.querySelectorAll("*"));for(const s of e){const o=[];for(const i of Array.from(s.attributes)){const n=i.name;if(n.startsWith("on")){let h=n.slice(2);h=h[0].toLowerCase()+h.slice(1).toLowerCase();const c=i.value;this.#l(s,n,c);let f;typeof this[c]=="function"?f=a=>this[c](a):(this.#l(s,n,c),f=()=>this.#o(c)),s.addEventListener(h,f),o.push(n)}}for(const i of o)s.removeAttribute(i)}}}function Z(r,...t){let e=x(r,t);for(;;){const s=j.exec(e);if(!s)break;const o=s[2];if(N.test(o)){const i=s[1];if(!i.startsWith("--")){const n=`--${i}: ${o};
2
- ${i}: var(--${i});`;e=L(e,s.index,s[0].length,n)}}}return e}function K(r,...t){let e=x(r,t);for(;;){const s=V.exec(e);if(!s||s[1]==="style")break;const o=z(s[2]);if(N.test(o)){const i=`<!-- ${o.trim()} -->`,n=s.index+s[0].indexOf(">")+1;e=L(e,n,o.length,i)}}return e}p.Wrec=u,p.createElement=B,p.css=Z,p.html=K,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(p,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(p=typeof globalThis<"u"?globalThis:p||self,d(p.wrec={}))})(this,(function(p){"use strict";function d(r,t){let e=r;for(const s of t.split("."))e=e[s];return e}function H(r,t,e){const s=t.split("."),o=s.length-1;let i=r;s.forEach((n,h)=>{h===o?i[n]=e:i=i[n]})}class b extends Error{}const j=/([a-zA-Z-]+)\s*:\s*([^;}]+)/g,P="a-zA-Z_$",F=P+"0-9",y=`[${P}][${F}]*`,V=/<!--\s*(.*?)\s*-->/,_=/<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g,S=new RegExp(`^this\\.${y}$`),C=new RegExp(`this\\.${y}(\\.${y})*`,"g"),N=new RegExp(`this\\.${y}(\\.${y})*`),I=new Set(["class","style"]),$=5;function D(r){return r instanceof HTMLButtonElement||r instanceof HTMLFieldSetElement||r instanceof HTMLInputElement||r instanceof HTMLSelectElement||r instanceof HTMLTextAreaElement||r instanceof l}function B(r,t,e){const s=document.createElement(r);if(t)for(const[o,i]of Object.entries(t))s.setAttribute(o,i);return e&&(s.innerHTML=e),s}const q=r=>r===String?"":r===Number?0:r===Boolean?!1:r===Array?[]:r===Object?{}:void 0;function T(r){const t=[];let e=r.firstElementChild;for(;e;)t.push(e),e.shadowRoot&&t.push(...T(e.shadowRoot)),e.firstElementChild&&t.push(...T(e)),e=e.nextElementSibling;return t}const E=r=>r.substring($).split(".")[0];function x(r,t){let e=r[0];return t.forEach((s,o)=>{e+=s+r[o+1]}),e}function w(r){const t=typeof r;return t==="string"||t==="number"||t==="boolean"}function g(r){return r.localName==="textarea"}function R(r){const{localName:t}=r;return t==="input"||t==="select"}const z=r=>r.replace(/<!--[\s\S]*?-->/g,"");function L(r,t,e,s){return r.slice(0,t)+s+r.slice(t+e)}function v(r){const t=Number(r);if(isNaN(t))throw new b(`can't convert "${r}" to a number`);return t}function O(r,t,e){const[s,o]=t.split(":");if(w(e))if(typeof e=="boolean"){e?r.setAttribute(s,s):r.removeAttribute(s);const i=l.getPropName(s);r[i]=e}else{const i=r.getAttribute(t),n=String(e);i!==n&&(r.setAttribute(s,n),s==="value"&&R(r)&&(r.value=n))}else{const i=l.getPropName(t);r[i]=e}}function M(r,t,e){const[s,o]=t.split(":");r instanceof CSSRule?r.style.setProperty(s,e):(O(r,s,e),s==="value"&&R(r)&&(r.value=e))}class l extends HTMLElement{static#p=new Map;static#d=new Map;static css="";static formAssociated=!1;static html="";static properties;static propToComputedMap;static propToExprsMap;static stylesheet=null;static template=null;#t=this.constructor;#s=new Map;#a={};#i;#f={};#h=null;#l=new Map;constructor(){super(),this.attachShadow({mode:"open"});const t=this.#t;t.properties||(t.properties={}),t.propToComputedMap||(t.propToComputedMap=new Map),t.propToExprsMap||(t.propToExprsMap=new Map)}attributeChangedCallback(t,e,s){t==="disabled"&&this.#m();const o=l.getPropName(t);if(this.#r(o)){const i=this.#A(o,String(s));this[o]=i;const n=this.#a[o];n&&this.setFormValue(n,String(i)),this.propertyChangedCallback(o,e,s)}}#T(){if(!this.shadowRoot)return;const t=this.#t;if(t.css){let s=t.stylesheet;if(!s){s=t.stylesheet=new CSSStyleSheet;const o=`:host([hidden]) { display: none; } ${t.css}`;s.replaceSync(o)}this.shadowRoot.adoptedStyleSheets=[s]}let e=t.template;e||(e=t.template=document.createElement("template"),e.innerHTML=t.html),this.shadowRoot.replaceChildren(e.content.cloneNode(!0))}changed(t,e,s){this[e]=s}connectedCallback(){this.#H(),this.#R(),this.#T(),this.hasAttribute("disabled")&&this.#m(),requestAnimationFrame(()=>{if(this.shadowRoot){this.#C(this.shadowRoot),this.#b(this.shadowRoot);for(const t of this.shadowRoot.adoptedStyleSheets)this.#$(t)}this.#w()})}#w(){const t=this.#t,{properties:e}=t;for(const[s,{computed:o}]of Object.entries(e))o&&(this[s]=this.#o(o))}#R(){const t=this.#t,{observedAttributes:e,properties:s}=t;for(const[o,i]of Object.entries(s))this.#v(o,i,e)}#v(t,e,s){const o=l.getAttrName(t),i=this.hasAttribute(o);e.required&&!i&&this.#e(this,t,"is a required attribute");let n=e.value;this.hasOwnProperty(t)&&(n=this[t],delete this[t]);const{type:h}=e,c=h===Boolean?n||i:s.includes(o)&&i?this.#E(t,o):n||q(h),f="#"+t;this[f]=c,e.computed&&this.#x(t,e),Object.defineProperty(this,t,{enumerable:!0,get(){return this[f]},set(a){h===Number&&typeof a=="string"&&(a=v(a));const u=this[f];if(a===u)return;this.#F(t,h,a),this[f]=a;const{state:m,stateProp:A}=this.#t.properties[t];A&&H(m,A,a),this.#O(t),this.#L(t,h,a,o),this.#g(t),this.#k(t,a);const k=this.#a[t];k&&this.setFormValue(k,String(a)),this.propertyChangedCallback(t,u,a),e.dispatch&&this.dispatch("change",{[t]:a})}})}#m(){const t=this.hasAttribute("disabled"),e=T(this.shadowRoot);for(const s of e)D(s)&&(s.disabled=t)}disconnectedCallback(){this.#s.clear(),this.#f.clear(),this.#l.clear()}dispatch(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}displayIfSet(t,e="block"){return`display: ${t?e:"none"}`}static elementName(){return this.name.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}#M(t){const e=t instanceof l;for(const s of t.getAttributeNames()){const o=t.getAttribute(s),i=this.#y(t,o);if(i){const n=this[i];n===void 0&&this.#c(t,s,i),t[i]=n;let[h,c]=s.split(":");h==="value"&&(c?(t["on"+c]===void 0&&this.#e(t,s,"refers to an unsupported event name"),t.setAttribute(h,this[i])):c="change"),e&&t.#l.set(l.getPropName(h),i)}this.#n(o,t,s)}}#o(t){const e=new Function("return "+t).call(this);return Array.isArray(e)?e.join(""):e}#P(t){const{localName:e}=t;if(e==="style"){const{sheet:s}=t,o=s?.cssRules??[],i=Array.from(o);for(const n of i)if(n.constructor===CSSStyleRule){const h=Array.from(n.style);for(const c of h)if(c.startsWith("--")){const f=n.style.getPropertyValue(c);this.#n(f,n,c)}}}else{let s="";if(g(t)){this.#n(t.textContent,t);const o=t.textContent?.match(V);o&&(s=o[1])}else{const o=Array.from(t.childNodes).find(i=>i.nodeType===Node.COMMENT_NODE);o&&(s=o.textContent?.trim()??"")}if(s){const o=this.#y(t,s);o&&g(t)?t.textContent=this[o]:this.#n(s,t)}}}formAssociatedCallback(){let t=this.getAttribute("form-assoc");if(!t){const n=this.getAttribute("name");if(n)if(this.#r("value"))t=`value:${n}`;else return;else return}const e={},s=t.split(",");for(const n of s){const[h,c]=n.split(":");e[h.trim()]=c.trim()}this.#a=e,this.#i=new FormData,this.#h=this.attachInternals(),this.#h.setFormValue(this.#i);const o=Object.keys(this.#t.properties),i=this.#f;for(const n of o)i[n]=this[n]}formResetCallback(){const t=this.#f;for(const e of Object.keys(t)){let s=t[e];S.test(s)&&(s=this.#o(s)),this[e]=s}}static getAttrName(t){let e=l.#d.get(t);return e||(e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l.#d.set(t,e)),e}static getPropName(t){let e=l.#p.get(t);return e||(e=t.replace(/-([a-z])/g,(s,o)=>o.toUpperCase()),l.#p.set(t,e)),e}#N(t,e,s){if(s.length!==1)return;const[o]=s;if(!S.test(o))return;const i=R(t)||g(t);let[n,h]=(e??"").split(":");if(!(i&&n==="value"||g(t)))return;h?t["on"+h]===void 0&&this.#e(t,e,"refers to an unsupported event name"):h="change";const f=E(o);t.addEventListener(h,a=>{const{target:u}=a;if(!u)return;const m=u.value,{type:A}=this.#t.properties[f];this[f]=A===Number?v(m):m,this.#g(f)})}#r(t){return!!this.#t.properties[t]}#b(t){const e=Array.from(t.querySelectorAll("*"));for(const s of e)this.#M(s),s.firstElementChild||this.#P(s)}#$(t){const e=t.cssRules||t.rules;for(const s of Array.from(e))if(s instanceof CSSStyleRule){for(const o of Array.from(s.style))if(o.startsWith("--")){const i=s.style.getPropertyValue(o);this.#n(i,s,o)}}}static get observedAttributes(){const t=Object.keys(this.properties||{}).map(l.getAttrName);return t.includes("disabled")||t.push("disabled"),t}propertyChangedCallback(t,e,s){}#y(t,e){if(!e||!S.test(e))return;const s=E(e);return this[s]===void 0&&this.#c(t,"",s),s}#g(t){const o=this.#t.propToExprsMap.get(t)||[];for(const i of o){let n=this.#o(i);const h=this.#s.get(i)??[];for(const c of h)if(c instanceof HTMLElement)this.#S(c,n);else if(!(c instanceof CSSStyleRule)){const{element:f,attrName:a}=c;f instanceof CSSStyleRule?f.style.setProperty(a,n):M(f,a,n)}}}static register(){const t=this.elementName();customElements.get(t)||customElements.define(t,this)}#x(t,e){const{computed:s,uses:o}=e,i=this.#t.propToComputedMap;function n(c,f){let a=i.get(c);a||(a=[],i.set(c,a)),a.push([t,f])}const h=s.match(C)||[];for(const c of h){const f=c.substring($);this[f]===void 0&&this.#c(null,t,f),typeof this[f]!="function"&&n(f,s)}if(o)for(const c of o.split(","))n(c,s)}#n(t,e,s=void 0){if(!t)return;const o=this.#u(e,s,t);if(!o){const c=t.replaceAll("this..","this.");s?M(e,s,c):"textContent"in e&&(e.textContent=c);return}const i=this.#t;o.forEach(c=>{const f=E(c);if(typeof this[f]=="function")return;const a=i.propToExprsMap;let u=a.get(f);u||(u=[],a.set(f,u)),u.includes(t)||u.push(t)});for(const[c,f]of this.#s.entries())for(const a of f){const u=a instanceof HTMLElement||a instanceof CSSStyleRule?a:a.element;u instanceof CSSStyleRule||u.isConnected||this.#s.set(c,f.filter(m=>m!==a))}let n=this.#s.get(t);n||(n=[],this.#s.set(t,n)),n.push(s?{element:e,attrName:s}:e),e instanceof HTMLElement&&this.#N(e,s,o);const h=this.#o(t);s?M(e,s,h):this.#S(e,h)}setAttributeSafe(t,e){this.hasAttribute(t)||this.setAttribute(t,e)}setFormValue(t,e){!this.#i||!w(e)||(this.#i.set(t,e),this.#h?.setFormValue(this.#i))}#e(t,e,s){const o=this.#t,i=t instanceof HTMLElement?t.localName:"CSS rule";throw new b(`component ${o.elementName()}`+(t?`, element "${i}"`:"")+(e?`, attribute "${e}"`:"")+` ${s}`)}#c(t,e,s){this.#e(t,e,`refers to missing property "${s}"`)}#E(t,e){return this.#A(t,this.getAttribute(e))}#A(t,e){if(e?.match(C))return e;const s=this.#t,{type:o}=s.properties[t];if(o||this.#e(null,t,"does not specify its type"),o===String)return e;if(o===Number)return v(e);if(o===Boolean)return e==="true"?!0:e==="false"||e==="null"?!1:(e&&e!==t&&this.#e(null,t,"is a Boolean attribute, so its value must match attribute name or be missing"),e===t)}#L(t,e,s,o){if(w(s)&&this.hasAttribute(o)){const i=e===Boolean?this.hasAttribute(o):this.#E(t,o);s!==i&&O(this,t,s)}}#O(t){const s=this.#t.propToComputedMap.get(t)||[];for(const[o,i]of s)this[o]=this.#o(i)}#S(t,e){if(e===void 0)return;const s=t instanceof HTMLElement,o=typeof e;o!=="string"&&o!=="number"&&this.#e(t,void 0," computed content is not a string or number"),t instanceof HTMLElement&&g(t)?t.value=e:s&&o==="string"&&e.trim().startsWith("<")?(t.innerHTML=e,this.#C(t),this.#b(t)):s&&(t.textContent=e)}#k(t,e){const s=this.#l.get(t);if(!s)return;const o=this.getRootNode();if(!(o instanceof ShadowRoot))return;const{host:i}=o;if(!i)return;const n=i;n[s]=e}useState(t,e){if(!e){e={};for(const s of Object.keys(t))e[s]=s}this.#j(t,e);for(const[s,o]of Object.entries(e))if(this.#r(o)){const i=d(t,s);i!==void 0&&(this[o]=i);const n=this.#t.properties[o];n.state=t,n.stateProp=s}t.addListener(this,e)}#H(){const t=this.#t,e=new Set(Object.keys(t.properties));for(const o of e)I.has(o)&&this.#e(null,"",`property "${o}" is not allowed because it is a reserved attribute`);const s=this.#t.name;for(const o of this.getAttributeNames())if(o!=="class"&&o!=="id"&&o!=="disabled"&&!o.startsWith("on")){if(o==="form-assoc"){if(!t.formAssociated)throw new b(`add "static formAssociated = true;" to class ${s}`);continue}if(!e.has(l.getPropName(o))){if(o==="name"){if(t.formAssociated)continue;throw new b(`name attribute requires "static formAssociated = true;" in class ${s}`)}this.#e(null,o,"is not a supported attribute")}}}#u(t,e,s){const o=s.match(C);if(o)return o.forEach(i=>{const n=E(i);this[n]===void 0&&this.#c(t,e,n)}),o}#j(t,e){for(const[s,o]of Object.entries(e)){let i=d(t,s);if(i===void 0)throw new b(`invalid state path "${s}"`);i=this[o],this.#r(o)||this.#e(null,o,"refers to missing property in useState map")}}#F(t,e,s){if(s instanceof e)return;let o=typeof s;if(o==="object"){const{constructor:i}=s;o=i.name,i!==e&&this.#e(null,t,`was set to a ${o}, but must be a ${e.name}`)}o!==e.name.toLowerCase()&&this.#e(null,t,`was set to a ${o}, but must be a ${e.name}`)}#C(t){const e=Array.from(t.querySelectorAll("*"));for(const s of e){const o=[];for(const i of Array.from(s.attributes)){const n=i.name;if(n.startsWith("on")){let h=n.slice(2);h=h[0].toLowerCase()+h.slice(1).toLowerCase();const c=i.value;this.#u(s,n,c);let f;typeof this[c]=="function"?f=a=>this[c](a):(this.#u(s,n,c),f=()=>this.#o(c)),s.addEventListener(h,f),o.push(n)}}for(const i of o)s.removeAttribute(i)}}}function Z(r,...t){let e=x(r,t);for(;;){const s=j.exec(e);if(!s)break;const o=s[2];if(N.test(o)){const i=s[1];if(!i.startsWith("--")){const n=`--${i}: ${o};
2
+ ${i}: var(--${i});`;e=L(e,s.index,s[0].length,n)}}}return e}function K(r,...t){let e=x(r,t);for(;;){const s=_.exec(e);if(!s||s[1]==="style")break;const o=z(s[2]);if(N.test(o)){const i=`<!-- ${o.trim()} -->`,n=s.index+s[0].indexOf(">")+1;e=L(e,n,o.length,i)}}return e}p.Wrec=l,p.createElement=B,p.css=Z,p.html=K,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));
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.17.3",
5
+ "version": "0.18.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",