@rebasepro/cms 0.28.2 → 0.29.0-canary.g0e3a0e7

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 (339) hide show
  1. package/README.md +3 -3
  2. package/dist/collection_editor/_cms_internals.d.ts +0 -1
  3. package/dist/collection_editor/ui/EditorCollectionAction.d.ts +2 -2
  4. package/dist/collection_editor/ui/EditorCollectionAction.js.map +1 -1
  5. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js +2 -2
  6. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js.map +1 -1
  7. package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.js +1 -1
  8. package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.js.map +1 -1
  9. package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.js +1 -1
  10. package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.js.map +1 -1
  11. package/dist/components/AdditionalFieldValue.d.ts +9 -3
  12. package/dist/components/AdditionalFieldValue.js +7 -4
  13. package/dist/components/AdditionalFieldValue.js.map +1 -1
  14. package/dist/components/CollectionPanel.d.ts +117 -18
  15. package/dist/components/CollectionPanel.js +115 -37
  16. package/dist/components/CollectionPanel.js.map +1 -1
  17. package/dist/components/CollectionTableBinding/CollectionRowActions.d.ts +5 -5
  18. package/dist/components/CollectionTableBinding/CollectionRowActions.js +16 -12
  19. package/dist/components/CollectionTableBinding/CollectionRowActions.js.map +1 -1
  20. package/dist/components/CollectionTableBinding/CollectionTableBinding.js +33 -8
  21. package/dist/components/CollectionTableBinding/CollectionTableBinding.js.map +1 -1
  22. package/dist/components/CollectionTableBinding/CollectionTableBindingProps.d.ts +8 -3
  23. package/dist/components/CollectionTableBinding/PropertyTableCell.js +2 -2
  24. package/dist/components/CollectionTableBinding/PropertyTableCell.js.map +1 -1
  25. package/dist/components/CollectionTableBinding/column_utils.d.ts +9 -1
  26. package/dist/components/CollectionTableBinding/column_utils.js +6 -3
  27. package/dist/components/CollectionTableBinding/column_utils.js.map +1 -1
  28. package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js +2 -2
  29. package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js.map +1 -1
  30. package/dist/components/CollectionTableBinding/fields/TableReferenceField.js +2 -2
  31. package/dist/components/CollectionTableBinding/fields/TableReferenceField.js.map +1 -1
  32. package/dist/components/CollectionTableBinding/fields/TableRelationField.js +2 -2
  33. package/dist/components/CollectionTableBinding/fields/TableRelationField.js.map +1 -1
  34. package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.d.ts +3 -2
  35. package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.js +9 -7
  36. package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.js.map +1 -1
  37. package/dist/components/CollectionTableBinding/internal/common.d.ts +26 -2
  38. package/dist/components/CollectionTableBinding/internal/common.js +88 -4
  39. package/dist/components/CollectionTableBinding/internal/common.js.map +1 -1
  40. package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js +4 -3
  41. package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js.map +1 -1
  42. package/dist/components/CollectionViewBinding/BoardCardBinding.d.ts +7 -1
  43. package/dist/components/CollectionViewBinding/BoardCardBinding.js +19 -14
  44. package/dist/components/CollectionViewBinding/BoardCardBinding.js.map +1 -1
  45. package/dist/components/CollectionViewBinding/CollectionAddButton.d.ts +28 -0
  46. package/dist/components/CollectionViewBinding/CollectionAddButton.js +50 -0
  47. package/dist/components/CollectionViewBinding/CollectionAddButton.js.map +1 -0
  48. package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.d.ts +11 -3
  49. package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js +9 -4
  50. package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js.map +1 -1
  51. package/dist/components/CollectionViewBinding/CollectionCardViewBinding.d.ts +5 -3
  52. package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js +5 -3
  53. package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js.map +1 -1
  54. package/dist/components/CollectionViewBinding/CollectionEntityActions.d.ts +29 -0
  55. package/dist/components/CollectionViewBinding/CollectionEntityActions.js +112 -0
  56. package/dist/components/CollectionViewBinding/CollectionEntityActions.js.map +1 -0
  57. package/dist/components/CollectionViewBinding/CollectionListViewBinding.d.ts +2 -2
  58. package/dist/components/CollectionViewBinding/CollectionListViewBinding.js +58 -16
  59. package/dist/components/CollectionViewBinding/CollectionListViewBinding.js.map +1 -1
  60. package/dist/components/CollectionViewBinding/CollectionToolbar.d.ts +57 -0
  61. package/dist/components/CollectionViewBinding/CollectionToolbar.js +146 -0
  62. package/dist/components/CollectionViewBinding/CollectionToolbar.js.map +1 -0
  63. package/dist/components/CollectionViewBinding/CollectionViewActions.d.ts +2 -2
  64. package/dist/components/CollectionViewBinding/CollectionViewActions.js +22 -26
  65. package/dist/components/CollectionViewBinding/CollectionViewActions.js.map +1 -1
  66. package/dist/components/CollectionViewBinding/CollectionViewBinding.d.ts +58 -22
  67. package/dist/components/CollectionViewBinding/CollectionViewBinding.js +81 -1089
  68. package/dist/components/CollectionViewBinding/CollectionViewBinding.js.map +1 -1
  69. package/dist/components/CollectionViewBinding/CollectionViewContent.d.ts +9 -0
  70. package/dist/components/CollectionViewBinding/CollectionViewContent.js +152 -0
  71. package/dist/components/CollectionViewBinding/CollectionViewContent.js.map +1 -0
  72. package/dist/components/CollectionViewBinding/CollectionViewDialogs.d.ts +9 -0
  73. package/dist/components/CollectionViewBinding/CollectionViewDialogs.js +38 -0
  74. package/dist/components/CollectionViewBinding/CollectionViewDialogs.js.map +1 -0
  75. package/dist/components/CollectionViewBinding/CollectionViewFrame.d.ts +13 -0
  76. package/dist/components/CollectionViewBinding/CollectionViewFrame.js +32 -0
  77. package/dist/components/CollectionViewBinding/CollectionViewFrame.js.map +1 -0
  78. package/dist/components/CollectionViewBinding/CollectionViewScope.d.ts +14 -0
  79. package/dist/components/CollectionViewBinding/CollectionViewScope.js +22 -0
  80. package/dist/components/CollectionViewBinding/CollectionViewScope.js.map +1 -0
  81. package/dist/components/CollectionViewBinding/CollectionViewStartActions.d.ts +2 -2
  82. package/dist/components/CollectionViewBinding/CollectionViewStartActions.js +39 -67
  83. package/dist/components/CollectionViewBinding/CollectionViewStartActions.js.map +1 -1
  84. package/dist/components/CollectionViewBinding/CustomViewHost.d.ts +28 -0
  85. package/dist/components/CollectionViewBinding/CustomViewHost.js +54 -0
  86. package/dist/components/CollectionViewBinding/CustomViewHost.js.map +1 -0
  87. package/dist/components/CollectionViewBinding/EntitiesCount.d.ts +24 -0
  88. package/dist/components/CollectionViewBinding/EntitiesCount.js +69 -0
  89. package/dist/components/CollectionViewBinding/EntitiesCount.js.map +1 -0
  90. package/dist/components/CollectionViewBinding/EntityCardBinding.d.ts +7 -1
  91. package/dist/components/CollectionViewBinding/EntityCardBinding.js +34 -23
  92. package/dist/components/CollectionViewBinding/EntityCardBinding.js.map +1 -1
  93. package/dist/components/CollectionViewBinding/EntityIdHeaderWidget.d.ts +17 -0
  94. package/dist/components/CollectionViewBinding/EntityIdHeaderWidget.js +107 -0
  95. package/dist/components/CollectionViewBinding/EntityIdHeaderWidget.js.map +1 -0
  96. package/dist/components/CollectionViewBinding/FiltersButton.d.ts +15 -0
  97. package/dist/components/CollectionViewBinding/FiltersButton.js +49 -0
  98. package/dist/components/CollectionViewBinding/FiltersButton.js.map +1 -0
  99. package/dist/components/CollectionViewBinding/PluginColumnSlots.d.ts +35 -0
  100. package/dist/components/CollectionViewBinding/PluginColumnSlots.js +45 -0
  101. package/dist/components/CollectionViewBinding/PluginColumnSlots.js.map +1 -0
  102. package/dist/components/CollectionViewBinding/RowActions.d.ts +40 -0
  103. package/dist/components/CollectionViewBinding/RowActions.js +60 -0
  104. package/dist/components/CollectionViewBinding/RowActions.js.map +1 -0
  105. package/dist/components/CollectionViewBinding/SplitListView.d.ts +7 -4
  106. package/dist/components/CollectionViewBinding/SplitListView.js +20 -21
  107. package/dist/components/CollectionViewBinding/SplitListView.js.map +1 -1
  108. package/dist/components/CollectionViewBinding/builtin_action_props.d.ts +13 -0
  109. package/dist/components/CollectionViewBinding/fields.d.ts +22 -0
  110. package/dist/components/CollectionViewBinding/fields.js +47 -0
  111. package/dist/components/CollectionViewBinding/fields.js.map +1 -0
  112. package/dist/components/CollectionViewBinding/useBoardDataController.js +6 -7
  113. package/dist/components/CollectionViewBinding/useBoardDataController.js.map +1 -1
  114. package/dist/components/CollectionViewBinding/useCollectionLargeLayout.d.ts +19 -0
  115. package/dist/components/CollectionViewBinding/useCollectionLargeLayout.js +28 -0
  116. package/dist/components/CollectionViewBinding/useCollectionLargeLayout.js.map +1 -0
  117. package/dist/components/CollectionViewBinding/useCollectionViewState.d.ts +125 -0
  118. package/dist/components/CollectionViewBinding/useCollectionViewState.js +844 -0
  119. package/dist/components/CollectionViewBinding/useCollectionViewState.js.map +1 -0
  120. package/dist/components/CollectionViewBinding/usePreviewSlots.d.ts +20 -0
  121. package/dist/components/CollectionViewBinding/usePreviewSlots.js +23 -2
  122. package/dist/components/CollectionViewBinding/usePreviewSlots.js.map +1 -1
  123. package/dist/components/CollectionViewBinding/useSelectionController.d.ts +21 -3
  124. package/dist/components/CollectionViewBinding/useSelectionController.js +37 -6
  125. package/dist/components/CollectionViewBinding/useSelectionController.js.map +1 -1
  126. package/dist/components/CollectionsProvider.d.ts +3 -3
  127. package/dist/components/CollectionsProvider.js +4 -4
  128. package/dist/components/CollectionsProvider.js.map +1 -1
  129. package/dist/components/CollectionsScopeContext.d.ts +1 -1
  130. package/dist/components/CollectionsScopeContext.js +1 -1
  131. package/dist/components/CollectionsScopeContext.js.map +1 -1
  132. package/dist/components/DeleteEntityDialog.d.ts +1 -1
  133. package/dist/components/DeleteEntityDialog.js +2 -2
  134. package/dist/components/DeleteEntityDialog.js.map +1 -1
  135. package/dist/components/DetailViewBinding.js +32 -68
  136. package/dist/components/DetailViewBinding.js.map +1 -1
  137. package/dist/components/EditFormActions.js +5 -4
  138. package/dist/components/EditFormActions.js.map +1 -1
  139. package/dist/components/EditViewBinding.d.ts +2 -2
  140. package/dist/components/EditViewBinding.js +25 -15
  141. package/dist/components/EditViewBinding.js.map +1 -1
  142. package/dist/components/EntityDisplayHeader.js +8 -5
  143. package/dist/components/EntityDisplayHeader.js.map +1 -1
  144. package/dist/components/EntityPreviewBinding.js +1 -1
  145. package/dist/components/EntityPreviewBinding.js.map +1 -1
  146. package/dist/components/EntityViewBinding.d.ts +8 -1
  147. package/dist/components/EntityViewBinding.js +43 -14
  148. package/dist/components/EntityViewBinding.js.map +1 -1
  149. package/dist/components/EntityViewBody.d.ts +40 -0
  150. package/dist/components/EntityViewBody.js +90 -0
  151. package/dist/components/EntityViewBody.js.map +1 -0
  152. package/dist/components/FieldValue.d.ts +50 -0
  153. package/dist/components/FieldValue.js +81 -0
  154. package/dist/components/FieldValue.js.map +1 -0
  155. package/dist/components/InlineEntityPreview.js +1 -1
  156. package/dist/components/InlineEntityPreview.js.map +1 -1
  157. package/dist/components/PanelNotFound.d.ts +5 -0
  158. package/dist/components/PanelNotFound.js +21 -0
  159. package/dist/components/PanelNotFound.js.map +1 -0
  160. package/dist/components/RebaseCMS.d.ts +1 -1
  161. package/dist/components/RebaseCMS.js +11 -3
  162. package/dist/components/RebaseCMS.js.map +1 -1
  163. package/dist/components/RebaseNavigation.js +9 -3
  164. package/dist/components/RebaseNavigation.js.map +1 -1
  165. package/dist/components/RebaseShell.js +10 -5
  166. package/dist/components/RebaseShell.js.map +1 -1
  167. package/dist/components/RecordDetail.d.ts +61 -0
  168. package/dist/components/RecordDetail.js +123 -0
  169. package/dist/components/RecordDetail.js.map +1 -0
  170. package/dist/components/RecordForm.d.ts +126 -0
  171. package/dist/components/{EntityFormPanel.js → RecordForm.js} +64 -36
  172. package/dist/components/RecordForm.js.map +1 -0
  173. package/dist/components/ReferenceTable/SelectionTableBinding.d.ts +47 -17
  174. package/dist/components/ReferenceTable/SelectionTableBinding.js +89 -53
  175. package/dist/components/ReferenceTable/SelectionTableBinding.js.map +1 -1
  176. package/dist/components/ReferenceWidget.d.ts +5 -3
  177. package/dist/components/ReferenceWidget.js +10 -7
  178. package/dist/components/ReferenceWidget.js.map +1 -1
  179. package/dist/components/RelationSelector.js +4 -4
  180. package/dist/components/RelationSelector.js.map +1 -1
  181. package/dist/components/SelectableTable/SelectableTable.js +2 -3
  182. package/dist/components/SelectableTable/SelectableTable.js.map +1 -1
  183. package/dist/components/SelectableTable/SelectionStore.d.ts +1 -1
  184. package/dist/components/SelectableTable/SelectionStore.js +1 -1
  185. package/dist/components/SelectableTable/SelectionStore.js.map +1 -1
  186. package/dist/components/SelectableTable/filters/ReferenceFilterField.js +2 -2
  187. package/dist/components/SelectableTable/filters/ReferenceFilterField.js.map +1 -1
  188. package/dist/components/SidePanelBinding.js +13 -12
  189. package/dist/components/SidePanelBinding.js.map +1 -1
  190. package/dist/components/collection_prop.d.ts +18 -0
  191. package/dist/components/collection_prop.js +23 -0
  192. package/dist/components/collection_prop.js.map +1 -0
  193. package/dist/components/common/default_entity_actions.js +54 -54
  194. package/dist/components/common/default_entity_actions.js.map +1 -1
  195. package/dist/components/history/EntityHistoryView.d.ts +4 -1
  196. package/dist/components/history/EntityHistoryView.js +1 -1
  197. package/dist/components/history/EntityHistoryView.js.map +1 -1
  198. package/dist/components/history/LastEditedByFormAction.d.ts +1 -1
  199. package/dist/components/index.d.ts +4 -2
  200. package/dist/data_export/export/ExportCollectionAction.d.ts +3 -2
  201. package/dist/data_export/export/ExportCollectionAction.js +4 -3
  202. package/dist/data_export/export/ExportCollectionAction.js.map +1 -1
  203. package/dist/data_export/export/additional_fields.d.ts +6 -3
  204. package/dist/data_export/export/additional_fields.js +8 -4
  205. package/dist/data_export/export/additional_fields.js.map +1 -1
  206. package/dist/data_import/import/ImportCollectionAction.js +2 -2
  207. package/dist/data_import/import/ImportCollectionAction.js.map +1 -1
  208. package/dist/form/EntityForm.d.ts +1 -1
  209. package/dist/form/EntityForm.js +252 -150
  210. package/dist/form/EntityForm.js.map +1 -1
  211. package/dist/form/EntityFormActions.js +3 -2
  212. package/dist/form/EntityFormActions.js.map +1 -1
  213. package/dist/form/EntityFormBinding.d.ts +1 -1
  214. package/dist/form/EntityFormBinding.js +22 -11
  215. package/dist/form/EntityFormBinding.js.map +1 -1
  216. package/dist/form/FormField.d.ts +36 -0
  217. package/dist/form/FormField.js +41 -0
  218. package/dist/form/FormField.js.map +1 -0
  219. package/dist/form/FormFieldsContext.d.ts +69 -0
  220. package/dist/form/FormFieldsContext.js +143 -0
  221. package/dist/form/FormFieldsContext.js.map +1 -0
  222. package/dist/form/PropertyFieldBinding.js +4 -4
  223. package/dist/form/PropertyFieldBinding.js.map +1 -1
  224. package/dist/form/collection_showing.d.ts +8 -0
  225. package/dist/form/collection_showing.js +29 -0
  226. package/dist/form/collection_showing.js.map +1 -0
  227. package/dist/form/components/ErrorFocus.js +2 -1
  228. package/dist/form/components/ErrorFocus.js.map +1 -1
  229. package/dist/form/components/FieldBlock.js +3 -1
  230. package/dist/form/components/FieldBlock.js.map +1 -1
  231. package/dist/form/components/FormRail.d.ts +5 -1
  232. package/dist/form/components/FormRail.js +5 -1
  233. package/dist/form/components/FormRail.js.map +1 -1
  234. package/dist/form/components/FormSections.d.ts +5 -1
  235. package/dist/form/components/FormSections.js +11 -4
  236. package/dist/form/components/FormSections.js.map +1 -1
  237. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js +2 -2
  238. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js.map +1 -1
  239. package/dist/form/field_bindings/MarkdownEditorFieldBinding.js +1 -1
  240. package/dist/form/field_bindings/MarkdownEditorFieldBinding.js.map +1 -1
  241. package/dist/form/field_bindings/MultipleRelationFieldBinding.js +2 -2
  242. package/dist/form/field_bindings/MultipleRelationFieldBinding.js.map +1 -1
  243. package/dist/form/field_bindings/ReadOnlyFieldBinding.js.map +1 -1
  244. package/dist/form/field_bindings/ReferenceFieldBinding.js +2 -2
  245. package/dist/form/field_bindings/ReferenceFieldBinding.js.map +1 -1
  246. package/dist/form/field_bindings/RelationFieldBinding.js +2 -2
  247. package/dist/form/field_bindings/RelationFieldBinding.js.map +1 -1
  248. package/dist/form/field_bindings/StorageUploadFieldBinding.js +1 -1
  249. package/dist/form/field_bindings/StorageUploadFieldBinding.js.map +1 -1
  250. package/dist/form/form_dom_ids.d.ts +25 -0
  251. package/dist/form/form_dom_ids.js +42 -0
  252. package/dist/form/form_dom_ids.js.map +1 -0
  253. package/dist/form/index.d.ts +3 -1
  254. package/dist/form/resolve_cell_property.d.ts +5 -0
  255. package/dist/form/resolve_cell_property.js +22 -1
  256. package/dist/form/resolve_cell_property.js.map +1 -1
  257. package/dist/hooks/index.d.ts +1 -1
  258. package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +2 -2
  259. package/dist/hooks/navigation/useBuildNavigationStateController.js.map +1 -1
  260. package/dist/hooks/navigation/useNavigationResolution.d.ts +3 -3
  261. package/dist/hooks/navigation/useNavigationResolution.js.map +1 -1
  262. package/dist/hooks/navigation/useResolvedCollections.d.ts +2 -2
  263. package/dist/hooks/navigation/useResolvedCollections.js.map +1 -1
  264. package/dist/hooks/navigation/useResolvedViews.d.ts +2 -2
  265. package/dist/hooks/navigation/useResolvedViews.js.map +1 -1
  266. package/dist/hooks/useBuildSidePanel.js +9 -9
  267. package/dist/hooks/useBuildSidePanel.js.map +1 -1
  268. package/dist/hooks/useEntityDisplay.js +6 -4
  269. package/dist/hooks/useEntityDisplay.js.map +1 -1
  270. package/dist/hooks/useRecordActions.js +2 -2
  271. package/dist/hooks/useRecordActions.js.map +1 -1
  272. package/dist/hooks/useSelectionDialog.d.ts +20 -7
  273. package/dist/hooks/useSelectionDialog.js +29 -8
  274. package/dist/hooks/useSelectionDialog.js.map +1 -1
  275. package/dist/index.d.ts +8 -3
  276. package/dist/index.js +15 -9
  277. package/dist/mcp-view.d.ts +9 -0
  278. package/dist/mcp-view.js +2 -0
  279. package/dist/mcp_view/app_modules.d.ts +29 -0
  280. package/dist/mcp_view/app_modules.js +163 -0
  281. package/dist/mcp_view/app_modules.js.map +1 -0
  282. package/dist/mcp_view/bridge.d.ts +90 -0
  283. package/dist/mcp_view/bridge.js +205 -0
  284. package/dist/mcp_view/bridge.js.map +1 -0
  285. package/dist/mcp_view/code_app.d.ts +65 -0
  286. package/dist/mcp_view/code_app.js +139 -0
  287. package/dist/mcp_view/code_app.js.map +1 -0
  288. package/dist/mcp_view/index.d.ts +48 -0
  289. package/dist/mcp_view/index.js +235 -0
  290. package/dist/mcp_view/index.js.map +1 -0
  291. package/dist/mcp_view/payload.d.ts +78 -0
  292. package/dist/mcp_view/payload.js +155 -0
  293. package/dist/mcp_view/payload.js.map +1 -0
  294. package/dist/mcp_view/screen.d.ts +28 -0
  295. package/dist/mcp_view/screen.js +223 -0
  296. package/dist/mcp_view/screen.js.map +1 -0
  297. package/dist/mcp_view/storage_source.d.ts +14 -0
  298. package/dist/mcp_view/storage_source.js +29 -0
  299. package/dist/mcp_view/storage_source.js.map +1 -0
  300. package/dist/mcp_view/store.d.ts +9 -0
  301. package/dist/mcp_view/store.js +27 -0
  302. package/dist/mcp_view/store.js.map +1 -0
  303. package/dist/mcp_view/tool_driver.d.ts +135 -0
  304. package/dist/mcp_view/tool_driver.js +527 -0
  305. package/dist/mcp_view/tool_driver.js.map +1 -0
  306. package/dist/preview/components/DatePreview.d.ts +34 -1
  307. package/dist/preview/components/DatePreview.js +72 -37
  308. package/dist/preview/components/DatePreview.js.map +1 -1
  309. package/dist/routes/RebaseRoute.js +1 -1
  310. package/dist/routes/RebaseRoute.js.map +1 -1
  311. package/dist/selection/SelectionMenu.d.ts +5 -3
  312. package/dist/selection/SelectionMenu.js +16 -9
  313. package/dist/selection/SelectionMenu.js.map +1 -1
  314. package/dist/selection/index.d.ts +2 -1
  315. package/dist/selection/resolve_selection.d.ts +61 -7
  316. package/dist/selection/resolve_selection.js +93 -11
  317. package/dist/selection/resolve_selection.js.map +1 -1
  318. package/dist/types/components/EntityFormProps.d.ts +60 -10
  319. package/dist/types/fields.d.ts +2 -65
  320. package/dist/util/dataControllerAdapter.d.ts +8 -0
  321. package/dist/util/dataControllerAdapter.js +11 -0
  322. package/dist/util/dataControllerAdapter.js.map +1 -1
  323. package/dist/util/navigation_utils.d.ts +5 -4
  324. package/dist/util/navigation_utils.js +6 -6
  325. package/dist/util/navigation_utils.js.map +1 -1
  326. package/dist/util/propertyConfigMapper.d.ts +8 -0
  327. package/dist/util/propertyConfigMapper.js +16 -2
  328. package/dist/util/propertyConfigMapper.js.map +1 -1
  329. package/package.json +15 -9
  330. package/recipes/README.md +79 -26
  331. package/recipes/approval-queue.tsx +79 -0
  332. package/recipes/bulk-set-status.tsx +23 -17
  333. package/recipes/calendar-view.tsx +28 -23
  334. package/recipes/master-detail.tsx +75 -0
  335. package/recipes/my-preferences.tsx +3 -3
  336. package/recipes/orders-dashboard.tsx +58 -84
  337. package/recipes/site-settings.tsx +4 -4
  338. package/dist/components/EntityFormPanel.d.ts +0 -63
  339. package/dist/components/EntityFormPanel.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"EntityCardBinding.js","names":[],"sources":["../../../src/components/CollectionViewBinding/EntityCardBinding.tsx"],"sourcesContent":["\nimport React, { useMemo } from \"react\";\nimport { Entity } from \"@rebasepro/types\";\nimport { CollectionSize, AdminCollection } from \"@rebasepro/cms-types\";\nimport {\n Card,\n Checkbox,\n Chip,\n cls,\n Typography\n} from \"@rebasepro/ui\";\nimport { PropertyPreview } from \"../../preview\";\nimport {\n useAuthController,\n useCustomizationController\n} from \"@rebasepro/app\";\nimport { useAnalyticsController, useTranslation } from \"@rebasepro/app\";\nimport { IconForView } from \"@rebasepro/app\";\nimport { useCollectionSlotKeys, useEntitySlots } from \"./usePreviewSlots\";\nimport { Highlighted } from \"./SearchHighlight\";\nimport { useSearchExplanation, MatchExplanation, fieldLabel } from \"./SearchExplanation\";\nimport { SlotValue, TagChips } from \"./SlotValue\";\n\nexport type EntityCardBindingProps<M extends Record<string, unknown> = Record<string, unknown>> = {\n /** The active search, so a card can mark the hit and say where it was. */\n searchString?: string;\n entity: Entity<M>;\n collection: AdminCollection<M>;\n /**\n * The card was clicked.\n *\n * Carries the originating event as well as the entity, because the grid's\n * own handler needs it: `CardView` hands `renderCard` an\n * `(e: React.MouseEvent) => void` that reads `e.metaKey` / `e.ctrlKey` and\n * calls `e.preventDefault()`. That handler used to be passed here through\n * `onClick as any` and then invoked with the *entity*, so its modifier\n * branch read `entity.metaKey` — always undefined — and never ran.\n */\n onClick?: (entity: Entity<M>, event?: React.MouseEvent) => void;\n selected?: boolean;\n highlighted?: boolean;\n onSelectionChange?: (entity: Entity<M>, selected: boolean) => void;\n selectionEnabled?: boolean;\n /**\n * Size of the card - affects checkbox styling\n */\n size?: CollectionSize;\n};\n\n/**\n * Card component for displaying a entity in a grid view.\n * Shows thumbnail, title, and preview properties via the shared slot system.\n */\nexport function EntityCardBinding<M extends Record<string, unknown> = Record<string, unknown>>({\n entity,\n collection,\n onClick,\n selected,\n highlighted,\n onSelectionChange,\n selectionEnabled,\n size = \"m\",\n searchString\n}: EntityCardBindingProps<M>) {\n const { t } = useTranslation();\n const authController = useAuthController();\n const analyticsController = useAnalyticsController();\n const customizationController = useCustomizationController();\n\n const slotKeys = useCollectionSlotKeys(\n collection as AdminCollection<Record<string, unknown>>,\n authController,\n customizationController.propertyConfigs\n );\n\n const slots = useEntitySlots(\n entity as Entity<Record<string, unknown>>,\n collection as AdminCollection<Record<string, unknown>>,\n slotKeys\n );\n\n // Same explanation the list shows, so a reader switching view modes does\n // not lose the reason a card is in front of them.\n const { terms, offSlot } = useSearchExplanation(\n entity,\n collection.properties as Record<string, unknown>,\n [slotKeys.titleKey, slotKeys.subtitleKey],\n searchString\n );\n\n // The event is optional because `Card` activates by keyboard too, calling\n // `onClick?.()` with nothing on Enter/Space. That path is real, and it is\n // why this cannot simply require one.\n const handleClick = (e?: React.MouseEvent) => {\n // Cmd+click (Mac) or Ctrl+click (Windows) toggles selection\n if (e && (e.metaKey || e.ctrlKey) && selectionEnabled) {\n e.preventDefault();\n onSelectionChange?.(entity, !selected);\n return;\n }\n if (onClick) {\n analyticsController.onAnalyticsEvent?.(\"card_view_entity_click\", {\n path: entity.path,\n entityId: entity.id\n });\n onClick(entity, e);\n }\n };\n\n const handleCheckboxClick = (e: React.MouseEvent) => {\n e.stopPropagation();\n };\n\n const handleSelectionChange = (checked: boolean) => {\n onSelectionChange?.(entity, checked);\n };\n\n return (\n <Card\n className={cls(\n \"cursor-pointer overflow-hidden group relative\",\n \"transition-all duration-200\",\n \"hover:shadow-lg hover:-translate-y-0.5\",\n selected && \"ring-2 ring-primary bg-surface-raised\",\n highlighted && !selected && \"ring-2 ring-primary/50 bg-surface-card-hover\"\n )}\n onClick={handleClick}\n >\n {/* Thumbnail area — image slot */}\n <div className=\"aspect-[4/3] relative overflow-hidden bg-surface-raised\">\n {slots.image ? (\n <div className=\"w-full h-full\">\n <SlotValue slot={slots.image} size=\"medium\" fill={true}/>\n </div>\n ) : (\n <div className=\"w-full h-full flex items-center justify-center\">\n <IconForView\n collectionOrView={collection}\n color=\"disabled\"\n />\n </div>\n )}\n\n {/* Hover overlay */}\n <div className={cls(\n \"absolute inset-0 bg-white/0 group-hover:bg-white/[0.06]\",\n \"transition-colors duration-200\"\n )}/>\n\n {/* Selection checkbox */}\n {selectionEnabled && (\n <div\n className={cls(\n \"absolute\",\n size === \"xs\" || size === \"s\" ? \"top-1 left-1\" : \"top-2 left-2\"\n )}\n onClick={handleCheckboxClick}\n >\n <Checkbox\n aria-label={t(\"select_row\", { id: String(entity.id) })}\n checked={selected ?? false}\n onCheckedChange={handleSelectionChange}\n size={size === \"xs\" ? \"smallest\" : \"small\"}\n />\n </div>\n )}\n\n </div>\n\n {/* Content area */}\n <div className=\"p-3\">\n {/* No id line here.\n A card used to print the row id above its title, always —\n a truncated uuid (`isId: \"uuid\"` is the default) too short\n to copy and not what a card is read for. The list row and\n the board card show an id only when nothing else names the\n record; the card was the one surface that showed it even\n when it had a title, and the id is still the fallback below\n for a record that has none. The table's ID column, which is\n full width, copyable and governed by\n `hideIdFromCollection`, is where an id is actually read. */}\n\n {/* Title slot */}\n <div className=\"truncate my-1 text-sm font-medium min-h-[20px]\">\n {slots.title ? (\n terms.length > 0 && typeof slots.title.value === \"string\"\n ? <Highlighted text={slots.title.value} terms={terms}/>\n : <SlotValue slot={slots.title} size=\"small\"/>\n ) : (\n <Typography variant=\"body2\" className=\"text-surface-500\">\n {entity.id}\n </Typography>\n )}\n </div>\n\n {/* Subtitle slot — or, while searching, where the hit was. A\n card whose match is in a field it does not show looks as\n arbitrary as a list row does. */}\n {offSlot ? (\n <MatchExplanation\n match={offSlot}\n label={fieldLabel(collection.properties as Record<string, unknown>, offSlot.field)}\n />\n ) : slots.subtitle && (\n <div className=\"line-clamp-3 [&_div]:line-clamp-3 text-xs text-surface-600 dark:text-surface-400 [&_p]:!my-1 [&_p:first-child]:!mt-0 [&_p:last-child]:!mb-0\">\n {terms.length > 0 && typeof slots.subtitle.value === \"string\"\n ? <Highlighted text={slots.subtitle.value} terms={terms}/>\n : <SlotValue slot={slots.subtitle} size=\"small\"/>}\n </div>\n )}\n\n {/* Relation chips slot */}\n {slots.relations.length > 0 && (\n <div className=\"flex items-center gap-1 mt-1 overflow-hidden max-w-full flex-wrap\">\n {slots.relations.map((rel) => (\n rel.items.map((item) => (\n <Chip\n key={`${rel.propertyKey}-${item.id}`}\n size=\"smallest\"\n colorScheme={rel.colorScheme}\n className=\"!text-[10px] !leading-tight !py-0 shrink-0 max-w-[100px] truncate\"\n >\n {item.displayName}\n </Chip>\n ))\n ))}\n {slots.relations.some(r => r.totalCount > r.items.length) && (\n <span className=\"text-[10px] text-surface-400 dark:text-surface-500 shrink-0\">\n +{slots.relations.reduce((acc, r) => acc + Math.max(0, r.totalCount - r.items.length), 0)}\n </span>\n )}\n </div>\n )}\n\n {/* Status + tags slot — \"free chips beside the status\" */}\n {(slots.status || slots.tags) && (\n <div className=\"flex items-center gap-1 mt-1 flex-wrap\">\n {slots.status && <SlotValue slot={slots.status} size=\"small\"/>}\n {slots.tags && <TagChips slot={slots.tags}/>}\n </div>\n )}\n\n {/* Date slot — a card is a list row with the image on top, and the\n row has always shown it. It was the one slot the card resolved\n and never rendered. */}\n {slots.date && (\n <div className=\"mt-1 text-[10px] text-surface-500 dark:text-surface-400\">\n {slots.date.formatted}\n </div>\n )}\n </div>\n </Card>\n );\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"EntityCardBinding.js","names":[],"sources":["../../../src/components/CollectionViewBinding/EntityCardBinding.tsx"],"sourcesContent":["\nimport React, { useMemo } from \"react\";\nimport { Entity } from \"@rebasepro/types\";\nimport { CollectionSize, AdminCollection } from \"@rebasepro/cms-types\";\nimport {\n Card,\n Checkbox,\n Chip,\n cls,\n Typography\n} from \"@rebasepro/ui\";\nimport { PropertyPreview } from \"../../preview\";\nimport {\n useAuthController,\n useCustomizationController\n} from \"@rebasepro/app\";\nimport { useAnalyticsController, useTranslation } from \"@rebasepro/app\";\nimport { IconForView } from \"@rebasepro/app\";\nimport { useCollectionSlotKeys, useEntitySlots, useImagePlace } from \"./usePreviewSlots\";\nimport { Highlighted } from \"./SearchHighlight\";\nimport { useSearchExplanation, MatchExplanation, fieldLabel } from \"./SearchExplanation\";\nimport { SlotValue, TagChips } from \"./SlotValue\";\n\nexport type EntityCardBindingProps<M extends Record<string, unknown> = Record<string, unknown>> = {\n /** The active search, so a card can mark the hit and say where it was. */\n searchString?: string;\n entity: Entity<M>;\n collection: AdminCollection<M>;\n /**\n * The card was clicked.\n *\n * Carries the originating event as well as the entity, because the grid's\n * own handler needs it: `CardView` hands `renderCard` an\n * `(e: React.MouseEvent) => void` that reads `e.metaKey` / `e.ctrlKey` and\n * calls `e.preventDefault()`. That handler used to be passed here through\n * `onClick as any` and then invoked with the *entity*, so its modifier\n * branch read `entity.metaKey` — always undefined — and never ran.\n */\n onClick?: (entity: Entity<M>, event?: React.MouseEvent) => void;\n selected?: boolean;\n highlighted?: boolean;\n onSelectionChange?: (entity: Entity<M>, selected: boolean) => void;\n selectionEnabled?: boolean;\n /**\n * Size of the card - affects checkbox styling\n */\n size?: CollectionSize;\n /**\n * Draws the record's actions — the collection's `entityActions` with\n * Copy and Delete, placed as a table row places them. The card puts them\n * beside its title; a copy of this card calls it where it wants them.\n */\n renderActions?: (entity: Entity<M>) => React.ReactNode;\n};\n\n/**\n * Card component for displaying a entity in a grid view.\n * Shows thumbnail, title, and preview properties via the shared slot system.\n */\nexport function EntityCardBinding<M extends Record<string, unknown> = Record<string, unknown>>({\n entity,\n collection,\n onClick,\n selected,\n highlighted,\n onSelectionChange,\n selectionEnabled,\n size = \"m\",\n searchString,\n renderActions\n}: EntityCardBindingProps<M>) {\n const { t } = useTranslation();\n const authController = useAuthController();\n const analyticsController = useAnalyticsController();\n const customizationController = useCustomizationController();\n\n const slotKeys = useCollectionSlotKeys(\n collection as AdminCollection<Record<string, unknown>>,\n authController,\n customizationController.propertyConfigs\n );\n\n const slots = useEntitySlots(\n entity as Entity<Record<string, unknown>>,\n collection as AdminCollection<Record<string, unknown>>,\n slotKeys\n );\n const imagePlace = useImagePlace(slotKeys.imageKey);\n\n // Same explanation the list shows, so a reader switching view modes does\n // not lose the reason a card is in front of them.\n const { terms, offSlot } = useSearchExplanation(\n entity,\n collection.properties as Record<string, unknown>,\n [slotKeys.titleKey, slotKeys.subtitleKey],\n searchString\n );\n\n // The event is optional because `Card` activates by keyboard too, calling\n // `onClick?.()` with nothing on Enter/Space. That path is real, and it is\n // why this cannot simply require one.\n const handleClick = (e?: React.MouseEvent) => {\n // Cmd+click (Mac) or Ctrl+click (Windows) toggles selection\n if (e && (e.metaKey || e.ctrlKey) && selectionEnabled) {\n e.preventDefault();\n onSelectionChange?.(entity, !selected);\n return;\n }\n if (onClick) {\n analyticsController.onAnalyticsEvent?.(\"card_view_entity_click\", {\n path: entity.path,\n entityId: entity.id\n });\n onClick(entity, e);\n }\n };\n\n const handleCheckboxClick = (e: React.MouseEvent) => {\n e.stopPropagation();\n };\n\n const handleSelectionChange = (checked: boolean) => {\n onSelectionChange?.(entity, checked);\n };\n\n const checkbox = (\n <div onClick={handleCheckboxClick}>\n <Checkbox\n aria-label={t(\"select_row\", { id: String(entity.id) })}\n checked={selected ?? false}\n onCheckedChange={handleSelectionChange}\n size={size === \"xs\" ? \"smallest\" : \"small\"}\n />\n </div>\n );\n\n return (\n <Card\n className={cls(\n \"cursor-pointer overflow-hidden group relative\",\n \"transition-all duration-200\",\n \"hover:shadow-lg hover:-translate-y-0.5\",\n selected && \"ring-2 ring-primary bg-surface-raised\",\n highlighted && !selected && \"ring-2 ring-primary/50 bg-surface-card-hover\"\n )}\n onClick={handleClick}\n >\n {/* Thumbnail area — image slot. Where `fields` leaves every image\n out there is none, and the checkbox goes beside the title. */}\n {imagePlace && (\n <div className=\"aspect-[4/3] relative overflow-hidden bg-surface-raised\">\n {slots.image ? (\n <div className=\"w-full h-full\">\n <SlotValue slot={slots.image} size=\"medium\" fill={true}/>\n </div>\n ) : (\n <div className=\"w-full h-full flex items-center justify-center\">\n <IconForView\n collectionOrView={collection}\n color=\"disabled\"\n />\n </div>\n )}\n\n {/* Hover overlay */}\n <div className={cls(\n \"absolute inset-0 bg-white/0 group-hover:bg-white/[0.06]\",\n \"transition-colors duration-200\"\n )}/>\n\n {selectionEnabled && (\n <div className={cls(\"absolute\", size === \"xs\" || size === \"s\" ? \"top-1 left-1\" : \"top-2 left-2\")}>\n {checkbox}\n </div>\n )}\n </div>\n )}\n\n {/* Content area */}\n <div className=\"p-3\">\n {/* No id line here.\n A card used to print the row id above its title, always —\n a truncated uuid (`isId: \"uuid\"` is the default) too short\n to copy and not what a card is read for. The list row and\n the board card show an id only when nothing else names the\n record; the card was the one surface that showed it even\n when it had a title, and the id is still the fallback below\n for a record that has none. The table's ID column, which is\n full width, copyable and governed by\n `hideIdFromCollection`, is where an id is actually read. */}\n\n {/* Title slot, and the record's actions beside it */}\n <div className=\"flex items-start gap-1\">\n {selectionEnabled && !imagePlace && checkbox}\n <div className=\"flex-1 min-w-0 truncate my-1 text-sm font-medium min-h-[20px]\">\n {slots.title ? (\n terms.length > 0 && typeof slots.title.value === \"string\"\n ? <Highlighted text={slots.title.value} terms={terms}/>\n : <SlotValue slot={slots.title} size=\"small\"/>\n ) : (\n <Typography variant=\"body2\" className=\"text-surface-500\">\n {entity.id}\n </Typography>\n )}\n </div>\n {renderActions?.(entity)}\n </div>\n\n {/* Subtitle slot — or, while searching, where the hit was. A\n card whose match is in a field it does not show looks as\n arbitrary as a list row does. */}\n {offSlot ? (\n <MatchExplanation\n match={offSlot}\n label={fieldLabel(collection.properties as Record<string, unknown>, offSlot.field)}\n />\n ) : slots.subtitle && (\n <div className=\"line-clamp-3 [&_div]:line-clamp-3 text-xs text-surface-600 dark:text-surface-400 [&_p]:!my-1 [&_p:first-child]:!mt-0 [&_p:last-child]:!mb-0\">\n {terms.length > 0 && typeof slots.subtitle.value === \"string\"\n ? <Highlighted text={slots.subtitle.value} terms={terms}/>\n : <SlotValue slot={slots.subtitle} size=\"small\"/>}\n </div>\n )}\n\n {/* Relation chips slot */}\n {slots.relations.length > 0 && (\n <div className=\"flex items-center gap-1 mt-1 overflow-hidden max-w-full flex-wrap\">\n {slots.relations.map((rel) => (\n rel.items.map((item) => (\n <Chip\n key={`${rel.propertyKey}-${item.id}`}\n size=\"smallest\"\n colorScheme={rel.colorScheme}\n className=\"!text-[10px] !leading-tight !py-0 shrink-0 max-w-[100px] truncate\"\n >\n {item.displayName}\n </Chip>\n ))\n ))}\n {slots.relations.some(r => r.totalCount > r.items.length) && (\n <span className=\"text-[10px] text-surface-400 dark:text-surface-500 shrink-0\">\n +{slots.relations.reduce((acc, r) => acc + Math.max(0, r.totalCount - r.items.length), 0)}\n </span>\n )}\n </div>\n )}\n\n {/* Status + tags slot — \"free chips beside the status\" */}\n {(slots.status || slots.tags) && (\n <div className=\"flex items-center gap-1 mt-1 flex-wrap\">\n {slots.status && <SlotValue slot={slots.status} size=\"small\"/>}\n {slots.tags && <TagChips slot={slots.tags}/>}\n </div>\n )}\n\n {/* Date slot — a card is a list row with the image on top, and the\n row has always shown it. It was the one slot the card resolved\n and never rendered. */}\n {slots.date && (\n <div className=\"mt-1 text-[10px] text-surface-500 dark:text-surface-400\">\n {slots.date.formatted}\n </div>\n )}\n </div>\n </Card>\n );\n}\n"],"mappings":"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"}
