@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":"ArrayOfStringsPreview.js","names":[],"sources":["../../../src/preview/property_previews/ArrayOfStringsPreview.tsx"],"sourcesContent":["import type { ArrayProperty, StringProperty } from \"@rebasepro/types\";\nimport React from \"react\";\nimport type { PropertyPreviewProps } from \"../../types/components/PropertyPreviewProps\";\nimport { StringPropertyPreview } from \"./StringPropertyPreview\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\n\n/**\n * @group Preview components\n */\nexport function ArrayOfStringsPreview({\n propertyKey,\n value,\n property: property,\n // entity,\n size,\n compact\n}: PropertyPreviewProps<ArrayProperty>) {\n\n if (Array.isArray(property.of)) {\n throw Error(\"Using array properties instead of single one in `of` in ArrayProperty\");\n }\n if (!property.of || property.type !== \"array\" || property.of.type !== \"string\")\n throw Error(\"Picked wrong preview component ArrayOfStringsPreview\");\n\n if (value && !Array.isArray(value)) {\n return <div>{`Unexpected value: ${value}`}</div>;\n }\n const stringProperty = property.of as StringProperty;\n const arrayValues = value as string[];\n\n // One line, so the items run along it separated by a dot rather than\n // stacking. Each still renders through the string preview: a value that is\n // a tag stays a tag, it just sits beside its neighbours.\n if (compact) {\n return (\n <span className=\"inline-flex items-center gap-1 min-w-0 truncate\">\n {arrayValues &&\n arrayValues.map((v, index: number) =>\n <React.Fragment key={`preview_array_strings_${propertyKey}_${index}`}>\n {index > 0 && <span className=\"opacity-40\"\n aria-hidden={true}>·</span>}\n <ErrorBoundary>\n <StringPropertyPreview propertyKey={propertyKey}\n property={stringProperty}\n value={v}\n compact={true}\n size={size}/>\n </ErrorBoundary>\n </React.Fragment>\n )}\n </span>\n );\n }\n\n return (\n <div className=\"flex flex-col gap-2\">\n {arrayValues &&\n arrayValues.map((v, index: number) =>\n <div key={`preview_array_strings_${propertyKey}_${index}`}>\n <ErrorBoundary>\n <StringPropertyPreview propertyKey={propertyKey}\n property={stringProperty}\n value={v}\n size={size}/>\n </ErrorBoundary>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,sBAAsB,EAClC,aACA,OACU,UAEV,MACA,WACoC;CAEpC,IAAI,MAAM,QAAQ,SAAS,EAAE,GACzB,MAAM,MAAM,uEAAuE;CAEvF,IAAI,CAAC,SAAS,MAAM,SAAS,SAAS,WAAW,SAAS,GAAG,SAAS,UAClE,MAAM,MAAM,sDAAsD;CAEtE,IAAI,SAAS,CAAC,MAAM,QAAQ,KAAK,GAC7B,OAAO,oBAAC,OAAD,EAAA,UAAM,qBAAqB,QAAa,CAAA;CAEnD,MAAM,iBAAiB,SAAS;CAChC,MAAM,cAAc;CAKpB,IAAI,SACA,OACI,oBAAC,QAAD;EAAM,WAAU;YACX,eACG,YAAY,KAAK,GAAG,UAChB,qBAAC,MAAM,UAAP,EAAA,UAAA,CACK,QAAQ,KAAK,oBAAC,QAAD;GAAM,WAAU;GAC1B,eAAa;aAAM;EAAO,CAAA,GAC9B,oBAAC,eAAD,EAAA,UACI,oBAAC,uBAAD;GAAoC;GAChC,UAAU;GACV,OAAO;GACP,SAAS;GACH;EAAM,CAAA,EACL,CAAA,CACH,EAAA,GAVK,yBAAyB,YAAY,GAAG,OAU7C,CACpB;CACF,CAAA;CAId,OACI,oBAAC,OAAD;EAAK,WAAU;YACV,eACG,YAAY,KAAK,GAAG,UAChB,oBAAC,OAAD,EAAA,UACI,oBAAC,eAAD,EAAA,UACI,oBAAC,uBAAD;GAAoC;GAChC,UAAU;GACV,OAAO;GACD;EAAM,CAAA,EACL,CAAA,EACd,GAPK,yBAAyB,YAAY,GAAG,OAO7C,CACT;CACH,CAAA;AAEb"}
1
+ {"version":3,"file":"ArrayOfStringsPreview.js","names":[],"sources":["../../../src/preview/property_previews/ArrayOfStringsPreview.tsx"],"sourcesContent":["import type { ArrayProperty, StringProperty } from \"@rebasepro/cms-types\";\nimport React from \"react\";\nimport type { PropertyPreviewProps } from \"../../types/components/PropertyPreviewProps\";\nimport { StringPropertyPreview } from \"./StringPropertyPreview\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\n\n/**\n * @group Preview components\n */\nexport function ArrayOfStringsPreview({\n propertyKey,\n value,\n property: property,\n // entity,\n size,\n compact\n}: PropertyPreviewProps<ArrayProperty>) {\n\n if (Array.isArray(property.of)) {\n throw Error(\"Using array properties instead of single one in `of` in ArrayProperty\");\n }\n if (!property.of || property.type !== \"array\" || property.of.type !== \"string\")\n throw Error(\"Picked wrong preview component ArrayOfStringsPreview\");\n\n if (value && !Array.isArray(value)) {\n return <div>{`Unexpected value: ${value}`}</div>;\n }\n const stringProperty = property.of as StringProperty;\n const arrayValues = value as string[];\n\n // One line, so the items run along it separated by a dot rather than\n // stacking. Each still renders through the string preview: a value that is\n // a tag stays a tag, it just sits beside its neighbours.\n if (compact) {\n return (\n <span className=\"inline-flex items-center gap-1 min-w-0 truncate\">\n {arrayValues &&\n arrayValues.map((v, index: number) =>\n <React.Fragment key={`preview_array_strings_${propertyKey}_${index}`}>\n {index > 0 && <span className=\"opacity-40\"\n aria-hidden={true}>·</span>}\n <ErrorBoundary>\n <StringPropertyPreview propertyKey={propertyKey}\n property={stringProperty}\n value={v}\n compact={true}\n size={size}/>\n </ErrorBoundary>\n </React.Fragment>\n )}\n </span>\n );\n }\n\n return (\n <div className=\"flex flex-col gap-2\">\n {arrayValues &&\n arrayValues.map((v, index: number) =>\n <div key={`preview_array_strings_${propertyKey}_${index}`}>\n <ErrorBoundary>\n <StringPropertyPreview propertyKey={propertyKey}\n property={stringProperty}\n value={v}\n size={size}/>\n </ErrorBoundary>\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,sBAAsB,EAClC,aACA,OACU,UAEV,MACA,WACoC;CAEpC,IAAI,MAAM,QAAQ,SAAS,EAAE,GACzB,MAAM,MAAM,uEAAuE;CAEvF,IAAI,CAAC,SAAS,MAAM,SAAS,SAAS,WAAW,SAAS,GAAG,SAAS,UAClE,MAAM,MAAM,sDAAsD;CAEtE,IAAI,SAAS,CAAC,MAAM,QAAQ,KAAK,GAC7B,OAAO,oBAAC,OAAD,EAAA,UAAM,qBAAqB,QAAa,CAAA;CAEnD,MAAM,iBAAiB,SAAS;CAChC,MAAM,cAAc;CAKpB,IAAI,SACA,OACI,oBAAC,QAAD;EAAM,WAAU;YACX,eACG,YAAY,KAAK,GAAG,UAChB,qBAAC,MAAM,UAAP,EAAA,UAAA,CACK,QAAQ,KAAK,oBAAC,QAAD;GAAM,WAAU;GAC1B,eAAa;aAAM;EAAO,CAAA,GAC9B,oBAAC,eAAD,EAAA,UACI,oBAAC,uBAAD;GAAoC;GAChC,UAAU;GACV,OAAO;GACP,SAAS;GACH;EAAM,CAAA,EACL,CAAA,CACH,EAAA,GAVK,yBAAyB,YAAY,GAAG,OAU7C,CACpB;CACF,CAAA;CAId,OACI,oBAAC,OAAD;EAAK,WAAU;YACV,eACG,YAAY,KAAK,GAAG,UAChB,oBAAC,OAAD,EAAA,UACI,oBAAC,eAAD,EAAA,UACI,oBAAC,uBAAD;GAAoC;GAChC,UAAU;GACV,OAAO;GACD;EAAM,CAAA,EACL,CAAA,EACd,GAPK,yBAAyB,YAAY,GAAG,OAO7C,CACT;CACH,CAAA;AAEb"}
@@ -1,4 +1,4 @@
1
- import type { ArrayProperty } from "@rebasepro/types";
1
+ import type { ArrayProperty } from "@rebasepro/cms-types";
2
2
  import React from "react";
3
3
  import type { PropertyPreviewProps } from "../../types/components/PropertyPreviewProps.js";
4
4
  /**
@@ -2,7 +2,7 @@ import { PropertyPreview } from "../PropertyPreview.js";
2
2
  import React from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { ErrorBoundary, cls, defaultBorderMixin } from "@rebasepro/ui";
5
- import { DEFAULT_ONE_OF_TYPE, DEFAULT_ONE_OF_VALUE } from "@rebasepro/common";
5
+ import { DEFAULT_ONE_OF_TYPE, DEFAULT_ONE_OF_VALUE } from "@rebasepro/cms-types";
6
6
  import { useAuthController, useCustomizationController } from "@rebasepro/app";
7
7
  //#region src/preview/property_previews/ArrayOneOfPreview.tsx
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ArrayOneOfPreview.js","names":[],"sources":["../../../src/preview/property_previews/ArrayOneOfPreview.tsx"],"sourcesContent":["import type { ArrayProperty, Property } from \"@rebasepro/types\";\nimport React from \"react\";\nimport type { PropertyPreviewProps, PreviewSize } from \"../../types/components/PropertyPreviewProps\";\nimport { useAuthController, useCustomizationController } from \"@rebasepro/app\";\nimport { PropertyPreview } from \"../PropertyPreview\";\nimport { cls, defaultBorderMixin } from \"@rebasepro/ui\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\nimport { DEFAULT_ONE_OF_TYPE, DEFAULT_ONE_OF_VALUE } from \"@rebasepro/common\";\n\n/**\n * @group Preview components\n */\nexport function ArrayOneOfPreview({\n propertyKey,\n value,\n property: property,\n size,\n compact\n // entity\n}: PropertyPreviewProps<ArrayProperty>) {\n\n if (property.type !== \"array\")\n throw Error(\n `You need to specify an 'of' or 'oneOf' prop (or specify a custom field) in your array property ${propertyKey}`\n )\n\n const authController = useAuthController();\n const customizationController = useCustomizationController();\n\n if (property?.type !== \"array\")\n throw Error(\"Picked wrong preview component ArrayPreview\");\n\n if (!property?.oneOf) {\n throw Error(`You need to specify an 'of' or 'oneOf' prop (or specify a custom field) in your array property ${propertyKey}`);\n }\n\n const values = value as Record<string, unknown>[];\n\n if (!values) return null;\n\n // As in {@link ArrayPropertyPreview}: blocks stacked vertically, so a\n // single line can only report the count.\n if (compact) {\n return <span className={\"text-sm truncate\"}>\n {values.length === 1 ? \"1 block\" : `${values.length} blocks`}\n </span>;\n }\n\n const childSize: PreviewSize = size === \"medium\" ? \"medium\" : \"small\";\n\n const typeField = property.oneOf.typeField ?? DEFAULT_ONE_OF_TYPE;\n const valueField = property.oneOf.valueField ?? DEFAULT_ONE_OF_VALUE;\n const properties = property.oneOf.properties;\n\n return (\n <div className={\"flex flex-col\"}>\n {values &&\n values.map((val, index: number) => {\n const resolvedProperty = properties[val?.[typeField] as string];\n if (!val || !resolvedProperty) return null;\n return (\n <React.Fragment\n key={\"preview_array_\" + index}>\n <div className={cls(defaultBorderMixin, \"m-1 border-b last:border-b-0 py-2\")}>\n <ErrorBoundary>\n <PropertyPreview\n propertyKey={propertyKey}\n value={val[valueField]}\n // entity={entity}\n property={resolvedProperty as Property}\n size={childSize}/>\n </ErrorBoundary>\n </div>\n </React.Fragment>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAYA,SAAgB,kBAAkB,EAC9B,aACA,OACU,UACV,MACA,WAEoC;CAEpC,IAAI,SAAS,SAAS,SAClB,MAAM,MACF,kGAAkG,aACtG;CAEmB,kBAAkB;CACT,2BAA2B;CAE3D,IAAI,UAAU,SAAS,SACnB,MAAM,MAAM,6CAA6C;CAE7D,IAAI,CAAC,UAAU,OACX,MAAM,MAAM,kGAAkG,aAAa;CAG/H,MAAM,SAAS;CAEf,IAAI,CAAC,QAAQ,OAAO;CAIpB,IAAI,SACA,OAAO,oBAAC,QAAD;EAAM,WAAW;YACnB,OAAO,WAAW,IAAI,YAAY,GAAG,OAAO,OAAO;CAClD,CAAA;CAGV,MAAM,YAAyB,SAAS,WAAW,WAAW;CAE9D,MAAM,YAAY,SAAS,MAAM,aAAa;CAC9C,MAAM,aAAa,SAAS,MAAM,cAAc;CAChD,MAAM,aAAa,SAAS,MAAM;CAElC,OACI,oBAAC,OAAD;EAAK,WAAW;YACX,UACG,OAAO,KAAK,KAAK,UAAkB;GAC/B,MAAM,mBAAmB,WAAW,MAAM;GAC1C,IAAI,CAAC,OAAO,CAAC,kBAAkB,OAAO;GACtC,OACI,oBAAC,MAAM,UAAP,EAAA,UAEI,oBAAC,OAAD;IAAK,WAAW,IAAI,oBAAoB,mCAAmC;cACvE,oBAAC,eAAD,EAAA,UACI,oBAAC,iBAAD;KACiB;KACb,OAAO,IAAI;KAEX,UAAU;KACV,MAAM;IAAW,CAAA,EACV,CAAA;GACd,CAAA,EACO,GAXP,mBAAmB,KAWZ;EAExB,CAAC;CACJ,CAAA;AAEb"}
1
+ {"version":3,"file":"ArrayOneOfPreview.js","names":[],"sources":["../../../src/preview/property_previews/ArrayOneOfPreview.tsx"],"sourcesContent":["import type { ArrayProperty, Property } from \"@rebasepro/cms-types\";\nimport React from \"react\";\nimport type { PropertyPreviewProps, PreviewSize } from \"../../types/components/PropertyPreviewProps\";\nimport { useAuthController, useCustomizationController } from \"@rebasepro/app\";\nimport { PropertyPreview } from \"../PropertyPreview\";\nimport { cls, defaultBorderMixin } from \"@rebasepro/ui\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\nimport { DEFAULT_ONE_OF_TYPE, DEFAULT_ONE_OF_VALUE } from \"@rebasepro/cms-types\";\n\n/**\n * @group Preview components\n */\nexport function ArrayOneOfPreview({\n propertyKey,\n value,\n property: property,\n size,\n compact\n // entity\n}: PropertyPreviewProps<ArrayProperty>) {\n\n if (property.type !== \"array\")\n throw Error(\n `You need to specify an 'of' or 'oneOf' prop (or specify a custom field) in your array property ${propertyKey}`\n )\n\n const authController = useAuthController();\n const customizationController = useCustomizationController();\n\n if (property?.type !== \"array\")\n throw Error(\"Picked wrong preview component ArrayPreview\");\n\n if (!property?.oneOf) {\n throw Error(`You need to specify an 'of' or 'oneOf' prop (or specify a custom field) in your array property ${propertyKey}`);\n }\n\n const values = value as Record<string, unknown>[];\n\n if (!values) return null;\n\n // As in {@link ArrayPropertyPreview}: blocks stacked vertically, so a\n // single line can only report the count.\n if (compact) {\n return <span className={\"text-sm truncate\"}>\n {values.length === 1 ? \"1 block\" : `${values.length} blocks`}\n </span>;\n }\n\n const childSize: PreviewSize = size === \"medium\" ? \"medium\" : \"small\";\n\n const typeField = property.oneOf.typeField ?? DEFAULT_ONE_OF_TYPE;\n const valueField = property.oneOf.valueField ?? DEFAULT_ONE_OF_VALUE;\n const properties = property.oneOf.properties;\n\n return (\n <div className={\"flex flex-col\"}>\n {values &&\n values.map((val, index: number) => {\n const resolvedProperty = properties[val?.[typeField] as string];\n if (!val || !resolvedProperty) return null;\n return (\n <React.Fragment\n key={\"preview_array_\" + index}>\n <div className={cls(defaultBorderMixin, \"m-1 border-b last:border-b-0 py-2\")}>\n <ErrorBoundary>\n <PropertyPreview\n propertyKey={propertyKey}\n value={val[valueField]}\n // entity={entity}\n property={resolvedProperty as Property}\n size={childSize}/>\n </ErrorBoundary>\n </div>\n </React.Fragment>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAYA,SAAgB,kBAAkB,EAC9B,aACA,OACU,UACV,MACA,WAEoC;CAEpC,IAAI,SAAS,SAAS,SAClB,MAAM,MACF,kGAAkG,aACtG;CAEmB,kBAAkB;CACT,2BAA2B;CAE3D,IAAI,UAAU,SAAS,SACnB,MAAM,MAAM,6CAA6C;CAE7D,IAAI,CAAC,UAAU,OACX,MAAM,MAAM,kGAAkG,aAAa;CAG/H,MAAM,SAAS;CAEf,IAAI,CAAC,QAAQ,OAAO;CAIpB,IAAI,SACA,OAAO,oBAAC,QAAD;EAAM,WAAW;YACnB,OAAO,WAAW,IAAI,YAAY,GAAG,OAAO,OAAO;CAClD,CAAA;CAGV,MAAM,YAAyB,SAAS,WAAW,WAAW;CAE9D,MAAM,YAAY,SAAS,MAAM,aAAa;CAC9C,MAAM,aAAa,SAAS,MAAM,cAAc;CAChD,MAAM,aAAa,SAAS,MAAM;CAElC,OACI,oBAAC,OAAD;EAAK,WAAW;YACX,UACG,OAAO,KAAK,KAAK,UAAkB;GAC/B,MAAM,mBAAmB,WAAW,MAAM;GAC1C,IAAI,CAAC,OAAO,CAAC,kBAAkB,OAAO;GACtC,OACI,oBAAC,MAAM,UAAP,EAAA,UAEI,oBAAC,OAAD;IAAK,WAAW,IAAI,oBAAoB,mCAAmC;cACvE,oBAAC,eAAD,EAAA,UACI,oBAAC,iBAAD;KACiB;KACb,OAAO,IAAI;KAEX,UAAU;KACV,MAAM;IAAW,CAAA,EACV,CAAA;GACd,CAAA,EACO,GAXP,mBAAmB,KAWZ;EAExB,CAAC;CACJ,CAAA;AAEb"}
@@ -1,4 +1,4 @@
1
- import type { ArrayProperty } from "@rebasepro/types";
1
+ import type { ArrayProperty } from "@rebasepro/cms-types";
2
2
  import type { PropertyPreviewProps } from "../../types/components/PropertyPreviewProps.js";
3
3
  /**
4
4
  * @group Preview components
@@ -1,6 +1,6 @@
1
1
  import { ArrayEnumPreview } from "../components/ArrayEnumPreview.js";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { resolveEnumValues } from "@rebasepro/common";
3
+ import { resolveEnumValues } from "@rebasepro/cms-types";
4
4
  //#region src/preview/property_previews/ArrayPropertyEnumPreview.tsx
5
5
  /**
6
6
  * @group Preview components
@@ -1 +1 @@
1
- {"version":3,"file":"ArrayPropertyEnumPreview.js","names":[],"sources":["../../../src/preview/property_previews/ArrayPropertyEnumPreview.tsx"],"sourcesContent":["import type { ArrayProperty, NumberProperty, StringProperty } from \"@rebasepro/types\";\nimport type { PropertyPreviewProps } from \"../../types/components/PropertyPreviewProps\";\nimport { ArrayEnumPreview } from \"../components/ArrayEnumPreview\";\nimport { resolveEnumValues } from \"@rebasepro/common\";\n\n/**\n * @group Preview components\n */\nexport function ArrayPropertyEnumPreview({\n propertyKey,\n value,\n property,\n size\n}: PropertyPreviewProps<ArrayProperty>) {\n\n if (property.type !== \"array\")\n throw Error(\"Picked wrong preview component ArrayEnumPreview\");\n\n const ofProperty = property.of as StringProperty | NumberProperty;\n if (!ofProperty.enum)\n throw Error(\"Picked wrong preview component ArrayEnumPreview\");\n\n if (!value) return null;\n\n const enumValues = resolveEnumValues(ofProperty.enum);\n if (!enumValues)\n throw Error(\n `Enum values not resolved for property ${propertyKey}`\n )\n\n return <ArrayEnumPreview name={propertyKey}\n value={value as string[] | number[]}\n enumValues={enumValues}\n size={size}/>;\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,yBAAyB,EACrC,aACA,OACA,UACA,QACoC;CAEpC,IAAI,SAAS,SAAS,SAClB,MAAM,MAAM,iDAAiD;CAEjE,MAAM,aAAa,SAAS;CAC5B,IAAI,CAAC,WAAW,MACZ,MAAM,MAAM,iDAAiD;CAEjE,IAAI,CAAC,OAAO,OAAO;CAEnB,MAAM,aAAa,kBAAkB,WAAW,IAAI;CACpD,IAAI,CAAC,YACD,MAAM,MACF,yCAAyC,aAC7C;CAEJ,OAAO,oBAAC,kBAAD;EAAkB,MAAM;EACpB;EACK;EACN;CAAM,CAAA;AACpB"}
1
+ {"version":3,"file":"ArrayPropertyEnumPreview.js","names":[],"sources":["../../../src/preview/property_previews/ArrayPropertyEnumPreview.tsx"],"sourcesContent":["import type { ArrayProperty, NumberProperty, StringProperty } from \"@rebasepro/cms-types\";\nimport type { PropertyPreviewProps } from \"../../types/components/PropertyPreviewProps\";\nimport { ArrayEnumPreview } from \"../components/ArrayEnumPreview\";\nimport { resolveEnumValues } from \"@rebasepro/cms-types\";\n\n/**\n * @group Preview components\n */\nexport function ArrayPropertyEnumPreview({\n propertyKey,\n value,\n property,\n size\n}: PropertyPreviewProps<ArrayProperty>) {\n\n if (property.type !== \"array\")\n throw Error(\"Picked wrong preview component ArrayEnumPreview\");\n\n const ofProperty = property.of as StringProperty | NumberProperty;\n if (!ofProperty.enum)\n throw Error(\"Picked wrong preview component ArrayEnumPreview\");\n\n if (!value) return null;\n\n const enumValues = resolveEnumValues(ofProperty.enum);\n if (!enumValues)\n throw Error(\n `Enum values not resolved for property ${propertyKey}`\n )\n\n return <ArrayEnumPreview name={propertyKey}\n value={value as string[] | number[]}\n enumValues={enumValues}\n size={size}/>;\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,yBAAyB,EACrC,aACA,OACA,UACA,QACoC;CAEpC,IAAI,SAAS,SAAS,SAClB,MAAM,MAAM,iDAAiD;CAEjE,MAAM,aAAa,SAAS;CAC5B,IAAI,CAAC,WAAW,MACZ,MAAM,MAAM,iDAAiD;CAEjE,IAAI,CAAC,OAAO,OAAO;CAEnB,MAAM,aAAa,kBAAkB,WAAW,IAAI;CACpD,IAAI,CAAC,YACD,MAAM,MACF,yCAAyC,aAC7C;CAEJ,OAAO,oBAAC,kBAAD;EAAkB,MAAM;EACpB;EACK;EACN;CAAM,CAAA;AACpB"}
@@ -1,4 +1,4 @@
1
- import type { ArrayProperty } from "@rebasepro/types";
1
+ import type { ArrayProperty } from "@rebasepro/cms-types";
2
2
  import React from "react";
3
3
  import type { PropertyPreviewProps } from "../../types/components/PropertyPreviewProps.js";
4
4
  /**
@@ -2,7 +2,7 @@ import { PropertyPreview } from "../PropertyPreview.js";
2
2
  import React from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { ErrorBoundary, cls, defaultBorderMixin } from "@rebasepro/ui";
5
- import { resolveArrayProperties } from "@rebasepro/common";
5
+ import { resolveArrayProperties } from "@rebasepro/cms-types";
6
6
  import { useAuthController, useCustomizationController } from "@rebasepro/app";
7
7
  //#region src/preview/property_previews/ArrayPropertyPreview.tsx
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ArrayPropertyPreview.js","names":[],"sources":["../../../src/preview/property_previews/ArrayPropertyPreview.tsx"],"sourcesContent":["import type { ArrayProperty, Property } from \"@rebasepro/types\";\nimport React from \"react\";\n\nimport type { PropertyPreviewProps, PreviewSize } from \"../../types/components/PropertyPreviewProps\";\nimport { useAuthController, useCustomizationController } from \"@rebasepro/app\";\nimport { PropertyPreview } from \"../PropertyPreview\";\nimport { cls, defaultBorderMixin } from \"@rebasepro/ui\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\nimport { resolveArrayProperties } from \"@rebasepro/common\";\n\n/**\n * @group Preview components\n */\nexport function ArrayPropertyPreview({\n propertyKey,\n value,\n property: property,\n size,\n compact\n}: PropertyPreviewProps<ArrayProperty>) {\n\n if (property.type !== \"array\")\n throw Error(\"Picked wrong preview component ArrayPreview\");\n\n if (!property.of) {\n throw Error(`You need to specify an 'of' prop (or specify a custom field) in your array property ${propertyKey}`);\n }\n\n const authController = useAuthController();\n const customizationController = useCustomizationController();\n const resolvedProperties = resolveArrayProperties({\n propertyKey,\n property: property as ArrayProperty,\n propertyConfigs: customizationController.propertyConfigs,\n authController\n });\n\n const values = value as unknown[];\n\n if (!values) return null;\n\n // Each entry is a block of its own — a bordered row, sometimes a whole\n // sub-table. Stating how many there are is the only honest one-liner.\n if (compact) {\n return <span className={\"text-sm truncate\"}>\n {values.length === 1 ? \"1 item\" : `${values.length} items`}\n </span>;\n }\n\n const childSize: PreviewSize = size === \"medium\" ? \"medium\" : \"small\";\n\n return (\n <div className=\"w-full flex flex-col gap-2\">\n {values &&\n values.map((val, index: number) => {\n if (!resolvedProperties) {\n throw Error(\"Property resolvedProperties is undefined\");\n }\n const of: Property = resolvedProperties[index] ??\n (resolvedProperties[index] ?? (Array.isArray(property.of) ? property.of[index] : property.of));\n return of\n ? <React.Fragment\n key={\"preview_array_\" + index}>\n <div className={cls(defaultBorderMixin, \"m-1 border-b last:border-b-0\")}>\n <ErrorBoundary>\n <PropertyPreview\n propertyKey={propertyKey}\n value={val}\n property={of}\n size={childSize}/>\n </ErrorBoundary>\n </div>\n </React.Fragment>\n : null;\n }\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAaA,SAAgB,qBAAqB,EACjC,aACA,OACU,UACV,MACA,WACoC;CAEpC,IAAI,SAAS,SAAS,SAClB,MAAM,MAAM,6CAA6C;CAE7D,IAAI,CAAC,SAAS,IACV,MAAM,MAAM,uFAAuF,aAAa;CAGpH,MAAM,iBAAiB,kBAAkB;CAEzC,MAAM,qBAAqB,uBAAuB;EAC9C;EACU;EACV,iBAJ4B,2BAIX,CAAA,CAAwB;EACzC;CACJ,CAAC;CAED,MAAM,SAAS;CAEf,IAAI,CAAC,QAAQ,OAAO;CAIpB,IAAI,SACA,OAAO,oBAAC,QAAD;EAAM,WAAW;YACnB,OAAO,WAAW,IAAI,WAAW,GAAG,OAAO,OAAO;CACjD,CAAA;CAGV,MAAM,YAAyB,SAAS,WAAW,WAAW;CAE9D,OACI,oBAAC,OAAD;EAAK,WAAU;YACV,UACG,OAAO,KAAK,KAAK,UAAkB;GAC/B,IAAI,CAAC,oBACD,MAAM,MAAM,0CAA0C;GAE1D,MAAM,KAAe,mBAAmB,UACnC,mBAAmB,WAAW,MAAM,QAAQ,SAAS,EAAE,IAAI,SAAS,GAAG,SAAS,SAAS;GAC9F,OAAO,KACD,oBAAC,MAAM,UAAP,EAAA,UAEE,oBAAC,OAAD;IAAK,WAAW,IAAI,oBAAoB,8BAA8B;cAClE,oBAAC,eAAD,EAAA,UACI,oBAAC,iBAAD;KACiB;KACb,OAAO;KACP,UAAU;KACV,MAAM;IAAW,CAAA,EACV,CAAA;GACd,CAAA,EACO,GAVP,mBAAmB,KAUZ,IACd;EACV,CACA;CACH,CAAA;AAEb"}
1
+ {"version":3,"file":"ArrayPropertyPreview.js","names":[],"sources":["../../../src/preview/property_previews/ArrayPropertyPreview.tsx"],"sourcesContent":["import type { ArrayProperty, Property } from \"@rebasepro/cms-types\";\nimport React from \"react\";\n\nimport type { PropertyPreviewProps, PreviewSize } from \"../../types/components/PropertyPreviewProps\";\nimport { useAuthController, useCustomizationController } from \"@rebasepro/app\";\nimport { PropertyPreview } from \"../PropertyPreview\";\nimport { cls, defaultBorderMixin } from \"@rebasepro/ui\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\nimport { resolveArrayProperties } from \"@rebasepro/cms-types\";\n\n/**\n * @group Preview components\n */\nexport function ArrayPropertyPreview({\n propertyKey,\n value,\n property: property,\n size,\n compact\n}: PropertyPreviewProps<ArrayProperty>) {\n\n if (property.type !== \"array\")\n throw Error(\"Picked wrong preview component ArrayPreview\");\n\n if (!property.of) {\n throw Error(`You need to specify an 'of' prop (or specify a custom field) in your array property ${propertyKey}`);\n }\n\n const authController = useAuthController();\n const customizationController = useCustomizationController();\n const resolvedProperties = resolveArrayProperties({\n propertyKey,\n property: property as ArrayProperty,\n propertyConfigs: customizationController.propertyConfigs,\n authController\n });\n\n const values = value as unknown[];\n\n if (!values) return null;\n\n // Each entry is a block of its own — a bordered row, sometimes a whole\n // sub-table. Stating how many there are is the only honest one-liner.\n if (compact) {\n return <span className={\"text-sm truncate\"}>\n {values.length === 1 ? \"1 item\" : `${values.length} items`}\n </span>;\n }\n\n const childSize: PreviewSize = size === \"medium\" ? \"medium\" : \"small\";\n\n return (\n <div className=\"w-full flex flex-col gap-2\">\n {values &&\n values.map((val, index: number) => {\n if (!resolvedProperties) {\n throw Error(\"Property resolvedProperties is undefined\");\n }\n const of: Property = resolvedProperties[index] ??\n (resolvedProperties[index] ?? (Array.isArray(property.of) ? property.of[index] : property.of));\n return of\n ? <React.Fragment\n key={\"preview_array_\" + index}>\n <div className={cls(defaultBorderMixin, \"m-1 border-b last:border-b-0\")}>\n <ErrorBoundary>\n <PropertyPreview\n propertyKey={propertyKey}\n value={val}\n property={of}\n size={childSize}/>\n </ErrorBoundary>\n </div>\n </React.Fragment>\n : null;\n }\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAaA,SAAgB,qBAAqB,EACjC,aACA,OACU,UACV,MACA,WACoC;CAEpC,IAAI,SAAS,SAAS,SAClB,MAAM,MAAM,6CAA6C;CAE7D,IAAI,CAAC,SAAS,IACV,MAAM,MAAM,uFAAuF,aAAa;CAGpH,MAAM,iBAAiB,kBAAkB;CAEzC,MAAM,qBAAqB,uBAAuB;EAC9C;EACU;EACV,iBAJ4B,2BAIX,CAAA,CAAwB;EACzC;CACJ,CAAC;CAED,MAAM,SAAS;CAEf,IAAI,CAAC,QAAQ,OAAO;CAIpB,IAAI,SACA,OAAO,oBAAC,QAAD;EAAM,WAAW;YACnB,OAAO,WAAW,IAAI,WAAW,GAAG,OAAO,OAAO;CACjD,CAAA;CAGV,MAAM,YAAyB,SAAS,WAAW,WAAW;CAE9D,OACI,oBAAC,OAAD;EAAK,WAAU;YACV,UACG,OAAO,KAAK,KAAK,UAAkB;GAC/B,IAAI,CAAC,oBACD,MAAM,MAAM,0CAA0C;GAE1D,MAAM,KAAe,mBAAmB,UACnC,mBAAmB,WAAW,MAAM,QAAQ,SAAS,EAAE,IAAI,SAAS,GAAG,SAAS,SAAS;GAC9F,OAAO,KACD,oBAAC,MAAM,UAAP,EAAA,UAEE,oBAAC,OAAD;IAAK,WAAW,IAAI,oBAAoB,8BAA8B;cAClE,oBAAC,eAAD,EAAA,UACI,oBAAC,iBAAD;KACiB;KACb,OAAO;KACP,UAAU;KACV,MAAM;IAAW,CAAA,EACV,CAAA;GACd,CAAA,EACO,GAVP,mBAAmB,KAUZ,IACd;EACV,CACA;CACH,CAAA;AAEb"}
@@ -1,4 +1,4 @@
1
- import type { MapProperty } from "@rebasepro/types";
1
+ import type { MapProperty } from "@rebasepro/cms-types";
2
2
  import React from "react";
3
3
  import type { PropertyPreviewProps } from "../../types/components/PropertyPreviewProps.js";
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MapPropertyPreview.js","names":[],"sources":["../../../src/preview/property_previews/MapPropertyPreview.tsx"],"sourcesContent":["import type { MapProperty } from \"@rebasepro/types\";\nimport React from \"react\";\n\nimport type { PropertyPreviewProps } from \"../../types/components/PropertyPreviewProps\";\nimport { PropertyPreview } from \"../PropertyPreview\";\nimport { cls, defaultBorderMixin, Typography } from \"@rebasepro/ui\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\nimport { EmptyValue } from \"../components/EmptyValue\";\n\n/**\n * @group Preview components\n */\nexport function MapPropertyPreview({\n propertyKey,\n value,\n property,\n size,\n compact\n}: PropertyPreviewProps<MapProperty>) {\n\n if (property.type !== \"map\") {\n throw Error(\"Picked wrong preview component MapPropertyPreview\");\n }\n\n const mapProperty = property as MapProperty;\n\n // A map is a table — a row per sub-property — and a card line has room for\n // neither the rows nor the borders between them.\n if (compact) {\n return <CompactMapPreview property={mapProperty}\n value={value as Record<string, unknown> | undefined}/>;\n }\n\n if (!mapProperty.properties || Object.keys(mapProperty.properties ?? {}).length === 0) {\n return (\n <KeyValuePreview value={value}/>\n );\n }\n\n if (!value) return null;\n const mapValue = value as Record<string, unknown>;\n\n const mapPropertyKeys: string[] = Object.keys(mapProperty.properties)\n\n if (size === \"small\")\n return (\n <div className=\"w-full flex flex-col space-y-1 md:space-y-2\">\n {mapPropertyKeys.map((key, index) => (\n <div key={`map_${key}`}>\n <ErrorBoundary\n key={\"map_preview_\" + mapProperty.name + key + index}>\n <PropertyPreview propertyKey={key}\n value={mapValue[key]}\n property={mapProperty.properties![key]}\n // entity={entity}\n size={size}/>\n </ErrorBoundary>\n </div>\n ))}\n </div>\n );\n\n return (\n <div\n className=\"flex flex-col gap-1 w-full\">\n {mapPropertyKeys &&\n mapPropertyKeys.map((key, index) => {\n const childProperty = mapProperty.properties![key];\n const isArrayOrMap = childProperty.type === \"map\" || childProperty.type === \"array\";\n return (\n <div\n key={`map_preview_table_${key}}`}\n className={cls(defaultBorderMixin, \"last:border-b-0 border-b\")}>\n <div\n className={\"flex flex-row pt-0.5 pb-0.5 gap-2\"}>\n <div\n className=\"min-w-[140px] w-[25%] py-1\">\n <Typography variant={\"caption\"}\n className={\"break-words font-semibold\"}\n color={\"secondary\"}>\n {childProperty.name}\n </Typography>\n </div>\n <div\n className=\"grow max-w-[75%]\">\n <ErrorBoundary>\n {!isArrayOrMap &&\n <PropertyPreview\n propertyKey={key}\n value={mapValue[key]}\n property={childProperty}\n // entity={entity}\n size={size}/>}\n </ErrorBoundary>\n </div>\n </div>\n\n {isArrayOrMap &&\n <div className={cls(defaultBorderMixin, \"border-l pl-4 ml-2 my-2\")}>\n <PropertyPreview\n propertyKey={key}\n value={mapValue[key]}\n property={childProperty}\n // entity={entity}\n size={size}/>\n </div>\n }\n </div>\n );\n })}\n </div>\n );\n\n}\n\n/** How many leaf values a one-line map summary shows before it gives up. */\nconst COMPACT_MAP_ENTRIES = 3;\n\n/**\n * A map in one line: its first few leaf values, labelled, joined by dots.\n *\n * Nested maps and arrays are skipped rather than flattened — a line that says\n * `[object Object]` is worse than a line that says nothing about that field —\n * and a map with no leaves at all falls back to stating its size, which is at\n * least true.\n */\nfunction CompactMapPreview({\n property,\n value\n}: { property: MapProperty, value: Record<string, unknown> | undefined }) {\n\n if (!value || typeof value !== \"object\") return <EmptyValue/>;\n\n const declared = property.properties;\n const keys = declared ? Object.keys(declared) : Object.keys(value);\n\n const parts: string[] = [];\n for (const key of keys) {\n if (parts.length >= COMPACT_MAP_ENTRIES) break;\n const childValue = value[key];\n if (childValue === undefined || childValue === null || childValue === \"\") continue;\n if (typeof childValue === \"object\") continue;\n const label = declared?.[key]?.name ?? key;\n parts.push(`${label}: ${String(childValue)}`);\n }\n\n if (parts.length === 0) {\n const count = Object.keys(value).length;\n return <Typography variant={\"caption\"}\n color={\"secondary\"}\n className={\"truncate\"}>\n {count === 1 ? \"1 field\" : `${count} fields`}\n </Typography>;\n }\n\n return <span className={\"truncate text-sm\"}>{parts.join(\" · \")}</span>;\n}\n\nexport function KeyValuePreview({ value }: { value: any }) {\n if (typeof value !== \"object\") return null;\n if (!value) return <EmptyValue/>;\n return <div\n className=\"flex flex-col gap-1 w-full\">\n {\n Object.entries(value).map(([key, childValue]: [string, any]) => (\n <div\n key={`map_preview_table_${key}}`}\n className={cls(defaultBorderMixin, \"last:border-b-0 border-b\")}>\n <div\n className={\"flex flex-row pt-0.5 pb-0.5 gap-2\"}>\n <div\n key={`table-cell-title-${key}-${key}`}\n className=\"min-w-[140px] w-[25%] py-1\">\n <Typography variant={\"caption\"}\n className={\"font-semibold break-words\"}\n color={\"secondary\"}>\n {key}\n </Typography>\n </div>\n <div\n className=\"grow max-w-[75%]\">\n {childValue && typeof childValue !== \"object\" && <Typography>\n <ErrorBoundary>\n {childValue.toString()}\n </ErrorBoundary>\n </Typography>}\n </div>\n </div>\n {typeof childValue === \"object\" &&\n <div className={cls(defaultBorderMixin, \"border-l pl-4\")}>\n <KeyValuePreview value={childValue}/>\n </div>\n }\n </div>\n ))\n }\n </div>;\n}\n"],"mappings":";;;;;;;;;AAYA,SAAgB,mBAAmB,EAC/B,aACA,OACA,UACA,MACA,WACkC;CAElC,IAAI,SAAS,SAAS,OAClB,MAAM,MAAM,mDAAmD;CAGnE,MAAM,cAAc;CAIpB,IAAI,SACA,OAAO,oBAAC,mBAAD;EAAmB,UAAU;EACzB;CAA8C,CAAA;CAG7D,IAAI,CAAC,YAAY,cAAc,OAAO,KAAK,YAAY,cAAc,CAAC,CAAC,CAAC,C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I,oBAAoB,IAAI,GAAG,KAO/B,GACL,oBAAC,OAAD;KACI,WAAU;eACT,cAAc,OAAO,eAAe,YAAY,oBAAC,YAAD,EAAA,UAC7C,oBAAC,eAAD,EAAA,UACK,WAAW,SAAS,EACV,CAAA,EACP,CAAA;IACX,CAAA,CACJ;OACJ,OAAO,eAAe,YACnB,oBAAC,OAAD;IAAK,WAAW,IAAI,oBAAoB,eAAe;cACnD,oBAAC,iBAAD,EAAiB,OAAO,WAAY,CAAA;GACnC,CAAA,CAER;KA3BI,qBAAqB,IAAI,EA2B7B,CACR;CAEJ,CAAA;AACT"}
1
+ {"version":3,"file":"MapPropertyPreview.js","names":[],"sources":["../../../src/preview/property_previews/MapPropertyPreview.tsx"],"sourcesContent":["import type { MapProperty } from \"@rebasepro/cms-types\";\nimport React from \"react\";\n\nimport type { PropertyPreviewProps } from \"../../types/components/PropertyPreviewProps\";\nimport { PropertyPreview } from \"../PropertyPreview\";\nimport { cls, defaultBorderMixin, Typography } from \"@rebasepro/ui\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\nimport { EmptyValue } from \"../components/EmptyValue\";\n\n/**\n * @group Preview components\n */\nexport function MapPropertyPreview({\n propertyKey,\n value,\n property,\n size,\n compact\n}: PropertyPreviewProps<MapProperty>) {\n\n if (property.type !== \"map\") {\n throw Error(\"Picked wrong preview component MapPropertyPreview\");\n }\n\n const mapProperty = property as MapProperty;\n\n // A map is a table — a row per sub-property — and a card line has room for\n // neither the rows nor the borders between them.\n if (compact) {\n return <CompactMapPreview property={mapProperty}\n value={value as Record<string, unknown> | undefined}/>;\n }\n\n if (!mapProperty.properties || Object.keys(mapProperty.properties ?? {}).length === 0) {\n return (\n <KeyValuePreview value={value}/>\n );\n }\n\n if (!value) return null;\n const mapValue = value as Record<string, unknown>;\n\n const mapPropertyKeys: string[] = Object.keys(mapProperty.properties)\n\n if (size === \"small\")\n return (\n <div className=\"w-full flex flex-col space-y-1 md:space-y-2\">\n {mapPropertyKeys.map((key, index) => (\n <div key={`map_${key}`}>\n <ErrorBoundary\n key={\"map_preview_\" + mapProperty.name + key + index}>\n <PropertyPreview propertyKey={key}\n value={mapValue[key]}\n property={mapProperty.properties![key]}\n // entity={entity}\n size={size}/>\n </ErrorBoundary>\n </div>\n ))}\n </div>\n );\n\n return (\n <div\n className=\"flex flex-col gap-1 w-full\">\n {mapPropertyKeys &&\n mapPropertyKeys.map((key, index) => {\n const childProperty = mapProperty.properties![key];\n const isArrayOrMap = childProperty.type === \"map\" || childProperty.type === \"array\";\n return (\n <div\n key={`map_preview_table_${key}}`}\n className={cls(defaultBorderMixin, \"last:border-b-0 border-b\")}>\n <div\n className={\"flex flex-row pt-0.5 pb-0.5 gap-2\"}>\n <div\n className=\"min-w-[140px] w-[25%] py-1\">\n <Typography variant={\"caption\"}\n className={\"break-words font-semibold\"}\n color={\"secondary\"}>\n {childProperty.name}\n </Typography>\n </div>\n <div\n className=\"grow max-w-[75%]\">\n <ErrorBoundary>\n {!isArrayOrMap &&\n <PropertyPreview\n propertyKey={key}\n value={mapValue[key]}\n property={childProperty}\n // entity={entity}\n size={size}/>}\n </ErrorBoundary>\n </div>\n </div>\n\n {isArrayOrMap &&\n <div className={cls(defaultBorderMixin, \"border-l pl-4 ml-2 my-2\")}>\n <PropertyPreview\n propertyKey={key}\n value={mapValue[key]}\n property={childProperty}\n // entity={entity}\n size={size}/>\n </div>\n }\n </div>\n );\n })}\n </div>\n );\n\n}\n\n/** How many leaf values a one-line map summary shows before it gives up. */\nconst COMPACT_MAP_ENTRIES = 3;\n\n/**\n * A map in one line: its first few leaf values, labelled, joined by dots.\n *\n * Nested maps and arrays are skipped rather than flattened — a line that says\n * `[object Object]` is worse than a line that says nothing about that field —\n * and a map with no leaves at all falls back to stating its size, which is at\n * least true.\n */\nfunction CompactMapPreview({\n property,\n value\n}: { property: MapProperty, value: Record<string, unknown> | undefined }) {\n\n if (!value || typeof value !== \"object\") return <EmptyValue/>;\n\n const declared = property.properties;\n const keys = declared ? Object.keys(declared) : Object.keys(value);\n\n const parts: string[] = [];\n for (const key of keys) {\n if (parts.length >= COMPACT_MAP_ENTRIES) break;\n const childValue = value[key];\n if (childValue === undefined || childValue === null || childValue === \"\") continue;\n if (typeof childValue === \"object\") continue;\n const label = declared?.[key]?.name ?? key;\n parts.push(`${label}: ${String(childValue)}`);\n }\n\n if (parts.length === 0) {\n const count = Object.keys(value).length;\n return <Typography variant={\"caption\"}\n color={\"secondary\"}\n className={\"truncate\"}>\n {count === 1 ? \"1 field\" : `${count} fields`}\n </Typography>;\n }\n\n return <span className={\"truncate text-sm\"}>{parts.join(\" · \")}</span>;\n}\n\nexport function KeyValuePreview({ value }: { value: any }) {\n if (typeof value !== \"object\") return null;\n if (!value) return <EmptyValue/>;\n return <div\n className=\"flex flex-col gap-1 w-full\">\n {\n Object.entries(value).map(([key, childValue]: [string, any]) => (\n <div\n key={`map_preview_table_${key}}`}\n className={cls(defaultBorderMixin, \"last:border-b-0 border-b\")}>\n <div\n className={\"flex flex-row pt-0.5 pb-0.5 gap-2\"}>\n <div\n key={`table-cell-title-${key}-${key}`}\n className=\"min-w-[140px] w-[25%] py-1\">\n <Typography variant={\"caption\"}\n className={\"font-semibold break-words\"}\n color={\"secondary\"}>\n {key}\n </Typography>\n </div>\n <div\n className=\"grow max-w-[75%]\">\n {childValue && typeof childValue !== \"object\" && <Typography>\n <ErrorBoundary>\n {childValue.toString()}\n </ErrorBoundary>\n </Typography>}\n </div>\n </div>\n {typeof childValue === \"object\" &&\n <div className={cls(defaultBorderMixin, \"border-l pl-4\")}>\n <KeyValuePreview value={childValue}/>\n </div>\n }\n </div>\n ))\n }\n </div>;\n}\n"],"mappings":";;;;;;;;;AAYA,SAAgB,mBAAmB,EAC/B,aACA,OACA,UACA,MACA,WACkC;CAElC,IAAI,SAAS,SAAS,OAClB,MAAM,MAAM,mDAAmD;CAGnE,MAAM,cAAc;CAIpB,IAAI,SACA,OAAO,oBAAC,mBAAD;EAAmB,UAAU;EACzB;CAA8C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AU;eACV,oBAAC,YAAD;MAAY,SAAS;MACjB,WAAW;MACX,OAAO;gBACN;KACO,CAAA;IACX,GAPI,oBAAoB,IAAI,GAAG,KAO/B,GACL,oBAAC,OAAD;KACI,WAAU;eACT,cAAc,OAAO,eAAe,YAAY,oBAAC,YAAD,EAAA,UAC7C,oBAAC,eAAD,EAAA,UACK,WAAW,SAAS,EACV,CAAA,EACP,CAAA;IACX,CAAA,CACJ;OACJ,OAAO,eAAe,YACnB,oBAAC,OAAD;IAAK,WAAW,IAAI,oBAAoB,eAAe;cACnD,oBAAC,iBAAD,EAAiB,OAAO,WAAY,CAAA;GACnC,CAAA,CAER;KA3BI,qBAAqB,IAAI,EA2B7B,CACR;CAEJ,CAAA;AACT"}
@@ -1,4 +1,4 @@
1
- import type { NumberProperty } from "@rebasepro/types";
1
+ import type { NumberProperty } from "@rebasepro/cms-types";
2
2
  import React from "react";
3
3
  import type { PropertyPreviewProps } from "../../types/components/PropertyPreviewProps.js";
4
4
  /**
@@ -2,7 +2,7 @@ import { EnumValuesChip } from "../components/EnumValuesChip.js";
2
2
  import { formatNumber } from "../../util/number_format.js";
3
3
  import "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
- import { enumToObjectEntries } from "@rebasepro/common";
5
+ import { enumToObjectEntries } from "@rebasepro/cms-types";
6
6
  import { useCustomizationController } from "@rebasepro/app";
7
7
  //#region src/preview/property_previews/NumberPropertyPreview.tsx
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"NumberPropertyPreview.js","names":[],"sources":["../../../src/preview/property_previews/NumberPropertyPreview.tsx"],"sourcesContent":["import type { NumberProperty } from \"@rebasepro/types\";\nimport React from \"react\";\n\nimport { EnumValuesChip } from \"../components/EnumValuesChip\";\nimport type { PropertyPreviewProps } from \"../../types/components/PropertyPreviewProps\";\nimport { enumToObjectEntries } from \"@rebasepro/common\";\nimport { useCustomizationController } from \"@rebasepro/app\";\nimport { formatNumber } from \"../../util/number_format\";\n\n/**\n * @group Preview components\n */\nexport function NumberPropertyPreview({\n value,\n property,\n size\n}: PropertyPreviewProps<NumberProperty>): React.ReactElement {\n\n const customizationController = useCustomizationController();\n const numValue = value as number;\n\n if (property.enum) {\n const enumKey = numValue;\n const enumValues = enumToObjectEntries(property.enum);\n if (!enumValues)\n return <span className={size === \"small\" ? \"font-mono tabular-nums text-sm\" : \"font-mono tabular-nums\"}>{numValue}</span>;\n return <EnumValuesChip\n enumKey={enumKey}\n enumValues={enumValues}\n size={size !== \"medium\" ? \"small\" : \"medium\"}/>;\n } else {\n // `admin.format` only — an undeclared number renders as the number that\n // is in the database, which is the only thing we can honestly claim to\n // know about it.\n return <span className={size === \"small\" ? \"font-mono tabular-nums text-sm\" : \"font-mono tabular-nums\"}>\n {formatNumber(numValue, property.admin?.format, customizationController?.locale)}\n </span>;\n }\n}\n"],"mappings":";;;;;;;;;;AAYA,SAAgB,sBAAsB,EAClC,OACA,UACA,QACyD;CAEzD,MAAM,0BAA0B,2BAA2B;CAC3D,MAAM,WAAW;CAEjB,IAAI,SAAS,MAAM;EACf,MAAM,UAAU;EAChB,MAAM,aAAa,oBAAoB,SAAS,IAAI;EACpD,IAAI,CAAC,YACD,OAAO,oBAAC,QAAD;GAAM,WAAW,SAAS,UAAU,mCAAmC;aAA2B;EAAe,CAAA;EAC5H,OAAO,oBAAC,gBAAD;GACM;GACG;GACZ,MAAM,SAAS,WAAW,UAAU;EAAU,CAAA;CACtD,OAII,OAAO,oBAAC,QAAD;EAAM,WAAW,SAAS,UAAU,mCAAmC;YACzE,aAAa,UAAU,SAAS,OAAO,QAAQ,yBAAyB,MAAM;CAC7E,CAAA;AAEd"}
1
+ {"version":3,"file":"NumberPropertyPreview.js","names":[],"sources":["../../../src/preview/property_previews/NumberPropertyPreview.tsx"],"sourcesContent":["import type { NumberProperty } from \"@rebasepro/cms-types\";\nimport React from \"react\";\n\nimport { EnumValuesChip } from \"../components/EnumValuesChip\";\nimport type { PropertyPreviewProps } from \"../../types/components/PropertyPreviewProps\";\nimport { enumToObjectEntries } from \"@rebasepro/cms-types\";\nimport { useCustomizationController } from \"@rebasepro/app\";\nimport { formatNumber } from \"../../util/number_format\";\n\n/**\n * @group Preview components\n */\nexport function NumberPropertyPreview({\n value,\n property,\n size\n}: PropertyPreviewProps<NumberProperty>): React.ReactElement {\n\n const customizationController = useCustomizationController();\n const numValue = value as number;\n\n if (property.enum) {\n const enumKey = numValue;\n const enumValues = enumToObjectEntries(property.enum);\n if (!enumValues)\n return <span className={size === \"small\" ? \"font-mono tabular-nums text-sm\" : \"font-mono tabular-nums\"}>{numValue}</span>;\n return <EnumValuesChip\n enumKey={enumKey}\n enumValues={enumValues}\n size={size !== \"medium\" ? \"small\" : \"medium\"}/>;\n } else {\n // `admin.format` only — an undeclared number renders as the number that\n // is in the database, which is the only thing we can honestly claim to\n // know about it.\n return <span className={size === \"small\" ? \"font-mono tabular-nums text-sm\" : \"font-mono tabular-nums\"}>\n {formatNumber(numValue, property.admin?.format, customizationController?.locale)}\n </span>;\n }\n}\n"],"mappings":";;;;;;;;;;AAYA,SAAgB,sBAAsB,EAClC,OACA,UACA,QACyD;CAEzD,MAAM,0BAA0B,2BAA2B;CAC3D,MAAM,WAAW;CAEjB,IAAI,SAAS,MAAM;EACf,MAAM,UAAU;EAChB,MAAM,aAAa,oBAAoB,SAAS,IAAI;EACpD,IAAI,CAAC,YACD,OAAO,oBAAC,QAAD;GAAM,WAAW,SAAS,UAAU,mCAAmC;aAA2B;EAAe,CAAA;EAC5H,OAAO,oBAAC,gBAAD;GACM;GACG;GACZ,MAAM,SAAS,WAAW,UAAU;EAAU,CAAA;CACtD,OAII,OAAO,oBAAC,QAAD;EAAM,WAAW,SAAS,UAAU,mCAAmC;YACzE,aAAa,UAAU,SAAS,OAAO,QAAQ,yBAAyB,MAAM;CAC7E,CAAA;AAEd"}
@@ -1,4 +1,4 @@
1
- import type { Property } from "@rebasepro/types";
1
+ import type { Property } from "@rebasepro/cms-types";
2
2
  import { PreviewSize } from "../../types/components/PropertyPreviewProps.js";
3
3
  import React from "react";
4
4
  export interface SkeletonPropertyComponentProps {
@@ -1 +1 @@
1
- {"version":3,"file":"SkeletonPropertyComponent.js","names":[],"sources":["../../../src/preview/property_previews/SkeletonPropertyComponent.tsx"],"sourcesContent":["import type { Properties } from \"@rebasepro/types\";\nimport type { ArrayProperty, MapProperty, Property, StringProperty } from \"@rebasepro/types\";\nimport { PreviewSize } from \"../../types/components/PropertyPreviewProps\";\nimport React from \"react\";\nimport { Skeleton, Table, TableBody, TableRow, TableCell, Typography } from \"@rebasepro/ui\";\nimport { getThumbnailMeasure } from \"../util\";\n\nexport interface SkeletonPropertyComponentProps {\n property: Property,\n size: PreviewSize\n}\n\n/**\n * @group Preview components\n */\nexport function SkeletonPropertyComponent({\n property,\n size\n}: SkeletonPropertyComponentProps\n) {\n\n if (!property) {\n console.error(\"No property assigned for skeleton component\", property, size);\n }\n\n let content: React.ReactNode | any;\n if (property.type === \"string\") {\n const stringProperty = property as StringProperty;\n if (stringProperty.admin?.urlPreview) {\n content = renderUrlComponent(stringProperty, size);\n } else if (stringProperty.storage) {\n content = renderSkeletonImageThumbnail(size);\n } else {\n content = renderSkeletonText();\n }\n } else if (property.type === \"array\") {\n const arrayProperty = property as ArrayProperty;\n\n if (arrayProperty.of) {\n if (Array.isArray(arrayProperty.of)) {\n content = <>{arrayProperty.of.map((p, i) => renderGenericArrayCell(p, i))} </>;\n } else {\n if (arrayProperty.of.type === \"map\" && arrayProperty.of.properties) {\n content = renderArrayOfMaps(arrayProperty.of.properties, size, arrayProperty.of.admin?.previewProperties);\n } else if (arrayProperty.of.type === \"string\") {\n if (arrayProperty.of.enum) {\n content = renderArrayEnumTableCell();\n } else if (arrayProperty.of.storage) {\n content = renderGenericArrayCell(arrayProperty.of);\n } else {\n content = renderArrayOfStrings();\n }\n } else {\n content = renderGenericArrayCell(arrayProperty.of);\n }\n }\n }\n\n } else if (property.type === \"map\") {\n content = renderMap(property as MapProperty, size);\n } else if (property.type === \"date\") {\n content = renderSkeletonText();\n } else if (property.type === \"reference\") {\n content = renderReference();\n } else if (property.type === \"boolean\") {\n content = renderSkeletonText();\n } else {\n content = renderSkeletonText();\n }\n return (content || null);\n}\n\nfunction renderMap<T extends Record<string, any>>(property: MapProperty, size: PreviewSize) {\n\n if (!property.properties)\n return <></>;\n\n let mapPropertyKeys: string[];\n if (size === \"large\") {\n mapPropertyKeys = Object.keys(property.properties);\n } else {\n mapPropertyKeys = (property.admin?.previewProperties || Object.keys(property.properties)) as string[];\n if (size === \"medium\")\n mapPropertyKeys = mapPropertyKeys.slice(0, 3);\n else if (size === \"small\")\n mapPropertyKeys = mapPropertyKeys.slice(0, 1);\n }\n\n if (size !== \"large\")\n return (\n <div\n className=\"w-full flex flex-col space-y-4\"\n >\n {mapPropertyKeys.map((key, index) => (\n <div key={`map_${key}`}>\n {property.properties && property.properties[key] &&\n <SkeletonPropertyComponent\n property={property.properties[key]}\n size={\"medium\"}/>}\n </div>\n ))}\n </div>\n );\n\n return (\n <Table className=\"table-auto\">\n <TableBody>\n {mapPropertyKeys &&\n mapPropertyKeys.map((key, index) => {\n return (\n <TableRow\n key={`map_preview_table__${index}`}>\n <TableCell key={`table-cell-title--${key}`}\n className=\"align-top\"\n style={{ width: \"30%\" }}>\n <Typography variant=\"caption\" color=\"secondary\">\n {property.properties![key].name}\n </Typography>\n </TableCell>\n <TableCell key={`table-cell-${key}`}\n style={{ width: \"70%\" }}>\n {property.properties && property.properties[key] &&\n <SkeletonPropertyComponent\n property={property.properties[key]}\n size={\"medium\"}/>}\n </TableCell>\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n );\n}\n\nfunction renderArrayOfMaps(properties: Properties, size: PreviewSize, previewProperties?: string[]) {\n let tableProperties = previewProperties;\n if (!tableProperties || !tableProperties.length) {\n tableProperties = Object.keys(properties) as string[];\n if (size)\n tableProperties = tableProperties.slice(0, 3);\n }\n\n return (\n <Table className=\"table-auto\">\n <TableBody>\n {\n [0, 1, 2].map((value, index) => {\n return (\n <TableRow key={`table_${value}_${index}`}>\n {tableProperties && tableProperties.map(\n (key) => (\n <TableCell\n key={`table-cell-${key}`}\n >\n <SkeletonPropertyComponent\n property={(properties)[key]}\n size={\"medium\"}/>\n </TableCell>\n )\n )}\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n );\n}\n\nfunction renderArrayOfStrings() {\n return (\n <div className={\"flex flex-col gap-2\"}>\n {\n [0, 1].map((value, index) => (\n renderSkeletonText(index)\n ))}\n </div>\n );\n}\n\nfunction renderArrayEnumTableCell() {\n return (\n <div className={\"flex flex-col gap-2\"}>\n {\n [0, 1].map((value, index) =>\n <>\n {renderSkeletonText(index)}\n </>\n )}\n </div>\n );\n}\n\nfunction renderGenericArrayCell(\n property: Property,\n index = 0\n) {\n return (\n\n <div key={\"array_index_\" + index}\n className={\"flex flex-col gap-2\"}>\n\n {\n [0, 1].map((value, index) =>\n <>\n <SkeletonPropertyComponent key={`i_${index}`}\n property={property}\n size={\"medium\"}/>\n </>\n )}\n </div>\n );\n}\n\nfunction renderUrlAudioComponent() {\n return (\n <Skeleton width={300}\n height={100}/>\n );\n}\n\nexport function renderSkeletonImageThumbnail(size: PreviewSize) {\n const imageSize = size === \"small\" ? 40 : size === \"medium\" ? 100 : 200;\n return (\n <Skeleton width={imageSize}\n height={imageSize}/>\n );\n}\n\nfunction renderUrlVideo(size: PreviewSize) {\n\n return (\n <Skeleton width={size !== \"large\" ? 300 : 500}\n height={size !== \"large\" ? 200 : 250}/>\n );\n}\n\nfunction renderReference() {\n return <Skeleton width={200} height={100}/>;\n}\n\nfunction renderUrlComponent(property: StringProperty, size: PreviewSize = \"large\") {\n\n if (typeof property.admin?.urlPreview === \"boolean\") {\n return <div style={{\n display: \"flex\"\n }}>\n {renderSkeletonIcon()}\n {renderSkeletonText()}\n </div>;\n }\n\n return renderUrlFile(size);\n}\n\nfunction renderUrlFile(size: PreviewSize) {\n\n return (\n <div\n className={`w-${getThumbnailMeasure(size)} h-${getThumbnailMeasure(size)}`}>\n {renderSkeletonIcon()}\n </div>\n );\n}\n\nexport function renderSkeletonText(index?: number, width = 120) {\n return <Skeleton width={width} key={`skeleton_${index}`}/>;\n}\n\nexport function renderSkeletonCaptionText(index?: number) {\n return <Skeleton\n height={20}/>;\n}\n\nexport function renderSkeletonIcon() {\n return <Skeleton width={24} height={24}/>;\n}\n"],"mappings":";;;;;;;;AAeA,SAAgB,0BAA0B,EACtC,UACA,QAEF;CAEE,IAAI,CAAC,UACD,QAAQ,MAAM,+CAA+C,UAAU,IAAI;CAG/E,IAAI;CACJ,IAAI,SAAS,SAAS,UAAU;EAC5B,MAAM,iBAAiB;EACvB,IAAI,eAAe,OAAO,YACtB,UAAU,mBAAmB,gBAAgB,IAAI;OAC9C,IAAI,eAAe,SACtB,UAAU,6BAA6B,IAAI;OAE3C,UAAU,mBAAmB;CAErC,OAAO,IAAI,SAAS,SAAS,SAAS;EAClC,MAAM,gBAAgB;EAEtB,IAAI,cAAc,IACd,IAAI,MAAM,QAAQ,cAAc,EAAE,GAC9B,UAAU,qBAAA,UAAA,EAAA,UAAA,CAAG,cAAc,GAAG,KAAK,GAAG,MAAM,uBAAuB,GAAG,CAAC,CAAC,GAAE,GAAG,EAAA,CAAA;OAE7E,IAAI,cAAc,GAAG,SAAS,SAAS,cAAc,GAAG,YACpD,UAAU,kBAAkB,cAAc,GAAG,YAAY,MAAM,cAAc,GAAG,OAAO,iBAAiB;OACrG,IAAI,cAAc,GAAG,SAAS,UACjC,IAAI,cAAc,GAAG,MACjB,UAAU,yBAAyB;OAChC,IAAI,cAAc,GAAG,SACxB,UAAU,uBAAuB,cAAc,EAAE;OAEjD,UAAU,qBAAqB;OAGnC,UAAU,uBAAuB,cAAc,EAAE;CAKjE,OAAO,IAAI,SAAS,SAAS,OACzB,UAAU,UAAU,UAAyB,IAAI;MAC9C,IAAI,SAAS,SAAS,QACzB,UAAU,mBAAmB;MAC1B,IAAI,SAAS,SAAS,aACzB,UAAU,gBAAgB;MACvB,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ACpE,OACI,oBAAC,UAAD;EAAU,OAAO;EACb,QAAQ;CAAW,CAAA;AAE/B;AAUA,SAAS,kBAAkB;CACvB,OAAO,oBAAC,UAAD;EAAU,OAAO;EAAK,QAAQ;CAAK,CAAA;AAC9C;AAEA,SAAS,mBAAmB,UAA0B,OAAoB,SAAS;CAE/E,IAAI,OAAO,SAAS,OAAO,eAAe,WACtC,OAAO,qBAAC,OAAD;EAAK,OAAO,EACf,SAAS,OACb;YAFO,CAGF,mBAAmB,GACnB,mBAAmB,CACnB;;CAGT,OAAO,cAAc,IAAI;AAC7B;AAEA,SAAS,cAAc,MAAmB;CAEtC,OACI,oBAAC,OAAD;EACI,WAAW,KAAK,oBAAoB,IAAI,EAAE,KAAK,oBAAoB,IAAI;YACtE,mBAAmB;CACnB,CAAA;AAEb;AAEA,SAAgB,mBAAmB,OAAgB,QAAQ,KAAK;CAC5D,OAAO,oBAAC,UAAD,EAAiB,MAAiC,GAArB,YAAY,OAAS;AAC7D;AAEA,SAAgB,0BAA0B,OAAgB;CACtD,OAAO,oBAAC,UAAD,EACH,QAAQ,GAAI,CAAA;AACpB;AAEA,SAAgB,qBAAqB;CACjC,OAAO,oBAAC,UAAD;EAAU,OAAO;EAAI,QAAQ;CAAI,CAAA;AAC5C"}
1
+ {"version":3,"file":"SkeletonPropertyComponent.js","names":[],"sources":["../../../src/preview/property_previews/SkeletonPropertyComponent.tsx"],"sourcesContent":["import type { Properties } from \"@rebasepro/cms-types\";\nimport type { ArrayProperty, MapProperty, Property, StringProperty } from \"@rebasepro/cms-types\";\nimport { PreviewSize } from \"../../types/components/PropertyPreviewProps\";\nimport React from \"react\";\nimport { Skeleton, Table, TableBody, TableRow, TableCell, Typography } from \"@rebasepro/ui\";\nimport { getThumbnailMeasure } from \"../util\";\n\nexport interface SkeletonPropertyComponentProps {\n property: Property,\n size: PreviewSize\n}\n\n/**\n * @group Preview components\n */\nexport function SkeletonPropertyComponent({\n property,\n size\n}: SkeletonPropertyComponentProps\n) {\n\n if (!property) {\n console.error(\"No property assigned for skeleton component\", property, size);\n }\n\n let content: React.ReactNode | any;\n if (property.type === \"string\") {\n const stringProperty = property as StringProperty;\n if (stringProperty.admin?.urlPreview) {\n content = renderUrlComponent(stringProperty, size);\n } else if (stringProperty.storage) {\n content = renderSkeletonImageThumbnail(size);\n } else {\n content = renderSkeletonText();\n }\n } else if (property.type === \"array\") {\n const arrayProperty = property as ArrayProperty;\n\n if (arrayProperty.of) {\n if (Array.isArray(arrayProperty.of)) {\n content = <>{arrayProperty.of.map((p, i) => renderGenericArrayCell(p, i))} </>;\n } else {\n if (arrayProperty.of.type === \"map\" && arrayProperty.of.properties) {\n content = renderArrayOfMaps(arrayProperty.of.properties, size, arrayProperty.of.admin?.previewProperties);\n } else if (arrayProperty.of.type === \"string\") {\n if (arrayProperty.of.enum) {\n content = renderArrayEnumTableCell();\n } else if (arrayProperty.of.storage) {\n content = renderGenericArrayCell(arrayProperty.of);\n } else {\n content = renderArrayOfStrings();\n }\n } else {\n content = renderGenericArrayCell(arrayProperty.of);\n }\n }\n }\n\n } else if (property.type === \"map\") {\n content = renderMap(property as MapProperty, size);\n } else if (property.type === \"date\") {\n content = renderSkeletonText();\n } else if (property.type === \"reference\") {\n content = renderReference();\n } else if (property.type === \"boolean\") {\n content = renderSkeletonText();\n } else {\n content = renderSkeletonText();\n }\n return (content || null);\n}\n\nfunction renderMap<T extends Record<string, any>>(property: MapProperty, size: PreviewSize) {\n\n if (!property.properties)\n return <></>;\n\n let mapPropertyKeys: string[];\n if (size === \"large\") {\n mapPropertyKeys = Object.keys(property.properties);\n } else {\n mapPropertyKeys = (property.admin?.previewProperties || Object.keys(property.properties)) as string[];\n if (size === \"medium\")\n mapPropertyKeys = mapPropertyKeys.slice(0, 3);\n else if (size === \"small\")\n mapPropertyKeys = mapPropertyKeys.slice(0, 1);\n }\n\n if (size !== \"large\")\n return (\n <div\n className=\"w-full flex flex-col space-y-4\"\n >\n {mapPropertyKeys.map((key, index) => (\n <div key={`map_${key}`}>\n {property.properties && property.properties[key] &&\n <SkeletonPropertyComponent\n property={property.properties[key]}\n size={\"medium\"}/>}\n </div>\n ))}\n </div>\n );\n\n return (\n <Table className=\"table-auto\">\n <TableBody>\n {mapPropertyKeys &&\n mapPropertyKeys.map((key, index) => {\n return (\n <TableRow\n key={`map_preview_table__${index}`}>\n <TableCell key={`table-cell-title--${key}`}\n className=\"align-top\"\n style={{ width: \"30%\" }}>\n <Typography variant=\"caption\" color=\"secondary\">\n {property.properties![key].name}\n </Typography>\n </TableCell>\n <TableCell key={`table-cell-${key}`}\n style={{ width: \"70%\" }}>\n {property.properties && property.properties[key] &&\n <SkeletonPropertyComponent\n property={property.properties[key]}\n size={\"medium\"}/>}\n </TableCell>\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n );\n}\n\nfunction renderArrayOfMaps(properties: Properties, size: PreviewSize, previewProperties?: string[]) {\n let tableProperties = previewProperties;\n if (!tableProperties || !tableProperties.length) {\n tableProperties = Object.keys(properties) as string[];\n if (size)\n tableProperties = tableProperties.slice(0, 3);\n }\n\n return (\n <Table className=\"table-auto\">\n <TableBody>\n {\n [0, 1, 2].map((value, index) => {\n return (\n <TableRow key={`table_${value}_${index}`}>\n {tableProperties && tableProperties.map(\n (key) => (\n <TableCell\n key={`table-cell-${key}`}\n >\n <SkeletonPropertyComponent\n property={(properties)[key]}\n size={\"medium\"}/>\n </TableCell>\n )\n )}\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n );\n}\n\nfunction renderArrayOfStrings() {\n return (\n <div className={\"flex flex-col gap-2\"}>\n {\n [0, 1].map((value, index) => (\n renderSkeletonText(index)\n ))}\n </div>\n );\n}\n\nfunction renderArrayEnumTableCell() {\n return (\n <div className={\"flex flex-col gap-2\"}>\n {\n [0, 1].map((value, index) =>\n <>\n {renderSkeletonText(index)}\n </>\n )}\n </div>\n );\n}\n\nfunction renderGenericArrayCell(\n property: Property,\n index = 0\n) {\n return (\n\n <div key={\"array_index_\" + index}\n className={\"flex flex-col gap-2\"}>\n\n {\n [0, 1].map((value, index) =>\n <>\n <SkeletonPropertyComponent key={`i_${index}`}\n property={property}\n size={\"medium\"}/>\n </>\n )}\n </div>\n );\n}\n\nfunction renderUrlAudioComponent() {\n return (\n <Skeleton width={300}\n height={100}/>\n );\n}\n\nexport function renderSkeletonImageThumbnail(size: PreviewSize) {\n const imageSize = size === \"small\" ? 40 : size === \"medium\" ? 100 : 200;\n return (\n <Skeleton width={imageSize}\n height={imageSize}/>\n );\n}\n\nfunction renderUrlVideo(size: PreviewSize) {\n\n return (\n <Skeleton width={size !== \"large\" ? 300 : 500}\n height={size !== \"large\" ? 200 : 250}/>\n );\n}\n\nfunction renderReference() {\n return <Skeleton width={200} height={100}/>;\n}\n\nfunction renderUrlComponent(property: StringProperty, size: PreviewSize = \"large\") {\n\n if (typeof property.admin?.urlPreview === \"boolean\") {\n return <div style={{\n display: \"flex\"\n }}>\n {renderSkeletonIcon()}\n {renderSkeletonText()}\n </div>;\n }\n\n return renderUrlFile(size);\n}\n\nfunction renderUrlFile(size: PreviewSize) {\n\n return (\n <div\n className={`w-${getThumbnailMeasure(size)} h-${getThumbnailMeasure(size)}`}>\n {renderSkeletonIcon()}\n </div>\n );\n}\n\nexport function renderSkeletonText(index?: number, width = 120) {\n return <Skeleton width={width} key={`skeleton_${index}`}/>;\n}\n\nexport function renderSkeletonCaptionText(index?: number) {\n return <Skeleton\n height={20}/>;\n}\n\nexport function renderSkeletonIcon() {\n return <Skeleton width={24} height={24}/>;\n}\n"],"mappings":";;;;;;;;AAeA,SAAgB,0BAA0B,EACtC,UACA,QAEF;CAEE,IAAI,CAAC,UACD,QAAQ,MAAM,+CAA+C,UAAU,IAAI;CAG/E,IAAI;CACJ,IAAI,SAAS,SAAS,UAAU;EAC5B,MAAM,iBAAiB;EACvB,IAAI,eAAe,OAAO,YACtB,UAAU,mBAAmB,gBAAgB,IAAI;OAC9C,IAAI,eAAe,SACtB,UAAU,6BAA6B,IAAI;OAE3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gB,mBAAmB,OAAgB,QAAQ,KAAK;CAC5D,OAAO,oBAAC,UAAD,EAAiB,MAAiC,GAArB,YAAY,OAAS;AAC7D;AAEA,SAAgB,0BAA0B,OAAgB;CACtD,OAAO,oBAAC,UAAD,EACH,QAAQ,GAAI,CAAA;AACpB;AAEA,SAAgB,qBAAqB;CACjC,OAAO,oBAAC,UAAD;EAAU,OAAO;EAAI,QAAQ;CAAI,CAAA;AAC5C"}
@@ -1,4 +1,4 @@
1
- import type { StringProperty } from "@rebasepro/types";
1
+ import type { StringProperty } from "@rebasepro/cms-types";
2
2
  import React from "react";
3
3
  import type { PropertyPreviewProps } from "../../types/components/PropertyPreviewProps.js";
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"StringPropertyPreview.js","names":[],"sources":["../../../src/preview/property_previews/StringPropertyPreview.tsx"],"sourcesContent":["import type { StringProperty } from \"@rebasepro/types\";\nimport React from \"react\";\n\nimport { EnumValuesChip } from \"../components/EnumValuesChip\";\nimport { PreviewType } from \"@rebasepro/cms-types\";\nimport type { PropertyPreviewProps } from \"../../types/components/PropertyPreviewProps\";\nimport { UrlComponentPreview } from \"../components/UrlComponentPreview\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\nimport { Chip, cls, getColorSchemeForSeed } from \"@rebasepro/ui\";\nimport { collapseToSingleLine } from \"../compact_text\";\n\n/**\n * @group Preview components\n */\nexport function StringPropertyPreview({\n propertyKey,\n value,\n property,\n size,\n textOnly,\n compact\n}: PropertyPreviewProps<StringProperty>): React.ReactElement {\n\n const strValue = value as string;\n\n if (property.enum) {\n const enumKey = strValue;\n return <EnumValuesChip\n enumKey={enumKey}\n enumValues={property.enum}\n size={size}/>;\n } else if (property.admin?.previewAsTag) {\n const colorScheme = getColorSchemeForSeed(propertyKey ?? \"\");\n return (\n <ErrorBoundary>\n <Chip\n colorScheme={colorScheme}\n size={size}>\n {strValue}\n </Chip>\n </ErrorBoundary>);\n } else if (property.admin?.urlPreview || property.url) {\n // `url: true` is the DATA statement — this string is a URI — and on its\n // own that is enough to render a link. It used to take a second,\n // presentational flag as well, so a property that had correctly declared\n // itself a URL still rendered as plain text you had to select and copy.\n //\n // `urlPreview` keeps its own job: upgrading that link to an inline\n // rendering of the thing it points at (an image, a video, a file card).\n // Absent, `UrlComponentPreview` draws an external-link icon and the URL,\n // which is what a link is.\n return (\n <UrlComponentPreview size={size}\n url={strValue}\n previewType={typeof property.admin?.urlPreview === \"string\" ? property.admin?.urlPreview as PreviewType : undefined}/>\n );\n } else {\n if (!strValue) return <></>;\n // A title/subtitle (textOnly) or a card line (compact) is one line, and\n // `truncate` only clamps text that has no newlines of its own to break\n // on — so the newlines come out here rather than in CSS.\n if (textOnly || compact) {\n const singleLine = collapseToSingleLine(strValue);\n return size === \"small\"\n ? <span className={\"text-sm\"}>{singleLine}</span>\n : <>{singleLine}</>;\n }\n return strValue.includes(\"\\n\")\n ? <div className={cls(\n \"whitespace-pre-line line-clamp-3 overflow-hidden\",\n size === \"small\" ? \"text-sm\" : \"\")}>\n {strValue}\n </div>\n : (size === \"small\"\n ? <span className={\"text-sm\"}>{strValue}</span>\n : <>{strValue}</>\n );\n }\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,sBAAsB,EAClC,aACA,OACA,UACA,MACA,UACA,WACyD;CAEzD,MAAM,WAAW;CAEjB,IAAI,SAAS,MAET,OAAO,oBAAC,gBAAD;EACM,SAAA;EACT,YAAY,SAAS;EACf;CAAM,CAAA;MACb,IAAI,SAAS,OAAO,cAEvB,OACI,oBAAC,eAAD,EAAA,UACI,oBAAC,MAAD;EACiB,aAJL,sBAAsB,eAAe,EAIhC;EACP;YACL;CACC,CAAA,EACK,CAAA;MAChB,IAAI,SAAS,OAAO,cAAc,SAAS,KAU9C,OACI,oBAAC,qBAAD;EAA2B;EACvB,KAAK;EACL,aAAa,OAAO,SAAS,OAAO,eAAe,WAAW,SAAS,OAAO,aAA4B,KAAA;CAAW,CAAA;MAE1H;EACH,IAAI,CAAC,UAAU,OAAO,oBAAA,UAAA,CAAI,CAAA;EAI1B,IAAI,YAAY,SAAS;GACrB,MAAM,aAAa,qBAAqB,QAAQ;GAChD,OAAO,SAAS,UACV,oBAAC,QAAD;IAAM,WAAW;cAAY;GAAiB,CAAA,IAC9C,oBAAA,UAAA,EAAA,UAAG,WAAa,CAAA;EAC1B;EACA,OAAO,SAAS,SAAS,IAAI,IACvB,oBAAC,OAAD;GAAK,WAAW,IACd,oDACA,SAAS,UAAU,YAAY,EAAE;aAChC;EACA,CAAA,IACF,SAAS,UACN,oBAAC,QAAD;GAAM,WAAW;aAAY;EAAe,CAAA,IAC5C,oBAAA,UAAA,EAAA,UAAG,SAAW,CAAA;CAE5B;AACJ"}
1
+ {"version":3,"file":"StringPropertyPreview.js","names":[],"sources":["../../../src/preview/property_previews/StringPropertyPreview.tsx"],"sourcesContent":["import type { StringProperty } from \"@rebasepro/cms-types\";\nimport React from \"react\";\n\nimport { EnumValuesChip } from \"../components/EnumValuesChip\";\nimport { PreviewType } from \"@rebasepro/cms-types\";\nimport type { PropertyPreviewProps } from \"../../types/components/PropertyPreviewProps\";\nimport { UrlComponentPreview } from \"../components/UrlComponentPreview\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\nimport { Chip, cls, getColorSchemeForSeed } from \"@rebasepro/ui\";\nimport { collapseToSingleLine } from \"../compact_text\";\n\n/**\n * @group Preview components\n */\nexport function StringPropertyPreview({\n propertyKey,\n value,\n property,\n size,\n textOnly,\n compact\n}: PropertyPreviewProps<StringProperty>): React.ReactElement {\n\n const strValue = value as string;\n\n if (property.enum) {\n const enumKey = strValue;\n return <EnumValuesChip\n enumKey={enumKey}\n enumValues={property.enum}\n size={size}/>;\n } else if (property.admin?.previewAsTag) {\n const colorScheme = getColorSchemeForSeed(propertyKey ?? \"\");\n return (\n <ErrorBoundary>\n <Chip\n colorScheme={colorScheme}\n size={size}>\n {strValue}\n </Chip>\n </ErrorBoundary>);\n } else if (property.admin?.urlPreview || property.url) {\n // `url: true` is the DATA statement — this string is a URI — and on its\n // own that is enough to render a link. It used to take a second,\n // presentational flag as well, so a property that had correctly declared\n // itself a URL still rendered as plain text you had to select and copy.\n //\n // `urlPreview` keeps its own job: upgrading that link to an inline\n // rendering of the thing it points at (an image, a video, a file card).\n // Absent, `UrlComponentPreview` draws an external-link icon and the URL,\n // which is what a link is.\n return (\n <UrlComponentPreview size={size}\n url={strValue}\n previewType={typeof property.admin?.urlPreview === \"string\" ? property.admin?.urlPreview as PreviewType : undefined}/>\n );\n } else {\n if (!strValue) return <></>;\n // A title/subtitle (textOnly) or a card line (compact) is one line, and\n // `truncate` only clamps text that has no newlines of its own to break\n // on — so the newlines come out here rather than in CSS.\n if (textOnly || compact) {\n const singleLine = collapseToSingleLine(strValue);\n return size === \"small\"\n ? <span className={\"text-sm\"}>{singleLine}</span>\n : <>{singleLine}</>;\n }\n return strValue.includes(\"\\n\")\n ? <div className={cls(\n \"whitespace-pre-line line-clamp-3 overflow-hidden\",\n size === \"small\" ? \"text-sm\" : \"\")}>\n {strValue}\n </div>\n : (size === \"small\"\n ? <span className={\"text-sm\"}>{strValue}</span>\n : <>{strValue}</>\n );\n }\n}\n"],"mappings":";;;;;;;;;;AAcA,SAAgB,sBAAsB,EAClC,aACA,OACA,UACA,MACA,UACA,WACyD;CAEzD,MAAM,WAAW;CAEjB,IAAI,SAAS,MAET,OAAO,oBAAC,gBAAD;EACM,SAAA;EACT,YAAY,SAAS;EACf;CAAM,CAAA;MACb,IAAI,SAAS,OAAO,cAEvB,OACI,oBAAC,eAAD,EAAA,UACI,oBAAC,MAAD;EACiB,aAJL,sBAAsB,eAAe,EAIhC;EACP;YACL;CACC,CAAA,EACK,CAAA;MAChB,IAAI,SAAS,OAAO,cAAc,SAAS,KAU9C,OACI,oBAAC,qBAAD;EAA2B;EACvB,KAAK;EACL,aAAa,OAAO,SAAS,OAAO,eAAe,WAAW,SAAS,OAAO,aAA4B,KAAA;CAAW,CAAA;MAE1H;EACH,IAAI,CAAC,UAAU,OAAO,oBAAA,UAAA,CAAI,CAAA;EAI1B,IAAI,YAAY,SAAS;GACrB,MAAM,aAAa,qBAAqB,QAAQ;GAChD,OAAO,SAAS,UACV,oBAAC,QAAD;IAAM,WAAW;cAAY;GAAiB,CAAA,IAC9C,oBAAA,UAAA,EAAA,UAAG,WAAa,CAAA;EAC1B;EACA,OAAO,SAAS,SAAS,IAAI,IACvB,oBAAC,OAAD;GAAK,WAAW,IACd,oDACA,SAAS,UAAU,YAAY,EAAE;aAChC;EACA,CAAA,IACF,SAAS,UACN,oBAAC,QAAD;GAAM,WAAW;aAAY;EAAe,CAAA,IAC5C,oBAAA,UAAA,EAAA,UAAG,SAAW,CAAA;CAE5B;AACJ"}
@@ -1,5 +1,5 @@
1
1
  import { CollectionSize } from "@rebasepro/cms-types";
2
- import type { DateProperty } from "@rebasepro/types";
2
+ import type { DateProperty } from "@rebasepro/cms-types";
3
3
  import type { PreviewSize } from "../types/components/PropertyPreviewProps.js";
4
4
  export declare function sanitizeUrl(url: string | undefined): string;
5
5
  export declare const SMALL_THUMBNAIL = 40;
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","names":[],"sources":["../../src/preview/util.ts"],"sourcesContent":["import { CollectionSize } from \"@rebasepro/cms-types\";\nimport type { DateProperty } from \"@rebasepro/types\";\nimport type { PreviewSize } from \"../types/components/PropertyPreviewProps\";\n/**\n * The schemes a preview link may use — everything else becomes `about:blank`.\n *\n * An allowlist, because the blocklist it replaces could be walked around and\n * the walk-arounds are not exotic. Browsers strip tabs, newlines and carriage\n * returns from a URL before parsing the scheme, so `java\\tscript:alert(1)` and\n * `java%0ascript:…` navigate exactly as `javascript:` does while matching none\n * of the names a blocklist knows. A leading control character does the same.\n *\n * Turned around, none of that matters: a string is either one of these four\n * schemes or it is not a link this panel will follow. `mailto:` and `tel:` are\n * here because a contact field is an ordinary thing to preview; `data:` is not,\n * even for images — a preview renders an `<img>` from its own value rather than\n * navigating to one.\n *\n * Relative URLs are allowed and deliberately: a preview commonly holds\n * `/uploads/x.png`, and a string with no scheme cannot carry one.\n */\nconst ALLOWED_URL_SCHEMES = new Set([\"http:\", \"https:\", \"mailto:\", \"tel:\"]);\n\nexport function sanitizeUrl(url: string | undefined): string {\n if (!url) return \"about:blank\";\n\n // The characters a browser removes before it decides what the scheme is.\n // Stripped here for the same reason, so this function is looking at the\n // string the browser will act on rather than the one it was handed.\n //\n // The control characters are the point, so the rule that objects to them is\n // off for this line rather than the expression rewritten to hide them from\n // it: `java\\tscript:` and `java\\nscript:` are the bypasses this exists to\n // close, and a regex that cannot name a control character cannot remove one.\n // eslint-disable-next-line no-control-regex\n const trimmed = url.trim().replace(/[\\u0000-\\u001F\\u007F]/g, \"\");\n if (!trimmed) return \"about:blank\";\n\n // No scheme at all — a relative link, which cannot navigate anywhere the\n // page could not already reach.\n if (!/^[a-z][a-z0-9+.-]*:/i.test(trimmed)) return trimmed;\n\n try {\n // `new URL` normalizes percent-encoding and case, so\n // `JaVaScRiPt%3aalert(1)` is judged as what it resolves to. The base is\n // there only so a protocol-relative `//host/path` parses.\n const parsed = new URL(trimmed, \"https://example.invalid\");\n return ALLOWED_URL_SCHEMES.has(parsed.protocol) ? trimmed : \"about:blank\";\n } catch {\n return \"about:blank\";\n }\n}\n\nexport const SMALL_THUMBNAIL = 40;\nexport const MEDIUM_THUMBNAIL = 100;\nexport const LARGE_THUMBNAIL = 200;\n\nexport function getThumbnailMeasure(size: PreviewSize): number {\n if (size === \"small\")\n return SMALL_THUMBNAIL;\n else if (size === \"medium\")\n return MEDIUM_THUMBNAIL;\n else if (size === \"large\")\n return LARGE_THUMBNAIL;\n else throw Error(\"Thumbnail size not mapped\");\n}\n\nexport function getPreviewSizeFrom(size: CollectionSize): PreviewSize {\n switch (size) {\n case \"xs\":\n case \"s\":\n case \"m\":\n return \"small\";\n case \"l\":\n return \"medium\";\n case \"xl\":\n return \"large\";\n default:\n throw Error(\"Missing mapping value in getPreviewSizeFrom: \" + size);\n }\n}\n\n/**\n * The zone a date property is shown and entered in.\n *\n * A `columnType: \"date\"` column holds a calendar day with no zone. It travels\n * as that day's UTC midnight, and Postgres keeps the date part of whatever it\n * is given, so it is read and written in UTC. In the browser's own zone a\n * stored 15th showed as the 14th west of Greenwich, and a 15th picked east of\n * it was stored as the 14th.\n *\n * A `columnType: \"time\"` column holds a time of day with no zone, and travels\n * as that time on 1970-01-01 UTC, so it is shown in UTC too: in the browser's\n * zone a stored 09:30 read as 10:30 in Rome.\n *\n * Any other date is shown in the property's declared `timezone`, or the\n * browser's when it declares none.\n */\nexport function getDatePropertyTimezone(property: DateProperty): string | undefined {\n return property.columnType === \"date\" || property.columnType === \"time\" ? \"UTC\" : property.timezone;\n}\n\n/**\n * Whether a date property is picked and shown as a day, a day and a time, or\n * a time of day. A `date` column holds no time, so it is a day whatever `mode`\n * says; a `time` column holds no day, so it is a time of day.\n */\nexport function getDatePropertyMode(property: DateProperty): \"date\" | \"date_time\" | \"time\" | undefined {\n if (property.columnType === \"date\") return \"date\";\n if (property.columnType === \"time\") return \"time\";\n return property.mode;\n}\n\n/**\n * Whether a value has nothing to show: absent, a blank string, an empty list.\n * A preview of one draws the empty marker, which is the right thing for a\n * column of values and the wrong thing for the one line under a record's name.\n */\nexport function isEmptyPreviewValue(value: unknown): boolean {\n if (value === undefined || value === null) return true;\n if (typeof value === \"string\") return value.trim() === \"\";\n if (Array.isArray(value)) return value.length === 0;\n return false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,IAAM,sCAAsB,IAAI,IAAI;CAAC;CAAS;CAAU;CAAW;AAAM,CAAC;AAE1E,SAAgB,YAAY,KAAiC;CACzD,IAAI,CAAC,KAAK,OAAO;CAWjB,MAAM,UAAU,IAAI,KAAK,CAAC,CAAC,QAAQ,0BAA0B,EAAE;CAC/D,IAAI,CAAC,SAAS,OAAO;CAIrB,IAAI,CAAC,uBAAuB,KAAK,OAAO,GAAG,OAAO;CAElD,IAAI;EAIA,MAAM,SAAS,IAAI,IAAI,SAAS,yBAAyB;EACzD,OAAO,oBAAoB,IAAI,OAAO,QAAQ,IAAI,UAAU;CAChE,QAAQ;EACJ,OAAO;CACX;AACJ;AAMA,SAAgB,oBAAoB,MAA2B;CAC3D,IAAI,SAAS,SACT,OAAA;MACC,IAAI,SAAS,UACd,OAAA;MACC,IAAI,SAAS,SACd,OAAA;MACC,MAAM,MAAM,2BAA2B;AAChD;AAEA,SAAgB,mBAAmB,MAAmC;CAClE,QAAQ,MAAR;EACI,KAAK;EACL,KAAK;EACL,KAAK,KACD,OAAO;EACX,KAAK,KACD,OAAO;EACX,KAAK,MACD,OAAO;EACX,SACI,MAAM,MAAM,kDAAkD,IAAI;CAC1E;AACJ;;;;;;;;;;;;;;;;;AAkBA,SAAgB,wBAAwB,UAA4C;CAChF,OAAO,SAAS,eAAe,UAAU,SAAS,eAAe,SAAS,QAAQ,SAAS;AAC/F;;;;;;AAOA,SAAgB,oBAAoB,UAAmE;CACnG,IAAI,SAAS,eAAe,QAAQ,OAAO;CAC3C,IAAI,SAAS,eAAe,QAAQ,OAAO;CAC3C,OAAO,SAAS;AACpB;;;;;;AAOA,SAAgB,oBAAoB,OAAyB;CACzD,IAAI,UAAU,KAAA,KAAa,UAAU,MAAM,OAAO;CAClD,IAAI,OAAO,UAAU,UAAU,OAAO,MAAM,KAAK,MAAM;CACvD,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,WAAW;CAClD,OAAO;AACX"}
1
+ {"version":3,"file":"util.js","names":[],"sources":["../../src/preview/util.ts"],"sourcesContent":["import { CollectionSize } from \"@rebasepro/cms-types\";\nimport type { DateProperty } from \"@rebasepro/cms-types\";\nimport type { PreviewSize } from \"../types/components/PropertyPreviewProps\";\n/**\n * The schemes a preview link may use — everything else becomes `about:blank`.\n *\n * An allowlist, because the blocklist it replaces could be walked around and\n * the walk-arounds are not exotic. Browsers strip tabs, newlines and carriage\n * returns from a URL before parsing the scheme, so `java\\tscript:alert(1)` and\n * `java%0ascript:…` navigate exactly as `javascript:` does while matching none\n * of the names a blocklist knows. A leading control character does the same.\n *\n * Turned around, none of that matters: a string is either one of these four\n * schemes or it is not a link this panel will follow. `mailto:` and `tel:` are\n * here because a contact field is an ordinary thing to preview; `data:` is not,\n * even for images — a preview renders an `<img>` from its own value rather than\n * navigating to one.\n *\n * Relative URLs are allowed and deliberately: a preview commonly holds\n * `/uploads/x.png`, and a string with no scheme cannot carry one.\n */\nconst ALLOWED_URL_SCHEMES = new Set([\"http:\", \"https:\", \"mailto:\", \"tel:\"]);\n\nexport function sanitizeUrl(url: string | undefined): string {\n if (!url) return \"about:blank\";\n\n // The characters a browser removes before it decides what the scheme is.\n // Stripped here for the same reason, so this function is looking at the\n // string the browser will act on rather than the one it was handed.\n //\n // The control characters are the point, so the rule that objects to them is\n // off for this line rather than the expression rewritten to hide them from\n // it: `java\\tscript:` and `java\\nscript:` are the bypasses this exists to\n // close, and a regex that cannot name a control character cannot remove one.\n // eslint-disable-next-line no-control-regex\n const trimmed = url.trim().replace(/[\\u0000-\\u001F\\u007F]/g, \"\");\n if (!trimmed) return \"about:blank\";\n\n // No scheme at all — a relative link, which cannot navigate anywhere the\n // page could not already reach.\n if (!/^[a-z][a-z0-9+.-]*:/i.test(trimmed)) return trimmed;\n\n try {\n // `new URL` normalizes percent-encoding and case, so\n // `JaVaScRiPt%3aalert(1)` is judged as what it resolves to. The base is\n // there only so a protocol-relative `//host/path` parses.\n const parsed = new URL(trimmed, \"https://example.invalid\");\n return ALLOWED_URL_SCHEMES.has(parsed.protocol) ? trimmed : \"about:blank\";\n } catch {\n return \"about:blank\";\n }\n}\n\nexport const SMALL_THUMBNAIL = 40;\nexport const MEDIUM_THUMBNAIL = 100;\nexport const LARGE_THUMBNAIL = 200;\n\nexport function getThumbnailMeasure(size: PreviewSize): number {\n if (size === \"small\")\n return SMALL_THUMBNAIL;\n else if (size === \"medium\")\n return MEDIUM_THUMBNAIL;\n else if (size === \"large\")\n return LARGE_THUMBNAIL;\n else throw Error(\"Thumbnail size not mapped\");\n}\n\nexport function getPreviewSizeFrom(size: CollectionSize): PreviewSize {\n switch (size) {\n case \"xs\":\n case \"s\":\n case \"m\":\n return \"small\";\n case \"l\":\n return \"medium\";\n case \"xl\":\n return \"large\";\n default:\n throw Error(\"Missing mapping value in getPreviewSizeFrom: \" + size);\n }\n}\n\n/**\n * The zone a date property is shown and entered in.\n *\n * A `columnType: \"date\"` column holds a calendar day with no zone. It travels\n * as that day's UTC midnight, and Postgres keeps the date part of whatever it\n * is given, so it is read and written in UTC. In the browser's own zone a\n * stored 15th showed as the 14th west of Greenwich, and a 15th picked east of\n * it was stored as the 14th.\n *\n * A `columnType: \"time\"` column holds a time of day with no zone, and travels\n * as that time on 1970-01-01 UTC, so it is shown in UTC too: in the browser's\n * zone a stored 09:30 read as 10:30 in Rome.\n *\n * Any other date is shown in the property's declared `timezone`, or the\n * browser's when it declares none.\n */\nexport function getDatePropertyTimezone(property: DateProperty): string | undefined {\n return property.columnType === \"date\" || property.columnType === \"time\" ? \"UTC\" : property.timezone;\n}\n\n/**\n * Whether a date property is picked and shown as a day, a day and a time, or\n * a time of day. A `date` column holds no time, so it is a day whatever `mode`\n * says; a `time` column holds no day, so it is a time of day.\n */\nexport function getDatePropertyMode(property: DateProperty): \"date\" | \"date_time\" | \"time\" | undefined {\n if (property.columnType === \"date\") return \"date\";\n if (property.columnType === \"time\") return \"time\";\n return property.mode;\n}\n\n/**\n * Whether a value has nothing to show: absent, a blank string, an empty list.\n * A preview of one draws the empty marker, which is the right thing for a\n * column of values and the wrong thing for the one line under a record's name.\n */\nexport function isEmptyPreviewValue(value: unknown): boolean {\n if (value === undefined || value === null) return true;\n if (typeof value === \"string\") return value.trim() === \"\";\n if (Array.isArray(value)) return value.length === 0;\n return false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,IAAM,sCAAsB,IAAI,IAAI;CAAC;CAAS;CAAU;CAAW;AAAM,CAAC;AAE1E,SAAgB,YAAY,KAAiC;CACzD,IAAI,CAAC,KAAK,OAAO;CAWjB,MAAM,UAAU,IAAI,KAAK,CAAC,CAAC,QAAQ,0BAA0B,EAAE;CAC/D,IAAI,CAAC,SAAS,OAAO;CAIrB,IAAI,CAAC,uBAAuB,KAAK,OAAO,GAAG,OAAO;CAElD,IAAI;EAIA,MAAM,SAAS,IAAI,IAAI,SAAS,yBAAyB;EACzD,OAAO,oBAAoB,IAAI,OAAO,QAAQ,IAAI,UAAU;CAChE,QAAQ;EACJ,OAAO;CACX;AACJ;AAMA,SAAgB,oBAAoB,MAA2B;CAC3D,IAAI,SAAS,SACT,OAAA;MACC,IAAI,SAAS,UACd,OAAA;MACC,IAAI,SAAS,SACd,OAAA;MACC,MAAM,MAAM,2BAA2B;AAChD;AAEA,SAAgB,mBAAmB,MAAmC;CAClE,QAAQ,MAAR;EACI,KAAK;EACL,KAAK;EACL,KAAK,KACD,OAAO;EACX,KAAK,KACD,OAAO;EACX,KAAK,MACD,OAAO;EACX,SACI,MAAM,MAAM,kDAAkD,IAAI;CAC1E;AACJ;;;;;;;;;;;;;;;;;AAkBA,SAAgB,wBAAwB,UAA4C;CAChF,OAAO,SAAS,eAAe,UAAU,SAAS,eAAe,SAAS,QAAQ,SAAS;AAC/F;;;;;;AAOA,SAAgB,oBAAoB,UAAmE;CACnG,IAAI,SAAS,eAAe,QAAQ,OAAO;CAC3C,IAAI,SAAS,eAAe,QAAQ,OAAO;CAC3C,OAAO,SAAS;AACpB;;;;;;AAOA,SAAgB,oBAAoB,OAAyB;CACzD,IAAI,UAAU,KAAA,KAAa,UAAU,MAAM,OAAO;CAClD,IAAI,OAAO,UAAU,UAAU,OAAO,MAAM,KAAK,MAAM;CACvD,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,WAAW;CAClD,OAAO;AACX"}
@@ -114,7 +114,7 @@ function RebaseRouteContent() {
114
114
  const effectiveOpenMode = collection ? resolveCollectionOpenMode({
115
115
  collection,
116
116
  search: location.search,
117
- savedViewMode: userConfigPersistence?.getCollectionConfig(collection.slug)?.defaultViewMode,
117
+ savedViewMode: userConfigPersistence?.getTablePreferences(collection.slug).defaultViewMode,
118
118
  registeredViews: customizationController.collectionViews
119
119
  }) : void 0;
120
120
  if (collection && effectiveOpenMode === "split") {
@@ -212,7 +212,7 @@ function EntityFullScreenRoute({ pathname, navigationEntries, isNew, isCopy }) {
212
212
  const showList = !isNew && !isCopy && entityId !== void 0 && navigationEntries[0]?.type === "collection" && (navigationEntries.length === 2 || navigationEntries.length === 3) && resolveCollectionOpenMode({
213
213
  collection,
214
214
  search: location.search,
215
- savedViewMode: userConfigPersistence?.getCollectionConfig(collection.slug)?.defaultViewMode,
215
+ savedViewMode: userConfigPersistence?.getTablePreferences(collection.slug).defaultViewMode,
216
216
  registeredViews: customizationController.collectionViews
217
217
  }) === "split" ? () => navigate({
218
218
  pathname,
@@ -1 +1 @@
1
- {"version":3,"file":"RebaseRoute.js","names":[],"sources":["../../src/routes/RebaseRoute.tsx"],"sourcesContent":["\nimport type { ViewMode, AdminCollection } from \"@rebasepro/cms-types\";\nimport { useLocation } from \"react-router\";\nimport { Suspense, useCallback, useEffect, useRef, useState } from \"react\";\nimport { useNavigate } from \"react-router\";\n// Lazy: the table, the record views and the form behind them are not needed\n// until a collection opens, and a static import here preloaded all of them on\n// the login screen. See components/lazy_record_views.ts.\nimport {\n LazyCollectionViewBinding as CollectionViewBinding,\n LazyDetailViewBinding as DetailViewBinding,\n LazyEditViewBinding as EditViewBinding\n} from \"../components/lazy_record_views\";\nimport { ErrorView, NotFoundPage, useCustomizationController, useTranslation, useUserConfigurationPersistence, useComponentOverride, useNavigationBlocker } from \"@rebasepro/app\";\nimport { resolveCollectionOpenMode } from \"../util/collection_open_mode\";\nimport { isPathWithinRecord } from \"../util/navigation_utils\";\nimport { UnsavedChangesDialog } from \"@rebasepro/app\";\nimport { CenteredView, CircularProgressCenter } from \"@rebasepro/ui\";\nimport { NavigationViewCollectionInternal, NavigationViewEntityCustomInternal, NavigationViewInternal } from \"@rebasepro/app\";\nimport { getNavigationEntriesFromPath } from \"@rebasepro/app\";\nimport { toArray } from \"@rebasepro/utils\";\nimport { useCollectionRegistryController } from \"../hooks/navigation/contexts/CollectionRegistryContext\";\nimport { useUrlController } from \"../hooks/navigation/contexts/UrlContext\";\nimport { useBreadcrumbsController } from \"../hooks/useBreadcrumbsController\";\nimport { useNavigationStateController } from \"../hooks/navigation/contexts/NavigationStateContext\";\nimport { NavigationLoadingErrorView } from \"../components/NavigationLoadingErrorView\";\nimport { decodeUrlPath, encodeUrlPathSegment, getPathAfterRecord } from \"../hooks/navigation/url_segments\";\n\nexport function RebaseRoute() {\n return <Suspense fallback={<CircularProgressCenter/>}>\n <RebaseRouteContent/>\n </Suspense>;\n}\n\nfunction RebaseRouteContent() {\n\n const location = useLocation();\n const collectionRegistry = useCollectionRegistryController();\n const urlController = useUrlController();\n const breadcrumbs = useBreadcrumbsController();\n const userConfigPersistence = useUserConfigurationPersistence();\n const customizationController = useCustomizationController();\n const ResolvedCollectionView = useComponentOverride(\"Collection.View\", CollectionViewBinding);\n const navigationState = useNavigationStateController();\n\n const hash = location.hash;\n // `#new_side` is a new record in the side panel, drawn by the side panel\n // (`useBuildSidePanel`); under it this route shows the collection, as it\n // does for `#side`. It contains `#new`, which made a pasted\n // `/c/products#new_side` draw a second, full-screen new form under the panel.\n const isNewInSidePanel = hash.includes(\"#new_side\");\n const isSidePanel = hash.includes(\"#side\") || isNewInSidePanel;\n const isNew = hash.includes(\"#new\") && !isNewInSidePanel;\n const isCopy = hash.includes(\"#copy\");\n const isFullScreen = hash.includes(\"#full\");\n\n const pathname = location.pathname;\n const navigationPath = urlController.urlPathToDataPath(pathname);\n\n const navigationEntries = getNavigationEntriesFromPath({\n path: navigationPath,\n collections: collectionRegistry.collections ?? []\n });\n\n useEffect(() => {\n breadcrumbs.set({\n breadcrumbs: navigationEntries.map((entry) => {\n\n if (entry.type === \"entity\") {\n return ({\n title: String(entry.entityId),\n url: urlController.buildUrlCollectionPath(entry.path)\n });\n } else if (entry.type === \"custom_view\") {\n return ({\n title: String(entry.view.name ?? entry.view.key),\n url: urlController.buildUrlCollectionPath(entry.path)\n });\n } else if (entry.type === \"collection\") {\n return ({\n title: entry.collection.name,\n url: urlController.buildUrlCollectionPath(entry.path),\n id: entry.path\n });\n } else {\n throw new Error(\"Unexpected navigation entry type\");\n }\n })\n });\n }, [navigationEntries.map(entry => entry.path).join(\",\")]);\n\n // The collections failed to load, so this URL cannot resolve to anything:\n // say why, rather than spin until a registry that will never fill does, or\n // report the collection as unregistered.\n if (navigationState.navigationLoadingError && !navigationEntries.some((entry) => entry.type === \"collection\")) {\n return <CenteredView>\n <NavigationLoadingErrorView error={navigationState.navigationLoadingError}\n onRetry={navigationState.refreshNavigation}/>\n </CenteredView>;\n }\n\n if (isNew) {\n // New entities always use full-screen mode, even for split-layout collections\n return <EntityFullScreenRoute\n pathname={pathname}\n navigationEntries={navigationEntries}\n isNew={true}\n isCopy={false}\n />;\n }\n\n if (navigationEntries.length === 1 && navigationEntries[0].type === \"collection\") {\n let collection: AdminCollection<any> | undefined;\n collection = collectionRegistry.getCollection(navigationEntries[0].id);\n if (!collection)\n collection = collectionRegistry.getCollection(navigationEntries[0].slug);\n if (!collection) {\n if (!collectionRegistry.initialised) {\n return <CircularProgressCenter/>;\n }\n return <UnresolvedCollectionView path={navigationEntries[0].slug}/>;\n }\n return <ResolvedCollectionView\n key={`collection_view_${collection.slug}`}\n {...collection}\n parentCollectionSlugs={[]} parentEntityIds={[]}\n path={collection.slug}\n updateUrl={true}\n Actions={toArray(collection.Actions)}/>\n }\n\n if (isSidePanel) {\n const lastCollectionEntry = [...navigationEntries].reverse().find((entry) => entry.type === \"collection\");\n if (lastCollectionEntry) {\n let collection: AdminCollection<any> | undefined;\n const firstEntry = navigationEntries[0] as NavigationViewCollectionInternal<any>;\n collection = collectionRegistry.getCollection(firstEntry.id);\n if (!collection)\n collection = collectionRegistry.getCollection(firstEntry.slug);\n if (!collection) {\n if (!collectionRegistry.initialised) {\n return <CircularProgressCenter/>;\n }\n return <UnresolvedCollectionView path={firstEntry.slug}/>;\n }\n return <ResolvedCollectionView\n key={`collection_view_${collection.slug}`}\n {...collection}\n parentCollectionSlugs={[]} parentEntityIds={[]}\n path={collection.slug}\n updateUrl={true}\n Actions={toArray(collection.Actions)}/>;\n }\n }\n\n // Check if this is a simple entity route (collection + entity) for a split-layout collection.\n // If so, render the collection view with the entity shown in the split detail panel\n // instead of the full-screen editor. This keeps the master-detail UX with clean URLs.\n //\n // Also handles subcollection tabs: /c/customers/39/orders produces 3 entries\n // (collection→entity→subcollection). We extract the subcollection slug as selectedTab.\n const lastEntityEntry = navigationEntries.find((entry) => entry.type === \"entity\");\n const firstCollectionEntry = navigationEntries[0];\n if (\n !isFullScreen &&\n !isCopy &&\n firstCollectionEntry?.type === \"collection\" &&\n lastEntityEntry?.type === \"entity\" &&\n (navigationEntries.length === 2 || navigationEntries.length === 3)\n ) {\n let collection: AdminCollection<any> | undefined;\n collection = collectionRegistry.getCollection(firstCollectionEntry.id);\n if (!collection)\n collection = collectionRegistry.getCollection(firstCollectionEntry.slug);\n\n const effectiveOpenMode = collection\n ? resolveCollectionOpenMode({\n collection,\n search: location.search,\n savedViewMode: userConfigPersistence?.getCollectionConfig(collection.slug)?.defaultViewMode as ViewMode | undefined,\n registeredViews: customizationController.collectionViews\n })\n : undefined;\n if (collection && effectiveOpenMode === \"split\") {\n // Extract subcollection tab from the 3rd entry if present\n let selectedTab: string | undefined;\n if (navigationEntries.length === 3) {\n const thirdEntry = navigationEntries[2];\n if (thirdEntry.type === \"collection\") {\n selectedTab = thirdEntry.collection.slug;\n } else if (thirdEntry.type === \"custom_view\") {\n selectedTab = thirdEntry.view.key;\n }\n }\n // Fallback: check for unregistered tabs (e.g. __json, __rebase_history)\n // that aren't parsed as navigation entries\n if (!selectedTab && (navigationEntries.length === 2) && lastEntityEntry) {\n const trailingSegment = getPathAfterRecord(pathname, urlController.buildUrlCollectionPath(lastEntityEntry.path));\n if (trailingSegment) {\n selectedTab = trailingSegment;\n }\n }\n return <ResolvedCollectionView\n key={`collection_view_${collection.slug}`}\n {...collection}\n parentCollectionSlugs={[]} parentEntityIds={[]}\n path={collection.slug}\n updateUrl={true}\n selectedEntityId={lastEntityEntry.entityId}\n selectedTab={selectedTab}\n Actions={toArray(collection.Actions)}/>;\n }\n }\n\n return <EntityFullScreenRoute\n pathname={pathname}\n navigationEntries={navigationEntries}\n isNew={isNew}\n isCopy={isCopy}\n />;\n\n}\n\nfunction getSelectedTabFromUrl(isNew: boolean, lastCustomView: NavigationViewCollectionInternal<any> | NavigationViewEntityCustomInternal<any> | undefined) {\n if (isNew) {\n return undefined;\n } else if (lastCustomView) {\n if (lastCustomView.type === \"custom_view\") {\n return lastCustomView.view.key;\n } else if (lastCustomView.type === \"collection\") {\n return lastCustomView.id ?? lastCustomView.slug;\n }\n }\n return undefined;\n}\n\nfunction EntityFullScreenRoute({\n pathname,\n navigationEntries,\n isNew,\n isCopy\n}: {\n pathname: string;\n navigationEntries: NavigationViewInternal[],\n isNew: boolean,\n isCopy: boolean\n}) {\n\n const collectionRegistry = useCollectionRegistryController();\n const urlController = useUrlController();\n const navigate = useNavigate();\n const location = useLocation();\n const userConfigPersistence = useUserConfigurationPersistence();\n const customizationController = useCustomizationController();\n const { t } = useTranslation();\n\n // defaultValues may be carried via location.state when openNewDocument() is called\n // for full-screen mode. We read it once on mount — after that, the form owns its state.\n const defaultValues = (location.state as { defaultValues?: Record<string, unknown> } | null)?.defaultValues;\n\n // Preserve the current hash (e.g. #full) across tab/save navigations\n const hash = location.hash;\n\n const navigationPath = urlController.urlPathToDataPath(pathname);\n\n // is navigating away blocked\n const blocked = useRef(false);\n\n const lastEntityEntry = [...navigationEntries].reverse().find((entry) => entry.type === \"entity\");\n const navigationEntriesAfterEntity = lastEntityEntry ? navigationEntries.slice(navigationEntries.indexOf(lastEntityEntry) + 1) : [];\n\n const lastCustomView = [...navigationEntriesAfterEntity].reverse().find(\n (entry) => entry.type === \"custom_view\" || entry.type === \"collection\"\n ) as NavigationViewCollectionInternal<any> | NavigationViewEntityCustomInternal<any> | undefined;\n\n const entityId = lastEntityEntry && \"entityId\" in lastEntityEntry ? lastEntityEntry.entityId : undefined;\n\n // The record's own URL, and the URL of the collection that holds it. Built\n // from the data path, so the id in them is percent-encoded once, however\n // the pathname spells it.\n const recordUrl = lastEntityEntry && entityId !== undefined && !isNew\n ? urlController.buildUrlCollectionPath(lastEntityEntry.path)\n : undefined;\n const basePath = lastEntityEntry && recordUrl !== undefined\n ? urlController.buildUrlCollectionPath(lastEntityEntry.slug)\n : pathname;\n\n // Derive tab from navigation entries (works for registered custom views)\n let urlTab = getSelectedTabFromUrl(isNew, lastCustomView);\n\n // Fallback: internal tabs like __json or __rebase_history aren't registered as\n // entity views, so the navigation parser ignores them. Check the raw pathname\n // for a trailing segment after the entity ID to catch those cases.\n if (!urlTab && recordUrl !== undefined) {\n const trailingSegment = getPathAfterRecord(pathname, recordUrl);\n if (trailingSegment && trailingSegment !== \"edit\") {\n urlTab = trailingSegment;\n }\n }\n\n const [selectedTab, setSelectedTab] = useState<string | undefined>(urlTab);\n\n const parentCollectionSlugs = collectionRegistry.getParentCollectionSlugs(navigationPath);\n const parentEntityIds = collectionRegistry.getParentEntityIds(navigationPath);\n useEffect(() => {\n if (urlTab !== selectedTab) {\n setSelectedTab(urlTab);\n }\n }, [urlTab]);\n\n // The URL of a record in this collection, or of one of its tabs.\n const recordTabUrl = (id: string | number, tab?: string) =>\n `${basePath}/${encodeUrlPathSegment(String(id))}${tab ? \"/\" + encodeUrlPathSegment(tab) : \"\"}`;\n\n // Compared decoded: a location's pathname spells an id the way whoever\n // wrote it encoded it, and these paths are built here.\n const entityPath = decodeUrlPath(recordUrl ?? `${basePath}/${entityId}`);\n const decodedBasePath = decodeUrlPath(basePath);\n\n const blocker = useNavigationBlocker(useCallback(({\n currentLocation,\n nextLocation\n }) => {\n const nextPathname = decodeUrlPath(nextLocation.pathname);\n // Inside this record — a tab, `/edit`. By path segment: a bare\n // prefix let Back to `/c/products/12` out of `/c/products/1` without\n // asking.\n if (isPathWithinRecord(nextPathname, entityPath))\n return false;\n\n // Side panel overlay navigations preserve the underlying form via\n // base_location in router state — no data is lost in either direction.\n\n // Opening a side panel (e.g. clicking a relation arrow)\n const nextHash = nextLocation.hash;\n if (nextHash === \"#side\" || nextHash === \"#new_side\")\n return false;\n\n // Closing a side panel (navigate(-1) back to the form's own path)\n const currentHash = currentLocation.hash;\n if ((currentHash === \"#side\" || currentHash === \"#new_side\") &&\n (nextPathname === decodedBasePath ||\n isPathWithinRecord(nextPathname, entityPath)))\n return false;\n\n return blocked.current;\n }, [entityPath, decodedBasePath]));\n\n const lastCollectionEntry = [...navigationEntries].reverse().find((entry) => entry.type === \"collection\");\n\n if (isNew && !lastCollectionEntry) {\n if (!collectionRegistry.initialised) {\n return <CircularProgressCenter/>;\n }\n throw new Error(\"INTERNAL: No collection found in the navigation\");\n }\n\n if (!isNew && !lastEntityEntry) {\n if (!collectionRegistry.initialised) {\n return <CircularProgressCenter/>;\n }\n return <NotFoundPage/>;\n }\n\n const rawCollection = isNew\n ? (lastCollectionEntry && \"collection\" in lastCollectionEntry ? lastCollectionEntry.collection : undefined)!\n : (lastEntityEntry && \"parentCollection\" in lastEntityEntry ? lastEntityEntry.parentCollection : undefined)!;\n const collection = collectionRegistry.getCollection(rawCollection.slug) || rawCollection;\n const fullIdPath = isNew ? lastCollectionEntry!.slug : lastEntityEntry!.slug;\n const collectionPath = urlController.resolveDatabasePathsFrom(fullIdPath);\n const isEditRoute = pathname.endsWith(\"/edit\") || pathname.split(\"/\").pop() === \"edit\";\n // Determine if this is a detail-view-first collection showing the view page\n const isDetailMode = collection.defaultEntityAction === \"view\" && !isNew && !isCopy && entityId && !isEditRoute;\n\n // A record is full screen either because its collection has no list to show\n // beside it, or because the user folded that list away. Only the second is\n // reversible, and it is reversible by dropping `#full` alone: this is the\n // same URL the split route reads, so the same conditions decide it.\n const splitListAvailable = !isNew && !isCopy && entityId !== undefined &&\n navigationEntries[0]?.type === \"collection\" &&\n (navigationEntries.length === 2 || navigationEntries.length === 3) &&\n resolveCollectionOpenMode({\n collection,\n search: location.search,\n savedViewMode: userConfigPersistence?.getCollectionConfig(collection.slug)?.defaultViewMode as ViewMode | undefined,\n registeredViews: customizationController.collectionViews\n }) === \"split\";\n\n const showList = splitListAvailable\n ? () => navigate({\n pathname,\n search: location.search,\n hash: \"\"\n })\n : undefined;\n\n if (isDetailMode) {\n return <>\n <DetailViewBinding\n key={collection.slug + \"_view_\" + entityId}\n entityId={entityId}\n collection={collection}\n layout={\"full_screen\"}\n path={collectionPath}\n selectedTab={selectedTab ?? undefined}\n onShowList={showList}\n onEditClick={() => {\n const editUrl = urlController.buildUrlCollectionPath(`${collectionPath}/${entityId}`) + \"/edit\";\n navigate(editUrl + hash);\n }}\n onTabChange={(params) => {\n setSelectedTab(params.selectedTab);\n navigate(`${recordTabUrl(entityId, params.selectedTab)}${hash}`, { replace: true });\n }}\n parentCollectionSlugs={parentCollectionSlugs}\n parentEntityIds={parentEntityIds}\n />\n </>;\n }\n\n return <>\n <EditViewBinding\n key={collection.slug + \"_\" + (isNew ? \"new\" : (isCopy ? entityId + \"_copy\" : entityId))}\n entityId={isNew ? undefined : entityId}\n collection={collection}\n layout={\"full_screen\"}\n path={collectionPath}\n copy={isCopy}\n selectedTab={selectedTab ?? undefined}\n onShowList={showList}\n defaultValues={isNew ? defaultValues : undefined}\n onValuesModified={(modified) => blocked.current = modified}\n navigateBack={() => {\n const detailUrl = urlController.buildUrlCollectionPath(`${collectionPath}/${entityId}`);\n navigate(detailUrl + hash);\n }}\n onSaved={(params) => {\n const newSelectedTab = params.selectedTab;\n const newEntityId = params.id;\n const savedHash = isNew ? \"\" : hash;\n navigate(`${recordTabUrl(newEntityId, newSelectedTab)}${savedHash}`, { replace: true });\n }}\n onTabChange={(params) => {\n setSelectedTab(params.selectedTab);\n if (isNew || entityId === undefined) {\n return;\n }\n navigate(`${recordTabUrl(entityId, params.selectedTab)}${hash}`, { replace: true });\n }}\n parentCollectionSlugs={parentCollectionSlugs} parentEntityIds={parentEntityIds}\n />\n\n <UnsavedChangesDialog\n open={blocker?.state === \"blocked\"}\n handleOk={() => blocker?.proceed?.()}\n handleCancel={() => blocker?.reset?.()}\n body={t(\"unsaved_changes_in_entity\")}/>\n </>;\n}\n\n/**\n * Shown when a URL names a collection the registry cannot resolve.\n *\n * This used to be `return null`, which renders an empty pane inside the app\n * chrome: the sidebar, the nav highlight and the breadcrumb all still work,\n * because those read the collections array directly, while the view itself is\n * blank. Nothing is thrown, and the only trace is a `console.debug` — so the\n * panel looks like it lost its data rather than like it failed to find the\n * collection, and there is no string to search for.\n *\n * A slug containing slashes went unresolvable this way and cost an afternoon to\n * find. The lookup is fixed; this is the part that made it expensive.\n */\nfunction UnresolvedCollectionView({ path }: { path: string }) {\n const { t } = useTranslation();\n // Warn, not debug: this is a route that renders nothing useful, and it\n // should be visible at the console's default level.\n useEffect(() => {\n console.warn(\n `[rebase] No collection is registered for \"${path}\", so this route has nothing to render. ` +\n \"Check that the collection is in the collections array and that its slug matches the URL.\"\n );\n }, [path]);\n\n return <CenteredView>\n <ErrorView\n title={t(\"collection_not_found\")}\n error={t(\"collection_not_found_body\", { path })}\n tooltip={t(\"collection_not_found_hint\")}/>\n </CenteredView>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA4BA,SAAgB,cAAc;CAC1B,OAAO,oBAAC,UAAD;EAAU,UAAU,oBAAC,wBAAD,CAAwB,CAAA;YAC/C,oBAAC,oBAAD,CAAoB,CAAA;CACd,CAAA;AACd;AAEA,SAAS,qBAAqB;CAE1B,MAAM,WAAW,YAAY;CAC7B,MAAM,qBAAqB,gCAAgC;CAC3D,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,cAAc,yBAAyB;CAC7C,MAAM,wBAAwB,gCAAgC;CAC9D,MAAM,0BAA0B,2BAA2B;CAC3D,MAAM,yBAA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mBAAmB,aAAa,QAAQ,UAAU;EAClD,oBAAoB;GAChB,MAAM,YAAY,cAAc,uBAAuB,GAAG,eAAe,GAAG,UAAU;GACtF,SAAS,YAAY,IAAI;EAC7B;EACA,UAAU,WAAW;GACjB,MAAM,iBAAiB,OAAO;GAC9B,MAAM,cAAc,OAAO;GAC3B,MAAM,YAAY,QAAQ,KAAK;GAC/B,SAAS,GAAG,aAAa,aAAa,cAAc,IAAI,aAAa,EAAE,SAAS,KAAK,CAAC;EAC1F;EACA,cAAc,WAAW;GACrB,eAAe,OAAO,WAAW;GACjC,IAAI,SAAS,aAAa,KAAA,GACtB;GAEJ,SAAS,GAAG,aAAa,UAAU,OAAO,WAAW,IAAI,QAAQ,EAAE,SAAS,KAAK,CAAC;EACtF;EACuB;EAAwC;CAClE,GA5BQ,WAAW,OAAO,OAAO,QAAQ,QAAS,SAAS,WAAW,UAAU,SA4BhF,GAED,oBAAC,sBAAD;EACI,MAAM,SAAS,UAAU;EACzB,gBAAgB,SAAS,UAAU;EACnC,oBAAoB,SAAS,QAAQ;EACrC,MAAM,EAAE,2BAA2B;CAAG,CAAA,CAC5C,EAAA,CAAA;AACN;;;;;;;;;;;;;;AAeA,SAAS,yBAAyB,EAAE,QAA0B;CAC1D,MAAM,EAAE,MAAM,eAAe;CAG7B,gBAAgB;EACZ,QAAQ,KACJ,6CAA6C,KAAK,iIAEtD;CACJ,GAAG,CAAC,IAAI,CAAC;CAET,OAAO,oBAAC,cAAD,EAAA,UACH,oBAAC,WAAD;EACI,OAAO,EAAE,sBAAsB;EAC/B,OAAO,EAAE,6BAA6B,EAAE,KAAK,CAAC;EAC9C,SAAS,EAAE,2BAA2B;CAAG,CAAA,EACnC,CAAA;AAClB"}
1
+ {"version":3,"file":"RebaseRoute.js","names":[],"sources":["../../src/routes/RebaseRoute.tsx"],"sourcesContent":["\nimport type { ViewMode, AdminCollection } from \"@rebasepro/cms-types\";\nimport { useLocation } from \"react-router\";\nimport { Suspense, useCallback, useEffect, useRef, useState } from \"react\";\nimport { useNavigate } from \"react-router\";\n// Lazy: the table, the record views and the form behind them are not needed\n// until a collection opens, and a static import here preloaded all of them on\n// the login screen. See components/lazy_record_views.ts.\nimport {\n LazyCollectionViewBinding as CollectionViewBinding,\n LazyDetailViewBinding as DetailViewBinding,\n LazyEditViewBinding as EditViewBinding\n} from \"../components/lazy_record_views\";\nimport { ErrorView, NotFoundPage, useCustomizationController, useTranslation, useUserConfigurationPersistence, useComponentOverride, useNavigationBlocker } from \"@rebasepro/app\";\nimport { resolveCollectionOpenMode } from \"../util/collection_open_mode\";\nimport { isPathWithinRecord } from \"../util/navigation_utils\";\nimport { UnsavedChangesDialog } from \"@rebasepro/app\";\nimport { CenteredView, CircularProgressCenter } from \"@rebasepro/ui\";\nimport { NavigationViewCollectionInternal, NavigationViewEntityCustomInternal, NavigationViewInternal } from \"@rebasepro/app\";\nimport { getNavigationEntriesFromPath } from \"@rebasepro/app\";\nimport { toArray } from \"@rebasepro/utils\";\nimport { useCollectionRegistryController } from \"../hooks/navigation/contexts/CollectionRegistryContext\";\nimport { useUrlController } from \"../hooks/navigation/contexts/UrlContext\";\nimport { useBreadcrumbsController } from \"../hooks/useBreadcrumbsController\";\nimport { useNavigationStateController } from \"../hooks/navigation/contexts/NavigationStateContext\";\nimport { NavigationLoadingErrorView } from \"../components/NavigationLoadingErrorView\";\nimport { decodeUrlPath, encodeUrlPathSegment, getPathAfterRecord } from \"../hooks/navigation/url_segments\";\n\nexport function RebaseRoute() {\n return <Suspense fallback={<CircularProgressCenter/>}>\n <RebaseRouteContent/>\n </Suspense>;\n}\n\nfunction RebaseRouteContent() {\n\n const location = useLocation();\n const collectionRegistry = useCollectionRegistryController();\n const urlController = useUrlController();\n const breadcrumbs = useBreadcrumbsController();\n const userConfigPersistence = useUserConfigurationPersistence();\n const customizationController = useCustomizationController();\n const ResolvedCollectionView = useComponentOverride(\"Collection.View\", CollectionViewBinding);\n const navigationState = useNavigationStateController();\n\n const hash = location.hash;\n // `#new_side` is a new record in the side panel, drawn by the side panel\n // (`useBuildSidePanel`); under it this route shows the collection, as it\n // does for `#side`. It contains `#new`, which made a pasted\n // `/c/products#new_side` draw a second, full-screen new form under the panel.\n const isNewInSidePanel = hash.includes(\"#new_side\");\n const isSidePanel = hash.includes(\"#side\") || isNewInSidePanel;\n const isNew = hash.includes(\"#new\") && !isNewInSidePanel;\n const isCopy = hash.includes(\"#copy\");\n const isFullScreen = hash.includes(\"#full\");\n\n const pathname = location.pathname;\n const navigationPath = urlController.urlPathToDataPath(pathname);\n\n const navigationEntries = getNavigationEntriesFromPath({\n path: navigationPath,\n collections: collectionRegistry.collections ?? []\n });\n\n useEffect(() => {\n breadcrumbs.set({\n breadcrumbs: navigationEntries.map((entry) => {\n\n if (entry.type === \"entity\") {\n return ({\n title: String(entry.entityId),\n url: urlController.buildUrlCollectionPath(entry.path)\n });\n } else if (entry.type === \"custom_view\") {\n return ({\n title: String(entry.view.name ?? entry.view.key),\n url: urlController.buildUrlCollectionPath(entry.path)\n });\n } else if (entry.type === \"collection\") {\n return ({\n title: entry.collection.name,\n url: urlController.buildUrlCollectionPath(entry.path),\n id: entry.path\n });\n } else {\n throw new Error(\"Unexpected navigation entry type\");\n }\n })\n });\n }, [navigationEntries.map(entry => entry.path).join(\",\")]);\n\n // The collections failed to load, so this URL cannot resolve to anything:\n // say why, rather than spin until a registry that will never fill does, or\n // report the collection as unregistered.\n if (navigationState.navigationLoadingError && !navigationEntries.some((entry) => entry.type === \"collection\")) {\n return <CenteredView>\n <NavigationLoadingErrorView error={navigationState.navigationLoadingError}\n onRetry={navigationState.refreshNavigation}/>\n </CenteredView>;\n }\n\n if (isNew) {\n // New entities always use full-screen mode, even for split-layout collections\n return <EntityFullScreenRoute\n pathname={pathname}\n navigationEntries={navigationEntries}\n isNew={true}\n isCopy={false}\n />;\n }\n\n if (navigationEntries.length === 1 && navigationEntries[0].type === \"collection\") {\n let collection: AdminCollection<any> | undefined;\n collection = collectionRegistry.getCollection(navigationEntries[0].id);\n if (!collection)\n collection = collectionRegistry.getCollection(navigationEntries[0].slug);\n if (!collection) {\n if (!collectionRegistry.initialised) {\n return <CircularProgressCenter/>;\n }\n return <UnresolvedCollectionView path={navigationEntries[0].slug}/>;\n }\n return <ResolvedCollectionView\n key={`collection_view_${collection.slug}`}\n {...collection}\n parentCollectionSlugs={[]} parentEntityIds={[]}\n path={collection.slug}\n updateUrl={true}\n Actions={toArray(collection.Actions)}/>\n }\n\n if (isSidePanel) {\n const lastCollectionEntry = [...navigationEntries].reverse().find((entry) => entry.type === \"collection\");\n if (lastCollectionEntry) {\n let collection: AdminCollection<any> | undefined;\n const firstEntry = navigationEntries[0] as NavigationViewCollectionInternal<any>;\n collection = collectionRegistry.getCollection(firstEntry.id);\n if (!collection)\n collection = collectionRegistry.getCollection(firstEntry.slug);\n if (!collection) {\n if (!collectionRegistry.initialised) {\n return <CircularProgressCenter/>;\n }\n return <UnresolvedCollectionView path={firstEntry.slug}/>;\n }\n return <ResolvedCollectionView\n key={`collection_view_${collection.slug}`}\n {...collection}\n parentCollectionSlugs={[]} parentEntityIds={[]}\n path={collection.slug}\n updateUrl={true}\n Actions={toArray(collection.Actions)}/>;\n }\n }\n\n // Check if this is a simple entity route (collection + entity) for a split-layout collection.\n // If so, render the collection view with the entity shown in the split detail panel\n // instead of the full-screen editor. This keeps the master-detail UX with clean URLs.\n //\n // Also handles subcollection tabs: /c/customers/39/orders produces 3 entries\n // (collection→entity→subcollection). We extract the subcollection slug as selectedTab.\n const lastEntityEntry = navigationEntries.find((entry) => entry.type === \"entity\");\n const firstCollectionEntry = navigationEntries[0];\n if (\n !isFullScreen &&\n !isCopy &&\n firstCollectionEntry?.type === \"collection\" &&\n lastEntityEntry?.type === \"entity\" &&\n (navigationEntries.length === 2 || navigationEntries.length === 3)\n ) {\n let collection: AdminCollection<any> | undefined;\n collection = collectionRegistry.getCollection(firstCollectionEntry.id);\n if (!collection)\n collection = collectionRegistry.getCollection(firstCollectionEntry.slug);\n\n const effectiveOpenMode = collection\n ? resolveCollectionOpenMode({\n collection,\n search: location.search,\n savedViewMode: userConfigPersistence?.getTablePreferences(collection.slug).defaultViewMode,\n registeredViews: customizationController.collectionViews\n })\n : undefined;\n if (collection && effectiveOpenMode === \"split\") {\n // Extract subcollection tab from the 3rd entry if present\n let selectedTab: string | undefined;\n if (navigationEntries.length === 3) {\n const thirdEntry = navigationEntries[2];\n if (thirdEntry.type === \"collection\") {\n selectedTab = thirdEntry.collection.slug;\n } else if (thirdEntry.type === \"custom_view\") {\n selectedTab = thirdEntry.view.key;\n }\n }\n // Fallback: check for unregistered tabs (e.g. __json, __rebase_history)\n // that aren't parsed as navigation entries\n if (!selectedTab && (navigationEntries.length === 2) && lastEntityEntry) {\n const trailingSegment = getPathAfterRecord(pathname, urlController.buildUrlCollectionPath(lastEntityEntry.path));\n if (trailingSegment) {\n selectedTab = trailingSegment;\n }\n }\n return <ResolvedCollectionView\n key={`collection_view_${collection.slug}`}\n {...collection}\n parentCollectionSlugs={[]} parentEntityIds={[]}\n path={collection.slug}\n updateUrl={true}\n selectedEntityId={lastEntityEntry.entityId}\n selectedTab={selectedTab}\n Actions={toArray(collection.Actions)}/>;\n }\n }\n\n return <EntityFullScreenRoute\n pathname={pathname}\n navigationEntries={navigationEntries}\n isNew={isNew}\n isCopy={isCopy}\n />;\n\n}\n\nfunction getSelectedTabFromUrl(isNew: boolean, lastCustomView: NavigationViewCollectionInternal<any> | NavigationViewEntityCustomInternal<any> | undefined) {\n if (isNew) {\n return undefined;\n } else if (lastCustomView) {\n if (lastCustomView.type === \"custom_view\") {\n return lastCustomView.view.key;\n } else if (lastCustomView.type === \"collection\") {\n return lastCustomView.id ?? lastCustomView.slug;\n }\n }\n return undefined;\n}\n\nfunction EntityFullScreenRoute({\n pathname,\n navigationEntries,\n isNew,\n isCopy\n}: {\n pathname: string;\n navigationEntries: NavigationViewInternal[],\n isNew: boolean,\n isCopy: boolean\n}) {\n\n const collectionRegistry = useCollectionRegistryController();\n const urlController = useUrlController();\n const navigate = useNavigate();\n const location = useLocation();\n const userConfigPersistence = useUserConfigurationPersistence();\n const customizationController = useCustomizationController();\n const { t } = useTranslation();\n\n // defaultValues may be carried via location.state when openNewDocument() is called\n // for full-screen mode. We read it once on mount — after that, the form owns its state.\n const defaultValues = (location.state as { defaultValues?: Record<string, unknown> } | null)?.defaultValues;\n\n // Preserve the current hash (e.g. #full) across tab/save navigations\n const hash = location.hash;\n\n const navigationPath = urlController.urlPathToDataPath(pathname);\n\n // is navigating away blocked\n const blocked = useRef(false);\n\n const lastEntityEntry = [...navigationEntries].reverse().find((entry) => entry.type === \"entity\");\n const navigationEntriesAfterEntity = lastEntityEntry ? navigationEntries.slice(navigationEntries.indexOf(lastEntityEntry) + 1) : [];\n\n const lastCustomView = [...navigationEntriesAfterEntity].reverse().find(\n (entry) => entry.type === \"custom_view\" || entry.type === \"collection\"\n ) as NavigationViewCollectionInternal<any> | NavigationViewEntityCustomInternal<any> | undefined;\n\n const entityId = lastEntityEntry && \"entityId\" in lastEntityEntry ? lastEntityEntry.entityId : undefined;\n\n // The record's own URL, and the URL of the collection that holds it. Built\n // from the data path, so the id in them is percent-encoded once, however\n // the pathname spells it.\n const recordUrl = lastEntityEntry && entityId !== undefined && !isNew\n ? urlController.buildUrlCollectionPath(lastEntityEntry.path)\n : undefined;\n const basePath = lastEntityEntry && recordUrl !== undefined\n ? urlController.buildUrlCollectionPath(lastEntityEntry.slug)\n : pathname;\n\n // Derive tab from navigation entries (works for registered custom views)\n let urlTab = getSelectedTabFromUrl(isNew, lastCustomView);\n\n // Fallback: internal tabs like __json or __rebase_history aren't registered as\n // entity views, so the navigation parser ignores them. Check the raw pathname\n // for a trailing segment after the entity ID to catch those cases.\n if (!urlTab && recordUrl !== undefined) {\n const trailingSegment = getPathAfterRecord(pathname, recordUrl);\n if (trailingSegment && trailingSegment !== \"edit\") {\n urlTab = trailingSegment;\n }\n }\n\n const [selectedTab, setSelectedTab] = useState<string | undefined>(urlTab);\n\n const parentCollectionSlugs = collectionRegistry.getParentCollectionSlugs(navigationPath);\n const parentEntityIds = collectionRegistry.getParentEntityIds(navigationPath);\n useEffect(() => {\n if (urlTab !== selectedTab) {\n setSelectedTab(urlTab);\n }\n }, [urlTab]);\n\n // The URL of a record in this collection, or of one of its tabs.\n const recordTabUrl = (id: string | number, tab?: string) =>\n `${basePath}/${encodeUrlPathSegment(String(id))}${tab ? \"/\" + encodeUrlPathSegment(tab) : \"\"}`;\n\n // Compared decoded: a location's pathname spells an id the way whoever\n // wrote it encoded it, and these paths are built here.\n const entityPath = decodeUrlPath(recordUrl ?? `${basePath}/${entityId}`);\n const decodedBasePath = decodeUrlPath(basePath);\n\n const blocker = useNavigationBlocker(useCallback(({\n currentLocation,\n nextLocation\n }) => {\n const nextPathname = decodeUrlPath(nextLocation.pathname);\n // Inside this record — a tab, `/edit`. By path segment: a bare\n // prefix let Back to `/c/products/12` out of `/c/products/1` without\n // asking.\n if (isPathWithinRecord(nextPathname, entityPath))\n return false;\n\n // Side panel overlay navigations preserve the underlying form via\n // base_location in router state — no data is lost in either direction.\n\n // Opening a side panel (e.g. clicking a relation arrow)\n const nextHash = nextLocation.hash;\n if (nextHash === \"#side\" || nextHash === \"#new_side\")\n return false;\n\n // Closing a side panel (navigate(-1) back to the form's own path)\n const currentHash = currentLocation.hash;\n if ((currentHash === \"#side\" || currentHash === \"#new_side\") &&\n (nextPathname === decodedBasePath ||\n isPathWithinRecord(nextPathname, entityPath)))\n return false;\n\n return blocked.current;\n }, [entityPath, decodedBasePath]));\n\n const lastCollectionEntry = [...navigationEntries].reverse().find((entry) => entry.type === \"collection\");\n\n if (isNew && !lastCollectionEntry) {\n if (!collectionRegistry.initialised) {\n return <CircularProgressCenter/>;\n }\n throw new Error(\"INTERNAL: No collection found in the navigation\");\n }\n\n if (!isNew && !lastEntityEntry) {\n if (!collectionRegistry.initialised) {\n return <CircularProgressCenter/>;\n }\n return <NotFoundPage/>;\n }\n\n const rawCollection = isNew\n ? (lastCollectionEntry && \"collection\" in lastCollectionEntry ? lastCollectionEntry.collection : undefined)!\n : (lastEntityEntry && \"parentCollection\" in lastEntityEntry ? lastEntityEntry.parentCollection : undefined)!;\n const collection = collectionRegistry.getCollection(rawCollection.slug) || rawCollection;\n const fullIdPath = isNew ? lastCollectionEntry!.slug : lastEntityEntry!.slug;\n const collectionPath = urlController.resolveDatabasePathsFrom(fullIdPath);\n const isEditRoute = pathname.endsWith(\"/edit\") || pathname.split(\"/\").pop() === \"edit\";\n // Determine if this is a detail-view-first collection showing the view page\n const isDetailMode = collection.defaultEntityAction === \"view\" && !isNew && !isCopy && entityId && !isEditRoute;\n\n // A record is full screen either because its collection has no list to show\n // beside it, or because the user folded that list away. Only the second is\n // reversible, and it is reversible by dropping `#full` alone: this is the\n // same URL the split route reads, so the same conditions decide it.\n const splitListAvailable = !isNew && !isCopy && entityId !== undefined &&\n navigationEntries[0]?.type === \"collection\" &&\n (navigationEntries.length === 2 || navigationEntries.length === 3) &&\n resolveCollectionOpenMode({\n collection,\n search: location.search,\n savedViewMode: userConfigPersistence?.getTablePreferences(collection.slug).defaultViewMode,\n registeredViews: customizationController.collectionViews\n }) === \"split\";\n\n const showList = splitListAvailable\n ? () => navigate({\n pathname,\n search: location.search,\n hash: \"\"\n })\n : undefined;\n\n if (isDetailMode) {\n return <>\n <DetailViewBinding\n key={collection.slug + \"_view_\" + entityId}\n entityId={entityId}\n collection={collection}\n layout={\"full_screen\"}\n path={collectionPath}\n selectedTab={selectedTab ?? undefined}\n onShowList={showList}\n onEditClick={() => {\n const editUrl = urlController.buildUrlCollectionPath(`${collectionPath}/${entityId}`) + \"/edit\";\n navigate(editUrl + hash);\n }}\n onTabChange={(params) => {\n setSelectedTab(params.selectedTab);\n navigate(`${recordTabUrl(entityId, params.selectedTab)}${hash}`, { replace: true });\n }}\n parentCollectionSlugs={parentCollectionSlugs}\n parentEntityIds={parentEntityIds}\n />\n </>;\n }\n\n return <>\n <EditViewBinding\n key={collection.slug + \"_\" + (isNew ? \"new\" : (isCopy ? entityId + \"_copy\" : entityId))}\n entityId={isNew ? undefined : entityId}\n collection={collection}\n layout={\"full_screen\"}\n path={collectionPath}\n copy={isCopy}\n selectedTab={selectedTab ?? undefined}\n onShowList={showList}\n defaultValues={isNew ? defaultValues : undefined}\n onValuesModified={(modified) => blocked.current = modified}\n navigateBack={() => {\n const detailUrl = urlController.buildUrlCollectionPath(`${collectionPath}/${entityId}`);\n navigate(detailUrl + hash);\n }}\n onSaved={(params) => {\n const newSelectedTab = params.selectedTab;\n const newEntityId = params.id;\n const savedHash = isNew ? \"\" : hash;\n navigate(`${recordTabUrl(newEntityId, newSelectedTab)}${savedHash}`, { replace: true });\n }}\n onTabChange={(params) => {\n setSelectedTab(params.selectedTab);\n if (isNew || entityId === undefined) {\n return;\n }\n navigate(`${recordTabUrl(entityId, params.selectedTab)}${hash}`, { replace: true });\n }}\n parentCollectionSlugs={parentCollectionSlugs} parentEntityIds={parentEntityIds}\n />\n\n <UnsavedChangesDialog\n open={blocker?.state === \"blocked\"}\n handleOk={() => blocker?.proceed?.()}\n handleCancel={() => blocker?.reset?.()}\n body={t(\"unsaved_changes_in_entity\")}/>\n </>;\n}\n\n/**\n * Shown when a URL names a collection the registry cannot resolve.\n *\n * This used to be `return null`, which renders an empty pane inside the app\n * chrome: the sidebar, the nav highlight and the breadcrumb all still work,\n * because those read the collections array directly, while the view itself is\n * blank. Nothing is thrown, and the only trace is a `console.debug` — so the\n * panel looks like it lost its data rather than like it failed to find the\n * collection, and there is no string to search for.\n *\n * A slug containing slashes went unresolvable this way and cost an afternoon to\n * find. The lookup is fixed; this is the part that made it expensive.\n */\nfunction UnresolvedCollectionView({ path }: { path: string }) {\n const { t } = useTranslation();\n // Warn, not debug: this is a route that renders nothing useful, and it\n // should be visible at the console's default level.\n useEffect(() => {\n console.warn(\n `[rebase] No collection is registered for \"${path}\", so this route has nothing to render. ` +\n \"Check that the collection is in the collections array and that its slug matches the URL.\"\n );\n }, [path]);\n\n return <CenteredView>\n <ErrorView\n title={t(\"collection_not_found\")}\n error={t(\"collection_not_found_body\", { path })}\n tooltip={t(\"collection_not_found_hint\")}/>\n </CenteredView>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA4BA,SAAgB,cAAc;CAC1B,OAAO,oBAAC,UAAD;EAAU,UAAU,oBAAC,wBAAD,CAAwB,CAAA;YAC/C,oBAAC,oBAAD,CAAoB,CAAA;CACd,CAAA;AACd;AAEA,SAAS,qBAAqB;CAE1B,MAAM,WAAW,YAAY;CAC7B,MAAM,qBAAqB,gCAAgC;CAC3D,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,cAAc,yBAAyB;CAC7C,MAAM,wBAAwB,gCAAgC;CAC9D,MAAM,0BAA0B,2BAA2B;CAC3D,MAAM,yBAAyB,qBAAqB,mBAAmB,yBAAqB;CAC5F,MAAM,kBAAkB,6BAA6B;CAErD,MAAM,OAAO,SAAS;CAKtB,MAAM,mBAAmB,KAAK,SAAS,WAAW;CAClD,MAAM,cAAc,KAAK,SAAS,OAAO,KAAK;CAC9C,MAAM,QAAQ,KAAK,SAAS,MAAM,KAAK,CAAC;CACxC,MAAM,SAAS,KAAK,SAAS,OAAO;CACpC,MAAM,eAAe,KAAK,SAAS,OAAO;CAE1C,MAAM,WAAW,SAAS;CAG1B,MAAM,oBAAoB,6BAA6B;EACnD,MAHmB,cAAc,kBAAkB,QAG7C;EACN,aAAa,mBAAmB,eAAe,CAAC;CACpD,CAAC;CAED,gBAAgB;EACZ,YAAY,IAAI,EACZ,aAAa,kBAAkB,KAAK,UAAU;GAE1C,IAAI,MAAM,SAAS,UACf,OAAQ;IACJ,OAAO,OAAO,MAAM,QAAQ;IAC5B,KAAK,cAAc,uBAAuB,MAAM,IAAI;GACxD;QACG,IAAI,MAAM,SAAS,eACtB,OAAQ;IACJ,OAAO,OAAO,MAAM,KAAK,QAAQ,MAAM,KAAK,GAAG;IAC/C,KAAK,cAAc,uBAAuB,MAAM,IAAI;GACxD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AAeA,SAAS,yBAAyB,EAAE,QAA0B;CAC1D,MAAM,EAAE,MAAM,eAAe;CAG7B,gBAAgB;EACZ,QAAQ,KACJ,6CAA6C,KAAK,iIAEtD;CACJ,GAAG,CAAC,IAAI,CAAC;CAET,OAAO,oBAAC,cAAD,EAAA,UACH,oBAAC,WAAD;EACI,OAAO,EAAE,sBAAsB;EAC/B,OAAO,EAAE,6BAA6B,EAAE,KAAK,CAAC;EAC9C,SAAS,EAAE,2BAA2B;CAAG,CAAA,EACnC,CAAA;AAClB"}
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * ```tsx
9
9
  * import { savedAppsView } from "@rebasepro/cms";
10
- * <RebaseCMS collections={collections} views={[savedAppsView]} />
10
+ * <RebaseCMS tableCustomizations={tableCustomizations} views={[savedAppsView]} />
11
11
  * ```
12
12
  */
13
13
  import React from "react";
@@ -14,7 +14,7 @@ import { useApiBase, useApiConfig } from "@rebasepro/app";
14
14
  *
15
15
  * ```tsx
16
16
  * import { savedAppsView } from "@rebasepro/cms";
17
- * <RebaseCMS collections={collections} views={[savedAppsView]} />
17
+ * <RebaseCMS tableCustomizations={tableCustomizations} views={[savedAppsView]} />
18
18
  * ```
19
19
  */
20
20
  /** Who an app is for, as the list says it. */