@jasonshimmy/custom-elements-runtime 2.6.0 → 2.6.2

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.
@@ -1,5 +1,5 @@
1
1
  import { j as K, t as Y, i as P, k as We, m as x, o as F, p as U, q as G, T as Ct, v as Qe, S as kt, x as pt, y as _e, z as X, A as _t, B as nt, a as rt, C as st, d as At } from "./namespace-helpers-DcD_6_K1.js";
2
- import { a as V, d as B } from "./logger-BvkEbVM4.js";
2
+ import { a as q, d as B } from "./logger-BvkEbVM4.js";
3
3
  import { j as wt, g as Tt, a as He, b as ye, m as Ae, s as Lt, d as ot } from "./transitions-Bo0DVkSp.js";
4
4
  const ge = /* @__PURE__ */ new Map(), Ke = /* @__PURE__ */ Symbol.for("cer.registry");
5
5
  function Nt() {
@@ -11,7 +11,7 @@ function Nt() {
11
11
  n[Ke] = new Map([...ge.entries()]), n[Ke].__realmId = t;
12
12
  }
13
13
  } catch (n) {
14
- V("Could not initialize global registry:", n);
14
+ q("Could not initialize global registry:", n);
15
15
  }
16
16
  }
17
17
  function Ot(e, n, t) {
@@ -237,7 +237,7 @@ class Rt {
237
237
  const s = this.cache.get(n);
238
238
  if (s) {
239
239
  if (!s.isSecure) {
240
- V("Blocked cached dangerous expression:", n);
240
+ q("Blocked cached dangerous expression:", n);
241
241
  return;
242
242
  }
243
243
  try {
@@ -252,7 +252,7 @@ class Rt {
252
252
  i && this.cache.delete(i);
253
253
  }
254
254
  if (this.cache.set(n, r), !r.isSecure) {
255
- V("Blocked dangerous expression:", n);
255
+ q("Blocked dangerous expression:", n);
256
256
  return;
257
257
  }
258
258
  return r.evaluator(t);
@@ -267,7 +267,7 @@ class Rt {
267
267
  try {
268
268
  return { evaluator: this.createSafeEvaluator(n), isSecure: !0 };
269
269
  } catch (t) {
270
- return V("Failed to create evaluator for expression:", n, t), { evaluator: () => {
270
+ return q("Failed to create evaluator for expression:", n, t), { evaluator: () => {
271
271
  }, isSecure: !1 };
272
272
  }
273
273
  }
@@ -752,8 +752,10 @@ function Bt(e, n, t, s, r, i, o, c) {
752
752
  }, 0), t[a] = Array.isArray(d) ? d : [];
753
753
  } else
754
754
  t[a] = d;
755
+ else if (!N && P(e))
756
+ t[a] = e;
755
757
  else {
756
- !N && P(e) ? t[a] = e : t[a] = d;
758
+ t[a] = d;
757
759
  try {
758
760
  const m = Y(a);
759
761
  s && (s[m] = d);
@@ -1163,7 +1165,7 @@ let Ve = !1;
1163
1165
  async function Vt(e, n, t = 10) {
1164
1166
  if (!Ve) {
1165
1167
  if (!e.isConnected) {
1166
- V("⚠️ Element not connected to DOM, skipping style wait");
1168
+ q("⚠️ Element not connected to DOM, skipping style wait");
1167
1169
  return;
1168
1170
  }
1169
1171
  for (let s = 0; s < t; s++) {
@@ -1176,7 +1178,7 @@ async function Vt(e, n, t = 10) {
1176
1178
  (c) => requestAnimationFrame(() => c(void 0))
1177
1179
  );
1178
1180
  }
1179
- Ve = !0, V("⚠️ Styles did not load in time for transition, continuing anyway");
1181
+ Ve = !0, q("⚠️ Styles did not load in time for transition, continuing anyway");
1180
1182
  }
1181
1183
  }
1182
1184
  function qt(e) {
@@ -2427,7 +2429,7 @@ function tn(e, n, t, s, r, i, o) {
2427
2429
  r(_);
2428
2430
  const a = d ? 50 : 10, b = d ? 100 : 25, E = p ? 12 : 50;
2429
2431
  if (_ === a && !d)
2430
- V(
2432
+ q(
2431
2433
  `⚠️ Component rendering frequently. Performance may be impacted.
2432
2434
  Common causes:
2433
2435
  • State updates during render cycle
@@ -2435,7 +2437,7 @@ Common causes:
2435
2437
  • Missing effect dependencies`
2436
2438
  );
2437
2439
  else if (_ === b && !d)
2438
- V(
2440
+ q(
2439
2441
  `⚠️ Component is re-rendering rapidly. Applying throttling.
2440
2442
  This might indicate:
2441
2443
  • Event handler calling function immediately: @click="\${fn()}" should be @click="\${fn}"
@@ -2817,7 +2819,7 @@ function sn(e, n) {
2817
2819
  } catch {
2818
2820
  c[f] = "[unreadable]";
2819
2821
  }
2820
- B(`Error rendering component <${i}> (id=${o}):`, r), B("Component props snapshot:", c), V(
2822
+ B(`Error rendering component <${i}> (id=${o}):`, r), B("Component props snapshot:", c), q(
2821
2823
  "Common causes: accessing properties of null/undefined inside template interpolations; expensive or throwing expressions inside templates that evaluate eagerly. Fixes: use optional chaining (obj?.prop), guard with ternary, or use the runtime lazy overload: when(cond, () => html`...`)."
2822
2824
  );
2823
2825
  } catch {
@@ -3121,7 +3123,7 @@ function _n(e) {
3121
3123
  configurable: !0
3122
3124
  });
3123
3125
  } catch (n) {
3124
- V("Error in useStyle callback:", n), Object.defineProperty(H, "_computedStyle", {
3126
+ q("Error in useStyle callback:", n), Object.defineProperty(H, "_computedStyle", {
3125
3127
  value: "",
3126
3128
  writable: !0,
3127
3129
  enumerable: !1,
@@ -3449,7 +3451,7 @@ function jn(e, n) {
3449
3451
  B(
3450
3452
  `Error during component discovery render <${t}>:`,
3451
3453
  o
3452
- ), V(
3454
+ ), q(
3453
3455
  "Error occurred during initial component discovery render. Consider guarding expensive expressions or using lazy factories for directives like when()."
3454
3456
  );
3455
3457
  } catch {
@@ -3537,14 +3539,14 @@ const ln = () => {
3537
3539
  );
3538
3540
  function fn(e, n) {
3539
3541
  if (e == null) {
3540
- V(
3542
+ q(
3541
3543
  `⚠️ Event handler for '@${n}' is ${e}. This will prevent the event from working. Use a function reference instead: @${n}="\${functionName}"`
3542
3544
  );
3543
3545
  return;
3544
3546
  }
3545
- typeof e != "function" && V(
3547
+ typeof e != "function" && q(
3546
3548
  `🚨 Potential infinite loop detected! Event handler for '@${n}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${n}="\${functionName()}" to @${n}="\${functionName}" to pass the function reference instead of calling it immediately.`
3547
- ), e === void 0 && typeof e != "function" && V(
3549
+ ), e === void 0 && typeof e != "function" && q(
3548
3550
  `💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${n}="\${fn}" not @${n}="\${fn()}"`
3549
3551
  );
3550
3552
  }
@@ -3861,12 +3863,19 @@ function dn(e, n, t) {
3861
3863
  if (!!(l.includes("-") || R || ie))
3862
3864
  for (const te of Object.keys(M)) {
3863
3865
  if (te !== "model" && !te.startsWith("model:")) continue;
3864
- const $e = M[te], xe = $e.arg ?? (te.includes(":") ? te.split(":", 2)[1] : void 0), q = $e.value, ze = xe ?? "modelValue", et = K, vt = We, Se = r?._state || r;
3866
+ const $e = M[te], xe = $e.arg ?? (te.includes(":") ? te.split(":", 2)[1] : void 0), V = $e.value, ze = xe ?? "modelValue", et = K, vt = We, Se = r?._state || r;
3865
3867
  let se;
3866
- typeof q == "string" && Se ? se = et(
3867
- Se,
3868
- q
3869
- ) : se = q, j.props[ze] = se;
3868
+ if (typeof V == "string" && Se)
3869
+ se = et(
3870
+ Se,
3871
+ V
3872
+ );
3873
+ else if (se = V, P(V))
3874
+ try {
3875
+ V.value;
3876
+ } catch {
3877
+ }
3878
+ j.props[ze] = se;
3870
3879
  try {
3871
3880
  const ae = Y(ze);
3872
3881
  j.attrs || (j.attrs = {}), se != null && (typeof se == "string" || typeof se == "number" || typeof se == "boolean") && (j.attrs[ae] = se);
@@ -3880,10 +3889,10 @@ function dn(e, n, t) {
3880
3889
  j.props[Et] = function(ae) {
3881
3890
  const re = ae.detail !== void 0 ? ae.detail : ae.target ? ae.target.value : void 0;
3882
3891
  if (Se)
3883
- if (q && P(q)) {
3884
- const le = q.value;
3892
+ if (V && P(V)) {
3893
+ const le = V.value;
3885
3894
  if (Array.isArray(re) && Array.isArray(le) ? JSON.stringify([...re].sort()) !== JSON.stringify([...le].sort()) : re !== le) {
3886
- q.value = re;
3895
+ V.value = re;
3887
3896
  try {
3888
3897
  const fe = r;
3889
3898
  if (fe) {
@@ -3896,12 +3905,12 @@ function dn(e, n, t) {
3896
3905
  } else {
3897
3906
  const le = et(
3898
3907
  Se || {},
3899
- typeof q == "string" ? q : String(q)
3908
+ typeof V == "string" ? V : String(V)
3900
3909
  );
3901
3910
  if (Array.isArray(re) && Array.isArray(le) ? JSON.stringify([...re].sort()) !== JSON.stringify([...le].sort()) : re !== le) {
3902
3911
  vt(
3903
3912
  Se || {},
3904
- typeof q == "string" ? q : String(q),
3913
+ typeof V == "string" ? V : String(V),
3905
3914
  re
3906
3915
  );
3907
3916
  try {
@@ -4008,4 +4017,4 @@ export {
4008
4017
  kn as u,
4009
4018
  Yt as v
4010
4019
  };
4011
- //# sourceMappingURL=template-compiler-xSxUyqRI.js.map
4020
+ //# sourceMappingURL=template-compiler-DvbSi27u.js.map