@@ -0,0 +1,17 @@
1
+ import type { AdminCollection } from "@rebasepro/cms-types";
2
+ import React from "react";
3
+ import { OpenEntityMode } from "../../util/view_mode.js";
4
+ /**
5
+ * The ID column's header control: find a record by its id, or reopen one of
6
+ * the last few opened from this collection.
7
+ */
8
+ export declare function EntityIdHeaderWidget({ collection, path, idPath, openEntityMode }: {
9
+ collection: AdminCollection;
10
+ path: string;
11
+ idPath: string;
12
+ /**
13
+ * Resolved by the parent so that finding an entity by id lands it in the
14
+ * same surface a row click would — not a different one.
15
+ */
16
+ openEntityMode: OpenEntityMode;
17
+ }): React.JSX.Element;
@@ -0,0 +1,107 @@
1
+ import { useSidePanel } from "../../hooks/useSidePanel.js";
2
+ import { ReferencePreview } from "../../preview/components/ReferencePreview.js";
3
+ import { useUrlController } from "../../hooks/navigation/contexts/UrlContext.js";
4
+ import { addRecentId, getRecentIds } from "./utils.js";
5
+ import { navigateToEntity } from "../../util/navigation_utils.js";
6
+ import React from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { ArrowRightToLineIcon, Button, IconButton, Popover, SearchIcon, TextField, Tooltip, cls, focusedDisabled, iconSize } from "@rebasepro/ui";
9
+ import { useTranslation } from "@rebasepro/app";
10
+ import { EntityReference } from "@rebasepro/types";
11
+ //#region src/components/CollectionViewBinding/EntityIdHeaderWidget.tsx
12
+ /**
13
+ * The ID column's header control: find a record by its id, or reopen one of
14
+ * the last few opened from this collection.
15
+ */
16
+ function EntityIdHeaderWidget({ collection, path, idPath, openEntityMode }) {
17
+ const { t } = useTranslation();
18
+ const urlController = useUrlController();
19
+ const [openPopup, setOpenPopup] = React.useState(false);
20
+ const [searchString, setSearchString] = React.useState("");
21
+ const [recentIds, setRecentIds] = React.useState(getRecentIds(collection.slug).map(String));
22
+ const sidePanelController = useSidePanel();
23
+ return /* @__PURE__ */ jsx(Tooltip, {
24
+ title: !openPopup ? t("find_by_id") : void 0,
25
+ asChild: false,
26
+ children: /* @__PURE__ */ jsx(Popover, {
27
+ open: openPopup,
28
+ onOpenChange: setOpenPopup,
29
+ sideOffset: 0,
30
+ align: "start",
31
+ alignOffset: -117,
32
+ trigger: /* @__PURE__ */ jsx(IconButton, {
33
+ "aria-label": t("search"),
34
+ size: "small",
35
+ children: /* @__PURE__ */ jsx(SearchIcon, { size: iconSize.small })
36
+ }),
37
+ children: /* @__PURE__ */ jsxs("div", {
38
+ className: cls("my-2 rounded-lg bg-surface-sheet text-surface-900 dark:text-white"),
39
+ children: [/* @__PURE__ */ jsx("form", {
40
+ noValidate: true,
41
+ onSubmit: (e) => {
42
+ e.preventDefault();
43
+ if (!searchString) return;
44
+ setOpenPopup(false);
45
+ const entityId = searchString.trim();
46
+ setRecentIds(addRecentId(collection.slug, entityId).map(String));
47
+ navigateToEntity({
48
+ openEntityMode,
49
+ collection,
50
+ id: entityId,
51
+ path,
52
+ sidePanelController,
53
+ navigation: urlController
54
+ });
55
+ },
56
+ className: "w-96 max-w-full",
57
+ children: /* @__PURE__ */ jsxs("div", {
58
+ className: "flex p-2 w-full gap-2",
59
+ children: [/* @__PURE__ */ jsx(TextField, {
60
+ autoFocus: openPopup,
61
+ "aria-label": t("find_entity_by_id"),
62
+ placeholder: t("find_entity_by_id"),
63
+ size: "small",
64
+ onChange: (e) => {
65
+ setSearchString(e.target.value);
66
+ },
67
+ value: searchString,
68
+ className: "flex-grow",
69
+ inputClassName: cls("rounded-lg bg-surface-card", focusedDisabled)
70
+ }), /* @__PURE__ */ jsx(Button, {
71
+ variant: "text",
72
+ disabled: !searchString.trim(),
73
+ type: "submit",
74
+ children: /* @__PURE__ */ jsx(ArrowRightToLineIcon, {})
75
+ })]
76
+ })
77
+ }), recentIds && recentIds.length > 0 && /* @__PURE__ */ jsx("div", {
78
+ className: "flex flex-col gap-2 p-2",
79
+ children: recentIds.map((id) => /* @__PURE__ */ jsx(ReferencePreview, {
80
+ reference: new EntityReference({
81
+ id,
82
+ path
83
+ }),
84
+ hover: true,
85
+ onClick: () => {
86
+ setOpenPopup(false);
87
+ navigateToEntity({
88
+ openEntityMode,
89
+ collection,
90
+ id,
91
+ path,
92
+ sidePanelController,
93
+ navigation: urlController
94
+ });
95
+ },
96
+ includeEntityLink: false,
97
+ size: "small"
98
+ }, id))
99
+ })]
100
+ })
101
+ })
102
+ });
103
+ }
104
+ //#endregion
105
+ export { EntityIdHeaderWidget };
106
+
107
+ //# sourceMappingURL=EntityIdHeaderWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityIdHeaderWidget.js","names":[],"sources":["../../../src/components/CollectionViewBinding/EntityIdHeaderWidget.tsx"],"sourcesContent":["import type { AdminCollection } from \"@rebasepro/cms-types\";\nimport { EntityReference } from \"@rebasepro/types\";\nimport React from \"react\";\nimport { useTranslation } from \"@rebasepro/app\";\nimport {\n ArrowRightToLineIcon,\n Button,\n cls,\n focusedDisabled,\n IconButton,\n iconSize,\n Popover,\n SearchIcon,\n TextField,\n Tooltip\n} from \"@rebasepro/ui\";\nimport { ReferencePreview } from \"../../preview\";\nimport { navigateToEntity } from \"../../util/navigation_utils\";\nimport { OpenEntityMode } from \"../../util/view_mode\";\nimport { useUrlController } from \"../../hooks/navigation/contexts/UrlContext\";\nimport { useSidePanel } from \"../../hooks/useSidePanel\";\nimport { addRecentId, getRecentIds } from \"./utils\";\n\n/**\n * The ID column's header control: find a record by its id, or reopen one of\n * the last few opened from this collection.\n */\nexport function EntityIdHeaderWidget({\n collection,\n path,\n idPath,\n openEntityMode\n}: {\n collection: AdminCollection,\n path: string,\n idPath: string,\n /**\n * Resolved by the parent so that finding an entity by id lands it in the\n * same surface a row click would — not a different one.\n */\n openEntityMode: OpenEntityMode\n}) {\n\n const { t } = useTranslation();\n const urlController = useUrlController();\n const [openPopup, setOpenPopup] = React.useState(false);\n const [searchString, setSearchString] = React.useState(\"\");\n const [recentIds, setRecentIds] = React.useState<string[]>(getRecentIds(collection.slug).map(String));\n const sidePanelController = useSidePanel();\n\n return (\n <Tooltip title={!openPopup ? t(\"find_by_id\") : undefined} asChild={false}>\n <Popover\n open={openPopup}\n onOpenChange={setOpenPopup}\n sideOffset={0}\n align={\"start\"}\n alignOffset={-117}\n trigger={\n <IconButton aria-label={t(\"search\")} size={\"small\"}>\n <SearchIcon size={iconSize.small}/>\n </IconButton>\n }>\n <div\n className={cls(\"my-2 rounded-lg bg-surface-sheet text-surface-900 dark:text-white\")}>\n <form noValidate={true}\n onSubmit={(e) => {\n e.preventDefault();\n if (!searchString) return;\n setOpenPopup(false);\n const entityId = searchString.trim();\n setRecentIds(addRecentId(collection.slug, entityId).map(String));\n navigateToEntity({\n openEntityMode,\n collection,\n id: entityId,\n path,\n\n sidePanelController,\n navigation: urlController\n })\n }}\n className={\"w-96 max-w-full\"}>\n\n <div className=\"flex p-2 w-full gap-2\">\n <TextField\n autoFocus={openPopup}\n aria-label={t(\"find_entity_by_id\")}\n placeholder={t(\"find_entity_by_id\")}\n size=\"small\"\n onChange={(e) => {\n setSearchString(e.target.value);\n }}\n value={searchString}\n className=\"flex-grow\"\n inputClassName={cls(\"rounded-lg bg-surface-card\", focusedDisabled)}\n />\n <Button variant={\"text\"}\n disabled={!(searchString.trim())}\n type={\"submit\"}\n ><ArrowRightToLineIcon/></Button>\n </div>\n </form>\n {recentIds && recentIds.length > 0 && <div className=\"flex flex-col gap-2 p-2\">\n {recentIds.map(id => (\n <ReferencePreview reference={new EntityReference({ id,\npath })}\n key={id}\n hover={true}\n onClick={() => {\n setOpenPopup(false);\n navigateToEntity({\n openEntityMode,\n collection,\n id,\n path,\n\n sidePanelController,\n navigation: urlController\n })\n }}\n includeEntityLink={false}\n size={\"small\"}/>\n ))}\n </div>}\n </div>\n </Popover>\n\n </Tooltip>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2BA,SAAgB,qBAAqB,EACjC,YACA,MACA,QACA,kBAUD;CAEC,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAAS,KAAK;CACtD,MAAM,CAAC,cAAc,mBAAmB,MAAM,SAAS,EAAE;CACzD,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAAmB,aAAa,WAAW,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC;CACpG,MAAM,sBAAsB,aAAa;CAEzC,OACI,oBAAC,SAAD;EAAS,OAAO,CAAC,YAAY,EAAE,YAAY,IAAI,KAAA;EAAW,SAAS;YAC/D,oBAAC,SAAD;GACI,MAAM;GACN,cAAc;GACd,YAAY;GACZ,OAAO;GACP,aAAa;GACb,SACI,oBAAC,YAAD;IAAY,cAAY,EAAE,QAAQ;IAAG,MAAM;cACvC,oBAAC,YAAD,EAAY,MAAM,SAAS,MAAO,CAAA;GAC1B,CAAA;aAEhB,qBAAC,OAAD;IACI,WAAW,IAAI,mEAAmE;cADtF,CAEI,oBAAC,QAAD;KAAM,YAAY;KACd,WAAW,MAAM;MACb,EAAE,eAAe;MACjB,IAAI,CAAC,cAAc;MACnB,aAAa,KAAK;MAClB,MAAM,WAAW,aAAa,KAAK;MACnC,aAAa,YAAY,WAAW,MAAM,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC;MAC/D,iBAAiB;OACb;OACA;OACA,IAAI;OACJ;OAEA;OACA,YAAY;MAChB,CAAC;KACL;KACA,WAAW;eAEX,qBAAC,OAAD;MAAK,WAAU;gBAAf,CACI,oBAAC,WAAD;OACI,WAAW;OACX,cAAY,EAAE,mBAAmB;OACjC,aAAa,EAAE,mBAAmB;OAClC,MAAK;OACL,WAAW,MAAM;QACb,gBAAgB,EAAE,OAAO,KAAK;OAClC;OACA,OAAO;OACP,WAAU;OACV,gBAAgB,IAAI,8BAA8B,eAAe;MACpE,CAAA,GACD,oBAAC,QAAD;OAAQ,SAAS;OACb,UAAU,CAAE,aAAa,KAAK;OAC9B,MAAM;iBACT,oBAAC,sBAAD,CAAsB,CAAA;MAAS,CAAA,CAC/B;;IACH,CAAA,GACL,aAAa,UAAU,SAAS,KAAK,oBAAC,OAAD;KAAK,WAAU;eAChD,UAAU,KAAI,OACX,oBAAC,kBAAD;MAAkB,WAAW,IAAI,gBAAgB;OAAE;OAC/E;MAAK,CAAC;MAE0B,OAAO;MACP,eAAe;OACX,aAAa,KAAK;OAClB,iBAAiB;QACb;QACA;QACA;QACA;QAEA;QACA,YAAY;OAChB,CAAC;MACL;MACA,mBAAmB;MACnB,MAAM;KAAS,GAfV,EAeU,CACtB;IACA,CAAA,CACJ;;EACA,CAAA;CAEJ,CAAA;AAEjB"}
@@ -0,0 +1,15 @@
1
+ import type { Properties } from "@rebasepro/types";
2
+ import type { EntityTableController } from "@rebasepro/cms-types";
3
+ import type { FilterValues } from "@rebasepro/types";
4
+ import React from "react";
5
+ /**
6
+ * The toolbar's filters control — labelled, or its icon-only form — with the
7
+ * count of filters the person set, and the dialog it opens.
8
+ */
9
+ export declare function FiltersButton<M extends Record<string, unknown>>({ tableController, properties, fixedFilter, iconOnly }: {
10
+ tableController: EntityTableController<M>;
11
+ properties: Properties;
12
+ /** The collection's scope: not a filter the person set, so not counted. */
13
+ fixedFilter?: FilterValues<string>;
14
+ iconOnly: boolean;
15
+ }): React.JSX.Element | null;
@@ -0,0 +1,49 @@
1
+ import { FiltersDialog } from "./FiltersDialog.js";
2
+ import { useState } from "react";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { Badge, Button, FilterIcon, IconButton, Tooltip, cls, iconSize } from "@rebasepro/ui";
5
+ import { useTranslation } from "@rebasepro/app";
6
+ //#region src/components/CollectionViewBinding/FiltersButton.tsx
7
+ /**
8
+ * The toolbar's filters control — labelled, or its icon-only form — with the
9
+ * count of filters the person set, and the dialog it opens.
10
+ */
11
+ function FiltersButton({ tableController, properties, fixedFilter, iconOnly }) {
12
+ const { t } = useTranslation();
13
+ const [open, setOpen] = useState(false);
14
+ const filterValues = tableController.filterValues;
15
+ const activeFilterCount = filterValues ? Object.keys(filterValues).filter((key) => !fixedFilter || !(key in fixedFilter)).length : 0;
16
+ if (!tableController.setFilterValues) return null;
17
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Tooltip, {
18
+ title: t("filters"),
19
+ children: /* @__PURE__ */ jsx(Badge, {
20
+ color: "primary",
21
+ invisible: activeFilterCount === 0,
22
+ children: !iconOnly ? /* @__PURE__ */ jsx(Button, {
23
+ variant: "text",
24
+ size: "small",
25
+ onClick: () => setOpen(true),
26
+ startIcon: /* @__PURE__ */ jsx(FilterIcon, { size: iconSize.small }),
27
+ className: cls(activeFilterCount > 0 && "text-primary"),
28
+ children: activeFilterCount > 0 ? `(${activeFilterCount})` : t("filters")
29
+ }) : /* @__PURE__ */ jsx(IconButton, {
30
+ "aria-label": t("filters"),
31
+ size: "small",
32
+ onClick: () => setOpen(true),
33
+ className: cls(activeFilterCount > 0 && "text-primary"),
34
+ children: /* @__PURE__ */ jsx(FilterIcon, { size: iconSize.smallest })
35
+ })
36
+ })
37
+ }), /* @__PURE__ */ jsx(FiltersDialog, {
38
+ open,
39
+ onOpenChange: setOpen,
40
+ properties,
41
+ filterValues: tableController.filterValues,
42
+ setFilterValues: (values) => tableController.setFilterValues?.(values ?? {}),
43
+ fixedFilter
44
+ })] });
45
+ }
46
+ //#endregion
47
+ export { FiltersButton };
48
+
49
+ //# sourceMappingURL=FiltersButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FiltersButton.js","names":[],"sources":["../../../src/components/CollectionViewBinding/FiltersButton.tsx"],"sourcesContent":["import type { Properties } from \"@rebasepro/types\";\nimport type { EntityTableController } from \"@rebasepro/cms-types\";\nimport type { FilterValues } from \"@rebasepro/types\";\nimport React, { useState } from \"react\";\nimport { useTranslation } from \"@rebasepro/app\";\nimport { Badge, Button, cls, FilterIcon, IconButton, iconSize, Tooltip } from \"@rebasepro/ui\";\nimport { FiltersDialog } from \"./FiltersDialog\";\n\n/**\n * The toolbar's filters control — labelled, or its icon-only form — with the\n * count of filters the person set, and the dialog it opens.\n */\nexport function FiltersButton<M extends Record<string, unknown>>({\n tableController,\n properties,\n fixedFilter,\n iconOnly\n}: {\n tableController: EntityTableController<M>;\n properties: Properties;\n /** The collection's scope: not a filter the person set, so not counted. */\n fixedFilter?: FilterValues<string>;\n iconOnly: boolean;\n}) {\n const { t } = useTranslation();\n const [open, setOpen] = useState(false);\n\n // Count active filters (excluding force filters)\n const filterValues = tableController.filterValues;\n const activeFilterCount = filterValues\n ? Object.keys(filterValues).filter(key => !fixedFilter || !(key in fixedFilter)).length\n : 0;\n\n if (!tableController.setFilterValues) return null;\n\n return (\n <>\n <Tooltip title={t(\"filters\")}>\n <Badge\n color=\"primary\"\n invisible={activeFilterCount === 0}\n >\n {!iconOnly ? (\n <Button\n variant=\"text\"\n size=\"small\"\n onClick={() => setOpen(true)}\n startIcon={<FilterIcon size={iconSize.small}/>}\n className={cls(activeFilterCount > 0 && \"text-primary\")}\n >\n {activeFilterCount > 0 ? `(${activeFilterCount})` : t(\"filters\")}\n </Button>\n ) : (\n <IconButton aria-label={t(\"filters\")}\n size={\"small\"}\n onClick={() => setOpen(true)}\n className={cls(activeFilterCount > 0 && \"text-primary\")}\n >\n <FilterIcon size={iconSize.smallest}/>\n </IconButton>\n )}\n </Badge>\n </Tooltip>\n <FiltersDialog\n open={open}\n onOpenChange={setOpen}\n properties={properties}\n filterValues={tableController.filterValues}\n setFilterValues={(values) => tableController.setFilterValues?.(values ?? {})}\n fixedFilter={fixedFilter}\n />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;AAYA,SAAgB,cAAiD,EAC7D,iBACA,YACA,aACA,YAOD;CACC,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CAGtC,MAAM,eAAe,gBAAgB;CACrC,MAAM,oBAAoB,eACpB,OAAO,KAAK,YAAY,CAAC,CAAC,QAAO,QAAO,CAAC,eAAe,EAAE,OAAO,YAAY,CAAC,CAAC,SAC/E;CAEN,IAAI,CAAC,gBAAgB,iBAAiB,OAAO;CAE7C,OACI,qBAAA,UAAA,EAAA,UAAA,CACI,oBAAC,SAAD;EAAS,OAAO,EAAE,SAAS;YACvB,oBAAC,OAAD;GACI,OAAM;GACN,WAAW,sBAAsB;aAEhC,CAAC,WACE,oBAAC,QAAD;IACI,SAAQ;IACR,MAAK;IACL,eAAe,QAAQ,IAAI;IAC3B,WAAW,oBAAC,YAAD,EAAY,MAAM,SAAS,MAAO,CAAA;IAC7C,WAAW,IAAI,oBAAoB,KAAK,cAAc;cAErD,oBAAoB,IAAI,IAAI,kBAAkB,KAAK,EAAE,SAAS;GAC3D,CAAA,IAER,oBAAC,YAAD;IAAY,cAAY,EAAE,SAAS;IAC/B,MAAM;IACN,eAAe,QAAQ,IAAI;IAC3B,WAAW,IAAI,oBAAoB,KAAK,cAAc;cAEtD,oBAAC,YAAD,EAAY,MAAM,SAAS,SAAU,CAAA;GAC7B,CAAA;EAEb,CAAA;CACF,CAAA,GACT,oBAAC,eAAD;EACU;EACN,cAAc;EACF;EACZ,cAAc,gBAAgB;EAC9B,kBAAkB,WAAW,gBAAgB,kBAAkB,UAAU,CAAC,CAAC;EAC9D;CAChB,CAAA,CACH,EAAA,CAAA;AAEV"}
@@ -0,0 +1,35 @@
1
+ import type { Property } from "@rebasepro/types";
2
+ import type { AdminCollection, SlotContribution, TableController } from "@rebasepro/cms-types";
3
+ import React from "react";
4
+ export declare const EMPTY_ARRAY: never[];
5
+ /** What the plugins contributed to the table's add-column slot, for {@link PluginAddColumnComponents}. */
6
+ export declare const PluginAddColumnsContext: React.Context<React.ReactNode[]>;
7
+ export declare function PluginAddColumnComponents(): React.JSX.Element;
8
+ /**
9
+ * What the plugins' column-header actions are handed besides their column:
10
+ * this render's collection and table controller. `null` when no plugin
11
+ * contributes one.
12
+ */
13
+ export type HeaderActionsScope = {
14
+ contributions: SlotContribution<"collection.header.action">[];
15
+ path: string;
16
+ collection: AdminCollection;
17
+ tableController: TableController;
18
+ parentCollectionSlugs: string[];
19
+ parentEntityIds: string[];
20
+ };
21
+ export declare const PluginHeaderActionsContext: React.Context<HeaderActionsScope | null>;
22
+ /**
23
+ * The `collection.header.action` contributions for one column. One component
24
+ * type for the life of the view, like {@link PluginAddColumnComponents}: the
25
+ * table's columns are built once, and their headers re-render only when their
26
+ * own props change, so what the actions are handed reaches them through
27
+ * context. It was closed over when the header was built — the table controller
28
+ * of the first render (a search, filter or sort typed since never reached a
29
+ * header action) and the collection of the render before.
30
+ */
31
+ export declare function PluginHeaderActions({ property, propertyKey, onHover }: {
32
+ property: Property;
33
+ propertyKey: string;
34
+ onHover: boolean;
35
+ }): React.JSX.Element | null;
@@ -0,0 +1,45 @@
1
+ import React from "react";
2
+ import { Fragment, jsx } from "react/jsx-runtime";
3
+ import { ErrorBoundary } from "@rebasepro/ui";
4
+ //#region src/components/CollectionViewBinding/PluginColumnSlots.tsx
5
+ var EMPTY_ARRAY = [];
6
+ /** What the plugins contributed to the table's add-column slot, for {@link PluginAddColumnComponents}. */
7
+ var PluginAddColumnsContext = React.createContext(EMPTY_ARRAY);
8
+ function PluginAddColumnComponents() {
9
+ return /* @__PURE__ */ jsx("div", {
10
+ className: "flex flex-row items-center gap-2",
11
+ children: React.useContext(PluginAddColumnsContext)
12
+ });
13
+ }
14
+ var PluginHeaderActionsContext = React.createContext(null);
15
+ /**
16
+ * The `collection.header.action` contributions for one column. One component
17
+ * type for the life of the view, like {@link PluginAddColumnComponents}: the
18
+ * table's columns are built once, and their headers re-render only when their
19
+ * own props change, so what the actions are handed reaches them through
20
+ * context. It was closed over when the header was built — the table controller
21
+ * of the first render (a search, filter or sort typed since never reached a
22
+ * header action) and the collection of the render before.
23
+ */
24
+ function PluginHeaderActions({ property, propertyKey, onHover }) {
25
+ const scope = React.useContext(PluginHeaderActionsContext);
26
+ if (!scope) return null;
27
+ const headerSlotProps = {
28
+ property,
29
+ propertyKey,
30
+ onHover,
31
+ path: scope.path,
32
+ collection: scope.collection,
33
+ tableController: scope.tableController,
34
+ parentCollectionSlugs: scope.parentCollectionSlugs,
35
+ parentEntityIds: scope.parentEntityIds
36
+ };
37
+ return /* @__PURE__ */ jsx(Fragment, { children: scope.contributions.map((s, i) => /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(s.Component, {
38
+ ...headerSlotProps,
39
+ ...s.props ?? {}
40
+ }) }, `header_action_${propertyKey}_${i}`)) });
41
+ }
42
+ //#endregion
43
+ export { EMPTY_ARRAY, PluginAddColumnComponents, PluginAddColumnsContext, PluginHeaderActions, PluginHeaderActionsContext };
44
+
45
+ //# sourceMappingURL=PluginColumnSlots.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginColumnSlots.js","names":[],"sources":["../../../src/components/CollectionViewBinding/PluginColumnSlots.tsx"],"sourcesContent":["import type { Property } from \"@rebasepro/types\";\nimport type { AdminCollection, SlotContribution, TableController } from \"@rebasepro/cms-types\";\nimport React from \"react\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\n\nexport const EMPTY_ARRAY: never[] = [];\n\n/** What the plugins contributed to the table's add-column slot, for {@link PluginAddColumnComponents}. */\nexport const PluginAddColumnsContext = React.createContext<React.ReactNode[]>(EMPTY_ARRAY);\n\nexport function PluginAddColumnComponents() {\n const components = React.useContext(PluginAddColumnsContext);\n return (\n <div className=\"flex flex-row items-center gap-2\">\n {components}\n </div>\n );\n}\n\n/**\n * What the plugins' column-header actions are handed besides their column:\n * this render's collection and table controller. `null` when no plugin\n * contributes one.\n */\nexport type HeaderActionsScope = {\n contributions: SlotContribution<\"collection.header.action\">[],\n path: string,\n collection: AdminCollection,\n tableController: TableController,\n parentCollectionSlugs: string[],\n parentEntityIds: string[]\n};\nexport const PluginHeaderActionsContext = React.createContext<HeaderActionsScope | null>(null);\n\n/**\n * The `collection.header.action` contributions for one column. One component\n * type for the life of the view, like {@link PluginAddColumnComponents}: the\n * table's columns are built once, and their headers re-render only when their\n * own props change, so what the actions are handed reaches them through\n * context. It was closed over when the header was built — the table controller\n * of the first render (a search, filter or sort typed since never reached a\n * header action) and the collection of the render before.\n */\nexport function PluginHeaderActions({\n property,\n propertyKey,\n onHover\n}: {\n property: Property,\n propertyKey: string,\n onHover: boolean\n}) {\n const scope = React.useContext(PluginHeaderActionsContext);\n if (!scope) return null;\n const headerSlotProps = {\n property,\n propertyKey,\n onHover,\n path: scope.path,\n collection: scope.collection,\n tableController: scope.tableController,\n parentCollectionSlugs: scope.parentCollectionSlugs,\n parentEntityIds: scope.parentEntityIds\n };\n return <>{scope.contributions.map((s, i) => (\n <ErrorBoundary key={`header_action_${propertyKey}_${i}`}>\n <s.Component {...headerSlotProps} {...(s.props ?? {})}/>\n </ErrorBoundary>\n ))}</>;\n}\n"],"mappings":";;;;AAKA,IAAa,cAAuB,CAAC;;AAGrC,IAAa,0BAA0B,MAAM,cAAiC,WAAW;AAEzF,SAAgB,4BAA4B;CAExC,OACI,oBAAC,OAAD;EAAK,WAAU;YAFA,MAAM,WAAW,uBAG3B;CACA,CAAA;AAEb;AAeA,IAAa,6BAA6B,MAAM,cAAyC,IAAI;;;;;;;;;;AAW7F,SAAgB,oBAAoB,EAChC,UACA,aACA,WAKD;CACC,MAAM,QAAQ,MAAM,WAAW,0BAA0B;CACzD,IAAI,CAAC,OAAO,OAAO;CACnB,MAAM,kBAAkB;EACpB;EACA;EACA;EACA,MAAM,MAAM;EACZ,YAAY,MAAM;EAClB,iBAAiB,MAAM;EACvB,uBAAuB,MAAM;EAC7B,iBAAiB,MAAM;CAC3B;CACA,OAAO,oBAAA,UAAA,EAAA,UAAG,MAAM,cAAc,KAAK,GAAG,MAClC,oBAAC,eAAD,EAAA,UACI,oBAAC,EAAE,WAAH;EAAa,GAAI;EAAiB,GAAK,EAAE,SAAS,CAAC;CAAI,CAAA,EAC5C,GAFK,iBAAiB,YAAY,GAAG,GAErC,CAClB,EAAI,CAAA;AACT"}
@@ -0,0 +1,40 @@
1
+ import React from "react";
2
+ import type { AdditionalFieldDelegate, AdminCollection } from "@rebasepro/cms-types";
3
+ import type { Entity } from "@rebasepro/types";
4
+ /**
5
+ * What `CollectionPanel`'s `rowActions` draws on a row: its own JSX, handed
6
+ * the row as the server sends it and the record's id.
7
+ */
8
+ export type RowActionsRenderer = (row: Record<string, unknown>, id: string) => React.ReactNode;
9
+ /**
10
+ * The renderer of the panel drawn here, and the path its rows live at.
11
+ *
12
+ * Through context rather than props: the cards, the board and the table's
13
+ * cells are memoised, and a caller's `rowActions` closes over its own state
14
+ * (a `saving` flag, the row being shipped), so a new one has to reach them
15
+ * without redrawing every row. The path keeps it to the panel's own rows: a
16
+ * record opened in the split beside the list draws its relation tables inside
17
+ * the same tree.
18
+ */
19
+ export declare const RowActionsContext: React.Context<{
20
+ path: string;
21
+ render: RowActionsRenderer;
22
+ } | null>;
23
+ /** A row's `rowActions`, or nothing where the panel has none or the row is not its own. */
24
+ export declare function useRowActionsNode(entity: Entity<Record<string, unknown>>, collection: AdminCollection | undefined, path: string | undefined): React.ReactNode;
25
+ /**
26
+ * A row's `rowActions` where a list row or a card puts them. A click on them
27
+ * is theirs: it does not reach the row, which would open the record.
28
+ */
29
+ export declare function RowActionsSlot({ entity, collection, path, className }: {
30
+ entity: Entity<Record<string, unknown>>;
31
+ collection: AdminCollection | undefined;
32
+ path: string | undefined;
33
+ className?: string;
34
+ }): React.JSX.Element | null;
35
+ /**
36
+ * The table's column for `rowActions`: the last one, always visible. One
37
+ * object for the life of the module, so the collection it is added to only
38
+ * changes when `rowActions` comes or goes, not each time it is a new function.
39
+ */
40
+ export declare const ROW_ACTIONS_FIELD: AdditionalFieldDelegate;
@@ -0,0 +1,60 @@
1
+ import React, { useCallback, useContext } from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { ROW_ACTIONS_COLUMN, rowOfEntity } from "@rebasepro/app";
4
+ //#region src/components/CollectionViewBinding/RowActions.tsx
5
+ /**
6
+ * The renderer of the panel drawn here, and the path its rows live at.
7
+ *
8
+ * Through context rather than props: the cards, the board and the table's
9
+ * cells are memoised, and a caller's `rowActions` closes over its own state
10
+ * (a `saving` flag, the row being shipped), so a new one has to reach them
11
+ * without redrawing every row. The path keeps it to the panel's own rows: a
12
+ * record opened in the split beside the list draws its relation tables inside
13
+ * the same tree.
14
+ */
15
+ var RowActionsContext = React.createContext(null);
16
+ /** A row's `rowActions`, or nothing where the panel has none or the row is not its own. */
17
+ function useRowActionsNode(entity, collection, path) {
18
+ const scope = useContext(RowActionsContext);
19
+ if (!scope || scope.path !== (path ?? entity.path)) return null;
20
+ return scope.render(rowOfEntity(entity, collection), String(entity.id));
21
+ }
22
+ /**
23
+ * A row's `rowActions` where a list row or a card puts them. A click on them
24
+ * is theirs: it does not reach the row, which would open the record.
25
+ */
26
+ function RowActionsSlot({ entity, collection, path, className }) {
27
+ const node = useRowActionsNode(entity, collection, path);
28
+ const stopPropagation = useCallback((event) => event.stopPropagation(), []);
29
+ if (node === null || node === void 0 || node === false) return null;
30
+ return /* @__PURE__ */ jsx("div", {
31
+ className: className ?? "flex items-center gap-1 shrink-0",
32
+ onClick: stopPropagation,
33
+ children: node
34
+ });
35
+ }
36
+ function RowActionsCell({ row, id }) {
37
+ const scope = useContext(RowActionsContext);
38
+ const stopPropagation = useCallback((event) => event.stopPropagation(), []);
39
+ if (!scope) return null;
40
+ return /* @__PURE__ */ jsx("div", {
41
+ className: "flex items-center gap-1",
42
+ onClick: stopPropagation,
43
+ children: scope.render(row, String(id))
44
+ });
45
+ }
46
+ /**
47
+ * The table's column for `rowActions`: the last one, always visible. One
48
+ * object for the life of the module, so the collection it is added to only
49
+ * changes when `rowActions` comes or goes, not each time it is a new function.
50
+ */
51
+ var ROW_ACTIONS_FIELD = {
52
+ key: ROW_ACTIONS_COLUMN,
53
+ name: "",
54
+ width: 160,
55
+ Builder: (props) => /* @__PURE__ */ jsx(RowActionsCell, { ...props })
56
+ };
57
+ //#endregion
58
+ export { ROW_ACTIONS_FIELD, RowActionsContext, RowActionsSlot, useRowActionsNode };
59
+
60
+ //# sourceMappingURL=RowActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RowActions.js","names":[],"sources":["../../../src/components/CollectionViewBinding/RowActions.tsx"],"sourcesContent":["import React, { useCallback, useContext } from \"react\";\nimport type { AdditionalFieldDelegate, AdditionalFieldDelegateProps, AdminCollection } from \"@rebasepro/cms-types\";\nimport type { Entity } from \"@rebasepro/types\";\nimport { ROW_ACTIONS_COLUMN, rowOfEntity } from \"@rebasepro/app\";\n\n/**\n * What `CollectionPanel`'s `rowActions` draws on a row: its own JSX, handed\n * the row as the server sends it and the record's id.\n */\nexport type RowActionsRenderer = (row: Record<string, unknown>, id: string) => React.ReactNode;\n\n/**\n * The renderer of the panel drawn here, and the path its rows live at.\n *\n * Through context rather than props: the cards, the board and the table's\n * cells are memoised, and a caller's `rowActions` closes over its own state\n * (a `saving` flag, the row being shipped), so a new one has to reach them\n * without redrawing every row. The path keeps it to the panel's own rows: a\n * record opened in the split beside the list draws its relation tables inside\n * the same tree.\n */\nexport const RowActionsContext = React.createContext<{ path: string; render: RowActionsRenderer } | null>(null);\n\n/** A row's `rowActions`, or nothing where the panel has none or the row is not its own. */\nexport function useRowActionsNode(entity: Entity<Record<string, unknown>>, collection: AdminCollection | undefined, path: string | undefined): React.ReactNode {\n const scope = useContext(RowActionsContext);\n if (!scope || scope.path !== (path ?? entity.path)) return null;\n return scope.render(rowOfEntity(entity, collection), String(entity.id));\n}\n\n/**\n * A row's `rowActions` where a list row or a card puts them. A click on them\n * is theirs: it does not reach the row, which would open the record.\n */\nexport function RowActionsSlot({ entity, collection, path, className }: {\n entity: Entity<Record<string, unknown>>;\n collection: AdminCollection | undefined;\n path: string | undefined;\n className?: string;\n}) {\n const node = useRowActionsNode(entity, collection, path);\n const stopPropagation = useCallback((event: React.MouseEvent) => event.stopPropagation(), []);\n if (node === null || node === undefined || node === false) return null;\n return <div className={className ?? \"flex items-center gap-1 shrink-0\"} onClick={stopPropagation}>{node}</div>;\n}\n\nfunction RowActionsCell({ row, id }: AdditionalFieldDelegateProps) {\n const scope = useContext(RowActionsContext);\n const stopPropagation = useCallback((event: React.MouseEvent) => event.stopPropagation(), []);\n if (!scope) return null;\n return <div className=\"flex items-center gap-1\" onClick={stopPropagation}>{scope.render(row, String(id))}</div>;\n}\n\n/**\n * The table's column for `rowActions`: the last one, always visible. One\n * object for the life of the module, so the collection it is added to only\n * changes when `rowActions` comes or goes, not each time it is a new function.\n */\nexport const ROW_ACTIONS_FIELD: AdditionalFieldDelegate = {\n key: ROW_ACTIONS_COLUMN,\n name: \"\",\n width: 160,\n Builder: (props) => <RowActionsCell {...props}/>\n};\n"],"mappings":";;;;;;;;;;;;;;AAqBA,IAAa,oBAAoB,MAAM,cAAmE,IAAI;;AAG9G,SAAgB,kBAAkB,QAAyC,YAAyC,MAA2C;CAC3J,MAAM,QAAQ,WAAW,iBAAiB;CAC1C,IAAI,CAAC,SAAS,MAAM,UAAU,QAAQ,OAAO,OAAO,OAAO;CAC3D,OAAO,MAAM,OAAO,YAAY,QAAQ,UAAU,GAAG,OAAO,OAAO,EAAE,CAAC;AAC1E;;;;;AAMA,SAAgB,eAAe,EAAE,QAAQ,YAAY,MAAM,aAKxD;CACC,MAAM,OAAO,kBAAkB,QAAQ,YAAY,IAAI;CACvD,MAAM,kBAAkB,aAAa,UAA4B,MAAM,gBAAgB,GAAG,CAAC,CAAC;CAC5F,IAAI,SAAS,QAAQ,SAAS,KAAA,KAAa,SAAS,OAAO,OAAO;CAClE,OAAO,oBAAC,OAAD;EAAK,WAAW,aAAa;EAAoC,SAAS;YAAkB;CAAU,CAAA;AACjH;AAEA,SAAS,eAAe,EAAE,KAAK,MAAoC;CAC/D,MAAM,QAAQ,WAAW,iBAAiB;CAC1C,MAAM,kBAAkB,aAAa,UAA4B,MAAM,gBAAgB,GAAG,CAAC,CAAC;CAC5F,IAAI,CAAC,OAAO,OAAO;CACnB,OAAO,oBAAC,OAAD;EAAK,WAAU;EAA0B,SAAS;YAAkB,MAAM,OAAO,KAAK,OAAO,EAAE,CAAC;CAAO,CAAA;AAClH;;;;;;AAOA,IAAa,oBAA6C;CACtD,KAAK;CACL,MAAM;CACN,OAAO;CACP,UAAU,UAAU,oBAAC,gBAAD,EAAgB,GAAI,MAAO,CAAA;AACnD"}
@@ -1,12 +1,12 @@
1
1
  import React from "react";
