@firecms/core 3.0.0-beta.12 → 3.0.0-beta.13
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/app/Scaffold.d.ts +4 -0
- package/dist/components/ArrayContainer.d.ts +12 -5
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +4 -0
- package/dist/components/EntityJsonPreview.d.ts +3 -0
- package/dist/core/DefaultAppBar.d.ts +8 -2
- package/dist/core/EntityEditView.d.ts +8 -1
- package/dist/core/FireCMS.d.ts +2 -2
- package/dist/form/EntityForm.d.ts +5 -1
- package/dist/form/PropertyFieldBinding.d.ts +1 -1
- package/dist/hooks/data/save.d.ts +1 -1
- package/dist/index.es.js +8630 -8578
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +8663 -8612
- package/dist/index.umd.js.map +1 -1
- package/dist/internal/useBuildDataSource.d.ts +3 -2
- package/dist/internal/useBuildSideEntityController.d.ts +3 -3
- package/dist/types/collections.d.ts +6 -0
- package/dist/types/fields.d.ts +4 -1
- package/dist/types/firecms.d.ts +1 -1
- package/dist/types/navigation.d.ts +4 -0
- package/dist/types/plugins.d.ts +1 -0
- package/dist/types/properties.d.ts +22 -1
- package/dist/util/createFormexStub.d.ts +2 -0
- package/dist/util/navigation_utils.d.ts +2 -1
- package/dist/util/objects.d.ts +1 -1
- package/dist/util/property_utils.d.ts +2 -2
- package/dist/util/references.d.ts +2 -2
- package/dist/util/resolutions.d.ts +11 -6
- package/package.json +6 -5
- package/src/app/Scaffold.tsx +13 -3
- package/src/components/ArrayContainer.tsx +40 -23
- package/src/components/DeleteEntityDialog.tsx +4 -2
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +8 -6
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +5 -2
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +22 -6
- package/src/components/EntityJsonPreview.tsx +66 -0
- package/src/components/EntityPreview.tsx +10 -3
- package/src/components/EntityView.tsx +4 -1
- package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +3 -1
- package/src/components/VirtualTable/VirtualTable.tsx +29 -1
- package/src/components/common/default_entity_actions.tsx +15 -4
- package/src/core/DefaultAppBar.tsx +17 -5
- package/src/core/EntityEditView.tsx +111 -35
- package/src/core/FireCMS.tsx +13 -12
- package/src/form/EntityForm.tsx +31 -23
- package/src/form/PropertyFieldBinding.tsx +8 -5
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +4 -1
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +1 -0
- package/src/form/field_bindings/BlockFieldBinding.tsx +1 -1
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +6 -2
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +2 -2
- package/src/form/field_bindings/RepeatFieldBinding.tsx +8 -2
- package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +5 -2
- package/src/hooks/data/save.ts +24 -29
- package/src/hooks/useBuildNavigationController.tsx +12 -1
- package/src/hooks/useFireCMSContext.tsx +0 -30
- package/src/internal/useBuildDataSource.ts +9 -5
- package/src/internal/useBuildSideEntityController.tsx +26 -20
- package/src/preview/PropertyPreview.tsx +4 -2
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +4 -3
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +4 -3
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +4 -2
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +4 -3
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +4 -2
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +4 -2
- package/src/routes/FireCMSRoute.tsx +15 -4
- package/src/types/collections.ts +7 -0
- package/src/types/fields.tsx +5 -1
- package/src/types/firecms.tsx +1 -1
- package/src/types/navigation.ts +5 -0
- package/src/types/plugins.tsx +1 -0
- package/src/types/properties.ts +27 -1
- package/src/types/side_entity_controller.tsx +5 -0
- package/src/util/createFormexStub.tsx +62 -0
- package/src/util/join_collections.ts +3 -1
- package/src/util/navigation_from_path.ts +5 -1
- package/src/util/navigation_utils.ts +64 -15
- package/src/util/objects.ts +5 -1
- package/src/util/property_utils.tsx +7 -3
- package/src/util/references.ts +8 -6
- package/src/util/resolutions.ts +17 -9
- package/src/util/useStorageUploadController.tsx +21 -2
package/dist/app/Scaffold.d.ts
CHANGED
|
@@ -13,6 +13,10 @@ export interface ScaffoldProps {
|
|
|
13
13
|
* Note that this has no effect if you are using a custom AppBar or Drawer.
|
|
14
14
|
*/
|
|
15
15
|
logo?: string;
|
|
16
|
+
/**
|
|
17
|
+
* If true, the main content will be padded in large layouts. Defaults to true.
|
|
18
|
+
*/
|
|
19
|
+
padding?: boolean;
|
|
16
20
|
className?: string;
|
|
17
21
|
style?: React.CSSProperties;
|
|
18
22
|
}
|
|
@@ -16,7 +16,12 @@ export interface ArrayContainerProps<T> {
|
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
size?: "small" | "medium";
|
|
18
18
|
onInternalIdAdded?: (id: number) => void;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use `canAddElements` instead
|
|
21
|
+
*/
|
|
19
22
|
includeAddButton?: boolean;
|
|
23
|
+
canAddElements?: boolean;
|
|
24
|
+
sortable?: boolean;
|
|
20
25
|
newDefaultEntry: T;
|
|
21
26
|
onValueChange: (value: T[]) => void;
|
|
22
27
|
className?: string;
|
|
@@ -26,7 +31,7 @@ export interface ArrayContainerProps<T> {
|
|
|
26
31
|
/**
|
|
27
32
|
* @group Form custom fields
|
|
28
33
|
*/
|
|
29
|
-
export declare function ArrayContainer<T>({ droppableId, addLabel, value, disabled, buildEntry, size, onInternalIdAdded, includeAddButton, newDefaultEntry, onValueChange, className, min, max }: ArrayContainerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare function ArrayContainer<T>({ droppableId, addLabel, value, disabled, buildEntry, size, onInternalIdAdded, includeAddButton: deprecatedIncludeAddButton, canAddElements: canAddElementsProp, sortable, newDefaultEntry, onValueChange, className, min, max }: ArrayContainerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
30
35
|
type ArrayContainerItemProps = {
|
|
31
36
|
provided: DraggableProvided;
|
|
32
37
|
index: number;
|
|
@@ -37,20 +42,22 @@ type ArrayContainerItemProps = {
|
|
|
37
42
|
remove: (index: number) => void;
|
|
38
43
|
copy: (index: number) => void;
|
|
39
44
|
addInIndex?: (index: number) => void;
|
|
40
|
-
|
|
45
|
+
canAddElements?: boolean;
|
|
46
|
+
sortable: boolean;
|
|
41
47
|
isDragging: boolean;
|
|
42
48
|
storedProps?: object;
|
|
43
49
|
updateItemCustomProps: (internalId: number, props: object) => void;
|
|
44
50
|
};
|
|
45
|
-
export declare function ArrayContainerItem({ provided, index, internalId, size, disabled, buildEntry, remove, addInIndex,
|
|
46
|
-
export declare function ArrayItemOptions({ direction, disabled, remove, index, provided, copy,
|
|
51
|
+
export declare function ArrayContainerItem({ provided, index, internalId, size, disabled, buildEntry, remove, addInIndex, canAddElements, sortable, copy, isDragging, storedProps, updateItemCustomProps }: ArrayContainerItemProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare function ArrayItemOptions({ direction, disabled, remove, index, provided, copy, canAddElements, sortable, addInIndex }: {
|
|
47
53
|
direction?: "row" | "column";
|
|
48
54
|
disabled: boolean;
|
|
49
55
|
remove: (index: number) => void;
|
|
50
56
|
index: number;
|
|
51
57
|
provided: any;
|
|
52
58
|
copy: (index: number) => void;
|
|
53
|
-
|
|
59
|
+
sortable: boolean;
|
|
60
|
+
canAddElements?: boolean;
|
|
54
61
|
addInIndex?: (index: number) => void;
|
|
55
62
|
}): import("react/jsx-runtime").JSX.Element;
|
|
56
63
|
export declare function getRandomId(): number;
|
|
@@ -9,6 +9,10 @@ export type EntityCollectionViewProps<M extends Record<string, any>> = {
|
|
|
9
9
|
* It defaults to the collection path if not provided.
|
|
10
10
|
*/
|
|
11
11
|
fullPath?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Full path using navigation ids.
|
|
14
|
+
*/
|
|
15
|
+
fullIdPath?: string;
|
|
12
16
|
/**
|
|
13
17
|
* If this is a subcollection, specify the parent collection ids.
|
|
14
18
|
*/
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { User } from "../types";
|
|
3
3
|
export type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {
|
|
4
|
+
/**
|
|
5
|
+
* The content of the app bar, usually a title or logo. This includes a link to the home page.
|
|
6
|
+
*/
|
|
4
7
|
title?: React.ReactNode;
|
|
5
8
|
/**
|
|
6
|
-
* A component that gets rendered on the upper side of the main toolbar
|
|
9
|
+
* A component that gets rendered on the upper side to the end of the main toolbar
|
|
7
10
|
*/
|
|
8
11
|
endAdornment?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* A component that gets rendered on the upper side to the start of the main toolbar
|
|
14
|
+
*/
|
|
9
15
|
startAdornment?: React.ReactNode;
|
|
10
16
|
dropDownActions?: React.ReactNode;
|
|
11
17
|
includeModeToggle?: boolean;
|
|
@@ -20,4 +26,4 @@ export type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {
|
|
|
20
26
|
*
|
|
21
27
|
|
|
22
28
|
*/
|
|
23
|
-
export declare const DefaultAppBar: ({ title, endAdornment, startAdornment, dropDownActions, includeModeToggle, className, style, user: userProp }: DefaultAppBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const DefaultAppBar: ({ title, endAdornment, startAdornment, dropDownActions, includeModeToggle, className, style, user: userProp, logo: logoProp, }: DefaultAppBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Entity, EntityCollection, EntityStatus, User } from "../types";
|
|
3
3
|
import { EntityFormProps } from "../form";
|
|
4
|
+
export declare const MAIN_TAB_VALUE = "__main_##Q$SC^#S6";
|
|
5
|
+
export declare const JSON_TAB_VALUE = "__json";
|
|
4
6
|
export type OnUpdateParams = {
|
|
5
7
|
entity: Entity<any>;
|
|
6
8
|
status: EntityStatus;
|
|
@@ -17,6 +19,10 @@ export type OnTabChangeParams<M extends Record<string, any>> = {
|
|
|
17
19
|
};
|
|
18
20
|
export interface EntityEditViewProps<M extends Record<string, any>> {
|
|
19
21
|
path: string;
|
|
22
|
+
/**
|
|
23
|
+
* The navigation path to the entity.
|
|
24
|
+
*/
|
|
25
|
+
fullIdPath?: string;
|
|
20
26
|
collection: EntityCollection<M>;
|
|
21
27
|
entityId?: string;
|
|
22
28
|
databaseId?: string;
|
|
@@ -35,10 +41,11 @@ export interface EntityEditViewProps<M extends Record<string, any>> {
|
|
|
35
41
|
* an entity is opened.
|
|
36
42
|
*/
|
|
37
43
|
export declare function EntityEditView<M extends Record<string, any>, USER extends User>({ entityId, ...props }: EntityEditViewProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
export declare function EntityEditViewInner<M extends Record<string, any>>({ path, entityId, selectedTab: selectedTabProp, collection, parentCollectionIds, onValuesModified, onSaved, onTabChange, entity, cachedDirtyValues, dataLoading, layout, barActions, status, setStatus, formProps, }: EntityEditViewProps<M> & {
|
|
44
|
+
export declare function EntityEditViewInner<M extends Record<string, any>>({ path, fullIdPath, entityId, selectedTab: selectedTabProp, collection, parentCollectionIds, onValuesModified, onSaved, onTabChange, entity, cachedDirtyValues, dataLoading, layout, barActions, status, setStatus, formProps, canEdit }: EntityEditViewProps<M> & {
|
|
39
45
|
entity?: Entity<M>;
|
|
40
46
|
cachedDirtyValues?: Partial<M>;
|
|
41
47
|
dataLoading: boolean;
|
|
42
48
|
status: EntityStatus;
|
|
43
49
|
setStatus: (status: EntityStatus) => void;
|
|
50
|
+
canEdit?: boolean;
|
|
44
51
|
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/core/FireCMS.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FireCMSProps, User } from "../types";
|
|
2
2
|
/**
|
|
3
3
|
* If you are using independent components of the CMS
|
|
4
4
|
* you need to wrap them with this main component, so the internal hooks work.
|
|
@@ -11,4 +11,4 @@ import { EntityCollection, FireCMSProps, User } from "../types";
|
|
|
11
11
|
|
|
12
12
|
* @group Core
|
|
13
13
|
*/
|
|
14
|
-
export declare function FireCMS<USER extends User
|
|
14
|
+
export declare function FireCMS<USER extends User>(props: FireCMSProps<USER>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -29,6 +29,10 @@ export type EntityFormProps<M extends Record<string, any>> = {
|
|
|
29
29
|
onEntityChange?: (entity: Entity<M>) => void;
|
|
30
30
|
formex?: FormexController<M>;
|
|
31
31
|
openEntityMode?: "side_panel" | "full_screen";
|
|
32
|
+
/**
|
|
33
|
+
* If true, the form will be disabled and no actions will be available
|
|
34
|
+
*/
|
|
35
|
+
disabled?: boolean;
|
|
32
36
|
/**
|
|
33
37
|
* Include the copy and delete actions in the form
|
|
34
38
|
*/
|
|
@@ -41,5 +45,5 @@ export type EntityFormProps<M extends Record<string, any>> = {
|
|
|
41
45
|
Builder?: React.ComponentType<EntityCustomViewParams<M>>;
|
|
42
46
|
children?: React.ReactNode;
|
|
43
47
|
};
|
|
44
|
-
export declare function EntityForm<M extends Record<string, any>>({ path, entityId: entityIdProp, collection, onValuesModified, onIdChange, onSaved, entity, initialDirtyValues, onFormContextReady, forceActionsAtTheBottom, initialStatus, className, onStatusChange, onEntityChange, openEntityMode, formex: formexProp, Builder, EntityFormActionsComponent, showDefaultActions, showEntityPath, children }: EntityFormProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare function EntityForm<M extends Record<string, any>>({ path, entityId: entityIdProp, collection, onValuesModified, onIdChange, onSaved, entity, initialDirtyValues, onFormContextReady, forceActionsAtTheBottom, initialStatus, className, onStatusChange, onEntityChange, openEntityMode, formex: formexProp, disabled: disabledProp, Builder, EntityFormActionsComponent, showDefaultActions, showEntityPath, children }: EntityFormProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
45
49
|
export declare function yupToFormErrors(yupError: ValidationError): Record<string, any>;
|
|
@@ -26,5 +26,5 @@ import { CMSType, PropertyFieldBindingProps } from "../types";
|
|
|
26
26
|
* @group Form custom fields
|
|
27
27
|
*/
|
|
28
28
|
export declare const PropertyFieldBinding: typeof PropertyFieldBindingInternal;
|
|
29
|
-
declare function PropertyFieldBindingInternal<T extends CMSType = CMSType, M extends Record<string, any> = any>({ propertyKey, property, context, includeDescription, underlyingValueHasChanged, disabled: disabledProp, partOfArray, minimalistView, autoFocus, index, size, onPropertyChange }: PropertyFieldBindingProps<T, M>): ReactElement<PropertyFieldBindingProps<T, M>>;
|
|
29
|
+
declare function PropertyFieldBindingInternal<T extends CMSType = CMSType, M extends Record<string, any> = any>({ propertyKey, property, context, includeDescription, underlyingValueHasChanged, disabled: disabledProp, partOfArray, minimalistView, autoFocus, index, size, onPropertyChange, }: PropertyFieldBindingProps<T, M>): ReactElement<PropertyFieldBindingProps<T, M>>;
|
|
30
30
|
export {};
|
|
@@ -37,5 +37,5 @@ export type SaveEntityWithCallbacksProps<M extends Record<string, any>> = SaveEn
|
|
|
37
37
|
export declare function saveEntityWithCallbacks<M extends Record<string, any>, USER extends User>({ collection, path, entityId, values, previousValues, status, dataSource, context, onSaveSuccess, onSaveFailure, onPreSaveHookError, onSaveSuccessHookError }: SaveEntityWithCallbacksProps<M> & {
|
|
38
38
|
collection: EntityCollection<M, USER>;
|
|
39
39
|
dataSource: DataSource;
|
|
40
|
-
context: FireCMSContext
|
|
40
|
+
context: FireCMSContext;
|
|
41
41
|
}): Promise<void>;
|