@rebasepro/admin 0.10.0 → 0.10.1-canary.0a881d4

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 (352) hide show
  1. package/dist/{CollectionEditorDialog-BOlKGGg7.js → CollectionEditorDialog-DMztwJ5S.js} +12 -12
  2. package/dist/CollectionEditorDialog-DMztwJ5S.js.map +1 -0
  3. package/dist/{PropertyEditView-i51tFOfM.js → PropertyEditView-CjFCnftn.js} +18 -18
  4. package/dist/PropertyEditView-CjFCnftn.js.map +1 -0
  5. package/dist/{RouterCollectionsStudioView-Dh4W53PU.js → RouterCollectionsStudioView-nDFQdKHA.js} +4 -4
  6. package/dist/RouterCollectionsStudioView-nDFQdKHA.js.map +1 -0
  7. package/dist/collection_editor/api/generateCollectionApi.d.ts +4 -4
  8. package/dist/collection_editor/pgColumnToProperty.d.ts +4 -3
  9. package/dist/collection_editor/serializable_types.d.ts +31 -30
  10. package/dist/collection_editor/serializable_utils.d.ts +6 -5
  11. package/dist/collection_editor/types/collection_editor_controller.d.ts +6 -5
  12. package/dist/collection_editor/types/collection_inference.d.ts +3 -2
  13. package/dist/collection_editor/types/config_controller.d.ts +8 -7
  14. package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -2
  15. package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +3 -2
  16. package/dist/collection_editor/ui/EditorCollectionAction.d.ts +1 -1
  17. package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +1 -1
  18. package/dist/collection_editor/ui/EditorEntityAction.d.ts +1 -1
  19. package/dist/collection_editor/ui/HomePageEditorCollectionAction.d.ts +1 -1
  20. package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -2
  21. package/dist/collection_editor/ui/NewCollectionCard.d.ts +1 -1
  22. package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +2 -2
  23. package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +3 -3
  24. package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +2 -2
  25. package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +5 -4
  26. package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
  27. package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +2 -2
  28. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +3 -2
  29. package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +2 -2
  30. package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +2 -2
  31. package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +2 -2
  32. package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +2 -2
  33. package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +2 -2
  34. package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +3 -2
  35. package/dist/collection_editor/ui/collection_editor/PropertyTree.d.ts +2 -1
  36. package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +4 -3
  37. package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.d.ts +1 -1
  38. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +1 -1
  39. package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.d.ts +1 -1
  40. package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.d.ts +1 -1
  41. package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.d.ts +1 -1
  42. package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +2 -2
  43. package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +2 -2
  44. package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +2 -2
  45. package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +2 -2
  46. package/dist/collection_editor/ui/collection_editor/utils/supported_fields.d.ts +1 -1
  47. package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.d.ts +2 -1
  48. package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +2 -2
  49. package/dist/collection_editor/validateCollectionJson.d.ts +2 -2
  50. package/dist/collection_editor_ui.js +4 -4
  51. package/dist/components/AdminModeSyncer.d.ts +1 -1
  52. package/dist/components/ClearFilterSortButton.d.ts +1 -1
  53. package/dist/components/CollectionPanel.d.ts +2 -2
  54. package/dist/components/CollectionTableBinding/CollectionRowActions.d.ts +4 -4
  55. package/dist/components/CollectionTableBinding/CollectionTableBinding.d.ts +1 -1
  56. package/dist/components/CollectionTableBinding/CollectionTableBindingProps.d.ts +3 -2
  57. package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.d.ts +3 -3
  58. package/dist/components/CollectionTableBinding/fields/TableReferenceField.d.ts +3 -3
  59. package/dist/components/CollectionTableBinding/fields/TableRelationField.d.ts +3 -3
  60. package/dist/components/CollectionTableBinding/internal/common.d.ts +2 -2
  61. package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.d.ts +2 -2
  62. package/dist/components/CollectionViewBinding/BoardCardBinding.d.ts +3 -3
  63. package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.d.ts +3 -3
  64. package/dist/components/CollectionViewBinding/CollectionCardViewBinding.d.ts +3 -3
  65. package/dist/components/CollectionViewBinding/CollectionListViewBinding.d.ts +3 -3
  66. package/dist/components/CollectionViewBinding/CollectionViewActions.d.ts +2 -3
  67. package/dist/components/CollectionViewBinding/CollectionViewBinding.d.ts +2 -2
  68. package/dist/components/CollectionViewBinding/CollectionViewStartActions.d.ts +2 -3
  69. package/dist/components/CollectionViewBinding/EntityCardBinding.d.ts +3 -3
  70. package/dist/components/CollectionViewBinding/FilterPresetsButton.d.ts +2 -1
  71. package/dist/components/CollectionViewBinding/SplitListView.d.ts +3 -3
  72. package/dist/components/CollectionViewBinding/ViewModeToggle.d.ts +1 -1
  73. package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.d.ts +3 -2
  74. package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.d.ts +3 -2
  75. package/dist/components/CollectionViewBinding/useBoardDataController.d.ts +2 -2
  76. package/dist/components/CollectionViewBinding/usePreviewSlots.d.ts +9 -6
  77. package/dist/components/CollectionViewBinding/useSelectionController.d.ts +2 -1
  78. package/dist/components/DeleteEntityDialog.d.ts +2 -2
  79. package/dist/components/DetailViewBinding.d.ts +3 -3
  80. package/dist/components/DrawerNavigationGroup.d.ts +1 -1
  81. package/dist/components/EditViewBinding.d.ts +3 -3
  82. package/dist/components/EntityPreviewBinding.d.ts +3 -3
  83. package/dist/components/EntityViewBinding.d.ts +2 -2
  84. package/dist/components/HomePage/ContentHomePage.d.ts +1 -1
  85. package/dist/components/HomePage/HomePageDnD.d.ts +1 -1
  86. package/dist/components/HomePage/NavigationCardBinding.d.ts +1 -1
  87. package/dist/components/PropertyConfigBadge.d.ts +1 -1
  88. package/dist/components/RebaseAdmin.d.ts +1 -1
  89. package/dist/components/RebaseLayout.d.ts +1 -1
  90. package/dist/components/ReferenceTable/SelectionTableBinding.d.ts +2 -2
  91. package/dist/components/SelectableTable/SelectableTable.d.ts +3 -2
  92. package/dist/components/SelectableTable/SelectionStore.d.ts +1 -1
  93. package/dist/components/SelectableTable/filters/FilterFieldBinding.d.ts +2 -2
  94. package/dist/components/SidePanelBinding.d.ts +1 -1
  95. package/dist/components/admin/CreationResultDialog.d.ts +1 -1
  96. package/dist/components/common/default_entity_actions.d.ts +2 -1
  97. package/dist/components/field_configs.d.ts +3 -2
  98. package/dist/components/history/EntityHistoryEntry.d.ts +2 -2
  99. package/dist/components/history/EntityHistoryView.d.ts +1 -1
  100. package/dist/components/history/LastEditedByFormAction.d.ts +1 -1
  101. package/dist/components/history/LastEditedByIndicator.d.ts +2 -2
  102. package/dist/contexts/BreacrumbsContext.d.ts +1 -1
  103. package/dist/contexts/SideDialogsControllerContext.d.ts +1 -1
  104. package/dist/contexts/SidePanelControllerContext.d.ts +1 -1
  105. package/dist/data_export/export/ExportCollectionAction.d.ts +4 -3
  106. package/dist/data_import/components/ImportSaveInProgress.d.ts +2 -2
  107. package/dist/data_import/import/ImportCollectionAction.d.ts +2 -1
  108. package/dist/data_import/utils/data.d.ts +2 -1
  109. package/dist/{export-BM6HPujv.js → export-CavEbZVF.js} +2 -2
  110. package/dist/export-CavEbZVF.js.map +1 -0
  111. package/dist/form/PropertyFieldBinding.d.ts +1 -1
  112. package/dist/form/form_utils.d.ts +4 -3
  113. package/dist/{history-CtIPJxvQ.js → history-B1lIsrkX.js} +2 -2
  114. package/dist/history-B1lIsrkX.js.map +1 -0
  115. package/dist/hooks/index.d.ts +1 -0
  116. package/dist/hooks/navigation/contexts/CollectionRegistryContext.d.ts +2 -2
  117. package/dist/hooks/navigation/contexts/NavigationStateContext.d.ts +1 -1
  118. package/dist/hooks/navigation/contexts/UrlContext.d.ts +1 -1
  119. package/dist/hooks/navigation/useBuildCollectionRegistryController.d.ts +2 -1
  120. package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +7 -5
  121. package/dist/hooks/navigation/useBuildUrlController.d.ts +1 -1
  122. package/dist/hooks/navigation/useNavigationResolution.d.ts +6 -5
  123. package/dist/hooks/navigation/useResolvedCollections.d.ts +8 -7
  124. package/dist/hooks/navigation/useResolvedViews.d.ts +4 -2
  125. package/dist/hooks/navigation/useTopLevelNavigation.d.ts +2 -2
  126. package/dist/hooks/navigation/utils.d.ts +5 -5
  127. package/dist/hooks/useBreadcrumbsController.d.ts +1 -1
  128. package/dist/hooks/useBuildSidePanel.d.ts +4 -4
  129. package/dist/hooks/useCMSContext.d.ts +4 -2
  130. package/dist/hooks/useResolvedNavigationFrom.d.ts +5 -4
  131. package/dist/hooks/useResolvedUsers.d.ts +8 -0
  132. package/dist/hooks/useSideDialogsController.d.ts +1 -1
  133. package/dist/hooks/useSidePanel.d.ts +1 -1
  134. package/dist/{import-DzQnT03v.js → import-36UcGe71.js} +2 -2
  135. package/dist/import-36UcGe71.js.map +1 -0
  136. package/dist/index.d.ts +1 -1
  137. package/dist/index.js +16 -16
  138. package/dist/index.js.map +1 -1
  139. package/dist/preview/components/UrlComponentPreview.d.ts +1 -1
  140. package/dist/preview/components/UserPreview.d.ts +3 -2
  141. package/dist/preview/property_previews/StringPropertyPreview.d.ts +1 -1
  142. package/dist/preview/util.d.ts +1 -1
  143. package/dist/routes/CustomViewRoute.d.ts +1 -1
  144. package/dist/types/components/EntityFormActionsProps.d.ts +2 -2
  145. package/dist/types/components/EntityFormProps.d.ts +3 -3
  146. package/dist/types/fields.d.ts +2 -2
  147. package/dist/util/dataControllerAdapter.d.ts +1 -1
  148. package/dist/util/entity_actions.d.ts +1 -1
  149. package/dist/util/navigation_utils.d.ts +3 -3
  150. package/dist/util/previews.d.ts +22 -4
  151. package/dist/util/property_utils.d.ts +3 -2
  152. package/dist/util/resolutions.d.ts +1 -1
  153. package/dist/util/view_mode.d.ts +3 -3
  154. package/dist/{util-XFwQ9FEc.js → util-CPgUM4M8.js} +353 -221
  155. package/dist/util-CPgUM4M8.js.map +1 -0
  156. package/package.json +11 -9
  157. package/src/collection_editor/ConfigControllerProvider.tsx +11 -12
  158. package/src/collection_editor/api/generateCollectionApi.ts +4 -4
  159. package/src/collection_editor/pgColumnToProperty.ts +4 -3
  160. package/src/collection_editor/serializable_types.ts +36 -34
  161. package/src/collection_editor/serializable_utils.ts +17 -32
  162. package/src/collection_editor/types/collection_editor_controller.tsx +6 -5
  163. package/src/collection_editor/types/collection_inference.ts +3 -2
  164. package/src/collection_editor/types/config_controller.tsx +8 -7
  165. package/src/collection_editor/ui/AddKanbanColumnAction.tsx +3 -2
  166. package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +3 -2
  167. package/src/collection_editor/ui/EditorCollectionAction.tsx +3 -2
  168. package/src/collection_editor/ui/EditorCollectionActionStart.tsx +3 -2
  169. package/src/collection_editor/ui/EditorEntityAction.tsx +3 -2
  170. package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +1 -1
  171. package/src/collection_editor/ui/KanbanSetupAction.tsx +3 -2
  172. package/src/collection_editor/ui/MissingReferenceWidget.tsx +1 -1
  173. package/src/collection_editor/ui/NewCollectionCard.tsx +1 -1
  174. package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +3 -2
  175. package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +6 -5
  176. package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +5 -7
  177. package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +28 -38
  178. package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +4 -3
  179. package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +3 -2
  180. package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +4 -3
  181. package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +4 -3
  182. package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +3 -2
  183. package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +2 -2
  184. package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +3 -2
  185. package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +4 -3
  186. package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +4 -4
  187. package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +4 -4
  188. package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +5 -4
  189. package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +3 -2
  190. package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +4 -3
  191. package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +2 -1
  192. package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +6 -5
  193. package/src/collection_editor/ui/collection_editor/ViewModeSwitch.tsx +1 -1
  194. package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.tsx +3 -2
  195. package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +2 -1
  196. package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +3 -2
  197. package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +3 -2
  198. package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +2 -1
  199. package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +3 -3
  200. package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +3 -3
  201. package/src/collection_editor/ui/collection_editor/templates/products_template.ts +4 -4
  202. package/src/collection_editor/ui/collection_editor/templates/users_template.ts +2 -2
  203. package/src/collection_editor/ui/collection_editor/utils/supported_fields.tsx +1 -1
  204. package/src/collection_editor/ui/collection_editor/utils/update_property_for_widget.ts +10 -8
  205. package/src/collection_editor/useJsonCollectionsConfigController.tsx +10 -9
  206. package/src/collection_editor/useLocalCollectionsConfigController.tsx +5 -5
  207. package/src/collection_editor/validateCollectionJson.ts +4 -5
  208. package/src/components/AdminModeSyncer.tsx +1 -1
  209. package/src/components/ClearFilterSortButton.tsx +1 -1
  210. package/src/components/CollectionPanel.tsx +5 -4
  211. package/src/components/CollectionTableBinding/CollectionRowActions.tsx +6 -6
  212. package/src/components/CollectionTableBinding/CollectionTableBinding.tsx +5 -4
  213. package/src/components/CollectionTableBinding/CollectionTableBindingProps.tsx +3 -2
  214. package/src/components/CollectionTableBinding/PropertyTableCell.tsx +5 -5
  215. package/src/components/CollectionTableBinding/fields/TableMultipleRelationField.tsx +4 -3
  216. package/src/components/CollectionTableBinding/fields/TableReferenceField.tsx +5 -4
  217. package/src/components/CollectionTableBinding/fields/TableRelationField.tsx +4 -3
  218. package/src/components/CollectionTableBinding/internal/common.tsx +8 -7
  219. package/src/components/CollectionTableBinding/internal/popup_field/PopupFormField.tsx +5 -4
  220. package/src/components/CollectionTableBinding/table_bindings.tsx +7 -7
  221. package/src/components/CollectionViewBinding/BoardCardBinding.tsx +6 -5
  222. package/src/components/CollectionViewBinding/CollectionBoardViewBinding.tsx +5 -6
  223. package/src/components/CollectionViewBinding/CollectionCardViewBinding.tsx +4 -3
  224. package/src/components/CollectionViewBinding/CollectionListViewBinding.tsx +10 -13
  225. package/src/components/CollectionViewBinding/CollectionViewActions.tsx +3 -3
  226. package/src/components/CollectionViewBinding/CollectionViewBinding.tsx +17 -16
  227. package/src/components/CollectionViewBinding/CollectionViewStartActions.tsx +3 -3
  228. package/src/components/CollectionViewBinding/EntityCardBinding.tsx +6 -5
  229. package/src/components/CollectionViewBinding/FilterPresetsButton.tsx +2 -1
  230. package/src/components/CollectionViewBinding/FiltersDialog.tsx +2 -2
  231. package/src/components/CollectionViewBinding/SplitListView.tsx +6 -5
  232. package/src/components/CollectionViewBinding/ViewModeToggle.tsx +1 -1
  233. package/src/components/CollectionViewBinding/hooks/useCollectionInlineEditor.ts +3 -2
  234. package/src/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.ts +3 -2
  235. package/src/components/CollectionViewBinding/useBoardDataController.tsx +3 -2
  236. package/src/components/CollectionViewBinding/usePreviewSlots.ts +57 -25
  237. package/src/components/CollectionViewBinding/useSelectionController.tsx +2 -1
  238. package/src/components/DefaultDrawer.tsx +2 -2
  239. package/src/components/DeleteEntityDialog.tsx +3 -2
  240. package/src/components/DetailViewBinding.tsx +23 -18
  241. package/src/components/DrawerNavigationGroup.tsx +1 -1
  242. package/src/components/EditFormActions.tsx +5 -5
  243. package/src/components/EditViewBinding.tsx +11 -15
  244. package/src/components/EntityPreviewBinding.tsx +7 -6
  245. package/src/components/EntityViewBinding.tsx +3 -3
  246. package/src/components/HomePage/ContentHomePage.tsx +2 -2
  247. package/src/components/HomePage/FavouritesView.tsx +1 -1
  248. package/src/components/HomePage/HomePageDnD.tsx +1 -1
  249. package/src/components/HomePage/NavigationCardBinding.tsx +2 -2
  250. package/src/components/PropertyConfigBadge.tsx +2 -1
  251. package/src/components/RebaseAdmin.tsx +1 -1
  252. package/src/components/RebaseAuthGate.tsx +1 -1
  253. package/src/components/RebaseLayout.tsx +1 -1
  254. package/src/components/RebaseNavigation.tsx +4 -3
  255. package/src/components/ReferenceTable/SelectionTableBinding.tsx +6 -5
  256. package/src/components/ReferenceWidget.tsx +3 -2
  257. package/src/components/SelectableTable/SelectableTable.tsx +3 -3
  258. package/src/components/SelectableTable/SelectionStore.ts +1 -1
  259. package/src/components/SelectableTable/filters/FilterFieldBinding.tsx +9 -6
  260. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +3 -2
  261. package/src/components/SideDialogs.tsx +2 -2
  262. package/src/components/SidePanelBinding.tsx +5 -5
  263. package/src/components/SidePanelProvider.tsx +1 -1
  264. package/src/components/admin/CreationResultDialog.tsx +1 -1
  265. package/src/components/common/default_entity_actions.tsx +3 -2
  266. package/src/components/field_configs.tsx +30 -29
  267. package/src/components/history/EntityHistoryEntry.tsx +3 -2
  268. package/src/components/history/EntityHistoryView.tsx +1 -1
  269. package/src/components/history/LastEditedByFormAction.tsx +1 -1
  270. package/src/components/history/LastEditedByIndicator.tsx +3 -2
  271. package/src/contexts/BreacrumbsContext.tsx +1 -1
  272. package/src/contexts/SideDialogsControllerContext.tsx +1 -1
  273. package/src/contexts/SidePanelControllerContext.tsx +1 -1
  274. package/src/data_export/export/ExportCollectionAction.tsx +5 -4
  275. package/src/data_import/components/ImportSaveInProgress.tsx +4 -3
  276. package/src/data_import/import/ImportCollectionAction.tsx +3 -2
  277. package/src/data_import/utils/data.ts +3 -2
  278. package/src/form/EntityForm.tsx +19 -10
  279. package/src/form/EntityFormActions.tsx +3 -3
  280. package/src/form/EntityFormBinding.tsx +6 -4
  281. package/src/form/PropertyFieldBinding.tsx +15 -12
  282. package/src/form/components/FieldHelperText.tsx +1 -1
  283. package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +5 -4
  284. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +7 -6
  285. package/src/form/field_bindings/BlockFieldBinding.tsx +4 -4
  286. package/src/form/field_bindings/DateTimeFieldBinding.tsx +1 -1
  287. package/src/form/field_bindings/KeyValueFieldBinding.tsx +1 -1
  288. package/src/form/field_bindings/MapFieldBinding.tsx +7 -7
  289. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +1 -1
  290. package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +2 -2
  291. package/src/form/field_bindings/ReferenceFieldBinding.tsx +4 -3
  292. package/src/form/field_bindings/RelationFieldBinding.tsx +2 -2
  293. package/src/form/field_bindings/RepeatFieldBinding.tsx +5 -5
  294. package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
  295. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +2 -2
  296. package/src/form/field_bindings/SwitchFieldBinding.tsx +1 -1
  297. package/src/form/field_bindings/TextFieldBinding.tsx +8 -8
  298. package/src/form/field_bindings/UserSelectFieldBinding.tsx +1 -1
  299. package/src/form/form_utils.ts +5 -3
  300. package/src/form/useClearRestoreValue.tsx +1 -1
  301. package/src/form/validation.ts +1 -1
  302. package/src/hooks/index.ts +1 -0
  303. package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +3 -2
  304. package/src/hooks/navigation/contexts/NavigationStateContext.tsx +1 -1
  305. package/src/hooks/navigation/contexts/UrlContext.tsx +1 -1
  306. package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +19 -15
  307. package/src/hooks/navigation/useBuildNavigationStateController.tsx +8 -6
  308. package/src/hooks/navigation/useBuildUrlController.tsx +2 -2
  309. package/src/hooks/navigation/useNavigationResolution.ts +15 -21
  310. package/src/hooks/navigation/useResolvedCollections.ts +10 -9
  311. package/src/hooks/navigation/useResolvedViews.tsx +4 -2
  312. package/src/hooks/navigation/useTopLevelNavigation.ts +3 -2
  313. package/src/hooks/navigation/utils.ts +6 -5
  314. package/src/hooks/useBreadcrumbsController.tsx +1 -1
  315. package/src/hooks/useBuildSidePanel.tsx +9 -12
  316. package/src/hooks/useCMSContext.tsx +8 -4
  317. package/src/hooks/useResolvedNavigationFrom.tsx +7 -5
  318. package/src/hooks/useResolvedUsers.ts +143 -0
  319. package/src/hooks/useSelectionDialog.tsx +3 -2
  320. package/src/hooks/useSideDialogsController.tsx +1 -1
  321. package/src/hooks/useSidePanel.tsx +1 -1
  322. package/src/index.ts +2 -1
  323. package/src/preview/PropertyPreview.tsx +11 -11
  324. package/src/preview/components/ReferencePreview.tsx +6 -5
  325. package/src/preview/components/RelationPreview.tsx +6 -5
  326. package/src/preview/components/UrlComponentPreview.tsx +1 -1
  327. package/src/preview/components/UserPreview.tsx +13 -4
  328. package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +1 -1
  329. package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +1 -1
  330. package/src/preview/property_previews/SkeletonPropertyComponent.tsx +2 -2
  331. package/src/preview/property_previews/StringPropertyPreview.tsx +19 -13
  332. package/src/preview/util.ts +1 -1
  333. package/src/routes/CustomViewRoute.tsx +1 -1
  334. package/src/routes/RebaseRoute.tsx +7 -5
  335. package/src/types/components/EntityFormActionsProps.tsx +3 -2
  336. package/src/types/components/EntityFormProps.tsx +4 -3
  337. package/src/types/fields.tsx +3 -2
  338. package/src/util/dataControllerAdapter.ts +2 -1
  339. package/src/util/entity_actions.ts +1 -1
  340. package/src/util/navigation_utils.ts +4 -13
  341. package/src/util/previews.ts +43 -53
  342. package/src/util/propertyConfigMapper.ts +7 -7
  343. package/src/util/property_utils.tsx +5 -4
  344. package/src/util/resolutions.ts +1 -1
  345. package/src/util/view_mode.ts +4 -3
  346. package/dist/CollectionEditorDialog-BOlKGGg7.js.map +0 -1
  347. package/dist/PropertyEditView-i51tFOfM.js.map +0 -1
  348. package/dist/RouterCollectionsStudioView-Dh4W53PU.js.map +0 -1
  349. package/dist/export-BM6HPujv.js.map +0 -1
  350. package/dist/history-CtIPJxvQ.js.map +0 -1
  351. package/dist/import-DzQnT03v.js.map +0 -1
  352. package/dist/util-XFwQ9FEc.js.map +0 -1
