@rebasepro/cms 0.23.0 → 0.24.1-canary.g56af4a4

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 (828) hide show
  1. package/dist/collection_editor/CollectionEditorDialogsContext.js +10 -0
  2. package/dist/collection_editor/CollectionEditorDialogsContext.js.map +1 -0
  3. package/dist/collection_editor/ConfigControllerProvider.js +274 -0
  4. package/dist/collection_editor/ConfigControllerProvider.js.map +1 -0
  5. package/dist/collection_editor/_cms_internals.d.ts +2 -1
  6. package/dist/collection_editor/api/generateCollectionApi.js +64 -0
  7. package/dist/collection_editor/api/generateCollectionApi.js.map +1 -0
  8. package/dist/collection_editor/collection_wire.d.ts +13 -0
  9. package/dist/collection_editor/collection_wire.js +49 -0
  10. package/dist/collection_editor/collection_wire.js.map +1 -0
  11. package/dist/collection_editor/liveSchemaClient.d.ts +38 -18
  12. package/dist/collection_editor/liveSchemaClient.js +130 -0
  13. package/dist/collection_editor/liveSchemaClient.js.map +1 -0
  14. package/dist/collection_editor/relation_kinds.js +74 -0
  15. package/dist/collection_editor/relation_kinds.js.map +1 -0
  16. package/dist/collection_editor/serializable_types.d.ts +6 -1
  17. package/dist/collection_editor/serializable_utils.js +504 -0
  18. package/dist/collection_editor/serializable_utils.js.map +1 -0
  19. package/dist/collection_editor/types/config_controller.d.ts +11 -0
  20. package/dist/collection_editor/ui/EditorCollectionAction.js +37 -0
  21. package/dist/collection_editor/ui/EditorCollectionAction.js.map +1 -0
  22. package/dist/collection_editor/ui/MissingReferenceWidget.js +39 -0
  23. package/dist/collection_editor/ui/MissingReferenceWidget.js.map +1 -0
  24. package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.js +160 -0
  25. package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.js.map +1 -0
  26. package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.js +61 -0
  27. package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.js.map +1 -0
  28. package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.js +731 -0
  29. package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.js.map +1 -0
  30. package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.js +220 -0
  31. package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.js.map +1 -0
  32. package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.js +160 -0
  33. package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.js.map +1 -0
  34. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.js +394 -0
  35. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.js.map +1 -0
  36. package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.js +616 -0
  37. package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.js.map +1 -0
  38. package/dist/collection_editor/ui/collection_editor/CollectionStudioView.js +68 -0
  39. package/dist/collection_editor/ui/collection_editor/CollectionStudioView.js.map +1 -0
  40. package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.js +11 -0
  41. package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.js.map +1 -0
  42. package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.js +148 -0
  43. package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.js.map +1 -0
  44. package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.js +244 -0
  45. package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.js.map +1 -0
  46. package/dist/collection_editor/ui/collection_editor/EnumForm.js +222 -0
  47. package/dist/collection_editor/ui/collection_editor/EnumForm.js.map +1 -0
  48. package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.js +204 -0
  49. package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.js.map +1 -0
  50. package/dist/collection_editor/ui/collection_editor/GetCodeDialog.js +108 -0
  51. package/dist/collection_editor/ui/collection_editor/GetCodeDialog.js.map +1 -0
  52. package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.js +163 -0
  53. package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.js.map +1 -0
  54. package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.js +59 -0
  55. package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.js.map +1 -0
  56. package/dist/collection_editor/ui/collection_editor/PropertyEditView.js +640 -0
  57. package/dist/collection_editor/ui/collection_editor/PropertyEditView.js.map +1 -0
  58. package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.js +141 -0
  59. package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.js.map +1 -0
  60. package/dist/collection_editor/ui/collection_editor/PropertyTree.js +210 -0
  61. package/dist/collection_editor/ui/collection_editor/PropertyTree.js.map +1 -0
  62. package/dist/collection_editor/ui/collection_editor/RouterCollectionStudioView.js +31 -0
  63. package/dist/collection_editor/ui/collection_editor/RouterCollectionStudioView.js.map +1 -0
  64. package/dist/collection_editor/ui/collection_editor/RouterCollectionsStudioView.js +25 -0
  65. package/dist/collection_editor/ui/collection_editor/RouterCollectionsStudioView.js.map +1 -0
  66. package/dist/{SchemaChangeDialog-BeP0A4MJ.js → collection_editor/ui/collection_editor/SchemaChangeDialog.js} +73 -69
  67. package/dist/collection_editor/ui/collection_editor/SchemaChangeDialog.js.map +1 -0
  68. package/dist/collection_editor/ui/collection_editor/SwitchControl.js +24 -0
  69. package/dist/collection_editor/ui/collection_editor/SwitchControl.js.map +1 -0
  70. package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.js +66 -0
  71. package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.js.map +1 -0
  72. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js +61 -0
  73. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.js.map +1 -0
  74. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.js +188 -0
  75. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.js.map +1 -0
  76. package/dist/collection_editor/ui/collection_editor/import/clean_import_data.d.ts +12 -0
  77. package/dist/collection_editor/ui/collection_editor/import/clean_import_data.js +74 -0
  78. package/dist/collection_editor/ui/collection_editor/import/clean_import_data.js.map +1 -0
  79. package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.js +100 -0
  80. package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.js.map +1 -0
  81. package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.js +34 -0
  82. package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.js.map +1 -0
  83. package/dist/collection_editor/ui/collection_editor/properties/CommonPropertyFields.js +75 -0
  84. package/dist/collection_editor/ui/collection_editor/properties/CommonPropertyFields.js.map +1 -0
  85. package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.js +338 -0
  86. package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.js.map +1 -0
  87. package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.js +83 -0
  88. package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.js.map +1 -0
  89. package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.js +15 -0
  90. package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.js.map +1 -0
  91. package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.js +121 -0
  92. package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.js.map +1 -0
  93. package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.js +127 -0
  94. package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.js.map +1 -0
  95. package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.js +151 -0
  96. package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.js.map +1 -0
  97. package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.js +77 -0
  98. package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.js.map +1 -0
  99. package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.js +254 -0
  100. package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.js.map +1 -0
  101. package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.js +71 -0
  102. package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.js.map +1 -0
  103. package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.js +356 -0
  104. package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.js.map +1 -0
  105. package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.js +173 -0
  106. package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.js.map +1 -0
  107. package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.js +79 -0
  108. package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.js.map +1 -0
  109. package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.js +34 -0
  110. package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.js.map +1 -0
  111. package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.js +47 -0
  112. package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.js.map +1 -0
  113. package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.js +47 -0
  114. package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.js.map +1 -0
  115. package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.js +62 -0
  116. package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.js.map +1 -0
  117. package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.js +119 -0
  118. package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.js.map +1 -0
  119. package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +10 -0
  120. package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.js +178 -0
  121. package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.js.map +1 -0
  122. package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.js +23 -0
  123. package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.js.map +1 -0
  124. package/dist/collection_editor/ui/collection_editor/templates/blog_template.js +116 -0
  125. package/dist/collection_editor/ui/collection_editor/templates/blog_template.js.map +1 -0
  126. package/dist/collection_editor/ui/collection_editor/templates/pages_template.js +182 -0
  127. package/dist/collection_editor/ui/collection_editor/templates/pages_template.js.map +1 -0
  128. package/dist/collection_editor/ui/collection_editor/templates/products_template.js +87 -0
  129. package/dist/collection_editor/ui/collection_editor/templates/products_template.js.map +1 -0
  130. package/dist/collection_editor/ui/collection_editor/templates/users_template.js +46 -0
  131. package/dist/collection_editor/ui/collection_editor/templates/users_template.js.map +1 -0
  132. package/dist/collection_editor/ui/collection_editor/util.js +20 -0
  133. package/dist/collection_editor/ui/collection_editor/util.js.map +1 -0
  134. package/dist/collection_editor/ui/collection_editor/utils/strings.js +2 -0
  135. package/dist/collection_editor/ui/collection_editor/utils/supported_fields.js +37 -0
  136. package/dist/collection_editor/ui/collection_editor/utils/supported_fields.js.map +1 -0
  137. package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.js +192 -0
  138. package/dist/collection_editor/ui/collection_editor/utils/update_property_for_widget.js.map +1 -0
  139. package/dist/collection_editor/useCollectionEditorController.js +12 -0
  140. package/dist/collection_editor/useCollectionEditorController.js.map +1 -0
  141. package/dist/collection_editor/useCollectionsConfigController.js +12 -0
  142. package/dist/collection_editor/useCollectionsConfigController.js.map +1 -0
  143. package/dist/collection_editor/useJsonCollectionsConfigController.js +191 -0
  144. package/dist/collection_editor/useJsonCollectionsConfigController.js.map +1 -0
  145. package/dist/collection_editor/useLiveSchemaEditing.d.ts +5 -5
  146. package/dist/collection_editor/useLiveSchemaEditing.js +214 -0
  147. package/dist/collection_editor/useLiveSchemaEditing.js.map +1 -0
  148. package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +7 -0
  149. package/dist/collection_editor/useLocalCollectionsConfigController.js +228 -0
  150. package/dist/collection_editor/useLocalCollectionsConfigController.js.map +1 -0
  151. package/dist/collection_editor/useSafeSnackbarController.js +13 -0
  152. package/dist/collection_editor/useSafeSnackbarController.js.map +1 -0
  153. package/dist/collection_editor/validateCollectionJson.js +289 -0
  154. package/dist/collection_editor/validateCollectionJson.js.map +1 -0
  155. package/dist/collection_editor_ui.js +7 -33
  156. package/dist/components/AdditionalFieldValue.js +60 -0
  157. package/dist/components/AdditionalFieldValue.js.map +1 -0
  158. package/dist/components/AdminModeSyncer.js +41 -0
  159. package/dist/components/AdminModeSyncer.js.map +1 -0
  160. package/dist/components/ArrayContainer.d.ts +8 -2
  161. package/dist/components/ArrayContainer.js +363 -0
  162. package/dist/components/ArrayContainer.js.map +1 -0
  163. package/dist/components/ClearFilterSortButton.d.ts +7 -1
  164. package/dist/components/ClearFilterSortButton.js +33 -0
  165. package/dist/components/ClearFilterSortButton.js.map +1 -0
  166. package/dist/components/CollectionEditorDialogs.js +49 -0
  167. package/dist/components/CollectionEditorDialogs.js.map +1 -0
  168. package/dist/components/CollectionPanel.js +95 -0
  169. package/dist/components/CollectionPanel.js.map +1 -0
  170. package/dist/components/CollectionTableBinding/CollectionRowActions.js +165 -0
  171. package/dist/components/CollectionTableBinding/CollectionRowActions.js.map +1 -0
  172. package/dist/components/CollectionTableBinding/CollectionTableBinding.js +329 -0
  173. package/dist/components/CollectionTableBinding/CollectionTableBinding.js.map +1 -0
  174. package/dist/components/CollectionTableBinding/PropertyTableCell.js +311 -0
  175. package/dist/components/CollectionTableBinding/PropertyTableCell.js.map +1 -0
  176. package/dist/components/CollectionTableBinding/column_utils.js +85 -0
  177. package/dist/components/CollectionTableBinding/column_utils.js.map +1 -0
  178. package/dist/components/CollectionTableBinding/fields/CompactEntityCellField.js +45 -0
  179. package/dist/components/CollectionTableBinding/fields/CompactEntityCellField.js.map +1 -0
  180. package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js +66 -0
  181. package/dist/components/CollectionTableBinding/fields/TableMultipleRelationField.js.map +1 -0
  182. package/dist/components/CollectionTableBinding/fields/TableReferenceField.js +86 -0
  183. package/dist/components/CollectionTableBinding/fields/TableReferenceField.js.map +1 -0
  184. package/dist/components/CollectionTableBinding/fields/TableRelationField.js +93 -0
  185. package/dist/components/CollectionTableBinding/fields/TableRelationField.js.map +1 -0
  186. package/dist/components/CollectionTableBinding/fields/TableRelationSelectorField.js +33 -0
  187. package/dist/components/CollectionTableBinding/fields/TableRelationSelectorField.js.map +1 -0
  188. package/dist/components/CollectionTableBinding/fields/TableStorageUpload.js +171 -0
  189. package/dist/components/CollectionTableBinding/fields/TableStorageUpload.js.map +1 -0
  190. package/dist/components/CollectionTableBinding/fields/VirtualTableSelect.js +91 -0
  191. package/dist/components/CollectionTableBinding/fields/VirtualTableSelect.js.map +1 -0
  192. package/dist/components/CollectionTableBinding/fields/VirtualTableUserSelect.js +36 -0
  193. package/dist/components/CollectionTableBinding/fields/VirtualTableUserSelect.js.map +1 -0
  194. package/dist/components/CollectionTableBinding/index.js +6 -0
  195. package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.js +50 -0
  196. package/dist/components/CollectionTableBinding/internal/CollectionTableToolbar.js.map +1 -0
  197. package/dist/components/CollectionTableBinding/internal/EntityTableCell.d.ts +2 -0
  198. package/dist/components/CollectionTableBinding/internal/EntityTableCell.js +223 -0
  199. package/dist/components/CollectionTableBinding/internal/EntityTableCell.js.map +1 -0
  200. package/dist/components/CollectionTableBinding/internal/EntityTableCellActions.js +58 -0
  201. package/dist/components/CollectionTableBinding/internal/EntityTableCellActions.js.map +1 -0
  202. package/dist/components/CollectionTableBinding/internal/TableCellOpener.js +53 -0
  203. package/dist/components/CollectionTableBinding/internal/TableCellOpener.js.map +1 -0
  204. package/dist/components/CollectionTableBinding/internal/common.js +40 -0
  205. package/dist/components/CollectionTableBinding/internal/common.js.map +1 -0
  206. package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js +270 -0
  207. package/dist/components/CollectionTableBinding/internal/popup_field/PopupFormField.js.map +1 -0
  208. package/dist/components/CollectionTableBinding/internal/popup_field/useDraggable.js +68 -0
  209. package/dist/components/CollectionTableBinding/internal/popup_field/useDraggable.js.map +1 -0
  210. package/dist/components/CollectionTableBinding/internal/popup_field/useWindowSize.js +24 -0
  211. package/dist/components/CollectionTableBinding/internal/popup_field/useWindowSize.js.map +1 -0
  212. package/dist/components/CollectionTableBinding/table_bindings.js +306 -0
  213. package/dist/components/CollectionTableBinding/table_bindings.js.map +1 -0
  214. package/dist/components/CollectionViewBinding/BoardCardBinding.js +160 -0
  215. package/dist/components/CollectionViewBinding/BoardCardBinding.js.map +1 -0
  216. package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js +471 -0
  217. package/dist/components/CollectionViewBinding/CollectionBoardViewBinding.js.map +1 -0
  218. package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js +108 -0
  219. package/dist/components/CollectionViewBinding/CollectionCardViewBinding.js.map +1 -0
  220. package/dist/components/CollectionViewBinding/CollectionListViewBinding.js +988 -0
  221. package/dist/components/CollectionViewBinding/CollectionListViewBinding.js.map +1 -0
  222. package/dist/components/CollectionViewBinding/CollectionViewActions.d.ts +6 -1
  223. package/dist/components/CollectionViewBinding/CollectionViewActions.js +146 -0
  224. package/dist/components/CollectionViewBinding/CollectionViewActions.js.map +1 -0
  225. package/dist/components/CollectionViewBinding/CollectionViewBinding.d.ts +5 -2
  226. package/dist/components/CollectionViewBinding/CollectionViewBinding.js +1209 -0
  227. package/dist/components/CollectionViewBinding/CollectionViewBinding.js.map +1 -0
  228. package/dist/components/CollectionViewBinding/CollectionViewStartActions.js +133 -0
  229. package/dist/components/CollectionViewBinding/CollectionViewStartActions.js.map +1 -0
  230. package/dist/components/CollectionViewBinding/EntityCardBinding.js +133 -0
  231. package/dist/components/CollectionViewBinding/EntityCardBinding.js.map +1 -0
  232. package/dist/components/CollectionViewBinding/FilterPresetsButton.js +203 -0
  233. package/dist/components/CollectionViewBinding/FilterPresetsButton.js.map +1 -0
  234. package/dist/components/CollectionViewBinding/FiltersDialog.d.ts +5 -0
  235. package/dist/components/CollectionViewBinding/FiltersDialog.js +148 -0
  236. package/dist/components/CollectionViewBinding/FiltersDialog.js.map +1 -0
  237. package/dist/components/CollectionViewBinding/SearchExplanation.js +86 -0
  238. package/dist/components/CollectionViewBinding/SearchExplanation.js.map +1 -0
  239. package/dist/components/CollectionViewBinding/SearchHighlight.js +262 -0
  240. package/dist/components/CollectionViewBinding/SearchHighlight.js.map +1 -0
  241. package/dist/components/CollectionViewBinding/SlotValue.js +117 -0
  242. package/dist/components/CollectionViewBinding/SlotValue.js.map +1 -0
  243. package/dist/components/CollectionViewBinding/SortButton.js +214 -0
  244. package/dist/components/CollectionViewBinding/SortButton.js.map +1 -0
  245. package/dist/components/CollectionViewBinding/SplitListCloseButton.js +41 -0
  246. package/dist/components/CollectionViewBinding/SplitListCloseButton.js.map +1 -0
  247. package/dist/components/CollectionViewBinding/SplitListShowButton.js +29 -0
  248. package/dist/components/CollectionViewBinding/SplitListShowButton.js.map +1 -0
  249. package/dist/components/CollectionViewBinding/SplitListView.js +311 -0
  250. package/dist/components/CollectionViewBinding/SplitListView.js.map +1 -0
  251. package/dist/components/CollectionViewBinding/SplitViewContext.js +21 -0
  252. package/dist/components/CollectionViewBinding/SplitViewContext.js.map +1 -0
  253. package/dist/components/CollectionViewBinding/ViewModeToggle.js +150 -0
  254. package/dist/components/CollectionViewBinding/ViewModeToggle.js.map +1 -0
  255. package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.js +49 -0
  256. package/dist/components/CollectionViewBinding/hooks/useCollectionInlineEditor.js.map +1 -0
  257. package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.js +122 -0
  258. package/dist/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.js.map +1 -0
  259. package/dist/components/CollectionViewBinding/useBoardDataController.js +530 -0
  260. package/dist/components/CollectionViewBinding/useBoardDataController.js.map +1 -0
  261. package/dist/components/CollectionViewBinding/usePreviewSlots.d.ts +4 -1
  262. package/dist/components/CollectionViewBinding/usePreviewSlots.js +384 -0
  263. package/dist/components/CollectionViewBinding/usePreviewSlots.js.map +1 -0
  264. package/dist/components/CollectionViewBinding/useSelectionController.js +104 -0
  265. package/dist/components/CollectionViewBinding/useSelectionController.js.map +1 -0
  266. package/dist/components/CollectionViewBinding/utils.js +21 -0
  267. package/dist/components/CollectionViewBinding/utils.js.map +1 -0
  268. package/dist/components/DefaultAppBar.js +179 -0
  269. package/dist/components/DefaultAppBar.js.map +1 -0
  270. package/dist/components/DefaultDrawer.js +364 -0
  271. package/dist/components/DefaultDrawer.js.map +1 -0
  272. package/dist/components/DeleteEntityDialog.js +256 -0
  273. package/dist/components/DeleteEntityDialog.js.map +1 -0
  274. package/dist/components/DetailViewBinding.js +504 -0
  275. package/dist/components/DetailViewBinding.js.map +1 -0
  276. package/dist/components/DrawerNavigationGroup.js +74 -0
  277. package/dist/components/DrawerNavigationGroup.js.map +1 -0
  278. package/dist/components/DrawerNavigationItem.d.ts +8 -0
  279. package/dist/components/DrawerNavigationItem.js +45 -0
  280. package/dist/components/DrawerNavigationItem.js.map +1 -0
  281. package/dist/components/EditFormActions.js +210 -0
  282. package/dist/components/EditFormActions.js.map +1 -0
  283. package/dist/components/EditViewBinding.d.ts +7 -1
  284. package/dist/components/EditViewBinding.js +802 -0
  285. package/dist/components/EditViewBinding.js.map +1 -0
  286. package/dist/components/EntityDisplayHeader.js +139 -0
  287. package/dist/components/EntityDisplayHeader.js.map +1 -0
  288. package/dist/components/EntityIdentityBar.d.ts +29 -4
  289. package/dist/components/EntityIdentityBar.js +364 -0
  290. package/dist/components/EntityIdentityBar.js.map +1 -0
  291. package/dist/components/EntityInspector.js +96 -0
  292. package/dist/components/EntityInspector.js.map +1 -0
  293. package/dist/components/EntityPreviewBinding.js +282 -0
  294. package/dist/components/EntityPreviewBinding.js.map +1 -0
  295. package/dist/components/EntityPreviewNesting.js +53 -0
  296. package/dist/components/EntityPreviewNesting.js.map +1 -0
  297. package/dist/components/EntityViewBinding.js +246 -0
  298. package/dist/components/EntityViewBinding.js.map +1 -0
  299. package/dist/components/FieldCaption.js +17 -0
  300. package/dist/components/FieldCaption.js.map +1 -0
  301. package/dist/components/HomePage/ContentHomePage.js +326 -0
  302. package/dist/components/HomePage/ContentHomePage.js.map +1 -0
  303. package/dist/components/HomePage/FavouritesView.js +44 -0
  304. package/dist/components/HomePage/FavouritesView.js.map +1 -0
  305. package/dist/components/HomePage/HomePageDnD.js +436 -0
  306. package/dist/components/HomePage/HomePageDnD.js.map +1 -0
  307. package/dist/components/HomePage/NavigationCard.js +59 -0
  308. package/dist/components/HomePage/NavigationCard.js.map +1 -0
  309. package/dist/components/HomePage/NavigationCardBinding.js +70 -0
  310. package/dist/components/HomePage/NavigationCardBinding.js.map +1 -0
  311. package/dist/components/HomePage/NavigationGroup.js +98 -0
  312. package/dist/components/HomePage/NavigationGroup.js.map +1 -0
  313. package/dist/components/HomePage/RenameGroupDialog.js +89 -0
  314. package/dist/components/HomePage/RenameGroupDialog.js.map +1 -0
  315. package/dist/components/InlineEntityPreview.js +116 -0
  316. package/dist/components/InlineEntityPreview.js.map +1 -0
  317. package/dist/{JsonPreviewBinding-v0w3H0fp.js → components/JsonPreviewBinding.js} +2 -2
  318. package/dist/components/JsonPreviewBinding.js.map +1 -0
  319. package/dist/components/NavigationLoadingErrorView.d.ts +16 -0
  320. package/dist/components/NavigationLoadingErrorView.js +27 -0
  321. package/dist/components/NavigationLoadingErrorView.js.map +1 -0
  322. package/dist/components/PickerTrigger.js +27 -0
  323. package/dist/components/PickerTrigger.js.map +1 -0
  324. package/dist/components/PropertyCollectionView.js +215 -0
  325. package/dist/components/PropertyCollectionView.js.map +1 -0
  326. package/dist/components/PropertyConfigBadge.js +19 -0
  327. package/dist/components/PropertyConfigBadge.js.map +1 -0
  328. package/dist/components/PropertyKeyHint.js +58 -0
  329. package/dist/components/PropertyKeyHint.js.map +1 -0
  330. package/dist/components/RebaseAuthGate.js +35 -0
  331. package/dist/components/RebaseAuthGate.js.map +1 -0
  332. package/dist/components/RebaseCMS.js +44 -0
  333. package/dist/components/RebaseCMS.js.map +1 -0
  334. package/dist/components/RebaseLayout.js +59 -0
  335. package/dist/components/RebaseLayout.js.map +1 -0
  336. package/dist/components/RebaseNavigation.js +211 -0
  337. package/dist/components/RebaseNavigation.js.map +1 -0
  338. package/dist/components/RebaseRouteDefs.js +96 -0
  339. package/dist/components/RebaseRouteDefs.js.map +1 -0
  340. package/dist/components/RebaseShell.js +50 -0
  341. package/dist/components/RebaseShell.js.map +1 -0
  342. package/dist/components/ReferenceTable/SelectionTableBinding.js +224 -0
  343. package/dist/components/ReferenceTable/SelectionTableBinding.js.map +1 -0
  344. package/dist/components/ReferenceWidget.js +100 -0
  345. package/dist/components/ReferenceWidget.js.map +1 -0
  346. package/dist/components/RelationSelector.js +625 -0
  347. package/dist/components/RelationSelector.js.map +1 -0
  348. package/dist/components/SearchIconsView.js +52 -0
  349. package/dist/components/SearchIconsView.js.map +1 -0
  350. package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
  351. package/dist/components/SelectableTable/SelectableTable.js +158 -0
  352. package/dist/components/SelectableTable/SelectableTable.js.map +1 -0
  353. package/dist/components/SelectableTable/SelectableTableContext.js +8 -0
  354. package/dist/components/SelectableTable/SelectableTableContext.js.map +1 -0
  355. package/dist/components/SelectableTable/SelectionStore.js +29 -0
  356. package/dist/components/SelectableTable/SelectionStore.js.map +1 -0
  357. package/dist/components/SelectableTable/filters/BooleanFilterField.js +28 -0
  358. package/dist/components/SelectableTable/filters/BooleanFilterField.js.map +1 -0
  359. package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
  360. package/dist/components/SelectableTable/filters/DateTimeFilterField.js +93 -0
  361. package/dist/components/SelectableTable/filters/DateTimeFilterField.js.map +1 -0
  362. package/dist/components/SelectableTable/filters/FilterFieldBinding.js +132 -0
  363. package/dist/components/SelectableTable/filters/FilterFieldBinding.js.map +1 -0
  364. package/dist/components/SelectableTable/filters/ReferenceFilterField.js +157 -0
  365. package/dist/components/SelectableTable/filters/ReferenceFilterField.js.map +1 -0
  366. package/dist/components/SelectableTable/filters/RelationFilterField.js +169 -0
  367. package/dist/components/SelectableTable/filters/RelationFilterField.js.map +1 -0
  368. package/dist/components/SelectableTable/filters/StringNumberFilterField.js +181 -0
  369. package/dist/components/SelectableTable/filters/StringNumberFilterField.js.map +1 -0
  370. package/dist/components/SelectableTable/filters/null_filter.js +36 -0
  371. package/dist/components/SelectableTable/filters/null_filter.js.map +1 -0
  372. package/dist/components/SideDialogs.js +149 -0
  373. package/dist/components/SideDialogs.js.map +1 -0
  374. package/dist/components/SidePanelBinding.js +287 -0
  375. package/dist/components/SidePanelBinding.js.map +1 -0
  376. package/dist/components/SidePanelProvider.js +69 -0
  377. package/dist/components/SidePanelProvider.js.map +1 -0
  378. package/dist/components/UserSelector.d.ts +2 -0
  379. package/dist/components/UserSelector.js +418 -0
  380. package/dist/components/UserSelector.js.map +1 -0
  381. package/dist/components/admin/CreationResultDialog.js +118 -0
  382. package/dist/components/admin/CreationResultDialog.js.map +1 -0
  383. package/dist/components/app/AppBar.js +14 -0
  384. package/dist/components/app/AppBar.js.map +1 -0
  385. package/dist/components/app/Drawer.js +26 -0
  386. package/dist/components/app/Drawer.js.map +1 -0
  387. package/dist/components/app/Scaffold.js +229 -0
  388. package/dist/components/app/Scaffold.js.map +1 -0
  389. package/dist/components/app/useApp.js +24 -0
  390. package/dist/components/app/useApp.js.map +1 -0
  391. package/dist/components/common/ActionMenuLabel.d.ts +15 -0
  392. package/dist/components/common/ActionMenuLabel.js +30 -0
  393. package/dist/components/common/ActionMenuLabel.js.map +1 -0
  394. package/dist/components/common/default_entity_actions.d.ts +37 -0
  395. package/dist/components/common/default_entity_actions.js +590 -0
  396. package/dist/components/common/default_entity_actions.js.map +1 -0
  397. package/dist/components/drawer_expansion.d.ts +25 -0
  398. package/dist/components/drawer_expansion.js +44 -0
  399. package/dist/components/drawer_expansion.js.map +1 -0
  400. package/dist/components/field_configs.d.ts +2 -2
  401. package/dist/components/field_configs.js +431 -0
  402. package/dist/components/field_configs.js.map +1 -0
  403. package/dist/components/field_ids.d.ts +11 -0
  404. package/dist/components/field_ids.js +58 -0
  405. package/dist/components/field_ids.js.map +1 -0
  406. package/dist/components/history/EntityHistoryEntry.js +151 -0
  407. package/dist/components/history/EntityHistoryEntry.js.map +1 -0
  408. package/dist/components/history/EntityHistoryView.js +157 -0
  409. package/dist/components/history/EntityHistoryView.js.map +1 -0
  410. package/dist/components/history/UserChip.js +21 -0
  411. package/dist/components/history/UserChip.js.map +1 -0
  412. package/dist/components/history/index.js +4 -0
  413. package/dist/components/lazy_record_views.d.ts +10 -0
  414. package/dist/components/lazy_record_views.js +57 -0
  415. package/dist/components/lazy_record_views.js.map +1 -0
  416. package/dist/contexts/BreacrumbsContext.js +28 -0
  417. package/dist/contexts/BreacrumbsContext.js.map +1 -0
  418. package/dist/contexts/EditorAIControllerContext.d.ts +18 -0
  419. package/dist/contexts/EditorAIControllerContext.js +29 -0
  420. package/dist/contexts/EditorAIControllerContext.js.map +1 -0
  421. package/dist/contexts/SideDialogsControllerContext.js +7 -0
  422. package/dist/contexts/SideDialogsControllerContext.js.map +1 -0
  423. package/dist/data_export/export/BasicExportAction.js +151 -0
  424. package/dist/data_export/export/BasicExportAction.js.map +1 -0
  425. package/dist/data_export/export/ExportCollectionAction.js +297 -0
  426. package/dist/data_export/export/ExportCollectionAction.js.map +1 -0
  427. package/dist/data_export/export/additional_fields.js +40 -0
  428. package/dist/data_export/export/additional_fields.js.map +1 -0
  429. package/dist/data_export/export/export.d.ts +35 -0
  430. package/dist/data_export/export/export.js +400 -0
  431. package/dist/data_export/export/export.js.map +1 -0
  432. package/dist/data_export/export/fetch_export_data.d.ts +17 -7
  433. package/dist/data_export/export/fetch_export_data.js +67 -0
  434. package/dist/data_export/export/fetch_export_data.js.map +1 -0
  435. package/dist/data_export/export/index.d.ts +4 -2
  436. package/dist/data_export/export/index.js +5 -0
  437. package/dist/data_import/components/DataNewPropertiesMapping.js +207 -0
  438. package/dist/data_import/components/DataNewPropertiesMapping.js.map +1 -0
  439. package/dist/data_import/components/ImportConversionProblems.d.ts +11 -0
  440. package/dist/data_import/components/ImportConversionProblems.js +89 -0
  441. package/dist/data_import/components/ImportConversionProblems.js.map +1 -0
  442. package/dist/data_import/components/ImportFileUpload.js +43 -0
  443. package/dist/data_import/components/ImportFileUpload.js.map +1 -0
  444. package/dist/data_import/components/ImportNewPropertyFieldPreview.js +42 -0
  445. package/dist/data_import/components/ImportNewPropertyFieldPreview.js.map +1 -0
  446. package/dist/data_import/components/ImportSaveInProgress.js +105 -0
  447. package/dist/data_import/components/ImportSaveInProgress.js.map +1 -0
  448. package/dist/data_import/components/index.d.ts +1 -0
  449. package/dist/data_import/hooks/useImportConfig.js +34 -0
  450. package/dist/data_import/hooks/useImportConfig.js.map +1 -0
  451. package/dist/{import-TCgkTVlS.js → data_import/import/ImportCollectionAction.js} +84 -92
  452. package/dist/data_import/import/ImportCollectionAction.js.map +1 -0
  453. package/dist/data_import/import/index.js +2 -0
  454. package/dist/data_import/utils/csv.js +146 -0
  455. package/dist/data_import/utils/csv.js.map +1 -0
  456. package/dist/data_import/utils/data.d.ts +81 -4
  457. package/dist/data_import/utils/data.js +366 -0
  458. package/dist/data_import/utils/data.js.map +1 -0
  459. package/dist/data_import/utils/file_headers.js +32 -0
  460. package/dist/data_import/utils/file_headers.js.map +1 -0
  461. package/dist/data_import/utils/file_to_json.js +149 -0
  462. package/dist/data_import/utils/file_to_json.js.map +1 -0
  463. package/dist/data_import/utils/get_import_inference_type.js +14 -0
  464. package/dist/data_import/utils/get_import_inference_type.js.map +1 -0
  465. package/dist/data_import/utils/id_column.js +27 -0
  466. package/dist/data_import/utils/id_column.js.map +1 -0
  467. package/dist/data_import/utils/import_columns.d.ts +48 -0
  468. package/dist/data_import/utils/import_columns.js +92 -0
  469. package/dist/data_import/utils/import_columns.js.map +1 -0
  470. package/dist/data_import/utils/save_entities.d.ts +33 -4
  471. package/dist/data_import/utils/save_entities.js +244 -0
  472. package/dist/data_import/utils/save_entities.js.map +1 -0
  473. package/dist/data_import/utils/transforms.js +83 -0
  474. package/dist/data_import/utils/transforms.js.map +1 -0
  475. package/dist/editor/components/SlashCommandMenu.js +497 -0
  476. package/dist/editor/components/SlashCommandMenu.js.map +1 -0
  477. package/dist/editor/components/editor-bubble-item.js +24 -0
  478. package/dist/editor/components/editor-bubble-item.js.map +1 -0
  479. package/dist/editor/components/editor-bubble.js +97 -0
  480. package/dist/editor/components/editor-bubble.js.map +1 -0
  481. package/dist/editor/components/image-bubble.js +148 -0
  482. package/dist/editor/components/image-bubble.js.map +1 -0
  483. package/dist/editor/components/table-bubble.js +406 -0
  484. package/dist/editor/components/table-bubble.js.map +1 -0
  485. package/dist/editor/editor.d.ts +7 -1
  486. package/dist/editor/editor.js +423 -0
  487. package/dist/editor/editor.js.map +1 -0
  488. package/dist/editor/extensions/HighlightDecorationExtension.js +74 -0
  489. package/dist/editor/extensions/HighlightDecorationExtension.js.map +1 -0
  490. package/dist/editor/extensions/Image.d.ts +28 -1
  491. package/dist/editor/extensions/Image.js +160 -0
  492. package/dist/editor/extensions/Image.js.map +1 -0
  493. package/dist/editor/extensions/TextLoadingDecorationExtension.js +82 -0
  494. package/dist/editor/extensions/TextLoadingDecorationExtension.js.map +1 -0
  495. package/dist/editor/extensions/clipboard.js +63 -0
  496. package/dist/editor/extensions/clipboard.js.map +1 -0
  497. package/dist/editor/extensions/drag-and-drop.js +354 -0
  498. package/dist/editor/extensions/drag-and-drop.js.map +1 -0
  499. package/dist/editor/hooks/useProseMirror.d.ts +4 -1
  500. package/dist/editor/hooks/useProseMirror.js +101 -0
  501. package/dist/editor/hooks/useProseMirror.js.map +1 -0
  502. package/dist/editor/hooks/useProseMirrorContext.js +11 -0
  503. package/dist/editor/hooks/useProseMirrorContext.js.map +1 -0
  504. package/dist/editor/markdown.js +154 -0
  505. package/dist/editor/markdown.js.map +1 -0
  506. package/dist/editor/nodeViews/ImageComponent.js +35 -0
  507. package/dist/editor/nodeViews/ImageComponent.js.map +1 -0
  508. package/dist/editor/nodeViews/ReactNodeView.js +57 -0
  509. package/dist/editor/nodeViews/ReactNodeView.js.map +1 -0
  510. package/dist/editor/nodeViews/TaskItemComponent.js +29 -0
  511. package/dist/editor/nodeViews/TaskItemComponent.js.map +1 -0
  512. package/dist/editor/nodeViews/index.js +21 -0
  513. package/dist/editor/nodeViews/index.js.map +1 -0
  514. package/dist/editor/plugins/index.js +54 -0
  515. package/dist/editor/plugins/index.js.map +1 -0
  516. package/dist/editor/plugins/inputrules.js +54 -0
  517. package/dist/editor/plugins/inputrules.js.map +1 -0
  518. package/dist/editor/plugins/placeholderPlugin.js +38 -0
  519. package/dist/editor/plugins/placeholderPlugin.js.map +1 -0
  520. package/dist/editor/plugins/slashCommandPlugin.js +40 -0
  521. package/dist/editor/plugins/slashCommandPlugin.js.map +1 -0
  522. package/dist/editor/sanitize-html.js +190 -0
  523. package/dist/editor/sanitize-html.js.map +1 -0
  524. package/dist/{markdown-CCqp8ibf.js → editor/schema.js} +2 -159
  525. package/dist/editor/schema.js.map +1 -0
  526. package/dist/editor/selectors/link-selector.js +118 -0
  527. package/dist/editor/selectors/link-selector.js.map +1 -0
  528. package/dist/editor/selectors/node-selector.js +118 -0
  529. package/dist/editor/selectors/node-selector.js.map +1 -0
  530. package/dist/editor/selectors/text-buttons.js +71 -0
  531. package/dist/editor/selectors/text-buttons.js.map +1 -0
  532. package/dist/editor/utils/prosemirror-utils.js +92 -0
  533. package/dist/editor/utils/prosemirror-utils.js.map +1 -0
  534. package/dist/editor/utils/remove_classes.js +16 -0
  535. package/dist/editor/utils/remove_classes.js.map +1 -0
  536. package/dist/editor.js +1 -3085
  537. package/dist/form/EntityForm.js +734 -0
  538. package/dist/form/EntityForm.js.map +1 -0
  539. package/dist/form/EntityFormActions.js +101 -0
  540. package/dist/form/EntityFormActions.js.map +1 -0
  541. package/dist/form/EntityFormBinding.js +257 -0
  542. package/dist/form/EntityFormBinding.js.map +1 -0
  543. package/dist/form/PropertyFieldBinding.js +298 -0
  544. package/dist/form/PropertyFieldBinding.js.map +1 -0
  545. package/dist/form/components/ErrorFocus.js +33 -0
  546. package/dist/form/components/ErrorFocus.js.map +1 -0
  547. package/dist/form/components/FieldBlock.js +118 -0
  548. package/dist/form/components/FieldBlock.js.map +1 -0
  549. package/dist/form/components/FieldHelperText.js +56 -0
  550. package/dist/form/components/FieldHelperText.js.map +1 -0
  551. package/dist/form/components/FormRail.js +118 -0
  552. package/dist/form/components/FormRail.js.map +1 -0
  553. package/dist/form/components/FormSections.js +63 -0
  554. package/dist/form/components/FormSections.js.map +1 -0
  555. package/dist/form/components/LabelWithIcon.js +29 -0
  556. package/dist/form/components/LabelWithIcon.js.map +1 -0
  557. package/dist/form/components/LocalChangesMenu.js +127 -0
  558. package/dist/form/components/LocalChangesMenu.js.map +1 -0
  559. package/dist/form/components/StorageItemPreview.js +46 -0
  560. package/dist/form/components/StorageItemPreview.js.map +1 -0
  561. package/dist/form/components/StorageUploadProgress.js +84 -0
  562. package/dist/form/components/StorageUploadProgress.js.map +1 -0
  563. package/dist/form/components/useRailVisible.js +43 -0
  564. package/dist/form/components/useRailVisible.js.map +1 -0
  565. package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.js +84 -0
  566. package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.js.map +1 -0
  567. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js +125 -0
  568. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.js.map +1 -0
  569. package/dist/form/field_bindings/BinaryFieldBinding.js +135 -0
  570. package/dist/form/field_bindings/BinaryFieldBinding.js.map +1 -0
  571. package/dist/form/field_bindings/BlockFieldBinding.js +164 -0
  572. package/dist/form/field_bindings/BlockFieldBinding.js.map +1 -0
  573. package/dist/form/field_bindings/DateTimeFieldBinding.js +47 -0
  574. package/dist/form/field_bindings/DateTimeFieldBinding.js.map +1 -0
  575. package/dist/form/field_bindings/GeopointFieldBinding.js +148 -0
  576. package/dist/form/field_bindings/GeopointFieldBinding.js.map +1 -0
  577. package/dist/form/field_bindings/KeyValueFieldBinding.js +450 -0
  578. package/dist/form/field_bindings/KeyValueFieldBinding.js.map +1 -0
  579. package/dist/form/field_bindings/MapFieldBinding.js +77 -0
  580. package/dist/form/field_bindings/MapFieldBinding.js.map +1 -0
  581. package/dist/form/field_bindings/MarkdownEditorFieldBinding.js +215 -0
  582. package/dist/form/field_bindings/MarkdownEditorFieldBinding.js.map +1 -0
  583. package/dist/form/field_bindings/MultiSelectFieldBinding.js +88 -0
  584. package/dist/form/field_bindings/MultiSelectFieldBinding.js.map +1 -0
  585. package/dist/form/field_bindings/MultipleRelationFieldBinding.js +118 -0
  586. package/dist/form/field_bindings/MultipleRelationFieldBinding.js.map +1 -0
  587. package/dist/form/field_bindings/ReadOnlyFieldBinding.js +52 -0
  588. package/dist/form/field_bindings/ReadOnlyFieldBinding.js.map +1 -0
  589. package/dist/form/field_bindings/ReferenceFieldBinding.js +99 -0
  590. package/dist/form/field_bindings/ReferenceFieldBinding.js.map +1 -0
  591. package/dist/form/field_bindings/RelationFieldBinding.js +135 -0
  592. package/dist/form/field_bindings/RelationFieldBinding.js.map +1 -0
  593. package/dist/form/field_bindings/RepeatFieldBinding.js +103 -0
  594. package/dist/form/field_bindings/RepeatFieldBinding.js.map +1 -0
  595. package/dist/form/field_bindings/SelectFieldBinding.js +80 -0
  596. package/dist/form/field_bindings/SelectFieldBinding.js.map +1 -0
  597. package/dist/form/field_bindings/StorageUploadFieldBinding.js +266 -0
  598. package/dist/form/field_bindings/StorageUploadFieldBinding.js.map +1 -0
  599. package/dist/form/field_bindings/SwitchFieldBinding.js +41 -0
  600. package/dist/form/field_bindings/SwitchFieldBinding.js.map +1 -0
  601. package/dist/form/field_bindings/TextFieldBinding.js +114 -0
  602. package/dist/form/field_bindings/TextFieldBinding.js.map +1 -0
  603. package/dist/form/field_bindings/UserSelectFieldBinding.js +48 -0
  604. package/dist/form/field_bindings/UserSelectFieldBinding.js.map +1 -0
  605. package/dist/form/field_bindings/VectorFieldBinding.js +147 -0
  606. package/dist/form/field_bindings/VectorFieldBinding.js.map +1 -0
  607. package/dist/form/form_keyboard_scope.d.ts +26 -0
  608. package/dist/form/form_keyboard_scope.js +39 -0
  609. package/dist/form/form_keyboard_scope.js.map +1 -0
  610. package/dist/form/form_uploads.d.ts +24 -0
  611. package/dist/form/form_uploads.js +31 -0
  612. package/dist/form/form_uploads.js.map +1 -0
  613. package/dist/form/form_utils.d.ts +48 -0
  614. package/dist/form/form_utils.js +280 -0
  615. package/dist/form/form_utils.js.map +1 -0
  616. package/dist/form/resolve_cell_property.d.ts +32 -0
  617. package/dist/form/resolve_cell_property.js +80 -0
  618. package/dist/form/resolve_cell_property.js.map +1 -0
  619. package/dist/form/resolve_form_properties.d.ts +27 -0
  620. package/dist/form/resolve_form_properties.js +78 -0
  621. package/dist/form/resolve_form_properties.js.map +1 -0
  622. package/dist/form/useClearRestoreValue.js +27 -0
  623. package/dist/form/useClearRestoreValue.js.map +1 -0
  624. package/dist/form/useUndoableDiscard.js +36 -0
  625. package/dist/form/useUndoableDiscard.js.map +1 -0
  626. package/dist/form/validation.d.ts +20 -0
  627. package/dist/form/validation.js +416 -0
  628. package/dist/form/validation.js.map +1 -0
  629. package/dist/hooks/navigation/contexts/CollectionRegistryContext.js +22 -0
  630. package/dist/hooks/navigation/contexts/CollectionRegistryContext.js.map +1 -0
  631. package/dist/hooks/navigation/contexts/NavigationStateContext.js +15 -0
  632. package/dist/hooks/navigation/contexts/NavigationStateContext.js.map +1 -0
  633. package/dist/hooks/navigation/contexts/UrlContext.js +22 -0
  634. package/dist/hooks/navigation/contexts/UrlContext.js.map +1 -0
  635. package/dist/hooks/navigation/useAsyncResolver.js +68 -0
  636. package/dist/hooks/navigation/useAsyncResolver.js.map +1 -0
  637. package/dist/hooks/navigation/useBuildCollectionRegistryController.js +141 -0
  638. package/dist/hooks/navigation/useBuildCollectionRegistryController.js.map +1 -0
  639. package/dist/hooks/navigation/useBuildNavigationStateController.js +77 -0
  640. package/dist/hooks/navigation/useBuildNavigationStateController.js.map +1 -0
  641. package/dist/hooks/navigation/useBuildUrlController.js +57 -0
  642. package/dist/hooks/navigation/useBuildUrlController.js.map +1 -0
  643. package/dist/hooks/navigation/useNavigationResolution.js +177 -0
  644. package/dist/hooks/navigation/useNavigationResolution.js.map +1 -0
  645. package/dist/hooks/navigation/useResolvedCollections.js +56 -0
  646. package/dist/hooks/navigation/useResolvedCollections.js.map +1 -0
  647. package/dist/hooks/navigation/useResolvedViews.js +94 -0
  648. package/dist/hooks/navigation/useResolvedViews.js.map +1 -0
  649. package/dist/hooks/navigation/useTopLevelNavigation.js +162 -0
  650. package/dist/hooks/navigation/useTopLevelNavigation.js.map +1 -0
  651. package/dist/hooks/navigation/utils.js +125 -0
  652. package/dist/hooks/navigation/utils.js.map +1 -0
  653. package/dist/hooks/useAdminContext.js +45 -0
  654. package/dist/hooks/useAdminContext.js.map +1 -0
  655. package/dist/hooks/useBreadcrumbsController.js +17 -0
  656. package/dist/hooks/useBreadcrumbsController.js.map +1 -0
  657. package/dist/hooks/useBuildSideDialogsController.js +96 -0
  658. package/dist/hooks/useBuildSideDialogsController.js.map +1 -0
  659. package/dist/hooks/useBuildSidePanel.js +208 -0
  660. package/dist/hooks/useBuildSidePanel.js.map +1 -0
  661. package/dist/hooks/useChildViewSource.js +41 -0
  662. package/dist/hooks/useChildViewSource.js.map +1 -0
  663. package/dist/hooks/useEntityDisplay.js +136 -0
  664. package/dist/hooks/useEntityDisplay.js.map +1 -0
  665. package/dist/hooks/useEntityDisplayTitle.js +34 -0
  666. package/dist/hooks/useEntityDisplayTitle.js.map +1 -0
  667. package/dist/hooks/useHistory.js +137 -0
  668. package/dist/hooks/useHistory.js.map +1 -0
  669. package/dist/hooks/useRecordActions.d.ts +28 -6
  670. package/dist/hooks/useRecordActions.js +108 -0
  671. package/dist/hooks/useRecordActions.js.map +1 -0
  672. package/dist/hooks/useReferencePaths.d.ts +21 -0
  673. package/dist/hooks/useReferencePaths.js +32 -0
  674. package/dist/hooks/useReferencePaths.js.map +1 -0
  675. package/dist/hooks/useResolvedNavigationFrom.js +83 -0
  676. package/dist/hooks/useResolvedNavigationFrom.js.map +1 -0
  677. package/dist/hooks/useResolvedUsers.js +109 -0
  678. package/dist/hooks/useResolvedUsers.js.map +1 -0
  679. package/dist/hooks/useSelectionDialog.js +53 -0
  680. package/dist/hooks/useSelectionDialog.js.map +1 -0
  681. package/dist/hooks/useSideDialogsController.js +8 -0
  682. package/dist/hooks/useSideDialogsController.js.map +1 -0
  683. package/dist/hooks/useSidePanel.js +15 -0
  684. package/dist/hooks/useSidePanel.js.map +1 -0
  685. package/dist/hooks/useStorageReferenceResolver.d.ts +25 -0
  686. package/dist/hooks/useStorageReferenceResolver.js +49 -0
  687. package/dist/hooks/useStorageReferenceResolver.js.map +1 -0
  688. package/dist/index.d.ts +1 -0
  689. package/dist/index.js +149 -3793
  690. package/dist/preview/PropertyPreview.js +260 -0
  691. package/dist/preview/PropertyPreview.js.map +1 -0
  692. package/dist/preview/compact_text.js +52 -0
  693. package/dist/preview/compact_text.js.map +1 -0
  694. package/dist/preview/components/ArrayEnumPreview.js +24 -0
  695. package/dist/preview/components/ArrayEnumPreview.js.map +1 -0
  696. package/dist/preview/components/BooleanPreview.js +25 -0
  697. package/dist/preview/components/BooleanPreview.js.map +1 -0
  698. package/dist/preview/components/DatePreview.d.ts +3 -2
  699. package/dist/preview/components/DatePreview.js +87 -0
  700. package/dist/preview/components/DatePreview.js.map +1 -0
  701. package/dist/preview/components/EmptyValue.js +13 -0
  702. package/dist/preview/components/EmptyValue.js.map +1 -0
  703. package/dist/preview/components/EnumValuesChip.js +26 -0
  704. package/dist/preview/components/EnumValuesChip.js.map +1 -0
  705. package/dist/preview/components/ImagePreview.d.ts +7 -1
  706. package/dist/preview/components/ImagePreview.js +112 -0
  707. package/dist/preview/components/ImagePreview.js.map +1 -0
  708. package/dist/preview/components/InlineEntityListPreview.js +31 -0
  709. package/dist/preview/components/InlineEntityListPreview.js.map +1 -0
  710. package/dist/preview/components/ReferencePreview.js +162 -0
  711. package/dist/preview/components/ReferencePreview.js.map +1 -0
  712. package/dist/preview/components/RelationPreview.js +196 -0
  713. package/dist/preview/components/RelationPreview.js.map +1 -0
  714. package/dist/preview/components/StorageMarkdown.d.ts +11 -0
  715. package/dist/preview/components/StorageMarkdown.js +49 -0
  716. package/dist/preview/components/StorageMarkdown.js.map +1 -0
  717. package/dist/preview/components/StorageThumbnail.js +183 -0
  718. package/dist/preview/components/StorageThumbnail.js.map +1 -0
  719. package/dist/preview/components/UrlComponentPreview.d.ts +3 -1
  720. package/dist/preview/components/UrlComponentPreview.js +88 -0
  721. package/dist/preview/components/UrlComponentPreview.js.map +1 -0
  722. package/dist/preview/components/UserPreview.js +30 -0
  723. package/dist/preview/components/UserPreview.js.map +1 -0
  724. package/dist/preview/components/date_fns_locales.js +124 -0
  725. package/dist/preview/components/date_fns_locales.js.map +1 -0
  726. package/dist/preview/components/storageRenditions.d.ts +10 -0
  727. package/dist/preview/components/storageRenditions.js +93 -0
  728. package/dist/preview/components/storageRenditions.js.map +1 -0
  729. package/dist/preview/property_previews/ArrayOfMapsPreview.js +44 -0
  730. package/dist/preview/property_previews/ArrayOfMapsPreview.js.map +1 -0
  731. package/dist/preview/property_previews/ArrayOfReferencesPreview.js +48 -0
  732. package/dist/preview/property_previews/ArrayOfReferencesPreview.js.map +1 -0
  733. package/dist/preview/property_previews/ArrayOfRelationsPreview.js +50 -0
  734. package/dist/preview/property_previews/ArrayOfRelationsPreview.js.map +1 -0
  735. package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.js +30 -0
  736. package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.js.map +1 -0
  737. package/dist/preview/property_previews/ArrayOfStringsPreview.js +42 -0
  738. package/dist/preview/property_previews/ArrayOfStringsPreview.js.map +1 -0
  739. package/dist/preview/property_previews/ArrayOneOfPreview.js +47 -0
  740. package/dist/preview/property_previews/ArrayOneOfPreview.js.map +1 -0
  741. package/dist/preview/property_previews/ArrayPropertyEnumPreview.js +25 -0
  742. package/dist/preview/property_previews/ArrayPropertyEnumPreview.js.map +1 -0
  743. package/dist/preview/property_previews/ArrayPropertyPreview.js +48 -0
  744. package/dist/preview/property_previews/ArrayPropertyPreview.js.map +1 -0
  745. package/dist/preview/property_previews/MapPropertyPreview.js +137 -0
  746. package/dist/preview/property_previews/MapPropertyPreview.js.map +1 -0
  747. package/dist/preview/property_previews/NumberPropertyPreview.js +34 -0
  748. package/dist/preview/property_previews/NumberPropertyPreview.js.map +1 -0
  749. package/dist/preview/property_previews/SkeletonPropertyComponent.js +151 -0
  750. package/dist/preview/property_previews/SkeletonPropertyComponent.js.map +1 -0
  751. package/dist/preview/property_previews/StringPropertyPreview.js +49 -0
  752. package/dist/preview/property_previews/StringPropertyPreview.js.map +1 -0
  753. package/dist/preview/util.d.ts +8 -3
  754. package/dist/{util-CC0ozHoD.js → preview/util.js} +13 -6
  755. package/dist/preview/util.js.map +1 -0
  756. package/dist/routes/CustomViewRoute.js +26 -0
  757. package/dist/routes/CustomViewRoute.js.map +1 -0
  758. package/dist/routes/RebaseRoute.js +311 -0
  759. package/dist/routes/RebaseRoute.js.map +1 -0
  760. package/dist/selection/SelectionMenu.js +90 -0
  761. package/dist/selection/SelectionMenu.js.map +1 -0
  762. package/dist/selection/resolve_selection.js +79 -0
  763. package/dist/selection/resolve_selection.js.map +1 -0
  764. package/dist/util/caller_scopes.d.ts +15 -0
  765. package/dist/util/caller_scopes.js +25 -0
  766. package/dist/util/caller_scopes.js.map +1 -0
  767. package/dist/util/collection_open_mode.d.ts +20 -0
  768. package/dist/util/collection_open_mode.js +32 -0
  769. package/dist/util/collection_open_mode.js.map +1 -0
  770. package/dist/util/dataControllerAdapter.js +65 -0
  771. package/dist/util/dataControllerAdapter.js.map +1 -0
  772. package/dist/util/entity_actions.d.ts +42 -1
  773. package/dist/util/entity_actions.js +77 -0
  774. package/dist/util/entity_actions.js.map +1 -0
  775. package/dist/util/entity_pages.d.ts +37 -3
  776. package/dist/util/entity_pages.js +71 -0
  777. package/dist/util/entity_pages.js.map +1 -0
  778. package/dist/util/find_entities_by_ids.d.ts +23 -0
  779. package/dist/util/find_entities_by_ids.js +55 -0
  780. package/dist/util/find_entities_by_ids.js.map +1 -0
  781. package/dist/util/fit_inline_actions.d.ts +20 -0
  782. package/dist/util/fit_inline_actions.js +40 -0
  783. package/dist/util/fit_inline_actions.js.map +1 -0
  784. package/dist/util/format_collection_date.d.ts +29 -0
  785. package/dist/util/format_collection_date.js +60 -0
  786. package/dist/util/format_collection_date.js.map +1 -0
  787. package/dist/util/map_with_concurrency.js +46 -0
  788. package/dist/util/map_with_concurrency.js.map +1 -0
  789. package/dist/util/navigation_utils.js +44 -0
  790. package/dist/util/navigation_utils.js.map +1 -0
  791. package/dist/util/number_format.js +33 -0
  792. package/dist/util/number_format.js.map +1 -0
  793. package/dist/util/previews.js +71 -0
  794. package/dist/util/previews.js.map +1 -0
  795. package/dist/util/propertyConfigMapper.js +83 -0
  796. package/dist/util/propertyConfigMapper.js.map +1 -0
  797. package/dist/util/property_utils.js +141 -0
  798. package/dist/util/property_utils.js.map +1 -0
  799. package/dist/util/resolutions.js +55 -0
  800. package/dist/util/resolutions.js.map +1 -0
  801. package/dist/util/view_constants.js +35 -0
  802. package/dist/util/view_constants.js.map +1 -0
  803. package/dist/util/view_mode.js +112 -0
  804. package/dist/util/view_mode.js.map +1 -0
  805. package/package.json +13 -9
  806. package/dist/CollectionEditorDialog-DLHCka00.js +0 -3630
  807. package/dist/CollectionEditorDialog-DLHCka00.js.map +0 -1
  808. package/dist/JsonPreviewBinding-v0w3H0fp.js.map +0 -1
  809. package/dist/PropertyEditView-_pu5hzZn.js +0 -3837
  810. package/dist/PropertyEditView-_pu5hzZn.js.map +0 -1
  811. package/dist/RouterCollectionsStudioView-ChPNl_uU.js +0 -212
  812. package/dist/RouterCollectionsStudioView-ChPNl_uU.js.map +0 -1
  813. package/dist/SchemaChangeDialog-BeP0A4MJ.js.map +0 -1
  814. package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +0 -13
  815. package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +0 -8
  816. package/dist/collection_editor_ui.js.map +0 -1
  817. package/dist/editor.js.map +0 -1
  818. package/dist/export-4bJWdlDK.js +0 -520
  819. package/dist/export-4bJWdlDK.js.map +0 -1
  820. package/dist/history-BElrZ5Rw.js +0 -313
  821. package/dist/history-BElrZ5Rw.js.map +0 -1
  822. package/dist/import-TCgkTVlS.js.map +0 -1
  823. package/dist/index.js.map +0 -1
  824. package/dist/markdown-CCqp8ibf.js.map +0 -1
  825. package/dist/rolldown-runtime-D7D4PA-g.js +0 -13
  826. package/dist/util-CC0ozHoD.js.map +0 -1
  827. package/dist/util-DybQBkug.js +0 -26390
  828. package/dist/util-DybQBkug.js.map +0 -1
