@firecms/core 3.0.0-canary.264 → 3.0.0-canary.266

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.umd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function(global, factory) {
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("react-compiler-runtime"), require("react"), require("@firecms/ui"), require("notistack"), require("object-hash"), require("@firecms/formex"), require("react-router-dom"), require("fuse.js"), require("react-fast-compare"), require("date-fns"), require("date-fns/locale"), require("react-use-measure"), require("yup"), require("react-window"), require("@dnd-kit/core"), require("@dnd-kit/sortable"), require("@dnd-kit/utilities"), require("@dnd-kit/modifiers"), require("react-dropzone"), require("react-image-file-resizer"), require("@firecms/editor"), require("prism-react-renderer"), require("react-router"), require("@radix-ui/react-portal")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "react-compiler-runtime", "react", "@firecms/ui", "notistack", "object-hash", "@firecms/formex", "react-router-dom", "fuse.js", "react-fast-compare", "date-fns", "date-fns/locale", "react-use-measure", "yup", "react-window", "@dnd-kit/core", "@dnd-kit/sortable", "@dnd-kit/utilities", "@dnd-kit/modifiers", "react-dropzone", "react-image-file-resizer", "@firecms/editor", "prism-react-renderer", "react-router", "@radix-ui/react-portal"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["FireCMS Core"] = {}, global.jsxRuntime, global.reactCompilerRuntime, global.React, global.ui, global.notistack, global.hash, global.formex, global.reactRouterDom, global.Fuse, global.equal, global.dateFns, global.locales, global.useMeasure, global.yup, global.reactWindow, global.core, global.sortable, global.utilities, global.modifiers, global.reactDropzone, global.Resizer, global.editor, global.prismReactRenderer, global.reactRouter, global.Portal));
3
- })(this, function(exports2, jsxRuntime, reactCompilerRuntime, React, ui, notistack, hash, formex, reactRouterDom, Fuse, equal, dateFns, locales, useMeasure, yup, reactWindow, core, sortable, utilities, modifiers, reactDropzone, Resizer, editor, prismReactRenderer, reactRouter, Portal) {
3
+ })(this, (function(exports2, jsxRuntime, reactCompilerRuntime, React, ui, notistack, hash, formex, reactRouterDom, Fuse, equal, dateFns, locales, useMeasure, yup, reactWindow, core, sortable, utilities, modifiers, reactDropzone, Resizer, editor, prismReactRenderer, reactRouter, Portal) {
4
4
  "use strict";
5
5
  function _interopNamespaceDefault(e) {
6
6
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -11039,9 +11039,9 @@
11039
11039
  possibleOperations = $[2];
11040
11040
  }
11041
11041
  let t1;
11042
- if ($[3] !== possibleOperations || $[4] !== value) {
11042
+ if ($[3] !== possibleOperations[0] || $[4] !== value) {
11043
11043
  t1 = value || [possibleOperations[0], void 0];
11044
- $[3] = possibleOperations;
11044
+ $[3] = possibleOperations[0];
11045
11045
  $[4] = value;
11046
11046
  $[5] = t1;
11047
11047
  } else {
@@ -11314,9 +11314,9 @@
11314
11314
  }
11315
11315
  const possibleOperations = t1;
11316
11316
  let t2;
11317
- if ($[2] !== possibleOperations || $[3] !== value) {
11317
+ if ($[2] !== possibleOperations[0] || $[3] !== value) {
11318
11318
  t2 = value || [possibleOperations[0], void 0];
11319
- $[2] = possibleOperations;
11319
+ $[2] = possibleOperations[0];
11320
11320
  $[3] = value;
11321
11321
  $[4] = t2;
11322
11322
  } else {
@@ -12836,11 +12836,11 @@
12836
12836
  let t2;
12837
12837
  let t3;
12838
12838
  let t4;
12839
- if ($[2] !== navigationController.topLevelNavigation?.navigationEntries || $[3] !== t1) {
12839
+ if ($[2] !== navigationController || $[3] !== t1) {
12840
12840
  let t52;
12841
- if ($[8] !== navigationController.topLevelNavigation?.navigationEntries) {
12841
+ if ($[8] !== navigationController) {
12842
12842
  t52 = (path) => navigationController.topLevelNavigation?.navigationEntries.find((entry) => entry.path === path);
12843
- $[8] = navigationController.topLevelNavigation?.navigationEntries;
12843
+ $[8] = navigationController;
12844
12844
  $[9] = t52;
12845
12845
  } else {
12846
12846
  t52 = $[9];
@@ -12850,7 +12850,7 @@
12850
12850
  t4 = favouriteCollections.length > 0;
12851
12851
  t2 = "flex flex-row flex-wrap gap-2 pb-2 min-h-[32px]";
12852
12852
  t3 = favouriteCollections.map(_temp$d);
12853
- $[2] = navigationController.topLevelNavigation?.navigationEntries;
12853
+ $[2] = navigationController;
12854
12854
  $[3] = t1;
12855
12855
  $[4] = T0;
12856
12856
  $[5] = t2;
@@ -14764,9 +14764,7 @@
14764
14764
  disabled,
14765
14765
  status,
14766
14766
  pluginActions,
14767
- openEntityMode,
14768
- navigateBack,
14769
- formContext
14767
+ openEntityMode
14770
14768
  });
14771
14769
  $[0] = collection;
14772
14770
  $[1] = context;
@@ -15287,7 +15285,7 @@
15287
15285
  if (!resolvedCollection || !path) {
15288
15286
  throw Error("INTERNAL: Collection and path must be defined in form context");
15289
15287
  }
15290
- const dialogActions = /* @__PURE__ */ jsxRuntime.jsx(EntityFormActionsComponent, { collection: resolvedCollection, path, fullPath: path, fullIdPath, entity, layout: forceActionsAtTheBottom ? "bottom" : "side", savingError, formex: formex$1, disabled: actionsDisabled, status, pluginActions, openEntityMode, showDefaultActions, navigateBack, formContext });
15288
+ const dialogActions = /* @__PURE__ */ jsxRuntime.jsx(EntityFormActionsComponent, { collection: resolvedCollection, path, fullPath: path, fullIdPath, entity, layout: forceActionsAtTheBottom ? "bottom" : "side", savingError, formex: formex$1, disabled: actionsDisabled, status, pluginActions: pluginActions ?? [], openEntityMode, showDefaultActions, navigateBack, formContext });
15291
15289
  return /* @__PURE__ */ jsxRuntime.jsx(formex.Formex, { value: formex$1, children: /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: formex$1.handleSubmit, onReset: () => formex$1.resetForm({
15292
15290
  values: getInitialEntityValues(authController, collection, path, status, entity, customizationController.propertyConfigs)
15293
15291
  }), noValidate: true, className: ui.cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", className), children: [
@@ -21193,7 +21191,7 @@
21193
21191
  ] });
21194
21192
  }
21195
21193
  const UPDATE_SEARCH_INDEX_WAIT_MS = 220;
21196
- if (process.env.NODE_ENV !== "production") {
21194
+ if (iconSynonyms && process.env.NODE_ENV !== "production") {
21197
21195
  Object.keys(iconSynonyms).forEach((icon) => {
21198
21196
  if (!ui.iconKeys.includes(icon)) {
21199
21197
  console.warn(`The icon ${icon} no longer exists. Remove it from \`iconSynonyms\``);
@@ -21578,7 +21576,7 @@
21578
21576
  });
21579
21577
  }
21580
21578
  const collectedGroupsFromEntries = navigationEntries.map((e_0) => e_0.group).filter(Boolean);
21581
- const allDefinedGroups = [...pluginGroups, ...collectedGroupsFromEntries];
21579
+ const allDefinedGroups = [...pluginGroups ?? [], ...collectedGroupsFromEntries];
21582
21580
  const uniqueGroups = [...new Set(allDefinedGroups)].sort((a_1, b_1) => groupOrderValue(a_1) - groupOrderValue(b_1));
21583
21581
  return {
21584
21582
  allowDragAndDrop: plugins?.some((plugin_2) => plugin_2.homePage?.allowDragAndDrop) ?? false,
@@ -22390,10 +22388,10 @@
22390
22388
  panels = $[1];
22391
22389
  }
22392
22390
  let t0;
22393
- if ($[2] !== panels || $[3] !== sidePanels.length) {
22391
+ if ($[2] !== panels || $[3] !== sidePanels) {
22394
22392
  t0 = /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: panels.map((panel, index) => /* @__PURE__ */ jsxRuntime.jsx(SideDialogView, { panel, offsetPosition: sidePanels.length - index - 1 }, `side_dialog_${index}`)) });
22395
22393
  $[2] = panels;
22396
- $[3] = sidePanels.length;
22394
+ $[3] = sidePanels;
22397
22395
  $[4] = t0;
22398
22396
  } else {
22399
22397
  t0 = $[4];
@@ -22412,7 +22410,6 @@
22412
22410
  const width = widthRef.current;
22413
22411
  const sideDialogsController = useSideDialogsController();
22414
22412
  const {
22415
- navigationWasBlocked,
22416
22413
  handleOk: handleNavigationOk,
22417
22414
  handleCancel: handleNavigationCancel
22418
22415
  } = useNavigationUnsavedChangesDialog(blocked && !drawerCloseRequested, () => setBlocked(false));
@@ -24670,7 +24667,7 @@
24670
24667
  return getDefaultFieldId(property);
24671
24668
  }
24672
24669
  function FireCMSRoute() {
24673
- const $ = reactCompilerRuntime.c(33);
24670
+ const $ = reactCompilerRuntime.c(34);
24674
24671
  const location = reactRouter.useLocation();
24675
24672
  const navigation = useNavigationController();
24676
24673
  const breadcrumbs = useBreadcrumbsController();
@@ -24780,7 +24777,7 @@
24780
24777
  if (navigationEntries.length === 1 && navigationEntries[0].type === "collection") {
24781
24778
  let t62;
24782
24779
  let t7;
24783
- if ($[18] !== navigation || $[19] !== navigationEntries) {
24780
+ if ($[18] !== navigation || $[19] !== navigationEntries[0].id || $[20] !== navigationEntries[0].path) {
24784
24781
  t7 = Symbol.for("react.early_return_sentinel");
24785
24782
  bb0: {
24786
24783
  let collection;
@@ -24793,21 +24790,22 @@
24793
24790
  break bb0;
24794
24791
  }
24795
24792
  let t8;
24796
- if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
24793
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
24797
24794
  t8 = [];
24798
- $[22] = t8;
24795
+ $[23] = t8;
24799
24796
  } else {
24800
- t8 = $[22];
24797
+ t8 = $[23];
24801
24798
  }
24802
24799
  t62 = /* @__PURE__ */ jsxRuntime.jsx(EntityCollectionView, { isSubCollection: false, parentCollectionIds: t8, fullPath: collection.path, fullIdPath: collection.id, updateUrl: true, ...collection, Actions: toArray(collection.Actions) }, `collection_view_${collection.id ?? collection.path}`);
24803
24800
  }
24804
24801
  $[18] = navigation;
24805
- $[19] = navigationEntries;
24806
- $[20] = t62;
24807
- $[21] = t7;
24802
+ $[19] = navigationEntries[0].id;
24803
+ $[20] = navigationEntries[0].path;
24804
+ $[21] = t62;
24805
+ $[22] = t7;
24808
24806
  } else {
24809
- t62 = $[20];
24810
- t7 = $[21];
24807
+ t62 = $[21];
24808
+ t7 = $[22];
24811
24809
  }
24812
24810
  if (t7 !== Symbol.for("react.early_return_sentinel")) {
24813
24811
  return t7;
@@ -24819,7 +24817,7 @@
24819
24817
  if (lastCollectionEntry) {
24820
24818
  let t62;
24821
24819
  let t7;
24822
- if ($[23] !== navigation || $[24] !== navigationEntries) {
24820
+ if ($[24] !== navigation || $[25] !== navigationEntries[0]) {
24823
24821
  t7 = Symbol.for("react.early_return_sentinel");
24824
24822
  bb1: {
24825
24823
  let collection_0;
@@ -24833,21 +24831,21 @@
24833
24831
  break bb1;
24834
24832
  }
24835
24833
  let t8;
24836
- if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
24834
+ if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
24837
24835
  t8 = [];
24838
- $[27] = t8;
24836
+ $[28] = t8;
24839
24837
  } else {
24840
- t8 = $[27];
24838
+ t8 = $[28];
24841
24839
  }
24842
24840
  t62 = /* @__PURE__ */ jsxRuntime.jsx(EntityCollectionView, { fullIdPath: collection_0.id, isSubCollection: false, parentCollectionIds: t8, fullPath: collection_0.path, updateUrl: true, ...collection_0, Actions: toArray(collection_0.Actions) }, `collection_view_${collection_0.id ?? collection_0.path}`);
24843
24841
  }
24844
- $[23] = navigation;
24845
- $[24] = navigationEntries;
24846
- $[25] = t62;
24847
- $[26] = t7;
24842
+ $[24] = navigation;
24843
+ $[25] = navigationEntries[0];
24844
+ $[26] = t62;
24845
+ $[27] = t7;
24848
24846
  } else {
24849
- t62 = $[25];
24850
- t7 = $[26];
24847
+ t62 = $[26];
24848
+ t7 = $[27];
24851
24849
  }
24852
24850
  if (t7 !== Symbol.for("react.early_return_sentinel")) {
24853
24851
  return t7;
@@ -24856,15 +24854,15 @@
24856
24854
  }
24857
24855
  }
24858
24856
  let t6;
24859
- if ($[28] !== isCopy || $[29] !== isNew || $[30] !== navigationEntries || $[31] !== pathname) {
24857
+ if ($[29] !== isCopy || $[30] !== isNew || $[31] !== navigationEntries || $[32] !== pathname) {
24860
24858
  t6 = /* @__PURE__ */ jsxRuntime.jsx(EntityFullScreenRoute, { pathname, navigationEntries, isNew, isCopy });
24861
- $[28] = isCopy;
24862
- $[29] = isNew;
24863
- $[30] = navigationEntries;
24864
- $[31] = pathname;
24865
- $[32] = t6;
24859
+ $[29] = isCopy;
24860
+ $[30] = isNew;
24861
+ $[31] = navigationEntries;
24862
+ $[32] = pathname;
24863
+ $[33] = t6;
24866
24864
  } else {
24867
- t6 = $[32];
24865
+ t6 = $[33];
24868
24866
  }
24869
24867
  return t6;
24870
24868
  }
@@ -25820,5 +25818,5 @@
25820
25818
  exports2.useValidateAuthenticator = useValidateAuthenticator;
25821
25819
  exports2.yupToFormErrors = yupToFormErrors;
25822
25820
  Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
25823
- });
25821
+ }));
25824
25822
  //# sourceMappingURL=index.umd.js.map