@firecms/core 3.0.0-canary.240 → 3.0.0-canary.241
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 +14 -9
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +14 -9
- package/dist/index.umd.js.map +1 -1
- package/dist/types/firecms.d.ts +2 -1
- package/dist/types/navigation.d.ts +5 -0
- package/package.json +5 -5
- package/src/core/FireCMS.tsx +7 -1
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +1 -1
- package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
- package/src/hooks/useBuildNavigationController.tsx +1 -0
- package/src/preview/components/ImagePreview.tsx +2 -2
- package/src/types/firecms.tsx +2 -1
- package/src/types/navigation.ts +6 -0
package/dist/types/firecms.d.ts
CHANGED
|
@@ -113,7 +113,8 @@ export type FireCMSProps<USER extends User> = {
|
|
|
113
113
|
userConfigPersistence?: UserConfigurationPersistence;
|
|
114
114
|
/**
|
|
115
115
|
* Use plugins to modify the behaviour of the CMS.
|
|
116
|
-
*
|
|
116
|
+
* DEPRECATED: use the `plugins` prop in the `useBuildNavigationController` instead.
|
|
117
|
+
* This prop will work as a fallback for the `plugins` prop in the `useBuildNavigationController`.
|
|
117
118
|
*/
|
|
118
119
|
plugins?: FireCMSPlugin<any, any, any>[];
|
|
119
120
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EntityCollection } from "./collections";
|
|
3
3
|
import { EntityReference } from "./entities";
|
|
4
|
+
import { FireCMSPlugin } from "./plugins";
|
|
4
5
|
/**
|
|
5
6
|
* Controller that includes the resolved navigation and utility methods and
|
|
6
7
|
* attributes.
|
|
@@ -127,6 +128,10 @@ export type NavigationController<EC extends EntityCollection = EntityCollection<
|
|
|
127
128
|
* @param {NavigateOptions} [options] - Optional configuration settings for navigation, such as replace behavior or state data.
|
|
128
129
|
*/
|
|
129
130
|
navigate: (to: string, options?: NavigateOptions) => void;
|
|
131
|
+
/**
|
|
132
|
+
* Plugin system allowing to extend the CMS functionality.
|
|
133
|
+
*/
|
|
134
|
+
plugins?: FireCMSPlugin<any, any, any>[];
|
|
130
135
|
};
|
|
131
136
|
export interface NavigateOptions {
|
|
132
137
|
replace?: boolean;
|
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.241",
|
|
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.241",
|
|
54
|
+
"@firecms/formex": "^3.0.0-canary.241",
|
|
55
|
+
"@firecms/ui": "^3.0.0-canary.241",
|
|
56
56
|
"@hello-pangea/dnd": "^17.0.0",
|
|
57
57
|
"@radix-ui/react-portal": "^1.1.3",
|
|
58
58
|
"clsx": "^2.1.1",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"dist",
|
|
106
106
|
"src"
|
|
107
107
|
],
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "5d3c3928250947d0363073d612a8c15f9bc10459",
|
|
109
109
|
"publishConfig": {
|
|
110
110
|
"access": "public"
|
|
111
111
|
},
|
package/src/core/FireCMS.tsx
CHANGED
|
@@ -44,7 +44,7 @@ export function FireCMS<USER extends User>(props: FireCMSProps<USER>) {
|
|
|
44
44
|
authController,
|
|
45
45
|
storageSource,
|
|
46
46
|
dataSourceDelegate,
|
|
47
|
-
plugins,
|
|
47
|
+
plugins: pluginsProp,
|
|
48
48
|
onAnalyticsEvent,
|
|
49
49
|
propertyConfigs,
|
|
50
50
|
entityViews,
|
|
@@ -53,6 +53,12 @@ export function FireCMS<USER extends User>(props: FireCMSProps<USER>) {
|
|
|
53
53
|
apiKey
|
|
54
54
|
} = props;
|
|
55
55
|
|
|
56
|
+
if (pluginsProp) {
|
|
57
|
+
console.warn("The `plugins` prop is deprecated in the FireCMS component. You should pass your plugins to `useBuildNavigationController` instead.");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const plugins = navigationController.plugins ?? pluginsProp;
|
|
61
|
+
|
|
56
62
|
const sideDialogsController = useBuildSideDialogsController();
|
|
57
63
|
const sideEntityController = useBuildSideEntityController(navigationController, sideDialogsController, authController);
|
|
58
64
|
|
|
@@ -141,7 +141,7 @@ export function MarkdownEditorFieldBinding({
|
|
|
141
141
|
icon={getIconForProperty(property, "small")}
|
|
142
142
|
required={property.validation?.required}
|
|
143
143
|
title={property.name}
|
|
144
|
-
className={"h-
|
|
144
|
+
className={"h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>
|
|
145
145
|
<div
|
|
146
146
|
className={cls("rounded-md", fieldBackgroundMixin, disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin)}>
|
|
147
147
|
{editor}
|
|
@@ -92,7 +92,7 @@ export function MultiSelectFieldBinding({
|
|
|
92
92
|
icon={getIconForProperty(property, "small")}
|
|
93
93
|
required={property.validation?.required}
|
|
94
94
|
title={property.name}
|
|
95
|
-
className={"h-
|
|
95
|
+
className={"h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>}
|
|
96
96
|
onValueChange={(updatedValue: string[]) => {
|
|
97
97
|
let newValue: EnumType[] | null;
|
|
98
98
|
if (of && (of as ResolvedProperty)?.dataType === "number") {
|
|
@@ -39,7 +39,7 @@ export function ReadOnlyFieldBinding({
|
|
|
39
39
|
icon={getIconForProperty(property, "small")}
|
|
40
40
|
required={property.validation?.required}
|
|
41
41
|
title={property.name}
|
|
42
|
-
className={"h-
|
|
42
|
+
className={"h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
<div
|
|
@@ -90,7 +90,7 @@ function ReferenceFieldBindingInternal({
|
|
|
90
90
|
icon={getIconForProperty(property, "small")}
|
|
91
91
|
required={property.validation?.required}
|
|
92
92
|
title={property.name}
|
|
93
|
-
className={"h-
|
|
93
|
+
className={"h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5"}/>}
|
|
94
94
|
|
|
95
95
|
{!collection && <ErrorView
|
|
96
96
|
error={"The specified collection does not exist. Check console"}/>}
|
|
@@ -62,7 +62,7 @@ export function SelectFieldBinding<T extends EnumType>({
|
|
|
62
62
|
icon={getIconForProperty(property, "small")}
|
|
63
63
|
required={property.validation?.required}
|
|
64
64
|
title={property.name}
|
|
65
|
-
className={"h-
|
|
65
|
+
className={"h-8 text-text-secondary dark:text-text-secondary-dark ml-3.5 my-0"}
|
|
66
66
|
/>
|
|
67
67
|
</PropertyIdCopyTooltip>}
|
|
68
68
|
endAdornment={
|
|
@@ -62,7 +62,7 @@ export function ImagePreview({
|
|
|
62
62
|
title="Copy url to clipboard" side={"bottom"}>
|
|
63
63
|
<IconButton
|
|
64
64
|
variant={"filled"}
|
|
65
|
-
size={"
|
|
65
|
+
size={"smallest"}
|
|
66
66
|
onClick={(e) => {
|
|
67
67
|
e.stopPropagation();
|
|
68
68
|
e.preventDefault();
|
|
@@ -81,7 +81,7 @@ export function ImagePreview({
|
|
|
81
81
|
href={url}
|
|
82
82
|
rel="noopener noreferrer"
|
|
83
83
|
target="_blank"
|
|
84
|
-
size={"
|
|
84
|
+
size={"smallest"}
|
|
85
85
|
onClick={(e: any) => e.stopPropagation()}
|
|
86
86
|
>
|
|
87
87
|
<OpenInNewIcon className={"text-surface-700 dark:text-surface-300"}
|
package/src/types/firecms.tsx
CHANGED
|
@@ -128,7 +128,8 @@ export type FireCMSProps<USER extends User> = {
|
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
130
|
* Use plugins to modify the behaviour of the CMS.
|
|
131
|
-
*
|
|
131
|
+
* DEPRECATED: use the `plugins` prop in the `useBuildNavigationController` instead.
|
|
132
|
+
* This prop will work as a fallback for the `plugins` prop in the `useBuildNavigationController`.
|
|
132
133
|
*/
|
|
133
134
|
plugins?: FireCMSPlugin<any, any, any>[];
|
|
134
135
|
|
package/src/types/navigation.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EntityCollection } from "./collections";
|
|
3
3
|
import { EntityReference } from "./entities";
|
|
4
|
+
import { FireCMSPlugin } from "./plugins";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Controller that includes the resolved navigation and utility methods and
|
|
@@ -152,6 +153,11 @@ export type NavigationController<EC extends EntityCollection = EntityCollection<
|
|
|
152
153
|
*/
|
|
153
154
|
navigate: (to: string, options?: NavigateOptions) => void;
|
|
154
155
|
|
|
156
|
+
/**
|
|
157
|
+
* Plugin system allowing to extend the CMS functionality.
|
|
158
|
+
*/
|
|
159
|
+
plugins?: FireCMSPlugin<any, any, any>[];
|
|
160
|
+
|
|
155
161
|
}
|
|
156
162
|
|
|
157
163
|
export interface NavigateOptions {
|