@firecms/core 3.0.0-canary.7 → 3.0.0-canary.71
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.
- package/README.md +2 -2
- package/dist/app/AppBar.d.ts +12 -0
- package/dist/app/Drawer.d.ts +17 -0
- package/dist/app/Scaffold.d.ts +30 -0
- package/dist/app/index.d.ts +4 -0
- package/dist/app/useApp.d.ts +16 -0
- package/dist/components/ClearFilterSortButton.d.ts +5 -0
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +11 -11
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -2
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +5 -3
- package/dist/components/EntityCollectionTable/PropertyTableCell.d.ts +3 -2
- package/dist/components/EntityCollectionTable/column_utils.d.ts +1 -2
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +2 -0
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +1 -4
- package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +2 -2
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +12 -3
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +11 -0
- package/dist/components/EntityCollectionView/useSelectionController.d.ts +2 -0
- package/dist/components/EntityPreview.d.ts +26 -7
- package/dist/components/EntityView.d.ts +11 -0
- package/dist/components/FieldCaption.d.ts +5 -0
- package/dist/components/HomePage/NavigationCard.d.ts +8 -0
- package/dist/components/HomePage/{NavigationCollectionCard.d.ts → NavigationCardBinding.d.ts} +2 -2
- package/dist/components/HomePage/SmallNavigationCard.d.ts +6 -0
- package/dist/components/HomePage/index.d.ts +3 -1
- package/dist/components/ReferenceWidget.d.ts +3 -1
- package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -1
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +6 -7
- package/dist/components/VirtualTable/types.d.ts +3 -3
- package/dist/components/{EntityCollectionTable/internal → common}/default_entity_actions.d.ts +1 -1
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/common/table_height.d.ts +5 -0
- package/dist/components/common/types.d.ts +4 -6
- package/dist/components/common/useDataSourceEntityCollectionTableController.d.ts +3 -0
- package/dist/components/index.d.ts +6 -3
- package/dist/contexts/AuthControllerContext.d.ts +1 -1
- package/dist/{components/FireCMSAppBar.d.ts → core/DefaultAppBar.d.ts} +5 -8
- package/dist/core/DefaultDrawer.d.ts +19 -0
- package/dist/core/DrawerNavigationItem.d.ts +9 -0
- package/dist/core/EntityEditView.d.ts +36 -0
- package/dist/core/NavigationRoutes.d.ts +2 -2
- package/dist/core/index.d.ts +3 -4
- package/dist/form/PropertiesForm.d.ts +8 -0
- package/dist/form/components/ErrorFocus.d.ts +1 -1
- package/dist/form/components/FieldHelperText.d.ts +3 -3
- package/dist/form/components/StorageItemPreview.d.ts +2 -3
- package/dist/form/components/StorageUploadProgress.d.ts +1 -1
- package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +3 -4
- package/dist/form/field_bindings/TextFieldBinding.d.ts +2 -2
- package/dist/form/index.d.ts +0 -2
- package/dist/form/validation.d.ts +1 -1
- package/dist/hooks/data/delete.d.ts +2 -2
- package/dist/hooks/data/save.d.ts +2 -3
- package/dist/hooks/data/useDataSource.d.ts +2 -2
- package/dist/hooks/data/useEntityFetch.d.ts +3 -3
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useBuildNavigationController.d.ts +6 -4
- package/dist/hooks/useProjectLog.d.ts +6 -2
- package/dist/hooks/useStorageSource.d.ts +2 -2
- package/dist/hooks/useValidateAuthenticator.d.ts +21 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +10507 -9993
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/internal/useBuildDataSource.d.ts +1 -16
- package/dist/preview/PropertyPreview.d.ts +1 -1
- package/dist/preview/PropertyPreviewProps.d.ts +1 -4
- package/dist/preview/components/BooleanPreview.d.ts +5 -1
- package/dist/preview/components/EnumValuesChip.d.ts +1 -1
- package/dist/preview/components/ReferencePreview.d.ts +3 -8
- package/dist/types/analytics.d.ts +1 -1
- package/dist/types/auth.d.ts +37 -1
- package/dist/types/collections.d.ts +44 -6
- package/dist/types/datasource.d.ts +21 -14
- package/dist/types/entities.d.ts +5 -1
- package/dist/types/entity_actions.d.ts +14 -0
- package/dist/types/entity_callbacks.d.ts +2 -2
- package/dist/types/entity_overrides.d.ts +6 -0
- package/dist/types/fields.d.ts +31 -30
- package/dist/types/index.d.ts +2 -1
- package/dist/types/navigation.d.ts +15 -14
- package/dist/types/permissions.d.ts +5 -1
- package/dist/types/plugins.d.ts +22 -22
- package/dist/types/properties.d.ts +13 -5
- package/dist/types/property_config.d.ts +2 -2
- package/dist/types/roles.d.ts +31 -0
- package/dist/types/storage.d.ts +11 -3
- package/dist/types/user.d.ts +5 -0
- package/dist/util/collections.d.ts +9 -1
- package/dist/util/entities.d.ts +1 -1
- package/dist/util/icon_synonyms.d.ts +1 -97
- package/dist/util/icons.d.ts +8 -2
- package/dist/util/navigation_utils.d.ts +2 -2
- package/dist/util/objects.d.ts +1 -1
- package/dist/util/permissions.d.ts +4 -4
- package/dist/util/references.d.ts +4 -2
- package/dist/util/resolutions.d.ts +14 -14
- package/dist/util/storage.d.ts +23 -2
- package/dist/util/useStorageUploadController.d.ts +1 -1
- package/dist/util/useTraceUpdate.d.ts +1 -0
- package/package.json +139 -119
- package/src/app/AppBar.tsx +18 -0
- package/src/app/Drawer.tsx +25 -0
- package/src/app/Scaffold.tsx +249 -0
- package/src/app/index.ts +4 -0
- package/src/app/useApp.tsx +32 -0
- package/src/components/ClearFilterSortButton.tsx +41 -0
- package/src/components/DeleteEntityDialog.tsx +4 -4
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +4 -4
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +276 -279
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +9 -5
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +48 -45
- package/src/components/EntityCollectionTable/column_utils.tsx +3 -3
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +18 -17
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +5 -5
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +29 -34
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +16 -12
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +4 -5
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +75 -74
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +5 -6
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +68 -0
- package/src/components/EntityCollectionView/useSelectionController.tsx +30 -0
- package/src/components/EntityPreview.tsx +209 -70
- package/src/components/EntityView.tsx +84 -0
- package/src/components/FieldCaption.tsx +14 -0
- package/src/components/HomePage/DefaultHomePage.tsx +15 -11
- package/src/components/HomePage/NavigationCard.tsx +69 -0
- package/src/components/HomePage/NavigationCardBinding.tsx +116 -0
- package/src/components/HomePage/SmallNavigationCard.tsx +45 -0
- package/src/components/HomePage/index.tsx +3 -1
- package/src/components/PropertyIdCopyTooltipContent.tsx +2 -3
- package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +4 -4
- package/src/components/ReferenceWidget.tsx +22 -12
- package/src/components/SearchIconsView.tsx +5 -5
- package/src/components/SelectableTable/SelectableTable.tsx +5 -3
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +2 -3
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +23 -8
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +38 -24
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +35 -15
- package/src/components/VirtualTable/VirtualTable.tsx +38 -29
- package/src/components/VirtualTable/VirtualTableHeader.tsx +4 -4
- package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +2 -2
- package/src/components/VirtualTable/VirtualTableProps.tsx +7 -7
- package/src/components/VirtualTable/VirtualTableRow.tsx +4 -5
- package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +1 -1
- package/src/components/VirtualTable/types.tsx +2 -3
- package/src/components/{EntityCollectionTable/internal → common}/default_entity_actions.tsx +11 -7
- package/src/components/common/index.ts +1 -0
- package/src/components/{VirtualTable/common.tsx → common/table_height.tsx} +5 -2
- package/src/components/common/types.tsx +4 -6
- package/src/components/common/useColumnsIds.tsx +10 -2
- package/src/components/common/useDataSourceEntityCollectionTableController.tsx +12 -1
- package/src/components/common/useTableSearchHelper.ts +39 -9
- package/src/components/index.tsx +6 -3
- package/src/contexts/AuthControllerContext.tsx +1 -1
- package/src/{components/FireCMSAppBar.tsx → core/DefaultAppBar.tsx} +51 -34
- package/src/core/DefaultDrawer.tsx +177 -0
- package/src/core/DrawerNavigationItem.tsx +62 -0
- package/src/core/EntityEditView.tsx +1100 -0
- package/src/core/EntitySidePanel.tsx +3 -4
- package/src/core/FireCMS.tsx +54 -43
- package/src/core/NavigationRoutes.tsx +14 -7
- package/src/core/field_configs.tsx +2 -3
- package/src/core/index.tsx +3 -4
- package/src/form/PropertiesForm.tsx +81 -0
- package/src/form/PropertyFieldBinding.tsx +29 -7
- package/src/form/components/FieldHelperText.tsx +3 -3
- package/src/form/components/StorageItemPreview.tsx +5 -7
- package/src/form/components/StorageUploadProgress.tsx +9 -8
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +10 -12
- package/src/form/field_bindings/BlockFieldBinding.tsx +2 -2
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +1 -1
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +19 -19
- package/src/form/field_bindings/MapFieldBinding.tsx +25 -17
- package/src/form/field_bindings/MarkdownFieldBinding.tsx +2 -2
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +2 -9
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +16 -13
- package/src/form/field_bindings/SelectFieldBinding.tsx +3 -3
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +14 -35
- package/src/form/field_bindings/TextFieldBinding.tsx +7 -5
- package/src/form/index.tsx +4 -4
- package/src/form/validation.ts +4 -21
- package/src/hooks/data/delete.ts +3 -3
- package/src/hooks/data/save.ts +4 -2
- package/src/hooks/data/useCollectionFetch.tsx +1 -1
- package/src/hooks/data/useDataSource.tsx +8 -3
- package/src/hooks/data/useEntityFetch.tsx +4 -4
- package/src/hooks/index.tsx +3 -0
- package/src/hooks/useBuildLocalConfigurationPersistence.tsx +8 -10
- package/src/hooks/useBuildModeController.tsx +11 -5
- package/src/hooks/useBuildNavigationController.tsx +200 -83
- package/src/hooks/useProjectLog.tsx +17 -7
- package/src/hooks/useReferenceDialog.tsx +2 -2
- package/src/hooks/useResolvedNavigationFrom.tsx +1 -1
- package/src/hooks/useStorageSource.tsx +7 -2
- package/src/hooks/useValidateAuthenticator.tsx +115 -0
- package/src/index.ts +1 -0
- package/src/internal/useBuildDataSource.ts +54 -47
- package/src/internal/useBuildSideEntityController.tsx +88 -21
- package/src/preview/PropertyPreview.tsx +5 -15
- package/src/preview/PropertyPreviewProps.tsx +1 -11
- package/src/preview/components/BooleanPreview.tsx +19 -4
- package/src/preview/components/EnumValuesChip.tsx +2 -2
- package/src/preview/components/ReferencePreview.tsx +72 -165
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +0 -1
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +2 -1
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +0 -1
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +0 -1
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +2 -3
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +2 -3
- package/src/preview/property_previews/MapPropertyPreview.tsx +5 -5
- package/src/preview/property_previews/StringPropertyPreview.tsx +8 -7
- package/src/types/analytics.ts +1 -0
- package/src/types/auth.tsx +50 -1
- package/src/types/collections.ts +51 -6
- package/src/types/customization_controller.tsx +0 -1
- package/src/types/datasource.ts +24 -17
- package/src/types/entities.ts +9 -1
- package/src/types/entity_actions.tsx +17 -0
- package/src/types/entity_callbacks.ts +2 -2
- package/src/types/entity_overrides.tsx +7 -0
- package/src/types/fields.tsx +33 -33
- package/src/types/firecms.tsx +0 -1
- package/src/types/index.ts +2 -1
- package/src/types/navigation.ts +17 -17
- package/src/types/permissions.ts +6 -1
- package/src/types/plugins.tsx +28 -30
- package/src/types/properties.ts +19 -7
- package/src/types/property_config.tsx +2 -2
- package/src/types/roles.ts +41 -0
- package/src/types/side_entity_controller.tsx +1 -0
- package/src/types/storage.ts +12 -3
- package/src/types/user.ts +7 -0
- package/src/util/collections.ts +22 -0
- package/src/util/entities.ts +2 -1
- package/src/util/enums.ts +1 -1
- package/src/util/icon_list.ts +2 -2
- package/src/util/icon_synonyms.ts +3 -99
- package/src/util/icons.tsx +11 -3
- package/src/util/navigation_utils.ts +6 -6
- package/src/util/objects.ts +8 -21
- package/src/util/permissions.ts +12 -8
- package/src/util/references.ts +36 -5
- package/src/util/resolutions.ts +32 -31
- package/src/util/storage.ts +75 -21
- package/src/util/strings.ts +2 -2
- package/src/util/useStorageUploadController.tsx +21 -3
- package/src/util/useTraceUpdate.tsx +2 -1
- package/dist/components/VirtualTable/common.d.ts +0 -2
- package/dist/core/Drawer.d.ts +0 -23
- package/dist/core/EntityView.d.ts +0 -22
- package/dist/core/Scaffold.d.ts +0 -55
- package/dist/core/SideEntityView.d.ts +0 -7
- package/dist/form/EntityForm.d.ts +0 -77
- package/dist/internal/useBuildCustomizationController.d.ts +0 -2
- package/dist/internal/useLocaleConfig.d.ts +0 -1
- package/dist/types/appcheck.d.ts +0 -26
- package/src/components/HomePage/NavigationCollectionCard.tsx +0 -146
- package/src/core/Drawer.tsx +0 -164
- package/src/core/EntityView.tsx +0 -578
- package/src/core/Scaffold.tsx +0 -281
- package/src/core/SideEntityView.tsx +0 -38
- package/src/form/EntityForm.tsx +0 -720
- package/src/internal/useBuildCustomizationController.tsx +0 -5
- package/src/internal/useLocaleConfig.tsx +0 -18
- package/src/types/appcheck.ts +0 -29
package/src/types/collections.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { EnumValues, PropertiesOrBuilders } from "./properties";
|
|
|
8
8
|
import { FormContext } from "./fields";
|
|
9
9
|
import { EntityAction } from "./entity_actions";
|
|
10
10
|
import { ExportConfig } from "./export_import";
|
|
11
|
+
import { EntityOverrides } from "./entity_overrides";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* This interface represents a view that includes a collection of entities.
|
|
@@ -16,7 +17,7 @@ import { ExportConfig } from "./export_import";
|
|
|
16
17
|
*
|
|
17
18
|
* @group Models
|
|
18
19
|
*/
|
|
19
|
-
export interface EntityCollection<M extends Record<string, any> = any, UserType extends User =
|
|
20
|
+
export interface EntityCollection<M extends Record<string, any> = any, UserType extends User = any> {
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* You can set an alias that will be used internally instead of the `path`.
|
|
@@ -76,6 +77,13 @@ export interface EntityCollection<M extends Record<string, any> = any, UserType
|
|
|
76
77
|
*/
|
|
77
78
|
properties: PropertiesOrBuilders<M>;
|
|
78
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Title property of the entity. This is the property that will be used
|
|
82
|
+
* as the title in entity related views and references.
|
|
83
|
+
* If not specified, the first property simple text property will be used.
|
|
84
|
+
*/
|
|
85
|
+
titleProperty?: keyof M,
|
|
86
|
+
|
|
79
87
|
/**
|
|
80
88
|
* Can this collection be edited by the end user.
|
|
81
89
|
* Defaults to `true`.
|
|
@@ -99,8 +107,12 @@ export interface EntityCollection<M extends Record<string, any> = any, UserType
|
|
|
99
107
|
* `subcollection:`. e.g. `subcollection:orders`.
|
|
100
108
|
* - If you are using a collection group, you will also have an
|
|
101
109
|
* additional `collectionGroupParent` column.
|
|
110
|
+
* You can use this prop to hide some properties from the table view.
|
|
111
|
+
* Note that if you set this prop, other ways to hide fields, like
|
|
112
|
+
* `hidden` in the property definition,will be ignored.
|
|
113
|
+
* `propertiesOrder` has precedence over `hidden`.
|
|
102
114
|
*/
|
|
103
|
-
propertiesOrder?: Extract<keyof M, string>[];
|
|
115
|
+
propertiesOrder?: (Extract<keyof M, string> | `subcollection:${string}`)[];
|
|
104
116
|
|
|
105
117
|
/**
|
|
106
118
|
* If enabled, content is loaded in batches. If `false` all entities in the
|
|
@@ -139,7 +151,7 @@ export interface EntityCollection<M extends Record<string, any> = any, UserType
|
|
|
139
151
|
* is being created, updated or deleted.
|
|
140
152
|
* Useful for adding your own logic or blocking the execution of the operation.
|
|
141
153
|
*/
|
|
142
|
-
callbacks?: EntityCallbacks<M>;
|
|
154
|
+
callbacks?: EntityCallbacks<M, UserType>;
|
|
143
155
|
|
|
144
156
|
/**
|
|
145
157
|
* Builder for rendering additional components such as buttons in the
|
|
@@ -276,6 +288,22 @@ export interface EntityCollection<M extends Record<string, any> = any, UserType
|
|
|
276
288
|
*
|
|
277
289
|
*/
|
|
278
290
|
exportable?: boolean | ExportConfig<UserType>;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* User id of the owner of this collection. This is used only by plugins, or if you
|
|
294
|
+
* are writing custom code
|
|
295
|
+
*/
|
|
296
|
+
ownerId?: string;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Overrides for the entity view, like the data source or the storage source.
|
|
300
|
+
*/
|
|
301
|
+
overrides?: EntityOverrides;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Width of the side dialog (in pixels) when opening an entity in this collection.
|
|
305
|
+
*/
|
|
306
|
+
sideDialogWidth?: number | string;
|
|
279
307
|
}
|
|
280
308
|
|
|
281
309
|
/**
|
|
@@ -346,7 +374,7 @@ export type SelectionController<M extends Record<string, any> = any> = {
|
|
|
346
374
|
|
|
347
375
|
/**
|
|
348
376
|
* Filter conditions in a `Query.where()` clause are specified using the
|
|
349
|
-
* strings
|
|
377
|
+
* strings `<`, `<=`, `==`, `>=`, `>`, `array-contains`, `in`, and `array-contains-any`.
|
|
350
378
|
* @group Models
|
|
351
379
|
*/
|
|
352
380
|
export type WhereFilterOp =
|
|
@@ -436,7 +464,10 @@ export interface AdditionalFieldDelegate<M extends Record<string, any> = any,
|
|
|
436
464
|
* view.
|
|
437
465
|
* @param entity
|
|
438
466
|
*/
|
|
439
|
-
value?: (props: {
|
|
467
|
+
value?: (props: {
|
|
468
|
+
entity: Entity<M>,
|
|
469
|
+
context: FireCMSContext<any>
|
|
470
|
+
}) => string | number | Promise<string | number> | undefined;
|
|
440
471
|
}
|
|
441
472
|
|
|
442
473
|
/**
|
|
@@ -446,8 +477,22 @@ export interface AdditionalFieldDelegate<M extends Record<string, any> = any,
|
|
|
446
477
|
*/
|
|
447
478
|
export type EntityCustomView<M extends Record<string, any> = any> =
|
|
448
479
|
{
|
|
480
|
+
/**
|
|
481
|
+
* Key of this custom view.
|
|
482
|
+
*/
|
|
449
483
|
key: string,
|
|
484
|
+
/**
|
|
485
|
+
* Name of this custom view.
|
|
486
|
+
*/
|
|
450
487
|
name: string,
|
|
488
|
+
/**
|
|
489
|
+
* If set to true, the actions of the entity will be included in the
|
|
490
|
+
* bottom of the panel (save buttons, delete buttons, etc.)
|
|
491
|
+
*/
|
|
492
|
+
includeActions?: boolean;
|
|
493
|
+
/**
|
|
494
|
+
* Builder for rendering the custom view
|
|
495
|
+
*/
|
|
451
496
|
Builder?: React.ComponentType<EntityCustomViewParams<M>>;
|
|
452
497
|
}
|
|
453
498
|
|
|
@@ -508,7 +553,7 @@ export type EntityTableController<M extends Record<string, any> = any> = {
|
|
|
508
553
|
filterValues?: FilterValues<Extract<keyof M, string>>;
|
|
509
554
|
setFilterValues?: (filterValues: FilterValues<Extract<keyof M, string>>) => void;
|
|
510
555
|
sortBy?: [Extract<keyof M, string>, "asc" | "desc"];
|
|
511
|
-
setSortBy?: (sortBy
|
|
556
|
+
setSortBy?: (sortBy?: [Extract<keyof M, string>, "asc" | "desc"]) => void;
|
|
512
557
|
searchString?: string;
|
|
513
558
|
setSearchString?: (searchString?: string) => void;
|
|
514
559
|
clearFilter?: () => void;
|
package/src/types/datasource.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Entity, EntityReference, EntityStatus, EntityValues, GeoPoint } from "./entities";
|
|
2
2
|
import { EntityCollection, FilterValues } from "./collections";
|
|
3
3
|
import { ResolvedEntityCollection } from "./resolved_entities";
|
|
4
|
+
import { FireCMSContext } from "./firecms_context";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* @group Datasource
|
|
@@ -8,7 +9,7 @@ import { ResolvedEntityCollection } from "./resolved_entities";
|
|
|
8
9
|
export interface FetchEntityProps<M extends Record<string, any> = any> {
|
|
9
10
|
path: string;
|
|
10
11
|
entityId: string;
|
|
11
|
-
collection?: EntityCollection<M>
|
|
12
|
+
collection?: EntityCollection<M, any>
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -216,6 +217,19 @@ export interface DataSource {
|
|
|
216
217
|
* @param props
|
|
217
218
|
*/
|
|
218
219
|
isFilterCombinationValid?(props: FilterCombinationValidProps): boolean;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Called when the user clicks on the search bar in a collection view.
|
|
223
|
+
* Useful for initializing a text search index.
|
|
224
|
+
* @param props
|
|
225
|
+
*/
|
|
226
|
+
initTextSearch?: (props: {
|
|
227
|
+
context: FireCMSContext,
|
|
228
|
+
path: string,
|
|
229
|
+
collection: EntityCollection,
|
|
230
|
+
parentCollectionIds?: string[]
|
|
231
|
+
}) => Promise<boolean>;
|
|
232
|
+
|
|
219
233
|
}
|
|
220
234
|
|
|
221
235
|
export type FilterCombinationValidProps = {
|
|
@@ -362,28 +376,21 @@ export interface DataSourceDelegate {
|
|
|
362
376
|
*/
|
|
363
377
|
isFilterCombinationValid?(props: Omit<FilterCombinationValidProps, "collection">): boolean;
|
|
364
378
|
|
|
365
|
-
/**
|
|
366
|
-
* Convert a FireCMS reference to a reference that can be used by the datasource
|
|
367
|
-
* @param reference
|
|
368
|
-
*/
|
|
369
|
-
buildReference: (reference: EntityReference) => any,
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* Convert a FireCMS GeoPoint to a GeoPoint that can be used by the datasource
|
|
373
|
-
* @param geoPoint
|
|
374
|
-
*/
|
|
375
|
-
buildGeoPoint: (geoPoint: GeoPoint) => any,
|
|
376
|
-
|
|
377
379
|
/**
|
|
378
380
|
* Get the object to generate the current time in the datasource
|
|
379
381
|
*/
|
|
380
382
|
currentTime(): any;
|
|
381
383
|
|
|
382
|
-
buildDate: (date: Date) => any;
|
|
383
|
-
|
|
384
|
-
buildDeleteFieldValue: () => any;
|
|
385
|
-
|
|
386
384
|
delegateToCMSModel: (data: any) => any;
|
|
387
385
|
|
|
386
|
+
cmsToDelegateModel: (data: any) => any;
|
|
387
|
+
|
|
388
388
|
setDateToMidnight: (input?: any) => any;
|
|
389
|
+
|
|
390
|
+
initTextSearch?: (props: {
|
|
391
|
+
context: FireCMSContext,
|
|
392
|
+
path: string,
|
|
393
|
+
collection: EntityCollection,
|
|
394
|
+
parentCollectionIds?: string[]
|
|
395
|
+
}) => Promise<boolean>;
|
|
389
396
|
}
|
package/src/types/entities.ts
CHANGED
|
@@ -37,7 +37,7 @@ export type EntityValues<M extends object> = M;
|
|
|
37
37
|
/**
|
|
38
38
|
* Class used to create a reference to an entity in a different path
|
|
39
39
|
*/
|
|
40
|
-
export class EntityReference
|
|
40
|
+
export class EntityReference {
|
|
41
41
|
/**
|
|
42
42
|
* ID of the entity
|
|
43
43
|
*/
|
|
@@ -78,3 +78,11 @@ export class GeoPoint {
|
|
|
78
78
|
this.longitude = longitude;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
+
|
|
82
|
+
export class Vector {
|
|
83
|
+
readonly value: number[];
|
|
84
|
+
|
|
85
|
+
constructor(value: number[]) {
|
|
86
|
+
this.value = value;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -5,9 +5,25 @@ import { EntityCollection, SelectionController } from "./collections";
|
|
|
5
5
|
import { User } from "./user";
|
|
6
6
|
import { SideEntityController } from "./side_entity_controller";
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* An entity action is a custom action that can be performed on an entity.
|
|
10
|
+
* They are displayed in the entity view and in the collection view.
|
|
11
|
+
*/
|
|
8
12
|
export type EntityAction<M extends object = any, UserType extends User = User> = {
|
|
13
|
+
/**
|
|
14
|
+
* Title of the action
|
|
15
|
+
*/
|
|
9
16
|
name: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Icon of the action
|
|
20
|
+
*/
|
|
10
21
|
icon?: React.ReactElement;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Callback when the action is clicked
|
|
25
|
+
* @param props
|
|
26
|
+
*/
|
|
11
27
|
onClick: (props: EntityActionClickProps<M, UserType>) => Promise<void> | void;
|
|
12
28
|
|
|
13
29
|
/**
|
|
@@ -21,6 +37,7 @@ export type EntityAction<M extends object = any, UserType extends User = User> =
|
|
|
21
37
|
* Show this action in the form, defaults to true
|
|
22
38
|
*/
|
|
23
39
|
includeInForm?: boolean;
|
|
40
|
+
|
|
24
41
|
}
|
|
25
42
|
|
|
26
43
|
export type EntityActionClickProps<M extends object, UserType extends User = User> = {
|
|
@@ -78,7 +78,7 @@ export interface EntityOnFetchProps<M extends Record<string, any> = any, UserTyp
|
|
|
78
78
|
/**
|
|
79
79
|
* Collection of the entity
|
|
80
80
|
*/
|
|
81
|
-
collection: EntityCollection<M>;
|
|
81
|
+
collection: EntityCollection<M, UserType>;
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* Full path of the CMS where this collection is being fetched.
|
|
@@ -193,7 +193,7 @@ export interface EntityOnDeleteProps<M extends Record<string, any> = any, UserTy
|
|
|
193
193
|
/**
|
|
194
194
|
* Context of the app status
|
|
195
195
|
*/
|
|
196
|
-
context: FireCMSContext
|
|
196
|
+
context: FireCMSContext<UserType>;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
/**
|
package/src/types/fields.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EntityValues } from "./entities";
|
|
2
1
|
import { CMSType, PropertyOrBuilder } from "./properties";
|
|
3
2
|
import { ResolvedEntityCollection, ResolvedProperty } from "./resolved_entities";
|
|
3
|
+
import { FormexController } from "@firecms/formex";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* When building a custom field you need to create a React component that takes
|
|
@@ -21,11 +21,6 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
|
|
|
21
21
|
*/
|
|
22
22
|
value: T;
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
* Initial value of this field
|
|
26
|
-
*/
|
|
27
|
-
// initialValue: T | undefined;
|
|
28
|
-
|
|
29
24
|
/**
|
|
30
25
|
* Set value of field directly
|
|
31
26
|
*/
|
|
@@ -42,7 +37,7 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
|
|
|
42
37
|
/**
|
|
43
38
|
* Is the form currently submitting
|
|
44
39
|
*/
|
|
45
|
-
isSubmitting
|
|
40
|
+
isSubmitting?: boolean;
|
|
46
41
|
|
|
47
42
|
/**
|
|
48
43
|
* Should this field show the error indicator.
|
|
@@ -50,19 +45,19 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
|
|
|
50
45
|
* filled) but we don't want to show the error until the user has tried
|
|
51
46
|
* saving.
|
|
52
47
|
*/
|
|
53
|
-
showError
|
|
48
|
+
showError?: boolean;
|
|
54
49
|
|
|
55
50
|
/**
|
|
56
51
|
* Is there an error in this field. The error field has the same shape as
|
|
57
52
|
* the field, replacing values with a string containing the error.
|
|
58
53
|
* It takes the value `null` if there is no error
|
|
59
54
|
*/
|
|
60
|
-
error
|
|
55
|
+
error?: any | null;
|
|
61
56
|
|
|
62
57
|
/**
|
|
63
58
|
* Has this field been touched
|
|
64
59
|
*/
|
|
65
|
-
touched
|
|
60
|
+
touched?: boolean;
|
|
66
61
|
|
|
67
62
|
/**
|
|
68
63
|
* Property related to this field
|
|
@@ -72,38 +67,38 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
|
|
|
72
67
|
/**
|
|
73
68
|
* Should this field include a description
|
|
74
69
|
*/
|
|
75
|
-
includeDescription
|
|
70
|
+
includeDescription?: boolean;
|
|
76
71
|
|
|
77
72
|
/**
|
|
78
73
|
* Flag to indicate that the underlying value has been updated in the
|
|
79
74
|
* datasource
|
|
80
75
|
*/
|
|
81
|
-
underlyingValueHasChanged
|
|
76
|
+
underlyingValueHasChanged?: boolean;
|
|
82
77
|
|
|
83
78
|
/**
|
|
84
79
|
* Is this field part of an array
|
|
85
80
|
*/
|
|
86
|
-
partOfArray
|
|
81
|
+
partOfArray?: boolean;
|
|
87
82
|
|
|
88
83
|
/**
|
|
89
84
|
* Is this field part of a block (oneOf array)
|
|
90
85
|
*/
|
|
91
|
-
partOfBlock
|
|
86
|
+
partOfBlock?: boolean;
|
|
92
87
|
|
|
93
88
|
/**
|
|
94
89
|
* Is this field being rendered in the entity table popup
|
|
95
90
|
*/
|
|
96
|
-
tableMode
|
|
91
|
+
tableMode?: boolean;
|
|
97
92
|
|
|
98
93
|
/**
|
|
99
94
|
* Should this field autofocus on mount
|
|
100
95
|
*/
|
|
101
|
-
autoFocus
|
|
96
|
+
autoFocus?: boolean;
|
|
102
97
|
|
|
103
98
|
/**
|
|
104
99
|
* Additional properties set by the developer
|
|
105
100
|
*/
|
|
106
|
-
customProps
|
|
101
|
+
customProps?: CustomProps
|
|
107
102
|
|
|
108
103
|
/**
|
|
109
104
|
* Additional values related to the state of the form or the entity
|
|
@@ -113,7 +108,7 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
|
|
|
113
108
|
/**
|
|
114
109
|
* Flag to indicate if this field should be disabled
|
|
115
110
|
*/
|
|
116
|
-
disabled
|
|
111
|
+
disabled?: boolean;
|
|
117
112
|
|
|
118
113
|
}
|
|
119
114
|
|
|
@@ -124,37 +119,42 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
|
|
|
124
119
|
export interface FormContext<M extends Record<string, any> = any> {
|
|
125
120
|
|
|
126
121
|
/**
|
|
127
|
-
*
|
|
122
|
+
* Current values of the entity
|
|
128
123
|
*/
|
|
129
|
-
|
|
124
|
+
values: M;
|
|
130
125
|
|
|
131
126
|
/**
|
|
132
|
-
*
|
|
127
|
+
* Update the value of a field
|
|
128
|
+
* @param key
|
|
129
|
+
* @param value
|
|
130
|
+
* @param shouldValidate
|
|
133
131
|
*/
|
|
134
|
-
|
|
132
|
+
setFieldValue: (key: string, value: any, shouldValidate?: boolean) => void;
|
|
135
133
|
|
|
136
134
|
/**
|
|
137
|
-
*
|
|
135
|
+
* Save the entity.
|
|
138
136
|
*/
|
|
139
|
-
|
|
137
|
+
save: (values: M) => void;
|
|
140
138
|
|
|
141
139
|
/**
|
|
142
|
-
*
|
|
140
|
+
* Collection of the entity being modified
|
|
143
141
|
*/
|
|
144
|
-
|
|
142
|
+
collection?: ResolvedEntityCollection<M>;
|
|
145
143
|
|
|
146
144
|
/**
|
|
147
|
-
*
|
|
148
|
-
* @param key
|
|
149
|
-
* @param value
|
|
150
|
-
* @param shouldValidate
|
|
145
|
+
* Entity id, it can be null if it's a new entity
|
|
151
146
|
*/
|
|
152
|
-
|
|
147
|
+
entityId?: string;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Path this entity is located at
|
|
151
|
+
*/
|
|
152
|
+
path?: string;
|
|
153
153
|
|
|
154
154
|
/**
|
|
155
|
-
*
|
|
155
|
+
* This is the underlying formex controller that powers the form
|
|
156
156
|
*/
|
|
157
|
-
|
|
157
|
+
formex: FormexController<M>;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
/**
|
package/src/types/firecms.tsx
CHANGED
package/src/types/index.ts
CHANGED
|
@@ -17,11 +17,12 @@ export * from "./side_entity_controller";
|
|
|
17
17
|
export * from "./side_dialogs_controller";
|
|
18
18
|
export * from "./firecms_context";
|
|
19
19
|
export * from "./entity_callbacks";
|
|
20
|
+
export * from "./entity_overrides";
|
|
20
21
|
export * from "./local_config_persistence";
|
|
21
22
|
export * from "./plugins";
|
|
22
23
|
export * from "./analytics";
|
|
23
24
|
export * from "./firecms";
|
|
24
|
-
export * from "./
|
|
25
|
+
export * from "./roles";
|
|
25
26
|
export * from "./export_import";
|
|
26
27
|
export * from "./modify_collections";
|
|
27
28
|
export * from "./analytics_controller";
|
package/src/types/navigation.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { EntityCollection } from "./collections";
|
|
2
3
|
import { EntityReference } from "./entities";
|
|
3
4
|
|
|
@@ -6,7 +7,7 @@ import { EntityReference } from "./entities";
|
|
|
6
7
|
* attributes.
|
|
7
8
|
* @group Models
|
|
8
9
|
*/
|
|
9
|
-
export type NavigationController = {
|
|
10
|
+
export type NavigationController<EC extends EntityCollection = EntityCollection<any>> = {
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* List of the mapped collections in the CMS.
|
|
@@ -22,6 +23,12 @@ export type NavigationController = {
|
|
|
22
23
|
*/
|
|
23
24
|
views?: CMSView[];
|
|
24
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Custom additional views created by the developer, added to the admin
|
|
28
|
+
* navigation
|
|
29
|
+
*/
|
|
30
|
+
adminViews?: CMSView[];
|
|
31
|
+
|
|
25
32
|
/**
|
|
26
33
|
* Configuration for the views that should be displayed at the top
|
|
27
34
|
* level of the navigation (e.g. in the home page or the navigation
|
|
@@ -49,18 +56,17 @@ export type NavigationController = {
|
|
|
49
56
|
* Get the collection configuration for a given path.
|
|
50
57
|
* The collection is resolved from the given path or alias.
|
|
51
58
|
*/
|
|
52
|
-
getCollection:
|
|
53
|
-
|
|
54
|
-
includeUserOverride?: boolean) => EC | undefined;
|
|
59
|
+
getCollection: (pathOrId: string,
|
|
60
|
+
includeUserOverride?: boolean) => EC | undefined;
|
|
55
61
|
/**
|
|
56
|
-
* Get the collection configuration from its parent
|
|
62
|
+
* Get the collection configuration from its parent ids.
|
|
57
63
|
*/
|
|
58
|
-
getCollectionFromIds:
|
|
64
|
+
getCollectionFromIds: (ids: string[]) => EC | undefined;
|
|
59
65
|
|
|
60
66
|
/**
|
|
61
67
|
* Get the collection configuration from its parent path segments.
|
|
62
68
|
*/
|
|
63
|
-
getCollectionFromPaths:
|
|
69
|
+
getCollectionFromPaths: (pathSegments: string[]) => EC | undefined;
|
|
64
70
|
|
|
65
71
|
/**
|
|
66
72
|
* Default path under the navigation routes of the CMS will be created
|
|
@@ -116,13 +122,6 @@ export type NavigationController = {
|
|
|
116
122
|
*/
|
|
117
123
|
resolveAliasesFrom: (pathWithAliases: string) => string;
|
|
118
124
|
|
|
119
|
-
/**
|
|
120
|
-
* Location used as the base for routes.
|
|
121
|
-
* This is the location that will be used underneath, when the url changes while
|
|
122
|
-
* opening a side dialog
|
|
123
|
-
*/
|
|
124
|
-
baseLocation: string;
|
|
125
|
-
|
|
126
125
|
/**
|
|
127
126
|
* Call this method to recalculate the navigation
|
|
128
127
|
*/
|
|
@@ -192,6 +191,7 @@ export interface CMSView {
|
|
|
192
191
|
/**
|
|
193
192
|
* Optional field used to group top level navigation entries under a
|
|
194
193
|
* navigation view.
|
|
194
|
+
* This prop is ignored for admin views.
|
|
195
195
|
*/
|
|
196
196
|
group?: string;
|
|
197
197
|
|
|
@@ -201,11 +201,11 @@ export interface TopNavigationEntry {
|
|
|
201
201
|
url: string;
|
|
202
202
|
name: string;
|
|
203
203
|
path: string;
|
|
204
|
-
type: "collection" | "view";
|
|
204
|
+
type: "collection" | "view" | "admin";
|
|
205
205
|
collection?: EntityCollection;
|
|
206
|
-
view
|
|
206
|
+
view?: CMSView;
|
|
207
207
|
description?: string;
|
|
208
|
-
group
|
|
208
|
+
group: string;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
export type TopNavigationResult = {
|
package/src/types/permissions.ts
CHANGED
|
@@ -41,6 +41,11 @@ export interface PermissionsBuilderProps<EC extends EntityCollection = EntityCol
|
|
|
41
41
|
*/
|
|
42
42
|
entity: Entity<M> | null;
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Path of the collection e.g. 'products/12345/locales'
|
|
46
|
+
*/
|
|
47
|
+
path: string;
|
|
48
|
+
|
|
44
49
|
/**
|
|
45
50
|
* Path segments of the collection e.g. ['products', 'locales']
|
|
46
51
|
*/
|
|
@@ -73,4 +78,4 @@ export type PermissionsBuilder<EC extends EntityCollection = EntityCollection, U
|
|
|
73
78
|
user,
|
|
74
79
|
collection,
|
|
75
80
|
authController
|
|
76
|
-
}: PermissionsBuilderProps<EC, UserType, M>) => Permissions);
|
|
81
|
+
}: PermissionsBuilderProps<EC, UserType, M>) => Permissions | undefined);
|
package/src/types/plugins.tsx
CHANGED
|
@@ -13,12 +13,12 @@ import { ResolvedProperty } from "./resolved_entities";
|
|
|
13
13
|
* NOTE: This is a work in progress and the API is not stable yet.
|
|
14
14
|
* @group Core
|
|
15
15
|
*/
|
|
16
|
-
export type FireCMSPlugin<PROPS = any, FORM_PROPS = any, EC extends EntityCollection = EntityCollection, COL_ACTIONS_PROPS = any> = {
|
|
16
|
+
export type FireCMSPlugin<PROPS = any, FORM_PROPS = any, EC extends EntityCollection = EntityCollection, COL_ACTIONS_PROPS = any, COL_ACTIONS_START__PROPS = any> = {
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Key of the plugin. This is used to identify the plugin in the CMS.
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
key: string;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* If this flag is set to true, no content will be shown in the CMS
|
|
@@ -26,31 +26,6 @@ export type FireCMSPlugin<PROPS = any, FORM_PROPS = any, EC extends EntityCollec
|
|
|
26
26
|
*/
|
|
27
27
|
loading?: boolean;
|
|
28
28
|
|
|
29
|
-
collections?: {
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Use this component to add custom actions to the entity collections
|
|
33
|
-
* toolbar.
|
|
34
|
-
*/
|
|
35
|
-
CollectionActions?: React.ComponentType<CollectionActionsProps<any, any, EC> & COL_ACTIONS_PROPS> | React.ComponentType<CollectionActionsProps<any, any, EC> & COL_ACTIONS_PROPS>[];
|
|
36
|
-
|
|
37
|
-
collectionActionsProps?: COL_ACTIONS_PROPS;
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
form?: {
|
|
42
|
-
provider?: {
|
|
43
|
-
Component: React.ComponentType<PropsWithChildren<FORM_PROPS & PluginFormActionProps<any, EC>>>;
|
|
44
|
-
props?: FORM_PROPS;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
Actions?: React.ComponentType<PluginFormActionProps<any, EC>>;
|
|
48
|
-
|
|
49
|
-
fieldBuilder?: <T extends CMSType = CMSType>(props: PluginFieldBuilderParams<T, any, EC>) => React.ComponentType<FieldProps<T>> | null;
|
|
50
|
-
|
|
51
|
-
fieldBuilderEnabled?: <T extends CMSType = CMSType>(props: PluginFieldBuilderParams<T>) => boolean;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
29
|
/**
|
|
55
30
|
* You can use this prop to add higher order components to the CMS.
|
|
56
31
|
* The components will be added to the root of the CMS, so any component
|
|
@@ -113,6 +88,16 @@ export type FireCMSPlugin<PROPS = any, FORM_PROPS = any, EC extends EntityCollec
|
|
|
113
88
|
|
|
114
89
|
collectionView?: {
|
|
115
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Use this component to add custom actions to the entity collections
|
|
93
|
+
* toolbar.
|
|
94
|
+
*/
|
|
95
|
+
CollectionActions?: React.ComponentType<CollectionActionsProps<any, any, EC> & COL_ACTIONS_PROPS> | React.ComponentType<CollectionActionsProps<any, any, EC> & COL_ACTIONS_PROPS>[];
|
|
96
|
+
collectionActionsProps?: COL_ACTIONS_PROPS;
|
|
97
|
+
|
|
98
|
+
CollectionActionsStart?: React.ComponentType<CollectionActionsProps<any, any, EC> & COL_ACTIONS_START__PROPS> | React.ComponentType<CollectionActionsProps<any, any, EC> & COL_ACTIONS_START__PROPS>[];
|
|
99
|
+
collectionActionsStartProps?: COL_ACTIONS_START__PROPS;
|
|
100
|
+
|
|
116
101
|
showTextSearchBar?: (props: {
|
|
117
102
|
context: FireCMSContext,
|
|
118
103
|
path: string,
|
|
@@ -151,6 +136,19 @@ export type FireCMSPlugin<PROPS = any, FORM_PROPS = any, EC extends EntityCollec
|
|
|
151
136
|
}>;
|
|
152
137
|
}
|
|
153
138
|
|
|
139
|
+
form?: {
|
|
140
|
+
provider?: {
|
|
141
|
+
Component: React.ComponentType<PropsWithChildren<FORM_PROPS & PluginFormActionProps<any, EC>>>;
|
|
142
|
+
props?: FORM_PROPS;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
Actions?: React.ComponentType<PluginFormActionProps<any, EC>>;
|
|
146
|
+
|
|
147
|
+
fieldBuilder?: <T extends CMSType = CMSType>(props: PluginFieldBuilderParams<T, any, EC>) => React.ComponentType<FieldProps<T>> | null;
|
|
148
|
+
|
|
149
|
+
fieldBuilderEnabled?: <T extends CMSType = CMSType>(props: PluginFieldBuilderParams<T>) => boolean;
|
|
150
|
+
}
|
|
151
|
+
|
|
154
152
|
}
|
|
155
153
|
|
|
156
154
|
/**
|
|
@@ -196,8 +194,8 @@ export type PluginFieldBuilderParams<T extends CMSType = CMSType, M extends Reco
|
|
|
196
194
|
property: Property<T> | ResolvedProperty<T>;
|
|
197
195
|
Field: React.ComponentType<FieldProps<T, any, M>>;
|
|
198
196
|
plugin: FireCMSPlugin;
|
|
199
|
-
path
|
|
200
|
-
collection
|
|
197
|
+
path?: string;
|
|
198
|
+
collection?: EC;
|
|
201
199
|
};
|
|
202
200
|
|
|
203
201
|
export interface PluginGenericProps<UserType extends User = User> {
|