@firecms/core 3.0.0-3.0.0-canary.27.0 → 3.0.0-3.0.0-canary.44.0

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.
Files changed (84) hide show
  1. package/README.md +1 -1
  2. package/dist/components/ClearFilterSortButton.d.ts +5 -0
  3. package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +11 -11
  4. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +1 -1
  5. package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +4 -2
  6. package/dist/components/EntityCollectionTable/PropertyTableCell.d.ts +1 -0
  7. package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +1 -4
  8. package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +1 -1
  9. package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +11 -1
  10. package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +11 -0
  11. package/dist/components/FireCMSAppBar.d.ts +3 -2
  12. package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
  13. package/dist/components/common/types.d.ts +4 -6
  14. package/dist/core/NavigationRoutes.d.ts +1 -1
  15. package/dist/core/Scaffold.d.ts +1 -1
  16. package/dist/form/components/ErrorFocus.d.ts +1 -1
  17. package/dist/hooks/data/save.d.ts +1 -2
  18. package/dist/hooks/useBuildNavigationController.d.ts +1 -2
  19. package/dist/hooks/useValidateAuthenticator.d.ts +2 -6
  20. package/dist/index.es.js +4322 -4171
  21. package/dist/index.es.js.map +1 -1
  22. package/dist/index.umd.js +5 -5
  23. package/dist/index.umd.js.map +1 -1
  24. package/dist/internal/useBuildDataSource.d.ts +1 -16
  25. package/dist/types/collections.d.ts +5 -1
  26. package/dist/types/datasource.d.ts +2 -5
  27. package/dist/types/entities.d.ts +5 -1
  28. package/dist/types/index.d.ts +0 -1
  29. package/dist/types/navigation.d.ts +1 -1
  30. package/dist/types/plugins.d.ts +3 -1
  31. package/dist/types/properties.d.ts +2 -2
  32. package/dist/util/entities.d.ts +1 -1
  33. package/dist/util/navigation_utils.d.ts +2 -2
  34. package/dist/util/resolutions.d.ts +5 -5
  35. package/package.json +22 -19
  36. package/src/components/ClearFilterSortButton.tsx +41 -0
  37. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +16 -13
  38. package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +6 -4
  39. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +33 -32
  40. package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +27 -32
  41. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +11 -6
  42. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +2 -4
  43. package/src/components/EntityCollectionView/EntityCollectionView.tsx +34 -10
  44. package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +68 -0
  45. package/src/components/EntityView.tsx +1 -1
  46. package/src/components/FireCMSAppBar.tsx +23 -8
  47. package/src/components/HomePage/DefaultHomePage.tsx +1 -1
  48. package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +1 -0
  49. package/src/components/SelectableTable/SelectableTable.tsx +1 -1
  50. package/src/components/SelectableTable/filters/BooleanFilterField.tsx +2 -3
  51. package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +23 -8
  52. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +24 -5
  53. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +35 -15
  54. package/src/components/VirtualTable/VirtualTable.tsx +28 -20
  55. package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +1 -1
  56. package/src/components/common/types.tsx +4 -6
  57. package/src/core/FireCMS.tsx +1 -2
  58. package/src/core/NavigationRoutes.tsx +3 -4
  59. package/src/core/Scaffold.tsx +5 -4
  60. package/src/core/field_configs.tsx +1 -2
  61. package/src/form/field_bindings/DateTimeFieldBinding.tsx +1 -1
  62. package/src/hooks/data/save.ts +1 -1
  63. package/src/hooks/useBuildLocalConfigurationPersistence.tsx +9 -10
  64. package/src/hooks/useBuildModeController.tsx +11 -5
  65. package/src/hooks/useBuildNavigationController.tsx +77 -21
  66. package/src/hooks/useProjectLog.tsx +3 -3
  67. package/src/hooks/useValidateAuthenticator.tsx +2 -22
  68. package/src/internal/useBuildDataSource.ts +42 -47
  69. package/src/internal/useBuildSideEntityController.tsx +16 -13
  70. package/src/preview/PropertyPreview.tsx +2 -12
  71. package/src/types/collections.ts +5 -1
  72. package/src/types/datasource.ts +7 -4
  73. package/src/types/entities.ts +9 -1
  74. package/src/types/index.ts +0 -1
  75. package/src/types/navigation.ts +1 -1
  76. package/src/types/plugins.tsx +4 -3
  77. package/src/types/properties.ts +5 -4
  78. package/src/util/entities.ts +1 -1
  79. package/src/util/navigation_utils.ts +6 -6
  80. package/src/util/strings.ts +2 -2
  81. package/dist/internal/useLocaleConfig.d.ts +0 -1
  82. package/dist/types/appcheck.d.ts +0 -26
  83. package/src/internal/useLocaleConfig.tsx +0 -18
  84. package/src/types/appcheck.ts +0 -29
