@mgdis/stencil-helpers 3.2.5 → 3.2.6
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/index.es.js +73 -73
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +7 -7
- package/dist/index.umd.js.map +1 -1
- package/package.json +6 -6
package/dist/index.es.js
CHANGED
|
@@ -33,8 +33,8 @@ class Yt {
|
|
|
33
33
|
*/
|
|
34
34
|
join = () => this.classes.join(" ");
|
|
35
35
|
}
|
|
36
|
-
const
|
|
37
|
-
if (!
|
|
36
|
+
const Z = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, qe = (e, t, r) => {
|
|
37
|
+
if (!Z(e) || typeof t != "string")
|
|
38
38
|
return r;
|
|
39
39
|
const [n, ...i] = t.split(".");
|
|
40
40
|
return i.length ? qe(e[n], i.join("."), r) : e[n] ?? r;
|
|
@@ -45,7 +45,7 @@ const U = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, qe = (
|
|
|
45
45
|
return e !== "" ? `${e}-${s}` : s;
|
|
46
46
|
}, rr = (e) => Ge(e) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e) !== null, sr = (e) => {
|
|
47
47
|
let t;
|
|
48
|
-
return typeof e == "string" ? t = e : e && typeof e == "object" && (
|
|
48
|
+
return typeof e == "string" ? t = e : e && typeof e == "object" && (Z(e) || Array.isArray(e)) ? t = JSON.stringify(e) : e != null && typeof e != "boolean" && typeof e != "object" && (t = String(e)), t && Je(t);
|
|
49
49
|
}, nr = async (e) => {
|
|
50
50
|
if (e)
|
|
51
51
|
return e();
|
|
@@ -77,7 +77,7 @@ class Ke {
|
|
|
77
77
|
*/
|
|
78
78
|
baseIndex = 1;
|
|
79
79
|
constructor(t) {
|
|
80
|
-
if (
|
|
80
|
+
if (Z(t))
|
|
81
81
|
Array.isArray(t.items) && (this.items = t.items), typeof t.top == "number" && (this.top = t.top), this.total = typeof t.total == "number" ? t.total : this.items.length, this.next = t.next;
|
|
82
82
|
else
|
|
83
83
|
throw new Error("Page - init must match IPage type.");
|
|
@@ -112,7 +112,7 @@ class or {
|
|
|
112
112
|
#t;
|
|
113
113
|
#r;
|
|
114
114
|
constructor(t, r) {
|
|
115
|
-
Array.isArray(t) && (this.items = t), r && (["string", "function"].includes(typeof r.next) ||
|
|
115
|
+
Array.isArray(t) && (this.items = t), r && (["string", "function"].includes(typeof r.next) || Z(r.next) && URL.canParse(r.next)) && (this.#t = r.next), typeof r?.top == "number" && (this.#e = r.top), typeof r?.total == "number" && (this.#r = r.total);
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
118
118
|
* Get page
|
|
@@ -338,7 +338,7 @@ Type: \`${e.type}\``, gr = (e, t, r, s) => ({
|
|
|
338
338
|
minimumFractionDigits: n,
|
|
339
339
|
maximumFractionDigits: n
|
|
340
340
|
}).format(e), lt = (e, t, r) => typeof e != "string" || e === "" || !ot.test(e) ? "" : new Intl.DateTimeFormat(t, r).format(new Date(e)), vr = (e, t) => (r) => at(r, e, t);
|
|
341
|
-
var
|
|
341
|
+
var R = {
|
|
342
342
|
updatable: !0,
|
|
343
343
|
slotRelocation: !0,
|
|
344
344
|
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
|
|
@@ -543,7 +543,7 @@ function ue(e) {
|
|
|
543
543
|
e
|
|
544
544
|
);
|
|
545
545
|
}
|
|
546
|
-
var
|
|
546
|
+
var C, P, z, X = !1, W = !1, ee = !1, y = !1, U = (e, t, r) => {
|
|
547
547
|
var s;
|
|
548
548
|
const n = t.$children$[r];
|
|
549
549
|
let i = 0, o, c, l;
|
|
@@ -567,32 +567,32 @@ var F, C, T, X = !1, P = !1, ee = !1, y = !1, W = (e, t, r) => {
|
|
|
567
567
|
);
|
|
568
568
|
if (o = n.$elm$ = S.document.createElementNS(
|
|
569
569
|
y ? ut : pt,
|
|
570
|
-
!X &&
|
|
571
|
-
), y && n.$tag$ === "foreignObject" && (y = !1), K(null, n, y), gt(
|
|
570
|
+
!X && R.slotRelocation && n.$flags$ & 2 ? "slot-fb" : n.$tag$
|
|
571
|
+
), y && n.$tag$ === "foreignObject" && (y = !1), K(null, n, y), gt(C) && o["s-si"] !== C && o.classList.add(o["s-si"] = C), n.$children$)
|
|
572
572
|
for (i = 0; i < n.$children$.length; ++i)
|
|
573
|
-
c =
|
|
573
|
+
c = U(e, n, i), c && o.appendChild(c);
|
|
574
574
|
n.$tag$ === "svg" ? y = !1 : o.tagName === "foreignObject" && (y = !0);
|
|
575
575
|
}
|
|
576
|
-
return o["s-hn"] =
|
|
577
|
-
},
|
|
576
|
+
return o["s-hn"] = z, n.$flags$ & 3 && (o["s-sr"] = !0, o["s-cr"] = P, o["s-sn"] = n.$name$ || "", o["s-rf"] = (s = n.$attrs$) == null ? void 0 : s.ref, vt(o), l = e && e.$children$ && e.$children$[r], l && l.$tag$ === n.$tag$ && e.$elm$ && I(e.$elm$, !1), Te(P, o, t.$elm$, e?.$elm$)), o;
|
|
577
|
+
}, I = (e, t) => {
|
|
578
578
|
j.$flags$ |= 1;
|
|
579
579
|
const r = Array.from(e.__childNodes || e.childNodes);
|
|
580
|
-
e["s-sr"] &&
|
|
580
|
+
e["s-sr"] && R.experimentalSlotFixes;
|
|
581
581
|
for (let s = r.length - 1; s >= 0; s--) {
|
|
582
582
|
const n = r[s];
|
|
583
|
-
n["s-hn"] !==
|
|
583
|
+
n["s-hn"] !== z && n["s-ol"] && (O(N(n).parentNode, n, N(n)), n["s-ol"].remove(), n["s-ol"] = void 0, n["s-sh"] = void 0, ee = !0), t && I(n, t);
|
|
584
584
|
}
|
|
585
585
|
j.$flags$ &= -2;
|
|
586
586
|
}, Oe = (e, t, r, s, n, i) => {
|
|
587
587
|
let o = e["s-cr"] && e["s-cr"].parentNode || e, c;
|
|
588
|
-
for (o.shadowRoot && o.tagName ===
|
|
589
|
-
s[n] && (c =
|
|
588
|
+
for (o.shadowRoot && o.tagName === z && (o = o.shadowRoot); n <= i; ++n)
|
|
589
|
+
s[n] && (c = U(null, r, n), c && (s[n].$elm$ = c, O(o, c, N(t))));
|
|
590
590
|
}, Ae = (e, t, r) => {
|
|
591
591
|
for (let s = t; s <= r; ++s) {
|
|
592
592
|
const n = e[s];
|
|
593
593
|
if (n) {
|
|
594
594
|
const i = n.$elm$;
|
|
595
|
-
je(n), i && (
|
|
595
|
+
je(n), i && (W = !0, i["s-ol"] ? i["s-ol"].remove() : I(i, !0), i.remove());
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
}, At = (e, t, r, s, n = !1) => {
|
|
@@ -606,24 +606,24 @@ var F, C, T, X = !1, P = !1, ee = !1, y = !1, W = (e, t, r) => {
|
|
|
606
606
|
d = s[++o];
|
|
607
607
|
else if (f == null)
|
|
608
608
|
f = s[--g];
|
|
609
|
-
else if (
|
|
609
|
+
else if (F(p, d, n))
|
|
610
610
|
k(p, d, n), p = t[++i], d = s[++o];
|
|
611
|
-
else if (
|
|
611
|
+
else if (F(a, f, n))
|
|
612
612
|
k(a, f, n), a = t[--u], f = s[--g];
|
|
613
|
-
else if (
|
|
614
|
-
(p.$tag$ === "slot" || f.$tag$ === "slot") &&
|
|
615
|
-
else if (
|
|
616
|
-
(p.$tag$ === "slot" || f.$tag$ === "slot") &&
|
|
613
|
+
else if (F(p, f, n))
|
|
614
|
+
(p.$tag$ === "slot" || f.$tag$ === "slot") && I(p.$elm$.parentNode, !1), k(p, f, n), O(e, p.$elm$, a.$elm$.nextSibling), p = t[++i], f = s[--g];
|
|
615
|
+
else if (F(a, d, n))
|
|
616
|
+
(p.$tag$ === "slot" || f.$tag$ === "slot") && I(a.$elm$.parentNode, !1), k(a, d, n), O(e, a.$elm$, p.$elm$), a = t[--u], d = s[++o];
|
|
617
617
|
else {
|
|
618
618
|
for (c = -1, l = i; l <= u; ++l)
|
|
619
619
|
if (t[l] && t[l].$key$ !== null && t[l].$key$ === d.$key$) {
|
|
620
620
|
c = l;
|
|
621
621
|
break;
|
|
622
622
|
}
|
|
623
|
-
c >= 0 ? (_ = t[c], _.$tag$ !== d.$tag$ ? h =
|
|
624
|
-
|
|
623
|
+
c >= 0 ? (_ = t[c], _.$tag$ !== d.$tag$ ? h = U(t && t[o], r, c) : (k(_, d, n), t[c] = void 0, h = _.$elm$), d = s[++o]) : (h = U(t && t[o], r, o), d = s[++o]), h && O(
|
|
624
|
+
N(p.$elm$).parentNode,
|
|
625
625
|
h,
|
|
626
|
-
|
|
626
|
+
N(p.$elm$)
|
|
627
627
|
);
|
|
628
628
|
}
|
|
629
629
|
i > u ? Oe(
|
|
@@ -634,12 +634,12 @@ var F, C, T, X = !1, P = !1, ee = !1, y = !1, W = (e, t, r) => {
|
|
|
634
634
|
o,
|
|
635
635
|
g
|
|
636
636
|
) : o > g && Ae(t, i, u);
|
|
637
|
-
},
|
|
637
|
+
}, F = (e, t, r = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === "slot" ? e.$name$ === t.$name$ : r ? (r && !e.$key$ && t.$key$ && (e.$key$ = t.$key$), !0) : e.$key$ === t.$key$ : !1, N = (e) => e && e["s-ol"] || e, k = (e, t, r = !1) => {
|
|
638
638
|
const s = t.$elm$ = e.$elm$, n = e.$children$, i = t.$children$, o = t.$tag$, c = t.$text$;
|
|
639
639
|
let l;
|
|
640
640
|
c === null ? (y = o === "svg" ? !0 : o === "foreignObject" ? !1 : y, K(e, t, y), n !== null && i !== null ? At(s, n, t, i, r) : i !== null ? (e.$text$ !== null && (s.textContent = ""), Oe(s, null, t, i, 0, i.length - 1)) : (
|
|
641
641
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
642
|
-
!r &&
|
|
642
|
+
!r && R.updatable && n !== null && Ae(n, 0, n.length - 1)
|
|
643
643
|
), y && o === "svg" && (y = !1)) : (l = s["s-cr"]) ? l.parentNode.textContent = c : e.$text$ !== c && (s.data = c);
|
|
644
644
|
}, m = [], ke = (e) => {
|
|
645
645
|
let t, r, s;
|
|
@@ -652,7 +652,7 @@ var F, C, T, X = !1, P = !1, ee = !1, y = !1, W = (e, t, r) => {
|
|
|
652
652
|
if (t = r[s], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== i["s-hn"])
|
|
653
653
|
if (ae(t, o)) {
|
|
654
654
|
let c = m.find((l) => l.$nodeToRelocate$ === t);
|
|
655
|
-
|
|
655
|
+
W = !0, t["s-sn"] = t["s-sn"] || o, c ? (c.$nodeToRelocate$["s-sh"] = i["s-hn"], c.$slotRefNode$ = i) : (t["s-sh"] = i["s-hn"], m.push({
|
|
656
656
|
$slotRefNode$: i,
|
|
657
657
|
$nodeToRelocate$: t
|
|
658
658
|
})), t["s-sr"] && m.map((l) => {
|
|
@@ -666,8 +666,8 @@ var F, C, T, X = !1, P = !1, ee = !1, y = !1, W = (e, t, r) => {
|
|
|
666
666
|
}
|
|
667
667
|
}, je = (e) => {
|
|
668
668
|
e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(je);
|
|
669
|
-
}, O = (e, t, r) => (typeof t["s-sn"] == "string" && t["s-sr"] && t["s-cr"] &&
|
|
670
|
-
function
|
|
669
|
+
}, O = (e, t, r) => (typeof t["s-sn"] == "string" && t["s-sr"] && t["s-cr"] && Te(t["s-cr"], t, e, t.parentElement), e?.insertBefore(t, r));
|
|
670
|
+
function Te(e, t, r, s) {
|
|
671
671
|
var n, i;
|
|
672
672
|
let o;
|
|
673
673
|
if (e && typeof t["s-sn"] == "string" && t["s-sr"] && e.parentNode && e.parentNode["s-sc"] && (o = t["s-si"] || e.parentNode["s-sc"])) {
|
|
@@ -688,12 +688,12 @@ function Re(e, t, r, s) {
|
|
|
688
688
|
var kt = (e, t, r = !1) => {
|
|
689
689
|
var s, n, i, o, c;
|
|
690
690
|
const l = e.$hostElement$, u = e.$cmpMeta$, p = e.$vnode$ || J(null, null), g = Et(t) ? t : wt(null, null, t);
|
|
691
|
-
if (
|
|
692
|
-
(
|
|
693
|
-
)), r && g.$attrs$)
|
|
691
|
+
if (z = l.tagName, u.$attrsToReflect$ && (g.$attrs$ = g.$attrs$ || {}, u.$attrsToReflect$.forEach(([d, f]) => {
|
|
692
|
+
R.serializer && e.$serializerValues$.has(d) ? g.$attrs$[f] = e.$serializerValues$.get(d) : g.$attrs$[f] = l[d];
|
|
693
|
+
})), r && g.$attrs$)
|
|
694
694
|
for (const d of Object.keys(g.$attrs$))
|
|
695
695
|
l.hasAttribute(d) && !["key", "ref", "style", "class"].includes(d) && (g.$attrs$[d] = l[d]);
|
|
696
|
-
g.$tag$ = null, g.$flags$ |= 4, e.$vnode$ = g, g.$elm$ = p.$elm$ = l.shadowRoot || l,
|
|
696
|
+
g.$tag$ = null, g.$flags$ |= 4, e.$vnode$ = g, g.$elm$ = p.$elm$ = l.shadowRoot || l, C = l["s-sc"], X = !!(u.$flags$ & 1) && !(u.$flags$ & 128), P = l["s-cr"], W = !1, k(p, g, r);
|
|
697
697
|
{
|
|
698
698
|
if (j.$flags$ |= 1, ee) {
|
|
699
699
|
ke(g.$elm$);
|
|
@@ -730,14 +730,14 @@ var kt = (e, t, r = !1) => {
|
|
|
730
730
|
f.nodeType === 1 && (r && (f["s-ih"] = (o = f.hidden) != null ? o : !1), f.hidden = !0);
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
-
|
|
733
|
+
W && xe(g.$elm$), j.$flags$ &= -2, m.length = 0;
|
|
734
734
|
}
|
|
735
|
-
if (
|
|
735
|
+
if (R.experimentalScopedSlotChanges && u.$flags$ & 2) {
|
|
736
736
|
const d = g.$elm$.__childNodes || g.$elm$.childNodes;
|
|
737
737
|
for (const f of d)
|
|
738
|
-
f["s-hn"] !==
|
|
738
|
+
f["s-hn"] !== z && !f["s-sh"] && (r && f["s-ih"] == null && (f["s-ih"] = (c = f.hidden) != null ? c : !1), f.hidden = !0);
|
|
739
739
|
}
|
|
740
|
-
|
|
740
|
+
P = void 0;
|
|
741
741
|
};
|
|
742
742
|
const te = {
|
|
743
743
|
content_wrap: 0,
|
|
@@ -748,7 +748,7 @@ const te = {
|
|
|
748
748
|
tag_wrap: 0,
|
|
749
749
|
tag_wrap_width: 80,
|
|
750
750
|
trim: []
|
|
751
|
-
}, v = "__!i-£___£%__", w = "!i-£___£%_",
|
|
751
|
+
}, v = "__!i-£___£%__", w = "!i-£___£%_", Re = [
|
|
752
752
|
"area",
|
|
753
753
|
"base",
|
|
754
754
|
"br",
|
|
@@ -763,11 +763,11 @@ const te = {
|
|
|
763
763
|
"source",
|
|
764
764
|
"track",
|
|
765
765
|
"wbr"
|
|
766
|
-
],
|
|
766
|
+
], ze = {
|
|
767
767
|
checked_html: !1,
|
|
768
768
|
config: { ...te },
|
|
769
769
|
ignored: !1
|
|
770
|
-
},
|
|
770
|
+
}, D = () => ze, L = (e) => Object.assign(ze, e), re = (e) => (L({ checked_html: !0 }), /<(?:[A-Za-z]+[A-Za-z0-9]*)(?:\s+.*?)*?\/{0,1}>/.test(e) || /<(?<Element>(?:[A-Za-z]+[A-Za-z0-9]*:)?(?:[A-Za-z]+[A-Za-z0-9]*))(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e) || /<(?<Element>(?:[a-z][a-z0-9._]*:)?[a-z][a-z0-9._]*-[a-z0-9._-]+)(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e)), Ie = (e, t) => {
|
|
771
771
|
if (!e || !t)
|
|
772
772
|
throw new Error("Both 'current' and 'updates' must be passed-in to mergeObjects()");
|
|
773
773
|
let r;
|
|
@@ -776,13 +776,13 @@ const te = {
|
|
|
776
776
|
else if (typeof e == "object") {
|
|
777
777
|
r = { ...e };
|
|
778
778
|
for (let s of Object.keys(t))
|
|
779
|
-
typeof t[s] != "object" ? r[s] = t[s] : r[s] =
|
|
779
|
+
typeof t[s] != "object" ? r[s] = t[s] : r[s] = Ie(r[s] || {}, t[s]);
|
|
780
780
|
}
|
|
781
781
|
return r;
|
|
782
782
|
}, jt = (e, t) => {
|
|
783
|
-
const r =
|
|
784
|
-
return
|
|
785
|
-
},
|
|
783
|
+
const r = Ie(e, t);
|
|
784
|
+
return L({ config: r }), r;
|
|
785
|
+
}, Tt = (e) => (e = e.replace(/<[\w:\-]+([^>]*[^\/])>/g, (t, r) => t.replace(r, (s) => s.replace(/\n/g, w + "nl!").replace(/\r/g, w + "cr!").replace(/\s/g, w + "ws!"))), e), Rt = (e) => e.replace(/\n/g, v + "nl!").replace(/\r/g, v + "cr!").replace(/\s/g, v + "ws!"), zt = (e) => {
|
|
786
786
|
const t = /\s*<([a-zA-Z0-9:-]+)[^>]*>\n\s*<\/\1>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n)|<([a-zA-Z0-9:-]+)[^>]*>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n\s*)<\/\3>/g;
|
|
787
787
|
return e.replace(t, (r, s, n, i, o) => {
|
|
788
788
|
const c = n || o;
|
|
@@ -791,10 +791,10 @@ const te = {
|
|
|
791
791
|
const l = c.replace(/\n/g, v + "nl!").replace(/\r/g, v + "cr!").replace(/\s/g, v + "ws!");
|
|
792
792
|
return r.replace(c, l);
|
|
793
793
|
});
|
|
794
|
-
},
|
|
794
|
+
}, It = (e) => {
|
|
795
795
|
const t = /<([A-Za-z][A-Za-z0-9]*|[a-z][a-z0-9._]*-[a-z0-9._-]+)((?:\s+[A-Za-z0-9_-]+="[^"]*"|\s*[a-z]*)*)>/g;
|
|
796
796
|
return e = e.replace(t, (r, s, n) => r.replace(n, (i) => i.replace(/</g, w + "lt!").replace(/>/g, w + "gt!"))), e;
|
|
797
|
-
},
|
|
797
|
+
}, Nt = (e, t) => {
|
|
798
798
|
for (let r = 0; r < t.length; r++) {
|
|
799
799
|
const s = new RegExp(`(<${t[r]}[^>]*>)\\s+`, "g"), n = new RegExp(`\\s+(</${t[r]}>)`, "g");
|
|
800
800
|
e = e.replace(s, "$1").replace(n, "$1");
|
|
@@ -802,10 +802,10 @@ const te = {
|
|
|
802
802
|
return e;
|
|
803
803
|
}, Dt = (e) => (e = e.replace(/<[\w:\-]+([^>]*[^\/])>/g, (t, r) => t.replace(r, (s) => s.replace(new RegExp(w + "nl!", "g"), `
|
|
804
804
|
`).replace(new RegExp(w + "cr!", "g"), "\r").replace(new RegExp(w + "ws!", "g"), " "))), e), Lt = (e) => (e = e.replace(/.*__!i-£___£%__[a-z]{2}!.*/g, (t) => t.replace(/__!i-£___£%__[a-z]{2}!/g, (r) => r.replace(new RegExp(v + "nl!", "g"), `
|
|
805
|
-
`).replace(new RegExp(v + "cr!", "g"), "\r").replace(new RegExp(v + "ws!", "g"), " "))), e),
|
|
805
|
+
`).replace(new RegExp(v + "cr!", "g"), "\r").replace(new RegExp(v + "ws!", "g"), " "))), e), Ne = w.replace(
|
|
806
806
|
/[-\/\\^$*+?.()|[\]{}]/g,
|
|
807
807
|
"\\$&"
|
|
808
|
-
), Mt = new RegExp(
|
|
808
|
+
), Mt = new RegExp(Ne + "lt!", "g"), Ft = new RegExp(Ne + "gt!", "g"), Ct = (e) => {
|
|
809
809
|
const t = /<([\w:\-]+)([^>]*)>/g;
|
|
810
810
|
return e.replace(
|
|
811
811
|
t,
|
|
@@ -818,7 +818,7 @@ const te = {
|
|
|
818
818
|
if (typeof e != "object") throw new Error("Config must be an object.");
|
|
819
819
|
const t = { ...te };
|
|
820
820
|
if (!(Object.hasOwn(e, "content_wrap") || Object.hasOwn(e, "ignore") || Object.hasOwn(e, "ignore_with") || Object.hasOwn(e, "strict") || Object.hasOwn(e, "tab_size") || Object.hasOwn(e, "tag_wrap") || Object.hasOwn(e, "tag_wrap_width") || Object.hasOwn(e, "trim")))
|
|
821
|
-
return
|
|
821
|
+
return L({ config: t }), t;
|
|
822
822
|
let s = e.tab_size;
|
|
823
823
|
if (s) {
|
|
824
824
|
if (typeof s != "number") throw new Error(`tab_size must be a number, not ${typeof e.tab_size}.`);
|
|
@@ -859,10 +859,10 @@ const te = {
|
|
|
859
859
|
}), i !== "" && n.push(n.length === 0 ? r + i : o + i);
|
|
860
860
|
const c = n.join(`
|
|
861
861
|
`);
|
|
862
|
-
return
|
|
862
|
+
return Rt(c);
|
|
863
863
|
};
|
|
864
864
|
function De(e, t) {
|
|
865
|
-
|
|
865
|
+
L({ ignored: !0 });
|
|
866
866
|
let r = e;
|
|
867
867
|
const s = /* @__PURE__ */ new Map();
|
|
868
868
|
let n = 0;
|
|
@@ -891,22 +891,22 @@ function De(e, t) {
|
|
|
891
891
|
return { html_with_markers: r, extracted_map: s };
|
|
892
892
|
}
|
|
893
893
|
function Le(e, t) {
|
|
894
|
-
|
|
894
|
+
L({ ignored: !1 });
|
|
895
895
|
let r = e;
|
|
896
896
|
for (const [s, n] of t)
|
|
897
897
|
r = r.split(s).join(n);
|
|
898
898
|
return r;
|
|
899
899
|
}
|
|
900
900
|
const Ut = (e) => {
|
|
901
|
-
const { checked_html: t } =
|
|
902
|
-
return !t && !re(e) ? e : e.replace(/<([a-zA-Z\-0-9:]+)[^>]*>/g, (r, s) =>
|
|
901
|
+
const { checked_html: t } = D();
|
|
902
|
+
return !t && !re(e) ? e : e.replace(/<([a-zA-Z\-0-9:]+)[^>]*>/g, (r, s) => Re.indexOf(s) > -1 ? `${r.substring(0, r.length - 1)} />`.replace(/\/\s\//g, "/") : r.replace(/[\s]?\/>/g, `></${s}>`));
|
|
903
903
|
}, Zt = (e, t = !1) => (e = e.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g, (r, s) => r.replace(s, (n) => n.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\n/g, " ").replace(/\r/g, " ").replace(/\s/g, " "))), t && (e = e.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g, (r, s) => (r = r.replace(s, (n) => n.replace(/\n|\t/g, "").replace(/[a-z]+="\s*"/ig, "").replace(/>\s+</g, "><").replace(/\s+/g, " ")), r = r.replace(/\s+/g, " ").replace(/\s>/g, ">").replace(/>\s/g, ">").replace(/\s</g, "<").replace(/class=["']\s/g, (n) => n.replace(/\s/g, "")).replace(/(class=.*)\s(["'])/g, "$1$2"), r))), e);
|
|
904
904
|
let pe;
|
|
905
905
|
const Ht = (e, t) => {
|
|
906
906
|
let r = !1;
|
|
907
|
-
const { checked_html: s, ignored: n } =
|
|
907
|
+
const { checked_html: s, ignored: n } = D();
|
|
908
908
|
if (!s && !re(e)) return e;
|
|
909
|
-
const i =
|
|
909
|
+
const i = D().config, o = i.ignore.length > 0;
|
|
910
910
|
if (!n && o) {
|
|
911
911
|
const { html_with_markers: c, extracted_map: l } = De(e, i);
|
|
912
912
|
e = c, pe = l, r = !0;
|
|
@@ -918,30 +918,30 @@ const Ht = (e, t) => {
|
|
|
918
918
|
return `${l}=${u}${a}${u}`;
|
|
919
919
|
}
|
|
920
920
|
), e = e.trim(), r && (e = Le(e, pe)), e;
|
|
921
|
-
},
|
|
921
|
+
}, T = {
|
|
922
922
|
line: []
|
|
923
923
|
};
|
|
924
924
|
let ge;
|
|
925
925
|
const Bt = (e) => {
|
|
926
|
-
|
|
926
|
+
T.line = [];
|
|
927
927
|
let t = -1;
|
|
928
928
|
const r = /(<[^>]+>)|([^<]+)/g;
|
|
929
|
-
return e = e.replace(r, (s, n, i) => (n ?
|
|
929
|
+
return e = e.replace(r, (s, n, i) => (n ? T.line.push({ type: "tag", value: s }) : i && i.trim().length > 0 && T.line.push({ type: "text", value: s }), t++, `
|
|
930
930
|
[#-# : ${t} : ${s} : #-#]
|
|
931
931
|
`)), e;
|
|
932
932
|
}, qt = (e) => {
|
|
933
933
|
e = Ut(e);
|
|
934
|
-
const { config: t } =
|
|
935
|
-
return t.trim.length > 0 && (e =
|
|
934
|
+
const { config: t } = D();
|
|
935
|
+
return t.trim.length > 0 && (e = Nt(e, t.trim)), e = Ht(e), e = Bt(e), e;
|
|
936
936
|
}, Gt = (e) => {
|
|
937
937
|
const t = " ".repeat(e.tab_size), r = e.tag_wrap, s = e.content_wrap, i = `-${e.ignore_with}`, o = e.strict;
|
|
938
938
|
let c = "";
|
|
939
939
|
const l = [], u = /<[A-Za-z]+\b[^>]*(?:.|\n)*?\/?>/g, p = /\s{1}[A-Za-z-]+(?:=".*?")?/g;
|
|
940
|
-
|
|
940
|
+
T.line.forEach((g, d) => {
|
|
941
941
|
let f = g.value;
|
|
942
942
|
const h = f.startsWith(i + "lt--") || f.startsWith(i + "gt--") || f.startsWith(i + "nl--") || f.startsWith(i + "cr--") || f.startsWith(i + "ws--") || f.startsWith(i + "tab--");
|
|
943
943
|
let _ = 0;
|
|
944
|
-
const x =
|
|
944
|
+
const x = T.line[d - 1], A = x?.value ?? "";
|
|
945
945
|
c += "0", d === 0 && _++, f.trim().startsWith("</") && _++, A.trim().startsWith("<!doctype") && _++, A.trim().startsWith("<!--") && _++, A.trim().endsWith("/>") && _++, A.trim().startsWith("</") && _++, x?.type === "text" && _++;
|
|
946
946
|
const E = Math.max(0, c.length - _);
|
|
947
947
|
if (c = c.substring(0, E), g.type === "text" && /^[!,;\.]/.test(f))
|
|
@@ -961,17 +961,17 @@ const Bt = (e) => {
|
|
|
961
961
|
b = Wt(b, s, $);
|
|
962
962
|
else if (r > 0 && b.length > r && u.test(b)) {
|
|
963
963
|
u.lastIndex = 0, p.lastIndex = 0;
|
|
964
|
-
const
|
|
965
|
-
if (
|
|
964
|
+
const M = b.split(p).filter(Boolean);
|
|
965
|
+
if (M.length >= 2) {
|
|
966
966
|
const Fe = b.matchAll(p), Ce = $ + t;
|
|
967
|
-
let H = $ +
|
|
967
|
+
let H = $ + M[0] + `
|
|
968
968
|
`;
|
|
969
969
|
for (const He of Fe) {
|
|
970
970
|
const Be = He[0].trim();
|
|
971
971
|
H += Ce + Be + `
|
|
972
972
|
`;
|
|
973
973
|
}
|
|
974
|
-
const ne =
|
|
974
|
+
const ne = M[0].match(/<([A-Za-z_:-]+)/), Pe = ne ? ne[1] : "", We = Re.includes(Pe), Ue = M[1].trim(), Ze = $ + (o && We ? " " : "");
|
|
975
975
|
H += Ze + Ue, b = H;
|
|
976
976
|
} else
|
|
977
977
|
b = $ + b;
|
|
@@ -982,7 +982,7 @@ const Bt = (e) => {
|
|
|
982
982
|
});
|
|
983
983
|
let a = l.join(`
|
|
984
984
|
`);
|
|
985
|
-
return r > 0 && (a =
|
|
985
|
+
return r > 0 && (a = Tt(a)), s > 0 && /\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n/.test(a) && (a = zt(a)), a = a.replace(
|
|
986
986
|
/<(?<Element>.+).*>[^<]*?[^><\/\s][^<]*?<\/{1}\k<Element>|<script[^>]*>\s+<\/script>|<(\w+)>\s+<\/(\w+)|<(?:([\w:\._-]+)|([\w:\._-]+)[^>]*[^\/])>\s+<\/([\w:\._-]+)>/g,
|
|
987
987
|
(g) => g.replace(/\n|\t|\s{2,}/g, "")
|
|
988
988
|
), s > 0 && (a = Lt(a)), r > 0 && (a = Dt(a)), o && (a = a.replace(/\s\/>|\/>/g, ">")), a.startsWith(`
|
|
@@ -990,14 +990,14 @@ const Bt = (e) => {
|
|
|
990
990
|
`) && (a = a.substring(0, a.length - 1)), a;
|
|
991
991
|
}, Jt = (e, t) => {
|
|
992
992
|
let r = !1;
|
|
993
|
-
const { checked_html: s, ignored: n } =
|
|
993
|
+
const { checked_html: s, ignored: n } = D();
|
|
994
994
|
if (!s && !re(e)) return e;
|
|
995
995
|
const i = t ? Pt(t) : { ...te }, o = i.ignore.length > 0;
|
|
996
996
|
if (!n && o) {
|
|
997
997
|
const { html_with_markers: c, extracted_map: l } = De(e, i);
|
|
998
998
|
e = c, ge = l, r = !0;
|
|
999
999
|
}
|
|
1000
|
-
return e =
|
|
1000
|
+
return e = It(e), e = qt(e), e = Gt(i), e = Ct(e), r && (e = Le(e, ge)), e;
|
|
1001
1001
|
}, Kt = (e, t, r) => {
|
|
1002
1002
|
[null, void 0, "", !1].includes(r) || ["innerHTML", "style", ""].includes(t) || e.setAttribute(t, ["object", "function"].includes(typeof r) ? "⚠️ Property must be set through a script or a framework-specific syntax." : r);
|
|
1003
1003
|
}, Me = (e, t, r, s, n) => {
|
|
@@ -1284,7 +1284,7 @@ export {
|
|
|
1284
1284
|
Er as getStoryHTML,
|
|
1285
1285
|
de as getStorybookUrl,
|
|
1286
1286
|
pr as getWindows,
|
|
1287
|
-
|
|
1287
|
+
Z as isObject,
|
|
1288
1288
|
cr as isTagName,
|
|
1289
1289
|
ur as isValidNumber,
|
|
1290
1290
|
Ge as isValidString,
|