@firecms/collection_editor 3.0.0-alpha.9 → 3.0.0-beta.10

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 (149) hide show
  1. package/LICENSE +114 -21
  2. package/dist/ConfigControllerProvider.d.ts +13 -3
  3. package/dist/index.d.ts +4 -2
  4. package/dist/index.es.js +5587 -4976
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/index.umd.js +6829 -1
  7. package/dist/index.umd.js.map +1 -1
  8. package/dist/types/collection_editor_controller.d.ts +36 -8
  9. package/dist/types/collection_inference.d.ts +1 -1
  10. package/dist/types/config_controller.d.ts +33 -6
  11. package/dist/types/persisted_collection.d.ts +4 -2
  12. package/dist/ui/CollectionViewHeaderAction.d.ts +11 -0
  13. package/dist/{components → ui}/EditorCollectionAction.d.ts +1 -1
  14. package/dist/ui/EditorCollectionActionStart.d.ts +2 -0
  15. package/dist/ui/MissingReferenceWidget.d.ts +3 -0
  16. package/dist/ui/NewCollectionButton.d.ts +1 -0
  17. package/dist/ui/PropertyAddColumnComponent.d.ts +8 -0
  18. package/dist/{components → ui}/collection_editor/CollectionDetailsForm.d.ts +3 -2
  19. package/dist/{components → ui}/collection_editor/CollectionEditorDialog.d.ts +15 -11
  20. package/dist/{components → ui}/collection_editor/CollectionEditorWelcomeView.d.ts +3 -3
  21. package/dist/{components → ui}/collection_editor/CollectionPropertiesEditorForm.d.ts +8 -6
  22. package/dist/{components → ui}/collection_editor/CollectionYupValidation.d.ts +3 -0
  23. package/dist/ui/collection_editor/EntityCustomViewsSelectDialog.d.ts +4 -0
  24. package/dist/{components → ui}/collection_editor/EnumForm.d.ts +1 -2
  25. package/dist/ui/collection_editor/GetCodeDialog.d.ts +5 -0
  26. package/dist/{components → ui}/collection_editor/PropertyEditView.d.ts +21 -11
  27. package/dist/{components → ui}/collection_editor/PropertyFieldPreview.d.ts +4 -3
  28. package/dist/{components → ui}/collection_editor/PropertyTree.d.ts +11 -7
  29. package/dist/{components → ui}/collection_editor/SubcollectionsEditTab.d.ts +3 -3
  30. package/dist/ui/collection_editor/SwitchControl.d.ts +8 -0
  31. package/dist/{components → ui}/collection_editor/import/CollectionEditorImportDataPreview.d.ts +1 -1
  32. package/dist/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +14 -0
  33. package/dist/{components → ui}/collection_editor/import/clean_import_data.d.ts +1 -1
  34. package/dist/{components → ui}/collection_editor/properties/BlockPropertyField.d.ts +4 -1
  35. package/dist/{components → ui}/collection_editor/properties/CommonPropertyFields.d.ts +1 -1
  36. package/dist/{components → ui}/collection_editor/properties/MapPropertyField.d.ts +4 -1
  37. package/dist/ui/collection_editor/properties/MarkdownPropertyField.d.ts +4 -0
  38. package/dist/{components → ui}/collection_editor/properties/RepeatPropertyField.d.ts +4 -1
  39. package/dist/{components → ui}/collection_editor/properties/StringPropertyField.d.ts +1 -1
  40. package/dist/ui/collection_editor/properties/UrlPropertyField.d.ts +4 -0
  41. package/dist/ui/collection_editor/templates/blog_template.d.ts +2 -0
  42. package/dist/ui/collection_editor/templates/pages_template.d.ts +2 -0
  43. package/dist/ui/collection_editor/templates/products_template.d.ts +2 -0
  44. package/dist/ui/collection_editor/templates/users_template.d.ts +2 -0
  45. package/dist/{components → ui}/collection_editor/util.d.ts +1 -0
  46. package/dist/ui/collection_editor/utils/strings.d.ts +1 -0
  47. package/dist/ui/collection_editor/utils/supported_fields.d.ts +3 -0
  48. package/dist/ui/collection_editor/utils/update_property_for_widget.d.ts +2 -0
  49. package/dist/useCollectionEditorPlugin.d.ts +17 -6
  50. package/dist/utils/collections.d.ts +6 -0
  51. package/dist/utils/entities.d.ts +3 -4
  52. package/package.json +35 -37
  53. package/src/ConfigControllerProvider.tsx +350 -0
  54. package/src/index.ts +36 -0
  55. package/src/types/collection_editor_controller.tsx +53 -0
  56. package/src/types/collection_inference.ts +3 -0
  57. package/src/types/config_controller.tsx +60 -0
  58. package/src/types/config_permissions.ts +20 -0
  59. package/src/types/persisted_collection.ts +9 -0
  60. package/src/ui/CollectionViewHeaderAction.tsx +48 -0
  61. package/src/ui/EditorCollectionAction.tsx +56 -0
  62. package/src/ui/EditorCollectionActionStart.tsx +88 -0
  63. package/src/ui/HomePageEditorCollectionAction.tsx +89 -0
  64. package/src/ui/MissingReferenceWidget.tsx +37 -0
  65. package/src/ui/NewCollectionButton.tsx +18 -0
  66. package/src/ui/NewCollectionCard.tsx +48 -0
  67. package/src/ui/PropertyAddColumnComponent.tsx +47 -0
  68. package/src/ui/collection_editor/CollectionDetailsForm.tsx +426 -0
  69. package/src/ui/collection_editor/CollectionEditorDialog.tsx +826 -0
  70. package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +214 -0
  71. package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +513 -0
  72. package/src/ui/collection_editor/CollectionYupValidation.tsx +7 -0
  73. package/src/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +37 -0
  74. package/src/ui/collection_editor/EnumForm.tsx +357 -0
  75. package/src/ui/collection_editor/GetCodeDialog.tsx +122 -0
  76. package/src/ui/collection_editor/PropertyEditView.tsx +789 -0
  77. package/src/ui/collection_editor/PropertyFieldPreview.tsx +204 -0
  78. package/src/ui/collection_editor/PropertyTree.tsx +254 -0
  79. package/src/ui/collection_editor/SubcollectionsEditTab.tsx +269 -0
  80. package/src/ui/collection_editor/SwitchControl.tsx +39 -0
  81. package/src/ui/collection_editor/UnsavedChangesDialog.tsx +47 -0
  82. package/src/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +53 -0
  83. package/src/ui/collection_editor/import/CollectionEditorImportMapping.tsx +299 -0
  84. package/src/ui/collection_editor/import/clean_import_data.ts +53 -0
  85. package/src/ui/collection_editor/properties/BlockPropertyField.tsx +144 -0
  86. package/src/ui/collection_editor/properties/BooleanPropertyField.tsx +40 -0
  87. package/src/ui/collection_editor/properties/CommonPropertyFields.tsx +110 -0
  88. package/src/ui/collection_editor/properties/DateTimePropertyField.tsx +89 -0
  89. package/src/ui/collection_editor/properties/EnumPropertyField.tsx +114 -0
  90. package/src/ui/collection_editor/properties/KeyValuePropertyField.tsx +20 -0
  91. package/src/ui/collection_editor/properties/MapPropertyField.tsx +150 -0
  92. package/src/ui/collection_editor/properties/MarkdownPropertyField.tsx +139 -0
  93. package/src/ui/collection_editor/properties/NumberPropertyField.tsx +38 -0
  94. package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +160 -0
  95. package/src/ui/collection_editor/properties/RepeatPropertyField.tsx +108 -0
  96. package/src/ui/collection_editor/properties/StoragePropertyField.tsx +215 -0
  97. package/src/ui/collection_editor/properties/StringPropertyField.tsx +70 -0
  98. package/src/ui/collection_editor/properties/UrlPropertyField.tsx +89 -0
  99. package/src/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +45 -0
  100. package/src/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +50 -0
  101. package/src/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +61 -0
  102. package/src/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +115 -0
  103. package/src/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +150 -0
  104. package/src/ui/collection_editor/properties/validation/ValidationPanel.tsx +28 -0
  105. package/src/ui/collection_editor/templates/blog_template.ts +115 -0
  106. package/src/ui/collection_editor/templates/pages_template.ts +183 -0
  107. package/src/ui/collection_editor/templates/products_template.ts +88 -0
  108. package/src/ui/collection_editor/templates/users_template.ts +42 -0
  109. package/src/ui/collection_editor/util.ts +28 -0
  110. package/src/ui/collection_editor/utils/strings.ts +9 -0
  111. package/src/ui/collection_editor/utils/supported_fields.tsx +29 -0
  112. package/src/ui/collection_editor/utils/update_property_for_widget.ts +271 -0
  113. package/src/ui/collection_editor/utils/useTraceUpdate.tsx +23 -0
  114. package/src/useCollectionEditorController.tsx +9 -0
  115. package/src/useCollectionEditorPlugin.tsx +164 -0
  116. package/src/useCollectionsConfigController.tsx +9 -0
  117. package/src/utils/arrays.ts +3 -0
  118. package/src/utils/collections.ts +30 -0
  119. package/src/utils/entities.ts +38 -0
  120. package/src/vite-env.d.ts +1 -0
  121. package/dist/components/collection_editor/PropertySelectItem.d.ts +0 -8
  122. package/dist/components/collection_editor/SelectIcons.d.ts +0 -6
  123. package/dist/components/collection_editor/import/CollectionEditorImportMapping.d.ts +0 -4
  124. package/dist/components/collection_editor/properties/FieldHelperView.d.ts +0 -4
  125. package/dist/components/collection_editor/templates/blog_template.d.ts +0 -10
  126. package/dist/components/collection_editor/templates/products_template.d.ts +0 -12
  127. package/dist/components/collection_editor/templates/users_template.d.ts +0 -7
  128. package/dist/components/collection_editor/utils/supported_fields.d.ts +0 -3
  129. package/dist/components/collection_editor/utils/update_property_for_widget.d.ts +0 -3
  130. package/dist/types/editable_properties.d.ts +0 -10
  131. package/dist/utils/icons.d.ts +0 -2
  132. package/dist/utils/synonyms.d.ts +0 -1951
  133. /package/dist/{components → ui}/HomePageEditorCollectionAction.d.ts +0 -0
  134. /package/dist/{components → ui}/NewCollectionCard.d.ts +0 -0
  135. /package/dist/{components → ui}/collection_editor/UnsavedChangesDialog.d.ts +0 -0
  136. /package/dist/{components → ui}/collection_editor/properties/BooleanPropertyField.d.ts +0 -0
  137. /package/dist/{components → ui}/collection_editor/properties/DateTimePropertyField.d.ts +0 -0
  138. /package/dist/{components → ui}/collection_editor/properties/EnumPropertyField.d.ts +0 -0
  139. /package/dist/{components → ui}/collection_editor/properties/KeyValuePropertyField.d.ts +0 -0
  140. /package/dist/{components → ui}/collection_editor/properties/NumberPropertyField.d.ts +0 -0
  141. /package/dist/{components → ui}/collection_editor/properties/ReferencePropertyField.d.ts +0 -0
  142. /package/dist/{components → ui}/collection_editor/properties/StoragePropertyField.d.ts +0 -0
  143. /package/dist/{components → ui}/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +0 -0
  144. /package/dist/{components → ui}/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +0 -0
  145. /package/dist/{components → ui}/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +0 -0
  146. /package/dist/{components → ui}/collection_editor/properties/validation/NumberPropertyValidation.d.ts +0 -0
  147. /package/dist/{components → ui}/collection_editor/properties/validation/StringPropertyValidation.d.ts +0 -0
  148. /package/dist/{components → ui}/collection_editor/properties/validation/ValidationPanel.d.ts +0 -0
  149. /package/dist/{components → ui}/collection_editor/utils/useTraceUpdate.d.ts +0 -0
