@firecms/core 3.0.0-canary.265 → 3.0.0-canary.267

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
@@ -2,10 +2,10 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
3
  import * as React from "react";
4
4
  import React__default, { useRef, useEffect, useContext, useCallback, useMemo, useState, createElement, createRef, createContext, forwardRef, useLayoutEffect, useDeferredValue } from "react";
5
- import { getColorSchemeForSeed, CHIP_COLORS, CircleIcon, FunctionsIcon, iconKeys, coolIconKeys, Icon, Tooltip, ErrorIcon, Typography, IconButton, ContentCopyIcon, OpenInNewIcon, DescriptionIcon, cls, Skeleton, Chip, defaultBorderMixin, KeyboardTabIcon, Checkbox, Markdown, TextareaAutosize, focusedDisabled, MultiSelect, MultiSelectItem, Select, SelectItem, BooleanSwitch, DateTimeField, paperMixin, EditIcon, DoNotDisturbOnIcon, Menu, MoreVertIcon, MenuItem, CircularProgress, SearchBar, Badge, ArrowUpwardIcon, Popover, FilterListIcon, Button, CenteredView, AssignmentIcon, Label, CloseIcon, TextField, BooleanSwitchWithLabel, useOutsideAlerter, Dialog, DialogTitle, DialogContent, DialogActions, FileCopyIcon, DeleteIcon, AddIcon, Collapse, StarIcon, ArrowForwardIcon, Card, cardMixin, cardClickableMixin, Container, LoadingButton, Alert, CheckIcon, NotesIcon, InfoIcon, ExpandablePanel, fieldBackgroundMixin, RemoveIcon, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, ArrowDropDownIcon, FilterListOffIcon, SearchIcon, Avatar, DarkModeIcon, LightModeIcon, BrightnessMediumIcon, LogoutIcon, HandleIcon, KeyboardArrowUpIcon, KeyboardArrowDownIcon, debounce, Sheet, Tab, Tabs, CodeIcon, OpenInFullIcon, ShortTextIcon, SubjectIcon, FormatQuoteIcon, HttpIcon, MailIcon, FlagIcon, ListIcon, ListAltIcon, NumbersIcon, FormatListNumberedIcon, UploadFileIcon, DriveFolderUploadIcon, LinkIcon, AddLinkIcon, ScheduleIcon, BallotIcon, RepeatIcon, ViewStreamIcon, MenuIcon, ChevronLeftIcon } from "@firecms/ui";
5
+ import { getColorSchemeForSeed, CHIP_COLORS, FunctionsIcon, CircleIcon, iconKeys, coolIconKeys, Icon, Tooltip, ErrorIcon, Typography, IconButton, ContentCopyIcon, OpenInNewIcon, DescriptionIcon, cls, Skeleton, Chip, defaultBorderMixin, KeyboardTabIcon, Checkbox, Markdown, TextareaAutosize, focusedDisabled, MultiSelect, MultiSelectItem, Select, SelectItem, BooleanSwitch, DateTimeField, paperMixin, EditIcon, DoNotDisturbOnIcon, Menu, MenuItem, MoreVertIcon, CircularProgress, SearchBar, Badge, ArrowUpwardIcon, Popover, FilterListIcon, Button, CenteredView, AssignmentIcon, Label, CloseIcon, TextField, BooleanSwitchWithLabel, useOutsideAlerter, Dialog, DialogTitle, DialogContent, DialogActions, FileCopyIcon, DeleteIcon, AddIcon, StarIcon, Collapse, ArrowForwardIcon, Card, cardMixin, cardClickableMixin, Container, LoadingButton, Alert, CheckIcon, NotesIcon, InfoIcon, ExpandablePanel, fieldBackgroundMixin, RemoveIcon, fieldBackgroundDisabledMixin, fieldBackgroundHoverMixin, ArrowDropDownIcon, FilterListOffIcon, SearchIcon, Avatar, DarkModeIcon, LightModeIcon, BrightnessMediumIcon, LogoutIcon, HandleIcon, KeyboardArrowUpIcon, KeyboardArrowDownIcon, debounce, Sheet, Tab, Tabs, CodeIcon, OpenInFullIcon, ViewStreamIcon, RepeatIcon, BallotIcon, ScheduleIcon, AddLinkIcon, LinkIcon, DriveFolderUploadIcon, UploadFileIcon, FormatListNumberedIcon, NumbersIcon, ListAltIcon, ListIcon, FlagIcon, MailIcon, HttpIcon, FormatQuoteIcon, SubjectIcon, ShortTextIcon, MenuIcon, ChevronLeftIcon } from "@firecms/ui";
6
6
  import { SnackbarProvider as SnackbarProvider$1, useSnackbar } from "notistack";
7
7
  import hash from "object-hash";
