@powerhousedao/connect 6.2.2-dev.88 → 6.2.2-staging.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/{ClearStorageModal-DtEpNLDG.js → ClearStorageModal-DXV7eveG.js} +4 -4
  2. package/dist/{ClearStorageModal-DtEpNLDG.js.map → ClearStorageModal-DXV7eveG.js.map} +1 -1
  3. package/dist/{DebugSettingsModal-DWS66LZC.js → DebugSettingsModal-D-8XfrLE.js} +4 -4
  4. package/dist/{DebugSettingsModal-DWS66LZC.js.map → DebugSettingsModal-D-8XfrLE.js.map} +1 -1
  5. package/dist/{InspectorModal-Dpj80N57.js → InspectorModal-Fnp57gG_.js} +4 -4
  6. package/dist/{InspectorModal-Dpj80N57.js.map → InspectorModal-Fnp57gG_.js.map} +1 -1
  7. package/dist/{OpenFileDocumentsModal-Ce9e8v7P.js → OpenFileDocumentsModal-Bp2SFfGY.js} +4 -4
  8. package/dist/{OpenFileDocumentsModal-Ce9e8v7P.js.map → OpenFileDocumentsModal-Bp2SFfGY.js.map} +1 -1
  9. package/dist/{SettingsModal-DNR3p-Nn.js → SettingsModal-BKyrRL4W.js} +5 -5
  10. package/dist/{SettingsModal-DNR3p-Nn.js.map → SettingsModal-BKyrRL4W.js.map} +1 -1
  11. package/dist/app-loader-1ACi7O7G.js +4 -0
  12. package/dist/{app-loader-DKZyJF5-.js → app-loader-9oxJxBSC.js} +9 -9
  13. package/dist/{app-loader-DKZyJF5-.js.map → app-loader-9oxJxBSC.js.map} +1 -1
  14. package/dist/{build-info-BNwlWZFA.js → build-info-Ck0vFY36.js} +5 -5
  15. package/dist/{build-info-BNwlWZFA.js.map → build-info-Ck0vFY36.js.map} +1 -1
  16. package/dist/components-C5E86_ow.js +4 -0
  17. package/dist/{load-Cs6aowAt.js → load-CvwtlhbX.js} +5 -5
  18. package/dist/{load-Cs6aowAt.js.map → load-CvwtlhbX.js.map} +1 -1
  19. package/dist/main.js +1 -1
  20. package/dist/{reactor-DolibVYk.js → reactor-CrKlyk9q.js} +4 -4
  21. package/dist/{reactor-DolibVYk.js.map → reactor-CrKlyk9q.js.map} +1 -1
  22. package/dist/start-connect.js +1 -1
  23. package/package.json +12 -12
  24. package/dist/app-loader-SIpDHhUx.js +0 -4
  25. package/dist/components-B22wJQKu.js +0 -4
@@ -1,12 +1,12 @@
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]="936320b2-acc8-5c46-b7f7-9a16e0dc83c8")}catch(e){}}();
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]="6c03f4cd-805b-50b6-b93f-a8834e4c75fb")}catch(e){}}();
3
3
  import { buildTreeUrl, shortGitSha } from "@powerhousedao/shared";
4
4
  //#region src/utils/build-info.ts
5
5
  function getVersion() {
6
- return "6.2.2-dev.88";
6
+ return "6.2.2-staging.0";
7
7
  }
8
8
  function getGitSha() {
9
- return "6294bd7d4d5ca19710d74447f33757da2e43a7d4";
9
+ return "1537bf32c27de170e3df4a03abd40dd720abc65c";
10
10
  }
