@firecms/core 3.0.0-canary.142 → 3.0.0-canary.144

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@firecms/core",
3
3
  "type": "module",
4
- "version": "3.0.0-canary.142",
4
+ "version": "3.0.0-canary.144",
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.142",
50
- "@firecms/formex": "^3.0.0-canary.142",
51
- "@firecms/ui": "^3.0.0-canary.142",
49
+ "@firecms/editor": "^3.0.0-canary.144",
50
+ "@firecms/formex": "^3.0.0-canary.144",
51
+ "@firecms/ui": "^3.0.0-canary.144",
52
52
  "@hello-pangea/dnd": "^17.0.0",
53
53
  "@radix-ui/react-portal": "^1.1.2",
54
54
  "clsx": "^2.1.1",
@@ -100,7 +100,7 @@
100
100
  "dist",
101
101
  "src"
102
102
  ],
103
- "gitHead": "9adfc426dab9b7e197f1080065e08d49366fdadd",
103
+ "gitHead": "8f862289db623ffd350e61e4ab4a06957ed97bdf",
104
104
  "publishConfig": {
105
105
  "access": "public"
106
106
  },
@@ -6,6 +6,7 @@ import { getHashValue } from "../util";
6
6
  import {
7
7
  AddIcon,
8
8
  Button,
9
+ cls,
9
10
  ContentCopyIcon,
10
11
  HandleIcon,
11
12
  IconButton,
@@ -173,7 +174,7 @@ export function ArrayContainer<T>({
173
174
  >
174
175
  {(droppableProvided, droppableSnapshot) => (
175
176
  <div
176
- className={className}
177
+ className={cls("space-y-1", className)}
177
178
  {...droppableProvided.droppableProps}
178
179
  ref={droppableProvided.innerRef}>
179
180
  {hasValue && internalIds.map((internalId: number, index: number) => {
@@ -23,6 +23,7 @@ import { Button, ClearIcon, DialogActions, IconButton, Typography } from "@firec
23
23
  import { PropertyFieldBinding } from "../../../../form";
24
24
  import { useCustomizationController, useDataSource, useFireCMSContext } from "../../../../hooks";
25
25
  import { OnCellValueChangeParams } from "../../../common";
26
+ import { yupToFormErrors } from "../../../../core/EntityEditView";
26
27
 
27
28
  interface PopupFormFieldProps<M extends Record<string, any>> {
28
29
  customFieldValidator?: CustomFieldValidator;
@@ -240,11 +241,12 @@ export function PopupFormFieldInternal<M extends Record<string, any>>({
240
241
  return validationSchema?.validate(values, { abortEarly: false })
241
242
  .then(() => ({}))
242
243
  .catch((e) => {
243
- const errors: Record<string, string> = {};
244
- e.inner.forEach((error: any) => {
245
- errors[error.path] = error.message;
246
- });
247
- return errors;
244
+ // const errors: Record<string, string> = {};
245
+ // e.inner.forEach((error: any) => {
246
+ // errors[error.path] = error.message;
247
+ // });
248
+ // return errors;
249
+ return yupToFormErrors(e);
248
250
  });
249
251
  },
250
252
  validateOnInitialRender: true,
@@ -77,19 +77,21 @@ export const DefaultAppBar = function DefaultAppBar({
77
77
 
78
78
  const user = userProp ?? authController.user;
79
79
 
80
- let avatarComponent: JSX.Element;
81
- if (user && user.photoURL) {
82
- avatarComponent = <Avatar
83
- src={user.photoURL}/>;
80
+ let avatarComponent: JSX.Element | null;
81
+
82
+ if (user) {
83
+ const initial = user?.displayName
84
+ ? user.displayName[0].toUpperCase()
85
+ : (user?.email ? user.email[0].toUpperCase() : "A");
86
+ avatarComponent = <Avatar src={user.photoURL ?? undefined}>
87
+ {initial}
88
+ </Avatar>;
84
89
  } else if (user === undefined || authController.initialLoading) {
85
90
  avatarComponent = <div className={"p-1 flex justify-center"}>
86
91
  <Skeleton className={"w-10 h-10 rounded-full"}/>
87
92
  </div>;
88
93
  } else {
89
- const initial = user?.displayName
90
- ? user.displayName[0].toUpperCase()
91
- : (user?.email ? user.email[0].toUpperCase() : "A");
92
- avatarComponent = <Avatar>{initial}</Avatar>;
94
+ avatarComponent = null;
93
95
  }
94
96
 
95
97
  return (
@@ -431,10 +431,10 @@ export function EntityEditViewInner<M extends Record<string, any>>({
431
431
  return {};
432
432
  })
433
433
  .catch((e: any) => {
434
- const errors: Record<string, string> = {};
435
- e.inner.forEach((error: any) => {
436
- errors[error.path] = error.message;
437
- });
434
+ // const errors: Record<string, string> = {};
435
+ // e.inner.forEach((error: any) => {
436
+ // errors[error.path] = error.message;
437
+ // });
438
438
  return yupToFormErrors(e);
439
439
  });
440
440
  }