unifyedx-storybook-new 0.1.54 → 0.1.56
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.
|
@@ -45190,12 +45190,8 @@ li.e-separator.e-menu-item.e-excel-separator {
|
|
|
45190
45190
|
}
|
|
45191
45191
|
|
|
45192
45192
|
.native-radiogroup-container {
|
|
45193
|
-
|
|
45194
|
-
border: 1px solid #e5e7eb;
|
|
45195
|
-
border-radius: .5rem;
|
|
45196
|
-
flex-direction: column;
|
|
45193
|
+
flex-direction: row;
|
|
45197
45194
|
gap: 1rem;
|
|
45198
|
-
padding: 1rem;
|
|
45199
45195
|
display: flex;
|
|
45200
45196
|
}
|
|
45201
45197
|
|
|
@@ -49435,12 +49431,8 @@ body.toast-backdrop #ui-toast-backdrop {
|
|
|
49435
49431
|
/* --- ✅ NEW: Native Radio Group Story Styles --- */
|
|
49436
49432
|
.native-radiogroup-container {
|
|
49437
49433
|
display: flex;
|
|
49438
|
-
flex-direction:
|
|
49434
|
+
flex-direction: row;
|
|
49439
49435
|
gap: 1rem;
|
|
49440
|
-
padding: 1rem;
|
|
49441
|
-
border: 1px solid #e5e7eb; /* gray-200 */
|
|
49442
|
-
border-radius: 0.5rem;
|
|
49443
|
-
background-color: #f9fafb; /* gray-50 */
|
|
49444
49436
|
}
|
|
49445
49437
|
|
|
49446
49438
|
.native-radio-option {
|
|
@@ -772,7 +772,6 @@ const fnv1a = (str) => {
|
|
|
772
772
|
};
|
|
773
773
|
|
|
774
774
|
const generatePastelColor = (word) => {
|
|
775
|
-
console.log(word, 'checking word');
|
|
776
775
|
const w = (word ?? "").trim().toLowerCase();
|
|
777
776
|
|
|
778
777
|
// Pull out any trailing number (e.g., "Unifyed3" -> 3)
|
|
@@ -782,10 +781,10 @@ const generatePastelColor = (word) => {
|
|
|
782
781
|
const hash = fnv1a(w);
|
|
783
782
|
|
|
784
783
|
// Distribute across channels and offset by numeric suffix
|
|
785
|
-
const hue = (hash % 360 + 37 * suffixNum) % 360;
|
|
786
|
-
const sat = 55 + ((hash >>> 8) % 20);
|
|
787
|
-
const lightText = 30 + ((hash >>> 16) % 10);
|
|
788
|
-
const lightBg = 86 + ((hash >>> 24) % 8);
|
|
784
|
+
const hue = ((hash % 360) + 37 * suffixNum) % 360; // 37 is coprime with 360
|
|
785
|
+
const sat = 55 + ((hash >>> 8) % 20); // 55–74%
|
|
786
|
+
const lightText = 30 + ((hash >>> 16) % 10); // 30–39% (text)
|
|
787
|
+
const lightBg = 86 + ((hash >>> 24) % 8); // 86–93% (pastel bg)
|
|
789
788
|
|
|
790
789
|
const backgroundColor = `hsl(${hue}, ${sat}%, ${lightBg}%)`;
|
|
791
790
|
const color = `hsl(${hue}, ${sat}%, ${lightText}%)`;
|
|
@@ -76380,7 +76379,10 @@ const ManageCollectionList = ({
|
|
|
76380
76379
|
}) => {
|
|
76381
76380
|
const [editingId, setEditingId] = useState(null);
|
|
76382
76381
|
const [draftName, setDraftName] = useState("");
|
|
76383
|
-
const [linksData, setLinksData] = useState(
|
|
76382
|
+
const [linksData, setLinksData] = useState(() => {
|
|
76383
|
+
if (Array.isArray(initialData)) return initialData;
|
|
76384
|
+
return [];
|
|
76385
|
+
});
|
|
76384
76386
|
const [draggingId, setDraggingId] = useState(null);
|
|
76385
76387
|
const [dragOverId, setDragOverId] = useState(null);
|
|
76386
76388
|
const [searchValue, setSearchValue] = useState("");
|
|
@@ -76408,6 +76410,11 @@ const ManageCollectionList = ({
|
|
|
76408
76410
|
getListData();
|
|
76409
76411
|
}
|
|
76410
76412
|
}, [initialData]);
|
|
76413
|
+
useEffect(() => {
|
|
76414
|
+
if (Array.isArray(initialData)) {
|
|
76415
|
+
setLinksData(initialData);
|
|
76416
|
+
}
|
|
76417
|
+
}, [initialData]);
|
|
76411
76418
|
const startEdit = (item) => {
|
|
76412
76419
|
if (!allowEdit) return;
|
|
76413
76420
|
setEditingId(item.id);
|
|
@@ -76447,7 +76454,7 @@ const ManageCollectionList = ({
|
|
|
76447
76454
|
if (isTemp) {
|
|
76448
76455
|
const resp = await axiosPost(endpoints.collectionCreate, {
|
|
76449
76456
|
categoryName: draftName.trim(),
|
|
76450
|
-
order: (linksData.at(-1)?.order ?? 0) + 1
|
|
76457
|
+
order: (Array.isArray(linksData) && linksData.length > 0 ? linksData.at(-1)?.order ?? 0 : 0) + 1
|
|
76451
76458
|
});
|
|
76452
76459
|
if (resp) {
|
|
76453
76460
|
setLinksData((prev) => {
|
|
@@ -76545,39 +76552,33 @@ const ManageCollectionList = ({
|
|
|
76545
76552
|
setDraggingId(null);
|
|
76546
76553
|
setDragOverId(null);
|
|
76547
76554
|
};
|
|
76548
|
-
const filteredData = linksData.filter(
|
|
76555
|
+
const filteredData = Array.isArray(linksData) ? linksData.filter(
|
|
76549
76556
|
(item) => item.categoryName?.toLowerCase().includes(searchValue.toLowerCase())
|
|
76550
|
-
);
|
|
76557
|
+
) : [];
|
|
76551
76558
|
return /* @__PURE__ */ jsxs("div", { className: `manage-collection-list ${className}`, children: [
|
|
76552
|
-
/* @__PURE__ */ jsxs("div", { className: "flex", children: [
|
|
76553
|
-
/* @__PURE__ */
|
|
76554
|
-
|
|
76555
|
-
|
|
76556
|
-
|
|
76557
|
-
|
|
76558
|
-
|
|
76559
|
-
|
|
76560
|
-
|
|
76561
|
-
|
|
76562
|
-
|
|
76563
|
-
|
|
76564
|
-
|
|
76565
|
-
|
|
76566
|
-
|
|
76567
|
-
|
|
76568
|
-
"
|
|
76569
|
-
|
|
76570
|
-
|
|
76571
|
-
|
|
76572
|
-
|
|
76573
|
-
|
|
76574
|
-
|
|
76575
|
-
disabled: editingId !== null,
|
|
76576
|
-
children: "Add a Collection"
|
|
76577
|
-
}
|
|
76578
|
-
)
|
|
76579
|
-
] })
|
|
76580
|
-
] }),
|
|
76559
|
+
/* @__PURE__ */ jsx("div", { className: "flex", children: /* @__PURE__ */ jsxs("div", { className: "w-1/2 flex justify-end", children: [
|
|
76560
|
+
showSearch && /* @__PURE__ */ jsx(
|
|
76561
|
+
SearchBar,
|
|
76562
|
+
{
|
|
76563
|
+
value: searchValue,
|
|
76564
|
+
onDebouncedChange: setSearchValue,
|
|
76565
|
+
placeholder: "Search Collection",
|
|
76566
|
+
customClass: "mr-4"
|
|
76567
|
+
}
|
|
76568
|
+
),
|
|
76569
|
+
allowAdd && /* @__PURE__ */ jsx(
|
|
76570
|
+
"button",
|
|
76571
|
+
{
|
|
76572
|
+
className: [
|
|
76573
|
+
"px-4 py-3 bg-black text-white rounded-2xl ml-4",
|
|
76574
|
+
editingId !== null ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
|
|
76575
|
+
].join(" "),
|
|
76576
|
+
onClick: startAdd,
|
|
76577
|
+
disabled: editingId !== null,
|
|
76578
|
+
children: "Add a Collection"
|
|
76579
|
+
}
|
|
76580
|
+
)
|
|
76581
|
+
] }) }),
|
|
76581
76582
|
/* @__PURE__ */ jsx("div", { className: "mt-5 flex flex-col", children: filteredData.map((item) => {
|
|
76582
76583
|
const isEditing = editingId === item.id;
|
|
76583
76584
|
const linkCount = item?.links?.length ?? 0;
|
|
@@ -76684,7 +76685,7 @@ const ManageCollectionList = ({
|
|
|
76684
76685
|
const ManageCollectionListRenderer = ({ item, data, updateHandler }) => {
|
|
76685
76686
|
const {
|
|
76686
76687
|
label = "Manage Collections",
|
|
76687
|
-
description = "
|
|
76688
|
+
description = "",
|
|
76688
76689
|
endpoints = {},
|
|
76689
76690
|
initialData = null,
|
|
76690
76691
|
showSearch = true,
|
|
@@ -76694,7 +76695,8 @@ const ManageCollectionListRenderer = ({ item, data, updateHandler }) => {
|
|
|
76694
76695
|
allowReorder = true,
|
|
76695
76696
|
className = ""
|
|
76696
76697
|
} = item;
|
|
76697
|
-
const
|
|
76698
|
+
const rawData = data?.[item.key] || initialData || [];
|
|
76699
|
+
const currentCollections = Array.isArray(rawData) ? rawData : [];
|
|
76698
76700
|
const handleCollectionChange = (newCollections) => {
|
|
76699
76701
|
if (updateHandler) {
|
|
76700
76702
|
updateHandler(item.key, newCollections);
|