11
11
  /**
12
12
  * Build identity baked in at build time (define PH_CONNECT_BUILD_HASH —
@@ -24,5 +24,5 @@ function getGitUrl() {
24
24
  //#endregion
25
25
  export { shortGitSha as a, getVersion as i, getGitSha as n, getGitUrl as r, getBuildHash as t };
26
26
 
27
- //# sourceMappingURL=build-info-BNwlWZFA.js.map
28
- //# debugId=936320b2-acc8-5c46-b7f7-9a16e0dc83c8
27
+ //# sourceMappingURL=build-info-Ck0vFY36.js.map
28
+ //# debugId=6c03f4cd-805b-50b6-b93f-a8834e4c75fb
@@ -1 +1 @@
1
- {"version":3,"file":"build-info-BNwlWZFA.js","sources":["../src/utils/build-info.ts"],"sourcesContent":["import { buildTreeUrl, shortGitSha } from \"@powerhousedao/shared\";\nimport { packageJson } from \"./package-json.js\";\n\nexport { shortGitSha };\n\ndeclare const CONNECT_VERSION: string | undefined;\ndeclare const CONNECT_GIT_SHA: string | undefined;\ndeclare const PH_CONNECT_BUILD_HASH: string | undefined;\n\nexport function getVersion(): string {\n if (typeof CONNECT_VERSION !== \"undefined\") return CONNECT_VERSION;\n return (\n process.env.WORKSPACE_VERSION ??\n process.env.npm_package_version ??\n packageJson.version\n );\n}\n\nexport function getGitSha(): string {\n if (typeof CONNECT_GIT_SHA !== \"undefined\") return CONNECT_GIT_SHA;\n return process.env.WORKSPACE_GIT_SHA ?? \"unknown\";\n}\n\n/**\n * Build identity baked in at build time (define PH_CONNECT_BUILD_HASH —\n * see builder-tools' connectBuildHashPlugin). Identical builds of the same\n * inputs produce the same hash; any change to the deployed content (Connect\n * version, project config, package list, build options) changes it.\n */\nexport function getBuildHash(): string {\n if (typeof PH_CONNECT_BUILD_HASH !== \"undefined\")\n return PH_CONNECT_BUILD_HASH;\n return \"unknown\";\n}\n\nexport function getGitUrl(): string | null {\n return buildTreeUrl(getGitSha());\n}\n"],"names":[],"mappings":";;;;AASA,SAAgB,aAAqB;AACS,QAAA;;AAQ9C,SAAgB,YAAoB;AACU,QAAA;;;;;;;;AAU9C,SAAgB,eAAuB;AACrC,KAAI,OAAO,0BAA0B,YACnC,QAAO;AACT,QAAO;;AAGT,SAAgB,YAA2B;AACzC,QAAO,aAAa,WAAW,CAAC","debug_id":"936320b2-acc8-5c46-b7f7-9a16e0dc83c8"}
1
+ {"version":3,"file":"build-info-Ck0vFY36.js","sources":["../src/utils/build-info.ts"],"sourcesContent":["import { buildTreeUrl, shortGitSha } from \"@powerhousedao/shared\";\nimport { packageJson } from \"./package-json.js\";\n\nexport { shortGitSha };\n\ndeclare const CONNECT_VERSION: string | undefined;\ndeclare const CONNECT_GIT_SHA: string | undefined;\ndeclare const PH_CONNECT_BUILD_HASH: string | undefined;\n\nexport function getVersion(): string {\n if (typeof CONNECT_VERSION !== \"undefined\") return CONNECT_VERSION;\n return (\n process.env.WORKSPACE_VERSION ??\n process.env.npm_package_version ??\n packageJson.version\n );\n}\n\nexport function getGitSha(): string {\n if (typeof CONNECT_GIT_SHA !== \"undefined\") return CONNECT_GIT_SHA;\n return process.env.WORKSPACE_GIT_SHA ?? \"unknown\";\n}\n\n/**\n * Build identity baked in at build time (define PH_CONNECT_BUILD_HASH —\n * see builder-tools' connectBuildHashPlugin). Identical builds of the same\n * inputs produce the same hash; any change to the deployed content (Connect\n * version, project config, package list, build options) changes it.\n */\nexport function getBuildHash(): string {\n if (typeof PH_CONNECT_BUILD_HASH !== \"undefined\")\n return PH_CONNECT_BUILD_HASH;\n return \"unknown\";\n}\n\nexport function getGitUrl(): string | null {\n return buildTreeUrl(getGitSha());\n}\n"],"names":[],"mappings":";;;;AASA,SAAgB,aAAqB;AACS,QAAA;;AAQ9C,SAAgB,YAAoB;AACU,QAAA;;;;;;;;AAU9C,SAAgB,eAAuB;AACrC,KAAI,OAAO,0BAA0B,YACnC,QAAO;AACT,QAAO;;AAGT,SAAgB,YAA2B;AACzC,QAAO,aAAa,WAAW,CAAC","debug_id":"6c03f4cd-805b-50b6-b93f-a8834e4c75fb"}
@@ -0,0 +1,4 @@
1
+ import { t as AppLoader } from "./app-loader-9oxJxBSC.js";
2
+ export { AppLoader };
3
+ !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]="fe379782-e654-548d-84db-07888a72c975")}catch(e){}}();
4
+ //# debugId=fe379782-e654-548d-84db-07888a72c975
@@ -1,9 +1,9 @@
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]="361db11b-22a0-5b97-ba51-97290bab9e74")}catch(e){}}();
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]="4321bb4d-4f50-51cf-af13-b02d0a30b15c")}catch(e){}}();
3
3
  import { r as loadRuntimeConfig, t as applyConnectBranding } from "./runtime-config-DL3QjcfM.js";