@@ -1,6 +1,7 @@
1
1
 
2
2
  import type { DefaultFieldConfig } from "../types/fields";
3
- import type { ArrayProperty, NumberProperty, Property, PropertyConfig, StringProperty, VectorProperty } from "@rebasepro/types";
3
+ import type { ArrayProperty, NumberProperty, Property, StringProperty, VectorProperty } from "@rebasepro/types";
4
+ import type { PropertyConfig } from "@rebasepro/admin-types";
4
5
  import { ArrayCustomShapedFieldBinding } from "../form/field_bindings/ArrayCustomShapedFieldBinding";
5
6
  import { ArrayOfReferencesFieldBinding } from "../form/field_bindings/ArrayOfReferencesFieldBinding";
6
7
  import { BlockFieldBinding } from "../form/field_bindings/BlockFieldBinding";
@@ -68,7 +69,7 @@ export const DEFAULT_FIELD_CONFIGS: Record<DefaultFieldConfig, PropertyConfig> =
68
69
  color: "#2d7ff9",
69
70
  property: {
70
71
  type: "string",
71
- ui: { get Field() { return TextFieldBinding; } }
72
+ admin: { get Field() { return TextFieldBinding; } }
72
73
  }
73
74
  },
74
75
  multiline: {
@@ -79,7 +80,7 @@ export const DEFAULT_FIELD_CONFIGS: Record<DefaultFieldConfig, PropertyConfig> =
79
80
  color: "#2d7ff9",
80
81
  property: {
81
82
  type: "string",
82
- ui: { multiline: true,
83
+ admin: { multiline: true,
83
84
  get Field() { return TextFieldBinding; } }
84
85
  }
85
86
  },
@@ -91,7 +92,7 @@ get Field() { return TextFieldBinding; } }
91
92
  color: "#2d7ff9",
