@firecms/core 3.0.0-canary.2 → 3.0.0-canary.200
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 +4 -4
- package/dist/app/AppBar.d.ts +12 -0
- package/dist/app/Drawer.d.ts +16 -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/ArrayContainer.d.ts +23 -6
- package/dist/components/CircularProgressCenter.d.ts +1 -1
- package/dist/components/ClearFilterSortButton.d.ts +5 -0
- package/dist/components/{DeleteConfirmationDialog.d.ts → ConfirmationDialog.d.ts} +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +13 -13
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +3 -3
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +22 -6
- 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 +3 -1
- package/dist/components/EntityCollectionTable/index.d.ts +1 -1
- 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 +7 -4
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +17 -4
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +11 -0
- package/dist/components/EntityCollectionView/useSelectionController.d.ts +2 -0
- package/dist/components/EntityCollectionView/utils.d.ts +3 -0
- package/dist/components/EntityPreview.d.ts +26 -7
- package/dist/components/EntityView.d.ts +11 -0
- package/dist/components/ErrorView.d.ts +1 -1
- package/dist/components/FieldCaption.d.ts +5 -0
- package/dist/components/HomePage/DefaultHomePage.d.ts +1 -1
- package/dist/components/HomePage/NavigationCard.d.ts +8 -0
- package/dist/components/HomePage/{NavigationCollectionCard.d.ts → NavigationCardBinding.d.ts} +3 -3
- package/dist/components/HomePage/SmallNavigationCard.d.ts +6 -0
- package/dist/components/HomePage/index.d.ts +3 -1
- package/dist/components/PropertyConfigBadge.d.ts +2 -1
- package/dist/components/PropertyIdCopyTooltip.d.ts +8 -0
- package/dist/components/ReferenceWidget.d.ts +6 -4
- package/dist/components/SelectableTable/SelectableTable.d.ts +13 -3
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -1
- package/dist/components/UnsavedChangesDialog.d.ts +8 -0
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +29 -13
- package/dist/components/VirtualTable/types.d.ts +3 -3
- package/dist/components/{EntityCollectionTable/internal → common}/default_entity_actions.d.ts +1 -3
- package/dist/components/common/index.d.ts +2 -1
- package/dist/components/common/table_height.d.ts +5 -0
- package/dist/components/common/types.d.ts +4 -6
- package/dist/components/common/useColumnsIds.d.ts +3 -1
- package/dist/components/common/{useDataSourceEntityCollectionTableController.d.ts → useDataSourceTableController.d.ts} +13 -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 +8 -5
- package/dist/contexts/AuthControllerContext.d.ts +1 -1
- package/dist/contexts/BreacrumbsContext.d.ts +8 -0
- package/dist/{components/FireCMSAppBar.d.ts → core/DefaultAppBar.d.ts} +6 -9
- package/dist/core/DefaultDrawer.d.ts +19 -0
- package/dist/core/DrawerNavigationItem.d.ts +10 -0
- package/dist/core/EntityEditView.d.ts +44 -0
- package/dist/core/EntityEditViewFormActions.d.ts +2 -0
- package/dist/core/FireCMS.d.ts +2 -2
- package/dist/core/FireCMSRouter.d.ts +4 -0
- package/dist/core/NavigationRoutes.d.ts +2 -3
- package/dist/core/SideDialogs.d.ts +4 -2
- package/dist/core/index.d.ts +4 -6
- package/dist/form/EntityForm.d.ts +45 -69
- package/dist/form/EntityFormActions.d.ts +17 -0
- package/dist/form/PropertyFieldBinding.d.ts +1 -1
- package/dist/form/components/ErrorFocus.d.ts +1 -1
- package/dist/form/components/FieldHelperText.d.ts +3 -3
- package/dist/form/components/FormEntry.d.ts +6 -0
- package/dist/form/components/FormLayout.d.ts +5 -0
- package/dist/{components → form/components}/LabelWithIcon.d.ts +1 -1
- package/dist/form/components/LabelWithIconAndTooltip.d.ts +15 -0
- package/dist/form/components/StorageItemPreview.d.ts +4 -3
- package/dist/form/components/StorageUploadProgress.d.ts +1 -1
- package/dist/form/components/index.d.ts +4 -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/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 +3 -4
- package/dist/form/field_bindings/SwitchFieldBinding.d.ts +1 -2
- package/dist/form/field_bindings/TextFieldBinding.d.ts +2 -2
- package/dist/form/index.d.ts +17 -18
- package/dist/form/useClearRestoreValue.d.ts +2 -2
- package/dist/form/validation.d.ts +1 -1
- package/dist/hooks/data/delete.d.ts +4 -4
- package/dist/hooks/data/save.d.ts +4 -5
- package/dist/hooks/data/useCollectionFetch.d.ts +1 -1
- package/dist/hooks/data/useDataSource.d.ts +2 -2
- package/dist/hooks/data/useEntityFetch.d.ts +4 -3
- package/dist/hooks/index.d.ts +4 -1
- package/dist/hooks/useAuthController.d.ts +1 -1
- package/dist/hooks/useBreadcrumbsController.d.ts +26 -0
- package/dist/{core → hooks}/useBuildModeController.d.ts +1 -1
- package/dist/hooks/useBuildNavigationController.d.ts +11 -6
- package/dist/hooks/useFireCMSContext.d.ts +1 -1
- package/dist/hooks/useModeController.d.ts +1 -2
- package/dist/hooks/useProjectLog.d.ts +12 -2
- package/dist/hooks/useResolvedNavigationFrom.d.ts +3 -3
- 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 +22131 -14039
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +24420 -588
- package/dist/index.umd.js.map +1 -1
- package/dist/internal/useBuildDataSource.d.ts +1 -12
- package/dist/internal/useUnsavedChangesDialog.d.ts +7 -9
- package/dist/preview/PropertyPreview.d.ts +1 -1
- package/dist/preview/PropertyPreviewProps.d.ts +7 -5
- 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 +4 -9
- package/dist/preview/components/StorageThumbnail.d.ts +2 -1
- package/dist/preview/components/UrlComponentPreview.d.ts +2 -1
- 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 +37 -3
- package/dist/types/collections.d.ts +86 -24
- package/dist/types/datasource.d.ts +53 -37
- package/dist/types/dialogs_controller.d.ts +7 -3
- package/dist/types/entities.d.ts +8 -2
- package/dist/types/entity_actions.d.ts +28 -4
- package/dist/types/entity_callbacks.d.ts +16 -16
- package/dist/types/entity_overrides.d.ts +6 -0
- package/dist/types/export_import.d.ts +4 -4
- package/dist/types/fields.d.ts +71 -42
- package/dist/types/firecms.d.ts +6 -2
- package/dist/types/firecms_context.d.ts +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/navigation.d.ts +45 -26
- package/dist/types/permissions.d.ts +8 -4
- package/dist/types/plugins.d.ts +40 -31
- package/dist/types/properties.d.ts +54 -26
- package/dist/types/property_config.d.ts +2 -4
- package/dist/types/roles.d.ts +31 -0
- package/dist/types/side_dialogs_controller.d.ts +10 -0
- package/dist/types/side_entity_controller.d.ts +6 -1
- package/dist/types/storage.d.ts +86 -3
- package/dist/types/user.d.ts +6 -0
- package/dist/util/builders.d.ts +3 -3
- package/dist/util/collections.d.ts +9 -1
- package/dist/util/entities.d.ts +3 -3
- package/dist/util/entity_actions.d.ts +2 -0
- package/dist/util/entity_cache.d.ts +23 -0
- package/dist/util/icon_list.d.ts +5 -1
- package/dist/util/icon_synonyms.d.ts +1 -98
- package/dist/util/icons.d.ts +13 -4
- package/dist/util/index.d.ts +2 -0
- package/dist/util/navigation_from_path.d.ts +6 -1
- package/dist/util/navigation_utils.d.ts +14 -3
- package/dist/util/objects.d.ts +2 -1
- package/dist/util/permissions.d.ts +4 -4
- package/dist/util/plurals.d.ts +0 -2
- package/dist/util/property_utils.d.ts +3 -3
- package/dist/util/references.d.ts +4 -2
- package/dist/util/resolutions.d.ts +31 -17
- package/dist/util/storage.d.ts +23 -2
- package/dist/util/useStorageUploadController.d.ts +3 -3
- package/dist/util/useTraceUpdate.d.ts +1 -0
- package/package.json +64 -51
- package/src/app/AppBar.tsx +18 -0
- package/src/app/Drawer.tsx +24 -0
- package/src/app/Scaffold.tsx +243 -0
- package/src/app/index.ts +4 -0
- package/src/app/useApp.tsx +32 -0
- package/src/components/ArrayContainer.tsx +126 -40
- package/src/components/CircularProgressCenter.tsx +2 -2
- package/src/components/ClearFilterSortButton.tsx +41 -0
- package/src/components/{DeleteConfirmationDialog.tsx → ConfirmationDialog.tsx} +3 -3
- package/src/components/DeleteEntityDialog.tsx +14 -23
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +56 -39
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +283 -280
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +29 -8
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +58 -50
- package/src/components/EntityCollectionTable/column_utils.tsx +3 -3
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +40 -33
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +22 -20
- package/src/components/EntityCollectionTable/index.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +31 -36
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +36 -34
- package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +20 -8
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +81 -80
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +228 -155
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +9 -8
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +68 -0
- package/src/components/EntityCollectionView/useSelectionController.tsx +43 -0
- package/src/components/EntityCollectionView/utils.ts +19 -0
- package/src/components/EntityPreview.tsx +218 -71
- package/src/components/EntityView.tsx +84 -0
- package/src/components/ErrorView.tsx +4 -4
- package/src/components/FieldCaption.tsx +14 -0
- package/src/components/HomePage/DefaultHomePage.tsx +39 -28
- package/src/components/HomePage/FavouritesView.tsx +6 -11
- package/src/components/HomePage/NavigationCard.tsx +69 -0
- package/src/components/HomePage/NavigationCardBinding.tsx +111 -0
- package/src/components/HomePage/NavigationGroup.tsx +2 -2
- package/src/components/HomePage/SmallNavigationCard.tsx +44 -0
- package/src/components/HomePage/index.tsx +3 -1
- package/src/components/NotFoundPage.tsx +2 -2
- package/src/components/PropertyConfigBadge.tsx +9 -3
- package/src/components/PropertyIdCopyTooltip.tsx +47 -0
- package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +22 -17
- package/src/components/ReferenceWidget.tsx +26 -16
- package/src/components/SearchIconsView.tsx +10 -7
- package/src/components/SelectableTable/SelectableTable.tsx +27 -12
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +2 -3
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +25 -8
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +46 -30
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +92 -23
- package/src/components/UnsavedChangesDialog.tsx +42 -0
- package/src/components/VirtualTable/VirtualTable.tsx +96 -48
- package/src/components/VirtualTable/VirtualTableCell.tsx +1 -9
- package/src/components/VirtualTable/VirtualTableHeader.tsx +10 -10
- package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +2 -2
- package/src/components/VirtualTable/VirtualTableProps.tsx +34 -15
- package/src/components/VirtualTable/VirtualTableRow.tsx +5 -6
- package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +5 -5
- package/src/components/VirtualTable/fields/VirtualTableInput.tsx +3 -2
- package/src/components/VirtualTable/fields/VirtualTableNumberInput.tsx +2 -1
- package/src/components/VirtualTable/fields/VirtualTableSelect.tsx +16 -28
- package/src/components/VirtualTable/types.tsx +2 -3
- package/src/components/{EntityCollectionTable/internal → common}/default_entity_actions.tsx +40 -43
- package/src/components/common/index.ts +2 -1
- 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 +24 -3
- 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 +53 -12
- package/src/components/index.tsx +8 -5
- package/src/contexts/AuthControllerContext.tsx +1 -1
- package/src/contexts/BreacrumbsContext.tsx +38 -0
- package/src/contexts/DialogsProvider.tsx +5 -4
- package/src/contexts/ModeController.tsx +1 -3
- package/src/contexts/SnackbarProvider.tsx +2 -0
- package/src/core/DefaultAppBar.tsx +207 -0
- package/src/core/DefaultDrawer.tsx +185 -0
- package/src/core/DrawerNavigationItem.tsx +66 -0
- package/src/core/EntityEditView.tsx +455 -0
- package/src/core/EntityEditViewFormActions.tsx +199 -0
- package/src/core/EntitySidePanel.tsx +87 -18
- package/src/core/FireCMS.tsx +67 -44
- package/src/core/FireCMSRouter.tsx +17 -0
- package/src/core/NavigationRoutes.tsx +36 -38
- package/src/core/SideDialogs.tsx +22 -12
- package/src/core/field_configs.tsx +11 -12
- package/src/core/index.tsx +6 -7
- package/src/form/EntityForm.tsx +565 -519
- package/src/form/EntityFormActions.tsx +169 -0
- package/src/form/PropertyFieldBinding.tsx +85 -44
- package/src/form/components/CustomIdField.tsx +6 -2
- package/src/form/components/FieldHelperText.tsx +4 -4
- package/src/form/components/FormEntry.tsx +22 -0
- package/src/form/components/FormLayout.tsx +16 -0
- package/src/form/components/LabelWithIcon.tsx +44 -0
- package/src/form/components/LabelWithIconAndTooltip.tsx +28 -0
- package/src/form/components/StorageItemPreview.tsx +23 -11
- package/src/form/components/StorageUploadProgress.tsx +9 -9
- package/src/form/components/index.tsx +4 -1
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +32 -21
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +54 -45
- package/src/form/field_bindings/BlockFieldBinding.tsx +57 -36
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +21 -17
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +76 -67
- package/src/form/field_bindings/MapFieldBinding.tsx +82 -65
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +153 -0
- package/src/form/field_bindings/{MultiSelectBinding.tsx → MultiSelectFieldBinding.tsx} +26 -22
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +12 -17
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +47 -34
- package/src/form/field_bindings/RepeatFieldBinding.tsx +57 -36
- package/src/form/field_bindings/SelectFieldBinding.tsx +24 -17
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +47 -46
- package/src/form/field_bindings/SwitchFieldBinding.tsx +31 -27
- package/src/form/field_bindings/TextFieldBinding.tsx +35 -30
- package/src/form/index.tsx +17 -37
- package/src/form/useClearRestoreValue.tsx +2 -2
- package/src/form/validation.ts +15 -26
- package/src/hooks/data/delete.ts +7 -6
- package/src/hooks/data/save.ts +13 -9
- package/src/hooks/data/useCollectionFetch.tsx +4 -4
- package/src/hooks/data/useDataSource.tsx +15 -2
- package/src/hooks/data/useEntityFetch.tsx +11 -7
- package/src/hooks/index.tsx +6 -1
- package/src/hooks/useAuthController.tsx +1 -1
- package/src/hooks/useBreadcrumbsController.tsx +31 -0
- package/src/{core → hooks}/useBuildLocalConfigurationPersistence.tsx +8 -10
- package/src/{core → hooks}/useBuildModeController.tsx +23 -30
- package/src/hooks/useBuildNavigationController.tsx +278 -117
- package/src/hooks/useFireCMSContext.tsx +5 -5
- package/src/hooks/useLargeLayout.tsx +0 -35
- package/src/hooks/useModeController.tsx +1 -2
- package/src/hooks/useProjectLog.tsx +41 -9
- package/src/hooks/useReferenceDialog.tsx +2 -2
- package/src/hooks/useResolvedNavigationFrom.tsx +10 -12
- 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 +72 -77
- package/src/internal/useBuildSideDialogsController.tsx +4 -2
- package/src/internal/useBuildSideEntityController.tsx +177 -70
- package/src/internal/useUnsavedChangesDialog.tsx +127 -91
- package/src/preview/PropertyPreview.tsx +19 -26
- package/src/preview/PropertyPreviewProps.tsx +5 -9
- package/src/preview/components/BooleanPreview.tsx +19 -4
- package/src/preview/components/EmptyValue.tsx +1 -1
- package/src/preview/components/EnumValuesChip.tsx +2 -2
- package/src/preview/components/ImagePreview.tsx +25 -36
- package/src/preview/components/ReferencePreview.tsx +73 -176
- package/src/preview/components/StorageThumbnail.tsx +5 -1
- package/src/preview/components/UrlComponentPreview.tsx +60 -28
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -3
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +4 -3
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +2 -3
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +1 -2
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +4 -5
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +4 -5
- package/src/preview/property_previews/MapPropertyPreview.tsx +12 -11
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +12 -12
- package/src/preview/property_previews/StringPropertyPreview.tsx +8 -7
- package/src/preview/util.ts +10 -10
- package/src/routes/CustomCMSRoute.tsx +21 -0
- package/src/routes/FireCMSRoute.tsx +236 -0
- package/src/routes/HomePageRoute.tsx +17 -0
- package/src/types/analytics.ts +1 -0
- package/src/types/auth.tsx +48 -3
- package/src/types/collections.ts +102 -27
- package/src/types/customization_controller.tsx +0 -1
- package/src/types/datasource.ts +62 -44
- package/src/types/dialogs_controller.tsx +7 -3
- package/src/types/entities.ts +16 -2
- package/src/types/entity_actions.tsx +33 -4
- package/src/types/entity_callbacks.ts +18 -18
- package/src/types/entity_overrides.tsx +7 -0
- package/src/types/export_import.ts +4 -4
- package/src/types/fields.tsx +81 -46
- package/src/types/firecms.tsx +6 -2
- package/src/types/firecms_context.tsx +1 -1
- package/src/types/index.ts +2 -1
- package/src/types/navigation.ts +52 -31
- package/src/types/permissions.ts +10 -5
- package/src/types/plugins.tsx +47 -39
- package/src/types/properties.ts +63 -27
- package/src/types/property_config.tsx +2 -4
- package/src/types/roles.ts +41 -0
- package/src/types/side_dialogs_controller.tsx +15 -0
- package/src/types/side_entity_controller.tsx +7 -1
- package/src/types/storage.ts +94 -3
- package/src/types/user.ts +9 -0
- package/src/util/builders.ts +10 -8
- package/src/util/collections.ts +22 -0
- package/src/util/entities.ts +9 -6
- package/src/util/entity_actions.ts +28 -0
- package/src/util/entity_cache.ts +204 -0
- package/src/util/enums.ts +1 -1
- package/src/util/icon_list.ts +16 -10
- package/src/util/icon_synonyms.ts +3 -100
- package/src/util/icons.tsx +26 -8
- package/src/util/index.ts +2 -0
- package/src/util/join_collections.ts +3 -0
- package/src/util/make_properties_editable.ts +13 -5
- package/src/util/navigation_from_path.ts +13 -6
- package/src/util/navigation_utils.ts +59 -7
- package/src/util/objects.ts +45 -28
- package/src/util/parent_references_from_path.ts +3 -3
- package/src/util/permissions.ts +20 -16
- package/src/util/plurals.ts +0 -2
- package/src/util/property_utils.tsx +11 -4
- package/src/util/references.ts +45 -5
- package/src/util/resolutions.ts +79 -46
- package/src/util/storage.ts +79 -21
- package/src/util/strings.ts +2 -2
- package/src/util/useStorageUploadController.tsx +71 -27
- package/src/util/useTraceUpdate.tsx +2 -1
- package/dist/components/PropertyIdCopyTooltipContent.d.ts +0 -3
- package/dist/components/VirtualTable/common.d.ts +0 -2
- package/dist/core/Drawer.d.ts +0 -23
- package/dist/core/Scaffold.d.ts +0 -55
- package/dist/form/components/FormikArrayContainer.d.ts +0 -18
- package/dist/form/field_bindings/MarkdownFieldBinding.d.ts +0 -9
- package/dist/internal/EntityView.d.ts +0 -22
- 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/FireCMSAppBar.tsx +0 -157
- package/src/components/HomePage/NavigationCollectionCard.tsx +0 -146
- package/src/components/LabelWithIcon.tsx +0 -33
- package/src/components/PropertyIdCopyTooltipContent.tsx +0 -28
- package/src/components/common/useDataSourceEntityCollectionTableController.tsx +0 -225
- package/src/core/Drawer.tsx +0 -164
- package/src/core/Scaffold.tsx +0 -281
- package/src/form/components/FormikArrayContainer.tsx +0 -44
- package/src/form/field_bindings/MarkdownFieldBinding.tsx +0 -696
- package/src/internal/EntityView.tsx +0 -578
- package/src/internal/useBuildCustomizationController.tsx +0 -5
- package/src/internal/useLocaleConfig.tsx +0 -18
- package/src/types/appcheck.ts +0 -29
- /package/dist/{core → hooks}/useBuildLocalConfigurationPersistence.d.ts +0 -0
- /package/src/util/{common.tsx → common.ts} +0 -0
package/dist/types/firecms.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export type CMSViewsBuilder = (params: {
|
|
|
44
44
|
/**
|
|
45
45
|
* @group Models
|
|
46
46
|
*/
|
|
47
|
-
export type FireCMSProps<
|
|
47
|
+
export type FireCMSProps<USER extends User, EC extends EntityCollection> = {
|
|
48
48
|
/**
|
|
49
49
|
* Use this function to return the components you want to render under
|
|
50
50
|
* FireCMS
|
|
@@ -62,6 +62,10 @@ export type FireCMSProps<UserType extends User, EC extends EntityCollection> = {
|
|
|
62
62
|
*/
|
|
63
63
|
loading: boolean;
|
|
64
64
|
}) => React.ReactNode;
|
|
65
|
+
/**
|
|
66
|
+
* If you have a custom API key, you can use it here.
|
|
67
|
+
*/
|
|
68
|
+
apiKey?: string;
|
|
65
69
|
/**
|
|
66
70
|
* Record of custom form fields to be used in the CMS.
|
|
67
71
|
* You can use the key to reference the custom field in
|
|
@@ -101,7 +105,7 @@ export type FireCMSProps<UserType extends User, EC extends EntityCollection> = {
|
|
|
101
105
|
/**
|
|
102
106
|
* Delegate for implementing your auth operations.
|
|
103
107
|
*/
|
|
104
|
-
authController: AuthController<
|
|
108
|
+
authController: AuthController<USER>;
|
|
105
109
|
/**
|
|
106
110
|
* Use this controller to access the configuration that is stored locally,
|
|
107
111
|
* and not defined in code
|
|
@@ -17,7 +17,7 @@ import { AnalyticsController } from "./analytics_controller";
|
|
|
17
17
|
* @group Hooks and utilities
|
|
18
18
|
* @see useFireCMSContext
|
|
19
19
|
*/
|
|
20
|
-
export type FireCMSContext<
|
|
20
|
+
export type FireCMSContext<USER extends User = User, AuthControllerType extends AuthController<USER> = AuthController<USER>> = {
|
|
21
21
|
/**
|
|
22
22
|
* Connector to your database, e.g. your Firestore database
|
|
23
23
|
*/
|
package/dist/types/index.d.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";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { EntityCollection } from "./collections";
|
|
2
3
|
import { EntityReference } from "./entities";
|
|
3
4
|
/**
|
|
4
5
|
* Controller that includes the resolved navigation and utility methods and
|
|
5
6
|
* attributes.
|
|
7
|
+
* This controller holds the state of the navigation including the collections.
|
|
6
8
|
* @group Models
|
|
7
9
|
*/
|
|
8
|
-
export type NavigationController = {
|
|
10
|
+
export type NavigationController<EC extends EntityCollection = EntityCollection<any>> = {
|
|
9
11
|
/**
|
|
10
12
|
* List of the mapped collections in the CMS.
|
|
11
13
|
* Each entry relates to a collection in the root database.
|
|
@@ -18,6 +20,11 @@ export type NavigationController = {
|
|
|
18
20
|
* navigation
|
|
19
21
|
*/
|
|
20
22
|
views?: CMSView[];
|
|
23
|
+
/**
|
|
24
|
+
* Custom additional views created by the developer, added to the admin
|
|
25
|
+
* navigation
|
|
26
|
+
*/
|
|
27
|
+
adminViews?: CMSView[];
|
|
21
28
|
/**
|
|
22
29
|
* Configuration for the views that should be displayed at the top
|
|
23
30
|
* level of the navigation (e.g. in the home page or the navigation
|
|
@@ -41,21 +48,23 @@ export type NavigationController = {
|
|
|
41
48
|
* Get the collection configuration for a given path.
|
|
42
49
|
* The collection is resolved from the given path or alias.
|
|
43
50
|
*/
|
|
44
|
-
getCollection:
|
|
51
|
+
getCollection: (pathOrId: string, includeUserOverride?: boolean) => EC | undefined;
|
|
45
52
|
/**
|
|
46
|
-
* Get the collection configuration from its parent
|
|
53
|
+
* Get the collection configuration from its parent ids.
|
|
47
54
|
*/
|
|
48
|
-
getCollectionFromIds:
|
|
55
|
+
getCollectionFromIds: (ids: string[]) => EC | undefined;
|
|
49
56
|
/**
|
|
50
57
|
* Get the collection configuration from its parent path segments.
|
|
51
58
|
*/
|
|
52
|
-
getCollectionFromPaths:
|
|
59
|
+
getCollectionFromPaths: (pathSegments: string[]) => EC | undefined;
|
|
53
60
|
/**
|
|
54
|
-
* Default path under the navigation routes of the CMS will be created
|
|
61
|
+
* Default path under the navigation routes of the CMS will be created.
|
|
62
|
+
* Defaults to '/'. You may want to change this `basepath` to 'admin' for example.
|
|
55
63
|
*/
|
|
56
64
|
basePath: string;
|
|
57
65
|
/**
|
|
58
|
-
* Default path under the collection routes of the CMS will be created
|
|
66
|
+
* Default path under the collection routes of the CMS will be created.
|
|
67
|
+
* It defaults to '/c'
|
|
59
68
|
*/
|
|
60
69
|
baseCollectionPath: string;
|
|
61
70
|
/**
|
|
@@ -66,14 +75,6 @@ export type NavigationController = {
|
|
|
66
75
|
* @param cmsPath
|
|
67
76
|
*/
|
|
68
77
|
urlPathToDataPath: (cmsPath: string) => string;
|
|
69
|
-
/**
|
|
70
|
-
* Convert a collection or entity path to a URL path
|
|
71
|
-
* @param path
|
|
72
|
-
*/
|
|
73
|
-
buildCMSUrlPath: (path: string) => string;
|
|
74
|
-
buildUrlEditCollectionPath: (props: {
|
|
75
|
-
path: string;
|
|
76
|
-
}) => string;
|
|
77
78
|
/**
|
|
78
79
|
* Base url path for the home screen
|
|
79
80
|
*/
|
|
@@ -91,16 +92,11 @@ export type NavigationController = {
|
|
|
91
92
|
*/
|
|
92
93
|
buildUrlCollectionPath: (path: string) => string;
|
|
93
94
|
/**
|
|
94
|
-
* Turn a path with
|
|
95
|
+
* Turn a path with collection ids into a resolved path.
|
|
96
|
+
* The ids (typically used in urls) will be replaced with relative paths (typically used in database paths)
|
|
95
97
|
* @param pathWithAliases
|
|
96
98
|
*/
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Location used as the base for routes.
|
|
100
|
-
* This is the location that will be used underneath, when the url changes while
|
|
101
|
-
* opening a side dialog
|
|
102
|
-
*/
|
|
103
|
-
baseLocation: string;
|
|
99
|
+
resolveIdsFrom: (pathWithAliases: string) => string;
|
|
104
100
|
/**
|
|
105
101
|
* Call this method to recalculate the navigation
|
|
106
102
|
*/
|
|
@@ -120,6 +116,27 @@ export type NavigationController = {
|
|
|
120
116
|
* @param ids
|
|
121
117
|
*/
|
|
122
118
|
convertIdsToPaths: (ids: string[]) => string[];
|
|
119
|
+
/**
|
|
120
|
+
* A function to navigate to a specified route or URL.
|
|
121
|
+
*
|
|
122
|
+
* @param {string} to - The target route or URL to navigate to.
|
|
123
|
+
* @param {NavigateOptions} [options] - Optional configuration settings for navigation, such as replace behavior or state data.
|
|
124
|
+
*/
|
|
125
|
+
navigate: (to: string, options?: NavigateOptions) => void;
|
|
126
|
+
};
|
|
127
|
+
export interface NavigateOptions {
|
|
128
|
+
replace?: boolean;
|
|
129
|
+
state?: any;
|
|
130
|
+
preventScrollReset?: boolean;
|
|
131
|
+
relative?: "route" | "path";
|
|
132
|
+
flushSync?: boolean;
|
|
133
|
+
viewTransition?: boolean;
|
|
134
|
+
}
|
|
135
|
+
export type NavigationBlocker = {
|
|
136
|
+
updateBlockListener: (path: string, block: boolean, basePath?: string) => () => void;
|
|
137
|
+
isBlocked: (path: string) => boolean;
|
|
138
|
+
proceed?: () => void;
|
|
139
|
+
reset?: () => void;
|
|
123
140
|
};
|
|
124
141
|
/**
|
|
125
142
|
* Custom additional views created by the developer, added to the main
|
|
@@ -144,6 +161,7 @@ export interface CMSView {
|
|
|
144
161
|
* You can use any of the icons in the Material specs:
|
|
145
162
|
* https://fonts.google.com/icons
|
|
146
163
|
* e.g. 'account_tree' or 'person'
|
|
164
|
+
* Find all the icons in https://firecms.co/docs/icons
|
|
147
165
|
*/
|
|
148
166
|
icon?: string;
|
|
149
167
|
/**
|
|
@@ -159,6 +177,7 @@ export interface CMSView {
|
|
|
159
177
|
/**
|
|
160
178
|
* Optional field used to group top level navigation entries under a
|
|
161
179
|
* navigation view.
|
|
180
|
+
* This prop is ignored for admin views.
|
|
162
181
|
*/
|
|
163
182
|
group?: string;
|
|
164
183
|
}
|
|
@@ -166,11 +185,11 @@ export interface TopNavigationEntry {
|
|
|
166
185
|
url: string;
|
|
167
186
|
name: string;
|
|
168
187
|
path: string;
|
|
169
|
-
type: "collection" | "view";
|
|
188
|
+
type: "collection" | "view" | "admin";
|
|
170
189
|
collection?: EntityCollection;
|
|
171
|
-
view
|
|
190
|
+
view?: CMSView;
|
|
172
191
|
description?: string;
|
|
173
|
-
group
|
|
192
|
+
group: string;
|
|
174
193
|
}
|
|
175
194
|
export type TopNavigationResult = {
|
|
176
195
|
navigationEntries: TopNavigationEntry[];
|
|
@@ -30,7 +30,7 @@ export interface Permissions {
|
|
|
30
30
|
* Props passed to a {@link PermissionsBuilder}
|
|
31
31
|
* @group Models
|
|
32
32
|
*/
|
|
33
|
-
export interface PermissionsBuilderProps<EC extends EntityCollection = EntityCollection,
|
|
33
|
+
export interface PermissionsBuilderProps<EC extends EntityCollection = EntityCollection, USER extends User = User, M extends object = InferCollectionType<EC>> {
|
|
34
34
|
/**
|
|
35
35
|
* Entity being edited, might be null in some cases, when the operation
|
|
36
36
|
* refers to the collection.
|
|
@@ -38,6 +38,10 @@ export interface PermissionsBuilderProps<EC extends EntityCollection = EntityCol
|
|
|
38
38
|
* in a collection, the entity will be null.
|
|
39
39
|
*/
|
|
40
40
|
entity: Entity<M> | null;
|
|
41
|
+
/**
|
|
42
|
+
* Path of the collection e.g. 'products/12345/locales'
|
|
43
|
+
*/
|
|
44
|
+
path: string;
|
|
41
45
|
/**
|
|
42
46
|
* Path segments of the collection e.g. ['products', 'locales']
|
|
43
47
|
*/
|
|
@@ -45,7 +49,7 @@ export interface PermissionsBuilderProps<EC extends EntityCollection = EntityCol
|
|
|
45
49
|
/**
|
|
46
50
|
* Logged in user
|
|
47
51
|
*/
|
|
48
|
-
user:
|
|
52
|
+
user: USER | null;
|
|
49
53
|
/**
|
|
50
54
|
* Collection these permissions apply to
|
|
51
55
|
*/
|
|
@@ -53,11 +57,11 @@ export interface PermissionsBuilderProps<EC extends EntityCollection = EntityCol
|
|
|
53
57
|
/**
|
|
54
58
|
* Auth controller
|
|
55
59
|
*/
|
|
56
|
-
authController: AuthController<
|
|
60
|
+
authController: AuthController<USER>;
|
|
57
61
|
}
|
|
58
62
|
/**
|
|
59
63
|
* Builder used to assign permissions to entities,
|
|
60
64
|
* based on the logged user or collection.
|
|
61
65
|
* @group Models
|
|
62
66
|
*/
|
|
63
|
-
export type PermissionsBuilder<EC extends EntityCollection = EntityCollection,
|
|
67
|
+
export type PermissionsBuilder<EC extends EntityCollection = EntityCollection, USER extends User = User, M extends object = InferCollectionType<EC>> = (({ pathSegments, user, collection, authController }: PermissionsBuilderProps<EC, USER, M>) => Permissions | undefined);
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from "react";
|
|
2
2
|
import { FireCMSContext } from "./firecms_context";
|
|
3
|
-
import { CollectionActionsProps, EntityCollection } from "./collections";
|
|
3
|
+
import { CollectionActionsProps, EntityCollection, EntityTableController } from "./collections";
|
|
4
4
|
import { User } from "./user";
|
|
5
5
|
import { FieldProps, FormContext } from "./fields";
|
|
6
6
|
import { CMSType, Property } from "./properties";
|
|
@@ -11,33 +11,16 @@ import { ResolvedProperty } from "./resolved_entities";
|
|
|
11
11
|
* NOTE: This is a work in progress and the API is not stable yet.
|
|
12
12
|
* @group Core
|
|
13
13
|
*/
|
|
14
|
-
export type FireCMSPlugin<PROPS = any, FORM_PROPS = any, EC extends EntityCollection = EntityCollection, COL_ACTIONS_PROPS = any> = {
|
|
14
|
+
export type FireCMSPlugin<PROPS = any, FORM_PROPS = any, EC extends EntityCollection = EntityCollection, COL_ACTIONS_PROPS = any, COL_ACTIONS_START__PROPS = any> = {
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Key of the plugin. This is used to identify the plugin in the CMS.
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
key: string;
|
|
19
19
|
/**
|
|
20
20
|
* If this flag is set to true, no content will be shown in the CMS
|
|
21
21
|
* until the plugin is fully loaded.
|
|
22
22
|
*/
|
|
23
23
|
loading?: boolean;
|
|
24
|
-
collections?: {
|
|
25
|
-
/**
|
|
26
|
-
* Use this component to add custom actions to the entity collections
|
|
27
|
-
* toolbar.
|
|
28
|
-
*/
|
|
29
|
-
CollectionActions?: React.ComponentType<CollectionActionsProps<any, any, EC> & COL_ACTIONS_PROPS> | React.ComponentType<CollectionActionsProps<any, any, EC> & COL_ACTIONS_PROPS>[];
|
|
30
|
-
collectionActionsProps?: COL_ACTIONS_PROPS;
|
|
31
|
-
};
|
|
32
|
-
form?: {
|
|
33
|
-
provider?: {
|
|
34
|
-
Component: React.ComponentType<PropsWithChildren<FORM_PROPS & PluginFormActionProps<any, EC>>>;
|
|
35
|
-
props?: FORM_PROPS;
|
|
36
|
-
};
|
|
37
|
-
Actions?: React.ComponentType<PluginFormActionProps<any, EC>>;
|
|
38
|
-
fieldBuilder?: <T extends CMSType = CMSType>(props: PluginFieldBuilderParams<T, any, EC>) => React.ComponentType<FieldProps<T>> | null;
|
|
39
|
-
fieldBuilderEnabled?: <T extends CMSType = CMSType>(props: PluginFieldBuilderParams<T>) => boolean;
|
|
40
|
-
};
|
|
41
24
|
/**
|
|
42
25
|
* You can use this prop to add higher order components to the CMS.
|
|
43
26
|
* The components will be added to the root of the CMS, so any component
|
|
@@ -89,6 +72,20 @@ export type FireCMSPlugin<PROPS = any, FORM_PROPS = any, EC extends EntityCollec
|
|
|
89
72
|
};
|
|
90
73
|
};
|
|
91
74
|
collectionView?: {
|
|
75
|
+
/**
|
|
76
|
+
* Use this component to add custom actions to the entity collections
|
|
77
|
+
* toolbar.
|
|
78
|
+
*/
|
|
79
|
+
CollectionActions?: React.ComponentType<CollectionActionsProps<any, any, EC> & COL_ACTIONS_PROPS> | React.ComponentType<CollectionActionsProps<any, any, EC> & COL_ACTIONS_PROPS>[];
|
|
80
|
+
collectionActionsProps?: COL_ACTIONS_PROPS;
|
|
81
|
+
CollectionActionsStart?: React.ComponentType<CollectionActionsProps<any, any, EC> & COL_ACTIONS_START__PROPS> | React.ComponentType<CollectionActionsProps<any, any, EC> & COL_ACTIONS_START__PROPS>[];
|
|
82
|
+
collectionActionsStartProps?: COL_ACTIONS_START__PROPS;
|
|
83
|
+
blockSearch?: (props: {
|
|
84
|
+
context: FireCMSContext;
|
|
85
|
+
path: string;
|
|
86
|
+
collection: EC;
|
|
87
|
+
parentCollectionIds?: string[];
|
|
88
|
+
}) => boolean;
|
|
92
89
|
showTextSearchBar?: (props: {
|
|
93
90
|
context: FireCMSContext;
|
|
94
91
|
path: string;
|
|
@@ -112,6 +109,7 @@ export type FireCMSPlugin<PROPS = any, FORM_PROPS = any, EC extends EntityCollec
|
|
|
112
109
|
parentCollectionIds: string[];
|
|
113
110
|
onHover: boolean;
|
|
114
111
|
collection: EC;
|
|
112
|
+
tableController: EntityTableController;
|
|
115
113
|
}>;
|
|
116
114
|
/**
|
|
117
115
|
* If you add this callback to your plugin, an add button will be added to the collection table.
|
|
@@ -121,8 +119,18 @@ export type FireCMSPlugin<PROPS = any, FORM_PROPS = any, EC extends EntityCollec
|
|
|
121
119
|
fullPath: string;
|
|
122
120
|
parentCollectionIds: string[];
|
|
123
121
|
collection: EC;
|
|
122
|
+
tableController: EntityTableController;
|
|
124
123
|
}>;
|
|
125
124
|
};
|
|
125
|
+
form?: {
|
|
126
|
+
provider?: {
|
|
127
|
+
Component: React.ComponentType<PropsWithChildren<FORM_PROPS & PluginFormActionProps<any, EC>>>;
|
|
128
|
+
props?: FORM_PROPS;
|
|
129
|
+
};
|
|
130
|
+
Actions?: React.ComponentType<PluginFormActionProps<any, EC>>;
|
|
131
|
+
fieldBuilder?: <T extends CMSType = CMSType>(props: PluginFieldBuilderParams<T, any, EC>) => React.ComponentType<FieldProps<T>> | null;
|
|
132
|
+
fieldBuilderEnabled?: <T extends CMSType = CMSType>(props: PluginFieldBuilderParams<T>) => boolean;
|
|
133
|
+
};
|
|
126
134
|
};
|
|
127
135
|
/**
|
|
128
136
|
* Props passed to the {@link FireCMSPlugin.homePage.CollectionActions} method.
|
|
@@ -130,7 +138,7 @@ export type FireCMSPlugin<PROPS = any, FORM_PROPS = any, EC extends EntityCollec
|
|
|
130
138
|
*
|
|
131
139
|
* @group Models
|
|
132
140
|
*/
|
|
133
|
-
export interface PluginHomePageActionsProps<EP extends object = object, M extends Record<string, any> = any,
|
|
141
|
+
export interface PluginHomePageActionsProps<EP extends object = object, M extends Record<string, any> = any, USER extends User = User, EC extends EntityCollection<M> = EntityCollection<M>> {
|
|
134
142
|
/**
|
|
135
143
|
* Collection path of this entity. This is the full path, like
|
|
136
144
|
* `users/1234/addresses`
|
|
@@ -143,17 +151,18 @@ export interface PluginHomePageActionsProps<EP extends object = object, M extend
|
|
|
143
151
|
/**
|
|
144
152
|
* Context of the app status
|
|
145
153
|
*/
|
|
146
|
-
context: FireCMSContext<
|
|
154
|
+
context: FireCMSContext<USER>;
|
|
147
155
|
extraProps?: EP;
|
|
148
156
|
}
|
|
149
|
-
export interface PluginFormActionProps<
|
|
157
|
+
export interface PluginFormActionProps<USER extends User = User, EC extends EntityCollection = EntityCollection> {
|
|
150
158
|
entityId?: string;
|
|
151
159
|
path: string;
|
|
152
160
|
status: EntityStatus;
|
|
153
161
|
collection: EC;
|
|
154
162
|
formContext?: FormContext<any>;
|
|
155
|
-
context: FireCMSContext<
|
|
163
|
+
context: FireCMSContext<USER>;
|
|
156
164
|
currentEntityId?: string;
|
|
165
|
+
openEntityMode: "side_panel" | "full_screen";
|
|
157
166
|
}
|
|
158
167
|
export type PluginFieldBuilderParams<T extends CMSType = CMSType, M extends Record<string, any> = any, EC extends EntityCollection<M> = EntityCollection<M>> = {
|
|
159
168
|
fieldConfigId: string;
|
|
@@ -161,13 +170,13 @@ export type PluginFieldBuilderParams<T extends CMSType = CMSType, M extends Reco
|
|
|
161
170
|
property: Property<T> | ResolvedProperty<T>;
|
|
162
171
|
Field: React.ComponentType<FieldProps<T, any, M>>;
|
|
163
172
|
plugin: FireCMSPlugin;
|
|
164
|
-
path
|
|
165
|
-
collection
|
|
173
|
+
path?: string;
|
|
174
|
+
collection?: EC;
|
|
166
175
|
};
|
|
167
|
-
export interface PluginGenericProps<
|
|
168
|
-
context: FireCMSContext<
|
|
176
|
+
export interface PluginGenericProps<USER extends User = User> {
|
|
177
|
+
context: FireCMSContext<USER>;
|
|
169
178
|
}
|
|
170
|
-
export interface PluginHomePageAdditionalCardsProps<
|
|
179
|
+
export interface PluginHomePageAdditionalCardsProps<USER extends User = User> {
|
|
171
180
|
group?: string;
|
|
172
|
-
context: FireCMSContext<
|
|
181
|
+
context: FireCMSContext<USER>;
|
|
173
182
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FieldProps } from "./fields";
|
|
3
3
|
import { PropertyPreviewProps } from "../preview";
|
|
4
|
-
import { EntityReference, EntityValues, GeoPoint } from "./entities";
|
|
4
|
+
import { EntityReference, EntityValues, GeoPoint, Vector } from "./entities";
|
|
5
5
|
import { ResolvedArrayProperty, ResolvedStringProperty } from "./resolved_entities";
|
|
6
6
|
import { FilterValues } from "./collections";
|
|
7
7
|
import { ChipColorKey, ChipColorScheme } from "@firecms/ui";
|
|
8
8
|
/**
|
|
9
9
|
* @group Entity properties
|
|
10
10
|
*/
|
|
11
|
-
export type DataType<T extends CMSType = CMSType> = T extends string ? "string" : T extends number ? "number" : T extends boolean ? "boolean" : T extends Date ? "date" : T extends GeoPoint ? "geopoint" : T extends EntityReference ? "reference" : T extends Array<
|
|
11
|
+
export type DataType<T extends CMSType = CMSType> = T extends string ? "string" : T extends number ? "number" : T extends boolean ? "boolean" : T extends Date ? "date" : T extends GeoPoint ? "geopoint" : T extends Vector ? "vector" : T extends EntityReference ? "reference" : T extends Array<any> ? "array" : T extends Record<string, any> ? "map" : never;
|
|
12
12
|
/**
|
|
13
13
|
* @group Entity properties
|
|
14
14
|
*/
|
|
@@ -20,7 +20,7 @@ export type AnyProperty = StringProperty | NumberProperty | BooleanProperty | Da
|
|
|
20
20
|
/**
|
|
21
21
|
* @group Entity properties
|
|
22
22
|
*/
|
|
23
|
-
export type Property<T extends CMSType =
|
|
23
|
+
export type Property<T extends CMSType = any> = T extends string ? StringProperty : T extends number ? NumberProperty : T extends boolean ? BooleanProperty : T extends Date ? DateProperty : T extends GeoPoint ? GeopointProperty : T extends EntityReference ? ReferenceProperty : T extends Array<CMSType> ? ArrayProperty<T> : T extends Record<string, any> ? MapProperty<T> : AnyProperty;
|
|
24
24
|
/**
|
|
25
25
|
* Interface including all common properties of a CMS property
|
|
26
26
|
* @group Entity properties
|
|
@@ -97,12 +97,17 @@ export interface BaseProperty<T extends CMSType, CustomProps = any> {
|
|
|
97
97
|
/**
|
|
98
98
|
* This value will be set by default for new entities.
|
|
99
99
|
*/
|
|
100
|
-
defaultValue?: T;
|
|
100
|
+
defaultValue?: T | null;
|
|
101
101
|
/**
|
|
102
102
|
* Should this property be editable. If set to true, the user will be able to modify the property and
|
|
103
103
|
* save the new config. The saved config will then become the source of truth.
|
|
104
104
|
*/
|
|
105
105
|
editable?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* A number between 0 and 100 that indicates the width of the field in the form view.
|
|
108
|
+
* It defaults to 100, but you can set it to 50 to have two fields in the same row.
|
|
109
|
+
*/
|
|
110
|
+
widthPercentage?: number;
|
|
106
111
|
}
|
|
107
112
|
/**
|
|
108
113
|
* @group Entity properties
|
|
@@ -207,15 +212,15 @@ export type PropertyBuilderProps<M extends Record<string, any> = any> = {
|
|
|
207
212
|
* current value of the property, as well as the path and entity ID.
|
|
208
213
|
* @group Entity properties
|
|
209
214
|
*/
|
|
210
|
-
export type PropertyBuilder<T extends CMSType = any, M extends Record<string, any> = any> = ({ values, previousValues, propertyValue, path, entityId }: PropertyBuilderProps<M>) => Property<T> | null;
|
|
215
|
+
export type PropertyBuilder<T extends CMSType = any, M extends Record<string, any> = any> = ({ values, previousValues, propertyValue, index, path, entityId }: PropertyBuilderProps<M>) => Property<T> | null;
|
|
211
216
|
/**
|
|
212
217
|
* @group Entity properties
|
|
213
218
|
*/
|
|
214
|
-
export type PropertyOrBuilder<T extends CMSType = CMSType, M extends Record<string, any> =
|
|
219
|
+
export type PropertyOrBuilder<T extends CMSType = CMSType, M extends Record<string, any> = any> = Property<T> | PropertyBuilder<T, M>;
|
|
215
220
|
/**
|
|
216
221
|
* @group Entity properties
|
|
217
222
|
*/
|
|
218
|
-
export type PropertiesOrBuilders<M extends Record<string, any> =
|
|
223
|
+
export type PropertiesOrBuilders<M extends Record<string, any> = any> = {
|
|
219
224
|
[k in keyof M]: PropertyOrBuilder<M[k], M>;
|
|
220
225
|
};
|
|
221
226
|
/**
|
|
@@ -278,7 +283,7 @@ export interface StringProperty extends BaseProperty<string> {
|
|
|
278
283
|
enumValues?: EnumValues;
|
|
279
284
|
/**
|
|
280
285
|
* You can specify a `Storage` configuration. It is used to
|
|
281
|
-
* indicate that this string refers to a path in
|
|
286
|
+
* indicate that this string refers to a path in your storage provider.
|
|
282
287
|
*/
|
|
283
288
|
storage?: StorageConfig;
|
|
284
289
|
/**
|
|
@@ -306,7 +311,7 @@ export interface StringProperty extends BaseProperty<string> {
|
|
|
306
311
|
/**
|
|
307
312
|
* @group Entity properties
|
|
308
313
|
*/
|
|
309
|
-
export interface ArrayProperty<T extends ArrayT[] = any[], ArrayT extends CMSType =
|
|
314
|
+
export interface ArrayProperty<T extends ArrayT[] = any[], ArrayT extends CMSType = any> extends BaseProperty<T> {
|
|
310
315
|
dataType: "array";
|
|
311
316
|
/**
|
|
312
317
|
* The property of this array.
|
|
@@ -361,6 +366,11 @@ export interface ArrayProperty<T extends ArrayT[] = any[], ArrayT extends CMSTyp
|
|
|
361
366
|
* Should the field be initially expanded. Defaults to `true`
|
|
362
367
|
*/
|
|
363
368
|
expanded?: boolean;
|
|
369
|
+
/**
|
|
370
|
+
* Display the child properties directly, without being wrapped in an
|
|
371
|
+
* extendable panel.
|
|
372
|
+
*/
|
|
373
|
+
minimalistView?: boolean;
|
|
364
374
|
}
|
|
365
375
|
/**
|
|
366
376
|
* @group Entity properties
|
|
@@ -400,6 +410,11 @@ export interface MapProperty<T extends Record<string, CMSType> = Record<string,
|
|
|
400
410
|
* view
|
|
401
411
|
*/
|
|
402
412
|
spreadChildren?: boolean;
|
|
413
|
+
/**
|
|
414
|
+
* Display the child properties directly, without being wrapped in an
|
|
415
|
+
* extendable panel. Note that this will also hide the title of this property.
|
|
416
|
+
*/
|
|
417
|
+
minimalistView?: boolean;
|
|
403
418
|
/**
|
|
404
419
|
* Should the field be initially expanded. Defaults to `true`
|
|
405
420
|
*/
|
|
@@ -474,6 +489,14 @@ export interface ReferenceProperty extends BaseProperty<EntityReference> {
|
|
|
474
489
|
* specified values are considered.
|
|
475
490
|
*/
|
|
476
491
|
previewProperties?: string[];
|
|
492
|
+
/**
|
|
493
|
+
* Should the reference include the ID of the entity. Defaults to `true`
|
|
494
|
+
*/
|
|
495
|
+
includeId?: boolean;
|
|
496
|
+
/**
|
|
497
|
+
* Should the reference include a link to the entity (open the entity details). Defaults to `true`
|
|
498
|
+
*/
|
|
499
|
+
includeEntityLink?: boolean;
|
|
477
500
|
}
|
|
478
501
|
/**
|
|
479
502
|
* Rules to validate any property. Some properties have specific rules
|
|
@@ -552,7 +575,7 @@ export interface ArrayPropertyValidationSchema extends PropertyValidationSchema
|
|
|
552
575
|
* Additional configuration related to Storage related fields
|
|
553
576
|
* @group Entity properties
|
|
554
577
|
*/
|
|
555
|
-
export
|
|
578
|
+
export type StorageConfig = {
|
|
556
579
|
/**
|
|
557
580
|
* File MIME types that can be uploaded to this reference. Don't specify for
|
|
558
581
|
* all.
|
|
@@ -575,13 +598,13 @@ export interface StorageConfig {
|
|
|
575
598
|
* You can use this prop to customize the uploaded filename.
|
|
576
599
|
* You can use a function as a callback or a string where you
|
|
577
600
|
* specify some placeholders that get replaced with the corresponding values.
|
|
578
|
-
* - {file} - Full file name
|
|
579
|
-
* - {file.name} - Name of the file without extension
|
|
580
|
-
* - {file.ext} - Extension of the file
|
|
581
|
-
* - {rand} - Random value used to avoid name collisions
|
|
582
|
-
* - {entityId} - ID of the entity
|
|
583
|
-
* - {propertyKey} - ID of this property
|
|
584
|
-
* - {path} - Path of this entity
|
|
601
|
+
* - `{file}` - Full file name
|
|
602
|
+
* - `{file.name}` - Name of the file without extension
|
|
603
|
+
* - `{file.ext}` - Extension of the file
|
|
604
|
+
* - `{rand}` - Random value used to avoid name collisions
|
|
605
|
+
* - `{entityId}` - ID of the entity
|
|
606
|
+
* - `{propertyKey}` - ID of this property
|
|
607
|
+
* - `{path}` - Path of this entity
|
|
585
608
|
*
|
|
586
609
|
* @param context
|
|
587
610
|
*/
|
|
@@ -591,13 +614,13 @@ export interface StorageConfig {
|
|
|
591
614
|
*
|
|
592
615
|
* You can use a function as a callback or a string where you
|
|
593
616
|
* specify some placeholders that get replaced with the corresponding values.
|
|
594
|
-
* - {file} - Full file name
|
|
595
|
-
* - {file.name} - Name of the file without extension
|
|
596
|
-
* - {file.ext} - Extension of the file
|
|
597
|
-
* - {rand} - Random value used to avoid name collisions
|
|
598
|
-
* - {entityId} - ID of the entity
|
|
599
|
-
* - {propertyKey} - ID of this property
|
|
600
|
-
* - {path} - Path of this entity
|
|
617
|
+
* - `{file}` - Full file name
|
|
618
|
+
* - `{file.name}` - Name of the file without extension
|
|
619
|
+
* - `{file.ext}` - Extension of the file
|
|
620
|
+
* - `{rand}` - Random value used to avoid name collisions
|
|
621
|
+
* - `{entityId}` - ID of the entity
|
|
622
|
+
* - `{propertyKey}` - ID of this property
|
|
623
|
+
* - `{path}` - Path of this entity
|
|
601
624
|
*/
|
|
602
625
|
storagePath: string | ((context: UploadedFileContext) => string);
|
|
603
626
|
/**
|
|
@@ -620,7 +643,12 @@ export interface StorageConfig {
|
|
|
620
643
|
* after it has been resolved.
|
|
621
644
|
*/
|
|
622
645
|
postProcess?: (pathOrUrl: string) => Promise<string>;
|
|
623
|
-
|
|
646
|
+
/**
|
|
647
|
+
* You can use this prop in order to provide a custom preview URL.
|
|
648
|
+
* Useful when the file's path is different from the original field value
|
|
649
|
+
*/
|
|
650
|
+
previewUrl?: (fileName: string) => string;
|
|
651
|
+
};
|
|
624
652
|
/**
|
|
625
653
|
* @group Entity properties
|
|
626
654
|
*/
|
|
@@ -644,7 +672,7 @@ export interface UploadedFileContext {
|
|
|
644
672
|
/**
|
|
645
673
|
* Entity path. E.g. `products/PID/locales`
|
|
646
674
|
*/
|
|
647
|
-
path
|
|
675
|
+
path?: string;
|
|
648
676
|
/**
|
|
649
677
|
* Values of the current entity
|
|
650
678
|
*/
|
|
@@ -9,7 +9,7 @@ export type PropertyConfig<T extends CMSType = any> = {
|
|
|
9
9
|
/**
|
|
10
10
|
* Key used to identify this property config.
|
|
11
11
|
*/
|
|
12
|
-
key: string;
|
|
12
|
+
key: PropertyConfigId | string;
|
|
13
13
|
/**
|
|
14
14
|
* Name of this field type.
|
|
15
15
|
* This is not the name of the property.
|
|
@@ -19,8 +19,6 @@ export type PropertyConfig<T extends CMSType = any> = {
|
|
|
19
19
|
* Default config for the property.
|
|
20
20
|
* This property or builder will be used as the base values for the resulting property.
|
|
21
21
|
* You can also use a builder function to generate the base property.
|
|
22
|
-
* You can use a builder function to generate the property based on the values or the path.
|
|
23
|
-
* You can also define a custom Field as a React component to be used for this property.
|
|
24
22
|
*/
|
|
25
23
|
property: PropertyOrBuilder<T>;
|
|
26
24
|
/**
|
|
@@ -39,4 +37,4 @@ export type PropertyConfig<T extends CMSType = any> = {
|
|
|
39
37
|
*/
|
|
40
38
|
description?: string;
|
|
41
39
|
};
|
|
42
|
-
export type
|
|
40
|
+
export type PropertyConfigId = "text_field" | "multiline" | "markdown" | "url" | "email" | "select" | "multi_select" | "number_input" | "number_select" | "multi_number_select" | "file_upload" | "multi_file_upload" | "group" | "key_value" | "reference" | "multi_references" | "switch" | "date_time" | "repeat" | "custom_array" | "block";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Permissions } from "../index";
|
|
2
|
+
export type Role = {
|
|
3
|
+
/**
|
|
4
|
+
* ID of the role
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
/**
|
|
8
|
+
* Name of the role
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* If this flag is true, the user can perform any action
|
|
13
|
+
*/
|
|
14
|
+
isAdmin?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Default permissions for all collections for this role.
|
|
17
|
+
* You can override this values at the collection level using
|
|
18
|
+
* {@link collectionPermissions}
|
|
19
|
+
*/
|
|
20
|
+
defaultPermissions?: Permissions;
|
|
21
|
+
/**
|
|
22
|
+
* Record of stripped collection ids to their permissions.
|
|
23
|
+
* @see stripCollectionPath
|
|
24
|
+
*/
|
|
25
|
+
collectionPermissions?: Record<string, Permissions>;
|
|
26
|
+
config?: {
|
|
27
|
+
createCollections?: boolean;
|
|
28
|
+
editCollections?: boolean | "own";
|
|
29
|
+
deleteCollections?: boolean | "own";
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
/**
|
|
2
3
|
* Controller to open the side dialog
|
|
3
4
|
* @group Hooks and utilities
|
|
@@ -11,6 +12,11 @@ export interface SideDialogsController {
|
|
|
11
12
|
* List of side panels currently open
|
|
12
13
|
*/
|
|
13
14
|
sidePanels: SideDialogPanelProps[];
|
|
15
|
+
/**
|
|
16
|
+
* Override the current side panels
|
|
17
|
+
* @param panels
|
|
18
|
+
*/
|
|
19
|
+
setSidePanels: (panels: SideDialogPanelProps[]) => void;
|
|
14
20
|
/**
|
|
15
21
|
* Open one or multiple side panels
|
|
16
22
|
* @param props
|
|
@@ -54,4 +60,8 @@ export interface SideDialogPanelProps {
|
|
|
54
60
|
* Callback when the panel is closed
|
|
55
61
|
*/
|
|
56
62
|
onClose?: () => void;
|
|
63
|
+
/**
|
|
64
|
+
* Use this prop to store additional data in the panel
|
|
65
|
+
*/
|
|
66
|
+
additional?: any;
|
|
57
67
|
}
|