unifyedx-storybook-new 0.2.59 → 0.2.60
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.
|
@@ -5661,14 +5661,14 @@ const Jl = ({
|
|
|
5661
5661
|
Array.isArray(h) && d(h);
|
|
5662
5662
|
}, [h]);
|
|
5663
5663
|
const _ = (p) => {
|
|
5664
|
-
l && (N(p._id
|
|
5664
|
+
l && (N(p._id), r(p.categoryName || ""));
|
|
5665
5665
|
}, U = () => {
|
|
5666
5666
|
if (!i || u !== null) return;
|
|
5667
|
-
const k = (v.length > 0 ? Math.max(...v.map((w) => w._id
|
|
5667
|
+
const k = (v.length > 0 ? Math.max(...v.map((w) => w._id ?? 0)) : 0) + 1;
|
|
5668
5668
|
d((w) => [
|
|
5669
5669
|
...w,
|
|
5670
5670
|
{
|
|
5671
|
-
_id:
|
|
5671
|
+
_id: k,
|
|
5672
5672
|
categoryName: "",
|
|
5673
5673
|
links: [],
|
|
5674
5674
|
order: (w.at(-1)?.order ?? 0) + 1,
|
|
@@ -5678,12 +5678,12 @@ const Jl = ({
|
|
|
5678
5678
|
]), N(k), r("");
|
|
5679
5679
|
}, Y = () => {
|
|
5680
5680
|
u != null && (d((p) => {
|
|
5681
|
-
const w = !p.some(($) => $._id
|
|
5681
|
+
const w = !p.some(($) => $._id !== void 0 && $._id === u && $.categoryName) ? p.filter(($) => $._id !== u) : p;
|
|
5682
5682
|
return a?.(w), w;
|
|
5683
5683
|
}), N(null), r(""));
|
|
5684
5684
|
}, G = () => {
|
|
5685
5685
|
u == null || !y.trim() || (d((p) => {
|
|
5686
|
-
const k = p.map((w) => w._id
|
|
5686
|
+
const k = p.map((w) => w._id === u ? {
|
|
5687
5687
|
...w,
|
|
5688
5688
|
categoryName: y.trim()
|
|
5689
5689
|
} : w);
|
|
@@ -5691,7 +5691,7 @@ const Jl = ({
|
|
|
5691
5691
|
}), N(null), r(""));
|
|
5692
5692
|
}, T = (p) => {
|
|
5693
5693
|
m && d((k) => {
|
|
5694
|
-
const w = k.filter(($) => $._id
|
|
5694
|
+
const w = k.filter(($) => $._id !== p._id);
|
|
5695
5695
|
return a?.(w), w;
|
|
5696
5696
|
});
|
|
5697
5697
|
}, x = (p, k, w) => {
|
|
@@ -5743,13 +5743,13 @@ const Jl = ({
|
|
|
5743
5743
|
)
|
|
5744
5744
|
] }) }),
|
|
5745
5745
|
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: b.map((p) => {
|
|
5746
|
-
const k = u === p._id
|
|
5746
|
+
const k = u === p._id, w = p?.links?.length ?? 0, $ = g === p._id, P = A === p._id && g !== p._id;
|
|
5747
5747
|
return /* @__PURE__ */ e(
|
|
5748
5748
|
"div",
|
|
5749
5749
|
{
|
|
5750
|
-
onDragEnter: () => C(p._id
|
|
5750
|
+
onDragEnter: () => C(p._id),
|
|
5751
5751
|
onDragOver: I,
|
|
5752
|
-
onDrop: (S) => R(S, p._id
|
|
5752
|
+
onDrop: (S) => R(S, p._id),
|
|
5753
5753
|
className: [
|
|
5754
5754
|
"flex items-center justify-between p-3 border rounded-2xl mb-3",
|
|
5755
5755
|
"border-gray-300",
|
|
@@ -5763,7 +5763,7 @@ const Jl = ({
|
|
|
5763
5763
|
type: "text",
|
|
5764
5764
|
className: "flex-1 h-10 px-3 max-w-[200px] border border-gray-300 rounded-2xl outline-none focus:ring-2 focus:ring-gray-800/20",
|
|
5765
5765
|
value: y,
|
|
5766
|
-
placeholder: v.some((S) => S._id
|
|
5766
|
+
placeholder: v.some((S) => S._id === p._id && S.categoryName) ? "Edit collection name" : "New collection name",
|
|
5767
5767
|
onChange: (S) => r(S.target.value),
|
|
5768
5768
|
onKeyDown: (S) => {
|
|
5769
5769
|
S.key === "Enter" && G(), S.key === "Escape" && Y();
|
|
@@ -5827,7 +5827,7 @@ const Jl = ({
|
|
|
5827
5827
|
"span",
|
|
5828
5828
|
{
|
|
5829
5829
|
className: w === 0 && !p.protected ? "cursor-pointer" : "cursor-not-allowed",
|
|
5830
|
-
title: w === 0 && !p.protected ? "Delete" : "Cannot delete
|
|
5830
|
+
title: w === 0 && !p.protected ? "Delete" : "Cannot delete a collection with linked items",
|
|
5831
5831
|
onClick: w === 0 ? () => T(p) : null,
|
|
5832
5832
|
children: /* @__PURE__ */ e(Me, { color: w === 0 ? "#767676" : "#C2C2C2" })
|
|
5833
5833
|
}
|
|
@@ -5835,7 +5835,7 @@ const Jl = ({
|
|
|
5835
5835
|
] })
|
|
5836
5836
|
] })
|
|
5837
5837
|
},
|
|
5838
|
-
p._id
|
|
5838
|
+
p._id
|
|
5839
5839
|
);
|
|
5840
5840
|
}) })
|
|
5841
5841
|
] });
|
|
Binary file
|
|
Binary file
|