@firecms/core 3.0.0-canary.261 → 3.0.0-canary.262

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.
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
  import { Entity, EntityCollection } from "../types";
3
3
  import { PreviewSize } from "../preview";
4
4
  export type EntityPreviewProps = {
5
- size: PreviewSize;
5
+ size?: PreviewSize;
6
6
  actions?: React.ReactNode;
7
7
  collection?: EntityCollection;
8
8
  hover?: boolean;
@@ -24,7 +24,7 @@ export type EntityPreviewContainerProps = {
24
24
  children: React.ReactNode;
25
25
  hover?: boolean;
26
26
  fullwidth?: boolean;
27
- size: PreviewSize;
27
+ size?: PreviewSize;
28
28
  className?: string;
29
29
  style?: React.CSSProperties;
30
30
  onClick?: (e: React.SyntheticEvent) => void;
package/dist/index.es.js CHANGED
@@ -431,7 +431,7 @@ function isReadOnly(property) {
431
431
  if (property.autoValue) return true;
432
432
  }
433
433
  if (property.dataType === "reference") {
434
- return !property.path;
434
+ return !property.path && !property.Field;
435
435
  }
436
436
  return false;
437
437
  }
@@ -5810,7 +5810,7 @@ function EntityPreview({
5810
5810
  collection: collectionProp,
5811
5811
  previewKeys,
5812
5812
  onClick,
5813
- size,
5813
+ size = "medium",
5814
5814
  includeId = true,
5815
5815
  includeTitle = true,
5816
5816
  includeEntityLink = true,
@@ -5879,18 +5879,18 @@ const EntityPreviewContainer = React.forwardRef((t0, ref) => {
5879
5879
  let hover;
5880
5880
  let onClick;
5881
5881
  let props;
5882
- let size;
5883
5882
  let style;
5884
5883
  let t1;
5884
+ let t2;
5885
5885
  if ($[0] !== t0) {
5886
5886
  ({
5887
5887
  children,
5888
5888
  hover,
5889
5889
  onClick,
5890
- size,
5890
+ size: t1,
5891
5891
  style,
5892
5892
  className,
5893
- fullwidth: t1,
5893
+ fullwidth: t2,
5894
5894
  ...props
5895
5895
  } = t0);
5896
5896
  $[0] = t0;
@@ -5899,74 +5899,75 @@ const EntityPreviewContainer = React.forwardRef((t0, ref) => {
5899
5899
  $[3] = hover;
5900
5900
  $[4] = onClick;
5901
5901
  $[5] = props;
5902
- $[6] = size;
5903
- $[7] = style;
5904
- $[8] = t1;
5902
+ $[6] = style;
5903
+ $[7] = t1;
5904
+ $[8] = t2;
5905
5905
  } else {
5906
5906
  children = $[1];
5907
5907
  className = $[2];
5908
5908
  hover = $[3];
5909
5909
  onClick = $[4];
5910
5910
  props = $[5];
5911
- size = $[6];
5912
- style = $[7];
5913
- t1 = $[8];
5911
+ style = $[6];
5912
+ t1 = $[7];
5913
+ t2 = $[8];
5914
5914
  }
5915
- const fullwidth = t1 === void 0 ? true : t1;
5916
- let t2;
5915
+ const size = t1 === void 0 ? "medium" : t1;
5916
+ const fullwidth = t2 === void 0 ? true : t2;
5917
+ let t3;
5917
5918
  if ($[9] !== style) {
5918
- t2 = {
5919
+ t3 = {
5919
5920
  ...style,
5920
5921
  tabindex: 0
5921
5922
  };
5922
5923
  $[9] = style;
5923
- $[10] = t2;
5924
+ $[10] = t3;
5924
5925
  } else {
5925
- t2 = $[10];
5926
+ t3 = $[10];
5926
5927
  }
5927
- const t3 = fullwidth ? "w-full" : "";
5928
- const t4 = hover ? "hover:bg-surface-accent-50 dark:hover:bg-surface-800 group-hover:bg-surface-accent-50 dark:group-hover:bg-surface-800" : "";
5929
- const t5 = size === "small" ? "p-1" : "px-2 py-1";
5930
- const t6 = onClick ? "cursor-pointer" : "";
5931
- let t7;
5932
- if ($[11] !== className || $[12] !== t3 || $[13] !== t4 || $[14] !== t5 || $[15] !== t6) {
5933
- t7 = cls("bg-white dark:bg-surface-900", "min-h-[42px]", t3, "items-center", t4, t5, "flex border rounded-lg", t6, defaultBorderMixin, className);
5928
+ const t4 = fullwidth ? "w-full" : "";
5929
+ const t5 = hover ? "hover:bg-surface-accent-50 dark:hover:bg-surface-800 group-hover:bg-surface-accent-50 dark:group-hover:bg-surface-800" : "";
5930
+ const t6 = size === "small" ? "p-1" : "px-2 py-1";
5931
+ const t7 = onClick ? "cursor-pointer" : "";
5932
+ let t8;
5933
+ if ($[11] !== className || $[12] !== t4 || $[13] !== t5 || $[14] !== t6 || $[15] !== t7) {
5934
+ t8 = cls("bg-white dark:bg-surface-900", "min-h-[42px]", t4, "items-center", t5, t6, "flex border rounded-lg", t7, defaultBorderMixin, className);
5934
5935
  $[11] = className;
5935
- $[12] = t3;
5936
- $[13] = t4;
5937
- $[14] = t5;
5938
- $[15] = t6;
5939
- $[16] = t7;
5936
+ $[12] = t4;
5937
+ $[13] = t5;
5938
+ $[14] = t6;
5939
+ $[15] = t7;
5940
+ $[16] = t8;
5940
5941
  } else {
5941
- t7 = $[16];
5942
+ t8 = $[16];
5942
5943
  }
5943
- let t8;
5944
+ let t9;
5944
5945
  if ($[17] !== onClick) {
5945
- t8 = (event) => {
5946
+ t9 = (event) => {
5946
5947
  if (onClick) {
5947
5948
  event.preventDefault();
5948
5949
  onClick(event);
5949
5950
  }
5950
5951
  };
5951
5952
  $[17] = onClick;
5952
- $[18] = t8;
5953
+ $[18] = t9;
5953
5954
  } else {
5954
- t8 = $[18];
5955
+ t9 = $[18];
5955
5956
  }
5956
- let t9;
5957
- if ($[19] !== children || $[20] !== props || $[21] !== ref || $[22] !== t2 || $[23] !== t7 || $[24] !== t8) {
5958
- t9 = /* @__PURE__ */ jsx("div", { ref, style: t2, className: t7, onClick: t8, ...props, children });
5957
+ let t10;
5958
+ if ($[19] !== children || $[20] !== props || $[21] !== ref || $[22] !== t3 || $[23] !== t8 || $[24] !== t9) {
5959
+ t10 = /* @__PURE__ */ jsx("div", { ref, style: t3, className: t8, onClick: t9, ...props, children });
5959
5960
  $[19] = children;
5960
5961
  $[20] = props;
5961
5962
  $[21] = ref;
5962
- $[22] = t2;
5963
- $[23] = t7;
5964
- $[24] = t8;
5965
- $[25] = t9;
5963
+ $[22] = t3;
5964
+ $[23] = t8;
5965
+ $[24] = t9;
5966
+ $[25] = t10;
5966
5967
  } else {
5967
- t9 = $[25];
5968
+ t10 = $[25];
5968
5969
  }
5969
- return t9;
5970
+ return t10;
5970
5971
  });
5971
5972
  EntityPreviewContainer.displayName = "EntityPreviewContainer";
5972
5973
  const ReferencePreview = function ReferencePreview2(props) {
@@ -5975,7 +5976,7 @@ const ReferencePreview = function ReferencePreview2(props) {
5975
5976
  if (!(typeof reference === "object" && "isEntityReference" in reference && reference.isEntityReference())) {
5976
5977
  console.warn("Reference preview received value of type", typeof reference);
5977
5978
  const t02 = props.onClick;
5978
- const t1 = props.size;
5979
+ const t1 = props.size ?? "medium";
5979
5980
  let t2;
5980
5981
  if ($[0] !== reference) {
5981
5982
  t2 = JSON.stringify(reference);
@@ -5993,10 +5994,10 @@ const ReferencePreview = function ReferencePreview2(props) {
5993
5994
  t3 = $[3];
5994
5995
  }
5995
5996
  let t4;
5996
- if ($[4] !== props.onClick || $[5] !== props.size || $[6] !== t3) {
5997
+ if ($[4] !== props.onClick || $[5] !== t1 || $[6] !== t3) {
5997
5998
  t4 = /* @__PURE__ */ jsx(EntityPreviewContainer, { onClick: t02, size: t1, children: t3 });
5998
5999
  $[4] = props.onClick;
5999
- $[5] = props.size;
6000
+ $[5] = t1;
6000
6001
  $[6] = t3;
6001
6002
  $[7] = t4;
6002
6003
  } else {
@@ -12674,10 +12675,9 @@ function ReferenceSelectionTable({
12674
12675
  fullPath
12675
12676
  });
12676
12677
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-full", children: [
12677
- /* @__PURE__ */ jsx("div", { className: "flex-grow", children: entitiesDisplayedFirst && /* @__PURE__ */ jsx(EntityCollectionTable, { textSearchLoading, onTextSearchClick: textSearchInitialised ? void 0 : onTextSearchClick, textSearchEnabled, displayedColumnIds, onEntityClick, tableController, enablePopupIcon: false, tableRowActionsBuilder, openEntityMode: "side_panel", title: /* @__PURE__ */ jsxs(Typography, { variant: "subtitle2", className: "flex flex-row gap-2", children: [
12678
+ /* @__PURE__ */ jsx("div", { className: "flex-grow", children: entitiesDisplayedFirst && /* @__PURE__ */ jsx(EntityCollectionTable, { textSearchLoading, onTextSearchClick: textSearchInitialised ? void 0 : onTextSearchClick, textSearchEnabled, additionalFields: collection.additionalFields, displayedColumnIds, onEntityClick, tableController, enablePopupIcon: false, tableRowActionsBuilder, openEntityMode: "side_panel", title: /* @__PURE__ */ jsxs(Typography, { variant: "subtitle2", className: "flex flex-row gap-2", children: [
12678
12679
  /* @__PURE__ */ jsx(IconForView, { size: "small", collectionOrView: collection, className: "text-surface-300 dark:text-surface-600" }),
12679
- collection.singularName ? `Select ${collection.singularName}` : `Select
12680
- from ${collection.name}`
12680
+ collection.singularName ? `Select ${collection.singularName}` : `Select from ${collection.name}`
12681
12681
  ] }), defaultSize: collection.defaultSize, properties: resolvedCollection.properties, forceFilter, inlineEditing: false, selectionController, actions: /* @__PURE__ */ jsx(ReferenceDialogActions, { collection, path: fullPath, onNewClick, onClear }) }) }),
12682
12682
  /* @__PURE__ */ jsxs(DialogActions, { translucent: false, children: [
12683
12683
  description && /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "flex-grow text-left", children: description }),