@firecms/core 3.0.0-3.0.0-canary.8.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 (120) 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/EntityPreview.d.ts +2 -2
  12. package/dist/components/FireCMSAppBar.d.ts +3 -2
  13. package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
  14. package/dist/components/common/types.d.ts +4 -6
  15. package/dist/contexts/AuthControllerContext.d.ts +1 -1
  16. package/dist/core/NavigationRoutes.d.ts +1 -1
  17. package/dist/core/Scaffold.d.ts +1 -1
  18. package/dist/form/components/ErrorFocus.d.ts +1 -1
  19. package/dist/hooks/data/delete.d.ts +2 -2
  20. package/dist/hooks/data/save.d.ts +2 -3
  21. package/dist/hooks/data/useDataSource.d.ts +1 -1
  22. package/dist/hooks/data/useEntityFetch.d.ts +3 -3
  23. package/dist/hooks/index.d.ts +1 -0
  24. package/dist/hooks/useBuildNavigationController.d.ts +1 -2
  25. package/dist/hooks/useProjectLog.d.ts +2 -2
  26. package/dist/hooks/useValidateAuthenticator.d.ts +21 -0
  27. package/dist/index.es.js +4971 -4744
  28. package/dist/index.es.js.map +1 -1
  29. package/dist/index.umd.js +5 -5
  30. package/dist/index.umd.js.map +1 -1
  31. package/dist/internal/useBuildDataSource.d.ts +1 -16
  32. package/dist/internal/useRestoreScroll.d.ts +1 -1
  33. package/dist/preview/PropertyPreviewProps.d.ts +1 -4
  34. package/dist/types/auth.d.ts +30 -1
  35. package/dist/types/collections.d.ts +8 -4
  36. package/dist/types/datasource.d.ts +3 -6
  37. package/dist/types/entities.d.ts +5 -1
  38. package/dist/types/entity_callbacks.d.ts +2 -2
  39. package/dist/types/index.d.ts +1 -1
  40. package/dist/types/navigation.d.ts +4 -4
  41. package/dist/types/plugins.d.ts +5 -3
  42. package/dist/types/properties.d.ts +2 -2
  43. package/dist/types/roles.d.ts +31 -0
  44. package/dist/types/storage.d.ts +11 -3
  45. package/dist/types/user.d.ts +5 -0
  46. package/dist/util/collections.d.ts +1 -1
  47. package/dist/util/entities.d.ts +1 -1
  48. package/dist/util/navigation_utils.d.ts +2 -2
  49. package/dist/util/resolutions.d.ts +5 -5
  50. package/dist/util/useTraceUpdate.d.ts +1 -0
  51. package/package.json +23 -20
  52. package/src/components/ClearFilterSortButton.tsx +41 -0
  53. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +16 -13
  54. package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +6 -4
  55. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +33 -32
  56. package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +1 -1
  57. package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +27 -32
  58. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +11 -6
  59. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +2 -4
  60. package/src/components/EntityCollectionView/EntityCollectionView.tsx +34 -10
  61. package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +68 -0
  62. package/src/components/EntityPreview.tsx +5 -2
  63. package/src/components/EntityView.tsx +1 -1
  64. package/src/components/FireCMSAppBar.tsx +23 -8
  65. package/src/components/HomePage/DefaultHomePage.tsx +2 -2
  66. package/src/components/HomePage/NavigationCard.tsx +1 -1
  67. package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +1 -0
  68. package/src/components/ReferenceWidget.tsx +1 -1
  69. package/src/components/SelectableTable/SelectableTable.tsx +1 -1
  70. package/src/components/SelectableTable/filters/BooleanFilterField.tsx +2 -3
  71. package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +23 -8
  72. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +24 -5
  73. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +35 -15
  74. package/src/components/VirtualTable/VirtualTable.tsx +28 -20
  75. package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +1 -1
  76. package/src/components/common/types.tsx +4 -6
  77. package/src/contexts/AuthControllerContext.tsx +1 -1
  78. package/src/core/FireCMS.tsx +2 -3
  79. package/src/core/NavigationRoutes.tsx +3 -4
  80. package/src/core/Scaffold.tsx +5 -4
  81. package/src/core/field_configs.tsx +1 -2
  82. package/src/form/EntityForm.tsx +1 -1
  83. package/src/form/field_bindings/DateTimeFieldBinding.tsx +1 -1
  84. package/src/hooks/data/delete.ts +3 -3
  85. package/src/hooks/data/save.ts +2 -2
  86. package/src/hooks/data/useDataSource.tsx +1 -1
  87. package/src/hooks/data/useEntityFetch.tsx +3 -3
  88. package/src/hooks/index.tsx +2 -0
  89. package/src/hooks/useBuildLocalConfigurationPersistence.tsx +9 -10
  90. package/src/hooks/useBuildModeController.tsx +11 -5
  91. package/src/hooks/useBuildNavigationController.tsx +136 -59
  92. package/src/hooks/useProjectLog.tsx +8 -6
  93. package/src/hooks/useValidateAuthenticator.tsx +115 -0
  94. package/src/internal/useBuildDataSource.ts +42 -47
  95. package/src/internal/useBuildSideEntityController.tsx +18 -12
  96. package/src/preview/PropertyPreview.tsx +2 -12
  97. package/src/preview/PropertyPreviewProps.tsx +1 -11
  98. package/src/preview/components/BooleanPreview.tsx +4 -2
  99. package/src/preview/components/ReferencePreview.tsx +1 -1
  100. package/src/types/auth.tsx +40 -1
  101. package/src/types/collections.ts +8 -4
  102. package/src/types/datasource.ts +8 -5
  103. package/src/types/entities.ts +9 -1
  104. package/src/types/entity_callbacks.ts +2 -2
  105. package/src/types/index.ts +1 -1
  106. package/src/types/navigation.ts +6 -6
  107. package/src/types/plugins.tsx +6 -5
  108. package/src/types/properties.ts +5 -4
  109. package/src/types/roles.ts +41 -0
  110. package/src/types/storage.ts +12 -3
  111. package/src/types/user.ts +7 -0
  112. package/src/util/collections.ts +1 -1
  113. package/src/util/entities.ts +1 -1
  114. package/src/util/navigation_utils.ts +6 -6
  115. package/src/util/strings.ts +2 -2
  116. package/src/util/useTraceUpdate.tsx +2 -1
  117. package/dist/internal/useLocaleConfig.d.ts +0 -1
  118. package/dist/types/appcheck.d.ts +0 -26
  119. package/src/internal/useLocaleConfig.tsx +0 -18
  120. 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, import("src/types/user").User> | 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;
