@powerhousedao/connect 6.2.2-dev.3 → 6.2.2-dev.31
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/assets/document-icon-192x192.png +0 -0
- package/assets/document-icon-512x512.png +0 -0
- package/assets/pwa-192x192.png +0 -0
- package/assets/pwa-512x512-maskable.png +0 -0
- package/assets/pwa-512x512.png +0 -0
- package/dist/{AddDriveModal-MMHlkJBJ.js → AddDriveModal-mTJUAV2Z.js} +5 -5
- package/dist/AddDriveModal-mTJUAV2Z.js.map +1 -0
- package/dist/{ClearStorageModal-RlmaMIyp.js → ClearStorageModal-D30zn7hF.js} +4 -4
- package/dist/{ClearStorageModal-RlmaMIyp.js.map → ClearStorageModal-D30zn7hF.js.map} +1 -1
- package/dist/{CookiesPolicyModal-CkcUKPLb.js → CookiesPolicyModal-Dpx-2TgP.js} +3 -3
- package/dist/{CookiesPolicyModal-CkcUKPLb.js.map → CookiesPolicyModal-Dpx-2TgP.js.map} +1 -1
- package/dist/{CreateDocumentModal-CvsTh0HM.js → CreateDocumentModal-u-IaJUQ0.js} +3 -3
- package/dist/{CreateDocumentModal-CvsTh0HM.js.map → CreateDocumentModal-u-IaJUQ0.js.map} +1 -1
- package/dist/{DebugSettingsModal-wrBrdvbW.js → DebugSettingsModal-CfXQgFFg.js} +6 -6
- package/dist/{DebugSettingsModal-wrBrdvbW.js.map → DebugSettingsModal-CfXQgFFg.js.map} +1 -1
- package/dist/{DeleteDriveModal-DSTK8FYk.js → DeleteDriveModal-CJKhWtli.js} +4 -4
- package/dist/{DeleteDriveModal-DSTK8FYk.js.map → DeleteDriveModal-CJKhWtli.js.map} +1 -1
- package/dist/{DeleteItemModal-B2nJmjsP.js → DeleteItemModal-DiieJw_o.js} +4 -4
- package/dist/{DeleteItemModal-B2nJmjsP.js.map → DeleteItemModal-DiieJw_o.js.map} +1 -1
- package/dist/{DisclaimerModal-D5FO34u9.js → DisclaimerModal-DAvYIF9-.js} +3 -3
- package/dist/{DisclaimerModal-D5FO34u9.js.map → DisclaimerModal-DAvYIF9-.js.map} +1 -1
- package/dist/{DownloadDocumentWithErrorsModal-tEr3bbtN.js → DownloadDocumentWithErrorsModal-CE4fa1k5.js} +3 -3
- package/dist/{DownloadDocumentWithErrorsModal-tEr3bbtN.js.map → DownloadDocumentWithErrorsModal-CE4fa1k5.js.map} +1 -1
- package/dist/DriveAuthRequiredModal-BQaAWHTe.js +36 -0
- package/dist/DriveAuthRequiredModal-BQaAWHTe.js.map +1 -0
- package/dist/{DriveSettingsModal-kR3hQnh4.js → DriveSettingsModal-CqFeWu4r.js} +3 -3
- package/dist/{DriveSettingsModal-kR3hQnh4.js.map → DriveSettingsModal-CqFeWu4r.js.map} +1 -1
- package/dist/{InspectorModal-AFMch1tJ.js → InspectorModal-yj4fJWTN.js} +6 -6
- package/dist/{InspectorModal-AFMch1tJ.js.map → InspectorModal-yj4fJWTN.js.map} +1 -1
- package/dist/LoginModal-CX0RlUEa.js +75 -0
- package/dist/LoginModal-CX0RlUEa.js.map +1 -0
- package/dist/{MissingPackageModal-BQcCQbOn.js → MissingPackageModal-C3acJ9r0.js} +18 -6
- package/dist/MissingPackageModal-C3acJ9r0.js.map +1 -0
- package/dist/OpenFileDocumentsModal-DI2ekUpP.js +293 -0
- package/dist/OpenFileDocumentsModal-DI2ekUpP.js.map +1 -0
- package/dist/{SettingsModal-D7d82WIw.js → SettingsModal-DpeELJpE.js} +26 -13
- package/dist/SettingsModal-DpeELJpE.js.map +1 -0
- package/dist/{UpgradeDriveModal-BZGSE9_r.js → UpgradeDriveModal-rUHyJTc7.js} +3 -3
- package/dist/{UpgradeDriveModal-BZGSE9_r.js.map → UpgradeDriveModal-rUHyJTc7.js.map} +1 -1
- package/dist/app-loader-BciF1tnb.js +4 -0
- package/dist/{app-loader-DRDD1kDU.js → app-loader-De5ykrjC.js} +345 -39
- package/dist/app-loader-De5ykrjC.js.map +1 -0
- package/dist/{build-info-Catqtg1-.js → build-info-d7VVqUQv.js} +5 -5
- package/dist/{build-info-Catqtg1-.js.map → build-info-d7VVqUQv.js.map} +1 -1
- package/dist/components-C0Ao-dTW.js +5 -0
- package/dist/{connect.config-vgUeFoNp.js → connect.config-C-b_Yhd6.js} +9 -4
- package/dist/connect.config-C-b_Yhd6.js.map +1 -0
- package/dist/{connection-state-DO_2lAEJ.js → connection-state-KCa1yljA.js} +4 -4
- package/dist/{connection-state-DO_2lAEJ.js.map → connection-state-KCa1yljA.js.map} +1 -1
- package/dist/{load-Ba2MrbCK.js → load-CHMu8r66.js} +10 -10
- package/dist/{load-Ba2MrbCK.js.map → load-CHMu8r66.js.map} +1 -1
- package/dist/main.js +1 -1
- package/dist/{package-BA70jfZK.js → package-3dLNfwNv.js} +8 -4
- package/dist/package-3dLNfwNv.js.map +1 -0
- package/dist/{pglite-seed-z3B1JA38.js → pglite-seed-DRXPe7p-.js} +4 -4
- package/dist/{pglite-seed-z3B1JA38.js.map → pglite-seed-DRXPe7p-.js.map} +1 -1
- package/dist/pwa-manifest-link-CG8UajMz.js +34 -0
- package/dist/pwa-manifest-link-CG8UajMz.js.map +1 -0
- package/dist/{reactor-NIC68X14.js → reactor-DumHjpgn.js} +154 -17
- package/dist/reactor-DumHjpgn.js.map +1 -0
- package/dist/reactor.worker.js +14 -8
- package/dist/reactor.worker.js.map +1 -1
- package/dist/{registerServiceWorker-nJIc0yEY.js → registerServiceWorker-Bn1KWmk0.js} +6 -4
- package/dist/registerServiceWorker-Bn1KWmk0.js.map +1 -0
- package/dist/{reload-connect-toast-D1Iqw9E_.js → reload-connect-toast-BkgP9i6_.js} +19 -3
- package/dist/{reload-connect-toast-D1Iqw9E_.js.map → reload-connect-toast-BkgP9i6_.js.map} +1 -1
- package/dist/start-connect.js +1 -1
- package/dist/style.css +64 -3
- package/dist/{toast-4t-VimvD.js → toast-BLv8rjmy.js} +3 -3
- package/dist/{toast-4t-VimvD.js.map → toast-BLv8rjmy.js.map} +1 -1
- package/dist/use-renown-login-BtGljnB4.js +52 -0
- package/dist/use-renown-login-BtGljnB4.js.map +1 -0
- package/dist/useRegistryPackages-DMhCvTWq.js +314 -0
- package/dist/useRegistryPackages-DMhCvTWq.js.map +1 -0
- package/package.json +15 -11
- package/dist/AddDriveModal-MMHlkJBJ.js.map +0 -1
- package/dist/DriveAuthRequiredModal-BA2vS3oF.js +0 -40
- package/dist/DriveAuthRequiredModal-BA2vS3oF.js.map +0 -1
- package/dist/MissingPackageModal-BQcCQbOn.js.map +0 -1
- package/dist/SettingsModal-D7d82WIw.js.map +0 -1
- package/dist/app-loader-BkjpA8jF.js +0 -4
- package/dist/app-loader-DRDD1kDU.js.map +0 -1
- package/dist/components-C6P7OHYq.js +0 -5
- package/dist/connect.config-vgUeFoNp.js.map +0 -1
- package/dist/package-BA70jfZK.js.map +0 -1
- package/dist/reactor-NIC68X14.js.map +0 -1
- package/dist/registerServiceWorker-nJIc0yEY.js.map +0 -1
- package/dist/useRegistryPackages-BaYtekjQ.js +0 -179
- package/dist/useRegistryPackages-BaYtekjQ.js.map +0 -1
|
@@ -1,19 +1,20 @@
|
|
|
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]="5d32f412-d28c-594d-aa01-226dd99b9e1e")}catch(e){}}();
|
|
3
3
|
import { n as getRuntimeConfig } from "./runtime-config-DL3QjcfM.js";
|
|
4
4
|
import { c as idbError } from "./pglite-major-B39aOEiE.js";
|
|
5
5
|
import { n as cloneFileData, r as migrateIdb } from "./pglite-migrate-core-Boxqqx-c.js";
|
|
6
|
-
import { i as i18n, n as setSentryModule } from "./reload-connect-toast-
|
|
7
|
-
import { a as defaultPHDocumentEditorConfig, i as defaultPHAppConfig, r as connectConfig } from "./connect.config-
|
|
8
|
-
import { f as PRIMARY_IDB_NAMES, r as subscribeWorkerConnection, s as getCachedMigrationMajor, t as getWorkerConnectionStatus, u as subscribeMigrationMajor } from "./connection-state-
|
|
9
|
-
import { n as serviceWorkerManager, r as subscribeServiceWorkerUpdate, t as getServiceWorkerUpdateAvailable } from "./registerServiceWorker-
|
|
10
|
-
import { n as toast, t as ToastContainer } from "./toast-
|
|
6
|
+
import { i as i18n, n as setSentryModule } from "./reload-connect-toast-BkgP9i6_.js";
|
|
7
|
+
import { a as defaultPHDocumentEditorConfig, i as defaultPHAppConfig, r as connectConfig } from "./connect.config-C-b_Yhd6.js";
|
|
8
|
+
import { f as PRIMARY_IDB_NAMES, r as subscribeWorkerConnection, s as getCachedMigrationMajor, t as getWorkerConnectionStatus, u as subscribeMigrationMajor } from "./connection-state-KCa1yljA.js";
|
|
9
|
+
import { n as serviceWorkerManager, r as subscribeServiceWorkerUpdate, t as getServiceWorkerUpdateAvailable } from "./registerServiceWorker-Bn1KWmk0.js";
|
|
10
|
+
import { n as toast, t as ToastContainer } from "./toast-BLv8rjmy.js";
|
|
11
|
+
import { t as useOpenRenownLogin } from "./use-renown-login-BtGljnB4.js";
|
|
11
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { Trans, useTranslation } from "react-i18next";
|
|
13
14
|
import React, { StrictMode, Suspense, lazy, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
14
|
-
import { DriveCollectionId, getRevisionFromDate, initTheme, logout,
|
|
15
|
+
import { DriveCollectionId, RenownWalletProvider, addFileWithProgress, getRevisionFromDate, initTheme, logout, setPHAppConfig, setPHDocumentEditorConfig, setRevisionHistoryVisible, setSelectedDrive, setSelectedNode, showPHModal, useAppModuleById, useConnectionStates, useDefaultAppModule, useDocumentById, useDocumentModelModuleById, useDocumentOperations, useDrives, useEditorModuleById, useEditorPreloader, useFallbackEditorModule, useIsAddDriveEnabled, useNodeParentFolderById, usePHModal, usePackageDiscoveryService, useReactorClientModule, useRevisionHistoryVisible, useSelectedDocument, useSelectedDocumentId, useSelectedDriveSafe, useSelectedFolder, useSelectedTimelineItem, useSyncList, useTheme, useUser, useVetraPackageManager, useVetraPackages } from "@powerhousedao/reactor-browser";
|
|
15
16
|
import { childLogger } from "document-model";
|
|
16
|
-
import { ConnectSidebar, ConnectTooltipProvider, CookieBanner, DefaultEditorLoader, DriveAuthGate, DropZoneWrapper, HomeScreen, HomeScreenAddDriveItem, HomeScreenItem, LogoAnimation, PackageInstallModal, RevisionHistory, SidebarAddDriveItem, SidebarItem, useEns } from "@powerhousedao/design-system/connect";
|
|
17
|
+
import { ConnectSidebar, ConnectTooltipProvider, CookieBanner, DefaultEditorLoader, DriveAuthGate, DropZoneWrapper, HomeScreen, HomeScreenAddDriveItem, HomeScreenItem, LogoAnimation, PackageInstallModal, RevisionHistory, SidebarAddDriveItem, SidebarItem, UploadFileListContainer, formatFileSize, mapProgressStageToStatus, useEns } from "@powerhousedao/design-system/connect";
|
|
17
18
|
import { z } from "zod";
|
|
18
19
|
import { Outlet, RouterProvider, createBrowserRouter, createRoutesFromChildren, matchRoutes, useLocation, useNavigationType } from "react-router-dom";
|
|
19
20
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
@@ -21,6 +22,10 @@ import { Icon, Modal, PowerhouseButton } from "@powerhousedao/design-system";
|
|
|
21
22
|
import { ErrorBoundary } from "react-error-boundary";
|
|
22
23
|
import { GenericDriveExplorer } from "@powerhousedao/powerhouse-vetra-packages/editors";
|
|
23
24
|
import { twMerge } from "tailwind-merge";
|
|
25
|
+
import { mockAdapter } from "@renown/sdk/wallet/mock";
|
|
26
|
+
import { privyAdapter } from "@renown/sdk/wallet/privy";
|
|
27
|
+
import { rainbowAdapter } from "@renown/sdk/wallet/rainbow";
|
|
28
|
+
import { arbitrum, base, mainnet, optimism, polygon, sepolia } from "wagmi/chains";
|
|
24
29
|
import { redo, undo } from "@powerhousedao/shared/document-model";
|
|
25
30
|
//#region src/utils/browser.ts
|
|
26
31
|
function getBasePath() {
|
|
@@ -75,6 +80,184 @@ var DocumentEditorDebugTools = class {
|
|
|
75
80
|
}
|
|
76
81
|
};
|
|
77
82
|
//#endregion
|
|
83
|
+
//#region src/utils/launch-queue.ts
|
|
84
|
+
let pendingImportFiles = [];
|
|
85
|
+
const pendingListeners = /* @__PURE__ */ new Set();
|
|
86
|
+
function notifyPendingListeners() {
|
|
87
|
+
for (const listener of pendingListeners) listener();
|
|
88
|
+
}
|
|
89
|
+
function getPendingImportFiles() {
|
|
90
|
+
return pendingImportFiles;
|
|
91
|
+
}
|
|
92
|
+
/** Stable identity of a pending file (also the picker's pre-check cache key). */
|
|
93
|
+
function pendingFileKey(file) {
|
|
94
|
+
return `${file.name}|${file.size}|${file.lastModified}`;
|
|
95
|
+
}
|
|
96
|
+
function addPendingImportFiles(files) {
|
|
97
|
+
const seen = new Set(pendingImportFiles.map(pendingFileKey));
|
|
98
|
+
const fresh = files.filter((file) => {
|
|
99
|
+
const key = pendingFileKey(file);
|
|
100
|
+
if (seen.has(key)) return false;
|
|
101
|
+
seen.add(key);
|
|
102
|
+
return true;
|
|
103
|
+
});
|
|
104
|
+
if (fresh.length === 0) return;
|
|
105
|
+
pendingImportFiles = [...pendingImportFiles, ...fresh];
|
|
106
|
+
notifyPendingListeners();
|
|
107
|
+
}
|
|
108
|
+
function clearPendingImportFiles() {
|
|
109
|
+
if (pendingImportFiles.length === 0) return;
|
|
110
|
+
pendingImportFiles = [];
|
|
111
|
+
notifyPendingListeners();
|
|
112
|
+
}
|
|
113
|
+
function subscribePendingImportFiles(cb) {
|
|
114
|
+
pendingListeners.add(cb);
|
|
115
|
+
return () => {
|
|
116
|
+
pendingListeners.delete(cb);
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
async function handleLaunchParams(params) {
|
|
120
|
+
const handles = params.files.filter((handle) => handle.kind === "file");
|
|
121
|
+
if (handles.length === 0) return;
|
|
122
|
+
const files = [];
|
|
123
|
+
for (const handle of handles) try {
|
|
124
|
+
files.push(await handle.getFile());
|
|
125
|
+
} catch (error) {
|
|
126
|
+
console.error("Failed to read launched file:", handle.name, error);
|
|
127
|
+
}
|
|
128
|
+
if (files.length === 0) return;
|
|
129
|
+
addPendingImportFiles(files);
|
|
130
|
+
showPHModal({ type: "openFileDocuments" });
|
|
131
|
+
}
|
|
132
|
+
function maybeReopenImportModal() {
|
|
133
|
+
if (getPendingImportFiles().length === 0) return;
|
|
134
|
+
if (window.ph?.modal !== void 0) return;
|
|
135
|
+
showPHModal({ type: "openFileDocuments" });
|
|
136
|
+
}
|
|
137
|
+
let initialized = false;
|
|
138
|
+
/**
|
|
139
|
+
* Register the launchQueue consumer that receives files opened with Connect
|
|
140
|
+
* through the OS file association. Idempotent (safe under StrictMode double
|
|
141
|
+
* effects) and a no-op where the File Handling API doesn't exist — Firefox,
|
|
142
|
+
* Safari, and any context without an installed PWA manifest simply never
|
|
143
|
+
* deliver launches.
|
|
144
|
+
*/
|
|
145
|
+
function initLaunchQueueFileHandling() {
|
|
146
|
+
if (initialized) return;
|
|
147
|
+
initialized = true;
|
|
148
|
+
window.addEventListener("ph:modalUpdated", maybeReopenImportModal);
|
|
149
|
+
window.launchQueue?.setConsumer((params) => {
|
|
150
|
+
handleLaunchParams(params);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region src/utils/open-file-uploads.ts
|
|
155
|
+
let uploads = [];
|
|
156
|
+
const listeners$3 = /* @__PURE__ */ new Set();
|
|
157
|
+
function notifyUploadListeners() {
|
|
158
|
+
for (const listener of listeners$3) listener();
|
|
159
|
+
}
|
|
160
|
+
function getOpenFileUploads() {
|
|
161
|
+
return uploads;
|
|
162
|
+
}
|
|
163
|
+
function subscribeOpenFileUploads(cb) {
|
|
164
|
+
listeners$3.add(cb);
|
|
165
|
+
return () => {
|
|
166
|
+
listeners$3.delete(cb);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function removeOpenFileUpload(id) {
|
|
170
|
+
const next = uploads.filter((upload) => upload.id !== id);
|
|
171
|
+
if (next.length === uploads.length) return;
|
|
172
|
+
uploads = next;
|
|
173
|
+
notifyUploadListeners();
|
|
174
|
+
}
|
|
175
|
+
function clearOpenFileUploads() {
|
|
176
|
+
if (uploads.length === 0) return;
|
|
177
|
+
uploads = [];
|
|
178
|
+
notifyUploadListeners();
|
|
179
|
+
}
|
|
180
|
+
function addOpenFileUploads(rows) {
|
|
181
|
+
uploads = [...uploads, ...rows];
|
|
182
|
+
notifyUploadListeners();
|
|
183
|
+
}
|
|
184
|
+
function patchOpenFileUpload(id, patch) {
|
|
185
|
+
uploads = uploads.map((upload) => upload.id === id ? {
|
|
186
|
+
...upload,
|
|
187
|
+
...patch
|
|
188
|
+
} : upload);
|
|
189
|
+
notifyUploadListeners();
|
|
190
|
+
}
|
|
191
|
+
let uploadCounter = 0;
|
|
192
|
+
let importChain = Promise.resolve();
|
|
193
|
+
/**
|
|
194
|
+
* Import one file and resolve once the flow truly ends. Completion is
|
|
195
|
+
* tracked through the progress stages, NOT the returned promise — the
|
|
196
|
+
* package-discovery retry path resolves early and keeps reporting through
|
|
197
|
+
* the callback. `resolveConflict: "duplicate"` is always passed: duplicates
|
|
198
|
+
* were resolved in the picker (rename), so the conflict stage must never
|
|
199
|
+
* fire — this also covers a duplicate appearing between pre-check and import.
|
|
200
|
+
*/
|
|
201
|
+
function importOne(row, driveId, documentTypes) {
|
|
202
|
+
return new Promise((resolve) => {
|
|
203
|
+
let settled = false;
|
|
204
|
+
const settle = (fileNode) => {
|
|
205
|
+
if (settled) return;
|
|
206
|
+
settled = true;
|
|
207
|
+
resolve(fileNode);
|
|
208
|
+
};
|
|
209
|
+
addFileWithProgress(row.file, driveId, row.name, void 0, (progress) => {
|
|
210
|
+
patchOpenFileUpload(row.id, {
|
|
211
|
+
status: mapProgressStageToStatus(progress.stage),
|
|
212
|
+
progress: progress.progress,
|
|
213
|
+
...progress.error ? { errorDetails: progress.error } : {},
|
|
214
|
+
...progress.documentType ? { documentType: progress.documentType } : {},
|
|
215
|
+
...progress.fileNode ? { fileNode: progress.fileNode } : {}
|
|
216
|
+
});
|
|
217
|
+
switch (progress.stage) {
|
|
218
|
+
case "complete":
|
|
219
|
+
settle(progress.fileNode);
|
|
220
|
+
break;
|
|
221
|
+
case "failed":
|
|
222
|
+
case "unsupported-document-type":
|
|
223
|
+
settle(void 0);
|
|
224
|
+
break;
|
|
225
|
+
default: break;
|
|
226
|
+
}
|
|
227
|
+
}, documentTypes, "duplicate").catch(() => {
|
|
228
|
+
settle(void 0);
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Run a confirmed batch of imports into a drive, feeding the floating upload
|
|
234
|
+
* panel. Rows appear immediately (queued), files import sequentially, and a
|
|
235
|
+
* single-file batch that succeeds opens its document in the editor.
|
|
236
|
+
*/
|
|
237
|
+
function runOpenFileImports(args) {
|
|
238
|
+
const { driveId, imports, documentTypes } = args;
|
|
239
|
+
if (imports.length === 0) return importChain;
|
|
240
|
+
const rows = imports.map(({ file, name }) => ({
|
|
241
|
+
id: `open-file-${++uploadCounter}`,
|
|
242
|
+
file,
|
|
243
|
+
name
|
|
244
|
+
}));
|
|
245
|
+
addOpenFileUploads(rows.map((row) => ({
|
|
246
|
+
id: row.id,
|
|
247
|
+
fileName: row.name,
|
|
248
|
+
fileSize: formatFileSize(row.file.size),
|
|
249
|
+
status: "pending",
|
|
250
|
+
progress: 0
|
|
251
|
+
})));
|
|
252
|
+
const run = async () => {
|
|
253
|
+
const results = [];
|
|
254
|
+
for (const row of rows) results.push(await importOne(row, driveId, documentTypes));
|
|
255
|
+
if (rows.length === 1 && results[0]) setSelectedNode(results[0]);
|
|
256
|
+
};
|
|
257
|
+
importChain = importChain.then(run, run);
|
|
258
|
+
return importChain;
|
|
259
|
+
}
|
|
260
|
+
//#endregion
|
|
78
261
|
//#region src/components/migration-status.ts
|
|
79
262
|
let current = null;
|
|
80
263
|
const listeners$2 = /* @__PURE__ */ new Set();
|
|
@@ -1106,16 +1289,38 @@ function canRetry(reason) {
|
|
|
1106
1289
|
}
|
|
1107
1290
|
function MissingModelBanner() {
|
|
1108
1291
|
const failed = useFailedInstallations();
|
|
1292
|
+
const discoveryService = usePackageDiscoveryService();
|
|
1109
1293
|
const [open, setOpen] = useState(false);
|
|
1294
|
+
const [dismissed, setDismissed] = useState(false);
|
|
1295
|
+
useEffect(() => {
|
|
1296
|
+
return discoveryService?.subscribeEvents((event) => {
|
|
1297
|
+
if (event.type === "load-failed") setDismissed(false);
|
|
1298
|
+
});
|
|
1299
|
+
}, [discoveryService]);
|
|
1110
1300
|
if (failed.length === 0) return null;
|
|
1111
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */
|
|
1112
|
-
className: "
|
|
1113
|
-
children:
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1301
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [dismissed ? null : /* @__PURE__ */ jsx("div", {
|
|
1302
|
+
className: "absolute inset-x-0 top-0 z-200 bg-background",
|
|
1303
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1304
|
+
className: "flex items-center justify-between gap-3 bg-warning/10 px-4 py-2 text-sm text-warning",
|
|
1305
|
+
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__ */ jsxs("div", {
|
|
1306
|
+
className: "flex items-center gap-2",
|
|
1307
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
1308
|
+
type: "button",
|
|
1309
|
+
onClick: () => setOpen(true),
|
|
1310
|
+
className: "rounded-md border border-warning bg-background px-3 py-1 text-warning hover:hover-effect",
|
|
1311
|
+
children: "View"
|
|
1312
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
1313
|
+
type: "button",
|
|
1314
|
+
onClick: () => setDismissed(true),
|
|
1315
|
+
"aria-label": "Dismiss",
|
|
1316
|
+
className: "flex items-center text-warning hover:hover-effect",
|
|
1317
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
1318
|
+
name: "XmarkLight",
|
|
1319
|
+
size: 16
|
|
1320
|
+
})
|
|
1321
|
+
})]
|
|
1322
|
+
})]
|
|
1323
|
+
})
|
|
1119
1324
|
}), /* @__PURE__ */ jsx(MissingModelDetailsModal, {
|
|
1120
1325
|
open,
|
|
1121
1326
|
failed,
|
|
@@ -1218,6 +1423,18 @@ function MissingModelDetailsModal(props) {
|
|
|
1218
1423
|
});
|
|
1219
1424
|
}
|
|
1220
1425
|
//#endregion
|
|
1426
|
+
//#region src/components/open-file-upload-list.tsx
|
|
1427
|
+
function OpenFileUploadList() {
|
|
1428
|
+
const uploads = useSyncExternalStore(subscribeOpenFileUploads, getOpenFileUploads);
|
|
1429
|
+
return /* @__PURE__ */ jsx(UploadFileListContainer, {
|
|
1430
|
+
uploadsArray: uploads,
|
|
1431
|
+
uploadsCount: uploads.length,
|
|
1432
|
+
removeUpload: removeOpenFileUpload,
|
|
1433
|
+
clearAllUploads: clearOpenFileUploads,
|
|
1434
|
+
setSelectedNode
|
|
1435
|
+
});
|
|
1436
|
+
}
|
|
1437
|
+
//#endregion
|
|
1221
1438
|
//#region src/components/package-install-prompt.tsx
|
|
1222
1439
|
function PackageInstallPrompt() {
|
|
1223
1440
|
const pendingInstallations = usePendingInstallations();
|
|
@@ -1233,6 +1450,87 @@ function PackageInstallPrompt() {
|
|
|
1233
1450
|
});
|
|
1234
1451
|
}
|
|
1235
1452
|
//#endregion
|
|
1453
|
+
//#region src/components/renown-adapter-descriptors.ts
|
|
1454
|
+
function describe(id, build) {
|
|
1455
|
+
try {
|
|
1456
|
+
return [build()];
|
|
1457
|
+
} catch (error) {
|
|
1458
|
+
console.error(`[connect] Ignoring the "${id}" wallet adapter: connect.renown.adapters.${id} was rejected.`, error);
|
|
1459
|
+
return [];
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
const CHAINS_BY_ID = new Map([
|
|
1463
|
+
mainnet,
|
|
1464
|
+
sepolia,
|
|
1465
|
+
polygon,
|
|
1466
|
+
optimism,
|
|
1467
|
+
arbitrum,
|
|
1468
|
+
base
|
|
1469
|
+
].map((chain) => [chain.id, chain]));
|
|
1470
|
+
function chainsFor(chainId) {
|
|
1471
|
+
if (chainId === void 0) return void 0;
|
|
1472
|
+
const chain = CHAINS_BY_ID.get(chainId);
|
|
1473
|
+
if (!chain) {
|
|
1474
|
+
console.error(`[connect] connect.renown.chainId ${chainId} is not a chain Connect can offer, so in-page sign-in will be rejected. Supported: ${[...CHAINS_BY_ID.keys()].join(", ")}.`);
|
|
1475
|
+
return;
|
|
1476
|
+
}
|
|
1477
|
+
return [chain];
|
|
1478
|
+
}
|
|
1479
|
+
/** Map Connect's declarative `connect.renown.adapters` config to the descriptors `RenownWalletProvider` takes. Array order sets the order of the login buttons. A rejected adapter config is dropped (logged), leaving the others working. `chainId` is `connect.renown.chainId`, the chain Renown issues credentials on. */
|
|
1480
|
+
function configToDescriptors(config, chainId) {
|
|
1481
|
+
if (!config) return [];
|
|
1482
|
+
const { rainbow, privy, mock } = config;
|
|
1483
|
+
const descriptors = [];
|
|
1484
|
+
const chains = chainsFor(chainId);
|
|
1485
|
+
if (rainbow) descriptors.push(...describe("rainbow", () => rainbowAdapter({
|
|
1486
|
+
...rainbow,
|
|
1487
|
+
...chains ? { chains } : {}
|
|
1488
|
+
})));
|
|
1489
|
+
if (privy) {
|
|
1490
|
+
const { appId, clientId, methods } = privy;
|
|
1491
|
+
if (appId) descriptors.push(...describe("privy", () => privyAdapter({
|
|
1492
|
+
appId,
|
|
1493
|
+
clientId,
|
|
1494
|
+
methods
|
|
1495
|
+
})));
|
|
1496
|
+
}
|
|
1497
|
+
if (mock) descriptors.push(...describe("mock", () => mockAdapter({
|
|
1498
|
+
...mock,
|
|
1499
|
+
methods: mock.methods
|
|
1500
|
+
})));
|
|
1501
|
+
return descriptors;
|
|
1502
|
+
}
|
|
1503
|
+
//#endregion
|
|
1504
|
+
//#region src/components/renown-wallet-providers.tsx
|
|
1505
|
+
function resolveColor(expr, fallback) {
|
|
1506
|
+
if (typeof document === "undefined") return fallback;
|
|
1507
|
+
const probe = document.createElement("span");
|
|
1508
|
+
probe.style.color = fallback;
|
|
1509
|
+
probe.style.color = expr;
|
|
1510
|
+
probe.style.display = "none";
|
|
1511
|
+
document.body.appendChild(probe);
|
|
1512
|
+
const resolved = getComputedStyle(probe).color;
|
|
1513
|
+
probe.remove();
|
|
1514
|
+
return resolved || fallback;
|
|
1515
|
+
}
|
|
1516
|
+
function RenownWalletProviders({ children }) {
|
|
1517
|
+
const config = getRuntimeConfig().connect.renown?.adapters;
|
|
1518
|
+
const chainId = getRuntimeConfig().connect.renown?.chainId;
|
|
1519
|
+
const { theme } = useTheme();
|
|
1520
|
+
const adapters = useMemo(() => configToDescriptors(config, chainId), [config, chainId]);
|
|
1521
|
+
const walletTheme = useMemo(() => adapters.length > 0 ? {
|
|
1522
|
+
mode: theme,
|
|
1523
|
+
accentColor: resolveColor("var(--primary)", "#0084ff"),
|
|
1524
|
+
accentColorForeground: resolveColor("var(--primary-foreground)", "#ffffff")
|
|
1525
|
+
} : void 0, [theme, adapters]);
|
|
1526
|
+
if (adapters.length === 0) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
1527
|
+
return /* @__PURE__ */ jsx(RenownWalletProvider, {
|
|
1528
|
+
adapters,
|
|
1529
|
+
theme: walletTheme,
|
|
1530
|
+
children
|
|
1531
|
+
});
|
|
1532
|
+
}
|
|
1533
|
+
//#endregion
|
|
1236
1534
|
//#region src/components/app.tsx
|
|
1237
1535
|
const App = () => {
|
|
1238
1536
|
useTheme();
|
|
@@ -1258,14 +1556,18 @@ const App = () => {
|
|
|
1258
1556
|
else if (connectConfig.offline) serviceWorkerManager.registerServiceWorker(false);
|
|
1259
1557
|
else serviceWorkerManager.unregisterAll();
|
|
1260
1558
|
}, []);
|
|
1261
|
-
|
|
1559
|
+
useEffect(() => {
|
|
1560
|
+
initLaunchQueueFileHandling();
|
|
1561
|
+
}, []);
|
|
1562
|
+
return /* @__PURE__ */ jsx(SentryProvider, { children: /* @__PURE__ */ jsxs(RenownWalletProviders, { children: [
|
|
1262
1563
|
/* @__PURE__ */ jsx(ToastContainer, { position: "bottom-right" }),
|
|
1263
1564
|
/* @__PURE__ */ jsx(MissingModelBanner, {}),
|
|
1264
1565
|
/* @__PURE__ */ jsx(Router, {}),
|
|
1566
|
+
/* @__PURE__ */ jsx(OpenFileUploadList, {}),
|
|
1265
1567
|
/* @__PURE__ */ jsx(PackageInstallPrompt, {}),
|
|
1266
1568
|
/* @__PURE__ */ jsx(Analytics, {}),
|
|
1267
1569
|
/* @__PURE__ */ jsx(OpenPanel, {})
|
|
1268
|
-
] });
|
|
1570
|
+
] }) });
|
|
1269
1571
|
};
|
|
1270
1572
|
//#endregion
|
|
1271
1573
|
//#region src/components/cookie-banner.tsx
|
|
@@ -1532,6 +1834,7 @@ function useDriveAuthGate() {
|
|
|
1532
1834
|
//#region src/pages/content.tsx
|
|
1533
1835
|
function Content() {
|
|
1534
1836
|
const { gate } = useDriveAuthGate();
|
|
1837
|
+
const openLogin = useOpenRenownLogin();
|
|
1535
1838
|
const [selectedDrive] = useSelectedDriveSafe();
|
|
1536
1839
|
const selectedFolder = useSelectedFolder();
|
|
1537
1840
|
const selectedDocumentId = useSelectedDocumentId();
|
|
@@ -1545,7 +1848,7 @@ function Content() {
|
|
|
1545
1848
|
className: "flex h-full items-center justify-center p-4",
|
|
1546
1849
|
children: /* @__PURE__ */ jsx(DriveAuthGate, {
|
|
1547
1850
|
mode: gate,
|
|
1548
|
-
onLogin:
|
|
1851
|
+
onLogin: openLogin,
|
|
1549
1852
|
onLogout: () => void logout()
|
|
1550
1853
|
})
|
|
1551
1854
|
}) : !selectedDocumentId && !selectedDrive && !selectedFolder ? /* @__PURE__ */ jsx(HomeScreenContainer, {}) : /* @__PURE__ */ jsx(AppContainer, {}) });
|
|
@@ -1613,6 +1916,7 @@ const Router = () => {
|
|
|
1613
1916
|
//#region src/components/sidebar.tsx
|
|
1614
1917
|
function Sidebar() {
|
|
1615
1918
|
const user = useUser();
|
|
1919
|
+
const openLogin = useOpenRenownLogin();
|
|
1616
1920
|
const drives = useDrives();
|
|
1617
1921
|
const isAddDriveEnabled = useIsAddDriveEnabled();
|
|
1618
1922
|
const [selectedDrive] = useSelectedDriveSafe();
|
|
@@ -1632,7 +1936,7 @@ function Sidebar() {
|
|
|
1632
1936
|
onClick: () => setSelectedDrive(void 0),
|
|
1633
1937
|
onClickSettings,
|
|
1634
1938
|
address: user?.address,
|
|
1635
|
-
onLogin:
|
|
1939
|
+
onLogin: openLogin,
|
|
1636
1940
|
onDisconnect: () => {
|
|
1637
1941
|
logout();
|
|
1638
1942
|
},
|
|
@@ -1789,18 +2093,18 @@ const MigrationBanner = () => {
|
|
|
1789
2093
|
};
|
|
1790
2094
|
//#endregion
|
|
1791
2095
|
//#region src/components/modal/modals-container.tsx
|
|
1792
|
-
const AddDriveModal$1 = lazy(() => import("./AddDriveModal-
|
|
1793
|
-
const ClearStorageModal = lazy(() => import("./ClearStorageModal-
|
|
1794
|
-
const CookiesPolicyModal = lazy(() => import("./CookiesPolicyModal-
|
|
1795
|
-
const CreateDocumentModal$1 = lazy(() => import("./CreateDocumentModal-
|
|
1796
|
-
const DebugSettingsModal = lazy(() => import("./DebugSettingsModal-
|
|
1797
|
-
const DeleteDriveModal = lazy(() => import("./DeleteDriveModal-
|
|
1798
|
-
const DeleteItemModal = lazy(() => import("./DeleteItemModal-
|
|
1799
|
-
const DisclaimerModal = lazy(() => import("./DisclaimerModal-
|
|
1800
|
-
const DriveSettingsModal$1 = lazy(() => import("./DriveSettingsModal-
|
|
1801
|
-
const DownloadDocumentWithErrorsModal = lazy(() => import("./DownloadDocumentWithErrorsModal-
|
|
1802
|
-
const SettingsModal$1 = lazy(() => import("./SettingsModal-
|
|
1803
|
-
const UpgradeDriveModal = lazy(() => import("./UpgradeDriveModal-
|
|
2096
|
+
const AddDriveModal$1 = lazy(() => import("./AddDriveModal-mTJUAV2Z.js").then((m) => ({ default: m.AddDriveModal })));
|
|
2097
|
+
const ClearStorageModal = lazy(() => import("./ClearStorageModal-D30zn7hF.js").then((m) => ({ default: m.ClearStorageModal })));
|
|
2098
|
+
const CookiesPolicyModal = lazy(() => import("./CookiesPolicyModal-Dpx-2TgP.js").then((m) => ({ default: m.CookiesPolicyModal })));
|
|
2099
|
+
const CreateDocumentModal$1 = lazy(() => import("./CreateDocumentModal-u-IaJUQ0.js").then((m) => ({ default: m.CreateDocumentModal })));
|
|
2100
|
+
const DebugSettingsModal = lazy(() => import("./DebugSettingsModal-CfXQgFFg.js").then((m) => ({ default: m.DebugSettingsModal })));
|
|
2101
|
+
const DeleteDriveModal = lazy(() => import("./DeleteDriveModal-CJKhWtli.js").then((m) => ({ default: m.DeleteDriveModal })));
|
|
2102
|
+
const DeleteItemModal = lazy(() => import("./DeleteItemModal-DiieJw_o.js").then((m) => ({ default: m.DeleteItemModal })));
|
|
2103
|
+
const DisclaimerModal = lazy(() => import("./DisclaimerModal-DAvYIF9-.js").then((m) => ({ default: m.DisclaimerModal })));
|
|
2104
|
+
const DriveSettingsModal$1 = lazy(() => import("./DriveSettingsModal-CqFeWu4r.js").then((m) => ({ default: m.DriveSettingsModal })));
|
|
2105
|
+
const DownloadDocumentWithErrorsModal = lazy(() => import("./DownloadDocumentWithErrorsModal-CE4fa1k5.js").then((m) => ({ default: m.DownloadDocumentWithErrorsModal })));
|
|
2106
|
+
const SettingsModal$1 = lazy(() => import("./SettingsModal-DpeELJpE.js").then((m) => ({ default: m.SettingsModal })));
|
|
2107
|
+
const UpgradeDriveModal = lazy(() => import("./UpgradeDriveModal-rUHyJTc7.js").then((m) => ({ default: m.UpgradeDriveModal })));
|
|
1804
2108
|
const modalComponents = {
|
|
1805
2109
|
addDrive: AddDriveModal$1,
|
|
1806
2110
|
clearStorage: ClearStorageModal,
|
|
@@ -1812,11 +2116,13 @@ const modalComponents = {
|
|
|
1812
2116
|
disclaimer: DisclaimerModal,
|
|
1813
2117
|
driveSettings: DriveSettingsModal$1,
|
|
1814
2118
|
downloadDocumentWithErrors: DownloadDocumentWithErrorsModal,
|
|
1815
|
-
inspector: lazy(() => import("./InspectorModal-
|
|
2119
|
+
inspector: lazy(() => import("./InspectorModal-yj4fJWTN.js").then((m) => ({ default: m.InspectorModal }))),
|
|
1816
2120
|
settings: SettingsModal$1,
|
|
1817
2121
|
upgradeDrive: UpgradeDriveModal,
|
|
1818
|
-
missingPackage: lazy(() => import("./MissingPackageModal-
|
|
1819
|
-
driveAuthRequired: lazy(() => import("./DriveAuthRequiredModal-
|
|
2122
|
+
missingPackage: lazy(() => import("./MissingPackageModal-C3acJ9r0.js").then((m) => ({ default: m.ConnectMissingPackageModal }))),
|
|
2123
|
+
driveAuthRequired: lazy(() => import("./DriveAuthRequiredModal-BQaAWHTe.js").then((m) => ({ default: m.DriveAuthRequiredModal }))),
|
|
2124
|
+
openFileDocuments: lazy(() => import("./OpenFileDocumentsModal-DI2ekUpP.js").then((m) => ({ default: m.OpenFileDocumentsModal }))),
|
|
2125
|
+
login: lazy(() => import("./LoginModal-CX0RlUEa.js").then((m) => ({ default: m.LoginModal })))
|
|
1820
2126
|
};
|
|
1821
2127
|
const ModalsContainer = lazy(() => {
|
|
1822
2128
|
return Promise.resolve({ default: () => {
|
|
@@ -1856,7 +2162,7 @@ const ServiceWorkerUpdatePrompt = () => {
|
|
|
1856
2162
|
//#endregion
|
|
1857
2163
|
//#region src/components/app-loader.tsx
|
|
1858
2164
|
const AppLoader = (props) => {
|
|
1859
|
-
const Load = lazy(() => import("./load-
|
|
2165
|
+
const Load = lazy(() => import("./load-CHMu8r66.js").then((m) => m.loadComponent(props.localPackage)));
|
|
1860
2166
|
return /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsxs(ErrorBoundary$1, {
|
|
1861
2167
|
fallbackRender: (props) => /* @__PURE__ */ jsx(AppSkeleton, { children: /* @__PURE__ */ jsx(DetailedFallback, { ...props }) }),
|
|
1862
2168
|
resetKeys: [props.localPackage],
|
|
@@ -1885,7 +2191,7 @@ const AppLoader = (props) => {
|
|
|
1885
2191
|
}) });
|
|
1886
2192
|
};
|
|
1887
2193
|
//#endregion
|
|
1888
|
-
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 };
|
|
2194
|
+
export { getPendingImportFiles as _, DocumentEditor as a, App as c, DocumentEditorContainer as d, OpenPanel as f, clearPendingImportFiles as g, runOpenFileImports as h, 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, pendingFileKey as v, subscribePendingImportFiles as y };
|
|
1889
2195
|
|
|
1890
|
-
//# sourceMappingURL=app-loader-
|
|
1891
|
-
//# debugId=
|
|
2196
|
+
//# sourceMappingURL=app-loader-De5ykrjC.js.map
|
|
2197
|
+
//# debugId=5d32f412-d28c-594d-aa01-226dd99b9e1e
|