2
2
  import { Entity } from "@rebasepro/types";
3
- import { CollectionSize, EntityTableController, SelectionController, AdminCollection } from "@rebasepro/cms-types";
3
+ import { CollectionSize, EntityTableController, EntitySelectionController, AdminCollection } from "@rebasepro/cms-types";
4
4
  export type SplitListViewProps<M extends Record<string, unknown> = Record<string, unknown>> = {
5
5
  collection: AdminCollection<M>;
6
6
  tableController: EntityTableController<M>;
7
7
  onEntityClick?: (entity: Entity<M>) => void;
8
8
  onNewClick?: () => void;
9
- selectionController?: SelectionController<M>;
9
+ selectionController?: EntitySelectionController<M>;
10
10
  selectionEnabled?: boolean;
11
11
  highlightedEntities?: Entity<M>[];
12
12
  emptyComponent?: React.ReactNode;
@@ -41,8 +41,11 @@ export type SplitListViewProps<M extends Record<string, unknown> = Record<string
41
41
  children: React.ReactNode;
42
42
  };
43
43
  /**
44
- * Master-detail split view.
45
- * Shows the list on the left and the entity edit view on the right.
44
+ * Master-detail split view: the kit's {@link SplitView}, with the list as its
45
+ * master and the record as its detail, wired to the router.
46
+ *
47
+ * The split follows its own width: side by side when the collection view is
48
+ * wide, the record covering the list when it is narrow.
46
49
  *
47
50
  * Animation approach:
48
51
  * - The list always renders at full width.
@@ -6,8 +6,8 @@ import { EditViewBinding } from "../EditViewBinding.js";
6
6
  import { DetailViewBinding } from "../DetailViewBinding.js";
7
7
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
8
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
- import { ErrorBoundary, ResizablePanels, cls, isKeyHandled } from "@rebasepro/ui";
10
- import { UnsavedChangesDialog, useLargeLayout, useNavigationBlocker, useTranslation } from "@rebasepro/app";
9
+ import { ErrorBoundary, SplitView, cls, isKeyHandled } from "@rebasepro/ui";
10
+ import { UnsavedChangesDialog, useNavigationBlocker } from "@rebasepro/app";
11
11
  import { useLocation, useNavigate } from "react-router";
12
12
  //#region src/components/CollectionViewBinding/SplitListView.tsx
13
13
  var PANEL_SIZE_KEY = "rebase_split_list_panel_size";
@@ -60,9 +60,14 @@ function savePanelSize(path, size) {
60
60
  localStorage.setItem(`${PANEL_SIZE_KEY}_${path}`, size.toString());
61
61
  } catch {}
62
62
  }
63
+ /** The list's floor while it sits beside the record: a title, a subtitle and a status chip still read. */
64
+ var MIN_LIST_WIDTH = 240;
63
65
  /**
64
- * Master-detail split view.
65
- * Shows the list on the left and the entity edit view on the right.
66
+ * Master-detail split view: the kit's {@link SplitView}, with the list as its
67
+ * master and the record as its detail, wired to the router.
68
+ *
69
+ * The split follows its own width: side by side when the collection view is
70
+ * wide, the record covering the list when it is narrow.
66
71
  *
67
72
  * Animation approach:
68
73
  * - The list always renders at full width.
@@ -76,8 +81,6 @@ function savePanelSize(path, size) {
76
81
  * - Closing the detail navigates back to /c/authors.
77
82
  */