92
93
  property: {
93
94
  type: "string",
94
- ui: { markdown: true,
95
+ admin: { markdown: true,
95
96
  get Field() { return MarkdownEditorFieldBinding; } }
96
97
  }
97
98
  },
@@ -103,8 +104,8 @@ get Field() { return MarkdownEditorFieldBinding; } }
103
104
  color: "#154fb3",
104
105
  property: {
105
106
  type: "string",
106
- ui: { url: true,
107
- get Field() { return TextFieldBinding; } }
107
+ url: true,
108
+ admin: { get Field() { return TextFieldBinding; } }
108
109
  }
109
110
  },
110
111
  email: {
@@ -116,7 +117,7 @@ get Field() { return TextFieldBinding; } }
116
117
  property: {
117
118
  type: "string",
118
119
  email: true,
119
- ui: { get Field() { return TextFieldBinding; } }
120
+ admin: { get Field() { return TextFieldBinding; } }
120
121
  }
121
122
  },
122
123
  switch: {
@@ -127,7 +128,7 @@ get Field() { return TextFieldBinding; } }
127
128
  color: "#20d9d2",
128
129
  property: {
129
130
  type: "boolean",
130
- ui: { get Field() { return SwitchFieldBinding; } }
131
+ admin: { get Field() { return SwitchFieldBinding; } }
131
132
  }
