@firecms/core 3.0.0-beta.4.pre.2 → 3.0.0-beta.5
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/EntityCollectionTable/EntityCollectionRowActions.d.ts +1 -1
- package/dist/components/EntityPreview.d.ts +2 -2
- package/dist/contexts/AuthControllerContext.d.ts +1 -1
- package/dist/hooks/data/delete.d.ts +2 -2
- package/dist/hooks/data/save.d.ts +1 -1
- package/dist/hooks/data/useDataSource.d.ts +1 -1
- package/dist/hooks/data/useEntityFetch.d.ts +3 -3
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useBuildNavigationController.d.ts +1 -2
- package/dist/hooks/useProjectLog.d.ts +2 -2
- package/dist/hooks/useValidateAuthenticator.d.ts +25 -0
- package/dist/index.es.js +2333 -2257
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/internal/useRestoreScroll.d.ts +1 -1
- package/dist/preview/PropertyPreviewProps.d.ts +1 -4
- package/dist/types/auth.d.ts +30 -1
- package/dist/types/collections.d.ts +3 -3
- package/dist/types/datasource.d.ts +1 -1
- package/dist/types/entity_callbacks.d.ts +2 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/navigation.d.ts +4 -4
- package/dist/types/plugins.d.ts +2 -2
- package/dist/types/roles.d.ts +31 -0
- package/dist/types/storage.d.ts +11 -3
- package/dist/types/user.d.ts +5 -0
- package/dist/util/collections.d.ts +1 -1
- package/dist/util/useTraceUpdate.d.ts +1 -0
- package/package.json +10 -10
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +1 -1
- package/src/components/EntityPreview.tsx +5 -2
- package/src/components/HomePage/DefaultHomePage.tsx +1 -1
- package/src/components/HomePage/NavigationCard.tsx +1 -1
- package/src/components/ReferenceWidget.tsx +1 -1
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +1 -1
- package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +1 -1
- package/src/contexts/AuthControllerContext.tsx +1 -1
- package/src/core/FireCMS.tsx +1 -1
- package/src/form/EntityForm.tsx +1 -1
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +1 -1
- package/src/hooks/data/delete.ts +3 -3
- package/src/hooks/data/save.ts +1 -1
- package/src/hooks/data/useDataSource.tsx +1 -1
- package/src/hooks/data/useEntityFetch.tsx +3 -3
- package/src/hooks/index.tsx +2 -0
- package/src/hooks/useBuildNavigationController.tsx +63 -43
- package/src/hooks/useProjectLog.tsx +7 -5
- package/src/hooks/useValidateAuthenticator.tsx +135 -0
- package/src/internal/useBuildSideEntityController.tsx +3 -0
- package/src/preview/PropertyPreviewProps.tsx +1 -11
- package/src/preview/components/BooleanPreview.tsx +4 -2
- package/src/preview/components/ReferencePreview.tsx +1 -1
- package/src/types/auth.tsx +40 -1
- package/src/types/collections.ts +3 -3
- package/src/types/datasource.ts +1 -1
- package/src/types/entity_callbacks.ts +2 -2
- package/src/types/index.ts +1 -0
- package/src/types/navigation.ts +6 -6
- package/src/types/plugins.tsx +2 -2
- package/src/types/roles.ts +41 -0
- package/src/types/storage.ts +12 -3
- package/src/types/user.ts +7 -0
- package/src/util/collections.ts +1 -1
- package/src/util/strings.ts +2 -2
- package/src/util/useTraceUpdate.tsx +2 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ 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,
|
|
18
|
+
collection?: EntityCollection<any, any> | undefined;
|
|
19
19
|
fullPath?: string | undefined;
|
|
20
20
|
width: number;
|
|
21
21
|
frozen?: boolean | undefined;
|
|
@@ -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 {};
|
|
@@ -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
|
|
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;
|
|
@@ -36,7 +36,7 @@ export type SaveEntityWithCallbacksProps<M extends Record<string, any>> = SaveEn
|
|
|
36
36
|
* @group Hooks and utilities
|
|
37
37
|
*/
|
|
38
38
|
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>;
|
|
39
|
+
collection: EntityCollection<M, UserType>;
|
|
40
40
|
dataSource: DataSource;
|
|
41
41
|
context: FireCMSContext<UserType>;
|
|
42
42
|
}): 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>;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -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,25 @@
|
|
|
1
|
+
import { AppCheckTokenResult, 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 getAppCheckToken
|
|
8
|
+
* @param appCheckForceRefresh
|
|
9
|
+
* @param storageSource
|
|
10
|
+
* @param dataSourceDelegate
|
|
11
|
+
*/
|
|
12
|
+
export declare function useValidateAuthenticator<UserType extends User = User, Controller extends AuthController<UserType> = AuthController<UserType>>({ disabled, authController, authenticator, getAppCheckToken, appCheckForceRefresh, storageSource, dataSourceDelegate }: {
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
authController: Controller;
|
|
15
|
+
authenticator?: boolean | Authenticator<UserType, Controller>;
|
|
16
|
+
getAppCheckToken?: (forceRefresh: boolean) => Promise<AppCheckTokenResult> | undefined;
|
|
17
|
+
appCheckForceRefresh?: boolean;
|
|
18
|
+
dataSourceDelegate: DataSourceDelegate;
|
|
19
|
+
storageSource: StorageSource;
|
|
20
|
+
}): {
|
|
21
|
+
canAccessMainView: boolean;
|
|
22
|
+
authLoading: boolean;
|
|
23
|
+
notAllowedError: any;
|
|
24
|
+
authVerified: boolean;
|
|
25
|
+
};
|