@rebasepro/studio 0.0.1-canary.000dc36

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 (363) hide show
  1. package/LICENSE +114 -0
  2. package/README.md +159 -0
  3. package/dist/ApiExplorer-DHVmWYfK.js +1053 -0
  4. package/dist/ApiExplorer-DHVmWYfK.js.map +1 -0
  5. package/dist/AuthSimulationSelector-CM488Eei.js +106 -0
  6. package/dist/AuthSimulationSelector-CM488Eei.js.map +1 -0
  7. package/dist/BranchesView-DcHZtvXo.js +292 -0
  8. package/dist/BranchesView-DcHZtvXo.js.map +1 -0
  9. package/dist/CronJobsView-CijCToeK.js +456 -0
  10. package/dist/CronJobsView-CijCToeK.js.map +1 -0
  11. package/dist/JSEditor-CSHA0t_O.js +1308 -0
  12. package/dist/JSEditor-CSHA0t_O.js.map +1 -0
  13. package/dist/MonacoEditor-CMYEjiRf.js +161 -0
  14. package/dist/MonacoEditor-CMYEjiRf.js.map +1 -0
  15. package/dist/RLSEditor-BzDjqo6w.js +1872 -0
  16. package/dist/RLSEditor-BzDjqo6w.js.map +1 -0
  17. package/dist/SQLEditor-Cr9Kg_Qg.js +1780 -0
  18. package/dist/SQLEditor-Cr9Kg_Qg.js.map +1 -0
  19. package/dist/SchemaVisualizer-BGpmzyXT.js +1069 -0
  20. package/dist/SchemaVisualizer-BGpmzyXT.js.map +1 -0
  21. package/dist/StorageView-DG9tJZG1.js +811 -0
  22. package/dist/StorageView-DG9tJZG1.js.map +1 -0
  23. package/dist/common/src/collections/CollectionRegistry.d.ts +56 -0
  24. package/dist/common/src/collections/index.d.ts +1 -0
  25. package/dist/common/src/data/buildRebaseData.d.ts +14 -0
  26. package/dist/common/src/index.d.ts +3 -0
  27. package/dist/common/src/util/builders.d.ts +57 -0
  28. package/dist/common/src/util/callbacks.d.ts +6 -0
  29. package/dist/common/src/util/collections.d.ts +11 -0
  30. package/dist/common/src/util/common.d.ts +2 -0
  31. package/dist/common/src/util/conditions.d.ts +26 -0
  32. package/dist/common/src/util/entities.d.ts +58 -0
  33. package/dist/common/src/util/enums.d.ts +3 -0
  34. package/dist/common/src/util/index.d.ts +16 -0
  35. package/dist/common/src/util/navigation_from_path.d.ts +34 -0
  36. package/dist/common/src/util/navigation_utils.d.ts +20 -0
  37. package/dist/common/src/util/parent_references_from_path.d.ts +6 -0
  38. package/dist/common/src/util/paths.d.ts +14 -0
  39. package/dist/common/src/util/permissions.d.ts +5 -0
  40. package/dist/common/src/util/references.d.ts +2 -0
  41. package/dist/common/src/util/relations.d.ts +22 -0
  42. package/dist/common/src/util/resolutions.d.ts +72 -0
  43. package/dist/common/src/util/storage.d.ts +24 -0
  44. package/dist/core/src/components/AIIcon.d.ts +16 -0
  45. package/dist/core/src/components/ConfirmationDialog.d.ts +9 -0
  46. package/dist/core/src/components/Debug/UIReferenceView.d.ts +1 -0
  47. package/dist/core/src/components/Debug/UIStyleGuide.d.ts +1 -0
  48. package/dist/core/src/components/ErrorTooltip.d.ts +2 -0
  49. package/dist/core/src/components/ErrorView.d.ts +21 -0
  50. package/dist/core/src/components/LanguageToggle.d.ts +1 -0
  51. package/dist/core/src/components/LoginView/LoginView.d.ts +68 -0
  52. package/dist/core/src/components/LoginView/index.d.ts +2 -0
  53. package/dist/core/src/components/NotFoundPage.d.ts +1 -0
  54. package/dist/core/src/components/RebaseAuth.d.ts +10 -0
  55. package/dist/core/src/components/RebaseLogo.d.ts +7 -0
  56. package/dist/core/src/components/UnsavedChangesDialog.d.ts +9 -0
  57. package/dist/core/src/components/UserDisplay.d.ts +7 -0
  58. package/dist/core/src/components/UserSelectPopover.d.ts +62 -0
  59. package/dist/core/src/components/UserSettingsView.d.ts +1 -0
  60. package/dist/core/src/components/common/index.d.ts +6 -0
  61. package/dist/core/src/components/common/table_height.d.ts +5 -0
  62. package/dist/core/src/components/common/types.d.ts +63 -0
  63. package/dist/core/src/components/common/useColumnsIds.d.ts +9 -0
  64. package/dist/core/src/components/common/useDataTableController.d.ts +45 -0
  65. package/dist/core/src/components/common/useDebouncedData.d.ts +9 -0
  66. package/dist/core/src/components/common/useScrollRestoration.d.ts +14 -0
  67. package/dist/core/src/components/index.d.ts +16 -0
  68. package/dist/core/src/contexts/AdminModeController.d.ts +4 -0
  69. package/dist/core/src/contexts/AnalyticsContext.d.ts +3 -0
  70. package/dist/core/src/contexts/AuthControllerContext.d.ts +3 -0
  71. package/dist/core/src/contexts/CustomizationControllerContext.d.ts +3 -0
  72. package/dist/core/src/contexts/DataDriverContext.d.ts +3 -0
  73. package/dist/core/src/contexts/DatabaseAdminContext.d.ts +3 -0
  74. package/dist/core/src/contexts/DialogsProvider.d.ts +4 -0
  75. package/dist/core/src/contexts/EffectiveRoleController.d.ts +4 -0
  76. package/dist/core/src/contexts/InternalUserManagementContext.d.ts +3 -0
  77. package/dist/core/src/contexts/ModeController.d.ts +4 -0
  78. package/dist/core/src/contexts/RebaseClientInstanceContext.d.ts +6 -0
  79. package/dist/core/src/contexts/RebaseDataContext.d.ts +3 -0
  80. package/dist/core/src/contexts/SnackbarProvider.d.ts +2 -0
  81. package/dist/core/src/contexts/StorageSourceContext.d.ts +3 -0
  82. package/dist/core/src/contexts/UserConfigurationPersistenceContext.d.ts +3 -0
  83. package/dist/core/src/contexts/index.d.ts +13 -0
  84. package/dist/core/src/core/PluginLifecycleManager.d.ts +17 -0
  85. package/dist/core/src/core/PluginProviderStack.d.ts +21 -0
  86. package/dist/core/src/core/Rebase.d.ts +14 -0
  87. package/dist/core/src/core/RebaseProps.d.ts +136 -0
  88. package/dist/core/src/core/RebaseRouter.d.ts +4 -0
  89. package/dist/core/src/core/RebaseRoutes.d.ts +17 -0
  90. package/dist/core/src/core/index.d.ts +4 -0
  91. package/dist/core/src/hooks/ApiConfigContext.d.ts +24 -0
  92. package/dist/core/src/hooks/data/delete.d.ts +31 -0
  93. package/dist/core/src/hooks/data/save.d.ts +34 -0
  94. package/dist/core/src/hooks/data/useCollectionFetch.d.ts +51 -0
  95. package/dist/core/src/hooks/data/useData.d.ts +13 -0
  96. package/dist/core/src/hooks/data/useDataOrder.d.ts +12 -0
  97. package/dist/core/src/hooks/data/useEntityFetch.d.ts +38 -0
  98. package/dist/core/src/hooks/data/useRelationSelector.d.ts +52 -0
  99. package/dist/core/src/hooks/data/useUserSelector.d.ts +31 -0
  100. package/dist/core/src/hooks/index.d.ts +37 -0
  101. package/dist/core/src/hooks/useAdminModeController.d.ts +19 -0
  102. package/dist/core/src/hooks/useAnalyticsController.d.ts +5 -0
  103. package/dist/core/src/hooks/useAuthController.d.ts +11 -0
  104. package/dist/core/src/hooks/useAuthSubscription.d.ts +2 -0
  105. package/dist/core/src/hooks/useBackendStorageSource.d.ts +30 -0
  106. package/dist/core/src/hooks/useBridgeRegistration.d.ts +18 -0
  107. package/dist/core/src/hooks/useBrowserTitleAndIcon.d.ts +6 -0
  108. package/dist/core/src/hooks/useBuildAdminModeController.d.ts +6 -0
  109. package/dist/core/src/hooks/useBuildEffectiveRoleController.d.ts +8 -0
  110. package/dist/core/src/hooks/useBuildLocalConfigurationPersistence.d.ts +2 -0
  111. package/dist/core/src/hooks/useBuildModeController.d.ts +6 -0
  112. package/dist/core/src/hooks/useClipboard.d.ts +57 -0
  113. package/dist/core/src/hooks/useCollapsedGroups.d.ts +12 -0
  114. package/dist/core/src/hooks/useCustomizationController.d.ts +11 -0
  115. package/dist/core/src/hooks/useDialogsController.d.ts +11 -0
  116. package/dist/core/src/hooks/useEffectiveRoleController.d.ts +7 -0
  117. package/dist/core/src/hooks/useInternalUserManagementController.d.ts +12 -0
  118. package/dist/core/src/hooks/useLargeLayout.d.ts +1 -0
  119. package/dist/core/src/hooks/useModeController.d.ts +19 -0
  120. package/dist/core/src/hooks/usePermissions.d.ts +12 -0
  121. package/dist/core/src/hooks/useRebaseClient.d.ts +5 -0
  122. package/dist/core/src/hooks/useRebaseContext.d.ts +11 -0
  123. package/dist/core/src/hooks/useRebaseRegistry.d.ts +34 -0
  124. package/dist/core/src/hooks/useSlot.d.ts +18 -0
  125. package/dist/core/src/hooks/useSnackbarController.d.ts +20 -0
  126. package/dist/core/src/hooks/useStorageSource.d.ts +7 -0
  127. package/dist/core/src/hooks/useStudioBridge.d.ts +91 -0
  128. package/dist/core/src/hooks/useTranslation.d.ts +17 -0
  129. package/dist/core/src/hooks/useUnsavedChangesDialog.d.ts +12 -0
  130. package/dist/core/src/hooks/useUserConfigurationPersistence.d.ts +8 -0
  131. package/dist/core/src/hooks/useValidateAuthenticator.d.ts +21 -0
  132. package/dist/core/src/i18n/RebaseI18nProvider.d.ts +33 -0
  133. package/dist/core/src/index.d.ts +15 -0
  134. package/dist/core/src/internal/common.d.ts +3 -0
  135. package/dist/core/src/internal/useRestoreScroll.d.ts +6 -0
  136. package/dist/core/src/locales/de.d.ts +2 -0
  137. package/dist/core/src/locales/en.d.ts +10 -0
  138. package/dist/core/src/locales/es.d.ts +10 -0
  139. package/dist/core/src/locales/fr.d.ts +2 -0
  140. package/dist/core/src/locales/hi.d.ts +2 -0
  141. package/dist/core/src/locales/it.d.ts +2 -0
  142. package/dist/core/src/locales/pt.d.ts +7 -0
  143. package/dist/core/src/util/constants.d.ts +1 -0
  144. package/dist/core/src/util/createFormexStub.d.ts +2 -0
  145. package/dist/core/src/util/entity_cache.d.ts +27 -0
  146. package/dist/core/src/util/enums.d.ts +5 -0
  147. package/dist/core/src/util/icon_list.d.ts +5 -0
  148. package/dist/core/src/util/icon_synonyms.d.ts +1 -0
  149. package/dist/core/src/util/icons.d.ts +20 -0
  150. package/dist/core/src/util/index.d.ts +10 -0
  151. package/dist/core/src/util/previews.d.ts +4 -0
  152. package/dist/core/src/util/useStorageUploadController.d.ts +38 -0
  153. package/dist/core/src/util/useTraceUpdate.d.ts +2 -0
  154. package/dist/formex/src/Field.d.ts +52 -0
  155. package/dist/formex/src/Formex.d.ts +7 -0
  156. package/dist/formex/src/index.d.ts +5 -0
  157. package/dist/formex/src/types.d.ts +40 -0
  158. package/dist/formex/src/useCreateFormex.d.ts +14 -0
  159. package/dist/formex/src/utils.d.ts +16 -0
  160. package/dist/index.es.js +726 -0
  161. package/dist/index.es.js.map +1 -0
  162. package/dist/index.umd.js +9567 -0
  163. package/dist/index.umd.js.map +1 -0
  164. package/dist/studio/src/components/ApiExplorer/ApiExplorer.d.ts +9 -0
  165. package/dist/studio/src/components/ApiExplorer/EndpointDetail.d.ts +9 -0
  166. package/dist/studio/src/components/ApiExplorer/TryItPanel.d.ts +15 -0
  167. package/dist/studio/src/components/ApiExplorer/parseSpec.d.ts +16 -0
  168. package/dist/studio/src/components/ApiExplorer/types.d.ts +90 -0
  169. package/dist/studio/src/components/AuthSimulationSelector.d.ts +11 -0
  170. package/dist/studio/src/components/Branches/BranchesView.d.ts +1 -0
  171. package/dist/studio/src/components/CronJobs/CronJobsView.d.ts +1 -0
  172. package/dist/studio/src/components/JSEditor/JSEditor.d.ts +1 -0
  173. package/dist/studio/src/components/JSEditor/JSEditorSidebar.d.ts +21 -0
  174. package/dist/studio/src/components/JSEditor/JSMonacoEditor.d.ts +18 -0
  175. package/dist/studio/src/components/RLSEditor/PolicyEditor.d.ts +9 -0
  176. package/dist/studio/src/components/RLSEditor/RLSEditor.d.ts +19 -0
  177. package/dist/studio/src/components/RLSEditor/index.d.ts +1 -0
  178. package/dist/studio/src/components/RebaseStudio.d.ts +2 -0
  179. package/dist/studio/src/components/SQLEditor/ExplainVisualizer.d.ts +24 -0
  180. package/dist/studio/src/components/SQLEditor/MonacoEditor.d.ts +17 -0
  181. package/dist/studio/src/components/SQLEditor/SQLEditor.d.ts +11 -0
  182. package/dist/studio/src/components/SQLEditor/SQLEditorSidebar.d.ts +21 -0
  183. package/dist/studio/src/components/SQLEditor/SchemaBrowser.d.ts +8 -0
  184. package/dist/studio/src/components/SchemaVisualizer/RelationEdge.d.ts +3 -0
  185. package/dist/studio/src/components/SchemaVisualizer/SchemaVisualizer.d.ts +2 -0
  186. package/dist/studio/src/components/SchemaVisualizer/TableNode.d.ts +3 -0
  187. package/dist/studio/src/components/SchemaVisualizer/index.d.ts +5 -0
  188. package/dist/studio/src/components/SchemaVisualizer/schema-visualizer.utils.d.ts +42 -0
  189. package/dist/studio/src/components/SchemaVisualizer/useSchemaGraph.d.ts +37 -0
  190. package/dist/studio/src/components/StorageView/StorageView.d.ts +1 -0
  191. package/dist/studio/src/components/StudioHomePage.d.ts +9 -0
  192. package/dist/studio/src/index.d.ts +4 -0
  193. package/dist/studio/src/utils/entities.d.ts +0 -0
  194. package/dist/studio/src/utils/pgColumnToProperty.d.ts +6 -0
  195. package/dist/studio/src/utils/sql_utils.d.ts +52 -0
  196. package/dist/types/src/controllers/analytics_controller.d.ts +7 -0
  197. package/dist/types/src/controllers/auth.d.ts +119 -0
  198. package/dist/types/src/controllers/client.d.ts +170 -0
  199. package/dist/types/src/controllers/collection_registry.d.ts +46 -0
  200. package/dist/types/src/controllers/customization_controller.d.ts +60 -0
  201. package/dist/types/src/controllers/data.d.ts +168 -0
  202. package/dist/types/src/controllers/data_driver.d.ts +195 -0
  203. package/dist/types/src/controllers/database_admin.d.ts +11 -0
  204. package/dist/types/src/controllers/dialogs_controller.d.ts +36 -0
  205. package/dist/types/src/controllers/effective_role.d.ts +4 -0
  206. package/dist/types/src/controllers/email.d.ts +34 -0
  207. package/dist/types/src/controllers/index.d.ts +18 -0
  208. package/dist/types/src/controllers/local_config_persistence.d.ts +20 -0
  209. package/dist/types/src/controllers/navigation.d.ts +213 -0
  210. package/dist/types/src/controllers/registry.d.ts +54 -0
  211. package/dist/types/src/controllers/side_dialogs_controller.d.ts +67 -0
  212. package/dist/types/src/controllers/side_entity_controller.d.ts +90 -0
  213. package/dist/types/src/controllers/snackbar.d.ts +24 -0
  214. package/dist/types/src/controllers/storage.d.ts +171 -0
  215. package/dist/types/src/index.d.ts +4 -0
  216. package/dist/types/src/rebase_context.d.ts +105 -0
  217. package/dist/types/src/types/backend.d.ts +536 -0
  218. package/dist/types/src/types/backend_hooks.d.ts +187 -0
  219. package/dist/types/src/types/builders.d.ts +15 -0
  220. package/dist/types/src/types/chips.d.ts +5 -0
  221. package/dist/types/src/types/collections.d.ts +857 -0
  222. package/dist/types/src/types/cron.d.ts +102 -0
  223. package/dist/types/src/types/data_source.d.ts +64 -0
  224. package/dist/types/src/types/entities.d.ts +145 -0
  225. package/dist/types/src/types/entity_actions.d.ts +98 -0
  226. package/dist/types/src/types/entity_callbacks.d.ts +173 -0
  227. package/dist/types/src/types/entity_link_builder.d.ts +7 -0
  228. package/dist/types/src/types/entity_overrides.d.ts +10 -0
  229. package/dist/types/src/types/entity_views.d.ts +59 -0
  230. package/dist/types/src/types/export_import.d.ts +21 -0
  231. package/dist/types/src/types/formex.d.ts +40 -0
  232. package/dist/types/src/types/index.d.ts +25 -0
  233. package/dist/types/src/types/locales.d.ts +4 -0
  234. package/dist/types/src/types/modify_collections.d.ts +5 -0
  235. package/dist/types/src/types/plugins.d.ts +282 -0
  236. package/dist/types/src/types/properties.d.ts +1148 -0
  237. package/dist/types/src/types/property_config.d.ts +70 -0
  238. package/dist/types/src/types/relations.d.ts +336 -0
  239. package/dist/types/src/types/slots.d.ts +262 -0
  240. package/dist/types/src/types/translations.d.ts +874 -0
  241. package/dist/types/src/types/user_management_delegate.d.ts +121 -0
  242. package/dist/types/src/types/websockets.d.ts +78 -0
  243. package/dist/types/src/users/index.d.ts +2 -0
  244. package/dist/types/src/users/roles.d.ts +22 -0
  245. package/dist/types/src/users/user.d.ts +46 -0
  246. package/dist/ui/src/components/Alert.d.ts +12 -0
  247. package/dist/ui/src/components/Autocomplete.d.ts +21 -0
  248. package/dist/ui/src/components/Avatar.d.ts +11 -0
  249. package/dist/ui/src/components/Badge.d.ts +8 -0
  250. package/dist/ui/src/components/BooleanSwitch.d.ts +14 -0
  251. package/dist/ui/src/components/BooleanSwitchWithLabel.d.ts +17 -0
  252. package/dist/ui/src/components/Button.d.ts +14 -0
  253. package/dist/ui/src/components/Card.d.ts +9 -0
  254. package/dist/ui/src/components/CenteredView.d.ts +9 -0
  255. package/dist/ui/src/components/Checkbox.d.ts +13 -0
  256. package/dist/ui/src/components/Chip.d.ts +26 -0
  257. package/dist/ui/src/components/CircularProgress.d.ts +5 -0
  258. package/dist/ui/src/components/CircularProgressCenter.d.ts +11 -0
  259. package/dist/ui/src/components/Collapse.d.ts +9 -0
  260. package/dist/ui/src/components/ColorPicker.d.ts +30 -0
  261. package/dist/ui/src/components/Container.d.ts +8 -0
  262. package/dist/ui/src/components/DateTimeField.d.ts +24 -0
  263. package/dist/ui/src/components/DebouncedTextField.d.ts +2 -0
  264. package/dist/ui/src/components/Dialog.d.ts +39 -0
  265. package/dist/ui/src/components/DialogActions.d.ts +7 -0
  266. package/dist/ui/src/components/DialogContent.d.ts +7 -0
  267. package/dist/ui/src/components/DialogTitle.d.ts +10 -0
  268. package/dist/ui/src/components/ErrorBoundary.d.ts +11 -0
  269. package/dist/ui/src/components/ExpandablePanel.d.ts +12 -0
  270. package/dist/ui/src/components/FileUpload.d.ts +23 -0
  271. package/dist/ui/src/components/IconButton.d.ts +12 -0
  272. package/dist/ui/src/components/InfoLabel.d.ts +5 -0
  273. package/dist/ui/src/components/InputLabel.d.ts +11 -0
  274. package/dist/ui/src/components/Label.d.ts +7 -0
  275. package/dist/ui/src/components/LoadingButton.d.ts +7 -0
  276. package/dist/ui/src/components/Markdown.d.ts +10 -0
  277. package/dist/ui/src/components/Menu.d.ts +23 -0
  278. package/dist/ui/src/components/Menubar.d.ts +80 -0
  279. package/dist/ui/src/components/MultiSelect.d.ts +48 -0
  280. package/dist/ui/src/components/Paper.d.ts +6 -0
  281. package/dist/ui/src/components/Popover.d.ts +24 -0
  282. package/dist/ui/src/components/RadioGroup.d.ts +28 -0
  283. package/dist/ui/src/components/ResizablePanels.d.ts +18 -0
  284. package/dist/ui/src/components/SearchBar.d.ts +22 -0
  285. package/dist/ui/src/components/Select.d.ts +43 -0
  286. package/dist/ui/src/components/Separator.d.ts +5 -0
  287. package/dist/ui/src/components/Sheet.d.ts +22 -0
  288. package/dist/ui/src/components/Skeleton.d.ts +6 -0
  289. package/dist/ui/src/components/Slider.d.ts +21 -0
  290. package/dist/ui/src/components/Table.d.ts +34 -0
  291. package/dist/ui/src/components/Tabs.d.ts +19 -0
  292. package/dist/ui/src/components/TextField.d.ts +58 -0
  293. package/dist/ui/src/components/TextareaAutosize.d.ts +43 -0
  294. package/dist/ui/src/components/ToggleButtonGroup.d.ts +30 -0
  295. package/dist/ui/src/components/Tooltip.d.ts +19 -0
  296. package/dist/ui/src/components/Typography.d.ts +36 -0
  297. package/dist/ui/src/components/VirtualTable/VirtualTable.d.ts +11 -0
  298. package/dist/ui/src/components/VirtualTable/VirtualTableCell.d.ts +21 -0
  299. package/dist/ui/src/components/VirtualTable/VirtualTableHeader.d.ts +29 -0
  300. package/dist/ui/src/components/VirtualTable/VirtualTableHeaderRow.d.ts +2 -0
  301. package/dist/ui/src/components/VirtualTable/VirtualTableProps.d.ts +243 -0
  302. package/dist/ui/src/components/VirtualTable/VirtualTableRow.d.ts +3 -0
  303. package/dist/ui/src/components/VirtualTable/index.d.ts +3 -0
  304. package/dist/ui/src/components/VirtualTable/types.d.ts +38 -0
  305. package/dist/ui/src/components/common/SelectInputLabel.d.ts +5 -0
  306. package/dist/ui/src/components/index.d.ts +53 -0
  307. package/dist/ui/src/hooks/PortalContainerContext.d.ts +31 -0
  308. package/dist/ui/src/hooks/index.d.ts +6 -0
  309. package/dist/ui/src/hooks/useDebounceCallback.d.ts +1 -0
  310. package/dist/ui/src/hooks/useDebounceValue.d.ts +1 -0
  311. package/dist/ui/src/hooks/useDebouncedCallback.d.ts +1 -0
  312. package/dist/ui/src/hooks/useInjectStyles.d.ts +7 -0
  313. package/dist/ui/src/hooks/useOutsideAlerter.d.ts +5 -0
  314. package/dist/ui/src/icons/GitHubIcon.d.ts +2 -0
  315. package/dist/ui/src/icons/HandleIcon.d.ts +1 -0
  316. package/dist/ui/src/icons/Icon.d.ts +20 -0
  317. package/dist/ui/src/icons/cool_icon_keys.d.ts +1 -0
  318. package/dist/ui/src/icons/icon_keys.d.ts +1 -0
  319. package/dist/ui/src/icons/index.d.ts +6 -0
  320. package/dist/ui/src/index.d.ts +5 -0
  321. package/dist/ui/src/styles.d.ts +12 -0
  322. package/dist/ui/src/util/chip_colors.d.ts +4 -0
  323. package/dist/ui/src/util/cls.d.ts +2 -0
  324. package/dist/ui/src/util/debounce.d.ts +10 -0
  325. package/dist/ui/src/util/hash.d.ts +1 -0
  326. package/dist/ui/src/util/index.d.ts +4 -0
  327. package/dist/ui/src/util/key_to_icon_component.d.ts +1 -0
  328. package/package.json +84 -0
  329. package/src/components/ApiExplorer/ApiExplorer.tsx +292 -0
  330. package/src/components/ApiExplorer/EndpointDetail.tsx +271 -0
  331. package/src/components/ApiExplorer/TryItPanel.tsx +486 -0
  332. package/src/components/ApiExplorer/parseSpec.ts +104 -0
  333. package/src/components/ApiExplorer/types.ts +84 -0
  334. package/src/components/AuthSimulationSelector.tsx +73 -0
  335. package/src/components/Branches/BranchesView.tsx +370 -0
  336. package/src/components/CronJobs/CronJobsView.tsx +346 -0
  337. package/src/components/JSEditor/JSEditor.tsx +1033 -0
  338. package/src/components/JSEditor/JSEditorSidebar.tsx +340 -0
  339. package/src/components/JSEditor/JSMonacoEditor.tsx +390 -0
  340. package/src/components/RLSEditor/PolicyEditor.tsx +444 -0
  341. package/src/components/RLSEditor/RLSEditor.tsx +771 -0
  342. package/src/components/RLSEditor/index.ts +1 -0
  343. package/src/components/RebaseStudio.tsx +121 -0
  344. package/src/components/SQLEditor/ExplainVisualizer.tsx +128 -0
  345. package/src/components/SQLEditor/MonacoEditor.tsx +203 -0
  346. package/src/components/SQLEditor/SQLEditor.tsx +1417 -0
  347. package/src/components/SQLEditor/SQLEditorSidebar.tsx +174 -0
  348. package/src/components/SQLEditor/SchemaBrowser.tsx +156 -0
  349. package/src/components/SchemaVisualizer/RelationEdge.tsx +102 -0
  350. package/src/components/SchemaVisualizer/SchemaVisualizer.tsx +663 -0
  351. package/src/components/SchemaVisualizer/TableNode.tsx +257 -0
  352. package/src/components/SchemaVisualizer/index.ts +5 -0
  353. package/src/components/SchemaVisualizer/schema-visualizer.utils.ts +140 -0
  354. package/src/components/SchemaVisualizer/useSchemaGraph.ts +397 -0
  355. package/src/components/StorageView/StorageView.tsx +938 -0
  356. package/src/components/StudioHomePage.tsx +357 -0
  357. package/src/index.ts +31 -0
  358. package/src/utils/entities.ts +2 -0
  359. package/src/utils/pgColumnToProperty.test.ts +401 -0
  360. package/src/utils/pgColumnToProperty.ts +275 -0
  361. package/src/utils/sql_utils.test.ts +265 -0
  362. package/src/utils/sql_utils.ts +291 -0
  363. package/src/vite-env.d.ts +1 -0