132
133
  },
133
134
  select: {
@@ -139,7 +140,7 @@ get Field() { return TextFieldBinding; } }
139
140
  property: {
140
141
  type: "string",
141
142
  enum: [],
142
- ui: { get Field() { return SelectFieldBinding; } }
143
+ admin: { get Field() { return SelectFieldBinding; } }
143
144
  }
144
145
  },
145
146
  multi_select: {
@@ -154,7 +155,7 @@ get Field() { return TextFieldBinding; } }
154
155
  type: "string",
155
156
  enum: []
156
157
  },
157
- ui: { get Field() { return MultiSelectFieldBinding; } }
158
+ admin: { get Field() { return MultiSelectFieldBinding; } }
158
159
  }
159
160
  },
160
161
  user_select: {
@@ -164,7 +165,7 @@ get Field() { return TextFieldBinding; } }
164
165
  Icon: UserIcon,
165
166
  property: {
166
167
  type: "string",
167
- ui: { get Field() { return UserSelectFieldBinding; } }
168
+ admin: { get Field() { return UserSelectFieldBinding; } }
168
169
  }
169
170
  },
170
171
  number_input: {
@@ -175,7 +176,7 @@ get Field() { return TextFieldBinding; } }
175
176
  color: "#bec920",
176
177
  property: {
177
178
  type: "number",
178
- ui: { get Field() { return TextFieldBinding; } }
179
+ admin: { get Field() { return TextFieldBinding; } }
179
180
  }
180
181
  },
