@firecms/core 3.0.0-canary.163 → 3.0.0-canary.164
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/dist/index.es.js +54 -53
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +54 -53
- package/dist/index.umd.js.map +1 -1
- package/dist/util/entities.d.ts +1 -1
- package/package.json +5 -5
- package/src/core/DefaultAppBar.tsx +2 -3
- package/src/core/DefaultDrawer.tsx +2 -1
- package/src/util/entities.ts +3 -1
package/dist/util/entities.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare function isReadOnly(property: Property<any> | ResolvedProperty<an
|
|
|
3
3
|
export declare function isHidden(property: Property | ResolvedProperty): boolean;
|
|
4
4
|
export declare function isPropertyBuilder<T extends CMSType, M extends Record<string, any>>(propertyOrBuilder?: PropertyOrBuilder<T, M> | Property<T> | ResolvedProperty<T>): propertyOrBuilder is PropertyBuilder<T, M>;
|
|
5
5
|
export declare function getDefaultValuesFor<M extends Record<string, any>>(properties: PropertiesOrBuilders<M> | ResolvedProperties<M>): Partial<EntityValues<M>>;
|
|
6
|
-
export declare function getDefaultValueFor(property
|
|
6
|
+
export declare function getDefaultValueFor(property?: PropertyOrBuilder): {} | null | undefined;
|
|
7
7
|
export declare function getDefaultValueForDataType(dataType: DataType): {} | null;
|
|
8
8
|
/**
|
|
9
9
|
* Update the automatic values in an entity before save
|
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.
|
|
4
|
+
"version": "3.0.0-canary.164",
|
|
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.
|
|
54
|
-
"@firecms/formex": "^3.0.0-canary.
|
|
55
|
-
"@firecms/ui": "^3.0.0-canary.
|
|
53
|
+
"@firecms/editor": "^3.0.0-canary.164",
|
|
54
|
+
"@firecms/formex": "^3.0.0-canary.164",
|
|
55
|
+
"@firecms/ui": "^3.0.0-canary.164",
|
|
56
56
|
"@hello-pangea/dnd": "^17.0.0",
|
|
57
57
|
"@radix-ui/react-portal": "^1.1.2",
|
|
58
58
|
"clsx": "^2.1.1",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"dist",
|
|
107
107
|
"src"
|
|
108
108
|
],
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "9f7019e32346d4917da2e32539ac13244636493f",
|
|
110
110
|
"publishConfig": {
|
|
111
111
|
"access": "public"
|
|
112
112
|
},
|
|
@@ -110,7 +110,7 @@ export const DefaultAppBar = function DefaultAppBar({
|
|
|
110
110
|
|
|
111
111
|
{navigation && <div className="mr-8 hidden lg:block">
|
|
112
112
|
<ReactLink
|
|
113
|
-
className="visited:text-inherit visited:dark:text-inherit"
|
|
113
|
+
className="visited:text-inherit visited:dark:text-inherit block"
|
|
114
114
|
to={navigation?.basePath ?? "/"}
|
|
115
115
|
>
|
|
116
116
|
<div className={"flex flex-row gap-4"}>
|
|
@@ -122,8 +122,7 @@ export const DefaultAppBar = function DefaultAppBar({
|
|
|
122
122
|
|
|
123
123
|
{typeof title === "string"
|
|
124
124
|
? <Typography variant="subtitle1"
|
|
125
|
-
noWrap
|
|
126
|
-
className={cls("transition-all", drawerOpen ? "ml-2" : "")}>
|
|
125
|
+
noWrap>
|
|
127
126
|
{title}
|
|
128
127
|
</Typography>
|
|
129
128
|
: title}
|
|
@@ -164,12 +164,13 @@ export function DrawerLogo({ logo }: {
|
|
|
164
164
|
transition: "padding 100ms cubic-bezier(0.4, 0, 0.6, 1) 0ms",
|
|
165
165
|
padding: drawerOpen ? "32px 144px 0px 24px" : "72px 12px 0px 12px"
|
|
166
166
|
}}
|
|
167
|
-
className={cls("cursor-pointer ml-3 mr-1")}>
|
|
167
|
+
className={cls("cursor-pointer rounded ml-3 mr-1")}>
|
|
168
168
|
|
|
169
169
|
<Tooltip title={"Home"}
|
|
170
170
|
sideOffset={20}
|
|
171
171
|
side="right">
|
|
172
172
|
<Link
|
|
173
|
+
className={"block"}
|
|
173
174
|
to={navigation.basePath}>
|
|
174
175
|
{logo
|
|
175
176
|
? <img src={logo}
|
package/src/util/entities.ts
CHANGED
|
@@ -40,13 +40,15 @@ export function getDefaultValuesFor<M extends Record<string, any>>(properties: P
|
|
|
40
40
|
if (!properties) return {};
|
|
41
41
|
return Object.entries(properties)
|
|
42
42
|
.map(([key, property]) => {
|
|
43
|
+
if (!property) return {};
|
|
43
44
|
const value = getDefaultValueFor(property as PropertyOrBuilder);
|
|
44
45
|
return value === undefined ? {} : { [key]: value };
|
|
45
46
|
})
|
|
46
47
|
.reduce((a, b) => ({ ...a, ...b }), {}) as EntityValues<M>;
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
export function getDefaultValueFor(property
|
|
50
|
+
export function getDefaultValueFor(property?: PropertyOrBuilder) {
|
|
51
|
+
if (!property) return undefined;
|
|
50
52
|
if (isPropertyBuilder(property)) return undefined;
|
|
51
53
|
if (property.defaultValue || property.defaultValue === null) {
|
|
52
54
|
return property.defaultValue;
|