@rebasepro/admin 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/dist/CollectionEditorDialog-jA-PLh6N.js +3549 -0
  2. package/dist/CollectionEditorDialog-jA-PLh6N.js.map +1 -0
  3. package/dist/CollectionsStudioView-UKouBPOm.js +170 -0
  4. package/dist/CollectionsStudioView-UKouBPOm.js.map +1 -0
  5. package/dist/PropertyEditView-DEUddmg_.js +3660 -0
  6. package/dist/PropertyEditView-DEUddmg_.js.map +1 -0
  7. package/dist/collection_editor/ConfigControllerProvider.d.ts +2 -2
  8. package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -1
  9. package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +2 -1
  10. package/dist/collection_editor/ui/EditorCollectionAction.d.ts +1 -1
  11. package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +1 -1
  12. package/dist/collection_editor/ui/EditorEntityAction.d.ts +1 -1
  13. package/dist/collection_editor/ui/HomePageEditorCollectionAction.d.ts +1 -1
  14. package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -1
  15. package/dist/collection_editor/ui/MissingReferenceWidget.d.ts +1 -1
  16. package/dist/collection_editor/ui/NewCollectionButton.d.ts +1 -1
  17. package/dist/collection_editor/ui/NewCollectionCard.d.ts +1 -1
  18. package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +1 -1
  19. package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +1 -1
  20. package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.d.ts +1 -1
  21. package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +2 -1
  22. package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +2 -2
  23. package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
  24. package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +2 -1
  25. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +1 -1
  26. package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.d.ts +2 -1
  27. package/dist/collection_editor/ui/collection_editor/CollectionRelationsTab.d.ts +2 -1
  28. package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +2 -1
  29. package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.d.ts +1 -9
  30. package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +2 -1
  31. package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.d.ts +2 -1
  32. package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +2 -1
  33. package/dist/collection_editor/ui/collection_editor/EntityActionsSelectDialog.d.ts +2 -1
  34. package/dist/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.d.ts +2 -1
  35. package/dist/collection_editor/ui/collection_editor/EnumForm.d.ts +2 -1
  36. package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +2 -1
  37. package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +2 -1
  38. package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.d.ts +2 -1
  39. package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +1 -1
  40. package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +4 -4
  41. package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.d.ts +2 -2
  42. package/dist/collection_editor/ui/collection_editor/PropertyTree.d.ts +2 -2
  43. package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +2 -1
  44. package/dist/collection_editor/ui/collection_editor/SwitchControl.d.ts +2 -1
  45. package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.d.ts +1 -1
  46. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.d.ts +1 -1
  47. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +3 -2
  48. package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.d.ts +2 -1
  49. package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.d.ts +2 -1
  50. package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.d.ts +2 -1
  51. package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.d.ts +2 -1
  52. package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.d.ts +2 -1
  53. package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.d.ts +2 -1
  54. package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.d.ts +2 -1
  55. package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.d.ts +2 -1
  56. package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.d.ts +3 -2
  57. package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.d.ts +2 -1
  58. package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.d.ts +2 -1
  59. package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.d.ts +2 -1
  60. package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.d.ts +2 -1
  61. package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.d.ts +2 -1
  62. package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.d.ts +2 -1
  63. package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +2 -1
  64. package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.d.ts +2 -1
  65. package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.d.ts +1 -1
  66. package/dist/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.d.ts +2 -1
  67. package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +2 -1
  68. package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +2 -1
  69. package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.d.ts +2 -1
  70. package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +2 -1
  71. package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.d.ts +1 -1
  72. package/dist/collection_editor_ui.js +4 -11
  73. package/dist/components/ArrayContainer.d.ts +3 -3
  74. package/dist/components/ClearFilterSortButton.d.ts +1 -1
  75. package/dist/components/CollectionEditorDialogs.d.ts +2 -1
  76. package/dist/components/CollectionPanel.d.ts +2 -27
  77. package/dist/components/DefaultAppBar.d.ts +1 -1
  78. package/dist/components/DefaultDrawer.d.ts +4 -4
  79. package/dist/components/DeleteEntityDialog.d.ts +2 -1
  80. package/dist/components/DrawerNavigationGroup.d.ts +1 -1
  81. package/dist/components/DrawerNavigationItem.d.ts +1 -1
  82. package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +1 -1
  83. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -1
  84. package/dist/components/EntityCollectionTable/fields/TableMultipleRelationField.d.ts +3 -3
  85. package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +3 -3
  86. package/dist/components/EntityCollectionTable/fields/TableRelationField.d.ts +3 -3
  87. package/dist/components/EntityCollectionTable/fields/TableRelationSelectorField.d.ts +2 -1
  88. package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
  89. package/dist/components/EntityCollectionTable/fields/VirtualTableDateField.d.ts +1 -1
  90. package/dist/components/EntityCollectionTable/fields/VirtualTableInput.d.ts +2 -1
  91. package/dist/components/EntityCollectionTable/fields/VirtualTableNumberInput.d.ts +2 -1
  92. package/dist/components/EntityCollectionTable/fields/VirtualTableSelect.d.ts +1 -1
  93. package/dist/components/EntityCollectionTable/fields/VirtualTableSwitch.d.ts +2 -1
  94. package/dist/components/EntityCollectionTable/fields/VirtualTableUserSelect.d.ts +1 -1
  95. package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +1 -1
  96. package/dist/components/EntityCollectionTable/internal/EntityTableCellActions.d.ts +1 -1
  97. package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +4 -3
  98. package/dist/components/EntityCollectionView/Board.d.ts +2 -1
  99. package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +1 -1
  100. package/dist/components/EntityCollectionView/BoardSortableList.d.ts +1 -1
  101. package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +1 -1
  102. package/dist/components/EntityCollectionView/EntityCard.d.ts +2 -1
  103. package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +1 -1
  104. package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +1 -1
  105. package/dist/components/EntityCollectionView/EntityCollectionListView.d.ts +1 -1
  106. package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +0 -24
  107. package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +1 -1
  108. package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +2 -1
  109. package/dist/components/EntityCollectionView/FilterPresetsButton.d.ts +2 -1
  110. package/dist/components/EntityCollectionView/FiltersDialog.d.ts +2 -1
  111. package/dist/components/EntityCollectionView/SplitListView.d.ts +1 -1
  112. package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +2 -1
  113. package/dist/components/EntityDetailView.d.ts +1 -1
  114. package/dist/components/EntityEditView.d.ts +2 -2
  115. package/dist/components/EntityEditViewFormActions.d.ts +2 -1
  116. package/dist/components/EntityJsonPreview.d.ts +2 -1
  117. package/dist/components/EntityPreview.d.ts +3 -3
  118. package/dist/components/EntitySidePanel.d.ts +2 -1
  119. package/dist/components/EntityView.d.ts +2 -1
  120. package/dist/components/FieldCaption.d.ts +1 -1
  121. package/dist/components/HomePage/ContentHomePage.d.ts +1 -1
  122. package/dist/components/HomePage/FavouritesView.d.ts +1 -1
  123. package/dist/components/HomePage/HomePageDnD.d.ts +4 -4
  124. package/dist/components/HomePage/NavigationCard.d.ts +1 -1
  125. package/dist/components/HomePage/NavigationCardBinding.d.ts +2 -1
  126. package/dist/components/HomePage/NavigationGroup.d.ts +2 -2
  127. package/dist/components/HomePage/RenameGroupDialog.d.ts +2 -1
  128. package/dist/components/HomePage/SmallNavigationCard.d.ts +1 -1
  129. package/dist/components/PropertyCollectionView.d.ts +2 -1
  130. package/dist/components/PropertyIdCopyTooltip.d.ts +2 -2
  131. package/dist/components/RebaseAuthGate.d.ts +1 -1
  132. package/dist/components/RebaseLayout.d.ts +1 -1
  133. package/dist/components/RebaseNavigation.d.ts +1 -1
  134. package/dist/components/RebaseRouteDefs.d.ts +1 -1
  135. package/dist/components/RebaseShell.d.ts +1 -1
  136. package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +1 -1
  137. package/dist/components/ReferenceWidget.d.ts +2 -1
  138. package/dist/components/SearchIconsView.d.ts +2 -1
  139. package/dist/components/SelectableTable/SelectableTable.d.ts +2 -2
  140. package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -1
  141. package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
  142. package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -1
  143. package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +2 -1
  144. package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -1
  145. package/dist/components/SideDialogs.d.ts +1 -1
  146. package/dist/components/SideEntityProvider.d.ts +1 -1
  147. package/dist/components/admin/CreationResultDialog.d.ts +2 -1
  148. package/dist/components/app/AppBar.d.ts +1 -1
  149. package/dist/components/app/Drawer.d.ts +1 -1
  150. package/dist/components/common/default_entity_actions.d.ts +2 -1
  151. package/dist/components/history/EntityHistoryEntry.d.ts +1 -1
  152. package/dist/components/history/EntityHistoryView.d.ts +1 -1
  153. package/dist/components/history/LastEditedByFormAction.d.ts +2 -1
  154. package/dist/components/history/LastEditedByIndicator.d.ts +2 -1
  155. package/dist/components/history/UserChip.d.ts +1 -1
  156. package/dist/data_export/export/BasicExportAction.d.ts +2 -1
  157. package/dist/data_export/export/ExportCollectionAction.d.ts +1 -1
  158. package/dist/data_import/components/DataNewPropertiesMapping.d.ts +1 -1
  159. package/dist/data_import/components/ImportFileUpload.d.ts +1 -1
  160. package/dist/data_import/components/ImportNewPropertyFieldPreview.d.ts +2 -1
  161. package/dist/data_import/components/ImportSaveInProgress.d.ts +1 -1
  162. package/dist/data_import/import/ImportCollectionAction.d.ts +4 -3
  163. package/dist/editor/components/SlashCommandMenu.d.ts +2 -1
  164. package/dist/editor/editor.d.ts +1 -1
  165. package/dist/editor/selectors/color-selector.d.ts +1 -1
  166. package/dist/editor/selectors/link-selector.d.ts +1 -1
  167. package/dist/editor/selectors/node-selector.d.ts +1 -1
  168. package/dist/editor/selectors/text-buttons.d.ts +1 -1
  169. package/dist/editor.js +2621 -3574
  170. package/dist/editor.js.map +1 -1
  171. package/dist/form/EntityForm.d.ts +2 -1
  172. package/dist/form/EntityFormActions.d.ts +2 -1
  173. package/dist/form/components/FieldHelperText.d.ts +1 -1
  174. package/dist/form/components/FormEntry.d.ts +1 -1
  175. package/dist/form/components/FormLayout.d.ts +1 -1
  176. package/dist/form/components/LabelWithIconAndTooltip.d.ts +1 -1
  177. package/dist/form/components/LocalChangesMenu.d.ts +2 -1
  178. package/dist/form/components/StorageItemPreview.d.ts +2 -1
  179. package/dist/form/components/StorageUploadProgress.d.ts +2 -1
  180. package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +2 -1
  181. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +2 -1
  182. package/dist/form/field_bindings/BlockFieldBinding.d.ts +2 -1
  183. package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +2 -1
  184. package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +2 -1
  185. package/dist/form/field_bindings/MapFieldBinding.d.ts +2 -1
  186. package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +2 -1
  187. package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +2 -1
  188. package/dist/form/field_bindings/MultipleRelationFieldBinding.d.ts +2 -1
  189. package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +2 -1
  190. package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +2 -1
  191. package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +2 -1
  192. package/dist/form/field_bindings/RelationFieldBinding.d.ts +2 -1
  193. package/dist/form/field_bindings/RepeatFieldBinding.d.ts +2 -1
  194. package/dist/form/field_bindings/SelectFieldBinding.d.ts +2 -1
  195. package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +3 -2
  196. package/dist/form/field_bindings/SwitchFieldBinding.d.ts +2 -1
  197. package/dist/form/field_bindings/TextFieldBinding.d.ts +2 -1
  198. package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +2 -1
  199. package/dist/form/field_bindings/VectorFieldBinding.d.ts +2 -1
  200. package/dist/history-BL49TIDb.js +311 -0
  201. package/dist/history-BL49TIDb.js.map +1 -0
  202. package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +0 -2
  203. package/dist/hooks/navigation/useNavigationResolution.d.ts +5 -6
  204. package/dist/hooks/navigation/useResolvedCollections.d.ts +0 -2
  205. package/dist/hooks/useBreadcrumbsController.d.ts +2 -32
  206. package/dist/index.js +2 -3393
  207. package/dist/markdown-CklalUUk.js +526 -0
  208. package/dist/markdown-CklalUUk.js.map +1 -0
  209. package/dist/preview/components/ArrayEnumPreview.d.ts +2 -1
  210. package/dist/preview/components/EmptyValue.d.ts +2 -1
  211. package/dist/preview/components/EnumValuesChip.d.ts +1 -1
  212. package/dist/preview/components/ImagePreview.d.ts +2 -1
  213. package/dist/preview/components/ReferencePreview.d.ts +2 -1
  214. package/dist/preview/components/RelationPreview.d.ts +2 -1
  215. package/dist/preview/components/StorageThumbnail.d.ts +1 -1
  216. package/dist/preview/components/UserPreview.d.ts +6 -3
  217. package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +2 -1
  218. package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +1 -1
  219. package/dist/preview/property_previews/ArrayOfRelationsPreview.d.ts +1 -1
  220. package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +2 -1
  221. package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +2 -1
  222. package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +2 -1
  223. package/dist/preview/property_previews/ArrayPropertyEnumPreview.d.ts +1 -1
  224. package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +2 -1
  225. package/dist/preview/property_previews/MapPropertyPreview.d.ts +3 -2
  226. package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +5 -4
  227. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  228. package/dist/routes/RebaseRoute.d.ts +1 -1
  229. package/dist/src-BJ8fkM8y.js +24010 -0
  230. package/dist/src-BJ8fkM8y.js.map +1 -0
  231. package/dist/types/components/PropertyPreviewProps.d.ts +4 -0
  232. package/dist/types/components/formex.d.ts +1 -40
  233. package/dist/types/fields.d.ts +9 -1
  234. package/dist/util/navigation_utils.d.ts +2 -1
  235. package/dist/util/previews.d.ts +5 -0
  236. package/dist/util/property_utils.d.ts +1 -1
  237. package/package.json +29 -26
  238. package/src/collection_editor/ConfigControllerProvider.tsx +10 -7
  239. package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +2 -1
  240. package/src/collection_editor/ui/EditorCollectionAction.tsx +2 -1
  241. package/src/collection_editor/ui/EditorCollectionActionStart.tsx +2 -1
  242. package/src/collection_editor/ui/EditorEntityAction.tsx +2 -1
  243. package/src/collection_editor/ui/KanbanSetupAction.tsx +2 -1
  244. package/src/collection_editor/ui/MissingReferenceWidget.tsx +2 -1
  245. package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +2 -1
  246. package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +2 -3
  247. package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +0 -1
  248. package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +8 -4
  249. package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +2 -1
  250. package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +1 -1
  251. package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +5 -2
  252. package/src/collection_editor/useLocalCollectionsConfigController.tsx +7 -2
  253. package/src/collection_editor/validateCollectionJson.ts +2 -2
  254. package/src/components/CollectionPanel.tsx +51 -25
  255. package/src/components/DefaultAppBar.tsx +1 -2
  256. package/src/components/DefaultDrawer.tsx +3 -2
  257. package/src/components/DrawerNavigationGroup.tsx +3 -2
  258. package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +30 -9
  259. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +1 -1
  260. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -0
  261. package/src/components/EntityCollectionView/Board.tsx +10 -8
  262. package/src/components/EntityCollectionView/BoardSortableList.tsx +2 -2
  263. package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +4 -2
  264. package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +14 -4
  265. package/src/components/EntityCollectionView/EntityCollectionListView.tsx +48 -26
  266. package/src/components/EntityCollectionView/EntityCollectionView.tsx +146 -73
  267. package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +2 -1
  268. package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +3 -2
  269. package/src/components/EntityCollectionView/FilterPresetsButton.tsx +4 -2
  270. package/src/components/EntityCollectionView/ViewModeToggle.tsx +0 -1
  271. package/src/components/EntityCollectionView/useBoardDataController.tsx +17 -15
  272. package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +29 -19
  273. package/src/components/EntityDetailView.tsx +66 -30
  274. package/src/components/EntityEditView.tsx +70 -32
  275. package/src/components/EntitySidePanel.tsx +6 -3
  276. package/src/components/HomePage/ContentHomePage.tsx +3 -3
  277. package/src/components/HomePage/NavigationCard.tsx +5 -5
  278. package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
  279. package/src/components/RebaseLayout.tsx +5 -2
  280. package/src/components/RebaseNavigation.tsx +1 -4
  281. package/src/components/RebaseRouteDefs.tsx +5 -3
  282. package/src/components/SearchIconsView.tsx +1 -1
  283. package/src/components/SelectableTable/SelectableTable.tsx +2 -3
  284. package/src/components/SelectableTable/SelectionStore.ts +9 -3
  285. package/src/components/UserSelector.tsx +92 -2
  286. package/src/components/common/default_entity_actions.tsx +23 -6
  287. package/src/components/field_configs.tsx +6 -3
  288. package/src/editor/editor.tsx +1 -1
  289. package/src/editor/extensions/Image/index.ts +2 -2
  290. package/src/editor/extensions/Image.ts +2 -2
  291. package/src/editor/extensions/clipboard.ts +2 -2
  292. package/src/editor/markdown-it-plugins.d.ts +24 -0
  293. package/src/editor/markdown.ts +2 -3
  294. package/src/form/EntityForm.tsx +21 -15
  295. package/src/form/field_bindings/MapFieldBinding.tsx +3 -3
  296. package/src/form/field_bindings/VectorFieldBinding.tsx +3 -3
  297. package/src/form/validation.ts +17 -15
  298. package/src/hooks/navigation/useBuildNavigationStateController.tsx +3 -6
  299. package/src/hooks/navigation/useNavigationResolution.ts +143 -19
  300. package/src/hooks/navigation/useResolvedCollections.ts +4 -6
  301. package/src/hooks/useBreadcrumbsController.tsx +2 -34
  302. package/src/hooks/useBuildSideEntityController.tsx +25 -3
  303. package/src/preview/PropertyPreview.tsx +6 -2
  304. package/src/preview/components/ReferencePreview.tsx +64 -13
  305. package/src/preview/components/RelationPreview.tsx +101 -13
  306. package/src/preview/components/UserPreview.tsx +5 -14
  307. package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -1
  308. package/src/routes/RebaseRoute.tsx +5 -4
  309. package/src/types/components/PropertyPreviewProps.tsx +5 -0
  310. package/src/types/components/formex.tsx +1 -45
  311. package/src/types/fields.tsx +10 -1
  312. package/src/util/navigation_utils.ts +14 -4
  313. package/src/util/previews.ts +101 -4
  314. package/dist/CollectionEditorDialog-C8E440oK.js +0 -4574
  315. package/dist/CollectionEditorDialog-C8E440oK.js.map +0 -1
  316. package/dist/CollectionsStudioView-Brr_b06v.js +0 -217
  317. package/dist/CollectionsStudioView-Brr_b06v.js.map +0 -1
  318. package/dist/ExportCollectionAction-D3TTYXrq.js +0 -446
  319. package/dist/ExportCollectionAction-D3TTYXrq.js.map +0 -1
  320. package/dist/ImportCollectionAction-Dn7lya6E.js +0 -685
  321. package/dist/ImportCollectionAction-Dn7lya6E.js.map +0 -1
  322. package/dist/PropertyEditView-ChBleIbN.js +0 -8197
  323. package/dist/PropertyEditView-ChBleIbN.js.map +0 -1
  324. package/dist/collection_editor_ui.js.map +0 -1
  325. package/dist/index-D3S9x_RP.js +0 -462
  326. package/dist/index-D3S9x_RP.js.map +0 -1
  327. package/dist/index-D9RNzm01.js +0 -12
  328. package/dist/index-D9RNzm01.js.map +0 -1
  329. package/dist/index-DrrT332R.js +0 -8
  330. package/dist/index-DrrT332R.js.map +0 -1
  331. package/dist/index.js.map +0 -1
  332. package/dist/markdown-DD2JDU1X.js +0 -618
  333. package/dist/markdown-DD2JDU1X.js.map +0 -1
  334. package/dist/useEntityHistory-UVsSclfZ.js +0 -123
  335. package/dist/useEntityHistory-UVsSclfZ.js.map +0 -1
  336. package/dist/util-COYYD8zr.js +0 -30474
  337. package/dist/util-COYYD8zr.js.map +0 -1