4
- import { t as getBuildHash } from "./build-info-BNwlWZFA.js";
4
+ import { t as getBuildHash } from "./build-info-Ck0vFY36.js";
5
5
  import { r as connectConfig } from "./connect.config-DaHDEUrw.js";
6
- import { n as createReactor } from "./reactor-DolibVYk.js";
6
+ import { n as createReactor } from "./reactor-CrKlyk9q.js";
7
7
  import { a as detectReactorPgMajor, i as detectMigrationMajor } from "./connection-state-3w4liC1X.js";
8
8
  import { n as seedPendingPgVersion } from "./pglite-seed-BqAUvNFw.js";
9
9
  import { n as setUser } from "./sentry-QXKgQmr2.js";
@@ -127,5 +127,5 @@ async function loadComponent(localPackage) {
127
127
  //#endregion
128
128
  export { loadComponent };
129
129
 
130
- //# sourceMappingURL=load-Cs6aowAt.js.map
131
- //# debugId=361db11b-22a0-5b97-ba51-97290bab9e74
130
+ //# sourceMappingURL=load-CvwtlhbX.js.map
131
+ //# debugId=4321bb4d-4f50-51cf-af13-b02d0a30b15c
@@ -1 +1 @@
1
- {"version":3,"file":"load-Cs6aowAt.js","sources":["../src/hooks/useCheckLatestVersion.ts","../src/hooks/utils.ts","../src/store/user.ts","../src/components/load.tsx"],"sourcesContent":["import { connectConfig } from \"@powerhousedao/connect/config\";\nimport { getBuildHashStatus } from \"@powerhousedao/connect/hooks\";\nimport { logger } from \"document-model\";\nimport { useEffect } from \"react\";\n\n// Session-scoped guard: records the deployed hash this tab already reloaded\n// for, so a broken or rolling deploy (server hash keeps changing under us)\n// cannot turn the tab into a reload loop. Cleared implicitly with the tab.\nconst RELOADED_FOR_KEY = \"ph-reloaded-for-build-hash\";\n\n/**\n * Drop the service worker's stale caches (precache + the NetworkFirst shell\n * cache) before reloading onto a new deploy, so the post-reload navigation\n * is answered from the network / fresh build instead of leftovers of the\n * build we are leaving. Best-effort: if the Caches API is unavailable or a\n * delete fails, the reload still picks up the new shell (the navigation\n * route is NetworkFirst).\n */\nasync function clearStaleCaches(): Promise<void> {\n try {\n if (!(\"caches\" in window)) return;\n const keys = await window.caches.keys();\n await Promise.all(\n keys\n .filter((key) => key.includes(\"precache\") || key.includes(\"ph-shell\"))\n .map((key) => window.caches.delete(key)),\n );\n } catch (error) {\n logger.warn(\n \"Failed to clear stale caches before update reload @error\",\n error,\n );\n }\n}\n\n/**\n * Detects that the server is serving a different build than the one this\n * page was loaded from (a new deploy) and reloads onto it — once per session\n * per deployed hash. Checked on mount and whenever the tab returns to the\n * foreground, so a deploy that lands while the tab sits open is picked up on\n * the next focus without a manual reload. The in-tab \"new version available\"\n * service-worker prompt (ServiceWorkerUpdatePrompt) remains the opt-in path\n * for workers that are waiting but not yet controlling.\n */\nexport const useCheckLatestVersion = () => {\n useEffect(() => {\n if (\n import.meta.env.MODE === \"development\" ||\n connectConfig.studioMode ||\n !connectConfig.warnOutdatedApp\n ) {\n return;\n }\n\n const checkBuildHash = async () => {\n const status = await getBuildHashStatus();\n if (!status || status.isCurrent) return;\n\n const reloadedFor = window.sessionStorage.getItem(RELOADED_FOR_KEY);\n if (reloadedFor === status.deployedHash) return;\n window.sessionStorage.setItem(RELOADED_FOR_KEY, status.deployedHash);\n\n logger.info(\n \"New deploy detected — reloading from build @currentHash to @deployedHash\",\n status.currentHash,\n status.deployedHash,\n );\n await clearStaleCaches();\n window.location.reload();\n };\n\n void checkBuildHash();\n const onVisibilityChange = () => {\n if (document.visibilityState === \"visible\") void checkBuildHash();\n };\n document.addEventListener(\"visibilitychange\", onVisibilityChange);\n return () => {\n document.removeEventListener(\"visibilitychange\", onVisibilityChange);\n };\n }, []);\n};\n","import { getBuildHash } from \"../utils/build-info.js\";\n\nexport const isMac = window.navigator.appVersion.includes(\"Mac\");\n\nexport interface BuildHashStatus {\n /** Hash baked into the running build. */\n currentHash: string;\n /** Hash the server is currently serving. */\n deployedHash: string;\n /** true when the running build matches what the server serves. */\n isCurrent: boolean;\n}\n\n/**\n * Same-origin build-identity probe. The build bakes a hash of the inputs that\n * determine the deployed content into the bundle (define\n * `PH_CONNECT_BUILD_HASH`, see builder-tools' connectBuildHashPlugin) and\n * emits `build-hash.json` next to the app (served no-cache). Comparing the\n * two tells us whether the server is serving a different build than the one\n * this page was loaded from — the reliable \"a new deploy went out\" signal.\n * Unlike the old GitHub-raw version check it works on localhost (it compares\n * against what the origin actually serves, not a remote branch head) and\n * needs no network beyond the app's own origin.\n *\n * Returns null when there is nothing to compare: dev/studio builds (no hash\n * baked), a server predating `build-hash.json`, an offline fetch, or a\n * malformed body.\n */\nexport const getBuildHashStatus = async (): Promise<BuildHashStatus | null> => {\n const currentHash = getBuildHash();\n if (!currentHash || currentHash === \"unknown\") return null;\n try {\n const result = await fetch(`${import.meta.env.BASE_URL}build-hash.json`, {\n cache: \"no-cache\",\n });\n if (!result.ok) return null;\n const data = (await result.json()) as { hash?: unknown };\n if (typeof data.hash !== \"string\" || !data.hash) return null;\n return {\n currentHash,\n deployedHash: data.hash,\n isCurrent: data.hash === currentHash,\n };\n } catch {\n return null;\n }\n};\n","import { useUser } from \"@powerhousedao/reactor-browser\";\nimport type { User as SentryUser } from \"@sentry/react\";\nimport { useEffect } from \"react\";\nimport { setUser as setSentryUser } from \"../services/sentry.js\";\n\nexport function useSetSentryUser() {\n const user = useUser();\n useEffect(() => {\n let sentryUser: SentryUser | null = null;\n if (user) {\n // saves the user info except the credential\n const { credential: _credential, ...rest } = user;\n sentryUser = { id: rest.did, username: rest.ens?.name, ...rest };\n }\n setSentryUser(sentryUser);\n }, [user]);\n}\n","import { useCheckLatestVersion } from \"@powerhousedao/connect/hooks\";\nimport \"@powerhousedao/connect/i18n\";\nimport { createReactor, useSetSentryUser } from \"@powerhousedao/connect/store\";\nimport {\n detectMigrationMajor,\n detectReactorPgMajor,\n seedPendingPgVersion,\n} from \"@powerhousedao/connect/utils\";\nimport { initTheme } from \"@powerhousedao/reactor-browser\";\nimport type { DocumentModelLib } from \"document-model\";\nimport { type ReactNode } from \"react\";\nimport { applyConnectBranding, loadRuntimeConfig } from \"../runtime-config.js\";\n\nexport async function loadComponent(localPackage?: DocumentModelLib) {\n await seedPendingPgVersion();\n await Promise.all([detectReactorPgMajor(), detectMigrationMajor()]);\n const runtimeConfig = await loadRuntimeConfig();\n applyConnectBranding(runtimeConfig);\n await createReactor(localPackage);\n return {\n default: ({ children }: { children?: ReactNode }) => {\n initTheme();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSetSentryUser();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useCheckLatestVersion();\n return children;\n },\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAQA,MAAM,mBAAmB;;;;;;;;;AAUzB,eAAe,mBAAkC;AAC/C,KAAI;AACF,MAAI,EAAE,YAAY,QAAS;EAC3B,MAAM,OAAO,MAAM,OAAO,OAAO,MAAM;AACvC,QAAM,QAAQ,IACZ,KACG,QAAQ,QAAQ,IAAI,SAAS,WAAW,IAAI,IAAI,SAAS,WAAW,CAAC,CACrE,KAAK,QAAQ,OAAO,OAAO,OAAO,IAAI,CAAC,CAC3C;UACM,OAAO;AACd,SAAO,KACL,4DACA,MACD;;;;;;;;;;;;AAaL,MAAa,8BAA8B;AACzC,iBAAgB;AACd,MACE,OAAO,KAAK,IAAI,SAAS,iBACzB,cAAc,cACd,CAAC,cAAc,gBAEf;EAGF,MAAM,iBAAiB,YAAY;GACjC,MAAM,SAAS,MAAM,oBAAoB;AACzC,O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BAAsB,EAAE,sBAAsB,CAAC,CAAC;AAEnE,sBADsB,MAAM,mBAAmB,CACZ;AACnC,OAAM,cAAc,aAAa;AACjC,QAAO,EACL,UAAU,EAAE,eAAyC;AACnD,aAAW;AAEX,oBAAkB;AAElB,yBAAuB;AACvB,SAAO;IAEV","debug_id":"361db11b-22a0-5b97-ba51-97290bab9e74"}
1
+ {"version":3,"file":"load-CvwtlhbX.js","sources":["../src/hooks/useCheckLatestVersion.ts","../src/hooks/utils.ts","../src/store/user.ts","../src/components/load.tsx"],"sourcesContent":["import { connectConfig } from \"@powerhousedao/connect/config\";\nimport { getBuildHashStatus } from \"@powerhousedao/connect/hooks\";\nimport { logger } from \"document-model\";\nimport { useEffect } from \"react\";\n\n// Session-scoped guard: records the deployed hash this tab already reloaded\n// for, so a broken or rolling deploy (server hash keeps changing under us)\n// cannot turn the tab into a reload loop. Cleared implicitly with the tab.\nconst RELOADED_FOR_KEY = \"ph-reloaded-for-build-hash\";\n\n/**\n * Drop the service worker's stale caches (precache + the NetworkFirst shell\n * cache) before reloading onto a new deploy, so the post-reload navigation\n * is answered from the network / fresh build instead of leftovers of the\n * build we are leaving. Best-effort: if the Caches API is unavailable or a\n * delete fails, the reload still picks up the new shell (the navigation\n * route is NetworkFirst).\n */\nasync function clearStaleCaches(): Promise<void> {\n try {\n if (!(\"caches\" in window)) return;\n const keys = await window.caches.keys();\n await Promise.all(\n keys\n .filter((key) => key.includes(\"precache\") || key.includes(\"ph-shell\"))\n .map((key) => window.caches.delete(key)),\n );\n } catch (error) {\n logger.warn(\n \"Failed to clear stale caches before update reload @error\",\n error,\n );\n }\n}\n\n/**\n * Detects that the server is serving a different build than the one this\n * page was loaded from (a new deploy) and reloads onto it — once per session\n * per deployed hash. Checked on mount and whenever the tab returns to the\n * foreground, so a deploy that lands while the tab sits open is picked up on\n * the next focus without a manual reload. The in-tab \"new version available\"\n * service-worker prompt (ServiceWorkerUpdatePrompt) remains the opt-in path\n * for workers that are waiting but not yet controlling.\n */\nexport const useCheckLatestVersion = () => {\n useEffect(() => {\n if (\n import.meta.env.MODE === \"development\" ||\n connectConfig.studioMode ||\n !connectConfig.warnOutdatedApp\n ) {\n return;\n }\n\n const checkBuildHash = async () => {\n const status = await getBuildHashStatus();\n if (!status || status.isCurrent) return;\n\n const reloadedFor = window.sessionStorage.getItem(RELOADED_FOR_KEY);\n if (reloadedFor === status.deployedHash) return;\n window.sessionStorage.setItem(RELOADED_FOR_KEY, status.deployedHash);\n\n logger.info(\n \"New deploy detected — reloading from build @currentHash to @deployedHash\",\n status.currentHash,\n status.deployedHash,\n );\n await clearStaleCaches();\n window.location.reload();\n };\n\n void checkBuildHash();\n const onVisibilityChange = () => {\n if (document.visibilityState === \"visible\") void checkBuildHash();\n };\n document.addEventListener(\"visibilitychange\", onVisibilityChange);\n return () => {\n document.removeEventListener(\"visibilitychange\", onVisibilityChange);\n };\n }, []);\n};\n","import { getBuildHash } from \"../utils/build-info.js\";\n\nexport const isMac = window.navigator.appVersion.includes(\"Mac\");\n\nexport interface BuildHashStatus {\n /** Hash baked into the running build. */\n currentHash: string;\n /** Hash the server is currently serving. */\n deployedHash: string;\n /** true when the running build matches what the server serves. */\n isCurrent: boolean;\n}\n\n/**\n * Same-origin build-identity probe. The build bakes a hash of the inputs that\n * determine the deployed content into the bundle (define\n * `PH_CONNECT_BUILD_HASH`, see builder-tools' connectBuildHashPlugin) and\n * emits `build-hash.json` next to the app (served no-cache). Comparing the\n * two tells us whether the server is serving a different build than the one\n * this page was loaded from — the reliable \"a new deploy went out\" signal.\n * Unlike the old GitHub-raw version check it works on localhost (it compares\n * against what the origin actually serves, not a remote branch head) and\n * needs no network beyond the app's own origin.\n *\n * Returns null when there is nothing to compare: dev/studio builds (no hash\n * baked), a server predating `build-hash.json`, an offline fetch, or a\n * malformed body.\n */\nexport const getBuildHashStatus = async (): Promise<BuildHashStatus | null> => {\n const currentHash = getBuildHash();\n if (!currentHash || currentHash === \"unknown\") return null;\n try {\n const result = await fetch(`${import.meta.env.BASE_URL}build-hash.json`, {\n cache: \"no-cache\",\n });\n if (!result.ok) return null;\n const data = (await result.json()) as { hash?: unknown };\n if (typeof data.hash !== \"string\" || !data.hash) return null;\n return {\n currentHash,\n deployedHash: data.hash,\n isCurrent: data.hash === currentHash,\n };\n } catch {\n return null;\n }\n};\n","import { useUser } from \"@powerhousedao/reactor-browser\";\nimport type { User as SentryUser } from \"@sentry/react\";\nimport { useEffect } from \"react\";\nimport { setUser as setSentryUser } from \"../services/sentry.js\";\n\nexport function useSetSentryUser() {\n const user = useUser();\n useEffect(() => {\n let sentryUser: SentryUser | null = null;\n if (user) {\n // saves the user info except the credential\n const { credential: _credential, ...rest } = user;\n sentryUser = { id: rest.did, username: rest.ens?.name, ...rest };\n }\n setSentryUser(sentryUser);\n }, [user]);\n}\n","import { useCheckLatestVersion } from \"@powerhousedao/connect/hooks\";\nimport \"@powerhousedao/connect/i18n\";\nimport { createReactor, useSetSentryUser } from \"@powerhousedao/connect/store\";\nimport {\n detectMigrationMajor,\n detectReactorPgMajor,\n seedPendingPgVersion,\n} from \"@powerhousedao/connect/utils\";\nimport { initTheme } from \"@powerhousedao/reactor-browser\";\nimport type { DocumentModelLib } from \"document-model\";\nimport { type ReactNode } from \"react\";\nimport { applyConnectBranding, loadRuntimeConfig } from \"../runtime-config.js\";\n\nexport async function loadComponent(localPackage?: DocumentModelLib) {\n await seedPendingPgVersion();\n await Promise.all([detectReactorPgMajor(), detectMigrationMajor()]);\n const runtimeConfig = await loadRuntimeConfig();\n applyConnectBranding(runtimeConfig);\n await createReactor(localPackage);\n return {\n default: ({ children }: { children?: ReactNode }) => {\n initTheme();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSetSentryUser();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useCheckLatestVersion();\n return children;\n },\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAQA,MAAM,mBAAmB;;;;;;;;;AAUzB,eAAe,mBAAkC;AAC/C,KAAI;AACF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,KAAM,QAAO;AACxD,SAAO;GACL;GACA,cAAc,KAAK;GACnB,WAAW,KAAK,SAAS;GAC1B;SACK;AACN,SAAO;;;;;ACvCX,SAAgB,mBAAmB;CACjC,MAAM,OAAO,SAAS;AACtB,iBAAgB;EACd,IAAI,aAAgC;AACpC,MAAI,MAAM;GAER,MAAM,EAAE,YAAY,aAAa,GAAG,SAAS;AAC7C,gBAAa;IAAE,IAAI,KAAK;IAAK,UAAU,KAAK,KAAK;IAAM,GAAG;IAAM;;AAElE,UAAc,WAAW;IACxB,CAAC,KAAK,CAAC;;;;ACFZ,eAAsB,cAAc,cAAiC;AACnE,OAAM,sBAAsB;AAC5B,OAAM,QAAQ,IAAI,CAAC,sBAAsB,EAAE,sBAAsB,CAAC,CAAC;AAEnE,sBADsB,MAAM,mBAAmB,CACZ;AACnC,OAAM,cAAc,aAAa;AACjC,QAAO,EACL,UAAU,EAAE,eAAyC;AACnD,aAAW;AAEX,oBAAkB;AAElB,yBAAuB;AACvB,SAAO;IAEV","debug_id":"4321bb4d-4f50-51cf-af13-b02d0a30b15c"}
package/dist/main.js CHANGED
@@ -6,7 +6,7 @@ import { jsx } from "react/jsx-runtime";
6
6
  //#region main.tsx
7
7
  if (!window.ph) window.ph = {};
8
8
  await loadRuntimeConfig();
9
- const { AppLoader } = await import("./app-loader-SIpDHhUx.js");
9
+ const { AppLoader } = await import("./app-loader-1ACi7O7G.js");
10
10
  createRoot(document.getElementById("root")).render(/* @__PURE__ */ jsx(AppLoader, {}));
11
11
  //#endregion
12
12
 
@@ -1,8 +1,8 @@
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]="74da2ef0-c09f-5f0a-841c-83b87d82199a")}catch(e){}}();
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]="bb3bf75e-9d72-5474-a859-7426e7ff2735")}catch(e){}}();
3
3
  import { n as getRuntimeConfig } from "./runtime-config-DL3QjcfM.js";
