@firecms/collection_editor 3.0.0-alpha.19 → 3.0.0-alpha.21

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.
Files changed (73) hide show
  1. package/package.json +8 -5
  2. package/src/components/MissingReferenceWidget.tsx +32 -0
  3. package/src/components/collection_editor/CollectionPropertiesEditorForm.tsx +8 -1
  4. package/src/components/collection_editor/import/CollectionEditorImportMapping.tsx +48 -10
  5. package/src/index.ts +2 -0
  6. package/src/useCollectionEditorController.tsx +1 -1
  7. package/src/utils/join_collections.ts +0 -2
  8. package/dist/ConfigControllerProvider.d.ts +0 -36
  9. package/dist/components/EditorCollectionAction.d.ts +0 -2
  10. package/dist/components/HomePageEditorCollectionAction.d.ts +0 -2
  11. package/dist/components/NewCollectionCard.d.ts +0 -2
  12. package/dist/components/RootCollectionSuggestions.d.ts +0 -1
  13. package/dist/components/collection_editor/CollectionDetailsForm.d.ts +0 -9
  14. package/dist/components/collection_editor/CollectionEditorDialog.d.ts +0 -37
  15. package/dist/components/collection_editor/CollectionEditorWelcomeView.d.ts +0 -15
  16. package/dist/components/collection_editor/CollectionPropertiesEditorForm.d.ts +0 -19
  17. package/dist/components/collection_editor/CollectionYupValidation.d.ts +0 -11
  18. package/dist/components/collection_editor/EntityCustomViewsSelectDialog.d.ts +0 -4
  19. package/dist/components/collection_editor/EnumForm.d.ts +0 -13
  20. package/dist/components/collection_editor/PropertyEditView.d.ts +0 -39
  21. package/dist/components/collection_editor/PropertyFieldPreview.d.ts +0 -15
  22. package/dist/components/collection_editor/PropertySelectItem.d.ts +0 -8
  23. package/dist/components/collection_editor/PropertyTree.d.ts +0 -30
  24. package/dist/components/collection_editor/SelectIcons.d.ts +0 -6
  25. package/dist/components/collection_editor/SubcollectionsEditTab.d.ts +0 -12
  26. package/dist/components/collection_editor/UnsavedChangesDialog.d.ts +0 -9
  27. package/dist/components/collection_editor/import/CollectionEditorImportDataPreview.d.ts +0 -7
  28. package/dist/components/collection_editor/import/CollectionEditorImportMapping.d.ts +0 -6
  29. package/dist/components/collection_editor/import/clean_import_data.d.ts +0 -7
  30. package/dist/components/collection_editor/properties/BlockPropertyField.d.ts +0 -7
  31. package/dist/components/collection_editor/properties/BooleanPropertyField.d.ts +0 -3
  32. package/dist/components/collection_editor/properties/CommonPropertyFields.d.ts +0 -10
  33. package/dist/components/collection_editor/properties/DateTimePropertyField.d.ts +0 -3
  34. package/dist/components/collection_editor/properties/EnumPropertyField.d.ts +0 -8
  35. package/dist/components/collection_editor/properties/FieldHelperView.d.ts +0 -4
  36. package/dist/components/collection_editor/properties/KeyValuePropertyField.d.ts +0 -3
  37. package/dist/components/collection_editor/properties/MapPropertyField.d.ts +0 -7
  38. package/dist/components/collection_editor/properties/NumberPropertyField.d.ts +0 -3
  39. package/dist/components/collection_editor/properties/ReferencePropertyField.d.ts +0 -13
  40. package/dist/components/collection_editor/properties/RepeatPropertyField.d.ts +0 -9
  41. package/dist/components/collection_editor/properties/StoragePropertyField.d.ts +0 -5
  42. package/dist/components/collection_editor/properties/StringPropertyField.d.ts +0 -5
  43. package/dist/components/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +0 -3
  44. package/dist/components/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +0 -5
  45. package/dist/components/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +0 -4
  46. package/dist/components/collection_editor/properties/validation/NumberPropertyValidation.d.ts +0 -3
  47. package/dist/components/collection_editor/properties/validation/StringPropertyValidation.d.ts +0 -11
  48. package/dist/components/collection_editor/properties/validation/ValidationPanel.d.ts +0 -2
  49. package/dist/components/collection_editor/templates/blog_template.d.ts +0 -10
  50. package/dist/components/collection_editor/templates/products_template.d.ts +0 -12
  51. package/dist/components/collection_editor/templates/users_template.d.ts +0 -7
  52. package/dist/components/collection_editor/util.d.ts +0 -4
  53. package/dist/components/collection_editor/utils/supported_fields.d.ts +0 -3
  54. package/dist/components/collection_editor/utils/update_property_for_widget.d.ts +0 -2
  55. package/dist/components/collection_editor/utils/useTraceUpdate.d.ts +0 -1
  56. package/dist/index.d.ts +0 -9
  57. package/dist/index.es.js +0 -6543
  58. package/dist/index.es.js.map +0 -1
  59. package/dist/index.umd.js +0 -2
  60. package/dist/index.umd.js.map +0 -1
  61. package/dist/types/collection_editor_controller.d.ts +0 -25
  62. package/dist/types/collection_inference.d.ts +0 -2
  63. package/dist/types/config_controller.d.ts +0 -24
  64. package/dist/types/config_permissions.d.ts +0 -19
  65. package/dist/types/persisted_collection.d.ts +0 -5
  66. package/dist/useCollectionEditorController.d.ts +0 -6
  67. package/dist/useCollectionEditorPlugin.d.ts +0 -44
  68. package/dist/useCollectionsConfigController.d.ts +0 -6
  69. package/dist/utils/arrays.d.ts +0 -1
  70. package/dist/utils/entities.d.ts +0 -3
  71. package/dist/utils/icons.d.ts +0 -1
  72. package/dist/utils/join_collections.d.ts +0 -14
  73. package/dist/utils/synonyms.d.ts +0 -1951
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firecms/collection_editor",
3
- "version": "3.0.0-alpha.19",
3
+ "version": "3.0.0-alpha.21",
4
4
  "main": "./dist/index.umd.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,11 +10,14 @@
