@vielzeug/ore 26.11.5 → 26.11.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/base-element.cjs +1 -1
  2. package/dist/base-element.cjs.map +1 -1
  3. package/dist/base-element.js +1 -1
  4. package/dist/define.cjs +1 -1
  5. package/dist/define.cjs.map +1 -1
  6. package/dist/define.js +1 -1
  7. package/dist/directives/each.cjs +1 -1
  8. package/dist/directives/each.cjs.map +1 -1
  9. package/dist/directives/each.js +1 -1
  10. package/dist/directives/unsafe-html.cjs +1 -1
  11. package/dist/directives/unsafe-html.cjs.map +1 -1
  12. package/dist/directives/unsafe-html.js +1 -1
  13. package/dist/directives/when.cjs +1 -1
  14. package/dist/directives/when.cjs.map +1 -1
  15. package/dist/directives/when.js +1 -1
  16. package/dist/host-bind.cjs +1 -1
  17. package/dist/host-bind.cjs.map +1 -1
  18. package/dist/host-bind.js +1 -1
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/ore.cjs +1 -1
  22. package/dist/ore.cjs.map +1 -1
  23. package/dist/ore.iife.js +1 -1
  24. package/dist/ore.iife.js.map +1 -1
  25. package/dist/ore.js +27 -41
  26. package/dist/ore.js.map +1 -1
  27. package/dist/props.cjs +1 -1
  28. package/dist/props.cjs.map +1 -1
  29. package/dist/props.js +1 -1
  30. package/dist/template/binding-types.d.ts +10 -1
  31. package/dist/template/binding-types.d.ts.map +1 -1
  32. package/dist/template/bindings.cjs +1 -1
  33. package/dist/template/bindings.cjs.map +1 -1
  34. package/dist/template/bindings.d.ts.map +1 -1
  35. package/dist/template/bindings.js +1 -1
  36. package/dist/template/bindings.js.map +1 -1
  37. package/dist/template/instantiator.cjs +1 -1
  38. package/dist/template/instantiator.cjs.map +1 -1
  39. package/dist/template/instantiator.d.ts.map +1 -1
  40. package/dist/template/instantiator.js +1 -1
  41. package/dist/template/instantiator.js.map +1 -1
  42. package/dist/testing/mount.cjs +1 -1
  43. package/dist/testing/mount.cjs.map +1 -1
  44. package/dist/testing/mount.js +1 -1
  45. package/dist/testing/render-hook.cjs +1 -1
  46. package/dist/testing/render-hook.cjs.map +1 -1
  47. package/dist/testing/render-hook.js +1 -1
  48. package/dist/testing.cjs +1 -1
  49. package/dist/testing.cjs.map +1 -1
  50. package/dist/testing.js +1 -1
  51. package/package.json +11 -11
