@firecms/core 3.0.0-canary.175 → 3.0.0-canary.177

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.
@@ -426,10 +426,12 @@ export type EntityCustomView<M extends Record<string, any> = any> = {
426
426
  */
427
427
  name: string;
428
428
  /**
429
- * If set to true, the actions of the entity will be included in the
430
- * bottom of the panel (save buttons, delete buttons, etc.)
429
+ * If set to true, the actions of the entity (save, discard,delete) will be
430
+ * included in the view. By default the actions are located in the right or bottom,
431
+ * based on the screen size. You can force the actions to be located at the bottom
432
+ * by setting this prop to "bottom".
431
433
  */
432
- includeActions?: boolean;
434
+ includeActions?: boolean | "bottom";
433
435
  /**
434
436
  * Builder for rendering the custom view
435
437
  */
@@ -67,7 +67,8 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
67
67
  */
68
68
  partOfArray?: boolean;
69
69
  /**
70
- * Should this field render with the minimal amount of UI elements
70
+ * Display the child properties directly, without being wrapped in an
71
+ * extendable panel. Note that this will also hide the title of this property.
71
72
  */
72
73
  minimalistView?: boolean;
73
74
  /**
@@ -170,7 +171,8 @@ export interface PropertyFieldBindingProps<T extends CMSType, M extends Record<s
170
171
  */
171
172
  partOfArray?: boolean;
172
173
  /**
173
- * Is this field part of a block (oneOf array)
174
+ * Display the child properties directly, without being wrapped in an
175
+ * extendable panel. Note that this will also hide the title of this property.
174
176
  */
175
177
  minimalistView?: boolean;
176
178
  /**
@@ -361,6 +361,11 @@ export interface ArrayProperty<T extends ArrayT[] = any[], ArrayT extends CMSTyp
361
361
  * Should the field be initially expanded. Defaults to `true`
362
362
  */
363
363
  expanded?: boolean;
364
+ /**
365
+ * Display the child properties directly, without being wrapped in an
366
+ * extendable panel.
367
+ */
368
+ minimalistView?: boolean;
364
369
  }
365
370
  /**
366
371
  * @group Entity properties
@@ -400,6 +405,11 @@ export interface MapProperty<T extends Record<string, CMSType> = Record<string,
400
405
  * view
401
406
  */
402
407
  spreadChildren?: boolean;
408
+ /**
409
+ * Display the child properties directly, without being wrapped in an
410
+ * extendable panel. Note that this will also hide the title of this property.
411
+ */
412
+ minimalistView?: boolean;
403
413
  /**
404
414
  * Should the field be initially expanded. Defaults to `true`
405
415
  */
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.175",
4
+ "version": "3.0.0-canary.177",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/firecmsco"
@@ -50,9 +50,9 @@
50
50
  "./package.json": "./package.json"
51
51
  },
52
52
  "dependencies": {
53
- "@firecms/editor": "^3.0.0-canary.175",
54
- "@firecms/formex": "^3.0.0-canary.175",
55
- "@firecms/ui": "^3.0.0-canary.175",
53
+ "@firecms/editor": "^3.0.0-canary.177",
54
+ "@firecms/formex": "^3.0.0-canary.177",
55
+ "@firecms/ui": "^3.0.0-canary.177",
56
56
  "@hello-pangea/dnd": "^17.0.0",
57
57
  "@radix-ui/react-portal": "^1.1.3",
58
58
  "clsx": "^2.1.1",
@@ -104,7 +104,7 @@
104
104
  "dist",
105
105
  "src"
106
106
  ],
107
- "gitHead": "0fd5d55e8bba65c5bd992606c3f8c61e0ad75ed7",
107
+ "gitHead": "e265baef6fad623e57376b3338475bc0d5b49372",
108
108
  "publishConfig": {
109
109
  "access": "public"
110
110
  },
