@firecms/core 3.0.0-alpha.81 → 3.0.0-alpha.83

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/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +4 -3
  2. package/dist/components/EntityCollectionTable/column_utils.d.ts +2 -2
  3. package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +5 -1
  4. package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +2 -2
  5. package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +1 -1
  6. package/dist/components/VirtualTable/VirtualTableProps.d.ts +1 -1
  7. package/dist/contexts/AnalyticsContext.d.ts +3 -0
  8. package/dist/contexts/CustomizationControllerContext.d.ts +3 -0
  9. package/dist/core/field_configs.d.ts +1 -1
  10. package/dist/hooks/index.d.ts +1 -0
  11. package/dist/hooks/useAnalyticsController.d.ts +5 -0
  12. package/dist/hooks/useCustomizationController.d.ts +11 -0
  13. package/dist/hooks/useFireCMSContext.d.ts +0 -1
  14. package/dist/index.es.js +4878 -4856
  15. package/dist/index.es.js.map +1 -1
  16. package/dist/index.umd.js +5 -5
  17. package/dist/index.umd.js.map +1 -1
  18. package/dist/internal/useBuildCustomizationController.d.ts +2 -0
  19. package/dist/types/analytics_controller.d.ts +7 -0
  20. package/dist/types/collections.d.ts +3 -0
  21. package/dist/types/customization_controller.d.ts +47 -0
  22. package/dist/types/entity_callbacks.d.ts +17 -3
  23. package/dist/types/firecms_context.d.ts +6 -46
  24. package/dist/types/index.d.ts +2 -0
  25. package/dist/util/icons.d.ts +4 -1
  26. package/dist/util/useTraceUpdate.d.ts +1 -1
  27. package/package.json +3 -3
  28. package/src/components/DeleteEntityDialog.tsx +9 -3
  29. package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +1 -1
  30. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +33 -8
  31. package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +5 -5
  32. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +1 -1
  33. package/src/components/EntityCollectionTable/SimpleEntityCollectionTable.tsx +0 -2
  34. package/src/components/EntityCollectionTable/column_utils.tsx +3 -3
  35. package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +125 -122
  36. package/src/components/EntityCollectionTable/filters/DateTimeFilterField.tsx +2 -2
  37. package/src/components/EntityCollectionTable/internal/default_entity_actions.tsx +3 -3
  38. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +4 -3
  39. package/src/components/EntityCollectionView/EntityCollectionView.tsx +77 -48
  40. package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +5 -3
  41. package/src/components/EntityPreview.tsx +11 -9
  42. package/src/components/HomePage/DefaultHomePage.tsx +9 -8
  43. package/src/components/HomePage/NavigationCollectionCard.tsx +6 -5
  44. package/src/components/ReferenceSelectionInner.tsx +38 -36
  45. package/src/components/VirtualTable/VirtualTable.tsx +23 -20
  46. package/src/components/VirtualTable/VirtualTableCell.tsx +27 -9
  47. package/src/components/VirtualTable/VirtualTableHeader.tsx +1 -1
  48. package/src/components/VirtualTable/VirtualTableProps.tsx +2 -2
  49. package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +2 -2
  50. package/src/contexts/AnalyticsContext.tsx +4 -0
  51. package/src/contexts/CustomizationControllerContext.tsx +4 -0
  52. package/src/core/Drawer.tsx +7 -6
  53. package/src/core/FireCMS.tsx +39 -29
  54. package/src/form/EntityForm.tsx +16 -5
  55. package/src/form/PropertyFieldBinding.tsx +8 -10
  56. package/src/form/components/CustomIdField.tsx +7 -5
  57. package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +1 -2
  58. package/src/form/field_bindings/DateTimeFieldBinding.tsx +2 -2
  59. package/src/form/field_bindings/KeyValueFieldBinding.tsx +4 -6
  60. package/src/hooks/data/save.ts +8 -3
  61. package/src/hooks/index.tsx +1 -0
  62. package/src/hooks/useAnalyticsController.tsx +8 -0
  63. package/src/hooks/useCustomizationController.tsx +14 -0
  64. package/src/hooks/useFireCMSContext.tsx +8 -7
  65. package/src/internal/EntityView.tsx +4 -2
  66. package/src/internal/useBuildCustomizationController.tsx +5 -0
  67. package/src/internal/useBuildSideDialogsController.tsx +0 -1
  68. package/src/preview/PropertyPreview.tsx +7 -4
  69. package/src/preview/components/DatePreview.tsx +4 -5
  70. package/src/preview/components/ReferencePreview.tsx +17 -8
  71. package/src/preview/property_previews/ArrayOfMapsPreview.tsx +3 -3
  72. package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +3 -3
  73. package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +3 -3
  74. package/src/preview/property_previews/ArrayOfStringsPreview.tsx +4 -4
  75. package/src/preview/property_previews/ArrayOneOfPreview.tsx +3 -3
  76. package/src/preview/property_previews/ArrayPropertyPreview.tsx +3 -3
  77. package/src/types/analytics_controller.tsx +10 -0
  78. package/src/types/collections.ts +3 -0
  79. package/src/types/customization_controller.tsx +58 -0
  80. package/src/types/entity_callbacks.ts +22 -3
  81. package/src/types/firecms_context.tsx +6 -51
  82. package/src/types/index.ts +2 -0
  83. package/src/util/icons.tsx +22 -19
  84. package/src/util/useTraceUpdate.tsx +5 -5
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { AdditionalFieldDelegate, CollectionSize, Entity, FilterValues, ResolvedProperties, ResolvedProperty, SelectionController, EntityTableController, User } from "../../types";
2
+ import { AdditionalFieldDelegate, CollectionSize, Entity, EntityTableController, FilterValues, ResolvedProperties, ResolvedProperty, SelectionController, User } from "../../types";
3
3
  import { OnCellValueChange, UniqueFieldValidator } from "./types";