package/dist/ore.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { batch as e, computed as t, createScope as n, effect as r, isReactive as i, signal as a, untrack as o } from "@vielzeug/ripple";
2
- //#endregion
3
- //#region src/errors.ts
2
+ // src/errors.ts
4
3
  var OreError = class extends Error {
5
4
  constructor(e, t) {
6
5
  super(e, t), this.name = new.target.name, Object.setPrototypeOf(this, new.target.prototype);
@@ -41,8 +40,7 @@ var s = {
41
40
  function invariant(e, t) {
42
41
  if (!e) throw new OreInternalError(s.invariantViolated(t));
43
42
  }
44
- //#endregion
45
- //#region src/utils/dom.ts
43
+ // src/utils/dom.ts
46
44
  var resolveMaybeReactive = (e) => typeof e == "function" ? e() : i(e) ? e.value : e, c = /[;{}]/g, sanitizeCssToken = (e) => e.replace(c, ""), runAll = (e) => {
47
45
  for (let t = e.length - 1; t >= 0; t--) e[t]?.();
48
46
  }, removeNodes = (e) => {
@@ -179,8 +177,7 @@ var injectStrict = (e) => {
179
177
  function createContext(e) {
180
178
  return Symbol(e);
181
179
  }
182
- //#endregion
183
- //#region src/props.ts
180
+ // src/props.ts
184
181
  function _jsOnlyProp(e) {
185
182
  return {
186
183
  default: e,
@@ -297,8 +294,7 @@ function createProps(e, t) {
297
294
  for (let [r, i] of Object.entries(t)) n[r] = registerProp(e, r, toKebab(r), i);
298
295
  return n;
299
296
  }
300
- //#endregion
301
- //#region src/utils/brand.ts
297
+ // src/utils/brand.ts
302
298
  var makeBrand = (e) => {
303
299
  let t = Symbol.for(e), stamp = (e) => Object.assign(e, { [t]: !0 }), is = (e) => typeof e == "object" && !!e && t in e;
304
300
  return {
@@ -457,8 +453,7 @@ var makeBrand = (e) => {
457
453
  });
458
454
  }
459
455
  };
460
- //#endregion
461
- //#region src/define.ts
456
+ // src/define.ts
462
457
  function define(e, t) {
463
458
  if (!e) throw new OreApiError(s.defineRequiresTag);
464
459
  if (customElements.get(e)) throw new OreApiError(s.defineDuplicate(e));
@@ -477,11 +472,9 @@ function define(e, t) {
477
472
  };
478
473
  return Object.defineProperty(ComponentClass, "name", { value: e }), customElements.define(e, ComponentClass), ComponentClass;
479
474
  }
480
- //#endregion
481
- //#region src/directives/classMap.ts
475
+ // src/directives/classMap.ts
482
476
  var classMap = (e) => t(() => [...resolveClassTokens(e)].join(" "));
483
- //#endregion
484
- //#region src/template/result.ts
477
+ // src/template/result.ts
485
478
  function ref() {
486
479
  return a(null);
487
480
  }
@@ -497,8 +490,7 @@ function createHtmlResult(e, t) {
497
490
  mount
498
491
  });
499
492
  }
500
- //#endregion
501
- //#region src/directives/each.ts
493
+ // src/directives/each.ts
502
494
  var createItem = (e, t, r, i, o) => {
503
495
  let s = a(e), c = a(t), l = n(), u = [], d = [];
504
496
  return l.run(() => {
@@ -599,8 +591,7 @@ function each(e, n, i, s) {
599
591
  });
600
592
  });
601
593
  }
602
- //#endregion
603
- //#region src/directives/live.ts
594
+ // src/directives/live.ts
604
595
  var k = makeBrand("ore:live"), live = (e) => k.stamp({ source: e }), A = k.is, j = makeBrand("ore:model"), M = j.is, modelDefaultGet = (e) => e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio") ? e.checked : e.value, modelDefaultEvent = (e) => e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio") || e instanceof HTMLSelectElement ? "change" : "input", model = (e, t) => j.stamp({
605
596
  event: t?.event,
606
597
  get: t?.get,
@@ -637,8 +628,7 @@ function unsafeHtml(e) {
637
628
  } else parseHtml(e, a, o), i(() => o.remove());
638
629
  });
639
630
  }
640
- //#endregion
641
- //#region src/directives/when.ts
631
+ // src/directives/when.ts
642
632
  var N = "when() anchor comment has no parent node";
643
633
  function when(e, n, a) {
644
634
  return typeof e != "function" && !i(e) ? createDirectiveResult((t, r) => {
@@ -664,8 +654,7 @@ function when(e, n, a) {
664
654
  });
665
655
  });
666
656
  }
667
- //#endregion
668
- //#region src/forms/field.ts
657
+ // src/forms/field.ts
669
658
  var P = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakSet(), useField = (e) => {
670
659
  let t = getHost();
671
660
  if (!t.constructor.formAssociated) throw new OreApiError(s.defineFieldRequiresFormAssociated(t.localName));
@@ -750,8 +739,7 @@ function applyClassMap(e, t) {
750
739
  r = t;
751
740
  });
752
741
  }
