@firecms/core 3.0.0-beta.10 → 3.0.0-beta.12
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/components/ArrayContainer.d.ts +22 -6
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +2 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -2
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +17 -3
- package/dist/components/EntityCollectionTable/index.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +6 -3
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +4 -0
- package/dist/components/PropertyIdCopyTooltip.d.ts +1 -1
- package/dist/components/SelectableTable/SelectableTable.d.ts +12 -2
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +1 -1
- package/dist/components/UnsavedChangesDialog.d.ts +8 -0
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +13 -0
- package/dist/components/common/default_entity_actions.d.ts +0 -2
- package/dist/components/common/index.d.ts +1 -1
- package/dist/components/common/useColumnsIds.d.ts +1 -0
- package/dist/components/common/{useDataSourceEntityCollectionTableController.d.ts → useDataSourceTableController.d.ts} +10 -2
- package/dist/components/common/useDebouncedCallback.d.ts +1 -0
- package/dist/components/common/useScrollRestoration.d.ts +14 -0
- package/dist/contexts/BreacrumbsContext.d.ts +8 -0
- package/dist/core/EntityEditView.d.ts +30 -22
- package/dist/core/EntityEditViewFormActions.d.ts +2 -0
- package/dist/core/FireCMS.d.ts +1 -1
- package/dist/core/FireCMSRouter.d.ts +4 -0
- package/dist/core/NavigationRoutes.d.ts +0 -1
- package/dist/core/SideDialogs.d.ts +4 -2
- package/dist/core/index.d.ts +2 -1
- package/dist/form/EntityForm.d.ts +45 -0
- package/dist/form/EntityFormActions.d.ts +17 -0
- package/dist/form/PropertyFieldBinding.d.ts +1 -1
- package/dist/form/components/FormEntry.d.ts +6 -0
- package/dist/form/components/FormLayout.d.ts +5 -0
- package/dist/form/components/index.d.ts +2 -1
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/BlockFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +2 -2
- package/dist/form/field_bindings/RepeatFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +1 -2
- package/dist/form/index.d.ts +16 -16
- package/dist/hooks/data/delete.d.ts +4 -4
- package/dist/hooks/data/save.d.ts +3 -3
- package/dist/hooks/data/useCollectionFetch.d.ts +1 -1
- package/dist/hooks/data/useEntityFetch.d.ts +4 -3
- package/dist/hooks/useAuthController.d.ts +1 -1
- package/dist/hooks/useBreadcrumbsController.d.ts +26 -0
- package/dist/hooks/useBuildNavigationController.d.ts +7 -4
- package/dist/hooks/useFireCMSContext.d.ts +1 -1
- package/dist/hooks/useModeController.d.ts +1 -2
- package/dist/hooks/useResolvedNavigationFrom.d.ts +3 -3
- package/dist/hooks/useValidateAuthenticator.d.ts +3 -3
- package/dist/index.es.js +17032 -12909
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +17019 -12898
- package/dist/index.umd.js.map +1 -1
- package/dist/internal/useBuildSideEntityController.d.ts +2 -2
- package/dist/internal/useUnsavedChangesDialog.d.ts +7 -9
- package/dist/preview/PropertyPreviewProps.d.ts +1 -1
- package/dist/preview/components/EnumValuesChip.d.ts +1 -1
- package/dist/preview/util.d.ts +3 -3
- package/dist/routes/CustomCMSRoute.d.ts +4 -0
- package/dist/routes/FireCMSRoute.d.ts +1 -0
- package/dist/routes/HomePageRoute.d.ts +3 -0
- package/dist/types/auth.d.ts +7 -9
- package/dist/types/collections.d.ts +44 -23
- package/dist/types/datasource.d.ts +2 -6
- package/dist/types/dialogs_controller.d.ts +7 -3
- package/dist/types/entities.d.ts +1 -1
- package/dist/types/entity_actions.d.ts +14 -4
- package/dist/types/entity_callbacks.d.ts +16 -16
- package/dist/types/export_import.d.ts +4 -4
- package/dist/types/fields.d.ts +27 -4
- package/dist/types/firecms.d.ts +2 -2
- package/dist/types/firecms_context.d.ts +1 -1
- package/dist/types/navigation.d.ts +29 -12
- package/dist/types/permissions.d.ts +4 -4
- package/dist/types/plugins.d.ts +9 -8
- package/dist/types/properties.d.ts +18 -3
- package/dist/types/property_config.d.ts +0 -2
- package/dist/types/side_entity_controller.d.ts +6 -1
- package/dist/types/user.d.ts +1 -0
- package/dist/util/builders.d.ts +3 -3
- package/dist/util/entities.d.ts +1 -1
- package/dist/util/entity_actions.d.ts +2 -0
- package/dist/util/entity_cache.d.ts +23 -0
- package/dist/util/icon_synonyms.d.ts +0 -1
- package/dist/util/icons.d.ts +3 -1
- package/dist/util/index.d.ts +1 -0
- package/dist/util/navigation_from_path.d.ts +6 -1
- package/dist/util/navigation_utils.d.ts +12 -1
- package/dist/util/objects.d.ts +1 -0
- package/dist/util/permissions.d.ts +4 -4
- package/dist/util/property_utils.d.ts +2 -2
- package/dist/util/resolutions.d.ts +12 -7
- package/package.json +129 -125
- package/src/app/Scaffold.tsx +4 -4
- package/src/components/ArrayContainer.tsx +115 -34
- package/src/components/CircularProgressCenter.tsx +1 -1
- package/src/components/ConfirmationDialog.tsx +2 -2
- package/src/components/DeleteEntityDialog.tsx +10 -19
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +44 -20
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +23 -17
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +20 -3
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +6 -4
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +8 -9
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +5 -11
- package/src/components/EntityCollectionTable/index.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +3 -3
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +5 -5
- package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +2 -2
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +77 -73
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +90 -49
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +4 -2
- package/src/components/EntityCollectionView/useSelectionController.tsx +5 -4
- package/src/components/EntityPreview.tsx +39 -30
- package/src/components/EntityView.tsx +5 -5
- package/src/components/ErrorView.tsx +3 -3
- package/src/components/HomePage/DefaultHomePage.tsx +1 -0
- package/src/components/HomePage/FavouritesView.tsx +6 -11
- package/src/components/HomePage/NavigationCard.tsx +1 -1
- package/src/components/HomePage/NavigationCardBinding.tsx +4 -9
- package/src/components/HomePage/NavigationGroup.tsx +1 -1
- package/src/components/NotFoundPage.tsx +2 -2
- package/src/components/PropertyConfigBadge.tsx +1 -1
- package/src/components/PropertyIdCopyTooltip.tsx +3 -4
- package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +13 -8
- package/src/components/SelectableTable/SelectableTable.tsx +20 -5
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +4 -2
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +10 -8
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +7 -5
- package/src/components/UnsavedChangesDialog.tsx +42 -0
- package/src/components/VirtualTable/VirtualTable.tsx +19 -2
- package/src/components/VirtualTable/VirtualTableHeader.tsx +8 -8
- package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +1 -1
- package/src/components/VirtualTable/VirtualTableProps.tsx +15 -0
- package/src/components/VirtualTable/VirtualTableRow.tsx +1 -1
- package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +1 -1
- package/src/components/VirtualTable/fields/VirtualTableInput.tsx +1 -1
- package/src/components/VirtualTable/fields/VirtualTableSelect.tsx +2 -0
- package/src/components/common/default_entity_actions.tsx +26 -37
- package/src/components/common/index.ts +1 -1
- package/src/components/common/useColumnsIds.tsx +1 -1
- package/src/components/common/useDataSourceTableController.tsx +420 -0
- package/src/components/common/useDebouncedCallback.tsx +20 -0
- package/src/components/common/useScrollRestoration.tsx +68 -0
- package/src/contexts/BreacrumbsContext.tsx +38 -0
- package/src/contexts/DialogsProvider.tsx +3 -2
- package/src/contexts/ModeController.tsx +1 -3
- package/src/contexts/SnackbarProvider.tsx +2 -0
- package/src/core/DefaultAppBar.tsx +56 -25
- package/src/core/DefaultDrawer.tsx +11 -9
- package/src/core/DrawerNavigationItem.tsx +4 -4
- package/src/core/EntityEditView.tsx +282 -1006
- package/src/core/EntityEditViewFormActions.tsx +199 -0
- package/src/core/EntitySidePanel.tsx +85 -15
- package/src/core/FireCMS.tsx +12 -9
- package/src/core/FireCMSRouter.tsx +17 -0
- package/src/core/NavigationRoutes.tsx +23 -32
- package/src/core/SideDialogs.tsx +21 -12
- package/src/core/field_configs.tsx +4 -4
- package/src/core/index.tsx +4 -2
- package/src/form/EntityForm.tsx +774 -0
- package/src/form/EntityFormActions.tsx +169 -0
- package/src/form/PropertyFieldBinding.tsx +39 -30
- package/src/form/components/CustomIdField.tsx +2 -0
- package/src/form/components/FormEntry.tsx +22 -0
- package/src/form/components/FormLayout.tsx +16 -0
- package/src/form/components/LabelWithIcon.tsx +6 -3
- package/src/form/components/StorageItemPreview.tsx +3 -3
- package/src/form/components/StorageUploadProgress.tsx +1 -1
- package/src/form/components/index.tsx +2 -1
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +7 -6
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +20 -12
- package/src/form/field_bindings/BlockFieldBinding.tsx +45 -25
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +2 -1
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +10 -7
- package/src/form/field_bindings/MapFieldBinding.tsx +69 -52
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +9 -6
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +2 -2
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +5 -5
- package/src/form/field_bindings/RepeatFieldBinding.tsx +30 -22
- package/src/form/field_bindings/SelectFieldBinding.tsx +6 -5
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +7 -5
- package/src/form/field_bindings/SwitchFieldBinding.tsx +26 -25
- package/src/form/field_bindings/TextFieldBinding.tsx +4 -3
- package/src/form/index.tsx +16 -32
- package/src/form/validation.ts +12 -6
- package/src/hooks/data/delete.ts +4 -4
- package/src/hooks/data/save.ts +8 -9
- package/src/hooks/data/useCollectionFetch.tsx +3 -3
- package/src/hooks/data/useEntityFetch.tsx +10 -6
- package/src/hooks/useAuthController.tsx +1 -1
- package/src/hooks/useBreadcrumbsController.tsx +31 -0
- package/src/hooks/useBuildModeController.tsx +15 -28
- package/src/hooks/useBuildNavigationController.tsx +74 -29
- package/src/hooks/useFireCMSContext.tsx +5 -5
- package/src/hooks/useLargeLayout.tsx +0 -35
- package/src/hooks/useModeController.tsx +1 -2
- package/src/hooks/useResolvedNavigationFrom.tsx +9 -11
- package/src/hooks/useValidateAuthenticator.tsx +3 -3
- package/src/internal/useBuildDataSource.ts +1 -1
- package/src/internal/useBuildSideDialogsController.tsx +3 -2
- package/src/internal/useBuildSideEntityController.tsx +124 -83
- package/src/internal/useUnsavedChangesDialog.tsx +127 -93
- package/src/preview/PropertyPreview.tsx +11 -11
- package/src/preview/PropertyPreviewProps.tsx +1 -1
- package/src/preview/components/BooleanPreview.tsx +1 -1
- package/src/preview/components/EmptyValue.tsx +1 -1
- package/src/preview/components/EnumValuesChip.tsx +1 -1
- package/src/preview/components/ImagePreview.tsx +5 -6
- package/src/preview/components/UrlComponentPreview.tsx +20 -21
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +2 -2
- package/src/preview/property_previews/MapPropertyPreview.tsx +7 -6
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +12 -12
- package/src/preview/property_previews/StringPropertyPreview.tsx +2 -2
- package/src/preview/util.ts +10 -10
- package/src/routes/CustomCMSRoute.tsx +21 -0
- package/src/routes/FireCMSRoute.tsx +235 -0
- package/src/routes/HomePageRoute.tsx +17 -0
- package/src/types/auth.tsx +8 -12
- package/src/types/collections.ts +52 -26
- package/src/types/datasource.ts +2 -6
- package/src/types/dialogs_controller.tsx +7 -3
- package/src/types/entities.ts +1 -1
- package/src/types/entity_actions.tsx +16 -4
- package/src/types/entity_callbacks.ts +18 -18
- package/src/types/export_import.ts +4 -4
- package/src/types/fields.tsx +33 -4
- package/src/types/firecms.tsx +2 -2
- package/src/types/firecms_context.tsx +1 -1
- package/src/types/navigation.ts +36 -16
- package/src/types/permissions.ts +5 -5
- package/src/types/plugins.tsx +9 -8
- package/src/types/properties.ts +21 -3
- package/src/types/property_config.tsx +0 -2
- package/src/types/side_dialogs_controller.tsx +2 -0
- package/src/types/side_entity_controller.tsx +6 -1
- package/src/types/user.ts +2 -0
- package/src/util/builders.ts +10 -8
- package/src/util/entities.ts +3 -1
- package/src/util/entity_actions.ts +28 -0
- package/src/util/entity_cache.ts +204 -0
- package/src/util/icon_list.ts +1 -0
- package/src/util/icon_synonyms.ts +0 -1
- package/src/util/icons.tsx +12 -8
- package/src/util/index.ts +1 -0
- package/src/util/join_collections.ts +3 -0
- package/src/util/navigation_from_path.ts +13 -6
- package/src/util/navigation_utils.ts +53 -1
- package/src/util/objects.ts +24 -1
- package/src/util/parent_references_from_path.ts +3 -3
- package/src/util/permissions.ts +8 -8
- package/src/util/property_utils.tsx +10 -3
- package/src/util/references.ts +8 -2
- package/src/util/resolutions.ts +34 -13
- package/src/util/useStorageUploadController.tsx +40 -22
- package/dist/form/components/FormikArrayContainer.d.ts +0 -19
- package/src/components/common/useDataSourceEntityCollectionTableController.tsx +0 -236
- package/src/form/components/FormikArrayContainer.tsx +0 -47
- /package/src/util/{common.tsx → common.ts} +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
import { Link
|
|
3
|
+
import { Link, useNavigate } from "react-router-dom";
|
|
4
4
|
import { ErrorBoundary, FireCMSLogo } from "../components";
|
|
5
5
|
import {
|
|
6
6
|
Avatar,
|
|
7
|
+
BrightnessMediumIcon,
|
|
7
8
|
cls,
|
|
8
9
|
DarkModeIcon,
|
|
9
10
|
IconButton,
|
|
@@ -17,6 +18,7 @@ import {
|
|
|
17
18
|
import { useAuthController, useLargeLayout, useModeController, useNavigationController } from "../hooks";
|
|
18
19
|
import { User } from "../types";
|
|
19
20
|
import { useApp } from "../app/useApp";
|
|
21
|
+
import { useBreadcrumbsController } from "../hooks/useBreadcrumbsController";
|
|
20
22
|
|
|
21
23
|
export type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {
|
|
22
24
|
|
|
@@ -65,10 +67,12 @@ export const DefaultAppBar = function DefaultAppBar({
|
|
|
65
67
|
} = useApp();
|
|
66
68
|
const navigation = useNavigationController();
|
|
67
69
|
|
|
70
|
+
const breadcrumbs = useBreadcrumbsController();
|
|
71
|
+
|
|
68
72
|
const authController = useAuthController();
|
|
69
73
|
const {
|
|
70
74
|
mode,
|
|
71
|
-
|
|
75
|
+
setMode
|
|
72
76
|
} = useModeController();
|
|
73
77
|
|
|
74
78
|
const navigate = useNavigate();
|
|
@@ -77,19 +81,21 @@ export const DefaultAppBar = function DefaultAppBar({
|
|
|
77
81
|
|
|
78
82
|
const user = userProp ?? authController.user;
|
|
79
83
|
|
|
80
|
-
let avatarComponent: JSX.Element;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
let avatarComponent: JSX.Element | null;
|
|
85
|
+
|
|
86
|
+
if (user) {
|
|
87
|
+
const initial = user?.displayName
|
|
88
|
+
? user.displayName[0].toUpperCase()
|
|
89
|
+
: (user?.email ? user.email[0].toUpperCase() : "A");
|
|
90
|
+
avatarComponent = <Avatar src={user.photoURL ?? undefined}>
|
|
91
|
+
{initial}
|
|
92
|
+
</Avatar>;
|
|
84
93
|
} else if (user === undefined || authController.initialLoading) {
|
|
85
94
|
avatarComponent = <div className={"p-1 flex justify-center"}>
|
|
86
95
|
<Skeleton className={"w-10 h-10 rounded-full"}/>
|
|
87
96
|
</div>;
|
|
88
97
|
} else {
|
|
89
|
-
|
|
90
|
-
? user.displayName[0].toUpperCase()
|
|
91
|
-
: (user?.email ? user.email[0].toUpperCase() : "A");
|
|
92
|
-
avatarComponent = <Avatar>{initial}</Avatar>;
|
|
98
|
+
avatarComponent = null;
|
|
93
99
|
}
|
|
94
100
|
|
|
95
101
|
return (
|
|
@@ -106,9 +112,9 @@ export const DefaultAppBar = function DefaultAppBar({
|
|
|
106
112
|
className)}>
|
|
107
113
|
|
|
108
114
|
|
|
109
|
-
{navigation && <div className="mr-
|
|
110
|
-
<
|
|
111
|
-
className="visited:text-inherit visited:dark:text-inherit"
|
|
115
|
+
{navigation && <div className="mr-2 hidden lg:block">
|
|
116
|
+
<Link
|
|
117
|
+
className="visited:text-inherit visited:dark:text-inherit block"
|
|
112
118
|
to={navigation?.basePath ?? "/"}
|
|
113
119
|
>
|
|
114
120
|
<div className={"flex flex-row gap-4"}>
|
|
@@ -120,13 +126,33 @@ export const DefaultAppBar = function DefaultAppBar({
|
|
|
120
126
|
|
|
121
127
|
{typeof title === "string"
|
|
122
128
|
? <Typography variant="subtitle1"
|
|
123
|
-
noWrap
|
|
124
|
-
className={cls("transition-all", drawerOpen ? "ml-2" : "")}>
|
|
129
|
+
noWrap>
|
|
125
130
|
{title}
|
|
126
131
|
</Typography>
|
|
127
132
|
: title}
|
|
128
133
|
</div>
|
|
129
|
-
</
|
|
134
|
+
</Link>
|
|
135
|
+
</div>}
|
|
136
|
+
|
|
137
|
+
{breadcrumbs.breadcrumbs && <div className="mr-8 hidden lg:block">
|
|
138
|
+
<div className={"flex flex-row gap-2"}>
|
|
139
|
+
{breadcrumbs.breadcrumbs.map((breadcrumb, index) => {
|
|
140
|
+
return <React.Fragment key={breadcrumb.url + "_" + index}>
|
|
141
|
+
<Typography variant={"caption"} color={"secondary"}>
|
|
142
|
+
/
|
|
143
|
+
</Typography>
|
|
144
|
+
<Link
|
|
145
|
+
key={index}
|
|
146
|
+
className="visited:text-inherit visited:dark:text-inherit block"
|
|
147
|
+
to={breadcrumb.url}
|
|
148
|
+
>
|
|
149
|
+
<Typography variant={"caption"} color={"secondary"}>
|
|
150
|
+
{breadcrumb.title}
|
|
151
|
+
</Typography>
|
|
152
|
+
</Link>
|
|
153
|
+
</React.Fragment>;
|
|
154
|
+
})}
|
|
155
|
+
</div>
|
|
130
156
|
</div>}
|
|
131
157
|
|
|
132
158
|
{startAdornment}
|
|
@@ -138,15 +164,20 @@ export const DefaultAppBar = function DefaultAppBar({
|
|
|
138
164
|
{endAdornment}
|
|
139
165
|
</ErrorBoundary>}
|
|
140
166
|
|
|
141
|
-
{includeModeToggle &&
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
167
|
+
{includeModeToggle &&
|
|
168
|
+
<Menu
|
|
169
|
+
trigger={<IconButton
|
|
170
|
+
color="inherit"
|
|
171
|
+
aria-label="Open drawer"
|
|
172
|
+
size="large">
|
|
173
|
+
{mode === "dark"
|
|
174
|
+
? <DarkModeIcon/>
|
|
175
|
+
: <LightModeIcon/>}
|
|
176
|
+
</IconButton>}>
|
|
177
|
+
<MenuItem onClick={() => setMode("dark")}><DarkModeIcon size={"smallest"}/> Dark</MenuItem>
|
|
178
|
+
<MenuItem onClick={() => setMode("light")}><LightModeIcon size={"smallest"}/> Light </MenuItem>
|
|
179
|
+
<MenuItem onClick={() => setMode("system")}> <BrightnessMediumIcon size={"smallest"}/>System</MenuItem>
|
|
180
|
+
</Menu>}
|
|
150
181
|
|
|
151
182
|
<Menu trigger={avatarComponent}>
|
|
152
183
|
{user && <div className={"px-4 py-2 mb-2"}>
|
|
@@ -79,13 +79,13 @@ export function DefaultDrawer({
|
|
|
79
79
|
<DrawerLogo logo={logo}/>
|
|
80
80
|
|
|
81
81
|
<div className={"mt-4 flex-grow overflow-scroll no-scrollbar"}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
style={{
|
|
83
|
+
maskImage: "linear-gradient(to bottom, transparent 0, black 20px, black calc(100% - 20px), transparent 100%)",
|
|
84
|
+
}}>
|
|
85
85
|
|
|
86
86
|
{groupsWithoutAdmin.map((group) => (
|
|
87
87
|
<div
|
|
88
|
-
className={"bg-
|
|
88
|
+
className={"bg-surface-50 dark:bg-surface-800 dark:bg-opacity-30 my-4 rounded-lg ml-3 mr-1"}
|
|
89
89
|
key={`drawer_group_${group}`}>
|
|
90
90
|
{buildGroupHeader(group)}
|
|
91
91
|
{Object.values(navigationEntries)
|
|
@@ -93,7 +93,8 @@ export function DefaultDrawer({
|
|
|
93
93
|
.map((view, index) =>
|
|
94
94
|
<DrawerNavigationItem
|
|
95
95
|
key={`navigation_${index}`}
|
|
96
|
-
icon={<IconForView collectionOrView={view.collection ?? view.view}
|
|
96
|
+
icon={<IconForView collectionOrView={view.collection ?? view.view}
|
|
97
|
+
size={"small"}/>}
|
|
97
98
|
tooltipsOpen={tooltipsOpen}
|
|
98
99
|
adminMenuOpen={adminMenuOpen}
|
|
99
100
|
drawerOpen={drawerOpen}
|
|
@@ -112,7 +113,7 @@ export function DefaultDrawer({
|
|
|
112
113
|
trigger={
|
|
113
114
|
<IconButton
|
|
114
115
|
shape={"square"}
|
|
115
|
-
className={"m-4 text-
|
|
116
|
+
className={"m-4 text-surface-900 dark:text-white w-fit"}>
|
|
116
117
|
<Tooltip title={"Admin"}
|
|
117
118
|
open={tooltipsOpen}
|
|
118
119
|
side={"right"} sideOffset={28}>
|
|
@@ -163,18 +164,19 @@ export function DrawerLogo({ logo }: {
|
|
|
163
164
|
transition: "padding 100ms cubic-bezier(0.4, 0, 0.6, 1) 0ms",
|
|
164
165
|
padding: drawerOpen ? "32px 144px 0px 24px" : "72px 12px 0px 12px"
|
|
165
166
|
}}
|
|
166
|
-
className={cls("cursor-pointer ml-
|
|
167
|
+
className={cls("cursor-pointer rounded ml-3 mr-1")}>
|
|
167
168
|
|
|
168
169
|
<Tooltip title={"Home"}
|
|
169
170
|
sideOffset={20}
|
|
170
171
|
side="right">
|
|
171
172
|
<Link
|
|
173
|
+
className={"block"}
|
|
172
174
|
to={navigation.basePath}>
|
|
173
175
|
{logo
|
|
174
176
|
? <img src={logo}
|
|
175
177
|
alt="Logo"
|
|
176
|
-
className={cls("max-w-full max-h-full",
|
|
177
|
-
drawerOpen
|
|
178
|
+
className={cls("max-w-full max-h-full transition-all object-contain",
|
|
179
|
+
drawerOpen ? "w-[96px] h-[96px]" : "w-[32px] h-[32px]")}/>
|
|
178
180
|
: <FireCMSLogo/>}
|
|
179
181
|
|
|
180
182
|
</Link>
|
|
@@ -22,7 +22,7 @@ export function DrawerNavigationItem({
|
|
|
22
22
|
}) {
|
|
23
23
|
|
|
24
24
|
const iconWrap = <div
|
|
25
|
-
className={"text-
|
|
25
|
+
className={"text-text-secondary dark:text-text-secondary-dark"}>
|
|
26
26
|
{icon}
|
|
27
27
|
</div>;
|
|
28
28
|
|
|
@@ -34,13 +34,13 @@ export function DrawerNavigationItem({
|
|
|
34
34
|
transition: drawerOpen ? "width 150ms ease-in" : undefined
|
|
35
35
|
}}
|
|
36
36
|
className={({ isActive }: any) => cls("rounded-lg truncate",
|
|
37
|
-
"hover:bg-
|
|
37
|
+
"hover:bg-surface-accent-300 hover:bg-opacity-75 dark:hover:bg-surface-accent-800 dark:hover:bg-opacity-75 text-text-primary dark:text-surface-200 hover:text-surface-900 hover:dark:text-white",
|
|
38
38
|
"flex flex-row items-center mr-8",
|
|
39
39
|
// "transition-all ease-in-out delay-100 duration-300",
|
|
40
40
|
// drawerOpen ? "w-full" : "w-18",
|
|
41
41
|
drawerOpen ? "pl-4 h-12" : "pl-4 h-11",
|
|
42
|
-
"font-
|
|
43
|
-
isActive ? "bg-
|
|
42
|
+
"font-semibold text-xs",
|
|
43
|
+
isActive ? "bg-surface-accent-200 bg-opacity-60 dark:bg-surface-800 dark:bg-opacity-50" : ""
|
|
44
44
|
)}
|
|
45
45
|
to={url}
|
|
46
46
|
>
|