4
4
  /**
5
5
  * @group Collection components
@@ -12,6 +12,7 @@ export type OnColumnResizeParams = {
12
12
  * @group Collection components
13
13
  */
14
14
  export type EntityCollectionTableProps<M extends Record<string, any>, UserType extends User = User> = {
15
+ debugKey?: string;
15
16
  /**
16
17
  * Display these entities as selected
17
18
  */
@@ -83,11 +84,11 @@ export type EntityCollectionTableProps<M extends Record<string, any>, UserType e
83
84
  filterable?: boolean;
84
85
  sortable?: boolean;
85
86
  endAdornment?: React.ReactNode;
86
- AdditionalHeaderWidget?: (props: {
87
+ AdditionalHeaderWidget?: React.ComponentType<{
87
88
  property: ResolvedProperty;
88
89
  propertyKey: string;
89
90
  onHover: boolean;
90
- }) => React.ReactNode;
91
+ }>;
91
92
  AddColumnComponent?: React.ComponentType;
92
93
  additionalIDHeaderWidget?: React.ReactNode;
93
94
  emptyComponent?: React.ReactNode;
@@ -7,10 +7,10 @@ export interface PropertiesToColumnsParams<M extends Record<string, any>> {
7
7
  sortable?: boolean;
8
8
  forceFilter?: FilterValues<keyof M extends string ? keyof M : never>;
9
9
  disabledFilter?: boolean;
10
- AdditionalHeaderWidget?: (props: {
10
+ AdditionalHeaderWidget?: React.ComponentType<{
11
11
  property: ResolvedProperty;
12
12
  propertyKey: string;
13
13
  onHover: boolean;
14
- }) => React.ReactNode;
14
+ }>;
15
15
  }
16
16
  export declare function propertiesToColumns<M extends Record<string, any>>({ properties, sortable, forceFilter, disabledFilter, AdditionalHeaderWidget }: PropertiesToColumnsParams<M>): VirtualTableColumn[];
@@ -1,4 +1,5 @@
1
- import { CollectionSize, EntityReference, FilterValues } from "../../../types";
1
+ import React from "react";
2
+ import { CollectionSize, EntityCollection, EntityReference, FilterValues } from "../../../types";
2
3
  type TableReferenceFieldProps = {
3
4
  name: string;
4
5
  disabled: boolean;
@@ -12,4 +13,7 @@ type TableReferenceFieldProps = {
12
13
  forceFilter?: FilterValues<string>;
13
14
  };
14
15
  export declare function TableReferenceField(props: TableReferenceFieldProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare const TableReferenceFieldSuccess: React.NamedExoticComponent<TableReferenceFieldProps & {
17
+ collection: EntityCollection;
18
+ }>;
15
19
  export {};
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { EntityCollection, SelectionController } from "../../types";
2
+ import { Entity, EntityCollection, SelectionController } from "../../types";
3
3
  /**
4
4
  * @group Components
5
5
  */
@@ -34,4 +34,4 @@ export type EntityCollectionViewProps<M extends Record<string, any>> = {
34
34
  * @group Components
35
35
  */
36
36
  export declare const EntityCollectionView: React.FunctionComponent<EntityCollectionViewProps<any>>;
37
- export declare function useSelectionController<M extends Record<string, any>>(): SelectionController<M>;
37
+ export declare function useSelectionController<M extends Record<string, any> = any>(onSelectionChange?: (entity: Entity<M>, selected: boolean) => void): SelectionController<M>;
@@ -1,4 +1,4 @@
1
- import { EntityCollection, SelectionController, EntityTableController } from "../../types";
1
+ import { EntityCollection, EntityTableController, SelectionController } from "../../types";
2
2
  export type EntityCollectionViewActionsProps<M extends Record<string, any>> = {
3
3
  collection: EntityCollection<M>;
4
4
  path: string;
@@ -153,7 +153,7 @@ export interface VirtualTableColumn<CustomProps extends any = any> {
153
153
  /**
154
154
  * Icon displayed in the header
155
155
  */
156
- icon?: (hoverOrOpen: boolean) => React.ReactNode;
156
+ icon?: React.ReactNode;
157
157
  /**
158
158
  *
159
159
  */
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { AnalyticsController } from "../types";
3
+ export declare const AnalyticsContext: React.Context<AnalyticsController>;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import { CustomizationController } from "../types/customization_controller";
3
+ export declare const CustomizationControllerContext: React.Context<CustomizationController>;
@@ -3,5 +3,5 @@ export declare function isDefaultFieldConfigId(id: string): boolean;
3
3
  export declare const DEFAULT_FIELD_CONFIGS: Record<string, PropertyConfig<any>>;
4
4
  export declare function getDefaultFieldConfig(property: Property | ResolvedProperty): PropertyConfig | undefined;
5
5
  export declare function getFieldConfig(property: Property | ResolvedProperty, propertyConfigs: Record<string, PropertyConfig<any>>): PropertyConfig | undefined;
6
- export declare function getDefaultFieldId(property: Property | ResolvedProperty): "reference" | "date_time" | "repeat" | "block" | "group" | "switch" | "url" | "email" | "select" | "text_field" | "multiline" | "markdown" | "multi_select" | "number_input" | "number_select" | "multi_number_select" | "file_upload" | "multi_file_upload" | "key_value" | "multi_references" | "custom_array" | undefined;
6
+ export declare function getDefaultFieldId(property: Property | ResolvedProperty): "reference" | "date_time" | "text_field" | "multiline" | "markdown" | "url" | "email" | "select" | "multi_select" | "number_input" | "number_select" | "multi_number_select" | "file_upload" | "multi_file_upload" | "group" | "key_value" | "multi_references" | "switch" | "repeat" | "custom_array" | "block" | undefined;
7
7
  export declare function getFieldId(property: Property | ResolvedProperty): string | undefined;
@@ -17,3 +17,4 @@ export * from "./useClipboard";
17
17
  export * from "./useLargeLayout";
18
18
  export * from "./useReferenceDialog";
19
19
  export * from "./useBrowserTitleAndIcon";
20
+ export * from "./useCustomizationController";
@@ -0,0 +1,5 @@
1
+ import { AnalyticsController } from "../types";
2
+ /**
3
+ * @group Hooks and utilities
4
+ */
5
+ export declare const useAnalyticsController: () => AnalyticsController;
@@ -0,0 +1,11 @@
1
+ import { CustomizationController } from "../types/customization_controller";
2
+ /**
3
+ * Use this hook to retrieve the customization controller.
4
+ * This hook includes all the customization options that can be used
5
+ * to customize the CMS.
6
+ *
7
+ * You will likely not need to use this hook directly.
8
+ *
9
+ * @group Hooks and utilities
10
+ */
11
+ export declare const useCustomizationController: () => CustomizationController;
@@ -1,5 +1,4 @@
1
1
  import { AuthController, FireCMSContext, User } from "../types";
2
- export declare const FireCMSContextInstance: import("react").Context<Partial<FireCMSContext>>;
3
2
  /**
4
3
  * Hook to retrieve the {@link FireCMSContext}.
5
4
  *