@@ -0,0 +1,811 @@
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { c } from "react-compiler-runtime";
3
+ import React, { useState, useEffect, useCallback } from "react";
4
+ import { Tooltip, IconButton, iconSize, Typography, Button, cls, Chip, defaultBorderMixin, CircularProgress, DialogContent, Dialog, FileUpload, DialogActions } from "@rebasepro/ui";
5
+ import { ArrowLeftIcon, LayoutGridIcon, ListIcon, RefreshCwIcon, UploadCloudIcon, PlusIcon, FolderIcon, DownloadIcon, Trash2Icon, XIcon, FileTextIcon, ImageIcon, VideoIcon, Music2Icon } from "lucide-react";
6
+ import { useStorageSource, useSnackbarController, ErrorView } from "@rebasepro/core";
7
+ import { useSearchParams } from "react-router-dom";
8
+ function formatFileSize(bytes) {
9
+ if (bytes < 1024) return `${bytes} B`;
10
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
11
+ if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
12
+ return `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;
13
+ }
14
+ function getFileIcon(contentType) {
15
+ if (!contentType) return FileTextIcon;
16
+ if (contentType.startsWith("image/")) return ImageIcon;
17
+ if (contentType.startsWith("video/")) return VideoIcon;
18
+ if (contentType.startsWith("audio/")) return Music2Icon;
19
+ return FileTextIcon;
20
+ }
21
+ function getExtension(name) {
22
+ const parts = name.split(".");
23
+ return parts.length > 1 ? parts[parts.length - 1].toUpperCase() : "";
24
+ }
25
+ function breadcrumbSegments(path) {
26
+ if (!path || path === "/") return [{
27
+ label: "Root",
28
+ path: ""
29
+ }];
30
+ const parts = path.split("/").filter(Boolean);
31
+ const segments = [{
32
+ label: "Root",
33
+ path: ""
34
+ }];
35
+ let accumulated = "";
36
+ for (const part of parts) {
37
+ accumulated = accumulated ? `${accumulated}/${part}` : part;
38
+ segments.push({
39
+ label: part,
40
+ path: accumulated
41
+ });
42
+ }
43
+ return segments;
44
+ }
45
+ function UploadDialog({
46
+ open,
47
+ currentPath,
48
+ onClose,
49
+ onUpload
50
+ }) {
51
+ const [uploading, setUploading] = useState(false);
52
+ const [selectedFiles, setSelectedFiles] = useState([]);
53
+ const [error, setError] = useState(null);
54
+ const handleFilesAdded = useCallback((files) => {
55
+ setSelectedFiles((prev) => [...prev, ...files]);
56
+ }, []);
57
+ const handleRemoveFile = useCallback((index) => {
58
+ setSelectedFiles((prev_0) => prev_0.filter((_, i) => i !== index));
59
+ }, []);
60
+ const handleUpload = useCallback(async () => {
61
+ if (selectedFiles.length === 0) return;
62
+ setUploading(true);
63
+ setError(null);
64
+ try {
65
+ await onUpload(selectedFiles);
66
+ setSelectedFiles([]);
67
+ onClose();
68
+ } catch (err) {
69
+ setError(err instanceof Error ? err.message : "Upload failed");
70
+ } finally {
71
+ setUploading(false);
72
+ }
73
+ }, [selectedFiles, onUpload, onClose]);
74
+ const handleClose = useCallback(() => {
75
+ if (!uploading) {
76
+ setSelectedFiles([]);
77
+ setError(null);
78
+ onClose();
79
+ }
80
+ }, [uploading, onClose]);
81
+ return /* @__PURE__ */ jsxs(Dialog, { open, onOpenChange: (o) => !o && handleClose(), maxWidth: "md", children: [
82
+ /* @__PURE__ */ jsxs(DialogContent, { className: "p-0", children: [
83
+ /* @__PURE__ */ jsxs("div", { className: "p-4 border-b border-surface-accent-200 dark:border-surface-accent-700", children: [
84
+ /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Upload Files" }),
85
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-text-secondary dark:text-text-secondary-dark mt-1 block", children: [
86
+ "to ",
87
+ /* @__PURE__ */ jsxs("span", { className: "font-mono text-primary", children: [
88
+ "/",
89
+ currentPath || "root"
90
+ ] })
91
+ ] })
92
+ ] }),
93
+ /* @__PURE__ */ jsxs("div", { className: "p-4", children: [
94
+ /* @__PURE__ */ jsx(FileUpload, { accept: {}, onFilesAdded: handleFilesAdded, size: "large", uploadDescription: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center pointer-events-none mt-2", children: [
95
+ /* @__PURE__ */ jsx(UploadCloudIcon, { className: "text-surface-accent-400 mb-2 w-8 h-8" }),
96
+ /* @__PURE__ */ jsx(Typography, { variant: "h6", className: "font-bold", children: "Drop files here or click to browse" }),
97
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-surface-accent-500 font-medium", children: "Any file type supported" })
98
+ ] }) }),
99
+ error && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-red-500 mt-2 block whitespace-pre-line", children: error }),
100
+ selectedFiles.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-4 space-y-2", children: [
101
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-surface-accent-500", children: [
102
+ "Selected files (",
103
+ selectedFiles.length,
104
+ ")"
105
+ ] }),
106
+ /* @__PURE__ */ jsx("div", { className: "max-h-40 overflow-auto space-y-1", children: selectedFiles.map((file, index_0) => /* @__PURE__ */ jsxs("div", { className: cls("flex items-center justify-between p-2 rounded", "bg-surface-accent-50 dark:bg-surface-accent-800"), children: [
107
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0 mr-2", children: [
108
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "truncate", children: file.name }),
109
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-surface-accent-500", children: formatFileSize(file.size) })
110
+ ] }),
111
+ /* @__PURE__ */ jsx(Button, { variant: "text", size: "small", onClick: (e) => {
112
+ e.stopPropagation();
113
+ handleRemoveFile(index_0);
114
+ }, disabled: uploading, children: "Remove" })
115
+ ] }, `${file.name}-${index_0}`)) })
116
+ ] })
117
+ ] })
118
+ ] }),
119
+ /* @__PURE__ */ jsxs(DialogActions, { children: [
120
+ /* @__PURE__ */ jsx(Button, { variant: "text", onClick: handleClose, disabled: uploading, children: "Cancel" }),
121
+ /* @__PURE__ */ jsx(Button, { variant: "filled", onClick: handleUpload, disabled: selectedFiles.length === 0 || uploading, children: uploading ? /* @__PURE__ */ jsxs(Fragment, { children: [
122
+ /* @__PURE__ */ jsx(CircularProgress, { size: "smallest" }),
123
+ "Uploading..."
124
+ ] }) : `Upload ${selectedFiles.length > 0 ? `(${selectedFiles.length})` : ""}` })
125
+ ] })
126
+ ] });
127
+ }
128
+ function FilePreviewPanel(t0) {
129
+ const $ = c(79);
130
+ const {
131
+ file,
132
+ onClose,
133
+ onDelete,
134
+ downloadUrl
135
+ } = t0;
136
+ file.contentType?.startsWith("image/");
137
+ file.contentType?.startsWith("video/");
138
+ file.contentType?.startsWith("audio/");
139
+ let t1;
140
+ if ($[0] !== file.contentType) {
141
+ t1 = getFileIcon(file.contentType);
142
+ $[0] = file.contentType;
143
+ $[1] = t1;
144
+ } else {
145
+ t1 = $[1];
146
+ }
147
+ const FileIconComponent = t1;
148
+ const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
149
+ let t2;
150
+ let t3;
151
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
152
+ t2 = cls("flex flex-col h-full border-l", defaultBorderMixin, "bg-white dark:bg-surface-950");
153
+ t3 = cls("flex items-center justify-between p-3 border-b shrink-0", defaultBorderMixin);
154
+ $[2] = t2;
155
+ $[3] = t3;
156
+ } else {
157
+ t2 = $[2];
158
+ t3 = $[3];
159
+ }
160
+ let t4;
161
+ if ($[4] !== file.name) {
162
+ t4 = /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "font-medium truncate flex-1 mr-2", children: file.name });
163
+ $[4] = file.name;
164
+ $[5] = t4;
165
+ } else {
166
+ t4 = $[5];
167
+ }
168
+ let t5;
169
+ if ($[6] !== downloadUrl) {
170
+ t5 = downloadUrl && /* @__PURE__ */ jsx(Tooltip, { title: "Download", children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => window.open(downloadUrl, "_blank"), children: /* @__PURE__ */ jsx(DownloadIcon, { size: iconSize.smallest }) }) });
171
+ $[6] = downloadUrl;
172
+ $[7] = t5;
173
+ } else {
174
+ t5 = $[7];
175
+ }
176
+ let t6;
177
+ if ($[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
178
+ t6 = () => setDeleteDialogOpen(true);
179
+ $[8] = t6;
180
+ } else {
181
+ t6 = $[8];
182
+ }
183
+ let t7;
184
+ if ($[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
185
+ t7 = /* @__PURE__ */ jsx(Tooltip, { title: "Delete", children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: t6, className: "text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20", children: /* @__PURE__ */ jsx(Trash2Icon, { size: iconSize.smallest }) }) });
186
+ $[9] = t7;
187
+ } else {
188
+ t7 = $[9];
189
+ }
190
+ let t8;
191
+ if ($[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
192
+ t8 = /* @__PURE__ */ jsx(XIcon, { size: iconSize.smallest });
193
+ $[10] = t8;
194
+ } else {
195
+ t8 = $[10];
196
+ }
197
+ let t9;
198
+ if ($[11] !== onClose) {
199
+ t9 = /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: onClose, children: t8 });
200
+ $[11] = onClose;
201
+ $[12] = t9;
202
+ } else {
203
+ t9 = $[12];
204
+ }
205
+ let t10;
206
+ if ($[13] !== t5 || $[14] !== t9) {
207
+ t10 = /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5", children: [
208
+ t5,
209
+ t7,
210
+ t9
211
+ ] });
212
+ $[13] = t5;
213
+ $[14] = t9;
214
+ $[15] = t10;
215
+ } else {
216
+ t10 = $[15];
217
+ }
218
+ let t11;
219
+ if ($[16] !== t10 || $[17] !== t4) {
220
+ t11 = /* @__PURE__ */ jsxs("div", { className: t3, children: [
221
+ t4,
222
+ t10
223
+ ] });
224
+ $[16] = t10;
225
+ $[17] = t4;
226
+ $[18] = t11;
227
+ } else {
228
+ t11 = $[18];
229
+ }
230
+ let t12;
231
+ const ext = getExtension(file.name)?.toLowerCase() || "";
232
+ const isImage_0 = file.contentType?.startsWith("image/") || ["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(ext);
233
+ const isVideo_0 = file.contentType?.startsWith("video/") || ["mp4", "webm", "ogg", "mov"].includes(ext);
234
+ const isAudio_0 = file.contentType?.startsWith("audio/") || ["mp3", "wav", "ogg", "m4a"].includes(ext);
235
+ const downloadUrl_0 = file.downloadUrl;
236
+ if (isImage_0 && downloadUrl_0) {
237
+ let t132;
238
+ if ($[19] !== downloadUrl_0 || $[20] !== file.name) {
239
+ t132 = /* @__PURE__ */ jsx("img", { src: downloadUrl_0, alt: file.name, className: "max-w-full max-h-[400px] object-contain rounded-md shadow-sm" });
240
+ $[19] = downloadUrl_0;
241
+ $[20] = file.name;
242
+ $[21] = t132;
243
+ } else {
244
+ t132 = $[21];
245
+ }
246
+ t12 = t132;
247
+ } else {
248
+ if (isVideo_0 && downloadUrl_0) {
249
+ let t132;
250
+ if ($[22] !== downloadUrl_0) {
251
+ t132 = /* @__PURE__ */ jsx("video", { src: downloadUrl_0, className: "max-w-full max-h-[400px] rounded-md", controls: true });
252
+ $[22] = downloadUrl_0;
253
+ $[23] = t132;
254
+ } else {
255
+ t132 = $[23];
256
+ }
257
+ t12 = t132;
258
+ } else {
259
+ if (isAudio_0 && downloadUrl_0) {
260
+ let t132;
261
+ if ($[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
262
+ t132 = /* @__PURE__ */ jsx(Music2Icon, { className: "text-surface-accent-400 w-10 h-10" });
263
+ $[24] = t132;
264
+ } else {
265
+ t132 = $[24];
266
+ }
267
+ let t142;
268
+ if ($[25] !== downloadUrl_0) {
269
+ t142 = /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4", children: [
270
+ t132,
271
+ /* @__PURE__ */ jsx("audio", { src: downloadUrl_0, controls: true, className: "w-full max-w-xs" })
272
+ ] });
273
+ $[25] = downloadUrl_0;
274
+ $[26] = t142;
275
+ } else {
276
+ t142 = $[26];
277
+ }
278
+ t12 = t142;
279
+ } else {
280
+ let t132;
281
+ if ($[27] !== FileIconComponent) {
282
+ t132 = /* @__PURE__ */ jsx(FileIconComponent, { className: "w-10 h-10" });
283
+ $[27] = FileIconComponent;
284
+ $[28] = t132;
285
+ } else {
286
+ t132 = $[28];
287
+ }
288
+ let t142;
289
+ if ($[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
290
+ t142 = /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-text-disabled dark:text-text-disabled-dark", children: "No preview available" });
291
+ $[29] = t142;
292
+ } else {
293
+ t142 = $[29];
294
+ }
295
+ let t152;
296
+ if ($[30] !== t132) {
297
+ t152 = /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-3 text-surface-accent-400", children: [
298
+ t132,
299
+ t142
300
+ ] });
301
+ $[30] = t132;
302
+ $[31] = t152;
303
+ } else {
304
+ t152 = $[31];
305
+ }
306
+ t12 = t152;
307
+ }
308
+ }
309
+ }
310
+ let t13;
311
+ if ($[32] !== t12) {
312
+ t13 = /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center justify-center min-h-[200px] p-4 bg-surface-50 dark:bg-surface-900 border-b border-surface-accent-200 dark:border-surface-accent-700", children: t12 }) });
313
+ $[32] = t12;
314
+ $[33] = t13;
315
+ } else {
316
+ t13 = $[33];
317
+ }
318
+ let t14;
319
+ if ($[34] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
320
+ t14 = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-text-disabled dark:text-text-disabled-dark text-[10px] uppercase tracking-wider font-bold mb-1 block", children: "File Info" }) });
321
+ $[34] = t14;
322
+ } else {
323
+ t14 = $[34];
324
+ }
325
+ let t15;
326
+ if ($[35] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
327
+ t15 = /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-surface-accent-500 text-[11px]", children: "Name" });
328
+ $[35] = t15;
329
+ } else {
330
+ t15 = $[35];
331
+ }
332
+ let t16;
333
+ if ($[36] !== file.name) {
334
+ t16 = /* @__PURE__ */ jsxs("div", { children: [
335
+ t15,
336
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-[13px] break-all", children: file.name })
337
+ ] });
338
+ $[36] = file.name;
339
+ $[37] = t16;
340
+ } else {
341
+ t16 = $[37];
342
+ }
343
+ let t17;
344
+ if ($[38] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
345
+ t17 = /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-surface-accent-500 text-[11px]", children: "Type" });
346
+ $[38] = t17;
347
+ } else {
348
+ t17 = $[38];
349
+ }
350
+ const t18 = file.contentType || "Unknown";
351
+ let t19;
352
+ if ($[39] !== t18) {
353
+ t19 = /* @__PURE__ */ jsxs("div", { children: [
354
+ t17,
355
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-[13px]", children: t18 })
356
+ ] });
357
+ $[39] = t18;
358
+ $[40] = t19;
359
+ } else {
360
+ t19 = $[40];
361
+ }
362
+ let t20;
363
+ if ($[41] !== file.size) {
364
+ t20 = file.size !== void 0 && /* @__PURE__ */ jsxs("div", { children: [
365
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-surface-accent-500 text-[11px]", children: "Size" }),
366
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-[13px]", children: formatFileSize(file.size) })
367
+ ] });
368
+ $[41] = file.size;
369
+ $[42] = t20;
370
+ } else {
371
+ t20 = $[42];
372
+ }
373
+ let t21;
374
+ if ($[43] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
375
+ t21 = /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-surface-accent-500 text-[11px]", children: "Extension" });
376
+ $[43] = t21;
377
+ } else {
378
+ t21 = $[43];
379
+ }
380
+ let t22;
381
+ if ($[44] !== file.name) {
382
+ t22 = getExtension(file.name) || "—";
383
+ $[44] = file.name;
384
+ $[45] = t22;
385
+ } else {
386
+ t22 = $[45];
387
+ }
388
+ let t23;
389
+ if ($[46] !== t22) {
390
+ t23 = /* @__PURE__ */ jsxs("div", { children: [
391
+ t21,
392
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-[13px] font-mono", children: t22 })
393
+ ] });
394
+ $[46] = t22;
395
+ $[47] = t23;
396
+ } else {
397
+ t23 = $[47];
398
+ }
399
+ let t24;
400
+ if ($[48] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
401
+ t24 = /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-surface-accent-500 text-[11px]", children: "Path" });
402
+ $[48] = t24;
403
+ } else {
404
+ t24 = $[48];
405
+ }
406
+ let t25;
407
+ if ($[49] !== file.fullPath) {
408
+ t25 = /* @__PURE__ */ jsxs("div", { className: "col-span-2", children: [
409
+ t24,
410
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-[13px] font-mono break-all", children: file.fullPath })
411
+ ] });
412
+ $[49] = file.fullPath;
413
+ $[50] = t25;
414
+ } else {
415
+ t25 = $[50];
416
+ }
417
+ let t26;
418
+ if ($[51] !== t16 || $[52] !== t19 || $[53] !== t20 || $[54] !== t23 || $[55] !== t25) {
419
+ t26 = /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
420
+ t16,
421
+ t19,
422
+ t20,
423
+ t23,
424
+ t25
425
+ ] });
426
+ $[51] = t16;
427
+ $[52] = t19;
428
+ $[53] = t20;
429
+ $[54] = t23;
430
+ $[55] = t25;
431
+ $[56] = t26;
432
+ } else {
433
+ t26 = $[56];
434
+ }
435
+ let t27;
436
+ if ($[57] !== downloadUrl) {
437
+ t27 = downloadUrl && /* @__PURE__ */ jsxs("div", { className: "pt-2", children: [
438
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-surface-accent-500 text-[11px] block mb-1", children: "URL" }),
439
+ /* @__PURE__ */ jsxs("div", { className: "p-2 rounded bg-surface-100 dark:bg-surface-950 cursor-pointer hover:bg-surface-200 dark:hover:bg-surface-700 transition-colors", onClick: () => {
440
+ navigator.clipboard.writeText(downloadUrl);
441
+ }, children: [
442
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-mono text-[11px] break-all text-primary", children: downloadUrl }),
443
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-text-disabled dark:text-text-disabled-dark text-[10px] block mt-1", children: "Click to copy" })
444
+ ] })
445
+ ] });
446
+ $[57] = downloadUrl;
447
+ $[58] = t27;
448
+ } else {
449
+ t27 = $[58];
450
+ }
451
+ let t28;
452
+ if ($[59] !== t26 || $[60] !== t27) {
453
+ t28 = /* @__PURE__ */ jsxs("div", { className: "p-4 space-y-3", children: [
454
+ t14,
455
+ t26,
456
+ t27
457
+ ] });
458
+ $[59] = t26;
459
+ $[60] = t27;
460
+ $[61] = t28;
461
+ } else {
462
+ t28 = $[61];
463
+ }
464
+ let t29;
465
+ if ($[62] !== t11 || $[63] !== t13 || $[64] !== t28) {
466
+ t29 = /* @__PURE__ */ jsxs("div", { className: t2, children: [
467
+ t11,
468
+ t13,
469
+ t28
470
+ ] });
471
+ $[62] = t11;
472
+ $[63] = t13;
473
+ $[64] = t28;
474
+ $[65] = t29;
475
+ } else {
476
+ t29 = $[65];
477
+ }
478
+ let t30;
479
+ if ($[66] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
480
+ t30 = /* @__PURE__ */ jsx(Typography, { variant: "subtitle1", className: "mb-2", children: "Delete File?" });
481
+ $[66] = t30;
482
+ } else {
483
+ t30 = $[66];
484
+ }
485
+ let t31;
486
+ if ($[67] !== file.name) {
487
+ t31 = /* @__PURE__ */ jsxs(DialogContent, { children: [
488
+ t30,
489
+ /* @__PURE__ */ jsxs(Typography, { className: "text-surface-accent-600 dark:text-surface-accent-400", children: [
490
+ 'Are you sure you want to delete "',
491
+ file.name,
492
+ '"? This action cannot be undone.'
493
+ ] })
494
+ ] });
495
+ $[67] = file.name;
496
+ $[68] = t31;
497
+ } else {
498
+ t31 = $[68];
499
+ }
500
+ let t32;
501
+ if ($[69] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
502
+ t32 = /* @__PURE__ */ jsx(Button, { variant: "text", onClick: () => setDeleteDialogOpen(false), children: "Cancel" });
503
+ $[69] = t32;
504
+ } else {
505
+ t32 = $[69];
506
+ }
507
+ let t33;
508
+ if ($[70] !== onDelete) {
509
+ t33 = /* @__PURE__ */ jsxs(DialogActions, { children: [
510
+ t32,
511
+ /* @__PURE__ */ jsx(Button, { variant: "filled", color: "error", onClick: () => {
512
+ setDeleteDialogOpen(false);
513
+ onDelete();
514
+ }, children: "Delete" })
515
+ ] });
516
+ $[70] = onDelete;
517
+ $[71] = t33;
518
+ } else {
519
+ t33 = $[71];
520
+ }
521
+ let t34;
522
+ if ($[72] !== deleteDialogOpen || $[73] !== t31 || $[74] !== t33) {
523
+ t34 = /* @__PURE__ */ jsxs(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: [
524
+ t31,
525
+ t33
526
+ ] });
527
+ $[72] = deleteDialogOpen;
528
+ $[73] = t31;
529
+ $[74] = t33;
530
+ $[75] = t34;
531
+ } else {
532
+ t34 = $[75];
533
+ }
534
+ let t35;
535
+ if ($[76] !== t29 || $[77] !== t34) {
536
+ t35 = /* @__PURE__ */ jsxs(Fragment, { children: [
537
+ t29,
538
+ t34
539
+ ] });
540
+ $[76] = t29;
541
+ $[77] = t34;
542
+ $[78] = t35;
543
+ } else {
544
+ t35 = $[78];
545
+ }
546
+ return t35;
547
+ }
548
+ const StorageView = () => {
549
+ const storageSource = useStorageSource();
550
+ const snackbarController = useSnackbarController();
551
+ const [searchParams, setSearchParams] = useSearchParams();
552
+ const currentPath = searchParams.get("path") || "";
553
+ const [loading, setLoading] = useState(true);
554
+ const [error, setError] = useState(null);
555
+ const [folders, setFolders] = useState([]);
556
+ const [files, setFiles] = useState([]);
557
+ const [selectedFile, setSelectedFile] = useState(null);
558
+ const [selectedDownloadUrl, setSelectedDownloadUrl] = useState(null);
559
+ const [uploadDialogOpen, setUploadDialogOpen] = useState(false);
560
+ const [viewMode, setViewMode] = useState("grid");
561
+ const storageSourceRef = React.useRef(storageSource);
562
+ useEffect(() => {
563
+ storageSourceRef.current = storageSource;
564
+ }, [storageSource]);
565
+ const fetchContents = useCallback(async (path) => {
566
+ setLoading(true);
567
+ setError(null);
568
+ try {
569
+ const result = await storageSourceRef.current.listObjects(path);
570
+ const folderItems = (result.prefixes ?? []).map((ref) => ({
571
+ name: ref.name,
572
+ fullPath: ref.fullPath,
573
+ isFolder: true
574
+ }));
575
+ const fileItems = await Promise.all((result.items ?? []).map(async (ref_0) => {
576
+ try {
577
+ const downloadConfig = await storageSourceRef.current.getSignedUrl(ref_0.fullPath);
578
+ return {
579
+ name: ref_0.name,
580
+ fullPath: ref_0.fullPath,
581
+ isFolder: false,
582
+ size: downloadConfig.metadata?.size,
583
+ contentType: downloadConfig.metadata?.contentType,
584
+ downloadUrl: downloadConfig.url ?? void 0
585
+ };
586
+ } catch {
587
+ return {
588
+ name: ref_0.name,
589
+ fullPath: ref_0.fullPath,
590
+ isFolder: false
591
+ };
592
+ }
593
+ }));
594
+ setFolders(folderItems);
595
+ setFiles(fileItems);
596
+ } catch (e) {
597
+ console.error("Storage list error:", e);
598
+ setError(e instanceof Error ? e.message : String(e));
599
+ } finally {
600
+ setLoading(false);
601
+ }
602
+ }, []);
603
+ useEffect(() => {
604
+ fetchContents(currentPath);
605
+ }, [currentPath, fetchContents]);
606
+ const handleNavigate = useCallback((path_0) => {
607
+ if (!path_0) {
608
+ setSearchParams({});
609
+ } else {
610
+ setSearchParams({
611
+ path: path_0
612
+ });
613
+ }
614
+ setSelectedFile(null);
615
+ setSelectedDownloadUrl(null);
616
+ }, [setSearchParams]);
617
+ const handleNavigateUp = useCallback(() => {
618
+ const parts = currentPath.split("/").filter(Boolean);
619
+ parts.pop();
620
+ handleNavigate(parts.join("/"));
621
+ }, [currentPath, handleNavigate]);
622
+ const handleSelectFile = useCallback(async (file) => {
623
+ setSelectedFile(file);
624
+ if (file.downloadUrl) {
625
+ setSelectedDownloadUrl(file.downloadUrl);
626
+ } else {
627
+ try {
628
+ const config = await storageSourceRef.current.getSignedUrl(file.fullPath);
629
+ setSelectedDownloadUrl(config.url);
630
+ } catch {
631
+ setSelectedDownloadUrl(null);
632
+ }
633
+ }
634
+ }, []);
635
+ const handleUpload = useCallback(async (uploadFiles) => {
636
+ for (const file_0 of uploadFiles) {
637
+ const key = currentPath ? `${currentPath}/${file_0.name}` : file_0.name;
638
+ await storageSourceRef.current.putObject({
639
+ file: file_0,
640
+ key
641
+ });
642
+ }
643
+ snackbarController.open({
644
+ type: "success",
645
+ message: `${uploadFiles.length} file${uploadFiles.length > 1 ? "s" : ""} uploaded successfully`
646
+ });
647
+ fetchContents(currentPath);
648
+ }, [currentPath, snackbarController, fetchContents]);
649
+ const handleDeleteFile = useCallback(async (file_1) => {
650
+ try {
651
+ await storageSourceRef.current.deleteObject(file_1.fullPath);
652
+ snackbarController.open({
653
+ type: "success",
654
+ message: `"${file_1.name}" deleted`
655
+ });
656
+ setSelectedFile(null);
657
+ setSelectedDownloadUrl(null);
658
+ fetchContents(currentPath);
659
+ } catch (e_0) {
660
+ snackbarController.open({
661
+ type: "error",
662
+ message: e_0 instanceof Error ? e_0.message : String(e_0)
663
+ });
664
+ }
665
+ }, [currentPath, snackbarController, fetchContents]);
666
+ const handleRefresh = useCallback(() => {
667
+ fetchContents(currentPath);
668
+ }, [currentPath, fetchContents]);
669
+ const segments = breadcrumbSegments(currentPath);
670
+ const renderContents = () => {
671
+ if (loading) {
672
+ return /* @__PURE__ */ jsx("div", { className: "flex-grow flex items-center justify-center", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
673
+ /* @__PURE__ */ jsx(CircularProgress, { size: "medium" }),
674
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "mt-4 text-text-secondary dark:text-text-secondary-dark font-mono tracking-tight animate-pulse", children: "Loading..." })
675
+ ] }) });
676
+ }
677
+ if (error) {
678
+ return /* @__PURE__ */ jsx("div", { className: "flex-grow flex items-center justify-center p-6 overflow-auto", children: /* @__PURE__ */ jsx(ErrorView, { title: "Error loading storage", error, onRetry: handleRefresh }) });
679
+ }
680
+ const allItems = [...folders, ...files];
681
+ if (allItems.length === 0) {
682
+ return /* @__PURE__ */ jsx("div", { className: "flex-grow flex items-center justify-center text-text-disabled dark:text-text-disabled-dark", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
683
+ /* @__PURE__ */ jsx("svg", { className: "w-12 h-12 mx-auto mb-4 opacity-50", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1, d: "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" }) }),
684
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", children: "This folder is empty" }),
685
+ /* @__PURE__ */ jsxs(Button, { className: "mt-3", onClick: () => setUploadDialogOpen(true), children: [
686
+ /* @__PURE__ */ jsx(PlusIcon, { size: iconSize.smallest }),
687
+ "Upload files"
688
+ ] })
689
+ ] }) });
690
+ }
691
+ if (viewMode === "list") {
692
+ return /* @__PURE__ */ jsx("div", { className: "flex-grow overflow-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full", children: [
693
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: cls("border-b text-left text-[10px] uppercase tracking-wider text-text-disabled dark:text-text-disabled-dark", defaultBorderMixin), children: [
694
+ /* @__PURE__ */ jsx("th", { className: "px-4 py-2 font-bold", children: "Name" }),
695
+ /* @__PURE__ */ jsx("th", { className: "px-4 py-2 font-bold w-24", children: "Type" }),
696
+ /* @__PURE__ */ jsx("th", { className: "px-4 py-2 font-bold w-24 text-right", children: "Size" })
697
+ ] }) }),
698
+ /* @__PURE__ */ jsxs("tbody", { children: [
699
+ folders.map((folder) => /* @__PURE__ */ jsxs("tr", { className: "hover:bg-surface-100 dark:hover:bg-surface-950 cursor-pointer transition-colors border-b border-surface-100 dark:border-surface-950/50", onClick: () => handleNavigate(folder.fullPath), children: [
700
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-2.5", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
701
+ /* @__PURE__ */ jsx(FolderIcon, { size: iconSize.smallest, className: "text-amber-500 dark:text-amber-400 shrink-0" }),
702
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-[13px] font-medium truncate", children: folder.name })
703
+ ] }) }),
704
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-2.5", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-text-secondary dark:text-text-secondary-dark", children: "Folder" }) }),
705
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-2.5 text-right", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-text-disabled dark:text-text-disabled-dark", children: "—" }) })
706
+ ] }, folder.fullPath)),
707
+ files.map((file_2) => {
708
+ const FileIconComp = getFileIcon(file_2.contentType);
709
+ const isSelected = selectedFile?.fullPath === file_2.fullPath;
710
+ return /* @__PURE__ */ jsxs("tr", { className: cls("cursor-pointer transition-colors border-b border-surface-100 dark:border-surface-950/50", isSelected ? "bg-primary/5 dark:bg-primary/10" : "hover:bg-surface-100 dark:hover:bg-surface-950"), onClick: () => handleSelectFile(file_2), children: [
711
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-2.5", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
712
+ /* @__PURE__ */ jsx(FileIconComp, { size: iconSize.smallest, className: "text-surface-accent-400 shrink-0" }),
713
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-[13px] truncate", children: file_2.name })
714
+ ] }) }),
715
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-2.5", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-text-secondary dark:text-text-secondary-dark", children: getExtension(file_2.name) || file_2.contentType?.split("/")[1]?.toUpperCase() || "—" }) }),
716
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-2.5 text-right", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-text-secondary dark:text-text-secondary-dark font-mono text-[11px]", children: file_2.size !== void 0 ? formatFileSize(file_2.size) : "—" }) })
717
+ ] }, file_2.fullPath);
718
+ })
719
+ ] })
720
+ ] }) });
721
+ }
722
+ return /* @__PURE__ */ jsxs("div", { className: "flex-grow overflow-auto p-4", children: [
723
+ folders.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
724
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-[10px] uppercase tracking-wider font-bold text-text-disabled dark:text-text-disabled-dark mb-2 block", children: "Folders" }),
725
+ /* @__PURE__ */ jsx("div", { className: "grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]", children: folders.map((folder_0) => /* @__PURE__ */ jsxs("div", { className: cls("rounded-lg p-3 cursor-pointer transition-all duration-150 border", defaultBorderMixin, "hover:bg-surface-100 dark:hover:bg-surface-950 hover:shadow-sm", "flex items-center gap-2"), onClick: () => handleNavigate(folder_0.fullPath), children: [
726
+ /* @__PURE__ */ jsx(FolderIcon, { size: iconSize.smallest, className: "text-amber-500 dark:text-amber-400 shrink-0" }),
727
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-[13px] font-medium truncate", children: folder_0.name })
728
+ ] }, folder_0.fullPath)) })
729
+ ] }),
730
+ files.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
731
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-[10px] uppercase tracking-wider font-bold text-text-disabled dark:text-text-disabled-dark mb-2 block", children: [
732
+ "Files (",
733
+ files.length,
734
+ ")"
735
+ ] }),
736
+ /* @__PURE__ */ jsx("div", { className: "grid gap-3 grid-cols-[repeat(auto-fill,minmax(140px,1fr))]", children: files.map((file_3) => {
737
+ const FileIconComp_0 = getFileIcon(file_3.contentType);
738
+ const ext = getExtension(file_3.name)?.toLowerCase() || "";
739
+ const isImage = file_3.contentType?.startsWith("image/") || ["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(ext);
740
+ const isSelected_0 = selectedFile?.fullPath === file_3.fullPath;
741
+ return /* @__PURE__ */ jsxs("div", { className: cls("rounded-lg overflow-hidden cursor-pointer transition-all duration-150 border group", defaultBorderMixin, "hover:shadow-md hover:-translate-y-0.5", isSelected_0 && "ring-2 ring-primary"), onClick: () => handleSelectFile(file_3), children: [
742
+ /* @__PURE__ */ jsxs("div", { className: "aspect-square relative overflow-hidden bg-surface-100 dark:bg-surface-950 flex items-center justify-center", children: [
743
+ isImage && file_3.downloadUrl ? /* @__PURE__ */ jsx("img", { src: file_3.downloadUrl, alt: file_3.name, className: "w-full h-full object-cover" }) : /* @__PURE__ */ jsx(FileIconComp_0, { className: "text-surface-accent-400 dark:text-surface-accent-500 w-8 h-8" }),
744
+ getExtension(file_3.name) && /* @__PURE__ */ jsx("div", { className: "absolute bottom-1.5 right-1.5 px-1.5 py-0.5 rounded text-[9px] font-bold uppercase bg-black/50 text-white backdrop-blur-sm", children: getExtension(file_3.name) }),
745
+ /* @__PURE__ */ jsx("div", { className: cls("absolute inset-0 bg-black/0 group-hover:bg-black/10", "transition-colors duration-200 pointer-events-none") })
746
+ ] }),
747
+ /* @__PURE__ */ jsxs("div", { className: "p-2.5", children: [
748
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-[12px] font-medium truncate text-surface-900 dark:text-white", children: file_3.name }),
749
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "truncate block mt-0.5 text-[11px]", children: file_3.size !== void 0 ? formatFileSize(file_3.size) : "—" })
750
+ ] })
751
+ ] }, file_3.fullPath);
752
+ }) })
753
+ ] })
754
+ ] });
755
+ };
756
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-full w-full bg-white dark:bg-surface-950 overflow-hidden text-text-primary dark:text-text-primary-dark", children: [
757
+ /* @__PURE__ */ jsxs("div", { className: "flex h-full w-full", children: [
758
+ /* @__PURE__ */ jsxs("div", { className: "flex-grow flex flex-col min-w-0 h-full", children: [
759
+ /* @__PURE__ */ jsxs("div", { className: cls("flex items-center justify-between pr-2 border-b bg-white dark:bg-surface-950 shrink-0", defaultBorderMixin), children: [
760
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 flex-grow overflow-hidden px-3 py-2", children: [
761
+ currentPath && /* @__PURE__ */ jsx(Tooltip, { title: "Go up", children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: handleNavigateUp, children: /* @__PURE__ */ jsx(ArrowLeftIcon, { size: iconSize.smallest }) }) }),
762
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-0.5 overflow-x-auto no-scrollbar", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
763
+ i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-text-disabled dark:text-text-disabled-dark mx-0.5", children: "/" }),
764
+ /* @__PURE__ */ jsx(Button, { variant: "text", size: "small", className: cls("px-1.5 py-0.5 min-h-0 min-w-0 h-6 text-xs whitespace-nowrap normal-case font-normal", i === segments.length - 1 ? "text-text-primary dark:text-text-primary-dark font-medium" : "text-text-secondary dark:text-text-secondary-dark"), onClick: () => handleNavigate(seg.path), children: seg.label })
765
+ ] }, seg.path)) }),
766
+ /* @__PURE__ */ jsx("div", { className: "flex-1" }),
767
+ !loading && /* @__PURE__ */ jsxs(Chip, { size: "small", className: "shrink-0 text-[10px]", children: [
768
+ files.length,
769
+ " file",
770
+ files.length !== 1 ? "s" : "",
771
+ folders.length > 0 ? `, ${folders.length} folder${folders.length !== 1 ? "s" : ""}` : ""
772
+ ] })
773
+ ] }),
774
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center justify-end gap-1.5 pr-1", children: [
775
+ /* @__PURE__ */ jsx(Tooltip, { title: "Grid view", children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => setViewMode("grid"), className: cls(viewMode === "grid" && "bg-surface-100 dark:bg-surface-950"), children: /* @__PURE__ */ jsx(LayoutGridIcon, { size: iconSize.smallest }) }) }),
776
+ /* @__PURE__ */ jsx(Tooltip, { title: "List view", children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: () => setViewMode("list"), className: cls(viewMode === "list" && "bg-surface-100 dark:bg-surface-950"), children: /* @__PURE__ */ jsx(ListIcon, { size: iconSize.smallest }) }) }),
777
+ /* @__PURE__ */ jsx("div", { className: "h-4 w-px bg-surface-200 dark:bg-surface-950 mx-0.5" }),
778
+ /* @__PURE__ */ jsx(Tooltip, { title: "Refresh", children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: handleRefresh, disabled: loading, children: /* @__PURE__ */ jsx(RefreshCwIcon, { size: iconSize.smallest }) }) }),
779
+ /* @__PURE__ */ jsxs(Button, { size: "small", color: "primary", onClick: () => setUploadDialogOpen(true), children: [
780
+ /* @__PURE__ */ jsx(UploadCloudIcon, { size: iconSize.smallest, className: "mr-1" }),
781
+ "Upload"
782
+ ] })
783
+ ] })
784
+ ] }),
785
+ /* @__PURE__ */ jsx("div", { className: "flex-grow flex flex-col overflow-hidden min-h-0", children: renderContents() }),
786
+ /* @__PURE__ */ jsxs("div", { className: cls("px-4 py-1.5 border-t bg-surface-50 dark:bg-surface-900 flex items-center justify-between shrink-0", defaultBorderMixin), children: [
787
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 text-[11px]", children: [
788
+ /* @__PURE__ */ jsx("span", { className: "text-text-disabled dark:text-text-disabled-dark font-bold uppercase tracking-tighter", children: "Path" }),
789
+ /* @__PURE__ */ jsxs("span", { className: "font-mono text-text-secondary dark:text-text-secondary-dark", children: [
790
+ "/",
791
+ currentPath || ""
792
+ ] })
793
+ ] }),
794
+ selectedFile && /* @__PURE__ */ jsxs("div", { className: "text-[11px] text-text-secondary dark:text-text-secondary-dark", children: [
795
+ "Selected: ",
796
+ /* @__PURE__ */ jsx("span", { className: "font-mono", children: selectedFile.name })
797
+ ] })
798
+ ] })
799
+ ] }),
800
+ selectedFile && /* @__PURE__ */ jsx("div", { className: "w-80 lg:w-96 shrink-0", children: /* @__PURE__ */ jsx(FilePreviewPanel, { file: selectedFile, downloadUrl: selectedDownloadUrl, onClose: () => {
801
+ setSelectedFile(null);
802
+ setSelectedDownloadUrl(null);
803
+ }, onDelete: () => handleDeleteFile(selectedFile) }) })
804
+ ] }),
805
+ /* @__PURE__ */ jsx(UploadDialog, { open: uploadDialogOpen, currentPath, onClose: () => setUploadDialogOpen(false), onUpload: handleUpload })
806
+ ] });
807
+ };
808
+ export {
809
+ StorageView
810
+ };
811
+ //# sourceMappingURL=StorageView-DG9tJZG1.js.map