@rebasepro/cms 0.30.1 → 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":"navigation_utils.js","names":[],"sources":["../../src/util/navigation_utils.ts"],"sourcesContent":["\nimport type { UrlController, SidePanelBindingProps, SidePanelController, NavigateOptions, AdminCollection } from \"@rebasepro/cms-types\";\nimport { hasEntityId } from \"@rebasepro/common\";\nimport { withListState } from \"./view_mode\";\n\n// Canonical path utilities — single source of truth in @rebasepro/common\nexport { removeInitialAndTrailingSlashes, removeInitialSlash, removeTrailingSlash, addInitialSlash, getLastSegment, resolveCollectionPathIds, getCollectionBySlugWithin, getCollectionPathsCombinations } from \"@rebasepro/app\";\n\n/**\n * Navigate to a entity using either a side panel or full-screen mode.\n * This is an admin-specific UI concern and lives here (not in common).\n */\nexport function navigateToEntity({\n openEntityMode,\n collection,\n id,\n copy,\n path,\n selectedTab,\n defaultValues,\n sidePanelController,\n onClose,\n onSaved,\n navigation,\n replace\n}:\n\n {\n openEntityMode?: \"side_panel\" | \"full_screen\" | \"split\" | \"dialog\";\n collection?: AdminCollection;\n /** Id of the record to open; unset opens the form for a new record. */\n id?: string | number;\n selectedTab?: string;\n copy?: boolean;\n /**\n * Pre-populate the new entity form with these values.\n * Only applied when `id` is not set (i.e. \"new\" mode).\n *\n * Side panel: passed through SidePanelBindingProps → EditViewBinding.\n * Full screen: carried via React Router location.state so the route\n * component can read it on mount without polluting the URL.\n */\n defaultValues?: Record<string, unknown>;\n path: string;\n sidePanelController: SidePanelController;\n onClose?: () => void;\n /**\n * Called when the side panel or dialog saves the record. A full-screen\n * record replaces the view that opened it, and that view reads\n * everything again when it comes back, so nothing is called there.\n */\n onSaved?: SidePanelBindingProps[\"onSaved\"];\n navigation: UrlController;\n replace?: boolean;\n }) {\n\n // No CMS route serves this page (a collection embedded in the host app's\n // own page): there is no URL to go to, so the record opens over the page.\n const mode = navigation.routesMounted === false && openEntityMode !== \"dialog\"\n ? \"side_panel\"\n : openEntityMode;\n\n if (mode === \"side_panel\" || mode === \"dialog\") {\n\n sidePanelController.open({\n id,\n path: path,\n copy,\n selectedTab,\n collection,\n updateUrl: mode !== \"dialog\",\n onClose,\n onSaved,\n defaultValues\n });\n\n } else {\n let to = navigation.buildUrlCollectionPath(hasEntityId(id) ? `${path}/${id}` : path);\n if (hasEntityId(id) && selectedTab) {\n to += `/${selectedTab}`;\n }\n // The whole list state, not just the view mode: a record opened from a\n // search must come back to that search.\n to = withListState(to);\n if (!hasEntityId(id)) {\n to += \"#new\";\n }\n if (copy) {\n to += \"#copy\";\n }\n // Use React Router location.state to carry defaultValues — the correct SPA\n // approach. No URL size limits, no encoding, nothing in the address bar.\n // EntityFullScreenRoute reads location.state.defaultValues on mount.\n const navigateOptions: NavigateOptions = {};\n if (replace !== undefined) {\n navigateOptions.replace = replace;\n }\n if (defaultValues) {\n navigateOptions.state = { defaultValues };\n }\n const hasOptions = Object.keys(navigateOptions).length > 0;\n navigation.navigate(to, hasOptions ? navigateOptions : undefined);\n }\n\n}\n\n/**\n * Whether `pathname` is the record at `entityPath` or somewhere below it — one\n * of its tabs, its `/edit`. A path segment, not a string prefix:\n * `/c/products/12` is another record, not a place inside `/c/products/1`.\n */\nexport function isPathWithinRecord(pathname: string, entityPath: string): boolean {\n return pathname === entityPath || pathname.startsWith(`${entityPath}/`);\n}\n"],"mappings":";;;;;;;;AAYA,SAAgB,iBAAiB,EAC7B,gBACA,YACA,IACA,MACA,MACA,aACA,eACA,qBACA,SACA,SACA,YACA,WA8BG;CAIH,MAAM,OAAO,WAAW,kBAAkB,SAAS,mBAAmB,WAChE,eACA;CAEN,IAAI,SAAS,gBAAgB,SAAS,UAElC,oBAAoB,KAAK;EACrB;EACM;EACN;EACA;EACA;EACA,WAAW,SAAS;EACpB;EACA;EACA;CACJ,CAAC;MAEE;EACH,IAAI,KAAK,WAAW,uBAAuB,YAAY,EAAE,IAAI,GAAG,KAAK,GAAG,OAAO,IAAI;EACnF,IAAI,YAAY,EAAE,KAAK,aACnB,MAAM,IAAI;EAId,KAAK,cAAc,EAAE;EACrB,IAAI,CAAC,YAAY,EAAE,GACf,MAAM;EAEV,IAAI,MACA,MAAM;EAKV,MAAM,kBAAmC,CAAC;EAC1C,IAAI,YAAY,KAAA,GACZ,gBAAgB,UAAU;EAE9B,IAAI,eACA,gBAAgB,QAAQ,EAAE,cAAc;EAE5C,MAAM,aAAa,OAAO,KAAK,eAAe,CAAC,CAAC,SAAS;EACzD,WAAW,SAAS,IAAI,aAAa,kBAAkB,KAAA,CAAS;CACpE;AAEJ;;;;;;AAOA,SAAgB,mBAAmB,UAAkB,YAA6B;CAC9E,OAAO,aAAa,cAAc,SAAS,WAAW,GAAG,WAAW,EAAE;AAC1E"}
1
+ {"version":3,"file":"navigation_utils.js","names":[],"sources":["../../src/util/navigation_utils.ts"],"sourcesContent":["\nimport type { UrlController, SidePanelBindingProps, SidePanelController, NavigateOptions, AdminCollection } from \"@rebasepro/cms-types\";\nimport { hasEntityId } from \"./identity\";\nimport { withListState } from \"./view_mode\";\n\n// Canonical path utilities — single source of truth in @rebasepro/common\nexport { removeInitialAndTrailingSlashes, removeInitialSlash, removeTrailingSlash, addInitialSlash, getLastSegment, resolveCollectionPathIds, getCollectionBySlugWithin, getCollectionPathsCombinations } from \"@rebasepro/app\";\n\n/**\n * Navigate to a entity using either a side panel or full-screen mode.\n * This is an admin-specific UI concern and lives here (not in common).\n */\nexport function navigateToEntity({\n openEntityMode,\n collection,\n id,\n copy,\n path,\n selectedTab,\n defaultValues,\n sidePanelController,\n onClose,\n onSaved,\n navigation,\n replace\n}:\n\n {\n openEntityMode?: \"side_panel\" | \"full_screen\" | \"split\" | \"dialog\";\n collection?: AdminCollection;\n /** Id of the record to open; unset opens the form for a new record. */\n id?: string | number;\n selectedTab?: string;\n copy?: boolean;\n /**\n * Pre-populate the new entity form with these values.\n * Only applied when `id` is not set (i.e. \"new\" mode).\n *\n * Side panel: passed through SidePanelBindingProps → EditViewBinding.\n * Full screen: carried via React Router location.state so the route\n * component can read it on mount without polluting the URL.\n */\n defaultValues?: Record<string, unknown>;\n path: string;\n sidePanelController: SidePanelController;\n onClose?: () => void;\n /**\n * Called when the side panel or dialog saves the record. A full-screen\n * record replaces the view that opened it, and that view reads\n * everything again when it comes back, so nothing is called there.\n */\n onSaved?: SidePanelBindingProps[\"onSaved\"];\n navigation: UrlController;\n replace?: boolean;\n }) {\n\n // No CMS route serves this page (a collection embedded in the host app's\n // own page): there is no URL to go to, so the record opens over the page.\n const mode = navigation.routesMounted === false && openEntityMode !== \"dialog\"\n ? \"side_panel\"\n : openEntityMode;\n\n if (mode === \"side_panel\" || mode === \"dialog\") {\n\n sidePanelController.open({\n id,\n path: path,\n copy,\n selectedTab,\n collection,\n updateUrl: mode !== \"dialog\",\n onClose,\n onSaved,\n defaultValues\n });\n\n } else {\n let to = navigation.buildUrlCollectionPath(hasEntityId(id) ? `${path}/${id}` : path);\n if (hasEntityId(id) && selectedTab) {\n to += `/${selectedTab}`;\n }\n // The whole list state, not just the view mode: a record opened from a\n // search must come back to that search.\n to = withListState(to);\n if (!hasEntityId(id)) {\n to += \"#new\";\n }\n if (copy) {\n to += \"#copy\";\n }\n // Use React Router location.state to carry defaultValues — the correct SPA\n // approach. No URL size limits, no encoding, nothing in the address bar.\n // EntityFullScreenRoute reads location.state.defaultValues on mount.\n const navigateOptions: NavigateOptions = {};\n if (replace !== undefined) {\n navigateOptions.replace = replace;\n }\n if (defaultValues) {\n navigateOptions.state = { defaultValues };\n }\n const hasOptions = Object.keys(navigateOptions).length > 0;\n navigation.navigate(to, hasOptions ? navigateOptions : undefined);\n }\n\n}\n\n/**\n * Whether `pathname` is the record at `entityPath` or somewhere below it — one\n * of its tabs, its `/edit`. A path segment, not a string prefix:\n * `/c/products/12` is another record, not a place inside `/c/products/1`.\n */\nexport function isPathWithinRecord(pathname: string, entityPath: string): boolean {\n return pathname === entityPath || pathname.startsWith(`${entityPath}/`);\n}\n"],"mappings":";;;;;;;;AAYA,SAAgB,iBAAiB,EAC7B,gBACA,YACA,IACA,MACA,MACA,aACA,eACA,qBACA,SACA,SACA,YACA,WA8BG;CAIH,MAAM,OAAO,WAAW,kBAAkB,SAAS,mBAAmB,WAChE,eACA;CAEN,IAAI,SAAS,gBAAgB,SAAS,UAElC,oBAAoB,KAAK;EACrB;EACM;EACN;EACA;EACA;EACA,WAAW,SAAS;EACpB;EACA;EACA;CACJ,CAAC;MAEE;EACH,IAAI,KAAK,WAAW,uBAAuB,YAAY,EAAE,IAAI,GAAG,KAAK,GAAG,OAAO,IAAI;EACnF,IAAI,YAAY,EAAE,KAAK,aACnB,MAAM,IAAI;EAId,KAAK,cAAc,EAAE;EACrB,IAAI,CAAC,YAAY,EAAE,GACf,MAAM;EAEV,IAAI,MACA,MAAM;EAKV,MAAM,kBAAmC,CAAC;EAC1C,IAAI,YAAY,KAAA,GACZ,gBAAgB,UAAU;EAE9B,IAAI,eACA,gBAAgB,QAAQ,EAAE,cAAc;EAE5C,MAAM,aAAa,OAAO,KAAK,eAAe,CAAC,CAAC,SAAS;EACzD,WAAW,SAAS,IAAI,aAAa,kBAAkB,KAAA,CAAS;CACpE;AAEJ;;;;;;AAOA,SAAgB,mBAAmB,UAAkB,YAA6B;CAC9E,OAAO,aAAa,cAAc,SAAS,WAAW,GAAG,WAAW,EAAE;AAC1E"}
@@ -1,4 +1,4 @@
1
- import { isPropertyBuilder } from "@rebasepro/common";
1
+ import { isPropertyBuilder } from "@rebasepro/cms-types";
2
2
  import { getEntityPreviewKeys, getTitlePropertyKey, getTitlePropertyKeyForValues } from "@rebasepro/app";
