@firecms/core 3.0.0-canary.99 → 3.0.0-rc.2
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/Drawer.d.ts +0 -1
- package/dist/app/Scaffold.d.ts +4 -0
- package/dist/components/ArrayContainer.d.ts +31 -12
- package/dist/components/{DeleteConfirmationDialog.d.ts → ConfirmationDialog.d.ts} +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +3 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -2
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +17 -3
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +1 -1
- package/dist/components/EntityCollectionTable/index.d.ts +1 -1
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +6 -3
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +8 -0
- package/dist/components/EntityCollectionView/utils.d.ts +3 -0
- package/dist/components/EntityJsonPreview.d.ts +3 -0
- package/dist/components/EntityPreview.d.ts +8 -6
- package/dist/components/HomePage/DefaultHomePage.d.ts +2 -15
- package/dist/components/HomePage/HomePageDnD.d.ts +76 -0
- package/dist/components/HomePage/NavigationCard.d.ts +3 -1
- package/dist/components/HomePage/NavigationCardBinding.d.ts +3 -2
- package/dist/components/HomePage/NavigationGroup.d.ts +8 -1
- package/dist/components/HomePage/RenameGroupDialog.d.ts +9 -0
- package/dist/components/PropertyConfigBadge.d.ts +2 -1
- package/dist/components/PropertyIdCopyTooltip.d.ts +8 -0
- package/dist/components/SelectableTable/SelectableTable.d.ts +13 -3
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +1 -1
- package/dist/components/UnsavedChangesDialog.d.ts +8 -0
- package/dist/components/UserDisplay.d.ts +7 -0
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +11 -2
- package/dist/components/VirtualTable/fields/VirtualTableUserSelect.d.ts +12 -0
- package/dist/components/common/default_entity_actions.d.ts +0 -2
- package/dist/components/common/index.d.ts +1 -1
- package/dist/components/common/useColumnsIds.d.ts +1 -0
- package/dist/components/common/{useDataSourceEntityCollectionTableController.d.ts → useDataSourceTableController.d.ts} +10 -2
- package/dist/components/common/useDebouncedCallback.d.ts +1 -0
- package/dist/components/common/useScrollRestoration.d.ts +14 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/contexts/BreacrumbsContext.d.ts +8 -0
- package/dist/contexts/InternalUserManagementContext.d.ts +3 -0
- package/dist/core/DefaultAppBar.d.ts +8 -2
- package/dist/core/DrawerNavigationItem.d.ts +2 -1
- package/dist/core/EntityEditView.d.ts +40 -22
- package/dist/core/EntityEditViewFormActions.d.ts +2 -0
- package/dist/core/FireCMS.d.ts +2 -3
- package/dist/core/FireCMSRouter.d.ts +4 -0
- package/dist/core/NavigationRoutes.d.ts +0 -1
- package/dist/core/SideDialogs.d.ts +4 -2
- package/dist/core/field_configs.d.ts +1 -1
- package/dist/core/index.d.ts +2 -1
- package/dist/form/EntityForm.d.ts +50 -0
- package/dist/form/EntityFormActions.d.ts +21 -0
- package/dist/form/PropertyFieldBinding.d.ts +1 -1
- package/dist/form/components/FormEntry.d.ts +6 -0
- package/dist/form/components/FormLayout.d.ts +5 -0
- package/dist/form/components/LabelWithIcon.d.ts +1 -1
- package/dist/form/components/LabelWithIconAndTooltip.d.ts +15 -0
- package/dist/form/components/index.d.ts +3 -1
- package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/BlockFieldBinding.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/MarkdownEditorFieldBinding.d.ts +11 -0
- package/dist/form/field_bindings/{MultiSelectBinding.d.ts → MultiSelectFieldBinding.d.ts} +1 -1
- package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +9 -0
- package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +2 -2
- package/dist/form/field_bindings/RepeatFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/SelectFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +4 -10
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +1 -2
- package/dist/form/field_bindings/TextFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +12 -0
- package/dist/form/index.d.ts +17 -16
- package/dist/form/useClearRestoreValue.d.ts +2 -2
- package/dist/hooks/data/delete.d.ts +4 -4
- package/dist/hooks/data/save.d.ts +3 -3
- package/dist/hooks/data/useCollectionFetch.d.ts +1 -1
- package/dist/hooks/data/useEntityFetch.d.ts +4 -3
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useAuthController.d.ts +1 -1
- package/dist/hooks/useBreadcrumbsController.d.ts +26 -0
- package/dist/hooks/useBuildNavigationController.d.ts +57 -12
- package/dist/hooks/useCollapsedGroups.d.ts +9 -0
- package/dist/hooks/useFireCMSContext.d.ts +1 -1
- package/dist/hooks/useInternalUserManagementController.d.ts +12 -0
- package/dist/hooks/useModeController.d.ts +1 -2
- package/dist/hooks/useProjectLog.d.ts +7 -1
- package/dist/hooks/useResolvedNavigationFrom.d.ts +3 -3
- package/dist/hooks/useValidateAuthenticator.d.ts +3 -3
- package/dist/index.es.js +20480 -14434
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +20250 -14209
- package/dist/index.umd.js.map +1 -1
- package/dist/internal/useBuildDataSource.d.ts +3 -2
- package/dist/internal/useBuildSideEntityController.d.ts +3 -3
- package/dist/internal/useUnsavedChangesDialog.d.ts +7 -9
- package/dist/preview/PropertyPreviewProps.d.ts +1 -1
- package/dist/preview/components/EnumValuesChip.d.ts +1 -1
- package/dist/preview/components/ReferencePreview.d.ts +2 -2
- package/dist/preview/components/UserPreview.d.ts +8 -0
- package/dist/preview/index.d.ts +1 -0
- package/dist/preview/util.d.ts +3 -3
- package/dist/routes/CustomCMSRoute.d.ts +4 -0
- package/dist/routes/FireCMSRoute.d.ts +1 -0
- package/dist/routes/HomePageRoute.d.ts +3 -0
- package/dist/types/analytics.d.ts +1 -1
- package/dist/types/auth.d.ts +7 -9
- package/dist/types/collections.d.ts +88 -25
- package/dist/types/customization_controller.d.ts +8 -0
- package/dist/types/datasource.d.ts +19 -17
- package/dist/types/dialogs_controller.d.ts +7 -3
- package/dist/types/entities.d.ts +7 -2
- package/dist/types/entity_actions.d.ts +58 -8
- package/dist/types/entity_callbacks.d.ts +16 -16
- package/dist/types/entity_overrides.d.ts +2 -2
- package/dist/types/export_import.d.ts +4 -4
- package/dist/types/fields.d.ts +43 -17
- package/dist/types/firecms.d.ts +31 -3
- package/dist/types/firecms_context.d.ts +17 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/internal_user_management.d.ts +20 -0
- package/dist/types/navigation.d.ts +60 -17
- package/dist/types/permissions.d.ts +4 -4
- package/dist/types/plugins.d.ts +44 -9
- package/dist/types/properties.d.ts +74 -22
- package/dist/types/property_config.d.ts +1 -3
- package/dist/types/roles.d.ts +3 -0
- package/dist/types/side_dialogs_controller.d.ts +10 -0
- package/dist/types/side_entity_controller.d.ts +14 -1
- package/dist/types/storage.d.ts +75 -0
- package/dist/types/user.d.ts +2 -1
- package/dist/util/builders.d.ts +3 -3
- package/dist/util/callbacks.d.ts +2 -0
- package/dist/util/createFormexStub.d.ts +2 -0
- package/dist/util/entities.d.ts +2 -2
- package/dist/util/entity_actions.d.ts +2 -0
- package/dist/util/entity_cache.d.ts +23 -0
- package/dist/util/icon_synonyms.d.ts +0 -1
- package/dist/util/icons.d.ts +5 -2
- package/dist/util/index.d.ts +3 -0
- package/dist/util/navigation_from_path.d.ts +10 -1
- package/dist/util/navigation_utils.d.ts +13 -1
- package/dist/util/objects.d.ts +2 -1
- package/dist/util/permissions.d.ts +4 -4
- package/dist/util/property_utils.d.ts +4 -4
- package/dist/util/references.d.ts +2 -2
- package/dist/util/resolutions.d.ts +30 -6
- package/dist/util/storage.d.ts +1 -1
- package/dist/util/useStorageUploadController.d.ts +2 -2
- package/package.json +133 -125
- package/src/app/Drawer.tsx +0 -1
- package/src/app/Scaffold.tsx +33 -29
- package/src/components/ArrayContainer.tsx +447 -229
- package/src/components/CircularProgressCenter.tsx +1 -1
- package/src/components/ClearFilterSortButton.tsx +1 -1
- package/src/components/{DeleteConfirmationDialog.tsx → ConfirmationDialog.tsx} +12 -11
- package/src/components/DeleteEntityDialog.tsx +13 -20
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +59 -25
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +23 -17
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +20 -3
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +47 -9
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +21 -16
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +6 -12
- package/src/components/EntityCollectionTable/index.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +6 -6
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +35 -26
- package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +20 -8
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +132 -101
- package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +9 -9
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +178 -85
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +7 -4
- package/src/components/EntityCollectionView/useSelectionController.tsx +5 -4
- package/src/components/EntityCollectionView/utils.ts +19 -0
- package/src/components/EntityJsonPreview.tsx +66 -0
- package/src/components/EntityPreview.tsx +75 -57
- package/src/components/EntityView.tsx +8 -5
- package/src/components/ErrorView.tsx +3 -3
- package/src/components/FireCMSLogo.tsx +7 -51
- package/src/components/HomePage/DefaultHomePage.tsx +506 -161
- package/src/components/HomePage/FavouritesView.tsx +9 -14
- package/src/components/HomePage/HomePageDnD.tsx +600 -0
- package/src/components/HomePage/NavigationCard.tsx +47 -38
- package/src/components/HomePage/NavigationCardBinding.tsx +16 -15
- package/src/components/HomePage/NavigationGroup.tsx +144 -30
- package/src/components/HomePage/RenameGroupDialog.tsx +123 -0
- package/src/components/HomePage/SmallNavigationCard.tsx +1 -2
- package/src/components/NotFoundPage.tsx +2 -2
- package/src/components/PropertyConfigBadge.tsx +10 -4
- package/src/components/PropertyIdCopyTooltip.tsx +47 -0
- package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +22 -13
- package/src/components/SearchIconsView.tsx +2 -2
- package/src/components/SelectableTable/SelectableTable.tsx +154 -142
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +4 -2
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +10 -8
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +60 -11
- package/src/components/UnsavedChangesDialog.tsx +46 -0
- package/src/components/UserDisplay.tsx +55 -0
- package/src/components/VirtualTable/VirtualTable.tsx +65 -44
- package/src/components/VirtualTable/VirtualTableCell.tsx +0 -8
- package/src/components/VirtualTable/VirtualTableHeader.tsx +8 -8
- package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +1 -1
- package/src/components/VirtualTable/VirtualTableProps.tsx +12 -2
- package/src/components/VirtualTable/VirtualTableRow.tsx +1 -1
- package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +4 -4
- package/src/components/VirtualTable/fields/VirtualTableInput.tsx +2 -2
- package/src/components/VirtualTable/fields/VirtualTableNumberInput.tsx +2 -1
- package/src/components/VirtualTable/fields/VirtualTableSelect.tsx +16 -28
- package/src/components/VirtualTable/fields/VirtualTableUserSelect.tsx +99 -0
- package/src/components/common/default_entity_actions.tsx +62 -42
- package/src/components/common/index.ts +1 -1
- package/src/components/common/useColumnsIds.tsx +2 -9
- package/src/components/common/useDataSourceTableController.tsx +420 -0
- package/src/components/common/useDebouncedCallback.tsx +20 -0
- package/src/components/common/useScrollRestoration.tsx +68 -0
- package/src/components/common/useTableSearchHelper.ts +1 -0
- package/src/components/index.tsx +4 -1
- package/src/contexts/BreacrumbsContext.tsx +38 -0
- package/src/contexts/DialogsProvider.tsx +3 -2
- package/src/contexts/InternalUserManagementContext.tsx +4 -0
- package/src/contexts/ModeController.tsx +1 -3
- package/src/contexts/SnackbarProvider.tsx +2 -0
- package/src/core/DefaultAppBar.tsx +124 -85
- package/src/core/DefaultDrawer.tsx +30 -22
- package/src/core/DrawerNavigationItem.tsx +32 -28
- package/src/core/EntityEditView.tsx +388 -995
- package/src/core/EntityEditViewFormActions.tsx +329 -0
- package/src/core/EntitySidePanel.tsx +88 -20
- package/src/core/FireCMS.tsx +58 -28
- package/src/core/FireCMSRouter.tsx +17 -0
- package/src/core/NavigationRoutes.tsx +23 -32
- package/src/core/SideDialogs.tsx +22 -12
- package/src/core/field_configs.tsx +39 -11
- package/src/core/index.tsx +4 -2
- package/src/form/EntityForm.tsx +814 -0
- package/src/form/EntityFormActions.tsx +211 -0
- package/src/form/PropertyFieldBinding.tsx +59 -41
- package/src/form/components/CustomIdField.tsx +9 -3
- package/src/form/components/FieldHelperText.tsx +1 -1
- package/src/form/components/FormEntry.tsx +22 -0
- package/src/form/components/FormLayout.tsx +16 -0
- package/src/form/components/LabelWithIcon.tsx +30 -19
- package/src/form/components/LabelWithIconAndTooltip.tsx +28 -0
- package/src/form/components/StorageItemPreview.tsx +5 -4
- package/src/form/components/StorageUploadProgress.tsx +2 -3
- package/src/form/components/index.tsx +3 -1
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +30 -18
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +47 -36
- package/src/form/field_bindings/BlockFieldBinding.tsx +55 -33
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +18 -14
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +19 -15
- package/src/form/field_bindings/MapFieldBinding.tsx +72 -62
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +159 -0
- package/src/form/field_bindings/{MultiSelectBinding.tsx → MultiSelectFieldBinding.tsx} +26 -21
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +10 -8
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +135 -0
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +28 -19
- package/src/form/field_bindings/RepeatFieldBinding.tsx +56 -32
- package/src/form/field_bindings/SelectFieldBinding.tsx +22 -13
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +247 -168
- package/src/form/field_bindings/SwitchFieldBinding.tsx +29 -24
- package/src/form/field_bindings/TextFieldBinding.tsx +28 -24
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +94 -0
- package/src/form/index.tsx +17 -37
- package/src/form/useClearRestoreValue.tsx +2 -2
- package/src/form/validation.ts +12 -6
- package/src/hooks/data/delete.ts +6 -5
- package/src/hooks/data/save.ts +26 -35
- package/src/hooks/data/useCollectionFetch.tsx +3 -3
- package/src/hooks/data/useDataSource.tsx +10 -2
- package/src/hooks/data/useEntityFetch.tsx +10 -6
- package/src/hooks/index.tsx +3 -0
- package/src/hooks/useAuthController.tsx +1 -1
- package/src/hooks/useBreadcrumbsController.tsx +31 -0
- package/src/hooks/useBrowserTitleAndIcon.tsx +1 -1
- package/src/hooks/useBuildModeController.tsx +15 -28
- package/src/hooks/useBuildNavigationController.tsx +386 -124
- package/src/hooks/useCollapsedGroups.ts +64 -0
- package/src/hooks/useFireCMSContext.tsx +9 -35
- package/src/hooks/useInternalUserManagementController.tsx +16 -0
- package/src/hooks/useLargeLayout.tsx +0 -35
- package/src/hooks/useModeController.tsx +1 -2
- package/src/hooks/useProjectLog.tsx +16 -5
- package/src/hooks/useResolvedNavigationFrom.tsx +9 -11
- package/src/hooks/useValidateAuthenticator.tsx +3 -3
- package/src/internal/useBuildDataSource.ts +67 -80
- package/src/internal/useBuildSideDialogsController.tsx +4 -2
- package/src/internal/useBuildSideEntityController.tsx +149 -86
- package/src/internal/useUnsavedChangesDialog.tsx +127 -91
- package/src/preview/PropertyPreview.tsx +36 -12
- package/src/preview/PropertyPreviewProps.tsx +1 -1
- package/src/preview/components/BooleanPreview.tsx +1 -1
- package/src/preview/components/EmptyValue.tsx +1 -1
- package/src/preview/components/EnumValuesChip.tsx +1 -1
- package/src/preview/components/ImagePreview.tsx +10 -9
- package/src/preview/components/ReferencePreview.tsx +10 -18
- package/src/preview/components/UrlComponentPreview.tsx +20 -21
- package/src/preview/components/UserPreview.tsx +27 -0
- package/src/preview/index.ts +1 -0
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +6 -5
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +5 -4
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +5 -3
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +4 -3
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +6 -4
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +6 -4
- package/src/preview/property_previews/MapPropertyPreview.tsx +7 -6
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +13 -13
- package/src/preview/property_previews/StringPropertyPreview.tsx +2 -2
- package/src/preview/util.ts +10 -10
- package/src/routes/CustomCMSRoute.tsx +21 -0
- package/src/routes/FireCMSRoute.tsx +246 -0
- package/src/routes/HomePageRoute.tsx +17 -0
- package/src/types/analytics.ts +3 -0
- package/src/types/auth.tsx +8 -12
- package/src/types/collections.ts +103 -28
- package/src/types/customization_controller.tsx +9 -0
- package/src/types/datasource.ts +21 -20
- package/src/types/dialogs_controller.tsx +7 -3
- package/src/types/entities.ts +10 -2
- package/src/types/entity_actions.tsx +71 -8
- package/src/types/entity_callbacks.ts +18 -18
- package/src/types/entity_overrides.tsx +2 -2
- package/src/types/export_import.ts +4 -4
- package/src/types/fields.tsx +52 -19
- package/src/types/firecms.tsx +34 -4
- package/src/types/firecms_context.tsx +18 -1
- package/src/types/index.ts +1 -0
- package/src/types/internal_user_management.ts +24 -0
- package/src/types/navigation.ts +76 -22
- package/src/types/permissions.ts +5 -5
- package/src/types/plugins.tsx +53 -9
- package/src/types/properties.ts +84 -22
- package/src/types/property_config.tsx +2 -2
- package/src/types/roles.ts +3 -0
- package/src/types/side_dialogs_controller.tsx +15 -0
- package/src/types/side_entity_controller.tsx +16 -1
- package/src/types/storage.ts +82 -0
- package/src/types/user.ts +3 -1
- package/src/util/builders.ts +10 -8
- package/src/util/callbacks.ts +119 -0
- package/src/util/createFormexStub.tsx +62 -0
- package/src/util/entities.ts +6 -4
- package/src/util/entity_actions.ts +28 -0
- package/src/util/entity_cache.ts +204 -0
- package/src/util/icon_list.ts +1 -1
- package/src/util/icon_synonyms.ts +0 -1
- package/src/util/icons.tsx +36 -11
- package/src/util/index.ts +3 -0
- package/src/util/join_collections.ts +9 -2
- package/src/util/make_properties_editable.ts +13 -5
- package/src/util/navigation_from_path.ts +33 -12
- package/src/util/navigation_utils.ts +135 -19
- package/src/util/objects.ts +74 -14
- package/src/util/parent_references_from_path.ts +3 -3
- package/src/util/permissions.ts +8 -8
- package/src/util/property_utils.tsx +17 -6
- package/src/util/references.ts +19 -8
- package/src/util/resolutions.ts +93 -24
- package/src/util/storage.ts +6 -2
- package/src/util/useStorageUploadController.tsx +74 -29
- package/dist/components/EntityCollectionTable/internal/popup_field/ElementResizeListener.d.ts +0 -5
- package/dist/components/PropertyIdCopyTooltipContent.d.ts +0 -3
- package/dist/form/PropertiesForm.d.ts +0 -8
- package/dist/form/components/FormikArrayContainer.d.ts +0 -18
- package/dist/form/field_bindings/MarkdownFieldBinding.d.ts +0 -9
- package/src/components/EntityCollectionTable/internal/popup_field/ElementResizeListener.tsx +0 -59
- package/src/components/PropertyIdCopyTooltipContent.tsx +0 -27
- package/src/components/common/useDataSourceEntityCollectionTableController.tsx +0 -236
- package/src/form/PropertiesForm.tsx +0 -81
- package/src/form/components/FormikArrayContainer.tsx +0 -44
- package/src/form/field_bindings/MarkdownFieldBinding.tsx +0 -695
- /package/src/util/{common.tsx → common.ts} +0 -0
package/dist/types/entities.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type EntityStatus = "new" | "existing" | "copy";
|
|
|
7
7
|
* Representation of an entity fetched from the datasource
|
|
8
8
|
* @group Models
|
|
9
9
|
*/
|
|
10
|
-
export interface Entity<M extends object> {
|
|
10
|
+
export interface Entity<M extends object = any> {
|
|
11
11
|
/**
|
|
12
12
|
* ID of the entity
|
|
13
13
|
*/
|
|
@@ -21,6 +21,7 @@ export interface Entity<M extends object> {
|
|
|
21
21
|
* Current values
|
|
22
22
|
*/
|
|
23
23
|
values: EntityValues<M>;
|
|
24
|
+
databaseId?: string;
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
27
|
* This type represents a record of key value pairs as described in an
|
|
@@ -41,7 +42,11 @@ export declare class EntityReference {
|
|
|
41
42
|
* to the root of the database).
|
|
42
43
|
*/
|
|
43
44
|
readonly path: string;
|
|
44
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Optional database ID where the entity is stored (if multiple databases are used)
|
|
47
|
+
*/
|
|
48
|
+
readonly databaseId?: string;
|
|
49
|
+
constructor(id: string, path: string, databaseId?: string);
|
|
45
50
|
get pathWithId(): string;
|
|
46
51
|
isEntityReference(): boolean;
|
|
47
52
|
}
|
|
@@ -4,15 +4,28 @@ import { Entity } from "./entities";
|
|
|
4
4
|
import { EntityCollection, SelectionController } from "./collections";
|
|
5
5
|
import { User } from "./user";
|
|
6
6
|
import { SideEntityController } from "./side_entity_controller";
|
|
7
|
+
import { FormContext } from "./fields";
|
|
7
8
|
/**
|
|
8
9
|
* An entity action is a custom action that can be performed on an entity.
|
|
9
10
|
* They are displayed in the entity view and in the collection view.
|
|
10
11
|
*/
|
|
11
|
-
export type EntityAction<M extends object = any,
|
|
12
|
+
export type EntityAction<M extends object = any, USER extends User = User> = {
|
|
12
13
|
/**
|
|
13
14
|
* Title of the action
|
|
14
15
|
*/
|
|
15
16
|
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* Key of the action. You only need to provide this if you want to
|
|
19
|
+
* override the default actions, or if you are not passing the action
|
|
20
|
+
* directly to the `entityActions` prop of a collection.
|
|
21
|
+
* You can define your actions at the app level, in which case you
|
|
22
|
+
* must provide a key.
|
|
23
|
+
* The default actions are:
|
|
24
|
+
* - edit
|
|
25
|
+
* - delete
|
|
26
|
+
* - copy
|
|
27
|
+
*/
|
|
28
|
+
key?: string;
|
|
16
29
|
/**
|
|
17
30
|
* Icon of the action
|
|
18
31
|
*/
|
|
@@ -21,7 +34,12 @@ export type EntityAction<M extends object = any, UserType extends User = User> =
|
|
|
21
34
|
* Callback when the action is clicked
|
|
22
35
|
* @param props
|
|
23
36
|
*/
|
|
24
|
-
onClick: (props: EntityActionClickProps<M,
|
|
37
|
+
onClick: (props: EntityActionClickProps<M, USER>) => Promise<void> | void;
|
|
38
|
+
/**
|
|
39
|
+
* Optional callback in case you want to disable the action
|
|
40
|
+
* @param props
|
|
41
|
+
*/
|
|
42
|
+
isEnabled?: (props: EntityActionClickProps<M, USER>) => boolean;
|
|
25
43
|
/**
|
|
26
44
|
* Show this action collapsed in the menu of the collection view.
|
|
27
45
|
* Defaults to true
|
|
@@ -33,17 +51,49 @@ export type EntityAction<M extends object = any, UserType extends User = User> =
|
|
|
33
51
|
*/
|
|
34
52
|
includeInForm?: boolean;
|
|
35
53
|
};
|
|
36
|
-
export type EntityActionClickProps<M extends object,
|
|
37
|
-
entity
|
|
38
|
-
context: FireCMSContext<
|
|
54
|
+
export type EntityActionClickProps<M extends object, USER extends User = User> = {
|
|
55
|
+
entity?: Entity<M>;
|
|
56
|
+
context: FireCMSContext<USER>;
|
|
39
57
|
fullPath?: string;
|
|
58
|
+
fullIdPath?: string;
|
|
40
59
|
collection?: EntityCollection<M>;
|
|
60
|
+
/**
|
|
61
|
+
* Optional form context, present if the action is being called from a form.
|
|
62
|
+
* This allows you to access the form state and methods, including modifying the form values.
|
|
63
|
+
*/
|
|
64
|
+
formContext?: FormContext;
|
|
65
|
+
/**
|
|
66
|
+
* Present if this actions is being called from a side dialog only
|
|
67
|
+
*/
|
|
68
|
+
sideEntityController?: SideEntityController;
|
|
69
|
+
/**
|
|
70
|
+
* Is the action being called from the collection view or from the entity form view?
|
|
71
|
+
*/
|
|
72
|
+
view: "collection" | "form";
|
|
73
|
+
/**
|
|
74
|
+
* If the action is rendered in the form, is it open in a side panel or full screen?
|
|
75
|
+
*/
|
|
76
|
+
openEntityMode: "side_panel" | "full_screen";
|
|
77
|
+
/**
|
|
78
|
+
* Optional selection controller, present if the action is being called from a collection view
|
|
79
|
+
*/
|
|
41
80
|
selectionController?: SelectionController;
|
|
81
|
+
/**
|
|
82
|
+
* Optional highlight function to highlight the entity in the collection view
|
|
83
|
+
* @param entity
|
|
84
|
+
*/
|
|
42
85
|
highlightEntity?: (entity: Entity<any>) => void;
|
|
86
|
+
/**
|
|
87
|
+
* Optional unhighlight function to remove the highlight from the entity in the collection view
|
|
88
|
+
* @param entity
|
|
89
|
+
*/
|
|
43
90
|
unhighlightEntity?: (entity: Entity<any>) => void;
|
|
44
|
-
onCollectionChange?: () => void;
|
|
45
91
|
/**
|
|
46
|
-
*
|
|
92
|
+
* Optional function to navigate back (e.g. when deleting an entity or navigating from a form)
|
|
47
93
|
*/
|
|
48
|
-
|
|
94
|
+
navigateBack?: () => void;
|
|
95
|
+
/**
|
|
96
|
+
* Callback to be called when the collection changes, e.g. after an entity is deleted or created.
|
|
97
|
+
*/
|
|
98
|
+
onCollectionChange?: () => void;
|
|
49
99
|
};
|
|
@@ -9,29 +9,29 @@ import { User } from "./user";
|
|
|
9
9
|
* Useful for adding your own logic or blocking the execution of the operation.
|
|
10
10
|
* @group Models
|
|
11
11
|
*/
|
|
12
|
-
export type EntityCallbacks<M extends Record<string, any> = any,
|
|
12
|
+
export type EntityCallbacks<M extends Record<string, any> = any, USER extends User = User> = {
|
|
13
13
|
/**
|
|
14
14
|
* Callback used after fetching data
|
|
15
15
|
* @param entityFetchProps
|
|
16
16
|
*/
|
|
17
|
-
onFetch?(entityFetchProps: EntityOnFetchProps<M,
|
|
17
|
+
onFetch?(entityFetchProps: EntityOnFetchProps<M, USER>): Promise<Entity<M>> | Entity<M>;
|
|
18
18
|
/**
|
|
19
19
|
* Callback used when save is successful
|
|
20
20
|
* @param entitySaveProps
|
|
21
21
|
*/
|
|
22
|
-
onSaveSuccess?(entitySaveProps: EntityOnSaveProps<M,
|
|
22
|
+
onSaveSuccess?(entitySaveProps: EntityOnSaveProps<M, USER>): Promise<void> | void;
|
|
23
23
|
/**
|
|
24
24
|
* Callback used when saving fails
|
|
25
25
|
* @param entitySaveProps
|
|
26
26
|
*/
|
|
27
|
-
onSaveFailure?(entitySaveProps: EntityOnSaveFailureProps<M,
|
|
27
|
+
onSaveFailure?(entitySaveProps: EntityOnSaveFailureProps<M, USER>): Promise<void> | void;
|
|
28
28
|
/**
|
|
29
29
|
* Callback used before saving, you need to return the values that will get
|
|
30
30
|
* saved. If you throw an error in this method the process stops, and an
|
|
31
31
|
* error snackbar gets displayed.
|
|
32
32
|
* @param entitySaveProps
|
|
33
33
|
*/
|
|
34
|
-
onPreSave?(entitySaveProps: EntityOnPreSaveProps<M,
|
|
34
|
+
onPreSave?(entitySaveProps: EntityOnPreSaveProps<M, USER>): Promise<Partial<EntityValues<M>>> | Partial<EntityValues<M>>;
|
|
35
35
|
/**
|
|
36
36
|
* Callback used after the entity is deleted.
|
|
37
37
|
* If you throw an error in this method the process stops, and an
|
|
@@ -39,13 +39,13 @@ export type EntityCallbacks<M extends Record<string, any> = any, UserType extend
|
|
|
39
39
|
*
|
|
40
40
|
* @param entityDeleteProps
|
|
41
41
|
*/
|
|
42
|
-
onPreDelete?(entityDeleteProps: EntityOnDeleteProps<M,
|
|
42
|
+
onPreDelete?(entityDeleteProps: EntityOnDeleteProps<M, USER>): void;
|
|
43
43
|
/**
|
|
44
44
|
* Callback used after the entity is deleted.
|
|
45
45
|
*
|
|
46
46
|
* @param entityDeleteProps
|
|
47
47
|
*/
|
|
48
|
-
onDelete?(entityDeleteProps: EntityOnDeleteProps<M,
|
|
48
|
+
onDelete?(entityDeleteProps: EntityOnDeleteProps<M, USER>): void;
|
|
49
49
|
/**
|
|
50
50
|
* Callback fired when any value in the form changes. You can use it
|
|
51
51
|
* to define the ID of a `new` entity based on the current values.
|
|
@@ -59,11 +59,11 @@ export type EntityCallbacks<M extends Record<string, any> = any, UserType extend
|
|
|
59
59
|
* Parameters passed to hooks when an entity is fetched
|
|
60
60
|
* @group Models
|
|
61
61
|
*/
|
|
62
|
-
export interface EntityOnFetchProps<M extends Record<string, any> = any,
|
|
62
|
+
export interface EntityOnFetchProps<M extends Record<string, any> = any, USER extends User = User> {
|
|
63
63
|
/**
|
|
64
64
|
* Collection of the entity
|
|
65
65
|
*/
|
|
66
|
-
collection: EntityCollection<M,
|
|
66
|
+
collection: EntityCollection<M, USER>;
|
|
67
67
|
/**
|
|
68
68
|
* Full path of the CMS where this collection is being fetched.
|
|
69
69
|
* Might contain unresolved aliases.
|
|
@@ -76,27 +76,27 @@ export interface EntityOnFetchProps<M extends Record<string, any> = any, UserTyp
|
|
|
76
76
|
/**
|
|
77
77
|
* Context of the app status
|
|
78
78
|
*/
|
|
79
|
-
context: FireCMSContext<
|
|
79
|
+
context: FireCMSContext<USER>;
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* Parameters passed to hooks before an entity is saved
|
|
83
83
|
* @group Models
|
|
84
84
|
*/
|
|
85
|
-
export type EntityOnPreSaveProps<M extends Record<string, any> = any,
|
|
85
|
+
export type EntityOnPreSaveProps<M extends Record<string, any> = any, USER extends User = User> = Omit<EntityOnSaveProps<M, USER>, "entityId"> & {
|
|
86
86
|
entityId?: string;
|
|
87
87
|
};
|
|
88
88
|
/**
|
|
89
89
|
* Parameters passed to hooks before an entity is saved
|
|
90
90
|
* @group Models
|
|
91
91
|
*/
|
|
92
|
-
export type EntityOnSaveFailureProps<M extends Record<string, any> = any,
|
|
92
|
+
export type EntityOnSaveFailureProps<M extends Record<string, any> = any, USER extends User = User> = Omit<EntityOnSaveProps<M, USER>, "entityId"> & {
|
|
93
93
|
entityId?: string;
|
|
94
94
|
};
|
|
95
95
|
/**
|
|
96
96
|
* Parameters passed to hooks when an entity is saved
|
|
97
97
|
* @group Models
|
|
98
98
|
*/
|
|
99
|
-
export interface EntityOnSaveProps<M extends Record<string, any> = any,
|
|
99
|
+
export interface EntityOnSaveProps<M extends Record<string, any> = any, USER extends User = User> {
|
|
100
100
|
/**
|
|
101
101
|
* Resolved collection of the entity
|
|
102
102
|
*/
|
|
@@ -129,13 +129,13 @@ export interface EntityOnSaveProps<M extends Record<string, any> = any, UserType
|
|
|
129
129
|
/**
|
|
130
130
|
* Context of the app status
|
|
131
131
|
*/
|
|
132
|
-
context: FireCMSContext<
|
|
132
|
+
context: FireCMSContext<USER>;
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
135
|
* Parameters passed to hooks when an entity is deleted
|
|
136
136
|
* @group Models
|
|
137
137
|
*/
|
|
138
|
-
export interface EntityOnDeleteProps<M extends Record<string, any> = any,
|
|
138
|
+
export interface EntityOnDeleteProps<M extends Record<string, any> = any, USER extends User = User> {
|
|
139
139
|
/**
|
|
140
140
|
* collection of the entity being deleted
|
|
141
141
|
*/
|
|
@@ -155,7 +155,7 @@ export interface EntityOnDeleteProps<M extends Record<string, any> = any, UserTy
|
|
|
155
155
|
/**
|
|
156
156
|
* Context of the app status
|
|
157
157
|
*/
|
|
158
|
-
context: FireCMSContext<
|
|
158
|
+
context: FireCMSContext<USER>;
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
161
|
* Parameters passed to hooks when an entity is deleted
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DataSourceDelegate } from "./datasource";
|
|
2
2
|
import { StorageSource } from "./storage";
|
|
3
3
|
export type EntityOverrides = {
|
|
4
|
-
|
|
4
|
+
dataSourceDelegate?: DataSourceDelegate;
|
|
5
5
|
storageSource?: StorageSource;
|
|
6
6
|
};
|
|
@@ -6,16 +6,16 @@ import { FireCMSContext } from "./firecms_context";
|
|
|
6
6
|
* exports
|
|
7
7
|
* @group Models
|
|
8
8
|
*/
|
|
9
|
-
export interface ExportConfig<
|
|
10
|
-
additionalFields: ExportMappingFunction<
|
|
9
|
+
export interface ExportConfig<USER extends User = User> {
|
|
10
|
+
additionalFields: ExportMappingFunction<USER>[];
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* @group Models
|
|
14
14
|
*/
|
|
15
|
-
export interface ExportMappingFunction<
|
|
15
|
+
export interface ExportMappingFunction<USER extends User = User> {
|
|
16
16
|
key: string;
|
|
17
17
|
builder: ({ entity, context }: {
|
|
18
18
|
entity: Entity<any>;
|
|
19
|
-
context: FireCMSContext<
|
|
19
|
+
context: FireCMSContext<USER>;
|
|
20
20
|
}) => Promise<string> | string;
|
|
21
21
|
}
|
package/dist/types/fields.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { CMSType, PropertyOrBuilder } from "./properties";
|
|
1
|
+
import { CMSType, Property, PropertyOrBuilder } from "./properties";
|
|
2
2
|
import { ResolvedEntityCollection, ResolvedProperty } from "./resolved_entities";
|
|
3
3
|
import { FormexController } from "@firecms/formex";
|
|
4
|
+
import { Entity } from "./entities";
|
|
4
5
|
/**
|
|
5
6
|
* When building a custom field you need to create a React component that takes
|
|
6
7
|
* this interface as props.
|
|
@@ -52,7 +53,7 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
|
|
|
52
53
|
/**
|
|
53
54
|
* Property related to this field
|
|
54
55
|
*/
|
|
55
|
-
property: ResolvedProperty<T>;
|
|
56
|
+
property: Property<T> | ResolvedProperty<T>;
|
|
56
57
|
/**
|
|
57
58
|
* Should this field include a description
|
|
58
59
|
*/
|
|
@@ -67,13 +68,10 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
|
|
|
67
68
|
*/
|
|
68
69
|
partOfArray?: boolean;
|
|
69
70
|
/**
|
|
70
|
-
*
|
|
71
|
+
* Display the child properties directly, without being wrapped in an
|
|
72
|
+
* extendable panel. Note that this will also hide the title of this property.
|
|
71
73
|
*/
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Is this field being rendered in the entity table popup
|
|
75
|
-
*/
|
|
76
|
-
tableMode?: boolean;
|
|
74
|
+
minimalistView?: boolean;
|
|
77
75
|
/**
|
|
78
76
|
* Should this field autofocus on mount
|
|
79
77
|
*/
|
|
@@ -81,7 +79,7 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
|
|
|
81
79
|
/**
|
|
82
80
|
* Additional properties set by the developer
|
|
83
81
|
*/
|
|
84
|
-
customProps
|
|
82
|
+
customProps: CustomProps;
|
|
85
83
|
/**
|
|
86
84
|
* Additional values related to the state of the form or the entity
|
|
87
85
|
*/
|
|
@@ -90,6 +88,18 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
|
|
|
90
88
|
* Flag to indicate if this field should be disabled
|
|
91
89
|
*/
|
|
92
90
|
disabled?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Size of the field
|
|
93
|
+
*/
|
|
94
|
+
size?: "small" | "medium" | "large";
|
|
95
|
+
/**
|
|
96
|
+
* Some properties might change internal state (like expanding a panel).
|
|
97
|
+
* This function should be called when the internal state changes.
|
|
98
|
+
* This is used to preserve state in array containers.
|
|
99
|
+
*
|
|
100
|
+
* @param property
|
|
101
|
+
*/
|
|
102
|
+
onPropertyChange?: (property: Partial<Property<any>>) => void;
|
|
93
103
|
}
|
|
94
104
|
/**
|
|
95
105
|
* Context passed to custom fields
|
|
@@ -118,15 +128,22 @@ export interface FormContext<M extends Record<string, any> = any> {
|
|
|
118
128
|
/**
|
|
119
129
|
* Entity id, it can be null if it's a new entity
|
|
120
130
|
*/
|
|
121
|
-
entityId
|
|
131
|
+
entityId: string;
|
|
122
132
|
/**
|
|
123
133
|
* Path this entity is located at
|
|
124
134
|
*/
|
|
125
135
|
path?: string;
|
|
136
|
+
status: "new" | "existing" | "copy";
|
|
137
|
+
entity?: Entity<M>;
|
|
138
|
+
savingError?: Error;
|
|
139
|
+
openEntityMode: "side_panel" | "full_screen";
|
|
126
140
|
/**
|
|
127
|
-
* This is the underlying formex controller that powers the form
|
|
141
|
+
* This is the underlying formex controller that powers the form.
|
|
142
|
+
* If you are in a red only mode, the formex controller is there, but you can't
|
|
143
|
+
* operate with it
|
|
128
144
|
*/
|
|
129
145
|
formex: FormexController<M>;
|
|
146
|
+
disabled: boolean;
|
|
130
147
|
}
|
|
131
148
|
/**
|
|
132
149
|
* In case you need to render a field bound to a Property inside your
|
|
@@ -157,18 +174,15 @@ export interface PropertyFieldBindingProps<T extends CMSType, M extends Record<s
|
|
|
157
174
|
* field is being edited
|
|
158
175
|
*/
|
|
159
176
|
underlyingValueHasChanged?: boolean;
|
|
160
|
-
/**
|
|
161
|
-
* Is this field being rendered in a table
|
|
162
|
-
*/
|
|
163
|
-
tableMode?: boolean;
|
|
164
177
|
/**
|
|
165
178
|
* Is this field part of an array
|
|
166
179
|
*/
|
|
167
180
|
partOfArray?: boolean;
|
|
168
181
|
/**
|
|
169
|
-
*
|
|
182
|
+
* Display the child properties directly, without being wrapped in an
|
|
183
|
+
* extendable panel. Note that this will also hide the title of this property.
|
|
170
184
|
*/
|
|
171
|
-
|
|
185
|
+
minimalistView?: boolean;
|
|
172
186
|
/**
|
|
173
187
|
* Should the field take focus when rendered. When opening the popup view
|
|
174
188
|
* in table mode, it makes sense to put the focus on the only field rendered.
|
|
@@ -183,4 +197,16 @@ export interface PropertyFieldBindingProps<T extends CMSType, M extends Record<s
|
|
|
183
197
|
* Only used when the field is part of an array.
|
|
184
198
|
*/
|
|
185
199
|
index?: number;
|
|
200
|
+
/**
|
|
201
|
+
* The size of the field
|
|
202
|
+
*/
|
|
203
|
+
size?: "small" | "medium" | "large";
|
|
204
|
+
/**
|
|
205
|
+
* Some properties might change internal state (like expanding a panel).
|
|
206
|
+
* This function should be called when the internal state changes.
|
|
207
|
+
* This is used to preserve state in array containers.
|
|
208
|
+
*
|
|
209
|
+
* @param property
|
|
210
|
+
*/
|
|
211
|
+
onPropertyChange?: (property: Partial<Property<any>>) => void;
|
|
186
212
|
}
|
package/dist/types/firecms.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ import { EntityLinkBuilder } from "./entity_link_builder";
|
|
|
12
12
|
import { UserConfigurationPersistence } from "./local_config_persistence";
|
|
13
13
|
import { FireCMSPlugin } from "./plugins";
|
|
14
14
|
import { CMSAnalyticsEvent } from "./analytics";
|
|
15
|
+
import { EntityAction } from "./entity_actions";
|
|
16
|
+
import { InternalUserManagement } from "./internal_user_management";
|
|
15
17
|
/**
|
|
16
18
|
* Use this callback to build entity collections dynamically.
|
|
17
19
|
* You can use the user to decide which collections to show.
|
|
@@ -44,7 +46,7 @@ export type CMSViewsBuilder = (params: {
|
|
|
44
46
|
/**
|
|
45
47
|
* @group Models
|
|
46
48
|
*/
|
|
47
|
-
export type FireCMSProps<
|
|
49
|
+
export type FireCMSProps<USER extends User> = {
|
|
48
50
|
/**
|
|
49
51
|
* Use this function to return the components you want to render under
|
|
50
52
|
* FireCMS
|
|
@@ -62,6 +64,10 @@ export type FireCMSProps<UserType extends User, EC extends EntityCollection> = {
|
|
|
62
64
|
*/
|
|
63
65
|
loading: boolean;
|
|
64
66
|
}) => React.ReactNode;
|
|
67
|
+
/**
|
|
68
|
+
* If you have a custom API key, you can use it here.
|
|
69
|
+
*/
|
|
70
|
+
apiKey?: string;
|
|
65
71
|
/**
|
|
66
72
|
* Record of custom form fields to be used in the CMS.
|
|
67
73
|
* You can use the key to reference the custom field in
|
|
@@ -81,6 +87,13 @@ export type FireCMSProps<UserType extends User, EC extends EntityCollection> = {
|
|
|
81
87
|
* You can also define an entity view from the UI.
|
|
82
88
|
*/
|
|
83
89
|
entityViews?: EntityCustomView[];
|
|
90
|
+
/**
|
|
91
|
+
* List of actions that can be performed on entities.
|
|
92
|
+
* These actions are displayed in the entity view and in the collection view.
|
|
93
|
+
* You can later reuse these actions in the `entityActions` prop of a collection,
|
|
94
|
+
* by specifying the `key` of the action.
|
|
95
|
+
*/
|
|
96
|
+
entityActions?: EntityAction[];
|
|
84
97
|
/**
|
|
85
98
|
* Format of the dates in the CMS.
|
|
86
99
|
* Defaults to 'MMMM dd, yyyy, HH:mm:ss'
|
|
@@ -101,7 +114,7 @@ export type FireCMSProps<UserType extends User, EC extends EntityCollection> = {
|
|
|
101
114
|
/**
|
|
102
115
|
* Delegate for implementing your auth operations.
|
|
103
116
|
*/
|
|
104
|
-
authController: AuthController<
|
|
117
|
+
authController: AuthController<USER>;
|
|
105
118
|
/**
|
|
106
119
|
* Use this controller to access the configuration that is stored locally,
|
|
107
120
|
* and not defined in code
|
|
@@ -109,7 +122,9 @@ export type FireCMSProps<UserType extends User, EC extends EntityCollection> = {
|
|
|
109
122
|
userConfigPersistence?: UserConfigurationPersistence;
|
|
110
123
|
/**
|
|
111
124
|
* Use plugins to modify the behaviour of the CMS.
|
|
112
|
-
*
|
|
125
|
+
* DEPRECATED: use the `plugins` prop in the `useBuildNavigationController` instead.
|
|
126
|
+
* This prop will work as a fallback for the `plugins` prop in the `useBuildNavigationController`.
|
|
127
|
+
* @deprecated
|
|
113
128
|
*/
|
|
114
129
|
plugins?: FireCMSPlugin<any, any, any>[];
|
|
115
130
|
/**
|
|
@@ -121,6 +136,19 @@ export type FireCMSProps<UserType extends User, EC extends EntityCollection> = {
|
|
|
121
136
|
* The function must return a URL that gets opened when the button is clicked
|
|
122
137
|
*/
|
|
123
138
|
entityLinkBuilder?: EntityLinkBuilder;
|
|
139
|
+
/**
|
|
140
|
+
* You can use this props to provide your own user management implementation.
|
|
141
|
+
* Note that this will not affect the UI, but it will be used to show user information
|
|
142
|
+
* in various places of the CMS, for example, to show who created or modified an entity,
|
|
143
|
+
* or to assign ownership of an entity.
|
|
144
|
+
*
|
|
145
|
+
* You can also use this data to be retrieved in your custom properties,
|
|
146
|
+
* for example, to show a list of users in a dropdown.
|
|
147
|
+
*
|
|
148
|
+
* If you are using the FireCMS user management plugin, this
|
|
149
|
+
* prop will be implemented automatically.
|
|
150
|
+
*/
|
|
151
|
+
userManagement?: InternalUserManagement;
|
|
124
152
|
components?: {
|
|
125
153
|
/**
|
|
126
154
|
* Component to render when a reference is missing
|
|
@@ -10,6 +10,7 @@ import { SideDialogsController } from "./side_dialogs_controller";
|
|
|
10
10
|
import { DialogsController } from "./dialogs_controller";
|
|
11
11
|
import { CustomizationController } from "./customization_controller";
|
|
12
12
|
import { AnalyticsController } from "./analytics_controller";
|
|
13
|
+
import { InternalUserManagement } from "./internal_user_management";
|
|
13
14
|
/**
|
|
14
15
|
* Context that includes the internal controllers and contexts used by the app.
|
|
15
16
|
* Some controllers and context included in this context can be accessed
|
|
@@ -17,7 +18,7 @@ import { AnalyticsController } from "./analytics_controller";
|
|
|
17
18
|
* @group Hooks and utilities
|
|
18
19
|
* @see useFireCMSContext
|
|
19
20
|
*/
|
|
20
|
-
export type FireCMSContext<
|
|
21
|
+
export type FireCMSContext<USER extends User = User, AuthControllerType extends AuthController<USER> = AuthController<USER>> = {
|
|
21
22
|
/**
|
|
22
23
|
* Connector to your database, e.g. your Firestore database
|
|
23
24
|
*/
|
|
@@ -67,4 +68,19 @@ export type FireCMSContext<UserType extends User = User, AuthControllerType exte
|
|
|
67
68
|
* Callback to send analytics events
|
|
68
69
|
*/
|
|
69
70
|
analyticsController?: AnalyticsController;
|
|
71
|
+
/**
|
|
72
|
+
* This section is used to manage users in the CMS.
|
|
73
|
+
* It is used to show user information in various places of the CMS,
|
|
74
|
+
* for example, to show who created or modified an entity,
|
|
75
|
+
* or to assign ownership of an entity.
|
|
76
|
+
*
|
|
77
|
+
* In the base CMS, this information is not used for access control.
|
|
78
|
+
* You can pass your own implementation of this section, to populate
|
|
79
|
+
* the dropdown of users when assigning ownership of an entity,
|
|
80
|
+
* or to show more information about the user.
|
|
81
|
+
*
|
|
82
|
+
* If you are using the FireCMS user management plugin, this
|
|
83
|
+
* section will be implemented automatically.
|
|
84
|
+
*/
|
|
85
|
+
userManagement: InternalUserManagement<USER>;
|
|
70
86
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from "./fields";
|
|
|
13
13
|
export * from "./property_config";
|
|
14
14
|
export * from "./datasource";
|
|
15
15
|
export * from "./entity_link_builder";
|
|
16
|
+
export * from "./internal_user_management";
|
|
16
17
|
export * from "./side_entity_controller";
|
|
17
18
|
export * from "./side_dialogs_controller";
|
|
18
19
|
export * from "./firecms_context";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { User } from "./user";
|
|
2
|
+
export type InternalUserManagement<USER extends User = User> = {
|
|
3
|
+
/**
|
|
4
|
+
* List of users to be managed by the CMS.
|
|
5
|
+
*/
|
|
6
|
+
users: USER[];
|
|
7
|
+
/**
|
|
8
|
+
* Function to get a user by its uid. This is used to show
|
|
9
|
+
* user information when assigning ownership of an entity.
|
|
10
|
+
*
|
|
11
|
+
* You can pass your own implementation if you want to show
|
|
12
|
+
* more information about the user.
|
|
13
|
+
*
|
|
14
|
+
* If you are using the FireCMS user management plugin, this
|
|
15
|
+
* function will be implemented automatically.
|
|
16
|
+
*
|
|
17
|
+
* @param uid
|
|
18
|
+
*/
|
|
19
|
+
getUser: (uid: string) => USER | null;
|
|
20
|
+
};
|