@firecms/core 3.0.0-canary.207 → 3.0.0-canary.208
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/app/Scaffold.d.ts +4 -0
- package/dist/core/DefaultAppBar.d.ts +8 -2
- package/dist/core/FireCMS.d.ts +2 -2
- package/dist/index.es.js +120 -111
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +120 -111
- package/dist/index.umd.js.map +1 -1
- package/dist/types/firecms.d.ts +1 -1
- package/package.json +5 -5
- package/src/app/Scaffold.tsx +13 -3
- package/src/core/DefaultAppBar.tsx +17 -5
- package/src/core/FireCMS.tsx +1 -1
- package/src/types/firecms.tsx +1 -1
package/dist/types/firecms.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export type CMSViewsBuilder = (params: {
|
|
|
44
44
|
/**
|
|
45
45
|
* @group Models
|
|
46
46
|
*/
|
|
47
|
-
export type FireCMSProps<USER extends User
|
|
47
|
+
export type FireCMSProps<USER extends User> = {
|
|
48
48
|
/**
|
|
49
49
|
* Use this function to return the components you want to render under
|
|
50
50
|
* FireCMS
|
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.208",
|
|
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.208",
|
|
54
|
+
"@firecms/formex": "^3.0.0-canary.208",
|
|
55
|
+
"@firecms/ui": "^3.0.0-canary.208",
|
|
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": "
|
|
107
|
+
"gitHead": "d1fb356f64e1762feb71b2247e64f3d49719f202",
|
|
108
108
|
"publishConfig": {
|
|
109
109
|
"access": "public"
|
|
110
110
|
},
|
package/src/app/Scaffold.tsx
CHANGED
|
@@ -23,6 +23,11 @@ export interface ScaffoldProps {
|
|
|
23
23
|
*/
|
|
24
24
|
logo?: string;
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* If true, the main content will be padded in large layouts. Defaults to true.
|
|
28
|
+
*/
|
|
29
|
+
padding?: boolean;
|
|
30
|
+
|
|
26
31
|
className?: string;
|
|
27
32
|
|
|
28
33
|
style?: React.CSSProperties;
|
|
@@ -47,7 +52,8 @@ export const Scaffold = React.memo<PropsWithChildren<ScaffoldProps>>(
|
|
|
47
52
|
autoOpenDrawer,
|
|
48
53
|
logo,
|
|
49
54
|
className,
|
|
50
|
-
style
|
|
55
|
+
style,
|
|
56
|
+
padding = true
|
|
51
57
|
} = props;
|
|
52
58
|
|
|
53
59
|
const drawerChildren = React.Children.toArray(children).filter((child: any) => child.type.componentType === "Drawer");
|
|
@@ -116,10 +122,14 @@ export const Scaffold = React.memo<PropsWithChildren<ScaffoldProps>>(
|
|
|
116
122
|
|
|
117
123
|
<main
|
|
118
124
|
className="flex flex-col flex-grow overflow-auto">
|
|
125
|
+
|
|
119
126
|
{hasAppBar && <DrawerHeader/>}
|
|
127
|
+
|
|
120
128
|
<div
|
|
121
|
-
className={cls(defaultBorderMixin, "flex-grow overflow-auto
|
|
122
|
-
"lg:mt-4": !hasAppBar
|
|
129
|
+
className={cls(defaultBorderMixin, "flex-grow overflow-auto m-0 mt-1", {
|
|
130
|
+
"lg:mt-4": !hasAppBar,
|
|
131
|
+
"lg:m-0 lg:mx-4 lg:mb-4 lg:rounded-lg lg:border lg:border-solid": padding,
|
|
132
|
+
"border-t": hasAppBar && !padding,
|
|
123
133
|
})}>
|
|
124
134
|
|
|
125
135
|
<ErrorBoundary>
|
|
@@ -22,12 +22,19 @@ import { useBreadcrumbsController } from "../hooks/useBreadcrumbsController";
|
|
|
22
22
|
|
|
23
23
|
export type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* The content of the app bar, usually a title or logo. This includes a link to the home page.
|
|
27
|
+
*/
|
|
25
28
|
title?: React.ReactNode;
|
|
29
|
+
|
|
26
30
|
/**
|
|
27
|
-
* A component that gets rendered on the upper side of the main toolbar
|
|
31
|
+
* A component that gets rendered on the upper side to the end of the main toolbar
|
|
28
32
|
*/
|
|
29
33
|
endAdornment?: React.ReactNode;
|
|
30
34
|
|
|
35
|
+
/**
|
|
36
|
+
* A component that gets rendered on the upper side to the start of the main toolbar
|
|
37
|
+
*/
|
|
31
38
|
startAdornment?: React.ReactNode;
|
|
32
39
|
|
|
33
40
|
dropDownActions?: React.ReactNode;
|
|
@@ -57,14 +64,18 @@ export const DefaultAppBar = function DefaultAppBar({
|
|
|
57
64
|
includeModeToggle = true,
|
|
58
65
|
className,
|
|
59
66
|
style,
|
|
60
|
-
user: userProp
|
|
67
|
+
user: userProp,
|
|
68
|
+
logo: logoProp,
|
|
61
69
|
}: DefaultAppBarProps) {
|
|
62
70
|
|
|
63
71
|
const {
|
|
64
72
|
hasDrawer,
|
|
65
73
|
drawerOpen,
|
|
66
|
-
logo
|
|
74
|
+
logo: appLogo
|
|
67
75
|
} = useApp();
|
|
76
|
+
|
|
77
|
+
const logo = logoProp ?? appLogo;
|
|
78
|
+
|
|
68
79
|
const navigation = useNavigationController();
|
|
69
80
|
|
|
70
81
|
const breadcrumbs = useBreadcrumbsController();
|
|
@@ -134,7 +145,7 @@ export const DefaultAppBar = function DefaultAppBar({
|
|
|
134
145
|
</Link>
|
|
135
146
|
</div>}
|
|
136
147
|
|
|
137
|
-
{breadcrumbs.breadcrumbs && <div className="mr-8 hidden lg:block">
|
|
148
|
+
{(breadcrumbs.breadcrumbs ?? []).length > 0 && <div className="mr-8 hidden lg:block">
|
|
138
149
|
<div className={"flex flex-row gap-2"}>
|
|
139
150
|
{breadcrumbs.breadcrumbs.map((breadcrumb, index) => {
|
|
140
151
|
return <React.Fragment key={breadcrumb.url + "_" + index}>
|
|
@@ -176,7 +187,8 @@ export const DefaultAppBar = function DefaultAppBar({
|
|
|
176
187
|
</IconButton>}>
|
|
177
188
|
<MenuItem onClick={() => setMode("dark")}><DarkModeIcon size={"smallest"}/> Dark</MenuItem>
|
|
178
189
|
<MenuItem onClick={() => setMode("light")}><LightModeIcon size={"smallest"}/> Light </MenuItem>
|
|
179
|
-
<MenuItem onClick={() => setMode("system")}> <BrightnessMediumIcon
|
|
190
|
+
<MenuItem onClick={() => setMode("system")}> <BrightnessMediumIcon
|
|
191
|
+
size={"smallest"}/>System</MenuItem>
|
|
180
192
|
</Menu>}
|
|
181
193
|
|
|
182
194
|
<Menu trigger={avatarComponent}>
|
package/src/core/FireCMS.tsx
CHANGED
|
@@ -33,7 +33,7 @@ import { BreadcrumbsProvider } from "../contexts/BreacrumbsContext";
|
|
|
33
33
|
|
|
34
34
|
* @group Core
|
|
35
35
|
*/
|
|
36
|
-
export function FireCMS<USER extends User
|
|
36
|
+
export function FireCMS<USER extends User>(props: FireCMSProps<USER>) {
|
|
37
37
|
|
|
38
38
|
const {
|
|
39
39
|
children,
|
package/src/types/firecms.tsx
CHANGED
|
@@ -47,7 +47,7 @@ export type CMSViewsBuilder = (params: {
|
|
|
47
47
|
/**
|
|
48
48
|
* @group Models
|
|
49
49
|
*/
|
|
50
|
-
export type FireCMSProps<USER extends User
|
|
50
|
+
export type FireCMSProps<USER extends User> = {
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* Use this function to return the components you want to render under
|