3
3
  //#region src/util/previews.ts
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"previews.js","names":[],"sources":["../../src/util/previews.ts"],"sourcesContent":["import type { Property } from \"@rebasepro/types\";\nimport type { AdminCollection } from \"@rebasepro/cms-types\";\nimport { getTitlePropertyKey, getTitlePropertyKeyForValues } from \"@rebasepro/app\";\nimport { isPropertyBuilder } from \"@rebasepro/common\";\n\n/**\n * Which properties fill a preview surface, best first.\n *\n * The implementation lives in `@rebasepro/app` so that the admin package and\n * the app package cannot disagree about what a record looks like in a card —\n * they had drifted, and only one of the two copies had learned to keep\n * relations out of the list.\n */\nexport { getEntityPreviewKeys } from \"@rebasepro/app\";\n\n/**\n * The property that fills the title slot for a collection.\n *\n * Ranking lives in `@rebasepro/common` so every surface (list rows, cards,\n * board cards, detail header, relation chips) agrees on what an entity is\n * called. Identifiers are excluded from the property *schema* — primary keys,\n * foreign keys, UUID columns — not from the key name.\n */\nexport function getEntityTitlePropertyKey<M extends Record<string, unknown>>(\n collection: AdminCollection<M>\n): string | undefined {\n return getTitlePropertyKey(collection);\n}\n\n/**\n * Same as {@link getEntityTitlePropertyKey}, but skips candidates that carry\n * no readable value for this particular entity (empty, or an opaque id).\n */\nexport function getEntityTitlePropertyKeyForEntity<M extends Record<string, unknown>>(\n collection: AdminCollection<M>,\n values: Record<string, unknown> | undefined,\n entityId?: string | number\n): string | undefined {\n return getTitlePropertyKeyForValues(collection, values, entityId);\n}\n\n/**\n * True when a property key points at a user picker, whose stored value is an\n * auth user id that has to be resolved before it can be displayed.\n */\nexport function isUserSelectProperty<M extends Record<string, unknown>>(\n collection: AdminCollection<M>,\n propertyKey: string | undefined\n): boolean {\n if (!propertyKey) return false;\n const property = collection.properties[propertyKey];\n if (!property || isPropertyBuilder(property)) return false;\n const prop = property as Property;\n return prop.type === \"string\" && Boolean(prop.userSelect);\n}\n\n/**\n * Attempt to turn a title value (which might be a relation, reference, date, array, or other complex object)\n * into a renderable, human-readable string.\n */\nexport function resolveTitleToString(title: any): string {\n if (title === null || title === undefined) {\n return \"\";\n }\n\n if (typeof title !== \"object\") {\n return String(title);\n }\n\n // Check if it's a relation shape: { __type: \"relation\", id, path, data }\n if (\"__type\" in title && title.__type === \"relation\") {\n if (title.data && title.data.values) {\n const values = title.data.values;\n // Prioritize common title fields in eagerly loaded relation data\n for (const key of [\"name\", \"title\", \"label\", \"displayName\"]) {\n if (values[key] !== undefined && values[key] !== null) {\n return String(values[key]);\n }\n }\n // Fallback: search for first short string value in values\n for (const val of Object.values(values)) {\n if (typeof val === \"string\" && val.length > 0 && val.length < 200) {\n return val;\n }\n }\n }\n if (title.id !== undefined && title.id !== null) {\n return String(title.id);\n }\n }\n\n // Check if it's a reference shape: { isEntityReference() } or similar\n if (\"isEntityReference\" in title && typeof title.isEntityReference === \"function\" && title.isEntityReference()) {\n return String(title.id);\n }\n if (\"id\" in title && \"path\" in title && !(\"__type\" in title)) {\n // Flat reference/relation-like object\n return String(title.id);\n }\n\n // Check if it's a Date\n if (title instanceof Date) {\n return title.toLocaleDateString();\n }\n\n // Check if it has a string/number property like name/title/label/id\n if (\"name\" in title && title.name !== undefined && title.name !== null && typeof title.name !== \"object\") {\n return String(title.name);\n }\n if (\"title\" in title && title.title !== undefined && title.title !== null && typeof title.title !== \"object\") {\n return String(title.title);\n }\n if (\"label\" in title && title.label !== undefined && title.label !== null && typeof title.label !== \"object\") {\n return String(title.label);\n }\n if (\"id\" in title && title.id !== undefined && title.id !== null && typeof title.id !== \"object\") {\n return String(title.id);\n }\n\n // Fallback: try converting to string, or JSON.stringify if it looks like a generic object\n try {\n const str = String(title);\n if (str !== \"[object Object]\") {\n return str;\n }\n return JSON.stringify(title);\n } catch {\n return \"\";\n }\n}\n\n"],"mappings":";;;;;;;;;;;AAuBA,SAAgB,0BACZ,YACkB;CAClB,OAAO,oBAAoB,UAAU;AACzC;;;;;AAMA,SAAgB,mCACZ,YACA,QACA,UACkB;CAClB,OAAO,6BAA6B,YAAY,QAAQ,QAAQ;AACpE;;;;;AAMA,SAAgB,qBACZ,YACA,aACO;CACP,IAAI,CAAC,aAAa,OAAO;CACzB,MAAM,WAAW,WAAW,WAAW;CACvC,IAAI,CAAC,YAAY,kBAAkB,QAAQ,GAAG,OAAO;CACrD,MAAM,OAAO;CACb,OAAO,KAAK,SAAS,YAAY,QAAQ,KAAK,UAAU;AAC5D;;;;;AAMA,SAAgB,qBAAqB,OAAoB;CACrD,IAAI,UAAU,QAAQ,UAAU,KAAA,GAC5B,OAAO;CAGX,IAAI,OAAO,UAAU,UACjB,OAAO,OAAO,KAAK;CAIvB,IAAI,YAAY,SAAS,MAAM,WAAW,YAAY;EAClD,IAAI,MAAM,QAAQ,MAAM,KAAK,QAAQ;GACjC,MAAM,SAAS,MAAM,KAAK;GAE1B,KAAK,MAAM,OAAO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Property } from \"@rebasepro/cms-types\";\nimport { getTitlePropertyKey, getTitlePropertyKeyForValues } from \"@rebasepro/app\";\nimport { isPropertyBuilder } from \"@rebasepro/cms-types\";\n\n/**\n * Which properties fill a preview surface, best first.\n *\n * The implementation lives in `@rebasepro/app` so that the admin package and\n * the app package cannot disagree about what a record looks like in a card —\n * they had drifted, and only one of the two copies had learned to keep\n * relations out of the list.\n */\nexport { getEntityPreviewKeys } from \"@rebasepro/app\";\n\n/**\n * The property that fills the title slot for a collection.\n *\n * Ranking lives in `@rebasepro/common` so every surface (list rows, cards,\n * board cards, detail header, relation chips) agrees on what an entity is\n * called. Identifiers are excluded from the property *schema* — primary keys,\n * foreign keys, UUID columns — not from the key name.\n */\nexport function getEntityTitlePropertyKey<M extends Record<string, unknown>>(\n collection: AdminCollection<M>\n): string | undefined {\n return getTitlePropertyKey(collection);\n}\n\n/**\n * Same as {@link getEntityTitlePropertyKey}, but skips candidates that carry\n * no readable value for this particular entity (empty, or an opaque id).\n */\nexport function getEntityTitlePropertyKeyForEntity<M extends Record<string, unknown>>(\n collection: AdminCollection<M>,\n values: Record<string, unknown> | undefined,\n entityId?: string | number\n): string | undefined {\n return getTitlePropertyKeyForValues(collection, values, entityId);\n}\n\n/**\n * True when a property key points at a user picker, whose stored value is an\n * auth user id that has to be resolved before it can be displayed.\n */\nexport function isUserSelectProperty<M extends Record<string, unknown>>(\n collection: AdminCollection<M>,\n propertyKey: string | undefined\n): boolean {\n if (!propertyKey) return false;\n const property = collection.properties[propertyKey];\n if (!property || isPropertyBuilder(property)) return false;\n const prop = property as Property;\n return prop.type === \"string\" && Boolean(prop.userSelect);\n}\n\n/**\n * Attempt to turn a title value (which might be a relation, reference, date, array, or other complex object)\n * into a renderable, human-readable string.\n */\nexport function resolveTitleToString(title: any): string {\n if (title === null || title === undefined) {\n return \"\";\n }\n\n if (typeof title !== \"object\") {\n return String(title);\n }\n\n // Check if it's a relation shape: { __type: \"relation\", id, path, data }\n if (\"__type\" in title && title.__type === \"relation\") {\n if (title.data && title.data.values) {\n const values = title.data.values;\n // Prioritize common title fields in eagerly loaded relation data\n for (const key of [\"name\", \"title\", \"label\", \"displayName\"]) {\n if (values[key] !== undefined && values[key] !== null) {\n return String(values[key]);\n }\n }\n // Fallback: search for first short string value in values\n for (const val of Object.values(values)) {\n if (typeof val === \"string\" && val.length > 0 && val.length < 200) {\n return val;\n }\n }\n }\n if (title.id !== undefined && title.id !== null) {\n return String(title.id);\n }\n }\n\n // Check if it's a reference shape: { isEntityReference() } or similar\n if (\"isEntityReference\" in title && typeof title.isEntityReference === \"function\" && title.isEntityReference()) {\n return String(title.id);\n }\n if (\"id\" in title && \"path\" in title && !(\"__type\" in title)) {\n // Flat reference/relation-like object\n return String(title.id);\n }\n\n // Check if it's a Date\n if (title instanceof Date) {\n return title.toLocaleDateString();\n }\n\n // Check if it has a string/number property like name/title/label/id\n if (\"name\" in title && title.name !== undefined && title.name !== null && typeof title.name !== \"object\") {\n return String(title.name);\n }\n if (\"title\" in title && title.title !== undefined && title.title !== null && typeof title.title !== \"object\") {\n return String(title.title);\n }\n if (\"label\" in title && title.label !== undefined && title.label !== null && typeof title.label !== \"object\") {\n return String(title.label);\n }\n if (\"id\" in title && title.id !== undefined && title.id !== null && typeof title.id !== \"object\") {\n return String(title.id);\n }\n\n // Fallback: try converting to string, or JSON.stringify if it looks like a generic object\n try {\n const str = String(title);\n if (str !== \"[object Object]\") {\n return str;\n }\n return JSON.stringify(title);\n } catch {\n return \"\";\n }\n}\n\n"],"mappings":";;;;;;;;;;;AAsBA,SAAgB,0BACZ,YACkB;CAClB,OAAO,oBAAoB,UAAU;AACzC;;;;;AAMA,SAAgB,mCACZ,YACA,QACA,UACkB;CAClB,OAAO,6BAA6B,YAAY,QAAQ,QAAQ;AACpE;;;;;AAMA,SAAgB,qBACZ,YACA,aACO;CACP,IAAI,CAAC,aAAa,OAAO;CACzB,MAAM,WAAW,WAAW,WAAW;CACvC,IAAI,CAAC,YAAY,kBAAkB,Q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U,UAChG,OAAO,OAAO,MAAM,KAAK;CAE7B,IAAI,QAAQ,SAAS,MAAM,OAAO,KAAA,KAAa,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,UACpF,OAAO,OAAO,MAAM,EAAE;CAI1B,IAAI;EACA,MAAM,MAAM,OAAO,KAAK;EACxB,IAAI,QAAQ,mBACR,OAAO;EAEX,OAAO,KAAK,UAAU,KAAK;CAC/B,QAAQ;EACJ,OAAO;CACX;AACJ"}
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * This is the bridge between the entity-aware and headless layers.
7
7
  */
