@firecms/core 3.0.0-canary.4 → 3.0.0-canary.6

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.
Files changed (48) hide show
  1. package/dist/components/index.d.ts +0 -1
  2. package/dist/core/SideEntityView.d.ts +7 -0
  3. package/dist/core/index.d.ts +0 -2
  4. package/dist/form/components/index.d.ts +1 -0
  5. package/dist/form/index.d.ts +1 -0
  6. package/dist/hooks/index.d.ts +2 -1
  7. package/dist/{core → hooks}/useBuildModeController.d.ts +1 -1
  8. package/dist/index.es.js +100 -100
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/index.umd.js +4 -4
  11. package/dist/index.umd.js.map +1 -1
  12. package/dist/internal/useBuildDataSource.d.ts +4 -0
  13. package/dist/types/entities.d.ts +1 -1
  14. package/dist/util/entities.d.ts +1 -1
  15. package/package.json +4 -4
  16. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +2 -1
  17. package/src/components/index.tsx +0 -1
  18. package/src/core/EntitySidePanel.tsx +1 -1
  19. package/src/{internal → core}/EntityView.tsx +2 -2
  20. package/src/core/SideEntityView.tsx +38 -0
  21. package/src/core/index.tsx +0 -2
  22. package/src/form/components/index.tsx +1 -0
  23. package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +2 -3
  24. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +4 -3
  25. package/src/form/field_bindings/BlockFieldBinding.tsx +2 -3
  26. package/src/form/field_bindings/DateTimeFieldBinding.tsx +3 -3
  27. package/src/form/field_bindings/KeyValueFieldBinding.tsx +3 -3
  28. package/src/form/field_bindings/MapFieldBinding.tsx +2 -2
  29. package/src/form/field_bindings/MarkdownFieldBinding.tsx +1 -2
  30. package/src/form/field_bindings/MultiSelectBinding.tsx +2 -3
  31. package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +2 -2
  32. package/src/form/field_bindings/ReferenceFieldBinding.tsx +4 -3
  33. package/src/form/field_bindings/RepeatFieldBinding.tsx +3 -3
  34. package/src/form/field_bindings/SelectFieldBinding.tsx +2 -3
  35. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +3 -3
  36. package/src/form/field_bindings/SwitchFieldBinding.tsx +2 -3
  37. package/src/form/field_bindings/TextFieldBinding.tsx +3 -4
  38. package/src/form/index.tsx +1 -0
  39. package/src/hooks/index.tsx +3 -1
  40. package/src/{core → hooks}/useBuildModeController.tsx +1 -1
  41. package/src/internal/useBuildDataSource.ts +6 -1
  42. package/src/types/entities.ts +1 -1
  43. package/src/util/entities.ts +1 -1
  44. /package/dist/{internal → core}/EntityView.d.ts +0 -0
  45. /package/dist/{components → form/components}/LabelWithIcon.d.ts +0 -0
  46. /package/dist/{core → hooks}/useBuildLocalConfigurationPersistence.d.ts +0 -0
  47. /package/src/{components → form/components}/LabelWithIcon.tsx +0 -0
  48. /package/src/{core → hooks}/useBuildLocalConfigurationPersistence.tsx +0 -0
@@ -20,5 +20,4 @@ export * from "./FireCMSLogo";
20
20
  export * from "./FireCMSAppBar";
21
21
  export * from "./ArrayContainer";
22
22
  export * from "./ReferenceWidget";
23
- export * from "./LabelWithIcon";
24
23
  export * from "./SearchIconsView";
@@ -0,0 +1,7 @@
1
+ import { EntityViewProps } from "./EntityView";
2
+ import { User } from "../types";
3
+ export type SideEntityViewProps<M extends Record<string, any>> = EntityViewProps<M> & {
4
+ formWidth?: number | string;
5
+ onClose?: () => void;
6
+ };
7
+ export declare function SideEntityView<M extends Record<string, any>, UserType extends User>({ path, entityId, selectedSubPath, copy, collection, parentCollectionIds, onValuesAreModified, formWidth, onUpdate, onClose }: SideEntityViewProps<M>): import("react/jsx-runtime").JSX.Element;
@@ -6,5 +6,3 @@ export { Drawer, DrawerNavigationItem } from "./Drawer";
6
6
  export * from "./field_configs";
7
7
  export * from "./SideDialogs";
8
8
  export * from "./NavigationRoutes";
