@firecms/collection_editor 3.0.0-canary.183 → 3.0.0-canary.186

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.
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { CollectionEditorPermissionsBuilder } from "./config_permissions";
3
2
  import { Entity, Property } from "@firecms/core";
4
3
  import { PersistedCollection } from "./persisted_collection";
@@ -36,13 +35,4 @@ export interface CollectionEditorController {
36
35
  }) => void;
37
36
  configPermissions: CollectionEditorPermissionsBuilder;
38
37
  getPathSuggestions?: (path: string) => Promise<string[]>;
39
- components?: {
40
- /**
41
- * Custom component to render the database field
42
- */
43
- DatabaseField?: React.ComponentType<{
44
- databaseId?: string;
45
- onDatabaseIdUpdate: (databaseId: string) => void;
46
- }>;
47
- };
48
38
  }
@@ -30,15 +30,6 @@ export interface CollectionConfigControllerProps<EC extends PersistedCollection
30
30
  getData?: (path: string, parentPaths: string[]) => Promise<object[]>;
31
31
  getUser?: (uid: string) => USER | null;
32
32
  onAnalyticsEvent?: (event: string, params?: object) => void;
33
- components?: {
34
- /**
35
- * Custom component to render the database field
36
- */
37
- DatabaseField?: React.ComponentType<{
38
- databaseId?: string;
39
- onDatabaseIdUpdate: (databaseId: string) => void;
40
- }>;
41
- };
42
33
  }
43
34
  /**
44
35
  * Use this hook to initialise the Collection Editor plugin.
@@ -51,5 +42,5 @@ export interface CollectionConfigControllerProps<EC extends PersistedCollection
51
42
  * @param getUser
52
43
  * @param collectionInference
53
44
  */
54
- export declare function useCollectionEditorPlugin<EC extends PersistedCollection = PersistedCollection, USER extends User = User>({ collectionConfigController, configPermissions, reservedGroups, extraView, getPathSuggestions, getUser, collectionInference, getData, onAnalyticsEvent, components }: CollectionConfigControllerProps<EC, USER>): FireCMSPlugin<any, any, PersistedCollection>;
45
+ export declare function useCollectionEditorPlugin<EC extends PersistedCollection = PersistedCollection, USER extends User = User>({ collectionConfigController, configPermissions, reservedGroups, extraView, getPathSuggestions, getUser, collectionInference, getData, onAnalyticsEvent, }: CollectionConfigControllerProps<EC, USER>): FireCMSPlugin<any, any, PersistedCollection>;
55
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.183",
4
+ "version": "3.0.0-canary.186",
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.183",
11
- "@firecms/data_import": "^3.0.0-canary.183",
12
- "@firecms/data_import_export": "^3.0.0-canary.183",
13
- "@firecms/formex": "^3.0.0-canary.183",
14
- "@firecms/schema_inference": "^3.0.0-canary.183",
15
- "@firecms/ui": "^3.0.0-canary.183",
10
+ "@firecms/data_export": "^3.0.0-canary.186",
11
+ "@firecms/data_import": "^3.0.0-canary.186",
12
+ "@firecms/data_import_export": "^3.0.0-canary.186",
13
+ "@firecms/formex": "^3.0.0-canary.186",
14
+ "@firecms/schema_inference": "^3.0.0-canary.186",
15
+ "@firecms/ui": "^3.0.0-canary.186",
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": "6f579e56efa2e2e93683e74f42aad1ca6702ac40"
73
+ "gitHead": "968beff28cddecbacc6740dc5e75288bf423746e"
74
74
  }
@@ -57,13 +57,6 @@ export interface ConfigControllerProviderProps {
57
57
 
58
58
  onAnalyticsEvent?: (event: string, params?: object) => void;
59
59
 
60
- components?: {
61
- /**
62
- * Custom component to render the database field
63
- */
64
- DatabaseField?: React.ComponentType<{ databaseId?: string, onDatabaseIdUpdate: (databaseId:string) => void }>;
65
- };
66
-
67
60
  }
68
61
 
69
62
  export const ConfigControllerProvider = React.memo(
@@ -78,7 +71,6 @@ export const ConfigControllerProvider = React.memo(
78
71
  getUser,
79
72
  getData,
80
73
  onAnalyticsEvent,
81
- components
82
74
  }: PropsWithChildren<ConfigControllerProviderProps>) {
83
75
 
84
76
  const navigation = useNavigationController();
@@ -239,7 +231,6 @@ export const ConfigControllerProvider = React.memo(
239
231
  editProperty,
240
232
  configPermissions: configPermissions ?? defaultConfigPermissions,
241
233
  getPathSuggestions,
242
- components
243
234
  }}>
244
235
 
245
236
  {children}
@@ -43,11 +43,4 @@ export interface CollectionEditorController {
43
43
 
44
44
  getPathSuggestions?: (path: string) => Promise<string[]>;
45
45
 
46
- components?: {
47
- /**
48
- * Custom component to render the database field
49
- */
50
- DatabaseField?: React.ComponentType<{ databaseId?: string, onDatabaseIdUpdate: (databaseId: string) => void }>;
51
- };
52
-
53
46
  }
@@ -91,8 +91,6 @@ export function CollectionDetailsForm({
91
91
  }
92
92
  }, [errors.id]);
93
93
 
94
- const DatabaseField = collectionEditor.components?.DatabaseField ?? DefaultDatabaseField;
95
-
96
94
  const collectionIcon = <IconForView collectionOrView={values}/>;
97
95
 
98
96
  const groupOptions = groups?.filter((group) => !reservedGroups?.includes(group));
@@ -129,8 +127,8 @@ export function CollectionDetailsForm({
129
127
  <Typography variant={!isNewCollection ? "h5" : "h4"} className={"flex-grow"}>
130
128
  {isNewCollection ? "New collection" : `${values?.name} collection`}
131
129
  </Typography>
132
- <DatabaseField databaseId={values.databaseId}
133
- onDatabaseIdUpdate={updateDatabaseId}/>
130
+ <DefaultDatabaseField databaseId={values.databaseId}
131
+ onDatabaseIdUpdate={updateDatabaseId}/>
134
132
 
135
133
  <Tooltip title={"Change icon"}
136
134
  asChild={true}>
@@ -51,13 +51,6 @@ export interface CollectionConfigControllerProps<EC extends PersistedCollection
51
51
 
52
52
  onAnalyticsEvent?: (event: string, params?: object) => void;
53
53
 
54
- components?: {
55
- /**
56
- * Custom component to render the database field
57
- */
58
- DatabaseField?: React.ComponentType<{ databaseId?: string, onDatabaseIdUpdate: (databaseId:string) => void }>;
59
- };
60
-
61
54
  }
62
55
 
63
56
  /**
@@ -82,7 +75,6 @@ export function useCollectionEditorPlugin<EC extends PersistedCollection = Persi
82
75
  collectionInference,
83
76
  getData,
84
77
  onAnalyticsEvent,
85
- components
86
78
  }: CollectionConfigControllerProps<EC, USER>): FireCMSPlugin<any, any, PersistedCollection> {
87
79
 
88
80
  return {
@@ -100,7 +92,6 @@ export function useCollectionEditorPlugin<EC extends PersistedCollection = Persi
100
92
  getUser,
101
93
  getData,
102
94
  onAnalyticsEvent,
103
- components
104
95
  }
105
96
  },
106
97
  homePage: {