@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
@@ -76,7 +76,7 @@ export function ContentHomePage({
76
76
  // Content mode shows collections, CMS custom views, and admin entries — but not Studio dev views.
77
77
  const rawNavigationEntries = useMemo(() => {
78
78
  if (adminModeController.mode === "studio") {
79
- return unFilteredNavigationEntries.filter(e => e.type === "view" || e.type === "admin");
79
+ return unFilteredNavigationEntries.filter(e => (e.type === "view" && studioViewSlugs.has(e.slug)) || e.type === "admin");
80
80
  }
81
81
  return unFilteredNavigationEntries.filter(e => e.type !== "view" || !studioViewSlugs.has(e.slug));
82
82
  }, [unFilteredNavigationEntries, adminModeController.mode, studioViewSlugs]);
@@ -1,4 +1,4 @@
1
- import type { NavigationEntry, EntityCollection } from "@rebasepro/types";
1
+ import type { NavigationEntry, CollectionConfig } from "@rebasepro/types";
2
2
  import { useNavigate } from "react-router-dom";
3
3
  ;
4
4
  import { IconButton, StarIcon, Tooltip } from "@rebasepro/ui";
@@ -2,7 +2,7 @@ import React, { useRef } from "react";
2
2
  import { Highlight, themes } from "prism-react-renderer";
3
3
  import { useModeController } from "@rebasepro/core";
4
4
 
5
- export function EntityJsonPreview({ values }: { values: object }) {
5
+ export function JsonPreviewBinding({ values }: { values: object }) {
6
6
  const code = JSON.stringify(values, null, "\t");
7
7
  const { mode } = useModeController();
8
8
  const preRef = useRef<HTMLPreElement>(null);
@@ -10,7 +10,7 @@ import type { RebaseCMSConfig } from "@rebasepro/types";
10
10
  * is auto-wired as a native feature (slots, provider, Studio view) without
11
11
  * needing any external plugin.
12
12
  */
13
- export function RebaseCMS({ collections, views, homePage, entityViews, entityActions, plugins, collectionEditor, navigationGroupMappings }: RebaseCMSConfig) {
13
+ export function RebaseCMS({ collections, views, homePage, entityViews, entityActions, collectionEditor, navigationGroupMappings, basePath }: RebaseCMSConfig) {
14
14
  const dispatch = useRebaseRegistryDispatch();
15
15
 
16
16
  useLayoutEffect(() => {
@@ -19,11 +19,11 @@ views,
19
19
  homePage,
20
20
  entityViews,
21
21
  entityActions,
22
- plugins,
23
22
  collectionEditor,
24
- navigationGroupMappings });
23
+ navigationGroupMappings,
24
+ basePath });
25
25
  return () => dispatch.unregisterCMS();
26
- }, [dispatch, collections, views, homePage, entityViews, entityActions, plugins, collectionEditor, navigationGroupMappings]);
26
+ }, [dispatch, collections, views, homePage, entityViews, entityActions, collectionEditor, navigationGroupMappings, basePath]);
27
27
 
28
28
  return null;
29
29
  }
@@ -16,12 +16,12 @@ import {
16
16
  } from "@rebasepro/core";
17
17
  import { buildRoutedRebaseData, resolveDataSource } from "@rebasepro/common";
18
18
  import { CircularProgressCenter } from "@rebasepro/ui";
19
- import type { AppView, CollectionEditorOptions, EntityCustomView, EntityAction, EntityCollection, RebasePlugin } from "@rebasepro/types";
19
+ import type { AppView, CollectionEditorOptions, EntityCustomView, EntityAction, CollectionConfig, RebasePlugin } from "@rebasepro/types";
20
20
  import type { CollectionRegistryController } from "@rebasepro/types";
21
21
  import type { UrlController, NavigationStateController } from "@rebasepro/types";
22
22
 
23
23
  const EMPTY_PLUGINS: RebasePlugin[] = [];
24
- const EMPTY_COLLECTIONS: EntityCollection[] = [];
24
+ const EMPTY_COLLECTIONS: CollectionConfig[] = [];
25
25
 
