@firecms/core 3.0.0-alpha.71 → 3.0.0-alpha.73
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/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +5 -5
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +1 -1
- package/dist/components/EntityCollectionTable/index.d.ts +1 -1
- package/dist/components/EntityCollectionTable/types.d.ts +15 -1
- package/dist/components/EntityCollectionTable/useDataSourceEntityCollectionTableController.d.ts +32 -0
- package/dist/components/SearchIconsView.d.ts +5 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/hooks/useVerifyLicense.d.ts +0 -0
- package/dist/index.es.js +8808 -6804
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/util/icon_list.d.ts +1 -0
- package/dist/util/icon_synonyms.d.ts +1950 -0
- package/dist/util/index.d.ts +2 -0
- package/package.json +3 -5
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +5 -6
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +1 -1
- package/src/components/EntityCollectionTable/index.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +2 -2
- package/src/components/EntityCollectionTable/types.tsx +15 -1
- package/src/components/EntityCollectionTable/{useEntityCollectionTableController.tsx → useDataSourceEntityCollectionTableController.tsx} +16 -4
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +2 -2
- package/src/components/ReferenceSelectionInner.tsx +2 -2
- package/src/components/SearchIconsView.tsx +75 -0
- package/src/components/VirtualTable/VirtualTableRow.tsx +0 -1
- package/src/components/index.tsx +1 -0
- package/src/core/EntitySidePanel.tsx +0 -1
- package/src/form/EntityForm.tsx +6 -5
- package/src/form/PropertyFieldBinding.tsx +1 -1
- package/src/form/validation.ts +5 -1
- package/src/hooks/useVerifyLicense.tsx +1 -0
- package/src/internal/EntityView.tsx +6 -6
- package/src/internal/useBuildDataSource.ts +0 -2
- package/src/internal/useBuildSideEntityController.tsx +26 -15
- package/src/preview/property_previews/MapPropertyPreview.tsx +3 -1
- package/src/preview/property_previews/StringPropertyPreview.tsx +1 -2
- package/src/util/enums.ts +1 -2
- package/src/util/icon_list.ts +17 -0
- package/src/util/icon_synonyms.ts +1950 -0
- package/src/util/index.ts +2 -0
- package/dist/components/EntityCollectionTable/useEntityCollectionTableController.d.ts +0 -21
- package/dist/util/chip_utils.d.ts +0 -3
- package/src/components/ArrayContainer.d.ts +0 -42
- package/src/components/CircularProgressCenter.d.ts +0 -11
- package/src/components/DeleteConfirmationDialog.d.ts +0 -9
- package/src/components/EntityCollectionTable/EntityCollectionTable.d.ts +0 -30
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +0 -106
- package/src/components/EntityCollectionTable/fields/TableReferenceField.d.ts +0 -15
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +0 -33
- package/src/components/EntityCollectionTable/filters/BooleanFilterField.d.ts +0 -9
- package/src/components/EntityCollectionTable/filters/DateTimeFilterField.d.ts +0 -11
- package/src/components/EntityCollectionTable/filters/ReferenceFilterField.d.ts +0 -14
- package/src/components/EntityCollectionTable/filters/StringNumberFilterField.d.ts +0 -13
- package/src/components/EntityCollectionTable/index.d.ts +0 -4
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +0 -18
- package/src/components/EntityCollectionTable/internal/DeleteEntityDialog.d.ts +0 -12
- package/src/components/EntityCollectionTable/internal/EntityCollectionRowActions.d.ts +0 -35
- package/src/components/EntityCollectionTable/internal/EntityTableCell.d.ts +0 -26
- package/src/components/EntityCollectionTable/internal/EntityTableCellActions.d.ts +0 -9
- package/src/components/EntityCollectionTable/internal/PropertyTableCell.d.ts +0 -18
- package/src/components/EntityCollectionTable/internal/common.d.ts +0 -4
- package/src/components/EntityCollectionTable/internal/default_entity_actions.d.ts +0 -6
- package/src/components/EntityCollectionTable/internal/popup_field/ElementResizeListener.d.ts +0 -5
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +0 -23
- package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.d.ts +0 -13
- package/src/components/EntityCollectionTable/internal/popup_field/useWindowSize.d.ts +0 -6
- package/src/components/EntityCollectionTable/types.d.ts +0 -39
- package/src/components/EntityCollectionTable/useDebouncedData.d.ts +0 -9
- package/src/components/EntityCollectionTable/useEntityCollectionTableController.d.ts +0 -21
- package/src/components/EntityCollectionView/EntityCollectionView.d.ts +0 -37
- package/src/components/EntityCollectionView/EntityCollectionViewActions.d.ts +0 -14
- package/src/components/EntityCollectionView/useColumnsIds.d.ts +0 -4
- package/src/components/EntityPreview.d.ts +0 -11
- package/src/components/ErrorBoundary.d.ts +0 -11
- package/src/components/ErrorTooltip.d.ts +0 -2
- package/src/components/ErrorView.d.ts +0 -19
- package/src/components/FieldConfigBadge.d.ts +0 -4
- package/src/components/FireCMSAppBar.d.ts +0 -26
- package/src/components/FireCMSLogo.d.ts +0 -7
- package/src/components/HomePage/DefaultHomePage.d.ts +0 -21
- package/src/components/HomePage/FavouritesView.d.ts +0 -3
- package/src/components/HomePage/NavigationCollectionCard.d.ts +0 -17
- package/src/components/HomePage/NavigationGroup.d.ts +0 -4
- package/src/components/HomePage/index.d.ts +0 -3
- package/src/components/LabelWithIcon.d.ts +0 -14
- package/src/components/NotFoundPage.d.ts +0 -1
- package/src/components/ReferenceSelectionInner.d.ts +0 -58
- package/src/components/ReferenceWidget.d.ts +0 -28
- package/src/components/VirtualTable/VirtualTable.d.ts +0 -11
- package/src/components/VirtualTable/VirtualTableCell.d.ts +0 -14
- package/src/components/VirtualTable/VirtualTableHeader.d.ts +0 -27
- package/src/components/VirtualTable/VirtualTableHeaderRow.d.ts +0 -2
- package/src/components/VirtualTable/VirtualTableProps.d.ts +0 -215
- package/src/components/VirtualTable/VirtualTableRow.d.ts +0 -3
- package/src/components/VirtualTable/common.d.ts +0 -2
- package/src/components/VirtualTable/fields/VirtualTableDateField.d.ts +0 -11
- package/src/components/VirtualTable/fields/VirtualTableInput.d.ts +0 -8
- package/src/components/VirtualTable/fields/VirtualTableNumberInput.d.ts +0 -8
- package/src/components/VirtualTable/fields/VirtualTableSelect.d.ts +0 -15
- package/src/components/VirtualTable/fields/VirtualTableSwitch.d.ts +0 -7
- package/src/components/VirtualTable/index.d.ts +0 -2
- package/src/components/VirtualTable/types.d.ts +0 -34
- package/src/components/index.d.ts +0 -20
- package/src/contexts/AuthControllerContext.d.ts +0 -3
- package/src/contexts/DataSourceContext.d.ts +0 -3
- package/src/contexts/DialogsProvider.d.ts +0 -4
- package/src/contexts/ModeController.d.ts +0 -4
- package/src/contexts/NavigationContext.d.ts +0 -3
- package/src/contexts/SideDialogsControllerContext.d.ts +0 -3
- package/src/contexts/SideEntityControllerContext.d.ts +0 -3
- package/src/contexts/SnackbarProvider.d.ts +0 -2
- package/src/contexts/StorageSourceContext.d.ts +0 -3
- package/src/contexts/UserConfigurationPersistenceContext.d.ts +0 -3
- package/src/contexts/index.d.ts +0 -3
- package/src/core/Drawer.d.ts +0 -23
- package/src/core/EntitySidePanel.d.ts +0 -10
- package/src/core/FireCMS.d.ts +0 -14
- package/src/core/NavigationRoutes.d.ts +0 -21
- package/src/core/Scaffold.d.ts +0 -52
- package/src/core/SideDialogs.d.ts +0 -23
- package/src/core/field_configs.d.ts +0 -7
- package/src/core/index.d.ts +0 -10
- package/src/core/useBuildLocalConfigurationPersistence.d.ts +0 -2
- package/src/core/useBuildModeController.d.ts +0 -6
- package/src/form/EntityForm.d.ts +0 -75
- package/src/form/PropertyFieldBinding.d.ts +0 -30
- package/src/form/components/CustomIdField.d.ts +0 -9
- package/src/form/components/ErrorFocus.d.ts +0 -4
- package/src/form/components/FieldHelperText.d.ts +0 -12
- package/src/form/components/FormikArrayContainer.d.ts +0 -18
- package/src/form/components/StorageItemPreview.d.ts +0 -13
- package/src/form/components/StorageUploadProgress.d.ts +0 -10
- package/src/form/components/SwitchControl.d.ts +0 -8
- package/src/form/components/index.d.ts +0 -3
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +0 -9
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +0 -11
- package/src/form/field_bindings/BlockFieldBinding.d.ts +0 -10
- package/src/form/field_bindings/DateTimeFieldBinding.d.ts +0 -11
- package/src/form/field_bindings/KeyValueFieldBinding.d.ts +0 -7
- package/src/form/field_bindings/MapFieldBinding.d.ts +0 -9
- package/src/form/field_bindings/MarkdownFieldBinding.d.ts +0 -9
- package/src/form/field_bindings/MultiSelectBinding.d.ts +0 -9
- package/src/form/field_bindings/ReadOnlyFieldBinding.d.ts +0 -10
- package/src/form/field_bindings/ReferenceFieldBinding.d.ts +0 -9
- package/src/form/field_bindings/RepeatFieldBinding.d.ts +0 -10
- package/src/form/field_bindings/SelectFieldBinding.d.ts +0 -12
- package/src/form/field_bindings/StorageUploadFieldBinding.d.ts +0 -28
- package/src/form/field_bindings/SwitchFieldBinding.d.ts +0 -12
- package/src/form/field_bindings/TextFieldBinding.d.ts +0 -12
- package/src/form/index.d.ts +0 -20
- package/src/form/useClearRestoreValue.d.ts +0 -13
- package/src/form/validation.d.ts +0 -25
- package/src/hooks/data/delete.d.ts +0 -37
- package/src/hooks/data/save.d.ts +0 -42
- package/src/hooks/data/useCollectionFetch.d.ts +0 -50
- package/src/hooks/data/useDataOrder.d.ts +0 -12
- package/src/hooks/data/useDataSource.d.ts +0 -6
- package/src/hooks/data/useEntityFetch.d.ts +0 -28
- package/src/hooks/index.d.ts +0 -19
- package/src/hooks/useAuthController.d.ts +0 -11
- package/src/hooks/useBrowserTitleAndIcon.d.ts +0 -6
- package/src/hooks/useClipboard.d.ts +0 -57
- package/src/hooks/useDialogsController.d.ts +0 -11
- package/src/hooks/useFireCMSContext.d.ts +0 -12
- package/src/hooks/useLargeLayout.d.ts +0 -1
- package/src/hooks/useModeController.d.ts +0 -20
- package/src/hooks/useNavigationController.d.ts +0 -9
- package/src/hooks/useReferenceDialog.d.ts +0 -18
- package/src/hooks/useResolvedNavigationFrom.d.ts +0 -72
- package/src/hooks/useSideDialogsController.d.ts +0 -18
- package/src/hooks/useSideEntityController.d.ts +0 -12
- package/src/hooks/useSnackbarController.d.ts +0 -41
- package/src/hooks/useStorageSource.d.ts +0 -6
- package/src/hooks/useUserConfigurationPersistence.d.ts +0 -8
- package/src/index.d.ts +0 -8
- package/src/internal/EntityView.d.ts +0 -22
- package/src/internal/common.d.ts +0 -3
- package/src/internal/useBuildDataSource.d.ts +0 -22
- package/src/internal/useBuildNavigationController.d.ts +0 -14
- package/src/internal/useBuildSideDialogsController.d.ts +0 -2
- package/src/internal/useBuildSideEntityController.d.ts +0 -4
- package/src/internal/useLocaleConfig.d.ts +0 -1
- package/src/internal/useRestoreScroll.d.ts +0 -6
- package/src/internal/useUnsavedChangesDialog.d.ts +0 -14
- package/src/preview/PropertyPreview.d.ts +0 -7
- package/src/preview/PropertyPreviewProps.d.ts +0 -43
- package/src/preview/components/ArrayEnumPreview.d.ts +0 -11
- package/src/preview/components/AsyncPreviewComponent.d.ts +0 -11
- package/src/preview/components/BooleanPreview.d.ts +0 -7
- package/src/preview/components/DatePreview.d.ts +0 -7
- package/src/preview/components/EmptyValue.d.ts +0 -4
- package/src/preview/components/EnumValuesChip.d.ts +0 -13
- package/src/preview/components/ImagePreview.d.ts +0 -12
- package/src/preview/components/ReferencePreview.d.ts +0 -22
- package/src/preview/components/StorageThumbnail.d.ts +0 -13
- package/src/preview/components/UrlComponentPreview.d.ts +0 -12
- package/src/preview/index.d.ts +0 -23
- package/src/preview/property_previews/ArrayOfMapsPreview.d.ts +0 -5
- package/src/preview/property_previews/ArrayOfReferencesPreview.d.ts +0 -5
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +0 -5
- package/src/preview/property_previews/ArrayOfStringsPreview.d.ts +0 -5
- package/src/preview/property_previews/ArrayOneOfPreview.d.ts +0 -5
- package/src/preview/property_previews/ArrayPropertyEnumPreview.d.ts +0 -5
- package/src/preview/property_previews/ArrayPropertyPreview.d.ts +0 -5
- package/src/preview/property_previews/MapPropertyPreview.d.ts +0 -8
- package/src/preview/property_previews/NumberPropertyPreview.d.ts +0 -6
- package/src/preview/property_previews/SkeletonPropertyComponent.d.ts +0 -14
- package/src/preview/property_previews/StringPropertyPreview.d.ts +0 -6
- package/src/preview/util.d.ts +0 -7
- package/src/types/analytics.d.ts +0 -1
- package/src/types/appcheck.d.ts +0 -26
- package/src/types/auth.d.ts +0 -40
- package/src/types/collections.d.ts +0 -451
- package/src/types/datasource.d.ts +0 -262
- package/src/types/dialogs_controller.d.ts +0 -32
- package/src/types/entities.d.ts +0 -57
- package/src/types/entity_actions.d.ts +0 -35
- package/src/types/entity_callbacks.d.ts +0 -171
- package/src/types/entity_link_builder.d.ts +0 -7
- package/src/types/export_import.d.ts +0 -21
- package/src/types/fields.d.ts +0 -181
- package/src/types/firecms.d.ts +0 -151
- package/src/types/firecms_context.d.ts +0 -110
- package/src/types/index.d.ts +0 -26
- package/src/types/local_config_persistence.d.ts +0 -21
- package/src/types/locales.d.ts +0 -4
- package/src/types/modify_collections.d.ts +0 -5
- package/src/types/navigation.d.ts +0 -178
- package/src/types/permissions.d.ts +0 -63
- package/src/types/plugins.d.ts +0 -179
- package/src/types/properties.d.ts +0 -681
- package/src/types/property_config.d.ts +0 -42
- package/src/types/resolved_entities.d.ts +0 -98
- package/src/types/side_dialogs_controller.d.ts +0 -57
- package/src/types/side_entity_controller.d.ts +0 -83
- package/src/types/storage.d.ts +0 -82
- package/src/types/user.d.ts +0 -36
- package/src/util/arrays.d.ts +0 -1
- package/src/util/builders.d.ts +0 -64
- package/src/util/chip_utils.d.ts +0 -3
- package/src/util/chip_utils.ts +0 -13
- package/src/util/collections.d.ts +0 -3
- package/src/util/common.d.ts +0 -2
- package/src/util/dates.d.ts +0 -1
- package/src/util/entities.d.ts +0 -28
- package/src/util/enums.d.ts +0 -7
- package/src/util/flatten_object.d.ts +0 -3
- package/src/util/hash.d.ts +0 -1
- package/src/util/icons.d.ts +0 -4
- package/src/util/index.d.ts +0 -20
- package/src/util/join_collections.d.ts +0 -9
- package/src/util/make_properties_editable.d.ts +0 -3
- package/src/util/navigation_from_path.d.ts +0 -24
- package/src/util/navigation_utils.d.ts +0 -20
- package/src/util/objects.d.ts +0 -10
- package/src/util/parent_references_from_path.d.ts +0 -6
- package/src/util/paths.d.ts +0 -14
- package/src/util/permissions.d.ts +0 -5
- package/src/util/plurals.d.ts +0 -18
- package/src/util/property_utils.d.ts +0 -23
- package/src/util/references.d.ts +0 -2
- package/src/util/regexp.d.ts +0 -7
- package/src/util/resolutions.d.ts +0 -64
- package/src/util/storage.d.ts +0 -3
- package/src/util/strings.d.ts +0 -6
- package/src/util/useDebounce.d.ts +0 -1
- package/src/util/useStorageUploadController.d.ts +0 -36
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { User } from "./user";
|
|
2
|
-
import { AuthController } from "./auth";
|
|
3
|
-
import { EntityCollection, InferCollectionType } from "./collections";
|
|
4
|
-
import { Entity } from "./entities";
|
|
5
|
-
/**
|
|
6
|
-
* Define the operations that can be performed in a collection.
|
|
7
|
-
* @group Models
|
|
8
|
-
*/
|
|
9
|
-
export interface Permissions {
|
|
10
|
-
/**
|
|
11
|
-
* Can the user see this collection.
|
|
12
|
-
* If `false` it will not show in the user's navigation
|
|
13
|
-
* Defaults to `true`
|
|
14
|
-
*/
|
|
15
|
-
read?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Can the user add new entities. Defaults to `true`
|
|
18
|
-
*/
|
|
19
|
-
create?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Can the elements in this collection be edited. Defaults to `true`
|
|
22
|
-
*/
|
|
23
|
-
edit?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Can the user delete entities. Defaults to `true`
|
|
26
|
-
*/
|
|
27
|
-
delete?: boolean;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Props passed to a {@link PermissionsBuilder}
|
|
31
|
-
* @group Models
|
|
32
|
-
*/
|
|
33
|
-
export interface PermissionsBuilderProps<EC extends EntityCollection = EntityCollection, UserType extends User = User, M extends object = InferCollectionType<EC>> {
|
|
34
|
-
/**
|
|
35
|
-
* Entity being edited, might be null in some cases, when the operation
|
|
36
|
-
* refers to the collection.
|
|
37
|
-
* For example, when deciding whether a user can create a new entity
|
|
38
|
-
* in a collection, the entity will be null.
|
|
39
|
-
*/
|
|
40
|
-
entity: Entity<M> | null;
|
|
41
|
-
/**
|
|
42
|
-
* Path segments of the collection e.g. ['products', 'locales']
|
|
43
|
-
*/
|
|
44
|
-
pathSegments: string[];
|
|
45
|
-
/**
|
|
46
|
-
* Logged in user
|
|
47
|
-
*/
|
|
48
|
-
user: UserType | null;
|
|
49
|
-
/**
|
|
50
|
-
* Collection these permissions apply to
|
|
51
|
-
*/
|
|
52
|
-
collection: EC;
|
|
53
|
-
/**
|
|
54
|
-
* Auth controller
|
|
55
|
-
*/
|
|
56
|
-
authController: AuthController<UserType>;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Builder used to assign permissions to entities,
|
|
60
|
-
* based on the logged user or collection.
|
|
61
|
-
* @group Models
|
|
62
|
-
*/
|
|
63
|
-
export type PermissionsBuilder<EC extends EntityCollection = EntityCollection, UserType extends User = User, M extends object = InferCollectionType<EC>> = (({ pathSegments, user, collection, authController }: PermissionsBuilderProps<EC, UserType, M>) => Permissions);
|
package/src/types/plugins.d.ts
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from "react";
|
|
2
|
-
import { FireCMSContext } from "./firecms_context";
|
|
3
|
-
import { CollectionActionsProps, EntityCollection } from "./collections";
|
|
4
|
-
import { User } from "./user";
|
|
5
|
-
import { FieldProps, FormContext } from "./fields";
|
|
6
|
-
import { CMSType, Property } from "./properties";
|
|
7
|
-
import { EntityStatus } from "./entities";
|
|
8
|
-
import { ResolvedProperty } from "./resolved_entities";
|
|
9
|
-
/**
|
|
10
|
-
* Interface used to define plugins for FireCMS.
|
|
11
|
-
* NOTE: This is a work in progress and the API is not stable yet.
|
|
12
|
-
* @group Core
|
|
13
|
-
*/
|
|
14
|
-
export type FireCMSPlugin<PROPS = any, FORM_PROPS = any, EC extends EntityCollection = EntityCollection, COL_ACTIONS_PROPS = any> = {
|
|
15
|
-
/**
|
|
16
|
-
* Name of the plugin
|
|
17
|
-
*/
|
|
18
|
-
name: string;
|
|
19
|
-
/**
|
|
20
|
-
* If this flag is set to true, no content will be shown in the CMS
|
|
21
|
-
* until the plugin is fully loaded.
|
|
22
|
-
*/
|
|
23
|
-
loading?: boolean;
|
|
24
|
-
collections?: {
|
|
25
|
-
/**
|
|
26
|
-
* Use this method to inject collections to the CMS.
|
|
27
|
-
* You receive the current collections as a parameter, and you can return
|
|
28
|
-
* a new list of collections.
|
|
29
|
-
* @see {@link joinCollectionLists}
|
|
30
|
-
* @param collections
|
|
31
|
-
*/
|
|
32
|
-
injectCollections?: (collections: EntityCollection[]) => EntityCollection[];
|
|
33
|
-
/**
|
|
34
|
-
* Use this component to add custom actions to the entity collections
|
|
35
|
-
* toolbar.
|
|
36
|
-
*/
|
|
37
|
-
CollectionActions?: React.ComponentType<CollectionActionsProps<any, any, EC> & COL_ACTIONS_PROPS> | React.ComponentType<CollectionActionsProps<any, any, EC> & COL_ACTIONS_PROPS>[];
|
|
38
|
-
collectionActionsProps?: COL_ACTIONS_PROPS;
|
|
39
|
-
};
|
|
40
|
-
form?: {
|
|
41
|
-
provider?: {
|
|
42
|
-
Component: React.ComponentType<PropsWithChildren<FORM_PROPS & PluginFormActionProps<any, EC>>>;
|
|
43
|
-
props?: FORM_PROPS;
|
|
44
|
-
};
|
|
45
|
-
Actions?: React.ComponentType<PluginFormActionProps<any, EC>>;
|
|
46
|
-
fieldBuilder?: <T extends CMSType = CMSType>(props: PluginFieldBuilderParams<T, any, EC>) => React.ComponentType<FieldProps<T>> | null;
|
|
47
|
-
fieldBuilderEnabled?: <T extends CMSType = CMSType>(props: PluginFieldBuilderParams<T>) => boolean;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* You can use this prop to add higher order components to the CMS.
|
|
51
|
-
* The components will be added to the root of the CMS, so any component
|
|
52
|
-
* rendered underneath by this plugin will have access to the context
|
|
53
|
-
* provided by this HOC.
|
|
54
|
-
* Anyhow, this is rendered below the {@link FireCMSContext} provider, so
|
|
55
|
-
* you can use the hooks provided by the CMS.
|
|
56
|
-
* @param props
|
|
57
|
-
*/
|
|
58
|
-
provider?: {
|
|
59
|
-
Component: React.ComponentType<PropsWithChildren<PROPS & {
|
|
60
|
-
context: FireCMSContext;
|
|
61
|
-
}>>;
|
|
62
|
-
props?: PROPS;
|
|
63
|
-
};
|
|
64
|
-
homePage?: {
|
|
65
|
-
/**
|
|
66
|
-
* Additional actions to be rendered in the home page, close to the search bar.
|
|
67
|
-
*/
|
|
68
|
-
additionalActions?: React.ReactNode;
|
|
69
|
-
/**
|
|
70
|
-
* Additional children to be rendered in the beginning of the home page.
|
|
71
|
-
*/
|
|
72
|
-
additionalChildrenStart?: React.ReactNode;
|
|
73
|
-
/**
|
|
74
|
-
* Additional children to be rendered at the end of the home page.
|
|
75
|
-
*/
|
|
76
|
-
additionalChildrenEnd?: React.ReactNode;
|
|
77
|
-
/**
|
|
78
|
-
* Use this component to add custom actions to the navigation card
|
|
79
|
-
* in the home page.
|
|
80
|
-
*/
|
|
81
|
-
CollectionActions?: React.ComponentType<PluginHomePageActionsProps>;
|
|
82
|
-
/**
|
|
83
|
-
* Additional props passed to `CollectionActions`
|
|
84
|
-
*/
|
|
85
|
-
extraProps?: any;
|
|
86
|
-
/**
|
|
87
|
-
* Add additional cards to each collection group in the home page.
|
|
88
|
-
*/
|
|
89
|
-
AdditionalCards?: React.ComponentType<PluginHomePageAdditionalCardsProps> | React.ComponentType<PluginHomePageAdditionalCardsProps>[];
|
|
90
|
-
/**
|
|
91
|
-
* Include a section in the home page with a custom component and title.
|
|
92
|
-
* @param props
|
|
93
|
-
*/
|
|
94
|
-
includeSection?: (props: PluginGenericProps) => {
|
|
95
|
-
title: string;
|
|
96
|
-
children: React.ReactNode;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
collectionView?: {
|
|
100
|
-
showTextSearchBar?: (props: {
|
|
101
|
-
context: FireCMSContext;
|
|
102
|
-
path: string;
|
|
103
|
-
collection: EC;
|
|
104
|
-
}) => boolean;
|
|
105
|
-
onTextSearchClick?: (props: {
|
|
106
|
-
context: FireCMSContext;
|
|
107
|
-
path: string;
|
|
108
|
-
collection: EC;
|
|
109
|
-
}) => Promise<boolean>;
|
|
110
|
-
/**
|
|
111
|
-
* Use this method to inject widgets to the entity collections header
|
|
112
|
-
* @param props
|
|
113
|
-
*/
|
|
114
|
-
HeaderAction?: React.ComponentType<{
|
|
115
|
-
property: ResolvedProperty;
|
|
116
|
-
propertyKey: string;
|
|
117
|
-
fullPath: string;
|
|
118
|
-
parentCollectionIds: string[];
|
|
119
|
-
onHover: boolean;
|
|
120
|
-
collection: EC;
|
|
121
|
-
}>;
|
|
122
|
-
/**
|
|
123
|
-
* If you add this callback to your plugin, an add button will be added to the collection table.
|
|
124
|
-
* TODO: Only the first plugin that defines this callback will be used, at the moment.
|
|
125
|
-
*/
|
|
126
|
-
AddColumnComponent?: React.ComponentType<{
|
|
127
|
-
fullPath: string;
|
|
128
|
-
parentCollectionIds: string[];
|
|
129
|
-
collection: EC;
|
|
130
|
-
}>;
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* Props passed to the {@link FireCMSPlugin.homePage.CollectionActions} method.
|
|
135
|
-
* You can use it to add custom actions to the navigation card of each collection.
|
|
136
|
-
*
|
|
137
|
-
* @group Models
|
|
138
|
-
*/
|
|
139
|
-
export interface PluginHomePageActionsProps<EP extends object = object, M extends Record<string, any> = any, UserType extends User = User, EC extends EntityCollection<M> = EntityCollection<M>> {
|
|
140
|
-
/**
|
|
141
|
-
* Collection path of this entity. This is the full path, like
|
|
142
|
-
* `users/1234/addresses`
|
|
143
|
-
*/
|
|
144
|
-
path: string;
|
|
145
|
-
/**
|
|
146
|
-
* The collection configuration
|
|
147
|
-
*/
|
|
148
|
-
collection: EC;
|
|
149
|
-
/**
|
|
150
|
-
* Context of the app status
|
|
151
|
-
*/
|
|
152
|
-
context: FireCMSContext<UserType>;
|
|
153
|
-
extraProps?: EP;
|
|
154
|
-
}
|
|
155
|
-
export interface PluginFormActionProps<UserType extends User = User, EC extends EntityCollection = EntityCollection> {
|
|
156
|
-
entityId?: string;
|
|
157
|
-
path: string;
|
|
158
|
-
status: EntityStatus;
|
|
159
|
-
collection: EC;
|
|
160
|
-
formContext?: FormContext<any>;
|
|
161
|
-
context: FireCMSContext<UserType>;
|
|
162
|
-
currentEntityId?: string;
|
|
163
|
-
}
|
|
164
|
-
export type PluginFieldBuilderParams<T extends CMSType = CMSType, M extends Record<string, any> = any, EC extends EntityCollection<M> = EntityCollection<M>> = {
|
|
165
|
-
fieldConfigId: string;
|
|
166
|
-
propertyKey: string;
|
|
167
|
-
property: Property<T> | ResolvedProperty<T>;
|
|
168
|
-
Field: React.ComponentType<FieldProps<T, any, M>>;
|
|
169
|
-
plugin: FireCMSPlugin;
|
|
170
|
-
path: string;
|
|
171
|
-
collection: EC;
|
|
172
|
-
};
|
|
173
|
-
export interface PluginGenericProps<UserType extends User = User> {
|
|
174
|
-
context: FireCMSContext<UserType>;
|
|
175
|
-
}
|
|
176
|
-
export interface PluginHomePageAdditionalCardsProps<UserType extends User = User> {
|
|
177
|
-
group?: string;
|
|
178
|
-
context: FireCMSContext<UserType>;
|
|
179
|
-
}
|