@powerhousedao/connect 6.0.0-dev.13 → 6.0.0-dev.131
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.
- package/.env +1 -1
- package/dist/AddDriveModal-A2SuEFot.js +88 -0
- package/dist/AddDriveModal-A2SuEFot.js.map +1 -0
- package/dist/ClearStorageModal-BW6OgSQZ.js +44 -0
- package/dist/ClearStorageModal-BW6OgSQZ.js.map +1 -0
- package/dist/CookiesPolicyModal-Gae1QuhA.js +30 -0
- package/dist/CookiesPolicyModal-Gae1QuhA.js.map +1 -0
- package/dist/CreateDocumentModal-5i6rmv3C.js +28 -0
- package/dist/CreateDocumentModal-5i6rmv3C.js.map +1 -0
- package/dist/DebugSettingsModal-Ko7M_1hz.js +139 -0
- package/dist/DebugSettingsModal-Ko7M_1hz.js.map +1 -0
- package/dist/DeleteDriveModal-BbAx_yXt.js +40 -0
- package/dist/DeleteDriveModal-BbAx_yXt.js.map +1 -0
- package/dist/DeleteItemModal-CkWegLlh.js +39 -0
- package/dist/DeleteItemModal-CkWegLlh.js.map +1 -0
- package/dist/DisclaimerModal-CCnvwoB5.js +21 -0
- package/dist/DisclaimerModal-CCnvwoB5.js.map +1 -0
- package/dist/DriveSettingsModal-DxMjOsLg.js +45 -0
- package/dist/DriveSettingsModal-DxMjOsLg.js.map +1 -0
- package/dist/ExportDocumentWithErrorsModal-hgliF8Gy.js +41 -0
- package/dist/ExportDocumentWithErrorsModal-hgliF8Gy.js.map +1 -0
- package/dist/InspectorModal-C4rE0Y5E.js +302 -0
- package/dist/InspectorModal-C4rE0Y5E.js.map +1 -0
- package/dist/MissingPackageModal-BOeTH4V6.js +33 -0
- package/dist/MissingPackageModal-BOeTH4V6.js.map +1 -0
- package/dist/SettingsModal-CbLo8E6b.js +153 -0
- package/dist/SettingsModal-CbLo8E6b.js.map +1 -0
- package/dist/UpgradeDriveModal-DldcNCaT.js +31 -0
- package/dist/UpgradeDriveModal-DldcNCaT.js.map +1 -0
- package/dist/connect.config-CUbxYkCy.js +140 -0
- package/dist/connect.config-CUbxYkCy.js.map +1 -0
- package/dist/i18n-Ch408v5-.js +125 -0
- package/dist/i18n-Ch408v5-.js.map +1 -0
- package/dist/load-Cj-e47iG.js +105 -0
- package/dist/load-Cj-e47iG.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +9 -0
- package/dist/main.js.map +1 -0
- package/dist/package-Bmdmcr41.js +109 -0
- package/dist/package-Bmdmcr41.js.map +1 -0
- package/dist/pglite.worker.d.ts +1 -0
- package/dist/pglite.worker.js +15 -0
- package/dist/pglite.worker.js.map +1 -0
- package/dist/reactor-Be0fd4-f.js +586 -0
- package/dist/reactor-Be0fd4-f.js.map +1 -0
- package/dist/registerServiceWorker-fSbJUcrq.js +76 -0
- package/dist/registerServiceWorker-fSbJUcrq.js.map +1 -0
- package/dist/sidebar--mosLbzc.js +1147 -0
- package/dist/sidebar--mosLbzc.js.map +1 -0
- package/dist/start-connect.d.ts +7 -0
- package/dist/start-connect.d.ts.map +1 -0
- package/dist/start-connect.js +14 -0
- package/dist/start-connect.js.map +1 -0
- package/{lib → dist}/style.css +1874 -258
- package/dist/toast-iD-70hL8.js +16 -0
- package/dist/toast-iD-70hL8.js.map +1 -0
- package/dist/useRegistryPackages-Ctlhv061.js +96 -0
- package/dist/useRegistryPackages-Ctlhv061.js.map +1 -0
- package/package.json +53 -122
- package/public/ph-packages.json +3 -0
- package/dist/assets/AddDriveModal-DIoUpaAF.js +0 -1
- package/dist/assets/ClearStorageModal-ycpNGzZD.js +0 -1
- package/dist/assets/CookiesPolicyModal-CTzhPkj4.js +0 -1
- package/dist/assets/CreateDocumentModal-CqEwhwol.js +0 -1
- package/dist/assets/DebugSettingsModal-CC10cJaK.js +0 -1
- package/dist/assets/DeleteDriveModal-D7udxO1a.js +0 -1
- package/dist/assets/DeleteItemModal-BbRw_1Gj.js +0 -1
- package/dist/assets/DisclaimerModal-CFaE-Nj8.js +0 -1
- package/dist/assets/DriveSettingsModal-Bufilldb.js +0 -1
- package/dist/assets/ExportDocumentWithErrorsModal-DPKe4TFT.js +0 -1
- package/dist/assets/SettingsModal-CWMfYviw.js +0 -1
- package/dist/assets/UpgradeDriveModal-DYrS0Hc2.js +0 -1
- package/dist/assets/_virtual_ph_external-packages-CM1tCR4L.js +0 -1
- package/dist/assets/config-CU-aFfVJ.js +0 -1
- package/dist/assets/connect-loader-CvOC68Ih.mp4 +0 -0
- package/dist/assets/design_system-D52MLspZ.js +0 -45
- package/dist/assets/design_system_connect-aoXYRwF4.js +0 -47
- package/dist/assets/design_system_ui-XQ1R-EVj.js +0 -1
- package/dist/assets/document_drive-Bubv8iix.js +0 -316
- package/dist/assets/document_engineering-CINAuWv7.js +0 -1
- package/dist/assets/document_model-_oCbt5YE.js +0 -230
- package/dist/assets/document_model_editor-BspMxpXW.js +0 -25
- package/dist/assets/drive_explorer-DqFnhYTw.js +0 -2
- package/dist/assets/graphql-AKTCpY7l.js +0 -75
- package/dist/assets/graphql-editor-C8npUT_I.js +0 -73
- package/dist/assets/graphql_request-BJtmW2JS.js +0 -3
- package/dist/assets/hmr-LMNkvzP7.js +0 -1
- package/dist/assets/home-bg-BEhF9NuW.png +0 -0
- package/dist/assets/home-bg-BRYzhkhi.avif +0 -0
- package/dist/assets/hooks-DQSYzWSJ.js +0 -12
- package/dist/assets/index-BtGkNDA5.js +0 -18
- package/dist/assets/index-DYdiZMfn.css +0 -1
- package/dist/assets/index-Dc3GW8BC.js +0 -28
- package/dist/assets/json-editor-DUBkHVgj.js +0 -1
- package/dist/assets/nodefs-Gkgpmm-M.js +0 -1
- package/dist/assets/opfs-ahp-LxCUF81V.js +0 -3
- package/dist/assets/pg_dump-CW0pN9tG.wasm +0 -0
- package/dist/assets/postgres-CkP7QCDB.data +0 -0
- package/dist/assets/postgres-CyuUVpXN.wasm +0 -0
- package/dist/assets/powerhouse-rounded-CeKGGUG4.png +0 -0
- package/dist/assets/react/jsx-runtime-DldvXD6N.js +0 -1
- package/dist/assets/react-DQSxOgtG.js +0 -1
- package/dist/assets/react-dom/client-BVPiT_FE.js +0 -9
- package/dist/assets/react-dom-D6zQJsh6.js +0 -1
- package/dist/assets/reactor_browser-Ctu-pROf.js +0 -129
- package/dist/assets/renown-short-hover-BiSLBV7L.png +0 -0
- package/dist/assets/rwa-report-Bb0W5-ac.png +0 -0
- package/dist/assets/sentry_browser-B4YoBIIG.js +0 -498
- package/dist/assets/sentry_react-cODD7zWc.js +0 -3
- package/dist/assets/state-schemas-us3Kzmgu.js +0 -2
- package/dist/assets/tailwind_merge-Dr4f9Rms.js +0 -1
- package/dist/assets/zod-9j67vCAu.js +0 -39
- package/dist/icon.ico +0 -0
- package/dist/index.html +0 -51
- package/dist/robots.txt +0 -3
- package/dist/settings.png +0 -0
- package/heroku/Dockerfile +0 -101
- package/heroku/Procfile +0 -1
- package/heroku/config/nginx.conf.template +0 -77
- package/heroku/heroku-entrypoint.sh +0 -38
- package/lib/cypress/e2e/navigation.cy.d.ts +0 -2
- package/lib/cypress/e2e/navigation.cy.d.ts.map +0 -1
- package/lib/cypress/e2e/navigation.cy.js +0 -221
- package/lib/cypress/e2e/navigation.cy.js.map +0 -1
- package/lib/cypress/e2e/utils/index.d.ts +0 -15
- package/lib/cypress/e2e/utils/index.d.ts.map +0 -1
- package/lib/cypress/e2e/utils/index.js +0 -121
- package/lib/cypress/e2e/utils/index.js.map +0 -1
- package/lib/cypress/support/commands.d.ts +0 -2
- package/lib/cypress/support/commands.d.ts.map +0 -1
- package/lib/cypress/support/commands.js +0 -29
- package/lib/cypress/support/commands.js.map +0 -1
- package/lib/cypress/support/e2e.d.ts +0 -2
- package/lib/cypress/support/e2e.d.ts.map +0 -1
- package/lib/cypress/support/e2e.js +0 -19
- package/lib/cypress/support/e2e.js.map +0 -1
- package/lib/cypress.config.d.ts +0 -3
- package/lib/cypress.config.d.ts.map +0 -1
- package/lib/cypress.config.js +0 -15
- package/lib/cypress.config.js.map +0 -1
- package/lib/package.copy.json +0 -177
- package/lib/scripts/render-skeleton.d.ts +0 -2
- package/lib/scripts/render-skeleton.d.ts.map +0 -1
- package/lib/scripts/render-skeleton.js +0 -11
- package/lib/scripts/render-skeleton.js.map +0 -1
- package/lib/src/components/analytics.d.ts +0 -8
- package/lib/src/components/analytics.d.ts.map +0 -1
- package/lib/src/components/analytics.js +0 -30
- package/lib/src/components/analytics.js.map +0 -1
- package/lib/src/components/app-loader.d.ts +0 -3
- package/lib/src/components/app-loader.d.ts.map +0 -1
- package/lib/src/components/app-loader.js +0 -20
- package/lib/src/components/app-loader.js.map +0 -1
- package/lib/src/components/app-skeleton.d.ts +0 -3
- package/lib/src/components/app-skeleton.d.ts.map +0 -1
- package/lib/src/components/app-skeleton.js +0 -38
- package/lib/src/components/app-skeleton.js.map +0 -1
- package/lib/src/components/app.d.ts +0 -2
- package/lib/src/components/app.d.ts.map +0 -1
- package/lib/src/components/app.js +0 -29
- package/lib/src/components/app.js.map +0 -1
- package/lib/src/components/button.d.ts +0 -3
- package/lib/src/components/button.d.ts.map +0 -1
- package/lib/src/components/button.js +0 -7
- package/lib/src/components/button.js.map +0 -1
- package/lib/src/components/cookie-banner.d.ts +0 -2
- package/lib/src/components/cookie-banner.d.ts.map +0 -1
- package/lib/src/components/cookie-banner.js +0 -48
- package/lib/src/components/cookie-banner.js.map +0 -1
- package/lib/src/components/document-editor-container.d.ts +0 -2
- package/lib/src/components/document-editor-container.d.ts.map +0 -1
- package/lib/src/components/document-editor-container.js +0 -65
- package/lib/src/components/document-editor-container.js.map +0 -1
- package/lib/src/components/dots-loader.d.ts +0 -2
- package/lib/src/components/dots-loader.d.ts.map +0 -1
- package/lib/src/components/dots-loader.js +0 -15
- package/lib/src/components/dots-loader.js.map +0 -1
- package/lib/src/components/drive-editor-container.d.ts +0 -2
- package/lib/src/components/drive-editor-container.d.ts.map +0 -1
- package/lib/src/components/drive-editor-container.js +0 -22
- package/lib/src/components/drive-editor-container.js.map +0 -1
- package/lib/src/components/drive-icon.d.ts +0 -5
- package/lib/src/components/drive-icon.d.ts.map +0 -1
- package/lib/src/components/drive-icon.js +0 -15
- package/lib/src/components/drive-icon.js.map +0 -1
- package/lib/src/components/editor-loader.d.ts +0 -9
- package/lib/src/components/editor-loader.d.ts.map +0 -1
- package/lib/src/components/editor-loader.js +0 -19
- package/lib/src/components/editor-loader.js.map +0 -1
- package/lib/src/components/editors.d.ts +0 -10
- package/lib/src/components/editors.d.ts.map +0 -1
- package/lib/src/components/editors.js +0 -87
- package/lib/src/components/editors.js.map +0 -1
- package/lib/src/components/error-boundary.d.ts +0 -103
- package/lib/src/components/error-boundary.d.ts.map +0 -1
- package/lib/src/components/error-boundary.js +0 -104
- package/lib/src/components/error-boundary.js.map +0 -1
- package/lib/src/components/footer.d.ts +0 -2
- package/lib/src/components/footer.d.ts.map +0 -1
- package/lib/src/components/footer.js +0 -16
- package/lib/src/components/footer.js.map +0 -1
- package/lib/src/components/index.d.ts +0 -22
- package/lib/src/components/index.d.ts.map +0 -1
- package/lib/src/components/index.js +0 -22
- package/lib/src/components/index.js.map +0 -1
- package/lib/src/components/login.d.ts +0 -2
- package/lib/src/components/login.d.ts.map +0 -1
- package/lib/src/components/login.js +0 -12
- package/lib/src/components/login.js.map +0 -1
- package/lib/src/components/modal/index.d.ts +0 -18
- package/lib/src/components/modal/index.d.ts.map +0 -1
- package/lib/src/components/modal/index.js +0 -18
- package/lib/src/components/modal/index.js.map +0 -1
- package/lib/src/components/modal/modals/AddDriveModal.d.ts +0 -2
- package/lib/src/components/modal/modals/AddDriveModal.d.ts.map +0 -1
- package/lib/src/components/modal/modals/AddDriveModal.js +0 -121
- package/lib/src/components/modal/modals/AddDriveModal.js.map +0 -1
- package/lib/src/components/modal/modals/ClearStorageModal.d.ts +0 -2
- package/lib/src/components/modal/modals/ClearStorageModal.d.ts.map +0 -1
- package/lib/src/components/modal/modals/ClearStorageModal.js +0 -35
- package/lib/src/components/modal/modals/ClearStorageModal.js.map +0 -1
- package/lib/src/components/modal/modals/CookiesPolicyModal.d.ts +0 -2
- package/lib/src/components/modal/modals/CookiesPolicyModal.d.ts.map +0 -1
- package/lib/src/components/modal/modals/CookiesPolicyModal.js +0 -16
- package/lib/src/components/modal/modals/CookiesPolicyModal.js.map +0 -1
- package/lib/src/components/modal/modals/CreateDocumentModal.d.ts +0 -2
- package/lib/src/components/modal/modals/CreateDocumentModal.d.ts.map +0 -1
- package/lib/src/components/modal/modals/CreateDocumentModal.js +0 -24
- package/lib/src/components/modal/modals/CreateDocumentModal.js.map +0 -1
- package/lib/src/components/modal/modals/DebugSettingsModal.d.ts +0 -2
- package/lib/src/components/modal/modals/DebugSettingsModal.d.ts.map +0 -1
- package/lib/src/components/modal/modals/DebugSettingsModal.js +0 -108
- package/lib/src/components/modal/modals/DebugSettingsModal.js.map +0 -1
- package/lib/src/components/modal/modals/DeleteDriveModal.d.ts +0 -2
- package/lib/src/components/modal/modals/DeleteDriveModal.d.ts.map +0 -1
- package/lib/src/components/modal/modals/DeleteDriveModal.js +0 -32
- package/lib/src/components/modal/modals/DeleteDriveModal.js.map +0 -1
- package/lib/src/components/modal/modals/DeleteItemModal.d.ts +0 -3
- package/lib/src/components/modal/modals/DeleteItemModal.d.ts.map +0 -1
- package/lib/src/components/modal/modals/DeleteItemModal.js +0 -33
- package/lib/src/components/modal/modals/DeleteItemModal.js.map +0 -1
- package/lib/src/components/modal/modals/DisclaimerModal.d.ts +0 -3
- package/lib/src/components/modal/modals/DisclaimerModal.d.ts.map +0 -1
- package/lib/src/components/modal/modals/DisclaimerModal.js +0 -12
- package/lib/src/components/modal/modals/DisclaimerModal.js.map +0 -1
- package/lib/src/components/modal/modals/DriveSettingsModal.d.ts +0 -2
- package/lib/src/components/modal/modals/DriveSettingsModal.d.ts.map +0 -1
- package/lib/src/components/modal/modals/DriveSettingsModal.js +0 -28
- package/lib/src/components/modal/modals/DriveSettingsModal.js.map +0 -1
- package/lib/src/components/modal/modals/ExportDocumentWithErrorsModal.d.ts +0 -2
- package/lib/src/components/modal/modals/ExportDocumentWithErrorsModal.d.ts.map +0 -1
- package/lib/src/components/modal/modals/ExportDocumentWithErrorsModal.js +0 -30
- package/lib/src/components/modal/modals/ExportDocumentWithErrorsModal.js.map +0 -1
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.d.ts +0 -2
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.d.ts.map +0 -1
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.js +0 -29
- package/lib/src/components/modal/modals/InspectorModal/InspectorModal.js.map +0 -1
- package/lib/src/components/modal/modals/InspectorModal/index.d.ts +0 -2
- package/lib/src/components/modal/modals/InspectorModal/index.d.ts.map +0 -1
- package/lib/src/components/modal/modals/InspectorModal/index.js +0 -2
- package/lib/src/components/modal/modals/InspectorModal/index.js.map +0 -1
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.d.ts +0 -31
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.d.ts.map +0 -1
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.js +0 -211
- package/lib/src/components/modal/modals/InspectorModal/useDbExplorer.js.map +0 -1
- package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.d.ts +0 -4
- package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.d.ts.map +0 -1
- package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.js +0 -12
- package/lib/src/components/modal/modals/InspectorModal/useRemotesInspector.js.map +0 -1
- package/lib/src/components/modal/modals/SettingsModal.d.ts +0 -3
- package/lib/src/components/modal/modals/SettingsModal.d.ts.map +0 -1
- package/lib/src/components/modal/modals/SettingsModal.js +0 -45
- package/lib/src/components/modal/modals/SettingsModal.js.map +0 -1
- package/lib/src/components/modal/modals/UpgradeDriveModal.d.ts +0 -3
- package/lib/src/components/modal/modals/UpgradeDriveModal.d.ts.map +0 -1
- package/lib/src/components/modal/modals/UpgradeDriveModal.js +0 -21
- package/lib/src/components/modal/modals/UpgradeDriveModal.js.map +0 -1
- package/lib/src/components/modal/modals/settings/about.d.ts +0 -2
- package/lib/src/components/modal/modals/settings/about.d.ts.map +0 -1
- package/lib/src/components/modal/modals/settings/about.js +0 -10
- package/lib/src/components/modal/modals/settings/about.js.map +0 -1
- package/lib/src/components/modal/modals/settings/danger-zone.d.ts +0 -2
- package/lib/src/components/modal/modals/settings/danger-zone.d.ts.map +0 -1
- package/lib/src/components/modal/modals/settings/danger-zone.js +0 -15
- package/lib/src/components/modal/modals/settings/danger-zone.js.map +0 -1
- package/lib/src/components/modal/modals/settings/default-editor.d.ts +0 -2
- package/lib/src/components/modal/modals/settings/default-editor.d.ts.map +0 -1
- package/lib/src/components/modal/modals/settings/default-editor.js +0 -18
- package/lib/src/components/modal/modals/settings/default-editor.js.map +0 -1
- package/lib/src/components/modal/modals/settings/package-manager.d.ts +0 -3
- package/lib/src/components/modal/modals/settings/package-manager.d.ts.map +0 -1
- package/lib/src/components/modal/modals/settings/package-manager.js +0 -87
- package/lib/src/components/modal/modals/settings/package-manager.js.map +0 -1
- package/lib/src/components/modal/modals-container.d.ts +0 -2
- package/lib/src/components/modal/modals-container.d.ts.map +0 -1
- package/lib/src/components/modal/modals-container.js +0 -66
- package/lib/src/components/modal/modals-container.js.map +0 -1
- package/lib/src/components/ph-logo.d.ts +0 -2
- package/lib/src/components/ph-logo.d.ts.map +0 -1
- package/lib/src/components/ph-logo.js +0 -7
- package/lib/src/components/ph-logo.js.map +0 -1
- package/lib/src/components/reload-connect-toast.d.ts +0 -2
- package/lib/src/components/reload-connect-toast.d.ts.map +0 -1
- package/lib/src/components/reload-connect-toast.js +0 -7
- package/lib/src/components/reload-connect-toast.js.map +0 -1
- package/lib/src/components/root.d.ts +0 -2
- package/lib/src/components/root.d.ts.map +0 -1
- package/lib/src/components/root.js +0 -8
- package/lib/src/components/root.js.map +0 -1
- package/lib/src/components/router.d.ts +0 -2
- package/lib/src/components/router.d.ts.map +0 -1
- package/lib/src/components/router.js +0 -41
- package/lib/src/components/router.js.map +0 -1
- package/lib/src/components/search-bar.d.ts +0 -2
- package/lib/src/components/search-bar.d.ts.map +0 -1
- package/lib/src/components/search-bar.js +0 -36
- package/lib/src/components/search-bar.js.map +0 -1
- package/lib/src/components/sidebar.d.ts +0 -2
- package/lib/src/components/sidebar.d.ts.map +0 -1
- package/lib/src/components/sidebar.js +0 -28
- package/lib/src/components/sidebar.js.map +0 -1
- package/lib/src/connect.config.d.ts +0 -115
- package/lib/src/connect.config.d.ts.map +0 -1
- package/lib/src/connect.config.js +0 -148
- package/lib/src/connect.config.js.map +0 -1
- package/lib/src/context/index.d.ts +0 -4
- package/lib/src/context/index.d.ts.map +0 -1
- package/lib/src/context/index.js +0 -4
- package/lib/src/context/index.js.map +0 -1
- package/lib/src/context/processor-manager.d.ts +0 -3
- package/lib/src/context/processor-manager.d.ts.map +0 -1
- package/lib/src/context/processor-manager.js +0 -189
- package/lib/src/context/processor-manager.js.map +0 -1
- package/lib/src/context/read-mode.d.ts +0 -2
- package/lib/src/context/read-mode.d.ts.map +0 -1
- package/lib/src/context/read-mode.js +0 -219
- package/lib/src/context/read-mode.js.map +0 -1
- package/lib/src/context/sentry-provider.d.ts +0 -6
- package/lib/src/context/sentry-provider.d.ts.map +0 -1
- package/lib/src/context/sentry-provider.js +0 -6
- package/lib/src/context/sentry-provider.js.map +0 -1
- package/lib/src/feature-flags.d.ts +0 -53
- package/lib/src/feature-flags.d.ts.map +0 -1
- package/lib/src/feature-flags.js +0 -173
- package/lib/src/feature-flags.js.map +0 -1
- package/lib/src/globals.d.ts +0 -9
- package/lib/src/globals.d.ts.map +0 -1
- package/lib/src/globals.js +0 -2
- package/lib/src/globals.js.map +0 -1
- package/lib/src/hmr.d.ts +0 -3
- package/lib/src/hmr.d.ts.map +0 -1
- package/lib/src/hmr.js +0 -2
- package/lib/src/hmr.js.map +0 -1
- package/lib/src/hooks/index.d.ts +0 -10
- package/lib/src/hooks/index.d.ts.map +0 -1
- package/lib/src/hooks/index.js +0 -10
- package/lib/src/hooks/index.js.map +0 -1
- package/lib/src/hooks/useAcceptedCookies.d.ts +0 -9
- package/lib/src/hooks/useAcceptedCookies.d.ts.map +0 -1
- package/lib/src/hooks/useAcceptedCookies.js +0 -34
- package/lib/src/hooks/useAcceptedCookies.js.map +0 -1
- package/lib/src/hooks/useCheckLatestVersion.d.ts +0 -2
- package/lib/src/hooks/useCheckLatestVersion.d.ts.map +0 -1
- package/lib/src/hooks/useCheckLatestVersion.js +0 -33
- package/lib/src/hooks/useCheckLatestVersion.js.map +0 -1
- package/lib/src/hooks/useClientErrorHandler.d.ts +0 -6
- package/lib/src/hooks/useClientErrorHandler.d.ts.map +0 -1
- package/lib/src/hooks/useClientErrorHandler.js +0 -131
- package/lib/src/hooks/useClientErrorHandler.js.map +0 -1
- package/lib/src/hooks/useCookieBanner.d.ts +0 -5
- package/lib/src/hooks/useCookieBanner.d.ts.map +0 -1
- package/lib/src/hooks/useCookieBanner.js +0 -32
- package/lib/src/hooks/useCookieBanner.js.map +0 -1
- package/lib/src/hooks/useInitSentry.d.ts +0 -2
- package/lib/src/hooks/useInitSentry.d.ts.map +0 -1
- package/lib/src/hooks/useInitSentry.js +0 -80
- package/lib/src/hooks/useInitSentry.js.map +0 -1
- package/lib/src/hooks/useNodeActions.d.ts +0 -6
- package/lib/src/hooks/useNodeActions.d.ts.map +0 -1
- package/lib/src/hooks/useNodeActions.js +0 -35
- package/lib/src/hooks/useNodeActions.js.map +0 -1
- package/lib/src/hooks/useUndoRedoShortcuts.d.ts +0 -8
- package/lib/src/hooks/useUndoRedoShortcuts.d.ts.map +0 -1
- package/lib/src/hooks/useUndoRedoShortcuts.js +0 -26
- package/lib/src/hooks/useUndoRedoShortcuts.js.map +0 -1
- package/lib/src/hooks/useWindowSize.d.ts +0 -5
- package/lib/src/hooks/useWindowSize.d.ts.map +0 -1
- package/lib/src/hooks/useWindowSize.js +0 -21
- package/lib/src/hooks/useWindowSize.js.map +0 -1
- package/lib/src/hooks/utils.d.ts +0 -7
- package/lib/src/hooks/utils.d.ts.map +0 -1
- package/lib/src/hooks/utils.js +0 -46
- package/lib/src/hooks/utils.js.map +0 -1
- package/lib/src/i18n/index.d.ts +0 -4
- package/lib/src/i18n/index.d.ts.map +0 -1
- package/lib/src/i18n/index.js +0 -26
- package/lib/src/i18n/index.js.map +0 -1
- package/lib/src/i18n/locales/en.json +0 -114
- package/lib/src/index.d.ts +0 -2
- package/lib/src/index.d.ts.map +0 -1
- package/lib/src/index.js +0 -2
- package/lib/src/index.js.map +0 -1
- package/lib/src/main.d.ts +0 -2
- package/lib/src/main.d.ts.map +0 -1
- package/lib/src/main.js +0 -5
- package/lib/src/main.js.map +0 -1
- package/lib/src/pages/content.d.ts +0 -2
- package/lib/src/pages/content.d.ts.map +0 -1
- package/lib/src/pages/content.js +0 -39
- package/lib/src/pages/content.js.map +0 -1
- package/lib/src/pages/demo/atlas-import.d.ts +0 -2
- package/lib/src/pages/demo/atlas-import.d.ts.map +0 -1
- package/lib/src/pages/demo/atlas-import.js +0 -122
- package/lib/src/pages/demo/atlas-import.js.map +0 -1
- package/lib/src/pages/index.d.ts +0 -4
- package/lib/src/pages/index.d.ts.map +0 -1
- package/lib/src/pages/index.js +0 -4
- package/lib/src/pages/index.js.map +0 -1
- package/lib/src/pages/settings.d.ts +0 -4
- package/lib/src/pages/settings.d.ts.map +0 -1
- package/lib/src/pages/settings.js +0 -9
- package/lib/src/pages/settings.js.map +0 -1
- package/lib/src/service-worker.d.ts +0 -2
- package/lib/src/service-worker.d.ts.map +0 -1
- package/lib/src/service-worker.js +0 -58
- package/lib/src/service-worker.js.map +0 -1
- package/lib/src/services/hmr.d.ts +0 -13
- package/lib/src/services/hmr.d.ts.map +0 -1
- package/lib/src/services/hmr.js +0 -85
- package/lib/src/services/hmr.js.map +0 -1
- package/lib/src/services/index.d.ts +0 -10
- package/lib/src/services/index.d.ts.map +0 -1
- package/lib/src/services/index.js +0 -9
- package/lib/src/services/index.js.map +0 -1
- package/lib/src/services/logger.d.ts +0 -2
- package/lib/src/services/logger.d.ts.map +0 -1
- package/lib/src/services/logger.js +0 -28
- package/lib/src/services/logger.js.map +0 -1
- package/lib/src/services/renown/browser.d.ts +0 -2
- package/lib/src/services/renown/browser.d.ts.map +0 -1
- package/lib/src/services/renown/browser.js +0 -6
- package/lib/src/services/renown/browser.js.map +0 -1
- package/lib/src/services/renown/constants.d.ts +0 -130
- package/lib/src/services/renown/constants.d.ts.map +0 -1
- package/lib/src/services/renown/constants.js +0 -41
- package/lib/src/services/renown/constants.js.map +0 -1
- package/lib/src/services/renown/utils.d.ts +0 -7
- package/lib/src/services/renown/utils.d.ts.map +0 -1
- package/lib/src/services/renown/utils.js +0 -20
- package/lib/src/services/renown/utils.js.map +0 -1
- package/lib/src/services/storage/base-storage.d.ts +0 -9
- package/lib/src/services/storage/base-storage.d.ts.map +0 -1
- package/lib/src/services/storage/base-storage.js +0 -21
- package/lib/src/services/storage/base-storage.js.map +0 -1
- package/lib/src/services/storage/browser.d.ts +0 -5
- package/lib/src/services/storage/browser.d.ts.map +0 -1
- package/lib/src/services/storage/browser.js +0 -25
- package/lib/src/services/storage/browser.js.map +0 -1
- package/lib/src/services/storage/types.d.ts +0 -6
- package/lib/src/services/storage/types.d.ts.map +0 -1
- package/lib/src/services/storage/types.js +0 -2
- package/lib/src/services/storage/types.js.map +0 -1
- package/lib/src/services/toast.d.ts +0 -8
- package/lib/src/services/toast.d.ts.map +0 -1
- package/lib/src/services/toast.js +0 -11
- package/lib/src/services/toast.js.map +0 -1
- package/lib/src/store/document-model.d.ts +0 -3
- package/lib/src/store/document-model.d.ts.map +0 -1
- package/lib/src/store/document-model.js +0 -80
- package/lib/src/store/document-model.js.map +0 -1
- package/lib/src/store/editor.d.ts +0 -5
- package/lib/src/store/editor.d.ts.map +0 -1
- package/lib/src/store/editor.js +0 -31
- package/lib/src/store/editor.js.map +0 -1
- package/lib/src/store/external-packages.d.ts +0 -4
- package/lib/src/store/external-packages.d.ts.map +0 -1
- package/lib/src/store/external-packages.js +0 -36
- package/lib/src/store/external-packages.js.map +0 -1
- package/lib/src/store/index.d.ts +0 -7
- package/lib/src/store/index.d.ts.map +0 -1
- package/lib/src/store/index.js +0 -7
- package/lib/src/store/index.js.map +0 -1
- package/lib/src/store/reactor.d.ts +0 -3
- package/lib/src/store/reactor.d.ts.map +0 -1
- package/lib/src/store/reactor.js +0 -272
- package/lib/src/store/reactor.js.map +0 -1
- package/lib/src/store/user.d.ts +0 -2
- package/lib/src/store/user.d.ts.map +0 -1
- package/lib/src/store/user.js +0 -16
- package/lib/src/store/user.js.map +0 -1
- package/lib/src/store/utils.d.ts +0 -2
- package/lib/src/store/utils.d.ts.map +0 -1
- package/lib/src/store/utils.js +0 -59
- package/lib/src/store/utils.js.map +0 -1
- package/lib/src/utils/browser.d.ts +0 -2
- package/lib/src/utils/browser.d.ts.map +0 -1
- package/lib/src/utils/browser.js +0 -9
- package/lib/src/utils/browser.js.map +0 -1
- package/lib/src/utils/document-editor-debug-tools.d.ts +0 -17
- package/lib/src/utils/document-editor-debug-tools.d.ts.map +0 -1
- package/lib/src/utils/document-editor-debug-tools.js +0 -55
- package/lib/src/utils/document-editor-debug-tools.js.map +0 -1
- package/lib/src/utils/drive-preservation.d.ts +0 -19
- package/lib/src/utils/drive-preservation.d.ts.map +0 -1
- package/lib/src/utils/drive-preservation.js +0 -51
- package/lib/src/utils/drive-preservation.js.map +0 -1
- package/lib/src/utils/drive-sections.d.ts +0 -31
- package/lib/src/utils/drive-sections.d.ts.map +0 -1
- package/lib/src/utils/drive-sections.js +0 -63
- package/lib/src/utils/drive-sections.js.map +0 -1
- package/lib/src/utils/index.d.ts +0 -12
- package/lib/src/utils/index.d.ts.map +0 -1
- package/lib/src/utils/index.js +0 -12
- package/lib/src/utils/index.js.map +0 -1
- package/lib/src/utils/join.d.ts +0 -2
- package/lib/src/utils/join.d.ts.map +0 -1
- package/lib/src/utils/join.js +0 -11
- package/lib/src/utils/join.js.map +0 -1
- package/lib/src/utils/openUrl.d.ts +0 -2
- package/lib/src/utils/openUrl.d.ts.map +0 -1
- package/lib/src/utils/openUrl.js +0 -3
- package/lib/src/utils/openUrl.js.map +0 -1
- package/lib/src/utils/path.d.ts +0 -4
- package/lib/src/utils/path.d.ts.map +0 -1
- package/lib/src/utils/path.js +0 -17
- package/lib/src/utils/path.js.map +0 -1
- package/lib/src/utils/reactor.d.ts +0 -26
- package/lib/src/utils/reactor.d.ts.map +0 -1
- package/lib/src/utils/reactor.js +0 -115
- package/lib/src/utils/reactor.js.map +0 -1
- package/lib/src/utils/registerServiceWorker.d.ts +0 -12
- package/lib/src/utils/registerServiceWorker.d.ts.map +0 -1
- package/lib/src/utils/registerServiceWorker.js +0 -97
- package/lib/src/utils/registerServiceWorker.js.map +0 -1
- package/lib/src/utils/signature.d.ts +0 -4
- package/lib/src/utils/signature.d.ts.map +0 -1
- package/lib/src/utils/signature.js +0 -36
- package/lib/src/utils/signature.js.map +0 -1
- package/lib/src/utils/slug.d.ts +0 -2
- package/lib/src/utils/slug.d.ts.map +0 -1
- package/lib/src/utils/slug.js +0 -4
- package/lib/src/utils/slug.js.map +0 -1
- package/lib/src/workers/pglite-worker.d.ts +0 -2
- package/lib/src/workers/pglite-worker.d.ts.map +0 -1
- package/lib/src/workers/pglite-worker.js +0 -32
- package/lib/src/workers/pglite-worker.js.map +0 -1
- package/lib/test/utils/signer.test.d.ts +0 -2
- package/lib/test/utils/signer.test.d.ts.map +0 -1
- package/lib/test/utils/signer.test.js +0 -330
- package/lib/test/utils/signer.test.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/vite.config.d.ts +0 -3
- package/lib/vite.config.d.ts.map +0 -1
- package/lib/vite.config.js +0 -59
- package/lib/vite.config.js.map +0 -1
- package/lib/vitest.config.d.ts +0 -3
- package/lib/vitest.config.d.ts.map +0 -1
- package/lib/vitest.config.js +0 -8
- package/lib/vitest.config.js.map +0 -1
- package/nginx.conf +0 -77
- package/package.copy.json +0 -177
- package/src/index.css +0 -5
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { InspectorModal as ConnectInspectorModal } from "@powerhousedao/design-system/connect";
|
|
3
|
-
import { REACTOR_SCHEMA } from "@powerhousedao/reactor";
|
|
4
|
-
import { closePHModal, usePHModal } from "@powerhousedao/reactor-browser";
|
|
5
|
-
import { useDbExplorer } from "./useDbExplorer.js";
|
|
6
|
-
import { useRemotesInspector } from "./useRemotesInspector.js";
|
|
7
|
-
const DEFAULT_PAGE_SIZE = 25;
|
|
8
|
-
export const InspectorModal = () => {
|
|
9
|
-
const phModal = usePHModal();
|
|
10
|
-
const open = phModal?.type === "inspector";
|
|
11
|
-
const { getTables, getTableRows, getDefaultSort, onExportDb, onImportDb } = useDbExplorer();
|
|
12
|
-
const { getRemotes } = useRemotesInspector();
|
|
13
|
-
return (_jsx(ConnectInspectorModal, { open: open, onOpenChange: (status) => {
|
|
14
|
-
if (!status)
|
|
15
|
-
closePHModal();
|
|
16
|
-
}, dbExplorerProps: {
|
|
17
|
-
schema: REACTOR_SCHEMA,
|
|
18
|
-
getTables,
|
|
19
|
-
getTableRows,
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
21
|
-
getDefaultSort,
|
|
22
|
-
pageSize: DEFAULT_PAGE_SIZE,
|
|
23
|
-
onExportDb,
|
|
24
|
-
onImportDb,
|
|
25
|
-
}, remotesInspectorProps: {
|
|
26
|
-
getRemotes,
|
|
27
|
-
} }));
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=InspectorModal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InspectorModal.js","sourceRoot":"","sources":["../../../../../../src/components/modal/modals/InspectorModal/InspectorModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,MAAM,CAAC,MAAM,cAAc,GAAa,GAAG,EAAE;IAC3C,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,KAAK,WAAW,CAAC;IAE3C,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,GACvE,aAAa,EAAE,CAAC;IAClB,MAAM,EAAE,UAAU,EAAE,GAAG,mBAAmB,EAAE,CAAC;IAE7C,OAAO,CACL,KAAC,qBAAqB,IACpB,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE;YACvB,IAAI,CAAC,MAAM;gBAAE,YAAY,EAAE,CAAC;QAC9B,CAAC,EACD,eAAe,EAAE;YACf,MAAM,EAAE,cAAc;YACtB,SAAS;YACT,YAAY;YACZ,mEAAmE;YACnE,cAAc;YACd,QAAQ,EAAE,iBAAiB;YAC3B,UAAU;YACV,UAAU;SACX,EACD,qBAAqB,EAAE;YACrB,UAAU;SACX,GACD,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/modal/modals/InspectorModal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/modal/modals/InspectorModal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { FilterGroup, SortOptions } from "@powerhousedao/design-system/connect";
|
|
2
|
-
type ColumnInfo = {
|
|
3
|
-
readonly name: string;
|
|
4
|
-
readonly dataType: string;
|
|
5
|
-
readonly isNullable: boolean;
|
|
6
|
-
};
|
|
7
|
-
type TableInfo = {
|
|
8
|
-
readonly name: string;
|
|
9
|
-
readonly columns: ColumnInfo[];
|
|
10
|
-
};
|
|
11
|
-
type GetTableRowsOptions = {
|
|
12
|
-
readonly schema?: string;
|
|
13
|
-
readonly limit: number;
|
|
14
|
-
readonly offset: number;
|
|
15
|
-
readonly sort?: SortOptions;
|
|
16
|
-
readonly filters?: FilterGroup;
|
|
17
|
-
};
|
|
18
|
-
type TablePage = {
|
|
19
|
-
readonly columns: string[];
|
|
20
|
-
readonly rows: Record<string, unknown>[];
|
|
21
|
-
readonly total: number | null;
|
|
22
|
-
};
|
|
23
|
-
export declare function useDbExplorer(): {
|
|
24
|
-
getTables: () => Promise<TableInfo[]>;
|
|
25
|
-
getTableRows: (table: string, options: GetTableRowsOptions) => Promise<TablePage>;
|
|
26
|
-
getDefaultSort: (table: string) => SortOptions | undefined;
|
|
27
|
-
onExportDb: () => Promise<void>;
|
|
28
|
-
onImportDb: (sqlContent: string) => Promise<void>;
|
|
29
|
-
};
|
|
30
|
-
export {};
|
|
31
|
-
//# sourceMappingURL=useDbExplorer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDbExplorer.d.ts","sourceRoot":"","sources":["../../../../../../src/components/modal/modals/InspectorModal/useDbExplorer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACZ,MAAM,sCAAsC,CAAC;AAM9C,KAAK,UAAU,GAAG;IAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC;CAChC,CAAC;AASF,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;CAChC,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC;AAWF,wBAAgB,aAAa;qBAIa,OAAO,CAAC,SAAS,EAAE,CAAC;0BAmD5C,MAAM,WAAW,mBAAmB,KAAG,OAAO,CAAC,SAAS,CAAC;4BA0K/D,MAAM,KAAG,WAAW,GAAG,SAAS;;6BAfrB,MAAM;EA+B5B"}
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import { pgDump } from "@electric-sql/pglite-tools/pg_dump";
|
|
2
|
-
import { REACTOR_SCHEMA } from "@powerhousedao/reactor";
|
|
3
|
-
import { useDatabase, usePGlite } from "@powerhousedao/reactor-browser/connect";
|
|
4
|
-
import { sql } from "kysely";
|
|
5
|
-
import { useCallback } from "react";
|
|
6
|
-
const PRIORITY_COLUMNS = [
|
|
7
|
-
"documentType",
|
|
8
|
-
"documentId",
|
|
9
|
-
"scope",
|
|
10
|
-
"branch",
|
|
11
|
-
"index",
|
|
12
|
-
"skip",
|
|
13
|
-
];
|
|
14
|
-
export function useDbExplorer() {
|
|
15
|
-
const database = useDatabase();
|
|
16
|
-
const pglite = usePGlite();
|
|
17
|
-
const getTables = useCallback(async () => {
|
|
18
|
-
if (!database)
|
|
19
|
-
return [];
|
|
20
|
-
const result = await sql `
|
|
21
|
-
SELECT
|
|
22
|
-
c.table_name,
|
|
23
|
-
c.column_name,
|
|
24
|
-
c.data_type,
|
|
25
|
-
c.is_nullable
|
|
26
|
-
FROM information_schema.columns c
|
|
27
|
-
INNER JOIN information_schema.tables t
|
|
28
|
-
ON c.table_name = t.table_name
|
|
29
|
-
AND c.table_schema = t.table_schema
|
|
30
|
-
WHERE c.table_schema = ${REACTOR_SCHEMA}
|
|
31
|
-
AND t.table_type = 'BASE TABLE'
|
|
32
|
-
ORDER BY c.table_name, c.ordinal_position
|
|
33
|
-
`.execute(database);
|
|
34
|
-
const tableMap = new Map();
|
|
35
|
-
for (const row of result.rows) {
|
|
36
|
-
if (!tableMap.has(row.table_name)) {
|
|
37
|
-
tableMap.set(row.table_name, []);
|
|
38
|
-
}
|
|
39
|
-
tableMap.get(row.table_name).push({
|
|
40
|
-
name: row.column_name,
|
|
41
|
-
dataType: row.data_type,
|
|
42
|
-
isNullable: row.is_nullable === "YES",
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
return Array.from(tableMap).map(([name, columns]) => {
|
|
46
|
-
const columnNames = columns.map((col) => col.name);
|
|
47
|
-
const orderedColumns = [
|
|
48
|
-
...PRIORITY_COLUMNS.filter((col) => columnNames.includes(col)).map((col) => columns.find((c) => c.name === col)),
|
|
49
|
-
...columns.filter((col) => !PRIORITY_COLUMNS.includes(col.name)),
|
|
50
|
-
];
|
|
51
|
-
return {
|
|
52
|
-
name,
|
|
53
|
-
columns: orderedColumns,
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
}, [database]);
|
|
57
|
-
const getTableRows = useCallback(async (table, options) => {
|
|
58
|
-
if (!database) {
|
|
59
|
-
return { columns: [], rows: [], total: null };
|
|
60
|
-
}
|
|
61
|
-
const limit = options.limit;
|
|
62
|
-
const offset = options.offset;
|
|
63
|
-
const sort = options.sort;
|
|
64
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
65
|
-
const filters = options.filters;
|
|
66
|
-
const tableRef = sql.raw(`${REACTOR_SCHEMA}."${table}"`);
|
|
67
|
-
// Build WHERE clause from filters
|
|
68
|
-
let whereClause = sql ``;
|
|
69
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
70
|
-
if (filters?.clauses && filters.clauses.length > 0) {
|
|
71
|
-
const conditions = [];
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
73
|
-
for (let i = 0; i < filters.clauses.length; i++) {
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment
|
|
75
|
-
const clause = filters.clauses[i];
|
|
76
|
-
if (!clause)
|
|
77
|
-
continue;
|
|
78
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
79
|
-
const columnRef = sql.raw(`"${clause.column}"`);
|
|
80
|
-
let condition;
|
|
81
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
82
|
-
if (clause.operator === "IS NULL") {
|
|
83
|
-
condition = sql `${columnRef} IS NULL`;
|
|
84
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
85
|
-
}
|
|
86
|
-
else if (clause.operator === "IS NOT NULL") {
|
|
87
|
-
condition = sql `${columnRef} IS NOT NULL`;
|
|
88
|
-
}
|
|
89
|
-
else if (
|
|
90
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
91
|
-
clause.operator === "LIKE" ||
|
|
92
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
93
|
-
clause.operator === "ILIKE") {
|
|
94
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment
|
|
95
|
-
const value = clause.value;
|
|
96
|
-
const operator =
|
|
97
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
98
|
-
clause.operator === "LIKE" ? sql `LIKE` : sql `ILIKE`;
|
|
99
|
-
condition = sql `${columnRef} ${operator} ${value}`;
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
// For =, !=, >, <, >=, <=
|
|
103
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
|
104
|
-
const operator = sql.raw(clause.operator);
|
|
105
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment
|
|
106
|
-
const value = clause.value;
|
|
107
|
-
// Try to parse as number if it looks like a number
|
|
108
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
109
|
-
let parsedValue = value;
|
|
110
|
-
if (value !== "" &&
|
|
111
|
-
!isNaN(Number(value)) &&
|
|
112
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
113
|
-
value.trim() !== "") {
|
|
114
|
-
parsedValue = Number(value);
|
|
115
|
-
}
|
|
116
|
-
condition = sql `${columnRef} ${operator} ${parsedValue}`;
|
|
117
|
-
}
|
|
118
|
-
conditions.push(condition);
|
|
119
|
-
// Add connector if not the last clause
|
|
120
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
121
|
-
if (i < filters.clauses.length - 1) {
|
|
122
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment
|
|
123
|
-
const connector = filters.connectors?.[i] ?? "AND";
|
|
124
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
125
|
-
conditions.push(sql.raw(connector));
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
// Combine all conditions
|
|
129
|
-
if (conditions.length > 0) {
|
|
130
|
-
whereClause = sql `WHERE ${sql.join(conditions, sql ` `)}`;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
// Build main query
|
|
134
|
-
let query;
|
|
135
|
-
if (sort) {
|
|
136
|
-
const columnRef = sql.raw(`"${sort.column}"`);
|
|
137
|
-
const direction = sort.direction === "desc" ? sql `DESC` : sql `ASC`;
|
|
138
|
-
query = sql `
|
|
139
|
-
SELECT * FROM ${tableRef}
|
|
140
|
-
${whereClause}
|
|
141
|
-
ORDER BY ${columnRef} ${direction}
|
|
142
|
-
LIMIT ${limit} OFFSET ${offset}
|
|
143
|
-
`;
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
query = sql `
|
|
147
|
-
SELECT * FROM ${tableRef}
|
|
148
|
-
${whereClause}
|
|
149
|
-
LIMIT ${limit} OFFSET ${offset}
|
|
150
|
-
`;
|
|
151
|
-
}
|
|
152
|
-
const result = await query.execute(database);
|
|
153
|
-
// Build count query with same filters
|
|
154
|
-
const countQuery = sql `
|
|
155
|
-
SELECT COUNT(*) as count FROM ${tableRef}
|
|
156
|
-
${whereClause}
|
|
157
|
-
`;
|
|
158
|
-
const countResult = await countQuery.execute(database);
|
|
159
|
-
const total = countResult.rows[0]
|
|
160
|
-
? parseInt(countResult.rows[0].count, 10)
|
|
161
|
-
: null;
|
|
162
|
-
const rawColumns = result.rows.length > 0 ? Object.keys(result.rows[0]) : [];
|
|
163
|
-
const columns = [
|
|
164
|
-
...PRIORITY_COLUMNS.filter((col) => rawColumns.includes(col)),
|
|
165
|
-
...rawColumns.filter((col) => !PRIORITY_COLUMNS.includes(col)),
|
|
166
|
-
];
|
|
167
|
-
return {
|
|
168
|
-
columns,
|
|
169
|
-
rows: result.rows,
|
|
170
|
-
total,
|
|
171
|
-
};
|
|
172
|
-
}, [database]);
|
|
173
|
-
const onExportDb = useCallback(async () => {
|
|
174
|
-
if (!pglite)
|
|
175
|
-
return;
|
|
176
|
-
const dump = await pgDump({ pg: pglite });
|
|
177
|
-
const sqlContent = await dump.text();
|
|
178
|
-
const blob = new Blob([sqlContent], { type: "text/sql" });
|
|
179
|
-
const url = URL.createObjectURL(blob);
|
|
180
|
-
const a = document.createElement("a");
|
|
181
|
-
a.href = url;
|
|
182
|
-
a.download = `database-export-${Date.now()}.sql`;
|
|
183
|
-
a.click();
|
|
184
|
-
URL.revokeObjectURL(url);
|
|
185
|
-
}, [pglite]);
|
|
186
|
-
const onImportDb = useCallback(async (sqlContent) => {
|
|
187
|
-
if (!pglite)
|
|
188
|
-
return;
|
|
189
|
-
// Use explicit transaction to ensure writable transaction context
|
|
190
|
-
await pglite.transaction(async (tx) => {
|
|
191
|
-
await tx.exec(`DROP SCHEMA ${REACTOR_SCHEMA} CASCADE`);
|
|
192
|
-
await tx.exec(`CREATE SCHEMA ${REACTOR_SCHEMA}`);
|
|
193
|
-
await tx.exec(sqlContent);
|
|
194
|
-
await tx.exec(`SET search_path TO ${REACTOR_SCHEMA}`);
|
|
195
|
-
});
|
|
196
|
-
}, [pglite]);
|
|
197
|
-
const getDefaultSort = useCallback((table) => {
|
|
198
|
-
if (table === "Operation") {
|
|
199
|
-
return { column: "timestampUtcMs", direction: "desc" };
|
|
200
|
-
}
|
|
201
|
-
return undefined;
|
|
202
|
-
}, []);
|
|
203
|
-
return {
|
|
204
|
-
getTables,
|
|
205
|
-
getTableRows,
|
|
206
|
-
getDefaultSort,
|
|
207
|
-
onExportDb,
|
|
208
|
-
onImportDb,
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
//# sourceMappingURL=useDbExplorer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDbExplorer.js","sourceRoot":"","sources":["../../../../../../src/components/modal/modals/InspectorModal/useDbExplorer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAK5D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,SAA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AAE,CAAC,IAAI,CAAC,iBAAiB,cAAc,EAAE,CAAC,CAAC;YACjD,MAAM,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC1B,MAAM,EAAE,CAAC,IAAI,CAAC,sBAAsB,cAAc,EAAE,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC,EACD,CAAC,MAAM,CAAC,CACT,CAAC;IAEF,MAAM,cAAc,GAAG,WAAW,CAChC,CAAC,KAAa,EAA2B,EAAE;QACzC,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC;YAC1B,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QACzD,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,EACD,EAAE,CACH,CAAC;IAEF,OAAO;QACL,SAAS;QACT,YAAY;QACZ,cAAc;QACd,UAAU;QACV,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRemotesInspector.d.ts","sourceRoot":"","sources":["../../../../../../src/components/modal/modals/InspectorModal/useRemotesInspector.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB;;EAUlC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useSync } from "@powerhousedao/reactor-browser/connect";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
export function useRemotesInspector() {
|
|
4
|
-
const syncManager = useSync();
|
|
5
|
-
const getRemotes = useCallback(() => {
|
|
6
|
-
return Promise.resolve(syncManager?.list() ?? []);
|
|
7
|
-
}, [syncManager]);
|
|
8
|
-
return {
|
|
9
|
-
getRemotes,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=useRemotesInspector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRemotesInspector.js","sourceRoot":"","sources":["../../../../../../src/components/modal/modals/InspectorModal/useRemotesInspector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,MAAM,UAAU,mBAAmB;IACjC,MAAM,WAAW,GAAG,OAAO,EAAE,CAAC;IAE9B,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE;QAClC,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,OAAO;QACL,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/modal/modals/SettingsModal.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EA+CjC,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { About, ConnectPackageManager, DangerZone, DefaultEditor, } from "@powerhousedao/connect/components";
|
|
3
|
-
import { Icon } from "@powerhousedao/design-system";
|
|
4
|
-
import { SettingsModal as SettingsModalV2 } from "@powerhousedao/design-system/connect";
|
|
5
|
-
import { closePHModal, usePHModal } from "@powerhousedao/reactor-browser";
|
|
6
|
-
import { t } from "i18next";
|
|
7
|
-
import React, { useMemo } from "react";
|
|
8
|
-
export const SettingsModal = () => {
|
|
9
|
-
const phModal = usePHModal();
|
|
10
|
-
const open = phModal?.type === "settings";
|
|
11
|
-
function onRefresh() {
|
|
12
|
-
window.location.reload();
|
|
13
|
-
}
|
|
14
|
-
const tabs = useMemo(() => [
|
|
15
|
-
{
|
|
16
|
-
id: "package-manager",
|
|
17
|
-
icon: _jsx(Icon, { name: "PackageManager", size: 12 }),
|
|
18
|
-
label: "Package Manager",
|
|
19
|
-
content: ConnectPackageManager,
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
id: "default-editors",
|
|
23
|
-
icon: _jsx(Icon, { name: "Edit", size: 12 }),
|
|
24
|
-
label: "Default Editors",
|
|
25
|
-
content: DefaultEditor,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
id: "danger-zone",
|
|
29
|
-
icon: _jsx(Icon, { name: "Danger", size: 12, className: "text-red-900" }),
|
|
30
|
-
label: _jsx("span", { className: "text-red-900", children: "Danger Zone" }),
|
|
31
|
-
content: () => _jsx(DangerZone, {}),
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
id: "about",
|
|
35
|
-
icon: _jsx(Icon, { name: "QuestionSquare", size: 12 }),
|
|
36
|
-
label: "About",
|
|
37
|
-
content: About,
|
|
38
|
-
},
|
|
39
|
-
], [onRefresh]);
|
|
40
|
-
return (_jsx(SettingsModalV2, { open: open, title: t("modals.connectSettings.title"), onOpenChange: (status) => {
|
|
41
|
-
if (!status)
|
|
42
|
-
return closePHModal();
|
|
43
|
-
}, tabs: tabs }));
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=SettingsModal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsModal.js","sourceRoot":"","sources":["../../../../../src/components/modal/modals/SettingsModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,KAAK,EACL,qBAAqB,EACrB,UAAU,EACV,aAAa,GACd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,SAAS,CAAC;AAC5B,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OA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AE,EAAE;YAChC,IAAI,CAAC,MAAM;gBAAE,OAAO,YAAY,EAAE,CAAC;QACrC,CAAC,EACD,IAAI,EAAE,IAAI,GACV,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UpgradeDriveModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/modal/modals/UpgradeDriveModal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EA0BrC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ConnectUpgradeDriveModal } from "@powerhousedao/design-system/connect";
|
|
3
|
-
import { closePHModal, usePHModal } from "@powerhousedao/reactor-browser";
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
export const UpgradeDriveModal = () => {
|
|
7
|
-
const phModal = usePHModal();
|
|
8
|
-
const open = phModal?.type === "upgradeDrive";
|
|
9
|
-
const driveId = open ? phModal.driveId : undefined;
|
|
10
|
-
const { t } = useTranslation();
|
|
11
|
-
const onContinue = () => {
|
|
12
|
-
// TODO: Implement upgrade drive
|
|
13
|
-
console.log("Upgrade drive: ", driveId);
|
|
14
|
-
closePHModal();
|
|
15
|
-
};
|
|
16
|
-
return (_jsx(ConnectUpgradeDriveModal, { open: open, onContinue: onContinue, header: t("modals.upgradeDrive.header"), body: t("modals.upgradeDrive.body"), cancelLabel: t("common.cancel"), continueLabel: t("common.continue"), onOpenChange: (status) => {
|
|
17
|
-
if (!status)
|
|
18
|
-
return closePHModal();
|
|
19
|
-
} }));
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=UpgradeDriveModal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UpgradeDriveModal.js","sourceRoot":"","sources":["../../../../../src/components/modal/modals/UpgradeDriveModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAAa,GAAG,EAAE;IAC9C,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,KAAK,cAAc,CAAC;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAEnD,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAC;IAE/B,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,gCAAgC;QAChC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;QACxC,YAAY,EAAE,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,wBAAwB,IACvB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,CAAC,CAAC,4BAA4B,CAAC,EACvC,IAAI,EAAE,CAAC,CAAC,0BAA0B,CAAC,EACnC,WAAW,EAAE,CAAC,CAAC,eAAe,CAAC,EAC/B,aAAa,EAAE,CAAC,CAAC,iBAAiB,CAAC,EACnC,YAAY,EAAE,CAAC,MAAe,EAAE,EAAE;YAChC,IAAI,CAAC,MAAM;gBAAE,OAAO,YAAY,EAAE,CAAC;QACrC,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"about.d.ts","sourceRoot":"","sources":["../../../../../../src/components/modal/modals/settings/about.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAWzB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { connectConfig } from "@powerhousedao/connect/config";
|
|
3
|
-
import packageJson from "@powerhousedao/connect/package.json" with { type: "json" };
|
|
4
|
-
import { About as BaseAbout } from "@powerhousedao/design-system/connect";
|
|
5
|
-
export const About = () => {
|
|
6
|
-
return (_jsx(BaseAbout, { packageJson: packageJson, phCliVersion: typeof connectConfig.phCliVersion === "string"
|
|
7
|
-
? connectConfig.phCliVersion
|
|
8
|
-
: undefined }));
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=about.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"about.js","sourceRoot":"","sources":["../../../../../../src/components/modal/modals/settings/about.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,WAAW,MAAM,qCAAqC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACpF,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAE1E,MAAM,CAAC,MAAM,KAAK,GAAa,GAAG,EAAE;IAClC,OAAO,CACL,KAAC,SAAS,IACR,WAAW,EAAE,WAAW,EACxB,YAAY,EACV,OAAO,aAAa,CAAC,YAAY,KAAK,QAAQ;YAC5C,CAAC,CAAC,aAAa,CAAC,YAAY;YAC5B,CAAC,CAAC,SAAS,GAEf,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"danger-zone.d.ts","sourceRoot":"","sources":["../../../../../../src/components/modal/modals/settings/danger-zone.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAmB9B,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { DangerZone as BaseDangerZone } from "@powerhousedao/design-system/connect";
|
|
3
|
-
import { deleteDrive, setSelectedDrive, showPHModal, useDrives, } from "@powerhousedao/reactor-browser";
|
|
4
|
-
export const DangerZone = () => {
|
|
5
|
-
const drives = useDrives();
|
|
6
|
-
const handleDeleteDrive = async (drive) => {
|
|
7
|
-
await deleteDrive(drive.header.id);
|
|
8
|
-
setSelectedDrive(undefined);
|
|
9
|
-
};
|
|
10
|
-
const handleClearStorage = () => {
|
|
11
|
-
showPHModal({ type: "clearStorage" });
|
|
12
|
-
};
|
|
13
|
-
return (_jsx(BaseDangerZone, { drives: drives ?? [], onDeleteDrive: handleDeleteDrive, onClearStorage: handleClearStorage }));
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=danger-zone.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"danger-zone.js","sourceRoot":"","sources":["../../../../../../src/components/modal/modals/settings/danger-zone.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,SAAS,GACV,MAAM,gCAAgC,CAAC;AAGxC,MAAM,CAAC,MAAM,UAAU,GAAa,GAAG,EAAE;IACvC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,MAAM,iBAAiB,GAAG,KAAK,EAAE,KAA4B,EAAE,EAAE;QAC/D,MAAM,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACnC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC,CAAC;IAEF,MAAM,kBAAkB,GAAG,GAAG,EAAE;QAC9B,WAAW,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IACxC,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,cAAc,IACb,MAAM,EAAE,MAAM,IAAI,EAAE,EACpB,aAAa,EAAE,iBAAiB,EAChC,cAAc,EAAE,kBAAkB,GAClC,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-editor.d.ts","sourceRoot":"","sources":["../../../../../../src/components/modal/modals/settings/default-editor.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAwBjC,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { DefaultEditor as BaseDefaultEditor } from "@powerhousedao/design-system/connect";
|
|
3
|
-
import { useCallback, useState } from "react";
|
|
4
|
-
const documentModelEditorOptions = [
|
|
5
|
-
{ label: "V1", value: "document-model-editor" },
|
|
6
|
-
{ label: "V2", value: "document-model-editor-v2" },
|
|
7
|
-
];
|
|
8
|
-
export const DefaultEditor = () => {
|
|
9
|
-
const [documentModelEditor, setDocumentModelEditor] = useState(documentModelEditorOptions[1]);
|
|
10
|
-
const handleSetDocumentEditor = useCallback((value) => {
|
|
11
|
-
const option = documentModelEditorOptions.find((dm) => dm.value == value);
|
|
12
|
-
if (option) {
|
|
13
|
-
setDocumentModelEditor(option);
|
|
14
|
-
}
|
|
15
|
-
}, []);
|
|
16
|
-
return (_jsx(BaseDefaultEditor, { documentModelEditor: documentModelEditor.value, setDocumentModelEditor: handleSetDocumentEditor, documentModelEditorOptions: documentModelEditorOptions }));
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=default-editor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-editor.js","sourceRoot":"","sources":["../../../../../../src/components/modal/modals/settings/default-editor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,MAAM,0BAA0B,GAAG;IACjC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,uBAAuB,EAAE;IAC/C,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,0BAA0B,EAAE;CAC1C,CAAC;AAEX,MAAM,CAAC,MAAM,aAAa,GAAa,GAAG,EAAE;IAC1C,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,QAAQ,CAE5D,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjC,MAAM,uBAAuB,GAAG,WAAW,CAAC,CAAC,KAAa,EAAE,EAAE;QAC5D,MAAM,MAAM,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC;QAC1E,IAAI,MAAM,EAAE,CAAC;YACX,sBAAsB,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,KAAC,iBAAiB,IAChB,mBAAmB,EAAE,mBAAmB,CAAC,KAAK,EAC9C,sBAAsB,EAAE,uBAAuB,EAC/C,0BAA0B,EACxB,0BAGG,GAEL,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-manager.d.ts","sourceRoot":"","sources":["../../../../../../src/components/modal/modals/settings/package-manager.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAoD,MAAM,OAAO,CAAC;AA6BzE,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAqGzC,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { PH_PACKAGES } from "@powerhousedao/config";
|
|
3
|
-
import { addExternalPackage, removeExternalPackage, } from "@powerhousedao/connect/services";
|
|
4
|
-
import { PackageManager } from "@powerhousedao/design-system/connect";
|
|
5
|
-
import { makeVetraPackageManifest, useDrives, useVetraPackages, } from "@powerhousedao/reactor-browser";
|
|
6
|
-
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
7
|
-
const LOCAL_REACTOR_VALUE = "local-reactor";
|
|
8
|
-
const LOCAL_REACTOR_LABEL = "Local Reactor";
|
|
9
|
-
function manifestToDetails(manifest, id, removable) {
|
|
10
|
-
if (!manifest) {
|
|
11
|
-
return undefined;
|
|
12
|
-
}
|
|
13
|
-
const documentModels = manifest.documentModels?.map((dm) => `Document Model: ${dm.name}`) ?? [];
|
|
14
|
-
const editors = manifest.editors?.map((editor) => `Editor: ${editor.name}`) ?? [];
|
|
15
|
-
const apps = manifest.apps?.map((app) => `App: ${app.name}`) ?? [];
|
|
16
|
-
return {
|
|
17
|
-
id,
|
|
18
|
-
...manifest,
|
|
19
|
-
publisher: manifest.publisher.name,
|
|
20
|
-
publisherUrl: manifest.publisher.url,
|
|
21
|
-
modules: documentModels.concat(editors).concat(apps),
|
|
22
|
-
removable,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export const ConnectPackageManager = () => {
|
|
26
|
-
const vetraPackages = useVetraPackages();
|
|
27
|
-
const drives = useDrives();
|
|
28
|
-
const [reactor, setReactor] = useState("");
|
|
29
|
-
const options = useMemo(() => {
|
|
30
|
-
return drives?.reduce((acc, drive) => {
|
|
31
|
-
const trigger = drive.state.local.triggers.find((trigger) => trigger.data?.url);
|
|
32
|
-
if (!trigger?.data?.url) {
|
|
33
|
-
return acc;
|
|
34
|
-
}
|
|
35
|
-
const value = trigger.data.url;
|
|
36
|
-
const label = drive.state.global.name;
|
|
37
|
-
acc.push({
|
|
38
|
-
value,
|
|
39
|
-
label,
|
|
40
|
-
disabled: true,
|
|
41
|
-
});
|
|
42
|
-
return acc;
|
|
43
|
-
}, [
|
|
44
|
-
{
|
|
45
|
-
value: LOCAL_REACTOR_VALUE,
|
|
46
|
-
label: LOCAL_REACTOR_LABEL,
|
|
47
|
-
disabled: false,
|
|
48
|
-
},
|
|
49
|
-
]);
|
|
50
|
-
}, [drives]);
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
setReactor((reactor) => {
|
|
53
|
-
const defaultOption = options?.find((option) => !option.disabled);
|
|
54
|
-
if (reactor && options?.find((option) => option.value === reactor)) {
|
|
55
|
-
return reactor;
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
return defaultOption?.value ?? "";
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}, [reactor, options]);
|
|
62
|
-
const packagesInfo = vetraPackages?.map((pkg) => makeVetraPackageManifest(pkg));
|
|
63
|
-
const handleReactorChange = useCallback((reactor) => setReactor(reactor ?? ""), []);
|
|
64
|
-
const handleInstall = useCallback((packageName) => {
|
|
65
|
-
if (reactor !== LOCAL_REACTOR_VALUE) {
|
|
66
|
-
throw new Error("Cannot install external package on a remote reactor");
|
|
67
|
-
}
|
|
68
|
-
return addExternalPackage(packageName);
|
|
69
|
-
}, [reactor]);
|
|
70
|
-
const handleUninstall = useCallback((packageName) => {
|
|
71
|
-
if (reactor !== LOCAL_REACTOR_VALUE) {
|
|
72
|
-
throw new Error("Cannot delete external package on a remote reactor");
|
|
73
|
-
}
|
|
74
|
-
return removeExternalPackage(packageName);
|
|
75
|
-
}, [reactor]);
|
|
76
|
-
return (_jsx(PackageManager, { mutable: true, reactorOptions: options ?? [], reactor: reactor, packages: packagesInfo?.map((pkg) => ({
|
|
77
|
-
id: pkg.id,
|
|
78
|
-
name: pkg.name,
|
|
79
|
-
description: pkg.description,
|
|
80
|
-
category: pkg.category,
|
|
81
|
-
publisher: pkg.author.name,
|
|
82
|
-
publisherUrl: pkg.author.website ?? "",
|
|
83
|
-
modules: Object.values(pkg.modules).flatMap((modules) => modules.map((module) => module.name)),
|
|
84
|
-
removable: true,
|
|
85
|
-
})) ?? [], onReactorChange: handleReactorChange, onInstall: handleInstall, onUninstall: handleUninstall, packageOptions: PH_PACKAGES }));
|
|
86
|
-
};
|
|
87
|
-
//# sourceMappingURL=package-manager.js.map
|