8
- import type { Property, Properties } from "@rebasepro/types";
8
+ import type { Property, Properties } from "@rebasepro/cms-types";
9
9
  import type { CollectionPropertyConfig } from "@rebasepro/ui";
10
10
  /**
11
11
  * Convert a single Property to a CollectionPropertyConfig.
@@ -1 +1 @@
1
- {"version":3,"file":"propertyConfigMapper.js","names":[],"sources":["../../src/util/propertyConfigMapper.ts"],"sourcesContent":["/**\n * Maps a Rebase `Property` (from @rebasepro/types) to a `CollectionPropertyConfig`\n * (from @rebasepro/ui), stripping all entity-specific fields and keeping only\n * the UI-relevant subset.\n *\n * This is the bridge between the entity-aware and headless layers.\n */\n\nimport type { Property, Properties, EnumValues, EnumValueConfig } from \"@rebasepro/types\";\nimport type { CollectionPropertyConfig, CollectionEnumValueConfig } from \"@rebasepro/ui\";\nimport { prettifyIdentifier } from \"@rebasepro/utils\";\nimport { warnDeprecated } from \"@rebasepro/common\";\n\n/**\n * Map Rebase property types to headless-supported types.\n * `vector` and `binary` are not directly renderable, so we fall back to `string`.\n */\nconst TYPE_MAP: Record<string, CollectionPropertyConfig[\"type\"]> = {\n string: \"string\",\n number: \"number\",\n boolean: \"boolean\",\n date: \"date\",\n geopoint: \"geopoint\",\n reference: \"reference\",\n relation: \"relation\",\n array: \"array\",\n map: \"map\",\n vector: \"string\", // vectors display as text\n binary: \"string\", // binary displays as text\n};\n\n/**\n * Convert a single Property to a CollectionPropertyConfig.\n *\n * @deprecated It feeds `CollectionView` from `@rebasepro/ui`, which is\n * deprecated: render the collection with `CollectionPanel` instead. Will be\n * removed in a future release.\n */\nexport function mapPropertyToConfig(property: Property, key?: string): CollectionPropertyConfig {\n warnDeprecated(\n \"cms.mapPropertyToConfig\",\n \"`mapPropertyToConfig` is deprecated, with the `CollectionView` it feeds; render the collection with `CollectionPanel` instead.\"\n );\n return propertyToConfig(property, key);\n}\n\nfunction propertyToConfig(property: Property, key?: string): CollectionPropertyConfig {\n const base: CollectionPropertyConfig = {\n type: TYPE_MAP[property.type] ?? \"string\",\n // A column header has to say something, and `name` is optional on the\n // property — a headless project has no UI and no reason to invent\n // labels. Falling back to the key is what the collection editor already\n // does when it suggests a name, so a derived label reads the same\n // wherever it appears: `publishDate` -> \"Publish Date\".\n name: property.name ?? (key ? prettifyIdentifier(key) : \"\"),\n description: property.description,\n columnWidth: property.admin?.columnWidth,\n hideFromCollection: property.admin?.hideFromCollection,\n };\n\n // String-specific\n if (property.type === \"string\") {\n if (property.enum) {\n base.enum = mapEnumValues(property.enum);\n }\n if (property.admin?.multiline) base.multiline = true;\n if (property.admin?.previewAsTag) base.previewAsTag = true;\n if (property.admin?.urlPreview) base.url = property.admin.urlPreview;\n if (property.admin?.markdown) base.markdown = true;\n if (property.storage) base.storage = true;\n if (property.email) base.email = true;\n }\n\n // Number-specific\n if (property.type === \"number\" && property.enum) {\n base.enum = mapEnumValues(property.enum);\n }\n\n // Array-specific\n if (property.type === \"array\" && property.of && !Array.isArray(property.of)) {\n base.of = propertyToConfig(property.of, key);\n }\n\n // Map-specific\n if (property.type === \"map\" && property.properties) {\n base.properties = mapPropertiesToConfigs(property.properties);\n if (property.propertiesOrder) {\n base.propertiesOrder = property.propertiesOrder;\n }\n }\n\n // Date-specific\n if (property.type === \"date\" && property.mode) {\n base.mode = property.mode;\n }\n\n // Custom preview component\n if (property.admin?.Preview) {\n // The connected wrapper will handle this by injecting via cellRenderer override\n // We don't copy it here because Preview may reference entity-aware components\n }\n\n return base;\n}\n\n/**\n * Convert a Properties record to a CollectionPropertyConfig record.\n *\n * @deprecated It feeds `CollectionView` from `@rebasepro/ui`, which is\n * deprecated: render the collection with `CollectionPanel` instead. Will be\n * removed in a future release.\n */\nexport function mapPropertiesToConfigs(\n properties: Properties\n): Record<string, CollectionPropertyConfig> {\n warnDeprecated(\n \"cms.mapPropertiesToConfigs\",\n \"`mapPropertiesToConfigs` is deprecated, with the `CollectionView` it feeds; render the collection with `CollectionPanel` instead.\"\n );\n const result: Record<string, CollectionPropertyConfig> = {};\n for (const [key, property] of Object.entries(properties)) {\n result[key] = propertyToConfig(property, key);\n }\n return result;\n}\n\n/**\n * Convert Rebase EnumValues to CollectionEnumValueConfig format.\n * Handles both array form (EnumValueConfig[]) and record form.\n */\nfunction mapEnumValues(\n enumValues: EnumValues | undefined\n): Record<string, CollectionEnumValueConfig> | Map<string | number, CollectionEnumValueConfig> | undefined {\n if (!enumValues) return undefined;\n\n // Array form: EnumValueConfig[]\n if (Array.isArray(enumValues)) {\n const result: Record<string, CollectionEnumValueConfig> = {};\n for (const item of enumValues) {\n result[String(item.id)] = normalizeEnumValueConfig(item);\n }\n return result;\n }\n\n // Record form: Record<string | number, string | EnumValueConfig>\n const result: Record<string, CollectionEnumValueConfig> = {};\n for (const [key, value] of Object.entries(enumValues)) {\n result[key] = typeof value === \"string\"\n ? value\n : normalizeEnumValueConfig(value);\n }\n return result;\n}\n\nfunction normalizeEnumValueConfig(config: EnumValueConfig): CollectionEnumValueConfig {\n return {\n label: config.label,\n color: typeof config.color === \"string\" ? config.color : undefined,\n disabled: config.disabled,\n };\n}\n"],"mappings":";;;;;;;AAiBA,IAAM,WAA6D;CAC/D,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,MAAM;CACN,UAAU;CACV,WAAW;CACX,UAAU;CACV,OAAO;CACP,KAAK;CACL,QAAQ;CACR,QAAQ;AACZ;;;;;;;;AASA,SAAgB,oBAAoB,UAAoB,KAAwC;CAC5F,eACI,2BACA,gIAC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ACX;;;;;AAMA,SAAS,cACL,YACuG;CACvG,IAAI,CAAC,YAAY,OAAO,KAAA;CAGxB,IAAI,MAAM,QAAQ,UAAU,GAAG;EAC3B,MAAM,SAAoD,CAAC;EAC3D,KAAK,MAAM,QAAQ,YACf,OAAO,OAAO,KAAK,EAAE,KAAK,yBAAyB,IAAI;EAE3D,OAAO;CACX;CAGA,MAAM,SAAoD,CAAC;CAC3D,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,UAAU,GAChD,OAAO,OAAO,OAAO,UAAU,WACzB,QACA,yBAAyB,KAAK;CAExC,OAAO;AACX;AAEA,SAAS,yBAAyB,QAAoD;CAClF,OAAO;EACH,OAAO,OAAO;EACd,OAAO,OAAO,OAAO,UAAU,WAAW,OAAO,QAAQ,KAAA;EACzD,UAAU,OAAO;CACrB;AACJ"}
1
+ {"version":3,"file":"propertyConfigMapper.js","names":[],"sources":["../../src/util/propertyConfigMapper.ts"],"sourcesContent":["/**\n * Maps a Rebase `Property` (from @rebasepro/types) to a `CollectionPropertyConfig`\n * (from @rebasepro/ui), stripping all entity-specific fields and keeping only\n * the UI-relevant subset.\n *\n * This is the bridge between the entity-aware and headless layers.\n */\n\nimport type { Property, Properties, EnumValues, EnumValueConfig } from \"@rebasepro/cms-types\";\nimport type { CollectionPropertyConfig, CollectionEnumValueConfig } from \"@rebasepro/ui\";\nimport { prettifyIdentifier } from \"@rebasepro/utils\";\nimport { warnDeprecated } from \"@rebasepro/common\";\n\n/**\n * Map Rebase property types to headless-supported types.\n * `vector` and `binary` are not directly renderable, so we fall back to `string`.\n */\nconst TYPE_MAP: Record<string, CollectionPropertyConfig[\"type\"]> = {\n string: \"string\",\n number: \"number\",\n boolean: \"boolean\",\n date: \"date\",\n geopoint: \"geopoint\",\n reference: \"reference\",\n relation: \"relation\",\n array: \"array\",\n map: \"map\",\n vector: \"string\", // vectors display as text\n binary: \"string\", // binary displays as text\n};\n\n/**\n * Convert a single Property to a CollectionPropertyConfig.\n *\n * @deprecated It feeds `CollectionView` from `@rebasepro/ui`, which is\n * deprecated: render the collection with `CollectionPanel` instead. Will be\n * removed in a future release.\n */\nexport function mapPropertyToConfig(property: Property, key?: string): CollectionPropertyConfig {\n warnDeprecated(\n \"cms.mapPropertyToConfig\",\n \"`mapPropertyToConfig` is deprecated, with the `CollectionView` it feeds; render the collection with `CollectionPanel` instead.\"\n );\n return propertyToConfig(property, key);\n}\n\nfunction propertyToConfig(property: Property, key?: string): CollectionPropertyConfig {\n const base: CollectionPropertyConfig = {\n type: TYPE_MAP[property.type] ?? \"string\",\n // A column header has to say something, and `name` is optional on the\n // property — a headless project has no UI and no reason to invent\n // labels. Falling back to the key is what the collection editor already\n // does when it suggests a name, so a derived label reads the same\n // wherever it appears: `publishDate` -> \"Publish Date\".\n name: property.name ?? (key ? prettifyIdentifier(key) : \"\"),\n description: property.description,\n columnWidth: property.admin?.columnWidth,\n hideFromCollection: property.admin?.hideFromCollection,\n };\n\n // String-specific\n if (property.type === \"string\") {\n if (property.enum) {\n base.enum = mapEnumValues(property.enum);\n }\n if (property.admin?.multiline) base.multiline = true;\n if (property.admin?.previewAsTag) base.previewAsTag = true;\n if (property.admin?.urlPreview) base.url = property.admin.urlPreview;\n if (property.admin?.markdown) base.markdown = true;\n if (property.storage) base.storage = true;\n if (property.email) base.email = true;\n }\n\n // Number-specific\n if (property.type === \"number\" && property.enum) {\n base.enum = mapEnumValues(property.enum);\n }\n\n // Array-specific\n if (property.type === \"array\" && property.of && !Array.isArray(property.of)) {\n base.of = propertyToConfig(property.of, key);\n }\n\n // Map-specific\n if (property.type === \"map\" && property.properties) {\n base.properties = mapPropertiesToConfigs(property.properties);\n if (property.propertiesOrder) {\n base.propertiesOrder = property.propertiesOrder;\n }\n }\n\n // Date-specific\n if (property.type === \"date\" && property.mode) {\n base.mode = property.mode;\n }\n\n // Custom preview component\n if (property.admin?.Preview) {\n // The connected wrapper will handle this by injecting via cellRenderer override\n // We don't copy it here because Preview may reference entity-aware components\n }\n\n return base;\n}\n\n/**\n * Convert a Properties record to a CollectionPropertyConfig record.\n *\n * @deprecated It feeds `CollectionView` from `@rebasepro/ui`, which is\n * deprecated: render the collection with `CollectionPanel` instead. Will be\n * removed in a future release.\n */\nexport function mapPropertiesToConfigs(\n properties: Properties\n): Record<string, CollectionPropertyConfig> {\n warnDeprecated(\n \"cms.mapPropertiesToConfigs\",\n \"`mapPropertiesToConfigs` is deprecated, with the `CollectionView` it feeds; render the collection with `CollectionPanel` instead.\"\n );\n const result: Record<string, CollectionPropertyConfig> = {};\n for (const [key, property] of Object.entries(properties)) {\n result[key] = propertyToConfig(property, key);\n }\n return result;\n}\n\n/**\n * Convert Rebase EnumValues to CollectionEnumValueConfig format.\n * Handles both array form (EnumValueConfig[]) and record form.\n */\nfunction mapEnumValues(\n enumValues: EnumValues | undefined\n): Record<string, CollectionEnumValueConfig> | Map<string | number, CollectionEnumValueConfig> | undefined {\n if (!enumValues) return undefined;\n\n // Array form: EnumValueConfig[]\n if (Array.isArray(enumValues)) {\n const result: Record<string, CollectionEnumValueConfig> = {};\n for (const item of enumValues) {\n result[String(item.id)] = normalizeEnumValueConfig(item);\n }\n return result;\n }\n\n // Record form: Record<string | number, string | EnumValueConfig>\n const result: Record<string, CollectionEnumValueConfig> = {};\n for (const [key, value] of Object.entries(enumValues)) {\n result[key] = typeof value === \"string\"\n ? value\n : normalizeEnumValueConfig(value);\n }\n return result;\n}\n\nfunction normalizeEnumValueConfig(config: EnumValueConfig): CollectionEnumValueConfig {\n return {\n label: config.label,\n color: typeof config.color === \"string\" ? config.color : undefined,\n disabled: config.disabled,\n };\n}\n"],"mappings":";;;;;;;AAiBA,IAAM,WAA6D;CAC/D,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,MAAM;CACN,UAAU;CACV,WAAW;CACX,UAAU;CACV,OAAO;CACP,KAAK;CACL,QAAQ;CACR,QAAQ;AACZ;;;;;;;;AASA,SAAgB,oBAAoB,UAAoB,KAAwC;CAC5F,eACI,2BACA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AO;AACX;;;;;AAMA,SAAS,cACL,YACuG;CACvG,IAAI,CAAC,YAAY,OAAO,KAAA;CAGxB,IAAI,MAAM,QAAQ,UAAU,GAAG;EAC3B,MAAM,SAAoD,CAAC;EAC3D,KAAK,MAAM,QAAQ,YACf,OAAO,OAAO,KAAK,EAAE,KAAK,yBAAyB,IAAI;EAE3D,OAAO;CACX;CAGA,MAAM,SAAoD,CAAC;CAC3D,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,UAAU,GAChD,OAAO,OAAO,OAAO,UAAU,WACzB,QACA,yBAAyB,KAAK;CAExC,OAAO;AACX;AAEA,SAAS,yBAAyB,QAAoD;CAClF,OAAO;EACH,OAAO,OAAO;EACd,OAAO,OAAO,OAAO,UAAU,WAAW,OAAO,QAAQ,KAAA;EACzD,UAAU,OAAO;CACrB;AACJ"}
@@ -1,6 +1,4 @@
1
- import type { Properties } from "@rebasepro/types";
2
- import type { Property } from "@rebasepro/types";
3
- import type { PropertyConfig, AdminCollection } from "@rebasepro/cms-types";
1
+ import type { PropertyConfig, AdminCollection, Properties, Property } from "@rebasepro/cms-types";
4
2
  import React from "react";