26
26
  import { useBuildNavigationStateController } from "../hooks/navigation/useBuildNavigationStateController";
27
27
  import { useBuildUrlController } from "../hooks/navigation/useBuildUrlController";
@@ -31,7 +31,7 @@ import { CollectionRegistryContext } from "../hooks/navigation/contexts/Collecti
31
31
  import { UrlContext } from "../hooks/navigation/contexts/UrlContext";
32
32
  import { NavigationStateContext } from "../hooks/navigation/contexts/NavigationStateContext";
33
33
 
34
- import { SideEntityProvider } from "./SideEntityProvider";
34
+ import { SidePanelProvider } from "./SidePanelProvider";
35
35
 
36
36
  // Collection editor internals — used when collectionEditor is enabled
37
37
  import { useLocalCollectionsConfigController } from "../collection_editor/useLocalCollectionsConfigController";
@@ -61,7 +61,7 @@ export interface RebaseNavigationProps {
61
61
  * ```tsx
62
62
  * <RebaseNavigation>
63
63
  * <MyCustomLayout>
64
- * <EntityCollectionView ... />
64
+ * <CollectionViewBinding ... />
65
65
  * </MyCustomLayout>
66
66
  * </RebaseNavigation>
67
67
  * ```
@@ -109,8 +109,17 @@ export function RebaseNavigation({ children }: RebaseNavigationProps) {
109
109
  resolveKey: (slugOrPath) => resolveDataSource(getCollectionRef.current(slugOrPath), dataSources.registry).key
110
110
  }), [defaultData, dataSources]);
111
111
 
112
+ // Normalize the configured mount prefix to a leading-slash, no-trailing-slash
113
+ // form (e.g. "admin" or "/admin/" -> "/admin"); empty/"/" stays "/".
114
+ const basePath = useMemo(() => {
115
+ const raw = registry.cmsConfig?.basePath;
116
+ if (!raw || raw === "/") return "/";
117
+ const trimmed = raw.replace(/^\/+/, "").replace(/\/+$/, "");
118
+ return trimmed ? `/${trimmed}` : "/";
119
+ }, [registry.cmsConfig?.basePath]);
120
+
112
121
  const urlController = useBuildUrlController({
113
- basePath: "/",
122
+ basePath,
114
123
  baseCollectionPath: "/c",
115
124
  collectionRegistryController
116
125
  });
@@ -195,8 +204,10 @@ export function RebaseNavigation({ children }: RebaseNavigationProps) {
195
204
  return [...cmsViews, ...devViews];
196
205
  }, [cmsViews, devViews]);
197
206
 
