@powerhousedao/connect 6.2.2-dev.22 → 6.2.2-dev.23
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/dist/{ClearStorageModal-DREBBOjF.js → ClearStorageModal-DIgifY7S.js} +4 -4
- package/dist/{ClearStorageModal-DREBBOjF.js.map → ClearStorageModal-DIgifY7S.js.map} +1 -1
- package/dist/{DebugSettingsModal-m_nU1LoA.js → DebugSettingsModal-D4CdZtB_.js} +4 -4
- package/dist/{DebugSettingsModal-m_nU1LoA.js.map → DebugSettingsModal-D4CdZtB_.js.map} +1 -1
- package/dist/{DriveAuthRequiredModal-DSM6uNlb.js → DriveAuthRequiredModal-CRFBGrcx.js} +4 -4
- package/dist/{DriveAuthRequiredModal-DSM6uNlb.js.map → DriveAuthRequiredModal-CRFBGrcx.js.map} +1 -1
- package/dist/{InspectorModal-CV9uqn0p.js → InspectorModal-IxyRcTFV.js} +4 -4
- package/dist/{InspectorModal-CV9uqn0p.js.map → InspectorModal-IxyRcTFV.js.map} +1 -1
- package/dist/{LoginModal-BGTKLJx0.js → LoginModal-B6ZwgiO1.js} +4 -4
- package/dist/{LoginModal-BGTKLJx0.js.map → LoginModal-B6ZwgiO1.js.map} +1 -1
- package/dist/{OpenFileDocumentsModal-C95lcnWB.js → OpenFileDocumentsModal-C4bpVasz.js} +4 -4
- package/dist/{OpenFileDocumentsModal-C95lcnWB.js.map → OpenFileDocumentsModal-C4bpVasz.js.map} +1 -1
- package/dist/{SettingsModal-C6J05Meq.js → SettingsModal-BEV0jFw1.js} +5 -5
- package/dist/{SettingsModal-C6J05Meq.js.map → SettingsModal-BEV0jFw1.js.map} +1 -1
- package/dist/{app-loader-2Q4mBzB0.js → app-loader-Cqq42L7A.js} +16 -15
- package/dist/app-loader-Cqq42L7A.js.map +1 -0
- package/dist/app-loader-DMfFpj4p.js +4 -0
- package/dist/{build-info-DA55E15v.js → build-info-D98hbIth.js} +5 -5
- package/dist/{build-info-DA55E15v.js.map → build-info-D98hbIth.js.map} +1 -1
- package/dist/{components-Cv0BOuPq.js → components-BjIaRHuq.js} +3 -3
- package/dist/{load-C4_Yxt4t.js → load-BYslkuqN.js} +5 -5
- package/dist/{load-C4_Yxt4t.js.map → load-BYslkuqN.js.map} +1 -1
- package/dist/main.js +1 -1
- package/dist/{package-UXkxpeKD.js → package-DNX1H93i.js} +4 -4
- package/dist/package-DNX1H93i.js.map +1 -0
- package/dist/{reactor-ysgsKV28.js → reactor-DsbeOt8y.js} +4 -4
- package/dist/{reactor-ysgsKV28.js.map → reactor-DsbeOt8y.js.map} +1 -1
- package/dist/start-connect.js +1 -1
- package/dist/use-renown-login-DBdWV-o8.js +88 -0
- package/dist/use-renown-login-DBdWV-o8.js.map +1 -0
- package/package.json +11 -11
- package/dist/app-loader-2Q4mBzB0.js.map +0 -1
- package/dist/app-loader-CyH0iUy6.js +0 -4
- package/dist/package-UXkxpeKD.js.map +0 -1
- package/dist/use-renown-login-DBujbqs8.js +0 -55
- package/dist/use-renown-login-DBujbqs8.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { t as clearReactorStorage } from "./reactor-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6aff1b5f-5a64-53a2-a6e1-2b5d9011da28")}catch(e){}}();
|
|
3
|
+
import { t as clearReactorStorage } from "./reactor-DsbeOt8y.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
6
|
import { useState } from "react";
|
|
@@ -42,5 +42,5 @@ function ClearStorageModal() {
|
|
|
42
42
|
//#endregion
|
|
43
43
|
export { ClearStorageModal };
|
|
44
44
|
|
|
45
|
-
//# sourceMappingURL=ClearStorageModal-
|
|
46
|
-
//# debugId=
|
|
45
|
+
//# sourceMappingURL=ClearStorageModal-DIgifY7S.js.map
|
|
46
|
+
//# debugId=6aff1b5f-5a64-53a2-a6e1-2b5d9011da28
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClearStorageModal-
|
|
1
|
+
{"version":3,"file":"ClearStorageModal-DIgifY7S.js","sources":["../src/components/modal/modals/ClearStorageModal.tsx"],"sourcesContent":["import { clearReactorStorage } from \"@powerhousedao/connect/store\";\nimport { ConnectConfirmationModal } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n setSelectedDrive,\n setSelectedNode,\n showPHModal,\n usePHModal,\n} from \"@powerhousedao/reactor-browser\";\nimport { childLogger } from \"document-model\";\nimport { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nconst logger = childLogger([\"ClearStorage\"]);\n\nexport function ClearStorageModal() {\n const phModal = usePHModal();\n const open = phModal?.type === \"clearStorage\";\n const { t } = useTranslation();\n const [loading, setLoading] = useState(false);\n\n function clearStorage() {\n setLoading(true);\n clearReactorStorage()\n .then(() => {\n logger.info(\"Storage cleared\");\n setSelectedDrive(undefined);\n setSelectedNode(undefined);\n window.location.reload();\n })\n .catch((error) => {\n logger.error(\"Error clearing storage: @error\", error);\n setLoading(false);\n });\n }\n\n return (\n <ConnectConfirmationModal\n open={open}\n header={t(\"modals.connectSettings.clearStorage.confirmation.title\")}\n body={t(\"modals.connectSettings.clearStorage.confirmation.body\")}\n cancelLabel={t(\"common.cancel\")}\n continueLabel={t(\n \"modals.connectSettings.clearStorage.confirmation.clearButton\",\n )}\n onCancel={() => showPHModal({ type: \"settings\" })}\n onContinue={clearStorage}\n onOpenChange={(status: boolean) => {\n if (!status) return closePHModal();\n }}\n continueDisabled={loading}\n />\n );\n}\n"],"names":["logger"],"mappings":";;;;;;;;;;AAaA,MAAMA,WAAS,YAAY,CAAC,eAAe,CAAC;AAE5C,SAAgB,oBAAoB;CAElC,MAAM,OADU,YAAY,EACN,SAAS;CAC/B,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAE7C,SAAS,eAAe;AACtB,aAAW,KAAK;AAChB,uBAAqB,CAClB,WAAW;AACV,YAAO,KAAK,kBAAkB;AAC9B,oBAAiB,KAAA,EAAU;AAC3B,mBAAgB,KAAA,EAAU;AAC1B,UAAO,SAAS,QAAQ;IACxB,CACD,OAAO,UAAU;AAChB,YAAO,MAAM,kCAAkC,MAAM;AACrD,cAAW,MAAM;IACjB;;AAGN,QACE,oBAAC,0BAAD;EACQ;EACN,QAAQ,EAAE,yDAAyD;EACnE,MAAM,EAAE,wDAAwD;EAChE,aAAa,EAAE,gBAAgB;EAC/B,eAAe,EACb,+DACD;EACD,gBAAgB,YAAY,EAAE,MAAM,YAAY,CAAC;EACjD,YAAY;EACZ,eAAe,WAAoB;AACjC,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,kBAAkB;EAClB,CAAA","debug_id":"6aff1b5f-5a64-53a2-a6e1-2b5d9011da28"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { i as shortGitSha, n as getGitUrl, t as getGitSha } from "./build-info-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="81c747c5-9274-5be8-bb32-4803c9568764")}catch(e){}}();
|
|
3
|
+
import { i as shortGitSha, n as getGitUrl, t as getGitSha } from "./build-info-D98hbIth.js";
|
|
4
4
|
import { r as connectConfig } from "./connect.config-C-b_Yhd6.js";
|
|
5
5
|
import { n as serviceWorkerManager } from "./registerServiceWorker-Bn1KWmk0.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -168,5 +168,5 @@ const DebugSettingsModal = () => {
|
|
|
168
168
|
//#endregion
|
|
169
169
|
export { DebugSettingsModal };
|
|
170
170
|
|
|
171
|
-
//# sourceMappingURL=DebugSettingsModal-
|
|
172
|
-
//# debugId=
|
|
171
|
+
//# sourceMappingURL=DebugSettingsModal-D4CdZtB_.js.map
|
|
172
|
+
//# debugId=81c747c5-9274-5be8-bb32-4803c9568764
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebugSettingsModal-
|
|
1
|
+
{"version":3,"file":"DebugSettingsModal-D4CdZtB_.js","sources":["../src/components/modal/modals/DebugSettingsModal.tsx"],"sourcesContent":["import { connectConfig } from \"@powerhousedao/connect/config\";\nimport {\n getGitSha,\n getGitUrl,\n serviceWorkerManager,\n shortGitSha,\n} from \"@powerhousedao/connect/utils\";\nimport { Icon, Modal, PowerhouseButton } from \"@powerhousedao/design-system\";\nimport { Combobox, FormInput } from \"@powerhousedao/design-system/connect\";\nimport { closePHModal, usePHModal } from \"@powerhousedao/reactor-browser\";\nimport { useEffect, useState } from \"react\";\n\nexport const DebugSettingsModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"debugSettings\";\n\n const [appVersion, setAppVersion] = useState(connectConfig.appVersion);\n const [serviceWorkerDebugMode, setServiceWorkerDebugMode] = useState({\n label: serviceWorkerManager.debug ? \"Enabled\" : \"Disabled\",\n value: serviceWorkerManager.debug,\n });\n\n useEffect(() => {\n serviceWorkerManager.setDebug(serviceWorkerDebugMode.value);\n }, [serviceWorkerDebugMode]);\n\n return (\n <Modal\n open={open}\n onOpenChange={(status) => {\n if (!status) return closePHModal();\n }}\n contentProps={{\n className: \"rounded-2xl\",\n }}\n >\n <div className=\"w-[700px] rounded-2xl bg-background p-6\">\n <div className=\"mb-6 flex justify-between\">\n <div className=\"text-xl font-bold\">Debug Tools</div>\n <button id=\"close-modal\" onClick={() => closePHModal()}>\n <Icon name=\"Xmark\" size={28} />\n </button>\n </div>\n <div className=\"flex text-sm font-bold\">\n <Icon name=\"Ring\" size={22} />\n <span className=\"ml-2\">App Version: {connectConfig.appVersion}</span>\n {(() => {\n const sha = getGitSha();\n if (sha === \"unknown\") return null;\n const url = getGitUrl();\n const label = shortGitSha(sha);\n return url ? (\n <a\n className=\"ml-2 font-mono text-xs font-normal text-info hover:underline\"\n href={url}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n title={sha}\n >\n ({label})\n </a>\n ) : (\n <span\n className=\"ml-2 font-mono text-xs font-normal text-muted-foreground\"\n title={sha}\n >\n ({label})\n </span>\n );\n })()}\n </div>\n <div className=\"mt-4 flex text-sm font-bold\">\n <Icon name=\"Hdd\" size={22} />\n <span className=\"ml-2\">Drive Tools:</span>\n </div>\n\n <div className=\"mt-4 flex text-sm font-bold\">\n <Icon name=\"Gear\" size={22} />\n <span className=\"ml-2\">Service Worker Tools:</span>\n </div>\n <div className=\"mt-2 flex items-end justify-between pl-4\">\n <div className=\"w-[400px]\">\n <label htmlFor=\"serviceWorkerDebugMode\" className=\"text-xs\">\n Service Worker Debug Mode:\n </label>\n <Combobox\n id=\"serviceWorkerDebugMode\"\n onChange={(value) => {\n setServiceWorkerDebugMode(\n value as typeof serviceWorkerDebugMode,\n );\n }}\n value={serviceWorkerDebugMode}\n options={[\n { label: \"Enabled\", value: true },\n { label: \"Disabled\", value: false },\n ]}\n />\n </div>\n </div>\n <div className=\"mt-2 flex items-end justify-between pl-4\">\n <div className=\"w-[400px]\">\n <label htmlFor=\"appVersion\" className=\"text-xs\">\n Set invalid app version:\n </label>\n <FormInput\n containerClassName=\"rounded-md border border-border bg-background p-1 text-sm\"\n inputClassName=\"text-xs font-normal\"\n id=\"appVersion\"\n icon={\n <div className=\"flex h-full items-center text-xs\">Version:</div>\n }\n value={appVersion}\n onChange={(element) => setAppVersion(element.target.value)}\n />\n </div>\n <div className=\"mb-1 flex items-center justify-center\">\n <PowerhouseButton\n color={appVersion === \"\" ? \"light\" : \"red\"}\n size=\"small\"\n disabled={appVersion === \"\"}\n onClick={() => {\n serviceWorkerManager.sendMessage({\n type: \"SET_APP_VERSION\",\n version: appVersion,\n });\n setAppVersion(\"\");\n }}\n >\n Add Invalid App Version\n </PowerhouseButton>\n </div>\n </div>\n </div>\n </Modal>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAYA,MAAa,2BAAqC;CAEhD,MAAM,OADU,YAAY,EACN,SAAS;CAE/B,MAAM,CAAC,YAAY,iBAAiB,SAAS,cAAc,WAAW;CACtE,MAAM,CAAC,wBAAwB,6BAA6B,SAAS;EACnE,OAAO,qBAAqB,QAAQ,YAAY;EAChD,OAAO,qBAAqB;EAC7B,CAAC;AAEF,iBAAgB;AACd,uBAAqB,SAAS,uBAAuB,MAAM;IAC1D,CAAC,uBAAuB,CAAC;AAE5B,QACE,oBAAC,OAAD;EACQ;EACN,eAAe,WAAW;AACxB,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,cAAc,EACZ,WAAW,eACZ;YAED,qBAAC,OAAD;GAAK,WAAU;aAAf;IACE,qBAAC,OAAD;KAAK,WAAU;eAAf,CACE,oBAAC,OAAD;MAAK,WAAU;gBAAoB;MAAiB,CAAA,EACpD,oBAAC,UAAD;MAAQ,IAAG;MAAc,eAAe,cAAc;gBACpD,oBAAC,MAAD;OAAM,MAAK;OAAQ,MAAM;OAAM,CAAA;MACxB,CAAA,CACL;;IACN,qBAAC,OAAD;KAAK,WAAU;eAAf;MACE,oBAAC,MAAD;OAAM,MAAK;OAAO,MAAM;OAAM,CAAA;MAC9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U;kBAAmC;QAAc,CAAA;OAElE,OAAO;OACP,WAAW,YAAY,cAAc,QAAQ,OAAO,MAAM;OAC1D,CAAA,CACE;SACN,oBAAC,OAAD;MAAK,WAAU;gBACb,oBAAC,kBAAD;OACE,OAAO,eAAe,KAAK,UAAU;OACrC,MAAK;OACL,UAAU,eAAe;OACzB,eAAe;AACb,6BAAqB,YAAY;SAC/B,MAAM;SACN,SAAS;SACV,CAAC;AACF,sBAAc,GAAG;;iBAEpB;OAEkB,CAAA;MACf,CAAA,CACF;;IACF;;EACA,CAAA","debug_id":"81c747c5-9274-5be8-bb32-4803c9568764"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { t as useOpenRenownLogin } from "./use-renown-login-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fe45c120-cb44-5fd1-b948-c2ca2376b534")}catch(e){}}();
|
|
3
|
+
import { t as useOpenRenownLogin } from "./use-renown-login-DBdWV-o8.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import { closePHModal, logout, usePHModal, useUser } from "@powerhousedao/reactor-browser";
|
|
@@ -32,5 +32,5 @@ const DriveAuthRequiredModal = () => {
|
|
|
32
32
|
//#endregion
|
|
33
33
|
export { DriveAuthRequiredModal };
|
|
34
34
|
|
|
35
|
-
//# sourceMappingURL=DriveAuthRequiredModal-
|
|
36
|
-
//# debugId=
|
|
35
|
+
//# sourceMappingURL=DriveAuthRequiredModal-CRFBGrcx.js.map
|
|
36
|
+
//# debugId=fe45c120-cb44-5fd1-b948-c2ca2376b534
|
package/dist/{DriveAuthRequiredModal-DSM6uNlb.js.map → DriveAuthRequiredModal-CRFBGrcx.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DriveAuthRequiredModal-
|
|
1
|
+
{"version":3,"file":"DriveAuthRequiredModal-CRFBGrcx.js","sources":["../src/components/modal/modals/DriveAuthRequiredModal.tsx"],"sourcesContent":["import { DriveAuthGate } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n logout,\n usePHModal,\n useUser,\n} from \"@powerhousedao/reactor-browser\";\nimport React from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useOpenRenownLogin } from \"../../../hooks/use-renown-login.js\";\n\n// Non-blocking overlay when a protected drive can't be added while signed out\n// (pointer-events-none backdrop keeps the cookie banner clickable). Opens login.\nexport const DriveAuthRequiredModal: React.FC = () => {\n const phModal = usePHModal();\n const user = useUser();\n const openLogin = useOpenRenownLogin();\n const mode = user ? \"unauthorized\" : \"login\";\n if (phModal?.type !== \"driveAuthRequired\") return null;\n\n // Portal to body so `fixed inset-0` centers on the viewport, not inside a\n // transformed/contained ancestor (a wallet provider wrapper or layout column).\n return createPortal(\n <div\n role=\"dialog\"\n aria-modal=\"false\"\n aria-label={\n mode === \"unauthorized\"\n ? \"You don't have access to this drive\"\n : \"Log in to access this drive\"\n }\n className=\"pointer-events-none fixed inset-0 z-50 grid place-items-center bg-primary/30\"\n >\n <DriveAuthGate\n mode={mode}\n onLogin={() => {\n closePHModal();\n openLogin();\n }}\n onLogout={() => void logout()}\n className=\"pointer-events-auto\"\n />\n </div>,\n document.body,\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAaA,MAAa,+BAAyC;CACpD,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,SAAS;CACtB,MAAM,YAAY,oBAAoB;CACtC,MAAM,OAAO,OAAO,iBAAiB;AACrC,KAAI,SAAS,SAAS,oBAAqB,QAAO;AAIlD,QAAO,aACL,oBAAC,OAAD;EACE,MAAK;EACL,cAAW;EACX,cACE,SAAS,iBACL,wCACA;EAEN,WAAU;YAEV,oBAAC,eAAD;GACQ;GACN,eAAe;AACb,kBAAc;AACd,eAAW;;GAEb,gBAAgB,KAAK,QAAQ;GAC7B,WAAU;GACV,CAAA;EACE,CAAA,EACN,SAAS,KACV","debug_id":"fe45c120-cb44-5fd1-b948-c2ca2376b534"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ea927a87-6dc2-5f43-ac5d-78c2d11c49ea")}catch(e){}}();
|
|
3
3
|
import { a as resolvePgMajorForRuntime, i as loadPgDump } from "./pglite-major-B39aOEiE.js";
|
|
4
|
-
import { t as clearReactorStorage } from "./reactor-
|
|
4
|
+
import { t as clearReactorStorage } from "./reactor-DsbeOt8y.js";
|
|
5
5
|
import { c as getCachedReactorPgMajor, d as subscribeReactorPgMajor } from "./connection-state-KCa1yljA.js";
|
|
6
6
|
import { t as PENDING_PG_SEED_KEY } from "./pglite-seed-DRXPe7p-.js";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -421,5 +421,5 @@ const InspectorModal = () => {
|
|
|
421
421
|
//#endregion
|
|
422
422
|
export { InspectorModal };
|
|
423
423
|
|
|
424
|
-
//# sourceMappingURL=InspectorModal-
|
|
425
|
-
//# debugId=
|
|
424
|
+
//# sourceMappingURL=InspectorModal-IxyRcTFV.js.map
|
|
425
|
+
//# debugId=ea927a87-6dc2-5f43-ac5d-78c2d11c49ea
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InspectorModal-CV9uqn0p.js","sources":["../src/components/modal/modals/InspectorModal/useDbExplorer.ts","../src/components/modal/modals/InspectorModal/useDebugInspector.ts","../src/components/modal/modals/InspectorModal/useIntegrityInspector.ts","../src/components/modal/modals/InspectorModal/useProcessorsInspector.ts","../src/components/modal/modals/InspectorModal/useQueueInspector.ts","../src/components/modal/modals/InspectorModal/useRemotesInspector.ts","../src/components/modal/modals/InspectorModal/useWorkerInspector.ts","../src/components/modal/modals/InspectorModal/InspectorModal.tsx"],"sourcesContent":["import type { PGlite } from \"@electric-sql/pglite\";\nimport {\n getCachedReactorPgMajor,\n loadPgDump,\n resolvePgMajorForRuntime,\n} from \"@powerhousedao/connect/utils\";\nimport type {\n FilterGroup,\n SortOptions,\n} from \"@powerhousedao/design-system/connect\";\nimport type { Database } from \"@powerhousedao/reactor\";\nimport {\n REACTOR_SCHEMA,\n useDatabase,\n usePGlite,\n useReactorClientModule,\n type IQueue,\n} from \"@powerhousedao/reactor-browser\";\nimport type { IInspectorProxy } from \"@powerhousedao/reactor-browser/rpc\";\nimport { Kysely, sql } from \"kysely\";\nimport { PGliteDialect } from \"kysely-pglite-dialect\";\nimport { useCallback, useMemo } from \"react\";\n\nasync function quiesceQueue(queue: IQueue): Promise<void> {\n await new Promise<void>((resolve) => queue.block(() => resolve()));\n}\n\n// The reactor runs with `relaxedDurability: true`, which makes PGlite's\n// `syncToFs()` fire the IDBFS→IndexedDB write and return without awaiting\n// Emscripten's syncfs callback. `close()` also doesn't flush. Calling\n// `FS.syncfs(false, cb)` directly gives us a callback that fires from the\n// IDBFS transaction's `oncomplete` — i.e. after IDB has actually committed.\nasync function syncPgliteToIdb(pglite: {\n readonly Module: {\n readonly FS: {\n syncfs(populate: boolean, cb: (err: Error | null) => void): void;\n };\n };\n}): Promise<void> {\n await new Promise<void>((resolve, reject) => {\n pglite.Module.FS.syncfs(false, (err) => (err ? reject(err) : resolve()));\n });\n}\n\ntype ColumnInfo = {\n readonly name: string;\n readonly dataType: string;\n readonly isNullable: boolean;\n};\n\ntype TableInfo = {\n readonly name: string;\n readonly columns: ColumnInfo[];\n};\n\ntype ColumnRow = {\n table_name: string;\n column_name: string;\n data_type: string;\n is_nullable: string;\n};\n\ntype GetTableRowsOptions = {\n readonly schema?: string;\n readonly limit: number;\n readonly offset: number;\n readonly sort?: SortOptions;\n readonly filters?: FilterGroup;\n};\n\ntype TablePage = {\n readonly columns: string[];\n readonly rows: Record<string, unknown>[];\n readonly total: number | null;\n};\n\nconst PRIORITY_COLUMNS = [\n \"documentType\",\n \"documentId\",\n \"scope\",\n \"branch\",\n \"index\",\n \"skip\",\n] as const;\n\ntype ReactorPgliteAdapter = {\n query: (\n sql: string,\n params?: unknown[],\n ) => Promise<{ rows: unknown[]; affectedRows?: number }>;\n};\n\nfunction createWorkerReactorDatabase(\n inspector: IInspectorProxy,\n): Kysely<Database> {\n const adapter: ReactorPgliteAdapter = {\n query: async (statement, params) => ({\n rows: (await inspector.queryReactorDb(statement, params)) as unknown[],\n }),\n };\n return new Kysely<Database>({\n dialect: new PGliteDialect(adapter as unknown as PGlite),\n });\n}\n\nexport function useDbExplorer() {\n const browserDatabase = useDatabase();\n const pglite = usePGlite();\n const module = useReactorClientModule();\n const reactorClientModule = module?.kind === \"browser\" ? module : undefined;\n const reactor = reactorClientModule?.reactorModule?.reactor;\n const queue = reactorClientModule?.reactorModule?.queue;\n const workerModule = module?.kind === \"worker\" ? module : undefined;\n const workerDatabase = useMemo(\n () =>\n workerModule\n ? createWorkerReactorDatabase(workerModule.inspector)\n : undefined,\n [workerModule],\n );\n const database = browserDatabase ?? workerDatabase;\n\n const getTables = useCallback(async (): Promise<TableInfo[]> => {\n if (!database) return [];\n\n const result = await sql<ColumnRow>`\n SELECT\n c.table_name,\n c.column_name,\n c.data_type,\n c.is_nullable\n FROM information_schema.columns c\n INNER JOIN information_schema.tables t\n ON c.table_name = t.table_name\n AND c.table_schema = t.table_schema\n WHERE c.table_schema = ${REACTOR_SCHEMA}\n AND t.table_type = 'BASE TABLE'\n ORDER BY c.table_name, c.ordinal_position\n `.execute(database);\n\n const tableMap = new Map<string, ColumnInfo[]>();\n for (const row of result.rows) {\n if (!tableMap.has(row.table_name)) {\n tableMap.set(row.table_name, []);\n }\n tableMap.get(row.table_name)!.push({\n name: row.column_name,\n dataType: row.data_type,\n isNullable: row.is_nullable === \"YES\",\n });\n }\n\n return Array.from(tableMap).map(([name, columns]) => {\n const columnNames = columns.map((col) => col.name);\n const orderedColumns = [\n ...PRIORITY_COLUMNS.filter((col) => columnNames.includes(col)).map(\n (col) => columns.find((c) => c.name === col)!,\n ),\n ...columns.filter(\n (col) =>\n !PRIORITY_COLUMNS.includes(\n col.name as (typeof PRIORITY_COLUMNS)[number],\n ),\n ),\n ];\n return {\n name,\n columns: orderedColumns,\n };\n });\n }, [database]);\n\n const getTableRows = useCallback(\n async (table: string, options: GetTableRowsOptions): Promise<TablePage> => {\n if (!database) {\n return { columns: [], rows: [], total: null };\n }\n\n const limit = options.limit;\n const offset = options.offset;\n const sort = options.sort;\n const filters = options.filters;\n const tableRef = sql.raw(`${REACTOR_SCHEMA}.\"${table}\"`);\n\n // Build WHERE clause from filters\n let whereClause = sql``;\n if (filters?.clauses && filters.clauses.length > 0) {\n const conditions: ReturnType<typeof sql>[] = [];\n\n for (let i = 0; i < filters.clauses.length; i++) {\n const clause = filters.clauses[i];\n if (!clause) continue;\n\n const columnRef = sql.raw(`\"${clause.column}\"`);\n\n let condition: ReturnType<typeof sql>;\n\n if (clause.operator === \"IS NULL\") {\n condition = sql`${columnRef} IS NULL`;\n } else if (clause.operator === \"IS NOT NULL\") {\n condition = sql`${columnRef} IS NOT NULL`;\n } else if (\n clause.operator === \"LIKE\" ||\n clause.operator === \"ILIKE\"\n ) {\n const value = clause.value;\n const operator =\n clause.operator === \"LIKE\" ? sql`LIKE` : sql`ILIKE`;\n condition = sql`${columnRef} ${operator} ${value}`;\n } else {\n // For =, !=, >, <, >=, <=\n const operator = sql.raw(clause.operator);\n const value = clause.value;\n\n // Try to parse as number if it looks like a number\n let parsedValue: string | number = value;\n if (value !== \"\" && !isNaN(Number(value)) && value.trim() !== \"\") {\n parsedValue = Number(value);\n }\n\n condition = sql`${columnRef} ${operator} ${parsedValue}`;\n }\n\n conditions.push(condition);\n\n // Add connector if not the last clause\n if (i < filters.clauses.length - 1) {\n const connector = filters.connectors?.[i] ?? \"AND\";\n conditions.push(sql.raw(connector));\n }\n }\n\n // Combine all conditions\n if (conditions.length > 0) {\n whereClause = sql`WHERE ${sql.join(conditions, sql` `)}`;\n }\n }\n\n // Build main query\n let query;\n if (sort) {\n const columnRef = sql.raw(`\"${sort.column}\"`);\n const direction = sort.direction === \"desc\" ? sql`DESC` : sql`ASC`;\n query = sql<Record<string, unknown>>`\n SELECT * FROM ${tableRef}\n ${whereClause}\n ORDER BY ${columnRef} ${direction}\n LIMIT ${limit} OFFSET ${offset}\n `;\n } else {\n query = sql<Record<string, unknown>>`\n SELECT * FROM ${tableRef}\n ${whereClause}\n LIMIT ${limit} OFFSET ${offset}\n `;\n }\n\n const result = await query.execute(database);\n\n // Build count query with same filters\n const countQuery = sql<{ count: string }>`\n SELECT COUNT(*) as count FROM ${tableRef}\n ${whereClause}\n `;\n const countResult = await countQuery.execute(database);\n const total = countResult.rows[0]\n ? parseInt(countResult.rows[0].count, 10)\n : null;\n\n const rawColumns =\n result.rows.length > 0 ? Object.keys(result.rows[0]) : [];\n const columns = [\n ...PRIORITY_COLUMNS.filter((col) => rawColumns.includes(col)),\n ...rawColumns.filter(\n (col) =>\n !PRIORITY_COLUMNS.includes(\n col as (typeof PRIORITY_COLUMNS)[number],\n ),\n ),\n ];\n\n return {\n columns,\n rows: result.rows,\n total,\n };\n },\n [database],\n );\n\n const onExportDb = useCallback(async () => {\n if (!pglite) return;\n\n if (queue) await quiesceQueue(queue);\n\n try {\n const major = resolvePgMajorForRuntime(getCachedReactorPgMajor() ?? null);\n const pgDump = await loadPgDump(major);\n const dump = await pgDump({ pg: pglite });\n const sqlContent = await dump.text();\n\n const blob = new Blob([sqlContent], { type: \"text/sql\" });\n const url = URL.createObjectURL(blob);\n const a = document.createElement(\"a\");\n a.href = url;\n a.download = `database-export-${Date.now()}.sql`;\n a.click();\n URL.revokeObjectURL(url);\n } finally {\n queue?.unblock();\n }\n }, [pglite, queue]);\n\n const onImportDb = useCallback(\n async (sqlContent: string) => {\n if (!pglite) return;\n\n if (queue) await quiesceQueue(queue);\n\n if (reactor) {\n const status = reactor.kill();\n await status.completed;\n }\n\n // drop every user-created schema before restoring\n await pglite.transaction(async (tx) => {\n const schemas = await tx.query<{ nspname: string }>(\n `SELECT nspname FROM pg_namespace\n WHERE nspname NOT IN ('pg_catalog', 'pg_toast', 'information_schema', 'public')\n AND nspname NOT LIKE 'pg_temp_%'\n AND nspname NOT LIKE 'pg_toast_temp_%'`,\n );\n for (const { nspname } of schemas.rows) {\n await tx.exec(`DROP SCHEMA IF EXISTS \"${nspname}\" CASCADE`);\n }\n try {\n await tx.exec(\"SET standard_conforming_strings = off;\");\n } catch {\n // PG17 still accepts this but log if it ever fails.\n }\n await tx.exec(sqlContent);\n await tx.exec(`SET search_path TO ${REACTOR_SCHEMA}`);\n });\n\n // flush IDBFS → IndexedDB synchronously\n await syncPgliteToIdb(pglite);\n\n window.location.reload();\n\n // reload() is asynchronous; without blocking here the DBExplorer caller\n // would continue and call loadTables() against an in-flight shutdown.\n await new Promise(() => {});\n },\n [pglite, queue, reactor],\n );\n\n const getDefaultSort = useCallback(\n (table: string): SortOptions | undefined => {\n if (table === \"Operation\") {\n return { column: \"timestampUtcMs\", direction: \"desc\" };\n }\n return undefined;\n },\n [],\n );\n\n const canModifyDb = !!pglite;\n\n return {\n getTables,\n getTableRows,\n getDefaultSort,\n onExportDb: canModifyDb ? onExportDb : undefined,\n onImportDb: canModifyDb ? onImportDb : undefined,\n };\n}\n","import { clearReactorStorage } from \"@powerhousedao/connect/store\";\nimport {\n getCachedReactorPgMajor,\n PENDING_PG_SEED_KEY,\n subscribeReactorPgMajor,\n} from \"@powerhousedao/connect/utils\";\nimport { useCallback, useSyncExternalStore } from \"react\";\n\nconst SUPPORTED_PG_VERSIONS = [16, 17] as const;\n\nexport function useDebugInspector() {\n const currentPgVersion = useSyncExternalStore(\n subscribeReactorPgMajor,\n getCachedReactorPgMajor,\n () => undefined,\n );\n\n const onResetToPgVersion = useCallback(async (major: number) => {\n console.info(`[debug-inspector] Reset requested: PG${major}`);\n try {\n localStorage.setItem(PENDING_PG_SEED_KEY, String(major));\n console.info(`[debug-inspector] Clearing reactor storage...`);\n await clearReactorStorage();\n console.info(`[debug-inspector] Storage cleared. Reloading...`);\n window.location.reload();\n } catch (err) {\n console.error(\"[debug-inspector] Reset failed:\", err);\n localStorage.removeItem(PENDING_PG_SEED_KEY);\n throw err;\n }\n }, []);\n\n return {\n supportedPgVersions: SUPPORTED_PG_VERSIONS,\n currentPgVersion: currentPgVersion ?? null,\n onResetToPgVersion,\n };\n}\n","import type { IntegrityInspectorProps } from \"@powerhousedao/design-system/connect\";\nimport {\n DocumentIntegrityService,\n useReactorClientModule,\n type RebuildResult,\n type ValidationResult,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useIntegrityInspector(): IntegrityInspectorProps | undefined {\n const module = useReactorClientModule();\n const reactorModule =\n module?.kind === \"browser\" ? module.reactorModule : undefined;\n const inspector = module?.kind === \"worker\" ? module.inspector : undefined;\n\n const service = useMemo(() => {\n if (!reactorModule) return undefined;\n\n return new DocumentIntegrityService(\n reactorModule.keyframeStore,\n reactorModule.operationStore,\n reactorModule.writeCache,\n reactorModule.documentView,\n reactorModule.documentModelRegistry,\n );\n }, [reactorModule]);\n\n const onValidate = useCallback(\n async (documentId: string, branch?: string): Promise<ValidationResult> => {\n if (inspector) {\n return (await inspector.validateDocument(\n documentId,\n branch,\n )) as ValidationResult;\n }\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.validateDocument(documentId, branch);\n },\n [service, inspector],\n );\n\n const onRebuildKeyframes = useCallback(\n async (documentId: string, branch?: string): Promise<RebuildResult> => {\n if (inspector) {\n return (await inspector.rebuildKeyframes(\n documentId,\n branch,\n )) as RebuildResult;\n }\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.rebuildKeyframes(documentId, branch);\n },\n [service, inspector],\n );\n\n const onRebuildSnapshots = useCallback(\n async (documentId: string, branch?: string): Promise<RebuildResult> => {\n if (inspector) {\n return (await inspector.rebuildSnapshots(\n documentId,\n branch,\n )) as RebuildResult;\n }\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.rebuildSnapshots(documentId, branch);\n },\n [service, inspector],\n );\n\n if (!service && !inspector) {\n return undefined;\n }\n\n return {\n onValidate,\n onRebuildKeyframes,\n onRebuildSnapshots,\n };\n}\n","import type {\n ProcessorInfo,\n ProcessorsInspectorProps,\n} from \"@powerhousedao/design-system/connect\";\nimport { useReactorClientModule } from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useProcessorsInspector(): ProcessorsInspectorProps | undefined {\n const module = useReactorClientModule();\n const processorManager =\n module?.kind === \"browser\"\n ? module.reactorModule?.processorManager\n : undefined;\n const inspector = module?.kind === \"worker\" ? module.inspector : undefined;\n\n const available = useMemo(\n () => processorManager != null || inspector != null,\n [processorManager, inspector],\n );\n\n const getProcessors = useCallback((): Promise<ProcessorInfo[]> => {\n if (inspector) {\n return inspector.getProcessors() as Promise<ProcessorInfo[]>;\n }\n if (!processorManager) {\n return Promise.resolve([]);\n }\n return Promise.resolve(\n processorManager.getAll().map((tracked) => ({\n processorId: tracked.processorId,\n factoryId: tracked.factoryId,\n driveId: tracked.driveId,\n processorIndex: tracked.processorIndex,\n lastOrdinal: tracked.lastOrdinal,\n status: tracked.status,\n lastError: tracked.lastError,\n lastErrorTimestamp: tracked.lastErrorTimestamp,\n })),\n );\n }, [processorManager, inspector]);\n\n const onRetry = useCallback(\n async (processorId: string) => {\n if (inspector) {\n await inspector.retryProcessor(processorId);\n return;\n }\n if (!processorManager) return;\n const tracked = processorManager.get(processorId);\n if (tracked) {\n await tracked.retry();\n }\n },\n [processorManager, inspector],\n );\n\n if (!available) {\n return undefined;\n }\n\n return {\n getProcessors,\n onRetry,\n };\n}\n","import type {\n QueueInspectorProps,\n QueueState,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n InMemoryQueue,\n useReactorClientModule,\n type Job,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useQueueInspector(): QueueInspectorProps | undefined {\n const module = useReactorClientModule();\n const reactorClientModule = module?.kind === \"browser\" ? module : undefined;\n const inspector = module?.kind === \"worker\" ? module.inspector : undefined;\n const queue = reactorClientModule?.reactorModule?.queue;\n\n const inMemoryQueue = useMemo(() => {\n if (queue instanceof InMemoryQueue) {\n return queue;\n }\n return undefined;\n }, [queue]);\n\n const getQueueState = useCallback((): Promise<QueueState> => {\n if (inspector) {\n return inspector.getQueueState() as Promise<QueueState>;\n }\n if (!inMemoryQueue) {\n return Promise.resolve({\n isPaused: false,\n pendingJobs: [],\n executingJobs: [],\n totalPending: 0,\n totalExecuting: 0,\n });\n }\n\n const pendingJobs = inMemoryQueue.getPendingJobs();\n const executingJobIds = inMemoryQueue.getExecutingJobIds();\n\n const executingJobs: Job[] = [];\n for (const jobIdSet of executingJobIds.values()) {\n for (const jobId of jobIdSet) {\n const job = inMemoryQueue.getJob(jobId);\n if (job) {\n executingJobs.push(job);\n }\n }\n }\n\n return Promise.resolve({\n isPaused: inMemoryQueue.paused,\n pendingJobs,\n executingJobs,\n totalPending: pendingJobs.length,\n totalExecuting: executingJobs.length,\n });\n }, [inMemoryQueue, inspector]);\n\n const onPause = useCallback(async (): Promise<void> => {\n if (inspector) {\n await inspector.pauseQueue();\n return;\n }\n if (inMemoryQueue) {\n inMemoryQueue.pause();\n }\n }, [inMemoryQueue, inspector]);\n\n const onResume = useCallback(async (): Promise<void> => {\n if (inspector) {\n await inspector.resumeQueue();\n return;\n }\n if (inMemoryQueue) {\n await inMemoryQueue.resume();\n }\n }, [inMemoryQueue, inspector]);\n\n if (!inMemoryQueue && !inspector) {\n return undefined;\n }\n\n return {\n getQueueState,\n onPause,\n onResume,\n };\n}\n","import type {\n ConnectionStateSnapshot,\n Remote,\n} from \"@powerhousedao/reactor-browser\";\nimport {\n addRemoteDrive,\n PollBehavior,\n useConnectionStates,\n useSync,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback } from \"react\";\n\nexport function useRemotesInspector(): {\n getRemotes: () => Promise<Remote[]>;\n removeRemote: (name: string) => Promise<void>;\n addRemoteManual: (url: string) => Promise<void>;\n triggerPull: (name: string) => void;\n connectionStates: ReadonlyMap<string, ConnectionStateSnapshot>;\n} {\n const syncManager = useSync();\n if (!syncManager) {\n throw new Error(\"Sync manager not found\");\n }\n\n const connectionStates = useConnectionStates();\n\n const getRemotes = useCallback(() => {\n return Promise.resolve(syncManager.list());\n }, [syncManager]);\n\n const removeRemote = useCallback(\n (name: string) => syncManager.remove(name),\n [syncManager],\n );\n\n const addRemoteManual = useCallback(async (url: string) => {\n await addRemoteDrive(url, undefined, {\n pollBehavior: PollBehavior.Manual,\n });\n }, []);\n\n const triggerPull = useCallback(\n (name: string) => syncManager.triggerPull(name),\n [syncManager],\n );\n\n return {\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n };\n}\n","import type { WorkerInspectorProps } from \"@powerhousedao/design-system/connect\";\nimport { useReactorClientModule } from \"@powerhousedao/reactor-browser\";\nimport { useMemo } from \"react\";\n\nexport function useWorkerInspector(): WorkerInspectorProps | undefined {\n const module = useReactorClientModule();\n const adminClient =\n module?.kind === \"worker\" ? module.adminClient : undefined;\n\n return useMemo(() => {\n if (!adminClient) {\n return undefined;\n }\n return {\n getInfo: () => adminClient.info(),\n onRestart: () => adminClient.restart(),\n };\n }, [adminClient]);\n}\n","import { InspectorModal as ConnectInspectorModal } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n REACTOR_SCHEMA,\n usePHModal,\n} from \"@powerhousedao/reactor-browser\";\nimport { useDbExplorer } from \"./useDbExplorer.js\";\nimport { useDebugInspector } from \"./useDebugInspector.js\";\nimport { useIntegrityInspector } from \"./useIntegrityInspector.js\";\nimport { useProcessorsInspector } from \"./useProcessorsInspector.js\";\nimport { useQueueInspector } from \"./useQueueInspector.js\";\nimport { useRemotesInspector } from \"./useRemotesInspector.js\";\nimport { useWorkerInspector } from \"./useWorkerInspector.js\";\n\nconst DEFAULT_PAGE_SIZE = 25;\n\nexport const InspectorModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"inspector\";\n\n const { getTables, getTableRows, getDefaultSort, onExportDb, onImportDb } =\n useDbExplorer();\n const {\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n } = useRemotesInspector();\n const queueInspectorProps = useQueueInspector();\n const processorsInspectorProps = useProcessorsInspector();\n const integrityInspectorProps = useIntegrityInspector();\n const workerInspectorProps = useWorkerInspector();\n const { currentPgVersion, supportedPgVersions, onResetToPgVersion } =\n useDebugInspector();\n\n return (\n <ConnectInspectorModal\n open={open}\n onOpenChange={(status) => {\n if (!status) closePHModal();\n }}\n dbExplorerProps={{\n schema: REACTOR_SCHEMA,\n getTables,\n getTableRows,\n getDefaultSort,\n pageSize: DEFAULT_PAGE_SIZE,\n onExportDb,\n onImportDb,\n pgVersionControl: {\n currentPgVersion,\n supportedPgVersions,\n onResetToPgVersion,\n },\n }}\n remotesInspectorProps={{\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n }}\n queueInspectorProps={queueInspectorProps}\n processorsInspectorProps={processorsInspectorProps}\n integrityInspectorProps={integrityInspectorProps}\n workerInspectorProps={workerInspectorProps}\n />\n );\n};\n"],"names":["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CACvD,MAAM,uBAAuB,oBAAoB;CACjD,MAAM,EAAE,kBAAkB,qBAAqB,uBAC7C,mBAAmB;AAErB,QACE,oBAACA,kBAAD;EACQ;EACN,eAAe,WAAW;AACxB,OAAI,CAAC,OAAQ,eAAc;;EAE7B,iBAAiB;GACf,QAAQ;GACR;GACA;GACA;GACA,UAAU;GACV;GACA;GACA,kBAAkB;IAChB;IACA;IACA;IACD;GACF;EACD,uBAAuB;GACrB;GACA;GACA;GACA;GACA;GACD;EACoB;EACK;EACD;EACH;EACtB,CAAA","debug_id":"f8938b04-de30-5555-b536-36e4a48f33e6"}
|
|
1
|
+
{"version":3,"file":"InspectorModal-IxyRcTFV.js","sources":["../src/components/modal/modals/InspectorModal/useDbExplorer.ts","../src/components/modal/modals/InspectorModal/useDebugInspector.ts","../src/components/modal/modals/InspectorModal/useIntegrityInspector.ts","../src/components/modal/modals/InspectorModal/useProcessorsInspector.ts","../src/components/modal/modals/InspectorModal/useQueueInspector.ts","../src/components/modal/modals/InspectorModal/useRemotesInspector.ts","../src/components/modal/modals/InspectorModal/useWorkerInspector.ts","../src/components/modal/modals/InspectorModal/InspectorModal.tsx"],"sourcesContent":["import type { PGlite } from \"@electric-sql/pglite\";\nimport {\n getCachedReactorPgMajor,\n loadPgDump,\n resolvePgMajorForRuntime,\n} from \"@powerhousedao/connect/utils\";\nimport type {\n FilterGroup,\n SortOptions,\n} from \"@powerhousedao/design-system/connect\";\nimport type { Database } from \"@powerhousedao/reactor\";\nimport {\n REACTOR_SCHEMA,\n useDatabase,\n usePGlite,\n useReactorClientModule,\n type IQueue,\n} from \"@powerhousedao/reactor-browser\";\nimport type { IInspectorProxy } from \"@powerhousedao/reactor-browser/rpc\";\nimport { Kysely, sql } from \"kysely\";\nimport { PGliteDialect } from \"kysely-pglite-dialect\";\nimport { useCallback, useMemo } from \"react\";\n\nasync function quiesceQueue(queue: IQueue): Promise<void> {\n await new Promise<void>((resolve) => queue.block(() => resolve()));\n}\n\n// The reactor runs with `relaxedDurability: true`, which makes PGlite's\n// `syncToFs()` fire the IDBFS→IndexedDB write and return without awaiting\n// Emscripten's syncfs callback. `close()` also doesn't flush. Calling\n// `FS.syncfs(false, cb)` directly gives us a callback that fires from the\n// IDBFS transaction's `oncomplete` — i.e. after IDB has actually committed.\nasync function syncPgliteToIdb(pglite: {\n readonly Module: {\n readonly FS: {\n syncfs(populate: boolean, cb: (err: Error | null) => void): void;\n };\n };\n}): Promise<void> {\n await new Promise<void>((resolve, reject) => {\n pglite.Module.FS.syncfs(false, (err) => (err ? reject(err) : resolve()));\n });\n}\n\ntype ColumnInfo = {\n readonly name: string;\n readonly dataType: string;\n readonly isNullable: boolean;\n};\n\ntype TableInfo = {\n readonly name: string;\n readonly columns: ColumnInfo[];\n};\n\ntype ColumnRow = {\n table_name: string;\n column_name: string;\n data_type: string;\n is_nullable: string;\n};\n\ntype GetTableRowsOptions = {\n readonly schema?: string;\n readonly limit: number;\n readonly offset: number;\n readonly sort?: SortOptions;\n readonly filters?: FilterGroup;\n};\n\ntype TablePage = {\n readonly columns: string[];\n readonly rows: Record<string, unknown>[];\n readonly total: number | null;\n};\n\nconst PRIORITY_COLUMNS = [\n \"documentType\",\n \"documentId\",\n \"scope\",\n \"branch\",\n \"index\",\n \"skip\",\n] as const;\n\ntype ReactorPgliteAdapter = {\n query: (\n sql: string,\n params?: unknown[],\n ) => Promise<{ rows: unknown[]; affectedRows?: number }>;\n};\n\nfunction createWorkerReactorDatabase(\n inspector: IInspectorProxy,\n): Kysely<Database> {\n const adapter: ReactorPgliteAdapter = {\n query: async (statement, params) => ({\n rows: (await inspector.queryReactorDb(statement, params)) as unknown[],\n }),\n };\n return new Kysely<Database>({\n dialect: new PGliteDialect(adapter as unknown as PGlite),\n });\n}\n\nexport function useDbExplorer() {\n const browserDatabase = useDatabase();\n const pglite = usePGlite();\n const module = useReactorClientModule();\n const reactorClientModule = module?.kind === \"browser\" ? module : undefined;\n const reactor = reactorClientModule?.reactorModule?.reactor;\n const queue = reactorClientModule?.reactorModule?.queue;\n const workerModule = module?.kind === \"worker\" ? module : undefined;\n const workerDatabase = useMemo(\n () =>\n workerModule\n ? createWorkerReactorDatabase(workerModule.inspector)\n : undefined,\n [workerModule],\n );\n const database = browserDatabase ?? workerDatabase;\n\n const getTables = useCallback(async (): Promise<TableInfo[]> => {\n if (!database) return [];\n\n const result = await sql<ColumnRow>`\n SELECT\n c.table_name,\n c.column_name,\n c.data_type,\n c.is_nullable\n FROM information_schema.columns c\n INNER JOIN information_schema.tables t\n ON c.table_name = t.table_name\n AND c.table_schema = t.table_schema\n WHERE c.table_schema = ${REACTOR_SCHEMA}\n AND t.table_type = 'BASE TABLE'\n ORDER BY c.table_name, c.ordinal_position\n `.execute(database);\n\n const tableMap = new Map<string, ColumnInfo[]>();\n for (const row of result.rows) {\n if (!tableMap.has(row.table_name)) {\n tableMap.set(row.table_name, []);\n }\n tableMap.get(row.table_name)!.push({\n name: row.column_name,\n dataType: row.data_type,\n isNullable: row.is_nullable === \"YES\",\n });\n }\n\n return Array.from(tableMap).map(([name, columns]) => {\n const columnNames = columns.map((col) => col.name);\n const orderedColumns = [\n ...PRIORITY_COLUMNS.filter((col) => columnNames.includes(col)).map(\n (col) => columns.find((c) => c.name === col)!,\n ),\n ...columns.filter(\n (col) =>\n !PRIORITY_COLUMNS.includes(\n col.name as (typeof PRIORITY_COLUMNS)[number],\n ),\n ),\n ];\n return {\n name,\n columns: orderedColumns,\n };\n });\n }, [database]);\n\n const getTableRows = useCallback(\n async (table: string, options: GetTableRowsOptions): Promise<TablePage> => {\n if (!database) {\n return { columns: [], rows: [], total: null };\n }\n\n const limit = options.limit;\n const offset = options.offset;\n const sort = options.sort;\n const filters = options.filters;\n const tableRef = sql.raw(`${REACTOR_SCHEMA}.\"${table}\"`);\n\n // Build WHERE clause from filters\n let whereClause = sql``;\n if (filters?.clauses && filters.clauses.length > 0) {\n const conditions: ReturnType<typeof sql>[] = [];\n\n for (let i = 0; i < filters.clauses.length; i++) {\n const clause = filters.clauses[i];\n if (!clause) continue;\n\n const columnRef = sql.raw(`\"${clause.column}\"`);\n\n let condition: ReturnType<typeof sql>;\n\n if (clause.operator === \"IS NULL\") {\n condition = sql`${columnRef} IS NULL`;\n } else if (clause.operator === \"IS NOT NULL\") {\n condition = sql`${columnRef} IS NOT NULL`;\n } else if (\n clause.operator === \"LIKE\" ||\n clause.operator === \"ILIKE\"\n ) {\n const value = clause.value;\n const operator =\n clause.operator === \"LIKE\" ? sql`LIKE` : sql`ILIKE`;\n condition = sql`${columnRef} ${operator} ${value}`;\n } else {\n // For =, !=, >, <, >=, <=\n const operator = sql.raw(clause.operator);\n const value = clause.value;\n\n // Try to parse as number if it looks like a number\n let parsedValue: string | number = value;\n if (value !== \"\" && !isNaN(Number(value)) && value.trim() !== \"\") {\n parsedValue = Number(value);\n }\n\n condition = sql`${columnRef} ${operator} ${parsedValue}`;\n }\n\n conditions.push(condition);\n\n // Add connector if not the last clause\n if (i < filters.clauses.length - 1) {\n const connector = filters.connectors?.[i] ?? \"AND\";\n conditions.push(sql.raw(connector));\n }\n }\n\n // Combine all conditions\n if (conditions.length > 0) {\n whereClause = sql`WHERE ${sql.join(conditions, sql` `)}`;\n }\n }\n\n // Build main query\n let query;\n if (sort) {\n const columnRef = sql.raw(`\"${sort.column}\"`);\n const direction = sort.direction === \"desc\" ? sql`DESC` : sql`ASC`;\n query = sql<Record<string, unknown>>`\n SELECT * FROM ${tableRef}\n ${whereClause}\n ORDER BY ${columnRef} ${direction}\n LIMIT ${limit} OFFSET ${offset}\n `;\n } else {\n query = sql<Record<string, unknown>>`\n SELECT * FROM ${tableRef}\n ${whereClause}\n LIMIT ${limit} OFFSET ${offset}\n `;\n }\n\n const result = await query.execute(database);\n\n // Build count query with same filters\n const countQuery = sql<{ count: string }>`\n SELECT COUNT(*) as count FROM ${tableRef}\n ${whereClause}\n `;\n const countResult = await countQuery.execute(database);\n const total = countResult.rows[0]\n ? parseInt(countResult.rows[0].count, 10)\n : null;\n\n const rawColumns =\n result.rows.length > 0 ? Object.keys(result.rows[0]) : [];\n const columns = [\n ...PRIORITY_COLUMNS.filter((col) => rawColumns.includes(col)),\n ...rawColumns.filter(\n (col) =>\n !PRIORITY_COLUMNS.includes(\n col as (typeof PRIORITY_COLUMNS)[number],\n ),\n ),\n ];\n\n return {\n columns,\n rows: result.rows,\n total,\n };\n },\n [database],\n );\n\n const onExportDb = useCallback(async () => {\n if (!pglite) return;\n\n if (queue) await quiesceQueue(queue);\n\n try {\n const major = resolvePgMajorForRuntime(getCachedReactorPgMajor() ?? null);\n const pgDump = await loadPgDump(major);\n const dump = await pgDump({ pg: pglite });\n const sqlContent = await dump.text();\n\n const blob = new Blob([sqlContent], { type: \"text/sql\" });\n const url = URL.createObjectURL(blob);\n const a = document.createElement(\"a\");\n a.href = url;\n a.download = `database-export-${Date.now()}.sql`;\n a.click();\n URL.revokeObjectURL(url);\n } finally {\n queue?.unblock();\n }\n }, [pglite, queue]);\n\n const onImportDb = useCallback(\n async (sqlContent: string) => {\n if (!pglite) return;\n\n if (queue) await quiesceQueue(queue);\n\n if (reactor) {\n const status = reactor.kill();\n await status.completed;\n }\n\n // drop every user-created schema before restoring\n await pglite.transaction(async (tx) => {\n const schemas = await tx.query<{ nspname: string }>(\n `SELECT nspname FROM pg_namespace\n WHERE nspname NOT IN ('pg_catalog', 'pg_toast', 'information_schema', 'public')\n AND nspname NOT LIKE 'pg_temp_%'\n AND nspname NOT LIKE 'pg_toast_temp_%'`,\n );\n for (const { nspname } of schemas.rows) {\n await tx.exec(`DROP SCHEMA IF EXISTS \"${nspname}\" CASCADE`);\n }\n try {\n await tx.exec(\"SET standard_conforming_strings = off;\");\n } catch {\n // PG17 still accepts this but log if it ever fails.\n }\n await tx.exec(sqlContent);\n await tx.exec(`SET search_path TO ${REACTOR_SCHEMA}`);\n });\n\n // flush IDBFS → IndexedDB synchronously\n await syncPgliteToIdb(pglite);\n\n window.location.reload();\n\n // reload() is asynchronous; without blocking here the DBExplorer caller\n // would continue and call loadTables() against an in-flight shutdown.\n await new Promise(() => {});\n },\n [pglite, queue, reactor],\n );\n\n const getDefaultSort = useCallback(\n (table: string): SortOptions | undefined => {\n if (table === \"Operation\") {\n return { column: \"timestampUtcMs\", direction: \"desc\" };\n }\n return undefined;\n },\n [],\n );\n\n const canModifyDb = !!pglite;\n\n return {\n getTables,\n getTableRows,\n getDefaultSort,\n onExportDb: canModifyDb ? onExportDb : undefined,\n onImportDb: canModifyDb ? onImportDb : undefined,\n };\n}\n","import { clearReactorStorage } from \"@powerhousedao/connect/store\";\nimport {\n getCachedReactorPgMajor,\n PENDING_PG_SEED_KEY,\n subscribeReactorPgMajor,\n} from \"@powerhousedao/connect/utils\";\nimport { useCallback, useSyncExternalStore } from \"react\";\n\nconst SUPPORTED_PG_VERSIONS = [16, 17] as const;\n\nexport function useDebugInspector() {\n const currentPgVersion = useSyncExternalStore(\n subscribeReactorPgMajor,\n getCachedReactorPgMajor,\n () => undefined,\n );\n\n const onResetToPgVersion = useCallback(async (major: number) => {\n console.info(`[debug-inspector] Reset requested: PG${major}`);\n try {\n localStorage.setItem(PENDING_PG_SEED_KEY, String(major));\n console.info(`[debug-inspector] Clearing reactor storage...`);\n await clearReactorStorage();\n console.info(`[debug-inspector] Storage cleared. Reloading...`);\n window.location.reload();\n } catch (err) {\n console.error(\"[debug-inspector] Reset failed:\", err);\n localStorage.removeItem(PENDING_PG_SEED_KEY);\n throw err;\n }\n }, []);\n\n return {\n supportedPgVersions: SUPPORTED_PG_VERSIONS,\n currentPgVersion: currentPgVersion ?? null,\n onResetToPgVersion,\n };\n}\n","import type { IntegrityInspectorProps } from \"@powerhousedao/design-system/connect\";\nimport {\n DocumentIntegrityService,\n useReactorClientModule,\n type RebuildResult,\n type ValidationResult,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useIntegrityInspector(): IntegrityInspectorProps | undefined {\n const module = useReactorClientModule();\n const reactorModule =\n module?.kind === \"browser\" ? module.reactorModule : undefined;\n const inspector = module?.kind === \"worker\" ? module.inspector : undefined;\n\n const service = useMemo(() => {\n if (!reactorModule) return undefined;\n\n return new DocumentIntegrityService(\n reactorModule.keyframeStore,\n reactorModule.operationStore,\n reactorModule.writeCache,\n reactorModule.documentView,\n reactorModule.documentModelRegistry,\n );\n }, [reactorModule]);\n\n const onValidate = useCallback(\n async (documentId: string, branch?: string): Promise<ValidationResult> => {\n if (inspector) {\n return (await inspector.validateDocument(\n documentId,\n branch,\n )) as ValidationResult;\n }\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.validateDocument(documentId, branch);\n },\n [service, inspector],\n );\n\n const onRebuildKeyframes = useCallback(\n async (documentId: string, branch?: string): Promise<RebuildResult> => {\n if (inspector) {\n return (await inspector.rebuildKeyframes(\n documentId,\n branch,\n )) as RebuildResult;\n }\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.rebuildKeyframes(documentId, branch);\n },\n [service, inspector],\n );\n\n const onRebuildSnapshots = useCallback(\n async (documentId: string, branch?: string): Promise<RebuildResult> => {\n if (inspector) {\n return (await inspector.rebuildSnapshots(\n documentId,\n branch,\n )) as RebuildResult;\n }\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.rebuildSnapshots(documentId, branch);\n },\n [service, inspector],\n );\n\n if (!service && !inspector) {\n return undefined;\n }\n\n return {\n onValidate,\n onRebuildKeyframes,\n onRebuildSnapshots,\n };\n}\n","import type {\n ProcessorInfo,\n ProcessorsInspectorProps,\n} from \"@powerhousedao/design-system/connect\";\nimport { useReactorClientModule } from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useProcessorsInspector(): ProcessorsInspectorProps | undefined {\n const module = useReactorClientModule();\n const processorManager =\n module?.kind === \"browser\"\n ? module.reactorModule?.processorManager\n : undefined;\n const inspector = module?.kind === \"worker\" ? module.inspector : undefined;\n\n const available = useMemo(\n () => processorManager != null || inspector != null,\n [processorManager, inspector],\n );\n\n const getProcessors = useCallback((): Promise<ProcessorInfo[]> => {\n if (inspector) {\n return inspector.getProcessors() as Promise<ProcessorInfo[]>;\n }\n if (!processorManager) {\n return Promise.resolve([]);\n }\n return Promise.resolve(\n processorManager.getAll().map((tracked) => ({\n processorId: tracked.processorId,\n factoryId: tracked.factoryId,\n driveId: tracked.driveId,\n processorIndex: tracked.processorIndex,\n lastOrdinal: tracked.lastOrdinal,\n status: tracked.status,\n lastError: tracked.lastError,\n lastErrorTimestamp: tracked.lastErrorTimestamp,\n })),\n );\n }, [processorManager, inspector]);\n\n const onRetry = useCallback(\n async (processorId: string) => {\n if (inspector) {\n await inspector.retryProcessor(processorId);\n return;\n }\n if (!processorManager) return;\n const tracked = processorManager.get(processorId);\n if (tracked) {\n await tracked.retry();\n }\n },\n [processorManager, inspector],\n );\n\n if (!available) {\n return undefined;\n }\n\n return {\n getProcessors,\n onRetry,\n };\n}\n","import type {\n QueueInspectorProps,\n QueueState,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n InMemoryQueue,\n useReactorClientModule,\n type Job,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useQueueInspector(): QueueInspectorProps | undefined {\n const module = useReactorClientModule();\n const reactorClientModule = module?.kind === \"browser\" ? module : undefined;\n const inspector = module?.kind === \"worker\" ? module.inspector : undefined;\n const queue = reactorClientModule?.reactorModule?.queue;\n\n const inMemoryQueue = useMemo(() => {\n if (queue instanceof InMemoryQueue) {\n return queue;\n }\n return undefined;\n }, [queue]);\n\n const getQueueState = useCallback((): Promise<QueueState> => {\n if (inspector) {\n return inspector.getQueueState() as Promise<QueueState>;\n }\n if (!inMemoryQueue) {\n return Promise.resolve({\n isPaused: false,\n pendingJobs: [],\n executingJobs: [],\n totalPending: 0,\n totalExecuting: 0,\n });\n }\n\n const pendingJobs = inMemoryQueue.getPendingJobs();\n const executingJobIds = inMemoryQueue.getExecutingJobIds();\n\n const executingJobs: Job[] = [];\n for (const jobIdSet of executingJobIds.values()) {\n for (const jobId of jobIdSet) {\n const job = inMemoryQueue.getJob(jobId);\n if (job) {\n executingJobs.push(job);\n }\n }\n }\n\n return Promise.resolve({\n isPaused: inMemoryQueue.paused,\n pendingJobs,\n executingJobs,\n totalPending: pendingJobs.length,\n totalExecuting: executingJobs.length,\n });\n }, [inMemoryQueue, inspector]);\n\n const onPause = useCallback(async (): Promise<void> => {\n if (inspector) {\n await inspector.pauseQueue();\n return;\n }\n if (inMemoryQueue) {\n inMemoryQueue.pause();\n }\n }, [inMemoryQueue, inspector]);\n\n const onResume = useCallback(async (): Promise<void> => {\n if (inspector) {\n await inspector.resumeQueue();\n return;\n }\n if (inMemoryQueue) {\n await inMemoryQueue.resume();\n }\n }, [inMemoryQueue, inspector]);\n\n if (!inMemoryQueue && !inspector) {\n return undefined;\n }\n\n return {\n getQueueState,\n onPause,\n onResume,\n };\n}\n","import type {\n ConnectionStateSnapshot,\n Remote,\n} from \"@powerhousedao/reactor-browser\";\nimport {\n addRemoteDrive,\n PollBehavior,\n useConnectionStates,\n useSync,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback } from \"react\";\n\nexport function useRemotesInspector(): {\n getRemotes: () => Promise<Remote[]>;\n removeRemote: (name: string) => Promise<void>;\n addRemoteManual: (url: string) => Promise<void>;\n triggerPull: (name: string) => void;\n connectionStates: ReadonlyMap<string, ConnectionStateSnapshot>;\n} {\n const syncManager = useSync();\n if (!syncManager) {\n throw new Error(\"Sync manager not found\");\n }\n\n const connectionStates = useConnectionStates();\n\n const getRemotes = useCallback(() => {\n return Promise.resolve(syncManager.list());\n }, [syncManager]);\n\n const removeRemote = useCallback(\n (name: string) => syncManager.remove(name),\n [syncManager],\n );\n\n const addRemoteManual = useCallback(async (url: string) => {\n await addRemoteDrive(url, undefined, {\n pollBehavior: PollBehavior.Manual,\n });\n }, []);\n\n const triggerPull = useCallback(\n (name: string) => syncManager.triggerPull(name),\n [syncManager],\n );\n\n return {\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n };\n}\n","import type { WorkerInspectorProps } from \"@powerhousedao/design-system/connect\";\nimport { useReactorClientModule } from \"@powerhousedao/reactor-browser\";\nimport { useMemo } from \"react\";\n\nexport function useWorkerInspector(): WorkerInspectorProps | undefined {\n const module = useReactorClientModule();\n const adminClient =\n module?.kind === \"worker\" ? module.adminClient : undefined;\n\n return useMemo(() => {\n if (!adminClient) {\n return undefined;\n }\n return {\n getInfo: () => adminClient.info(),\n onRestart: () => adminClient.restart(),\n };\n }, [adminClient]);\n}\n","import { InspectorModal as ConnectInspectorModal } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n REACTOR_SCHEMA,\n usePHModal,\n} from \"@powerhousedao/reactor-browser\";\nimport { useDbExplorer } from \"./useDbExplorer.js\";\nimport { useDebugInspector } from \"./useDebugInspector.js\";\nimport { useIntegrityInspector } from \"./useIntegrityInspector.js\";\nimport { useProcessorsInspector } from \"./useProcessorsInspector.js\";\nimport { useQueueInspector } from \"./useQueueInspector.js\";\nimport { useRemotesInspector } from \"./useRemotesInspector.js\";\nimport { useWorkerInspector } from \"./useWorkerInspector.js\";\n\nconst DEFAULT_PAGE_SIZE = 25;\n\nexport const InspectorModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"inspector\";\n\n const { getTables, getTableRows, getDefaultSort, onExportDb, onImportDb } =\n useDbExplorer();\n const {\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n } = useRemotesInspector();\n const queueInspectorProps = useQueueInspector();\n const processorsInspectorProps = useProcessorsInspector();\n const integrityInspectorProps = useIntegrityInspector();\n const workerInspectorProps = useWorkerInspector();\n const { currentPgVersion, supportedPgVersions, onResetToPgVersion } =\n useDebugInspector();\n\n return (\n <ConnectInspectorModal\n open={open}\n onOpenChange={(status) => {\n if (!status) closePHModal();\n }}\n dbExplorerProps={{\n schema: REACTOR_SCHEMA,\n getTables,\n getTableRows,\n getDefaultSort,\n pageSize: DEFAULT_PAGE_SIZE,\n onExportDb,\n onImportDb,\n pgVersionControl: {\n currentPgVersion,\n supportedPgVersions,\n onResetToPgVersion,\n },\n }}\n remotesInspectorProps={{\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n }}\n queueInspectorProps={queueInspectorProps}\n processorsInspectorProps={processorsInspectorProps}\n integrityInspectorProps={integrityInspectorProps}\n workerInspectorProps={workerInspectorProps}\n />\n );\n};\n"],"names":["ConnectInspectorModal"],"mappings":";;;;;;;;;;;;;AAuBA,eAAe,aAAa,OAA8B;AACxD,OAAM,IAAI,SAAe,YAAY,MAAM,YAAY,SAAS,CAAC,CAAC;;AAQpE,eAAe,gBAAgB,QAMb;AAChB,OAAM,IAAI,SAAe,SAAS,WAAW;AAC3C,SAAO,OAAO,GAAG,OAAO,QAAQ,QAAS,MAAM,OAAO,IAAI,GAAG,SAAS,CAAE;GACxE;;AAmCJ,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACD;AASD,SAAS,4BACP,WACkB;AAMlB,QAAO,IAAI,OAAiB,EAC1B,SAAS,IAAI,cANuB,EACpC,OAAO,OAAO,WAAW,YAAY,EACnC,MAAO,MAAM,UAAU,eAAe,WAAW,OAAO,EACzD,GACF,CAEyD,EACzD,CAAC;;AAGJ,SAAgB,gBAAgB;CAC9B,MAAM,kBAAkB,aAAa;CACrC,MAAM,SAAS,WAAW;CAC1B,MAAM,SAAS,wBAAwB;CACvC,MAAM,sBAAsB,QAAQ,SAAS,YAAY,SAAS,KAAA;CAClE,MAAM,UAAU,qBAAqB,eAAe;CACpD,MAAM,QAAQ,qBAAqB,eAAe;CAClD,MAAM,eAAe,QAAQ,SAAS,WAAW,SAAS,KAAA;CAC1D,MAAM,iBAAiB,cAEnB,eACI,4BAA4B,aAAa,UAAU,GACnD,KAAA,GACN,CAAC,aAAa,CACf;CACD,MAAM,WAAW,mBAAmB;CAEpC,MAAM,YAAY,YAAY,YAAkC;AAC9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A,CAAC,YAAY,CAAC;;;;ACHnB,MAAM,oBAAoB;AAE1B,MAAa,uBAAiC;CAE5C,MAAM,OADU,YAAY,EACN,SAAS;CAE/B,MAAM,EAAE,WAAW,cAAc,gBAAgB,YAAY,eAC3D,eAAe;CACjB,MAAM,EACJ,YACA,cACA,iBACA,aACA,qBACE,qBAAqB;CACzB,MAAM,sBAAsB,mBAAmB;CAC/C,MAAM,2BAA2B,wBAAwB;CACzD,MAAM,0BAA0B,uBAAuB;CACvD,MAAM,uBAAuB,oBAAoB;CACjD,MAAM,EAAE,kBAAkB,qBAAqB,uBAC7C,mBAAmB;AAErB,QACE,oBAACA,kBAAD;EACQ;EACN,eAAe,WAAW;AACxB,OAAI,CAAC,OAAQ,eAAc;;EAE7B,iBAAiB;GACf,QAAQ;GACR;GACA;GACA;GACA,UAAU;GACV;GACA;GACA,kBAAkB;IAChB;IACA;IACA;IACD;GACF;EACD,uBAAuB;GACrB;GACA;GACA;GACA;GACA;GACD;EACoB;EACK;EACD;EACH;EACtB,CAAA","debug_id":"ea927a87-6dc2-5f43-ac5d-78c2d11c49ea"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { n as useRenownLoginProps } from "./use-renown-login-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d887e388-fe1d-5cb4-be2b-077139eb8d77")}catch(e){}}();
|
|
3
|
+
import { n as useRenownLoginProps } from "./use-renown-login-DBdWV-o8.js";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { useLayoutEffect, useMemo } from "react";
|
|
6
6
|
import { closePHModal, usePHModal, useUser } from "@powerhousedao/reactor-browser";
|
|
@@ -71,5 +71,5 @@ const LoginModal = () => {
|
|
|
71
71
|
//#endregion
|
|
72
72
|
export { LoginModal };
|
|
73
73
|
|
|
74
|
-
//# sourceMappingURL=LoginModal-
|
|
75
|
-
//# debugId=
|
|
74
|
+
//# sourceMappingURL=LoginModal-B6ZwgiO1.js.map
|
|
75
|
+
//# debugId=d887e388-fe1d-5cb4-be2b-077139eb8d77
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginModal-
|
|
1
|
+
{"version":3,"file":"LoginModal-B6ZwgiO1.js","sources":["../src/components/modal/modals/LoginModal.tsx"],"sourcesContent":["import { Icon } from \"@powerhousedao/design-system\";\nimport { Modal } from \"@powerhousedao/design-system\";\nimport { RenownLoginMethods } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n usePHModal,\n useUser,\n} from \"@powerhousedao/reactor-browser\";\nimport React, { useLayoutEffect, useMemo } from \"react\";\nimport { useRenownLoginProps } from \"../../../hooks/use-renown-login.js\";\n\n// The single login surface, opened via showPHModal({ type: \"login\" }). Matches\n// the other modals' chrome (title + close, rounded-2xl, p-6).\nexport const LoginModal: React.FC = () => {\n const phModal = usePHModal();\n const user = useUser();\n const {\n methods: baseMethods,\n onLogin,\n loading,\n error,\n } = useRenownLoginProps();\n const open = phModal?.type === \"login\";\n\n // A method that opens its own modal (wallet/Privy) closes this one first, so\n // the two surfaces never overlap.\n const methods = useMemo(\n () =>\n baseMethods?.map((method) => ({\n ...method,\n onSelect: () => {\n closePHModal();\n method.onSelect();\n },\n })),\n [baseMethods],\n );\n\n useLayoutEffect(() => {\n if (open && user) closePHModal();\n }, [open, user]);\n\n const hasMethods = !!methods && methods.length > 0;\n\n return (\n <Modal\n open={open}\n onOpenChange={(next) => {\n if (!next) closePHModal();\n }}\n title=\"Log in\"\n contentProps={{ className: \"rounded-2xl\" }}\n >\n <div className=\"w-96 max-w-[calc(100vw-2rem)] rounded-2xl bg-background p-6 text-foreground\">\n <div className=\"mb-6 flex items-center justify-between\">\n <h1 className=\"text-xl font-bold text-foreground\">Log in</h1>\n <button\n type=\"button\"\n aria-label=\"Close\"\n onClick={() => closePHModal()}\n className=\"flex size-8 items-center justify-center rounded-md bg-muted text-muted-foreground outline-none hover:hover-effect\"\n >\n <Icon name=\"Xmark\" size={20} />\n </button>\n </div>\n {hasMethods ? (\n <RenownLoginMethods\n methods={methods}\n loading={loading}\n error={error}\n />\n ) : (\n <>\n <button\n type=\"button\"\n onClick={onLogin}\n disabled={loading}\n className=\"flex h-10 w-full items-center justify-center rounded-lg bg-primary text-sm font-semibold text-primary-foreground transition-colors hover:bg-primary/85 active:active-effect disabled:cursor-wait disabled:opacity-60\"\n >\n {loading ? (\n <Icon name=\"Reload\" size={14} className=\"animate-spin\" />\n ) : (\n <span>Connect</span>\n )}\n </button>\n {error ? (\n <p className=\"mt-2 text-center text-xs text-destructive\">\n {error}\n </p>\n ) : null}\n </>\n )}\n </div>\n </Modal>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAaA,MAAa,mBAA6B;CACxC,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,SAAS;CACtB,MAAM,EACJ,SAAS,aACT,SACA,SACA,UACE,qBAAqB;CACzB,MAAM,OAAO,SAAS,SAAS;CAI/B,MAAM,UAAU,cAEZ,aAAa,KAAK,YAAY;EAC5B,GAAG;EACH,gBAAgB;AACd,iBAAc;AACd,UAAO,UAAU;;EAEpB,EAAE,EACL,CAAC,YAAY,CACd;AAED,uBAAsB;AACpB,MAAI,QAAQ,KAAM,eAAc;IAC/B,CAAC,MAAM,KAAK,CAAC;CAEhB,MAAM,aAAa,CAAC,CAAC,WAAW,QAAQ,SAAS;AAEjD,QACE,oBAAC,OAAD;EACQ;EACN,eAAe,SAAS;AACtB,OAAI,CAAC,KAAM,eAAc;;EAE3B,OAAM;EACN,cAAc,EAAE,WAAW,eAAe;YAE1C,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,qBAAC,OAAD;IAAK,WAAU;cAAf,CACE,oBAAC,MAAD;KAAI,WAAU;eAAoC;KAAW,CAAA,EAC7D,oBAAC,UAAD;KACE,MAAK;KACL,cAAW;KACX,eAAe,cAAc;KAC7B,WAAU;eAEV,oBAAC,MAAD;MAAM,MAAK;MAAQ,MAAM;MAAM,CAAA;KACxB,CAAA,CACL;OACL,aACC,oBAAC,oBAAD;IACW;IACA;IACF;IACP,CAAA,GAEF,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,UAAD;IACE,MAAK;IACL,SAAS;IACT,UAAU;IACV,WAAU;cAET,UACC,oBAAC,MAAD;KAAM,MAAK;KAAS,MAAM;KAAI,WAAU;KAAiB,CAAA,GAEzD,oBAAC,QAAD,EAAA,UAAM,WAAc,CAAA;IAEf,CAAA,EACR,QACC,oBAAC,KAAD;IAAG,WAAU;cACV;IACC,CAAA,GACF,KACH,EAAA,CAAA,CAED;;EACA,CAAA","debug_id":"d887e388-fe1d-5cb4-be2b-077139eb8d77"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { _ as getPendingImportFiles, g as clearPendingImportFiles, h as runOpenFileImports, o as DriveIcon, v as pendingFileKey, y as subscribePendingImportFiles } from "./app-loader-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="06f7f73b-5dfa-5c88-a0ce-9555c8fd0ff3")}catch(e){}}();
|
|
3
|
+
import { _ as getPendingImportFiles, g as clearPendingImportFiles, h as runOpenFileImports, o as DriveIcon, v as pendingFileKey, y as subscribePendingImportFiles } from "./app-loader-Cqq42L7A.js";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
6
|
import { useEffect, useState, useSyncExternalStore } from "react";
|
|
@@ -289,5 +289,5 @@ function OpenFileDocumentsModal() {
|
|
|
289
289
|
//#endregion
|
|
290
290
|
export { OpenFileDocumentsModal };
|
|
291
291
|
|
|
292
|
-
//# sourceMappingURL=OpenFileDocumentsModal-
|
|
293
|
-
//# debugId=
|
|
292
|
+
//# sourceMappingURL=OpenFileDocumentsModal-C4bpVasz.js.map
|
|
293
|
+
//# debugId=06f7f73b-5dfa-5c88-a0ce-9555c8fd0ff3
|
package/dist/{OpenFileDocumentsModal-C95lcnWB.js.map → OpenFileDocumentsModal-C4bpVasz.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenFileDocumentsModal-C95lcnWB.js","sources":["../src/utils/open-file-plan.ts","../src/components/modal/modals/OpenFileDocumentsModal.tsx"],"sourcesContent":["import { isDocumentTypeSupported } from \"@powerhousedao/reactor-browser\";\nimport type { Node } from \"@powerhousedao/shared/document-drive\";\nimport {\n getNextCopyNumber,\n isFileNode,\n} from \"@powerhousedao/shared/document-drive\";\n\n// Pure pre-flight planning for the open-file picker: given the pending files,\n// their parse results and the selected drive's nodes, decide per file whether\n// it can be imported, whether it collides with an existing document, and what\n// name it should be stored under. No reactor access — everything here derives\n// synchronously so the picker can recompute on every drive switch.\n\n/** What the one-time parse of a pending file yielded. */\nexport type ParsedFileInfo =\n | { state: \"parsed\"; id: string; documentType: string; headerName: string }\n // The document model isn't installed: the import path's package\n // auto-discovery may still resolve it, so the file stays importable —\n // but its header is unknown, so no duplicate check is possible.\n | { state: \"model-missing\" }\n // Corrupt zip / not a Powerhouse document.\n | { state: \"invalid\" };\n\nexport type PlannedRow =\n | { kind: \"checking\" }\n | { kind: \"invalid\" }\n | { kind: \"unsupported\" }\n | {\n kind: \"ready\";\n finalName: string;\n duplicate?: \"id\" | \"name\";\n renamed: boolean;\n };\n\nexport type PlanEntry = {\n /** Stable identity of the pending file (see pendingFileKey). */\n key: string;\n file: File;\n /** undefined while the parse is still in flight. */\n parsed: ParsedFileInfo | undefined;\n};\n\n/** Same name normalization the import stores (use-on-drop-file convention). */\nexport function storedFileName(file: File): string {\n return file.name.replace(/\\..+/gim, \"\");\n}\n\n/**\n * Duplicate semantics mirror the import path's isDocumentInLocation, scoped\n * to the drive ROOT: an id match, or a file node with the same name AND the\n * same document type. Renames follow the drive-tree copy convention\n * (\"name (copy) N\" via getNextCopyNumber). Names assigned within the batch\n * accumulate into the collision set, so two pending files that would store\n * the same name never end up identical either.\n */\nexport function planOpenFileImports(args: {\n entries: PlanEntry[];\n nodes: Node[];\n documentTypes: string[] | undefined;\n}): Map<string, PlannedRow> {\n const { entries, nodes, documentTypes } = args;\n const rootNodes = nodes.filter(\n (node) => (node.parentFolder ?? null) === null,\n );\n const rows = new Map<string, PlannedRow>();\n const assignedNames = new Set<string>();\n\n function uniqueName(base: string, driveNames: string[]): string {\n const collides = driveNames.includes(base) || assignedNames.has(base);\n if (!collides) return base;\n const candidates = [...driveNames, ...assignedNames];\n return `${base} (copy) ${getNextCopyNumber(candidates, base)}`;\n }\n\n for (const { key, file, parsed } of entries) {\n if (!parsed) {\n rows.set(key, { kind: \"checking\" });\n continue;\n }\n if (parsed.state === \"invalid\") {\n rows.set(key, { kind: \"invalid\" });\n continue;\n }\n\n if (parsed.state === \"model-missing\") {\n const base = storedFileName(file) || file.name;\n const finalName = uniqueName(base, []);\n assignedNames.add(finalName);\n rows.set(key, {\n kind: \"ready\",\n finalName,\n renamed: finalName !== base,\n });\n continue;\n }\n\n if (!isDocumentTypeSupported(parsed.documentType, documentTypes)) {\n rows.set(key, { kind: \"unsupported\" });\n continue;\n }\n\n // The stored name falls back to the document's own header name when the\n // file name is extension-only (\".phd\" normalizes to \"\").\n const base = storedFileName(file) || parsed.headerName;\n const sameTypeNames = rootNodes\n .filter(\n (node) => isFileNode(node) && node.documentType === parsed.documentType,\n )\n .map((node) => node.name);\n const idDuplicate = rootNodes.some((node) => node.id === parsed.id);\n const nameDuplicate = sameTypeNames.includes(base);\n\n const finalName = uniqueName(base, sameTypeNames);\n assignedNames.add(finalName);\n rows.set(key, {\n kind: \"ready\",\n finalName,\n duplicate: nameDuplicate ? \"name\" : idDuplicate ? \"id\" : undefined,\n renamed: finalName !== base,\n });\n }\n\n return rows;\n}\n","import { DriveIcon } from \"@powerhousedao/connect/components\";\nimport {\n clearPendingImportFiles,\n getPendingImportFiles,\n pendingFileKey,\n planOpenFileImports,\n runOpenFileImports,\n subscribePendingImportFiles,\n type ParsedFileInfo,\n type PlanEntry,\n type PlannedOpenFileImport,\n} from \"@powerhousedao/connect/utils\";\nimport { Modal } from \"@powerhousedao/design-system\";\nimport {\n Combobox,\n formatFileSize,\n ModalButton,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n DocumentModelNotFoundError,\n loadFile,\n setSelectedDrive,\n showPHModal,\n useDocumentTypes,\n useDrives,\n usePHModal,\n useUserPermissions,\n} from \"@powerhousedao/reactor-browser\";\nimport { useEffect, useState, useSyncExternalStore } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\n// Drive picker for documents opened through the OS file association (PWA\n// File Handling). This is the flow's ONLY dialog state: validity and\n// duplicate checks run up-front against the selected drive (inline errors,\n// automatic \"(copy) N\" renames surfaced as \"Rename and import\"), and on\n// confirmation the dialog closes — progress is shown by the floating upload\n// panel (OpenFileUploadList) driven from utils/open-file-uploads.ts, the same\n// UI drag-and-drop uses.\n//\n// The component only mounts while the modal is shown (ModalsContainer keys on\n// the modal type), so picker state starts fresh on every open.\n\n// Parse results are cached at module level so they survive the create-drive\n// detour (which unmounts this component) and are computed once per pending\n// file — loadFile replays the file's full operation history. Only header\n// fields are retained, never the parsed document. In-flight promises are\n// cached too, deduplicating StrictMode double-effects.\nconst parseCache = new Map<string, ParsedFileInfo | Promise<ParsedFileInfo>>();\n\nasync function parsePendingFile(file: File): Promise<ParsedFileInfo> {\n try {\n const document = await loadFile(file);\n return {\n state: \"parsed\",\n id: document.header.id,\n documentType: document.header.documentType,\n headerName: document.header.name,\n };\n } catch (error) {\n // Missing document model ≠ invalid: the import path's package\n // auto-discovery may still resolve it.\n if (DocumentModelNotFoundError.isError(error)) {\n return { state: \"model-missing\" };\n }\n return { state: \"invalid\" };\n }\n}\n\nexport function OpenFileDocumentsModal() {\n const phModal = usePHModal();\n const open = phModal?.type === \"openFileDocuments\";\n const { t } = useTranslation();\n const drives = useDrives();\n const documentTypes = useDocumentTypes();\n const { isAllowedToCreateDocuments } = useUserPermissions();\n const pendingFiles = useSyncExternalStore(\n subscribePendingImportFiles,\n getPendingImportFiles,\n );\n\n const [pickedDriveId, setPickedDriveId] = useState<string>();\n const [, setParseVersion] = useState(0);\n\n // Kick off (and cache) the one-time parse of each pending file. Gated on\n // the reactor being ready — never cache \"reactor not initialized\" as a\n // parse result; the effect re-runs when files change and drives arriving\n // re-render the modal anyway.\n useEffect(() => {\n if (!window.ph?.reactorClient) return;\n let cancelled = false;\n const pendingKeys = new Set(pendingFiles.map(pendingFileKey));\n for (const key of parseCache.keys()) {\n if (!pendingKeys.has(key)) parseCache.delete(key);\n }\n for (const file of pendingFiles) {\n const key = pendingFileKey(file);\n if (parseCache.has(key)) continue;\n const promise = parsePendingFile(file).then((info) => {\n parseCache.set(key, info);\n return info;\n });\n parseCache.set(key, promise);\n void promise.then(() => {\n if (!cancelled) setParseVersion((version) => version + 1);\n });\n }\n return () => {\n cancelled = true;\n };\n }, [pendingFiles]);\n\n // The first drive is preselected so opening a file is a single\n // confirmation; the select lets the user switch destination.\n const selectedDriveId = pickedDriveId ?? drives?.[0]?.header.id;\n const selectedDrive = drives?.find(\n (drive) => drive.header.id === selectedDriveId,\n );\n\n const driveOptions = (drives ?? []).map((drive) => ({\n // New local drives carry their name only in the global state until the\n // header syncs.\n label: drive.header.name || drive.state.global.name,\n value: drive.header.id,\n drive,\n }));\n type DriveOption = (typeof driveOptions)[number];\n\n // Pure derivations — recomputed on drive switch, on files arriving, and on\n // parses settling.\n const entries: PlanEntry[] = pendingFiles.map((file) => {\n const cached = parseCache.get(pendingFileKey(file));\n return {\n key: pendingFileKey(file),\n file,\n parsed: cached instanceof Promise ? undefined : cached,\n };\n });\n const plan = selectedDrive\n ? planOpenFileImports({\n entries,\n nodes: selectedDrive.state.global.nodes,\n documentTypes,\n })\n : new Map<string, never>();\n\n const planRows = [...plan.values()];\n const readyCount = planRows.filter((row) => row.kind === \"ready\").length;\n const anyChecking = planRows.some((row) => row.kind === \"checking\");\n const anyRenamed = planRows.some(\n (row) => row.kind === \"ready\" && row.renamed,\n );\n\n function onImport() {\n const drive = selectedDrive;\n if (!drive) return;\n const imports: PlannedOpenFileImport[] = [];\n for (const { key, file } of entries) {\n const row = plan.get(key);\n if (row?.kind === \"ready\") imports.push({ file, name: row.finalName });\n }\n if (imports.length === 0) return;\n // Ordering matters: the pending store must be cleared BEFORE the modal\n // closes — the launch-queue listener reopens this picker whenever the\n // modal clears while files are still pending.\n clearPendingImportFiles();\n closePHModal();\n setSelectedDrive(drive);\n void runOpenFileImports({\n driveId: drive.header.id,\n imports,\n documentTypes,\n });\n }\n\n function onCancel() {\n clearPendingImportFiles();\n closePHModal();\n }\n\n if (!open) return null;\n\n const hasDrives = (drives?.length ?? 0) > 0;\n\n function rowAnnotation(key: string) {\n const row = plan.get(key);\n if (!row) return null;\n switch (row.kind) {\n case \"checking\":\n return (\n <span className=\"text-xs text-muted-foreground\">\n {t(\"modals.openFileDocuments.checking\")}\n </span>\n );\n case \"invalid\":\n return (\n <span className=\"text-xs text-destructive\">\n {t(\"modals.openFileDocuments.invalidFile\")}\n </span>\n );\n case \"unsupported\":\n return (\n <span className=\"text-xs text-destructive\">\n {t(\"modals.openFileDocuments.unsupportedType\")}\n </span>\n );\n case \"ready\":\n // \"name\": same name + type already in the drive, so the file is\n // renamed to a copy. \"id\": same document id, imported as a fresh copy\n // under its original name. A row that only got renamed to avoid\n // clashing with another file in THIS batch is NOT in the drive, so it\n // must not claim to be — it gets the neutral rename hint instead.\n if (row.duplicate === \"name\") {\n return (\n <span className=\"text-xs text-muted-foreground\">\n {t(\"modals.openFileDocuments.duplicateHint\", {\n name: row.finalName,\n })}\n </span>\n );\n }\n if (row.duplicate === \"id\") {\n return (\n <span className=\"text-xs text-muted-foreground\">\n {t(\"modals.openFileDocuments.duplicateCopyHint\")}\n </span>\n );\n }\n if (row.renamed) {\n return (\n <span className=\"text-xs text-muted-foreground\">\n {t(\"modals.openFileDocuments.renamedHint\", {\n name: row.finalName,\n })}\n </span>\n );\n }\n return null;\n }\n }\n\n return (\n <Modal\n open={open}\n onOpenChange={(status) => {\n if (!status) onCancel();\n }}\n // The drive select's dropdown must be able to spill past the dialog\n // bounds instead of being clipped (the menu cannot portal to <body>:\n // Radix's modal pointer-events lock would make it unclickable there).\n contentProps={{ className: \"overflow-visible\" }}\n >\n <div className=\"w-[520px] p-6\">\n <div className=\"pb-2 text-2xl font-bold text-foreground\">\n {t(\"modals.openFileDocuments.title\", {\n count: pendingFiles.length,\n })}\n </div>\n\n {!isAllowedToCreateDocuments ? (\n <>\n <div className=\"my-6 rounded-md bg-background p-4 text-center text-foreground\">\n {t(\"modals.openFileDocuments.notAllowed\")}\n </div>\n <div className=\"mt-8 flex\">\n <ModalButton variant=\"cancel\" onClick={onCancel}>\n {t(\"common.cancel\")}\n </ModalButton>\n </div>\n </>\n ) : (\n <>\n <div className=\"my-4 flex flex-col gap-1 text-sm text-foreground\">\n {pendingFiles.map((file, index) => {\n const key = pendingFileKey(file);\n const annotation = rowAnnotation(key);\n return (\n <div\n key={`${index}-${key}`}\n className=\"flex flex-col gap-0.5 rounded-md bg-background px-3 py-2\"\n >\n <div className=\"flex justify-between gap-2\">\n <span className=\"truncate\">{file.name}</span>\n <span className=\"shrink-0 text-muted-foreground\">\n {formatFileSize(file.size)}\n </span>\n </div>\n {annotation}\n </div>\n );\n })}\n </div>\n\n {hasDrives ? (\n <>\n <div className=\"mb-2 text-sm text-muted-foreground\">\n {t(\"modals.openFileDocuments.body\")}\n </div>\n <Combobox\n id=\"open-file-documents-drive\"\n isSearchable={false}\n options={driveOptions}\n value={\n driveOptions.find(\n (option) => option.value === selectedDriveId,\n ) ?? null\n }\n onChange={(option) =>\n setPickedDriveId((option as DriveOption).value)\n }\n formatOptionLabel={(option) => {\n const { label, drive } = option as DriveOption;\n return (\n <span className=\"flex items-center gap-2\">\n <DriveIcon drive={drive} />\n <span className=\"truncate\">{label}</span>\n </span>\n );\n }}\n maxMenuHeight={200}\n />\n </>\n ) : (\n <div className=\"my-6 rounded-md bg-background p-4 text-center text-foreground\">\n {t(\"modals.openFileDocuments.noDrives\")}\n </div>\n )}\n\n <div className=\"mt-8 flex justify-between gap-3\">\n <ModalButton variant=\"cancel\" onClick={onCancel}>\n {t(\"common.cancel\")}\n </ModalButton>\n {hasDrives ? (\n <ModalButton\n variant=\"confirm\"\n disabled={!selectedDriveId || readyCount === 0 || anyChecking}\n onClick={onImport}\n >\n {anyRenamed\n ? t(\"modals.openFileDocuments.renameAndImport\")\n : t(\"modals.openFileDocuments.import\")}\n </ModalButton>\n ) : (\n <ModalButton\n variant=\"confirm\"\n onClick={() => showPHModal({ type: \"addDrive\" })}\n >\n {t(\"modals.openFileDocuments.createDrive\")}\n </ModalButton>\n )}\n </div>\n </>\n )}\n </div>\n </Modal>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AA2CA,SAAgB,eAAe,MAAoB;AACjD,QAAO,KAAK,KAAK,QAAQ,WAAW,GAAG;;;;;;;;;;AAWzC,SAAgB,oBAAoB,MAIR;CAC1B,MAAM,EAAE,SAAS,OAAO,kBAAkB;CAC1C,MAAM,YAAY,MAAM,QACrB,UAAU,KAA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,SAAQ;MACR,eAAe,YAAY,EAAE,MAAM,YAAY,CAAC;gBAE/C,EAAE,uCAAuC;MAC9B,CAAA,CAEZ;;IACL,EAAA,CAAA,CAED;;EACA,CAAA","debug_id":"c3a1dbec-6f17-5d16-86f4-12f86816f22a"}
|
|
1
|
+
{"version":3,"file":"OpenFileDocumentsModal-C4bpVasz.js","sources":["../src/utils/open-file-plan.ts","../src/components/modal/modals/OpenFileDocumentsModal.tsx"],"sourcesContent":["import { isDocumentTypeSupported } from \"@powerhousedao/reactor-browser\";\nimport type { Node } from \"@powerhousedao/shared/document-drive\";\nimport {\n getNextCopyNumber,\n isFileNode,\n} from \"@powerhousedao/shared/document-drive\";\n\n// Pure pre-flight planning for the open-file picker: given the pending files,\n// their parse results and the selected drive's nodes, decide per file whether\n// it can be imported, whether it collides with an existing document, and what\n// name it should be stored under. No reactor access — everything here derives\n// synchronously so the picker can recompute on every drive switch.\n\n/** What the one-time parse of a pending file yielded. */\nexport type ParsedFileInfo =\n | { state: \"parsed\"; id: string; documentType: string; headerName: string }\n // The document model isn't installed: the import path's package\n // auto-discovery may still resolve it, so the file stays importable —\n // but its header is unknown, so no duplicate check is possible.\n | { state: \"model-missing\" }\n // Corrupt zip / not a Powerhouse document.\n | { state: \"invalid\" };\n\nexport type PlannedRow =\n | { kind: \"checking\" }\n | { kind: \"invalid\" }\n | { kind: \"unsupported\" }\n | {\n kind: \"ready\";\n finalName: string;\n duplicate?: \"id\" | \"name\";\n renamed: boolean;\n };\n\nexport type PlanEntry = {\n /** Stable identity of the pending file (see pendingFileKey). */\n key: string;\n file: File;\n /** undefined while the parse is still in flight. */\n parsed: ParsedFileInfo | undefined;\n};\n\n/** Same name normalization the import stores (use-on-drop-file convention). */\nexport function storedFileName(file: File): string {\n return file.name.replace(/\\..+/gim, \"\");\n}\n\n/**\n * Duplicate semantics mirror the import path's isDocumentInLocation, scoped\n * to the drive ROOT: an id match, or a file node with the same name AND the\n * same document type. Renames follow the drive-tree copy convention\n * (\"name (copy) N\" via getNextCopyNumber). Names assigned within the batch\n * accumulate into the collision set, so two pending files that would store\n * the same name never end up identical either.\n */\nexport function planOpenFileImports(args: {\n entries: PlanEntry[];\n nodes: Node[];\n documentTypes: string[] | undefined;\n}): Map<string, PlannedRow> {\n const { entries, nodes, documentTypes } = args;\n const rootNodes = nodes.filter(\n (node) => (node.parentFolder ?? null) === null,\n );\n const rows = new Map<string, PlannedRow>();\n const assignedNames = new Set<string>();\n\n function uniqueName(base: string, driveNames: string[]): string {\n const collides = driveNames.includes(base) || assignedNames.has(base);\n if (!collides) return base;\n const candidates = [...driveNames, ...assignedNames];\n return `${base} (copy) ${getNextCopyNumber(candidates, base)}`;\n }\n\n for (const { key, file, parsed } of entries) {\n if (!parsed) {\n rows.set(key, { kind: \"checking\" });\n continue;\n }\n if (parsed.state === \"invalid\") {\n rows.set(key, { kind: \"invalid\" });\n continue;\n }\n\n if (parsed.state === \"model-missing\") {\n const base = storedFileName(file) || file.name;\n const finalName = uniqueName(base, []);\n assignedNames.add(finalName);\n rows.set(key, {\n kind: \"ready\",\n finalName,\n renamed: finalName !== base,\n });\n continue;\n }\n\n if (!isDocumentTypeSupported(parsed.documentType, documentTypes)) {\n rows.set(key, { kind: \"unsupported\" });\n continue;\n }\n\n // The stored name falls back to the document's own header name when the\n // file name is extension-only (\".phd\" normalizes to \"\").\n const base = storedFileName(file) || parsed.headerName;\n const sameTypeNames = rootNodes\n .filter(\n (node) => isFileNode(node) && node.documentType === parsed.documentType,\n )\n .map((node) => node.name);\n const idDuplicate = rootNodes.some((node) => node.id === parsed.id);\n const nameDuplicate = sameTypeNames.includes(base);\n\n const finalName = uniqueName(base, sameTypeNames);\n assignedNames.add(finalName);\n rows.set(key, {\n kind: \"ready\",\n finalName,\n duplicate: nameDuplicate ? \"name\" : idDuplicate ? \"id\" : undefined,\n renamed: finalName !== base,\n });\n }\n\n return rows;\n}\n","import { DriveIcon } from \"@powerhousedao/connect/components\";\nimport {\n clearPendingImportFiles,\n getPendingImportFiles,\n pendingFileKey,\n planOpenFileImports,\n runOpenFileImports,\n subscribePendingImportFiles,\n type ParsedFileInfo,\n type PlanEntry,\n type PlannedOpenFileImport,\n} from \"@powerhousedao/connect/utils\";\nimport { Modal } from \"@powerhousedao/design-system\";\nimport {\n Combobox,\n formatFileSize,\n ModalButton,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n DocumentModelNotFoundError,\n loadFile,\n setSelectedDrive,\n showPHModal,\n useDocumentTypes,\n useDrives,\n usePHModal,\n useUserPermissions,\n} from \"@powerhousedao/reactor-browser\";\nimport { useEffect, useState, useSyncExternalStore } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\n// Drive picker for documents opened through the OS file association (PWA\n// File Handling). This is the flow's ONLY dialog state: validity and\n// duplicate checks run up-front against the selected drive (inline errors,\n// automatic \"(copy) N\" renames surfaced as \"Rename and import\"), and on\n// confirmation the dialog closes — progress is shown by the floating upload\n// panel (OpenFileUploadList) driven from utils/open-file-uploads.ts, the same\n// UI drag-and-drop uses.\n//\n// The component only mounts while the modal is shown (ModalsContainer keys on\n// the modal type), so picker state starts fresh on every open.\n\n// Parse results are cached at module level so they survive the create-drive\n// detour (which unmounts this component) and are computed once per pending\n// file — loadFile replays the file's full operation history. Only header\n// fields are retained, never the parsed document. In-flight promises are\n// cached too, deduplicating StrictMode double-effects.\nconst parseCache = new Map<string, ParsedFileInfo | Promise<ParsedFileInfo>>();\n\nasync function parsePendingFile(file: File): Promise<ParsedFileInfo> {\n try {\n const document = await loadFile(file);\n return {\n state: \"parsed\",\n id: document.header.id,\n documentType: document.header.documentType,\n headerName: document.header.name,\n };\n } catch (error) {\n // Missing document model ≠ invalid: the import path's package\n // auto-discovery may still resolve it.\n if (DocumentModelNotFoundError.isError(error)) {\n return { state: \"model-missing\" };\n }\n return { state: \"invalid\" };\n }\n}\n\nexport function OpenFileDocumentsModal() {\n const phModal = usePHModal();\n const open = phModal?.type === \"openFileDocuments\";\n const { t } = useTranslation();\n const drives = useDrives();\n const documentTypes = useDocumentTypes();\n const { isAllowedToCreateDocuments } = useUserPermissions();\n const pendingFiles = useSyncExternalStore(\n subscribePendingImportFiles,\n getPendingImportFiles,\n );\n\n const [pickedDriveId, setPickedDriveId] = useState<string>();\n const [, setParseVersion] = useState(0);\n\n // Kick off (and cache) the one-time parse of each pending file. Gated on\n // the reactor being ready — never cache \"reactor not initialized\" as a\n // parse result; the effect re-runs when files change and drives arriving\n // re-render the modal anyway.\n useEffect(() => {\n if (!window.ph?.reactorClient) return;\n let cancelled = false;\n const pendingKeys = new Set(pendingFiles.map(pendingFileKey));\n for (const key of parseCache.keys()) {\n if (!pendingKeys.has(key)) parseCache.delete(key);\n }\n for (const file of pendingFiles) {\n const key = pendingFileKey(file);\n if (parseCache.has(key)) continue;\n const promise = parsePendingFile(file).then((info) => {\n parseCache.set(key, info);\n return info;\n });\n parseCache.set(key, promise);\n void promise.then(() => {\n if (!cancelled) setParseVersion((version) => version + 1);\n });\n }\n return () => {\n cancelled = true;\n };\n }, [pendingFiles]);\n\n // The first drive is preselected so opening a file is a single\n // confirmation; the select lets the user switch destination.\n const selectedDriveId = pickedDriveId ?? drives?.[0]?.header.id;\n const selectedDrive = drives?.find(\n (drive) => drive.header.id === selectedDriveId,\n );\n\n const driveOptions = (drives ?? []).map((drive) => ({\n // New local drives carry their name only in the global state until the\n // header syncs.\n label: drive.header.name || drive.state.global.name,\n value: drive.header.id,\n drive,\n }));\n type DriveOption = (typeof driveOptions)[number];\n\n // Pure derivations — recomputed on drive switch, on files arriving, and on\n // parses settling.\n const entries: PlanEntry[] = pendingFiles.map((file) => {\n const cached = parseCache.get(pendingFileKey(file));\n return {\n key: pendingFileKey(file),\n file,\n parsed: cached instanceof Promise ? undefined : cached,\n };\n });\n const plan = selectedDrive\n ? planOpenFileImports({\n entries,\n nodes: selectedDrive.state.global.nodes,\n documentTypes,\n })\n : new Map<string, never>();\n\n const planRows = [...plan.values()];\n const readyCount = planRows.filter((row) => row.kind === \"ready\").length;\n const anyChecking = planRows.some((row) => row.kind === \"checking\");\n const anyRenamed = planRows.some(\n (row) => row.kind === \"ready\" && row.renamed,\n );\n\n function onImport() {\n const drive = selectedDrive;\n if (!drive) return;\n const imports: PlannedOpenFileImport[] = [];\n for (const { key, file } of entries) {\n const row = plan.get(key);\n if (row?.kind === \"ready\") imports.push({ file, name: row.finalName });\n }\n if (imports.length === 0) return;\n // Ordering matters: the pending store must be cleared BEFORE the modal\n // closes — the launch-queue listener reopens this picker whenever the\n // modal clears while files are still pending.\n clearPendingImportFiles();\n closePHModal();\n setSelectedDrive(drive);\n void runOpenFileImports({\n driveId: drive.header.id,\n imports,\n documentTypes,\n });\n }\n\n function onCancel() {\n clearPendingImportFiles();\n closePHModal();\n }\n\n if (!open) return null;\n\n const hasDrives = (drives?.length ?? 0) > 0;\n\n function rowAnnotation(key: string) {\n const row = plan.get(key);\n if (!row) return null;\n switch (row.kind) {\n case \"checking\":\n return (\n <span className=\"text-xs text-muted-foreground\">\n {t(\"modals.openFileDocuments.checking\")}\n </span>\n );\n case \"invalid\":\n return (\n <span className=\"text-xs text-destructive\">\n {t(\"modals.openFileDocuments.invalidFile\")}\n </span>\n );\n case \"unsupported\":\n return (\n <span className=\"text-xs text-destructive\">\n {t(\"modals.openFileDocuments.unsupportedType\")}\n </span>\n );\n case \"ready\":\n // \"name\": same name + type already in the drive, so the file is\n // renamed to a copy. \"id\": same document id, imported as a fresh copy\n // under its original name. A row that only got renamed to avoid\n // clashing with another file in THIS batch is NOT in the drive, so it\n // must not claim to be — it gets the neutral rename hint instead.\n if (row.duplicate === \"name\") {\n return (\n <span className=\"text-xs text-muted-foreground\">\n {t(\"modals.openFileDocuments.duplicateHint\", {\n name: row.finalName,\n })}\n </span>\n );\n }\n if (row.duplicate === \"id\") {\n return (\n <span className=\"text-xs text-muted-foreground\">\n {t(\"modals.openFileDocuments.duplicateCopyHint\")}\n </span>\n );\n }\n if (row.renamed) {\n return (\n <span className=\"text-xs text-muted-foreground\">\n {t(\"modals.openFileDocuments.renamedHint\", {\n name: row.finalName,\n })}\n </span>\n );\n }\n return null;\n }\n }\n\n return (\n <Modal\n open={open}\n onOpenChange={(status) => {\n if (!status) onCancel();\n }}\n // The drive select's dropdown must be able to spill past the dialog\n // bounds instead of being clipped (the menu cannot portal to <body>:\n // Radix's modal pointer-events lock would make it unclickable there).\n contentProps={{ className: \"overflow-visible\" }}\n >\n <div className=\"w-[520px] p-6\">\n <div className=\"pb-2 text-2xl font-bold text-foreground\">\n {t(\"modals.openFileDocuments.title\", {\n count: pendingFiles.length,\n })}\n </div>\n\n {!isAllowedToCreateDocuments ? (\n <>\n <div className=\"my-6 rounded-md bg-background p-4 text-center text-foreground\">\n {t(\"modals.openFileDocuments.notAllowed\")}\n </div>\n <div className=\"mt-8 flex\">\n <ModalButton variant=\"cancel\" onClick={onCancel}>\n {t(\"common.cancel\")}\n </ModalButton>\n </div>\n </>\n ) : (\n <>\n <div className=\"my-4 flex flex-col gap-1 text-sm text-foreground\">\n {pendingFiles.map((file, index) => {\n const key = pendingFileKey(file);\n const annotation = rowAnnotation(key);\n return (\n <div\n key={`${index}-${key}`}\n className=\"flex flex-col gap-0.5 rounded-md bg-background px-3 py-2\"\n >\n <div className=\"flex justify-between gap-2\">\n <span className=\"truncate\">{file.name}</span>\n <span className=\"shrink-0 text-muted-foreground\">\n {formatFileSize(file.size)}\n </span>\n </div>\n {annotation}\n </div>\n );\n })}\n </div>\n\n {hasDrives ? (\n <>\n <div className=\"mb-2 text-sm text-muted-foreground\">\n {t(\"modals.openFileDocuments.body\")}\n </div>\n <Combobox\n id=\"open-file-documents-drive\"\n isSearchable={false}\n options={driveOptions}\n value={\n driveOptions.find(\n (option) => option.value === selectedDriveId,\n ) ?? null\n }\n onChange={(option) =>\n setPickedDriveId((option as DriveOption).value)\n }\n formatOptionLabel={(option) => {\n const { label, drive } = option as DriveOption;\n return (\n <span className=\"flex items-center gap-2\">\n <DriveIcon drive={drive} />\n <span className=\"truncate\">{label}</span>\n </span>\n );\n }}\n maxMenuHeight={200}\n />\n </>\n ) : (\n <div className=\"my-6 rounded-md bg-background p-4 text-center text-foreground\">\n {t(\"modals.openFileDocuments.noDrives\")}\n </div>\n )}\n\n <div className=\"mt-8 flex justify-between gap-3\">\n <ModalButton variant=\"cancel\" onClick={onCancel}>\n {t(\"common.cancel\")}\n </ModalButton>\n {hasDrives ? (\n <ModalButton\n variant=\"confirm\"\n disabled={!selectedDriveId || readyCount === 0 || anyChecking}\n onClick={onImport}\n >\n {anyRenamed\n ? t(\"modals.openFileDocuments.renameAndImport\")\n : t(\"modals.openFileDocuments.import\")}\n </ModalButton>\n ) : (\n <ModalButton\n variant=\"confirm\"\n onClick={() => showPHModal({ type: \"addDrive\" })}\n >\n {t(\"modals.openFileDocuments.createDrive\")}\n </ModalButton>\n )}\n </div>\n </>\n )}\n </div>\n </Modal>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AA2CA,SAAgB,eAAe,MAAoB;AACjD,QAAO,KAAK,KAAK,QAAQ,WAAW,GAAG;;;;;;;;;;AAWzC,SAAgB,oBAAoB,MAIR;CAC1B,MAAM,EAAE,SAAS,OAAO,kBAAkB;CAC1C,MAAM,YAAY,MAAM,QACrB,UAAU,KAAK,gBAAgB,UAAU,KAC3C;CACD,MAAM,uBAAO,IAAI,KAAyB;CAC1C,MAAM,gCAAgB,IAAI,KAAa;CAEvC,SAAS,WAAW,MAAc,YAA8B;AAE9D,MAAI,EADa,WAAW,SAAS,KAAK,IAAI,cAAc,IAAI,KAAK,EACtD,QAAO;AAEtB,SAAO,GAAG,KAAK,UAAU,kBADN,CAAC,GAAG,YAAY,GAAG,cAAc,EACG,KAAK;;AAG9D,MAAK,MAAM,EAAE,KAAK,MAAM,YAAY,SAAS;AAC3C,MAAI,CAAC,QAAQ;AACX,QAAK,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC;;AAEF,MAAI,OAAO,UAAU,WAAW;AAC9B,QAAK,IAAI,K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BAAC,OAAD;KAAK,WAAU;eACZ,EAAE,gCAAgC;KAC/B,CAAA,EACN,oBAAC,UAAD;KACE,IAAG;KACH,cAAc;KACd,SAAS;KACT,OACE,aAAa,MACV,WAAW,OAAO,UAAU,gBAC9B,IAAI;KAEP,WAAW,WACT,iBAAkB,OAAuB,MAAM;KAEjD,oBAAoB,WAAW;MAC7B,MAAM,EAAE,OAAO,UAAU;AACzB,aACE,qBAAC,QAAD;OAAM,WAAU;iBAAhB,CACE,oBAAC,WAAD,EAAkB,OAAS,CAAA,EAC3B,oBAAC,QAAD;QAAM,WAAU;kBAAY;QAAa,CAAA,CACpC;;;KAGX,eAAe;KACf,CAAA,CACD,EAAA,CAAA,GAEH,oBAAC,OAAD;KAAK,WAAU;eACZ,EAAE,oCAAoC;KACnC,CAAA;IAGR,qBAAC,OAAD;KAAK,WAAU;eAAf,CACE,oBAAC,aAAD;MAAa,SAAQ;MAAS,SAAS;gBACpC,EAAE,gBAAgB;MACP,CAAA,EACb,YACC,oBAAC,aAAD;MACE,SAAQ;MACR,UAAU,CAAC,mBAAmB,eAAe,KAAK;MAClD,SAAS;gBAER,aACG,EAAE,2CAA2C,GAC7C,EAAE,kCAAkC;MAC5B,CAAA,GAEd,oBAAC,aAAD;MACE,SAAQ;MACR,eAAe,YAAY,EAAE,MAAM,YAAY,CAAC;gBAE/C,EAAE,uCAAuC;MAC9B,CAAA,CAEZ;;IACL,EAAA,CAAA,CAED;;EACA,CAAA","debug_id":"06f7f73b-5dfa-5c88-a0ce-9555c8fd0ff3"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { t as package_default } from "./package-
|
|
4
|
-
import { i as shortGitSha, n as getGitUrl, t as getGitSha } from "./build-info-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c4f56f50-0ffd-57ab-a23b-0297fdba1adb")}catch(e){}}();
|
|
3
|
+
import { t as package_default } from "./package-DNX1H93i.js";
|
|
4
|
+
import { i as shortGitSha, n as getGitUrl, t as getGitSha } from "./build-info-D98hbIth.js";
|
|
5
5
|
import { r as connectConfig } from "./connect.config-C-b_Yhd6.js";
|
|
6
6
|
import { n as toast } from "./toast-BLv8rjmy.js";
|
|
7
7
|
import { t as useRegistryPackages } from "./useRegistryPackages-DMhCvTWq.js";
|
|
@@ -298,5 +298,5 @@ const SettingsModal = () => {
|
|
|
298
298
|
//#endregion
|
|
299
299
|
export { SettingsModal };
|
|
300
300
|
|
|
301
|
-
//# sourceMappingURL=SettingsModal-
|
|
302
|
-
//# debugId=
|
|
301
|
+
//# sourceMappingURL=SettingsModal-BEV0jFw1.js.map
|
|
302
|
+
//# debugId=c4f56f50-0ffd-57ab-a23b-0297fdba1adb
|