@@ -2,10 +2,11 @@
2
2
  import type { AdditionalFieldDelegate, EntityCollection } from "@rebasepro/types";
3
3
  import type { EntityAction, Property } from "@rebasepro/types";
4
4
  import React, { useCallback, useEffect, useMemo, useState } from "react";
5
+ import { useSearchParams } from "react-router-dom";
5
6
 
6
7
  import { deepEqual as equal } from "fast-equals"
7
8
 
8
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- used as fallback for many array types
9
+
9
10
  const EMPTY_ARRAY: any[] = [];
10
11
  const DEFAULT_ENTITY_OPEN_MODE = "split";
11
12
 
@@ -31,7 +32,9 @@ import {
31
32
  usePermissions,
32
33
  useTranslation,
33
34
  useSlot,
34
- IconForView
35
+ IconForView,
36
+ useComponentOverride,
37
+ CollectionComponentOverrideProvider
35
38
  } from "@rebasepro/core";
36
39
  import { useUserConfigurationPersistence } from "@rebasepro/core";
37
40
  import { EntityCollectionViewActions } from "./EntityCollectionViewActions";
@@ -40,7 +43,7 @@ import { EntityCollectionListView } from "./EntityCollectionListView";
40
43
  import { SplitListView } from "./SplitListView";
