@firecms/collection_editor 3.0.0 → 3.1.0-canary.02232f4

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 (119) hide show
  1. package/dist/ConfigControllerProvider.d.ts +6 -0
  2. package/dist/api/generateCollectionApi.d.ts +71 -0
  3. package/dist/api/index.d.ts +1 -0
  4. package/dist/index.d.ts +5 -1
  5. package/dist/index.es.js +15234 -8138
  6. package/dist/index.es.js.map +1 -1
  7. package/dist/index.umd.js +15199 -8103
  8. package/dist/index.umd.js.map +1 -1
  9. package/dist/locales/de.d.ts +120 -0
  10. package/dist/locales/en.d.ts +120 -0
  11. package/dist/locales/es.d.ts +120 -0
  12. package/dist/locales/fr.d.ts +120 -0
  13. package/dist/locales/hi.d.ts +120 -0
  14. package/dist/locales/it.d.ts +120 -0
  15. package/dist/locales/pt.d.ts +120 -0
  16. package/dist/types/collection_editor_controller.d.ts +14 -0
  17. package/dist/types/collection_inference.d.ts +8 -2
  18. package/dist/types/config_controller.d.ts +31 -1
  19. package/dist/ui/AddKanbanColumnAction.d.ts +11 -0
  20. package/dist/ui/KanbanSetupAction.d.ts +10 -0
  21. package/dist/ui/collection_editor/AICollectionGeneratorPopover.d.ts +37 -0
  22. package/dist/ui/collection_editor/AIModifiedPathsContext.d.ts +20 -0
  23. package/dist/ui/collection_editor/CollectionDetailsForm.d.ts +2 -3
  24. package/dist/ui/collection_editor/CollectionEditorDialog.d.ts +24 -0
  25. package/dist/ui/collection_editor/CollectionEditorWelcomeView.d.ts +4 -1
  26. package/dist/ui/collection_editor/CollectionJsonImportDialog.d.ts +7 -0
  27. package/dist/ui/collection_editor/CollectionYupValidation.d.ts +9 -13
  28. package/dist/ui/collection_editor/DisplaySettingsForm.d.ts +3 -0
  29. package/dist/ui/collection_editor/EntityActionsEditTab.d.ts +2 -1
  30. package/dist/ui/collection_editor/ExtendSettingsForm.d.ts +14 -0
  31. package/dist/ui/collection_editor/GeneralSettingsForm.d.ts +7 -0
  32. package/dist/ui/collection_editor/KanbanConfigSection.d.ts +4 -0
  33. package/dist/ui/collection_editor/PropertyEditView.d.ts +6 -1
  34. package/dist/ui/collection_editor/PropertyTree.d.ts +2 -1
  35. package/dist/ui/collection_editor/SubcollectionsEditTab.d.ts +2 -1
  36. package/dist/ui/collection_editor/ViewModeSwitch.d.ts +6 -0
  37. package/dist/ui/collection_editor/properties/EnumPropertyField.d.ts +2 -1
  38. package/dist/ui/collection_editor/properties/conditions/ConditionsEditor.d.ts +10 -0
  39. package/dist/ui/collection_editor/properties/conditions/ConditionsPanel.d.ts +2 -0
  40. package/dist/ui/collection_editor/properties/conditions/EnumConditionsEditor.d.ts +6 -0
  41. package/dist/ui/collection_editor/properties/conditions/index.d.ts +6 -0
  42. package/dist/ui/collection_editor/properties/conditions/property_paths.d.ts +19 -0
  43. package/dist/useCollectionEditorPlugin.d.ts +7 -1
  44. package/dist/utils/validateCollectionJson.d.ts +22 -0
  45. package/package.json +15 -15
  46. package/src/ConfigControllerProvider.tsx +82 -47
  47. package/src/api/generateCollectionApi.ts +119 -0
  48. package/src/api/index.ts +1 -0
  49. package/src/index.ts +28 -1
  50. package/src/locales/de.ts +125 -0
  51. package/src/locales/en.ts +145 -0
  52. package/src/locales/es.ts +125 -0
  53. package/src/locales/fr.ts +125 -0
  54. package/src/locales/hi.ts +125 -0
  55. package/src/locales/it.ts +125 -0
  56. package/src/locales/pt.ts +125 -0
  57. package/src/types/collection_editor_controller.tsx +16 -3
  58. package/src/types/collection_inference.ts +15 -2
  59. package/src/types/config_controller.tsx +37 -1
  60. package/src/ui/AddKanbanColumnAction.tsx +203 -0
  61. package/src/ui/EditorCollectionAction.tsx +3 -3
  62. package/src/ui/EditorCollectionActionStart.tsx +1 -2
  63. package/src/ui/EditorEntityAction.tsx +3 -2
  64. package/src/ui/HomePageEditorCollectionAction.tsx +41 -13
  65. package/src/ui/KanbanSetupAction.tsx +38 -0
  66. package/src/ui/MissingReferenceWidget.tsx +1 -1
  67. package/src/ui/NewCollectionButton.tsx +4 -2
  68. package/src/ui/NewCollectionCard.tsx +7 -4
  69. package/src/ui/PropertyAddColumnComponent.tsx +4 -3
  70. package/src/ui/collection_editor/AICollectionGeneratorPopover.tsx +243 -0
  71. package/src/ui/collection_editor/AIModifiedPathsContext.tsx +88 -0
  72. package/src/ui/collection_editor/CollectionDetailsForm.tsx +222 -268
  73. package/src/ui/collection_editor/CollectionEditorDialog.tsx +270 -204
  74. package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +138 -71
  75. package/src/ui/collection_editor/CollectionJsonImportDialog.tsx +171 -0
  76. package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +202 -101
  77. package/src/ui/collection_editor/DisplaySettingsForm.tsx +335 -0
  78. package/src/ui/collection_editor/EntityActionsEditTab.tsx +106 -97
  79. package/src/ui/collection_editor/EntityActionsSelectDialog.tsx +8 -10
  80. package/src/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +5 -7
  81. package/src/ui/collection_editor/EnumForm.tsx +153 -102
  82. package/src/ui/collection_editor/ExtendSettingsForm.tsx +94 -0
  83. package/src/ui/collection_editor/GeneralSettingsForm.tsx +335 -0
  84. package/src/ui/collection_editor/GetCodeDialog.tsx +63 -41
  85. package/src/ui/collection_editor/KanbanConfigSection.tsx +209 -0
  86. package/src/ui/collection_editor/LayoutModeSwitch.tsx +27 -43
  87. package/src/ui/collection_editor/PropertyEditView.tsx +272 -199
  88. package/src/ui/collection_editor/PropertyFieldPreview.tsx +1 -1
  89. package/src/ui/collection_editor/PropertyTree.tsx +130 -58
  90. package/src/ui/collection_editor/SubcollectionsEditTab.tsx +169 -163
  91. package/src/ui/collection_editor/UnsavedChangesDialog.tsx +0 -2
  92. package/src/ui/collection_editor/ViewModeSwitch.tsx +43 -0
  93. package/src/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +6 -3
  94. package/src/ui/collection_editor/import/CollectionEditorImportMapping.tsx +5 -2
  95. package/src/ui/collection_editor/properties/BlockPropertyField.tsx +0 -2
  96. package/src/ui/collection_editor/properties/BooleanPropertyField.tsx +4 -1
  97. package/src/ui/collection_editor/properties/CommonPropertyFields.tsx +6 -4
  98. package/src/ui/collection_editor/properties/DateTimePropertyField.tsx +126 -42
  99. package/src/ui/collection_editor/properties/EnumPropertyField.tsx +32 -24
  100. package/src/ui/collection_editor/properties/MapPropertyField.tsx +8 -9
  101. package/src/ui/collection_editor/properties/MarkdownPropertyField.tsx +128 -53
  102. package/src/ui/collection_editor/properties/NumberPropertyField.tsx +3 -1
  103. package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +6 -9
  104. package/src/ui/collection_editor/properties/StoragePropertyField.tsx +65 -49
  105. package/src/ui/collection_editor/properties/StringPropertyField.tsx +3 -1
  106. package/src/ui/collection_editor/properties/UrlPropertyField.tsx +12 -10
  107. package/src/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +23 -4
  108. package/src/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +866 -0
  109. package/src/ui/collection_editor/properties/conditions/ConditionsPanel.tsx +28 -0
  110. package/src/ui/collection_editor/properties/conditions/EnumConditionsEditor.tsx +599 -0
  111. package/src/ui/collection_editor/properties/conditions/index.ts +6 -0
  112. package/src/ui/collection_editor/properties/conditions/property_paths.ts +92 -0
  113. package/src/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +5 -2
  114. package/src/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +7 -5
  115. package/src/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +10 -7
  116. package/src/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +11 -9
  117. package/src/ui/collection_editor/properties/validation/ValidationPanel.tsx +5 -2
  118. package/src/useCollectionEditorPlugin.tsx +53 -22
  119. package/src/utils/validateCollectionJson.ts +380 -0