@@ -0,0 +1,60 @@
1
+ import { getDatePropertyMode, getDatePropertyTimezone } from "../preview/util.js";
2
+ import { formatRelativeTime } from "@rebasepro/utils";
3
+ //#region src/util/format_collection_date.ts
4
+ function yearIn(date, timeZone) {
5
+ return new Intl.DateTimeFormat("en-US", {
6
+ year: "numeric",
7
+ timeZone
8
+ }).format(date);
9
+ }
10
+ /**
11
+ * The short date a collection's list, card and board views show: the date
12
+ * slot, and the list view's date columns.
13
+ *
14
+ * It reads the property the way the table cell, the filter and the form do
15
+ * (`getDatePropertyMode` / `getDatePropertyTimezone`):
16
+ * - a `columnType: "date"` value is a calendar day stored as its UTC midnight,
17
+ * so it is shown as that day in UTC, with no time and no relative phrase —
18
+ * in the browser's zone a stored 15th read as the 14th west of Greenwich;
19
+ * - a `columnType: "time"` value is a time of day, shown in UTC;
20
+ * - any other date reads "3h ago" / "in 2d" within a week, else a short date
21
+ * in the property's declared `timezone` (the browser's when none).
22
+ *
23
+ * A slot can also hold a non-date property or a computed value; with no date
24
+ * property the browser's zone is used.
25
+ *
26
+ * Returns `null` for an empty or unreadable value.
27
+ */
28
+ function formatCollectionDate(value, property, options = {}) {
29
+ if (value === void 0 || value === null || value === "") return null;
30
+ let date = null;
31
+ if (value instanceof Date) date = value;
32
+ else if (typeof value === "string" || typeof value === "number") date = new Date(value);
33
+ if (!date || isNaN(date.getTime())) return null;
34
+ const now = options.now ?? /* @__PURE__ */ new Date();
35
+ const dateProperty = property?.type === "date" ? property : void 0;
36
+ const timeZone = dateProperty ? getDatePropertyTimezone(dateProperty) : void 0;
37
+ if (dateProperty?.columnType === "time") return new Intl.DateTimeFormat(options.locale, {
38
+ hour: "2-digit",
39
+ minute: "2-digit",
40
+ timeZone
41
+ }).format(date);
42
+ if (!(dateProperty !== void 0 && getDatePropertyMode(dateProperty) === "date")) {
43
+ const relative = formatRelativeTime(date, {
44
+ now,
45
+ labels: options.relativeTimeLabels
46
+ });
47
+ if (relative) return relative;
48
+ }
49
+ const sameYear = yearIn(date, timeZone) === yearIn(now, timeZone);
50
+ return new Intl.DateTimeFormat(options.locale, {
51
+ month: "short",
52
+ day: "numeric",
53
+ year: sameYear ? void 0 : "numeric",
54
+ timeZone
55
+ }).format(date);
56
+ }
57
+ //#endregion
58
+ export { formatCollectionDate };
59
+
60
+ //# sourceMappingURL=format_collection_date.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format_collection_date.js","names":[],"sources":["../../src/util/format_collection_date.ts"],"sourcesContent":["import type { Property } from \"@rebasepro/types\";\nimport { formatRelativeTime, type RelativeTimeLabels } from \"@rebasepro/utils\";\nimport { getDatePropertyMode, getDatePropertyTimezone } from \"../preview/util\";\n\nexport type FormatCollectionDateOptions = {\n /** The instant relative phrases are measured from. Defaults to now. */\n now?: Date;\n /** BCP 47 locale. Defaults to the browser's. */\n locale?: string;\n /** The relative phrases, in the admin language (`useUiLabels().relativeTime`). English when absent. */\n relativeTimeLabels?: Partial<RelativeTimeLabels>;\n};\n\nfunction yearIn(date: Date, timeZone: string | undefined): string {\n return new Intl.DateTimeFormat(\"en-US\", { year: \"numeric\", timeZone }).format(date);\n}\n\n/**\n * The short date a collection's list, card and board views show: the date\n * slot, and the list view's date columns.\n *\n * It reads the property the way the table cell, the filter and the form do\n * (`getDatePropertyMode` / `getDatePropertyTimezone`):\n * - a `columnType: \"date\"` value is a calendar day stored as its UTC midnight,\n * so it is shown as that day in UTC, with no time and no relative phrase —\n * in the browser's zone a stored 15th read as the 14th west of Greenwich;\n * - a `columnType: \"time\"` value is a time of day, shown in UTC;\n * - any other date reads \"3h ago\" / \"in 2d\" within a week, else a short date\n * in the property's declared `timezone` (the browser's when none).\n *\n * A slot can also hold a non-date property or a computed value; with no date\n * property the browser's zone is used.\n *\n * Returns `null` for an empty or unreadable value.\n */\nexport function formatCollectionDate(\n value: unknown,\n property: Property | undefined,\n options: FormatCollectionDateOptions = {}\n): string | null {\n if (value === undefined || value === null || value === \"\") return null;\n let date: Date | null = null;\n if (value instanceof Date) date = value;\n else if (typeof value === \"string\" || typeof value === \"number\") date = new Date(value);\n if (!date || isNaN(date.getTime())) return null;\n\n const now = options.now ?? new Date();\n const dateProperty = property?.type === \"date\" ? property : undefined;\n const timeZone = dateProperty ? getDatePropertyTimezone(dateProperty) : undefined;\n\n if (dateProperty?.columnType === \"time\") {\n return new Intl.DateTimeFormat(options.locale, { hour: \"2-digit\", minute: \"2-digit\", timeZone }).format(date);\n }\n\n const dayOnly = dateProperty !== undefined && getDatePropertyMode(dateProperty) === \"date\";\n if (!dayOnly) {\n // A date slot holds whatever the collection points it at, as often a\n // due or publish date as an `updated_at`; `formatRelativeTime` reads\n // the sign, so a scheduled date says \"in 3d\".\n const relative = formatRelativeTime(date, { now, labels: options.relativeTimeLabels });\n if (relative) return relative;\n }\n\n // Comparing years rather than counting days: a date six weeks back across a\n // new year needs the year, and one 400 days ahead needs it just as much.\n const sameYear = yearIn(date, timeZone) === yearIn(now, timeZone);\n return new Intl.DateTimeFormat(options.locale, {\n month: \"short\",\n day: \"numeric\",\n year: sameYear ? undefined : \"numeric\",\n timeZone\n }).format(date);\n}\n"],"mappings":";;;AAaA,SAAS,OAAO,MAAY,UAAsC;CAC9D,OAAO,IAAI,KAAK,eAAe,SAAS;EAAE,MAAM;EAAW;CAAS,CAAC,CAAC,CAAC,OAAO,IAAI;AACtF;;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,qBACZ,OACA,UACA,UAAuC,CAAC,GAC3B;CACb,IAAI,UAAU,KAAA,KAAa,UAAU,QAAQ,UAAU,IAAI,OAAO;CAClE,IAAI,OAAoB;CACxB,IAAI,iBAAiB,MAAM,OAAO;MAC7B,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU,OAAO,IAAI,KAAK,KAAK;CACtF,IAAI,CAAC,QAAQ,MAAM,KAAK,QAAQ,CAAC,GAAG,OAAO;CAE3C,MAAM,MAAM,QAAQ,uBAAO,IAAI,KAAK;CACpC,MAAM,eAAe,UAAU,SAAS,SAAS,WAAW,KAAA;CAC5D,MAAM,WAAW,eAAe,wBAAwB,YAAY,IAAI,KAAA;CAExE,IAAI,cAAc,eAAe,QAC7B,OAAO,IAAI,KAAK,eAAe,QAAQ,QAAQ;EAAE,MAAM;EAAW,QAAQ;EAAW;CAAS,CAAC,CAAC,CAAC,OAAO,IAAI;CAIhH,IAAI,EADY,iBAAiB,KAAA,KAAa,oBAAoB,YAAY,MAAM,SACtE;EAIV,MAAM,WAAW,mBAAmB,MAAM;GAAE;GAAK,QAAQ,QAAQ;EAAmB,CAAC;EACrF,IAAI,UAAU,OAAO;CACzB;CAIA,MAAM,WAAW,OAAO,MAAM,QAAQ,MAAM,OAAO,KAAK,QAAQ;CAChE,OAAO,IAAI,KAAK,eAAe,QAAQ,QAAQ;EAC3C,OAAO;EACP,KAAK;EACL,MAAM,WAAW,KAAA,IAAY;EAC7B;CACJ,CAAC,CAAC,CAAC,OAAO,IAAI;AAClB"}
@@ -0,0 +1,46 @@
1
+ //#region src/util/map_with_concurrency.ts
2
+ /**
3
+ * Run `task` over every item, at most `concurrency` at a time, and return the
4
+ * results in the order the items were given.
5
+ *
6
+ * The bulk delete used to be `Promise.all(entities.map(performDelete))`. That is
7
+ * fine for the handful of rows anyone could tick by hand, and it is the reason
8
+ * a "select all matching" over a real collection could not simply be poured
9
+ * into the existing dialog: twelve thousand entries in that array is twelve
10
+ * thousand simultaneous requests, which the browser queues and the server takes
11
+ * as a burst.
12
+ *
13
+ * Rejections are not swallowed and do not cancel: every task is run, and the
14
+ * first rejection is thrown once they have all settled, so a bulk action cannot
15
+ * half-apply and then report the failure as if nothing had happened.
16
+ */
17
+ async function mapWithConcurrency(items, concurrency, task, onSettled) {
18
+ const results = new Array(items.length);
19
+ const limit = Math.max(1, Math.floor(concurrency));
20
+ let next = 0;
21
+ let completed = 0;
22
+ let firstError;
23
+ let failed = false;
24
+ async function worker() {
25
+ for (;;) {
26
+ const index = next++;
27
+ if (index >= items.length) return;
28
+ try {
29
+ results[index] = await task(items[index], index);
30
+ } catch (e) {
31
+ if (!failed) {
32
+ failed = true;
33
+ firstError = e;
34
+ }
35
+ }
36
+ onSettled?.(++completed, items.length);
37
+ }
38
+ }
39
+ await Promise.all(Array.from({ length: Math.min(limit, items.length) }, worker));
40
+ if (failed) throw firstError;
41
+ return results;
42
+ }
43
+ //#endregion
44
+ export { mapWithConcurrency };
45
+
46
+ //# sourceMappingURL=map_with_concurrency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map_with_concurrency.js","names":[],"sources":["../../src/util/map_with_concurrency.ts"],"sourcesContent":["/**\n * Run `task` over every item, at most `concurrency` at a time, and return the\n * results in the order the items were given.\n *\n * The bulk delete used to be `Promise.all(entities.map(performDelete))`. That is\n * fine for the handful of rows anyone could tick by hand, and it is the reason\n * a \"select all matching\" over a real collection could not simply be poured\n * into the existing dialog: twelve thousand entries in that array is twelve\n * thousand simultaneous requests, which the browser queues and the server takes\n * as a burst.\n *\n * Rejections are not swallowed and do not cancel: every task is run, and the\n * first rejection is thrown once they have all settled, so a bulk action cannot\n * half-apply and then report the failure as if nothing had happened.\n */\nexport async function mapWithConcurrency<T, R>(\n items: readonly T[],\n concurrency: number,\n task: (item: T, index: number) => Promise<R>,\n onSettled?: (completed: number, total: number) => void\n): Promise<R[]> {\n\n const results = new Array<R>(items.length);\n const limit = Math.max(1, Math.floor(concurrency));\n let next = 0;\n let completed = 0;\n let firstError: unknown;\n let failed = false;\n\n async function worker(): Promise<void> {\n for (; ;) {\n const index = next++;\n if (index >= items.length) return;\n try {\n results[index] = await task(items[index], index);\n } catch (e) {\n if (!failed) {\n failed = true;\n firstError = e;\n }\n }\n onSettled?.(++completed, items.length);\n }\n }\n\n await Promise.all(Array.from({ length: Math.min(limit, items.length) }, worker));\n\n if (failed) throw firstError;\n return results;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,eAAsB,mBAClB,OACA,aACA,MACA,WACY;CAEZ,MAAM,UAAU,IAAI,MAAS,MAAM,MAAM;CACzC,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,WAAW,CAAC;CACjD,IAAI,OAAO;CACX,IAAI,YAAY;CAChB,IAAI;CACJ,IAAI,SAAS;CAEb,eAAe,SAAwB;EACnC,SAAU;GACN,MAAM,QAAQ;GACd,IAAI,SAAS,MAAM,QAAQ;GAC3B,IAAI;IACA,QAAQ,SAAS,MAAM,KAAK,MAAM,QAAQ,KAAK;GACnD,SAAS,GAAG;IACR,IAAI,CAAC,QAAQ;KACT,SAAS;KACT,aAAa;IACjB;GACJ;GACA,YAAY,EAAE,WAAW,MAAM,MAAM;EACzC;CACJ;CAEA,MAAM,QAAQ,IAAI,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAI,OAAO,MAAM,MAAM,EAAE,GAAG,MAAM,CAAC;CAE/E,IAAI,QAAQ,MAAM;CAClB,OAAO;AACX"}
@@ -0,0 +1,44 @@
1
+ import { withListState } from "./view_mode.js";
2
+ import { addInitialSlash, getCollectionBySlugWithin, getCollectionPathsCombinations, getLastSegment as getLastSegment$1, removeInitialAndTrailingSlashes as removeInitialAndTrailingSlashes$1, removeInitialSlash, removeTrailingSlash as removeTrailingSlash$1, resolveCollectionPathIds as resolveCollectionPathIds$1 } from "@rebasepro/app";
3
+ //#region src/util/navigation_utils.ts
4
+ /**
5
+ * Navigate to a entity using either a side panel or full-screen mode.
6
+ * This is an admin-specific UI concern and lives here (not in common).
7
+ */
8
+ function navigateToEntity({ openEntityMode, collection, entityId, copy, path, selectedTab, defaultValues, sidePanelController, onClose, onUpdate, navigation, replace }) {
9
+ if (openEntityMode === "side_panel" || openEntityMode === "dialog") sidePanelController.open({
10
+ entityId,
11
+ path,
12
+ copy,
13
+ selectedTab,
14
+ collection,
15
+ updateUrl: openEntityMode !== "dialog",
16
+ onClose,
17
+ onUpdate,
18
+ defaultValues
19
+ });
20
+ else {
21
+ let to = navigation.buildUrlCollectionPath(entityId ? `${path ?? path}/${entityId}` : path ?? path);
22
+ if (entityId && selectedTab) to += `/${selectedTab}`;
23
+ to = withListState(to);
24
+ if (!entityId) to += "#new";
25
+ if (copy) to += "#copy";
26
+ const navigateOptions = {};
27
+ if (replace !== void 0) navigateOptions.replace = replace;
28
+ if (defaultValues) navigateOptions.state = { defaultValues };
29
+ const hasOptions = Object.keys(navigateOptions).length > 0;
30
+ navigation.navigate(to, hasOptions ? navigateOptions : void 0);
31
+ }
32
+ }
33
+ /**
34
+ * Whether `pathname` is the record at `entityPath` or somewhere below it — one
35
+ * of its tabs, its `/edit`. A path segment, not a string prefix:
36
+ * `/c/products/12` is another record, not a place inside `/c/products/1`.
37
+ */
38
+ function isPathWithinRecord(pathname, entityPath) {
39
+ return pathname === entityPath || pathname.startsWith(`${entityPath}/`);
40
+ }
41
+ //#endregion
42
+ export { addInitialSlash, getCollectionBySlugWithin, getCollectionPathsCombinations, getLastSegment$1 as getLastSegment, isPathWithinRecord, navigateToEntity, removeInitialAndTrailingSlashes$1 as removeInitialAndTrailingSlashes, removeInitialSlash, removeTrailingSlash$1 as removeTrailingSlash, resolveCollectionPathIds$1 as resolveCollectionPathIds };
43
+
44
+ //# sourceMappingURL=navigation_utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation_utils.js","names":[],"sources":["../../src/util/navigation_utils.ts"],"sourcesContent":["\nimport type { UrlController, SidePanelBindingProps, SidePanelController, NavigateOptions, AdminCollection } from \"@rebasepro/cms-types\";\nimport { withListState } from \"./view_mode\";\n\n// Canonical path utilities — single source of truth in @rebasepro/common\nexport { removeInitialAndTrailingSlashes, removeInitialSlash, removeTrailingSlash, addInitialSlash, getLastSegment, resolveCollectionPathIds, getCollectionBySlugWithin, getCollectionPathsCombinations } from \"@rebasepro/app\";\n\n/**\n * Navigate to a entity using either a side panel or full-screen mode.\n * This is an admin-specific UI concern and lives here (not in common).\n */\nexport function navigateToEntity({\n openEntityMode,\n collection,\n entityId,\n copy,\n path,\n selectedTab,\n defaultValues,\n sidePanelController,\n onClose,\n onUpdate,\n navigation,\n replace\n}:\n\n {\n openEntityMode?: \"side_panel\" | \"full_screen\" | \"split\" | \"dialog\";\n collection?: AdminCollection;\n entityId?: string | number;\n selectedTab?: string;\n copy?: boolean;\n /**\n * Pre-populate the new entity form with these values.\n * Only applied when entityId is not set (i.e. \"new\" mode).\n *\n * Side panel: passed through SidePanelBindingProps → EditViewBinding.\n * Full screen: carried via React Router location.state so the route\n * component can read it on mount without polluting the URL.\n */\n defaultValues?: Record<string, unknown>;\n path: string;\n sidePanelController: SidePanelController;\n onClose?: () => void;\n /**\n * Called when the side panel or dialog saves the record. A full-screen\n * record replaces the view that opened it, and that view reads\n * everything again when it comes back, so nothing is called there.\n */\n onUpdate?: SidePanelBindingProps[\"onUpdate\"];\n navigation: UrlController;\n replace?: boolean;\n }) {\n\n if (openEntityMode === \"side_panel\" || openEntityMode === \"dialog\") {\n\n sidePanelController.open({\n entityId,\n path: path,\n copy,\n selectedTab,\n collection,\n updateUrl: openEntityMode !== \"dialog\",\n onClose,\n onUpdate,\n defaultValues\n });\n\n } else {\n let to = navigation.buildUrlCollectionPath(entityId ? `${path ?? path}/${entityId}` : path ?? path);\n if (entityId && selectedTab) {\n to += `/${selectedTab}`;\n }\n // The whole list state, not just the view mode: a record opened from a\n // search must come back to that search.\n to = withListState(to);\n if (!entityId) {\n to += \"#new\";\n }\n if (copy) {\n to += \"#copy\";\n }\n // Use React Router location.state to carry defaultValues — the correct SPA\n // approach. No URL size limits, no encoding, nothing in the address bar.\n // EntityFullScreenRoute reads location.state.defaultValues on mount.\n const navigateOptions: NavigateOptions = {};\n if (replace !== undefined) {\n navigateOptions.replace = replace;\n }\n if (defaultValues) {\n navigateOptions.state = { defaultValues };\n }\n const hasOptions = Object.keys(navigateOptions).length > 0;\n navigation.navigate(to, hasOptions ? navigateOptions : undefined);\n }\n\n}\n\n/**\n * Whether `pathname` is the record at `entityPath` or somewhere below it — one\n * of its tabs, its `/edit`. A path segment, not a string prefix:\n * `/c/products/12` is another record, not a place inside `/c/products/1`.\n */\nexport function isPathWithinRecord(pathname: string, entityPath: string): boolean {\n return pathname === entityPath || pathname.startsWith(`${entityPath}/`);\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,iBAAiB,EAC7B,gBACA,YACA,UACA,MACA,MACA,aACA,eACA,qBACA,SACA,UACA,YACA,WA6BG;CAEH,IAAI,mBAAmB,gBAAgB,mBAAmB,UAEtD,oBAAoB,KAAK;EACrB;EACM;EACN;EACA;EACA;EACA,WAAW,mBAAmB;EAC9B;EACA;EACA;CACJ,CAAC;MAEE;EACH,IAAI,KAAK,WAAW,uBAAuB,WAAW,GAAG,QAAQ,KAAK,GAAG,aAAa,QAAQ,IAAI;EAClG,IAAI,YAAY,aACZ,MAAM,IAAI;EAId,KAAK,cAAc,EAAE;EACrB,IAAI,CAAC,UACD,MAAM;EAEV,IAAI,MACA,MAAM;EAKV,MAAM,kBAAmC,CAAC;EAC1C,IAAI,YAAY,KAAA,GACZ,gBAAgB,UAAU;EAE9B,IAAI,eACA,gBAAgB,QAAQ,EAAE,cAAc;EAE5C,MAAM,aAAa,OAAO,KAAK,eAAe,CAAC,CAAC,SAAS;EACzD,WAAW,SAAS,IAAI,aAAa,kBAAkB,KAAA,CAAS;CACpE;AAEJ;;;;;;AAOA,SAAgB,mBAAmB,UAAkB,YAA6B;CAC9E,OAAO,aAAa,cAAc,SAAS,WAAW,GAAG,WAAW,EAAE;AAC1E"}
@@ -0,0 +1,33 @@
1
+ //#region src/util/number_format.ts
2
+ /**
3
+ * Write a number out for reading, per a property's declared `admin.format`.
4
+ *
5
+ * Nothing is inferred here. With no options the number is returned as it came
6
+ * out of the database — `String(value)`, not a locale-grouped rendering — so a
7
+ * panel that declares nothing shows exactly the stored value, and an author who
8
+ * wants thousands separators asks for them.
9
+ *
10
+ * `Intl.NumberFormat` throws on a bad currency code or an out-of-range fraction
11
+ * count, and a record must not blank because one property is misconfigured, so a
12
+ * failure falls back to the raw value.
13
+ */
14
+ function formatNumber(value, options, fallbackLocale) {
15
+ if (!options) return String(value);
16
+ const style = options.style ?? (options.currency ? "currency" : "decimal");
17
+ if (style === "currency" && !options.currency) return String(value);
18
+ try {
19
+ return new Intl.NumberFormat(options.locale ?? fallbackLocale ?? void 0, {
20
+ style,
21
+ currency: options.currency,
22
+ minimumFractionDigits: options.minimumFractionDigits,
23
+ maximumFractionDigits: options.maximumFractionDigits,
24
+ notation: options.notation
25
+ }).format(value);
26
+ } catch {
27
+ return String(value);
28
+ }
29
+ }
30
+ //#endregion
31
+ export { formatNumber };
32
+
33
+ //# sourceMappingURL=number_format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number_format.js","names":[],"sources":["../../src/util/number_format.ts"],"sourcesContent":["import type { NumberFormatOptions } from \"@rebasepro/cms-types\";\n\n/**\n * Write a number out for reading, per a property's declared `admin.format`.\n *\n * Nothing is inferred here. With no options the number is returned as it came\n * out of the database — `String(value)`, not a locale-grouped rendering — so a\n * panel that declares nothing shows exactly the stored value, and an author who\n * wants thousands separators asks for them.\n *\n * `Intl.NumberFormat` throws on a bad currency code or an out-of-range fraction\n * count, and a record must not blank because one property is misconfigured, so a\n * failure falls back to the raw value.\n */\nexport function formatNumber(\n value: number,\n options: NumberFormatOptions | undefined,\n fallbackLocale?: string\n): string {\n\n if (!options) return String(value);\n\n // A currency code is the whole declaration in the common case: writing\n // `{ currency: \"EUR\" }` and getting a bare `185.11` because `style` was\n // omitted is a trap, and there is nothing else `currency` could mean.\n const style = options.style ?? (options.currency ? \"currency\" : \"decimal\");\n\n if (style === \"currency\" && !options.currency) {\n // `Intl` throws on this rather than picking a currency, which is the\n // right call — there is no sensible default — but the record still has\n // to render.\n return String(value);\n }\n\n try {\n return new Intl.NumberFormat(options.locale ?? fallbackLocale ?? undefined, {\n style,\n currency: options.currency,\n minimumFractionDigits: options.minimumFractionDigits,\n maximumFractionDigits: options.maximumFractionDigits,\n notation: options.notation\n }).format(value);\n } catch {\n return String(value);\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAcA,SAAgB,aACZ,OACA,SACA,gBACM;CAEN,IAAI,CAAC,SAAS,OAAO,OAAO,KAAK;CAKjC,MAAM,QAAQ,QAAQ,UAAU,QAAQ,WAAW,aAAa;CAEhE,IAAI,UAAU,cAAc,CAAC,QAAQ,UAIjC,OAAO,OAAO,KAAK;CAGvB,IAAI;EACA,OAAO,IAAI,KAAK,aAAa,QAAQ,UAAU,kBAAkB,KAAA,GAAW;GACxE;GACA,UAAU,QAAQ;GAClB,uBAAuB,QAAQ;GAC/B,uBAAuB,QAAQ;GAC/B,UAAU,QAAQ;EACtB,CAAC,CAAC,CAAC,OAAO,KAAK;CACnB,QAAQ;EACJ,OAAO,OAAO,KAAK;CACvB;AACJ"}
@@ -0,0 +1,71 @@
1
+ import { isPropertyBuilder } from "@rebasepro/common";
2
+ import { getEntityPreviewKeys, getTitlePropertyKey, getTitlePropertyKeyForValues } from "@rebasepro/app";
3
+ //#region src/util/previews.ts
4
+ /**
5
+ * The property that fills the title slot for a collection.
6
+ *
7
+ * Ranking lives in `@rebasepro/common` so every surface (list rows, cards,
8
+ * board cards, detail header, relation chips) agrees on what an entity is
9
+ * called. Identifiers are excluded from the property *schema* — primary keys,
10
+ * foreign keys, UUID columns — not from the key name.
11
+ */
12
+ function getEntityTitlePropertyKey(collection) {
13
+ return getTitlePropertyKey(collection);
14
+ }
15
+ /**
16
+ * Same as {@link getEntityTitlePropertyKey}, but skips candidates that carry
17
+ * no readable value for this particular entity (empty, or an opaque id).
18
+ */
19
+ function getEntityTitlePropertyKeyForEntity(collection, values, entityId) {
20
+ return getTitlePropertyKeyForValues(collection, values, entityId);
21
+ }
22
+ /**
23
+ * True when a property key points at a user picker, whose stored value is an
24
+ * auth user id that has to be resolved before it can be displayed.
25
+ */
26
+ function isUserSelectProperty(collection, propertyKey) {
27
+ if (!propertyKey) return false;
28
+ const property = collection.properties[propertyKey];
29
+ if (!property || isPropertyBuilder(property)) return false;
30
+ const prop = property;
31
+ return prop.type === "string" && Boolean(prop.userSelect);
32
+ }
33
+ /**
34
+ * Attempt to turn a title value (which might be a relation, reference, date, array, or other complex object)
35
+ * into a renderable, human-readable string.
36
+ */
37
+ function resolveTitleToString(title) {
38
+ if (title === null || title === void 0) return "";
39
+ if (typeof title !== "object") return String(title);
40
+ if ("__type" in title && title.__type === "relation") {
41
+ if (title.data && title.data.values) {
42
+ const values = title.data.values;
43
+ for (const key of [
44
+ "name",
45
+ "title",
46
+ "label",
47
+ "displayName"
48
+ ]) if (values[key] !== void 0 && values[key] !== null) return String(values[key]);
49
+ for (const val of Object.values(values)) if (typeof val === "string" && val.length > 0 && val.length < 200) return val;
50
+ }
51
+ if (title.id !== void 0 && title.id !== null) return String(title.id);
52
+ }
53
+ if ("isEntityReference" in title && typeof title.isEntityReference === "function" && title.isEntityReference()) return String(title.id);
54
+ if ("id" in title && "path" in title && !("__type" in title)) return String(title.id);
55
+ if (title instanceof Date) return title.toLocaleDateString();
56
+ if ("name" in title && title.name !== void 0 && title.name !== null && typeof title.name !== "object") return String(title.name);
57
+ if ("title" in title && title.title !== void 0 && title.title !== null && typeof title.title !== "object") return String(title.title);
58
+ if ("label" in title && title.label !== void 0 && title.label !== null && typeof title.label !== "object") return String(title.label);
59
+ if ("id" in title && title.id !== void 0 && title.id !== null && typeof title.id !== "object") return String(title.id);
60
+ try {
61
+ const str = String(title);
62
+ if (str !== "[object Object]") return str;
63
+ return JSON.stringify(title);
64
+ } catch {
65
+ return "";
66
+ }
67
+ }
68
+ //#endregion
69
+ export { getEntityPreviewKeys, getEntityTitlePropertyKey, getEntityTitlePropertyKeyForEntity, isUserSelectProperty, resolveTitleToString };
70
+
71
+ //# sourceMappingURL=previews.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"previews.js","names":[],"sources":["../../src/util/previews.ts"],"sourcesContent":["import type { Property } from \"@rebasepro/types\";\nimport type { AdminCollection } from \"@rebasepro/cms-types\";\nimport { getTitlePropertyKey, getTitlePropertyKeyForValues } from \"@rebasepro/app\";\nimport { isPropertyBuilder } from \"@rebasepro/common\";\n\n/**\n * Which properties fill a preview surface, best first.\n *\n * The implementation lives in `@rebasepro/app` so that the admin package and\n * the app package cannot disagree about what a record looks like in a card —\n * they had drifted, and only one of the two copies had learned to keep\n * relations out of the list.\n */\nexport { getEntityPreviewKeys } from \"@rebasepro/app\";\n\n/**\n * The property that fills the title slot for a collection.\n *\n * Ranking lives in `@rebasepro/common` so every surface (list rows, cards,\n * board cards, detail header, relation chips) agrees on what an entity is\n * called. Identifiers are excluded from the property *schema* — primary keys,\n * foreign keys, UUID columns — not from the key name.\n */\nexport function getEntityTitlePropertyKey<M extends Record<string, unknown>>(\n collection: AdminCollection<M>\n): string | undefined {\n return getTitlePropertyKey(collection);\n}\n\n/**\n * Same as {@link getEntityTitlePropertyKey}, but skips candidates that carry\n * no readable value for this particular entity (empty, or an opaque id).\n */\nexport function getEntityTitlePropertyKeyForEntity<M extends Record<string, unknown>>(\n collection: AdminCollection<M>,\n values: Record<string, unknown> | undefined,\n entityId?: string | number\n): string | undefined {\n return getTitlePropertyKeyForValues(collection, values, entityId);\n}\n\n/**\n * True when a property key points at a user picker, whose stored value is an\n * auth user id that has to be resolved before it can be displayed.\n */\nexport function isUserSelectProperty<M extends Record<string, unknown>>(\n collection: AdminCollection<M>,\n propertyKey: string | undefined\n): boolean {\n if (!propertyKey) return false;\n const property = collection.properties[propertyKey];\n if (!property || isPropertyBuilder(property)) return false;\n const prop = property as Property;\n return prop.type === \"string\" && Boolean(prop.userSelect);\n}\n\n/**\n * Attempt to turn a title value (which might be a relation, reference, date, array, or other complex object)\n * into a renderable, human-readable string.\n */\nexport function resolveTitleToString(title: any): string {\n if (title === null || title === undefined) {\n return \"\";\n }\n\n if (typeof title !== \"object\") {\n return String(title);\n }\n\n // Check if it's a relation shape: { __type: \"relation\", id, path, data }\n if (\"__type\" in title && title.__type === \"relation\") {\n if (title.data && title.data.values) {\n const values = title.data.values;\n // Prioritize common title fields in eagerly loaded relation data\n for (const key of [\"name\", \"title\", \"label\", \"displayName\"]) {\n if (values[key] !== undefined && values[key] !== null) {\n return String(values[key]);\n }\n }\n // Fallback: search for first short string value in values\n for (const val of Object.values(values)) {\n if (typeof val === \"string\" && val.length > 0 && val.length < 200) {\n return val;\n }\n }\n }\n if (title.id !== undefined && title.id !== null) {\n return String(title.id);\n }\n }\n\n // Check if it's a reference shape: { isEntityReference() } or similar\n if (\"isEntityReference\" in title && typeof title.isEntityReference === \"function\" && title.isEntityReference()) {\n return String(title.id);\n }\n if (\"id\" in title && \"path\" in title && !(\"__type\" in title)) {\n // Flat reference/relation-like object\n return String(title.id);\n }\n\n // Check if it's a Date\n if (title instanceof Date) {\n return title.toLocaleDateString();\n }\n\n // Check if it has a string/number property like name/title/label/id\n if (\"name\" in title && title.name !== undefined && title.name !== null && typeof title.name !== \"object\") {\n return String(title.name);\n }\n if (\"title\" in title && title.title !== undefined && title.title !== null && typeof title.title !== \"object\") {\n return String(title.title);\n }\n if (\"label\" in title && title.label !== undefined && title.label !== null && typeof title.label !== \"object\") {\n return String(title.label);\n }\n if (\"id\" in title && title.id !== undefined && title.id !== null && typeof title.id !== \"object\") {\n return String(title.id);\n }\n\n // Fallback: try converting to string, or JSON.stringify if it looks like a generic object\n try {\n const str = String(title);\n if (str !== \"[object Object]\") {\n return str;\n }\n return JSON.stringify(title);\n } catch {\n return \"\";\n }\n}\n\n"],"mappings":";;;;;;;;;;;AAuBA,SAAgB,0BACZ,YACkB;CAClB,OAAO,oBAAoB,UAAU;AACzC;;;;;AAMA,SAAgB,mCACZ,YACA,QACA,UACkB;CAClB,OAAO,6BAA6B,YAAY,QAAQ,QAAQ;AACpE;;;;;AAMA,SAAgB,qBACZ,YACA,aACO;CACP,IAAI,CAAC,aAAa,OAAO;CACzB,MAAM,WAAW,WAAW,WAAW;CACvC,IAAI,CAAC,YAAY,kBAAkB,QAAQ,GAAG,OAAO;CACrD,MAAM,OAAO;CACb,OAAO,KAAK,SAAS,YAAY,QAAQ,KAAK,UAAU;AAC5D;;;;;AAMA,SAAgB,qBAAqB,OAAoB;CACrD,IAAI,UAAU,QAAQ,UAAU,KAAA,GAC5B,OAAO;CAGX,IAAI,OAAO,UAAU,UACjB,OAAO,OAAO,KAAK;CAIvB,IAAI,YAAY,SAAS,MAAM,WAAW,YAAY;EAClD,IAAI,MAAM,QAAQ,MAAM,KAAK,QAAQ;GACjC,MAAM,SAAS,MAAM,KAAK;GAE1B,KAAK,MAAM,OAAO;IAAC;IAAQ;IAAS;IAAS;GAAa,GACtD,IAAI,OAAO,SAAS,KAAA,KAAa,OAAO,SAAS,MAC7C,OAAO,OAAO,OAAO,IAAI;GAIjC,KAAK,MAAM,OAAO,OAAO,OAAO,MAAM,GAClC,IAAI,OAAO,QAAQ,YAAY,IAAI,SAAS,KAAK,IAAI,SAAS,KAC1D,OAAO;EAGnB;EACA,IAAI,MAAM,OAAO,KAAA,KAAa,MAAM,OAAO,MACvC,OAAO,OAAO,MAAM,EAAE;CAE9B;CAGA,IAAI,uBAAuB,SAAS,OAAO,MAAM,sBAAsB,cAAc,MAAM,kBAAkB,GACzG,OAAO,OAAO,MAAM,EAAE;CAE1B,IAAI,QAAQ,SAAS,UAAU,SAAS,EAAE,YAAY,QAElD,OAAO,OAAO,MAAM,EAAE;CAI1B,IAAI,iBAAiB,MACjB,OAAO,MAAM,mBAAmB;CAIpC,IAAI,UAAU,SAAS,MAAM,SAAS,KAAA,KAAa,MAAM,SAAS,QAAQ,OAAO,MAAM,SAAS,UAC5F,OAAO,OAAO,MAAM,IAAI;CAE5B,IAAI,WAAW,SAAS,MAAM,UAAU,KAAA,KAAa,MAAM,UAAU,QAAQ,OAAO,MAAM,UAAU,UAChG,OAAO,OAAO,MAAM,KAAK;CAE7B,IAAI,WAAW,SAAS,MAAM,UAAU,KAAA,KAAa,MAAM,UAAU,QAAQ,OAAO,MAAM,UAAU,UAChG,OAAO,OAAO,MAAM,KAAK;CAE7B,IAAI,QAAQ,SAAS,MAAM,OAAO,KAAA,KAAa,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,UACpF,OAAO,OAAO,MAAM,EAAE;CAI1B,IAAI;EACA,MAAM,MAAM,OAAO,KAAK;EACxB,IAAI,QAAQ,mBACR,OAAO;EAEX,OAAO,KAAK,UAAU,KAAK;CAC/B,QAAQ;EACJ,OAAO;CACX;AACJ"}
@@ -0,0 +1,83 @@
1
+ import { prettifyIdentifier } from "@rebasepro/utils";
2
+ //#region src/util/propertyConfigMapper.ts
3
+ /**
4
+ * Map Rebase property types to headless-supported types.
5
+ * `vector` and `binary` are not directly renderable, so we fall back to `string`.
6
+ */
7
+ var TYPE_MAP = {
8
+ string: "string",
9
+ number: "number",
10
+ boolean: "boolean",
11
+ date: "date",
12
+ geopoint: "geopoint",
13
+ reference: "reference",
14
+ relation: "relation",
15
+ array: "array",
16
+ map: "map",
17
+ vector: "string",
18
+ binary: "string"
19
+ };
20
+ /**
21
+ * Convert a single Property to a CollectionPropertyConfig.
22
+ */
23
+ function mapPropertyToConfig(property, key) {
24
+ const base = {
25
+ type: TYPE_MAP[property.type] ?? "string",
26
+ name: property.name ?? (key ? prettifyIdentifier(key) : ""),
27
+ description: property.description,
28
+ columnWidth: property.admin?.columnWidth,
29
+ hideFromCollection: property.admin?.hideFromCollection
30
+ };
31
+ if (property.type === "string") {
32
+ if (property.enum) base.enum = mapEnumValues(property.enum);
33
+ if (property.admin?.multiline) base.multiline = true;
34
+ if (property.admin?.previewAsTag) base.previewAsTag = true;
35
+ if (property.admin?.urlPreview) base.url = property.admin.urlPreview;
36
+ if (property.admin?.markdown) base.markdown = true;
37
+ if (property.storage) base.storage = true;
38
+ if (property.email) base.email = true;
39
+ }
40
+ if (property.type === "number" && property.enum) base.enum = mapEnumValues(property.enum);
41
+ if (property.type === "array" && property.of && !Array.isArray(property.of)) base.of = mapPropertyToConfig(property.of, key);
42
+ if (property.type === "map" && property.properties) {
43
+ base.properties = mapPropertiesToConfigs(property.properties);
44
+ if (property.propertiesOrder) base.propertiesOrder = property.propertiesOrder;
45
+ }
46
+ if (property.type === "date" && property.mode) base.mode = property.mode;
47
+ if (property.admin?.Preview) {}
48
+ return base;
49
+ }
50
+ /**
51
+ * Convert a Properties record to a CollectionPropertyConfig record.
52
+ */
53
+ function mapPropertiesToConfigs(properties) {
54
+ const result = {};
55
+ for (const [key, property] of Object.entries(properties)) result[key] = mapPropertyToConfig(property, key);
56
+ return result;
57
+ }
58
+ /**
59
+ * Convert Rebase EnumValues to CollectionEnumValueConfig format.
60
+ * Handles both array form (EnumValueConfig[]) and record form.
61
+ */
62
+ function mapEnumValues(enumValues) {
63
+ if (!enumValues) return void 0;
64
+ if (Array.isArray(enumValues)) {
65
+ const result = {};
66
+ for (const item of enumValues) result[String(item.id)] = normalizeEnumValueConfig(item);
67
+ return result;
68
+ }
69
+ const result = {};
70
+ for (const [key, value] of Object.entries(enumValues)) result[key] = typeof value === "string" ? value : normalizeEnumValueConfig(value);
71
+ return result;
72
+ }
73
+ function normalizeEnumValueConfig(config) {
74
+ return {
75
+ label: config.label,
76
+ color: typeof config.color === "string" ? config.color : void 0,
77
+ disabled: config.disabled
78
+ };
79
+ }
80
+ //#endregion
81
+ export { mapPropertiesToConfigs, mapPropertyToConfig };
82
+
83
+ //# sourceMappingURL=propertyConfigMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propertyConfigMapper.js","names":[],"sources":["../../src/util/propertyConfigMapper.ts"],"sourcesContent":["/**\n * Maps a Rebase `Property` (from @rebasepro/types) to a `CollectionPropertyConfig`\n * (from @rebasepro/ui), stripping all entity-specific fields and keeping only\n * the UI-relevant subset.\n *\n * This is the bridge between the entity-aware and headless layers.\n */\n\nimport type { Property, Properties, EnumValues, EnumValueConfig } from \"@rebasepro/types\";\nimport type { CollectionPropertyConfig, CollectionEnumValueConfig } from \"@rebasepro/ui\";\nimport { prettifyIdentifier } from \"@rebasepro/utils\";\n\n/**\n * Map Rebase property types to headless-supported types.\n * `vector` and `binary` are not directly renderable, so we fall back to `string`.\n */\nconst TYPE_MAP: Record<string, CollectionPropertyConfig[\"type\"]> = {\n string: \"string\",\n number: \"number\",\n boolean: \"boolean\",\n date: \"date\",\n geopoint: \"geopoint\",\n reference: \"reference\",\n relation: \"relation\",\n array: \"array\",\n map: \"map\",\n vector: \"string\", // vectors display as text\n binary: \"string\", // binary displays as text\n};\n\n/**\n * Convert a single Property to a CollectionPropertyConfig.\n */\nexport function mapPropertyToConfig(property: Property, key?: string): CollectionPropertyConfig {\n const base: CollectionPropertyConfig = {\n type: TYPE_MAP[property.type] ?? \"string\",\n // A column header has to say something, and `name` is optional on the\n // property — a headless project has no UI and no reason to invent\n // labels. Falling back to the key is what the collection editor already\n // does when it suggests a name, so a derived label reads the same\n // wherever it appears: `publishDate` -> \"Publish Date\".\n name: property.name ?? (key ? prettifyIdentifier(key) : \"\"),\n description: property.description,\n columnWidth: property.admin?.columnWidth,\n hideFromCollection: property.admin?.hideFromCollection,\n };\n\n // String-specific\n if (property.type === \"string\") {\n if (property.enum) {\n base.enum = mapEnumValues(property.enum);\n }\n if (property.admin?.multiline) base.multiline = true;\n if (property.admin?.previewAsTag) base.previewAsTag = true;\n if (property.admin?.urlPreview) base.url = property.admin.urlPreview;\n if (property.admin?.markdown) base.markdown = true;\n if (property.storage) base.storage = true;\n if (property.email) base.email = true;\n }\n\n // Number-specific\n if (property.type === \"number\" && property.enum) {\n base.enum = mapEnumValues(property.enum);\n }\n\n // Array-specific\n if (property.type === \"array\" && property.of && !Array.isArray(property.of)) {\n base.of = mapPropertyToConfig(property.of, key);\n }\n\n // Map-specific\n if (property.type === \"map\" && property.properties) {\n base.properties = mapPropertiesToConfigs(property.properties);\n if (property.propertiesOrder) {\n base.propertiesOrder = property.propertiesOrder;\n }\n }\n\n // Date-specific\n if (property.type === \"date\" && property.mode) {\n base.mode = property.mode;\n }\n\n // Custom preview component\n if (property.admin?.Preview) {\n // The connected wrapper will handle this by injecting via cellRenderer override\n // We don't copy it here because Preview may reference entity-aware components\n }\n\n return base;\n}\n\n/**\n * Convert a Properties record to a CollectionPropertyConfig record.\n */\nexport function mapPropertiesToConfigs(\n properties: Properties\n): Record<string, CollectionPropertyConfig> {\n const result: Record<string, CollectionPropertyConfig> = {};\n for (const [key, property] of Object.entries(properties)) {\n result[key] = mapPropertyToConfig(property, key);\n }\n return result;\n}\n\n/**\n * Convert Rebase EnumValues to CollectionEnumValueConfig format.\n * Handles both array form (EnumValueConfig[]) and record form.\n */\nfunction mapEnumValues(\n enumValues: EnumValues | undefined\n): Record<string, CollectionEnumValueConfig> | Map<string | number, CollectionEnumValueConfig> | undefined {\n if (!enumValues) return undefined;\n\n // Array form: EnumValueConfig[]\n if (Array.isArray(enumValues)) {\n const result: Record<string, CollectionEnumValueConfig> = {};\n for (const item of enumValues) {\n result[String(item.id)] = normalizeEnumValueConfig(item);\n }\n return result;\n }\n\n // Record form: Record<string | number, string | EnumValueConfig>\n const result: Record<string, CollectionEnumValueConfig> = {};\n for (const [key, value] of Object.entries(enumValues)) {\n result[key] = typeof value === \"string\"\n ? value\n : normalizeEnumValueConfig(value);\n }\n return result;\n}\n\nfunction normalizeEnumValueConfig(config: EnumValueConfig): CollectionEnumValueConfig {\n return {\n label: config.label,\n color: typeof config.color === \"string\" ? config.color : undefined,\n disabled: config.disabled,\n };\n}\n"],"mappings":";;;;;;AAgBA,IAAM,WAA6D;CAC/D,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,MAAM;CACN,UAAU;CACV,WAAW;CACX,UAAU;CACV,OAAO;CACP,KAAK;CACL,QAAQ;CACR,QAAQ;AACZ;;;;AAKA,SAAgB,oBAAoB,UAAoB,KAAwC;CAC5F,MAAM,OAAiC;EACnC,MAAM,SAAS,SAAS,SAAS;EAMjC,MAAM,SAAS,SAAS,MAAM,mBAAmB,GAAG,IAAI;EACxD,aAAa,SAAS;EACtB,aAAa,SAAS,OAAO;EAC7B,oBAAoB,SAAS,OAAO;CACxC;CAGA,IAAI,SAAS,SAAS,UAAU;EAC5B,IAAI,SAAS,MACT,KAAK,OAAO,cAAc,SAAS,IAAI;EAE3C,IAAI,SAAS,OAAO,WAAW,KAAK,YAAY;EAChD,IAAI,SAAS,OAAO,cAAc,KAAK,eAAe;EACtD,IAAI,SAAS,OAAO,YAAY,KAAK,MAAM,SAAS,MAAM;EAC1D,IAAI,SAAS,OAAO,UAAU,KAAK,WAAW;EAC9C,IAAI,SAAS,SAAS,KAAK,UAAU;EACrC,IAAI,SAAS,OAAO,KAAK,QAAQ;CACrC;CAGA,IAAI,SAAS,SAAS,YAAY,SAAS,MACvC,KAAK,OAAO,cAAc,SAAS,IAAI;CAI3C,IAAI,SAAS,SAAS,WAAW,SAAS,MAAM,CAAC,MAAM,QAAQ,SAAS,EAAE,GACtE,KAAK,KAAK,oBAAoB,SAAS,IAAI,GAAG;CAIlD,IAAI,SAAS,SAAS,SAAS,SAAS,YAAY;EAChD,KAAK,aAAa,uBAAuB,SAAS,UAAU;EAC5D,IAAI,SAAS,iBACT,KAAK,kBAAkB,SAAS;CAExC;CAGA,IAAI,SAAS,SAAS,UAAU,SAAS,MACrC,KAAK,OAAO,SAAS;CAIzB,IAAI,SAAS,OAAO,SAAS,CAG7B;CAEA,OAAO;AACX;;;;AAKA,SAAgB,uBACZ,YACwC;CACxC,MAAM,SAAmD,CAAC;CAC1D,KAAK,MAAM,CAAC,KAAK,aAAa,OAAO,QAAQ,UAAU,GACnD,OAAO,OAAO,oBAAoB,UAAU,GAAG;CAEnD,OAAO;AACX;;;;;AAMA,SAAS,cACL,YACuG;CACvG,IAAI,CAAC,YAAY,OAAO,KAAA;CAGxB,IAAI,MAAM,QAAQ,UAAU,GAAG;EAC3B,MAAM,SAAoD,CAAC;EAC3D,KAAK,MAAM,QAAQ,YACf,OAAO,OAAO,KAAK,EAAE,KAAK,yBAAyB,IAAI;EAE3D,OAAO;CACX;CAGA,MAAM,SAAoD,CAAC;CAC3D,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,UAAU,GAChD,OAAO,OAAO,OAAO,UAAU,WACzB,QACA,yBAAyB,KAAK;CAExC,OAAO;AACX;AAEA,SAAS,yBAAyB,QAAoD;CAClF,OAAO;EACH,OAAO,OAAO;EACd,OAAO,OAAO,OAAO,UAAU,WAAW,OAAO,QAAQ,KAAA;EACzD,UAAU,OAAO;CACrB;AACJ"}
@@ -0,0 +1,141 @@
1
+ import "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { AlignLeftIcon, CalendarIcon, CircleIcon, FlagIcon, FunctionSquareIcon, GlobeIcon, HashIcon, LinkIcon, MailIcon, RepeatIcon, Rows3Icon, TextIcon, UploadIcon, VoteIcon, iconSize } from "@rebasepro/ui";
4
+ import { isPropertyBuilder } from "@rebasepro/common";
5
+ //#region src/util/property_utils.tsx
6
+ /**
7
+ * Resolve a size value (string token or number) to a numeric pixel value
8
+ * suitable for passing to Lucide icons.
9
+ */
10
+ function resolveSize(size) {
11
+ if (typeof size === "number") return size;
12
+ return iconSize[size];
13
+ }
14
+ function isReferenceProperty(property) {
15
+ if (!property) return null;
16
+ if (property.type === "reference") return true;
17
+ if (property.type === "array") if (Array.isArray(property.of)) return false;
18
+ else return property.of?.type === "reference";
19
+ return false;
20
+ }
21
+ function isRelationProperty(property) {
22
+ if (!property) return null;
23
+ if (property.type === "relation") return true;
24
+ if (property.type === "array") if (Array.isArray(property.of)) return false;
25
+ else return property.of?.type === "relation";
26
+ return false;
27
+ }
28
+ function getIconForWidget(widget, size) {
29
+ return /* @__PURE__ */ jsx(widget?.Icon ?? CircleIcon, { size: resolveSize(size) });
30
+ }
31
+ /**
32
+ * Returns a default Lucide icon component based on property type.
33
+ * This provides a sensible fallback when no PropertyConfig is available.
34
+ */
35
+ function getDefaultIconForProperty(property) {
36
+ switch (property.type) {
37
+ case "string":
38
+ if (property.storage) return UploadIcon;
39
+ if (property.admin?.urlPreview) return GlobeIcon;
40
+ if (property.email) return MailIcon;
41
+ if (property.admin?.multiline || property.admin?.markdown) return AlignLeftIcon;
42
+ return TextIcon;
43
+ case "number": return HashIcon;
44
+ case "boolean": return FlagIcon;
45
+ case "date": return CalendarIcon;
46
+ case "map": return VoteIcon;
47
+ case "array": {
48
+ const of = property.of;
49
+ if (property.oneOf) return Rows3Icon;
50
+ if (of && !Array.isArray(of)) {
51
+ if (of.type === "reference") return LinkIcon;
52
+ if (of.type === "string" && of.storage) return UploadIcon;
53
+ }
54
+ return RepeatIcon;
55
+ }
56
+ case "reference": return LinkIcon;
57
+ case "relation": return LinkIcon;
58
+ case "vector": return HashIcon;
59
+ default: return CircleIcon;
60
+ }
61
+ }
62
+ function getIconForProperty(property, size = "small", fields = {}) {
63
+ const px = resolveSize(size);
64
+ if (isPropertyBuilder(property)) return /* @__PURE__ */ jsx(FunctionSquareIcon, { size: px });
65
+ const configId = property.propertyConfig || void 0;
66
+ const widget = configId ? fields[configId] : void 0;
67
+ if (widget?.Icon) return getIconForWidget(widget, size);
68
+ return /* @__PURE__ */ jsx(getDefaultIconForProperty(property), { size: px });
69
+ }
70
+ /**
71
+ * Get a property in a property tree from a path like
72
+ * `address.street`
73
+ * @param properties
74
+ * @param path
75
+ */
76
+ function getPropertyInPath(properties, path) {
77
+ if (typeof properties === "object") {
78
+ if (path in properties) return properties[path];
79
+ if (path.includes(".")) {
80
+ const pathSegments = path.split(".");
81
+ const childProperty = properties[pathSegments[0]];
82
+ if (typeof childProperty === "object" && childProperty.type === "map" && childProperty.properties) return getPropertyInPath(childProperty.properties, pathSegments.slice(1).join("."));
83
+ }
84
+ }
85
+ }
86
+ function getResolvedPropertyInPath(properties, path) {
87
+ if (typeof properties === "object") {
88
+ if (path in properties) return properties[path];
89
+ if (path.includes(".")) {
90
+ const pathSegments = path.split(".");
91
+ const childProperty = properties[pathSegments[0]];
92
+ if (childProperty?.type === "map" && childProperty.properties) return getResolvedPropertyInPath(childProperty.properties, pathSegments.slice(1).join("."));
93
+ }
94
+ }
95
+ }
96
+ function getBracketNotation(path) {
97
+ return path.replace(/\.([^.]*)/g, "[$1]");
98
+ }
99
+ /**
100
+ * Get properties sorted by their order, but include ALL properties.
101
+ * Nested keys (like "data.mode") in propertiesOrder are ignored - they're for column ordering.
102
+ * @param properties
103
+ * @param propertiesOrder
104
+ */
105
+ function getPropertiesWithPropertiesOrder(properties, propertiesOrder) {
106
+ if (!propertiesOrder) return properties;
107
+ const propertyKeys = Object.keys(properties);
108
+ const validOrderKeys = propertiesOrder.filter((key) => !key.includes(".") && properties[key]);
109
+ const result = {};
110
+ validOrderKeys.forEach((key) => {
111
+ const property = properties[key];
112
+ if (typeof property === "object" && property.type === "map" && property.properties) {
113
+ const mapProp = property;
114
+ result[key] = {
115
+ ...mapProp,
116
+ properties: getPropertiesWithPropertiesOrder(mapProp.properties, mapProp.propertiesOrder ?? [])
117
+ };
118
+ } else if (property) result[key] = property;
119
+ });
120
+ propertyKeys.forEach((key) => {
121
+ if (!result[key]) {
122
+ const property = properties[key];
123
+ if (typeof property === "object" && property.type === "map" && property.properties) {
124
+ const mapProp = property;
125
+ result[key] = {
126
+ ...mapProp,
127
+ properties: getPropertiesWithPropertiesOrder(mapProp.properties, mapProp.propertiesOrder ?? [])
128
+ };
129
+ } else if (property) result[key] = property;
130
+ }
131
+ });
132
+ return result;
133
+ }
134
+ function getDefaultPropertiesOrder(collection) {
135
+ if (collection.propertiesOrder) return collection.propertiesOrder;
136
+ return [...Object.keys(collection.properties), ...(collection.additionalFields ?? []).map((field) => field.key)];
137
+ }
138
+ //#endregion
139
+ export { getBracketNotation, getDefaultPropertiesOrder, getIconForProperty, getIconForWidget, getPropertiesWithPropertiesOrder, getPropertyInPath, getResolvedPropertyInPath, isReferenceProperty, isRelationProperty };
140
+
141
+ //# sourceMappingURL=property_utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property_utils.js","names":[],"sources":["../../src/util/property_utils.tsx"],"sourcesContent":["\nimport type { Properties } from \"@rebasepro/types\";\nimport type { MapProperty, Property } from \"@rebasepro/types\";\nimport type { PropertyConfig, AdminCollection } from \"@rebasepro/cms-types\";\nimport React from \"react\";\n\nimport { isPropertyBuilder } from \"@rebasepro/common\";\nimport {\n AlignLeftIcon,\n CalendarIcon,\n CircleIcon,\n FlagIcon,\n FunctionSquareIcon,\n GlobeIcon,\n HashIcon,\n iconSize,\n LinkIcon,\n MailIcon,\n RepeatIcon,\n Rows3Icon,\n TextIcon,\n UploadIcon,\n VoteIcon\n} from \"@rebasepro/ui\";\nimport type { IconSize, LucideIcon } from \"@rebasepro/ui\";\n\n/**\n * Resolve a size value (string token or number) to a numeric pixel value\n * suitable for passing to Lucide icons.\n */\nfunction resolveSize(size: IconSize | number): number {\n if (typeof size === \"number\") return size;\n return iconSize[size];\n}\n\nexport function isReferenceProperty(property: Property) {\n\n if (!property) return null;\n if (property.type === \"reference\") {\n return true;\n }\n if (property.type === \"array\") {\n if (Array.isArray(property.of)) return false;\n else return property.of?.type === \"reference\"\n }\n return false;\n}\n\nexport function isRelationProperty(property: Property) {\n if (!property) return null;\n if (property.type === \"relation\") {\n return true;\n }\n if (property.type === \"array\") {\n if (Array.isArray(property.of)) return false;\n else return property.of?.type === \"relation\"\n }\n return false;\n}\n\nexport function getIconForWidget(widget: PropertyConfig | undefined,\n size: IconSize | number) {\n const Icon = widget?.Icon ?? CircleIcon;\n const px = resolveSize(size);\n return <Icon size={px}/>;\n}\n\n/**\n * Returns a default Lucide icon component based on property type.\n * This provides a sensible fallback when no PropertyConfig is available.\n */\nfunction getDefaultIconForProperty(property: Property): LucideIcon {\n switch (property.type) {\n case \"string\": {\n if (property.storage) return UploadIcon;\n if (property.admin?.urlPreview) return GlobeIcon;\n if (property.email) return MailIcon;\n if (property.admin?.multiline || property.admin?.markdown) return AlignLeftIcon;\n return TextIcon;\n }\n case \"number\":\n return HashIcon;\n case \"boolean\":\n return FlagIcon;\n case \"date\":\n return CalendarIcon;\n case \"map\":\n return VoteIcon;\n case \"array\": {\n const of = property.of;\n const oneOf = property.oneOf;\n if (oneOf) return Rows3Icon;\n if (of && !Array.isArray(of)) {\n if (of.type === \"reference\") return LinkIcon;\n if (of.type === \"string\" && of.storage) return UploadIcon;\n }\n return RepeatIcon;\n }\n case \"reference\":\n return LinkIcon;\n case \"relation\":\n return LinkIcon;\n case \"vector\":\n return HashIcon;\n default:\n return CircleIcon;\n }\n}\n\nexport function getIconForProperty(\n property: Property,\n size: IconSize | number = \"small\",\n fields: Record<string, PropertyConfig> = {}\n): React.ReactNode {\n const px = resolveSize(size);\n\n if (isPropertyBuilder(property)) {\n return <FunctionSquareIcon size={px}/>;\n }\n\n // Try to look up a custom PropertyConfig icon first\n const configId = property.propertyConfig || undefined;\n const widget = configId ? fields[configId] : undefined;\n if (widget?.Icon) {\n return getIconForWidget(widget, size);\n }\n\n // Fall back to a type-based default icon\n const Icon = getDefaultIconForProperty(property);\n return <Icon size={px}/>;\n}\n\n/**\n * Get a property in a property tree from a path like\n * `address.street`\n * @param properties\n * @param path\n */\nexport function getPropertyInPath(properties: Properties, path: string): Property | undefined {\n if (typeof properties === \"object\") {\n if (path in properties) {\n return (properties as Record<string, Property>)[path];\n }\n if (path.includes(\".\")) {\n const pathSegments = path.split(\".\");\n const childProperty = (properties as Record<string, Property>)[pathSegments[0]];\n if (typeof childProperty === \"object\" && childProperty.type === \"map\" && childProperty.properties) {\n return getPropertyInPath(childProperty.properties, pathSegments.slice(1).join(\".\"))\n }\n }\n }\n return undefined;\n}\n\nexport function getResolvedPropertyInPath(properties: Record<string, Property>, path: string): Property | undefined {\n if (typeof properties === \"object\") {\n if (path in properties) {\n return properties[path];\n }\n if (path.includes(\".\")) {\n const pathSegments = path.split(\".\");\n // A path whose root is not a property at all is simply not found.\n // Reading `.type` off the miss threw a TypeError instead, which\n // turned one unresolvable column key into a crash for whatever was\n // walking the properties — see `propertiesToColumns`, where that is\n // the whole table. `getPropertyInPath` above already guards this.\n const childProperty = properties[pathSegments[0]];\n if (childProperty?.type === \"map\" && childProperty.properties) {\n return getResolvedPropertyInPath(childProperty.properties, pathSegments.slice(1).join(\".\"))\n }\n }\n }\n return undefined;\n}\n\n// replace the dot notation with brackets\n// address.street => address[street]\nexport function getBracketNotation(path: string): string {\n return path.replace(/\\.([^.]*)/g, \"[$1]\");\n}\n\n/**\n * Get properties sorted by their order, but include ALL properties.\n * Nested keys (like \"data.mode\") in propertiesOrder are ignored - they're for column ordering.\n * @param properties\n * @param propertiesOrder\n */\nexport function getPropertiesWithPropertiesOrder(properties: Properties, propertiesOrder?: string[]): Properties {\n if (!propertiesOrder) return properties;\n\n const propertyKeys = Object.keys(properties);\n\n // Filter propertiesOrder to only include top-level keys (no dots) that exist\n const validOrderKeys = (propertiesOrder as string[]).filter(\n key => !key.includes(\".\") && properties[key]\n );\n\n const result: Properties = {};\n\n // First add properties in the specified order\n validOrderKeys.forEach(key => {\n const property = properties[key];\n if (typeof property === \"object\" && property.type === \"map\" && (property as MapProperty).properties) {\n const mapProp = property as MapProperty;\n result[key] = {\n ...mapProp,\n properties: getPropertiesWithPropertiesOrder(mapProp.properties!, mapProp.propertiesOrder ?? [])\n } as Property;\n } else if (property) {\n result[key] = property;\n }\n });\n\n // Then add any missing properties (so they don't disappear!)\n propertyKeys.forEach(key => {\n if (!result[key]) {\n const property = properties[key];\n if (typeof property === \"object\" && property.type === \"map\" && (property as MapProperty).properties) {\n const mapProp = property as MapProperty;\n result[key] = {\n ...mapProp,\n properties: getPropertiesWithPropertiesOrder(mapProp.properties!, mapProp.propertiesOrder ?? [])\n } as Property;\n } else if (property) {\n result[key] = property;\n }\n }\n });\n\n return result;\n}\n\nexport function getDefaultPropertiesOrder(collection: AdminCollection): string[] {\n if (collection.propertiesOrder) return collection.propertiesOrder;\n return [...Object.keys(collection.properties), ...(collection.additionalFields ?? []).map(field => field.key)];\n}\n"],"mappings":";;;;;;;;;AA8BA,SAAS,YAAY,MAAiC;CAClD,IAAI,OAAO,SAAS,UAAU,OAAO;CACrC,OAAO,SAAS;AACpB;AAEA,SAAgB,oBAAoB,UAAoB;CAEpD,IAAI,CAAC,UAAU,OAAO;CACtB,IAAI,SAAS,SAAS,aAClB,OAAO;CAEX,IAAI,SAAS,SAAS,SAClB,IAAI,MAAM,QAAQ,SAAS,EAAE,GAAG,OAAO;MAClC,OAAO,SAAS,IAAI,SAAS;CAEtC,OAAO;AACX;AAEA,SAAgB,mBAAmB,UAAoB;CACnD,IAAI,CAAC,UAAU,OAAO;CACtB,IAAI,SAAS,SAAS,YAClB,OAAO;CAEX,IAAI,SAAS,SAAS,SAClB,IAAI,MAAM,QAAQ,SAAS,EAAE,GAAG,OAAO;MAClC,OAAO,SAAS,IAAI,SAAS;CAEtC,OAAO;AACX;AAEA,SAAgB,iBAAiB,QAC7B,MAAyB;CAGzB,OAAO,oBAFM,QAAQ,QAAQ,YAEtB,EAAM,MADF,YAAY,IACJ,EAAI,CAAA;AAC3B;;;;;AAMA,SAAS,0BAA0B,UAAgC;CAC/D,QAAQ,SAAS,MAAjB;EACI,KAAK;GACD,IAAI,SAAS,SAAS,OAAO;GAC7B,IAAI,SAAS,OAAO,YAAY,OAAO;GACvC,IAAI,SAAS,OAAO,OAAO;GAC3B,IAAI,SAAS,OAAO,aAAa,SAAS,OAAO,UAAU,OAAO;GAClE,OAAO;EAEX,KAAK,UACD,OAAO;EACX,KAAK,WACD,OAAO;EACX,KAAK,QACD,OAAO;EACX,KAAK,OACD,OAAO;EACX,KAAK,SAAS;GACV,MAAM,KAAK,SAAS;GAEpB,IADc,SAAS,OACZ,OAAO;GAClB,IAAI,MAAM,CAAC,MAAM,QAAQ,EAAE,GAAG;IAC1B,IAAI,GAAG,SAAS,aAAa,OAAO;IACpC,IAAI,GAAG,SAAS,YAAY,GAAG,SAAS,OAAO;GACnD;GACA,OAAO;EACX;EACA,KAAK,aACD,OAAO;EACX,KAAK,YACD,OAAO;EACX,KAAK,UACD,OAAO;EACX,SACI,OAAO;CACf;AACJ;AAEA,SAAgB,mBACZ,UACA,OAA0B,SAC1B,SAAyC,CAAC,GAC3B;CACf,MAAM,KAAK,YAAY,IAAI;CAE3B,IAAI,kBAAkB,QAAQ,GAC1B,OAAO,oBAAC,oBAAD,EAAoB,MAAM,GAAI,CAAA;CAIzC,MAAM,WAAW,SAAS,kBAAkB,KAAA;CAC5C,MAAM,SAAS,WAAW,OAAO,YAAY,KAAA;CAC7C,IAAI,QAAQ,MACR,OAAO,iBAAiB,QAAQ,IAAI;CAKxC,OAAO,oBADM,0BAA0B,QAC/B,GAAD,EAAM,MAAM,GAAI,CAAA;AAC3B;;;;;;;AAQA,SAAgB,kBAAkB,YAAwB,MAAoC;CAC1F,IAAI,OAAO,eAAe,UAAU;EAChC,IAAI,QAAQ,YACR,OAAQ,WAAwC;EAEpD,IAAI,KAAK,SAAS,GAAG,GAAG;GACpB,MAAM,eAAe,KAAK,MAAM,GAAG;GACnC,MAAM,gBAAiB,WAAwC,aAAa;GAC5E,IAAI,OAAO,kBAAkB,YAAY,cAAc,SAAS,SAAS,cAAc,YACnF,OAAO,kBAAkB,cAAc,YAAY,aAAa,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;EAE1F;CACJ;AAEJ;AAEA,SAAgB,0BAA0B,YAAsC,MAAoC;CAChH,IAAI,OAAO,eAAe,UAAU;EAChC,IAAI,QAAQ,YACR,OAAO,WAAW;EAEtB,IAAI,KAAK,SAAS,GAAG,GAAG;GACpB,MAAM,eAAe,KAAK,MAAM,GAAG;GAMnC,MAAM,gBAAgB,WAAW,aAAa;GAC9C,IAAI,eAAe,SAAS,SAAS,cAAc,YAC/C,OAAO,0BAA0B,cAAc,YAAY,aAAa,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;EAElG;CACJ;AAEJ;AAIA,SAAgB,mBAAmB,MAAsB;CACrD,OAAO,KAAK,QAAQ,cAAc,MAAM;AAC5C;;;;;;;AAQA,SAAgB,iCAAiC,YAAwB,iBAAwC;CAC7G,IAAI,CAAC,iBAAiB,OAAO;CAE7B,MAAM,eAAe,OAAO,KAAK,UAAU;CAG3C,MAAM,iBAAkB,gBAA6B,QACjD,QAAO,CAAC,IAAI,SAAS,GAAG,KAAK,WAAW,IAC5C;CAEA,MAAM,SAAqB,CAAC;CAG5B,eAAe,SAAQ,QAAO;EAC1B,MAAM,WAAW,WAAW;EAC5B,IAAI,OAAO,aAAa,YAAY,SAAS,SAAS,SAAU,SAAyB,YAAY;GACjG,MAAM,UAAU;GAChB,OAAO,OAAO;IACV,GAAG;IACH,YAAY,iCAAiC,QAAQ,YAAa,QAAQ,mBAAmB,CAAC,CAAC;GACnG;EACJ,OAAO,IAAI,UACP,OAAO,OAAO;CAEtB,CAAC;CAGD,aAAa,SAAQ,QAAO;EACxB,IAAI,CAAC,OAAO,MAAM;GACd,MAAM,WAAW,WAAW;GAC5B,IAAI,OAAO,aAAa,YAAY,SAAS,SAAS,SAAU,SAAyB,YAAY;IACjG,MAAM,UAAU;IAChB,OAAO,OAAO;KACV,GAAG;KACH,YAAY,iCAAiC,QAAQ,YAAa,QAAQ,mBAAmB,CAAC,CAAC;IACnG;GACJ,OAAO,IAAI,UACP,OAAO,OAAO;EAEtB;CACJ,CAAC;CAED,OAAO;AACX;AAEA,SAAgB,0BAA0B,YAAuC;CAC7E,IAAI,WAAW,iBAAiB,OAAO,WAAW;CAClD,OAAO,CAAC,GAAG,OAAO,KAAK,WAAW,UAAU,GAAG,IAAI,WAAW,oBAAoB,CAAC,EAAA,CAAG,KAAI,UAAS,MAAM,GAAG,CAAC;AACjH"}
@@ -0,0 +1,55 @@
1
+ import { VIEW_MODES } from "./view_mode.js";
2
+ import React from "react";
3
+ import { HistoryIcon } from "@rebasepro/ui";
4
+ //#region src/util/resolutions.ts
5
+ /**
6
+ * Built-in entity views that are resolved by token name.
7
+ * These are always available without needing to be registered
8
+ * in the customization controller's entityViews array.
9
+ */
10
+ var BUILTIN_ENTITY_VIEWS = { "__rebase_history": {
11
+ key: "__rebase_history",
12
+ name: "History",
13
+ tabComponent: React.createElement(HistoryIcon, { size: 20 }),
14
+ position: "end"
15
+ } };
16
+ function resolveEntityView(entityView, contextEntityViews) {
17
+ if (typeof entityView === "string") return BUILTIN_ENTITY_VIEWS[entityView] ?? contextEntityViews?.find((entry) => entry.key === entityView);
18
+ else return entityView;
19
+ }
20
+ /**
21
+ * Resolve a collection's `admin.customViews` into the views it can actually
22
+ * render, dropping every entry that names a key nothing registered.
23
+ *
24
+ * Dropping is deliberate: an unresolvable key must not become a switcher entry
25
+ * that renders a blank panel. It falls out of `enabledViews` too, so a user
26
+ * whose saved view mode was removed lands on a built-in.
27
+ */
28
+ function resolveCollectionViews(customViews, contextCollectionViews) {
29
+ if (!customViews) return [];
30
+ const resolved = [];
31
+ const seen = /* @__PURE__ */ new Set();
32
+ for (const entry of customViews) {
33
+ const view = typeof entry === "string" ? contextCollectionViews?.find((candidate) => candidate.key === entry) : entry;
34
+ if (!view || VIEW_MODES.includes(view.key) || seen.has(view.key)) continue;
35
+ seen.add(view.key);
36
+ resolved.push(view);
37
+ }
38
+ return resolved;
39
+ }
40
+ function resolveEntityAction(entityAction, contextEntityActions) {
41
+ if (typeof entityAction === "string") return contextEntityActions?.find((entry) => entry.key === entityAction);
42
+ else return entityAction;
43
+ }
44
+ function resolvedSelectedEntityView(customViews, customizationController, selectedTab, _canEdit) {
45
+ const resolvedEntityViews = customViews ? customViews.map((e) => resolveEntityView(e, customizationController.entityViews)).filter(Boolean).filter((e) => e.key !== "__rebase_history") : [];
46
+ return {
47
+ resolvedEntityViews,
48
+ selectedEntityView: resolvedEntityViews.find((e) => e.key === selectedTab),
49
+ selectedSecondaryForm: customViews && resolvedEntityViews.filter((e) => e.includeActions).find((e) => e.key === selectedTab)
50
+ };
51
+ }
52
+ //#endregion
53
+ export { resolveCollectionViews, resolveEntityAction, resolveEntityView, resolvedSelectedEntityView };
54
+
55
+ //# sourceMappingURL=resolutions.js.map