5
3
  import type { IconSize } from "@rebasepro/ui";
6
4
  export declare function isReferenceProperty(property: Property | null | undefined): boolean | null;
@@ -1,7 +1,7 @@
1
1
  import "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { AlignLeftIcon, CalendarIcon, CircleIcon, FlagIcon, FunctionSquareIcon, GlobeIcon, HashIcon, LinkIcon, MailIcon, RepeatIcon, Rows3Icon, TextIcon, UploadIcon, VoteIcon, iconSize } from "@rebasepro/ui";
4
- import { isPropertyBuilder } from "@rebasepro/common";
4
+ import { isPropertyBuilder } from "@rebasepro/cms-types";
5
5
  //#region src/util/property_utils.tsx
6
6
  /**
7
7
  * Resolve a size value (string token or number) to a numeric pixel value
@@ -1 +1 @@
1
- {"version":3,"file":"property_utils.js","names":[],"sources":["../../src/util/property_utils.tsx"],"sourcesContent":["\nimport type { Properties } from \"@rebasepro/types\";\nimport type { MapProperty, Property } from \"@rebasepro/types\";\nimport type { PropertyConfig, AdminCollection } from \"@rebasepro/cms-types\";\nimport React from \"react\";\n\nimport { isPropertyBuilder } from \"@rebasepro/common\";\nimport {\n AlignLeftIcon,\n CalendarIcon,\n CircleIcon,\n FlagIcon,\n FunctionSquareIcon,\n GlobeIcon,\n HashIcon,\n iconSize,\n LinkIcon,\n MailIcon,\n RepeatIcon,\n Rows3Icon,\n TextIcon,\n UploadIcon,\n VoteIcon\n} from \"@rebasepro/ui\";\nimport type { IconSize, LucideIcon } from \"@rebasepro/ui\";\n\n/**\n * Resolve a size value (string token or number) to a numeric pixel value\n * suitable for passing to Lucide icons.\n */\nfunction resolveSize(size: IconSize | number): number {\n if (typeof size === \"number\") return size;\n return iconSize[size];\n}\n\nexport function isReferenceProperty(property: Property | null | undefined) {\n\n if (!property) return null;\n if (property.type === \"reference\") {\n return true;\n }\n if (property.type === \"array\") {\n if (Array.isArray(property.of)) return false;\n else return property.of?.type === \"reference\"\n }\n return false;\n}\n\nexport function isRelationProperty(property: Property | null | undefined) {\n if (!property) return null;\n if (property.type === \"relation\") {\n return true;\n }\n if (property.type === \"array\") {\n if (Array.isArray(property.of)) return false;\n else return property.of?.type === \"relation\"\n }\n return false;\n}\n\nexport function getIconForWidget(widget: PropertyConfig | undefined,\n size: IconSize | number) {\n const Icon = widget?.Icon ?? CircleIcon;\n const px = resolveSize(size);\n return <Icon size={px}/>;\n}\n\n/**\n * Returns a default Lucide icon component based on property type.\n * This provides a sensible fallback when no PropertyConfig is available.\n */\nfunction getDefaultIconForProperty(property: Property): LucideIcon {\n switch (property.type) {\n case \"string\": {\n if (property.storage) return UploadIcon;\n if (property.admin?.urlPreview) return GlobeIcon;\n if (property.email) return MailIcon;\n if (property.admin?.multiline || property.admin?.markdown) return AlignLeftIcon;\n return TextIcon;\n }\n case \"number\":\n return HashIcon;\n case \"boolean\":\n return FlagIcon;\n case \"date\":\n return CalendarIcon;\n case \"map\":\n return VoteIcon;\n case \"array\": {\n const of = property.of;\n const oneOf = property.oneOf;\n if (oneOf) return Rows3Icon;\n if (of && !Array.isArray(of)) {\n if (of.type === \"reference\") return LinkIcon;\n if (of.type === \"string\" && of.storage) return UploadIcon;\n }\n return RepeatIcon;\n }\n case \"reference\":\n return LinkIcon;\n case \"relation\":\n return LinkIcon;\n case \"vector\":\n return HashIcon;\n default:\n return CircleIcon;\n }\n}\n\nexport function getIconForProperty(\n property: Property,\n size: IconSize | number = \"small\",\n fields: Record<string, PropertyConfig> = {}\n): React.ReactNode {\n const px = resolveSize(size);\n\n if (isPropertyBuilder(property)) {\n return <FunctionSquareIcon size={px}/>;\n }\n\n // Try to look up a custom PropertyConfig icon first\n const configId = property.propertyConfig || undefined;\n const widget = configId ? fields[configId] : undefined;\n if (widget?.Icon) {\n return getIconForWidget(widget, size);\n }\n\n // Fall back to a type-based default icon\n const Icon = getDefaultIconForProperty(property);\n return <Icon size={px}/>;\n}\n\n/**\n * Get a property in a property tree from a path like\n * `address.street`\n * @param properties\n * @param path\n */\nexport function getPropertyInPath(properties: Properties, path: string): Property | undefined {\n if (typeof properties === \"object\") {\n if (path in properties) {\n return (properties as Record<string, Property>)[path];\n }\n if (path.includes(\".\")) {\n const pathSegments = path.split(\".\");\n const childProperty = (properties as Record<string, Property>)[pathSegments[0]];\n if (typeof childProperty === \"object\" && childProperty.type === \"map\" && childProperty.properties) {\n return getPropertyInPath(childProperty.properties, pathSegments.slice(1).join(\".\"))\n }\n }\n }\n return undefined;\n}\n\nexport function getResolvedPropertyInPath(properties: Record<string, Property>, path: string): Property | undefined {\n if (typeof properties === \"object\") {\n if (path in properties) {\n return properties[path];\n }\n if (path.includes(\".\")) {\n const pathSegments = path.split(\".\");\n // A path whose root is not a property at all is simply not found.\n // Reading `.type` off the miss threw a TypeError instead, which\n // turned one unresolvable column key into a crash for whatever was\n // walking the properties — see `propertiesToColumns`, where that is\n // the whole table. `getPropertyInPath` above already guards this.\n const childProperty = properties[pathSegments[0]];\n if (childProperty?.type === \"map\" && childProperty.properties) {\n return getResolvedPropertyInPath(childProperty.properties, pathSegments.slice(1).join(\".\"))\n }\n }\n }\n return undefined;\n}\n\n// replace the dot notation with brackets\n// address.street => address[street]\nexport function getBracketNotation(path: string): string {\n return path.replace(/\\.([^.]*)/g, \"[$1]\");\n}\n\n/**\n * Get properties sorted by their order, but include ALL properties.\n * Nested keys (like \"data.mode\") in propertiesOrder are ignored - they're for column ordering.\n * @param properties\n * @param propertiesOrder\n */\nexport function getPropertiesWithPropertiesOrder(properties: Properties, propertiesOrder?: string[]): Properties {\n if (!propertiesOrder) return properties;\n\n const propertyKeys = Object.keys(properties);\n\n // Filter propertiesOrder to only include top-level keys (no dots) that exist\n const validOrderKeys = (propertiesOrder as string[]).filter(\n key => !key.includes(\".\") && properties[key]\n );\n\n const result: Properties = {};\n\n // First add properties in the specified order\n validOrderKeys.forEach(key => {\n const property = properties[key];\n if (typeof property === \"object\" && property.type === \"map\" && (property as MapProperty).properties) {\n const mapProp = property as MapProperty;\n result[key] = {\n ...mapProp,\n properties: getPropertiesWithPropertiesOrder(mapProp.properties!, mapProp.propertiesOrder ?? [])\n } as Property;\n } else if (property) {\n result[key] = property;\n }\n });\n\n // Then add any missing properties (so they don't disappear!)\n propertyKeys.forEach(key => {\n if (!result[key]) {\n const property = properties[key];\n if (typeof property === \"object\" && property.type === \"map\" && (property as MapProperty).properties) {\n const mapProp = property as MapProperty;\n result[key] = {\n ...mapProp,\n properties: getPropertiesWithPropertiesOrder(mapProp.properties!, mapProp.propertiesOrder ?? [])\n } as Property;\n } else if (property) {\n result[key] = property;\n }\n }\n });\n\n return result;\n}\n\nexport function getDefaultPropertiesOrder(collection: AdminCollection): string[] {\n if (collection.propertiesOrder) return collection.propertiesOrder;\n return [...Object.keys(collection.properties), ...(collection.additionalFields ?? []).map(field => field.key)];\n}\n"],"mappings":";;;;;;;;;AA8BA,SAAS,YAAY,MAAiC;CAClD,IAAI,OAAO,SAAS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AAI,CAAC,iBAAiB,OAAO;CAE7B,MAAM,eAAe,OAAO,KAAK,UAAU;CAG3C,MAAM,iBAAkB,gBAA6B,QACjD,QAAO,CAAC,IAAI,SAAS,GAAG,KAAK,WAAW,IAC5C;CAEA,MAAM,SAAqB,CAAC;CAG5B,eAAe,SAAQ,QAAO;EAC1B,MAAM,WAAW,WAAW;EAC5B,IAAI,OAAO,aAAa,YAAY,SAAS,SAAS,SAAU,SAAyB,YAAY;GACjG,MAAM,UAAU;GAChB,OAAO,OAAO;IACV,GAAG;IACH,YAAY,iCAAiC,QAAQ,YAAa,QAAQ,mBAAmB,CAAC,CAAC;GACnG;EACJ,OAAO,IAAI,UACP,OAAO,OAAO;CAEtB,CAAC;CAGD,aAAa,SAAQ,QAAO;EACxB,IAAI,CAAC,OAAO,MAAM;GACd,MAAM,WAAW,WAAW;GAC5B,IAAI,OAAO,aAAa,YAAY,SAAS,SAAS,SAAU,SAAyB,YAAY;IACjG,MAAM,UAAU;IAChB,OAAO,OAAO;KACV,GAAG;KACH,YAAY,iCAAiC,QAAQ,YAAa,QAAQ,mBAAmB,CAAC,CAAC;IACnG;GACJ,OAAO,IAAI,UACP,OAAO,OAAO;EAEtB;CACJ,CAAC;CAED,OAAO;AACX;AAEA,SAAgB,0BAA0B,YAAuC;CAC7E,IAAI,WAAW,iBAAiB,OAAO,WAAW;CAClD,OAAO,CAAC,GAAG,OAAO,KAAK,WAAW,UAAU,GAAG,IAAI,WAAW,oBAAoB,CAAC,EAAA,CAAG,KAAI,UAAS,MAAM,GAAG,CAAC;AACjH"}
1
+ {"version":3,"file":"property_utils.js","names":[],"sources":["../../src/util/property_utils.tsx"],"sourcesContent":["\nimport type { PropertyConfig, AdminCollection, Properties, MapProperty, Property } from \"@rebasepro/cms-types\";\nimport React from \"react\";\n\nimport { isPropertyBuilder } from \"@rebasepro/cms-types\";\nimport {\n AlignLeftIcon,\n CalendarIcon,\n CircleIcon,\n FlagIcon,\n FunctionSquareIcon,\n GlobeIcon,\n HashIcon,\n iconSize,\n LinkIcon,\n MailIcon,\n RepeatIcon,\n Rows3Icon,\n TextIcon,\n UploadIcon,\n VoteIcon\n} from \"@rebasepro/ui\";\nimport type { IconSize, LucideIcon } from \"@rebasepro/ui\";\n\n/**\n * Resolve a size value (string token or number) to a numeric pixel value\n * suitable for passing to Lucide icons.\n */\nfunction resolveSize(size: IconSize | number): number {\n if (typeof size === \"number\") return size;\n return iconSize[size];\n}\n\nexport function isReferenceProperty(property: Property | null | undefined) {\n\n if (!property) return null;\n if (property.type === \"reference\") {\n return true;\n }\n if (property.type === \"array\") {\n if (Array.isArray(property.of)) return false;\n else return property.of?.type === \"reference\"\n }\n return false;\n}\n\nexport function isRelationProperty(property: Property | null | undefined) {\n if (!property) return null;\n if (property.type === \"relation\") {\n return true;\n }\n if (property.type === \"array\") {\n if (Array.isArray(property.of)) return false;\n else return property.of?.type === \"relation\"\n }\n return false;\n}\n\nexport function getIconForWidget(widget: PropertyConfig | undefined,\n size: IconSize | number) {\n const Icon = widget?.Icon ?? CircleIcon;\n const px = resolveSize(size);\n return <Icon size={px}/>;\n}\n\n/**\n * Returns a default Lucide icon component based on property type.\n * This provides a sensible fallback when no PropertyConfig is available.\n */\nfunction getDefaultIconForProperty(property: Property): LucideIcon {\n switch (property.type) {\n case \"string\": {\n if (property.storage) return UploadIcon;\n if (property.admin?.urlPreview) return GlobeIcon;\n if (property.email) return MailIcon;\n if (property.admin?.multiline || property.admin?.markdown) return AlignLeftIcon;\n return TextIcon;\n }\n case \"number\":\n return HashIcon;\n case \"boolean\":\n return FlagIcon;\n case \"date\":\n return CalendarIcon;\n case \"map\":\n return VoteIcon;\n case \"array\": {\n const of = property.of;\n const oneOf = property.oneOf;\n if (oneOf) return Rows3Icon;\n if (of && !Array.isArray(of)) {\n if (of.type === \"reference\") return LinkIcon;\n if (of.type === \"string\" && of.storage) return UploadIcon;\n }\n return RepeatIcon;\n }\n case \"reference\":\n return LinkIcon;\n case \"relation\":\n return LinkIcon;\n case \"vector\":\n return HashIcon;\n default:\n return CircleIcon;\n }\n}\n\nexport function getIconForProperty(\n property: Property,\n size: IconSize | number = \"small\",\n fields: Record<string, PropertyConfig> = {}\n): React.ReactNode {\n const px = resolveSize(size);\n\n if (isPropertyBuilder(property)) {\n return <FunctionSquareIcon size={px}/>;\n }\n\n // Try to look up a custom PropertyConfig icon first\n const configId = property.propertyConfig || undefined;\n const widget = configId ? fields[configId] : undefined;\n if (widget?.Icon) {\n return getIconForWidget(widget, size);\n }\n\n // Fall back to a type-based default icon\n const Icon = getDefaultIconForProperty(property);\n return <Icon size={px}/>;\n}\n\n/**\n * Get a property in a property tree from a path like\n * `address.street`\n * @param properties\n * @param path\n */\nexport function getPropertyInPath(properties: Properties, path: string): Property | undefined {\n if (typeof properties === \"object\") {\n if (path in properties) {\n return (properties as Record<string, Property>)[path];\n }\n if (path.includes(\".\")) {\n const pathSegments = path.split(\".\");\n const childProperty = (properties as Record<string, Property>)[pathSegments[0]];\n if (typeof childProperty === \"object\" && childProperty.type === \"map\" && childProperty.properties) {\n return getPropertyInPath(childProperty.properties, pathSegments.slice(1).join(\".\"))\n }\n }\n }\n return undefined;\n}\n\nexport function getResolvedPropertyInPath(properties: Record<string, Property>, path: string): Property | undefined {\n if (typeof properties === \"object\") {\n if (path in properties) {\n return properties[path];\n }\n if (path.includes(\".\")) {\n const pathSegments = path.split(\".\");\n // A path whose root is not a property at all is simply not found.\n // Reading `.type` off the miss threw a TypeError instead, which\n // turned one unresolvable column key into a crash for whatever was\n // walking the properties — see `propertiesToColumns`, where that is\n // the whole table. `getPropertyInPath` above already guards this.\n const childProperty = properties[pathSegments[0]];\n if (childProperty?.type === \"map\" && childProperty.properties) {\n return getResolvedPropertyInPath(childProperty.properties, pathSegments.slice(1).join(\".\"))\n }\n }\n }\n return undefined;\n}\n\n// replace the dot notation with brackets\n// address.street => address[street]\nexport function getBracketNotation(path: string): string {\n return path.replace(/\\.([^.]*)/g, \"[$1]\");\n}\n\n/**\n * Get properties sorted by their order, but include ALL properties.\n * Nested keys (like \"data.mode\") in propertiesOrder are ignored - they're for column ordering.\n * @param properties\n * @param propertiesOrder\n */\nexport function getPropertiesWithPropertiesOrder(properties: Properties, propertiesOrder?: string[]): Properties {\n if (!propertiesOrder) return properties;\n\n const propertyKeys = Object.keys(properties);\n\n // Filter propertiesOrder to only include top-level keys (no dots) that exist\n const validOrderKeys = (propertiesOrder as string[]).filter(\n key => !key.includes(\".\") && properties[key]\n );\n\n const result: Properties = {};\n\n // First add properties in the specified order\n validOrderKeys.forEach(key => {\n const property = properties[key];\n if (typeof property === \"object\" && property.type === \"map\" && (property as MapProperty).properties) {\n const mapProp = property as MapProperty;\n result[key] = {\n ...mapProp,\n properties: getPropertiesWithPropertiesOrder(mapProp.properties!, mapProp.propertiesOrder ?? [])\n } as Property;\n } else if (property) {\n result[key] = property;\n }\n });\n\n // Then add any missing properties (so they don't disappear!)\n propertyKeys.forEach(key => {\n if (!result[key]) {\n const property = properties[key];\n if (typeof property === \"object\" && property.type === \"map\" && (property as MapProperty).properties) {\n const mapProp = property as MapProperty;\n result[key] = {\n ...mapProp,\n properties: getPropertiesWithPropertiesOrder(mapProp.properties!, mapProp.propertiesOrder ?? [])\n } as Property;\n } else if (property) {\n result[key] = property;\n }\n }\n });\n\n return result;\n}\n\nexport function getDefaultPropertiesOrder(collection: AdminCollection): string[] {\n if (collection.propertiesOrder) return collection.propertiesOrder;\n return [...Object.keys(collection.properties), ...(collection.additionalFields ?? []).map(field => field.key)];\n}\n"],"mappings":";;;;;;;;;AA4BA,SAAS,YAAY,MAAiC;CAClD,IAAI,OAAO,SAAS,UAAU,OAAO;CACrC,OAAO,SAAS;AACpB;AAEA,SAAgB,oBAAoB,UAAuC;CAEvE,IAAI,CAAC,UAAU,OAAO;CACtB,IAAI,SAAS,SAAS,aAClB,OAAO;CAEX,IAAI,SAAS,SAAS,SAClB,IAAI,MAAM,QAAQ,SAAS,EAAE,GAAG,OAAO;MAClC,OAAO,SAAS,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EAC5B,IAAI,OAAO,aAAa,YAAY,SAAS,SAAS,SAAU,SAAyB,YAAY;GACjG,MAAM,UAAU;GAChB,OAAO,OAAO;IACV,GAAG;IACH,YAAY,iCAAiC,QAAQ,YAAa,QAAQ,mBAAmB,CAAC,CAAC;GACnG;EACJ,OAAO,IAAI,UACP,OAAO,OAAO;CAEtB,CAAC;CAGD,aAAa,SAAQ,QAAO;EACxB,IAAI,CAAC,OAAO,MAAM;GACd,MAAM,WAAW,WAAW;GAC5B,IAAI,OAAO,aAAa,YAAY,SAAS,SAAS,SAAU,SAAyB,YAAY;IACjG,MAAM,UAAU;IAChB,OAAO,OAAO;KACV,GAAG;KACH,YAAY,iCAAiC,QAAQ,YAAa,QAAQ,mBAAmB,CAAC,CAAC;IACnG;GACJ,OAAO,IAAI,UACP,OAAO,OAAO;EAEtB;CACJ,CAAC;CAED,OAAO;AACX;AAEA,SAAgB,0BAA0B,YAAuC;CAC7E,IAAI,WAAW,iBAAiB,OAAO,WAAW;CAClD,OAAO,CAAC,GAAG,OAAO,KAAK,WAAW,UAAU,GAAG,IAAI,WAAW,oBAAoB,CAAC,EAAA,CAAG,KAAI,UAAS,MAAM,GAAG,CAAC;AACjH"}
@@ -0,0 +1,18 @@
1
+ import type { RelationProperty } from "@rebasepro/cms-types";
2
+ /**
3
+ * The path of the collection a relation property points at, derived from the
4
+ * property alone.
5
+ *
6
+ * A preview holds a property and a value and no collection, so it cannot call
7
+ * `resolveRelationProperty`. It does not need to: both forms that carry a
8
+ * target — the stamped `resolvedRelation` and the inline `relation` — name it
9
+ * directly. Only the third form, a relation declared by name in the
10
+ * collection's `relations` array, is out of reach, and that one has no target
11
+ * to read without the collection anyway.
12
+ *
13
+ * This is what lets a preview render a relation column that arrived as a bare
14
+ * foreign key: the id says *which* row, the declared target says *which
15
+ * collection*, and `RelationPreview` fetches the rest. Without it a scalar id
16
+ * is indistinguishable from a value of the wrong type.
17
+ */
18
+ export declare function getRelationTargetPath(property: RelationProperty): string | undefined;
@@ -0,0 +1,32 @@
1
+ //#region src/util/relations.ts
2
+ /**
3
+ * The path of the collection a relation property points at, derived from the
4
+ * property alone.
5
+ *
6
+ * A preview holds a property and a value and no collection, so it cannot call
7
+ * `resolveRelationProperty`. It does not need to: both forms that carry a
8
+ * target — the stamped `resolvedRelation` and the inline `relation` — name it
9
+ * directly. Only the third form, a relation declared by name in the
10
+ * collection's `relations` array, is out of reach, and that one has no target
11
+ * to read without the collection anyway.
12
+ *
13
+ * This is what lets a preview render a relation column that arrived as a bare
14
+ * foreign key: the id says *which* row, the declared target says *which
15
+ * collection*, and `RelationPreview` fetches the rest. Without it a scalar id
16
+ * is indistinguishable from a value of the wrong type.
17
+ */
18
+ function getRelationTargetPath(property) {
19
+ const stamped = property.resolvedRelation?.targetSlug;
20
+ if (stamped) return stamped;
21
+ const target = property.relation?.target;
22
+ if (typeof target !== "function") return void 0;
23
+ try {
24
+ return target()?.slug;
25
+ } catch (_e) {
26
+ return;
27
+ }
28
+ }
29
+ //#endregion
30
+ export { getRelationTargetPath };
31
+
32
+ //# sourceMappingURL=relations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relations.js","names":[],"sources":["../../src/util/relations.ts"],"sourcesContent":["import type { RelationProperty } from \"@rebasepro/cms-types\";\n\n/**\n * The path of the collection a relation property points at, derived from the\n * property alone.\n *\n * A preview holds a property and a value and no collection, so it cannot call\n * `resolveRelationProperty`. It does not need to: both forms that carry a\n * target — the stamped `resolvedRelation` and the inline `relation` — name it\n * directly. Only the third form, a relation declared by name in the\n * collection's `relations` array, is out of reach, and that one has no target\n * to read without the collection anyway.\n *\n * This is what lets a preview render a relation column that arrived as a bare\n * foreign key: the id says *which* row, the declared target says *which\n * collection*, and `RelationPreview` fetches the rest. Without it a scalar id\n * is indistinguishable from a value of the wrong type.\n */\nexport function getRelationTargetPath(property: RelationProperty): string | undefined {\n const stamped = property.resolvedRelation?.targetSlug;\n if (stamped) return stamped;\n\n const target = property.relation?.target;\n if (typeof target !== \"function\") return undefined;\n try {\n return target()?.slug;\n } catch (_e) {\n // A thunk reaching into a module that has not finished initialising:\n // there is no target to name yet, and a preview is not worth throwing over.\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAgB,sBAAsB,UAAgD;CAClF,MAAM,UAAU,SAAS,kBAAkB;CAC3C,IAAI,SAAS,OAAO;CAEpB,MAAM,SAAS,SAAS,UAAU;CAClC,IAAI,OAAO,WAAW,YAAY,OAAO,KAAA;CACzC,IAAI;EACA,OAAO,OAAO,CAAC,EAAE;CACrB,SAAS,IAAI;EAGT;CACJ;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebasepro/cms",
3
- "version": "0.30.1",
3
+ "version": "0.31.0-canary.g59cd6fd",
4
4
  "description": "Rebase CMS — content management views, forms, and routing",
