@firecms/core 3.0.0-canary.7 → 3.0.0-canary.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/app/AppBar.d.ts +12 -0
- package/dist/app/Drawer.d.ts +17 -0
- package/dist/app/Scaffold.d.ts +30 -0
- package/dist/app/index.d.ts +4 -0
- package/dist/app/useApp.d.ts +16 -0
- package/dist/components/ClearFilterSortButton.d.ts +5 -0
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +11 -11
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -2
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +5 -3
- package/dist/components/EntityCollectionTable/PropertyTableCell.d.ts +3 -2
- package/dist/components/EntityCollectionTable/column_utils.d.ts +1 -2
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +2 -0
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +1 -4
- package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +2 -2
- package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +1 -1
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +12 -3
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +11 -0
- package/dist/components/EntityCollectionView/useSelectionController.d.ts +2 -0
- package/dist/components/EntityPreview.d.ts +26 -7
- package/dist/components/EntityView.d.ts +11 -0
- package/dist/components/FieldCaption.d.ts +5 -0
- package/dist/components/HomePage/NavigationCard.d.ts +8 -0
- package/dist/components/HomePage/{NavigationCollectionCard.d.ts → NavigationCardBinding.d.ts} +2 -2
- package/dist/components/HomePage/SmallNavigationCard.d.ts +6 -0
- package/dist/components/HomePage/index.d.ts +3 -1
- package/dist/components/ReferenceWidget.d.ts +3 -1
- package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -1
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +6 -7
- package/dist/components/VirtualTable/types.d.ts +3 -3
- package/dist/components/{EntityCollectionTable/internal → common}/default_entity_actions.d.ts +1 -1
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/common/table_height.d.ts +5 -0
- package/dist/components/common/types.d.ts +4 -6
- package/dist/components/common/useDataSourceEntityCollectionTableController.d.ts +3 -0
- package/dist/components/index.d.ts +6 -3
- package/dist/contexts/AuthControllerContext.d.ts +1 -1
- package/dist/{components/FireCMSAppBar.d.ts → core/DefaultAppBar.d.ts} +5 -8
- package/dist/core/DefaultDrawer.d.ts +19 -0
- package/dist/core/DrawerNavigationItem.d.ts +9 -0
- package/dist/core/EntityEditView.d.ts +36 -0
- package/dist/core/NavigationRoutes.d.ts +2 -2
- package/dist/core/index.d.ts +3 -4
- package/dist/form/PropertiesForm.d.ts +8 -0
- package/dist/form/components/ErrorFocus.d.ts +1 -1
- package/dist/form/components/FieldHelperText.d.ts +3 -3
- package/dist/form/components/StorageItemPreview.d.ts +2 -3
- package/dist/form/components/StorageUploadProgress.d.ts +1 -1
- package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +3 -4
- package/dist/form/field_bindings/TextFieldBinding.d.ts +2 -2
- package/dist/form/index.d.ts +0 -2
- package/dist/form/validation.d.ts +1 -1
- package/dist/hooks/data/delete.d.ts +2 -2
- package/dist/hooks/data/save.d.ts +2 -3
- package/dist/hooks/data/useDataSource.d.ts +2 -2
- package/dist/hooks/data/useEntityFetch.d.ts +3 -3
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useBuildNavigationController.d.ts +6 -4
- package/dist/hooks/useProjectLog.d.ts +6 -2
- package/dist/hooks/useStorageSource.d.ts +2 -2
- package/dist/hooks/useValidateAuthenticator.d.ts +21 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +10512 -9997
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/internal/useBuildDataSource.d.ts +1 -16
- package/dist/preview/PropertyPreview.d.ts +1 -1
- package/dist/preview/PropertyPreviewProps.d.ts +1 -4
- package/dist/preview/components/BooleanPreview.d.ts +5 -1
- package/dist/preview/components/EnumValuesChip.d.ts +1 -1
- package/dist/preview/components/ReferencePreview.d.ts +3 -8
- package/dist/types/analytics.d.ts +1 -1
- package/dist/types/auth.d.ts +37 -1
- package/dist/types/collections.d.ts +44 -6
- package/dist/types/datasource.d.ts +21 -14
- package/dist/types/entities.d.ts +5 -1
- package/dist/types/entity_actions.d.ts +14 -0
- package/dist/types/entity_callbacks.d.ts +2 -2
- package/dist/types/entity_overrides.d.ts +6 -0
- package/dist/types/fields.d.ts +31 -30
- package/dist/types/index.d.ts +2 -1
- package/dist/types/navigation.d.ts +15 -14
- package/dist/types/permissions.d.ts +5 -1
- package/dist/types/plugins.d.ts +22 -22
- package/dist/types/properties.d.ts +13 -5
- package/dist/types/property_config.d.ts +2 -2
- package/dist/types/roles.d.ts +31 -0
- package/dist/types/storage.d.ts +11 -3
- package/dist/types/user.d.ts +5 -0
- package/dist/util/collections.d.ts +9 -1
- package/dist/util/entities.d.ts +1 -1
- package/dist/util/icon_synonyms.d.ts +1 -97
- package/dist/util/icons.d.ts +8 -2
- package/dist/util/navigation_utils.d.ts +2 -2
- package/dist/util/objects.d.ts +1 -1
- package/dist/util/permissions.d.ts +4 -4
- package/dist/util/references.d.ts +4 -2
- package/dist/util/resolutions.d.ts +14 -14
- package/dist/util/storage.d.ts +23 -2
- package/dist/util/useStorageUploadController.d.ts +1 -1
- package/dist/util/useTraceUpdate.d.ts +1 -0
- package/package.json +139 -119
- package/src/app/AppBar.tsx +18 -0
- package/src/app/Drawer.tsx +25 -0
- package/src/app/Scaffold.tsx +249 -0
- package/src/app/index.ts +4 -0
- package/src/app/useApp.tsx +32 -0
- package/src/components/ClearFilterSortButton.tsx +41 -0
- package/src/components/DeleteEntityDialog.tsx +4 -4
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +4 -4
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +276 -279
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +9 -5
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +48 -45
- package/src/components/EntityCollectionTable/column_utils.tsx +3 -3
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +18 -17
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +5 -5
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +29 -34
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +16 -12
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +4 -5
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +73 -72
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +5 -6
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +68 -0
- package/src/components/EntityCollectionView/useSelectionController.tsx +30 -0
- package/src/components/EntityPreview.tsx +209 -70
- package/src/components/EntityView.tsx +84 -0
- package/src/components/FieldCaption.tsx +14 -0
- package/src/components/HomePage/DefaultHomePage.tsx +15 -11
- package/src/components/HomePage/NavigationCard.tsx +69 -0
- package/src/components/HomePage/NavigationCardBinding.tsx +116 -0
- package/src/components/HomePage/SmallNavigationCard.tsx +45 -0
- package/src/components/HomePage/index.tsx +3 -1
- package/src/components/PropertyIdCopyTooltipContent.tsx +2 -3
- package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +4 -4
- package/src/components/ReferenceWidget.tsx +22 -12
- package/src/components/SearchIconsView.tsx +5 -5
- package/src/components/SelectableTable/SelectableTable.tsx +5 -3
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +2 -3
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +23 -8
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +38 -24
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +35 -15
- package/src/components/VirtualTable/VirtualTable.tsx +38 -29
- package/src/components/VirtualTable/VirtualTableHeader.tsx +4 -4
- package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +2 -2
- package/src/components/VirtualTable/VirtualTableProps.tsx +7 -7
- package/src/components/VirtualTable/VirtualTableRow.tsx +4 -5
- package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +1 -1
- package/src/components/VirtualTable/types.tsx +2 -3
- package/src/components/{EntityCollectionTable/internal → common}/default_entity_actions.tsx +11 -7
- package/src/components/common/index.ts +1 -0
- package/src/components/{VirtualTable/common.tsx → common/table_height.tsx} +5 -2
- package/src/components/common/types.tsx +4 -6
- package/src/components/common/useColumnsIds.tsx +10 -2
- package/src/components/common/useDataSourceEntityCollectionTableController.tsx +12 -1
- package/src/components/common/useTableSearchHelper.ts +39 -9
- package/src/components/index.tsx +6 -3
- package/src/contexts/AuthControllerContext.tsx +1 -1
- package/src/{components/FireCMSAppBar.tsx → core/DefaultAppBar.tsx} +51 -34
- package/src/core/DefaultDrawer.tsx +177 -0
- package/src/core/DrawerNavigationItem.tsx +62 -0
- package/src/core/EntityEditView.tsx +1101 -0
- package/src/core/EntitySidePanel.tsx +3 -4
- package/src/core/FireCMS.tsx +54 -43
- package/src/core/NavigationRoutes.tsx +14 -7
- package/src/core/field_configs.tsx +2 -3
- package/src/core/index.tsx +3 -4
- package/src/form/PropertiesForm.tsx +81 -0
- package/src/form/PropertyFieldBinding.tsx +29 -7
- package/src/form/components/FieldHelperText.tsx +3 -3
- package/src/form/components/StorageItemPreview.tsx +5 -7
- package/src/form/components/StorageUploadProgress.tsx +9 -8
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +10 -12
- package/src/form/field_bindings/BlockFieldBinding.tsx +2 -2
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +1 -1
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +19 -19
- package/src/form/field_bindings/MapFieldBinding.tsx +25 -17
- package/src/form/field_bindings/MarkdownFieldBinding.tsx +2 -2
- package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +2 -9
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +16 -13
- package/src/form/field_bindings/SelectFieldBinding.tsx +3 -3
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +14 -35
- package/src/form/field_bindings/TextFieldBinding.tsx +7 -5
- package/src/form/index.tsx +4 -4
- package/src/form/validation.ts +4 -21
- package/src/hooks/data/delete.ts +3 -3
- package/src/hooks/data/save.ts +4 -2
- package/src/hooks/data/useCollectionFetch.tsx +1 -1
- package/src/hooks/data/useDataSource.tsx +8 -3
- package/src/hooks/data/useEntityFetch.tsx +4 -4
- package/src/hooks/index.tsx +3 -0
- package/src/hooks/useBuildLocalConfigurationPersistence.tsx +8 -10
- package/src/hooks/useBuildModeController.tsx +11 -5
- package/src/hooks/useBuildNavigationController.tsx +200 -83
- package/src/hooks/useProjectLog.tsx +17 -7
- package/src/hooks/useReferenceDialog.tsx +2 -2
- package/src/hooks/useResolvedNavigationFrom.tsx +1 -1
- package/src/hooks/useStorageSource.tsx +7 -2
- package/src/hooks/useValidateAuthenticator.tsx +115 -0
- package/src/index.ts +1 -0
- package/src/internal/useBuildDataSource.ts +54 -47
- package/src/internal/useBuildSideEntityController.tsx +88 -21
- package/src/preview/PropertyPreview.tsx +5 -15
- package/src/preview/PropertyPreviewProps.tsx +1 -11
- package/src/preview/components/BooleanPreview.tsx +19 -4
- package/src/preview/components/EnumValuesChip.tsx +2 -2
- package/src/preview/components/ReferencePreview.tsx +72 -165
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +0 -1
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +2 -1
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +0 -1
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +0 -1
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +2 -3
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +2 -3
- package/src/preview/property_previews/MapPropertyPreview.tsx +5 -5
- package/src/preview/property_previews/StringPropertyPreview.tsx +8 -7
- package/src/types/analytics.ts +1 -0
- package/src/types/auth.tsx +50 -1
- package/src/types/collections.ts +51 -6
- package/src/types/customization_controller.tsx +0 -1
- package/src/types/datasource.ts +24 -17
- package/src/types/entities.ts +9 -1
- package/src/types/entity_actions.tsx +17 -0
- package/src/types/entity_callbacks.ts +2 -2
- package/src/types/entity_overrides.tsx +7 -0
- package/src/types/fields.tsx +33 -33
- package/src/types/firecms.tsx +0 -1
- package/src/types/index.ts +2 -1
- package/src/types/navigation.ts +17 -17
- package/src/types/permissions.ts +6 -1
- package/src/types/plugins.tsx +28 -30
- package/src/types/properties.ts +19 -7
- package/src/types/property_config.tsx +2 -2
- package/src/types/roles.ts +41 -0
- package/src/types/side_entity_controller.tsx +1 -0
- package/src/types/storage.ts +12 -3
- package/src/types/user.ts +7 -0
- package/src/util/collections.ts +22 -0
- package/src/util/entities.ts +2 -1
- package/src/util/enums.ts +1 -1
- package/src/util/icon_list.ts +2 -2
- package/src/util/icon_synonyms.ts +3 -99
- package/src/util/icons.tsx +11 -3
- package/src/util/navigation_utils.ts +6 -6
- package/src/util/objects.ts +8 -21
- package/src/util/permissions.ts +12 -8
- package/src/util/references.ts +36 -5
- package/src/util/resolutions.ts +32 -31
- package/src/util/storage.ts +75 -21
- package/src/util/strings.ts +2 -2
- package/src/util/useStorageUploadController.tsx +21 -3
- package/src/util/useTraceUpdate.tsx +2 -1
- package/dist/components/VirtualTable/common.d.ts +0 -2
- package/dist/core/Drawer.d.ts +0 -23
- package/dist/core/EntityView.d.ts +0 -22
- package/dist/core/Scaffold.d.ts +0 -55
- package/dist/core/SideEntityView.d.ts +0 -7
- package/dist/form/EntityForm.d.ts +0 -77
- package/dist/internal/useBuildCustomizationController.d.ts +0 -2
- package/dist/internal/useLocaleConfig.d.ts +0 -1
- package/dist/types/appcheck.d.ts +0 -26
- package/src/components/HomePage/NavigationCollectionCard.tsx +0 -146
- package/src/core/Drawer.tsx +0 -164
- package/src/core/EntityView.tsx +0 -578
- package/src/core/Scaffold.tsx +0 -281
- package/src/core/SideEntityView.tsx +0 -38
- package/src/form/EntityForm.tsx +0 -720
- package/src/internal/useBuildCustomizationController.tsx +0 -5
- package/src/internal/useLocaleConfig.tsx +0 -18
- package/src/types/appcheck.ts +0 -29
|
@@ -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
|
*/
|
|
@@ -60,4 +64,4 @@ export interface PermissionsBuilderProps<EC extends EntityCollection = EntityCol
|
|
|
60
64
|
* based on the logged user or collection.
|
|
61
65
|
* @group Models
|
|
62
66
|
*/
|
|
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);
|
|
67
|
+
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 | undefined);
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -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,14 @@ 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;
|
|
92
83
|
showTextSearchBar?: (props: {
|
|
93
84
|
context: FireCMSContext;
|
|
94
85
|
path: string;
|
|
@@ -123,6 +114,15 @@ export type FireCMSPlugin<PROPS = any, FORM_PROPS = any, EC extends EntityCollec
|
|
|
123
114
|
collection: EC;
|
|
124
115
|
}>;
|
|
125
116
|
};
|
|
117
|
+
form?: {
|
|
118
|
+
provider?: {
|
|
119
|
+
Component: React.ComponentType<PropsWithChildren<FORM_PROPS & PluginFormActionProps<any, EC>>>;
|
|
120
|
+
props?: FORM_PROPS;
|
|
121
|
+
};
|
|
122
|
+
Actions?: React.ComponentType<PluginFormActionProps<any, EC>>;
|
|
123
|
+
fieldBuilder?: <T extends CMSType = CMSType>(props: PluginFieldBuilderParams<T, any, EC>) => React.ComponentType<FieldProps<T>> | null;
|
|
124
|
+
fieldBuilderEnabled?: <T extends CMSType = CMSType>(props: PluginFieldBuilderParams<T>) => boolean;
|
|
125
|
+
};
|
|
126
126
|
};
|
|
127
127
|
/**
|
|
128
128
|
* Props passed to the {@link FireCMSPlugin.homePage.CollectionActions} method.
|
|
@@ -161,8 +161,8 @@ export type PluginFieldBuilderParams<T extends CMSType = CMSType, M extends Reco
|
|
|
161
161
|
property: Property<T> | ResolvedProperty<T>;
|
|
162
162
|
Field: React.ComponentType<FieldProps<T, any, M>>;
|
|
163
163
|
plugin: FireCMSPlugin;
|
|
164
|
-
path
|
|
165
|
-
collection
|
|
164
|
+
path?: string;
|
|
165
|
+
collection?: EC;
|
|
166
166
|
};
|
|
167
167
|
export interface PluginGenericProps<UserType extends User = User> {
|
|
168
168
|
context: FireCMSContext<UserType>;
|
|
@@ -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<CMSType> ? "array" : T extends Record<string, any> ? "map" : never;
|
|
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<CMSType> ? "array" : T extends Record<string, any> ? "map" : never;
|
|
12
12
|
/**
|
|
13
13
|
* @group Entity properties
|
|
14
14
|
*/
|
|
@@ -474,6 +474,14 @@ export interface ReferenceProperty extends BaseProperty<EntityReference> {
|
|
|
474
474
|
* specified values are considered.
|
|
475
475
|
*/
|
|
476
476
|
previewProperties?: string[];
|
|
477
|
+
/**
|
|
478
|
+
* Should the reference include the ID of the entity. Defaults to `true`
|
|
479
|
+
*/
|
|
480
|
+
includeId?: boolean;
|
|
481
|
+
/**
|
|
482
|
+
* Should the reference include a link to the entity (open the entity details). Defaults to `true`
|
|
483
|
+
*/
|
|
484
|
+
includeEntityLink?: boolean;
|
|
477
485
|
}
|
|
478
486
|
/**
|
|
479
487
|
* Rules to validate any property. Some properties have specific rules
|
|
@@ -552,7 +560,7 @@ export interface ArrayPropertyValidationSchema extends PropertyValidationSchema
|
|
|
552
560
|
* Additional configuration related to Storage related fields
|
|
553
561
|
* @group Entity properties
|
|
554
562
|
*/
|
|
555
|
-
export
|
|
563
|
+
export type StorageConfig = {
|
|
556
564
|
/**
|
|
557
565
|
* File MIME types that can be uploaded to this reference. Don't specify for
|
|
558
566
|
* all.
|
|
@@ -620,7 +628,7 @@ export interface StorageConfig {
|
|
|
620
628
|
* after it has been resolved.
|
|
621
629
|
*/
|
|
622
630
|
postProcess?: (pathOrUrl: string) => Promise<string>;
|
|
623
|
-
}
|
|
631
|
+
};
|
|
624
632
|
/**
|
|
625
633
|
* @group Entity properties
|
|
626
634
|
*/
|
|
@@ -644,7 +652,7 @@ export interface UploadedFileContext {
|
|
|
644
652
|
/**
|
|
645
653
|
* Entity path. E.g. `products/PID/locales`
|
|
646
654
|
*/
|
|
647
|
-
path
|
|
655
|
+
path?: string;
|
|
648
656
|
/**
|
|
649
657
|
* Values of the current entity
|
|
650
658
|
*/
|
|
@@ -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.
|
|
@@ -39,4 +39,4 @@ export type PropertyConfig<T extends CMSType = any> = {
|
|
|
39
39
|
*/
|
|
40
40
|
description?: string;
|
|
41
41
|
};
|
|
42
|
-
export type
|
|
42
|
+
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
|
+
};
|
package/dist/types/storage.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface UploadFileProps {
|
|
|
6
6
|
fileName?: string;
|
|
7
7
|
path?: string;
|
|
8
8
|
metadata?: any;
|
|
9
|
+
bucket?: string;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* @group Models
|
|
@@ -15,6 +16,10 @@ export interface UploadFileResult {
|
|
|
15
16
|
* Storage path including the file name where the file was uploaded.
|
|
16
17
|
*/
|
|
17
18
|
path: string;
|
|
19
|
+
/**
|
|
20
|
+
* Bucket where the file was uploaded
|
|
21
|
+
*/
|
|
22
|
+
bucket: string;
|
|
18
23
|
}
|
|
19
24
|
/**
|
|
20
25
|
* @group Models
|
|
@@ -66,17 +71,20 @@ export interface StorageSource {
|
|
|
66
71
|
* @param fileName
|
|
67
72
|
* @param path
|
|
68
73
|
* @param metadata
|
|
74
|
+
* @param bucket
|
|
69
75
|
*/
|
|
70
|
-
uploadFile: ({ file, fileName, path, metadata }: UploadFileProps) => Promise<UploadFileResult>;
|
|
76
|
+
uploadFile: ({ file, fileName, path, metadata, bucket }: UploadFileProps) => Promise<UploadFileResult>;
|
|
71
77
|
/**
|
|
72
78
|
* Convert a storage path or URL into a download configuration
|
|
73
79
|
* @param path
|
|
80
|
+
* @param bucket
|
|
74
81
|
*/
|
|
75
|
-
getDownloadURL: (pathOrUrl: string) => Promise<DownloadConfig>;
|
|
82
|
+
getDownloadURL: (pathOrUrl: string, bucket?: string) => Promise<DownloadConfig>;
|
|
76
83
|
/**
|
|
77
84
|
* Get a file from a storage path.
|
|
78
85
|
* It returns null if the file does not exist.
|
|
79
86
|
* @param props
|
|
87
|
+
* @param bucket
|
|
80
88
|
*/
|
|
81
|
-
getFile: (path: string) => Promise<File | null>;
|
|
89
|
+
getFile: (path: string, bucket?: string) => Promise<File | null>;
|
|
82
90
|
}
|
package/dist/types/user.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Role } from "./roles";
|
|
1
2
|
/**
|
|
2
3
|
* This interface represents a user.
|
|
3
4
|
* It has some of the same fields as a Firebase User.
|
|
@@ -33,4 +34,8 @@ export type User = {
|
|
|
33
34
|
*
|
|
34
35
|
*/
|
|
35
36
|
readonly isAnonymous: boolean;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
roles?: Role[];
|
|
36
41
|
};
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import { DefaultSelectedViewBuilder, DefaultSelectedViewParams, PropertiesOrBuilders } from "../types";
|
|
1
|
+
import { DefaultSelectedViewBuilder, DefaultSelectedViewParams, EntityCollection, PermissionsBuilder, PropertiesOrBuilders } from "../types";
|
|
2
2
|
export declare function sortProperties<M extends Record<string, any>>(properties: PropertiesOrBuilders<M>, propertiesOrder?: (keyof M)[]): PropertiesOrBuilders<M>;
|
|
3
3
|
export declare function resolveDefaultSelectedView(defaultSelectedView: string | DefaultSelectedViewBuilder | undefined, params: DefaultSelectedViewParams): string | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* If a collection is not applying permissions, we apply the given permissionsBuilder.
|
|
6
|
+
* This is used to apply the role permissions to the collections, unless they are already
|
|
7
|
+
* applying permissions.
|
|
8
|
+
* @param collections
|
|
9
|
+
* @param permissionsBuilder
|
|
10
|
+
*/
|
|
11
|
+
export declare const applyPermissionsFunctionIfEmpty: (collections: EntityCollection[], permissionsBuilder?: PermissionsBuilder<any, any>) => EntityCollection[];
|
package/dist/util/entities.d.ts
CHANGED
|
@@ -23,6 +23,6 @@ export declare function updateDateAutoValues<M extends Record<string, any>>({ in
|
|
|
23
23
|
* @group Datasource
|
|
24
24
|
*/
|
|
25
25
|
export declare function sanitizeData<M extends Record<string, any>>(values: EntityValues<M>, properties: ResolvedProperties<M>): any;
|
|
26
|
-
export declare function getReferenceFrom<M extends Record<string, any>>(entity: Entity<M>): EntityReference
|
|
26
|
+
export declare function getReferenceFrom<M extends Record<string, any>>(entity: Entity<M>): EntityReference;
|
|
27
27
|
export declare function traverseValuesProperties<M extends Record<string, any>>(inputValues: Partial<EntityValues<M>>, properties: ResolvedProperties<M>, operation: (value: any, property: Property) => any): EntityValues<M> | undefined;
|
|
28
28
|
export declare function traverseValueProperty(inputValue: any, property: Property, operation: (value: any, property: Property) => any): any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const iconSynonyms: {
|
|
2
2
|
abc: string;
|
|
3
3
|
access_alarm: string;
|
|
4
4
|
access_alarms: string;
|
|
@@ -84,7 +84,6 @@ export declare const icon_synonyms: {
|
|
|
84
84
|
apartment: string;
|
|
85
85
|
api: string;
|
|
86
86
|
app_blocking: string;
|
|
87
|
-
apple: string;
|
|
88
87
|
app_registration: string;
|
|
89
88
|
approval: string;
|
|
90
89
|
apps: string;
|
|
@@ -281,7 +280,6 @@ export declare const icon_synonyms: {
|
|
|
281
280
|
cast: string;
|
|
282
281
|
cast_connected: string;
|
|
283
282
|
cast_for_education: string;
|
|
284
|
-
catching_pokemon: string;
|
|
285
283
|
category: string;
|
|
286
284
|
celebration: string;
|
|
287
285
|
cell_tower: string;
|
|
@@ -382,10 +380,6 @@ export declare const icon_synonyms: {
|
|
|
382
380
|
credit_score: string;
|
|
383
381
|
crib: string;
|
|
384
382
|
crop: string;
|
|
385
|
-
crop_169: string;
|
|
386
|
-
crop_32: string;
|
|
387
|
-
crop_54: string;
|
|
388
|
-
crop_75: string;
|
|
389
383
|
crop_din: string;
|
|
390
384
|
crop_free: string;
|
|
391
385
|
crop_landscape: string;
|
|
@@ -420,7 +414,6 @@ export declare const icon_synonyms: {
|
|
|
420
414
|
delete_forever: string;
|
|
421
415
|
delete_outline: string;
|
|
422
416
|
delete_sweep: string;
|
|
423
|
-
delivery_dining: string;
|
|
424
417
|
density_large: string;
|
|
425
418
|
density_medium: string;
|
|
426
419
|
density_small: string;
|
|
@@ -525,11 +518,6 @@ export declare const icon_synonyms: {
|
|
|
525
518
|
edit_road: string;
|
|
526
519
|
egg: string;
|
|
527
520
|
egg_alt: string;
|
|
528
|
-
eighteen_mp: string;
|
|
529
|
-
eight_k: string;
|
|
530
|
-
eight_k_plus: string;
|
|
531
|
-
eight_mp: string;
|
|
532
|
-
eightteen_mp: string;
|
|
533
521
|
eject: string;
|
|
534
522
|
elderly: string;
|
|
535
523
|
elderly_woman: string;
|
|
@@ -542,7 +530,6 @@ export declare const icon_synonyms: {
|
|
|
542
530
|
electric_rickshaw: string;
|
|
543
531
|
electric_scooter: string;
|
|
544
532
|
elevator: string;
|
|
545
|
-
eleven_mp: string;
|
|
546
533
|
email: string;
|
|
547
534
|
e_mobiledata: string;
|
|
548
535
|
emoji_emotions: string;
|
|
@@ -582,7 +569,6 @@ export declare const icon_synonyms: {
|
|
|
582
569
|
extension: string;
|
|
583
570
|
extension_off: string;
|
|
584
571
|
face: string;
|
|
585
|
-
facebook: string;
|
|
586
572
|
face_retouching_natural: string;
|
|
587
573
|
face_retouching_off: string;
|
|
588
574
|
fact_check: string;
|
|
@@ -606,7 +592,6 @@ export declare const icon_synonyms: {
|
|
|
606
592
|
fiber_new: string;
|
|
607
593
|
fiber_pin: string;
|
|
608
594
|
fiber_smart_record: string;
|
|
609
|
-
fifteen_mp: string;
|
|
610
595
|
file_copy: string;
|
|
611
596
|
file_download: string;
|
|
612
597
|
file_download_done: string;
|
|
@@ -643,14 +628,8 @@ export declare const icon_synonyms: {
|
|
|
643
628
|
fire_extinguisher: string;
|
|
644
629
|
fireplace: string;
|
|
645
630
|
first_page: string;
|
|
646
|
-
fitbit: string;
|
|
647
631
|
fitness_center: string;
|
|
648
632
|
fit_screen: string;
|
|
649
|
-
five_g: string;
|
|
650
|
-
five_k: string;
|
|
651
|
-
five_k_plus: string;
|
|
652
|
-
five_mp: string;
|
|
653
|
-
fivteen_mp: string;
|
|
654
633
|
flag: string;
|
|
655
634
|
flag_circle: string;
|
|
656
635
|
flaky: string;
|
|
@@ -719,12 +698,6 @@ export declare const icon_synonyms: {
|
|
|
719
698
|
forward_5: string;
|
|
720
699
|
forward_to_inbox: string;
|
|
721
700
|
foundation: string;
|
|
722
|
-
four_g_mobiledata: string;
|
|
723
|
-
four_g_plus_mobiledata: string;
|
|
724
|
-
four_k: string;
|
|
725
|
-
four_k_plus: string;
|
|
726
|
-
four_mp: string;
|
|
727
|
-
fourteen_mp: string;
|
|
728
701
|
free_breakfast: string;
|
|
729
702
|
fullscreen: string;
|
|
730
703
|
fullscreen_exit: string;
|
|
@@ -740,10 +713,8 @@ export declare const icon_synonyms: {
|
|
|
740
713
|
gif_box: string;
|
|
741
714
|
girl: string;
|
|
742
715
|
gite: string;
|
|
743
|
-
git_hub: string;
|
|
744
716
|
g_mobiledata: string;
|
|
745
717
|
golf_course: string;
|
|
746
|
-
google: string;
|
|
747
718
|
gpp_bad: string;
|
|
748
719
|
gpp_good: string;
|
|
749
720
|
gpp_maybe: string;
|
|
@@ -756,8 +727,6 @@ export declare const icon_synonyms: {
|
|
|
756
727
|
grain: string;
|
|
757
728
|
graphic_eq: string;
|
|
758
729
|
grass: string;
|
|
759
|
-
grid3x3: string;
|
|
760
|
-
grid4x4: string;
|
|
761
730
|
grid_goldenratio: string;
|
|
762
731
|
grid_off: string;
|
|
763
732
|
grid_on: string;
|
|
@@ -802,7 +771,6 @@ export declare const icon_synonyms: {
|
|
|
802
771
|
hide_image: string;
|
|
803
772
|
hide_source: string;
|
|
804
773
|
highlight: string;
|
|
805
|
-
highlight_alt: string;
|
|
806
774
|
highlight_off: string;
|
|
807
775
|
high_quality: string;
|
|
808
776
|
hiking: string;
|
|
@@ -862,14 +830,12 @@ export declare const icon_synonyms: {
|
|
|
862
830
|
insert_page_break: string;
|
|
863
831
|
insert_photo: string;
|
|
864
832
|
insights: string;
|
|
865
|
-
instagram: string;
|
|
866
833
|
install_desktop: string;
|
|
867
834
|
install_mobile: string;
|
|
868
835
|
integration_instructions: string;
|
|
869
836
|
interests: string;
|
|
870
837
|
interpreter_mode: string;
|
|
871
838
|
inventory: string;
|
|
872
|
-
inventory2: string;
|
|
873
839
|
invert_colors: string;
|
|
874
840
|
invert_colors_off: string;
|
|
875
841
|
ios_share: string;
|
|
@@ -939,7 +905,6 @@ export declare const icon_synonyms: {
|
|
|
939
905
|
line_weight: string;
|
|
940
906
|
link: string;
|
|
941
907
|
linked_camera: string;
|
|
942
|
-
linked_in: string;
|
|
943
908
|
link_off: string;
|
|
944
909
|
liquor: string;
|
|
945
910
|
list: string;
|
|
@@ -1068,7 +1033,6 @@ export declare const icon_synonyms: {
|
|
|
1068
1033
|
monochrome_photos: string;
|
|
1069
1034
|
mood: string;
|
|
1070
1035
|
mood_bad: string;
|
|
1071
|
-
moped: string;
|
|
1072
1036
|
more: string;
|
|
1073
1037
|
more_horiz: string;
|
|
1074
1038
|
more_time: string;
|
|
@@ -1116,13 +1080,8 @@ export declare const icon_synonyms: {
|
|
|
1116
1080
|
nightlight_round: string;
|
|
1117
1081
|
night_shelter: string;
|
|
1118
1082
|
nights_stay: string;
|
|
1119
|
-
nine_k: string;
|
|
1120
|
-
nine_k_plus: string;
|
|
1121
|
-
nine_mp: string;
|
|
1122
|
-
nineteen_mp: string;
|
|
1123
1083
|
no_accounts: string;
|
|
1124
1084
|
no_backpack: string;
|
|
1125
|
-
no_cell: string;
|
|
1126
1085
|
no_drinks: string;
|
|
1127
1086
|
no_encryption: string;
|
|
1128
1087
|
no_encryption_gmailerrorred: string;
|
|
@@ -1160,9 +1119,6 @@ export declare const icon_synonyms: {
|
|
|
1160
1119
|
oil_barrel: string;
|
|
1161
1120
|
ondemand_video: string;
|
|
1162
1121
|
on_device_training: string;
|
|
1163
|
-
one_k: string;
|
|
1164
|
-
one_kk: string;
|
|
1165
|
-
one_k_plus: string;
|
|
1166
1122
|
online_prediction: string;
|
|
1167
1123
|
opacity: string;
|
|
1168
1124
|
open_in_browser: string;
|
|
@@ -1184,13 +1140,9 @@ export declare const icon_synonyms: {
|
|
|
1184
1140
|
panorama: string;
|
|
1185
1141
|
panorama_fish_eye: string;
|
|
1186
1142
|
panorama_horizontal: string;
|
|
1187
|
-
panorama_horizontal_select: string;
|
|
1188
1143
|
panorama_photosphere: string;
|
|
1189
|
-
panorama_photosphere_select: string;
|
|
1190
1144
|
panorama_vertical: string;
|
|
1191
|
-
panorama_vertical_select: string;
|
|
1192
1145
|
panorama_wide_angle: string;
|
|
1193
|
-
panorama_wide_angle_select: string;
|
|
1194
1146
|
pan_tool: string;
|
|
1195
1147
|
paragliding: string;
|
|
1196
1148
|
park: string;
|
|
@@ -1274,16 +1226,11 @@ export declare const icon_synonyms: {
|
|
|
1274
1226
|
pin: string;
|
|
1275
1227
|
pinch: string;
|
|
1276
1228
|
pin_drop: string;
|
|
1277
|
-
pinterest: string;
|
|
1278
1229
|
pivot_table_chart: string;
|
|
1279
|
-
pix: string;
|
|
1280
1230
|
place: string;
|
|
1281
1231
|
plagiarism: string;
|
|
1282
1232
|
play_arrow: string;
|
|
1283
1233
|
play_circle: string;
|
|
1284
|
-
play_circle_filled: string;
|
|
1285
|
-
play_circle_filled_white: string;
|
|
1286
|
-
play_circle_outline: string;
|
|
1287
1234
|
play_disabled: string;
|
|
1288
1235
|
play_for_work: string;
|
|
1289
1236
|
play_lesson: string;
|
|
@@ -1356,7 +1303,6 @@ export declare const icon_synonyms: {
|
|
|
1356
1303
|
recommend: string;
|
|
1357
1304
|
record_voice_over: string;
|
|
1358
1305
|
rectangle: string;
|
|
1359
|
-
reddit: string;
|
|
1360
1306
|
redeem: string;
|
|
1361
1307
|
redo: string;
|
|
1362
1308
|
reduce_capacity: string;
|
|
@@ -1499,10 +1445,6 @@ export declare const icon_synonyms: {
|
|
|
1499
1445
|
settings_suggest: string;
|
|
1500
1446
|
settings_system_daydream: string;
|
|
1501
1447
|
settings_voice: string;
|
|
1502
|
-
seven_k: string;
|
|
1503
|
-
seven_k_plus: string;
|
|
1504
|
-
seven_mp: string;
|
|
1505
|
-
seventeen_mp: string;
|
|
1506
1448
|
share: string;
|
|
1507
1449
|
share_location: string;
|
|
1508
1450
|
shield: string;
|
|
@@ -1525,19 +1467,13 @@ export declare const icon_synonyms: {
|
|
|
1525
1467
|
signal_cellular_4_bar: string;
|
|
1526
1468
|
signal_cellular_alt: string;
|
|
1527
1469
|
signal_cellular_connected_no_internet_0_bar: string;
|
|
1528
|
-
signal_cellular_connected_no_internet_1_bar: string;
|
|
1529
|
-
signal_cellular_connected_no_internet_2_bar: string;
|
|
1530
|
-
signal_cellular_connected_no_internet_3_bar: string;
|
|
1531
1470
|
signal_cellular_connected_no_internet_4_bar: string;
|
|
1532
1471
|
signal_cellular_nodata: string;
|
|
1533
1472
|
signal_cellular_no_sim: string;
|
|
1534
1473
|
signal_cellular_null: string;
|
|
1535
1474
|
signal_cellular_off: string;
|
|
1536
1475
|
signal_wifi_bad: string;
|
|
1537
|
-
signal_wifi_connected_no_internet4: string;
|
|
1538
1476
|
signal_wifi_off: string;
|
|
1539
|
-
signal_wifi_statusbar4_bar: string;
|
|
1540
|
-
signal_wifi_statusbar_connected_no_internet4: string;
|
|
1541
1477
|
signal_wifi_statusbar_null: string;
|
|
1542
1478
|
signpost: string;
|
|
1543
1479
|
sim_card: string;
|
|
@@ -1545,12 +1481,6 @@ export declare const icon_synonyms: {
|
|
|
1545
1481
|
sim_card_download: string;
|
|
1546
1482
|
single_bed: string;
|
|
1547
1483
|
sip: string;
|
|
1548
|
-
six_k: string;
|
|
1549
|
-
six_k_plus: string;
|
|
1550
|
-
six_mp: string;
|
|
1551
|
-
sixteen_mp: string;
|
|
1552
|
-
sixty_fps: string;
|
|
1553
|
-
sixty_fps_select: string;
|
|
1554
1484
|
skateboarding: string;
|
|
1555
1485
|
skip_next: string;
|
|
1556
1486
|
skip_previous: string;
|
|
@@ -1621,10 +1551,8 @@ export declare const icon_synonyms: {
|
|
|
1621
1551
|
stairs: string;
|
|
1622
1552
|
star: string;
|
|
1623
1553
|
star_border: string;
|
|
1624
|
-
star_border_purple_500: string;
|
|
1625
1554
|
star_half: string;
|
|
1626
1555
|
star_outline: string;
|
|
1627
|
-
star_purple_500: string;
|
|
1628
1556
|
star_rate: string;
|
|
1629
1557
|
stars: string;
|
|
1630
1558
|
start: string;
|
|
@@ -1712,8 +1640,6 @@ export declare const icon_synonyms: {
|
|
|
1712
1640
|
task: string;
|
|
1713
1641
|
task_alt: string;
|
|
1714
1642
|
taxi_alert: string;
|
|
1715
|
-
telegram: string;
|
|
1716
|
-
ten_mp: string;
|
|
1717
1643
|
terminal: string;
|
|
1718
1644
|
terrain: string;
|
|
1719
1645
|
text_decrease: string;
|
|
@@ -1733,16 +1659,6 @@ export declare const icon_synonyms: {
|
|
|
1733
1659
|
theaters: string;
|
|
1734
1660
|
thermostat: string;
|
|
1735
1661
|
thermostat_auto: string;
|
|
1736
|
-
thirteen_mp: string;
|
|
1737
|
-
thirty_fps: string;
|
|
1738
|
-
thirty_fps_select: string;
|
|
1739
|
-
three_d_rotation: string;
|
|
1740
|
-
three_g_mobiledata: string;
|
|
1741
|
-
three_k: string;
|
|
1742
|
-
three_k_plus: string;
|
|
1743
|
-
three_mp: string;
|
|
1744
|
-
three_p: string;
|
|
1745
|
-
three_sixty: string;
|
|
1746
1662
|
thumb_down: string;
|
|
1747
1663
|
thumb_down_alt: string;
|
|
1748
1664
|
thumb_down_off_alt: string;
|
|
@@ -1758,7 +1674,6 @@ export declare const icon_synonyms: {
|
|
|
1758
1674
|
timer_3: string;
|
|
1759
1675
|
timer_3_select: string;
|
|
1760
1676
|
timer_off: string;
|
|
1761
|
-
times_one_mobiledata: string;
|
|
1762
1677
|
time_to_leave: string;
|
|
1763
1678
|
tips_and_updates: string;
|
|
1764
1679
|
title: string;
|
|
@@ -1802,16 +1717,6 @@ export declare const icon_synonyms: {
|
|
|
1802
1717
|
turn_slight_right: string;
|
|
1803
1718
|
tv: string;
|
|
1804
1719
|
tv_off: string;
|
|
1805
|
-
twelve_mp: string;
|
|
1806
|
-
twenty_four_mp: string;
|
|
1807
|
-
twenty_one_mp: string;
|
|
1808
|
-
twenty_three_mp: string;
|
|
1809
|
-
twenty_two_mp: string;
|
|
1810
|
-
twenty_zero_mp: string;
|
|
1811
|
-
twitter: string;
|
|
1812
|
-
two_k: string;
|
|
1813
|
-
two_k_plus: string;
|
|
1814
|
-
two_mp: string;
|
|
1815
1720
|
two_wheeler: string;
|
|
1816
1721
|
umbrella: string;
|
|
1817
1722
|
unarchive: string;
|
|
@@ -1941,7 +1846,6 @@ export declare const icon_synonyms: {
|
|
|
1941
1846
|
wrong_location: string;
|
|
1942
1847
|
wysiwyg: string;
|
|
1943
1848
|
yard: string;
|
|
1944
|
-
you_tube: string;
|
|
1945
1849
|
youtube_searched_for: string;
|
|
1946
1850
|
zoom_in: string;
|
|
1947
1851
|
zoom_in_map: string;
|
package/dist/util/icons.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { CMSView, EntityCollection } from "../types";
|
|
3
2
|
export declare function getIcon(iconKey?: string, className?: string): React.ReactElement | undefined;
|
|
3
|
+
export type IconViewProps = {
|
|
4
|
+
path: string;
|
|
5
|
+
name: string;
|
|
6
|
+
singularName?: string;
|
|
7
|
+
group?: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
};
|
|
4
10
|
export declare const IconForView: React.NamedExoticComponent<{
|
|
5
|
-
collectionOrView
|
|
11
|
+
collectionOrView?: IconViewProps | undefined;
|
|
6
12
|
className?: string | undefined;
|
|
7
13
|
}>;
|
|
@@ -8,10 +8,10 @@ export declare function resolveCollectionPathIds(path: string, allCollections: E
|
|
|
8
8
|
/**
|
|
9
9
|
* Find the corresponding view at any depth for a given path.
|
|
10
10
|
* Note that path or segments of the paths can be collection aliases.
|
|
11
|
-
* @param
|
|
11
|
+
* @param pathOrId
|
|
12
12
|
* @param collections
|
|
13
13
|
*/
|
|
14
|
-
export declare function getCollectionByPathOrId(
|
|
14
|
+
export declare function getCollectionByPathOrId(pathOrId: string, collections: EntityCollection[]): EntityCollection | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* Get the subcollection combinations from a path:
|
|
17
17
|
* "sites/es/locales" => ["sites/es/locales", "sites"]
|
package/dist/util/objects.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const pick: <T>(obj: T, ...args: any[]) => T;
|
|
2
2
|
export declare function isObject(item: any): any;
|
|
3
|
-
export declare function mergeDeep<T extends
|
|
3
|
+
export declare function mergeDeep<T extends Record<any, any>, U extends Record<any, any>>(target: T, source: U): T & U;
|
|
4
4
|
export declare function getValueInPath(o: object | undefined, path: string): any;
|
|
5
5
|
export declare function removeInPath(o: object, path: string): object | undefined;
|
|
6
6
|
export declare function removeFunctions(o: object | undefined): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuthController, Entity, EntityCollection, Permissions, User } from "../types";
|
|
2
|
-
export declare function resolvePermissions<M extends Record<string, any>, UserType extends User>(collection: EntityCollection<M>, authController: AuthController<UserType>,
|
|
3
|
-
export declare function canEditEntity<M extends Record<string, any>, UserType extends User>(collection: EntityCollection<M>, authController: AuthController<UserType>,
|
|
4
|
-
export declare function canCreateEntity<M extends Record<string, any>, UserType extends User>(collection: EntityCollection<M>, authController: AuthController<UserType>,
|
|
5
|
-
export declare function canDeleteEntity<M extends Record<string, any>, UserType extends User>(collection: EntityCollection<M>, authController: AuthController<UserType>,
|
|
2
|
+
export declare function resolvePermissions<M extends Record<string, any>, UserType extends User>(collection: EntityCollection<M>, authController: AuthController<UserType>, path: string, entity: Entity<M> | null): Permissions | undefined;
|
|
3
|
+
export declare function canEditEntity<M extends Record<string, any>, UserType extends User>(collection: EntityCollection<M>, authController: AuthController<UserType>, path: string, entity: Entity<M> | null): boolean;
|
|
4
|
+
export declare function canCreateEntity<M extends Record<string, any>, UserType extends User>(collection: EntityCollection<M>, authController: AuthController<UserType>, path: string, entity: Entity<M> | null): boolean;
|
|
5
|
+
export declare function canDeleteEntity<M extends Record<string, any>, UserType extends User>(collection: EntityCollection<M>, authController: AuthController<UserType>, path: string, entity: Entity<M> | null): boolean;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import { EntityCollection, PropertyConfig } from "../types";
|
|
2
|
-
export declare function
|
|
1
|
+
import { EntityCollection, PropertyConfig, ResolvedEntityCollection } from "../types";
|
|
2
|
+
export declare function getEntityPreviewKeys(targetCollection: EntityCollection<any>, fields: Record<string, PropertyConfig>, previewProperties?: string[], limit?: number): string[];
|
|
3
|
+
export declare function getEntityTitlePropertyKey<M extends Record<string, any>>(collection: EntityCollection<M>, propertyConfigs: Record<string, PropertyConfig<any>>): string | undefined;
|
|
4
|
+
export declare function getEntityImagePreviewPropertyKey<M extends object>(collection: ResolvedEntityCollection<M>): string | undefined;
|