9
- export * from "./useBuildModeController";
10
- export * from "./useBuildLocalConfigurationPersistence";
@@ -1,2 +1,3 @@
1
1
  export * from "./FormikArrayContainer";
2
2
  export * from "./FieldHelperText";
3
+ export * from "./LabelWithIcon";
@@ -18,3 +18,4 @@ export * from "./components";
18
18
  export type { EntityFormProps } from "./EntityForm";
19
19
  export { EntityForm } from "./EntityForm";
20
20
  export { PropertyFieldBinding } from "./PropertyFieldBinding";
21
+ export * from "./useClearRestoreValue";
@@ -3,7 +3,6 @@ export * from "./data/useCollectionFetch";
3
3
  export * from "./data/useEntityFetch";
4
4
  export * from "./data/save";
5
5
  export * from "./data/delete";
6
- export * from "../form/useClearRestoreValue";
7
6
  export * from "./useNavigationController";
8
7
  export * from "./useResolvedNavigationFrom";
9
8
  export * from "./useStorageSource";
@@ -19,3 +18,5 @@ export * from "./useReferenceDialog";
19
18
  export * from "./useBrowserTitleAndIcon";
20
19
  export * from "./useCustomizationController";
21
20
  export * from "./useBuildNavigationController";
21
+ export * from "./useBuildLocalConfigurationPersistence";
22
+ export * from "./useBuildModeController";
@@ -1,4 +1,4 @@
1
- import { ModeController } from "../hooks";
1
+ import { ModeController } from "./index";
2
2
  /**
3
3
  * Use this hook to build a color mode controller that determines
4
4
  * the theme of the CMS
package/dist/index.es.js CHANGED
@@ -3400,16 +3400,6 @@ async function Ss({
3400
3400
  }
3401
3401
  }).catch((u) => (a && a(t, u), !1));
3402
3402
  }
3403
- function Le({
3404
- property: e,
3405
- value: t,
3406
- setValue: r
3407
- }) {
3408
- const i = ce(null);
3409
- O(() => {
3410
- typeof e.disabled == "object" && !!e.disabled.clearOnDisabled ? t != null && (i.current = t, r(null)) : i.current && (r(i.current), i.current = null);
3411
- }, [e]);
3412
- }
3413
3403
  function Is({
3414
3404
  path: e,
3415
3405
  context: t
@@ -6140,6 +6130,16 @@ const Il = ({
6140
6130
  },
6141
6131
  (e, t) => e.error === t.error && e.value === t.value && e.disabled === t.disabled && e.saved === t.saved && e.allowScroll === t.allowScroll && e.align === t.align && e.size === t.size && e.disabledTooltip === t.disabledTooltip && e.width === t.width && e.showExpandIcon === t.showExpandIcon && e.removePadding === t.removePadding && e.fullHeight === t.fullHeight && e.selected === t.selected
6142
6132
  ), vo = I.createContext({}), Nl = () => je(vo);
6133
+ function Le({
6134
+ property: e,
6135
+ value: t,
6136
+ setValue: r
6137
+ }) {
6138
+ const i = ce(null);
6139
+ O(() => {
6140
+ typeof e.disabled == "object" && !!e.disabled.clearOnDisabled ? t != null && (i.current = t, r(null)) : i.current && (r(i.current), i.current = null);
6141
+ }, [e]);
6142
+ }
6143
6143
  function Fl(e) {
6144
6144
  return e.dataType === "string" && e.storage ? !0 : e.dataType === "array" ? Array.isArray(e.of) ? !1 : e.of?.dataType === "string" && e.of?.storage : !1;
6145
6145
  }
@@ -8426,6 +8426,30 @@ function Te({
8426
8426
  )
8427
8427
  ] });
8428
8428
  }
8429
+ function Oe({
8430
+ icon: e,
8431
+ title: t,
8432
+ small: r,
8433
+ className: i,
8434
+ required: o
8435
+ }) {
8436
+ return /* @__PURE__ */ _(
8437
+ "span",
8438
+ {
8439
+ className: `inline-flex items-center my-0.5 ${r ? "gap-1" : "gap-2"} ${i ?? ""}`,
8440
+ children: [
8441
+ e,
8442
+ /* @__PURE__ */ n(
8443
+ "span",
8444
+ {
8445
+ className: `text-start font-medium text-${r ? "base" : "sm"} origin-top-left transform ${r ? "translate-x-2 scale-75" : ""}`,
8446
+ children: (t ?? "") + (o ? " *" : "")
8447
+ }
8448
+ )
8449
+ ]
8450
+ }
8451
+ );
8452
+ }
8429
8453
  function Ki({
8430
8454
  propertyKey: e,
8431
8455
  value: t,
@@ -13914,30 +13938,6 @@ function Ru({
13914
13938
  }
13915
13939
  );
13916
13940
  }
13917
- function Oe({
13918
- icon: e,
13919
- title: t,
13920
- small: r,
13921
- className: i,
13922
- required: o
13923
- }) {
13924
- return /* @__PURE__ */ _(
13925
- "span",
13926
- {
13927
- className: `inline-flex items-center my-0.5 ${r ? "gap-1" : "gap-2"} ${i ?? ""}`,
13928
- children: [
13929
- e,
13930
- /* @__PURE__ */ n(
13931
- "span",
13932
- {
13933
- className: `text-start font-medium text-${r ? "base" : "sm"} origin-top-left transform ${r ? "translate-x-2 scale-75" : ""}`,
13934
- children: (t ?? "") + (o ? " *" : "")
13935
- }
13936
- )
13937
- ]
13938
- }
13939
- );
13940
- }
13941
13941
  const od = 220;
13942
13942
  process.env.NODE_ENV !== "production" && Object.keys(Ln).forEach((e) => {
13943
13943
  Lr.includes(e) || console.warn(`The icon ${e} no longer exists. Remove it from \`icon_synonyms\``);
@@ -14246,6 +14246,61 @@ async function dd(e, t, r) {
14246
14246
  dataSource: r
14247
14247
  }) : Array.isArray(e) && (i = e), i;
14248
14248
  }
14249
+ function Mu() {
14250
+ const [e, t] = Q({}), r = k((p) => {
14251
+ const h = localStorage.getItem(p);
14252
+ return h ? JSON.parse(h) : {};
14253
+ }, []), i = k((p) => {
14254
+ const h = `collection_config::${Oi(p)}`;
14255
+ return e[h] ? e[h] : r(h);
14256
+ }, [e, r]), o = k((p, h) => {
14257
+ const A = `collection_config::${Oi(p)}`;
14258
+ localStorage.setItem(A, JSON.stringify(h)), t((y) => {
14259
+ const b = y[A], w = We(b ?? r(p), h);
14260
+ return We(y, w);
14261
+ });
14262
+ }, [r]), [a, s] = Q([]), [l, c] = Q([]), [d, u] = Q([]);
14263
+ O(() => {
14264
+ s(localStorage.getItem("recently_visited_paths") ? JSON.parse(localStorage.getItem("recently_visited_paths")) : []), c(localStorage.getItem("favourite_paths") ? JSON.parse(localStorage.getItem("favourite_paths")) : []), u(localStorage.getItem("collapsed_groups") ? JSON.parse(localStorage.getItem("collapsed_groups")) : []);
14265
+ }, []);
14266
+ const f = k((p) => {
14267
+ localStorage.setItem("recently_visited_paths", JSON.stringify(p)), s(p);
14268
+ }, []), m = k((p) => {
14269
+ localStorage.setItem("favourite_paths", JSON.stringify(p)), c(p);
14270
+ }, []), g = k((p) => {
14271
+ localStorage.setItem("collapsed_groups", JSON.stringify(p)), u(p);
14272
+ }, []);
14273
+ return {
14274
+ onCollectionModified: o,
14275
+ getCollectionConfig: i,
14276
+ recentlyVisitedPaths: a,
14277
+ setRecentlyVisitedPaths: f,
14278
+ favouritePaths: l,
14279
+ setFavouritePaths: m,
14280
+ collapsedGroups: d,
14281
+ setCollapsedGroups: g
14282
+ };
14283
+ }
14284
+ function zu() {
14285
+ const e = typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)"), r = (localStorage.getItem("prefers-dark-mode") != null ? localStorage.getItem("prefers-dark-mode") === "true" : null) ?? e, [i, o] = Q(r ? "dark" : "light");
14286
+ O(() => {
14287
+ o(r ? "dark" : "light"), l(r ? "dark" : "light");
14288
+ }, [r]);
14289
+ const a = k(() => {
14290
+ o("dark"), l("dark");
14291
+ }, [e]), s = k(() => {
14292
+ o("light"), l("light");
14293
+ }, []), l = (d) => {
14294
+ document.body.style.setProperty("color-scheme", d), document.documentElement.dataset.theme = d;
14295
+ }, c = k(() => {
14296
+ i === "light" ? (e ? localStorage.removeItem("prefers-dark-mode") : localStorage.setItem("prefers-dark-mode", "true"), a()) : (e ? localStorage.setItem("prefers-dark-mode", "false") : localStorage.removeItem("prefers-dark-mode"), s());
14297
+ }, [i, e]);
14298
+ return {
14299
+ mode: i,
14300
+ setMode: o,
14301
+ toggleMode: c
14302
+ };
14303
+ }
14249
14304
  const Lt = "main_##Q$SC^#S6";
