@firecms/core 3.0.0-canary.99 → 3.0.0-rc.2

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 (371) hide show
  1. package/README.md +2 -2
  2. package/dist/app/Drawer.d.ts +0 -1
  3. package/dist/app/Scaffold.d.ts +4 -0
  4. package/dist/components/ArrayContainer.d.ts +31 -12
  5. package/dist/components/{DeleteConfirmationDialog.d.ts → ConfirmationDialog.d.ts} +1 -1
  6. package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +3 -1
  7. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -2
  8. package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +17 -3
  9. package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +1 -1
  10. package/dist/components/EntityCollectionTable/index.d.ts +1 -1
  11. package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +6 -3
  12. package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +8 -0
  13. package/dist/components/EntityCollectionView/utils.d.ts +3 -0
  14. package/dist/components/EntityJsonPreview.d.ts +3 -0
  15. package/dist/components/EntityPreview.d.ts +8 -6
  16. package/dist/components/HomePage/DefaultHomePage.d.ts +2 -15
  17. package/dist/components/HomePage/HomePageDnD.d.ts +76 -0
  18. package/dist/components/HomePage/NavigationCard.d.ts +3 -1
  19. package/dist/components/HomePage/NavigationCardBinding.d.ts +3 -2
  20. package/dist/components/HomePage/NavigationGroup.d.ts +8 -1
  21. package/dist/components/HomePage/RenameGroupDialog.d.ts +9 -0
  22. package/dist/components/PropertyConfigBadge.d.ts +2 -1
  23. package/dist/components/PropertyIdCopyTooltip.d.ts +8 -0
  24. package/dist/components/SelectableTable/SelectableTable.d.ts +13 -3
  25. package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +1 -1
  26. package/dist/components/UnsavedChangesDialog.d.ts +8 -0
  27. package/dist/components/UserDisplay.d.ts +7 -0
  28. package/dist/components/VirtualTable/VirtualTableProps.d.ts +11 -2
  29. package/dist/components/VirtualTable/fields/VirtualTableUserSelect.d.ts +12 -0
  30. package/dist/components/common/default_entity_actions.d.ts +0 -2
  31. package/dist/components/common/index.d.ts +1 -1
  32. package/dist/components/common/useColumnsIds.d.ts +1 -0
  33. package/dist/components/common/{useDataSourceEntityCollectionTableController.d.ts → useDataSourceTableController.d.ts} +10 -2
  34. package/dist/components/common/useDebouncedCallback.d.ts +1 -0
  35. package/dist/components/common/useScrollRestoration.d.ts +14 -0
  36. package/dist/components/index.d.ts +3 -1
  37. package/dist/contexts/BreacrumbsContext.d.ts +8 -0
  38. package/dist/contexts/InternalUserManagementContext.d.ts +3 -0
  39. package/dist/core/DefaultAppBar.d.ts +8 -2
  40. package/dist/core/DrawerNavigationItem.d.ts +2 -1
  41. package/dist/core/EntityEditView.d.ts +40 -22
  42. package/dist/core/EntityEditViewFormActions.d.ts +2 -0
  43. package/dist/core/FireCMS.d.ts +2 -3
  44. package/dist/core/FireCMSRouter.d.ts +4 -0
  45. package/dist/core/NavigationRoutes.d.ts +0 -1
  46. package/dist/core/SideDialogs.d.ts +4 -2
  47. package/dist/core/field_configs.d.ts +1 -1
  48. package/dist/core/index.d.ts +2 -1
  49. package/dist/form/EntityForm.d.ts +50 -0
  50. package/dist/form/EntityFormActions.d.ts +21 -0
  51. package/dist/form/PropertyFieldBinding.d.ts +1 -1
  52. package/dist/form/components/FormEntry.d.ts +6 -0
  53. package/dist/form/components/FormLayout.d.ts +5 -0
  54. package/dist/form/components/LabelWithIcon.d.ts +1 -1
  55. package/dist/form/components/LabelWithIconAndTooltip.d.ts +15 -0
  56. package/dist/form/components/index.d.ts +3 -1
  57. package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +1 -1
  58. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +1 -1
  59. package/dist/form/field_bindings/BlockFieldBinding.d.ts +1 -1
  60. package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +1 -1
  61. package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
  62. package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +11 -0
  63. package/dist/form/field_bindings/{MultiSelectBinding.d.ts → MultiSelectFieldBinding.d.ts} +1 -1
  64. package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +1 -1
  65. package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +9 -0
  66. package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +2 -2
  67. package/dist/form/field_bindings/RepeatFieldBinding.d.ts +1 -1
  68. package/dist/form/field_bindings/SelectFieldBinding.d.ts +1 -1
  69. package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +4 -10
  70. package/dist/form/field_bindings/SwitchFieldBinding.d.ts +1 -2
  71. package/dist/form/field_bindings/TextFieldBinding.d.ts +1 -1
  72. package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +12 -0
  73. package/dist/form/index.d.ts +17 -16
  74. package/dist/form/useClearRestoreValue.d.ts +2 -2
  75. package/dist/hooks/data/delete.d.ts +4 -4
  76. package/dist/hooks/data/save.d.ts +3 -3
  77. package/dist/hooks/data/useCollectionFetch.d.ts +1 -1
  78. package/dist/hooks/data/useEntityFetch.d.ts +4 -3
  79. package/dist/hooks/index.d.ts +2 -0
  80. package/dist/hooks/useAuthController.d.ts +1 -1
  81. package/dist/hooks/useBreadcrumbsController.d.ts +26 -0
  82. package/dist/hooks/useBuildNavigationController.d.ts +57 -12
  83. package/dist/hooks/useCollapsedGroups.d.ts +9 -0
  84. package/dist/hooks/useFireCMSContext.d.ts +1 -1
  85. package/dist/hooks/useInternalUserManagementController.d.ts +12 -0
  86. package/dist/hooks/useModeController.d.ts +1 -2
  87. package/dist/hooks/useProjectLog.d.ts +7 -1
  88. package/dist/hooks/useResolvedNavigationFrom.d.ts +3 -3
  89. package/dist/hooks/useValidateAuthenticator.d.ts +3 -3
  90. package/dist/index.es.js +20480 -14434
  91. package/dist/index.es.js.map +1 -1
  92. package/dist/index.umd.js +20250 -14209
  93. package/dist/index.umd.js.map +1 -1
  94. package/dist/internal/useBuildDataSource.d.ts +3 -2
  95. package/dist/internal/useBuildSideEntityController.d.ts +3 -3
  96. package/dist/internal/useUnsavedChangesDialog.d.ts +7 -9
  97. package/dist/preview/PropertyPreviewProps.d.ts +1 -1
  98. package/dist/preview/components/EnumValuesChip.d.ts +1 -1
  99. package/dist/preview/components/ReferencePreview.d.ts +2 -2
  100. package/dist/preview/components/UserPreview.d.ts +8 -0
  101. package/dist/preview/index.d.ts +1 -0
  102. package/dist/preview/util.d.ts +3 -3
  103. package/dist/routes/CustomCMSRoute.d.ts +4 -0
  104. package/dist/routes/FireCMSRoute.d.ts +1 -0
  105. package/dist/routes/HomePageRoute.d.ts +3 -0
  106. package/dist/types/analytics.d.ts +1 -1
  107. package/dist/types/auth.d.ts +7 -9
  108. package/dist/types/collections.d.ts +88 -25
  109. package/dist/types/customization_controller.d.ts +8 -0
  110. package/dist/types/datasource.d.ts +19 -17
  111. package/dist/types/dialogs_controller.d.ts +7 -3
  112. package/dist/types/entities.d.ts +7 -2
  113. package/dist/types/entity_actions.d.ts +58 -8
  114. package/dist/types/entity_callbacks.d.ts +16 -16
  115. package/dist/types/entity_overrides.d.ts +2 -2
  116. package/dist/types/export_import.d.ts +4 -4
  117. package/dist/types/fields.d.ts +43 -17
  118. package/dist/types/firecms.d.ts +31 -3
  119. package/dist/types/firecms_context.d.ts +17 -1
  120. package/dist/types/index.d.ts +1 -0
  121. package/dist/types/internal_user_management.d.ts +20 -0
  122. package/dist/types/navigation.d.ts +60 -17
  123. package/dist/types/permissions.d.ts +4 -4
  124. package/dist/types/plugins.d.ts +44 -9
  125. package/dist/types/properties.d.ts +74 -22
  126. package/dist/types/property_config.d.ts +1 -3
  127. package/dist/types/roles.d.ts +3 -0
  128. package/dist/types/side_dialogs_controller.d.ts +10 -0
  129. package/dist/types/side_entity_controller.d.ts +14 -1
  130. package/dist/types/storage.d.ts +75 -0
  131. package/dist/types/user.d.ts +2 -1
  132. package/dist/util/builders.d.ts +3 -3
  133. package/dist/util/callbacks.d.ts +2 -0
  134. package/dist/util/createFormexStub.d.ts +2 -0
  135. package/dist/util/entities.d.ts +2 -2
  136. package/dist/util/entity_actions.d.ts +2 -0
  137. package/dist/util/entity_cache.d.ts +23 -0
  138. package/dist/util/icon_synonyms.d.ts +0 -1
  139. package/dist/util/icons.d.ts +5 -2
  140. package/dist/util/index.d.ts +3 -0
  141. package/dist/util/navigation_from_path.d.ts +10 -1
  142. package/dist/util/navigation_utils.d.ts +13 -1
  143. package/dist/util/objects.d.ts +2 -1
  144. package/dist/util/permissions.d.ts +4 -4
  145. package/dist/util/property_utils.d.ts +4 -4
  146. package/dist/util/references.d.ts +2 -2
  147. package/dist/util/resolutions.d.ts +30 -6
  148. package/dist/util/storage.d.ts +1 -1
  149. package/dist/util/useStorageUploadController.d.ts +2 -2
  150. package/package.json +133 -125
  151. package/src/app/Drawer.tsx +0 -1
  152. package/src/app/Scaffold.tsx +33 -29
  153. package/src/components/ArrayContainer.tsx +447 -229
  154. package/src/components/CircularProgressCenter.tsx +1 -1
  155. package/src/components/ClearFilterSortButton.tsx +1 -1
  156. package/src/components/{DeleteConfirmationDialog.tsx → ConfirmationDialog.tsx} +12 -11
  157. package/src/components/DeleteEntityDialog.tsx +13 -20
  158. package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +59 -25
  159. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +23 -17
  160. package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +20 -3
  161. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +47 -9
  162. package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +21 -16
  163. package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +6 -12
  164. package/src/components/EntityCollectionTable/index.tsx +1 -1
  165. package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +6 -6
  166. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +35 -26
  167. package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +20 -8
  168. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +132 -101
  169. package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +9 -9
  170. package/src/components/EntityCollectionView/EntityCollectionView.tsx +178 -85
  171. package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +7 -4
  172. package/src/components/EntityCollectionView/useSelectionController.tsx +5 -4
  173. package/src/components/EntityCollectionView/utils.ts +19 -0
  174. package/src/components/EntityJsonPreview.tsx +66 -0
  175. package/src/components/EntityPreview.tsx +75 -57
  176. package/src/components/EntityView.tsx +8 -5
  177. package/src/components/ErrorView.tsx +3 -3
  178. package/src/components/FireCMSLogo.tsx +7 -51
  179. package/src/components/HomePage/DefaultHomePage.tsx +506 -161
  180. package/src/components/HomePage/FavouritesView.tsx +9 -14
  181. package/src/components/HomePage/HomePageDnD.tsx +600 -0
  182. package/src/components/HomePage/NavigationCard.tsx +47 -38
  183. package/src/components/HomePage/NavigationCardBinding.tsx +16 -15
  184. package/src/components/HomePage/NavigationGroup.tsx +144 -30
  185. package/src/components/HomePage/RenameGroupDialog.tsx +123 -0
  186. package/src/components/HomePage/SmallNavigationCard.tsx +1 -2
  187. package/src/components/NotFoundPage.tsx +2 -2
  188. package/src/components/PropertyConfigBadge.tsx +10 -4
  189. package/src/components/PropertyIdCopyTooltip.tsx +47 -0
  190. package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +22 -13
  191. package/src/components/SearchIconsView.tsx +2 -2
  192. package/src/components/SelectableTable/SelectableTable.tsx +154 -142
  193. package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +4 -2
  194. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +10 -8
  195. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +60 -11
  196. package/src/components/UnsavedChangesDialog.tsx +46 -0
  197. package/src/components/UserDisplay.tsx +55 -0
  198. package/src/components/VirtualTable/VirtualTable.tsx +65 -44
  199. package/src/components/VirtualTable/VirtualTableCell.tsx +0 -8
  200. package/src/components/VirtualTable/VirtualTableHeader.tsx +8 -8
  201. package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +1 -1
  202. package/src/components/VirtualTable/VirtualTableProps.tsx +12 -2
  203. package/src/components/VirtualTable/VirtualTableRow.tsx +1 -1
  204. package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +4 -4
  205. package/src/components/VirtualTable/fields/VirtualTableInput.tsx +2 -2
  206. package/src/components/VirtualTable/fields/VirtualTableNumberInput.tsx +2 -1
  207. package/src/components/VirtualTable/fields/VirtualTableSelect.tsx +16 -28
  208. package/src/components/VirtualTable/fields/VirtualTableUserSelect.tsx +99 -0
  209. package/src/components/common/default_entity_actions.tsx +62 -42
  210. package/src/components/common/index.ts +1 -1
  211. package/src/components/common/useColumnsIds.tsx +2 -9
  212. package/src/components/common/useDataSourceTableController.tsx +420 -0
  213. package/src/components/common/useDebouncedCallback.tsx +20 -0
  214. package/src/components/common/useScrollRestoration.tsx +68 -0
  215. package/src/components/common/useTableSearchHelper.ts +1 -0
  216. package/src/components/index.tsx +4 -1
  217. package/src/contexts/BreacrumbsContext.tsx +38 -0
  218. package/src/contexts/DialogsProvider.tsx +3 -2
  219. package/src/contexts/InternalUserManagementContext.tsx +4 -0
  220. package/src/contexts/ModeController.tsx +1 -3
  221. package/src/contexts/SnackbarProvider.tsx +2 -0
  222. package/src/core/DefaultAppBar.tsx +124 -85
  223. package/src/core/DefaultDrawer.tsx +30 -22
  224. package/src/core/DrawerNavigationItem.tsx +32 -28
  225. package/src/core/EntityEditView.tsx +388 -995
  226. package/src/core/EntityEditViewFormActions.tsx +329 -0
  227. package/src/core/EntitySidePanel.tsx +88 -20
  228. package/src/core/FireCMS.tsx +58 -28
  229. package/src/core/FireCMSRouter.tsx +17 -0
  230. package/src/core/NavigationRoutes.tsx +23 -32
  231. package/src/core/SideDialogs.tsx +22 -12
  232. package/src/core/field_configs.tsx +39 -11
  233. package/src/core/index.tsx +4 -2
  234. package/src/form/EntityForm.tsx +814 -0
  235. package/src/form/EntityFormActions.tsx +211 -0
  236. package/src/form/PropertyFieldBinding.tsx +59 -41
  237. package/src/form/components/CustomIdField.tsx +9 -3
  238. package/src/form/components/FieldHelperText.tsx +1 -1
  239. package/src/form/components/FormEntry.tsx +22 -0
  240. package/src/form/components/FormLayout.tsx +16 -0
  241. package/src/form/components/LabelWithIcon.tsx +30 -19
  242. package/src/form/components/LabelWithIconAndTooltip.tsx +28 -0
  243. package/src/form/components/StorageItemPreview.tsx +5 -4
  244. package/src/form/components/StorageUploadProgress.tsx +2 -3
  245. package/src/form/components/index.tsx +3 -1
  246. package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +30 -18
  247. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +47 -36
  248. package/src/form/field_bindings/BlockFieldBinding.tsx +55 -33
  249. package/src/form/field_bindings/DateTimeFieldBinding.tsx +18 -14
  250. package/src/form/field_bindings/KeyValueFieldBinding.tsx +19 -15
  251. package/src/form/field_bindings/MapFieldBinding.tsx +72 -62
  252. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +159 -0
  253. package/src/form/field_bindings/{MultiSelectBinding.tsx → MultiSelectFieldBinding.tsx} +26 -21
  254. package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +10 -8
  255. package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +135 -0
  256. package/src/form/field_bindings/ReferenceFieldBinding.tsx +28 -19
  257. package/src/form/field_bindings/RepeatFieldBinding.tsx +56 -32
  258. package/src/form/field_bindings/SelectFieldBinding.tsx +22 -13
  259. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +247 -168
  260. package/src/form/field_bindings/SwitchFieldBinding.tsx +29 -24
  261. package/src/form/field_bindings/TextFieldBinding.tsx +28 -24
  262. package/src/form/field_bindings/UserSelectFieldBinding.tsx +94 -0
  263. package/src/form/index.tsx +17 -37
  264. package/src/form/useClearRestoreValue.tsx +2 -2
  265. package/src/form/validation.ts +12 -6
  266. package/src/hooks/data/delete.ts +6 -5
  267. package/src/hooks/data/save.ts +26 -35
  268. package/src/hooks/data/useCollectionFetch.tsx +3 -3
  269. package/src/hooks/data/useDataSource.tsx +10 -2
  270. package/src/hooks/data/useEntityFetch.tsx +10 -6
  271. package/src/hooks/index.tsx +3 -0
  272. package/src/hooks/useAuthController.tsx +1 -1
  273. package/src/hooks/useBreadcrumbsController.tsx +31 -0
  274. package/src/hooks/useBrowserTitleAndIcon.tsx +1 -1
  275. package/src/hooks/useBuildModeController.tsx +15 -28
  276. package/src/hooks/useBuildNavigationController.tsx +386 -124
  277. package/src/hooks/useCollapsedGroups.ts +64 -0
  278. package/src/hooks/useFireCMSContext.tsx +9 -35
  279. package/src/hooks/useInternalUserManagementController.tsx +16 -0
  280. package/src/hooks/useLargeLayout.tsx +0 -35
  281. package/src/hooks/useModeController.tsx +1 -2
  282. package/src/hooks/useProjectLog.tsx +16 -5
  283. package/src/hooks/useResolvedNavigationFrom.tsx +9 -11
  284. package/src/hooks/useValidateAuthenticator.tsx +3 -3
  285. package/src/internal/useBuildDataSource.ts +67 -80
  286. package/src/internal/useBuildSideDialogsController.tsx +4 -2
  287. package/src/internal/useBuildSideEntityController.tsx +149 -86
  288. package/src/internal/useUnsavedChangesDialog.tsx +127 -91
  289. package/src/preview/PropertyPreview.tsx +36 -12
  290. package/src/preview/PropertyPreviewProps.tsx +1 -1
  291. package/src/preview/components/BooleanPreview.tsx +1 -1
  292. package/src/preview/components/EmptyValue.tsx +1 -1
  293. package/src/preview/components/EnumValuesChip.tsx +1 -1
  294. package/src/preview/components/ImagePreview.tsx +10 -9
  295. package/src/preview/components/ReferencePreview.tsx +10 -18
  296. package/src/preview/components/UrlComponentPreview.tsx +20 -21
  297. package/src/preview/components/UserPreview.tsx +27 -0
  298. package/src/preview/index.ts +1 -0
  299. package/src/preview/property_previews/ArrayOfMapsPreview.tsx +6 -5
  300. package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +5 -4
  301. package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +5 -3
  302. package/src/preview/property_previews/ArrayOfStringsPreview.tsx +4 -3
  303. package/src/preview/property_previews/ArrayOneOfPreview.tsx +6 -4
  304. package/src/preview/property_previews/ArrayPropertyPreview.tsx +6 -4
  305. package/src/preview/property_previews/MapPropertyPreview.tsx +7 -6
  306. package/src/preview/property_previews/SkeletonPropertyComponent.tsx +13 -13
  307. package/src/preview/property_previews/StringPropertyPreview.tsx +2 -2
  308. package/src/preview/util.ts +10 -10
  309. package/src/routes/CustomCMSRoute.tsx +21 -0
  310. package/src/routes/FireCMSRoute.tsx +246 -0
  311. package/src/routes/HomePageRoute.tsx +17 -0
  312. package/src/types/analytics.ts +3 -0
  313. package/src/types/auth.tsx +8 -12
  314. package/src/types/collections.ts +103 -28
  315. package/src/types/customization_controller.tsx +9 -0
  316. package/src/types/datasource.ts +21 -20
  317. package/src/types/dialogs_controller.tsx +7 -3
  318. package/src/types/entities.ts +10 -2
  319. package/src/types/entity_actions.tsx +71 -8
  320. package/src/types/entity_callbacks.ts +18 -18
  321. package/src/types/entity_overrides.tsx +2 -2
  322. package/src/types/export_import.ts +4 -4
  323. package/src/types/fields.tsx +52 -19
  324. package/src/types/firecms.tsx +34 -4
  325. package/src/types/firecms_context.tsx +18 -1
  326. package/src/types/index.ts +1 -0
  327. package/src/types/internal_user_management.ts +24 -0
  328. package/src/types/navigation.ts +76 -22
  329. package/src/types/permissions.ts +5 -5
  330. package/src/types/plugins.tsx +53 -9
  331. package/src/types/properties.ts +84 -22
  332. package/src/types/property_config.tsx +2 -2
  333. package/src/types/roles.ts +3 -0
  334. package/src/types/side_dialogs_controller.tsx +15 -0
  335. package/src/types/side_entity_controller.tsx +16 -1
  336. package/src/types/storage.ts +82 -0
  337. package/src/types/user.ts +3 -1
  338. package/src/util/builders.ts +10 -8
  339. package/src/util/callbacks.ts +119 -0
  340. package/src/util/createFormexStub.tsx +62 -0
  341. package/src/util/entities.ts +6 -4
  342. package/src/util/entity_actions.ts +28 -0
  343. package/src/util/entity_cache.ts +204 -0
  344. package/src/util/icon_list.ts +1 -1
  345. package/src/util/icon_synonyms.ts +0 -1
  346. package/src/util/icons.tsx +36 -11
  347. package/src/util/index.ts +3 -0
  348. package/src/util/join_collections.ts +9 -2
  349. package/src/util/make_properties_editable.ts +13 -5
  350. package/src/util/navigation_from_path.ts +33 -12
  351. package/src/util/navigation_utils.ts +135 -19
  352. package/src/util/objects.ts +74 -14
  353. package/src/util/parent_references_from_path.ts +3 -3
  354. package/src/util/permissions.ts +8 -8
  355. package/src/util/property_utils.tsx +17 -6
  356. package/src/util/references.ts +19 -8
  357. package/src/util/resolutions.ts +93 -24
  358. package/src/util/storage.ts +6 -2
  359. package/src/util/useStorageUploadController.tsx +74 -29
  360. package/dist/components/EntityCollectionTable/internal/popup_field/ElementResizeListener.d.ts +0 -5
  361. package/dist/components/PropertyIdCopyTooltipContent.d.ts +0 -3
  362. package/dist/form/PropertiesForm.d.ts +0 -8
  363. package/dist/form/components/FormikArrayContainer.d.ts +0 -18
  364. package/dist/form/field_bindings/MarkdownFieldBinding.d.ts +0 -9
  365. package/src/components/EntityCollectionTable/internal/popup_field/ElementResizeListener.tsx +0 -59
  366. package/src/components/PropertyIdCopyTooltipContent.tsx +0 -27
  367. package/src/components/common/useDataSourceEntityCollectionTableController.tsx +0 -236
  368. package/src/form/PropertiesForm.tsx +0 -81
  369. package/src/form/components/FormikArrayContainer.tsx +0 -44
  370. package/src/form/field_bindings/MarkdownFieldBinding.tsx +0 -695
  371. /package/src/util/{common.tsx → common.ts} +0 -0
