@firecms/core 3.0.0-beta.13 → 3.0.0-beta.14
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/ArrayContainer.d.ts +7 -12
- package/dist/components/EntityPreview.d.ts +4 -2
- package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +0 -4
- package/dist/components/index.d.ts +1 -0
- package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +3 -9
- package/dist/hooks/useBuildNavigationController.d.ts +2 -9
- package/dist/index.es.js +1183 -705
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1191 -716
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collections.d.ts +20 -2
- package/dist/types/firecms.d.ts +2 -1
- package/dist/types/navigation.d.ts +5 -0
- package/dist/types/plugins.d.ts +12 -0
- package/dist/types/side_entity_controller.d.ts +4 -0
- package/dist/util/callbacks.d.ts +2 -0
- package/dist/util/index.d.ts +1 -0
- package/package.json +8 -6
- package/src/components/ArrayContainer.tsx +409 -294
- package/src/components/ClearFilterSortButton.tsx +1 -1
- package/src/components/ConfirmationDialog.tsx +9 -9
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +13 -2
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +53 -27
- package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +9 -9
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +4 -0
- package/src/components/EntityPreview.tsx +18 -14
- package/src/components/ErrorView.tsx +1 -1
- package/src/components/HomePage/DefaultHomePage.tsx +2 -1
- package/src/components/HomePage/NavigationCardBinding.tsx +3 -1
- package/src/components/SelectableTable/SelectableTable.tsx +140 -143
- package/src/components/VirtualTable/VirtualTable.tsx +8 -30
- package/src/components/VirtualTable/VirtualTableProps.tsx +0 -5
- package/src/components/VirtualTable/fields/VirtualTableInput.tsx +0 -1
- package/src/components/index.tsx +2 -0
- package/src/core/EntityEditView.tsx +26 -14
- package/src/core/EntitySidePanel.tsx +15 -20
- package/src/core/FireCMS.tsx +7 -1
- package/src/form/EntityForm.tsx +1 -1
- package/src/form/PropertyFieldBinding.tsx +0 -1
- package/src/form/components/CustomIdField.tsx +3 -1
- package/src/form/components/LabelWithIcon.tsx +1 -1
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +3 -2
- package/src/form/field_bindings/MapFieldBinding.tsx +5 -4
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -0
- package/src/form/field_bindings/SelectFieldBinding.tsx +2 -1
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +222 -154
- package/src/hooks/data/save.ts +0 -6
- package/src/hooks/useBuildNavigationController.tsx +30 -16
- package/src/internal/useBuildSideEntityController.tsx +1 -1
- package/src/preview/components/ImagePreview.tsx +2 -2
- package/src/preview/components/ReferencePreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -1
- package/src/preview/property_previews/MapPropertyPreview.tsx +1 -1
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +1 -1
- package/src/preview/property_previews/StringPropertyPreview.tsx +1 -1
- package/src/types/collections.ts +24 -2
- package/src/types/firecms.tsx +2 -2
- package/src/types/navigation.ts +6 -0
- package/src/types/plugins.tsx +16 -0
- package/src/types/side_entity_controller.tsx +5 -5
- package/src/util/callbacks.ts +119 -0
- package/src/util/index.ts +1 -0
- package/src/util/navigation_utils.ts +70 -55
- package/src/util/objects.ts +53 -20
- package/dist/components/EntityCollectionTable/internal/popup_field/ElementResizeListener.d.ts +0 -5
- package/src/components/EntityCollectionTable/internal/popup_field/ElementResizeListener.tsx +0 -59
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { DraggableProvided } from "@hello-pangea/dnd";
|
|
3
2
|
export type ArrayEntryParams = {
|
|
4
3
|
index: number;
|
|
5
4
|
internalId: number;
|
|
@@ -16,9 +15,6 @@ export interface ArrayContainerProps<T> {
|
|
|
16
15
|
disabled?: boolean;
|
|
17
16
|
size?: "small" | "medium";
|
|
18
17
|
onInternalIdAdded?: (id: number) => void;
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated Use `canAddElements` instead
|
|
21
|
-
*/
|
|
22
18
|
includeAddButton?: boolean;
|
|
23
19
|
canAddElements?: boolean;
|
|
24
20
|
sortable?: boolean;
|
|
@@ -28,12 +24,10 @@ export interface ArrayContainerProps<T> {
|
|
|
28
24
|
min?: number;
|
|
29
25
|
max?: number;
|
|
30
26
|
}
|
|
31
|
-
/**
|
|
32
|
-
* @group Form custom fields
|
|
33
|
-
*/
|
|
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;
|
|
35
27
|
type ArrayContainerItemProps = {
|
|
36
|
-
|
|
28
|
+
nodeRef: (node: HTMLElement | null) => void;
|
|
29
|
+
style: React.CSSProperties;
|
|
30
|
+
dragHandleProps: any;
|
|
37
31
|
index: number;
|
|
38
32
|
internalId: number;
|
|
39
33
|
size?: "small" | "medium";
|
|
@@ -48,17 +42,18 @@ type ArrayContainerItemProps = {
|
|
|
48
42
|
storedProps?: object;
|
|
49
43
|
updateItemCustomProps: (internalId: number, props: object) => void;
|
|
50
44
|
};
|
|
51
|
-
export declare function ArrayContainerItem({
|
|
52
|
-
export declare function ArrayItemOptions({ direction, disabled, remove, index,
|
|
45
|
+
export declare function ArrayContainerItem({ nodeRef, style, dragHandleProps, index, internalId, size, disabled, buildEntry, remove, copy, addInIndex, canAddElements, sortable, isDragging, storedProps, updateItemCustomProps }: ArrayContainerItemProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare function ArrayItemOptions({ dragHandleProps, direction, disabled, remove, index, copy, canAddElements, sortable, addInIndex, }: {
|
|
47
|
+
dragHandleProps: any;
|
|
53
48
|
direction?: "row" | "column";
|
|
54
49
|
disabled: boolean;
|
|
55
50
|
remove: (index: number) => void;
|
|
56
51
|
index: number;
|
|
57
|
-
provided: any;
|
|
58
52
|
copy: (index: number) => void;
|
|
59
53
|
sortable: boolean;
|
|
60
54
|
canAddElements?: boolean;
|
|
61
55
|
addInIndex?: (index: number) => void;
|
|
62
56
|
}): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
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;
|
|
63
58
|
export declare function getRandomId(): number;
|
|
64
59
|
export {};
|
|
@@ -6,18 +6,20 @@ export type EntityPreviewProps = {
|
|
|
6
6
|
actions?: React.ReactNode;
|
|
7
7
|
collection?: EntityCollection;
|
|
8
8
|
hover?: boolean;
|
|
9
|
-
|
|
9
|
+
previewKeys?: string[];
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
entity: Entity<any>;
|
|
12
12
|
includeId?: boolean;
|
|
13
|
+
includeTitle?: boolean;
|
|
13
14
|
includeEntityLink?: boolean;
|
|
15
|
+
includeImage?: boolean;
|
|
14
16
|
onClick?: (e: React.SyntheticEvent) => void;
|
|
15
17
|
};
|
|
16
18
|
/**
|
|
17
19
|
* This view is used to display a preview of an entity.
|
|
18
20
|
* It is used by default in reference fields and whenever a reference is displayed.
|
|
19
21
|
*/
|
|
20
|
-
export declare function EntityPreview({ actions, disabled, hover, collection: collectionProp,
|
|
22
|
+
export declare function EntityPreview({ actions, disabled, hover, collection: collectionProp, previewKeys, onClick, size, includeId, includeTitle, includeEntityLink, includeImage, entity, }: EntityPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
export type EntityPreviewContainerProps = {
|
|
22
24
|
children: React.ReactNode;
|
|
23
25
|
hover?: boolean;
|
|
@@ -82,4 +82,4 @@ export type SelectableTableProps<M extends Record<string, any>> = {
|
|
|
82
82
|
* @see VirtualTable
|
|
83
83
|
* @group Components
|
|
84
84
|
*/
|
|
85
|
-
export declare const SelectableTable:
|
|
85
|
+
export declare const SelectableTable: <M extends Record<string, any>>({ onValueChange, cellRenderer, onEntityClick, onColumnResize, hoverRow, size, inlineEditing, tableController: { data, dataLoading, noMoreToLoad, dataLoadingError, filterValues, setFilterValues, sortBy, setSortBy, itemCount, setItemCount, pageSize, paginationEnabled, checkFilterCombination, setPopupCell }, filterable, onScroll, initialScroll, emptyComponent, columns, forceFilter, highlightedRow, endAdornment, AddColumnComponent }: SelectableTableProps<M>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -132,10 +132,6 @@ export interface VirtualTableProps<T extends Record<string, any>> {
|
|
|
132
132
|
* Initial scroll position
|
|
133
133
|
*/
|
|
134
134
|
initialScroll?: number;
|
|
135
|
-
/**
|
|
136
|
-
* Debug mode
|
|
137
|
-
*/
|
|
138
|
-
debug?: boolean;
|
|
139
135
|
}
|
|
140
136
|
export type CellRendererParams<T = any> = {
|
|
141
137
|
column: VirtualTableColumn;
|
|
@@ -6,4 +6,4 @@ import { FieldProps } from "../../types";
|
|
|
6
6
|
* and tables to the specified properties.
|
|
7
7
|
* @group Form fields
|
|
8
8
|
*/
|
|
9
|
-
export declare function MapFieldBinding({ propertyKey, value, showError, error, disabled, property, minimalistView: minimalistViewProp, includeDescription, autoFocus, context, onPropertyChange }: FieldProps<Record<string, any>>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function MapFieldBinding({ propertyKey, value, showError, error, disabled, property, partOfArray, minimalistView: minimalistViewProp, includeDescription, autoFocus, context, onPropertyChange }: FieldProps<Record<string, any>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { FieldProps, ResolvedArrayProperty, ResolvedStringProperty, StorageConfig } from "../../types";
|
|
2
2
|
import { StorageFieldItem } from "../../util/useStorageUploadController";
|
|
3
3
|
type StorageUploadFieldProps = FieldProps<string | string[]>;
|
|
4
|
-
/**
|
|
5
|
-
* Field that allows to upload files to Google Cloud Storage.
|
|
6
|
-
*
|
|
7
|
-
* This is one of the internal components that get mapped natively inside forms
|
|
8
|
-
* and tables to the specified properties.
|
|
9
|
-
* @group Form fields
|
|
10
|
-
*/
|
|
11
4
|
export declare function StorageUploadFieldBinding({ propertyKey, value, setValue, error, showError, autoFocus, minimalistView, property, includeDescription, context, isSubmitting, }: StorageUploadFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
12
5
|
export interface StorageUploadProps {
|
|
13
6
|
value: StorageFieldItem[];
|
|
@@ -19,9 +12,10 @@ export interface StorageUploadProps {
|
|
|
19
12
|
autoFocus: boolean;
|
|
20
13
|
disabled: boolean;
|
|
21
14
|
storage: StorageConfig;
|
|
22
|
-
onFilesAdded: (acceptedFiles: File[]) => void
|
|
15
|
+
onFilesAdded: (acceptedFiles: File[]) => Promise<void>;
|
|
23
16
|
storagePathBuilder: (file: File) => string;
|
|
24
17
|
onFileUploadComplete: (uploadedPath: string, entry: StorageFieldItem, fileMetadata?: any) => Promise<void>;
|
|
25
18
|
}
|
|
26
|
-
export declare function StorageUpload({ property, name, value,
|
|
19
|
+
export declare function StorageUpload({ property, name, value, // This is internalValue from useStorageUploadController
|
|
20
|
+
setInternalValue, onChange, multipleFilesSupported, onFileUploadComplete, disabled, onFilesAdded, autoFocus, storage, storagePathBuilder, }: StorageUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
27
21
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthController, CMSView, CMSViewsBuilder, DataSourceDelegate, EntityCollection, EntityCollectionsBuilder, NavigationController, PermissionsBuilder, User, UserConfigurationPersistence } from "../types";
|
|
1
|
+
import { AuthController, CMSView, CMSViewsBuilder, DataSourceDelegate, EntityCollection, EntityCollectionsBuilder, FireCMSPlugin, NavigationController, PermissionsBuilder, User, UserConfigurationPersistence } from "../types";
|
|
2
2
|
export type BuildNavigationContextProps<EC extends EntityCollection, USER extends User> = {
|
|
3
3
|
basePath?: string;
|
|
4
4
|
baseCollectionPath?: string;
|
|
@@ -10,14 +10,7 @@ export type BuildNavigationContextProps<EC extends EntityCollection, USER extend
|
|
|
10
10
|
viewsOrder?: string[];
|
|
11
11
|
userConfigPersistence?: UserConfigurationPersistence;
|
|
12
12
|
dataSourceDelegate: DataSourceDelegate;
|
|
13
|
-
|
|
14
|
-
* Use this method to inject collections to the CMS.
|
|
15
|
-
* You receive the current collections as a parameter, and you can return
|
|
16
|
-
* a new list of collections.
|
|
17
|
-
* @see {@link joinCollectionLists}
|
|
18
|
-
* @param collections
|
|
19
|
-
*/
|
|
20
|
-
injectCollections?: (collections: EntityCollection[]) => EntityCollection[];
|
|
13
|
+
plugins?: FireCMSPlugin[];
|
|
21
14
|
/**
|
|
22
15
|
* If true, the navigation logic will not be updated until this flag is false
|
|
23
16
|
*/
|