@firecms/collection_editor 3.0.0-canary.28 → 3.0.0-canary.280

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 (91) hide show
  1. package/LICENSE +114 -21
  2. package/README.md +165 -1
  3. package/dist/ConfigControllerProvider.d.ts +1 -2
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.es.js +10792 -4791
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/index.umd.js +11458 -3
  8. package/dist/index.umd.js.map +1 -1
  9. package/dist/types/collection_editor_controller.d.ts +3 -2
  10. package/dist/types/collection_inference.d.ts +4 -1
  11. package/dist/types/config_controller.d.ts +3 -1
  12. package/dist/types/config_permissions.d.ts +2 -2
  13. package/dist/types/persisted_collection.d.ts +1 -1
  14. package/dist/ui/CollectionViewHeaderAction.d.ts +3 -2
  15. package/dist/ui/EditorCollectionActionStart.d.ts +2 -0
  16. package/dist/ui/EditorEntityAction.d.ts +2 -0
  17. package/dist/ui/PropertyAddColumnComponent.d.ts +3 -1
  18. package/dist/ui/collection_editor/CollectionDetailsForm.d.ts +3 -1
  19. package/dist/ui/collection_editor/CollectionEditorDialog.d.ts +3 -2
  20. package/dist/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
  21. package/dist/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +2 -2
  22. package/dist/ui/collection_editor/EntityActionsEditTab.d.ts +4 -0
  23. package/dist/ui/collection_editor/EntityActionsSelectDialog.d.ts +4 -0
  24. package/dist/ui/collection_editor/LayoutModeSwitch.d.ts +5 -0
  25. package/dist/ui/collection_editor/PropertyEditView.d.ts +8 -0
  26. package/dist/ui/collection_editor/PropertyTree.d.ts +11 -12
  27. package/dist/ui/collection_editor/SubcollectionsEditTab.d.ts +1 -1
  28. package/dist/ui/collection_editor/import/CollectionEditorImportDataPreview.d.ts +1 -1
  29. package/dist/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +8 -1
  30. package/dist/ui/collection_editor/import/clean_import_data.d.ts +1 -1
  31. package/dist/ui/collection_editor/properties/MarkdownPropertyField.d.ts +4 -0
  32. package/dist/ui/collection_editor/properties/ReferencePropertyField.d.ts +2 -1
  33. package/dist/ui/collection_editor/properties/StringPropertyField.d.ts +1 -1
  34. package/dist/useCollectionEditorPlugin.d.ts +8 -11
  35. package/dist/utils/collections.d.ts +6 -0
  36. package/package.json +25 -37
  37. package/src/ConfigControllerProvider.tsx +64 -66
  38. package/src/index.ts +1 -0
  39. package/src/types/collection_editor_controller.tsx +6 -5
  40. package/src/types/collection_inference.ts +4 -1
  41. package/src/types/config_controller.tsx +4 -1
  42. package/src/types/config_permissions.ts +1 -1
  43. package/src/types/persisted_collection.ts +2 -3
  44. package/src/ui/CollectionViewHeaderAction.tsx +10 -5
  45. package/src/ui/EditorCollectionAction.tsx +12 -70
  46. package/src/ui/EditorCollectionActionStart.tsx +87 -0
  47. package/src/ui/EditorEntityAction.tsx +51 -0
  48. package/src/ui/HomePageEditorCollectionAction.tsx +21 -14
  49. package/src/ui/NewCollectionButton.tsx +1 -1
  50. package/src/ui/NewCollectionCard.tsx +3 -3
  51. package/src/ui/PropertyAddColumnComponent.tsx +11 -6
  52. package/src/ui/collection_editor/CollectionDetailsForm.tsx +157 -50
  53. package/src/ui/collection_editor/CollectionEditorDialog.tsx +119 -39
  54. package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +24 -33
  55. package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +46 -41
  56. package/src/ui/collection_editor/EntityActionsEditTab.tsx +163 -0
  57. package/src/ui/collection_editor/EntityActionsSelectDialog.tsx +41 -0
  58. package/src/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +11 -7
  59. package/src/ui/collection_editor/EnumForm.tsx +11 -7
  60. package/src/ui/collection_editor/GetCodeDialog.tsx +60 -28
  61. package/src/ui/collection_editor/LayoutModeSwitch.tsx +54 -0
  62. package/src/ui/collection_editor/PropertyEditView.tsx +266 -79
  63. package/src/ui/collection_editor/PropertyFieldPreview.tsx +8 -10
  64. package/src/ui/collection_editor/PropertyTree.tsx +184 -138
  65. package/src/ui/collection_editor/SubcollectionsEditTab.tsx +26 -19
  66. package/src/ui/collection_editor/UnsavedChangesDialog.tsx +9 -7
  67. package/src/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +41 -9
  68. package/src/ui/collection_editor/import/CollectionEditorImportMapping.tsx +43 -10
  69. package/src/ui/collection_editor/import/clean_import_data.ts +1 -1
  70. package/src/ui/collection_editor/properties/BlockPropertyField.tsx +32 -20
  71. package/src/ui/collection_editor/properties/DateTimePropertyField.tsx +54 -47
  72. package/src/ui/collection_editor/properties/EnumPropertyField.tsx +3 -1
  73. package/src/ui/collection_editor/properties/MapPropertyField.tsx +8 -7
  74. package/src/ui/collection_editor/properties/MarkdownPropertyField.tsx +139 -0
  75. package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +7 -3
  76. package/src/ui/collection_editor/properties/RepeatPropertyField.tsx +0 -1
  77. package/src/ui/collection_editor/properties/StoragePropertyField.tsx +34 -19
  78. package/src/ui/collection_editor/properties/StringPropertyField.tsx +4 -9
  79. package/src/ui/collection_editor/properties/UrlPropertyField.tsx +1 -0
  80. package/src/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +2 -0
  81. package/src/ui/collection_editor/properties/validation/ValidationPanel.tsx +2 -2
  82. package/src/ui/collection_editor/templates/pages_template.ts +1 -6
  83. package/src/ui/collection_editor/utils/strings.ts +13 -6
  84. package/src/ui/collection_editor/utils/supported_fields.tsx +2 -0
  85. package/src/ui/collection_editor/utils/update_property_for_widget.ts +37 -6
  86. package/src/useCollectionEditorPlugin.tsx +38 -32
  87. package/src/utils/collections.ts +46 -0
  88. package/dist/ui/RootCollectionSuggestions.d.ts +0 -3
  89. package/dist/ui/collection_editor/PropertySelectItem.d.ts +0 -8
  90. package/src/ui/RootCollectionSuggestions.tsx +0 -63
  91. package/src/ui/collection_editor/PropertySelectItem.tsx +0 -32
