@jasonshimmy/custom-elements-runtime 3.5.0 → 3.7.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/README.md +10 -9
- package/dist/custom-elements-runtime.cjs.js +2 -2
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +25 -4
- package/dist/custom-elements-runtime.es.js.map +1 -1
- 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 +3 -3
- package/dist/custom-elements-runtime.ssr-middleware.cjs.js +1 -1
- package/dist/custom-elements-runtime.ssr-middleware.es.js +1 -1
- package/dist/custom-elements-runtime.ssr.cjs.js +1 -1
- package/dist/custom-elements-runtime.ssr.es.js +2 -2
- package/dist/custom-elements-runtime.vite-plugin.cjs.js +1 -1
- package/dist/custom-elements-runtime.vite-plugin.es.js +1 -1
- package/dist/{helpers-DcEpRwq5.cjs → helpers-7zLtbh_q.cjs} +2 -2
- package/dist/helpers-7zLtbh_q.cjs.map +1 -0
- package/dist/{helpers-tJgb4Qve.js → helpers-kOWgceUQ.js} +4 -1
- package/dist/helpers-kOWgceUQ.js.map +1 -0
- package/dist/{hooks-CNfugc95.cjs → hooks-BY_35J9Y.cjs} +2 -2
- package/dist/{hooks-CNfugc95.cjs.map → hooks-BY_35J9Y.cjs.map} +1 -1
- package/dist/{hooks-CEUnvtsA.js → hooks-Dj1xwqpK.js} +2 -2
- package/dist/{hooks-CEUnvtsA.js.map → hooks-Dj1xwqpK.js.map} +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/runtime/component/async-component.d.ts +48 -0
- package/dist/runtime/render.d.ts +7 -0
- package/dist/{ssr-BpYy9XlW.js → ssr-Bg9jYXYv.js} +14 -13
- package/dist/{ssr-BpYy9XlW.js.map → ssr-Bg9jYXYv.js.map} +1 -1
- package/dist/{ssr-CFabTOyi.cjs → ssr-CucZ-Iwz.cjs} +3 -3
- package/dist/{ssr-CFabTOyi.cjs.map → ssr-CucZ-Iwz.cjs.map} +1 -1
- package/dist/ssr.d.ts +2 -0
- package/dist/{tag-utils-CoSXTr1F.js → tag-utils-Dg0vRKq9.js} +2 -2
- package/dist/{tag-utils-CoSXTr1F.js.map → tag-utils-Dg0vRKq9.js.map} +1 -1
- package/dist/{tag-utils-XJ3dkcPQ.cjs → tag-utils-ZOoyzCm9.cjs} +2 -2
- package/dist/{tag-utils-XJ3dkcPQ.cjs.map → tag-utils-ZOoyzCm9.cjs.map} +1 -1
- package/dist/{template-compiler-B4B_jAPN.cjs → template-compiler-BngILG2f.cjs} +6 -6
- package/dist/{template-compiler-B4B_jAPN.cjs.map → template-compiler-BngILG2f.cjs.map} +1 -1
- package/dist/{template-compiler-C3h8_vbE.js → template-compiler-q_rTI8PA.js} +63 -52
- package/dist/{template-compiler-C3h8_vbE.js.map → template-compiler-q_rTI8PA.js.map} +1 -1
- package/package.json +1 -1
- package/dist/helpers-DcEpRwq5.cjs.map +0 -1
- package/dist/helpers-tJgb4Qve.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as e, t } from "./logger-DIJ0UH3R.js";
|
|
2
2
|
import { a as n, i as r, n as i, o as a, r as o } from "./namespace-helpers-CIUkG8Mn.js";
|
|
3
|
-
import { C as s, O as c, S as l, T as u, _ as d, a as f, d as p, f as m, i as h, l as g, n as _, o as v, p as y, u as b, v as x, w as S } from "./helpers-
|
|
3
|
+
import { C as s, O as c, S as l, T as u, _ as d, a as f, d as p, f as m, i as h, l as g, n as _, o as v, p as y, u as b, v as x, w as S } from "./helpers-kOWgceUQ.js";
|
|
4
4
|
import { a as C, d as w, f as T, i as E, n as ee, r as D, u as O } from "./css-utils-Bn-dO44e.js";
|
|
5
5
|
import { resetWhenCounter as te } from "./custom-elements-runtime.directives.es.js";
|
|
6
6
|
import { getTransitionStyleSheet as ne } from "./custom-elements-runtime.transitions.es.js";
|
|
7
|
-
import { t as re } from "./tag-utils-
|
|
8
|
-
import { c as ie, t as k } from "./hooks-
|
|
7
|
+
import { t as re } from "./tag-utils-Dg0vRKq9.js";
|
|
8
|
+
import { c as ie, t as k } from "./hooks-Dj1xwqpK.js";
|
|
9
9
|
//#region src/lib/runtime/watchers.ts
|
|
10
10
|
function ae(e, n, r) {
|
|
11
11
|
if (r) for (let [i, a] of Object.entries(r)) {
|
|
@@ -2002,15 +2002,26 @@ function Ve(e, t, n, r) {
|
|
|
2002
2002
|
}
|
|
2003
2003
|
//#endregion
|
|
2004
2004
|
//#region src/lib/runtime/render.ts
|
|
2005
|
-
var Y = [], He = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap();
|
|
2006
|
-
function
|
|
2005
|
+
var Y = [], He = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new Map();
|
|
2006
|
+
function We(e) {
|
|
2007
|
+
if (typeof CSSStyleSheet > "u" || !("replaceSync" in CSSStyleSheet.prototype)) return null;
|
|
2008
|
+
let t = Ue.get(e);
|
|
2009
|
+
if (t) return t;
|
|
2010
|
+
try {
|
|
2011
|
+
let t = new CSSStyleSheet();
|
|
2012
|
+
return t.replaceSync(e), Ue.set(e, t), t;
|
|
2013
|
+
} catch {
|
|
2014
|
+
return null;
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
function Ge(e, t) {
|
|
2007
2018
|
X.has(e) || X.set(e, /* @__PURE__ */ new Set()), X.get(e).add(t);
|
|
2008
2019
|
}
|
|
2009
|
-
function
|
|
2020
|
+
function Ke(e, t) {
|
|
2010
2021
|
let n = X.get(e);
|
|
2011
2022
|
n && (n.delete(t), n.size === 0 && X.delete(e));
|
|
2012
2023
|
}
|
|
2013
|
-
function
|
|
2024
|
+
function qe(e, n, r, i, a, o, s, c) {
|
|
2014
2025
|
if (e) {
|
|
2015
2026
|
Y.push(r);
|
|
2016
2027
|
try {
|
|
@@ -2019,7 +2030,7 @@ function Ge(e, n, r, i, a, o, s, c) {
|
|
|
2019
2030
|
o(!0);
|
|
2020
2031
|
let n = e.host.isConnected, u = e, d = u._asyncRenderToken = (u._asyncRenderToken ?? 0) + 1;
|
|
2021
2032
|
l.then((t) => {
|
|
2022
|
-
n && !e.host.isConnected || u._asyncRenderToken === d && (o(!1), s(null),
|
|
2033
|
+
n && !e.host.isConnected || u._asyncRenderToken === d && (o(!1), s(null), Je(e, t, r, i, a), c(e.innerHTML));
|
|
2023
2034
|
}).catch((r) => {
|
|
2024
2035
|
if (n && !e.host.isConnected || u._asyncRenderToken !== d) return;
|
|
2025
2036
|
o(!1);
|
|
@@ -2028,7 +2039,7 @@ function Ge(e, n, r, i, a, o, s, c) {
|
|
|
2028
2039
|
});
|
|
2029
2040
|
return;
|
|
2030
2041
|
}
|
|
2031
|
-
|
|
2042
|
+
Je(e, l, r, i, a), c(e.innerHTML);
|
|
2032
2043
|
} catch (n) {
|
|
2033
2044
|
let r = n instanceof Error ? n : Error(String(n));
|
|
2034
2045
|
t(`[${e.host.tagName.toLowerCase()}] Render error:`, r), s(r);
|
|
@@ -2037,10 +2048,10 @@ function Ge(e, n, r, i, a, o, s, c) {
|
|
|
2037
2048
|
}
|
|
2038
2049
|
}
|
|
2039
2050
|
}
|
|
2040
|
-
function
|
|
2051
|
+
function Je(e, t, n, r, i) {
|
|
2041
2052
|
e && (Ve(e, Array.isArray(t) ? t : [t], n, r), i(e.innerHTML));
|
|
2042
2053
|
}
|
|
2043
|
-
function
|
|
2054
|
+
function Ye(n, r, i, a, o, s, c) {
|
|
2044
2055
|
s !== null && clearTimeout(s);
|
|
2045
2056
|
let l = Date.now() - r < 16, { isVitest: d, isCypress: f, isTest: p } = u(), m = (d || p) && !f;
|
|
2046
2057
|
if (l) {
|
|
@@ -2068,7 +2079,7 @@ function qe(n, r, i, a, o, s, c) {
|
|
|
2068
2079
|
};
|
|
2069
2080
|
h > 0 ? c(setTimeout(g, h)) : p ? g() : (c({}), queueMicrotask(g));
|
|
2070
2081
|
}
|
|
2071
|
-
function
|
|
2082
|
+
function Xe(e, t) {
|
|
2072
2083
|
let n = t;
|
|
2073
2084
|
try {
|
|
2074
2085
|
let t = X.get(e);
|
|
@@ -2086,22 +2097,22 @@ function Je(e, t) {
|
|
|
2086
2097
|
} catch {}
|
|
2087
2098
|
return n;
|
|
2088
2099
|
}
|
|
2089
|
-
function
|
|
2100
|
+
function Ze(e) {
|
|
2090
2101
|
return "adoptedStyleSheets" in e && typeof CSSStyleSheet < "u" && "replaceSync" in CSSStyleSheet.prototype;
|
|
2091
2102
|
}
|
|
2092
|
-
function
|
|
2103
|
+
function Qe(e, t) {
|
|
2093
2104
|
let n = e.querySelector("style[data-cer-runtime]");
|
|
2094
2105
|
n || (n = document.createElement("style"), r(n, "data-cer-runtime", "true"), e.appendChild(n));
|
|
2095
2106
|
try {
|
|
2096
2107
|
n.textContent = t;
|
|
2097
2108
|
} catch {}
|
|
2098
2109
|
}
|
|
2099
|
-
function
|
|
2110
|
+
function $e(e, t, n, r, i) {
|
|
2100
2111
|
if (!e) return;
|
|
2101
|
-
let a =
|
|
2112
|
+
let a = Xe(e, n);
|
|
2102
2113
|
if (He.get(e) === a) return;
|
|
2103
2114
|
He.set(e, a);
|
|
2104
|
-
let o = D(e) ? E(a) : "", s = ee(), c = t._computedStyle, l =
|
|
2115
|
+
let o = D(e) ? E(a) : "", s = ee(), c = t._computedStyle, l = Ze(e), u = ne(), d = "";
|
|
2105
2116
|
if (!l) try {
|
|
2106
2117
|
u?.cssRules && (d = Array.from(u.cssRules).map((e) => e.cssText).join("\n"));
|
|
2107
2118
|
} catch {
|
|
@@ -2110,7 +2121,7 @@ function Ze(e, t, n, r, i) {
|
|
|
2110
2121
|
if (!o?.trim() && !c && !s) {
|
|
2111
2122
|
if (i(null), l) e.adoptedStyleSheets = [O(), u];
|
|
2112
2123
|
else {
|
|
2113
|
-
|
|
2124
|
+
Qe(e, w(`${w(C)}\n${d}`));
|
|
2114
2125
|
try {
|
|
2115
2126
|
e.adoptedStyleSheets = [O(), u];
|
|
2116
2127
|
} catch {}
|
|
@@ -2119,16 +2130,16 @@ function Ze(e, t, n, r, i) {
|
|
|
2119
2130
|
}
|
|
2120
2131
|
let f = "";
|
|
2121
2132
|
if (c && (f += c + "\n"), o && (f += o + "\n"), f = T(f), f = w(f), l) {
|
|
2122
|
-
let t =
|
|
2123
|
-
t ||= new CSSStyleSheet();
|
|
2133
|
+
let t = !o?.trim() && !!c, n;
|
|
2134
|
+
t ? (n = We(f), n ||= new CSSStyleSheet()) : (n = r, n ||= new CSSStyleSheet());
|
|
2124
2135
|
try {
|
|
2125
|
-
t.replaceSync(f);
|
|
2126
|
-
let
|
|
2127
|
-
s &&
|
|
2136
|
+
t || n.replaceSync(f);
|
|
2137
|
+
let r = [O(), u];
|
|
2138
|
+
s && r.push(s), r.push(n), e.adoptedStyleSheets = r, i(t ? null : n);
|
|
2128
2139
|
return;
|
|
2129
2140
|
} catch {}
|
|
2130
2141
|
}
|
|
2131
|
-
|
|
2142
|
+
Qe(e, w(`${w(C)}\n${d}\n${f}`));
|
|
2132
2143
|
try {
|
|
2133
2144
|
let t = [O(), u];
|
|
2134
2145
|
if (s && t.push(s), typeof CSSStyleSheet < "u") try {
|
|
@@ -2146,7 +2157,7 @@ function Ze(e, t, n, r, i) {
|
|
|
2146
2157
|
}
|
|
2147
2158
|
//#endregion
|
|
2148
2159
|
//#region src/lib/runtime/component/element-class.ts
|
|
2149
|
-
function
|
|
2160
|
+
function et(n, r) {
|
|
2150
2161
|
if (!r.render) throw Error("Component must have a render function");
|
|
2151
2162
|
return typeof window > "u" ? class {
|
|
2152
2163
|
constructor() {}
|
|
@@ -2232,7 +2243,7 @@ function Qe(n, r) {
|
|
|
2232
2243
|
connectedCallback() {
|
|
2233
2244
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2234
2245
|
let e = this.getRootNode();
|
|
2235
|
-
e && e !== document && "host" in e &&
|
|
2246
|
+
e && e !== document && "host" in e && Ge(e, this);
|
|
2236
2247
|
let t = this.getAttribute("data-cer-hydrate");
|
|
2237
2248
|
if (t !== "none") {
|
|
2238
2249
|
if (t === "idle") {
|
|
@@ -2265,7 +2276,7 @@ function Qe(n, r) {
|
|
|
2265
2276
|
disconnectedCallback() {
|
|
2266
2277
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
2267
2278
|
let e = this.getRootNode();
|
|
2268
|
-
e && e !== document && "host" in e &&
|
|
2279
|
+
e && e !== document && "host" in e && Ke(e, this), de(r, this.context, this._listeners, () => {
|
|
2269
2280
|
this._listeners = [];
|
|
2270
2281
|
}, () => {
|
|
2271
2282
|
this._watchers.clear();
|
|
@@ -2288,7 +2299,7 @@ function Qe(n, r) {
|
|
|
2288
2299
|
}
|
|
2289
2300
|
_render(e) {
|
|
2290
2301
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
2291
|
-
|
|
2302
|
+
qe(this.shadowRoot, e, this.context, this._refs, (e) => {
|
|
2292
2303
|
this._lastHtmlStringForJitCSS = e, typeof this.onHtmlStringUpdate == "function" && this?.onHtmlStringUpdate?.(e);
|
|
2293
2304
|
}, (e) => {
|
|
2294
2305
|
this._templateLoading = e, this?.onLoadingStateChange?.(e);
|
|
@@ -2303,7 +2314,7 @@ function Qe(n, r) {
|
|
|
2303
2314
|
_requestRender() {
|
|
2304
2315
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
2305
2316
|
c(() => {
|
|
2306
|
-
|
|
2317
|
+
Ye(() => this._render(this._cfg), this._lastRenderTime, this._renderCount, (e) => {
|
|
2307
2318
|
this._lastRenderTime = e;
|
|
2308
2319
|
}, (e) => {
|
|
2309
2320
|
this._renderCount = e;
|
|
@@ -2315,7 +2326,7 @@ function Qe(n, r) {
|
|
|
2315
2326
|
}
|
|
2316
2327
|
_applyStyle(e, t) {
|
|
2317
2328
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
2318
|
-
|
|
2329
|
+
$e(this.shadowRoot, this.context, t, this._styleSheet, (e) => {
|
|
2319
2330
|
this._styleSheet = e;
|
|
2320
2331
|
});
|
|
2321
2332
|
});
|
|
@@ -2435,14 +2446,14 @@ function Qe(n, r) {
|
|
|
2435
2446
|
}
|
|
2436
2447
|
//#endregion
|
|
2437
2448
|
//#region src/lib/runtime/component/factory.ts
|
|
2438
|
-
function
|
|
2449
|
+
function tt(e, n, r, i) {
|
|
2439
2450
|
for (let a of r) try {
|
|
2440
2451
|
a(...i);
|
|
2441
2452
|
} catch (r) {
|
|
2442
2453
|
t(`[${e}] Error in ${n} lifecycle hook:`, r);
|
|
2443
2454
|
}
|
|
2444
2455
|
}
|
|
2445
|
-
function
|
|
2456
|
+
function nt(r, i, o) {
|
|
2446
2457
|
n();
|
|
2447
2458
|
let c = re(r), u = {}, d = {
|
|
2448
2459
|
props: {},
|
|
@@ -2531,19 +2542,19 @@ function et(r, i, o) {
|
|
|
2531
2542
|
if (e.onConnected) {
|
|
2532
2543
|
let t = e.onConnected;
|
|
2533
2544
|
u.onConnected = (e) => {
|
|
2534
|
-
|
|
2545
|
+
tt(c, "useOnConnected", t, [e]);
|
|
2535
2546
|
};
|
|
2536
2547
|
}
|
|
2537
2548
|
if (e.onDisconnected) {
|
|
2538
2549
|
let t = e.onDisconnected;
|
|
2539
2550
|
u.onDisconnected = (e) => {
|
|
2540
|
-
|
|
2551
|
+
tt(c, "useOnDisconnected", t, [e]);
|
|
2541
2552
|
};
|
|
2542
2553
|
}
|
|
2543
2554
|
if (e.onAttributeChanged) {
|
|
2544
2555
|
let t = e.onAttributeChanged;
|
|
2545
2556
|
u.onAttributeChanged = (e, n, r, i) => {
|
|
2546
|
-
|
|
2557
|
+
tt(c, "useOnAttributeChanged", t, [
|
|
2547
2558
|
e,
|
|
2548
2559
|
n,
|
|
2549
2560
|
r,
|
|
@@ -2554,7 +2565,7 @@ function et(r, i, o) {
|
|
|
2554
2565
|
if (e.onError) {
|
|
2555
2566
|
let t = e.onError;
|
|
2556
2567
|
u.onError = (e) => {
|
|
2557
|
-
|
|
2568
|
+
tt(c, "useOnError", t, [e]);
|
|
2558
2569
|
};
|
|
2559
2570
|
}
|
|
2560
2571
|
if (e.props && !Object.keys(d.props ?? {}).length) {
|
|
@@ -2606,7 +2617,7 @@ function et(r, i, o) {
|
|
|
2606
2617
|
} catch (t) {
|
|
2607
2618
|
e(`[${c}] Failed to register component. Check your component definition for errors.`, t);
|
|
2608
2619
|
}
|
|
2609
|
-
typeof customElements < "u" && !customElements.get(c) && customElements.define(c,
|
|
2620
|
+
typeof customElements < "u" && !customElements.get(c) && customElements.define(c, et(c, d));
|
|
2610
2621
|
}
|
|
2611
2622
|
}
|
|
2612
2623
|
//#endregion
|
|
@@ -2625,7 +2636,7 @@ function Q(e) {
|
|
|
2625
2636
|
function $(e) {
|
|
2626
2637
|
return typeof e == "object" && !!e && "tag" in e && !Q(e);
|
|
2627
2638
|
}
|
|
2628
|
-
function
|
|
2639
|
+
function rt(e, t) {
|
|
2629
2640
|
return e.key == null ? {
|
|
2630
2641
|
...e,
|
|
2631
2642
|
key: t
|
|
@@ -2633,14 +2644,14 @@ function tt(e, t) {
|
|
|
2633
2644
|
}
|
|
2634
2645
|
//#endregion
|
|
2635
2646
|
//#region src/lib/runtime/template-compiler/props-parser.ts
|
|
2636
|
-
function
|
|
2647
|
+
function it(t, n) {
|
|
2637
2648
|
if (t == null) {
|
|
2638
2649
|
e(`⚠️ Event handler for '@${n}' is ${t}. This will prevent the event from working. Use a function reference instead: @${n}="\${functionName}"`);
|
|
2639
2650
|
return;
|
|
2640
2651
|
}
|
|
2641
2652
|
typeof t != "function" && e(`🚨 Potential infinite loop detected! Event handler for '@${n}' appears to be the result of a function call (${typeof t}) instead of a function reference. Change @${n}="\${functionName()}" to @${n}="\${functionName}" to pass the function reference instead of calling it immediately.`), t === void 0 && typeof t != "function" && e(`💡 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()}"`);
|
|
2642
2653
|
}
|
|
2643
|
-
function
|
|
2654
|
+
function at(e, t = [], n = {}) {
|
|
2644
2655
|
let r = {}, i = {}, a = {}, o = [], s = /([:@#]?)([a-zA-Z0-9-:.]+)(?:\s*=\s*("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|([^\s>]+)))?/g, c;
|
|
2645
2656
|
for (; c = s.exec(e);) {
|
|
2646
2657
|
let e = c[1], s = c[2], l = "";
|
|
@@ -2685,7 +2696,7 @@ function rt(e, t = [], n = {}) {
|
|
|
2685
2696
|
}
|
|
2686
2697
|
} else if (e === "@") {
|
|
2687
2698
|
let [e, ...t] = s.split("."), i = t;
|
|
2688
|
-
|
|
2699
|
+
it(m, e);
|
|
2689
2700
|
let a = typeof m == "function" ? m : typeof n[m] == "function" ? n[m] : void 0;
|
|
2690
2701
|
if (a) {
|
|
2691
2702
|
let t = (n) => {
|
|
@@ -2704,7 +2715,7 @@ function rt(e, t = [], n = {}) {
|
|
|
2704
2715
|
}
|
|
2705
2716
|
//#endregion
|
|
2706
2717
|
//#region src/lib/runtime/template-compiler/impl.ts
|
|
2707
|
-
function
|
|
2718
|
+
function ot(e) {
|
|
2708
2719
|
if (!$(e) || Q(e)) return e;
|
|
2709
2720
|
let t = e.props?.directives;
|
|
2710
2721
|
if (t && t.when) {
|
|
@@ -2716,14 +2727,14 @@ function it(e) {
|
|
|
2716
2727
|
...e,
|
|
2717
2728
|
props: a
|
|
2718
2729
|
};
|
|
2719
|
-
return Array.isArray(o.children) && (o.children = o.children.map((e) => typeof e == "object" && e ?
|
|
2730
|
+
return Array.isArray(o.children) && (o.children = o.children.map((e) => typeof e == "object" && e ? ot(e) : e)), {
|
|
2720
2731
|
tag: "#anchor",
|
|
2721
2732
|
key: e.key == null ? `when-${e.tag}` : `when-${e.key}`,
|
|
2722
2733
|
children: r ? [o] : []
|
|
2723
2734
|
};
|
|
2724
2735
|
}
|
|
2725
2736
|
if (Array.isArray(e.children)) {
|
|
2726
|
-
let t = e.children.map((e) => typeof e == "object" && e ?
|
|
2737
|
+
let t = e.children.map((e) => typeof e == "object" && e ? ot(e) : e);
|
|
2727
2738
|
return {
|
|
2728
2739
|
...e,
|
|
2729
2740
|
children: t
|
|
@@ -2731,7 +2742,7 @@ function it(e) {
|
|
|
2731
2742
|
}
|
|
2732
2743
|
return e;
|
|
2733
2744
|
}
|
|
2734
|
-
function
|
|
2745
|
+
function st(e, t, n) {
|
|
2735
2746
|
let r = Y.length > 0 ? Y[Y.length - 1] : void 0, i = n ?? r, a = !n && t.length === 0, o = a ? e.join("<!--TEMPLATE_DELIM-->") : null;
|
|
2736
2747
|
if (a && o) {
|
|
2737
2748
|
let e = me.get(o);
|
|
@@ -2786,7 +2797,7 @@ function at(e, t, n) {
|
|
|
2786
2797
|
return;
|
|
2787
2798
|
}
|
|
2788
2799
|
if ($(e)) {
|
|
2789
|
-
n.push(
|
|
2800
|
+
n.push(rt(e, void 0));
|
|
2790
2801
|
return;
|
|
2791
2802
|
}
|
|
2792
2803
|
if (Array.isArray(e)) {
|
|
@@ -2826,7 +2837,7 @@ function at(e, t, n) {
|
|
|
2826
2837
|
]);
|
|
2827
2838
|
for (; S = u.exec(l);) if (!(S[0].startsWith("<!--") && S[0].endsWith("-->"))) {
|
|
2828
2839
|
if (S[1]) {
|
|
2829
|
-
let e = S[1], n = S[0][1] === "/", r = S[0][S[0].length - 2] === "/" || ie.has(e), { props: a, attrs: o, directives: s, bound: c } =
|
|
2840
|
+
let e = S[1], n = S[0][1] === "/", r = S[0][S[0].length - 2] === "/" || ie.has(e), { props: a, attrs: o, directives: s, bound: c } = at(S[2] || "", t, i ?? {}), l = {
|
|
2830
2841
|
props: {},
|
|
2831
2842
|
attrs: {}
|
|
2832
2843
|
};
|
|
@@ -3021,7 +3032,7 @@ function at(e, t, n) {
|
|
|
3021
3032
|
}
|
|
3022
3033
|
}
|
|
3023
3034
|
}
|
|
3024
|
-
let k = D.filter((e) => $(e) && e.tag === "#text" ? typeof e.children == "string" && e.children.trim() !== "" : !0).map((e) =>
|
|
3035
|
+
let k = D.filter((e) => $(e) && e.tag === "#text" ? typeof e.children == "string" && e.children.trim() !== "" : !0).map((e) => ot(e));
|
|
3025
3036
|
if (k.length === 1) {
|
|
3026
3037
|
let e = k[0];
|
|
3027
3038
|
return a && o && me.set(o, e), e;
|
|
@@ -3033,12 +3044,12 @@ function at(e, t, n) {
|
|
|
3033
3044
|
}
|
|
3034
3045
|
//#endregion
|
|
3035
3046
|
//#region src/lib/runtime/template-compiler.ts
|
|
3036
|
-
function
|
|
3047
|
+
function ct(e, ...t) {
|
|
3037
3048
|
if (S()) return [];
|
|
3038
3049
|
let n = t[t.length - 1];
|
|
3039
|
-
return
|
|
3050
|
+
return st(e, t, typeof n == "object" && n && !Array.isArray(n) ? n : void 0);
|
|
3040
3051
|
}
|
|
3041
3052
|
//#endregion
|
|
3042
|
-
export {
|
|
3053
|
+
export { nt as n, Ve as r, ct as t };
|
|
3043
3054
|
|
|
3044
|
-
//# sourceMappingURL=template-compiler-
|
|
3055
|
+
//# sourceMappingURL=template-compiler-q_rTI8PA.js.map
|