@@ -0,0 +1,120 @@
1
+ export declare const collectionEditorTranslationsIt: {
2
+ file_upload_config: string;
3
+ file_type_images: string;
4
+ file_type_videos: string;
5
+ file_type_audio: string;
6
+ file_type_applications: string;
7
+ file_type_text: string;
8
+ only: string;
9
+ all_file_types_allowed: string;
10
+ allowed_file_types: string;
11
+ file_name_label: string;
12
+ storage_path_label: string;
13
+ storage_placeholders_description: string;
14
+ storage_placeholder_file: string;
15
+ storage_placeholder_file_name: string;
16
+ storage_placeholder_file_ext: string;
17
+ storage_placeholder_entity_id: string;
18
+ storage_placeholder_property_key: string;
19
+ storage_placeholder_path: string;
20
+ storage_placeholder_rand: string;
21
+ include_bucket_url: string;
22
+ include_bucket_url_description: string;
23
+ save_url_instead_of_path: string;
24
+ save_url_description: string;
25
+ max_size_bytes: string;
26
+ image_resize_configuration: string;
27
+ image_resize_description: string;
28
+ max_width_px: string;
29
+ max_height_px: string;
30
+ resize_mode: string;
31
+ resize_contain: string;
32
+ resize_contain_description: string;
33
+ resize_cover: string;
34
+ resize_cover_description: string;
35
+ output_format: string;
36
+ format_original: string;
37
+ format_original_description: string;
38
+ format_webp_description: string;
39
+ quality_label: string;
40
+ quality_hint: string;
41
+ preview_type: string;
42
+ preview_image: string;
43
+ preview_video: string;
44
+ preview_audio: string;
45
+ display_url: string;
46
+ default_value_not_set: string;
47
+ default_value_is: string;
48
+ default_value_was_cleared: string;
49
+ enum_missing_values: string;
50
+ mode_label: string;
51
+ date_time_mode: string;
52
+ date_mode: string;
53
+ automatic_value: string;
54
+ auto_on_create: string;
55
+ auto_on_update: string;
56
+ auto_none: string;
57
+ auto_value_description: string;
58
+ timezone_label: string;
59
+ local_timezone: string;
60
+ timezone_description: string;
61
+ target_collection: string;
62
+ views_group: string;
63
+ add_property_to: string;
64
+ add_first_property_to_group: string;
65
+ spread_children_as_columns: string;
66
+ spread_children_description: string;
67
+ paste_behavior: string;
68
+ strip_html_on_paste: string;
69
+ strip_html_description: string;
70
+ convert_pasted_to_markdown: string;
71
+ convert_pasted_description: string;
72
+ markdown_url_note: string;
73
+ hide_from_collection: string;
74
+ hide_from_collection_tooltip: string;
75
+ read_only: string;
76
+ read_only_tooltip: string;
77
+ nullable: string;
78
+ nullable_tooltip: string;
79
+ tab_general: string;
80
+ tab_display: string;
81
+ tab_properties: string;
82
+ tab_extend: string;
83
+ unsaved_changes_in_collection: string;
84
+ error_persisting_collection: string;
85
+ details_in_console: string;
86
+ error_inferring_collection: string;
87
+ collection_deleted: string;
88
+ data_imported_successfully_msg: string;
89
+ must_specify_path: string;
90
+ collection_path_already_exists: string;
91
+ collection_path_odd_segments: string;
92
+ collection_uses_path_as_id: string;
93
+ collection_uses_this_id: string;
94
+ delete_stored_config: string;
95
+ delete_stored_config_body: string;
96
+ order_label: string;
97
+ select_property_to_edit: string;
98
+ add_first_property: string;
99
+ add_new_property: string;
100
+ no_permission_add_properties: string;
101
+ get_code_for_collection: string;
102
+ add_properties_from_data: string;
103
+ collection_name_placeholder: string;
104
+ created_by: string;
105
+ property_defined_as_builder: string;
106
+ extend_title: string;
107
+ extend_description: string;
108
+ collection_defined_in_code: string;
109
+ reset_to_code: string;
110
+ widget_group_text: string;
111
+ widget_group_boolean: string;
112
+ widget_group_users: string;
113
+ widget_group_select: string;
114
+ widget_group_number: string;
115
+ widget_group_file: string;
116
+ widget_group_reference: string;
117
+ widget_group_date: string;
118
+ widget_group_group: string;
119
+ widget_group_array: string;
120
+ };
@@ -0,0 +1,120 @@
1
+ export declare const collectionEditorTranslationsPt: {
2
+ file_upload_config: string;
3
+ file_type_images: string;
4
+ file_type_videos: string;
5
+ file_type_audio: string;
6
+ file_type_applications: string;
7
+ file_type_text: string;
8
+ only: string;
9
+ all_file_types_allowed: string;
10
+ allowed_file_types: string;
11
+ file_name_label: string;
12
+ storage_path_label: string;
13
+ storage_placeholders_description: string;
14
+ storage_placeholder_file: string;
15
+ storage_placeholder_file_name: string;
16
+ storage_placeholder_file_ext: string;
17
+ storage_placeholder_entity_id: string;
18
+ storage_placeholder_property_key: string;
19
+ storage_placeholder_path: string;
20
+ storage_placeholder_rand: string;
21
+ include_bucket_url: string;
22
+ include_bucket_url_description: string;
23
+ save_url_instead_of_path: string;
24
+ save_url_description: string;
25
+ max_size_bytes: string;
26
+ image_resize_configuration: string;
27
+ image_resize_description: string;
28
+ max_width_px: string;
29
+ max_height_px: string;
30
+ resize_mode: string;
31
+ resize_contain: string;
32
+ resize_contain_description: string;
33
+ resize_cover: string;
34
+ resize_cover_description: string;
35
+ output_format: string;
36
+ format_original: string;
37
+ format_original_description: string;
38
+ format_webp_description: string;
39
+ quality_label: string;
40
+ quality_hint: string;
41
+ preview_type: string;
42
+ preview_image: string;
43
+ preview_video: string;
44
+ preview_audio: string;
45
+ display_url: string;
46
+ default_value_not_set: string;
47
+ default_value_is: string;
48
+ default_value_was_cleared: string;
49
+ enum_missing_values: string;
50
+ mode_label: string;
51
+ date_time_mode: string;
52
+ date_mode: string;
53
+ automatic_value: string;
54
+ auto_on_create: string;
55
+ auto_on_update: string;
56
+ auto_none: string;
57
+ auto_value_description: string;
58
+ timezone_label: string;
59
+ local_timezone: string;
60
+ timezone_description: string;
61
+ target_collection: string;
62
+ views_group: string;
63
+ add_property_to: string;
64
+ add_first_property_to_group: string;
65
+ spread_children_as_columns: string;
66
+ spread_children_description: string;
67
+ paste_behavior: string;
68
+ strip_html_on_paste: string;
69
+ strip_html_description: string;
70
+ convert_pasted_to_markdown: string;
71
+ convert_pasted_description: string;
72
+ markdown_url_note: string;
73
+ hide_from_collection: string;
74
+ hide_from_collection_tooltip: string;
75
+ read_only: string;
76
+ read_only_tooltip: string;
77
+ nullable: string;
78
+ nullable_tooltip: string;
79
+ tab_general: string;
80
+ tab_display: string;
81
+ tab_properties: string;
82
+ tab_extend: string;
83
+ unsaved_changes_in_collection: string;
84
+ error_persisting_collection: string;
85
+ details_in_console: string;
86
+ error_inferring_collection: string;
87
+ collection_deleted: string;
88
+ data_imported_successfully_msg: string;
89
+ must_specify_path: string;
90
+ collection_path_already_exists: string;
91
+ collection_path_odd_segments: string;
92
+ collection_uses_path_as_id: string;
93
+ collection_uses_this_id: string;
94
+ delete_stored_config: string;
95
+ delete_stored_config_body: string;
96
+ order_label: string;
97
+ select_property_to_edit: string;
98
+ add_first_property: string;
99
+ add_new_property: string;
100
+ no_permission_add_properties: string;
101
+ get_code_for_collection: string;
102
+ add_properties_from_data: string;
103
+ collection_name_placeholder: string;
104
+ created_by: string;
105
+ property_defined_as_builder: string;
106
+ extend_title: string;
107
+ extend_description: string;
108
+ collection_defined_in_code: string;
109
+ reset_to_code: string;
110
+ widget_group_text: string;
111
+ widget_group_boolean: string;
112
+ widget_group_users: string;
113
+ widget_group_select: string;
114
+ widget_group_number: string;
115
+ widget_group_file: string;
116
+ widget_group_reference: string;
117
+ widget_group_date: string;
118
+ widget_group_group: string;
119
+ widget_group_array: string;
120
+ };
@@ -12,13 +12,27 @@ export interface CollectionEditorController {
12
12
  parentCollectionIds: string[];
13
13
  parentCollection?: PersistedCollection;
14
14
  existingEntities?: Entity<any>[];
15
+ /**
16
+ * Initial view to open: "general", "display", or "properties"
17
+ */
18
+ initialView?: "general" | "display" | "properties";
19
+ /**
20
+ * If true, expand the Kanban configuration section
21
+ */
22
+ expandKanban?: boolean;
15
23
  }) => void;
