@firecms/collection_editor 3.0.0-alpha.8 → 3.0.0-alpha.80

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 (138) hide show
  1. package/dist/ConfigControllerProvider.d.ts +37 -0
  2. package/dist/index.d.ts +11 -0
  3. package/dist/index.es.js +5257 -0
  4. package/dist/index.es.js.map +1 -0
  5. package/dist/index.umd.js +4 -0
  6. package/dist/index.umd.js.map +1 -0
  7. package/dist/types/collection_editor_controller.d.ts +35 -0
  8. package/dist/types/collection_inference.d.ts +2 -0
  9. package/dist/types/config_controller.d.ts +51 -0
  10. package/dist/types/config_permissions.d.ts +19 -0
  11. package/dist/types/persisted_collection.d.ts +6 -0
  12. package/dist/ui/CollectionViewHeaderAction.d.ts +10 -0
  13. package/dist/ui/EditorCollectionAction.d.ts +2 -0
  14. package/dist/ui/HomePageEditorCollectionAction.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/NewCollectionCard.d.ts +2 -0
  18. package/dist/ui/PropertyAddColumnComponent.d.ts +6 -0
  19. package/dist/ui/RootCollectionSuggestions.d.ts +1 -0
  20. package/dist/ui/collection_editor/CollectionDetailsForm.d.ts +10 -0
  21. package/dist/ui/collection_editor/CollectionEditorDialog.d.ts +38 -0
  22. package/dist/ui/collection_editor/CollectionEditorWelcomeView.d.ts +15 -0
  23. package/dist/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +20 -0
  24. package/dist/ui/collection_editor/CollectionYupValidation.d.ts +14 -0
  25. package/dist/ui/collection_editor/EntityCustomViewsSelectDialog.d.ts +4 -0
  26. package/dist/ui/collection_editor/EnumForm.d.ts +13 -0
  27. package/dist/ui/collection_editor/GetCodeDialog.d.ts +5 -0
  28. package/dist/ui/collection_editor/PropertyEditView.d.ts +40 -0
  29. package/dist/ui/collection_editor/PropertyFieldPreview.d.ts +15 -0
  30. package/dist/ui/collection_editor/PropertySelectItem.d.ts +8 -0
  31. package/dist/ui/collection_editor/PropertyTree.d.ts +32 -0
  32. package/dist/ui/collection_editor/SubcollectionsEditTab.d.ts +12 -0
  33. package/dist/ui/collection_editor/UnsavedChangesDialog.d.ts +9 -0
  34. package/dist/ui/collection_editor/import/CollectionEditorImportDataPreview.d.ts +7 -0
  35. package/dist/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +7 -0
  36. package/dist/ui/collection_editor/import/clean_import_data.d.ts +7 -0
  37. package/dist/ui/collection_editor/properties/BlockPropertyField.d.ts +8 -0
  38. package/dist/ui/collection_editor/properties/BooleanPropertyField.d.ts +3 -0
  39. package/dist/ui/collection_editor/properties/CommonPropertyFields.d.ts +11 -0
  40. package/dist/ui/collection_editor/properties/DateTimePropertyField.d.ts +3 -0
  41. package/dist/ui/collection_editor/properties/EnumPropertyField.d.ts +8 -0
  42. package/dist/ui/collection_editor/properties/FieldHelperView.d.ts +4 -0
  43. package/dist/ui/collection_editor/properties/KeyValuePropertyField.d.ts +3 -0
  44. package/dist/ui/collection_editor/properties/MapPropertyField.d.ts +8 -0
  45. package/dist/ui/collection_editor/properties/NumberPropertyField.d.ts +3 -0
  46. package/dist/ui/collection_editor/properties/ReferencePropertyField.d.ts +13 -0
  47. package/dist/ui/collection_editor/properties/RepeatPropertyField.d.ts +10 -0
  48. package/dist/ui/collection_editor/properties/StoragePropertyField.d.ts +5 -0
  49. package/dist/ui/collection_editor/properties/StringPropertyField.d.ts +5 -0
  50. package/dist/ui/collection_editor/properties/UrlPropertyField.d.ts +4 -0
  51. package/dist/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +3 -0
  52. package/dist/ui/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +5 -0
  53. package/dist/ui/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +4 -0
  54. package/dist/ui/collection_editor/properties/validation/NumberPropertyValidation.d.ts +3 -0
  55. package/dist/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +11 -0
  56. package/dist/ui/collection_editor/properties/validation/ValidationPanel.d.ts +2 -0
  57. package/dist/ui/collection_editor/templates/blog_template.d.ts +2 -0
  58. package/dist/ui/collection_editor/templates/pages_template.d.ts +2 -0
  59. package/dist/ui/collection_editor/templates/products_template.d.ts +2 -0
  60. package/dist/ui/collection_editor/templates/users_template.d.ts +2 -0
  61. package/dist/ui/collection_editor/util.d.ts +4 -0
  62. package/dist/ui/collection_editor/utils/strings.d.ts +1 -0
  63. package/dist/ui/collection_editor/utils/supported_fields.d.ts +3 -0
  64. package/dist/ui/collection_editor/utils/update_property_for_widget.d.ts +2 -0
  65. package/dist/ui/collection_editor/utils/useTraceUpdate.d.ts +1 -0
  66. package/dist/useCollectionEditorController.d.ts +6 -0
  67. package/dist/useCollectionEditorPlugin.d.ts +46 -0
  68. package/dist/useCollectionsConfigController.d.ts +6 -0
  69. package/dist/utils/arrays.d.ts +1 -0
  70. package/dist/utils/entities.d.ts +3 -0
  71. package/package.json +24 -27
  72. package/src/ConfigControllerProvider.tsx +330 -0
  73. package/src/index.ts +35 -0
  74. package/src/types/collection_editor_controller.tsx +42 -0
  75. package/src/types/collection_inference.ts +3 -0
  76. package/src/types/config_controller.tsx +60 -0
  77. package/src/types/config_permissions.ts +20 -0
  78. package/src/types/persisted_collection.ts +9 -0
  79. package/src/ui/CollectionViewHeaderAction.tsx +43 -0
  80. package/src/ui/EditorCollectionAction.tsx +109 -0
  81. package/src/ui/HomePageEditorCollectionAction.tsx +84 -0
  82. package/src/ui/MissingReferenceWidget.tsx +35 -0
  83. package/src/ui/NewCollectionButton.tsx +16 -0
  84. package/src/ui/NewCollectionCard.tsx +47 -0
  85. package/src/ui/PropertyAddColumnComponent.tsx +42 -0
  86. package/src/ui/RootCollectionSuggestions.tsx +55 -0
  87. package/src/ui/collection_editor/CollectionDetailsForm.tsx +366 -0
  88. package/src/ui/collection_editor/CollectionEditorDialog.tsx +754 -0
  89. package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +206 -0
  90. package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +481 -0
  91. package/src/ui/collection_editor/CollectionYupValidation.tsx +7 -0
  92. package/src/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +37 -0
  93. package/src/ui/collection_editor/EnumForm.tsx +358 -0
  94. package/src/ui/collection_editor/GetCodeDialog.tsx +120 -0
  95. package/src/ui/collection_editor/PropertyEditView.tsx +558 -0
  96. package/src/ui/collection_editor/PropertyFieldPreview.tsx +204 -0
  97. package/src/ui/collection_editor/PropertySelectItem.tsx +32 -0
  98. package/src/ui/collection_editor/PropertyTree.tsx +233 -0
  99. package/src/ui/collection_editor/SubcollectionsEditTab.tsx +253 -0
  100. package/src/ui/collection_editor/UnsavedChangesDialog.tsx +47 -0
  101. package/src/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +37 -0
  102. package/src/ui/collection_editor/import/CollectionEditorImportMapping.tsx +272 -0
  103. package/src/ui/collection_editor/import/clean_import_data.ts +53 -0
  104. package/src/ui/collection_editor/properties/BlockPropertyField.tsx +135 -0
  105. package/src/ui/collection_editor/properties/BooleanPropertyField.tsx +36 -0
  106. package/src/ui/collection_editor/properties/CommonPropertyFields.tsx +137 -0
  107. package/src/ui/collection_editor/properties/DateTimePropertyField.tsx +87 -0
  108. package/src/ui/collection_editor/properties/EnumPropertyField.tsx +117 -0
  109. package/src/ui/collection_editor/properties/FieldHelperView.tsx +13 -0
  110. package/src/ui/collection_editor/properties/KeyValuePropertyField.tsx +20 -0
  111. package/src/ui/collection_editor/properties/MapPropertyField.tsx +149 -0
  112. package/src/ui/collection_editor/properties/NumberPropertyField.tsx +38 -0
  113. package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +182 -0
  114. package/src/ui/collection_editor/properties/RepeatPropertyField.tsx +108 -0
  115. package/src/ui/collection_editor/properties/StoragePropertyField.tsx +194 -0
  116. package/src/ui/collection_editor/properties/StringPropertyField.tsx +79 -0
  117. package/src/ui/collection_editor/properties/UrlPropertyField.tsx +89 -0
  118. package/src/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +36 -0
  119. package/src/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +50 -0
  120. package/src/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +50 -0
  121. package/src/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +100 -0
  122. package/src/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +132 -0
  123. package/src/ui/collection_editor/properties/validation/ValidationPanel.tsx +28 -0
  124. package/src/ui/collection_editor/templates/blog_template.ts +115 -0
  125. package/src/ui/collection_editor/templates/pages_template.ts +188 -0
  126. package/src/ui/collection_editor/templates/products_template.ts +88 -0
  127. package/src/ui/collection_editor/templates/users_template.ts +42 -0
  128. package/src/ui/collection_editor/util.ts +21 -0
  129. package/src/ui/collection_editor/utils/strings.ts +8 -0
  130. package/src/ui/collection_editor/utils/supported_fields.tsx +29 -0
  131. package/src/ui/collection_editor/utils/update_property_for_widget.ts +271 -0
  132. package/src/ui/collection_editor/utils/useTraceUpdate.tsx +23 -0
  133. package/src/useCollectionEditorController.tsx +9 -0
  134. package/src/useCollectionEditorPlugin.tsx +137 -0
  135. package/src/useCollectionsConfigController.tsx +9 -0
  136. package/src/utils/arrays.ts +3 -0
  137. package/src/utils/entities.ts +38 -0
  138. package/src/vite-env.d.ts +1 -0
