@rebasepro/admin 0.5.0 → 0.6.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 (348) hide show
  1. package/README.md +7 -3
  2. package/dist/CollectionEditorDialog-HNXGxXdO.js +3549 -0
  3. package/dist/CollectionEditorDialog-HNXGxXdO.js.map +1 -0
  4. package/dist/CollectionsStudioView-B1mN33GB.js +170 -0
  5. package/dist/CollectionsStudioView-B1mN33GB.js.map +1 -0
  6. package/dist/PropertyEditView-C2wp8kQ9.js +3660 -0
  7. package/dist/PropertyEditView-C2wp8kQ9.js.map +1 -0
  8. package/dist/collection_editor/ConfigControllerProvider.d.ts +2 -2
  9. package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +2 -1
  10. package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +2 -1
  11. package/dist/collection_editor/ui/EditorCollectionAction.d.ts +1 -1
  12. package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +1 -1
  13. package/dist/collection_editor/ui/EditorEntityAction.d.ts +1 -1
  14. package/dist/collection_editor/ui/HomePageEditorCollectionAction.d.ts +1 -1
  15. package/dist/collection_editor/ui/KanbanSetupAction.d.ts +2 -1
  16. package/dist/collection_editor/ui/MissingReferenceWidget.d.ts +1 -1
  17. package/dist/collection_editor/ui/NewCollectionButton.d.ts +1 -1
  18. package/dist/collection_editor/ui/NewCollectionCard.d.ts +1 -1
  19. package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +1 -1
  20. package/dist/collection_editor/ui/collection_editor/AICollectionGeneratorPopover.d.ts +1 -1
  21. package/dist/collection_editor/ui/collection_editor/AIModifiedPathsContext.d.ts +1 -1
  22. package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +2 -1
  23. package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +2 -2
  24. package/dist/collection_editor/ui/collection_editor/CollectionEditorWelcomeView.d.ts +2 -2
  25. package/dist/collection_editor/ui/collection_editor/CollectionJsonImportDialog.d.ts +2 -1
  26. package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +1 -1
  27. package/dist/collection_editor/ui/collection_editor/CollectionRLSTab.d.ts +2 -1
  28. package/dist/collection_editor/ui/collection_editor/CollectionRelationsTab.d.ts +2 -1
  29. package/dist/collection_editor/ui/collection_editor/CollectionStudioView.d.ts +2 -1
  30. package/dist/collection_editor/ui/collection_editor/CollectionYupValidation.d.ts +1 -9
  31. package/dist/collection_editor/ui/collection_editor/CollectionsStudioView.d.ts +2 -1
  32. package/dist/collection_editor/ui/collection_editor/DisplaySettingsForm.d.ts +2 -1
  33. package/dist/collection_editor/ui/collection_editor/EntityActionsEditTab.d.ts +2 -1
  34. package/dist/collection_editor/ui/collection_editor/EntityActionsSelectDialog.d.ts +2 -1
  35. package/dist/collection_editor/ui/collection_editor/EntityCustomViewsSelectDialog.d.ts +2 -1
  36. package/dist/collection_editor/ui/collection_editor/EnumForm.d.ts +2 -1
  37. package/dist/collection_editor/ui/collection_editor/GeneralSettingsForm.d.ts +2 -1
  38. package/dist/collection_editor/ui/collection_editor/GetCodeDialog.d.ts +2 -1
  39. package/dist/collection_editor/ui/collection_editor/KanbanConfigSection.d.ts +2 -1
  40. package/dist/collection_editor/ui/collection_editor/LayoutModeSwitch.d.ts +1 -1
  41. package/dist/collection_editor/ui/collection_editor/PropertyEditView.d.ts +4 -4
  42. package/dist/collection_editor/ui/collection_editor/PropertyFieldPreview.d.ts +2 -2
  43. package/dist/collection_editor/ui/collection_editor/PropertyTree.d.ts +2 -2
  44. package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +2 -1
  45. package/dist/collection_editor/ui/collection_editor/SwitchControl.d.ts +2 -1
  46. package/dist/collection_editor/ui/collection_editor/ViewModeSwitch.d.ts +1 -1
  47. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportDataPreview.d.ts +1 -1
  48. package/dist/collection_editor/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +3 -2
  49. package/dist/collection_editor/ui/collection_editor/properties/BlockPropertyField.d.ts +2 -1
  50. package/dist/collection_editor/ui/collection_editor/properties/BooleanPropertyField.d.ts +2 -1
  51. package/dist/collection_editor/ui/collection_editor/properties/DateTimePropertyField.d.ts +2 -1
  52. package/dist/collection_editor/ui/collection_editor/properties/EnumPropertyField.d.ts +2 -1
  53. package/dist/collection_editor/ui/collection_editor/properties/KeyValuePropertyField.d.ts +2 -1
  54. package/dist/collection_editor/ui/collection_editor/properties/MapPropertyField.d.ts +2 -1
  55. package/dist/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.d.ts +2 -1
  56. package/dist/collection_editor/ui/collection_editor/properties/NumberPropertyField.d.ts +2 -1
  57. package/dist/collection_editor/ui/collection_editor/properties/ReferencePropertyField.d.ts +3 -2
  58. package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.d.ts +2 -1
  59. package/dist/collection_editor/ui/collection_editor/properties/RepeatPropertyField.d.ts +2 -1
  60. package/dist/collection_editor/ui/collection_editor/properties/StoragePropertyField.d.ts +2 -1
  61. package/dist/collection_editor/ui/collection_editor/properties/StringPropertyField.d.ts +2 -1
  62. package/dist/collection_editor/ui/collection_editor/properties/UrlPropertyField.d.ts +2 -1
  63. package/dist/collection_editor/ui/collection_editor/properties/VectorPropertyField.d.ts +2 -1
  64. package/dist/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +2 -1
  65. package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsEditor.d.ts +2 -1
  66. package/dist/collection_editor/ui/collection_editor/properties/conditions/ConditionsPanel.d.ts +1 -1
  67. package/dist/collection_editor/ui/collection_editor/properties/conditions/EnumConditionsEditor.d.ts +2 -1
  68. package/dist/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +2 -1
  69. package/dist/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +2 -1
  70. package/dist/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.d.ts +2 -1
  71. package/dist/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +2 -1
  72. package/dist/collection_editor/ui/collection_editor/properties/validation/ValidationPanel.d.ts +1 -1
  73. package/dist/collection_editor_ui.js +4 -11
  74. package/dist/components/ArrayContainer.d.ts +3 -3
  75. package/dist/components/ClearFilterSortButton.d.ts +1 -1
  76. package/dist/components/CollectionEditorDialogs.d.ts +2 -1
  77. package/dist/components/CollectionPanel.d.ts +2 -27
  78. package/dist/components/DefaultAppBar.d.ts +1 -1
  79. package/dist/components/DefaultDrawer.d.ts +4 -4
  80. package/dist/components/DeleteEntityDialog.d.ts +2 -1
  81. package/dist/components/DrawerNavigationGroup.d.ts +1 -1
  82. package/dist/components/DrawerNavigationItem.d.ts +1 -1
  83. package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +1 -1
  84. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +2 -1
  85. package/dist/components/EntityCollectionTable/fields/TableMultipleRelationField.d.ts +3 -3
  86. package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +3 -3
  87. package/dist/components/EntityCollectionTable/fields/TableRelationField.d.ts +3 -3
  88. package/dist/components/EntityCollectionTable/fields/TableRelationSelectorField.d.ts +2 -1
  89. package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
  90. package/dist/components/EntityCollectionTable/fields/VirtualTableDateField.d.ts +1 -1
  91. package/dist/components/EntityCollectionTable/fields/VirtualTableInput.d.ts +2 -1
  92. package/dist/components/EntityCollectionTable/fields/VirtualTableNumberInput.d.ts +2 -1
  93. package/dist/components/EntityCollectionTable/fields/VirtualTableSelect.d.ts +1 -1
  94. package/dist/components/EntityCollectionTable/fields/VirtualTableSwitch.d.ts +2 -1
  95. package/dist/components/EntityCollectionTable/fields/VirtualTableUserSelect.d.ts +1 -1
  96. package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +1 -1
  97. package/dist/components/EntityCollectionTable/internal/EntityTableCellActions.d.ts +1 -1
  98. package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +4 -3
  99. package/dist/components/EntityCollectionView/Board.d.ts +2 -1
  100. package/dist/components/EntityCollectionView/BoardColumnTitle.d.ts +1 -1
  101. package/dist/components/EntityCollectionView/BoardSortableList.d.ts +1 -1
  102. package/dist/components/EntityCollectionView/EntityBoardCard.d.ts +1 -1
  103. package/dist/components/EntityCollectionView/EntityCard.d.ts +2 -1
  104. package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +1 -1
  105. package/dist/components/EntityCollectionView/EntityCollectionCardView.d.ts +1 -1
  106. package/dist/components/EntityCollectionView/EntityCollectionListView.d.ts +1 -1
  107. package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +0 -24
  108. package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +1 -1
  109. package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +2 -1
  110. package/dist/components/EntityCollectionView/FilterPresetsButton.d.ts +2 -1
  111. package/dist/components/EntityCollectionView/FiltersDialog.d.ts +2 -1
  112. package/dist/components/EntityCollectionView/SplitListView.d.ts +1 -1
  113. package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +2 -1
  114. package/dist/components/EntityDetailView.d.ts +1 -1
  115. package/dist/components/EntityEditView.d.ts +2 -2
  116. package/dist/components/EntityEditViewFormActions.d.ts +2 -1
  117. package/dist/components/EntityJsonPreview.d.ts +2 -1
  118. package/dist/components/EntityPreview.d.ts +3 -3
  119. package/dist/components/EntitySidePanel.d.ts +2 -1
  120. package/dist/components/EntityView.d.ts +2 -1
  121. package/dist/components/FieldCaption.d.ts +1 -1
  122. package/dist/components/HomePage/ContentHomePage.d.ts +1 -1
  123. package/dist/components/HomePage/FavouritesView.d.ts +1 -1
  124. package/dist/components/HomePage/HomePageDnD.d.ts +4 -4
  125. package/dist/components/HomePage/NavigationCard.d.ts +1 -1
  126. package/dist/components/HomePage/NavigationCardBinding.d.ts +2 -1
  127. package/dist/components/HomePage/NavigationGroup.d.ts +2 -2
  128. package/dist/components/HomePage/RenameGroupDialog.d.ts +2 -1
  129. package/dist/components/HomePage/SmallNavigationCard.d.ts +1 -1
  130. package/dist/components/PropertyCollectionView.d.ts +2 -1
  131. package/dist/components/PropertyIdCopyTooltip.d.ts +2 -2
  132. package/dist/components/RebaseAuthGate.d.ts +1 -1
  133. package/dist/components/RebaseLayout.d.ts +1 -1
  134. package/dist/components/RebaseNavigation.d.ts +1 -1
  135. package/dist/components/RebaseRouteDefs.d.ts +1 -1
  136. package/dist/components/RebaseShell.d.ts +1 -1
  137. package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +1 -1
  138. package/dist/components/ReferenceWidget.d.ts +2 -1
  139. package/dist/components/SearchIconsView.d.ts +2 -1
  140. package/dist/components/SelectableTable/SelectableTable.d.ts +2 -2
  141. package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -1
  142. package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -1
  143. package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -1
  144. package/dist/components/SelectableTable/filters/RelationFilterField.d.ts +2 -1
  145. package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -1
  146. package/dist/components/SideDialogs.d.ts +1 -1
  147. package/dist/components/SideEntityProvider.d.ts +1 -1
  148. package/dist/components/admin/CreationResultDialog.d.ts +2 -1
  149. package/dist/components/app/AppBar.d.ts +1 -1
  150. package/dist/components/app/Drawer.d.ts +1 -1
  151. package/dist/components/common/default_entity_actions.d.ts +2 -1
  152. package/dist/components/history/EntityHistoryEntry.d.ts +1 -1
  153. package/dist/components/history/EntityHistoryView.d.ts +1 -1
  154. package/dist/components/history/LastEditedByFormAction.d.ts +2 -1
  155. package/dist/components/history/LastEditedByIndicator.d.ts +2 -1
  156. package/dist/components/history/UserChip.d.ts +1 -1
  157. package/dist/data_export/export/BasicExportAction.d.ts +2 -1
  158. package/dist/data_export/export/ExportCollectionAction.d.ts +1 -1
  159. package/dist/data_import/components/DataNewPropertiesMapping.d.ts +1 -1
  160. package/dist/data_import/components/ImportFileUpload.d.ts +1 -1
  161. package/dist/data_import/components/ImportNewPropertyFieldPreview.d.ts +2 -1
  162. package/dist/data_import/components/ImportSaveInProgress.d.ts +1 -1
  163. package/dist/data_import/import/ImportCollectionAction.d.ts +4 -3
  164. package/dist/editor/components/SlashCommandMenu.d.ts +2 -1
  165. package/dist/editor/editor.d.ts +10 -4
  166. package/dist/editor/selectors/color-selector.d.ts +1 -1
  167. package/dist/editor/selectors/link-selector.d.ts +1 -1
  168. package/dist/editor/selectors/node-selector.d.ts +1 -1
  169. package/dist/editor/selectors/text-buttons.d.ts +1 -1
  170. package/dist/editor.js +2623 -3574
  171. package/dist/editor.js.map +1 -1
  172. package/dist/form/EntityForm.d.ts +2 -1
  173. package/dist/form/EntityFormActions.d.ts +2 -1
  174. package/dist/form/components/FieldHelperText.d.ts +1 -1
  175. package/dist/form/components/FormEntry.d.ts +1 -1
  176. package/dist/form/components/FormLayout.d.ts +1 -1
  177. package/dist/form/components/LabelWithIconAndTooltip.d.ts +1 -1
  178. package/dist/form/components/LocalChangesMenu.d.ts +2 -1
  179. package/dist/form/components/StorageItemPreview.d.ts +2 -1
  180. package/dist/form/components/StorageUploadProgress.d.ts +2 -1
  181. package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +2 -1
  182. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +2 -1
  183. package/dist/form/field_bindings/BlockFieldBinding.d.ts +2 -1
  184. package/dist/form/field_bindings/DateTimeFieldBinding.d.ts +2 -1
  185. package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +2 -1
  186. package/dist/form/field_bindings/MapFieldBinding.d.ts +2 -1
  187. package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +4 -3
  188. package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +2 -1
  189. package/dist/form/field_bindings/MultipleRelationFieldBinding.d.ts +2 -1
  190. package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +2 -1
  191. package/dist/form/field_bindings/ReferenceAsStringFieldBinding.d.ts +2 -1
  192. package/dist/form/field_bindings/ReferenceFieldBinding.d.ts +2 -1
  193. package/dist/form/field_bindings/RelationFieldBinding.d.ts +2 -1
  194. package/dist/form/field_bindings/RepeatFieldBinding.d.ts +2 -1
  195. package/dist/form/field_bindings/SelectFieldBinding.d.ts +2 -1
  196. package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +3 -2
  197. package/dist/form/field_bindings/SwitchFieldBinding.d.ts +2 -1
  198. package/dist/form/field_bindings/TextFieldBinding.d.ts +2 -1
  199. package/dist/form/field_bindings/UserSelectFieldBinding.d.ts +2 -1
  200. package/dist/form/field_bindings/VectorFieldBinding.d.ts +2 -1
  201. package/dist/history-BO6VT85a.js +311 -0
  202. package/dist/history-BO6VT85a.js.map +1 -0
  203. package/dist/hooks/navigation/useBuildNavigationStateController.d.ts +0 -2
  204. package/dist/hooks/navigation/useNavigationResolution.d.ts +5 -6
  205. package/dist/hooks/navigation/useResolvedCollections.d.ts +0 -2
  206. package/dist/hooks/useBreadcrumbsController.d.ts +2 -32
  207. package/dist/index.d.ts +1 -1
  208. package/dist/index.js +2 -3393
  209. package/dist/markdown-CklalUUk.js +526 -0
  210. package/dist/markdown-CklalUUk.js.map +1 -0
  211. package/dist/preview/components/ArrayEnumPreview.d.ts +2 -1
  212. package/dist/preview/components/EmptyValue.d.ts +2 -1
  213. package/dist/preview/components/EnumValuesChip.d.ts +1 -1
  214. package/dist/preview/components/ImagePreview.d.ts +2 -1
  215. package/dist/preview/components/ReferencePreview.d.ts +2 -1
  216. package/dist/preview/components/RelationPreview.d.ts +2 -1
  217. package/dist/preview/components/StorageThumbnail.d.ts +1 -1
  218. package/dist/preview/components/UserPreview.d.ts +6 -3
  219. package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +2 -1
  220. package/dist/preview/property_previews/ArrayOfReferencesPreview.d.ts +1 -1
  221. package/dist/preview/property_previews/ArrayOfRelationsPreview.d.ts +1 -1
  222. package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +2 -1
  223. package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +2 -1
  224. package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +2 -1
  225. package/dist/preview/property_previews/ArrayPropertyEnumPreview.d.ts +1 -1
  226. package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +2 -1
  227. package/dist/preview/property_previews/MapPropertyPreview.d.ts +3 -2
  228. package/dist/preview/property_previews/SkeletonPropertyComponent.d.ts +5 -4
  229. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  230. package/dist/routes/RebaseRoute.d.ts +1 -1
  231. package/dist/src-BYniefVu.js +24011 -0
  232. package/dist/src-BYniefVu.js.map +1 -0
  233. package/dist/types/components/PropertyPreviewProps.d.ts +4 -0
  234. package/dist/types/components/formex.d.ts +1 -40
  235. package/dist/types/fields.d.ts +9 -1
  236. package/dist/util/navigation_utils.d.ts +2 -1
  237. package/dist/util/previews.d.ts +5 -0
  238. package/dist/util/property_utils.d.ts +1 -1
  239. package/package.json +29 -26
  240. package/src/collection_editor/ConfigControllerProvider.tsx +10 -7
  241. package/src/collection_editor/ui/AddKanbanColumnAction.tsx +2 -0
  242. package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +2 -1
  243. package/src/collection_editor/ui/EditorCollectionAction.tsx +2 -1
  244. package/src/collection_editor/ui/EditorCollectionActionStart.tsx +2 -1
  245. package/src/collection_editor/ui/EditorEntityAction.tsx +2 -1
  246. package/src/collection_editor/ui/KanbanSetupAction.tsx +2 -1
  247. package/src/collection_editor/ui/MissingReferenceWidget.tsx +2 -1
  248. package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +2 -1
  249. package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +2 -3
  250. package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +0 -1
  251. package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +8 -4
  252. package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +2 -1
  253. package/src/collection_editor/ui/collection_editor/PropertyEditView.tsx +1 -1
  254. package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +5 -2
  255. package/src/collection_editor/useLocalCollectionsConfigController.tsx +7 -2
  256. package/src/collection_editor/validateCollectionJson.ts +2 -2
  257. package/src/components/ArrayContainer.tsx +5 -5
  258. package/src/components/CollectionPanel.tsx +51 -25
  259. package/src/components/DefaultAppBar.tsx +1 -2
  260. package/src/components/DefaultDrawer.tsx +3 -2
  261. package/src/components/DrawerNavigationGroup.tsx +3 -2
  262. package/src/components/DrawerNavigationItem.tsx +4 -4
  263. package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +30 -9
  264. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +1 -1
  265. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -0
  266. package/src/components/EntityCollectionView/Board.tsx +10 -8
  267. package/src/components/EntityCollectionView/BoardSortableList.tsx +2 -2
  268. package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +6 -2
  269. package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +14 -4
  270. package/src/components/EntityCollectionView/EntityCollectionListView.tsx +48 -26
  271. package/src/components/EntityCollectionView/EntityCollectionView.tsx +146 -73
  272. package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +2 -1
  273. package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +3 -2
  274. package/src/components/EntityCollectionView/FilterPresetsButton.tsx +4 -2
  275. package/src/components/EntityCollectionView/ViewModeToggle.tsx +0 -1
  276. package/src/components/EntityCollectionView/useBoardDataController.tsx +17 -15
  277. package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +29 -19
  278. package/src/components/EntityDetailView.tsx +66 -30
  279. package/src/components/EntityEditView.tsx +70 -32
  280. package/src/components/EntitySidePanel.tsx +6 -3
  281. package/src/components/HomePage/ContentHomePage.tsx +3 -3
  282. package/src/components/HomePage/NavigationCard.tsx +9 -15
  283. package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
  284. package/src/components/HomePage/NavigationGroup.tsx +1 -1
  285. package/src/components/HomePage/SmallNavigationCard.tsx +1 -5
  286. package/src/components/RebaseLayout.tsx +5 -2
  287. package/src/components/RebaseNavigation.tsx +1 -4
  288. package/src/components/RebaseRouteDefs.tsx +5 -3
  289. package/src/components/SearchIconsView.tsx +1 -1
  290. package/src/components/SelectableTable/SelectableTable.tsx +2 -3
  291. package/src/components/SelectableTable/SelectionStore.ts +9 -3
  292. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +28 -21
  293. package/src/components/UserSelector.tsx +92 -2
  294. package/src/components/common/default_entity_actions.tsx +33 -8
  295. package/src/components/field_configs.tsx +6 -3
  296. package/src/editor/editor.tsx +15 -9
  297. package/src/editor/extensions/Image/index.ts +2 -2
  298. package/src/editor/extensions/Image.ts +2 -2
  299. package/src/editor/extensions/clipboard.ts +2 -2
  300. package/src/editor/markdown-it-plugins.d.ts +24 -0
  301. package/src/editor/markdown.ts +2 -3
  302. package/src/form/EntityForm.tsx +21 -15
  303. package/src/form/field_bindings/MapFieldBinding.tsx +3 -3
  304. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +4 -4
  305. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +1 -1
  306. package/src/form/field_bindings/VectorFieldBinding.tsx +3 -3
  307. package/src/form/validation.ts +17 -15
  308. package/src/hooks/navigation/useBuildNavigationStateController.tsx +3 -6
  309. package/src/hooks/navigation/useNavigationResolution.ts +143 -19
  310. package/src/hooks/navigation/useResolvedCollections.ts +4 -6
  311. package/src/hooks/useBreadcrumbsController.tsx +2 -34
  312. package/src/hooks/useBuildSideEntityController.tsx +25 -3
  313. package/src/index.ts +2 -2
  314. package/src/preview/PropertyPreview.tsx +6 -2
  315. package/src/preview/components/ReferencePreview.tsx +64 -13
  316. package/src/preview/components/RelationPreview.tsx +101 -13
  317. package/src/preview/components/UserPreview.tsx +5 -14
  318. package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -1
  319. package/src/routes/RebaseRoute.tsx +5 -4
  320. package/src/types/components/PropertyPreviewProps.tsx +5 -0
  321. package/src/types/components/formex.tsx +1 -45
  322. package/src/types/fields.tsx +10 -1
  323. package/src/util/navigation_utils.ts +14 -4
  324. package/src/util/previews.ts +101 -4
  325. package/dist/CollectionEditorDialog-C8E440oK.js +0 -4574
  326. package/dist/CollectionEditorDialog-C8E440oK.js.map +0 -1
  327. package/dist/CollectionsStudioView-Brr_b06v.js +0 -217
  328. package/dist/CollectionsStudioView-Brr_b06v.js.map +0 -1
  329. package/dist/ExportCollectionAction-D3TTYXrq.js +0 -446
  330. package/dist/ExportCollectionAction-D3TTYXrq.js.map +0 -1
  331. package/dist/ImportCollectionAction-Dn7lya6E.js +0 -685
  332. package/dist/ImportCollectionAction-Dn7lya6E.js.map +0 -1
  333. package/dist/PropertyEditView-ChBleIbN.js +0 -8197
  334. package/dist/PropertyEditView-ChBleIbN.js.map +0 -1
  335. package/dist/collection_editor_ui.js.map +0 -1
  336. package/dist/index-D3S9x_RP.js +0 -462
  337. package/dist/index-D3S9x_RP.js.map +0 -1
  338. package/dist/index-D9RNzm01.js +0 -12
  339. package/dist/index-D9RNzm01.js.map +0 -1
  340. package/dist/index-DrrT332R.js +0 -8
  341. package/dist/index-DrrT332R.js.map +0 -1
  342. package/dist/index.js.map +0 -1
  343. package/dist/markdown-DD2JDU1X.js +0 -618
  344. package/dist/markdown-DD2JDU1X.js.map +0 -1
  345. package/dist/useEntityHistory-UVsSclfZ.js +0 -123
  346. package/dist/useEntityHistory-UVsSclfZ.js.map +0 -1
  347. package/dist/util-COYYD8zr.js +0 -30474
  348. package/dist/util-COYYD8zr.js.map +0 -1
