@powerhousedao/connect 6.2.3-dev.70 → 6.2.3-dev.72
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/README.md +1 -1
- package/RUNTIME-CONFIG.md +6 -85
- package/dist/{ClearStorageModal-BwGVIuLX.js → ClearStorageModal-DQv3ZGOq.js} +4 -4
- package/dist/{ClearStorageModal-BwGVIuLX.js.map → ClearStorageModal-DQv3ZGOq.js.map} +1 -1
- package/dist/{CreateDocumentModal-B-cXzeOA.js → CreateDocumentModal-CiIW3pzx.js} +18 -9
- package/dist/CreateDocumentModal-CiIW3pzx.js.map +1 -0
- package/dist/{DebugSettingsModal-DfOnR4iY.js → DebugSettingsModal-DjFwGop2.js} +6 -6
- package/dist/{DebugSettingsModal-DfOnR4iY.js.map → DebugSettingsModal-DjFwGop2.js.map} +1 -1
- package/dist/{InspectorModal-BVqRNFfP.js → InspectorModal-C1ZVZpT5.js} +6 -6
- package/dist/{InspectorModal-BVqRNFfP.js.map → InspectorModal-C1ZVZpT5.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-ClDJbH8j.js +4 -0
- package/dist/{app-loader-DtH6v5CE.js → app-loader-DxGySldw.js} +41 -32
- package/dist/{app-loader-DtH6v5CE.js.map → app-loader-DxGySldw.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-D2-yDYJi.js} +5 -5
- package/dist/{boot-N7f3RrY_.js.map → boot-D2-yDYJi.js.map} +1 -1
- package/dist/{build-info-TgBEqTq1.js → build-info-CZ8K52c5.js} +5 -5
- package/dist/{build-info-TgBEqTq1.js.map → build-info-CZ8K52c5.js.map} +1 -1
- package/dist/{components-B_wpF5Is.js → components-B36iVkNp.js} +8 -8
- package/dist/{components-B_wpF5Is.js.map → components-B36iVkNp.js.map} +1 -1
- package/dist/{connect.config-D1pGNmaF.js → connect.config-DL9nKtlW.js} +6 -5
- package/dist/connect.config-DL9nKtlW.js.map +1 -0
- package/dist/{connection-state-B6fleM37.js → connection-state-Bwm9Agwy.js} +4 -4
- package/dist/{connection-state-B6fleM37.js.map → connection-state-Bwm9Agwy.js.map} +1 -1
- package/dist/{cookie-banner-CAvd3PC3.js → cookie-banner-NclLYtB0.js} +4 -4
- package/dist/{cookie-banner-CAvd3PC3.js.map → cookie-banner-NclLYtB0.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.d.ts +20 -2
- package/dist/generic.d.ts.map +1 -1
- package/dist/generic.js +2 -2
- package/dist/{load-CkbGF6wB.js → load-C2wlvi5d.js} +9 -9
- package/dist/{load-CkbGF6wB.js.map → load-C2wlvi5d.js.map} +1 -1
- package/dist/{load-runtime-config-DXswYA71.js → load-runtime-config-BeZF5z7m.js} +4 -4
- package/dist/{load-runtime-config-DXswYA71.js.map → load-runtime-config-BeZF5z7m.js.map} +1 -1
- package/dist/main.js +2 -2
- package/dist/{package-manager-CPqbVSd8.js → package-manager-dfP4R5L3.js} +11 -10
- package/dist/{package-manager-CPqbVSd8.js.map → package-manager-dfP4R5L3.js.map} +1 -1
- package/dist/{pglite-seed-eGzXMld2.js → pglite-seed-QPbGbLB_.js} +4 -4
- package/dist/{pglite-seed-eGzXMld2.js.map → pglite-seed-QPbGbLB_.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-DV3oFEmL.js +263 -0
- package/dist/plugins-DV3oFEmL.js.map +1 -0
- package/dist/{preferences-store-CSqauT9V.js → preferences-store-DxYAnGCc.js} +4 -4
- package/dist/{preferences-store-CSqauT9V.js.map → preferences-store-DxYAnGCc.js.map} +1 -1
- package/dist/prerender.d.ts.map +1 -1
- package/dist/prerender.js +18 -7
- package/dist/prerender.js.map +1 -1
- package/dist/{reactor-DLCl-WHi.js → reactor-DT1kVwnf.js} +12 -7
- package/dist/{reactor-DLCl-WHi.js.map → reactor-DT1kVwnf.js.map} +1 -1
- package/dist/{registerServiceWorker-APlHkrmH.js → registerServiceWorker-X6fT91iL.js} +4 -4
- package/dist/{registerServiceWorker-APlHkrmH.js.map → registerServiceWorker-X6fT91iL.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-D_873yb_.js +4 -0
- package/dist/{route-views-BF0p-4Fi.js → route-views-DmmQ1DzX.js} +5 -5
- package/dist/{route-views-BF0p-4Fi.js.map → route-views-DmmQ1DzX.js.map} +1 -1
- package/dist/route-views.js +3 -3
- package/dist/router-CBzb5FUq.js +4 -0
- package/dist/{router-L9X9U-97.js → router-DXpaaTeR.js} +15 -7
- package/dist/router-DXpaaTeR.js.map +1 -0
- package/dist/{settings-B-apZN_f.js → settings-BwKo6EAU.js} +17 -10
- package/dist/{settings-B-apZN_f.js.map → settings-BwKo6EAU.js.map} +1 -1
- package/dist/{settings-tabs-CRgiuZcb.js → settings-tabs-BubPdsiT.js} +51 -19
- package/dist/settings-tabs-BubPdsiT.js.map +1 -0
- package/dist/shell-core.html +1 -1
- package/dist/shell-head.html +1 -1
- package/dist/shell.html +1 -1
- package/dist/start-connect.js +2 -2
- package/dist/style.css +109 -4
- package/dist/{ui-CwbE23ra.js → ui-BVOQ9tj_.js} +8 -8
- package/dist/{ui-CwbE23ra.js.map → ui-BVOQ9tj_.js.map} +1 -1
- package/dist/workflows-C3qEvx1R.js +63 -0
- package/dist/workflows-C3qEvx1R.js.map +1 -0
- package/docs/customizing/data-and-navigation.md +50 -0
- package/docs/customizing/drive-apps.md +42 -0
- package/docs/customizing/hosts-and-plugins.md +23 -0
- package/docs/customizing/layout.md +9 -2
- package/docs/customizing/modals.md +25 -4
- package/docs/customizing/overrides.md +59 -4
- package/docs/customizing/packages.md +2 -0
- package/docs/customizing/pages.md +10 -13
- package/docs/customizing/styles-and-branding.md +9 -2
- package/docs/customizing/types-and-troubleshooting.md +4 -2
- package/generic-routes.json +9 -0
- package/package.json +26 -19
- package/scripts/assert-plugin-configs.mjs +47 -0
- package/skills/customize-connect/SKILL.md +14 -11
- package/CUSTOMIZING.md +0 -80
- package/dist/CreateDocumentModal-B-cXzeOA.js.map +0 -1
- package/dist/app-loader-BjAXSJQ6.js +0 -4
- package/dist/app-skeleton-BFjvlTWd.js.map +0 -1
- package/dist/connect.config-D1pGNmaF.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
package/CUSTOMIZING.md
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
# Customizing Connect
|
|
2
|
-
|
|
3
|
-
How a Powerhouse project (scaffolded by `ph init`) changes what Connect shows: its own pages, sidebar links, settings tabs, and the layout around them.
|
|
4
|
-
|
|
5
|
-
## TL;DR
|
|
6
|
-
|
|
7
|
-
Connect routes with [TanStack Router](https://tanstack.com/router) file routes. A project adds file routes to `hosts/connect/routes/`, and `ph connect build`, `ph connect studio` and `ph connect preview` mount them beside Connect's own routes in one router.
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
hosts/connect/routes/
|
|
11
|
-
├── _app.tsx optional: replaces Connect's layout (sidebar)
|
|
12
|
-
├── _app/
|
|
13
|
-
│ ├── inventory.tsx /inventory, inside the layout
|
|
14
|
-
│ └── settings/
|
|
15
|
-
│ └── inventory.tsx /settings/inventory, a settings tab
|
|
16
|
-
└── status.tsx /status, a full page without the layout
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
- A file in `_app/` renders inside Connect's layout, with the sidebar.
|
|
20
|
-
- Any other file renders as a full page.
|
|
21
|
-
- A route lists itself in the sidebar with `staticData.nav`, and adds a settings tab with `staticData.settings`.
|
|
22
|
-
- Route loaders read the app's PH store from the router context.
|
|
23
|
-
|
|
24
|
-
Connect's runtime settings (app name, drives, Renown, package registry) are the other way to customize it. They live in `powerhouse.config.json`; see [RUNTIME-CONFIG.md](./RUNTIME-CONFIG.md).
|
|
25
|
-
|
|
26
|
-
## Guides
|
|
27
|
-
|
|
28
|
-
| Guide | Covers |
|
|
29
|
-
| --- | --- |
|
|
30
|
-
| [Pages, sidebar links and settings tabs](./docs/customizing/pages.md) | Add a page, list it in the sidebar, hide the sidebar on it, add a settings tab, set the page title. |
|
|
31
|
-
| [Layout and the loading screen](./docs/customizing/layout.md) | Replace the sidebar or the whole layout; what the prerendered loading screen shows. |
|
|
32
|
-
| [Data and navigation](./docs/customizing/data-and-navigation.md) | Route loaders, the open drive and document, editor props, typed search params, navigating from editors. |
|
|
33
|
-
| [Override Connect's routes](./docs/customizing/overrides.md) | Replace home, the drive view, the open document, settings or the 404 page; slow routes, not found and errors. |
|
|
34
|
-
| [Modals](./docs/customizing/modals.md) | Routed modals, replacing a modal's view, framing every modal. |
|
|
35
|
-
| [Styles and branding](./docs/customizing/styles-and-branding.md) | The project's Tailwind build and theme tokens; app name and favicon per host. |
|
|
36
|
-
| [Hosts and plugins](./docs/customizing/hosts-and-plugins.md) | Routes per host, host plugins, the generic plugin and a plugin's UI. |
|
|
37
|
-
| [Extend Connect from a package](./docs/customizing/packages.md) | A package's routes in every Connect that loads it; registering routes from code. |
|
|
38
|
-
| [Types, troubleshooting and upgrading](./docs/customizing/types-and-troubleshooting.md) | The generated route tree, common symptoms, `ph migrate`. |
|
|
39
|
-
|
|
40
|
-
Coding agents start from the [customize-connect skill](./skills/customize-connect/SKILL.md), which links to these guides.
|
|
41
|
-
|
|
42
|
-
## UI screenshots of core's views
|
|
43
|
-
|
|
44
|
-
`ui:shots` in `@powerhousedao/connect-core` renders core's views in a real Connect and saves one PNG per scene to `packages/connect-core/.ui-shots/` (gitignored):
|
|
45
|
-
|
|
46
|
-
```sh
|
|
47
|
-
pnpm --filter @powerhousedao/connect-core ui:serve # Connect plus a browser window on seeded drives
|
|
48
|
-
pnpm --filter @powerhousedao/connect-core ui:shots # every scene
|
|
49
|
-
pnpm --filter @powerhousedao/connect-core ui:shots document-json --theme dark
|
|
50
|
-
pnpm --filter @powerhousedao/connect-core ui:shots --list
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
- Connect is a production build of `test/versioned-documents` (`ph connect build --outDir .ph/ui-shots/dist`), served by `ph connect preview` on `:4350` (`UI_SHOTS_CONNECT_PORT`, 4350-4359). The stack starts it unless the port answers, stops what it started, and rebuilds when the connect-core, Connect, builder-tools or project sources are newer than the build. `UI_CONNECT_DEV=1` runs `ph connect studio` instead.
|
|
54
|
-
- Each browser context overrides the served `powerhouse.config.json` with `connect.composition: []`, so the generic plugin is absent and core's views show. `--generic` keeps the classic chrome, for comparison.
|
|
55
|
-
- Each run seeds local drives through Connect's reactor: folders, a Todo document, Reactor Group documents (no editor, so the JSON view) and a drive whose `preferredEditor` is a drive app.
|
|
56
|
-
- Flags: `--width`, `--height`, `--out`; `UI_SHOTS_VERBOSE=1` prints the server logs. Scenes live in `SCENES` in `packages/connect-core/scripts/ui-shots.ts`.
|
|
57
|
-
|
|
58
|
-
## Reference: key files
|
|
59
|
-
|
|
60
|
-
| File | What it holds |
|
|
61
|
-
| --- | --- |
|
|
62
|
-
| `apps/connect/src/routes/` | Connect's routes, which a project's files override: core's `options` and core's views, which plugins' UI replaces. |
|
|
63
|
-
| `packages/connect-core/src/routes/` | Core's routes: each file's `options` and core's view. |
|
|
64
|
-
| `packages/connect-core/src/plugins/plugin-ui.ts` | Loading, merging and applying plugins' UI. |
|
|
65
|
-
| `apps/connect/src/generic/ui.tsx` | The generic plugin's UI. |
|
|
66
|
-
| `apps/connect/src/layout/index.ts` | The `@powerhousedao/connect/layout` exports: core's layout parts. |
|
|
67
|
-
| `apps/connect/src/generic/index.ts` | The `@powerhousedao/connect/generic` exports: the generic plugin's parts, with core's. |
|
|
68
|
-
| `packages/connect-core/src/router/sidebar.ts` | `staticData.nav` and `staticData.sidebar`. |
|
|
69
|
-
| `packages/connect-core/src/router/settings.ts` | `staticData.settings`. |
|
|
70
|
-
| `packages/connect-core/src/router/drive-route-loader.ts` | `ConnectRouterContext`. |
|
|
71
|
-
| `packages/connect-core/src/router/search.ts` | Search param parsing and the global params. |
|
|
72
|
-
| `packages/connect-core/src/router/titles.ts` | Connect's titles. |
|
|
73
|
-
| `packages/builder-tools/connect-utils/vite-plugins/connect-routes.ts` | Routes folder lookup and tree generation. |
|
|
74
|
-
| `apps/connect/tailwind.css` | Connect's Tailwind source, which a project's `style.css` imports. |
|
|
75
|
-
| `apps/connect/theme.css` | Connect's tokens without its classes, which a package's stylesheet references. |
|
|
76
|
-
| `packages/codegen/src/file-builders/boilerplate/migrate-style.ts` | `style.css` on `ph migrate`, and the package stylesheet `ph build` compiles. |
|
|
77
|
-
| `packages/builder-tools/connect-utils/vite-plugins/host-stylesheet.ts` | The host's `style.css`, added to the project's in the page's build. |
|
|
78
|
-
| `apps/connect/src/prerender/shell-css.ts` | The loading screen's CSS, built by Tailwind's compiler. |
|
|
79
|
-
| `packages/reactor-browser/src/hooks/navigation.ts`, `link-props.ts` | The navigation API for editors. |
|
|
80
|
-
| `test/versioned-documents/hosts/connect/routes/` | A working example project. |
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreateDocumentModal-B-cXzeOA.js","sources":["../src/generic/modals/CreateDocumentModal.tsx"],"sourcesContent":["import { CreateDocumentModal as ConnectCreateDocumentModal } from \"@powerhousedao/design-system/connect\";\nimport {\n addDocument,\n closePHModal,\n setSelectedNode,\n useDocumentModelModuleById,\n useNodeParentFolderById,\n usePHModal,\n} from \"@powerhousedao/reactor-browser\";\nimport { useDriveRouteData } from \"@powerhousedao/connect-core/router\";\n\nexport const CreateDocumentModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"createDocument\";\n const documentType = open ? phModal.documentType : undefined;\n const documentModelVersion = open ? phModal.documentModelVersion : undefined;\n const documentModel = useDocumentModelModuleById(\n documentType,\n documentModelVersion,\n );\n // In the open folder, else beside the open document.\n const { drive, folder, documentId } = useDriveRouteData();\n const parentFolder = useNodeParentFolderById(documentId);\n\n const onCreateDocument = async (documentName: string) => {\n closePHModal();\n if (!drive || !documentModel) return;\n\n const node = await addDocument(\n drive.header.id,\n documentName || `New ${documentModel.documentModel.global.name}`,\n documentModel.documentModel.global.id,\n folder?.id ?? parentFolder?.id,\n undefined,\n undefined,\n undefined,\n documentModelVersion,\n );\n setSelectedNode(node);\n };\n\n return (\n <ConnectCreateDocumentModal\n open={open}\n onContinue={(documentName) => {\n void onCreateDocument(documentName);\n }}\n onOpenChange={(status: boolean) => {\n if (!status) return closePHModal();\n }}\n />\n );\n};\n"],"names":["ConnectCreateDocumentModal"],"mappings":";;;;;;;AAWA,MAAa,4BAAsC;CACjD,MAAM,UAAU,WAAW;CAC3B,MAAM,OAAO,SAAS,SAAS;CAC/B,MAAM,eAAe,OAAO,QAAQ,eAAe,KAAA;CACnD,MAAM,uBAAuB,OAAO,QAAQ,uBAAuB,KAAA;CACnE,MAAM,gBAAgB,2BACpB,cACA,oBACF;CAEA,MAAM,EAAE,OAAO,QAAQ,eAAe,kBAAkB;CACxD,MAAM,eAAe,wBAAwB,UAAU;CAEvD,MAAM,mBAAmB,OAAO,iBAAyB;EACvD,aAAa;EACb,IAAI,CAAC,SAAS,CAAC,eAAe;EAE9B,MAAM,OAAO,MAAM,YACjB,MAAM,OAAO,IACb,gBAAgB,OAAO,cAAc,cAAc,OAAO,QAC1D,cAAc,cAAc,OAAO,IACnC,QAAQ,MAAM,cAAc,IAC5B,KAAA,GACA,KAAA,GACA,KAAA,GACA,oBACF;EACA,gBAAgB,IAAI;CACtB;CAEA,OACE,oBAACA,uBAAD;EACQ;EACN,aAAa,iBAAiB;GAC5B,iBAAsB,YAAY;EACpC;EACA,eAAe,WAAoB;GACjC,IAAI,CAAC,QAAQ,OAAO,aAAa;EACnC;CACD,CAAA;AAEL","debug_id":"80191016-ed64-5a35-8eb6-56700d13ea19"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { t as AppLoader } from "./app-loader-DtH6v5CE.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]="0f348b5b-50a4-5272-906c-9d850785f98f")}catch(e){}}();
|
|
4
|
-
//# debugId=0f348b5b-50a4-5272-906c-9d850785f98f
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-skeleton-BFjvlTWd.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 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\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 <div className=\"animate-pulse overflow-hidden rounded-full shadow-lg motion-reduce:animate-none\">\n <LogoAnimation />\n </div>\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 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;;;ACgBA,MAAM,eAAe;AAErB,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;IAAc,UAAA;GAA8B,CAAA,GAC3D,oBAAC,OAAD;IAAK,WAAU;IAAmB,UAAA,YAAY,OAAO;GAAY,CAAA,CAC9D;;CACF,CAAA;AAET;AAEA,MAAM,UAAU,EAAE,QAAQ,mBAAuC;CAC/D,MAAM,QAAQ,OAAO,WAAW;CAChC,MAAM,oBACJ,OAAO,aAAa,eACpB,SAAS,KAAK,aAAa,kBAAkB,MAAM;CACrD,IAAI,CAAC,OACH,UAAU;CAGZ,MAAM,CAAC,aAAa,kBAAkB,SAAS,CAAC,SAAS,iBAAiB;CAE1E,gBAAgB;EACd,MAAM,KAAK,iBAAiB;GAC1B,eAAe,IAAI;GAOnB,SAAS,KAAK,aAAa,oBAAoB,MAAM;EACvD,GAAG,KAAK;EAER,aAAa,aAAa,EAAE;CAC9B,GAAG,CAAC,CAAC;CAEL,OACE,qBAAC,OAAD;EACE,WAAW,0EAA0E,cAAc,KAAK;EAD1G,UAAA,CAGE,oBAAC,OAAD;GAAK,WAAU;GACb,UAAA,oBAAC,eAAD,CAAgB,CAAA;EACb,CAAA,GACJ,QACC,oBAAC,UAAD,EACE,yBAAyB,EACvB,QAAQ;;;yBAGK,MAAM,GACrB,EACD,CAAA,IACC,IACD;;AAET;AAEA,MAAa,eAA4C,UAAU;CACjE,MAAM,QAAQ,OAAO,WAAW;CAChC,MAAM,eAAe,CAAC,SAAS,OAAO,SAAS,aAAa,YAAY;CAIxE,MAAM,aAAa,CAAC,SAAS,cAAc;CAC3C,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACG,CAAC,cACA,oBAAC,gBAAD;IACE,WAAU;IACV,SAAS,KAAA;IACT,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":"ea914ffc-deaa-5afd-8076-9d2b82f22764"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connect.config-D1pGNmaF.js","sources":["../src/utils/openpanel-config.ts","../src/connect.config.ts"],"sourcesContent":["import type { PHConnectOpenPanel } from \"@powerhousedao/shared/clis\";\n\n/** The build-time (Vite env) OpenPanel settings, as parsed by loadRuntimeEnv. */\nexport type OpenPanelBuildEnv = {\n PH_CONNECT_OPENPANEL_CLIENT_ID?: string;\n PH_CONNECT_OPENPANEL_API_URL?: string;\n PH_CONNECT_OPENPANEL_TRACK_UI_EVENTS: boolean;\n PH_CONNECT_OPENPANEL_TRACK_OPERATIONS: boolean;\n};\n\nexport type ResolvedOpenPanelConfig = {\n clientId: string;\n apiUrl: string | undefined;\n trackUiEvents: boolean;\n trackOperations: boolean;\n};\n\n/**\n * Resolve Connect's OpenPanel settings. The runtime config\n * (`connect.openPanel`, settable per deploy via PH_CONNECT_CONFIG_JSON) wins;\n * the build-time PH_CONNECT_OPENPANEL_* env is the fallback so builds that\n * bake it keep working. An empty clientId leaves OpenPanel disabled.\n */\nexport function resolveOpenPanelConfig(\n runtime: PHConnectOpenPanel | undefined,\n env: OpenPanelBuildEnv,\n): ResolvedOpenPanelConfig {\n return {\n clientId: runtime?.clientId || env.PH_CONNECT_OPENPANEL_CLIENT_ID || \"\",\n apiUrl: runtime?.apiUrl || env.PH_CONNECT_OPENPANEL_API_URL || undefined,\n trackUiEvents:\n runtime?.trackUiEvents ?? env.PH_CONNECT_OPENPANEL_TRACK_UI_EVENTS,\n trackOperations:\n runtime?.trackOperations ?? env.PH_CONNECT_OPENPANEL_TRACK_OPERATIONS,\n };\n}\n","import {\n setLogLevel,\n type PHAppConfig,\n type PHDocumentEditorConfig,\n type PHGlobalConfig,\n} from \"@powerhousedao/reactor-browser\";\nimport type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport {\n loadRuntimeEnv,\n normalizeBasePath,\n} from \"@powerhousedao/shared/connect\";\nimport { logger } from \"document-model\";\nimport { getRuntimeConfig } from \"@powerhousedao/connect-core/runtime-config\";\nimport { resolveOpenPanelConfig } from \"./utils/openpanel-config.js\";\n\n// Env vars are reserved for version stamps and analytics processor toggles.\n// Everything in the Connect runtime schema (PHConnectRuntimeConfig) is read\n// from `runtime` below. The Sentry release tag is stamped at build time via\n// Vite's `define` so it always matches the sourcemap upload tag CI used.\nexport const env = loadRuntimeEnv({\n processEnv: import.meta.env,\n});\n\ndeclare const PH_CONNECT_SENTRY_RELEASE: string;\n\n// Runtime fields come from the JSON, not env. start-connect.tsx's top-level\n// await guarantees the loader cache is warm by the time this module\n// evaluates, so getRuntimeConfig() resolves synchronously. The cache merges\n// DEFAULT_CONNECT_CONFIG into whatever the file declared, so every leaf\n// under `runtime.*` is guaranteed defined.\nconst runtime = getRuntimeConfig().connect;\n\nfunction getRouterBasenameFromBasePath(basePath: string) {\n return basePath.endsWith(\"/\") ? basePath : basePath + \"/\";\n}\n\n// Runtime deploy base. In dynamic-base builds the plugin rewrites\n// import.meta.env.BASE_URL to (globalThis.__PH_DYNAMIC_BASE__||\"/\"), the same\n// base assets resolve against; it takes precedence so router basename and\n// path stripping match the served subpath. A baked runtime base path\n// (runtime.app.basePath) only applies to concrete-base builds, where the\n// dynamic global is unset.\nfunction getDeployBasePath() {\n if (\n typeof globalThis !== \"undefined\" &&\n (globalThis as { __PH_DYNAMIC_BASE__?: string }).__PH_DYNAMIC_BASE__\n ) {\n return import.meta.env.BASE_URL;\n }\n return runtime.app?.basePath || import.meta.env.BASE_URL;\n}\n\n// Hardcoded literal defaults for `PHGlobalConfig` fields whose env-var\n// source was removed. The fields stay on the type so wired-but-dead SW /\n// hook consumers keep typechecking; values mirror the previous Zod\n// defaults.\nfunction getBuiltInDefaults(): Omit<\n PHGlobalConfig,\n \"basePath\" | \"routerBasename\"\n> {\n const studioMode = runtime.app?.studioMode ?? false;\n // Drive containers, DocumentModel, and vetra builder-spec types are authored\n // via their own drives — never creatable from a generic drive.\n const disabledEditors = [\n \"powerhouse/document-drive\",\n \"powerhouse/reactor-drive\",\n \"powerhouse/document-model\",\n \"powerhouse/app\",\n \"powerhouse/document-editor\",\n \"powerhouse/processor\",\n \"powerhouse/subgraph\",\n \"powerhouse/package\",\n ];\n return {\n allowList: undefined,\n allowedDocumentTypes: [],\n isDragAndDropEnabled: true,\n isEditorDebugModeEnabled: false,\n isEditorReadModeEnabled: false,\n isExternalControlsEnabled: false,\n version: env.PH_CONNECT_VERSION,\n logLevel: runtime.app?.logLevel,\n requiresHardRefresh: true,\n warnOutdatedApp: true,\n studioMode,\n versionCheckInterval: 60 * 60 * 1000,\n cliVersion: env.PH_CONNECT_CLI_VERSION,\n fileUploadOperationsChunkSize: 50,\n gaTrackingId: undefined,\n defaultDrivesUrl: runtime.drives?.defaultDrives?.find(\n (drive) => \"url\" in drive,\n )?.url,\n drivesPreserveStrategy: runtime.drives?.preserveStrategy,\n enabledEditors: undefined,\n disabledEditors,\n\n /* Processors */\n isExternalProcessorsEnabled: true,\n // Analytics off by default; flip to true (or wire a runtime-config field)\n // when we want analytics enabled out of the box.\n isAnalyticsEnabled: false,\n isAnalyticsExternalProcessorsEnabled:\n env.PH_CONNECT_EXTERNAL_ANALYTICS_PROCESSORS_ENABLED,\n analyticsDatabaseName: undefined,\n isRelationalProcessorsEnabled: true,\n isExternalRelationalProcessorsEnabled: true,\n\n renownUrl: runtime.renown?.url,\n renownNetworkId: runtime.renown?.networkId,\n renownChainId: runtime.renown?.chainId,\n switchboardUrl: runtime.renown?.switchboardUrl,\n renownAdapters: runtime.renown?.adapters,\n sentryRelease: PH_CONNECT_SENTRY_RELEASE,\n sentryDsn: runtime.sentry?.dsn ?? undefined,\n sentryEnv: runtime.sentry?.env,\n isDiffAnalyticsEnabled: env.PH_CONNECT_DIFF_ANALYTICS_ENABLED,\n isDriveAnalyticsEnabled: env.PH_CONNECT_DRIVE_ANALYTICS_ENABLED,\n isPublicDrivesEnabled: runtime.drives?.sections?.remote?.enabled,\n isCloudDrivesEnabled: runtime.drives?.sections?.remote?.enabled ?? true,\n isLocalDrivesEnabled: runtime.drives?.sections?.local?.enabled,\n isSentryTracingEnabled: runtime.sentry?.tracing,\n isDocumentModelSelectionSettingsEnabled: false,\n isAddDriveEnabled: runtime.drives?.allowAddDrive,\n isAddPublicDrivesEnabled: runtime.drives?.sections?.remote?.allowAdd,\n isDeletePublicDrivesEnabled: runtime.drives?.sections?.remote?.allowDelete,\n isAddCloudDrivesEnabled: runtime.drives?.sections?.remote?.allowAdd ?? true,\n isDeleteCloudDrivesEnabled:\n runtime.drives?.sections?.remote?.allowDelete ?? true,\n isAddLocalDrivesEnabled: runtime.drives?.sections?.local?.allowAdd,\n isDeleteLocalDrivesEnabled: runtime.drives?.sections?.local?.allowDelete,\n isAnalyticsDatabaseWorkerEnabled: false,\n isExternalPackagesEnabled: runtime.packages?.externalEnabled,\n };\n}\n\nexport function buildPHGlobalConfig(\n basePath: string,\n routerBasename: string,\n connectFromConfig: PHConnectRuntimeConfig,\n): PHGlobalConfig {\n const defaults = getBuiltInDefaults();\n const fileOverrides: Partial<PHGlobalConfig> = {};\n\n if (connectFromConfig.drives?.allowAddDrive !== undefined) {\n fileOverrides.isAddDriveEnabled = connectFromConfig.drives.allowAddDrive;\n }\n\n return {\n basePath,\n routerBasename,\n ...defaults,\n ...fileOverrides,\n };\n}\n\nfunction getPHGlobalConfigFromRuntime(): PHGlobalConfig {\n // Deploy base wins via getDeployBasePath: the dynamic-base global when set,\n // else runtime.app.basePath (DEFAULT_CONNECT_CONFIG guarantees it defined),\n // with a \"/\" fallback as a defensive guard for typecheck.\n const basePath = getDeployBasePath() ?? \"/\";\n const routerBasename = getRouterBasenameFromBasePath(basePath);\n return buildPHGlobalConfig(basePath, routerBasename, runtime);\n}\n\nexport const phGlobalConfig = getPHGlobalConfigFromRuntime();\n\nexport const defaultPHDocumentEditorConfig: PHDocumentEditorConfig = {\n isExternalControlsEnabled: phGlobalConfig.isExternalControlsEnabled,\n};\n\nexport const defaultPHAppConfig: PHAppConfig = {\n allowedDocumentTypes: phGlobalConfig.allowedDocumentTypes,\n isDragAndDropEnabled: phGlobalConfig.isDragAndDropEnabled,\n};\n\n// Set log level from the runtime config (DEFAULT_CONNECT_CONFIG provides a\n// fallback, so this is always defined).\nconst RESOLVED_LOG_LEVEL = runtime.app?.logLevel;\nif (RESOLVED_LOG_LEVEL) {\n setLogLevel(RESOLVED_LOG_LEVEL);\n}\nlogger.debug(\"Setting log level to @level.\", RESOLVED_LOG_LEVEL);\n\n// Normalize the base path to ensure it starts and ends with a forward slash.\nexport const PH_CONNECT_BASE_PATH = normalizeBasePath(\n getDeployBasePath() ?? \"/\",\n);\n\n// Analytics database name — derived deterministically from the base path so\n// instances on different prefixes of one origin do not share an analytics DB.\n// Root resolves to \":analytics\".\nconst PH_CONNECT_ANALYTICS_DATABASE_NAME = `${PH_CONNECT_BASE_PATH.replace(\n /\\//g,\n \"\",\n)}:analytics`;\n\n// The CLOUD section was collapsed into the unified `remote` section. PUBLIC\n// keeps its existing string identifier in the legacy\n// connectConfig.drives.sections map to avoid rippling through downstream UI\n// components — both PUBLIC and the\n// soon-to-be-removed CLOUD readers point at runtime.drives.sections.remote.\nexport const connectConfig = {\n appVersion: env.PH_CONNECT_VERSION,\n studioMode: runtime.app?.studioMode ?? false,\n // Boot-time constant, so it is read straight off the runtime config rather\n // than through the PHGlobalConfig event machinery. Off unless turned on.\n workflowsEnabled: runtime.app?.workflowsEnabled ?? false,\n warnOutdatedApp: phGlobalConfig.warnOutdatedApp,\n appVersionCheckInterval: 60 * 60 * 1000,\n routerBasename: PH_CONNECT_BASE_PATH,\n offline: runtime.app?.offline ?? true,\n aiAssistantEnabled: runtime.ai?.assistantEnabled ?? false,\n externalPackagesEnabled: runtime.packages?.externalEnabled,\n processors: {\n enabled: true,\n externalProcessorsEnabled: true,\n },\n analytics: {\n enabled: true,\n databaseName: PH_CONNECT_ANALYTICS_DATABASE_NAME,\n useWorker: false,\n driveAnalyticsEnabled: env.PH_CONNECT_DRIVE_ANALYTICS_ENABLED,\n diffProcessorEnabled: env.PH_CONNECT_DIFF_ANALYTICS_ENABLED,\n externalProcessorsEnabled: true,\n },\n relational: {\n enabled: true,\n externalProcessorsEnabled: true,\n },\n // Runtime `connect.openPanel` wins; the build-time PH_CONNECT_OPENPANEL_*\n // env is the fallback. An empty clientId (the default) keeps it disabled.\n // `trackUiEvents` is intentionally dormant — no call sites gate on it yet.\n openPanel: resolveOpenPanelConfig(runtime.openPanel, env),\n renown: {\n url: runtime.renown?.url,\n networkId: runtime.renown?.networkId,\n chainId: runtime.renown?.chainId,\n namespace: runtime.renown?.namespace,\n switchboardUrl: runtime.renown?.switchboardUrl,\n adapters: runtime.renown?.adapters,\n },\n sentry: {\n release: PH_CONNECT_SENTRY_RELEASE,\n // `dsn: null` (default) means Sentry is disabled — useInitSentry bails.\n dsn: runtime.sentry?.dsn ?? null,\n env: runtime.sentry?.env,\n tracing: runtime.sentry?.tracing ?? false,\n },\n content: {\n showSearchBar: false,\n showDocumentModelSelectionSetting: false,\n },\n drives: {\n addDriveEnabled: runtime.drives?.allowAddDrive,\n preserveStrategy: runtime.drives?.preserveStrategy,\n // The legacy `SharingType` enum still includes a \"CLOUD\" variant.\n // Connect collapsed CLOUD into the unified remote section, so both CLOUD\n // and PUBLIC map to the same `runtime.drives.sections.remote` object —\n // the alias keeps `sections[sharingType]` lookups type-safe for every\n // SharingType value.\n sections: (() => {\n const remote = {\n enabled: runtime.drives?.sections?.remote?.enabled,\n allowAdd: runtime.drives?.sections?.remote?.allowAdd,\n allowDelete: runtime.drives?.sections?.remote?.allowDelete,\n };\n return {\n LOCAL: {\n enabled: runtime.drives?.sections?.local?.enabled,\n allowAdd: runtime.drives?.sections?.local?.allowAdd,\n allowDelete: runtime.drives?.sections?.local?.allowDelete,\n },\n PUBLIC: remote,\n CLOUD: remote,\n };\n })(),\n },\n gaTrackingId: undefined,\n phCliVersion: env.PH_CONNECT_CLI_VERSION,\n} as const;\n"],"names":[],"mappings":";;;;;;;;;;;;;AAuBA,SAAgB,uBACd,SACA,KACyB;CACzB,OAAO;EACL,UAAU,SAAS,YAAY,IAAI,kCAAkC;EACrE,QAAQ,SAAS,UAAU,IAAI,gCAAgC,KAAA;EAC/D,eACE,SAAS,iBAAiB,IAAI;EAChC,iBACE,SAAS,mBAAmB,IAAI;CACpC;AACF;;;AChBA,MAAa,MAAM,eA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1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drive-icon-BiVP8yJc.js","sources":["../src/components/drive-icon.tsx"],"sourcesContent":["import { Icon } from \"@powerhousedao/design-system\";\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 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 if (!isRemoteDrive) {\n return <Icon name=\"Hdd\" size={32} />;\n }\n\n return <Icon name=\"Server\" size={32} />;\n}\n"],"names":[],"mappings":";;;;;;;AASA,SAAgB,UAAU,EACxB,SAGC;CACD,MAAM,UAAU,YAAY;CAC5B,MAAM,EAAE,UAAU,SAAS;CAC3B,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;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":"ead78b3b-f177-590e-81d1-cfaa7f5325f5"}
|
package/dist/plugins-CWbr0n_Q.js
DELETED
|
@@ -1,246 +0,0 @@
|
|
|
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]="12bba573-1829-54ba-93ff-88f5dd246cb5")}catch(e){}}();
|
|
3
|
-
import { DEFAULT_CONNECT_CONFIG } from "@powerhousedao/shared/connect";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
//#region src/plugins/assistant.ts
|
|
6
|
-
/**
|
|
7
|
-
* The Connect AI assistant (`@powerhousedao/connect/plugins/assistant`).
|
|
8
|
-
* Presence flips `ai.assistantEnabled` on and merges the entry config
|
|
9
|
-
* (endpoint, agent, defaultOpen, …); absence forces it off. The assistant FAB
|
|
10
|
-
* in app.tsx already renders on `ai.assistantEnabled`, so this plugin's
|
|
11
|
-
* config shuffle is immediately visible in the UI.
|
|
12
|
-
*/
|
|
13
|
-
const createAssistantPlugin = (config) => {
|
|
14
|
-
return {
|
|
15
|
-
name: "connect-assistant",
|
|
16
|
-
appliesTo: "connect",
|
|
17
|
-
hooks: { transformConnectConfig(served) {
|
|
18
|
-
return {
|
|
19
|
-
...served,
|
|
20
|
-
ai: {
|
|
21
|
-
...served.ai,
|
|
22
|
-
assistantEnabled: true,
|
|
23
|
-
...config
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
} }
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/plugins/generic.ts
|
|
31
|
-
/**
|
|
32
|
-
* The generic Connect shell plugin (`@powerhousedao/connect/plugins/generic`).
|
|
33
|
-
*
|
|
34
|
-
* It OWNS the drive-chrome UI toggles — `allowAddDrive` and the per-section
|
|
35
|
-
* `sections.{remote,local}` switches (enabled / allowAdd / allowDelete). These
|
|
36
|
-
* describe nothing outside the generic chrome (connect.config.ts reads them to
|
|
37
|
-
* decide whether the add-drive affordance and the drive sections render), so
|
|
38
|
-
* under uniform runners they are configured HERE, through this plugin's entry
|
|
39
|
-
* config, not as free-standing top-level connect.drives values:
|
|
40
|
-
*
|
|
41
|
-
* - present + entry provides a value -> that value
|
|
42
|
-
* - present + entry omits it -> inherit DEFAULT_CONNECT_CONFIG
|
|
43
|
-
* - absent from the composition -> zeroed off (see plugin-host's
|
|
44
|
-
* zeroAbsentSlices — no chrome, no
|
|
45
|
-
* toggles)
|
|
46
|
-
*
|
|
47
|
-
* The top-level served value is deliberately NOT a fallback: ownership means a
|
|
48
|
-
* single source. `branding` is intentionally NOT handled here — it has reach
|
|
49
|
-
* beyond the chrome (e.g. document.title), so it stays a Connect-level config
|
|
50
|
-
* value that survives this plugin's absence.
|
|
51
|
-
*/
|
|
52
|
-
const sectionSchema = z.object({
|
|
53
|
-
enabled: z.boolean().optional(),
|
|
54
|
-
allowAdd: z.boolean().optional(),
|
|
55
|
-
allowDelete: z.boolean().optional()
|
|
56
|
-
}).optional();
|
|
57
|
-
const genericConfigSchema = z.object({
|
|
58
|
-
allowAddDrive: z.boolean().optional(),
|
|
59
|
-
sections: z.object({
|
|
60
|
-
remote: sectionSchema,
|
|
61
|
-
local: sectionSchema
|
|
62
|
-
}).optional()
|
|
63
|
-
}).partial();
|
|
64
|
-
const DEFAULT_DRIVES = DEFAULT_CONNECT_CONFIG.drives;
|
|
65
|
-
const createGenericPlugin = (rawConfig) => {
|
|
66
|
-
const config = genericConfigSchema.parse(rawConfig ?? {});
|
|
67
|
-
return {
|
|
68
|
-
name: "connect-generic",
|
|
69
|
-
appliesTo: "connect",
|
|
70
|
-
configSchema: genericConfigSchema,
|
|
71
|
-
hooks: { transformConnectConfig(served) {
|
|
72
|
-
const entrySections = config.sections ?? {};
|
|
73
|
-
return {
|
|
74
|
-
...served,
|
|
75
|
-
drives: {
|
|
76
|
-
...served.drives,
|
|
77
|
-
allowAddDrive: config.allowAddDrive ?? DEFAULT_DRIVES?.allowAddDrive,
|
|
78
|
-
sections: {
|
|
79
|
-
remote: {
|
|
80
|
-
...DEFAULT_DRIVES?.sections?.remote,
|
|
81
|
-
...entrySections.remote
|
|
82
|
-
},
|
|
83
|
-
local: {
|
|
84
|
-
...DEFAULT_DRIVES?.sections?.local,
|
|
85
|
-
...entrySections.local
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
} }
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region src/plugins/openpanel.ts
|
|
95
|
-
/**
|
|
96
|
-
* OpenPanel analytics (`@powerhousedao/connect/plugins/openpanel`). Presence
|
|
97
|
-
* is activation: the entry config (clientId, trackUiEvents, trackOperations)
|
|
98
|
-
* merges into the served `openPanel` block; absence clears the clientId and
|
|
99
|
-
* turns tracking off. Config shuffle today; the Analytics/OpenPanel
|
|
100
|
-
* components that consume it already live in the app tree.
|
|
101
|
-
*/
|
|
102
|
-
const createOpenPanelPlugin = (config) => {
|
|
103
|
-
return {
|
|
104
|
-
name: "connect-openpanel",
|
|
105
|
-
appliesTo: "connect",
|
|
106
|
-
hooks: { transformConnectConfig(served) {
|
|
107
|
-
return {
|
|
108
|
-
...served,
|
|
109
|
-
openPanel: {
|
|
110
|
-
...served.openPanel,
|
|
111
|
-
...config
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
} }
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
//#endregion
|
|
118
|
-
//#region src/plugins/sentry.ts
|
|
119
|
-
/**
|
|
120
|
-
* Sentry error reporting (`@powerhousedao/connect/plugins/sentry`). Presence
|
|
121
|
-
* is activation: listing it merges the entry config (dsn, env, tracing) into
|
|
122
|
-
* the served `sentry` block; omitting it nulls the dsn (see the absence
|
|
123
|
-
* zeroing in plugin-host). A thin config shuffle today — the SentryProvider
|
|
124
|
-
* that reads this slice already exists in the app.
|
|
125
|
-
*/
|
|
126
|
-
const createSentryPlugin = (config) => {
|
|
127
|
-
return {
|
|
128
|
-
name: "connect-sentry",
|
|
129
|
-
appliesTo: "connect",
|
|
130
|
-
hooks: { transformConnectConfig(served) {
|
|
131
|
-
return {
|
|
132
|
-
...served,
|
|
133
|
-
sentry: {
|
|
134
|
-
...served.sentry,
|
|
135
|
-
...config
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
} }
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
//#endregion
|
|
142
|
-
//#region src/plugins/ids.ts
|
|
143
|
-
/** The generic shell: Connect's sidebar, home screen and settings tabs. */
|
|
144
|
-
const GENERIC_PLUGIN = "@powerhousedao/connect/plugins/generic";
|
|
145
|
-
//#endregion
|
|
146
|
-
//#region src/plugins/vetra-studio.ts
|
|
147
|
-
/**
|
|
148
|
-
* Vetra Studio, browser side (`@powerhousedao/vetra-studio/connect`). Its
|
|
149
|
-
* presence turns Connect's studio mode on; the classic `app.studioMode`
|
|
150
|
-
* consumer paths run unchanged, and absence forces studio off (the zeroing in
|
|
151
|
-
* plugin-host). Lives here, in Connect's own source, because the studio-mode
|
|
152
|
-
* behaviour is Connect browser behaviour — the published vetra-studio/connect
|
|
153
|
-
* module is only the server-resolvable identity of the same plugin.
|
|
154
|
-
*/
|
|
155
|
-
const createVetraStudioPlugin = (config) => {
|
|
156
|
-
return {
|
|
157
|
-
name: "vetra-studio-connect",
|
|
158
|
-
appliesTo: "connect",
|
|
159
|
-
hooks: { transformConnectConfig(served) {
|
|
160
|
-
return {
|
|
161
|
-
...served,
|
|
162
|
-
app: {
|
|
163
|
-
...served.app,
|
|
164
|
-
studioMode: true,
|
|
165
|
-
...config
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
} }
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
//#endregion
|
|
172
|
-
//#region src/plugins/index.ts
|
|
173
|
-
const ANALYTICS_CONSENT = { consent: true };
|
|
174
|
-
const driveSectionOff = {
|
|
175
|
-
enabled: false,
|
|
176
|
-
allowAdd: false,
|
|
177
|
-
allowDelete: false
|
|
178
|
-
};
|
|
179
|
-
/** Connect's built-in plugins, by the specifier a composition names. */
|
|
180
|
-
const connectPlugins = {
|
|
181
|
-
[GENERIC_PLUGIN]: {
|
|
182
|
-
create: createGenericPlugin,
|
|
183
|
-
ui: () => import("./ui-CwbE23ra.js").then((m) => m.default),
|
|
184
|
-
shell: "generic",
|
|
185
|
-
whenAbsent: (config) => ({
|
|
186
|
-
...config,
|
|
187
|
-
drives: {
|
|
188
|
-
...config.drives,
|
|
189
|
-
allowAddDrive: false,
|
|
190
|
-
sections: {
|
|
191
|
-
remote: driveSectionOff,
|
|
192
|
-
local: driveSectionOff
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
})
|
|
196
|
-
},
|
|
197
|
-
"@powerhousedao/connect/plugins/sentry": {
|
|
198
|
-
create: createSentryPlugin,
|
|
199
|
-
ui: () => Promise.resolve(ANALYTICS_CONSENT),
|
|
200
|
-
whenAbsent: (config) => ({
|
|
201
|
-
...config,
|
|
202
|
-
sentry: {
|
|
203
|
-
...config.sentry,
|
|
204
|
-
dsn: null
|
|
205
|
-
}
|
|
206
|
-
})
|
|
207
|
-
},
|
|
208
|
-
"@powerhousedao/connect/plugins/openpanel": {
|
|
209
|
-
create: createOpenPanelPlugin,
|
|
210
|
-
ui: () => Promise.resolve(ANALYTICS_CONSENT),
|
|
211
|
-
whenAbsent: (config) => ({
|
|
212
|
-
...config,
|
|
213
|
-
openPanel: {
|
|
214
|
-
...config.openPanel,
|
|
215
|
-
clientId: "",
|
|
216
|
-
trackUiEvents: false,
|
|
217
|
-
trackOperations: false
|
|
218
|
-
}
|
|
219
|
-
})
|
|
220
|
-
},
|
|
221
|
-
"@powerhousedao/connect/plugins/assistant": {
|
|
222
|
-
create: createAssistantPlugin,
|
|
223
|
-
whenAbsent: (config) => ({
|
|
224
|
-
...config,
|
|
225
|
-
ai: {
|
|
226
|
-
...config.ai,
|
|
227
|
-
assistantEnabled: false
|
|
228
|
-
}
|
|
229
|
-
})
|
|
230
|
-
},
|
|
231
|
-
"@powerhousedao/vetra-studio/connect": {
|
|
232
|
-
create: createVetraStudioPlugin,
|
|
233
|
-
whenAbsent: (config) => ({
|
|
234
|
-
...config,
|
|
235
|
-
app: {
|
|
236
|
-
...config.app,
|
|
237
|
-
studioMode: false
|
|
238
|
-
}
|
|
239
|
-
})
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
//#endregion
|
|
243
|
-
export { connectPlugins };
|
|
244
|
-
|
|
245
|
-
//# sourceMappingURL=plugins-CWbr0n_Q.js.map
|
|
246
|
-
//# debugId=12bba573-1829-54ba-93ff-88f5dd246cb5
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugins-CWbr0n_Q.js","sources":["../src/plugins/assistant.ts","../src/plugins/generic.ts","../src/plugins/openpanel.ts","../src/plugins/sentry.ts","../src/plugins/ids.ts","../src/plugins/vetra-studio.ts","../src/plugins/index.ts"],"sourcesContent":["import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\n\n/**\n * The Connect AI assistant (`@powerhousedao/connect/plugins/assistant`).\n * Presence flips `ai.assistantEnabled` on and merges the entry config\n * (endpoint, agent, defaultOpen, …); absence forces it off. The assistant FAB\n * in app.tsx already renders on `ai.assistantEnabled`, so this plugin's\n * config shuffle is immediately visible in the UI.\n */\nexport const createAssistantPlugin: ConnectPluginFactory = (config) => {\n const plugin: ConnectPlugin = {\n name: \"connect-assistant\",\n appliesTo: \"connect\",\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n ai: { ...served.ai, assistantEnabled: true, ...config } as never,\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createAssistantPlugin;\n","import { DEFAULT_CONNECT_CONFIG } from \"@powerhousedao/shared/connect\";\nimport type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport { z } from \"zod\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\n\n/**\n * The generic Connect shell plugin (`@powerhousedao/connect/plugins/generic`).\n *\n * It OWNS the drive-chrome UI toggles — `allowAddDrive` and the per-section\n * `sections.{remote,local}` switches (enabled / allowAdd / allowDelete). These\n * describe nothing outside the generic chrome (connect.config.ts reads them to\n * decide whether the add-drive affordance and the drive sections render), so\n * under uniform runners they are configured HERE, through this plugin's entry\n * config, not as free-standing top-level connect.drives values:\n *\n * - present + entry provides a value -> that value\n * - present + entry omits it -> inherit DEFAULT_CONNECT_CONFIG\n * - absent from the composition -> zeroed off (see plugin-host's\n * zeroAbsentSlices — no chrome, no\n * toggles)\n *\n * The top-level served value is deliberately NOT a fallback: ownership means a\n * single source. `branding` is intentionally NOT handled here — it has reach\n * beyond the chrome (e.g. document.title), so it stays a Connect-level config\n * value that survives this plugin's absence.\n */\n\nconst sectionSchema = z\n .object({\n enabled: z.boolean().optional(),\n allowAdd: z.boolean().optional(),\n allowDelete: z.boolean().optional(),\n })\n .optional();\n\nconst genericConfigSchema = z\n .object({\n allowAddDrive: z.boolean().optional(),\n sections: z\n .object({ remote: sectionSchema, local: sectionSchema })\n .optional(),\n })\n .partial();\n\ntype GenericConfig = z.infer<typeof genericConfigSchema>;\n\nconst DEFAULT_DRIVES = DEFAULT_CONNECT_CONFIG.drives;\n\nexport const createGenericPlugin: ConnectPluginFactory = (rawConfig) => {\n const config = genericConfigSchema.parse(rawConfig ?? {}) as GenericConfig;\n const plugin: ConnectPlugin = {\n name: \"connect-generic\",\n appliesTo: \"connect\",\n configSchema: genericConfigSchema,\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n const entrySections = config.sections ?? {};\n return {\n ...served,\n drives: {\n ...served.drives,\n // Owned: entry value, else the single-source default — never the\n // served top-level value.\n allowAddDrive:\n config.allowAddDrive ?? DEFAULT_DRIVES?.allowAddDrive,\n sections: {\n remote: {\n ...DEFAULT_DRIVES?.sections?.remote,\n ...entrySections.remote,\n },\n local: {\n ...DEFAULT_DRIVES?.sections?.local,\n ...entrySections.local,\n },\n },\n } as never,\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createGenericPlugin;\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\n\n/**\n * OpenPanel analytics (`@powerhousedao/connect/plugins/openpanel`). Presence\n * is activation: the entry config (clientId, trackUiEvents, trackOperations)\n * merges into the served `openPanel` block; absence clears the clientId and\n * turns tracking off. Config shuffle today; the Analytics/OpenPanel\n * components that consume it already live in the app tree.\n */\nexport const createOpenPanelPlugin: ConnectPluginFactory = (config) => {\n const plugin: ConnectPlugin = {\n name: \"connect-openpanel\",\n appliesTo: \"connect\",\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n openPanel: { ...served.openPanel, ...config } as never,\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createOpenPanelPlugin;\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\n\n/**\n * Sentry error reporting (`@powerhousedao/connect/plugins/sentry`). Presence\n * is activation: listing it merges the entry config (dsn, env, tracing) into\n * the served `sentry` block; omitting it nulls the dsn (see the absence\n * zeroing in plugin-host). A thin config shuffle today — the SentryProvider\n * that reads this slice already exists in the app.\n */\nexport const createSentryPlugin: ConnectPluginFactory = (config) => {\n const plugin: ConnectPlugin = {\n name: \"connect-sentry\",\n appliesTo: \"connect\",\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n sentry: { ...served.sentry, ...config } as never,\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createSentryPlugin;\n","/** The generic shell: Connect's sidebar, home screen and settings tabs. */\nexport const GENERIC_PLUGIN = \"@powerhousedao/connect/plugins/generic\";\n","import type { PHConnectRuntimeConfig } from \"@powerhousedao/shared/clis\";\nimport type {\n ConnectPlugin,\n ConnectPluginFactory,\n} from \"@powerhousedao/connect-core/plugins\";\n\n/**\n * Vetra Studio, browser side (`@powerhousedao/vetra-studio/connect`). Its\n * presence turns Connect's studio mode on; the classic `app.studioMode`\n * consumer paths run unchanged, and absence forces studio off (the zeroing in\n * plugin-host). Lives here, in Connect's own source, because the studio-mode\n * behaviour is Connect browser behaviour — the published vetra-studio/connect\n * module is only the server-resolvable identity of the same plugin.\n */\nexport const createVetraStudioPlugin: ConnectPluginFactory = (config) => {\n const plugin: ConnectPlugin = {\n name: \"vetra-studio-connect\",\n appliesTo: \"connect\",\n hooks: {\n transformConnectConfig(served: PHConnectRuntimeConfig) {\n return {\n ...served,\n app: { ...served.app, studioMode: true, ...config } as never,\n };\n },\n },\n };\n return plugin;\n};\n\nexport default createVetraStudioPlugin;\n","import type { ConnectPluginDefinition } from \"@powerhousedao/connect-core/plugins\";\nimport createAssistantPlugin from \"./assistant.js\";\nimport createGenericPlugin from \"./generic.js\";\nimport createOpenPanelPlugin from \"./openpanel.js\";\nimport createSentryPlugin from \"./sentry.js\";\nimport { GENERIC_PLUGIN } from \"./ids.js\";\nimport createVetraStudioPlugin from \"./vetra-studio.js\";\n\nexport { GENERIC_PLUGIN };\n\n// Sentry and OpenPanel start only once the viewer accepts analytics cookies.\nconst ANALYTICS_CONSENT = { consent: true };\n\n// Each built-in zeroes the config slice it owns when a composition leaves it out.\nconst driveSectionOff = { enabled: false, allowAdd: false, allowDelete: false };\n\n/** Connect's built-in plugins, by the specifier a composition names. */\nexport const connectPlugins: Record<string, ConnectPluginDefinition> = {\n [GENERIC_PLUGIN]: {\n create: createGenericPlugin,\n ui: () => import(\"../generic/ui.js\").then((m) => m.default),\n shell: \"generic\",\n // Branding is not zeroed: it is Connect-level and outlives the plugin.\n whenAbsent: (config) => ({\n ...config,\n drives: {\n ...config.drives,\n allowAddDrive: false,\n sections: { remote: driveSectionOff, local: driveSectionOff },\n } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/sentry\": {\n create: createSentryPlugin,\n ui: () => Promise.resolve(ANALYTICS_CONSENT),\n whenAbsent: (config) => ({\n ...config,\n sentry: { ...config.sentry, dsn: null } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/openpanel\": {\n create: createOpenPanelPlugin,\n ui: () => Promise.resolve(ANALYTICS_CONSENT),\n whenAbsent: (config) => ({\n ...config,\n openPanel: {\n ...config.openPanel,\n clientId: \"\",\n trackUiEvents: false,\n trackOperations: false,\n } as never,\n }),\n },\n \"@powerhousedao/connect/plugins/assistant\": {\n create: createAssistantPlugin,\n whenAbsent: (config) => ({\n ...config,\n ai: { ...config.ai, assistantEnabled: false } as never,\n }),\n },\n \"@powerhousedao/vetra-studio/connect\": {\n create: createVetraStudioPlugin,\n whenAbsent: (config) => ({\n ...config,\n app: { ...config.app, studioMode: false } as never,\n }),\n },\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAaA,MAAa,yBAA+C,WAAW;CAarE,OAAO;EAXL,MAAM;EACN,WAAW;EACX,OAAO,EACL,uBAAuB,QAAgC;GACrD,OAAO;IACL,GAAG;IACH,IAAI;KAAE,GAAG,OAAO;KAAI,kBAAkB;KAAM,GAAG;IAAO;GACxD;EACF,EACF;CAEU;AACd;;;;;;;;;;;;;;;;;;;;;;;;ACGA,MAAM,gBAAgB,EACnB,OAAO;CACN,SAAS,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC9B,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC/B,aAAa,EAAE,QAAQ,CAAC,CAAC,SAAS;AACpC,CAAC,CAAC,CACD,SAAS;AAEZ,MAAM,sBAAsB,EACzB,OAAO;CACN,eAAe,EAAE,QAAQ,CAAC,CAAC,SAAS;CACpC,UAAU,EACP,OAAO;EAAE,QAAQ;EAAe,OAAO;CAAc,CAAC,CAAC,CACvD,SAAS;AACd,CAAC,CAAC,CACD,QAAQ;AAIX,MAAM,iBAAiB,uBAAuB;AAE9C,MAAa,uBAA6C,cAAc;CACtE,MAAM,SAAS,oBAAoB,MAAM,aAAa,CAAC,CAAC;CA+BxD,OAAO;EA7BL,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO,EACL,uBAAuB,QAAgC;GACrD,MAAM,gBAAgB,OAAO,YAAY,CAAC;GAC1C,OAAO;IACL,GAAG;IACH,QAAQ;KACN,GAAG,OAAO;KAGV,eACE,OAAO,iBAAiB,gBAAgB;KAC1C,UAAU;MACR,QAAQ;OACN,GAAG,gBAAgB,UAAU;OAC7B,GAAG,cAAc;MACnB;MACA,OAAO;OACL,GAAG,gBAAgB,UAAU;OAC7B,GAAG,cAAc;MACnB;KACF;IACF;GACF;EACF,EACF;CAEU;AACd;;;;;;;;;;ACvEA,MAAa,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ACT,GAAG,OAAO;IACV,UAAU;IACV,eAAe;IACf,iBAAiB;GACnB;EACF;CACF;CACA,4CAA4C;EAC1C,QAAQ;EACR,aAAa,YAAY;GACvB,GAAG;GACH,IAAI;IAAE,GAAG,OAAO;IAAI,kBAAkB;GAAM;EAC9C;CACF;CACA,uCAAuC;EACrC,QAAQ;EACR,aAAa,YAAY;GACvB,GAAG;GACH,KAAK;IAAE,GAAG,OAAO;IAAK,YAAY;GAAM;EAC1C;CACF;AACF","debug_id":"12bba573-1829-54ba-93ff-88f5dd246cb5"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route-views-CTARvT5N.js","sources":["../src/components/route-views.tsx"],"sourcesContent":["import { useRouter, useRouterState } from \"@tanstack/react-router\";\nimport type { PropsWithChildren } from \"react\";\nimport { useEffect, useState } from \"react\";\nimport AppSkeleton from \"./app-skeleton.js\";\nimport { LoadingShell } from \"./prerendered-shell.js\";\n\n// Loads quicker than this show no progress bar.\nconst PROGRESS_DELAY_MS = 150;\n\n/** A thin top bar while a route takes longer than PROGRESS_DELAY_MS. */\nexport function RouteProgressBar() {\n const router = useRouter();\n const [visible, setVisible] = useState(false);\n // Router events, not state: a quick load never re-renders the bar.\n useEffect(() => {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const start = () => {\n clearTimeout(timer);\n timer = setTimeout(() => setVisible(true), PROGRESS_DELAY_MS);\n };\n const stop = () => {\n clearTimeout(timer);\n setVisible(false);\n };\n // The first load starts before this effect subscribes.\n if (router.state.isLoading) start();\n const unsubscribes = [\n router.subscribe(\"onBeforeLoad\", start),\n router.subscribe(\"onResolved\", stop),\n ];\n return () => {\n clearTimeout(timer);\n for (const unsubscribe of unsubscribes) unsubscribe();\n };\n }, [router]);\n if (!visible) return null;\n return (\n <div\n role=\"progressbar\"\n aria-label=\"Loading\"\n className=\"pointer-events-none fixed inset-x-0 top-0 z-50 h-[3px] overflow-hidden\"\n >\n <style>\n {`@keyframes ph-route-progress{0%{transform:translateX(-100%)}100%{transform:translateX(250%)}}`}\n </style>\n <div\n className=\"h-full w-2/5 bg-[#3b82f6]\"\n style={{ animation: \"ph-route-progress 1.1s ease-in-out infinite\" }}\n />\n </div>\n );\n}\n\n/** Wraps the matches: the skeleton until the first view shows, and the bar. */\nexport function RouterChrome({ children }: PropsWithChildren) {\n const isEmpty = useRouterState({ select: (state) => !state.matches.length });\n return (\n <>\n {isEmpty && <LoadingShell Fallback={AppSkeleton} />}\n {children}\n <RouteProgressBar />\n </>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAOA,MAAM,oBAAoB;;AAG1B,SAAgB,mBAAmB;CACjC,MAAM,SAAS,UAAU;CACzB,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAE5C,gBAAgB;EACd,IAAI;EACJ,MAAM,cAAc;GAClB,aAAa,KAAK;GAClB,QAAQ,iBAAiB,WAAW,IAAI,GAAG,iBAAiB;EAC9D;EACA,MAAM,aAAa;GACjB,aAAa,KAAK;GAClB,WAAW,KAAK;EAClB;EAEA,IAAI,OAAO,MAAM,WAAW,MAAM;EAClC,MAAM,eAAe,CACnB,OAAO,UAAU,gBAAgB,KAAK,GACtC,OAAO,UAAU,cAAc,IAAI,CACrC;EACA,aAAa;GACX,aAAa,KAAK;GAClB,KAAK,MAAM,eAAe,cAAc,YAAY;EACtD;CACF,GAAG,CAAC,MAAM,CAAC;CACX,IAAI,CAAC,SAAS,OAAO;CACrB,OACE,qBAAC,OAAD;EACE,MAAK;EACL,cAAW;EACX,WAAU;EAHZ,UAAA,CAKE,oBAAC,SAAD,EAAA,UACG,gGACI,CAAA,GACP,oBAAC,OAAD;GACE,WAAU;GACV,OAAO,EAAE,WAAW,8CAA8C;EACnE,CAAA,CACE;;AAET;;AAGA,SAAgB,aAAa,EAAE,YAA+B;CAC5D,MAAM,UAAU,eAAe,EAAE,SAAS,UAAU,CAAC,MAAM,QAAQ,OAAO,CAAC;CAC3E,OACE,qBAAA,YAAA,EAAA,UAAA;EACG,WAAW,oBAAC,cAAD,EAAc,UAAU,YAAc,CAAA;EACjD;EACD,oBAAC,kBAAD,CAAmB,CAAA;CACnB,EAAA,CAAA;AAEN","debug_id":"5a966c41-2bda-5eb5-b42a-c2f02e7c6ec9"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { n as RouterChrome, t as RouteProgressBar } from "./route-views-CTARvT5N.js";
|
|
2
|
-
export { RouteProgressBar, RouterChrome };
|
|
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]="0830b340-f22b-5577-a827-f9bad6b1a9bb")}catch(e){}}();
|
|
4
|
-
//# debugId=0830b340-f22b-5577-a827-f9bad6b1a9bb
|
package/dist/router-BguOMBUh.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { n as getConnectRouter } from "./router-L9X9U-97.js";
|
|
2
|
-
export { getConnectRouter };
|
|
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]="195cb590-140e-5d0c-98ba-18fa4cfa23b4")}catch(e){}}();
|
|
4
|
-
//# debugId=195cb590-140e-5d0c-98ba-18fa4cfa23b4
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"router-L9X9U-97.js","sources":["../src/components/router.tsx"],"sourcesContent":["import { connectConfig } from \"@powerhousedao/connect/config\";\nimport { routeTree } from \"@powerhousedao/connect/route-tree\";\nimport type { ConnectAppRouterOptions } from \"@powerhousedao/connect-core/router\";\nimport {\n disposeConnectAppRouter,\n getConnectAppRouter,\n} from \"@powerhousedao/connect-core/router\";\nimport { getRuntimeConfig } from \"@powerhousedao/connect-core/runtime-config\";\nimport { ensurePHStore, usePHStore } from \"@powerhousedao/reactor-browser\";\nimport { RouterProvider } from \"@tanstack/react-router\";\nimport { lazy, Suspense } from \"react\";\nimport { reportRouteError } from \"../services/sentry.js\";\nimport { ColdStartPending } from \"./prerendered-shell.js\";\nimport { RouterChrome } from \"./route-views.js\";\n\nfunction connectRouterOptions(): ConnectAppRouterOptions {\n return {\n routeTree,\n basepath: connectConfig.routerBasename,\n InnerWrap: RouterChrome,\n pendingComponent: ColdStartPending,\n appName: getRuntimeConfig().connect.branding?.appName,\n onCatch: reportRouteError,\n };\n}\n\n// HMR re-runs this module: the replaced router must stop writing the selection.\nimport.meta.hot?.dispose(() => disposeConnectAppRouter());\n\n/** The app's router, e.g. for tracing. */\nexport function getConnectRouter() {\n return getConnectAppRouter(ensurePHStore(), connectRouterOptions).router;\n}\n\n// Dev only: production builds drop the import with this branch.\nconst RouterDevtools = import.meta.env.DEV\n ? lazy(() =>\n import(\"@tanstack/react-router-devtools\").then((m) => ({\n default: m.TanStackRouterDevtools,\n })),\n )\n : undefined;\n\nexport const Router = () => {\n const store = usePHStore() ?? ensurePHStore();\n const { router } = getConnectAppRouter(store, connectRouterOptions);\n return (\n <>\n <RouterProvider router={router} />\n {RouterDevtools && (\n <Suspense name=\"RouterDevtools\">\n <RouterDevtools router={router} position=\"bottom-left\" />\n </Suspense>\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAeA,SAAS,uBAAgD;CACvD,OAAO;EACL;EACA,UAAU,cAAc;EACxB,WAAW;EACX,kBAAkB;EAClB,SAAS,iBAAiB,CAAC,CAAC,QAAQ,UAAU;EAC9C,SAAS;CACX;AACF;AAGA,YAAY,KAAK,cAAc,wBAAwB,CAAC;;AAGxD,SAAgB,mBAAmB;CACjC,OAAO,oBAAoB,cAAc,GAAG,oBAAoB,CAAC,CAAC;AACpE;AAGA,MAAM,iBAAiB,YAAY,IAAI,MACnC,WACE,OAAO,oBAAkC,CAAC,MAAM,OAAO,EACrD,SAAS,EAAE,uBACb,EAAE,CACJ,IACA,KAAA;AAEJ,MAAa,eAAe;CAC1B,MAAM,QAAQ,WAAW,KAAK,cAAc;CAC5C,MAAM,EAAE,WAAW,oBAAoB,OAAO,oBAAoB;CAClE,OACE,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,gBAAD,EAAwB,OAAS,CAAA,GAChC,kBACC,oBAAC,UAAD;EAAU,MAAK;EACb,UAAA,oBAAC,gBAAD;GAAwB;GAAQ,UAAS;EAAe,CAAA;CAChD,CAAA,CAEZ,EAAA,CAAA;AAEN","debug_id":"9bb1cf89-913c-563d-9b67-c8a5d6b4b08b"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"settings-tabs-CRgiuZcb.js","sources":["../src/generic/pages/use-drive-auth-gate.ts","../src/generic/layout/sidebar.tsx","../src/generic/layout/app-layout.tsx","../src/generic/layout/route-views.tsx","../src/generic/editors/app-container.tsx","../src/generic/pages/content.tsx","../src/generic/settings/tabs.ts","../src/generic/settings-tabs.ts"],"sourcesContent":["import {\n setSelectedDrive,\n useConnectionStates,\n useDrives,\n useSelectedDriveId,\n useSync,\n useUser,\n type ConnectionStateSnapshot,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport { useCallback, useEffect, useMemo, useSyncExternalStore } from \"react\";\n\n/** Return code for the auth gate decision:\n * - `\"login\"` : anonymous user, the selected drive's channel rejected with `requiresAuth`.\n * - `\"unauthorized\"` : signed in, but the selected drive's channel was rejected — they aren't the owner.\n * - `null` : no auth barrier on the selected drive, carry on. */\nexport type AuthGate = \"login\" | \"unauthorized\" | null;\n\n/** A remote, reduced to the two fields the gate decision needs. */\nexport type AuthGateRemote = {\n readonly name: string;\n readonly driveId: string;\n};\n\nexport type AuthGateSelection = {\n readonly selectedDriveId: string | undefined;\n readonly remotes: readonly AuthGateRemote[];\n};\n\n/**\n * Decides the gate for the drive the user selected, and only that drive. A\n * refusal on any other drive must not hide the rest of Connect.\n *\n * Connection states are keyed by remote name, which is a random uuid, so the\n * caller supplies the remote -> drive mapping.\n */\nexport function computeAuthGate(\n isAuthenticated: boolean,\n connectionStates: ReadonlyMap<string, ConnectionStateSnapshot>,\n selection: AuthGateSelection,\n): AuthGate {\n const { selectedDriveId, remotes } = selection;\n if (!selectedDriveId) return null;\n\n let refused = false;\n for (const remote of remotes) {\n if (remote.driveId !== selectedDriveId) continue;\n const snapshot = connectionStates.get(remote.name);\n if (snapshot?.state === \"error\" && snapshot.requiresAuth) {\n refused = true;\n break;\n }\n }\n if (!refused) return null;\n return isAuthenticated ? \"unauthorized\" : \"login\";\n}\n\n// Drives dismissed from the auth gate. Deliberately in memory and session\n// scoped: the reactor keeps a refused drive's storage record, so a reload while\n// signed in must bring the drive back rather than fight that recovery.\nconst hiddenDriveIds = new Set<string>();\nlet hiddenDriveIdsSnapshot: readonly string[] = [];\nconst hiddenDriveListeners = new Set<() => void>();\n\nfunction publishHiddenDrives(): void {\n hiddenDriveIdsSnapshot = [...hiddenDriveIds];\n for (const listener of [...hiddenDriveListeners]) {\n listener();\n }\n}\n\nfunction subscribeHiddenDrives(listener: () => void): () => void {\n hiddenDriveListeners.add(listener);\n return () => {\n hiddenDriveListeners.delete(listener);\n };\n}\n\nfunction getHiddenDriveIds(): readonly string[] {\n return hiddenDriveIdsSnapshot;\n}\n\n/** Hides a drive from Connect's drive lists until the page reloads. */\nexport function hideDriveForSession(driveId: string): void {\n if (hiddenDriveIds.has(driveId)) return;\n hiddenDriveIds.add(driveId);\n publishHiddenDrives();\n}\n\n/** Restores every drive hidden this session. */\nexport function clearHiddenDrives(): void {\n if (hiddenDriveIds.size === 0) return;\n hiddenDriveIds.clear();\n publishHiddenDrives();\n}\n\nexport function useHiddenDriveIds(): readonly string[] {\n return useSyncExternalStore(\n subscribeHiddenDrives,\n getHiddenDriveIds,\n getHiddenDriveIds,\n );\n}\n\n/** `useDrives()` minus the drives dismissed from the auth gate this session. */\nexport function useVisibleDrives(): DocumentDriveDocument[] | undefined {\n const drives = useDrives();\n const hidden = useHiddenDriveIds();\n return useMemo(() => {\n if (!drives || hidden.length === 0) return drives;\n return drives.filter((drive) => !hidden.includes(drive.header.id));\n }, [drives, hidden]);\n}\n\n/** Live wrapper over {@link computeAuthGate}, plus the dismiss action. */\nexport function useDriveAuthGate(): { gate: AuthGate; dismiss: () => void } {\n const user = useUser();\n const connectionStates = useConnectionStates();\n const syncManager = useSync();\n const selectedDriveId = useSelectedDriveId();\n\n // Remote names are random uuids; `meta.collectionId.driveId` is the only link\n // from a connection state back to the drive it belongs to. Recomputed\n // alongside `connectionStates`, which also refreshes as remotes come and go.\n const remotes = useMemo<AuthGateRemote[]>(\n () =>\n (syncManager?.list() ?? []).map((remote) => ({\n name: remote.meta.name,\n driveId: remote.meta.collectionId.driveId,\n })),\n [syncManager, connectionStates],\n );\n\n // A change of identity changes who the drive would be fetched as, so give the\n // dismissed drives another chance instead of waiting for a reload.\n const address = user?.address;\n useEffect(() => {\n clearHiddenDrives();\n }, [address]);\n\n const dismiss = useCallback(() => {\n if (selectedDriveId) {\n hideDriveForSession(selectedDriveId);\n }\n setSelectedDrive(undefined);\n }, [selectedDriveId]);\n\n const gate = computeAuthGate(Boolean(user), connectionStates, {\n selectedDriveId,\n remotes,\n });\n return { gate, dismiss };\n}\n","import {\n ConnectSidebar,\n ConnectTooltipProvider,\n SidebarAddDriveItem,\n SidebarItem,\n useEns,\n} from \"@powerhousedao/design-system/connect\";\n\nimport {\n isPlainClick,\n logout,\n makeDriveSlug,\n preloadDrive,\n setSelectedDrive,\n showPHModal,\n useIsAddDriveEnabled,\n useLinkProps,\n useSelectedDriveSafe,\n useUser,\n getDriveName,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport type { AnyRouter } from \"@tanstack/react-router\";\nimport { useRouter, useRouterState } from \"@tanstack/react-router\";\nimport type { ReactNode } from \"react\";\nimport { useOpenRenownLogin } from \"../hooks/use-renown-login.js\";\nimport type { NavRouteEntry } from \"@powerhousedao/connect-core/router\";\nimport { useNavRoutes } from \"@powerhousedao/connect-core/router\";\nimport { DriveIcon } from \"@powerhousedao/connect/components/shared\";\nimport { ErrorBoundary } from \"@powerhousedao/connect/components/shared\";\nimport { useVisibleDrives } from \"../pages/use-drive-auth-gate.js\";\n\nfunction DriveSidebarItem(props: {\n drive: DocumentDriveDocument;\n active: boolean;\n}) {\n const { drive, active } = props;\n const link = useLinkProps({ driveSlug: makeDriveSlug(drive) }, () =>\n setSelectedDrive(drive),\n );\n return (\n <SidebarItem\n title={getDriveName(drive)}\n href={link.href}\n aria-current={link[\"aria-current\"]}\n onClick={link.onClick}\n onPreload={() => preloadDrive(drive)}\n active={active}\n icon={<DriveIcon drive={drive} />}\n />\n );\n}\n\n/** The drives the user may open, and the add-drive item when enabled. */\nexport function SidebarDriveItems() {\n const drives = useVisibleDrives();\n const isAddDriveEnabled = useIsAddDriveEnabled();\n const [selectedDrive] = useSelectedDriveSafe();\n return (\n <>\n {drives?.map((drive) => (\n <DriveSidebarItem\n key={drive.header.id}\n drive={drive}\n active={selectedDrive?.header.id === drive.header.id}\n />\n ))}\n {isAddDriveEnabled && (\n <SidebarAddDriveItem\n onClick={() => showPHModal({ type: \"addDrive\" })}\n />\n )}\n </>\n );\n}\n\nfunction NavSidebarItem({ item }: { item: NavRouteEntry }) {\n // Nav routes can come from a project's tree, unknown to Connect's types.\n const router = useRouter() as unknown as AnyRouter;\n // A boolean select: loading state changes don't re-render the item.\n const current = useRouterState({\n select: () => !!router.matchRoute({ to: item.to }, { fuzzy: true }),\n });\n const Icon = item.icon;\n return (\n <SidebarItem\n title={item.label}\n href={router.buildLocation({ to: item.to }).publicHref}\n aria-current={current ? \"page\" : undefined}\n onClick={(event) => {\n if (!isPlainClick(event)) return;\n event.preventDefault();\n void router.navigate({ to: item.to });\n }}\n onPreload={() => {\n router.preloadRoute({ to: item.to }).catch(() => undefined);\n }}\n icon={Icon ? <Icon size={24} /> : undefined}\n />\n );\n}\n\n/** Links to the routes that declare `staticData.nav`, in order. */\nexport function SidebarNavItems() {\n const items = useNavRoutes();\n return (\n <>\n {items.map((item) => (\n <NavSidebarItem key={item.routeId} item={item} />\n ))}\n </>\n );\n}\n\nexport type SidebarProps = {\n /** Items after the drives and nav routes, e.g. a custom layout's links. */\n extraItems?: ReactNode;\n /** Header and footer only, no items. */\n collapsed?: boolean;\n};\n\n/** Connect's sidebar: drives, nav routes, settings and the user. */\nexport function Sidebar({ extraItems, collapsed }: SidebarProps = {}) {\n const user = useUser();\n const openLogin = useOpenRenownLogin();\n const connectDebug =\n typeof localStorage !== \"undefined\" &&\n localStorage.getItem(\"CONNECT_DEBUG\") === \"true\";\n\n const ensName = user?.ens?.name || user?.profile?.username || undefined;\n const avatarUrl =\n user?.ens?.avatarUrl || user?.profile?.userImage || undefined;\n\n const ensInfo = useEns(!avatarUrl ? user?.address : undefined);\n\n const settingsLink = useLinkProps({ settings: true });\n\n const etherscanUrl = user?.address\n ? `https://etherscan.io/address/${user.address}`\n : \"\";\n\n return (\n <ConnectTooltipProvider>\n <ConnectSidebar\n id=\"sidebar\"\n data-collapsed={collapsed ? \"\" : undefined}\n onClick={() => setSelectedDrive(undefined)}\n onClickSettings={settingsLink.onClick}\n settingsHref={settingsLink.href}\n settingsCurrent={settingsLink[\"aria-current\"]}\n address={user?.address}\n onLogin={openLogin}\n onDisconnect={() => {\n void logout();\n }}\n ensName={ensName || ensInfo.data?.ens}\n avatarUrl={\n avatarUrl ||\n ensInfo.data?.avatar_small ||\n ensInfo.data?.avatar_url ||\n undefined\n }\n etherscanUrl={etherscanUrl}\n showDebug={connectDebug}\n onDebugClick={() => showPHModal({ type: \"debugSettings\" })}\n >\n {!collapsed && (\n <ErrorBoundary\n variant=\"text\"\n fallbackMessage=\"There was an error loading drives\"\n loggerContext={[\"Connect\", \"Sidebar\"]}\n >\n <SidebarDriveItems />\n <SidebarNavItems />\n {extraItems}\n </ErrorBoundary>\n )}\n </ConnectSidebar>\n </ConnectTooltipProvider>\n );\n}\n","import { useIsEmbedded } from \"@powerhousedao/connect-core/embedded\";\nimport type { ReactNode } from \"react\";\nimport {\n ContentOutlet,\n useSidebarMode,\n} from \"@powerhousedao/connect-core/router\";\nimport { Sidebar } from \"./sidebar.js\";\n\nexport type AppLayoutProps = {\n /** Replaces Connect's sidebar, e.g. `<ConnectSidebar extraItems={...} />`. */\n sidebar?: ReactNode;\n};\n\n/** The `_app` layout: the sidebar beside the matched route. Embedded mode and\n * `staticData.sidebar: \"hidden\"` drop the sidebar. */\nexport function AppLayout({ sidebar }: AppLayoutProps = {}) {\n const isEmbedded = useIsEmbedded();\n const mode = useSidebarMode();\n const showSidebar = !isEmbedded && mode !== \"hidden\";\n return (\n <div\n className=\"flex h-full items-stretch overflow-auto\"\n role=\"presentation\"\n tabIndex={0}\n >\n {showSidebar && (sidebar ?? <Sidebar collapsed={mode === \"collapsed\"} />)}\n <ContentOutlet className=\"relative flex flex-1 flex-col overflow-auto\" />\n </div>\n );\n}\n","import { CenteredErrorMessage } from \"@powerhousedao/connect/components/shared\";\nimport { useIsColdStart } from \"@powerhousedao/connect-core/router\";\nimport { DefaultEditorLoader } from \"@powerhousedao/design-system/connect\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\n\n// Fades the cold-start loader in, so a load ending just past pendingMs doesn't flash.\nconst DRIVE_PENDING_FADE = \"ph-drive-pending-in 200ms ease-in 100ms both\";\n\n/** A loader on a cold start; otherwise the open view stays while loading. */\nexport function DrivePending() {\n const isColdStart = useIsColdStart();\n if (!isColdStart) return null;\n return (\n <div\n className=\"flex size-full items-center justify-center\"\n style={{ animation: DRIVE_PENDING_FADE }}\n >\n <style>\n {`@keyframes ph-drive-pending-in{from{opacity:0}to{opacity:1}}`}\n </style>\n <DefaultEditorLoader message=\"Loading drive\" />\n </div>\n );\n}\n\n/** A route's loader or render error, as Connect's error boundaries show it. */\nexport function RouteError({ error, reset }: ErrorComponentProps) {\n return <CenteredErrorMessage error={error} resetErrorBoundary={reset} />;\n}\n","import { DropZoneWrapper } from \"@powerhousedao/design-system/connect\";\nimport { GenericDriveExplorer } from \"@powerhousedao/powerhouse-vetra-packages/editors\";\nimport {\n DriveProvider,\n useAppModuleById,\n useDefaultAppModule,\n useDispatch,\n} from \"@powerhousedao/reactor-browser\";\nimport { useDriveRouteData } from \"@powerhousedao/connect-core/router\";\nimport type { ReactNode } from \"react\";\nimport { Suspense, useMemo } from \"react\";\nimport { EditorLoader } from \"./editor-loader.js\";\nimport { ErrorBoundary } from \"@powerhousedao/connect/components/shared\";\n\n/** The route's drive's app around `children`, the open document's view;\n * drive apps show their own view while `children` is null. */\nexport function AppContainer({ children = null }: { children?: ReactNode }) {\n const { drive: selectedDrive, folder, documentId } = useDriveRouteData();\n\n const app = useAppModuleById(selectedDrive?.header.meta?.preferredEditor);\n const defaultApp = useDefaultAppModule();\n const [, dispatch] = useDispatch(selectedDrive);\n const nodeId = documentId ?? folder?.id;\n // The drive app's useSelected* read this; opening goes through the router.\n const context = useMemo(\n () => selectedDrive && { drive: selectedDrive, dispatch, folder, nodeId },\n [selectedDrive, dispatch, folder, nodeId],\n );\n\n if (!selectedDrive || !context) {\n return <EditorLoader />;\n }\n\n const AppComponent =\n app?.Component ?? defaultApp?.Component ?? GenericDriveExplorer.Component;\n return (\n <ErrorBoundary\n variant=\"detailed\"\n resetKeys={[selectedDrive.header.id]}\n loggerContext={[\"Connect\", \"App\"]}\n >\n <Suspense fallback={<EditorLoader />}>\n <DriveProvider value={context}>\n <DropZoneWrapper className=\"flex h-full flex-col overflow-auto\">\n <AppComponent document={selectedDrive} dispatch={dispatch}>\n {children}\n </AppComponent>\n </DropZoneWrapper>\n </DriveProvider>\n </Suspense>\n </ErrorBoundary>\n );\n}\n","import { AppContainer } from \"../editors/app-container.js\";\nimport { DocumentEditorContainer } from \"../editors/document-editor-container.js\";\nimport { DriveIcon } from \"@powerhousedao/connect/components/shared\";\nimport {\n DriveAuthGate,\n HomeScreen,\n HomeScreenAddDriveItem,\n HomeScreenItem,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n logout,\n makeDriveSlug,\n preloadDrive,\n setSelectedDrive,\n useAppModuleById,\n useIsAddDriveEnabled,\n useLinkProps,\n getDriveName,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport { Outlet } from \"@tanstack/react-router\";\nimport { useDriveRouteData } from \"@powerhousedao/connect-core/router\";\nimport { getRuntimeConfig } from \"@powerhousedao/connect-core/runtime-config\";\nimport { useDriveAuthGate, useVisibleDrives } from \"./use-drive-auth-gate.js\";\nimport { useOpenRenownLogin } from \"../hooks/use-renown-login.js\";\n\n/** Connect's home: the drives, and adding one. */\nexport function Home() {\n const drives = useVisibleDrives();\n const isAddDriveEnabled = useIsAddDriveEnabled();\n const runtimeConfig = getRuntimeConfig();\n const homeBackground = runtimeConfig.connect?.branding?.homeBackground;\n return (\n <HomeScreen homeBackground={homeBackground}>\n {drives?.map((drive) => {\n return <DriveItem key={drive.header.id} drive={drive} />;\n })}\n {isAddDriveEnabled && <HomeScreenAddDriveItem />}\n </HomeScreen>\n );\n}\n\n/** Connect's drive layout: the drive app around the open document, or the\n * sign-in gate when the drive's remote refuses the user. */\nexport function DriveLayout() {\n const { gate, dismiss } = useDriveAuthGate();\n const openLogin = useOpenRenownLogin();\n const { documentId } = useDriveRouteData();\n if (gate) {\n return (\n <div className=\"flex h-full items-center justify-center p-4\">\n <DriveAuthGate\n mode={gate}\n onLogin={openLogin}\n onLogout={() => void logout()}\n onClose={dismiss}\n />\n </div>\n );\n }\n return <AppContainer>{documentId ? <Outlet /> : null}</AppContainer>;\n}\n\n/** Connect's node route: the open document's editor. */\nexport function NodeView() {\n const { documentId } = useDriveRouteData();\n return documentId ? (\n <DocumentEditorContainer documentId={documentId} />\n ) : null;\n}\n\nfunction DriveItem({ drive }: { drive: DocumentDriveDocument }) {\n const editorModule = useAppModuleById(drive.header.meta?.preferredEditor);\n const description = editorModule?.config.name || \"Drive Explorer App\";\n const link = useLinkProps({ driveSlug: makeDriveSlug(drive) }, () =>\n setSelectedDrive(drive),\n );\n return (\n <HomeScreenItem\n key={drive.header.id}\n title={getDriveName(drive)}\n description={description}\n icon={<DriveIcon drive={drive} />}\n href={link.href}\n aria-current={link[\"aria-current\"]}\n onClick={link.onClick}\n onPreload={() => preloadDrive(drive)}\n />\n );\n}\n","import { connectConfig } from \"@powerhousedao/connect/config\";\nimport { lazyRouteComponent } from \"@tanstack/react-router\";\nimport type * as SettingsModule from \"./index.js\";\n\n/** Whether the AI assistant is configured. */\nexport const aiAssistantEnabled = () => connectConfig.aiAssistantEnabled;\n\n// Loaded with the settings page, not with the app; the router preloads it on intent.\nconst settings = () => import(\"./index.js\");\n\n/** Connect's settings page around the shown tab. */\nexport const SettingsPage = lazyRouteComponent(settings, \"SettingsPage\");\n\n/** One of Connect's settings tabs. */\nexport function settingsTab(\n name: Exclude<keyof typeof SettingsModule, \"SettingsPage\">,\n) {\n return lazyRouteComponent(settings, name);\n}\n","import type {\n ConnectRoutes,\n ConnectSettingsTab,\n} from \"@powerhousedao/connect-core/router\";\nimport type { AnyRoute } from \"@tanstack/react-router\";\nimport { createRoute } from \"@tanstack/react-router\";\nimport { Bot, CircleHelp, Package, PenLine, TriangleAlert } from \"lucide-react\";\nimport { aiAssistantEnabled, settingsTab } from \"./settings/tabs.js\";\n\nconst tab = (settings: ConnectSettingsTab) => ({ staticData: { settings } });\n\n/** The generic plugin's settings tabs by path: each tab's route options, which a\n * project file at that path spreads to replace the tab's view. */\nexport const genericSettingsTabs = {\n \"ai-assistant\": tab({\n label: \"AI Assistant\",\n order: 0,\n icon: Bot,\n enabled: aiAssistantEnabled,\n }),\n \"package-manager\": tab({\n label: \"Package Manager\",\n order: 10,\n icon: Package,\n }),\n \"default-editors\": tab({\n label: \"Default Editors\",\n order: 20,\n icon: PenLine,\n }),\n \"danger-zone\": tab({\n label: \"Danger Zone\",\n order: 80,\n icon: TriangleAlert,\n destructive: true,\n }),\n about: tab({ label: \"About\", order: 90, icon: CircleHelp }),\n};\n\ntype GenericSettingsTab = keyof typeof genericSettingsTabs;\n\nconst VIEWS: Record<GenericSettingsTab, Parameters<typeof settingsTab>[0]> = {\n \"ai-assistant\": \"AiAssistant\",\n \"package-manager\": \"ConnectPackageManager\",\n \"default-editors\": \"DefaultEditor\",\n \"danger-zone\": \"DangerZone\",\n about: \"About\",\n};\n\n/** The generic settings tabs, under the settings route. */\nexport function settingsTabRoutes({ settingsRoute }: ConnectRoutes) {\n return Object.entries(genericSettingsTabs).map(([path, options]) =>\n createRoute({\n getParentRoute: () => settingsRoute,\n path,\n ...options,\n component: settingsTab(VIEWS[path as GenericSettingsTab]),\n }),\n ) as AnyRoute[];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAgB,gBACd,iBACA,kBACA,WACU;CACV,MAAM,EAAE,iBAAiB,YAAY;CACrC,IAAI,CAAC,iBAAiB,OAAO;CAE7B,IAAI,UAAU;CACd,KAAK,MAAM,UAAU,SAAS;EAC5B,IAAI,OAAO,YAAY,iBAAiB;EACxC,MAAM,WAAW,iBAAiB,IAAI,OAAO,IAAI;EACjD,IAAI,UAAU,UAAU,WAAW,SAAS,cAAc;GACxD,UAAU;GACV;EACF;CACF;CACA,IAAI,CAAC,SAAS,OAAO;CACrB,OAAO,kBAAkB,iBAAiB;AAC5C;AAKA,MAAM,iCAAiB,IAAI,IAAY;AACvC,IAAI,yBAA4C,CAAC;AACjD,MAAM,uCAAuB,IAAI,IAAgB;AAEjD,SAAS,sBAA4B;CACnC,yBAAyB,CAAC,GAAG,cAAc;CAC3C,KAAK,MAAM,YAAY,CAAC,GAAG,oBAAoB,GAC7C,SAAS;AAEb;AAEA,SAAS,sBAAsB,UAAkC;CAC/D,qBAAqB,IAAI,QAAQ;CACjC,aAAa;EACX,qBAAqB,OAAO,QAAQ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