@@ -0,0 +1,35 @@
1
+ import { CollectionEditorPermissionsBuilder } from "./config_permissions";
2
+ import { Property } from "@firecms/core";
3
+ import { PersistedCollection } from "./persisted_collection";
4
+ /**
5
+ * Controller to open the collection editor dialog.
6
+ * @group Hooks and utilities
7
+ */
8
+ export interface CollectionEditorController {
9
+ editCollection: (props: {
10
+ path?: string;
11
+ fullPath?: string;
12
+ parentCollectionIds: string[];
13
+ parentCollection?: PersistedCollection;
14
+ }) => void;
15
+ createCollection: (props: {
16
+ initialValues?: {
17
+ group?: string;
18
+ path?: string;
19
+ name?: string;
20
+ };
21
+ parentCollectionIds: string[];
22
+ parentCollection?: PersistedCollection;
23
+ redirect: boolean;
24
+ }) => void;
25
+ editProperty: (props: {
26
+ propertyKey?: string;
27
+ property?: Property;
28
+ currentPropertiesOrder?: string[];
29
+ editedCollectionPath: string;
30
+ parentCollectionIds: string[];
31
+ collection: PersistedCollection;
32
+ }) => void;
33
+ configPermissions: CollectionEditorPermissionsBuilder;
34
+ rootPathSuggestions?: string[];
35
+ }
@@ -0,0 +1,2 @@
1
+ import { EntityCollection } from "@firecms/core";
2
+ export type CollectionInference = (path: string, collectionGroup: boolean, parentCollectionIds: string[]) => Promise<Partial<EntityCollection> | null>;
@@ -0,0 +1,51 @@
1
+ import { CMSType, Property } from "@firecms/core";
2
+ import { PersistedCollection } from "./persisted_collection";
3
+ /**
4
+ * Use this controller to access the configuration that is stored externally,
5
+ * and not defined in code.
6
+ */
7
+ export interface CollectionsConfigController {
8
+ loading: boolean;
9
+ collections?: PersistedCollection[];
10
+ getCollection: (id: string) => PersistedCollection;
11
+ saveCollection: <M extends {
12
+ [Key: string]: CMSType;
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>;
19
+ deleteCollection: (props: DeleteCollectionParams) => Promise<void>;
20
+ }
21
+ export type UpdateCollectionParams<M extends Record<string, any>> = {
22
+ id: string;
23
+ collectionData: Partial<PersistedCollection<M>>;
24
+ previousPath?: string;
25
+ parentCollectionIds?: string[];
26
+ };
27
+ export type SaveCollectionParams<M extends Record<string, any>> = {
28
+ id: string;
29
+ collectionData: PersistedCollection<M>;
30
+ previousPath?: string;
31
+ parentCollectionIds?: string[];
32
+ };
33
+ export type SavePropertyParams = {
34
+ path: string;
35
+ propertyKey: string;
36
+ namespace?: string;
37
+ newPropertiesOrder?: string[];
38
+ property: Property;
39
+ parentCollectionIds?: string[];
40
+ };
41
+ export type DeletePropertyParams = {
42
+ path: string;
43
+ propertyKey: string;
44
+ namespace?: string;
45
+ newPropertiesOrder?: string[];
46
+ parentCollectionIds?: string[];
47
+ };
48
+ export type DeleteCollectionParams = {
49
+ path: string;
50
+ parentCollectionIds?: string[];
51
+ };
@@ -0,0 +1,19 @@
1
+ import { EntityCollection } from "@firecms/core";
2
+ export type CollectionEditorPermissionsBuilder<UserType = any, EC extends EntityCollection = EntityCollection> = (params: {
3
+ user: UserType | null;
4
+ collection?: EC;
5
+ }) => CollectionEditorPermissions;
6
+ export type CollectionEditorPermissions = {
7
+ /**
8
+ * Is the user allowed to create new collections.
9
+ */
10
+ createCollections: boolean;
11
+ /**
12
+ * Is the user allowed to modify this collection
13
+ */
14
+ editCollections: boolean;
15
+ /**
16
+ * Is the user allowed to delete this collection
17
+ */
18
+ deleteCollections: boolean;
19
+ };
@@ -0,0 +1,6 @@
1
+ import { EntityCollection, User } from "@firecms/core";
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;
6
+ };
@@ -0,0 +1,10 @@
1
+ import { ResolvedProperty } from "@firecms/core";
2
+ import { PersistedCollection } from "../types/persisted_collection";
3
+ export declare function CollectionViewHeaderAction({ propertyKey, onHover, property, fullPath, parentCollectionIds, collection }: {
4
+ property: ResolvedProperty;
5
+ propertyKey: string;
6
+ onHover: boolean;
7
+ fullPath: string;
8
+ parentCollectionIds: string[];
9
+ collection: PersistedCollection;
10
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { CollectionActionsProps } from "@firecms/core";
2
+ export declare function EditorCollectionAction({ path: fullPath, parentCollectionIds, collection, tableController }: CollectionActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { PluginHomePageActionsProps } from "@firecms/core";
2
+ export declare function HomePageEditorCollectionAction({ path, collection }: PluginHomePageActionsProps): 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,2 @@
1
+ import { PluginHomePageAdditionalCardsProps } from "@firecms/core";
2
+ export declare function NewCollectionCard({ group, context }: PluginHomePageAdditionalCardsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { PersistedCollection } from "../types/persisted_collection";
2
+ export declare function PropertyAddColumnComponent({ fullPath, parentCollectionIds, collection }: {
3
+ fullPath: string;
4
+ parentCollectionIds: string[];
5
+ collection: PersistedCollection;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function RootCollectionSuggestions(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { EntityCollection } from "@firecms/core";
2
+ export declare function CollectionDetailsForm({ isNewCollection, reservedGroups, existingPaths, existingIds, groups, parentCollection }: {
3
+ isNewCollection: boolean;
4
+ reservedGroups?: string[];
5
+ existingPaths?: string[];
6
+ existingIds?: string[];
7
+ groups: string[] | null;
8
+ parentCollection?: EntityCollection;
9
+ parentCollectionIds?: string[];
10
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,38 @@
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
+ import { PersistedCollection } from "../../types/persisted_collection";
6
+ export interface CollectionEditorDialogProps {
7
+ open: boolean;
8
+ isNewCollection: boolean;
9
+ initialValues?: {
10
+ group?: string;
11
+ path?: string;
12
+ name?: string;
13
+ };
14
+ editedCollectionPath?: string;
15
+ fullPath?: string;
16
+ parentCollectionIds?: string[];
17
+ handleClose: (collection?: EntityCollection) => void;
18
+ configController: CollectionsConfigController;
19
+ reservedGroups?: string[];
20
+ collectionInference?: CollectionInference;
21
+ extraView?: {
22
+ View: React.ComponentType<{
23
+ path: string;
24
+ }>;
25
+ icon: React.ReactNode;
26
+ };
27
+ pathSuggestions?: (path?: string) => Promise<string[]>;
28
+ getUser: (uid: string) => User | null;
29
+ getData?: (path: string, parentPaths: string[]) => Promise<object[]>;
30
+ parentCollection?: PersistedCollection;
31
+ }
32
+ export declare function CollectionEditorDialog(props: CollectionEditorDialogProps): import("react/jsx-runtime").JSX.Element;
33
+ export declare function CollectionEditorDialogInternal<M extends {
34
+ [Key: string]: CMSType;
35
+ }>({ isNewCollection, initialValues: initialValuesProp, configController, editedCollectionPath, parentCollectionIds, fullPath, collectionInference, handleClose, reservedGroups, extraView, handleCancel, setFormDirty, pathSuggestions, getUser, parentCollection, getData }: CollectionEditorDialogProps & {
36
+ handleCancel: () => void;
37
+ setFormDirty: (dirty: boolean) => void;
38
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
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;
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { FormikErrors } from "formik";
3
+ import { EntityCollection, PropertyConfig, 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) => Promise<Partial<EntityCollection> | null> | undefined;
16
+ propertyConfigs: Record<string, PropertyConfig>;
17
+ collectionEditable: boolean;
18
+ };
19
+ export declare function CollectionPropertiesEditorForm({ showErrors, isNewCollection, propertyErrorsRef, onPropertyError, setDirty, reservedGroups, extraIcon, getUser, getData, doCollectionInference, propertyConfigs, collectionEditable }: CollectionEditorFormProps): import("react/jsx-runtime").JSX.Element;
20
+ export {};
@@ -0,0 +1,14 @@
1
+ import * as Yup from "yup";
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>;
4
+ name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
5
+ path: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
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>;
8
+ name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
9
+ path: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
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>;
12
+ name: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
13
+ path: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
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;
@@ -0,0 +1,13 @@
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 {};
@@ -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;
@@ -0,0 +1,40 @@
1
+ import React from "react";
2
+ import { FormikErrors, FormikProps } from "formik";
3
+ import { Property, PropertyConfig } 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
+ existingProperty: 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
+ propertyConfigs: Record<string, PropertyConfig>;
33
+ collectionEditable: boolean;
34
+ };
35
+ export declare const PropertyForm: React.NamedExoticComponent<PropertyFormProps>;
36
+ export declare function PropertyFormDialog({ open, onCancel, onOkClicked, onPropertyChanged, getData, collectionEditable, ...formProps }: PropertyFormProps & {
37
+ open?: boolean;
38
+ onOkClicked?: () => void;
39
+ onCancel?: () => void;
40
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
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;
@@ -0,0 +1,8 @@
1
+ import { PropertyConfig } from "@firecms/core";
2
+ export interface PropertySelectItemProps {
3
+ value: string;
4
+ optionDisabled: boolean;
5
+ propertyConfig: PropertyConfig;
6
+ existing: boolean;
7
+ }
8
+ export declare function PropertySelectItem({ value, optionDisabled, propertyConfig, existing }: PropertySelectItemProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,32 @@
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, collectionEditable, }: {
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
+ collectionEditable: boolean;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ export declare function PropertyTreeEntry({ propertyKey, namespace, propertyOrBuilder, additionalField, provided, selectedPropertyKey, errors, onPropertyClick, onPropertyMove, onPropertyRemove, inferredPropertyKeys, collectionEditable, }: {
20
+ propertyKey: string;
21
+ namespace?: string;
22
+ propertyOrBuilder: PropertyOrBuilder;
23
+ additionalField?: AdditionalFieldDelegate<any>;
24
+ selectedPropertyKey?: string;
25
+ provided: DraggableProvided;
26
+ errors: Record<string, any>;
27
+ onPropertyClick?: (propertyKey: string, namespace?: string) => void;
28
+ onPropertyMove?: (propertiesOrder: string[], namespace?: string) => void;
29
+ onPropertyRemove?: (propertyKey: string, namespace?: string) => void;
30
+ inferredPropertyKeys?: string[];
31
+ collectionEditable: boolean;
32
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
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, parentCollectionIds }: {
6
+ collection: PersistedCollection;
7
+ parentCollection?: EntityCollection;
8
+ configController: CollectionsConfigController;
9
+ collectionInference?: CollectionInference;
10
+ getUser: (uid: string) => User | null;
11
+ parentCollectionIds?: string[];
12
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
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;
@@ -0,0 +1,7 @@
1
+ import { ImportConfig } from "@firecms/data_import_export";
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;
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,7 @@
1
+ import { Properties } from "@firecms/core";
2
+ import { ImportConfig } from "@firecms/data_import_export";
3
+ export declare function cleanPropertiesFromImport(properties: Properties, parentSlug?: string): {
4
+ headersMapping: ImportConfig["headersMapping"];
5
+ properties: Properties;
6
+ idColumn?: ImportConfig["idColumn"];
7
+ };
@@ -0,0 +1,8 @@
1
+ import { PropertyConfig } from "@firecms/core";
2
+ export declare function BlockPropertyField({ disabled, getData, allowDataInference, propertyConfigs, collectionEditable }: {
3
+ disabled: boolean;
4
+ getData?: () => Promise<object[]>;
5
+ allowDataInference: boolean;
6
+ propertyConfigs: Record<string, PropertyConfig>;
7
+ collectionEditable: boolean;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare function BooleanPropertyField({ disabled }: {
2
+ disabled: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ type CommonPropertyFieldsProps = {
3
+ showErrors: boolean;
4
+ disabledId: boolean;
5
+ existingPropertyKeys?: string[];
6
+ disabled: boolean;
7
+ isNewProperty: boolean;
8
+ autoUpdateId: boolean;
9
+ };
10
+ export declare const CommonPropertyFields: React.ForwardRefExoticComponent<CommonPropertyFieldsProps & React.RefAttributes<HTMLDivElement>>;
11
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare function DateTimePropertyField({ disabled }: {
2
+ disabled: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
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;
@@ -0,0 +1,4 @@
1
+ export declare function FieldHelperView({ error, children }: {
2
+ error?: boolean;
3
+ children?: React.ReactNode;
4
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,3 @@
1
+ export declare function KeyValuePropertyField({ disabled }: {
2
+ disabled: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { PropertyConfig } from "@firecms/core";
2
+ export declare function MapPropertyField({ disabled, getData, allowDataInference, propertyConfigs, collectionEditable }: {
3
+ disabled: boolean;
4
+ getData?: () => Promise<object[]>;
5
+ allowDataInference: boolean;
6
+ propertyConfigs: Record<string, PropertyConfig>;
7
+ collectionEditable: boolean;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare function NumberPropertyField({ disabled }: {
2
+ disabled: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ export declare function ReferencePropertyField({ existing, multiple, disabled, showErrors }: {
2
+ existing: boolean;
3
+ multiple: boolean;
4
+ disabled: boolean;
5
+ showErrors: boolean;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ export declare function CollectionsSelect({ disabled, pathPath, value, handleChange, error, ...props }: {
8
+ disabled: boolean;
9
+ pathPath: string;
10
+ value?: string;
11
+ handleChange: (event: any) => void;
12
+ error?: string;
13
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { PropertyConfig } from "@firecms/core";
2
+ export declare function RepeatPropertyField({ showErrors, existing, disabled, getData, allowDataInference, propertyConfigs, collectionEditable }: {
3
+ showErrors: boolean;
4
+ existing: boolean;
5
+ disabled: boolean;
6
+ getData?: () => Promise<object[]>;
7
+ allowDataInference: boolean;
8
+ propertyConfigs: Record<string, PropertyConfig>;
9
+ collectionEditable: boolean;
10
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare function StoragePropertyField({ multiple, existing, disabled }: {
2
+ multiple: boolean;
3
+ existing: boolean;
4
+ disabled: boolean;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare function StringPropertyField({ widgetId, disabled, showErrors }: {
2
+ widgetId: "text_field" | "multiline" | "markdown" | "email";
3
+ disabled: boolean;
4
+ showErrors: boolean;
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,3 @@
1
+ export declare function AdvancedPropertyValidation({ disabled }: {
2
+ disabled: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare function ArrayPropertyValidation({ max, min, disabled }: {
2
+ min?: boolean;
3
+ max?: boolean;
4
+ disabled: boolean;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare function GeneralPropertyValidation({ disabled }: {
2
+ required?: boolean;
3
+ disabled: boolean;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare function NumberPropertyValidation({ disabled }: {
2
+ disabled: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ export declare function StringPropertyValidation({ length, lowercase, matches, max, min, trim, uppercase, disabled, showErrors }: {
2
+ length?: boolean;
3
+ min?: boolean;
4
+ max?: boolean;
5
+ trim?: boolean;
6
+ matches?: boolean;
7
+ lowercase?: boolean;
8
+ uppercase?: boolean;
9
+ disabled: boolean;
10
+ showErrors: boolean;
11
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { PropsWithChildren } from "react";
2
+ export declare function ValidationPanel({ children }: PropsWithChildren<{}>): 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;