78
83
  function SplitListView({ collection, tableController, onEntityClick: externalOnEntityClick, onNewClick: externalOnNewClick, selectionController, selectionEnabled = true, highlightedEntities, emptyComponent, onScroll, initialScroll, size = "m", path, parentCollectionSlugs, parentEntityIds, selectedEntityId, selectedTab, toolbar, children }) {
79
- const { t } = useTranslation();
80
- const largeLayout = useLargeLayout();
81
84
  const collectionRegistryController = useCollectionRegistryController();
82
85
  const location = useLocation();
83
86
  const isEditMode = location.pathname.endsWith("/edit") || location.pathname.split("/").pop() === "edit";
@@ -103,9 +106,8 @@ function SplitListView({ collection, tableController, onEntityClick: externalOnE
103
106
  if (currentHash === "#side" || currentHash === "#new_side") return false;
104
107
  return true;
105
108
  }, []));
106
- const [panelSize, setPanelSize] = useState(() => getSavedPanelSize(path));
109
+ const [panelSize] = useState(() => getSavedPanelSize(path));
107
110
  const handlePanelSizeChange = useCallback((size) => {
108
- setPanelSize(size);
109
111
  savePanelSize(path, size);
110
112
  }, [path]);
111
113
  const [renderedEntityId, setRenderedEntityId] = useState(selectedEntityId);
