@powerhousedao/connect 6.2.3-dev.64 → 6.2.3-dev.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ClearStorageModal-DONwGkPh.js → ClearStorageModal-BWSktCmz.js} +4 -4
- package/dist/{ClearStorageModal-DONwGkPh.js.map → ClearStorageModal-BWSktCmz.js.map} +1 -1
- package/dist/{DebugSettingsModal-BDX2ADlA.js → DebugSettingsModal-FR4Ygn1r.js} +4 -4
- package/dist/{DebugSettingsModal-BDX2ADlA.js.map → DebugSettingsModal-FR4Ygn1r.js.map} +1 -1
- package/dist/{InspectorModal-BORK4q75.js → InspectorModal-Df_Dj4Gy.js} +4 -4
- package/dist/{InspectorModal-BORK4q75.js.map → InspectorModal-Df_Dj4Gy.js.map} +1 -1
- package/dist/app-loader-DWVnAJhQ.js +4 -0
- package/dist/{app-loader-C97oGqzI.js → app-loader-FBmwAnUq.js} +9 -9
- package/dist/{app-loader-C97oGqzI.js.map → app-loader-FBmwAnUq.js.map} +1 -1
- package/dist/{build-info-C6G4Fjnr.js → build-info-D89jTqV-.js} +5 -5
- package/dist/{build-info-C6G4Fjnr.js.map → build-info-D89jTqV-.js.map} +1 -1
- package/dist/{components-BdPg3wOC.js → components-Ksj8WTJ5.js} +5 -5
- package/dist/{components-BdPg3wOC.js.map → components-Ksj8WTJ5.js.map} +1 -1
- package/dist/{load-CsRnf8jp.js → load-B-M2dI6C.js} +5 -5
- package/dist/{load-CsRnf8jp.js.map → load-B-M2dI6C.js.map} +1 -1
- package/dist/main.js +1 -1
- package/dist/{reactor-Dbhqwbjw.js → reactor-CMXWKWup.js} +6 -11
- package/dist/{reactor-Dbhqwbjw.js.map → reactor-CMXWKWup.js.map} +1 -1
- package/dist/router-Bh19hdNU.js +4 -0
- package/dist/{router-CCCrN6AM.js → router-Cxt7uaaL.js} +4 -4
- package/dist/{router-CCCrN6AM.js.map → router-Cxt7uaaL.js.map} +1 -1
- package/dist/{settings-CMQpb0hN.js → settings-D7lXsfBl.js} +5 -5
- package/dist/{settings-CMQpb0hN.js.map → settings-D7lXsfBl.js.map} +1 -1
- package/dist/start-connect.js +1 -1
- package/package.json +16 -16
- package/dist/app-loader-DpOHDhSo.js +0 -4
- package/dist/router-B8Yo4-or.js +0 -4
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { r as getConnectRouter } from "./router-Cxt7uaaL.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]="49ca91d1-0bfc-5f75-8693-5980115bca3a")}catch(e){}}();
|
|
4
|
+
//# debugId=49ca91d1-0bfc-5f75-8693-5980115bca3a
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ffb62207-50e4-55cc-a2b9-0f63ae9ffcc1")}catch(e){}}();
|
|
3
3
|
import { i as useReleasePrerenderedShell, t as LoadingShell } from "./prerendered-shell-DxCUDEXL.js";
|
|
4
4
|
import { t as getRuntimeConfig } from "./runtime-config-DdN1Frg7.js";
|
|
5
5
|
import { a as HOME_ROUTE_ID, n as bindConnectRouter, r as createConnectRouter, t as CONTENT_VIEW_ID } from "./connect-router-KmNBGS0G.js";
|
|
@@ -531,7 +531,7 @@ function DriveNotFoundPage({ driveSlug }) {
|
|
|
531
531
|
//#endregion
|
|
532
532
|
//#region src/components/router.tsx
|
|
533
533
|
const EmptyView = () => null;
|
|
534
|
-
const settingsModule = () => import("./settings-
|
|
534
|
+
const settingsModule = () => import("./settings-D7lXsfBl.js");
|
|
535
535
|
const lazySettings = (name) => lazy(() => settingsModule().then((m) => ({ default: m[name] })));
|
|
536
536
|
const SettingsPage = lazySettings("SettingsPage");
|
|
537
537
|
const connectRouteComponents = {
|
|
@@ -600,5 +600,5 @@ const Router$1 = () => {
|
|
|
600
600
|
//#endregion
|
|
601
601
|
export { AppContainer as a, EditorLoader as c, IfPlugin as i, Root as l, connectRouteComponents as n, DocumentEditorContainer as o, getConnectRouter as r, DocumentEditor as s, Router$1 as t };
|
|
602
602
|
|
|
603
|
-
//# sourceMappingURL=router-
|
|
604
|
-
//# debugId=
|
|
603
|
+
//# sourceMappingURL=router-Cxt7uaaL.js.map
|
|
604
|
+
//# debugId=ffb62207-50e4-55cc-a2b9-0f63ae9ffcc1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-CCCrN6AM.js","sources":["../src/components/root.tsx","../src/components/editor-loader.tsx","../src/hooks/useUndoRedoShortcuts.ts","../src/components/document-upgrade-toast.tsx","../src/components/editors.tsx","../src/components/document-editor-container.tsx","../src/components/app-container.tsx","../src/components/if-plugin.tsx","../src/components/route-views.tsx","../src/pages/content.tsx","../src/components/not-found-page.tsx","../src/components/router.tsx"],"sourcesContent":["import { Outlet } from \"@tanstack/react-router\";\nimport { Suspense } from \"react\";\nimport { useReleasePrerenderedShell } from \"./prerendered-shell.js\";\n\n/** What every page shares; the sidebar is the `_app` layout's. */\nexport function Root() {\n useReleasePrerenderedShell(true);\n return (\n <div className=\"h-screen overflow-auto bg-background\">\n <Suspense name=\"Root\">\n <Outlet />\n </Suspense>\n </div>\n );\n}\n","import { DefaultEditorLoader } from \"@powerhousedao/design-system/connect\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { useEffect, useState } from \"react\";\n\ntype Props = ComponentProps<typeof DefaultEditorLoader> & {\n /** Delay before showing, so short loads show nothing; 0 shows at once. */\n loadingTimeout?: number;\n customEditorLoader?: ReactNode;\n};\nexport function EditorLoader(props: Props) {\n const { customEditorLoader, loadingTimeout = 200, ...defaultProps } = props;\n const [showLoading, setShowLoading] = useState(loadingTimeout <= 0);\n\n useEffect(() => {\n if (loadingTimeout <= 0) return;\n const timer = setTimeout(() => setShowLoading(true), loadingTimeout);\n return () => clearTimeout(timer);\n }, [loadingTimeout]);\n\n if (!showLoading) return null;\n\n if (customEditorLoader) return <>{customEditorLoader}</>;\n\n return <DefaultEditorLoader {...defaultProps} />;\n}\n","import { useHotkeys } from \"react-hotkeys-hook\";\n\nexport interface UseUndoRedoShortcutsProps {\n undo: () => void;\n redo: () => void;\n canUndo: boolean;\n canRedo: boolean;\n}\n\nexport const useUndoRedoShortcuts = (props: UseUndoRedoShortcutsProps) => {\n const { undo, redo, canRedo, canUndo } = props;\n const isMac = window.navigator.userAgent.includes(\"Mac\");\n\n let undoShortcut = \"ctrl+z\";\n let redoShortcut = \"ctrl+y\";\n\n if (isMac) {\n undoShortcut = \"mod+z\";\n redoShortcut = \"mod+shift+z\";\n }\n\n // set handler for undo\n useHotkeys(\n undoShortcut,\n (event) => {\n event.preventDefault();\n if (canUndo) {\n undo();\n }\n },\n {},\n [canUndo, undo],\n );\n\n // set handler for redo\n useHotkeys(\n redoShortcut,\n (event) => {\n event.preventDefault();\n if (canRedo) {\n redo();\n }\n },\n {},\n [canRedo, redo],\n );\n};\n","import { showPHModal } from \"@powerhousedao/reactor-browser\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const DocumentUpgradeToast = ({\n documentId,\n}: {\n documentId: string;\n}) => {\n const { t } = useTranslation();\n\n return (\n <div>\n <p className=\"font-medium\">\n {t(\"notifications.documentUpgradeAvailable\")}\n </p>\n <button\n onClick={() => {\n showPHModal({ type: \"confirmDocumentUpgrade\", documentId });\n }}\n className=\"underline decoration-solid underline-offset-2\"\n >\n {t(\"common.updateDocument\")}\n </button>\n </div>\n );\n};\n","import { EditorLoader } from \"./editor-loader.js\";\nimport { useUndoRedoShortcuts } from \"../hooks/useUndoRedoShortcuts.js\";\nimport { dismissToast, toast } from \"@powerhousedao/connect/services\";\nimport { Icon, PowerhouseButton } from \"@powerhousedao/design-system\";\nimport { RevisionHistory } from \"@powerhousedao/design-system/connect\";\nimport {\n getRevisionFromDate,\n openTarget,\n setRevisionHistoryVisible,\n useDocumentById,\n useDocumentModelModuleById,\n useDocumentOperations,\n useDocumentVersionStatus,\n useEditorModuleById,\n useFallbackEditorModule,\n useRevisionHistoryVisible,\n useSelectedTimelineItem,\n useVetraPackageManager,\n useVetraPackages,\n} from \"@powerhousedao/reactor-browser\";\nimport type { PHDocument } from \"@powerhousedao/shared/document-model\";\nimport { redo, undo } from \"@powerhousedao/shared/document-model\";\nimport { createElement, Suspense, useEffect, useMemo, useState } from \"react\";\nimport { CenteredErrorMessage, ErrorBoundary } from \"./error-boundary.js\";\nimport { DocumentUpgradeToast } from \"./document-upgrade-toast.js\";\n\ntype Props<TDocument extends PHDocument = PHDocument> = {\n document: TDocument;\n};\n\n// Card treatment mirrors DetailedFallback in error-boundary.tsx so editor\n// errors read the same as boundary errors, and stay legible in both themes\n// (bg-card/border-border/text-foreground tokens instead of bare text).\nfunction EditorError({\n title,\n children,\n}: {\n title: string;\n children: React.ReactNode;\n}) {\n return (\n <div className=\"flex size-full items-center justify-center p-6\">\n <div className=\"w-full max-w-lg rounded-lg border border-border bg-card p-6 text-foreground shadow-sm\">\n <div className=\"mb-3 flex items-center gap-2\">\n <Icon name=\"Error\" className=\"size-5 shrink-0 text-destructive\" />\n <h3 className=\"min-w-0 text-lg font-semibold wrap-break-word text-foreground\">\n {title}\n </h3>\n </div>\n <div className=\"wrap-break-word\">{children}</div>\n </div>\n </div>\n );\n}\n\n// Prefers \"global\" when the document carries it, otherwise falls back to\n// the first available scope.\nfunction defaultScope(scopes: string[]): string {\n return scopes.includes(\"global\") ? \"global\" : scopes[0];\n}\n\nfunction OpenPackageManagerButton() {\n return (\n <PowerhouseButton\n className=\"px-3 py-1.5 text-base font-medium\"\n onClick={() => {\n openTarget({ settings: \"package-manager\" });\n }}\n type=\"button\"\n >\n Open package manager\n </PowerhouseButton>\n );\n}\n\nexport const DocumentEditor: React.FC<Props> = (props) => {\n const { document: initialDocument } = props;\n const selectedTimelineItem = useSelectedTimelineItem();\n const revisionHistoryVisible = useRevisionHistoryVisible();\n const [document, dispatch] = useDocumentById(initialDocument.header.id);\n const documentId = document?.header.id ?? undefined;\n const documentName = document?.header.name ?? undefined;\n const documentType = document?.header.documentType ?? undefined;\n const preferredEditor = document?.header.meta?.preferredEditor ?? undefined;\n // The scopes a document carries operations for; every document has at\n // least \"global\".\n const scopes = useMemo(() => {\n const keys = Object.keys(document?.header.revision ?? {});\n return keys.length > 0 ? keys : [\"global\"];\n }, [document?.header.revision]);\n const [operationScope, setOperationScope] = useState(() =>\n defaultScope(scopes),\n );\n const selectedScope = scopes.includes(operationScope)\n ? operationScope\n : defaultScope(scopes);\n\n // The history panel's operations: one scope, fetched only while the panel\n // is open. The panel asks for further pages itself.\n const {\n operations: historyOperations,\n isLoading: isLoadingHistory,\n hasNextPage: historyHasNextPage,\n fetchNextPage: fetchNextHistoryPage,\n error: historyError,\n } = useDocumentOperations(documentId, selectedScope, {\n enabled: revisionHistoryVisible,\n // A page fetch costs the same for 100 or 500 rows in the in-browser\n // reactor, so fewer, bigger round trips are strictly cheaper.\n limit: 500,\n });\n\n // The timeline read-mode feature maps a selected date range to a global\n // revision, which needs the whole global history. Fetched only while a\n // timeline item is selected; shares the cache entry with the panel when\n // the panel is on \"global\".\n const {\n operations: globalOperations,\n hasNextPage: globalHasNextPage,\n isLoading: isLoadingGlobal,\n fetchNextPage: fetchNextGlobalPage,\n error: globalError,\n } = useDocumentOperations(documentId, \"global\", {\n enabled: !!selectedTimelineItem,\n // A page fetch costs the same for 100 or 500 rows in the in-browser\n // reactor, so fewer, bigger round trips are strictly cheaper.\n limit: 500,\n });\n useEffect(() => {\n // An error ends the walk; we answer from what loaded rather than\n // retrying forever.\n if (!globalHasNextPage || isLoadingGlobal || globalError) return;\n // Deferred: the cache's fetch and the render it triggers are both\n // synchronous, so calling fetchNextGlobalPage here directly would chain\n // fetch -> render -> effect -> fetch into one uninterrupted task;\n // setTimeout(0) yields between pages so the UI stays responsive.\n const handle = window.setTimeout(fetchNextGlobalPage, 0);\n return () => window.clearTimeout(handle);\n }, [globalHasNextPage, isLoadingGlobal, fetchNextGlobalPage, globalError]);\n\n const globalRevisionNumber = document?.header.revision.global ?? 0;\n const localRevisionNumber = document?.header.revision.local ?? 0;\n const documentModelModule = useDocumentModelModuleById(documentType);\n const preferredEditorModule = useEditorModuleById(preferredEditor);\n const fallbackEditorModule = useFallbackEditorModule(documentType);\n const editorModule = preferredEditorModule ?? fallbackEditorModule;\n const versionStatus = useDocumentVersionStatus(document ?? undefined);\n const versionStatusKind = versionStatus?.kind;\n const upgradeAvailable =\n versionStatus?.kind === \"upgrade-available\" && versionStatus.canUpgrade;\n useEffect(() => {\n if (upgradeAvailable && documentId) {\n toast(createElement(DocumentUpgradeToast, { documentId }), {\n type: \"connect-warning\",\n toastId: `outdated-document-${documentId}`,\n autoClose: false,\n });\n } else if (\n versionStatusKind &&\n versionStatusKind !== \"upgrade-available\" &&\n documentId\n ) {\n dismissToast(`outdated-document-${documentId}`);\n }\n }, [upgradeAvailable, versionStatusKind, documentId]);\n const vetraPackages = useVetraPackages();\n const packageManager = useVetraPackageManager();\n const owningPackageName = editorModule\n ? vetraPackages.find((pkg) => pkg.editors.includes(editorModule))?.manifest\n .name\n : undefined;\n const owningPackageVersion =\n owningPackageName && packageManager\n ? packageManager.getPackageVersion(owningPackageName)\n : undefined;\n const editorBundleKey = owningPackageName\n ? `${owningPackageName}@${owningPackageVersion ?? \"unknown\"}`\n : (editorModule?.config.id ?? \"no-editor\");\n const isLoadingDocument = !document;\n const isLoadingEditor =\n editorModule &&\n documentType &&\n !editorModule.documentTypes.includes(documentType) &&\n !editorModule.documentTypes.includes(\"*\");\n\n const canUndo = globalRevisionNumber > 0 || localRevisionNumber > 0;\n const canRedo = !!document?.clipboard.length;\n const addUndoAction = () => dispatch(undo());\n const addRedoAction = () => dispatch(redo());\n useUndoRedoShortcuts({\n undo: addUndoAction,\n redo: addRedoAction,\n canUndo,\n canRedo,\n });\n\n useEffect(() => {\n return () => {\n window.documentEditorDebugTools?.clear();\n };\n }, []);\n\n const [editorError, setEditorError] = useState<\n | {\n error: any;\n info: React.ErrorInfo;\n documentId?: string;\n // clear: () => void;\n }\n | undefined\n >(undefined);\n\n useEffect(() => {\n if (editorError && editorError.documentId !== documentId) {\n // eslint-disable-next-line react-hooks-extra/set-state-in-effect\n setEditorError(undefined);\n }\n }, [editorError, documentId]);\n\n const handleEditorError = (error: Error, info: React.ErrorInfo) => {\n setEditorError({\n error,\n documentId,\n info,\n });\n };\n\n if (isLoadingEditor) {\n return <EditorLoader message=\"Loading editor\" />;\n }\n\n if (isLoadingDocument) {\n return <EditorLoader message=\"Loading document\" />;\n }\n\n if (!documentModelModule) {\n return (\n <EditorError title=\"Document type not supported\">\n <p className=\"mb-4 text-sm text-foreground\">\n This document can't be opened because the \"{documentType}\" document\n model isn't installed. Install the package that provides it to open\n the document.\n </p>\n <OpenPackageManagerButton />\n </EditorError>\n );\n }\n\n if (versionStatus?.kind === \"unsupported\") {\n return (\n <EditorError title=\"Document version not supported\">\n <p className=\"mb-4 text-sm text-foreground\">\n This document requires version {versionStatus.documentVersion} of the\n \"{documentType}\" document model, but only version\n {versionStatus.availableVersions.length > 1 ? \"s\" : \"\"}{\" \"}\n {versionStatus.availableVersions.join(\", \")}{\" \"}\n {versionStatus.availableVersions.length > 1 ? \"are\" : \"is\"} installed.\n Update the package that provides \"{documentType}\" to open it.\n </p>\n <OpenPackageManagerButton />\n </EditorError>\n );\n }\n\n if (!editorModule) {\n return (\n <EditorError title=\"No editor available\">\n <p className=\"mb-4 text-sm text-foreground\">\n The \"{documentType}\" document model is installed, but no editor for it\n was found. Install a package that provides an editor for this document\n type.\n </p>\n <OpenPackageManagerButton />\n </EditorError>\n );\n }\n const EditorComponent = editorModule.Component;\n\n return (\n <div\n className=\"relative h-full\"\n id=\"document-editor-context\"\n data-editor={editorModule.config.id}\n data-document-type={documentType}\n >\n {revisionHistoryVisible ? (\n <RevisionHistory\n key={documentId}\n documentTitle={documentName ?? \"\"}\n documentId={documentId ?? \"\"}\n operations={historyOperations}\n isLoading={isLoadingHistory}\n hasNextPage={historyHasNextPage}\n onLoadNextPage={fetchNextHistoryPage}\n error={historyError}\n scopes={scopes}\n scope={selectedScope}\n onScopeChange={setOperationScope}\n onClose={() => setRevisionHistoryVisible(false)}\n documentState={document.state}\n onCopyState={() => {\n toast(\"Copied document state to clipboard\", { type: \"success\" });\n }}\n onCopyDocId={() => {\n toast(\"Copied document ID to clipboard\", { type: \"success\" });\n }}\n />\n ) : (\n <Suspense\n fallback={<EditorLoader message=\"Loading editor\" />}\n name=\"EditorLoader\"\n >\n <ErrorBoundary\n fallbackRender={CenteredErrorMessage}\n resetKeys={[documentId]}\n onError={handleEditorError}\n loggerContext={[\"Connect\", \"DocumentEditor\"]}\n >\n {!editorError?.error && (\n <EditorComponent\n key={`${editorBundleKey}:${documentId}`}\n context={{\n readMode: !!selectedTimelineItem,\n // Until the whole global history has paged in, the date lookup\n // cannot be answered; undefined leaves the editor on the latest\n // state in read mode instead of jumping to revision 0. A failed\n // page ends the walk, so we answer from what loaded rather than\n // waiting on a page that will never arrive.\n selectedTimelineRevision:\n (isLoadingGlobal || globalHasNextPage) && !globalError\n ? undefined\n : getRevisionFromDate(\n selectedTimelineItem?.startDate,\n selectedTimelineItem?.endDate,\n globalOperations,\n ),\n }}\n documentId={document.header.id}\n />\n )}\n </ErrorBoundary>\n </Suspense>\n )}\n </div>\n );\n};\n","import { DocumentEditor } from \"./editors.js\";\nimport {\n setSelectedNode,\n useNodeParentFolderById,\n useSelectedDocument,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function DocumentEditorContainer() {\n const [selectedDocument] = useSelectedDocument();\n const parentFolder = useNodeParentFolderById(selectedDocument.header.id);\n\n // TODO: unused\n const _onOpenSwitchboardLink = useMemo(() => {\n return async () => {\n //\n };\n }, []);\n\n const _onClose = useCallback(() => {\n setSelectedNode(parentFolder);\n }, [parentFolder]);\n\n return (\n <div\n id=\"document-editor-container\"\n className=\"flex-1\"\n data-document-type={selectedDocument.header.documentType}\n >\n <DocumentEditor document={selectedDocument} />\n </div>\n );\n}\n","import { DropZoneWrapper } from \"@powerhousedao/design-system/connect\";\nimport { GenericDriveExplorer } from \"@powerhousedao/powerhouse-vetra-packages/editors\";\nimport {\n useAppModuleById,\n useDefaultAppModule,\n useSelectedDocumentId,\n useSelectedDriveSafe,\n} from \"@powerhousedao/reactor-browser\";\nimport { Suspense } from \"react\";\nimport { DocumentEditorContainer } from \"./document-editor-container.js\";\nimport { EditorLoader } from \"./editor-loader.js\";\nimport { ErrorBoundary } from \"./error-boundary.js\";\n\nexport function AppContainer() {\n const [selectedDrive] = useSelectedDriveSafe();\n const selectedDocumentId = useSelectedDocumentId();\n\n const app = useAppModuleById(selectedDrive?.header.meta?.preferredEditor);\n const defaultApp = useDefaultAppModule();\n\n if (!selectedDrive) {\n return <EditorLoader />;\n }\n\n const AppComponent =\n app?.Component ?? defaultApp?.Component ?? GenericDriveExplorer.Component;\n\n if (!AppComponent) {\n throw new Error(\"No app component found\");\n }\n return (\n <ErrorBoundary\n variant=\"detailed\"\n resetKeys={[selectedDrive.header.id]}\n loggerContext={[\"Connect\", \"App\"]}\n >\n <Suspense fallback={<EditorLoader />}>\n <DropZoneWrapper className=\"flex h-full flex-col overflow-auto\">\n <AppComponent>\n {selectedDocumentId ? <DocumentEditorContainer /> : null}\n </AppComponent>\n </DropZoneWrapper>\n </Suspense>\n </ErrorBoundary>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { useIsPluginActive } from \"../hooks/usePluginComposition.js\";\n\n/**\n * Renders its children only when a plugin is present in the served\n * composition — the runtime gate for generic-chrome deletability (rewire R3).\n *\n * This is the demonstration step ahead of extracting the generic components\n * into their own package: it makes \"remove the generic plugin → the chrome is\n * gone\" true at render time while the code still lives in the Connect app.\n * When those components move to `@powerhousedao/connect-generic`, this gate\n * becomes the seam where the package is dynamically imported (or not) instead\n * of merely not rendered.\n *\n * Presence is activation, classic-preserving: with no declared composition,\n * every plugin reads active, so the chrome renders unchanged.\n */\nexport function IfPlugin(props: {\n module: string;\n children: ReactNode;\n /** Rendered when the plugin is absent from a declared composition. */\n fallback?: ReactNode;\n}): ReactNode {\n const active = useIsPluginActive(props.module);\n return active ? props.children : (props.fallback ?? null);\n}\n","import { DefaultEditorLoader } from \"@powerhousedao/design-system/connect\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\nimport { useMatch, useRouter, useRouterState } from \"@tanstack/react-router\";\nimport type { PropsWithChildren } from \"react\";\nimport { useEffect, useState } from \"react\";\nimport { HOME_ROUTE_ID } from \"../router/route-tree.js\";\nimport AppSkeleton from \"./app-skeleton.js\";\nimport { CenteredErrorMessage } from \"./error-boundary.js\";\nimport { LoadingShell } from \"./prerendered-shell.js\";\n\n// Loads quicker than this show no progress bar.\nconst PROGRESS_DELAY_MS = 150;\n\n/** True until the router has resolved its first location. */\nexport function useIsColdStart() {\n return useRouterState({ select: (state) => !state.resolvedLocation });\n}\n\n/** Whether the content shows home: a cold deep link shows the pending view. */\nexport function useShowsHomeScreen(hasSelection: boolean) {\n const isColdStart = useIsColdStart();\n const isHomeRoute = !!useMatch({ from: HOME_ROUTE_ID, shouldThrow: false });\n return !hasSelection && (isHomeRoute || !isColdStart);\n}\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\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","import { AppContainer } from \"../components/app-container.js\";\nimport { DriveIcon } from \"../components/drive-icon.js\";\nimport { IfPlugin } from \"../components/if-plugin.js\";\nimport {\n defaultPHAppConfig,\n defaultPHDocumentEditorConfig,\n} from \"@powerhousedao/connect/config\";\nimport {\n DriveAuthGate,\n HomeScreen,\n HomeScreenAddDriveItem,\n HomeScreenItem,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n logout,\n makeDriveSlug,\n preloadDrive,\n setPHAppConfig,\n setPHDocumentEditorConfig,\n setSelectedDrive,\n useAppModuleById,\n useIsAddDriveEnabled,\n useLinkProps,\n useSelectedDocumentId,\n useSelectedDriveSafe,\n useSelectedFolder,\n getDriveName,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport { Outlet } from \"@tanstack/react-router\";\nimport { useEffect } from \"react\";\nimport { getRuntimeConfig } from \"../runtime-config.js\";\nimport { CONTENT_VIEW_ID } from \"../router/connect-router.js\";\nimport { useShowsHomeScreen } from \"../components/route-views.js\";\nimport {\n useDriveAuthGate,\n useVisibleDrives,\n} from \"../components/use-drive-auth-gate.js\";\nimport { useOpenRenownLogin } from \"../hooks/use-renown-login.js\";\n\nexport function Content() {\n const { gate, dismiss } = useDriveAuthGate();\n const openLogin = useOpenRenownLogin();\n const [selectedDrive] = useSelectedDriveSafe();\n const selectedFolder = useSelectedFolder();\n const selectedDocumentId = useSelectedDocumentId();\n\n useEffect(() => {\n if (!selectedDocumentId) {\n setPHDocumentEditorConfig(defaultPHDocumentEditorConfig);\n }\n }, [selectedDocumentId]);\n\n useEffect(() => {\n if (!selectedDrive) {\n setPHAppConfig(defaultPHAppConfig);\n }\n }, [selectedDrive]);\n\n const hasSelection = !!(\n selectedDocumentId ||\n selectedDrive ||\n selectedFolder\n );\n const showHomeScreen = useShowsHomeScreen(hasSelection);\n return (\n <ContentContainer>\n <Outlet />\n {gate ? (\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 ) : showHomeScreen ? (\n // The home screen is generic-shell chrome (the drive-list landing +\n // add-drive). R3 gate: only when the generic plugin is composed in.\n // Absent → no generic landing (a headless/custom shell renders its own\n // or routes straight to a drive). Classic (no composition) = active.\n <IfPlugin module=\"@powerhousedao/connect/plugins/generic\">\n <HomeScreenContainer />\n </IfPlugin>\n ) : hasSelection ? (\n <AppContainer />\n ) : null}\n </ContentContainer>\n );\n}\n\nfunction ContentContainer({ children }: { children: React.ReactNode }) {\n return (\n <div\n className=\"flex h-full flex-col overflow-auto\"\n id={CONTENT_VIEW_ID}\n data-scroll-restoration-id={CONTENT_VIEW_ID}\n >\n {children}\n </div>\n );\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\nfunction HomeScreenContainer() {\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","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-foreground\">\n {driveSlug ? `Drive ${driveSlug} not found` : \"Page not found\"}\n </h1>\n <p className=\"text-muted-foreground\">\n Nothing is at{\" \"}\n <code data-testid=\"not-found-path\" className=\"text-foreground\">\n {pathname}\n </code>\n .\n </p>\n <a {...home} className=\"text-foreground 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 { Root } from \"./root.js\";\nimport { connectConfig } from \"@powerhousedao/connect/config\";\nimport { Content } from \"../pages/content.js\";\nimport type { PHStore } from \"@powerhousedao/reactor-browser\";\nimport {\n createDriveArrivals,\n ensurePHStore,\n usePHStore,\n} from \"@powerhousedao/reactor-browser\";\nimport { RouterProvider } from \"@tanstack/react-router\";\nimport { lazy, Suspense } from \"react\";\nimport { getRuntimeConfig } from \"../runtime-config.js\";\nimport type { ConnectRouteComponents } from \"../router/route-components.js\";\nimport type * as SettingsModule from \"./settings/index.js\";\nimport { AppLayout } from \"./app-layout.js\";\nimport { LoadingShell } from \"./prerendered-shell.js\";\nimport {\n bindConnectRouter,\n createConnectRouter,\n} from \"../router/connect-router.js\";\nimport { DriveNotFoundPage, NotFoundPage } from \"./not-found-page.js\";\nimport { DrivePending, RouteError, RouterChrome } from \"./route-views.js\";\n\nconst EmptyView = () => null;\n\nconst settingsModule = () => import(\"./settings/index.js\");\nconst lazySettings = (name: keyof typeof SettingsModule) =>\n lazy(() => settingsModule().then((m) => ({ default: m[name] })));\nconst SettingsPage = lazySettings(\"SettingsPage\");\n\nexport const connectRouteComponents: ConnectRouteComponents = {\n root: () => (\n <Suspense name=\"RouteRoot\" fallback={<LoadingShell Fallback={EmptyView} />}>\n <Root />\n </Suspense>\n ),\n app: () => <AppLayout />,\n content: () => (\n <Suspense name=\"Drive\">\n <Content />\n </Suspense>\n ),\n notFound: NotFoundPage,\n drivePending: DrivePending,\n driveNotFound: DriveNotFoundPage,\n error: RouteError,\n settings: () => (\n <Suspense name=\"Settings\">\n <SettingsPage />\n </Suspense>\n ),\n settingsTabs: {\n ...(connectConfig.aiAssistantEnabled && {\n \"ai-assistant\": lazySettings(\"AiAssistant\"),\n }),\n \"package-manager\": lazySettings(\"ConnectPackageManager\"),\n \"default-editors\": lazySettings(\"DefaultEditor\"),\n \"danger-zone\": lazySettings(\"DangerZone\"),\n about: lazySettings(\"About\"),\n },\n};\n\nlet connectRouter: ReturnType<typeof createConnectRouter> | undefined;\nlet routerStore: PHStore | undefined;\nlet unbindConnectRouter: (() => void) | undefined;\n\n// HMR re-runs this module: the replaced router must stop writing the selection.\nimport.meta.hot?.dispose(() => unbindConnectRouter?.());\n\n// One router per app; its context is the app's PH store. It becomes the PH\n// navigator as it is created, so selection setters navigate from the start.\nfunction getConnectRouterFor(store: PHStore) {\n if (connectRouter) {\n if (import.meta.env.DEV && store !== routerStore) {\n throw new Error(\"Connect's router is already bound to another PH store\");\n }\n return connectRouter;\n }\n routerStore = store;\n connectRouter = createConnectRouter({\n store,\n arrivals: createDriveArrivals(store),\n components: connectRouteComponents,\n basepath: connectConfig.routerBasename,\n InnerWrap: RouterChrome,\n appName: getRuntimeConfig().connect.branding?.appName,\n });\n unbindConnectRouter = bindConnectRouter(connectRouter, store);\n return connectRouter;\n}\n\n/** The app's router, e.g. for tracing. */\nexport function getConnectRouter() {\n return getConnectRouterFor(ensurePHStore()).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 } = getConnectRouterFor(store);\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":["Router"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAgB,OAAO;CACrB,2BAA2B,IAAI;CAC/B,OACE,oBAAC,OAAD;EAAK,WAAU;EACb,UAAA,oBAAC,UAAD;GAAU,MAAK;GACb,UAAA,oBAAC,QAAD,CAAS,CAAA;EACD,CAAA;CACP,CAAA;AAET;;;ACLA,SAAgB,aAAa,OAAc;CACzC,MAAM,EAAE,oBAAoB,iBAAiB,KAAK,GAAG,iBAAiB;CACtE,MAAM,CAAC,aAAa,kBAAkB,SAAS,kBAAkB,CAAC;CAElE,gBAAgB;EACd,IAAI,kBAAkB,GAAG;EACzB,MAAM,QAAQ,iBAAiB,eAAe,IAAI,GAAG,cAAc;EACnE,aAAa,aAAa,KAAK;CACjC,GAAG,CAAC,cAAc,CAAC;CAEnB,IAAI,CAAC,aAAa,OAAO;CAEzB,IAAI,oBAAoB,OAAO,oBAAA,YAAA,EAAA,UAAG,mBAAqB,CAAA;CAEvD,OAAO,oBAAC,qBAAD,EAAqB,GAAI,aAAe,CAAA;AACjD;;;ACfA,MAAa,wBAAwB,UAAqC;CACxE,MAAM,EAAE,MAAM,MAAM,SAAS,YAAY;CACzC,MAAM,QAAQ,OAAO,UAAU,UAAU,SAAS,KAAK;CAEvD,IAAI,eAAe;CACnB,IAAI,eAAe;CAEnB,IAAI,OAAO;EACT,eAAe;EACf,eAAe;CACjB;CAGA,WACE,eACC,UAAU;EACT,MAAM,eAAe;EACrB,IAAI,SACF,KAAK;CAET,GACA,CAAC,GACD,CAAC,SAAS,IAAI,CAChB;CAGA,WACE,eACC,UAAU;EACT,MAAM,eAAe;EACrB,IAAI,SACF,KAAK;CAET,GACA,CAAC,GACD,CAAC,SAAS,IAAI,CAChB;AACF;;;AC3CA,MAA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ACvD,mBAAmB,aAAa,eAAe;EAC/C,eAAe,aAAa,YAAY;EACxC,OAAO,aAAa,OAAO;CAC7B;AACF;AAEA,IAAI;AACJ,IAAI;AACJ,IAAI;AAGJ,YAAY,KAAK,cAAc,sBAAsB,CAAC;AAItD,SAAS,oBAAoB,OAAgB;CAC3C,IAAI,eAAe;EACjB,IAAI,YAAY,IAAI,OAAO,UAAU,aACnC,MAAM,IAAI,MAAM,uDAAuD;EAEzE,OAAO;CACT;CACA,cAAc;CACd,gBAAgB,oBAAoB;EAClC;EACA,UAAU,oBAAoB,KAAK;EACnC,YAAY;EACZ,UAAU,cAAc;EACxB,WAAW;EACX,SAAS,iBAAiB,CAAC,CAAC,QAAQ,UAAU;CAChD,CAAC;CACD,sBAAsB,kBAAkB,eAAe,KAAK;CAC5D,OAAO;AACT;;AAGA,SAAgB,mBAAmB;CACjC,OAAO,oBAAoB,cAAc,CAAC,CAAC,CAAC;AAC9C;AAGA,MAAM,iBAAiB,YAAY,IAAI,MACnC,WACE,OAAO,oBAAkC,CAAC,MAAM,OAAO,EACrD,SAAS,EAAE,uBACb,EAAE,CACJ,IACA,KAAA;AAEJ,MAAaA,iBAAe;CAE1B,MAAM,EAAE,WAAW,oBADL,WAAW,KAAK,cAAc,CACA;CAC5C,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":"812a2f2f-9d99-5633-bd87-9a9de051a17e"}
|
|
1
|
+
{"version":3,"file":"router-Cxt7uaaL.js","sources":["../src/components/root.tsx","../src/components/editor-loader.tsx","../src/hooks/useUndoRedoShortcuts.ts","../src/components/document-upgrade-toast.tsx","../src/components/editors.tsx","../src/components/document-editor-container.tsx","../src/components/app-container.tsx","../src/components/if-plugin.tsx","../src/components/route-views.tsx","../src/pages/content.tsx","../src/components/not-found-page.tsx","../src/components/router.tsx"],"sourcesContent":["import { Outlet } from \"@tanstack/react-router\";\nimport { Suspense } from \"react\";\nimport { useReleasePrerenderedShell } from \"./prerendered-shell.js\";\n\n/** What every page shares; the sidebar is the `_app` layout's. */\nexport function Root() {\n useReleasePrerenderedShell(true);\n return (\n <div className=\"h-screen overflow-auto bg-background\">\n <Suspense name=\"Root\">\n <Outlet />\n </Suspense>\n </div>\n );\n}\n","import { DefaultEditorLoader } from \"@powerhousedao/design-system/connect\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { useEffect, useState } from \"react\";\n\ntype Props = ComponentProps<typeof DefaultEditorLoader> & {\n /** Delay before showing, so short loads show nothing; 0 shows at once. */\n loadingTimeout?: number;\n customEditorLoader?: ReactNode;\n};\nexport function EditorLoader(props: Props) {\n const { customEditorLoader, loadingTimeout = 200, ...defaultProps } = props;\n const [showLoading, setShowLoading] = useState(loadingTimeout <= 0);\n\n useEffect(() => {\n if (loadingTimeout <= 0) return;\n const timer = setTimeout(() => setShowLoading(true), loadingTimeout);\n return () => clearTimeout(timer);\n }, [loadingTimeout]);\n\n if (!showLoading) return null;\n\n if (customEditorLoader) return <>{customEditorLoader}</>;\n\n return <DefaultEditorLoader {...defaultProps} />;\n}\n","import { useHotkeys } from \"react-hotkeys-hook\";\n\nexport interface UseUndoRedoShortcutsProps {\n undo: () => void;\n redo: () => void;\n canUndo: boolean;\n canRedo: boolean;\n}\n\nexport const useUndoRedoShortcuts = (props: UseUndoRedoShortcutsProps) => {\n const { undo, redo, canRedo, canUndo } = props;\n const isMac = window.navigator.userAgent.includes(\"Mac\");\n\n let undoShortcut = \"ctrl+z\";\n let redoShortcut = \"ctrl+y\";\n\n if (isMac) {\n undoShortcut = \"mod+z\";\n redoShortcut = \"mod+shift+z\";\n }\n\n // set handler for undo\n useHotkeys(\n undoShortcut,\n (event) => {\n event.preventDefault();\n if (canUndo) {\n undo();\n }\n },\n {},\n [canUndo, undo],\n );\n\n // set handler for redo\n useHotkeys(\n redoShortcut,\n (event) => {\n event.preventDefault();\n if (canRedo) {\n redo();\n }\n },\n {},\n [canRedo, redo],\n );\n};\n","import { showPHModal } from \"@powerhousedao/reactor-browser\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const DocumentUpgradeToast = ({\n documentId,\n}: {\n documentId: string;\n}) => {\n const { t } = useTranslation();\n\n return (\n <div>\n <p className=\"font-medium\">\n {t(\"notifications.documentUpgradeAvailable\")}\n </p>\n <button\n onClick={() => {\n showPHModal({ type: \"confirmDocumentUpgrade\", documentId });\n }}\n className=\"underline decoration-solid underline-offset-2\"\n >\n {t(\"common.updateDocument\")}\n </button>\n </div>\n );\n};\n","import { EditorLoader } from \"./editor-loader.js\";\nimport { useUndoRedoShortcuts } from \"../hooks/useUndoRedoShortcuts.js\";\nimport { dismissToast, toast } from \"@powerhousedao/connect/services\";\nimport { Icon, PowerhouseButton } from \"@powerhousedao/design-system\";\nimport { RevisionHistory } from \"@powerhousedao/design-system/connect\";\nimport {\n getRevisionFromDate,\n openTarget,\n setRevisionHistoryVisible,\n useDocumentById,\n useDocumentModelModuleById,\n useDocumentOperations,\n useDocumentVersionStatus,\n useEditorModuleById,\n useFallbackEditorModule,\n useRevisionHistoryVisible,\n useSelectedTimelineItem,\n useVetraPackageManager,\n useVetraPackages,\n} from \"@powerhousedao/reactor-browser\";\nimport type { PHDocument } from \"@powerhousedao/shared/document-model\";\nimport { redo, undo } from \"@powerhousedao/shared/document-model\";\nimport { createElement, Suspense, useEffect, useMemo, useState } from \"react\";\nimport { CenteredErrorMessage, ErrorBoundary } from \"./error-boundary.js\";\nimport { DocumentUpgradeToast } from \"./document-upgrade-toast.js\";\n\ntype Props<TDocument extends PHDocument = PHDocument> = {\n document: TDocument;\n};\n\n// Card treatment mirrors DetailedFallback in error-boundary.tsx so editor\n// errors read the same as boundary errors, and stay legible in both themes\n// (bg-card/border-border/text-foreground tokens instead of bare text).\nfunction EditorError({\n title,\n children,\n}: {\n title: string;\n children: React.ReactNode;\n}) {\n return (\n <div className=\"flex size-full items-center justify-center p-6\">\n <div className=\"w-full max-w-lg rounded-lg border border-border bg-card p-6 text-foreground shadow-sm\">\n <div className=\"mb-3 flex items-center gap-2\">\n <Icon name=\"Error\" className=\"size-5 shrink-0 text-destructive\" />\n <h3 className=\"min-w-0 text-lg font-semibold wrap-break-word text-foreground\">\n {title}\n </h3>\n </div>\n <div className=\"wrap-break-word\">{children}</div>\n </div>\n </div>\n );\n}\n\n// Prefers \"global\" when the document carries it, otherwise falls back to\n// the first available scope.\nfunction defaultScope(scopes: string[]): string {\n return scopes.includes(\"global\") ? \"global\" : scopes[0];\n}\n\nfunction OpenPackageManagerButton() {\n return (\n <PowerhouseButton\n className=\"px-3 py-1.5 text-base font-medium\"\n onClick={() => {\n openTarget({ settings: \"package-manager\" });\n }}\n type=\"button\"\n >\n Open package manager\n </PowerhouseButton>\n );\n}\n\nexport const DocumentEditor: React.FC<Props> = (props) => {\n const { document: initialDocument } = props;\n const selectedTimelineItem = useSelectedTimelineItem();\n const revisionHistoryVisible = useRevisionHistoryVisible();\n const [document, dispatch] = useDocumentById(initialDocument.header.id);\n const documentId = document?.header.id ?? undefined;\n const documentName = document?.header.name ?? undefined;\n const documentType = document?.header.documentType ?? undefined;\n const preferredEditor = document?.header.meta?.preferredEditor ?? undefined;\n // The scopes a document carries operations for; every document has at\n // least \"global\".\n const scopes = useMemo(() => {\n const keys = Object.keys(document?.header.revision ?? {});\n return keys.length > 0 ? keys : [\"global\"];\n }, [document?.header.revision]);\n const [operationScope, setOperationScope] = useState(() =>\n defaultScope(scopes),\n );\n const selectedScope = scopes.includes(operationScope)\n ? operationScope\n : defaultScope(scopes);\n\n // The history panel's operations: one scope, fetched only while the panel\n // is open. The panel asks for further pages itself.\n const {\n operations: historyOperations,\n isLoading: isLoadingHistory,\n hasNextPage: historyHasNextPage,\n fetchNextPage: fetchNextHistoryPage,\n error: historyError,\n } = useDocumentOperations(documentId, selectedScope, {\n enabled: revisionHistoryVisible,\n // A page fetch costs the same for 100 or 500 rows in the in-browser\n // reactor, so fewer, bigger round trips are strictly cheaper.\n limit: 500,\n });\n\n // The timeline read-mode feature maps a selected date range to a global\n // revision, which needs the whole global history. Fetched only while a\n // timeline item is selected; shares the cache entry with the panel when\n // the panel is on \"global\".\n const {\n operations: globalOperations,\n hasNextPage: globalHasNextPage,\n isLoading: isLoadingGlobal,\n fetchNextPage: fetchNextGlobalPage,\n error: globalError,\n } = useDocumentOperations(documentId, \"global\", {\n enabled: !!selectedTimelineItem,\n // A page fetch costs the same for 100 or 500 rows in the in-browser\n // reactor, so fewer, bigger round trips are strictly cheaper.\n limit: 500,\n });\n useEffect(() => {\n // An error ends the walk; we answer from what loaded rather than\n // retrying forever.\n if (!globalHasNextPage || isLoadingGlobal || globalError) return;\n // Deferred: the cache's fetch and the render it triggers are both\n // synchronous, so calling fetchNextGlobalPage here directly would chain\n // fetch -> render -> effect -> fetch into one uninterrupted task;\n // setTimeout(0) yields between pages so the UI stays responsive.\n const handle = window.setTimeout(fetchNextGlobalPage, 0);\n return () => window.clearTimeout(handle);\n }, [globalHasNextPage, isLoadingGlobal, fetchNextGlobalPage, globalError]);\n\n const globalRevisionNumber = document?.header.revision.global ?? 0;\n const localRevisionNumber = document?.header.revision.local ?? 0;\n const documentModelModule = useDocumentModelModuleById(documentType);\n const preferredEditorModule = useEditorModuleById(preferredEditor);\n const fallbackEditorModule = useFallbackEditorModule(documentType);\n const editorModule = preferredEditorModule ?? fallbackEditorModule;\n const versionStatus = useDocumentVersionStatus(document ?? undefined);\n const versionStatusKind = versionStatus?.kind;\n const upgradeAvailable =\n versionStatus?.kind === \"upgrade-available\" && versionStatus.canUpgrade;\n useEffect(() => {\n if (upgradeAvailable && documentId) {\n toast(createElement(DocumentUpgradeToast, { documentId }), {\n type: \"connect-warning\",\n toastId: `outdated-document-${documentId}`,\n autoClose: false,\n });\n } else if (\n versionStatusKind &&\n versionStatusKind !== \"upgrade-available\" &&\n documentId\n ) {\n dismissToast(`outdated-document-${documentId}`);\n }\n }, [upgradeAvailable, versionStatusKind, documentId]);\n const vetraPackages = useVetraPackages();\n const packageManager = useVetraPackageManager();\n const owningPackageName = editorModule\n ? vetraPackages.find((pkg) => pkg.editors.includes(editorModule))?.manifest\n .name\n : undefined;\n const owningPackageVersion =\n owningPackageName && packageManager\n ? packageManager.getPackageVersion(owningPackageName)\n : undefined;\n const editorBundleKey = owningPackageName\n ? `${owningPackageName}@${owningPackageVersion ?? \"unknown\"}`\n : (editorModule?.config.id ?? \"no-editor\");\n const isLoadingDocument = !document;\n const isLoadingEditor =\n editorModule &&\n documentType &&\n !editorModule.documentTypes.includes(documentType) &&\n !editorModule.documentTypes.includes(\"*\");\n\n const canUndo = globalRevisionNumber > 0 || localRevisionNumber > 0;\n const canRedo = !!document?.clipboard.length;\n const addUndoAction = () => dispatch(undo());\n const addRedoAction = () => dispatch(redo());\n useUndoRedoShortcuts({\n undo: addUndoAction,\n redo: addRedoAction,\n canUndo,\n canRedo,\n });\n\n useEffect(() => {\n return () => {\n window.documentEditorDebugTools?.clear();\n };\n }, []);\n\n const [editorError, setEditorError] = useState<\n | {\n error: any;\n info: React.ErrorInfo;\n documentId?: string;\n // clear: () => void;\n }\n | undefined\n >(undefined);\n\n useEffect(() => {\n if (editorError && editorError.documentId !== documentId) {\n // eslint-disable-next-line react-hooks-extra/set-state-in-effect\n setEditorError(undefined);\n }\n }, [editorError, documentId]);\n\n const handleEditorError = (error: Error, info: React.ErrorInfo) => {\n setEditorError({\n error,\n documentId,\n info,\n });\n };\n\n if (isLoadingEditor) {\n return <EditorLoader message=\"Loading editor\" />;\n }\n\n if (isLoadingDocument) {\n return <EditorLoader message=\"Loading document\" />;\n }\n\n if (!documentModelModule) {\n return (\n <EditorError title=\"Document type not supported\">\n <p className=\"mb-4 text-sm text-foreground\">\n This document can't be opened because the \"{documentType}\" document\n model isn't installed. Install the package that provides it to open\n the document.\n </p>\n <OpenPackageManagerButton />\n </EditorError>\n );\n }\n\n if (versionStatus?.kind === \"unsupported\") {\n return (\n <EditorError title=\"Document version not supported\">\n <p className=\"mb-4 text-sm text-foreground\">\n This document requires version {versionStatus.documentVersion} of the\n \"{documentType}\" document model, but only version\n {versionStatus.availableVersions.length > 1 ? \"s\" : \"\"}{\" \"}\n {versionStatus.availableVersions.join(\", \")}{\" \"}\n {versionStatus.availableVersions.length > 1 ? \"are\" : \"is\"} installed.\n Update the package that provides \"{documentType}\" to open it.\n </p>\n <OpenPackageManagerButton />\n </EditorError>\n );\n }\n\n if (!editorModule) {\n return (\n <EditorError title=\"No editor available\">\n <p className=\"mb-4 text-sm text-foreground\">\n The \"{documentType}\" document model is installed, but no editor for it\n was found. Install a package that provides an editor for this document\n type.\n </p>\n <OpenPackageManagerButton />\n </EditorError>\n );\n }\n const EditorComponent = editorModule.Component;\n\n return (\n <div\n className=\"relative h-full\"\n id=\"document-editor-context\"\n data-editor={editorModule.config.id}\n data-document-type={documentType}\n >\n {revisionHistoryVisible ? (\n <RevisionHistory\n key={documentId}\n documentTitle={documentName ?? \"\"}\n documentId={documentId ?? \"\"}\n operations={historyOperations}\n isLoading={isLoadingHistory}\n hasNextPage={historyHasNextPage}\n onLoadNextPage={fetchNextHistoryPage}\n error={historyError}\n scopes={scopes}\n scope={selectedScope}\n onScopeChange={setOperationScope}\n onClose={() => setRevisionHistoryVisible(false)}\n documentState={document.state}\n onCopyState={() => {\n toast(\"Copied document state to clipboard\", { type: \"success\" });\n }}\n onCopyDocId={() => {\n toast(\"Copied document ID to clipboard\", { type: \"success\" });\n }}\n />\n ) : (\n <Suspense\n fallback={<EditorLoader message=\"Loading editor\" />}\n name=\"EditorLoader\"\n >\n <ErrorBoundary\n fallbackRender={CenteredErrorMessage}\n resetKeys={[documentId]}\n onError={handleEditorError}\n loggerContext={[\"Connect\", \"DocumentEditor\"]}\n >\n {!editorError?.error && (\n <EditorComponent\n key={`${editorBundleKey}:${documentId}`}\n context={{\n readMode: !!selectedTimelineItem,\n // Until the whole global history has paged in, the date lookup\n // cannot be answered; undefined leaves the editor on the latest\n // state in read mode instead of jumping to revision 0. A failed\n // page ends the walk, so we answer from what loaded rather than\n // waiting on a page that will never arrive.\n selectedTimelineRevision:\n (isLoadingGlobal || globalHasNextPage) && !globalError\n ? undefined\n : getRevisionFromDate(\n selectedTimelineItem?.startDate,\n selectedTimelineItem?.endDate,\n globalOperations,\n ),\n }}\n documentId={document.header.id}\n />\n )}\n </ErrorBoundary>\n </Suspense>\n )}\n </div>\n );\n};\n","import { DocumentEditor } from \"./editors.js\";\nimport {\n setSelectedNode,\n useNodeParentFolderById,\n useSelectedDocument,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function DocumentEditorContainer() {\n const [selectedDocument] = useSelectedDocument();\n const parentFolder = useNodeParentFolderById(selectedDocument.header.id);\n\n // TODO: unused\n const _onOpenSwitchboardLink = useMemo(() => {\n return async () => {\n //\n };\n }, []);\n\n const _onClose = useCallback(() => {\n setSelectedNode(parentFolder);\n }, [parentFolder]);\n\n return (\n <div\n id=\"document-editor-container\"\n className=\"flex-1\"\n data-document-type={selectedDocument.header.documentType}\n >\n <DocumentEditor document={selectedDocument} />\n </div>\n );\n}\n","import { DropZoneWrapper } from \"@powerhousedao/design-system/connect\";\nimport { GenericDriveExplorer } from \"@powerhousedao/powerhouse-vetra-packages/editors\";\nimport {\n useAppModuleById,\n useDefaultAppModule,\n useSelectedDocumentId,\n useSelectedDriveSafe,\n} from \"@powerhousedao/reactor-browser\";\nimport { Suspense } from \"react\";\nimport { DocumentEditorContainer } from \"./document-editor-container.js\";\nimport { EditorLoader } from \"./editor-loader.js\";\nimport { ErrorBoundary } from \"./error-boundary.js\";\n\nexport function AppContainer() {\n const [selectedDrive] = useSelectedDriveSafe();\n const selectedDocumentId = useSelectedDocumentId();\n\n const app = useAppModuleById(selectedDrive?.header.meta?.preferredEditor);\n const defaultApp = useDefaultAppModule();\n\n if (!selectedDrive) {\n return <EditorLoader />;\n }\n\n const AppComponent =\n app?.Component ?? defaultApp?.Component ?? GenericDriveExplorer.Component;\n\n if (!AppComponent) {\n throw new Error(\"No app component found\");\n }\n return (\n <ErrorBoundary\n variant=\"detailed\"\n resetKeys={[selectedDrive.header.id]}\n loggerContext={[\"Connect\", \"App\"]}\n >\n <Suspense fallback={<EditorLoader />}>\n <DropZoneWrapper className=\"flex h-full flex-col overflow-auto\">\n <AppComponent>\n {selectedDocumentId ? <DocumentEditorContainer /> : null}\n </AppComponent>\n </DropZoneWrapper>\n </Suspense>\n </ErrorBoundary>\n );\n}\n","import type { ReactNode } from \"react\";\nimport { useIsPluginActive } from \"../hooks/usePluginComposition.js\";\n\n/**\n * Renders its children only when a plugin is present in the served\n * composition — the runtime gate for generic-chrome deletability (rewire R3).\n *\n * This is the demonstration step ahead of extracting the generic components\n * into their own package: it makes \"remove the generic plugin → the chrome is\n * gone\" true at render time while the code still lives in the Connect app.\n * When those components move to `@powerhousedao/connect-generic`, this gate\n * becomes the seam where the package is dynamically imported (or not) instead\n * of merely not rendered.\n *\n * Presence is activation, classic-preserving: with no declared composition,\n * every plugin reads active, so the chrome renders unchanged.\n */\nexport function IfPlugin(props: {\n module: string;\n children: ReactNode;\n /** Rendered when the plugin is absent from a declared composition. */\n fallback?: ReactNode;\n}): ReactNode {\n const active = useIsPluginActive(props.module);\n return active ? props.children : (props.fallback ?? null);\n}\n","import { DefaultEditorLoader } from \"@powerhousedao/design-system/connect\";\nimport type { ErrorComponentProps } from \"@tanstack/react-router\";\nimport { useMatch, useRouter, useRouterState } from \"@tanstack/react-router\";\nimport type { PropsWithChildren } from \"react\";\nimport { useEffect, useState } from \"react\";\nimport { HOME_ROUTE_ID } from \"../router/route-tree.js\";\nimport AppSkeleton from \"./app-skeleton.js\";\nimport { CenteredErrorMessage } from \"./error-boundary.js\";\nimport { LoadingShell } from \"./prerendered-shell.js\";\n\n// Loads quicker than this show no progress bar.\nconst PROGRESS_DELAY_MS = 150;\n\n/** True until the router has resolved its first location. */\nexport function useIsColdStart() {\n return useRouterState({ select: (state) => !state.resolvedLocation });\n}\n\n/** Whether the content shows home: a cold deep link shows the pending view. */\nexport function useShowsHomeScreen(hasSelection: boolean) {\n const isColdStart = useIsColdStart();\n const isHomeRoute = !!useMatch({ from: HOME_ROUTE_ID, shouldThrow: false });\n return !hasSelection && (isHomeRoute || !isColdStart);\n}\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\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","import { AppContainer } from \"../components/app-container.js\";\nimport { DriveIcon } from \"../components/drive-icon.js\";\nimport { IfPlugin } from \"../components/if-plugin.js\";\nimport {\n defaultPHAppConfig,\n defaultPHDocumentEditorConfig,\n} from \"@powerhousedao/connect/config\";\nimport {\n DriveAuthGate,\n HomeScreen,\n HomeScreenAddDriveItem,\n HomeScreenItem,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n logout,\n makeDriveSlug,\n preloadDrive,\n setPHAppConfig,\n setPHDocumentEditorConfig,\n setSelectedDrive,\n useAppModuleById,\n useIsAddDriveEnabled,\n useLinkProps,\n useSelectedDocumentId,\n useSelectedDriveSafe,\n useSelectedFolder,\n getDriveName,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport { Outlet } from \"@tanstack/react-router\";\nimport { useEffect } from \"react\";\nimport { getRuntimeConfig } from \"../runtime-config.js\";\nimport { CONTENT_VIEW_ID } from \"../router/connect-router.js\";\nimport { useShowsHomeScreen } from \"../components/route-views.js\";\nimport {\n useDriveAuthGate,\n useVisibleDrives,\n} from \"../components/use-drive-auth-gate.js\";\nimport { useOpenRenownLogin } from \"../hooks/use-renown-login.js\";\n\nexport function Content() {\n const { gate, dismiss } = useDriveAuthGate();\n const openLogin = useOpenRenownLogin();\n const [selectedDrive] = useSelectedDriveSafe();\n const selectedFolder = useSelectedFolder();\n const selectedDocumentId = useSelectedDocumentId();\n\n useEffect(() => {\n if (!selectedDocumentId) {\n setPHDocumentEditorConfig(defaultPHDocumentEditorConfig);\n }\n }, [selectedDocumentId]);\n\n useEffect(() => {\n if (!selectedDrive) {\n setPHAppConfig(defaultPHAppConfig);\n }\n }, [selectedDrive]);\n\n const hasSelection = !!(\n selectedDocumentId ||\n selectedDrive ||\n selectedFolder\n );\n const showHomeScreen = useShowsHomeScreen(hasSelection);\n return (\n <ContentContainer>\n <Outlet />\n {gate ? (\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 ) : showHomeScreen ? (\n // The home screen is generic-shell chrome (the drive-list landing +\n // add-drive). R3 gate: only when the generic plugin is composed in.\n // Absent → no generic landing (a headless/custom shell renders its own\n // or routes straight to a drive). Classic (no composition) = active.\n <IfPlugin module=\"@powerhousedao/connect/plugins/generic\">\n <HomeScreenContainer />\n </IfPlugin>\n ) : hasSelection ? (\n <AppContainer />\n ) : null}\n </ContentContainer>\n );\n}\n\nfunction ContentContainer({ children }: { children: React.ReactNode }) {\n return (\n <div\n className=\"flex h-full flex-col overflow-auto\"\n id={CONTENT_VIEW_ID}\n data-scroll-restoration-id={CONTENT_VIEW_ID}\n >\n {children}\n </div>\n );\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\nfunction HomeScreenContainer() {\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","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-foreground\">\n {driveSlug ? `Drive ${driveSlug} not found` : \"Page not found\"}\n </h1>\n <p className=\"text-muted-foreground\">\n Nothing is at{\" \"}\n <code data-testid=\"not-found-path\" className=\"text-foreground\">\n {pathname}\n </code>\n .\n </p>\n <a {...home} className=\"text-foreground 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 { Root } from \"./root.js\";\nimport { connectConfig } from \"@powerhousedao/connect/config\";\nimport { Content } from \"../pages/content.js\";\nimport type { PHStore } from \"@powerhousedao/reactor-browser\";\nimport {\n createDriveArrivals,\n ensurePHStore,\n usePHStore,\n} from \"@powerhousedao/reactor-browser\";\nimport { RouterProvider } from \"@tanstack/react-router\";\nimport { lazy, Suspense } from \"react\";\nimport { getRuntimeConfig } from \"../runtime-config.js\";\nimport type { ConnectRouteComponents } from \"../router/route-components.js\";\nimport type * as SettingsModule from \"./settings/index.js\";\nimport { AppLayout } from \"./app-layout.js\";\nimport { LoadingShell } from \"./prerendered-shell.js\";\nimport {\n bindConnectRouter,\n createConnectRouter,\n} from \"../router/connect-router.js\";\nimport { DriveNotFoundPage, NotFoundPage } from \"./not-found-page.js\";\nimport { DrivePending, RouteError, RouterChrome } from \"./route-views.js\";\n\nconst EmptyView = () => null;\n\nconst settingsModule = () => import(\"./settings/index.js\");\nconst lazySettings = (name: keyof typeof SettingsModule) =>\n lazy(() => settingsModule().then((m) => ({ default: m[name] })));\nconst SettingsPage = lazySettings(\"SettingsPage\");\n\nexport const connectRouteComponents: ConnectRouteComponents = {\n root: () => (\n <Suspense name=\"RouteRoot\" fallback={<LoadingShell Fallback={EmptyView} />}>\n <Root />\n </Suspense>\n ),\n app: () => <AppLayout />,\n content: () => (\n <Suspense name=\"Drive\">\n <Content />\n </Suspense>\n ),\n notFound: NotFoundPage,\n drivePending: DrivePending,\n driveNotFound: DriveNotFoundPage,\n error: RouteError,\n settings: () => (\n <Suspense name=\"Settings\">\n <SettingsPage />\n </Suspense>\n ),\n settingsTabs: {\n ...(connectConfig.aiAssistantEnabled && {\n \"ai-assistant\": lazySettings(\"AiAssistant\"),\n }),\n \"package-manager\": lazySettings(\"ConnectPackageManager\"),\n \"default-editors\": lazySettings(\"DefaultEditor\"),\n \"danger-zone\": lazySettings(\"DangerZone\"),\n about: lazySettings(\"About\"),\n },\n};\n\nlet connectRouter: ReturnType<typeof createConnectRouter> | undefined;\nlet routerStore: PHStore | undefined;\nlet unbindConnectRouter: (() => void) | undefined;\n\n// HMR re-runs this module: the replaced router must stop writing the selection.\nimport.meta.hot?.dispose(() => unbindConnectRouter?.());\n\n// One router per app; its context is the app's PH store. It becomes the PH\n// navigator as it is created, so selection setters navigate from the start.\nfunction getConnectRouterFor(store: PHStore) {\n if (connectRouter) {\n if (import.meta.env.DEV && store !== routerStore) {\n throw new Error(\"Connect's router is already bound to another PH store\");\n }\n return connectRouter;\n }\n routerStore = store;\n connectRouter = createConnectRouter({\n store,\n arrivals: createDriveArrivals(store),\n components: connectRouteComponents,\n basepath: connectConfig.routerBasename,\n InnerWrap: RouterChrome,\n appName: getRuntimeConfig().connect.branding?.appName,\n });\n unbindConnectRouter = bindConnectRouter(connectRouter, store);\n return connectRouter;\n}\n\n/** The app's router, e.g. for tracing. */\nexport function getConnectRouter() {\n return getConnectRouterFor(ensurePHStore()).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 } = getConnectRouterFor(store);\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":["Router"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAgB,OAAO;CACrB,2BAA2B,IAAI;CAC/B,OACE,oBAAC,OAAD;EAAK,WAAU;EACb,UAAA,oBAAC,UAAD;GAAU,MAAK;GACb,UAAA,oBAAC,QAAD,CAAS,CAAA;EACD,CAAA;CACP,CAAA;AAET;;;ACLA,SAAgB,aAAa,OAAc;CACzC,MAAM,EAAE,oBAAoB,iBAAiB,KAAK,GAAG,iBAAiB;CACtE,MAAM,CAAC,aAAa,kBAAkB,SAAS,kBAAkB,CAAC;CAElE,gBAAgB;EACd,IAAI,kBAAkB,GAAG;EACzB,MAAM,QAAQ,iBAAiB,eAAe,IAAI,GAAG,cAAc;EACnE,aAAa,aAAa,KAAK;CACjC,GAAG,CAAC,cAAc,CAAC;CAEnB,IAAI,CAAC,aAAa,OAAO;CAEzB,IAAI,oBAAoB,OAAO,oBAAA,YAAA,EAAA,UAAG,mBAAqB,CAAA;CAEvD,OAAO,oBAAC,qBAAD,EAAqB,GAAI,aAAe,CAAA;AACjD;;;ACfA,MAAa,wBAAwB,UAAqC;CACxE,MAAM,EAAE,M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,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":"ffb62207-50e4-55cc-a2b9-0f63ae9ffcc1"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
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]="823075db-85bb-56a8-bcd1-fb07ac11b140")}catch(e){}}();
|
|
3
3
|
import { c as useSettingsTabs, s as useForgetSettingsOpenedFrom } from "./settings-CjvK8OKA.js";
|
|
4
4
|
import { r as connectConfig } from "./connect.config-uZF-gnvV.js";
|
|
5
5
|
import { r as toast } from "./toast-C6WW-_O-.js";
|
|
6
|
-
import { n as getGitSha, o as shortGitSha, r as getGitUrl } from "./build-info-
|
|
6
|
+
import { n as getGitSha, o as shortGitSha, r as getGitUrl } from "./build-info-D89jTqV-.js";
|
|
7
7
|
import { t as useRegistryPackages } from "./useRegistryPackages-BqIWwXV-.js";
|
|
8
8
|
import { Suspense, useCallback, useMemo, useState } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -19,7 +19,7 @@ import { getAiSettings, isAiConfigured, updateAiSettings } from "@powerhousedao/
|
|
|
19
19
|
var package_default = {
|
|
20
20
|
name: "@powerhousedao/connect",
|
|
21
21
|
productName: "Powerhouse-Connect",
|
|
22
|
-
version: "6.2.3-dev.
|
|
22
|
+
version: "6.2.3-dev.65",
|
|
23
23
|
description: "Powerhouse Connect",
|
|
24
24
|
main: "dist/index.html",
|
|
25
25
|
type: "module",
|
|
@@ -612,5 +612,5 @@ function SettingsPage() {
|
|
|
612
612
|
//#endregion
|
|
613
613
|
export { About, AiAssistant, ConnectPackageManager, DangerZone, DefaultEditor, SettingsPage };
|
|
614
614
|
|
|
615
|
-
//# sourceMappingURL=settings-
|
|
616
|
-
//# debugId=
|
|
615
|
+
//# sourceMappingURL=settings-D7lXsfBl.js.map
|
|
616
|
+
//# debugId=823075db-85bb-56a8-bcd1-fb07ac11b140
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-CMQpb0hN.js","sources":["../package.json","../src/components/settings/about.tsx","../src/components/settings/ai-assistant.tsx","../src/components/settings/danger-zone.tsx","../src/components/settings/default-editor.tsx","../src/components/settings/package-manager.tsx","../src/components/settings/settings-page.tsx"],"sourcesContent":["","import { connectConfig } from \"@powerhousedao/connect/config\";\nimport {\n getGitSha,\n getGitUrl,\n packageJson,\n shortGitSha,\n} from \"@powerhousedao/connect/utils\";\nimport { Icon } from \"@powerhousedao/design-system\";\nimport { About as BaseAbout } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n DriveCollectionId,\n showPHModal,\n useDrives,\n useDriveSystemInfo,\n useSyncList,\n getDriveName,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport { useMemo } from \"react\";\n\nexport const About: React.FC = () => {\n const onOpenInspector = () => {\n closePHModal();\n showPHModal({ type: \"inspector\" });\n };\n\n return (\n <div>\n <BaseAbout\n packageJson={packageJson}\n phCliVersion={\n typeof connectConfig.phCliVersion === \"string\"\n ? connectConfig.phCliVersion\n : undefined\n }\n />\n <AppGitHash />\n <ConnectedDrives />\n <div className=\"bg-background p-3\">\n <h2 className=\"mb-2 font-semibold text-foreground\">Inspector</h2>\n <p className=\"mb-3 text-sm font-normal text-foreground\">\n Explore the local database and sync state for debugging.\n </p>\n <button\n className=\"flex items-center gap-x-2 rounded-md border border-border bg-transparent px-3 py-1 text-sm font-medium text-foreground transition-colors hover:hover-effect\"\n onClick={onOpenInspector}\n type=\"button\"\n >\n Open Inspector <Icon name=\"CircleInfo\" size={16} />\n </button>\n </div>\n </div>\n );\n};\n\nfunction AppGitHash() {\n const sha = getGitSha();\n if (sha === \"unknown\") return null;\n const url = getGitUrl();\n const label = shortGitSha(sha);\n return (\n <div className=\"bg-background p-3 text-sm\">\n <span className=\"font-semibold\">Git hash: </span>\n {url ? (\n <a\n className=\"font-mono underline\"\n href={url}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n title={sha}\n >\n {label}\n </a>\n ) : (\n <span className=\"font-mono\" title={sha}>\n {label}\n </span>\n )}\n </div>\n );\n}\n\nfunction ConnectedDrives() {\n const drives = useDrives() ?? [];\n const remotes = useSyncList();\n\n const remoteDrives = useMemo(\n () =>\n drives.filter((d) =>\n remotes.some((r) =>\n r.meta.collectionId.equals(DriveCollectionId.forDrive(d.header.id)),\n ),\n ),\n [drives, remotes],\n );\n\n return (\n <div className=\"my-4 bg-background p-3\">\n <h2 className=\"mb-2 font-semibold text-foreground\">Connected drives</h2>\n {remoteDrives.length === 0 ? (\n <p className=\"text-sm font-normal text-foreground\">\n No connected remote drives.\n </p>\n ) : (\n <ul className=\"flex flex-col gap-3\">\n {remoteDrives.map((drive) => (\n <DriveAboutEntry key={drive.header.id} drive={drive} />\n ))}\n </ul>\n )}\n </div>\n );\n}\n\nfunction DriveAboutEntry({ drive }: { drive: DocumentDriveDocument }) {\n const info = useDriveSystemInfo(drive);\n const name = getDriveName(drive);\n\n return (\n <li className=\"text-sm text-foreground\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"font-medium\">{name}</span>\n {info.status === \"ready\" && (\n <span className=\"text-xs text-muted-foreground\">{info.host}</span>\n )}\n </div>\n {info.status === \"loading\" && (\n <div className=\"mt-1 text-xs text-muted-foreground\">Loading…</div>\n )}\n {info.status === \"error\" && (\n <div className=\"mt-1 text-xs text-destructive\">\n Could not load system info\n </div>\n )}\n {info.status === \"ready\" && (\n <div className=\"mt-1 text-xs text-foreground\">\n <div>\n <span className=\"font-medium\">Version:</span> {info.version}\n </div>\n <div>\n <span className=\"font-medium\">Git hash: </span>\n {info.gitUrl ? (\n <a\n className=\"font-mono hover:underline\"\n href={info.gitUrl}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n title={info.gitHash}\n >\n {shortGitSha(info.gitHash)}\n </a>\n ) : (\n <span className=\"font-mono\" title={info.gitHash}>\n {shortGitSha(info.gitHash)}\n </span>\n )}\n </div>\n </div>\n )}\n {info.status === \"local\" && (\n <div className=\"mt-1 text-xs text-muted-foreground\">\n Local drive — N/A\n </div>\n )}\n </li>\n );\n}\n","import {\n getAiSettings,\n isAiConfigured,\n updateAiSettings,\n type AiSettings,\n} from \"@powerhousedao/reactor-browser/ai\";\nimport { Bot } from \"lucide-react\";\nimport { useState } from \"react\";\n\ntype TestState =\n | { status: \"idle\" }\n | { status: \"testing\" }\n | { status: \"ok\"; message: string }\n | { status: \"error\"; message: string };\n\nconst FIELD_CLASS =\n \"w-full rounded-md border border-border bg-background p-2.5 text-sm text-foreground outline-none placeholder:text-muted-foreground\";\n\n/**\n * Settings-modal section for the in-browser AI assistant: the user master\n * toggle, the OpenAI-compatible endpoint configuration, and a\n * save-and-test-connection action. Only mounted when the deployment\n * enables the feature (`connect.ai.assistantEnabled`).\n */\nexport const AiAssistant: React.FC = () => {\n const [draft, setDraft] = useState<AiSettings>(() => getAiSettings());\n const [test, setTest] = useState<TestState>({ status: \"idle\" });\n\n const patch = (value: Partial<AiSettings>) =>\n setDraft((d) => ({ ...d, ...value }));\n\n const saveAndTest = async () => {\n updateAiSettings(draft);\n if (!isAiConfigured(draft)) {\n setTest({\n status: \"error\",\n message: \"Base URL, API key and model are all required.\",\n });\n return;\n }\n setTest({ status: \"testing\" });\n try {\n const base = draft.baseUrl.trim().replace(/\\/+$/, \"\");\n const res = await fetch(`${base}/models`, {\n headers: draft.apiKey.trim()\n ? { Authorization: `Bearer ${draft.apiKey.trim()}` }\n : undefined,\n });\n if (!res.ok) {\n throw new Error(\n `HTTP ${res.status}${res.statusText ? ` ${res.statusText}` : \"\"}`,\n );\n }\n const data: unknown = await res.json();\n const list = (data as { data?: unknown[] } | null)?.data;\n const count = Array.isArray(list) ? list.length : 0;\n setTest({\n status: \"ok\",\n message: count\n ? `Connected — ${count} model(s) available.`\n : \"Connected.\",\n });\n } catch (error) {\n setTest({\n status: \"error\",\n message: `Connection failed: ${\n error instanceof Error ? error.message : String(error)\n }`,\n });\n }\n };\n\n return (\n <div className=\"space-y-4 p-1\">\n <div>\n <h3 className=\"flex items-center gap-2 text-sm font-semibold text-foreground\">\n <Bot size={16} /> AI Assistant\n </h3>\n <p className=\"mt-1 text-xs text-muted-foreground\">\n An in-page assistant that creates and changes documents, manages\n drives, and inspects read models through an OpenAI-compatible\n endpoint.\n </p>\n </div>\n\n <label className=\"flex items-center gap-2 text-sm text-foreground\">\n <input\n type=\"checkbox\"\n checked={draft.enabled}\n onChange={(event) => {\n patch({ enabled: event.target.checked });\n // The switch acts immediately: the FAB mounts/unmounts at once.\n updateAiSettings({ enabled: event.target.checked });\n }}\n />\n Enable AI assistant\n </label>\n\n {draft.enabled && (\n <div className=\"space-y-2 rounded-lg border border-border p-3\">\n <div className=\"mb-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase\">\n Endpoint\n </div>\n <input\n type=\"url\"\n placeholder=\"Base URL (e.g. https://api.openai.com/v1)\"\n value={draft.baseUrl}\n onChange={(e) => patch({ baseUrl: e.target.value })}\n className={FIELD_CLASS}\n spellCheck={false}\n />\n <input\n type=\"password\"\n placeholder=\"API key\"\n value={draft.apiKey}\n onChange={(e) => patch({ apiKey: e.target.value })}\n className={FIELD_CLASS}\n autoComplete=\"off\"\n spellCheck={false}\n />\n <input\n type=\"text\"\n placeholder=\"Model (e.g. gpt-4o-mini)\"\n value={draft.model}\n onChange={(e) => patch({ model: e.target.value })}\n className={FIELD_CLASS}\n spellCheck={false}\n />\n <label className=\"flex items-center gap-2 pt-1 text-sm text-foreground\">\n <input\n type=\"checkbox\"\n checked={draft.autoApproveWrites}\n onChange={(event) =>\n patch({ autoApproveWrites: event.target.checked })\n }\n />\n Auto-approve write actions\n </label>\n <p className=\"text-xs text-muted-foreground\">\n Requests go directly from this browser to the endpoint; the API key\n is never sent to Powerhouse servers. The endpoint must allow\n cross-origin (CORS) requests from this site.\n </p>\n <div className=\"flex items-center gap-3 pt-1\">\n <button\n type=\"button\"\n onClick={() => void saveAndTest()}\n disabled={test.status === \"testing\"}\n className=\"rounded-md bg-primary px-3 py-1.5 text-sm font-semibold text-primary-foreground hover:bg-primary/90 disabled:disabled-effect\"\n >\n {test.status === \"testing\"\n ? \"Testing…\"\n : \"Save & test connection\"}\n </button>\n {test.status === \"ok\" && (\n <span className=\"text-xs text-foreground\">{test.message}</span>\n )}\n {test.status === \"error\" && (\n <span className=\"text-xs text-destructive\">{test.message}</span>\n )}\n </div>\n </div>\n )}\n </div>\n );\n};\n","import { DangerZone as BaseDangerZone } from \"@powerhousedao/design-system/connect\";\nimport {\n deleteDrive,\n showPHModal,\n useDrives,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport { useForgetSettingsOpenedFrom } from \"../../router/settings.js\";\n\nexport const DangerZone: React.FC = () => {\n const drives = useDrives();\n const forgetOpenedFrom = useForgetSettingsOpenedFrom();\n\n const handleDeleteDrive = async (drive: DocumentDriveDocument) => {\n // Settings selects no drive; deselecting would navigate home.\n await deleteDrive(drive.header.id);\n // Settings may have been opened from the deleted drive.\n await forgetOpenedFrom();\n };\n\n const handleClearStorage = () => {\n showPHModal({ type: \"clearStorage\" });\n };\n\n return (\n <BaseDangerZone\n drives={drives ?? []}\n onDeleteDrive={(drive) => {\n void handleDeleteDrive(drive);\n }}\n onClearStorage={handleClearStorage}\n />\n );\n};\n","import { DefaultEditor as BaseDefaultEditor } from \"@powerhousedao/design-system/connect\";\nimport { useCallback, useState } from \"react\";\n\nconst documentModelEditorOptions = [\n { label: \"V1\", value: \"document-model-editor\" },\n { label: \"V2\", value: \"document-model-editor-v2\" },\n] as const;\n\nexport const DefaultEditor: React.FC = () => {\n const [documentModelEditor, setDocumentModelEditor] = useState<\n (typeof documentModelEditorOptions)[number]\n >(documentModelEditorOptions[1]);\n\n const handleSetDocumentEditor = useCallback((value: string) => {\n const option = documentModelEditorOptions.find((dm) => dm.value == value);\n if (option) {\n setDocumentModelEditor(option);\n }\n }, []);\n\n return (\n <BaseDefaultEditor\n documentModelEditor={documentModelEditor.value}\n setDocumentModelEditor={handleSetDocumentEditor}\n documentModelEditorOptions={\n documentModelEditorOptions as unknown as {\n value: string;\n label: string;\n }[]\n }\n />\n );\n};\n","import { useRegistryPackages } from \"../../hooks/useRegistryPackages.js\";\nimport { toast } from \"@powerhousedao/connect/services\";\nimport { PackageManager } from \"@powerhousedao/design-system/connect\";\nimport { useVetraPackageManager } from \"@powerhousedao/reactor-browser\";\nimport React from \"react\";\n\n/**\n * Split a `name@tag` spec into its bare package name. Mirrors the design-system's\n * `parsePackageSpec` — duplicated here to avoid reaching into a deep subpath\n * export. Scoped names split on the LAST `@`, unscoped on the first.\n */\nfunction parseBareName(spec: string): string {\n const trimmed = spec.trim();\n const at = trimmed.startsWith(\"@\")\n ? trimmed.lastIndexOf(\"@\")\n : trimmed.indexOf(\"@\");\n return at > 0 ? trimmed.slice(0, at) : trimmed;\n}\n\nexport const ConnectPackageManager: React.FC = () => {\n const packageManager = useVetraPackageManager();\n const {\n registryPackageList,\n installedPackages,\n availablePackages,\n availableHasMore,\n isLoadingAvailable,\n isLoadingMoreAvailable,\n availableError,\n ensureAvailableLoaded,\n ensureInstalledMetadataLoaded,\n fetchAvailablePage,\n loadMoreAvailable,\n setAvailableSearch,\n updateRegistryPackageStatus,\n registerFallbackRegistryPackage,\n } = useRegistryPackages();\n\n async function handleInstall(packageSpec: string) {\n if (!packageManager) return;\n\n // The spec may include an explicit `@tag` / `@version` suffix from the\n // search input. Pass it through to the package manager as-is (the CDN\n // route already handles `name@tag` specs), but track status under the\n // bare name so the Settings list doesn't fragment.\n const bareName = parseBareName(packageSpec);\n // Packages that were in `/packages` when the user clicked Install go\n // through `updateRegistryPackageStatus` and hit an existing entry.\n // Packages that landed via the npm-uplink fallback weren't in the list,\n // so we register them explicitly rather than silently upserting a\n // placeholder — keeping the \"does not exist\" error as a signal for any\n // other code path that reaches update without a matching entry.\n const wasKnownToRegistry = registryPackageList.some(\n (p) => p.name === bareName,\n );\n const result = await packageManager.addPackage(packageSpec);\n if (result.type === \"success\") {\n if (wasKnownToRegistry) {\n updateRegistryPackageStatus(bareName, \"registry-install\");\n } else {\n registerFallbackRegistryPackage(\n bareName,\n result.package,\n packageManager.getPackageVersion(bareName) ??\n packageManager.getPackageVersion(packageSpec),\n \"registry-install\",\n );\n }\n toast(`Package \"${packageSpec}\" installed successfully`, {\n type: \"connect-success\",\n });\n } else {\n const message = result.error.message;\n console.error(\n `[Connect][PackageManager] Install failed for \"${packageSpec}\":`,\n result.error,\n );\n // `BrowserPackageManager` raises a generic \"Failed to fetch dynamically\n // imported module\" when the registry CDN returns an error. That covers\n // both \"the name exists nowhere (not on this registry AND not on the\n // npmjs uplink)\" and \"the tarball is there but doesn't look like a\n // Powerhouse package\". Map to plain-language copy — never dump the raw\n // API / loader message into the toast.\n const isLikelyNotFound = /failed to fetch|404|not found/i.test(message);\n const userMessage = isLikelyNotFound\n ? `Couldn't install \"${packageSpec}\". It isn't available on this registry or via npm.`\n : `Couldn't install \"${packageSpec}\". Please try again.`;\n toast(userMessage, { type: \"error\" });\n }\n }\n\n function handleUninstall(packageName: string) {\n if (!packageManager) return;\n try {\n packageManager.removePackage(packageName);\n updateRegistryPackageStatus(packageName, \"available\");\n\n toast(`Package \"${packageName}\" uninstalled successfully`, {\n type: \"connect-success\",\n });\n } catch (error) {\n console.error(\n `[Connect][PackageManager] Uninstall failed for \"${packageName}\":`,\n error,\n );\n toast(`Couldn't uninstall \"${packageName}\". Please try again.`, {\n type: \"error\",\n });\n }\n }\n\n return (\n <div className=\"flex min-h-0 flex-1 flex-col\">\n <PackageManager\n mutable={true}\n installedPackages={installedPackages}\n availablePackages={availablePackages}\n isAvailableLoading={isLoadingAvailable}\n isLoadingMoreAvailable={isLoadingMoreAvailable}\n hasMoreAvailable={availableHasMore}\n onLoadMoreAvailable={loadMoreAvailable}\n availableError={availableError}\n onAvailableRetry={() => {\n void fetchAvailablePage({ reset: true });\n }}\n onAvailableSearchChange={setAvailableSearch}\n onAvailableTabOpen={ensureAvailableLoaded}\n onInstalledTabOpen={ensureInstalledMetadataLoaded}\n onInstall={handleInstall}\n onUninstall={handleUninstall}\n />\n </div>\n );\n};\n","import { Icon } from \"@powerhousedao/design-system\";\nimport { ThemeSwitch } from \"@powerhousedao/design-system/connect\";\nimport { useLinkProps, usePHNavigation } from \"@powerhousedao/reactor-browser\";\nimport { Outlet } from \"@tanstack/react-router\";\nimport { Suspense } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { twMerge } from \"tailwind-merge\";\nimport type { SettingsTabEntry } from \"../../router/settings.js\";\nimport { useSettingsTabs } from \"../../router/settings.js\";\n\nfunction SettingsTabLink({ tab }: { tab: SettingsTabEntry }) {\n const link = useLinkProps({ settings: tab.id });\n const TabIcon = tab.icon;\n const current = link[\"aria-current\"] === \"page\";\n return (\n <a\n {...link}\n className={twMerge(\n \"flex h-9 w-48 items-center gap-x-2 rounded-md pl-3 text-left text-foreground\",\n current ? \"cursor-default bg-accent\" : \"hover:bg-accent\",\n tab.destructive && \"text-destructive\",\n )}\n >\n {TabIcon && (\n <TabIcon\n size={16}\n className={tab.destructive ? \"text-destructive\" : undefined}\n />\n )}\n <span>{tab.label}</span>\n </a>\n );\n}\n\n/** The settings page: its tabs as links beside the open one. */\nexport function SettingsPage() {\n const { t } = useTranslation();\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 bg-background\">\n <div className=\"flex items-center justify-between border-b border-border p-4\">\n <h1 className=\"text-xl font-semibold text-foreground\">\n {t(\"modals.connectSettings.title\")}\n </h1>\n <button\n type=\"button\"\n aria-label=\"Close\"\n className=\"flex size-6 cursor-pointer items-center justify-center rounded-md text-foreground outline-none\"\n onClick={close}\n >\n <Icon name=\"XmarkLight\" size={24} />\n </button>\n </div>\n <div className=\"flex min-h-0 flex-1\">\n <nav aria-label=\"Settings\" className=\"flex flex-col p-3 pt-6\">\n <div className=\"flex flex-col gap-y-1\">\n {tabs.map((tab) => (\n <SettingsTabLink key={tab.id} tab={tab} />\n ))}\n </div>\n <div className=\"mt-auto border-t border-border pt-2\">\n <ThemeSwitch horizontal />\n </div>\n </nav>\n <main className=\"m-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-border bg-background\">\n <Suspense name=\"SettingsTab\">\n <Outlet />\n </Suspense>\n </main>\n </div>\n </div>\n );\n}\n"],"names":["BaseAbout","packageJson","BaseDangerZone","BaseDefaultEditor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACqBA,MAAa,cAAwB;CACnC,MAAM,wBAAwB;EAC5B,aAAa;EACb,YAAY,EAAE,MAAM,YAAY,CAAC;CACnC;CAEA,OACE,qBAAC,OAAD,EAAA,UAAA;EACE,oBAACA,SAAD;GACE,aAAaC;GACb,cACE,OAAO,cAAc,iBAAiB,WAClC,cAAc,eACd,KAAA;EAEP,CAAA;EACD,oBAAC,YAAD,CAAa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C,iBAAD,EAAmC,IAAM,GAAnB,IAAI,EAAe,CAC1C;IACE,CAAA,GACL,oBAAC,OAAD;KAAK,WAAU;KACb,UAAA,oBAAC,aAAD,EAAa,YAAA,KAAY,CAAA;IACtB,CAAA,CACF;GACL,CAAA,GAAA,oBAAC,QAAD;IAAM,WAAU;IACd,UAAA,oBAAC,UAAD;KAAU,MAAK;KACb,UAAA,oBAAC,QAAD,CAAS,CAAA;IACD,CAAA;GACN,CAAA,CACH;EACF,CAAA,CAAA;;AAET","debug_id":"f40512be-5632-5939-91f9-8dd5c96b9a19"}
|
|
1
|
+
{"version":3,"file":"settings-D7lXsfBl.js","sources":["../package.json","../src/components/settings/about.tsx","../src/components/settings/ai-assistant.tsx","../src/components/settings/danger-zone.tsx","../src/components/settings/default-editor.tsx","../src/components/settings/package-manager.tsx","../src/components/settings/settings-page.tsx"],"sourcesContent":["","import { connectConfig } from \"@powerhousedao/connect/config\";\nimport {\n getGitSha,\n getGitUrl,\n packageJson,\n shortGitSha,\n} from \"@powerhousedao/connect/utils\";\nimport { Icon } from \"@powerhousedao/design-system\";\nimport { About as BaseAbout } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n DriveCollectionId,\n showPHModal,\n useDrives,\n useDriveSystemInfo,\n useSyncList,\n getDriveName,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport { useMemo } from \"react\";\n\nexport const About: React.FC = () => {\n const onOpenInspector = () => {\n closePHModal();\n showPHModal({ type: \"inspector\" });\n };\n\n return (\n <div>\n <BaseAbout\n packageJson={packageJson}\n phCliVersion={\n typeof connectConfig.phCliVersion === \"string\"\n ? connectConfig.phCliVersion\n : undefined\n }\n />\n <AppGitHash />\n <ConnectedDrives />\n <div className=\"bg-background p-3\">\n <h2 className=\"mb-2 font-semibold text-foreground\">Inspector</h2>\n <p className=\"mb-3 text-sm font-normal text-foreground\">\n Explore the local database and sync state for debugging.\n </p>\n <button\n className=\"flex items-center gap-x-2 rounded-md border border-border bg-transparent px-3 py-1 text-sm font-medium text-foreground transition-colors hover:hover-effect\"\n onClick={onOpenInspector}\n type=\"button\"\n >\n Open Inspector <Icon name=\"CircleInfo\" size={16} />\n </button>\n </div>\n </div>\n );\n};\n\nfunction AppGitHash() {\n const sha = getGitSha();\n if (sha === \"unknown\") return null;\n const url = getGitUrl();\n const label = shortGitSha(sha);\n return (\n <div className=\"bg-background p-3 text-sm\">\n <span className=\"font-semibold\">Git hash: </span>\n {url ? (\n <a\n className=\"font-mono underline\"\n href={url}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n title={sha}\n >\n {label}\n </a>\n ) : (\n <span className=\"font-mono\" title={sha}>\n {label}\n </span>\n )}\n </div>\n );\n}\n\nfunction ConnectedDrives() {\n const drives = useDrives() ?? [];\n const remotes = useSyncList();\n\n const remoteDrives = useMemo(\n () =>\n drives.filter((d) =>\n remotes.some((r) =>\n r.meta.collectionId.equals(DriveCollectionId.forDrive(d.header.id)),\n ),\n ),\n [drives, remotes],\n );\n\n return (\n <div className=\"my-4 bg-background p-3\">\n <h2 className=\"mb-2 font-semibold text-foreground\">Connected drives</h2>\n {remoteDrives.length === 0 ? (\n <p className=\"text-sm font-normal text-foreground\">\n No connected remote drives.\n </p>\n ) : (\n <ul className=\"flex flex-col gap-3\">\n {remoteDrives.map((drive) => (\n <DriveAboutEntry key={drive.header.id} drive={drive} />\n ))}\n </ul>\n )}\n </div>\n );\n}\n\nfunction DriveAboutEntry({ drive }: { drive: DocumentDriveDocument }) {\n const info = useDriveSystemInfo(drive);\n const name = getDriveName(drive);\n\n return (\n <li className=\"text-sm text-foreground\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"font-medium\">{name}</span>\n {info.status === \"ready\" && (\n <span className=\"text-xs text-muted-foreground\">{info.host}</span>\n )}\n </div>\n {info.status === \"loading\" && (\n <div className=\"mt-1 text-xs text-muted-foreground\">Loading…</div>\n )}\n {info.status === \"error\" && (\n <div className=\"mt-1 text-xs text-destructive\">\n Could not load system info\n </div>\n )}\n {info.status === \"ready\" && (\n <div className=\"mt-1 text-xs text-foreground\">\n <div>\n <span className=\"font-medium\">Version:</span> {info.version}\n </div>\n <div>\n <span className=\"font-medium\">Git hash: </span>\n {info.gitUrl ? (\n <a\n className=\"font-mono hover:underline\"\n href={info.gitUrl}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n title={info.gitHash}\n >\n {shortGitSha(info.gitHash)}\n </a>\n ) : (\n <span className=\"font-mono\" title={info.gitHash}>\n {shortGitSha(info.gitHash)}\n </span>\n )}\n </div>\n </div>\n )}\n {info.status === \"local\" && (\n <div className=\"mt-1 text-xs text-muted-foreground\">\n Local drive — N/A\n </div>\n )}\n </li>\n );\n}\n","import {\n getAiSettings,\n isAiConfigured,\n updateAiSettings,\n type AiSettings,\n} from \"@powerhousedao/reactor-browser/ai\";\nimport { Bot } from \"lucide-react\";\nimport { useState } from \"react\";\n\ntype TestState =\n | { status: \"idle\" }\n | { status: \"testing\" }\n | { status: \"ok\"; message: string }\n | { status: \"error\"; message: string };\n\nconst FIELD_CLASS =\n \"w-full rounded-md border border-border bg-background p-2.5 text-sm text-foreground outline-none placeholder:text-muted-foreground\";\n\n/**\n * Settings-modal section for the in-browser AI assistant: the user master\n * toggle, the OpenAI-compatible endpoint configuration, and a\n * save-and-test-connection action. Only mounted when the deployment\n * enables the feature (`connect.ai.assistantEnabled`).\n */\nexport const AiAssistant: React.FC = () => {\n const [draft, setDraft] = useState<AiSettings>(() => getAiSettings());\n const [test, setTest] = useState<TestState>({ status: \"idle\" });\n\n const patch = (value: Partial<AiSettings>) =>\n setDraft((d) => ({ ...d, ...value }));\n\n const saveAndTest = async () => {\n updateAiSettings(draft);\n if (!isAiConfigured(draft)) {\n setTest({\n status: \"error\",\n message: \"Base URL, API key and model are all required.\",\n });\n return;\n }\n setTest({ status: \"testing\" });\n try {\n const base = draft.baseUrl.trim().replace(/\\/+$/, \"\");\n const res = await fetch(`${base}/models`, {\n headers: draft.apiKey.trim()\n ? { Authorization: `Bearer ${draft.apiKey.trim()}` }\n : undefined,\n });\n if (!res.ok) {\n throw new Error(\n `HTTP ${res.status}${res.statusText ? ` ${res.statusText}` : \"\"}`,\n );\n }\n const data: unknown = await res.json();\n const list = (data as { data?: unknown[] } | null)?.data;\n const count = Array.isArray(list) ? list.length : 0;\n setTest({\n status: \"ok\",\n message: count\n ? `Connected — ${count} model(s) available.`\n : \"Connected.\",\n });\n } catch (error) {\n setTest({\n status: \"error\",\n message: `Connection failed: ${\n error instanceof Error ? error.message : String(error)\n }`,\n });\n }\n };\n\n return (\n <div className=\"space-y-4 p-1\">\n <div>\n <h3 className=\"flex items-center gap-2 text-sm font-semibold text-foreground\">\n <Bot size={16} /> AI Assistant\n </h3>\n <p className=\"mt-1 text-xs text-muted-foreground\">\n An in-page assistant that creates and changes documents, manages\n drives, and inspects read models through an OpenAI-compatible\n endpoint.\n </p>\n </div>\n\n <label className=\"flex items-center gap-2 text-sm text-foreground\">\n <input\n type=\"checkbox\"\n checked={draft.enabled}\n onChange={(event) => {\n patch({ enabled: event.target.checked });\n // The switch acts immediately: the FAB mounts/unmounts at once.\n updateAiSettings({ enabled: event.target.checked });\n }}\n />\n Enable AI assistant\n </label>\n\n {draft.enabled && (\n <div className=\"space-y-2 rounded-lg border border-border p-3\">\n <div className=\"mb-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase\">\n Endpoint\n </div>\n <input\n type=\"url\"\n placeholder=\"Base URL (e.g. https://api.openai.com/v1)\"\n value={draft.baseUrl}\n onChange={(e) => patch({ baseUrl: e.target.value })}\n className={FIELD_CLASS}\n spellCheck={false}\n />\n <input\n type=\"password\"\n placeholder=\"API key\"\n value={draft.apiKey}\n onChange={(e) => patch({ apiKey: e.target.value })}\n className={FIELD_CLASS}\n autoComplete=\"off\"\n spellCheck={false}\n />\n <input\n type=\"text\"\n placeholder=\"Model (e.g. gpt-4o-mini)\"\n value={draft.model}\n onChange={(e) => patch({ model: e.target.value })}\n className={FIELD_CLASS}\n spellCheck={false}\n />\n <label className=\"flex items-center gap-2 pt-1 text-sm text-foreground\">\n <input\n type=\"checkbox\"\n checked={draft.autoApproveWrites}\n onChange={(event) =>\n patch({ autoApproveWrites: event.target.checked })\n }\n />\n Auto-approve write actions\n </label>\n <p className=\"text-xs text-muted-foreground\">\n Requests go directly from this browser to the endpoint; the API key\n is never sent to Powerhouse servers. The endpoint must allow\n cross-origin (CORS) requests from this site.\n </p>\n <div className=\"flex items-center gap-3 pt-1\">\n <button\n type=\"button\"\n onClick={() => void saveAndTest()}\n disabled={test.status === \"testing\"}\n className=\"rounded-md bg-primary px-3 py-1.5 text-sm font-semibold text-primary-foreground hover:bg-primary/90 disabled:disabled-effect\"\n >\n {test.status === \"testing\"\n ? \"Testing…\"\n : \"Save & test connection\"}\n </button>\n {test.status === \"ok\" && (\n <span className=\"text-xs text-foreground\">{test.message}</span>\n )}\n {test.status === \"error\" && (\n <span className=\"text-xs text-destructive\">{test.message}</span>\n )}\n </div>\n </div>\n )}\n </div>\n );\n};\n","import { DangerZone as BaseDangerZone } from \"@powerhousedao/design-system/connect\";\nimport {\n deleteDrive,\n showPHModal,\n useDrives,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport { useForgetSettingsOpenedFrom } from \"../../router/settings.js\";\n\nexport const DangerZone: React.FC = () => {\n const drives = useDrives();\n const forgetOpenedFrom = useForgetSettingsOpenedFrom();\n\n const handleDeleteDrive = async (drive: DocumentDriveDocument) => {\n // Settings selects no drive; deselecting would navigate home.\n await deleteDrive(drive.header.id);\n // Settings may have been opened from the deleted drive.\n await forgetOpenedFrom();\n };\n\n const handleClearStorage = () => {\n showPHModal({ type: \"clearStorage\" });\n };\n\n return (\n <BaseDangerZone\n drives={drives ?? []}\n onDeleteDrive={(drive) => {\n void handleDeleteDrive(drive);\n }}\n onClearStorage={handleClearStorage}\n />\n );\n};\n","import { DefaultEditor as BaseDefaultEditor } from \"@powerhousedao/design-system/connect\";\nimport { useCallback, useState } from \"react\";\n\nconst documentModelEditorOptions = [\n { label: \"V1\", value: \"document-model-editor\" },\n { label: \"V2\", value: \"document-model-editor-v2\" },\n] as const;\n\nexport const DefaultEditor: React.FC = () => {\n const [documentModelEditor, setDocumentModelEditor] = useState<\n (typeof documentModelEditorOptions)[number]\n >(documentModelEditorOptions[1]);\n\n const handleSetDocumentEditor = useCallback((value: string) => {\n const option = documentModelEditorOptions.find((dm) => dm.value == value);\n if (option) {\n setDocumentModelEditor(option);\n }\n }, []);\n\n return (\n <BaseDefaultEditor\n documentModelEditor={documentModelEditor.value}\n setDocumentModelEditor={handleSetDocumentEditor}\n documentModelEditorOptions={\n documentModelEditorOptions as unknown as {\n value: string;\n label: string;\n }[]\n }\n />\n );\n};\n","import { useRegistryPackages } from \"../../hooks/useRegistryPackages.js\";\nimport { toast } from \"@powerhousedao/connect/services\";\nimport { PackageManager } from \"@powerhousedao/design-system/connect\";\nimport { useVetraPackageManager } from \"@powerhousedao/reactor-browser\";\nimport React from \"react\";\n\n/**\n * Split a `name@tag` spec into its bare package name. Mirrors the design-system's\n * `parsePackageSpec` — duplicated here to avoid reaching into a deep subpath\n * export. Scoped names split on the LAST `@`, unscoped on the first.\n */\nfunction parseBareName(spec: string): string {\n const trimmed = spec.trim();\n const at = trimmed.startsWith(\"@\")\n ? trimmed.lastIndexOf(\"@\")\n : trimmed.indexOf(\"@\");\n return at > 0 ? trimmed.slice(0, at) : trimmed;\n}\n\nexport const ConnectPackageManager: React.FC = () => {\n const packageManager = useVetraPackageManager();\n const {\n registryPackageList,\n installedPackages,\n availablePackages,\n availableHasMore,\n isLoadingAvailable,\n isLoadingMoreAvailable,\n availableError,\n ensureAvailableLoaded,\n ensureInstalledMetadataLoaded,\n fetchAvailablePage,\n loadMoreAvailable,\n setAvailableSearch,\n updateRegistryPackageStatus,\n registerFallbackRegistryPackage,\n } = useRegistryPackages();\n\n async function handleInstall(packageSpec: string) {\n if (!packageManager) return;\n\n // The spec may include an explicit `@tag` / `@version` suffix from the\n // search input. Pass it through to the package manager as-is (the CDN\n // route already handles `name@tag` specs), but track status under the\n // bare name so the Settings list doesn't fragment.\n const bareName = parseBareName(packageSpec);\n // Packages that were in `/packages` when the user clicked Install go\n // through `updateRegistryPackageStatus` and hit an existing entry.\n // Packages that landed via the npm-uplink fallback weren't in the list,\n // so we register them explicitly rather than silently upserting a\n // placeholder — keeping the \"does not exist\" error as a signal for any\n // other code path that reaches update without a matching entry.\n const wasKnownToRegistry = registryPackageList.some(\n (p) => p.name === bareName,\n );\n const result = await packageManager.addPackage(packageSpec);\n if (result.type === \"success\") {\n if (wasKnownToRegistry) {\n updateRegistryPackageStatus(bareName, \"registry-install\");\n } else {\n registerFallbackRegistryPackage(\n bareName,\n result.package,\n packageManager.getPackageVersion(bareName) ??\n packageManager.getPackageVersion(packageSpec),\n \"registry-install\",\n );\n }\n toast(`Package \"${packageSpec}\" installed successfully`, {\n type: \"connect-success\",\n });\n } else {\n const message = result.error.message;\n console.error(\n `[Connect][PackageManager] Install failed for \"${packageSpec}\":`,\n result.error,\n );\n // `BrowserPackageManager` raises a generic \"Failed to fetch dynamically\n // imported module\" when the registry CDN returns an error. That covers\n // both \"the name exists nowhere (not on this registry AND not on the\n // npmjs uplink)\" and \"the tarball is there but doesn't look like a\n // Powerhouse package\". Map to plain-language copy — never dump the raw\n // API / loader message into the toast.\n const isLikelyNotFound = /failed to fetch|404|not found/i.test(message);\n const userMessage = isLikelyNotFound\n ? `Couldn't install \"${packageSpec}\". It isn't available on this registry or via npm.`\n : `Couldn't install \"${packageSpec}\". Please try again.`;\n toast(userMessage, { type: \"error\" });\n }\n }\n\n function handleUninstall(packageName: string) {\n if (!packageManager) return;\n try {\n packageManager.removePackage(packageName);\n updateRegistryPackageStatus(packageName, \"available\");\n\n toast(`Package \"${packageName}\" uninstalled successfully`, {\n type: \"connect-success\",\n });\n } catch (error) {\n console.error(\n `[Connect][PackageManager] Uninstall failed for \"${packageName}\":`,\n error,\n );\n toast(`Couldn't uninstall \"${packageName}\". Please try again.`, {\n type: \"error\",\n });\n }\n }\n\n return (\n <div className=\"flex min-h-0 flex-1 flex-col\">\n <PackageManager\n mutable={true}\n installedPackages={installedPackages}\n availablePackages={availablePackages}\n isAvailableLoading={isLoadingAvailable}\n isLoadingMoreAvailable={isLoadingMoreAvailable}\n hasMoreAvailable={availableHasMore}\n onLoadMoreAvailable={loadMoreAvailable}\n availableError={availableError}\n onAvailableRetry={() => {\n void fetchAvailablePage({ reset: true });\n }}\n onAvailableSearchChange={setAvailableSearch}\n onAvailableTabOpen={ensureAvailableLoaded}\n onInstalledTabOpen={ensureInstalledMetadataLoaded}\n onInstall={handleInstall}\n onUninstall={handleUninstall}\n />\n </div>\n );\n};\n","import { Icon } from \"@powerhousedao/design-system\";\nimport { ThemeSwitch } from \"@powerhousedao/design-system/connect\";\nimport { useLinkProps, usePHNavigation } from \"@powerhousedao/reactor-browser\";\nimport { Outlet } from \"@tanstack/react-router\";\nimport { Suspense } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { twMerge } from \"tailwind-merge\";\nimport type { SettingsTabEntry } from \"../../router/settings.js\";\nimport { useSettingsTabs } from \"../../router/settings.js\";\n\nfunction SettingsTabLink({ tab }: { tab: SettingsTabEntry }) {\n const link = useLinkProps({ settings: tab.id });\n const TabIcon = tab.icon;\n const current = link[\"aria-current\"] === \"page\";\n return (\n <a\n {...link}\n className={twMerge(\n \"flex h-9 w-48 items-center gap-x-2 rounded-md pl-3 text-left text-foreground\",\n current ? \"cursor-default bg-accent\" : \"hover:bg-accent\",\n tab.destructive && \"text-destructive\",\n )}\n >\n {TabIcon && (\n <TabIcon\n size={16}\n className={tab.destructive ? \"text-destructive\" : undefined}\n />\n )}\n <span>{tab.label}</span>\n </a>\n );\n}\n\n/** The settings page: its tabs as links beside the open one. */\nexport function SettingsPage() {\n const { t } = useTranslation();\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 bg-background\">\n <div className=\"flex items-center justify-between border-b border-border p-4\">\n <h1 className=\"text-xl font-semibold text-foreground\">\n {t(\"modals.connectSettings.title\")}\n </h1>\n <button\n type=\"button\"\n aria-label=\"Close\"\n className=\"flex size-6 cursor-pointer items-center justify-center rounded-md text-foreground outline-none\"\n onClick={close}\n >\n <Icon name=\"XmarkLight\" size={24} />\n </button>\n </div>\n <div className=\"flex min-h-0 flex-1\">\n <nav aria-label=\"Settings\" className=\"flex flex-col p-3 pt-6\">\n <div className=\"flex flex-col gap-y-1\">\n {tabs.map((tab) => (\n <SettingsTabLink key={tab.id} tab={tab} />\n ))}\n </div>\n <div className=\"mt-auto border-t border-border pt-2\">\n <ThemeSwitch horizontal />\n </div>\n </nav>\n <main className=\"m-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-border bg-background\">\n <Suspense name=\"SettingsTab\">\n <Outlet />\n </Suspense>\n </main>\n </div>\n </div>\n );\n}\n"],"names":["BaseAbout","packageJson","BaseDangerZone","BaseDefaultEditor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACqBA,MAAa,cAAwB;CACnC,MAAM,wBAAwB;EAC5B,aAAa;EACb,YAAY,EAAE,MAAM,YAAY,CAAC;CACnC;CAEA,OACE,qBAAC,OAAD,EAAA,UAAA;EACE,oBAACA,SAAD;GACE,aAAaC;GACb,cACE,OAAO,cAAc,iBAAiB,WAClC,cAAc,eACd,KAAA;EAEP,CAAA;EACD,oBAAC,YAAD,CAAa,CAAA;EACb,oBAAC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AAM,GAAnB,IAAI,EAAe,CAC1C;IACE,CAAA,GACL,oBAAC,OAAD;KAAK,WAAU;KACb,UAAA,oBAAC,aAAD,EAAa,YAAA,KAAY,CAAA;IACtB,CAAA,CACF;GACL,CAAA,GAAA,oBAAC,QAAD;IAAM,WAAU;IACd,UAAA,oBAAC,UAAD;KAAU,MAAK;KACb,UAAA,oBAAC,QAAD,CAAS,CAAA;IACD,CAAA;GACN,CAAA,CACH;EACF,CAAA,CAAA;;AAET","debug_id":"823075db-85bb-56a8-bcd1-fb07ac11b140"}
|
package/dist/start-connect.js
CHANGED
|
@@ -4,7 +4,7 @@ import { t as bootConnect } from "./boot-CC_DgQKX.js";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region start-connect.tsx
|
|
6
6
|
const root = await bootConnect();
|
|
7
|
-
const components = root ? await import("./components-
|
|
7
|
+
const components = root ? await import("./components-Ksj8WTJ5.js") : null;
|
|
8
8
|
function updateLocalPackage(pkg) {
|
|
9
9
|
window.ph?.vetraPackageManager?.updateLocalPackage(pkg);
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/connect",
|
|
3
3
|
"productName": "Powerhouse-Connect",
|
|
4
|
-
"version": "6.2.3-dev.
|
|
4
|
+
"version": "6.2.3-dev.65",
|
|
5
5
|
"description": "Powerhouse Connect",
|
|
6
6
|
"main": "dist/index.html",
|
|
7
7
|
"type": "module",
|
|
@@ -80,26 +80,26 @@
|
|
|
80
80
|
"@openfeature/core": "1.9.1",
|
|
81
81
|
"@openfeature/web-sdk": "1.6.2",
|
|
82
82
|
"@openpanel/web": "^1.4.1",
|
|
83
|
-
"@powerhousedao/config": "6.2.3-dev.
|
|
84
|
-
"@powerhousedao/design-system": "6.2.3-dev.
|
|
83
|
+
"@powerhousedao/config": "6.2.3-dev.65",
|
|
84
|
+
"@powerhousedao/design-system": "6.2.3-dev.65",
|
|
85
85
|
"@powerhousedao/document-engineering": "1.40.5",
|
|
86
|
-
"@powerhousedao/host-core": "6.2.3-dev.
|
|
87
|
-
"@powerhousedao/powerhouse-vetra-packages": "6.2.3-dev.
|
|
88
|
-
"@powerhousedao/reactor": "6.2.3-dev.
|
|
89
|
-
"@powerhousedao/reactor-attachments": "6.2.3-dev.
|
|
90
|
-
"@powerhousedao/reactor-browser": "6.2.3-dev.
|
|
91
|
-
"@powerhousedao/reactor-mcp": "6.2.3-dev.
|
|
92
|
-
"@powerhousedao/reactor-router": "6.2.3-dev.
|
|
93
|
-
"@powerhousedao/shared": "6.2.3-dev.
|
|
94
|
-
"@powerhousedao/vetra": "6.2.3-dev.
|
|
95
|
-
"@powerhousedao/workflow": "6.2.3-dev.
|
|
86
|
+
"@powerhousedao/host-core": "6.2.3-dev.65",
|
|
87
|
+
"@powerhousedao/powerhouse-vetra-packages": "6.2.3-dev.65",
|
|
88
|
+
"@powerhousedao/reactor": "6.2.3-dev.65",
|
|
89
|
+
"@powerhousedao/reactor-attachments": "6.2.3-dev.65",
|
|
90
|
+
"@powerhousedao/reactor-browser": "6.2.3-dev.65",
|
|
91
|
+
"@powerhousedao/reactor-mcp": "6.2.3-dev.65",
|
|
92
|
+
"@powerhousedao/reactor-router": "6.2.3-dev.65",
|
|
93
|
+
"@powerhousedao/shared": "6.2.3-dev.65",
|
|
94
|
+
"@powerhousedao/vetra": "6.2.3-dev.65",
|
|
95
|
+
"@powerhousedao/workflow": "6.2.3-dev.65",
|
|
96
96
|
"@privy-io/react-auth": "3.35.0",
|
|
97
97
|
"@rainbow-me/rainbowkit": "^2.2.11",
|
|
98
|
-
"@renown/sdk": "6.2.3-dev.
|
|
98
|
+
"@renown/sdk": "6.2.3-dev.65",
|
|
99
99
|
"@sentry/react": "^10.17.0",
|
|
100
100
|
"@tanstack/react-query": "^5.90.2",
|
|
101
101
|
"@tanstack/react-router": "^1.170.41",
|
|
102
|
-
"document-model": "6.2.3-dev.
|
|
102
|
+
"document-model": "6.2.3-dev.65",
|
|
103
103
|
"i18next": "^25.5.3",
|
|
104
104
|
"kysely": "0.28.16",
|
|
105
105
|
"kysely-pglite-dialect": "1.2.0",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"tailwindcss": "4.2.2",
|
|
137
137
|
"tsdown": "0.23.0",
|
|
138
138
|
"typescript": "7.0.2",
|
|
139
|
-
"vite": "8.3.
|
|
139
|
+
"vite": "8.3.4",
|
|
140
140
|
"vite-tsconfig-paths": "6.1.1"
|
|
141
141
|
},
|
|
142
142
|
"peerDependencies": {
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { t as AppLoader } from "./app-loader-C97oGqzI.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]="64af495e-281b-5fb0-ba73-6f33bdda5b88")}catch(e){}}();
|
|
4
|
-
//# debugId=64af495e-281b-5fb0-ba73-6f33bdda5b88
|
package/dist/router-B8Yo4-or.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { r as getConnectRouter } from "./router-CCCrN6AM.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]="1b0bb71e-0b67-5f4e-ba1f-e6be7cc9f618")}catch(e){}}();
|
|
4
|
-
//# debugId=1b0bb71e-0b67-5f4e-ba1f-e6be7cc9f618
|