@firecms/core 3.0.0-canary.122 → 3.0.0-canary.124
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 +50 -40
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +50 -40
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +8 -7
- package/src/components/EntityPreview.tsx +2 -2
- package/src/components/common/useDataSourceEntityCollectionTableController.tsx +12 -12
- package/src/core/DefaultDrawer.tsx +9 -5
- package/src/core/DrawerNavigationItem.tsx +4 -4
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.124",
|
|
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.
|
|
50
|
-
"@firecms/formex": "^3.0.0-canary.
|
|
51
|
-
"@firecms/ui": "^3.0.0-canary.
|
|
49
|
+
"@firecms/editor": "^3.0.0-canary.124",
|
|
50
|
+
"@firecms/formex": "^3.0.0-canary.124",
|
|
51
|
+
"@firecms/ui": "^3.0.0-canary.124",
|
|
52
52
|
"@hello-pangea/dnd": "^16.6.0",
|
|
53
53
|
"@radix-ui/react-portal": "^1.1.1",
|
|
54
54
|
"clsx": "^2.1.1",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"dist",
|
|
101
101
|
"src"
|
|
102
102
|
],
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "b1ef1804b61ad99988128d9a79d4364dba7d9beb",
|
|
104
104
|
"publishConfig": {
|
|
105
105
|
"access": "public"
|
|
106
106
|
},
|
|
@@ -151,13 +151,14 @@ export const TableReferenceFieldInternal = React.memo(
|
|
|
151
151
|
{internalValue && multiselect && buildMultipleReferenceField()}
|
|
152
152
|
|
|
153
153
|
{valueNotSet &&
|
|
154
|
-
<EntityPreviewContainer
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
154
|
+
<EntityPreviewContainer
|
|
155
|
+
className={cls("px-4 py-2 text-sm font-medium flex items-center uppercase",
|
|
156
|
+
multiselect ? "gap-4" : "gap-6",
|
|
157
|
+
disabled
|
|
158
|
+
? "text-slate-500"
|
|
159
|
+
: "cursor-pointer text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-gray-800 group-hover:bg-slate-50 dark:group-hover:bg-gray-800")}
|
|
160
|
+
onClick={handleOpen}
|
|
161
|
+
size={"medium"}>
|
|
161
162
|
<IconForView
|
|
162
163
|
size={"small"}
|
|
163
164
|
collectionOrView={collection}
|
|
@@ -77,12 +77,12 @@ export function EntityPreview({
|
|
|
77
77
|
return <EntityPreviewContainer onClick={disabled ? undefined : onClick}
|
|
78
78
|
hover={disabled ? undefined : hover}
|
|
79
79
|
size={size}>
|
|
80
|
-
<div className={cls("w-10 h-10 mr-2 shrink-0 grow-0", size === "smallest" ? "my-0.5" : "m-2 self-start")}>
|
|
80
|
+
<div className={cls("flex w-10 h-10 mr-2 shrink-0 grow-0", size === "smallest" ? "my-0.5" : "m-2 self-start")}>
|
|
81
81
|
{imageProperty && <PropertyPreview property={imageProperty}
|
|
82
82
|
propertyKey={imagePropertyKey as string}
|
|
83
83
|
size={"smallest"}
|
|
84
84
|
value={getValueInPath(entity.values, imagePropertyKey as string)}/>}
|
|
85
|
-
{!imageProperty && <IconForView collectionOrView={collection} size={size} className={"
|
|
85
|
+
{!imageProperty && <IconForView collectionOrView={collection} size={size} className={"m-auto"}/>}
|
|
86
86
|
</div>
|
|
87
87
|
|
|
88
88
|
|
|
@@ -80,6 +80,18 @@ export function useDataSourceEntityCollectionTableController<M extends Record<st
|
|
|
80
80
|
const [searchString, setSearchString] = React.useState<string | undefined>();
|
|
81
81
|
const [itemCount, setItemCount] = React.useState<number | undefined>(paginationEnabled ? pageSize : undefined);
|
|
82
82
|
|
|
83
|
+
const checkFilterCombination = useCallback((filterValues: FilterValues<any>,
|
|
84
|
+
sortBy?: [string, "asc" | "desc"]) => {
|
|
85
|
+
if (!dataSource.isFilterCombinationValid)
|
|
86
|
+
return true;
|
|
87
|
+
return dataSource.isFilterCombinationValid({
|
|
88
|
+
path: resolvedPath,
|
|
89
|
+
collection,
|
|
90
|
+
filterValues,
|
|
91
|
+
sortBy
|
|
92
|
+
})
|
|
93
|
+
}, []);
|
|
94
|
+
|
|
83
95
|
const initialSortInternal = useMemo(() => {
|
|
84
96
|
if (initialSort && forceFilter && !checkFilterCombination(forceFilter, initialSort)) {
|
|
85
97
|
console.warn("Initial sort is not compatible with the force filter. Ignoring initial sort");
|
|
@@ -108,18 +120,6 @@ export function useDataSourceEntityCollectionTableController<M extends Record<st
|
|
|
108
120
|
const [dataLoadingError, setDataLoadingError] = useState<Error | undefined>();
|
|
109
121
|
const [noMoreToLoad, setNoMoreToLoad] = useState<boolean>(false);
|
|
110
122
|
|
|
111
|
-
const checkFilterCombination = useCallback((filterValues: FilterValues<any>,
|
|
112
|
-
sortBy?: [string, "asc" | "desc"]) => {
|
|
113
|
-
if (!dataSource.isFilterCombinationValid)
|
|
114
|
-
return true;
|
|
115
|
-
return dataSource.isFilterCombinationValid({
|
|
116
|
-
path: resolvedPath,
|
|
117
|
-
collection,
|
|
118
|
-
filterValues,
|
|
119
|
-
sortBy
|
|
120
|
-
})
|
|
121
|
-
}, []);
|
|
122
|
-
|
|
123
123
|
const clearFilter = useCallback(() => setFilterValues(forceFilter ?? undefined), [forceFilter]);
|
|
124
124
|
|
|
125
125
|
const updateFilterValues = useCallback((updatedFilter: FilterValues<Extract<keyof M, string>> | undefined) => {
|
|
@@ -51,9 +51,9 @@ export function DefaultDrawer({
|
|
|
51
51
|
const groupsWithoutAdmin = groups.filter(g => g !== "Admin");
|
|
52
52
|
|
|
53
53
|
const buildGroupHeader = useCallback((group?: string) => {
|
|
54
|
-
if (!drawerOpen) return <div className="
|
|
54
|
+
if (!drawerOpen) return <div className="w-full"/>;
|
|
55
55
|
return <div
|
|
56
|
-
className="
|
|
56
|
+
className="pl-6 pr-8 py-4 flex flex-row items-center">
|
|
57
57
|
<Typography variant={"caption"}
|
|
58
58
|
color={"secondary"}
|
|
59
59
|
className="font-medium flex-grow line-clamp-1">
|
|
@@ -78,10 +78,14 @@ export function DefaultDrawer({
|
|
|
78
78
|
|
|
79
79
|
<DrawerLogo logo={logo}/>
|
|
80
80
|
|
|
81
|
-
<div className={"flex-grow overflow-scroll no-scrollbar"}
|
|
81
|
+
<div className={"mt-4 flex-grow overflow-scroll no-scrollbar"}
|
|
82
|
+
style={{
|
|
83
|
+
maskImage: "linear-gradient(to bottom, transparent 0, black 20px, black calc(100% - 20px), transparent 100%)",
|
|
84
|
+
}}>
|
|
82
85
|
|
|
83
86
|
{groupsWithoutAdmin.map((group) => (
|
|
84
|
-
<
|
|
87
|
+
<div
|
|
88
|
+
className={"bg-gray-50 dark:bg-gray-800 dark:bg-opacity-30 my-4 rounded-lg ml-4"}
|
|
85
89
|
key={`drawer_group_${group}`}>
|
|
86
90
|
{buildGroupHeader(group)}
|
|
87
91
|
{Object.values(navigationEntries)
|
|
@@ -96,7 +100,7 @@ export function DefaultDrawer({
|
|
|
96
100
|
onClick={() => onClick(view)}
|
|
97
101
|
url={view.url}
|
|
98
102
|
name={view.name}/>)}
|
|
99
|
-
</
|
|
103
|
+
</div>
|
|
100
104
|
))}
|
|
101
105
|
|
|
102
106
|
</div>
|
|
@@ -30,17 +30,17 @@ export function DrawerNavigationItem({
|
|
|
30
30
|
<NavLink
|
|
31
31
|
onClick={onClick}
|
|
32
32
|
style={{
|
|
33
|
-
width:
|
|
33
|
+
width: "100%",
|
|
34
34
|
transition: drawerOpen ? "width 150ms ease-in" : undefined
|
|
35
35
|
}}
|
|
36
|
-
className={({ isActive }: any) => cls("rounded-
|
|
36
|
+
className={({ isActive }: any) => cls("rounded-lg truncate",
|
|
37
37
|
"hover:bg-slate-300 hover:bg-opacity-75 dark:hover:bg-gray-700 dark:hover:bg-opacity-75 text-gray-800 dark:text-gray-200 hover:text-gray-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
|
-
drawerOpen ? "pl-
|
|
41
|
+
drawerOpen ? "pl-4 h-12" : "pl-4 h-11",
|
|
42
42
|
"font-medium text-sm",
|
|
43
|
-
isActive ? "bg-slate-200 bg-opacity-60 dark:bg-gray-800 dark:bg-opacity-
|
|
43
|
+
isActive ? "bg-slate-200 bg-opacity-60 dark:bg-gray-800 dark:bg-opacity-50" : ""
|
|
44
44
|
)}
|
|
45
45
|
to={url}
|
|
46
46
|
>
|