@@ -173,7 +173,7 @@ function FormLayout({
173
173
  return <div
174
174
  role="tabpanel"
175
175
  id={id}
176
- className={cls("relative flex flex-row max-w-4xl lg:max-w-3xl xl:max-w-4xl 2xl:max-w-5xl w-full h-fit", className)}>
176
+ className={cls("relative flex flex-row max-w-4xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl w-full h-fit", className)}>
177
177
 
178
178
  <div className={cls("flex flex-col w-full pt-12 pb-16 px-4 sm:px-8 md:px-10")}>
179
179
 
@@ -573,7 +573,7 @@ export function EntityEditViewInner<M extends Record<string, any>>({
573
573
  : [];
574
574
 
575
575
  const selectedEntityView = resolvedEntityViews.find(e => e.key === selectedTab);
576
- const shouldShowEntityActions = !autoSave && (selectedTab === MAIN_TAB_VALUE || selectedEntityView?.includeActions);
576
+ const shouldShowEntityActions = selectedTab === MAIN_TAB_VALUE || selectedEntityView?.includeActions;
577
577
 
578
578
  const secondaryForms: React.ReactNode[] | undefined = customViews && resolvedEntityViews
579
579
  .filter(e => e.includeActions)
@@ -1290,7 +1290,7 @@ function buildSideActions<M extends object>({
1290
1290
  }: ActionsViewProps<M>) {
1291
1291
 
1292
1292
  return <div
1293
- className={cls("overflow-auto h-full flex flex-col gap-2 w-96 px-4 py-16 sticky top-0 border-l", defaultBorderMixin)}>
1293
+ className={cls("overflow-auto h-full flex flex-col gap-2 w-80 xl:w-96 px-4 py-16 sticky top-0 border-l", defaultBorderMixin)}>
1294
1294
 
1295
1295
  <LoadingButton
1296
1296
  fullWidth={true}
@@ -20,7 +20,7 @@ export function ArrayCustomShapedFieldBinding<T extends Array<any>>({
20
20
  showError,
21
21
  isSubmitting,
22
22
  setValue,
23
- minimalistView,
23
+ minimalistView: minimalistViewProp,
24
24
  property,
25
25
  includeDescription,
26
26
  underlyingValueHasChanged,
@@ -28,6 +28,8 @@ export function ArrayCustomShapedFieldBinding<T extends Array<any>>({
28
28
  disabled
29
29
  }: FieldProps<T, any, any>) {
30
30
 
31
+ const minimalistView = minimalistViewProp || property.minimalistView;
32
+
31
33
  let resolvedProperties = "resolvedProperties" in property ? property.resolvedProperties : undefined;
32
34
  if (!resolvedProperties) {
33
35
  resolvedProperties = getArrayResolvedProperties({
@@ -25,13 +25,15 @@ export function ArrayOfReferencesFieldBinding({
25
25
  showError,
26
26
  disabled,
27
27
  isSubmitting,
28
- minimalistView,
28
+ minimalistView: minimalistViewProp,
29
29
  property,
30
30
  includeDescription,
31
31
  setValue,
32
32
  setFieldValue
33
33
  }: ArrayOfReferencesFieldProps) {
34
34
 
35
+ const minimalistView = minimalistViewProp || property.minimalistView;
36
+
35
37
  const ofProperty = property.of as ResolvedProperty;
36
38
  if (ofProperty.dataType !== "reference") {
37
39
  throw Error("ArrayOfReferencesField expected a property containing references");
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useEffect, useState } from "react";
1
+ import React, { useEffect, useState } from "react";
2
2
 
3
3
  import { Field, useFormex } from "@firecms/formex";
4
4
 
@@ -28,7 +28,7 @@ export function BlockFieldBinding<T extends Array<any>>({
28
28
  isSubmitting,
29
29
  setValue,
30
30
  setFieldValue,
31
- minimalistView,
31
+ minimalistView: minimalistViewProp,
32
32
  property,
33
33
  includeDescription,
34
34
  underlyingValueHasChanged,
@@ -36,6 +36,8 @@ export function BlockFieldBinding<T extends Array<any>>({
36
36
  disabled
37
37
  }: FieldProps<T>) {
38
38
 
39
+ const minimalistView = minimalistViewProp || property.minimalistView;
40
+
39
41
  if (!property.oneOf)
40
42
  throw Error("ArrayOneOfField misconfiguration. Property `oneOf` not set");
41
43
 
@@ -21,7 +21,7 @@ export function MapFieldBinding({
21
21
  error,
22
22
  disabled,
23
23
  property,
24
- minimalistView,
24
+ minimalistView: minimalistViewProp,
25
25
  includeDescription,
26
26
  underlyingValueHasChanged,
27
27
  autoFocus,
@@ -31,6 +31,7 @@ export function MapFieldBinding({
31
31
 
32
32
  const pickOnlySomeKeys = property.pickOnlySomeKeys || false;
33
33
  const expanded = property.expanded === undefined ? true : property.expanded;
34
+ const minimalistView = minimalistViewProp || property.minimalistView;
34
35
 
35
36
  if (!property.properties) {
36
37
  throw Error(`You need to specify a 'properties' prop (or specify a custom field) in your map property ${propertyKey}`);
@@ -23,7 +23,7 @@ export function RepeatFieldBinding<T extends Array<any>>({
23
23
  isSubmitting,
24
24
  setValue,
25
25
  setFieldValue,
26
- minimalistView,
26
+ minimalistView: minimalistViewProp,
27
27
  property,
28
28
  includeDescription,
29
29
  underlyingValueHasChanged,
@@ -31,6 +31,8 @@ export function RepeatFieldBinding<T extends Array<any>>({
31
31
  disabled
32
32
  }: FieldProps<T>) {
33
33
 
34
+ const minimalistView = minimalistViewProp || property.minimalistView;
35
+
34
36
  if (!property.of)
35
37
  throw Error("RepeatFieldBinding misconfiguration. Property `of` not set");
36
38
 
@@ -498,21 +498,26 @@ export type EntityCustomView<M extends Record<string, any> = any> =
498
498
  /**
499
499
  * Key of this custom view.
500
500
  */
501
- key: string,
501
+ key: string;
502
+
502
503
  /**
503
504
  * Name of this custom view.
504
505
  */
505
- name: string,
506
+ name: string;
507
+
506
508
  /**
507
- * If set to true, the actions of the entity will be included in the
508
- * bottom of the panel (save buttons, delete buttons, etc.)
509
+ * If set to true, the actions of the entity (save, discard,delete) will be
510
+ * included in the view. By default the actions are located in the right or bottom,
511
+ * based on the screen size. You can force the actions to be located at the bottom
512
+ * by setting this prop to "bottom".
509
513
  */
510
- includeActions?: boolean;
514
+ includeActions?: boolean | "bottom";
515
+
511
516
  /**
512
517
  * Builder for rendering the custom view
513
518
  */
514
519
  Builder?: React.ComponentType<EntityCustomViewParams<M>>;
515
- }
520
+ };
516
521
 
517
522
  /**
518
523
  * Parameters passed to the builder in charge of rendering a custom panel for
@@ -81,7 +81,8 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
81
81
  partOfArray?: boolean;
82
82
 
83
83
  /**
84
- * Should this field render with the minimal amount of UI elements
84
+ * Display the child properties directly, without being wrapped in an
85
+ * extendable panel. Note that this will also hide the title of this property.
85
86
  */
86
87
  minimalistView?: boolean;
87
88
 
@@ -207,7 +208,8 @@ export interface PropertyFieldBindingProps<T extends CMSType, M extends Record<s
207
208
  partOfArray?: boolean;
208
209
 
209
210
  /**
210
- * Is this field part of a block (oneOf array)
211
+ * Display the child properties directly, without being wrapped in an
212
+ * extendable panel. Note that this will also hide the title of this property.
211
213
  */
212
214
  minimalistView?: boolean;
213
215
 
@@ -469,6 +469,12 @@ export interface ArrayProperty<T extends ArrayT[] = any[], ArrayT extends CMSTyp
469
469
  */
470
470
  expanded?: boolean;
471
471
 
472
+ /**
473
+ * Display the child properties directly, without being wrapped in an
474
+ * extendable panel.
475
+ */
476
+ minimalistView?: boolean;
477
+
472
478
  }
473
479
 
474
480
  /**
@@ -517,6 +523,12 @@ export interface MapProperty<T extends Record<string, CMSType> = Record<string,
517
523
  */
518
524
  spreadChildren?: boolean;
519
525
 
526
+ /**
527
+ * Display the child properties directly, without being wrapped in an
528
+ * extendable panel. Note that this will also hide the title of this property.
529
+ */
530
+ minimalistView?: boolean;
531
+
520
532
  /**
521
533
  * Should the field be initially expanded. Defaults to `true`
522
534
  */