@@ -1,5 +1,5 @@
1
1
  import { CollectionEditorPermissionsBuilder } from "./config_permissions";
2
- import { Property } from "@firecms/core";
2
+ import { Entity, Property } from "@firecms/core";
3
3
  import { PersistedCollection } from "./persisted_collection";
4
4
  /**
5
5
  * Controller to open the collection editor dialog.
@@ -11,6 +11,7 @@ export interface CollectionEditorController {
11
11
  fullPath?: string;
12
12
  parentCollectionIds: string[];
13
13
  parentCollection?: PersistedCollection;
14
+ existingEntities?: Entity<any>[];
14
15
  }) => void;
15
16
  createCollection: (props: {
16
17
  initialValues?: {
@@ -30,7 +31,7 @@ export interface CollectionEditorController {
30
31
  editedCollectionId: string;
31
32
  parentCollectionIds: string[];
32
33
  collection: PersistedCollection;
34
+ existingEntities: Entity<any>[];
33
35
  }) => void;
34
36
  configPermissions: CollectionEditorPermissionsBuilder;
35
- rootPathSuggestions?: string[];
36
37
  }
@@ -1,2 +1,5 @@
1
1
  import { EntityCollection } from "@firecms/core";
2
- export type CollectionInference = (path: string, collectionGroup: boolean, parentCollectionIds: string[]) => Promise<Partial<EntityCollection> | null>;
2
+ /**
3
+ * This function is used to infer the configuration of a collection given its path.
4
+ */
5
+ export type CollectionInference = (path: string, collectionGroup: boolean, parentCollectionPaths: string[], databaseId?: string) => Promise<Partial<EntityCollection> | null>;
@@ -1,4 +1,4 @@
1
- import { CMSType, Property } from "@firecms/core";
1
+ import { CMSType, NavigationGroupMapping, 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,
@@ -17,6 +17,8 @@ export interface CollectionsConfigController {
17
17
  saveProperty: (params: SavePropertyParams) => Promise<void>;
18
18
  deleteProperty: (params: DeletePropertyParams) => Promise<void>;
19
19
  deleteCollection: (props: DeleteCollectionParams) => Promise<void>;
20
+ navigationEntries: NavigationGroupMapping[];
21
+ saveNavigationEntries: (entries: NavigationGroupMapping[]) => Promise<void>;
20
22
  }
21
23
  export type UpdateCollectionParams<M extends Record<string, any>> = {
22
24
  id: string;
@@ -1,6 +1,6 @@
1
1
  import { EntityCollection } from "@firecms/core";
2
- export type CollectionEditorPermissionsBuilder<UserType = any, EC extends EntityCollection = EntityCollection> = (params: {
3
- user: UserType | null;
2
+ export type CollectionEditorPermissionsBuilder<USER = any, EC extends EntityCollection = EntityCollection> = (params: {
3
+ user: USER | null;
4
4
  collection?: EC;
5
5
  }) => CollectionEditorPermissions;
6
6
  export type CollectionEditorPermissions = {
@@ -1,5 +1,5 @@
1
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"> & {
2
+ export type PersistedCollection<M extends Record<string, any> = any, USER extends User = User> = Omit<EntityCollection<M, USER>, "subcollections"> & {
3
3
  ownerId?: string;
4
4
  subcollections?: PersistedCollection<any, any>[];
5
5
  editable?: boolean;
@@ -1,10 +1,11 @@
1
- import { ResolvedProperty } from "@firecms/core";
1
+ import { EntityTableController, ResolvedProperty } from "@firecms/core";
2
2
  import { PersistedCollection } from "../types/persisted_collection";
3
- export declare function CollectionViewHeaderAction({ propertyKey, onHover, property, fullPath, parentCollectionIds, collection }: {
3
+ export declare function CollectionViewHeaderAction({ propertyKey, onHover, property, fullPath, parentCollectionIds, collection, tableController }: {
4
4
  property: ResolvedProperty;
5
5
  propertyKey: string;
6
6
  onHover: boolean;
7
7
  fullPath: string;
8
8
  parentCollectionIds: string[];
9
9
  collection: PersistedCollection;
10
+ tableController: EntityTableController;
10
11
  }): 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,2 @@
1
+ import { PluginFormActionProps } from "@firecms/core";
2
+ export declare function EditorEntityAction({ path: fullPath, parentCollectionIds, collection, formContext }: PluginFormActionProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,8 @@
1
+ import { EntityTableController } from "@firecms/core";
1
2
  import { PersistedCollection } from "../types/persisted_collection";
2
- export declare function PropertyAddColumnComponent({ fullPath, parentCollectionIds, collection }: {
3
+ export declare function PropertyAddColumnComponent({ fullPath, parentCollectionIds, collection, tableController }: {
3
4
  fullPath: string;
4
5
  parentCollectionIds: string[];
5
6
  collection: PersistedCollection;
7
+ tableController: EntityTableController;
6
8
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,6 @@
1
+ import React from "react";
1
2
  import { EntityCollection } from "@firecms/core";
2
- export declare function CollectionDetailsForm({ isNewCollection, reservedGroups, existingPaths, existingIds, groups, parentCollection }: {
3
+ export declare function CollectionDetailsForm({ isNewCollection, reservedGroups, existingPaths, existingIds, groups, parentCollection, children }: {
3
4
  isNewCollection: boolean;
4
5
  reservedGroups?: string[];
5
6
  existingPaths?: string[];
@@ -7,4 +8,5 @@ export declare function CollectionDetailsForm({ isNewCollection, reservedGroups,
7
8
  groups: string[] | null;
8
9
  parentCollection?: EntityCollection;
9
10
  parentCollectionIds?: string[];
11
+ children?: React.ReactNode;
10
12
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { 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
5
  import { PersistedCollection } from "../../types/persisted_collection";
@@ -25,9 +25,10 @@ export interface CollectionEditorDialogProps {
25
25
  icon: React.ReactNode;
26
26
  };
27
27
  pathSuggestions?: (path?: string) => Promise<string[]>;
28
- getUser: (uid: string) => User | null;
28
+ getUser?: (uid: string) => User | null;
29
29
  getData?: (path: string, parentPaths: string[]) => Promise<object[]>;
30
30
  parentCollection?: PersistedCollection;
31
+ existingEntities?: Entity<any>[];
31
32
  }
32
33
  export declare function CollectionEditorDialog(props: CollectionEditorDialogProps): import("react/jsx-runtime").JSX.Element;
33
34
  export declare function CollectionEditor(props: CollectionEditorDialogProps & {
@@ -4,9 +4,9 @@ export declare function CollectionEditorWelcomeView({ path, pathSuggestions, par
4
4
  path: string;
5
5
  pathSuggestions?: (path: string) => Promise<string[]>;
6
6
  parentCollection?: EntityCollection;
7
- onContinue: (importData?: object[]) => void;
7
+ onContinue: (importData?: object[], propertiesOrder?: string[]) => void;
8
8
  existingCollectionPaths?: string[];
9
- }): import("react/jsx-runtime").JSX.Element;
9
+ }): import("react/jsx-runtime").JSX.Element | null;
10
10
  export declare function TemplateButton({ title, subtitle, icon, onClick }: {
11
11
  title: string;
12
12
  icon: React.ReactNode;
@@ -9,9 +9,9 @@ type CollectionEditorFormProps = {
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: PersistedCollection) => Promise<Partial<EntityCollection> | null> | undefined;
14
+ doCollectionInference?: (collection: PersistedCollection) => Promise<Partial<EntityCollection> | null> | undefined;
15
15
  propertyConfigs: Record<string, PropertyConfig>;
16
16
  collectionEditable: boolean;
17
17
  };
@@ -0,0 +1,4 @@
1
+ import { PersistedCollection } from "../../types/persisted_collection";
2
+ export declare function EntityActionsEditTab({ collection, }: {
3
+ collection: PersistedCollection;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare function EntityActionsSelectDialog({ open, onClose }: {
2
+ open: boolean;
3
+ onClose: (selectedActionKey?: string) => void;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare function LayoutModeSwitch({ value, onChange, className }: {
2
+ value: "side_panel" | "full_screen";
3
+ onChange: (value: "side_panel" | "full_screen") => void;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -21,6 +21,7 @@ export type PropertyFormProps = {
21
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
26
  onError?: (id: string, namespace?: string, error?: Record<string, any>) => void;
26
27
  initialErrors?: Record<string, any>;
@@ -38,3 +39,10 @@ export declare function PropertyFormDialog({ open, onCancel, onOkClicked, onProp
38
39
  onOkClicked?: () => void;
39
40
  onCancel?: () => void;
40
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,29 +1,28 @@
1
1
  import React from "react";
2
2
  import { AdditionalFieldDelegate, CMSType, PropertiesOrBuilders, PropertyOrBuilder } from "@firecms/core";
3
- import { DraggableProvided } from "@hello-pangea/dnd";
4
3
  export declare const PropertyTree: React.MemoExoticComponent<(<M extends {
5
4
  [Key: string]: CMSType;
6
5
  }>({ namespace, selectedPropertyKey, onPropertyClick, properties, propertiesOrder: propertiesOrderProp, additionalFields, errors, onPropertyMove, onPropertyRemove, className, inferredPropertyKeys, collectionEditable }: {
7
- namespace?: string | undefined;
8
- selectedPropertyKey?: string | undefined;
9
- onPropertyClick?: ((propertyKey: string, namespace?: string) => void) | undefined;
6
+ namespace?: string;
7
+ selectedPropertyKey?: string;
8
+ onPropertyClick?: (propertyKey: string, namespace?: string) => void;
10
9
  properties: PropertiesOrBuilders<M>;
11
- propertiesOrder?: string[] | undefined;
12
- additionalFields?: AdditionalFieldDelegate<M, import("@firecms/core").User>[] | undefined;
10
+ propertiesOrder?: string[];
11
+ additionalFields?: AdditionalFieldDelegate<M>[];
13
12
  errors: Record<string, any>;
14
- onPropertyMove?: ((propertiesOrder: string[], namespace?: string) => void) | undefined;
15
- onPropertyRemove?: ((propertyKey: string, namespace?: string) => void) | undefined;
16
- className?: string | undefined;
17
- inferredPropertyKeys?: string[] | undefined;
13
+ onPropertyMove?: (propertiesOrder: string[], namespace?: string) => void;
14
+ onPropertyRemove?: (propertyKey: string, namespace?: string) => void;
15
+ className?: string;
16
+ inferredPropertyKeys?: string[];
18
17
  collectionEditable: boolean;
19
18
  }) => import("react/jsx-runtime").JSX.Element)>;
20
- export declare function PropertyTreeEntry({ propertyKey, namespace, propertyOrBuilder, additionalField, provided, selectedPropertyKey, errors, onPropertyClick, onPropertyMove, onPropertyRemove, inferredPropertyKeys, collectionEditable }: {
19
+ export declare function PropertyTreeEntry({ id, propertyKey, namespace, propertyOrBuilder, additionalField, selectedPropertyKey, errors, onPropertyClick, onPropertyMove, onPropertyRemove, inferredPropertyKeys, collectionEditable }: {
20
+ id: string;
21
21
  propertyKey: string;
22
22
  namespace?: string;
23
23
  propertyOrBuilder: PropertyOrBuilder;
24
24
  additionalField?: AdditionalFieldDelegate<any>;
25
25
  selectedPropertyKey?: string;
26
- provided: DraggableProvided;
27
26
  errors: Record<string, any>;
28
27
  onPropertyClick?: (propertyKey: string, namespace?: string) => void;
29
28
  onPropertyMove?: (propertiesOrder: string[], namespace?: string) => void;
@@ -7,6 +7,6 @@ export declare function SubcollectionsEditTab({ collection, parentCollection, co
7
7
  parentCollection?: EntityCollection;
8
8
  configController: CollectionsConfigController;
9
9
  collectionInference?: CollectionInference;
10
- getUser: (uid: string) => User | null;
10
+ getUser?: (uid: string) => User | null;
11
11
  parentCollectionIds?: string[];
12
12
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { ImportConfig } from "@firecms/data_import_export";
1
+ import { ImportConfig } from "@firecms/data_import";
2
2
  import { Properties } from "@firecms/core";
3
3
  export declare function CollectionEditorImportDataPreview({ importConfig, properties, propertiesOrder }: {
4
4
  importConfig: ImportConfig;
@@ -1,7 +1,14 @@
1
- import { ImportConfig } from "@firecms/data_import_export";
1
+ import { ImportConfig } from "@firecms/data_import";
2
2
  import { PropertyConfig } from "@firecms/core";
3
3
  export declare function CollectionEditorImportMapping({ importConfig, propertyConfigs, collectionEditable }: {
4
4
  importConfig: ImportConfig;
5
5
  propertyConfigs: Record<string, PropertyConfig>;
6
6
  collectionEditable: boolean;
7
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_export";
2
+ import { ImportConfig } from "@firecms/data_import";
3
3
  export declare function cleanPropertiesFromImport(properties: Properties, parentSlug?: string): {
4
4
  headersMapping: ImportConfig["headersMapping"];
5
5
  properties: Properties;
@@ -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,8 +1,9 @@
1
- export declare function ReferencePropertyField({ existing, multiple, disabled, showErrors }: {
1
+ export declare function ReferencePropertyField({ existing, multiple, disabled, showErrors, asString }: {
2
2
  existing: boolean;
3
3
  multiple: boolean;
4
4
  disabled: boolean;
5
5
  showErrors: boolean;
6
+ asString?: boolean;
6
7
  }): import("react/jsx-runtime").JSX.Element;
7
8
  export declare function CollectionsSelect({ disabled, pathPath, value, handleChange, error, ...props }: {
8
9
  disabled: boolean;
@@ -1,5 +1,5 @@
1
1
  export declare function StringPropertyField({ widgetId, disabled, showErrors }: {
2
- widgetId: "text_field" | "multiline" | "markdown" | "email";
2
+ widgetId: "text_field" | "multiline" | "email" | "user_select";
3
3
  disabled: boolean;
4
4
  showErrors: boolean;
5
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@ import { CollectionEditorPermissionsBuilder } from "./types/config_permissions";
4
4
  import { PersistedCollection } from "./types/persisted_collection";
5
5
  import { CollectionInference } from "./types/collection_inference";
6
6
  import { CollectionsConfigController } from "./types/config_controller";
7
- export interface CollectionConfigControllerProps<EC extends PersistedCollection = PersistedCollection, UserType extends User = User> {
7
+ export interface CollectionConfigControllerProps<EC extends PersistedCollection = PersistedCollection, USER extends User = User> {
8
8
  /**
9
9
  * Firebase app where the configuration is saved.
10
10
  */
@@ -12,25 +12,24 @@ export interface CollectionConfigControllerProps<EC extends PersistedCollection
12
12
  /**
13
13
  * Define what actions can be performed on the configuration.
14
14
  */
15
- configPermissions?: CollectionEditorPermissionsBuilder<UserType, EC>;
15
+ configPermissions?: CollectionEditorPermissionsBuilder<USER, EC>;
16
16
  /**
17
17
  * The words you define here will not be allowed to be used as group
18
18
  * names when creating collections.
19
19
  * e.g. ["admin"]
20
20
  */
21
- reservedGroups: string[];
21
+ reservedGroups?: string[];
22
22
  extraView?: {
23
23
  View: React.ComponentType<{
24
24
  path: string;
25
25
  }>;
26
26
  icon: React.ReactNode;
27
27
  };
28
- pathSuggestions?: (path: string) => Promise<string[]>;
29
28
  collectionInference?: CollectionInference;
30
29
  getData?: (path: string, parentPaths: string[]) => Promise<object[]>;
31
- getUser: (uid: string) => UserType | null;
30
+ getUser?: (uid: string) => USER | null;
32
31
  onAnalyticsEvent?: (event: string, params?: object) => void;
33
- introMode?: "new_project" | "existing_project";
32
+ includeIntroView?: boolean;
34
33
  }
35
34
  /**
36
35
  * Use this hook to initialise the Collection Editor plugin.
@@ -39,11 +38,9 @@ export interface CollectionConfigControllerProps<EC extends PersistedCollection
39
38
  * @param configPermissions
40
39
  * @param reservedGroups
41
40
  * @param extraView
42
- * @param pathSuggestions
41
+ * @param getData
43
42
  * @param getUser
44
43
  * @param collectionInference
45
44
  */
46
- export declare function useCollectionEditorPlugin<EC extends PersistedCollection = PersistedCollection, UserType extends User = User>({ collectionConfigController, introMode, configPermissions, reservedGroups, extraView, pathSuggestions, getUser, collectionInference, getData, onAnalyticsEvent }: CollectionConfigControllerProps<EC, UserType>): FireCMSPlugin<any, any, PersistedCollection>;
47
- export declare function IntroWidget({ introMode }: {
48
- introMode?: "new_project" | "existing_project";
49
- }): import("react/jsx-runtime").JSX.Element;
45
+ export declare function useCollectionEditorPlugin<EC extends PersistedCollection = PersistedCollection, USER extends User = User>({ collectionConfigController, configPermissions, reservedGroups, extraView, getUser, collectionInference, getData, onAnalyticsEvent, includeIntroView }: CollectionConfigControllerProps<EC, USER>): FireCMSPlugin<any, any, PersistedCollection>;
46
+ export declare function IntroWidget(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ import { EntityCollection, ModifyCollectionProps } from "@firecms/core";
2
+ import { PersistedCollection } from "../types/persisted_collection";
3
+ /**
4
+ * Function in charge of merging collections defined in code with those stored in the backend.
5
+ */
6
+ export declare const mergeCollections: (baseCollections: EntityCollection[], backendCollections?: PersistedCollection[], modifyCollection?: (props: ModifyCollectionProps) => EntityCollection | void) => EntityCollection<any, any>[];
package/package.json CHANGED
@@ -1,24 +1,26 @@
1
1
  {
2
2
  "name": "@firecms/collection_editor",
3
3
  "type": "module",
4
- "version": "3.0.0-canary.28",
4
+ "version": "3.0.0-canary.280",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",
7
- "types": "dist/index.d.ts",
7
+ "types": "./dist/index.d.ts",
8
8
  "source": "src/index.ts",
9
9
  "dependencies": {
10
- "@firecms/data_import_export": "^3.0.0-canary.28",
11
- "@firecms/formex": "^3.0.0-canary.28",
12
- "@firecms/schema_inference": "^3.0.0-canary.28",
13
- "@firecms/ui": "^3.0.0-canary.28",
10
+ "@firecms/data_export": "^3.0.0-canary.280",
11
+ "@firecms/data_import": "^3.0.0-canary.280",
12
+ "@firecms/data_import_export": "^3.0.0-canary.280",
13
+ "@firecms/formex": "^3.0.0-canary.280",
14
+ "@firecms/schema_inference": "^3.0.0-canary.280",
15
+ "@firecms/ui": "^3.0.0-canary.280",
14
16
  "json5": "^2.2.3",
15
- "prism-react-renderer": "^2.3.1"
17
+ "prism-react-renderer": "^2.4.1"
16
18
  },
17
19
  "peerDependencies": {
18
- "react": "^18.2.0",
19
- "react-dom": "^18.2.0",
20
- "react-router": "^6.22.0",
21
- "react-router-dom": "^6.22.0"
20
+ "react": ">=18.0.0",
21
+ "react-dom": ">=18.0.0",
22
+ "react-router": "^6.28.0",
23
+ "react-router-dom": "^6.28.0"
22
24
  },
23
25
  "exports": {
24
26
  ".": {
@@ -34,12 +36,6 @@
34
36
  "build": "vite build && tsc --emitDeclarationOnly -p tsconfig.prod.json",
35
37
  "clean": "rm -rf dist && find ./src -name '*.js' -type f | xargs rm -f"
36
38
  },
37
- "eslintConfig": {
38
- "extends": [
39
- "react-app",
40
- "react-app/jest"
41
- ]
42
- },
43
39
  "browserslist": {
44
40
  "production": [
45
41
  ">0.2%",
@@ -53,26 +49,18 @@
53
49
  ]
54
50
  },
55
51
  "devDependencies": {
56
- "@jest/globals": "^29.7.0",
57
- "@types/react": "^18.2.67",
58
- "@types/react-dom": "^18.2.22",
59
- "@typescript-eslint/eslint-plugin": "^7.3.1",
60
- "@typescript-eslint/parser": "^7.3.1",
61
- "@vitejs/plugin-react": "^4.2.1",
62
- "eslint": "^8.57.0",
63
- "eslint-config-standard": "^17.1.0",
64
- "eslint-plugin-import": "^2.29.1",
65
- "eslint-plugin-n": "^16.6.2",
66
- "eslint-plugin-promise": "^6.1.1",
67
- "eslint-plugin-react": "^7.34.1",
68
- "eslint-plugin-react-hooks": "^4.6.0",
52
+ "@jest/globals": "^30.1.2",
53
+ "@types/react": "^18.3.24",
54
+ "@types/react-dom": "^18.3.7",
55
+ "@vitejs/plugin-react": "^4.7.0",
56
+ "babel-plugin-react-compiler": "^19.0.0-beta-af1b7da-20250417",
57
+ "eslint-plugin-react-compiler": "^19.0.0-beta-af1b7da-20250417",
69
58
  "jest": "^29.7.0",
70
- "react-router": "^6.22.0",
71
- "react-router-dom": "^6.22.0",
72
- "ts-jest": "^29.1.2",
73
- "typescript": "^5.4.2",
74
- "vite": "^5.2.3",
75
- "vite-plugin-fonts": "^0.7.0"
59
+ "react-router": "^6.30.1",
60
+ "react-router-dom": "^6.30.1",
61
+ "ts-jest": "^29.4.3",
62
+ "typescript": "^5.9.2",
63
+ "vite": "^7.1.6"
76
64
  },
77
65
  "files": [
78
66
  "dist",
@@ -81,5 +69,5 @@
81
69
  "publishConfig": {
82
70
  "access": "public"
83
71
  },
84
- "gitHead": "441a5992df035cea5efef3b618d7f1c665cfe284"
72
+ "gitHead": "4c511808713ad163340dd67cb07f4bbba3d15c56"
85
73
  }