@firecms/core 3.0.1 → 3.1.0-canary.1df3b2c
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 +1 -1
- package/dist/components/AIIcon.d.ts +16 -0
- package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +7 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +14 -0
- package/dist/components/EntityCollectionTable/PropertyTableCell.d.ts +6 -0
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +5 -4
- package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +6 -0
- package/dist/components/EntityCollectionView/Board.d.ts +2 -0
- package/dist/components/EntityCollectionView/BoardColumn.d.ts +42 -0
- package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +9 -0
- package/dist/components/EntityCollectionView/BoardSortableList.d.ts +14 -0
- package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +26 -0
- package/dist/components/EntityCollectionView/EntityCard.d.ts +19 -0
- package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +20 -0
- package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +31 -0
- package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +2 -2
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +7 -3
- package/dist/components/EntityCollectionView/FiltersDialog.d.ts +14 -0
- package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +49 -0
- package/dist/components/EntityCollectionView/board_types.d.ts +105 -0
- package/dist/components/EntityCollectionView/useBoardDataController.d.ts +60 -0
- package/dist/components/SelectableTable/SelectableTable.d.ts +5 -1
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
- package/dist/components/VirtualTable/VirtualTableCell.d.ts +6 -0
- package/dist/components/VirtualTable/VirtualTableHeader.d.ts +2 -0
- package/dist/components/VirtualTable/VirtualTableHeaderRow.d.ts +1 -1
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +11 -0
- package/dist/components/VirtualTable/fields/VirtualTableDateField.d.ts +1 -0
- package/dist/components/VirtualTable/types.d.ts +2 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/contexts/index.d.ts +10 -0
- package/dist/core/DrawerNavigationGroup.d.ts +45 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/form/validation.d.ts +3 -2
- package/dist/hooks/useBreadcrumbsController.d.ts +16 -0
- package/dist/hooks/useCollapsedGroups.d.ts +4 -1
- package/dist/index.es.js +5239 -1590
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5233 -1585
- package/dist/index.umd.js.map +1 -1
- package/dist/preview/PropertyPreviewProps.d.ts +5 -0
- package/dist/preview/components/DatePreview.d.ts +13 -3
- package/dist/preview/components/ImagePreview.d.ts +5 -1
- package/dist/preview/components/StorageThumbnail.d.ts +2 -1
- package/dist/preview/components/UrlComponentPreview.d.ts +2 -1
- package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +1 -1
- package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +1 -1
- package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +1 -1
- package/dist/types/collections.d.ts +42 -2
- package/dist/types/datasource.d.ts +0 -1
- package/dist/types/plugins.d.ts +46 -1
- package/dist/types/properties.d.ts +259 -4
- package/dist/util/__tests__/conditions.test.d.ts +1 -0
- package/dist/util/__tests__/objects.test.d.ts +1 -0
- package/dist/util/conditions.d.ts +26 -0
- package/dist/util/entities.d.ts +1 -2
- package/dist/util/index.d.ts +2 -1
- package/dist/util/property_utils.d.ts +2 -1
- package/dist/util/resolutions.d.ts +1 -1
- package/package.json +10 -7
- package/src/app/Scaffold.tsx +14 -15
- package/src/components/AIIcon.tsx +39 -0
- package/src/components/ArrayContainer.tsx +1 -4
- package/src/components/ClearFilterSortButton.tsx +19 -16
- package/src/components/ConfirmationDialog.tsx +0 -2
- package/src/components/DeleteEntityDialog.tsx +2 -4
- package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +74 -41
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +130 -79
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +121 -104
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +132 -103
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +20 -42
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +90 -49
- package/src/components/EntityCollectionView/Board.tsx +324 -0
- package/src/components/EntityCollectionView/BoardColumn.tsx +158 -0
- package/src/components/EntityCollectionView/BoardColumnTitle.tsx +45 -0
- package/src/components/EntityCollectionView/BoardSortableList.tsx +172 -0
- package/src/components/EntityCollectionView/EntityBoardCard.tsx +212 -0
- package/src/components/EntityCollectionView/EntityCard.tsx +231 -0
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +713 -0
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +244 -0
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +485 -203
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +31 -19
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +84 -15
- package/src/components/EntityCollectionView/FiltersDialog.tsx +249 -0
- package/src/components/EntityCollectionView/ViewModeToggle.tsx +202 -0
- package/src/components/EntityCollectionView/board_types.ts +113 -0
- package/src/components/EntityCollectionView/useBoardDataController.tsx +490 -0
- package/src/components/ErrorTooltip.tsx +2 -1
- package/src/components/HomePage/DefaultHomePage.tsx +47 -10
- package/src/components/HomePage/HomePageDnD.tsx +56 -41
- package/src/components/HomePage/NavigationCard.tsx +20 -18
- package/src/components/HomePage/NavigationGroup.tsx +17 -16
- package/src/components/HomePage/RenameGroupDialog.tsx +0 -2
- package/src/components/HomePage/SmallNavigationCard.tsx +10 -9
- package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +3 -10
- package/src/components/ReferenceWidget.tsx +2 -4
- package/src/components/SelectableTable/SelectableTable.tsx +75 -67
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +7 -6
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +39 -40
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +38 -38
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +49 -58
- package/src/components/UnsavedChangesDialog.tsx +0 -2
- package/src/components/UserDisplay.tsx +4 -4
- package/src/components/VirtualTable/VirtualTable.tsx +170 -19
- package/src/components/VirtualTable/VirtualTableCell.tsx +18 -2
- package/src/components/VirtualTable/VirtualTableHeader.tsx +20 -11
- package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +158 -42
- package/src/components/VirtualTable/VirtualTableProps.tsx +14 -1
- package/src/components/VirtualTable/VirtualTableRow.tsx +1 -1
- package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +3 -0
- package/src/components/VirtualTable/fields/VirtualTableSelect.tsx +17 -4
- package/src/components/VirtualTable/types.tsx +2 -0
- package/src/components/common/useColumnsIds.tsx +95 -3
- package/src/components/index.tsx +4 -0
- package/src/contexts/BreacrumbsContext.tsx +15 -8
- package/src/contexts/index.ts +10 -0
- package/src/core/DefaultAppBar.tsx +39 -26
- package/src/core/DefaultDrawer.tsx +42 -56
- package/src/core/DrawerNavigationGroup.tsx +118 -0
- package/src/core/DrawerNavigationItem.tsx +4 -3
- package/src/core/EntityEditView.tsx +41 -43
- package/src/core/SideDialogs.tsx +4 -2
- package/src/core/index.tsx +1 -0
- package/src/form/PropertyFieldBinding.tsx +58 -43
- package/src/form/components/StorageItemPreview.tsx +2 -1
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +0 -1
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +17 -16
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +0 -1
- package/src/form/field_bindings/MapFieldBinding.tsx +69 -67
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +21 -17
- package/src/form/field_bindings/TextFieldBinding.tsx +71 -35
- package/src/form/validation.ts +245 -160
- package/src/hooks/useBreadcrumbsController.tsx +18 -0
- package/src/hooks/useBuildNavigationController.tsx +42 -19
- package/src/hooks/useCollapsedGroups.ts +12 -4
- package/src/internal/useBuildDataSource.ts +69 -34
- package/src/internal/useBuildSideDialogsController.tsx +11 -8
- package/src/internal/useBuildSideEntityController.tsx +2 -4
- package/src/internal/useRestoreScroll.tsx +26 -14
- package/src/preview/PropertyPreview.tsx +40 -32
- package/src/preview/PropertyPreviewProps.tsx +6 -0
- package/src/preview/components/DatePreview.tsx +72 -4
- package/src/preview/components/EmptyValue.tsx +1 -1
- package/src/preview/components/ImagePreview.tsx +37 -21
- package/src/preview/components/StorageThumbnail.tsx +16 -12
- package/src/preview/components/UrlComponentPreview.tsx +28 -25
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +9 -7
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +11 -9
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +26 -24
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +61 -56
- package/src/routes/CustomCMSRoute.tsx +1 -0
- package/src/routes/FireCMSRoute.tsx +26 -13
- package/src/types/collections.ts +48 -3
- package/src/types/datasource.ts +54 -56
- package/src/types/plugins.tsx +51 -1
- package/src/types/properties.ts +347 -27
- package/src/util/__tests__/conditions.test.ts +506 -0
- package/src/util/__tests__/objects.test.ts +196 -0
- package/src/util/callbacks.ts +6 -3
- package/src/util/collections.ts +51 -6
- package/src/util/conditions.ts +339 -0
- package/src/util/entities.ts +28 -29
- package/src/util/entity_cache.ts +2 -1
- package/src/util/index.ts +2 -1
- package/src/util/objects.ts +31 -13
- package/src/util/{references.ts → previews.ts} +14 -0
- package/src/util/property_utils.tsx +36 -10
- package/src/util/resolutions.ts +57 -55
- /package/dist/util/{references.d.ts → previews.d.ts} +0 -0
|
@@ -132,6 +132,11 @@ export interface VirtualTableProps<T extends Record<string, any>> {
|
|
|
132
132
|
* Initial scroll position
|
|
133
133
|
*/
|
|
134
134
|
initialScroll?: number;
|
|
135
|
+
/**
|
|
136
|
+
* Callback when columns are reordered via drag-and-drop.
|
|
137
|
+
* @param columns The new column order
|
|
138
|
+
*/
|
|
139
|
+
onColumnsOrderChange?: (columns: VirtualTableColumn[]) => void;
|
|
135
140
|
}
|
|
136
141
|
export type CellRendererParams<T = any> = {
|
|
137
142
|
column: VirtualTableColumn;
|
|
@@ -141,6 +146,12 @@ export type CellRendererParams<T = any> = {
|
|
|
141
146
|
rowIndex: number;
|
|
142
147
|
width: number;
|
|
143
148
|
isScrolling?: boolean;
|
|
149
|
+
sortableNodeRef?: (node: HTMLElement | null) => void;
|
|
150
|
+
sortableStyle?: React.CSSProperties;
|
|
151
|
+
sortableAttributes?: Record<string, any>;
|
|
152
|
+
isDragging?: boolean;
|
|
153
|
+
isDraggable?: boolean;
|
|
154
|
+
frozen?: boolean;
|
|
144
155
|
};
|
|
145
156
|
/**
|
|
146
157
|
* @see Table
|
|
@@ -31,4 +31,6 @@ export type VirtualTableContextProps<T extends any> = {
|
|
|
31
31
|
rowClassName?: (rowData: T) => string | undefined;
|
|
32
32
|
endAdornment?: React.ReactNode;
|
|
33
33
|
AddColumnComponent?: React.ComponentType;
|
|
34
|
+
onColumnsOrderChange?: (columns: VirtualTableColumn[]) => void;
|
|
35
|
+
draggingColumnId?: string | null;
|
|
34
36
|
};
|
|
@@ -11,6 +11,8 @@ export * from "./SelectableTable/SelectableTable";
|
|
|
11
11
|
export * from "./SelectableTable/SelectableTableContext";
|
|
12
12
|
export * from "./EntityCollectionView/EntityCollectionView";
|
|
13
13
|
export * from "./EntityCollectionView/EntityCollectionViewActions";
|
|
14
|
+
export * from "./EntityCollectionView/EntityCollectionCardView";
|
|
15
|
+
export * from "./EntityCollectionView/EntityCard";
|
|
14
16
|
export * from "./EntityCollectionView/useSelectionController";
|
|
15
17
|
export * from "./PropertyConfigBadge";
|
|
16
18
|
export * from "./PropertyIdCopyTooltip";
|
|
@@ -26,3 +28,4 @@ export * from "./ReferenceWidget";
|
|
|
26
28
|
export * from "./SearchIconsView";
|
|
27
29
|
export * from "./FieldCaption";
|
|
28
30
|
export * from "./EntityPreview";
|
|
31
|
+
export * from "./AIIcon";
|
package/dist/contexts/index.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
export * from "./SnackbarProvider";
|
|
2
2
|
export * from "./ModeController";
|
|
3
3
|
export * from "./AuthControllerContext";
|
|
4
|
+
export * from "./DataSourceContext";
|
|
5
|
+
export * from "./NavigationContext";
|
|
6
|
+
export * from "./CustomizationControllerContext";
|
|
7
|
+
export * from "./SideEntityControllerContext";
|
|
8
|
+
export * from "./SideDialogsControllerContext";
|
|
9
|
+
export * from "./AnalyticsContext";
|
|
10
|
+
export * from "./StorageSourceContext";
|
|
11
|
+
export * from "./UserConfigurationPersistenceContext";
|
|
12
|
+
export * from "./DialogsProvider";
|
|
13
|
+
export * from "./InternalUserManagementContext";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NavigationEntry } from "../types";
|
|
3
|
+
export interface DrawerNavigationGroupProps {
|
|
4
|
+
/**
|
|
5
|
+
* Group name to display in header
|
|
6
|
+
*/
|
|
7
|
+
group: string;
|
|
8
|
+
/**
|
|
9
|
+
* Navigation entries in this group
|
|
10
|
+
*/
|
|
11
|
+
entries: NavigationEntry[];
|
|
12
|
+
/**
|
|
13
|
+
* Whether the group is collapsed
|
|
14
|
+
*/
|
|
15
|
+
collapsed: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Callback when collapse state should toggle
|
|
18
|
+
*/
|
|
19
|
+
onToggleCollapsed: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the drawer is in open (expanded) state
|
|
22
|
+
*/
|
|
23
|
+
drawerOpen: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether tooltips should be shown (drawer closed + hovered)
|
|
26
|
+
*/
|
|
27
|
+
tooltipsOpen: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether admin menu is open (used to control tooltip visibility)
|
|
30
|
+
*/
|
|
31
|
+
adminMenuOpen?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Optional actions to render in the group header (e.g., "Add collection" button)
|
|
34
|
+
*/
|
|
35
|
+
headerActions?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Optional callback when a navigation item is clicked
|
|
38
|
+
*/
|
|
39
|
+
onItemClick?: (entry: NavigationEntry) => void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Shared drawer navigation group component used by both DefaultDrawer and FireCMSCloudDrawer.
|
|
43
|
+
* Renders a collapsible group with header and navigation items.
|
|
44
|
+
*/
|
|
45
|
+
export declare function DrawerNavigationGroup({ group, entries, collapsed, onToggleCollapsed, drawerOpen, tooltipsOpen, adminMenuOpen, headerActions, onItemClick }: DrawerNavigationGroupProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { CMSType, ResolvedArrayProperty, ResolvedMapProperty, ResolvedProperties, ResolvedProperty } from "../types";
|
|
2
|
+
import * as yup from "yup";
|
|
2
3
|
import { AnySchema, ObjectSchema } from "yup";
|
|
3
4
|
declare module "yup" {
|
|
4
|
-
interface ArraySchema<
|
|
5
|
-
uniqueInArray(mapper: (a:
|
|
5
|
+
interface ArraySchema<TIn extends any[] | null | undefined, TContext, TDefault = undefined, TFlags extends yup.Flags = ""> {
|
|
6
|
+
uniqueInArray(mapper: (a: any) => any, message: string): ArraySchema<TIn, TContext, TDefault, TFlags>;
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
9
|
export type CustomFieldValidator = (props: {
|
|
@@ -6,6 +6,10 @@ export interface BreadcrumbsController {
|
|
|
6
6
|
set: (props: {
|
|
7
7
|
breadcrumbs: BreadcrumbEntry[];
|
|
8
8
|
}) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Update the count for a specific breadcrumb by ID.
|
|
11
|
+
*/
|
|
12
|
+
updateCount: (id: string, count: number | null | undefined) => void;
|
|
9
13
|
}
|
|
10
14
|
/**
|
|
11
15
|
* @group Hooks and utilities
|
|
@@ -13,6 +17,18 @@ export interface BreadcrumbsController {
|
|
|
13
17
|
export interface BreadcrumbEntry {
|
|
14
18
|
title: string;
|
|
15
19
|
url: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional entity count for collection breadcrumbs.
|
|
22
|
+
* - undefined: not applicable (e.g., entity breadcrumb, custom view)
|
|
23
|
+
* - null: loading
|
|
24
|
+
* - number: loaded count
|
|
25
|
+
*/
|
|
26
|
+
count?: number | null;
|
|
27
|
+
/**
|
|
28
|
+
* Unique identifier for this breadcrumb (e.g., collection path).
|
|
29
|
+
* Used to update count without replacing entire breadcrumb array.
|
|
30
|
+
*/
|
|
31
|
+
id?: string;
|
|
16
32
|
}
|
|
17
33
|
/**
|
|
18
34
|
* Hook to retrieve the BreadcrumbsController.
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
* Custom hook for managing collapsed/expanded state of navigation groups
|
|
3
3
|
* with localStorage persistence. Automatically cleans up stale group entries
|
|
4
4
|
* when groups are removed from the navigation.
|
|
5
|
+
*
|
|
6
|
+
* @param groupNames - Array of group names to track
|
|
7
|
+
* @param namespace - Namespace for localStorage key (e.g., "home", "drawer") to allow independent state
|
|
5
8
|
*/
|
|
6
|
-
export declare function useCollapsedGroups(groupNames: string[]): {
|
|
9
|
+
export declare function useCollapsedGroups(groupNames: string[], namespace?: string): {
|
|
7
10
|
isGroupCollapsed: (name: string) => boolean;
|
|
8
11
|
toggleGroupCollapsed: (name: string) => void;
|
|
9
12
|
};
|