@firecms/core 3.0.0-canary.103 → 3.0.0-canary.104

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.
@@ -58,7 +58,8 @@ export interface EntityCollection<M extends Record<string, any> = any, UserType
58
58
  * Icon key to use in this collection.
59
59
  * You can use any of the icons in the Material specs:
60
60
  * https://fonts.google.com/icons
61
- * e.g. 'account_tree' or 'person'
61
+ * e.g. 'account_tree' or 'person'.
62
+ * Find all the icons in https://firecms.co/docs/icons
62
63
  */
63
64
  icon?: string;
64
65
  /**
@@ -270,6 +271,10 @@ export interface EntityCollection<M extends Record<string, any> = any, UserType
270
271
  * Width of the side dialog (in pixels) when opening an entity in this collection.
271
272
  */
272
273
  sideDialogWidth?: number | string;
274
+ /**
275
+ * Default preview properties displayed when this collection is referenced to.
276
+ */
277
+ previewProperties?: string[];
273
278
  }
274
279
  /**
275
280
  * Parameter passed to the `Actions` prop in the collection configuration.
@@ -144,6 +144,7 @@ export interface CMSView {
144
144
  * You can use any of the icons in the Material specs:
145
145
  * https://fonts.google.com/icons
146
146
  * e.g. 'account_tree' or 'person'
147
+ * Find all the icons in https://firecms.co/docs/icons
147
148
  */
148
149
  icon?: string;
149
150
  /**
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.103",
4
+ "version": "3.0.0-canary.104",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/firecmsco"
@@ -46,9 +46,9 @@
46
46
  "./package.json": "./package.json"
47
47
  },
48
48
  "dependencies": {
49
- "@firecms/editor": "^3.0.0-canary.103",
50
- "@firecms/formex": "^3.0.0-canary.103",
51
- "@firecms/ui": "^3.0.0-canary.103",
49
+ "@firecms/editor": "^3.0.0-canary.104",
50
+ "@firecms/formex": "^3.0.0-canary.104",
51
+ "@firecms/ui": "^3.0.0-canary.104",
52
52
  "@hello-pangea/dnd": "^16.6.0",
53
53
  "@radix-ui/react-portal": "^1.1.1",
54
54
  "clsx": "^2.1.1",
@@ -100,7 +100,7 @@
100
100
  "dist",
101
101
  "src"
102
102
  ],
103
- "gitHead": "c33fe736fee99aaf30789aed66e4385563011783",
103
+ "gitHead": "df5ac9be9439d01c0acf3666fad83bc87d236eb6",
104
104
  "publishConfig": {
105
105
  "access": "public"
106
106
  },
@@ -34,6 +34,7 @@ function ReferenceFieldBindingInternal({
34
34
  showError,
35
35
  isSubmitting,
36
36
  disabled,
37
+ minimalistView,
37
38
  touched,
38
39
  autoFocus,
39
40
  property,
@@ -82,10 +83,10 @@ function ReferenceFieldBindingInternal({
82
83
 
83
84
  return (
84
85
  <>
85
- <LabelWithIcon icon={getIconForProperty(property, "small")}
86
- required={property.validation?.required}
87
- title={property.name}
88
- className={"text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>
86
+ {!minimalistView && <LabelWithIcon icon={getIconForProperty(property, "small")}
87
+ required={property.validation?.required}
88
+ title={property.name}
89
+ className={"text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>}
89
90
 
90
91
  {!collection && <ErrorView
91
92
  error={"The specified collection does not exist. Check console"}/>}
@@ -67,7 +67,8 @@ export interface EntityCollection<M extends Record<string, any> = any, UserType
67
67
  * Icon key to use in this collection.
68
68
  * You can use any of the icons in the Material specs:
69
69
  * https://fonts.google.com/icons
70
- * e.g. 'account_tree' or 'person'
70
+ * e.g. 'account_tree' or 'person'.
71
+ * Find all the icons in https://firecms.co/docs/icons
71
72
  */
72
73
  icon?: string;
73
74
 
@@ -310,6 +311,11 @@ export interface EntityCollection<M extends Record<string, any> = any, UserType
310
311
  * Width of the side dialog (in pixels) when opening an entity in this collection.
311
312
  */
312
313
  sideDialogWidth?: number | string;
314
+
315
+ /**
316
+ * Default preview properties displayed when this collection is referenced to.
317
+ */
318
+ previewProperties?: string[];
313
319
  }
314
320
 
315
321
  /**
@@ -173,6 +173,7 @@ export interface CMSView {
173
173
  * You can use any of the icons in the Material specs:
174
174
  * https://fonts.google.com/icons
175
175
  * e.g. 'account_tree' or 'person'
176
+ * Find all the icons in https://firecms.co/docs/icons
176
177
  */
177
178
  icon?: string;
178
179
 
@@ -9,6 +9,9 @@ export function getEntityPreviewKeys(targetCollection: EntityCollection<any>,
9
9
  limit = 3) {
10
10
  const allProperties = Object.keys(targetCollection.properties);
11
11
  let listProperties = previewProperties?.filter(p => allProperties.includes(p as string));
12
+ if (!listProperties && targetCollection.previewProperties) {
13
+ listProperties = targetCollection.previewProperties?.filter(p => allProperties.includes(p as string));
14
+ }
12
15
  if (listProperties && listProperties.length > 0) {
13
16
  return listProperties;
14
17
  } else {