@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.
@@ -4,7 +4,7 @@ import { PreviewSize } from "../PropertyPreviewProps";
4
4
  export type ReferencePreviewProps = {
5
5
  disabled?: boolean;
6
6
  reference: EntityReference;
7
- size: PreviewSize;
7
+ size?: PreviewSize;
8
8
  previewProperties?: string[];
9
9
  onClick?: (e: React.SyntheticEvent) => void;
10
10
  hover?: boolean;
@@ -497,7 +497,7 @@ export interface ReferenceProperty extends BaseProperty<EntityReference> {
497
497
  * You can leave this prop undefined if the path is not yet know, e.g.
498
498
  * you are using a property builder and the path depends on a different
499
499
  * property.
500
- * Note that you can also use a collection alias.
500
+ * Note that you can also use a collection id.
501
501
  */
502
502
  path?: string;
503
503
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@firecms/core",
3
3
  "type": "module",
4
- "version": "3.0.0-canary.261",
4
+ "version": "3.0.0-canary.262",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/firecmsco"
@@ -53,9 +53,9 @@
53
53
  "@dnd-kit/core": "^6.3.1",
54
54
  "@dnd-kit/modifiers": "^9.0.0",
55
55
  "@dnd-kit/sortable": "^10.0.0",
56
- "@firecms/editor": "^3.0.0-canary.261",
57
- "@firecms/formex": "^3.0.0-canary.261",
58
- "@firecms/ui": "^3.0.0-canary.261",
56
+ "@firecms/editor": "^3.0.0-canary.262",
57
+ "@firecms/formex": "^3.0.0-canary.262",
58
+ "@firecms/ui": "^3.0.0-canary.262",
59
59
  "@radix-ui/react-portal": "^1.1.3",
60
60
  "clsx": "^2.1.1",
61
61
  "date-fns": "^3.6.0",
@@ -107,7 +107,7 @@
107
107
  "dist",
108
108
  "src"
109
109
  ],
110
- "gitHead": "ef43edff9ed897c8fc7b672b568eca7b381758bc",
110
+ "gitHead": "c4735e41358ca64630b299dd6746e277e452e88f",
111
111
  "publishConfig": {
112
112
  "access": "public"
113
113
  },
@@ -23,7 +23,7 @@ import {
23
23
  import { useAnalyticsController } from "../hooks/useAnalyticsController";
24
24
 
25
25
  export type EntityPreviewProps = {
26
- size: PreviewSize,
26
+ size?: PreviewSize,
27
27
  actions?: React.ReactNode,
28
28
  collection?: EntityCollection,
29
29
  hover?: boolean;
@@ -48,7 +48,7 @@ export function EntityPreview({
48
48
  collection: collectionProp,
49
49
  previewKeys,
50
50
  onClick,
51
- size,
51
+ size = "medium",
52
52
  includeId = true,
53
53
  includeTitle = true,
54
54
  includeEntityLink = true,
@@ -194,7 +194,7 @@ export type EntityPreviewContainerProps = {
194
194
  children: React.ReactNode;
195
195
  hover?: boolean;
196
196
  fullwidth?: boolean;
197
- size: PreviewSize;
197
+ size?: PreviewSize;
198
198
  className?: string;
199
199
  style?: React.CSSProperties;
200
200
  onClick?: (e: React.SyntheticEvent) => void;
@@ -204,7 +204,7 @@ export const EntityPreviewContainer = React.forwardRef<HTMLDivElement, EntityPre
204
204
  children,
205
205
  hover,
206
206
  onClick,
207
- size,
207
+ size = "medium",
208
208
  style,
209
209
  className,
210
210
  fullwidth = true,
@@ -289,6 +289,7 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
289
289
  textSearchLoading={textSearchLoading}
290
290
  onTextSearchClick={textSearchInitialised ? undefined : onTextSearchClick}
291
291
  textSearchEnabled={textSearchEnabled}
292
+ additionalFields={collection.additionalFields}
292
293
  displayedColumnIds={displayedColumnIds}
293
294
  onEntityClick={onEntityClick}
294
295
  tableController={tableController}
@@ -300,8 +301,9 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
300
301
  size={"small"}
301
302
  collectionOrView={collection}
302
303
  className={"text-surface-300 dark:text-surface-600"}/>
303
- {collection.singularName ? `Select ${collection.singularName}` : `Select
304
- from ${collection.name}`}
304
+ {collection.singularName
305
+ ? `Select ${collection.singularName}`
306
+ : `Select from ${collection.name}`}
305
307
  </Typography>}
306
308
  defaultSize={collection.defaultSize}
307
309
  properties={resolvedCollection.properties}
@@ -10,7 +10,7 @@ import { EntityPreview, EntityPreviewContainer } from "../../components/EntityPr
10
10
  export type ReferencePreviewProps = {
11
11
  disabled?: boolean;
12
12
  reference: EntityReference,
13
- size: PreviewSize;
13
+ size?: PreviewSize;
14
14
  previewProperties?: string[];
15
15
  onClick?: (e: React.SyntheticEvent) => void;
16
16
  hover?: boolean;
@@ -27,7 +27,7 @@ export const ReferencePreview = function ReferencePreview(props: ReferencePrevie
27
27
  console.warn("Reference preview received value of type", typeof reference);
28
28
  return <EntityPreviewContainer
29
29
  onClick={props.onClick}
30
- size={props.size}>
30
+ size={props.size ?? "medium"}>
31
31
  <ErrorView error={"Unexpected value. Click to edit"}
32
32
  tooltip={JSON.stringify(reference)}/>
33
33
  </EntityPreviewContainer>;
@@ -140,6 +140,7 @@ function ReferencePreviewExisting<M extends Record<string, any> = any>({
140
140
  </EntityPreviewContainer>
141
141
  );
142
142
  }
143
+
143
144
  return <EntityPreview size={size}
144
145
  previewKeys={previewProperties}
145
146
  disabled={disabled}
@@ -638,7 +638,7 @@ export interface ReferenceProperty extends BaseProperty<EntityReference> {
638
638
  * You can leave this prop undefined if the path is not yet know, e.g.
639
639
  * you are using a property builder and the path depends on a different
640
640
  * property.
641
- * Note that you can also use a collection alias.
641
+ * Note that you can also use a collection id.
642
642
  */
643
643
  path?: string;
644
644
 
@@ -23,7 +23,7 @@ export function isReadOnly(property: Property<any> | ResolvedProperty<any>): boo
23
23
  return true;
24
24
  }
25
25
  if (property.dataType === "reference") {
26
- return !property.path;
26
+ return !property.path && !property.Field;
27
27
  }
28
28
  return false;
29
29
  }