@powerhousedao/connect 6.2.0-dev.2 → 6.2.0-dev.21
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/{AddDriveModal-kzL41qdg.js → AddDriveModal-BoKLJyUY.js} +4 -7
- package/dist/{AddDriveModal-kzL41qdg.js.map → AddDriveModal-BoKLJyUY.js.map} +1 -1
- package/dist/{ClearStorageModal-DIKwqiia.js → ClearStorageModal-CXoNWmRe.js} +4 -4
- package/dist/{ClearStorageModal-DIKwqiia.js.map → ClearStorageModal-CXoNWmRe.js.map} +1 -1
- package/dist/{DebugSettingsModal-Dxi_8rOa.js → DebugSettingsModal-BUjKyRCv.js} +10 -10
- package/dist/DebugSettingsModal-BUjKyRCv.js.map +1 -0
- package/dist/DriveAuthRequiredModal-B3VdLwSH.js +36 -0
- package/dist/DriveAuthRequiredModal-B3VdLwSH.js.map +1 -0
- package/dist/{DriveSettingsModal-L5sM-rIh.js → DriveSettingsModal-CsNFEJ9E.js} +5 -5
- package/dist/DriveSettingsModal-CsNFEJ9E.js.map +1 -0
- package/dist/{InspectorModal-C7pIf6OO.js → InspectorModal-BsSihzuc.js} +6 -6
- package/dist/{InspectorModal-C7pIf6OO.js.map → InspectorModal-BsSihzuc.js.map} +1 -1
- package/dist/{MissingPackageModal-D_N96M6a.js → MissingPackageModal-Bn036mWQ.js} +4 -4
- package/dist/{MissingPackageModal-D_N96M6a.js.map → MissingPackageModal-Bn036mWQ.js.map} +1 -1
- package/dist/{SettingsModal-B2DuAQVQ.js → SettingsModal-DI2_oVrF.js} +35 -42
- package/dist/SettingsModal-DI2_oVrF.js.map +1 -0
- package/dist/{UpgradeDriveModal-CyAUDCU7.js → UpgradeDriveModal-C7lV4rAX.js} +3 -3
- package/dist/{UpgradeDriveModal-CyAUDCU7.js.map → UpgradeDriveModal-C7lV4rAX.js.map} +1 -1
- package/dist/app-loader-Crk2wvz-.js +4 -0
- package/dist/{app-loader-DvjTCKwK.js → app-loader-HC9KrWYq.js} +75 -50
- package/dist/app-loader-HC9KrWYq.js.map +1 -0
- package/dist/{build-info-M90cqR0U.js → build-info-YjllYmn8.js} +4 -4
- package/dist/{build-info-M90cqR0U.js.map → build-info-YjllYmn8.js.map} +1 -1
- package/dist/{components-BY3M6wF8.js → components-CY-vRx23.js} +3 -3
- package/dist/{connect.config-aPx3rHZQ.js → connect.config-Bt4pvvWV.js} +9 -5
- package/dist/connect.config-Bt4pvvWV.js.map +1 -0
- package/dist/{load-BSRod9gt.js → load-9_rJ2u5a.js} +8 -8
- package/dist/{load-BSRod9gt.js.map → load-9_rJ2u5a.js.map} +1 -1
- package/dist/main.js +1 -1
- package/dist/{package-VvzmOTZO.js → package-Cra5KN-6.js} +6 -5
- package/dist/package-Cra5KN-6.js.map +1 -0
- package/dist/{pglite-runtime-toc1-TWa.js → pglite-runtime-Ch2YeUAA.js} +4 -4
- package/dist/{pglite-runtime-toc1-TWa.js.map → pglite-runtime-Ch2YeUAA.js.map} +1 -1
- package/dist/{pglite-seed-D8oSKkep.js → pglite-seed-BWk7yOwr.js} +4 -4
- package/dist/{pglite-seed-D8oSKkep.js.map → pglite-seed-BWk7yOwr.js.map} +1 -1
- package/dist/{reactor-BlxTyHZ5.js → reactor-BxNvHOKC.js} +32 -38
- package/dist/reactor-BxNvHOKC.js.map +1 -0
- package/dist/{registerServiceWorker-B7uKpkci.js → registerServiceWorker-D9l1kja7.js} +4 -4
- package/dist/{registerServiceWorker-B7uKpkci.js.map → registerServiceWorker-D9l1kja7.js.map} +1 -1
- package/dist/start-connect.js +1 -1
- package/dist/style.css +851 -2392
- package/dist/{useRegistryPackages-Bh0luCvV.js → useRegistryPackages-B-gFECmd.js} +44 -8
- package/dist/useRegistryPackages-B-gFECmd.js.map +1 -0
- package/package.json +12 -11
- package/dist/DebugSettingsModal-Dxi_8rOa.js.map +0 -1
- package/dist/DriveSettingsModal-L5sM-rIh.js.map +0 -1
- package/dist/SettingsModal-B2DuAQVQ.js.map +0 -1
- package/dist/app-loader-DW8p8fo5.js +0 -4
- package/dist/app-loader-DvjTCKwK.js.map +0 -1
- package/dist/connect.config-aPx3rHZQ.js.map +0 -1
- package/dist/package-VvzmOTZO.js.map +0 -1
- package/dist/reactor-BlxTyHZ5.js.map +0 -1
- package/dist/useRegistryPackages-Bh0luCvV.js.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
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]="5de9352d-c347-5789-abb0-91edaee27780")}catch(e){}}();
|
|
3
3
|
import { n as getRuntimeConfig } from "./runtime-config-DL3QjcfM.js";
|
|
4
4
|
import { n as i18n } from "./reload-connect-toast-CwvSc6F-.js";
|
|
5
|
-
import { a as defaultPHDocumentEditorConfig, i as defaultPHAppConfig, r as connectConfig } from "./connect.config-
|
|
6
|
-
import { c as subscribeReactorPgMajor, d as createFileDataStore, f as idbError, l as IDB_STORE_NAME, m as readPgVersionFile, p as openIdb, r as getCachedReactorPgMajor, u as PRIMARY_IDB_NAMES } from "./pglite-runtime-
|
|
7
|
-
import { t as serviceWorkerManager } from "./registerServiceWorker-
|
|
5
|
+
import { a as defaultPHDocumentEditorConfig, i as defaultPHAppConfig, r as connectConfig } from "./connect.config-Bt4pvvWV.js";
|
|
6
|
+
import { c as subscribeReactorPgMajor, d as createFileDataStore, f as idbError, l as IDB_STORE_NAME, m as readPgVersionFile, p as openIdb, r as getCachedReactorPgMajor, u as PRIMARY_IDB_NAMES } from "./pglite-runtime-Ch2YeUAA.js";
|
|
7
|
+
import { t as serviceWorkerManager } from "./registerServiceWorker-D9l1kja7.js";
|
|
8
8
|
import { n as toast, t as ToastContainer } from "./toast-BEy42aYx.js";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { PGlite } from "@electric-sql/pglite";
|
|
11
11
|
import { Trans, useTranslation } from "react-i18next";
|
|
12
12
|
import React, { StrictMode, Suspense, lazy, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
13
|
-
import {
|
|
13
|
+
import { DriveCollectionId, getRevisionFromDate, initTheme, logout, openRenown, setPHAppConfig, setPHDocumentEditorConfig, setRevisionHistoryVisible, setSelectedDrive, setSelectedNode, showPHModal, useAppModuleById, useConnectionStates, useDefaultAppModule, useDocumentById, useDocumentModelModuleById, useDocumentOperations, useDrives, useEditorModuleById, useFallbackEditorModule, useIsAddDriveEnabled, useNodeParentFolderById, usePHModal, usePackageDiscoveryService, useReactorClientModule, useRevisionHistoryVisible, useSelectedDocument, useSelectedDocumentId, useSelectedDriveSafe, useSelectedFolder, useSelectedTimelineItem, useSyncList, useTheme, useUser, useVetraPackageManager, useVetraPackages } from "@powerhousedao/reactor-browser";
|
|
14
14
|
import { childLogger } from "document-model";
|
|
15
|
-
import { ConnectSidebar, ConnectTooltipProvider, CookieBanner, DefaultEditorLoader, DropZoneWrapper, HomeScreen, HomeScreenAddDriveItem, HomeScreenItem, LogoAnimation, PackageInstallModal, RevisionHistory, SidebarAddDriveItem, SidebarItem, useEns } from "@powerhousedao/design-system/connect";
|
|
15
|
+
import { ConnectSidebar, ConnectTooltipProvider, CookieBanner, DefaultEditorLoader, DriveAuthGate, DropZoneWrapper, HomeScreen, HomeScreenAddDriveItem, HomeScreenItem, LogoAnimation, PackageInstallModal, RevisionHistory, SidebarAddDriveItem, SidebarItem, useEns } from "@powerhousedao/design-system/connect";
|
|
16
16
|
import { z } from "zod";
|
|
17
17
|
import { Outlet, RouterProvider, createBrowserRouter, createRoutesFromChildren, matchRoutes, useLocation, useNavigationType } from "react-router-dom";
|
|
18
18
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
@@ -743,12 +743,12 @@ const MigrationOverlay = () => {
|
|
|
743
743
|
return /* @__PURE__ */ jsx("div", {
|
|
744
744
|
className: "absolute inset-0 z-20 flex items-center justify-center",
|
|
745
745
|
children: /* @__PURE__ */ jsxs("div", {
|
|
746
|
-
className: "rounded-lg bg-
|
|
746
|
+
className: "rounded-lg bg-card/90 px-6 py-4 text-sm text-foreground shadow-lg",
|
|
747
747
|
children: [/* @__PURE__ */ jsx("div", {
|
|
748
748
|
className: "font-medium",
|
|
749
749
|
children: "Upgrading local database…"
|
|
750
750
|
}), /* @__PURE__ */ jsx("div", {
|
|
751
|
-
className: "text-
|
|
751
|
+
className: "text-foreground",
|
|
752
752
|
children: PHASE_LABEL[status.phase]
|
|
753
753
|
})]
|
|
754
754
|
})
|
|
@@ -780,7 +780,7 @@ const AppSkeleton = (props) => {
|
|
|
780
780
|
const isSSR = typeof window === "undefined";
|
|
781
781
|
const isHomeScreen = !isSSR && window.location.pathname === getBasePath();
|
|
782
782
|
return /* @__PURE__ */ jsxs("div", {
|
|
783
|
-
className: "flex h-screen overflow-hidden bg-
|
|
783
|
+
className: "flex h-screen overflow-hidden bg-background",
|
|
784
784
|
children: [
|
|
785
785
|
!(!isSSR && getIsEmbedded()) && /* @__PURE__ */ jsx(ConnectSidebar, {
|
|
786
786
|
className: "animate-pulse",
|
|
@@ -790,7 +790,7 @@ const AppSkeleton = (props) => {
|
|
|
790
790
|
address: void 0
|
|
791
791
|
}),
|
|
792
792
|
/* @__PURE__ */ jsx(HomeScreen, {
|
|
793
|
-
containerClassName: isSSR || !isHomeScreen ? "
|
|
793
|
+
containerClassName: isSSR || !isHomeScreen ? "home-screen hidden" : void 0,
|
|
794
794
|
children: props.children ?? null
|
|
795
795
|
}),
|
|
796
796
|
isSSR ? /* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: `
|
|
@@ -835,7 +835,7 @@ function DetailedFallback({ error, resetErrorBoundary }) {
|
|
|
835
835
|
return /* @__PURE__ */ jsx("div", {
|
|
836
836
|
className: "z-10 mx-auto flex max-w-[80%] flex-1 items-center justify-center p-6",
|
|
837
837
|
children: /* @__PURE__ */ jsxs("div", {
|
|
838
|
-
className: "w-full max-w-lg rounded-lg border border-
|
|
838
|
+
className: "w-full max-w-lg rounded-lg border border-border bg-background p-6 shadow-sm",
|
|
839
839
|
children: [
|
|
840
840
|
/* @__PURE__ */ jsxs("div", {
|
|
841
841
|
className: "mb-3 flex items-center gap-2",
|
|
@@ -848,16 +848,16 @@ function DetailedFallback({ error, resetErrorBoundary }) {
|
|
|
848
848
|
})]
|
|
849
849
|
}),
|
|
850
850
|
/* @__PURE__ */ jsx("p", {
|
|
851
|
-
className: "mb-4 text-sm text-
|
|
851
|
+
className: "mb-4 text-sm text-foreground",
|
|
852
852
|
children: errorMessage
|
|
853
853
|
}),
|
|
854
854
|
errorDetails !== "{}" && /* @__PURE__ */ jsxs("details", {
|
|
855
855
|
className: "group",
|
|
856
856
|
children: [/* @__PURE__ */ jsx("summary", {
|
|
857
|
-
className: "cursor-pointer text-sm font-medium text-
|
|
857
|
+
className: "cursor-pointer text-sm font-medium text-foreground underline select-none hover:hover-effect",
|
|
858
858
|
children: "Show details"
|
|
859
859
|
}), /* @__PURE__ */ jsx("pre", {
|
|
860
|
-
className: "mt-2 max-h-48 overflow-auto rounded-sm bg-
|
|
860
|
+
className: "mt-2 max-h-48 overflow-auto rounded-sm bg-muted p-3 text-xs",
|
|
861
861
|
children: errorDetails
|
|
862
862
|
})]
|
|
863
863
|
}),
|
|
@@ -1219,11 +1219,11 @@ function MissingModelBanner() {
|
|
|
1219
1219
|
const [open, setOpen] = useState(false);
|
|
1220
1220
|
if (failed.length === 0) return null;
|
|
1221
1221
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
1222
|
-
className: "flex items-center justify-between gap-3 bg-
|
|
1222
|
+
className: "flex items-center justify-between gap-3 bg-warning/10 px-4 py-2 text-sm text-warning",
|
|
1223
1223
|
children: [/* @__PURE__ */ jsx("span", { children: failed.length === 1 ? "1 document type couldn't load (missing model)." : `${failed.length} document types couldn't load (missing models).` }), /* @__PURE__ */ jsx("button", {
|
|
1224
1224
|
type: "button",
|
|
1225
1225
|
onClick: () => setOpen(true),
|
|
1226
|
-
className: "rounded-md border border-
|
|
1226
|
+
className: "rounded-md border border-warning bg-background px-3 py-1 text-warning hover:hover-effect",
|
|
1227
1227
|
children: "View"
|
|
1228
1228
|
})]
|
|
1229
1229
|
}), /* @__PURE__ */ jsx(MissingModelDetailsModal, {
|
|
@@ -1256,18 +1256,18 @@ function MissingModelDetailsModal(props) {
|
|
|
1256
1256
|
},
|
|
1257
1257
|
contentProps: { className: "rounded-3xl" },
|
|
1258
1258
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1259
|
-
className: "w-[520px] max-w-[90vw] bg-
|
|
1259
|
+
className: "w-[520px] max-w-[90vw] bg-background p-6",
|
|
1260
1260
|
children: [
|
|
1261
1261
|
/* @__PURE__ */ jsx("div", {
|
|
1262
|
-
className: "border-b border-
|
|
1262
|
+
className: "border-b border-border pb-2 text-2xl font-bold text-foreground",
|
|
1263
1263
|
children: "Missing document models"
|
|
1264
1264
|
}),
|
|
1265
1265
|
/* @__PURE__ */ jsx("div", {
|
|
1266
|
-
className: "my-4 text-sm text-
|
|
1266
|
+
className: "my-4 text-sm text-foreground",
|
|
1267
1267
|
children: "The following document types couldn't be loaded. Documents using them won't display until the underlying package is installed."
|
|
1268
1268
|
}),
|
|
1269
1269
|
failed.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
1270
|
-
className: "rounded-xl bg-
|
|
1270
|
+
className: "rounded-xl bg-background p-4 text-sm text-foreground",
|
|
1271
1271
|
children: "No outstanding failures."
|
|
1272
1272
|
}) : /* @__PURE__ */ jsx("div", {
|
|
1273
1273
|
className: "flex max-h-[60vh] flex-col gap-3 overflow-y-auto",
|
|
@@ -1275,18 +1275,18 @@ function MissingModelDetailsModal(props) {
|
|
|
1275
1275
|
const isRetrying = retrying.has(entry.documentType);
|
|
1276
1276
|
const retryDisabled = !canRetry(entry.reason) || isRetrying;
|
|
1277
1277
|
return /* @__PURE__ */ jsxs("div", {
|
|
1278
|
-
className: "rounded-xl bg-
|
|
1278
|
+
className: "rounded-xl bg-background p-4",
|
|
1279
1279
|
children: [
|
|
1280
1280
|
/* @__PURE__ */ jsx("div", {
|
|
1281
|
-
className: "mb-1 font-mono text-sm font-semibold text-
|
|
1281
|
+
className: "mb-1 font-mono text-sm font-semibold text-foreground",
|
|
1282
1282
|
children: entry.documentType
|
|
1283
1283
|
}),
|
|
1284
1284
|
/* @__PURE__ */ jsx("div", {
|
|
1285
|
-
className: "mb-2 text-xs text-
|
|
1285
|
+
className: "mb-2 text-xs text-foreground",
|
|
1286
1286
|
children: reasonLabels[entry.reason]
|
|
1287
1287
|
}),
|
|
1288
1288
|
entry.packageNames.length > 0 ? /* @__PURE__ */ jsxs("div", {
|
|
1289
|
-
className: "mb-2 text-xs text-
|
|
1289
|
+
className: "mb-2 text-xs text-muted-foreground",
|
|
1290
1290
|
children: [
|
|
1291
1291
|
"Package",
|
|
1292
1292
|
entry.packageNames.length > 1 ? "s" : "",
|
|
@@ -1296,7 +1296,7 @@ function MissingModelDetailsModal(props) {
|
|
|
1296
1296
|
]
|
|
1297
1297
|
}) : null,
|
|
1298
1298
|
entry.error ? /* @__PURE__ */ jsx("div", {
|
|
1299
|
-
className: "mb-2 font-mono text-xs wrap-break-word text-
|
|
1299
|
+
className: "mb-2 font-mono text-xs wrap-break-word text-destructive",
|
|
1300
1300
|
children: entry.error.message
|
|
1301
1301
|
}) : null,
|
|
1302
1302
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -1306,7 +1306,7 @@ function MissingModelDetailsModal(props) {
|
|
|
1306
1306
|
onClick: () => void handleRetry(entry.documentType),
|
|
1307
1307
|
disabled: retryDisabled,
|
|
1308
1308
|
title: canRetry(entry.reason) ? void 0 : "No registry is configured; nothing to retry against.",
|
|
1309
|
-
className: twMerge("min-h-[32px] rounded-xl px-3 py-1 text-sm font-semibold text-
|
|
1309
|
+
className: twMerge("min-h-[32px] rounded-xl px-3 py-1 text-sm font-semibold text-foreground transition-all hover:hover-effect", retryDisabled ? "cursor-not-allowed bg-secondary hover:hover-effect" : "bg-primary text-primary-foreground active:active-effect"),
|
|
1310
1310
|
children: isRetrying ? "Retrying..." : "Try install again"
|
|
1311
1311
|
})
|
|
1312
1312
|
})
|
|
@@ -1319,7 +1319,7 @@ function MissingModelDetailsModal(props) {
|
|
|
1319
1319
|
children: /* @__PURE__ */ jsx("button", {
|
|
1320
1320
|
type: "button",
|
|
1321
1321
|
onClick: onClose,
|
|
1322
|
-
className: "min-h-[36px] rounded-xl border border-
|
|
1322
|
+
className: "min-h-[36px] rounded-xl border border-border bg-background px-4 py-2 text-sm font-semibold text-foreground hover:hover-effect",
|
|
1323
1323
|
children: "Close"
|
|
1324
1324
|
})
|
|
1325
1325
|
})
|
|
@@ -1410,8 +1410,8 @@ const CookieBanner$1 = () => {
|
|
|
1410
1410
|
if (!showBanner) return null;
|
|
1411
1411
|
return /* @__PURE__ */ jsxs("div", {
|
|
1412
1412
|
className: "absolute inset-0 z-10000 backdrop-blur-sm",
|
|
1413
|
-
children: [/* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-
|
|
1414
|
-
className: "absolute inset-x-0 bottom-0 flex justify-center bg-
|
|
1413
|
+
children: [/* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-primary opacity-15" }), /* @__PURE__ */ jsx("div", {
|
|
1414
|
+
className: "absolute inset-x-0 bottom-0 flex justify-center bg-background px-10 pt-10 pb-16 shadow-lg",
|
|
1415
1415
|
children: /* @__PURE__ */ jsx(CookieBanner, {
|
|
1416
1416
|
className: "max-w-[1024px]",
|
|
1417
1417
|
cookies: cookiesInput,
|
|
@@ -1420,12 +1420,12 @@ const CookieBanner$1 = () => {
|
|
|
1420
1420
|
submitLabel: t("cookieBanner.accept"),
|
|
1421
1421
|
rejectLabel: t("cookieBanner.reject"),
|
|
1422
1422
|
children: /* @__PURE__ */ jsx("p", {
|
|
1423
|
-
className: "font-semibold text-
|
|
1423
|
+
className: "font-semibold text-muted-foreground",
|
|
1424
1424
|
children: /* @__PURE__ */ jsx(Trans, {
|
|
1425
1425
|
i18nKey: "cookieBanner.message",
|
|
1426
1426
|
components: { a: /* @__PURE__ */ jsx("a", {
|
|
1427
1427
|
onClick: () => showPHModal({ type: "cookiesPolicy" }),
|
|
1428
|
-
className: "cursor-pointer text-
|
|
1428
|
+
className: "cursor-pointer text-foreground hover:underline"
|
|
1429
1429
|
}, "cookieBanner.message-link") }
|
|
1430
1430
|
}, "cookieBanner.message")
|
|
1431
1431
|
})
|
|
@@ -1439,7 +1439,7 @@ function DriveIcon({ drive }) {
|
|
|
1439
1439
|
const remotes = useSyncList();
|
|
1440
1440
|
const isRemoteDrive = useMemo(() => {
|
|
1441
1441
|
if (!drive) return false;
|
|
1442
|
-
return remotes.some((remote) => remote.collectionId
|
|
1442
|
+
return remotes.some((remote) => remote.collectionId.equals(DriveCollectionId.forDrive(drive.header.id)));
|
|
1443
1443
|
}, [remotes, drive]);
|
|
1444
1444
|
const driveIconSrc = drive?.state.global.icon;
|
|
1445
1445
|
if (driveIconSrc) return /* @__PURE__ */ jsx("img", {
|
|
@@ -1604,7 +1604,7 @@ const DocumentEditor = (props) => {
|
|
|
1604
1604
|
//#region src/components/root.tsx
|
|
1605
1605
|
function Root() {
|
|
1606
1606
|
return /* @__PURE__ */ jsx("div", {
|
|
1607
|
-
className: "h-screen bg-
|
|
1607
|
+
className: "h-screen bg-background",
|
|
1608
1608
|
children: /* @__PURE__ */ jsx("div", {
|
|
1609
1609
|
className: `flex h-screen items-stretch overflow-auto`,
|
|
1610
1610
|
role: "presentation",
|
|
@@ -1620,8 +1620,29 @@ function Root() {
|
|
|
1620
1620
|
});
|
|
1621
1621
|
}
|
|
1622
1622
|
//#endregion
|
|
1623
|
+
//#region src/components/use-drive-auth-gate.ts
|
|
1624
|
+
/**
|
|
1625
|
+
* Pure decision: is the user blocked from a drive purely because they are not
|
|
1626
|
+
* logged in? An anonymous user with any remote channel stuck in `"error"` means
|
|
1627
|
+
* the auth-enabled studio's sync failed unrecoverably -> needs login. The
|
|
1628
|
+
* snapshot carries no error category, so "error + not authenticated" is the
|
|
1629
|
+
* signal. Never gate an authenticated user. No window/React access -> testable.
|
|
1630
|
+
*/
|
|
1631
|
+
function computeNeedsLogin(isAuthenticated, connectionStates) {
|
|
1632
|
+
if (isAuthenticated) return false;
|
|
1633
|
+
for (const snap of connectionStates.values()) if (snap.state === "error") return true;
|
|
1634
|
+
return false;
|
|
1635
|
+
}
|
|
1636
|
+
/** Live wrapper over {@link computeNeedsLogin}. */
|
|
1637
|
+
function useDriveAuthGate() {
|
|
1638
|
+
const user = useUser();
|
|
1639
|
+
const connectionStates = useConnectionStates();
|
|
1640
|
+
return { needsLogin: computeNeedsLogin(Boolean(user), connectionStates) };
|
|
1641
|
+
}
|
|
1642
|
+
//#endregion
|
|
1623
1643
|
//#region src/pages/content.tsx
|
|
1624
1644
|
function Content() {
|
|
1645
|
+
const { needsLogin } = useDriveAuthGate();
|
|
1625
1646
|
const [selectedDrive] = useSelectedDriveSafe();
|
|
1626
1647
|
const selectedFolder = useSelectedFolder();
|
|
1627
1648
|
const selectedDocumentId = useSelectedDocumentId();
|
|
@@ -1631,7 +1652,10 @@ function Content() {
|
|
|
1631
1652
|
useEffect(() => {
|
|
1632
1653
|
if (!selectedDrive) setPHAppConfig(defaultPHAppConfig);
|
|
1633
1654
|
}, [selectedDrive]);
|
|
1634
|
-
return /* @__PURE__ */ jsx(ContentContainer, { children:
|
|
1655
|
+
return /* @__PURE__ */ jsx(ContentContainer, { children: needsLogin ? /* @__PURE__ */ jsx("div", {
|
|
1656
|
+
className: "flex h-full items-center justify-center p-4",
|
|
1657
|
+
children: /* @__PURE__ */ jsx(DriveAuthGate, { onLogin: openRenown })
|
|
1658
|
+
}) : !selectedDocumentId && !selectedDrive && !selectedFolder ? /* @__PURE__ */ jsx(HomeScreenContainer, {}) : /* @__PURE__ */ jsx(AppContainer, {}) });
|
|
1635
1659
|
}
|
|
1636
1660
|
function ContentContainer({ children }) {
|
|
1637
1661
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1777,7 +1801,7 @@ const MigrationBanner = () => {
|
|
|
1777
1801
|
return /* @__PURE__ */ jsx("div", {
|
|
1778
1802
|
className: "absolute inset-x-0 top-0 z-30 flex justify-center p-3",
|
|
1779
1803
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1780
|
-
className: "flex max-w-3xl items-center gap-3 rounded-lg border border-
|
|
1804
|
+
className: "flex max-w-3xl items-center gap-3 rounded-lg border border-warning bg-warning px-4 py-3 text-sm text-warning-foreground shadow-lg",
|
|
1781
1805
|
children: [
|
|
1782
1806
|
/* @__PURE__ */ jsxs("div", {
|
|
1783
1807
|
className: "flex-1",
|
|
@@ -1791,7 +1815,7 @@ const MigrationBanner = () => {
|
|
|
1791
1815
|
]
|
|
1792
1816
|
}),
|
|
1793
1817
|
/* @__PURE__ */ jsxs("div", {
|
|
1794
|
-
className: "text-
|
|
1818
|
+
className: "text-foreground",
|
|
1795
1819
|
children: [
|
|
1796
1820
|
"Migrate to Postgres ",
|
|
1797
1821
|
17,
|
|
@@ -1799,7 +1823,7 @@ const MigrationBanner = () => {
|
|
|
1799
1823
|
]
|
|
1800
1824
|
}),
|
|
1801
1825
|
error && /* @__PURE__ */ jsxs("div", {
|
|
1802
|
-
className: "mt-2 font-medium text-
|
|
1826
|
+
className: "mt-2 font-medium text-destructive",
|
|
1803
1827
|
children: ["Migration failed: ", error]
|
|
1804
1828
|
})
|
|
1805
1829
|
]
|
|
@@ -1808,14 +1832,14 @@ const MigrationBanner = () => {
|
|
|
1808
1832
|
type: "button",
|
|
1809
1833
|
disabled: migrating,
|
|
1810
1834
|
onClick: handleMigrate,
|
|
1811
|
-
className: "rounded-sm bg-
|
|
1835
|
+
className: "rounded-sm bg-primary px-3 py-1 text-sm font-medium text-primary-foreground hover:hover-effect disabled:disabled-effect",
|
|
1812
1836
|
children: migrating ? "Migrating…" : "Migrate now"
|
|
1813
1837
|
}),
|
|
1814
1838
|
/* @__PURE__ */ jsx("button", {
|
|
1815
1839
|
type: "button",
|
|
1816
1840
|
disabled: migrating,
|
|
1817
1841
|
onClick: dismiss,
|
|
1818
|
-
className: "rounded-sm border border-
|
|
1842
|
+
className: "rounded-sm border border-foreground bg-transparent px-3 py-1 text-sm font-medium text-foreground hover:hover-effect disabled:disabled-effect",
|
|
1819
1843
|
children: "Dismiss"
|
|
1820
1844
|
})
|
|
1821
1845
|
]
|
|
@@ -1824,18 +1848,18 @@ const MigrationBanner = () => {
|
|
|
1824
1848
|
};
|
|
1825
1849
|
//#endregion
|
|
1826
1850
|
//#region src/components/modal/modals-container.tsx
|
|
1827
|
-
const AddDriveModal$1 = lazy(() => import("./AddDriveModal-
|
|
1828
|
-
const ClearStorageModal = lazy(() => import("./ClearStorageModal-
|
|
1851
|
+
const AddDriveModal$1 = lazy(() => import("./AddDriveModal-BoKLJyUY.js").then((m) => ({ default: m.AddDriveModal })));
|
|
1852
|
+
const ClearStorageModal = lazy(() => import("./ClearStorageModal-CXoNWmRe.js").then((m) => ({ default: m.ClearStorageModal })));
|
|
1829
1853
|
const CookiesPolicyModal = lazy(() => import("./CookiesPolicyModal-1nOh6oN3.js").then((m) => ({ default: m.CookiesPolicyModal })));
|
|
1830
1854
|
const CreateDocumentModal$1 = lazy(() => import("./CreateDocumentModal-nQbLVDq3.js").then((m) => ({ default: m.CreateDocumentModal })));
|
|
1831
|
-
const DebugSettingsModal = lazy(() => import("./DebugSettingsModal-
|
|
1855
|
+
const DebugSettingsModal = lazy(() => import("./DebugSettingsModal-BUjKyRCv.js").then((m) => ({ default: m.DebugSettingsModal })));
|
|
1832
1856
|
const DeleteDriveModal = lazy(() => import("./DeleteDriveModal-6P0T1QgD.js").then((m) => ({ default: m.DeleteDriveModal })));
|
|
1833
1857
|
const DeleteItemModal = lazy(() => import("./DeleteItemModal-BmV1aQyZ.js").then((m) => ({ default: m.DeleteItemModal })));
|
|
1834
1858
|
const DisclaimerModal = lazy(() => import("./DisclaimerModal-CVTFfN0_.js").then((m) => ({ default: m.DisclaimerModal })));
|
|
1835
|
-
const DriveSettingsModal$1 = lazy(() => import("./DriveSettingsModal-
|
|
1859
|
+
const DriveSettingsModal$1 = lazy(() => import("./DriveSettingsModal-CsNFEJ9E.js").then((m) => ({ default: m.DriveSettingsModal })));
|
|
1836
1860
|
const DownloadDocumentWithErrorsModal = lazy(() => import("./DownloadDocumentWithErrorsModal-CXeFUtaz.js").then((m) => ({ default: m.DownloadDocumentWithErrorsModal })));
|
|
1837
|
-
const SettingsModal$1 = lazy(() => import("./SettingsModal-
|
|
1838
|
-
const UpgradeDriveModal = lazy(() => import("./UpgradeDriveModal-
|
|
1861
|
+
const SettingsModal$1 = lazy(() => import("./SettingsModal-DI2_oVrF.js").then((m) => ({ default: m.SettingsModal })));
|
|
1862
|
+
const UpgradeDriveModal = lazy(() => import("./UpgradeDriveModal-C7lV4rAX.js").then((m) => ({ default: m.UpgradeDriveModal })));
|
|
1839
1863
|
const modalComponents = {
|
|
1840
1864
|
addDrive: AddDriveModal$1,
|
|
1841
1865
|
clearStorage: ClearStorageModal,
|
|
@@ -1847,10 +1871,11 @@ const modalComponents = {
|
|
|
1847
1871
|
disclaimer: DisclaimerModal,
|
|
1848
1872
|
driveSettings: DriveSettingsModal$1,
|
|
1849
1873
|
downloadDocumentWithErrors: DownloadDocumentWithErrorsModal,
|
|
1850
|
-
inspector: lazy(() => import("./InspectorModal-
|
|
1874
|
+
inspector: lazy(() => import("./InspectorModal-BsSihzuc.js").then((m) => ({ default: m.InspectorModal }))),
|
|
1851
1875
|
settings: SettingsModal$1,
|
|
1852
1876
|
upgradeDrive: UpgradeDriveModal,
|
|
1853
|
-
missingPackage: lazy(() => import("./MissingPackageModal-
|
|
1877
|
+
missingPackage: lazy(() => import("./MissingPackageModal-Bn036mWQ.js").then((m) => ({ default: m.ConnectMissingPackageModal }))),
|
|
1878
|
+
driveAuthRequired: lazy(() => import("./DriveAuthRequiredModal-B3VdLwSH.js").then((m) => ({ default: m.DriveAuthRequiredModal })))
|
|
1854
1879
|
};
|
|
1855
1880
|
const ModalsContainer = lazy(() => {
|
|
1856
1881
|
return Promise.resolve({ default: () => {
|
|
@@ -1870,7 +1895,7 @@ const ModalsContainer = lazy(() => {
|
|
|
1870
1895
|
//#endregion
|
|
1871
1896
|
//#region src/components/app-loader.tsx
|
|
1872
1897
|
const AppLoader = (props) => {
|
|
1873
|
-
const Load = lazy(() => import("./load-
|
|
1898
|
+
const Load = lazy(() => import("./load-9_rJ2u5a.js").then((m) => m.loadComponent(props.localPackage)));
|
|
1874
1899
|
return /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsxs(ErrorBoundary$1, {
|
|
1875
1900
|
fallbackRender: (props) => /* @__PURE__ */ jsx(AppSkeleton, { children: /* @__PURE__ */ jsx(DetailedFallback, { ...props }) }),
|
|
1876
1901
|
resetKeys: [props.localPackage],
|
|
@@ -1899,5 +1924,5 @@ const AppLoader = (props) => {
|
|
|
1899
1924
|
//#endregion
|
|
1900
1925
|
export { DocumentEditor as a, App as c, DocumentEditorContainer as d, OpenPanel as f, Root as i, AppContainer as l, AppSkeleton as m, Sidebar as n, DriveIcon as o, Analytics as p, Router as r, CookieBanner$1 as s, AppLoader as t, EditorLoader as u };
|
|
1901
1926
|
|
|
1902
|
-
//# sourceMappingURL=app-loader-
|
|
1903
|
-
//# debugId=
|
|
1927
|
+
//# sourceMappingURL=app-loader-HC9KrWYq.js.map
|
|
1928
|
+
//# debugId=5de9352d-c347-5789-abb0-91edaee27780
|