@firecms/core 3.0.0-canary.206 → 3.0.0-canary.208
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/app/Scaffold.d.ts +4 -0
- package/dist/core/DefaultAppBar.d.ts +8 -2
- package/dist/core/FireCMS.d.ts +2 -2
- package/dist/index.es.js +121 -113
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +121 -113
- package/dist/index.umd.js.map +1 -1
- package/dist/types/firecms.d.ts +1 -1
- package/package.json +5 -5
- package/src/app/Scaffold.tsx +13 -3
- package/src/core/DefaultAppBar.tsx +17 -5
- package/src/core/FireCMS.tsx +1 -1
- package/src/hooks/useBuildNavigationController.tsx +1 -1
- package/src/routes/FireCMSRoute.tsx +0 -1
- package/src/types/firecms.tsx +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -4520,7 +4520,7 @@
|
|
|
4520
4520
|
let shouldUpdateTopLevelNav = false;
|
|
4521
4521
|
if (!areCollectionListsEqual(collectionsRef.current ?? [], resolvedCollections)) {
|
|
4522
4522
|
collectionsRef.current = resolvedCollections;
|
|
4523
|
-
console.
|
|
4523
|
+
console.debug("Collections have changed", resolvedCollections);
|
|
4524
4524
|
shouldUpdateTopLevelNav = true;
|
|
4525
4525
|
}
|
|
4526
4526
|
if (collectionsRef.current === void 0) {
|
|
@@ -15392,14 +15392,16 @@
|
|
|
15392
15392
|
includeModeToggle: t1,
|
|
15393
15393
|
className,
|
|
15394
15394
|
style,
|
|
15395
|
-
user: userProp
|
|
15395
|
+
user: userProp,
|
|
15396
|
+
logo: logoProp
|
|
15396
15397
|
} = t0;
|
|
15397
15398
|
const includeModeToggle = t1 === void 0 ? true : t1;
|
|
15398
15399
|
const {
|
|
15399
15400
|
hasDrawer,
|
|
15400
15401
|
drawerOpen,
|
|
15401
|
-
logo
|
|
15402
|
+
logo: appLogo
|
|
15402
15403
|
} = useApp();
|
|
15404
|
+
const logo = logoProp ?? appLogo;
|
|
15403
15405
|
const navigation = useNavigationController();
|
|
15404
15406
|
const breadcrumbs = useBreadcrumbsController();
|
|
15405
15407
|
const authController = useAuthController();
|
|
@@ -15483,7 +15485,7 @@
|
|
|
15483
15485
|
}
|
|
15484
15486
|
let t7;
|
|
15485
15487
|
if ($[18] !== breadcrumbs.breadcrumbs) {
|
|
15486
|
-
t7 = breadcrumbs.breadcrumbs && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mr-8 hidden lg:block", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row gap-2", children: breadcrumbs.breadcrumbs.map(_temp$a) }) });
|
|
15488
|
+
t7 = (breadcrumbs.breadcrumbs ?? []).length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mr-8 hidden lg:block", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-row gap-2", children: breadcrumbs.breadcrumbs.map(_temp$a) }) });
|
|
15487
15489
|
$[18] = breadcrumbs.breadcrumbs;
|
|
15488
15490
|
$[19] = t7;
|
|
15489
15491
|
} else {
|
|
@@ -23290,7 +23292,6 @@
|
|
|
23290
23292
|
const collectionPath = navigation.resolveIdsFrom(isNew ? lastCollectionEntry.path : lastEntityEntry.path);
|
|
23291
23293
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
23292
23294
|
/* @__PURE__ */ jsxRuntime.jsx(EntityEditView, { entityId: isNew ? void 0 : entityId, collection, layout: "full_screen", path: collectionPath, copy: isCopy, selectedTab: selectedTab ?? void 0, onValuesModified: (modified) => blocked.current = modified, onSaved: (params) => {
|
|
23293
|
-
console.log("Entity saved", params);
|
|
23294
23295
|
const newSelectedTab = params.selectedTab;
|
|
23295
23296
|
const newEntityId = params.entityId;
|
|
23296
23297
|
if (newSelectedTab) {
|
|
@@ -23517,92 +23518,94 @@
|
|
|
23517
23518
|
AppBar.componentType = "AppBar";
|
|
23518
23519
|
const DRAWER_WIDTH = 280;
|
|
23519
23520
|
const Scaffold = React.memo(function Scaffold2(props) {
|
|
23520
|
-
const $ = reactCompilerRuntime.c(
|
|
23521
|
+
const $ = reactCompilerRuntime.c(48);
|
|
23521
23522
|
const {
|
|
23522
23523
|
children,
|
|
23523
23524
|
autoOpenDrawer,
|
|
23524
23525
|
logo,
|
|
23525
23526
|
className,
|
|
23526
|
-
style
|
|
23527
|
+
style,
|
|
23528
|
+
padding: t0
|
|
23527
23529
|
} = props;
|
|
23528
|
-
|
|
23530
|
+
const padding = t0 === void 0 ? true : t0;
|
|
23531
|
+
let t1;
|
|
23529
23532
|
if ($[0] !== children) {
|
|
23530
|
-
|
|
23533
|
+
t1 = React.Children.toArray(children).filter(_temp);
|
|
23531
23534
|
$[0] = children;
|
|
23532
|
-
$[1] =
|
|
23535
|
+
$[1] = t1;
|
|
23533
23536
|
} else {
|
|
23534
|
-
|
|
23537
|
+
t1 = $[1];
|
|
23535
23538
|
}
|
|
23536
|
-
const drawerChildren =
|
|
23539
|
+
const drawerChildren = t1;
|
|
23537
23540
|
if (drawerChildren.length > 1) {
|
|
23538
23541
|
throw Error("Only one Drawer component is allowed in Scaffold");
|
|
23539
23542
|
}
|
|
23540
|
-
let
|
|
23543
|
+
let t2;
|
|
23541
23544
|
if ($[2] !== children) {
|
|
23542
|
-
|
|
23545
|
+
t2 = React.Children.toArray(children).filter(_temp2);
|
|
23543
23546
|
$[2] = children;
|
|
23544
|
-
$[3] =
|
|
23547
|
+
$[3] = t2;
|
|
23545
23548
|
} else {
|
|
23546
|
-
|
|
23549
|
+
t2 = $[3];
|
|
23547
23550
|
}
|
|
23548
|
-
const appBarChildren =
|
|
23551
|
+
const appBarChildren = t2;
|
|
23549
23552
|
if (appBarChildren.length > 1) {
|
|
23550
23553
|
throw Error("Only one AppBar component is allowed in Scaffold");
|
|
23551
23554
|
}
|
|
23552
|
-
let
|
|
23555
|
+
let t3;
|
|
23553
23556
|
if ($[4] !== children) {
|
|
23554
|
-
|
|
23557
|
+
t3 = React.Children.toArray(children).filter(_temp3);
|
|
23555
23558
|
$[4] = children;
|
|
23556
|
-
$[5] =
|
|
23559
|
+
$[5] = t3;
|
|
23557
23560
|
} else {
|
|
23558
|
-
|
|
23561
|
+
t3 = $[5];
|
|
23559
23562
|
}
|
|
23560
|
-
const otherChildren =
|
|
23563
|
+
const otherChildren = t3;
|
|
23561
23564
|
const includeDrawer = drawerChildren.length > 0;
|
|
23562
23565
|
const largeLayout = useLargeLayout();
|
|
23563
23566
|
const [drawerOpen, setDrawerOpen] = React.useState(false);
|
|
23564
23567
|
const [onHover, setOnHover] = React.useState(false);
|
|
23565
|
-
let
|
|
23568
|
+
let t4;
|
|
23566
23569
|
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23567
|
-
|
|
23568
|
-
$[6] =
|
|
23570
|
+
t4 = () => setOnHover(true);
|
|
23571
|
+
$[6] = t4;
|
|
23569
23572
|
} else {
|
|
23570
|
-
|
|
23573
|
+
t4 = $[6];
|
|
23571
23574
|
}
|
|
23572
|
-
const setOnHoverTrue =
|
|
23573
|
-
let
|
|
23575
|
+
const setOnHoverTrue = t4;
|
|
23576
|
+
let t5;
|
|
23574
23577
|
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23575
|
-
|
|
23576
|
-
$[7] =
|
|
23578
|
+
t5 = () => setOnHover(false);
|
|
23579
|
+
$[7] = t5;
|
|
23577
23580
|
} else {
|
|
23578
|
-
|
|
23581
|
+
t5 = $[7];
|
|
23579
23582
|
}
|
|
23580
|
-
const setOnHoverFalse =
|
|
23581
|
-
let
|
|
23583
|
+
const setOnHoverFalse = t5;
|
|
23584
|
+
let t6;
|
|
23582
23585
|
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23583
|
-
|
|
23586
|
+
t6 = () => {
|
|
23584
23587
|
setDrawerOpen(true);
|
|
23585
23588
|
};
|
|
23586
|
-
$[8] =
|
|
23589
|
+
$[8] = t6;
|
|
23587
23590
|
} else {
|
|
23588
|
-
|
|
23591
|
+
t6 = $[8];
|
|
23589
23592
|
}
|
|
23590
|
-
const handleDrawerOpen =
|
|
23591
|
-
let
|
|
23593
|
+
const handleDrawerOpen = t6;
|
|
23594
|
+
let t7;
|
|
23592
23595
|
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23593
|
-
|
|
23596
|
+
t7 = () => {
|
|
23594
23597
|
setDrawerOpen(false);
|
|
23595
23598
|
};
|
|
23596
|
-
$[9] =
|
|
23599
|
+
$[9] = t7;
|
|
23597
23600
|
} else {
|
|
23598
|
-
|
|
23601
|
+
t7 = $[9];
|
|
23599
23602
|
}
|
|
23600
|
-
const handleDrawerClose =
|
|
23603
|
+
const handleDrawerClose = t7;
|
|
23601
23604
|
const computedDrawerOpen = drawerOpen || Boolean(largeLayout && autoOpenDrawer && onHover);
|
|
23602
23605
|
const hasAppBar = Boolean(appBarChildren.length > 0);
|
|
23603
|
-
let
|
|
23606
|
+
let t8;
|
|
23604
23607
|
if ($[10] !== autoOpenDrawer || $[11] !== computedDrawerOpen || $[12] !== includeDrawer || $[13] !== logo || $[14] !== onHover) {
|
|
23605
|
-
|
|
23608
|
+
t8 = {
|
|
23606
23609
|
logo,
|
|
23607
23610
|
hasDrawer: includeDrawer,
|
|
23608
23611
|
drawerHovered: onHover,
|
|
@@ -23616,21 +23619,21 @@
|
|
|
23616
23619
|
$[12] = includeDrawer;
|
|
23617
23620
|
$[13] = logo;
|
|
23618
23621
|
$[14] = onHover;
|
|
23619
|
-
$[15] =
|
|
23622
|
+
$[15] = t8;
|
|
23620
23623
|
} else {
|
|
23621
|
-
|
|
23624
|
+
t8 = $[15];
|
|
23622
23625
|
}
|
|
23623
|
-
let
|
|
23626
|
+
let t9;
|
|
23624
23627
|
if ($[16] !== className) {
|
|
23625
|
-
|
|
23628
|
+
t9 = ui.cls("flex h-screen w-screen bg-surface-50 dark:bg-surface-900 text-surface-900 dark:text-white overflow-hidden", className);
|
|
23626
23629
|
$[16] = className;
|
|
23627
|
-
$[17] =
|
|
23630
|
+
$[17] = t9;
|
|
23628
23631
|
} else {
|
|
23629
|
-
|
|
23632
|
+
t9 = $[17];
|
|
23630
23633
|
}
|
|
23631
|
-
let
|
|
23634
|
+
let t10;
|
|
23632
23635
|
if ($[18] !== style) {
|
|
23633
|
-
|
|
23636
|
+
t10 = {
|
|
23634
23637
|
paddingTop: "env(safe-area-inset-top)",
|
|
23635
23638
|
paddingLeft: "env(safe-area-inset-left)",
|
|
23636
23639
|
paddingRight: "env(safe-area-inset-right)",
|
|
@@ -23639,96 +23642,101 @@
|
|
|
23639
23642
|
...style
|
|
23640
23643
|
};
|
|
23641
23644
|
$[18] = style;
|
|
23642
|
-
$[19] =
|
|
23645
|
+
$[19] = t10;
|
|
23643
23646
|
} else {
|
|
23644
|
-
|
|
23647
|
+
t10 = $[19];
|
|
23645
23648
|
}
|
|
23646
|
-
const
|
|
23647
|
-
let
|
|
23648
|
-
if ($[20] !== computedDrawerOpen || $[21] !== includeDrawer || $[22] !== onHover || $[23] !==
|
|
23649
|
-
|
|
23649
|
+
const t11 = includeDrawer && drawerChildren;
|
|
23650
|
+
let t12;
|
|
23651
|
+
if ($[20] !== computedDrawerOpen || $[21] !== includeDrawer || $[22] !== onHover || $[23] !== t11) {
|
|
23652
|
+
t12 = /* @__PURE__ */ jsxRuntime.jsx(DrawerWrapper, { displayed: includeDrawer, onMouseEnter: setOnHoverTrue, onMouseMove: setOnHoverTrue, onMouseLeave: setOnHoverFalse, open: computedDrawerOpen, hovered: onHover, setDrawerOpen, children: t11 });
|
|
23650
23653
|
$[20] = computedDrawerOpen;
|
|
23651
23654
|
$[21] = includeDrawer;
|
|
23652
23655
|
$[22] = onHover;
|
|
23653
|
-
$[23] =
|
|
23654
|
-
$[24] =
|
|
23656
|
+
$[23] = t11;
|
|
23657
|
+
$[24] = t12;
|
|
23655
23658
|
} else {
|
|
23656
|
-
|
|
23659
|
+
t12 = $[24];
|
|
23657
23660
|
}
|
|
23658
|
-
let
|
|
23661
|
+
let t13;
|
|
23659
23662
|
if ($[25] !== hasAppBar) {
|
|
23660
|
-
|
|
23663
|
+
t13 = hasAppBar && /* @__PURE__ */ jsxRuntime.jsx(DrawerHeader, {});
|
|
23661
23664
|
$[25] = hasAppBar;
|
|
23662
|
-
$[26] =
|
|
23665
|
+
$[26] = t13;
|
|
23663
23666
|
} else {
|
|
23664
|
-
|
|
23667
|
+
t13 = $[26];
|
|
23665
23668
|
}
|
|
23666
|
-
const
|
|
23667
|
-
|
|
23668
|
-
|
|
23669
|
-
|
|
23670
|
-
|
|
23669
|
+
const t14 = !hasAppBar;
|
|
23670
|
+
const t15 = hasAppBar && !padding;
|
|
23671
|
+
let t16;
|
|
23672
|
+
if ($[27] !== padding || $[28] !== t14 || $[29] !== t15) {
|
|
23673
|
+
t16 = ui.cls(ui.defaultBorderMixin, "flex-grow overflow-auto m-0 mt-1", {
|
|
23674
|
+
"lg:mt-4": t14,
|
|
23675
|
+
"lg:m-0 lg:mx-4 lg:mb-4 lg:rounded-lg lg:border lg:border-solid": padding,
|
|
23676
|
+
"border-t": t15
|
|
23671
23677
|
});
|
|
23672
|
-
$[27] =
|
|
23678
|
+
$[27] = padding;
|
|
23673
23679
|
$[28] = t14;
|
|
23680
|
+
$[29] = t15;
|
|
23681
|
+
$[30] = t16;
|
|
23674
23682
|
} else {
|
|
23675
|
-
|
|
23683
|
+
t16 = $[30];
|
|
23676
23684
|
}
|
|
23677
|
-
let
|
|
23678
|
-
if ($[
|
|
23679
|
-
|
|
23680
|
-
$[
|
|
23681
|
-
$[
|
|
23685
|
+
let t17;
|
|
23686
|
+
if ($[31] !== otherChildren) {
|
|
23687
|
+
t17 = /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: otherChildren });
|
|
23688
|
+
$[31] = otherChildren;
|
|
23689
|
+
$[32] = t17;
|
|
23682
23690
|
} else {
|
|
23683
|
-
|
|
23691
|
+
t17 = $[32];
|
|
23684
23692
|
}
|
|
23685
|
-
let
|
|
23686
|
-
if ($[
|
|
23687
|
-
|
|
23688
|
-
$[31] = t14;
|
|
23689
|
-
$[32] = t15;
|
|
23693
|
+
let t18;
|
|
23694
|
+
if ($[33] !== t16 || $[34] !== t17) {
|
|
23695
|
+
t18 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: t16, children: t17 });
|
|
23690
23696
|
$[33] = t16;
|
|
23697
|
+
$[34] = t17;
|
|
23698
|
+
$[35] = t18;
|
|
23691
23699
|
} else {
|
|
23692
|
-
|
|
23700
|
+
t18 = $[35];
|
|
23693
23701
|
}
|
|
23694
|
-
let
|
|
23695
|
-
if ($[
|
|
23696
|
-
|
|
23697
|
-
|
|
23698
|
-
|
|
23702
|
+
let t19;
|
|
23703
|
+
if ($[36] !== t13 || $[37] !== t18) {
|
|
23704
|
+
t19 = /* @__PURE__ */ jsxRuntime.jsxs("main", { className: "flex flex-col flex-grow overflow-auto", children: [
|
|
23705
|
+
t13,
|
|
23706
|
+
t18
|
|
23699
23707
|
] });
|
|
23700
|
-
$[
|
|
23701
|
-
$[
|
|
23702
|
-
$[
|
|
23708
|
+
$[36] = t13;
|
|
23709
|
+
$[37] = t18;
|
|
23710
|
+
$[38] = t19;
|
|
23703
23711
|
} else {
|
|
23704
|
-
|
|
23712
|
+
t19 = $[38];
|
|
23705
23713
|
}
|
|
23706
|
-
let
|
|
23707
|
-
if ($[
|
|
23708
|
-
|
|
23714
|
+
let t20;
|
|
23715
|
+
if ($[39] !== appBarChildren || $[40] !== t10 || $[41] !== t12 || $[42] !== t19 || $[43] !== t9) {
|
|
23716
|
+
t20 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t9, style: t10, children: [
|
|
23709
23717
|
appBarChildren,
|
|
23710
|
-
|
|
23711
|
-
|
|
23718
|
+
t12,
|
|
23719
|
+
t19
|
|
23712
23720
|
] });
|
|
23713
|
-
$[
|
|
23714
|
-
$[
|
|
23715
|
-
$[
|
|
23716
|
-
$[
|
|
23717
|
-
$[
|
|
23718
|
-
$[
|
|
23721
|
+
$[39] = appBarChildren;
|
|
23722
|
+
$[40] = t10;
|
|
23723
|
+
$[41] = t12;
|
|
23724
|
+
$[42] = t19;
|
|
23725
|
+
$[43] = t9;
|
|
23726
|
+
$[44] = t20;
|
|
23719
23727
|
} else {
|
|
23720
|
-
|
|
23728
|
+
t20 = $[44];
|
|
23721
23729
|
}
|
|
23722
|
-
let
|
|
23723
|
-
if ($[
|
|
23724
|
-
|
|
23725
|
-
$[
|
|
23726
|
-
$[
|
|
23727
|
-
$[
|
|
23730
|
+
let t21;
|
|
23731
|
+
if ($[45] !== t20 || $[46] !== t8) {
|
|
23732
|
+
t21 = /* @__PURE__ */ jsxRuntime.jsx(AppContext.Provider, { value: t8, children: t20 });
|
|
23733
|
+
$[45] = t20;
|
|
23734
|
+
$[46] = t8;
|
|
23735
|
+
$[47] = t21;
|
|
23728
23736
|
} else {
|
|
23729
|
-
|
|
23737
|
+
t21 = $[47];
|
|
23730
23738
|
}
|
|
23731
|
-
return
|
|
23739
|
+
return t21;
|
|
23732
23740
|
}, equal);
|
|
23733
23741
|
const DrawerHeader = () => {
|
|
23734
23742
|
const $ = reactCompilerRuntime.c(1);
|