@rebasepro/admin 0.7.0 → 0.9.0

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 (350) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -20
  3. package/dist/{CollectionEditorDialog-iGgS4rLX.js → CollectionEditorDialog-B-7uW3iJ.js} +15 -15
  4. package/dist/CollectionEditorDialog-B-7uW3iJ.js.map +1 -0
  5. package/dist/{PropertyEditView-C9yhLyja.js → PropertyEditView-7KMTcrqi.js} +140 -106
  6. package/dist/PropertyEditView-7KMTcrqi.js.map +1 -0
  7. package/dist/{RouterCollectionsStudioView-Dqx27GD8.js → RouterCollectionsStudioView-epqIbZrJ.js} +4 -4
  8. package/dist/{RouterCollectionsStudioView-Dqx27GD8.js.map → RouterCollectionsStudioView-epqIbZrJ.js.map} +1 -1
  9. package/dist/collection_editor/_cms_internals.d.ts +4 -4
  10. package/dist/collection_editor/api/generateCollectionApi.d.ts +7 -6
  11. package/dist/collection_editor/extensibility_types.d.ts +3 -3
  12. package/dist/collection_editor/index.d.ts +2 -2
  13. package/dist/collection_editor/pgColumnToProperty.d.ts +3 -3
  14. package/dist/collection_editor/serializable_types.d.ts +12 -16
  15. package/dist/collection_editor/serializable_utils.d.ts +8 -8
  16. package/dist/collection_editor/types/collection_editor_controller.d.ts +5 -5
  17. package/dist/collection_editor/types/collection_inference.d.ts +2 -2
  18. package/dist/collection_editor/types/config_controller.d.ts +7 -7
  19. package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -2
  20. package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +2 -2
  21. package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -2
  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 +4 -5
  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 +4 -4
  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 +4 -4
  35. package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +3 -3
  36. package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +2 -2
  37. package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +2 -2
  38. package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +2 -2
  39. package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +2 -2
  40. package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +2 -2
  41. package/dist/collection_editor/validateCollectionJson.d.ts +2 -2
  42. package/dist/collection_editor_ui.js +4 -4
  43. package/dist/components/CollectionPanel.d.ts +4 -4
  44. package/dist/components/{EntityCollectionTable/EntityCollectionRowActions.d.ts → CollectionTableBinding/CollectionRowActions.d.ts} +3 -3
  45. package/dist/components/CollectionTableBinding/CollectionTableBinding.d.ts +28 -0
  46. package/dist/components/{EntityCollectionTable/EntityCollectionTableProps.d.ts → CollectionTableBinding/CollectionTableBindingProps.d.ts} +1 -1
  47. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableMultipleRelationField.d.ts +2 -2
  48. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableReferenceField.d.ts +2 -2
  49. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationField.d.ts +2 -2
  50. package/dist/components/CollectionTableBinding/index.d.ts +6 -0
  51. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/common.d.ts +2 -2
  52. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/PopupFormField.d.ts +2 -2
  53. package/dist/components/{EntityCollectionView/EntityBoardCard.d.ts → CollectionViewBinding/BoardCardBinding.d.ts} +8 -8
  54. package/dist/components/{EntityCollectionView/EntityCollectionBoardView.d.ts → CollectionViewBinding/CollectionBoardViewBinding.d.ts} +4 -4
  55. package/dist/components/{EntityCollectionView/EntityCollectionCardView.d.ts → CollectionViewBinding/CollectionCardViewBinding.d.ts} +5 -5
  56. package/dist/components/{EntityCollectionView/EntityCollectionListView.d.ts → CollectionViewBinding/CollectionListViewBinding.d.ts} +4 -4
  57. package/dist/components/{EntityCollectionView/EntityCollectionViewActions.d.ts → CollectionViewBinding/CollectionViewActions.d.ts} +4 -4
  58. package/dist/components/{EntityCollectionView/EntityCollectionView.d.ts → CollectionViewBinding/CollectionViewBinding.d.ts} +4 -4
  59. package/dist/components/{EntityCollectionView/EntityCollectionViewStartActions.d.ts → CollectionViewBinding/CollectionViewStartActions.d.ts} +4 -4
  60. package/dist/components/CollectionViewBinding/EntityCardBinding.d.ts +21 -0
  61. package/dist/components/{EntityCollectionView → CollectionViewBinding}/SplitListView.d.ts +3 -3
  62. package/dist/components/{EntityCollectionView → CollectionViewBinding}/hooks/useCollectionInlineEditor.d.ts +2 -2
  63. package/dist/components/{EntityCollectionView → CollectionViewBinding}/hooks/useKanbanDragAndDrop.d.ts +2 -2
  64. package/dist/components/{EntityCollectionView → CollectionViewBinding}/useBoardDataController.d.ts +2 -2
  65. package/dist/components/{EntityCollectionView/useEntityPreviewSlots.d.ts → CollectionViewBinding/usePreviewSlots.d.ts} +5 -5
  66. package/dist/components/DeleteEntityDialog.d.ts +4 -4
  67. package/dist/components/{EntityDetailView.d.ts → DetailViewBinding.d.ts} +5 -5
  68. package/dist/components/EditFormActions.d.ts +3 -0
  69. package/dist/components/{EntityEditView.d.ts → EditViewBinding.d.ts} +9 -9
  70. package/dist/components/{EntityPreview.d.ts → EntityPreviewBinding.d.ts} +13 -13
  71. package/dist/components/EntityViewBinding.d.ts +13 -0
  72. package/dist/components/{EntityJsonPreview.d.ts → JsonPreviewBinding.d.ts} +1 -1
  73. package/dist/components/RebaseCMS.d.ts +1 -1
  74. package/dist/components/RebaseNavigation.d.ts +1 -1
  75. package/dist/components/ReferenceTable/{EntitySelectionTable.d.ts → SelectionTableBinding.d.ts} +5 -5
  76. package/dist/components/SelectableTable/SelectableTable.d.ts +5 -5
  77. package/dist/components/SelectableTable/SelectableTableContext.d.ts +3 -3
  78. package/dist/components/SelectableTable/SelectionStore.d.ts +13 -22
  79. package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +6 -1
  80. package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +7 -1
  81. package/dist/components/SelectableTable/filters/FilterFieldBinding.d.ts +40 -0
  82. package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +7 -1
  83. package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +7 -1
  84. package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +7 -1
  85. package/dist/components/SideDialogs.d.ts +1 -1
  86. package/dist/components/SidePanelBinding.d.ts +11 -0
  87. package/dist/components/{SideEntityProvider.d.ts → SidePanelProvider.d.ts} +7 -7
  88. package/dist/components/field_configs.d.ts +1 -1
  89. package/dist/components/history/EntityHistoryEntry.d.ts +2 -2
  90. package/dist/components/history/LastEditedByIndicator.d.ts +2 -2
  91. package/dist/components/index.d.ts +14 -13
  92. package/dist/contexts/SidePanelControllerContext.d.ts +3 -0
  93. package/dist/data_export/export/ExportCollectionAction.d.ts +3 -3
  94. package/dist/data_import/components/ImportSaveInProgress.d.ts +2 -2
  95. package/dist/editor/editor.d.ts +0 -6
  96. package/dist/editor.js +1 -3
  97. package/dist/editor.js.map +1 -1
  98. package/dist/form/EntityForm.d.ts +1 -1
  99. package/dist/form/PropertyFieldBinding.d.ts +1 -1
  100. package/dist/form/components/StorageUploadProgress.d.ts +6 -1
  101. package/dist/form/form_utils.d.ts +2 -2
  102. package/dist/form/index.d.ts +0 -1
  103. package/dist/{history-ChHgyyvM.js → history-7X5bON_n.js} +4 -4
  104. package/dist/history-7X5bON_n.js.map +1 -0
  105. package/dist/hooks/index.d.ts +4 -4
  106. package/dist/hooks/navigation/contexts/CollectionRegistryContext.d.ts +2 -2
  107. package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +5 -5
  108. package/dist/hooks/navigation/useNavigationResolution.d.ts +4 -4
  109. package/dist/hooks/navigation/useResolvedCollections.d.ts +7 -7
  110. package/dist/hooks/navigation/useTopLevelNavigation.d.ts +2 -2
  111. package/dist/hooks/navigation/utils.d.ts +5 -5
  112. package/dist/hooks/useBuildSidePanel.d.ts +6 -0
  113. package/dist/hooks/useCMSContext.d.ts +2 -2
  114. package/dist/hooks/{useEntityHistory.d.ts → useHistory.d.ts} +1 -1
  115. package/dist/hooks/useResolvedNavigationFrom.d.ts +3 -3
  116. package/dist/hooks/{useEntitySelectionDialog.d.ts → useSelectionDialog.d.ts} +2 -2
  117. package/dist/hooks/useSideDialogsController.d.ts +1 -1
  118. package/dist/hooks/useSidePanel.d.ts +11 -0
  119. package/dist/index.d.ts +3 -3
  120. package/dist/index.js +2 -2
  121. package/dist/preview/components/StorageThumbnail.d.ts +3 -1
  122. package/dist/{src-DOX2nOyh.js → src-sUZfe29F.js} +904 -1096
  123. package/dist/src-sUZfe29F.js.map +1 -0
  124. package/dist/types/components/EntityFormActionsProps.d.ts +2 -2
  125. package/dist/types/components/EntityFormProps.d.ts +3 -3
  126. package/dist/types/components/PropertyPreviewProps.d.ts +2 -1
  127. package/dist/types/fields.d.ts +6 -8
  128. package/dist/util/dataControllerAdapter.d.ts +2 -5
  129. package/dist/util/navigation_utils.d.ts +6 -6
  130. package/dist/util/previews.d.ts +3 -3
  131. package/dist/util/property_utils.d.ts +2 -2
  132. package/dist/util/{entity_view_constants.d.ts → view_constants.d.ts} +1 -1
  133. package/package.json +18 -18
  134. package/src/collection_editor/ConfigControllerProvider.tsx +10 -10
  135. package/src/collection_editor/_cms_internals.ts +4 -4
  136. package/src/collection_editor/api/generateCollectionApi.ts +7 -6
  137. package/src/collection_editor/extensibility_types.ts +3 -3
  138. package/src/collection_editor/index.ts +3 -3
  139. package/src/collection_editor/pgColumnToProperty.ts +4 -4
  140. package/src/collection_editor/serializable_types.ts +22 -35
  141. package/src/collection_editor/serializable_utils.ts +40 -52
  142. package/src/collection_editor/types/collection_editor_controller.tsx +5 -5
  143. package/src/collection_editor/types/collection_inference.ts +2 -2
  144. package/src/collection_editor/types/config_controller.tsx +7 -7
  145. package/src/collection_editor/ui/AddKanbanColumnAction.tsx +2 -2
  146. package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +2 -2
  147. package/src/collection_editor/ui/EditorCollectionAction.tsx +2 -2
  148. package/src/collection_editor/ui/EditorCollectionActionStart.tsx +2 -2
  149. package/src/collection_editor/ui/EditorEntityAction.tsx +2 -2
  150. package/src/collection_editor/ui/KanbanSetupAction.tsx +2 -2
  151. package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +2 -2
  152. package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +5 -5
  153. package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +3 -3
  154. package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +63 -46
  155. package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +3 -3
  156. package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +2 -2
  157. package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +8 -8
  158. package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +2 -2
  159. package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +2 -2
  160. package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +2 -2
  161. package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +2 -2
  162. package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +2 -2
  163. package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +3 -3
  164. package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +5 -5
  165. package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +4 -4
  166. package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +2 -2
  167. package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +7 -16
  168. package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +45 -36
  169. package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +1 -1
  170. package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +5 -5
  171. package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +3 -3
  172. package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.tsx +2 -2
  173. package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +2 -2
  174. package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +35 -1
  175. package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +3 -3
  176. package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +2 -2
  177. package/src/collection_editor/ui/collection_editor/templates/products_template.ts +2 -2
  178. package/src/collection_editor/ui/collection_editor/templates/users_template.ts +2 -2
  179. package/src/collection_editor/ui/collection_editor/utils/supported_fields.tsx +0 -1
  180. package/src/collection_editor/ui/collection_editor/utils/update_property_for_widget.ts +7 -29
  181. package/src/collection_editor/useJsonCollectionsConfigController.tsx +14 -14
  182. package/src/collection_editor/useLocalCollectionsConfigController.tsx +4 -4
  183. package/src/collection_editor/validateCollectionJson.ts +3 -3
  184. package/src/components/CollectionPanel.tsx +14 -17
  185. package/src/components/{EntityCollectionTable/EntityCollectionRowActions.tsx → CollectionTableBinding/CollectionRowActions.tsx} +6 -6
  186. package/src/components/{EntityCollectionTable/EntityCollectionTable.tsx → CollectionTableBinding/CollectionTableBinding.tsx} +19 -17
  187. package/src/components/{EntityCollectionTable/EntityCollectionTableProps.tsx → CollectionTableBinding/CollectionTableBindingProps.tsx} +1 -1
  188. package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableMultipleRelationField.tsx +7 -6
  189. package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableReferenceField.tsx +10 -10
  190. package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationField.tsx +7 -6
  191. package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableStorageUpload.tsx +23 -20
  192. package/src/components/CollectionTableBinding/index.tsx +14 -0
  193. package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/common.tsx +2 -2
  194. package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/PopupFormField.tsx +2 -2
  195. package/src/components/{EntityCollectionTable → CollectionTableBinding}/table_bindings.tsx +24 -44
  196. package/src/components/{EntityCollectionView/EntityBoardCard.tsx → CollectionViewBinding/BoardCardBinding.tsx} +15 -15
  197. package/src/components/{EntityCollectionView/EntityCollectionBoardView.tsx → CollectionViewBinding/CollectionBoardViewBinding.tsx} +15 -14
  198. package/src/components/{EntityCollectionView/EntityCollectionCardView.tsx → CollectionViewBinding/CollectionCardViewBinding.tsx} +8 -8
  199. package/src/components/{EntityCollectionView/EntityCollectionListView.tsx → CollectionViewBinding/CollectionListViewBinding.tsx} +24 -13
  200. package/src/components/{EntityCollectionView/EntityCollectionViewActions.tsx → CollectionViewBinding/CollectionViewActions.tsx} +5 -5
  201. package/src/components/{EntityCollectionView/EntityCollectionView.tsx → CollectionViewBinding/CollectionViewBinding.tsx} +112 -114
  202. package/src/components/{EntityCollectionView/EntityCollectionViewStartActions.tsx → CollectionViewBinding/CollectionViewStartActions.tsx} +5 -5
  203. package/src/components/{EntityCollectionView/EntityCard.tsx → CollectionViewBinding/EntityCardBinding.tsx} +9 -9
  204. package/src/components/{EntityCollectionView → CollectionViewBinding}/FiltersDialog.tsx +31 -72
  205. package/src/components/{EntityCollectionView → CollectionViewBinding}/SplitListView.tsx +9 -9
  206. package/src/components/{EntityCollectionView → CollectionViewBinding}/hooks/useCollectionInlineEditor.ts +6 -6
  207. package/src/components/{EntityCollectionView → CollectionViewBinding}/hooks/useKanbanDragAndDrop.ts +4 -4
  208. package/src/components/{EntityCollectionView → CollectionViewBinding}/useBoardDataController.tsx +28 -50
  209. package/src/components/{EntityCollectionView/useEntityPreviewSlots.ts → CollectionViewBinding/usePreviewSlots.ts} +11 -11
  210. package/src/components/DefaultDrawer.tsx +1 -1
  211. package/src/components/DeleteEntityDialog.tsx +6 -6
  212. package/src/components/{EntityDetailView.tsx → DetailViewBinding.tsx} +28 -31
  213. package/src/components/{EntityEditViewFormActions.tsx → EditFormActions.tsx} +15 -15
  214. package/src/components/{EntityEditView.tsx → EditViewBinding.tsx} +31 -34
  215. package/src/components/{EntityPreview.tsx → EntityPreviewBinding.tsx} +27 -27
  216. package/src/components/{EntityView.tsx → EntityViewBinding.tsx} +5 -5
  217. package/src/components/HomePage/ContentHomePage.tsx +1 -1
  218. package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
  219. package/src/components/{EntityJsonPreview.tsx → JsonPreviewBinding.tsx} +1 -1
  220. package/src/components/RebaseCMS.tsx +4 -4
  221. package/src/components/RebaseNavigation.tsx +20 -10
  222. package/src/components/ReferenceTable/{EntitySelectionTable.tsx → SelectionTableBinding.tsx} +22 -19
  223. package/src/components/ReferenceWidget.tsx +4 -4
  224. package/src/components/RelationSelector.tsx +16 -14
  225. package/src/components/SelectableTable/SelectableTable.tsx +44 -89
  226. package/src/components/SelectableTable/SelectableTableContext.tsx +3 -3
  227. package/src/components/SelectableTable/SelectionStore.ts +22 -52
  228. package/src/components/SelectableTable/filters/BooleanFilterField.tsx +9 -1
  229. package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +33 -12
  230. package/src/components/SelectableTable/filters/FilterFieldBinding.tsx +187 -0
  231. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +21 -7
  232. package/src/components/SelectableTable/filters/RelationFilterField.tsx +17 -3
  233. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +66 -12
  234. package/src/components/SideDialogs.tsx +3 -3
  235. package/src/components/{EntitySidePanel.tsx → SidePanelBinding.tsx} +19 -19
  236. package/src/components/{SideEntityProvider.tsx → SidePanelProvider.tsx} +16 -16
  237. package/src/components/common/default_entity_actions.tsx +24 -13
  238. package/src/components/field_configs.tsx +0 -14
  239. package/src/components/history/EntityHistoryEntry.tsx +2 -2
  240. package/src/components/history/EntityHistoryView.tsx +3 -3
  241. package/src/components/history/LastEditedByIndicator.tsx +2 -2
  242. package/src/components/index.ts +15 -14
  243. package/src/contexts/SidePanelControllerContext.tsx +5 -0
  244. package/src/data_export/export/ExportCollectionAction.tsx +4 -4
  245. package/src/data_import/components/ImportSaveInProgress.tsx +3 -3
  246. package/src/data_import/import/ImportCollectionAction.tsx +4 -4
  247. package/src/data_import/utils/data.ts +2 -2
  248. package/src/editor/editor.tsx +4 -7
  249. package/src/form/EntityForm.tsx +2 -2
  250. package/src/form/EntityFormActions.tsx +4 -4
  251. package/src/form/EntityFormBinding.tsx +7 -7
  252. package/src/form/PropertyFieldBinding.tsx +4 -4
  253. package/src/form/components/StorageUploadProgress.tsx +9 -2
  254. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +4 -4
  255. package/src/form/field_bindings/KeyValueFieldBinding.tsx +19 -19
  256. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +12 -1
  257. package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +6 -6
  258. package/src/form/field_bindings/ReferenceFieldBinding.tsx +5 -5
  259. package/src/form/field_bindings/RelationFieldBinding.tsx +8 -10
  260. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +19 -15
  261. package/src/form/form_utils.ts +2 -2
  262. package/src/form/index.tsx +0 -1
  263. package/src/hooks/index.ts +4 -4
  264. package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +2 -2
  265. package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +11 -11
  266. package/src/hooks/navigation/useBuildNavigationStateController.tsx +5 -5
  267. package/src/hooks/navigation/useNavigationResolution.ts +10 -10
  268. package/src/hooks/navigation/useResolvedCollections.ts +8 -8
  269. package/src/hooks/navigation/useTopLevelNavigation.ts +2 -2
  270. package/src/hooks/navigation/utils.ts +5 -5
  271. package/src/hooks/{useBuildSideEntityController.tsx → useBuildSidePanel.tsx} +28 -28
  272. package/src/hooks/useCMSContext.tsx +6 -6
  273. package/src/hooks/{useEntityHistory.ts → useHistory.ts} +1 -1
  274. package/src/hooks/useResolvedNavigationFrom.tsx +8 -5
  275. package/src/hooks/{useEntitySelectionDialog.tsx → useSelectionDialog.tsx} +7 -7
  276. package/src/hooks/useSideDialogsController.tsx +1 -1
  277. package/src/hooks/useSidePanel.tsx +13 -0
  278. package/src/index.ts +13 -13
  279. package/src/preview/PropertyPreview.tsx +1 -16
  280. package/src/preview/components/ReferencePreview.tsx +10 -10
  281. package/src/preview/components/RelationPreview.tsx +13 -12
  282. package/src/preview/components/StorageThumbnail.tsx +24 -7
  283. package/src/routes/RebaseRoute.tsx +10 -10
  284. package/src/types/components/EntityFormActionsProps.tsx +2 -2
  285. package/src/types/components/EntityFormProps.tsx +3 -3
  286. package/src/types/components/PropertyPreviewProps.tsx +1 -1
  287. package/src/types/fields.tsx +4 -9
  288. package/src/util/dataControllerAdapter.ts +9 -15
  289. package/src/util/navigation_utils.ts +7 -7
  290. package/src/util/previews.ts +23 -3
  291. package/src/util/propertyConfigMapper.ts +3 -3
  292. package/src/util/property_utils.tsx +2 -3
  293. package/src/util/{entity_view_constants.ts → view_constants.ts} +1 -1
  294. package/dist/CollectionEditorDialog-iGgS4rLX.js.map +0 -1
  295. package/dist/PropertyEditView-C9yhLyja.js.map +0 -1
  296. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +0 -28
  297. package/dist/components/EntityCollectionTable/fields/VirtualTableDateField.d.ts +0 -12
  298. package/dist/components/EntityCollectionTable/fields/VirtualTableInput.d.ts +0 -10
  299. package/dist/components/EntityCollectionTable/fields/VirtualTableNumberInput.d.ts +0 -9
  300. package/dist/components/EntityCollectionTable/fields/VirtualTableSwitch.d.ts +0 -8
  301. package/dist/components/EntityCollectionTable/index.d.ts +0 -6
  302. package/dist/components/EntityCollectionView/EntityCard.d.ts +0 -21
  303. package/dist/components/EntityEditViewFormActions.d.ts +0 -3
  304. package/dist/components/EntitySidePanel.d.ts +0 -11
  305. package/dist/components/EntityView.d.ts +0 -13
  306. package/dist/contexts/SideEntityControllerContext.d.ts +0 -3
  307. package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +0 -11
  308. package/dist/history-ChHgyyvM.js.map +0 -1
  309. package/dist/hooks/useBuildSideEntityController.d.ts +0 -6
  310. package/dist/hooks/useSideEntityController.d.ts +0 -11
  311. package/dist/src-DOX2nOyh.js.map +0 -1
  312. package/src/components/EntityCollectionTable/fields/VirtualTableDateField.tsx +0 -39
  313. package/src/components/EntityCollectionTable/fields/VirtualTableInput.tsx +0 -90
  314. package/src/components/EntityCollectionTable/fields/VirtualTableNumberInput.tsx +0 -83
  315. package/src/components/EntityCollectionTable/fields/VirtualTableSwitch.tsx +0 -32
  316. package/src/components/EntityCollectionTable/index.tsx +0 -14
  317. package/src/contexts/SideEntityControllerContext.tsx +0 -5
  318. package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +0 -141
  319. package/src/hooks/useSideEntityController.tsx +0 -13
  320. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/PropertyTableCell.d.ts +0 -0
  321. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/column_utils.d.ts +0 -0
  322. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationSelectorField.d.ts +0 -0
  323. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableStorageUpload.d.ts +0 -0
  324. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableSelect.d.ts +0 -0
  325. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableUserSelect.d.ts +0 -0
  326. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/CollectionTableToolbar.d.ts +0 -0
  327. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCell.d.ts +0 -0
  328. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCellActions.d.ts +0 -0
  329. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useDraggable.d.ts +0 -0
  330. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useWindowSize.d.ts +0 -0
  331. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/table_bindings.d.ts +0 -0
  332. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/FilterPresetsButton.d.ts +0 -0
  333. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/FiltersDialog.d.ts +0 -0
  334. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/ViewModeToggle.d.ts +0 -0
  335. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/useSelectionController.d.ts +0 -0
  336. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/utils.d.ts +0 -0
  337. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/PropertyTableCell.tsx +0 -0
  338. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/column_utils.tsx +0 -0
  339. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationSelectorField.tsx +0 -0
  340. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableSelect.tsx +0 -0
  341. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableUserSelect.tsx +0 -0
  342. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/CollectionTableToolbar.tsx +0 -0
  343. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCell.tsx +0 -0
  344. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCellActions.tsx +0 -0
  345. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useDraggable.tsx +0 -0
  346. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useWindowSize.tsx +0 -0
  347. /package/src/components/{EntityCollectionView → CollectionViewBinding}/FilterPresetsButton.tsx +0 -0
  348. /package/src/components/{EntityCollectionView → CollectionViewBinding}/ViewModeToggle.tsx +0 -0
  349. /package/src/components/{EntityCollectionView → CollectionViewBinding}/useSelectionController.tsx +0 -0
  350. /package/src/components/{EntityCollectionView → CollectionViewBinding}/utils.ts +0 -0
