@firecms/collection_editor 3.0.0-canary.235 → 3.0.0-canary.237
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/ConfigControllerProvider.d.ts +0 -1
- package/dist/index.es.js +268 -260
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +268 -260
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collection_editor_controller.d.ts +0 -1
- package/dist/ui/collection_editor/CollectionEditorWelcomeView.d.ts +1 -1
- package/dist/useCollectionEditorPlugin.d.ts +3 -3
- package/package.json +8 -8
- package/src/ConfigControllerProvider.tsx +0 -5
- package/src/types/collection_editor_controller.tsx +0 -2
- package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +5 -21
- package/src/useCollectionEditorPlugin.tsx +5 -6
- package/src/utils/collections.ts +1 -0
|
@@ -6,7 +6,7 @@ export declare function CollectionEditorWelcomeView({ path, pathSuggestions, par
|
|
|
6
6
|
parentCollection?: EntityCollection;
|
|
7
7
|
onContinue: (importData?: object[], propertiesOrder?: string[]) => void;
|
|
8
8
|
existingCollectionPaths?: string[];
|
|
9
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
10
10
|
export declare function TemplateButton({ title, subtitle, icon, onClick }: {
|
|
11
11
|
title: string;
|
|
12
12
|
icon: React.ReactNode;
|
|
@@ -25,11 +25,11 @@ export interface CollectionConfigControllerProps<EC extends PersistedCollection
|
|
|
25
25
|
}>;
|
|
26
26
|
icon: React.ReactNode;
|
|
27
27
|
};
|
|
28
|
-
getPathSuggestions?: (path?: string) => Promise<string[]>;
|
|
29
28
|
collectionInference?: CollectionInference;
|
|
30
29
|
getData?: (path: string, parentPaths: string[]) => Promise<object[]>;
|
|
31
30
|
getUser?: (uid: string) => USER | null;
|
|
32
31
|
onAnalyticsEvent?: (event: string, params?: object) => void;
|
|
32
|
+
includeIntroView?: boolean;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Use this hook to initialise the Collection Editor plugin.
|
|
@@ -42,5 +42,5 @@ export interface CollectionConfigControllerProps<EC extends PersistedCollection
|
|
|
42
42
|
* @param getUser
|
|
43
43
|
* @param collectionInference
|
|
44
44
|
*/
|
|
45
|
-
export declare function useCollectionEditorPlugin<EC extends PersistedCollection = PersistedCollection, USER extends User = User>({ collectionConfigController, configPermissions, reservedGroups, extraView,
|
|
46
|
-
export declare function IntroWidget(
|
|
45
|
+
export declare function useCollectionEditorPlugin<EC extends PersistedCollection = PersistedCollection, USER extends User = User>({ collectionConfigController, configPermissions, reservedGroups, extraView, getUser, collectionInference, getData, onAnalyticsEvent, includeIntroView }: CollectionConfigControllerProps<EC, USER>): FireCMSPlugin<any, any, PersistedCollection>;
|
|
46
|
+
export declare function IntroWidget(): import("react/jsx-runtime").JSX.Element | null;
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firecms/collection_editor",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-canary.
|
|
4
|
+
"version": "3.0.0-canary.237",
|
|
5
5
|
"main": "./dist/index.umd.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"source": "src/index.ts",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@firecms/data_export": "^3.0.0-canary.
|
|
11
|
-
"@firecms/data_import": "^3.0.0-canary.
|
|
12
|
-
"@firecms/data_import_export": "^3.0.0-canary.
|
|
13
|
-
"@firecms/formex": "^3.0.0-canary.
|
|
14
|
-
"@firecms/schema_inference": "^3.0.0-canary.
|
|
15
|
-
"@firecms/ui": "^3.0.0-canary.
|
|
10
|
+
"@firecms/data_export": "^3.0.0-canary.237",
|
|
11
|
+
"@firecms/data_import": "^3.0.0-canary.237",
|
|
12
|
+
"@firecms/data_import_export": "^3.0.0-canary.237",
|
|
13
|
+
"@firecms/formex": "^3.0.0-canary.237",
|
|
14
|
+
"@firecms/schema_inference": "^3.0.0-canary.237",
|
|
15
|
+
"@firecms/ui": "^3.0.0-canary.237",
|
|
16
16
|
"@hello-pangea/dnd": "^17.0.0",
|
|
17
17
|
"json5": "^2.2.3",
|
|
18
18
|
"prism-react-renderer": "^2.4.1"
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "20e10b4e0cd4b6a2f2831b219ce43a6d09047a54"
|
|
74
74
|
}
|
|
@@ -49,8 +49,6 @@ export interface ConfigControllerProviderProps {
|
|
|
49
49
|
icon: React.ReactNode
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
getPathSuggestions?: (path?: string) => Promise<string[]>;
|
|
53
|
-
|
|
54
52
|
getUser?: (uid: string) => User | null
|
|
55
53
|
|
|
56
54
|
getData?: (path: string, parentPaths: string[]) => Promise<object[]>;
|
|
@@ -67,7 +65,6 @@ export const ConfigControllerProvider = React.memo(
|
|
|
67
65
|
reservedGroups,
|
|
68
66
|
collectionInference,
|
|
69
67
|
extraView,
|
|
70
|
-
getPathSuggestions,
|
|
71
68
|
getUser,
|
|
72
69
|
getData,
|
|
73
70
|
onAnalyticsEvent,
|
|
@@ -230,7 +227,6 @@ export const ConfigControllerProvider = React.memo(
|
|
|
230
227
|
createCollection,
|
|
231
228
|
editProperty,
|
|
232
229
|
configPermissions: configPermissions ?? defaultConfigPermissions,
|
|
233
|
-
getPathSuggestions,
|
|
234
230
|
}}>
|
|
235
231
|
|
|
236
232
|
{children}
|
|
@@ -244,7 +240,6 @@ export const ConfigControllerProvider = React.memo(
|
|
|
244
240
|
getData={getData}
|
|
245
241
|
reservedGroups={reservedGroups}
|
|
246
242
|
extraView={extraView}
|
|
247
|
-
pathSuggestions={getPathSuggestions}
|
|
248
243
|
getUser={getUser}
|
|
249
244
|
handleClose={(collection) => {
|
|
250
245
|
if (currentDialog?.redirect) {
|
|
@@ -37,18 +37,6 @@ export function CollectionEditorWelcomeView({
|
|
|
37
37
|
}
|
|
38
38
|
}, [existingCollectionPaths, path, pathSuggestions]);
|
|
39
39
|
|
|
40
|
-
// const {
|
|
41
|
-
// values,
|
|
42
|
-
// setFieldValue,
|
|
43
|
-
// setValues,
|
|
44
|
-
// handleChange,
|
|
45
|
-
// touched,
|
|
46
|
-
// errors,
|
|
47
|
-
// setFieldTouched,
|
|
48
|
-
// isSubmitting,
|
|
49
|
-
// submitCount
|
|
50
|
-
// } = useFormex<EntityCollection>();
|
|
51
|
-
|
|
52
40
|
const {
|
|
53
41
|
values,
|
|
54
42
|
setFieldValue,
|
|
@@ -56,6 +44,11 @@ export function CollectionEditorWelcomeView({
|
|
|
56
44
|
submitCount
|
|
57
45
|
} = useFormex<EntityCollection>();
|
|
58
46
|
|
|
47
|
+
const noSuggestions = !loadingPathSuggestions && (filteredPathSuggestions ?? [])?.length === 0;
|
|
48
|
+
if (!noSuggestions) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
|
|
59
52
|
return (
|
|
60
53
|
<div className={"overflow-auto my-auto"}>
|
|
61
54
|
<Container maxWidth={"4xl"} className={"flex flex-col gap-4 p-8 m-auto"}>
|
|
@@ -97,12 +90,6 @@ export function CollectionEditorWelcomeView({
|
|
|
97
90
|
</Chip>
|
|
98
91
|
))}
|
|
99
92
|
|
|
100
|
-
{!loadingPathSuggestions && (filteredPathSuggestions ?? [])?.length === 0 &&
|
|
101
|
-
<Typography variant={"caption"}>
|
|
102
|
-
No suggestions
|
|
103
|
-
</Typography>
|
|
104
|
-
}
|
|
105
|
-
|
|
106
93
|
</div>
|
|
107
94
|
|
|
108
95
|
</div>
|
|
@@ -202,9 +189,6 @@ export function TemplateButton({
|
|
|
202
189
|
<Typography variant={"subtitle1"}>
|
|
203
190
|
{title}
|
|
204
191
|
</Typography>
|
|
205
|
-
{/*<Typography>*/}
|
|
206
|
-
{/* {subtitle}*/}
|
|
207
|
-
{/*</Typography>*/}
|
|
208
192
|
|
|
209
193
|
</div>
|
|
210
194
|
</Card>
|
|
@@ -41,8 +41,6 @@ export interface CollectionConfigControllerProps<EC extends PersistedCollection
|
|
|
41
41
|
icon: React.ReactNode
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
getPathSuggestions?: (path?: string) => Promise<string[]>;
|
|
45
|
-
|
|
46
44
|
collectionInference?: CollectionInference;
|
|
47
45
|
|
|
48
46
|
getData?: (path: string, parentPaths: string[]) => Promise<object[]>;
|
|
@@ -51,6 +49,8 @@ export interface CollectionConfigControllerProps<EC extends PersistedCollection
|
|
|
51
49
|
|
|
52
50
|
onAnalyticsEvent?: (event: string, params?: object) => void;
|
|
53
51
|
|
|
52
|
+
includeIntroView?: boolean;
|
|
53
|
+
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/**
|
|
@@ -70,11 +70,11 @@ export function useCollectionEditorPlugin<EC extends PersistedCollection = Persi
|
|
|
70
70
|
configPermissions,
|
|
71
71
|
reservedGroups,
|
|
72
72
|
extraView,
|
|
73
|
-
getPathSuggestions,
|
|
74
73
|
getUser,
|
|
75
74
|
collectionInference,
|
|
76
75
|
getData,
|
|
77
76
|
onAnalyticsEvent,
|
|
77
|
+
includeIntroView = true
|
|
78
78
|
}: CollectionConfigControllerProps<EC, USER>): FireCMSPlugin<any, any, PersistedCollection> {
|
|
79
79
|
|
|
80
80
|
return {
|
|
@@ -88,7 +88,6 @@ export function useCollectionEditorPlugin<EC extends PersistedCollection = Persi
|
|
|
88
88
|
collectionInference,
|
|
89
89
|
reservedGroups,
|
|
90
90
|
extraView,
|
|
91
|
-
getPathSuggestions,
|
|
92
91
|
getUser,
|
|
93
92
|
getData,
|
|
94
93
|
onAnalyticsEvent,
|
|
@@ -96,7 +95,7 @@ export function useCollectionEditorPlugin<EC extends PersistedCollection = Persi
|
|
|
96
95
|
},
|
|
97
96
|
homePage: {
|
|
98
97
|
additionalActions: <NewCollectionButton/>,
|
|
99
|
-
additionalChildrenStart: <IntroWidget
|
|
98
|
+
additionalChildrenStart: includeIntroView ? <IntroWidget/> : undefined,
|
|
100
99
|
// additionalChildrenEnd: <RootCollectionSuggestions introMode={introMode}/>,
|
|
101
100
|
CollectionActions: HomePageEditorCollectionAction,
|
|
102
101
|
AdditionalCards: NewCollectionCard,
|
|
@@ -110,7 +109,7 @@ export function useCollectionEditorPlugin<EC extends PersistedCollection = Persi
|
|
|
110
109
|
};
|
|
111
110
|
}
|
|
112
111
|
|
|
113
|
-
export function IntroWidget(
|
|
112
|
+
export function IntroWidget() {
|
|
114
113
|
|
|
115
114
|
const navigation = useNavigationController();
|
|
116
115
|
if (!navigation.topLevelNavigation)
|