753
- //#endregion
754
- //#region src/slots.ts
742
+ // src/slots.ts
755
743
  var L = "default", normalizeSlotName = (e) => e || L, createSlots = (e) => {
756
744
  let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), ensureSlotEntry = (e) => {
757
745
  let n = t.get(e);
@@ -869,9 +857,9 @@ var L = "default", normalizeSlotName = (e) => e || L, createSlots = (e) => {
869
857
  i.insertBefore(e, t), r.push(e);
870
858
  }
871
859
  return r;
872
- }, applyHtmlBinding = (e, t) => {
873
- let { anchor: n, signal: i } = e, a = createReplaceableSlot(), s = r(() => {
874
- let e = i.value;
860
+ }, toHtmlValues = (e) => Array.isArray(e) ? e : [e], applyHtmlBinding = (e, t) => {
861
+ let { anchor: n, source: i } = e, a = createReplaceableSlot(), s = r(() => {
862
+ let e = toHtmlValues(typeof i == "function" ? i() : i.value);
875
863
  a.clear(), e != null && e.length !== 0 && o(() => {
876
864
  a.setNodes(insertHtmlValues(e, n, a.registerCleanup));
877
865
  });
@@ -1053,7 +1041,7 @@ var L = "default", normalizeSlotName = (e) => e || L, createSlots = (e) => {
1053
1041
  let n = e;
1054
1042
  for (let e of t) n = n.childNodes[e];
1055
1043
  return n;
1056
- }, Z = "html`...`: node-slot comment anchor has no parent node", toHtmlValues = (e) => Array.isArray(e) ? e : [e], embedStaticResult = (e, t, n) => {
1044
+ }, Z = "html`...`: node-slot comment anchor has no parent node", embedStaticResult = (e, t, n) => {
1057
1045
  let r = t.parentNode;
1058
1046
  for (invariant(r, Z); e.fragment.firstChild;) r.insertBefore(e.fragment.firstChild, t);
1059
1047
  n.push(e.apply.bind(e));
@@ -1076,38 +1064,37 @@ var L = "default", normalizeSlotName = (e) => e || L, createSlots = (e) => {
1076
1064
  };
1077
1065
  });
1078
1066
  for (let { comment: e, el: n, slot: r, value: a } of l) if (r.kind === z.NODE) {
1079
- let n = e;
1080
- if (invariant(n, "compiled template produced a node slot without a comment anchor"), E(a)) {
1067
+ let t = e;
1068
+ if (invariant(t, "compiled template produced a node slot without a comment anchor"), E(a)) {
1081
1069
  o.push({
1082
- anchor: n,
1070
+ anchor: t,
1083
1071
  directive: a,
1084
1072
  type: "directive"
1085
1073
  });
1086
1074
  continue;
1087
1075
  }
1088
1076
  if (O(a)) {
1089
- embedStaticResult(a, n, c), n.remove();
1077
+ embedStaticResult(a, t, c), t.remove();
1090
1078
  continue;
1091
1079
  }
1092
1080
  if (typeof a == "function" || i(a)) {
1093
- let e = t(typeof a == "function" ? () => toHtmlValues(a()) : () => toHtmlValues(a.value));
1094
1081
  o.push({
1095
- anchor: n,
1096
- signal: e,
1082
+ anchor: t,
1083
+ source: a,
1097
1084
  type: "html"
1098
1085
  });
1099
1086
  continue;
1100
1087
  }
1101
1088
  if (Array.isArray(a)) {
1102
- for (let e of a) if (O(e)) embedStaticResult(e, n, c);
1089
+ for (let e of a) if (O(e)) embedStaticResult(e, t, c);
1103
1090
  else {
1104
- let t = n.parentNode;
1105
- invariant(t, Z), t.insertBefore(document.createTextNode(resolveStaticText(e)), n);
1091
+ let n = t.parentNode;
1092
+ invariant(n, Z), n.insertBefore(document.createTextNode(resolveStaticText(e)), t);
1106
1093
  }
1107
- n.remove();
1094
+ t.remove();
1108
1095
  continue;
1109
1096
  }
1110
- n.replaceWith(document.createTextNode(resolveStaticText(a)));
1097
+ t.replaceWith(document.createTextNode(resolveStaticText(a)));
1111
1098
  } else if (invariant(n, "compiled template produced an element slot without an element"), r.kind === z.EVENT) {
1112
1099
  let e = r.name;
1113
1100
  if (invariant(e, "compiled template produced an event slot without an event name"), typeof a == "function") o.push({
@@ -1181,7 +1168,6 @@ var L = "default", normalizeSlotName = (e) => e || L, createSlots = (e) => {
1181
1168
  return e.dispatchEvent(new CustomEvent(String(t), r));
1182
1169
  });
1183
1170
  }, $ = 0, ee = Math.random().toString(36).slice(2, 6), createId = (e = "id") => `${e}-${ee}${++$}`;
1184
- //#endregion
1185
1171
  export { OreApiError, OreError, OreInternalError, OreLifecycleError, bind, classMap, createContext, createId, css, define, each, getHost, html, inject, injectStrict, live, model, onCleanup, onElement, onEvent, onFormReset, onMounted, v as prop, provide, ref, styleMap, unsafeHtml, useEmit, useField, useSlots, watchEffect, when };
1186
1172
 
1187
1173
  //# sourceMappingURL=ore.js.map