207
+ const parentCustomizationController = useCustomizationController();
208
+
198
209
  const navigationStateController = useBuildNavigationStateController({
199
- plugins: registry.cmsConfig?.plugins ?? EMPTY_PLUGINS,
210
+ plugins: parentCustomizationController.plugins ?? EMPTY_PLUGINS,
200
211
  collections: collectionsBuilder,
201
212
  views: mergedViews,
202
213
  navigationGroupMappings: registry.cmsConfig?.navigationGroupMappings,
@@ -211,9 +222,8 @@ export function RebaseNavigation({ children }: RebaseNavigationProps) {
211
222
  // The <Rebase> component builds the customizationController from its own props,
212
223
  // but entity views passed to <RebaseCMS> are stored in the registry and not
213
224
  // automatically merged. We re-provide an enriched controller here so that
214
- // downstream consumers (EntityEditView, side panels, etc.) can resolve
225
+ // downstream consumers (EditViewBinding, side panels, etc.) can resolve
215
226
  // string-keyed entity views like "blog_preview".
216
- const parentCustomizationController = useCustomizationController();
217
227
  const enrichedCustomizationController = useMemo(() => {
218
228
  const cmsEntityViews = (registry.cmsConfig?.entityViews ?? []) as EntityCustomView[];
219
229
  const cmsEntityActions = (registry.cmsConfig?.entityActions ?? []) as EntityAction[];
@@ -244,14 +254,14 @@ export function RebaseNavigation({ children }: RebaseNavigationProps) {
244
254
  <CollectionRegistryContext.Provider value={collectionRegistryController}>
245
255
  <UrlContext.Provider value={urlController}>
246
256
  <NavigationStateContext.Provider value={navigationStateController}>
247
- <SideEntityProvider>
257
+ <SidePanelProvider>
248
258
  <BridgeAutoRegistrar
249
259
  collectionRegistryController={collectionRegistryController}
250
260
  urlController={urlController}
251
261
  navigationStateController={navigationStateController}
252
262
  />
253
263
  {children}
254
- </SideEntityProvider>
264
+ </SidePanelProvider>
255
265
  </NavigationStateContext.Provider>
256
266
  </UrlContext.Provider>
257
267
  </CollectionRegistryContext.Provider>
@@ -1,12 +1,13 @@
1
- import type { EntityCollection } from "@rebasepro/types";
1
+ import type { CollectionConfig } from "@rebasepro/types";
2
2
  import React, { MouseEventHandler, useCallback, useEffect, useMemo, useRef, useState } from "react";
3
3
  import { CollectionSize, Entity, FilterValues } from "@rebasepro/types";
4
4
 
5
5
  import {
6
- EntityCollectionRowActions,
7
- EntityCollectionTable
8
- } from "../EntityCollectionTable";
6
+ CollectionRowActions,
7
+ CollectionTableBinding
8
+ } from "../CollectionTableBinding";
9
9
  import {
10
+ CollectionScopeProvider,
10
11
  useAuthController,
11
12
  useCustomizationController,
12
13
  useData,
@@ -17,17 +18,17 @@ import {
17
18
  import { ErrorView } from "@rebasepro/core";
18
19
  import { Button, DialogActions, PlusIcon, Typography } from "@rebasepro/ui";
19
20
  import { IconForView } from "@rebasepro/core";
20
- import { useSelectionController } from "../EntityCollectionView/useSelectionController";
21
+ import { useSelectionController } from "../CollectionViewBinding/useSelectionController";
21
22
 
22
23
  import { useColumnIds } from "@rebasepro/core";
23
24
  import { useSideDialogContext } from "../SideDialogs";
24
25
  import { useAnalyticsController } from "@rebasepro/core";
25
- import { useUrlController, useSideEntityController } from "../../index";
26
+ import { useUrlController, useSidePanel } from "../../index";
26
27
 
27
28
  /**
28
29
  * @group Components
29
30
  */
30
- export interface EntitySelectionProps<M extends Record<string, unknown>> {
31
+ export interface SelectionProps<M extends Record<string, unknown>> {
31
32
 
32
33
  /**
33
34
  * Allow multiple selection of values
@@ -37,7 +38,7 @@ export interface EntitySelectionProps<M extends Record<string, unknown>> {
37
38
  /**
38
39
  * Entity collection config
39
40
  */
40
- collection?: EntityCollection<M>;
41
+ collection?: CollectionConfig<M>;
41
42
 
42
43
  /**
43
44
  * Absolute path of the collection.
@@ -87,20 +88,20 @@ export interface EntitySelectionProps<M extends Record<string, unknown>> {
87
88
 
88
89
  /**
89
90
  * This component allows to select entities from a given collection.
90
- * You probably want to open this dialog as a side view using {@link useEntitySelectionTable}
91
+ * You probably want to open this dialog as a side view using {@link useSelectionTableBinding}
91
92
  * @group Components
92
93
  */
93
- export function EntitySelectionTable<M extends Record<string, unknown>>(
94
- props: EntitySelectionProps<M>
94
+ export function SelectionTableBinding<M extends Record<string, unknown>>(
95
+ props: SelectionProps<M>
95
96
  ) {
96
97
  if (!props.collection) {
97
98
  return <ErrorView
98
99
  error={"Could not find collection"}/>
99
100
  }
100
- return <EntitySelectionTableInternal {...props} collection={props.collection} />;
101
+ return <SelectionTableBindingInternal {...props} collection={props.collection} />;
101
102
  }
102
103
 
103
- function EntitySelectionTableInternal<M extends Record<string, unknown>>(
104
+ function SelectionTableBindingInternal<M extends Record<string, unknown>>(
104
105
  {
105
106
  onSingleEntitySelected,
106
107
  onMultipleEntitiesSelected,
@@ -111,10 +112,10 @@ function EntitySelectionTableInternal<M extends Record<string, unknown>>(
111
112
  description,
112
113
  fixedFilter,
113
114
  maxSelection
114
- }: EntitySelectionProps<M> & { collection: EntityCollection<M> }) {
115
+ }: SelectionProps<M> & { collection: CollectionConfig<M> }) {
115
116
 
116
117
  const sideDialogContext = useSideDialogContext();
117
- const sideEntityController = useSideEntityController();
118
+ const sidePanelController = useSidePanel();
118
119
  const urlController = useUrlController();
119
120
  const analyticsController = useAnalyticsController();
120
121
 
@@ -212,7 +213,7 @@ function EntitySelectionTableInternal<M extends Record<string, unknown>>(
212
213
  analyticsController.onAnalyticsEvent?.("reference_selection_new_entity", {
213
214
  path
214
215
  });
215
- sideEntityController.open({
216
+ sidePanelController.open({
216
217
  path: path,
217
218
  collection,
218
219
  updateUrl: true,
@@ -237,7 +238,7 @@ function EntitySelectionTableInternal<M extends Record<string, unknown>>(
237
238
  }) => {
238
239
  const selectedEntities = selectionController.selectedEntities;
239
240
  const isSelected = selectedEntities && selectedEntities.map(e => e.id).indexOf(entity.id) > -1;
240
- return <EntityCollectionRowActions
241
+ return <CollectionRowActions
241
242
  width={width}
242
243
  frozen={frozen}
243
244
  entity={entity}
@@ -269,11 +270,12 @@ function EntitySelectionTableInternal<M extends Record<string, unknown>>(
269
270
 
270
271
  return (
271
272
 
273
+ <CollectionScopeProvider collection={collection}>
272
274
  <div className="flex flex-col h-full">
273
275
 
274
276
  <div className="grow">
275
277
  {entitiesDisplayedFirst &&
276
- <EntityCollectionTable
278
+ <CollectionTableBinding
277
279
  additionalFields={collection.additionalFields}
278
280
  displayedColumnIds={displayedColumnIds}
279
281
  onEntityClick={onEntityClick}
@@ -316,6 +318,7 @@ function EntitySelectionTableInternal<M extends Record<string, unknown>>(
316
318
  </Button>
317
319
  </DialogActions>
318
320
  </div>
321
+ </CollectionScopeProvider>
319
322
 
320
323
  );
321
324
 
@@ -327,7 +330,7 @@ function EntitySelectionDialogActions({
327
330
  onClear,
328
331
  onNewClick
329
332
  }: {
330
- collection: EntityCollection<any>,
333
+ collection: CollectionConfig<any>,
331
334
  path: string,
332
335
  onClear: () => void,
333
336
  onNewClick: () => void
@@ -1,5 +1,5 @@
1
- import { useEntitySelectionDialog } from "../hooks/useEntitySelectionDialog";
2
- import type { EntityCollection } from "@rebasepro/types";
1
+ import { useSelectionDialog } from "../hooks/useSelectionDialog";
2
+ import type { CollectionConfig } from "@rebasepro/types";
3
3
  import React, { useCallback, useMemo } from "react";
4
4
 
5
5
  import { Entity, EntityReference, FilterValues } from "@rebasepro/types";
@@ -55,7 +55,7 @@ export function ReferenceWidget<M extends Record<string, unknown>>({
55
55
 
56
56
  const collectionRegistryController = useCollectionRegistryController();
57
57
 
58
- const collection: EntityCollection | undefined = useMemo(() => {
58
+ const collection: CollectionConfig | undefined = useMemo(() => {
59
59
  return collectionRegistryController.getCollection(path);
60
60
  }, [path, collectionRegistryController.getCollection]);
61
61
 
@@ -83,7 +83,7 @@ export function ReferenceWidget<M extends Record<string, unknown>>({
83
83
  }
84
84
  }, [disabled, onReferenceSelected]);
85
85
 
86
- const referenceDialogController = useEntitySelectionDialog({
86
+ const referenceDialogController = useSelectionDialog({
87
87
  multiselect,
88
88
  path,
89
89
  collection,
@@ -24,10 +24,10 @@ import {
24
24
  import * as React from "react";
25
25
  import { useCallback, useEffect, useRef, useState } from "react";
26
26
  import { Command as CommandPrimitive } from "cmdk";
27
- import { Entity, EntityRelation, FilterValues, Relation } from "@rebasepro/types";
28
- import { EntityPreviewData } from "./EntityPreview";
27
+ import { Entity, EntityRelation, FilterValues, Relation, getCollectionDataPath } from "@rebasepro/types";
28
+ import { EntityPreviewBindingData } from "./EntityPreviewBinding";
29
29
  import { useData, useRelationSelector } from "@rebasepro/core";
30
- import { useSideEntityController } from "../hooks/useSideEntityController";
30
+ import { useSidePanel } from "../hooks/useSidePanel";
31
31
  import { normalizeToEntityRelation } from "@rebasepro/common";
32
32
  import { EmptyValue } from "../preview";
33
33
 
@@ -91,7 +91,7 @@ export const RelationSelector = React.forwardRef<
91
91
 
92
92
  const collection = relation.target();
93
93
  const dataClient = useData();
94
- const sideEntityController = useSideEntityController();
94
+ const sidePanelController = useSidePanel();
95
95
  const multiple = relation.cardinality === "many";
96
96
 
97
97
  const [isPopoverOpen, setIsPopoverOpen] = useState(false);
@@ -102,7 +102,7 @@ export const RelationSelector = React.forwardRef<
102
102
  // Track IDs that were set via local user interaction (onItemClick / handleClear / handleRemoveItem).
103
103
  // When an incoming value change matches these IDs exactly, we skip async re-resolution.
104
104
  const localSelectionIdsRef = useRef<string | null>(null);
105
- // Snapshot of selected IDs captured when the popover opens.
105
+ // Entity of selected IDs captured when the popover opens.
106
106
  // Used to sort the dropdown list so selected items appear at the top.
107
107
  // Stays stable for the entire popover session so items don't jump around.
108
108
  const pinnedIdsRef = useRef<Set<string> | null>(null);
@@ -115,7 +115,7 @@ export const RelationSelector = React.forwardRef<
115
115
  loadMore,
116
116
  entityToRelationItem
117
117
  } = useRelationSelector({
118
- path: collection.slug,
118
+ path: getCollectionDataPath(collection),
119
119
  collection,
120
120
  fixedFilter,
121
121
  pageSize
@@ -213,7 +213,8 @@ export const RelationSelector = React.forwardRef<
213
213
 
214
214
  if (hasEmbeddedData) {
215
215
  const r = rel as EntityRelation;
216
- newResolvedItems.push(toRelationItem(r.data!, r));
216
+ // CMS wire format embeds relation data as { id, path, values }
217
+ newResolvedItems.push(toRelationItem(r.data as unknown as Entity, r));
217
218
  } else if (currentSelectedMap.has(relId)) {
218
219
  // We already have it in currentSelected
219
220
  const existingItem = currentSelectedMap.get(relId)!;
@@ -248,7 +249,8 @@ export const RelationSelector = React.forwardRef<
248
249
  const relation = isPrimitive ? new EntityRelation(relId, path) : rel as EntityRelation;
249
250
 
250
251
  if (!isPrimitive && (rel as EntityRelation).data) {
251
- return toRelationItem((rel as EntityRelation).data!, relation);
252
+ // CMS wire format embeds relation data as { id, path, values }
253
+ return toRelationItem((rel as EntityRelation).data as unknown as Entity, relation);
252
254
  }
253
255
  if (currentSelectedMap.has(String(relId))) {
254
256
  return currentSelectedMap.get(String(relId))!;
@@ -485,11 +487,11 @@ relation } as RelationItem;
485
487
  <div key={String(item.id)}
486
488
  className="flex flex-row items-center gap-1 truncate">
487
489
  {item.data ? (
488
- <EntityPreviewData size={"medium"}
490
+ <EntityPreviewBindingData size={"medium"}
489
491
  entity={item.data}
490
492
  includeEntityLink={false}
491
493
  includeId={false}
492
- onSideEntityClick={closePopover}
494
+ onSidePanelClick={closePopover}
493
495
  />
494
496
  ) : (
495
497
  <span className="text-sm truncate">{item.label}</span>
@@ -504,7 +506,7 @@ relation } as RelationItem;
504
506
  className={cls("flex flex-row items-center gap-1 truncate")}
505
507
  >
506
508
  {item.data ? (
507
- <EntityPreviewData size={"smallest"} entity={item.data}
509
+ <EntityPreviewBindingData size={"smallest"} entity={item.data}
508
510
  includeEntityLink={false}
509
511
  includeId={false}/>
510
512
  ) : (
@@ -541,7 +543,7 @@ relation } as RelationItem;
541
543
  e.preventDefault();
542
544
  const entity = selectedItems[0].data!;
543
545
  setIsPopoverOpen(false);
544
- sideEntityController.open({
546
+ sidePanelController.open({
545
547
  entityId: entity.id,
546
548
  path: entity.path,
547
549
  collection,
@@ -634,7 +636,7 @@ relation } as RelationItem;
634
636
  <CommandPrimitive.Group>
635
637
  {(() => {
636
638
  // Sort items so that initially-selected (pinned) items appear first.
637
- // We use the snapshot taken when the popover opened so items don't
639
+ // We use the entity taken when the popover opened so items don't
638
640
  // jump around as the user checks/unchecks.
639
641
  const pinned = pinnedIdsRef.current;
640
642
  const sortedItems = pinned && pinned.size > 0
@@ -666,7 +668,7 @@ relation } as RelationItem;
666
668
  {item.data ? (
667
669
  <div
668
670
  className="flex flex-row items-center gap-2 min-w-0 w-full">
669
- <EntityPreviewData
671
+ <EntityPreviewBindingData
670
672
  size={multiple ? "smallest" : "medium"}
671
673
  entity={item.data}
672
674
  includeId={false}
@@ -1,19 +1,14 @@
1
- import { createSelectionStore } from "./SelectionStore";
2
- import type { Property } from "@rebasepro/types";
1
+ import { createSelectionStore, AdminSelectedCell } from "./SelectionStore";
2
+ import type { Property, WhereFilterOp } from "@rebasepro/types";
3
3
  import React, { useCallback, useEffect, useMemo, useRef } from "react";
4
- import { CollectionSize, Entity, EntityRelation, EntityTableController, FilterValues, SelectedCellProps } from "@rebasepro/types";
5
- import { CellRendererParams, TableView, VirtualTableColumn, VirtualTableFilterValues, OnRowClickParams, VirtualTableWhereFilterOp } from "@rebasepro/ui";
6
- import { enumToObjectEntries } from "@rebasepro/common";
7
- import { DEFAULT_PAGE_SIZE, EntityCollectionTableController, OnCellValueChange, OnColumnResizeParams } from "@rebasepro/core";
4
+ import { CollectionSize, Entity, EntityTableController, FilterValues, SelectedCellProps } from "@rebasepro/types";
5
+ import { CellRendererParams, TableView, VirtualTableColumn, VirtualTableFilterValues, OnRowClickParams } from "@rebasepro/ui";
6
+ import { DEFAULT_PAGE_SIZE, DataCollectionTableController, OnCellValueChange, OnColumnResizeParams } from "@rebasepro/core";
8
7
  import { FilterFormFieldProps } from "@rebasepro/ui";
9
- import { ReferenceFilterField } from "./filters/ReferenceFilterField";
10
- import { StringNumberFilterField } from "./filters/StringNumberFilterField";
11
- import { BooleanFilterField } from "./filters/BooleanFilterField";
12
- import { DateTimeFilterField } from "./filters/DateTimeFilterField";
13
8
  import { useOutsideAlerter } from "@rebasepro/ui";
14
9
  import { SelectableTableContext } from "./SelectableTableContext";
15
10
  import { getRowHeight } from "@rebasepro/core";
16
- import { RelationFilterField } from "./filters/RelationFilterField";
11
+ import { FilterFieldBinding } from "./filters/FilterFieldBinding";
17
12
 
18
13
  export type SelectableTableProps<M extends Record<string, unknown>> = {
19
14
 
@@ -107,23 +102,23 @@ export type SelectableTableProps<M extends Record<string, unknown>> = {
107
102
  * This component is in charge of rendering a collection table with a high
108
103
  * degree of customization.
109
104
  *
110
- * This component is used internally by {@link EntityCollectionView} and
105
+ * This component is used internally by {@link CollectionViewBinding} and
111
106
  * {@link useReferenceDialog}
112
107
  *
113
108
  * Please note that you only need to use this component if you are building
114
109
  * a custom view. If you just need to create a default view you can do it
115
110
  * exclusively with config options.
116
111
  *
117
- * If you want to bind a {@link EntityCollection} to a table with the default
112
+ * If you want to bind a {@link CollectionConfig} to a table with the default
118
113
  * options you see in collections in the top level navigation, you can
119
- * check {@link EntityCollectionView}.
114
+ * check {@link CollectionViewBinding}.
120
115
  *
121
116
  * The data displayed in the table is managed by a {@link EntityTableController}.
122
117
  * You can build the default, bound to a path in the driver, by using the hook
123
118
  * {@link useDataTableController}
124
119
  *
125
- * @see EntityCollectionTableProps
126
- * @see EntityCollectionView
120
+ * @see CollectionTableBindingProps
121
+ * @see CollectionViewBinding
127
122
  * @see VirtualTable
128
123
  * @group Components
129
124
  */
@@ -192,7 +187,15 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
192
187
 
193
188
  const select = useCallback((cell?: SelectedCellProps<M>) => {
194
189
  setLocalSelectedCell(cell);
195
- selectionStore.select(cell);
190
+ if (cell) {
191
+ selectionStore.select({
192
+ ...cell,
193
+ columnKey: cell.propertyKey,
194
+ id: cell.entityId
195
+ } as AdminSelectedCell);
196
+ } else {
197
+ selectionStore.select(undefined);
198
+ }
196
199
  }, [selectionStore]);
197
200
 
198
201
  const unselect = useCallback(() => {
@@ -236,7 +239,29 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
236
239
  size: size ?? "m",
237
240
  selectionStore,
238
241
  setPopupCell
239
- } as unknown as EntityCollectionTableController<Record<string, unknown>>), [setPopupCell, select, onValueChange, size, selectionStore]);
242
+ } as unknown as DataCollectionTableController<Record<string, unknown>>), [setPopupCell, select, onValueChange, size, selectionStore]);
243
+
244
+ const createFilterField = useCallback(({
245
+ id,
246
+ filterValue,
247
+ setFilterValue,
248
+ column,
249
+ hidden,
250
+ setHidden
251
+ }: FilterFormFieldProps<unknown>): React.ReactNode => {
252
+ if (!column.custom) return null;
253
+ const { resolvedProperty } = column.custom as { resolvedProperty?: Property };
254
+ if (!resolvedProperty) return null;
255
+ // Engine-aware operator resolution happens inside FilterFieldBinding,
256
+ // which reads the collection from the surrounding CollectionScopeProvider.
257
+ return <FilterFieldBinding
258
+ propertyKey={id as string}
259
+ property={resolvedProperty}
260
+ value={filterValue as [WhereFilterOp, unknown] | undefined}
261
+ setValue={setFilterValue as (value?: [WhereFilterOp, unknown]) => void}
262
+ hidden={hidden}
263
+ setHidden={setHidden}/>;
264
+ }, []);
240
265
 
241
266
  return (
242
267
  <SelectableTableContext.Provider
@@ -255,7 +280,7 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
255
280
  onColumnResize={onColumnResize}
256
281
  rowHeight={getRowHeight(size)}
257
282
  loading={dataLoading}
258
- filter={filterValues}
283
+ filter={filterValues as any}
259
284
  onFilterUpdate={setFilterValues ? onFilterUpdate : undefined}
260
285
  sortBy={sortBy}
261
286
  onSortByUpdate={setSortBy as ((sortBy?: [string, "asc" | "desc"]) => void)}
@@ -281,74 +306,4 @@ export const SelectableTable = function SelectableTable<M extends Record<string,
281
306
 
282
307
  };
283
308
 
284
- function createFilterField({
285
- id,
286
- filterValue,
287
- setFilterValue,
288
- column,
289
- hidden,
290
- setHidden
291
- }: FilterFormFieldProps<unknown>): React.ReactNode {
292
-
293
- if (!column.custom) {
294
- return null;
295
- }
296
-
297
- const { resolvedProperty } = column.custom as { resolvedProperty?: Property };
298
-
299
- const isArray = resolvedProperty?.type === "array";
300
- const ofVal = isArray && resolvedProperty ? resolvedProperty.of : undefined;
301
- const baseProperty: Property | undefined = isArray ? (Array.isArray(ofVal) ? ofVal[0] : ofVal) : resolvedProperty;
302
- if (!baseProperty) {
303
- return null;
304
- }
305
- if (baseProperty.type === "reference") {
306
- return <ReferenceFilterField value={filterValue}
307
- setValue={setFilterValue}
308
- name={id as string}
309
- isArray={isArray}
310
- path={baseProperty.path}
311
- title={resolvedProperty?.name}
312
- includeId={baseProperty.includeId}
313
- previewProperties={baseProperty?.ui?.previewProperties}
314
- hidden={hidden}
315
- setHidden={setHidden}/>;
316
- } else if (baseProperty.type === "relation" && baseProperty.relation) {
317
- return <RelationFilterField value={filterValue as [VirtualTableWhereFilterOp, EntityRelation | EntityRelation[] | null]}
318
- setValue={setFilterValue}
319
- name={id as string}
320
- relation={baseProperty.relation}
321
- hidden={hidden}
322
- setHidden={setHidden}/>;
323
- } else if (baseProperty.type === "number" || baseProperty.type === "string") {
324
- const name = baseProperty.name;
325
- const enumValues = baseProperty.enum ? enumToObjectEntries(baseProperty.enum) : undefined;
326
- return <StringNumberFilterField value={filterValue}
327
- setValue={setFilterValue}
328
- name={id as string}
329
- type={baseProperty.type}
330
- isArray={isArray}
331
- enumValues={enumValues}
332
- title={name}/>;
333
- } else if (baseProperty.type === "boolean") {
334
- const name = baseProperty.name;
335
- return <BooleanFilterField value={filterValue}
336
- setValue={setFilterValue}
337
- name={id as string}
338
- title={name}/>;
339
-
340
- } else if (baseProperty.type === "date") {
341
- const title = baseProperty.name;
342
- return <DateTimeFilterField value={filterValue}
343
- setValue={setFilterValue}
344
- name={id as string}
345
- mode={baseProperty.mode}
346
- isArray={isArray}
347
- title={title}/>;
348
- }
349
-
350
- return (
351
- <div>{`Currently the filter field ${resolvedProperty?.type} is not supported`}</div>
352
- );
353
- }
354
309
 
@@ -1,7 +1,7 @@
1
1
  import React, { useContext } from "react";
2
- import { EntityCollectionTableController } from "@rebasepro/core";
2
+ import { DataCollectionTableController } from "@rebasepro/core";
3
3
 
4
- export const SelectableTableContext = React.createContext<EntityCollectionTableController<Record<string, unknown>>>(null! as EntityCollectionTableController<Record<string, unknown>>);
4
+ export const SelectableTableContext = React.createContext<DataCollectionTableController<Record<string, unknown>>>(null! as DataCollectionTableController<Record<string, unknown>>);
5
5
 
6
6
  export const useSelectableTableController = <M extends Record<string, unknown> = Record<string, unknown>>() =>
7
- useContext(SelectableTableContext) as unknown as EntityCollectionTableController<M>;
7
+ useContext(SelectableTableContext) as unknown as DataCollectionTableController<M>;