@firecms/core 3.0.0-beta.11 → 3.0.0-beta.13

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 (201) hide show
  1. package/dist/app/Scaffold.d.ts +4 -0
  2. package/dist/components/ArrayContainer.d.ts +14 -3
  3. package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +2 -1
  4. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -2
  5. package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +15 -1
  6. package/dist/components/EntityCollectionTable/index.d.ts +1 -1
  7. package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +8 -0
  8. package/dist/components/EntityJsonPreview.d.ts +3 -0
  9. package/dist/components/PropertyIdCopyTooltip.d.ts +1 -1
  10. package/dist/components/SelectableTable/SelectableTable.d.ts +12 -2
  11. package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +1 -1
  12. package/dist/components/UnsavedChangesDialog.d.ts +8 -0
  13. package/dist/components/VirtualTable/VirtualTableProps.d.ts +13 -0
  14. package/dist/components/common/default_entity_actions.d.ts +0 -2
  15. package/dist/components/common/index.d.ts +1 -1
  16. package/dist/components/common/useColumnsIds.d.ts +1 -0
  17. package/dist/components/common/{useDataSourceEntityCollectionTableController.d.ts → useDataSourceTableController.d.ts} +10 -2
  18. package/dist/components/common/useDebouncedCallback.d.ts +1 -0
  19. package/dist/components/common/useScrollRestoration.d.ts +14 -0
  20. package/dist/contexts/BreacrumbsContext.d.ts +8 -0
  21. package/dist/core/DefaultAppBar.d.ts +8 -2
  22. package/dist/core/EntityEditView.d.ts +36 -21
  23. package/dist/core/EntityEditViewFormActions.d.ts +2 -0
  24. package/dist/core/FireCMS.d.ts +2 -2
  25. package/dist/core/FireCMSRouter.d.ts +4 -0
  26. package/dist/core/NavigationRoutes.d.ts +0 -1
  27. package/dist/core/SideDialogs.d.ts +4 -2
  28. package/dist/core/index.d.ts +2 -1
  29. package/dist/form/EntityForm.d.ts +49 -0
  30. package/dist/form/EntityFormActions.d.ts +17 -0
  31. package/dist/form/PropertyFieldBinding.d.ts +1 -1
  32. package/dist/form/components/FormEntry.d.ts +6 -0
  33. package/dist/form/components/FormLayout.d.ts +5 -0
  34. package/dist/form/components/index.d.ts +2 -0
  35. package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +1 -1
  36. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +1 -1
  37. package/dist/form/field_bindings/BlockFieldBinding.d.ts +1 -1
  38. package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
  39. package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +1 -1
  40. package/dist/form/field_bindings/RepeatFieldBinding.d.ts +1 -1
  41. package/dist/form/index.d.ts +16 -16
  42. package/dist/hooks/data/save.d.ts +1 -1
  43. package/dist/hooks/data/useEntityFetch.d.ts +2 -1
  44. package/dist/hooks/useBreadcrumbsController.d.ts +26 -0
  45. package/dist/hooks/useBuildNavigationController.d.ts +4 -1
  46. package/dist/hooks/useModeController.d.ts +1 -2
  47. package/dist/index.es.js +15842 -14396
  48. package/dist/index.es.js.map +1 -1
  49. package/dist/index.umd.js +15833 -14389
  50. package/dist/index.umd.js.map +1 -1
  51. package/dist/internal/useBuildDataSource.d.ts +3 -2
  52. package/dist/internal/useBuildSideEntityController.d.ts +3 -3
  53. package/dist/internal/useUnsavedChangesDialog.d.ts +7 -9
  54. package/dist/routes/CustomCMSRoute.d.ts +4 -0
  55. package/dist/routes/FireCMSRoute.d.ts +1 -0
  56. package/dist/routes/HomePageRoute.d.ts +3 -0
  57. package/dist/types/collections.d.ts +36 -10
  58. package/dist/types/datasource.d.ts +2 -2
  59. package/dist/types/dialogs_controller.d.ts +7 -3
  60. package/dist/types/entities.d.ts +1 -1
  61. package/dist/types/entity_actions.d.ts +10 -0
  62. package/dist/types/fields.d.ts +13 -3
  63. package/dist/types/firecms.d.ts +1 -1
  64. package/dist/types/navigation.d.ts +33 -12
  65. package/dist/types/plugins.d.ts +2 -0
  66. package/dist/types/properties.d.ts +40 -4
  67. package/dist/types/side_entity_controller.d.ts +6 -1
  68. package/dist/util/builders.d.ts +1 -1
  69. package/dist/util/createFormexStub.d.ts +2 -0
  70. package/dist/util/entity_actions.d.ts +2 -0
  71. package/dist/util/entity_cache.d.ts +23 -0
  72. package/dist/util/index.d.ts +1 -0
  73. package/dist/util/navigation_from_path.d.ts +6 -1
  74. package/dist/util/navigation_utils.d.ts +13 -1
  75. package/dist/util/objects.d.ts +1 -1
  76. package/dist/util/property_utils.d.ts +2 -2
  77. package/dist/util/references.d.ts +2 -2
  78. package/dist/util/resolutions.d.ts +12 -2
  79. package/package.json +20 -21
  80. package/src/app/Scaffold.tsx +13 -3
  81. package/src/components/ArrayContainer.tsx +60 -24
  82. package/src/components/CircularProgressCenter.tsx +1 -1
  83. package/src/components/DeleteEntityDialog.tsx +5 -3
  84. package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +46 -23
  85. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +10 -4
  86. package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +18 -1
  87. package/src/components/EntityCollectionTable/index.tsx +1 -1
  88. package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +3 -3
  89. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +10 -13
  90. package/src/components/EntityCollectionView/EntityCollectionView.tsx +105 -47
  91. package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +4 -2
  92. package/src/components/EntityJsonPreview.tsx +66 -0
  93. package/src/components/EntityPreview.tsx +10 -3
  94. package/src/components/EntityView.tsx +4 -1
  95. package/src/components/NotFoundPage.tsx +2 -2
  96. package/src/components/PropertyIdCopyTooltip.tsx +2 -3
  97. package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +14 -7
  98. package/src/components/SelectableTable/SelectableTable.tsx +18 -3
  99. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +7 -7
  100. package/src/components/UnsavedChangesDialog.tsx +42 -0
  101. package/src/components/VirtualTable/VirtualTable.tsx +48 -3
  102. package/src/components/VirtualTable/VirtualTableProps.tsx +15 -0
  103. package/src/components/VirtualTable/fields/VirtualTableInput.tsx +1 -1
  104. package/src/components/common/default_entity_actions.tsx +37 -37
  105. package/src/components/common/index.ts +1 -1
  106. package/src/components/common/useColumnsIds.tsx +1 -1
  107. package/src/components/common/useDataSourceTableController.tsx +420 -0
  108. package/src/components/common/useDebouncedCallback.tsx +20 -0
  109. package/src/components/common/useScrollRestoration.tsx +68 -0
  110. package/src/contexts/BreacrumbsContext.tsx +38 -0
  111. package/src/contexts/DialogsProvider.tsx +3 -2
  112. package/src/contexts/ModeController.tsx +1 -3
  113. package/src/core/DefaultAppBar.tsx +59 -17
  114. package/src/core/DefaultDrawer.tsx +1 -1
  115. package/src/core/EntityEditView.tsx +354 -1000
  116. package/src/core/EntityEditViewFormActions.tsx +199 -0
  117. package/src/core/EntitySidePanel.tsx +85 -15
  118. package/src/core/FireCMS.tsx +20 -16
  119. package/src/core/FireCMSRouter.tsx +17 -0
  120. package/src/core/NavigationRoutes.tsx +23 -32
  121. package/src/core/SideDialogs.tsx +20 -11
  122. package/src/core/index.tsx +4 -2
  123. package/src/form/EntityForm.tsx +782 -0
  124. package/src/form/EntityFormActions.tsx +169 -0
  125. package/src/form/PropertyFieldBinding.tsx +21 -16
  126. package/src/form/components/FormEntry.tsx +22 -0
  127. package/src/form/components/FormLayout.tsx +16 -0
  128. package/src/form/components/LabelWithIcon.tsx +6 -3
  129. package/src/form/components/StorageUploadProgress.tsx +1 -1
  130. package/src/form/components/index.tsx +2 -0
  131. package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +8 -5
  132. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +5 -2
  133. package/src/form/field_bindings/BlockFieldBinding.tsx +5 -3
  134. package/src/form/field_bindings/DateTimeFieldBinding.tsx +1 -0
  135. package/src/form/field_bindings/KeyValueFieldBinding.tsx +1 -1
  136. package/src/form/field_bindings/MapFieldBinding.tsx +14 -16
  137. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +15 -8
  138. package/src/form/field_bindings/MultiSelectFieldBinding.tsx +3 -3
  139. package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +2 -2
  140. package/src/form/field_bindings/ReferenceFieldBinding.tsx +1 -1
  141. package/src/form/field_bindings/RepeatFieldBinding.tsx +13 -4
  142. package/src/form/field_bindings/SelectFieldBinding.tsx +2 -2
  143. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +11 -6
  144. package/src/form/field_bindings/SwitchFieldBinding.tsx +1 -0
  145. package/src/form/field_bindings/TextFieldBinding.tsx +1 -0
  146. package/src/form/index.tsx +16 -32
  147. package/src/form/validation.ts +12 -6
  148. package/src/hooks/data/save.ts +25 -30
  149. package/src/hooks/data/useCollectionFetch.tsx +1 -1
  150. package/src/hooks/data/useEntityFetch.tsx +5 -1
  151. package/src/hooks/useBreadcrumbsController.tsx +31 -0
  152. package/src/hooks/useBuildModeController.tsx +15 -28
  153. package/src/hooks/useBuildNavigationController.tsx +81 -24
  154. package/src/hooks/useFireCMSContext.tsx +0 -30
  155. package/src/hooks/useLargeLayout.tsx +0 -35
  156. package/src/hooks/useModeController.tsx +1 -2
  157. package/src/hooks/useResolvedNavigationFrom.tsx +4 -6
  158. package/src/internal/useBuildDataSource.ts +9 -5
  159. package/src/internal/useBuildSideDialogsController.tsx +3 -2
  160. package/src/internal/useBuildSideEntityController.tsx +135 -88
  161. package/src/internal/useUnsavedChangesDialog.tsx +126 -92
  162. package/src/preview/PropertyPreview.tsx +12 -10
  163. package/src/preview/components/UrlComponentPreview.tsx +17 -18
  164. package/src/preview/property_previews/ArrayOfMapsPreview.tsx +4 -3
  165. package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +4 -3
  166. package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +4 -2
  167. package/src/preview/property_previews/ArrayOfStringsPreview.tsx +4 -3
  168. package/src/preview/property_previews/ArrayOneOfPreview.tsx +4 -2
  169. package/src/preview/property_previews/ArrayPropertyPreview.tsx +4 -2
  170. package/src/preview/property_previews/MapPropertyPreview.tsx +3 -2
  171. package/src/routes/CustomCMSRoute.tsx +21 -0
  172. package/src/routes/FireCMSRoute.tsx +246 -0
  173. package/src/routes/HomePageRoute.tsx +17 -0
  174. package/src/types/collections.ts +45 -13
  175. package/src/types/datasource.ts +2 -1
  176. package/src/types/dialogs_controller.tsx +7 -3
  177. package/src/types/entities.ts +1 -1
  178. package/src/types/entity_actions.tsx +12 -0
  179. package/src/types/fields.tsx +18 -3
  180. package/src/types/firecms.tsx +1 -1
  181. package/src/types/navigation.ts +41 -16
  182. package/src/types/plugins.tsx +2 -0
  183. package/src/types/properties.ts +48 -4
  184. package/src/types/side_dialogs_controller.tsx +2 -0
  185. package/src/types/side_entity_controller.tsx +11 -1
  186. package/src/util/builders.ts +5 -3
  187. package/src/util/createFormexStub.tsx +62 -0
  188. package/src/util/entity_actions.ts +28 -0
  189. package/src/util/entity_cache.ts +204 -0
  190. package/src/util/index.ts +1 -0
  191. package/src/util/join_collections.ts +6 -1
  192. package/src/util/navigation_from_path.ts +18 -7
  193. package/src/util/navigation_utils.ts +115 -14
  194. package/src/util/objects.ts +9 -2
  195. package/src/util/parent_references_from_path.ts +3 -3
  196. package/src/util/property_utils.tsx +7 -3
  197. package/src/util/references.ts +8 -6
  198. package/src/util/resolutions.ts +41 -12
  199. package/src/util/useStorageUploadController.tsx +60 -23
  200. package/src/components/common/useDataSourceEntityCollectionTableController.tsx +0 -236
  201. /package/src/util/{common.tsx → common.ts} +0 -0
