@firecms/core 3.0.0-rc.3 → 3.0.0-tw4.1

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/README.md CHANGED
@@ -167,7 +167,7 @@ in `example/src`.
167
167
  That file needs to export a valid Firebase config, that you can get
168
168
  from your Firebase console when creating a webapp for your project.
169
169
 
170
- Then simply run `yarn` and `yarn dev`
170
+ Then simply run `npm install` and `npm run dev` (or `yarn` and `yarn dev`)
171
171
 
172
172
  ## License
173
173
 
@@ -26,5 +26,5 @@ import { CMSType, PropertyFieldBindingProps } from "../types";
26
26
  * @group Form custom fields
27
27
  */
28
28
  export declare const PropertyFieldBinding: typeof PropertyFieldBindingInternal;
29
- declare function PropertyFieldBindingInternal<T extends CMSType = CMSType, M extends Record<string, any> = any>({ propertyKey, property, context, includeDescription, underlyingValueHasChanged, disabled: disabledProp, partOfArray, minimalistView, autoFocus, index, size, onPropertyChange, }: PropertyFieldBindingProps<T, M>): ReactElement<PropertyFieldBindingProps<T, M>>;
29
+ declare function PropertyFieldBindingInternal<T extends CMSType = CMSType, M extends Record<string, any> = any>({ propertyKey, property, context, includeDescription, underlyingValueHasChanged, disabled: disabledProp, partOfArray, partOfBlock, minimalistView, autoFocus, index, size, onPropertyChange, }: PropertyFieldBindingProps<T, M>): ReactElement<PropertyFieldBindingProps<T, M>>;
30
30
  export {};
