@rebasepro/cms 0.30.0 → 0.31.0-canary.g59cd6fd

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 (583) hide show
  1. package/README.md +8 -8
  2. package/dist/collection_editor/ConfigControllerProvider.js +25 -22
  3. package/dist/collection_editor/ConfigControllerProvider.js.map +1 -1
  4. package/dist/collection_editor/firestore_callee.d.ts +10 -0
  5. package/dist/collection_editor/firestore_callee.js +15 -0
  6. package/dist/collection_editor/firestore_callee.js.map +1 -0
  7. package/dist/collection_editor/firestore_edit.d.ts +62 -0
  8. package/dist/collection_editor/firestore_edit.js +339 -0
  9. package/dist/collection_editor/firestore_edit.js.map +1 -0
  10. package/dist/collection_editor/index.d.ts +2 -3
  11. package/dist/collection_editor/liveSchemaClient.d.ts +44 -22
  12. package/dist/collection_editor/liveSchemaClient.js +9 -3
  13. package/dist/collection_editor/liveSchemaClient.js.map +1 -1
  14. package/dist/collection_editor/property_column.d.ts +86 -0
  15. package/dist/collection_editor/property_column.js +719 -0
  16. package/dist/collection_editor/property_column.js.map +1 -0
  17. package/dist/collection_editor/serializable_types.d.ts +2 -24
  18. package/dist/collection_editor/serializable_utils.d.ts +1 -1
  19. package/dist/collection_editor/serializable_utils.js +2 -1
  20. package/dist/collection_editor/serializable_utils.js.map +1 -1
  21. package/dist/collection_editor/split_edit.d.ts +106 -0
  22. package/dist/collection_editor/split_edit.js +564 -0
  23. package/dist/collection_editor/split_edit.js.map +1 -0
  24. package/dist/collection_editor/split_edit_error.d.ts +25 -0
  25. package/dist/collection_editor/split_edit_error.js +35 -0
  26. package/dist/collection_editor/split_edit_error.js.map +1 -0
  27. package/dist/collection_editor/types/collection_editor_controller.d.ts +1 -1
  28. package/dist/collection_editor/types/config_controller.d.ts +67 -1
  29. package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +6 -5
  30. package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.js +44 -12
  31. package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.js.map +1 -1
  32. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.js +18 -3
  33. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.js.map +1 -1
  34. package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.js +94 -55
  35. package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.js.map +1 -1
  36. package/dist/collection_editor/ui/collection_editor/CollectionRelationsTab.d.ts +2 -1
  37. package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.js.map +1 -1
  38. package/dist/collection_editor/ui/collection_editor/EnumForm.d.ts +1 -1
  39. package/dist/collection_editor/ui/collection_editor/EnumForm.js.map +1 -1
  40. package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.js +3 -3
  41. package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.js.map +1 -1
  42. package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.js.map +1 -1
  43. package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +2 -3
  44. package/dist/collection_editor/ui/collection_editor/PropertyEditView.js +1 -1
  45. package/dist/collection_editor/ui/collection_editor/PropertyEditView.js.map +1 -1
  46. package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.d.ts +1 -1
  47. package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.js +1 -1
  48. package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.js.map +1 -1
  49. package/dist/collection_editor/ui/collection_editor/PropertyTree.d.ts +7 -4
  50. package/dist/collection_editor/ui/collection_editor/PropertyTree.js +15 -5
  51. package/dist/collection_editor/ui/collection_editor/PropertyTree.js.map +1 -1
  52. package/dist/collection_editor/ui/collection_editor/SchemaChangeDialog.js +1 -1
  53. package/dist/collection_editor/ui/collection_editor/SchemaChangeDialog.js.map +1 -1
  54. package/dist/collection_editor/ui/collection_editor/SchemaEditRefusalView.d.ts +20 -0
  55. package/dist/collection_editor/ui/collection_editor/SchemaEditRefusalView.js +74 -0
  56. package/dist/collection_editor/ui/collection_editor/SchemaEditRefusalView.js.map +1 -0
  57. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.d.ts +1 -1
  58. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js.map +1 -1
  59. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.js.map +1 -1
  60. package/dist/collection_editor/ui/collection_editor/import/clean_import_data.d.ts +1 -1
  61. package/dist/collection_editor/ui/collection_editor/import/clean_import_data.js.map +1 -1
  62. package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.js.map +1 -1
  63. package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.js.map +1 -1
  64. package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.js +1 -1
  65. package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.js.map +1 -1
  66. package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.js.map +1 -1
  67. package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.js.map +1 -1
  68. package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.js.map +1 -1
  69. package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.js.map +1 -1
  70. package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.d.ts +1 -1
  71. package/dist/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.d.ts +1 -1
  72. package/dist/collection_editor/ui/collection_editor/properties/conditions/property_paths.d.ts +1 -1
  73. package/dist/collection_editor/ui/collection_editor/rlsRuleForm.d.ts +34 -0
  74. package/dist/collection_editor/ui/collection_editor/rlsRuleForm.js +50 -0
  75. package/dist/collection_editor/ui/collection_editor/rlsRuleForm.js.map +1 -0
  76. package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.d.ts +1 -2
  77. package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.js.map +1 -1
  78. package/dist/collection_editor/useDetachRulesConfirmation.d.ts +16 -0
  79. package/dist/collection_editor/useDetachRulesConfirmation.js +48 -0
  80. package/dist/collection_editor/useDetachRulesConfirmation.js.map +1 -0
  81. package/dist/collection_editor/useLiveSchemaEditing.d.ts +2 -2
  82. package/dist/collection_editor/useLiveSchemaEditing.js +1 -1
  83. package/dist/collection_editor/useLiveSchemaEditing.js.map +1 -1
  84. package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +54 -10
  85. package/dist/collection_editor/useLocalCollectionsConfigController.js +394 -122
  86. package/dist/collection_editor/useLocalCollectionsConfigController.js.map +1 -1
  87. package/dist/collection_editor/validateCollectionJson.js.map +1 -1
  88. package/dist/components/CollectionPanel.d.ts +10 -9
  89. package/dist/components/CollectionPanel.js +5 -2
  90. package/dist/components/CollectionPanel.js.map +1 -1
  91. package/dist/components/CollectionTableBinding/CollectionRowActions.d.ts +1 -2
  92. package/dist/components/CollectionTableBinding/CollectionRowActions.js.map +1 -1
  93. package/dist/components/CollectionTableBinding/CollectionTableBinding.js.map +1 -1
  94. package/dist/components/CollectionTableBinding/CollectionTableBindingProps.d.ts +3 -5
  95. package/dist/components/CollectionTableBinding/PropertyTableCell.d.ts +2 -2
  96. package/dist/components/CollectionTableBinding/PropertyTableCell.js.map +1 -1
  97. package/dist/components/CollectionTableBinding/column_utils.d.ts +1 -1
  98. package/dist/components/CollectionTableBinding/column_utils.js.map +1 -1
  99. package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.d.ts +2 -2
  100. package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js +1 -2
  101. package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js.map +1 -1
  102. package/dist/components/CollectionTableBinding/fields/TableReferenceField.d.ts +2 -2
  103. package/dist/components/CollectionTableBinding/fields/TableReferenceField.js +2 -2
  104. package/dist/components/CollectionTableBinding/fields/TableReferenceField.js.map +1 -1
  105. package/dist/components/CollectionTableBinding/fields/TableRelationField.d.ts +2 -2
  106. package/dist/components/CollectionTableBinding/fields/TableRelationField.js +1 -2
  107. package/dist/components/CollectionTableBinding/fields/TableRelationField.js.map +1 -1
  108. package/dist/components/CollectionTableBinding/fields/TableRelationSelectorField.d.ts +2 -1
  109. package/dist/components/CollectionTableBinding/fields/TableRelationSelectorField.js.map +1 -1
  110. package/dist/components/CollectionTableBinding/fields/TableStorageUpload.d.ts +2 -2
  111. package/dist/components/CollectionTableBinding/fields/TableStorageUpload.js.map +1 -1
  112. package/dist/components/CollectionTableBinding/fields/VirtualTableSelect.d.ts +1 -1
  113. package/dist/components/CollectionTableBinding/fields/VirtualTableSelect.js +1 -1
  114. package/dist/components/CollectionTableBinding/fields/VirtualTableSelect.js.map +1 -1
  115. package/dist/components/CollectionTableBinding/internal/common.d.ts +1 -2
  116. package/dist/components/CollectionTableBinding/internal/common.js.map +1 -1
  117. package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.d.ts +1 -1
  118. package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js +2 -2
  119. package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js.map +1 -1
  120. package/dist/components/CollectionTableBinding/table_bindings.d.ts +2 -2
  121. package/dist/components/CollectionTableBinding/table_bindings.js.map +1 -1
  122. package/dist/components/CollectionViewBinding/BoardCardBinding.d.ts +1 -1
  123. package/dist/components/CollectionViewBinding/BoardCardBinding.js.map +1 -1
  124. package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.d.ts +1 -2
  125. package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js +9 -5
  126. package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js.map +1 -1
  127. package/dist/components/CollectionViewBinding/CollectionCardViewBinding.d.ts +1 -2
  128. package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js.map +1 -1
  129. package/dist/components/CollectionViewBinding/CollectionEntityActions.d.ts +1 -1
  130. package/dist/components/CollectionViewBinding/CollectionEntityActions.js.map +1 -1
  131. package/dist/components/CollectionViewBinding/CollectionListViewBinding.d.ts +1 -2
  132. package/dist/components/CollectionViewBinding/CollectionListViewBinding.js +1 -1
  133. package/dist/components/CollectionViewBinding/CollectionListViewBinding.js.map +1 -1
  134. package/dist/components/CollectionViewBinding/CollectionToolbar.js +1 -1
  135. package/dist/components/CollectionViewBinding/CollectionToolbar.js.map +1 -1
  136. package/dist/components/CollectionViewBinding/CollectionViewActions.js +2 -4
  137. package/dist/components/CollectionViewBinding/CollectionViewActions.js.map +1 -1
  138. package/dist/components/CollectionViewBinding/CollectionViewBinding.d.ts +6 -6
  139. package/dist/components/CollectionViewBinding/CollectionViewBinding.js.map +1 -1
  140. package/dist/components/CollectionViewBinding/CollectionViewContent.js +1 -2
  141. package/dist/components/CollectionViewBinding/CollectionViewContent.js.map +1 -1
  142. package/dist/components/CollectionViewBinding/CollectionViewStartActions.d.ts +1 -1
  143. package/dist/components/CollectionViewBinding/CollectionViewStartActions.js.map +1 -1
  144. package/dist/components/CollectionViewBinding/CustomViewHost.d.ts +1 -2
  145. package/dist/components/CollectionViewBinding/CustomViewHost.js.map +1 -1
  146. package/dist/components/CollectionViewBinding/EntitiesCount.js +3 -3
  147. package/dist/components/CollectionViewBinding/EntitiesCount.js.map +1 -1
  148. package/dist/components/CollectionViewBinding/EntityCardBinding.d.ts +1 -2
  149. package/dist/components/CollectionViewBinding/EntityCardBinding.js.map +1 -1
  150. package/dist/components/CollectionViewBinding/EntityIdHeaderWidget.js +1 -1
  151. package/dist/components/CollectionViewBinding/EntityIdHeaderWidget.js.map +1 -1
  152. package/dist/components/CollectionViewBinding/FilterPresetsButton.d.ts +1 -2
  153. package/dist/components/CollectionViewBinding/FilterPresetsButton.js +1 -1
  154. package/dist/components/CollectionViewBinding/FilterPresetsButton.js.map +1 -1
  155. package/dist/components/CollectionViewBinding/FiltersButton.d.ts +1 -2
  156. package/dist/components/CollectionViewBinding/FiltersButton.js.map +1 -1
  157. package/dist/components/CollectionViewBinding/FiltersDialog.d.ts +1 -1
  158. package/dist/components/CollectionViewBinding/FiltersDialog.js.map +1 -1
  159. package/dist/components/CollectionViewBinding/PluginColumnSlots.d.ts +1 -2
  160. package/dist/components/CollectionViewBinding/PluginColumnSlots.js.map +1 -1
  161. package/dist/components/CollectionViewBinding/RowActions.d.ts +1 -2
  162. package/dist/components/CollectionViewBinding/RowActions.js.map +1 -1
  163. package/dist/components/CollectionViewBinding/SortButton.d.ts +1 -1
  164. package/dist/components/CollectionViewBinding/SortButton.js.map +1 -1
  165. package/dist/components/CollectionViewBinding/SplitListView.d.ts +1 -2
  166. package/dist/components/CollectionViewBinding/SplitListView.js.map +1 -1
  167. package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.d.ts +1 -2
  168. package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.js +1 -1
  169. package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.js.map +1 -1
  170. package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.d.ts +1 -2
  171. package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.js.map +1 -1
  172. package/dist/components/CollectionViewBinding/useBoardDataController.d.ts +2 -1
  173. package/dist/components/CollectionViewBinding/useBoardDataController.js +3 -3
  174. package/dist/components/CollectionViewBinding/useBoardDataController.js.map +1 -1
  175. package/dist/components/CollectionViewBinding/useCollectionViewState.d.ts +2 -4
  176. package/dist/components/CollectionViewBinding/useCollectionViewState.js +14 -19
  177. package/dist/components/CollectionViewBinding/useCollectionViewState.js.map +1 -1
  178. package/dist/components/CollectionViewBinding/usePreviewSlots.d.ts +1 -3
  179. package/dist/components/CollectionViewBinding/usePreviewSlots.js.map +1 -1
  180. package/dist/components/CollectionViewBinding/useSelectionController.d.ts +1 -2
  181. package/dist/components/CollectionViewBinding/useSelectionController.js.map +1 -1
  182. package/dist/components/CollectionsProvider.d.ts +23 -8
  183. package/dist/components/CollectionsProvider.js +23 -7
  184. package/dist/components/CollectionsProvider.js.map +1 -1
  185. package/dist/components/DefaultDrawer.js +1 -1
  186. package/dist/components/DeleteEntityDialog.d.ts +1 -1
  187. package/dist/components/DeleteEntityDialog.js +1 -1
  188. package/dist/components/DeleteEntityDialog.js.map +1 -1
  189. package/dist/components/DetailViewBinding.js +3 -3
  190. package/dist/components/DetailViewBinding.js.map +1 -1
  191. package/dist/components/EditFormActions.js.map +1 -1
  192. package/dist/components/EditViewBinding.d.ts +2 -1
  193. package/dist/components/EditViewBinding.js +6 -6
  194. package/dist/components/EditViewBinding.js.map +1 -1
  195. package/dist/components/EntityDisplayHeader.d.ts +1 -2
  196. package/dist/components/EntityDisplayHeader.js.map +1 -1
  197. package/dist/components/EntityInspector.d.ts +1 -2
  198. package/dist/components/EntityInspector.js.map +1 -1
  199. package/dist/components/EntityPreviewBinding.d.ts +1 -1
  200. package/dist/components/EntityPreviewBinding.js +1 -1
  201. package/dist/components/EntityPreviewBinding.js.map +1 -1
  202. package/dist/components/EntityViewBinding.d.ts +1 -1
  203. package/dist/components/EntityViewBinding.js.map +1 -1
  204. package/dist/components/EntityViewBody.d.ts +1 -1
  205. package/dist/components/EntityViewBody.js +3 -4
  206. package/dist/components/EntityViewBody.js.map +1 -1
  207. package/dist/components/FieldValue.js +2 -2
  208. package/dist/components/FieldValue.js.map +1 -1
  209. package/dist/components/HomePage/ContentHomePage.js +12 -3
  210. package/dist/components/HomePage/ContentHomePage.js.map +1 -1
  211. package/dist/components/InlineEntityPreview.d.ts +1 -1
  212. package/dist/components/InlineEntityPreview.js.map +1 -1
  213. package/dist/components/PropertyCollectionView.d.ts +2 -2
  214. package/dist/components/PropertyCollectionView.js.map +1 -1
  215. package/dist/components/PropertyConfigBadge.js.map +1 -1
  216. package/dist/components/RebaseCMS.d.ts +22 -3
  217. package/dist/components/RebaseCMS.js +32 -14
  218. package/dist/components/RebaseCMS.js.map +1 -1
  219. package/dist/components/RebaseNavigation.js +106 -31
  220. package/dist/components/RebaseNavigation.js.map +1 -1
  221. package/dist/components/RecordDetail.js +4 -1
  222. package/dist/components/RecordDetail.js.map +1 -1
  223. package/dist/components/RecordForm.d.ts +5 -5
  224. package/dist/components/RecordForm.js +5 -2
  225. package/dist/components/RecordForm.js.map +1 -1
  226. package/dist/components/ReferenceTable/SelectionTableBinding.d.ts +2 -2
  227. package/dist/components/ReferenceTable/SelectionTableBinding.js +1 -1
  228. package/dist/components/ReferenceTable/SelectionTableBinding.js.map +1 -1
  229. package/dist/components/ReferenceWidget.d.ts +2 -1
  230. package/dist/components/ReferenceWidget.js +2 -2
  231. package/dist/components/ReferenceWidget.js.map +1 -1
  232. package/dist/components/RelationSelector.d.ts +2 -1
  233. package/dist/components/RelationSelector.js +2 -3
  234. package/dist/components/RelationSelector.js.map +1 -1
  235. package/dist/components/SelectableTable/SelectableTable.d.ts +2 -2
  236. package/dist/components/SelectableTable/SelectableTable.js.map +1 -1
  237. package/dist/components/SelectableTable/filters/FilterFieldBinding.d.ts +2 -1
  238. package/dist/components/SelectableTable/filters/FilterFieldBinding.js +3 -3
  239. package/dist/components/SelectableTable/filters/FilterFieldBinding.js.map +1 -1
  240. package/dist/components/SelectableTable/filters/ReferenceFilterField.js +2 -2
  241. package/dist/components/SelectableTable/filters/ReferenceFilterField.js.map +1 -1
  242. package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +1 -1
  243. package/dist/components/SelectableTable/filters/RelationFilterField.js +1 -1
  244. package/dist/components/SelectableTable/filters/RelationFilterField.js.map +1 -1
  245. package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +1 -1
  246. package/dist/components/SelectableTable/filters/StringNumberFilterField.js.map +1 -1
  247. package/dist/components/SelectableTable/filters/null_filter.d.ts +1 -3
  248. package/dist/components/SelectableTable/filters/null_filter.js.map +1 -1
  249. package/dist/components/SidePanelBinding.js +1 -1
  250. package/dist/components/SidePanelBinding.js.map +1 -1
  251. package/dist/components/field_configs.d.ts +1 -2
  252. package/dist/components/field_configs.js.map +1 -1
  253. package/dist/components/field_ids.d.ts +1 -1
  254. package/dist/components/field_ids.js +1 -1
  255. package/dist/components/field_ids.js.map +1 -1
  256. package/dist/components/history/EntityHistoryEntry.js.map +1 -1
  257. package/dist/components/history/EntityHistoryView.d.ts +1 -2
  258. package/dist/components/history/EntityHistoryView.js +1 -1
  259. package/dist/components/history/EntityHistoryView.js.map +1 -1
  260. package/dist/data_export/export/BasicExportAction.d.ts +1 -1
  261. package/dist/data_export/export/BasicExportAction.js.map +1 -1
  262. package/dist/data_export/export/ExportCollectionAction.js +2 -2
  263. package/dist/data_export/export/ExportCollectionAction.js.map +1 -1
  264. package/dist/data_export/export/additional_fields.d.ts +1 -1
  265. package/dist/data_export/export/additional_fields.js.map +1 -1
  266. package/dist/data_export/export/export.d.ts +1 -1
  267. package/dist/data_export/export/export.js +1 -1
  268. package/dist/data_export/export/export.js.map +1 -1
  269. package/dist/data_export/export/fetch_export_data.d.ts +3 -2
  270. package/dist/data_export/export/fetch_export_data.js.map +1 -1
  271. package/dist/data_import/components/DataNewPropertiesMapping.d.ts +1 -1
  272. package/dist/data_import/components/DataNewPropertiesMapping.js.map +1 -1
  273. package/dist/data_import/components/ImportNewPropertyFieldPreview.d.ts +1 -1
  274. package/dist/data_import/components/ImportNewPropertyFieldPreview.js.map +1 -1
  275. package/dist/data_import/hooks/useImportConfig.js.map +1 -1
  276. package/dist/data_import/import/ImportCollectionAction.d.ts +2 -2
  277. package/dist/data_import/import/ImportCollectionAction.js.map +1 -1
  278. package/dist/data_import/types/column_mapping.d.ts +1 -1
  279. package/dist/data_import/utils/data.d.ts +1 -2
  280. package/dist/data_import/utils/data.js +1 -2
  281. package/dist/data_import/utils/data.js.map +1 -1
  282. package/dist/data_import/utils/get_import_inference_type.d.ts +1 -1
  283. package/dist/data_import/utils/get_import_inference_type.js.map +1 -1
  284. package/dist/data_import/utils/id_column.d.ts +1 -1
  285. package/dist/data_import/utils/id_column.js.map +1 -1
  286. package/dist/data_import/utils/import_columns.d.ts +1 -1
  287. package/dist/data_import/utils/import_columns.js.map +1 -1
  288. package/dist/data_import/utils/save_entities.d.ts +3 -3
  289. package/dist/data_import/utils/save_entities.js +1 -1
  290. package/dist/data_import/utils/save_entities.js.map +1 -1
  291. package/dist/form/EntityForm.js +2 -1
  292. package/dist/form/EntityForm.js.map +1 -1
  293. package/dist/form/EntityFormActions.js.map +1 -1
  294. package/dist/form/EntityFormBinding.js +2 -2
  295. package/dist/form/EntityFormBinding.js.map +1 -1
  296. package/dist/form/FormFieldsContext.d.ts +1 -4
  297. package/dist/form/FormFieldsContext.js +1 -1
  298. package/dist/form/FormFieldsContext.js.map +1 -1
  299. package/dist/form/PropertyFieldBinding.js +6 -8
  300. package/dist/form/PropertyFieldBinding.js.map +1 -1
  301. package/dist/form/components/FieldBlock.d.ts +1 -2
  302. package/dist/form/components/FieldBlock.js.map +1 -1
  303. package/dist/form/components/FieldHelperText.d.ts +1 -1
  304. package/dist/form/components/FieldHelperText.js.map +1 -1
  305. package/dist/form/components/FormRail.d.ts +1 -1
  306. package/dist/form/components/FormRail.js.map +1 -1
  307. package/dist/form/components/LocalChangesMenu.d.ts +1 -1
  308. package/dist/form/components/LocalChangesMenu.js.map +1 -1
  309. package/dist/form/components/StorageItemPreview.d.ts +1 -1
  310. package/dist/form/components/StorageItemPreview.js.map +1 -1
  311. package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +1 -1
  312. package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.js +1 -1
  313. package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.js.map +1 -1
  314. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +2 -2
  315. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js +2 -2
  316. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js.map +1 -1
  317. package/dist/form/field_bindings/BinaryFieldBinding.d.ts +1 -1
  318. package/dist/form/field_bindings/BinaryFieldBinding.js.map +1 -1
  319. package/dist/form/field_bindings/BlockFieldBinding.d.ts +1 -1
  320. package/dist/form/field_bindings/BlockFieldBinding.js +1 -1
  321. package/dist/form/field_bindings/BlockFieldBinding.js.map +1 -1
  322. package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +1 -1
  323. package/dist/form/field_bindings/DateTimeFieldBinding.js.map +1 -1
  324. package/dist/form/field_bindings/GeopointFieldBinding.d.ts +1 -1
  325. package/dist/form/field_bindings/GeopointFieldBinding.js.map +1 -1
  326. package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +1 -1
  327. package/dist/form/field_bindings/KeyValueFieldBinding.js +1 -2
  328. package/dist/form/field_bindings/KeyValueFieldBinding.js.map +1 -1
  329. package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
  330. package/dist/form/field_bindings/MapFieldBinding.js.map +1 -1
  331. package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +1 -1
  332. package/dist/form/field_bindings/MarkdownEditorFieldBinding.js +1 -1
  333. package/dist/form/field_bindings/MarkdownEditorFieldBinding.js.map +1 -1
  334. package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +1 -1
  335. package/dist/form/field_bindings/MultiSelectFieldBinding.js +1 -1
  336. package/dist/form/field_bindings/MultiSelectFieldBinding.js.map +1 -1
  337. package/dist/form/field_bindings/MultipleRelationFieldBinding.d.ts +1 -1
  338. package/dist/form/field_bindings/MultipleRelationFieldBinding.js +2 -2
  339. package/dist/form/field_bindings/MultipleRelationFieldBinding.js.map +1 -1
  340. package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +1 -1
  341. package/dist/form/field_bindings/ReadOnlyFieldBinding.js.map +1 -1
  342. package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +1 -1
  343. package/dist/form/field_bindings/ReferenceFieldBinding.js +2 -2
  344. package/dist/form/field_bindings/ReferenceFieldBinding.js.map +1 -1
  345. package/dist/form/field_bindings/RelationFieldBinding.d.ts +1 -1
  346. package/dist/form/field_bindings/RelationFieldBinding.js +2 -2
  347. package/dist/form/field_bindings/RelationFieldBinding.js.map +1 -1
  348. package/dist/form/field_bindings/RepeatFieldBinding.d.ts +1 -1
  349. package/dist/form/field_bindings/RepeatFieldBinding.js +1 -1
  350. package/dist/form/field_bindings/RepeatFieldBinding.js.map +1 -1
  351. package/dist/form/field_bindings/SelectFieldBinding.d.ts +1 -1
  352. package/dist/form/field_bindings/SelectFieldBinding.js +1 -1
  353. package/dist/form/field_bindings/SelectFieldBinding.js.map +1 -1
  354. package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +2 -2
  355. package/dist/form/field_bindings/StorageUploadFieldBinding.js.map +1 -1
  356. package/dist/form/field_bindings/SwitchFieldBinding.d.ts +1 -1
  357. package/dist/form/field_bindings/SwitchFieldBinding.js.map +1 -1
  358. package/dist/form/field_bindings/TextFieldBinding.d.ts +1 -1
  359. package/dist/form/field_bindings/TextFieldBinding.js.map +1 -1
  360. package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +1 -1
  361. package/dist/form/field_bindings/UserSelectFieldBinding.js.map +1 -1
  362. package/dist/form/field_bindings/VectorFieldBinding.d.ts +1 -1
  363. package/dist/form/field_bindings/VectorFieldBinding.js.map +1 -1
  364. package/dist/form/form_utils.d.ts +3 -3
  365. package/dist/form/form_utils.js +1 -2
  366. package/dist/form/form_utils.js.map +1 -1
  367. package/dist/form/label_placement.d.ts +1 -2
  368. package/dist/form/label_placement.js.map +1 -1
  369. package/dist/form/resolve_cell_property.d.ts +1 -2
  370. package/dist/form/resolve_cell_property.js +1 -1
  371. package/dist/form/resolve_cell_property.js.map +1 -1
  372. package/dist/form/resolve_form_properties.d.ts +2 -2
  373. package/dist/form/resolve_form_properties.js +1 -1
  374. package/dist/form/resolve_form_properties.js.map +1 -1
  375. package/dist/form/useClearRestoreValue.d.ts +1 -1
  376. package/dist/form/useClearRestoreValue.js.map +1 -1
  377. package/dist/form/validation.d.ts +2 -2
  378. package/dist/form/validation.js +1 -1
  379. package/dist/form/validation.js.map +1 -1
  380. package/dist/hooks/navigation/compose_collections.d.ts +59 -0
  381. package/dist/hooks/navigation/compose_collections.js +48 -0
  382. package/dist/hooks/navigation/compose_collections.js.map +1 -0
  383. package/dist/hooks/navigation/compose_collections_input.d.ts +8 -0
  384. package/dist/hooks/navigation/compose_collections_input.js +17 -0
  385. package/dist/hooks/navigation/compose_collections_input.js.map +1 -0
  386. package/dist/hooks/navigation/contexts/CollectionRegistryContext.d.ts +1 -1
  387. package/dist/hooks/navigation/contexts/CollectionRegistryContext.js.map +1 -1
  388. package/dist/hooks/navigation/registered_collection.d.ts +15 -0
  389. package/dist/hooks/navigation/registered_collection.js +20 -0
  390. package/dist/hooks/navigation/registered_collection.js.map +1 -0
  391. package/dist/hooks/navigation/ui_preferences.d.ts +47 -0
  392. package/dist/hooks/navigation/ui_preferences.js +179 -0
  393. package/dist/hooks/navigation/ui_preferences.js.map +1 -0
  394. package/dist/hooks/navigation/useAsyncResolver.d.ts +8 -1
  395. package/dist/hooks/navigation/useAsyncResolver.js +9 -3
  396. package/dist/hooks/navigation/useAsyncResolver.js.map +1 -1
  397. package/dist/hooks/navigation/useBuildCollectionRegistryController.d.ts +1 -3
  398. package/dist/hooks/navigation/useBuildCollectionRegistryController.js +3 -3
  399. package/dist/hooks/navigation/useBuildCollectionRegistryController.js.map +1 -1
  400. package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +9 -5
  401. package/dist/hooks/navigation/useBuildNavigationStateController.js +2 -1
  402. package/dist/hooks/navigation/useBuildNavigationStateController.js.map +1 -1
  403. package/dist/hooks/navigation/useBuildUrlController.d.ts +1 -1
  404. package/dist/hooks/navigation/useBuildUrlController.js.map +1 -1
  405. package/dist/hooks/navigation/useNavigationResolution.js +1 -2
  406. package/dist/hooks/navigation/useNavigationResolution.js.map +1 -1
  407. package/dist/hooks/navigation/usePanelTables.d.ts +11 -0
  408. package/dist/hooks/navigation/usePanelTables.js +33 -0
  409. package/dist/hooks/navigation/usePanelTables.js.map +1 -0
  410. package/dist/hooks/navigation/useResolvedCollections.d.ts +8 -3
  411. package/dist/hooks/navigation/useResolvedCollections.js +3 -2
  412. package/dist/hooks/navigation/useResolvedCollections.js.map +1 -1
  413. package/dist/hooks/navigation/useResolvedViews.d.ts +1 -2
  414. package/dist/hooks/navigation/useResolvedViews.js.map +1 -1
  415. package/dist/hooks/navigation/useTopLevelNavigation.d.ts +1 -2
  416. package/dist/hooks/navigation/useTopLevelNavigation.js.map +1 -1
  417. package/dist/hooks/navigation/user_preferences_overlay.d.ts +21 -0
  418. package/dist/hooks/navigation/user_preferences_overlay.js +101 -0
  419. package/dist/hooks/navigation/user_preferences_overlay.js.map +1 -0
  420. package/dist/hooks/navigation/utils.js +1 -1
  421. package/dist/hooks/navigation/utils.js.map +1 -1
  422. package/dist/hooks/useAdminContext.d.ts +1 -2
  423. package/dist/hooks/useAdminContext.js.map +1 -1
  424. package/dist/hooks/useBuildSidePanel.d.ts +1 -2
  425. package/dist/hooks/useBuildSidePanel.js +2 -1
  426. package/dist/hooks/useBuildSidePanel.js.map +1 -1
  427. package/dist/hooks/useChildViewSource.d.ts +1 -1
  428. package/dist/hooks/useChildViewSource.js +1 -1
  429. package/dist/hooks/useChildViewSource.js.map +1 -1
  430. package/dist/hooks/useEntityDisplay.d.ts +1 -2
  431. package/dist/hooks/useEntityDisplay.js +1 -1
  432. package/dist/hooks/useEntityDisplay.js.map +1 -1
  433. package/dist/hooks/useEntityDisplayTitle.d.ts +2 -2
  434. package/dist/hooks/useEntityDisplayTitle.js.map +1 -1
  435. package/dist/hooks/useHistory.js +1 -1
  436. package/dist/hooks/useHistory.js.map +1 -1
  437. package/dist/hooks/useRecordActions.d.ts +1 -2
  438. package/dist/hooks/useRecordActions.js.map +1 -1
  439. package/dist/hooks/useReferencePaths.d.ts +21 -7
  440. package/dist/hooks/useReferencePaths.js +23 -6
  441. package/dist/hooks/useReferencePaths.js.map +1 -1
  442. package/dist/hooks/useResolvedNavigationFrom.d.ts +3 -3
  443. package/dist/hooks/useResolvedNavigationFrom.js +1 -1
  444. package/dist/hooks/useResolvedNavigationFrom.js.map +1 -1
  445. package/dist/index.d.ts +11 -0
  446. package/dist/index.js +8 -2
  447. package/dist/mcp_view/app_modules.d.ts +2 -2
  448. package/dist/mcp_view/app_modules.js +4 -4
  449. package/dist/mcp_view/app_modules.js.map +1 -1
  450. package/dist/mcp_view/index.d.ts +16 -19
  451. package/dist/mcp_view/index.js +43 -62
  452. package/dist/mcp_view/index.js.map +1 -1
  453. package/dist/mcp_view/payload.d.ts +54 -18
  454. package/dist/mcp_view/payload.js +49 -24
  455. package/dist/mcp_view/payload.js.map +1 -1
  456. package/dist/mcp_view/screen.js +11 -11
  457. package/dist/mcp_view/screen.js.map +1 -1
  458. package/dist/mcp_view/tool_driver.d.ts +5 -34
  459. package/dist/mcp_view/tool_driver.js +17 -16
  460. package/dist/mcp_view/tool_driver.js.map +1 -1
  461. package/dist/mcp_view/write_review.d.ts +1 -2
  462. package/dist/mcp_view/write_review.js +1 -1
  463. package/dist/mcp_view/write_review.js.map +1 -1
  464. package/dist/preview/PropertyPreview.d.ts +1 -1
  465. package/dist/preview/PropertyPreview.js +4 -3
  466. package/dist/preview/PropertyPreview.js.map +1 -1
  467. package/dist/preview/components/ArrayEnumPreview.d.ts +1 -1
  468. package/dist/preview/components/ArrayEnumPreview.js.map +1 -1
  469. package/dist/preview/components/BooleanPreview.d.ts +1 -1
  470. package/dist/preview/components/BooleanPreview.js.map +1 -1
  471. package/dist/preview/components/EnumValuesChip.d.ts +1 -1
  472. package/dist/preview/components/EnumValuesChip.js +1 -1
  473. package/dist/preview/components/EnumValuesChip.js.map +1 -1
  474. package/dist/preview/components/ReferencePreview.d.ts +1 -1
  475. package/dist/preview/components/ReferencePreview.js.map +1 -1
  476. package/dist/preview/components/RelationPreview.d.ts +1 -1
  477. package/dist/preview/components/RelationPreview.js.map +1 -1
  478. package/dist/preview/components/StorageThumbnail.js +2 -1
  479. package/dist/preview/components/StorageThumbnail.js.map +1 -1
  480. package/dist/preview/components/UserPreview.d.ts +1 -1
  481. package/dist/preview/components/UserPreview.js.map +1 -1
  482. package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +1 -1
  483. package/dist/preview/property_previews/ArrayOfMapsPreview.js.map +1 -1
  484. package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +1 -1
  485. package/dist/preview/property_previews/ArrayOfReferencesPreview.js.map +1 -1
  486. package/dist/preview/property_previews/ArrayOfRelationsPreview.d.ts +1 -1
  487. package/dist/preview/property_previews/ArrayOfRelationsPreview.js +2 -1
  488. package/dist/preview/property_previews/ArrayOfRelationsPreview.js.map +1 -1
  489. package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +1 -1
  490. package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.js.map +1 -1
  491. package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +1 -1
  492. package/dist/preview/property_previews/ArrayOfStringsPreview.js.map +1 -1
  493. package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +1 -1
  494. package/dist/preview/property_previews/ArrayOneOfPreview.js +1 -1
  495. package/dist/preview/property_previews/ArrayOneOfPreview.js.map +1 -1
  496. package/dist/preview/property_previews/ArrayPropertyEnumPreview.d.ts +1 -1
  497. package/dist/preview/property_previews/ArrayPropertyEnumPreview.js +1 -1
  498. package/dist/preview/property_previews/ArrayPropertyEnumPreview.js.map +1 -1
  499. package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +1 -1
  500. package/dist/preview/property_previews/ArrayPropertyPreview.js +1 -1
  501. package/dist/preview/property_previews/ArrayPropertyPreview.js.map +1 -1
  502. package/dist/preview/property_previews/MapPropertyPreview.d.ts +1 -1
  503. package/dist/preview/property_previews/MapPropertyPreview.js.map +1 -1
  504. package/dist/preview/property_previews/NumberPropertyPreview.d.ts +1 -1
  505. package/dist/preview/property_previews/NumberPropertyPreview.js +1 -1
  506. package/dist/preview/property_previews/NumberPropertyPreview.js.map +1 -1
  507. package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +1 -1
  508. package/dist/preview/property_previews/SkeletonPropertyComponent.js.map +1 -1
  509. package/dist/preview/property_previews/StringPropertyPreview.d.ts +1 -1
  510. package/dist/preview/property_previews/StringPropertyPreview.js.map +1 -1
  511. package/dist/preview/util.d.ts +1 -1
  512. package/dist/preview/util.js.map +1 -1
  513. package/dist/routes/RebaseRoute.js +2 -2
  514. package/dist/routes/RebaseRoute.js.map +1 -1
  515. package/dist/saved_apps/SavedAppsView.d.ts +1 -1
  516. package/dist/saved_apps/SavedAppsView.js +1 -1
  517. package/dist/saved_apps/SavedAppsView.js.map +1 -1
  518. package/dist/selection/SelectionMenu.d.ts +1 -1
  519. package/dist/selection/SelectionMenu.js.map +1 -1
  520. package/dist/selection/resolve_selection.d.ts +3 -3
  521. package/dist/selection/resolve_selection.js +3 -2
  522. package/dist/selection/resolve_selection.js.map +1 -1
  523. package/dist/tables/apply_customization.d.ts +65 -0
  524. package/dist/tables/apply_customization.js +644 -0
  525. package/dist/tables/apply_customization.js.map +1 -0
  526. package/dist/tables/column_property.d.ts +64 -0
  527. package/dist/tables/column_property.js +549 -0
  528. package/dist/tables/column_property.js.map +1 -0
  529. package/dist/tables/customize_table.d.ts +39 -0
  530. package/dist/tables/customize_table.js +247 -0
  531. package/dist/tables/customize_table.js.map +1 -0
  532. package/dist/tables/index.d.ts +12 -0
  533. package/dist/tables/labels.d.ts +18 -0
  534. package/dist/tables/labels.js +18 -0
  535. package/dist/tables/labels.js.map +1 -0
  536. package/dist/tables/project_table.d.ts +79 -0
  537. package/dist/tables/project_table.js +148 -0
  538. package/dist/tables/project_table.js.map +1 -0
  539. package/dist/tables/relations.d.ts +47 -0
  540. package/dist/tables/relations.js +112 -0
  541. package/dist/tables/relations.js.map +1 -0
  542. package/dist/tables/rls.d.ts +39 -0
  543. package/dist/tables/rls.js +111 -0
  544. package/dist/tables/rls.js.map +1 -0
  545. package/dist/tables/update_record.d.ts +32 -0
  546. package/dist/tables/update_record.js +40 -0
  547. package/dist/tables/update_record.js.map +1 -0
  548. package/dist/types/components/EntityFormActionsProps.d.ts +1 -1
  549. package/dist/types/components/PropertyPreviewProps.d.ts +2 -2
  550. package/dist/types/fields.d.ts +2 -2
  551. package/dist/util/dataControllerAdapter.js.map +1 -1
  552. package/dist/util/entity_pages.d.ts +2 -1
  553. package/dist/util/entity_pages.js.map +1 -1
  554. package/dist/util/find_entities_by_ids.d.ts +2 -2
  555. package/dist/util/find_entities_by_ids.js +1 -1
  556. package/dist/util/find_entities_by_ids.js.map +1 -1
  557. package/dist/util/format_collection_date.d.ts +1 -1
  558. package/dist/util/format_collection_date.js.map +1 -1
  559. package/dist/util/identity.d.ts +8 -0
  560. package/dist/util/identity.js +16 -0
  561. package/dist/util/identity.js.map +1 -0
  562. package/dist/util/navigation_utils.js +1 -1
  563. package/dist/util/navigation_utils.js.map +1 -1
  564. package/dist/util/previews.js +1 -1
  565. package/dist/util/previews.js.map +1 -1
  566. package/dist/util/propertyConfigMapper.d.ts +1 -1
  567. package/dist/util/propertyConfigMapper.js.map +1 -1
  568. package/dist/util/property_utils.d.ts +1 -3
  569. package/dist/util/property_utils.js +1 -1
  570. package/dist/util/property_utils.js.map +1 -1
  571. package/dist/util/relations.d.ts +18 -0
  572. package/dist/util/relations.js +32 -0
  573. package/dist/util/relations.js.map +1 -0
  574. package/package.json +12 -10
  575. package/recipes/README.md +4 -4
  576. package/recipes/my-preferences.tsx +34 -26
  577. package/recipes/site-settings.tsx +34 -27
  578. package/dist/collection_editor/collection_wire.d.ts +0 -13
  579. package/dist/collection_editor/collection_wire.js +0 -49
  580. package/dist/collection_editor/collection_wire.js.map +0 -1
  581. package/dist/collection_editor/useJsonCollectionsConfigController.d.ts +0 -37
  582. package/dist/collection_editor/useJsonCollectionsConfigController.js +0 -191
  583. package/dist/collection_editor/useJsonCollectionsConfigController.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CollectionViewActions.js","names":[],"sources":["../../../src/components/CollectionViewBinding/CollectionViewActions.tsx"],"sourcesContent":["\n\nimport React, { Suspense } from \"react\";\n\nimport { useTranslation, useSlot, resolveComponentRef } from \"@rebasepro/app\";\nimport { CollectionActionsProps, EntityTableController, EntitySelectionController, AdminCollection } from \"@rebasepro/cms-types\";\nimport { Button, IconButton, Tooltip, Popover, iconSize, lazyChunk } from \"@rebasepro/ui\";\nimport { ErrorBoundary, Link2Icon, MoreVerticalIcon, Trash2Icon, Unlink2Icon } from \"@rebasepro/ui\";\nimport { usePermissions } from \"@rebasepro/app\";\nimport { toArray } from \"@rebasepro/utils\";\n// Lazy-load import/export — pulls in exceljs only on demand\nconst ImportCollectionAction = lazyChunk(() => import(\"../../data_import/import\").then(m => ({ default: m.ImportCollectionAction })));\nconst ExportCollectionAction = lazyChunk(() => import(\"../../data_export/export\").then(m => ({ default: m.ExportCollectionAction })));\nimport { EditorCollectionAction } from \"../../collection_editor/ui/EditorCollectionAction\";\nimport { useCollectionEditorController } from \"../../collection_editor/useCollectionEditorController\";\nimport { useAdminContext } from \"../../hooks/useAdminContext\";\nimport { useToolbarLabels } from \"../CollectionTableBinding/internal/CollectionTableToolbar\";\nimport { CollectionAddButton } from \"./CollectionAddButton\";\nimport { selectionControllerOf, tableControllerOf } from \"@rebasepro/app\";\n\nexport type CollectionViewActionsProps<M extends Record<string, unknown>> = {\n collection: AdminCollection<M>;\n path: string;\n relativePath: string;\n parentCollectionSlugs: string[], parentEntityIds: string[];\n selectionEnabled: boolean;\n onNewClick: () => void;\n /**\n * Attach a row that already exists to this parent. Only supplied for a\n * junction-backed tab, where the parent owns the link rather than the row.\n */\n onAddExistingClick?: () => void;\n onMultipleDeleteClick: () => void;\n /**\n * The rows are shared with other records through a junction, so removing\n * them unlinks them from this record and deletes nothing. The bin says so.\n */\n removeUnlinks?: boolean;\n selectionController: EntitySelectionController<M>;\n tableController: EntityTableController<M>;\n collectionEntitiesCount?: number;\n compact?: boolean;\n children?: React.ReactNode;\n openNewDocument: (defaultValues?: Record<string, unknown>) => void;\n}\n\nexport function CollectionViewActions<M extends Record<string, unknown>>({\n collection,\n relativePath,\n parentCollectionSlugs, parentEntityIds,\n onNewClick,\n onAddExistingClick,\n onMultipleDeleteClick,\n removeUnlinks,\n selectionEnabled,\n path,\n selectionController,\n tableController,\n collectionEntitiesCount,\n compact,\n children,\n openNewDocument\n}: CollectionViewActionsProps<M>) {\n const context = useAdminContext();\n\n const { canDelete } = usePermissions();\n\n const toolbarLabels = useToolbarLabels();\n // Labelled controls where the toolbar has room for them — a wide view\n // and labels that fit; their icon-only forms otherwise.\n const labelled = !compact && toolbarLabels;\n const { t } = useTranslation();\n\n // Check if the collection editor context is available (ConfigControllerProvider present)\n const collectionEditorController = useCollectionEditorController();\n const hasCollectionEditor = Boolean(collectionEditorController?.editCollection);\n\n const { selectedCount, hasSelection } = selectionController;\n\n const addButton = onNewClick &&\n <CollectionAddButton collection={collection} path={path} onClick={onNewClick} compact={Boolean(compact)}/>;\n\n // On a junction-backed tab, creating a row is only half of what \"add\" means:\n // the far more common act is attaching one that already exists. There was no\n // way to do that at all — the junction row was only ever written alongside an\n // insert — so a shared vocabulary could only ever grow.\n const linkButton = onAddExistingClick && (labelled\n ? <Button\n id={`link_entity_${path}`}\n onClick={onAddExistingClick}\n startIcon={<Link2Icon size={iconSize.small}/>}\n size=\"small\"\n variant=\"outlined\"\n color=\"neutral\">\n {t(\"add_existing\")}\n </Button>\n : <Tooltip title={t(\"add_existing\")}>\n <Button\n id={`link_entity_${path}`}\n onClick={onAddExistingClick}\n variant=\"outlined\"\n color=\"neutral\"\n size=\"small\">\n <Link2Icon size={iconSize.small}/>\n </Button>\n </Tooltip>);\n\n const multipleDeleteEnabled = canDelete(collection, path, null);\n\n // Only once something is selected. A permanently-disabled bin sat in every\n // collection toolbar — and in the split view, where the toolbar is a narrow\n // strip above the list, it was a third of the visible controls doing\n // nothing. It appears the moment you tick a row, which is when you want it.\n\n // `undefined` is \"every matching row, and nobody knows how many\" — a full\n // selection against an accessor with no `count`. Rendering it as 0 would\n // say the opposite of what is true.\n const countLabel = selectedCount === undefined ? \"…\" : selectedCount.toLocaleString();\n\n let multipleDeleteButton: React.ReactNode | undefined;\n if (hasSelection) {\n const RemoveIcon = removeUnlinks ? Unlink2Icon : Trash2Icon;\n // What the button does, in both forms. The labelled one's only text is\n // the count, so without it a screen reader announced \"(1)\".\n const actionLabel = removeUnlinks ? t(\"remove_from_record\") : t(\"delete_selected\");\n const button = labelled\n // `min-w`, not `w`. A fixed 80px was enough for the one- and\n // two-digit counts you could reach by ticking rows; \"select all\n // matching\" put six digits in here, and a flex child over its width\n // compresses — so the bin itself was what gave way, shrinking to a\n // sliver beside the number. The width is a floor now, so the\n // control still holds its place in the toolbar when the count is\n // short, and `shrink-0` means the icon can never be the thing that\n // gives.\n ? <Button\n variant={\"text\"}\n aria-label={`${actionLabel} (${countLabel})`}\n disabled={!multipleDeleteEnabled}\n startIcon={<RemoveIcon size={iconSize.small} className={\"shrink-0\"}/>}\n onClick={onMultipleDeleteClick}\n color={\"neutral\"}\n className=\"@5xl/collection:min-w-20\"\n >\n ({countLabel})\n </Button>\n : <IconButton aria-label={actionLabel}\n size={\"small\"}\n disabled={!multipleDeleteEnabled}\n onClick={onMultipleDeleteClick}>\n <RemoveIcon size={iconSize.small}/>\n </IconButton>;\n multipleDeleteButton =\n <Tooltip\n title={multipleDeleteEnabled\n ? (removeUnlinks ? t(\"remove_from_record\") : t(\"delete\"))\n : t(\"delete_not_allowed\")}>\n {button}\n </Tooltip>\n }\n\n // The admin's own actions read the records; an app's are handed rows.\n const builtInActionProps = {\n path,\n relativePath,\n parentCollectionSlugs,\n parentEntityIds,\n collection,\n selectionController,\n context,\n tableController,\n collectionEntitiesCount,\n openNewDocument\n };\n const actionProps: CollectionActionsProps<M> = {\n ...builtInActionProps,\n selectionController: selectionControllerOf(selectionController, collection, path),\n tableController: tableControllerOf(tableController, collection)\n };\n\n const actions = toArray(collection.Actions)\n .map((actionRef, i) => {\n const Action = resolveComponentRef(actionRef);\n if (!Action) return null;\n return (\n <ErrorBoundary key={`actions_${i}`}>\n <Suspense fallback={null}>\n <Action {...actionProps}/>\n </Suspense>\n </ErrorBoundary>\n );\n });\n\n const pluginActions = useSlot(\"collection.actions\", actionProps as CollectionActionsProps);\n\n const secondaryActions = (\n <>\n {children}\n <ErrorBoundary>\n {actions}\n {pluginActions}\n </ErrorBoundary>\n <ErrorBoundary>\n <Suspense fallback={null}>\n <ImportCollectionAction {...(actionProps as CollectionActionsProps)}/>\n </Suspense>\n </ErrorBoundary>\n {collection.exportable !== false && (\n <ErrorBoundary>\n <Suspense fallback={null}>\n <ExportCollectionAction {...builtInActionProps}/>\n </Suspense>\n </ErrorBoundary>\n )}\n {hasCollectionEditor && (\n <ErrorBoundary>\n <EditorCollectionAction {...builtInActionProps}/>\n </ErrorBoundary>\n )}\n </>\n );\n\n const [overflowOpen, setOverflowOpen] = React.useState(false);\n\n return (\n <div className=\"flex items-center gap-1\">\n {!compact ? (\n secondaryActions\n ) : (\n <Popover\n open={overflowOpen}\n onOpenChange={setOverflowOpen}\n trigger={\n <IconButton aria-label={t(\"more_actions\")} size=\"small\">\n <MoreVerticalIcon size={iconSize.smallest}/>\n </IconButton>\n }>\n <div className=\"flex flex-row items-center gap-1 p-2\">\n {secondaryActions}\n </div>\n </Popover>\n )}\n {multipleDeleteButton}\n {linkButton}\n {addButton}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAWA,IAAM,yBAAyB,gBAAgB,OAAO,oCAA2B,CAAC,MAAK,OAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;AACpI,IAAM,yBAAyB,gBAAgB,OAAO,oCAA2B,CAAC,MAAK,OAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;AAkCpI,SAAgB,sBAAyD,EACrE,YACA,cACA,uBAAuB,iBACvB,YACA,oBACA,uBACA,eACA,kBACA,MACA,qBACA,iBACA,yBACA,SACA,UACA,mBAC8B;CAC9B,MAAM,UAAU,gBAAgB;CAEhC,MAAM,EAAE,cAAc,eAAe;CAErC,MAAM,gBAAgB,iBAAiB;CAGvC,MAAM,WAAW,CAAC,WAAW;CAC7B,MAAM,EAAE,MA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YAAD;KAAY,cAAY,EAAE,cAAc;KAAG,MAAK;eAC5C,oBAAC,kBAAD,EAAkB,MAAM,SAAS,SAAU,CAAA;IACnC,CAAA;cAEhB,oBAAC,OAAD;KAAK,WAAU;eACV;IACA,CAAA;GACA,CAAA;GAEZ;GACA;GACA;EACA;;AAEb"}