16
24
  createCollection: (props: {
17
25
  initialValues?: {
18
26
  group?: string;
19
27
  path?: string;
20
28
  name?: string;
29
+ databaseId?: string;
21
30
  };
31
+ /**
32
+ * A collection to duplicate from. If provided, the new collection will be
33
+ * pre-populated with the same properties (but with empty name, path, and id).
34
+ */
35
+ copyFrom?: PersistedCollection;
22
36
  parentCollectionIds: string[];
23
37
  parentCollection?: PersistedCollection;
24
38
  redirect: boolean;
@@ -1,5 +1,11 @@
1
- import { EntityCollection } from "@firecms/core";
1
+ import { EntityCollection, FilterValues } from "@firecms/core";
2
2
  /**
3
3
  * This function is used to infer the configuration of a collection given its path.
4
+ * @param path - The path of the collection
5
+ * @param collectionGroup - Whether this is a collection group query
6
+ * @param parentCollectionPaths - Array of parent collection paths for subcollections
7
+ * @param databaseId - Optional database ID for multi-database setups
8
+ * @param initialFilter - Optional filter values from the collection configuration
9
+ * @param initialSort - Optional sort configuration from the collection
4
10
  */
5
- export type CollectionInference = (path: string, collectionGroup: boolean, parentCollectionPaths: string[], databaseId?: string) => Promise<Partial<EntityCollection> | null>;
11
+ export type CollectionInference = (path: string, collectionGroup: boolean, parentCollectionPaths: string[], databaseId?: string, initialFilter?: FilterValues<string>, initialSort?: [string, "asc" | "desc"]) => Promise<Partial<EntityCollection> | null>;
@@ -1,5 +1,9 @@
1
- import { CMSType, NavigationGroupMapping, Property } from "@firecms/core";
1
+ import { CMSType, EntityCollection, NavigationGroupMapping, Property } from "@firecms/core";
2
2
  import { PersistedCollection } from "./persisted_collection";
3
+ export interface CollectionsSetupInfo {
4
+ status: "ongoing" | "complete" | "error";
5
+ error: string | null;
6
+ }
3
7
  /**
4
8
  * Use this controller to access the configuration that is stored externally,
5
9
  * and not defined in code.
@@ -7,6 +11,11 @@ import { PersistedCollection } from "./persisted_collection";
7
11
  export interface CollectionsConfigController {
8
12
  loading: boolean;
9
13
  collections?: PersistedCollection[];
14
+ /**
15
+ * Status information about the automatic collections setup process.
16
+ * Stored in the project config document at `collectionsSetup`.
17
+ */
18
+ collectionsSetup?: CollectionsSetupInfo;
10
19
  getCollection: (id: string) => PersistedCollection;
11
20
  saveCollection: <M extends {
12
21
  [Key: string]: CMSType;
@@ -17,6 +26,14 @@ export interface CollectionsConfigController {
17
26
  saveProperty: (params: SavePropertyParams) => Promise<void>;
18
27
  deleteProperty: (params: DeletePropertyParams) => Promise<void>;
19
28
  deleteCollection: (props: DeleteCollectionParams) => Promise<void>;
29
+ /**
30
+ * Update the properties order of a collection (used for column reordering).
31
+ */
32
+ updatePropertiesOrder: (params: UpdatePropertiesOrderParams) => Promise<void>;
33
+ /**
34
+ * Update the Kanban columns order for a collection.
35
+ */
36
+ updateKanbanColumnsOrder: (params: UpdateKanbanColumnsOrderParams) => Promise<void>;
20
37
  navigationEntries: NavigationGroupMapping[];
21
38
  saveNavigationEntries: (entries: NavigationGroupMapping[]) => Promise<void>;
22
39
  }
@@ -51,3 +68,16 @@ export type DeleteCollectionParams = {
51
68
  id: string;
52
69
  parentCollectionIds?: string[];
53
70
  };
71
+ export type UpdatePropertiesOrderParams = {
72
+ fullPath: string;
73
+ parentCollectionIds: string[];
74
+ collection: EntityCollection<any>;
75
+ newPropertiesOrder: string[];
76
+ };
77
+ export type UpdateKanbanColumnsOrderParams = {
78
+ fullPath: string;
79
+ parentCollectionIds: string[];
80
+ collection: EntityCollection<any>;
81
+ kanbanColumnProperty: string;
82
+ newColumnsOrder: string[];
83
+ };
@@ -0,0 +1,11 @@
1
+ import { EntityCollection } from "@firecms/core";
2
+ /**
3
+ * Component rendered at the end of the Kanban board to add new columns (enum values).
4
+ * Opens a dialog to input a new enum value for the column property.
5
+ */
6
+ export declare function AddKanbanColumnAction({ collection, fullPath, parentCollectionIds, columnProperty }: {
7
+ collection: EntityCollection;
8
+ fullPath: string;
9
+ parentCollectionIds: string[];
10
+ columnProperty: string;
11
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { EntityCollection } from "@firecms/core";
2
+ /**
3
+ * Component rendered when Kanban view is missing orderProperty configuration.
4
+ * Provides a CTA button to open the collection editor to configure Kanban.
5
+ */
6
+ export declare function KanbanSetupAction({ collection, fullPath, parentCollectionIds }: {
7
+ collection: EntityCollection;
8
+ fullPath: string;
9
+ parentCollectionIds: string[];
10
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+ import { EntityCollection } from "@firecms/core";
3
+ import { CollectionGenerationCallback, CollectionOperation } from "../../api/generateCollectionApi";
4
+ import { PersistedCollection } from "../../types/persisted_collection";
5
+ export interface AICollectionGeneratorPopoverProps {
6
+ /**
7
+ * Current collection being edited (if modifying an existing collection)
8
+ */
9
+ existingCollection?: PersistedCollection;
10
+ /**
11
+ * Callback when a collection is generated or modified.
12
+ * Includes the collection and optionally the operations that were applied.
13
+ */
14
+ onGenerated: (collection: EntityCollection, operations?: CollectionOperation[]) => void;
15
+ /**
16
+ * Callback function for generating/modifying collections.
17
+ * The plugin is API-agnostic - the consumer provides the implementation.
18
+ */
19
+ generateCollection: CollectionGenerationCallback;
20
+ /**
21
+ * Optional custom trigger button. If not provided, a default AI button is used.
22
+ */
23
+ trigger?: React.ReactNode;
24
+ /**
25
+ * Size of the button
26
+ */
27
+ size?: "small" | "medium" | "large";
28
+ /**
29
+ * Whether to show the label text
30
+ */
31
+ showLabel?: boolean;
32
+ /**
33
+ * Optional analytics callback
34
+ */
35
+ onAnalyticsEvent?: (event: string, params?: object) => void;
36
+ }
37
+ export declare function AICollectionGeneratorPopover({ existingCollection, onGenerated, generateCollection, trigger, size, showLabel, onAnalyticsEvent }: AICollectionGeneratorPopoverProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { CollectionOperation } from "../../api/generateCollectionApi";
3
+ export interface AIModifiedPathsContextType {
4
+ /** Set of paths that were modified by AI */
5
+ modifiedPaths: Set<string>;
6
+ /** Counter that increments each time AI modifies the collection - use in keys to force remount */
7
+ generationCounter: number;
8
+ /** Add paths from operations */
9
+ addModifiedPaths: (operations: CollectionOperation[]) => void;
10
+ /** Clear a specific path (when user edits that field) */
11
+ clearPath: (path: string) => void;
12
+ /** Clear all paths (on save or cancel) */
13
+ clearAllPaths: () => void;
14
+ /** Check if a path is modified */
15
+ isPathModified: (path: string) => boolean;
16
+ }
17
+ export declare function AIModifiedPathsProvider({ children }: {
18
+ children: React.ReactNode;
19
+ }): import("react/jsx-runtime").JSX.Element;
20
+ export declare function useAIModifiedPaths(): AIModifiedPathsContextType | null;
@@ -1,6 +1,5 @@
1
- import React from "react";
2
1
  import { EntityCollection } from "@firecms/core";
3
- export declare function CollectionDetailsForm({ isNewCollection, reservedGroups, existingPaths, existingIds, groups, parentCollection, children }: {
2
+ export declare function CollectionDetailsForm({ isNewCollection, reservedGroups, existingPaths, existingIds, groups, parentCollection, expandKanban }: {
4
3
  isNewCollection: boolean;
5
4
  reservedGroups?: string[];
6
5
  existingPaths?: string[];
@@ -8,5 +7,5 @@ export declare function CollectionDetailsForm({ isNewCollection, reservedGroups,
8
7
  groups: string[] | null;
9
8
  parentCollection?: EntityCollection;
10
9
  parentCollectionIds?: string[];
11
- children?: React.ReactNode;
10
+ expandKanban?: boolean;
12
11
  }): import("react/jsx-runtime").JSX.Element;
@@ -3,6 +3,7 @@ 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";
6
+ import { CollectionGenerationCallback } from "../../api/generateCollectionApi";
6
7
  export interface CollectionEditorDialogProps {
7
8
  open: boolean;
8
9
  isNewCollection: boolean;
@@ -11,6 +12,11 @@ export interface CollectionEditorDialogProps {
11
12
  path?: string;
12
13
  name?: string;
13
14
  };
15
+ /**
16
+ * A collection to duplicate from. If provided, the new collection will be
17
+ * pre-populated with the same properties (but with empty name, path, and id).
18
+ */
19
+ copyFrom?: PersistedCollection;
14
20
  editedCollectionId?: string;
15
21
  fullPath?: string;
16
22
  parentCollectionIds?: string[];
@@ -28,6 +34,24 @@ export interface CollectionEditorDialogProps {
28
34
  getData?: (path: string, parentPaths: string[]) => Promise<object[]>;
29
35
  parentCollection?: PersistedCollection;
30
36
  existingEntities?: Entity<any>[];
37
+ /**
38
+ * Initial view to open when editing: "general", "display", or "properties".
39
+ * For new collections, this is ignored.
40
+ */
41
+ initialView?: "general" | "display" | "properties";
42
+ /**
43
+ * If true, auto-expand the Kanban configuration section.
44
+ */
45
+ expandKanban?: boolean;
46
+ /**
47
+ * Callback function for generating/modifying collections.
48
+ * The plugin is API-agnostic - the consumer provides the implementation.
49
+ */
50
+ generateCollection?: CollectionGenerationCallback;
51
+ /**
52
+ * Optional analytics callback
53
+ */
54
+ onAnalyticsEvent?: (event: string, params?: object) => void;
31
55
  }
32
56
  export declare function CollectionEditorDialog(props: CollectionEditorDialogProps): import("react/jsx-runtime").JSX.Element;
33
57
  export declare function CollectionEditor(props: CollectionEditorDialogProps & {
@@ -1,10 +1,13 @@
1
1
  import React from "react";
2
2
  import { EntityCollection } from "@firecms/core";
3
- export declare function CollectionEditorWelcomeView({ path, parentCollection, onContinue, existingCollectionPaths }: {
3
+ import { CollectionGenerationCallback } from "../../api/generateCollectionApi";
4
+ export declare function CollectionEditorWelcomeView({ path, parentCollection, onContinue, existingCollectionPaths, generateCollection, onAnalyticsEvent }: {
4
5
  path: string;
5
6
  parentCollection?: EntityCollection;
6
7
  onContinue: (importData?: object[], propertiesOrder?: string[]) => void;
7
8
  existingCollectionPaths?: string[];
9
+ generateCollection?: CollectionGenerationCallback;
10
+ onAnalyticsEvent?: (event: string, params?: object) => void;
8
11
  }): import("react/jsx-runtime").JSX.Element;
9
12
  export declare function TemplateButton({ title, subtitle, icon, onClick }: {
10
13
  title: string;
@@ -0,0 +1,7 @@
1
+ import { EntityCollection } from "@firecms/core";
2
+ export interface CollectionJsonImportDialogProps {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ onImport: (collection: EntityCollection) => void;
6
+ }
7
+ export declare function CollectionJsonImportDialog({ open, onClose, onImport }: CollectionJsonImportDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,10 @@
1
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
- }>>>;
2
+ export declare const YupSchema: Yup.ObjectSchema<{
3
+ id: string;
4
+ name: string;
5
+ path: string;
6
+ }, Yup.AnyObject, {
7
+ id: undefined;
8
+ name: undefined;
9
+ path: undefined;
10
+ }, "">;
@@ -0,0 +1,3 @@
1
+ export declare function DisplaySettingsForm({ expandKanban }: {
2
+ expandKanban?: boolean;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { PersistedCollection } from "../../types/persisted_collection";
2
- export declare function EntityActionsEditTab({ collection, }: {
2
+ export declare function EntityActionsEditTab({ collection, embedded }: {
3
3
  collection: PersistedCollection;
4
+ embedded?: boolean;
4
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { EntityCollection, User } from "@firecms/core";
2
+ import { CollectionsConfigController } from "../../types/config_controller";
3
+ import { CollectionInference } from "../../types/collection_inference";
4
+ import { PersistedCollection } from "../../types/persisted_collection";
5
+ export declare function ExtendSettingsForm({ collection, parentCollection, configController, collectionInference, getUser, parentCollectionIds, isMergedCollection, onResetToCode }: {
6
+ collection: PersistedCollection;
7
+ parentCollection?: EntityCollection;
8
+ configController: CollectionsConfigController;
9
+ collectionInference?: CollectionInference;
10
+ getUser?: (uid: string) => User | null;
11
+ parentCollectionIds?: string[];
12
+ isMergedCollection?: boolean;
13
+ onResetToCode?: () => void;
14
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { EntityCollection } from "@firecms/core";
2
+ export declare function GeneralSettingsForm({ isNewCollection, existingPaths, existingIds, parentCollection }: {
3
+ isNewCollection: boolean;
4
+ existingPaths?: string[];
5
+ existingIds?: string[];
6
+ parentCollection?: EntityCollection;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare function KanbanConfigSection({ className, forceExpanded }: {
2
+ className?: string;
3
+ forceExpanded?: boolean;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { FormexController } from "@firecms/formex";
3
- import { Property, PropertyConfig } from "@firecms/core";
3
+ import { Properties, Property, PropertyConfig } from "@firecms/core";
4
4
  export type PropertyWithId = Property & {
5
5
  id?: string;
6
6
  };
@@ -32,6 +32,11 @@ export type PropertyFormProps = {
32
32
  getController?: (formex: FormexController<PropertyWithId>) => void;
33
33
  propertyConfigs: Record<string, PropertyConfig>;
34
34
  collectionEditable: boolean;
35
+ /**
36
+ * Collection properties for populating the conditions field selector.
37
+ * Includes nested map properties.
38
+ */
39
+ collectionProperties?: Properties;
35
40
  };
36
41
  export declare const PropertyForm: React.NamedExoticComponent<PropertyFormProps>;
37
42
  export declare function PropertyFormDialog({ open, onCancel, onOkClicked, onPropertyChanged, getData, collectionEditable, ...formProps }: PropertyFormProps & {
@@ -16,7 +16,7 @@ export declare const PropertyTree: React.MemoExoticComponent<(<M extends {
16
16
  inferredPropertyKeys?: string[];
17
17
  collectionEditable: boolean;
18
18
  }) => import("react/jsx-runtime").JSX.Element)>;
19
- export declare function PropertyTreeEntry({ id, propertyKey, namespace, propertyOrBuilder, additionalField, selectedPropertyKey, errors, onPropertyClick, onPropertyMove, onPropertyRemove, inferredPropertyKeys, collectionEditable }: {
19
+ export declare function PropertyTreeEntry({ id, propertyKey, namespace, propertyOrBuilder, additionalField, selectedPropertyKey, errors, propertiesOrder, onPropertyClick, onPropertyMove, onPropertyRemove, inferredPropertyKeys, collectionEditable }: {
20
20
  id: string;
21
21
  propertyKey: string;
22
22
  namespace?: string;
@@ -24,6 +24,7 @@ export declare function PropertyTreeEntry({ id, propertyKey, namespace, property
24
24
  additionalField?: AdditionalFieldDelegate<any>;
25
25
  selectedPropertyKey?: string;
26
26
  errors: Record<string, any>;
27
+ propertiesOrder: string[];
27
28
  onPropertyClick?: (propertyKey: string, namespace?: string) => void;
28
29
  onPropertyMove?: (propertiesOrder: string[], namespace?: string) => void;
29
30
  onPropertyRemove?: (propertyKey: string, namespace?: string) => void;
@@ -2,11 +2,12 @@ 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, parentCollectionIds }: {
5
+ export declare function SubcollectionsEditTab({ collection, parentCollection, configController, collectionInference, getUser, parentCollectionIds, embedded }: {
6
6
  collection: PersistedCollection;
7
7
  parentCollection?: EntityCollection;
8
8
  configController: CollectionsConfigController;
9
9
  collectionInference?: CollectionInference;
10
10
  getUser?: (uid: string) => User | null;
11
11
  parentCollectionIds?: string[];
12
+ embedded?: boolean;
12
13
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ViewMode } from "@firecms/core";
2
+ export declare function ViewModeSwitch({ value, onChange, className }: {
3
+ value: ViewMode;
4
+ onChange: (value: ViewMode) => void;
5
+ className?: string;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,9 @@
1
- export declare function EnumPropertyField({ multiselect, updateIds, disabled, showErrors, allowDataInference, getData }: {
1
+ export declare function EnumPropertyField({ multiselect, updateIds, disabled, showErrors, allowDataInference, getData, propertyNamespace }: {
2
2
  multiselect: boolean;
3
3
  updateIds: boolean;
4
4
  disabled: boolean;
5
5
  showErrors: boolean;
6
6
  allowDataInference?: boolean;
7
7
  getData?: () => Promise<object[]>;
8
+ propertyNamespace?: string;
8
9
  }): import("react/jsx-runtime").JSX.Element;