@blockbite/ui 2.1.2 → 2.1.3
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/DataItemList.d.ts +4 -1
- package/dist/index.js +637 -634
- package/dist/index.js.map +1 -1
- package/dist/ui.css +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -97,13 +97,13 @@ const B = /* @__PURE__ */ Ri(Ni), Ci = Ye(
|
|
|
97
97
|
}) => {
|
|
98
98
|
const u = ke(
|
|
99
99
|
(f) => {
|
|
100
|
-
const
|
|
101
|
-
l == null || l(
|
|
100
|
+
const p = i && e === f ? "" : f;
|
|
101
|
+
l == null || l(p);
|
|
102
102
|
},
|
|
103
103
|
[l, i, e]
|
|
104
|
-
),
|
|
105
|
-
const
|
|
106
|
-
return n === "icon" && (f != null && f.icon) ? /* @__PURE__ */ React.createElement(
|
|
104
|
+
), m = (f) => {
|
|
105
|
+
const p = (f == null ? void 0 : f.icon) || null;
|
|
106
|
+
return n === "icon" && (f != null && f.icon) ? /* @__PURE__ */ React.createElement(p, { className: "w-4 h-4" }) : n === "label" ? /* @__PURE__ */ React.createElement("span", null, f.label) : /* @__PURE__ */ React.createElement("span", { className: "flex items-center justify-center gap-1" }, f.icon && /* @__PURE__ */ React.createElement(p, { className: "w-3 h-3" }), /* @__PURE__ */ React.createElement("span", null, f.label));
|
|
107
107
|
};
|
|
108
108
|
return /* @__PURE__ */ React.createElement(
|
|
109
109
|
"div",
|
|
@@ -114,10 +114,10 @@ const B = /* @__PURE__ */ Ri(Ni), Ci = Ye(
|
|
|
114
114
|
o ? "blockbite-ui__button-group--tabs" : ""
|
|
115
115
|
)
|
|
116
116
|
},
|
|
117
|
-
r.map((f,
|
|
117
|
+
r.map((f, p) => /* @__PURE__ */ React.createElement(
|
|
118
118
|
Y,
|
|
119
119
|
{
|
|
120
|
-
key: `ButtonToggleGroup__${f.value}__${f.label}__${
|
|
120
|
+
key: `ButtonToggleGroup__${f.value}__${f.label}__${p}`,
|
|
121
121
|
className: B("blockbite-ui__button--default", {
|
|
122
122
|
grow: s,
|
|
123
123
|
"justify-center": s
|
|
@@ -131,7 +131,7 @@ const B = /* @__PURE__ */ Ri(Ni), Ci = Ye(
|
|
|
131
131
|
isPressed: e === f.value,
|
|
132
132
|
onClick: () => u(f.value)
|
|
133
133
|
},
|
|
134
|
-
|
|
134
|
+
m(f),
|
|
135
135
|
f.children && f.children
|
|
136
136
|
))
|
|
137
137
|
);
|
|
@@ -172,7 +172,7 @@ function Kn({
|
|
|
172
172
|
"div",
|
|
173
173
|
{
|
|
174
174
|
style: {
|
|
175
|
-
backgroundColor: (u = e.find((
|
|
175
|
+
backgroundColor: (u = e.find((m) => m.value === t)) == null ? void 0 : u.style
|
|
176
176
|
},
|
|
177
177
|
className: "h-3 w-3 rounded-full"
|
|
178
178
|
}
|
|
@@ -257,18 +257,18 @@ const Ht = ({
|
|
|
257
257
|
if (c) {
|
|
258
258
|
a(c.body);
|
|
259
259
|
const s = c.createElement("style");
|
|
260
|
-
s.innerHTML = e, c.head.appendChild(s), i.forEach(({ type: l, id: u, url:
|
|
260
|
+
s.innerHTML = e, c.head.appendChild(s), i.forEach(({ type: l, id: u, url: m }) => {
|
|
261
261
|
const f = document.getElementById(u);
|
|
262
262
|
if (f) {
|
|
263
|
-
const
|
|
263
|
+
const p = document.adoptNode(
|
|
264
264
|
f.cloneNode(!0)
|
|
265
265
|
);
|
|
266
|
-
c.head.appendChild(
|
|
266
|
+
c.head.appendChild(p);
|
|
267
267
|
} else {
|
|
268
|
-
const
|
|
268
|
+
const p = c.createElement(
|
|
269
269
|
l === "script" ? "script" : "link"
|
|
270
270
|
);
|
|
271
|
-
|
|
271
|
+
p.id = u, l === "script" ? (p.src = m, p.async = !0) : (p.rel = "stylesheet", p.href = m), c.head.appendChild(p);
|
|
272
272
|
}
|
|
273
273
|
});
|
|
274
274
|
}
|
|
@@ -600,9 +600,9 @@ const Ht = ({
|
|
|
600
600
|
onBlur: s,
|
|
601
601
|
type: l = "text",
|
|
602
602
|
label: u,
|
|
603
|
-
helper:
|
|
603
|
+
helper: m = "",
|
|
604
604
|
...f
|
|
605
|
-
},
|
|
605
|
+
}, p) => {
|
|
606
606
|
const v = `text-control-${Math.random().toString(36).substring(2, 15)}`;
|
|
607
607
|
return /* @__PURE__ */ React.createElement(
|
|
608
608
|
"div",
|
|
@@ -623,16 +623,16 @@ const Ht = ({
|
|
|
623
623
|
value: n,
|
|
624
624
|
placeholder: c,
|
|
625
625
|
onFocus: () => t && t(),
|
|
626
|
-
onBlur: (
|
|
627
|
-
t && t(), s && s(
|
|
626
|
+
onBlur: (x) => {
|
|
627
|
+
t && t(), s && s(x.target.value);
|
|
628
628
|
},
|
|
629
|
-
onChange: (
|
|
629
|
+
onChange: (x) => e && e(x.target.value),
|
|
630
630
|
readOnly: o,
|
|
631
|
-
ref:
|
|
631
|
+
ref: p
|
|
632
632
|
}
|
|
633
633
|
),
|
|
634
634
|
r,
|
|
635
|
-
|
|
635
|
+
m && /* @__PURE__ */ React.createElement("p", { className: "text-primary !m-0 !mb-0 text-xs" }, m)
|
|
636
636
|
);
|
|
637
637
|
}
|
|
638
638
|
);
|
|
@@ -645,92 +645,95 @@ const Gn = ({
|
|
|
645
645
|
onDelete: r,
|
|
646
646
|
onUpdate: a,
|
|
647
647
|
onSwitch: o,
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
648
|
+
allowCreate: c = !0,
|
|
649
|
+
allowDelete: s = !0,
|
|
650
|
+
allowRename: l = !0,
|
|
651
|
+
renderItemActions: u,
|
|
652
|
+
renderItemContent: m,
|
|
653
|
+
addons: f,
|
|
654
|
+
className: p = "",
|
|
655
|
+
footerSlot: v,
|
|
656
|
+
footerSlotClassName: x = "",
|
|
657
|
+
badge: b = ""
|
|
655
658
|
}) => {
|
|
656
|
-
const [
|
|
659
|
+
const [g, z] = A({
|
|
657
660
|
id: "",
|
|
658
661
|
title: ""
|
|
659
|
-
}), [
|
|
660
|
-
n();
|
|
661
|
-
},
|
|
662
|
-
if (!e || t.length === 0) return;
|
|
663
|
-
const
|
|
664
|
-
r(e.id), i(
|
|
665
|
-
},
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
}, 500);
|
|
669
|
-
},
|
|
662
|
+
}), [I, y] = A(!1), L = U(null), k = () => {
|
|
663
|
+
c && n();
|
|
664
|
+
}, d = () => {
|
|
665
|
+
if (!s || !e || t.length === 0) return;
|
|
666
|
+
const R = t.filter((_) => _.id !== (e == null ? void 0 : e.id)), O = t.findIndex((_) => _.id === (e == null ? void 0 : e.id)), M = R[O] || R[0];
|
|
667
|
+
r(e.id), i(M);
|
|
668
|
+
}, S = (R) => {
|
|
669
|
+
l && (y(!0), g.id && a(g.id, { title: R }), setTimeout(() => {
|
|
670
|
+
z({ id: "", title: "" }), y(!1);
|
|
671
|
+
}, 500));
|
|
672
|
+
}, T = (R) => !b || !R[b] ? null : /* @__PURE__ */ React.createElement(Ht, { className: "ml-2 max-w-[80px] text-sm" }, R[b]);
|
|
670
673
|
return /* @__PURE__ */ React.createElement(
|
|
671
674
|
"div",
|
|
672
675
|
{
|
|
673
|
-
className: B("flex flex-col justify-between h-full",
|
|
676
|
+
className: B("flex flex-col justify-between h-full", p)
|
|
674
677
|
},
|
|
675
|
-
/* @__PURE__ */ React.createElement("ul", { className: "divide-y overflow-auto" },
|
|
678
|
+
/* @__PURE__ */ React.createElement("ul", { className: "divide-y overflow-auto" }, f, t.length > 0 && /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("ul", { className: "divide-y divide-border border-b border-border" }, t.map((R) => /* @__PURE__ */ React.createElement(
|
|
676
679
|
"li",
|
|
677
680
|
{
|
|
678
|
-
key: `data__${
|
|
681
|
+
key: `data__${R.id}`,
|
|
679
682
|
className: B(
|
|
680
683
|
"relative !mb-0 flex flex-col hover:bg-wp/10",
|
|
681
684
|
{
|
|
682
|
-
"bg-[#1e40af]/20":
|
|
685
|
+
"bg-[#1e40af]/20": R.id === (e == null ? void 0 : e.id)
|
|
683
686
|
}
|
|
684
687
|
)
|
|
685
688
|
},
|
|
686
689
|
/* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between gap-1" }, /* @__PURE__ */ React.createElement("div", { className: "flex-1 relative" }, /* @__PURE__ */ React.createElement(
|
|
687
690
|
"button",
|
|
688
691
|
{
|
|
689
|
-
className: "text-gray-medium w-full truncate
|
|
692
|
+
className: "text-gray-medium w-full truncate py-1 pl-2 text-left text-[11px]! font-semibold hover:text-wordpress",
|
|
690
693
|
onClick: () => {
|
|
691
|
-
o(e == null ? void 0 : e.id, { ...e }), i(
|
|
694
|
+
o(e == null ? void 0 : e.id, { ...e }), i(R);
|
|
692
695
|
},
|
|
693
696
|
onDoubleClick: () => {
|
|
694
|
-
|
|
697
|
+
l && z({ id: R.id, title: R.title || "" });
|
|
695
698
|
}
|
|
696
699
|
},
|
|
697
|
-
|
|
698
|
-
),
|
|
700
|
+
I && g.id === R.id ? /* @__PURE__ */ React.createElement("span", { className: "animate-pulse text-gray-medium" }, g.title, " ", T(R)) : /* @__PURE__ */ React.createElement("span", { className: "text-gray-medium" }, R.title || "Untitled", " ", T(R))
|
|
701
|
+
), g.id === R.id && !I && /* @__PURE__ */ React.createElement(
|
|
699
702
|
jt,
|
|
700
703
|
{
|
|
701
704
|
className: "absolute left-1 top-0 w-[calc(100%-.5rem)] h-full",
|
|
702
705
|
inputClassName: "w-full",
|
|
703
|
-
defaultValue:
|
|
704
|
-
onChange: (
|
|
705
|
-
ref:
|
|
706
|
-
onBlur: () =>
|
|
706
|
+
defaultValue: g.title,
|
|
707
|
+
onChange: (O) => z({ ...g, title: O }),
|
|
708
|
+
ref: L,
|
|
709
|
+
onBlur: () => S(g.title)
|
|
707
710
|
}
|
|
708
|
-
)),
|
|
709
|
-
|
|
711
|
+
)), u && /* @__PURE__ */ React.createElement("div", { className: "flex gap-1 pr-1" }, u(R))),
|
|
712
|
+
m && m(R, R.id === (e == null ? void 0 : e.id))
|
|
710
713
|
))))),
|
|
711
|
-
/* @__PURE__ */ React.createElement(
|
|
714
|
+
(v || c || s) && /* @__PURE__ */ React.createElement(
|
|
712
715
|
"div",
|
|
713
716
|
{
|
|
714
717
|
className: B(
|
|
715
718
|
"flex flex-wrap justify-center gap-2 p-2",
|
|
716
|
-
|
|
719
|
+
x
|
|
717
720
|
)
|
|
718
721
|
},
|
|
719
|
-
|
|
720
|
-
/* @__PURE__ */ React.createElement(
|
|
722
|
+
v,
|
|
723
|
+
c && /* @__PURE__ */ React.createElement(
|
|
721
724
|
Y,
|
|
722
725
|
{
|
|
723
|
-
onClick:
|
|
726
|
+
onClick: k,
|
|
724
727
|
icon: /* @__PURE__ */ React.createElement($i, { className: "h-4 w-4" }),
|
|
725
728
|
variant: "tertiary",
|
|
726
729
|
size: "compact"
|
|
727
730
|
},
|
|
728
731
|
"Add"
|
|
729
732
|
),
|
|
730
|
-
/* @__PURE__ */ React.createElement(
|
|
733
|
+
s && /* @__PURE__ */ React.createElement(
|
|
731
734
|
Y,
|
|
732
735
|
{
|
|
733
|
-
onClick:
|
|
736
|
+
onClick: d,
|
|
734
737
|
icon: /* @__PURE__ */ React.createElement(Bi, { className: "h-4 w-4" }),
|
|
735
738
|
variant: "tertiary",
|
|
736
739
|
size: "compact",
|
|
@@ -790,13 +793,13 @@ Received: { icon: <ColumnsIcon /> }`
|
|
|
790
793
|
l(i);
|
|
791
794
|
}, [i]);
|
|
792
795
|
const u = [
|
|
793
|
-
...o.map((
|
|
794
|
-
icon:
|
|
795
|
-
label:
|
|
796
|
-
title:
|
|
797
|
-
value:
|
|
796
|
+
...o.map((p) => ({
|
|
797
|
+
icon: p.icon,
|
|
798
|
+
label: p.label,
|
|
799
|
+
title: p.label,
|
|
800
|
+
value: p.value,
|
|
798
801
|
onClick: () => {
|
|
799
|
-
l(
|
|
802
|
+
l(p.value), a(p.value);
|
|
800
803
|
}
|
|
801
804
|
})),
|
|
802
805
|
{
|
|
@@ -808,13 +811,13 @@ Received: { icon: <ColumnsIcon /> }`
|
|
|
808
811
|
}
|
|
809
812
|
}
|
|
810
813
|
];
|
|
811
|
-
let
|
|
812
|
-
return r === "medium" ?
|
|
814
|
+
let m = "1em";
|
|
815
|
+
return r === "medium" ? m = "1.5em" : r === "large" && (m = "2em"), /* @__PURE__ */ React.createElement(
|
|
813
816
|
ri,
|
|
814
817
|
{
|
|
815
818
|
controls: u,
|
|
816
819
|
className: B("blockbite-ui__dropdown-picker", e),
|
|
817
|
-
icon: ((f = o.find((
|
|
820
|
+
icon: ((f = o.find((p) => p.value === s)) == null ? void 0 : f.icon) || /* @__PURE__ */ React.createElement(He, { width: m, height: m, icon: n }),
|
|
818
821
|
label: t || "Select",
|
|
819
822
|
...c
|
|
820
823
|
}
|
|
@@ -847,10 +850,10 @@ function nr({
|
|
|
847
850
|
}) {
|
|
848
851
|
const e = U(null), [i, n] = A({ x: 100, y: 100 }), [r, a] = A(!1), [o, c] = A({ x: 0, y: 0 });
|
|
849
852
|
j(() => {
|
|
850
|
-
const l = (
|
|
853
|
+
const l = (m) => {
|
|
851
854
|
r && n({
|
|
852
|
-
x:
|
|
853
|
-
y:
|
|
855
|
+
x: m.clientX - o.x,
|
|
856
|
+
y: m.clientY - o.y
|
|
854
857
|
});
|
|
855
858
|
}, u = () => a(!1);
|
|
856
859
|
return window.addEventListener("mousemove", l), window.addEventListener("mouseup", u), () => {
|
|
@@ -1041,40 +1044,40 @@ function he(t) {
|
|
|
1041
1044
|
return Number.isFinite(i) ? Math.min(100, Math.max(0, i)) : void 0;
|
|
1042
1045
|
}
|
|
1043
1046
|
function ar(t, e) {
|
|
1044
|
-
var f,
|
|
1047
|
+
var f, p, v, x;
|
|
1045
1048
|
if (!t) return null;
|
|
1046
|
-
const i = t["gradient-direction"], n = i === Ke ? "radial" : "linear", r = n === "radial" ? "to-r" : i && je[i] || "to-r", a = [], o = (f = t["gradient-from"]) == null ? void 0 : f[0], c = (
|
|
1049
|
+
const i = t["gradient-direction"], n = i === Ke ? "radial" : "linear", r = n === "radial" ? "to-r" : i && je[i] || "to-r", a = [], o = (f = t["gradient-from"]) == null ? void 0 : f[0], c = (p = t["gradient-from-pos"]) == null ? void 0 : p[0];
|
|
1047
1050
|
if (o != null && o.from) {
|
|
1048
|
-
const
|
|
1051
|
+
const b = String(o.from), { opacityFromToken: g } = fe(e, b);
|
|
1049
1052
|
a.push({
|
|
1050
1053
|
id: "from",
|
|
1051
1054
|
role: "from",
|
|
1052
|
-
colorToken:
|
|
1055
|
+
colorToken: b,
|
|
1053
1056
|
position: he(c == null ? void 0 : c.from) ?? 0,
|
|
1054
|
-
opacity:
|
|
1057
|
+
opacity: g ?? 100
|
|
1055
1058
|
});
|
|
1056
1059
|
}
|
|
1057
1060
|
const s = t["gradient-via"] || [], l = t["gradient-via-pos"] || [];
|
|
1058
|
-
s.forEach((
|
|
1061
|
+
s.forEach((b, g) => {
|
|
1059
1062
|
var L;
|
|
1060
|
-
const
|
|
1063
|
+
const z = String(b.via), { opacityFromToken: I } = fe(e, z), y = (L = l[g]) == null ? void 0 : L.via;
|
|
1061
1064
|
a.push({
|
|
1062
|
-
id: `via-${
|
|
1065
|
+
id: `via-${g}`,
|
|
1063
1066
|
role: "via",
|
|
1064
|
-
colorToken:
|
|
1065
|
-
position: he(
|
|
1066
|
-
opacity:
|
|
1067
|
+
colorToken: z,
|
|
1068
|
+
position: he(y) ?? 50,
|
|
1069
|
+
opacity: I ?? 100
|
|
1067
1070
|
});
|
|
1068
1071
|
});
|
|
1069
|
-
const u = (v = t["gradient-to"]) == null ? void 0 : v[0],
|
|
1072
|
+
const u = (v = t["gradient-to"]) == null ? void 0 : v[0], m = (x = t["gradient-to-pos"]) == null ? void 0 : x[0];
|
|
1070
1073
|
if (u != null && u.to) {
|
|
1071
|
-
const
|
|
1074
|
+
const b = String(u.to), { opacityFromToken: g } = fe(e, b);
|
|
1072
1075
|
a.push({
|
|
1073
1076
|
id: "to",
|
|
1074
1077
|
role: "to",
|
|
1075
|
-
colorToken:
|
|
1076
|
-
position: he(
|
|
1077
|
-
opacity:
|
|
1078
|
+
colorToken: b,
|
|
1079
|
+
position: he(m == null ? void 0 : m.to) ?? 100,
|
|
1080
|
+
opacity: g ?? 100
|
|
1078
1081
|
});
|
|
1079
1082
|
}
|
|
1080
1083
|
return a.length ? { kind: n, direction: r, stops: ve(a) } : null;
|
|
@@ -1187,12 +1190,12 @@ function ur(t) {
|
|
|
1187
1190
|
return Xi(Yi(t));
|
|
1188
1191
|
}
|
|
1189
1192
|
const mr = (t) => {
|
|
1190
|
-
var
|
|
1191
|
-
const e = Array.isArray(t) ? t.filter((
|
|
1193
|
+
var p, v, x, b, g, z, I, y, L;
|
|
1194
|
+
const e = Array.isArray(t) ? t.filter((k) => String((k == null ? void 0 : k.value) ?? "").trim() !== "") : [];
|
|
1192
1195
|
if (e.length === 0)
|
|
1193
1196
|
return null;
|
|
1194
1197
|
const n = (Array.isArray(t) ? t : []).some(
|
|
1195
|
-
(
|
|
1198
|
+
(k) => [
|
|
1196
1199
|
"gradient-direction",
|
|
1197
1200
|
"gradient-from",
|
|
1198
1201
|
"gradient-from-pos",
|
|
@@ -1200,11 +1203,11 @@ const mr = (t) => {
|
|
|
1200
1203
|
"gradient-via-pos",
|
|
1201
1204
|
"gradient-to",
|
|
1202
1205
|
"gradient-to-pos"
|
|
1203
|
-
].includes(
|
|
1204
|
-
), r = (
|
|
1205
|
-
if (n && !!!((
|
|
1206
|
+
].includes(k == null ? void 0 : k.id)
|
|
1207
|
+
), r = (k) => e.filter((d) => d.id === k);
|
|
1208
|
+
if (n && !!!((p = r("gradient-from")[0]) != null && p.value || (v = r("gradient-to")[0]) != null && v.value || (x = r("gradient-direction")[0]) != null && x.value || r("gradient-via").length && r("gradient-via").some((d) => !!d.value) || (b = r("gradient-from-pos")[0]) != null && b.value || (g = r("gradient-to-pos")[0]) != null && g.value || r("gradient-via-pos").length && r("gradient-via-pos").some((d) => !!d.value)))
|
|
1206
1209
|
return null;
|
|
1207
|
-
const a = [], o = (
|
|
1210
|
+
const a = [], o = (z = r("gradient-from")[0]) == null ? void 0 : z.value, c = he((I = r("gradient-from-pos")[0]) == null ? void 0 : I.value);
|
|
1208
1211
|
o && a.push({
|
|
1209
1212
|
id: "from",
|
|
1210
1213
|
role: "from",
|
|
@@ -1213,38 +1216,38 @@ const mr = (t) => {
|
|
|
1213
1216
|
opacity: 100
|
|
1214
1217
|
});
|
|
1215
1218
|
const s = r("gradient-via"), l = r("gradient-via-pos");
|
|
1216
|
-
s.forEach((
|
|
1217
|
-
var
|
|
1218
|
-
const
|
|
1219
|
-
if (!
|
|
1220
|
-
const
|
|
1219
|
+
s.forEach((k, d) => {
|
|
1220
|
+
var R;
|
|
1221
|
+
const S = k.value;
|
|
1222
|
+
if (!S) return;
|
|
1223
|
+
const T = he((R = l[d]) == null ? void 0 : R.value);
|
|
1221
1224
|
a.push({
|
|
1222
|
-
id: `via-${
|
|
1225
|
+
id: `via-${d}`,
|
|
1223
1226
|
role: "via",
|
|
1224
|
-
colorToken:
|
|
1225
|
-
position:
|
|
1227
|
+
colorToken: S,
|
|
1228
|
+
position: T ?? 50,
|
|
1226
1229
|
opacity: 100
|
|
1227
1230
|
});
|
|
1228
1231
|
});
|
|
1229
|
-
const u = (
|
|
1232
|
+
const u = (y = r("gradient-to")[0]) == null ? void 0 : y.value, m = he((L = r("gradient-to-pos")[0]) == null ? void 0 : L.value);
|
|
1230
1233
|
if (u && a.push({
|
|
1231
1234
|
id: "to",
|
|
1232
1235
|
role: "to",
|
|
1233
1236
|
colorToken: u,
|
|
1234
|
-
position:
|
|
1237
|
+
position: m ?? 100,
|
|
1235
1238
|
opacity: 100
|
|
1236
1239
|
}), a.length) {
|
|
1237
|
-
const
|
|
1238
|
-
return { kind:
|
|
1239
|
-
}
|
|
1240
|
-
const f = e.map((
|
|
1241
|
-
const
|
|
1242
|
-
let
|
|
1243
|
-
return
|
|
1244
|
-
id:
|
|
1245
|
-
role:
|
|
1246
|
-
colorToken:
|
|
1247
|
-
position:
|
|
1240
|
+
const k = r("gradient-direction")[0], d = k == null ? void 0 : k.value, S = d === Ke ? "radial" : "linear", T = S === "radial" ? "to-r" : d && je[d] ? je[d] : "to-r";
|
|
1241
|
+
return { kind: S, direction: T, stops: ve(a) };
|
|
1242
|
+
}
|
|
1243
|
+
const f = e.map((k, d) => {
|
|
1244
|
+
const S = (k == null ? void 0 : k.selector) ?? "";
|
|
1245
|
+
let T = "via";
|
|
1246
|
+
return S.startsWith("from-") || d === 0 ? T = "from" : (S.startsWith("to-") || d === e.length - 1) && (T = "to"), {
|
|
1247
|
+
id: k.id ?? (T === "via" ? `via-${d}` : T),
|
|
1248
|
+
role: T,
|
|
1249
|
+
colorToken: k.value,
|
|
1250
|
+
position: d === 0 ? 0 : d === e.length - 1 ? 100 : 50,
|
|
1248
1251
|
opacity: 100
|
|
1249
1252
|
};
|
|
1250
1253
|
});
|
|
@@ -1266,23 +1269,23 @@ const dr = ({
|
|
|
1266
1269
|
value: e,
|
|
1267
1270
|
onChange: i
|
|
1268
1271
|
}) => {
|
|
1269
|
-
const n = U(null), [r, a] = A(null), [o, c] = A(!1), [s, l] = A(null), [u,
|
|
1270
|
-
(
|
|
1271
|
-
) : e.stops,
|
|
1272
|
-
const
|
|
1273
|
-
i({ ...e, stops:
|
|
1274
|
-
},
|
|
1272
|
+
const n = U(null), [r, a] = A(null), [o, c] = A(!1), [s, l] = A(null), [u, m] = A(null), f = u ? e.stops.map(
|
|
1273
|
+
(d) => d.id === u.stopId ? { ...d, position: u.position } : d
|
|
1274
|
+
) : e.stops, p = e.stops.find((d) => d.id === r), v = (d) => {
|
|
1275
|
+
const S = ve(d(e.stops));
|
|
1276
|
+
i({ ...e, stops: S });
|
|
1277
|
+
}, x = (d, S) => {
|
|
1275
1278
|
v(
|
|
1276
|
-
(
|
|
1279
|
+
(T) => T.map((R) => R.id === d ? { ...R, ...S } : R)
|
|
1277
1280
|
);
|
|
1278
|
-
},
|
|
1279
|
-
e.stops.length <= 2 || v((
|
|
1280
|
-
},
|
|
1281
|
+
}, b = (d) => {
|
|
1282
|
+
e.stops.length <= 2 || v((S) => S.filter((T) => T.id !== d));
|
|
1283
|
+
}, g = (d) => {
|
|
1281
1284
|
var V;
|
|
1282
|
-
if (((V =
|
|
1283
|
-
const
|
|
1284
|
-
if (!
|
|
1285
|
-
const
|
|
1285
|
+
if (((V = d.target.dataset) == null ? void 0 : V.stopHandle) === "true") return;
|
|
1286
|
+
const T = n.current;
|
|
1287
|
+
if (!T) return;
|
|
1288
|
+
const R = T.getBoundingClientRect(), O = (d.clientX - R.left) / R.width * 100, M = se(O, 0, 100), _ = e.stops.reduce(
|
|
1286
1289
|
(P, $) => Math.abs($.position - M) < Math.abs(P.position - M) ? $ : P,
|
|
1287
1290
|
e.stops[0]
|
|
1288
1291
|
) ?? e.stops[0], D = `via-${Date.now()}`;
|
|
@@ -1296,33 +1299,33 @@ const dr = ({
|
|
|
1296
1299
|
opacity: _.opacity
|
|
1297
1300
|
}
|
|
1298
1301
|
]), a(D);
|
|
1299
|
-
},
|
|
1300
|
-
if (
|
|
1301
|
-
const
|
|
1302
|
-
a(
|
|
1303
|
-
const
|
|
1304
|
-
const D = (_.clientX -
|
|
1305
|
-
|
|
1302
|
+
}, z = (d, S) => {
|
|
1303
|
+
if (d.stopPropagation(), d.preventDefault(), !n.current) return;
|
|
1304
|
+
const T = n.current;
|
|
1305
|
+
a(S.id);
|
|
1306
|
+
const R = T.getBoundingClientRect(), O = (_) => {
|
|
1307
|
+
const D = (_.clientX - R.left) / R.width * 100, V = se(D, 0, 100);
|
|
1308
|
+
m({ stopId: S.id, position: V });
|
|
1306
1309
|
}, M = (_) => {
|
|
1307
|
-
window.removeEventListener("mousemove",
|
|
1308
|
-
const D = (_.clientX -
|
|
1309
|
-
|
|
1310
|
+
window.removeEventListener("mousemove", O), window.removeEventListener("mouseup", M);
|
|
1311
|
+
const D = (_.clientX - R.left) / R.width * 100, V = se(D, 0, 100);
|
|
1312
|
+
m(null), x(S.id, { position: V });
|
|
1310
1313
|
};
|
|
1311
|
-
window.addEventListener("mousemove",
|
|
1312
|
-
},
|
|
1313
|
-
a(
|
|
1314
|
-
},
|
|
1315
|
-
i({ ...e, kind:
|
|
1316
|
-
}, L = (
|
|
1317
|
-
i({ ...e, direction:
|
|
1318
|
-
},
|
|
1319
|
-
(
|
|
1320
|
-
if (!
|
|
1321
|
-
const
|
|
1322
|
-
|
|
1314
|
+
window.addEventListener("mousemove", O), window.addEventListener("mouseup", M);
|
|
1315
|
+
}, I = (d, S) => {
|
|
1316
|
+
a(d.id), l(S), c(!0);
|
|
1317
|
+
}, y = (d) => {
|
|
1318
|
+
i({ ...e, kind: d });
|
|
1319
|
+
}, L = (d) => {
|
|
1320
|
+
i({ ...e, direction: d });
|
|
1321
|
+
}, k = ke(
|
|
1322
|
+
(d) => {
|
|
1323
|
+
if (!p) return;
|
|
1324
|
+
const T = `[${typeof d == "string" ? d : (d == null ? void 0 : d.hex) ?? "#000000"}]`;
|
|
1325
|
+
x(p.id, { colorToken: T });
|
|
1323
1326
|
},
|
|
1324
1327
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1325
|
-
[
|
|
1328
|
+
[p]
|
|
1326
1329
|
);
|
|
1327
1330
|
return /* @__PURE__ */ React.createElement("div", { className: "bb-gradient-picker space-y-3 text-xs" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(
|
|
1328
1331
|
Fi,
|
|
@@ -1333,7 +1336,7 @@ const dr = ({
|
|
|
1333
1336
|
{ label: "Radial", value: "radial" }
|
|
1334
1337
|
],
|
|
1335
1338
|
value: e.kind,
|
|
1336
|
-
onChange: (
|
|
1339
|
+
onChange: (d) => y(d)
|
|
1337
1340
|
}
|
|
1338
1341
|
)), e.kind === "linear" && /* @__PURE__ */ React.createElement(
|
|
1339
1342
|
ye,
|
|
@@ -1349,7 +1352,7 @@ const dr = ({
|
|
|
1349
1352
|
{ value: "to-br", label: "to-br" }
|
|
1350
1353
|
],
|
|
1351
1354
|
value: e.direction,
|
|
1352
|
-
onPressedChange: (
|
|
1355
|
+
onPressedChange: (d) => L(d)
|
|
1353
1356
|
}
|
|
1354
1357
|
), /* @__PURE__ */ React.createElement(
|
|
1355
1358
|
"div",
|
|
@@ -1362,42 +1365,42 @@ const dr = ({
|
|
|
1362
1365
|
t
|
|
1363
1366
|
)
|
|
1364
1367
|
},
|
|
1365
|
-
onMouseDown:
|
|
1368
|
+
onMouseDown: g
|
|
1366
1369
|
},
|
|
1367
|
-
f.map((
|
|
1370
|
+
f.map((d) => /* @__PURE__ */ React.createElement(
|
|
1368
1371
|
"div",
|
|
1369
1372
|
{
|
|
1370
|
-
key:
|
|
1373
|
+
key: d.id,
|
|
1371
1374
|
"data-stop-handle": "true",
|
|
1372
1375
|
className: "absolute top-1/2 h-4 w-4 rounded-full -translate-y-1/2 -translate-x-1/2 cursor-pointer ring-2 ring-border",
|
|
1373
1376
|
style: {
|
|
1374
|
-
left: `${
|
|
1375
|
-
backgroundColor:
|
|
1377
|
+
left: `${d.position}%`,
|
|
1378
|
+
backgroundColor: d.colorToken.startsWith("[") ? d.colorToken.slice(1, -1) : void 0
|
|
1376
1379
|
},
|
|
1377
|
-
onMouseDown: (
|
|
1378
|
-
onClick: (
|
|
1379
|
-
|
|
1380
|
+
onMouseDown: (S) => z(S, d),
|
|
1381
|
+
onClick: (S) => {
|
|
1382
|
+
S.stopPropagation(), a(d.id);
|
|
1380
1383
|
}
|
|
1381
1384
|
}
|
|
1382
1385
|
))
|
|
1383
|
-
), /* @__PURE__ */ React.createElement("div", { className: "space-y-1" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-start justify-between text-[10px] font-semibold uppercase" }, /* @__PURE__ */ React.createElement("span", null, "Stops")), /* @__PURE__ */ React.createElement("div", { className: "space-y-1" }, ve(f).map((
|
|
1384
|
-
const { hex:
|
|
1386
|
+
), /* @__PURE__ */ React.createElement("div", { className: "space-y-1" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-start justify-between text-[10px] font-semibold uppercase" }, /* @__PURE__ */ React.createElement("span", null, "Stops")), /* @__PURE__ */ React.createElement("div", { className: "space-y-1" }, ve(f).map((d) => {
|
|
1387
|
+
const { hex: S, baseToken: T } = fe(t, d.colorToken);
|
|
1385
1388
|
return /* @__PURE__ */ React.createElement(
|
|
1386
1389
|
"div",
|
|
1387
1390
|
{
|
|
1388
|
-
key:
|
|
1389
|
-
className: `flex gap-2 items-start ${r ===
|
|
1390
|
-
onClick: () => a(
|
|
1391
|
+
key: d.id,
|
|
1392
|
+
className: `flex gap-2 items-start ${r === d.id ? "bg-wp/10" : "bg-transparent"}`,
|
|
1393
|
+
onClick: () => a(d.id)
|
|
1391
1394
|
},
|
|
1392
1395
|
/* @__PURE__ */ React.createElement(
|
|
1393
1396
|
Ee,
|
|
1394
1397
|
{
|
|
1395
1398
|
className: "w-16 h-6",
|
|
1396
1399
|
__nextHasNoMarginBottom: !0,
|
|
1397
|
-
value: String(Math.round(
|
|
1398
|
-
onChange: (
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1400
|
+
value: String(Math.round(d.position)),
|
|
1401
|
+
onChange: (R) => {
|
|
1402
|
+
const O = se(parseFloat(R) || 0, 0, 100);
|
|
1403
|
+
x(d.id, { position: O });
|
|
1401
1404
|
},
|
|
1402
1405
|
type: "text",
|
|
1403
1406
|
suffix: "%"
|
|
@@ -1408,26 +1411,26 @@ const dr = ({
|
|
|
1408
1411
|
{
|
|
1409
1412
|
type: "button",
|
|
1410
1413
|
className: "flex w-16 h-[32px] items-center gap border border-border",
|
|
1411
|
-
onClick: (
|
|
1414
|
+
onClick: (R) => I(d, R.currentTarget)
|
|
1412
1415
|
},
|
|
1413
1416
|
/* @__PURE__ */ React.createElement(
|
|
1414
1417
|
tt,
|
|
1415
1418
|
{
|
|
1416
|
-
colorValue:
|
|
1419
|
+
colorValue: S ?? "#000000",
|
|
1417
1420
|
className: "!h-4 !w-4"
|
|
1418
1421
|
}
|
|
1419
1422
|
),
|
|
1420
|
-
/* @__PURE__ */ React.createElement("span", { className: "truncate text-[11px]" },
|
|
1423
|
+
/* @__PURE__ */ React.createElement("span", { className: "truncate text-[11px]" }, T)
|
|
1421
1424
|
),
|
|
1422
1425
|
/* @__PURE__ */ React.createElement(
|
|
1423
1426
|
Ee,
|
|
1424
1427
|
{
|
|
1425
1428
|
__nextHasNoMarginBottom: !0,
|
|
1426
1429
|
className: "w-12",
|
|
1427
|
-
value: String(Math.round(
|
|
1428
|
-
onChange: (
|
|
1429
|
-
const
|
|
1430
|
-
|
|
1430
|
+
value: String(Math.round(d.opacity)),
|
|
1431
|
+
onChange: (R) => {
|
|
1432
|
+
const O = se(parseFloat(R) || 0, 0, 100);
|
|
1433
|
+
x(d.id, { opacity: O });
|
|
1431
1434
|
},
|
|
1432
1435
|
type: "text",
|
|
1433
1436
|
suffix: "%"
|
|
@@ -1438,7 +1441,7 @@ const dr = ({
|
|
|
1438
1441
|
{
|
|
1439
1442
|
type: "button",
|
|
1440
1443
|
className: "flex h-6 w-6 items-center justify-center rounded border text-xs",
|
|
1441
|
-
onClick: () =>
|
|
1444
|
+
onClick: () => b(d.id),
|
|
1442
1445
|
disabled: e.stops.length <= 1
|
|
1443
1446
|
},
|
|
1444
1447
|
"–"
|
|
@@ -1447,34 +1450,34 @@ const dr = ({
|
|
|
1447
1450
|
}))), /* @__PURE__ */ React.createElement(
|
|
1448
1451
|
Wt,
|
|
1449
1452
|
{
|
|
1450
|
-
visible: o && !!
|
|
1453
|
+
visible: o && !!p,
|
|
1451
1454
|
anchor: s,
|
|
1452
1455
|
onClose: () => c(!1),
|
|
1453
1456
|
position: "bottom center",
|
|
1454
1457
|
offset: 8
|
|
1455
1458
|
},
|
|
1456
|
-
|
|
1459
|
+
p && /* @__PURE__ */ React.createElement("div", { className: "space-y-3" }, /* @__PURE__ */ React.createElement(xe, { title: "Theme tokens" }), /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap gap-1 max-w-[200px]" }, t.map((d) => /* @__PURE__ */ React.createElement(
|
|
1457
1460
|
"button",
|
|
1458
1461
|
{
|
|
1459
|
-
key:
|
|
1462
|
+
key: d.value,
|
|
1460
1463
|
type: "button",
|
|
1461
1464
|
className: "flex h-6 w-6 items-center justify-center rounded-full border",
|
|
1462
|
-
onClick: () =>
|
|
1463
|
-
colorToken:
|
|
1465
|
+
onClick: () => x(p.id, {
|
|
1466
|
+
colorToken: d.value
|
|
1464
1467
|
})
|
|
1465
1468
|
},
|
|
1466
1469
|
/* @__PURE__ */ React.createElement(
|
|
1467
1470
|
tt,
|
|
1468
1471
|
{
|
|
1469
|
-
colorValue:
|
|
1472
|
+
colorValue: d.color,
|
|
1470
1473
|
className: "!h-5 !w-5 !rounded-full"
|
|
1471
1474
|
}
|
|
1472
1475
|
)
|
|
1473
1476
|
))), /* @__PURE__ */ React.createElement(
|
|
1474
1477
|
oi,
|
|
1475
1478
|
{
|
|
1476
|
-
color: fe(t,
|
|
1477
|
-
onChange:
|
|
1479
|
+
color: fe(t, p.colorToken).hex ?? "#000000",
|
|
1480
|
+
onChange: k
|
|
1478
1481
|
}
|
|
1479
1482
|
))
|
|
1480
1483
|
));
|
|
@@ -1566,7 +1569,7 @@ function pr({ mediaProps: t, mediaCallback: e, className: i }) {
|
|
|
1566
1569
|
height: 0
|
|
1567
1570
|
});
|
|
1568
1571
|
}, o = (c) => {
|
|
1569
|
-
var u,
|
|
1572
|
+
var u, m;
|
|
1570
1573
|
const s = {
|
|
1571
1574
|
thumbnail: null,
|
|
1572
1575
|
medium: null,
|
|
@@ -1576,7 +1579,7 @@ function pr({ mediaProps: t, mediaCallback: e, className: i }) {
|
|
|
1576
1579
|
f.width <= 768 && (s.thumbnail = f.url), f.width > 768 && f.width <= 1536 && (s.medium = f.url), f.width > 1536 && (s.large = f.url);
|
|
1577
1580
|
});
|
|
1578
1581
|
let l = c.type;
|
|
1579
|
-
(u = c.url) != null && u.endsWith(".json") && (l = "lottie"), (
|
|
1582
|
+
(u = c.url) != null && u.endsWith(".json") && (l = "lottie"), (m = c.url) != null && m.endsWith(".svg") && (l = "svg"), e({
|
|
1580
1583
|
id: c.id,
|
|
1581
1584
|
url: c.url,
|
|
1582
1585
|
sizes: s,
|
|
@@ -1630,17 +1633,17 @@ const Ji = ({
|
|
|
1630
1633
|
showTooltip: l = !1,
|
|
1631
1634
|
...u
|
|
1632
1635
|
}) => {
|
|
1633
|
-
const [f] = A(-999), [
|
|
1636
|
+
const [f] = A(-999), [p, v] = A(0);
|
|
1634
1637
|
j(() => {
|
|
1635
1638
|
v(Math.round(parseInt(t) / (s ? 16 : 1)));
|
|
1636
1639
|
}, [t]);
|
|
1637
|
-
function b
|
|
1638
|
-
if (
|
|
1640
|
+
function x(b) {
|
|
1641
|
+
if (b === -999) {
|
|
1639
1642
|
o ? o() : a("");
|
|
1640
1643
|
return;
|
|
1641
1644
|
}
|
|
1642
|
-
const
|
|
1643
|
-
a(
|
|
1645
|
+
const g = b * (s ? 16 : 1);
|
|
1646
|
+
a(g.toString());
|
|
1644
1647
|
}
|
|
1645
1648
|
return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React.createElement(
|
|
1646
1649
|
li,
|
|
@@ -1648,19 +1651,19 @@ const Ji = ({
|
|
|
1648
1651
|
__next40pxDefaultSize: !0,
|
|
1649
1652
|
__nextHasNoMarginBottom: !0,
|
|
1650
1653
|
label: e,
|
|
1651
|
-
value:
|
|
1654
|
+
value: p,
|
|
1652
1655
|
min: i,
|
|
1653
1656
|
max: n,
|
|
1654
1657
|
showTooltip: l,
|
|
1655
1658
|
withInputField: r,
|
|
1656
1659
|
allowReset: c,
|
|
1657
|
-
onChange: (
|
|
1658
|
-
v(
|
|
1660
|
+
onChange: (b) => {
|
|
1661
|
+
v(b), x(b);
|
|
1659
1662
|
},
|
|
1660
1663
|
resetFallbackValue: f,
|
|
1661
1664
|
...u
|
|
1662
1665
|
}
|
|
1663
|
-
), /* @__PURE__ */ React.createElement("span", null, s ? `${
|
|
1666
|
+
), /* @__PURE__ */ React.createElement("span", null, s ? `${p * 16}px` : null, " "));
|
|
1664
1667
|
}, Le = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, nt = /^\((?:(\w[\w-]*):)?(.+)\)$/i, Zt = /^\d+\/\d+$/, qi = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, Re = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, Qi = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, Gi = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, en = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, rt = (t) => Zt.test(t), _e = (t) => !!t && !Number.isNaN(Number(t)), tn = (t) => !!t && t.endsWith("%") && _e(t.slice(0, -1)), nn = (t) => qi.test(t), rn = [
|
|
1665
1668
|
{ value: "px", label: "Pixels" },
|
|
1666
1669
|
{ value: "rem", label: "Root EM" },
|
|
@@ -1683,14 +1686,14 @@ const Ji = ({
|
|
|
1683
1686
|
classGroupControl: n,
|
|
1684
1687
|
tailwindUi: r = {}
|
|
1685
1688
|
}) => {
|
|
1686
|
-
var
|
|
1687
|
-
const [a, o] = A(!1), [c, s] = A("arbitrary"), [l, u] = A(""), [
|
|
1689
|
+
var E, N;
|
|
1690
|
+
const [a, o] = A(!1), [c, s] = A("arbitrary"), [l, u] = A(""), [m, f] = A(""), p = U(null), {
|
|
1688
1691
|
manualFraction: v,
|
|
1689
|
-
manualOptions:
|
|
1690
|
-
manualRange:
|
|
1691
|
-
manualCssVars:
|
|
1692
|
-
manualArbitrary:
|
|
1693
|
-
placeholder:
|
|
1692
|
+
manualOptions: x,
|
|
1693
|
+
manualRange: b,
|
|
1694
|
+
manualCssVars: g,
|
|
1695
|
+
manualArbitrary: z,
|
|
1696
|
+
placeholder: I
|
|
1694
1697
|
} = (n == null ? void 0 : n.metadata) || {
|
|
1695
1698
|
manualFraction: !0,
|
|
1696
1699
|
manualOptions: !0,
|
|
@@ -1698,75 +1701,75 @@ const Ji = ({
|
|
|
1698
1701
|
manualCssVars: !0,
|
|
1699
1702
|
manualArbitrary: !0,
|
|
1700
1703
|
placeholder: "0"
|
|
1701
|
-
},
|
|
1704
|
+
}, y = ((E = n == null ? void 0 : n.metadata) == null ? void 0 : E.rangeMin) ?? 0, L = ((N = n == null ? void 0 : n.metadata) == null ? void 0 : N.rangeMax) ?? 100;
|
|
1702
1705
|
j(() => {
|
|
1703
|
-
u(
|
|
1706
|
+
u(O(t)), f(t), s(_(t));
|
|
1704
1707
|
}, [t]);
|
|
1705
|
-
const
|
|
1708
|
+
const k = oe(
|
|
1706
1709
|
() => (n == null ? void 0 : n.options) || [],
|
|
1707
1710
|
[n == null ? void 0 : n.options]
|
|
1708
|
-
),
|
|
1709
|
-
() =>
|
|
1711
|
+
), d = oe(
|
|
1712
|
+
() => R(n == null ? void 0 : n.validators, [
|
|
1710
1713
|
"isArbitraryVariable",
|
|
1711
1714
|
"isArbitraryValue",
|
|
1712
1715
|
"themeGetter"
|
|
1713
1716
|
]),
|
|
1714
1717
|
[n == null ? void 0 : n.validators]
|
|
1715
|
-
),
|
|
1716
|
-
() =>
|
|
1718
|
+
), S = oe(
|
|
1719
|
+
() => R(n == null ? void 0 : n.validators, ["isFraction"]),
|
|
1717
1720
|
[n == null ? void 0 : n.validators]
|
|
1718
|
-
),
|
|
1719
|
-
() =>
|
|
1721
|
+
), T = oe(
|
|
1722
|
+
() => R(n == null ? void 0 : n.validators, ["themeGetter"]),
|
|
1720
1723
|
[n == null ? void 0 : n.validators]
|
|
1721
1724
|
);
|
|
1722
|
-
function
|
|
1723
|
-
return
|
|
1724
|
-
}
|
|
1725
|
-
const
|
|
1726
|
-
if (!
|
|
1727
|
-
const
|
|
1728
|
-
if (
|
|
1729
|
-
const
|
|
1730
|
-
return
|
|
1731
|
-
}, M = (
|
|
1732
|
-
if (!
|
|
1733
|
-
const
|
|
1734
|
-
return
|
|
1735
|
-
}, _ = (
|
|
1736
|
-
const
|
|
1737
|
-
return
|
|
1738
|
-
}, D = (
|
|
1739
|
-
u(
|
|
1725
|
+
function R(h, w) {
|
|
1726
|
+
return h ? h.some((C) => typeof C == "function" && typeof C.name == "string" ? w.includes(C.name) : !1) : !1;
|
|
1727
|
+
}
|
|
1728
|
+
const O = (h) => {
|
|
1729
|
+
if (!h) return "";
|
|
1730
|
+
const w = h.match(Le);
|
|
1731
|
+
if (w) return w[2];
|
|
1732
|
+
const C = h.match(nt);
|
|
1733
|
+
return C ? C[2] : h;
|
|
1734
|
+
}, M = (h) => {
|
|
1735
|
+
if (!h) return "";
|
|
1736
|
+
const w = h.trim();
|
|
1737
|
+
return k.some((C) => String(C.value) === w) ? w : w.startsWith("--") ? `(${w})` : _e(w) && !Re.test(w) ? (n == null ? void 0 : n.themeProvider) && Array.isArray(n.themeProvider) && n.themeProvider.length > 0 ? w : `[${w}]` : Re.test(w) ? `[${w}]` : h;
|
|
1738
|
+
}, _ = (h) => {
|
|
1739
|
+
const w = (h || "").trim();
|
|
1740
|
+
return k.some((C) => String(C.value) === w) ? "list" : w.startsWith("--") ? "arbitrary" : rt(w) ? "fraction" : Le.test(w) ? "arbitrary" : _e(w) && !Re.test(w) ? "native" : tn(w) || Re.test(w) ? "arbitrary" : nn(w) ? "native" : Qi.test(w) || /^#([0-9a-f]{3,8})$/i.test(w) ? "color" : (Gi.test(w) || en.test(w), "arbitrary");
|
|
1741
|
+
}, D = (h) => !!(h === "" || _e(h) || Le.test(h) || nt.test(h) || k.some((w) => String(w.value) === h) || rt(h) || h === "full"), V = (h) => {
|
|
1742
|
+
u(h);
|
|
1740
1743
|
}, P = () => {
|
|
1741
|
-
const
|
|
1742
|
-
D(
|
|
1743
|
-
}, $ = (
|
|
1744
|
-
if (
|
|
1745
|
-
const
|
|
1746
|
-
D(
|
|
1747
|
-
}
|
|
1748
|
-
},
|
|
1744
|
+
const h = M(l);
|
|
1745
|
+
D(h) ? (f(h), e(h), s(_(h))) : u(m);
|
|
1746
|
+
}, $ = (h) => {
|
|
1747
|
+
if (h.key === "Enter") {
|
|
1748
|
+
const w = M(l);
|
|
1749
|
+
D(w) ? (f(w), e(w), s(_(w))) : u(m);
|
|
1750
|
+
}
|
|
1751
|
+
}, H = (h) => {
|
|
1749
1752
|
var Ge;
|
|
1750
|
-
const
|
|
1753
|
+
const w = l.trim(), C = !isNaN(Number(w));
|
|
1751
1754
|
let Z = "";
|
|
1752
|
-
if (
|
|
1755
|
+
if (h === "")
|
|
1753
1756
|
Z = "";
|
|
1754
|
-
else if (Zt.test(
|
|
1755
|
-
Z =
|
|
1756
|
-
else if (c === "list" || c === "theme" ||
|
|
1757
|
-
Z =
|
|
1758
|
-
else if (
|
|
1759
|
-
Z = `${
|
|
1757
|
+
else if (Zt.test(h))
|
|
1758
|
+
Z = h;
|
|
1759
|
+
else if (c === "list" || c === "theme" || w.startsWith("--"))
|
|
1760
|
+
Z = h;
|
|
1761
|
+
else if (C)
|
|
1762
|
+
Z = `${w}${h}`;
|
|
1760
1763
|
else {
|
|
1761
|
-
const et =
|
|
1762
|
-
et ? Z = `${et[1]}${
|
|
1764
|
+
const et = w.match(/^(-?\d+\.?\d*)/);
|
|
1765
|
+
et ? Z = `${et[1]}${h}` : Z = h;
|
|
1763
1766
|
}
|
|
1764
1767
|
u(Z);
|
|
1765
1768
|
const ce = M(Z);
|
|
1766
|
-
D(ce) && (f(ce), e(ce), s(_(ce))), (Ge =
|
|
1767
|
-
}, K = (
|
|
1768
|
-
const
|
|
1769
|
-
D(
|
|
1769
|
+
D(ce) && (f(ce), e(ce), s(_(ce))), (Ge = p.current) == null || Ge.focus();
|
|
1770
|
+
}, K = (h) => {
|
|
1771
|
+
const w = O(h), C = M(w);
|
|
1772
|
+
D(C) ? (u(w), f(C), e(C), s(_(C))) : u(m);
|
|
1770
1773
|
}, ne = (() => {
|
|
1771
1774
|
switch (c) {
|
|
1772
1775
|
case "fraction":
|
|
@@ -1781,48 +1784,48 @@ const Ji = ({
|
|
|
1781
1784
|
return /* @__PURE__ */ React.createElement(Ft, null);
|
|
1782
1785
|
}
|
|
1783
1786
|
})(), F = () => o(!0), re = () => {
|
|
1784
|
-
var
|
|
1785
|
-
return
|
|
1787
|
+
var h, w, C;
|
|
1788
|
+
return S ? /* @__PURE__ */ React.createElement(
|
|
1786
1789
|
ye,
|
|
1787
1790
|
{
|
|
1788
|
-
options: ((
|
|
1791
|
+
options: ((C = (w = (h = r == null ? void 0 : r.units) == null ? void 0 : h.spacing) == null ? void 0 : w.fraction) == null ? void 0 : C.options) || [],
|
|
1789
1792
|
size: "small",
|
|
1790
1793
|
value: l,
|
|
1791
1794
|
className: "mt-0 w-[200px]",
|
|
1792
|
-
onPressedChange: (Z) =>
|
|
1795
|
+
onPressedChange: (Z) => H(String(Z))
|
|
1793
1796
|
}
|
|
1794
1797
|
) : null;
|
|
1795
1798
|
}, W = () => /* @__PURE__ */ React.createElement(
|
|
1796
1799
|
ye,
|
|
1797
1800
|
{
|
|
1798
|
-
options:
|
|
1799
|
-
value:
|
|
1800
|
-
label:
|
|
1801
|
+
options: k.map((h) => ({
|
|
1802
|
+
value: h.value,
|
|
1803
|
+
label: h.label
|
|
1801
1804
|
})),
|
|
1802
1805
|
size: "small",
|
|
1803
1806
|
className: "mt-0 w-[200px]",
|
|
1804
1807
|
value: l,
|
|
1805
|
-
onPressedChange: (
|
|
1808
|
+
onPressedChange: (h) => K(String(h))
|
|
1806
1809
|
}
|
|
1807
1810
|
), J = oe(() => {
|
|
1808
1811
|
try {
|
|
1809
|
-
const
|
|
1810
|
-
for (let
|
|
1811
|
-
const Z =
|
|
1812
|
+
const h = window.getComputedStyle(document.documentElement), w = [];
|
|
1813
|
+
for (let C = 0; C < h.length; C++) {
|
|
1814
|
+
const Z = h[C];
|
|
1812
1815
|
if (Z.startsWith("--wp--custom--")) {
|
|
1813
|
-
const ce =
|
|
1814
|
-
|
|
1816
|
+
const ce = h.getPropertyValue(Z).trim();
|
|
1817
|
+
w.push({
|
|
1815
1818
|
value: Z,
|
|
1816
1819
|
label: `${Z} (${ce})`
|
|
1817
1820
|
});
|
|
1818
1821
|
}
|
|
1819
1822
|
}
|
|
1820
|
-
return
|
|
1823
|
+
return w;
|
|
1821
1824
|
} catch {
|
|
1822
1825
|
return [];
|
|
1823
1826
|
}
|
|
1824
1827
|
}, []), ae = () => {
|
|
1825
|
-
const
|
|
1828
|
+
const w = [
|
|
1826
1829
|
...J,
|
|
1827
1830
|
{
|
|
1828
1831
|
value: "--custom-css-var",
|
|
@@ -1833,24 +1836,24 @@ const Ji = ({
|
|
|
1833
1836
|
ye,
|
|
1834
1837
|
{
|
|
1835
1838
|
className: "mt-0 w-[200px]",
|
|
1836
|
-
options:
|
|
1839
|
+
options: w,
|
|
1837
1840
|
size: "small",
|
|
1838
1841
|
value: l,
|
|
1839
|
-
onPressedChange: (
|
|
1842
|
+
onPressedChange: (C) => K(String(C))
|
|
1840
1843
|
}
|
|
1841
1844
|
);
|
|
1842
1845
|
}, le = () => /* @__PURE__ */ React.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React.createElement(
|
|
1843
1846
|
ye,
|
|
1844
1847
|
{
|
|
1845
1848
|
className: "mt-0 w-[200px]",
|
|
1846
|
-
options: rn.map((
|
|
1847
|
-
value:
|
|
1848
|
-
label:
|
|
1849
|
-
tooltip:
|
|
1849
|
+
options: rn.map((h) => ({
|
|
1850
|
+
value: h.value,
|
|
1851
|
+
label: h.value,
|
|
1852
|
+
tooltip: h.label
|
|
1850
1853
|
})),
|
|
1851
1854
|
size: "small",
|
|
1852
1855
|
value: l,
|
|
1853
|
-
onPressedChange: (
|
|
1856
|
+
onPressedChange: (h) => H(String(h))
|
|
1854
1857
|
}
|
|
1855
1858
|
));
|
|
1856
1859
|
return /* @__PURE__ */ React.createElement("div", { className: "relative flex flex-col items-baseline" }, /* @__PURE__ */ React.createElement(
|
|
@@ -1862,7 +1865,7 @@ const Ji = ({
|
|
|
1862
1865
|
onChange: V,
|
|
1863
1866
|
onBlur: P,
|
|
1864
1867
|
onKeyDown: $,
|
|
1865
|
-
placeholder:
|
|
1868
|
+
placeholder: I,
|
|
1866
1869
|
autoComplete: "off",
|
|
1867
1870
|
suffix: /* @__PURE__ */ React.createElement($t, null, /* @__PURE__ */ React.createElement(
|
|
1868
1871
|
Wt,
|
|
@@ -1873,22 +1876,22 @@ const Ji = ({
|
|
|
1873
1876
|
className: "overflow-x-hidden w-[280px] max-h-[400px]",
|
|
1874
1877
|
onVisibleChange: o
|
|
1875
1878
|
},
|
|
1876
|
-
/* @__PURE__ */ React.createElement("div", { className: "flex flex-col divide-y divide-border -m-4" },
|
|
1879
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex flex-col divide-y divide-border -m-4" }, b && /* @__PURE__ */ React.createElement(
|
|
1877
1880
|
Ji,
|
|
1878
1881
|
{
|
|
1879
1882
|
value: l,
|
|
1880
1883
|
label: "Number Value",
|
|
1881
1884
|
className: "w-[200px] pt-4 pb-2 px-4",
|
|
1882
|
-
min:
|
|
1885
|
+
min: y,
|
|
1883
1886
|
max: L,
|
|
1884
1887
|
gridMode: !1,
|
|
1885
1888
|
showTooltip: !1,
|
|
1886
|
-
onValueChange: (
|
|
1887
|
-
const
|
|
1888
|
-
D(
|
|
1889
|
+
onValueChange: (h) => {
|
|
1890
|
+
const w = M(h);
|
|
1891
|
+
D(w) ? (u(h), f(w), e(w), s(_(w))) : u(h);
|
|
1889
1892
|
}
|
|
1890
1893
|
}
|
|
1891
|
-
),
|
|
1894
|
+
), S && v && /* @__PURE__ */ React.createElement("div", { className: "p-4" }, /* @__PURE__ */ React.createElement(xe, { title: "Fraction" }), re()), k.length > 0 && x && /* @__PURE__ */ React.createElement("div", { className: "p-4" }, /* @__PURE__ */ React.createElement(xe, { title: "Options" }), W()), d && z && /* @__PURE__ */ React.createElement("div", { className: "p-4" }, /* @__PURE__ */ React.createElement(xe, { title: "Arbitrary Units" }), le()), T && g && /* @__PURE__ */ React.createElement("div", { className: "p-4" }, /* @__PURE__ */ React.createElement(
|
|
1892
1895
|
xe,
|
|
1893
1896
|
{
|
|
1894
1897
|
title: "CSS Variables",
|
|
@@ -1935,20 +1938,20 @@ const Ji = ({
|
|
|
1935
1938
|
shouldCloseOnClickOutside: l = !0,
|
|
1936
1939
|
...u
|
|
1937
1940
|
}) => {
|
|
1938
|
-
const
|
|
1939
|
-
|
|
1940
|
-
},
|
|
1941
|
-
c == null || c(),
|
|
1942
|
-
},
|
|
1943
|
-
(
|
|
1941
|
+
const m = e !== void 0, [f, p] = A(i), v = m ? e : f, x = (y) => {
|
|
1942
|
+
m || p(y), n == null || n(y);
|
|
1943
|
+
}, b = () => x(!0), g = () => {
|
|
1944
|
+
c == null || c(), x(!1);
|
|
1945
|
+
}, z = ge.toArray(t).some(
|
|
1946
|
+
(y) => we(y) && y.type === at
|
|
1944
1947
|
);
|
|
1945
1948
|
j(() => {
|
|
1946
1949
|
n == null || n(v);
|
|
1947
1950
|
}, [v, n]);
|
|
1948
|
-
let
|
|
1949
|
-
return
|
|
1951
|
+
let I = {};
|
|
1952
|
+
return z ? I = { labelledby: "bb-modal-heading" } : r && (I = { label: r }), /* @__PURE__ */ React.createElement(Ut.Provider, { value: { closeModal: g, openModal: b } }, ge.map(
|
|
1950
1953
|
t,
|
|
1951
|
-
(
|
|
1954
|
+
(y) => we(y) && y.type === on ? y : null
|
|
1952
1955
|
), v && /* @__PURE__ */ React.createElement(
|
|
1953
1956
|
ci,
|
|
1954
1957
|
{
|
|
@@ -1959,8 +1962,8 @@ const Ji = ({
|
|
|
1959
1962
|
),
|
|
1960
1963
|
size: o,
|
|
1961
1964
|
title: "",
|
|
1962
|
-
aria:
|
|
1963
|
-
onRequestClose:
|
|
1965
|
+
aria: I,
|
|
1966
|
+
onRequestClose: g,
|
|
1964
1967
|
shouldCloseOnEsc: s,
|
|
1965
1968
|
shouldCloseOnClickOutside: l,
|
|
1966
1969
|
...u
|
|
@@ -1971,18 +1974,18 @@ const Ji = ({
|
|
|
1971
1974
|
"aria-label": "Close",
|
|
1972
1975
|
label: "Close",
|
|
1973
1976
|
variant: "secondary",
|
|
1974
|
-
onClick:
|
|
1977
|
+
onClick: g
|
|
1975
1978
|
},
|
|
1976
1979
|
/* @__PURE__ */ React.createElement(Ti, { className: "h-4 w-4" })
|
|
1977
1980
|
)), ge.map(
|
|
1978
1981
|
t,
|
|
1979
|
-
(
|
|
1982
|
+
(y) => we(y) && y.type === at ? y : null
|
|
1980
1983
|
), ge.map(
|
|
1981
1984
|
t,
|
|
1982
|
-
(
|
|
1985
|
+
(y) => we(y) && y.type === sn ? y : null
|
|
1983
1986
|
), ge.map(
|
|
1984
1987
|
t,
|
|
1985
|
-
(
|
|
1988
|
+
(y) => we(y) && y.type === an ? y : null
|
|
1986
1989
|
))
|
|
1987
1990
|
));
|
|
1988
1991
|
}, at = ({ children: t, className: e = "", ...i }) => /* @__PURE__ */ React.createElement(
|
|
@@ -2120,7 +2123,7 @@ function Sr(t) {
|
|
|
2120
2123
|
const { media: e, bbFill: i } = t, { url: n, alt: r, sizes: a } = e;
|
|
2121
2124
|
if (a === void 0)
|
|
2122
2125
|
return /* @__PURE__ */ React.createElement("picture", { className: "b_fill" }, /* @__PURE__ */ React.createElement("img", { src: n, alt: r, className: `b_media ${i}` }));
|
|
2123
|
-
const { thumbnail: o, medium: c, large: s } = a, l = o || n, u = c || n,
|
|
2126
|
+
const { thumbnail: o, medium: c, large: s } = a, l = o || n, u = c || n, m = s || n;
|
|
2124
2127
|
return /* @__PURE__ */ React.createElement("picture", { className: "b_fill" }, l ? /* @__PURE__ */ React.createElement(
|
|
2125
2128
|
"source",
|
|
2126
2129
|
{
|
|
@@ -2135,11 +2138,11 @@ function Sr(t) {
|
|
|
2135
2138
|
srcSet: u,
|
|
2136
2139
|
className: `b_media ${i}`
|
|
2137
2140
|
}
|
|
2138
|
-
) : null,
|
|
2141
|
+
) : null, m ? /* @__PURE__ */ React.createElement(
|
|
2139
2142
|
"source",
|
|
2140
2143
|
{
|
|
2141
2144
|
media: "(min-width: 1536px)",
|
|
2142
|
-
srcSet:
|
|
2145
|
+
srcSet: m,
|
|
2143
2146
|
className: `b_media ${i}`
|
|
2144
2147
|
}
|
|
2145
2148
|
) : null, u ? /* @__PURE__ */ React.createElement("img", { src: u, alt: r, className: `b_media ${i}` }) : null);
|
|
@@ -2172,31 +2175,31 @@ const cn = 2e3, zr = ({
|
|
|
2172
2175
|
disabled: s = !1,
|
|
2173
2176
|
savedLabel: l = "Saved",
|
|
2174
2177
|
savedDuration: u = cn,
|
|
2175
|
-
...
|
|
2178
|
+
...m
|
|
2176
2179
|
}) => {
|
|
2177
|
-
const [f,
|
|
2180
|
+
const [f, p] = A(!1), [v, x] = A(!1), b = U(null), g = o === "icon" || o === "icon-lg";
|
|
2178
2181
|
j(() => () => {
|
|
2179
|
-
|
|
2182
|
+
b.current && window.clearTimeout(b.current);
|
|
2180
2183
|
}, []);
|
|
2181
|
-
const
|
|
2184
|
+
const z = async () => {
|
|
2182
2185
|
if (!(s || f)) {
|
|
2183
|
-
|
|
2186
|
+
b.current && window.clearTimeout(b.current), x(!1), p(!0);
|
|
2184
2187
|
try {
|
|
2185
|
-
await Promise.resolve(r == null ? void 0 : r()),
|
|
2186
|
-
|
|
2188
|
+
await Promise.resolve(r == null ? void 0 : r()), p(!1), x(!0), b.current = window.setTimeout(() => {
|
|
2189
|
+
x(!1);
|
|
2187
2190
|
}, u);
|
|
2188
2191
|
} catch {
|
|
2189
|
-
|
|
2192
|
+
p(!1);
|
|
2190
2193
|
}
|
|
2191
2194
|
}
|
|
2192
|
-
},
|
|
2195
|
+
}, I = v ? l : i, y = v ? _i : c;
|
|
2193
2196
|
return /* @__PURE__ */ React.createElement(
|
|
2194
2197
|
Y,
|
|
2195
2198
|
{
|
|
2196
|
-
...
|
|
2199
|
+
...m,
|
|
2197
2200
|
size: e,
|
|
2198
2201
|
variant: a,
|
|
2199
|
-
label:
|
|
2202
|
+
label: I,
|
|
2200
2203
|
showTooltip: !0,
|
|
2201
2204
|
disabled: s || f,
|
|
2202
2205
|
isBusy: f,
|
|
@@ -2210,17 +2213,17 @@ const cn = 2e3, zr = ({
|
|
|
2210
2213
|
{ "is-tertiary": a === "tertiary" },
|
|
2211
2214
|
{ "is-icon": o === "icon" }
|
|
2212
2215
|
),
|
|
2213
|
-
onClick:
|
|
2216
|
+
onClick: z
|
|
2214
2217
|
},
|
|
2215
|
-
|
|
2218
|
+
y && /* @__PURE__ */ React.createElement(
|
|
2216
2219
|
He,
|
|
2217
2220
|
{
|
|
2218
|
-
icon:
|
|
2221
|
+
icon: y,
|
|
2219
2222
|
className: B({ "h-4 w-4": o === "icon-lg" })
|
|
2220
2223
|
}
|
|
2221
2224
|
),
|
|
2222
|
-
|
|
2223
|
-
|
|
2225
|
+
g ? null : v ? l : t,
|
|
2226
|
+
I && !t && !g ? /* @__PURE__ */ React.createElement("span", null, I) : null
|
|
2224
2227
|
);
|
|
2225
2228
|
}, Nr = ({
|
|
2226
2229
|
children: t,
|
|
@@ -2360,10 +2363,10 @@ var Ve, lt, ct, dn = (st || (st = 1, Ve = ot, (function() {
|
|
|
2360
2363
|
}
|
|
2361
2364
|
function c(s) {
|
|
2362
2365
|
if (typeof s == "number") return s;
|
|
2363
|
-
if ((function(
|
|
2364
|
-
return typeof
|
|
2366
|
+
if ((function(m) {
|
|
2367
|
+
return typeof m == "symbol" || /* @__PURE__ */ (function(f) {
|
|
2365
2368
|
return !!f && typeof f == "object";
|
|
2366
|
-
})(
|
|
2369
|
+
})(m) && a.call(m) == "[object Symbol]";
|
|
2367
2370
|
})(s)) return NaN;
|
|
2368
2371
|
if (o(s)) {
|
|
2369
2372
|
var l = typeof s.valueOf == "function" ? s.valueOf() : s;
|
|
@@ -2375,72 +2378,72 @@ var Ve, lt, ct, dn = (st || (st = 1, Ve = ot, (function() {
|
|
|
2375
2378
|
return u || n.test(s) ? r(s.slice(2), u ? 2 : 8) : e.test(s) ? NaN : +s;
|
|
2376
2379
|
}
|
|
2377
2380
|
return ut = function(s, l, u) {
|
|
2378
|
-
return u === void 0 && (u = l, l = void 0), u !== void 0 && (u = (u = c(u)) == u ? u : 0), l !== void 0 && (l = (l = c(l)) == l ? l : 0), (function(
|
|
2379
|
-
return
|
|
2381
|
+
return u === void 0 && (u = l, l = void 0), u !== void 0 && (u = (u = c(u)) == u ? u : 0), l !== void 0 && (l = (l = c(l)) == l ? l : 0), (function(m, f, p) {
|
|
2382
|
+
return m == m && (p !== void 0 && (m = m <= p ? m : p), f !== void 0 && (m = m >= f ? m : f)), m;
|
|
2380
2383
|
})(c(s), l, u);
|
|
2381
2384
|
};
|
|
2382
2385
|
})()), pn = Se((function() {
|
|
2383
2386
|
if (ft) return dt;
|
|
2384
2387
|
ft = 1;
|
|
2385
|
-
var t = /^\s+|\s+$/g, e = /^[-+]0x[0-9a-f]+$/i, i = /^0b[01]+$/i, n = /^0o[0-7]+$/i, r = parseInt, a = typeof ze == "object" && ze && ze.Object === Object && ze, o = typeof self == "object" && self && self.Object === Object && self, c = a || o || Function("return this")(), s = Object.prototype.toString, l = Math.max, u = Math.min,
|
|
2388
|
+
var t = /^\s+|\s+$/g, e = /^[-+]0x[0-9a-f]+$/i, i = /^0b[01]+$/i, n = /^0o[0-7]+$/i, r = parseInt, a = typeof ze == "object" && ze && ze.Object === Object && ze, o = typeof self == "object" && self && self.Object === Object && self, c = a || o || Function("return this")(), s = Object.prototype.toString, l = Math.max, u = Math.min, m = function() {
|
|
2386
2389
|
return c.Date.now();
|
|
2387
2390
|
};
|
|
2388
2391
|
function f(v) {
|
|
2389
|
-
var
|
|
2390
|
-
return !!v && (
|
|
2392
|
+
var x = typeof v;
|
|
2393
|
+
return !!v && (x == "object" || x == "function");
|
|
2391
2394
|
}
|
|
2392
|
-
function
|
|
2395
|
+
function p(v) {
|
|
2393
2396
|
if (typeof v == "number") return v;
|
|
2394
|
-
if ((function(
|
|
2395
|
-
return typeof
|
|
2396
|
-
return !!
|
|
2397
|
-
})(
|
|
2397
|
+
if ((function(g) {
|
|
2398
|
+
return typeof g == "symbol" || /* @__PURE__ */ (function(z) {
|
|
2399
|
+
return !!z && typeof z == "object";
|
|
2400
|
+
})(g) && s.call(g) == "[object Symbol]";
|
|
2398
2401
|
})(v)) return NaN;
|
|
2399
2402
|
if (f(v)) {
|
|
2400
|
-
var
|
|
2401
|
-
v = f(
|
|
2403
|
+
var x = typeof v.valueOf == "function" ? v.valueOf() : v;
|
|
2404
|
+
v = f(x) ? x + "" : x;
|
|
2402
2405
|
}
|
|
2403
2406
|
if (typeof v != "string") return v === 0 ? v : +v;
|
|
2404
2407
|
v = v.replace(t, "");
|
|
2405
|
-
var
|
|
2406
|
-
return
|
|
2408
|
+
var b = i.test(v);
|
|
2409
|
+
return b || n.test(v) ? r(v.slice(2), b ? 2 : 8) : e.test(v) ? NaN : +v;
|
|
2407
2410
|
}
|
|
2408
|
-
return dt = function(v,
|
|
2409
|
-
var
|
|
2411
|
+
return dt = function(v, x, b) {
|
|
2412
|
+
var g, z, I, y, L, k, d = 0, S = !1, T = !1, R = !0;
|
|
2410
2413
|
if (typeof v != "function") throw new TypeError("Expected a function");
|
|
2411
|
-
function
|
|
2412
|
-
var $ =
|
|
2413
|
-
return
|
|
2414
|
+
function O(P) {
|
|
2415
|
+
var $ = g, H = z;
|
|
2416
|
+
return g = z = void 0, d = P, y = v.apply(H, $);
|
|
2414
2417
|
}
|
|
2415
2418
|
function M(P) {
|
|
2416
|
-
var $ = P -
|
|
2417
|
-
return
|
|
2419
|
+
var $ = P - k;
|
|
2420
|
+
return k === void 0 || $ >= x || $ < 0 || T && P - d >= I;
|
|
2418
2421
|
}
|
|
2419
2422
|
function _() {
|
|
2420
|
-
var P =
|
|
2423
|
+
var P = m();
|
|
2421
2424
|
if (M(P)) return D(P);
|
|
2422
2425
|
L = setTimeout(_, (function($) {
|
|
2423
|
-
var
|
|
2424
|
-
return
|
|
2426
|
+
var H = x - ($ - k);
|
|
2427
|
+
return T ? u(H, I - ($ - d)) : H;
|
|
2425
2428
|
})(P));
|
|
2426
2429
|
}
|
|
2427
2430
|
function D(P) {
|
|
2428
|
-
return L = void 0,
|
|
2431
|
+
return L = void 0, R && g ? O(P) : (g = z = void 0, y);
|
|
2429
2432
|
}
|
|
2430
2433
|
function V() {
|
|
2431
|
-
var P =
|
|
2432
|
-
if (
|
|
2433
|
-
if (L === void 0) return (function(
|
|
2434
|
-
return
|
|
2435
|
-
})(
|
|
2436
|
-
if (
|
|
2434
|
+
var P = m(), $ = M(P);
|
|
2435
|
+
if (g = arguments, z = this, k = P, $) {
|
|
2436
|
+
if (L === void 0) return (function(H) {
|
|
2437
|
+
return d = H, L = setTimeout(_, x), S ? O(H) : y;
|
|
2438
|
+
})(k);
|
|
2439
|
+
if (T) return L = setTimeout(_, x), O(k);
|
|
2437
2440
|
}
|
|
2438
|
-
return L === void 0 && (L = setTimeout(_,
|
|
2441
|
+
return L === void 0 && (L = setTimeout(_, x)), y;
|
|
2439
2442
|
}
|
|
2440
|
-
return
|
|
2441
|
-
L !== void 0 && clearTimeout(L),
|
|
2443
|
+
return x = p(x) || 0, f(b) && (S = !!b.leading, I = (T = "maxWait" in b) ? l(p(b.maxWait) || 0, x) : I, R = "trailing" in b ? !!b.trailing : R), V.cancel = function() {
|
|
2444
|
+
L !== void 0 && clearTimeout(L), d = 0, g = k = z = L = void 0;
|
|
2442
2445
|
}, V.flush = function() {
|
|
2443
|
-
return L === void 0 ?
|
|
2446
|
+
return L === void 0 ? y : D(m());
|
|
2444
2447
|
}, V;
|
|
2445
2448
|
};
|
|
2446
2449
|
})()), ht = {
|
|
@@ -2463,13 +2466,13 @@ function vn(t) {
|
|
|
2463
2466
|
return s.current = t.onResize, window.React.useEffect(() => {
|
|
2464
2467
|
if (!e.current || typeof window > "u" || !("ResizeObserver" in window)) return;
|
|
2465
2468
|
const l = new ResizeObserver(([u]) => {
|
|
2466
|
-
const
|
|
2467
|
-
if (c.current.width !== f || c.current.height !==
|
|
2469
|
+
const m = i === "border-box" ? "borderBoxSize" : i === "device-pixel-content-box" ? "devicePixelContentBoxSize" : "contentBoxSize", f = pt(u, m, "inlineSize"), p = pt(u, m, "blockSize");
|
|
2470
|
+
if (c.current.width !== f || c.current.height !== p) {
|
|
2468
2471
|
const v = {
|
|
2469
2472
|
width: f,
|
|
2470
|
-
height:
|
|
2473
|
+
height: p
|
|
2471
2474
|
};
|
|
2472
|
-
c.current.width = f, c.current.height =
|
|
2475
|
+
c.current.width = f, c.current.height = p, s.current ? s.current(v) : o() && a(v);
|
|
2473
2476
|
}
|
|
2474
2477
|
});
|
|
2475
2478
|
return l.observe(e.current, {
|
|
@@ -2513,10 +2516,10 @@ var gt, wt = {
|
|
|
2513
2516
|
function r(s, l, u) {
|
|
2514
2517
|
this.fn = s, this.context = l, this.once = u || !1;
|
|
2515
2518
|
}
|
|
2516
|
-
function a(s, l, u,
|
|
2519
|
+
function a(s, l, u, m, f) {
|
|
2517
2520
|
if (typeof u != "function") throw new TypeError("The listener must be a function");
|
|
2518
|
-
var
|
|
2519
|
-
return s._events[v] ? s._events[v].fn ? s._events[v] = [s._events[v],
|
|
2521
|
+
var p = new r(u, m || s, f), v = i ? i + l : l;
|
|
2522
|
+
return s._events[v] ? s._events[v].fn ? s._events[v] = [s._events[v], p] : s._events[v].push(p) : (s._events[v] = p, s._eventsCount++), s;
|
|
2520
2523
|
}
|
|
2521
2524
|
function o(s, l) {
|
|
2522
2525
|
--s._eventsCount === 0 ? s._events = new n() : delete s._events[l];
|
|
@@ -2533,50 +2536,50 @@ var gt, wt = {
|
|
|
2533
2536
|
var l = i ? i + s : s, u = this._events[l];
|
|
2534
2537
|
if (!u) return [];
|
|
2535
2538
|
if (u.fn) return [u.fn];
|
|
2536
|
-
for (var
|
|
2537
|
-
return
|
|
2539
|
+
for (var m = 0, f = u.length, p = new Array(f); m < f; m++) p[m] = u[m].fn;
|
|
2540
|
+
return p;
|
|
2538
2541
|
}, c.prototype.listenerCount = function(s) {
|
|
2539
2542
|
var l = i ? i + s : s, u = this._events[l];
|
|
2540
2543
|
return u ? u.fn ? 1 : u.length : 0;
|
|
2541
|
-
}, c.prototype.emit = function(s, l, u,
|
|
2544
|
+
}, c.prototype.emit = function(s, l, u, m, f, p) {
|
|
2542
2545
|
var v = i ? i + s : s;
|
|
2543
2546
|
if (!this._events[v]) return !1;
|
|
2544
|
-
var
|
|
2545
|
-
if (
|
|
2546
|
-
switch (
|
|
2547
|
+
var x, b, g = this._events[v], z = arguments.length;
|
|
2548
|
+
if (g.fn) {
|
|
2549
|
+
switch (g.once && this.removeListener(s, g.fn, void 0, !0), z) {
|
|
2547
2550
|
case 1:
|
|
2548
|
-
return
|
|
2551
|
+
return g.fn.call(g.context), !0;
|
|
2549
2552
|
case 2:
|
|
2550
|
-
return
|
|
2553
|
+
return g.fn.call(g.context, l), !0;
|
|
2551
2554
|
case 3:
|
|
2552
|
-
return
|
|
2555
|
+
return g.fn.call(g.context, l, u), !0;
|
|
2553
2556
|
case 4:
|
|
2554
|
-
return
|
|
2557
|
+
return g.fn.call(g.context, l, u, m), !0;
|
|
2555
2558
|
case 5:
|
|
2556
|
-
return
|
|
2559
|
+
return g.fn.call(g.context, l, u, m, f), !0;
|
|
2557
2560
|
case 6:
|
|
2558
|
-
return
|
|
2561
|
+
return g.fn.call(g.context, l, u, m, f, p), !0;
|
|
2559
2562
|
}
|
|
2560
|
-
for (
|
|
2561
|
-
|
|
2563
|
+
for (b = 1, x = new Array(z - 1); b < z; b++) x[b - 1] = arguments[b];
|
|
2564
|
+
g.fn.apply(g.context, x);
|
|
2562
2565
|
} else {
|
|
2563
|
-
var
|
|
2564
|
-
for (
|
|
2566
|
+
var I, y = g.length;
|
|
2567
|
+
for (b = 0; b < y; b++) switch (g[b].once && this.removeListener(s, g[b].fn, void 0, !0), z) {
|
|
2565
2568
|
case 1:
|
|
2566
|
-
|
|
2569
|
+
g[b].fn.call(g[b].context);
|
|
2567
2570
|
break;
|
|
2568
2571
|
case 2:
|
|
2569
|
-
|
|
2572
|
+
g[b].fn.call(g[b].context, l);
|
|
2570
2573
|
break;
|
|
2571
2574
|
case 3:
|
|
2572
|
-
|
|
2575
|
+
g[b].fn.call(g[b].context, l, u);
|
|
2573
2576
|
break;
|
|
2574
2577
|
case 4:
|
|
2575
|
-
|
|
2578
|
+
g[b].fn.call(g[b].context, l, u, m);
|
|
2576
2579
|
break;
|
|
2577
2580
|
default:
|
|
2578
|
-
if (!
|
|
2579
|
-
|
|
2581
|
+
if (!x) for (I = 1, x = new Array(z - 1); I < z; I++) x[I - 1] = arguments[I];
|
|
2582
|
+
g[b].fn.apply(g[b].context, x);
|
|
2580
2583
|
}
|
|
2581
2584
|
}
|
|
2582
2585
|
return !0;
|
|
@@ -2584,15 +2587,15 @@ var gt, wt = {
|
|
|
2584
2587
|
return a(this, s, l, u, !1);
|
|
2585
2588
|
}, c.prototype.once = function(s, l, u) {
|
|
2586
2589
|
return a(this, s, l, u, !0);
|
|
2587
|
-
}, c.prototype.removeListener = function(s, l, u,
|
|
2590
|
+
}, c.prototype.removeListener = function(s, l, u, m) {
|
|
2588
2591
|
var f = i ? i + s : s;
|
|
2589
2592
|
if (!this._events[f]) return this;
|
|
2590
2593
|
if (!l) return o(this, f), this;
|
|
2591
|
-
var
|
|
2592
|
-
if (
|
|
2594
|
+
var p = this._events[f];
|
|
2595
|
+
if (p.fn) p.fn !== l || m && !p.once || u && p.context !== u || o(this, f);
|
|
2593
2596
|
else {
|
|
2594
|
-
for (var v = 0,
|
|
2595
|
-
|
|
2597
|
+
for (var v = 0, x = [], b = p.length; v < b; v++) (p[v].fn !== l || m && !p[v].once || u && p[v].context !== u) && x.push(p[v]);
|
|
2598
|
+
x.length ? this._events[f] = x.length === 1 ? x[0] : x : o(this, f);
|
|
2596
2599
|
}
|
|
2597
2600
|
return this;
|
|
2598
2601
|
}, c.prototype.removeAllListeners = function(s) {
|
|
@@ -2638,17 +2641,17 @@ class Et extends Je {
|
|
|
2638
2641
|
currentY: c
|
|
2639
2642
|
};
|
|
2640
2643
|
this.el.classList.add("sash-active", $e), this.emit("start", s), this.el.setPointerCapture(a.pointerId);
|
|
2641
|
-
const l = (
|
|
2642
|
-
|
|
2644
|
+
const l = (m) => {
|
|
2645
|
+
m.preventDefault();
|
|
2643
2646
|
const f = {
|
|
2644
2647
|
startX: o,
|
|
2645
|
-
currentX:
|
|
2648
|
+
currentX: m.pageX,
|
|
2646
2649
|
startY: c,
|
|
2647
|
-
currentY:
|
|
2650
|
+
currentY: m.pageY
|
|
2648
2651
|
};
|
|
2649
2652
|
this.emit("change", f);
|
|
2650
|
-
}, u = (
|
|
2651
|
-
|
|
2653
|
+
}, u = (m) => {
|
|
2654
|
+
m.preventDefault(), this.el.classList.remove("sash-active", $e), this.hoverDelayer.cancel(), this.emit("end"), this.el.releasePointerCapture(m.pointerId), window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
|
|
2652
2655
|
};
|
|
2653
2656
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
2654
2657
|
}, this.onPointerDoublePress = () => {
|
|
@@ -2767,8 +2770,8 @@ class Ln extends Je {
|
|
|
2767
2770
|
}, this.orientation = (o = i.orientation) != null ? o : G.Vertical, this.proportionalLayout = (c = i.proportionalLayout) != null ? c : !0, this.getSashOrthogonalSize = i.getSashOrthogonalSize, n && (this.onDidChange = n), r && (this.onDidDragStart = r), a && (this.onDidDragEnd = a), this.sashContainer = document.createElement("div"), this.sashContainer.classList.add("sash-container", wn), e.prepend(this.sashContainer), i.descriptor) {
|
|
2768
2771
|
this.size = i.descriptor.size;
|
|
2769
2772
|
for (const [s, l] of i.descriptor.views.entries()) {
|
|
2770
|
-
const u = l.size,
|
|
2771
|
-
this.addView(
|
|
2773
|
+
const u = l.size, m = l.container, f = l.view;
|
|
2774
|
+
this.addView(m, f, u, s, !0);
|
|
2772
2775
|
}
|
|
2773
2776
|
this.contentSize = this.viewItems.reduce((s, l) => s + l.size, 0), this.saveProportions();
|
|
2774
2777
|
}
|
|
@@ -2781,37 +2784,37 @@ class Ln extends Je {
|
|
|
2781
2784
|
const c = this.orientation === G.Vertical ? new Mn(e, i, o) : new Tn(e, i, o);
|
|
2782
2785
|
if (this.viewItems.splice(r, 0, c), this.viewItems.length > 1) {
|
|
2783
2786
|
const s = this.orientation === G.Vertical ? new Et(this.sashContainer, {
|
|
2784
|
-
getHorizontalSashTop: (
|
|
2787
|
+
getHorizontalSashTop: (m) => this.getSashPosition(m),
|
|
2785
2788
|
getHorizontalSashWidth: this.getSashOrthogonalSize
|
|
2786
2789
|
}, {
|
|
2787
2790
|
orientation: G.Horizontal
|
|
2788
2791
|
}) : new Et(this.sashContainer, {
|
|
2789
|
-
getVerticalSashLeft: (
|
|
2792
|
+
getVerticalSashLeft: (m) => this.getSashPosition(m),
|
|
2790
2793
|
getVerticalSashHeight: this.getSashOrthogonalSize
|
|
2791
2794
|
}, {
|
|
2792
2795
|
orientation: G.Vertical
|
|
2793
|
-
}), l = this.orientation === G.Vertical ? (
|
|
2796
|
+
}), l = this.orientation === G.Vertical ? (m) => ({
|
|
2794
2797
|
sash: s,
|
|
2795
|
-
start:
|
|
2796
|
-
current:
|
|
2797
|
-
}) : (
|
|
2798
|
+
start: m.startY,
|
|
2799
|
+
current: m.currentY
|
|
2800
|
+
}) : (m) => ({
|
|
2798
2801
|
sash: s,
|
|
2799
|
-
start:
|
|
2800
|
-
current:
|
|
2802
|
+
start: m.startX,
|
|
2803
|
+
current: m.currentX
|
|
2801
2804
|
});
|
|
2802
|
-
s.on("start", (
|
|
2805
|
+
s.on("start", (m) => {
|
|
2803
2806
|
var f;
|
|
2804
|
-
this.emit("sashDragStart"), this.onSashStart(l(
|
|
2805
|
-
const
|
|
2806
|
-
(f = this.onDidDragStart) == null || f.call(this,
|
|
2807
|
-
}), s.on("change", (
|
|
2808
|
-
var
|
|
2809
|
-
this.emit("sashDragEnd"), this.onSashEnd(this.sashItems.findIndex((
|
|
2810
|
-
const f = this.viewItems.map((
|
|
2811
|
-
(
|
|
2807
|
+
this.emit("sashDragStart"), this.onSashStart(l(m));
|
|
2808
|
+
const p = this.viewItems.map((v) => v.size);
|
|
2809
|
+
(f = this.onDidDragStart) == null || f.call(this, p);
|
|
2810
|
+
}), s.on("change", (m) => this.onSashChange(l(m))), s.on("end", () => {
|
|
2811
|
+
var m;
|
|
2812
|
+
this.emit("sashDragEnd"), this.onSashEnd(this.sashItems.findIndex((p) => p.sash === s));
|
|
2813
|
+
const f = this.viewItems.map((p) => p.size);
|
|
2814
|
+
(m = this.onDidDragEnd) == null || m.call(this, f);
|
|
2812
2815
|
}), s.on("reset", () => {
|
|
2813
|
-
const
|
|
2814
|
-
(typeof v != "number" || this.viewItems[v].visible) && (typeof
|
|
2816
|
+
const m = this.sashItems.findIndex((b) => b.sash === s), f = q(m, -1, -1), p = q(m + 1, this.viewItems.length), v = this.findFirstSnapIndex(f), x = this.findFirstSnapIndex(p);
|
|
2817
|
+
(typeof v != "number" || this.viewItems[v].visible) && (typeof x != "number" || this.viewItems[x].visible) && this.emit("sashreset", m);
|
|
2815
2818
|
});
|
|
2816
2819
|
const u = {
|
|
2817
2820
|
sash: s
|
|
@@ -2895,25 +2898,25 @@ class Ln extends Je {
|
|
|
2895
2898
|
}) {
|
|
2896
2899
|
const n = this.sashItems.findIndex((r) => r.sash === e);
|
|
2897
2900
|
((r) => {
|
|
2898
|
-
const a = this.viewItems.map((
|
|
2901
|
+
const a = this.viewItems.map((z) => z.size);
|
|
2899
2902
|
let o, c, s = Number.NEGATIVE_INFINITY, l = Number.POSITIVE_INFINITY;
|
|
2900
|
-
const u = q(n, -1, -1),
|
|
2901
|
-
s = Math.max(f,
|
|
2902
|
-
const
|
|
2903
|
-
if (typeof
|
|
2904
|
-
const
|
|
2903
|
+
const u = q(n, -1, -1), m = q(n + 1, this.viewItems.length), f = u.reduce((z, I) => z + (this.viewItems[I].minimumSize - a[I]), 0), p = u.reduce((z, I) => z + (this.viewItems[I].viewMaximumSize - a[I]), 0), v = m.length === 0 ? Number.POSITIVE_INFINITY : m.reduce((z, I) => z + (a[I] - this.viewItems[I].minimumSize), 0), x = m.length === 0 ? Number.NEGATIVE_INFINITY : m.reduce((z, I) => z + (a[I] - this.viewItems[I].viewMaximumSize), 0);
|
|
2904
|
+
s = Math.max(f, x), l = Math.min(v, p);
|
|
2905
|
+
const b = this.findFirstSnapIndex(u), g = this.findFirstSnapIndex(m);
|
|
2906
|
+
if (typeof b == "number") {
|
|
2907
|
+
const z = this.viewItems[b], I = Math.floor(z.viewMinimumSize / 2);
|
|
2905
2908
|
o = {
|
|
2906
|
-
index:
|
|
2907
|
-
limitDelta:
|
|
2908
|
-
size:
|
|
2909
|
+
index: b,
|
|
2910
|
+
limitDelta: z.visible ? s - I : s + I,
|
|
2911
|
+
size: z.size
|
|
2909
2912
|
};
|
|
2910
2913
|
}
|
|
2911
|
-
if (typeof
|
|
2912
|
-
const
|
|
2914
|
+
if (typeof g == "number") {
|
|
2915
|
+
const z = this.viewItems[g], I = Math.floor(z.viewMinimumSize / 2);
|
|
2913
2916
|
c = {
|
|
2914
|
-
index:
|
|
2915
|
-
limitDelta:
|
|
2916
|
-
size:
|
|
2917
|
+
index: g,
|
|
2918
|
+
limitDelta: z.visible ? l + I : l - I,
|
|
2919
|
+
size: z.size
|
|
2917
2920
|
};
|
|
2918
2921
|
}
|
|
2919
2922
|
this.sashDragState = {
|
|
@@ -2951,27 +2954,27 @@ class Ln extends Je {
|
|
|
2951
2954
|
}
|
|
2952
2955
|
resize(e, i, n = this.viewItems.map((u) => u.size), r, a, o = Number.NEGATIVE_INFINITY, c = Number.POSITIVE_INFINITY, s, l) {
|
|
2953
2956
|
if (e < 0 || e >= this.viewItems.length) return 0;
|
|
2954
|
-
const u = q(e, -1, -1),
|
|
2955
|
-
if (a) for (const
|
|
2956
|
-
if (r) for (const
|
|
2957
|
-
const f = u.map((
|
|
2958
|
-
let
|
|
2957
|
+
const u = q(e, -1, -1), m = q(e + 1, this.viewItems.length);
|
|
2958
|
+
if (a) for (const d of a) bt(u, d), bt(m, d);
|
|
2959
|
+
if (r) for (const d of r) De(u, d), De(m, d);
|
|
2960
|
+
const f = u.map((d) => this.viewItems[d]), p = u.map((d) => n[d]), v = m.map((d) => this.viewItems[d]), x = m.map((d) => n[d]), b = u.reduce((d, S) => d + (this.viewItems[S].minimumSize - n[S]), 0), g = u.reduce((d, S) => d + (this.viewItems[S].maximumSize - n[S]), 0), z = m.length === 0 ? Number.POSITIVE_INFINITY : m.reduce((d, S) => d + (n[S] - this.viewItems[S].minimumSize), 0), I = m.length === 0 ? Number.NEGATIVE_INFINITY : m.reduce((d, S) => d + (n[S] - this.viewItems[S].maximumSize), 0), y = Math.max(b, I, o), L = Math.min(z, g, c);
|
|
2961
|
+
let k = !1;
|
|
2959
2962
|
if (s) {
|
|
2960
|
-
const
|
|
2961
|
-
|
|
2963
|
+
const d = this.viewItems[s.index], S = i >= s.limitDelta;
|
|
2964
|
+
k = S !== d.visible, d.setVisible(S, s.size);
|
|
2962
2965
|
}
|
|
2963
|
-
if (!
|
|
2964
|
-
const
|
|
2965
|
-
|
|
2966
|
+
if (!k && l) {
|
|
2967
|
+
const d = this.viewItems[l.index], S = i < l.limitDelta;
|
|
2968
|
+
k = S !== d.visible, d.setVisible(S, l.size);
|
|
2966
2969
|
}
|
|
2967
|
-
if (
|
|
2968
|
-
for (let
|
|
2969
|
-
const
|
|
2970
|
-
|
|
2970
|
+
if (k) return this.resize(e, i, n, r, a, o, c);
|
|
2971
|
+
for (let d = 0, S = i = ie(i, y, L); d < f.length; d++) {
|
|
2972
|
+
const T = f[d], R = ie(p[d] + S, T.minimumSize, T.maximumSize);
|
|
2973
|
+
S -= R - p[d], T.size = R;
|
|
2971
2974
|
}
|
|
2972
|
-
for (let
|
|
2973
|
-
const
|
|
2974
|
-
|
|
2975
|
+
for (let d = 0, S = i; d < v.length; d++) {
|
|
2976
|
+
const T = v[d], R = ie(x[d] - S, T.minimumSize, T.maximumSize);
|
|
2977
|
+
S += R - x[d], T.size = R;
|
|
2975
2978
|
}
|
|
2976
2979
|
return i;
|
|
2977
2980
|
}
|
|
@@ -2981,8 +2984,8 @@ class Ln extends Je {
|
|
|
2981
2984
|
const r = q(0, this.viewItems.length), a = [], o = r.filter((l) => this.viewItems[l].priority === Q.Low), c = r.filter((l) => this.viewItems[l].priority === Q.Normal), s = r.filter((l) => this.viewItems[l].priority === Q.High);
|
|
2982
2985
|
a.push(...s, ...c, ...o), typeof e == "number" && De(a, e);
|
|
2983
2986
|
for (let l = 0; n !== 0 && l < a.length; l++) {
|
|
2984
|
-
const u = this.viewItems[a[l]],
|
|
2985
|
-
n -=
|
|
2987
|
+
const u = this.viewItems[a[l]], m = ie(u.size + n, u.minimumSize, u.maximumSize);
|
|
2988
|
+
n -= m - u.size, u.size = m;
|
|
2986
2989
|
}
|
|
2987
2990
|
}
|
|
2988
2991
|
layoutViews() {
|
|
@@ -3010,11 +3013,11 @@ class Ln extends Je {
|
|
|
3010
3013
|
sash: l
|
|
3011
3014
|
} = this.sashItems[s];
|
|
3012
3015
|
c += this.viewItems[s].size;
|
|
3013
|
-
const u = !(i[s] && o[s + 1]),
|
|
3014
|
-
if (u &&
|
|
3015
|
-
const f = q(s, -1, -1),
|
|
3016
|
-
|
|
3017
|
-
} else l.state = u && !
|
|
3016
|
+
const u = !(i[s] && o[s + 1]), m = !(n[s] && a[s + 1]);
|
|
3017
|
+
if (u && m) {
|
|
3018
|
+
const f = q(s, -1, -1), p = q(s + 1, this.viewItems.length), v = this.findFirstSnapIndex(f), x = this.findFirstSnapIndex(p), b = typeof v == "number" && !this.viewItems[v].visible, g = typeof x == "number" && !this.viewItems[x].visible;
|
|
3019
|
+
b && a[s] && (c > 0 || this.startSnappingEnabled) ? l.state = X.Minimum : g && i[s] && (c < this.contentSize || this.endSnappingEnabled) ? l.state = X.Maximum : l.state = X.Disabled;
|
|
3020
|
+
} else l.state = u && !m ? X.Minimum : !u && m ? X.Maximum : X.Enabled;
|
|
3018
3021
|
}
|
|
3019
3022
|
}
|
|
3020
3023
|
findFirstSnapIndex(e) {
|
|
@@ -3113,33 +3116,33 @@ const ti = window.React.forwardRef(({
|
|
|
3113
3116
|
defaultSizes: s = c,
|
|
3114
3117
|
snap: l = !1,
|
|
3115
3118
|
vertical: u = !1,
|
|
3116
|
-
onChange:
|
|
3119
|
+
onChange: m,
|
|
3117
3120
|
onReset: f,
|
|
3118
|
-
onVisibleChange:
|
|
3121
|
+
onVisibleChange: p,
|
|
3119
3122
|
onDragStart: v,
|
|
3120
|
-
onDragEnd:
|
|
3121
|
-
},
|
|
3122
|
-
const
|
|
3123
|
+
onDragEnd: x
|
|
3124
|
+
}, b) => {
|
|
3125
|
+
const g = window.React.useRef(null), z = window.React.useRef([]), I = window.React.useRef(/* @__PURE__ */ new Map()), y = window.React.useRef(null), L = window.React.useRef(/* @__PURE__ */ new Map()), k = window.React.useRef(new Rn()), d = window.React.useRef([]), [S, T] = window.React.useState(!1), R = window.React.useMemo(() => window.React.Children.toArray(t).filter(window.React.isValidElement), [t]), O = window.React.useCallback((M) => {
|
|
3123
3126
|
var _, D;
|
|
3124
|
-
const V = (_ =
|
|
3125
|
-
return typeof (V == null ? void 0 : V.preferredSize) == "number" && ((D =
|
|
3127
|
+
const V = (_ = d.current) == null ? void 0 : _[M];
|
|
3128
|
+
return typeof (V == null ? void 0 : V.preferredSize) == "number" && ((D = y.current) != null && D.resizeView(M, Math.round(V.preferredSize)), !0);
|
|
3126
3129
|
}, []);
|
|
3127
|
-
return window.React.useImperativeHandle(
|
|
3130
|
+
return window.React.useImperativeHandle(b, () => ({
|
|
3128
3131
|
reset: () => {
|
|
3129
3132
|
if (f) f();
|
|
3130
3133
|
else {
|
|
3131
3134
|
var M;
|
|
3132
|
-
(M =
|
|
3133
|
-
for (let _ = 0; _ <
|
|
3135
|
+
(M = y.current) == null || M.distributeViewSizes();
|
|
3136
|
+
for (let _ = 0; _ < d.current.length; _++) O(_);
|
|
3134
3137
|
}
|
|
3135
3138
|
},
|
|
3136
3139
|
resize: (M) => {
|
|
3137
3140
|
var _;
|
|
3138
|
-
(_ =
|
|
3141
|
+
(_ = y.current) == null || _.resizeViews(M);
|
|
3139
3142
|
}
|
|
3140
3143
|
})), vt(() => {
|
|
3141
3144
|
let M = !0;
|
|
3142
|
-
s && L.current.size !== s.length && (M = !1, console.warn(`Expected ${s.length} children based on defaultSizes but found ${L.current.size}`)), M && s && (
|
|
3145
|
+
s && L.current.size !== s.length && (M = !1, console.warn(`Expected ${s.length} children based on defaultSizes but found ${L.current.size}`)), M && s && (z.current = R.map((V) => V.key));
|
|
3143
3146
|
const _ = pe({
|
|
3144
3147
|
orientation: u ? G.Vertical : G.Horizontal,
|
|
3145
3148
|
proportionalLayout: a
|
|
@@ -3147,18 +3150,18 @@ const ti = window.React.forwardRef(({
|
|
|
3147
3150
|
descriptor: {
|
|
3148
3151
|
size: s.reduce((V, P) => V + P, 0),
|
|
3149
3152
|
views: s.map((V, P) => {
|
|
3150
|
-
var $,
|
|
3151
|
-
const F =
|
|
3153
|
+
var $, H, K, ne;
|
|
3154
|
+
const F = I.current.get(z.current[P]), re = new Rt(k.current, pe({
|
|
3152
3155
|
element: document.createElement("div"),
|
|
3153
3156
|
minimumSize: ($ = F == null ? void 0 : F.minSize) != null ? $ : r,
|
|
3154
|
-
maximumSize: (
|
|
3157
|
+
maximumSize: (H = F == null ? void 0 : F.maxSize) != null ? H : n,
|
|
3155
3158
|
priority: (K = F == null ? void 0 : F.priority) != null ? K : Q.Normal
|
|
3156
3159
|
}, (F == null ? void 0 : F.preferredSize) && {
|
|
3157
3160
|
preferredSize: F == null ? void 0 : F.preferredSize
|
|
3158
3161
|
}, {
|
|
3159
3162
|
snap: (ne = F == null ? void 0 : F.snap) != null ? ne : l
|
|
3160
3163
|
}));
|
|
3161
|
-
return
|
|
3164
|
+
return d.current.push(re), {
|
|
3162
3165
|
container: [...L.current.values()][P],
|
|
3163
3166
|
size: V,
|
|
3164
3167
|
view: re
|
|
@@ -3166,103 +3169,103 @@ const ti = window.React.forwardRef(({
|
|
|
3166
3169
|
})
|
|
3167
3170
|
}
|
|
3168
3171
|
});
|
|
3169
|
-
|
|
3172
|
+
y.current = new Ln(g.current, _, m, v, x), y.current.on("sashDragStart", () => {
|
|
3170
3173
|
var V;
|
|
3171
|
-
(V =
|
|
3172
|
-
}),
|
|
3174
|
+
(V = g.current) == null || V.classList.add("split-view-sash-dragging");
|
|
3175
|
+
}), y.current.on("sashDragEnd", () => {
|
|
3173
3176
|
var V;
|
|
3174
|
-
(V =
|
|
3175
|
-
}),
|
|
3176
|
-
if (
|
|
3177
|
-
const P =
|
|
3177
|
+
(V = g.current) == null || V.classList.remove("split-view-sash-dragging");
|
|
3178
|
+
}), y.current.on("sashchange", (V) => {
|
|
3179
|
+
if (p && y.current) {
|
|
3180
|
+
const P = R.map(($) => $.key);
|
|
3178
3181
|
for (let $ = 0; $ < P.length; $++) {
|
|
3179
|
-
const
|
|
3180
|
-
(
|
|
3182
|
+
const H = I.current.get(P[$]);
|
|
3183
|
+
(H == null ? void 0 : H.visible) !== void 0 && H.visible !== y.current.isViewVisible($) && p($, y.current.isViewVisible($));
|
|
3181
3184
|
}
|
|
3182
3185
|
}
|
|
3183
|
-
}),
|
|
3186
|
+
}), y.current.on("sashreset", (V) => {
|
|
3184
3187
|
if (f) f();
|
|
3185
3188
|
else {
|
|
3186
3189
|
var P;
|
|
3187
|
-
if (
|
|
3188
|
-
(P =
|
|
3190
|
+
if (O(V) || O(V + 1)) return;
|
|
3191
|
+
(P = y.current) == null || P.distributeViewSizes();
|
|
3189
3192
|
}
|
|
3190
3193
|
});
|
|
3191
|
-
const D =
|
|
3194
|
+
const D = y.current;
|
|
3192
3195
|
return () => {
|
|
3193
3196
|
D.dispose();
|
|
3194
3197
|
};
|
|
3195
3198
|
}, []), vt(() => {
|
|
3196
|
-
if (
|
|
3197
|
-
const W =
|
|
3198
|
-
for (let
|
|
3199
|
+
if (S) {
|
|
3200
|
+
const W = R.map((N) => N.key), J = [...z.current], ae = W.filter((N) => !z.current.includes(N)), le = W.filter((N) => z.current.includes(N)), E = z.current.map((N) => !W.includes(N));
|
|
3201
|
+
for (let N = E.length - 1; N >= 0; N--) {
|
|
3199
3202
|
var M;
|
|
3200
|
-
|
|
3203
|
+
E[N] && ((M = y.current) != null && M.removeView(N), J.splice(N, 1), d.current.splice(N, 1));
|
|
3201
3204
|
}
|
|
3202
|
-
for (const
|
|
3205
|
+
for (const N of ae) {
|
|
3203
3206
|
var _, D, V, P, $;
|
|
3204
|
-
const
|
|
3207
|
+
const h = I.current.get(N), w = new Rt(k.current, pe({
|
|
3205
3208
|
element: document.createElement("div"),
|
|
3206
|
-
minimumSize: (_ =
|
|
3207
|
-
maximumSize: (D =
|
|
3208
|
-
priority: (V =
|
|
3209
|
-
}, (
|
|
3210
|
-
preferredSize:
|
|
3209
|
+
minimumSize: (_ = h == null ? void 0 : h.minSize) != null ? _ : r,
|
|
3210
|
+
maximumSize: (D = h == null ? void 0 : h.maxSize) != null ? D : n,
|
|
3211
|
+
priority: (V = h == null ? void 0 : h.priority) != null ? V : Q.Normal
|
|
3212
|
+
}, (h == null ? void 0 : h.preferredSize) && {
|
|
3213
|
+
preferredSize: h == null ? void 0 : h.preferredSize
|
|
3211
3214
|
}, {
|
|
3212
|
-
snap: (P =
|
|
3215
|
+
snap: (P = h == null ? void 0 : h.snap) != null ? P : l
|
|
3213
3216
|
}));
|
|
3214
|
-
($ =
|
|
3217
|
+
($ = y.current) != null && $.addView(L.current.get(N), w, Ie.Distribute, W.findIndex((C) => C === N)), J.splice(W.findIndex((C) => C === N), 0, N), d.current.splice(W.findIndex((C) => C === N), 0, w);
|
|
3215
3218
|
}
|
|
3216
|
-
for (; !hn(W, J); ) for (const [
|
|
3217
|
-
const
|
|
3218
|
-
if (
|
|
3219
|
-
var
|
|
3220
|
-
(
|
|
3221
|
-
const
|
|
3222
|
-
J.splice(
|
|
3219
|
+
for (; !hn(W, J); ) for (const [N, h] of W.entries()) {
|
|
3220
|
+
const w = J.findIndex((C) => C === h);
|
|
3221
|
+
if (w !== N) {
|
|
3222
|
+
var H;
|
|
3223
|
+
(H = y.current) == null || H.moveView(L.current.get(h), w, N);
|
|
3224
|
+
const C = J[w];
|
|
3225
|
+
J.splice(w, 1), J.splice(N, 0, C);
|
|
3223
3226
|
break;
|
|
3224
3227
|
}
|
|
3225
3228
|
}
|
|
3226
|
-
for (const
|
|
3229
|
+
for (const N of ae) {
|
|
3227
3230
|
var K;
|
|
3228
|
-
const
|
|
3229
|
-
|
|
3231
|
+
const h = W.findIndex((C) => C === N), w = d.current[h].preferredSize;
|
|
3232
|
+
w !== void 0 && ((K = y.current) == null || K.resizeView(h, w));
|
|
3230
3233
|
}
|
|
3231
|
-
for (const
|
|
3234
|
+
for (const N of [...ae, ...le]) {
|
|
3232
3235
|
var ne, F;
|
|
3233
|
-
const
|
|
3234
|
-
|
|
3236
|
+
const h = I.current.get(N), w = W.findIndex((C) => C === N);
|
|
3237
|
+
h && zt(h) && h.visible !== void 0 && ((ne = y.current) == null ? void 0 : ne.isViewVisible(w)) !== h.visible && ((F = y.current) == null || F.setViewVisible(w, h.visible));
|
|
3235
3238
|
}
|
|
3236
|
-
for (const
|
|
3237
|
-
const
|
|
3238
|
-
if (
|
|
3239
|
+
for (const N of le) {
|
|
3240
|
+
const h = I.current.get(N), w = W.findIndex((C) => C === N);
|
|
3241
|
+
if (h && zt(h)) {
|
|
3239
3242
|
var re;
|
|
3240
|
-
|
|
3241
|
-
let
|
|
3242
|
-
|
|
3243
|
+
h.preferredSize !== void 0 && d.current[w].preferredSize !== h.preferredSize && (d.current[w].preferredSize = h.preferredSize);
|
|
3244
|
+
let C = !1;
|
|
3245
|
+
h.minSize !== void 0 && d.current[w].minimumSize !== h.minSize && (d.current[w].minimumSize = h.minSize, C = !0), h.maxSize !== void 0 && d.current[w].maximumSize !== h.maxSize && (d.current[w].maximumSize = h.maxSize, C = !0), C && ((re = y.current) == null || re.layout());
|
|
3243
3246
|
}
|
|
3244
3247
|
}
|
|
3245
|
-
(ae.length > 0 ||
|
|
3248
|
+
(ae.length > 0 || E.length > 0) && (z.current = W);
|
|
3246
3249
|
}
|
|
3247
|
-
}, [
|
|
3248
|
-
|
|
3249
|
-
}, [
|
|
3250
|
-
|
|
3250
|
+
}, [R, S, n, r, l]), window.React.useEffect(() => {
|
|
3251
|
+
y.current && (y.current.onDidChange = m);
|
|
3252
|
+
}, [m]), window.React.useEffect(() => {
|
|
3253
|
+
y.current && (y.current.onDidDragStart = v);
|
|
3251
3254
|
}, [v]), window.React.useEffect(() => {
|
|
3252
|
-
|
|
3253
|
-
}, [
|
|
3254
|
-
ref:
|
|
3255
|
+
y.current && (y.current.onDidDragEnd = x);
|
|
3256
|
+
}, [x]), vn({
|
|
3257
|
+
ref: g,
|
|
3255
3258
|
onResize: ({
|
|
3256
3259
|
width: M,
|
|
3257
3260
|
height: _
|
|
3258
3261
|
}) => {
|
|
3259
3262
|
var D;
|
|
3260
|
-
M && _ && ((D =
|
|
3263
|
+
M && _ && ((D = y.current) != null && D.layout(u ? _ : M), k.current.setSize(u ? _ : M), T(!0));
|
|
3261
3264
|
}
|
|
3262
3265
|
}), window.React.useEffect(() => {
|
|
3263
3266
|
qt && Vn(20);
|
|
3264
3267
|
}, []), window.React.createElement("div", {
|
|
3265
|
-
ref:
|
|
3268
|
+
ref: g,
|
|
3266
3269
|
className: We("split-view", u ? "split-view-vertical" : "split-view-horizontal", {
|
|
3267
3270
|
"split-view-separator-border": o
|
|
3268
3271
|
}, gn, u ? yn : xn, {
|
|
@@ -3274,7 +3277,7 @@ const ti = window.React.forwardRef(({
|
|
|
3274
3277
|
}, window.React.Children.toArray(t).map((M) => {
|
|
3275
3278
|
if (!window.React.isValidElement(M)) return null;
|
|
3276
3279
|
const _ = M.key;
|
|
3277
|
-
return M.type.displayName === "Allotment.Pane" ? (
|
|
3280
|
+
return M.type.displayName === "Allotment.Pane" ? (I.current.set(_, M.props), window.React.cloneElement(M, {
|
|
3278
3281
|
key: _,
|
|
3279
3282
|
ref: (D) => {
|
|
3280
3283
|
const V = M.ref;
|
|
@@ -3401,10 +3404,10 @@ const kr = ({
|
|
|
3401
3404
|
}) => {
|
|
3402
3405
|
const o = U(null), c = !!e, s = U(!1), l = U(null), u = U(!0);
|
|
3403
3406
|
if (u.current && i) {
|
|
3404
|
-
const
|
|
3405
|
-
if (
|
|
3407
|
+
const p = localStorage.getItem(`splitPaneSizes-${i}`);
|
|
3408
|
+
if (p)
|
|
3406
3409
|
try {
|
|
3407
|
-
l.current = JSON.parse(
|
|
3410
|
+
l.current = JSON.parse(p);
|
|
3408
3411
|
} catch {
|
|
3409
3412
|
l.current = [70, 30];
|
|
3410
3413
|
}
|
|
@@ -3414,14 +3417,14 @@ const kr = ({
|
|
|
3414
3417
|
}
|
|
3415
3418
|
gi(() => {
|
|
3416
3419
|
c && !s.current && o.current && l.current && requestAnimationFrame(() => {
|
|
3417
|
-
var
|
|
3418
|
-
(
|
|
3420
|
+
var p;
|
|
3421
|
+
(p = o.current) != null && p.resize && o.current.resize(l.current);
|
|
3419
3422
|
}), s.current = c;
|
|
3420
3423
|
}, [c]);
|
|
3421
|
-
const
|
|
3422
|
-
i && c &&
|
|
3424
|
+
const m = (p) => {
|
|
3425
|
+
i && c && p[1] > 10 && (l.current = p, localStorage.setItem(
|
|
3423
3426
|
`splitPaneSizes-${i}`,
|
|
3424
|
-
JSON.stringify(
|
|
3427
|
+
JSON.stringify(p)
|
|
3425
3428
|
));
|
|
3426
3429
|
};
|
|
3427
3430
|
let f;
|
|
@@ -3430,7 +3433,7 @@ const kr = ({
|
|
|
3430
3433
|
{
|
|
3431
3434
|
ref: o,
|
|
3432
3435
|
className: n,
|
|
3433
|
-
onChange:
|
|
3436
|
+
onChange: m,
|
|
3434
3437
|
defaultSizes: f,
|
|
3435
3438
|
proportionalLayout: !0
|
|
3436
3439
|
},
|
|
@@ -3446,8 +3449,8 @@ const kr = ({
|
|
|
3446
3449
|
}) => {
|
|
3447
3450
|
const a = i !== void 0, [o, c] = A(e || ""), u = {
|
|
3448
3451
|
activeTab: a ? i : o,
|
|
3449
|
-
setActiveTab: (
|
|
3450
|
-
a || c(
|
|
3452
|
+
setActiveTab: (m) => {
|
|
3453
|
+
a || c(m), n && n(m);
|
|
3451
3454
|
},
|
|
3452
3455
|
initialTabName: a ? i : e
|
|
3453
3456
|
};
|
|
@@ -3499,151 +3502,151 @@ const kr = ({
|
|
|
3499
3502
|
colorTokenClasses: s,
|
|
3500
3503
|
suggestions: l = [],
|
|
3501
3504
|
onLoadMore: u,
|
|
3502
|
-
css:
|
|
3505
|
+
css: m,
|
|
3503
3506
|
hasMore: f = !1,
|
|
3504
|
-
isLoading:
|
|
3507
|
+
isLoading: p = !1,
|
|
3505
3508
|
allowCustom: v = !0,
|
|
3506
|
-
dedupe:
|
|
3507
|
-
...
|
|
3509
|
+
dedupe: x = !0,
|
|
3510
|
+
...b
|
|
3508
3511
|
}) => {
|
|
3509
|
-
const
|
|
3510
|
-
|
|
3511
|
-
},
|
|
3512
|
-
var
|
|
3513
|
-
const
|
|
3514
|
-
if (!
|
|
3515
|
-
const
|
|
3516
|
-
o == null || o(
|
|
3517
|
-
}, K = (
|
|
3518
|
-
const
|
|
3519
|
-
o == null || o(
|
|
3520
|
-
}, ne = (
|
|
3521
|
-
|
|
3512
|
+
const g = U(null), z = U(null), I = U(null), y = U(!1), [L, k] = A(""), [d, S] = A(!1), [T, R] = A(-1), [O, M] = A(!1), [_, D] = A(null), [V, P] = A(""), $ = () => {
|
|
3513
|
+
S(!1), R(-1);
|
|
3514
|
+
}, H = (E) => {
|
|
3515
|
+
var w;
|
|
3516
|
+
const N = Vt(E);
|
|
3517
|
+
if (!N.length) return;
|
|
3518
|
+
const h = x ? Oe([...i, ...N]) : [...i, ...N];
|
|
3519
|
+
o == null || o(h), k(""), c == null || c(""), $(), (w = g.current) == null || w.focus();
|
|
3520
|
+
}, K = (E) => {
|
|
3521
|
+
const N = i.filter((h, w) => w !== E);
|
|
3522
|
+
o == null || o(N), _ === E ? (D(null), P("")) : _ !== null && E < _ && D(_ - 1);
|
|
3523
|
+
}, ne = (E) => {
|
|
3524
|
+
y.current = !0, D(E), P(i[E] ?? ""), $();
|
|
3522
3525
|
}, F = () => {
|
|
3523
3526
|
var Z;
|
|
3524
3527
|
if (_ === null) return;
|
|
3525
|
-
const
|
|
3526
|
-
if (!
|
|
3528
|
+
const E = V.trim();
|
|
3529
|
+
if (!E) {
|
|
3527
3530
|
K(_);
|
|
3528
3531
|
return;
|
|
3529
3532
|
}
|
|
3530
|
-
const
|
|
3531
|
-
let
|
|
3532
|
-
|
|
3533
|
+
const N = Vt(E), h = i.slice(0, _), w = i.slice(_ + 1);
|
|
3534
|
+
let C = [...h, ...N, ...w];
|
|
3535
|
+
x && (C = Oe(C)), o == null || o(C), D(null), P(""), y.current = !1, (Z = g.current) == null || Z.focus();
|
|
3533
3536
|
}, re = () => {
|
|
3534
|
-
var
|
|
3535
|
-
D(null), P(""),
|
|
3536
|
-
}, W = (
|
|
3537
|
+
var E;
|
|
3538
|
+
D(null), P(""), y.current = !1, (E = g.current) == null || E.focus();
|
|
3539
|
+
}, W = (E) => {
|
|
3537
3540
|
M(!0);
|
|
3538
|
-
const
|
|
3539
|
-
o == null || o(
|
|
3540
|
-
var
|
|
3541
|
-
M(!1), (
|
|
3541
|
+
const N = x ? Oe([...i, E]) : [...i, E];
|
|
3542
|
+
o == null || o(N), k(""), c == null || c(""), $(), setTimeout(() => {
|
|
3543
|
+
var h;
|
|
3544
|
+
M(!1), (h = g.current) == null || h.focus();
|
|
3542
3545
|
}, 0);
|
|
3543
|
-
}, J = (
|
|
3544
|
-
|
|
3545
|
-
}, ae = (
|
|
3546
|
-
if (
|
|
3547
|
-
if (
|
|
3548
|
-
|
|
3549
|
-
(
|
|
3546
|
+
}, J = (E) => {
|
|
3547
|
+
k(E), c == null || c(E), R(-1), E.length > 0 && l.length > 0 ? S(!0) : $();
|
|
3548
|
+
}, ae = (E) => {
|
|
3549
|
+
if (d) {
|
|
3550
|
+
if (E.key === "ArrowDown") {
|
|
3551
|
+
E.preventDefault(), R(
|
|
3552
|
+
(h) => Math.min(h + 1, l.length - 1)
|
|
3550
3553
|
);
|
|
3551
3554
|
return;
|
|
3552
3555
|
}
|
|
3553
|
-
if (
|
|
3554
|
-
|
|
3556
|
+
if (E.key === "ArrowUp") {
|
|
3557
|
+
E.preventDefault(), R((h) => Math.max(h - 1, 0));
|
|
3555
3558
|
return;
|
|
3556
3559
|
}
|
|
3557
|
-
if (
|
|
3558
|
-
|
|
3560
|
+
if (E.key === "Escape") {
|
|
3561
|
+
E.preventDefault(), $();
|
|
3559
3562
|
return;
|
|
3560
3563
|
}
|
|
3561
|
-
if (
|
|
3562
|
-
|
|
3564
|
+
if (E.key === "Enter" && T >= 0 && l[T]) {
|
|
3565
|
+
E.preventDefault(), W(l[T]);
|
|
3563
3566
|
return;
|
|
3564
3567
|
}
|
|
3565
3568
|
}
|
|
3566
|
-
if (
|
|
3567
|
-
if (!v && !(
|
|
3568
|
-
|
|
3569
|
+
if (E.key === "Enter" || E.key === "," || E.key === "Tab") {
|
|
3570
|
+
if (!v && !(T >= 0 && l[T])) {
|
|
3571
|
+
E.key === "Enter" && T >= 0 && l[T] && (E.preventDefault(), W(l[T]));
|
|
3569
3572
|
return;
|
|
3570
3573
|
}
|
|
3571
|
-
L.trim().length > 0 ? (
|
|
3574
|
+
L.trim().length > 0 ? (E.preventDefault(), H(L)) : E.key === "Enter" && (E.preventDefault(), $());
|
|
3572
3575
|
return;
|
|
3573
3576
|
}
|
|
3574
|
-
if (
|
|
3577
|
+
if (E.key === "Backspace" && L.length === 0 && i.length > 0) {
|
|
3575
3578
|
K(i.length - 1);
|
|
3576
3579
|
return;
|
|
3577
3580
|
}
|
|
3578
|
-
|
|
3581
|
+
E.key === " " && L.trim().length > 0 && (E.preventDefault(), H(L));
|
|
3579
3582
|
}, le = () => {
|
|
3580
|
-
if (!
|
|
3583
|
+
if (!O) {
|
|
3581
3584
|
if (v && L.trim().length > 0) {
|
|
3582
|
-
|
|
3585
|
+
H(L);
|
|
3583
3586
|
return;
|
|
3584
3587
|
}
|
|
3585
3588
|
$();
|
|
3586
3589
|
}
|
|
3587
3590
|
};
|
|
3588
3591
|
return j(() => {
|
|
3589
|
-
const
|
|
3590
|
-
if (!
|
|
3591
|
-
const
|
|
3592
|
-
const { scrollTop:
|
|
3593
|
-
|
|
3592
|
+
const E = I.current;
|
|
3593
|
+
if (!E || !u || !f || p) return;
|
|
3594
|
+
const N = () => {
|
|
3595
|
+
const { scrollTop: h, scrollHeight: w, clientHeight: C } = E;
|
|
3596
|
+
w - h - C < 50 && u();
|
|
3594
3597
|
};
|
|
3595
|
-
return
|
|
3596
|
-
}, [u, f,
|
|
3598
|
+
return E.addEventListener("scroll", N), () => E.removeEventListener("scroll", N);
|
|
3599
|
+
}, [u, f, p]), j(() => {
|
|
3597
3600
|
if (_ !== null) {
|
|
3598
|
-
const
|
|
3599
|
-
if (!
|
|
3600
|
-
|
|
3601
|
-
const
|
|
3602
|
-
|
|
3601
|
+
const E = z.current;
|
|
3602
|
+
if (!E) return;
|
|
3603
|
+
E.focus();
|
|
3604
|
+
const N = E.value.length;
|
|
3605
|
+
E.setSelectionRange(N, N);
|
|
3603
3606
|
}
|
|
3604
3607
|
}, [_]), j(() => {
|
|
3605
|
-
l.length === 0 &&
|
|
3606
|
-
}, [l.length]), /* @__PURE__ */ React.createElement("div", { className: B("flex flex-col gap-2", t), ...
|
|
3607
|
-
const
|
|
3608
|
+
l.length === 0 && S(!1);
|
|
3609
|
+
}, [l.length]), /* @__PURE__ */ React.createElement("div", { className: B("flex flex-col gap-2", t), ...b }, m && /* @__PURE__ */ React.createElement("style", null, m), n && /* @__PURE__ */ React.createElement("div", { className: "text-xs font-medium flex gap-1 items-center" }, /* @__PURE__ */ React.createElement(Ft, null), " ", n), /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap gap-2 flex-start" }, i.map((E, N) => {
|
|
3610
|
+
const h = _ === N, w = s == null ? void 0 : s[E];
|
|
3608
3611
|
return /* @__PURE__ */ React.createElement(
|
|
3609
3612
|
"div",
|
|
3610
3613
|
{
|
|
3611
|
-
key: `${
|
|
3614
|
+
key: `${E}-${N}`,
|
|
3612
3615
|
className: B(
|
|
3613
3616
|
"bg-border/50 gap-1 p-1 text-xs hover:bg-border-75 ",
|
|
3614
|
-
{ "bg-white border-border/50 border":
|
|
3617
|
+
{ "bg-white border-border/50 border": h }
|
|
3615
3618
|
),
|
|
3616
3619
|
title: "Click to edit"
|
|
3617
3620
|
},
|
|
3618
|
-
|
|
3621
|
+
h ? /* @__PURE__ */ React.createElement(
|
|
3619
3622
|
"input",
|
|
3620
3623
|
{
|
|
3621
|
-
ref:
|
|
3624
|
+
ref: z,
|
|
3622
3625
|
className: "bg-transparent text-sm outline-none",
|
|
3623
3626
|
value: V,
|
|
3624
|
-
onChange: (
|
|
3627
|
+
onChange: (C) => P(C.target.value),
|
|
3625
3628
|
onBlur: () => F(),
|
|
3626
|
-
onKeyDown: (
|
|
3627
|
-
|
|
3629
|
+
onKeyDown: (C) => {
|
|
3630
|
+
C.key === "Enter" && (C.preventDefault(), F()), C.key === "Escape" && (C.preventDefault(), re());
|
|
3628
3631
|
}
|
|
3629
3632
|
}
|
|
3630
3633
|
) : /* @__PURE__ */ React.createElement(
|
|
3631
3634
|
"button",
|
|
3632
3635
|
{
|
|
3633
3636
|
type: "button",
|
|
3634
|
-
onClick: () => ne(
|
|
3637
|
+
onClick: () => ne(N),
|
|
3635
3638
|
onMouseDown: () => {
|
|
3636
|
-
|
|
3639
|
+
y.current = !0, $();
|
|
3637
3640
|
},
|
|
3638
3641
|
className: "select-none inline-flex justify-center items-center gap-1 w-auto rounded-sm px-1 hover:bg-gray-100"
|
|
3639
3642
|
},
|
|
3640
|
-
|
|
3641
|
-
|
|
3643
|
+
E,
|
|
3644
|
+
w && /* @__PURE__ */ React.createElement(
|
|
3642
3645
|
"span",
|
|
3643
3646
|
{
|
|
3644
3647
|
className: B(
|
|
3645
3648
|
"w-3! h-3! overflow-hidden! rounded-full!",
|
|
3646
|
-
|
|
3649
|
+
w
|
|
3647
3650
|
)
|
|
3648
3651
|
}
|
|
3649
3652
|
)
|
|
@@ -3653,10 +3656,10 @@ const kr = ({
|
|
|
3653
3656
|
{
|
|
3654
3657
|
type: "button",
|
|
3655
3658
|
className: "inline-flex items-center rounded-full px-1 cursor-pointer hover:bg-gray-100",
|
|
3656
|
-
onMouseDown: (
|
|
3657
|
-
|
|
3659
|
+
onMouseDown: (C) => {
|
|
3660
|
+
C.preventDefault(), C.stopPropagation(), K(N);
|
|
3658
3661
|
},
|
|
3659
|
-
"aria-label": `Remove ${
|
|
3662
|
+
"aria-label": `Remove ${E}`
|
|
3660
3663
|
},
|
|
3661
3664
|
"×"
|
|
3662
3665
|
)
|
|
@@ -3664,14 +3667,14 @@ const kr = ({
|
|
|
3664
3667
|
})), /* @__PURE__ */ React.createElement("div", { className: "relative" }, /* @__PURE__ */ React.createElement(
|
|
3665
3668
|
"input",
|
|
3666
3669
|
{
|
|
3667
|
-
ref:
|
|
3670
|
+
ref: g,
|
|
3668
3671
|
className: B(
|
|
3669
3672
|
"w-full border px-3 py-2 text-sm outline-none",
|
|
3670
3673
|
e
|
|
3671
3674
|
),
|
|
3672
3675
|
value: L,
|
|
3673
3676
|
placeholder: a,
|
|
3674
|
-
onChange: (
|
|
3677
|
+
onChange: (E) => J(E.target.value),
|
|
3675
3678
|
onKeyDown: ae,
|
|
3676
3679
|
onFocus: () => {
|
|
3677
3680
|
},
|
|
@@ -3680,39 +3683,39 @@ const kr = ({
|
|
|
3680
3683
|
autoComplete: "off",
|
|
3681
3684
|
"aria-autocomplete": "list"
|
|
3682
3685
|
}
|
|
3683
|
-
),
|
|
3686
|
+
), d && /* @__PURE__ */ React.createElement(
|
|
3684
3687
|
Dt,
|
|
3685
3688
|
{
|
|
3686
3689
|
position: "bottom left",
|
|
3687
3690
|
onClose: $,
|
|
3688
|
-
anchor:
|
|
3691
|
+
anchor: g.current ?? void 0,
|
|
3689
3692
|
focusOnMount: !1,
|
|
3690
3693
|
offset: 12
|
|
3691
3694
|
},
|
|
3692
3695
|
/* @__PURE__ */ React.createElement(
|
|
3693
3696
|
"div",
|
|
3694
3697
|
{
|
|
3695
|
-
ref:
|
|
3698
|
+
ref: I,
|
|
3696
3699
|
role: "listbox",
|
|
3697
3700
|
className: "max-h-60 min-w-64 overflow-y-auto p-1"
|
|
3698
3701
|
},
|
|
3699
|
-
l.map((
|
|
3702
|
+
l.map((E, N) => /* @__PURE__ */ React.createElement(
|
|
3700
3703
|
Y,
|
|
3701
3704
|
{
|
|
3702
|
-
key: `${
|
|
3703
|
-
variant:
|
|
3705
|
+
key: `${E}-${N}`,
|
|
3706
|
+
variant: N === T ? "primary" : "tertiary",
|
|
3704
3707
|
className: B("block w-full text-left", {
|
|
3705
|
-
"is-active":
|
|
3708
|
+
"is-active": N === T
|
|
3706
3709
|
}),
|
|
3707
3710
|
onMouseDown: () => M(!0),
|
|
3708
|
-
onMouseEnter: () =>
|
|
3709
|
-
onClick: () => W(
|
|
3711
|
+
onMouseEnter: () => R(N),
|
|
3712
|
+
onClick: () => W(E),
|
|
3710
3713
|
tabIndex: -1
|
|
3711
3714
|
},
|
|
3712
|
-
/* @__PURE__ */ React.createElement("span", { className: "text-sm" },
|
|
3715
|
+
/* @__PURE__ */ React.createElement("span", { className: "text-sm" }, E)
|
|
3713
3716
|
)),
|
|
3714
|
-
|
|
3715
|
-
!
|
|
3717
|
+
p && /* @__PURE__ */ React.createElement("div", { className: "flex justify-center py-3" }, /* @__PURE__ */ React.createElement(At, null)),
|
|
3718
|
+
!p && f && l.length > 0 && /* @__PURE__ */ React.createElement("div", { className: "text-center text-xs text-gray-500 py-2" }, "Scroll for more")
|
|
3716
3719
|
)
|
|
3717
3720
|
)), r && /* @__PURE__ */ React.createElement("p", { className: "text-xs text-primary" }, r));
|
|
3718
3721
|
};
|