@firecms/collection_editor 3.0.0-alpha.51 → 3.0.0-alpha.52
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 +1 -0
- package/dist/index.es.js +982 -978
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/useCollectionEditorPlugin.d.ts +2 -1
- package/package.json +4 -4
- package/src/ConfigControllerProvider.tsx +10 -1
- package/src/useCollectionEditorPlugin.tsx +7 -4
|
@@ -30,6 +30,7 @@ export interface CollectionConfigControllerProps<EC extends PersistedCollection
|
|
|
30
30
|
collectionInference?: CollectionInference;
|
|
31
31
|
getData?: (path: string) => Promise<object[]>;
|
|
32
32
|
getUser: (uid: string) => UserType | null;
|
|
33
|
+
onAnalyticsEvent?: (event: string, params?: object) => void;
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
35
36
|
* Use this hook to initialise the Collection Editor plugin.
|
|
@@ -42,4 +43,4 @@ export interface CollectionConfigControllerProps<EC extends PersistedCollection
|
|
|
42
43
|
* @param getUser
|
|
43
44
|
* @param collectionInference
|
|
44
45
|
*/
|
|
45
|
-
export declare function useCollectionEditorPlugin<EC extends PersistedCollection = PersistedCollection, UserType extends User = User>({ collectionConfigController, modifyCollection, configPermissions, reservedGroups, extraView, pathSuggestions, getUser, collectionInference, getData }: CollectionConfigControllerProps<EC, UserType>): FireCMSPlugin<any, any, PersistedCollection>;
|
|
46
|
+
export declare function useCollectionEditorPlugin<EC extends PersistedCollection = PersistedCollection, UserType extends User = User>({ collectionConfigController, modifyCollection, configPermissions, reservedGroups, extraView, pathSuggestions, getUser, collectionInference, getData, onAnalyticsEvent }: CollectionConfigControllerProps<EC, UserType>): FireCMSPlugin<any, any, PersistedCollection>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firecms/collection_editor",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.52",
|
|
4
4
|
"main": "./dist/index.umd.js",
|
|
5
5
|
"module": "./dist/index.es.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"./package.json": "./package.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@firecms/data_import_export": "^3.0.0-alpha.
|
|
18
|
-
"@firecms/schema_inference": "^3.0.0-alpha.
|
|
17
|
+
"@firecms/data_import_export": "^3.0.0-alpha.52",
|
|
18
|
+
"@firecms/schema_inference": "^3.0.0-alpha.52",
|
|
19
19
|
"json5": "^2.2.3",
|
|
20
20
|
"prism-react-renderer": "^2.3.0"
|
|
21
21
|
},
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "347fb05aab3d2c4399ba9370f10c6d142c4721f6"
|
|
82
82
|
}
|
|
@@ -48,6 +48,8 @@ export interface ConfigControllerProviderProps {
|
|
|
48
48
|
|
|
49
49
|
getData?: (path: string) => Promise<object[]>;
|
|
50
50
|
|
|
51
|
+
onAnalyticsEvent?: (event: string, params?: object) => void;
|
|
52
|
+
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
export const ConfigControllerProvider = React.memo(
|
|
@@ -60,7 +62,8 @@ export const ConfigControllerProvider = React.memo(
|
|
|
60
62
|
extraView,
|
|
61
63
|
pathSuggestions,
|
|
62
64
|
getUser,
|
|
63
|
-
getData
|
|
65
|
+
getData,
|
|
66
|
+
onAnalyticsEvent
|
|
64
67
|
}: PropsWithChildren<ConfigControllerProviderProps>) {
|
|
65
68
|
|
|
66
69
|
const navigation = useNavigationController();
|
|
@@ -125,6 +128,8 @@ export const ConfigControllerProvider = React.memo(
|
|
|
125
128
|
parentCollectionIds: string[],
|
|
126
129
|
parentCollection?: PersistedCollection
|
|
127
130
|
}) => {
|
|
131
|
+
console.debug("edit collection", path, fullPath, parentCollectionIds, parentCollection);
|
|
132
|
+
onAnalyticsEvent?.("edit_collection", { path, fullPath });
|
|
128
133
|
setCurrentDialog({
|
|
129
134
|
editedCollectionPath: path,
|
|
130
135
|
fullPath,
|
|
@@ -150,6 +155,8 @@ export const ConfigControllerProvider = React.memo(
|
|
|
150
155
|
parentCollectionIds: string[],
|
|
151
156
|
collection: PersistedCollection,
|
|
152
157
|
}) => {
|
|
158
|
+
console.debug("edit property", propertyKey, property, editedCollectionPath, currentPropertiesOrder, parentCollectionIds, collection);
|
|
159
|
+
onAnalyticsEvent?.("edit_property", { propertyKey, editedCollectionPath });
|
|
153
160
|
// namespace is all the path until the last dot
|
|
154
161
|
const namespace = propertyKey && propertyKey.includes(".")
|
|
155
162
|
? propertyKey.substring(0, propertyKey.lastIndexOf("."))
|
|
@@ -184,6 +191,8 @@ export const ConfigControllerProvider = React.memo(
|
|
|
184
191
|
},
|
|
185
192
|
redirect: boolean
|
|
186
193
|
}) => {
|
|
194
|
+
console.debug("create collection", parentCollectionIds, parentCollection, initialValues, redirect);
|
|
195
|
+
onAnalyticsEvent?.("create_collection", { parentCollectionIds, parentCollection, initialValues, redirect });
|
|
187
196
|
setCurrentDialog({
|
|
188
197
|
isNewCollection: true,
|
|
189
198
|
parentCollectionIds,
|
|
@@ -56,8 +56,9 @@ export interface CollectionConfigControllerProps<EC extends PersistedCollection
|
|
|
56
56
|
|
|
57
57
|
getUser: (uid: string) => UserType | null;
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
onAnalyticsEvent?: (event: string, params?: object) => void;
|
|
60
60
|
|
|
61
|
+
}
|
|
61
62
|
|
|
62
63
|
/**
|
|
63
64
|
* Use this hook to initialise the Collection Editor plugin.
|
|
@@ -73,14 +74,15 @@ export interface CollectionConfigControllerProps<EC extends PersistedCollection
|
|
|
73
74
|
export function useCollectionEditorPlugin<EC extends PersistedCollection = PersistedCollection, UserType extends User = User>
|
|
74
75
|
({
|
|
75
76
|
collectionConfigController,
|
|
76
|
-
|
|
77
|
+
modifyCollection,
|
|
77
78
|
configPermissions,
|
|
78
79
|
reservedGroups,
|
|
79
80
|
extraView,
|
|
80
81
|
pathSuggestions,
|
|
81
82
|
getUser,
|
|
82
83
|
collectionInference,
|
|
83
|
-
getData
|
|
84
|
+
getData,
|
|
85
|
+
onAnalyticsEvent
|
|
84
86
|
}: CollectionConfigControllerProps<EC, UserType>): FireCMSPlugin<any, any, PersistedCollection> {
|
|
85
87
|
|
|
86
88
|
const injectCollections = useCallback(
|
|
@@ -112,7 +114,8 @@ export function useCollectionEditorPlugin<EC extends PersistedCollection = Persi
|
|
|
112
114
|
extraView,
|
|
113
115
|
pathSuggestions,
|
|
114
116
|
getUser,
|
|
115
|
-
getData
|
|
117
|
+
getData,
|
|
118
|
+
onAnalyticsEvent
|
|
116
119
|
}
|
|
117
120
|
},
|
|
118
121
|
homePage: {
|