@@ -17,13 +17,13 @@ export type EntityPreviewProps = {
17
17
  * It is used by default in reference fields and whenever a reference is displayed.
18
18
  */
19
19
  export declare function EntityPreview({ actions, disabled, hover, collection: collectionProp, previewProperties, onClick, size, includeEntityNavigation, entity }: EntityPreviewProps): import("react/jsx-runtime").JSX.Element;
20
- type EntityPreviewContainerProps = {
20
+ export type EntityPreviewContainerProps = {
21
21
  children: React.ReactNode;
22
22
  hover?: boolean;
23
+ fullwidth?: boolean;
23
24
  size: PreviewSize;
24
25
  className?: string;
25
26
  style?: React.CSSProperties;
26
27
  onClick?: (e: React.SyntheticEvent) => void;
27
28
  };
28
29
  export declare const EntityPreviewContainer: React.FC<EntityPreviewContainerProps>;
29
- export {};
@@ -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
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
2
  import { AuthController } from "../types";
3
- export declare const AuthControllerContext: React.Context<AuthController>;
3
+ export declare const AuthControllerContext: React.Context<AuthController<any, any>>;
@@ -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;
@@ -2,8 +2,8 @@ import { DataSource, DeleteEntityProps, Entity, EntityCallbacks, FireCMSContext,
2
2
  /**
3
3
  * @group Hooks and utilities
4
4
  */
5
- export type DeleteEntityWithCallbacksProps<M extends Record<string, any>> = DeleteEntityProps<M> & {
6
- callbacks?: EntityCallbacks<M>;
5
+ export type DeleteEntityWithCallbacksProps<M extends Record<string, any>, UserType extends User = User> = DeleteEntityProps<M> & {
6
+ callbacks?: EntityCallbacks<M, UserType>;
7
7
  onDeleteSuccess?: (entity: Entity<M>) => void;
8
8
  onDeleteFailure?: (entity: Entity<M>, e: Error) => void;
9
9
  onPreDeleteHookError?: (entity: Entity<M>, e: Error) => void;
@@ -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;
@@ -36,7 +35,7 @@ export type SaveEntityWithCallbacksProps<M extends Record<string, any>> = SaveEn
36
35
  * @group Hooks and utilities
37
36
  */
38
37
  export declare function saveEntityWithCallbacks<M extends Record<string, any>, UserType extends User>({ collection, path, entityId, values, previousValues, status, dataSource, context, onSaveSuccess, onSaveFailure, onPreSaveHookError, onSaveSuccessHookError }: SaveEntityWithCallbacksProps<M> & {
39
- collection: EntityCollection<M>;
38
+ collection: EntityCollection<M, UserType>;
40
39
  dataSource: DataSource;
41
40
  context: FireCMSContext<UserType>;
42
41
  }): Promise<void>;
@@ -3,4 +3,4 @@ import { DataSource, EntityCollection } from "../../types";
3
3
  * Use this hook to get the datasource being used
4
4
  * @group Hooks and utilities
5
5
  */
6
- export declare const useDataSource: (collection?: EntityCollection) => DataSource;
6
+ export declare const useDataSource: (collection?: EntityCollection<any, any>) => DataSource;
@@ -2,10 +2,10 @@ import { Entity, EntityCollection, User } from "../../types";
2
2
  /**
3
3
  * @group Hooks and utilities
4
4
  */
5
- export interface EntityFetchProps<M extends Record<string, any>> {
5
+ export interface EntityFetchProps<M extends Record<string, any>, UserType extends User = User> {
6
6
  path: string;
7
7
  entityId?: string;
8
- collection: EntityCollection<M>;
8
+ collection: EntityCollection<M, UserType>;
9
9
  useCache?: boolean;
10
10
  }
11
11
  /**
@@ -25,4 +25,4 @@ export interface EntityFetchResult<M extends Record<string, any>> {
25
25
  * @param useCache
26
26
  * @group Hooks and utilities
27
27
  */
28
- export declare function useEntityFetch<M extends Record<string, any>, UserType extends User>({ path: inputPath, entityId, collection, useCache }: EntityFetchProps<M>): EntityFetchResult<M>;
28
+ export declare function useEntityFetch<M extends Record<string, any>, UserType extends User>({ path: inputPath, entityId, collection, useCache }: EntityFetchProps<M, UserType>): EntityFetchResult<M>;
@@ -20,3 +20,4 @@ export * from "./useCustomizationController";
20
20
  export * from "./useBuildNavigationController";
21
21
  export * from "./useBuildLocalConfigurationPersistence";
22
22
  export * from "./useBuildModeController";
23
+ export * from "./useValidateAuthenticator";
@@ -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,8 +1,8 @@
1
- import { AuthController } from "../types";
1
+ import { AuthController, FireCMSPlugin } from "../types";
2
2
  export declare const DEFAULT_SERVER_DEV = "https://api-kdoe6pj3qq-ey.a.run.app";
3
3
  export declare const DEFAULT_SERVER = "https://api-drplyi3b6q-ey.a.run.app";
4
4
  export type AccessResponse = {
5
5
  blocked?: boolean;
6
6
  message?: string;
7
7
  };
8
- export declare function useProjectLog(authController: AuthController): AccessResponse | null;
8
+ export declare function useProjectLog(authController: AuthController, plugins?: FireCMSPlugin<any, any, any>[]): AccessResponse | null;
@@ -0,0 +1,21 @@
1
+ import { AuthController, Authenticator, DataSourceDelegate, StorageSource, User } from "../index";
2
+ /**
3
+ * This hook is used internally for validating an authenticator.
4
+ *
5
+ * @param authController
6
+ * @param authentication
7
+ * @param storageSource
8
+ * @param dataSourceDelegate
9
+ */
10
+ export declare function useValidateAuthenticator<UserType extends User = User, Controller extends AuthController<UserType> = AuthController<UserType>>({ disabled, authController, authenticator, storageSource, dataSourceDelegate }: {
11
+ disabled?: boolean;
12
+ authController: Controller;
13
+ authenticator?: boolean | Authenticator<UserType, Controller>;
14
+ dataSourceDelegate: DataSourceDelegate;
15
+ storageSource: StorageSource;
16
+ }): {
17
+ canAccessMainView: boolean;
18
+ authLoading: boolean;
19
+ notAllowedError: any;
20
+ authVerified: boolean;
21
+ };