@@ -7,7 +7,7 @@ export type EntityStatus = "new" | "existing" | "copy";
7
7
  * Representation of an entity fetched from the datasource
8
8
  * @group Models
9
9
  */
10
- export interface Entity<M extends object> {
10
+ export interface Entity<M extends object = any> {
11
11
  /**
12
12
  * ID of the entity
13
13
  */
@@ -21,6 +21,7 @@ export interface Entity<M extends object> {
21
21
  * Current values
22
22
  */
23
23
  values: EntityValues<M>;
24
+ databaseId?: string;
24
25
  }
25
26
  /**
26
27
  * This type represents a record of key value pairs as described in an
@@ -41,7 +42,11 @@ export declare class EntityReference {
41
42
  * to the root of the database).
42
43
  */
43
44
  readonly path: string;
44
- constructor(id: string, path: string);
45
+ /**
46
+ * Optional database ID where the entity is stored (if multiple databases are used)
47
+ */
48
+ readonly databaseId?: string;
49
+ constructor(id: string, path: string, databaseId?: string);
45
50
  get pathWithId(): string;
46
51
  isEntityReference(): boolean;
47
52
  }
@@ -4,15 +4,28 @@ import { Entity } from "./entities";
4
4
  import { EntityCollection, SelectionController } from "./collections";
5
5
  import { User } from "./user";
6
6
  import { SideEntityController } from "./side_entity_controller";
7
+ import { FormContext } from "./fields";
7
8
  /**
8
9
  * An entity action is a custom action that can be performed on an entity.
9
10
  * They are displayed in the entity view and in the collection view.
10
11
  */
11
- export type EntityAction<M extends object = any, UserType extends User = User> = {
12
+ export type EntityAction<M extends object = any, USER extends User = User> = {
12
13
  /**
13
14
  * Title of the action
14
15
  */
15
16
  name: string;
17
+ /**
18
+ * Key of the action. You only need to provide this if you want to
19
+ * override the default actions, or if you are not passing the action
20
+ * directly to the `entityActions` prop of a collection.
21
+ * You can define your actions at the app level, in which case you
22
+ * must provide a key.
23
+ * The default actions are:
24
+ * - edit
25
+ * - delete
26
+ * - copy
27
+ */
28
+ key?: string;
16
29
  /**
17
30
  * Icon of the action
18
31
  */
@@ -21,7 +34,12 @@ export type EntityAction<M extends object = any, UserType extends User = User> =
21
34
  * Callback when the action is clicked
22
35
  * @param props
23
36
  */
24
- onClick: (props: EntityActionClickProps<M, UserType>) => Promise<void> | void;
37
+ onClick: (props: EntityActionClickProps<M, USER>) => Promise<void> | void;
38
+ /**
39
+ * Optional callback in case you want to disable the action
40
+ * @param props
41
+ */
42
+ isEnabled?: (props: EntityActionClickProps<M, USER>) => boolean;
25
43
  /**
26
44
  * Show this action collapsed in the menu of the collection view.
27
45
  * Defaults to true
@@ -33,17 +51,49 @@ export type EntityAction<M extends object = any, UserType extends User = User> =
33
51
  */
34
52
  includeInForm?: boolean;
35
53
  };
36
- export type EntityActionClickProps<M extends object, UserType extends User = User> = {
37
- entity: Entity<M>;
38
- context: FireCMSContext<UserType>;
54
+ export type EntityActionClickProps<M extends object, USER extends User = User> = {
55
+ entity?: Entity<M>;
56
+ context: FireCMSContext<USER>;
39
57
  fullPath?: string;
58
+ fullIdPath?: string;
40
59
  collection?: EntityCollection<M>;
60
+ /**
61
+ * Optional form context, present if the action is being called from a form.
62
+ * This allows you to access the form state and methods, including modifying the form values.
63
+ */
64
+ formContext?: FormContext;
65
+ /**
66
+ * Present if this actions is being called from a side dialog only
67
+ */
68
+ sideEntityController?: SideEntityController;
69
+ /**
70
+ * Is the action being called from the collection view or from the entity form view?
71
+ */
72
+ view: "collection" | "form";
73
+ /**
74
+ * If the action is rendered in the form, is it open in a side panel or full screen?
75
+ */
76
+ openEntityMode: "side_panel" | "full_screen";
77
+ /**
78
+ * Optional selection controller, present if the action is being called from a collection view
79
+ */
41
80
  selectionController?: SelectionController;
81
+ /**
82
+ * Optional highlight function to highlight the entity in the collection view
83
+ * @param entity
84
+ */
42
85
  highlightEntity?: (entity: Entity<any>) => void;
86
+ /**
87
+ * Optional unhighlight function to remove the highlight from the entity in the collection view
88
+ * @param entity
89
+ */
43
90
  unhighlightEntity?: (entity: Entity<any>) => void;
44
- onCollectionChange?: () => void;
45
91
  /**
46
- * If this actions is being called from a side dialog
92
+ * Optional function to navigate back (e.g. when deleting an entity or navigating from a form)
47
93
  */
48
- sideEntityController?: SideEntityController;
94
+ navigateBack?: () => void;
95
+ /**
96
+ * Callback to be called when the collection changes, e.g. after an entity is deleted or created.
97
+ */
98
+ onCollectionChange?: () => void;
49
99
  };
@@ -9,29 +9,29 @@ import { User } from "./user";
9
9
  * Useful for adding your own logic or blocking the execution of the operation.
10
10
  * @group Models
11
11
  */
12
- export type EntityCallbacks<M extends Record<string, any> = any, UserType extends User = User> = {
12
+ export type EntityCallbacks<M extends Record<string, any> = any, USER extends User = User> = {
13
13
  /**
14
14
  * Callback used after fetching data
15
15
  * @param entityFetchProps
16
16
  */
17
- onFetch?(entityFetchProps: EntityOnFetchProps<M, UserType>): Promise<Entity<M>> | Entity<M>;
17
+ onFetch?(entityFetchProps: EntityOnFetchProps<M, USER>): Promise<Entity<M>> | Entity<M>;
18
18
  /**
19
19
  * Callback used when save is successful
20
20
  * @param entitySaveProps
21
21
  */
22
- onSaveSuccess?(entitySaveProps: EntityOnSaveProps<M, UserType>): Promise<void> | void;
22
+ onSaveSuccess?(entitySaveProps: EntityOnSaveProps<M, USER>): Promise<void> | void;
23
23
  /**
24
24
  * Callback used when saving fails
25
25
  * @param entitySaveProps
26
26
  */
27
- onSaveFailure?(entitySaveProps: EntityOnSaveFailureProps<M, UserType>): Promise<void> | void;
27
+ onSaveFailure?(entitySaveProps: EntityOnSaveFailureProps<M, USER>): Promise<void> | void;
28
28
  /**
29
29
  * Callback used before saving, you need to return the values that will get
30
30
  * saved. If you throw an error in this method the process stops, and an
31
31
  * error snackbar gets displayed.
32
32
  * @param entitySaveProps
33
33
  */
34
- onPreSave?(entitySaveProps: EntityOnPreSaveProps<M, UserType>): Promise<Partial<EntityValues<M>>> | Partial<EntityValues<M>>;
34
+ onPreSave?(entitySaveProps: EntityOnPreSaveProps<M, USER>): Promise<Partial<EntityValues<M>>> | Partial<EntityValues<M>>;
35
35
  /**
36
36
  * Callback used after the entity is deleted.
37
37
  * If you throw an error in this method the process stops, and an
@@ -39,13 +39,13 @@ export type EntityCallbacks<M extends Record<string, any> = any, UserType extend
39
39
  *
40
40
  * @param entityDeleteProps
41
41
  */
42
- onPreDelete?(entityDeleteProps: EntityOnDeleteProps<M, UserType>): void;
42
+ onPreDelete?(entityDeleteProps: EntityOnDeleteProps<M, USER>): void;
43
43
  /**
44
44
  * Callback used after the entity is deleted.
45
45
  *
46
46
  * @param entityDeleteProps
47
47
  */
48
- onDelete?(entityDeleteProps: EntityOnDeleteProps<M, UserType>): void;
48
+ onDelete?(entityDeleteProps: EntityOnDeleteProps<M, USER>): void;
49
49
  /**
50
50
  * Callback fired when any value in the form changes. You can use it
51
51
  * to define the ID of a `new` entity based on the current values.
@@ -59,11 +59,11 @@ export type EntityCallbacks<M extends Record<string, any> = any, UserType extend
59
59
  * Parameters passed to hooks when an entity is fetched
60
60
  * @group Models
61
61
  */
62
- export interface EntityOnFetchProps<M extends Record<string, any> = any, UserType extends User = User> {
62
+ export interface EntityOnFetchProps<M extends Record<string, any> = any, USER extends User = User> {
63
63
  /**
64
64
  * Collection of the entity
65
65
  */
66
- collection: EntityCollection<M, UserType>;
66
+ collection: EntityCollection<M, USER>;
67
67
  /**
68
68
  * Full path of the CMS where this collection is being fetched.
69
69
  * Might contain unresolved aliases.
@@ -76,27 +76,27 @@ export interface EntityOnFetchProps<M extends Record<string, any> = any, UserTyp
76
76
  /**
77
77
  * Context of the app status
78
78
  */
79
- context: FireCMSContext<UserType>;
79
+ context: FireCMSContext<USER>;
80
80
  }
81
81
  /**
82
82
  * Parameters passed to hooks before an entity is saved
83
83
  * @group Models
84
84
  */
85
- export type EntityOnPreSaveProps<M extends Record<string, any> = any, UserType extends User = User> = Omit<EntityOnSaveProps<M, UserType>, "entityId"> & {
85
+ export type EntityOnPreSaveProps<M extends Record<string, any> = any, USER extends User = User> = Omit<EntityOnSaveProps<M, USER>, "entityId"> & {
86
86
  entityId?: string;
87
87
  };
88
88
  /**
89
89
  * Parameters passed to hooks before an entity is saved
90
90
  * @group Models
91
91
  */
92
- export type EntityOnSaveFailureProps<M extends Record<string, any> = any, UserType extends User = User> = Omit<EntityOnSaveProps<M, UserType>, "entityId"> & {
92
+ export type EntityOnSaveFailureProps<M extends Record<string, any> = any, USER extends User = User> = Omit<EntityOnSaveProps<M, USER>, "entityId"> & {
93
93
  entityId?: string;
94
94
  };
95
95
  /**
96
96
  * Parameters passed to hooks when an entity is saved
97
97
  * @group Models
98
98
  */
99
- export interface EntityOnSaveProps<M extends Record<string, any> = any, UserType extends User = User> {
99
+ export interface EntityOnSaveProps<M extends Record<string, any> = any, USER extends User = User> {
100
100
  /**
101
101
  * Resolved collection of the entity
102
102
  */
@@ -129,13 +129,13 @@ export interface EntityOnSaveProps<M extends Record<string, any> = any, UserType
129
129
  /**
130
130
  * Context of the app status
131
131
  */
132
- context: FireCMSContext<UserType>;
132
+ context: FireCMSContext<USER>;
133
133
  }
134
134
  /**
135
135
  * Parameters passed to hooks when an entity is deleted
136
136
  * @group Models
137
137
  */
138
- export interface EntityOnDeleteProps<M extends Record<string, any> = any, UserType extends User = User> {
138
+ export interface EntityOnDeleteProps<M extends Record<string, any> = any, USER extends User = User> {
139
139
  /**
140
140
  * collection of the entity being deleted
141
141
  */
@@ -155,7 +155,7 @@ export interface EntityOnDeleteProps<M extends Record<string, any> = any, UserTy
155
155
  /**
156
156
  * Context of the app status
157
157
  */
158
- context: FireCMSContext<UserType>;
158
+ context: FireCMSContext<USER>;
159
159
  }
160
160
  /**
161
161
  * Parameters passed to hooks when an entity is deleted
@@ -1,6 +1,6 @@
1
- import { DataSource } from "./datasource";
1
+ import { DataSourceDelegate } from "./datasource";
2
2
  import { StorageSource } from "./storage";
3
3
  export type EntityOverrides = {
4
- dataSource?: DataSource;
4
+ dataSourceDelegate?: DataSourceDelegate;
5
5
  storageSource?: StorageSource;
6
6
  };
@@ -6,16 +6,16 @@ import { FireCMSContext } from "./firecms_context";
6
6
  * exports
7
7
  * @group Models
8
8
  */
9
- export interface ExportConfig<UserType extends User = User> {
10
- additionalFields: ExportMappingFunction<UserType>[];
9
+ export interface ExportConfig<USER extends User = User> {
10
+ additionalFields: ExportMappingFunction<USER>[];
11
11
  }
12
12
  /**
13
13
  * @group Models
14
14
  */
15
- export interface ExportMappingFunction<UserType extends User = User> {
15
+ export interface ExportMappingFunction<USER extends User = User> {
16
16
  key: string;
17
17
  builder: ({ entity, context }: {
18
18
  entity: Entity<any>;
19
- context: FireCMSContext<UserType>;
19
+ context: FireCMSContext<USER>;
20
20
  }) => Promise<string> | string;
21
21
  }
@@ -1,6 +1,7 @@
1
- import { CMSType, PropertyOrBuilder } from "./properties";
1
+ import { CMSType, Property, PropertyOrBuilder } from "./properties";
2
2
  import { ResolvedEntityCollection, ResolvedProperty } from "./resolved_entities";
3
3
  import { FormexController } from "@firecms/formex";
4
+ import { Entity } from "./entities";
4
5
  /**
5
6
  * When building a custom field you need to create a React component that takes
6
7
  * this interface as props.
@@ -52,7 +53,7 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
52
53
  /**
53
54
  * Property related to this field
54
55
  */
55
- property: ResolvedProperty<T>;
56
+ property: Property<T> | ResolvedProperty<T>;
56
57
  /**
57
58
  * Should this field include a description
58
59
  */
@@ -67,13 +68,10 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
67
68
  */
68
69
  partOfArray?: boolean;
69
70
  /**
70
- * Is this field part of a block (oneOf array)
71
+ * Display the child properties directly, without being wrapped in an
72
+ * extendable panel. Note that this will also hide the title of this property.
71
73
  */
72
- partOfBlock?: boolean;
73
- /**
74
- * Is this field being rendered in the entity table popup
75
- */
76
- tableMode?: boolean;
74
+ minimalistView?: boolean;
77
75
  /**
78
76
  * Should this field autofocus on mount
79
77
  */
@@ -81,7 +79,7 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
81
79
  /**
82
80
  * Additional properties set by the developer
83
81
  */
84
- customProps?: CustomProps;
82
+ customProps: CustomProps;
85
83
  /**
86
84
  * Additional values related to the state of the form or the entity
87
85
  */
@@ -90,6 +88,18 @@ export interface FieldProps<T extends CMSType = any, CustomProps = any, M extend
90
88
  * Flag to indicate if this field should be disabled
91
89
  */
92
90
  disabled?: boolean;
91
+ /**
92
+ * Size of the field
93
+ */
94
+ size?: "small" | "medium" | "large";
95
+ /**
96
+ * Some properties might change internal state (like expanding a panel).
97
+ * This function should be called when the internal state changes.
98
+ * This is used to preserve state in array containers.
99
+ *
100
+ * @param property
101
+ */
102
+ onPropertyChange?: (property: Partial<Property<any>>) => void;
93
103
  }
94
104
  /**
95
105
  * Context passed to custom fields
@@ -118,15 +128,22 @@ export interface FormContext<M extends Record<string, any> = any> {
118
128
  /**
119
129
  * Entity id, it can be null if it's a new entity
120
130
  */
121
- entityId?: string;
131
+ entityId: string;
122
132
  /**
123
133
  * Path this entity is located at
124
134
  */
125
135
  path?: string;
136
+ status: "new" | "existing" | "copy";
137
+ entity?: Entity<M>;
138
+ savingError?: Error;
139
+ openEntityMode: "side_panel" | "full_screen";
126
140
  /**
127
- * This is the underlying formex controller that powers the form
141
+ * This is the underlying formex controller that powers the form.
142
+ * If you are in a red only mode, the formex controller is there, but you can't
143
+ * operate with it
128
144
  */
129
145
  formex: FormexController<M>;
146
+ disabled: boolean;
130
147
  }
131
148
  /**
132
149
  * In case you need to render a field bound to a Property inside your
@@ -157,18 +174,15 @@ export interface PropertyFieldBindingProps<T extends CMSType, M extends Record<s
157
174
  * field is being edited
158
175
  */
159
176
  underlyingValueHasChanged?: boolean;
160
- /**
161
- * Is this field being rendered in a table
162
- */
163
- tableMode?: boolean;
164
177
  /**
165
178
  * Is this field part of an array
166
179
  */
167
180
  partOfArray?: boolean;
168
181
  /**
169
- * Is this field part of a block (oneOf array)
182
+ * Display the child properties directly, without being wrapped in an
183
+ * extendable panel. Note that this will also hide the title of this property.
170
184
  */
171
- partOfBlock?: boolean;
185
+ minimalistView?: boolean;
172
186
  /**
173
187
  * Should the field take focus when rendered. When opening the popup view
174
188
  * in table mode, it makes sense to put the focus on the only field rendered.
@@ -183,4 +197,16 @@ export interface PropertyFieldBindingProps<T extends CMSType, M extends Record<s
183
197
  * Only used when the field is part of an array.
184
198
  */
185
199
  index?: number;
200
+ /**
201
+ * The size of the field
202
+ */
203
+ size?: "small" | "medium" | "large";
204
+ /**
205
+ * Some properties might change internal state (like expanding a panel).
206
+ * This function should be called when the internal state changes.
207
+ * This is used to preserve state in array containers.
208
+ *
209
+ * @param property
210
+ */
211
+ onPropertyChange?: (property: Partial<Property<any>>) => void;
186
212
  }
@@ -12,6 +12,8 @@ import { EntityLinkBuilder } from "./entity_link_builder";
12
12
  import { UserConfigurationPersistence } from "./local_config_persistence";
13
13
  import { FireCMSPlugin } from "./plugins";
14
14
  import { CMSAnalyticsEvent } from "./analytics";
15
+ import { EntityAction } from "./entity_actions";
16
+ import { InternalUserManagement } from "./internal_user_management";
15
17
  /**
16
18
  * Use this callback to build entity collections dynamically.
17
19
  * You can use the user to decide which collections to show.
@@ -44,7 +46,7 @@ export type CMSViewsBuilder = (params: {
44
46
  /**
45
47
  * @group Models
46
48
  */
47
- export type FireCMSProps<UserType extends User, EC extends EntityCollection> = {
49
+ export type FireCMSProps<USER extends User> = {
48
50
  /**
49
51
  * Use this function to return the components you want to render under
50
52
  * FireCMS
@@ -62,6 +64,10 @@ export type FireCMSProps<UserType extends User, EC extends EntityCollection> = {
62
64
  */
63
65
  loading: boolean;
64
66
  }) => React.ReactNode;
67
+ /**
68
+ * If you have a custom API key, you can use it here.
69
+ */
70
+ apiKey?: string;
65
71
  /**
66
72
  * Record of custom form fields to be used in the CMS.
67
73
  * You can use the key to reference the custom field in
@@ -81,6 +87,13 @@ export type FireCMSProps<UserType extends User, EC extends EntityCollection> = {
81
87
  * You can also define an entity view from the UI.
82
88
  */
83
89
  entityViews?: EntityCustomView[];
90
+ /**
91
+ * List of actions that can be performed on entities.
92
+ * These actions are displayed in the entity view and in the collection view.
93
+ * You can later reuse these actions in the `entityActions` prop of a collection,
94
+ * by specifying the `key` of the action.
95
+ */
96
+ entityActions?: EntityAction[];
84
97
  /**
85
98
  * Format of the dates in the CMS.
86
99
  * Defaults to 'MMMM dd, yyyy, HH:mm:ss'
@@ -101,7 +114,7 @@ export type FireCMSProps<UserType extends User, EC extends EntityCollection> = {
101
114
  /**
102
115
  * Delegate for implementing your auth operations.
103
116
  */
104
- authController: AuthController<UserType>;
117
+ authController: AuthController<USER>;
105
118
  /**
106
119
  * Use this controller to access the configuration that is stored locally,
107
120
  * and not defined in code
@@ -109,7 +122,9 @@ export type FireCMSProps<UserType extends User, EC extends EntityCollection> = {
109
122
  userConfigPersistence?: UserConfigurationPersistence;
110
123
  /**
111
124
  * Use plugins to modify the behaviour of the CMS.
112
- * Currently, in ALPHA, and likely subject to change.
125
+ * DEPRECATED: use the `plugins` prop in the `useBuildNavigationController` instead.
126
+ * This prop will work as a fallback for the `plugins` prop in the `useBuildNavigationController`.
127
+ * @deprecated
113
128
  */
114
129
  plugins?: FireCMSPlugin<any, any, any>[];
115
130
  /**
@@ -121,6 +136,19 @@ export type FireCMSProps<UserType extends User, EC extends EntityCollection> = {
121
136
  * The function must return a URL that gets opened when the button is clicked
122
137
  */
123
138
  entityLinkBuilder?: EntityLinkBuilder;
139
+ /**
140
+ * You can use this props to provide your own user management implementation.
141
+ * Note that this will not affect the UI, but it will be used to show user information
142
+ * in various places of the CMS, for example, to show who created or modified an entity,
143
+ * or to assign ownership of an entity.
144
+ *
145
+ * You can also use this data to be retrieved in your custom properties,
146
+ * for example, to show a list of users in a dropdown.
147
+ *
148
+ * If you are using the FireCMS user management plugin, this
149
+ * prop will be implemented automatically.
150
+ */
151
+ userManagement?: InternalUserManagement;
124
152
  components?: {
125
153
  /**
126
154
  * Component to render when a reference is missing
@@ -10,6 +10,7 @@ import { SideDialogsController } from "./side_dialogs_controller";
10
10
  import { DialogsController } from "./dialogs_controller";
11
11
  import { CustomizationController } from "./customization_controller";
12
12
  import { AnalyticsController } from "./analytics_controller";
13
+ import { InternalUserManagement } from "./internal_user_management";
13
14
  /**
14
15
  * Context that includes the internal controllers and contexts used by the app.
15
16
  * Some controllers and context included in this context can be accessed
@@ -17,7 +18,7 @@ import { AnalyticsController } from "./analytics_controller";
17
18
  * @group Hooks and utilities
18
19
  * @see useFireCMSContext
19
20
  */
20
- export type FireCMSContext<UserType extends User = User, AuthControllerType extends AuthController<UserType> = AuthController<UserType>> = {
21
+ export type FireCMSContext<USER extends User = User, AuthControllerType extends AuthController<USER> = AuthController<USER>> = {
21
22
  /**
22
23
  * Connector to your database, e.g. your Firestore database
23
24
  */
@@ -67,4 +68,19 @@ export type FireCMSContext<UserType extends User = User, AuthControllerType exte
67
68
  * Callback to send analytics events
68
69
  */
69
70
  analyticsController?: AnalyticsController;
71
+ /**
72
+ * This section is used to manage users in the CMS.
73
+ * It is used to show user information in various places of the CMS,
74
+ * for example, to show who created or modified an entity,
75
+ * or to assign ownership of an entity.
76
+ *
77
+ * In the base CMS, this information is not used for access control.
78
+ * You can pass your own implementation of this section, to populate
79
+ * the dropdown of users when assigning ownership of an entity,
80
+ * or to show more information about the user.
81
+ *
82
+ * If you are using the FireCMS user management plugin, this
83
+ * section will be implemented automatically.
84
+ */
85
+ userManagement: InternalUserManagement<USER>;
70
86
  };
@@ -13,6 +13,7 @@ export * from "./fields";
13
13
  export * from "./property_config";
14
14
  export * from "./datasource";
15
15
  export * from "./entity_link_builder";
16
+ export * from "./internal_user_management";
16
17
  export * from "./side_entity_controller";
17
18
  export * from "./side_dialogs_controller";
18
19
  export * from "./firecms_context";
@@ -0,0 +1,20 @@
1
+ import { User } from "./user";
2
+ export type InternalUserManagement<USER extends User = User> = {
3
+ /**
4
+ * List of users to be managed by the CMS.
5
+ */
6
+ users: USER[];
7
+ /**
8
+ * Function to get a user by its uid. This is used to show
9
+ * user information when assigning ownership of an entity.
10
+ *
11
+ * You can pass your own implementation if you want to show
12
+ * more information about the user.
13
+ *
14
+ * If you are using the FireCMS user management plugin, this
15
+ * function will be implemented automatically.
16
+ *
17
+ * @param uid
18
+ */
19
+ getUser: (uid: string) => USER | null;
20
+ };