@firecms/core 3.0.0-canary.144 → 3.0.0-canary.145
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/EntityCollectionTable/EntityCollectionTable.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +2 -2
- package/dist/components/common/useDataSourceEntityCollectionTableController.d.ts +1 -1
- package/dist/core/EntityEditView.d.ts +1 -1
- package/dist/core/FireCMS.d.ts +1 -1
- 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 +3 -3
- package/dist/hooks/useAuthController.d.ts +1 -1
- package/dist/hooks/useBuildNavigationController.d.ts +3 -3
- package/dist/hooks/useFireCMSContext.d.ts +1 -1
- package/dist/hooks/useResolvedNavigationFrom.d.ts +3 -3
- package/dist/hooks/useValidateAuthenticator.d.ts +3 -3
- package/dist/index.es.js +70 -67
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +70 -67
- package/dist/index.umd.js.map +1 -1
- package/dist/types/auth.d.ts +8 -6
- package/dist/types/collections.d.ts +12 -12
- package/dist/types/datasource.d.ts +0 -4
- package/dist/types/entity_actions.d.ts +4 -4
- package/dist/types/entity_callbacks.d.ts +16 -16
- package/dist/types/export_import.d.ts +4 -4
- package/dist/types/firecms.d.ts +2 -2
- package/dist/types/firecms_context.d.ts +1 -1
- package/dist/types/permissions.d.ts +4 -4
- package/dist/types/plugins.d.ts +8 -8
- package/dist/types/user.d.ts +1 -0
- package/dist/util/builders.d.ts +2 -2
- package/dist/util/permissions.d.ts +4 -4
- package/package.json +5 -5
- package/src/app/Scaffold.tsx +2 -2
- package/src/components/ArrayContainer.tsx +1 -1
- package/src/components/CircularProgressCenter.tsx +1 -1
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +1 -1
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +5 -5
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +2 -2
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +3 -3
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +2 -2
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +4 -4
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +3 -3
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +3 -3
- package/src/components/EntityPreview.tsx +2 -2
- package/src/components/EntityView.tsx +4 -4
- package/src/components/HomePage/FavouritesView.tsx +1 -1
- package/src/components/HomePage/NavigationCard.tsx +1 -1
- package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
- package/src/components/HomePage/NavigationGroup.tsx +1 -1
- package/src/components/PropertyConfigBadge.tsx +1 -1
- package/src/components/PropertyIdCopyTooltip.tsx +1 -1
- package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +1 -1
- package/src/components/SelectableTable/SelectableTable.tsx +2 -2
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +1 -1
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +1 -1
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +1 -1
- package/src/components/VirtualTable/VirtualTableHeader.tsx +8 -8
- package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +1 -1
- package/src/components/VirtualTable/VirtualTableRow.tsx +1 -1
- package/src/components/common/useDataSourceEntityCollectionTableController.tsx +2 -2
- package/src/core/DefaultDrawer.tsx +2 -2
- package/src/core/DrawerNavigationItem.tsx +3 -3
- package/src/core/EntityEditView.tsx +4 -4
- package/src/core/FireCMS.tsx +1 -1
- package/src/core/SideDialogs.tsx +1 -1
- package/src/core/field_configs.tsx +1 -1
- package/src/form/components/StorageItemPreview.tsx +2 -2
- package/src/form/field_bindings/MapFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +3 -3
- package/src/hooks/data/delete.ts +4 -4
- package/src/hooks/data/save.ts +3 -3
- package/src/hooks/data/useCollectionFetch.tsx +2 -2
- package/src/hooks/data/useEntityFetch.tsx +5 -5
- package/src/hooks/useAuthController.tsx +1 -1
- package/src/hooks/useBuildNavigationController.tsx +7 -6
- package/src/hooks/useFireCMSContext.tsx +5 -5
- package/src/hooks/useResolvedNavigationFrom.tsx +5 -5
- package/src/hooks/useValidateAuthenticator.tsx +3 -3
- package/src/preview/components/EmptyValue.tsx +1 -1
- package/src/preview/components/ImagePreview.tsx +2 -2
- package/src/preview/components/UrlComponentPreview.tsx +1 -1
- package/src/types/auth.tsx +8 -8
- package/src/types/collections.ts +12 -12
- package/src/types/datasource.ts +0 -5
- package/src/types/entity_actions.tsx +4 -4
- package/src/types/entity_callbacks.ts +18 -18
- package/src/types/export_import.ts +4 -4
- package/src/types/firecms.tsx +2 -2
- package/src/types/firecms_context.tsx +1 -1
- package/src/types/permissions.ts +5 -5
- package/src/types/plugins.tsx +8 -8
- package/src/types/user.ts +2 -0
- package/src/util/builders.ts +6 -6
- package/src/util/permissions.ts +8 -8
|
@@ -259,7 +259,7 @@ function StorageUpload({
|
|
|
259
259
|
className="flex-grow m-2 max-w-[200px]"
|
|
260
260
|
onClick={open}>
|
|
261
261
|
<Typography
|
|
262
|
-
className="text-
|
|
262
|
+
className="text-surface-400 dark:text-surface-600"
|
|
263
263
|
variant={"body2"}
|
|
264
264
|
align={"center"}>
|
|
265
265
|
{helpText}
|
|
@@ -276,7 +276,7 @@ function StorageUpload({
|
|
|
276
276
|
color={"inherit"}
|
|
277
277
|
size={"small"}
|
|
278
278
|
onClick={open}>
|
|
279
|
-
<EditIcon size={"small"} className={"text-
|
|
279
|
+
<EditIcon size={"small"} className={"text-surface-500"}/>
|
|
280
280
|
</IconButton>
|
|
281
281
|
</EntityTableCellActions>
|
|
282
282
|
|
|
@@ -71,7 +71,7 @@ export function CollectionTableToolbar({
|
|
|
71
71
|
|
|
72
72
|
return (
|
|
73
73
|
<div
|
|
74
|
-
className={cls(defaultBorderMixin, "no-scrollbar min-h-[56px] overflow-x-auto px-2 md:px-4 bg-
|
|
74
|
+
className={cls(defaultBorderMixin, "no-scrollbar min-h-[56px] overflow-x-auto px-2 md:px-4 bg-surface-50 dark:bg-surface-900 border-b flex flex-row justify-between items-center w-full")}>
|
|
75
75
|
|
|
76
76
|
<div className="flex items-center gap-2 md:mr-4 mr-2">
|
|
77
77
|
|
|
@@ -188,10 +188,10 @@ export const EntityTableCell = React.memo<EntityTableCellProps>(
|
|
|
188
188
|
className={cls(
|
|
189
189
|
"transition-colors duration-100 ease-in-out",
|
|
190
190
|
`flex relative h-full rounded-md p-${p} border border-4 border-opacity-75`,
|
|
191
|
-
onHover && !disabled ? "bg-
|
|
192
|
-
saved ? "bg-
|
|
191
|
+
onHover && !disabled ? "bg-surface-50 dark:bg-surface-900" : "",
|
|
192
|
+
saved ? "bg-surface-100 bg-opacity-75 dark:bg-surface-800 dark:bg-opacity-75" : "",
|
|
193
193
|
hideOverflow ? "overflow-hidden" : "",
|
|
194
|
-
isSelected ? "bg-
|
|
194
|
+
isSelected ? "bg-surface-50 dark:bg-surface-900" : "",
|
|
195
195
|
borderClass
|
|
196
196
|
)}
|
|
197
197
|
ref={ref}
|
|
@@ -236,7 +236,7 @@ export const EntityTableCell = React.memo<EntityTableCellProps>(
|
|
|
236
236
|
{disabled && onHover && disabledTooltip &&
|
|
237
237
|
<div className="absolute top-1 right-1 text-xs">
|
|
238
238
|
<Tooltip title={disabledTooltip}>
|
|
239
|
-
<RemoveCircleIcon size={"smallest"} color={"disabled"} className={"text-
|
|
239
|
+
<RemoveCircleIcon size={"smallest"} color={"disabled"} className={"text-surface-500"}/>
|
|
240
240
|
</Tooltip>
|
|
241
241
|
</div>}
|
|
242
242
|
|
|
@@ -353,7 +353,7 @@ export function PopupFormFieldInternal<M extends Record<string, any>>({
|
|
|
353
353
|
});
|
|
354
354
|
}
|
|
355
355
|
const form = <div
|
|
356
|
-
className={`text-
|
|
356
|
+
className={`text-surface-900 dark:text-white overflow-auto rounded rounded-md bg-white dark:bg-surface-950 ${!open ? "hidden" : ""} cursor-grab max-w-[100vw]`}>
|
|
357
357
|
|
|
358
358
|
{internalForm}
|
|
359
359
|
|
|
@@ -370,7 +370,7 @@ export function PopupFormFieldInternal<M extends Record<string, any>>({
|
|
|
370
370
|
style={{
|
|
371
371
|
boxShadow: "0 0 0 2px rgba(128,128,128,0.2)",
|
|
372
372
|
}}
|
|
373
|
-
className={`inline-block fixed z-20 shadow-outline rounded-md bg-white dark:bg-
|
|
373
|
+
className={`inline-block fixed z-20 shadow-outline rounded-md bg-white dark:bg-surface-950 ${
|
|
374
374
|
!open ? "invisible" : "visible"
|
|
375
375
|
} cursor-grab overflow-visible`}
|
|
376
376
|
ref={draggableRef}>
|
|
@@ -383,7 +383,7 @@ export function PopupFormFieldInternal<M extends Record<string, any>>({
|
|
|
383
383
|
{form}
|
|
384
384
|
|
|
385
385
|
<div
|
|
386
|
-
className="absolute -top-3.5 -right-3.5 bg-
|
|
386
|
+
className="absolute -top-3.5 -right-3.5 bg-surface-500 rounded-full"
|
|
387
387
|
style={{
|
|
388
388
|
width: "32px",
|
|
389
389
|
height: "32px"
|
|
@@ -538,7 +538,7 @@ export const EntityCollectionView = React.memo(
|
|
|
538
538
|
</div>}
|
|
539
539
|
>
|
|
540
540
|
|
|
541
|
-
{collection.description && <div className="m-4 text-
|
|
541
|
+
{collection.description && <div className="m-4 text-surface-900 dark:text-white">
|
|
542
542
|
<Markdown source={collection.description}/>
|
|
543
543
|
</div>}
|
|
544
544
|
|
|
@@ -798,7 +798,7 @@ function EntityIdHeaderWidget({
|
|
|
798
798
|
<SearchIcon size={"small"}/>
|
|
799
799
|
</IconButton>
|
|
800
800
|
}>
|
|
801
|
-
<div className={cls("my-2 rounded-lg bg-
|
|
801
|
+
<div className={cls("my-2 rounded-lg bg-surface-50 dark:bg-surface-950 text-surface-900 dark:text-white")}>
|
|
802
802
|
<form noValidate={true}
|
|
803
803
|
onSubmit={(e) => {
|
|
804
804
|
e.preventDefault();
|
|
@@ -823,7 +823,7 @@ function EntityIdHeaderWidget({
|
|
|
823
823
|
setSearchString(e.target.value);
|
|
824
824
|
}}
|
|
825
825
|
value={searchString}
|
|
826
|
-
className={"rounded-lg bg-white dark:bg-
|
|
826
|
+
className={"rounded-lg bg-white dark:bg-surface-800 flex-grow bg-transparent outline-none p-2 " + focusedDisabled}/>
|
|
827
827
|
<Button variant={"text"}
|
|
828
828
|
disabled={!(searchString.trim())}
|
|
829
829
|
type={"submit"}
|
|
@@ -200,11 +200,11 @@ export const EntityPreviewContainer = React.forwardRef<HTMLDivElement, EntityPre
|
|
|
200
200
|
tabindex: 0
|
|
201
201
|
}}
|
|
202
202
|
className={cls(
|
|
203
|
-
"bg-white dark:bg-
|
|
203
|
+
"bg-white dark:bg-surface-900",
|
|
204
204
|
"min-h-[42px]",
|
|
205
205
|
fullwidth ? "w-full" : "",
|
|
206
206
|
"items-center",
|
|
207
|
-
hover ? "hover:bg-
|
|
207
|
+
hover ? "hover:bg-surface-accent-50 dark:hover:bg-surface-800 group-hover:bg-surface-accent-50 dark:group-hover:bg-surface-800" : "",
|
|
208
208
|
size === "smallest" ? "p-1" : "px-2 py-1",
|
|
209
209
|
"flex border rounded-lg",
|
|
210
210
|
onClick ? "cursor-pointer" : "",
|
|
@@ -40,10 +40,10 @@ export function EntityView<M extends Record<string, any>>(
|
|
|
40
40
|
<div className={"w-full mb-4"}>
|
|
41
41
|
<div className={cls(defaultBorderMixin, "flex justify-between py-2 border-b last:border-b-0")}>
|
|
42
42
|
<div className="flex items-center w-1/4">
|
|
43
|
-
<span className="pl-2 text-sm text-
|
|
43
|
+
<span className="pl-2 text-sm text-surface-600">Id</span>
|
|
44
44
|
</div>
|
|
45
45
|
<div
|
|
46
|
-
className="flex-grow p-2 ml-2 w-3/4 text-
|
|
46
|
+
className="flex-grow p-2 ml-2 w-3/4 text-surface-900 dark:text-white min-h-[56px] flex items-center">
|
|
47
47
|
<span className="flex-grow mr-2">{entity.id}</span>
|
|
48
48
|
{customizationController?.entityLinkBuilder &&
|
|
49
49
|
<a href={customizationController.entityLinkBuilder({ entity })}
|
|
@@ -64,10 +64,10 @@ export function EntityView<M extends Record<string, any>>(
|
|
|
64
64
|
key={`reference_previews_${key}`}
|
|
65
65
|
className={cls(defaultBorderMixin, "flex justify-between py-2 border-b last:border-b-0")}>
|
|
66
66
|
<div className="flex items-center w-1/4">
|
|
67
|
-
<span className="pl-2 text-sm text-
|
|
67
|
+
<span className="pl-2 text-sm text-surface-600">{property.name}</span>
|
|
68
68
|
</div>
|
|
69
69
|
<div
|
|
70
|
-
className="flex-grow p-2 ml-2 w-3/4 text-
|
|
70
|
+
className="flex-grow p-2 ml-2 w-3/4 text-surface-900 dark:text-white min-h-[56px] flex items-center">
|
|
71
71
|
<PropertyPreview
|
|
72
72
|
propertyKey={key}
|
|
73
73
|
value={value}
|
|
@@ -38,7 +38,7 @@ function NavigationChip({ entry }: { entry: TopNavigationEntry }) {
|
|
|
38
38
|
: <StarBorderIcon
|
|
39
39
|
onClick={onIconClick}
|
|
40
40
|
size={18}
|
|
41
|
-
className={"text-
|
|
41
|
+
className={"text-surface-400 dark:text-surface-500"}/>}>
|
|
42
42
|
{entry.name}
|
|
43
43
|
</Chip>;
|
|
44
44
|
}
|
|
@@ -27,7 +27,7 @@ export function NavigationCard({
|
|
|
27
27
|
className="flex-grow w-full">
|
|
28
28
|
|
|
29
29
|
<div
|
|
30
|
-
className="h-10 flex items-center w-full justify-between text-
|
|
30
|
+
className="h-10 flex items-center w-full justify-between text-surface-300 dark:text-surface-600">
|
|
31
31
|
|
|
32
32
|
{icon}
|
|
33
33
|
|
|
@@ -12,7 +12,7 @@ export function NavigationGroup({
|
|
|
12
12
|
return (
|
|
13
13
|
<ExpandablePanel
|
|
14
14
|
invisible={true}
|
|
15
|
-
titleClassName={"font-medium text-sm text-
|
|
15
|
+
titleClassName={"font-medium text-sm text-surface-600 dark:text-surface-400"}
|
|
16
16
|
innerClassName={"py-4"}
|
|
17
17
|
initiallyExpanded={!(userConfigurationPersistence?.collapsedGroups ?? []).includes(group ?? "ungrouped")}
|
|
18
18
|
onExpandedChange={expanded => {
|
|
@@ -9,7 +9,7 @@ export function PropertyConfigBadge({
|
|
|
9
9
|
propertyConfig: PropertyConfig | undefined,
|
|
10
10
|
disabled?: boolean
|
|
11
11
|
}): React.ReactNode {
|
|
12
|
-
const classes = "h-8 w-8 p-1 rounded-full shadow text-white " + (disabled ? "bg-
|
|
12
|
+
const classes = "h-8 w-8 p-1 rounded-full shadow text-white " + (disabled ? "bg-surface-400 dark:bg-surface-600" : "");
|
|
13
13
|
|
|
14
14
|
const defaultPropertyConfig = typeof propertyConfig?.property === "object" ? getDefaultFieldConfig(propertyConfig.property) : undefined;
|
|
15
15
|
|
|
@@ -29,7 +29,7 @@ export function PropertyIdCopyTooltipContent({ propertyKey }: { propertyKey: str
|
|
|
29
29
|
return (
|
|
30
30
|
<div className={"flex flex-row gap-2 items-center justify-center text-white"}>
|
|
31
31
|
<div>
|
|
32
|
-
<Typography variant={"caption"} className={"min-w-20 text-
|
|
32
|
+
<Typography variant={"caption"} className={"min-w-20 text-surface-accent-400"}
|
|
33
33
|
color={"disabled"}>{copied ? "Copied" : "Property ID"}</Typography>
|
|
34
34
|
<Typography variant={"caption"} className={"text-white"}><code>{propertyKey}</code></Typography>
|
|
35
35
|
</div>
|
|
@@ -293,7 +293,7 @@ export function ReferenceSelectionTable<M extends Record<string, any>>(
|
|
|
293
293
|
<IconForView
|
|
294
294
|
size={"small"}
|
|
295
295
|
collectionOrView={collection}
|
|
296
|
-
className={"text-
|
|
296
|
+
className={"text-surface-300 dark:text-surface-600"}/>
|
|
297
297
|
{collection.singularName ? `Select ${collection.singularName}` : `Select from ${collection.name}`}
|
|
298
298
|
</Typography>}
|
|
299
299
|
defaultSize={collection.defaultSize}
|
|
@@ -210,7 +210,7 @@ export const SelectableTable = React.memo<SelectableTableProps<any>>(
|
|
|
210
210
|
selectedCell,
|
|
211
211
|
}}
|
|
212
212
|
>
|
|
213
|
-
<div className="h-full w-full flex flex-col bg-white dark:bg-
|
|
213
|
+
<div className="h-full w-full flex flex-col bg-white dark:bg-surface-950"
|
|
214
214
|
ref={ref}>
|
|
215
215
|
|
|
216
216
|
<VirtualTable
|
|
@@ -232,7 +232,7 @@ export const SelectableTable = React.memo<SelectableTableProps<any>>(
|
|
|
232
232
|
checkFilterCombination={checkFilterCombination}
|
|
233
233
|
createFilterField={filterable ? createFilterField : undefined}
|
|
234
234
|
rowClassName={useCallback((entity: Entity<M>) => {
|
|
235
|
-
return highlightedRow?.(entity) ? "bg-
|
|
235
|
+
return highlightedRow?.(entity) ? "bg-surface-100 bg-opacity-75 dark:bg-surface-800 dark:bg-opacity-75" : "";
|
|
236
236
|
}, [highlightedRow])}
|
|
237
237
|
className="flex-grow"
|
|
238
238
|
emptyComponent={emptyComponent}
|
|
@@ -102,7 +102,7 @@ export function DateTimeFilterField({
|
|
|
102
102
|
/>
|
|
103
103
|
|
|
104
104
|
<Label
|
|
105
|
-
className="border cursor-pointer rounded-md p-2 flex items-center gap-2 [&:has(:checked)]:bg-
|
|
105
|
+
className="border cursor-pointer rounded-md p-2 flex items-center gap-2 [&:has(:checked)]:bg-surface-100 dark:[&:has(:checked)]:bg-surface-800"
|
|
106
106
|
htmlFor="null-filter"
|
|
107
107
|
>
|
|
108
108
|
<Checkbox id="null-filter"
|
|
@@ -179,7 +179,7 @@ export function ReferenceFilterField({
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
{!isArray && <Label
|
|
182
|
-
className="border cursor-pointer rounded-md p-2 flex items-center gap-2 [&:has(:checked)]:bg-
|
|
182
|
+
className="border cursor-pointer rounded-md p-2 flex items-center gap-2 [&:has(:checked)]:bg-surface-100 dark:[&:has(:checked)]:bg-surface-800"
|
|
183
183
|
htmlFor="null-filter"
|
|
184
184
|
>
|
|
185
185
|
<Checkbox id="null-filter"
|
|
@@ -203,7 +203,7 @@ export function StringNumberFilterField({
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
{!isArray && <Label
|
|
206
|
-
className="border cursor-pointer rounded-md p-2 flex items-center gap-2 [&:has(:checked)]:bg-
|
|
206
|
+
className="border cursor-pointer rounded-md p-2 flex items-center gap-2 [&:has(:checked)]:bg-surface-100 dark:[&:has(:checked)]:bg-surface-800"
|
|
207
207
|
htmlFor="null-filter"
|
|
208
208
|
>
|
|
209
209
|
<Checkbox id="null-filter"
|
|
@@ -85,9 +85,9 @@ export const VirtualTableHeader = React.memo<VirtualTableHeaderProps<any>>(
|
|
|
85
85
|
return (
|
|
86
86
|
<ErrorBoundary>
|
|
87
87
|
<div
|
|
88
|
-
className={cls("flex py-0 px-3 h-full text-xs uppercase font-semibold relative select-none items-center bg-
|
|
89
|
-
"text-
|
|
90
|
-
"hover:bg-
|
|
88
|
+
className={cls("flex py-0 px-3 h-full text-xs uppercase font-semibold relative select-none items-center bg-surface-50 dark:bg-surface-900",
|
|
89
|
+
"text-text-secondary hover:text-text-primary dark:text-text-secondary-dark dark:hover:text-text-primary-dark",
|
|
90
|
+
"hover:bg-surface-100 dark:hover:bg-surface-800 hover:bg-opacity-50 dark:hover:bg-opacity-50",
|
|
91
91
|
column.frozen ? "sticky left-0 z-10" : "relative z-0"
|
|
92
92
|
)}
|
|
93
93
|
style={{
|
|
@@ -130,7 +130,7 @@ export const VirtualTableHeader = React.memo<VirtualTableHeaderProps<any>>(
|
|
|
130
130
|
invisible={!sort}>
|
|
131
131
|
<IconButton
|
|
132
132
|
size={"small"}
|
|
133
|
-
className={onHover || openFilter ? "bg-white dark:bg-
|
|
133
|
+
className={onHover || openFilter ? "bg-white dark:bg-surface-950" : undefined}
|
|
134
134
|
onClick={() => {
|
|
135
135
|
onColumnSort(column.key as Extract<keyof M, string>);
|
|
136
136
|
}}
|
|
@@ -157,7 +157,7 @@ export const VirtualTableHeader = React.memo<VirtualTableHeaderProps<any>>(
|
|
|
157
157
|
modal={true}
|
|
158
158
|
trigger={
|
|
159
159
|
<IconButton
|
|
160
|
-
className={onHover || openFilter ? "bg-white dark:bg-
|
|
160
|
+
className={onHover || openFilter ? "bg-white dark:bg-surface-950" : undefined}
|
|
161
161
|
size={"small"}
|
|
162
162
|
onClick={handleSettingsClick}>
|
|
163
163
|
<FilterListIcon size={"small"}/>
|
|
@@ -181,7 +181,7 @@ export const VirtualTableHeader = React.memo<VirtualTableHeaderProps<any>>(
|
|
|
181
181
|
ref={resizeHandleRef}
|
|
182
182
|
className={cls(
|
|
183
183
|
"absolute h-full w-[6px] top-0 right-0 cursor-col-resize",
|
|
184
|
-
hovered && "bg-
|
|
184
|
+
hovered && "bg-surface-300 dark:bg-surface-700"
|
|
185
185
|
)}
|
|
186
186
|
onMouseDown={onClickResizeColumn ? () => onClickResizeColumn(columnIndex, column) : undefined}
|
|
187
187
|
/>}
|
|
@@ -238,9 +238,9 @@ function FilterForm<M>({
|
|
|
238
238
|
e.preventDefault();
|
|
239
239
|
submit();
|
|
240
240
|
}}
|
|
241
|
-
className={"text-
|
|
241
|
+
className={"text-surface-900 dark:text-white"}>
|
|
242
242
|
<div
|
|
243
|
-
className={cls(defaultBorderMixin, "py-4 px-6
|
|
243
|
+
className={cls(defaultBorderMixin, "py-4 px-6 typography-label border-b")}>
|
|
244
244
|
{column.title ?? id}
|
|
245
245
|
</div>
|
|
246
246
|
{filterField && <div className="m-4">
|
|
@@ -100,7 +100,7 @@ export const VirtualTableHeaderRow = ({
|
|
|
100
100
|
|
|
101
101
|
return (
|
|
102
102
|
<div
|
|
103
|
-
className={cls(defaultBorderMixin, "z-20 sticky min-w-full flex w-fit flex-row top-0 left-0 h-12 border-b bg-
|
|
103
|
+
className={cls(defaultBorderMixin, "z-20 sticky min-w-full flex w-fit flex-row top-0 left-0 h-12 border-b bg-surface-50 dark:bg-surface-900")}>
|
|
104
104
|
{columns.map((c, columnIndex) => {
|
|
105
105
|
const column = columns[columnIndex];
|
|
106
106
|
|
|
@@ -29,7 +29,7 @@ export const VirtualTableRow = React.memo<VirtualTableRowProps<any>>(
|
|
|
29
29
|
return (
|
|
30
30
|
<div
|
|
31
31
|
className={cls(
|
|
32
|
-
"flex min-w-full text-sm border-b border-
|
|
32
|
+
"flex min-w-full text-sm border-b border-surface-200 dark:border-surface-800 border-opacity-40 dark:border-opacity-40",
|
|
33
33
|
rowClassName ? rowClassName(rowData) : "",
|
|
34
34
|
{
|
|
35
35
|
"hover:bg-opacity-95": hoverRow,
|
|
@@ -52,7 +52,7 @@ export type DataSourceEntityCollectionTableControllerProps<M extends Record<stri
|
|
|
52
52
|
* @param lastDeleteTimestamp
|
|
53
53
|
* @param forceFilterFromProps
|
|
54
54
|
*/
|
|
55
|
-
export function useDataSourceEntityCollectionTableController<M extends Record<string, any> = any,
|
|
55
|
+
export function useDataSourceEntityCollectionTableController<M extends Record<string, any> = any, USER extends User = User>(
|
|
56
56
|
{
|
|
57
57
|
fullPath,
|
|
58
58
|
collection,
|
|
@@ -112,7 +112,7 @@ export function useDataSourceEntityCollectionTableController<M extends Record<st
|
|
|
112
112
|
const sortByProperty = sortBy ? sortBy[0] : undefined;
|
|
113
113
|
const currentSort = sortBy ? sortBy[1] : undefined;
|
|
114
114
|
|
|
115
|
-
const context: FireCMSContext<
|
|
115
|
+
const context: FireCMSContext<USER> = useFireCMSContext();
|
|
116
116
|
|
|
117
117
|
const [rawData, setRawData] = useState<Entity<M>[]>([]);
|
|
118
118
|
|
|
@@ -85,7 +85,7 @@ export function DefaultDrawer({
|
|
|
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-4"}
|
|
89
89
|
key={`drawer_group_${group}`}>
|
|
90
90
|
{buildGroupHeader(group)}
|
|
91
91
|
{Object.values(navigationEntries)
|
|
@@ -112,7 +112,7 @@ export function DefaultDrawer({
|
|
|
112
112
|
trigger={
|
|
113
113
|
<IconButton
|
|
114
114
|
shape={"square"}
|
|
115
|
-
className={"m-4 text-
|
|
115
|
+
className={"m-4 text-surface-900 dark:text-white w-fit"}>
|
|
116
116
|
<Tooltip title={"Admin"}
|
|
117
117
|
open={tooltipsOpen}
|
|
118
118
|
side={"right"} sideOffset={28}>
|
|
@@ -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-secondary 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
42
|
"font-medium text-sm",
|
|
43
|
-
isActive ? "bg-
|
|
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
|
>
|
|
@@ -95,7 +95,7 @@ export interface EntityEditViewProps<M extends Record<string, any>> {
|
|
|
95
95
|
* You probably don't want to use this view directly since it is bound to the
|
|
96
96
|
* side panel.
|
|
97
97
|
*/
|
|
98
|
-
export function EntityEditView<M extends Record<string, any>,
|
|
98
|
+
export function EntityEditView<M extends Record<string, any>, USER extends User>({
|
|
99
99
|
entityId,
|
|
100
100
|
...props
|
|
101
101
|
}: EntityEditViewProps<M>) {
|
|
@@ -104,7 +104,7 @@ export function EntityEditView<M extends Record<string, any>, UserType extends U
|
|
|
104
104
|
dataLoading,
|
|
105
105
|
// eslint-disable-next-line no-unused-vars
|
|
106
106
|
dataLoadingError
|
|
107
|
-
} = useEntityFetch<M,
|
|
107
|
+
} = useEntityFetch<M, USER>({
|
|
108
108
|
path: props.path,
|
|
109
109
|
entityId: entityId,
|
|
110
110
|
collection: props.collection,
|
|
@@ -888,7 +888,7 @@ export function EntityEditViewInner<M extends Record<string, any>>({
|
|
|
888
888
|
let form = <>
|
|
889
889
|
|
|
890
890
|
{pluginActions.length > 0 && <div
|
|
891
|
-
className={cls("w-full flex justify-end items-center sticky top-0 right-0 left-0 z-10 bg-opacity-60 bg-
|
|
891
|
+
className={cls("w-full flex justify-end items-center sticky top-0 right-0 left-0 z-10 bg-opacity-60 bg-surface-accent-200 dark:bg-opacity-60 dark:bg-surface-accent-800 backdrop-blur-md")}>
|
|
892
892
|
{pluginActions}
|
|
893
893
|
</div>}
|
|
894
894
|
|
|
@@ -1004,7 +1004,7 @@ export function EntityEditViewInner<M extends Record<string, any>>({
|
|
|
1004
1004
|
<div className="flex flex-col h-full w-full">
|
|
1005
1005
|
|
|
1006
1006
|
<div
|
|
1007
|
-
className={cls(defaultBorderMixin, "no-scrollbar h-16 border-b pl-2 pr-2 pt-1 flex items-end overflow-scroll bg-
|
|
1007
|
+
className={cls(defaultBorderMixin, "no-scrollbar h-16 border-b pl-2 pr-2 pt-1 flex items-end overflow-scroll bg-surface-50 dark:bg-surface-950")}>
|
|
1008
1008
|
|
|
1009
1009
|
<div
|
|
1010
1010
|
className="pb-1 self-center">
|
package/src/core/FireCMS.tsx
CHANGED
|
@@ -30,7 +30,7 @@ import { useProjectLog } from "../hooks/useProjectLog";
|
|
|
30
30
|
|
|
31
31
|
* @group Core
|
|
32
32
|
*/
|
|
33
|
-
export function FireCMS<
|
|
33
|
+
export function FireCMS<USER extends User, EC extends EntityCollection>(props: FireCMSProps<USER, EC>) {
|
|
34
34
|
|
|
35
35
|
const {
|
|
36
36
|
children,
|
package/src/core/SideDialogs.tsx
CHANGED
|
@@ -130,7 +130,7 @@ function SideDialogView({
|
|
|
130
130
|
>
|
|
131
131
|
{panel &&
|
|
132
132
|
<div
|
|
133
|
-
className={"transform max-w-[100vw] lg:max-w-[95vw] flex flex-col h-full transition-all duration-250 ease-in-out bg-white dark:bg-
|
|
133
|
+
className={"transform max-w-[100vw] lg:max-w-[95vw] flex flex-col h-full transition-all duration-250 ease-in-out bg-white dark:bg-surface-900 "}
|
|
134
134
|
style={{
|
|
135
135
|
width: panel.width,
|
|
136
136
|
transform: `translateX(-${offsetPosition * 200}px)`
|
|
@@ -129,7 +129,7 @@ export const DEFAULT_FIELD_CONFIGS: Record<string, PropertyConfig<any>> = {
|
|
|
129
129
|
},
|
|
130
130
|
multi_select: {
|
|
131
131
|
key: "multi_select",
|
|
132
|
-
name: "Multi select",
|
|
132
|
+
name: "Multi select (enum)",
|
|
133
133
|
description: "Select multiple text values from within an enumeration",
|
|
134
134
|
Icon: ListAltIcon,
|
|
135
135
|
color: "#4223c9",
|
|
@@ -36,7 +36,7 @@ export function StorageItemPreview({
|
|
|
36
36
|
|
|
37
37
|
{!placeholder && !disabled &&
|
|
38
38
|
<div
|
|
39
|
-
className="absolute rounded-full -top-2 -right-2 z-10 bg-white dark:bg-
|
|
39
|
+
className="absolute rounded-full -top-2 -right-2 z-10 bg-white dark:bg-surface-900">
|
|
40
40
|
|
|
41
41
|
<Tooltip
|
|
42
42
|
asChild={true}
|
|
@@ -67,7 +67,7 @@ export function StorageItemPreview({
|
|
|
67
67
|
<div
|
|
68
68
|
onClick={(e) => e.stopPropagation()}
|
|
69
69
|
className="flex flex-col items-center justify-center w-full h-full">
|
|
70
|
-
<DescriptionIcon className="text-
|
|
70
|
+
<DescriptionIcon className="text-surface-700 dark:text-surface-300"/>
|
|
71
71
|
</div>
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -112,7 +112,7 @@ export function MapFieldBinding({
|
|
|
112
112
|
expanded
|
|
113
113
|
});
|
|
114
114
|
}}
|
|
115
|
-
innerClassName={"px-2 md:px-4 pb-2 md:pb-4 pt-1 md:pt-2 bg-white dark:bg-
|
|
115
|
+
innerClassName={"px-2 md:px-4 pb-2 md:pb-4 pt-1 md:pt-2 bg-white dark:bg-surface-900"}
|
|
116
116
|
title={title}>{mapFormView}</ExpandablePanel>}
|
|
117
117
|
|
|
118
118
|
{minimalistView && mapFormView}
|
|
@@ -111,12 +111,12 @@ function ReferenceFieldBindingInternal({
|
|
|
111
111
|
{!value && <div className="justify-center text-left">
|
|
112
112
|
<EntityPreviewContainer className={cls("px-6 h-16 text-sm font-medium flex items-center gap-6",
|
|
113
113
|
disabled || isSubmitting
|
|
114
|
-
? "text-
|
|
115
|
-
: "cursor-pointer text-
|
|
114
|
+
? "text-surface-accent-500"
|
|
115
|
+
: "cursor-pointer text-surface-accent-700 dark:text-surface-accent-300 hover:bg-surface-accent-50 dark:hover:bg-surface-800 group-hover:bg-surface-accent-50 dark:group-hover:bg-surface-800")}
|
|
116
116
|
onClick={onEntryClick}
|
|
117
117
|
size={"medium"}>
|
|
118
118
|
<IconForView collectionOrView={collection}
|
|
119
|
-
className={"text-
|
|
119
|
+
className={"text-surface-300 dark:text-surface-600"}/>
|
|
120
120
|
{`Edit ${property.name}`.toUpperCase()}
|
|
121
121
|
</EntityPreviewContainer>
|
|
122
122
|
</div>}
|
package/src/hooks/data/delete.ts
CHANGED
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
/**
|
|
13
13
|
* @group Hooks and utilities
|
|
14
14
|
*/
|
|
15
|
-
export type DeleteEntityWithCallbacksProps<M extends Record<string, any>,
|
|
15
|
+
export type DeleteEntityWithCallbacksProps<M extends Record<string, any>, USER extends User = User> =
|
|
16
16
|
DeleteEntityProps<M>
|
|
17
17
|
& {
|
|
18
|
-
callbacks?: EntityCallbacks<M,
|
|
18
|
+
callbacks?: EntityCallbacks<M, USER>;
|
|
19
19
|
onDeleteSuccess?: (entity: Entity<M>) => void;
|
|
20
20
|
onDeleteFailure?: (entity: Entity<M>, e: Error) => void;
|
|
21
21
|
onPreDeleteHookError?: (entity: Entity<M>, e: Error) => void;
|
|
@@ -43,7 +43,7 @@ export type DeleteEntityWithCallbacksProps<M extends Record<string, any>, UserTy
|
|
|
43
43
|
* @param context
|
|
44
44
|
* @group Hooks and utilities
|
|
45
45
|
*/
|
|
46
|
-
export async function deleteEntityWithCallbacks<M extends Record<string, any>,
|
|
46
|
+
export async function deleteEntityWithCallbacks<M extends Record<string, any>, USER extends User>({
|
|
47
47
|
dataSource,
|
|
48
48
|
entity,
|
|
49
49
|
collection,
|
|
@@ -56,7 +56,7 @@ export async function deleteEntityWithCallbacks<M extends Record<string, any>, U
|
|
|
56
56
|
}: DeleteEntityWithCallbacksProps<M> & {
|
|
57
57
|
collection: ResolvedEntityCollection<M>,
|
|
58
58
|
dataSource: DataSource,
|
|
59
|
-
context: FireCMSContext<
|
|
59
|
+
context: FireCMSContext<USER>
|
|
60
60
|
}
|
|
61
61
|
): Promise<boolean> {
|
|
62
62
|
|
package/src/hooks/data/save.ts
CHANGED
|
@@ -48,7 +48,7 @@ export type SaveEntityWithCallbacksProps<M extends Record<string, any>> =
|
|
|
48
48
|
* @see useDataSource
|
|
49
49
|
* @group Hooks and utilities
|
|
50
50
|
*/
|
|
51
|
-
export async function saveEntityWithCallbacks<M extends Record<string, any>,
|
|
51
|
+
export async function saveEntityWithCallbacks<M extends Record<string, any>, USER extends User>({
|
|
52
52
|
collection,
|
|
53
53
|
path,
|
|
54
54
|
entityId,
|
|
@@ -62,9 +62,9 @@ export async function saveEntityWithCallbacks<M extends Record<string, any>, Use
|
|
|
62
62
|
onPreSaveHookError,
|
|
63
63
|
onSaveSuccessHookError
|
|
64
64
|
}: SaveEntityWithCallbacksProps<M> & {
|
|
65
|
-
collection: EntityCollection<M,
|
|
65
|
+
collection: EntityCollection<M, USER>,
|
|
66
66
|
dataSource: DataSource,
|
|
67
|
-
context: FireCMSContext<
|
|
67
|
+
context: FireCMSContext<USER>,
|
|
68
68
|
}
|
|
69
69
|
): Promise<void> {
|
|
70
70
|
|
|
@@ -60,7 +60,7 @@ export interface CollectionFetchResult<M extends Record<string, any>> {
|
|
|
60
60
|
* @param searchString
|
|
61
61
|
* @group Hooks and utilities
|
|
62
62
|
*/
|
|
63
|
-
export function useCollectionFetch<M extends Record<string, any>,
|
|
63
|
+
export function useCollectionFetch<M extends Record<string, any>, USER extends User>(
|
|
64
64
|
{
|
|
65
65
|
path: inputPath,
|
|
66
66
|
collection,
|
|
@@ -78,7 +78,7 @@ export function useCollectionFetch<M extends Record<string, any>, UserType exten
|
|
|
78
78
|
const sortByProperty = sortBy ? sortBy[0] : undefined;
|
|
79
79
|
const currentSort = sortBy ? sortBy[1] : undefined;
|
|
80
80
|
|
|
81
|
-
const context: FireCMSContext<
|
|
81
|
+
const context: FireCMSContext<USER> = useFireCMSContext();
|
|
82
82
|
|
|
83
83
|
const [data, setData] = useState<Entity<M>[]>([]);
|
|
84
84
|
|