181
182
  number_select: {
@@ -187,7 +188,7 @@ get Field() { return TextFieldBinding; } }
187
188
  property: {
188
189
  type: "number",
189
190
  enum: [],
190
- ui: { get Field() { return SelectFieldBinding; } }
191
+ admin: { get Field() { return SelectFieldBinding; } }
191
192
  }
192
193
  },
193
194
  multi_number_select: {
@@ -202,7 +203,7 @@ get Field() { return TextFieldBinding; } }
202
203
  type: "number",
203
204
  enum: []
204
205
  },
205
- ui: { get Field() { return MultiSelectFieldBinding; } }
206
+ admin: { get Field() { return MultiSelectFieldBinding; } }
206
207
  }
207
208
  },
208
209
  file_upload: {
@@ -216,7 +217,7 @@ get Field() { return TextFieldBinding; } }
216
217
  storage: {
217
218
  storagePath: "{path}"
218
219
  },
219
- ui: { get Field() { return StorageUploadFieldBinding; } }
220
+ admin: { get Field() { return StorageUploadFieldBinding; } }
220
221
  }
221
222
  },
222
223
  multi_file_upload: {
@@ -233,7 +234,7 @@ get Field() { return TextFieldBinding; } }
233
234
  storagePath: "{path}"
234
235
  }
235
236
  },
236
- ui: { get Field() { return StorageUploadFieldBinding; } }
237
+ admin: { get Field() { return StorageUploadFieldBinding; } }
237
238
  }
238
239
  },
239
240
  reference: {
@@ -244,7 +245,7 @@ get Field() { return TextFieldBinding; } }
244
245
  color: "#ff0042",
245
246
  property: {
246
247
  type: "reference",
247
- ui: { get Field() { return ReferenceFieldBinding; } }
248
+ admin: { get Field() { return ReferenceFieldBinding; } }
248
249
  }
249
250
  },
250
251
  multi_references: {
@@ -258,7 +259,7 @@ get Field() { return TextFieldBinding; } }
258
259
  of: {
259
260
  type: "reference"
260
261
  },
261
- ui: { get Field() { return ArrayOfReferencesFieldBinding; } }
262
+ admin: { get Field() { return ArrayOfReferencesFieldBinding; } }
262
263
  }
263
264
  },
264
265
  relation: {
@@ -270,7 +271,7 @@ get Field() { return TextFieldBinding; } }
270
271
  property: {
271
272
  relationName: "",
272
273
  type: "relation",
273
- ui: { get Field() { return RelationFieldBinding; } }
274
+ admin: { get Field() { return RelationFieldBinding; } }
274
275
  }
275
276
  },
276
277
  date_time: {
@@ -281,7 +282,7 @@ get Field() { return TextFieldBinding; } }
281
282
  color: "#8b46ff",
282
283
  property: {
283
284
  type: "date",
284
- ui: { get Field() { return DateTimeFieldBinding; } }
285
+ admin: { get Field() { return DateTimeFieldBinding; } }
285
286
  }
286
287
  },
287
288
  group: {
@@ -293,7 +294,7 @@ get Field() { return TextFieldBinding; } }
293
294
  property: {
294
295
  type: "map",
295
296
  properties: {},
296
- ui: { get Field() { return MapFieldBinding; } }
297
+ admin: { get Field() { return MapFieldBinding; } }
297
298
  }
298
299
  },
299
300
  key_value: {
@@ -305,7 +306,7 @@ get Field() { return TextFieldBinding; } }
305
306
  property: {
306
307
  type: "map",
307
308
  keyValue: true,
308
- ui: { get Field() { return KeyValueFieldBinding; } }
309
+ admin: { get Field() { return KeyValueFieldBinding; } }
309
310
  }
310
311
  },
311
312
  repeat: {
@@ -319,7 +320,7 @@ get Field() { return TextFieldBinding; } }
319
320
  of: {
320
321
  type: "string"
321
322
  },
322
- ui: { get Field() { return RepeatFieldBinding; } }
323
+ admin: { get Field() { return RepeatFieldBinding; } }
323
324
  }
324
325
  },
325
326
  custom_array: {
@@ -330,7 +331,7 @@ get Field() { return TextFieldBinding; } }
330
331
  color: "#ff9408",
331
332
  property: {
332
333
  type: "array",
333
- ui: { get Field() { return ArrayCustomShapedFieldBinding; } }
334
+ admin: { get Field() { return ArrayCustomShapedFieldBinding; } }
334
335
  }
335
336
  },
336
337
  block: {
@@ -344,7 +345,7 @@ get Field() { return TextFieldBinding; } }
344
345
  oneOf: {
345
346
  properties: {}
346
347
  },
347
- ui: { get Field() { return BlockFieldBinding; } }
348
+ admin: { get Field() { return BlockFieldBinding; } }
348
349
  }
349
350
  },
350
351
  vector_input: {
@@ -356,7 +357,7 @@ get Field() { return TextFieldBinding; } }
356
357
  property: {
357
358
  type: "vector",
358
359
  dimensions: 1536,
359
- ui: { get Field() { return VectorFieldBinding; } }
360
+ admin: { get Field() { return VectorFieldBinding; } }
360
361
  }
361
362
  }
362
363
  };