14250
14305
  function ud({
14251
14306
  path: e,
@@ -14684,7 +14739,7 @@ const jo = I.createContext({
14684
14739
  close: () => {
14685
14740
  }
14686
14741
  }), wi = () => je(jo);
14687
- function Mu() {
14742
+ function Vu() {
14688
14743
  const t = pr().sidePanels, r = [...t];
14689
14744
  return r.push(void 0), /* @__PURE__ */ n(z, { children: r.map((i, o) => /* @__PURE__ */ n(
14690
14745
  fd,
@@ -15198,7 +15253,7 @@ function vd({
15198
15253
  };
15199
15254
  }
15200
15255
  function qr(e, t, r, i, o) {
15201
- return e === void 0 ? o() : Array.isArray(e) ? e.map((a) => qr(a, t, r, i, o)) : e.isEntityReference && e.isEntityReference() ? t(e) : e instanceof si ? r(e) : e instanceof Date ? i(e) : e && typeof e == "object" ? Object.entries(e).map(([a, s]) => ({ [a]: qr(s, t, r, i, o) })).reduce((a, s) => ({ ...a, ...s }), {}) : e;
15256
+ return e === void 0 ? o() : e === null ? null : Array.isArray(e) ? e.map((a) => qr(a, t, r, i, o)) : e.isEntityReference && e.isEntityReference() ? t(e) : e instanceof si ? r(e) : e instanceof Date ? i(e) : e && typeof e == "object" ? Object.entries(e).map(([a, s]) => ({ [a]: qr(s, t, r, i, o) })).reduce((a, s) => ({ ...a, ...s }), {}) : e;
15202
15257
  }
15203
15258
  const _d = "https://api-drplyi3b6q-ey.a.run.app";
15204
15259
  async function kd(e) {
@@ -15223,7 +15278,7 @@ function xd(e) {
15223
15278
  e.user && e.user.uid !== t.current && !e.initialLoading && (kd(e), t.current = e.user.uid);
15224
15279
  }, [e]);
15225
15280
  }
15226
- function zu(e) {
15281
+ function Gu(e) {
15227
15282
  const t = ao(), {
15228
15283
  children: r,
15229
15284
  entityLinkBuilder: i,
@@ -15463,7 +15518,7 @@ function an({
15463
15518
  }
15464
15519
  );
15465
15520
  }
15466
- const Cd = 280, Vu = I.memo(
15521
+ const Cd = 280, ju = I.memo(
15467
15522
  function(t) {
15468
15523
  const {
15469
15524
  children: r,
@@ -15984,7 +16039,7 @@ function ki(e) {
15984
16039
  function qo(e) {
15985
16040
  return e.propertyConfig ? e.propertyConfig : ki(e);
15986
16041
  }
15987
- const Gu = I.memo(
16042
+ const Yu = I.memo(
15988
16043
  function({
15989
16044
  HomePage: t = Xc,
15990
16045
  customRoutes: r
@@ -16047,61 +16102,6 @@ const Gu = I.memo(
16047
16102
  },
16048
16103
  "navigation_view_" + e
16049
16104
  );
16050
- function ju() {
16051
- const e = typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)"), r = (localStorage.getItem("prefers-dark-mode") != null ? localStorage.getItem("prefers-dark-mode") === "true" : null) ?? e, [i, o] = Q(r ? "dark" : "light");
16052
- O(() => {
16053
- o(r ? "dark" : "light"), l(r ? "dark" : "light");
16054
- }, [r]);
16055
- const a = k(() => {
16056
- o("dark"), l("dark");
16057
- }, [e]), s = k(() => {
16058
- o("light"), l("light");
16059
- }, []), l = (d) => {
16060
- document.body.style.setProperty("color-scheme", d), document.documentElement.dataset.theme = d;
16061
- }, c = k(() => {
16062
- i === "light" ? (e ? localStorage.removeItem("prefers-dark-mode") : localStorage.setItem("prefers-dark-mode", "true"), a()) : (e ? localStorage.setItem("prefers-dark-mode", "false") : localStorage.removeItem("prefers-dark-mode"), s());
16063
- }, [i, e]);
16064
- return {
16065
- mode: i,
16066
- setMode: o,
16067
- toggleMode: c
16068
- };
16069
- }
16070
- function Yu() {
16071
- const [e, t] = Q({}), r = k((p) => {
16072
- const h = localStorage.getItem(p);
16073
- return h ? JSON.parse(h) : {};
16074
- }, []), i = k((p) => {
16075
- const h = `collection_config::${Oi(p)}`;
16076
- return e[h] ? e[h] : r(h);
16077
- }, [e, r]), o = k((p, h) => {
16078
- const A = `collection_config::${Oi(p)}`;
16079
- localStorage.setItem(A, JSON.stringify(h)), t((y) => {
16080
- const b = y[A], w = We(b ?? r(p), h);
16081
- return We(y, w);
16082
- });
16083
- }, [r]), [a, s] = Q([]), [l, c] = Q([]), [d, u] = Q([]);
16084
- O(() => {
16085
- s(localStorage.getItem("recently_visited_paths") ? JSON.parse(localStorage.getItem("recently_visited_paths")) : []), c(localStorage.getItem("favourite_paths") ? JSON.parse(localStorage.getItem("favourite_paths")) : []), u(localStorage.getItem("collapsed_groups") ? JSON.parse(localStorage.getItem("collapsed_groups")) : []);
16086
- }, []);
16087
- const f = k((p) => {
16088
- localStorage.setItem("recently_visited_paths", JSON.stringify(p)), s(p);
16089
- }, []), m = k((p) => {
16090
- localStorage.setItem("favourite_paths", JSON.stringify(p)), c(p);
16091
- }, []), g = k((p) => {
16092
- localStorage.setItem("collapsed_groups", JSON.stringify(p)), u(p);
16093
- }, []);
16094
- return {
16095
- onCollectionModified: o,
16096
- getCollectionConfig: i,
16097
- recentlyVisitedPaths: a,
16098
- setRecentlyVisitedPaths: f,
16099
- favouritePaths: l,
16100
- setFavouritePaths: m,
16101
- collapsedGroups: d,
16102
- setCollapsedGroups: g
16103
- };
16104
- }
16105
16105
  export {
16106
16106
  zo as ArrayContainer,
16107
16107
  on as ArrayContainerItem,
@@ -16141,7 +16141,7 @@ export {
16141
16141
  de as ErrorBoundary,
16142
16142
  Ee as ErrorView,
16143
16143
  Te as FieldHelperText,
16144
- zu as FireCMS,
16144
+ Gu as FireCMS,
16145
16145
  td as FireCMSAppBar,
16146
16146
  ed as FireCMSLogo,
16147
16147
  bi as FormikArrayContainer,
@@ -16159,7 +16159,7 @@ export {
16159
16159
  en as MultiSelectBinding,
16160
16160
  Wc as NavigationCollectionCard,
16161
16161
  nn as NavigationGroup,
16162
- Gu as NavigationRoutes,
16162
+ Yu as NavigationRoutes,
16163
16163
  Kc as NotFoundPage,
16164
16164
  nl as NumberPropertyPreview,
16165
16165
  Fu as PropertyConfigBadge,
@@ -16173,11 +16173,11 @@ export {
16173
16173
  Lc as ReferenceSelectionTable,
16174
16174
  Ru as ReferenceWidget,
16175
16175
  Ec as RepeatFieldBinding,
16176
- Vu as Scaffold,
16176
+ ju as Scaffold,
16177
16177
  Du as SearchIconsView,
16178
16178
  Ki as SelectFieldBinding,
16179
16179
  Hl as SelectableTable,
16180
- Mu as SideDialogs,
16180
+ Vu as SideDialogs,
16181
16181
  Tt as SkeletonPropertyComponent,
16182
16182
  Jd as SnackbarProvider,
16183
16183
  qs as StorageThumbnail,
@@ -16298,8 +16298,8 @@ export {
16298
16298
  os as updateDateAutoValues,
16299
16299
  pt as useAuthController,
16300
16300
  Pu as useBrowserTitleAndIcon,
16301
- Yu as useBuildLocalConfigurationPersistence,
16302
- ju as useBuildModeController,
16301
+ Mu as useBuildLocalConfigurationPersistence,
16302
+ zu as useBuildModeController,
16303
16303
  Tu as useBuildNavigationController,
16304
16304
  Le as useClearRestoreValue,
16305
16305
  Ns as useClipboard,