@firecms/core 3.0.0-alpha.27 → 3.0.0-alpha.29

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 (91) hide show
  1. package/dist/components/Popover.d.ts +3 -1
  2. package/dist/core/FireCMS.d.ts +2 -2
  3. package/dist/core/builders.d.ts +5 -5
  4. package/dist/core/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +4 -2
  5. package/dist/core/components/EntityCollectionTable/filters/ReferenceFilterField.d.ts +3 -3
  6. package/dist/core/components/EntityCollectionTable/internal/EntityCollectionRowActions.d.ts +15 -11
  7. package/dist/core/components/EntityCollectionTable/internal/default_entity_actions.d.ts +5 -0
  8. package/dist/core/components/EntityCollectionTable/types.d.ts +1 -37
  9. package/dist/core/components/FieldConfigBadge.d.ts +3 -3
  10. package/dist/core/components/VirtualTable/VirtualTableHeader.d.ts +2 -2
  11. package/dist/core/components/VirtualTable/VirtualTableProps.d.ts +1 -1
  12. package/dist/core/contexts/DialogsProvider.d.ts +4 -0
  13. package/dist/core/form_field_configs.d.ts +3 -3
  14. package/dist/core/index.d.ts +1 -1
  15. package/dist/core/internal/useBuildNavigationContext.d.ts +3 -3
  16. package/dist/core/util/property_utils.d.ts +5 -5
  17. package/dist/core/util/references.d.ts +2 -2
  18. package/dist/core/util/resolutions.d.ts +6 -6
  19. package/dist/hooks/index.d.ts +1 -0
  20. package/dist/hooks/useBuildDataSource.d.ts +23 -0
  21. package/dist/hooks/useDialogsController.d.ts +11 -0
  22. package/dist/index.es.js +8996 -8583
  23. package/dist/index.es.js.map +1 -1
  24. package/dist/index.umd.js +67 -67
  25. package/dist/index.umd.js.map +1 -1
  26. package/dist/styles.d.ts +1 -1
  27. package/dist/types/collections.d.ts +36 -13
  28. package/dist/types/datasource.d.ts +120 -11
  29. package/dist/types/dialogs_controller.d.ts +30 -0
  30. package/dist/types/entity_actions.d.ts +33 -0
  31. package/dist/types/fields.d.ts +1 -1
  32. package/dist/types/firecms.d.ts +8 -8
  33. package/dist/types/firecms_context.d.ts +10 -3
  34. package/dist/types/index.d.ts +2 -1
  35. package/dist/types/navigation.d.ts +3 -3
  36. package/dist/types/plugins.d.ts +11 -10
  37. package/dist/types/properties.d.ts +1 -1
  38. package/dist/types/{field_config.d.ts → property_config.d.ts} +3 -4
  39. package/package.json +3 -3
  40. package/src/components/Popover.tsx +10 -3
  41. package/src/components/Sheet.tsx +1 -0
  42. package/src/components/TextareaAutosize.tsx +2 -1
  43. package/src/core/FireCMS.tsx +9 -6
  44. package/src/core/builders.ts +11 -11
  45. package/src/core/components/ArrayContainer.tsx +1 -1
  46. package/src/core/components/EntityCollectionTable/EntityCollectionTable.tsx +20 -13
  47. package/src/core/components/EntityCollectionTable/EntityCollectionTableProps.tsx +5 -2
  48. package/src/core/components/EntityCollectionTable/filters/ReferenceFilterField.tsx +11 -6
  49. package/src/core/components/EntityCollectionTable/internal/EntityCollectionRowActions.tsx +96 -79
  50. package/src/core/components/EntityCollectionTable/internal/PropertyTableCell.tsx +2 -2
  51. package/src/core/components/EntityCollectionTable/internal/default_entity_actions.tsx +107 -0
  52. package/src/core/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +6 -2
  53. package/src/core/components/EntityCollectionTable/types.tsx +1 -56
  54. package/src/core/components/EntityCollectionView/EntityCollectionView.tsx +67 -43
  55. package/src/core/components/FieldConfigBadge.tsx +4 -4
  56. package/src/core/components/ReferenceSelectionInner.tsx +2 -2
  57. package/src/core/components/VirtualTable/VirtualTable.tsx +4 -6
  58. package/src/core/components/VirtualTable/VirtualTableHeader.tsx +21 -18
  59. package/src/core/components/VirtualTable/VirtualTableProps.tsx +1 -1
  60. package/src/core/contexts/DialogsProvider.tsx +50 -0
  61. package/src/core/form_field_configs.tsx +5 -5
  62. package/src/core/index.tsx +1 -1
  63. package/src/core/internal/useBuildNavigationContext.tsx +13 -13
  64. package/src/core/internal/useBuildSideEntityController.tsx +9 -1
  65. package/src/core/util/property_utils.tsx +5 -5
  66. package/src/core/util/references.ts +2 -2
  67. package/src/core/util/resolutions.ts +16 -11
  68. package/src/form/EntityForm.tsx +64 -7
  69. package/src/form/PropertyFieldBinding.tsx +4 -4
  70. package/src/form/field_bindings/KeyValueFieldBinding.tsx +1 -1
  71. package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +4 -6
  72. package/src/hooks/index.tsx +1 -0
  73. package/src/hooks/useBuildDataSource.ts +351 -0
  74. package/src/hooks/useDialogsController.tsx +14 -0
  75. package/src/hooks/useFireCMSContext.tsx +5 -11
  76. package/src/preview/property_previews/StringPropertyPreview.tsx +4 -2
  77. package/src/styles.ts +1 -1
  78. package/src/types/collections.ts +36 -17
  79. package/src/types/datasource.ts +174 -10
  80. package/src/types/dialogs_controller.tsx +31 -0
  81. package/src/types/entity_actions.tsx +36 -0
  82. package/src/types/fields.tsx +1 -1
  83. package/src/types/firecms.tsx +8 -8
  84. package/src/types/firecms_context.tsx +11 -3
  85. package/src/types/index.ts +2 -1
  86. package/src/types/navigation.ts +3 -3
  87. package/src/types/plugins.tsx +11 -10
  88. package/src/types/properties.ts +1 -1
  89. package/src/types/{field_config.tsx → property_config.tsx} +3 -4
  90. /package/dist/core/contexts/{SnackbarContext.d.ts → SnackbarProvider.d.ts} +0 -0
  91. /package/src/core/contexts/{SnackbarContext.tsx → SnackbarProvider.tsx} +0 -0