@@ -384,13 +385,13 @@ export function getFieldConfig(property: Property, propertyConfigs: Record<strin
384
385
 
385
386
  export function getDefaultFieldId(property: Property) {
386
387
  if (property.type === "string") {
387
- if (property.ui?.markdown) {
388
+ if (property.admin?.markdown) {
388
389
  return "markdown";
389
- } else if (property.ui?.multiline) {
390
+ } else if (property.admin?.multiline) {
390
391
  return "multiline";
391
392
  } else if (property.storage) {
392
393
  return "file_upload";
393
- } else if (property.ui?.url) {
394
+ } else if (property.admin?.urlPreview) {
394
395
  return "url";
395
396
  } else if (property.email) {
396
397
  return "email";
@@ -1,4 +1,4 @@
1
- import type { CollectionConfig } from "@rebasepro/types";
1
+
2
2
  import type { Property } from "@rebasepro/types";
3
3
  import * as React from "react";
4
4
 
@@ -11,6 +11,7 @@ import { useAuthController } from "@rebasepro/app";
11
11
  import { UserChip } from "./UserChip";
12
12
  import { HistoryEntryData } from "../../hooks";
13
13
  import { getValueInPath } from "@rebasepro/utils";
14
+ import type { AdminCollection } from "@rebasepro/admin-types";
14
15
 
15
16
  /**
16
17
  * Recursive deep equality for primitives, arrays and plain objects.
@@ -39,7 +40,7 @@ function deepEqual(a: unknown, b: unknown): boolean {
39
40
  export type EntityHistoryEntryProps = {
40
41
  size: PreviewSize;
41
42
  actions?: React.ReactNode;
42
- collection?: CollectionConfig;
43
+ collection?: AdminCollection;
43
44
  hover?: boolean;
44
45
  entry: HistoryEntryData;
45
46
  onClick?: (e: React.SyntheticEvent) => void;
@@ -1,5 +1,5 @@
1
1
 
2
- import type { EntityCustomViewParams } from "@rebasepro/types";
2
+ import type { EntityCustomViewParams } from "@rebasepro/admin-types";
3
3
  import { useRef, useEffect } from "react";
4
4
  import { cls, IconButton, Label, Tooltip, Typography } from "@rebasepro/ui";
5
5
  import { ErrorBoundary, HistoryIcon } from "@rebasepro/ui";
@@ -1,4 +1,4 @@
1
- import type { PluginFormActionProps } from "@rebasepro/types";
1
+ import type { PluginFormActionProps } from "@rebasepro/admin-types";
2
2
  import React from "react";
3
3
  ;
4
4
  import { LastEditedByIndicator } from "./LastEditedByIndicator";
@@ -1,9 +1,10 @@
1
- import type { CollectionConfig } from "@rebasepro/types";
1
+
2
2
  import React, { useEffect, useState, useCallback } from "react";
3
3
  ;
4
4
  import { useApiConfig } from "@rebasepro/app";
5
5
  import { useAuthController } from "@rebasepro/app";
6
6
  import { HistoryEntryData } from "../../hooks";
7
+ import type { AdminCollection } from "@rebasepro/admin-types";
7
8
 
8
9
  function getRelativeTimeString(date: Date): string {
9
10
  const now = new Date();
@@ -31,7 +32,7 @@ export function LastEditedByIndicator({
31
32
  }: {
32
33
  path: string;
33
34
  entityId: string;
34
- collection: CollectionConfig;
35
+ collection: AdminCollection;
35
36
  }) {
36
37
  const apiConfig = useApiConfig();
37
38
  const authController = useAuthController();
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useMemo, useState } from "react";
2
- import type { BreadcrumbEntry, BreadcrumbsController } from "@rebasepro/types";
2
+ import type { BreadcrumbEntry, BreadcrumbsController } from "@rebasepro/admin-types";
3
3
 
4
4
  const DEFAULT_BREADCRUMBS_CONTROLLER: BreadcrumbsController = {
5
5
  breadcrumbs: [],
@@ -1,4 +1,4 @@
1
- import type { SideDialogsController } from "@rebasepro/types";
1
+ import type { SideDialogsController } from "@rebasepro/admin-types";
2
2
  import React from "react";
3
3
  ;
4
4
 
@@ -1,4 +1,4 @@
1
- import type { SidePanelController } from "@rebasepro/types";
1
+ import type { SidePanelController } from "@rebasepro/admin-types";
2
2
  import React from "react";
3
3
  ;
4
4
 
@@ -8,7 +8,8 @@ import {
8
8
  useTranslation
9
9
  } from "@rebasepro/app";
10
10
  import { useCMSContext } from "../../hooks";
11
- import { CollectionActionsProps, Entity, CollectionConfig, ExportConfig, RebaseContext, User } from "@rebasepro/types";
11
+ import { Entity, User } from "@rebasepro/types";
12
+ import { CollectionActionsProps, ExportConfig, RebaseContext, AdminCollection } from "@rebasepro/admin-types";
12
13
  import { getDefaultValuesFor } from "@rebasepro/common";
13
14
  import {
14
15
  Alert,
@@ -38,8 +39,8 @@ export function ExportCollectionAction<M extends Record<string, unknown>, USER e
38
39
  onAnalyticsEvent,
39
40
  exportAllowed,
40
41
  notAllowedView
41
- }: CollectionActionsProps<M, USER, CollectionConfig<M>> & {
42
- exportAllowed?: (props: { collectionEntitiesCount: number, path: string, collection: CollectionConfig }) => boolean;
42
+ }: CollectionActionsProps<M, USER, AdminCollection<M>> & {
43
+ exportAllowed?: (props: { collectionEntitiesCount: number, path: string, collection: AdminCollection }) => boolean;
43
44
  notAllowedView?: React.ReactNode;
44
45
  onAnalyticsEvent?: (event: string, params?: any) => void;
45
46
  }) {
@@ -115,7 +116,7 @@ export function ExportCollectionAction<M extends Record<string, unknown>, USER e
115
116
  return [...resolvedExportColumnsValues, ...resolvedColumnsValues];
116
117
  }, [exportConfig?.additionalFields]);
117
118
 
118
- const doDownload = useCallback(async (collection: CollectionConfig<M>,
119
+ const doDownload = useCallback(async (collection: AdminCollection<M>,
119
120
  exportConfig: ExportConfig<any> | undefined) => {
120
121
 
121
122
  onAnalyticsEvent?.("export_collection", {
@@ -1,11 +1,12 @@
1
1
  import { useData } from "@rebasepro/app";
2
- import { Entity, CollectionConfig } from "@rebasepro/types";
2
+ import { Entity } from "@rebasepro/types";
3
3
  import { RebaseData } from "@rebasepro/types";
4
4
  import { Button, CenteredView, CircularProgress, Typography } from "@rebasepro/ui";
5
5
  import { useEffect, useRef, useState } from "react";
6
6
  import { ImportConfig } from "../types";
7
+ import type { AdminCollection } from "@rebasepro/admin-types";
7
8
 
8
- export function ImportSaveInProgress<C extends CollectionConfig<any>>
9
+ export function ImportSaveInProgress<C extends AdminCollection<any>>
9
10
  ({
10
11
  path,
11
12
  importConfig,
@@ -95,7 +96,7 @@ export function ImportSaveInProgress<C extends CollectionConfig<any>>
95
96
  }
96
97
 
97
98
  function saveDataBatch(dataClient: RebaseData,
98
- collection: CollectionConfig,
99
+ collection: AdminCollection,
99
100
  path: string,
100
101
  data: Partial<Entity<any>>[],
101
102
  offset = 0,
@@ -5,7 +5,8 @@ import {
5
5
  useSnackbarController
6
6
  } from "@rebasepro/app";
7
7
  import { getPropertiesWithPropertiesOrder, getPropertyInPath } from "../../util";
8
- import { CollectionActionsProps, Properties, Property, User, CollectionConfig } from "@rebasepro/types";
8
+ import { Properties, Property, User } from "@rebasepro/types";
9
+ import { CollectionActionsProps, AdminCollection } from "@rebasepro/admin-types";
9
10
  import { getFieldConfig } from "../../components/field_configs";
10
11
  import { PropertyConfigBadge } from "../../components/PropertyConfigBadge";
11
12
  import { useSelectionController } from "../../components/CollectionViewBinding/useSelectionController";
@@ -176,7 +177,7 @@ export function ImportCollectionAction<M extends Record<string, unknown>, USER e
176
177
 
177
178
  {step === "import_data_saving" && importConfig &&
178
179
  <ImportSaveInProgress importConfig={importConfig}
179
- collection={collection as CollectionConfig}
180
+ collection={collection as AdminCollection}
180
181
  path={path}
181
182
  onImportSuccess={(importedCollection) => {
182
183
  handleClose();
@@ -1,5 +1,6 @@
1
1
  import { getPropertyInPath } from "../../util";
2
- import { AuthController, Entity, CollectionConfig, EntityReference, CollectionRegistryController, Properties, Property, Vector } from "@rebasepro/types";
2
+ import { Entity, EntityReference, CollectionRegistryController, Properties, Property, Vector } from "@rebasepro/types";
3
+ import { AuthController, AdminCollection } from "@rebasepro/admin-types";
3
4
  import { isPropertyBuilder } from "@rebasepro/common";
4
5
  import { unflattenObject } from "./file_to_json";
5
6
  import { getIn } from "@rebasepro/forms";
@@ -148,7 +149,7 @@ export function processValueMapping(authController: AuthController, value: any,
148
149
 
149
150
  // If no explicit database was provided in the string, try to get it from the collection
150
151
  if (databaseId === undefined) {
151
- const targetCollection: CollectionConfig<any> | undefined = navigation.getCollection(path);
152
+ const targetCollection: AdminCollection<any> | undefined = navigation.getCollection(path);
152
153
  databaseId = targetCollection?.databaseId;
153
154
  }
154
155
 
@@ -1,6 +1,7 @@
1
- import type { CollectionConfig, EntityCustomViewParams, AdditionalFieldDelegateProps } from "@rebasepro/types";
1
+
2
+ import type { EntityCustomViewParams, AdditionalFieldDelegateProps, AdminCollection } from "@rebasepro/admin-types";
2
3
  import type { FormContext, PropertyFieldBindingProps } from "../types/fields";
3
- import type { PropertyConfig } from "@rebasepro/types";
4
+ import type { PropertyConfig } from "@rebasepro/admin-types";
4
5
  import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
5
6
  import { Entity, EntityStatus, EntityValues } from "@rebasepro/types";
6
7
  import type { EntityFormProps, OnUpdateParams } from "../types/components/EntityFormProps";
@@ -8,7 +9,8 @@ import { deepEqual as equal } from "fast-equals";
8
9
 
9
10
  import { ErrorBoundary } from "@rebasepro/ui";
10
11
  import { AlignLeftIcon, CheckIcon, LoaderIcon, PencilIcon, useDebouncedCallback } from "@rebasepro/ui";
11
- import { getDefaultValuesFor, isHidden, isReadOnly } from "@rebasepro/common";
12
+ import { getDefaultValuesFor } from "@rebasepro/common";
13
+ import { isHidden, isReadOnly } from "@rebasepro/app";
12
14
 
13
15
  import { useCustomizationController } from "@rebasepro/app";
14
16
  import { getFormFieldKeys } from "@rebasepro/app";
@@ -26,7 +28,8 @@ import { EntityFormActions } from "./EntityFormActions";
26
28
  import type { EntityFormActionsProps } from "../types/components/EntityFormActionsProps";
27
29
  import { LocalChangesMenu } from "./components/LocalChangesMenu";
28
30
 
29
- import { getEntityTitlePropertyKey, resolveTitleToString } from "../util/previews";
31
+ import { getEntityTitlePropertyKeyForEntity, isUserSelectProperty, resolveTitleToString } from "../util/previews";
32
+ import { getUserLabel, useResolvedUser } from "../hooks/useResolvedUsers";
30
33
  import { getValueInPath, mergeDeep } from "@rebasepro/utils";
31
34
  import {
32
35
  getChanges,
@@ -313,11 +316,17 @@ export function EntityForm<M extends Record<string, unknown>>({
313
316
 
314
317
  const actionsDisabled = disabled || formex.isSubmitting || (status === "existing" && !formex.dirty) || Boolean(disabledProp);
315
318
 
316
- const titlePropertyKey = getEntityTitlePropertyKey(collection, customizationController.propertyConfigs);
319
+ const titlePropertyKey = getEntityTitlePropertyKeyForEntity(collection, formex.values as Record<string, unknown> | undefined, entityId);
317
320
  const rawTitle = formex.values && titlePropertyKey ? getValueInPath(formex.values, titlePropertyKey) : undefined;
318
- const title = rawTitle !== undefined && rawTitle !== null
319
- ? resolveTitleToString(rawTitle)
320
- : (collection.singularName ?? collection.name);
321
+ // A user picker stores an id: resolve it to the person, like a relation.
322
+ const titleUser = useResolvedUser(isUserSelectProperty(collection, titlePropertyKey) && typeof rawTitle === "string"
323
+ ? rawTitle
324
+ : undefined);
325
+ const title = titleUser
326
+ ? getUserLabel(titleUser)
327
+ : (rawTitle !== undefined && rawTitle !== null
328
+ ? resolveTitleToString(rawTitle)
329
+ : (collection.singularName ?? collection.name));
321
330
 
322
331
  const modified = formex.dirty;
323
332
 
@@ -387,10 +396,10 @@ export function EntityForm<M extends Record<string, unknown>>({
387
396
  const isNew = status === "new" || status === "copy";
388
397
  const isStringOrNumber = property.type === "string" || property.type === "number";
389
398
  const isIdAndAuto = isStringOrNumber && "isId" in property && typeof property.isId === "string" && property.isId !== "manual";
390
- const disabled = disabledProp || (!autoSave && formex.isSubmitting) || isReadOnly(property) || Boolean(property.ui?.disabled) || (!isNew && "isId" in property && Boolean(property.isId)) || (isNew && isIdAndAuto);
399
+ const disabled = disabledProp || (!autoSave && formex.isSubmitting) || isReadOnly(property) || Boolean(property.admin?.disabled) || (!isNew && "isId" in property && Boolean(property.isId)) || (isNew && isIdAndAuto);
391
400
  const hidden = isHidden(property);
392
401
  if (hidden) return null;
393
- const widthPercentage = property.ui?.widthPercentage ?? 100;
402
+ const widthPercentage = property.admin?.widthPercentage ?? 100;
394
403
 
395
404
  const shouldAutoFocus = isNewEntity && !disabled && firstFocusableIndex === -1;
396
405
  if (shouldAutoFocus) firstFocusableIndex = 0;
@@ -1,7 +1,7 @@
1
1
 
2
- import { type CollectionConfig, getCollectionDataPath } from "@rebasepro/types";
2
+ import { getCollectionDataPath } from "@rebasepro/types";
3
3
  import type { FormContext } from "../types/fields";
4
- import type { EntityAction } from "@rebasepro/types";
4
+ import type { EntityAction, AdminCollection } from "@rebasepro/admin-types";
5
5
  import React from "react";
6
6
  import { Entity } from "@rebasepro/types";
7
7
  import type { EntityFormActionsProps } from "../types/components/EntityFormActionsProps";
@@ -81,7 +81,7 @@ type ActionsViewProps<M extends Record<string, unknown>> = {
81
81
  savingError: Error | undefined,
82
82
  entity: Entity<M> | undefined,
83
83
  formActions?: EntityAction[],
84
- collection: CollectionConfig,
84
+ collection: AdminCollection,
85
85
  disabled: boolean,
86
86
  status: "new" | "existing" | "copy",
87
87
  pluginActions?: React.ReactNode[],
@@ -1,11 +1,13 @@
1
- import type { CollectionConfig, PluginFormActionProps } from "@rebasepro/types";
1
+
2
+ import type { PluginFormActionProps, AdminCollection } from "@rebasepro/admin-types";
2
3
  import type { FormContext } from "../types/fields";
3
4
  import React, { useCallback, useMemo, useState } from "react";
4
- import { AnalyticsEvent, Entity, EntityStatus, EntityValues } from "@rebasepro/types";
5
+ import { Entity, EntityStatus, EntityValues } from "@rebasepro/types";
6
+ import { AnalyticsEvent } from "@rebasepro/admin-types";
5
7
  import type { EntityFormProps, OnUpdateParams } from "../types/components/EntityFormProps";
6
8
  import type { EntityFormActionsProps } from "../types/components/EntityFormActionsProps";
7
9
 
8
- import { getLocalChangesBackup } from "@rebasepro/common";
10
+ import { getLocalChangesBackup } from "@rebasepro/app";
9
11
 
10
12
  import {
11
13
  saveEntityWithCallbacks,
@@ -278,7 +280,7 @@ export function EntityFormBinding<M extends Record<string, unknown>>({
278
280
  parentEntityIds,
279
281
  path,
280
282
  status,
281
- collection: collection as CollectionConfig,
283
+ collection: collection as AdminCollection,
282
284
  context,
283
285
  formContext: undefined as unknown as FormContext<Record<string, unknown>>,
284
286
  openEntityMode,
@@ -1,6 +1,8 @@
1
- import type { CollectionConfig, FieldProps as CoreFieldProps } from "@rebasepro/types";
1
+
2
+ import type { FieldProps as CoreFieldProps, AdminCollection } from "@rebasepro/admin-types";
2
3
  import type { FieldProps, PropertyFieldBindingProps } from "../types/fields";
3
- import type { RebasePlugin, PluginFieldBuilderParams, Property } from "@rebasepro/types";
4
+ import type { Property } from "@rebasepro/types";
5
+ import type { RebasePlugin, PluginFieldBuilderParams } from "@rebasepro/admin-types";
4
6
  import React, { ComponentType, ReactElement, Suspense, useCallback, useRef } from "react";
5
7
  import { deepEqual as equal } from "fast-equals"
6
8
 
@@ -11,7 +13,8 @@ import { Field, FormexFieldProps, getIn } from "@rebasepro/forms";
11
13
  ;
12
14
  import { ReadOnlyFieldBinding } from "./field_bindings/ReadOnlyFieldBinding";
13
15
 
14
- import { isHidden, isPropertyBuilder, isReadOnly, resolveProperty } from "@rebasepro/common";
16
+ import { isPropertyBuilder, resolveProperty } from "@rebasepro/common";
17
+ import { isHidden, isReadOnly } from "@rebasepro/app";
15
18
  import { useAuthController, useCustomizationController } from "@rebasepro/app";
16
19
  import { Typography } from "@rebasepro/ui";
17
20
  import { getFieldConfig, getFieldId } from "../components/field_configs";
@@ -29,7 +32,7 @@ import { ErrorBoundary } from "@rebasepro/ui";
29
32
  *
30
33
  * Please note that if you build a custom field in a component, the
31
34
  * **validation** passed in the property will have no effect. You need to set
32
- * the validation in the `CollectionConfig` definition.
35
+ * the validation in the `AdminCollection` definition.
33
36
  *
34
37
  * @param propertyKey You can use nested names such as `address.street` or `friends[2]`
35
38
  * @param property
@@ -109,14 +112,14 @@ function PropertyFieldBindingInternal<M extends Record<string, unknown> = Record
109
112
  }) as Property | null;
110
113
 
111
114
  const readOnly = resolvedProperty ? isReadOnly(resolvedProperty) : true;
112
- const disabled = disabledProp || readOnly || Boolean(resolvedProperty?.ui?.disabled) || context.disabled;
115
+ const disabled = disabledProp || readOnly || Boolean(resolvedProperty?.admin?.disabled) || context.disabled;
113
116
 
114
117
  if (resolvedProperty === null || isHidden(resolvedProperty)) {
115
118
  return <></>;
116
119
  } else if (readOnly) {
117
120
  Component = ReadOnlyFieldBinding;
118
- } else if (resolvedProperty.ui?.Field) {
119
- const resolved = resolveComponentRef(resolvedProperty.ui.Field);
121
+ } else if (resolvedProperty.admin?.Field) {
122
+ const resolved = resolveComponentRef(resolvedProperty.admin.Field);
120
123
  if (resolved) {
121
124
  Component = resolved as ComponentType<FieldProps<Property, any, any>>;
122
125
  }
@@ -135,7 +138,7 @@ function PropertyFieldBindingInternal<M extends Record<string, unknown> = Record
135
138
  index,
136
139
  authController
137
140
  }) as Property | null;
138
- Component = resolveComponentRef(configProperty?.ui?.Field) as ComponentType<FieldProps<Property, any, any>> | undefined;
141
+ Component = resolveComponentRef(configProperty?.admin?.Field) as ComponentType<FieldProps<Property, any, any>> | undefined;
139
142
  }
140
143
  if (!Component) {
141
144
  console.warn(`No field component found for property ${propertyKey}`);
@@ -205,7 +208,7 @@ function FieldInternal<CustomProps, M extends Record<string, unknown>>
205
208
 
206
209
  const { plugins } = useCustomizationController();
207
210
 
208
- const customFieldProps: unknown = property.ui?.customProps;
211
+ const customFieldProps: unknown = property.admin?.customProps;
209
212
  const value = formexFieldProps.field.value;
210
213
  const error = getIn(formexFieldProps.form.errors, propertyKey) as string | string[] | undefined;
211
214
  const touched = getIn(formexFieldProps.form.touched, propertyKey) as boolean | undefined;
@@ -282,7 +285,7 @@ const shouldPropertyReRender = (property: Property, plugins?: RebasePlugin[]): b
282
285
  return true;
283
286
  }
284
287
  const defAProperty = property as Property;
285
- const rerenderThisProperty = Boolean(defAProperty.ui?.Field);
288
+ const rerenderThisProperty = Boolean(defAProperty.admin?.Field);
286
289
  if (defAProperty.type === "map" && defAProperty.properties) {
287
290
  return Boolean(rerenderThisProperty || Object.values(defAProperty.properties).some((childProperty) => shouldPropertyReRender(childProperty as Property, plugins)));
288
291
  } else {
@@ -292,7 +295,7 @@ const shouldPropertyReRender = (property: Property, plugins?: RebasePlugin[]): b
292
295
 
293
296
  interface UseWrappedComponentParams<M extends Record<string, unknown> = Record<string, unknown>> {
294
297
  path?: string,
295
- collection?: CollectionConfig<M>,
298
+ collection?: AdminCollection<M>,
296
299
  propertyKey: string,
297
300
  property: Property,
298
301
  Component: ComponentType<FieldProps<Property, unknown, M>>,
@@ -323,7 +326,7 @@ function useWrappedComponent<T, M extends Record<string, unknown> = Record<strin
323
326
  Field: Component as unknown as ComponentType<CoreFieldProps<Property, unknown, Record<string, unknown>>>,
324
327
  plugin,
325
328
  path,
326
- collection: collection as CollectionConfig | undefined
329
+ collection: collection as AdminCollection | undefined
327
330
  };
328
331
  const enabled = plugin.fieldBuilder.enabled?.(params);
329
332
  if (enabled === undefined || enabled)
@@ -71,7 +71,7 @@ export function FieldHelperText<T>({
71
71
  </Typography>
72
72
  }
73
73
 
74
- const disabledTooltip: string | undefined = typeof property.ui?.disabled === "object" ? property.ui?.disabled.disabledMessage : undefined;
74
+ const disabledTooltip: string | undefined = typeof property.admin?.disabled === "object" ? property.admin?.disabled.disabledMessage : undefined;
75
75
 
76
76
  return <div className={"flex ml-3.5 mt-1"}>
77
77
  <Typography variant={"caption"}