@firecms/core 3.0.0-canary.146 → 3.0.0-canary.148
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/components/ArrayContainer.d.ts +4 -2
- package/dist/index.es.js +59 -14
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +58 -13
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/src/app/Scaffold.tsx +3 -3
- package/src/components/ArrayContainer.tsx +40 -1
- package/src/components/ErrorView.tsx +2 -2
- package/src/core/DefaultDrawer.tsx +2 -2
- package/src/core/DrawerNavigationItem.tsx +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -4021,8 +4021,8 @@
|
|
|
4021
4021
|
{
|
|
4022
4022
|
className: "flex items-center m-2",
|
|
4023
4023
|
children: [
|
|
4024
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.ErrorIcon, { size: "small", color: "error" }),
|
|
4025
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pl-
|
|
4024
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.ErrorIcon, { className: "mx-2", size: "small", color: "error" }),
|
|
4025
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pl-4", children: [
|
|
4026
4026
|
title && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4027
4027
|
ui.Typography,
|
|
4028
4028
|
{
|
|
@@ -12480,6 +12480,18 @@
|
|
|
12480
12480
|
setInternalIds(newIds);
|
|
12481
12481
|
onValueChange([...value.slice(0, index + 1), copyingItem, ...value.slice(index + 1)]);
|
|
12482
12482
|
};
|
|
12483
|
+
const addInIndex = (index) => {
|
|
12484
|
+
const id = getRandomId$1();
|
|
12485
|
+
const newIds = [
|
|
12486
|
+
...internalIds.splice(0, index),
|
|
12487
|
+
id,
|
|
12488
|
+
...internalIds.slice(index)
|
|
12489
|
+
];
|
|
12490
|
+
if (onInternalIdAdded)
|
|
12491
|
+
onInternalIdAdded(id);
|
|
12492
|
+
setInternalIds(newIds);
|
|
12493
|
+
onValueChange([...value.slice(0, index), newDefaultEntry, ...value.slice(index)]);
|
|
12494
|
+
};
|
|
12483
12495
|
const onDragEnd = (result) => {
|
|
12484
12496
|
if (!result.destination) {
|
|
12485
12497
|
return;
|
|
@@ -12513,7 +12525,8 @@
|
|
|
12513
12525
|
copy,
|
|
12514
12526
|
isDragging: snapshot.isDragging,
|
|
12515
12527
|
storedProps: itemCustomPropsRef.current[internalId],
|
|
12516
|
-
updateItemCustomProps
|
|
12528
|
+
updateItemCustomProps,
|
|
12529
|
+
addInIndex
|
|
12517
12530
|
}
|
|
12518
12531
|
);
|
|
12519
12532
|
},
|
|
@@ -12544,7 +12557,8 @@
|
|
|
12544
12557
|
copy,
|
|
12545
12558
|
isDragging: snapshot.isDragging,
|
|
12546
12559
|
storedProps: itemCustomPropsRef.current[internalId],
|
|
12547
|
-
updateItemCustomProps
|
|
12560
|
+
updateItemCustomProps,
|
|
12561
|
+
addInIndex
|
|
12548
12562
|
}
|
|
12549
12563
|
)
|
|
12550
12564
|
},
|
|
@@ -12578,6 +12592,7 @@
|
|
|
12578
12592
|
disabled,
|
|
12579
12593
|
buildEntry,
|
|
12580
12594
|
remove,
|
|
12595
|
+
addInIndex,
|
|
12581
12596
|
copy,
|
|
12582
12597
|
isDragging,
|
|
12583
12598
|
storedProps,
|
|
@@ -12616,6 +12631,7 @@
|
|
|
12616
12631
|
remove,
|
|
12617
12632
|
index,
|
|
12618
12633
|
provided,
|
|
12634
|
+
addInIndex,
|
|
12619
12635
|
copy
|
|
12620
12636
|
}
|
|
12621
12637
|
)
|
|
@@ -12631,7 +12647,8 @@
|
|
|
12631
12647
|
remove,
|
|
12632
12648
|
index,
|
|
12633
12649
|
provided,
|
|
12634
|
-
copy
|
|
12650
|
+
copy,
|
|
12651
|
+
addInIndex
|
|
12635
12652
|
}) {
|
|
12636
12653
|
const [menuOpen, setMenuOpen] = React.useState(false);
|
|
12637
12654
|
const iconRef = React.useRef(null);
|
|
@@ -12686,7 +12703,35 @@
|
|
|
12686
12703
|
}, children: [
|
|
12687
12704
|
/* @__PURE__ */ jsxRuntime.jsx(ui.ContentCopyIcon, { size: "small" }),
|
|
12688
12705
|
"Copy"
|
|
12689
|
-
] })
|
|
12706
|
+
] }),
|
|
12707
|
+
addInIndex && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12708
|
+
ui.MenuItem,
|
|
12709
|
+
{
|
|
12710
|
+
dense: true,
|
|
12711
|
+
onClick: () => {
|
|
12712
|
+
setMenuOpen(false);
|
|
12713
|
+
addInIndex(index);
|
|
12714
|
+
},
|
|
12715
|
+
children: [
|
|
12716
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.KeyboardArrowUpIcon, { size: "small" }),
|
|
12717
|
+
"Add on top"
|
|
12718
|
+
]
|
|
12719
|
+
}
|
|
12720
|
+
),
|
|
12721
|
+
addInIndex && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12722
|
+
ui.MenuItem,
|
|
12723
|
+
{
|
|
12724
|
+
dense: true,
|
|
12725
|
+
onClick: () => {
|
|
12726
|
+
setMenuOpen(false);
|
|
12727
|
+
addInIndex(index + 1);
|
|
12728
|
+
},
|
|
12729
|
+
children: [
|
|
12730
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.KeyboardArrowDownIcon, { size: "small" }),
|
|
12731
|
+
"Add below"
|
|
12732
|
+
]
|
|
12733
|
+
}
|
|
12734
|
+
)
|
|
12690
12735
|
]
|
|
12691
12736
|
}
|
|
12692
12737
|
)
|
|
@@ -19447,7 +19492,7 @@
|
|
|
19447
19492
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19448
19493
|
"div",
|
|
19449
19494
|
{
|
|
19450
|
-
className: "ml-2 fixed top-1 left-2 sm:top-2 sm:left-
|
|
19495
|
+
className: "ml-2 fixed top-1 left-2 sm:top-2 sm:left-2 !bg-surface-50 dark:!bg-surface-900 rounded-full w-fit z-20",
|
|
19451
19496
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19452
19497
|
ui.IconButton,
|
|
19453
19498
|
{
|
|
@@ -19492,7 +19537,7 @@
|
|
|
19492
19537
|
"aria-label": "Open drawer",
|
|
19493
19538
|
onClick: () => props.setDrawerOpen(true),
|
|
19494
19539
|
size: "large",
|
|
19495
|
-
className: "absolute sm:top-2 sm:left-
|
|
19540
|
+
className: "absolute sm:top-2 sm:left-4 top-1 left-2",
|
|
19496
19541
|
children: /* @__PURE__ */ jsxRuntime.jsx(ui.MenuIcon, {})
|
|
19497
19542
|
}
|
|
19498
19543
|
),
|
|
@@ -19503,7 +19548,7 @@
|
|
|
19503
19548
|
transparent: true,
|
|
19504
19549
|
open: props.open,
|
|
19505
19550
|
onOpenChange: props.setDrawerOpen,
|
|
19506
|
-
title: "
|
|
19551
|
+
title: "Navigation drawer",
|
|
19507
19552
|
overlayClassName: "bg-white bg-opacity-80",
|
|
19508
19553
|
children: innerDrawer
|
|
19509
19554
|
}
|
|
@@ -19551,12 +19596,12 @@
|
|
|
19551
19596
|
},
|
|
19552
19597
|
className: ({ isActive }) => ui.cls(
|
|
19553
19598
|
"rounded-lg truncate",
|
|
19554
|
-
"hover:bg-surface-accent-300 hover:bg-opacity-75 dark:hover:bg-surface-accent-800 dark:hover:bg-opacity-75 text-text-
|
|
19599
|
+
"hover:bg-surface-accent-300 hover:bg-opacity-75 dark:hover:bg-surface-accent-800 dark:hover:bg-opacity-75 text-text-primary dark:text-surface-200 hover:text-surface-900 hover:dark:text-white",
|
|
19555
19600
|
"flex flex-row items-center mr-8",
|
|
19556
19601
|
// "transition-all ease-in-out delay-100 duration-300",
|
|
19557
19602
|
// drawerOpen ? "w-full" : "w-18",
|
|
19558
19603
|
drawerOpen ? "pl-4 h-12" : "pl-4 h-11",
|
|
19559
|
-
"font-
|
|
19604
|
+
"font-semibold text-xs",
|
|
19560
19605
|
isActive ? "bg-surface-accent-200 bg-opacity-60 dark:bg-surface-800 dark:bg-opacity-50" : ""
|
|
19561
19606
|
),
|
|
19562
19607
|
to: url,
|
|
@@ -19645,7 +19690,7 @@
|
|
|
19645
19690
|
children: groupsWithoutAdmin.map((group) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19646
19691
|
"div",
|
|
19647
19692
|
{
|
|
19648
|
-
className: "bg-surface-50 dark:bg-surface-800 dark:bg-opacity-30 my-4 rounded-lg ml-
|
|
19693
|
+
className: "bg-surface-50 dark:bg-surface-800 dark:bg-opacity-30 my-4 rounded-lg ml-3 mr-1",
|
|
19649
19694
|
children: [
|
|
19650
19695
|
buildGroupHeader(group),
|
|
19651
19696
|
Object.values(navigationEntries).filter((e) => e.group === group).map((view, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -19730,7 +19775,7 @@
|
|
|
19730
19775
|
transition: "padding 100ms cubic-bezier(0.4, 0, 0.6, 1) 0ms",
|
|
19731
19776
|
padding: drawerOpen ? "32px 144px 0px 24px" : "72px 12px 0px 12px"
|
|
19732
19777
|
},
|
|
19733
|
-
className: ui.cls("cursor-pointer ml-
|
|
19778
|
+
className: ui.cls("cursor-pointer ml-3 mr-1"),
|
|
19734
19779
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19735
19780
|
ui.Tooltip,
|
|
19736
19781
|
{
|