8
- import { getIn, useFormex, useCreateFormex, Formex, setIn, Field } from "@firecms/formex";
8
+ import { getIn, useFormex, setIn, useCreateFormex, Formex, Field } from "@firecms/formex";
9
9
  import { useNavigate, useLocation, Link, NavLink, Routes, Route, createBrowserRouter, RouterProvider } from "react-router-dom";
10
10
  import Fuse from "fuse.js";
11
11
  import equal from "react-fast-compare";
@@ -14,8 +14,8 @@ import * as locales from "date-fns/locale";
14
14
  import useMeasure from "react-use-measure";
15
15
  import * as yup from "yup";
16
16
  import { FixedSizeList } from "react-window";
17
- import { useDroppable, useSensor, MouseSensor, TouchSensor, KeyboardSensor, useSensors, closestCenter, pointerWithin, closestCorners, getFirstCollision, rectIntersection, useDndMonitor, DndContext, MeasuringStrategy, DragOverlay, PointerSensor } from "@dnd-kit/core";
18
- import { useSortable, defaultAnimateLayoutChanges, SortableContext, rectSortingStrategy, arrayMove as arrayMove$1, verticalListSortingStrategy, sortableKeyboardCoordinates, horizontalListSortingStrategy } from "@dnd-kit/sortable";
17
+ import { useSensor, MouseSensor, TouchSensor, KeyboardSensor, useSensors, closestCenter, pointerWithin, closestCorners, getFirstCollision, rectIntersection, useDroppable, useDndMonitor, DndContext, MeasuringStrategy, DragOverlay, PointerSensor } from "@dnd-kit/core";
18
+ import { useSortable, defaultAnimateLayoutChanges, arrayMove as arrayMove$1, SortableContext, rectSortingStrategy, verticalListSortingStrategy, sortableKeyboardCoordinates, horizontalListSortingStrategy } from "@dnd-kit/sortable";
19
19
  import { CSS } from "@dnd-kit/utilities";
20
20
  import { restrictToVerticalAxis, restrictToWindowEdges } from "@dnd-kit/modifiers";
21
21
  import { useDropzone } from "react-dropzone";
@@ -11041,9 +11041,9 @@ function StringNumberFilterField(t0) {
11041
11041
  possibleOperations = $[2];
11042
11042
  }
11043
11043
  let t1;