package/README.md CHANGED
@@ -49,7 +49,7 @@ FireCMS is based on this great technologies:
49
49
  The easiest way to get going is to check our quickstart guide! You will just
50
50
  need to follow some quick steps:
51
51
 
52
- https://firecms.co/docs/quickstart
52
+ https://firecms.co/docs
53
53
 
54
54
  ### Demo
55
55
 
@@ -0,0 +1,5 @@
1
+ import { EntityTableController } from "../types";
2
+ export declare function ClearFilterSortButton({ tableController, enabled }: {
3
+ enabled: boolean;
4
+ tableController: EntityTableController;
5
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -15,17 +15,17 @@ import { CollectionSize, Entity, EntityAction, EntityCollection, SelectionContro
15
15
  */
16
16
  export declare const EntityCollectionRowActions: ({ entity, collection, fullPath, width, frozen, isSelected, selectionEnabled, size, highlightEntity, onCollectionChange, unhighlightEntity, actions, hideId, selectionController, }: {
17
17
  entity: Entity<any>;
18
- collection?: EntityCollection<any, any> | undefined;
19
- fullPath?: string | undefined;
18
+ collection?: EntityCollection<any>;
19
+ fullPath?: string;
20
20
  width: number;
21
- frozen?: boolean | undefined;
21
+ frozen?: boolean;
22
22
  size: CollectionSize;
23
- isSelected?: boolean | undefined;
24
- selectionEnabled?: boolean | undefined;
25
- actions?: EntityAction[] | undefined;
26
- hideId?: boolean | undefined;
27
- onCollectionChange?: (() => void) | undefined;
28
- selectionController?: SelectionController | undefined;
29
- highlightEntity?: ((entity: Entity<any>) => void) | undefined;
30
- unhighlightEntity?: ((entity: Entity<any>) => void) | undefined;
23
+ isSelected?: boolean;
24
+ selectionEnabled?: boolean;
25
+ actions?: EntityAction[];
26
+ hideId?: boolean;
27
+ onCollectionChange?: () => void;
28
+ selectionController?: SelectionController;
29
+ highlightEntity?: (entity: Entity<any>) => void;
30
+ unhighlightEntity?: (entity: Entity<any>) => void;
31
31
  }) => import("react/jsx-runtime").JSX.Element;
@@ -24,4 +24,4 @@ import { EntityCollectionTableProps } from "./EntityCollectionTableProps";
24
24
  * @see VirtualTable
25
25
  * @group Components
26
26
  */
27
- export declare const EntityCollectionTable: <M extends Record<string, any>, UserType extends User>({ forceFilter, actionsStart, actions, title, tableRowActionsBuilder, uniqueFieldValidator, getPropertyFor, onValueChange, selectionController, highlightedEntities, onEntityClick, onColumnResize, onSizeChanged, textSearchEnabled, hoverRow, inlineEditing, additionalFields, displayedColumnIds, defaultSize, properties, tableController, filterable, sortable, endAdornment, AddColumnComponent, AdditionalHeaderWidget, additionalIDHeaderWidget, emptyComponent, getIdColumnWidth, onTextSearchClick, textSearchLoading }: EntityCollectionTableProps<M>) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const EntityCollectionTable: <M extends Record<string, any>, UserType extends User>({ className, forceFilter, actionsStart, actions, title, tableRowActionsBuilder, uniqueFieldValidator, getPropertyFor, onValueChange, selectionController, highlightedEntities, onEntityClick, onColumnResize, onSizeChanged, textSearchEnabled, hoverRow, inlineEditing, additionalFields, displayedColumnIds, defaultSize, properties, tableController, filterable, sortable, endAdornment, AddColumnComponent, AdditionalHeaderWidget, additionalIDHeaderWidget, emptyComponent, getIdColumnWidth, onTextSearchClick, textSearchLoading, enablePopupIcon }: EntityCollectionTableProps<M>) => import("react/jsx-runtime").JSX.Element;
@@ -5,6 +5,7 @@ import { OnCellValueChange, OnColumnResizeParams, UniqueFieldValidator } from ".
5
5
  * @group Collection components
6
6
  */
7
7
  export type EntityCollectionTableProps<M extends Record<string, any>, UserType extends User = User> = {
8
+ className?: string;
8
9
  /**
9
10
  * Display these entities as selected
10
11
  */
@@ -65,7 +66,7 @@ export type EntityCollectionTableProps<M extends Record<string, any>, UserType e
65
66
  * {@link EntityTableController}
66
67
  */
67
68
  tableController: EntityTableController<M>;
68
- displayedColumnIds: PropertyColumnConfig[];
69
+ displayedColumnIds?: PropertyColumnConfig[];
69
70
  forceFilter?: FilterValues<Extract<keyof M, string>>;
70
71
  textSearchEnabled?: boolean;
71
72
  inlineEditing?: boolean;
@@ -87,6 +88,7 @@ export type EntityCollectionTableProps<M extends Record<string, any>, UserType e
87
88
  getIdColumnWidth?: () => number;
88
89
  onTextSearchClick?: () => void;
89
90
  textSearchLoading?: boolean;
91
+ enablePopupIcon: boolean;
90
92
  };
91
93
  export type GetPropertyForProps<M extends Record<string, any>> = {
92
94
  propertyKey: string;
@@ -95,5 +97,5 @@ export type GetPropertyForProps<M extends Record<string, any>> = {
95
97
  };
96
98
  export type PropertyColumnConfig = {
97
99
  key: string;
98
- disabled: boolean;
100
+ disabled?: boolean;
99
101
  };
@@ -14,5 +14,6 @@ export interface PropertyTableCellProps<T extends CMSType> {
14
14
  entity: Entity<any>;
15
15
  path: string;
16
16
  disabled: boolean;
17
+ enablePopupIcon?: boolean;
17
18
  }
18
19
  export declare const PropertyTableCell: React.FunctionComponent<PropertyTableCellProps<any>>;
@@ -2,17 +2,14 @@ import React from "react";
2
2
  import { CollectionSize } from "../../../types";
3
3
  interface CollectionTableToolbarProps {
4
4
  size: CollectionSize;
5
- filterIsSet: boolean;
6
5
  loading: boolean;
7
- forceFilter?: boolean;
8
6
  actionsStart?: React.ReactNode;
9
7
  actions?: React.ReactNode;
10
8
  title?: React.ReactNode;
11
9
  onTextSearchClick?: () => void;
12
10
  onTextSearch?: (searchString?: string) => void;
13
11
  onSizeChanged: (size: CollectionSize) => void;
14
- clearFilter?: () => void;
15
12
  textSearchLoading?: boolean;
16
13
  }
17
- export declare function CollectionTableToolbar(props: CollectionTableToolbarProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function CollectionTableToolbar({ actions, actionsStart, loading, onSizeChanged, onTextSearch, onTextSearchClick, size, textSearchLoading, title }: CollectionTableToolbarProps): import("react/jsx-runtime").JSX.Element;
18
15
  export {};
@@ -16,7 +16,7 @@ interface PopupFormFieldProps<M extends Record<string, any>> {
16
16
  * Callback when the value of a cell has been edited
17
17
  * @param params
18
18
  */
19
- onCellValueChange?: (params: OnCellValueChangeParams<any, M>) => Promise<void> | void;
19
+ onCellValueChange?: (params: OnCellValueChangeParams<any, any>) => Promise<void> | void;
20
20
  }
21
21
  export declare function PopupFormField<M extends Record<string, any>>(props: PopupFormFieldProps<M>): import("react/jsx-runtime").JSX.Element | null;
22
22
  export declare function PopupFormFieldInternal<M extends Record<string, any>>({ tableKey, entity: entityProp, customFieldValidator, propertyKey, collection: inputCollection, path, cellRect, open, onClose, onCellValueChange, container }: PopupFormFieldProps<M>): import("react/jsx-runtime").JSX.Element;
@@ -4,8 +4,18 @@ import { EntityCollection } from "../../types";
4
4
  * @group Components
5
5
  */
6
6
  export type EntityCollectionViewProps<M extends Record<string, any>> = {
7
- fullPath: string;
7
+ /**
8
+ * Complete path where this collection is located.
9
+ * It defaults to the collection path if not provided.
10
+ */
11
+ fullPath?: string;
12
+ /**
13
+ * If this is a subcollection, specify the parent collection ids.
14
+ */
8
15
  parentCollectionIds?: string[];
16
+ /**
17
+ * Whether this is a subcollection or not.
18
+ */
9
19
  isSubCollection?: boolean;
10
20
  className?: string;
11
21
  } & EntityCollection<M>;
@@ -0,0 +1,11 @@
1
+ import { EntityCollection, EntityTableController, SelectionController } from "../../types";
2
+ export type EntityCollectionViewStartActionsProps<M extends Record<string, any>> = {
3
+ collection: EntityCollection<M>;
4
+ path: string;
5
+ relativePath: string;
6
+ parentCollectionIds: string[];
7
+ selectionController: SelectionController<M>;
8
+ tableController: EntityTableController<M>;
9
+ collectionEntitiesCount: number;
10
+ };
11
+ export declare function EntityCollectionViewStartActions<M extends Record<string, any>>({ collection, relativePath, parentCollectionIds, path, selectionController, tableController, collectionEntitiesCount }: EntityCollectionViewStartActionsProps<M>): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { User } from "../types";
3
3
  export type FireCMSAppBarProps<ADDITIONAL_PROPS = object> = {
4
- title: string;
4
+ title: React.ReactNode;
5
5
  /**
6
6
  * A component that gets rendered on the upper side of the main toolbar
7
7
  */
@@ -12,6 +12,7 @@ export type FireCMSAppBarProps<ADDITIONAL_PROPS = object> = {
12
12
  drawerOpen: boolean;
13
13
  className?: string;
14
14
  style?: React.CSSProperties;
15
+ logo?: string;
15
16
  user?: User;
16
17
  } & ADDITIONAL_PROPS;
17
18
  /**
@@ -23,4 +24,4 @@ export type FireCMSAppBarProps<ADDITIONAL_PROPS = object> = {
23
24
  * @param drawerOpen
24
25
  * @constructor
25
26
  */
26
- export declare const FireCMSAppBar: ({ title, endAdornment, startAdornment, drawerOpen, dropDownActions, includeDrawer, className, style, user: userProp }: FireCMSAppBarProps) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const FireCMSAppBar: ({ title, endAdornment, startAdornment, drawerOpen, dropDownActions, includeDrawer, className, style, logo, user: userProp }: FireCMSAppBarProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { CollectionSize, Entity, EntityTableController, FilterValues } from "../../types";
3
3
  import { CellRendererParams, VirtualTableColumn } from "../VirtualTable";
4
- import { OnCellValueChange, OnColumnResizeParams } from "../common/types";
4
+ import { OnCellValueChange, OnColumnResizeParams } from "../common";
5
5
  export type SelectableTableProps<M extends Record<string, any>> = {
6
6
  /**
7
7
  * Callback when a cell value changes.
@@ -1,4 +1,4 @@
1
- import { CollectionSize, Entity, FireCMSContext, ResolvedProperty, SelectedCellProps } from "../../types";
1
+ import { CollectionSize, ResolvedProperty, SelectedCellProps } from "../../types";
2
2
  export type EntityCollectionTableController<M extends Record<string, any>> = {
3
3
  /**
4
4
  * This cell is displayed as selected
@@ -28,14 +28,12 @@ export type EntityCollectionTableController<M extends Record<string, any>> = {
28
28
  * Props passed in a callback when the content of a cell in a table has been edited
29
29
  * @group Collection components
30
30
  */
31
- export interface OnCellValueChangeParams<T = any, M extends Record<string, any> = any> {
31
+ export interface OnCellValueChangeParams<T = any, D = any> {
32
32
  value: T;
33
33
  propertyKey: string;
34
- entity: Entity<M>;
34
+ data?: D;
35
35
  onValueUpdated: () => void;
36
- setError: (e: Error) => void;
37
- fullPath: string;
38
- context: FireCMSContext;
36
+ setError: (e: Error | undefined) => void;
39
37
  }
40
38
  /**
41
39
  * @group Collection components
@@ -6,7 +6,7 @@ export type NavigationRoutesProps = {
6
6
  /**
7
7
  * In case you need to override the home page
8
8
  */
9
- HomePage?: React.ComponentType;
9
+ homePage?: React.ReactNode;
10
10
  customRoutes?: React.ReactNode[];
11
11
  };
12
12
  /**
@@ -9,7 +9,7 @@ export interface ScaffoldProps<ExtraDrawerProps = object, ExtraAppbarProps = obj
9
9
  /**
10
10
  * Name of the app, displayed as the main title and in the tab title
11
11
  */
12
- name: string;
12
+ name: React.ReactNode;
13
13
  /**
14
14
  * Logo to be displayed in the drawer of the CMS
15
15
  */
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  export declare const ErrorFocus: ({ containerRef }: {
3
- containerRef?: React.RefObject<HTMLDivElement> | undefined;
3
+ containerRef?: React.RefObject<HTMLDivElement>;
4
4
  }) => null;
@@ -1,9 +1,8 @@
1
- import { DataSource, Entity, EntityCallbacks, EntityCollection, FireCMSContext, SaveEntityProps, User } from "../../types";
1
+ import { DataSource, Entity, EntityCollection, FireCMSContext, SaveEntityProps, User } from "../../types";
2
2
  /**
3
3
  * @group Hooks and utilities
4
4
  */
5
5
  export type SaveEntityWithCallbacksProps<M extends Record<string, any>> = SaveEntityProps<M> & {
6
- callbacks?: EntityCallbacks<M>;
7
6
  onSaveSuccess?: (updatedEntity: Entity<M>) => void;
8
7
  onSaveFailure?: (e: Error) => void;
9
8
  onPreSaveHookError?: (e: Error) => void;
@@ -1,5 +1,5 @@
1
1
  import { AuthController, CMSView, CMSViewsBuilder, DataSourceDelegate, EntityCollection, EntityCollectionsBuilder, NavigationController, PermissionsBuilder, User, UserConfigurationPersistence } from "../types";
2
- type BuildNavigationContextProps<EC extends EntityCollection, UserType extends User> = {
2
+ export type BuildNavigationContextProps<EC extends EntityCollection, UserType extends User> = {
3
3
  basePath?: string;
4
4
  baseCollectionPath?: string;
5
5
  authController: AuthController<UserType>;
@@ -21,4 +21,3 @@ type BuildNavigationContextProps<EC extends EntityCollection, UserType extends U
21
21
  };
22
22
  export declare function useBuildNavigationController<EC extends EntityCollection, UserType extends User>(props: BuildNavigationContextProps<EC, UserType>): NavigationController;
23
23
  export declare function getSidePanelKey(path: string, entityId?: string): string;
24
- export {};
@@ -1,20 +1,16 @@
1
- import { AppCheckTokenResult, AuthController, Authenticator, DataSourceDelegate, StorageSource, User } from "../index";
1
+ import { AuthController, Authenticator, DataSourceDelegate, StorageSource, User } from "../index";
2
2
  /**
3
3
  * This hook is used internally for validating an authenticator.
4
4
  *
5
5
  * @param authController
6
6
  * @param authentication
7
- * @param getAppCheckToken
8
- * @param appCheckForceRefresh
9
7
  * @param storageSource
10
8
  * @param dataSourceDelegate
11
9
  */
12
- export declare function useValidateAuthenticator<UserType extends User = User, Controller extends AuthController<UserType> = AuthController<UserType>>({ disabled, authController, authenticator, getAppCheckToken, appCheckForceRefresh, storageSource, dataSourceDelegate }: {
10
+ export declare function useValidateAuthenticator<UserType extends User = User, Controller extends AuthController<UserType> = AuthController<UserType>>({ disabled, authController, authenticator, storageSource, dataSourceDelegate }: {
13
11
  disabled?: boolean;
14
12
  authController: Controller;
15
13
  authenticator?: boolean | Authenticator<UserType, Controller>;
16
- getAppCheckToken?: (forceRefresh: boolean) => Promise<AppCheckTokenResult> | undefined;
17
- appCheckForceRefresh?: boolean;
18
14
  dataSourceDelegate: DataSourceDelegate;
19
15
  storageSource: StorageSource;
20
16
  }): {