41
44
  import { EntityCollectionBoardView } from "./EntityCollectionBoardView";
42
45
  import { ViewModeToggle, KanbanPropertyOption } from "./ViewModeToggle";
43
- import { Button, cls, focusedDisabled, IconButton, Markdown, Popover, Skeleton, TextField, Tooltip, Typography, VirtualTableColumn , iconSize } from "@rebasepro/ui";
46
+ import { Button, cls, focusedDisabled, IconButton, Markdown, Popover, Skeleton, TextField, Tooltip, Typography, VirtualTableColumn, iconSize } from "@rebasepro/ui";
44
47
  import { ArrowRightToLineIcon, ErrorBoundary, PlusIcon, SearchIcon } from "@rebasepro/ui";
45
48
  import { setIn } from "@rebasepro/formex";
46
49
  import { getSubcollectionColumnId } from "../EntityCollectionTable/internal/common";
@@ -141,8 +144,8 @@ export type EntityCollectionViewProps<M extends Record<string, unknown>> = {
141
144
 
142
145
  * @group Components
143
146
  */
144
- export const EntityCollectionView = React.memo(
145
- function EntityCollectionView<M extends Record<string, unknown>>({
147
+ const EntityCollectionViewInner = React.memo(
148
+ function EntityCollectionViewInner<M extends Record<string, unknown>>({
146
149
  path: pathProp,
147
150
 
148
151
  parentCollectionSlugs, parentEntityIds,
@@ -227,16 +230,16 @@ export const EntityCollectionView = React.memo(
227
230
 
228
231
  // View mode priority: URL > saved user config > collection.defaultViewMode
229
232
  const defaultViewMode = collection.defaultViewMode ?? "list";
233
+ const [searchParams, setSearchParams] = useSearchParams();
230
234
 
231
- // Parse view from URL
232
- const getViewFromUrl = useCallback((): ViewMode | null => {
233
- const params = new URLSearchParams(window.location.search);
234
- const urlView = params.get("__view");
235
- if (urlView && ["list", "table", "kanban", "cards"].includes(urlView)) {
236
- return urlView as ViewMode;
235
+ // Read view from React Router's searchParams (reactive on back/forward)
236
+ const urlView = useMemo((): ViewMode | null => {
237
+ const v = searchParams.get("__view");
238
+ if (v && ["list", "table", "kanban", "cards"].includes(v)) {
239
+ return v as ViewMode;
237
240
  }
238
241
  return null;
239
- }, []);
242
+ }, [searchParams]);
240
243
 
241
244
  // Get saved view from local persistence
242
245
  const getSavedView = useCallback((): ViewMode | null => {
@@ -246,7 +249,6 @@ export const EntityCollectionView = React.memo(
246
249
 
247
250
  const [viewMode, setViewModeState] = useState<ViewMode>(() => {
248
251
  // Priority: URL > saved config > collection default
249
- const urlView = getViewFromUrl();
250
252
  if (urlView) return urlView;
251
253
  const savedView = getSavedView();
252
254
  if (savedView) return savedView;
@@ -257,12 +259,13 @@ export const EntityCollectionView = React.memo(
257
259
 
258
260
  // Sync URL with current view on init (if view came from saved config)
259
261
  useEffect(() => {
260
- const urlView = getViewFromUrl();
261
262
  if (!urlView && viewMode !== defaultViewMode) {
262
263
  // View came from saved config but URL doesn't have it - update URL without push
263
- const url = new URL(window.location.href);
264
- url.searchParams.set("__view", viewMode);
265
- window.history.replaceState({}, "", url.toString());
264
+ setSearchParams((prev) => {
265
+ const next = new URLSearchParams(prev);
266
+ next.set("__view", viewMode);
267
+ return next;
268
+ }, { replace: true });
266
269
  }
267
270
  }, []); // Only on mount
268
271
 
@@ -270,33 +273,27 @@ export const EntityCollectionView = React.memo(
270
273
  const setViewMode = useCallback((newMode: ViewMode) => {
271
274
  setViewModeState(newMode);
272
275
 
273
- // Update URL with __view param
274
- const url = new URL(window.location.href);
275
- if (newMode === defaultViewMode) {
276
- url.searchParams.delete("__view");
277
- } else {
278
- url.searchParams.set("__view", newMode);
279
- }
280
- window.history.pushState({}, "", url.toString());
281
- }, [defaultViewMode]);
282
-
283
- // Listen for browser back/forward
284
- useEffect(() => {
285
- const handlePopState = () => {
286
- const urlView = getViewFromUrl();
287
- if (urlView) {
288
- // URL has explicit view - use it
289
- setViewModeState(urlView);
276
+ // Update URL with __view param via React Router
277
+ setSearchParams((prev) => {
278
+ const next = new URLSearchParams(prev);
279
+ if (newMode === defaultViewMode) {
280
+ next.delete("__view");
290
281
  } else {
291
- // No URL param - fallback to saved config or collection default
292
- const savedView = getSavedView();
293
- setViewModeState(savedView ?? defaultViewMode);
282
+ next.set("__view", newMode);
294
283
  }
295
- };
284
+ return next;
285
+ });
286
+ }, [defaultViewMode, setSearchParams]);
296
287
 
297
- window.addEventListener("popstate", handlePopState);
298
- return () => window.removeEventListener("popstate", handlePopState);
299
- }, [getViewFromUrl, getSavedView, defaultViewMode]);
288
+ // Sync viewMode state when URL changes via back/forward navigation
289
+ useEffect(() => {
290
+ if (urlView) {
291
+ setViewModeState(urlView);
292
+ } else {
293
+ const savedView = getSavedView();
294
+ setViewModeState(savedView ?? defaultViewMode);
295
+ }
296
+ }, [urlView, getSavedView, defaultViewMode]);
300
297
 
301
298
  // List view size state - controls row height and info density
302
299
  const [listSize, setListSize] = useState<CollectionSize>(collection.defaultSize ?? "m");
@@ -352,10 +349,11 @@ export const EntityCollectionView = React.memo(
352
349
  sideEntityController,
353
350
  openEntityMode,
354
351
  collection,
355
- entityId: clickedEntity.id
352
+ entityId: clickedEntity.id,
353
+ replace: openEntityMode === "split" && selectedEntityIdProp !== undefined
356
354
  });
357
355
 
358
- }, [unselectNavigatedEntity, sideEntityController]);
356
+ }, [sideEntityController, openEntityMode, selectedEntityIdProp, path, urlController, analyticsController]);
359
357
 
360
358
  const onNewClick = useCallback(() => {
361
359
  const collection = collectionRef.current;
@@ -418,14 +416,16 @@ export const EntityCollectionView = React.memo(
418
416
 
419
417
  const pluginAddColumnComponents = useSlot("collection.add-column", {
420
418
  path,
421
- parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY, parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
419
+ parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
420
+ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
422
421
  collection,
423
422
  tableController
424
423
  });
425
424
 
426
425
  const pluginToolbarWidgets = useSlot("collection.toolbar", {
427
426
  path,
428
- parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY, parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
427
+ parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
428
+ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
429
429
  collection: collection,
430
430
  tableController: tableController,
431
431
  selectionController: usedSelectionController
@@ -433,7 +433,8 @@ export const EntityCollectionView = React.memo(
433
433
 
434
434
  const pluginEmptyStates = useSlot("collection.empty-state", {
435
435
  path,
436
- parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY, parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
436
+ parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
437
+ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
437
438
  collection,
438
439
  canCreate: canCreateEntities,
439
440
  onNewClick
@@ -441,7 +442,8 @@ export const EntityCollectionView = React.memo(
441
442
 
442
443
  const pluginInsights = useSlot("collection.insights", {
443
444
  path,
444
- parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY, parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
445
+ parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
446
+ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
445
447
  collection
446
448
  });
447
449
 
@@ -776,7 +778,8 @@ export const EntityCollectionView = React.memo(
776
778
  path,
777
779
  collection: collection as EntityCollection,
778
780
  tableController: tableController as EntityTableController,
779
- parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY, parentEntityIds: parentEntityIds ?? EMPTY_ARRAY
781
+ parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
782
+ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY
780
783
  };
781
784
  return <>{headerActionContributions.map((s, i) => (
782
785
  <ErrorBoundary key={`header_action_${propertyKey}_${i}`}>
@@ -819,13 +822,19 @@ export const EntityCollectionView = React.memo(
819
822
  .forEach(plugin => {
820
823
  plugin.hooks!.onColumnsReorder!({
821
824
  fullPath: path,
822
- parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY, parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
825
+ parentCollectionSlugs: parentCollectionSlugs ?? EMPTY_ARRAY,
826
+ parentEntityIds: parentEntityIds ?? EMPTY_ARRAY,
823
827
  collection,
824
828
  newPropertiesOrder
825
829
  });
826
830
  });
827
831
  }
828
- }, [collection, setLocalPropertiesOrder, customizationController, path, parentCollectionSlugs]);
832
+
833
+ // Save to user configuration persistence (local storage)
834
+ if (userConfigPersistence) {
835
+ onCollectionModifiedForUser(path, { propertiesOrder: newPropertiesOrder } as PartialEntityCollection<M>);
836
+ }
837
+ }, [collection, setLocalPropertiesOrder, customizationController, path, parentCollectionSlugs, parentEntityIds, userConfigPersistence, onCollectionModifiedForUser]);
829
838
 
830
839
  // Popover open state managed at parent level to prevent closing when view changes
831
840
  const [viewModePopoverOpen, setViewModePopoverOpen] = useState(false);
@@ -850,34 +859,28 @@ export const EntityCollectionView = React.memo(
850
859
  const pluginErrorViews = useSlot("collection.error", {
851
860
  path,
852
861
  collection,
853
- parentCollectionSlugs, parentEntityIds,
862
+ parentCollectionSlugs,
863
+ parentEntityIds,
854
864
  error: tableController.dataLoadingError as Error
855
865
  });
856
866
  const pluginErrorView = tableController.dataLoadingError && pluginErrorViews.length > 0
857
867
  ? pluginErrorViews[0]
858
868
  : null;
859
869
 
860
- // Shared empty state — plugin slot takes priority, then default
870
+ // Shared empty state — plugin slot takes priority, then override, then default
861
871
  const isSearching = !!tableController.searchString;
862
872
  const isFilteredOrSorted = tableController.filterValues !== undefined || tableController.sortBy !== undefined || isSearching;
873
+ const ResolvedEmptyState = useComponentOverride("Collection.EmptyState", DefaultCollectionEmptyState);
874
+ const ResolvedCollectionActions = useComponentOverride("Collection.Actions", EntityCollectionViewActions);
875
+ const ResolvedCollectionTable = useComponentOverride("Collection.Table", EntityCollectionTable) as typeof EntityCollectionTable;
863
876
  const emptyComponent = pluginEmptyStates.length > 0
864
877
  ? <>{pluginEmptyStates}</>
865
- : canCreateEntities && !isFilteredOrSorted
866
- ? <div className="flex flex-col items-center justify-center">
867
- <Typography variant={"subtitle2"}>{t("so_empty")}</Typography>
868
- <Button
869
- onClick={onNewClick}
870
- className="mt-4"
871
- >
872
- <PlusIcon/>
873
- {t("create_your_first_entry")}
874
- </Button>
875
- </div>
876
- : <Typography variant={"label"}>
877
- {isSearching
878
- ? t("no_results_search", { search: tableController.searchString ?? "" })
879
- : t("no_results_filter_sort")}
880
- </Typography>;
878
+ : <ResolvedEmptyState
879
+ canCreate={canCreateEntities && !isFilteredOrSorted}
880
+ onNewClick={onNewClick}
881
+ isSearching={isSearching}
882
+ searchString={tableController.searchString ?? ""}
883
+ />;
881
884
 
882
885
  const toolbarNode = (
883
886
  <CollectionTableToolbar
@@ -898,7 +901,7 @@ export const EntityCollectionView = React.memo(
898
901
  openNewDocument={openNewDocument}
899
902
  compact={isCompact}/>}
900
903
  actions={
901
- <EntityCollectionViewActions
904
+ <ResolvedCollectionActions
902
905
  parentCollectionSlugs={parentCollectionSlugs ?? EMPTY_ARRAY} parentEntityIds={parentEntityIds ?? EMPTY_ARRAY}
903
906
  collection={collection}
904
907
  tableController={tableController}
@@ -913,7 +916,7 @@ export const EntityCollectionView = React.memo(
913
916
  compact={isCompact}
914
917
  >
915
918
  {pluginToolbarWidgets}
916
- </EntityCollectionViewActions>
919
+ </ResolvedCollectionActions>
917
920
  }
918
921
  />
919
922
  ); const innerView = viewMode === "kanban" ? (
@@ -961,7 +964,7 @@ export const EntityCollectionView = React.memo(
961
964
  openEntityMode={openEntityMode}
962
965
  />
963
966
  ) : (
964
- <EntityCollectionTable
967
+ <ResolvedCollectionTable
965
968
  key={`collection_table_${path}`}
966
969
  hideToolbar={true}
967
970
  additionalFields={additionalFields}
@@ -996,12 +999,20 @@ export const EntityCollectionView = React.memo(
996
999
  />
997
1000
  );
998
1001
 
999
- return (
1002
+ const mainContent = (
1000
1003
  <div className={cls("overflow-hidden h-full w-full rounded-md flex flex-col dark:bg-surface-800", className)}
1001
1004
  ref={containerRef}>
1002
1005
 
1003
1006
  {countFetcher}
1004
1007
 
1008
+ {tableController.dataLoadingError && tableController.data.length > 0 && (
1009
+ <div className="flex items-center gap-4 px-4 py-2 bg-red-50 dark:bg-red-900/20 border-b border-red-200 dark:border-red-800 flex-shrink-0">
1010
+ <Typography variant="body2" className="text-red-700 dark:text-red-300 flex-1">
1011
+ <strong>Warning:</strong> {tableController.dataLoadingError.message || "Failed to update data."}
1012
+ </Typography>
1013
+ </div>
1014
+ )}
1015
+
1005
1016
 
1006
1017
  {/* When isSplitLayout, SplitListView is ALWAYS mounted — regardless
1007
1018
  of viewMode. The toolbar + current view live in the left panel;
@@ -1160,6 +1171,8 @@ export const EntityCollectionView = React.memo(
1160
1171
 
1161
1172
  </div>
1162
1173
  );
1174
+
1175
+ return mainContent;
1163
1176
  }, (a, b) => {
1164
1177
  return equal(a.path, b.path) &&
1165
1178
  equal(a.parentCollectionSlugs, b.parentCollectionSlugs) && equal(a.parentEntityIds, b.parentEntityIds) &&
@@ -1182,7 +1195,67 @@ export const EntityCollectionView = React.memo(
1182
1195
  equal(a.fixedFilter, b.fixedFilter) &&
1183
1196
  equal(a.selectedEntityId, b.selectedEntityId) &&
1184
1197
  equal(a.selectedTab, b.selectedTab);
1185
- }) as React.FunctionComponent<EntityCollectionViewProps<any>>
1198
+ }) as React.FunctionComponent<EntityCollectionViewProps<any>>;
1199
+
1200
+ export const EntityCollectionView = React.memo(
1201
+ function EntityCollectionView<M extends Record<string, unknown>>(props: EntityCollectionViewProps<M>) {
1202
+ const collectionRegistry = useCollectionRegistryController();
1203
+ const path = props.path ?? props.slug;
1204
+ const collection = collectionRegistry.getCollection(path) ?? props;
1205
+
1206
+ const content = <EntityCollectionViewInner {...props} />;
1207
+
1208
+ if (collection?.components) {
1209
+ return (
1210
+ <CollectionComponentOverrideProvider overrides={collection.components}>
1211
+ {content}
1212
+ </CollectionComponentOverrideProvider>
1213
+ );
1214
+ }
1215
+ return content;
1216
+ }
1217
+ ) as React.FunctionComponent<EntityCollectionViewProps<any>>;
1218
+
1219
+ /**
1220
+ * Default empty state shown when a collection has no entities.
1221
+ * Used as the fallback for the `"Collection.EmptyState"` component override.
1222
+ *
1223
+ * @internal
1224
+ */
1225
+ function DefaultCollectionEmptyState({
1226
+ canCreate,
1227
+ onNewClick,
1228
+ isSearching,
1229
+ searchString
1230
+ }: {
1231
+ canCreate: boolean;
1232
+ onNewClick: () => void;
1233
+ isSearching: boolean;
1234
+ searchString: string;
1235
+ }) {
1236
+ const { t } = useTranslation();
1237
+ if (canCreate) {
1238
+ return (
1239
+ <div className="flex flex-col items-center justify-center">
1240
+ <Typography variant={"subtitle2"}>{t("so_empty")}</Typography>
1241
+ <Button
1242
+ onClick={onNewClick}
1243
+ className="mt-4"
1244
+ >
1245
+ <PlusIcon/>
1246
+ {t("create_your_first_entry")}
1247
+ </Button>
1248
+ </div>
1249
+ );
1250
+ }
1251
+ return (
1252
+ <Typography variant={"label"}>
1253
+ {isSearching
1254
+ ? t("no_results_search", { search: searchString })
1255
+ : t("no_results_filter_sort")}
1256
+ </Typography>
1257
+ );
1258
+ }
1186
1259
 
1187
1260
  /**
1188
1261
  * Inflight count request deduplication map.
@@ -112,7 +112,8 @@ export function EntityCollectionViewActions<M extends Record<string, unknown>>({
112
112
  const actionProps: CollectionActionsProps<M> = {
113
113
  path,
114
114
  relativePath,
115
- parentCollectionSlugs, parentEntityIds,
115
+ parentCollectionSlugs,
116
+ parentEntityIds,
116
117
  collection,
117
118
  selectionController,
118
119
  context,
@@ -3,7 +3,7 @@ import type { EntityCollection } from "@rebasepro/types";
3
3
  import React, { useState, useCallback } from "react";
4
4
  import { useAuthController, useLargeLayout, useTranslation, useSlot } from "@rebasepro/core";
5
5
  import { CollectionActionsProps, EntityTableController, SelectionController } from "@rebasepro/types";
6
- import { ErrorBoundary , iconSize } from "@rebasepro/ui";
6
+ import { ErrorBoundary, iconSize } from "@rebasepro/ui";
7
7
  import { ArrowLeftIcon, Badge, Button, cls, FilterIcon, IconButton, Tooltip } from "@rebasepro/ui";
8
8
  import { ClearFilterSortButton } from "../ClearFilterSortButton";
9
9
  import { FiltersDialog } from "./FiltersDialog";
@@ -61,7 +61,8 @@ export function EntityCollectionViewStartActions<M extends Record<string, unknow
61
61
  const actionProps: CollectionActionsProps<M> = {
62
62
  path,
63
63
  relativePath,
64
- parentCollectionSlugs, parentEntityIds,
64
+ parentCollectionSlugs,
65
+ parentEntityIds,
65
66
  collection,
66
67
  selectionController,
67
68
  context,
@@ -79,8 +79,10 @@ function generateLabel(filterValues: FilterValues<string>): string {
79
79
  * Truncate a label if it exceeds MAX_LABEL_LENGTH.
80
80
  */
81
81
  function truncateLabel(label: string): { display: string; truncated: boolean } {
82
- if (label.length <= MAX_LABEL_LENGTH) return { display: label, truncated: false };
83
- return { display: label.slice(0, MAX_LABEL_LENGTH - 1) + "…", truncated: true };
82
+ if (label.length <= MAX_LABEL_LENGTH) return { display: label,
83
+ truncated: false };
84
+ return { display: label.slice(0, MAX_LABEL_LENGTH - 1) + "…",
85
+ truncated: true };
84
86
  }
85
87
 
86
88
  // ─── Overflow Menu ──────────────────────────────────────────────────
@@ -79,7 +79,6 @@ export function ViewModeToggle({
79
79
  const { t } = useTranslation();
80
80
 
81
81
 
82
-
83
82
  // Get icon for current view mode
84
83
  const getViewModeIcon = () => {
85
84
  if (viewMode === "kanban") return <KanbanIcon size={iconSize.smallest}/>;
@@ -276,7 +276,7 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
276
276
  if (isCleaningUpRef.current) return;
277
277
 
278
278
  const pendingMap = pendingItemsRef.current;
279
-
279
+
280
280
  // Apply pending updates to incoming entities
281
281
  const mergedEntities = entities.map(e => {
282
282
  const pending = pendingMap[String(e.id)];
@@ -284,7 +284,7 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
284
284
  // Check if DB entity has caught up to the expected column and order
285
285
  const expectedCol = pending.expectedValues[currentColumnProperty];
286
286
  const expectedOrder = currentOrderProperty ? pending.expectedValues[currentOrderProperty] : undefined;
287
-
287
+
288
288
  let caughtUp = true;
289
289
  if (e.values?.[currentColumnProperty] !== expectedCol) {
290
290
  caughtUp = false;
@@ -292,15 +292,17 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
292
292
  if (currentOrderProperty && e.values?.[currentOrderProperty] !== expectedOrder) {
293
293
  caughtUp = false;
294
294
  }
295
-
295
+
296
296
  if (caughtUp) {
297
297
  // DB has caught up, clear pending state
298
298
  delete pendingMap[String(e.id)];
299
299
  return e; // Use the real DB entity
300
300
  }
301
-
301
+
302
302
  // DB hasn't caught up, overlay expected values
303
- return { ...e, values: { ...e.values, ...pending.expectedValues } };
303
+ return { ...e,
304
+ values: { ...e.values,
305
+ ...pending.expectedValues } };
304
306
  }
305
307
  return e;
306
308
  });
@@ -326,14 +328,14 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
326
328
  processed = [...processed].sort((a, b) => {
327
329
  const valA = a.values?.[currentOrderProperty] as string | undefined | null;
328
330
  const valB = b.values?.[currentOrderProperty] as string | undefined | null;
329
-
331
+
330
332
  const isAEmpty = valA === undefined || valA === null || valA === "";
331
333
  const isBEmpty = valB === undefined || valB === null || valB === "";
332
-
334
+
333
335
  if (isAEmpty && isBEmpty) return 0;
334
336
  if (isAEmpty) return 1;
335
337
  if (isBEmpty) return -1;
336
-
338
+
337
339
  return valA < valB ? -1 : valA > valB ? 1 : 0;
338
340
  });
339
341
  }
@@ -618,7 +620,7 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
618
620
  ...itemToMove.values,
619
621
  ...(newValues || {})
620
622
  };
621
-
623
+
622
624
  const updatedEntity = {
623
625
  ...itemToMove,
624
626
  values: newValuesMerged
@@ -631,7 +633,7 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
631
633
  };
632
634
 
633
635
  const targetEntities = sourceColumn === targetColumn ? sourceEntities : [...(updated[targetColumn]?.entities || [])];
634
-
636
+
635
637
  if (newIndex !== undefined && newIndex >= 0 && newIndex <= targetEntities.length) {
636
638
  targetEntities.splice(newIndex, 0, updatedEntity);
637
639
  } else {
@@ -641,15 +643,15 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
641
643
  targetEntities.sort((a, b) => {
642
644
  const valA = a.values?.[orderProp] as string | undefined | null;
643
645
  const valB = b.values?.[orderProp] as string | undefined | null;
644
-
646
+
645
647
  // Handle nulls/empty strings to match Postgres NULLS LAST (ASC) behavior
646
648
  const isAEmpty = valA === undefined || valA === null || valA === "";
647
649
  const isBEmpty = valB === undefined || valB === null || valB === "";
648
-
650
+
649
651
  if (isAEmpty && isBEmpty) return 0;
650
652
  if (isAEmpty) return 1; // A is null, B is not -> A goes after B
651
653
  if (isBEmpty) return -1; // B is null, A is not -> A goes before B
652
-
654
+
653
655
  return valA < valB ? -1 : valA > valB ? 1 : 0;
654
656
  });
655
657
  }
@@ -658,8 +660,8 @@ export function useBoardDataController<M extends Record<string, unknown> = any,
658
660
  updated[sourceColumn] = {
659
661
  ...updated[sourceColumn],
660
662
  entities: sourceColumn === targetColumn ? targetEntities : sourceEntities,
661
- totalCount: sourceColumn === targetColumn
662
- ? updated[sourceColumn].totalCount
663
+ totalCount: sourceColumn === targetColumn
664
+ ? updated[sourceColumn].totalCount
663
665
  : Math.max(0, (updated[sourceColumn].totalCount ?? 0) - 1)
664
666
  };
665
667
 
@@ -166,31 +166,38 @@ export function resolveCollectionSlotKeys(
166
166
  }
167
167
  }
168
168
 
169
- // Relations: collect ALL relation property keys.
170
- // We iterate properties (not a hardcoded key list) and check the
171
- // resolved relation metadata for type === "relation".
169
+ // Relations: collect relation property keys for chip rendering.
170
+ // When propertiesOrder is explicitly set, skip this relations will
171
+ // be shown in the developer-defined order, not as separate chips.
172
+ const hasExplicitOrder = !!(collection.propertiesOrder as string[] | undefined);
172
173
  const relationKeys: string[] = [];
173
- for (const [key, prop] of Object.entries(collection.properties)) {
174
- const p = prop as Property;
175
- if (p.type === "relation") {
176
- relationKeys.push(key);
174
+ if (!hasExplicitOrder) {
175
+ for (const [key, prop] of Object.entries(collection.properties)) {
176
+ const p = prop as Property;
177
+ if (p.type === "relation") {
178
+ relationKeys.push(key);
179
+ }
177
180
  }
178
181
  }
179
182
 
180
- // Subtitle: first preview key that isn't title/image/status/date/relation/id.
183
+ // Subtitle: first preview key that isn't title/image/status/date/id.
184
+ // When propertiesOrder is not set, also exclude relation keys (they render as chips).
181
185
  // Prefer string fields (especially multiline/description-like) over numbers.
182
186
  const excludeKeys = new Set([titleKey, imageKey, statusKey, dateKey, ...relationKeys]);
183
187
  const previewKeys = getEntityPreviewKeys(authController, collection, propertyConfigs, undefined, 10)
184
188
  .filter(k => !excludeKeys.has(k) && k !== "id");
185
189
 
186
- // Sort: strings first (prefer multiline good description candidate), then others
187
- const sortedPreviewKeys = [...previewKeys].sort((a, b) => {
188
- const propA = collection.properties[a] as Property | undefined;
189
- const propB = collection.properties[b] as Property | undefined;
190
- const scoreA = propA?.type === "string" ? (propA.multiline ? 2 : 1) : 0;
191
- const scoreB = propB?.type === "string" ? (propB.multiline ? 2 : 1) : 0;
192
- return scoreB - scoreA;
193
- });
190
+ // When propertiesOrder is set, respect the developer-defined order (no re-sorting).
191
+ // When not set, sort: strings first (prefer multiline good description candidate).
192
+ const sortedPreviewKeys = hasExplicitOrder
193
+ ? previewKeys
194
+ : [...previewKeys].sort((a, b) => {
195
+ const propA = collection.properties[a] as Property | undefined;
196
+ const propB = collection.properties[b] as Property | undefined;
197
+ const scoreA = propA?.type === "string" ? (propA.multiline ? 2 : 1) : 0;
198
+ const scoreB = propB?.type === "string" ? (propB.multiline ? 2 : 1) : 0;
199
+ return scoreB - scoreA;
200
+ });
194
201
  const subtitleKey = sortedPreviewKeys.length > 0 ? sortedPreviewKeys[0] : undefined;
195
202
 
196
203
  return { titleKey,
@@ -333,7 +340,7 @@ value: val };
333
340
  const items: RelationChipItem[] = [];
334
341
  let totalCount = 0;
335
342
 
336
- const isMany = prop.relation?.cardinality === "many";
343
+ const isMany = prop.cardinality === "many" || prop.relation?.cardinality === "many";
337
344
 
338
345
  if (isMany && Array.isArray(val)) {
339
346
  // cardinality:"many" → array of EntityRelation
@@ -351,9 +358,12 @@ id });
351
358
  }
352
359
  } else if (!isMany && val && typeof val === "object") {
353
360
  // cardinality:"one" → single EntityRelation
354
- const isRelation = "__type" in val && (val as Record<string, unknown>).__type === "relation";
361
+ const obj = val as Record<string, unknown>;
362
+ const isRelation = ("__type" in obj && obj.__type === "relation")
363
+ || (typeof obj.isEntityRelation === "function"
364
+ && (obj.isEntityRelation as () => boolean)());
355
365
  if (isRelation) {
356
- const relation = val as EntityRelation;
366
+ const relation = obj as unknown as EntityRelation;
357
367
  const displayName = resolveRelationDisplayName(relation, prop);
358
368
  totalCount = 1;
359
369
  if (displayName) {