1
+ {"version":3,"file":"CollectionViewActions.js","names":[],"sources":["../../../src/components/CollectionViewBinding/CollectionViewActions.tsx"],"sourcesContent":["\n\nimport React, { Suspense } from \"react\";\n\nimport { useTranslation, useSlot } from \"@rebasepro/app\";\nimport { CollectionActionsProps, EntityTableController, EntitySelectionController, AdminCollection } from \"@rebasepro/cms-types\";\nimport { Button, IconButton, Tooltip, Popover, iconSize, lazyChunk } from \"@rebasepro/ui\";\nimport { ErrorBoundary, Link2Icon, MoreVerticalIcon, Trash2Icon, Unlink2Icon } from \"@rebasepro/ui\";\nimport { usePermissions } from \"@rebasepro/app\";\nimport { toArray } from \"@rebasepro/utils\";\n// Lazy-load import/export — pulls in exceljs only on demand\nconst ImportCollectionAction = lazyChunk(() => import(\"../../data_import/import\").then(m => ({ default: m.ImportCollectionAction })));\nconst ExportCollectionAction = lazyChunk(() => import(\"../../data_export/export\").then(m => ({ default: m.ExportCollectionAction })));\nimport { EditorCollectionAction } from \"../../collection_editor/ui/EditorCollectionAction\";\nimport { useCollectionEditorController } from \"../../collection_editor/useCollectionEditorController\";\nimport { useAdminContext } from \"../../hooks/useAdminContext\";\nimport { useToolbarLabels } from \"../CollectionTableBinding/internal/CollectionTableToolbar\";\nimport { CollectionAddButton } from \"./CollectionAddButton\";\nimport { selectionControllerOf, tableControllerOf } from \"@rebasepro/app\";\n\nexport type CollectionViewActionsProps<M extends Record<string, unknown>> = {\n collection: AdminCollection<M>;\n path: string;\n relativePath: string;\n parentCollectionSlugs: string[], parentEntityIds: string[];\n selectionEnabled: boolean;\n onNewClick: () => void;\n /**\n * Attach a row that already exists to this parent. Only supplied for a\n * junction-backed tab, where the parent owns the link rather than the row.\n */\n onAddExistingClick?: () => void;\n onMultipleDeleteClick: () => void;\n /**\n * The rows are shared with other records through a junction, so removing\n * them unlinks them from this record and deletes nothing. The bin says so.\n */\n removeUnlinks?: boolean;\n selectionController: EntitySelectionController<M>;\n tableController: EntityTableController<M>;\n collectionEntitiesCount?: number;\n compact?: boolean;\n children?: React.ReactNode;\n openNewDocument: (defaultValues?: Record<string, unknown>) => void;\n}\n\nexport function CollectionViewActions<M extends Record<string, unknown>>({\n collection,\n relativePath,\n parentCollectionSlugs, parentEntityIds,\n onNewClick,\n onAddExistingClick,\n onMultipleDeleteClick,\n removeUnlinks,\n selectionEnabled,\n path,\n selectionController,\n tableController,\n collectionEntitiesCount,\n compact,\n children,\n openNewDocument\n}: CollectionViewActionsProps<M>) {\n const context = useAdminContext();\n\n const { canDelete } = usePermissions();\n\n const toolbarLabels = useToolbarLabels();\n // Labelled controls where the toolbar has room for them — a wide view\n // and labels that fit; their icon-only forms otherwise.\n const labelled = !compact && toolbarLabels;\n const { t } = useTranslation();\n\n // Check if the collection editor context is available (ConfigControllerProvider present)\n const collectionEditorController = useCollectionEditorController();\n const hasCollectionEditor = Boolean(collectionEditorController?.editCollection);\n\n const { selectedCount, hasSelection } = selectionController;\n\n const addButton = onNewClick &&\n <CollectionAddButton collection={collection} path={path} onClick={onNewClick} compact={Boolean(compact)}/>;\n\n // On a junction-backed tab, creating a row is only half of what \"add\" means:\n // the far more common act is attaching one that already exists. There was no\n // way to do that at all — the junction row was only ever written alongside an\n // insert — so a shared vocabulary could only ever grow.\n const linkButton = onAddExistingClick && (labelled\n ? <Button\n id={`link_entity_${path}`}\n onClick={onAddExistingClick}\n startIcon={<Link2Icon size={iconSize.small}/>}\n size=\"small\"\n variant=\"outlined\"\n color=\"neutral\">\n {t(\"add_existing\")}\n </Button>\n : <Tooltip title={t(\"add_existing\")}>\n <Button\n id={`link_entity_${path}`}\n onClick={onAddExistingClick}\n variant=\"outlined\"\n color=\"neutral\"\n size=\"small\">\n <Link2Icon size={iconSize.small}/>\n </Button>\n </Tooltip>);\n\n const multipleDeleteEnabled = canDelete(collection, path, null);\n\n // Only once something is selected. A permanently-disabled bin sat in every\n // collection toolbar — and in the split view, where the toolbar is a narrow\n // strip above the list, it was a third of the visible controls doing\n // nothing. It appears the moment you tick a row, which is when you want it.\n\n // `undefined` is \"every matching row, and nobody knows how many\" — a full\n // selection against an accessor with no `count`. Rendering it as 0 would\n // say the opposite of what is true.\n const countLabel = selectedCount === undefined ? \"…\" : selectedCount.toLocaleString();\n\n let multipleDeleteButton: React.ReactNode | undefined;\n if (hasSelection) {\n const RemoveIcon = removeUnlinks ? Unlink2Icon : Trash2Icon;\n // What the button does, in both forms. The labelled one's only text is\n // the count, so without it a screen reader announced \"(1)\".\n const actionLabel = removeUnlinks ? t(\"remove_from_record\") : t(\"delete_selected\");\n const button = labelled\n // `min-w`, not `w`. A fixed 80px was enough for the one- and\n // two-digit counts you could reach by ticking rows; \"select all\n // matching\" put six digits in here, and a flex child over its width\n // compresses — so the bin itself was what gave way, shrinking to a\n // sliver beside the number. The width is a floor now, so the\n // control still holds its place in the toolbar when the count is\n // short, and `shrink-0` means the icon can never be the thing that\n // gives.\n ? <Button\n variant={\"text\"}\n aria-label={`${actionLabel} (${countLabel})`}\n disabled={!multipleDeleteEnabled}\n startIcon={<RemoveIcon size={iconSize.small} className={\"shrink-0\"}/>}\n onClick={onMultipleDeleteClick}\n color={\"neutral\"}\n className=\"@5xl/collection:min-w-20\"\n >\n ({countLabel})\n </Button>\n : <IconButton aria-label={actionLabel}\n size={\"small\"}\n disabled={!multipleDeleteEnabled}\n onClick={onMultipleDeleteClick}>\n <RemoveIcon size={iconSize.small}/>\n </IconButton>;\n multipleDeleteButton =\n <Tooltip\n title={multipleDeleteEnabled\n ? (removeUnlinks ? t(\"remove_from_record\") : t(\"delete\"))\n : t(\"delete_not_allowed\")}>\n {button}\n </Tooltip>\n }\n\n // The admin's own actions read the records; an app's are handed rows.\n const builtInActionProps = {\n path,\n relativePath,\n parentCollectionSlugs,\n parentEntityIds,\n collection,\n selectionController,\n context,\n tableController,\n collectionEntitiesCount,\n openNewDocument\n };\n const actionProps: CollectionActionsProps<M> = {\n ...builtInActionProps,\n selectionController: selectionControllerOf(selectionController, collection, path),\n tableController: tableControllerOf(tableController, collection)\n };\n\n const actions = toArray(collection.Actions)\n .map((Action, i) => {\n return (\n <ErrorBoundary key={`actions_${i}`}>\n <Suspense fallback={null}>\n <Action {...actionProps}/>\n </Suspense>\n </ErrorBoundary>\n );\n });\n\n const pluginActions = useSlot(\"collection.actions\", actionProps as CollectionActionsProps);\n\n const secondaryActions = (\n <>\n {children}\n <ErrorBoundary>\n {actions}\n {pluginActions}\n </ErrorBoundary>\n <ErrorBoundary>\n <Suspense fallback={null}>\n <ImportCollectionAction {...(actionProps as CollectionActionsProps)}/>\n </Suspense>\n </ErrorBoundary>\n {collection.exportable !== false && (\n <ErrorBoundary>\n <Suspense fallback={null}>\n <ExportCollectionAction {...builtInActionProps}/>\n </Suspense>\n </ErrorBoundary>\n )}\n {hasCollectionEditor && (\n <ErrorBoundary>\n <EditorCollectionAction {...builtInActionProps}/>\n </ErrorBoundary>\n )}\n </>\n );\n\n const [overflowOpen, setOverflowOpen] = React.useState(false);\n\n return (\n <div className=\"flex items-center gap-1\">\n {!compact ? (\n secondaryActions\n ) : (\n <Popover\n open={overflowOpen}\n onOpenChange={setOverflowOpen}\n trigger={\n <IconButton aria-label={t(\"more_actions\")} size=\"small\">\n <MoreVerticalIcon size={iconSize.smallest}/>\n </IconButton>\n }>\n <div className=\"flex flex-row items-center gap-1 p-2\">\n {secondaryActions}\n </div>\n </Popover>\n )}\n {multipleDeleteButton}\n {linkButton}\n {addButton}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAWA,IAAM,yBAAyB,gBAAgB,OAAO,oCAA2B,CAAC,MAAK,OAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;AACpI,IAAM,yBAAyB,gBAAgB,OAAO,oCA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AC,eAAD,EAAA,UACI,oBAAC,wBAAD,EAAwB,GAAI,mBAAoB,CAAA,EACrC,CAAA;CAErB,EAAA,CAAA;CAGN,MAAM,CAAC,cAAc,mBAAmB,MAAM,SAAS,KAAK;CAE5D,OACI,qBAAC,OAAD;EAAK,WAAU;YAAf;GACK,CAAC,UACE,mBAEA,oBAAC,SAAD;IACI,MAAM;IACN,cAAc;IACd,SACI,oBAAC,YAAD;KAAY,cAAY,EAAE,cAAc;KAAG,MAAK;eAC5C,oBAAC,kBAAD,EAAkB,MAAM,SAAS,SAAU,CAAA;IACnC,CAAA;cAEhB,oBAAC,OAAD;KAAK,WAAU;eACV;IACA,CAAA;GACA,CAAA;GAEZ;GACA;GACA;EACA;;AAEb"}
@@ -8,7 +8,7 @@ export type CollectionViewBindingProps<M extends Record<string, unknown>> = {
8
8
  /**
9
9
  * The path the collection is addressed by: its slug, or for a
10
10
  * subcollection `parentSlug/{id}/slug`. Defaults to the collection's slug.
11
- * Not the `path` a Firestore or MongoDB collection declares for its store:
11
+ * Not the `path` a Firestore collection declares for its store:
12
12
  * the data layer translates to that one, and another collection's slug may
13
13
  * be spelled the same.
14
14
  */
@@ -67,11 +67,11 @@ export type CollectionViewBindingProps<M extends Record<string, unknown>> = {
67
67
  * image, subtitle, status, date, relation chips, the list's columns — are
68
68
  * filled from, earlier ones first; a place none of them fills stays empty.
69
69
  *
70
- * Over `propertiesOrder`, the order the user saved, `listProperties` and
71
- * what the cards infer, for this view only. Column widths the user drags
72
- * still persist; the column order is the caller's, so columns are not
73
- * dragged. A property hidden from collections stays hidden, and a custom
74
- * view is handed the whole collection.
70
+ * Over the table's `fieldOrder` and `listFields` (`customizeTable`), the
71
+ * order the user saved, and what the cards infer, for this view only.
72
+ * Column widths the user drags still persist; the column order is the
73
+ * caller's, so columns are not dragged. A field customized `hidden` stays
74
+ * hidden, and a custom view is handed the whole collection.
75
75
  */
76
76
  fields?: string[];
77
77
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CollectionViewBinding.js","names":[],"sources":["../../../src/components/CollectionViewBinding/CollectionViewBinding.tsx"],"sourcesContent":["import type { AdminCollection, ViewMode } from \"@rebasepro/cms-types\";\nimport React, { useCallback, useRef } from \"react\";\n\nimport { deepEqual as equal } from \"fast-equals\"\nimport { CollectionScopeProvider } from \"@rebasepro/app\";\nimport { Alert, cls } from \"@rebasepro/ui\";\nimport { SplitListView } from \"./SplitListView\";\nimport { useCollectionRegistryController } from \"../../hooks/navigation/contexts/CollectionRegistryContext\";\nimport { useCollectionViewState } from \"./useCollectionViewState\";\nimport { CollectionViewScopeContext } from \"./CollectionViewScope\";\nimport { CollectionToolbarSlot, CollectionToolbarSlotContext, DEFAULT_TOOLBAR } from \"./CollectionToolbar\";\nimport { CollectionViewContent } from \"./CollectionViewContent\";\nimport { CollectionViewDialogs } from \"./CollectionViewDialogs\";\nimport { CollectionViewFrame } from \"./CollectionViewFrame\";\nimport { EntitiesCount } from \"./EntitiesCount\";\n\nexport { EntitiesCount } from \"./EntitiesCount\";\n\n/**\n * @group Components\n */\nexport type CollectionViewBindingProps<M extends Record<string, unknown>> = {\n /**\n * The path the collection is addressed by: its slug, or for a\n * subcollection `parentSlug/{id}/slug`. Defaults to the collection's slug.\n * Not the `path` a Firestore or MongoDB collection declares for its store:\n * the data layer translates to that one, and another collection's slug may\n * be spelled the same.\n */\n path?: string;\n /**\n * Full path using navigation ids.\n */\n idPath?: string;\n /**\n * If this is a subcollection, specify the parent collection ids.\n */\n parentCollectionSlugs?: string[], parentEntityIds?: string[];\n /**\n * Whether this is a subcollection or not.\n */\n isSubCollection?: boolean;\n\n className?: string;\n\n /**\n * If true, this view will store its filter and sorting status in the url params\n */\n updateUrl?: boolean;\n\n /**\n * When provided, the split view will render this entity's detail panel.\n * Used by the router to pass the entity ID from the URL path.\n */\n selectedEntityId?: string | number;\n\n /**\n * When provided, the split view will open this tab (e.g. a subcollection slug)\n * in the entity detail panel. Used by the router to pass the subcollection from the URL.\n */\n selectedTab?: string;\n\n /**\n * What this view changes about the collection it draws — a fixed filter,\n * a default view mode, a sort — applied over the registered collection.\n *\n * The collection's own props are not that: where the path is registered\n * the view draws the registry's copy, which carries the user's saved\n * overrides and the plugins' changes, and the props are only its fallback.\n * `CollectionPanel`'s `viewMode`, `sort`, `limit` and `collectionOverrides`\n * arrive here; spread onto the props, they were dropped for every\n * registered collection.\n */\n collectionOverrides?: Partial<AdminCollection<M>>;\n\n /**\n * The ids of the rows drawn as selected, where the caller decides which\n * they are — a page that shows the opened row beside the list. `[]`\n * draws none. Without it the view highlights the row last opened, by\n * itself.\n */\n highlightedIds?: (string | number)[];\n\n /**\n * The properties this view shows, in this order; the ones it leaves out\n * are not drawn. In the table they are the columns. In the list, on a card\n * and on a kanban card they are what the row's or card's places — title,\n * image, subtitle, status, date, relation chips, the list's columns — are\n * filled from, earlier ones first; a place none of them fills stays empty.\n *\n * Over `propertiesOrder`, the order the user saved, `listProperties` and\n * what the cards infer, for this view only. Column widths the user drags\n * still persist; the column order is the caller's, so columns are not\n * dragged. A property hidden from collections stays hidden, and a custom\n * view is handed the whole collection.\n */\n fields?: string[];\n\n /**\n * The mode this view opens in, over the one in the URL and the one the\n * person last picked. They can still switch.\n */\n viewMode?: ViewMode;\n\n /**\n * The title the list view draws above its rows; `false` draws none.\n * Defaults to the collection's name.\n */\n title?: string | false;\n\n /**\n * The toolbar drawn above the rows. Defaults to the full toolbar —\n * `<CollectionToolbar/>`; `null` draws none. Compose a smaller one from\n * its pieces: `CollectionSearchBar`, `CollectionFiltersButton`,\n * `CollectionViewModeToggle`, `CollectionAddButton`.\n */\n toolbar?: React.ReactNode;\n\n /**\n * Called with the row and its id when one is clicked, instead of the\n * view opening it. Without it the record opens as the collection's\n * `openEntityMode` says. The row is the server's, as `useRows` returns\n * it; the id is the string `highlightedIds` and `useSidePanel().open`\n * take.\n */\n onRowClick?: (row: Record<string, unknown>, id: string) => void;\n\n} & AdminCollection<M>;\n\n/**\n * Props a caller commonly rebuilds on every render — a parent path array, a\n * properties object, an `Actions` list made with `toArray` — compared by value,\n * so a re-render that builds the same ones again does not redraw the view.\n */\nconst PROPS_COMPARED_BY_VALUE = new Set<string>([\n \"path\", \"parentCollectionSlugs\", \"parentEntityIds\", \"isSubCollection\", \"className\",\n \"properties\", \"propertiesOrder\", \"hideIdFromCollection\", \"inlineEditing\", \"selectionEnabled\",\n \"selectionController\", \"Actions\", \"defaultSize\", \"includeJsonView\", \"additionalFields\",\n \"sideDialogWidth\", \"openEntityMode\", \"exportable\", \"history\", \"fixedFilter\",\n \"selectedEntityId\", \"selectedTab\", \"collectionOverrides\", \"highlightedIds\", \"fields\"\n]);\n\n/**\n * Whether the view would draw the same thing with these props.\n *\n * Every prop counts: the listed ones by value, every other one — the name, the\n * entity actions, the custom views, the callbacks, anything a collection\n * carries — by reference. It used to compare the listed ones only, so a\n * collection passed as props (one not in the registry, where the view reads it\n * from) that changed anything else was never redrawn. A caller spreading a\n * registry collection hands over the same references each render.\n */\nfunction collectionViewPropsEqual(a: CollectionViewBindingProps<any>, b: CollectionViewBindingProps<any>): boolean {\n const previous = a as Record<string, unknown>;\n const next = b as Record<string, unknown>;\n const keys = new Set([...Object.keys(previous), ...Object.keys(next)]);\n for (const key of keys) {\n if (previous[key] === next[key]) continue;\n if (PROPS_COMPARED_BY_VALUE.has(key) && equal(previous[key], next[key])) continue;\n return false;\n }\n return true;\n}\n\n/**\n * This component is in charge of binding a driver path with an {@link AdminCollection}\n * where it's configuration is defined. It includes an infinite scrolling table\n * and a 'Add' new entities button,\n *\n * This component is the default one used for displaying entity collections\n * and is in charge of generating all the specific actions and customization\n * of the lower level {@link CollectionTableBinding}\n *\n * Please **note** that you only need to use this component if you are building\n * a custom view. If you just need to create a default view you can do it\n * exclusively with config options.\n *\n * If you need a lower level implementation with more granular options, you\n * can use {@link CollectionTableBinding}.\n *\n * If you need a generic table that is not bound to the driver or entities and\n * properties at all, you can check {@link VirtualTable}\n *\n * @param path\n * @param collection\n\n * @group Components\n */\nconst CollectionViewBindingInner = React.memo(\n function CollectionViewBindingInner(props: CollectionViewBindingProps<Record<string, unknown>>) {\n\n const state = useCollectionViewState(props);\n const {\n t,\n containerRef,\n path,\n parentCollectionSlugs,\n parentEntityIds,\n selectedEntityId,\n selectedTab,\n collection,\n tableController,\n lastDeleteTimestamp,\n setDocsCount,\n pluginErrorView,\n isSplitLayout,\n viewMode,\n onEntityClick,\n onNewClick,\n usedSelectionController,\n selectionEnabled,\n highlightedEntities,\n listSize,\n emptyComponent\n } = state;\n\n const toolbarNode = <CollectionToolbarSlot/>;\n const collectionSurface = <CollectionViewContent state={state}/>;\n\n return (\n <CollectionViewScopeContext.Provider value={state}>\n <CollectionViewFrame className={props.className} containerRef={containerRef}>\n\n {/* Fetches the count and reports it — the toolbar renders it. */}\n <EntitiesCount\n path={path}\n collection={collection}\n filter={tableController.filterValues}\n sortBy={tableController.sortBy}\n searchString={tableController.searchString}\n onCountChange={setDocsCount}\n refreshKey={lastDeleteTimestamp}\n />\n\n {/* A plugin's error view takes priority over the built-in\n banner, the same precedence the empty state uses. This was\n computed above and then rendered nowhere, so `collection.error`\n — a declared, documented slot with its own props interface —\n did nothing at all, and a plugin author had no way to tell. */}\n {pluginErrorView ?? (tableController.dataLoadingError && tableController.data.length > 0 && (\n <div className=\"px-4 pt-2 flex-shrink-0\">\n <Alert color=\"error\" size=\"small\">\n <strong>{t(\"error_loading_data\")}</strong>\n {tableController.dataLoadingError.message ? <>: {tableController.dataLoadingError.message}</> : null}\n </Alert>\n </div>\n ))}\n\n {/* When isSplitLayout, SplitListView is ALWAYS mounted — regardless\n of viewMode. The toolbar + current view live in the left panel;\n the right panel (entity detail) shows/hides based on selection.\n This keeps the toolbar's React tree position stable across view\n mode switches, preventing the ViewModeToggle popover from flashing. */}\n {isSplitLayout ? (\n <SplitListView\n key={`split-list-view-${path}`}\n collection={collection}\n tableController={tableController}\n onEntityClick={onEntityClick}\n onNewClick={onNewClick}\n selectionController={usedSelectionController}\n selectionEnabled={selectionEnabled}\n highlightedEntities={highlightedEntities}\n onScroll={tableController.onScroll}\n initialScroll={tableController.initialScroll}\n size={listSize}\n emptyComponent={emptyComponent}\n path={path}\n parentCollectionSlugs={parentCollectionSlugs} parentEntityIds={parentEntityIds}\n selectedEntityId={selectedEntityId}\n selectedTab={selectedTab}\n toolbar={toolbarNode}\n >\n {/* The left panel keeps rendering whichever view mode is\n active. Swapping it to a list on selection would make\n a board or card grid vanish on every click. */}\n {collectionSurface}\n </SplitListView>\n ) : (\n <div className=\"flex flex-col w-full h-full min-h-0\">\n {toolbarNode}\n {/* `min-h-0` is what lets the board scroll its columns.\n A flex item defaults to `min-height: auto`, so this\n one grew to the board's full content height — 1230px\n in a 883px area — and the ancestor's `overflow-hidden`\n simply cut the rest off, with each column's own\n scroller never reaching its limit. */}\n {/* `max-h-dvh` for a view whose parent gives it no\n height: it draws its rows, up to the window's\n height, and scrolls inside that — rather than\n growing with every page it loads. */}\n <div className={cls(\n \"flex-1 min-h-0 max-h-dvh flex flex-col\",\n (viewMode === \"list\" || viewMode === \"cards\") && \"overflow-y-auto\"\n )}>\n {collectionSurface}\n </div>\n </div>\n )}\n\n <CollectionViewDialogs state={state}/>\n\n </CollectionViewFrame>\n </CollectionViewScopeContext.Provider>\n );\n }, collectionViewPropsEqual) as React.FunctionComponent<CollectionViewBindingProps<any>>;\n\nexport const CollectionViewBinding = React.memo(\n function CollectionViewBinding<M extends Record<string, unknown>>({\n toolbar,\n onRowClick,\n ...props\n }: CollectionViewBindingProps<M>) {\n const collectionRegistry = useCollectionRegistryController();\n const path = props.path ?? props.slug;\n const collection = collectionRegistry.getCollection(path) ?? props;\n\n // Both are commonly written inline, a new value on every render of\n // the caller. Neither reaches the memoised view as a prop: the\n // handler is called through a ref, and the toolbar is read from\n // context by the one element that draws it, so a caller's re-render\n // redraws the toolbar and nothing else.\n const onRowClickRef = useRef(onRowClick);\n onRowClickRef.current = onRowClick;\n const callRowClick = useCallback((row: Record<string, unknown>, id: string) => onRowClickRef.current?.(row, id), []);\n\n const content = (\n <CollectionToolbarSlotContext.Provider value={toolbar === undefined ? DEFAULT_TOOLBAR : toolbar}>\n <CollectionViewBindingInner {...props} onRowClick={onRowClick ? callRowClick : undefined}/>\n </CollectionToolbarSlotContext.Provider>\n );\n\n if (collection) {\n return (\n <CollectionScopeProvider collection={collection as AdminCollection}>\n {content}\n </CollectionScopeProvider>\n );\n }\n return content;\n }\n) as React.FunctionComponent<CollectionViewBindingProps<any>>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsIA,IAAM,0CAA0B,IAAI,IAAY;CAC5C;CAAQ;CAAyB;CAAmB;CAAmB;CACvE;CAAc;CAAmB;CAAwB;CAAiB;CAC1E;CAAuB;CAAW;CAAe;CAAmB;CACpE;CAAmB;CAAkB;CAAc;CAAW;CAC9D;CAAoB;CAAe;CAAuB;CAAkB;AAChF,CAAC;;;;;;;;;;;AAYD,SAAS,yBAAyB,GAAoC,GAA6C;CAC/G,MAAM,WAAW;CACjB,MAAM,OAAO;CACb,MAAM,uBAAO,IAAI,IAAI,CAAC,GAAG,OAAO,KAAK,QAAQ,GAAG,GAAG,OAAO,KAAK,IAAI,CAAC,CAAC;CACrE,KAAK,MAAM,OAAO,MAAM;EACpB,IAAI,SAAS,SAAS,KAAK,MAAM;EACjC,IAAI,wBAAwB,IAAI,GAAG,KAAK,UAAM,SAAS,MAAM,KAAK,IAAI,GAAG;EACzE,OAAO;CACX;CACA,OAAO;AACX;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAM,6BAA6B,MAAM,KACrC,SAAS,2BAA2B,OAA4D;CAE5F,MAAM,QAAQ,uBAAuB,KAAK;CAC1C,MAAM,EACF,GACA,cACA,MACA,uBACA,iBACA,kBACA,aACA,YACA,iBACA,qBACA,cACA,iBACA,eACA,UACA,eACA,YACA,yBACA,kBACA,qBACA,UACA,mBACA;CAEJ,MAAM,cAAc,oBAAC,uBAAD,CAAuB,CAAA;CAC3C,MAAM,oBAAoB,oBAAC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vC,cAAc,UAAU;CACxB,MAAM,eAAe,aAAa,KAA8B,OAAe,cAAc,UAAU,KAAK,EAAE,GAAG,CAAC,CAAC;CAEnH,MAAM,UACF,oBAAC,6BAA6B,UAA9B;EAAuC,OAAO,YAAY,KAAA,IAAY,kBAAkB;YACpF,oBAAC,4BAAD;GAA4B,GAAI;GAAO,YAAY,aAAa,eAAe,KAAA;EAAW,CAAA;CACvD,CAAA;CAG3C,IAAI,YACA,OACI,oBAAC,yBAAD;EAAqC;YAChC;CACoB,CAAA;CAGjC,OAAO;AACX,CACJ"}
1
+ {"version":3,"file":"CollectionViewBinding.js","names":[],"sources":["../../../src/components/CollectionViewBinding/CollectionViewBinding.tsx"],"sourcesContent":["import type { AdminCollection, ViewMode } from \"@rebasepro/cms-types\";\nimport React, { useCallback, useRef } from \"react\";\n\nimport { deepEqual as equal } from \"fast-equals\"\nimport { CollectionScopeProvider } from \"@rebasepro/app\";\nimport { Alert, cls } from \"@rebasepro/ui\";\nimport { SplitListView } from \"./SplitListView\";\nimport { useCollectionRegistryController } from \"../../hooks/navigation/contexts/CollectionRegistryContext\";\nimport { useCollectionViewState } from \"./useCollectionViewState\";\nimport { CollectionViewScopeContext } from \"./CollectionViewScope\";\nimport { CollectionToolbarSlot, CollectionToolbarSlotContext, DEFAULT_TOOLBAR } from \"./CollectionToolbar\";\nimport { CollectionViewContent } from \"./CollectionViewContent\";\nimport { CollectionViewDialogs } from \"./CollectionViewDialogs\";\nimport { CollectionViewFrame } from \"./CollectionViewFrame\";\nimport { EntitiesCount } from \"./EntitiesCount\";\n\nexport { EntitiesCount } from \"./EntitiesCount\";\n\n/**\n * @group Components\n */\nexport type CollectionViewBindingProps<M extends Record<string, unknown>> = {\n /**\n * The path the collection is addressed by: its slug, or for a\n * subcollection `parentSlug/{id}/slug`. Defaults to the collection's slug.\n * Not the `path` a Firestore collection declares for its store:\n * the data layer translates to that one, and another collection's slug may\n * be spelled the same.\n */\n path?: string;\n /**\n * Full path using navigation ids.\n */\n idPath?: string;\n /**\n * If this is a subcollection, specify the parent collection ids.\n */\n parentCollectionSlugs?: string[], parentEntityIds?: string[];\n /**\n * Whether this is a subcollection or not.\n */\n isSubCollection?: boolean;\n\n className?: string;\n\n /**\n * If true, this view will store its filter and sorting status in the url params\n */\n updateUrl?: boolean;\n\n /**\n * When provided, the split view will render this entity's detail panel.\n * Used by the router to pass the entity ID from the URL path.\n */\n selectedEntityId?: string | number;\n\n /**\n * When provided, the split view will open this tab (e.g. a subcollection slug)\n * in the entity detail panel. Used by the router to pass the subcollection from the URL.\n */\n selectedTab?: string;\n\n /**\n * What this view changes about the collection it draws — a fixed filter,\n * a default view mode, a sort — applied over the registered collection.\n *\n * The collection's own props are not that: where the path is registered\n * the view draws the registry's copy, which carries the user's saved\n * overrides and the plugins' changes, and the props are only its fallback.\n * `CollectionPanel`'s `viewMode`, `sort`, `limit` and `collectionOverrides`\n * arrive here; spread onto the props, they were dropped for every\n * registered collection.\n */\n collectionOverrides?: Partial<AdminCollection<M>>;\n\n /**\n * The ids of the rows drawn as selected, where the caller decides which\n * they are — a page that shows the opened row beside the list. `[]`\n * draws none. Without it the view highlights the row last opened, by\n * itself.\n */\n highlightedIds?: (string | number)[];\n\n /**\n * The properties this view shows, in this order; the ones it leaves out\n * are not drawn. In the table they are the columns. In the list, on a card\n * and on a kanban card they are what the row's or card's places — title,\n * image, subtitle, status, date, relation chips, the list's columns — are\n * filled from, earlier ones first; a place none of them fills stays empty.\n *\n * Over the table's `fieldOrder` and `listFields` (`customizeTable`), the\n * order the user saved, and what the cards infer, for this view only.\n * Column widths the user drags still persist; the column order is the\n * caller's, so columns are not dragged. A field customized `hidden` stays\n * hidden, and a custom view is handed the whole collection.\n */\n fields?: string[];\n\n /**\n * The mode this view opens in, over the one in the URL and the one the\n * person last picked. They can still switch.\n */\n viewMode?: ViewMode;\n\n /**\n * The title the list view draws above its rows; `false` draws none.\n * Defaults to the collection's name.\n */\n title?: string | false;\n\n /**\n * The toolbar drawn above the rows. Defaults to the full toolbar —\n * `<CollectionToolbar/>`; `null` draws none. Compose a smaller one from\n * its pieces: `CollectionSearchBar`, `CollectionFiltersButton`,\n * `CollectionViewModeToggle`, `CollectionAddButton`.\n */\n toolbar?: React.ReactNode;\n\n /**\n * Called with the row and its id when one is clicked, instead of the\n * view opening it. Without it the record opens as the collection's\n * `openEntityMode` says. The row is the server's, as `useRows` returns\n * it; the id is the string `highlightedIds` and `useSidePanel().open`\n * take.\n */\n onRowClick?: (row: Record<string, unknown>, id: string) => void;\n\n} & AdminCollection<M>;\n\n/**\n * Props a caller commonly rebuilds on every render — a parent path array, a\n * properties object, an `Actions` list made with `toArray` — compared by value,\n * so a re-render that builds the same ones again does not redraw the view.\n */\nconst PROPS_COMPARED_BY_VALUE = new Set<string>([\n \"path\", \"parentCollectionSlugs\", \"parentEntityIds\", \"isSubCollection\", \"className\",\n \"properties\", \"propertiesOrder\", \"hideIdFromCollection\", \"inlineEditing\", \"selectionEnabled\",\n \"selectionController\", \"Actions\", \"defaultSize\", \"includeJsonView\", \"additionalFields\",\n \"sideDialogWidth\", \"openEntityMode\", \"exportable\", \"history\", \"fixedFilter\",\n \"selectedEntityId\", \"selectedTab\", \"collectionOverrides\", \"highlightedIds\", \"fields\"\n]);\n\n/**\n * Whether the view would draw the same thing with these props.\n *\n * Every prop counts: the listed ones by value, every other one — the name, the\n * entity actions, the custom views, the callbacks, anything a collection\n * carries — by reference. It used to compare the listed ones only, so a\n * collection passed as props (one not in the registry, where the view reads it\n * from) that changed anything else was never redrawn. A caller spreading a\n * registry collection hands over the same references each render.\n */\nfunction collectionViewPropsEqual(a: CollectionViewBindingProps<any>, b: CollectionViewBindingProps<any>): boolean {\n const previous = a as Record<string, unknown>;\n const next = b as Record<string, unknown>;\n const keys = new Set([...Object.keys(previous), ...Object.keys(next)]);\n for (const key of keys) {\n if (previous[key] === next[key]) continue;\n if (PROPS_COMPARED_BY_VALUE.has(key) && equal(previous[key], next[key])) continue;\n return false;\n }\n return true;\n}\n\n/**\n * This component is in charge of binding a driver path with an {@link AdminCollection}\n * where it's configuration is defined. It includes an infinite scrolling table\n * and a 'Add' new entities button,\n *\n * This component is the default one used for displaying entity collections\n * and is in charge of generating all the specific actions and customization\n * of the lower level {@link CollectionTableBinding}\n *\n * Please **note** that you only need to use this component if you are building\n * a custom view. If you just need to create a default view you can do it\n * exclusively with config options.\n *\n * If you need a lower level implementation with more granular options, you\n * can use {@link CollectionTableBinding}.\n *\n * If you need a generic table that is not bound to the driver or entities and\n * properties at all, you can check {@link VirtualTable}\n *\n * @param path\n * @param collection\n\n * @group Components\n */\nconst CollectionViewBindingInner = React.memo(\n function CollectionViewBindingInner(props: CollectionViewBindingProps<Record<string, unknown>>) {\n\n const state = useCollectionViewState(props);\n const {\n t,\n containerRef,\n path,\n parentCollectionSlugs,\n parentEntityIds,\n selectedEntityId,\n selectedTab,\n collection,\n tableController,\n lastDeleteTimestamp,\n setDocsCount,\n pluginErrorView,\n isSplitLayout,\n viewMode,\n onEntityClick,\n onNewClick,\n usedSelectionController,\n selectionEnabled,\n highlightedEntities,\n listSize,\n emptyComponent\n } = state;\n\n const toolbarNode = <CollectionToolbarSlot/>;\n const collectionSurface = <CollectionViewContent state={state}/>;\n\n return (\n <CollectionViewScopeContext.Provider value={state}>\n <CollectionViewFrame className={props.className} containerRef={containerRef}>\n\n {/* Fetches the count and reports it — the toolbar renders it. */}\n <EntitiesCount\n path={path}\n collection={collection}\n filter={tableController.filterValues}\n sortBy={tableController.sortBy}\n searchString={tableController.searchString}\n onCountChange={setDocsCount}\n refreshKey={lastDeleteTimestamp}\n />\n\n {/* A plugin's error view takes priority over the built-in\n banner, the same precedence the empty state uses. This was\n computed above and then rendered nowhere, so `collection.error`\n — a declared, documented slot with its own props interface —\n did nothing at all, and a plugin author had no way to tell. */}\n {pluginErrorView ?? (tableController.dataLoadingError && tableController.data.length > 0 && (\n <div className=\"px-4 pt-2 flex-shrink-0\">\n <Alert color=\"error\" size=\"small\">\n <strong>{t(\"error_loading_data\")}</strong>\n {tableController.dataLoadingError.message ? <>: {tableController.dataLoadingError.message}</> : null}\n </Alert>\n </div>\n ))}\n\n {/* When isSplitLayout, SplitListView is ALWAYS mounted — regardless\n of viewMode. The toolbar + current view live in the left panel;\n the right panel (entity detail) shows/hides based on selection.\n This keeps the toolbar's React tree position stable across view\n mode switches, preventing the ViewModeToggle popover from flashing. */}\n {isSplitLayout ? (\n <SplitListView\n key={`split-list-view-${path}`}\n collection={collection}\n tableController={tableController}\n onEntityClick={onEntityClick}\n onNewClick={onNewClick}\n selectionController={usedSelectionController}\n selectionEnabled={selectionEnabled}\n highlightedEntities={highlightedEntities}\n onScroll={tableController.onScroll}\n initialScroll={tableController.initialScroll}\n size={listSize}\n emptyComponent={emptyComponent}\n path={path}\n parentCollectionSlugs={parentCollectionSlugs} parentEntityIds={parentEntityIds}\n selectedEntityId={selectedEntityId}\n selectedTab={selectedTab}\n toolbar={toolbarNode}\n >\n {/* The left panel keeps rendering whichever view mode is\n active. Swapping it to a list on selection would make\n a board or card grid vanish on every click. */}\n {collectionSurface}\n </SplitListView>\n ) : (\n <div className=\"flex flex-col w-full h-full min-h-0\">\n {toolbarNode}\n {/* `min-h-0` is what lets the board scroll its columns.\n A flex item defaults to `min-height: auto`, so this\n one grew to the board's full content height — 1230px\n in a 883px area — and the ancestor's `overflow-hidden`\n simply cut the rest off, with each column's own\n scroller never reaching its limit. */}\n {/* `max-h-dvh` for a view whose parent gives it no\n height: it draws its rows, up to the window's\n height, and scrolls inside that — rather than\n growing with every page it loads. */}\n <div className={cls(\n \"flex-1 min-h-0 max-h-dvh flex flex-col\",\n (viewMode === \"list\" || viewMode === \"cards\") && \"overflow-y-auto\"\n )}>\n {collectionSurface}\n </div>\n </div>\n )}\n\n <CollectionViewDialogs state={state}/>\n\n </CollectionViewFrame>\n </CollectionViewScopeContext.Provider>\n );\n }, collectionViewPropsEqual) as React.FunctionComponent<CollectionViewBindingProps<any>>;\n\nexport const CollectionViewBinding = React.memo(\n function CollectionViewBinding<M extends Record<string, unknown>>({\n toolbar,\n onRowClick,\n ...props\n }: CollectionViewBindingProps<M>) {\n const collectionRegistry = useCollectionRegistryController();\n const path = props.path ?? props.slug;\n const collection = collectionRegistry.getCollection(path) ?? props;\n\n // Both are commonly written inline, a new value on every render of\n // the caller. Neither reaches the memoised view as a prop: the\n // handler is called through a ref, and the toolbar is read from\n // context by the one element that draws it, so a caller's re-render\n // redraws the toolbar and nothing else.\n const onRowClickRef = useRef(onRowClick);\n onRowClickRef.current = onRowClick;\n const callRowClick = useCallback((row: Record<string, unknown>, id: string) => onRowClickRef.current?.(row, id), []);\n\n const content = (\n <CollectionToolbarSlotContext.Provider value={toolbar === undefined ? DEFAULT_TOOLBAR : toolbar}>\n <CollectionViewBindingInner {...props} onRowClick={onRowClick ? callRowClick : undefined}/>\n </CollectionToolbarSlotContext.Provider>\n );\n\n if (collection) {\n return (\n <CollectionScopeProvider collection={collection as AdminCollection}>\n {content}\n </CollectionScopeProvider>\n );\n }\n return content;\n }\n) as React.FunctionComponent<CollectionViewBindingProps<any>>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsIA,IAAM,0CAA0B,IAAI,IAAY;CAC5C;CAAQ;CAAyB;CAAmB;CAAmB;CACvE;CAAc;CAAmB;CAAwB;CAAiB;CAC1E;CAAuB;CAAW;CAAe;CAAmB;CACpE;CAAmB;CAAkB;CAAc;CAAW;CAC9D;CAAoB;CAAe;CAAuB;CAAkB;AAChF,CAAC;;;;;;;;;;;AAYD,SAAS,yBAAyB,GAAoC,GAA6C;CAC/G,MAAM,WAAW;CACjB,MAAM,OAAO;CACb,MAAM,uBAAO,IAAI,IAAI,CAAC,GAAG,OAAO,KAAK,QAAQ,GAAG,GAAG,OAAO,KAAK,IAAI,CAAC,CAAC;CACrE,KAAK,MAAM,OAAO,MAAM;EACpB,IAAI,SAAS,SAAS,KAAK,MAAM;EACjC,IAAI,wBAAwB,IAAI,GAAG,KAAK,UAAM,SAAS,MAAM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IACZ,2CACC,aAAa,UAAU,aAAa,YAAY,iBACrD;gBACK;KACA,CAAA,CACJ;;IAGT,oBAAC,uBAAD,EAA8B,MAAO,CAAA;GAEpB;;CACgB,CAAA;AAE7C,GAAG,wBAAwB;AAE/B,IAAa,wBAAwB,MAAM,KACvC,SAAS,sBAAyD,EAC9D,SACA,YACA,GAAG,SAC2B;CAC9B,MAAM,qBAAqB,gCAAgC;CAC3D,MAAM,OAAO,MAAM,QAAQ,MAAM;CACjC,MAAM,aAAa,mBAAmB,cAAc,IAAI,KAAK;CAO7D,MAAM,gBAAgB,OAAO,UAAU;CACvC,cAAc,UAAU;CACxB,MAAM,eAAe,aAAa,KAA8B,OAAe,cAAc,UAAU,KAAK,EAAE,GAAG,CAAC,CAAC;CAEnH,MAAM,UACF,oBAAC,6BAA6B,UAA9B;EAAuC,OAAO,YAAY,KAAA,IAAY,kBAAkB;YACpF,oBAAC,4BAAD;GAA4B,GAAI;GAAO,YAAY,aAAa,eAAe,KAAA;EAAW,CAAA;CACvD,CAAA;CAG3C,IAAI,YACA,OACI,oBAAC,yBAAD;EAAqC;YAChC;CACoB,CAAA;CAGjC,OAAO;AACX,CACJ"}
@@ -8,7 +8,6 @@ import { CustomViewHost } from "./CustomViewHost.js";
8
8
  import React, { useContext, useLayoutEffect } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { ErrorBoundary, Typography, cls } from "@rebasepro/ui";
11
- import { resolveComponentRef } from "@rebasepro/app";
12
11
  //#region src/components/CollectionViewBinding/CollectionViewContent.tsx
13
12
  /**
14
13
  * Where a panel draws a title above the view (`CollectionPanel`): the view of
@@ -33,7 +32,7 @@ function CollectionViewContent({ state }) {
33
32
  path,
34
33
  drawsTitle
35
34
  ]);
36
- const CustomViewBuilder = activeCustomView ? resolveComponentRef(activeCustomView.Builder) : void 0;
35
+ const CustomViewBuilder = activeCustomView?.Builder;
37
36
  const innerView = CustomViewBuilder ? /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(CustomViewHost, {
38
37
  Builder: CustomViewBuilder,
39
38
  collection,
@@ -1 +1 @@
1
- {"version":3,"file":"CollectionViewContent.js","names":[],"sources":["../../../src/components/CollectionViewBinding/CollectionViewContent.tsx"],"sourcesContent":["import React, { useContext, useLayoutEffect } from \"react\";\nimport type { CollectionCustomViewParams } from \"@rebasepro/cms-types\";\nimport { resolveComponentRef } from \"@rebasepro/app\";\nimport { cls, ErrorBoundary, Typography } from \"@rebasepro/ui\";\nimport { CollectionCardViewBinding } from \"./CollectionCardViewBinding\";\nimport { CollectionListViewBinding } from \"./CollectionListViewBinding\";\nimport { CollectionBoardViewBinding } from \"./CollectionBoardViewBinding\";\nimport { PluginAddColumnsContext, PluginHeaderActions, PluginHeaderActionsContext } from \"./PluginColumnSlots\";\nimport type { CollectionViewState } from \"./useCollectionViewState\";\nimport { EntityActionsScopeContext, renderCollectionEntityActions } from \"./CollectionEntityActions\";\nimport { EmptyImagePlaceContext } from \"./usePreviewSlots\";\nimport { CustomViewHost } from \"./CustomViewHost\";\n\n/**\n * Where a panel draws a title above the view (`CollectionPanel`): the view of\n * the panel's own path says whether it draws the title itself — the list's\n * heading — so the panel draws it only where the view does not, and never\n * both. Keyed on the path because a record opened beside the list draws its\n * relation views inside the same tree.\n */\nexport const ViewTitleReportContext = React.createContext<{ path: string; onViewDrawsTitle: (draws: boolean) => void } | null>(null);\n\n/**\n * The view the collection is drawn in: a custom view, the board, the cards,\n * the list or the table — and, for the list, its titled reading surface.\n */\nexport function CollectionViewContent({ state }: { state: CollectionViewState }) {\n const {\n path,\n parentCollectionSlugs,\n parentEntityIds,\n collection,\n resolvedCollection,\n tableController,\n activeCustomView,\n viewMode,\n onEntityClick,\n onNewClick,\n canCreateEntities,\n usedSelectionController,\n selectionEnabled,\n highlightedEntities,\n deletedEntities,\n emptyComponent,\n customViewSize,\n selectedKanbanProperty,\n cardSize,\n listSize,\n tableSize,\n selectedEntityId,\n getActionsForEntity,\n openEntityMode,\n pluginAddColumnComponents,\n headerActionsScope,\n ResolvedCollectionTable,\n additionalFields,\n displayedColumnIds,\n onTableSizeChanged,\n onColumnResize,\n onValueChange,\n tableRowActionsBuilder,\n uniqueFieldValidator,\n getPropertyFor,\n hoverRow,\n inlineEditingEnabled,\n addColumnComponentInternal,\n getIdColumnWidth,\n idHeaderWidget,\n onColumnsOrderChange,\n pluginWidgets,\n viewCollection,\n entityActionsScope,\n title\n } = state;\n\n const titleReport = useContext(ViewTitleReportContext);\n const drawsTitle = viewMode === \"list\" && title !== false;\n // Before paint, so the panel never shows its title beside the list's.\n useLayoutEffect(() => {\n if (titleReport?.path === path) titleReport.onViewDrawsTitle(drawsTitle);\n }, [titleReport, path, drawsTitle]);\n\n // A custom view wins over the built-in chain, but only after the\n // built-in keys have been ruled out — `resolveCollectionViews` refuses\n // a view keyed \"table\", so this cannot shadow one.\n const CustomViewBuilder = activeCustomView\n ? resolveComponentRef<CollectionCustomViewParams>(activeCustomView.Builder)\n : undefined;\n\n const innerView = CustomViewBuilder ? (\n <ErrorBoundary>\n <CustomViewHost\n key={`custom-view-${activeCustomView!.key}-${path}`}\n Builder={CustomViewBuilder}\n collection={collection}\n tableController={tableController}\n path={path}\n parentCollectionSlugs={parentCollectionSlugs}\n parentEntityIds={parentEntityIds}\n onEntityClick={onEntityClick}\n onNewClick={canCreateEntities ? onNewClick : undefined}\n canCreate={canCreateEntities}\n selectionController={usedSelectionController}\n selectionEnabled={selectionEnabled}\n highlightedEntities={highlightedEntities}\n deletedEntities={deletedEntities}\n emptyComponent={emptyComponent}\n size={activeCustomView!.sizeable ? customViewSize : undefined}\n viewMode={viewMode}\n />\n </ErrorBoundary>\n ) : viewMode === \"kanban\" ? (\n <CollectionBoardViewBinding\n key={`kanban-view-${path}-${selectedKanbanProperty}`}\n collection={collection}\n cardCollection={viewCollection !== collection ? viewCollection : undefined}\n renderActions={renderCollectionEntityActions}\n tableController={tableController}\n fullPath={path}\n parentCollectionSlugs={parentCollectionSlugs} parentEntityIds={parentEntityIds}\n columnProperty={selectedKanbanProperty}\n onEntityClick={onEntityClick}\n selectionController={usedSelectionController}\n selectionEnabled={selectionEnabled}\n highlightedEntities={highlightedEntities}\n deletedEntities={deletedEntities}\n emptyComponent={emptyComponent}\n />\n ) : viewMode === \"cards\" ? (\n <CollectionCardViewBinding\n key={`cards-view-${path}`}\n collection={viewCollection}\n renderActions={renderCollectionEntityActions}\n tableController={tableController}\n onEntityClick={onEntityClick}\n selectionController={usedSelectionController}\n selectionEnabled={selectionEnabled}\n highlightedEntities={highlightedEntities}\n onScroll={tableController.onScroll}\n initialScroll={tableController.initialScroll}\n size={cardSize}\n emptyComponent={emptyComponent}\n />\n ) : viewMode === \"list\" ? (\n <CollectionListViewBinding\n key={`list-view-${path}`}\n collection={viewCollection}\n tableController={tableController}\n onEntityClick={onEntityClick}\n selectionController={usedSelectionController}\n selectionEnabled={selectionEnabled}\n highlightedEntities={highlightedEntities}\n size={listSize}\n emptyComponent={emptyComponent}\n selectedEntityId={selectedEntityId}\n getActionsForEntity={getActionsForEntity}\n path={path}\n openEntityMode={openEntityMode}\n />\n ) : (\n <PluginAddColumnsContext.Provider value={pluginAddColumnComponents}>\n <PluginHeaderActionsContext.Provider value={headerActionsScope}>\n <ResolvedCollectionTable\n key={`collection_table_${path}`}\n hideToolbar={true}\n additionalFields={additionalFields}\n tableController={tableController}\n fixedFilter={collection.fixedFilter}\n enablePopupIcon={true}\n displayedColumnIds={displayedColumnIds}\n onSizeChanged={onTableSizeChanged}\n onEntityClick={onEntityClick}\n onColumnResize={onColumnResize}\n onValueChange={onValueChange}\n tableRowActionsBuilder={tableRowActionsBuilder}\n uniqueFieldValidator={uniqueFieldValidator}\n selectionController={usedSelectionController}\n highlightedEntities={highlightedEntities}\n defaultSize={tableSize}\n properties={resolvedCollection.properties}\n getPropertyFor={getPropertyFor}\n onScroll={tableController.onScroll}\n initialScroll={tableController.initialScroll}\n emptyComponent={emptyComponent}\n hoverRow={hoverRow}\n inlineEditing={inlineEditingEnabled}\n AdditionalHeaderWidget={PluginHeaderActions}\n AddColumnComponent={addColumnComponentInternal}\n getIdColumnWidth={getIdColumnWidth}\n additionalIDHeaderWidget={idHeaderWidget}\n openEntityMode={openEntityMode}\n onColumnsOrderChange={onColumnsOrderChange}\n />\n </PluginHeaderActionsContext.Provider>\n </PluginAddColumnsContext.Provider>\n );\n\n // Given `fields`, the rows draw only the places those fill.\n const withActions = (\n <EntityActionsScopeContext.Provider value={entityActionsScope}>\n <EmptyImagePlaceContext.Provider value={viewCollection === collection}>\n {innerView}\n </EmptyImagePlaceContext.Provider>\n </EntityActionsScopeContext.Provider>\n );\n\n if (viewMode !== \"list\") return withActions;\n\n const detailOpen = selectedEntityId !== undefined;\n\n // List view gets a centered, titled reading surface. Opening a detail\n // panel collapses the title and drops the centering so the list can\n // shrink into the master column.\n return (\n <div\n className={cls(\n \"flex flex-col w-full\",\n detailOpen ? \"\" : \"max-w-6xl mx-auto px-3 @3xl/collection:px-4 @5xl/collection:px-6 py-4\"\n )}\n >\n {/* Collapsible title — grid-rows for smooth height, transform for GPU */}\n {title !== false && <div\n className={cls(\n \"grid transition-[grid-template-rows,transform,margin] duration-150 ease-out\",\n detailOpen\n ? \"grid-rows-[0fr] -translate-y-2 mt-0 mb-0\"\n : \"grid-rows-[1fr] translate-y-0 mt-12 mb-6\"\n )}\n >\n <div className=\"overflow-hidden flex items-center gap-4\">\n <Typography gutterBottom variant=\"h4\" className=\"grow mb-0\" component=\"h4\">\n {title ?? collection.name}\n </Typography>\n </div>\n </div>}\n {pluginWidgets.length > 0 && (\n <div\n className={cls(\n \"grid transition-[grid-template-rows] duration-150 ease-out\",\n detailOpen ? \"grid-rows-[0fr]\" : \"grid-rows-[1fr]\"\n )}\n >\n <div className=\"overflow-hidden flex-shrink-0\">\n {pluginWidgets}\n </div>\n </div>\n )}\n {withActions}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,IAAa,yBAAyB,MAAM,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"}
1
+ {"version":3,"file":"CollectionViewContent.js","names":[],"sources":["../../../src/components/CollectionViewBinding/CollectionViewContent.tsx"],"sourcesContent":["import React, { useContext, useLayoutEffect } from \"react\";\nimport type { CollectionCustomViewParams } from \"@rebasepro/cms-types\";\nimport { cls, ErrorBoundary, Typography } from \"@rebasepro/ui\";\nimport { CollectionCardViewBinding } from \"./CollectionCardViewBinding\";\nimport { CollectionListViewBinding } from \"./CollectionListViewBinding\";\nimport { CollectionBoardViewBinding } from \"./CollectionBoardViewBinding\";\nimport { PluginAddColumnsContext, PluginHeaderActions, PluginHeaderActionsContext } from \"./PluginColumnSlots\";\nimport type { CollectionViewState } from \"./useCollectionViewState\";\nimport { EntityActionsScopeContext, renderCollectionEntityActions } from \"./CollectionEntityActions\";\nimport { EmptyImagePlaceContext } from \"./usePreviewSlots\";\nimport { CustomViewHost } from \"./CustomViewHost\";\n\n/**\n * Where a panel draws a title above the view (`CollectionPanel`): the view of\n * the panel's own path says whether it draws the title itself — the list's\n * heading — so the panel draws it only where the view does not, and never\n * both. Keyed on the path because a record opened beside the list draws its\n * relation views inside the same tree.\n */\nexport const ViewTitleReportContext = React.createContext<{ path: string; onViewDrawsTitle: (draws: boolean) => void } | null>(null);\n\n/**\n * The view the collection is drawn in: a custom view, the board, the cards,\n * the list or the table — and, for the list, its titled reading surface.\n */\nexport function CollectionViewContent({ state }: { state: CollectionViewState }) {\n const {\n path,\n parentCollectionSlugs,\n parentEntityIds,\n collection,\n resolvedCollection,\n tableController,\n activeCustomView,\n viewMode,\n onEntityClick,\n onNewClick,\n canCreateEntities,\n usedSelectionController,\n selectionEnabled,\n highlightedEntities,\n deletedEntities,\n emptyComponent,\n customViewSize,\n selectedKanbanProperty,\n cardSize,\n listSize,\n tableSize,\n selectedEntityId,\n getActionsForEntity,\n openEntityMode,\n pluginAddColumnComponents,\n headerActionsScope,\n ResolvedCollectionTable,\n additionalFields,\n displayedColumnIds,\n onTableSizeChanged,\n onColumnResize,\n onValueChange,\n tableRowActionsBuilder,\n uniqueFieldValidator,\n getPropertyFor,\n hoverRow,\n inlineEditingEnabled,\n addColumnComponentInternal,\n getIdColumnWidth,\n idHeaderWidget,\n onColumnsOrderChange,\n pluginWidgets,\n viewCollection,\n entityActionsScope,\n title\n } = state;\n\n const titleReport = useContext(ViewTitleReportContext);\n const drawsTitle = viewMode === \"list\" && title !== false;\n // Before paint, so the panel never shows its title beside the list's.\n useLayoutEffect(() => {\n if (titleReport?.path === path) titleReport.onViewDrawsTitle(drawsTitle);\n }, [titleReport, path, drawsTitle]);\n\n // A custom view wins over the built-in chain, but only after the\n // built-in keys have been ruled out — `resolveCollectionViews` refuses\n // a view keyed \"table\", so this cannot shadow one.\n const CustomViewBuilder = activeCustomView?.Builder;\n\n const innerView = CustomViewBuilder ? (\n <ErrorBoundary>\n <CustomViewHost\n key={`custom-view-${activeCustomView!.key}-${path}`}\n Builder={CustomViewBuilder}\n collection={collection}\n tableController={tableController}\n path={path}\n parentCollectionSlugs={parentCollectionSlugs}\n parentEntityIds={parentEntityIds}\n onEntityClick={onEntityClick}\n onNewClick={canCreateEntities ? onNewClick : undefined}\n canCreate={canCreateEntities}\n selectionController={usedSelectionController}\n selectionEnabled={selectionEnabled}\n highlightedEntities={highlightedEntities}\n deletedEntities={deletedEntities}\n emptyComponent={emptyComponent}\n size={activeCustomView!.sizeable ? customViewSize : undefined}\n viewMode={viewMode}\n />\n </ErrorBoundary>\n ) : viewMode === \"kanban\" ? (\n <CollectionBoardViewBinding\n key={`kanban-view-${path}-${selectedKanbanProperty}`}\n collection={collection}\n cardCollection={viewCollection !== collection ? viewCollection : undefined}\n renderActions={renderCollectionEntityActions}\n tableController={tableController}\n fullPath={path}\n parentCollectionSlugs={parentCollectionSlugs} parentEntityIds={parentEntityIds}\n columnProperty={selectedKanbanProperty}\n onEntityClick={onEntityClick}\n selectionController={usedSelectionController}\n selectionEnabled={selectionEnabled}\n highlightedEntities={highlightedEntities}\n deletedEntities={deletedEntities}\n emptyComponent={emptyComponent}\n />\n ) : viewMode === \"cards\" ? (\n <CollectionCardViewBinding\n key={`cards-view-${path}`}\n collection={viewCollection}\n renderActions={renderCollectionEntityActions}\n tableController={tableController}\n onEntityClick={onEntityClick}\n selectionController={usedSelectionController}\n selectionEnabled={selectionEnabled}\n highlightedEntities={highlightedEntities}\n onScroll={tableController.onScroll}\n initialScroll={tableController.initialScroll}\n size={cardSize}\n emptyComponent={emptyComponent}\n />\n ) : viewMode === \"list\" ? (\n <CollectionListViewBinding\n key={`list-view-${path}`}\n collection={viewCollection}\n tableController={tableController}\n onEntityClick={onEntityClick}\n selectionController={usedSelectionController}\n selectionEnabled={selectionEnabled}\n highlightedEntities={highlightedEntities}\n size={listSize}\n emptyComponent={emptyComponent}\n selectedEntityId={selectedEntityId}\n getActionsForEntity={getActionsForEntity}\n path={path}\n openEntityMode={openEntityMode}\n />\n ) : (\n <PluginAddColumnsContext.Provider value={pluginAddColumnComponents}>\n <PluginHeaderActionsContext.Provider value={headerActionsScope}>\n <ResolvedCollectionTable\n key={`collection_table_${path}`}\n hideToolbar={true}\n additionalFields={additionalFields}\n tableController={tableController}\n fixedFilter={collection.fixedFilter}\n enablePopupIcon={true}\n displayedColumnIds={displayedColumnIds}\n onSizeChanged={onTableSizeChanged}\n onEntityClick={onEntityClick}\n onColumnResize={onColumnResize}\n onValueChange={onValueChange}\n tableRowActionsBuilder={tableRowActionsBuilder}\n uniqueFieldValidator={uniqueFieldValidator}\n selectionController={usedSelectionController}\n highlightedEntities={highlightedEntities}\n defaultSize={tableSize}\n properties={resolvedCollection.properties}\n getPropertyFor={getPropertyFor}\n onScroll={tableController.onScroll}\n initialScroll={tableController.initialScroll}\n emptyComponent={emptyComponent}\n hoverRow={hoverRow}\n inlineEditing={inlineEditingEnabled}\n AdditionalHeaderWidget={PluginHeaderActions}\n AddColumnComponent={addColumnComponentInternal}\n getIdColumnWidth={getIdColumnWidth}\n additionalIDHeaderWidget={idHeaderWidget}\n openEntityMode={openEntityMode}\n onColumnsOrderChange={onColumnsOrderChange}\n />\n </PluginHeaderActionsContext.Provider>\n </PluginAddColumnsContext.Provider>\n );\n\n // Given `fields`, the rows draw only the places those fill.\n const withActions = (\n <EntityActionsScopeContext.Provider value={entityActionsScope}>\n <EmptyImagePlaceContext.Provider value={viewCollection === collection}>\n {innerView}\n </EmptyImagePlaceContext.Provider>\n </EntityActionsScopeContext.Provider>\n );\n\n if (viewMode !== \"list\") return withActions;\n\n const detailOpen = selectedEntityId !== undefined;\n\n // List view gets a centered, titled reading surface. Opening a detail\n // panel collapses the title and drops the centering so the list can\n // shrink into the master column.\n return (\n <div\n className={cls(\n \"flex flex-col w-full\",\n detailOpen ? \"\" : \"max-w-6xl mx-auto px-3 @3xl/collection:px-4 @5xl/collection:px-6 py-4\"\n )}\n >\n {/* Collapsible title — grid-rows for smooth height, transform for GPU */}\n {title !== false && <div\n className={cls(\n \"grid transition-[grid-template-rows,transform,margin] duration-150 ease-out\",\n detailOpen\n ? \"grid-rows-[0fr] -translate-y-2 mt-0 mb-0\"\n : \"grid-rows-[1fr] translate-y-0 mt-12 mb-6\"\n )}\n >\n <div className=\"overflow-hidden flex items-center gap-4\">\n <Typography gutterBottom variant=\"h4\" className=\"grow mb-0\" component=\"h4\">\n {title ?? collection.name}\n </Typography>\n </div>\n </div>}\n {pluginWidgets.length > 0 && (\n <div\n className={cls(\n \"grid transition-[grid-template-rows] duration-150 ease-out\",\n detailOpen ? \"grid-rows-[0fr]\" : \"grid-rows-[1fr]\"\n )}\n >\n <div className=\"overflow-hidden flex-shrink-0\">\n {pluginWidgets}\n </div>\n </div>\n )}\n {withActions}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,IAAa,yBAAyB,MAAM,cAAmF,IAAI;;;;;AAMnI,SAAgB,sBAAsB,EAAE,SAAyC;CAC7E,MAAM,EACF,MACA,uBACA,iBACA,YACA,oBACA,iBACA,kBACA,UACA,eACA,YACA,mBACA,yBACA,kBACA,qBACA,iBACA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,OAAO;YACrC,oBAAC,2BAA2B,UAA5B;GAAqC,OAAO;aACxC,oBAAC,yBAAD;IAEI,aAAa;IACK;IACD;IACjB,aAAa,WAAW;IACxB,iBAAiB;IACG;IACpB,eAAe;IACA;IACC;IACD;IACS;IACF;IACtB,qBAAqB;IACA;IACrB,aAAa;IACb,YAAY,mBAAmB;IACf;IAChB,UAAU,gBAAgB;IAC1B,eAAe,gBAAgB;IACf;IACN;IACV,eAAe;IACf,wBAAwB;IACxB,oBAAoB;IACF;IAClB,0BAA0B;IACV;IACM;GACzB,GA7BQ,oBAAoB,MA6B5B;EACgC,CAAA;CACP,CAAA;CAItC,MAAM,cACF,oBAAC,0BAA0B,UAA3B;EAAoC,OAAO;YACvC,oBAAC,uBAAuB,UAAxB;GAAiC,OAAO,mBAAmB;aACtD;EAC4B,CAAA;CACD,CAAA;CAGxC,IAAI,aAAa,QAAQ,OAAO;CAEhC,MAAM,aAAa,qBAAqB,KAAA;CAKxC,OACI,qBAAC,OAAD;EACI,WAAW,IACP,wBACA,aAAa,KAAK,uEACtB;YAJJ;GAOK,UAAU,SAAS,oBAAC,OAAD;IAChB,WAAW,IACP,+EACA,aACM,6CACA,0CACV;cAEA,oBAAC,OAAD;KAAK,WAAU;eACX,oBAAC,YAAD;MAAY,cAAA;MAAa,SAAQ;MAAK,WAAU;MAAY,WAAU;gBACjE,SAAS,WAAW;KACb,CAAA;IACX,CAAA;GACJ,CAAA;GACJ,cAAc,SAAS,KACpB,oBAAC,OAAD;IACI,WAAW,IACP,8DACA,aAAa,oBAAoB,iBACrC;cAEA,oBAAC,OAAD;KAAK,WAAU;eACV;IACA,CAAA;GACJ,CAAA;GAER;EACA;;AAEb"}
@@ -1,4 +1,4 @@
1
- import type { Properties } from "@rebasepro/types";
1
+ import type { Properties } from "@rebasepro/cms-types";
2
2
  import React from "react";
3
3
  import { EntityTableController, EntitySelectionController, SelectionQuery, AdminCollection, ViewMode } from "@rebasepro/cms-types";
4
4
  export type CollectionViewStartActionsProps<M extends Record<string, unknown>> = {
@@ -1 +1 @@
1
- {"version":3,"file":"CollectionViewStartActions.js","names":[],"sources":["../../../src/components/CollectionViewBinding/CollectionViewStartActions.tsx"],"sourcesContent":["import type { Properties } from \"@rebasepro/types\";\n\nimport React, { useCallback } from \"react\";\nimport { useAuthController, useTranslation, useSlot } from \"@rebasepro/app\";\nimport { CollectionActionsProps, EntityTableController, EntitySelectionController, SelectionQuery, AdminCollection, ViewMode } from \"@rebasepro/cms-types\";\nimport { ErrorBoundary, iconSize } from \"@rebasepro/ui\";\nimport { IconButton, Skeleton, Tooltip, XIcon } from \"@rebasepro/ui\";\nimport { ClearFilterSortButton } from \"../ClearFilterSortButton\";\nimport { FiltersButton } from \"./FiltersButton\";\nimport { FilterPresetsButton } from \"./FilterPresetsButton\";\nimport { SortButton } from \"./SortButton\";\nimport { toArray } from \"@rebasepro/utils\";\nimport { useNavigate } from \"react-router\";\nimport { useUrlController } from \"../../hooks/navigation/contexts/UrlContext\";\nimport { useAdminContext } from \"../../hooks/useAdminContext\";\nimport { withListState } from \"../../util/view_mode\";\nimport { useSplitView } from \"./SplitViewContext\";\nimport { SelectionMenu } from \"../../selection\";\nimport { selectionControllerOf, tableControllerOf } from \"@rebasepro/app\";\nimport { useToolbarLabels } from \"../CollectionTableBinding/internal/CollectionTableToolbar\";\n\nexport type CollectionViewStartActionsProps<M extends Record<string, unknown>> = {\n collection: AdminCollection<M>;\n path: string;\n relativePath: string;\n parentCollectionSlugs: string[], parentEntityIds: string[];\n selectionController: EntitySelectionController<M>;\n tableController: EntityTableController<M>;\n collectionEntitiesCount?: number;\n /**\n * Number of records the current filters and search resolve to, rendered at\n * the end of this group.\n * - `undefined`: not applicable\n * - `null`: still counting\n * - number: the count\n */\n entitiesCount?: number | null;\n /**\n * Resolved properties from the collection for the filters dialog\n */\n resolvedProperties?: Properties;\n /**\n * Which view is being displayed. Decides whether the sort control is\n * offered — see `sortButton`.\n */\n viewMode?: ViewMode;\n /** Whether rows can be selected at all in this mount. */\n selectionEnabled?: boolean;\n /** The view's live query — what the menu's \"all matching\" item stands for. */\n selectionQuery?: SelectionQuery<M>;\n compact?: boolean;\n openNewDocument: (defaultValues?: Record<string, unknown>) => void;\n}\n\nexport function CollectionViewStartActions<M extends Record<string, unknown>>({\n collection,\n relativePath,\n parentCollectionSlugs, parentEntityIds,\n path,\n selectionController,\n tableController,\n collectionEntitiesCount,\n entitiesCount,\n resolvedProperties,\n viewMode,\n selectionEnabled,\n selectionQuery,\n compact,\n openNewDocument\n}: CollectionViewStartActionsProps<M>) {\n\n const context = useAdminContext();\n const toolbarLabels = useToolbarLabels();\n const { t } = useTranslation();\n\n const navigate = useNavigate();\n const urlController = useUrlController();\n const splitView = useSplitView();\n\n // What an app's actions are handed: the rows, not the admin's records.\n const rowSelectionController = selectionControllerOf(selectionController, collection, path);\n const rowTableController = tableControllerOf(tableController, collection);\n const actionProps: CollectionActionsProps<M> = {\n path,\n relativePath,\n parentCollectionSlugs,\n parentEntityIds,\n collection,\n selectionController: rowSelectionController,\n context,\n tableController: rowTableController,\n collectionEntitiesCount,\n openNewDocument\n };\n\n const handleBackClick = useCallback(() => {\n navigate(withListState(urlController.buildUrlCollectionPath(path)));\n }, [navigate, urlController, path]);\n\n // In a split view the control that closes the list lives at the leading\n // edge of the record's app bar (`SplitListCloseButton`), not here.\n //\n // Outside one — a compact list with no record open beside it — the only\n // thing this can mean is \"leave the record behind\".\n const backButton = compact && !splitView?.detailOpen && (\n <Tooltip title={t(\"close\")} key={\"close_tooltip\"}>\n <IconButton\n size=\"small\"\n onClick={handleBackClick}\n aria-label={t(\"close\")}\n className=\"mr-1\"\n >\n <XIcon size={iconSize.smallest}/>\n </IconButton>\n </Tooltip>\n );\n\n // Whether the toolbar is showing icon-only controls. The filters button\n // drops its label — and its icon a size with it — on a narrow layout as\n // well as in the split view, and the sort and clear controls beside it\n // follow: keyed on `compact` alone they stayed 20px next to a 16px filter\n // icon at every width below `largeLayout`. A toolbar too narrow for its\n // labels (`useToolbarLabels`) is a narrow layout too, whatever the window.\n const iconOnlyToolbar = Boolean(compact) || !toolbarLabels;\n\n const filtersButton = resolvedProperties && (\n <FiltersButton\n key={\"filters_tooltip\"}\n tableController={tableController}\n properties={resolvedProperties}\n fixedFilter={collection.fixedFilter}\n iconOnly={iconOnlyToolbar}/>\n );\n\n // Everywhere a `sortBy` means something — which is every view but the\n // board, whose columns are ordered by their own order key and which ignores\n // `sortBy` entirely, so the control would appear to do nothing.\n //\n // Including the table, whose headers were once thought to cover it. They\n // build a multi-key sort (shift-click) and they show its ranks, but they\n // cannot *re-rank* it: promoting the third key above the first means\n // clearing the sort and shift-clicking all three back in the new order.\n // Nor can they remove a middle key without cycling it through descending\n // first. This popover is the only place either is one click, and a table\n // with a three-key sort needs it more than a card grid does, not less.\n const sortButton = resolvedProperties && viewMode !== \"kanban\" && (\n <SortButton\n key={\"sort_button\"}\n tableController={tableController}\n properties={resolvedProperties}\n compact={iconOnlyToolbar}\n />\n );\n\n // Not in the split view. The toolbar there is a strip a few hundred pixels\n // wide above the list, and a row of preset chips crowded out the controls\n // that act on what you are looking at. The presets are still one click away\n // inside the filters dialog.\n const filterPresetsButton = !compact && collection.filterPresets?.length ? (\n <FilterPresetsButton\n key={\"filter_presets\"}\n filterPresets={collection.filterPresets}\n tableController={tableController}\n compact={compact}\n />\n ) : null;\n\n // The count closes the group the filter, sort and preset controls open: it\n // is what they resolve to. It used to live in the breadcrumb trail, which\n // the app bar owns — and a collection rendered without an app bar has no\n // breadcrumbs, so the number simply disappeared.\n //\n // Hidden on the same layouts the trail was (`hidden lg:block` there) and in\n // the split view, where this toolbar is a few hundred pixels wide and\n // scrolls: a passive readout is the first thing that should give up its\n // room to the controls.\n const countBadge = !iconOnlyToolbar && entitiesCount !== undefined ? (\n <Tooltip title={t(\"records_in_view\")} key={\"entities_count\"}>\n {entitiesCount === null\n ? <Skeleton className={\"w-8 h-4 rounded-md mx-1\"}/>\n : <span\n className={\"mx-1 text-xs font-mono tabular-nums text-text-secondary dark:text-text-secondary-dark\"}>\n {entitiesCount.toLocaleString()}\n </span>}\n </Tooltip>\n ) : null;\n\n // One control, in one place, for every view — the leading edge of the\n // toolbar, which in a table sits directly above the checkbox column anyway.\n // The table used to carry its own in the ID column header, which meant two\n // controls that did different amounts.\n const selectionMenu = selectionEnabled && selectionQuery ? (\n <div key={\"select_all\"} className={\"mr-1 flex items-center\"}>\n <SelectionMenu\n selectionController={rowSelectionController}\n loadedRows={rowTableController.rows}\n collection={collection}\n query={selectionQuery}\n collectionEntitiesCount={collectionEntitiesCount}\n collectionName={collection.name}/>\n </div>\n ) : null;\n\n const actions: React.ReactNode[] = [\n backButton,\n selectionMenu,\n filtersButton,\n sortButton,\n <ClearFilterSortButton\n key={\"clear_filter\"}\n tableController={tableController}\n compact={iconOnlyToolbar}\n fixedFilter={collection.fixedFilter}\n enabled={true}/>,\n filterPresetsButton,\n countBadge\n ];\n\n const pluginActionsStart = useSlot(\"collection.actions.start\", actionProps);\n\n return (\n <>\n {actions}\n {pluginActionsStart}\n </>\n );\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;AAsDA,SAAgB,2BAA8D,EAC1E,YACA,cACA,uBAAuB,iBACvB,MACA,qBACA,iBACA,yBACA,eACA,oBACA,UACA,kBACA,gBACA,SACA,mBACmC;CAEnC,MAAM,UAAU,gBAAgB;CAChC,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,EAAE,MAAM,eAAe;CAE7B,MAAM,WAAW,YAAY;CAC7B,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,YAAY,aAAa;CAG/B,MAAM,yBAAyB,sBAAsB,qBAAqB,YAAY,IAAI;CAC1F,MAAM,qBAAqB,kBAAkB,iBAAiB,UAAU;CACxE,MAAM,cAAyC;EAC3C;EACA;EACA;EACA;EACA;EACA,qBAAqB;EACrB;EACA,iBAAiB;EACjB;EACA;CACJ;CAEA,MAAM,kBAAkB,kBAAkB;EACtC,SAAS,cAAc,cAAc,uBAAuB,IAA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V,cAIU;EACnB;EACA;CAOK,GAJkB,QAAQ,4BAA4B,WAKtD,CACH,EAAA,CAAA;AAEV"}
1
+ {"version":3,"file":"CollectionViewStartActions.js","names":[],"sources":["../../../src/components/CollectionViewBinding/CollectionViewStartActions.tsx"],"sourcesContent":["import type { Properties } from \"@rebasepro/cms-types\";\n\nimport React, { useCallback } from \"react\";\nimport { useAuthController, useTranslation, useSlot } from \"@rebasepro/app\";\nimport { CollectionActionsProps, EntityTableController, EntitySelectionController, SelectionQuery, AdminCollection, ViewMode } from \"@rebasepro/cms-types\";\nimport { ErrorBoundary, iconSize } from \"@rebasepro/ui\";\nimport { IconButton, Skeleton, Tooltip, XIcon } from \"@rebasepro/ui\";\nimport { ClearFilterSortButton } from \"../ClearFilterSortButton\";\nimport { FiltersButton } from \"./FiltersButton\";\nimport { FilterPresetsButton } from \"./FilterPresetsButton\";\nimport { SortButton } from \"./SortButton\";\nimport { toArray } from \"@rebasepro/utils\";\nimport { useNavigate } from \"react-router\";\nimport { useUrlController } from \"../../hooks/navigation/contexts/UrlContext\";\nimport { useAdminContext } from \"../../hooks/useAdminContext\";\nimport { withListState } from \"../../util/view_mode\";\nimport { useSplitView } from \"./SplitViewContext\";\nimport { SelectionMenu } from \"../../selection\";\nimport { selectionControllerOf, tableControllerOf } from \"@rebasepro/app\";\nimport { useToolbarLabels } from \"../CollectionTableBinding/internal/CollectionTableToolbar\";\n\nexport type CollectionViewStartActionsProps<M extends Record<string, unknown>> = {\n collection: AdminCollection<M>;\n path: string;\n relativePath: string;\n parentCollectionSlugs: string[], parentEntityIds: string[];\n selectionController: EntitySelectionController<M>;\n tableController: EntityTableController<M>;\n collectionEntitiesCount?: number;\n /**\n * Number of records the current filters and search resolve to, rendered at\n * the end of this group.\n * - `undefined`: not applicable\n * - `null`: still counting\n * - number: the count\n */\n entitiesCount?: number | null;\n /**\n * Resolved properties from the collection for the filters dialog\n */\n resolvedProperties?: Properties;\n /**\n * Which view is being displayed. Decides whether the sort control is\n * offered — see `sortButton`.\n */\n viewMode?: ViewMode;\n /** Whether rows can be selected at all in this mount. */\n selectionEnabled?: boolean;\n /** The view's live query — what the menu's \"all matching\" item stands for. */\n selectionQuery?: SelectionQuery<M>;\n compact?: boolean;\n openNewDocument: (defaultValues?: Record<string, unknown>) => void;\n}\n\nexport function CollectionViewStartActions<M extends Record<string, unknown>>({\n collection,\n relativePath,\n parentCollectionSlugs, parentEntityIds,\n path,\n selectionController,\n tableController,\n collectionEntitiesCount,\n entitiesCount,\n resolvedProperties,\n viewMode,\n selectionEnabled,\n selectionQuery,\n compact,\n openNewDocument\n}: CollectionViewStartActionsProps<M>) {\n\n const context = useAdminContext();\n const toolbarLabels = useToolbarLabels();\n const { t } = useTranslation();\n\n const navigate = useNavigate();\n const urlController = useUrlController();\n const splitView = useSplitView();\n\n // What an app's actions are handed: the rows, not the admin's records.\n const rowSelectionController = selectionControllerOf(selectionController, collection, path);\n const rowTableController = tableControllerOf(tableController, collection);\n const actionProps: CollectionActionsProps<M> = {\n path,\n relativePath,\n parentCollectionSlugs,\n parentEntityIds,\n collection,\n selectionController: rowSelectionController,\n context,\n tableController: rowTableController,\n collectionEntitiesCount,\n openNewDocument\n };\n\n const handleBackClick = useCallback(() => {\n navigate(withListState(urlController.buildUrlCollectionPath(path)));\n }, [navigate, urlController, path]);\n\n // In a split view the control that closes the list lives at the leading\n // edge of the record's app bar (`SplitListCloseButton`), not here.\n //\n // Outside one — a compact list with no record open beside it — the only\n // thing this can mean is \"leave the record behind\".\n const backButton = compact && !splitView?.detailOpen && (\n <Tooltip title={t(\"close\")} key={\"close_tooltip\"}>\n <IconButton\n size=\"small\"\n onClick={handleBackClick}\n aria-label={t(\"close\")}\n className=\"mr-1\"\n >\n <XIcon size={iconSize.smallest}/>\n </IconButton>\n </Tooltip>\n );\n\n // Whether the toolbar is showing icon-only controls. The filters button\n // drops its label — and its icon a size with it — on a narrow layout as\n // well as in the split view, and the sort and clear controls beside it\n // follow: keyed on `compact` alone they stayed 20px next to a 16px filter\n // icon at every width below `largeLayout`. A toolbar too narrow for its\n // labels (`useToolbarLabels`) is a narrow layout too, whatever the window.\n const iconOnlyToolbar = Boolean(compact) || !toolbarLabels;\n\n const filtersButton = resolvedProperties && (\n <FiltersButton\n key={\"filters_tooltip\"}\n tableController={tableController}\n properties={resolvedProperties}\n fixedFilter={collection.fixedFilter}\n iconOnly={iconOnlyToolbar}/>\n );\n\n // Everywhere a `sortBy` means something — which is every view but the\n // board, whose columns are ordered by their own order key and which ignores\n // `sortBy` entirely, so the control would appear to do nothing.\n //\n // Including the table, whose headers were once thought to cover it. They\n // build a multi-key sort (shift-click) and they show its ranks, but they\n // cannot *re-rank* it: promoting the third key above the first means\n // clearing the sort and shift-clicking all three back in the new order.\n // Nor can they remove a middle key without cycling it through descending\n // first. This popover is the only place either is one click, and a table\n // with a three-key sort needs it more than a card grid does, not less.\n const sortButton = resolvedProperties && viewMode !== \"kanban\" && (\n <SortButton\n key={\"sort_button\"}\n tableController={tableController}\n properties={resolvedProperties}\n compact={iconOnlyToolbar}\n />\n );\n\n // Not in the split view. The toolbar there is a strip a few hundred pixels\n // wide above the list, and a row of preset chips crowded out the controls\n // that act on what you are looking at. The presets are still one click away\n // inside the filters dialog.\n const filterPresetsButton = !compact && collection.filterPresets?.length ? (\n <FilterPresetsButton\n key={\"filter_presets\"}\n filterPresets={collection.filterPresets}\n tableController={tableController}\n compact={compact}\n />\n ) : null;\n\n // The count closes the group the filter, sort and preset controls open: it\n // is what they resolve to. It used to live in the breadcrumb trail, which\n // the app bar owns — and a collection rendered without an app bar has no\n // breadcrumbs, so the number simply disappeared.\n //\n // Hidden on the same layouts the trail was (`hidden lg:block` there) and in\n // the split view, where this toolbar is a few hundred pixels wide and\n // scrolls: a passive readout is the first thing that should give up its\n // room to the controls.\n const countBadge = !iconOnlyToolbar && entitiesCount !== undefined ? (\n <Tooltip title={t(\"records_in_view\")} key={\"entities_count\"}>\n {entitiesCount === null\n ? <Skeleton className={\"w-8 h-4 rounded-md mx-1\"}/>\n : <span\n className={\"mx-1 text-xs font-mono tabular-nums text-text-secondary dark:text-text-secondary-dark\"}>\n {entitiesCount.toLocaleString()}\n </span>}\n </Tooltip>\n ) : null;\n\n // One control, in one place, for every view — the leading edge of the\n // toolbar, which in a table sits directly above the checkbox column anyway.\n // The table used to carry its own in the ID column header, which meant two\n // controls that did different amounts.\n const selectionMenu = selectionEnabled && selectionQuery ? (\n <div key={\"select_all\"} className={\"mr-1 flex items-center\"}>\n <SelectionMenu\n selectionController={rowSelectionController}\n loadedRows={rowTableController.rows}\n collection={collection}\n query={selectionQuery}\n collectionEntitiesCount={collectionEntitiesCount}\n collectionName={collection.name}/>\n </div>\n ) : null;\n\n const actions: React.ReactNode[] = [\n backButton,\n selectionMenu,\n filtersButton,\n sortButton,\n <ClearFilterSortButton\n key={\"clear_filter\"}\n tableController={tableController}\n compact={iconOnlyToolbar}\n fixedFilter={collection.fixedFilter}\n enabled={true}/>,\n filterPresetsButton,\n countBadge\n ];\n\n const pluginActionsStart = useSlot(\"collection.actions.start\", actionProps);\n\n return (\n <>\n {actions}\n {pluginActionsStart}\n </>\n );\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;AAsDA,SAAgB,2BAA8D,EAC1E,YACA,cACA,uBAAuB,iBACvB,MACA,qBACA,iBACA,yBACA,eACA,oBACA,UACA,kBACA,gBACA,SACA,mBACmC;CAEnC,MAAM,UAAU,gBAAgB;CAChC,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,EAAE,MAAM,eAAe;CAE7B,MAAM,WAAW,YAAY;CAC7B,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,YAAY,aAAa;CAG/B,MAAM,yBAAyB,sBAAsB,qBAAqB,YAAY,IAAI;CAC1F,MAAM,qBAAqB,kBAAkB,iBAAiB,UAAU;CACxE,MAAM,cAAyC;EAC3C;EACA;EACA;EACA;EACA;EACA,qBAAqB;EACrB;EACA,iBAAiB;EACjB;EACA;CACJ;CAEA,MAAM,kBAA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jB,SAAS;GACT,aAAa,WAAW;GACxB,SAAS;EAAM,GAJV,cAIU;EACnB;EACA;CAOK,GAJkB,QAAQ,4BAA4B,WAKtD,CACH,EAAA,CAAA;AAEV"}
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
- import type { Entity } from "@rebasepro/types";
3
- import type { AdminCollection, CollectionCustomViewParams, CollectionSize, EntitySelectionController, EntityTableController, ViewMode } from "@rebasepro/cms-types";
2
+ import type { AdminCollection, CollectionCustomViewParams, CollectionSize, EntitySelectionController, EntityTableController, ViewMode, Entity } from "@rebasepro/cms-types";
4
3
  /** What the view holds, in its own view model, for a custom view to be drawn from. */
5
4
  export interface CustomViewHostProps<M extends Record<string, unknown>> {
6
5
  Builder: React.ComponentType<CollectionCustomViewParams<M>>;
@@ -1 +1 @@
1
- {"version":3,"file":"CustomViewHost.js","names":[],"sources":["../../../src/components/CollectionViewBinding/CustomViewHost.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useRef } from \"react\";\nimport type { Entity } from \"@rebasepro/types\";\nimport type {\n AdminCollection,\n CollectionCustomViewParams,\n CollectionSize,\n EntitySelectionController,\n EntityTableController,\n ViewMode\n} from \"@rebasepro/cms-types\";\nimport { entityOfRow, idOfRow, selectionControllerOf, tableControllerOf } from \"@rebasepro/app\";\n\nconst NO_IDS: string[] = [];\n\n/** What the view holds, in its own view model, for a custom view to be drawn from. */\nexport interface CustomViewHostProps<M extends Record<string, unknown>> {\n Builder: React.ComponentType<CollectionCustomViewParams<M>>;\n collection: AdminCollection<M>;\n tableController: EntityTableController<M>;\n path: string;\n parentCollectionSlugs?: string[];\n parentEntityIds?: string[];\n onEntityClick?: (entity: Entity<M>) => void;\n onNewClick?: () => void;\n canCreate?: boolean;\n selectionController?: EntitySelectionController<M>;\n selectionEnabled?: boolean;\n highlightedEntities?: Entity<M>[];\n deletedEntities?: Entity<M>[];\n emptyComponent?: React.ReactNode;\n size?: CollectionSize;\n viewMode?: ViewMode;\n}\n\n/**\n * A custom view's `Builder`, handed what the view holds as an app's code\n * reads it: the rows as the server sends them, ids for what is highlighted\n * and deleted, and a click that takes a row.\n */\nexport function CustomViewHost<M extends Record<string, unknown>>({\n Builder,\n collection,\n tableController,\n path,\n parentCollectionSlugs,\n parentEntityIds,\n onEntityClick,\n onNewClick,\n canCreate,\n selectionController,\n selectionEnabled,\n highlightedEntities,\n deletedEntities,\n emptyComponent,\n size,\n viewMode\n}: CustomViewHostProps<M>) {\n const rowTableController = tableControllerOf(tableController, collection);\n const rowSelectionController = selectionController\n ? selectionControllerOf(selectionController, collection, path)\n : undefined;\n const highlightedIds = useMemo(\n () => highlightedEntities?.length ? highlightedEntities.map((entity) => String(entity.id)) : NO_IDS,\n [highlightedEntities]);\n const deletedIds = useMemo(\n () => deletedEntities?.length ? deletedEntities.map((entity) => String(entity.id)) : NO_IDS,\n [deletedEntities]);\n\n // Through a ref, so the view is not redrawn when the handler is.\n const latest = useRef({ onEntityClick, collection, path });\n latest.current = { onEntityClick, collection, path };\n const hasClick = onEntityClick !== undefined;\n const onRowClick = useCallback((row: Record<string, unknown>) => {\n const { onEntityClick, collection, path } = latest.current;\n const id = idOfRow(row, collection);\n if (id === undefined) return;\n onEntityClick?.(entityOfRow(row, id, path, collection) as Entity<M>);\n }, []);\n\n return (\n <Builder\n collection={collection}\n tableController={rowTableController}\n path={path}\n parentCollectionSlugs={parentCollectionSlugs}\n parentEntityIds={parentEntityIds}\n onRowClick={hasClick ? onRowClick : undefined}\n onNewClick={onNewClick}\n canCreate={canCreate}\n selectionController={rowSelectionController}\n selectionEnabled={selectionEnabled}\n highlightedIds={highlightedIds}\n deletedIds={deletedIds}\n emptyComponent={emptyComponent}\n size={size}\n viewMode={viewMode}\n />\n );\n}\n"],"mappings":";;;;AAYA,IAAM,SAAmB,CAAC;;;;;;AA2B1B,SAAgB,eAAkD,EAC9D,SACA,YACA,iBACA,MACA,uBACA,iBACA,eACA,YACA,WACA,qBACA,kBACA,qBACA,iBACA,gBACA,MACA,YACuB;CACvB,MAAM,qBAAqB,kBAAkB,iBAAiB,UAAU;CACxE,MAAM,yBAAyB,sBACzB,sBAAsB,qBAAqB,YAAY,IAAI,IAC3D,KAAA;CACN,MAAM,iBAAiB,cACb,qBAAqB,SAAS,oBAAoB,KAAK,WAAW,OAAO,OAAO,EAAE,CAAC,IAAI,QAC7F,CAAC,mBAAmB,CAAC;CACzB,MAAM,aAAa,cACT,iBAAiB,SAAS,gBAAgB,KAAK,WAAW,OAAO,OAAO,EAAE,CAAC,IAAI,QACrF,CAAC,eAAe,CAAC;CAGrB,MAAM,SAAS,OAAO;EAAE;EAAe;EAAY;CAAK,CAAC;CACzD,OAAO,UAAU;EAAE;EAAe;EAAY;CAAK;CACnD,MAAM,WAAW,kBAAkB,KAAA;CACnC,MAAM,aAAa,aAAa,QAAiC;EAC7D,MAAM,EAAE,eAAe,YAAY,SAAS,OAAO;EACnD,MAAM,KAAK,QAAQ,KAAK,UAAU;EAClC,IAAI,OAAO,KAAA,GAAW;EACtB,gBAAgB,YAAY,KAAK,IAAI,MAAM,UAAU,CAAc;CACvE,GAAG,CAAC,CAAC;CAEL,OACI,oBAAC,SAAD;EACgB;EACZ,iBAAiB;EACX;EACiB;EACN;EACjB,YAAY,WAAW,aAAa,KAAA;EACxB;EACD;EACX,qBAAqB;EACH;EACF;EACJ;EACI;EACV;EACI;CACb,CAAA;AAET"}
1
+ {"version":3,"file":"CustomViewHost.js","names":[],"sources":["../../../src/components/CollectionViewBinding/CustomViewHost.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useRef } from \"react\";\nimport type {\n AdminCollection,\n CollectionCustomViewParams,\n CollectionSize,\n EntitySelectionController,\n EntityTableController,\n ViewMode,\n Entity\n} from \"@rebasepro/cms-types\";\nimport { entityOfRow, idOfRow, selectionControllerOf, tableControllerOf } from \"@rebasepro/app\";\n\nconst NO_IDS: string[] = [];\n\n/** What the view holds, in its own view model, for a custom view to be drawn from. */\nexport interface CustomViewHostProps<M extends Record<string, unknown>> {\n Builder: React.ComponentType<CollectionCustomViewParams<M>>;\n collection: AdminCollection<M>;\n tableController: EntityTableController<M>;\n path: string;\n parentCollectionSlugs?: string[];\n parentEntityIds?: string[];\n onEntityClick?: (entity: Entity<M>) => void;\n onNewClick?: () => void;\n canCreate?: boolean;\n selectionController?: EntitySelectionController<M>;\n selectionEnabled?: boolean;\n highlightedEntities?: Entity<M>[];\n deletedEntities?: Entity<M>[];\n emptyComponent?: React.ReactNode;\n size?: CollectionSize;\n viewMode?: ViewMode;\n}\n\n/**\n * A custom view's `Builder`, handed what the view holds as an app's code\n * reads it: the rows as the server sends them, ids for what is highlighted\n * and deleted, and a click that takes a row.\n */\nexport function CustomViewHost<M extends Record<string, unknown>>({\n Builder,\n collection,\n tableController,\n path,\n parentCollectionSlugs,\n parentEntityIds,\n onEntityClick,\n onNewClick,\n canCreate,\n selectionController,\n selectionEnabled,\n highlightedEntities,\n deletedEntities,\n emptyComponent,\n size,\n viewMode\n}: CustomViewHostProps<M>) {\n const rowTableController = tableControllerOf(tableController, collection);\n const rowSelectionController = selectionController\n ? selectionControllerOf(selectionController, collection, path)\n : undefined;\n const highlightedIds = useMemo(\n () => highlightedEntities?.length ? highlightedEntities.map((entity) => String(entity.id)) : NO_IDS,\n [highlightedEntities]);\n const deletedIds = useMemo(\n () => deletedEntities?.length ? deletedEntities.map((entity) => String(entity.id)) : NO_IDS,\n [deletedEntities]);\n\n // Through a ref, so the view is not redrawn when the handler is.\n const latest = useRef({ onEntityClick, collection, path });\n latest.current = { onEntityClick, collection, path };\n const hasClick = onEntityClick !== undefined;\n const onRowClick = useCallback((row: Record<string, unknown>) => {\n const { onEntityClick, collection, path } = latest.current;\n const id = idOfRow(row, collection);\n if (id === undefined) return;\n onEntityClick?.(entityOfRow(row, id, path, collection) as Entity<M>);\n }, []);\n\n return (\n <Builder\n collection={collection}\n tableController={rowTableController}\n path={path}\n parentCollectionSlugs={parentCollectionSlugs}\n parentEntityIds={parentEntityIds}\n onRowClick={hasClick ? onRowClick : undefined}\n onNewClick={onNewClick}\n canCreate={canCreate}\n selectionController={rowSelectionController}\n selectionEnabled={selectionEnabled}\n highlightedIds={highlightedIds}\n deletedIds={deletedIds}\n emptyComponent={emptyComponent}\n size={size}\n viewMode={viewMode}\n />\n );\n}\n"],"mappings":";;;;AAYA,IAAM,SAAmB,CAAC;;;;;;AA2B1B,SAAgB,eAAkD,EAC9D,SACA,YACA,iBACA,MACA,uBACA,iBACA,eACA,YACA,WACA,qBACA,kBACA,qBACA,iBACA,gBACA,MACA,YACuB;CACvB,MAAM,qBAAqB,kBAAkB,iBAAiB,UAAU;CACxE,MAAM,yBAAyB,sBACzB,sBAAsB,qBAAqB,YAAY,IAAI,IAC3D,KAAA;CACN,MAAM,iBAAiB,cACb,qBAAqB,SAAS,oBAAoB,KAAK,WAAW,OAAO,OAAO,EAAE,CAAC,IAAI,QAC7F,CAAC,mBAAmB,CAAC;CACzB,MAAM,aAAa,cACT,iBAAiB,SAAS,gBAAgB,KAAK,WAAW,OAAO,OAAO,EAAE,CAAC,IAAI,QACrF,CAAC,eAAe,CAAC;CAGrB,MAAM,SAAS,OAAO;EAAE;EAAe;EAAY;CAAK,CAAC;CACzD,OAAO,UAAU;EAAE;EAAe;EAAY;CAAK;CACnD,MAAM,WAAW,kBAAkB,KAAA;CACnC,MAAM,aAAa,aAAa,QAAiC;EAC7D,MAAM,EAAE,eAAe,YAAY,SAAS,OAAO;EACnD,MAAM,KAAK,QAAQ,KAAK,UAAU;EAClC,IAAI,OAAO,KAAA,GAAW;EACtB,gBAAgB,YAAY,KAAK,IAAI,MAAM,UAAU,CAAc;CACvE,GAAG,CAAC,CAAC;CAEL,OACI,oBAAC,SAAD;EACgB;EACZ,iBAAiB;EACX;EACiB;EACN;EACjB,YAAY,WAAW,aAAa,KAAA;EACxB;EACD;EACX,qBAAqB;EACH;EACF;EACJ;EACI;EACV;EACI;CACb,CAAA;AAET"}
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect } from "react";
2
- import { serializeOrderBy } from "@rebasepro/common";
3
2
  import { useData, useDataChangeVersion } from "@rebasepro/app";
3
+ import { serializeOrderBy } from "@rebasepro/common";
4
4
  //#region src/components/CollectionViewBinding/EntitiesCount.tsx
5
5
  /**
6
6
  * Inflight count request deduplication map.
@@ -10,7 +10,7 @@ import { useData, useDataChangeVersion } from "@rebasepro/app";
10
10
  var inflightCountRequests = /* @__PURE__ */ new Map();
11
11
  function EntitiesCount({ path, collection, filter, sortBy, searchString, onCountChange, refreshKey }) {
12
12
  const dataClient = useData();
13
- const changeVersion = useDataChangeVersion(path, !dataClient.collection(path).listenCount);
13
+ const changeVersion = useDataChangeVersion(path, !dataClient.table(path).listenCount);
14
14
  const sortKey = React.useMemo(() => sortBy ? serializeOrderBy(sortBy) ?? "" : "", [sortBy]);
15
15
  const dataClientRef = React.useRef(dataClient);
16
16
  dataClientRef.current = dataClient;
@@ -18,7 +18,7 @@ function EntitiesCount({ path, collection, filter, sortBy, searchString, onCount
18
18
  onCountChangeRef.current = onCountChange;
19
19
  const filterKey = React.useMemo(() => filter ? JSON.stringify(filter) : "", [filter]);
20
20
  useEffect(() => {
21
- const accessor = dataClientRef.current.collection(path);
21
+ const accessor = dataClientRef.current.table(path);
22
22
  if (!accessor.count && !accessor.listenCount) {
23
23
  onCountChangeRef.current?.(void 0);
24
24
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"EntitiesCount.js","names":[],"sources":["../../../src/components/CollectionViewBinding/EntitiesCount.tsx"],"sourcesContent":["import type { OrderByTuple } from \"@rebasepro/types\";\nimport { FilterValues } from \"@rebasepro/types\";\nimport type { AdminCollection } from \"@rebasepro/cms-types\";\nimport { serializeOrderBy } from \"@rebasepro/common\";\nimport React, { useEffect } from \"react\";\nimport { useData, useDataChangeVersion } from \"@rebasepro/app\";\n\n/**\n * Inflight count request deduplication map.\n * Keyed by `path|filterKey|sort|search` so that concurrent\n * callers (e.g. React StrictMode double-mount) share the same promise.\n */\nconst inflightCountRequests = new Map<string, Promise<number>>();\n\nexport function EntitiesCount({\n path,\n collection,\n filter,\n sortBy,\n searchString,\n onCountChange,\n refreshKey\n}: {\n path: string,\n collection: AdminCollection,\n filter?: FilterValues<any>,\n sortBy?: OrderByTuple[],\n /**\n * Required, not optional. The term sits in the same scope as the element\n * that mounts this and is passed to the toolbar and the empty state beside\n * it — it was simply not passed here, so a searched list showed the count\n * of the unsearched collection. A required prop is what stops the next\n * caller doing the same; there is no useful \"count without the search\".\n */\n searchString: string | undefined,\n onCountChange?: (count: number | null | undefined) => void,\n /**\n * Counts again whenever this changes. The count is one read, not a\n * subscription: after a delete the toolbar kept the old total, and \"select\n * all matching\" offered it over the rows that were left.\n */\n refreshKey?: number,\n}) {\n\n const dataClient = useData();\n // A count is one read where the source cannot count live: it is read\n // again on every write to the collection in this `<Rebase>`.\n const changeVersion = useDataChangeVersion(path, !dataClient.collection(path).listenCount);\n\n // The whole sort as one string: it keys the dedup cache and drives the\n // effect, and a `sortBy` array is a new reference on every render.\n const sortKey = React.useMemo(() => sortBy ? serializeOrderBy(sortBy) ?? \"\" : \"\", [sortBy]);\n\n // Use refs for values that should NOT trigger re-fetches\n const dataClientRef = React.useRef(dataClient);\n dataClientRef.current = dataClient;\n const onCountChangeRef = React.useRef(onCountChange);\n onCountChangeRef.current = onCountChange;\n\n // Serialize filter to a stable string to avoid re-fetches on object identity changes\n const filterKey = React.useMemo(() => filter ? JSON.stringify(filter) : \"\", [filter]);\n\n useEffect(() => {\n const accessor = dataClientRef.current.collection(path);\n if (!accessor.count && !accessor.listenCount) {\n onCountChangeRef.current?.(undefined);\n return;\n }\n\n let cancelled = false;\n\n // filterValues is already FilterValues — pass directly\n const whereParams = filter && Object.keys(filter).length > 0 ? filter : undefined;\n const orderByParams = sortBy && sortBy.length > 0\n ? sortBy.map(([field, direction]) => [String(field), direction] as OrderByTuple)\n : undefined;\n\n // Live where the data source can subscribe: the total then follows the\n // rows other people add and remove, not only this view's own deletes,\n // and so does the \"select all N\" offer built on it.\n if (accessor.listenCount) {\n return accessor.listenCount(\n { where: whereParams, searchString },\n (total) => onCountChangeRef.current?.(total),\n (error) => {\n console.warn(\"Error counting\", error);\n onCountChangeRef.current?.(undefined);\n }\n );\n }\n\n // Deduplicate inflight count requests (e.g. React StrictMode double-mount)\n // The search term is part of the query, so it is part of the key. The\n // cache is module-level and outlives an unmount, so a key that omits it\n // does not merely lose precision — it answers one search with a\n // different search's total.\n // The refresh key too: a count still in flight from before a delete\n // must not answer the one asked after it.\n const cacheKey = `${path}|${filterKey}|${sortKey}|${searchString ?? \"\"}|${refreshKey ?? \"\"}|${changeVersion}`;\n let countPromise = inflightCountRequests.get(cacheKey);\n if (!countPromise) {\n countPromise = accessor.count!({\n where: whereParams,\n orderBy: orderByParams,\n searchString\n });\n inflightCountRequests.set(cacheKey, countPromise);\n // Clean up the inflight entry once resolved/rejected\n countPromise.finally(() => inflightCountRequests.delete(cacheKey));\n }\n\n countPromise.then((c) => {\n if (!cancelled) onCountChangeRef.current?.(c);\n }).catch((e) => {\n console.warn(\"Error fetching count\", e);\n if (!cancelled) onCountChangeRef.current?.(undefined);\n });\n\n return () => { cancelled = true; };\n // `filterKey` and `sortKey` ARE `filter` and `sortBy` — the memoized\n // serializations a few lines up, and the only stable identity either\n // has. Both arrive as freshly built objects on every render, so\n // depending on them directly would re-run this effect each time and\n // fire a count request per render. The keys change exactly when the\n // values do, which is the condition this effect actually wants.\n // eslint-disable-next-line react-hooks/exhaustive-deps -- `filterKey` and `sortKey` are `filter` and `sortBy`, serialized\n }, [path, filterKey, sortKey, searchString, refreshKey, changeVersion]);\n\n // The toolbar renders the count; this component only fetches and reports it\n return null;\n}\n"],"mappings":";;;;;;;;;AAYA,IAAM,wCAAwB,IAAI,IAA6B;AAE/D,SAAgB,cAAc,EAC1B,MACA,YACA,QACA,QACA,cACA,eACA,cAqBD;CAEC,MAAM,aAAa,QAAQ;CAG3B,MAAM,gBAAgB,qBAAqB,MAAM,CAAC,WAAW,WAAW,IAAI,CAAC,CAAC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,UAAU,CAAC;EAChD,CAAC,CAAC,CAAC,OAAO,MAAM;GACZ,QAAQ,KAAK,wBAAwB,CAAC;GACtC,IAAI,CAAC,WAAW,iBAAiB,UAAU,KAAA,CAAS;EACxD,CAAC;EAED,aAAa;GAAE,YAAY;EAAM;CAQrC,GAAG;EAAC;EAAM;EAAW;EAAS;EAAc;EAAY;CAAa,CAAC;CAGtE,OAAO;AACX"}
1
+ {"version":3,"file":"EntitiesCount.js","names":[],"sources":["../../../src/components/CollectionViewBinding/EntitiesCount.tsx"],"sourcesContent":["import type { OrderByTuple } from \"@rebasepro/types\";\nimport { FilterValues } from \"@rebasepro/types\";\nimport type { AdminCollection } from \"@rebasepro/cms-types\";\nimport { serializeOrderBy } from \"@rebasepro/common\";\nimport React, { useEffect } from \"react\";\nimport { useData, useDataChangeVersion } from \"@rebasepro/app\";\n\n/**\n * Inflight count request deduplication map.\n * Keyed by `path|filterKey|sort|search` so that concurrent\n * callers (e.g. React StrictMode double-mount) share the same promise.\n */\nconst inflightCountRequests = new Map<string, Promise<number>>();\n\nexport function EntitiesCount({\n path,\n collection,\n filter,\n sortBy,\n searchString,\n onCountChange,\n refreshKey\n}: {\n path: string,\n collection: AdminCollection,\n filter?: FilterValues<any>,\n sortBy?: OrderByTuple[],\n /**\n * Required, not optional. The term sits in the same scope as the element\n * that mounts this and is passed to the toolbar and the empty state beside\n * it — it was simply not passed here, so a searched list showed the count\n * of the unsearched collection. A required prop is what stops the next\n * caller doing the same; there is no useful \"count without the search\".\n */\n searchString: string | undefined,\n onCountChange?: (count: number | null | undefined) => void,\n /**\n * Counts again whenever this changes. The count is one read, not a\n * subscription: after a delete the toolbar kept the old total, and \"select\n * all matching\" offered it over the rows that were left.\n */\n refreshKey?: number,\n}) {\n\n const dataClient = useData();\n // A count is one read where the source cannot count live: it is read\n // again on every write to the collection in this `<Rebase>`.\n const changeVersion = useDataChangeVersion(path, !dataClient.table(path).listenCount);\n\n // The whole sort as one string: it keys the dedup cache and drives the\n // effect, and a `sortBy` array is a new reference on every render.\n const sortKey = React.useMemo(() => sortBy ? serializeOrderBy(sortBy) ?? \"\" : \"\", [sortBy]);\n\n // Use refs for values that should NOT trigger re-fetches\n const dataClientRef = React.useRef(dataClient);\n dataClientRef.current = dataClient;\n const onCountChangeRef = React.useRef(onCountChange);\n onCountChangeRef.current = onCountChange;\n\n // Serialize filter to a stable string to avoid re-fetches on object identity changes\n const filterKey = React.useMemo(() => filter ? JSON.stringify(filter) : \"\", [filter]);\n\n useEffect(() => {\n const accessor = dataClientRef.current.table(path);\n if (!accessor.count && !accessor.listenCount) {\n onCountChangeRef.current?.(undefined);\n return;\n }\n\n let cancelled = false;\n\n // filterValues is already FilterValues — pass directly\n const whereParams = filter && Object.keys(filter).length > 0 ? filter : undefined;\n const orderByParams = sortBy && sortBy.length > 0\n ? sortBy.map(([field, direction]) => [String(field), direction] as OrderByTuple)\n : undefined;\n\n // Live where the data source can subscribe: the total then follows the\n // rows other people add and remove, not only this view's own deletes,\n // and so does the \"select all N\" offer built on it.\n if (accessor.listenCount) {\n return accessor.listenCount(\n { where: whereParams, searchString },\n (total) => onCountChangeRef.current?.(total),\n (error) => {\n console.warn(\"Error counting\", error);\n onCountChangeRef.current?.(undefined);\n }\n );\n }\n\n // Deduplicate inflight count requests (e.g. React StrictMode double-mount)\n // The search term is part of the query, so it is part of the key. The\n // cache is module-level and outlives an unmount, so a key that omits it\n // does not merely lose precision — it answers one search with a\n // different search's total.\n // The refresh key too: a count still in flight from before a delete\n // must not answer the one asked after it.\n const cacheKey = `${path}|${filterKey}|${sortKey}|${searchString ?? \"\"}|${refreshKey ?? \"\"}|${changeVersion}`;\n let countPromise = inflightCountRequests.get(cacheKey);\n if (!countPromise) {\n countPromise = accessor.count!({\n where: whereParams,\n orderBy: orderByParams,\n searchString\n });\n inflightCountRequests.set(cacheKey, countPromise);\n // Clean up the inflight entry once resolved/rejected\n countPromise.finally(() => inflightCountRequests.delete(cacheKey));\n }\n\n countPromise.then((c) => {\n if (!cancelled) onCountChangeRef.current?.(c);\n }).catch((e) => {\n console.warn(\"Error fetching count\", e);\n if (!cancelled) onCountChangeRef.current?.(undefined);\n });\n\n return () => { cancelled = true; };\n // `filterKey` and `sortKey` ARE `filter` and `sortBy` — the memoized\n // serializations a few lines up, and the only stable identity either\n // has. Both arrive as freshly built objects on every render, so\n // depending on them directly would re-run this effect each time and\n // fire a count request per render. The keys change exactly when the\n // values do, which is the condition this effect actually wants.\n // eslint-disable-next-line react-hooks/exhaustive-deps -- `filterKey` and `sortKey` are `filter` and `sortBy`, serialized\n }, [path, filterKey, sortKey, searchString, refreshKey, changeVersion]);\n\n // The toolbar renders the count; this component only fetches and reports it\n return null;\n}\n"],"mappings":";;;;;;;;;AAYA,IAAM,wCAAwB,IAAI,IAA6B;AAE/D,SAAgB,cAAc,EAC1B,MACA,YACA,QACA,QACA,cACA,eACA,cAqBD;CAEC,MAAM,aAAa,QAAQ;CAG3B,MAAM,gBAAgB,qBAAqB,MAAM,CAAC,WAAW,MAAM,IAAI,CAAC,CAAC,WAAW;CAIpF,MAAM,UAAU,MAAM,cAAc,SAAS,iBAAiB,MAAM,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC;CAG1F,MAAM,gBAAgB,MAAM,OAAO,UAAU;CAC7C,cAAc,UAAU;CACxB,MAAM,mBAAmB,MAAM,OAAO,aAAa;CACnD,iBAAiB,UAAU;CAG3B,MAAM,YAAY,MAAM,cAAc,SAAS,KAAK,UAAU,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;CAEpF,gBAAgB;EACZ,MAAM,WAAW,cAAc,QAAQ,MAAM,IAAI;EACjD,IAAI,CAAC,SAAS,SAAS,CAAC,SAAS,aAAa;GAC1C,iBAAiB,UAAU,KAAA,CAAS;GACpC;EACJ;EAEA,IAAI,YAAY;EAGhB,MAAM,cAAc,UAAU,OAAO,KAAK,MAAM,CAAC,CAAC,SAAS,IAAI,SAAS,KAAA;EACxE,MAAM,gBAAgB,UAAU,OAAO,SAAS,IAC1C,OAAO,KAAK,CAAC,OAAO,eAAe,CAAC,OAAO,KAAK,GAAG,SAAS,CAAiB,IAC7E,KAAA;EAKN,IAAI,SAAS,aACT,OAAO,SAAS,YACZ;GAAE,OAAO;GAAa;EAAa,IAClC,UAAU,iBAAiB,UAAU,KAAK,IAC1C,UAAU;GACP,QAAQ,KAAK,kBAAkB,KAAK;GACpC,iBAAiB,UAAU,KAAA,CAAS;EACxC,CACJ;EAUJ,MAAM,WAAW,GAAG,KAAK,GAAG,UAAU,GAAG,QAAQ,GAAG,gBAAgB,GAAG,GAAG,cAAc,GAAG,GAAG;EAC9F,IAAI,eAAe,sBAAsB,IAAI,QAAQ;EACrD,IAAI,CAAC,cAAc;GACf,eAAe,SAAS,MAAO;IAC3B,OAAO;IACP,SAAS;IACT;GACJ,CAAC;GACD,sBAAsB,IAAI,UAAU,YAAY;GAEhD,aAAa,cAAc,sBAAsB,OAAO,QAAQ,CAAC;EACrE;EAEA,aAAa,MAAM,MAAM;GACrB,IAAI,CAAC,WAAW,iBAAiB,UAAU,CAAC;EAChD,CAAC,CAAC,CAAC,OAAO,MAAM;GACZ,QAAQ,KAAK,wBAAwB,CAAC;GACtC,IAAI,CAAC,WAAW,iBAAiB,UAAU,KAAA,CAAS;EACxD,CAAC;EAED,aAAa;GAAE,YAAY;EAAM;CAQrC,GAAG;EAAC;EAAM;EAAW;EAAS;EAAc;EAAY;CAAa,CAAC;CAGtE,OAAO;AACX"}
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
- import { Entity } from "@rebasepro/types";
3
- import { CollectionSize, AdminCollection } from "@rebasepro/cms-types";
2
+ import { CollectionSize, AdminCollection, Entity } from "@rebasepro/cms-types";
4
3
  export type EntityCardBindingProps<M extends Record<string, unknown> = Record<string, unknown>> = {
5
4
  /** The active search, so a card can mark the hit and say where it was. */
6
5
  searchString?: string;
@@ -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, 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 * a cast of `onClick` to `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-well border-b border-hairline p-3 [&_img]:!object-contain\">\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":";;;;;;;;;;;;;AA2DA,SAAgB,kBAA+E,EAC3F,QACA,YACA,SACA,UACA,aACA,mBACA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GAAG,KAAK,IAM9B,CACT,CACJ,GACA,MAAM,UAAU,MAAK,MAAK,EAAE,aAAa,EAAE,MAAM,MAAM,KACpD,qBAAC,QAAD;MAAM,WAAU;gBAAhB,CAA8E,KACxE,MAAM,UAAU,QAAQ,KAAK,MAAM,MAAM,KAAK,IAAI,GAAG,EAAE,aAAa,EAAE,MAAM,MAAM,GAAG,CAAC,CACtF;OAET;;KAIP,MAAM,UAAU,MAAM,SACpB,qBAAC,OAAD;KAAK,WAAU;eAAf,CACK,MAAM,UAAU,oBAAC,WAAD;MAAW,MAAM,MAAM;MAAQ,MAAK;KAAQ,CAAA,GAC5D,MAAM,QAAQ,oBAAC,UAAD,EAAU,MAAM,MAAM,KAAM,CAAA,CAC1C;;IAMR,MAAM,QACH,oBAAC,OAAD;KAAK,WAAU;eACV,MAAM,KAAK;IACX,CAAA;GAER;IACH;;AAEd"}
1
+ {"version":3,"file":"EntityCardBinding.js","names":[],"sources":["../../../src/components/CollectionViewBinding/EntityCardBinding.tsx"],"sourcesContent":["\nimport React, { useMemo } from \"react\";\nimport { CollectionSize, AdminCollection, Entity } 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 * a cast of `onClick` to `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-well border-b border-hairline p-3 [&_img]:!object-contain\">\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":";;;;;;;;;;;;;AA0DA,SAAgB,kBAA+E,EAC3F,QACA,YACA,SACA,UACA,aACA,mBACA,kBACA,OAAO,KACP,cACA,iBAC0B;CAC1B,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,iBAAiB,kBAAkB;CACzC,MAAM,sBAAsB,uBAAuB;CAGnD,MAAM,WAAW,sBACb,YACA,gBAJ4B,2BAK5B,CAAA,CAAwB,eAC5B;CAEA,MAAM,QAAQ,eACV,QACA,YACA,QACJ;CACA,MAAM,aAAa,cAAc,SAAS,QAAQ;CAIlD,MAAM,EAAE,OAAO,YAAY,qBACvB,QACA,WAAW,YACX,CAAC,SAAS,UAAU,SAAS,WAAW,GACxC,YACJ;CAKA,MAAM,eAAe,MAAyB;EAE1C,IAAI,MAAM,EAAE,WAAW,EAAE,YAAY,kBAAkB;GACnD,EAAE,eAAe;GACjB,oBAAoB,QAAQ,CAAC,QAAQ;GACrC;EACJ;EACA,IAAI,SAAS;GACT,oBAAoB,mBAAmB,0BAA0B;IAC7D,MAAM,OAAO;IACb,UAAU,OAAO;GACrB,CAAC;GACD,QAAQ,QAAQ,CAAC;EACrB;CACJ;CAE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U;kBACjC,OAAO;OACA,CAAA;MAEf,CAAA;MACJ,gBAAgB,MAAM;KACtB;;IAKJ,UACG,oBAAC,kBAAD;KACI,OAAO;KACP,OAAO,WAAW,WAAW,YAAuC,QAAQ,KAAK;IACpF,CAAA,IACD,MAAM,YACN,oBAAC,OAAD;KAAK,WAAU;eACV,MAAM,SAAS,KAAK,OAAO,MAAM,SAAS,UAAU,WAC/C,oBAAC,aAAD;MAAa,MAAM,MAAM,SAAS;MAAc;KAAO,CAAA,IACvD,oBAAC,WAAD;MAAW,MAAM,MAAM;MAAU,MAAK;KAAQ,CAAA;IACnD,CAAA;IAIR,MAAM,UAAU,SAAS,KACtB,qBAAC,OAAD;KAAK,WAAU;eAAf,CACK,MAAM,UAAU,KAAK,QAClB,IAAI,MAAM,KAAK,SACX,oBAAC,MAAD;MAEI,MAAK;MACL,aAAa,IAAI;MACjB,WAAU;gBAET,KAAK;KACJ,GANG,GAAG,IAAI,YAAY,GAAG,KAAK,IAM9B,CACT,CACJ,GACA,MAAM,UAAU,MAAK,MAAK,EAAE,aAAa,EAAE,MAAM,MAAM,KACpD,qBAAC,QAAD;MAAM,WAAU;gBAAhB,CAA8E,KACxE,MAAM,UAAU,QAAQ,KAAK,MAAM,MAAM,KAAK,IAAI,GAAG,EAAE,aAAa,EAAE,MAAM,MAAM,GAAG,CAAC,CACtF;OAET;;KAIP,MAAM,UAAU,MAAM,SACpB,qBAAC,OAAD;KAAK,WAAU;eAAf,CACK,MAAM,UAAU,oBAAC,WAAD;MAAW,MAAM,MAAM;MAAQ,MAAK;KAAQ,CAAA,GAC5D,MAAM,QAAQ,oBAAC,UAAD,EAAU,MAAM,MAAM,KAAM,CAAA,CAC1C;;IAMR,MAAM,QACH,oBAAC,OAAD;KAAK,WAAU;eACV,MAAM,KAAK;IACX,CAAA;GAER;IACH;;AAEd"}
@@ -6,8 +6,8 @@ import { navigateToEntity } from "../../util/navigation_utils.js";
6
6
  import React from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  import { ArrowRightToLineIcon, Button, IconButton, Popover, SearchIcon, TextField, Tooltip, cls, focusedDisabled, iconSize } from "@rebasepro/ui";
9
+ import { EntityReference } from "@rebasepro/cms-types";
9
10
  import { useTranslation } from "@rebasepro/app";
10
- import { EntityReference } from "@rebasepro/types";
11
11
  //#region src/components/CollectionViewBinding/EntityIdHeaderWidget.tsx
12
12
  /**
13
13
  * The ID column's header control: find a record by its id, or reopen one of
@@ -1 +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,gB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AS,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"}
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/cms-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,g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