10
10
  "import": "./dist/index.es.js",
11
11
  "require": "./dist/index.umd.js",
12
12
  "types": "./dist/index.d.ts"
13
- }
13
+ },
14
+ "./package.json": "./package.json"
15
+ },
16
+ "dependencies": {
17
+ "@firecms/data_import": "^3.0.0-alpha.21",
18
+ "@firecms/schema_inference": "^3.0.0-alpha.21"
14
19
  },
15
20
  "peerDependencies": {
16
- "@firecms/data_import": "^3.0.0-alpha.9",
17
- "@firecms/schema_inference": "^3.0.0-alpha.9",
18
21
  "react": "^18.2.0",
19
22
  "react-dom": "^18.2.0",
20
23
  "react-router": "^6.12.0",
@@ -72,5 +75,5 @@
72
75
  "publishConfig": {
73
76
  "access": "public"
74
77
  },
75
- "gitHead": "dfac6a681cd88ab0b926eb6fcd94a3a49a43d945"
78
+ "gitHead": "4a18047fa8fd4ddaa157ec2d415fcab89cf34d65"
76
79
  }
@@ -0,0 +1,32 @@
1
+ import { Button, ErrorView, unslugify } from "@firecms/core";
2
+ import { useCollectionEditorController } from "../useCollectionEditorController";
3
+
4
+ export function MissingReferenceWidget({ path: pathProp }: {
5
+ path: string
6
+ }) {
7
+ const path = getLastSegment(pathProp);
8
+ const parentPathSegments = getParentPathSegments(pathProp);
9
+ const collectionEditor = useCollectionEditorController();
10
+ return <div className={"p-1 flex flex-col items-center"}>
11
+ <ErrorView error={"No collection for path: " + path}/>
12
+ <Button className={"mx-2"} variant={"outlined"} size={"small"}
13
+ onClick={() => {
14
+ collectionEditor.createCollection({
15
+ initialValues: { path, name: unslugify(path) },
16
+ parentPathSegments
17
+ });
18
+ }}>
19
+ Create
20
+ </Button>
21
+ </div>;
22
+ }
23
+
24
+ function getParentPathSegments(path: string): string[] {
25
+ const segments = path.split("/");
26
+ return segments.filter((segment, index) => index % 2 === 0 && index !== segments.length - 1);
27
+ }
28
+
29
+ function getLastSegment(path: string): string {
30
+ const segments = path.split("/");
31
+ return segments[segments.length - 1];
32
+ }
@@ -10,9 +10,12 @@ import {
10
10
  DebouncedTextField,
11
11
  defaultBorderMixin,
12
12
  EntityCollection,
13
- ErrorBoundary, FieldConfig,
13
+ ErrorBoundary,
14
+ FieldConfig,
14
15
  isPropertyBuilder,
16
+ makePropertiesEditable,
15
17
  Paper,
18
+ Properties,
16
19
  Property,
17
20
  PropertyOrBuilder,
18
21
  Tooltip,
@@ -100,6 +103,10 @@ export function CollectionPropertiesEditorForm({
100
103
  // @ts-ignore
101
104
  doCollectionInference(values)
102
105
  .then((newCollection) => {
106
+
107
+ if (newCollection)
108
+ makePropertiesEditable(newCollection.properties as Properties);
109
+
103
110
  if (!newCollection) {
104
111
  snackbarController.open({
105
112
  type: "error",
@@ -28,13 +28,20 @@ import { PropertySelectItem } from "../PropertySelectItem";
28
28
  import { supportedFields } from "../utils/supported_fields";
29
29
  import { buildPropertyFromData } from "@firecms/schema_inference";
30
30
 
31
- export function CollectionEditorImportMapping({ importConfig, customFields }:
31
+ export function CollectionEditorImportMapping({
32
+ importConfig,
33
+ customFields
34
+ }:
32
35
  {
33
36
  importConfig: ImportConfig,
34
37
  customFields: Record<string, FieldConfig>
35
38
  }) {
36
39
 
37
- const { setFieldValue, setFieldTouched, values } = useFormikContext<PersistedCollection>();
40
+ const {
41
+ setFieldValue,
42
+ setFieldTouched,
43
+ values
44
+ } = useFormikContext<PersistedCollection>();
38
45
  const [selectedProperty, setSelectedProperty] = useState<PropertyWithId | undefined>(undefined);
39
46
 
40
47
  const currentPropertiesOrderRef = React.useRef<{
@@ -117,11 +124,17 @@ export function CollectionEditorImportMapping({ importConfig, customFields }:
117
124
 
118
125
  // we try to infer the rest of the properties of a property, from the type and the data
119
126
  const propertyData = importConfig.importData.map((d) => getIn(d, importKey));
120
- const inferredNewProperty = buildPropertyFromData(propertyData, property, getInferenceType);
127
+ const inferredNewProperty = {
128
+ ...buildPropertyFromData(propertyData, property, getInferenceType),
129
+ editable: true
130
+ };
121
131
 
122
132
  if (propertyPath) {
123
133
  if (inferredNewProperty) {
124
- console.log("updating inferredNewProperty", { property, inferredNewProperty })
134
+ console.log("updating inferredNewProperty", {
135
+ property,
136
+ inferredNewProperty
137
+ })
125
138
  setFieldValue(propertyPath, inferredNewProperty, false);
126
139
  } else {
127
140
  setFieldValue(propertyPath, property, false);
@@ -142,18 +155,29 @@ export function CollectionEditorImportMapping({ importConfig, customFields }:
142
155
  originProperties={importConfig.originProperties}
143
156
  destinationProperties={values.properties as Properties}
144
157
  onIdPropertyChanged={(value) => importConfig.setIdColumn(value)}
145
- buildPropertyView={({ property, propertyKey, importKey }) => {
158
+ buildPropertyView={({
159
+ property,
160
+ propertyKey,
161
+ importKey
162
+ }) => {
146
163
  return <ImportNewPropertyFieldPreview
147
164
  property={property}
148
165
  propertyKey={propertyKey}
149
166
  onPropertyNameChanged={(propertyKey: string, value: string) => setFieldValue(`properties.${propertyKey}.name`, value, false)}
150
167
  onEditClick={() => {
151
168
  if (!propertyKey || !property) return;
152
- setSelectedProperty({ ...property, id: propertyKey, editable: true });
169
+ setSelectedProperty({
170
+ ...property,
171
+ id: propertyKey,
172
+ editable: true
173
+ });
153
174
  }}
154
175
  propertyTypeView={<PropertySelect property={property}
155
176
  disabled={false}
156
- onPropertyChanged={(props) => onPropertyTypeChanged({ ...props, importKey })}
177
+ onPropertyChanged={(props) => onPropertyTypeChanged({
178
+ ...props,
179
+ importKey
180
+ })}
157
181
  propertyKey={propertyKey}
158
182
  customFields={customFields}/>}
159
183
  />;
@@ -184,10 +208,21 @@ export function CollectionEditorImportMapping({ importConfig, customFields }:
184
208
 
185
209
  }
186
210
 
187
- function PropertySelect({ property, onPropertyChanged, propertyKey, customFields, disabled }: {
211
+ function PropertySelect({
212
+ property,
213
+ onPropertyChanged,
214
+ propertyKey,
215
+ customFields,
216
+ disabled
217
+ }: {
188
218
  property: Property | null,
189
219
  propertyKey: string | null,
190
- onPropertyChanged: ({ id, property, previousId, namespace }: OnPropertyChangedParams) => void,
220
+ onPropertyChanged: ({
221
+ id,
222
+ property,
223
+ previousId,
224
+ namespace
225
+ }: OnPropertyChangedParams) => void,
191
226
  customFields: Record<string, FieldConfig>,
192
227
  disabled?: boolean
193
228
  }) {
@@ -218,7 +253,10 @@ function PropertySelect({ property, onPropertyChanged, propertyKey, customFields
218
253
  const newProperty = updatePropertyFromWidget(property, newSelectedWidgetId, customFields)
219
254
  if (!propertyKey) return;
220
255
  onPropertyChanged({
221
- id: propertyKey, property: newProperty, previousId: propertyKey, namespace: undefined
256
+ id: propertyKey,
257
+ property: newProperty,
258
+ previousId: propertyKey,
259
+ namespace: undefined
222
260
  });
223
261
  console.log("newSelectedWidgetId", newSelectedWidgetId);
224
262
  }}>
package/src/index.ts CHANGED
@@ -29,3 +29,5 @@ export type {
29
29
  export type {
30
30
  CollectionInference
31
31
  } from "./types/collection_inference";
32
+
33
+ export { MissingReferenceWidget } from "./components/MissingReferenceWidget";
@@ -1,4 +1,4 @@
1
- import React, { useContext } from "react";
1
+ import { useContext } from "react";
2
2
  import { CollectionEditorController } from "./types/collection_editor_controller";
3
3
  import { CollectionEditorContext } from "./ConfigControllerProvider";
4
4
 
@@ -45,8 +45,6 @@ export function joinCollectionLists(storedCollections: PersistedCollection[], co
45
45
  const resultStoredCollections = resolvedFetchedCollections
46
46
  .filter((col) => !updatedCollections.map(c => c.path).includes(col.path) || !updatedCollections.map(c => c.alias).includes(col.alias));
47
47
 
48
- console.log("Updated collections", { updatedCollections, resultStoredCollections });
49
-
50
48
  return [...updatedCollections, ...resultStoredCollections];
51
49
  }
52
50
 
@@ -1,36 +0,0 @@
1
- import React from "react";
2
- import { CollectionsConfigController } from "./types/config_controller";
3
- import { User } from "@firecms/core";
4
- import { CollectionEditorController } from "./types/collection_editor_controller";
5
- import { CollectionEditorPermissionsBuilder } from "./types/config_permissions";
6
- import { CollectionInference } from "./types/collection_inference";
7
- export declare const ConfigControllerContext: React.Context<CollectionsConfigController>;
8
- export declare const CollectionEditorContext: React.Context<CollectionEditorController>;
9
- export interface ConfigControllerProviderProps {
10
- /**
11
- * Controller for managing the collections' config.
12
- */
13
- collectionConfigController: CollectionsConfigController;
14
- /**
15
- * Callback used to infer the schema from the data.
16
- */
17
- collectionInference?: CollectionInference;
18
- /**
19
- * Use this builder to define the permissions for the configuration per user.
20
- */
21
- configPermissions?: CollectionEditorPermissionsBuilder;
22
- /**
23
- * Groups that cannot be used to create new collections.
24
- */
25
- reservedGroups?: string[];
26
- extraView?: {
27
- View: React.ComponentType<{
28
- path: string;
29
- }>;
30
- icon: React.ReactNode;
31
- };
32
- pathSuggestions?: (path?: string) => Promise<string[]>;
33
- getUser: (uid: string) => User | null;
34
- getData?: (path: string) => Promise<object[]>;
35
- }
36
- export declare const ConfigControllerProvider: React.NamedExoticComponent<React.PropsWithChildren<ConfigControllerProviderProps>>;
@@ -1,2 +0,0 @@
1
- import { CollectionActionsProps } from "@firecms/core";
2
- export declare function EditorCollectionAction({ path: fullPath, parentPathSegments, collection, tableController }: CollectionActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- import { PluginHomePageActionsProps } from "@firecms/core";
2
- export declare function HomePageEditorCollectionAction({ path, collection }: PluginHomePageActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- import { PluginHomePageAdditionalCardsProps } from "@firecms/core";
2
- export declare function NewCollectionCard({ group, context }: PluginHomePageAdditionalCardsProps): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export declare function RootCollectionSuggestions(): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +0,0 @@
1
- import { EntityCollection } from "@firecms/core";
2
- export declare function CollectionDetailsForm({ isNewCollection, reservedGroups, existingPaths, existingAliases, groups, parentCollection }: {
3
- isNewCollection: boolean;
4
- reservedGroups?: string[];
5
- existingPaths?: string[];
6
- existingAliases?: string[];
7
- groups: string[] | null;
8
- parentCollection?: EntityCollection;
9
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,37 +0,0 @@
1
- import * as React from "react";
2
- import { CMSType, EntityCollection, User } from "@firecms/core";
3
- import { CollectionsConfigController } from "../../types/config_controller";
4
- import { CollectionInference } from "../../types/collection_inference";
5
- export interface CollectionEditorDialogProps {
6
- open: boolean;
7
- isNewCollection: boolean;
8
- initialValues?: {
9
- group?: string;
10
- path?: string;
11
- name?: string;
12
- };
13
- editedCollectionPath?: string;
14
- fullPath?: string;
15
- parentPathSegments?: string[];
16
- handleClose: (collection?: EntityCollection) => void;
17
- configController: CollectionsConfigController;
18
- reservedGroups?: string[];
19
- collectionInference?: CollectionInference;
20
- extraView?: {
21
- View: React.ComponentType<{
22
- path: string;
23
- }>;
24
- icon: React.ReactNode;
25
- };
26
- pathSuggestions?: (path?: string) => Promise<string[]>;
27
- getUser: (uid: string) => User | null;
28
- getData?: (path: string) => Promise<object[]>;
29
- parentCollection?: EntityCollection;
30
- }
31
- export declare function CollectionEditorDialog(props: CollectionEditorDialogProps): import("react/jsx-runtime").JSX.Element;
32
- export declare function CollectionEditorDialogInternal<M extends {
33
- [Key: string]: CMSType;
34
- }>({ isNewCollection, initialValues: initialValuesProp, configController, editedCollectionPath, parentPathSegments, fullPath, collectionInference, handleClose, reservedGroups, extraView, handleCancel, setFormDirty, pathSuggestions, getUser, parentCollection, getData }: CollectionEditorDialogProps & {
35
- handleCancel: () => void;
36
- setFormDirty: (dirty: boolean) => void;
37
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,15 +0,0 @@
1
- import React from "react";
2
- import { EntityCollection } from "@firecms/core";
3
- export declare function CollectionEditorWelcomeView({ path, pathSuggestions, parentCollection, onContinue, collections }: {
4
- path: string;
5
- pathSuggestions?: (path: string) => Promise<string[]>;
6
- parentCollection?: EntityCollection;
7
- onContinue: (importData?: object[]) => void;
8
- collections?: EntityCollection[];
9
- }): import("react/jsx-runtime").JSX.Element;
10
- export declare function TemplateButton({ title, subtitle, icon, onClick }: {
11
- title: string;
12
- icon: React.ReactNode;
13
- subtitle: string;
14
- onClick?: () => void;
15
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,19 +0,0 @@
1
- import React from "react";
2
- import { FormikErrors } from "formik";
3
- import { EntityCollection, FieldConfig, User } from "@firecms/core";
4
- import { PersistedCollection } from "../../types/persisted_collection";
5
- type CollectionEditorFormProps = {
6
- showErrors: boolean;
7
- isNewCollection: boolean;
8
- propertyErrorsRef?: React.MutableRefObject<any>;
9
- onPropertyError: (propertyKey: string, namespace: string | undefined, error?: FormikErrors<any>) => void;
10
- setDirty?: (dirty: boolean) => void;
11
- reservedGroups?: string[];
12
- extraIcon: React.ReactNode;
13
- getUser: (uid: string) => User | null;
14
- getData?: () => Promise<object[]>;
15
- doCollectionInference: (collection: PersistedCollection<any, string>) => Promise<EntityCollection | null> | undefined;
16
- customFields: Record<string, FieldConfig>;
17
- };
18
- export declare function CollectionPropertiesEditorForm({ showErrors, isNewCollection, propertyErrorsRef, onPropertyError, setDirty, reservedGroups, extraIcon, getUser, getData, doCollectionInference, customFields }: CollectionEditorFormProps): import("react/jsx-runtime").JSX.Element;
19
- export {};
@@ -1,11 +0,0 @@
1
- import * as Yup from "yup";
2
- export declare const YupSchema: Yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
- name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
- path: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
5
- }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
6
- name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
7
- path: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
- }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
9
- name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
10
- path: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
11
- }>>>;
@@ -1,4 +0,0 @@
1
- export declare function EntityCustomViewsSelectDialog({ open, onClose }: {
2
- open: boolean;
3
- onClose: (selectedViewKey?: string) => void;
4
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- import { EnumValueConfig } from "@firecms/core";
3
- type EnumFormProps = {
4
- enumValues: EnumValueConfig[];
5
- onValuesChanged?: (enumValues: EnumValueConfig[]) => void;
6
- onError?: (error: boolean) => void;
7
- updateIds: boolean;
8
- disabled: boolean;
9
- allowDataInference?: boolean;
10
- getData?: () => Promise<string[]>;
11
- };
12
- export declare const EnumForm: React.NamedExoticComponent<EnumFormProps>;
13
- export {};
@@ -1,39 +0,0 @@
1
- import React from "react";
2
- import { FormikErrors, FormikProps } from "formik";
3
- import { FieldConfig, Property } from "@firecms/core";
4
- export type PropertyWithId = Property & {
5
- id?: string;
6
- };
7
- export type OnPropertyChangedParams = {
8
- id?: string;
9
- property: Property;
10
- namespace?: string;
11
- previousId?: string;
12
- };
13
- export type PropertyFormProps = {
14
- includeIdAndName?: boolean;
15
- existing: boolean;
16
- autoUpdateId?: boolean;
17
- autoOpenTypeSelect: boolean;
18
- inArray: boolean;
19
- propertyKey?: string;
20
- propertyNamespace?: string;
21
- property?: Property;
22
- onPropertyChanged?: (params: OnPropertyChangedParams) => void;
23
- onPropertyChangedImmediate?: boolean;
24
- onDelete?: (id?: string, namespace?: string) => void;
25
- onError?: (id: string, namespace?: string, error?: FormikErrors<any>) => void;
26
- initialErrors?: FormikErrors<any>;
27
- forceShowErrors?: boolean;
28
- existingPropertyKeys?: string[];
29
- allowDataInference: boolean;
30
- getData?: () => Promise<object[]>;
31
- getHelpers?: (formikProps: FormikProps<PropertyWithId>) => void;
32
- customFields: Record<string, FieldConfig>;
33
- };
34
- export declare const PropertyForm: React.NamedExoticComponent<PropertyFormProps>;
35
- export declare function PropertyFormDialog({ open, onCancel, onOkClicked, onPropertyChanged, getData, ...formProps }: PropertyFormProps & {
36
- open?: boolean;
37
- onOkClicked?: () => void;
38
- onCancel?: () => void;
39
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,15 +0,0 @@
1
- import { Property, PropertyOrBuilder } from "@firecms/core";
2
- export declare function PropertyFieldPreview({ property, onClick, hasError, includeName, includeEditButton, selected }: {
3
- property: Property;
4
- hasError?: boolean;
5
- selected?: boolean;
6
- includeName?: boolean;
7
- includeEditButton?: boolean;
8
- onClick?: () => void;
9
- }): import("react/jsx-runtime").JSX.Element;
10
- export declare function NonEditablePropertyPreview({ name, selected, onClick, property }: {
11
- name: string;
12
- selected: boolean;
13
- onClick?: () => void;
14
- property?: PropertyOrBuilder;
15
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +0,0 @@
1
- import { FieldConfig } from "@firecms/core";
2
- export interface PropertySelectItemProps {
3
- value: string;
4
- optionDisabled: boolean;
5
- fieldConfig: FieldConfig;
6
- existing: boolean;
7
- }
8
- export declare function PropertySelectItem({ value, optionDisabled, fieldConfig, existing }: PropertySelectItemProps): import("react/jsx-runtime").JSX.Element;
@@ -1,30 +0,0 @@
1
- import { AdditionalFieldDelegate, CMSType, PropertiesOrBuilders, PropertyOrBuilder } from "@firecms/core";
2
- import { DraggableProvided } from "@hello-pangea/dnd";
3
- export declare function PropertyTree<M extends {
4
- [Key: string]: CMSType;
5
- }>({ namespace, selectedPropertyKey, onPropertyClick, properties, propertiesOrder: propertiesOrderProp, additionalFields, errors, onPropertyMove, onPropertyRemove, className, inferredPropertyKeys }: {
6
- namespace?: string;
7
- selectedPropertyKey?: string;
8
- onPropertyClick?: (propertyKey: string, namespace?: string) => void;
9
- properties: PropertiesOrBuilders<M>;
10
- propertiesOrder?: string[];
11
- additionalFields?: AdditionalFieldDelegate<M>[];
12
- errors: Record<string, any>;
13
- onPropertyMove?: (propertiesOrder: string[], namespace?: string) => void;
14
- onPropertyRemove?: (propertyKey: string, namespace?: string) => void;
15
- className?: string;
16
- inferredPropertyKeys?: string[];
17
- }): import("react/jsx-runtime").JSX.Element;
18
- export declare function PropertyTreeEntry({ propertyKey, namespace, propertyOrBuilder, additionalField, provided, selectedPropertyKey, errors, onPropertyClick, onPropertyMove, onPropertyRemove, inferredPropertyKeys }: {
19
- propertyKey: string;
20
- namespace?: string;
21
- propertyOrBuilder: PropertyOrBuilder;
22
- additionalField?: AdditionalFieldDelegate<any>;
23
- selectedPropertyKey?: string;
24
- provided: DraggableProvided;
25
- errors: Record<string, any>;
26
- onPropertyClick?: (propertyKey: string, namespace?: string) => void;
27
- onPropertyMove?: (propertiesOrder: string[], namespace?: string) => void;
28
- onPropertyRemove?: (propertyKey: string, namespace?: string) => void;
29
- inferredPropertyKeys?: string[];
30
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- interface SearchIconsProps {
2
- selectedIcon?: string;
3
- onIconSelected: (icon: string) => void;
4
- }
5
- export declare function SearchIcons({ selectedIcon, onIconSelected }: SearchIconsProps): import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,12 +0,0 @@
1
- import { EntityCollection, User } from "@firecms/core";
2
- import { CollectionsConfigController } from "../../types/config_controller";
3
- import { PersistedCollection } from "../../types/persisted_collection";
4
- import { CollectionInference } from "../../types/collection_inference";
5
- export declare function SubcollectionsEditTab({ collection, parentCollection, configController, collectionInference, getUser, parentPathSegments }: {
6
- collection: PersistedCollection;
7
- parentCollection?: EntityCollection;
8
- configController: CollectionsConfigController;
9
- collectionInference?: CollectionInference;
10
- getUser: (uid: string) => User | null;
11
- parentPathSegments?: string[];
12
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +0,0 @@
1
- import React from "react";
2
- export interface UnsavedChangesDialogProps {
3
- open: boolean;
4
- body?: React.ReactNode;
5
- title?: string;
6
- handleOk: () => void;
7
- handleCancel: () => void;
8
- }
9
- export declare function UnsavedChangesDialog({ open, handleOk, handleCancel, body, title }: UnsavedChangesDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- import { ImportConfig } from "@firecms/data_import";
2
- import { Properties } from "@firecms/core";
3
- export declare function CollectionEditorImportDataPreview({ importConfig, properties, propertiesOrder }: {
4
- importConfig: ImportConfig;
5
- properties: Properties;
6
- propertiesOrder: string[];
7
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- import { ImportConfig } from "@firecms/data_import";
2
- import { FieldConfig } from "@firecms/core";
3
- export declare function CollectionEditorImportMapping({ importConfig, customFields }: {
4
- importConfig: ImportConfig;
5
- customFields: Record<string, FieldConfig>;
6
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- import { Properties } from "@firecms/core";
2
- import { ImportConfig } from "@firecms/data_import";
3
- export declare function cleanPropertiesFromImport(properties: Properties, parentSlug?: string): {
4
- headersMapping: ImportConfig["headersMapping"];
5
- properties: Properties;
6
- idColumn?: ImportConfig["idColumn"];
7
- };
@@ -1,7 +0,0 @@
1
- import { FieldConfig } from "@firecms/core";
2
- export declare function BlockPropertyField({ disabled, getData, allowDataInference, customFields }: {
3
- disabled: boolean;
4
- getData?: () => Promise<object[]>;
5
- allowDataInference: boolean;
6
- customFields: Record<string, FieldConfig>;
7
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- export declare function BooleanPropertyField({ disabled }: {
2
- disabled: boolean;
3
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- type CommonPropertyFieldsProps = {
3
- showErrors: boolean;
4
- disabledId: boolean;
5
- existingPropertyKeys?: string[];
6
- disabled: boolean;
7
- isNewProperty: boolean;
8
- };
9
- export declare const CommonPropertyFields: React.ForwardRefExoticComponent<CommonPropertyFieldsProps & React.RefAttributes<HTMLDivElement>>;
10
- export {};
@@ -1,3 +0,0 @@
1
- export declare function DateTimePropertyField({ disabled }: {
2
- disabled: boolean;
3
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +0,0 @@
1
- export declare function EnumPropertyField({ multiselect, updateIds, disabled, showErrors, allowDataInference, getData }: {
2
- multiselect: boolean;
3
- updateIds: boolean;
4
- disabled: boolean;
5
- showErrors: boolean;
6
- allowDataInference?: boolean;
7
- getData?: () => Promise<object[]>;
8
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +0,0 @@
1
- export declare function FieldHelperView({ error, children }: {
2
- error?: boolean;
3
- children?: React.ReactNode;
4
- }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,3 +0,0 @@
1
- export declare function KeyValuePropertyField({ disabled }: {
2
- disabled: boolean;
3
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- import { FieldConfig } from "@firecms/core";
2
- export declare function MapPropertyField({ disabled, getData, allowDataInference, customFields }: {
3
- disabled: boolean;
4
- getData?: () => Promise<object[]>;
5
- allowDataInference: boolean;
6
- customFields: Record<string, FieldConfig>;
7
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- export declare function NumberPropertyField({ disabled }: {
2
- disabled: boolean;
3
- }): import("react/jsx-runtime").JSX.Element;