4
4
  import { a as resolvePgMajorForRuntime, r as loadPGliteModule } from "./pglite-major-B39aOEiE.js";
5
- import { i as getVersion, n as getGitSha } from "./build-info-BNwlWZFA.js";
5
+ import { i as getVersion, n as getGitSha } from "./build-info-Ck0vFY36.js";
6
6
  import { n as buildPHGlobalConfig, o as phGlobalConfig } from "./connect.config-DaHDEUrw.js";
7
7
  import { t as refreshPwaManifestLink } from "./pwa-manifest-link-DIgOSo2Q.js";
8
8
  import { a as detectReactorPgMajor, h as RELATIONAL_PGLITE_NAME, m as REACTOR_PGLITE_NAME, n as setWorkerConnectionStatus, o as detectRelationalPgMajor, p as REACTOR_INSTANCE_NAMESPACE } from "./connection-state-3w4liC1X.js";
@@ -1451,5 +1451,5 @@ function getDriveUrl() {
1451
1451
  //#endregion
1452
1452
  export { createReactor as n, clearReactorStorage as t };
1453
1453
 
1454
- //# sourceMappingURL=reactor-DolibVYk.js.map
1455
- //# debugId=74da2ef0-c09f-5f0a-841c-83b87d82199a
1454
+ //# sourceMappingURL=reactor-CrKlyk9q.js.map
1455
+ //# debugId=bb3bf75e-9d72-5474-a859-7426e7ff2735