@rebasepro/cms 0.17.3 → 0.18.1

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 (449) hide show
  1. package/README.md +4 -0
  2. package/dist/{CollectionEditorDialog-B-akreOU.js → CollectionEditorDialog-BeX4b92r.js} +13 -7
  3. package/dist/{CollectionEditorDialog-B-akreOU.js.map → CollectionEditorDialog-BeX4b92r.js.map} +1 -1
  4. package/dist/{PropertyEditView-CiY84wkR.js → PropertyEditView-C7thfj4L.js} +3 -3
  5. package/dist/{PropertyEditView-CiY84wkR.js.map → PropertyEditView-C7thfj4L.js.map} +1 -1
  6. package/dist/{RouterCollectionsStudioView-DkAWda4N.js → RouterCollectionsStudioView-BtjzvB6E.js} +4 -4
  7. package/dist/{RouterCollectionsStudioView-DkAWda4N.js.map → RouterCollectionsStudioView-BtjzvB6E.js.map} +1 -1
  8. package/dist/{SchemaChangeDialog-DceT8QFX.js → SchemaChangeDialog-CkqK6KOC.js} +4 -2
  9. package/dist/{SchemaChangeDialog-DceT8QFX.js.map → SchemaChangeDialog-CkqK6KOC.js.map} +1 -1
  10. package/dist/collection_editor/api/generateCollectionApi.d.ts +1 -2
  11. package/dist/collection_editor_ui.d.ts +2 -0
  12. package/dist/collection_editor_ui.js +6 -5
  13. package/dist/collection_editor_ui.js.map +1 -1
  14. package/dist/components/DeleteEntityDialog.d.ts +2 -3
  15. package/dist/components/RebaseLayout.d.ts +11 -4
  16. package/dist/components/field_configs.d.ts +1 -1
  17. package/dist/editor/sanitize-html.d.ts +15 -0
  18. package/dist/editor.js +195 -10
  19. package/dist/editor.js.map +1 -1
  20. package/dist/{export-Ben8E355.js → export--arni_VY.js} +2 -2
  21. package/dist/{export-Ben8E355.js.map → export--arni_VY.js.map} +1 -1
  22. package/dist/form/components/LabelWithIcon.d.ts +10 -0
  23. package/dist/{history-DIEVd26f.js → history-C2TpoQwi.js} +2 -2
  24. package/dist/{history-DIEVd26f.js.map → history-C2TpoQwi.js.map} +1 -1
  25. package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +1 -1
  26. package/dist/hooks/navigation/useResolvedViews.d.ts +1 -1
  27. package/dist/hooks/navigation/useTopLevelNavigation.d.ts +1 -1
  28. package/dist/{import-D25x7ko-.js → import-DTkXNoBg.js} +2 -2
  29. package/dist/{import-D25x7ko-.js.map → import-DTkXNoBg.js.map} +1 -1
  30. package/dist/index.js +78 -33
  31. package/dist/index.js.map +1 -1
  32. package/dist/util/propertyConfigMapper.d.ts +1 -1
  33. package/dist/util-CfLFggP7.js +57 -0
  34. package/dist/util-CfLFggP7.js.map +1 -0
  35. package/dist/{util-DVqnqlLn.js → util-DE1WQW6h.js} +134 -112
  36. package/dist/util-DE1WQW6h.js.map +1 -0
  37. package/package.json +42 -34
  38. package/dist/util-DVqnqlLn.js.map +0 -1
  39. package/src/collection_editor/CollectionEditorDialogsContext.tsx +0 -25
  40. package/src/collection_editor/ConfigControllerProvider.tsx +0 -395
  41. package/src/collection_editor/_cms_internals.ts +0 -41
  42. package/src/collection_editor/api/generateCollectionApi.ts +0 -126
  43. package/src/collection_editor/api/index.ts +0 -1
  44. package/src/collection_editor/extensibility_types.ts +0 -168
  45. package/src/collection_editor/index.ts +0 -108
  46. package/src/collection_editor/liveSchemaClient.ts +0 -285
  47. package/src/collection_editor/relation_kinds.ts +0 -44
  48. package/src/collection_editor/serializable_types.ts +0 -535
  49. package/src/collection_editor/serializable_utils.ts +0 -729
  50. package/src/collection_editor/types/collection_editor_controller.tsx +0 -62
  51. package/src/collection_editor/types/collection_inference.ts +0 -18
  52. package/src/collection_editor/types/config_controller.tsx +0 -121
  53. package/src/collection_editor/ui/AddKanbanColumnAction.tsx +0 -199
  54. package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +0 -51
  55. package/src/collection_editor/ui/EditorCollectionAction.tsx +0 -54
  56. package/src/collection_editor/ui/EditorCollectionActionStart.tsx +0 -90
  57. package/src/collection_editor/ui/EditorEntityAction.tsx +0 -50
  58. package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +0 -114
  59. package/src/collection_editor/ui/KanbanSetupAction.tsx +0 -43
  60. package/src/collection_editor/ui/MissingReferenceWidget.tsx +0 -35
  61. package/src/collection_editor/ui/NewCollectionButton.tsx +0 -27
  62. package/src/collection_editor/ui/NewCollectionCard.tsx +0 -48
  63. package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +0 -49
  64. package/src/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.tsx +0 -260
  65. package/src/collection_editor/ui/collection_editor/AIModifiedPathsContext.tsx +0 -90
  66. package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +0 -388
  67. package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +0 -1098
  68. package/src/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.tsx +0 -301
  69. package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +0 -172
  70. package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +0 -620
  71. package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +0 -530
  72. package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +0 -462
  73. package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +0 -104
  74. package/src/collection_editor/ui/collection_editor/CollectionYupValidation.tsx +0 -9
  75. package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +0 -199
  76. package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +0 -315
  77. package/src/collection_editor/ui/collection_editor/EntityActionsEditTab.tsx +0 -164
  78. package/src/collection_editor/ui/collection_editor/EntityActionsSelectDialog.tsx +0 -40
  79. package/src/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +0 -39
  80. package/src/collection_editor/ui/collection_editor/EnumForm.tsx +0 -373
  81. package/src/collection_editor/ui/collection_editor/GeneralSettingsForm.tsx +0 -288
  82. package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +0 -141
  83. package/src/collection_editor/ui/collection_editor/KanbanConfigSection.tsx +0 -194
  84. package/src/collection_editor/ui/collection_editor/LayoutModeSwitch.tsx +0 -53
  85. package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +0 -980
  86. package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +0 -164
  87. package/src/collection_editor/ui/collection_editor/PropertyTree.tsx +0 -364
  88. package/src/collection_editor/ui/collection_editor/RouterCollectionStudioView.tsx +0 -44
  89. package/src/collection_editor/ui/collection_editor/RouterCollectionsStudioView.tsx +0 -41
  90. package/src/collection_editor/ui/collection_editor/SchemaChangeDialog.tsx +0 -470
  91. package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +0 -256
  92. package/src/collection_editor/ui/collection_editor/SwitchControl.tsx +0 -39
  93. package/src/collection_editor/ui/collection_editor/ViewModeSwitch.tsx +0 -68
  94. package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +0 -67
  95. package/src/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.tsx +0 -296
  96. package/src/collection_editor/ui/collection_editor/import/clean_import_data.ts +0 -57
  97. package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +0 -147
  98. package/src/collection_editor/ui/collection_editor/properties/BooleanPropertyField.tsx +0 -41
  99. package/src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx +0 -113
  100. package/src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx +0 -250
  101. package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +0 -126
  102. package/src/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.tsx +0 -20
  103. package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +0 -153
  104. package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +0 -217
  105. package/src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx +0 -117
  106. package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +0 -129
  107. package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +0 -335
  108. package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +0 -107
  109. package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +0 -403
  110. package/src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx +0 -148
  111. package/src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx +0 -91
  112. package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +0 -34
  113. package/src/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +0 -49
  114. package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.tsx +0 -925
  115. package/src/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.tsx +0 -28
  116. package/src/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.tsx +0 -626
  117. package/src/collection_editor/ui/collection_editor/properties/conditions/index.ts +0 -6
  118. package/src/collection_editor/ui/collection_editor/properties/conditions/property_paths.ts +0 -93
  119. package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +0 -52
  120. package/src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +0 -63
  121. package/src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +0 -114
  122. package/src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +0 -154
  123. package/src/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.tsx +0 -28
  124. package/src/collection_editor/ui/collection_editor/templates/blog_template.ts +0 -112
  125. package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +0 -183
  126. package/src/collection_editor/ui/collection_editor/templates/products_template.ts +0 -88
  127. package/src/collection_editor/ui/collection_editor/templates/users_template.ts +0 -42
  128. package/src/collection_editor/ui/collection_editor/util.ts +0 -28
  129. package/src/collection_editor/ui/collection_editor/utils/strings.ts +0 -1
  130. package/src/collection_editor/ui/collection_editor/utils/supported_fields.tsx +0 -39
  131. package/src/collection_editor/ui/collection_editor/utils/update_property_for_widget.ts +0 -276
  132. package/src/collection_editor/useCollectionEditorController.tsx +0 -9
  133. package/src/collection_editor/useCollectionsConfigController.tsx +0 -9
  134. package/src/collection_editor/useJsonCollectionsConfigController.tsx +0 -297
  135. package/src/collection_editor/useLiveSchemaEditing.tsx +0 -315
  136. package/src/collection_editor/useLocalCollectionsConfigController.tsx +0 -341
  137. package/src/collection_editor/useSafeSnackbarController.ts +0 -9
  138. package/src/collection_editor/validateCollectionJson.ts +0 -440
  139. package/src/collection_editor_ui.ts +0 -21
  140. package/src/components/AdditionalFieldValue.tsx +0 -68
  141. package/src/components/AdminModeSyncer.tsx +0 -56
  142. package/src/components/ArrayContainer.tsx +0 -542
  143. package/src/components/ClearFilterSortButton.tsx +0 -56
  144. package/src/components/CollectionEditorDialogs.tsx +0 -69
  145. package/src/components/CollectionPanel.tsx +0 -179
  146. package/src/components/CollectionTableBinding/CollectionRowActions.tsx +0 -244
  147. package/src/components/CollectionTableBinding/CollectionTableBinding.tsx +0 -394
  148. package/src/components/CollectionTableBinding/CollectionTableBindingProps.tsx +0 -172
  149. package/src/components/CollectionTableBinding/PropertyTableCell.tsx +0 -350
  150. package/src/components/CollectionTableBinding/column_utils.tsx +0 -155
  151. package/src/components/CollectionTableBinding/fields/TableMultipleRelationField.tsx +0 -131
  152. package/src/components/CollectionTableBinding/fields/TableReferenceField.tsx +0 -193
  153. package/src/components/CollectionTableBinding/fields/TableRelationField.tsx +0 -192
  154. package/src/components/CollectionTableBinding/fields/TableRelationSelectorField.tsx +0 -42
  155. package/src/components/CollectionTableBinding/fields/TableStorageUpload.tsx +0 -324
  156. package/src/components/CollectionTableBinding/fields/VirtualTableSelect.tsx +0 -132
  157. package/src/components/CollectionTableBinding/fields/VirtualTableUserSelect.tsx +0 -41
  158. package/src/components/CollectionTableBinding/index.tsx +0 -14
  159. package/src/components/CollectionTableBinding/internal/CollectionTableToolbar.tsx +0 -96
  160. package/src/components/CollectionTableBinding/internal/EntityTableCell.tsx +0 -309
  161. package/src/components/CollectionTableBinding/internal/EntityTableCellActions.tsx +0 -80
  162. package/src/components/CollectionTableBinding/internal/common.tsx +0 -74
  163. package/src/components/CollectionTableBinding/internal/popup_field/PopupFormField.tsx +0 -422
  164. package/src/components/CollectionTableBinding/internal/popup_field/useDraggable.tsx +0 -99
  165. package/src/components/CollectionTableBinding/internal/popup_field/useWindowSize.tsx +0 -22
  166. package/src/components/CollectionTableBinding/table_bindings.tsx +0 -350
  167. package/src/components/CollectionViewBinding/BoardCardBinding.tsx +0 -263
  168. package/src/components/CollectionViewBinding/CollectionBoardViewBinding.tsx +0 -662
  169. package/src/components/CollectionViewBinding/CollectionCardViewBinding.tsx +0 -159
  170. package/src/components/CollectionViewBinding/CollectionListViewBinding.tsx +0 -1430
  171. package/src/components/CollectionViewBinding/CollectionViewActions.tsx +0 -227
  172. package/src/components/CollectionViewBinding/CollectionViewBinding.tsx +0 -1603
  173. package/src/components/CollectionViewBinding/CollectionViewStartActions.tsx +0 -240
  174. package/src/components/CollectionViewBinding/EntityCardBinding.tsx +0 -239
  175. package/src/components/CollectionViewBinding/FilterPresetsButton.tsx +0 -298
  176. package/src/components/CollectionViewBinding/FiltersDialog.tsx +0 -218
  177. package/src/components/CollectionViewBinding/SearchExplanation.tsx +0 -106
  178. package/src/components/CollectionViewBinding/SearchHighlight.tsx +0 -311
  179. package/src/components/CollectionViewBinding/SlotValue.tsx +0 -156
  180. package/src/components/CollectionViewBinding/SortButton.tsx +0 -354
  181. package/src/components/CollectionViewBinding/SplitListCloseButton.tsx +0 -49
  182. package/src/components/CollectionViewBinding/SplitListShowButton.tsx +0 -28
  183. package/src/components/CollectionViewBinding/SplitListView.tsx +0 -488
  184. package/src/components/CollectionViewBinding/SplitViewContext.tsx +0 -34
  185. package/src/components/CollectionViewBinding/ViewModeToggle.tsx +0 -250
  186. package/src/components/CollectionViewBinding/hooks/useCollectionInlineEditor.ts +0 -81
  187. package/src/components/CollectionViewBinding/hooks/useKanbanDragAndDrop.ts +0 -181
  188. package/src/components/CollectionViewBinding/useBoardDataController.tsx +0 -802
  189. package/src/components/CollectionViewBinding/usePreviewSlots.ts +0 -703
  190. package/src/components/CollectionViewBinding/useSelectionController.tsx +0 -40
  191. package/src/components/CollectionViewBinding/utils.ts +0 -22
  192. package/src/components/DefaultAppBar.tsx +0 -264
  193. package/src/components/DefaultDrawer.tsx +0 -593
  194. package/src/components/DeleteEntityDialog.tsx +0 -205
  195. package/src/components/DetailViewBinding.tsx +0 -731
  196. package/src/components/DrawerNavigationGroup.tsx +0 -141
  197. package/src/components/DrawerNavigationItem.tsx +0 -115
  198. package/src/components/EditFormActions.tsx +0 -303
  199. package/src/components/EditViewBinding.tsx +0 -1069
  200. package/src/components/EntityDisplayHeader.tsx +0 -170
  201. package/src/components/EntityIdentityBar.tsx +0 -428
  202. package/src/components/EntityInspector.tsx +0 -156
  203. package/src/components/EntityPreviewBinding.tsx +0 -432
  204. package/src/components/EntityPreviewNesting.tsx +0 -50
  205. package/src/components/EntityViewBinding.tsx +0 -374
  206. package/src/components/FieldCaption.tsx +0 -14
  207. package/src/components/HomePage/ContentHomePage.tsx +0 -586
  208. package/src/components/HomePage/FavouritesView.tsx +0 -60
  209. package/src/components/HomePage/HomePageDnD.tsx +0 -704
  210. package/src/components/HomePage/NavigationCard.tsx +0 -81
  211. package/src/components/HomePage/NavigationCardBinding.tsx +0 -107
  212. package/src/components/HomePage/NavigationGroup.tsx +0 -156
  213. package/src/components/HomePage/RenameGroupDialog.tsx +0 -123
  214. package/src/components/HomePage/SmallNavigationCard.tsx +0 -41
  215. package/src/components/HomePage/index.tsx +0 -5
  216. package/src/components/InlineEntityPreview.tsx +0 -149
  217. package/src/components/JsonPreviewBinding.tsx +0 -66
  218. package/src/components/PropertyCollectionView.tsx +0 -336
  219. package/src/components/PropertyConfigBadge.tsx +0 -28
  220. package/src/components/PropertyIdCopyTooltip.tsx +0 -47
  221. package/src/components/RebaseAuthGate.tsx +0 -44
  222. package/src/components/RebaseCMS.tsx +0 -30
  223. package/src/components/RebaseLayout.tsx +0 -80
  224. package/src/components/RebaseNavigation.tsx +0 -369
  225. package/src/components/RebaseRouteDefs.tsx +0 -127
  226. package/src/components/RebaseShell.tsx +0 -83
  227. package/src/components/ReferenceTable/SelectionTableBinding.tsx +0 -389
  228. package/src/components/ReferenceWidget.tsx +0 -156
  229. package/src/components/RelationSelector.tsx +0 -926
  230. package/src/components/SearchIconsView.tsx +0 -78
  231. package/src/components/SelectableTable/SelectableTable.tsx +0 -309
  232. package/src/components/SelectableTable/SelectableTableContext.tsx +0 -7
  233. package/src/components/SelectableTable/SelectionStore.ts +0 -43
  234. package/src/components/SelectableTable/filters/BooleanFilterField.tsx +0 -59
  235. package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +0 -146
  236. package/src/components/SelectableTable/filters/FilterFieldBinding.tsx +0 -190
  237. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +0 -250
  238. package/src/components/SelectableTable/filters/RelationFilterField.tsx +0 -238
  239. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +0 -282
  240. package/src/components/SelectableTable/filters/null_filter.ts +0 -63
  241. package/src/components/SideDialogs.tsx +0 -238
  242. package/src/components/SidePanelBinding.tsx +0 -361
  243. package/src/components/SidePanelProvider.tsx +0 -80
  244. package/src/components/UserSelector.tsx +0 -513
  245. package/src/components/admin/CreationResultDialog.tsx +0 -138
  246. package/src/components/admin/index.ts +0 -1
  247. package/src/components/app/AppBar.tsx +0 -17
  248. package/src/components/app/Drawer.tsx +0 -38
  249. package/src/components/app/Scaffold.tsx +0 -366
  250. package/src/components/app/index.ts +0 -4
  251. package/src/components/app/useApp.tsx +0 -36
  252. package/src/components/common/default_entity_actions.tsx +0 -440
  253. package/src/components/common/index.ts +0 -1
  254. package/src/components/field_configs.tsx +0 -506
  255. package/src/components/history/EntityHistoryEntry.tsx +0 -203
  256. package/src/components/history/EntityHistoryView.tsx +0 -206
  257. package/src/components/history/LastEditedByFormAction.tsx +0 -24
  258. package/src/components/history/LastEditedByIndicator.tsx +0 -95
  259. package/src/components/history/UserChip.tsx +0 -15
  260. package/src/components/history/index.tsx +0 -5
  261. package/src/components/index.ts +0 -63
  262. package/src/contexts/BreacrumbsContext.tsx +0 -45
  263. package/src/contexts/SideDialogsControllerContext.tsx +0 -5
  264. package/src/contexts/SidePanelControllerContext.tsx +0 -5
  265. package/src/data_export/export/BasicExportAction.tsx +0 -142
  266. package/src/data_export/export/ExportCollectionAction.tsx +0 -321
  267. package/src/data_export/export/export.ts +0 -295
  268. package/src/data_export/export/fetch_export_data.ts +0 -90
  269. package/src/data_export/export/index.ts +0 -4
  270. package/src/data_export/index.ts +0 -1
  271. package/src/data_import/components/DataNewPropertiesMapping.tsx +0 -261
  272. package/src/data_import/components/ImportFileUpload.tsx +0 -42
  273. package/src/data_import/components/ImportNewPropertyFieldPreview.tsx +0 -58
  274. package/src/data_import/components/ImportSaveInProgress.tsx +0 -121
  275. package/src/data_import/components/index.ts +0 -4
  276. package/src/data_import/hooks/index.ts +0 -1
  277. package/src/data_import/hooks/useImportConfig.tsx +0 -34
  278. package/src/data_import/import/ImportCollectionAction.tsx +0 -461
  279. package/src/data_import/import/index.ts +0 -1
  280. package/src/data_import/index.ts +0 -5
  281. package/src/data_import/types/column_mapping.ts +0 -32
  282. package/src/data_import/types/index.ts +0 -1
  283. package/src/data_import/utils/csv.ts +0 -153
  284. package/src/data_import/utils/data.ts +0 -181
  285. package/src/data_import/utils/file_headers.ts +0 -14
  286. package/src/data_import/utils/file_to_json.ts +0 -149
  287. package/src/data_import/utils/get_import_inference_type.ts +0 -33
  288. package/src/data_import/utils/get_properties_mapping.ts +0 -67
  289. package/src/data_import/utils/index.ts +0 -5
  290. package/src/data_import/utils/save_entities.ts +0 -138
  291. package/src/data_import/utils/transforms.ts +0 -70
  292. package/src/editor/components/SlashCommandMenu.tsx +0 -532
  293. package/src/editor/components/editor-bubble-item.tsx +0 -32
  294. package/src/editor/components/editor-bubble.tsx +0 -143
  295. package/src/editor/components/image-bubble.tsx +0 -183
  296. package/src/editor/components/index.ts +0 -14
  297. package/src/editor/components/table-bubble.tsx +0 -233
  298. package/src/editor/editor.tsx +0 -529
  299. package/src/editor/extensions/HighlightDecorationExtension.ts +0 -115
  300. package/src/editor/extensions/Image.ts +0 -159
  301. package/src/editor/extensions/TextLoadingDecorationExtension.tsx +0 -107
  302. package/src/editor/extensions/clipboard.ts +0 -72
  303. package/src/editor/extensions/custom-keymap.ts +0 -25
  304. package/src/editor/extensions/drag-and-drop.tsx +0 -508
  305. package/src/editor/hooks/useProseMirror.ts +0 -126
  306. package/src/editor/hooks/useProseMirrorContext.ts +0 -15
  307. package/src/editor/index.ts +0 -2
  308. package/src/editor/markdown-it-plugins.d.ts +0 -24
  309. package/src/editor/markdown.ts +0 -204
  310. package/src/editor/nodeViews/ImageComponent.tsx +0 -20
  311. package/src/editor/nodeViews/ReactNodeView.tsx +0 -89
  312. package/src/editor/nodeViews/TaskItemComponent.tsx +0 -30
  313. package/src/editor/nodeViews/index.ts +0 -35
  314. package/src/editor/plugins/index.ts +0 -58
  315. package/src/editor/plugins/inputrules.ts +0 -82
  316. package/src/editor/plugins/placeholderPlugin.ts +0 -55
  317. package/src/editor/plugins/slashCommandPlugin.ts +0 -65
  318. package/src/editor/schema.ts +0 -339
  319. package/src/editor/selectors/ai-selector.tsx +0 -110
  320. package/src/editor/selectors/color-selector.tsx +0 -199
  321. package/src/editor/selectors/link-selector.tsx +0 -122
  322. package/src/editor/selectors/node-selector.tsx +0 -159
  323. package/src/editor/selectors/text-buttons.tsx +0 -79
  324. package/src/editor/types.ts +0 -6
  325. package/src/editor/useProseMirror.ts +0 -125
  326. package/src/editor/utils/prosemirror-utils.ts +0 -113
  327. package/src/editor/utils/remove_classes.ts +0 -18
  328. package/src/editor/utils/useDebouncedCallback.ts +0 -25
  329. package/src/form/EntityForm.tsx +0 -761
  330. package/src/form/EntityFormActions.tsx +0 -160
  331. package/src/form/EntityFormBinding.tsx +0 -342
  332. package/src/form/PropertyFieldBinding.tsx +0 -348
  333. package/src/form/components/ErrorFocus.tsx +0 -44
  334. package/src/form/components/FieldBlock.tsx +0 -189
  335. package/src/form/components/FieldHelperText.tsx +0 -84
  336. package/src/form/components/FormRail.tsx +0 -153
  337. package/src/form/components/FormSections.tsx +0 -145
  338. package/src/form/components/LabelWithIcon.tsx +0 -43
  339. package/src/form/components/LabelWithIconAndTooltip.tsx +0 -28
  340. package/src/form/components/LocalChangesMenu.tsx +0 -147
  341. package/src/form/components/StorageItemPreview.tsx +0 -81
  342. package/src/form/components/StorageUploadProgress.tsx +0 -118
  343. package/src/form/components/index.tsx +0 -6
  344. package/src/form/components/useRailVisible.tsx +0 -47
  345. package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +0 -109
  346. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +0 -172
  347. package/src/form/field_bindings/BinaryFieldBinding.tsx +0 -177
  348. package/src/form/field_bindings/BlockFieldBinding.tsx +0 -282
  349. package/src/form/field_bindings/DateTimeFieldBinding.tsx +0 -78
  350. package/src/form/field_bindings/GeopointFieldBinding.tsx +0 -200
  351. package/src/form/field_bindings/KeyValueFieldBinding.tsx +0 -574
  352. package/src/form/field_bindings/MapFieldBinding.tsx +0 -120
  353. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +0 -259
  354. package/src/form/field_bindings/MultiSelectFieldBinding.tsx +0 -130
  355. package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +0 -168
  356. package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +0 -94
  357. package/src/form/field_bindings/ReferenceFieldBinding.tsx +0 -146
  358. package/src/form/field_bindings/RelationFieldBinding.tsx +0 -202
  359. package/src/form/field_bindings/RepeatFieldBinding.tsx +0 -143
  360. package/src/form/field_bindings/SelectFieldBinding.tsx +0 -111
  361. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +0 -521
  362. package/src/form/field_bindings/SwitchFieldBinding.tsx +0 -70
  363. package/src/form/field_bindings/TextFieldBinding.tsx +0 -189
  364. package/src/form/field_bindings/UserSelectFieldBinding.tsx +0 -71
  365. package/src/form/field_bindings/VectorFieldBinding.tsx +0 -209
  366. package/src/form/form_utils.ts +0 -243
  367. package/src/form/index.tsx +0 -36
  368. package/src/form/useClearRestoreValue.tsx +0 -36
  369. package/src/form/useUndoableDiscard.ts +0 -39
  370. package/src/form/validation.ts +0 -583
  371. package/src/hooks/index.ts +0 -16
  372. package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +0 -22
  373. package/src/hooks/navigation/contexts/NavigationStateContext.tsx +0 -16
  374. package/src/hooks/navigation/contexts/UrlContext.tsx +0 -24
  375. package/src/hooks/navigation/contexts/index.ts +0 -14
  376. package/src/hooks/navigation/useAsyncResolver.ts +0 -100
  377. package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +0 -218
  378. package/src/hooks/navigation/useBuildNavigationStateController.tsx +0 -134
  379. package/src/hooks/navigation/useBuildUrlController.tsx +0 -66
  380. package/src/hooks/navigation/useNavigationResolution.ts +0 -271
  381. package/src/hooks/navigation/useResolvedCollections.ts +0 -102
  382. package/src/hooks/navigation/useResolvedViews.tsx +0 -139
  383. package/src/hooks/navigation/useTopLevelNavigation.ts +0 -273
  384. package/src/hooks/navigation/utils.ts +0 -200
  385. package/src/hooks/useAdminContext.tsx +0 -83
  386. package/src/hooks/useBreadcrumbsController.tsx +0 -17
  387. package/src/hooks/useBuildSideDialogsController.tsx +0 -145
  388. package/src/hooks/useBuildSidePanel.tsx +0 -315
  389. package/src/hooks/useChildViewSource.ts +0 -46
  390. package/src/hooks/useEntityDisplay.tsx +0 -262
  391. package/src/hooks/useEntityDisplayTitle.tsx +0 -49
  392. package/src/hooks/useHistory.ts +0 -178
  393. package/src/hooks/useRecordActions.tsx +0 -69
  394. package/src/hooks/useResolvedNavigationFrom.tsx +0 -167
  395. package/src/hooks/useResolvedUsers.ts +0 -148
  396. package/src/hooks/useSelectionDialog.tsx +0 -58
  397. package/src/hooks/useSideDialogsController.tsx +0 -25
  398. package/src/hooks/useSidePanel.tsx +0 -13
  399. package/src/index.ts +0 -124
  400. package/src/preview/PropertyPreview.tsx +0 -331
  401. package/src/preview/compact_text.ts +0 -68
  402. package/src/preview/components/ArrayEnumPreview.tsx +0 -39
  403. package/src/preview/components/BooleanPreview.tsx +0 -28
  404. package/src/preview/components/DatePreview.tsx +0 -106
  405. package/src/preview/components/EmptyValue.tsx +0 -10
  406. package/src/preview/components/EnumValuesChip.tsx +0 -39
  407. package/src/preview/components/ImagePreview.tsx +0 -144
  408. package/src/preview/components/InlineEntityListPreview.tsx +0 -42
  409. package/src/preview/components/ReferencePreview.tsx +0 -235
  410. package/src/preview/components/RelationPreview.tsx +0 -271
  411. package/src/preview/components/StorageThumbnail.tsx +0 -147
  412. package/src/preview/components/UrlComponentPreview.tsx +0 -116
  413. package/src/preview/components/UserPreview.tsx +0 -30
  414. package/src/preview/components/date_fns_locales.ts +0 -125
  415. package/src/preview/index.ts +0 -26
  416. package/src/preview/property_previews/ArrayOfMapsPreview.tsx +0 -73
  417. package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +0 -67
  418. package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +0 -77
  419. package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +0 -49
  420. package/src/preview/property_previews/ArrayOfStringsPreview.tsx +0 -70
  421. package/src/preview/property_previews/ArrayOneOfPreview.tsx +0 -79
  422. package/src/preview/property_previews/ArrayPropertyEnumPreview.tsx +0 -35
  423. package/src/preview/property_previews/ArrayPropertyPreview.tsx +0 -79
  424. package/src/preview/property_previews/MapPropertyPreview.tsx +0 -198
  425. package/src/preview/property_previews/NumberPropertyPreview.tsx +0 -39
  426. package/src/preview/property_previews/SkeletonPropertyComponent.tsx +0 -276
  427. package/src/preview/property_previews/StringPropertyPreview.tsx +0 -70
  428. package/src/preview/util.ts +0 -39
  429. package/src/routes/CustomViewRoute.tsx +0 -33
  430. package/src/routes/RebaseRoute.tsx +0 -467
  431. package/src/routes/index.ts +0 -2
  432. package/src/types/components/EntityFormActionsProps.tsx +0 -20
  433. package/src/types/components/EntityFormProps.tsx +0 -119
  434. package/src/types/components/PropertyPreviewProps.tsx +0 -85
  435. package/src/types/components/formex.tsx +0 -2
  436. package/src/types/components/index.ts +0 -3
  437. package/src/types/fields.tsx +0 -340
  438. package/src/types/index.ts +0 -4
  439. package/src/util/dataControllerAdapter.ts +0 -88
  440. package/src/util/entity_actions.ts +0 -28
  441. package/src/util/index.ts +0 -5
  442. package/src/util/navigation_utils.ts +0 -89
  443. package/src/util/number_format.ts +0 -46
  444. package/src/util/previews.ts +0 -131
  445. package/src/util/propertyConfigMapper.ts +0 -134
  446. package/src/util/property_utils.tsx +0 -236
  447. package/src/util/resolutions.ts +0 -96
  448. package/src/util/view_constants.ts +0 -33
  449. package/src/util/view_mode.ts +0 -176
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyEditView-CiY84wkR.js","names":[],"sources":["../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/relation_kinds.ts","../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":["\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/inference\";\nimport { Field, Formex, getIn, useCreateFormex, useFormex } from \"@rebasepro/forms\";\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/forms\";\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/forms\";\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\n;\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\nimport { useTranslation } from \"@rebasepro/app\";\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 type { 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/forms\";\nimport { useStorageSources, useTranslation } from \"@rebasepro/app\";\nimport { DEFAULT_STORAGE_SOURCE_KEY } from \"@rebasepro/types\";\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 const storageSources = useStorageSources();\n\n const baseStoragePath = multiple ? \"of.storage\" : \"storage\";\n const acceptedFiles = `${baseStoragePath}.acceptedFiles`;\n const storageSource = `${baseStoragePath}.storageSource`;\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 // Available storage backends (from `<Rebase storageSources={...}>`).\n const sourceKeys = Object.keys(storageSources.sources)\n .filter((key) => key !== DEFAULT_STORAGE_SOURCE_KEY);\n const storageSourceValue = (getIn(values, storageSource) as string | undefined) ?? DEFAULT_STORAGE_SOURCE_KEY;\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 {sourceKeys.length > 0 && (\n <div className={\"col-span-12\"}>\n <Select\n className={\"w-full\"}\n disabled={disabled}\n name={storageSource}\n value={storageSourceValue}\n onValueChange={(value) =>\n setFieldValue(storageSource, !value || value === DEFAULT_STORAGE_SOURCE_KEY ? undefined : value)}\n label={\"Storage backend\"}\n renderValue={(key) => {\n const label = storageSources.registry[key]?.label;\n return label ?? (key === DEFAULT_STORAGE_SOURCE_KEY ? \"Default\" : key);\n }}>\n <SelectItem value={DEFAULT_STORAGE_SOURCE_KEY}>\n Default\n </SelectItem>\n {sourceKeys.map((key) => (\n <SelectItem key={key} value={key}>\n {storageSources.registry[key]?.label ?? key}\n </SelectItem>\n ))}\n </Select>\n </div>\n )}\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/app\";\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 mr-16\">\n {includeName &&\n <ErrorBoundary>\n <div className=\"flex items-center gap-2 min-w-0\">\n <Typography variant=\"body2\" component=\"span\" className=\"truncate font-medium\">\n {property.name || propertyKey || \"\\u00a0\"}\n </Typography>\n {propertyConfig?.name && (\n <Typography\n variant={\"caption\"}\n component=\"span\"\n className=\"text-text-secondary dark:text-text-secondary-dark shrink-0\">\n {propertyConfig.name}\n </Typography>\n )}\n </div>\n <div className=\"flex items-center gap-1.5 mt-0.5 min-w-0\">\n {propertyKey && (\n <Typography variant=\"caption\" component=\"span\" color=\"secondary\" className=\"font-mono truncate\">\n {propertyKey}\n </Typography>\n )}\n <ErrorBoundary>\n <Typography variant=\"caption\" component=\"span\" className=\"shrink-0 text-text-disabled dark:text-text-disabled-dark font-mono\">\n · {\"columnType\" in property ? (property as { columnType?: string }).columnType ?? property.type : property.type}\n </Typography>\n </ErrorBoundary>\n </div>\n </ErrorBoundary>}\n\n {!includeName &&\n <div className=\"flex flex-row items-center gap-2\">\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 {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 mr-16\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <Typography variant=\"label\" component=\"span\" className=\"truncate\">\n {property?.name ? property.name : name}\n </Typography>\n {propertyConfig && <Typography variant={\"caption\"} component=\"span\" className=\"text-text-secondary dark:text-text-secondary-dark shrink-0\">\n {propertyConfig?.name}\n </Typography>}\n </div>\n\n <div className=\"flex flex-row items-center gap-1.5 mt-0.5 min-w-0\">\n <Typography variant=\"caption\" component=\"span\" color=\"secondary\" className=\"font-mono truncate\">\n {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 </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/app\";\nimport { Properties, Property } from \"@rebasepro/types\";\nimport { AdditionalFieldDelegate } from \"@rebasepro/cms-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-2 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 } from \"@rebasepro/types\";\nimport { PropertyConfig } from \"@rebasepro/cms-types\";\nimport { BooleanSwitchWithLabel, Button, Paper, PlusIcon, Typography } from \"@rebasepro/ui\";\nimport { PropertyFormDialog } from \"../PropertyEditView\";\nimport { getIn, useFormex } from \"@rebasepro/forms\";\nimport { useTranslation } from \"@rebasepro/app\";\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(\"admin.spreadChildren\", v)}\n value={values.admin?.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 } from \"@rebasepro/types\";\nimport { PropertyConfig } from \"@rebasepro/cms-types\";\nimport { Button, Paper, Typography } from \"@rebasepro/ui\";\nimport { Field, getIn, useFormex } from \"@rebasepro/forms\";\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/forms\";\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport type { PropertyWithId } from \"../PropertyEditView\";\nimport React from \"react\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\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/forms\";\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, Property } from \"@rebasepro/types\";\nimport { PropertyConfig } from \"@rebasepro/cms-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/forms\";\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\nimport { useTranslation } from \"@rebasepro/app\";\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/app\";\nimport { FieldCaption, useCollectionRegistryController } from \"../../../_cms_internals\";\nimport React from \"react\";\nimport { Field, getIn, useFormex } from \"@rebasepro/forms\";\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/forms\";\n;\nimport { NumberProperty, StringProperty } from \"@rebasepro/types\";\nimport { Select, SelectItem } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\nimport { SwitchControl } from \"../../SwitchControl\";\n\nexport function AdvancedPropertyValidation({ disabled }: {\n disabled: boolean\n}) {\n\n // `ui` was renamed to `admin` in 0.11. Nothing reads `ui.*` — the toggles did\n // nothing — and the boot validator treats the old name as a removed key, so a\n // save through here left a project that would not start.\n const hideFromCollection = \"admin.hideFromCollection\";\n const readOnly = \"admin.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/forms\";\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 type { RelationKind } from \"@rebasepro/types\";\n\n/**\n * How each relation kind is named and explained in the editor UI.\n *\n * One table, shared by every surface that lets someone pick a kind — the\n * relations tab and the relation property form — so the two cannot describe the\n * same thing differently, and so a sixth kind added to the union fails to\n * compile here rather than quietly going missing from a dropdown.\n *\n * The descriptions all answer the same question, because it is the only\n * question that distinguishes the first four: *where is the foreign key?*\n */\nexport const RELATION_KINDS: Record<RelationKind, { label: string; description: string }> = {\n belongsTo: {\n label: \"Belongs to\",\n description: \"One target row. The foreign key is a column on this table.\"\n },\n hasOne: {\n label: \"Has one\",\n description: \"One target row. The foreign key is a column on the target's table.\"\n },\n hasMany: {\n label: \"Has many\",\n description: \"Many target rows. The foreign key is a column on the target's table.\"\n },\n manyToMany: {\n label: \"Many to many\",\n description: \"Many target rows, linked through a junction table.\"\n },\n via: {\n label: \"Via a join path\",\n description: \"Reached by joining across several tables. Read-only.\"\n }\n};\n\n/** The kinds, in the order they are offered. */\nexport const RELATION_KIND_ORDER = Object.keys(RELATION_KINDS) as RelationKind[];\n\n/** Which link field, if any, a kind is configured with. */\nexport const kindUsesLocalKey = (kind: RelationKind) => kind === \"belongsTo\";\nexport const kindUsesForeignKeyOnTarget = (kind: RelationKind) => kind === \"hasOne\" || kind === \"hasMany\";\nexport const kindUsesThrough = (kind: RelationKind) => kind === \"manyToMany\";\nexport const kindUsesJoinPath = (kind: RelationKind) => kind === \"via\";\n","import { FieldCaption, useCollectionRegistryController } from \"../../../_cms_internals\";\nimport React, { useCallback, useEffect } from \"react\";\nimport { useFormex } from \"@rebasepro/forms\";\n;\nimport {\n Select,\n SelectItem,\n TextField,\n Typography\n} from \"@rebasepro/ui\";\nimport { OnAction, RelationProperty, RelationKind, JoinStep } from \"@rebasepro/types\";\nimport {\n RELATION_KINDS,\n RELATION_KIND_ORDER,\n kindUsesForeignKeyOnTarget,\n kindUsesJoinPath,\n kindUsesLocalKey,\n kindUsesThrough\n} from \"../../../relation_kinds\";\n\nimport { CollectionsSelect } from \"./ReferencePropertyField\";\nimport type { AdminCollection } from \"@rebasepro/cms-types\";\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 // The link lives under `relation` now, and its `kind` decides which of the\n // fields below even exist — which is what drives the conditional sections.\n const link = (values.relation ?? {}) as Record<string, any>;\n const kind = (link.kind ?? \"belongsTo\") as RelationKind;\n\n const relationName = link.relationName ?? \"\";\n const targetSlug = getTargetSlug(link.target);\n const localKey = link.localKey ?? \"\";\n const foreignKeyOnTarget = link.foreignKeyOnTarget ?? \"\";\n const sourceKey = link.sourceKey ?? \"\";\n const through = link.through;\n const throughTable = through?.table ?? \"\";\n const throughSourceColumn = through?.sourceColumn ?? \"\";\n const throughTargetColumn = through?.targetColumn ?? \"\";\n const onUpdate = link.onUpdate ?? \"no action\";\n const onDelete = link.onDelete ?? \"no action\";\n\n const showThrough = kindUsesThrough(kind);\n const showLocalKey = kindUsesLocalKey(kind);\n const showForeignKey = kindUsesForeignKeyOnTarget(kind);\n const showJoinPath = kindUsesJoinPath(kind);\n\n const updateThrough = useCallback(\n (patch: Record<string, unknown>) => {\n const currentThrough = link.through ?? { table: \"\",\nsourceColumn: \"\",\ntargetColumn: \"\" };\n setFieldValue(\"relation.through\", { ...currentThrough,\n...patch });\n },\n [link.through, setFieldValue]\n );\n\n // Auto-generate relationName from target collection slug\n useEffect(() => {\n if (targetSlug && !relationName) {\n setFieldValue(\"relation.relationName\", targetSlug);\n }\n }, [targetSlug, relationName, setFieldValue]);\n\n const collections: AdminCollection[] = 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(\"relation.target\", value);\n // Auto-generate relation name from target\n if (!relationName || relationName === targetSlug) {\n setFieldValue(\"relation.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(\"relation.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 {/* ─── Kind ─── */}\n <div className={\"col-span-12\"}>\n <Select\n value={kind}\n onValueChange={(v) => setFieldValue(\"relation.kind\", v as RelationKind)}\n label={\"Kind\"}\n disabled={disabled}\n fullWidth\n renderValue={(v) => RELATION_KINDS[v as RelationKind]?.label ?? v}\n >\n {RELATION_KIND_ORDER.map((k) => (\n <SelectItem key={k} value={k}>\n <div>\n <Typography variant={\"body2\"}>{RELATION_KINDS[k].label}</Typography>\n <Typography variant={\"caption\"} color={\"secondary\"}>\n {RELATION_KINDS[k].description}\n </Typography>\n </div>\n </SelectItem>\n ))}\n </Select>\n <FieldCaption>\n Which side holds the key, and whether this yields one row or many\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(\"relation.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(\"relation.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 <TextField\n className={\"mt-4\"}\n value={sourceKey}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>\n setFieldValue(\"relation.sourceKey\", e.target.value)\n }\n label={\"Source key (optional)\"}\n disabled={disabled}\n placeholder={\"defaults to this table's primary key\"}\n />\n <FieldCaption>\n Column on <em>this</em> table that the foreign key above points at. Leave empty\n unless the two sides are joined on a natural key — an external identity id, a\n SKU — rather than on the row id. It must be unique.\n </FieldCaption>\n </div>\n )}\n\n {/* ─── Join path (via) ─── */}\n {showJoinPath && (\n <div className={\"col-span-12\"}>\n <Typography variant={\"label\"} className={\"mb-2\"}>\n Join path\n </Typography>\n <FieldCaption>\n A <code>via</code> relation is reached by joining across several tables, and is\n read-only — Rebase will not guess which hop to write to. Its <code>joinPath</code>\n {\" \"}is edited in the collection&apos;s Relations tab, or in code, where the whole\n chain is visible at once.\n {(link.joinPath as JoinStep[] | undefined)?.length\n ? ` Currently ${(link.joinPath as JoinStep[]).length} step(s).`\n : \" No steps are configured yet, so this relation will return nothing.\"}\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(\"relation.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(\"relation.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, StringProperty } from \"@rebasepro/types\";\nimport { PropertyConfig } from \"@rebasepro/cms-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 admin: { multiline: undefined, markdown: undefined, urlPreview: undefined },\n email: 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 admin: { multiline: undefined, markdown: undefined, urlPreview: undefined },\n email: 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 admin: { multiline: true, markdown: undefined, urlPreview: undefined },\n storage: undefined,\n email: 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 admin: { multiline: undefined, markdown: true, urlPreview: undefined },\n email: 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 url: true,\n admin: { multiline: undefined, markdown: undefined },\n email: undefined,\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 admin: { multiline: undefined, markdown: undefined, urlPreview: undefined },\n email: true,\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 admin: { multiline: undefined, markdown: undefined, urlPreview: undefined },\n email: 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 unknown 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 unknown 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 // Every widget without a branch of its own — vector, geopoint, binary,\n // and any registered custom one — takes its shape from the config.\n //\n // The identity fields are carried across explicitly. This used to\n // return the config's property alone, which dropped the name, the\n // description and the column mapping: switching an existing property to\n // one of these widgets silently blanked its label. The branches above\n // all merge onto `propertyData`; this one did not.\n //\n // Only those three are kept, not a full merge: the point of changing\n // widget is to change type, and a `defaultValue` or `enum` left over\n // from the previous type is not valid for the new one.\n updatedProperty = {\n ...propertyConfigs[selectedWidgetId].property,\n propertyConfig: selectedWidgetId,\n ...(propertyData?.name !== undefined ? { name: propertyData.name } : {}),\n ...(propertyData?.description !== undefined ? { description: propertyData.description } : {}),\n ...(propertyData?.columnName !== undefined ? { columnName: propertyData.columnName } : {})\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/forms\";\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/cms-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 \"multi_references\",\n \"relation\",\n \"switch\",\n \"date_time\",\n \"group\",\n \"key_value\",\n \"repeat\",\n \"block\",\n // These three have a field binding and a property editor, and were simply\n // never added to the picker — so a property of the type rendered correctly\n // once it existed, but there was no way to create one from the UI.\n \"vector_input\",\n \"geopoint\",\n \"binary\"\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/forms\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\nimport { ConfirmationDialog } from \"@rebasepro/app\";\nimport { DEFAULT_FIELD_CONFIGS, getFieldConfig, getFieldId } from \"../../../components/field_configs\";\nimport { PropertyConfigBadge } from \"../../../components/PropertyConfigBadge\";\nimport { Property } from \"@rebasepro/types\";\nimport { PropertyConfig, PropertyConfigId, AdminCollection } from \"@rebasepro/cms-types\";\nimport type { PropertyTypePreset, PropertyType } from \"../../extensibility_types\";\nimport { toSerializableProperty, toSerializableCollectionConfig } from \"../../serializable_utils\";\nimport type { SerializableProperty, SerializableCollectionConfig } 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: SerializableCollectionConfig;\n }) => React.ReactNode;\n collectionValues?: AdminCollection;\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?: AdminCollection;\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\": \"geopoint\",\n \"binary\": \"binary\"\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,\n...preset.defaults,\npropertyConfig: 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 === \"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 if (selectedFieldConfigId === \"geopoint\" || selectedFieldConfigId === \"binary\") {\n // These two have nothing of their own to configure — a geopoint is a\n // latitude and a longitude, a binary value is base64 — so the shared\n // fields above are the whole editor. Said out loud, because a dialog\n // that just stops is indistinguishable from one that failed to load.\n childComponent = (\n <div className={\"col-span-12\"}>\n <Typography variant={\"body2\"} color={\"secondary\"}>\n {selectedFieldConfigId === \"geopoint\"\n ? \"A location is stored as a latitude and a longitude. There is nothing further to configure here.\"\n : \"Binary values are stored as base64. There is nothing further to configure here.\"}\n </Typography>\n </div>\n );\n } else {\n // No editor matched this widget. `geopoint` lands here every time: the\n // model defines the type, but the admin has no field binding for it, so\n // `getDefaultFieldId` falls off the end of its chain, logs to the\n // console and returns undefined.\n //\n // This used to render nothing — the dialog opened showing a name, a\n // description and no type-specific fields at all, which reads exactly\n // like a property that simply has no settings. Saying so out loud is\n // not support, but it is the difference between a gap and a bug.\n childComponent = (\n <div className={\"col-span-12\"}>\n <InfoLabel mode={\"warn\"}>\n {values?.type\n ? `Properties of type \"${values.type}\" have no editor in the admin panel yet. ` +\n \"The fields shown here are the ones every property shares — configure the rest in code.\"\n : \"This property has no type yet.\"}\n </InfoLabel>\n </div>\n );\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,\n[key]: value }\n } as PropertyWithId);\n },\n property: toSerializableProperty(values as Property),\n collection: toSerializableCollectionConfig(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 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 geopoint: \"Location\",\n binary: \"Binary\"\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 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 geopoint: \"geopoint\",\n binary: \"binary\"\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":";;;;;;;;;;;;;;;;;AAsCA,SAAgB,SAAS,EACrB,YACA,iBACA,SACA,WACA,UACA,oBACA,WACc;CAEd,MAAM,SAAS,gBAEZ;EACC,eAAe,EAAE,MAAM,WAAW;EAClC,kBAAkB;EAClB,aAAa,WAAW;GAEpB,MAAM,aAA+B,CAAC;GACtC,IAAI,cAAc;GAClB,IAAI,OAAO,MACP,OAAO,KAAK,SAAS,WAAW,UAAU;IACtC,MAAM,aAA6B,CAAC;IACpC,IAAI,CAAC,WAAW,OAAO;KACnB,WAAW,QAAQ;KACnB,cAAc;IAClB;IACA,IAAI,CAAC,WAAW,IAAI;KAChB,WAAW,KAAK;KAChB,cAAc;IAClB;IACA,WAAW,SAAS;GACxB,CAAC;GAEL,MAAM,SAAS,cAAc,EAAE,MAAM,WAAW,IAAI,CAAC;GACrD,UAAU,WAAW;GACrB,OAAO;EACX;CACJ,CAAC;CAED,MAAM,EACF,QACA,WACA;CAEJ,gBAAgB;EACZ,IAAI,iBACA,gBAAgB,OAAO,IAAI;CA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C,OAAD;IAAK,WAAW;cAAhB,CACK,0BAA0B,oBAAC,SAAD;KACvB,OAAO;eACP,oBAAC,mBAAD;MAAmB,MAAM,SAAS;MAAU,WAAW;KAAO,CAAA;IACzD,CAAA,GACT,oBAAC,YAAD;KACI,SAAS;KACT,OAAO,yBAAyB,cAAc,KAAA;eAAY,eAAe;IAAiB,CAAA,CAC7F;OAEL,oBAAC,YAAD;IAAY,SAAS;IACjB,OAAO;IACP,WAAW;cACV,eAAe;GACR,CAAA,CAEX,EAAA,CAAA,CACJ;;CACH,CAAA;AACV"}
1
+ {"version":3,"file":"PropertyEditView-C7thfj4L.js","names":[],"sources":["../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/relation_kinds.ts","../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":["\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/inference\";\nimport { Field, Formex, getIn, useCreateFormex, useFormex } from \"@rebasepro/forms\";\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/forms\";\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/forms\";\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\n;\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\nimport { useTranslation } from \"@rebasepro/app\";\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 type { 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/forms\";\nimport { useStorageSources, useTranslation } from \"@rebasepro/app\";\nimport { DEFAULT_STORAGE_SOURCE_KEY } from \"@rebasepro/types\";\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 const storageSources = useStorageSources();\n\n const baseStoragePath = multiple ? \"of.storage\" : \"storage\";\n const acceptedFiles = `${baseStoragePath}.acceptedFiles`;\n const storageSource = `${baseStoragePath}.storageSource`;\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 // Available storage backends (from `<Rebase storageSources={...}>`).\n const sourceKeys = Object.keys(storageSources.sources)\n .filter((key) => key !== DEFAULT_STORAGE_SOURCE_KEY);\n const storageSourceValue = (getIn(values, storageSource) as string | undefined) ?? DEFAULT_STORAGE_SOURCE_KEY;\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 {sourceKeys.length > 0 && (\n <div className={\"col-span-12\"}>\n <Select\n className={\"w-full\"}\n disabled={disabled}\n name={storageSource}\n value={storageSourceValue}\n onValueChange={(value) =>\n setFieldValue(storageSource, !value || value === DEFAULT_STORAGE_SOURCE_KEY ? undefined : value)}\n label={\"Storage backend\"}\n renderValue={(key) => {\n const label = storageSources.registry[key]?.label;\n return label ?? (key === DEFAULT_STORAGE_SOURCE_KEY ? \"Default\" : key);\n }}>\n <SelectItem value={DEFAULT_STORAGE_SOURCE_KEY}>\n Default\n </SelectItem>\n {sourceKeys.map((key) => (\n <SelectItem key={key} value={key}>\n {storageSources.registry[key]?.label ?? key}\n </SelectItem>\n ))}\n </Select>\n </div>\n )}\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/app\";\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 mr-16\">\n {includeName &&\n <ErrorBoundary>\n <div className=\"flex items-center gap-2 min-w-0\">\n <Typography variant=\"body2\" component=\"span\" className=\"truncate font-medium\">\n {property.name || propertyKey || \"\\u00a0\"}\n </Typography>\n {propertyConfig?.name && (\n <Typography\n variant={\"caption\"}\n component=\"span\"\n className=\"text-text-secondary dark:text-text-secondary-dark shrink-0\">\n {propertyConfig.name}\n </Typography>\n )}\n </div>\n <div className=\"flex items-center gap-1.5 mt-0.5 min-w-0\">\n {propertyKey && (\n <Typography variant=\"caption\" component=\"span\" color=\"secondary\" className=\"font-mono truncate\">\n {propertyKey}\n </Typography>\n )}\n <ErrorBoundary>\n <Typography variant=\"caption\" component=\"span\" className=\"shrink-0 text-text-disabled dark:text-text-disabled-dark font-mono\">\n · {\"columnType\" in property ? (property as { columnType?: string }).columnType ?? property.type : property.type}\n </Typography>\n </ErrorBoundary>\n </div>\n </ErrorBoundary>}\n\n {!includeName &&\n <div className=\"flex flex-row items-center gap-2\">\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 {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 mr-16\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <Typography variant=\"label\" component=\"span\" className=\"truncate\">\n {property?.name ? property.name : name}\n </Typography>\n {propertyConfig && <Typography variant={\"caption\"} component=\"span\" className=\"text-text-secondary dark:text-text-secondary-dark shrink-0\">\n {propertyConfig?.name}\n </Typography>}\n </div>\n\n <div className=\"flex flex-row items-center gap-1.5 mt-0.5 min-w-0\">\n <Typography variant=\"caption\" component=\"span\" color=\"secondary\" className=\"font-mono truncate\">\n {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 </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/app\";\nimport { Properties, Property } from \"@rebasepro/types\";\nimport { AdditionalFieldDelegate } from \"@rebasepro/cms-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-2 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 } from \"@rebasepro/types\";\nimport { PropertyConfig } from \"@rebasepro/cms-types\";\nimport { BooleanSwitchWithLabel, Button, Paper, PlusIcon, Typography } from \"@rebasepro/ui\";\nimport { PropertyFormDialog } from \"../PropertyEditView\";\nimport { getIn, useFormex } from \"@rebasepro/forms\";\nimport { useTranslation } from \"@rebasepro/app\";\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(\"admin.spreadChildren\", v)}\n value={values.admin?.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 } from \"@rebasepro/types\";\nimport { PropertyConfig } from \"@rebasepro/cms-types\";\nimport { Button, Paper, Typography } from \"@rebasepro/ui\";\nimport { Field, getIn, useFormex } from \"@rebasepro/forms\";\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/forms\";\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport type { PropertyWithId } from \"../PropertyEditView\";\nimport React from \"react\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\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/forms\";\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, Property } from \"@rebasepro/types\";\nimport { PropertyConfig } from \"@rebasepro/cms-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/forms\";\nimport { DebouncedTextField } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\nimport { useTranslation } from \"@rebasepro/app\";\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/app\";\nimport { FieldCaption, useCollectionRegistryController } from \"../../../_cms_internals\";\nimport React from \"react\";\nimport { Field, getIn, useFormex } from \"@rebasepro/forms\";\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/forms\";\n;\nimport { NumberProperty, StringProperty } from \"@rebasepro/types\";\nimport { Select, SelectItem } from \"@rebasepro/ui\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\nimport { SwitchControl } from \"../../SwitchControl\";\n\nexport function AdvancedPropertyValidation({ disabled }: {\n disabled: boolean\n}) {\n\n // `ui` was renamed to `admin` in 0.11. Nothing reads `ui.*` — the toggles did\n // nothing — and the boot validator treats the old name as a removed key, so a\n // save through here left a project that would not start.\n const hideFromCollection = \"admin.hideFromCollection\";\n const readOnly = \"admin.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/forms\";\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 type { RelationKind } from \"@rebasepro/types\";\n\n/**\n * How each relation kind is named and explained in the editor UI.\n *\n * One table, shared by every surface that lets someone pick a kind — the\n * relations tab and the relation property form — so the two cannot describe the\n * same thing differently, and so a sixth kind added to the union fails to\n * compile here rather than quietly going missing from a dropdown.\n *\n * The descriptions all answer the same question, because it is the only\n * question that distinguishes the first four: *where is the foreign key?*\n */\nexport const RELATION_KINDS: Record<RelationKind, { label: string; description: string }> = {\n belongsTo: {\n label: \"Belongs to\",\n description: \"One target row. The foreign key is a column on this table.\"\n },\n hasOne: {\n label: \"Has one\",\n description: \"One target row. The foreign key is a column on the target's table.\"\n },\n hasMany: {\n label: \"Has many\",\n description: \"Many target rows. The foreign key is a column on the target's table.\"\n },\n manyToMany: {\n label: \"Many to many\",\n description: \"Many target rows, linked through a junction table.\"\n },\n via: {\n label: \"Via a join path\",\n description: \"Reached by joining across several tables. Read-only.\"\n }\n};\n\n/** The kinds, in the order they are offered. */\nexport const RELATION_KIND_ORDER = Object.keys(RELATION_KINDS) as RelationKind[];\n\n/** Which link field, if any, a kind is configured with. */\nexport const kindUsesLocalKey = (kind: RelationKind) => kind === \"belongsTo\";\nexport const kindUsesForeignKeyOnTarget = (kind: RelationKind) => kind === \"hasOne\" || kind === \"hasMany\";\nexport const kindUsesThrough = (kind: RelationKind) => kind === \"manyToMany\";\nexport const kindUsesJoinPath = (kind: RelationKind) => kind === \"via\";\n","import { FieldCaption, useCollectionRegistryController } from \"../../../_cms_internals\";\nimport React, { useCallback, useEffect } from \"react\";\nimport { useFormex } from \"@rebasepro/forms\";\n;\nimport {\n Select,\n SelectItem,\n TextField,\n Typography\n} from \"@rebasepro/ui\";\nimport { OnAction, RelationProperty, RelationKind, JoinStep } from \"@rebasepro/types\";\nimport {\n RELATION_KINDS,\n RELATION_KIND_ORDER,\n kindUsesForeignKeyOnTarget,\n kindUsesJoinPath,\n kindUsesLocalKey,\n kindUsesThrough\n} from \"../../../relation_kinds\";\n\nimport { CollectionsSelect } from \"./ReferencePropertyField\";\nimport type { AdminCollection } from \"@rebasepro/cms-types\";\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 // The link lives under `relation` now, and its `kind` decides which of the\n // fields below even exist — which is what drives the conditional sections.\n const link = (values.relation ?? {}) as Record<string, any>;\n const kind = (link.kind ?? \"belongsTo\") as RelationKind;\n\n const relationName = link.relationName ?? \"\";\n const targetSlug = getTargetSlug(link.target);\n const localKey = link.localKey ?? \"\";\n const foreignKeyOnTarget = link.foreignKeyOnTarget ?? \"\";\n const sourceKey = link.sourceKey ?? \"\";\n const through = link.through;\n const throughTable = through?.table ?? \"\";\n const throughSourceColumn = through?.sourceColumn ?? \"\";\n const throughTargetColumn = through?.targetColumn ?? \"\";\n const onUpdate = link.onUpdate ?? \"no action\";\n const onDelete = link.onDelete ?? \"no action\";\n\n const showThrough = kindUsesThrough(kind);\n const showLocalKey = kindUsesLocalKey(kind);\n const showForeignKey = kindUsesForeignKeyOnTarget(kind);\n const showJoinPath = kindUsesJoinPath(kind);\n\n const updateThrough = useCallback(\n (patch: Record<string, unknown>) => {\n const currentThrough = link.through ?? { table: \"\",\nsourceColumn: \"\",\ntargetColumn: \"\" };\n setFieldValue(\"relation.through\", { ...currentThrough,\n...patch });\n },\n [link.through, setFieldValue]\n );\n\n // Auto-generate relationName from target collection slug\n useEffect(() => {\n if (targetSlug && !relationName) {\n setFieldValue(\"relation.relationName\", targetSlug);\n }\n }, [targetSlug, relationName, setFieldValue]);\n\n const collections: AdminCollection[] = 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(\"relation.target\", value);\n // Auto-generate relation name from target\n if (!relationName || relationName === targetSlug) {\n setFieldValue(\"relation.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(\"relation.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 {/* ─── Kind ─── */}\n <div className={\"col-span-12\"}>\n <Select\n value={kind}\n onValueChange={(v) => setFieldValue(\"relation.kind\", v as RelationKind)}\n label={\"Kind\"}\n disabled={disabled}\n fullWidth\n renderValue={(v) => RELATION_KINDS[v as RelationKind]?.label ?? v}\n >\n {RELATION_KIND_ORDER.map((k) => (\n <SelectItem key={k} value={k}>\n <div>\n <Typography variant={\"body2\"}>{RELATION_KINDS[k].label}</Typography>\n <Typography variant={\"caption\"} color={\"secondary\"}>\n {RELATION_KINDS[k].description}\n </Typography>\n </div>\n </SelectItem>\n ))}\n </Select>\n <FieldCaption>\n Which side holds the key, and whether this yields one row or many\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(\"relation.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(\"relation.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 <TextField\n className={\"mt-4\"}\n value={sourceKey}\n onChange={(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>\n setFieldValue(\"relation.sourceKey\", e.target.value)\n }\n label={\"Source key (optional)\"}\n disabled={disabled}\n placeholder={\"defaults to this table's primary key\"}\n />\n <FieldCaption>\n Column on <em>this</em> table that the foreign key above points at. Leave empty\n unless the two sides are joined on a natural key — an external identity id, a\n SKU — rather than on the row id. It must be unique.\n </FieldCaption>\n </div>\n )}\n\n {/* ─── Join path (via) ─── */}\n {showJoinPath && (\n <div className={\"col-span-12\"}>\n <Typography variant={\"label\"} className={\"mb-2\"}>\n Join path\n </Typography>\n <FieldCaption>\n A <code>via</code> relation is reached by joining across several tables, and is\n read-only — Rebase will not guess which hop to write to. Its <code>joinPath</code>\n {\" \"}is edited in the collection&apos;s Relations tab, or in code, where the whole\n chain is visible at once.\n {(link.joinPath as JoinStep[] | undefined)?.length\n ? ` Currently ${(link.joinPath as JoinStep[]).length} step(s).`\n : \" No steps are configured yet, so this relation will return nothing.\"}\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(\"relation.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(\"relation.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, StringProperty } from \"@rebasepro/types\";\nimport { PropertyConfig } from \"@rebasepro/cms-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 admin: { multiline: undefined, markdown: undefined, urlPreview: undefined },\n email: 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 admin: { multiline: undefined, markdown: undefined, urlPreview: undefined },\n email: 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 admin: { multiline: true, markdown: undefined, urlPreview: undefined },\n storage: undefined,\n email: 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 admin: { multiline: undefined, markdown: true, urlPreview: undefined },\n email: 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 url: true,\n admin: { multiline: undefined, markdown: undefined },\n email: undefined,\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 admin: { multiline: undefined, markdown: undefined, urlPreview: undefined },\n email: true,\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 admin: { multiline: undefined, markdown: undefined, urlPreview: undefined },\n email: 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 unknown 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 unknown 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 // Every widget without a branch of its own — vector, geopoint, binary,\n // and any registered custom one — takes its shape from the config.\n //\n // The identity fields are carried across explicitly. This used to\n // return the config's property alone, which dropped the name, the\n // description and the column mapping: switching an existing property to\n // one of these widgets silently blanked its label. The branches above\n // all merge onto `propertyData`; this one did not.\n //\n // Only those three are kept, not a full merge: the point of changing\n // widget is to change type, and a `defaultValue` or `enum` left over\n // from the previous type is not valid for the new one.\n updatedProperty = {\n ...propertyConfigs[selectedWidgetId].property,\n propertyConfig: selectedWidgetId,\n ...(propertyData?.name !== undefined ? { name: propertyData.name } : {}),\n ...(propertyData?.description !== undefined ? { description: propertyData.description } : {}),\n ...(propertyData?.columnName !== undefined ? { columnName: propertyData.columnName } : {})\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/forms\";\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/cms-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 \"multi_references\",\n \"relation\",\n \"switch\",\n \"date_time\",\n \"group\",\n \"key_value\",\n \"repeat\",\n \"block\",\n // These three have a field binding and a property editor, and were simply\n // never added to the picker — so a property of the type rendered correctly\n // once it existed, but there was no way to create one from the UI.\n \"vector_input\",\n \"geopoint\",\n \"binary\"\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/forms\";\nimport { useTranslation } from \"@rebasepro/app\";\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/forms\";\nimport { ConfirmationDialog } from \"@rebasepro/app\";\nimport { DEFAULT_FIELD_CONFIGS, getFieldConfig, getFieldId } from \"../../../components/field_configs\";\nimport { PropertyConfigBadge } from \"../../../components/PropertyConfigBadge\";\nimport { Property } from \"@rebasepro/types\";\nimport { PropertyConfig, PropertyConfigId, AdminCollection } from \"@rebasepro/cms-types\";\nimport type { PropertyTypePreset, PropertyType } from \"../../extensibility_types\";\nimport { toSerializableProperty, toSerializableCollectionConfig } from \"../../serializable_utils\";\nimport type { SerializableProperty, SerializableCollectionConfig } 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: SerializableCollectionConfig;\n }) => React.ReactNode;\n collectionValues?: AdminCollection;\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?: AdminCollection;\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\": \"geopoint\",\n \"binary\": \"binary\"\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,\n...preset.defaults,\npropertyConfig: 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 === \"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 if (selectedFieldConfigId === \"geopoint\" || selectedFieldConfigId === \"binary\") {\n // These two have nothing of their own to configure — a geopoint is a\n // latitude and a longitude, a binary value is base64 — so the shared\n // fields above are the whole editor. Said out loud, because a dialog\n // that just stops is indistinguishable from one that failed to load.\n childComponent = (\n <div className={\"col-span-12\"}>\n <Typography variant={\"body2\"} color={\"secondary\"}>\n {selectedFieldConfigId === \"geopoint\"\n ? \"A location is stored as a latitude and a longitude. There is nothing further to configure here.\"\n : \"Binary values are stored as base64. There is nothing further to configure here.\"}\n </Typography>\n </div>\n );\n } else {\n // No editor matched this widget. `geopoint` lands here every time: the\n // model defines the type, but the admin has no field binding for it, so\n // `getDefaultFieldId` falls off the end of its chain, logs to the\n // console and returns undefined.\n //\n // This used to render nothing — the dialog opened showing a name, a\n // description and no type-specific fields at all, which reads exactly\n // like a property that simply has no settings. Saying so out loud is\n // not support, but it is the difference between a gap and a bug.\n childComponent = (\n <div className={\"col-span-12\"}>\n <InfoLabel mode={\"warn\"}>\n {values?.type\n ? `Properties of type \"${values.type}\" have no editor in the admin panel yet. ` +\n \"The fields shown here are the ones every property shares — configure the rest in code.\"\n : \"This property has no type yet.\"}\n </InfoLabel>\n </div>\n );\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,\n[key]: value }\n } as PropertyWithId);\n },\n property: toSerializableProperty(values as Property),\n collection: toSerializableCollectionConfig(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 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 geopoint: \"Location\",\n binary: \"Binary\"\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 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 geopoint: \"geopoint\",\n binary: \"binary\"\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":";;;;;;;;;;;;;;;;;AAsCA,SAAgB,SAAS,EACrB,YACA,iBACA,SACA,WACA,UACA,oBACA,WACc;CAEd,MAAM,SAAS,gBAEZ;EACC,eAAe,EAAE,MAAM,WAAW;EAClC,kBAAkB;EAClB,aAAa,WAAW;GAEpB,MAAM,aAA+B,CAAC;GACtC,IAAI,cAAc;GAClB,IAAI,OAAO,MACP,OAAO,KAAK,SAAS,WAAW,UAAU;IACtC,MAAM,aAA6B,CAAC;IACpC,IAAI,CAAC,WAAW,OAAO;KACnB,WAAW,QAAQ;KACnB,cAAc;IAClB;IACA,IAAI,CAAC,WAAW,IAAI;KAChB,WAAW,KAAK;KAChB,cAAc;IAClB;IACA,WAAW,SAAS;GACxB,CAAC;GAEL,MAAM,SAAS,cAAc,EAAE,MAAM,WAAW,IAAI,CAAC;GACrD,UAAU,WAAW;GACrB,OAAO;EACX;CACJ,CAAC;CAED,MAAM,EACF,QACA,WACA;CAEJ,gBAAgB;EACZ,IAAI,iBACA,gBAAgB,OAAO,IAAI;CAEnC,GAAG,CAAC,OAAO,IAAI,CAAC;CAEhB,OAAO,oBAAC,QAAD;EAAQ,OAAO;YAClB,oBAAC,gBAAD;GAAgB,gBAAgB;GACpB;GACA;GACR,gBAAgB;GACN;GACU;GACX;EAAS,CAAA;CAClB,CAAA;AAEZ;AAeA,SAAS,eAAe,EACpB,QACA,QACA,UACA,gBACA,gBACA,oBACA,WAC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