@@ -15,5 +15,7 @@ export interface PopoverProps {
15
15
  hideWhenDetached?: boolean;
16
16
  avoidCollisions?: boolean;
17
17
  enabled?: boolean;
18
+ modal?: boolean;
19
+ className?: string;
18
20
  }
19
- export declare function Popover({ trigger, children, open, onOpenChange, side, sideOffset, align, alignOffset, arrowPadding, sticky, hideWhenDetached, avoidCollisions, enabled }: PopoverProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function Popover({ trigger, children, open, onOpenChange, side, sideOffset, align, alignOffset, arrowPadding, sticky, hideWhenDetached, avoidCollisions, enabled, modal, className }: PopoverProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { FireCMSProps, User } from "../types";
1
+ import { EntityCollection, FireCMSProps, User } from "../types";
2
2
  /**
3
3
  * If you are using independent components of the CMS
4
4
  * you need to wrap them with this main component, so the internal hooks work.
@@ -12,4 +12,4 @@ import { FireCMSProps, User } from "../types";
12
12
  * @constructor
13
13
  * @category Core
14
14
  */
15
- export declare function FireCMS<UserType extends User>(props: FireCMSProps<UserType>): import("react/jsx-runtime").JSX.Element;
15
+ export declare function FireCMS<UserType extends User, EC extends EntityCollection>(props: FireCMSProps<UserType, EC>): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,11 @@
1
- import { AdditionalFieldDelegate, ArrayProperty, BooleanProperty, CMSType, DateProperty, EntityCallbacks, EntityCollection, EnumValueConfig, EnumValues, FieldConfig, GeopointProperty, MapProperty, NumberProperty, PropertiesOrBuilders, PropertyBuilder, PropertyOrBuilder, ReferenceProperty, StringProperty, User } from "../types";
1
+ import { AdditionalFieldDelegate, ArrayProperty, BooleanProperty, CMSType, DateProperty, EntityCallbacks, EntityCollection, EnumValueConfig, EnumValues, PropertyConfig, GeopointProperty, MapProperty, NumberProperty, PropertiesOrBuilders, PropertyBuilder, PropertyOrBuilder, ReferenceProperty, StringProperty, User } from "../types";
2
2
  /**
3
3
  * Identity function we use to defeat the type system of Typescript and build
4
4
  * collection views with all its properties
5
5
  * @param collection
6
6
  * @category Builder
7
7
  */
8
- export declare function buildCollection<M extends Record<string, any> = any, AdditionalKey extends string = string, UserType extends User = User>(collection: EntityCollection<M, AdditionalKey, UserType>): EntityCollection<M, AdditionalKey, UserType>;
8
+ export declare function buildCollection<M extends Record<string, any> = any, UserType extends User = User>(collection: EntityCollection<M, UserType>): EntityCollection<M, UserType>;
9
9
  /**
10
10
  * Identity function we use to defeat the type system of Typescript and preserve
11
11
  * the property keys.
@@ -54,11 +54,11 @@ export declare function buildEntityCallbacks<M extends Record<string, any> = any
54
54
  * @param additionalFieldDelegate
55
55
  * @category Builder
56
56
  */
57
- export declare function buildAdditionalFieldDelegate<M extends Record<string, any>, AdditionalKey extends string = string, UserType extends User = User>(additionalFieldDelegate: AdditionalFieldDelegate<M, AdditionalKey, UserType>): AdditionalFieldDelegate<M, AdditionalKey, UserType>;
57
+ export declare function buildAdditionalFieldDelegate<M extends Record<string, any>, UserType extends User = User>(additionalFieldDelegate: AdditionalFieldDelegate<M, UserType>): AdditionalFieldDelegate<M, UserType>;
58
58
  /**
59
59
  * Identity function we use to defeat the type system of Typescript and build
60
60
  * additional field delegates views with all its properties
61
- * @param fieldConfig
61
+ * @param propertyConfig
62
62
  * @category Builder
63
63
  */
64
- export declare function buildFieldConfig<T extends CMSType = CMSType>(fieldConfig: FieldConfig<T>): FieldConfig<T>;
64
+ export declare function buildFieldConfig<T extends CMSType = CMSType>(propertyConfig: PropertyConfig<T>): PropertyConfig<T>;
@@ -11,7 +11,7 @@ export type OnColumnResizeParams = {
11
11
  /**
12
12
  * @category Collection components
13
13
  */
14
- export type EntityCollectionTableProps<M extends Record<string, any>, AdditionalKey extends string = string, UserType extends User = User> = {
14
+ export type EntityCollectionTableProps<M extends Record<string, any>, UserType extends User = User> = {
15
15
  /**
16
16
  * Display these entities as selected
17
17
  */
@@ -76,7 +76,7 @@ export type EntityCollectionTableProps<M extends Record<string, any>, Additional
76
76
  forceFilter?: FilterValues<Extract<keyof M, string>>;
77
77
  textSearchEnabled?: boolean;
78
78
  inlineEditing?: boolean | ((entity: Entity<M>) => boolean);
79
- additionalFields?: AdditionalFieldDelegate<M, AdditionalKey, UserType>[];
79
+ additionalFields?: AdditionalFieldDelegate<M, UserType>[];
80
80
  defaultSize?: CollectionSize;
81
81
  properties: ResolvedProperties<M>;
82
82
  getPropertyFor?: (props: GetPropertyForProps<M>) => ResolvedProperties<M>[string];
@@ -90,6 +90,8 @@ export type EntityCollectionTableProps<M extends Record<string, any>, Additional
90
90
  }) => React.ReactNode;
91
91
  AddColumnComponent?: React.ComponentType;
92
92
  additionalIDHeaderWidget?: React.ReactNode;
93
+ emptyComponent?: React.ReactNode;
94
+ getIdColumnWidth?: () => number;
93
95
  };
94
96
  export type GetPropertyForProps<M extends Record<string, any>> = {
95
97
  propertyKey: string;
@@ -7,8 +7,8 @@ interface ReferenceFilterFieldProps {
7
7
  path?: string;
8
8
  title?: string;
9
9
  previewProperties?: string[];
10
- popupOpen: boolean;
11
- setPopupOpen: (open: boolean) => void;
10
+ hidden: boolean;
11
+ setHidden: (hidden: boolean) => void;
12
12
  }
13
- export declare function ReferenceFilterField({ name, value, setValue, isArray, path, title, previewProperties, setPopupOpen }: ReferenceFilterFieldProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function ReferenceFilterField({ name, value, setValue, isArray, path, title, previewProperties, setHidden }: ReferenceFilterFieldProps): import("react/jsx-runtime").JSX.Element;
14
14
  export {};
@@ -1,4 +1,5 @@
1
- import { CollectionSize, Entity } from "../../../../types";
1
+ import React from "react";
2
+ import { CollectionSize, Entity, EntityAction, EntityCollection, SelectionController } from "../../../../types";
2
3
  /**
3
4
  *
4
5
  * @param entity
@@ -16,16 +17,19 @@ import { CollectionSize, Entity } from "../../../../types";
16
17
  *
17
18
  * @category Collection components
18
19
  */
19
- export declare function EntityCollectionRowActions<M extends Record<string, any>>({ entity, width, frozen, isSelected, selectionEnabled, size, toggleEntitySelection, onCopyClicked, onEditClicked, onDeleteClicked, hideId }: {
20
- entity: Entity<M>;
20
+ export declare const EntityCollectionRowActions: React.NamedExoticComponent<{
21
+ entity: Entity<any>;
22
+ collection?: EntityCollection<any, import("../../../../types").User> | undefined;
23
+ fullPath?: string | undefined;
21
24
  width: number;
22
- frozen?: boolean;
25
+ frozen?: boolean | undefined;
23
26
  size: CollectionSize;
24
27
  isSelected: boolean;
25
- selectionEnabled?: boolean;
26
- toggleEntitySelection?: (selectedEntity: Entity<M>) => void;
27
- onEditClicked?: (selectedEntity: Entity<M>) => void;
28
- onCopyClicked?: (selectedEntity: Entity<M>) => void;
29
- onDeleteClicked?: (selectedEntity: Entity<M>) => void;
30
- hideId?: boolean;
31
- }): import("react/jsx-runtime").JSX.Element;
28
+ selectionEnabled?: boolean | undefined;
29
+ actions?: EntityAction[] | undefined;
30
+ hideId?: boolean | undefined;
31
+ onCollectionChange?: (() => void) | undefined;
32
+ selectionController?: SelectionController | undefined;
33
+ highlightEntity?: ((entity: Entity<any>) => void) | undefined;
34
+ unhighlightEntity?: ((entity: Entity<any>) => void) | undefined;
35
+ }>;
@@ -0,0 +1,5 @@
1
+ import { EntityAction } from "../../../../types";
2
+ export declare const editEntityAction: EntityAction;
3
+ export declare const copyEntityAction: EntityAction;
4
+ export declare const archiveEntityAction: EntityAction;
5
+ export declare const deleteEntityAction: EntityAction;
@@ -1,40 +1,4 @@
1
- import { CollectionSize, Entity, EntityCollection, FireCMSContext, ResolvedProperty, SelectedCellProps, User } from "../../../types";
2
- export type EntityCollectionTableProviderProps<M extends Record<string, any>, AdditionalKey extends string, UserType extends User> = {
3
- /**
4
- * Absolute collection path
5
- */
6
- path: string;
7
- /**
8
- * Use to resolve the collection properties for specific path, entity id or values
9
- */
10
- collection: EntityCollection<M>;
11
- /**
12
- * List of entities that will be displayed on top, no matter the ordering.
13
- * This is used for reference fields selection
14
- */
15
- entitiesDisplayedFirst?: Entity<M>[];
16
- /**
17
- * Callback when anywhere on the table is clicked
18
- */
19
- onEntityClick?(entity: Entity<M>): void;
20
- /**
21
- * Callback when the selected size of the table is changed
22
- */
23
- onSizeChanged?(size: CollectionSize): void;
24
- /**
25
- * Can the table be edited inline
26
- */
27
- inlineEditing: ((entity: Entity<any>) => boolean) | boolean;
28
- /**
29
- * Builder for creating the buttons in each row
30
- * @param entity
31
- * @param size
32
- */
33
- tableRowActionsBuilder?: ({ entity, size }: {
34
- entity: Entity<M>;
35
- size: CollectionSize;
36
- }) => React.ReactNode;
37
- };
1
+ import { CollectionSize, Entity, FireCMSContext, ResolvedProperty, SelectedCellProps } from "../../../types";
38
2
  export type EntityCollectionTableController<M extends Record<string, any>> = {
39
3
  selectedCell?: SelectedCellProps<any>;
40
4
  select: (cell?: SelectedCellProps<M>) => void;
@@ -1,4 +1,4 @@
1
- import { FieldConfig } from "../../types";
2
- export declare function FieldConfigBadge({ fieldConfig }: {
3
- fieldConfig: FieldConfig | undefined;
1
+ import { PropertyConfig } from "../../types";
2
+ export declare function FieldConfigBadge({ propertyConfig }: {
3
+ propertyConfig: PropertyConfig | undefined;
4
4
  }): React.ReactNode;
@@ -5,8 +5,8 @@ export type FilterFormFieldProps<CustomProps> = {
5
5
  filterValue: [VirtualTableWhereFilterOp, any] | undefined;
6
6
  setFilterValue: (filterValue?: [VirtualTableWhereFilterOp, any]) => void;
7
7
  column: VirtualTableColumn<CustomProps>;
8
- popupOpen: boolean;
9
- setPopupOpen: (open: boolean) => void;
8
+ hidden: boolean;
9
+ setHidden: (hidden: boolean) => void;
10
10
  };
11
11
  type VirtualTableHeaderProps<M extends Record<string, any>> = {
12
12
  resizeHandleRef: RefObject<HTMLDivElement>;
@@ -83,7 +83,7 @@ export interface VirtualTableProps<T extends Record<string, any>> {
83
83
  /**
84
84
  * Message displayed when there is no data
85
85
  */
86
- emptyMessage?: string;
86
+ emptyComponent?: React.ReactNode;
87
87
  /**
88
88
  * Is the table in a loading state
89
89
  */
@@ -0,0 +1,4 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ import { DialogsController } from "../../types/dialogs_controller";
3
+ export declare const DialogsControllerContext: React.Context<DialogsController>;
4
+ export declare const DialogsProvider: React.FC<PropsWithChildren<{}>>;
@@ -1,6 +1,6 @@
1
- import { FieldConfig, Property, ResolvedProperty } from "../types";
1
+ import { PropertyConfig, Property, ResolvedProperty } from "../types";
2
2
  export declare function isDefaultFieldConfigId(id: string): boolean;
3
- export declare const DEFAULT_FIELD_CONFIGS: Record<string, FieldConfig<any>>;
4
- export declare function getFieldConfig(property: Property | ResolvedProperty, customFields: Record<string, FieldConfig<any>>): FieldConfig | undefined;
3
+ export declare const DEFAULT_FIELD_CONFIGS: Record<string, PropertyConfig<any>>;
4
+ export declare function getFieldConfig(property: Property | ResolvedProperty, customFields: Record<string, PropertyConfig<any>>): PropertyConfig | undefined;
5
5
  export declare function getDefaultFieldId(property: Property | ResolvedProperty): "reference" | "date_time" | "email" | "url" | "group" | "switch" | "block" | "file_upload" | "repeat" | "select" | "text_field" | "multiline" | "markdown" | "multi_select" | "number_input" | "number_select" | "multi_number_select" | "multi_file_upload" | "multi_references" | "key_value" | "custom_array" | undefined;
6
6
  export declare function getFieldId(property: Property | ResolvedProperty): string | undefined;
@@ -12,6 +12,6 @@ export * from "./form_field_configs";
12
12
  export * from "./useBuildModeController";
13
13
  export * from "../components/util/useOutsideAlerter";
14
14
  export * from "./useBuildLocalConfigurationPersistence";
15
- export { SnackbarProvider } from "./contexts/SnackbarContext";
15
+ export { SnackbarProvider } from "./contexts/SnackbarProvider";
16
16
  export { ModeControllerProvider } from "./contexts/ModeController";
17
17
  export * from "./contexts/AuthControllerContext";
@@ -1,14 +1,14 @@
1
1
  import { AuthController, CMSView, CMSViewsBuilder, DataSource, EntityCollection, EntityCollectionsBuilder, FireCMSPlugin, NavigationContext, User, UserConfigurationPersistence } from "../../types";
2
- type BuildNavigationContextProps<UserType extends User> = {
2
+ type BuildNavigationContextProps<EC extends EntityCollection, UserType extends User> = {
3
3
  basePath: string;
4
4
  baseCollectionPath: string;
5
5
  authController: AuthController<UserType>;
6
- collections?: EntityCollection[] | EntityCollectionsBuilder;
6
+ collections?: EC[] | EntityCollectionsBuilder<EC>;
7
7
  views?: CMSView[] | CMSViewsBuilder;
8
8
  userConfigPersistence?: UserConfigurationPersistence;
9
9
  plugins?: FireCMSPlugin[];
10
10
  dataSource: DataSource;
11
11
  };
12
- export declare function useBuildNavigationContext<UserType extends User>({ basePath, baseCollectionPath, authController, collections: baseCollections, views: baseViews, userConfigPersistence, plugins, dataSource }: BuildNavigationContextProps<UserType>): NavigationContext;
12
+ export declare function useBuildNavigationContext<EC extends EntityCollection, UserType extends User>({ basePath, baseCollectionPath, authController, collections: baseCollections, views: baseViews, userConfigPersistence, plugins, dataSource }: BuildNavigationContextProps<EC, UserType>): NavigationContext;
13
13
  export declare function getSidePanelKey(path: string, entityId?: string): string;
14
14
  export {};
@@ -1,10 +1,10 @@
1
1
  import React from "react";
2
- import { EntityCollection, FieldConfig, PropertiesOrBuilders, PropertyOrBuilder, ResolvedProperty } from "../../types";
3
- export declare function isReferenceProperty(propertyOrBuilder: PropertyOrBuilder, fields: Record<string, FieldConfig>): boolean | null;
2
+ import { EntityCollection, PropertyConfig, PropertiesOrBuilders, PropertyOrBuilder, ResolvedProperty } from "../../types";
3
+ export declare function isReferenceProperty(propertyOrBuilder: PropertyOrBuilder, fields: Record<string, PropertyConfig>): boolean | null;
4
4
  export declare function getIdIcon(size: "small" | "medium" | "large"): React.ReactNode;
5
- export declare function getIconForWidget(widget: FieldConfig | undefined, size: "small" | "medium" | "large"): import("react/jsx-runtime").JSX.Element;
6
- export declare function getIconForProperty(property: PropertyOrBuilder | ResolvedProperty, size?: "small" | "medium" | "large", fields?: Record<string, FieldConfig>): React.ReactNode;
7
- export declare function getColorForProperty(property: PropertyOrBuilder, fields: Record<string, FieldConfig>): string;
5
+ export declare function getIconForWidget(widget: PropertyConfig | undefined, size: "small" | "medium" | "large"): import("react/jsx-runtime").JSX.Element;
6
+ export declare function getIconForProperty(property: PropertyOrBuilder | ResolvedProperty, size?: "small" | "medium" | "large", fields?: Record<string, PropertyConfig>): React.ReactNode;
7
+ export declare function getColorForProperty(property: PropertyOrBuilder, fields: Record<string, PropertyConfig>): string;
8
8
  /**
9
9
  * Get a property in a property tree from a path like
10
10
  * `address.street`
@@ -1,2 +1,2 @@
1
- import { EntityCollection, FieldConfig } from "../../types";
2
- export declare function getReferencePreviewKeys(targetCollection: EntityCollection<any>, fields: Record<string, FieldConfig>, previewProperties?: string[], limit?: number): string[];
1
+ import { EntityCollection, PropertyConfig } from "../../types";
2
+ export declare function getReferencePreviewKeys(targetCollection: EntityCollection<any>, fields: Record<string, PropertyConfig>, previewProperties?: string[], limit?: number): string[];
@@ -1,12 +1,12 @@
1
- import { ArrayProperty, CMSType, EntityCollection, EntityCustomView, EntityValues, EnumValueConfig, EnumValues, FieldConfig, NumberProperty, PropertiesOrBuilders, PropertyOrBuilder, ResolvedArrayProperty, ResolvedEntityCollection, ResolvedNumberProperty, ResolvedProperties, ResolvedProperty, ResolvedStringProperty, StringProperty, UserConfigurationPersistence } from "../../types";
1
+ import { ArrayProperty, CMSType, EntityCollection, EntityCustomView, EntityValues, EnumValueConfig, EnumValues, PropertyConfig, NumberProperty, PropertiesOrBuilders, PropertyOrBuilder, ResolvedArrayProperty, ResolvedEntityCollection, ResolvedNumberProperty, ResolvedProperties, ResolvedProperty, ResolvedStringProperty, StringProperty, UserConfigurationPersistence } from "../../types";
2
2
  export declare const resolveCollection: <M extends Record<string, any>>({ collection, path, entityId, values, previousValues, userConfigPersistence, fields }: {
3
- collection: EntityCollection<M, string, import("../../types").User> | ResolvedEntityCollection<M>;
3
+ collection: EntityCollection<M, import("../../types").User> | ResolvedEntityCollection<M>;
4
4
  path: string;
5
5
  entityId?: string | undefined;
6
6
  values?: Partial<M> | undefined;
7
7
  previousValues?: Partial<M> | undefined;
8
8
  userConfigPersistence?: UserConfigurationPersistence | undefined;
9
- fields?: Record<string, FieldConfig> | undefined;
9
+ fields?: Record<string, PropertyConfig> | undefined;
10
10
  }) => ResolvedEntityCollection<M>;
11
11
  /**
12
12
  * Resolve property builders, enums and arrays.
@@ -24,7 +24,7 @@ export declare function resolveProperty<T extends CMSType = CMSType, M extends R
24
24
  entityId?: string;
25
25
  index?: number;
26
26
  fromBuilder?: boolean;
27
- fields?: Record<string, FieldConfig<any>>;
27
+ fields?: Record<string, PropertyConfig<any>>;
28
28
  }): ResolvedProperty<T> | null;
29
29
  export declare function resolveArrayProperty<T extends any[], M>({ propertyKey, property, propertyValue, ...props }: {
30
30
  propertyKey?: string;
@@ -36,7 +36,7 @@ export declare function resolveArrayProperty<T extends any[], M>({ propertyKey,
36
36
  entityId?: string;
37
37
  index?: number;
38
38
  fromBuilder?: boolean;
39
- fields?: Record<string, FieldConfig>;
39
+ fields?: Record<string, PropertyConfig>;
40
40
  }): ResolvedArrayProperty;
41
41
  /**
42
42
  * Resolve enums and arrays for properties
@@ -52,7 +52,7 @@ export declare function resolveProperties<M extends Record<string, any>>({ prope
52
52
  entityId?: string;
53
53
  index?: number;
54
54
  fromBuilder?: boolean;
55
- fields?: Record<string, FieldConfig>;
55
+ fields?: Record<string, PropertyConfig>;
56
56
  }): ResolvedProperties<M>;
57
57
  /**
58
58
  * Resolve enum aliases for a string or number property
@@ -18,3 +18,4 @@ export * from "./useBreadcrumbsContext";
18
18
  export * from "./useLargeLayout";
19
19
  export * from "./useReferenceDialog";
20
20
  export * from "./useBrowserTitleAndIcon";
21
+ export * from "./useBuildDataSource";
@@ -0,0 +1,23 @@
1
+ import { DataSource, DataSourceDelegate, EntityReference, GeoPoint, PropertyConfig } from "../types";
2
+ /**
3
+ * Use this hook to build a {@link DataSource} based on Firestore
4
+ * @param firebaseApp
5
+ * @param textSearchController
6
+ * @param collectionRegistry
7
+ * @category Firebase
8
+ */
9
+ export declare function useBuildDataSource({ delegate, customFields }: {
10
+ delegate: DataSourceDelegate;
11
+ customFields: Record<string, PropertyConfig>;
12
+ }): DataSource;
13
+ /**
14
+ * Recursive function that converts Firestore data types into CMS or plain
15
+ * JS types.
16
+ * FireCMS uses Javascript dates internally instead of Firestore timestamps.
17
+ * This makes it easier to interact with the rest of the libraries and
18
+ * bindings.
19
+ * Also, Firestore references are replaced with {@link EntityReference}
20
+ * @param data
21
+ * @category Firestore
22
+ */
23
+ export declare function cmsToDelegateModel(data: any, buildReference: (reference: EntityReference) => any, buildGeoPoint: (geoPoint: GeoPoint) => any, buildDate: (date: Date) => any, buildDelete: () => any): any;
@@ -0,0 +1,11 @@
1
+ import { DialogsController } from "../types/dialogs_controller";
2
+ /**
3
+ * Use this hook to open a dialog imperatively.
4
+ * Alternatively, you can use dialogs declaratively using the `Dialog` component.
5
+ *
6
+ * Consider that in order to use this hook you need to have a parent
7
+ * `FireCMS`
8
+ *
9
+ * @category Hooks and utilities
10
+ */
11
+ export declare const useDialogsController: () => DialogsController;