@rebasepro/admin 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -20
  3. package/dist/{CollectionEditorDialog-iGgS4rLX.js → CollectionEditorDialog-B-7uW3iJ.js} +15 -15
  4. package/dist/CollectionEditorDialog-B-7uW3iJ.js.map +1 -0
  5. package/dist/{PropertyEditView-C9yhLyja.js → PropertyEditView-7KMTcrqi.js} +140 -106
  6. package/dist/PropertyEditView-7KMTcrqi.js.map +1 -0
  7. package/dist/{RouterCollectionsStudioView-Dqx27GD8.js → RouterCollectionsStudioView-epqIbZrJ.js} +4 -4
  8. package/dist/{RouterCollectionsStudioView-Dqx27GD8.js.map → RouterCollectionsStudioView-epqIbZrJ.js.map} +1 -1
  9. package/dist/collection_editor/_cms_internals.d.ts +4 -4
  10. package/dist/collection_editor/api/generateCollectionApi.d.ts +7 -6
  11. package/dist/collection_editor/extensibility_types.d.ts +3 -3
  12. package/dist/collection_editor/index.d.ts +2 -2
  13. package/dist/collection_editor/pgColumnToProperty.d.ts +3 -3
  14. package/dist/collection_editor/serializable_types.d.ts +12 -16
  15. package/dist/collection_editor/serializable_utils.d.ts +8 -8
  16. package/dist/collection_editor/types/collection_editor_controller.d.ts +5 -5
  17. package/dist/collection_editor/types/collection_inference.d.ts +2 -2
  18. package/dist/collection_editor/types/config_controller.d.ts +7 -7
  19. package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -2
  20. package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +2 -2
  21. package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -2
  22. package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +2 -2
  23. package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +3 -3
  24. package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +2 -2
  25. package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +4 -5
  26. package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
  27. package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +2 -2
  28. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +4 -4
  29. package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +2 -2
  30. package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +2 -2
  31. package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +2 -2
  32. package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +2 -2
  33. package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +2 -2
  34. package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +4 -4
  35. package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +3 -3
  36. package/dist/collection_editor/ui/collection_editor/templates/blog_template.d.ts +2 -2
  37. package/dist/collection_editor/ui/collection_editor/templates/pages_template.d.ts +2 -2
  38. package/dist/collection_editor/ui/collection_editor/templates/products_template.d.ts +2 -2
  39. package/dist/collection_editor/ui/collection_editor/templates/users_template.d.ts +2 -2
  40. package/dist/collection_editor/useLocalCollectionsConfigController.d.ts +2 -2
  41. package/dist/collection_editor/validateCollectionJson.d.ts +2 -2
  42. package/dist/collection_editor_ui.js +4 -4
  43. package/dist/components/CollectionPanel.d.ts +4 -4
  44. package/dist/components/{EntityCollectionTable/EntityCollectionRowActions.d.ts → CollectionTableBinding/CollectionRowActions.d.ts} +3 -3
  45. package/dist/components/CollectionTableBinding/CollectionTableBinding.d.ts +28 -0
  46. package/dist/components/{EntityCollectionTable/EntityCollectionTableProps.d.ts → CollectionTableBinding/CollectionTableBindingProps.d.ts} +1 -1
  47. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableMultipleRelationField.d.ts +2 -2
  48. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableReferenceField.d.ts +2 -2
  49. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationField.d.ts +2 -2
  50. package/dist/components/CollectionTableBinding/index.d.ts +6 -0
  51. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/common.d.ts +2 -2
  52. package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/PopupFormField.d.ts +2 -2
  53. package/dist/components/{EntityCollectionView/EntityBoardCard.d.ts → CollectionViewBinding/BoardCardBinding.d.ts} +8 -8
  54. package/dist/components/{EntityCollectionView/EntityCollectionBoardView.d.ts → CollectionViewBinding/CollectionBoardViewBinding.d.ts} +4 -4
  55. package/dist/components/{EntityCollectionView/EntityCollectionCardView.d.ts → CollectionViewBinding/CollectionCardViewBinding.d.ts} +5 -5
  56. package/dist/components/{EntityCollectionView/EntityCollectionListView.d.ts → CollectionViewBinding/CollectionListViewBinding.d.ts} +4 -4
  57. package/dist/components/{EntityCollectionView/EntityCollectionViewActions.d.ts → CollectionViewBinding/CollectionViewActions.d.ts} +4 -4
  58. package/dist/components/{EntityCollectionView/EntityCollectionView.d.ts → CollectionViewBinding/CollectionViewBinding.d.ts} +4 -4
  59. package/dist/components/{EntityCollectionView/EntityCollectionViewStartActions.d.ts → CollectionViewBinding/CollectionViewStartActions.d.ts} +4 -4
  60. package/dist/components/CollectionViewBinding/EntityCardBinding.d.ts +21 -0
  61. package/dist/components/{EntityCollectionView → CollectionViewBinding}/SplitListView.d.ts +3 -3
  62. package/dist/components/{EntityCollectionView → CollectionViewBinding}/hooks/useCollectionInlineEditor.d.ts +2 -2
  63. package/dist/components/{EntityCollectionView → CollectionViewBinding}/hooks/useKanbanDragAndDrop.d.ts +2 -2
  64. package/dist/components/{EntityCollectionView → CollectionViewBinding}/useBoardDataController.d.ts +2 -2
  65. package/dist/components/{EntityCollectionView/useEntityPreviewSlots.d.ts → CollectionViewBinding/usePreviewSlots.d.ts} +5 -5
  66. package/dist/components/DeleteEntityDialog.d.ts +4 -4
  67. package/dist/components/{EntityDetailView.d.ts → DetailViewBinding.d.ts} +5 -5
  68. package/dist/components/EditFormActions.d.ts +3 -0
  69. package/dist/components/{EntityEditView.d.ts → EditViewBinding.d.ts} +9 -9
  70. package/dist/components/{EntityPreview.d.ts → EntityPreviewBinding.d.ts} +13 -13
  71. package/dist/components/EntityViewBinding.d.ts +13 -0
  72. package/dist/components/{EntityJsonPreview.d.ts → JsonPreviewBinding.d.ts} +1 -1
  73. package/dist/components/RebaseCMS.d.ts +1 -1
  74. package/dist/components/RebaseNavigation.d.ts +1 -1
  75. package/dist/components/ReferenceTable/{EntitySelectionTable.d.ts → SelectionTableBinding.d.ts} +5 -5
  76. package/dist/components/SelectableTable/SelectableTable.d.ts +5 -5
  77. package/dist/components/SelectableTable/SelectableTableContext.d.ts +3 -3
  78. package/dist/components/SelectableTable/SelectionStore.d.ts +13 -22
  79. package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +6 -1
  80. package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +7 -1
  81. package/dist/components/SelectableTable/filters/FilterFieldBinding.d.ts +40 -0
  82. package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +7 -1
  83. package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +7 -1
  84. package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +7 -1
  85. package/dist/components/SideDialogs.d.ts +1 -1
  86. package/dist/components/SidePanelBinding.d.ts +11 -0
  87. package/dist/components/{SideEntityProvider.d.ts → SidePanelProvider.d.ts} +7 -7
  88. package/dist/components/field_configs.d.ts +1 -1
  89. package/dist/components/history/EntityHistoryEntry.d.ts +2 -2
  90. package/dist/components/history/LastEditedByIndicator.d.ts +2 -2
  91. package/dist/components/index.d.ts +14 -13
  92. package/dist/contexts/SidePanelControllerContext.d.ts +3 -0
  93. package/dist/data_export/export/ExportCollectionAction.d.ts +3 -3
  94. package/dist/data_import/components/ImportSaveInProgress.d.ts +2 -2
  95. package/dist/editor/editor.d.ts +0 -6
  96. package/dist/editor.js +1 -3
  97. package/dist/editor.js.map +1 -1
  98. package/dist/form/EntityForm.d.ts +1 -1
  99. package/dist/form/PropertyFieldBinding.d.ts +1 -1
  100. package/dist/form/components/StorageUploadProgress.d.ts +6 -1
  101. package/dist/form/form_utils.d.ts +2 -2
  102. package/dist/form/index.d.ts +0 -1
  103. package/dist/{history-ChHgyyvM.js → history-7X5bON_n.js} +4 -4
  104. package/dist/history-7X5bON_n.js.map +1 -0
  105. package/dist/hooks/index.d.ts +4 -4
  106. package/dist/hooks/navigation/contexts/CollectionRegistryContext.d.ts +2 -2
  107. package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +5 -5
  108. package/dist/hooks/navigation/useNavigationResolution.d.ts +4 -4
  109. package/dist/hooks/navigation/useResolvedCollections.d.ts +7 -7
  110. package/dist/hooks/navigation/useTopLevelNavigation.d.ts +2 -2
  111. package/dist/hooks/navigation/utils.d.ts +5 -5
  112. package/dist/hooks/useBuildSidePanel.d.ts +6 -0
  113. package/dist/hooks/useCMSContext.d.ts +2 -2
  114. package/dist/hooks/{useEntityHistory.d.ts → useHistory.d.ts} +1 -1
  115. package/dist/hooks/useResolvedNavigationFrom.d.ts +3 -3
  116. package/dist/hooks/{useEntitySelectionDialog.d.ts → useSelectionDialog.d.ts} +2 -2
  117. package/dist/hooks/useSideDialogsController.d.ts +1 -1
  118. package/dist/hooks/useSidePanel.d.ts +11 -0
  119. package/dist/index.d.ts +3 -3
  120. package/dist/index.js +2 -2
  121. package/dist/preview/components/StorageThumbnail.d.ts +3 -1
  122. package/dist/{src-DOX2nOyh.js → src-sUZfe29F.js} +904 -1096
  123. package/dist/src-sUZfe29F.js.map +1 -0
  124. package/dist/types/components/EntityFormActionsProps.d.ts +2 -2
  125. package/dist/types/components/EntityFormProps.d.ts +3 -3
  126. package/dist/types/components/PropertyPreviewProps.d.ts +2 -1
  127. package/dist/types/fields.d.ts +6 -8
  128. package/dist/util/dataControllerAdapter.d.ts +2 -5
  129. package/dist/util/navigation_utils.d.ts +6 -6
  130. package/dist/util/previews.d.ts +3 -3
  131. package/dist/util/property_utils.d.ts +2 -2
  132. package/dist/util/{entity_view_constants.d.ts → view_constants.d.ts} +1 -1
  133. package/package.json +18 -18
  134. package/src/collection_editor/ConfigControllerProvider.tsx +10 -10
  135. package/src/collection_editor/_cms_internals.ts +4 -4
  136. package/src/collection_editor/api/generateCollectionApi.ts +7 -6
  137. package/src/collection_editor/extensibility_types.ts +3 -3
  138. package/src/collection_editor/index.ts +3 -3
  139. package/src/collection_editor/pgColumnToProperty.ts +4 -4
  140. package/src/collection_editor/serializable_types.ts +22 -35
  141. package/src/collection_editor/serializable_utils.ts +40 -52
  142. package/src/collection_editor/types/collection_editor_controller.tsx +5 -5
  143. package/src/collection_editor/types/collection_inference.ts +2 -2
  144. package/src/collection_editor/types/config_controller.tsx +7 -7
  145. package/src/collection_editor/ui/AddKanbanColumnAction.tsx +2 -2
  146. package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +2 -2
  147. package/src/collection_editor/ui/EditorCollectionAction.tsx +2 -2
  148. package/src/collection_editor/ui/EditorCollectionActionStart.tsx +2 -2
  149. package/src/collection_editor/ui/EditorEntityAction.tsx +2 -2
  150. package/src/collection_editor/ui/KanbanSetupAction.tsx +2 -2
  151. package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +2 -2
  152. package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +5 -5
  153. package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +3 -3
  154. package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +63 -46
  155. package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +3 -3
  156. package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +2 -2
  157. package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +8 -8
  158. package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +2 -2
  159. package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +2 -2
  160. package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +2 -2
  161. package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +2 -2
  162. package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +2 -2
  163. package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +3 -3
  164. package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +5 -5
  165. package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +4 -4
  166. package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +2 -2
  167. package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +7 -16
  168. package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +45 -36
  169. package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +1 -1
  170. package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +5 -5
  171. package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +3 -3
  172. package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.tsx +2 -2
  173. package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +2 -2
  174. package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +35 -1
  175. package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +3 -3
  176. package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +2 -2
  177. package/src/collection_editor/ui/collection_editor/templates/products_template.ts +2 -2
  178. package/src/collection_editor/ui/collection_editor/templates/users_template.ts +2 -2
  179. package/src/collection_editor/ui/collection_editor/utils/supported_fields.tsx +0 -1
  180. package/src/collection_editor/ui/collection_editor/utils/update_property_for_widget.ts +7 -29
  181. package/src/collection_editor/useJsonCollectionsConfigController.tsx +14 -14
  182. package/src/collection_editor/useLocalCollectionsConfigController.tsx +4 -4
  183. package/src/collection_editor/validateCollectionJson.ts +3 -3
  184. package/src/components/CollectionPanel.tsx +14 -17
  185. package/src/components/{EntityCollectionTable/EntityCollectionRowActions.tsx → CollectionTableBinding/CollectionRowActions.tsx} +6 -6
  186. package/src/components/{EntityCollectionTable/EntityCollectionTable.tsx → CollectionTableBinding/CollectionTableBinding.tsx} +19 -17
  187. package/src/components/{EntityCollectionTable/EntityCollectionTableProps.tsx → CollectionTableBinding/CollectionTableBindingProps.tsx} +1 -1
  188. package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableMultipleRelationField.tsx +7 -6
  189. package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableReferenceField.tsx +10 -10
  190. package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationField.tsx +7 -6
  191. package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableStorageUpload.tsx +23 -20
  192. package/src/components/CollectionTableBinding/index.tsx +14 -0
  193. package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/common.tsx +2 -2
  194. package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/PopupFormField.tsx +2 -2
  195. package/src/components/{EntityCollectionTable → CollectionTableBinding}/table_bindings.tsx +24 -44
  196. package/src/components/{EntityCollectionView/EntityBoardCard.tsx → CollectionViewBinding/BoardCardBinding.tsx} +15 -15
  197. package/src/components/{EntityCollectionView/EntityCollectionBoardView.tsx → CollectionViewBinding/CollectionBoardViewBinding.tsx} +15 -14
  198. package/src/components/{EntityCollectionView/EntityCollectionCardView.tsx → CollectionViewBinding/CollectionCardViewBinding.tsx} +8 -8
  199. package/src/components/{EntityCollectionView/EntityCollectionListView.tsx → CollectionViewBinding/CollectionListViewBinding.tsx} +24 -13
  200. package/src/components/{EntityCollectionView/EntityCollectionViewActions.tsx → CollectionViewBinding/CollectionViewActions.tsx} +5 -5
  201. package/src/components/{EntityCollectionView/EntityCollectionView.tsx → CollectionViewBinding/CollectionViewBinding.tsx} +112 -114
  202. package/src/components/{EntityCollectionView/EntityCollectionViewStartActions.tsx → CollectionViewBinding/CollectionViewStartActions.tsx} +5 -5
  203. package/src/components/{EntityCollectionView/EntityCard.tsx → CollectionViewBinding/EntityCardBinding.tsx} +9 -9
  204. package/src/components/{EntityCollectionView → CollectionViewBinding}/FiltersDialog.tsx +31 -72
  205. package/src/components/{EntityCollectionView → CollectionViewBinding}/SplitListView.tsx +9 -9
  206. package/src/components/{EntityCollectionView → CollectionViewBinding}/hooks/useCollectionInlineEditor.ts +6 -6
  207. package/src/components/{EntityCollectionView → CollectionViewBinding}/hooks/useKanbanDragAndDrop.ts +4 -4
  208. package/src/components/{EntityCollectionView → CollectionViewBinding}/useBoardDataController.tsx +28 -50
  209. package/src/components/{EntityCollectionView/useEntityPreviewSlots.ts → CollectionViewBinding/usePreviewSlots.ts} +11 -11
  210. package/src/components/DefaultDrawer.tsx +1 -1
  211. package/src/components/DeleteEntityDialog.tsx +6 -6
  212. package/src/components/{EntityDetailView.tsx → DetailViewBinding.tsx} +28 -31
  213. package/src/components/{EntityEditViewFormActions.tsx → EditFormActions.tsx} +15 -15
  214. package/src/components/{EntityEditView.tsx → EditViewBinding.tsx} +31 -34
  215. package/src/components/{EntityPreview.tsx → EntityPreviewBinding.tsx} +27 -27
  216. package/src/components/{EntityView.tsx → EntityViewBinding.tsx} +5 -5
  217. package/src/components/HomePage/ContentHomePage.tsx +1 -1
  218. package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
  219. package/src/components/{EntityJsonPreview.tsx → JsonPreviewBinding.tsx} +1 -1
  220. package/src/components/RebaseCMS.tsx +4 -4
  221. package/src/components/RebaseNavigation.tsx +20 -10
  222. package/src/components/ReferenceTable/{EntitySelectionTable.tsx → SelectionTableBinding.tsx} +22 -19
  223. package/src/components/ReferenceWidget.tsx +4 -4
  224. package/src/components/RelationSelector.tsx +16 -14
  225. package/src/components/SelectableTable/SelectableTable.tsx +44 -89
  226. package/src/components/SelectableTable/SelectableTableContext.tsx +3 -3
  227. package/src/components/SelectableTable/SelectionStore.ts +22 -52
  228. package/src/components/SelectableTable/filters/BooleanFilterField.tsx +9 -1
  229. package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +33 -12
  230. package/src/components/SelectableTable/filters/FilterFieldBinding.tsx +187 -0
  231. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +21 -7
  232. package/src/components/SelectableTable/filters/RelationFilterField.tsx +17 -3
  233. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +66 -12
  234. package/src/components/SideDialogs.tsx +3 -3
  235. package/src/components/{EntitySidePanel.tsx → SidePanelBinding.tsx} +19 -19
  236. package/src/components/{SideEntityProvider.tsx → SidePanelProvider.tsx} +16 -16
  237. package/src/components/common/default_entity_actions.tsx +24 -13
  238. package/src/components/field_configs.tsx +0 -14
  239. package/src/components/history/EntityHistoryEntry.tsx +2 -2
  240. package/src/components/history/EntityHistoryView.tsx +3 -3
  241. package/src/components/history/LastEditedByIndicator.tsx +2 -2
  242. package/src/components/index.ts +15 -14
  243. package/src/contexts/SidePanelControllerContext.tsx +5 -0
  244. package/src/data_export/export/ExportCollectionAction.tsx +4 -4
  245. package/src/data_import/components/ImportSaveInProgress.tsx +3 -3
  246. package/src/data_import/import/ImportCollectionAction.tsx +4 -4
  247. package/src/data_import/utils/data.ts +2 -2
  248. package/src/editor/editor.tsx +4 -7
  249. package/src/form/EntityForm.tsx +2 -2
  250. package/src/form/EntityFormActions.tsx +4 -4
  251. package/src/form/EntityFormBinding.tsx +7 -7
  252. package/src/form/PropertyFieldBinding.tsx +4 -4
  253. package/src/form/components/StorageUploadProgress.tsx +9 -2
  254. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +4 -4
  255. package/src/form/field_bindings/KeyValueFieldBinding.tsx +19 -19
  256. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +12 -1
  257. package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +6 -6
  258. package/src/form/field_bindings/ReferenceFieldBinding.tsx +5 -5
  259. package/src/form/field_bindings/RelationFieldBinding.tsx +8 -10
  260. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +19 -15
  261. package/src/form/form_utils.ts +2 -2
  262. package/src/form/index.tsx +0 -1
  263. package/src/hooks/index.ts +4 -4
  264. package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +2 -2
  265. package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +11 -11
  266. package/src/hooks/navigation/useBuildNavigationStateController.tsx +5 -5
  267. package/src/hooks/navigation/useNavigationResolution.ts +10 -10
  268. package/src/hooks/navigation/useResolvedCollections.ts +8 -8
  269. package/src/hooks/navigation/useTopLevelNavigation.ts +2 -2
  270. package/src/hooks/navigation/utils.ts +5 -5
  271. package/src/hooks/{useBuildSideEntityController.tsx → useBuildSidePanel.tsx} +28 -28
  272. package/src/hooks/useCMSContext.tsx +6 -6
  273. package/src/hooks/{useEntityHistory.ts → useHistory.ts} +1 -1
  274. package/src/hooks/useResolvedNavigationFrom.tsx +8 -5
  275. package/src/hooks/{useEntitySelectionDialog.tsx → useSelectionDialog.tsx} +7 -7
  276. package/src/hooks/useSideDialogsController.tsx +1 -1
  277. package/src/hooks/useSidePanel.tsx +13 -0
  278. package/src/index.ts +13 -13
  279. package/src/preview/PropertyPreview.tsx +1 -16
  280. package/src/preview/components/ReferencePreview.tsx +10 -10
  281. package/src/preview/components/RelationPreview.tsx +13 -12
  282. package/src/preview/components/StorageThumbnail.tsx +24 -7
  283. package/src/routes/RebaseRoute.tsx +10 -10
  284. package/src/types/components/EntityFormActionsProps.tsx +2 -2
  285. package/src/types/components/EntityFormProps.tsx +3 -3
  286. package/src/types/components/PropertyPreviewProps.tsx +1 -1
  287. package/src/types/fields.tsx +4 -9
  288. package/src/util/dataControllerAdapter.ts +9 -15
  289. package/src/util/navigation_utils.ts +7 -7
  290. package/src/util/previews.ts +23 -3
  291. package/src/util/propertyConfigMapper.ts +3 -3
  292. package/src/util/property_utils.tsx +2 -3
  293. package/src/util/{entity_view_constants.ts → view_constants.ts} +1 -1
  294. package/dist/CollectionEditorDialog-iGgS4rLX.js.map +0 -1
  295. package/dist/PropertyEditView-C9yhLyja.js.map +0 -1
  296. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +0 -28
  297. package/dist/components/EntityCollectionTable/fields/VirtualTableDateField.d.ts +0 -12
  298. package/dist/components/EntityCollectionTable/fields/VirtualTableInput.d.ts +0 -10
  299. package/dist/components/EntityCollectionTable/fields/VirtualTableNumberInput.d.ts +0 -9
  300. package/dist/components/EntityCollectionTable/fields/VirtualTableSwitch.d.ts +0 -8
  301. package/dist/components/EntityCollectionTable/index.d.ts +0 -6
  302. package/dist/components/EntityCollectionView/EntityCard.d.ts +0 -21
  303. package/dist/components/EntityEditViewFormActions.d.ts +0 -3
  304. package/dist/components/EntitySidePanel.d.ts +0 -11
  305. package/dist/components/EntityView.d.ts +0 -13
  306. package/dist/contexts/SideEntityControllerContext.d.ts +0 -3
  307. package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +0 -11
  308. package/dist/history-ChHgyyvM.js.map +0 -1
  309. package/dist/hooks/useBuildSideEntityController.d.ts +0 -6
  310. package/dist/hooks/useSideEntityController.d.ts +0 -11
  311. package/dist/src-DOX2nOyh.js.map +0 -1
  312. package/src/components/EntityCollectionTable/fields/VirtualTableDateField.tsx +0 -39
  313. package/src/components/EntityCollectionTable/fields/VirtualTableInput.tsx +0 -90
  314. package/src/components/EntityCollectionTable/fields/VirtualTableNumberInput.tsx +0 -83
  315. package/src/components/EntityCollectionTable/fields/VirtualTableSwitch.tsx +0 -32
  316. package/src/components/EntityCollectionTable/index.tsx +0 -14
  317. package/src/contexts/SideEntityControllerContext.tsx +0 -5
  318. package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +0 -141
  319. package/src/hooks/useSideEntityController.tsx +0 -13
  320. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/PropertyTableCell.d.ts +0 -0
  321. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/column_utils.d.ts +0 -0
  322. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationSelectorField.d.ts +0 -0
  323. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableStorageUpload.d.ts +0 -0
  324. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableSelect.d.ts +0 -0
  325. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableUserSelect.d.ts +0 -0
  326. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/CollectionTableToolbar.d.ts +0 -0
  327. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCell.d.ts +0 -0
  328. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCellActions.d.ts +0 -0
  329. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useDraggable.d.ts +0 -0
  330. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useWindowSize.d.ts +0 -0
  331. /package/dist/components/{EntityCollectionTable → CollectionTableBinding}/table_bindings.d.ts +0 -0
  332. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/FilterPresetsButton.d.ts +0 -0
  333. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/FiltersDialog.d.ts +0 -0
  334. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/ViewModeToggle.d.ts +0 -0
  335. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/useSelectionController.d.ts +0 -0
  336. /package/dist/components/{EntityCollectionView → CollectionViewBinding}/utils.d.ts +0 -0
  337. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/PropertyTableCell.tsx +0 -0
  338. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/column_utils.tsx +0 -0
  339. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/TableRelationSelectorField.tsx +0 -0
  340. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableSelect.tsx +0 -0
  341. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/fields/VirtualTableUserSelect.tsx +0 -0
  342. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/CollectionTableToolbar.tsx +0 -0
  343. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCell.tsx +0 -0
  344. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/EntityTableCellActions.tsx +0 -0
  345. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useDraggable.tsx +0 -0
  346. /package/src/components/{EntityCollectionTable → CollectionTableBinding}/internal/popup_field/useWindowSize.tsx +0 -0
  347. /package/src/components/{EntityCollectionView → CollectionViewBinding}/FilterPresetsButton.tsx +0 -0
  348. /package/src/components/{EntityCollectionView → CollectionViewBinding}/ViewModeToggle.tsx +0 -0
  349. /package/src/components/{EntityCollectionView → CollectionViewBinding}/useSelectionController.tsx +0 -0
  350. /package/src/components/{EntityCollectionView → CollectionViewBinding}/utils.ts +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertyEditView-C9yhLyja.js","names":[],"sources":["../src/collection_editor/useSafeSnackbarController.ts","../src/collection_editor/ui/collection_editor/EnumForm.tsx","../src/collection_editor/ui/collection_editor/SwitchControl.tsx","../src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx","../src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx","../src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx","../src/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.tsx","../src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx","../src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx","../src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx","../src/collection_editor/ui/collection_editor/AIModifiedPathsContext.tsx","../src/collection_editor/ui/collection_editor/PropertyTree.tsx","../src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx","../src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx","../src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx","../src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx","../src/collection_editor/ui/collection_editor/properties/BooleanPropertyField.tsx","../src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx","../src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx","../src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx","../src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx","../src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx","../src/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx","../src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx","../src/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.tsx","../src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx","../src/collection_editor/ui/collection_editor/utils/update_property_for_widget.ts","../src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx","../src/collection_editor/ui/collection_editor/utils/supported_fields.tsx","../src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx","../src/collection_editor/ui/collection_editor/PropertyEditView.tsx"],"sourcesContent":["import { useSnackbarController } from \"@rebasepro/core\";\n\nexport function useSafeSnackbarController(): ReturnType<typeof useSnackbarController> | undefined {\n try {\n return useSnackbarController();\n } catch {\n return undefined;\n }\n}\n","\nimport { FieldCaption } from \"../../_cms_internals\";\nimport React, { useEffect } from \"react\";\nimport { deepEqual as equal } from \"fast-equals\"\n\n;\nimport { EnumValueConfig, EnumValues } from \"@rebasepro/types\";\nimport { ArrayContainer, ArrayEntryParams } from \"../../_cms_internals\";\nimport {\n Badge,\n Button,\n CircularProgress,\n DebouncedTextField,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n iconSize,\n ListIcon,\n Paper,\n RefreshCcwIcon,\n SettingsIcon,\n Typography\n} from \"@rebasepro/ui\";\nimport { extractEnumFromValues } from \"@rebasepro/schema-inference\";\nimport { Field, Formex, getIn, useCreateFormex, useFormex } from \"@rebasepro/formex\";\n\ntype EnumFormProps = {\n enumValues: EnumValueConfig[];\n onValuesChanged?: (enumValues: EnumValueConfig[]) => void;\n onError?: (error: boolean) => void;\n updateIds: boolean;\n disabled: boolean;\n allowDataInference?: boolean;\n getData?: () => Promise<string[]>;\n};\n\nexport function EnumForm({\n enumValues,\n onValuesChanged,\n onError,\n updateIds,\n disabled,\n allowDataInference,\n getData\n}: EnumFormProps) {\n\n const formex = useCreateFormex<{\n enum: EnumValueConfig[]\n }>({\n initialValues: { enum: enumValues },\n validateOnChange: true,\n validation: (values) => {\n interface EnumFieldError { label?: string; id?: string; }\n const enumErrors: EnumFieldError[] = [];\n let hasAnyError = false;\n if (values.enum) {\n values.enum.forEach((enumValue, index) => {\n const fieldError: EnumFieldError = {};\n if (!enumValue?.label) {\n fieldError.label = \"You must specify a label for this enum value entry\";\n hasAnyError = true;\n }\n if (!enumValue?.id) {\n fieldError.id = \"You must specify an ID for this enum value entry\";\n hasAnyError = true;\n }\n enumErrors[index] = fieldError;\n });\n }\n const errors = hasAnyError ? { enum: enumErrors } : {};\n onError?.(hasAnyError);\n return errors as Record<string, string>;\n }\n });\n\n const {\n values,\n errors\n } = formex;\n\n useEffect(() => {\n if (onValuesChanged) {\n onValuesChanged(values.enum);\n }\n }, [values.enum]);\n\n return <Formex value={formex as ReturnType<typeof useCreateFormex>}>\n <EnumFormFields enumValuesPath={\"enum\"}\n values={values}\n errors={errors}\n shouldUpdateId={updateIds}\n disabled={disabled}\n allowDataInference={allowDataInference}\n getData={getData}/>\n </Formex>\n\n}\n\ntype EnumFormFieldsProps = {\n values: {\n enum: EnumValueConfig[]\n };\n errors: { enum?: Array<{ label?: string; id?: string }> };\n enumValuesPath: string;\n shouldUpdateId: boolean;\n disabled: boolean;\n getData?: () => Promise<string[]>;\n allowDataInference?: boolean;\n};\n\n// const EnumFormFields = React.memo(\nfunction EnumFormFields({\n values,\n errors,\n disabled,\n enumValuesPath,\n shouldUpdateId,\n allowDataInference,\n getData\n}: EnumFormFieldsProps) {\n\n const {\n setFieldValue\n } = useFormex();\n\n const [lastInternalIdAdded, setLastInternalIdAdded] = React.useState<number | undefined>();\n const [editDialogIndex, setEditDialogIndex] = React.useState<number | undefined>();\n const [inferring, setInferring] = React.useState(false);\n\n const inferredValuesRef = React.useRef(new Set());\n const inferredValues = inferredValuesRef.current;\n\n const buildEntry = ({\n index,\n internalId\n }: ArrayEntryParams) => {\n const justAdded = lastInternalIdAdded === internalId;\n const entryError = errors?.enum?.[index];\n return <EnumEntry index={index}\n disabled={disabled}\n enumValuesPath={enumValuesPath}\n autoFocus={justAdded}\n entryError={entryError}\n shouldUpdateId={shouldUpdateId || justAdded}\n onDialogOpen={() => setEditDialogIndex(index)}\n inferredEntry={inferredValues.has(values.enum[index]?.id as string)}\n key={`${internalId}`}/>;\n };\n\n const inferValues = async () => {\n if (!getData)\n return;\n setInferring(true);\n getData?.().then((data) => {\n if (!data)\n return;\n\n const flatData = data.flat();\n\n const fieldData = Array.from(new Set(flatData));\n\n const currentEnumValues = values.enum;\n const foundEnumValues = extractEnumFromValues(fieldData);\n\n // add only new enum values\n const newEnumValues = foundEnumValues.filter((enumValue) => {\n if (!enumValue) return false;\n return !currentEnumValues?.some((v: EnumValueConfig) => v.id === enumValue.id);\n });\n\n newEnumValues.forEach((enumValue) => {\n if (enumValue) inferredValues.add(enumValue.id);\n });\n setFieldValue(enumValuesPath, [...newEnumValues, ...currentEnumValues], true);\n }).catch(e => {\n console.error(e);\n })\n .finally(() => setInferring(false));\n }\n\n return (\n <div className={\"col-span-12\"}>\n <div className=\"ml-3.5 flex flex-row items-center\">\n <ListIcon/>\n <Typography variant={\"subtitle2\"}\n className=\"ml-2 grow\">\n Values\n </Typography>\n {allowDataInference &&\n <Button loading={inferring}\n disabled={disabled || inferring}\n variant={\"text\"}\n size={\"small\"}\n onClick={inferValues}>\n {inferring ? <CircularProgress size={\"smallest\"}/> : <RefreshCcwIcon/>}\n Infer values from data\n </Button>}\n </div>\n\n <Paper className=\"p-4 m-1\">\n\n <ArrayContainer droppableId={enumValuesPath}\n addLabel={\"Add enum value\"}\n value={values.enum}\n disabled={disabled}\n size={\"small\"}\n buildEntry={buildEntry}\n onInternalIdAdded={setLastInternalIdAdded}\n canAddElements={true}\n onValueChange={(value: EnumValueConfig[]) => setFieldValue(enumValuesPath, value)}\n newDefaultEntry={{\n id: \"\",\n label: \"\"\n }}/>\n\n <EnumEntryDialog index={editDialogIndex}\n open={editDialogIndex !== undefined}\n enumValuesPath={enumValuesPath}\n onClose={() => setEditDialogIndex(undefined)}/>\n </Paper>\n </div>\n );\n}\n\ntype EnumEntryProps = {\n index: number,\n enumValuesPath: string,\n shouldUpdateId: boolean,\n autoFocus: boolean,\n onDialogOpen: () => void;\n disabled: boolean;\n inferredEntry?: boolean;\n entryError?: { label?: string, id?: string }\n};\n\nconst EnumEntry = React.memo(\n function EnumEntryInternal({\n index,\n shouldUpdateId: updateId,\n enumValuesPath,\n autoFocus,\n onDialogOpen,\n disabled,\n inferredEntry,\n entryError\n }: EnumEntryProps) {\n\n const {\n values,\n handleChange,\n errors,\n setFieldValue,\n touched\n } = useFormex<EnumValues>();\n\n const shouldUpdateIdRef = React.useRef(!getIn(values, `${enumValuesPath}[${index}].id`));\n const shouldUpdateId = updateId || shouldUpdateIdRef.current;\n\n const idValue = getIn(values, `${enumValuesPath}[${index}].id`);\n const labelValue = getIn(values, `${enumValuesPath}[${index}].label`);\n\n const currentLabelRef = React.useRef(labelValue);\n\n React.useEffect(() => {\n if ((currentLabelRef.current === idValue || !idValue) && shouldUpdateId) {\n setFieldValue(`${enumValuesPath}[${index}].id`, labelValue);\n }\n currentLabelRef.current = labelValue;\n }, [labelValue]);\n\n return (\n <>\n <div className={\"flex w-full align-center justify-center\"}>\n <Field name={`${enumValuesPath}[${index}].label`}\n as={DebouncedTextField}\n className={\"grow\"}\n required\n disabled={disabled}\n size=\"small\"\n autoFocus={autoFocus}\n autoComplete=\"off\"\n endAdornment={inferredEntry && <RefreshCcwIcon size={iconSize.small}/>}\n error={Boolean(entryError?.label)}/>\n\n {!disabled &&\n <Badge color={\"error\"} invisible={!entryError?.id}>\n <IconButton\n size=\"small\"\n aria-label=\"edit\"\n className={\"m-1\"}\n onClick={() => onDialogOpen()}>\n <SettingsIcon size={iconSize.small}/>\n </IconButton>\n </Badge>}\n\n </div>\n\n {entryError?.label && <Typography variant={\"caption\"}\n className={\"ml-3.5 text-red-500 dark:text-red-500\"}>\n {entryError?.label}\n </Typography>}\n\n {entryError?.id && <Typography variant={\"caption\"}\n className={\"ml-3.5 text-red-500 dark:text-red-500\"}>\n {entryError?.id}\n </Typography>}\n\n </>);\n },\n function areEqual(prevProps: EnumEntryProps, nextProps: EnumEntryProps) {\n return prevProps.index === nextProps.index &&\n prevProps.enumValuesPath === nextProps.enumValuesPath &&\n prevProps.shouldUpdateId === nextProps.shouldUpdateId &&\n prevProps.inferredEntry === nextProps.inferredEntry &&\n equal(prevProps.entryError, nextProps.entryError) &&\n prevProps.autoFocus === nextProps.autoFocus;\n }\n);\n\nfunction EnumEntryDialog({\n index,\n open,\n onClose,\n enumValuesPath\n}: {\n index?: number;\n open: boolean;\n enumValuesPath: string;\n onClose: () => void;\n}) {\n\n const {\n errors\n } = useFormex<EnumValues>();\n\n const idError = index !== undefined ? getIn(errors, `${enumValuesPath}[${index}].id`) as string | undefined : undefined;\n return <Dialog\n maxWidth=\"md\"\n aria-labelledby=\"enum-edit-dialog\"\n open={open}\n onOpenChange={(open) => !open ? onClose() : undefined}\n >\n <DialogTitle hidden>Enum form dialog</DialogTitle>\n <DialogContent>\n {index !== undefined &&\n <div>\n <Field name={`${enumValuesPath}[${index}].id`}\n as={DebouncedTextField}\n required\n label={\"ID\"}\n size=\"small\"\n autoComplete=\"off\"\n error={Boolean(idError)}/>\n\n <FieldCaption error={Boolean(idError)}>\n {idError ?? \"Value saved in the data source\"}\n </FieldCaption>\n </div>}\n </DialogContent>\n\n <DialogActions>\n <Button\n autoFocus\n onClick={onClose}>\n Ok\n </Button>\n </DialogActions>\n\n </Dialog>\n}\n\n","import React from \"react\";\n\nimport { BooleanSwitchWithLabel, Tooltip } from \"@rebasepro/ui\";\nimport { FormexFieldProps } from \"@rebasepro/formex\";\n\nexport function SwitchControl({\n field,\n form,\n label,\n tooltip,\n disabled,\n size = \"small\",\n allowIndeterminate\n}: FormexFieldProps & {\n label: string,\n tooltip?: string,\n disabled?: boolean,\n size?: \"small\" | \"medium\",\n allowIndeterminate?: boolean\n}) {\n\n const formControlLabel = <BooleanSwitchWithLabel\n label={label}\n size={size}\n position={\"start\"}\n value={field.value}\n disabled={disabled}\n allowIndeterminate={allowIndeterminate}\n onValueChange={(checked: boolean | null) => form.setFieldValue(field.name, checked)}/>;\n\n if (tooltip)\n return (\n <Tooltip\n title={tooltip}>\n {formControlLabel}\n </Tooltip>\n );\n return formControlLabel;\n}\n","import React from \"react\";\n\nimport { Field, FormexFieldProps, getIn, useFormex } from \"@rebasepro/formex\";\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/core\";\nimport { SwitchControl } from \"../../SwitchControl\";\n\nexport function GeneralPropertyValidation({ disabled }: {\n required?: boolean;\n disabled: boolean;\n}) {\n\n const { values, handleChange } = useFormex();\n const { t } = useTranslation();\n\n const validationRequired = \"validation.required\";\n const validationRequiredMessage = \"validation.requiredMessage\";\n const validationUnique = \"validation.unique\";\n const validationUniqueInArray = \"validation.uniqueInArray\";\n\n return (\n <>\n <div className={\"col-span-6\"}>\n <Field name={validationRequired}\n type=\"checkbox\">\n {({ field, form }: FormexFieldProps) => {\n return <SwitchControl\n disabled={disabled}\n label={t(\"required\")}\n tooltip={t(\"required_tooltip\")}\n form={form}\n field={field}/>\n }}\n </Field>\n </div>\n\n <div className={\"col-span-6\"}>\n\n <Field name={validationUnique}\n type=\"checkbox\">\n {({ field, form }: FormexFieldProps) => {\n return <SwitchControl\n disabled={disabled}\n label={t(\"unique\")}\n tooltip={t(\"unique_tooltip\")}\n form={form}\n field={field}/>\n }}\n </Field>\n </div>\n\n {getIn(values, validationRequired) && <div className={\"col-span-12\"}>\n <DebouncedTextField\n disabled={disabled}\n value={getIn(values, validationRequiredMessage) as string | undefined}\n label={t(\"required_message\")}\n name={validationRequiredMessage}\n size=\"small\"\n onChange={handleChange}/>\n </div>}\n </>\n );\n}\n","import { FieldCaption } from \"../../../../_cms_internals\";\nimport React from \"react\";\n\nimport { Field, FormexFieldProps, getIn, useFormex } from \"@rebasepro/formex\";\n;\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/core\";\nimport { GeneralPropertyValidation } from \"./GeneralPropertyValidation\";\nimport { SwitchControl } from \"../../SwitchControl\";\nimport { serializeRegExp } from \"@rebasepro/utils\";\n\nexport function StringPropertyValidation({\n length,\n lowercase,\n matches,\n max,\n min,\n trim,\n uppercase,\n disabled,\n showErrors\n}: {\n length?: boolean;\n min?: boolean;\n max?: boolean;\n trim?: boolean;\n matches?: boolean;\n lowercase?: boolean;\n uppercase?: boolean;\n disabled: boolean;\n showErrors: boolean;\n}) {\n\n const {\n values,\n handleChange,\n errors\n } = useFormex();\n const { t } = useTranslation();\n\n const validationLength = \"validation.length\";\n const validationMin = \"validation.min\";\n const validationMax = \"validation.max\";\n const validationTrim = \"validation.trim\";\n const validationMatches = \"validation.matches\";\n const validationLowercase = \"validation.lowercase\";\n const validationUppercase = \"validation.uppercase\";\n\n const matchesError = getIn(errors, validationMatches);\n\n const matchesValue = getIn(values, validationMatches);\n const matchesStringValue = typeof matchesValue === \"string\" ? matchesValue : serializeRegExp(matchesValue as RegExp);\n return (\n <div className={\"grid grid-cols-12 gap-2\"}>\n\n <GeneralPropertyValidation disabled={disabled}/>\n\n <div className={\"grid grid-cols-12 gap-2 col-span-12\"}>\n\n {lowercase && <div className={\"col-span-4\"}>\n <Field name={validationLowercase}\n type=\"checkbox\">\n {({ field, form }: FormexFieldProps) => {\n return <SwitchControl\n label={t(\"lowercase\")}\n disabled={disabled}\n form={form}\n field={field}/>\n }}\n </Field>\n </div>}\n\n {uppercase && <div className={\"col-span-4\"}>\n <Field name={validationUppercase}\n type=\"checkbox\">\n {({ field, form }: FormexFieldProps) => {\n return <SwitchControl\n label={t(\"uppercase\")}\n disabled={disabled}\n form={form}\n field={field}/>\n }}\n </Field>\n </div>}\n\n {trim && <div className={\"col-span-4\"}>\n <Field name={validationTrim}\n type=\"checkbox\">\n {({ field, form }: FormexFieldProps) => {\n return <SwitchControl\n label={t(\"trim\")}\n disabled={disabled}\n form={form}\n field={field}/>\n }}\n </Field>\n </div>}\n\n </div>\n\n <div className={\"grid grid-cols-12 gap-2 col-span-12\"}>\n {length && <div className={\"col-span-4\"}>\n <DebouncedTextField\n value={getIn(values, validationLength) as number | undefined}\n label={t(\"exact_length\")}\n name={validationLength}\n type=\"number\"\n size=\"small\"\n\n disabled={disabled}\n onChange={handleChange}/>\n </div>}\n\n {min && <div className={\"col-span-4\"}>\n <DebouncedTextField value={getIn(values, validationMin) as number | undefined}\n label={t(\"min_length\")}\n name={validationMin}\n type=\"number\"\n size=\"small\"\n\n disabled={disabled}\n onChange={handleChange}/>\n </div>}\n\n {max && <div className={\"col-span-4\"}>\n <DebouncedTextField value={getIn(values, validationMax) as number | undefined}\n label={t(\"max_length\")}\n name={validationMax}\n type=\"number\"\n size=\"small\"\n\n disabled={disabled}\n onChange={handleChange}/>\n </div>}\n\n </div>\n\n {matches && <div className={\"col-span-12\"}>\n <Field name={validationMatches}\n as={DebouncedTextField}\n label={t(\"matches_regex\")}\n size=\"small\"\n disabled={disabled}\n value={matchesStringValue}\n error={Boolean(matchesError)}/>\n <FieldCaption error={Boolean(matchesError)}>\n {matchesError ? t(\"not_valid_regexp\") : t(\"regex_helper\")}\n </FieldCaption>\n </div>}\n\n </div>\n );\n\n}\n","import React from \"react\";\n\nimport { getIn, useFormex } from \"@rebasepro/formex\";\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/core\";\nimport { GeneralPropertyValidation } from \"./GeneralPropertyValidation\";\n\nexport function ArrayPropertyValidation({\n max = true,\n min = true,\n disabled\n}: {\n min?: boolean;\n max?: boolean;\n disabled: boolean;\n}) {\n\n const {\n values,\n handleChange\n } = useFormex();\n const { t } = useTranslation();\n\n const validationMin = \"validation.min\";\n const validationMax = \"validation.max\";\n\n return (\n <div className={\"grid grid-cols-12 gap-2\"}>\n\n <GeneralPropertyValidation disabled={disabled}/>\n\n {min && <div className={\"col-span-6\"}>\n <DebouncedTextField value={getIn(values, validationMin) as number | undefined}\n disabled={disabled}\n label={t(\"min_length\")}\n name={validationMin}\n type=\"number\"\n size=\"small\"\n onChange={handleChange}/>\n </div>}\n {max && <div className={\"col-span-6\"}>\n <DebouncedTextField value={getIn(values, validationMax) as number | undefined}\n disabled={disabled}\n label={t(\"max_length\")}\n name={validationMax}\n type=\"number\"\n size=\"small\"\n onChange={handleChange}/>\n </div>}\n </div>\n );\n}\n","import { PropsWithChildren } from \"react\";\n\nimport { CheckSquareIcon, ExpandablePanel, Typography } from \"@rebasepro/ui\";\n\nexport function ValidationPanel({\n children\n}: { children?: React.ReactNode }) {\n\n return (\n <ExpandablePanel\n initiallyExpanded={false}\n asField={true}\n innerClassName=\"p-4\"\n title={\n <div className=\"flex flex-row text-surface-500 text-text-secondary dark:text-text-secondary-dark\">\n <CheckSquareIcon/>\n <Typography variant={\"subtitle2\"}\n className=\"ml-4\">\n Validation\n </Typography>\n </div>\n }>\n\n {children}\n\n </ExpandablePanel>\n )\n}\n","import React, { useMemo } from \"react\";\nimport { getIn, useFormex } from \"@rebasepro/formex\";\nimport { useTranslation } from \"@rebasepro/core\";\nimport { useSafeSnackbarController } from \"../../../useSafeSnackbarController\";\nimport { EnumValueConfig, EnumValues } from \"@rebasepro/types\";\nimport { resolveEnumValues } from \"@rebasepro/common\";\nimport { Select, SelectItem } from \"@rebasepro/ui\";\nimport { EnumForm } from \"../EnumForm\";\nimport { StringPropertyValidation } from \"./validation/StringPropertyValidation\";\nimport { ArrayPropertyValidation } from \"./validation/ArrayPropertyValidation\";\nimport { ValidationPanel } from \"./validation/ValidationPanel\";\nimport { PropertyWithId } from \"../PropertyEditView\";\n\nexport function EnumPropertyField({\n multiselect,\n updateIds,\n disabled,\n showErrors,\n allowDataInference,\n getData,\n propertyNamespace\n}: {\n multiselect: boolean;\n updateIds: boolean;\n disabled: boolean;\n showErrors: boolean;\n allowDataInference?: boolean;\n getData?: () => Promise<object[]>;\n propertyNamespace?: string;\n}) {\n\n const {\n values,\n setFieldError,\n setFieldValue\n } = useFormex<PropertyWithId>();\n\n const snackbarContext = useSafeSnackbarController();\n const { t } = useTranslation();\n\n const enumValuesPath = multiselect ? \"of.enum\" : \"enum\";\n\n const defaultValue = getIn(values, \"defaultValue\") as string | number | undefined;\n\n const valuesEnumValues = getIn(values, enumValuesPath) as EnumValues | undefined;\n const enumValues: EnumValueConfig[] = useMemo(() => {\n if (!valuesEnumValues || typeof valuesEnumValues === \"boolean\")\n return [] as EnumValueConfig[];\n return resolveEnumValues(valuesEnumValues) ?? [] as EnumValueConfig[];\n }, [valuesEnumValues]);\n\n const onValuesChanged = (value: EnumValueConfig[]) => {\n if (!values)\n return;\n setFieldValue(enumValuesPath, value);\n if (!multiselect) {\n const enumIds = value.filter(v => Boolean(v?.id)).map((v: EnumValueConfig) => v.id);\n if (defaultValue && !enumIds.includes(defaultValue)) {\n setFieldValue(\"defaultValue\", undefined);\n snackbarContext?.open({\n type: \"warning\",\n message: \"Default value was cleared\"\n })\n }\n }\n };\n\n // Build full path including namespace for nested properties (e.g., \"address.status\")\n const fullPropertyPath = values.id\n ? (propertyNamespace ? `${propertyNamespace}.${values.id}` : values.id)\n : undefined;\n\n return (\n <>\n <div className={\"col-span-12\"}>\n <EnumForm enumValues={enumValues}\n updateIds={updateIds}\n disabled={disabled}\n allowDataInference={allowDataInference}\n onError={(hasError) => {\n setFieldError(enumValuesPath, hasError ? \"This enum property is missing some values\" : undefined);\n }}\n getData={getData && fullPropertyPath\n ? () => getData()\n .then(res => res.map(entry => getIn(entry, fullPropertyPath) as string).filter(Boolean))\n : undefined}\n onValuesChanged={onValuesChanged}/>\n </div>\n\n <div className={\"col-span-12\"}>\n\n <ValidationPanel>\n {!multiselect &&\n <StringPropertyValidation disabled={disabled}\n showErrors={showErrors}/>}\n {multiselect &&\n <ArrayPropertyValidation disabled={disabled}/>}\n </ValidationPanel>\n\n </div>\n\n {!multiselect && <div className={\"col-span-12\"}>\n\n <Select\n disabled={disabled}\n position={\"item-aligned\"}\n fullWidth={true}\n onValueChange={(value: string) => {\n setFieldValue(\"defaultValue\", value);\n }}\n label={t(\"default_value\")}\n value={defaultValue?.toString() ?? \"\"}>\n {enumValues\n .filter((enumValue) => Boolean(enumValue?.id))\n .map((enumValue) => (\n <SelectItem key={enumValue.id}\n value={enumValue.id?.toString()}>\n {enumValue.label}\n </SelectItem>\n ))}\n </Select>\n\n </div>}\n </>\n );\n}\n","\nimport React from \"react\";\nimport {\n Button,\n DebouncedTextField,\n ExpandablePanel,\n MultiSelect,\n MultiSelectItem,\n Select,\n SelectItem,\n Typography,\n UploadCloudIcon\n} from \"@rebasepro/ui\";\n\nimport { Field, FormexFieldProps, getIn, useFormex } from \"@rebasepro/formex\";\nimport { useTranslation } from \"@rebasepro/core\";\nimport { GeneralPropertyValidation } from \"./validation/GeneralPropertyValidation\";\nimport { ArrayPropertyValidation } from \"./validation/ArrayPropertyValidation\";\nimport { ValidationPanel } from \"./validation/ValidationPanel\";\nimport { SwitchControl } from \"../SwitchControl\";\n\nconst fileTypes: Record<string, string> = {\n \"image/*\": \"Images\",\n \"video/*\": \"Videos\",\n \"audio/*\": \"Audio files\",\n \"application/*\": \"Files (pdf, zip, csv, excel...)\",\n \"text/*\": \"Text files\"\n}\n\nexport function StoragePropertyField({\n multiple,\n existing,\n disabled\n}: {\n multiple: boolean;\n existing: boolean;\n disabled: boolean;\n}) {\n\n const {\n values,\n setFieldValue\n } = useFormex();\n const { t } = useTranslation();\n\n const baseStoragePath = multiple ? \"of.storage\" : \"storage\";\n const acceptedFiles = `${baseStoragePath}.acceptedFiles`;\n\n const metadata = `${baseStoragePath}.metadata`;\n const fileName = `${baseStoragePath}.fileName`;\n const maxSize = `${baseStoragePath}.maxSize`;\n const storagePath = `${baseStoragePath}.storagePath`;\n const storeUrl = `${baseStoragePath}.storeUrl`;\n const includeBucketUrl = `${baseStoragePath}.includeBucketUrl`;\n\n // Image resize config paths\n const imageResize = `${baseStoragePath}.imageResize`;\n const imageResizeMaxWidth = `${imageResize}.maxWidth`;\n const imageResizeMaxHeight = `${imageResize}.maxHeight`;\n const imageResizeMode = `${imageResize}.mode`;\n const imageResizeFormat = `${imageResize}.format`;\n const imageResizeQuality = `${imageResize}.quality`;\n\n const fileNameValue = (getIn(values, fileName) as string | undefined) ?? \"{rand}_{file}\";\n const storagePathValue = (getIn(values, storagePath) as string | undefined) ?? \"/\";\n const maxSizeValue = getIn(values, maxSize) as number | undefined;\n\n // Image resize values\n const imageResizeMaxWidthValue = getIn(values, imageResizeMaxWidth) as number | undefined;\n const imageResizeMaxHeightValue = getIn(values, imageResizeMaxHeight) as number | undefined;\n const imageResizeModeValue = (getIn(values, imageResizeMode) as string | undefined) ?? \"cover\";\n const imageResizeFormatValue = (getIn(values, imageResizeFormat) as string | undefined) ?? \"original\";\n const imageResizeQualityValue = getIn(values, imageResizeQuality) as number | undefined;\n\n const storedValue = getIn(values, acceptedFiles);\n const fileTypesValue: string[] | undefined = Array.isArray(storedValue) ? storedValue : undefined;\n const allFileTypesSelected = !fileTypesValue || fileTypesValue.length === 0;\n\n const handleTypesChange = (value: string[]) => {\n if (!value) setFieldValue(acceptedFiles, undefined);\n else setFieldValue(acceptedFiles, value);\n };\n\n const hasFilenameCallback = typeof fileNameValue === \"function\";\n const hasStoragePathCallback = typeof storagePathValue === \"function\";\n\n return (\n <>\n\n <div className={\"col-span-12\"}>\n\n <ExpandablePanel\n title={\n <div className=\"flex flex-row text-surface-500 text-text-secondary dark:text-text-secondary-dark\">\n <UploadCloudIcon/>\n <Typography variant={\"subtitle2\"}\n className=\"ml-4\">\n File upload config\n </Typography>\n </div>\n }>\n\n <div className={\"grid grid-cols-12 gap-2 p-4\"}>\n\n <div className={\"col-span-12\"}>\n\n <MultiSelect\n className={\"w-full\"}\n placeholder={\"All file types allowed\"}\n disabled={disabled}\n name={acceptedFiles}\n value={fileTypesValue ?? []}\n onValueChange={handleTypesChange}\n label={allFileTypesSelected ? undefined : \"Allowed file types\"}\n renderValues={(selected: string[]) => {\n if (!selected || selected.length === 0) return \"All file types allowed\";\n return selected.map((v: string) => fileTypes[v])\n .filter((v: string) => Boolean(v))\n .join(\", \");\n }}>\n\n {Object.entries(fileTypes).map(([value, label]) => (\n <MultiSelectItem key={value} value={value} className={\"flex items-center gap-2\"}>\n {/*<Checkbox*/}\n {/* checked={allFileTypesSelected || fileTypesValue.indexOf(value) > -1}/>*/}\n <div className={\"grow\"}>\n {label}\n </div>\n <Button size={\"small\"}\n variant={\"text\"}\n onClick={(e: React.MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n return setFieldValue(acceptedFiles, [value]);\n }}>\n Only\n </Button>\n </MultiSelectItem>\n ))}\n\n </MultiSelect>\n </div>\n\n <div className={\"col-span-12\"}>\n <Field name={fileName}\n as={DebouncedTextField}\n label={t(\"storage_file_name\")}\n size={\"small\"}\n disabled={hasFilenameCallback || disabled}\n value={hasFilenameCallback ? \"-\" : fileNameValue}\n />\n </div>\n <div className={\"col-span-12\"}>\n <Field name={storagePath}\n as={DebouncedTextField}\n label={t(\"storage_path\")}\n disabled={hasStoragePathCallback || disabled}\n size={\"small\"}\n value={hasStoragePathCallback ? \"-\" : storagePathValue}\n />\n <Typography variant={\"caption\"} className={\"ml-3.5 mt-1 mb-2\"}>\n <p>You can use the following placeholders in\n the file name\n and storage path values:</p>\n <ul>\n <li>{\"{file} - Full name of the uploaded file\"}</li>\n <li>{\"{file.name} - Name of the uploaded file without extension\"}</li>\n <li>{\"{file.ext} - Extension of the uploaded file\"}</li>\n <li>{\"{entityId} - ID of the entity\"}</li>\n <li>{\"{propertyKey} - ID of this field\"}</li>\n <li>{\"{path} - Path of this entity\"}</li>\n <li>{\"{rand} - Random value used to avoid name collisions\"}</li>\n </ul>\n </Typography>\n\n <Field name={includeBucketUrl}\n type=\"checkbox\">\n {({\n field,\n form\n }: FormexFieldProps) => {\n return <SwitchControl\n label={t(\"storage_include_bucket_url\")}\n disabled={existing || disabled}\n form={form}\n field={field}/>;\n }}\n </Field>\n\n <Typography variant={\"caption\"} className={\"ml-3.5 mt-1 mb-2\"}>\n Turn this setting on if you want to save a fully-qualified storage URL\n (e.g. <code>s3://my-bucket/path/to/file</code>) instead of just the storage path.\n You can only change this prop upon creation.\n </Typography>\n\n <Field name={storeUrl}\n type=\"checkbox\">\n {({\n field,\n form\n }: FormexFieldProps) => {\n return <SwitchControl\n label={t(\"storage_save_url\")}\n disabled={existing || disabled}\n form={form}\n field={field}/>;\n }}\n </Field>\n\n <Typography variant={\"caption\"} className={\"ml-3.5 mt-1 mb-2\"}>\n Turn this setting on, if you prefer to save\n the download\n URL of the uploaded file instead of the\n storage path.\n You can only change this prop upon creation.\n </Typography>\n </div>\n\n <div className={\"col-span-12\"}>\n <DebouncedTextField name={maxSize}\n type={\"number\"}\n label={t(\"storage_max_size\")}\n size={\"small\"}\n value={maxSizeValue !== undefined && maxSizeValue !== null ? maxSizeValue.toString() : \"\"}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const value = e.target.value;\n if (value === \"\") setFieldValue(maxSize, undefined);\n else setFieldValue(maxSize, parseInt(value));\n }}\n />\n </div>\n\n <div className={\"col-span-12 mt-4\"}>\n <Typography variant={\"subtitle2\"}\n color={\"secondary\"}\n className={\"mb-2 block\"}>\n Image Resize Configuration\n </Typography>\n <Typography variant={\"caption\"} className={\"mb-2 block text-xs\"}>\n Automatically resize and optimize images before upload (JPEG, PNG, WebP only)\n </Typography>\n </div>\n\n <div className={\"col-span-6\"}>\n <DebouncedTextField\n name={imageResizeMaxWidth}\n type={\"number\"}\n label={t(\"storage_max_width\")}\n size={\"small\"}\n disabled={disabled}\n value={imageResizeMaxWidthValue !== undefined && imageResizeMaxWidthValue !== null ? imageResizeMaxWidthValue.toString() : \"\"}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const value = e.target.value;\n if (value === \"\") setFieldValue(imageResizeMaxWidth, undefined);\n else setFieldValue(imageResizeMaxWidth, parseInt(value));\n }}\n />\n </div>\n\n <div className={\"col-span-6\"}>\n <DebouncedTextField\n name={imageResizeMaxHeight}\n type={\"number\"}\n label={t(\"storage_max_height\")}\n size={\"small\"}\n disabled={disabled}\n value={imageResizeMaxHeightValue !== undefined && imageResizeMaxHeightValue !== null ? imageResizeMaxHeightValue.toString() : \"\"}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const value = e.target.value;\n if (value === \"\") setFieldValue(imageResizeMaxHeight, undefined);\n else setFieldValue(imageResizeMaxHeight, parseInt(value));\n }}\n />\n </div>\n\n <div className={\"col-span-6\"}>\n <Select\n disabled={disabled}\n name={imageResizeMode}\n fullWidth\n size={\"medium\"}\n value={imageResizeModeValue || \"cover\"}\n onValueChange={(value) => setFieldValue(imageResizeMode, value || \"cover\")}\n label={t(\"storage_resize_mode\")}\n renderValue={(selected) => {\n if (!selected) return \"Cover\";\n return selected === \"contain\" ? \"Contain (fit within bounds)\" : \"Cover (fill bounds, may crop)\";\n }}>\n <SelectItem value=\"contain\">\n Contain (fit within bounds)\n </SelectItem>\n <SelectItem value=\"cover\">\n Cover (fill bounds, may crop)\n </SelectItem>\n </Select>\n </div>\n\n <div className={\"col-span-6\"}>\n <Select\n disabled={disabled}\n size={\"medium\"}\n fullWidth\n name={imageResizeFormat}\n value={imageResizeFormatValue || \"original\"}\n onValueChange={(value) => setFieldValue(imageResizeFormat, value || \"original\")}\n label={t(\"storage_output_format\")}\n renderValue={(selected) => {\n if (!selected) return \"Original\";\n return selected.charAt(0).toUpperCase() + selected.slice(1);\n }}>\n <SelectItem value=\"original\">\n Original (keep same format)\n </SelectItem>\n <SelectItem value=\"jpeg\">\n JPEG\n </SelectItem>\n <SelectItem value=\"png\">\n PNG\n </SelectItem>\n <SelectItem value=\"webp\">\n WebP (best compression)\n </SelectItem>\n </Select>\n </div>\n\n <div className={\"col-span-12\"}>\n <DebouncedTextField\n name={imageResizeQuality}\n type={\"number\"}\n label={t(\"storage_quality\")}\n size={\"small\"}\n disabled={disabled}\n value={imageResizeQualityValue !== undefined && imageResizeQualityValue !== null ? imageResizeQualityValue.toString() : \"\"}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const value = e.target.value;\n if (value === \"\") setFieldValue(imageResizeQuality, undefined);\n else {\n const numValue = parseInt(value);\n if (numValue >= 0 && numValue <= 100) {\n setFieldValue(imageResizeQuality, numValue);\n }\n }\n }}\n />\n <Typography variant={\"caption\"} className={\"ml-3.5 mt-1 mb-2\"}>\n Higher quality = larger file size. Recommended: 80-90 for photos, 90-100 for graphics\n </Typography>\n </div>\n\n </div>\n </ExpandablePanel>\n\n </div>\n\n <div className={\"col-span-12\"}>\n\n <ValidationPanel>\n {!multiple && <div className={\"grid grid-cols-12 gap-2\"}>\n <GeneralPropertyValidation disabled={disabled}/>\n </div>}\n {multiple && <div className={\"col-span-12\"}>\n <ArrayPropertyValidation disabled={disabled}/>\n </div>}\n </ValidationPanel>\n\n </div>\n </>\n );\n}\n","import { useCustomizationController } from \"@rebasepro/core\";\nimport { getFieldConfig } from \"../../../components/field_configs\";\nimport { PropertyConfigBadge } from \"../../../components/PropertyConfigBadge\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\nimport { Property } from \"@rebasepro/types\";\nimport { isPropertyBuilder } from \"@rebasepro/common\";\nimport { cls, Paper, Typography } from \"@rebasepro/ui\";\nimport { FunctionSquareIcon, iconSize, MinusCircleIcon } from \"@rebasepro/ui\";\n\n\nexport function PropertyFieldPreview({\n property,\n propertyKey,\n onClick,\n hasError,\n includeName,\n includeEditButton,\n selected\n}: {\n property: Property,\n propertyKey?: string,\n hasError?: boolean,\n selected?: boolean,\n includeName?: boolean,\n includeEditButton?: boolean;\n onClick?: () => void\n}) {\n\n const { propertyConfigs } = useCustomizationController();\n const propertyConfig = getFieldConfig(property, propertyConfigs);\n\n\n const borderColorClass = hasError\n ? \"border-red-500 dark:border-red-500 border-red-500/100 dark:border-red-500/100 ring-0 dark:ring-0\"\n : (selected ? \"border-primary\" : \"\");\n\n return <ErrorBoundary>\n <div onClick={onClick} className={onClick ? \"cursor-pointer\" : \"\"}>\n <div\n className={cls(\n \"w-full flex flex-row gap-3 items-center px-3 py-2 rounded-lg transition-all duration-200 border bg-white dark:bg-surface-900 shadow-xs\",\n borderColorClass || \"border-surface-200 dark:border-surface-700\",\n selected\n ? \"bg-primary/10 text-primary dark:bg-primary/20 dark:text-primary-light ring-1 ring-inset ring-primary border-primary/30\"\n : \"hover:bg-surface-50 dark:hover:bg-surface-700\"\n )}\n >\n <PropertyConfigBadge propertyConfig={propertyConfig} size=\"small\"/>\n\n <div className=\"flex-1 flex flex-col min-w-0 pr-8\">\n {includeName &&\n <ErrorBoundary>\n <div className=\"flex items-center gap-2\">\n <Typography variant=\"body2\" component=\"span\">\n {property.name || propertyKey || \"\\u00a0\"}\n </Typography>\n {property.name && propertyKey && property.name !== propertyKey && (\n <Typography variant=\"caption\" component=\"span\" color=\"secondary\" className=\"font-mono\">\n {propertyKey}\n </Typography>\n )}\n </div>\n </ErrorBoundary>}\n\n <div className=\"flex flex-row items-center gap-2 mt-0.5\">\n <ErrorBoundary>\n <Typography\n variant={\"caption\"}\n component=\"span\"\n className=\"text-text-secondary dark:text-text-secondary-dark font-medium\">\n {propertyConfig?.name}\n </Typography>\n </ErrorBoundary>\n </div>\n </div>\n\n <ErrorBoundary>\n <Typography variant=\"caption\" component=\"span\" className=\"ml-auto shrink-0 text-text-disabled dark:text-text-disabled-dark font-mono bg-surface-100 dark:bg-surface-900 px-1.5 py-0.5 rounded mr-8\">\n {\"columnType\" in property ? (property as { columnType?: string }).columnType ?? property.type : property.type}\n </Typography>\n </ErrorBoundary>\n\n {includeEditButton && <Typography variant={\"button\"}>EDIT</Typography>}\n </div>\n </div>\n </ErrorBoundary>\n}\n\nexport function NonEditablePropertyPreview({\n name,\n selected,\n onClick,\n property\n}: {\n name: string,\n selected: boolean,\n onClick?: () => void,\n property?: Property\n}) {\n\n const { propertyConfigs } = useCustomizationController();\n const propertyConfig = !isPropertyBuilder(property) && property ? getFieldConfig(property, propertyConfigs) : undefined;\n\n return (\n <div onClick={onClick} className={onClick ? \"cursor-pointer\" : \"\"}>\n <div\n className={cls(\n \"w-full flex flex-row gap-3 items-center px-3 py-2 rounded-lg transition-all duration-200 border bg-white dark:bg-surface-900 border-surface-200 dark:border-surface-700 shadow-xs\",\n selected\n ? \"bg-primary/10 text-primary dark:bg-primary/20 dark:text-primary-light ring-1 ring-inset ring-primary border-primary/30\"\n : \"hover:bg-surface-50 dark:hover:bg-surface-700\"\n )}\n >\n <div className={\"relative shrink-0\"}>\n {propertyConfig && <PropertyConfigBadge propertyConfig={propertyConfig} size=\"small\"/>}\n {!propertyConfig && <div\n className={\"h-8 w-8 flex items-center justify-center rounded-full shadow-2xs text-white bg-surface-500\"}>\n <FunctionSquareIcon className={\"text-inherit\"} size={iconSize.small}/>\n </div>}\n <MinusCircleIcon className={\"text-surface-accent-400 absolute -right-2 -top-2 bg-surface-50 dark:bg-surface-900 rounded-full\"} size={iconSize.small}/>\n </div>\n\n <div className=\"flex-1 flex flex-col min-w-0 pr-8\">\n <Typography variant=\"label\" component=\"span\" className=\"grow pr-2\">\n {property?.name ? property.name : name}\n </Typography>\n\n <div className=\"flex flex-row items-center gap-2 mt-0.5\">\n {propertyConfig && <Typography variant={\"caption\"} component=\"span\" className=\"text-text-secondary dark:text-text-secondary-dark font-medium\">\n {propertyConfig?.name}\n </Typography>}\n\n {property && isPropertyBuilder(property) && <ErrorBoundary>\n <Typography variant=\"caption\" component=\"span\" className=\"text-text-disabled dark:text-text-disabled-dark\">\n Defined in code\n </Typography>\n </ErrorBoundary>}\n\n {!property && <ErrorBoundary>\n <Typography variant=\"caption\" component=\"span\" className=\"text-text-disabled dark:text-text-disabled-dark\">\n Additional field\n </Typography>\n </ErrorBoundary>}\n </div>\n </div>\n\n {property && !isPropertyBuilder(property) && <ErrorBoundary>\n <Typography variant=\"caption\" component=\"span\" className=\"ml-auto shrink-0 text-text-disabled dark:text-text-disabled-dark font-mono bg-surface-100 dark:bg-surface-900 px-1.5 py-0.5 rounded mr-8\">\n {\"columnType\" in property ? (property as { columnType?: string }).columnType ?? property.type : property.type}\n </Typography>\n </ErrorBoundary>}\n </div>\n </div>\n )\n}\n","import React, { createContext, useCallback, useContext, useState, useMemo } from \"react\";\nimport { CollectionOperation } from \"../../api/generateCollectionApi\";\n\nexport interface AIModifiedPathsContextType {\n /** Set of paths that were modified by AI */\n modifiedPaths: Set<string>;\n /** Counter that increments each time AI modifies the collection - use in keys to force remount */\n generationCounter: number;\n /** Add paths from operations */\n addModifiedPaths: (operations: CollectionOperation[]) => void;\n /** Clear a specific path (when user edits that field) */\n clearPath: (path: string) => void;\n /** Clear all paths (on save or cancel) */\n clearAllPaths: () => void;\n /** Check if a path is modified */\n isPathModified: (path: string) => boolean;\n}\n\nconst AIModifiedPathsContext = createContext<AIModifiedPathsContextType | null>(null);\n\nexport function AIModifiedPathsProvider({ children }: { children: React.ReactNode | any }) {\n const [modifiedPaths, setModifiedPaths] = useState<Set<string>>(new Set());\n const [generationCounter, setGenerationCounter] = useState(0);\n\n const addModifiedPaths = useCallback((operations: CollectionOperation[]) => {\n setModifiedPaths(prev => {\n const newSet = new Set(prev);\n operations.forEach(op => {\n // Add the path and all parent paths for nested modifications\n newSet.add(op.path);\n // For properties modifications, also mark the property itself\n // e.g., \"properties.email.description\" -> also adds \"properties.email\"\n const parts = op.path.split(\".\");\n if (parts[0] === \"properties\" && parts.length >= 2) {\n newSet.add(`properties.${parts[1]}`);\n }\n });\n return newSet;\n });\n // Increment counter to force property form remount\n setGenerationCounter(prev => prev + 1);\n }, []);\n\n const clearPath = useCallback((path: string) => {\n setModifiedPaths(prev => {\n const newSet = new Set(prev);\n // Remove exact path and any child paths\n for (const p of newSet) {\n if (p === path || p.startsWith(path + \".\")) {\n newSet.delete(p);\n }\n }\n return newSet;\n });\n }, []);\n\n const clearAllPaths = useCallback(() => {\n setModifiedPaths(new Set());\n }, []);\n\n const isPathModified = useCallback((path: string): boolean => {\n // Check if this exact path or any parent path is modified\n if (modifiedPaths.has(path)) return true;\n // Check if any child paths are modified\n for (const p of modifiedPaths) {\n if (p.startsWith(path + \".\")) return true;\n }\n return false;\n }, [modifiedPaths]);\n\n const contextValue = useMemo(() => ({\n modifiedPaths,\n generationCounter,\n addModifiedPaths,\n clearPath,\n clearAllPaths,\n isPathModified\n }), [modifiedPaths, generationCounter, addModifiedPaths, clearPath, clearAllPaths, isPathModified]);\n\n return (\n <AIModifiedPathsContext.Provider value={contextValue}>\n {children}\n </AIModifiedPathsContext.Provider>\n );\n}\n\nexport function useAIModifiedPaths(): AIModifiedPathsContextType | null {\n return useContext(AIModifiedPathsContext);\n}\n\n","\nimport React from \"react\";\nimport { deepEqual as equal } from \"fast-equals\"\n\nimport { AIModifiedIndicator } from \"@rebasepro/core\";\nimport { AdditionalFieldDelegate, Properties, Property } from \"@rebasepro/types\";\nimport { isPropertyBuilder } from \"@rebasepro/common\";\nimport {\n ArrowDownToLineIcon,\n ArrowUpToLineIcon,\n cls,\n defaultBorderMixin,\n FileSearchIcon,\n IconButton,\n iconSize,\n Menu,\n MenuItem,\n MoreVerticalIcon,\n Tooltip,\n Trash2Icon\n} from \"@rebasepro/ui\";\nimport { NonEditablePropertyPreview, PropertyFieldPreview } from \"./PropertyFieldPreview\";\nimport {\n closestCenter,\n DndContext,\n DragEndEvent,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n sortableKeyboardCoordinates,\n useSortable,\n verticalListSortingStrategy\n} from \"@dnd-kit/sortable\";\nimport { restrictToVerticalAxis } from \"@dnd-kit/modifiers\";\n\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { getFullId, getFullIdPath } from \"./util\";\n\nimport { useAIModifiedPaths } from \"./AIModifiedPathsContext\";\n\nexport const PropertyTree = React.memo(\n function PropertyTree<M extends {\n [Key: string]: unknown\n }>({\n namespace,\n selectedPropertyKey,\n onPropertyClick,\n properties,\n propertiesOrder: propertiesOrderProp,\n additionalFields,\n errors,\n onPropertyMove,\n onPropertyRemove,\n className,\n inferredPropertyKeys\n }: {\n namespace?: string;\n selectedPropertyKey?: string;\n onPropertyClick?: (propertyKey: string, namespace?: string) => void;\n properties: Properties;\n propertiesOrder?: string[];\n additionalFields?: AdditionalFieldDelegate<M>[];\n errors: Record<string, any>;\n onPropertyMove?: (propertiesOrder: string[], namespace?: string) => void;\n onPropertyRemove?: (propertyKey: string, namespace?: string) => void;\n className?: string;\n inferredPropertyKeys?: string[];\n }) {\n\n // Filter propertiesOrder to only include top-level keys (no dots) that exist in properties\n // Nested keys like \"data.mode\" are for column ordering in the table, not for the property editor\n const propertyKeys = Object.keys(properties);\n const filteredOrder = (propertiesOrderProp ?? propertyKeys)\n .filter(key => !key.includes(\".\") && properties[key as keyof typeof properties]);\n\n // Ensure all properties are included (append any missing ones)\n const missingKeys = propertyKeys.filter(key => !filteredOrder.includes(key));\n const propertiesOrder = [...filteredOrder, ...missingKeys];\n\n const sensors = useSensors(\n useSensor(PointerSensor, {\n activationConstraint: {\n distance: 5\n }\n }),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates\n })\n );\n\n const handleDragEnd = (event: DragEndEvent) => {\n const {\n active,\n over\n } = event;\n\n if (!over || active.id === over.id) {\n return;\n }\n\n const activeId = String(active.id);\n const overId = String(over.id);\n\n // Extract property keys from the full IDs\n const activeKey = activeId.includes(\".\") ? activeId.split(\".\").pop() : activeId;\n const overKey = overId.includes(\".\") ? overId.split(\".\").pop() : overId;\n\n if (!activeKey || !overKey) return;\n\n const oldIndex = propertiesOrder.indexOf(activeKey);\n const newIndex = propertiesOrder.indexOf(overKey);\n\n if (oldIndex !== -1 && newIndex !== -1) {\n const newPropertiesOrder = [...propertiesOrder];\n const [removed] = newPropertiesOrder.splice(oldIndex, 1);\n newPropertiesOrder.splice(newIndex, 0, removed);\n\n if (onPropertyMove) {\n onPropertyMove(newPropertiesOrder, namespace);\n }\n }\n };\n\n const items = propertiesOrder.map(key => getFullId(key, namespace));\n\n return (\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragEnd={handleDragEnd}\n modifiers={[restrictToVerticalAxis]}\n >\n <SortableContext\n items={items}\n strategy={verticalListSortingStrategy}\n >\n <div className={cls(\"flex flex-col gap-0.5\", className)}>\n\n {propertiesOrder && propertiesOrder\n .map((propertyKey: string, index: number) => {\n const property = properties[propertyKey];\n const additionalField = additionalFields?.find(field => field.key === propertyKey);\n\n if (!property && !additionalField) {\n console.warn(`Property ${propertyKey} not found in properties or additionalFields`);\n return null;\n }\n\n const id = getFullId(propertyKey, namespace);\n\n return (\n <PropertyTreeEntry\n key={id}\n id={id}\n propertyKey={propertyKey}\n property={property}\n additionalField={additionalField}\n errors={errors}\n namespace={namespace}\n propertiesOrder={propertiesOrder}\n inferredPropertyKeys={inferredPropertyKeys}\n onPropertyMove={onPropertyMove}\n onPropertyRemove={onPropertyRemove}\n onPropertyClick={onPropertyClick}\n selectedPropertyKey={selectedPropertyKey}\n\n />\n );\n }).filter(Boolean)}\n </div>\n </SortableContext>\n </DndContext>\n );\n },\n equal\n);\n\nexport function PropertyTreeEntry({\n id,\n propertyKey,\n namespace,\n property,\n additionalField,\n selectedPropertyKey,\n errors,\n propertiesOrder,\n onPropertyClick,\n onPropertyMove,\n onPropertyRemove,\n inferredPropertyKeys\n}: {\n id: string;\n propertyKey: string;\n namespace?: string;\n property: Property;\n additionalField?: AdditionalFieldDelegate<any>;\n selectedPropertyKey?: string;\n errors: Record<string, any>;\n propertiesOrder: string[];\n onPropertyClick?: (propertyKey: string, namespace?: string) => void;\n onPropertyMove?: (propertiesOrder: string[], namespace?: string) => void;\n onPropertyRemove?: (propertyKey: string, namespace?: string) => void;\n inferredPropertyKeys?: string[];\n}) {\n\n const {\n attributes,\n listeners,\n setNodeRef,\n transform,\n transition,\n isDragging\n } = useSortable({\n id\n });\n\n const style = {\n // Key change: use Translate instead of Transform to prevent stretching\n transform: CSS.Translate.toString(transform),\n transition,\n zIndex: isDragging ? 10 : undefined,\n position: \"relative\" as const\n };\n\n const isPropertyInferred = inferredPropertyKeys?.includes(namespace ? `${namespace}.${propertyKey}` : propertyKey);\n const fullId = id;\n const fullIdPath = getFullIdPath(propertyKey, namespace);\n const hasError = fullIdPath in errors;\n\n let subtree;\n if (typeof property === \"object\") {\n if (property.type === \"map\" && property.properties) {\n subtree = <PropertyTree\n selectedPropertyKey={selectedPropertyKey}\n namespace={fullId}\n properties={property.properties}\n propertiesOrder={property.propertiesOrder}\n errors={errors}\n onPropertyClick={onPropertyClick}\n onPropertyMove={onPropertyMove}\n onPropertyRemove={onPropertyRemove}\n inferredPropertyKeys={inferredPropertyKeys}\n />\n }\n }\n\n const selected = selectedPropertyKey === fullId;\n const editable = property && !isPropertyBuilder(property);\n\n // Check if this property was AI-modified\n const aiModifiedPaths = useAIModifiedPaths();\n const isAIModified = aiModifiedPaths?.isPathModified(`properties.${propertyKey}`) ?? false;\n\n return (\n <div\n ref={setNodeRef}\n style={style}\n className=\"relative cursor-grab\"\n {...attributes}\n {...listeners}\n >\n <div className=\"relative\">\n {subtree && <div\n className={\"absolute border-l \" + defaultBorderMixin}\n style={{\n left: \"24px\",\n top: \"40px\",\n bottom: \"16px\"\n }}/>}\n\n <div>\n {!isPropertyBuilder(property) && !additionalField && editable\n ? <PropertyFieldPreview\n property={property}\n propertyKey={propertyKey}\n onClick={onPropertyClick ? () => onPropertyClick(propertyKey, namespace) : undefined}\n includeName={true}\n selected={selected}\n hasError={hasError}/>\n : <NonEditablePropertyPreview name={propertyKey}\n property={property}\n onClick={onPropertyClick ? () => onPropertyClick(propertyKey, namespace) : undefined}\n selected={selected}/>}\n </div>\n\n <div className=\"absolute top-1/2 -translate-y-1/2 right-3 flex flex-row items-center gap-1\">\n {isAIModified && <AIModifiedIndicator/>}\n {isPropertyInferred && <>\n <Tooltip title={\"Inferred property\"} asChild={true}>\n <IconButton size=\"smallest\" disabled>\n <FileSearchIcon size={iconSize.smallest}/>\n </IconButton>\n </Tooltip>\n {onPropertyRemove && <Tooltip title={\"Remove inferred property\"}\n asChild={true}>\n <IconButton size=\"smallest\"\n color=\"inherit\"\n onClick={(e: React.MouseEvent) => {\n e.stopPropagation();\n onPropertyRemove(propertyKey, namespace);\n }}>\n <Trash2Icon size={iconSize.smallest}/>\n </IconButton>\n </Tooltip>}\n </>}\n\n <Menu\n trigger={\n <IconButton\n size=\"smallest\"\n >\n <MoreVerticalIcon size={iconSize.smallest}/>\n </IconButton>\n }\n >\n <MenuItem\n dense\n onClick={() => {\n const currentIndex = propertiesOrder.indexOf(propertyKey);\n if (currentIndex > 0) {\n const newOrder = propertiesOrder.filter(k => k !== propertyKey);\n newOrder.unshift(propertyKey);\n onPropertyMove?.(newOrder, namespace);\n }\n }}\n >\n <ArrowUpToLineIcon size={iconSize.smallest}/>\n Move to top\n </MenuItem>\n <MenuItem\n dense\n onClick={() => {\n const currentIndex = propertiesOrder.indexOf(propertyKey);\n if (currentIndex < propertiesOrder.length - 1) {\n const newOrder = propertiesOrder.filter(k => k !== propertyKey);\n newOrder.push(propertyKey);\n onPropertyMove?.(newOrder, namespace);\n }\n }}\n >\n <ArrowDownToLineIcon size={iconSize.smallest}/>\n Move to bottom\n </MenuItem>\n <MenuItem\n dense\n onClick={() => onPropertyRemove?.(propertyKey, namespace)}\n >\n <Trash2Icon size={iconSize.smallest}/>\n Delete\n </MenuItem>\n </Menu>\n\n </div>\n\n {subtree && <div className={\"ml-12\"}>{subtree}</div>}\n </div>\n </div>\n );\n}\n","import { FieldCaption } from \"../../../_cms_internals\";\nimport React, { useState } from \"react\";\n;\nimport { MapProperty, Property, PropertyConfig } from \"@rebasepro/types\";\nimport { BooleanSwitchWithLabel, Button, Paper, PlusIcon, Typography } from \"@rebasepro/ui\";\nimport { PropertyFormDialog } from \"../PropertyEditView\";\nimport { getIn, useFormex } from \"@rebasepro/formex\";\nimport { useTranslation } from \"@rebasepro/core\";\nimport { PropertyTree } from \"../PropertyTree\";\nimport { getFullId, idToPropertiesPath, namespaceToPropertiesOrderPath, namespaceToPropertiesPath } from \"../util\";\n\nexport function MapPropertyField({ disabled, getData, allowDataInference, propertyConfigs }: {\n disabled: boolean;\n getData?: () => Promise<object[]>;\n allowDataInference: boolean;\n propertyConfigs: Record<string, PropertyConfig>,\n}) {\n\n const {\n values,\n setFieldValue\n } = useFormex<MapProperty>();\n const { t } = useTranslation();\n\n const [propertyDialogOpen, setPropertyDialogOpen] = useState<boolean>(false);\n const [selectedPropertyKey, setSelectedPropertyKey] = useState<string | undefined>();\n const [selectedPropertyNamespace, setSelectedPropertyNamespace] = useState<string | undefined>();\n\n const propertiesOrder = values.propertiesOrder ?? Object.keys(values.properties ?? {});\n const onPropertyCreated = ({\n id,\n property\n }: { id?: string, property: Property }) => {\n if (!id)\n throw Error();\n setFieldValue(\"properties\", {\n ...(values.properties ?? {}),\n [id]: property\n }, false);\n\n const currentPropertiesOrder = values.propertiesOrder ?? Object.keys(values.properties ?? {});\n const newPropertiesOrder = currentPropertiesOrder.includes(id) ? currentPropertiesOrder : [...currentPropertiesOrder, id];\n setFieldValue(\"propertiesOrder\", newPropertiesOrder, false);\n\n setPropertyDialogOpen(false);\n };\n\n const deleteProperty = (propertyKey?: string, namespace?: string) => {\n const fullId = propertyKey ? getFullId(propertyKey, namespace) : undefined;\n if (!fullId)\n throw Error(\"collection editor miss config\");\n\n const propertiesPath = idToPropertiesPath(fullId);\n const propertiesOrderPath = namespaceToPropertiesOrderPath(namespace);\n\n const currentPropertiesOrder: string[] = (getIn(values, propertiesOrderPath) as string[] | undefined) ?? Object.keys(getIn(values, namespaceToPropertiesPath(namespace)) as object ?? {});\n\n setFieldValue(propertiesPath, undefined, false);\n setFieldValue(propertiesOrderPath, currentPropertiesOrder.filter((p) => p !== propertyKey), false);\n\n setPropertyDialogOpen(false);\n setSelectedPropertyKey(undefined);\n setSelectedPropertyNamespace(undefined);\n };\n\n const selectedPropertyFullId = selectedPropertyKey ? getFullId(selectedPropertyKey, selectedPropertyNamespace) : undefined;\n const selectedProperty = selectedPropertyFullId ? getIn(values.properties, selectedPropertyFullId.replaceAll(\".\", \".properties.\")) : undefined;\n\n const empty = !propertiesOrder || propertiesOrder.length < 1;\n\n const onPropertyMove = (propertiesOrder: string[], namespace?: string) => {\n setFieldValue(namespaceToPropertiesOrderPath(namespace), propertiesOrder, false);\n };\n\n return (\n <>\n <div className={\"col-span-12\"}>\n <div className=\"flex justify-between items-end my-4\">\n <Typography variant={\"subtitle2\"}>{t(\"properties_in_this_group\")}</Typography>\n <Button\n onClick={() => setPropertyDialogOpen(true)}\n startIcon={<PlusIcon/>}\n >\n Add property to {values.name ?? \"this group\"}\n </Button>\n </div>\n <Paper className=\"p-2 pl-8\">\n <PropertyTree\n properties={values.properties ?? {}}\n propertiesOrder={propertiesOrder}\n errors={{}}\n\n onPropertyClick={(propertyKey, namespace) => {\n setSelectedPropertyKey(propertyKey);\n setSelectedPropertyNamespace(namespace);\n setPropertyDialogOpen(true);\n }}\n onPropertyMove={onPropertyMove}/>\n\n {empty &&\n <Typography variant={\"label\"}\n className=\"h-full flex items-center justify-center p-4\">\n Add the first property to this group\n </Typography>}\n </Paper>\n </div>\n\n <div className={\"col-span-12\"}>\n <BooleanSwitchWithLabel\n position={\"start\"}\n size={\"medium\"}\n label={t(\"spread_children_as_columns\")}\n onValueChange={(v) => setFieldValue(\"ui.spreadChildren\", v)}\n value={values.ui?.spreadChildren ?? false}\n />\n <FieldCaption>\n Set this flag to true if you want to display the children of this group as individual columns. This\n will only work for top level groups.\n </FieldCaption>\n </div>\n\n <PropertyFormDialog\n inArray={false}\n forceShowErrors={false}\n open={propertyDialogOpen}\n allowDataInference={allowDataInference}\n\n onCancel={() => {\n setPropertyDialogOpen(false);\n setSelectedPropertyKey(undefined);\n setSelectedPropertyNamespace(undefined);\n }}\n onOkClicked={() => {\n setPropertyDialogOpen(false);\n setSelectedPropertyKey(undefined);\n setSelectedPropertyNamespace(undefined);\n }}\n getData={getData}\n onDelete={deleteProperty}\n propertyKey={selectedPropertyKey}\n propertyNamespace={selectedPropertyNamespace}\n property={selectedProperty as Property | undefined}\n existingProperty={Boolean(selectedPropertyKey)}\n autoUpdateId={!selectedPropertyKey}\n autoOpenTypeSelect={!selectedPropertyKey}\n onPropertyChanged={onPropertyCreated}\n existingPropertyKeys={selectedPropertyKey ? undefined : propertiesOrder}\n propertyConfigs={propertyConfigs}\n />\n\n </>);\n}\n","import React, { useState } from \"react\";\nimport { getFieldConfig } from \"../../../../components/field_configs\";\nimport { ArrayProperty, Property, PropertyConfig } from \"@rebasepro/types\";\nimport { Button, Paper, Typography } from \"@rebasepro/ui\";\nimport { Field, getIn, useFormex } from \"@rebasepro/formex\";\nimport { PropertyFormDialog } from \"../PropertyEditView\";\nimport { PropertyFieldPreview } from \"../PropertyFieldPreview\";\nimport { ArrayPropertyValidation } from \"./validation/ArrayPropertyValidation\";\nimport { ValidationPanel } from \"./validation/ValidationPanel\";\n\nexport function RepeatPropertyField({\n showErrors,\n existing,\n disabled,\n getData,\n allowDataInference,\n propertyConfigs\n}: {\n showErrors: boolean,\n existing: boolean,\n disabled: boolean,\n getData?: () => Promise<object[]>;\n allowDataInference: boolean;\n propertyConfigs: Record<string, PropertyConfig>,\n}) {\n\n const {\n values,\n handleChange,\n errors,\n setFieldValue,\n touched\n } = useFormex<ArrayProperty>();\n\n const [propertyDialogOpen, setPropertyDialogOpen] = useState(false);\n const ofProperty = getIn(values, \"of\") as Property | undefined;\n const ofPropertyError = (getIn(touched, \"of\") && getIn(errors, \"of\")) as string | undefined;\n\n const onPropertyChanged = ({ id, property, namespace }:\n { id?: string, property: Property, namespace?: string }) => {\n setFieldValue(\"of\", property);\n };\n\n const widget = ofProperty && getFieldConfig(ofProperty, propertyConfigs);\n return (\n <>\n <div className={\"col-span-12\"}>\n <Typography variant={\"subtitle2\"}>\n Repeat component\n </Typography>\n <Field\n name={\"of\"}\n value={ofProperty}\n // validate={(property: Property) => {\n // return property?.type ? undefined : \"You need to specify a repeat field\";\n // }}\n >\n {({ }) => (\n <Paper className=\"p-2 mt-4\">\n\n {ofProperty && <PropertyFieldPreview\n property={ofProperty}\n onClick={disabled ? undefined : () => setPropertyDialogOpen(true)}\n includeName={false}\n includeEditButton={true}\n selected={false}\n hasError={false}/>}\n\n {!disabled && !ofProperty && <Button variant={\"text\"}\n color={ofPropertyError ? \"error\" : \"primary\"}\n onClick={() => setPropertyDialogOpen(true)}>\n Edit {`${widget ? widget.name : \"repeat component\"}`}\n </Button>}\n\n <PropertyFormDialog\n inArray={true}\n open={propertyDialogOpen}\n existingProperty={existing}\n getData={getData}\n autoUpdateId={!existing}\n autoOpenTypeSelect={!existing}\n onOkClicked={() => setPropertyDialogOpen(false)}\n allowDataInference={allowDataInference}\n property={ofProperty}\n includeIdAndName={false}\n onPropertyChanged={onPropertyChanged}\n forceShowErrors={showErrors}\n propertyConfigs={propertyConfigs}\n\n />\n </Paper>\n )}\n </Field>\n\n </div>\n\n <div className={\"col-span-12\"}>\n\n <ValidationPanel>\n <ArrayPropertyValidation disabled={disabled}/>\n </ValidationPanel>\n\n </div>\n </>\n );\n}\n","import { FieldCaption } from \"../../../_cms_internals\";\nimport { Field, getIn, useFormex } from \"@rebasepro/formex\";\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport { PropertyWithId } from \"../PropertyEditView\";\nimport React from \"react\";\nimport { useTranslation } from \"@rebasepro/core\";\n;\nimport { prettifyIdentifier, toSnakeCase } from \"@rebasepro/utils\";\n\ntype CommonPropertyFieldsProps = {\n showErrors: boolean,\n disabledId: boolean,\n disabled: boolean;\n isNewProperty: boolean;\n autoUpdateId: boolean;\n};\n\nexport const CommonPropertyFields = React.forwardRef<HTMLDivElement, CommonPropertyFieldsProps>(\n function CommonPropertyFields({\n showErrors,\n disabledId,\n disabled,\n autoUpdateId,\n isNewProperty\n }, ref) {\n\n const {\n errors,\n values,\n setFieldValue,\n setFieldTouched,\n touched,\n validate\n } = useFormex<PropertyWithId>();\n const { t } = useTranslation();\n\n const name = \"name\";\n const nameError = showErrors && (getIn(errors, name) as string | undefined);\n\n const id = \"id\";\n const idError = showErrors && (getIn(errors, id) as string | undefined);\n\n const description = \"description\";\n const descriptionError = showErrors && (getIn(errors, description) as string | undefined);\n\n return (\n <div className={\"flex flex-col gap-2 col-span-12\"}>\n\n <div>\n <Field\n name={name}\n inputRef={ref}\n as={DebouncedTextField}\n value={values[name]}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const newNameValue = e.target.value;\n const idTouched = getIn(touched, id);\n if (!idTouched && autoUpdateId) {\n setFieldValue(id, newNameValue ? toSnakeCase(newNameValue) : \"\", false)\n }\n setFieldValue(name, newNameValue, true);\n setFieldTouched(name, true);\n }}\n style={{ fontSize: 20 }}\n placeholder={t(\"field_name\")}\n required\n disabled={disabled}\n error={Boolean(nameError)}/>\n\n <FieldCaption error={Boolean(nameError)}>\n {nameError}\n </FieldCaption>\n </div>\n\n <div>\n <DebouncedTextField\n name={id}\n label={\"ID\"}\n value={values[id]}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const newIdValue = e.target.value;\n const nameTouched = getIn(touched, name);\n if (!nameTouched && autoUpdateId) {\n setFieldValue(name, newIdValue ? prettifyIdentifier(newIdValue) : \"\")\n }\n setFieldValue(id, newIdValue, true);\n setFieldTouched(id, true);\n }}\n disabled={disabledId || disabled}\n required\n size=\"small\"\n error={Boolean(idError)}/>\n <FieldCaption error={Boolean(idError)}>\n {idError}\n </FieldCaption>\n </div>\n\n <div>\n <Field name={description}\n as={DebouncedTextField}\n label={t(\"description\")}\n disabled={disabled}\n error={Boolean(descriptionError)}/>\n <FieldCaption error={Boolean(descriptionError)}>\n {descriptionError}\n </FieldCaption>\n </div>\n\n </div>\n );\n\n }\n);\n","import { FieldCaption } from \"../../../_cms_internals\";\nimport React from \"react\";\nimport { StringPropertyValidation } from \"./validation/StringPropertyValidation\";\nimport { ValidationPanel } from \"./validation/ValidationPanel\";\nimport { getIn, useFormex } from \"@rebasepro/formex\";\nimport { useTranslation } from \"@rebasepro/core\";\n;\nimport { Select, SelectItem, TextField } from \"@rebasepro/ui\";\n\nexport function StringPropertyField({\n widgetId,\n disabled,\n showErrors\n}: {\n widgetId: \"text_field\" | \"multiline\" | \"email\" | \"user_select\";\n disabled: boolean;\n showErrors: boolean;\n}) {\n\n const { values, setFieldValue, touched, errors } = useFormex();\n const { t } = useTranslation();\n\n const columnTypePath = \"columnType\";\n const columnTypeValue: string | undefined = getIn(values, columnTypePath) as string | undefined;\n const columnTypeError: string | undefined = (getIn(touched, columnTypePath) && getIn(errors, columnTypePath)) as string | undefined;\n\n const isIdPath = \"isId\";\n const isIdValue: string | boolean | undefined = getIn(values, isIdPath) as string | boolean | undefined;\n const isIdError: string | undefined = (getIn(touched, isIdPath) && getIn(errors, isIdPath)) as string | undefined;\n\n return (\n <>\n <div className={\"col-span-12\"}>\n\n <ValidationPanel>\n\n {widgetId === \"text_field\" &&\n <StringPropertyValidation disabled={disabled}\n length={true}\n lowercase={true}\n matches={true}\n max={true}\n min={true}\n trim={true}\n uppercase={true}\n showErrors={showErrors}/>}\n {widgetId === \"user_select\" &&\n <StringPropertyValidation disabled={disabled}\n showErrors={showErrors}/>}\n\n {widgetId === \"multiline\" &&\n <StringPropertyValidation disabled={disabled}\n length={true}\n lowercase={true}\n max={true}\n min={true}\n trim={true}\n uppercase={true}\n showErrors={showErrors}/>}\n\n {widgetId === \"email\" &&\n <StringPropertyValidation disabled={disabled}\n max={true}\n min={true}\n trim={true}\n showErrors={showErrors}/>}\n\n </ValidationPanel>\n\n </div>\n\n <div className={\"col-span-12\"}>\n <Select name={columnTypePath}\n disabled={disabled || Boolean(isIdValue)}\n fullWidth={true}\n value={isIdValue === \"uuid\" ? \"uuid\" : (columnTypeValue ?? \"_default_\")}\n onValueChange={(v) => setFieldValue(columnTypePath, v === \"_default_\" ? undefined : v)}\n renderValue={(v) => {\n if (isIdValue === \"uuid\") return \"uuid (forced by Primary Key)\";\n switch (v) {\n case \"text\": return \"text (unlimited)\";\n case \"char\": return \"char (fixed length)\";\n case \"varchar\": return \"varchar (variable length)\";\n case \"_default_\": return \"Default (varchar)\";\n default: return \"Default (varchar)\";\n }\n }}\n error={Boolean(columnTypeError)}\n label={t(\"db_column_type\")}>\n {isIdValue === \"uuid\" && <SelectItem value={\"uuid\"}> uuid (forced by Primary Key) </SelectItem>}\n <SelectItem value={\"_default_\"}> Default (varchar) </SelectItem>\n <SelectItem value={\"varchar\"}> varchar (variable length) </SelectItem>\n <SelectItem value={\"text\"}> text (unlimited) </SelectItem>\n <SelectItem value={\"char\"}> char (fixed length) </SelectItem>\n </Select>\n <FieldCaption error={Boolean(columnTypeError)}>\n {columnTypeError ?? \"Optional database override for this string field.\"}\n </FieldCaption>\n </div>\n\n <div className={\"col-span-12\"}>\n <Select name={isIdPath}\n disabled={disabled}\n fullWidth={true}\n value={isIdValue === true ? \"true\" : (isIdValue === false ? \"false\" : (isIdValue ?? \"_default_\"))}\n onValueChange={(v) => {\n if (v === \"_default_\" || v === \"false\") setFieldValue(isIdPath, undefined);\n else if (v === \"true\") setFieldValue(isIdPath, true);\n else setFieldValue(isIdPath, v);\n }}\n renderValue={(v) => {\n switch (v) {\n case \"true\": return \"Yes (Auto-generated UUID/String)\";\n case \"manual\": return \"Yes (Manual input)\";\n case \"uuid\": return \"Yes (UUID)\";\n case \"cuid\": return \"Yes (CUID)\";\n case \"false\":\n case \"_default_\": return \"No\";\n default: return `Yes (${v})`;\n }\n }}\n error={Boolean(isIdError)}\n label={t(\"primary_key_unique_id\")}>\n <SelectItem value={\"_default_\"}> No </SelectItem>\n <SelectItem value={\"manual\"}> Yes (Manual input) </SelectItem>\n <SelectItem value={\"true\"}> Yes (Auto-generated UUID/String) </SelectItem>\n <SelectItem value={\"uuid\"}> Yes (UUID) </SelectItem>\n <SelectItem value={\"cuid\"}> Yes (CUID) </SelectItem>\n </Select>\n <FieldCaption error={Boolean(isIdError)}>\n {isIdError ?? \"Set as Primary Key and configure ID generation strategy.\"}\n </FieldCaption>\n </div>\n\n <div className={\"col-span-12\"}>\n\n <TextField name={\"defaultValue\"}\n disabled={disabled}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n setFieldValue(\"defaultValue\", e.target.value === \"\" ? undefined : e.target.value);\n }}\n label={t(\"default_value\")}\n value={(getIn(values, \"defaultValue\") as string | undefined) ?? \"\"}/>\n\n </div>\n </>\n );\n}\n","import React from \"react\";\nimport { Field, FormexFieldProps, getIn, useFormex } from \"@rebasepro/formex\";\n\nimport { GeneralPropertyValidation } from \"./validation/GeneralPropertyValidation\";\nimport { ValidationPanel } from \"./validation/ValidationPanel\";\nimport { SwitchControl } from \"../SwitchControl\";\n\nexport function BooleanPropertyField({ disabled }: {\n disabled: boolean;\n}) {\n const { values } = useFormex();\n const defaultValue = getIn(values, \"defaultValue\");\n\n return (\n <>\n <div className={\"col-span-12\"}>\n\n <ValidationPanel>\n <GeneralPropertyValidation disabled={disabled}/>\n </ValidationPanel>\n\n </div>\n\n <div className={\"col-span-12\"}>\n\n <Field\n name={\"defaultValue\"}>\n {({ field, form }: FormexFieldProps) => {\n return <SwitchControl\n size={\"medium\"}\n label={defaultValue === null || defaultValue === undefined ? \"Default value not set\" : (\"Default value is \" + defaultValue.toString())}\n disabled={disabled}\n allowIndeterminate={true} field={field}\n form={form}/>\n }}\n </Field>\n\n </div>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { Button, Paper, PlusIcon, Typography } from \"@rebasepro/ui\";\nimport { getIn, useFormex } from \"@rebasepro/formex\";\nimport { OnPropertyChangedParams, PropertyFormDialog } from \"../PropertyEditView\";\nimport {\n getFullId,\n getFullIdPath,\n idToPropertiesPath,\n namespaceToPropertiesOrderPath,\n namespaceToPropertiesPath\n} from \"../util\";\nimport { PropertyTree } from \"../PropertyTree\";\nimport { ArrayProperty, PropertyConfig, Property } from \"@rebasepro/types\";\n\nexport function BlockPropertyField({\n disabled,\n getData,\n allowDataInference,\n propertyConfigs\n}: {\n disabled: boolean;\n getData?: () => Promise<object[]>;\n allowDataInference: boolean;\n propertyConfigs: Record<string, PropertyConfig>,\n}) {\n\n const {\n values,\n setFieldValue\n } = useFormex<ArrayProperty>();\n\n const [propertyDialogOpen, setPropertyDialogOpen] = useState<boolean>(false);\n const [selectedPropertyKey, setSelectedPropertyKey] = useState<string | undefined>();\n const [selectedPropertyNamespace, setSelectedPropertyNamespace] = useState<string | undefined>();\n\n const onPropertyChanged = ({\n id,\n namespace,\n property\n }: OnPropertyChangedParams) => {\n if (!id)\n throw Error();\n\n setFieldValue(\"oneOf.\" + getFullIdPath(id, namespace), property, false);\n\n const currentPropertiesOrder = values.oneOf?.propertiesOrder ?? Object.keys(values.oneOf?.properties ?? {});\n const newPropertiesOrder = currentPropertiesOrder.includes(id) ? currentPropertiesOrder : [...currentPropertiesOrder, id];\n setFieldValue(\"oneOf.\" + namespaceToPropertiesOrderPath(namespace), newPropertiesOrder, false);\n setPropertyDialogOpen(false);\n };\n\n const selectedPropertyFullId = selectedPropertyKey ? getFullId(selectedPropertyKey, selectedPropertyNamespace) : undefined;\n const selectedProperty = selectedPropertyFullId ? getIn(values.oneOf?.properties, selectedPropertyFullId.replaceAll(\".\", \".properties.\")) : undefined;\n\n const deleteProperty = (propertyKey?: string, namespace?: string) => {\n const fullId = propertyKey ? getFullId(propertyKey, namespace) : undefined;\n if (!fullId)\n throw Error(\"collection editor miss config\");\n\n setFieldValue(`oneOf.${idToPropertiesPath(fullId)}`, undefined, false);\n const propertiesOrderPath = `oneOf.${namespaceToPropertiesOrderPath(namespace)}`;\n const currentPropertiesOrder: string[] = (getIn(values, propertiesOrderPath) as string[] | undefined) ?? Object.keys(getIn(values, namespaceToPropertiesPath(namespace)) as object ?? {});\n setFieldValue(propertiesOrderPath, currentPropertiesOrder.filter((p) => p !== propertyKey), false);\n\n setPropertyDialogOpen(false);\n setSelectedPropertyKey(undefined);\n setSelectedPropertyNamespace(undefined);\n };\n\n const addChildButton = <Button\n autoFocus\n onClick={() => setPropertyDialogOpen(true)}\n startIcon={<PlusIcon/>}\n >\n Add property to {values.name ?? \"this block\"}\n </Button>;\n\n const onPropertyMove = (propertiesOrder: string[], namespace?: string) => {\n setFieldValue(`oneOf.${namespaceToPropertiesOrderPath(namespace)}`, propertiesOrder, false);\n };\n\n return (\n <>\n <div className={\"col-span-12\"}>\n <div className={\"flex justify-between items-end mt-8 mb-4\"}>\n <Typography variant={\"subtitle2\"}>\n Properties in this block\n </Typography>\n {addChildButton}\n </div>\n <Paper className=\"p-2 pl-8\">\n\n <PropertyTree\n properties={values.oneOf?.properties ?? {}}\n propertiesOrder={values.oneOf?.propertiesOrder}\n errors={{}}\n\n onPropertyClick={disabled\n ? undefined\n : (propertyKey, namespace) => {\n setSelectedPropertyKey(propertyKey);\n setSelectedPropertyNamespace(namespace);\n setPropertyDialogOpen(true);\n }}\n onPropertyMove={disabled\n ? undefined\n : onPropertyMove}/>\n\n {!disabled && (values.oneOf?.propertiesOrder?.length === 0) &&\n <div className=\"h-full flex items-center justify-center p-4\">\n Add the first property to this block\n </div>}\n\n </Paper>\n </div>\n\n {!disabled && <PropertyFormDialog\n inArray={false}\n forceShowErrors={false}\n open={propertyDialogOpen}\n getData={getData}\n allowDataInference={allowDataInference}\n onCancel={() => {\n setPropertyDialogOpen(false);\n setSelectedPropertyKey(undefined);\n setSelectedPropertyNamespace(undefined);\n }}\n onOkClicked={() => {\n setPropertyDialogOpen(false);\n setSelectedPropertyKey(undefined);\n setSelectedPropertyNamespace(undefined);\n }}\n\n onDelete={deleteProperty}\n propertyKey={selectedPropertyKey}\n propertyNamespace={selectedPropertyNamespace}\n property={selectedProperty as Property | undefined}\n existingProperty={Boolean(selectedPropertyKey)}\n autoUpdateId={!selectedPropertyKey}\n autoOpenTypeSelect={!selectedPropertyKey}\n onPropertyChanged={onPropertyChanged}\n existingPropertyKeys={selectedPropertyKey ? undefined : values.oneOf?.propertiesOrder}\n propertyConfigs={propertyConfigs}/>}\n\n </>);\n}\n","import React from \"react\";\n\nimport { Field, FormexFieldProps, getIn, useFormex } from \"@rebasepro/formex\";\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/core\";\nimport { GeneralPropertyValidation } from \"./GeneralPropertyValidation\";\nimport { SwitchControl } from \"../../SwitchControl\";\n\nexport function NumberPropertyValidation({ disabled }: {\n disabled: boolean;\n}) {\n\n const {\n values,\n handleChange\n } = useFormex();\n const { t } = useTranslation();\n\n const validationMin = \"validation.min\";\n const validationMax = \"validation.max\";\n const validationLessThan = \"validation.lessThan\";\n const validationMoreThan = \"validation.moreThan\";\n const validationPositive = \"validation.positive\";\n const validationNegative = \"validation.negative\";\n const validationInteger = \"validation.integer\";\n\n return (\n\n <div className={\"grid grid-cols-12 gap-2\"}>\n <GeneralPropertyValidation disabled={disabled}/>\n\n\n <div className={\"col-span-6\"}>\n <DebouncedTextField value={getIn(values, validationMin) as number | undefined}\n label={t(\"min_value\")}\n name={validationMin}\n type=\"number\"\n size=\"small\"\n disabled={disabled}\n onChange={handleChange}/>\n </div>\n\n <div className={\"col-span-6\"}>\n <DebouncedTextField value={getIn(values, validationMax) as number | undefined}\n label={t(\"max_value\")}\n name={validationMax}\n type=\"number\"\n size=\"small\"\n disabled={disabled}\n onChange={handleChange}/>\n </div>\n\n\n <div className={\"col-span-6\"}>\n <DebouncedTextField\n value={getIn(values, validationLessThan) as number | undefined}\n label={t(\"less_than\")}\n name={validationLessThan}\n type=\"number\"\n size=\"small\"\n disabled={disabled}\n onChange={handleChange}/>\n </div>\n\n <div className={\"col-span-6\"}>\n <DebouncedTextField\n value={getIn(values, validationMoreThan) as number | undefined}\n label={t(\"more_than\")}\n name={validationMoreThan}\n type=\"number\"\n size=\"small\"\n disabled={disabled}\n onChange={handleChange}/>\n </div>\n\n <div className={\"col-span-4\"}>\n <Field name={validationPositive}\n type=\"checkbox\">\n {({ field, form }: FormexFieldProps) => {\n return <SwitchControl\n label={t(\"positive_value\")}\n disabled={disabled}\n form={form}\n field={field}/>\n }}\n </Field>\n </div>\n <div className={\"col-span-4\"}>\n <Field name={validationNegative}\n type=\"checkbox\">\n {({ field, form }: FormexFieldProps) => {\n return <SwitchControl\n label={t(\"negative_value\")}\n disabled={disabled}\n form={form}\n field={field}/>\n }}\n </Field>\n </div>\n <div className={\"col-span-4\"}>\n <Field name={validationInteger}\n type=\"checkbox\">\n {({ field, form }: FormexFieldProps) => {\n return <SwitchControl\n label={t(\"integer_value\")}\n disabled={disabled}\n form={form}\n field={field}/>\n }}\n </Field>\n </div>\n </div>\n );\n}\n","import { FieldCaption } from \"../../../_cms_internals\";\nimport React from \"react\";\nimport { NumberPropertyValidation } from \"./validation/NumberPropertyValidation\";\nimport { ValidationPanel } from \"./validation/ValidationPanel\";\n;\nimport { Select, SelectItem, TextField } from \"@rebasepro/ui\";\nimport { getIn, useFormex } from \"@rebasepro/formex\";\nimport { useTranslation } from \"@rebasepro/core\";\n\nexport function NumberPropertyField({ disabled }: {\n disabled: boolean;\n}) {\n\n const { values, setFieldValue, touched, errors } = useFormex();\n const { t } = useTranslation();\n\n const columnTypePath = \"columnType\";\n const columnTypeValue: string | undefined = getIn(values, columnTypePath) as string | undefined;\n const columnTypeError: string | undefined = (getIn(touched, columnTypePath) && getIn(errors, columnTypePath)) as string | undefined;\n\n const isIdPath = \"isId\";\n const isIdValue: string | boolean | undefined = getIn(values, isIdPath) as string | boolean | undefined;\n const isIdError: string | undefined = (getIn(touched, isIdPath) && getIn(errors, isIdPath)) as string | undefined;\n\n return (\n <>\n\n <div className={\"col-span-12\"}>\n\n <ValidationPanel>\n <NumberPropertyValidation disabled={disabled}/>\n </ValidationPanel>\n\n </div>\n\n <div className={\"col-span-12\"}>\n <Select name={columnTypePath}\n disabled={disabled || Boolean(isIdValue)}\n fullWidth={true}\n value={columnTypeValue ?? \"_default_\"}\n onValueChange={(v) => setFieldValue(columnTypePath, v === \"_default_\" ? undefined : v)}\n renderValue={(v) => {\n switch (v) {\n case \"integer\": return \"integer\";\n case \"real\": return \"real (float4)\";\n case \"double precision\": return \"double precision (float8)\";\n case \"numeric\": return \"numeric / decimal\";\n case \"bigint\": return \"bigint\";\n case \"serial\": return \"serial\";\n case \"bigserial\": return \"bigserial\";\n case \"_default_\": return \"Default (integer/numeric)\";\n default: return \"Default (integer/numeric)\";\n }\n }}\n error={Boolean(columnTypeError)}\n label={t(\"db_column_type\")}>\n <SelectItem value={\"_default_\"}> Default (integer/numeric) </SelectItem>\n <SelectItem value={\"integer\"}> integer </SelectItem>\n <SelectItem value={\"real\"}> real (float4) </SelectItem>\n <SelectItem value={\"double precision\"}> double precision (float8) </SelectItem>\n <SelectItem value={\"numeric\"}> numeric / decimal </SelectItem>\n <SelectItem value={\"bigint\"}> bigint </SelectItem>\n <SelectItem value={\"serial\"}> serial </SelectItem>\n <SelectItem value={\"bigserial\"}> bigserial </SelectItem>\n </Select>\n <FieldCaption error={Boolean(columnTypeError)}>\n {columnTypeError ?? \"Optional database override for this number field.\"}\n </FieldCaption>\n </div>\n\n <div className={\"col-span-12\"}>\n <Select name={isIdPath}\n disabled={disabled}\n fullWidth={true}\n value={isIdValue === true ? \"true\" : (isIdValue === false ? \"false\" : (isIdValue ?? \"_default_\"))}\n onValueChange={(v) => {\n if (v === \"_default_\" || v === \"false\") setFieldValue(isIdPath, undefined);\n else if (v === \"true\") setFieldValue(isIdPath, true);\n else setFieldValue(isIdPath, v);\n }}\n renderValue={(v) => {\n switch (v) {\n case \"true\": return \"Yes (Auto-increment/identity)\";\n case \"increment\": return \"Yes (Increment)\";\n case \"manual\": return \"Yes (Manual input)\";\n case \"false\":\n case \"_default_\": return \"No\";\n default: return `Yes (${v})`;\n }\n }}\n error={Boolean(isIdError)}\n label={t(\"primary_key_unique_id\")}>\n <SelectItem value={\"_default_\"}> No </SelectItem>\n <SelectItem value={\"manual\"}> Yes (Manual input) </SelectItem>\n <SelectItem value={\"true\"}> Yes (Auto-increment/identity) </SelectItem>\n <SelectItem value={\"increment\"}> Yes (Increment) </SelectItem>\n </Select>\n <FieldCaption error={Boolean(isIdError)}>\n {isIdError ?? \"Set as Primary Key and configure ID generation strategy.\"}\n </FieldCaption>\n </div>\n\n <div className={\"col-span-12\"}>\n\n <TextField name={\"defaultValue\"}\n disabled={disabled}\n type={\"number\"}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n setFieldValue(\"defaultValue\", e.target.value === \"\" ? undefined : parseFloat(e.target.value));\n }}\n label={t(\"default_value\")}\n value={(getIn(values, \"defaultValue\") as string | number | undefined) ?? \"\"}/>\n\n </div>\n </>\n );\n}\n","import { IconForView, useTranslation } from \"@rebasepro/core\";\nimport { FieldCaption, useCollectionRegistryController } from \"../../../_cms_internals\";\nimport React from \"react\";\nimport { Field, getIn, useFormex } from \"@rebasepro/formex\";\n;\nimport { NumberProperty, StringProperty } from \"@rebasepro/types\";\nimport { CircularProgress, Select, SelectItem, Typography } from \"@rebasepro/ui\";\n\nexport function ReferencePropertyField({\n existing,\n multiple,\n disabled,\n showErrors,\n asString\n}: {\n existing: boolean,\n multiple: boolean,\n disabled: boolean,\n showErrors: boolean,\n asString?: boolean\n}) {\n\n const {\n values,\n errors,\n setFieldValue\n } = useFormex<StringProperty | NumberProperty>();\n\n const collectionRegistry = useCollectionRegistryController();\n\n if (!collectionRegistry.initialised)\n return <div className={\"col-span-12\"}>\n <CircularProgress/>\n </div>;\n\n const pathPath = asString ? \"reference.slug\" : (multiple ? \"of.slug\" : \"path\");\n const pathValue: string | undefined = getIn(values, pathPath) as string | undefined;\n const pathError: string | undefined = (showErrors && getIn(errors, pathPath)) as string | undefined;\n\n return (\n <>\n <div className={\"col-span-12\"}>\n\n <Field name={pathPath}\n pathPath={pathPath}\n type=\"select\"\n disabled={disabled}\n value={pathValue}\n error={pathError}\n setFieldValue={setFieldValue}\n as={CollectionsSelect}/>\n\n </div>\n\n </>\n );\n}\n\nexport function CollectionsSelect({\n disabled,\n pathPath,\n value,\n setFieldValue,\n error,\n ...props\n}: {\n disabled: boolean,\n pathPath: string,\n value?: string,\n setFieldValue: (field: string, value: string) => void,\n error?: string\n}) {\n\n const collectionRegistry = useCollectionRegistryController();\n const { t } = useTranslation();\n\n if (!collectionRegistry.initialised)\n return <div className={\"col-span-12\"}>\n <CircularProgress/>\n </div>;\n\n const collections = collectionRegistry.collections ?? [];\n\n return (\n <>\n <Select\n error={Boolean(error)}\n disabled={disabled}\n value={value ?? \"\"}\n position={\"item-aligned\"}\n name={pathPath}\n fullWidth={true}\n onChange={(e: React.ChangeEvent<HTMLSelectElement>) => setFieldValue(pathPath, e.target.value)}\n label={t(\"target_collection\")}\n renderValue={(selected: string) => {\n const selectedCollection = collections.find(collection => collection.slug === selected);\n if (!selectedCollection) return null;\n return (\n <div className=\"flex flex-row\">\n <IconForView collectionOrView={selectedCollection}/>\n <Typography\n variant={\"subtitle2\"}\n className=\"ml-4\">\n {selectedCollection?.name.toUpperCase()}\n </Typography>\n </div>)\n }}\n {...props}>\n\n {collections.map((collection) => {\n return <SelectItem\n key={collection.slug}\n value={collection.slug}>\n <div className=\"flex flex-row\">\n <IconForView collectionOrView={collection}/>\n <Typography\n variant={\"subtitle2\"}\n className=\"ml-4\">\n {collection?.name.toUpperCase()}\n </Typography>\n </div>\n </SelectItem>;\n })}\n\n </Select>\n\n </>\n );\n}\n","import { FieldCaption } from \"../../../_cms_internals\";\nimport React from \"react\";\nimport { getIn, useFormex } from \"@rebasepro/formex\";\n;\nimport { NumberProperty, StringProperty } from \"@rebasepro/types\";\nimport { Select, SelectItem } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/core\";\nimport { GeneralPropertyValidation } from \"./validation/GeneralPropertyValidation\";\nimport { ValidationPanel } from \"./validation/ValidationPanel\";\n\n// Common IANA timezones with human-readable labels\nconst TIMEZONES = [\n // UTC\n { value: \"UTC\",\nlabel: \"UTC (Coordinated Universal Time)\" },\n // Americas\n { value: \"America/New_York\",\nlabel: \"New York (US Eastern)\" },\n { value: \"America/Chicago\",\nlabel: \"Chicago (US Central)\" },\n { value: \"America/Denver\",\nlabel: \"Denver (US Mountain)\" },\n { value: \"America/Los_Angeles\",\nlabel: \"Los Angeles (US Pacific)\" },\n { value: \"America/Anchorage\",\nlabel: \"Anchorage (Alaska)\" },\n { value: \"America/Toronto\",\nlabel: \"Toronto (Canada Eastern)\" },\n { value: \"America/Vancouver\",\nlabel: \"Vancouver (Canada Pacific)\" },\n { value: \"America/Mexico_City\",\nlabel: \"Mexico City\" },\n { value: \"America/Sao_Paulo\",\nlabel: \"São Paulo (Brazil)\" },\n { value: \"America/Buenos_Aires\",\nlabel: \"Buenos Aires (Argentina)\" },\n // Europe\n { value: \"Europe/London\",\nlabel: \"London (UK)\" },\n { value: \"Europe/Paris\",\nlabel: \"Paris (France)\" },\n { value: \"Europe/Berlin\",\nlabel: \"Berlin (Germany)\" },\n { value: \"Europe/Madrid\",\nlabel: \"Madrid (Spain)\" },\n { value: \"Europe/Rome\",\nlabel: \"Rome (Italy)\" },\n { value: \"Europe/Amsterdam\",\nlabel: \"Amsterdam (Netherlands)\" },\n { value: \"Europe/Brussels\",\nlabel: \"Brussels (Belgium)\" },\n { value: \"Europe/Zurich\",\nlabel: \"Zurich (Switzerland)\" },\n { value: \"Europe/Stockholm\",\nlabel: \"Stockholm (Sweden)\" },\n { value: \"Europe/Vienna\",\nlabel: \"Vienna (Austria)\" },\n { value: \"Europe/Warsaw\",\nlabel: \"Warsaw (Poland)\" },\n { value: \"Europe/Prague\",\nlabel: \"Prague (Czech Republic)\" },\n { value: \"Europe/Athens\",\nlabel: \"Athens (Greece)\" },\n { value: \"Europe/Moscow\",\nlabel: \"Moscow (Russia)\" },\n { value: \"Europe/Istanbul\",\nlabel: \"Istanbul (Turkey)\" },\n // Asia\n { value: \"Asia/Dubai\",\nlabel: \"Dubai (UAE)\" },\n { value: \"Asia/Kolkata\",\nlabel: \"Mumbai / Delhi (India)\" },\n { value: \"Asia/Bangkok\",\nlabel: \"Bangkok (Thailand)\" },\n { value: \"Asia/Singapore\",\nlabel: \"Singapore\" },\n { value: \"Asia/Hong_Kong\",\nlabel: \"Hong Kong\" },\n { value: \"Asia/Shanghai\",\nlabel: \"Shanghai (China)\" },\n { value: \"Asia/Tokyo\",\nlabel: \"Tokyo (Japan)\" },\n { value: \"Asia/Seoul\",\nlabel: \"Seoul (South Korea)\" },\n { value: \"Asia/Jakarta\",\nlabel: \"Jakarta (Indonesia)\" },\n // Oceania\n { value: \"Australia/Sydney\",\nlabel: \"Sydney (Australia Eastern)\" },\n { value: \"Australia/Melbourne\",\nlabel: \"Melbourne (Australia)\" },\n { value: \"Australia/Brisbane\",\nlabel: \"Brisbane (Australia)\" },\n { value: \"Australia/Perth\",\nlabel: \"Perth (Australia Western)\" },\n { value: \"Pacific/Auckland\",\nlabel: \"Auckland (New Zealand)\" },\n // Africa\n { value: \"Africa/Cairo\",\nlabel: \"Cairo (Egypt)\" },\n { value: \"Africa/Johannesburg\",\nlabel: \"Johannesburg (South Africa)\" },\n { value: \"Africa/Lagos\",\nlabel: \"Lagos (Nigeria)\" }\n];\n\nexport function DateTimePropertyField({ disabled }: {\n disabled: boolean;\n}) {\n\n const {\n values,\n errors,\n touched,\n setFieldValue\n } = useFormex<StringProperty | NumberProperty>();\n const { t } = useTranslation();\n\n const modePath = \"mode\";\n const modeValue: string | undefined = getIn(values, modePath) as string | undefined;\n const modeError: string | undefined = (getIn(touched, modePath) && getIn(errors, modePath)) as string | undefined;\n\n const autoValuePath = \"autoValue\";\n const autoValueValue: string | undefined = getIn(values, autoValuePath) as string | undefined;\n const autoValueError: string | undefined = (getIn(touched, autoValuePath) && getIn(errors, autoValuePath)) as string | undefined;\n\n const timezonePath = \"timezone\";\n const timezoneValue: string | undefined = getIn(values, timezonePath) as string | undefined;\n const timezoneError: string | undefined = (getIn(touched, timezonePath) && getIn(errors, timezonePath)) as string | undefined;\n\n const columnTypePath = \"columnType\";\n const columnTypeValue: string | undefined = getIn(values, columnTypePath) as string | undefined;\n const columnTypeError: string | undefined = (getIn(touched, columnTypePath) && getIn(errors, columnTypePath)) as string | undefined;\n\n return (\n <>\n <div className={\"flex flex-col col-span-12 gap-2\"}>\n <div>\n <Select name={modePath}\n value={modeValue ?? \"date\"}\n error={Boolean(modeError)}\n onValueChange={(v) => setFieldValue(modePath, v)}\n label={t(\"mode\")}\n fullWidth={true}\n renderValue={(v) => {\n switch (v) {\n case \"date_time\":\n return \"Date/Time\";\n case \"date\":\n return \"Date\";\n default:\n return \"\";\n }\n }}\n disabled={disabled}>\n <SelectItem value={\"date_time\"}> Date/Time </SelectItem>\n <SelectItem value={\"date\"}> Date </SelectItem>\n </Select>\n <FieldCaption error={Boolean(modeError)}>\n {modeError}\n </FieldCaption>\n </div>\n <div>\n <Select name={autoValuePath}\n disabled={disabled}\n fullWidth={true}\n value={autoValueValue ?? \"\"}\n onValueChange={(v) => setFieldValue(autoValuePath, v === \"none\" ? null : v)}\n renderValue={(v) => {\n switch (v) {\n case \"on_create\":\n return \"On create\";\n case \"on_update\":\n return \"On any update\";\n default:\n return \"None\";\n }\n }}\n error={Boolean(autoValueError)}\n label={t(\"datetime_automatic_value\")}>\n <SelectItem value={\"none\"}> None </SelectItem>\n <SelectItem value={\"on_create\"}> On create </SelectItem>\n <SelectItem value={\"on_update\"}> On any update </SelectItem>\n </Select>\n <FieldCaption error={Boolean(autoValueError)}>\n {autoValueError ?? \"Update this field automatically when creating or updating the entity\"}\n </FieldCaption>\n </div>\n <div>\n <Select name={timezonePath}\n disabled={disabled}\n fullWidth={true}\n value={timezoneValue ?? \"__local__\"}\n onValueChange={(v) => setFieldValue(timezonePath, v === \"__local__\" ? undefined : v)}\n renderValue={(v) => {\n if (!v || v === \"__local__\") return \"Local timezone\";\n const tz = TIMEZONES.find(t => t.value === v);\n return tz?.label ?? v;\n }}\n error={Boolean(timezoneError)}\n label={t(\"timezone\")}>\n <SelectItem value={\"__local__\"}> Local timezone </SelectItem>\n {TIMEZONES.map((tz) => (\n <SelectItem key={tz.value} value={tz.value}>\n {tz.label}\n </SelectItem>\n ))}\n </Select>\n <FieldCaption error={Boolean(timezoneError)}>\n {timezoneError ?? \"Timezone for displaying and inputting dates. Values are always stored in UTC.\"}\n </FieldCaption>\n </div>\n\n </div>\n\n <div className={\"col-span-12\"}>\n <Select name={columnTypePath}\n disabled={disabled}\n fullWidth={true}\n value={columnTypeValue ?? \"_default_\"}\n onValueChange={(v) => setFieldValue(columnTypePath, v === \"_default_\" ? undefined : v)}\n renderValue={(v) => {\n switch (v) {\n case \"timestamp\": return \"timestamp (with timezone)\";\n case \"date\": return \"date\";\n case \"time\": return \"time\";\n case \"_default_\": return \"Default (timestamp)\";\n default: return \"Default (timestamp)\";\n }\n }}\n error={Boolean(columnTypeError)}\n label={t(\"db_column_type\")}>\n <SelectItem value={\"_default_\"}> Default (timestamp) </SelectItem>\n <SelectItem value={\"timestamp\"}> timestamp (with timezone) </SelectItem>\n <SelectItem value={\"date\"}> date </SelectItem>\n <SelectItem value={\"time\"}> time </SelectItem>\n </Select>\n <FieldCaption error={Boolean(columnTypeError)}>\n {columnTypeError ?? \"Optional database override for this date field.\"}\n </FieldCaption>\n </div>\n\n <div className={\"col-span-12\"}>\n <ValidationPanel>\n <GeneralPropertyValidation disabled={disabled}/>\n </ValidationPanel>\n </div>\n </>\n );\n}\n","import React from \"react\";\n\nimport { Field, FormexFieldProps } from \"@rebasepro/formex\";\nimport { SwitchControl } from \"../../SwitchControl\";\n\nexport function AdvancedPropertyValidation({ disabled }: {\n disabled: boolean\n}) {\n\n const hideFromCollection = \"ui.hideFromCollection\";\n const readOnly = \"ui.readOnly\";\n\n return (\n\n <div className={\"grid grid-cols-12 gap-2\"}>\n <div className={\"col-span-12\"}>\n <Field type=\"checkbox\" name={hideFromCollection}>\n {({ field, form }: FormexFieldProps) => {\n return <SwitchControl\n label={\"Hide from collection\"}\n size={\"small\"}\n disabled={disabled}\n form={form}\n tooltip={\"Hide this field from the collection view. It will still be visible in the form view\"}\n field={field}/>\n }}\n </Field>\n </div>\n\n <div className={\"col-span-12\"}>\n <Field name={readOnly}\n type=\"checkbox\">\n {({ field, form }: FormexFieldProps) => {\n return <SwitchControl\n label={\"Read only\"}\n size={\"small\"}\n disabled={disabled}\n tooltip={\"Is this a read only field. Display only as a preview\"}\n form={form}\n field={field}/>\n }}\n </Field>\n </div>\n </div>\n );\n}\n","import { FieldCaption } from \"../../../_cms_internals\";\nimport React from \"react\";\nimport { TextField } from \"@rebasepro/ui\";\nimport { getIn, useFormex } from \"@rebasepro/formex\";\n\nexport function VectorPropertyField({ disabled }: {\n disabled: boolean;\n}) {\n const { values, setFieldValue, touched, errors } = useFormex();\n\n const dimensionsPath = \"dimensions\";\n const dimensionsValue = getIn(values, dimensionsPath) as number | undefined;\n const dimensionsError = (getIn(touched, dimensionsPath) && getIn(errors, dimensionsPath)) as string | undefined;\n\n return (\n <div className={\"col-span-12\"}>\n <TextField\n name={dimensionsPath}\n disabled={disabled}\n type={\"number\"}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n const parsedVal = parseInt(e.target.value);\n setFieldValue(dimensionsPath, isNaN(parsedVal) ? undefined : parsedVal);\n }}\n label={\"Vector Dimensions\"}\n value={dimensionsValue ?? \"\"}\n error={Boolean(dimensionsError)}\n />\n <FieldCaption error={Boolean(dimensionsError)}>\n {dimensionsError ?? \"The dimension size of the vector embeddings (e.g., 1536 for OpenAI text-embedding-3-small).\"}\n </FieldCaption>\n </div>\n );\n}\n","import React from \"react\";\nimport { ValidationPanel } from \"./validation/ValidationPanel\";\nimport { GeneralPropertyValidation } from \"./validation/GeneralPropertyValidation\";\n\nexport function KeyValuePropertyField({ disabled }: {\n disabled: boolean;\n}) {\n\n return (\n <>\n <div className={\"col-span-12\"}>\n\n <ValidationPanel>\n <GeneralPropertyValidation disabled={disabled}/>\n </ValidationPanel>\n\n </div>\n </>\n );\n}\n","import { FieldCaption, useCollectionRegistryController } from \"../../../_cms_internals\";\nimport React, { useCallback, useEffect } from \"react\";\nimport { useFormex } from \"@rebasepro/formex\";\n;\nimport {\n Select,\n SelectItem,\n TextField,\n Typography\n} from \"@rebasepro/ui\";\nimport { EntityCollection, OnAction, RelationProperty } from \"@rebasepro/types\";\n\nimport { CollectionsSelect } from \"./ReferencePropertyField\";\n\nconst ON_ACTION_OPTIONS: OnAction[] = [\"cascade\", \"restrict\", \"no action\", \"set null\", \"set default\"];\n\nfunction getTargetSlug(target?: string | (() => string | { slug: string } | Record<string, unknown>)): string {\n if (!target) return \"\";\n if (typeof target === \"string\") return target;\n try {\n const resolved = target();\n if (typeof resolved === \"string\") return resolved;\n if (resolved && typeof resolved === \"object\" && \"slug\" in resolved && typeof resolved.slug === \"string\") {\n return resolved.slug;\n }\n return \"\";\n } catch {\n return \"\";\n }\n}\n\n/**\n * Property editor form for `type: \"relation\"` properties.\n *\n * This component edits the `RelationProperty` fields on the property itself (target, relationName, etc.)\n */\nexport function RelationPropertyField({\n disabled,\n showErrors\n}: {\n disabled: boolean;\n showErrors: boolean;\n}) {\n const {\n values,\n errors,\n setFieldValue\n } = useFormex<RelationProperty & { id?: string }>();\n\n const collectionRegistry = useCollectionRegistryController();\n\n const relationName = values.relationName ?? \"\";\n const targetSlug = getTargetSlug(values.target);\n const cardinality = values.cardinality ?? \"one\";\n const direction = values.direction ?? \"owning\";\n const localKey = values.localKey ?? \"\";\n const foreignKeyOnTarget = values.foreignKeyOnTarget ?? \"\";\n const through = values.through;\n const throughTable = through?.table ?? \"\";\n const throughSourceColumn = through?.sourceColumn ?? \"\";\n const throughTargetColumn = through?.targetColumn ?? \"\";\n const onUpdate = values.onUpdate ?? \"no action\";\n const onDelete = values.onDelete ?? \"no action\";\n\n // Whether to show the junction table section\n const showThrough = cardinality === \"many\" && direction === \"owning\";\n // Whether to show the local key field\n const showLocalKey = direction === \"owning\" && cardinality === \"one\";\n // Whether to show the foreign key on target field\n const showForeignKey = direction === \"inverse\";\n\n const updateThrough = useCallback(\n (patch: Record<string, unknown>) => {\n const currentThrough = values.through ?? { table: \"\",\nsourceColumn: \"\",\ntargetColumn: \"\" };\n setFieldValue(\"through\", { ...currentThrough,\n...patch });\n },\n [values.through, setFieldValue]\n );\n\n // Auto-generate relationName from target collection slug\n useEffect(() => {\n if (targetSlug && !relationName) {\n setFieldValue(\"relationName\", targetSlug);\n }\n }, [targetSlug, relationName, setFieldValue]);\n\n const collections: EntityCollection[] = collectionRegistry?.collections ?? [];\n\n return (\n <>\n {/* ─── Target Collection ─── */}\n <div className={\"col-span-12\"}>\n <CollectionsSelect\n disabled={disabled}\n pathPath={\"target\"}\n value={targetSlug}\n setFieldValue={(_, value) => {\n setFieldValue(\"target\", value);\n // Auto-generate relation name from target\n if (!relationName || relationName === targetSlug) {\n setFieldValue(\"relationName\", value);\n }\n }}\n error={showErrors && !targetSlug ? \"You must select a target collection\" : undefined}\n />\n <FieldCaption error={showErrors && !targetSlug}>\n {showErrors && !targetSlug\n ? \"You must select a target collection\"\n : \"The collection this relation points to\"}\n </FieldCaption>\n </div>\n\n {/* ─── Relation Name ─── */}\n <div className={\"col-span-12\"}>\n <TextField\n value={relationName}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>\n setFieldValue(\"relationName\", e.target.value)\n }\n label={\"Relation name\"}\n disabled={disabled}\n error={showErrors && !relationName}\n />\n <FieldCaption error={showErrors && !relationName}>\n {showErrors && !relationName\n ? \"Required\"\n : \"Identifier for this relation (used to link the property to the relation config)\"}\n </FieldCaption>\n </div>\n\n {/* ─── Cardinality ─── */}\n <div className={\"col-span-12 sm:col-span-6\"}>\n <Select\n value={cardinality}\n onValueChange={(v) => setFieldValue(\"cardinality\", v as \"one\" | \"many\")}\n label={\"Cardinality\"}\n disabled={disabled}\n fullWidth\n renderValue={(v) => v === \"one\" ? \"One (has-one)\" : \"Many (has-many)\"}\n >\n <SelectItem value={\"one\"}>\n <div>\n <Typography variant={\"body2\"}>One (has-one)</Typography>\n <Typography variant={\"caption\"} color={\"secondary\"}>\n This property references a single record\n </Typography>\n </div>\n </SelectItem>\n <SelectItem value={\"many\"}>\n <div>\n <Typography variant={\"body2\"}>Many (has-many)</Typography>\n <Typography variant={\"caption\"} color={\"secondary\"}>\n This property references multiple records\n </Typography>\n </div>\n </SelectItem>\n </Select>\n <FieldCaption>\n Whether the relation returns one or multiple records\n </FieldCaption>\n </div>\n\n {/* ─── Direction ─── */}\n <div className={\"col-span-12 sm:col-span-6\"}>\n <Select\n value={direction}\n onValueChange={(v) => setFieldValue(\"direction\", v as \"owning\" | \"inverse\")}\n label={\"Direction\"}\n disabled={disabled}\n fullWidth\n renderValue={(v) => v === \"owning\" ? \"Owning\" : \"Inverse\"}\n >\n <SelectItem value={\"owning\"}>\n <div>\n <Typography variant={\"body2\"}>Owning</Typography>\n <Typography variant={\"caption\"} color={\"secondary\"}>\n This table stores the foreign key (or owns the junction table)\n </Typography>\n </div>\n </SelectItem>\n <SelectItem value={\"inverse\"}>\n <div>\n <Typography variant={\"body2\"}>Inverse</Typography>\n <Typography variant={\"caption\"} color={\"secondary\"}>\n The target table stores the foreign key pointing back here\n </Typography>\n </div>\n </SelectItem>\n </Select>\n <FieldCaption>\n Which side of the relation owns the persistence\n </FieldCaption>\n </div>\n\n {/* ─── Local Key (owning + one) ─── */}\n {showLocalKey && (\n <div className={\"col-span-12\"}>\n <TextField\n value={localKey}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>\n setFieldValue(\"localKey\", e.target.value)\n }\n label={\"Local key (foreign key column on this table)\"}\n disabled={disabled}\n placeholder={\"e.g. author_id\"}\n />\n <FieldCaption>\n Column on this table that references the target&apos;s primary key\n </FieldCaption>\n </div>\n )}\n\n {/* ─── Foreign Key on Target (inverse) ─── */}\n {showForeignKey && (\n <div className={\"col-span-12\"}>\n <TextField\n value={foreignKeyOnTarget}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>\n setFieldValue(\"foreignKeyOnTarget\", e.target.value)\n }\n label={\"Foreign key on target table\"}\n disabled={disabled}\n placeholder={\"e.g. post_id\"}\n />\n <FieldCaption>\n Column on the target table that references this table&apos;s primary key\n </FieldCaption>\n </div>\n )}\n\n {/* ─── Junction Table (many + owning) ─── */}\n {showThrough && (\n <div className={\"col-span-12\"}>\n <Typography variant={\"label\"} className={\"mb-2\"}>\n Junction table (many-to-many)\n </Typography>\n <div className={\"grid grid-cols-12 gap-4\"}>\n <div className={\"col-span-12\"}>\n <TextField\n value={throughTable}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>\n updateThrough({ table: e.target.value })\n }\n label={\"Junction table name\"}\n disabled={disabled}\n placeholder={\"e.g. user_roles\"}\n />\n <FieldCaption>\n Name of the intermediate table that connects both collections\n </FieldCaption>\n </div>\n <div className={\"col-span-12 sm:col-span-6\"}>\n <TextField\n value={throughSourceColumn}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>\n updateThrough({ sourceColumn: e.target.value })\n }\n label={\"Source column\"}\n disabled={disabled}\n placeholder={\"e.g. user_id\"}\n />\n <FieldCaption>\n Column in the junction table referencing this table\n </FieldCaption>\n </div>\n <div className={\"col-span-12 sm:col-span-6\"}>\n <TextField\n value={throughTargetColumn}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>\n updateThrough({ targetColumn: e.target.value })\n }\n label={\"Target column\"}\n disabled={disabled}\n placeholder={\"e.g. role_id\"}\n />\n <FieldCaption>\n Column in the junction table referencing the target table\n </FieldCaption>\n </div>\n </div>\n </div>\n )}\n\n {/* ─── Cascade Actions ─── */}\n <div className={\"col-span-12 sm:col-span-6\"}>\n <Select\n value={onUpdate}\n onValueChange={(v) => setFieldValue(\"onUpdate\", v as OnAction)}\n label={\"On update\"}\n disabled={disabled}\n fullWidth\n renderValue={(v) => String(v)}\n >\n {ON_ACTION_OPTIONS.map((action) => (\n <SelectItem key={action} value={action}>\n {action}\n </SelectItem>\n ))}\n </Select>\n <FieldCaption>\n Action when the referenced record is updated\n </FieldCaption>\n </div>\n\n <div className={\"col-span-12 sm:col-span-6\"}>\n <Select\n value={onDelete}\n onValueChange={(v) => setFieldValue(\"onDelete\", v as OnAction)}\n label={\"On delete\"}\n disabled={disabled}\n fullWidth\n renderValue={(v) => String(v)}\n >\n {ON_ACTION_OPTIONS.map((action) => (\n <SelectItem key={action} value={action}>\n {action}\n </SelectItem>\n ))}\n </Select>\n <FieldCaption>\n Action when the referenced record is deleted\n </FieldCaption>\n </div>\n </>\n );\n}\n","import { ArrayProperty, BooleanProperty, DateProperty, MapProperty, NumberProperty, Property, PropertyConfig, StringProperty } from \"@rebasepro/types\";\nimport { mergeDeep } from \"@rebasepro/utils\";\n\n\nexport function updatePropertyFromWidget(propertyData: any,\n selectedWidgetId: string | undefined,\n propertyConfigs: Record<string, PropertyConfig>): Property {\n\n let updatedProperty;\n if (selectedWidgetId === \"text_field\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"string\",\n propertyConfig: \"text_field\",\n storage: undefined,\n multiline: undefined,\n markdown: undefined,\n email: undefined,\n url: undefined,\n enum: undefined,\n userSelect: undefined\n } as StringProperty\n );\n } else if (selectedWidgetId === \"user_select\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"string\",\n propertyConfig: \"user_select\",\n storage: undefined,\n multiline: undefined,\n markdown: undefined,\n email: undefined,\n url: undefined,\n enum: undefined,\n userSelect: true\n } as StringProperty\n );\n } else if (selectedWidgetId === \"multiline\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"string\",\n propertyConfig: \"multiline\",\n multiline: true,\n storage: undefined,\n markdown: undefined,\n email: undefined,\n url: undefined,\n enum: undefined,\n userSelect: undefined\n } as StringProperty\n );\n } else if (selectedWidgetId === \"markdown\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"string\",\n propertyConfig: \"markdown\",\n storage: undefined,\n multiline: undefined,\n markdown: true,\n email: undefined,\n url: undefined,\n userSelect: undefined\n } as StringProperty\n );\n } else if (selectedWidgetId === \"url\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"string\",\n propertyConfig: \"url\",\n storage: undefined,\n multiline: undefined,\n markdown: undefined,\n email: undefined,\n url: true,\n enum: undefined,\n userSelect: undefined\n } as StringProperty\n );\n } else if (selectedWidgetId === \"email\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"string\",\n propertyConfig: \"email\",\n storage: undefined,\n multiline: undefined,\n markdown: undefined,\n email: true,\n url: undefined,\n enum: undefined,\n userSelect: undefined\n } as StringProperty\n );\n } else if (selectedWidgetId === \"select\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"string\",\n propertyConfig: \"select\",\n storage: undefined,\n multiline: undefined,\n markdown: undefined,\n email: undefined,\n url: undefined,\n enum: propertyData.enum ?? [],\n userSelect: undefined\n } as StringProperty\n );\n } else if (selectedWidgetId === \"multi_select\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"array\",\n propertyConfig: \"multi_select\",\n of: {\n type: \"string\",\n enum: propertyData.of?.enum ?? []\n }\n } as ArrayProperty\n );\n } else if (selectedWidgetId === \"number_input\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"number\",\n propertyConfig: \"number_input\",\n enum: undefined\n } as NumberProperty\n );\n } else if (selectedWidgetId === \"number_select\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"number\",\n propertyConfig: \"number_select\",\n enum: propertyData.enum ?? []\n } as NumberProperty\n );\n } else if (selectedWidgetId === \"multi_number_select\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"array\",\n propertyConfig: \"multi_number_select\",\n of: {\n type: \"number\",\n enum: propertyData.of?.enum ?? []\n }\n } as ArrayProperty\n );\n } else if (selectedWidgetId === \"file_upload\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"string\",\n propertyConfig: \"file_upload\",\n storage: {\n storagePath: \"/\"\n }\n } as StringProperty\n );\n } else if (selectedWidgetId === \"multi_file_upload\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"array\",\n propertyConfig: \"multi_file_upload\",\n of: {\n type: \"string\",\n storage: propertyData.of?.storage ?? {\n storagePath: \"/\"\n }\n }\n } as ArrayProperty\n );\n } else if (selectedWidgetId === \"group\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"map\",\n propertyConfig: \"group\",\n keyValue: false,\n properties: propertyData.properties ?? {}\n } as MapProperty\n );\n } else if (selectedWidgetId === \"key_value\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"map\",\n propertyConfig: \"key_value\",\n keyValue: true,\n properties: undefined\n } as MapProperty\n );\n } else if (selectedWidgetId === \"reference\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"reference\",\n propertyConfig: \"reference\"\n } as Property\n );\n } else if (selectedWidgetId === \"reference_as_string\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"string\",\n propertyConfig: \"reference_as_string\"\n } as Property\n );\n } else if (selectedWidgetId === \"multi_references\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"array\",\n propertyConfig: \"multi_references\",\n of: {\n type: \"reference\"\n }\n } as ArrayProperty\n );\n } else if (selectedWidgetId === \"switch\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"boolean\",\n propertyConfig: \"switch\"\n } as BooleanProperty\n );\n } else if (selectedWidgetId === \"date_time\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"date\",\n propertyConfig: \"date_time\",\n mode: \"date_time\"\n } as DateProperty\n );\n } else if (selectedWidgetId === \"relation\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"relation\",\n propertyConfig: \"relation\",\n relationName: propertyData.relationName ?? \"\"\n } as Property\n );\n } else if (selectedWidgetId === \"repeat\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"array\",\n propertyConfig: \"repeat\"\n } as ArrayProperty\n );\n } else if (selectedWidgetId === \"block\") {\n updatedProperty = mergeDeep(\n propertyData,\n {\n type: \"array\",\n propertyConfig: \"block\",\n oneOf: {\n properties: {}\n }\n } as ArrayProperty\n );\n } else if (selectedWidgetId && propertyConfigs[selectedWidgetId]) {\n updatedProperty = {\n ...propertyConfigs[selectedWidgetId].property,\n propertyConfig: selectedWidgetId\n };\n }\n\n return updatedProperty;\n}\n","import React from \"react\";\nimport { StringPropertyValidation } from \"./validation/StringPropertyValidation\";\nimport { ValidationPanel } from \"./validation/ValidationPanel\";\nimport { getIn, useFormex } from \"@rebasepro/formex\";\n\nimport { Select, SelectItem, TextField } from \"@rebasepro/ui\";\n\nexport function UrlPropertyField({\n disabled,\n showErrors\n}: {\n disabled: boolean;\n showErrors: boolean;\n}) {\n\n const { values, setFieldValue } = useFormex();\n\n const urlRawValue = getIn(values, \"url\");\n const urlValue = typeof urlRawValue === \"string\" ? urlRawValue : \"[NONE]\";\n\n return (\n <>\n <div className={\"col-span-12\"}>\n\n <Select\n disabled={disabled}\n position={\"item-aligned\"}\n fullWidth={true}\n onValueChange={(value: string) => {\n if (value === \"[NONE]\")\n setFieldValue(\"url\", true);\n else\n setFieldValue(\"url\", value);\n }}\n label={\"Preview type\"}\n renderValue={(value: string) => {\n switch (value) {\n case \"image\":\n return \"Image\";\n case \"video\":\n return \"Video\";\n case \"audio\":\n return \"Audio\";\n default:\n return \"Display URL\";\n }\n }}\n value={urlValue ?? \"[NONE]\"}>\n <SelectItem value={\"[NONE]\"}>\n Display URL\n </SelectItem>\n <SelectItem value={\"image\"}>\n Image\n </SelectItem>\n <SelectItem value={\"video\"}>\n Video\n </SelectItem>\n <SelectItem value={\"audio\"}>\n Audio\n </SelectItem>\n </Select>\n </div>\n\n <div className={\"col-span-12\"}>\n\n <ValidationPanel>\n\n <StringPropertyValidation disabled={disabled}\n max={true}\n min={true}\n trim={true}\n showErrors={showErrors}/>\n\n </ValidationPanel>\n\n </div>\n\n <div className={\"col-span-12\"}>\n\n <TextField name={\"defaultValue\"}\n disabled={disabled}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n setFieldValue(\"defaultValue\", e.target.value === \"\" ? undefined : e.target.value);\n }}\n label={\"Default value\"}\n value={(getIn(values, \"defaultValue\") as string | undefined) ?? \"\"}/>\n\n </div>\n </>\n );\n}\n","import { DEFAULT_FIELD_CONFIGS } from \"../../../../components/field_configs\";\nimport { PropertyConfigId, PropertyConfig } from \"@rebasepro/types\";\n\nexport const supportedFieldsIds: PropertyConfigId[] = [\n \"text_field\",\n \"multiline\",\n \"markdown\",\n \"url\",\n \"email\",\n \"user_select\",\n \"select\",\n \"multi_select\",\n \"number_input\",\n \"number_select\",\n \"multi_number_select\",\n \"file_upload\",\n \"multi_file_upload\",\n \"reference\",\n \"reference_as_string\",\n \"multi_references\",\n \"relation\",\n \"switch\",\n \"date_time\",\n \"group\",\n \"key_value\",\n \"repeat\",\n \"block\"\n];\n\nexport const supportedFields: Record<string, PropertyConfig> = Object.entries(DEFAULT_FIELD_CONFIGS)\n .filter(([id]) => supportedFieldsIds.includes(id as PropertyConfigId))\n .map(([id, config]) => ({ [id]: config }))\n .reduce((a, b) => ({ ...a,\n...b }), {});\n","\nimport React, { useCallback } from \"react\";\nimport { StringPropertyValidation } from \"./validation/StringPropertyValidation\";\nimport { ValidationPanel } from \"./validation/ValidationPanel\";\nimport { Field, getIn, useFormex } from \"@rebasepro/formex\";\nimport { useTranslation } from \"@rebasepro/core\";\n\nimport {\n BooleanSwitchWithLabel,\n DebouncedTextField,\n ExpandablePanel,\n SettingsIcon,\n TextField,\n Typography,\n UploadCloudIcon\n} from \"@rebasepro/ui\";\n\nexport function MarkdownPropertyField({\n disabled,\n showErrors\n}: {\n disabled: boolean;\n showErrors: boolean;\n}) {\n\n const {\n values,\n setFieldValue\n } = useFormex();\n const { t } = useTranslation();\n\n const baseStoragePath = \"storage\";\n const baseMarkdownPath = \"markdown\";\n\n const metadata = `${baseStoragePath}.metadata`;\n const fileName = `${baseStoragePath}.fileName`;\n const maxSize = `${baseStoragePath}.maxSize`;\n const storagePath = `${baseStoragePath}.storagePath`;\n\n // Markdown config paths\n const htmlPath = `${baseMarkdownPath}.html`;\n const transformPastedTextPath = `${baseMarkdownPath}.transformPastedText`;\n\n const fileNameValue = (getIn(values, fileName) as string | undefined) ?? \"{rand}_{file}\";\n const storagePathValue = (getIn(values, storagePath) as string | undefined) ?? \"/\";\n const maxSizeValue = getIn(values, maxSize);\n\n // Markdown config values - check if markdown is an object or boolean\n const markdownValue = getIn(values, \"markdown\");\n const isMarkdownObject = typeof markdownValue === \"object\" && markdownValue !== null;\n const htmlValue = isMarkdownObject ? (((markdownValue as Record<string, unknown>).html as boolean | undefined) ?? true) : true;\n const transformPastedTextValue = isMarkdownObject ? (((markdownValue as Record<string, unknown>).transformPastedText as boolean | undefined) ?? false) : false;\n\n const hasFilenameCallback = typeof fileNameValue === \"function\";\n const hasStoragePathCallback = typeof storagePathValue === \"function\";\n\n // Handler to update markdown config - converts from boolean to object if needed\n const updateMarkdownConfig = useCallback((key: \"html\" | \"transformPastedText\", value: boolean) => {\n const currentMarkdown = getIn(values, \"markdown\");\n if (typeof currentMarkdown === \"object\" && currentMarkdown !== null) {\n // Already an object, update the key\n setFieldValue(`markdown.${key}`, value);\n } else {\n // Convert from boolean to object\n const defaultConfig = {\n html: true,\n transformPastedText: false\n };\n setFieldValue(\"markdown\", {\n ...defaultConfig,\n [key]: value\n });\n }\n }, [values, setFieldValue]);\n\n return (\n <>\n <div className={\"col-span-12\"}>\n\n <ValidationPanel>\n\n <StringPropertyValidation disabled={disabled}\n length={true}\n lowercase={true}\n max={true}\n min={true}\n trim={true}\n uppercase={true}\n showErrors={showErrors}/>\n\n </ValidationPanel>\n\n </div>\n\n <div className={\"col-span-12\"}>\n <ExpandablePanel\n title={\n <div className=\"flex flex-row text-surface-500\">\n <SettingsIcon/>\n <Typography variant={\"subtitle2\"}\n className=\"ml-4\">\n Paste behavior\n </Typography>\n </div>\n }>\n\n <div className={\"flex flex-col gap-2 p-4\"}>\n <BooleanSwitchWithLabel\n size={\"small\"}\n disabled={disabled}\n value={!htmlValue}\n onValueChange={(value) => updateMarkdownConfig(\"html\", !value)}\n label={t(\"markdown_strip_html\")}\n />\n <Typography variant={\"caption\"} className={\"ml-3.5 mt-1 mb-2\"}>\n Remove HTML tags and inline styles when pasting content from external sources\n </Typography>\n\n <BooleanSwitchWithLabel\n size={\"small\"}\n disabled={disabled}\n value={transformPastedTextValue}\n onValueChange={(value) => updateMarkdownConfig(\"transformPastedText\", value)}\n label={t(\"markdown_convert_pasted\")}\n />\n <Typography variant={\"caption\"} className={\"ml-3.5 mt-1 mb-2\"}>\n Convert rich text (from Google Docs, Word, etc.) to clean markdown format\n </Typography>\n </div>\n </ExpandablePanel>\n </div>\n\n <div className={\"col-span-12\"}>\n <ExpandablePanel\n title={\n <div className=\"flex flex-row text-surface-500\">\n <UploadCloudIcon/>\n <Typography variant={\"subtitle2\"}\n className=\"ml-4\">\n File upload config\n </Typography>\n </div>\n }>\n\n <div className={\"grid grid-cols-12 gap-2 p-4\"}>\n\n <div className={\"col-span-12\"}>\n <Field name={fileName}\n as={DebouncedTextField}\n label={t(\"storage_file_name\")}\n size={\"small\"}\n disabled={hasFilenameCallback || disabled}\n value={hasFilenameCallback ? \"-\" : fileNameValue}\n />\n </div>\n <div className={\"col-span-12\"}>\n <Field name={storagePath}\n as={DebouncedTextField}\n label={t(\"storage_path\")}\n disabled={hasStoragePathCallback || disabled}\n size={\"small\"}\n value={hasStoragePathCallback ? \"-\" : storagePathValue}\n />\n <Typography variant={\"caption\"} className={\"ml-3.5 mt-1 mb-2\"}>\n <p>You can use the following placeholders in\n the file name\n and storage path values:</p>\n <ul>\n <li>{\"{file} - Full name of the uploaded file\"}</li>\n <li>{\"{file.name} - Name of the uploaded file without extension\"}</li>\n <li>{\"{file.ext} - Extension of the uploaded file\"}</li>\n <li>{\"{entityId} - ID of the entity\"}</li>\n <li>{\"{propertyKey} - ID of this field\"}</li>\n <li>{\"{path} - Path of this entity\"}</li>\n <li>{\"{rand} - Random value used to avoid name collisions\"}</li>\n </ul>\n </Typography>\n\n <Typography variant={\"caption\"} className={\"ml-3.5 mt-1 mb-2\"}>\n When using Markdown, the URL of the uploaded files are always saved in the text value\n (not\n the path).\n </Typography>\n </div>\n\n <div className={\"col-span-12\"}>\n <DebouncedTextField name={maxSize}\n type={\"number\"}\n label={t(\"storage_max_size\")}\n size={\"small\"}\n value={maxSizeValue !== undefined && maxSizeValue !== null ? maxSizeValue.toString() : \"\"}\n onChange={(e) => {\n const value = e.target.value;\n if (value === \"\") setFieldValue(maxSize, undefined);\n else setFieldValue(maxSize, parseInt(value));\n }}\n />\n </div>\n\n </div>\n </ExpandablePanel>\n </div>\n\n <div className={\"col-span-12\"}>\n\n <TextField name={\"defaultValue\"}\n disabled={disabled}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n setFieldValue(\"defaultValue\", e.target.value === \"\" ? undefined : e.target.value);\n }}\n label={t(\"default_value\")}\n value={(getIn(values, \"defaultValue\") as string | undefined) ?? \"\"}/>\n\n </div>\n </>\n );\n}\n","\nimport React, { useCallback, useDeferredValue, useEffect, useMemo, useRef, useState } from \"react\";\nimport { deepEqual as equal } from \"fast-equals\"\n\nimport { Formex, FormexController, getIn, useCreateFormex } from \"@rebasepro/formex\";\nimport { ConfirmationDialog } from \"@rebasepro/core\";\nimport { DEFAULT_FIELD_CONFIGS, getFieldConfig, getFieldId } from \"../../../components/field_configs\";\nimport { PropertyConfigBadge } from \"../../../components/PropertyConfigBadge\";\nimport { EntityCollection, Property, PropertyConfig, PropertyConfigId } from \"@rebasepro/types\";\nimport type { PropertyTypePreset, PropertyType } from \"../../extensibility_types\";\nimport { toSerializableProperty, toSerializableCollection } from \"../../serializable_utils\";\nimport type { SerializableProperty, SerializableCollection } from \"../../serializable_types\";\nimport { isPropertyBuilder } from \"@rebasepro/common\";\nimport {\n AlertTriangleIcon,\n Button,\n Card,\n cls,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n fieldBackgroundDisabledMixin,\n fieldBackgroundHoverMixin,\n fieldBackgroundMixin,\n IconButton,\n iconSize,\n InfoLabel,\n Tooltip,\n Trash2Icon,\n Typography\n} from \"@rebasepro/ui\";\nimport { EnumPropertyField } from \"./properties/EnumPropertyField\";\nimport { StoragePropertyField } from \"./properties/StoragePropertyField\";\nimport { MapPropertyField } from \"./properties/MapPropertyField\";\nimport { RepeatPropertyField } from \"./properties/RepeatPropertyField\";\nimport { CommonPropertyFields } from \"./properties/CommonPropertyFields\";\nimport { StringPropertyField } from \"./properties/StringPropertyField\";\nimport { BooleanPropertyField } from \"./properties/BooleanPropertyField\";\nimport { BlockPropertyField } from \"./properties/BlockPropertyField\";\nimport { NumberPropertyField } from \"./properties/NumberPropertyField\";\nimport { ReferencePropertyField } from \"./properties/ReferencePropertyField\";\nimport { DateTimePropertyField } from \"./properties/DateTimePropertyField\";\nimport { AdvancedPropertyValidation } from \"./properties/advanced/AdvancedPropertyValidation\";\nimport { VectorPropertyField } from \"./properties/VectorPropertyField\";\n\nimport { KeyValuePropertyField } from \"./properties/KeyValuePropertyField\";\nimport { RelationPropertyField } from \"./properties/RelationPropertyField\";\nimport { updatePropertyFromWidget } from \"./utils/update_property_for_widget\";\nimport { UrlPropertyField } from \"./properties/UrlPropertyField\";\nimport { supportedFields } from \"./utils/supported_fields\";\nimport { MarkdownPropertyField } from \"./properties/MarkdownPropertyField\";\nimport { isValidRegExp, mergeDeep } from \"@rebasepro/utils\";\n\nexport type PropertyWithId = Property & {\n id?: string;\n conditions?: import(\"@rebasepro/types\").PropertyConditions;\n};\n\nexport type OnPropertyChangedParams = {\n id?: string,\n property: Property,\n namespace?: string,\n previousId?: string\n};\n\nexport type PropertyFormProps = {\n includeIdAndName?: boolean;\n existingProperty: boolean;\n autoUpdateId?: boolean;\n autoOpenTypeSelect: boolean;\n inArray: boolean;\n propertyKey?: string;\n propertyNamespace?: string;\n property?: Property;\n onPropertyChanged?: (params: OnPropertyChangedParams) => void;\n onPropertyChangedImmediate?: boolean;\n onDismiss?: () => void;\n onDelete?: (id?: string, namespace?: string) => void;\n onError?: (id: string, namespace?: string, error?: Record<string, any>) => void;\n initialErrors?: Record<string, any>;\n existingPropertyKeys?: string[];\n forceShowErrors?: boolean;\n allowDataInference: boolean;\n getData?: () => Promise<object[]>;\n getController?: (formex: FormexController<PropertyWithId>) => void;\n propertyConfigs: Record<string, PropertyConfig>;\n propertyTypePresets?: PropertyTypePreset[];\n hiddenPropertyTypes?: PropertyType[];\n renderExtraPropertyFields?: (params: {\n metadata: Record<string, unknown>;\n onMetadataChange: (key: string, value: unknown) => void;\n property: SerializableProperty;\n collection: SerializableCollection;\n }) => React.ReactNode;\n collectionValues?: EntityCollection;\n\n};\n\nexport const PropertyForm = React.memo(\n function PropertyForm(props: PropertyFormProps) {\n\n const {\n includeIdAndName = true,\n autoOpenTypeSelect,\n existingProperty,\n autoUpdateId,\n inArray,\n propertyKey,\n existingPropertyKeys,\n propertyNamespace,\n property,\n onPropertyChanged,\n onPropertyChangedImmediate = true,\n onDismiss,\n onDelete,\n onError,\n initialErrors,\n forceShowErrors,\n allowDataInference,\n getController,\n getData,\n propertyConfigs,\n propertyTypePresets,\n hiddenPropertyTypes,\n renderExtraPropertyFields,\n collectionValues\n } = props;\n\n const initialValue: PropertyWithId = {\n id: \"\",\n name: \"\"\n } as PropertyWithId;\n\n const disabled = Boolean(property && isPropertyBuilder(property));\n\n const lastSubmittedProperty = useRef<OnPropertyChangedParams | undefined>(property ? {\n id: propertyKey,\n previousId: propertyKey,\n property\n } : undefined);\n\n const doOnPropertyChanged = ({\n id,\n property\n }: OnPropertyChangedParams) => {\n const params = {\n id,\n previousId: lastSubmittedProperty.current?.id,\n property,\n namespace: propertyNamespace\n };\n lastSubmittedProperty.current = params;\n onPropertyChanged?.(params);\n };\n\n const formexController = useCreateFormex<PropertyWithId>({\n debugId: \"PROPERTY_FORM\",\n initialValues: property\n ? { id: propertyKey,\n...property } as PropertyWithId\n : initialValue,\n initialErrors,\n validateOnChange: true,\n validateOnInitialRender: true,\n onSubmit: (newPropertyWithId, controller) => {\n const {\n id,\n ...property\n } = newPropertyWithId;\n doOnPropertyChanged({\n id,\n property: property as Property\n });\n if (!existingProperty)\n controller.resetForm({ values: initialValue });\n },\n validation: (values) => {\n const errors: Record<string, any> = {};\n if (includeIdAndName) {\n if (!values.name) {\n errors.name = \"Required\";\n } else {\n const nameError = validateName(values.name);\n if (nameError)\n errors.name = nameError;\n }\n if (!values.id) {\n errors.id = \"Required\";\n } else {\n const idError = validateId(values.id, existingPropertyKeys);\n if (idError)\n errors.id = idError;\n }\n }\n\n if (values.type === \"string\") {\n if (values.validation?.matches && !isValidRegExp(values.validation?.matches.toString())) {\n errors.validation = {\n matches: \"Invalid regular expression\"\n }\n }\n }\n if (values.type === \"reference\" && !values.path) {\n errors.slug = \"You must specify a target collection for the field\";\n }\n if (values.type === \"vector\" && (!values.dimensions || isNaN(Number(values.dimensions)) || Number(values.dimensions) <= 0)) {\n errors.dimensions = \"Vector dimensions must be a positive number\";\n }\n if (values.propertyConfig === \"repeat\") {\n if (!(\"of\" in values) || !values.of) {\n errors.of = \"You need to specify a repeat field\";\n }\n }\n if (values.propertyConfig === \"block\") {\n if (!(\"oneOf\" in values) || !values.oneOf) {\n errors.oneOf = \"You need to specify the properties of this block\";\n }\n }\n return errors;\n }\n });\n\n useEffect(() => {\n getController?.(formexController);\n }, [formexController, getController]);\n\n return <Formex value={formexController}>\n <PropertyEditFormFields\n onPropertyChanged={onPropertyChangedImmediate\n ? doOnPropertyChanged\n : undefined}\n onDelete={onDelete}\n includeIdAndTitle={includeIdAndName}\n propertyNamespace={propertyNamespace}\n onError={onError}\n onDismiss={onDismiss}\n showErrors={forceShowErrors || formexController.submitCount > 0}\n existing={existingProperty}\n autoUpdateId={autoUpdateId}\n inArray={inArray}\n autoOpenTypeSelect={autoOpenTypeSelect}\n disabled={disabled}\n getData={getData}\n allowDataInference={allowDataInference}\n propertyConfigs={propertyConfigs}\n propertyTypePresets={propertyTypePresets}\n hiddenPropertyTypes={hiddenPropertyTypes}\n renderExtraPropertyFields={renderExtraPropertyFields}\n collectionValues={collectionValues}\n {...formexController}/>\n </Formex>;\n }, (a, b) =>\n a.getData === b.getData &&\n a.propertyKey === b.propertyKey &&\n a.propertyNamespace === b.propertyNamespace &&\n a.includeIdAndName === b.includeIdAndName &&\n a.autoOpenTypeSelect === b.autoOpenTypeSelect &&\n a.autoUpdateId === b.autoUpdateId &&\n a.existingPropertyKeys === b.existingPropertyKeys &&\n a.existingProperty === b.existingProperty\n);\n\nexport function PropertyFormDialog({\n open,\n onCancel,\n onOkClicked,\n onPropertyChanged,\n getData,\n ...formProps\n}: PropertyFormProps & {\n open?: boolean;\n onOkClicked?: () => void;\n onCancel?: () => void;\n}) {\n const formexRef = useRef<FormexController<PropertyWithId>>(undefined);\n const getController = (helpers: FormexController<PropertyWithId>) => {\n formexRef.current = helpers;\n };\n\n return <Dialog\n open={open ?? false}\n maxWidth={\"xl\"}\n fullWidth={true}\n >\n <form noValidate={true}\n autoComplete={\"off\"}\n onSubmit={(e) => {\n e.preventDefault();\n e.stopPropagation();\n formexRef.current?.handleSubmit(e)\n }}>\n <DialogTitle hidden>Property edit view</DialogTitle>\n <DialogContent>\n\n <PropertyForm {...formProps}\n onDismiss={onCancel}\n onPropertyChanged={(params) => {\n onPropertyChanged?.(params);\n onOkClicked?.();\n }}\n\n onPropertyChangedImmediate={false}\n getController={getController}\n getData={getData}\n />\n </DialogContent>\n\n <DialogActions>\n\n {onCancel && <Button\n variant={\"text\"}\n onClick={() => {\n onCancel();\n formexRef.current?.resetForm();\n }}>\n Cancel\n </Button>}\n\n <Button type={\"submit\"}>\n Ok\n </Button>\n </DialogActions>\n </form>\n </Dialog>;\n\n}\n\nfunction PropertyEditFormFields({\n values,\n errors,\n setValues,\n existing,\n autoUpdateId = false,\n autoOpenTypeSelect,\n includeIdAndTitle,\n onPropertyChanged,\n onDelete,\n propertyNamespace,\n onDismiss,\n onError,\n showErrors,\n disabled,\n inArray,\n getData,\n allowDataInference,\n propertyConfigs,\n propertyTypePresets,\n hiddenPropertyTypes,\n renderExtraPropertyFields,\n collectionValues\n}: {\n includeIdAndTitle?: boolean;\n existing: boolean;\n autoUpdateId?: boolean;\n autoOpenTypeSelect: boolean;\n propertyNamespace?: string;\n onDismiss?: () => void;\n onPropertyChanged?: (params: OnPropertyChangedParams) => void;\n onDelete?: (id?: string, namespace?: string) => void;\n onError?: (id: string, namespace?: string, error?: Record<string, any>) => void;\n showErrors: boolean;\n inArray: boolean;\n disabled: boolean;\n getData?: () => Promise<object[]>;\n allowDataInference: boolean;\n propertyConfigs: Record<string, PropertyConfig>;\n propertyTypePresets?: PropertyTypePreset[];\n hiddenPropertyTypes?: PropertyType[];\n renderExtraPropertyFields?: PropertyFormProps[\"renderExtraPropertyFields\"];\n collectionValues?: EntityCollection;\n\n} & FormexController<PropertyWithId>) {\n\n const [selectOpen, setSelectOpen] = useState(autoOpenTypeSelect);\n const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);\n const [selectedFieldConfigId, setSelectedFieldConfigId] = useState<string | undefined>(values?.type ? getFieldId(values) : undefined);\n\n const deferredValues = useDeferredValue(values);\n const nameFieldRef = useRef<HTMLInputElement>(null);\n\n const lastSubmittedProperty = useRef<object>(values);\n\n const selectedWidgetError = showErrors && getIn(errors, \"selectedWidget\");\n\n useEffect(() => {\n if (onPropertyChanged) {\n if ((!includeIdAndTitle || deferredValues.id)) {\n const {\n id,\n ...property\n } = deferredValues;\n if (!equal(deferredValues, lastSubmittedProperty.current)) {\n onPropertyChanged({\n id,\n property,\n namespace: propertyNamespace\n });\n lastSubmittedProperty.current = deferredValues;\n }\n }\n }\n }, [deferredValues, includeIdAndTitle, propertyNamespace]);\n\n useEffect(() => {\n if (values?.id && onError) {\n onError(values?.id, propertyNamespace, errors);\n }\n }, [errors, propertyNamespace, values?.id]);\n\n const onWidgetSelectChanged = (newSelectedWidgetId: PropertyConfigId) => {\n setSelectedFieldConfigId(newSelectedWidgetId);\n setValues(updatePropertyFromWidget(values, newSelectedWidgetId, propertyConfigs));\n // Ugly hack to autofocus the name field\n setTimeout(() => {\n nameFieldRef.current?.focus();\n }, 0);\n };\n\n const onPresetSelected = useCallback((preset: PropertyTypePreset) => {\n // Map baseType to the default widgetId\n const BASE_TYPE_TO_WIDGET: Record<string, string> = {\n \"string\": \"text_field\",\n \"number\": \"number_input\",\n \"boolean\": \"switch\",\n \"date\": \"date_time\",\n \"reference\": \"reference\",\n \"relation\": \"relation\",\n \"map\": \"group\",\n \"array\": \"repeat\",\n \"vector\": \"vector_input\",\n \"geopoint\": \"text_field\",\n \"binary\": \"text_field\",\n };\n const widgetId = BASE_TYPE_TO_WIDGET[preset.baseType] || \"text_field\";\n setSelectedFieldConfigId(widgetId);\n // Merge preset defaults into the property\n const updatedValues = updatePropertyFromWidget(values, widgetId, propertyConfigs);\n const mergedValues = { ...updatedValues, ...preset.defaults, propertyConfig: widgetId };\n setValues(mergedValues as PropertyWithId);\n }, [values, propertyConfigs, setValues]);\n\n let childComponent;\n if (selectedFieldConfigId === \"text_field\" ||\n selectedFieldConfigId === \"multiline\" ||\n selectedFieldConfigId === \"user_select\" ||\n selectedFieldConfigId === \"email\") {\n childComponent =\n <StringPropertyField widgetId={selectedFieldConfigId}\n disabled={disabled}\n showErrors={showErrors}/>;\n } else if (selectedFieldConfigId === \"url\") {\n childComponent =\n <UrlPropertyField disabled={disabled}\n showErrors={showErrors}/>;\n } else if (selectedFieldConfigId === \"markdown\") {\n childComponent =\n <MarkdownPropertyField disabled={disabled}\n showErrors={showErrors}/>;\n } else if (selectedFieldConfigId === \"select\" ||\n selectedFieldConfigId === \"number_select\") {\n childComponent = <EnumPropertyField\n multiselect={false}\n allowDataInference={allowDataInference}\n updateIds={!existing}\n disabled={disabled}\n getData={getData}\n propertyNamespace={propertyNamespace}\n showErrors={showErrors}/>;\n } else if (selectedFieldConfigId === \"multi_select\" ||\n selectedFieldConfigId === \"multi_number_select\") {\n childComponent = <EnumPropertyField\n multiselect={true}\n updateIds={!existing}\n disabled={disabled}\n allowDataInference={allowDataInference}\n getData={getData}\n propertyNamespace={propertyNamespace}\n showErrors={showErrors}/>;\n } else if (selectedFieldConfigId === \"file_upload\") {\n childComponent =\n <StoragePropertyField existing={existing}\n multiple={false}\n disabled={disabled}/>;\n } else if (selectedFieldConfigId === \"multi_file_upload\") {\n childComponent =\n <StoragePropertyField existing={existing}\n multiple={true}\n disabled={disabled}/>;\n } else if (selectedFieldConfigId === \"switch\") {\n childComponent = <BooleanPropertyField disabled={disabled}/>;\n } else if (selectedFieldConfigId === \"number_input\") {\n childComponent = <NumberPropertyField disabled={disabled}/>;\n } else if (selectedFieldConfigId === \"group\") {\n childComponent =\n <MapPropertyField disabled={disabled} getData={getData} allowDataInference={allowDataInference}\n propertyConfigs={propertyConfigs}/>;\n } else if (selectedFieldConfigId === \"block\") {\n childComponent =\n <BlockPropertyField disabled={disabled} getData={getData} allowDataInference={allowDataInference}\n propertyConfigs={propertyConfigs}/>;\n } else if (selectedFieldConfigId === \"reference\") {\n childComponent =\n <ReferencePropertyField showErrors={showErrors}\n existing={existing}\n multiple={false}\n disabled={disabled}/>;\n } else if (selectedFieldConfigId === \"reference_as_string\") {\n childComponent =\n <ReferencePropertyField showErrors={showErrors}\n existing={existing}\n asString={true}\n multiple={false}\n disabled={disabled}/>;\n } else if (selectedFieldConfigId === \"date_time\") {\n childComponent = <DateTimePropertyField disabled={disabled}/>;\n } else if (selectedFieldConfigId === \"multi_references\") {\n childComponent =\n <ReferencePropertyField showErrors={showErrors}\n existing={existing}\n multiple={true}\n disabled={disabled}/>;\n } else if (selectedFieldConfigId === \"repeat\") {\n childComponent =\n <RepeatPropertyField showErrors={showErrors}\n existing={existing}\n getData={getData}\n allowDataInference={allowDataInference}\n disabled={disabled}\n propertyConfigs={propertyConfigs}/>;\n } else if (selectedFieldConfigId === \"key_value\") {\n childComponent =\n <KeyValuePropertyField disabled={disabled}/>;\n } else if (selectedFieldConfigId === \"relation\") {\n childComponent =\n <RelationPropertyField\n showErrors={showErrors}\n disabled={disabled}/>;\n } else if (selectedFieldConfigId === \"vector_input\") {\n childComponent =\n <VectorPropertyField\n disabled={disabled}/>;\n } else {\n childComponent = null;\n }\n\n return (\n <>\n {disabled && <InfoLabel mode={\"warn\"}>\n <Typography>This property can&apos;t be edited</Typography>\n <Typography variant={\"caption\"}>\n You may not have permission to\n edit it or it is defined in code and cannot be modified.\n </Typography>\n </InfoLabel>}\n\n <div className=\"flex mt-2 items-start justify-between\">\n <div className={\"w-full flex flex-col gap-2\"}>\n <WidgetSelectView\n initialProperty={values}\n value={selectedFieldConfigId as PropertyConfigId}\n onValueChange={(value) => onWidgetSelectChanged(value as PropertyConfigId)}\n open={selectOpen}\n onOpenChange={(open, hasValue) => {\n if (!hasValue) {\n onDismiss?.();\n }\n setSelectOpen(open);\n }}\n disabled={disabled}\n showError={Boolean(selectedWidgetError)}\n existing={existing}\n propertyConfigs={propertyConfigs}\n inArray={inArray}\n propertyTypePresets={propertyTypePresets}\n hiddenPropertyTypes={hiddenPropertyTypes}\n onPresetSelected={onPresetSelected}/>\n\n {!!selectedWidgetError &&\n <Typography variant=\"caption\"\n className={\"ml-3.5\"}\n color={\"error\"}>Required</Typography>}\n\n {/*<Typography variant=\"caption\" className={\"ml-3.5\"}>Define your own custom properties and*/}\n {/* components</Typography>*/}\n\n </div>\n\n {onDelete && values?.id &&\n <IconButton\n variant={\"ghost\"}\n className=\"mt-1 shrink-0\"\n disabled={disabled}\n onClick={() => setDeleteDialogOpen(true)}>\n <Trash2Icon size={iconSize.small}/>\n </IconButton>}\n </div>\n\n <div className={\"grid grid-cols-12 gap-y-8 mt-6 mb-8\"}>\n {includeIdAndTitle &&\n <CommonPropertyFields showErrors={showErrors}\n disabledId={existing}\n isNewProperty={!existing}\n disabled={disabled}\n autoUpdateId={autoUpdateId}\n ref={nameFieldRef}/>}\n\n {childComponent}\n\n {renderExtraPropertyFields && collectionValues && (\n <div className=\"col-span-12 mt-4 px-2\">\n {renderExtraPropertyFields({\n metadata: ((values as unknown as Record<string, unknown>).metadata as Record<string, unknown>) ?? {},\n onMetadataChange: (key: string, value: unknown) => {\n const currentMetadata = ((values as unknown as Record<string, unknown>).metadata as Record<string, unknown>) ?? {};\n setValues({\n ...values,\n metadata: { ...currentMetadata, [key]: value },\n } as PropertyWithId);\n },\n property: toSerializableProperty(values as Property),\n collection: toSerializableCollection(collectionValues),\n })}\n </div>\n )}\n\n <div className={\"col-span-12\"}>\n <AdvancedPropertyValidation disabled={disabled}/>\n </div>\n </div>\n\n {onDelete &&\n <ConfirmationDialog open={deleteDialogOpen}\n onAccept={() => onDelete(values?.id, propertyNamespace)}\n onCancel={() => setDeleteDialogOpen(false)}\n title={<div>Delete this property?</div>}\n body={\n <div> This will <b>not delete any\n data</b>, only modify the\n collection.</div>\n }/>}\n\n </>\n );\n}\n\nconst idRegEx = /^[a-zA-Z_][a-zA-Z0-9_]*$/;\n\nfunction validateId(value?: string, existingPropertyKeys?: string[]) {\n\n let error;\n if (!value) {\n error = \"You must specify an id for the field\";\n }\n if (value && !value.match(idRegEx)) {\n error = \"The id can only contain letters, numbers and underscores (_), and not start with a number\";\n }\n if (value && existingPropertyKeys && existingPropertyKeys.includes(value)) {\n error = \"There is another field with this ID already\";\n }\n return error;\n}\n\nfunction validateName(value: string) {\n let error;\n if (!value) {\n error = \"You must specify a title for the field\";\n }\n return error;\n}\n\nconst WIDGET_TYPE_MAP: Record<PropertyConfigId, string> = {\n text_field: \"Text\",\n multiline: \"Text\",\n markdown: \"Text\",\n url: \"Text\",\n email: \"Text\",\n switch: \"Boolean\",\n user_select: \"Users\",\n select: \"Select\",\n multi_select: \"Select\",\n number_input: \"Number\",\n number_select: \"Select\",\n multi_number_select: \"Select\",\n file_upload: \"File\",\n multi_file_upload: \"File\",\n relation: \"Relation\",\n reference: \"Reference\",\n reference_as_string: \"Text\",\n multi_references: \"Reference\",\n date_time: \"Date\",\n group: \"Group\",\n key_value: \"Group\",\n repeat: \"Array\",\n custom_array: \"Array\",\n block: \"Group\",\n vector_input: \"Number\"\n};\n\nconst WIDGET_BASE_TYPE_MAP: Record<string, PropertyType> = {\n text_field: \"string\",\n multiline: \"string\",\n markdown: \"string\",\n url: \"string\",\n email: \"string\",\n select: \"string\",\n multi_select: \"string\",\n file_upload: \"string\",\n multi_file_upload: \"string\",\n reference_as_string: \"string\",\n user_select: \"string\",\n number_input: \"number\",\n number_select: \"number\",\n multi_number_select: \"number\",\n switch: \"boolean\",\n date_time: \"date\",\n reference: \"reference\",\n multi_references: \"reference\",\n relation: \"relation\",\n group: \"map\",\n key_value: \"map\",\n block: \"map\",\n repeat: \"array\",\n custom_array: \"array\",\n vector_input: \"vector\",\n};\n\nfunction WidgetSelectView({\n initialProperty,\n value,\n onValueChange,\n open,\n onOpenChange,\n disabled,\n showError,\n existing,\n propertyConfigs,\n inArray,\n propertyTypePresets,\n hiddenPropertyTypes,\n onPresetSelected\n}: {\n initialProperty?: PropertyWithId,\n value?: PropertyConfigId,\n onValueChange: (value: string) => void,\n showError: boolean,\n open: boolean,\n onOpenChange: (open: boolean, hasValue: boolean) => void,\n disabled: boolean,\n existing: boolean,\n propertyConfigs: Record<string, PropertyConfig>,\n inArray?: boolean,\n propertyTypePresets?: PropertyTypePreset[],\n hiddenPropertyTypes?: PropertyType[],\n onPresetSelected?: (preset: PropertyTypePreset) => void,\n}) {\n\n const allSupportedFields = Object.entries(supportedFields).concat(Object.entries(propertyConfigs));\n\n const filteredFields = hiddenPropertyTypes && !propertyTypePresets\n ? allSupportedFields.filter(([key]) => {\n const baseType = WIDGET_BASE_TYPE_MAP[key];\n return !baseType || !hiddenPropertyTypes.includes(baseType);\n })\n : allSupportedFields;\n\n const displayedWidgets = (inArray\n ? filteredFields.filter(([_, propertyConfig]) => !isPropertyBuilder(propertyConfig.property as Property) && (propertyConfig.property as Property)?.type !== \"array\")\n : filteredFields)\n .map(([key, propertyConfig]) => ({\n [key]: propertyConfig\n }))\n .reduce((a, b) => {\n return {\n ...a,\n ...b\n }\n }, {});\n\n const activePreset = useMemo(() => {\n if (!propertyTypePresets || !initialProperty) return undefined;\n return propertyTypePresets.find(p => p.detect?.(toSerializableProperty(initialProperty as Property)));\n }, [propertyTypePresets, initialProperty]);\n\n const key = value;\n const propertyConfig = key ? (DEFAULT_FIELD_CONFIGS[key] ?? propertyConfigs[key]) : undefined;\n const baseProperty = propertyConfig?.property;\n const baseFieldConfig = baseProperty && !isPropertyBuilder(baseProperty as Property) ? getFieldConfig(baseProperty as Property, propertyConfigs) : undefined;\n const computedFieldConfig = baseFieldConfig && propertyConfig ? mergeDeep(baseFieldConfig, propertyConfig) : propertyConfig;\n\n const groups: string[] = [...new Set(Object.keys(displayedWidgets).map(key => {\n const group = WIDGET_TYPE_MAP[key as PropertyConfigId];\n if (group) {\n return group;\n }\n return \"Custom/Other\"\n }))];\n\n return <>\n <div\n onClick={() => {\n if (!disabled) {\n onOpenChange(!open, Boolean(value));\n }\n }}\n className={cls(\n \"select-none rounded-md text-sm py-2 px-1 transition-colors duration-200\",\n !disabled && \"hover:bg-surface-50 dark:hover:bg-surface-800 cursor-pointer\",\n \"relative flex items-center mb-2\"\n )}>\n {!value && <em>Select a property widget</em>}\n {value && computedFieldConfig && <div\n className={cls(\n \"flex items-center\")}>\n <div className={\"mr-4\"}>\n <PropertyConfigBadge propertyConfig={computedFieldConfig}/>\n </div>\n <div className={\"flex flex-col items-start text-left\"}>\n <div className=\"font-semibold text-text-primary dark:text-text-primary-dark tracking-tight\">{computedFieldConfig.name}</div>\n <Typography variant={\"caption\"}\n className=\"text-text-secondary dark:text-text-secondary-dark mt-0.5\">\n {computedFieldConfig.description}\n </Typography>\n </div>\n </div>}\n </div>\n <Dialog open={open}\n onOpenChange={(open: boolean) => onOpenChange(open, Boolean(value))}\n maxWidth={\"4xl\"}>\n <DialogTitle>\n {propertyTypePresets ? \"Select a property type\" : \"Select a property widget\"}\n </DialogTitle>\n <DialogContent>\n {propertyTypePresets ? (\n <div className={\"grid grid-cols-1 md:grid-cols-2 gap-x-4 gap-y-2 mt-4\"}>\n {propertyTypePresets.map((preset) => (\n <Card\n key={preset.id}\n onClick={() => {\n onPresetSelected?.(preset);\n onOpenChange(false, true);\n }}\n className={cls(\n \"flex flex-row items-center px-4 py-2 m-1\",\n activePreset?.id === preset.id && \"ring-2 ring-primary\"\n )}>\n <div className={cls(\"flex flex-row items-center text-base min-h-[48px]\")}>\n {preset.icon && (\n <div className={\"mr-4 text-2xl\"}>\n {typeof preset.icon === \"string\" ? preset.icon : preset.icon}\n </div>\n )}\n <div>\n <Typography variant={\"label\"}>{preset.label}</Typography>\n </div>\n </div>\n </Card>\n ))}\n </div>\n ) : (\n <div>\n {groups.map(group => {\n return <div key={group} className={\"mt-4\"}>\n <Typography variant={\"label\"}>{group}</Typography>\n <div className={\"grid grid-cols-1 md:grid-cols-2 gap-x-4 gap-y-2 mt-4\"}>\n {Object.entries(displayedWidgets).map(([key, propertyConfig]) => {\n const groupKey = WIDGET_TYPE_MAP[key as PropertyConfigId];\n if (groupKey === group) {\n return <WidgetSelectViewItem\n key={key}\n initialProperty={initialProperty}\n onClick={() => {\n onValueChange(key);\n onOpenChange(false, true);\n }}\n propertyConfig={propertyConfig}\n existing={existing}/>;\n }\n return null;\n })}\n </div>\n </div>;\n })}\n {/*{displayedWidgets.map(([key, propertyConfig]) => {*/}\n {/* return <WidgetSelectViewItem*/}\n {/* key={key}*/}\n {/* initialProperty={initialProperty}*/}\n {/* onClick={() => {*/}\n {/* onValueChange(key);*/}\n {/* onOpenChange(false);*/}\n {/* }}*/}\n {/* propertyConfig={propertyConfig}*/}\n {/* existing={existing}/>;*/}\n {/*})}*/}\n </div>\n )}\n </DialogContent>\n </Dialog>\n </>;\n}\n\nexport interface PropertySelectItemProps {\n onClick?: () => void;\n initialProperty?: PropertyWithId;\n propertyConfig: PropertyConfig;\n existing: boolean;\n}\n\nexport function WidgetSelectViewItem({\n onClick,\n initialProperty,\n // optionDisabled,\n propertyConfig,\n existing\n}: PropertySelectItemProps) {\n const baseProperty = propertyConfig.property;\n const shouldWarnChangingtype = existing && !isPropertyBuilder(baseProperty as Property) && (baseProperty as Property).type !== initialProperty?.type;\n\n return <Card\n onClick={onClick}\n className={\"flex flex-row items-center px-4 py-2 m-1\"}>\n <div\n className={cls(\n \"flex flex-row items-center text-base min-h-[48px]\"\n )}>\n <div className={\"mr-8\"}>\n <PropertyConfigBadge propertyConfig={propertyConfig} disabled={shouldWarnChangingtype}/>\n </div>\n <div>\n <div className={\"flex flex-row gap-2 items-center\"}>\n {shouldWarnChangingtype && <Tooltip\n title={\"This widget uses a different data type than the initially selected widget. This can cause errors with existing data.\"}>\n <AlertTriangleIcon size={iconSize.smallest} className={\"w-4\"}/>\n </Tooltip>}\n <Typography\n variant={\"label\"}\n color={shouldWarnChangingtype ? \"secondary\" : undefined}>{propertyConfig.name}</Typography>\n </div>\n\n <Typography variant={\"caption\"}\n color={\"secondary\"}\n className={\"max-w-sm\"}>\n {propertyConfig.description}\n </Typography>\n\n </div>\n </div>\n </Card>\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAEA,SAAgB,4BAAkF;CAC9F,IAAI;EACA,OAAO,sBAAsB;CACjC,QA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