5
5
  "keywords": [
6
6
  "rebase",
@@ -99,14 +99,14 @@
99
99
  "react-use-measure": "^2.1.7",
100
100
  "read-excel-file": "^9.3.10",
101
101
  "zod": "^4.4.3",
102
- "@rebasepro/forms": "0.30.1",
103
- "@rebasepro/app": "0.30.1",
104
- "@rebasepro/cms-types": "0.30.1",
105
- "@rebasepro/inference": "0.30.1",
106
- "@rebasepro/utils": "0.30.1",
107
- "@rebasepro/ui": "0.30.1",
108
- "@rebasepro/common": "0.30.1",
109
- "@rebasepro/types": "0.30.1"
102
+ "@rebasepro/app": "0.31.0-canary.g59cd6fd",
103
+ "@rebasepro/types": "0.31.0-canary.g59cd6fd",
104
+ "@rebasepro/cms-types": "0.31.0-canary.g59cd6fd",
105
+ "@rebasepro/inference": "0.31.0-canary.g59cd6fd",
106
+ "@rebasepro/forms": "0.31.0-canary.g59cd6fd",
107
+ "@rebasepro/ui": "0.31.0-canary.g59cd6fd",
108
+ "@rebasepro/utils": "0.31.0-canary.g59cd6fd",
109
+ "@rebasepro/common": "0.31.0-canary.g59cd6fd"
110
110
  },