@@ -216,8 +218,7 @@ function SplitListView({ collection, tableController, onEntityClick: externalOnE
216
218
  const usedParentEntityIds = parentEntityIds ?? collectionRegistryController.getParentEntityIds(path);
217
219
  const isDetailVisible = animationPhase !== "idle";
218
220
  const listPanel = /* @__PURE__ */ jsxs("div", {
219
- className: cls("flex flex-col h-full min-w-0 transition-all ease-out w-full", !largeLayout && isDetailVisible ? "opacity-0 -translate-x-1/3 pointer-events-none" : "opacity-100 translate-x-0"),
220
- style: { transitionDuration: `${TRANSITION_DURATION}ms` },
221
+ className: "flex flex-col h-full min-w-0 w-full",
221
222
  children: [toolbar, /* @__PURE__ */ jsx("div", {
222
223
  className: "flex-1 overflow-y-auto overflow-x-hidden min-h-0",
223
224
  children
@@ -225,7 +226,7 @@ function SplitListView({ collection, tableController, onEntityClick: externalOnE
225
226
  });
226
227
  const detailPanel = renderedEntityId !== void 0 ? /* @__PURE__ */ jsx("div", {
227
228
  ref: detailPanelRef,
228
- className: cls("flex-1 flex flex-col min-w-0 h-full transition-all ease-out w-full", largeLayout && "border-l border-hairline", animationPhase === "entered" ? "opacity-100 translate-x-0" : largeLayout ? "opacity-0 translate-x-8" : "opacity-0 translate-x-1/3"),
229
+ className: cls("flex-1 flex flex-col min-w-0 h-full transition-all ease-out w-full", "border-l border-hairline group-data-[layout=stacked]/split:border-l-0", animationPhase === "entered" ? "opacity-100 translate-x-0" : "opacity-0 translate-x-8 group-data-[layout=stacked]/split:translate-x-1/3"),
229
230
  style: { transitionDuration: `${TRANSITION_DURATION}ms` },
230
231
  children: /* @__PURE__ */ jsx(ErrorBoundary, { children: collection.defaultEntityAction === "view" && !isEditMode ? /* @__PURE__ */ jsx(DetailViewBinding, {
231
232
  path,
@@ -265,7 +266,7 @@ function SplitListView({ collection, tableController, onEntityClick: externalOnE
265
266
  navigate(buildUrl(newSelectedTab ? `${path}/${renderedEntityId}/${newSelectedTab}` : `${path}/${renderedEntityId}`));
266
267
  }
267
268
  }, String(renderedEntityId)) })
268
- }) : /* @__PURE__ */ jsx(Fragment, {});
269
+ }) : null;
269
270
  const openFullScreen = useCallback(() => {
270
271
  if (selectedEntityId === void 0) return;
271
272
  navigate(`${buildUrl(`${path}/${selectedEntityId}${isEditMode ? "/edit" : ""}`)}#full`);
@@ -281,15 +282,13 @@ function SplitListView({ collection, tableController, onEntityClick: externalOnE
281
282
  detailOpen: selectedEntityId !== void 0,
282
283
  openFullScreen
283
284
  }), [selectedEntityId, openFullScreen]),
284
- children: [/* @__PURE__ */ jsx(ResizablePanels, {
285
- dividerAriaLabel: t("resize_list"),
286
- stacked: !largeLayout,
287
- firstPanel: listPanel,
288
- secondPanel: detailPanel,
289
- showSecondPanel: isDetailVisible,
290
- panelSizePercent: animationPhase === "entering" ? 100 : panelSize,
291
- onPanelSizeChange: handlePanelSizeChange,
292
- minPanelSizePx: 240
285
+ children: [/* @__PURE__ */ jsx(SplitView, {
286
+ className: "group/split",
287
+ master: listPanel,
288
+ detail: isDetailVisible ? detailPanel : null,
289
+ defaultMasterPercent: panelSize,
290
+ onMasterPercentChange: handlePanelSizeChange,
291
+ minPaneWidth: MIN_LIST_WIDTH
293
292
  }), /* @__PURE__ */ jsx(UnsavedChangesDialog, {
294
293
  open: blocker?.state === "blocked",
295
294
  handleOk: () => {