@jasonshimmy/custom-elements-runtime 3.1.0 → 3.1.1
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/dist/custom-elements-runtime.cjs.js +1 -1
- package/dist/custom-elements-runtime.es.js +3 -3
- package/dist/custom-elements-runtime.jit-css.cjs.js +1 -1
- package/dist/custom-elements-runtime.jit-css.es.js +2 -2
- package/dist/custom-elements-runtime.router.cjs.js +1 -1
- package/dist/custom-elements-runtime.router.es.js +2 -2
- package/dist/custom-elements-runtime.ssr-middleware.cjs.js +1 -1
- package/dist/custom-elements-runtime.ssr-middleware.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.ssr-middleware.es.js +36 -30
- package/dist/custom-elements-runtime.ssr-middleware.es.js.map +1 -1
- package/dist/custom-elements-runtime.ssr.cjs.js +3 -3
- package/dist/custom-elements-runtime.ssr.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.ssr.es.js +121 -100
- package/dist/custom-elements-runtime.ssr.es.js.map +1 -1
- package/dist/{hooks-B50HhrHh.cjs → hooks-x8M4knLc.cjs} +4 -4
- package/dist/hooks-x8M4knLc.cjs.map +1 -0
- package/dist/{hooks-Cze3o-F7.js → hooks-xWZhQHco.js} +202 -199
- package/dist/hooks-xWZhQHco.js.map +1 -0
- package/dist/runtime/render.d.ts +0 -11
- package/dist/runtime/scheduler.d.ts +12 -0
- package/dist/runtime/ssr-context.d.ts +3 -1
- package/dist/runtime/ssr-utils.d.ts +9 -0
- package/dist/runtime/vdom-ssr-dsd.d.ts +25 -1
- package/dist/runtime/vdom-ssr.d.ts +2 -6
- package/dist/template-compiler-CTUhEHr8.cjs +22 -0
- package/dist/template-compiler-CTUhEHr8.cjs.map +1 -0
- package/dist/{template-compiler-DtpNsqE-.js → template-compiler-ZhSg1yPh.js} +902 -922
- package/dist/template-compiler-ZhSg1yPh.js.map +1 -0
- package/package.json +1 -1
- package/dist/hooks-B50HhrHh.cjs.map +0 -1
- package/dist/hooks-Cze3o-F7.js.map +0 -1
- package/dist/template-compiler-Cshhqxyd.cjs +0 -23
- package/dist/template-compiler-Cshhqxyd.cjs.map +0 -1
- package/dist/template-compiler-DtpNsqE-.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as m, d as T } from "./logger-BvkEbVM4.js";
|
|
2
2
|
import { m as G, s as X } from "./css-utils-Cg4o1MqY.js";
|
|
3
3
|
function K() {
|
|
4
4
|
const r = (() => {
|
|
@@ -70,7 +70,7 @@ class Z {
|
|
|
70
70
|
try {
|
|
71
71
|
n();
|
|
72
72
|
} catch (t) {
|
|
73
|
-
|
|
73
|
+
T("Error in batched update:", t);
|
|
74
74
|
}
|
|
75
75
|
} finally {
|
|
76
76
|
this.isFlushing = !1;
|
|
@@ -119,7 +119,7 @@ class Z {
|
|
|
119
119
|
*/
|
|
120
120
|
performPeriodicCleanup() {
|
|
121
121
|
const e = Date.now();
|
|
122
|
-
e - this.lastCleanup < this.CLEANUP_INTERVAL || (this.pendingUpdates.size > 100 &&
|
|
122
|
+
e - this.lastCleanup < this.CLEANUP_INTERVAL || (this.pendingUpdates.size > 100 && m(
|
|
123
123
|
`Scheduler has ${this.pendingUpdates.size} pending updates. Consider investigating.`
|
|
124
124
|
), this.lastCleanup = e);
|
|
125
125
|
}
|
|
@@ -128,7 +128,7 @@ class Z {
|
|
|
128
128
|
* @param queue - The specific map to trim; defaults to the normal queue.
|
|
129
129
|
*/
|
|
130
130
|
performEmergencyCleanup(e = this.pendingUpdates) {
|
|
131
|
-
|
|
131
|
+
m(
|
|
132
132
|
"Scheduler emergency cleanup: too many pending updates, clearing oldest entries"
|
|
133
133
|
);
|
|
134
134
|
const n = Array.from(e.entries()), t = Math.floor(n.length / 2);
|
|
@@ -155,7 +155,7 @@ class Z {
|
|
|
155
155
|
try {
|
|
156
156
|
e();
|
|
157
157
|
} catch (o) {
|
|
158
|
-
|
|
158
|
+
T("Error in immediate update:", o);
|
|
159
159
|
}
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
@@ -216,7 +216,7 @@ class Z {
|
|
|
216
216
|
try {
|
|
217
217
|
n[t][1]();
|
|
218
218
|
} catch (s) {
|
|
219
|
-
|
|
219
|
+
T("Error in idle update:", s);
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
}
|
|
@@ -236,13 +236,13 @@ function ue() {
|
|
|
236
236
|
let n = 0;
|
|
237
237
|
for (; S.hasPendingUpdates && n < 100; )
|
|
238
238
|
S.flushImmediately(), n++;
|
|
239
|
-
n >= 100 &&
|
|
239
|
+
n >= 100 && m(
|
|
240
240
|
"[nextTick] Maximum flush iterations reached — possible circular update loop. Check for watchers or computed values that unconditionally mutate reactive state."
|
|
241
241
|
), queueMicrotask(r);
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
const I = /* @__PURE__ */ new WeakSet();
|
|
245
|
-
class
|
|
245
|
+
class Y {
|
|
246
246
|
static cache = /* @__PURE__ */ new WeakMap();
|
|
247
247
|
static arrayHandlerCache = /* @__PURE__ */ new WeakMap();
|
|
248
248
|
static objectHandlerCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -278,9 +278,9 @@ class J {
|
|
|
278
278
|
"reverse",
|
|
279
279
|
"fill",
|
|
280
280
|
"copyWithin"
|
|
281
|
-
].includes(s) ? function(...
|
|
282
|
-
const
|
|
283
|
-
return e.triggerUpdate(),
|
|
281
|
+
].includes(s) ? function(...l) {
|
|
282
|
+
const a = i.apply(t, l);
|
|
283
|
+
return e.triggerUpdate(), a;
|
|
284
284
|
} : i !== null && typeof i == "object" && typeof s == "string" ? e.makeReactiveValue(i) : i;
|
|
285
285
|
},
|
|
286
286
|
set: (t, s, o) => (t[s] = e.makeReactiveValue(o), e.triggerUpdate(), !0),
|
|
@@ -350,7 +350,7 @@ class $ {
|
|
|
350
350
|
return i || (i = {
|
|
351
351
|
triggerUpdate: n,
|
|
352
352
|
makeReactiveValue: t
|
|
353
|
-
}, o.set(t, i)),
|
|
353
|
+
}, o.set(t, i)), Y.getOrCreateProxy(e, i, s);
|
|
354
354
|
}
|
|
355
355
|
/**
|
|
356
356
|
* Mark an object as a proxy (for optimization)
|
|
@@ -363,23 +363,23 @@ class $ {
|
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
let
|
|
367
|
-
function
|
|
368
|
-
return
|
|
366
|
+
let D = !1;
|
|
367
|
+
function p() {
|
|
368
|
+
return D;
|
|
369
369
|
}
|
|
370
370
|
function le() {
|
|
371
|
-
|
|
371
|
+
D && m(
|
|
372
372
|
"[CER] beginDiscoveryRender() called while a discovery render is already active. This usually means a component was registered inside another component's render function. Ensure component() calls are at module top-level."
|
|
373
|
-
),
|
|
373
|
+
), D = !0;
|
|
374
374
|
}
|
|
375
375
|
function de() {
|
|
376
|
-
|
|
376
|
+
D = !1;
|
|
377
377
|
}
|
|
378
|
-
let
|
|
379
|
-
function
|
|
380
|
-
return `${r}-${++
|
|
378
|
+
let J = 0;
|
|
379
|
+
function A(r) {
|
|
380
|
+
return `${r}-${++J}`;
|
|
381
381
|
}
|
|
382
|
-
class
|
|
382
|
+
class Q {
|
|
383
383
|
// Use a stack to support nested callers (component render -> watcher)
|
|
384
384
|
// so that watchers can temporarily become the "current component" while
|
|
385
385
|
// establishing dependencies without clobbering the outer component id.
|
|
@@ -542,7 +542,7 @@ class Y {
|
|
|
542
542
|
s.startsWith(t) && this.stateStorage.delete(s);
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
const d = new
|
|
545
|
+
const d = new Q();
|
|
546
546
|
class x {
|
|
547
547
|
_value;
|
|
548
548
|
/** The unwrapped value last assigned — used for Object.is equality checks. */
|
|
@@ -563,7 +563,7 @@ class x {
|
|
|
563
563
|
return d.trackDependency(this), this._value;
|
|
564
564
|
}
|
|
565
565
|
set value(e) {
|
|
566
|
-
Object.is(e, this._rawValue) || (d.isRenderingComponent() && d.shouldEmitRenderWarning() &&
|
|
566
|
+
Object.is(e, this._rawValue) || (d.isRenderingComponent() && d.shouldEmitRenderWarning() && m(
|
|
567
567
|
`🚨 State modification detected during render! This can cause infinite loops.
|
|
568
568
|
• Move state updates to event handlers
|
|
569
569
|
• Use watchEffect/watch for side effects
|
|
@@ -623,7 +623,7 @@ function C(r) {
|
|
|
623
623
|
}
|
|
624
624
|
function he(r) {
|
|
625
625
|
let e, n = !0;
|
|
626
|
-
const t =
|
|
626
|
+
const t = A("computed"), s = () => {
|
|
627
627
|
n = !0;
|
|
628
628
|
};
|
|
629
629
|
try {
|
|
@@ -638,9 +638,9 @@ function he(r) {
|
|
|
638
638
|
};
|
|
639
639
|
}
|
|
640
640
|
function pe(r) {
|
|
641
|
-
if (
|
|
641
|
+
if (p()) return () => {
|
|
642
642
|
};
|
|
643
|
-
const e =
|
|
643
|
+
const e = A("effect");
|
|
644
644
|
try {
|
|
645
645
|
const t = d.getCurrentComponentId();
|
|
646
646
|
t && d.registerWatcher(t, e);
|
|
@@ -664,7 +664,7 @@ function N(r, e = /* @__PURE__ */ new WeakMap(), n = 0) {
|
|
|
664
664
|
const t = r;
|
|
665
665
|
if (e.has(t)) return e.get(t);
|
|
666
666
|
if (n > H)
|
|
667
|
-
return
|
|
667
|
+
return m(
|
|
668
668
|
`[watch] Deep clone exceeded ${H} nesting levels. Returning a reference at this depth instead of cloning further. Consider restructuring your state or switching to a shallow watch.`
|
|
669
669
|
), r;
|
|
670
670
|
if (typeof Node < "u" && t instanceof Node) return r;
|
|
@@ -690,24 +690,24 @@ function N(r, e = /* @__PURE__ */ new WeakMap(), n = 0) {
|
|
|
690
690
|
return s;
|
|
691
691
|
}
|
|
692
692
|
function ge(r, e, n) {
|
|
693
|
-
if (
|
|
693
|
+
if (p()) return () => {
|
|
694
694
|
};
|
|
695
695
|
let t;
|
|
696
|
-
const s = C(r) ? () => r.value : r, o =
|
|
696
|
+
const s = C(r) ? () => r.value : r, o = A("watch");
|
|
697
697
|
try {
|
|
698
|
-
const
|
|
699
|
-
|
|
698
|
+
const c = d.getCurrentComponentId();
|
|
699
|
+
c && d.registerWatcher(c, o);
|
|
700
700
|
} catch {
|
|
701
701
|
}
|
|
702
702
|
const i = () => {
|
|
703
703
|
d.setCurrentComponent(o, i);
|
|
704
|
-
const
|
|
704
|
+
const c = s();
|
|
705
705
|
if (d.clearCurrentComponent(), n?.deep) {
|
|
706
|
-
const
|
|
707
|
-
() => N(
|
|
706
|
+
const l = d.withoutTracking(
|
|
707
|
+
() => N(c)
|
|
708
708
|
);
|
|
709
|
-
e(
|
|
710
|
-
} else
|
|
709
|
+
e(l, t), t = l;
|
|
710
|
+
} else c !== t && (e(c, t), t = c);
|
|
711
711
|
};
|
|
712
712
|
return d.setCurrentComponent(o, i), t = s(), d.clearCurrentComponent(), n?.deep && (t = d.withoutTracking(() => N(t))), n && n.immediate && e(t, void 0), () => {
|
|
713
713
|
d.cleanup(o);
|
|
@@ -755,12 +755,12 @@ function y(r) {
|
|
|
755
755
|
if (!r) return "";
|
|
756
756
|
const e = String(r);
|
|
757
757
|
if (typeof document < "u" && typeof document.createElement == "function") {
|
|
758
|
-
const
|
|
758
|
+
const c = e.replace(/</g, "").replace(/>/g, ""), l = L || (L = document.createElement("div"));
|
|
759
759
|
try {
|
|
760
|
-
y._el =
|
|
760
|
+
y._el = l;
|
|
761
761
|
} catch {
|
|
762
762
|
}
|
|
763
|
-
return
|
|
763
|
+
return l.innerHTML = c, (l.textContent || "").replace(new RegExp("", "g"), "<").replace(new RegExp("", "g"), ">");
|
|
764
764
|
}
|
|
765
765
|
const n = {
|
|
766
766
|
lt: "<",
|
|
@@ -785,11 +785,11 @@ function y(r) {
|
|
|
785
785
|
"../entities.json",
|
|
786
786
|
"./entities.json"
|
|
787
787
|
];
|
|
788
|
-
for (const
|
|
788
|
+
for (const c of i)
|
|
789
789
|
try {
|
|
790
|
-
const
|
|
791
|
-
if (
|
|
792
|
-
s =
|
|
790
|
+
const l = o(c);
|
|
791
|
+
if (l && typeof l == "object") {
|
|
792
|
+
s = l;
|
|
793
793
|
break;
|
|
794
794
|
}
|
|
795
795
|
} catch {
|
|
@@ -820,7 +820,7 @@ function y(r) {
|
|
|
820
820
|
} catch {
|
|
821
821
|
}
|
|
822
822
|
try {
|
|
823
|
-
|
|
823
|
+
m(
|
|
824
824
|
"decodeEntities: using small SSR fallback entity map. Register the full entities.json via registerEntityMap(entities) on the server to enable full HTML5 named-entity decoding."
|
|
825
825
|
);
|
|
826
826
|
} catch {
|
|
@@ -828,11 +828,11 @@ function y(r) {
|
|
|
828
828
|
}
|
|
829
829
|
return e.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g, (o, i) => {
|
|
830
830
|
if (i.charCodeAt(0) === 35) {
|
|
831
|
-
const
|
|
832
|
-
return Number.isNaN(
|
|
831
|
+
const a = (i.charAt(1) || "").toLowerCase() === "x" ? parseInt(i.slice(2), 16) : parseInt(i.slice(1), 10);
|
|
832
|
+
return Number.isNaN(a) ? `&${i};` : String.fromCodePoint(a);
|
|
833
833
|
}
|
|
834
|
-
const
|
|
835
|
-
return
|
|
834
|
+
const c = s[i] ?? (t && t[i]);
|
|
835
|
+
return c !== void 0 ? c : `&${i};`;
|
|
836
836
|
});
|
|
837
837
|
}
|
|
838
838
|
async function z() {
|
|
@@ -921,7 +921,7 @@ function Ee(r, e, n) {
|
|
|
921
921
|
const t = String(e).split("."), s = t.pop();
|
|
922
922
|
if (!s) return;
|
|
923
923
|
const o = t.reduce(
|
|
924
|
-
(i,
|
|
924
|
+
(i, c) => (i[c] == null && (i[c] = {}), i[c]),
|
|
925
925
|
r
|
|
926
926
|
);
|
|
927
927
|
C(o[s]) ? o[s].value = n : o[s] = n;
|
|
@@ -955,31 +955,35 @@ function ve(r) {
|
|
|
955
955
|
}
|
|
956
956
|
return !1;
|
|
957
957
|
}
|
|
958
|
-
let
|
|
958
|
+
let b = null;
|
|
959
959
|
function Me() {
|
|
960
|
-
|
|
960
|
+
if (b !== null)
|
|
961
|
+
throw new Error(
|
|
962
|
+
"[CER] Concurrent SSR render detected: beginSSRGlobalStyleCollection() called while a collection is already active. For concurrent request handling, use worker threads or multiple Node.js processes."
|
|
963
|
+
);
|
|
964
|
+
b = [];
|
|
961
965
|
}
|
|
962
|
-
function
|
|
963
|
-
const r =
|
|
964
|
-
return
|
|
966
|
+
function Te() {
|
|
967
|
+
const r = b ?? [];
|
|
968
|
+
return b = null, r;
|
|
965
969
|
}
|
|
966
970
|
function re(r) {
|
|
967
|
-
return
|
|
971
|
+
return b !== null ? (r && !b.includes(r) && b.push(r), !0) : !1;
|
|
968
972
|
}
|
|
969
|
-
function
|
|
973
|
+
function De(r, e, n = "unknown") {
|
|
970
974
|
const t = {};
|
|
971
|
-
for (const [
|
|
972
|
-
t[F(
|
|
975
|
+
for (const [a, g] of Object.entries(e ?? {}))
|
|
976
|
+
t[F(a)] = g;
|
|
973
977
|
const s = {
|
|
974
|
-
getAttribute(
|
|
975
|
-
const
|
|
976
|
-
if (t[
|
|
977
|
-
return String(t[
|
|
978
|
-
const
|
|
979
|
-
return
|
|
978
|
+
getAttribute(a) {
|
|
979
|
+
const g = F(a);
|
|
980
|
+
if (t[g] !== void 0 && t[g] !== null)
|
|
981
|
+
return String(t[g]);
|
|
982
|
+
const h = (e ?? {})[a];
|
|
983
|
+
return h != null ? String(h) : null;
|
|
980
984
|
},
|
|
981
|
-
hasAttribute(
|
|
982
|
-
return this.getAttribute(
|
|
985
|
+
hasAttribute(a) {
|
|
986
|
+
return this.getAttribute(a) !== null;
|
|
983
987
|
},
|
|
984
988
|
// shadowRoot must be null so useJITCSS() doesn't try to registerJITCSSComponent
|
|
985
989
|
shadowRoot: null,
|
|
@@ -1001,48 +1005,46 @@ function Te(r, e, n = "unknown") {
|
|
|
1001
1005
|
writable: !0,
|
|
1002
1006
|
enumerable: !1,
|
|
1003
1007
|
configurable: !0
|
|
1004
|
-
}),
|
|
1005
|
-
let i = null;
|
|
1008
|
+
}), R(o);
|
|
1009
|
+
let i = null, c;
|
|
1006
1010
|
try {
|
|
1007
|
-
const
|
|
1011
|
+
const a = r.render(
|
|
1008
1012
|
o
|
|
1009
1013
|
);
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
} catch (u) {
|
|
1014
|
-
g(
|
|
1014
|
+
a instanceof Promise ? c = a : i = a;
|
|
1015
|
+
} catch (a) {
|
|
1016
|
+
m(
|
|
1015
1017
|
`[SSR] Component "${n}" threw during SSR render. The shadow DOM will be empty. Error:`,
|
|
1016
|
-
|
|
1018
|
+
a
|
|
1017
1019
|
);
|
|
1018
1020
|
} finally {
|
|
1019
1021
|
q();
|
|
1020
1022
|
}
|
|
1021
|
-
const
|
|
1023
|
+
const l = String(
|
|
1022
1024
|
o._computedStyle ?? ""
|
|
1023
1025
|
);
|
|
1024
|
-
return { shadowVNode: i, useStyleCSS:
|
|
1026
|
+
return { shadowVNode: i, useStyleCSS: l, asyncPromise: c };
|
|
1025
1027
|
}
|
|
1026
1028
|
function Ne() {
|
|
1027
|
-
return
|
|
1029
|
+
return p();
|
|
1028
1030
|
}
|
|
1029
|
-
let
|
|
1031
|
+
let u = null;
|
|
1030
1032
|
const k = /* @__PURE__ */ Symbol("cer:provides");
|
|
1031
|
-
function
|
|
1032
|
-
|
|
1033
|
+
function R(r) {
|
|
1034
|
+
u = r;
|
|
1033
1035
|
}
|
|
1034
1036
|
function q() {
|
|
1035
|
-
|
|
1037
|
+
u = null;
|
|
1036
1038
|
}
|
|
1037
1039
|
function xe() {
|
|
1038
|
-
return
|
|
1040
|
+
return u;
|
|
1039
1041
|
}
|
|
1040
|
-
function
|
|
1041
|
-
if (!
|
|
1042
|
+
function Re() {
|
|
1043
|
+
if (!u)
|
|
1042
1044
|
throw new Error("useEmit must be called during component render");
|
|
1043
|
-
if (
|
|
1045
|
+
if (p())
|
|
1044
1046
|
return () => !1;
|
|
1045
|
-
const r =
|
|
1047
|
+
const r = u.emit;
|
|
1046
1048
|
if (typeof r != "function")
|
|
1047
1049
|
throw new Error(
|
|
1048
1050
|
"useEmit requires an emit function on the component context"
|
|
@@ -1050,7 +1052,7 @@ function Ae() {
|
|
|
1050
1052
|
const e = r;
|
|
1051
1053
|
return (n, t, s) => e(n, t, s);
|
|
1052
1054
|
}
|
|
1053
|
-
function
|
|
1055
|
+
function w(r) {
|
|
1054
1056
|
r._hookCallbacks || Object.defineProperty(r, "_hookCallbacks", {
|
|
1055
1057
|
value: {},
|
|
1056
1058
|
writable: !0,
|
|
@@ -1058,56 +1060,56 @@ function b(r) {
|
|
|
1058
1060
|
configurable: !0
|
|
1059
1061
|
});
|
|
1060
1062
|
}
|
|
1061
|
-
function
|
|
1062
|
-
if (!
|
|
1063
|
+
function Ae(r) {
|
|
1064
|
+
if (!u)
|
|
1063
1065
|
throw new Error("useOnConnected must be called during component render");
|
|
1064
|
-
if (
|
|
1065
|
-
|
|
1066
|
-
const e =
|
|
1066
|
+
if (p()) return;
|
|
1067
|
+
w(u);
|
|
1068
|
+
const e = u._hookCallbacks;
|
|
1067
1069
|
e.onConnected || (e.onConnected = []), e.onConnected.push(r);
|
|
1068
1070
|
}
|
|
1069
1071
|
function Oe(r) {
|
|
1070
|
-
if (!
|
|
1072
|
+
if (!u)
|
|
1071
1073
|
throw new Error("useOnDisconnected must be called during component render");
|
|
1072
|
-
if (
|
|
1073
|
-
|
|
1074
|
-
const e =
|
|
1074
|
+
if (p()) return;
|
|
1075
|
+
w(u);
|
|
1076
|
+
const e = u._hookCallbacks;
|
|
1075
1077
|
e.onDisconnected || (e.onDisconnected = []), e.onDisconnected.push(r);
|
|
1076
1078
|
}
|
|
1077
1079
|
function Pe(r) {
|
|
1078
|
-
if (!
|
|
1080
|
+
if (!u)
|
|
1079
1081
|
throw new Error(
|
|
1080
1082
|
"useOnAttributeChanged must be called during component render"
|
|
1081
1083
|
);
|
|
1082
|
-
if (
|
|
1083
|
-
|
|
1084
|
-
const e =
|
|
1084
|
+
if (p()) return;
|
|
1085
|
+
w(u);
|
|
1086
|
+
const e = u._hookCallbacks;
|
|
1085
1087
|
e.onAttributeChanged || (e.onAttributeChanged = []), e.onAttributeChanged.push(r);
|
|
1086
1088
|
}
|
|
1087
1089
|
function Ie(r) {
|
|
1088
|
-
if (!
|
|
1090
|
+
if (!u)
|
|
1089
1091
|
throw new Error("useOnError must be called during component render");
|
|
1090
|
-
if (
|
|
1091
|
-
|
|
1092
|
-
const e =
|
|
1092
|
+
if (p()) return;
|
|
1093
|
+
w(u);
|
|
1094
|
+
const e = u._hookCallbacks;
|
|
1093
1095
|
e.onError || (e.onError = []), e.onError.push((n) => {
|
|
1094
1096
|
try {
|
|
1095
1097
|
n instanceof Error ? r(n) : r(new Error(String(n)));
|
|
1096
1098
|
} catch (t) {
|
|
1097
|
-
|
|
1099
|
+
T("[useOnError] The error handler itself threw an exception:", t);
|
|
1098
1100
|
}
|
|
1099
1101
|
});
|
|
1100
1102
|
}
|
|
1101
1103
|
function se(r) {
|
|
1102
|
-
if (!
|
|
1104
|
+
if (!u)
|
|
1103
1105
|
throw new Error("useProps must be called during component render");
|
|
1104
|
-
|
|
1105
|
-
const e =
|
|
1106
|
+
w(u);
|
|
1107
|
+
const e = u._hookCallbacks;
|
|
1106
1108
|
e.props = {
|
|
1107
1109
|
...e.props || {},
|
|
1108
1110
|
...r
|
|
1109
1111
|
};
|
|
1110
|
-
const n =
|
|
1112
|
+
const n = u;
|
|
1111
1113
|
try {
|
|
1112
1114
|
const s = Object.keys(r || {});
|
|
1113
1115
|
for (const o of s) {
|
|
@@ -1115,21 +1117,21 @@ function se(r) {
|
|
|
1115
1117
|
const i = Object.getOwnPropertyDescriptor(n, o);
|
|
1116
1118
|
if (!(i && !i.configurable))
|
|
1117
1119
|
try {
|
|
1118
|
-
let
|
|
1120
|
+
let l = Object.prototype.hasOwnProperty.call(n, o) ? n[o] : void 0;
|
|
1119
1121
|
Object.defineProperty(n, o, {
|
|
1120
1122
|
configurable: !0,
|
|
1121
1123
|
enumerable: !0,
|
|
1122
1124
|
get() {
|
|
1123
1125
|
try {
|
|
1124
|
-
const
|
|
1125
|
-
if (
|
|
1126
|
-
const
|
|
1127
|
-
if (
|
|
1126
|
+
const a = n && n._host;
|
|
1127
|
+
if (a) {
|
|
1128
|
+
const g = te(o), h = a.getAttribute(g);
|
|
1129
|
+
if (h !== null) {
|
|
1128
1130
|
const f = typeof r[o];
|
|
1129
|
-
return f === "boolean" ?
|
|
1131
|
+
return f === "boolean" ? h === "" || h === "true" : f === "number" ? Number(h) : h;
|
|
1130
1132
|
}
|
|
1131
|
-
if (typeof
|
|
1132
|
-
const f =
|
|
1133
|
+
if (typeof a[o] < "u") {
|
|
1134
|
+
const f = a[o];
|
|
1133
1135
|
if (C(f) || f && typeof f == "object" && "value" in f && !(f instanceof Node))
|
|
1134
1136
|
return f.value;
|
|
1135
1137
|
const P = typeof r[o];
|
|
@@ -1139,10 +1141,10 @@ function se(r) {
|
|
|
1139
1141
|
}
|
|
1140
1142
|
} catch {
|
|
1141
1143
|
}
|
|
1142
|
-
return
|
|
1144
|
+
return l;
|
|
1143
1145
|
},
|
|
1144
|
-
set(
|
|
1145
|
-
|
|
1146
|
+
set(a) {
|
|
1147
|
+
l = a;
|
|
1146
1148
|
}
|
|
1147
1149
|
});
|
|
1148
1150
|
} catch {
|
|
@@ -1155,24 +1157,24 @@ function se(r) {
|
|
|
1155
1157
|
if (typeof o != "string") return;
|
|
1156
1158
|
const i = r[o];
|
|
1157
1159
|
try {
|
|
1158
|
-
const
|
|
1159
|
-
if (
|
|
1160
|
-
if (
|
|
1161
|
-
const
|
|
1162
|
-
if (
|
|
1163
|
-
return typeof i == "boolean" ?
|
|
1160
|
+
const l = n && n._host;
|
|
1161
|
+
if (l) {
|
|
1162
|
+
if (l instanceof HTMLElement || typeof l.getAttribute == "function" && typeof l.hasAttribute == "function") {
|
|
1163
|
+
const g = o.replace(/([A-Z])/g, "-$1").toLowerCase(), h = l.getAttribute(g);
|
|
1164
|
+
if (h !== null)
|
|
1165
|
+
return typeof i == "boolean" ? h === "" || h === "true" : typeof i == "number" ? Number(h) : h;
|
|
1164
1166
|
}
|
|
1165
|
-
const
|
|
1166
|
-
if (typeof
|
|
1167
|
-
const
|
|
1168
|
-
if (!(typeof i == "string" &&
|
|
1169
|
-
return typeof i == "boolean" && i === !1 &&
|
|
1167
|
+
const a = l[o];
|
|
1168
|
+
if (typeof a < "u" && a !== "") {
|
|
1169
|
+
const g = a && typeof a == "object" && "value" in a && !(a instanceof Node);
|
|
1170
|
+
if (!(typeof i == "string" && a && typeof a == "object" && !g && !C(a)))
|
|
1171
|
+
return typeof i == "boolean" && i === !1 && a === "" ? i : C(a) || g ? a.value : typeof i == "boolean" && typeof a == "string" ? a === "" || a === "true" : typeof i == "number" && typeof a == "string" && !Number.isNaN(Number(a)) ? Number(a) : a;
|
|
1170
1172
|
}
|
|
1171
1173
|
}
|
|
1172
1174
|
} catch {
|
|
1173
1175
|
}
|
|
1174
|
-
const
|
|
1175
|
-
return typeof i == "boolean" &&
|
|
1176
|
+
const c = n[o];
|
|
1177
|
+
return typeof i == "boolean" && c === "" ? i === !1 ? i : !0 : C(c) || c && typeof c == "object" && "value" in c && !(c instanceof Node) ? c.value : c != null && c !== "" ? typeof i == "boolean" && typeof c == "string" ? c === "true" : typeof i == "number" && typeof c == "string" && !Number.isNaN(Number(c)) ? Number(c) : c : i;
|
|
1176
1178
|
},
|
|
1177
1179
|
has(s, o) {
|
|
1178
1180
|
return typeof o == "string" && (o in n || o in r);
|
|
@@ -1188,20 +1190,20 @@ function se(r) {
|
|
|
1188
1190
|
});
|
|
1189
1191
|
}
|
|
1190
1192
|
function He(r) {
|
|
1191
|
-
if (!
|
|
1193
|
+
if (!u)
|
|
1192
1194
|
throw new Error("useStyle must be called during component render");
|
|
1193
|
-
if (!
|
|
1194
|
-
|
|
1195
|
+
if (!p()) {
|
|
1196
|
+
w(u);
|
|
1195
1197
|
try {
|
|
1196
1198
|
const e = r();
|
|
1197
|
-
Object.defineProperty(
|
|
1199
|
+
Object.defineProperty(u, "_computedStyle", {
|
|
1198
1200
|
value: e,
|
|
1199
1201
|
writable: !0,
|
|
1200
1202
|
enumerable: !1,
|
|
1201
1203
|
configurable: !0
|
|
1202
1204
|
});
|
|
1203
1205
|
} catch (e) {
|
|
1204
|
-
|
|
1206
|
+
m("Error in useStyle callback:", e), Object.defineProperty(u, "_computedStyle", {
|
|
1205
1207
|
value: "",
|
|
1206
1208
|
writable: !0,
|
|
1207
1209
|
enumerable: !1,
|
|
@@ -1220,7 +1222,7 @@ function je(r) {
|
|
|
1220
1222
|
}
|
|
1221
1223
|
if (re(e) || typeof document > "u" || typeof CSSStyleSheet > "u")
|
|
1222
1224
|
return;
|
|
1223
|
-
|
|
1225
|
+
m(
|
|
1224
1226
|
"[useGlobalStyle] Injecting global styles from a component. This escapes Shadow DOM encapsulation — use sparingly."
|
|
1225
1227
|
);
|
|
1226
1228
|
const n = G(X(e));
|
|
@@ -1234,9 +1236,9 @@ function je(r) {
|
|
|
1234
1236
|
}
|
|
1235
1237
|
}
|
|
1236
1238
|
function Ue(r) {
|
|
1237
|
-
if (!
|
|
1239
|
+
if (!u)
|
|
1238
1240
|
throw new Error("useDesignTokens must be called during component render");
|
|
1239
|
-
if (
|
|
1241
|
+
if (p()) return;
|
|
1240
1242
|
const e = [], n = {
|
|
1241
1243
|
primary: "--cer-color-primary-500",
|
|
1242
1244
|
secondary: "--cer-color-secondary-500",
|
|
@@ -1250,23 +1252,23 @@ function Ue(r) {
|
|
|
1250
1252
|
fontSerif: "--cer-font-serif",
|
|
1251
1253
|
fontMono: "--cer-font-mono"
|
|
1252
1254
|
};
|
|
1253
|
-
for (const [
|
|
1254
|
-
|
|
1255
|
+
for (const [l, a] of Object.entries(r))
|
|
1256
|
+
a !== void 0 && (l in n ? e.push(`${n[l]}:${a}`) : l in t ? e.push(`${t[l]}:${a}`) : l.startsWith("--") && e.push(`${l}:${a}`));
|
|
1255
1257
|
if (e.length === 0) return;
|
|
1256
|
-
const s = `:host{${e.join(";")}}`, i =
|
|
1258
|
+
const s = `:host{${e.join(";")}}`, i = u._computedStyle ?? "", c = i ? `${i}
|
|
1257
1259
|
${s}` : s;
|
|
1258
|
-
Object.defineProperty(
|
|
1259
|
-
value:
|
|
1260
|
+
Object.defineProperty(u, "_computedStyle", {
|
|
1261
|
+
value: c,
|
|
1260
1262
|
writable: !0,
|
|
1261
1263
|
enumerable: !1,
|
|
1262
1264
|
configurable: !0
|
|
1263
1265
|
});
|
|
1264
1266
|
}
|
|
1265
1267
|
function Le(r, e) {
|
|
1266
|
-
if (!
|
|
1268
|
+
if (!u)
|
|
1267
1269
|
throw new Error("provide must be called during component render");
|
|
1268
|
-
if (
|
|
1269
|
-
const n =
|
|
1270
|
+
if (p()) return;
|
|
1271
|
+
const n = u;
|
|
1270
1272
|
n[k] || Object.defineProperty(n, k, {
|
|
1271
1273
|
value: /* @__PURE__ */ new Map(),
|
|
1272
1274
|
writable: !1,
|
|
@@ -1275,11 +1277,11 @@ function Le(r, e) {
|
|
|
1275
1277
|
}), n[k].set(r, e);
|
|
1276
1278
|
}
|
|
1277
1279
|
function Fe(r, e) {
|
|
1278
|
-
if (!
|
|
1280
|
+
if (!u)
|
|
1279
1281
|
throw new Error("inject must be called during component render");
|
|
1280
|
-
if (
|
|
1282
|
+
if (p()) return e;
|
|
1281
1283
|
try {
|
|
1282
|
-
const n =
|
|
1284
|
+
const n = u._host;
|
|
1283
1285
|
if (n) {
|
|
1284
1286
|
let t = n.parentNode;
|
|
1285
1287
|
t || (t = n.getRootNode());
|
|
@@ -1287,20 +1289,20 @@ function Fe(r, e) {
|
|
|
1287
1289
|
const o = 50;
|
|
1288
1290
|
for (; t && s < o; )
|
|
1289
1291
|
if (s++, t instanceof ShadowRoot) {
|
|
1290
|
-
const i = t.host,
|
|
1291
|
-
if (
|
|
1292
|
-
const
|
|
1293
|
-
if (
|
|
1294
|
-
return
|
|
1292
|
+
const i = t.host, c = i.context;
|
|
1293
|
+
if (c) {
|
|
1294
|
+
const a = c[k];
|
|
1295
|
+
if (a?.has(r))
|
|
1296
|
+
return a.get(r);
|
|
1295
1297
|
}
|
|
1296
1298
|
if (t = i.parentNode ?? i.getRootNode(), t === document || t === i) break;
|
|
1297
1299
|
} else {
|
|
1298
1300
|
if (t instanceof Element) {
|
|
1299
|
-
const
|
|
1300
|
-
if (
|
|
1301
|
-
const
|
|
1302
|
-
if (
|
|
1303
|
-
return
|
|
1301
|
+
const l = t.context;
|
|
1302
|
+
if (l) {
|
|
1303
|
+
const a = l[k];
|
|
1304
|
+
if (a?.has(r))
|
|
1305
|
+
return a.get(r);
|
|
1304
1306
|
}
|
|
1305
1307
|
}
|
|
1306
1308
|
const i = t;
|
|
@@ -1313,28 +1315,28 @@ function Fe(r, e) {
|
|
|
1313
1315
|
}
|
|
1314
1316
|
function We(r) {
|
|
1315
1317
|
return (e) => {
|
|
1316
|
-
const n = e ??
|
|
1318
|
+
const n = e ?? u;
|
|
1317
1319
|
if (!n)
|
|
1318
1320
|
throw new Error(
|
|
1319
1321
|
"createComposable: no component context available. Pass a context explicitly or call inside a render function."
|
|
1320
1322
|
);
|
|
1321
|
-
const t =
|
|
1322
|
-
|
|
1323
|
+
const t = u;
|
|
1324
|
+
R(n);
|
|
1323
1325
|
try {
|
|
1324
1326
|
return r();
|
|
1325
1327
|
} finally {
|
|
1326
|
-
t ?
|
|
1328
|
+
t ? R(t) : q();
|
|
1327
1329
|
}
|
|
1328
1330
|
};
|
|
1329
1331
|
}
|
|
1330
1332
|
function $e(r) {
|
|
1331
|
-
if (!
|
|
1333
|
+
if (!u)
|
|
1332
1334
|
throw new Error("useExpose must be called during component render");
|
|
1333
|
-
if (
|
|
1334
|
-
|
|
1335
|
-
const e =
|
|
1335
|
+
if (p()) return;
|
|
1336
|
+
w(u);
|
|
1337
|
+
const e = u._hookCallbacks;
|
|
1336
1338
|
e.expose = { ...e.expose ?? {}, ...r };
|
|
1337
|
-
const n =
|
|
1339
|
+
const n = u._host;
|
|
1338
1340
|
if (n)
|
|
1339
1341
|
for (const [t, s] of Object.entries(r))
|
|
1340
1342
|
try {
|
|
@@ -1343,11 +1345,11 @@ function $e(r) {
|
|
|
1343
1345
|
}
|
|
1344
1346
|
}
|
|
1345
1347
|
function Ve() {
|
|
1346
|
-
if (!
|
|
1348
|
+
if (!u)
|
|
1347
1349
|
throw new Error("useSlots must be called during component render");
|
|
1348
|
-
if (
|
|
1350
|
+
if (p())
|
|
1349
1351
|
return { has: () => !1, getNodes: () => [], names: () => [] };
|
|
1350
|
-
const r =
|
|
1352
|
+
const r = u._host, e = () => {
|
|
1351
1353
|
const n = /* @__PURE__ */ new Map();
|
|
1352
1354
|
if (!r) return n;
|
|
1353
1355
|
for (const t of r.children) {
|
|
@@ -1382,19 +1384,19 @@ function Ve() {
|
|
|
1382
1384
|
};
|
|
1383
1385
|
}
|
|
1384
1386
|
function ze(...r) {
|
|
1385
|
-
if (!
|
|
1387
|
+
if (!u)
|
|
1386
1388
|
throw new Error("defineModel must be called during component render");
|
|
1387
1389
|
const e = r.length === 2 ? r[0] : "modelValue", n = r.length === 2 ? r[1] : r.length === 1 ? r[0] : void 0, t = se({
|
|
1388
1390
|
[e]: n
|
|
1389
|
-
}), o =
|
|
1390
|
-
const
|
|
1391
|
-
return typeof
|
|
1391
|
+
}), o = p() ? null : (() => {
|
|
1392
|
+
const c = u.emit;
|
|
1393
|
+
return typeof c != "function" ? null : c;
|
|
1392
1394
|
})(), i = {
|
|
1393
1395
|
get value() {
|
|
1394
1396
|
return t[e];
|
|
1395
1397
|
},
|
|
1396
|
-
set value(
|
|
1397
|
-
o && o(`update:${e}`,
|
|
1398
|
+
set value(c) {
|
|
1399
|
+
o && o(`update:${e}`, c);
|
|
1398
1400
|
}
|
|
1399
1401
|
};
|
|
1400
1402
|
try {
|
|
@@ -1417,21 +1419,22 @@ export {
|
|
|
1417
1419
|
_e as G,
|
|
1418
1420
|
F as H,
|
|
1419
1421
|
ve as I,
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1422
|
+
K as J,
|
|
1423
|
+
B as K,
|
|
1424
|
+
R as L,
|
|
1425
|
+
le as M,
|
|
1426
|
+
de as N,
|
|
1427
|
+
q as O,
|
|
1428
|
+
ke as P,
|
|
1429
|
+
p as Q,
|
|
1428
1430
|
x as R,
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1431
|
+
ye as S,
|
|
1432
|
+
De as T,
|
|
1433
|
+
Me as U,
|
|
1434
|
+
Te as V,
|
|
1435
|
+
be as W,
|
|
1436
|
+
z as X,
|
|
1437
|
+
Ce as Y,
|
|
1435
1438
|
$e as a,
|
|
1436
1439
|
se as b,
|
|
1437
1440
|
d as c,
|
|
@@ -1448,15 +1451,15 @@ export {
|
|
|
1448
1451
|
ue as n,
|
|
1449
1452
|
Ue as o,
|
|
1450
1453
|
Le as p,
|
|
1451
|
-
|
|
1454
|
+
Re as q,
|
|
1452
1455
|
fe as r,
|
|
1453
1456
|
ae as s,
|
|
1454
1457
|
je as t,
|
|
1455
1458
|
Ie as u,
|
|
1456
1459
|
Pe as v,
|
|
1457
|
-
|
|
1460
|
+
Ae as w,
|
|
1458
1461
|
Oe as x,
|
|
1459
1462
|
Ve as y,
|
|
1460
1463
|
He as z
|
|
1461
1464
|
};
|
|
1462
|
-
//# sourceMappingURL=hooks-
|
|
1465
|
+
//# sourceMappingURL=hooks-xWZhQHco.js.map
|