@powerhousedao/connect 6.2.3-dev.70 → 6.2.3-dev.71
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/RUNTIME-CONFIG.md +29 -20
- package/dist/{ClearStorageModal-BwGVIuLX.js → ClearStorageModal-DxBXLSmH.js} +4 -4
- package/dist/{ClearStorageModal-BwGVIuLX.js.map → ClearStorageModal-DxBXLSmH.js.map} +1 -1
- package/dist/{DebugSettingsModal-DfOnR4iY.js → DebugSettingsModal-D1I-K2Gf.js} +4 -4
- package/dist/{DebugSettingsModal-DfOnR4iY.js.map → DebugSettingsModal-D1I-K2Gf.js.map} +1 -1
- package/dist/{InspectorModal-BVqRNFfP.js → InspectorModal-D85U4oKJ.js} +4 -4
- package/dist/{InspectorModal-BVqRNFfP.js.map → InspectorModal-D85U4oKJ.js.map} +1 -1
- package/dist/{OpenFileDocumentsModal-BNHD0vg9.js → OpenFileDocumentsModal-B9c-CsKT.js} +4 -4
- package/dist/{OpenFileDocumentsModal-BNHD0vg9.js.map → OpenFileDocumentsModal-B9c-CsKT.js.map} +1 -1
- package/dist/app-loader-D5GEwpML.js +4 -0
- package/dist/{app-loader-DtH6v5CE.js → app-loader-casiq2T2.js} +36 -27
- package/dist/{app-loader-DtH6v5CE.js.map → app-loader-casiq2T2.js.map} +1 -1
- package/dist/{app-skeleton-DFg65Rxa.js → app-skeleton-BHgmbYld.js} +3 -3
- package/dist/{app-skeleton-BFjvlTWd.js → app-skeleton-ClRUYLE_.js} +14 -5
- package/dist/app-skeleton-ClRUYLE_.js.map +1 -0
- package/dist/{boot-N7f3RrY_.js → boot-CFPdHSqB.js} +5 -5
- package/dist/{boot-N7f3RrY_.js.map → boot-CFPdHSqB.js.map} +1 -1
- package/dist/{build-info-TgBEqTq1.js → build-info-Cn2f6llN.js} +5 -5
- package/dist/{build-info-TgBEqTq1.js.map → build-info-Cn2f6llN.js.map} +1 -1
- package/dist/{components-B_wpF5Is.js → components-C4K5xyad.js} +7 -7
- package/dist/{components-B_wpF5Is.js.map → components-C4K5xyad.js.map} +1 -1
- package/dist/{drive-icon-BiVP8yJc.js → drive-icon-BIpd8edR.js} +14 -3
- package/dist/drive-icon-BIpd8edR.js.map +1 -0
- package/dist/generic.js +1 -1
- package/dist/{load-CkbGF6wB.js → load-DcDV9hi4.js} +6 -6
- package/dist/{load-CkbGF6wB.js.map → load-DcDV9hi4.js.map} +1 -1
- package/dist/{load-runtime-config-DXswYA71.js → load-runtime-config-Deq75NYr.js} +4 -4
- package/dist/{load-runtime-config-DXswYA71.js.map → load-runtime-config-Deq75NYr.js.map} +1 -1
- package/dist/main.js +2 -2
- package/dist/{package-manager-CPqbVSd8.js → package-manager-CzBsaUUd.js} +6 -6
- package/dist/{package-manager-CPqbVSd8.js.map → package-manager-CzBsaUUd.js.map} +1 -1
- package/dist/plugin-configs.d.ts +242 -0
- package/dist/plugin-configs.d.ts.map +1 -0
- package/dist/plugin-configs.js +26 -0
- package/dist/plugin-configs.js.map +1 -0
- package/dist/plugins-CegSox2x.js +263 -0
- package/dist/plugins-CegSox2x.js.map +1 -0
- package/dist/prerender.js +9 -5
- package/dist/prerender.js.map +1 -1
- package/dist/{reactor-DLCl-WHi.js → reactor-BGYR1N7Z.js} +5 -5
- package/dist/{reactor-DLCl-WHi.js.map → reactor-BGYR1N7Z.js.map} +1 -1
- package/dist/route-tree.js +1 -1
- package/dist/{route-views-CTARvT5N.js → route-views-2aB1ZZPP.js} +6 -6
- package/dist/route-views-2aB1ZZPP.js.map +1 -0
- package/dist/{route-views-BF0p-4Fi.js → route-views-CDVZytw4.js} +4 -4
- package/dist/{route-views-BF0p-4Fi.js.map → route-views-CDVZytw4.js.map} +1 -1
- package/dist/route-views-D_873yb_.js +4 -0
- package/dist/route-views.js +3 -3
- package/dist/router-B0OQvO11.js +4 -0
- package/dist/{router-L9X9U-97.js → router-Cu0PH6sh.js} +5 -5
- package/dist/router-Cu0PH6sh.js.map +1 -0
- package/dist/{settings-B-apZN_f.js → settings-CFn4TA0g.js} +13 -7
- package/dist/{settings-B-apZN_f.js.map → settings-CFn4TA0g.js.map} +1 -1
- package/dist/{settings-tabs-CRgiuZcb.js → settings-tabs-BC8gAacB.js} +31 -6
- package/dist/settings-tabs-BC8gAacB.js.map +1 -0
- package/dist/shell-core.html +1 -1
- package/dist/shell.html +1 -1
- package/dist/start-connect.js +2 -2
- package/dist/style.css +27 -4
- package/dist/{ui-CwbE23ra.js → ui-BOTsJPoc.js} +7 -7
- package/dist/{ui-CwbE23ra.js.map → ui-BOTsJPoc.js.map} +1 -1
- package/dist/workflows-C3qEvx1R.js +63 -0
- package/dist/workflows-C3qEvx1R.js.map +1 -0
- package/docs/customizing/styles-and-branding.md +1 -1
- package/package.json +23 -17
- package/scripts/assert-plugin-configs.mjs +47 -0
- package/dist/app-loader-BjAXSJQ6.js +0 -4
- package/dist/app-skeleton-BFjvlTWd.js.map +0 -1
- package/dist/drive-icon-BiVP8yJc.js.map +0 -1
- package/dist/plugins-CWbr0n_Q.js +0 -246
- package/dist/plugins-CWbr0n_Q.js.map +0 -1
- package/dist/route-views-CTARvT5N.js.map +0 -1
- package/dist/route-views-D8I-1PWU.js +0 -4
- package/dist/router-BguOMBUh.js +0 -4
- package/dist/router-L9X9U-97.js.map +0 -1
- package/dist/settings-tabs-CRgiuZcb.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-skeleton-ClRUYLE_.js","sources":["../src/components/migration-status.ts","../src/utils/browser.ts","../src/components/app-skeleton.tsx"],"sourcesContent":["export type MigrationPhase = \"clone\" | \"dump\" | \"restore\";\n\nexport type MigrationStatus = {\n idbName: string;\n phase: MigrationPhase;\n};\n\nlet current: MigrationStatus | null = null;\nconst listeners = new Set<() => void>();\n\nexport function setMigrationStatus(status: MigrationStatus | null): void {\n current = status;\n for (const l of listeners) l();\n}\n\nexport function getMigrationStatus(): MigrationStatus | null {\n return current;\n}\n\nexport function subscribeMigrationStatus(cb: () => void): () => void {\n listeners.add(cb);\n return () => {\n listeners.delete(cb);\n };\n}\n","export function getBasePath() {\n if (typeof document === \"undefined\") {\n return \"/\";\n }\n\n const baseEl = document.querySelector(\"base\");\n const href = baseEl?.getAttribute(\"href\");\n return href || \"/\";\n}\n","// Leaf imports, not the `@powerhousedao/connect/{utils,hooks}` barrels: this\n// is the first contentful paint and main.tsx loads it BEFORE the runtime\n// config is fetched. The barrels re-export modules that read the config at\n// module-evaluation (which throws if the config cache isn't warm), so they\n// must stay out of this graph.\nimport { getBasePath } from \"../utils/browser.js\";\nimport { getIsEmbedded } from \"@powerhousedao/connect-core/embedded\";\nimport {\n ConnectSidebar,\n getProjectLoader,\n HomeScreen,\n LogoAnimation,\n} from \"@powerhousedao/design-system/connect\";\nimport { initTheme } from \"@powerhousedao/reactor-browser\";\nimport {\n useEffect,\n useState,\n useSyncExternalStore,\n type PropsWithChildren,\n} from \"react\";\nimport {\n getMigrationStatus,\n subscribeMigrationStatus,\n type MigrationPhase,\n} from \"./migration-status.js\";\nconst LOADER_DELAY = 250;\n\n/** Set by the build when the project's `_app` replaces Connect's layout:\n * the loading state then shows no Connect chrome, only the loader. */\nfunction isCustomShell() {\n return (\n typeof document !== \"undefined\" &&\n document.querySelector('meta[name=\"ph-custom-shell\"]') !== null\n );\n}\n\nconst PHASE_LABEL: Record<MigrationPhase, string> = {\n clone: \"Backing up local database…\",\n dump: \"Exporting data from previous version…\",\n restore: \"Restoring data into the new database…\",\n};\n\nconst MigrationOverlay = () => {\n const status = useSyncExternalStore(\n subscribeMigrationStatus,\n getMigrationStatus,\n () => null,\n );\n if (!status) return null;\n return (\n <div className=\"absolute inset-0 z-20 flex items-center justify-center\">\n <div className=\"rounded-lg bg-card/90 px-6 py-4 text-sm text-foreground shadow-lg\">\n <div className=\"font-medium\">Upgrading local database…</div>\n <div className=\"text-foreground\">{PHASE_LABEL[status.phase]}</div>\n </div>\n </div>\n );\n};\n\nconst Loader = ({ delay = LOADER_DELAY }: { delay?: number }) => {\n const isSSR = typeof window === \"undefined\";\n const showInitialLoader =\n typeof document !== \"undefined\" &&\n document.body.getAttribute(\"data-show-loader\") === \"true\";\n if (!isSSR) {\n initTheme();\n }\n\n const [showLoading, setShowLoading] = useState(!delay || showInitialLoader);\n\n useEffect(() => {\n const id = setTimeout(() => {\n setShowLoading(true);\n // Latch it on the body — the same flag the SSR branch below sets, and\n // the one `showInitialLoader` reads on mount. The bootstrap renders this\n // skeleton, then swaps in the config-dependent app whose Suspense\n // fallback is this same component, which remounts it. Without the latch\n // the delay re-arms and the logo blinks out for another `delay` ms at\n // exactly the moment the app is loading.\n document.body.setAttribute(\"data-show-loader\", \"true\");\n }, delay);\n\n return () => clearTimeout(id);\n }, []);\n\n return (\n <div\n className={`skeleton-loader absolute inset-0 z-10 flex items-center justify-center ${showLoading ? \"\" : \"hidden\"}`}\n >\n {getProjectLoader() ? (\n // The project's loader brings its own motion and shape.\n <LogoAnimation />\n ) : (\n <div className=\"animate-pulse overflow-hidden rounded-full shadow-lg motion-reduce:animate-none\">\n <LogoAnimation />\n </div>\n )}\n {isSSR ? (\n <script\n dangerouslySetInnerHTML={{\n __html: `setTimeout(() => {\n document.querySelector('.skeleton-loader')?.classList.remove('hidden');\n document.body.setAttribute('data-show-loader', 'true');\n }, ${delay})`,\n }}\n />\n ) : null}\n </div>\n );\n};\n\nexport const AppSkeleton: React.FC<PropsWithChildren> = (props) => {\n const isSSR = typeof window === \"undefined\";\n const isHomeScreen = !isSSR && window.location.pathname === getBasePath();\n /* Match Root's behavior: when Connect is rendered inside an embed (e.g. the\n * vetra-studio BUILD iframe), suppress the sidebar during the Suspense\n * fallback so the loading state matches the loaded state. */\n const isEmbedded = !isSSR && getIsEmbedded();\n if (!isSSR && isCustomShell()) {\n return (\n <div className=\"relative flex h-screen overflow-hidden bg-background\">\n {props.children ?? <Loader />}\n <MigrationOverlay />\n </div>\n );\n }\n return (\n <div className=\"flex h-screen overflow-hidden bg-background\">\n {!isEmbedded && (\n <ConnectSidebar\n className=\"animate-pulse motion-reduce:animate-none\"\n onLogin={undefined}\n onDisconnect={undefined}\n onClickSettings={undefined}\n address={undefined}\n />\n )}\n <HomeScreen\n containerClassName={\n isSSR || !isHomeScreen ? \"home-screen hidden\" : undefined\n }\n children={props.children ?? null}\n />\n {isSSR ? (\n <script\n dangerouslySetInnerHTML={{\n __html: `\n const baseEl = document.querySelector('base');\n const href = baseEl?.getAttribute('href');\n const basePath = href || '/';\n if (window.location.pathname === basePath) {\n document.querySelector('.home-screen')?.classList.remove('hidden')\n }`,\n }}\n />\n ) : null}\n {!props.children ? <Loader /> : null}\n <MigrationOverlay />\n </div>\n );\n};\n\nexport default AppSkeleton;\n"],"names":[],"mappings":";;;;;;;;AAOA,IAAI,UAAkC;AACtC,MAAM,4BAAY,IAAI,IAAgB;AAEtC,SAAgB,mBAAmB,QAAsC;CACvE,UAAU;CACV,KAAK,MAAM,KAAK,WAAW,EAAE;AAC/B;AAEA,SAAgB,qBAA6C;CAC3D,OAAO;AACT;AAEA,SAAgB,yBAAyB,IAA4B;CACnE,UAAU,IAAI,EAAE;CAChB,aAAa;EACX,UAAU,OAAO,EAAE;CACrB;AACF;;;ACxBA,SAAgB,cAAc;CAC5B,IAAI,OAAO,aAAa,aACtB,OAAO;CAKT,OAFe,SAAS,cAAc,MACpB,CAAC,EAAE,aAAa,MAAM,KACzB;AACjB;;;ACiBA,MAAM,eAAe;;;AAIrB,SAAS,gBAAgB;CACvB,OACE,OAAO,aAAa,eACpB,SAAS,cAAc,gCAA8B,MAAM;AAE/D;AAEA,MAAM,cAA8C;CAClD,OAAO;CACP,MAAM;CACN,SAAS;AACX;AAEA,MAAM,yBAAyB;CAC7B,MAAM,SAAS,qBACb,0BACA,0BACM,IACR;CACA,IAAI,CAAC,QAAQ,OAAO;CACpB,OACE,oBAAC,OAAD;EAAK,WAAU;EACb,UAAA,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,oBAAC,OAAD;IAAK,WAAU;I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T,cAAc,KAAA;IACd,iBAAiB,KAAA;IACjB,SAAS,KAAA;GACV,CAAA;GAEH,oBAAC,YAAD;IACE,oBACE,SAAS,CAAC,eAAe,uBAAuB,KAAA;IAElD,UAAU,MAAM,YAAY;GAC7B,CAAA;GACA,QACC,oBAAC,UAAD,EACE,yBAAyB,EACvB,QAAQ;;;;;;uBAOV,EACD,CAAA,IACC;GACH,CAAC,MAAM,WAAW,oBAAC,QAAD,CAAS,CAAA,IAAI;GAChC,oBAAC,kBAAD,CAAmB,CAAA;EAChB;;AAET","debug_id":"7b32800f-4bc4-5752-a2e9-86b7868c2afa"}
|
|
@@ -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]="38599def-db4f-5d26-9e84-dc3c1ed30360")}catch(e){}}();
|
|
3
3
|
import { i as hasPrerenderedShell, r as adoptPrerenderedShell } from "./prerendered-shell-peKE7AqI.js";
|
|
4
|
-
import { t as loadRuntimeConfig } from "./load-runtime-config-
|
|
4
|
+
import { t as loadRuntimeConfig } from "./load-runtime-config-Deq75NYr.js";
|
|
5
5
|
import { r as track } from "./buffer-DNTcuap_.js";
|
|
6
6
|
import "@powerhousedao/connect/fonts.css";
|
|
7
7
|
import { createRoot } from "react-dom/client";
|
|
@@ -140,7 +140,7 @@ async function warmModules(stages = STAGES) {
|
|
|
140
140
|
//#region src/boot.tsx
|
|
141
141
|
const defaultDeps = {
|
|
142
142
|
loadConfig: () => loadRuntimeConfig(),
|
|
143
|
-
importSkeleton: () => import("./app-skeleton-
|
|
143
|
+
importSkeleton: () => import("./app-skeleton-BHgmbYld.js"),
|
|
144
144
|
createRoot: () => createRoot(document.getElementById("root")),
|
|
145
145
|
initObserver: initPerformanceObserver,
|
|
146
146
|
adoptShell: () => {
|
|
@@ -229,5 +229,5 @@ async function bootConnect(overrides = {}) {
|
|
|
229
229
|
//#endregion
|
|
230
230
|
export { bootConnect as t };
|
|
231
231
|
|
|
232
|
-
//# sourceMappingURL=boot-
|
|
233
|
-
//# debugId=
|
|
232
|
+
//# sourceMappingURL=boot-CFPdHSqB.js.map
|
|
233
|
+
//# debugId=38599def-db4f-5d26-9e84-dc3c1ed30360
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot-N7f3RrY_.js","sources":["../src/utils/performance-observer.ts","../src/warm-modules.ts","../src/boot.tsx"],"sourcesContent":["import { track } from \"../services/openpanel/buffer.js\";\nimport type { PHGlobal } from \"@powerhousedao/reactor-browser\";\n\n/**\n * Startup performance measurement.\n *\n * Captures First Contentful Paint (FCP) and Largest Contentful Paint (LCP) via\n * the Performance API and reports each to the OpenPanel analytics buffer (a\n * consent-gated, never-throwing queue). Call {@link initPerformanceObserver}\n * at the very top of the entry module, before the runtime config is fetched,\n * so FCP is caught even if the browser has already painted — a\n * `PerformanceObserver` with `buffered: true` replays entries that fired\n * before `observe()` was called.\n *\n * This module is intentionally dependency-light (only the OpenPanel event\n * buffer, which has no runtime imports of its own) so it is safe to load\n * before the runtime config is fetched. Every API access is guarded: nothing\n * here may throw into the application.\n */\n\nfunction navigationType(): string | undefined {\n try {\n const entry = performance.getEntriesByType(\"navigation\")[0] as\n | PerformanceNavigationTiming\n | undefined;\n return entry?.type; // \"navigate\" | \"reload\" | \"back_forward\" | \"prerender\"\n } catch {\n return undefined;\n }\n}\n\n// window.ph is the app's global bag (PHGlobal). This module owns a\n// `performance` sub-object it writes into; `PhWithPerformance` is a named\n// stand-in for that write so it type-checks without touching the shared\n// PHGlobal definition.\ntype PhWithPerformance = PHGlobal & { performance?: Record<string, number> };\n\n/**\n * Mirror the metric on `window.ph.performance` for devtools inspection. Only\n * writes to an already-existing `window.ph` (owned by the entry module) —\n * never creates or replaces it, so it can't clobber the app's global state.\n */\nfunction storeOnWindow(name: string, value: number): void {\n try {\n const ph = window.ph as PhWithPerformance | undefined;\n if (!ph) return;\n ph.performance = ph.performance ?? {};\n ph.performance[name] = value;\n } catch {\n // devtools mirror is best-effort only\n }\n}\n\nfunction report(name: string, ms: number): void {\n const value = Math.round(ms);\n const props: Record<string, unknown> = { ms: value };\n const navType = navigationType();\n if (navType) props.navigation = navType;\n\n storeOnWindow(name, value);\n\n // The console summary is a developer aid. In a production build it is noise\n // in every user's console and in every support screenshot, so it is gated\n // out of the bundle there.\n if (!import.meta.env.PROD) {\n try {\n console.info(`[connect:performance] ${name}: ${value}ms`, props);\n } catch {\n // console is best-effort only\n }\n }\n\n try {\n track(`performance.${name}`, props);\n } catch {\n // analytics must never throw into the app\n }\n}\n\n/**\n * Starts the observers. Returns a disposer that detaches all of them. The app\n * never needs it — the observers live as long as the page does — but it keeps\n * the module testable and leaves no listener behind.\n */\nexport function initPerformanceObserver(): () => void {\n if (\n typeof window === \"undefined\" ||\n typeof PerformanceObserver === \"undefined\"\n ) {\n return () => undefined;\n }\n\n const teardown: Array<() => void> = [];\n\n /** Registers a listener and queues its removal on dispose. */\n const listen = (\n target: EventTarget,\n type: string,\n handler: () => void,\n once = true,\n ): void => {\n target.addEventListener(type, handler, { once });\n teardown.push(() => target.removeEventListener(type, handler));\n };\n\n // FCP — from the \"paint\" buffer. It fires once, so stop observing after it.\n try {\n const fcpObserver = new PerformanceObserver((list) => {\n for (const entry of list.getEntries()) {\n if (entry.name === \"first-contentful-paint\") {\n fcpObserver.disconnect();\n report(\"first_contentful_paint\", entry.startTime);\n }\n }\n });\n fcpObserver.observe({ type: \"paint\", buffered: true });\n teardown.push(() => fcpObserver.disconnect());\n } catch (err) {\n console.warn(\"[connect:performance] FCP observer failed:\", err);\n }\n\n // LCP — the final value only settles on an interaction or page hide, so latch\n // the latest candidate and report on the first terminal signal.\n let lcpMs = 0;\n let lcpReported = false;\n let lcpObserver: PerformanceObserver | undefined;\n\n /** Latches the newest candidate of a batch. The last entry is the newest. */\n const latch = (entries: ArrayLike<{ startTime: number }>): void => {\n if (entries.length > 0) {\n lcpMs = entries[entries.length - 1].startTime;\n }\n };\n\n const reportLcp = (): void => {\n // Several terminal signals can fire in one session (a click, then the page\n // hiding, then pagehide). The metric is sent for the first one only: every\n // repeat would be a double-count downstream.\n if (lcpReported) return;\n lcpReported = true;\n\n // A PerformanceObserver delivers entries in a task of its own, so a\n // terminal signal early in the page's life arrives while the newest\n // candidate is still buffered. Drain it before disconnecting — otherwise\n // an early click costs the session its LCP entirely.\n try {\n latch(lcpObserver?.takeRecords() ?? []);\n } catch {\n // draining is best-effort; report whatever was already delivered\n }\n\n lcpObserver?.disconnect();\n if (lcpMs > 0) report(\"largest_contentful_paint\", lcpMs);\n };\n\n try {\n lcpObserver = new PerformanceObserver((list) => {\n latch(list.getEntries());\n });\n lcpObserver.observe({ type: \"largest-contentful-paint\", buffered: true });\n teardown.push(() => lcpObserver?.disconnect());\n\n listen(window, \"pagehide\", reportLcp);\n listen(window, \"pointerdown\", reportLcp);\n listen(window, \"keydown\", reportLcp);\n // Not `once`: a page that loads in a background tab, or that the user tabs\n // away from and back, fires visibilitychange more than once, and only the\n // transition to \"hidden\" is terminal. A one-shot listener would be spent\n // on an earlier \"visible\" event and never see the hide.\n listen(\n document,\n \"visibilitychange\",\n () => {\n if (document.visibilityState === \"hidden\") reportLcp();\n },\n false,\n );\n } catch (err) {\n console.warn(\"[connect:performance] LCP observer failed:\", err);\n }\n\n return () => {\n for (const detach of teardown) {\n try {\n detach();\n } catch {\n // teardown is best-effort only\n }\n }\n teardown.length = 0;\n };\n}\n","// The app graph's largest packages; none reads the runtime config when evaluated.\nconst STAGES: (() => Promise<unknown>)[] = [\n () => import(\"@powerhousedao/reactor-browser\"),\n () => import(\"@powerhousedao/design-system/connect\"),\n];\n\nconst nextTask = () => new Promise((resolve) => setTimeout(resolve, 0));\n\n/** Evaluates them one task each; imported with the app they'd be one long task. */\nexport async function warmModules(stages = STAGES) {\n for (const stage of stages) {\n await nextTask();\n // The app's own import reports a failure.\n await stage().catch(() => undefined);\n }\n}\n","// Imported by package name so projects resolve its fonts from Connect's dependencies.\nimport \"@powerhousedao/connect/fonts.css\";\nimport type { ComponentType, PropsWithChildren, ReactNode } from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport {\n adoptPrerenderedShell,\n hasPrerenderedShell,\n} from \"./components/prerendered-shell.js\";\nimport { loadRuntimeConfig } from \"./load-runtime-config.js\";\nimport { initPerformanceObserver } from \"./utils/performance-observer.js\";\nimport { warmModules } from \"./warm-modules.js\";\n\n/**\n * The two-phase startup shared by both entry points.\n *\n * Phase 1 paints the config-independent skeleton, so first contentful paint\n * does not wait on the `powerhouse.config.json` round-trip. Phase 2 awaits the\n * config and hands the caller back the root to render the config-dependent app\n * into — every module that reads the runtime config at module-evaluation\n * throws if the cache isn't warm, so the app graph may only be imported after\n * this resolves.\n *\n * Kept dependency-light on purpose: it loads before the config is fetched, so\n * nothing in its import graph may read the config.\n */\n\n/** All the bootstrap needs of a React root — and all a test has to stand in for. */\ntype RenderTarget = { render: (node: ReactNode) => void };\n\nexport type BootDeps = {\n loadConfig: () => Promise<unknown>;\n importSkeleton: () => Promise<{ default: ComponentType<PropsWithChildren> }>;\n createRoot: () => RenderTarget;\n initObserver: () => () => void;\n /** True when #root holds a prerendered shell, which stays until the app renders. */\n adoptShell: () => boolean;\n /** Evaluates the app's large packages while the config loads. */\n warmModules: () => Promise<unknown>;\n};\n\nconst defaultDeps: BootDeps = {\n loadConfig: () => loadRuntimeConfig(),\n importSkeleton: () => import(\"./components/app-skeleton.js\"),\n createRoot: () => createRoot(document.getElementById(\"root\")!),\n initObserver: initPerformanceObserver,\n adoptShell: () => {\n adoptPrerenderedShell(document.getElementById(\"root\"));\n return hasPrerenderedShell();\n },\n warmModules: () => warmModules(),\n};\n\n/**\n * Shown when startup cannot proceed. Deliberately built from plain elements:\n * this renders precisely when the runtime config is unavailable, so it must\n * not depend on anything that reads it.\n */\nfunction BootError({ error }: { error: unknown }): ReactNode {\n const message = error instanceof Error ? error.message : String(error);\n return (\n <div\n role=\"alert\"\n className=\"flex h-screen flex-col items-center justify-center gap-3 bg-background p-6 text-center\"\n >\n <h1 className=\"text-lg font-semibold text-foreground\">\n Connect could not start\n </h1>\n <p className=\"max-w-prose text-sm text-foreground\">\n Its runtime configuration could not be loaded. This is usually temporary\n — reloading often resolves it.\n </p>\n <pre className=\"max-w-prose overflow-x-auto rounded-sm bg-card px-3 py-2 text-left text-xs text-foreground\">\n {message}\n </pre>\n <button\n type=\"button\"\n className=\"rounded-sm bg-card px-4 py-2 text-sm font-medium text-foreground shadow-sm\"\n onClick={() => {\n window.location.reload();\n }}\n >\n Reload\n </button>\n </div>\n );\n}\n\n/**\n * Paints the skeleton, then waits for the runtime config.\n *\n * Returns the root to render the app into, or `null` when startup failed — in\n * which case the error state is already painted and the caller must not import\n * the config-dependent app. It resolves rather than rejecting on failure: both\n * entry points await this at their module's top level, where a rejection would\n * surface only as an unhandled rejection behind a skeleton that never goes\n * away.\n */\nexport async function bootConnect(\n overrides: Partial<BootDeps> = {},\n): Promise<RenderTarget | null> {\n const {\n loadConfig,\n importSkeleton,\n createRoot: makeRoot,\n initObserver,\n adoptShell,\n warmModules: warm,\n } = { ...defaultDeps, ...overrides };\n\n if (!window.ph) {\n window.ph = {};\n }\n\n // Before anything else: the observers use `buffered: true`, so they catch\n // the browser's paint even when setup runs a tick after it fired.\n initObserver();\n\n // Started here and awaited at the bottom. The config fetch and the skeleton\n // chunk are independent round-trips, so they overlap; awaiting the chunk\n // first would put the config fetch — and with it everything the app needs —\n // behind it, which measured ~180ms of extra time-to-usable on a 150ms-RTT\n // connection. Mapping the rejection to a value here also means a config\n // failure is handled from the start, never an unhandled rejection.\n const config = loadConfig().then(\n () => ({ ok: true }) as const,\n (error: unknown) => ({ ok: false, error }) as const,\n );\n\n const hasShell = adoptShell();\n const root = makeRoot();\n\n try {\n // The prerendered shell is already painted; the skeleton would replace it.\n if (!hasShell) {\n const { default: AppSkeleton } = await importSkeleton();\n root.render(<AppSkeleton />);\n }\n } catch (error) {\n console.error(\"[connect:boot] the app skeleton failed to load:\", error);\n root.render(<BootError error={error} />);\n return null;\n }\n\n const warmed = warm().catch(() => undefined);\n const result = await config;\n if (!result.ok) {\n console.error(\n \"[connect:boot] the runtime config failed to load:\",\n result.error,\n );\n root.render(<BootError error={result.error} />);\n return null;\n }\n // The app imports these modules anyway; warmed, they evaluate in tasks of their own.\n await warmed;\n\n return root;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,iBAAqC;CAC5C,IAAI;EAIF,OAHc,YAAY,iBAAiB,YAAY,CAAC,CAAC,EAG7C,EAAE;CAChB,QAAQ;EACN;CACF;AACF;;;;;;AAaA,SAAS,cAAc,MAAc,OAAqB;CACxD,IAAI;EACF,MAAM,KAAK,OAAO;EAClB,IAAI,CAAC,IAAI;EACT,GAAG,cAAc,GAAG,eAAe,CAAC;EACpC,GAAG,YAAY,QAAQ;CACzB,QAAQ,CAER;AACF;AAEA,SAAS,OAAO,MAAc,IAAkB;CAC9C,MAAM,QAAQ,KAAK,MAAM,EAAE;CAC3B,MAAM,QAAiC,EAAE,IAAI,MAAM;CACnD,MAAM,UAAU,eAAe;CAC/B,IAAI,SAAS,MAAM,aAAa;CAEhC,cAAc,MAAM,KAAK;CAKzB,IAAI,CAAC,YAAY,IAAI,MACnB,IAAI;EACF,QAAQ,KAAK,yBAAyB,KAAK,IAAI,MAAM,KAAK,KAAK;CACjE,QAAQ,CAER;CAGF,IAAI;EACF,MAAM,eAAe,QAAQ,KAAK;CACpC,QAAQ,CAER;AACF;;;;;;AAOA,SAAgB,0BAAsC;CACpD,IACE,OAAO,W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AAG;EAAa,GAAG;CAAU;CAEnC,IAAI,CAAC,OAAO,IACV,OAAO,KAAK,CAAC;CAKf,aAAa;CAQb,MAAM,SAAS,WAAW,CAAC,CAAC,YACnB,EAAE,IAAI,KAAK,KACjB,WAAoB;EAAE,IAAI;EAAO;CAAM,EAC1C;CAEA,MAAM,WAAW,WAAW;CAC5B,MAAM,OAAO,SAAS;CAEtB,IAAI;EAEF,IAAI,CAAC,UAAU;GACb,MAAM,EAAE,SAAS,gBAAgB,MAAM,eAAe;GACtD,KAAK,OAAO,oBAAC,aAAD,CAAc,CAAA,CAAC;EAC7B;CACF,SAAS,OAAO;EACd,QAAQ,MAAM,mDAAmD,KAAK;EACtE,KAAK,OAAO,oBAAC,WAAD,EAAkB,MAAQ,CAAA,CAAC;EACvC,OAAO;CACT;CAEA,MAAM,SAAS,KAAK,CAAC,CAAC,YAAY,KAAA,CAAS;CAC3C,MAAM,SAAS,MAAM;CACrB,IAAI,CAAC,OAAO,IAAI;EACd,QAAQ,MACN,qDACA,OAAO,KACT;EACA,KAAK,OAAO,oBAAC,WAAD,EAAW,OAAO,OAAO,MAAQ,CAAA,CAAC;EAC9C,OAAO;CACT;CAEA,MAAM;CAEN,OAAO;AACT","debug_id":"75f310ea-5a77-5dfc-8a0c-82ae96b645f6"}
|
|
1
|
+
{"version":3,"file":"boot-CFPdHSqB.js","sources":["../src/utils/performance-observer.ts","../src/warm-modules.ts","../src/boot.tsx"],"sourcesContent":["import { track } from \"../services/openpanel/buffer.js\";\nimport type { PHGlobal } from \"@powerhousedao/reactor-browser\";\n\n/**\n * Startup performance measurement.\n *\n * Captures First Contentful Paint (FCP) and Largest Contentful Paint (LCP) via\n * the Performance API and reports each to the OpenPanel analytics buffer (a\n * consent-gated, never-throwing queue). Call {@link initPerformanceObserver}\n * at the very top of the entry module, before the runtime config is fetched,\n * so FCP is caught even if the browser has already painted — a\n * `PerformanceObserver` with `buffered: true` replays entries that fired\n * before `observe()` was called.\n *\n * This module is intentionally dependency-light (only the OpenPanel event\n * buffer, which has no runtime imports of its own) so it is safe to load\n * before the runtime config is fetched. Every API access is guarded: nothing\n * here may throw into the application.\n */\n\nfunction navigationType(): string | undefined {\n try {\n const entry = performance.getEntriesByType(\"navigation\")[0] as\n | PerformanceNavigationTiming\n | undefined;\n return entry?.type; // \"navigate\" | \"reload\" | \"back_forward\" | \"prerender\"\n } catch {\n return undefined;\n }\n}\n\n// window.ph is the app's global bag (PHGlobal). This module owns a\n// `performance` sub-object it writes into; `PhWithPerformance` is a named\n// stand-in for that write so it type-checks without touching the shared\n// PHGlobal definition.\ntype PhWithPerformance = PHGlobal & { performance?: Record<string, number> };\n\n/**\n * Mirror the metric on `window.ph.performance` for devtools inspection. Only\n * writes to an already-existing `window.ph` (owned by the entry module) —\n * never creates or replaces it, so it can't clobber the app's global state.\n */\nfunction storeOnWindow(name: string, value: number): void {\n try {\n const ph = window.ph as PhWithPerformance | undefined;\n if (!ph) return;\n ph.performance = ph.performance ?? {};\n ph.performance[name] = value;\n } catch {\n // devtools mirror is best-effort only\n }\n}\n\nfunction report(name: string, ms: number): void {\n const value = Math.round(ms);\n const props: Record<string, unknown> = { ms: value };\n const navType = navigationType();\n if (navType) props.navigation = navType;\n\n storeOnWindow(name, value);\n\n // The console summary is a developer aid. In a production build it is noise\n // in every user's console and in every support screenshot, so it is gated\n // out of the bundle there.\n if (!import.meta.env.PROD) {\n try {\n console.info(`[connect:performance] ${name}: ${value}ms`, props);\n } catch {\n // console is best-effort only\n }\n }\n\n try {\n track(`performance.${name}`, props);\n } catch {\n // analytics must never throw into the app\n }\n}\n\n/**\n * Starts the observers. Returns a disposer that detaches all of them. The app\n * never needs it — the observers live as long as the page does — but it keeps\n * the module testable and leaves no listener behind.\n */\nexport function initPerformanceObserver(): () => void {\n if (\n typeof window === \"undefined\" ||\n typeof PerformanceObserver === \"undefined\"\n ) {\n return () => undefined;\n }\n\n const teardown: Array<() => void> = [];\n\n /** Registers a listener and queues its removal on dispose. */\n const listen = (\n target: EventTarget,\n type: string,\n handler: () => void,\n once = true,\n ): void => {\n target.addEventListener(type, handler, { once });\n teardown.push(() => target.removeEventListener(type, handler));\n };\n\n // FCP — from the \"paint\" buffer. It fires once, so stop observing after it.\n try {\n const fcpObserver = new PerformanceObserver((list) => {\n for (const entry of list.getEntries()) {\n if (entry.name === \"first-contentful-paint\") {\n fcpObserver.disconnect();\n report(\"first_contentful_paint\", entry.startTime);\n }\n }\n });\n fcpObserver.observe({ type: \"paint\", buffered: true });\n teardown.push(() => fcpObserver.disconnect());\n } catch (err) {\n console.warn(\"[connect:performance] FCP observer failed:\", err);\n }\n\n // LCP — the final value only settles on an interaction or page hide, so latch\n // the latest candidate and report on the first terminal signal.\n let lcpMs = 0;\n let lcpReported = false;\n let lcpObserver: PerformanceObserver | undefined;\n\n /** Latches the newest candidate of a batch. The last entry is the newest. */\n const latch = (entries: ArrayLike<{ startTime: number }>): void => {\n if (entries.length > 0) {\n lcpMs = entries[entries.length - 1].startTime;\n }\n };\n\n const reportLcp = (): void => {\n // Several terminal signals can fire in one session (a click, then the page\n // hiding, then pagehide). The metric is sent for the first one only: every\n // repeat would be a double-count downstream.\n if (lcpReported) return;\n lcpReported = true;\n\n // A PerformanceObserver delivers entries in a task of its own, so a\n // terminal signal early in the page's life arrives while the newest\n // candidate is still buffered. Drain it before disconnecting — otherwise\n // an early click costs the session its LCP entirely.\n try {\n latch(lcpObserver?.takeRecords() ?? []);\n } catch {\n // draining is best-effort; report whatever was already delivered\n }\n\n lcpObserver?.disconnect();\n if (lcpMs > 0) report(\"largest_contentful_paint\", lcpMs);\n };\n\n try {\n lcpObserver = new PerformanceObserver((list) => {\n latch(list.getEntries());\n });\n lcpObserver.observe({ type: \"largest-contentful-paint\", buffered: true });\n teardown.push(() => lcpObserver?.disconnect());\n\n listen(window, \"pagehide\", reportLcp);\n listen(window, \"pointerdown\", reportLcp);\n listen(window, \"keydown\", reportLcp);\n // Not `once`: a page that loads in a background tab, or that the user tabs\n // away from and back, fires visibilitychange more than once, and only the\n // transition to \"hidden\" is terminal. A one-shot listener would be spent\n // on an earlier \"visible\" event and never see the hide.\n listen(\n document,\n \"visibilitychange\",\n () => {\n if (document.visibilityState === \"hidden\") reportLcp();\n },\n false,\n );\n } catch (err) {\n console.warn(\"[connect:performance] LCP observer failed:\", err);\n }\n\n return () => {\n for (const detach of teardown) {\n try {\n detach();\n } catch {\n // teardown is best-effort only\n }\n }\n teardown.length = 0;\n };\n}\n","// The app graph's largest packages; none reads the runtime config when evaluated.\nconst STAGES: (() => Promise<unknown>)[] = [\n () => import(\"@powerhousedao/reactor-browser\"),\n () => import(\"@powerhousedao/design-system/connect\"),\n];\n\nconst nextTask = () => new Promise((resolve) => setTimeout(resolve, 0));\n\n/** Evaluates them one task each; imported with the app they'd be one long task. */\nexport async function warmModules(stages = STAGES) {\n for (const stage of stages) {\n await nextTask();\n // The app's own import reports a failure.\n await stage().catch(() => undefined);\n }\n}\n","// Imported by package name so projects resolve its fonts from Connect's dependencies.\nimport \"@powerhousedao/connect/fonts.css\";\nimport type { ComponentType, PropsWithChildren, ReactNode } from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport {\n adoptPrerenderedShell,\n hasPrerenderedShell,\n} from \"./components/prerendered-shell.js\";\nimport { loadRuntimeConfig } from \"./load-runtime-config.js\";\nimport { initPerformanceObserver } from \"./utils/performance-observer.js\";\nimport { warmModules } from \"./warm-modules.js\";\n\n/**\n * The two-phase startup shared by both entry points.\n *\n * Phase 1 paints the config-independent skeleton, so first contentful paint\n * does not wait on the `powerhouse.config.json` round-trip. Phase 2 awaits the\n * config and hands the caller back the root to render the config-dependent app\n * into — every module that reads the runtime config at module-evaluation\n * throws if the cache isn't warm, so the app graph may only be imported after\n * this resolves.\n *\n * Kept dependency-light on purpose: it loads before the config is fetched, so\n * nothing in its import graph may read the config.\n */\n\n/** All the bootstrap needs of a React root — and all a test has to stand in for. */\ntype RenderTarget = { render: (node: ReactNode) => void };\n\nexport type BootDeps = {\n loadConfig: () => Promise<unknown>;\n importSkeleton: () => Promise<{ default: ComponentType<PropsWithChildren> }>;\n createRoot: () => RenderTarget;\n initObserver: () => () => void;\n /** True when #root holds a prerendered shell, which stays until the app renders. */\n adoptShell: () => boolean;\n /** Evaluates the app's large packages while the config loads. */\n warmModules: () => Promise<unknown>;\n};\n\nconst defaultDeps: BootDeps = {\n loadConfig: () => loadRuntimeConfig(),\n importSkeleton: () => import(\"./components/app-skeleton.js\"),\n createRoot: () => createRoot(document.getElementById(\"root\")!),\n initObserver: initPerformanceObserver,\n adoptShell: () => {\n adoptPrerenderedShell(document.getElementById(\"root\"));\n return hasPrerenderedShell();\n },\n warmModules: () => warmModules(),\n};\n\n/**\n * Shown when startup cannot proceed. Deliberately built from plain elements:\n * this renders precisely when the runtime config is unavailable, so it must\n * not depend on anything that reads it.\n */\nfunction BootError({ error }: { error: unknown }): ReactNode {\n const message = error instanceof Error ? error.message : String(error);\n return (\n <div\n role=\"alert\"\n className=\"flex h-screen flex-col items-center justify-center gap-3 bg-background p-6 text-center\"\n >\n <h1 className=\"text-lg font-semibold text-foreground\">\n Connect could not start\n </h1>\n <p className=\"max-w-prose text-sm text-foreground\">\n Its runtime configuration could not be loaded. This is usually temporary\n — reloading often resolves it.\n </p>\n <pre className=\"max-w-prose overflow-x-auto rounded-sm bg-card px-3 py-2 text-left text-xs text-foreground\">\n {message}\n </pre>\n <button\n type=\"button\"\n className=\"rounded-sm bg-card px-4 py-2 text-sm font-medium text-foreground shadow-sm\"\n onClick={() => {\n window.location.reload();\n }}\n >\n Reload\n </button>\n </div>\n );\n}\n\n/**\n * Paints the skeleton, then waits for the runtime config.\n *\n * Returns the root to render the app into, or `null` when startup failed — in\n * which case the error state is already painted and the caller must not import\n * the config-dependent app. It resolves rather than rejecting on failure: both\n * entry points await this at their module's top level, where a rejection would\n * surface only as an unhandled rejection behind a skeleton that never goes\n * away.\n */\nexport async function bootConnect(\n overrides: Partial<BootDeps> = {},\n): Promise<RenderTarget | null> {\n const {\n loadConfig,\n importSkeleton,\n createRoot: makeRoot,\n initObserver,\n adoptShell,\n warmModules: warm,\n } = { ...defaultDeps, ...overrides };\n\n if (!window.ph) {\n window.ph = {};\n }\n\n // Before anything else: the observers use `buffered: true`, so they catch\n // the browser's paint even when setup runs a tick after it fired.\n initObserver();\n\n // Started here and awaited at the bottom. The config fetch and the skeleton\n // chunk are independent round-trips, so they overlap; awaiting the chunk\n // first would put the config fetch — and with it everything the app needs —\n // behind it, which measured ~180ms of extra time-to-usable on a 150ms-RTT\n // connection. Mapping the rejection to a value here also means a config\n // failure is handled from the start, never an unhandled rejection.\n const config = loadConfig().then(\n () => ({ ok: true }) as const,\n (error: unknown) => ({ ok: false, error }) as const,\n );\n\n const hasShell = adoptShell();\n const root = makeRoot();\n\n try {\n // The prerendered shell is already painted; the skeleton would replace it.\n if (!hasShell) {\n const { default: AppSkeleton } = await importSkeleton();\n root.render(<AppSkeleton />);\n }\n } catch (error) {\n console.error(\"[connect:boot] the app skeleton failed to load:\", error);\n root.render(<BootError error={error} />);\n return null;\n }\n\n const warmed = warm().catch(() => undefined);\n const result = await config;\n if (!result.ok) {\n console.error(\n \"[connect:boot] the runtime config failed to load:\",\n result.error,\n );\n root.render(<BootError error={result.error} />);\n return null;\n }\n // The app imports these modules anyway; warmed, they evaluate in tasks of their own.\n await warmed;\n\n return root;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,iBAAqC;CAC5C,IAAI;EAIF,OAHc,YAAY,iBAAiB,YAAY,CAAC,CAAC,EAG7C,EAAE;CAChB,QAAQ;EACN;CACF;AACF;;;;;;AAaA,SAAS,cAAc,MAAc,OAAqB;CACxD,IAAI;EACF,MAAM,KAAK,OAAO;EAClB,IAAI,CAAC,IAAI;EACT,GAAG,cAAc,GAAG,eAAe,CAAC;EACpC,GAAG,YAAY,QAAQ;CACzB,QAAQ,CAER;AACF;AAEA,SAAS,OAAO,MAAc,IAAkB;CAC9C,MAAM,QAAQ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=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]="4a2dc06a-3eeb-5f7a-906f-ad41c8b35efa")}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.3-dev.
|
|
6
|
+
return "6.2.3-dev.71";
|
|
7
7
|
}
|
|
8
8
|
/** True in the tsdown dist projects install; false in the monorepo app, where Vite bundles the worker. */
|
|
9
9
|
function isPackagedConnectDist() {
|
|
10
10
|
return true;
|
|
11
11
|
}
|
|
12
12
|
function getGitSha() {
|
|
13
|
-
return "
|
|
13
|
+
return "5533a2c21ac67b89746c6ed26c033ae99659e131";
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Build identity baked in at build time (define PH_CONNECT_BUILD_HASH —
|
|
@@ -28,5 +28,5 @@ function getGitUrl() {
|
|
|
28
28
|
//#endregion
|
|
29
29
|
export { isPackagedConnectDist as a, getVersion as i, getGitSha as n, shortGitSha as o, getGitUrl as r, getBuildHash as t };
|
|
30
30
|
|
|
31
|
-
//# sourceMappingURL=build-info-
|
|
32
|
-
//# debugId=
|
|
31
|
+
//# sourceMappingURL=build-info-Cn2f6llN.js.map
|
|
32
|
+
//# debugId=4a2dc06a-3eeb-5f7a-906f-ad41c8b35efa
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-info-
|
|
1
|
+
{"version":3,"file":"build-info-Cn2f6llN.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;\ndeclare const CONNECT_PACKAGED_DIST: boolean | 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\n/** True in the tsdown dist projects install; false in the monorepo app, where Vite bundles the worker. */\nexport function isPackagedConnectDist(): boolean {\n return typeof CONNECT_PACKAGED_DIST !== \"undefined\" && CONNECT_PACKAGED_DIST;\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":";;;;AAUA,SAAgB,aAAqB;CACS,OAAA;AAM9C;;AAGA,SAAgB,wBAAiC;CAC/C,OAAA;AACF;AAEA,SAAgB,YAAoB;CACU,OAAA;AAE9C;;;;;;;AAQA,SAAgB,eAAuB;CACrC,IAAI,OAAO,0BAA0B,aACnC,OAAO;CACT,OAAO;AACT;AAEA,SAAgB,YAA2B;CACzC,OAAO,aAAa,UAAU,CAAC;AACjC","debug_id":"4a2dc06a-3eeb-5f7a-906f-ad41c8b35efa"}
|
|
@@ -1,11 +1,11 @@
|
|
|
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 DriveIcon } from "./drive-icon-
|
|
4
|
-
import { t as AppSkeleton } from "./app-skeleton-
|
|
5
|
-
import { i as Analytics, n as App, r as OpenPanel, t as AppLoader } 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]="692075da-d353-55fe-8db8-220f468b3e16")}catch(e){}}();
|
|
3
|
+
import { t as DriveIcon } from "./drive-icon-BIpd8edR.js";
|
|
4
|
+
import { t as AppSkeleton } from "./app-skeleton-ClRUYLE_.js";
|
|
5
|
+
import { i as Analytics, n as App, r as OpenPanel, t as AppLoader } from "./app-loader-casiq2T2.js";
|
|
6
6
|
import { t as setBannerShown } from "./preferences-store-CSqauT9V.js";
|
|
7
7
|
import { t as Root } from "./root-B1Pq9x6S.js";
|
|
8
|
-
import { n as getConnectRouter, t as Router } from "./router-
|
|
8
|
+
import { n as getConnectRouter, t as Router } from "./router-Cu0PH6sh.js";
|
|
9
9
|
import { useEffect, useState } from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { ConnectSearchBar, Footer as Footer$1, FooterLink } from "@powerhousedao/design-system/connect";
|
|
@@ -117,5 +117,5 @@ const SearchBar = () => {
|
|
|
117
117
|
//#endregion
|
|
118
118
|
export { Analytics, App, AppLoader, AppSkeleton, DotsLoader, DriveIcon, Footer, OpenPanel, Root, Router, SearchBar, getConnectRouter, loadLocalPackage };
|
|
119
119
|
|
|
120
|
-
//# sourceMappingURL=components-
|
|
121
|
-
//# debugId=
|
|
120
|
+
//# sourceMappingURL=components-C4K5xyad.js.map
|
|
121
|
+
//# debugId=692075da-d353-55fe-8db8-220f468b3e16
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components-
|
|
1
|
+
{"version":3,"file":"components-C4K5xyad.js","sources":["../src/utils/openUrl.ts","../src/components/dots-loader.tsx","../src/components/footer.tsx","../src/components/search-bar.tsx"],"sourcesContent":["const openBrowserUrl = (url: string) => window.open(url, \"_blank\");\n\nexport const openUrl = openBrowserUrl;\n","import { useEffect, useState } from \"react\";\n\nexport const DotsLoader = () => {\n const [dots, setDots] = useState(0);\n\n useEffect(() => {\n const id = setInterval(() => {\n setDots((dots) => (dots === 3 ? 0 : dots + 1));\n }, 200);\n return () => {\n clearInterval(id);\n };\n }, []);\n\n return <span>{new Array(dots).fill(\".\").join(\"\")}</span>;\n};\n","import { setBannerShown } from \"../hooks/preferences-store.js\";\nimport { openUrl } from \"@powerhousedao/connect/utils\";\nimport { Icon } from \"@powerhousedao/design-system\";\nimport {\n Footer as DesignSystemFooter,\n FooterLink,\n} from \"@powerhousedao/design-system/connect\";\nimport { showPHModal } from \"@powerhousedao/reactor-browser\";\nimport { Trans } from \"react-i18next\";\n\nexport const Footer = () => {\n return (\n <DesignSystemFooter>\n <FooterLink onClick={() => setBannerShown(true)}>\n <Trans i18nKey=\"footer.cookiePolicy\" />\n </FooterLink>\n <FooterLink onClick={() => showPHModal({ type: \"disclaimer\" })}>\n <Trans i18nKey=\"footer.disclaimer\" />\n </FooterLink>\n <FooterLink\n id=\"ph-logo-link\"\n onClick={() => openUrl(\"https://www.powerhouse.inc/\")}\n >\n <Trans\n i18nKey=\"footer.builtWith\"\n components={{\n icon: (\n <Icon name=\"PowerhouseLogoSmall\" size={16} className=\"mx-1\" />\n ),\n }}\n />\n </FooterLink>\n </DesignSystemFooter>\n );\n};\n","import { Icon } from \"@powerhousedao/design-system\";\nimport type { ConnectSearchBarProps } from \"@powerhousedao/design-system/connect\";\nimport { ConnectSearchBar } from \"@powerhousedao/design-system/connect\";\nimport { useTranslation } from \"react-i18next\";\n\nconst defaultFilterItems: ConnectSearchBarProps[\"filterItems\"] = [\n {\n id: \"project\",\n label: \".project\",\n icon: <Icon name=\"Project\" color=\"#FF6A55\" size={16} />,\n },\n {\n id: \"budget\",\n label: \".budget\",\n icon: <Icon name=\"BarChart\" color=\"#8E55EA\" size={16} />,\n },\n {\n id: \"profile\",\n label: \".profile\",\n icon: <Icon name=\"Person\" color=\"#3E90F0\" size={16} />,\n },\n {\n id: \"legal\",\n label: \".legal\",\n icon: <Icon name=\"Briefcase\" color=\"#4BAB71\" size={16} />,\n },\n {\n id: \"atlas\",\n label: \".Atlas\",\n icon: <Icon name=\"Globe\" color=\"#FF8A00\" size={16} />,\n },\n];\n\nexport const SearchBar = () => {\n const { t } = useTranslation();\n\n return (\n <ConnectSearchBar\n className=\"m-4 shrink-0 bg-muted\"\n placeholder={t(\"searchbar.placeholder\")}\n filterLabel={t(\"searchbar.filterLabel\")}\n filterItems={defaultFilterItems}\n />\n );\n};\n"],"names":["DesignSystemFooter"],"mappings":";;;;;;;;;;;;;;;;AAAA,MAAM,kBAAkB,QAAgB,OAAO,KAAK,KAAK,QAAQ;AAEjE,MAAa,UAAU;;;ACAvB,MAAa,mBAAmB;CAC9B,MAAM,CAAC,MAAM,WAAW,SAAS,CAAC;CAElC,gBAAgB;EACd,MAAM,KAAK,kBAAkB;GAC3B,SAAS,SAAU,SAAS,IAAI,IAAI,OAAO,CAAE;EAC/C,GAAG,GAAG;EACN,aAAa;GACX,cAAc,EAAE;EAClB;CACF,GAAG,CAAC,CAAC;CAEL,OAAO,oBAAC,QAAD,EAAA,UAAO,IAAI,MAAM,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,EAAE,EAAQ,CAAA;AACzD;;;ACLA,MAAa,eAAe;CAC1B,OACE,qBAACA,UAAD,EAAA,UAAA;EACE,oBAAC,YAAD;GAAY,eAAe,e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|
|
|
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]="41e4ef44-4bb1-5a4d-aea9-fc2181bd3d50")}catch(e){}}();
|
|
3
3
|
import { useMemo, useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useConnectBranding } from "@powerhousedao/design-system/connect";
|
|
5
6
|
import { DriveCollectionId, useSyncList, useTheme } from "@powerhousedao/reactor-browser";
|
|
6
7
|
import { Icon } from "@powerhousedao/design-system";
|
|
7
8
|
//#region src/components/drive-icon.tsx
|
|
8
9
|
function DriveIcon({ drive }) {
|
|
9
10
|
const remotes = useSyncList();
|
|
10
11
|
const { theme } = useTheme();
|
|
12
|
+
const branding = useConnectBranding();
|
|
11
13
|
const isRemoteDrive = useMemo(() => {
|
|
12
14
|
if (!drive) return false;
|
|
13
15
|
return remotes.some((remote) => remote.meta.collectionId.equals(DriveCollectionId.forDrive(drive.header.id)));
|
|
@@ -22,6 +24,15 @@ function DriveIcon({ drive }) {
|
|
|
22
24
|
style: { colorScheme: theme },
|
|
23
25
|
onError: () => setFailedSrc(driveIconSrc)
|
|
24
26
|
});
|
|
27
|
+
const fallbackSrc = isRemoteDrive ? branding.icons?.remoteDrive : branding.icons?.localDrive;
|
|
28
|
+
if (fallbackSrc && fallbackSrc !== failedSrc) return /* @__PURE__ */ jsx("img", {
|
|
29
|
+
src: fallbackSrc,
|
|
30
|
+
alt: drive?.header.name ?? "",
|
|
31
|
+
height: 32,
|
|
32
|
+
width: 32,
|
|
33
|
+
className: "object-contain",
|
|
34
|
+
onError: () => setFailedSrc(fallbackSrc)
|
|
35
|
+
});
|
|
25
36
|
if (!isRemoteDrive) return /* @__PURE__ */ jsx(Icon, {
|
|
26
37
|
name: "Hdd",
|
|
27
38
|
size: 32
|
|
@@ -34,5 +45,5 @@ function DriveIcon({ drive }) {
|
|
|
34
45
|
//#endregion
|
|
35
46
|
export { DriveIcon as t };
|
|
36
47
|
|
|
37
|
-
//# sourceMappingURL=drive-icon-
|
|
38
|
-
//# debugId=
|
|
48
|
+
//# sourceMappingURL=drive-icon-BIpd8edR.js.map
|
|
49
|
+
//# debugId=41e4ef44-4bb1-5a4d-aea9-fc2181bd3d50
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drive-icon-BIpd8edR.js","sources":["../src/components/drive-icon.tsx"],"sourcesContent":["import { Icon } from \"@powerhousedao/design-system\";\nimport { useConnectBranding } from \"@powerhousedao/design-system/connect\";\nimport {\n DriveCollectionId,\n useSyncList,\n useTheme,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport { useMemo, useState } from \"react\";\n\nexport function DriveIcon({\n drive,\n}: {\n drive: DocumentDriveDocument | undefined;\n}) {\n const remotes = useSyncList();\n const { theme } = useTheme();\n const branding = useConnectBranding();\n const isRemoteDrive = useMemo(() => {\n if (!drive) return false;\n\n return remotes.some((remote) =>\n remote.meta.collectionId.equals(\n DriveCollectionId.forDrive(drive.header.id),\n ),\n );\n }, [remotes, drive]);\n\n const driveIconSrc = drive?.state.global.icon;\n // A drive's icon is an arbitrary URL stored in its state, so it can rot:\n // the host goes away, the gateway starts refusing, the CID is unpinned.\n // Rendering the <img> anyway leaves a browser's broken-image glyph in the\n // sidebar forever, because the dead URL is baked into the document and no\n // later fix to whoever wrote it can reach the drives already created.\n //\n // The failure is remembered as the src that failed rather than a flag, so a\n // drive whose icon later changes retries on its own - no effect needed to\n // reset it.\n const [failedSrc, setFailedSrc] = useState<string | null>(null);\n\n if (driveIconSrc && driveIconSrc !== failedSrc) {\n // An icon is its own document once the browser renders it, so it cannot\n // see the `.dark` class the theme toggles on the host page. Propagating\n // the resolved theme as a color scheme is what lets an icon drawn against\n // `prefers-color-scheme` follow an explicit in-app choice rather than only\n // the OS preference.\n return (\n <img\n src={driveIconSrc}\n alt={drive.header.name}\n height={32}\n width={32}\n style={{ colorScheme: theme }}\n onError={() => setFailedSrc(driveIconSrc)}\n />\n );\n }\n\n // A drive without an icon of its own takes the explorer's local/remote\n // drive icon (the generic plugin's `icons`), else the built-in one.\n const fallbackSrc = isRemoteDrive\n ? branding.icons?.remoteDrive\n : branding.icons?.localDrive;\n if (fallbackSrc && fallbackSrc !== failedSrc) {\n return (\n <img\n src={fallbackSrc}\n alt={drive?.header.name ?? \"\"}\n height={32}\n width={32}\n className=\"object-contain\"\n onError={() => setFailedSrc(fallbackSrc)}\n />\n );\n }\n\n if (!isRemoteDrive) {\n return <Icon name=\"Hdd\" size={32} />;\n }\n\n return <Icon name=\"Server\" size={32} />;\n}\n"],"names":[],"mappings":";;;;;;;;AAUA,SAAgB,UAAU,EACxB,SAGC;CACD,MAAM,UAAU,YAAY;CAC5B,MAAM,EAAE,UAAU,SAAS;CAC3B,MAAM,WAAW,mBAAmB;CACpC,MAAM,gBAAgB,cAAc;EAClC,IAAI,CAAC,OAAO,OAAO;EAEnB,OAAO,QAAQ,MAAM,WACnB,OAAO,KAAK,aAAa,OACvB,kBAAkB,SAAS,MAAM,OAAO,EAAE,CAC5C,CACF;CACF,GAAG,CAAC,SAAS,KAAK,CAAC;CAEnB,MAAM,eAAe,OAAO,MAAM,OAAO;CAUzC,MAAM,CAAC,WAAW,gBAAgB,SAAwB,IAAI;CAE9D,IAAI,gBAAgB,iBAAiB,WAMnC,OACE,oBAAC,OAAD;EACE,KAAK;EACL,KAAK,MAAM,OAAO;EAClB,QAAQ;EACR,OAAO;EACP,OAAO,EAAE,aAAa,MAAM;EAC5B,eAAe,aAAa,YAAY;CACzC,CAAA;CAML,MAAM,cAAc,gBAChB,SAAS,OAAO,cAChB,SAAS,OAAO;CACpB,IAAI,eAAe,gBAAgB,WACjC,OACE,oBAAC,OAAD;EACE,KAAK;EACL,KAAK,OAAO,OAAO,QAAQ;EAC3B,QAAQ;EACR,OAAO;EACP,WAAU;EACV,eAAe,aAAa,WAAW;CACxC,CAAA;CAIL,IAAI,CAAC,eACH,OAAO,oBAAC,MAAD;EAAM,MAAK;EAAM,MAAM;CAAK,CAAA;CAGrC,OAAO,oBAAC,MAAD;EAAM,MAAK;EAAS,MAAM;CAAK,CAAA;AACxC","debug_id":"41e4ef44-4bb1-5a4d-aea9-fc2181bd3d50"}
|
package/dist/generic.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
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]="a22e7ee3-a1b4-5773-abee-29f7a20f6fb3")}catch(e){}}();
|
|
3
3
|
import { a as useNavRoutes, i as useDriveRouteData, n as ModalDialog, o as useSidebarMode, r as SidebarItem, t as ContentOutlet } from "./layout-wfvkfP4J.js";
|
|
4
4
|
import { r as ErrorBoundary } from "./error-boundary-BsUBww61.js";
|
|
5
|
-
import { a as settingsTab, c as NodeView, d as AppLayout, f as Sidebar, i as aiAssistantEnabled, l as DrivePending, m as SidebarNavItems, o as DriveLayout, p as SidebarDriveItems, r as SettingsPage, s as Home, t as genericSettingsTabs } from "./settings-tabs-
|
|
5
|
+
import { a as settingsTab, c as NodeView, d as AppLayout, f as Sidebar, i as aiAssistantEnabled, l as DrivePending, m as SidebarNavItems, o as DriveLayout, p as SidebarDriveItems, r as SettingsPage, s as Home, t as genericSettingsTabs } from "./settings-tabs-BC8gAacB.js";
|
|
6
6
|
import { n as EditorLoader } from "./document-editor-container-FNIEsf8H.js";
|
|
7
7
|
import { Suspense, lazy } from "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,13 +1,13 @@
|
|
|
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 loadRuntimeConfig } from "./load-runtime-config-
|
|
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]="bda42659-4023-5737-b6fd-1eb1024af1a0")}catch(e){}}();
|
|
3
|
+
import { t as loadRuntimeConfig } from "./load-runtime-config-Deq75NYr.js";
|
|
4
4
|
import { r as connectConfig } from "./connect.config-D1pGNmaF.js";
|
|
5
|
-
import { t as getBuildHash } from "./build-info-
|
|
5
|
+
import { t as getBuildHash } from "./build-info-Cn2f6llN.js";
|
|
6
6
|
import { r as setUser } from "./sentry-Cuc_Nbba.js";
|
|
7
7
|
import "./i18n-D9WYPgk9.js";
|
|
8
8
|
import { a as detectMigrationMajor, o as detectReactorPgMajor } from "./connection-state-B6fleM37.js";
|
|
9
9
|
import { n as seedPendingPgVersion } from "./pglite-seed-eGzXMld2.js";
|
|
10
|
-
import { n as createReactor } from "./reactor-
|
|
10
|
+
import { n as createReactor } from "./reactor-BGYR1N7Z.js";
|
|
11
11
|
import { useEffect } from "react";
|
|
12
12
|
import { initTheme, useUser } from "@powerhousedao/reactor-browser";
|
|
13
13
|
import { logger } from "document-model";
|
|
@@ -129,5 +129,5 @@ async function loadComponent(localPackage, store) {
|
|
|
129
129
|
//#endregion
|
|
130
130
|
export { loadComponent };
|
|
131
131
|
|
|
132
|
-
//# sourceMappingURL=load-
|
|
133
|
-
//# debugId=
|
|
132
|
+
//# sourceMappingURL=load-DcDV9hi4.js.map
|
|
133
|
+
//# debugId=bda42659-4023-5737-b6fd-1eb1024af1a0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-
|
|
1
|
+
{"version":3,"file":"load-DcDV9hi4.js","sources":["../src/hooks/utils.ts","../src/hooks/useCheckLatestVersion.ts","../src/store/user.ts","../src/components/load.tsx"],"sourcesContent":["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 { connectConfig } from \"@powerhousedao/connect/config\";\nimport { getBuildHashStatus } from \"./utils.js\";\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 { 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 type { PHStore } from \"@powerhousedao/reactor-browser\";\nimport { initTheme } from \"@powerhousedao/reactor-browser\";\nimport type { DocumentModelLib } from \"document-model\";\nimport { type ReactNode } from \"react\";\nimport { loadRuntimeConfig } from \"../load-runtime-config.js\";\n\nexport async function loadComponent(\n localPackage: DocumentModelLib | Promise<DocumentModelLib> | undefined,\n store: PHStore,\n) {\n await seedPendingPgVersion();\n await Promise.all([detectReactorPgMajor(), detectMigrationMajor()]);\n await loadRuntimeConfig();\n await createReactor(await localPackage, store);\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":";;;;;;;;;;;;;AAEqB,OAAO,UAAU,WAAW,SAAS,KAAK;;;;;;;;;;;;;;;;AA0B/D,MAAa,qBAAqB,YAA6C;CAC7E,MAAM,cAAc,aAA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B,kBAAkB;EAChE,aAAa;GACX,SAAS,oBAAoB,oBAAoB,kBAAkB;EACrE;CACF,GAAG,CAAC,CAAC;AACP;;;AC3EA,SAAgB,mBAAmB;CACjC,MAAM,OAAO,QAAQ;CACrB,gBAAgB;EACd,IAAI,aAAgC;EACpC,IAAI,MAAM;GAER,MAAM,EAAE,YAAY,aAAa,GAAG,SAAS;GAC7C,aAAa;IAAE,IAAI,KAAK;IAAK,UAAU,KAAK,KAAK;IAAM,GAAG;GAAK;EACjE;EACA,QAAc,UAAU;CAC1B,GAAG,CAAC,IAAI,CAAC;AACX;;;ACFA,eAAsB,cACpB,cACA,OACA;CACA,MAAM,qBAAqB;CAC3B,MAAM,QAAQ,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC,CAAC;CAClE,MAAM,kBAAkB;CACxB,MAAM,cAAc,MAAM,cAAc,KAAK;CAC7C,OAAO,EACL,UAAU,EAAE,eAAyC;EACnD,UAAU;EAEV,iBAAiB;EAEjB,sBAAsB;EACtB,OAAO;CACT,EACF;AACF","debug_id":"bda42659-4023-5737-b6fd-1eb1024af1a0"}
|
|
@@ -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]="
|
|
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]="64bc0b90-4505-5db8-a190-c8e2ff9cd4d1")}catch(e){}}();
|
|
3
3
|
import { loadRuntimeConfig } from "@powerhousedao/connect-core/runtime-config";
|
|
4
4
|
//#region src/load-runtime-config.ts
|
|
5
|
-
const connectPlugins = () => import("./plugins-
|
|
5
|
+
const connectPlugins = () => import("./plugins-CegSox2x.js").then((m) => m.connectPlugins);
|
|
6
6
|
/** Core's loader, with Connect's built-in plugins for the composition. */
|
|
7
7
|
function loadRuntimeConfig$1() {
|
|
8
8
|
return loadRuntimeConfig({ plugins: connectPlugins });
|
|
@@ -10,5 +10,5 @@ function loadRuntimeConfig$1() {
|
|
|
10
10
|
//#endregion
|
|
11
11
|
export { loadRuntimeConfig$1 as t };
|
|
12
12
|
|
|
13
|
-
//# sourceMappingURL=load-runtime-config-
|
|
14
|
-
//# debugId=
|
|
13
|
+
//# sourceMappingURL=load-runtime-config-Deq75NYr.js.map
|
|
14
|
+
//# debugId=64bc0b90-4505-5db8-a190-c8e2ff9cd4d1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-runtime-config-
|
|
1
|
+
{"version":3,"file":"load-runtime-config-Deq75NYr.js","sources":["../src/load-runtime-config.ts"],"sourcesContent":["import { loadRuntimeConfig as loadCoreRuntimeConfig } from \"@powerhousedao/connect-core/runtime-config\";\n\n// The built-ins: a declared composition's transform the config, and the active\n// ones' UI loads (every one's without a composition).\nconst connectPlugins = () =>\n import(\"./plugins/index.js\").then((m) => m.connectPlugins);\n\n/** Core's loader, with Connect's built-in plugins for the composition. */\nexport function loadRuntimeConfig() {\n return loadCoreRuntimeConfig({ plugins: connectPlugins });\n}\n"],"names":["loadRuntimeConfig","loadCoreRuntimeConfig"],"mappings":";;;;AAIA,MAAM,uBACJ,OAAO,wBAAqB,CAAC,MAAM,MAAM,EAAE,cAAc;;AAG3D,SAAgBA,sBAAoB;CAClC,OAAOC,kBAAsB,EAAE,SAAS,eAAe,CAAC;AAC1D","debug_id":"64bc0b90-4505-5db8-a190-c8e2ff9cd4d1"}
|
package/dist/main.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
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]="1f52a123-ef3c-5452-bdfa-b05d09bb17c0")}catch(e){}}();
|
|
3
|
-
import { t as bootConnect } from "./boot-
|
|
3
|
+
import { t as bootConnect } from "./boot-CFPdHSqB.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region main.tsx
|
|
6
6
|
const root = await bootConnect();
|
|
7
7
|
if (root) {
|
|
8
|
-
const { AppLoader } = await import("./app-loader-
|
|
8
|
+
const { AppLoader } = await import("./app-loader-D5GEwpML.js");
|
|
9
9
|
root.render(/* @__PURE__ */ jsx(AppLoader, {}));
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
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]="c0da8d5a-fcd4-523d-b4d6-7f40fbfd24b7")}catch(e){}}();
|
|
3
3
|
import { t as refreshPwaManifestLink } from "./pwa-manifest-link-DQRJpF0r.js";
|
|
4
4
|
import { holdConnectRoutes, registerPackageRoutes } from "@powerhousedao/connect-core/router";
|
|
5
5
|
import { BrowserLocalStorage } from "@powerhousedao/reactor-browser";
|
|
@@ -204,14 +204,14 @@ var BrowserPackageManager = class {
|
|
|
204
204
|
this.addLocalPackage(common.manifest.name, genericChrome ? common : {
|
|
205
205
|
...common,
|
|
206
206
|
editors: []
|
|
207
|
-
}, "6.2.3-dev.
|
|
207
|
+
}, "6.2.3-dev.71");
|
|
208
208
|
if (studioMode) {
|
|
209
209
|
const vetra = await import("@powerhousedao/vetra");
|
|
210
|
-
this.addLocalPackage(vetra.manifest.name, vetra, "6.2.3-dev.
|
|
210
|
+
this.addLocalPackage(vetra.manifest.name, vetra, "6.2.3-dev.71");
|
|
211
211
|
}
|
|
212
212
|
if (workflowsEnabled) {
|
|
213
213
|
const workflow = await import("@powerhousedao/workflow");
|
|
214
|
-
this.addLocalPackage(workflow.manifest.name, workflow, "6.2.3-dev.
|
|
214
|
+
this.addLocalPackage(workflow.manifest.name, workflow, "6.2.3-dev.71");
|
|
215
215
|
}
|
|
216
216
|
if (localPackage) this.updateLocalPackage(localPackage, localPackageVersion);
|
|
217
217
|
for (const packageName of this.#storage.keys()) {
|
|
@@ -520,5 +520,5 @@ var BrowserPackageManager = class {
|
|
|
520
520
|
//#endregion
|
|
521
521
|
export { sharedDepMismatchWarnings as n, getSharedDeps as r, BrowserPackageManager as t };
|
|
522
522
|
|
|
523
|
-
//# sourceMappingURL=package-manager-
|
|
524
|
-
//# debugId=
|
|
523
|
+
//# sourceMappingURL=package-manager-CzBsaUUd.js.map
|
|
524
|
+
//# debugId=c0da8d5a-fcd4-523d-b4d6-7f40fbfd24b7
|