@@ -1,20 +1,48 @@
1
+ import React from "react";
1
2
  import { CollectionEditorPermissionsBuilder } from "./config_permissions";
2
- import { EntityCollection } from "@firecms/core";
3
+ import { Entity, Property } from "@firecms/core";
4
+ import { PersistedCollection } from "./persisted_collection";
3
5
  /**
4
6
  * Controller to open the collection editor dialog.
5
- * @category Hooks and utilities
7
+ * @group Hooks and utilities
6
8
  */
7
9
  export interface CollectionEditorController {
8
10
  editCollection: (props: {
9
- path?: string;
11
+ id?: string;
10
12
  fullPath?: string;
11
- parentPathSegments: string[];
12
- parentCollection?: EntityCollection<any, any, any>;
13
+ parentCollectionIds: string[];
14
+ parentCollection?: PersistedCollection;
15
+ existingEntities?: Entity<any>[];
13
16
  }) => void;
14
17
  createCollection: (props: {
15
- group?: string;
16
- parentPathSegments: string[];
17
- parentCollection?: EntityCollection<any, any, any>;
18
+ initialValues?: {
19
+ group?: string;
20
+ path?: string;
21
+ name?: string;
22
+ };
23
+ parentCollectionIds: string[];
24
+ parentCollection?: PersistedCollection;
25
+ redirect: boolean;
26
+ sourceClick?: string;
27
+ }) => void;
28
+ editProperty: (props: {
29
+ propertyKey?: string;
30
+ property?: Property;
31
+ currentPropertiesOrder?: string[];
32
+ editedCollectionId: string;
33
+ parentCollectionIds: string[];
34
+ collection: PersistedCollection;
35
+ existingEntities: Entity<any>[];
18
36
  }) => void;
19
37
  configPermissions: CollectionEditorPermissionsBuilder;
38
+ 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
+ };
20
48
  }