111
111
  "peerDependencies": {
112
112
  "react": "^19.2.7",
@@ -171,13 +171,15 @@
171
171
  ],
172
172
  "moduleNameMapper": {
173
173
  "\\.(css|less)$": "<rootDir>/test/__mocks__/styleMock.js",
174
+ "^@rebasepro/common/migrate$": "<rootDir>/../common/src/migrate/index.ts",
174
175
  "^@rebasepro/([a-z0-9-]+)$": "<rootDir>/../$1/src/index.ts",
175
176
  "^react$": "<rootDir>/node_modules/react",
176
177
  "^react-dom$": "<rootDir>/node_modules/react-dom",
177
178
  "^react/jsx-runtime$": "<rootDir>/node_modules/react/jsx-runtime",
178
179
  "^@rebasepro/cms-types$": "<rootDir>/../cms-types/src/index.ts"
179
180
  },
180
- "testTimeout": 30000
181
+ "testTimeout": 30000,
182
+ "maxWorkers": 4
181
183
  },
182
184
  "scripts": {
183
185
  "watch": "vite build --watch",
package/recipes/README.md CHANGED
@@ -75,7 +75,7 @@ Components you render anywhere under `<Rebase>` and a router.
75
75
  | `useRowCount` | `@rebasepro/app` | `useRowCount("orders", where)` → `{ count, loading, error }`, counted by the data source. |
76
76
  | `useAggregate` | `@rebasepro/app` | `useAggregate("orders", { select: [{ fn: "count" }], groupBy: ["status"], orderBy: ["count", "desc"] })` → `{ result, loading, error }`: one row per group, each aggregate under its alias (`count`, `sum_total`). Computed by the data source; `error` says so where it cannot. |
77
77
  | `useRowWrites` | `@rebasepro/app` | `{ create, update, remove, saving, error }`: `update("orders", id, { status: "shipped" })`. Each write is the record form's save: the collection's `browserCallbacks` run, then the server's callbacks and rules, and every view of the collection reads it again. |
78
- | `useRebaseContext` | `@rebasepro/app` | The context: `context.data.collection("orders").find / findById / create / update / delete`, outside React state. Rows as the hooks return them; a write runs the collection's `browserCallbacks` and refreshes its views, as `useRowWrites` does. |
78
+ | `useRebaseContext` | `@rebasepro/app` | The context: `context.data.table("orders").find / findById / create / update / delete`, outside React state. Rows as the hooks return them; a write runs the collection's `browserCallbacks` and refreshes its views, as `useRowWrites` does. |
79
79
  | `usePermissions` | `@rebasepro/app` | `canCreate(collection, path)`, `canEdit(collection, path, row)`, `canDelete(collection, path, row)`: what the signed-in user may do, by the collection's rules. |
80
80
  | `useAuthController` | `@rebasepro/app` | The signed-in `user` (uid, roles), and sign-in / sign-out. |
81
81
  | `useSnackbarController` | `@rebasepro/app` | `open({ type, message })` for a toast. |
@@ -142,9 +142,9 @@ Components you render anywhere under `<Rebase>` and a router.
142
142
  - **Defaults for a new record:** a property's `defaultValue` applies everywhere a
143
143
  record is created; `RecordForm`'s `defaultValues` apply to that form only,
144
144
  on top of them.
145
- - **Enum fields** are `enum: [{ id: "draft", label: "Draft" }, …]` on a string
146
- property — see `defineCollection` and the collections docs for every property
147
- option.
145
+ - **Enum fields:** the values are the column's (`col.enum(["draft", …])` on
146
+ `defineTable`); their labels and colours are `fields.status.enumLabels` in
147
+ `customizeTable` (the site-settings and per-user recipes declare both halves).
148
148
  - **A record keyed by its user:** `id={useAuthController().user?.uid}`.
