@firecms/core 3.0.0-canary.163 → 3.0.0-canary.165

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/index.es.js CHANGED
@@ -352,6 +352,7 @@ function isPropertyBuilder(propertyOrBuilder) {
352
352
  function getDefaultValuesFor(properties) {
353
353
  if (!properties) return {};
354
354
  return Object.entries(properties).map(([key, property]) => {
355
+ if (!property) return {};
355
356
  const value = getDefaultValueFor(property);
356
357
  return value === void 0 ? {} : {
357
358
  [key]: value
@@ -362,6 +363,7 @@ function getDefaultValuesFor(properties) {
362
363
  }), {});
363
364
  }
364
365
  function getDefaultValueFor(property) {
366
+ if (!property) return void 0;
365
367
  if (isPropertyBuilder(property)) return void 0;
366
368
  if (property.defaultValue || property.defaultValue === null) {
367
369
  return property.defaultValue;
@@ -6855,15 +6857,17 @@ const EntityCollectionRowActions = function EntityCollectionRowActions2({
6855
6857
  const hasCollapsedActions = actions.some((a) => a.collapsed || a.collapsed === void 0);
6856
6858
  const collapsedActions = actions.filter((a_0) => a_0.collapsed || a_0.collapsed === void 0);
6857
6859
  const uncollapsedActions = actions.filter((a_1) => a_1.collapsed === false);
6858
- return /* @__PURE__ */ jsxs("div", { className: cls("h-full flex items-center justify-center flex-col bg-surface-50 dark:bg-surface-900 bg-opacity-90 dark:bg-opacity-90 z-10", frozen ? "sticky left-0" : ""), style: {
6860
+ return /* @__PURE__ */ jsxs("div", { className: cls("h-full flex items-center justify-center flex-col bg-surface-50 dark:bg-surface-900 bg-opacity-90 dark:bg-opacity-90 z-10", frozen ? "sticky left-0" : ""), onClick: useCallback((event) => {
6861
+ event.stopPropagation();
6862
+ }, []), style: {
6859
6863
  width,
6860
6864
  position: frozen ? "sticky" : "initial",
6861
6865
  left: frozen ? 0 : "initial",
6862
6866
  contain: "strict"
6863
6867
  }, children: [
6864
6868
  (hasActions || selectionEnabled) && /* @__PURE__ */ jsxs("div", { className: "w-34 flex justify-center", children: [
6865
- uncollapsedActions.map((action, index) => /* @__PURE__ */ jsx(Tooltip, { title: action.name, asChild: true, children: /* @__PURE__ */ jsx(IconButton, { onClick: (event) => {
6866
- event.stopPropagation();
6869
+ uncollapsedActions.map((action, index) => /* @__PURE__ */ jsx(Tooltip, { title: action.name, asChild: true, children: /* @__PURE__ */ jsx(IconButton, { onClick: (event_0) => {
6870
+ event_0.stopPropagation();
6867
6871
  action.onClick({
6868
6872
  entity,
6869
6873
  fullPath,
@@ -6893,8 +6897,8 @@ const EntityCollectionRowActions = function EntityCollectionRowActions2({
6893
6897
  ] }, index_0)) }),
6894
6898
  selectionEnabled && /* @__PURE__ */ jsx(Tooltip, { title: `Select ${entity.id}`, children: /* @__PURE__ */ jsx(Checkbox, { size: largeLayout ? "medium" : "small", checked: Boolean(isSelected), onCheckedChange }) })
6895
6899
  ] }),
6896
- !hideId && size !== "xs" && /* @__PURE__ */ jsx("div", { className: "w-[138px] text-center overflow-hidden truncate font-mono text-xs text-text-secondary dark:text-text-secondary-dark max-w-full text-ellipsis px-2", onClick: (event_0) => {
6897
- event_0.stopPropagation();
6900
+ !hideId && size !== "xs" && /* @__PURE__ */ jsx("div", { className: "w-[138px] text-center overflow-hidden truncate font-mono text-xs text-text-secondary dark:text-text-secondary-dark max-w-full text-ellipsis px-2", onClick: (event_1) => {
6901
+ event_1.stopPropagation();
6898
6902
  }, children: entity ? entity.id : /* @__PURE__ */ jsx(Skeleton, {}) })
6899
6903
  ] });
6900
6904
  };
@@ -12873,7 +12877,7 @@ function useApp() {
12873
12877
  return React__default.useContext(AppContext);
12874
12878
  }
12875
12879
  const DefaultAppBar = function DefaultAppBar2(t0) {
12876
- const $ = c(45);
12880
+ const $ = c(44);
12877
12881
  const {
12878
12882
  title,
12879
12883
  endAdornment,
@@ -12957,58 +12961,57 @@ const DefaultAppBar = function DefaultAppBar2(t0) {
12957
12961
  t5 = $[12];
12958
12962
  }
12959
12963
  let t6;
12960
- if ($[13] !== drawerOpen || $[14] !== hasDrawer || $[15] !== logo || $[16] !== navigation || $[17] !== title) {
12961
- t6 = navigation && /* @__PURE__ */ jsx("div", { className: "mr-8 hidden lg:block", children: /* @__PURE__ */ jsx(Link, { className: "visited:text-inherit visited:dark:text-inherit", to: navigation?.basePath ?? "/", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-4", children: [
12964
+ if ($[13] !== hasDrawer || $[14] !== logo || $[15] !== navigation || $[16] !== title) {
12965
+ t6 = navigation && /* @__PURE__ */ jsx("div", { className: "mr-8 hidden lg:block", children: /* @__PURE__ */ jsx(Link, { className: "visited:text-inherit visited:dark:text-inherit block", to: navigation?.basePath ?? "/", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-4", children: [
12962
12966
  !hasDrawer && (logo ? /* @__PURE__ */ jsx("img", { src: logo, alt: "Logo", className: cls("w-[32px] h-[32px] object-contain") }) : /* @__PURE__ */ jsx(FireCMSLogo, { width: "32px", height: "32px" })),
12963
- typeof title === "string" ? /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", noWrap: true, className: cls("transition-all", drawerOpen ? "ml-2" : ""), children: title }) : title
12967
+ typeof title === "string" ? /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", noWrap: true, children: title }) : title
12964
12968
  ] }) }) });
12965
- $[13] = drawerOpen;
12966
- $[14] = hasDrawer;
12967
- $[15] = logo;
12968
- $[16] = navigation;
12969
- $[17] = title;
12970
- $[18] = t6;
12969
+ $[13] = hasDrawer;
12970
+ $[14] = logo;
12971
+ $[15] = navigation;
12972
+ $[16] = title;
12973
+ $[17] = t6;
12971
12974
  } else {
12972
- t6 = $[18];
12975
+ t6 = $[17];
12973
12976
  }
12974
12977
  let t7;
12975
- if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
12978
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
12976
12979
  t7 = /* @__PURE__ */ jsx("div", { className: "flex-grow" });
12977
- $[19] = t7;
12980
+ $[18] = t7;
12978
12981
  } else {
12979
- t7 = $[19];
12982
+ t7 = $[18];
12980
12983
  }
12981
12984
  let t8;
12982
- if ($[20] !== endAdornment) {
12985
+ if ($[19] !== endAdornment) {
12983
12986
  t8 = endAdornment && /* @__PURE__ */ jsx(ErrorBoundary, { children: endAdornment });
12984
- $[20] = endAdornment;
12985
- $[21] = t8;
12987
+ $[19] = endAdornment;
12988
+ $[20] = t8;
12986
12989
  } else {
12987
- t8 = $[21];
12990
+ t8 = $[20];
12988
12991
  }
12989
12992
  let t9;
12990
- if ($[22] !== includeModeToggle || $[23] !== mode || $[24] !== toggleMode) {
12993
+ if ($[21] !== includeModeToggle || $[22] !== mode || $[23] !== toggleMode) {
12991
12994
  t9 = includeModeToggle && /* @__PURE__ */ jsx(IconButton, { color: "inherit", "aria-label": "Open drawer", onClick: toggleMode, size: "large", children: mode === "dark" ? /* @__PURE__ */ jsx(DarkModeIcon, {}) : /* @__PURE__ */ jsx(LightModeIcon, {}) });
12992
- $[22] = includeModeToggle;
12993
- $[23] = mode;
12994
- $[24] = toggleMode;
12995
- $[25] = t9;
12995
+ $[21] = includeModeToggle;
12996
+ $[22] = mode;
12997
+ $[23] = toggleMode;
12998
+ $[24] = t9;
12996
12999
  } else {
12997
- t9 = $[25];
13000
+ t9 = $[24];
12998
13001
  }
12999
13002
  let t10;
13000
- if ($[26] !== user) {
13003
+ if ($[25] !== user) {
13001
13004
  t10 = user && /* @__PURE__ */ jsxs("div", { className: "px-4 py-2 mb-2", children: [
13002
13005
  user.displayName && /* @__PURE__ */ jsx(Typography, { variant: "body1", color: "secondary", children: user.displayName }),
13003
13006
  user.email && /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "secondary", children: user.email })
13004
13007
  ] });
13005
- $[26] = user;
13006
- $[27] = t10;
13008
+ $[25] = user;
13009
+ $[26] = t10;
13007
13010
  } else {
13008
- t10 = $[27];
13011
+ t10 = $[26];
13009
13012
  }
13010
13013
  let t11;
13011
- if ($[28] !== authController || $[29] !== dropDownActions || $[30] !== navigate) {
13014
+ if ($[27] !== authController || $[28] !== dropDownActions || $[29] !== navigate) {
13012
13015
  t11 = !dropDownActions && /* @__PURE__ */ jsxs(MenuItem, { onClick: async () => {
13013
13016
  await authController.signOut();
13014
13017
  navigate("/");
@@ -13016,30 +13019,30 @@ const DefaultAppBar = function DefaultAppBar2(t0) {
13016
13019
  /* @__PURE__ */ jsx(LogoutIcon, {}),
13017
13020
  "Log Out"
13018
13021
  ] });
13019
- $[28] = authController;
13020
- $[29] = dropDownActions;
13021
- $[30] = navigate;
13022
- $[31] = t11;
13022
+ $[27] = authController;
13023
+ $[28] = dropDownActions;
13024
+ $[29] = navigate;
13025
+ $[30] = t11;
13023
13026
  } else {
13024
- t11 = $[31];
13027
+ t11 = $[30];
13025
13028
  }
13026
13029
  let t12;
13027
- if ($[32] !== avatarComponent || $[33] !== dropDownActions || $[34] !== t10 || $[35] !== t11) {
13030
+ if ($[31] !== avatarComponent || $[32] !== dropDownActions || $[33] !== t10 || $[34] !== t11) {
13028
13031
  t12 = /* @__PURE__ */ jsxs(Menu, { trigger: avatarComponent, children: [
13029
13032
  t10,
13030
13033
  dropDownActions,
13031
13034
  t11
13032
13035
  ] });
13033
- $[32] = avatarComponent;
13034
- $[33] = dropDownActions;
13035
- $[34] = t10;
13036
- $[35] = t11;
13037
- $[36] = t12;
13036
+ $[31] = avatarComponent;
13037
+ $[32] = dropDownActions;
13038
+ $[33] = t10;
13039
+ $[34] = t11;
13040
+ $[35] = t12;
13038
13041
  } else {
13039
- t12 = $[36];
13042
+ t12 = $[35];
13040
13043
  }
13041
13044
  let t13;
13042
- if ($[37] !== startAdornment || $[38] !== style || $[39] !== t12 || $[40] !== t5 || $[41] !== t6 || $[42] !== t8 || $[43] !== t9) {
13045
+ if ($[36] !== startAdornment || $[37] !== style || $[38] !== t12 || $[39] !== t5 || $[40] !== t6 || $[41] !== t8 || $[42] !== t9) {
13043
13046
  t13 = /* @__PURE__ */ jsxs("div", { style, className: t5, children: [
13044
13047
  t6,
13045
13048
  startAdornment,
@@ -13048,16 +13051,16 @@ const DefaultAppBar = function DefaultAppBar2(t0) {
13048
13051
  t9,
13049
13052
  t12
13050
13053
  ] });
13051
- $[37] = startAdornment;
13052
- $[38] = style;
13053
- $[39] = t12;
13054
- $[40] = t5;
13055
- $[41] = t6;
13056
- $[42] = t8;
13057
- $[43] = t9;
13058
- $[44] = t13;
13054
+ $[36] = startAdornment;
13055
+ $[37] = style;
13056
+ $[38] = t12;
13057
+ $[39] = t5;
13058
+ $[40] = t6;
13059
+ $[41] = t8;
13060
+ $[42] = t9;
13061
+ $[43] = t13;
13059
13062
  } else {
13060
- t13 = $[44];
13063
+ t13 = $[43];
13061
13064
  }
13062
13065
  return t13;
13063
13066
  };
@@ -22372,7 +22375,7 @@ function DrawerLogo(t0) {
22372
22375
  }
22373
22376
  let t3;
22374
22377
  if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
22375
- t3 = cls("cursor-pointer ml-3 mr-1");
22378
+ t3 = cls("cursor-pointer rounded ml-3 mr-1");
22376
22379
  $[2] = t3;
22377
22380
  } else {
22378
22381
  t3 = $[2];
@@ -22388,7 +22391,7 @@ function DrawerLogo(t0) {
22388
22391
  }
22389
22392
  let t5;
22390
22393
  if ($[6] !== navigation.basePath || $[7] !== t4) {
22391
- t5 = /* @__PURE__ */ jsx(Tooltip, { title: "Home", sideOffset: 20, side: "right", children: /* @__PURE__ */ jsx(Link, { to: navigation.basePath, children: t4 }) });
22394
+ t5 = /* @__PURE__ */ jsx(Tooltip, { title: "Home", sideOffset: 20, side: "right", children: /* @__PURE__ */ jsx(Link, { className: "block", to: navigation.basePath, children: t4 }) });
22392
22395
  $[6] = navigation.basePath;
22393
22396
  $[7] = t4;
22394
22397
  $[8] = t5;