@powerhousedao/connect-core 6.2.3-dev.78 → 6.2.3-dev.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend-auth-gate-DNKg_v4Y.js +65 -0
- package/dist/backend-auth-gate-DNKg_v4Y.js.map +1 -0
- package/dist/backend-auth-gate-DiFpY5rt.d.ts +19 -0
- package/dist/backend-auth-gate-DiFpY5rt.d.ts.map +1 -0
- package/dist/{index-q4bHCPoJ.d.ts → index-BMlma368.d.ts} +30 -7
- package/dist/index-BMlma368.d.ts.map +1 -0
- package/dist/{index-DQ0nbYne.d.ts → index-Beqvfchq.d.ts} +16 -3
- package/dist/index-Beqvfchq.d.ts.map +1 -0
- package/dist/{index-Cm8rYUhs.d.ts → index-Bfl1VYdj.d.ts} +21 -2
- package/dist/index-Bfl1VYdj.d.ts.map +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +10 -9
- package/dist/{multi-reactor-CCMzwoMi.js → multi-reactor-D_2B4jmu.js} +2 -2
- package/dist/multi-reactor-D_2B4jmu.js.map +1 -0
- package/dist/{plugin-host-HhfxwUZN.js → plugin-host-CMr7lN40.js} +2 -2
- package/dist/{plugin-host-HhfxwUZN.js.map → plugin-host-CMr7lN40.js.map} +1 -1
- package/dist/{plugin-ui-W0ma6oKJ.js → plugin-ui-DHlnXJmN.js} +3 -3
- package/dist/{plugin-ui-W0ma6oKJ.js.map → plugin-ui-DHlnXJmN.js.map} +1 -1
- package/dist/plugins.js +2 -2
- package/dist/route-tree-D0aszMrk.js.map +1 -1
- package/dist/route-tree.d.ts +16 -16
- package/dist/route-tree.d.ts.map +1 -1
- package/dist/{router-DHL9GT3P.js → router-C4hDJ4_J.js} +10 -4
- package/dist/router-C4hDJ4_J.js.map +1 -0
- package/dist/router.d.ts +2 -2
- package/dist/router.js +4 -4
- package/dist/routes/__root.d.ts +3 -3
- package/dist/routes/__root.d.ts.map +1 -1
- package/dist/routes/__root.js +3 -3
- package/dist/routes/__root.js.map +1 -1
- package/dist/routes/_app/$.d.ts +3 -3
- package/dist/routes/_app/$.d.ts.map +1 -1
- package/dist/routes/_app/$.js +3 -3
- package/dist/routes/_app/$.js.map +1 -1
- package/dist/routes/_app/d/$driveSlug/{-$nodeSlug}.d.ts +5 -5
- package/dist/routes/_app/d/$driveSlug/{-$nodeSlug}.d.ts.map +1 -1
- package/dist/routes/_app/d/$driveSlug/{-$nodeSlug}.js +3 -3
- package/dist/routes/_app/d/$driveSlug/{-$nodeSlug}.js.map +1 -1
- package/dist/routes/_app/d/$driveSlug.d.ts +4 -4
- package/dist/routes/_app/d/$driveSlug.d.ts.map +1 -1
- package/dist/routes/_app/d/$driveSlug.js +3 -3
- package/dist/routes/_app/d/$driveSlug.js.map +1 -1
- package/dist/routes/_app/index.d.ts +41 -2
- package/dist/routes/_app/index.d.ts.map +1 -1
- package/dist/routes/_app/index.js +2 -2
- package/dist/routes/_app/index.js.map +1 -1
- package/dist/routes/_app/settings/appearance.d.ts +3 -3
- package/dist/routes/_app/settings/appearance.d.ts.map +1 -1
- package/dist/routes/_app/settings/appearance.js +3 -3
- package/dist/routes/_app/settings/appearance.js.map +1 -1
- package/dist/routes/_app/settings/packages.d.ts +3 -3
- package/dist/routes/_app/settings/packages.d.ts.map +1 -1
- package/dist/routes/_app/settings/packages.js +3 -3
- package/dist/routes/_app/settings/packages.js.map +1 -1
- package/dist/routes/_app/settings.d.ts +3 -3
- package/dist/routes/_app/settings.d.ts.map +1 -1
- package/dist/routes/_app/settings.js +3 -3
- package/dist/routes/_app/settings.js.map +1 -1
- package/dist/routes/_app.d.ts +41 -2
- package/dist/routes/_app.d.ts.map +1 -1
- package/dist/routes/_app.js +2 -2
- package/dist/routes/_app.js.map +1 -1
- package/dist/{runtime-D5hpzfgT.js → runtime-D20_LlB_.js} +64 -14
- package/dist/runtime-D20_LlB_.js.map +1 -0
- package/dist/runtime-config-D3YPhYyj.d.ts.map +1 -1
- package/dist/runtime-config.js +11 -5
- package/dist/runtime-config.js.map +1 -1
- package/dist/{runtime-flag-U8y14Nth.js → runtime-flag-DvxW_SD4.js} +2 -2
- package/dist/{runtime-flag-U8y14Nth.js.map → runtime-flag-DvxW_SD4.js.map} +1 -1
- package/dist/runtime.d.ts +3 -2
- package/dist/runtime.js +5 -4
- package/dist/{sidebar-CRv_DvBV.js → sidebar-C2y4mZnX.js} +13 -2
- package/dist/{sidebar-CRv_DvBV.js.map → sidebar-C2y4mZnX.js.map} +1 -1
- package/dist/{views-anOyTI7u.js → views-BtUVboYl.js} +79 -6
- package/dist/views-BtUVboYl.js.map +1 -0
- package/dist/views.d.ts +3 -2
- package/dist/views.js +3 -2
- package/package.json +8 -8
- package/src/router/index.ts +14 -2
- package/src/router/modals.tsx +3 -3
- package/src/router/route-options.ts +16 -0
- package/src/router/sidebar.ts +22 -0
- package/src/routes/__root.tsx +3 -2
- package/src/routes/_app/$.tsx +3 -2
- package/src/routes/_app/d/$driveSlug/{-$nodeSlug}.tsx +3 -2
- package/src/routes/_app/d/$driveSlug.tsx +3 -2
- package/src/routes/_app/index.tsx +2 -2
- package/src/routes/_app/settings/appearance.tsx +3 -3
- package/src/routes/_app/settings/packages.tsx +3 -3
- package/src/routes/_app/settings.tsx +3 -2
- package/src/routes/_app.tsx +2 -2
- package/src/runtime/app-reactor-client.ts +63 -12
- package/src/runtime/backend-auth-gate.ts +57 -0
- package/src/runtime/drive-relist.ts +18 -0
- package/src/runtime/graphql-routable-backend.ts +2 -2
- package/src/runtime/index.ts +8 -1
- package/src/runtime/reactor-client-mode.ts +26 -9
- package/src/runtime/runtime-config.ts +12 -1
- package/src/views/backend-auth-gate.tsx +76 -0
- package/src/views/directory-listing.tsx +2 -2
- package/src/views/editor-host.tsx +3 -3
- package/src/views/index.ts +5 -0
- package/src/views/layout.tsx +6 -2
- package/dist/index-Cm8rYUhs.d.ts.map +0 -1
- package/dist/index-DQ0nbYne.d.ts.map +0 -1
- package/dist/index-q4bHCPoJ.d.ts.map +0 -1
- package/dist/multi-reactor-CCMzwoMi.js.map +0 -1
- package/dist/router-DHL9GT3P.js.map +0 -1
- package/dist/runtime-D5hpzfgT.js.map +0 -1
- package/dist/views-anOyTI7u.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-D5hpzfgT.js","names":[],"sources":["../src/runtime/multi-reactor-flag.ts","../src/runtime/reactor-worker-flag.ts","../src/runtime/reactor-client-mode.ts","../src/runtime/app-reactor-client.ts","../src/runtime/ph-store.ts","../src/runtime/local-package.ts"],"sourcesContent":["import { getRuntimeConfig } from \"./runtime-config.js\";\n\n// Config only: the flag is in the worker fingerprint, so a per-tab value would split tabs.\nexport function isMultiReactorEnabled(): boolean {\n return getRuntimeConfig().connect.instance?.multiReactor ?? false;\n}\n","import { getRuntimeConfig } from \"./runtime-config.js\";\nimport {\n isRuntimeFlagEnabled,\n resolveRuntimeFlag,\n type RuntimeFlagInput,\n} from \"./runtime-flag.js\";\n\nexport const REACTOR_WORKER_QUERY_KEY = \"reactorWorker\";\nexport const REACTOR_WORKER_STORAGE_KEY = \"ph:reactorWorker\";\n\nexport type ReactorWorkerFlagInput = RuntimeFlagInput;\n\nexport function resolveReactorWorkerEnabled(\n input: ReactorWorkerFlagInput,\n): boolean {\n return resolveRuntimeFlag(input);\n}\n\nexport function isReactorWorkerEnabled(): boolean {\n return isRuntimeFlagEnabled({\n queryKey: REACTOR_WORKER_QUERY_KEY,\n storageKey: REACTOR_WORKER_STORAGE_KEY,\n readConfigFlag: () =>\n getRuntimeConfig().connect.instance?.reactorWorker ?? false,\n });\n}\n","import type { PHReactorClientMode } from \"@powerhousedao/shared/clis\";\nimport { getRuntimeConfig } from \"./runtime-config.js\";\nimport { isMultiReactorEnabled } from \"./multi-reactor-flag.js\";\nimport { isReactorWorkerEnabled } from \"./reactor-worker-flag.js\";\n\n/**\n * Which of the four reactor clients Connect boots. Standardized by the\n * multi-reactor work; this resolves the single selector Connect acts on:\n *\n * in-process | worker | remote | router\n *\n * Precedence: an explicit `?reactorClient=` query override (handy for a quick\n * check), then the served `connect.instance.reactorClient` (projected from the\n * host's reactor backends), then the LEGACY booleans — so a config that only\n * sets reactorWorker/multiReactor behaves exactly as before.\n *\n * `remote` is the only mode that builds NO local reactor (no PGlite): it is a\n * pure client to a remote Switchboard. `router` keeps the local reactor and\n * adds remote backends; `worker`/`in-process` are the local reactor alone.\n */\nexport type ReactorClientMode = PHReactorClientMode;\n\nconst MODES: ReadonlySet<string> = new Set([\n \"in-process\",\n \"worker\",\n \"remote\",\n \"router\",\n]);\n\nfunction fromQuery(): ReactorClientMode | undefined {\n if (typeof window === \"undefined\") return undefined;\n try {\n const value = new URLSearchParams(window.location.search).get(\n \"reactorClient\",\n );\n return value && MODES.has(value) ? (value as ReactorClientMode) : undefined;\n } catch {\n return undefined;\n }\n}\n\nexport function resolveReactorClientMode(): ReactorClientMode {\n const override = fromQuery();\n if (override) return override;\n const configured = getRuntimeConfig().connect.instance?.reactorClient;\n if (configured && MODES.has(configured)) return configured;\n // Legacy fallback — unchanged behaviour for configs without reactorClient.\n if (isMultiReactorEnabled()) return \"router\";\n if (isReactorWorkerEnabled()) return \"worker\";\n return \"in-process\";\n}\n","import type { IReactorClient } from \"@powerhousedao/reactor\";\nimport {\n getDrives,\n refreshReactorDataClient,\n setDrives,\n setFullReactorClient,\n getPHStore,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport type { ISigner } from \"@powerhousedao/shared/document-model\";\nimport { logger } from \"document-model\";\nimport type * as MultiReactor from \"./multi-reactor.js\";\nimport type {\n LoadedDocumentModels,\n LocalReactorModule,\n} from \"./multi-reactor.js\";\nimport type { ReactorClientMode } from \"./reactor-client-mode.js\";\nimport { resolveReactorClientMode } from \"./reactor-client-mode.js\";\nimport { isReactorWorkerEnabled } from \"./reactor-worker-flag.js\";\n\ntype MultiReactorModule = typeof MultiReactor;\n\nexport type AppReactorClientParams = {\n mode: ReactorClientMode;\n /** Built, and ready (the worker has started up). Undefined in `remote`\n * mode, where no local reactor is built. */\n module: LocalReactorModule | undefined;\n remoteDriveUrl: string | undefined;\n /** Signs routed writes; unsigned (anonymous) without one. */\n signer?: ISigner;\n documentModelModules: LoadedDocumentModels;\n loadRouter?: () => Promise<MultiReactorModule>;\n};\n\nconst loadMultiReactor = (): Promise<MultiReactorModule> =>\n import(\"./multi-reactor.js\");\n\n/** What a mode builds in the tab; `remote` builds no local reactor (no PGlite). */\nexport type ReactorClientPlan = {\n mode: ReactorClientMode;\n /** `router`: the local reactor plus remote backends. */\n multiReactor: boolean;\n needsLocalReactor: boolean;\n /** The local reactor runs in the shared worker. */\n localAsWorker: boolean;\n};\n\nexport function planReactorClient(\n mode: ReactorClientMode = resolveReactorClientMode(),\n): ReactorClientPlan {\n const needsLocalReactor = mode !== \"remote\";\n return {\n mode,\n multiReactor: mode === \"router\",\n needsLocalReactor,\n localAsWorker:\n needsLocalReactor &&\n (mode === \"worker\" || (mode === \"router\" && isReactorWorkerEnabled())),\n };\n}\n\n/** Builds the tab's reactor, e.g. Connect's PGlite or worker reactor. */\nexport type LocalReactorFactory = (\n plan: ReactorClientPlan,\n) => Promise<LocalReactorModule>;\n\nexport type CreateAppReactorClientOptions = Omit<\n AppReactorClientParams,\n \"mode\" | \"module\"\n> & {\n plan?: ReactorClientPlan;\n /** Called only when the plan needs a local reactor. */\n localReactor?: LocalReactorFactory;\n};\n\n/** Builds the local reactor the plan needs, then selects the app's client. */\nexport async function createAppReactorClient(\n options: CreateAppReactorClientOptions,\n) {\n const { localReactor, ...params } = options;\n const plan = options.plan ?? planReactorClient();\n let module: LocalReactorModule | undefined;\n if (plan.needsLocalReactor) {\n if (!localReactor) {\n throw new Error(\n `reactorClient mode \"${plan.mode}\" needs a local reactor; pass localReactor`,\n );\n }\n module = await localReactor(plan);\n }\n const client = await selectAppReactorClient({\n ...params,\n mode: plan.mode,\n module,\n });\n return { plan, module, client };\n}\n\n/**\n * Pick the client for the resolved mode:\n * - `in-process` / `worker`: the local client, router module never loaded.\n * - `router`: the local reactor plus remote backends.\n * - `remote`: a remote-only router — a full IReactorClient that proxies to\n * the Switchboard over GraphQL with NO local reactor (no PGlite).\n */\nexport async function selectAppReactorClient(\n params: AppReactorClientParams,\n): Promise<IReactorClient> {\n if (params.mode === \"remote\") {\n setFullReactorClient(undefined);\n const remote = await buildRemoteOnly(params);\n setFullReactorClient(remote);\n return remote;\n }\n if (params.mode !== \"router\") {\n if (getPHStore()?.fullReactorClient) {\n setFullReactorClient(undefined);\n }\n return requireModule(params).client;\n }\n setFullReactorClient(undefined);\n const routed = await buildRouter(params);\n setFullReactorClient(routed);\n return routed ?? requireModule(params).client;\n}\n\nfunction requireModule(params: AppReactorClientParams): LocalReactorModule {\n if (!params.module) {\n throw new Error(\n `reactorClient mode \"${params.mode}\" needs a local reactor, but none was built`,\n );\n }\n return params.module;\n}\n\n/** A Switchboard that cannot answer must not fail boot: list the tab's drives. */\nexport async function getAppDrives(\n client: IReactorClient,\n local: IReactorClient,\n): Promise<DocumentDriveDocument[]> {\n if (client === local) {\n return getDrives(local);\n }\n try {\n return await getDrives(client);\n } catch (error) {\n logger.warn(\n \"Could not list drives through the router; listing the local reactor's: @error\",\n error,\n );\n return getDrives(local);\n }\n}\n\nexport async function refreshAppDrives(\n client: IReactorClient,\n local: IReactorClient,\n): Promise<void> {\n if (client === local) {\n return refreshReactorDataClient(client);\n }\n setDrives(await getAppDrives(client, local));\n}\n\nasync function buildRouter(\n params: AppReactorClientParams,\n): Promise<IReactorClient | undefined> {\n if (!params.remoteDriveUrl) {\n logger.warn(\n \"multiReactor is on but no remote drive URL is configured; using the local reactor only\",\n );\n return undefined;\n }\n let multiReactor: MultiReactorModule;\n try {\n multiReactor = await (params.loadRouter ?? loadMultiReactor)();\n } catch (error) {\n logger.error(\"Could not load the multi-reactor router: @error\", error);\n return undefined;\n }\n const remoteGraphqlUrl = multiReactor.deriveSwitchboardGraphqlUrl(\n params.remoteDriveUrl,\n );\n if (!remoteGraphqlUrl) {\n logger.warn(\n \"multiReactor is on but the remote drive URL @url does not parse; using the local reactor only\",\n params.remoteDriveUrl,\n );\n return undefined;\n }\n logger.info(\"Multi-reactor routing to @url\", remoteGraphqlUrl);\n return multiReactor.buildMultiReactorClient({\n module: requireModule(params),\n remoteGraphqlUrl,\n signer: params.signer,\n documentModelModules: params.documentModelModules,\n });\n}\n\n/**\n * The `remote` mode: a remote-only router — a full IReactorClient that proxies\n * to the Switchboard over GraphQL with NO local backend, so no local reactor\n * and no PGlite are ever built. A missing/unparseable remote URL is a hard\n * config error here (unlike `router`, there is no local reactor to fall back\n * to).\n */\nasync function buildRemoteOnly(\n params: AppReactorClientParams,\n): Promise<IReactorClient> {\n if (!params.remoteDriveUrl) {\n throw new Error(\n 'reactorClient \"remote\" needs a remote drive URL — declare a remote backend / default drive the client can proxy to',\n );\n }\n const multiReactor = await (params.loadRouter ?? loadMultiReactor)();\n const remoteGraphqlUrl = multiReactor.deriveSwitchboardGraphqlUrl(\n params.remoteDriveUrl,\n );\n if (!remoteGraphqlUrl) {\n throw new Error(\n `reactorClient \"remote\": the remote drive URL \"${params.remoteDriveUrl}\" does not resolve to a Switchboard GraphQL endpoint`,\n );\n }\n logger.info(\"Remote reactor client → @url\", remoteGraphqlUrl);\n return multiReactor.buildMultiReactorClient({\n module: undefined,\n remoteGraphqlUrl,\n signer: params.signer,\n documentModelModules: params.documentModelModules,\n });\n}\n","import type { PHStore } from \"@powerhousedao/reactor-browser\";\nimport {\n bindPHStoreToWindow,\n createPHStore,\n getActivePHStore,\n} from \"@powerhousedao/reactor-browser\";\n\n/** The app's PH store: the active one, else a new one bound to `window.ph`.\n * Values set on `window.ph` before carry over. */\nexport function getConnectPHStore(): PHStore {\n const active = getActivePHStore();\n if (active) return active;\n const store = createPHStore();\n bindPHStoreToWindow(store);\n return store;\n}\n","import type { DocumentModelLib } from \"document-model\";\n\n/** A module namespace, as `import * as pkg` or Vite HMR hands it over. */\nexport type ModuleNamespace = Record<string, any> & {\n [Symbol.toStringTag]: \"Module\";\n};\n\nexport type LocalPackage = DocumentModelLib<any> | ModuleNamespace;\n\n/** The package itself, or a loader (`() => import(\"./index.js\")`) that keeps it off the boot path. */\nexport type LocalPackageSource = LocalPackage | (() => Promise<LocalPackage>);\n\n/** Starts loading the project's package; a loader runs once, here. */\nexport function loadLocalPackage(\n source: LocalPackageSource | undefined,\n): DocumentModelLib | Promise<DocumentModelLib> | undefined {\n const pkg = (typeof source === \"function\" ? source() : source) as\n | DocumentModelLib\n | Promise<DocumentModelLib>\n | undefined;\n // Consumers await it; this only stops an early rejection being reported as unhandled.\n if (pkg instanceof Promise) pkg.catch(() => undefined);\n return pkg;\n}\n"],"mappings":";;;;;AAGA,SAAgB,wBAAiC;CAC/C,OAAO,iBAAiB,CAAC,CAAC,QAAQ,UAAU,gBAAgB;AAC9D;;;ACEA,MAAa,2BAA2B;AACxC,MAAa,6BAA6B;AAI1C,SAAgB,4BACd,OACS;CACT,OAAO,mBAAmB,KAAK;AACjC;AAEA,SAAgB,yBAAkC;CAChD,OAAO,qBAAqB;EAC1B,UAAU;EACV,YAAY;EACZ,sBACE,iBAAiB,CAAC,CAAC,QAAQ,UAAU,iBAAiB;CAC1D,CAAC;AACH;;;ACHA,MAAM,wBAA6B,IAAI,IAAI;CACzC;CACA;CACA;CACA;AACF,CAAC;AAED,SAAS,YAA2C;CAClD,IAAI,OAAO,WAAW,aAAa,OAAO,KAAA;CAC1C,IAAI;EACF,MAAM,QAAQ,IAAI,gBAAgB,OAAO,SAAS,MAAM,CAAC,CAAC,IACxD,eACF;EACA,OAAO,SAAS,MAAM,IAAI,KAAK,IAAK,QAA8B,KAAA;CACpE,QAAQ;EACN;CACF;AACF;AAEA,SAAgB,2BAA8C;CAC5D,MAAM,WAAW,UAAU;CAC3B,IAAI,UAAU,OAAO;CACrB,MAAM,aAAa,iBAAiB,CAAC,CAAC,QAAQ,UAAU;CACxD,IAAI,cAAc,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BAAiB;CAChC,IAAI,QAAQ,OAAO;CACnB,MAAM,QAAQ,cAAc;CAC5B,oBAAoB,KAAK;CACzB,OAAO;AACT;;;;ACFA,SAAgB,iBACd,QAC0D;CAC1D,MAAM,MAAO,OAAO,WAAW,aAAa,OAAO,IAAI;CAKvD,IAAI,eAAe,SAAS,IAAI,YAAY,KAAA,CAAS;CACrD,OAAO;AACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"views-anOyTI7u.js","names":["modalViews"],"sources":["../src/views/index-table.tsx","../src/views/directory-listing.tsx","../src/views/document-history.tsx","../src/views/document-json.tsx","../src/views/editor-host.tsx","../src/views/content.tsx","../src/views/home.tsx","../src/views/theme-toggle.tsx","../src/views/modals.tsx","../src/views/layout.tsx","../src/views/not-found-page.tsx","../src/views/route-views.tsx","../src/views/settings.tsx","../src/views/settings-packages.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\n/** `YYYY-MM-DD HH:mm` in UTC, as a server index lists it; \"-\" when unknown. */\nexport function formatModified(iso: string | undefined) {\n if (!iso) return \"-\";\n const date = new Date(iso);\n if (Number.isNaN(date.getTime())) return \"-\";\n return date.toISOString().slice(0, 16).replace(\"T\", \" \");\n}\n\n/** An \"Index of\" page: a title above a name / type / last modified table. */\nexport function IndexTable(props: {\n title: ReactNode;\n label: string;\n children: ReactNode;\n}) {\n return (\n <div className=\"p-6 font-mono text-sm text-core-fg\">\n <h1 className=\"mb-4 text-xl font-semibold\">{props.title}</h1>\n <table aria-label={props.label} className=\"w-full border-collapse\">\n <thead>\n <tr className=\"border-b border-core-border text-left text-core-muted\">\n <th className=\"py-1 pr-6 font-normal\">Name</th>\n <th className=\"py-1 pr-6 font-normal\">Type</th>\n <th className=\"py-1 font-normal\">Last modified</th>\n </tr>\n </thead>\n <tbody>{props.children}</tbody>\n </table>\n </div>\n );\n}\n\nexport function IndexRow(props: {\n name: ReactNode;\n type: ReactNode;\n modified: ReactNode;\n}) {\n return (\n <tr className=\"border-b border-core-border/50 hover:bg-core-hover\">\n <td className=\"py-1 pr-6\">{props.name}</td>\n <td className=\"py-1 pr-6 text-core-muted\">{props.type}</td>\n <td className=\"py-1 whitespace-nowrap text-core-muted\">\n {props.modified}\n </td>\n </tr>\n );\n}\n\nexport const linkClass = \"text-core-link underline-offset-2 hover:underline\";\n","import {\n getDriveName,\n makeDriveSlug,\n makeNodeSlug,\n useDocumentById,\n useDriveNodes,\n useLinkProps,\n} from \"@powerhousedao/reactor-browser\";\nimport type {\n DocumentDriveDocument,\n FolderNode,\n Node,\n} from \"@powerhousedao/shared/document-drive\";\nimport { isFileNode } from \"@powerhousedao/shared/document-drive\";\nimport type { ReactNode } from \"react\";\nimport { Component, Fragment, Suspense } from \"react\";\nimport type { DriveViewProps } from \"../router/route-components.js\";\nimport {\n formatModified,\n IndexRow,\n IndexTable,\n linkClass,\n} from \"./index-table.js\";\n\nfunction NodeLink(props: {\n drive: DocumentDriveDocument;\n node: Node | undefined;\n children: ReactNode;\n}) {\n const link = useLinkProps({\n driveSlug: makeDriveSlug(props.drive),\n nodeSlug: props.node ? makeNodeSlug(props.node) : undefined,\n });\n return (\n <a {...link} className={linkClass}>\n {props.children}\n </a>\n );\n}\n\nfunction HomeLink(props: { children: ReactNode }) {\n const link = useLinkProps(undefined);\n return (\n <a {...link} className={linkClass}>\n {props.children}\n </a>\n );\n}\n\n// A row's date is a nicety: it shows \"-\" when the document can't load.\nclass Quiet extends Component<{ children: ReactNode }, { failed: boolean }> {\n state = { failed: false };\n static getDerivedStateFromError() {\n return { failed: true };\n }\n render() {\n return this.state.failed ? \"-\" : this.props.children;\n }\n}\n\nfunction DocumentModified({ id }: { id: string }) {\n const [document] = useDocumentById(id);\n return formatModified(document?.header.lastModifiedAtUtcIso);\n}\n\n/** The folders from the drive's root down to `folder`. */\nfunction folderPath(nodes: readonly Node[], folder: FolderNode | undefined) {\n const path: Node[] = [];\n for (let node: Node | undefined = folder; node;) {\n path.unshift(node);\n const parentId: string | null | undefined = node.parentFolder;\n node = parentId ? nodes.find((n) => n.id === parentId) : undefined;\n }\n return path;\n}\n\nconst byKindThenName = (a: Node, b: Node) =>\n a.kind === b.kind\n ? a.name.localeCompare(b.name)\n : a.kind === \"folder\"\n ? -1\n : 1;\n\n/** Core's drive fallback: a listing of the open folder; an open document shows instead. */\nexport function DirectoryListing({ drive, folder, children }: DriveViewProps) {\n if (children) return children;\n return <FolderListing drive={drive} folder={folder} />;\n}\n\nfunction FolderListing({\n drive,\n folder,\n}: {\n drive: DocumentDriveDocument;\n folder: FolderNode | undefined;\n}) {\n const nodes = useDriveNodes(drive.header.id) ?? [];\n const path = folderPath(nodes, folder);\n const parent = path.at(-2);\n const entries = nodes\n .filter((node) => (node.parentFolder ?? null) === (folder?.id ?? null))\n .sort(byKindThenName);\n const title = (\n <>\n Index of /\n <NodeLink drive={drive} node={undefined}>\n {getDriveName(drive)}\n </NodeLink>\n /\n {path.map((node) => (\n <Fragment key={node.id}>\n <NodeLink drive={drive} node={node}>\n {node.name}\n </NodeLink>\n /\n </Fragment>\n ))}\n </>\n );\n return (\n <IndexTable title={title} label=\"Directory listing\">\n <IndexRow\n name={\n folder ? (\n <NodeLink drive={drive} node={parent}>\n Parent Directory\n </NodeLink>\n ) : (\n <HomeLink>Parent Directory</HomeLink>\n )\n }\n type=\"-\"\n modified=\"-\"\n />\n {entries.map((node) => (\n <IndexRow\n key={node.id}\n name={\n <NodeLink drive={drive} node={node}>\n {node.kind === \"folder\" ? `${node.name}/` : node.name}\n </NodeLink>\n }\n type={isFileNode(node) ? node.documentType : \"Folder\"}\n modified={\n node.kind === \"folder\" ? (\n \"-\"\n ) : (\n <Quiet>\n <Suspense fallback=\"…\">\n <DocumentModified id={node.id} />\n </Suspense>\n </Quiet>\n )\n }\n />\n ))}\n </IndexTable>\n );\n}\n","import {\n hideRevisionHistory,\n setRevisionHistoryPage,\n useReactorClient,\n useRevisionHistoryPage,\n} from \"@powerhousedao/reactor-browser\";\nimport type { Operation } from \"@powerhousedao/shared/document-model\";\nimport { useEffect, useState } from \"react\";\nimport type { DocumentViewProps } from \"../router/route-components.js\";\nimport { formatModified, linkClass } from \"./index-table.js\";\n\nconst pagerClass = `${linkClass} disabled:text-core-muted disabled:no-underline`;\n\n/** Operations per scope on a history page. */\nexport const HISTORY_PAGE_SIZE = 50;\n\n/** Page `page`'s index range of a scope with `count` operations, newest first. */\nexport function historyPageRange(count: number, page: number) {\n const end = Math.max(count - (page - 1) * HISTORY_PAGE_SIZE, 0);\n return { start: Math.max(end - HISTORY_PAGE_SIZE, 0), end };\n}\n\ntype PageState =\n | { status: \"loading\" }\n | { status: \"ready\"; operations: Operation[] }\n | { status: \"error\"; error: Error };\n\n// Fetches only the page's range: `sinceRevision` and a limit of the page size.\nfunction useScopePage(\n documentId: string,\n scope: string,\n start: number,\n end: number,\n) {\n const client = useReactorClient();\n // Each result is kept with its request; a newer request reads as loading.\n const key = `${documentId}:${scope}:${start}:${end}`;\n const [result, setResult] = useState<{ key: string; state: PageState }>();\n const empty = !client || end <= start;\n useEffect(() => {\n if (empty) return;\n const controller = new AbortController();\n const setState = (state: PageState) => setResult({ key, state });\n client\n .getOperations(\n documentId,\n { scopes: [scope] },\n { sinceRevision: start },\n { cursor: \"\", limit: end - start },\n controller.signal,\n )\n .then(\n (page) => {\n const operations = page.results\n .filter((operation) => operation.index < end)\n .sort((a, b) => b.index - a.index);\n setState({ status: \"ready\", operations });\n },\n (reason: unknown) => {\n if (controller.signal.aborted) return;\n setState({\n status: \"error\",\n error: reason instanceof Error ? reason : new Error(String(reason)),\n });\n },\n );\n return () => controller.abort();\n }, [client, empty, key, documentId, scope, start, end]);\n if (empty) return { status: \"ready\", operations: [] } as const;\n return result?.key === key ? result.state : ({ status: \"loading\" } as const);\n}\n\nfunction ScopeOperations(props: {\n documentId: string;\n scope: string;\n count: number;\n page: number;\n}) {\n const { start, end } = historyPageRange(props.count, props.page);\n const state = useScopePage(props.documentId, props.scope, start, end);\n return (\n <section className=\"mb-6\">\n <h2 className=\"mb-2 font-semibold\">\n {props.scope}{\" \"}\n <span className=\"font-normal text-core-muted\">\n {end > start\n ? `${end - start} of ${props.count}, ${start}-${end - 1}`\n : `0 of ${props.count}`}\n </span>\n </h2>\n {state.status === \"error\" ? (\n <p className=\"text-core-danger\">{state.error.message}</p>\n ) : state.status === \"loading\" ? (\n <p className=\"text-core-muted\">Loading…</p>\n ) : state.operations.length === 0 ? (\n <p className=\"text-core-muted\">No operations on this page.</p>\n ) : (\n <table\n aria-label={`${props.scope} operations`}\n className=\"w-full border-collapse\"\n >\n <thead>\n <tr className=\"border-b border-core-border text-left text-core-muted\">\n <th className=\"py-1 pr-6 font-normal\">Index</th>\n <th className=\"py-1 pr-6 font-normal\">Action</th>\n <th className=\"py-1 font-normal\">Timestamp</th>\n </tr>\n </thead>\n <tbody>\n {state.operations.map((operation) => (\n <tr\n key={operation.index}\n className=\"border-b border-core-border/50 hover:bg-core-hover\"\n >\n <td className=\"py-1 pr-6\">{operation.index}</td>\n <td className=\"py-1 pr-6\">{operation.action.type}</td>\n <td className=\"py-1\">\n {formatModified(operation.timestampUtcMs)}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n )}\n </section>\n );\n}\n\n/** Core's revision history: each scope's operations, newest first, a page at a time. */\nexport function DocumentHistory({ document }: DocumentViewProps) {\n const page = useRevisionHistoryPage();\n const { header } = document;\n const scopes = Object.entries(header.revision);\n const pageCount = Math.max(\n 1,\n ...scopes.map(([, count]) => Math.ceil(count / HISTORY_PAGE_SIZE)),\n );\n const pager = (\n <nav aria-label=\"History pages\" className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n className={pagerClass}\n disabled={page <= 1}\n onClick={() => setRevisionHistoryPage(page - 1)}\n >\n Newer\n </button>\n <span className=\"text-core-muted\">\n Page {page} of {pageCount}\n </span>\n <button\n type=\"button\"\n className={pagerClass}\n disabled={page >= pageCount}\n onClick={() => setRevisionHistoryPage(page + 1)}\n >\n Older\n </button>\n </nav>\n );\n return (\n <div className=\"p-6 font-mono text-sm text-core-fg\">\n <div className=\"mb-4 flex items-baseline justify-between\">\n <h1 className=\"text-xl font-semibold\">\n History of {header.name || header.id}\n </h1>\n <button\n type=\"button\"\n className={linkClass}\n onClick={hideRevisionHistory}\n >\n Close\n </button>\n </div>\n <div className=\"mb-4\">{pager}</div>\n {scopes.length === 0 ? (\n <p className=\"text-core-muted\">No operations yet.</p>\n ) : (\n scopes.map(([scope, count]) => (\n <ScopeOperations\n key={scope}\n documentId={header.id}\n scope={scope}\n count={count}\n page={page}\n />\n ))\n )}\n </div>\n );\n}\n","import type { ReactNode } from \"react\";\nimport type { DocumentViewProps } from \"../router/route-components.js\";\nimport { formatModified } from \"./index-table.js\";\n\nfunction Leaf({ value }: { value: unknown }) {\n if (value === null) return <span className=\"text-core-muted\">null</span>;\n if (typeof value === \"string\") {\n return <span className=\"text-core-string\">{JSON.stringify(value)}</span>;\n }\n return <span className=\"text-core-number\">{JSON.stringify(value)}</span>;\n}\n\nfunction JsonNode(props: { name: ReactNode; value: unknown; open?: boolean }) {\n const { name, value } = props;\n if (value === null || typeof value !== \"object\") {\n return (\n <div className=\"pl-4\">\n <span className=\"text-core-muted\">{name}: </span>\n <Leaf value={value} />\n </div>\n );\n }\n const entries = Object.entries(value as Record<string, unknown>);\n const isArray = Array.isArray(value);\n const summary = isArray ? `[${entries.length}]` : `{${entries.length}}`;\n return (\n <details open={props.open} className=\"pl-4\">\n <summary className=\"cursor-pointer select-none\">\n <span className=\"text-core-muted\">{name}: </span>\n <span className=\"text-core-muted\">{summary}</span>\n </summary>\n {entries.map(([key, child]) => (\n <JsonNode key={key} name={key} value={child} />\n ))}\n </details>\n );\n}\n\n/** Core's document fallback: the document's state, read-only, as a JSON tree. */\nexport function DocumentJson({ document }: DocumentViewProps) {\n const { header } = document;\n const revisions = Object.entries(header.revision);\n const operations = revisions.reduce((sum, [, count]) => sum + count, 0);\n const state = document.state as Record<string, unknown>;\n const scopes = [\"global\", \"local\"].filter((scope) => scope in state);\n return (\n <div className=\"p-6 font-mono text-sm text-core-fg\">\n <h1 className=\"mb-1 text-xl font-semibold\">{header.name || header.id}</h1>\n <dl className=\"mb-4 grid grid-cols-[max-content_1fr] gap-x-4 text-core-muted\">\n <dt>Type</dt>\n <dd>{header.documentType}</dd>\n <dt>Id</dt>\n <dd>{header.id}</dd>\n <dt>Last modified</dt>\n <dd>{formatModified(header.lastModifiedAtUtcIso)}</dd>\n <dt>Operations</dt>\n <dd data-testid=\"operation-count\">\n {operations}\n {revisions.length > 0 &&\n ` (${revisions.map(([scope, count]) => `${scope} ${count}`).join(\", \")})`}\n </dd>\n </dl>\n <p className=\"mb-2 text-core-muted\">\n No editor is installed for this document type; its state is shown\n read-only.\n </p>\n <div aria-label=\"Document state\" className=\"-ml-4\">\n {scopes.map((scope) => (\n <JsonNode key={scope} name={scope} value={state[scope]} open />\n ))}\n </div>\n </div>\n );\n}\n","import type { EditorProps } from \"@powerhousedao/shared/document-model\";\nimport type { ErrorInfo, ReactNode } from \"react\";\nimport { Component, Suspense } from \"react\";\n\n/** What core passes a document editor; drive apps get `DriveViewProps`. */\nexport type DocumentEditorProps = EditorProps & {\n documentId: string;\n context?: { readMode?: boolean; selectedTimelineRevision?: number };\n};\n\ntype BoundaryProps = {\n resetKeys: readonly unknown[];\n label: string;\n children: ReactNode;\n};\ntype BoundaryState = { error?: unknown; keys: readonly unknown[] };\n\nclass EditorErrorBoundary extends Component<BoundaryProps, BoundaryState> {\n state: BoundaryState = { keys: this.props.resetKeys };\n\n static getDerivedStateFromError(error: unknown): Partial<BoundaryState> {\n return { error };\n }\n\n // A new document or drive gets a fresh try.\n static getDerivedStateFromProps(\n props: BoundaryProps,\n state: BoundaryState,\n ): Partial<BoundaryState> | null {\n const changed =\n props.resetKeys.length !== state.keys.length ||\n props.resetKeys.some((key, i) => !Object.is(key, state.keys[i]));\n return changed ? { error: undefined, keys: props.resetKeys } : null;\n }\n\n componentDidCatch(error: unknown, info: ErrorInfo) {\n console.error(`[connect] ${this.props.label} failed:`, error, info);\n }\n\n render() {\n const { error } = this.state;\n if (error === undefined) return this.props.children;\n return (\n <div role=\"alert\" className=\"p-6 text-core-fg\">\n <h2 className=\"font-semibold\">The {this.props.label} failed</h2>\n <pre className=\"mt-2 overflow-x-auto text-sm text-core-muted\">\n {error instanceof Error ? error.message : JSON.stringify(error)}\n </pre>\n </div>\n );\n }\n}\n\nexport type EditorHostProps = {\n /** A change shows the editor again after an error. */\n resetKeys?: readonly unknown[];\n /** Names what failed, e.g. \"editor\" or \"drive app\". */\n label?: string;\n children: ReactNode;\n};\n\n/** Hosts a drive app or an editor: it loads in Suspense, and an error stays inside. */\nexport function EditorHost({\n resetKeys = [],\n label = \"editor\",\n children,\n}: EditorHostProps) {\n return (\n <EditorErrorBoundary resetKeys={resetKeys} label={label}>\n <Suspense\n name=\"EditorHost\"\n fallback={\n <p role=\"status\" className=\"p-6 text-core-muted\">\n Loading {label}…\n </p>\n }\n >\n {children}\n </Suspense>\n </EditorErrorBoundary>\n );\n}\n","import {\n DriveProvider,\n EditorDocumentProvider,\n useAppModuleById,\n useDispatch,\n useDocument,\n useEditorModuleFor,\n useRevisionHistoryVisible,\n} from \"@powerhousedao/reactor-browser\";\nimport type { PHDocument } from \"@powerhousedao/shared/document-model\";\nimport { Outlet } from \"@tanstack/react-router\";\nimport { useMemo } from \"react\";\nimport { useDriveRouteData } from \"../router/route-data.js\";\nimport { DirectoryListing } from \"./directory-listing.js\";\nimport { DocumentHistory } from \"./document-history.js\";\nimport { DocumentJson } from \"./document-json.js\";\nimport { EditorHost } from \"./editor-host.js\";\n\n/** `document`: its revision history while `?history` is set, else its\n * editor (given `document` and `dispatch`), else its JSON. */\nexport function DocumentView({ document }: { document: PHDocument }) {\n const [, dispatch] = useDispatch(document);\n const editor = useEditorModuleFor(document);\n const historyVisible = useRevisionHistoryVisible();\n if (historyVisible) return <DocumentHistory document={document} />;\n if (!editor) return <DocumentJson document={document} />;\n const Editor = editor.Component;\n return (\n <div\n className=\"relative h-full\"\n data-editor={editor.config.id}\n data-document-type={document.header.documentType}\n >\n <EditorDocumentProvider document={document} dispatch={dispatch}>\n <Editor\n documentId={document.header.id}\n document={document}\n dispatch={dispatch}\n context={{ readMode: false }}\n />\n </EditorDocumentProvider>\n </div>\n );\n}\n\nfunction OpenDocument({ documentId }: { documentId: string }) {\n const document = useDocument(documentId);\n return document ? <DocumentView document={document} /> : null;\n}\n\n/** The drive layout: the drive app its `preferredEditor` names (given the\n * drive as `document`), else the directory listing, around the node route. */\nexport function DriveLayout() {\n const { drive, folder, documentId } = useDriveRouteData();\n const app = useAppModuleById(drive?.header.meta?.preferredEditor);\n const [, dispatch] = useDispatch(drive);\n const nodeId = documentId ?? folder?.id;\n const context = useMemo(\n () => drive && { drive, dispatch, folder, nodeId },\n [drive, dispatch, folder, nodeId],\n );\n if (!drive || !context) return null;\n const App = app?.Component;\n // Drive apps show their own view until they get a document to show.\n const document = documentId ? <Outlet /> : null;\n return (\n <DriveProvider value={context}>\n <EditorHost\n resetKeys={[drive.header.id]}\n label={App ? \"drive app\" : \"drive view\"}\n >\n {App ? (\n <App document={drive} dispatch={dispatch}>\n {document}\n </App>\n ) : (\n <DirectoryListing drive={drive} folder={folder}>\n {document}\n </DirectoryListing>\n )}\n </EditorHost>\n </DriveProvider>\n );\n}\n\n/** The node route: the open document, or nothing on a folder or the drive's root. */\nexport function NodeView() {\n const { documentId } = useDriveRouteData();\n if (!documentId) return null;\n return (\n <EditorHost resetKeys={[documentId]} label=\"editor\">\n <OpenDocument documentId={documentId} />\n </EditorHost>\n );\n}\n","import {\n getDriveName,\n makeDriveSlug,\n preloadDrive,\n useAppModuleById,\n useDrives,\n useLinkProps,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport {\n formatModified,\n IndexRow,\n IndexTable,\n linkClass,\n} from \"./index-table.js\";\n\nfunction DriveRow({ drive }: { drive: DocumentDriveDocument }) {\n const app = useAppModuleById(drive.header.meta?.preferredEditor);\n const link = useLinkProps({ driveSlug: makeDriveSlug(drive) });\n return (\n <IndexRow\n name={\n <a\n {...link}\n className={linkClass}\n onMouseEnter={() => {\n link.onMouseEnter();\n preloadDrive(drive);\n }}\n >\n {getDriveName(drive)}/\n </a>\n }\n type={app?.config.name ?? \"Drive\"}\n modified={formatModified(drive.header.lastModifiedAtUtcIso)}\n />\n );\n}\n\n/** Core's home: an index of the drives. */\nexport function DriveIndex() {\n const drives = useDrives();\n // Empty until the reactor lists its drives, e.g. in the prerendered shell.\n if (!drives) return null;\n return (\n <IndexTable title=\"Index of /\" label=\"Drives\">\n {drives.map((drive) => (\n <DriveRow key={drive.header.id} drive={drive} />\n ))}\n {!drives.length && (\n <tr>\n <td colSpan={3} className=\"py-2 text-core-muted\">\n No drives yet.\n </td>\n </tr>\n )}\n </IndexTable>\n );\n}\n","import { useTheme } from \"@powerhousedao/reactor-browser\";\n\n/** Flips between light and dark; the first flip pins the system theme's opposite. */\nexport function ThemeToggle({ className }: { className?: string }) {\n const { theme, setTheme } = useTheme();\n const next = theme === \"dark\" ? \"light\" : \"dark\";\n return (\n <button\n type=\"button\"\n aria-label={`Switch to ${next} theme`}\n title={`Switch to ${next} theme`}\n className={\n className ??\n \"rounded px-2 py-1 text-core-muted hover:bg-core-hover hover:text-core-fg\"\n }\n onClick={() => setTheme(next)}\n >\n {theme === \"dark\" ? \"☾\" : \"☀\"}\n </button>\n );\n}\n","// Core's modals: the ones editors, drive apps and the reactor open, in core's plain style.\nimport {\n addDocument,\n closePHModal,\n deleteNode,\n exportFile,\n getDocumentUpgradePreview,\n getDriveName,\n getNodeTarget,\n logout,\n openRenown,\n openTarget,\n setSelectedNode,\n showPHModal,\n upgradeDocument,\n useDocumentById,\n useDocumentModelModuleById,\n useModelRegistry,\n useNodeById,\n useNodeParentFolderById,\n usePHModal,\n useRenownAuth,\n useRenownLoginMethods,\n useUser,\n validateDocument,\n} from \"@powerhousedao/reactor-browser\";\nimport type { PHModal } from \"@powerhousedao/reactor-browser\";\nimport type { ReactNode } from \"react\";\nimport { createElement, useEffect, useId, useState } from \"react\";\nimport type { ModalFrameProps } from \"../router/modal-frame.js\";\nimport { ModalDialog, useModalFrame } from \"../router/modal-frame.js\";\nimport { useCreateDocumentTarget } from \"../router/create-target.js\";\nimport { useDriveRouteData } from \"../router/route-data.js\";\n\nconst buttonClass =\n \"rounded border border-core-border px-3 py-1 text-sm hover:bg-core-hover disabled:opacity-50\";\nconst primaryClass = `${buttonClass} font-semibold`;\n\n/** Core's modal frame: title, content, and the buttons on the right. */\nfunction CoreModalFrame({\n title,\n titleId,\n actions,\n children,\n}: ModalFrameProps) {\n return (\n <ModalDialog\n labelledBy={titleId}\n className=\"m-auto w-96 max-w-[calc(100vw-2rem)] rounded border border-core-border bg-core-bg p-5 text-core-fg backdrop:bg-black/30\"\n >\n <h2 id={titleId} className=\"mb-3 text-lg font-semibold\">\n {title}\n </h2>\n <div className=\"flex flex-col gap-2 text-sm\">{children}</div>\n <div className=\"mt-4 flex justify-end gap-2\">{actions}</div>\n </ModalDialog>\n );\n}\n\n/** A modal in the routes' frame, else core's. */\nfunction Dialog(props: {\n title: string;\n children: ReactNode;\n actions?: ReactNode;\n}) {\n const Frame = useModalFrame() ?? CoreModalFrame;\n const titleId = useId();\n const actions = props.actions ?? (\n <button type=\"button\" className={buttonClass} onClick={closePHModal}>\n Close\n </button>\n );\n // A registered frame, not one made here.\n return createElement(Frame, {\n title: props.title,\n titleId,\n actions,\n children: props.children,\n });\n}\n\nconst Cancel = () => (\n <button type=\"button\" className={buttonClass} onClick={closePHModal}>\n Cancel\n </button>\n);\n\nfunction useModal<T extends PHModal[\"type\"]>(type: T) {\n const modal = usePHModal();\n return modal?.type === type\n ? (modal as Extract<PHModal, { type: T }>)\n : undefined;\n}\n\n/** A new document of the modal's type: in its `driveId`, else the open drive\n * and folder, else a drive picked here. */\nexport function CreateDocumentModal() {\n const modal = useModal(\"createDocument\");\n const module = useDocumentModelModuleById(\n modal?.documentType,\n modal?.documentModelVersion,\n );\n const { folder } = useDriveRouteData();\n const target = useCreateDocumentTarget(modal?.driveId);\n const { drive } = target;\n const [name, setName] = useState(\"\");\n const typeName = module?.documentModel.global.name ?? modal?.documentType;\n const create = async () => {\n if (!drive || !module || !modal) return;\n closePHModal();\n const node = await addDocument(\n drive.header.id,\n name.trim() || `New ${typeName}`,\n module.documentModel.global.id,\n target.isOpenDrive ? folder?.id : undefined,\n undefined,\n undefined,\n undefined,\n modal.documentModelVersion,\n );\n // Opens it in its drive, wherever the modal was opened.\n openTarget(getNodeTarget(node, drive));\n };\n return (\n <Dialog\n title={`New ${typeName ?? \"document\"}`}\n actions={\n <>\n <Cancel />\n <button\n type=\"submit\"\n form=\"create-document\"\n className={primaryClass}\n disabled={!drive || !module}\n >\n Create\n </button>\n </>\n }\n >\n <form\n id=\"create-document\"\n className=\"flex flex-col gap-2\"\n onSubmit={(event) => {\n event.preventDefault();\n void create();\n }}\n >\n <label className=\"flex flex-col gap-1\">\n Name\n <input\n autoFocus\n value={name}\n onChange={(event) => setName(event.target.value)}\n placeholder={`New ${typeName}`}\n className=\"rounded border border-core-border bg-core-bg px-2 py-1\"\n />\n </label>\n {!!target.choices?.length && (\n <label className=\"flex flex-col gap-1\">\n Drive\n <select\n value={drive?.header.id ?? \"\"}\n onChange={(event) => target.pick(event.target.value)}\n className=\"rounded border border-core-border bg-core-bg px-2 py-1\"\n >\n {!drive && <option value=\"\">Choose a drive</option>}\n {target.choices.map((choice) => (\n <option key={choice.header.id} value={choice.header.id}>\n {getDriveName(choice)}\n </option>\n ))}\n </select>\n </label>\n )}\n </form>\n {target.choices?.length === 0 && (\n <p className=\"text-core-muted\">\n There's no drive to create it in.{\" \"}\n <button\n type=\"button\"\n className=\"underline\"\n onClick={() => showPHModal({ type: \"addDrive\" })}\n >\n Add a drive\n </button>\n </p>\n )}\n </Dialog>\n );\n}\n\n/** Signs in with Renown: the configured methods, else its portal. */\nexport function LoginModal() {\n const user = useUser();\n const methods = useRenownLoginMethods();\n const { login, pending, error } = useRenownAuth();\n useEffect(() => {\n if (user) closePHModal();\n }, [user]);\n return (\n <Dialog title=\"Log in\">\n {methods.length ? (\n methods.map((method) => (\n <button\n key={method.id}\n type=\"button\"\n className={buttonClass}\n disabled={pending}\n onClick={() => {\n closePHModal();\n login(undefined, method.id);\n }}\n >\n {method.label}\n </button>\n ))\n ) : (\n <button\n type=\"button\"\n className={primaryClass}\n onClick={() => openRenown()}\n >\n Continue with Renown\n </button>\n )}\n {error && <p className=\"text-core-muted\">{error.message}</p>}\n </Dialog>\n );\n}\n\n/** Deletes a file or folder, then opens its parent. */\nexport function DeleteItemModal() {\n const modal = useModal(\"deleteItem\");\n const node = useNodeById(modal?.id);\n const parent = useNodeParentFolderById(modal?.id);\n const { drive } = useDriveRouteData();\n const remove = async () => {\n closePHModal();\n if (!drive || !modal) return;\n await deleteNode(drive.header.id, modal.id);\n setSelectedNode(parent);\n };\n return (\n <Dialog\n title={`Delete ${node?.name ?? \"item\"}?`}\n actions={\n <>\n <Cancel />\n <button\n type=\"button\"\n className={primaryClass}\n onClick={() => void remove()}\n >\n Delete\n </button>\n </>\n }\n >\n <p>\n {node?.kind === \"folder\"\n ? \"The folder and everything in it will be deleted.\"\n : \"The document will be deleted.\"}\n </p>\n </Dialog>\n );\n}\n\n/** Upgrades a document to its model's latest version. */\nexport function ConfirmDocumentUpgradeModal() {\n const modal = useModal(\"confirmDocumentUpgrade\");\n const [document] = useDocumentById(modal?.documentId);\n const registry = useModelRegistry();\n const preview = document\n ? getDocumentUpgradePreview(document, registry)\n : undefined;\n if (!document || !preview) return null;\n const upgrade = () => {\n closePHModal();\n upgradeDocument(document.header.id).catch((error: unknown) => {\n console.error(\"[connect] the document upgrade failed:\", error);\n });\n };\n return (\n <Dialog\n title=\"Update document\"\n actions={\n <>\n <Cancel />\n <button type=\"button\" className={primaryClass} onClick={upgrade}>\n Update document\n </button>\n </>\n }\n >\n <p>\n From version {preview.fromVersion} to {preview.toVersion}. Existing\n content is migrated; this can't be undone.\n </p>\n {preview.steps\n .filter((step) => step.description)\n .map((step) => (\n <p key={step.toVersion}>\n v{step.toVersion}: {step.description}\n </p>\n ))}\n </Dialog>\n );\n}\n\n/** Exports a document that has validation errors, after listing them. */\nexport function DownloadDocumentWithErrorsModal() {\n const modal = useModal(\"downloadDocumentWithErrors\");\n const [document] = useDocumentById(modal?.documentId);\n if (!document) return null;\n const errors = validateDocument(document);\n const download = () => {\n closePHModal();\n exportFile(document).catch((error: unknown) => {\n console.error(\"[connect] the export failed:\", error);\n });\n };\n return (\n <Dialog\n title=\"The document has errors\"\n actions={\n <>\n <Cancel />\n <button type=\"button\" className={primaryClass} onClick={download}>\n Export anyway\n </button>\n </>\n }\n >\n <ul className=\"list-disc pl-5 text-core-muted\">\n {errors.map((error, index) => (\n <li key={index}>{error.message}</li>\n ))}\n </ul>\n </Dialog>\n );\n}\n\n/** A document whose model version no installed package provides. */\nexport function DocumentVersionUnsupportedModal() {\n const modal = useModal(\"documentVersionUnsupported\");\n if (!modal) return null;\n const { documentType, requiredVersion, availableVersions } = modal;\n return (\n <Dialog\n title=\"Document version not supported\"\n actions={\n <>\n <Cancel />\n <button\n type=\"button\"\n className={primaryClass}\n onClick={() => {\n closePHModal();\n openTarget({ settings: \"packages\" });\n }}\n >\n Show packages\n </button>\n </>\n }\n >\n <p>\n This document needs version {requiredVersion} of \"{documentType}\"; the\n installed packages provide {availableVersions.join(\", \")}.\n </p>\n </Dialog>\n );\n}\n\n/** A protected drive that couldn't be added: sign in, or as someone else. */\nexport function DriveAuthRequiredModal() {\n const user = useUser();\n return (\n <Dialog\n title={user ? \"No access to this drive\" : \"Log in to access this drive\"}\n actions={\n <>\n <Cancel />\n {user ? (\n <button\n type=\"button\"\n className={primaryClass}\n onClick={() => {\n closePHModal();\n void logout();\n }}\n >\n Log out\n </button>\n ) : (\n <button\n type=\"button\"\n className={primaryClass}\n onClick={() => showPHModal({ type: \"login\" })}\n >\n Log in\n </button>\n )}\n </>\n }\n >\n <p>\n {user\n ? \"The account you're signed in with can't open this drive.\"\n : \"This drive is only open to signed-in users.\"}\n </p>\n </Dialog>\n );\n}\n","import {\n initTheme,\n useLinkProps,\n useTheme,\n} from \"@powerhousedao/reactor-browser\";\nimport { HeadContent, Link, Outlet, useRouter } from \"@tanstack/react-router\";\nimport { Suspense } from \"react\";\nimport type { ConnectModals } from \"../router/modals.js\";\nimport { CORE_MODAL_VIEWS, ModalOutlet } from \"../router/modals.js\";\nimport { ContentOutlet } from \"../router/route-components.js\";\nimport { useNavRoutes, useSidebarMode } from \"../router/sidebar.js\";\nimport { appTitle } from \"../router/titles.js\";\nimport { useIsEmbedded } from \"../runtime/embedded.js\";\nimport { ThemeToggle } from \"./theme-toggle.js\";\nimport { linkClass } from \"./index-table.js\";\nimport * as modalViews from \"./modals.js\";\n\n// The layout shares the modals' chunk, so it renders them directly.\nconst coreModals: ConnectModals = Object.fromEntries(\n Object.entries(CORE_MODAL_VIEWS).map(([type, name]) => [\n type,\n modalViews[name],\n ]),\n);\n\n/** Core's root: the page, in the theme. */\nexport function CoreRoot() {\n initTheme();\n useTheme();\n return (\n <div className=\"h-screen overflow-auto bg-core-bg text-core-fg\">\n {/* The matched routes' head: the document title. */}\n <HeadContent />\n <Suspense name=\"CoreRoot\">\n <Outlet />\n </Suspense>\n <ModalOutlet modals={coreModals} />\n </div>\n );\n}\n\n/** Core's header: home, the `staticData.nav` routes, settings and the theme. */\nexport function CoreHeader() {\n const appName = useRouter().options.context.appName;\n const home = useLinkProps(undefined);\n const settings = useLinkProps({ settings: true });\n const navRoutes = useNavRoutes();\n return (\n <header className=\"flex items-center gap-4 border-b border-core-border px-4 py-2 text-sm\">\n <a {...home} className=\"font-semibold text-core-fg\">\n {appTitle(appName)}\n </a>\n <nav aria-label=\"Pages\" className=\"flex gap-3\">\n {navRoutes.map((item) => (\n // `to` is a plain string: the routes are only known at runtime.\n <Link key={item.routeId} to={item.to as never} className={linkClass}>\n {item.label}\n </Link>\n ))}\n </nav>\n <div className=\"ml-auto flex items-center gap-2\">\n <a {...settings} className={linkClass}>\n Settings\n </a>\n <ThemeToggle />\n </div>\n </header>\n );\n}\n\n/** Core's `_app` layout: the header above the matched route. Embedded mode\n * and `staticData.sidebar: \"hidden\"` drop the header. */\nexport function CoreLayout() {\n const isEmbedded = useIsEmbedded();\n const hidden = useSidebarMode() === \"hidden\";\n return (\n <div className=\"flex h-full flex-col\">\n {!isEmbedded && !hidden && <CoreHeader />}\n <main className=\"relative min-h-0 flex-1\">\n <ContentOutlet />\n </main>\n </div>\n );\n}\n","import { useLinkProps } from \"@powerhousedao/reactor-browser\";\nimport { useRouterState } from \"@tanstack/react-router\";\n\n/** The 404 page: what was asked for, and a way home. */\nexport function NotFoundPage({ driveSlug }: { driveSlug?: string }) {\n const pathname = useRouterState({ select: (s) => s.location.pathname });\n const home = useLinkProps(undefined);\n return (\n <div\n role=\"alert\"\n className=\"flex size-full flex-col items-center justify-center gap-3 p-6 text-center\"\n >\n <h1 className=\"text-2xl font-semibold text-core-fg\">\n {driveSlug ? `Drive ${driveSlug} not found` : \"Page not found\"}\n </h1>\n <p className=\"text-core-muted\">\n Nothing is at{\" \"}\n <code data-testid=\"not-found-path\" className=\"text-core-fg\">\n {pathname}\n </code>\n .\n </p>\n <a {...home} className=\"text-core-fg underline\">\n Go to the home page\n </a>\n </div>\n );\n}\n\nexport function DriveNotFoundPage({ driveSlug }: { driveSlug: string }) {\n return <NotFoundPage driveSlug={driveSlug} />;\n}\n","import type { ErrorComponentProps } from \"@tanstack/react-router\";\n\n/** A route's loader or render error. */\nexport function CoreRouteError({ error, reset }: ErrorComponentProps) {\n return (\n <div role=\"alert\" className=\"flex flex-col gap-2 p-6 text-core-fg\">\n <h1 className=\"text-lg font-semibold\">Something went wrong</h1>\n <pre className=\"overflow-x-auto text-sm text-core-muted\">\n {error instanceof Error ? error.message : JSON.stringify(error)}\n </pre>\n <button\n type=\"button\"\n className=\"self-start rounded border border-core-border px-3 py-1 hover:bg-core-hover\"\n onClick={reset}\n >\n Try again\n </button>\n </div>\n );\n}\n","import {\n useLinkProps,\n usePHNavigation,\n useTheme,\n} from \"@powerhousedao/reactor-browser\";\nimport { Outlet } from \"@tanstack/react-router\";\nimport { Suspense } from \"react\";\nimport type { SettingsTabEntry } from \"../router/settings.js\";\nimport { useSettingsTabs } from \"../router/settings.js\";\n\nfunction TabLink({ tab }: { tab: SettingsTabEntry }) {\n const link = useLinkProps({ settings: tab.id });\n const current = link[\"aria-current\"] === \"page\";\n const Icon = tab.icon;\n return (\n <a\n {...link}\n className={[\n \"flex items-center gap-2 rounded px-3 py-1.5\",\n current ? \"bg-core-hover font-semibold\" : \"hover:bg-core-hover\",\n tab.destructive ? \"text-core-danger\" : \"text-core-fg\",\n ].join(\" \")}\n >\n {Icon && <Icon size={16} />}\n {tab.label}\n </a>\n );\n}\n\n/** Core's settings page: the tabs from `staticData.settings` beside the open one. */\nexport function CoreSettingsPage() {\n const tabs = useSettingsTabs();\n const navigation = usePHNavigation();\n // Back to where settings was opened from, else home.\n const close = () => {\n if (navigation.closeOpened?.()) return;\n navigation.open(undefined, { replace: true });\n };\n return (\n <div className=\"flex h-full flex-col text-core-fg\">\n <div className=\"flex items-center justify-between border-b border-core-border px-4 py-3\">\n <h1 className=\"text-lg font-semibold\">Settings</h1>\n <button\n type=\"button\"\n className=\"rounded px-2 text-core-muted hover:bg-core-hover\"\n onClick={close}\n >\n Close\n </button>\n </div>\n <div className=\"flex min-h-0 flex-1\">\n <nav aria-label=\"Settings\" className=\"w-48 shrink-0 p-3\">\n <ul className=\"flex flex-col gap-1\">\n {tabs.map((tab) => (\n <li key={tab.id}>\n <TabLink tab={tab} />\n </li>\n ))}\n </ul>\n </nav>\n <section className=\"min-w-0 flex-1 overflow-auto p-6\">\n <Suspense name=\"SettingsTab\">\n <Outlet />\n </Suspense>\n </section>\n </div>\n </div>\n );\n}\n\nconst THEMES = [\n { value: \"light\", label: \"Light\" },\n { value: \"dark\", label: \"Dark\" },\n { value: \"system\", label: \"System\" },\n] as const;\n\n/** Core's Appearance tab: light, dark, or the system's. */\nexport function AppearanceTab() {\n const { theme, isSystem, setTheme } = useTheme();\n const selected = isSystem ? \"system\" : theme;\n return (\n <fieldset className=\"flex flex-col gap-2\">\n <legend className=\"mb-2 font-semibold\">Theme</legend>\n {THEMES.map((option) => (\n <label key={option.value} className=\"flex items-center gap-2\">\n <input\n type=\"radio\"\n name=\"theme\"\n value={option.value}\n checked={selected === option.value}\n onChange={() => setTheme(option.value)}\n />\n {option.label}\n </label>\n ))}\n </fieldset>\n );\n}\n","import {\n DRIVE_DOCUMENT_TYPES,\n useVetraPackageManager,\n useVetraPackages,\n} from \"@powerhousedao/reactor-browser\";\nimport type {\n DocumentModelLib,\n EditorModule,\n} from \"@powerhousedao/shared/document-model\";\nimport type { ReactNode } from \"react\";\n\nconst SOURCE_LABELS: Record<string, string> = {\n common: \"built-in\",\n project: \"project\",\n \"local-install\": \"local\",\n \"registry-install\": \"registry\",\n};\n\nconst isDriveApp = (editor: EditorModule) =>\n editor.documentTypes.some((type) =>\n (DRIVE_DOCUMENT_TYPES as readonly string[]).includes(type),\n );\n\n/** A package's document models by type, with every version it ships. */\nfunction modelsOf(pkg: DocumentModelLib) {\n const byType = new Map<string, { name: string; versions: number[] }>();\n for (const model of pkg.documentModels) {\n const { id, name } = model.documentModel.global;\n const entry = byType.get(id) ?? { name, versions: [] };\n entry.versions.push(model.version ?? 1);\n byType.set(id, entry);\n }\n return [...byType].map(([type, { name, versions }]) => ({\n type,\n name,\n versions: versions.sort((a, b) => a - b),\n }));\n}\n\nfunction Section(props: { title: string; children: ReactNode }) {\n return (\n <div className=\"mt-3\">\n <h3 className=\"mb-1 text-xs font-semibold tracking-wide text-core-muted uppercase\">\n {props.title}\n </h3>\n {props.children}\n </div>\n );\n}\n\nconst cell = \"py-1 pr-4 align-top break-words\";\n\nfunction EditorTable(props: { label: string; editors: EditorModule[] }) {\n return (\n <table\n aria-label={props.label}\n className=\"w-full table-fixed border-collapse text-sm\"\n >\n <tbody>\n {props.editors.map((editor) => (\n <tr key={editor.config.id} className=\"border-t border-core-border/50\">\n <td className={`${cell} w-1/3`}>{editor.config.name}</td>\n <td className={`${cell} w-1/3 font-mono text-core-muted`}>\n {editor.config.id}\n </td>\n <td className={`${cell} font-mono`}>\n {editor.documentTypes.join(\", \")}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n}\n\nfunction PackageEntry({ pkg }: { pkg: DocumentModelLib }) {\n const manager = useVetraPackageManager();\n const name = pkg.manifest.name;\n const version = manager?.getPackageVersion(name);\n const source = manager?.getPackageSource(name);\n const models = modelsOf(pkg);\n const apps = pkg.editors.filter(isDriveApp);\n const editors = pkg.editors.filter((editor) => !isDriveApp(editor));\n return (\n <li\n aria-label={name}\n className=\"rounded border border-core-border px-4 py-3\"\n >\n <div className=\"flex flex-wrap items-baseline gap-x-3\">\n <h2 className=\"font-semibold\">{name}</h2>\n {version && (\n <span className=\"font-mono text-sm text-core-muted\">{version}</span>\n )}\n {source && (\n <span className=\"rounded border border-core-border px-1.5 text-xs text-core-muted\">\n {SOURCE_LABELS[source] ?? source}\n </span>\n )}\n </div>\n {models.length > 0 && (\n <Section title=\"Document models\">\n <table\n aria-label={`${name} document models`}\n className=\"w-full table-fixed border-collapse text-sm\"\n >\n <tbody>\n {models.map((model) => (\n <tr key={model.type} className=\"border-t border-core-border/50\">\n <td className={`${cell} w-1/3`}>{model.name}</td>\n <td className={`${cell} w-1/3 font-mono`}>{model.type}</td>\n <td className={`${cell} text-core-muted`}>\n {model.versions.map((v) => `v${v}`).join(\", \")}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </Section>\n )}\n {editors.length > 0 && (\n <Section title=\"Editors\">\n <EditorTable label={`${name} editors`} editors={editors} />\n </Section>\n )}\n {apps.length > 0 && (\n <Section title=\"Drive apps\">\n <EditorTable label={`${name} drive apps`} editors={apps} />\n </Section>\n )}\n </li>\n );\n}\n\n/** Core's Packages tab: the loaded packages, their document models, editors and drive apps. */\nexport function PackagesTab() {\n const packages = useVetraPackages();\n return (\n <div className=\"w-full max-w-3xl\">\n {packages.length === 0 ? (\n <p className=\"text-core-muted\">No packages are loaded.</p>\n ) : (\n <ul aria-label=\"Packages\" className=\"flex flex-col gap-3\">\n {packages.map((pkg, index) => (\n <PackageEntry key={`${pkg.manifest.name}:${index}`} pkg={pkg} />\n ))}\n </ul>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAGA,SAAgB,eAAe,KAAyB;CACtD,IAAI,CAAC,KAAK,OAAO;CACjB,MAAM,OAAO,IAAI,KAAK,GAAG;CACzB,IAAI,OAAO,MAAM,KAAK,QAAQ,CAAC,GAAG,OAAO;CACzC,OAAO,KAAK,YAAY,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,QAAQ,KAAK,GAAG;AACzD;;AAGA,SAAgB,WAAW,OAIxB;CACD,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,oBAAC,MAAD;GAAI,WAAU;GAA8B,UAAA,MAAM;EAAU,CAAA,GAC5D,qBAAC,SAAD;GAAO,cAAY,MAAM;GAAO,WAAU;GAA1C,UAAA,CACE,oBAAC,SAAD,EAAA,UACE,qBAAC,MAAD;IAAI,WAAU;IAAd,UAAA;KACE,oBAAC,MAAD;MAAI,WAAU;MAAwB,UAAA;KAAQ,CAAA;KAC9C,oBAAC,MAAD;MAAI,WAAU;MAAwB,UAAA;KAAQ,CAAA;KAC9C,oBAAC,MAAD;MAAI,WAAU;MAAmB,UAAA;KAAiB,CAAA;IAChD;GACC,CAAA,EAAA,CAAA,GACP,oBAAC,SAAD,EAAA,UAAQ,MAAM,SAAgB,CAAA,CACzB;EACJ,CAAA,CAAA;;AAET;AAEA,SAAgB,SAAS,OAItB;CACD,OACE,qBAAC,MAAD;EAAI,WAAU;EAAd,UAAA;GACE,oBAAC,MAAD;IAAI,WAAU;IAAa,U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