149
149
 
150
150
  The override names are `Shell.AppBar`, `Shell.Drawer`, `HomePage`,
@@ -4,42 +4,50 @@
4
4
  * The same shape as the site-settings singleton, keyed by the user instead of
5
5
  * a constant: the record's id is the user's uid. The first visit creates it.
6
6
  *
7
- * Protect it on the server too: a `securityRules` owner rule (`ownerField:
8
- * "id"`) makes a user's row readable and writable by that user alone, so the
9
- * page is a convenience, not the only lock.
7
+ * The table's `rls` is the real lock: an owner rule on `id` makes a user's row
8
+ * readable and writable by that user alone, in Postgres, so the page is a
9
+ * convenience, not the only lock.
10
10
  *
11
- * To use it: put `userPreferencesCollection` in `config/collections`, and add
12
- * `myPreferencesView` to `<RebaseCMS views={[…]}>`.
11
+ * To use it: put `userPreferences` in `backend/schema/user_preferences.ts`
12
+ * (importing `defineTable` and `col` from `@rebasepro/server/schema`) and
13
+ * export it from `backend/schema/index.ts`; put `userPreferencesCms` in
14
+ * `frontend/src/cms/` and add it to `<RebaseCMS tableCustomizations={[…]}>`;
15
+ * add `myPreferencesView` to `<RebaseCMS views={[…]}>`.
13
16
  */
14
17
  import React from "react";
15
- import { defineCollection } from "@rebasepro/cms-types";
18
+ import { col, defineTable } from "@rebasepro/types";
16
19
  import type { AppView } from "@rebasepro/cms-types";
17
20
  import { useAuthController } from "@rebasepro/app";
18
- import { RecordForm } from "@rebasepro/cms";
21
+ import { customizeTable, RecordForm } from "@rebasepro/cms";
19
22
  import { Container, Typography } from "@rebasepro/ui";
20
23
 