@@ -1,446 +0,0 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import React__default, { useCallback } from "react";
3
- import { useTranslation, useData } from "@rebasepro/core";
4
- import { Tooltip, IconButton, DownloadIcon, Dialog, DialogTitle, DialogContent, RadioGroup, RadioGroupItem, Label, BooleanSwitchWithLabel, DialogActions, Button, iconSize, Alert, CircularProgress } from "@rebasepro/ui";
5
- import { bi as useCMSContext } from "./util-COYYD8zr.js";
6
- import "react-compiler-runtime";
7
- import { getDefaultValuesFor } from "@rebasepro/common";
8
- import "fast-equals";
9
- import "@rebasepro/formex";
10
- import "zod";
11
- import { getArrayValuesCount, getValueInPath } from "@rebasepro/utils";
12
- import "@dnd-kit/core";
13
- import "@dnd-kit/modifiers";
14
- import "@dnd-kit/sortable";
15
- import "@dnd-kit/utilities";
16
- import "react-dropzone";
17
- import "@rebasepro/types";
18
- import "react-router-dom";
19
- import "exceljs";
20
- import "@rebasepro/schema-inference";
21
- import "date-fns";
22
- import "date-fns/locale";
23
- import "fuse.js";
24
- function downloadEntitiesExport({
25
- data,
26
- additionalData,
27
- properties,
28
- propertiesOrder,
29
- name,
30
- flattenArrays,
31
- additionalHeaders,
32
- exportType,
33
- dateExportType
34
- }) {
35
- console.debug("Downloading export", {
36
- dataLength: data.length,
37
- properties,
38
- exportType,
39
- dateExportType
40
- });
41
- if (exportType === "csv") {
42
- const arrayValuesCount = flattenArrays ? getArrayValuesCount(data.map((d) => d.values)) : {};
43
- const headers = getExportHeaders(properties, propertiesOrder, additionalHeaders, arrayValuesCount);
44
- const exportableData = getEntityCSVExportableData(data, additionalData, properties, headers, dateExportType);
45
- const headersData = entryToCSVRow(headers.map((h) => h.label));
46
- const csvData = exportableData.map((entry) => entryToCSVRow(entry));
47
- downloadBlob([headersData, ...csvData], `${name}.csv`, "text/csv");
48
- } else {
49
- const exportableData = getEntityJsonExportableData(data, additionalData, properties, dateExportType);
50
- const json = JSON.stringify(exportableData, null, 2);
51
- downloadBlob([json], `${name}.json`, "application/json");
52
- }
53
- }
54
- function getEntityCSVExportableData(data, additionalData, properties, headers, dateExportType) {
55
- const mergedData = data.map((e) => ({
56
- id: e.id,
57
- ...processValuesForExport(e.values, properties, "csv", dateExportType)
58
- }));
59
- if (additionalData) {
60
- additionalData.forEach((additional, index) => {
61
- mergedData[index] = {
62
- ...mergedData[index],
63
- ...additional
64
- };
65
- });
66
- }
67
- return mergedData && mergedData.map((entry) => {
68
- return headers.map((header) => getValueInPath(entry, header.key));
69
- });
70
- }
71
- function getEntityJsonExportableData(data, additionalData, properties, dateExportType) {
72
- const mergedData = data.map((e) => ({
73
- id: e.id,
74
- ...processValuesForExport(e.values, properties, "json", dateExportType)
75
- }));
76
- if (additionalData) {
77
- additionalData.forEach((additional, index) => {
78
- mergedData[index] = {
79
- ...mergedData[index],
80
- ...additional
81
- };
82
- });
83
- }
84
- return mergedData;
85
- }
86
- function getExportHeaders(properties, propertiesOrder, additionalHeaders, arrayValuesCount) {
87
- const headers = [{
88
- label: "id",
89
- key: "id"
90
- }, ...(propertiesOrder ?? Object.keys(properties)).flatMap((childKey) => {
91
- const property = properties[childKey];
92
- if (!property) {
93
- console.warn("Property not found", childKey, properties);
94
- return [];
95
- }
96
- if (arrayValuesCount && arrayValuesCount[childKey] > 1) {
97
- return Array.from({
98
- length: arrayValuesCount[childKey]
99
- }, (_, i) => getHeaders(property, `${childKey}[${i}]`, "")).flat();
100
- } else {
101
- return getHeaders(property, childKey, "");
102
- }
103
- })];
104
- if (additionalHeaders) {
105
- headers.push(...additionalHeaders.map((h) => ({
106
- label: h,
107
- key: h
108
- })));
109
- }
110
- return headers;
111
- }
112
- function getHeaders(property, propertyKey, prefix = "") {
113
- const currentKey = prefix ? `${prefix}.${propertyKey}` : propertyKey;
114
- if (property.type === "map" && property.properties) {
115
- return Object.entries(property.properties).map(([childKey, p]) => getHeaders(p, childKey, currentKey)).flat();
116
- } else {
117
- return [{
118
- label: currentKey,
119
- key: currentKey
120
- }];
121
- }
122
- }
123
- function processValueForExport(inputValue, property, exportType, dateExportType) {
124
- let value;
125
- if (property.type === "map" && property.properties) {
126
- value = processValuesForExport(inputValue, property.properties, exportType, dateExportType);
127
- } else if (property.type === "array") {
128
- if (property.of && Array.isArray(inputValue)) {
129
- if (Array.isArray(property.of)) {
130
- value = property.of.map((p, i) => processValueForExport(inputValue[i], p, exportType, dateExportType));
131
- } else if (property.of.type === "map") {
132
- value = exportType === "csv" ? inputValue.map((e) => JSON.stringify(e)) : inputValue.map((e) => processValueForExport(e, property.of, exportType, dateExportType));
133
- } else {
134
- value = inputValue.map((e) => processValueForExport(e, property.of, exportType, dateExportType));
135
- }
136
- } else {
137
- value = inputValue;
138
- }
139
- } else if (property.type === "reference" && inputValue && typeof inputValue === "object" && "isEntityReference" in inputValue && typeof inputValue.isEntityReference === "function" && inputValue.isEntityReference()) {
140
- const ref = inputValue ? inputValue : void 0;
141
- value = ref ? ref.fullPath : null;
142
- } else if (property.type === "date" && inputValue instanceof Date) {
143
- value = inputValue ? dateExportType === "timestamp" ? inputValue.getTime() : inputValue.toISOString() : null;
144
- } else {
145
- value = inputValue;
146
- }
147
- return value;
148
- }
149
- function processValuesForExport(inputValues, properties, exportType, dateExportType) {
150
- const updatedValues = Object.entries(properties).map(([key, property]) => {
151
- const inputValue = inputValues && inputValues[key];
152
- const updatedValue = processValueForExport(inputValue, property, exportType, dateExportType);
153
- if (updatedValue === void 0) return {};
154
- return {
155
- [key]: updatedValue
156
- };
157
- }).reduce((a, b) => ({
158
- ...a,
159
- ...b
160
- }), {});
161
- return {
162
- ...inputValues,
163
- ...updatedValues
164
- };
165
- }
166
- function entryToCSVRow(entry) {
167
- return entry.map((v) => {
168
- if (v === null || v === void 0) return "";
169
- if (Array.isArray(v)) return '"' + JSON.stringify(v).replaceAll('"', '""') + '"';
170
- const s = String(v);
171
- return '"' + s.replaceAll('"', '""') + '"';
172
- }).join(",") + "\r\n";
173
- }
174
- function downloadBlob(content, filename, contentType) {
175
- const blob = new Blob(content, {
176
- type: contentType
177
- });
178
- const url = URL.createObjectURL(blob);
179
- const pom = document.createElement("a");
180
- pom.href = url;
181
- pom.setAttribute("download", filename);
182
- pom.click();
183
- }
184
- function downloadDataAsCsv(data, name) {
185
- if (data.length === 0) return;
186
- const headers = Object.keys(data[0]);
187
- const csvContent = [headers.join(","), ...data.map((row) => headers.map((header) => {
188
- const value = row[header];
189
- if (value === null || value === void 0) return "";
190
- if (Array.isArray(value)) return `"${JSON.stringify(value).replace(/"/g, '""')}"`;
191
- return `"${String(value).replace(/"/g, '""')}"`;
192
- }).join(","))].join("\r\n");
193
- downloadBlob([csvContent], `${name}.csv`, "text/csv");
194
- }
195
- function BasicExportAction({
196
- data,
197
- properties,
198
- propertiesOrder
199
- }) {
200
- const {
201
- t
202
- } = useTranslation();
203
- const dateRef = React__default.useRef(/* @__PURE__ */ new Date());
204
- const [flattenArrays, setFlattenArrays] = React__default.useState(true);
205
- const [exportType, setExportType] = React__default.useState("csv");
206
- const [dateExportType, setDateExportType] = React__default.useState("string");
207
- const [open, setOpen] = React__default.useState(false);
208
- const handleClickOpen = useCallback(() => {
209
- setOpen(true);
210
- }, [setOpen]);
211
- const handleClose = useCallback(() => {
212
- setOpen(false);
213
- }, [setOpen]);
214
- const onOkClicked = useCallback(() => {
215
- downloadEntitiesExport({
216
- data,
217
- additionalData: [],
218
- properties,
219
- propertiesOrder,
220
- name: "export.csv",
221
- flattenArrays,
222
- additionalHeaders: [],
223
- exportType,
224
- dateExportType
225
- });
226
- handleClose();
227
- }, []);
228
- return /* @__PURE__ */ jsxs(Fragment, { children: [
229
- /* @__PURE__ */ jsx(Tooltip, { title: "Export", asChild: true, children: /* @__PURE__ */ jsx(IconButton, { size: "small", color: "primary", onClick: handleClickOpen, children: /* @__PURE__ */ jsx(DownloadIcon, { size: "small" }) }) }),
230
- /* @__PURE__ */ jsxs(Dialog, { open, onOpenChange: setOpen, maxWidth: "xl", children: [
231
- /* @__PURE__ */ jsx(DialogTitle, { variant: "h6", children: t("export_data") }),
232
- /* @__PURE__ */ jsxs(DialogContent, { className: "flex flex-col gap-4 my-4", children: [
233
- /* @__PURE__ */ jsx("div", { children: t("download_table_csv") }),
234
- /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-4", children: [
235
- /* @__PURE__ */ jsx("div", { className: "p-4 flex flex-col", children: /* @__PURE__ */ jsxs(RadioGroup, { value: exportType, onValueChange: (v) => setExportType(v), children: [
236
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
237
- /* @__PURE__ */ jsx(RadioGroupItem, { value: "csv", id: "radio-csv" }),
238
- /* @__PURE__ */ jsx(Label, { htmlFor: "radio-csv", children: t("csv") })
239
- ] }),
240
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
241
- /* @__PURE__ */ jsx(RadioGroupItem, { value: "json", id: "radio-json" }),
242
- /* @__PURE__ */ jsx(Label, { htmlFor: "radio-json", children: t("json") })
243
- ] })
244
- ] }) }),
245
- /* @__PURE__ */ jsx("div", { className: "p-4 flex flex-col", children: /* @__PURE__ */ jsxs(RadioGroup, { value: dateExportType, onValueChange: (v_0) => setDateExportType(v_0), children: [
246
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
247
- /* @__PURE__ */ jsx(RadioGroupItem, { value: "timestamp", id: "radio-timestamp" }),
248
- /* @__PURE__ */ jsxs(Label, { htmlFor: "radio-timestamp", children: [
249
- t("dates_as_timestamps"),
250
- " (",
251
- dateRef.current.getTime(),
252
- ")"
253
- ] })
254
- ] }),
255
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
256
- /* @__PURE__ */ jsx(RadioGroupItem, { value: "string", id: "radio-string" }),
257
- /* @__PURE__ */ jsxs(Label, { htmlFor: "radio-string", children: [
258
- t("dates_as_strings"),
259
- " (",
260
- dateRef.current.toISOString(),
261
- ")"
262
- ] })
263
- ] })
264
- ] }) })
265
- ] }),
266
- /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { size: "small", disabled: exportType !== "csv", value: flattenArrays, onValueChange: setFlattenArrays, label: t("flatten_arrays") })
267
- ] }),
268
- /* @__PURE__ */ jsxs(DialogActions, { children: [
269
- /* @__PURE__ */ jsx(Button, { onClick: handleClose, variant: "text", children: t("cancel") }),
270
- /* @__PURE__ */ jsx(Button, { onClick: onOkClicked, children: t("download") })
271
- ] })
272
- ] })
273
- ] });
274
- }
275
- const DOCS_LIMIT = 500;
276
- function ExportCollectionAction({
277
- collection,
278
- path,
279
- collectionEntitiesCount,
280
- onAnalyticsEvent,
281
- exportAllowed,
282
- notAllowedView
283
- }) {
284
- const {
285
- t
286
- } = useTranslation();
287
- const exportConfig = typeof collection.exportable === "object" ? collection.exportable : void 0;
288
- const dateRef = React__default.useRef(/* @__PURE__ */ new Date());
289
- const [includeUndefinedValues, setIncludeUndefinedValues] = React__default.useState(false);
290
- const [flattenArrays, setFlattenArrays] = React__default.useState(true);
291
- const [exportType, setExportType] = React__default.useState("csv");
292
- const [dateExportType, setDateExportType] = React__default.useState("string");
293
- const context = useCMSContext();
294
- const dataClient = useData();
295
- const canExport = !exportAllowed || exportAllowed({
296
- collectionEntitiesCount: collectionEntitiesCount ?? 0,
297
- path,
298
- collection
299
- });
300
- const [dataLoading, setDataLoading] = React__default.useState(false);
301
- const [dataLoadingError, setDataLoadingError] = React__default.useState();
302
- const [open, setOpen] = React__default.useState(false);
303
- const handleClickOpen = useCallback(() => {
304
- setOpen(true);
305
- }, [setOpen]);
306
- const handleClose = useCallback(() => {
307
- setOpen(false);
308
- }, [setOpen]);
309
- const fetchAdditionalFields = useCallback(async (entities) => {
310
- const additionalExportFields = exportConfig?.additionalFields;
311
- const additionalFields = collection.additionalFields;
312
- const resolvedExportColumnsValues = additionalExportFields ? await Promise.all(entities.map(async (entity) => {
313
- return (await Promise.all(additionalExportFields.map(async (column) => {
314
- return {
315
- [column.key]: await column.builder({
316
- entity,
317
- context
318
- })
319
- };
320
- }))).reduce((a, b) => ({
321
- ...a,
322
- ...b
323
- }), {});
324
- })) : [];
325
- const resolvedColumnsValues = additionalFields ? await Promise.all(entities.map(async (entity_0) => {
326
- return (await Promise.all(additionalFields.map(async (field) => {
327
- if (!field.value) return {};
328
- return {
329
- [field.key]: await field.value({
330
- entity: entity_0,
331
- context
332
- })
333
- };
334
- }))).reduce((a_0, b_0) => ({
335
- ...a_0,
336
- ...b_0
337
- }), {});
338
- })) : [];
339
- return [...resolvedExportColumnsValues, ...resolvedColumnsValues];
340
- }, [exportConfig?.additionalFields]);
341
- const doDownload = useCallback(async (collection_0, exportConfig_0) => {
342
- onAnalyticsEvent?.("export_collection", {
343
- collection: collection_0.slug
344
- });
345
- setDataLoading(true);
346
- dataClient.collection(path).find({}).then(async (res) => {
347
- const data = res.data;
348
- setDataLoadingError(void 0);
349
- const additionalData = await fetchAdditionalFields(data);
350
- const additionalHeaders = [...exportConfig_0?.additionalFields?.map((column_0) => column_0.key) ?? [], ...collection_0.additionalFields?.map((field_0) => field_0.key) ?? []];
351
- const dataWithDefaults = includeUndefinedValues ? data.map((entity_1) => {
352
- const defaultValues = getDefaultValuesFor(collection_0.properties);
353
- return {
354
- ...entity_1,
355
- values: {
356
- ...defaultValues,
357
- ...entity_1.values
358
- }
359
- };
360
- }) : data;
361
- downloadEntitiesExport({
362
- data: dataWithDefaults,
363
- additionalData,
364
- properties: collection_0.properties,
365
- propertiesOrder: collection_0.propertiesOrder,
366
- name: collection_0.name,
367
- flattenArrays,
368
- additionalHeaders,
369
- exportType,
370
- dateExportType
371
- });
372
- onAnalyticsEvent?.("export_collection_success", {
373
- collection: collection_0.slug
374
- });
375
- }).catch((e) => {
376
- console.error("Error loading export data", e);
377
- setDataLoadingError(e);
378
- }).finally(() => setDataLoading(false));
379
- }, [onAnalyticsEvent, dataClient, path, fetchAdditionalFields, includeUndefinedValues, flattenArrays, exportType, dateExportType]);
380
- const onOkClicked = useCallback(() => {
381
- doDownload(collection, exportConfig);
382
- handleClose();
383
- }, [doDownload, collection, exportConfig, handleClose]);
384
- return /* @__PURE__ */ jsxs(Fragment, { children: [
385
- /* @__PURE__ */ jsx(Tooltip, { title: "Export", asChild: true, children: /* @__PURE__ */ jsx(IconButton, { size: "small", color: "primary", onClick: handleClickOpen, children: /* @__PURE__ */ jsx(DownloadIcon, { size: iconSize.small }) }) }),
386
- /* @__PURE__ */ jsxs(Dialog, { open, onOpenChange: setOpen, maxWidth: "xl", children: [
387
- /* @__PURE__ */ jsx(DialogTitle, { variant: "h6", children: t("export_data") }),
388
- /* @__PURE__ */ jsxs(DialogContent, { className: "flex flex-col gap-4 my-4", children: [
389
- /* @__PURE__ */ jsx("div", { children: t("download_table_csv") }),
390
- collectionEntitiesCount !== void 0 && collectionEntitiesCount > DOCS_LIMIT && /* @__PURE__ */ jsx(Alert, { color: "warning", children: /* @__PURE__ */ jsx("div", { children: t("large_number_of_documents", {
391
- count: collectionEntitiesCount.toString()
392
- }) }) }),
393
- /* @__PURE__ */ jsxs("div", { className: "flex flex-row gap-4", children: [
394
- /* @__PURE__ */ jsx("div", { className: "p-4 flex flex-col", children: /* @__PURE__ */ jsxs(RadioGroup, { value: exportType, onValueChange: (v) => setExportType(v), children: [
395
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
396
- /* @__PURE__ */ jsx(RadioGroupItem, { value: "csv", id: "radio-csv" }),
397
- /* @__PURE__ */ jsx(Label, { htmlFor: "radio-csv", children: t("csv") })
398
- ] }),
399
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
400
- /* @__PURE__ */ jsx(RadioGroupItem, { value: "json", id: "radio-json" }),
401
- /* @__PURE__ */ jsx(Label, { htmlFor: "radio-json", children: t("json") })
402
- ] })
403
- ] }) }),
404
- /* @__PURE__ */ jsx("div", { className: "p-4 flex flex-col", children: /* @__PURE__ */ jsxs(RadioGroup, { value: dateExportType, onValueChange: (v_0) => setDateExportType(v_0), children: [
405
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
406
- /* @__PURE__ */ jsx(RadioGroupItem, { value: "timestamp", id: "radio-timestamp" }),
407
- /* @__PURE__ */ jsxs(Label, { htmlFor: "radio-timestamp", children: [
408
- t("dates_as_timestamps"),
409
- " (",
410
- dateRef.current.getTime(),
411
- ")"
412
- ] })
413
- ] }),
414
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
415
- /* @__PURE__ */ jsx(RadioGroupItem, { value: "string", id: "radio-string" }),
416
- /* @__PURE__ */ jsxs(Label, { htmlFor: "radio-string", children: [
417
- t("dates_as_strings"),
418
- " (",
419
- dateRef.current.toISOString(),
420
- ")"
421
- ] })
422
- ] })
423
- ] }) })
424
- ] }),
425
- /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { size: "small", disabled: exportType !== "csv", value: flattenArrays, onValueChange: setFlattenArrays, label: t("flatten_arrays") }),
426
- /* @__PURE__ */ jsx(BooleanSwitchWithLabel, { size: "small", value: includeUndefinedValues, onValueChange: setIncludeUndefinedValues, label: t("include_undefined_values") }),
427
- !canExport && notAllowedView
428
- ] }),
429
- /* @__PURE__ */ jsxs(DialogActions, { children: [
430
- dataLoading && /* @__PURE__ */ jsx(CircularProgress, { size: "smallest" }),
431
- /* @__PURE__ */ jsx(Button, { onClick: handleClose, variant: "text", children: t("cancel") }),
432
- /* @__PURE__ */ jsx(Button, { onClick: onOkClicked, disabled: dataLoading || !canExport, children: t("download") })
433
- ] })
434
- ] })
435
- ] });
436
- }
437
- export {
438
- BasicExportAction as B,
439
- ExportCollectionAction as E,
440
- downloadDataAsCsv as a,
441
- downloadEntitiesExport as b,
442
- getEntityJsonExportableData as c,
443
- downloadBlob as d,
444
- getEntityCSVExportableData as g
445
- };
446
- //# sourceMappingURL=ExportCollectionAction-D3TTYXrq.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExportCollectionAction-D3TTYXrq.js","sources":["../src/data_export/export/export.ts","../src/data_export/export/BasicExportAction.tsx","../src/data_export/export/ExportCollectionAction.tsx"],"sourcesContent":["import { Entity, EntityReference, Properties, Property } from \"@rebasepro/types\";\nimport { type ArrayValuesCount, getArrayValuesCount, getValueInPath } from \"@rebasepro/utils\";\n\ninterface Header {\n key: string;\n label: string;\n}\n\nexport interface DownloadEntitiesExportParams<M extends Record<string, unknown>> {\n data: Entity<M>[];\n additionalData: Record<string, unknown>[] | undefined;\n properties: Properties;\n propertiesOrder: string[] | undefined;\n name: string;\n flattenArrays: boolean;\n additionalHeaders: string[] | undefined;\n exportType: \"csv\" | \"json\";\n dateExportType: \"timestamp\" | \"string\";\n}\n\nexport function downloadEntitiesExport<M extends Record<string, unknown>>({\n data,\n additionalData,\n properties,\n propertiesOrder,\n name,\n flattenArrays,\n additionalHeaders,\n exportType,\n dateExportType\n}: DownloadEntitiesExportParams<M>\n) {\n\n console.debug(\"Downloading export\", {\n dataLength: data.length,\n properties,\n exportType,\n dateExportType\n });\n\n if (exportType === \"csv\") {\n const arrayValuesCount = flattenArrays ? getArrayValuesCount(data.map(d => d.values)) : {};\n const headers = getExportHeaders(properties, propertiesOrder, additionalHeaders, arrayValuesCount);\n const exportableData = getEntityCSVExportableData(data, additionalData, properties, headers, dateExportType);\n const headersData = entryToCSVRow(headers.map(h => h.label));\n const csvData = exportableData.map(entry => entryToCSVRow(entry));\n downloadBlob([headersData, ...csvData], `${name}.csv`, \"text/csv\");\n } else {\n const exportableData = getEntityJsonExportableData(data, additionalData, properties, dateExportType);\n const json = JSON.stringify(exportableData, null, 2);\n downloadBlob([json], `${name}.json`, \"application/json\");\n }\n}\n\nexport function getEntityCSVExportableData(data: Entity<Record<string, unknown>>[],\n additionalData: Record<string, unknown>[] | undefined,\n properties: Properties,\n headers: Header[],\n dateExportType: \"timestamp\" | \"string\"\n) {\n\n const mergedData: Record<string, unknown>[] = data.map(e => ({\n id: e.id,\n ...processValuesForExport(e.values, properties, \"csv\", dateExportType)\n }));\n\n if (additionalData) {\n additionalData.forEach((additional, index) => {\n mergedData[index] = { ...mergedData[index],\n...additional };\n });\n }\n\n return mergedData && mergedData.map((entry) => {\n return headers.map((header) => getValueInPath(entry, header.key));\n });\n}\n\nexport function getEntityJsonExportableData(data: Entity<Record<string, unknown>>[],\n additionalData: Record<string, unknown>[] | undefined,\n properties: Properties,\n dateExportType: \"timestamp\" | \"string\"\n) {\n\n const mergedData: Record<string, unknown>[] = data.map(e => ({\n id: e.id,\n ...processValuesForExport(e.values, properties, \"json\", dateExportType)\n }));\n\n if (additionalData) {\n additionalData.forEach((additional, index) => {\n mergedData[index] = { ...mergedData[index],\n...additional };\n });\n }\n\n return mergedData;\n}\n\nfunction getExportHeaders<M extends Record<string, unknown>>(properties: Properties,\n propertiesOrder: string[] | undefined,\n additionalHeaders: string[] | undefined,\n arrayValuesCount?: ArrayValuesCount): Header[] {\n\n const headers: Header[] = [\n {\n label: \"id\",\n key: \"id\"\n },\n ...(propertiesOrder ?? Object.keys(properties))\n .flatMap((childKey) => {\n const property = properties[childKey];\n if (!property) {\n console.warn(\"Property not found\", childKey, properties);\n return [];\n }\n if (arrayValuesCount && arrayValuesCount[childKey] > 1) {\n return Array.from({ length: arrayValuesCount[childKey] },\n (_, i) => getHeaders(property as Property, `${childKey}[${i}]`, \"\"))\n .flat();\n } else {\n return getHeaders(property as Property, childKey, \"\");\n }\n })\n ];\n\n if (additionalHeaders) {\n headers.push(...additionalHeaders.map(h => ({\n label: h,\n key: h\n })));\n }\n\n return headers;\n}\n\n/**\n * Get headers for property. There could be more than one header per property\n * @param property\n * @param propertyKey\n * @param prefix\n */\nfunction getHeaders(property: Property, propertyKey: string, prefix = \"\"): Header[] {\n const currentKey = prefix ? `${prefix}.${propertyKey}` : propertyKey;\n if (property.type === \"map\" && property.properties) {\n return Object.entries(property.properties)\n .map(([childKey, p]) => getHeaders(p, childKey, currentKey))\n .flat();\n } else {\n return [{\n label: currentKey,\n key: currentKey\n }];\n }\n}\n\nfunction processValueForExport(inputValue: unknown,\n property: Property,\n exportType: \"csv\" | \"json\",\n dateExportType: \"timestamp\" | \"string\"\n): unknown {\n\n let value: unknown;\n if (property.type === \"map\" && property.properties) {\n value = processValuesForExport(inputValue as Record<string, unknown>, property.properties as Properties, exportType, dateExportType);\n } else if (property.type === \"array\") {\n if (property.of && Array.isArray(inputValue)) {\n if (Array.isArray(property.of)) {\n value = property.of.map((p, i) => processValueForExport(inputValue[i], p, exportType, dateExportType));\n } else if (property.of.type === \"map\") {\n value = exportType === \"csv\"\n ? inputValue.map((e) => JSON.stringify(e))\n : inputValue.map((e) => processValueForExport(e, property.of as Property, exportType, dateExportType));\n ;\n } else {\n value = inputValue.map((e) => processValueForExport(e, property.of as Property, exportType, dateExportType));\n }\n } else {\n value = inputValue;\n }\n } else if (property.type === \"reference\" && inputValue && typeof inputValue === \"object\" && \"isEntityReference\" in inputValue && typeof (inputValue as EntityReference).isEntityReference === \"function\" && (inputValue as EntityReference).isEntityReference()) {\n const ref = inputValue ? inputValue as EntityReference : undefined;\n value = ref ? ref.fullPath : null;\n } else if (property.type === \"date\" && inputValue instanceof Date) {\n value = inputValue ? (dateExportType === \"timestamp\" ? inputValue.getTime() : inputValue.toISOString()) : null;\n } else {\n value = inputValue;\n }\n\n return value;\n}\n\nfunction processValuesForExport<M extends Record<string, unknown>>\n (inputValues: Record<string, unknown>,\n properties: Properties,\n exportType: \"csv\" | \"json\",\n dateExportType: \"timestamp\" | \"string\"\n ): Record<string, unknown> {\n const updatedValues = Object.entries(properties)\n .map(([key, property]) => {\n const inputValue = inputValues && (inputValues)[key];\n const updatedValue = processValueForExport(inputValue, property as Property, exportType, dateExportType);\n if (updatedValue === undefined) return {};\n return ({ [key]: updatedValue });\n })\n .reduce((a, b) => ({ ...a,\n...b }), {}) as Record<string, unknown>;\n return { ...inputValues,\n...updatedValues };\n}\n\nfunction entryToCSVRow(entry: unknown[]) {\n return entry\n .map((v: unknown) => {\n if (v === null || v === undefined) return \"\";\n if (Array.isArray(v))\n return \"\\\"\" + JSON.stringify(v).replaceAll(\"\\\"\", \"\\\"\\\"\") + \"\\\"\";\n const s = String(v);\n return \"\\\"\" + s.replaceAll(\"\\\"\", \"\\\"\\\"\") + \"\\\"\";\n })\n .join(\",\") + \"\\r\\n\";\n}\n\nexport function downloadBlob(content: BlobPart[], filename: string, contentType: string) {\n const blob = new Blob(content, { type: contentType });\n const url = URL.createObjectURL(blob);\n const pom = document.createElement(\"a\");\n pom.href = url;\n pom.setAttribute(\"download\", filename);\n pom.click();\n}\n\nexport function downloadDataAsCsv(data: object[], name: string) {\n if (data.length === 0) return;\n\n const headers = Object.keys(data[0]);\n const csvContent = [\n headers.join(\",\"),\n ...data.map(row => headers.map(header => {\n const value = (row as Record<string, unknown>)[header];\n if (value === null || value === undefined) return \"\";\n if (Array.isArray(value)) return `\"${JSON.stringify(value).replace(/\"/g, '\"\"')}\"`;\n return `\"${String(value).replace(/\"/g, '\"\"')}\"`;\n }).join(\",\"))\n ].join(\"\\r\\n\");\n\n downloadBlob([csvContent], `${name}.csv`, \"text/csv\");\n}\n","\nimport React, { useCallback } from \"react\";\n\nimport { useTranslation } from \"@rebasepro/core\";\nimport { Entity, Properties } from \"@rebasepro/types\";\nimport {\n BooleanSwitchWithLabel,\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n DownloadIcon,\n IconButton,\n Label,\n RadioGroup,\n RadioGroupItem,\n Tooltip,\n Typography\n} from \"@rebasepro/ui\";\nimport { downloadEntitiesExport } from \"./export\";\n\nexport type BasicExportActionProps = {\n data: Entity<any>[];\n properties: Properties;\n propertiesOrder?: string[];\n}\n\nexport function BasicExportAction({\n data,\n properties,\n propertiesOrder\n}: BasicExportActionProps) {\n\n const { t } = useTranslation();\n const dateRef = React.useRef<Date>(new Date());\n const [flattenArrays, setFlattenArrays] = React.useState<boolean>(true);\n const [exportType, setExportType] = React.useState<\"csv\" | \"json\">(\"csv\");\n const [dateExportType, setDateExportType] = React.useState<\"timestamp\" | \"string\">(\"string\");\n\n const [open, setOpen] = React.useState(false);\n\n const handleClickOpen = useCallback(() => {\n setOpen(true);\n }, [setOpen]);\n\n const handleClose = useCallback(() => {\n setOpen(false);\n }, [setOpen]);\n\n const onOkClicked = useCallback(() => {\n downloadEntitiesExport({\n data,\n additionalData: [],\n properties,\n propertiesOrder,\n name: \"export.csv\",\n flattenArrays,\n additionalHeaders: [],\n exportType,\n dateExportType\n });\n handleClose();\n }, []);\n\n return <>\n\n <Tooltip title={\"Export\"}\n asChild={true}>\n <IconButton\n size={\"small\"}\n color={\"primary\"} onClick={handleClickOpen}>\n <DownloadIcon\n size={\"small\"}/>\n </IconButton>\n </Tooltip>\n\n <Dialog\n open={open}\n onOpenChange={setOpen}\n maxWidth={\"xl\"}>\n\n <DialogTitle variant={\"h6\"}>{t(\"export_data\")}</DialogTitle>\n\n <DialogContent className={\"flex flex-col gap-4 my-4\"}>\n\n <div>{t(\"download_table_csv\")}</div>\n\n <div className={\"flex flex-row gap-4\"}>\n <div className={\"p-4 flex flex-col\"}>\n <RadioGroup value={exportType} onValueChange={(v) => setExportType(v as \"csv\" | \"json\")}>\n <div className=\"flex items-center gap-2\">\n <RadioGroupItem value=\"csv\" id=\"radio-csv\"/>\n <Label htmlFor=\"radio-csv\">{t(\"csv\")}</Label>\n </div>\n <div className=\"flex items-center gap-2\">\n <RadioGroupItem value=\"json\" id=\"radio-json\"/>\n <Label htmlFor=\"radio-json\">{t(\"json\")}</Label>\n </div>\n </RadioGroup>\n </div>\n\n <div className={\"p-4 flex flex-col\"}>\n <RadioGroup value={dateExportType} onValueChange={(v) => setDateExportType(v as \"timestamp\" | \"string\")}>\n <div className=\"flex items-center gap-2\">\n <RadioGroupItem value=\"timestamp\" id=\"radio-timestamp\"/>\n <Label htmlFor=\"radio-timestamp\">{t(\"dates_as_timestamps\")} ({dateRef.current.getTime()})</Label>\n </div>\n <div className=\"flex items-center gap-2\">\n <RadioGroupItem value=\"string\" id=\"radio-string\"/>\n <Label htmlFor=\"radio-string\">{t(\"dates_as_strings\")} ({dateRef.current.toISOString()})</Label>\n </div>\n </RadioGroup>\n </div>\n </div>\n\n <BooleanSwitchWithLabel\n size={\"small\"}\n disabled={exportType !== \"csv\"}\n value={flattenArrays}\n onValueChange={setFlattenArrays}\n label={t(\"flatten_arrays\")}/>\n\n </DialogContent>\n\n <DialogActions>\n\n <Button onClick={handleClose}\n variant={\"text\"}>\n {t(\"cancel\")}\n </Button>\n\n <Button onClick={onOkClicked}>\n {t(\"download\")}\n </Button>\n\n </DialogActions>\n\n </Dialog>\n\n </>;\n}\n","\nimport React, { useCallback } from \"react\";\n\nimport {\n useAuthController,\n useCustomizationController,\n useData,\n useTranslation\n} from \"@rebasepro/core\";\nimport { useCMSContext } from \"../../hooks\";\nimport { CollectionActionsProps, Entity, EntityCollection, ExportConfig, RebaseContext, User } from \"@rebasepro/types\";\nimport { getDefaultValuesFor } from \"@rebasepro/common\";\nimport {\n Alert,\n BooleanSwitchWithLabel,\n Button,\n CircularProgress,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n DownloadIcon,\n IconButton,\n iconSize,\n Label,\n RadioGroup,\n RadioGroupItem,\n Tooltip\n} from \"@rebasepro/ui\";\nimport { downloadEntitiesExport } from \"./export\";\n\nconst DOCS_LIMIT = 500;\n\nexport function ExportCollectionAction<M extends Record<string, unknown>, USER extends User>({\n collection,\n path,\n collectionEntitiesCount,\n onAnalyticsEvent,\n exportAllowed,\n notAllowedView\n}: CollectionActionsProps<M, USER, EntityCollection<M>> & {\n exportAllowed?: (props: { collectionEntitiesCount: number, path: string, collection: EntityCollection }) => boolean;\n notAllowedView?: React.ReactNode;\n onAnalyticsEvent?: (event: string, params?: any) => void;\n}) {\n\n const { t } = useTranslation();\n\n const exportConfig = typeof collection.exportable === \"object\" ? collection.exportable : undefined;\n\n const dateRef = React.useRef<Date>(new Date());\n\n const [includeUndefinedValues, setIncludeUndefinedValues] = React.useState<boolean>(false);\n const [flattenArrays, setFlattenArrays] = React.useState<boolean>(true);\n const [exportType, setExportType] = React.useState<\"csv\" | \"json\">(\"csv\");\n const [dateExportType, setDateExportType] = React.useState<\"timestamp\" | \"string\">(\"string\");\n\n const context = useCMSContext<USER>();\n const dataClient = useData();\n\n const canExport = !exportAllowed || exportAllowed({\n collectionEntitiesCount: collectionEntitiesCount ?? 0,\n path,\n collection\n });\n\n const [dataLoading, setDataLoading] = React.useState<boolean>(false);\n const [dataLoadingError, setDataLoadingError] = React.useState<Error | undefined>();\n\n const [open, setOpen] = React.useState(false);\n\n const handleClickOpen = useCallback(() => {\n setOpen(true);\n }, [setOpen]);\n\n const handleClose = useCallback(() => {\n setOpen(false);\n }, [setOpen]);\n\n const fetchAdditionalFields = useCallback(async (entities: Entity<M>[]) => {\n\n const additionalExportFields = exportConfig?.additionalFields;\n const additionalFields = collection.additionalFields;\n\n const resolvedExportColumnsValues: Record<string, any>[] = additionalExportFields\n ? await Promise.all(entities.map(async (entity) => {\n return (await Promise.all(additionalExportFields.map(async (column) => {\n return {\n [column.key]: await column.builder({\n entity,\n context: context as RebaseContext\n })\n };\n }))).reduce((a, b) => ({ ...a,\n...b }), {});\n }))\n : [];\n\n const resolvedColumnsValues: Record<string, any>[] = additionalFields\n ? await Promise.all(entities.map(async (entity) => {\n return (await Promise.all(additionalFields\n .map(async (field) => {\n if (!field.value)\n return {};\n return {\n [field.key]: await field.value({\n entity,\n context: context as RebaseContext\n })\n };\n }))).reduce((a, b) => ({ ...a,\n...b }), {});\n }))\n : [];\n return [...resolvedExportColumnsValues, ...resolvedColumnsValues];\n }, [exportConfig?.additionalFields]);\n\n const doDownload = useCallback(async (collection: EntityCollection<M>,\n exportConfig: ExportConfig<any> | undefined) => {\n\n onAnalyticsEvent?.(\"export_collection\", {\n collection: collection.slug\n });\n setDataLoading(true);\n dataClient.collection(path).find({})\n .then(async (res) => {\n const data = res.data as Entity<M>[];\n setDataLoadingError(undefined);\n const additionalData = await fetchAdditionalFields(data);\n const additionalHeaders = [\n ...exportConfig?.additionalFields?.map(column => column.key) ?? [],\n ...collection.additionalFields?.map(field => field.key) ?? []\n ];\n\n const dataWithDefaults = includeUndefinedValues\n ? data.map(entity => {\n const defaultValues = getDefaultValuesFor(collection.properties);\n return {\n ...entity,\n values: { ...defaultValues,\n...entity.values }\n };\n })\n : data;\n downloadEntitiesExport({\n data: dataWithDefaults,\n additionalData,\n properties: collection.properties,\n propertiesOrder: collection.propertiesOrder,\n name: collection.name,\n flattenArrays,\n additionalHeaders,\n exportType,\n dateExportType\n });\n onAnalyticsEvent?.(\"export_collection_success\", {\n collection: collection.slug\n });\n })\n .catch((e) => {\n console.error(\"Error loading export data\", e);\n setDataLoadingError(e);\n })\n .finally(() => setDataLoading(false));\n\n }, [onAnalyticsEvent, dataClient, path, fetchAdditionalFields, includeUndefinedValues, flattenArrays, exportType, dateExportType]);\n\n const onOkClicked = useCallback(() => {\n doDownload(collection, exportConfig);\n handleClose();\n }, [doDownload, collection, exportConfig, handleClose]);\n\n return <>\n\n <Tooltip title={\"Export\"}\n asChild={true}>\n <IconButton\n size={\"small\"}\n color={\"primary\"}\n onClick={handleClickOpen}>\n <DownloadIcon size={iconSize.small}/>\n </IconButton>\n </Tooltip>\n\n <Dialog\n open={open}\n onOpenChange={setOpen}\n maxWidth={\"xl\"}>\n\n <DialogTitle variant={\"h6\"}>{t(\"export_data\")}</DialogTitle>\n\n <DialogContent className={\"flex flex-col gap-4 my-4\"}>\n\n <div>{t(\"download_table_csv\")}</div>\n\n {collectionEntitiesCount !== undefined && collectionEntitiesCount > DOCS_LIMIT &&\n <Alert color={\"warning\"}>\n <div>\n {t(\"large_number_of_documents\", { count: collectionEntitiesCount.toString() })}\n </div>\n </Alert>}\n\n <div className={\"flex flex-row gap-4\"}>\n <div className={\"p-4 flex flex-col\"}>\n <RadioGroup value={exportType} onValueChange={(v) => setExportType(v as \"csv\" | \"json\")}>\n <div className=\"flex items-center gap-2\">\n <RadioGroupItem value=\"csv\" id=\"radio-csv\"/>\n <Label htmlFor=\"radio-csv\">{t(\"csv\")}</Label>\n </div>\n <div className=\"flex items-center gap-2\">\n <RadioGroupItem value=\"json\" id=\"radio-json\"/>\n <Label htmlFor=\"radio-json\">{t(\"json\")}</Label>\n </div>\n </RadioGroup>\n </div>\n\n <div className={\"p-4 flex flex-col\"}>\n <RadioGroup value={dateExportType} onValueChange={(v) => setDateExportType(v as \"timestamp\" | \"string\")}>\n <div className=\"flex items-center gap-2\">\n <RadioGroupItem value=\"timestamp\" id=\"radio-timestamp\"/>\n <Label htmlFor=\"radio-timestamp\">{t(\"dates_as_timestamps\")} ({dateRef.current.getTime()})</Label>\n </div>\n <div className=\"flex items-center gap-2\">\n <RadioGroupItem value=\"string\" id=\"radio-string\"/>\n <Label htmlFor=\"radio-string\">{t(\"dates_as_strings\")} ({dateRef.current.toISOString()})</Label>\n </div>\n </RadioGroup>\n </div>\n </div>\n\n <BooleanSwitchWithLabel\n size={\"small\"}\n disabled={exportType !== \"csv\"}\n value={flattenArrays}\n onValueChange={setFlattenArrays}\n label={t(\"flatten_arrays\")}/>\n\n <BooleanSwitchWithLabel\n size={\"small\"}\n value={includeUndefinedValues}\n onValueChange={setIncludeUndefinedValues}\n label={t(\"include_undefined_values\")}/>\n\n {!canExport && notAllowedView}\n\n </DialogContent>\n\n <DialogActions>\n\n {dataLoading && <CircularProgress size={\"smallest\"}/>}\n\n <Button onClick={handleClose}\n variant={\"text\"}>\n {t(\"cancel\")}\n </Button>\n\n <Button onClick={onOkClicked}\n disabled={dataLoading || !canExport}>\n {t(\"download\")}\n </Button>\n\n </DialogActions>\n\n </Dialog>\n\n </>;\n}\n"],"names":["downloadEntitiesExport","data","additionalData","properties","propertiesOrder","name","flattenArrays","additionalHeaders","exportType","dateExportType","console","debug","dataLength","length","arrayValuesCount","getArrayValuesCount","map","d","values","headers","getExportHeaders","exportableData","getEntityCSVExportableData","headersData","entryToCSVRow","h","label","csvData","entry","downloadBlob","getEntityJsonExportableData","json","JSON","stringify","mergedData","e","id","processValuesForExport","forEach","additional","index","header","getValueInPath","key","Object","keys","flatMap","childKey","property","warn","Array","from","_","i","getHeaders","flat","push","propertyKey","prefix","currentKey","type","entries","p","processValueForExport","inputValue","value","of","isArray","isEntityReference","ref","undefined","fullPath","Date","getTime","toISOString","inputValues","updatedValues","updatedValue","reduce","a","b","v","replaceAll","s","String","join","content","filename","contentType","blob","Blob","url","URL","createObjectURL","pom","document","createElement","href","setAttribute","click","downloadDataAsCsv","csvContent","row","replace","BasicExportAction","t","useTranslation","dateRef","React","useRef","setFlattenArrays","useState","setExportType","setDateExportType","open","setOpen","handleClickOpen","useCallback","handleClose","onOkClicked","current","DOCS_LIMIT","ExportCollectionAction","collection","path","collectionEntitiesCount","onAnalyticsEvent","exportAllowed","notAllowedView","exportConfig","exportable","includeUndefinedValues","setIncludeUndefinedValues","context","useCMSContext","dataClient","useData","canExport","dataLoading","setDataLoading","dataLoadingError","setDataLoadingError","fetchAdditionalFields","entities","additionalExportFields","additionalFields","resolvedExportColumnsValues","Promise","all","entity","column","builder","resolvedColumnsValues","field","doDownload","slug","find","then","res","dataWithDefaults","defaultValues","getDefaultValuesFor","catch","error","finally","iconSize","small","count","toString"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoBO,SAASA,uBAA0D;AAAA,EACtEC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAC6B,GAC/B;AAEEC,UAAQC,MAAM,sBAAsB;AAAA,IAChCC,YAAYX,KAAKY;AAAAA,IACjBV;AAAAA,IACAK;AAAAA,IACAC;AAAAA,EAAAA,CACH;AAED,MAAID,eAAe,OAAO;AACtB,UAAMM,mBAAmBR,gBAAgBS,oBAAoBd,KAAKe,IAAIC,OAAKA,EAAEC,MAAM,CAAC,IAAI,CAAA;AACxF,UAAMC,UAAUC,iBAAiBjB,YAAYC,iBAAiBG,mBAAmBO,gBAAgB;AACjG,UAAMO,iBAAiBC,2BAA2BrB,MAAMC,gBAAgBC,YAAYgB,SAASV,cAAc;AAC3G,UAAMc,cAAcC,cAAcL,QAAQH,IAAIS,CAAAA,MAAKA,EAAEC,KAAK,CAAC;A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