@@ -13,6 +13,10 @@ export interface ScaffoldProps {
13
13
  * Note that this has no effect if you are using a custom AppBar or Drawer.
14
14
  */
15
15
  logo?: string;
16
+ /**
17
+ * If true, the main content will be padded in large layouts. Defaults to true.
18
+ */
19
+ padding?: boolean;
16
20
  className?: string;
17
21
  style?: React.CSSProperties;
18
22
  }
@@ -16,15 +16,22 @@ export interface ArrayContainerProps<T> {
16
16
  disabled?: boolean;
17
17
  size?: "small" | "medium";
18
18
  onInternalIdAdded?: (id: number) => void;
19
+ /**
20
+ * @deprecated Use `canAddElements` instead
21
+ */
19
22
  includeAddButton?: boolean;
23
+ canAddElements?: boolean;
24
+ sortable?: boolean;
20
25
  newDefaultEntry: T;
21
26
  onValueChange: (value: T[]) => void;
22
27
  className?: string;
28
+ min?: number;
29
+ max?: number;
23
30
  }
24
31
  /**
25
32
  * @group Form custom fields
26
33
  */
27
- export declare function ArrayContainer<T>({ droppableId, addLabel, value, disabled, buildEntry, size, onInternalIdAdded, includeAddButton, newDefaultEntry, onValueChange, className }: ArrayContainerProps<T>): import("react/jsx-runtime").JSX.Element;
34
+ export declare function ArrayContainer<T>({ droppableId, addLabel, value, disabled, buildEntry, size, onInternalIdAdded, includeAddButton: deprecatedIncludeAddButton, canAddElements: canAddElementsProp, sortable, newDefaultEntry, onValueChange, className, min, max }: ArrayContainerProps<T>): import("react/jsx-runtime").JSX.Element;
28
35
  type ArrayContainerItemProps = {
29
36
  provided: DraggableProvided;
30
37
  index: number;
@@ -35,18 +42,22 @@ type ArrayContainerItemProps = {
35
42
  remove: (index: number) => void;
36
43
  copy: (index: number) => void;
37
44
  addInIndex?: (index: number) => void;
45
+ canAddElements?: boolean;
46
+ sortable: boolean;
38
47
  isDragging: boolean;
39
48
  storedProps?: object;
40
49
  updateItemCustomProps: (internalId: number, props: object) => void;
41
50
  };
42
- export declare function ArrayContainerItem({ provided, index, internalId, size, disabled, buildEntry, remove, addInIndex, copy, isDragging, storedProps, updateItemCustomProps }: ArrayContainerItemProps): import("react/jsx-runtime").JSX.Element;
43
- export declare function ArrayItemOptions({ direction, disabled, remove, index, provided, copy, addInIndex }: {
51
+ export declare function ArrayContainerItem({ provided, index, internalId, size, disabled, buildEntry, remove, addInIndex, canAddElements, sortable, copy, isDragging, storedProps, updateItemCustomProps }: ArrayContainerItemProps): import("react/jsx-runtime").JSX.Element;
52
+ export declare function ArrayItemOptions({ direction, disabled, remove, index, provided, copy, canAddElements, sortable, addInIndex }: {
44
53
  direction?: "row" | "column";
45
54
  disabled: boolean;
46
55
  remove: (index: number) => void;
47
56
  index: number;
48
57
  provided: any;
49
58
  copy: (index: number) => void;
59
+ sortable: boolean;
60
+ canAddElements?: boolean;
50
61
  addInIndex?: (index: number) => void;
51
62
  }): import("react/jsx-runtime").JSX.Element;
52
63
  export declare function getRandomId(): number;
@@ -12,7 +12,7 @@ import { CollectionSize, Entity, EntityAction, EntityCollection, SelectionContro
12
12
  *
13
13
  * @group Collection components
14
14
  */
15
- export declare const EntityCollectionRowActions: ({ entity, collection, fullPath, width, frozen, isSelected, selectionEnabled, size, highlightEntity, onCollectionChange, unhighlightEntity, actions, hideId, selectionController, }: {
15
+ export declare const EntityCollectionRowActions: ({ entity, collection, fullPath, width, frozen, isSelected, selectionEnabled, size, highlightEntity, onCollectionChange, unhighlightEntity, actions, hideId, selectionController, openEntityMode }: {
16
16
  entity: Entity<any>;
17
17
  collection?: EntityCollection<any>;
18
18
  fullPath?: string;
@@ -27,4 +27,5 @@ export declare const EntityCollectionRowActions: ({ entity, collection, fullPath
27
27
  selectionController?: SelectionController;
28
28
  highlightEntity?: (entity: Entity<any>) => void;
29
29
  unhighlightEntity?: (entity: Entity<any>) => void;
30
+ openEntityMode: "side_panel" | "full_screen";
30
31
  }) => import("react/jsx-runtime").JSX.Element;
@@ -17,11 +17,11 @@ import { EntityCollectionTableProps } from "./EntityCollectionTableProps";
17
17
  *
18
18
  * The data displayed in the table is managed by a {@link EntityTableController}.
19
19
  * You can build the default, bound to a path in the datasource, by using the hook
20
- * {@link useDataSourceEntityCollectionTableController}
20
+ * {@link useDataSourceTableController}
21
21
  *
22
22
  * @see EntityCollectionTableProps
23
23
  * @see EntityCollectionView
24
24
  * @see VirtualTable
25
25
  * @group Components
26
26
  */
27
- export declare const EntityCollectionTable: <M extends Record<string, any>, USER extends User>({ className, style, 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;
27
+ export declare const EntityCollectionTable: <M extends Record<string, any> = any, USER extends User = any>({ className, style, forceFilter, actionsStart, actions, title, tableRowActionsBuilder, uniqueFieldValidator, getPropertyFor, onValueChange, selectionController, highlightedEntities, onEntityClick, onColumnResize, initialScroll, onScroll, onSizeChanged, textSearchEnabled, hoverRow, inlineEditing, additionalFields, displayedColumnIds, defaultSize, properties, tableController, filterable, sortable, endAdornment, AddColumnComponent, AdditionalHeaderWidget, additionalIDHeaderWidget, emptyComponent, getIdColumnWidth, onTextSearchClick, textSearchLoading, enablePopupIcon, openEntityMode }: EntityCollectionTableProps<M>) => import("react/jsx-runtime").JSX.Element;
@@ -48,6 +48,19 @@ export type EntityCollectionTableProps<M extends Record<string, any>, USER exten
48
48
  * Callback when a column is resized
49
49
  */
50
50
  onColumnResize?(params: OnColumnResizeParams): void;
51
+ /**
52
+ * Initial scroll position
53
+ */
54
+ initialScroll?: number;
55
+ /**
56
+ * Callback when the table is scrolled
57
+ * @param props
58
+ */
59
+ onScroll?: (props: {
60
+ scrollDirection: "forward" | "backward";
61
+ scrollOffset: number;
62
+ scrollUpdateWasRequested: boolean;
63
+ }) => void;
51
64
  /**
52
65
  * Callback when the selected size of the table is changed
53
66
  */
@@ -63,7 +76,7 @@ export type EntityCollectionTableProps<M extends Record<string, any>, USER exten
63
76
  actions?: React.ReactNode;
64
77
  /**
65
78
  * Controller holding the logic for the table
66
- * {@link useDataSourceEntityCollectionTableController}
79
+ * {@link useDataSourceTableController}
67
80
  * {@link EntityTableController}
68
81
  */
69
82
  tableController: EntityTableController<M>;
@@ -90,6 +103,7 @@ export type EntityCollectionTableProps<M extends Record<string, any>, USER exten
90
103
  onTextSearchClick?: () => void;
91
104
  textSearchLoading?: boolean;
92
105
  enablePopupIcon: boolean;
106
+ openEntityMode?: "side_panel" | "full_screen";
93
107
  };
94
108
  export type GetPropertyForProps<M extends Record<string, any>> = {
95
109
  propertyKey: string;
@@ -2,5 +2,5 @@ export { EntityCollectionTable } from "./EntityCollectionTable";
2
2
  export type { EntityCollectionTableProps, } from "./EntityCollectionTableProps";
3
3
  export * from "./PropertyTableCell";
4
4
  export * from "./EntityCollectionRowActions";
5
- export * from "../common/useDataSourceEntityCollectionTableController";
5
+ export * from "../common/useDataSourceTableController";
6
6
  export * from "./column_utils";
@@ -9,6 +9,10 @@ export type EntityCollectionViewProps<M extends Record<string, any>> = {
9
9
  * It defaults to the collection path if not provided.
10
10
  */
11
11
  fullPath?: string;
12
+ /**
13
+ * Full path using navigation ids.
14
+ */
15
+ fullIdPath?: string;
12
16
  /**
13
17
  * If this is a subcollection, specify the parent collection ids.
14
18
  */
@@ -18,6 +22,10 @@ export type EntityCollectionViewProps<M extends Record<string, any>> = {
18
22
  */
19
23
  isSubCollection?: boolean;
20
24
  className?: string;
25
+ /**
26
+ * If true, this view will store its filter and sorting status in the url params
27
+ */
28
+ updateUrl?: boolean;
21
29
  } & EntityCollection<M>;
22
30
  /**
23
31
  * This component is in charge of binding a datasource path with an {@link EntityCollection}
@@ -0,0 +1,3 @@
1
+ export declare function EntityJsonPreview({ values }: {
2
+ values: object;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- export declare function PropertyIdCopyTooltip({ propertyKey, className, children }: {
1
+ export declare function PropertyIdCopyTooltip({ propertyKey, className, children, }: {
2
2
  propertyKey: string;
3
3
  className?: string;
4
4
  children: React.ReactNode;
@@ -34,7 +34,7 @@ export type SelectableTableProps<M extends Record<string, any>> = {
34
34
  hoverRow?: boolean;
35
35
  /**
36
36
  * Controller holding the logic for the table
37
- * {@link useDataSourceEntityCollectionTableController}
37
+ * {@link useDataSourceTableController}
38
38
  * {@link EntityTableController}
39
39
  */
40
40
  tableController: EntityTableController<M>;
@@ -44,6 +44,16 @@ export type SelectableTableProps<M extends Record<string, any>> = {
44
44
  forceFilter?: FilterValues<keyof M extends string ? keyof M : never>;
45
45
  highlightedRow?: (data: Entity<M>) => boolean;
46
46
  size?: CollectionSize;
47
+ initialScroll?: number;
48
+ /**
49
+ * Callback when the table is scrolled
50
+ * @param props
51
+ */
52
+ onScroll?: (props: {
53
+ scrollDirection: "forward" | "backward";
54
+ scrollOffset: number;
55
+ scrollUpdateWasRequested: boolean;
56
+ }) => void;
47
57
  emptyComponent?: React.ReactNode;
48
58
  endAdornment?: React.ReactNode;
49
59
  AddColumnComponent?: React.ComponentType;
@@ -65,7 +75,7 @@ export type SelectableTableProps<M extends Record<string, any>> = {
65
75
  *
66
76
  * The data displayed in the table is managed by a {@link EntityTableController}.
67
77
  * You can build the default, bound to a path in the datasource, by using the hook
68
- * {@link useDataSourceEntityCollectionTableController}
78
+ * {@link useDataSourceTableController}
69
79
  *
70
80
  * @see EntityCollectionTableProps
71
81
  * @see EntityCollectionView
@@ -11,5 +11,5 @@ interface ReferenceFilterFieldProps {
11
11
  hidden: boolean;
12
12
  setHidden: (hidden: boolean) => void;
13
13
  }
14
- export declare function ReferenceFilterField({ name, value, setValue, isArray, path, title, includeId, previewProperties, setHidden }: ReferenceFilterFieldProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function ReferenceFilterField({ value, setValue, isArray, path, includeId, previewProperties, setHidden }: ReferenceFilterFieldProps): import("react/jsx-runtime").JSX.Element;
15
15
  export {};
@@ -0,0 +1,8 @@
1
+ export interface UnsavedChangesDialogProps {
2
+ open: boolean;
3
+ body?: React.ReactNode;
4
+ title?: string;
5
+ handleOk: () => void;
6
+ handleCancel: () => void;
7
+ }
8
+ export declare function UnsavedChangesDialog({ open, handleOk, handleCancel, body, title }: UnsavedChangesDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -66,6 +66,15 @@ export interface VirtualTableProps<T extends Record<string, any>> {
66
66
  * @param filter
67
67
  */
68
68
  onFilterUpdate?: (filter?: VirtualTableFilterValues<any> | undefined) => void;
69
+ /**
70
+ * Callback when the table is scrolled
71
+ * @param props
72
+ */
73
+ onScroll?: (props: {
74
+ scrollDirection: "forward" | "backward";
75
+ scrollOffset: number;
76
+ scrollUpdateWasRequested: boolean;
77
+ }) => void;
69
78
  /**
70
79
  * Default sort applied to this collection
71
80
  */
@@ -119,6 +128,10 @@ export interface VirtualTableProps<T extends Record<string, any>> {
119
128
  * @param column
120
129
  */
121
130
  AddColumnComponent?: React.ComponentType;
131
+ /**
132
+ * Initial scroll position
133
+ */
134
+ initialScroll?: number;
122
135
  /**
123
136
  * Debug mode
124
137
  */
@@ -1,6 +1,4 @@
1
1
  import { EntityAction } from "../../types";
2
2
  export declare const editEntityAction: EntityAction;
3
3
  export declare const copyEntityAction: EntityAction;
4
- export declare const archiveEntityAction: EntityAction;
5
- export declare const openWebsiteAction: EntityAction;
6
4
  export declare const deleteEntityAction: EntityAction;
@@ -1,6 +1,6 @@
1
1
  export * from "./types";
2
2
  export * from "./useDebouncedData";
3
3
  export * from "./useColumnsIds";
4
- export * from "./useDataSourceEntityCollectionTableController";
4
+ export * from "./useDataSourceTableController";
5
5
  export * from "./useTableSearchHelper";
6
6
  export * from "./default_entity_actions";
@@ -1,5 +1,6 @@
1
1
  import { EntityCollection, ResolvedEntityCollection, ResolvedProperty } from "../../types";
2
2
  import { PropertyColumnConfig } from "../EntityCollectionTable/EntityCollectionTableProps";
3
+ export declare const COLLECTION_GROUP_PARENT_ID = "collectionGroupParent";
3
4
  export declare function useColumnIds<M extends Record<string, any>>(collection: ResolvedEntityCollection<M>, includeSubcollections: boolean): PropertyColumnConfig[];
4
5
  export declare function getColumnKeysForProperty(property: ResolvedProperty, key: string, disabled?: boolean): PropertyColumnConfig[];
5
6
  export declare function getFormFieldKeys(collection: EntityCollection): string[];
@@ -1,5 +1,6 @@
1
1
  import { Entity, EntityCollection, EntityTableController, FilterValues, User } from "../../types";
2
- export type DataSourceEntityCollectionTableControllerProps<M extends Record<string, any> = any> = {
2
+ import { ScrollRestorationController } from "./useScrollRestoration";
3
+ export type DataSourceTableControllerProps<M extends Record<string, any> = any> = {
3
4
  /**
4
5
  * Full path where the data of this table is located
5
6
  */
@@ -18,6 +19,11 @@ export type DataSourceEntityCollectionTableControllerProps<M extends Record<stri
18
19
  * Force filter to be applied to the table.
19
20
  */
20
21
  forceFilter?: FilterValues<string>;
22
+ scrollRestoration?: ScrollRestorationController;
23
+ /**
24
+ * When set to true the filters and sort will be updated in the URL
25
+ */
26
+ updateUrl?: boolean;
21
27
  };
22
28
  /**
23
29
  * Use this hook to build a controller for the {@link EntityCollectionTable}.
@@ -28,8 +34,10 @@ export type DataSourceEntityCollectionTableControllerProps<M extends Record<stri
28
34
  *
29
35
  * @param fullPath
30
36
  * @param collection
37
+ * @param scrollRestoration
31
38
  * @param entitiesDisplayedFirst
32
39
  * @param lastDeleteTimestamp
33
40
  * @param forceFilterFromProps
41
+ * @param updateUrl
34
42
  */
35
- export declare function useDataSourceEntityCollectionTableController<M extends Record<string, any> = any, USER extends User = User>({ fullPath, collection, entitiesDisplayedFirst, lastDeleteTimestamp, forceFilter: forceFilterFromProps, }: DataSourceEntityCollectionTableControllerProps<M>): EntityTableController<M>;
43
+ export declare function useDataSourceTableController<M extends Record<string, any> = any, USER extends User = User>({ fullPath, collection, scrollRestoration, entitiesDisplayedFirst, lastDeleteTimestamp, forceFilter: forceFilterFromProps, updateUrl }: DataSourceTableControllerProps<M>): EntityTableController<M>;
@@ -0,0 +1 @@
1
+ export declare function useDebounceCallback<T extends (...args: any[]) => any>(callback?: T, delay?: number): T;
@@ -0,0 +1,14 @@
1
+ import { Entity, FilterValues } from "../../types";
2
+ export type ScrollRestorationController = {
3
+ getCollectionScroll: (fullPath: string, filters?: FilterValues<any>) => {
4
+ scrollOffset: number;
5
+ data: Entity<any>[];
6
+ } | undefined;
7
+ updateCollectionScroll: (props: {
8
+ fullPath: string;
9
+ scrollOffset: number;
10
+ filters?: FilterValues<any>;
11
+ data: Entity<any>[];
12
+ }) => void;
13
+ };
14
+ export declare function useScrollRestoration(): ScrollRestorationController;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { BreadcrumbsController } from "../hooks/useBreadcrumbsController";
3
+ export declare const BreadcrumbContext: React.Context<BreadcrumbsController>;
4
+ interface BreadcrumbsProviderProps {
5
+ children: React.ReactNode;
6
+ }
7
+ export declare const BreadcrumbsProvider: React.FC<BreadcrumbsProviderProps>;
8
+ export {};
@@ -1,11 +1,17 @@
1
1
  import React from "react";
2
2
  import { User } from "../types";
3
3
  export type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {
4
+ /**
5
+ * The content of the app bar, usually a title or logo. This includes a link to the home page.
6
+ */
4
7
  title?: React.ReactNode;
5
8
  /**
6
- * A component that gets rendered on the upper side of the main toolbar
9
+ * A component that gets rendered on the upper side to the end of the main toolbar
7
10
  */
8
11
  endAdornment?: React.ReactNode;
12
+ /**
13
+ * A component that gets rendered on the upper side to the start of the main toolbar
14
+ */
9
15
  startAdornment?: React.ReactNode;
10
16
  dropDownActions?: React.ReactNode;
11
17
  includeModeToggle?: boolean;
@@ -20,4 +26,4 @@ export type DefaultAppBarProps<ADDITIONAL_PROPS = object> = {
20
26
  *
21
27
 
22
28
  */
23
- export declare const DefaultAppBar: ({ title, endAdornment, startAdornment, dropDownActions, includeModeToggle, className, style, user: userProp }: DefaultAppBarProps) => import("react/jsx-runtime").JSX.Element;
29
+ export declare const DefaultAppBar: ({ title, endAdornment, startAdornment, dropDownActions, includeModeToggle, className, style, user: userProp, logo: logoProp, }: DefaultAppBarProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,36 +1,51 @@
1
- import { Entity, EntityCollection, EntityValues, ResolvedEntityCollection, User } from "../types";
2
- import { ValidationError } from "yup";
1
+ import React from "react";
2
+ import { Entity, EntityCollection, EntityStatus, User } from "../types";
3
+ import { EntityFormProps } from "../form";
4
+ export declare const MAIN_TAB_VALUE = "__main_##Q$SC^#S6";
5
+ export declare const JSON_TAB_VALUE = "__json";
6
+ export type OnUpdateParams = {
7
+ entity: Entity<any>;
8
+ status: EntityStatus;
9
+ path: string;
10
+ entityId?: string;
11
+ selectedTab?: string;
12
+ collection: EntityCollection<any>;
13
+ };
14
+ export type OnTabChangeParams<M extends Record<string, any>> = {
15
+ path: string;
16
+ entityId?: string;
17
+ selectedTab?: string;
18
+ collection: EntityCollection<M>;
19
+ };
3
20
  export interface EntityEditViewProps<M extends Record<string, any>> {
4
21
  path: string;
22
+ /**
23
+ * The navigation path to the entity.
24
+ */
25
+ fullIdPath?: string;
5
26
  collection: EntityCollection<M>;
6
27
  entityId?: string;
28
+ databaseId?: string;
7
29
  copy?: boolean;
8
- selectedSubPath?: string;
30
+ selectedTab?: string;
9
31
  parentCollectionIds: string[];
10
- onValuesAreModified: (modified: boolean) => void;
11
- onUpdate?: (params: {
12
- entity: Entity<any>;
13
- }) => void;
14
- onClose?: () => void;
32
+ onValuesModified?: (modified: boolean) => void;
33
+ onSaved?: (params: OnUpdateParams) => void;
34
+ onTabChange?: (props: OnTabChangeParams<M>) => void;
35
+ layout?: "side_panel" | "full_screen";
36
+ barActions?: React.ReactNode;
37
+ formProps?: Partial<EntityFormProps<M>>;
15
38
  }
16
39
  /**
17
40
  * This is the default view that is used as the content of a side panel when
18
41
  * an entity is opened.
19
- * You probably don't want to use this view directly since it is bound to the
20
- * side panel.
21
42
  */
22
43
  export declare function EntityEditView<M extends Record<string, any>, USER extends User>({ entityId, ...props }: EntityEditViewProps<M>): import("react/jsx-runtime").JSX.Element;
23
- export declare function EntityEditViewInner<M extends Record<string, any>>({ path, entityId: entityIdProp, selectedSubPath: selectedSubPathProp, copy, collection, parentCollectionIds, onValuesAreModified, onUpdate, onClose, entity, dataLoading }: EntityEditViewProps<M> & {
44
+ export declare function EntityEditViewInner<M extends Record<string, any>>({ path, fullIdPath, entityId, selectedTab: selectedTabProp, collection, parentCollectionIds, onValuesModified, onSaved, onTabChange, entity, cachedDirtyValues, dataLoading, layout, barActions, status, setStatus, formProps, canEdit }: EntityEditViewProps<M> & {
24
45
  entity?: Entity<M>;
46
+ cachedDirtyValues?: Partial<M>;
25
47
  dataLoading: boolean;
48
+ status: EntityStatus;
49
+ setStatus: (status: EntityStatus) => void;
50
+ canEdit?: boolean;
26
51
  }): import("react/jsx-runtime").JSX.Element;
27
- export type EntityFormSaveParams<M extends Record<string, any>> = {
28
- collection: ResolvedEntityCollection<M>;
29
- path: string;
30
- entityId: string | undefined;
31
- values: EntityValues<M>;
32
- previousValues?: EntityValues<M>;
33
- closeAfterSave: boolean;
34
- autoSave: boolean;
35
- };
36
- export declare function yupToFormErrors(yupError: ValidationError): Record<string, any>;
@@ -0,0 +1,2 @@
1
+ import { EntityFormActionsProps } from "../form/EntityFormActions";
2
+ export declare function EntityEditViewFormActions({ collection, path, entity, layout, savingError, formex, disabled, status, pluginActions, openEntityMode, showDefaultActions }: EntityFormActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { EntityCollection, FireCMSProps, User } from "../types";
1
+ import { 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.
@@ -11,4 +11,4 @@ import { EntityCollection, FireCMSProps, User } from "../types";
11
11
 
12
12
  * @group Core
13
13
  */
14
- export declare function FireCMS<USER extends User, EC extends EntityCollection>(props: FireCMSProps<USER, EC>): import("react/jsx-runtime").JSX.Element;
14
+ export declare function FireCMS<USER extends User>(props: FireCMSProps<USER>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare function FireCMSRouter({ children, basePath }: {
2
+ children: React.ReactNode;
3
+ basePath?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -15,7 +15,6 @@ export type NavigationRoutesProps = {
15
15
  * or the home route) related to a {@link NavigationController}.
16
16
  * This component needs a parent {@link FireCMS}
17
17
  *
18
-
19
18
  * @group Components
20
19
  */
21
20
  export declare const NavigationRoutes: React.NamedExoticComponent<NavigationRoutesProps>;
@@ -1,17 +1,19 @@
1
1
  import React from "react";
2
- export type SideDialogContextProps = {
2
+ export type SideDialogController = {
3
3
  blocked: boolean;
4
4
  setBlocked: (blocked: boolean) => void;
5
5
  setBlockedNavigationMessage: (message?: React.ReactNode) => void;
6
6
  width?: string;
7
7
  close: (force?: boolean) => void;
8
+ pendingClose: boolean;
9
+ setPendingClose: (pendingClose: boolean) => void;
8
10
  };
9
11
  /**
10
12
  * This hook is used to access the properties of a particular side dialog,
11
13
  * in contrast with {@link useSideDialogsController} which handles the
12
14
  * state of all the dialogs.
13
15
  */
14
- export declare const useSideDialogContext: () => SideDialogContextProps;
16
+ export declare const useSideDialogContext: () => SideDialogController;
15
17
  /**
16
18
  * This is the component in charge of rendering the side dialogs used
17
19
  * for editing entities. Use the {@link useSideEntityController} to open
@@ -1,7 +1,8 @@
1
1
  export * from "./FireCMS";
2
- export * from "../app/Scaffold";
3
2
  export * from "./DefaultDrawer";
4
3
  export * from "./DrawerNavigationItem";
5
4
  export * from "./field_configs";
6
5
  export * from "./SideDialogs";
7
6
  export * from "./NavigationRoutes";
7
+ export * from "./FireCMSRouter";
8
+ export * from "../app";
@@ -0,0 +1,49 @@
1
+ import React from "react";
2
+ import { Entity, EntityCollection, EntityCustomViewParams, EntityStatus, FormContext } from "../types";
3
+ import { FormexController } from "@firecms/formex";
4
+ import { ValidationError } from "yup";
5
+ import { EntityFormActionsProps } from "./EntityFormActions";
6
+ export type OnUpdateParams = {
7
+ entity: Entity<any>;
8
+ status: EntityStatus;
9
+ path: string;
10
+ entityId?: string;
11
+ selectedTab?: string;
12
+ collection: EntityCollection<any>;
13
+ };
14
+ export type EntityFormProps<M extends Record<string, any>> = {
15
+ path: string;
16
+ collection: EntityCollection<M>;
17
+ entityId?: string;
18
+ entity?: Entity<M>;
19
+ databaseId?: string;
20
+ onIdChange?: (id: string) => void;
21
+ onValuesModified?: (modified: boolean) => void;
22
+ onSaved?: (params: OnUpdateParams) => void;
23
+ initialDirtyValues?: Partial<M>;
24
+ onFormContextReady?: (formContext: FormContext) => void;
25
+ forceActionsAtTheBottom?: boolean;
26
+ className?: string;
27
+ initialStatus: EntityStatus;
28
+ onStatusChange?: (status: EntityStatus) => void;
29
+ onEntityChange?: (entity: Entity<M>) => void;
30
+ formex?: FormexController<M>;
31
+ openEntityMode?: "side_panel" | "full_screen";
32
+ /**
33
+ * If true, the form will be disabled and no actions will be available
34
+ */
35
+ disabled?: boolean;
36
+ /**
37
+ * Include the copy and delete actions in the form
38
+ */
39
+ showDefaultActions?: boolean;
40
+ /**
41
+ * Display the entity path in the form
42
+ */
43
+ showEntityPath?: boolean;
44
+ EntityFormActionsComponent?: React.FC<EntityFormActionsProps>;
45
+ Builder?: React.ComponentType<EntityCustomViewParams<M>>;
46
+ children?: React.ReactNode;
47
+ };
48
+ export declare function EntityForm<M extends Record<string, any>>({ path, entityId: entityIdProp, collection, onValuesModified, onIdChange, onSaved, entity, initialDirtyValues, onFormContextReady, forceActionsAtTheBottom, initialStatus, className, onStatusChange, onEntityChange, openEntityMode, formex: formexProp, disabled: disabledProp, Builder, EntityFormActionsComponent, showDefaultActions, showEntityPath, children }: EntityFormProps<M>): import("react/jsx-runtime").JSX.Element;
49
+ export declare function yupToFormErrors(yupError: ValidationError): Record<string, any>;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { Entity, ResolvedEntityCollection } from "../types";
3
+ import { FormexController } from "@firecms/formex";
4
+ export interface EntityFormActionsProps {
5
+ collection: ResolvedEntityCollection;
6
+ path: string;
7
+ entity?: Entity;
8
+ layout: "bottom" | "side";
9
+ savingError?: Error;
10
+ formex: FormexController<any>;
11
+ disabled: boolean;
12
+ status: "new" | "existing" | "copy";
13
+ pluginActions: React.ReactNode[];
14
+ openEntityMode: "side_panel" | "full_screen";
15
+ showDefaultActions?: boolean;
16
+ }
17
+ export declare function EntityFormActions({ collection, entity, layout, savingError, formex, disabled, status, pluginActions, openEntityMode }: EntityFormActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -26,5 +26,5 @@ import { CMSType, PropertyFieldBindingProps } from "../types";
26
26
  * @group Form custom fields
27
27
  */
28
28
  export declare const PropertyFieldBinding: typeof PropertyFieldBindingInternal;
29
- declare function PropertyFieldBindingInternal<T extends CMSType = CMSType, M extends Record<string, any> = Record<string, any>>({ propertyKey, property, context, includeDescription, underlyingValueHasChanged, disabled: disabledProp, partOfArray, minimalistView, autoFocus, index, size, onPropertyChange }: PropertyFieldBindingProps<T, M>): ReactElement<PropertyFieldBindingProps<T, M>>;
29
+ declare function PropertyFieldBindingInternal<T extends CMSType = CMSType, M extends Record<string, any> = any>({ propertyKey, property, context, includeDescription, underlyingValueHasChanged, disabled: disabledProp, partOfArray, minimalistView, autoFocus, index, size, onPropertyChange, }: PropertyFieldBindingProps<T, M>): ReactElement<PropertyFieldBindingProps<T, M>>;
30
30
  export {};
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export declare function FormEntry({ propertyKey, widthPercentage, children }: {
3
+ propertyKey: string;
4
+ widthPercentage?: number;
5
+ children: React.ReactNode;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ export declare function FormLayout({ children, className }: {
3
+ children: React.ReactNode;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,5 @@
1
1
  export * from "./FieldHelperText";
2
2
  export * from "./LabelWithIcon";
3
3
  export * from "./LabelWithIconAndTooltip";
4
+ export * from "./FormEntry";
5
+ export * from "./FormLayout";
@@ -6,4 +6,4 @@ import { FieldProps } from "../../types";
6
6
  * and tables to the specified properties.
7
7
  * @group Form fields
8
8
  */
9
- export declare function ArrayCustomShapedFieldBinding<T extends Array<any>>({ propertyKey, value, error, showError, isSubmitting, setValue, minimalistView, property, includeDescription, underlyingValueHasChanged, context, disabled }: FieldProps<T, any, any>): import("react/jsx-runtime").JSX.Element;
9
+ export declare function ArrayCustomShapedFieldBinding<T extends Array<any>>({ propertyKey, value, error, showError, isSubmitting, setValue, minimalistView: minimalistViewProp, property, includeDescription, context, disabled }: FieldProps<T, any, any>): import("react/jsx-runtime").JSX.Element;
@@ -7,5 +7,5 @@ type ArrayOfReferencesFieldProps = FieldProps<EntityReference[]>;
7
7
  * and tables to the specified properties.
8
8
  * @group Form fields
9
9
  */
10
- export declare function ArrayOfReferencesFieldBinding({ propertyKey, value, error, showError, disabled, isSubmitting, minimalistView, property, includeDescription, setValue, setFieldValue }: ArrayOfReferencesFieldProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function ArrayOfReferencesFieldBinding({ propertyKey, value, error, showError, disabled, isSubmitting, minimalistView: minimalistViewProp, property, includeDescription, setValue, setFieldValue }: ArrayOfReferencesFieldProps): import("react/jsx-runtime").JSX.Element;
11
11
  export {};
@@ -7,4 +7,4 @@ import { FieldProps } from "../../types";
7
7
  * and tables to the specified properties.
8
8
  * @group Form fields
9
9
  */
10
- export declare function BlockFieldBinding<T extends Array<any>>({ propertyKey, value, error, showError, isSubmitting, setValue, setFieldValue, minimalistView, property, includeDescription, underlyingValueHasChanged, context, disabled }: FieldProps<T>): import("react/jsx-runtime").JSX.Element;
10
+ export declare function BlockFieldBinding<T extends Array<any>>({ propertyKey, value, error, showError, isSubmitting, setValue, setFieldValue, minimalistView: minimalistViewProp, property, includeDescription, underlyingValueHasChanged, context, disabled }: FieldProps<T>): import("react/jsx-runtime").JSX.Element;