@@ -1,2 +1,2 @@
1
1
  import { EntityCollection } from "@firecms/core";
2
- export type CollectionInference = (path: string, collectionGroup: boolean, parentPathSegments: string[]) => Promise<EntityCollection | null>;
2
+ export type CollectionInference = (path: string, collectionGroup: boolean, parentCollectionPaths: string[]) => Promise<Partial<EntityCollection> | null>;
@@ -1,4 +1,4 @@
1
- import { CMSType, EntityCollection } from "@firecms/core";
1
+ import { CMSType, Property } from "@firecms/core";
2
2
  import { PersistedCollection } from "./persisted_collection";
3
3
  /**
4
4
  * Use this controller to access the configuration that is stored externally,
@@ -7,18 +7,45 @@ import { PersistedCollection } from "./persisted_collection";
7
7
  export interface CollectionsConfigController {
8
8
  loading: boolean;
9
9
  collections?: PersistedCollection[];
10
+ getCollection: (id: string) => PersistedCollection;
10
11
  saveCollection: <M extends {
11
12
  [Key: string]: CMSType;
12
13
  }>(params: SaveCollectionParams<M>) => Promise<void>;
14
+ updateCollection: <M extends {
15
+ [Key: string]: CMSType;
16
+ }>(params: UpdateCollectionParams<M>) => Promise<void>;
17
+ saveProperty: (params: SavePropertyParams) => Promise<void>;
18
+ deleteProperty: (params: DeletePropertyParams) => Promise<void>;
13
19
  deleteCollection: (props: DeleteCollectionParams) => Promise<void>;
14
20
  }
21
+ export type UpdateCollectionParams<M extends Record<string, any>> = {
22
+ id: string;
23
+ collectionData: Partial<PersistedCollection<M>>;
24
+ previousId?: string;
25
+ parentCollectionIds?: string[];
26
+ };
15
27
  export type SaveCollectionParams<M extends Record<string, any>> = {
28
+ id: string;
29
+ collectionData: PersistedCollection<M>;
30
+ previousId?: string;
31
+ parentCollectionIds?: string[];
32
+ };
33
+ export type SavePropertyParams = {
16
34
  path: string;
17
- collectionData: EntityCollection<M>;
18
- previousPath?: string;
19
- parentPathSegments?: string[];
35
+ propertyKey: string;
36
+ namespace?: string;
37
+ newPropertiesOrder?: string[];
38
+ property: Property;
39
+ parentCollectionIds?: string[];
20
40
  };
21
- export type DeleteCollectionParams = {
41
+ export type DeletePropertyParams = {
22
42
  path: string;
23
- parentPathSegments?: string[];
43
+ propertyKey: string;
44
+ namespace?: string;
45
+ newPropertiesOrder?: string[];
46
+ parentCollectionIds?: string[];
47
+ };
48
+ export type DeleteCollectionParams = {
49
+ id: string;
50
+ parentCollectionIds?: string[];
24
51
  };
@@ -1,4 +1,6 @@
1
1
  import { EntityCollection, User } from "@firecms/core";
2
- export type PersistedCollection<M extends Record<string, any> = any, AdditionalKey extends string = string, UserType extends User = User> = EntityCollection<M, AdditionalKey, UserType> & {
3
- ownerId: string;
2
+ export type PersistedCollection<M extends Record<string, any> = any, UserType extends User = User> = Omit<EntityCollection<M, UserType>, "subcollections"> & {
3
+ ownerId?: string;
4
+ subcollections?: PersistedCollection<any, any>[];
5
+ editable?: boolean;
4
6
  };
@@ -0,0 +1,11 @@
1
+ import { EntityTableController, ResolvedProperty } from "@firecms/core";
2
+ import { PersistedCollection } from "../types/persisted_collection";
3
+ export declare function CollectionViewHeaderAction({ propertyKey, onHover, property, fullPath, parentCollectionIds, collection, tableController }: {
4
+ property: ResolvedProperty;
5
+ propertyKey: string;
6
+ onHover: boolean;
7
+ fullPath: string;
8
+ parentCollectionIds: string[];
9
+ collection: PersistedCollection;
10
+ tableController: EntityTableController;
11
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { CollectionActionsProps } from "@firecms/core";
2
- export declare function EditorCollectionAction({ path: fullPath, parentPathSegments, collection, tableController }: CollectionActionsProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function EditorCollectionAction({ path: fullPath, parentCollectionIds, collection, tableController }: CollectionActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { CollectionActionsProps } from "@firecms/core";
2
+ export declare function EditorCollectionActionStart({ path: fullPath, parentCollectionIds, collection, tableController }: CollectionActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare function MissingReferenceWidget({ path: pathProp }: {
2
+ path: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function NewCollectionButton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { EntityTableController } from "@firecms/core";
2
+ import { PersistedCollection } from "../types/persisted_collection";
3
+ export declare function PropertyAddColumnComponent({ fullPath, parentCollectionIds, collection, tableController }: {
4
+ fullPath: string;
5
+ parentCollectionIds: string[];
6
+ collection: PersistedCollection;
7
+ tableController: EntityTableController;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,10 @@
1
1
  import { EntityCollection } from "@firecms/core";
2
- export declare function CollectionDetailsForm({ isNewCollection, reservedGroups, existingPaths, existingAliases, groups, parentCollection }: {
2
+ export declare function CollectionDetailsForm({ isNewCollection, reservedGroups, existingPaths, existingIds, groups, parentCollection }: {
3
3
  isNewCollection: boolean;
4
4
  reservedGroups?: string[];
5
5
  existingPaths?: string[];
6
- existingAliases?: string[];
6
+ existingIds?: string[];
7
7
  groups: string[] | null;
8
8
  parentCollection?: EntityCollection;
9
+ parentCollectionIds?: string[];
9
10
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,19 @@
1
1
  import * as React from "react";
2
- import { CMSType, EntityCollection, User } from "@firecms/core";
2
+ import { Entity, EntityCollection, User } from "@firecms/core";
3
3
  import { CollectionsConfigController } from "../../types/config_controller";
4
4
  import { CollectionInference } from "../../types/collection_inference";
5
+ import { PersistedCollection } from "../../types/persisted_collection";
5
6
  export interface CollectionEditorDialogProps {
6
7
  open: boolean;
7
8
  isNewCollection: boolean;
8
- group?: string;
9
- editedCollectionPath?: string;
9
+ initialValues?: {
10
+ group?: string;
11
+ path?: string;
12
+ name?: string;
13
+ };
14
+ editedCollectionId?: string;
10
15
  fullPath?: string;
11
- parentPathSegments?: string[];
16
+ parentCollectionIds?: string[];
12
17
  handleClose: (collection?: EntityCollection) => void;
13
18
  configController: CollectionsConfigController;
14
19
  reservedGroups?: string[];
@@ -19,15 +24,14 @@ export interface CollectionEditorDialogProps {
19
24
  }>;
20
25
  icon: React.ReactNode;
21
26
  };
22
- pathSuggestions?: (path: string) => Promise<string[]>;
23
- getUser: (uid: string) => User | null;
24
- getData?: (path: string) => Promise<object[]>;
25
- parentCollection?: EntityCollection;
27
+ pathSuggestions?: (path?: string) => Promise<string[]>;
28
+ getUser?: (uid: string) => User | null;
29
+ getData?: (path: string, parentPaths: string[]) => Promise<object[]>;
30
+ parentCollection?: PersistedCollection;
31
+ existingEntities?: Entity<any>[];
26
32
  }
27
33
  export declare function CollectionEditorDialog(props: CollectionEditorDialogProps): import("react/jsx-runtime").JSX.Element;
28
- export declare function CollectionEditorDialogInternal<M extends {
29
- [Key: string]: CMSType;
30
- }>({ isNewCollection, group, configController, editedCollectionPath, parentPathSegments, fullPath, collectionInference, handleClose, reservedGroups, extraView, handleCancel, setFormDirty, pathSuggestions, getUser, parentCollection, getData }: CollectionEditorDialogProps & {
34
+ export declare function CollectionEditor(props: CollectionEditorDialogProps & {
31
35
  handleCancel: () => void;
32
36
  setFormDirty: (dirty: boolean) => void;
33
37
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import React from "react";
2
2
  import { EntityCollection } from "@firecms/core";
3
- export declare function CollectionEditorWelcomeView({ path, pathSuggestions, parentCollection, onContinue, collections }: {
3
+ export declare function CollectionEditorWelcomeView({ path, pathSuggestions, parentCollection, onContinue, existingCollectionPaths }: {
4
4
  path: string;
5
5
  pathSuggestions?: (path: string) => Promise<string[]>;
6
6
  parentCollection?: EntityCollection;
7
- onContinue: (importData?: object[]) => void;
8
- collections?: EntityCollection[];
7
+ onContinue: (importData?: object[], propertiesOrder?: string[]) => void;
8
+ existingCollectionPaths?: string[];
9
9
  }): import("react/jsx-runtime").JSX.Element;
10
10
  export declare function TemplateButton({ title, subtitle, icon, onClick }: {
11
11
  title: string;
@@ -1,17 +1,19 @@
1
1
  import React from "react";
2
- import { FormikErrors } from "formik";
3
- import { EntityCollection, User } from "@firecms/core";
2
+ import { EntityCollection, PropertyConfig, User } from "@firecms/core";
3
+ import { PersistedCollection } from "../../types/persisted_collection";
4
4
  type CollectionEditorFormProps = {
5
5
  showErrors: boolean;
6
6
  isNewCollection: boolean;
7
7
  propertyErrorsRef?: React.MutableRefObject<any>;
8
- onPropertyError: (propertyKey: string, namespace: string | undefined, error?: FormikErrors<any>) => void;
8
+ onPropertyError: (propertyKey: string, namespace: string | undefined, error?: Record<string, any>) => void;
9
9
  setDirty?: (dirty: boolean) => void;
10
10
  reservedGroups?: string[];
11
11
  extraIcon: React.ReactNode;
12
- getUser: (uid: string) => User | null;
12
+ getUser?: (uid: string) => User | null;
13
13
  getData?: () => Promise<object[]>;
14
- doCollectionInference: (collection: EntityCollection<any, string>) => Promise<EntityCollection | null> | undefined;
14
+ doCollectionInference: (collection: PersistedCollection) => Promise<Partial<EntityCollection> | null> | undefined;
15
+ propertyConfigs: Record<string, PropertyConfig>;
16
+ collectionEditable: boolean;
15
17
  };
16
- export declare function CollectionPropertiesEditorForm({ showErrors, isNewCollection, propertyErrorsRef, onPropertyError, setDirty, reservedGroups, extraIcon, getUser, getData, doCollectionInference }: CollectionEditorFormProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function CollectionPropertiesEditorForm({ showErrors, isNewCollection, propertyErrorsRef, onPropertyError, setDirty, reservedGroups, extraIcon, getUser, getData, doCollectionInference, propertyConfigs, collectionEditable }: CollectionEditorFormProps): import("react/jsx-runtime").JSX.Element;
17
19
  export {};
@@ -1,11 +1,14 @@
1
1
  import * as Yup from "yup";
2
2
  export declare const YupSchema: Yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
3
4
  name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
5
  path: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
5
6
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
7
+ id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
8
  name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
7
9
  path: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
10
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
11
+ id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
9
12
  name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
10
13
  path: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
11
14
  }>>>;
@@ -0,0 +1,4 @@
1
+ export declare function EntityCustomViewsSelectDialog({ open, onClose }: {
2
+ open: boolean;
3
+ onClose: (selectedViewKey?: string) => void;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { EnumValueConfig } from "@firecms/core";
3
2
  type EnumFormProps = {
4
3
  enumValues: EnumValueConfig[];
@@ -9,5 +8,5 @@ type EnumFormProps = {
9
8
  allowDataInference?: boolean;
10
9
  getData?: () => Promise<string[]>;
11
10
  };
12
- export declare const EnumForm: React.NamedExoticComponent<EnumFormProps>;
11
+ export declare function EnumForm({ enumValues, onValuesChanged, onError, updateIds, disabled, allowDataInference, getData }: EnumFormProps): import("react/jsx-runtime").JSX.Element;
13
12
  export {};
@@ -0,0 +1,5 @@
1
+ export declare function GetCodeDialog({ collection, onOpenChange, open }: {
2
+ onOpenChange: (open: boolean) => void;
3
+ collection: any;
4
+ open: any;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,38 +1,48 @@
1
1
  import React from "react";
2
- import { FormikErrors, FormikProps } from "formik";
3
- import { EditableProperty } from "../../types/editable_properties";
4
- export type PropertyWithId = EditableProperty & {
2
+ import { FormexController } from "@firecms/formex";
3
+ import { Property, PropertyConfig } from "@firecms/core";
4
+ export type PropertyWithId = Property & {
5
5
  id?: string;
6
6
  };
7
7
  export type OnPropertyChangedParams = {
8
8
  id?: string;
9
- property: EditableProperty;
9
+ property: Property;
10
10
  namespace?: string;
11
11
  previousId?: string;
12
12
  };
13
13
  export type PropertyFormProps = {
14
14
  includeIdAndName?: boolean;
15
- existing: boolean;
15
+ existingProperty: boolean;
16
16
  autoUpdateId?: boolean;
17
17
  autoOpenTypeSelect: boolean;
18
18
  inArray: boolean;
19
19
  propertyKey?: string;
20
20
  propertyNamespace?: string;
21
- property?: EditableProperty;
21
+ property?: Property;
22
22
  onPropertyChanged?: (params: OnPropertyChangedParams) => void;
23
23
  onPropertyChangedImmediate?: boolean;
24
+ onDismiss?: () => void;
24
25
  onDelete?: (id?: string, namespace?: string) => void;
25
- onError?: (id: string, namespace?: string, error?: FormikErrors<any>) => void;
26
- initialErrors?: FormikErrors<any>;
27
- forceShowErrors?: boolean;
26
+ onError?: (id: string, namespace?: string, error?: Record<string, any>) => void;
27
+ initialErrors?: Record<string, any>;
28
28
  existingPropertyKeys?: string[];
29
+ forceShowErrors?: boolean;
29
30
  allowDataInference: boolean;
30
31
  getData?: () => Promise<object[]>;
31
- getHelpers?: (formikProps: FormikProps<PropertyWithId>) => void;
32
+ getController?: (formex: FormexController<PropertyWithId>) => void;
33
+ propertyConfigs: Record<string, PropertyConfig>;
34
+ collectionEditable: boolean;
32
35
  };
33
36
  export declare const PropertyForm: React.NamedExoticComponent<PropertyFormProps>;
34
- export declare function PropertyFormDialog({ open, onCancel, onOkClicked, onPropertyChanged, getData, ...formProps }: PropertyFormProps & {
37
+ export declare function PropertyFormDialog({ open, onCancel, onOkClicked, onPropertyChanged, getData, collectionEditable, ...formProps }: PropertyFormProps & {
35
38
  open?: boolean;
36
39
  onOkClicked?: () => void;
37
40
  onCancel?: () => void;
38
41
  }): import("react/jsx-runtime").JSX.Element;
42
+ export interface PropertySelectItemProps {
43
+ onClick?: () => void;
44
+ initialProperty?: PropertyWithId;
45
+ propertyConfig: PropertyConfig;
46
+ existing: boolean;
47
+ }
48
+ export declare function WidgetSelectViewItem({ onClick, initialProperty, propertyConfig, existing }: PropertySelectItemProps): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,15 @@
1
- import { EditableProperty } from "../../types/editable_properties";
1
+ import { Property, PropertyOrBuilder } from "@firecms/core";
2
2
  export declare function PropertyFieldPreview({ property, onClick, hasError, includeName, includeEditButton, selected }: {
3
- property: EditableProperty;
3
+ property: Property;
4
4
  hasError?: boolean;
5
5
  selected?: boolean;
6
6
  includeName?: boolean;
7
7
  includeEditButton?: boolean;
8
8
  onClick?: () => void;
9
9
  }): import("react/jsx-runtime").JSX.Element;
10
- export declare function PropertyBuilderPreview({ name, selected, onClick }: {
10
+ export declare function NonEditablePropertyPreview({ name, selected, onClick, property }: {
11
11
  name: string;
12
12
  selected: boolean;
13
13
  onClick?: () => void;
14
+ property?: PropertyOrBuilder;
14
15
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,24 +1,27 @@
1
- import { CMSType, PropertiesOrBuilders } from "@firecms/core";
1
+ import React from "react";
2
+ import { AdditionalFieldDelegate, CMSType, PropertiesOrBuilders, PropertyOrBuilder } from "@firecms/core";
2
3
  import { DraggableProvided } from "@hello-pangea/dnd";
3
- import { EditablePropertyOrBuilder } from "../../types/editable_properties";
4
- export declare function PropertyTree<M extends {
4
+ export declare const PropertyTree: React.MemoExoticComponent<(<M extends {
5
5
  [Key: string]: CMSType;
6
- }>({ namespace, selectedPropertyKey, onPropertyClick, properties, propertiesOrder: propertiesOrderProp, errors, onPropertyMove, onPropertyRemove, className, inferredPropertyKeys }: {
6
+ }>({ namespace, selectedPropertyKey, onPropertyClick, properties, propertiesOrder: propertiesOrderProp, additionalFields, errors, onPropertyMove, onPropertyRemove, className, inferredPropertyKeys, collectionEditable }: {
7
7
  namespace?: string;
8
8
  selectedPropertyKey?: string;
9
9
  onPropertyClick?: (propertyKey: string, namespace?: string) => void;
10
10
  properties: PropertiesOrBuilders<M>;
11
11
  propertiesOrder?: string[];
12
+ additionalFields?: AdditionalFieldDelegate<M>[];
12
13
  errors: Record<string, any>;
13
14
  onPropertyMove?: (propertiesOrder: string[], namespace?: string) => void;
14
15
  onPropertyRemove?: (propertyKey: string, namespace?: string) => void;
15
16
  className?: string;
16
17
  inferredPropertyKeys?: string[];
17
- }): import("react/jsx-runtime").JSX.Element;
18
- export declare function PropertyTreeEntry({ propertyKey, namespace, propertyOrBuilder, provided, selectedPropertyKey, errors, onPropertyClick, onPropertyMove, onPropertyRemove, inferredPropertyKeys }: {
18
+ collectionEditable: boolean;
19
+ }) => import("react/jsx-runtime").JSX.Element)>;
20
+ export declare function PropertyTreeEntry({ propertyKey, namespace, propertyOrBuilder, additionalField, provided, selectedPropertyKey, errors, onPropertyClick, onPropertyMove, onPropertyRemove, inferredPropertyKeys, collectionEditable }: {
19
21
  propertyKey: string;
20
22
  namespace?: string;
21
- propertyOrBuilder: EditablePropertyOrBuilder;
23
+ propertyOrBuilder: PropertyOrBuilder;
24
+ additionalField?: AdditionalFieldDelegate<any>;
22
25
  selectedPropertyKey?: string;
23
26
  provided: DraggableProvided;
24
27
  errors: Record<string, any>;
@@ -26,4 +29,5 @@ export declare function PropertyTreeEntry({ propertyKey, namespace, propertyOrBu
26
29
  onPropertyMove?: (propertiesOrder: string[], namespace?: string) => void;
27
30
  onPropertyRemove?: (propertyKey: string, namespace?: string) => void;
28
31
  inferredPropertyKeys?: string[];
32
+ collectionEditable: boolean;
29
33
  }): import("react/jsx-runtime").JSX.Element;
@@ -2,11 +2,11 @@ import { EntityCollection, User } from "@firecms/core";
2
2
  import { CollectionsConfigController } from "../../types/config_controller";
3
3
  import { PersistedCollection } from "../../types/persisted_collection";
4
4
  import { CollectionInference } from "../../types/collection_inference";
5
- export declare function SubcollectionsEditTab({ collection, parentCollection, configController, collectionInference, getUser, parentPathSegments }: {
5
+ export declare function SubcollectionsEditTab({ collection, parentCollection, configController, collectionInference, getUser, parentCollectionIds }: {
6
6
  collection: PersistedCollection;
7
7
  parentCollection?: EntityCollection;
8
8
  configController: CollectionsConfigController;
9
9
  collectionInference?: CollectionInference;
10
- getUser: (uid: string) => User | null;
11
- parentPathSegments?: string[];
10
+ getUser?: (uid: string) => User | null;
11
+ parentCollectionIds?: string[];
12
12
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { FormexFieldProps } from "@firecms/formex";
2
+ export declare function SwitchControl({ field, form, label, tooltip, disabled, size, allowIndeterminate }: FormexFieldProps & {
3
+ label: string;
4
+ tooltip?: string;
5
+ disabled?: boolean;
6
+ size?: "small" | "medium";
7
+ allowIndeterminate?: boolean;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { ImportConfig } from "@firecms/data_import";
1
+ import { ImportConfig } from "@firecms/data_import_export";
2
2
  import { Properties } from "@firecms/core";
3
3
  export declare function CollectionEditorImportDataPreview({ importConfig, properties, propertiesOrder }: {
4
4
  importConfig: ImportConfig;
@@ -0,0 +1,14 @@
1
+ import { ImportConfig } from "@firecms/data_import_export";
2
+ import { PropertyConfig } from "@firecms/core";
3
+ export declare function CollectionEditorImportMapping({ importConfig, propertyConfigs, collectionEditable }: {
4
+ importConfig: ImportConfig;
5
+ propertyConfigs: Record<string, PropertyConfig>;
6
+ collectionEditable: boolean;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ export interface PropertySelectItemProps {
9
+ value: string;
10
+ optionDisabled: boolean;
11
+ propertyConfig: PropertyConfig;
12
+ existing: boolean;
13
+ }
14
+ export declare function PropertySelectItem({ value, optionDisabled, propertyConfig, existing }: PropertySelectItemProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { Properties } from "@firecms/core";
2
- import { ImportConfig } from "@firecms/data_import";
2
+ import { ImportConfig } from "@firecms/data_import_export";
3
3
  export declare function cleanPropertiesFromImport(properties: Properties, parentSlug?: string): {
4
4
  headersMapping: ImportConfig["headersMapping"];
5
5
  properties: Properties;
@@ -1,5 +1,8 @@
1
- export declare function BlockPropertyField({ disabled, getData, allowDataInference }: {
1
+ import { PropertyConfig } from "@firecms/core";
2
+ export declare function BlockPropertyField({ disabled, getData, allowDataInference, propertyConfigs, collectionEditable }: {
2
3
  disabled: boolean;
3
4
  getData?: () => Promise<object[]>;
4
5
  allowDataInference: boolean;
6
+ propertyConfigs: Record<string, PropertyConfig>;
7
+ collectionEditable: boolean;
5
8
  }): import("react/jsx-runtime").JSX.Element;
@@ -2,9 +2,9 @@ import React from "react";
2
2
  type CommonPropertyFieldsProps = {
3
3
  showErrors: boolean;
4
4
  disabledId: boolean;
5
- existingPropertyKeys?: string[];
6
5
  disabled: boolean;
7
6
  isNewProperty: boolean;
7
+ autoUpdateId: boolean;
8
8
  };
9
9
  export declare const CommonPropertyFields: React.ForwardRefExoticComponent<CommonPropertyFieldsProps & React.RefAttributes<HTMLDivElement>>;
10
10
  export {};
@@ -1,5 +1,8 @@
1
- export declare function MapPropertyField({ disabled, getData, allowDataInference }: {
1
+ import { PropertyConfig } from "@firecms/core";
2
+ export declare function MapPropertyField({ disabled, getData, allowDataInference, propertyConfigs, collectionEditable }: {
2
3
  disabled: boolean;
3
4
  getData?: () => Promise<object[]>;
4
5
  allowDataInference: boolean;
6
+ propertyConfigs: Record<string, PropertyConfig>;
7
+ collectionEditable: boolean;
5
8
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare function MarkdownPropertyField({ disabled, showErrors }: {
2
+ disabled: boolean;
3
+ showErrors: boolean;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,10 @@
1
- export declare function RepeatPropertyField({ showErrors, existing, disabled, getData, allowDataInference }: {
1
+ import { PropertyConfig } from "@firecms/core";
2
+ export declare function RepeatPropertyField({ showErrors, existing, disabled, getData, allowDataInference, propertyConfigs, collectionEditable }: {
2
3
  showErrors: boolean;
3
4
  existing: boolean;
4
5
  disabled: boolean;
5
6
  getData?: () => Promise<object[]>;
6
7
  allowDataInference: boolean;
8
+ propertyConfigs: Record<string, PropertyConfig>;
9
+ collectionEditable: boolean;
7
10
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  export declare function StringPropertyField({ widgetId, disabled, showErrors }: {
2
- widgetId: "text_field" | "multiline" | "markdown" | "url" | "email";
2
+ widgetId: "text_field" | "multiline" | "email";
3
3
  disabled: boolean;
4
4
  showErrors: boolean;
5
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare function UrlPropertyField({ disabled, showErrors }: {
2
+ disabled: boolean;
3
+ showErrors: boolean;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { EntityCollection } from "@firecms/core";
2
+ export declare const blogCollectionTemplate: EntityCollection;
@@ -0,0 +1,2 @@
1
+ import { EntityCollection } from "@firecms/core";
2
+ export declare const pagesCollectionTemplate: EntityCollection;
@@ -0,0 +1,2 @@
1
+ import { EntityCollection } from "@firecms/core";
2
+ export declare const productsCollectionTemplate: EntityCollection;
@@ -0,0 +1,2 @@
1
+ import { EntityCollection } from "@firecms/core";
2
+ export declare const usersCollectionTemplate: EntityCollection;
@@ -2,3 +2,4 @@ export declare function idToPropertiesPath(id: string): string;
2
2
  export declare function namespaceToPropertiesPath(namespace?: string): string;
3
3
  export declare function namespaceToPropertiesOrderPath(namespace?: string): string;
4
4
  export declare function getFullId(propertyKey: string, propertyNamespace?: string): string;
5
+ export declare function getFullIdPath(propertyKey: string, propertyNamespace?: string): string;
@@ -0,0 +1 @@
1
+ export declare function camelCase(str: string): string;
@@ -0,0 +1,3 @@
1
+ import { PropertyConfigId, PropertyConfig } from "@firecms/core";
2
+ export declare const supportedFieldsIds: PropertyConfigId[];
3
+ export declare const supportedFields: Record<string, PropertyConfig>;
@@ -0,0 +1,2 @@
1
+ import { Property, PropertyConfig } from "@firecms/core";
2
+ export declare function updatePropertyFromWidget(propertyData: any, selectedWidgetId: string | undefined, propertyConfigs: Record<string, PropertyConfig>): Property;