@firecms/core 3.0.0-canary.207 → 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 +120 -111
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +120 -111
- 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/types/firecms.tsx +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -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 {
|
|
@@ -23516,92 +23518,94 @@
|
|
|
23516
23518
|
AppBar.componentType = "AppBar";
|
|
23517
23519
|
const DRAWER_WIDTH = 280;
|
|
23518
23520
|
const Scaffold = React.memo(function Scaffold2(props) {
|
|
23519
|
-
const $ = reactCompilerRuntime.c(
|
|
23521
|
+
const $ = reactCompilerRuntime.c(48);
|
|
23520
23522
|
const {
|
|
23521
23523
|
children,
|
|
23522
23524
|
autoOpenDrawer,
|
|
23523
23525
|
logo,
|
|
23524
23526
|
className,
|
|
23525
|
-
style
|
|
23527
|
+
style,
|
|
23528
|
+
padding: t0
|
|
23526
23529
|
} = props;
|
|
23527
|
-
|
|
23530
|
+
const padding = t0 === void 0 ? true : t0;
|
|
23531
|
+
let t1;
|
|
23528
23532
|
if ($[0] !== children) {
|
|
23529
|
-
|
|
23533
|
+
t1 = React.Children.toArray(children).filter(_temp);
|
|
23530
23534
|
$[0] = children;
|
|
23531
|
-
$[1] =
|
|
23535
|
+
$[1] = t1;
|
|
23532
23536
|
} else {
|
|
23533
|
-
|
|
23537
|
+
t1 = $[1];
|
|
23534
23538
|
}
|
|
23535
|
-
const drawerChildren =
|
|
23539
|
+
const drawerChildren = t1;
|
|
23536
23540
|
if (drawerChildren.length > 1) {
|
|
23537
23541
|
throw Error("Only one Drawer component is allowed in Scaffold");
|
|
23538
23542
|
}
|
|
23539
|
-
let
|
|
23543
|
+
let t2;
|
|
23540
23544
|
if ($[2] !== children) {
|
|
23541
|
-
|
|
23545
|
+
t2 = React.Children.toArray(children).filter(_temp2);
|
|
23542
23546
|
$[2] = children;
|
|
23543
|
-
$[3] =
|
|
23547
|
+
$[3] = t2;
|
|
23544
23548
|
} else {
|
|
23545
|
-
|
|
23549
|
+
t2 = $[3];
|
|
23546
23550
|
}
|
|
23547
|
-
const appBarChildren =
|
|
23551
|
+
const appBarChildren = t2;
|
|
23548
23552
|
if (appBarChildren.length > 1) {
|
|
23549
23553
|
throw Error("Only one AppBar component is allowed in Scaffold");
|
|
23550
23554
|
}
|
|
23551
|
-
let
|
|
23555
|
+
let t3;
|
|
23552
23556
|
if ($[4] !== children) {
|
|
23553
|
-
|
|
23557
|
+
t3 = React.Children.toArray(children).filter(_temp3);
|
|
23554
23558
|
$[4] = children;
|
|
23555
|
-
$[5] =
|
|
23559
|
+
$[5] = t3;
|
|
23556
23560
|
} else {
|
|
23557
|
-
|
|
23561
|
+
t3 = $[5];
|
|
23558
23562
|
}
|
|
23559
|
-
const otherChildren =
|
|
23563
|
+
const otherChildren = t3;
|
|
23560
23564
|
const includeDrawer = drawerChildren.length > 0;
|
|
23561
23565
|
const largeLayout = useLargeLayout();
|
|
23562
23566
|
const [drawerOpen, setDrawerOpen] = React.useState(false);
|
|
23563
23567
|
const [onHover, setOnHover] = React.useState(false);
|
|
23564
|
-
let
|
|
23568
|
+
let t4;
|
|
23565
23569
|
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23566
|
-
|
|
23567
|
-
$[6] =
|
|
23570
|
+
t4 = () => setOnHover(true);
|
|
23571
|
+
$[6] = t4;
|
|
23568
23572
|
} else {
|
|
23569
|
-
|
|
23573
|
+
t4 = $[6];
|
|
23570
23574
|
}
|
|
23571
|
-
const setOnHoverTrue =
|
|
23572
|
-
let
|
|
23575
|
+
const setOnHoverTrue = t4;
|
|
23576
|
+
let t5;
|
|
23573
23577
|
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23574
|
-
|
|
23575
|
-
$[7] =
|
|
23578
|
+
t5 = () => setOnHover(false);
|
|
23579
|
+
$[7] = t5;
|
|
23576
23580
|
} else {
|
|
23577
|
-
|
|
23581
|
+
t5 = $[7];
|
|
23578
23582
|
}
|
|
23579
|
-
const setOnHoverFalse =
|
|
23580
|
-
let
|
|
23583
|
+
const setOnHoverFalse = t5;
|
|
23584
|
+
let t6;
|
|
23581
23585
|
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23582
|
-
|
|
23586
|
+
t6 = () => {
|
|
23583
23587
|
setDrawerOpen(true);
|
|
23584
23588
|
};
|
|
23585
|
-
$[8] =
|
|
23589
|
+
$[8] = t6;
|
|
23586
23590
|
} else {
|
|
23587
|
-
|
|
23591
|
+
t6 = $[8];
|
|
23588
23592
|
}
|
|
23589
|
-
const handleDrawerOpen =
|
|
23590
|
-
let
|
|
23593
|
+
const handleDrawerOpen = t6;
|
|
23594
|
+
let t7;
|
|
23591
23595
|
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
23592
|
-
|
|
23596
|
+
t7 = () => {
|
|
23593
23597
|
setDrawerOpen(false);
|
|
23594
23598
|
};
|
|
23595
|
-
$[9] =
|
|
23599
|
+
$[9] = t7;
|
|
23596
23600
|
} else {
|
|
23597
|
-
|
|
23601
|
+
t7 = $[9];
|
|
23598
23602
|
}
|
|
23599
|
-
const handleDrawerClose =
|
|
23603
|
+
const handleDrawerClose = t7;
|
|
23600
23604
|
const computedDrawerOpen = drawerOpen || Boolean(largeLayout && autoOpenDrawer && onHover);
|
|
23601
23605
|
const hasAppBar = Boolean(appBarChildren.length > 0);
|
|
23602
|
-
let
|
|
23606
|
+
let t8;
|
|
23603
23607
|
if ($[10] !== autoOpenDrawer || $[11] !== computedDrawerOpen || $[12] !== includeDrawer || $[13] !== logo || $[14] !== onHover) {
|
|
23604
|
-
|
|
23608
|
+
t8 = {
|
|
23605
23609
|
logo,
|
|
23606
23610
|
hasDrawer: includeDrawer,
|
|
23607
23611
|
drawerHovered: onHover,
|
|
@@ -23615,21 +23619,21 @@
|
|
|
23615
23619
|
$[12] = includeDrawer;
|
|
23616
23620
|
$[13] = logo;
|
|
23617
23621
|
$[14] = onHover;
|
|
23618
|
-
$[15] =
|
|
23622
|
+
$[15] = t8;
|
|
23619
23623
|
} else {
|
|
23620
|
-
|
|
23624
|
+
t8 = $[15];
|
|
23621
23625
|
}
|
|
23622
|
-
let
|
|
23626
|
+
let t9;
|
|
23623
23627
|
if ($[16] !== className) {
|
|
23624
|
-
|
|
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);
|
|
23625
23629
|
$[16] = className;
|
|
23626
|
-
$[17] =
|
|
23630
|
+
$[17] = t9;
|
|
23627
23631
|
} else {
|
|
23628
|
-
|
|
23632
|
+
t9 = $[17];
|
|
23629
23633
|
}
|
|
23630
|
-
let
|
|
23634
|
+
let t10;
|
|
23631
23635
|
if ($[18] !== style) {
|
|
23632
|
-
|
|
23636
|
+
t10 = {
|
|
23633
23637
|
paddingTop: "env(safe-area-inset-top)",
|
|
23634
23638
|
paddingLeft: "env(safe-area-inset-left)",
|
|
23635
23639
|
paddingRight: "env(safe-area-inset-right)",
|
|
@@ -23638,96 +23642,101 @@
|
|
|
23638
23642
|
...style
|
|
23639
23643
|
};
|
|
23640
23644
|
$[18] = style;
|
|
23641
|
-
$[19] =
|
|
23645
|
+
$[19] = t10;
|
|
23642
23646
|
} else {
|
|
23643
|
-
|
|
23647
|
+
t10 = $[19];
|
|
23644
23648
|
}
|
|
23645
|
-
const
|
|
23646
|
-
let
|
|
23647
|
-
if ($[20] !== computedDrawerOpen || $[21] !== includeDrawer || $[22] !== onHover || $[23] !==
|
|
23648
|
-
|
|
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 });
|
|
23649
23653
|
$[20] = computedDrawerOpen;
|
|
23650
23654
|
$[21] = includeDrawer;
|
|
23651
23655
|
$[22] = onHover;
|
|
23652
|
-
$[23] =
|
|
23653
|
-
$[24] =
|
|
23656
|
+
$[23] = t11;
|
|
23657
|
+
$[24] = t12;
|
|
23654
23658
|
} else {
|
|
23655
|
-
|
|
23659
|
+
t12 = $[24];
|
|
23656
23660
|
}
|
|
23657
|
-
let
|
|
23661
|
+
let t13;
|
|
23658
23662
|
if ($[25] !== hasAppBar) {
|
|
23659
|
-
|
|
23663
|
+
t13 = hasAppBar && /* @__PURE__ */ jsxRuntime.jsx(DrawerHeader, {});
|
|
23660
23664
|
$[25] = hasAppBar;
|
|
23661
|
-
$[26] =
|
|
23665
|
+
$[26] = t13;
|
|
23662
23666
|
} else {
|
|
23663
|
-
|
|
23667
|
+
t13 = $[26];
|
|
23664
23668
|
}
|
|
23665
|
-
const
|
|
23666
|
-
|
|
23667
|
-
|
|
23668
|
-
|
|
23669
|
-
|
|
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
|
|
23670
23677
|
});
|
|
23671
|
-
$[27] =
|
|
23678
|
+
$[27] = padding;
|
|
23672
23679
|
$[28] = t14;
|
|
23680
|
+
$[29] = t15;
|
|
23681
|
+
$[30] = t16;
|
|
23673
23682
|
} else {
|
|
23674
|
-
|
|
23683
|
+
t16 = $[30];
|
|
23675
23684
|
}
|
|
23676
|
-
let
|
|
23677
|
-
if ($[
|
|
23678
|
-
|
|
23679
|
-
$[
|
|
23680
|
-
$[
|
|
23685
|
+
let t17;
|
|
23686
|
+
if ($[31] !== otherChildren) {
|
|
23687
|
+
t17 = /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: otherChildren });
|
|
23688
|
+
$[31] = otherChildren;
|
|
23689
|
+
$[32] = t17;
|
|
23681
23690
|
} else {
|
|
23682
|
-
|
|
23691
|
+
t17 = $[32];
|
|
23683
23692
|
}
|
|
23684
|
-
let
|
|
23685
|
-
if ($[
|
|
23686
|
-
|
|
23687
|
-
$[31] = t14;
|
|
23688
|
-
$[32] = t15;
|
|
23693
|
+
let t18;
|
|
23694
|
+
if ($[33] !== t16 || $[34] !== t17) {
|
|
23695
|
+
t18 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: t16, children: t17 });
|
|
23689
23696
|
$[33] = t16;
|
|
23697
|
+
$[34] = t17;
|
|
23698
|
+
$[35] = t18;
|
|
23690
23699
|
} else {
|
|
23691
|
-
|
|
23700
|
+
t18 = $[35];
|
|
23692
23701
|
}
|
|
23693
|
-
let
|
|
23694
|
-
if ($[
|
|
23695
|
-
|
|
23696
|
-
|
|
23697
|
-
|
|
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
|
|
23698
23707
|
] });
|
|
23699
|
-
$[
|
|
23700
|
-
$[
|
|
23701
|
-
$[
|
|
23708
|
+
$[36] = t13;
|
|
23709
|
+
$[37] = t18;
|
|
23710
|
+
$[38] = t19;
|
|
23702
23711
|
} else {
|
|
23703
|
-
|
|
23712
|
+
t19 = $[38];
|
|
23704
23713
|
}
|
|
23705
|
-
let
|
|
23706
|
-
if ($[
|
|
23707
|
-
|
|
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: [
|
|
23708
23717
|
appBarChildren,
|
|
23709
|
-
|
|
23710
|
-
|
|
23718
|
+
t12,
|
|
23719
|
+
t19
|
|
23711
23720
|
] });
|
|
23712
|
-
$[
|
|
23713
|
-
$[
|
|
23714
|
-
$[
|
|
23715
|
-
$[
|
|
23716
|
-
$[
|
|
23717
|
-
$[
|
|
23721
|
+
$[39] = appBarChildren;
|
|
23722
|
+
$[40] = t10;
|
|
23723
|
+
$[41] = t12;
|
|
23724
|
+
$[42] = t19;
|
|
23725
|
+
$[43] = t9;
|
|
23726
|
+
$[44] = t20;
|
|
23718
23727
|
} else {
|
|
23719
|
-
|
|
23728
|
+
t20 = $[44];
|
|
23720
23729
|
}
|
|
23721
|
-
let
|
|
23722
|
-
if ($[
|
|
23723
|
-
|
|
23724
|
-
$[
|
|
23725
|
-
$[
|
|
23726
|
-
$[
|
|
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;
|
|
23727
23736
|
} else {
|
|
23728
|
-
|
|
23737
|
+
t21 = $[47];
|
|
23729
23738
|
}
|
|
23730
|
-
return
|
|
23739
|
+
return t21;
|
|
23731
23740
|
}, equal);
|
|
23732
23741
|
const DrawerHeader = () => {
|
|
23733
23742
|
const $ = reactCompilerRuntime.c(1);
|