21
- export const userPreferencesCollection = defineCollection({
24
+ /** The table — backend/schema/user_preferences.ts. A row is its user's alone. */
25
+ export const userPreferences = defineTable("user_preferences", {
26
+ columns: {
27
+ id: col.text().primaryKey(),
28
+ theme: col.enum(["system", "light", "dark"]),
29
+ weeklyDigest: col.boolean()
30
+ },
31
+ rls: [{ operation: "all", ownerField: "id" }]
32
+ });
33
+
34
+ /** How the admin shows it — frontend/src/cms/user_preferences.tsx. */
35
+ export const userPreferencesCms = customizeTable<typeof userPreferences>("user_preferences", {
22
36
  name: "User preferences",
23
37
  singularName: "Preferences",
24
- slug: "user_preferences",
25
- table: "user_preferences",
26
- properties: {
27
- id: { name: "User", type: "string", isId: true },
38
+ icon: "UserCog",
39
+ hideFromNavigation: true,
40
+ hideIdFromForm: true,
41
+ fields: {
42
+ id: { name: "User" },
28
43
  theme: {
29
- name: "Theme",
30
- type: "string",
31
- enum: [
32
- { id: "system", label: "System" },
33
- { id: "light", label: "Light" },
34
- { id: "dark", label: "Dark" }
35
- ]
44
+ enumLabels: {
45
+ system: { label: "System" },
46
+ light: { label: "Light" },
47
+ dark: { label: "Dark" }
48
+ }
36
49
  },
37
- weeklyDigest: { name: "Weekly digest email", type: "boolean" }
38
- },
39
- admin: {
40
- icon: "UserCog",
41
- hideFromNavigation: true,
42
- hideIdFromForm: true
50
+ weeklyDigest: { name: "Weekly digest email" }
43
51
  }
44
52
  });
45
53
 
@@ -53,7 +61,7 @@ export function MyPreferencesPage() {
53
61
  // A new user is a new record: remount rather than carry one
54
62
  // user's form state into another's.
55
63
  key={user.uid}
56
- collection={userPreferencesCollection}
64
+ collection={"user_preferences"}
57
65
  id={user.uid}
58
66
  defaultValues={{ theme: "system", weeklyDigest: true }}/>
59
67
  </Container>
@@ -1,45 +1,52 @@
1
1
  /**
2
2
  * Recipe: a singleton — one settings record, edited on a page of its own.
3
3
  *
4
- * A singleton is not a special kind of collection. It is an ordinary table
5
- * whose admin page always opens the same row. `RecordForm` given an id
6
- * edits that record, and creates it under that id the first time, so there is
7
- * nothing to seed.
4
+ * A singleton is not a special kind of table. It is an ordinary table whose
5
+ * admin page always opens the same row. `RecordForm` given an id edits that
6
+ * record, and creates it under that id the first time, so there is nothing to
7
+ * seed.
8
8
  *
9
9
  * To use it:
10
- * 1. Put `siteSettingsCollection` in `config/collections/site_settings.ts`
11
- * (it is a normal collection: `rebase db push` creates its table).
12
- * 2. Add `siteSettingsView` to `<RebaseCMS views={[…]}>`.
10
+ * 1. Put `siteSettings` in `backend/schema/site_settings.ts` and export it
11
+ * from `backend/schema/index.ts` (it is a normal table: `rebase db push`
12
+ * creates it). In the backend, import `defineTable` and `col` from
13
+ * `@rebasepro/server/schema`.
14
+ * 2. Put `siteSettingsCms` in `frontend/src/cms/site_settings.tsx` and add it
15
+ * to `<RebaseCMS tableCustomizations={[…]}>`.
16
+ * 3. Add `siteSettingsView` to `<RebaseCMS views={[…]}>`.
13
17
  *
14
- * Reading the settings elsewhere is a normal read of row `"site"`.
18
+ * Reading the settings elsewhere is a normal read of row `"site"`:
19
+ * `client.data.table("site_settings").findById("site")`.
15
20
  */
16
21
  import React from "react";
17
- import { defineCollection } from "@rebasepro/cms-types";
22
+ import { col, defineTable } from "@rebasepro/types";
18
23
  import type { AppView } from "@rebasepro/cms-types";
19
- import { RecordForm } from "@rebasepro/cms";
24
+ import { customizeTable, RecordForm } from "@rebasepro/cms";
20
25
  import { Container, Typography } from "@rebasepro/ui";
21
26
 
22
27
  /** The one row every visit to the page edits. */
23
28
  export const SITE_SETTINGS_ID = "site";
24
29
 
25
- export const siteSettingsCollection = defineCollection({
30
+ /** The table — backend/schema/site_settings.ts. Admins read and write it. */
31
+ export const siteSettings = defineTable("site_settings", {
32
+ columns: {
33
+ id: col.text().primaryKey(),
34
+ siteName: col.text().notNull(),
35
+ tagline: col.text(),
36
+ maintenanceMode: col.boolean(),
37
+ supportEmail: col.text().validate({ email: true })
38
+ },
39
+ rls: "admin-only"
40
+ });
41
+
42
+ /** How the admin shows it — frontend/src/cms/site_settings.tsx. */
43
+ export const siteSettingsCms = customizeTable<typeof siteSettings>("site_settings", {
26
44
  name: "Site settings",
27
45
  singularName: "Site settings",
28
- slug: "site_settings",
29
- table: "site_settings",
30
- properties: {
31
- id: { name: "ID", type: "string", isId: true },
32
- siteName: { name: "Site name", type: "string", validation: { required: true } },
33
- tagline: { name: "Tagline", type: "string" },
34
- maintenanceMode: { name: "Maintenance mode", type: "boolean" },
35
- supportEmail: { name: "Support email", type: "string", email: true }
36
- },
37
- admin: {
38
- icon: "Settings",
39
- // The page below is the way in; a list of one row is not.
40
- hideFromNavigation: true,
41
- hideIdFromForm: true
42
- }
46
+ icon: "Settings",
47
+ // The page below is the way in; a list of one row is not.
48
+ hideFromNavigation: true,
49
+ hideIdFromForm: true
43
50
  });
44
51
 
45
52
  export function SiteSettingsPage() {
@@ -47,7 +54,7 @@ export function SiteSettingsPage() {
47
54
  <Container maxWidth={"3xl"} className={"py-8"}>
48
55
  <Typography variant={"h4"} gutterBottom>Site settings</Typography>
49
56
  <RecordForm
50
- collection={siteSettingsCollection}
57
+ collection={"site_settings"}
51
58
  id={SITE_SETTINGS_ID}
52
59
  defaultValues={{ siteName: "My site", maintenanceMode: false }}/>
53
60
  </Container>
@@ -1,13 +0,0 @@
1
- /**
2
- * A whole collection as the schema-editor routes take it.
3
- *
4
- * A collection the panel holds is the runtime's view of it: every relation's
5
- * `target` is a thunk, and the registry has added `resolvedRelation` beside
6
- * each relation. JSON drops the thunk, so a collection posted as it is arrives
7
- * with relations that have no target and is refused ("has no target
8
- * collection"), and the runtime's keys are refused as not belonging in a file.
9
- * Both servers read a `target` that is a slug and write the thunk back, so
10
- * each thunk is sent as the slug it points at, and the runtime's keys are left
11
- * out.
12
- */
13
- export declare function collectionForWire(collection: Record<string, unknown>): Record<string, unknown>;
@@ -1,49 +0,0 @@
1
- import { RUNTIME_ONLY_COLLECTION_KEYS } from "@rebasepro/types";
2
- //#region src/collection_editor/collection_wire.ts
3
- var isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
4
- /** The slug a relation's `target` thunk points at, or `undefined` when it cannot be read. */
5
- function targetSlugOf(target) {
6
- if (typeof target === "string") return target;
7
- if (typeof target !== "function") return void 0;
8
- try {
9
- const resolved = target();
10
- if (typeof resolved === "string") return resolved;
11
- if (isPlainObject(resolved) && typeof resolved.slug === "string") return resolved.slug;
12
- } catch {}
13
- }
14
- function encode(value) {
15
- if (Array.isArray(value)) return value.map(encode);
16
- if (!isPlainObject(value)) return value;
17
- const next = {};
18
- for (const [key, entry] of Object.entries(value)) {
19
- if (RUNTIME_ONLY_COLLECTION_KEYS.includes(key)) continue;
20
- next[key] = key === "target" && typeof entry === "function" ? targetSlugOf(entry) ?? entry : encode(entry);
21
- }
22
- if (value.type === "relation" && isPlainObject(next.relation) && typeof next.relation.target !== "string") {
23
- const resolved = value.resolvedRelation;
24
- if (isPlainObject(resolved) && typeof resolved.targetSlug === "string") next.relation = {
25
- ...next.relation,
26
- target: resolved.targetSlug
27
- };
28
- }
29
- return next;
30
- }
31
- /**
32
- * A whole collection as the schema-editor routes take it.
33
- *
34
- * A collection the panel holds is the runtime's view of it: every relation's
35
- * `target` is a thunk, and the registry has added `resolvedRelation` beside
36
- * each relation. JSON drops the thunk, so a collection posted as it is arrives
37
- * with relations that have no target and is refused ("has no target
38
- * collection"), and the runtime's keys are refused as not belonging in a file.
39
- * Both servers read a `target` that is a slug and write the thunk back, so
40
- * each thunk is sent as the slug it points at, and the runtime's keys are left
41
- * out.
42
- */
43
- function collectionForWire(collection) {
44
- return encode(collection);
45
- }
46
- //#endregion
47
- export { collectionForWire };
48
-
49
- //# sourceMappingURL=collection_wire.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collection_wire.js","names":[],"sources":["../../src/collection_editor/collection_wire.ts"],"sourcesContent":["import { RUNTIME_ONLY_COLLECTION_KEYS } from \"@rebasepro/types\";\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\n/** The slug a relation's `target` thunk points at, or `undefined` when it cannot be read. */\nfunction targetSlugOf(target: unknown): string | undefined {\n if (typeof target === \"string\") return target;\n if (typeof target !== \"function\") return undefined;\n try {\n const resolved: unknown = target();\n if (typeof resolved === \"string\") return resolved;\n if (isPlainObject(resolved) && typeof resolved.slug === \"string\") return resolved.slug;\n } catch {\n // A thunk over a collection that is not loaded: the caller falls back.\n }\n return undefined;\n}\n\nfunction encode(value: unknown): unknown {\n if (Array.isArray(value)) return value.map(encode);\n if (!isPlainObject(value)) return value;\n\n const next: Record<string, unknown> = {};\n for (const [key, entry] of Object.entries(value)) {\n if (RUNTIME_ONLY_COLLECTION_KEYS.includes(key)) continue;\n next[key] = key === \"target\" && typeof entry === \"function\"\n ? targetSlugOf(entry) ?? entry\n : encode(entry);\n }\n\n // A relation property whose thunk could not be read still names its\n // target in what the runtime resolved for it.\n if (value.type === \"relation\" && isPlainObject(next.relation) && typeof next.relation.target !== \"string\") {\n const resolved = value.resolvedRelation;\n if (isPlainObject(resolved) && typeof resolved.targetSlug === \"string\") {\n next.relation = { ...next.relation, target: resolved.targetSlug };\n }\n }\n return next;\n}\n\n/**\n * A whole collection as the schema-editor routes take it.\n *\n * A collection the panel holds is the runtime's view of it: every relation's\n * `target` is a thunk, and the registry has added `resolvedRelation` beside\n * each relation. JSON drops the thunk, so a collection posted as it is arrives\n * with relations that have no target and is refused (\"has no target\n * collection\"), and the runtime's keys are refused as not belonging in a file.\n * Both servers read a `target` that is a slug and write the thunk back, so\n * each thunk is sent as the slug it points at, and the runtime's keys are left\n * out.\n */\nexport function collectionForWire(collection: Record<string, unknown>): Record<string, unknown> {\n return encode(collection) as Record<string, unknown>;\n}\n"],"mappings":";;AAEA,IAAM,iBAAiB,UACnB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;;AAGvE,SAAS,aAAa,QAAqC;CACvD,IAAI,OAAO,WAAW,UAAU,OAAO;CACvC,IAAI,OAAO,WAAW,YAAY,OAAO,KAAA;CACzC,IAAI;EACA,MAAM,WAAoB,OAAO;EACjC,IAAI,OAAO,aAAa,UAAU,OAAO;EACzC,IAAI,cAAc,QAAQ,KAAK,OAAO,SAAS,SAAS,UAAU,OAAO,SAAS;CACtF,QAAQ,CAER;AAEJ;AAEA,SAAS,OAAO,OAAyB;CACrC,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,IAAI,MAAM;CACjD,IAAI,CAAC,cAAc,KAAK,GAAG,OAAO;CAElC,MAAM,OAAgC,CAAC;CACvC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAAG;EAC9C,IAAI,6BAA6B,SAAS,GAAG,GAAG;EAChD,KAAK,OAAO,QAAQ,YAAY,OAAO,UAAU,aAC3C,aAAa,KAAK,KAAK,QACvB,OAAO,KAAK;CACtB;CAIA,IAAI,MAAM,SAAS,cAAc,cAAc,KAAK,QAAQ,KAAK,OAAO,KAAK,SAAS,WAAW,UAAU;EACvG,MAAM,WAAW,MAAM;EACvB,IAAI,cAAc,QAAQ,KAAK,OAAO,SAAS,eAAe,UAC1D,KAAK,WAAW;GAAE,GAAG,KAAK;GAAU,QAAQ,SAAS;EAAW;CAExE;CACA,OAAO;AACX;;;;;;;;;;;;;AAcA,SAAgB,kBAAkB,YAA8D;CAC5F,OAAO,OAAO,UAAU;AAC5B"}