@@ -1,4 +1,4 @@
1
- import type { EntityCollection, DataSourceDefinition } from "@rebasepro/types";
1
+ import type { CollectionConfig, DataSourceDefinition } from "@rebasepro/types";
2
2
  import { useCallback, useEffect, useRef, useState, useMemo } from "react";
3
3
  import { CollectionRegistry, getParentReferencesFromPath as commonGetParentReferencesFromPath, removeInitialAndTrailingSlashes, getSubcollections } from "@rebasepro/common";
4
4
  import { EntityReference, UserConfigurationPersistence, CollectionRegistryController } from "@rebasepro/types";
@@ -21,7 +21,7 @@ export function useBuildCollectionRegistryController(props: {
21
21
  const getCollection = useCallback((
22
22
  slugOrPath: string,
23
23
  includeUserOverride = false
24
- ): EntityCollection | undefined => {
24
+ ): CollectionConfig | undefined => {
25
25
 
26
26
  const registry = collectionRegistryRef.current;
27
27
 
@@ -31,14 +31,14 @@ export function useBuildCollectionRegistryController(props: {
31
31
  const pathSegments = cleanedPath.split("/");
32
32
 
33
33
  let collectionPath = pathSegments.join("/");
34
- // If the path has an even number of segments, it points to an entity, so we get the parent collection
34
+ // If the path has an even number of segments, it points to a entity, so we get the parent collection
35
35
  if (pathSegments.length > 0 && pathSegments.length % 2 === 0) {
36
36
  collectionPath = pathSegments.slice(0, -1).join("/");
37
37
  }
38
38
 
39
39
  if (!collectionPath) return undefined;
40
40
 
41
- let collection: EntityCollection | undefined;
41
+ let collection: CollectionConfig | undefined;
42
42
  try {
43
43
  collection = registry.resolvePathToCollections(collectionPath).finalCollection;
44
44
  } catch (e) {
@@ -56,7 +56,7 @@ export function useBuildCollectionRegistryController(props: {
56
56
 
57
57
  if (!overriddenCollection) return undefined;
58
58
 
59
- let result: Partial<EntityCollection> | undefined = overriddenCollection;
59
+ let result: Partial<CollectionConfig> | undefined = overriddenCollection;
60
60
  const subcollections = "subcollections" in overriddenCollection ? overriddenCollection.subcollections : undefined;
61
61
  const callbacks = overriddenCollection.callbacks;
62
62
  result = {
@@ -69,11 +69,11 @@ export function useBuildCollectionRegistryController(props: {
69
69
  }
70
70
 
71
71
  return { ...overriddenCollection,
72
- ...result } as EntityCollection;
72
+ ...result } as CollectionConfig;
73
73
 
74
74
  }, [userConfigPersistence]);
75
75
 
76
- const getRawCollection = useCallback((slugOrPath: string): EntityCollection | undefined => {
76
+ const getRawCollection = useCallback((slugOrPath: string): CollectionConfig | undefined => {
77
77
  const registry = collectionRegistryRef.current;
78
78
  if (registry === undefined) return undefined;
79
79
 
@@ -82,7 +82,7 @@ export function useBuildCollectionRegistryController(props: {
82
82
 
83
83
  const pathSegments = cleanedPath.split("/");
84
84
 
85
- return registry.getRaw(pathSegments.join("/")) as EntityCollection | undefined;
85
+ return registry.getRaw(pathSegments.join("/")) as CollectionConfig | undefined;
86
86
  }, []);
87
87
 
88
88
  const getParentReferencesFromPath = useCallback((path: string): EntityReference[] => {
@@ -115,7 +115,7 @@ export function useBuildCollectionRegistryController(props: {
115
115
  result.push(oddPathSegments.slice(0, i));
116
116
  }
117
117
 
118
- const getCollectionFromPaths = (pathSegments: string[]): EntityCollection | undefined => {
118
+ const getCollectionFromPaths = (pathSegments: string[]): CollectionConfig | undefined => {
119
119
  if (!pathSegments?.length) return undefined;
120
120
  const testPath = pathSegments.reduce((acc, segment, idx) => {
121
121
  if (idx === 0) return segment;
@@ -144,11 +144,11 @@ export function useBuildCollectionRegistryController(props: {
144
144
  const convertIdsToPaths = useCallback((ids: string[]): string[] => {
145
145
  const registry = collectionRegistryRef.current;
146
146
  if (!registry) return [];
147
- let currentCollections: EntityCollection[] = registry.getCollections();
147
+ let currentCollections: CollectionConfig[] = registry.getCollections();
148
148
  const paths: string[] = [];
149
149
  for (let i = 0; i < ids.length; i++) {
150
150
  const id = ids[i];
151
- const collection: EntityCollection | undefined = currentCollections.find(c => c.slug === id);
151
+ const collection: CollectionConfig | undefined = currentCollections.find(c => c.slug === id);
152
152
  if (!collection)
153
153
  throw Error(`Collection with id ${id} not found`);
154
154
  paths.push(collection.slug);
@@ -1,8 +1,8 @@
1
- import type { AppView, EntityCollection, NavigationResult, RebasePlugin, NavigationStateController, UrlController, NavigationGroupMapping } from "@rebasepro/types";
1
+ import type { AppView, CollectionConfig, NavigationResult, RebasePlugin, NavigationStateController, UrlController, NavigationGroupMapping } from "@rebasepro/types";
2
2
  import { useCallback, useMemo, useRef } from "react";
3
3
 
4
4
  import { AuthController, RebaseData, CollectionRegistryController, User } from "@rebasepro/types";
5
- import type { EntityCollectionsBuilder, AppViewsBuilder, EffectiveRoleController } from "@rebasepro/types";
5
+ import type { CollectionConfigsBuilder, AppViewsBuilder, EffectiveRoleController } from "@rebasepro/types";
6
6
  import { CollectionRegistry } from "@rebasepro/common";
7
7
 
8
8
 
@@ -10,9 +10,9 @@ import { useResolvedCollections } from "./useResolvedCollections";
10
10
  import { useResolvedViews } from "./useResolvedViews";
11
11
  import { useTopLevelNavigation } from "./useTopLevelNavigation";
12
12
 
13
- export type BuildNavigationStateProps<EC extends EntityCollection, USER extends User> = {
13
+ export type BuildNavigationStateProps<EC extends CollectionConfig, USER extends User> = {
14
14
  authController: AuthController<USER>;
15
- collections?: EC[] | EntityCollectionsBuilder<EC>;
15
+ collections?: EC[] | CollectionConfigsBuilder<EC>;
16
16
  views?: AppView[] | AppViewsBuilder;
17
17
  adminViews?: AppView[] | AppViewsBuilder;
18
18
  data: RebaseData;
@@ -37,7 +37,7 @@ export type BuildNavigationStateProps<EC extends EntityCollection, USER extends
37
37
  *
38
38
  * The NavigationStateController type is preserved as a public API.
39
39
  */
40
- export function useBuildNavigationStateController<EC extends EntityCollection, USER extends User>(
40
+ export function useBuildNavigationStateController<EC extends CollectionConfig, USER extends User>(
41
41
  props: BuildNavigationStateProps<EC, USER>
42
42
  ): NavigationStateController {
43
43
 
@@ -3,8 +3,8 @@ import type {
3
3
  AppViewsBuilder,
4
4
  AuthCollectionConfig,
5
5
  EntityAction,
6
- EntityCollection,
7
- EntityCollectionsBuilder,
6
+ CollectionConfig,
7
+ CollectionConfigsBuilder,
8
8
  RebaseContext,
9
9
  RebasePlugin,
10
10
  UserCreationResult
@@ -23,7 +23,7 @@ function isRebaseContext(ctx: unknown): ctx is RebaseContext {
23
23
  return typeof ctx === "object" && ctx !== null && "dialogsController" in ctx;
24
24
  }
25
25
 
26
- export function filterOutNotAllowedCollections(resolvedCollections: EntityCollection[], authController: AuthController): EntityCollection[] {
26
+ export function filterOutNotAllowedCollections(resolvedCollections: CollectionConfig[], authController: AuthController): CollectionConfig[] {
27
27
  return resolvedCollections
28
28
  .filter((c) => canReadCollection(c, authController))
29
29
  .map((c) => {
@@ -35,8 +35,8 @@ export function filterOutNotAllowedCollections(resolvedCollections: EntityCollec
35
35
  });
36
36
  }
37
37
 
38
- export function applyPluginModifyCollection(resolvedCollections: EntityCollection[], modifyCollection: (collection: EntityCollection) => EntityCollection): EntityCollection[] {
39
- return resolvedCollections.map((collection): EntityCollection => {
38
+ export function applyPluginModifyCollection(resolvedCollections: CollectionConfig[], modifyCollection: (collection: CollectionConfig) => CollectionConfig): CollectionConfig[] {
39
+ return resolvedCollections.map((collection): CollectionConfig => {
40
40
  const modifiedCollection = modifyCollection(collection);
41
41
  if (modifiedCollection.childCollections) {
42
42
  return {
@@ -59,7 +59,7 @@ export function applyPluginModifyCollection(resolvedCollections: EntityCollectio
59
59
  *
60
60
  * Skips injection if the collection already has the action/callback present.
61
61
  */
62
- function injectAuthCollectionConfig(collections: EntityCollection[]): EntityCollection[] {
62
+ function injectAuthCollectionConfig(collections: CollectionConfig[]): CollectionConfig[] {
63
63
  return collections.map((collection) => {
64
64
  const authProp = collection.auth;
65
65
  if (!authProp) return collection;
@@ -116,7 +116,7 @@ function injectAuthCollectionConfig(collections: EntityCollection[]): EntityColl
116
116
 
117
117
  const creationResult: UserCreationResult = {
118
118
  user: {
119
- uid: String(props.entityId),
119
+ uid: String(props.id),
120
120
  email: typeof values.email === "string" ? values.email : "",
121
121
  displayName: typeof values.displayName === "string" ? values.displayName : "",
122
122
  roles: Array.isArray(values.roles) ? values.roles as string[] : [],
@@ -150,12 +150,12 @@ function injectAuthCollectionConfig(collections: EntityCollection[]): EntityColl
150
150
  }
151
151
 
152
152
  export async function resolveCollections(
153
- collections: undefined | EntityCollection[] | EntityCollectionsBuilder,
153
+ collections: undefined | CollectionConfig[] | CollectionConfigsBuilder,
154
154
  authController: AuthController,
155
155
  data: RebaseData,
156
156
  plugins: RebasePlugin[] | undefined
157
- ): Promise<EntityCollection[]> {
158
- let resolvedCollections: EntityCollection[] = [];
157
+ ): Promise<CollectionConfig[]> {
158
+ let resolvedCollections: CollectionConfig[] = [];
159
159
  if (typeof collections === "function") {
160
160
  resolvedCollections = await collections({
161
161
  user: authController.user,
@@ -1,8 +1,8 @@
1
- import type { EntityCollection, RebasePlugin } from "@rebasepro/types";
1
+ import type { CollectionConfig, RebasePlugin } from "@rebasepro/types";
2
2
  import { useRef, useMemo } from "react";
3
3
 
4
4
  import { AuthController, CollectionRegistryController, RebaseData, User } from "@rebasepro/types";
5
- import type { EntityCollectionsBuilder } from "@rebasepro/types";
5
+ import type { CollectionConfigsBuilder } from "@rebasepro/types";
6
6
  import { CollectionRegistry } from "@rebasepro/common";
7
7
 
8
8
 
@@ -10,9 +10,9 @@ import { resolveCollections } from "./useNavigationResolution";
10
10
  import { areCollectionListsEqual } from "./utils";
11
11
  import { useAsyncResolver } from "./useAsyncResolver";
12
12
 
13
- export type UseResolvedCollectionsProps<EC extends EntityCollection, USER extends User> = {
13
+ export type UseResolvedCollectionsProps<EC extends CollectionConfig, USER extends User> = {
14
14
  authController: AuthController<USER>;
15
- collections?: EC[] | EntityCollectionsBuilder<EC>;
15
+ collections?: EC[] | CollectionConfigsBuilder<EC>;
16
16
  data: RebaseData;
17
17
  plugins?: RebasePlugin[];
18
18
  disabled?: boolean;
@@ -21,7 +21,7 @@ export type UseResolvedCollectionsProps<EC extends EntityCollection, USER extend
21
21
  };
22
22
 
23
23
  export type UseResolvedCollectionsResult = {
24
- collections: EntityCollection[];
24
+ collections: CollectionConfig[];
25
25
  loading: boolean;
26
26
  error: Error | undefined;
27
27
  refresh: () => void;
@@ -29,7 +29,7 @@ export type UseResolvedCollectionsResult = {
29
29
 
30
30
  /**
31
31
  * Hook that resolves collection props (which may be async builders or arrays)
32
- * into concrete EntityCollection[], and registers them with the CollectionRegistry.
32
+ * into concrete CollectionConfig[], and registers them with the CollectionRegistry.
33
33
  *
34
34
  * When userManagement is provided, the default users collection is always
35
35
  * prepended. Developer collections override via generic slug-based dedup
@@ -38,7 +38,7 @@ export type UseResolvedCollectionsResult = {
38
38
  * Uses refs for potentially-unstable dependencies (driver, authController,
39
39
  * plugins) to avoid re-triggering effects when their object identity changes.
40
40
  */
41
- export function useResolvedCollections<EC extends EntityCollection, USER extends User>(
41
+ export function useResolvedCollections<EC extends CollectionConfig, USER extends User>(
42
42
  props: UseResolvedCollectionsProps<EC, USER>
43
43
  ): UseResolvedCollectionsResult {
44
44
 
@@ -66,7 +66,7 @@ export function useResolvedCollections<EC extends EntityCollection, USER extends
66
66
  const pluginsRef = useRef(plugins);
67
67
  pluginsRef.current = plugins;
68
68
 
69
- const { data: collections, loading, error, refresh } = useAsyncResolver<EntityCollection[]>({
69
+ const { data: collections, loading, error, refresh } = useAsyncResolver<CollectionConfig[]>({
70
70
  resolver: async () => {
71
71
  const resolved = await resolveCollections(
72
72
  collectionsProp,
@@ -1,4 +1,4 @@
1
- import type { AppView, UrlController, EntityCollection, RebasePlugin, NavigationEntry, NavigationGroupMapping, NavigationResult } from "@rebasepro/types";
1
+ import type { AppView, UrlController, CollectionConfig, RebasePlugin, NavigationEntry, NavigationGroupMapping, NavigationResult } from "@rebasepro/types";
2
2
  import { useCallback, useMemo, useRef } from "react";
3
3
  import { deepEqual as equal } from "fast-equals";
4
4
 
@@ -8,7 +8,7 @@ import { CollectionRegistry } from "@rebasepro/common";
8
8
  import { computeNavigationGroups, getGroup, NAVIGATION_ADMIN_GROUP_NAME, NAVIGATION_DEFAULT_GROUP_NAME } from "./utils";
9
9
 
10
10
  export type UseTopLevelNavigationProps = {
11
- collections: EntityCollection[];
11
+ collections: CollectionConfig[];
12
12
  views: AppView[] | undefined;
13
13
  adminViews: AppView[] | undefined;
14
14
  plugins?: RebasePlugin[];
@@ -1,4 +1,4 @@
1
- import type { AppView, EntityCollection, RebasePlugin, NavigationGroupMapping } from "@rebasepro/types";
1
+ import type { AppView, CollectionConfig, RebasePlugin, NavigationGroupMapping } from "@rebasepro/types";
2
2
 
3
3
  import { getSubcollections } from "@rebasepro/common";
4
4
  import { deepEqual as equal } from "fast-equals";
@@ -6,7 +6,7 @@ import { deepEqual as equal } from "fast-equals";
6
6
  export const NAVIGATION_DEFAULT_GROUP_NAME = "Views";
7
7
  export const NAVIGATION_ADMIN_GROUP_NAME = "Admin";
8
8
 
9
- export function getGroup(collectionOrView: EntityCollection | AppView) {
9
+ export function getGroup(collectionOrView: CollectionConfig | AppView) {
10
10
  const trimmed = collectionOrView.group?.trim();
11
11
  if (!trimmed || trimmed === "") {
12
12
  return NAVIGATION_DEFAULT_GROUP_NAME;
@@ -21,7 +21,7 @@ export function computeNavigationGroups({
21
21
  plugins
22
22
  }: {
23
23
  navigationGroupMappings?: NavigationGroupMapping[],
24
- collections?: EntityCollection[],
24
+ collections?: CollectionConfig[],
25
25
  views?: AppView[],
26
26
  plugins?: RebasePlugin[]
27
27
  }): NavigationGroupMapping[] {
@@ -146,7 +146,7 @@ export function computeNavigationGroups({
146
146
  return result;
147
147
  }
148
148
 
149
- export function areCollectionListsEqual(a: EntityCollection[], b: EntityCollection[], visitedSlugs: string[] = []) {
149
+ export function areCollectionListsEqual(a: CollectionConfig[], b: CollectionConfig[], visitedSlugs: string[] = []) {
150
150
  if (a.length !== b.length) {
151
151
  return false;
152
152
  }
@@ -157,7 +157,7 @@ export function areCollectionListsEqual(a: EntityCollection[], b: EntityCollecti
157
157
  return aSorted.every((value, index) => areCollectionsEqual(value, bSorted[index], visitedSlugs));
158
158
  }
159
159
 
160
- export function areCollectionsEqual(a: EntityCollection, b: EntityCollection, visitedSlugs: string[] = []) {
160
+ export function areCollectionsEqual(a: CollectionConfig, b: CollectionConfig, visitedSlugs: string[] = []) {
161
161
  if (a.slug !== b.slug) {
162
162
  return false;
163
163
  }
@@ -1,5 +1,5 @@
1
- import type { EntityCollection } from "@rebasepro/types";
2
- import type { CustomizationController, EntitySidePanelProps, SideDialogPanelProps, SideDialogsController, SideEntityController, UrlController, NavigationStateController, Property } from "@rebasepro/types";
1
+ import type { CollectionConfig } from "@rebasepro/types";
2
+ import type { CustomizationController, SidePanelBindingProps, SideDialogPanelProps, SideDialogsController, SidePanelController, UrlController, NavigationStateController, Property } from "@rebasepro/types";
3
3
  import { useCallback, useEffect, useRef, useMemo } from "react";
4
4
  import { AuthController, CollectionRegistryController } from "@rebasepro/types";
5
5
  import { useLocation } from "react-router-dom";
@@ -11,10 +11,10 @@ import {
11
11
  } from "@rebasepro/common";
12
12
  import { resolvedSelectedEntityView } from "../util/resolutions";
13
13
  import { ADDITIONAL_TAB_WIDTH, CONTAINER_FULL_WIDTH, FORM_CONTAINER_WIDTH } from "@rebasepro/core";
14
- import { useCustomizationController, useLargeLayout, useComponentOverride, CollectionComponentOverrideProvider } from "@rebasepro/core";
15
- import { JSON_TAB_VALUE, HISTORY_TAB_VALUE } from "../components/EntityEditView";
14
+ import { useCustomizationController, useLargeLayout, useComponentOverride, CollectionScopeProvider } from "@rebasepro/core";
15
+ import { JSON_TAB_VALUE, HISTORY_TAB_VALUE } from "../components/EditViewBinding";
16
16
  import React from "react";
17
- import { EntitySidePanel } from "../components/EntitySidePanel";
17
+ import { SidePanelBinding } from "../components/SidePanelBinding";
18
18
 
19
19
  /**
20
20
  * Thin wrapper that resolves the Entity.SidePanel component override.
@@ -22,26 +22,26 @@ import { EntitySidePanel } from "../components/EntitySidePanel";
22
22
  * not a React component), we need this wrapper so the hook is called at the
23
23
  * top level of a React component per the Rules of Hooks.
24
24
  */
25
- function ResolvedEntitySidePanelInner(props: EntitySidePanelProps) {
26
- const Resolved = useComponentOverride("Entity.SidePanel", EntitySidePanel);
25
+ function ResolvedSidePanelBindingInner(props: SidePanelBindingProps) {
26
+ const Resolved = useComponentOverride("Entity.SidePanel", SidePanelBinding);
27
27
  return <Resolved {...props}/>;
28
28
  }
29
29
 
30
- function ResolvedEntitySidePanel(props: EntitySidePanelProps) {
31
- if (props.collection?.components) {
30
+ function ResolvedSidePanelBinding(props: SidePanelBindingProps) {
31
+ if (props.collection) {
32
32
  return (
33
- <CollectionComponentOverrideProvider overrides={props.collection.components}>
34
- <ResolvedEntitySidePanelInner {...props}/>
35
- </CollectionComponentOverrideProvider>
33
+ <CollectionScopeProvider collection={props.collection}>
34
+ <ResolvedSidePanelBindingInner {...props}/>
35
+ </CollectionScopeProvider>
36
36
  );
37
37
  }
38
- return <ResolvedEntitySidePanelInner {...props}/>;
38
+ return <ResolvedSidePanelBindingInner {...props}/>;
39
39
  }
40
40
 
41
41
  const NEW_URL_HASH = "new_side";
42
42
  const SIDE_URL_HASH = "side";
43
43
 
44
- export function getEntityViewWidth(props: EntitySidePanelProps<any>, small: boolean, customizationController: CustomizationController): string {
44
+ export function getEntityViewWidth(props: SidePanelBindingProps<any>, small: boolean, customizationController: CustomizationController): string {
45
45
  if (small) return CONTAINER_FULL_WIDTH;
46
46
 
47
47
  const {
@@ -72,7 +72,7 @@ export function getEntityViewWidth(props: EntitySidePanelProps<any>, small: bool
72
72
 
73
73
  const collectionViewWidthCache: { [key: string]: string } = {};
74
74
 
75
- function calculateCollectionDesiredWidth(collection: EntityCollection<any>): string {
75
+ function calculateCollectionDesiredWidth(collection: CollectionConfig<any>): string {
76
76
  if (collectionViewWidthCache[collection.slug]) {
77
77
  return collectionViewWidthCache[collection.slug];
78
78
  }
@@ -108,12 +108,12 @@ function getNestedPropertiesDepth(property: Property, accumulator = 0): number {
108
108
  }
109
109
  }
110
110
 
111
- export const useBuildSideEntityController = (collectionRegistryController: CollectionRegistryController,
111
+ export const useBuildSidePanel = (collectionRegistryController: CollectionRegistryController,
112
112
  urlController: UrlController,
113
113
  navigationStateController: NavigationStateController,
114
114
  sideDialogsController: SideDialogsController,
115
115
  authController: AuthController
116
- ): SideEntityController => {
116
+ ): SidePanelController => {
117
117
 
118
118
  const location = useLocation();
119
119
  const initialised = useRef<boolean>(false);
@@ -172,12 +172,12 @@ export const useBuildSideEntityController = (collectionRegistryController: Colle
172
172
 
173
173
  // update side panels to match browser size
174
174
  // Only update panel widths on layout change — don't recreate components.
175
- // Recreating components would unmount/remount EntitySidePanel, losing
175
+ // Recreating components would unmount/remount SidePanelBinding, losing
176
176
  // scroll position, unsaved form state, and triggering unnecessary data fetches.
177
177
  useEffect(() => {
178
178
  const updatedSidePanels = sideDialogsController.sidePanels.map(sidePanelProps => {
179
179
  if (sidePanelProps.additional) {
180
- const entityProps = sidePanelProps.additional as EntitySidePanelProps;
180
+ const entityProps = sidePanelProps.additional as SidePanelBindingProps;
181
181
  const newWidth = getEntityViewWidth(entityProps, smallLayout, customizationController);
182
182
  if (sidePanelProps.width !== newWidth) {
183
183
  return { ...sidePanelProps,
@@ -193,10 +193,10 @@ width: newWidth };
193
193
  sideDialogsController.close();
194
194
  }, [sideDialogsController]);
195
195
 
196
- const open = useCallback((props: EntitySidePanelProps<any>) => {
196
+ const open = useCallback((props: SidePanelBindingProps<any>) => {
197
197
 
198
198
  if (props.copy && !props.entityId) {
199
- throw Error("If you want to copy an entity you need to provide an entityId");
199
+ throw Error("If you want to copy a entity you need to provide a entityId");
200
200
  }
201
201
 
202
202
  const defaultSelectedView = resolveDefaultSelectedView(
@@ -222,10 +222,10 @@ width: newWidth };
222
222
 
223
223
  }, [sideDialogsController, urlController.buildUrlCollectionPath, urlController.resolveDatabasePathsFrom, smallLayout, authController.user, location.search]);
224
224
 
225
- const replace = useCallback((props: EntitySidePanelProps<any>) => {
225
+ const replace = useCallback((props: SidePanelBindingProps<any>) => {
226
226
 
227
227
  if (props.copy && !props.entityId) {
228
- throw Error("If you want to copy an entity you need to provide an entityId");
228
+ throw Error("If you want to copy a entity you need to provide a entityId");
229
229
  }
230
230
 
231
231
  sideDialogsController.replace(propsToSidePanel(props, urlController.buildUrlCollectionPath, urlController.resolveDatabasePathsFrom, smallLayout, customizationController, authController, location.search));
@@ -239,14 +239,14 @@ width: newWidth };
239
239
  }), [close, open, replace]);
240
240
  };
241
241
 
242
- export function buildSidePanelsFromUrl(path: string, collections: EntityCollection[], newFlag: boolean): EntitySidePanelProps<any>[] {
242
+ export function buildSidePanelsFromUrl(path: string, collections: CollectionConfig[], newFlag: boolean): SidePanelBindingProps<any>[] {
243
243
 
244
244
  const navigationViewsForPath: NavigationViewInternal<any>[] = getNavigationEntriesFromPath({
245
245
  path,
246
246
  collections
247
247
  });
248
248
 
249
- let sidePanel: EntitySidePanelProps<any> | undefined = undefined;
249
+ let sidePanel: SidePanelBindingProps<any> | undefined = undefined;
250
250
  let lastCollectionPath = "";
251
251
  let lastCollectionId: string | undefined = undefined;
252
252
  for (let i = 0; i < navigationViewsForPath.length; i++) {
@@ -306,7 +306,7 @@ export function buildSidePanelsFromUrl(path: string, collections: EntityCollecti
306
306
  return sidePanel ? [sidePanel] : [];
307
307
  }
308
308
 
309
- const propsToSidePanel = (props: EntitySidePanelProps,
309
+ const propsToSidePanel = (props: SidePanelBindingProps,
310
310
  buildUrlCollectionPath: (path: string) => string,
311
311
  resolveIdsFrom: (pathWithAliases: string) => string,
312
312
  smallLayout: boolean,
@@ -331,7 +331,7 @@ const propsToSidePanel = (props: EntitySidePanelProps,
331
331
  ? buildUrlCollectionPath(collectionPath)
332
332
  : undefined;
333
333
 
334
- const resolvedPanelProps: EntitySidePanelProps<any> = {
334
+ const resolvedPanelProps: SidePanelBindingProps<any> = {
335
335
  ...props,
336
336
  formProps: props.formProps
337
337
  };
@@ -339,7 +339,7 @@ const propsToSidePanel = (props: EntitySidePanelProps,
339
339
  const entityViewWidth = getEntityViewWidth(props, smallLayout, customizationController);
340
340
  return {
341
341
  key: `${props.path}/${props.entityId}`,
342
- component: <ResolvedEntitySidePanel {...resolvedPanelProps}/>,
342
+ component: <ResolvedSidePanelBinding {...resolvedPanelProps}/>,
343
343
  urlPath: urlPath,
344
344
  parentUrlPath: parentUrlPath,
345
345
  width: entityViewWidth,
@@ -4,7 +4,7 @@ import type {
4
4
  AuthController,
5
5
  RebaseContext,
6
6
  SideDialogsController,
7
- SideEntityController,
7
+ SidePanelController,
8
8
  User
9
9
  } from "@rebasepro/types";
10
10
  import type {
@@ -12,7 +12,7 @@ import type {
12
12
  NavigationStateController,
13
13
  UrlController
14
14
  } from "@rebasepro/types";
15
- import { useSideEntityController } from "./useSideEntityController";
15
+ import { useSidePanel } from "./useSidePanel";
16
16
  import { useSideDialogsController } from "./useSideDialogsController";
17
17
  import {
18
18
  useUrlController,
@@ -32,7 +32,7 @@ export type CMSContext<
32
32
  USER extends User = User,
33
33
  AuthControllerType extends AuthController<USER> = AuthController<USER>
34
34
  > = RebaseContext<USER, AuthControllerType> & {
35
- sideEntityController: SideEntityController;
35
+ sidePanelController: SidePanelController;
36
36
  sideDialogsController: SideDialogsController;
37
37
  urlController: UrlController;
38
38
  navigationStateController: NavigationStateController;
@@ -55,7 +55,7 @@ export function useCMSContext<
55
55
  AuthControllerType extends AuthController<USER> = AuthController<USER>
56
56
  >(): CMSContext<DB, USER, AuthControllerType> {
57
57
  const baseContext = useRebaseContext<USER, AuthControllerType>();
58
- const sideEntityController = useSideEntityController();
58
+ const sidePanelController = useSidePanel();
59
59
  const sideDialogsController = useSideDialogsController();
60
60
  const urlController = useUrlController();
61
61
  const navigationStateController = useNavigationStateController();
@@ -63,14 +63,14 @@ export function useCMSContext<
63
63
 
64
64
  return useMemo(() => ({
65
65
  ...baseContext,
66
- sideEntityController,
66
+ sidePanelController,
67
67
  sideDialogsController,
68
68
  urlController,
69
69
  navigationStateController,
70
70
  collectionRegistryController
71
71
  }), [
72
72
  baseContext,
73
- sideEntityController,
73
+ sidePanelController,
74
74
  sideDialogsController,
75
75
  urlController,
76
76
  navigationStateController,
@@ -27,7 +27,7 @@ export interface UseEntityHistoryResult {
27
27
  * Hook to fetch entity history from the backend REST API.
28
28
  * Replaces the old subcollection-based approach with a proper API call.
29
29
  */
30
- export function useEntityHistory(params: {
30
+ export function useHistory(params: {
31
31
  slug: string;
32
32
  entityId: string | number | undefined;
33
33
  enabled?: boolean;
@@ -1,4 +1,4 @@
1
- import type { EntityCollection, EntityCustomView } from "@rebasepro/types";
1
+ import type { CollectionConfig, EntityCustomView } from "@rebasepro/types";
2
2
  import { Entity, RebaseContext, User } from "@rebasepro/types";
3
3
  import { useEffect, useState, useMemo } from "react";
4
4
  import { getNavigationEntriesFromPath } from "@rebasepro/common";
@@ -22,7 +22,7 @@ export interface ResolvedNavigationEntity<M extends Record<string, unknown>> {
22
22
  entity: Entity<M>;
23
23
  entityId: string | number;
24
24
  path: string;
25
- parentCollection: EntityCollection<M>;
25
+ parentCollection: CollectionConfig<M>;
26
26
  }
27
27
 
28
28
  /**
@@ -32,7 +32,7 @@ export interface ResolvedNavigationEntity<M extends Record<string, unknown>> {
32
32
  export interface ResolvedNavigationCollection<M extends Record<string, unknown>> {
33
33
  type: "collection";
34
34
  path: string;
35
- collection: EntityCollection<M>;
35
+ collection: CollectionConfig<M>;
36
36
  }
37
37
 
38
38
  /**
@@ -85,9 +85,12 @@ export function resolveNavigationFrom<M extends Record<string, unknown>, USER ex
85
85
  if (!collection) {
86
86
  throw Error(`No collection defined in the navigation for the entity with path ${entry.slug}`);
87
87
  }
88
+ // `context.data` is the flat SDK layer; re-wrap the row into the
89
+ // Entity view-model the navigation entry expects.
88
90
  return data.collection(entry.slug).findById(entry.entityId)
89
- .then((entity) => {
90
- if (!entity) return undefined;
91
+ .then((row) => {
92
+ if (!row) return undefined;
93
+ const entity = { id: row.id, path: entry.slug, values: row };
91
94
  return { ...entry,
92
95
  entity };
93
96
  });
@@ -1,5 +1,5 @@
1
- import { EntitySelectionProps, EntitySelectionTable } from "../components";
2
- import type { EntityCollection } from "@rebasepro/types";
1
+ import { SelectionProps, SelectionTableBinding } from "../components";
2
+ import type { CollectionConfig } from "@rebasepro/types";
3
3
  import { useCallback, useMemo } from "react";
4
4
  import { useSideDialogsController } from "../index";
5
5
  import { useCollectionRegistryController } from "../index";
@@ -14,7 +14,7 @@ import { useCollectionRegistryController } from "../index";
14
14
  * This is the same hook used internally when a reference property is defined.
15
15
  * @group Hooks and utilities
16
16
  */
17
- export function useEntitySelectionDialog<M extends Record<string, unknown>>(referenceDialogProps: Omit<EntitySelectionProps<M>, "path"> & {
17
+ export function useSelectionDialog<M extends Record<string, unknown>>(referenceDialogProps: Omit<SelectionProps<M>, "path"> & {
18
18
  path?: string | false;
19
19
  onClose?: () => void;
20
20
  }): { open: () => void; close: () => void } {
@@ -26,15 +26,15 @@ export function useEntitySelectionDialog<M extends Record<string, unknown>>(refe
26
26
  if (referenceDialogProps.path) {
27
27
  let usedCollection = referenceDialogProps.collection;
28
28
  if (!usedCollection)
29
- usedCollection = navigation.getCollection(referenceDialogProps.path) as EntityCollection<M> | undefined;
29
+ usedCollection = navigation.getCollection(referenceDialogProps.path) as CollectionConfig<M> | undefined;
30
30
  if (!usedCollection)
31
- throw Error("Not able to resolve the collection in useEntitySelectionDialog. Make sure a collection is registered in path " + referenceDialogProps.path);
31
+ throw Error("Not able to resolve the collection in useSelectionDialog. Make sure a collection is registered in path " + referenceDialogProps.path);
32
32
  sideDialogsController.open({
33
33
  key: `reference_${referenceDialogProps.path}`,
34
34
  component:
35
- <EntitySelectionTable
35
+ <SelectionTableBinding
36
36
  collection={usedCollection}
37
- {...referenceDialogProps as EntitySelectionProps<M>}/>,
37
+ {...referenceDialogProps as SelectionProps<M>}/>,
38
38
  width: "90vw",
39
39
  onClose: () => {
40
40
  referenceDialogProps.onClose?.();
@@ -8,7 +8,7 @@ import { useContext } from "react";
8
8
  * This hook allows you to open and close side dialogs. This is the mechanism
9
9
  * used when open a side entity dialog, or when selecting a reference.
10
10
  *
11
- * If you want to open a side entity dialog, you can use the {@link useSideEntityController}
11
+ * If you want to open a side entity dialog, you can use the {@link useSidePanel}
12
12
  * hook.
13
13
  *
14
14
  * If you want to select a reference, you can use the {@link useReferenceDialog}
@@ -0,0 +1,13 @@
1
+ import type { SidePanelController } from "@rebasepro/types";
2
+ import React, { useContext } from "react";
3
+
4
+ export const SidePanelControllerContext = React.createContext<SidePanelController>({} as SidePanelController);
5
+
6
+ /**
7
+ * Use this hook to retrieve a entity controller that allows you to open
8
+ * a side dialog to edit a entity.
9
+ *
10
+ * @see SidePanelController
11
+ * @group Hooks and utilities
12
+ */
13
+ export const useSidePanel = (): SidePanelController => useContext(SidePanelControllerContext);