11044
- if ($[3] !== possibleOperations || $[4] !== value) {
11044
+ if ($[3] !== possibleOperations[0] || $[4] !== value) {
11045
11045
  t1 = value || [possibleOperations[0], void 0];
11046
- $[3] = possibleOperations;
11046
+ $[3] = possibleOperations[0];
11047
11047
  $[4] = value;
11048
11048
  $[5] = t1;
11049
11049
  } else {
@@ -11316,9 +11316,9 @@ function DateTimeFilterField(t0) {
11316
11316
  }
11317
11317
  const possibleOperations = t1;
11318
11318
  let t2;
11319
- if ($[2] !== possibleOperations || $[3] !== value) {
11319
+ if ($[2] !== possibleOperations[0] || $[3] !== value) {
11320
11320
  t2 = value || [possibleOperations[0], void 0];
11321
- $[2] = possibleOperations;
11321
+ $[2] = possibleOperations[0];
11322
11322
  $[3] = value;
11323
11323
  $[4] = t2;
11324
11324
  } else {
@@ -12838,11 +12838,11 @@ function FavouritesView(t0) {
12838
12838
  let t2;
12839
12839
  let t3;
12840
12840
  let t4;
12841
- if ($[2] !== navigationController.topLevelNavigation?.navigationEntries || $[3] !== t1) {
12841
+ if ($[2] !== navigationController || $[3] !== t1) {
12842
12842
  let t52;
12843
- if ($[8] !== navigationController.topLevelNavigation?.navigationEntries) {
12843
+ if ($[8] !== navigationController) {
12844
12844
  t52 = (path) => navigationController.topLevelNavigation?.navigationEntries.find((entry) => entry.path === path);
12845
- $[8] = navigationController.topLevelNavigation?.navigationEntries;
12845
+ $[8] = navigationController;
12846
12846
  $[9] = t52;
12847
12847
  } else {
12848
12848
  t52 = $[9];
@@ -12852,7 +12852,7 @@ function FavouritesView(t0) {
12852
12852
  t4 = favouriteCollections.length > 0;
12853
12853
  t2 = "flex flex-row flex-wrap gap-2 pb-2 min-h-[32px]";
12854
12854
  t3 = favouriteCollections.map(_temp$d);
12855
- $[2] = navigationController.topLevelNavigation?.navigationEntries;
12855
+ $[2] = navigationController;
12856
12856
  $[3] = t1;
12857
12857
  $[4] = T0;
12858
12858
  $[5] = t2;
@@ -14766,9 +14766,7 @@ function EntityFormActions(t0) {
14766
14766
  disabled,
14767
14767
  status,
14768
14768
  pluginActions,
14769
- openEntityMode,
14770
- navigateBack,
14771
- formContext
14769
+ openEntityMode
14772
14770
  });
14773
14771
  $[0] = collection;
14774
14772
  $[1] = context;
@@ -15289,7 +15287,7 @@ function EntityForm({
15289
15287
  if (!resolvedCollection || !path) {
15290
15288
  throw Error("INTERNAL: Collection and path must be defined in form context");
15291
15289
  }
15292
- const dialogActions = /* @__PURE__ */ jsx(EntityFormActionsComponent, { collection: resolvedCollection, path, fullPath: path, fullIdPath, entity, layout: forceActionsAtTheBottom ? "bottom" : "side", savingError, formex, disabled: actionsDisabled, status, pluginActions, openEntityMode, showDefaultActions, navigateBack, formContext });
15290
+ const dialogActions = /* @__PURE__ */ jsx(EntityFormActionsComponent, { collection: resolvedCollection, path, fullPath: path, fullIdPath, entity, layout: forceActionsAtTheBottom ? "bottom" : "side", savingError, formex, disabled: actionsDisabled, status, pluginActions: pluginActions ?? [], openEntityMode, showDefaultActions, navigateBack, formContext });
15293
15291
  return /* @__PURE__ */ jsx(Formex, { value: formex, children: /* @__PURE__ */ jsxs("form", { onSubmit: formex.handleSubmit, onReset: () => formex.resetForm({
15294
15292
  values: getInitialEntityValues(authController, collection, path, status, entity, customizationController.propertyConfigs)
15295
15293
  }), noValidate: true, className: cls("flex-1 flex flex-row w-full overflow-y-auto justify-center", className), children: [
@@ -21195,7 +21193,7 @@ function ReferenceWidget({
21195
21193
  ] });
21196
21194
  }
21197
21195
  const UPDATE_SEARCH_INDEX_WAIT_MS = 220;
21198
- if (process.env.NODE_ENV !== "production") {
21196
+ if (iconSynonyms && process.env.NODE_ENV !== "production") {
21199
21197
  Object.keys(iconSynonyms).forEach((icon) => {
21200
21198
  if (!iconKeys.includes(icon)) {
21201
21199
  console.warn(`The icon ${icon} no longer exists. Remove it from \`iconSynonyms\``);
@@ -21580,7 +21578,7 @@ function useBuildNavigationController(props) {
21580
21578
  });
21581
21579
  }
21582
21580
  const collectedGroupsFromEntries = navigationEntries.map((e_0) => e_0.group).filter(Boolean);
21583
- const allDefinedGroups = [...pluginGroups, ...collectedGroupsFromEntries];
21581
+ const allDefinedGroups = [...pluginGroups ?? [], ...collectedGroupsFromEntries];
21584
21582
  const uniqueGroups = [...new Set(allDefinedGroups)].sort((a_1, b_1) => groupOrderValue(a_1) - groupOrderValue(b_1));
21585
21583
  return {
21586
21584
  allowDragAndDrop: plugins?.some((plugin_2) => plugin_2.homePage?.allowDragAndDrop) ?? false,
@@ -22392,10 +22390,10 @@ function SideDialogs() {
22392
22390
  panels = $[1];
22393
22391
  }
22394
22392
  let t0;
22395
- if ($[2] !== panels || $[3] !== sidePanels.length) {
22393
+ if ($[2] !== panels || $[3] !== sidePanels) {
22396
22394
  t0 = /* @__PURE__ */ jsx(Fragment, { children: panels.map((panel, index) => /* @__PURE__ */ jsx(SideDialogView, { panel, offsetPosition: sidePanels.length - index - 1 }, `side_dialog_${index}`)) });
22397
22395
  $[2] = panels;
22398
- $[3] = sidePanels.length;
22396
+ $[3] = sidePanels;
22399
22397
  $[4] = t0;
22400
22398
  } else {
22401
22399
  t0 = $[4];
@@ -22414,7 +22412,6 @@ function SideDialogView({
22414
22412
  const width = widthRef.current;
22415
22413
  const sideDialogsController = useSideDialogsController();
22416
22414
  const {
22417
- navigationWasBlocked,
22418
22415
  handleOk: handleNavigationOk,
22419
22416
  handleCancel: handleNavigationCancel
22420
22417
  } = useNavigationUnsavedChangesDialog(blocked && !drawerCloseRequested, () => setBlocked(false));
@@ -24672,7 +24669,7 @@ function getFieldId(property) {
24672
24669
  return getDefaultFieldId(property);
24673
24670
  }
24674
24671
  function FireCMSRoute() {
24675
- const $ = c(33);
24672
+ const $ = c(34);
24676
24673
  const location = useLocation$1();
24677
24674
  const navigation = useNavigationController();
24678
24675
  const breadcrumbs = useBreadcrumbsController();
@@ -24782,7 +24779,7 @@ function FireCMSRoute() {
24782
24779
  if (navigationEntries.length === 1 && navigationEntries[0].type === "collection") {
24783
24780
  let t62;
24784
24781
  let t7;
24785
- if ($[18] !== navigation || $[19] !== navigationEntries) {
24782
+ if ($[18] !== navigation || $[19] !== navigationEntries[0].id || $[20] !== navigationEntries[0].path) {
24786
24783
  t7 = Symbol.for("react.early_return_sentinel");
24787
24784
  bb0: {
24788
24785
  let collection;
@@ -24795,21 +24792,22 @@ function FireCMSRoute() {
24795
24792
  break bb0;
24796
24793
  }
24797
24794
  let t8;
24798
- if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
24795
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
24799
24796
  t8 = [];
24800
- $[22] = t8;
24797
+ $[23] = t8;
24801
24798
  } else {
24802
- t8 = $[22];
24799
+ t8 = $[23];
24803
24800
  }
24804
24801
  t62 = /* @__PURE__ */ 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}`);
24805
24802
  }
24806
24803
  $[18] = navigation;
24807
- $[19] = navigationEntries;
24808
- $[20] = t62;
24809
- $[21] = t7;
24804
+ $[19] = navigationEntries[0].id;
24805
+ $[20] = navigationEntries[0].path;
24806
+ $[21] = t62;
24807
+ $[22] = t7;
24810
24808
  } else {
24811
- t62 = $[20];
24812
- t7 = $[21];
24809
+ t62 = $[21];
24810
+ t7 = $[22];
24813
24811
  }
24814
24812
  if (t7 !== Symbol.for("react.early_return_sentinel")) {
24815
24813
  return t7;
@@ -24821,7 +24819,7 @@ function FireCMSRoute() {
24821
24819
  if (lastCollectionEntry) {
24822
24820
  let t62;
24823
24821
  let t7;
24824
- if ($[23] !== navigation || $[24] !== navigationEntries) {
24822
+ if ($[24] !== navigation || $[25] !== navigationEntries[0]) {
24825
24823
  t7 = Symbol.for("react.early_return_sentinel");
24826
24824
  bb1: {
24827
24825
  let collection_0;
@@ -24835,21 +24833,21 @@ function FireCMSRoute() {
24835
24833
  break bb1;
24836
24834
  }
24837
24835
  let t8;
24838
- if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
24836
+ if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
24839
24837
  t8 = [];
24840
- $[27] = t8;
24838
+ $[28] = t8;
24841
24839
  } else {
24842
- t8 = $[27];
24840
+ t8 = $[28];
24843
24841
  }
24844
24842
  t62 = /* @__PURE__ */ 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}`);
24845
24843
  }
24846
- $[23] = navigation;
24847
- $[24] = navigationEntries;
24848
- $[25] = t62;
24849
- $[26] = t7;
24844
+ $[24] = navigation;
24845
+ $[25] = navigationEntries[0];
24846
+ $[26] = t62;
24847
+ $[27] = t7;
24850
24848
  } else {
24851
- t62 = $[25];
24852
- t7 = $[26];
24849
+ t62 = $[26];
24850
+ t7 = $[27];
24853
24851
  }
24854
24852
  if (t7 !== Symbol.for("react.early_return_sentinel")) {
24855
24853
  return t7;
@@ -24858,15 +24856,15 @@ function FireCMSRoute() {
24858
24856
  }
24859
24857
  }
24860
24858
  let t6;
24861
- if ($[28] !== isCopy || $[29] !== isNew || $[30] !== navigationEntries || $[31] !== pathname) {
24859
+ if ($[29] !== isCopy || $[30] !== isNew || $[31] !== navigationEntries || $[32] !== pathname) {
24862
24860
  t6 = /* @__PURE__ */ jsx(EntityFullScreenRoute, { pathname, navigationEntries, isNew, isCopy });
24863
- $[28] = isCopy;
24864
- $[29] = isNew;
24865
- $[30] = navigationEntries;
24866
- $[31] = pathname;
24867
- $[32] = t6;
24861
+ $[29] = isCopy;
24862
+ $[30] = isNew;
24863
+ $[31] = navigationEntries;
24864
+ $[32] = pathname;
24865
+ $[33] = t6;
24868
24866
  } else {
24869
- t6 = $[32];
24867
+ t6 = $[33];
24870
24868
  }
24871
24869
  return t6;
24872
24870
  }