package/dist/index.es.js CHANGED
@@ -4908,7 +4908,7 @@ function EmptyValue() {
4908
4908
  const $ = c(1);
4909
4909
  let t0;
4910
4910
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
4911
- t0 = /* @__PURE__ */ jsx("div", { className: "rounded-full bg-surface-200 bg-opacity-30 dark:bg-opacity-20 w-5 h-2 inline-block" });
4911
+ t0 = /* @__PURE__ */ jsx("div", { className: "rounded-full bg-surface-200 bg-opacity-30 bg-surface-200/30 dark:bg-opacity-20 dark:bg-surface-200/20 w-5 h-2 inline-block" });
4912
4912
  $[0] = t0;
4913
4913
  } else {
4914
4914
  t0 = $[0];
@@ -9733,9 +9733,9 @@ const EntityTableCell = React__default.memo(function EntityTableCell2(t0) {
9733
9733
  }
9734
9734
  const setOnHoverFalse = t10;
9735
9735
  const borderClass = showError ? "border-red-500" : internalSaved ? "border-green-500" : isSelected ? "border-primary" : "border-transparent";
9736
- const t11 = `flex relative h-full rounded-md p-${p} border border-4 border-opacity-75`;
9736
+ const t11 = `flex relative h-full rounded-md p-${p} border border-4 border-opacity-75`;
9737
9737
  const t12 = onHover && !disabled ? "bg-surface-50 dark:bg-surface-900" : "";
9738
- const t13 = saved ? "bg-surface-100 bg-opacity-75 dark:bg-surface-800 dark:bg-opacity-75" : "";
9738
+ const t13 = saved ? "bg-surface-100/75 dark:bg-surface-800/75" : "";
9739
9739
  const t14 = hideOverflow ? "overflow-hidden" : "";
9740
9740
  const t15 = isSelected ? "bg-surface-50 dark:bg-surface-900" : "";
9741
9741
  let t16;
@@ -9803,7 +9803,7 @@ const EntityTableCell = React__default.memo(function EntityTableCell2(t0) {
9803
9803
  }
9804
9804
  let t24;
9805
9805
  if ($[33] !== disabled || $[34] !== disabledTooltip || $[35] !== onHover) {
9806
- t24 = disabled && onHover && disabledTooltip && /* @__PURE__ */ jsx("div", { className: "absolute top-1 right-1 text-xs", children: /* @__PURE__ */ jsx(Tooltip, { title: disabledTooltip, children: /* @__PURE__ */ jsx(DoNotDisturbOnIcon, { size: "smallest", color: "disabled", className: "text-surface-500" }) }) });
9806
+ t24 = disabled && onHover && disabledTooltip && /* @__PURE__ */ jsx("div", { className: "absolute top-1 right-1 text-xs", children: /* @__PURE__ */ jsx(Tooltip, { title: disabledTooltip, children: /* @__PURE__ */ jsx(DoNotDisturbOnIcon, { size: "smallest", color: "disabled", className: "text-text-disabled" }) }) });
9807
9807
  $[33] = disabled;
9808
9808
  $[34] = disabledTooltip;
9809
9809
  $[35] = onHover;
@@ -10273,7 +10273,7 @@ const EntityCollectionRowActions = function EntityCollectionRowActions2({
10273
10273
  const enableLocalChangesBackup = collection ? getLocalChangesBackup(collection) : false;
10274
10274
  const hasDraft = enableLocalChangesBackup ? getEntityFromCache(fullPath + "/" + entity.id) : false;
10275
10275
  const iconSize = largeLayout && (size === "m" || size === "l" || size == "xl") ? "medium" : "small";
10276
- 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) => {
10276
+ 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 bg-surface-50/90 dark:bg-opacity-90 dark:bg-surface-900/90 z-10", frozen ? "sticky left-0" : ""), onClick: useCallback((event) => {
10277
10277
  event.stopPropagation();
10278
10278
  }, []), style: {
10279
10279
  width,
@@ -10787,7 +10787,7 @@ const VirtualTableHeader = React__default.memo(function VirtualTableHeader2(t0)
10787
10787
  const t3 = column.frozen ? "sticky left-0 z-10" : "relative z-0";
10788
10788
  let t4;
10789
10789
  if ($[4] !== t3) {
10790
- t4 = cls("flex py-0 px-3 h-full text-xs uppercase font-semibold relative select-none items-center bg-surface-50 dark:bg-surface-900", "text-text-secondary hover:text-text-primary dark:text-text-secondary-dark dark:hover:text-text-primary-dark", "hover:bg-surface-100 dark:hover:bg-surface-800 hover:bg-opacity-50 dark:hover:bg-opacity-50", t3);
10790
+ t4 = cls("flex py-0 px-3 h-full text-xs uppercase font-semibold relative select-none items-center bg-surface-50 dark:bg-surface-900", "text-text-secondary hover:text-text-primary dark:text-text-secondary-dark dark:hover:text-text-primary-dark", "hover:bg-surface-100 dark:hover:bg-surface-800 hover:bg-opacity-50 hover:bg-surface-100/50 dark:hover:bg-opacity-50 dark:hover:bg-surface-800/50", t3);
10791
10791
  $[4] = t3;
10792
10792
  $[5] = t4;
10793
10793
  } else {
@@ -11223,7 +11223,7 @@ const VirtualTableRow = React__default.memo(function VirtualTableRow2(t0) {
11223
11223
  const onClick = t1;
11224
11224
  let t2;
11225
11225
  if ($[4] !== hoverRow || $[5] !== onRowClick || $[6] !== rowClassName || $[7] !== rowData) {
11226
- t2 = cls("flex min-w-full text-sm border-b border-surface-200 dark:border-surface-800 border-opacity-40 dark:border-opacity-40", rowClassName ? rowClassName(rowData) : "", {
11226
+ t2 = cls("flex min-w-full text-sm border-b border-surface-200 dark:border-surface-800 border-opacity-40 border-surface-200/40 dark:border-opacity-40 dark:border-surface-800/40", rowClassName ? rowClassName(rowData) : "", {
11227
11227
  "hover:bg-opacity-95": hoverRow,
11228
11228
  "cursor-pointer": onRowClick
11229
11229
  });
@@ -12254,7 +12254,7 @@ const SelectableTable = function SelectableTable2({
12254
12254
  selectedCell
12255
12255
  }), [setPopupCell, select, onValueChange, size, selectedCell]);
12256
12256
  return /* @__PURE__ */ jsx(SelectableTableContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx("div", { className: "h-full w-full flex flex-col bg-white dark:bg-surface-950", ref, children: /* @__PURE__ */ jsx(VirtualTable, { data, columns, cellRenderer, onRowClick: inlineEditing ? void 0 : onEntityClick ? onRowClick : void 0, onEndReached: loadNextPage, onResetPagination: resetPagination, error: dataLoadingError, onColumnResize, rowHeight: getRowHeight(size), loading: dataLoading, filter: filterValues, onFilterUpdate: setFilterValues ? onFilterUpdate : void 0, sortBy, onSortByUpdate: setSortBy, hoverRow, initialScroll, onScroll, checkFilterCombination, createFilterField: filterable ? createFilterField : void 0, rowClassName: useCallback((entity) => {
12257
- return highlightedRow?.(entity) ? "bg-surface-100 bg-opacity-75 dark:bg-surface-800 dark:bg-opacity-75" : "";
12257
+ return highlightedRow?.(entity) ? "bg-surface-100 bg-opacity-75 bg-surface-100/75 dark:bg-surface-800 dark:bg-opacity-75 dark:bg-surface-800/75" : "";
12258
12258
  }, [highlightedRow]), className: "flex-grow", emptyComponent, endAdornment, AddColumnComponent }) }) });
12259
12259
  };
12260
12260
  function createFilterField({
@@ -16471,7 +16471,7 @@ function EntityForm({
16471
16471
  /* @__PURE__ */ jsx("div", { id: `form_${path}`, className: cls("relative flex flex-row max-w-4xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-6xl w-full h-fit"), children: /* @__PURE__ */ jsxs("div", { className: cls("flex flex-col w-full pt-12 pb-16 px-4 sm:px-8 md:px-10"), children: [
16472
16472
  /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-4 self-end sticky top-4 z-10", children: [
16473
16473
  manualApplyLocalChanges && hasLocalChanges && /* @__PURE__ */ jsx(LocalChangesMenu, { cacheKey: status === "new" || status === "copy" ? path + "#new" : path + "/" + entityId, properties: resolvedCollection.properties, localChangesData, formex, onClearLocalChanges: () => setLocalChangesCleared(true) }),
16474
- formex.dirty ? /* @__PURE__ */ jsx(Tooltip, { title: "There are local unsaved changes", children: /* @__PURE__ */ jsx(Chip, { size: "small", className: "py-1", colorScheme: "orangeDarker", children: /* @__PURE__ */ jsx(EditIcon, { size: "smallest" }) }) }) : /* @__PURE__ */ jsx(Tooltip, { title: "The current form is in sync with the database", children: /* @__PURE__ */ jsx(Chip, { size: "small", className: "py-1", children: /* @__PURE__ */ jsx(CheckIcon, { size: "smallest" }) }) })
16474
+ formex.dirty ? /* @__PURE__ */ jsx(Tooltip, { title: "This form has been modified", children: /* @__PURE__ */ jsx(Chip, { size: "small", className: "py-1", colorScheme: "orangeDarker", children: /* @__PURE__ */ jsx(EditIcon, { size: "smallest" }) }) }) : /* @__PURE__ */ jsx(Tooltip, { title: "The current form is in sync with the database", children: /* @__PURE__ */ jsx(Chip, { size: "small", className: "py-1", children: /* @__PURE__ */ jsx(CheckIcon, { size: "smallest" }) }) })
16475
16475
  ] }),
16476
16476
  formView
16477
16477
  ] }) }),
@@ -18636,7 +18636,7 @@ const PropertyFieldBinding = React__default.memo(PropertyFieldBindingInternal, (
18636
18636
  return false;
18637
18637
  });
18638
18638
  function PropertyFieldBindingInternal(t0) {
18639
- const $ = c(18);
18639
+ const $ = c(19);
18640
18640
  const {
18641
18641
  propertyKey,
18642
18642
  property,
@@ -18645,6 +18645,7 @@ function PropertyFieldBindingInternal(t0) {
18645
18645
  underlyingValueHasChanged,
18646
18646
  disabled: disabledProp,
18647
18647
  partOfArray,
18648
+ partOfBlock,
18648
18649
  minimalistView,
18649
18650
  autoFocus,
18650
18651
  index,
@@ -18653,15 +18654,8 @@ function PropertyFieldBindingInternal(t0) {
18653
18654
  } = t0;
18654
18655
  const authController = useAuthController();
18655
18656
  const customizationController = useCustomizationController();
18656
- if (propertyKey === "created_by") {
18657
- console.log("Rendering field for created_by", {
18658
- propertyKey,
18659
- property,
18660
- context
18661
- });
18662
- }
18663
18657
  let t1;
18664
- if ($[0] !== authController || $[1] !== autoFocus || $[2] !== context || $[3] !== customizationController.propertyConfigs || $[4] !== disabledProp || $[5] !== includeDescription || $[6] !== index || $[7] !== minimalistView || $[8] !== onPropertyChange || $[9] !== partOfArray || $[10] !== property || $[11] !== propertyKey || $[12] !== size || $[13] !== underlyingValueHasChanged) {
18658
+ if ($[0] !== authController || $[1] !== autoFocus || $[2] !== context || $[3] !== customizationController.propertyConfigs || $[4] !== disabledProp || $[5] !== includeDescription || $[6] !== index || $[7] !== minimalistView || $[8] !== onPropertyChange || $[9] !== partOfArray || $[10] !== partOfBlock || $[11] !== property || $[12] !== propertyKey || $[13] !== size || $[14] !== underlyingValueHasChanged) {
18665
18659
  t1 = (fieldProps) => {
18666
18660
  let Component;
18667
18661
  const resolvedProperty = resolveProperty({
@@ -18724,6 +18718,7 @@ function PropertyFieldBindingInternal(t0) {
18724
18718
  context,
18725
18719
  disabled,
18726
18720
  partOfArray,
18721
+ partOfBlock,
18727
18722
  minimalistView,
18728
18723
  autoFocus,
18729
18724
  size,
@@ -18741,22 +18736,23 @@ function PropertyFieldBindingInternal(t0) {
18741
18736
  $[7] = minimalistView;
18742
18737
  $[8] = onPropertyChange;
18743
18738
  $[9] = partOfArray;
18744
- $[10] = property;
18745
- $[11] = propertyKey;
18746
- $[12] = size;
18747
- $[13] = underlyingValueHasChanged;
18748
- $[14] = t1;
18739
+ $[10] = partOfBlock;
18740
+ $[11] = property;
18741
+ $[12] = propertyKey;
18742
+ $[13] = size;
18743
+ $[14] = underlyingValueHasChanged;
18744
+ $[15] = t1;
18749
18745
  } else {
18750
- t1 = $[14];
18746
+ t1 = $[15];
18751
18747
  }
18752
18748
  let t2;
18753
- if ($[15] !== propertyKey || $[16] !== t1) {
18749
+ if ($[16] !== propertyKey || $[17] !== t1) {
18754
18750
  t2 = /* @__PURE__ */ jsx(Field, { name: propertyKey, children: t1 }, propertyKey);
18755
- $[15] = propertyKey;
18756
- $[16] = t1;
18757
- $[17] = t2;
18751
+ $[16] = propertyKey;
18752
+ $[17] = t1;
18753
+ $[18] = t2;
18758
18754
  } else {
18759
- t2 = $[17];
18755
+ t2 = $[18];
18760
18756
  }
18761
18757
  return t2;
18762
18758
  }
@@ -18768,6 +18764,7 @@ function FieldInternal({
18768
18764
  includeDescription,
18769
18765
  underlyingValueHasChanged,
18770
18766
  partOfArray,
18767
+ partOfBlock,
18771
18768
  minimalistView,
18772
18769
  autoFocus,
18773
18770
  context,
@@ -18817,6 +18814,7 @@ function FieldInternal({
18817
18814
  disabled: disabled ?? false,
18818
18815
  underlyingValueHasChanged: underlyingValueHasChanged ?? false,
18819
18816
  partOfArray: partOfArray ?? false,
18817
+ partOfBlock: partOfBlock ?? false,
18820
18818
  minimalistView: minimalistView ?? false,
18821
18819
  autoFocus: autoFocus ?? false,
18822
18820
  customProps: customFieldProps,
@@ -20128,6 +20126,7 @@ function BlockEntry(t0) {
20128
20126
  context,
20129
20127
  autoFocus,
20130
20128
  partOfArray: false,
20129
+ partOfBlock: true,
20131
20130
  minimalistView: true,
20132
20131
  onPropertyChange: storeProps
20133
20132
  } : void 0;
@@ -22053,7 +22052,7 @@ function ArrayContainerItem(t0) {
22053
22052
  storedProps,
22054
22053
  updateItemCustomProps
22055
22054
  } = t0;
22056
- const t1 = `relative ${!isDragging ? "hover\\:bg-surface-accent-50 dark\\:hover\\:bg-surface-800 dark\\:hover\\:bg-opacity-20" : ""} rounded-md opacity-100`;
22055
+ const t1 = `relative ${!isDragging ? "hover\\:bg-surface-accent-50 dark\\:hover\\:bg-surface-800 dark\\:hover\\:bg-opacity-20 dark\\:hover\\:bg-surface-800/20" : ""} rounded-md opacity-100`;
22057
22056
  let t2;
22058
22057
  if ($[0] !== internalId || $[1] !== updateItemCustomProps) {
22059
22058
  t2 = (props) => updateItemCustomProps(internalId, props);
@@ -22376,7 +22375,7 @@ function ReferenceWidget({
22376
22375
  } else if (value?.isEntityReference && value?.isEntityReference()) {
22377
22376
  child = /* @__PURE__ */ jsx(ReferencePreview, { reference: value, onClick: onEntryClick, disabled, previewProperties, size, includeId, includeEntityLink });
22378
22377
  }
22379
- return /* @__PURE__ */ jsxs("div", { className: cls("text-sm font-medium", "min-w-80 flex flex-col gap-4", "relative transition-colors duration-200 ease-in rounded font-medium", disabled ? "bg-opacity-50" : "hover:bg-opacity-75", "text-opacity-50 dark:text-white dark:text-opacity-50", className), children: [
22378
+ return /* @__PURE__ */ jsxs("div", { className: cls("text-sm font-medium", "min-w-80 flex flex-col gap-4", "relative transition-colors duration-200 ease-in rounded font-medium", disabled ? "bg-opacity-50" : "hover:bg-opacity-75", "text-opacity-50 text-text-primary/50 dark:text-white dark:text-opacity-50 dark:text-white/50", className), children: [
22380
22379
  child,
22381
22380
  !value && /* @__PURE__ */ jsx("div", { className: "justify-center text-left", children: /* @__PURE__ */ jsxs(Button, { variant: "outlined", color: "primary", disabled, onClick: onEntryClick, children: [
22382
22381
  "Edit ",
@@ -25264,7 +25263,7 @@ function DrawerNavigationItem(t0) {
25264
25263
  const {
25265
25264
  isActive
25266
25265
  } = t52;
25267
- return cls("rounded-lg truncate", "hover:bg-surface-accent-300 hover:bg-opacity-75 dark:hover:bg-surface-accent-800 dark:hover:bg-opacity-75 text-text-primary dark:text-surface-200 hover:text-surface-900 hover:dark:text-white", "flex flex-row items-center mr-8", drawerOpen ? "pl-4 h-10" : "pl-4 h-9", "font-semibold text-xs", isActive ? "bg-surface-accent-200 bg-opacity-60 dark:bg-surface-800 dark:bg-opacity-50" : "");
25266
+ return cls("rounded-lg truncate", "hover:bg-surface-accent-300 hover:bg-opacity-75 hover:bg-surface-accent-300/75 dark:hover:bg-surface-accent-800 dark:hover:bg-opacity-75 dark:hover:bg-surface-accent-800/75 text-text-primary dark:text-surface-200 hover:text-surface-900 hover:dark:text-white hover:bg-surface-accent-300/75 dark:hover:bg-surface-accent-800/75", "flex flex-row items-center mr-8", drawerOpen ? "pl-4 h-10" : "pl-4 h-9", "font-semibold text-xs", isActive ? "bg-surface-accent-200 bg-opacity-60 dark:bg-surface-800 dark:bg-opacity-50 bg-surface-accent-200/60 dark:bg-surface-800/50" : "");
25268
25267
  };
25269
25268
  $[4] = drawerOpen;
25270
25269
  $[5] = t4;
@@ -25274,7 +25273,7 @@ function DrawerNavigationItem(t0) {
25274
25273
  const t5 = drawerOpen ? "opacity-100" : "opacity-0 hidden";
25275
25274
  let t6;
25276
25275
  if ($[6] !== t5) {
25277
- t6 = cls(t5, "ml-4 font-inherit text-inherit");
25276
+ t6 = cls("text-text-primary dark:text-surface-200", t5, "ml-4 font-inherit");
25278
25277
  $[6] = t5;
25279
25278
  $[7] = t6;
25280
25279
  } else {
@@ -25422,7 +25421,7 @@ function DefaultDrawer(t0) {
25422
25421
  }
25423
25422
  let t10;
25424
25423
  if ($[41] !== adminMenuOpen || $[42] !== buildGroupHeader || $[43] !== drawerOpen || $[44] !== navigationEntries || $[45] !== onClick || $[46] !== tooltipsOpen) {
25425
- t10 = (group_0) => /* @__PURE__ */ jsxs("div", { className: "bg-surface-50 dark:bg-surface-800 dark:bg-opacity-30 my-4 rounded-lg ml-3 mr-1", children: [
25424
+ t10 = (group_0) => /* @__PURE__ */ jsxs("div", { className: "bg-surface-50 dark:bg-surface-800 dark:bg-opacity-30 dark:bg-surface-800/30 bg-surface-50 dark:bg-surface-800/30 my-4 rounded-lg ml-3 mr-1", children: [
25426
25425
  buildGroupHeader(group_0),
25427
25426
  Object.values(navigationEntries).filter((e_0) => e_0.group === group_0).map((view_0) => /* @__PURE__ */ jsx(DrawerNavigationItem, { icon: /* @__PURE__ */ jsx(IconForView, { collectionOrView: view_0.collection ?? view_0.view, size: "small" }), tooltipsOpen, adminMenuOpen, drawerOpen, onClick: () => onClick(view_0), url: view_0.url, name: view_0.name }, view_0.id))
25428
25427
  ] }, `drawer_group_${group_0}`);
@@ -26930,7 +26929,7 @@ function DrawerWrapper(props) {
26930
26929
  }
26931
26930
  let t12;
26932
26931
  if ($[24] !== innerDrawer || $[25] !== props.open || $[26] !== props.setDrawerOpen) {
26933
- t12 = /* @__PURE__ */ jsx(Sheet, { side: "left", transparent: true, open: props.open, onOpenChange: props.setDrawerOpen, title: "Navigation drawer", overlayClassName: "bg-white bg-opacity-80", children: innerDrawer });
26932
+ t12 = /* @__PURE__ */ jsx(Sheet, { side: "left", transparent: true, open: props.open, onOpenChange: props.setDrawerOpen, title: "Navigation drawer", overlayClassName: "bg-white bg-opacity-80 bg-white/80", children: innerDrawer });
26934
26933
  $[24] = innerDrawer;
26935
26934
  $[25] = props.open;
26936
26935
  $[26] = props.setDrawerOpen;