@powerhousedao/connect 6.2.2-dev.2 → 6.2.2-dev.20
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-Cy4_b0wO.js} +4 -4
- package/dist/{AddDriveModal-MMHlkJBJ.js.map → AddDriveModal-Cy4_b0wO.js.map} +1 -1
- package/dist/{ClearStorageModal-CFBQ3g2W.js → ClearStorageModal-DzbBamBg.js} +4 -4
- package/dist/{ClearStorageModal-CFBQ3g2W.js.map → ClearStorageModal-DzbBamBg.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-Rbn2aHS5.js → DebugSettingsModal-B64Dd6MI.js} +6 -6
- package/dist/{DebugSettingsModal-Rbn2aHS5.js.map → DebugSettingsModal-B64Dd6MI.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-DSM6uNlb.js +36 -0
- package/dist/DriveAuthRequiredModal-DSM6uNlb.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-D2BipxVV.js → InspectorModal-B9EdY0kb.js} +6 -6
- package/dist/{InspectorModal-D2BipxVV.js.map → InspectorModal-B9EdY0kb.js.map} +1 -1
- package/dist/LoginModal-BGTKLJx0.js +75 -0
- package/dist/LoginModal-BGTKLJx0.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-V2KByPpZ.js +293 -0
- package/dist/OpenFileDocumentsModal-V2KByPpZ.js.map +1 -0
- package/dist/{SettingsModal-C3gueGaR.js → SettingsModal-Cqb-1c4T.js} +26 -13
- package/dist/SettingsModal-Cqb-1c4T.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-CuI4Pvun.js → app-loader-C4GMxAYB.js} +288 -39
- package/dist/app-loader-C4GMxAYB.js.map +1 -0
- package/dist/app-loader-gXQFs-oQ.js +4 -0
- package/dist/{build-info-DRFIgMZ5.js → build-info-D48uD8Uk.js} +5 -5
- package/dist/{build-info-DRFIgMZ5.js.map → build-info-D48uD8Uk.js.map} +1 -1
- package/dist/components-BjuHdG8Q.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-D7Bd6r8L.js → load-C1TQWaRI.js} +10 -10
- package/dist/{load-D7Bd6r8L.js.map → load-C1TQWaRI.js.map} +1 -1
- package/dist/main.js +1 -1
- package/dist/{package-nOMk-HnW.js → package-BosGa7CE.js} +8 -4
- package/dist/package-BosGa7CE.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-DNtlhToA.js → reactor-DEFv5EuZ.js} +145 -14
- package/dist/reactor-DEFv5EuZ.js.map +1 -0
- package/dist/reactor.worker.js +9 -5
- 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-DBujbqs8.js +55 -0
- package/dist/use-renown-login-DBujbqs8.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/DriveAuthRequiredModal-BA2vS3oF.js +0 -40
- package/dist/DriveAuthRequiredModal-BA2vS3oF.js.map +0 -1
- package/dist/MissingPackageModal-BQcCQbOn.js.map +0 -1
- package/dist/SettingsModal-C3gueGaR.js.map +0 -1
- package/dist/app-loader-CuI4Pvun.js.map +0 -1
- package/dist/app-loader-DGIZ2168.js +0 -4
- package/dist/components-L890idPs.js +0 -5
- package/dist/connect.config-vgUeFoNp.js.map +0 -1
- package/dist/package-nOMk-HnW.js.map +0 -1
- package/dist/reactor-DNtlhToA.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]="fe0f49a2-5e6c-5a37-b864-71ff7d56b29f")}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-DBujbqs8.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";
|
|
@@ -75,6 +76,184 @@ var DocumentEditorDebugTools = class {
|
|
|
75
76
|
}
|
|
76
77
|
};
|
|
77
78
|
//#endregion
|
|
79
|
+
//#region src/utils/launch-queue.ts
|
|
80
|
+
let pendingImportFiles = [];
|
|
81
|
+
const pendingListeners = /* @__PURE__ */ new Set();
|
|
82
|
+
function notifyPendingListeners() {
|
|
83
|
+
for (const listener of pendingListeners) listener();
|
|
84
|
+
}
|
|
85
|
+
function getPendingImportFiles() {
|
|
86
|
+
return pendingImportFiles;
|
|
87
|
+
}
|
|
88
|
+
/** Stable identity of a pending file (also the picker's pre-check cache key). */
|
|
89
|
+
function pendingFileKey(file) {
|
|
90
|
+
return `${file.name}|${file.size}|${file.lastModified}`;
|
|
91
|
+
}
|
|
92
|
+
function addPendingImportFiles(files) {
|
|
93
|
+
const seen = new Set(pendingImportFiles.map(pendingFileKey));
|
|
94
|
+
const fresh = files.filter((file) => {
|
|
95
|
+
const key = pendingFileKey(file);
|
|
96
|
+
if (seen.has(key)) return false;
|
|
97
|
+
seen.add(key);
|
|
98
|
+
return true;
|
|
99
|
+
});
|
|
100
|
+
if (fresh.length === 0) return;
|
|
101
|
+
pendingImportFiles = [...pendingImportFiles, ...fresh];
|
|
102
|
+
notifyPendingListeners();
|
|
103
|
+
}
|
|
104
|
+
function clearPendingImportFiles() {
|
|
105
|
+
if (pendingImportFiles.length === 0) return;
|
|
106
|
+
pendingImportFiles = [];
|
|
107
|
+
notifyPendingListeners();
|
|
108
|
+
}
|
|
109
|
+
function subscribePendingImportFiles(cb) {
|
|
110
|
+
pendingListeners.add(cb);
|
|
111
|
+
return () => {
|
|
112
|
+
pendingListeners.delete(cb);
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
async function handleLaunchParams(params) {
|
|
116
|
+
const handles = params.files.filter((handle) => handle.kind === "file");
|
|
117
|
+
if (handles.length === 0) return;
|
|
118
|
+
const files = [];
|
|
119
|
+
for (const handle of handles) try {
|
|
120
|
+
files.push(await handle.getFile());
|
|
121
|
+
} catch (error) {
|
|
122
|
+
console.error("Failed to read launched file:", handle.name, error);
|
|
123
|
+
}
|
|
124
|
+
if (files.length === 0) return;
|
|
125
|
+
addPendingImportFiles(files);
|
|
126
|
+
showPHModal({ type: "openFileDocuments" });
|
|
127
|
+
}
|
|
128
|
+
function maybeReopenImportModal() {
|
|
129
|
+
if (getPendingImportFiles().length === 0) return;
|
|
130
|
+
if (window.ph?.modal !== void 0) return;
|
|
131
|
+
showPHModal({ type: "openFileDocuments" });
|
|
132
|
+
}
|
|
133
|
+
let initialized = false;
|
|
134
|
+
/**
|
|
135
|
+
* Register the launchQueue consumer that receives files opened with Connect
|
|
136
|
+
* through the OS file association. Idempotent (safe under StrictMode double
|
|
137
|
+
* effects) and a no-op where the File Handling API doesn't exist — Firefox,
|
|
138
|
+
* Safari, and any context without an installed PWA manifest simply never
|
|
139
|
+
* deliver launches.
|
|
140
|
+
*/
|
|
141
|
+
function initLaunchQueueFileHandling() {
|
|
142
|
+
if (initialized) return;
|
|
143
|
+
initialized = true;
|
|
144
|
+
window.addEventListener("ph:modalUpdated", maybeReopenImportModal);
|
|
145
|
+
window.launchQueue?.setConsumer((params) => {
|
|
146
|
+
handleLaunchParams(params);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/utils/open-file-uploads.ts
|
|
151
|
+
let uploads = [];
|
|
152
|
+
const listeners$3 = /* @__PURE__ */ new Set();
|
|
153
|
+
function notifyUploadListeners() {
|
|
154
|
+
for (const listener of listeners$3) listener();
|
|
155
|
+
}
|
|
156
|
+
function getOpenFileUploads() {
|
|
157
|
+
return uploads;
|
|
158
|
+
}
|
|
159
|
+
function subscribeOpenFileUploads(cb) {
|
|
160
|
+
listeners$3.add(cb);
|
|
161
|
+
return () => {
|
|
162
|
+
listeners$3.delete(cb);
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function removeOpenFileUpload(id) {
|
|
166
|
+
const next = uploads.filter((upload) => upload.id !== id);
|
|
167
|
+
if (next.length === uploads.length) return;
|
|
168
|
+
uploads = next;
|
|
169
|
+
notifyUploadListeners();
|
|
170
|
+
}
|
|
171
|
+
function clearOpenFileUploads() {
|
|
172
|
+
if (uploads.length === 0) return;
|
|
173
|
+
uploads = [];
|
|
174
|
+
notifyUploadListeners();
|
|
175
|
+
}
|
|
176
|
+
function addOpenFileUploads(rows) {
|
|
177
|
+
uploads = [...uploads, ...rows];
|
|
178
|
+
notifyUploadListeners();
|
|
179
|
+
}
|
|
180
|
+
function patchOpenFileUpload(id, patch) {
|
|
181
|
+
uploads = uploads.map((upload) => upload.id === id ? {
|
|
182
|
+
...upload,
|
|
183
|
+
...patch
|
|
184
|
+
} : upload);
|
|
185
|
+
notifyUploadListeners();
|
|
186
|
+
}
|
|
187
|
+
let uploadCounter = 0;
|
|
188
|
+
let importChain = Promise.resolve();
|
|
189
|
+
/**
|
|
190
|
+
* Import one file and resolve once the flow truly ends. Completion is
|
|
191
|
+
* tracked through the progress stages, NOT the returned promise — the
|
|
192
|
+
* package-discovery retry path resolves early and keeps reporting through
|
|
193
|
+
* the callback. `resolveConflict: "duplicate"` is always passed: duplicates
|
|
194
|
+
* were resolved in the picker (rename), so the conflict stage must never
|
|
195
|
+
* fire — this also covers a duplicate appearing between pre-check and import.
|
|
196
|
+
*/
|
|
197
|
+
function importOne(row, driveId, documentTypes) {
|
|
198
|
+
return new Promise((resolve) => {
|
|
199
|
+
let settled = false;
|
|
200
|
+
const settle = (fileNode) => {
|
|
201
|
+
if (settled) return;
|
|
202
|
+
settled = true;
|
|
203
|
+
resolve(fileNode);
|
|
204
|
+
};
|
|
205
|
+
addFileWithProgress(row.file, driveId, row.name, void 0, (progress) => {
|
|
206
|
+
patchOpenFileUpload(row.id, {
|
|
207
|
+
status: mapProgressStageToStatus(progress.stage),
|
|
208
|
+
progress: progress.progress,
|
|
209
|
+
...progress.error ? { errorDetails: progress.error } : {},
|
|
210
|
+
...progress.documentType ? { documentType: progress.documentType } : {},
|
|
211
|
+
...progress.fileNode ? { fileNode: progress.fileNode } : {}
|
|
212
|
+
});
|
|
213
|
+
switch (progress.stage) {
|
|
214
|
+
case "complete":
|
|
215
|
+
settle(progress.fileNode);
|
|
216
|
+
break;
|
|
217
|
+
case "failed":
|
|
218
|
+
case "unsupported-document-type":
|
|
219
|
+
settle(void 0);
|
|
220
|
+
break;
|
|
221
|
+
default: break;
|
|
222
|
+
}
|
|
223
|
+
}, documentTypes, "duplicate").catch(() => {
|
|
224
|
+
settle(void 0);
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Run a confirmed batch of imports into a drive, feeding the floating upload
|
|
230
|
+
* panel. Rows appear immediately (queued), files import sequentially, and a
|
|
231
|
+
* single-file batch that succeeds opens its document in the editor.
|
|
232
|
+
*/
|
|
233
|
+
function runOpenFileImports(args) {
|
|
234
|
+
const { driveId, imports, documentTypes } = args;
|
|
235
|
+
if (imports.length === 0) return importChain;
|
|
236
|
+
const rows = imports.map(({ file, name }) => ({
|
|
237
|
+
id: `open-file-${++uploadCounter}`,
|
|
238
|
+
file,
|
|
239
|
+
name
|
|
240
|
+
}));
|
|
241
|
+
addOpenFileUploads(rows.map((row) => ({
|
|
242
|
+
id: row.id,
|
|
243
|
+
fileName: row.name,
|
|
244
|
+
fileSize: formatFileSize(row.file.size),
|
|
245
|
+
status: "pending",
|
|
246
|
+
progress: 0
|
|
247
|
+
})));
|
|
248
|
+
const run = async () => {
|
|
249
|
+
const results = [];
|
|
250
|
+
for (const row of rows) results.push(await importOne(row, driveId, documentTypes));
|
|
251
|
+
if (rows.length === 1 && results[0]) setSelectedNode(results[0]);
|
|
252
|
+
};
|
|
253
|
+
importChain = importChain.then(run, run);
|
|
254
|
+
return importChain;
|
|
255
|
+
}
|
|
256
|
+
//#endregion
|
|
78
257
|
//#region src/components/migration-status.ts
|
|
79
258
|
let current = null;
|
|
80
259
|
const listeners$2 = /* @__PURE__ */ new Set();
|
|
@@ -1106,16 +1285,38 @@ function canRetry(reason) {
|
|
|
1106
1285
|
}
|
|
1107
1286
|
function MissingModelBanner() {
|
|
1108
1287
|
const failed = useFailedInstallations();
|
|
1288
|
+
const discoveryService = usePackageDiscoveryService();
|
|
1109
1289
|
const [open, setOpen] = useState(false);
|
|
1290
|
+
const [dismissed, setDismissed] = useState(false);
|
|
1291
|
+
useEffect(() => {
|
|
1292
|
+
return discoveryService?.subscribeEvents((event) => {
|
|
1293
|
+
if (event.type === "load-failed") setDismissed(false);
|
|
1294
|
+
});
|
|
1295
|
+
}, [discoveryService]);
|
|
1110
1296
|
if (failed.length === 0) return null;
|
|
1111
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */
|
|
1112
|
-
className: "
|
|
1113
|
-
children:
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1297
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [dismissed ? null : /* @__PURE__ */ jsx("div", {
|
|
1298
|
+
className: "absolute inset-x-0 top-0 z-200 bg-background",
|
|
1299
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1300
|
+
className: "flex items-center justify-between gap-3 bg-warning/10 px-4 py-2 text-sm text-warning",
|
|
1301
|
+
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", {
|
|
1302
|
+
className: "flex items-center gap-2",
|
|
1303
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
1304
|
+
type: "button",
|
|
1305
|
+
onClick: () => setOpen(true),
|
|
1306
|
+
className: "rounded-md border border-warning bg-background px-3 py-1 text-warning hover:hover-effect",
|
|
1307
|
+
children: "View"
|
|
1308
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
1309
|
+
type: "button",
|
|
1310
|
+
onClick: () => setDismissed(true),
|
|
1311
|
+
"aria-label": "Dismiss",
|
|
1312
|
+
className: "flex items-center text-warning hover:hover-effect",
|
|
1313
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
1314
|
+
name: "XmarkLight",
|
|
1315
|
+
size: 16
|
|
1316
|
+
})
|
|
1317
|
+
})]
|
|
1318
|
+
})]
|
|
1319
|
+
})
|
|
1119
1320
|
}), /* @__PURE__ */ jsx(MissingModelDetailsModal, {
|
|
1120
1321
|
open,
|
|
1121
1322
|
failed,
|
|
@@ -1218,6 +1419,18 @@ function MissingModelDetailsModal(props) {
|
|
|
1218
1419
|
});
|
|
1219
1420
|
}
|
|
1220
1421
|
//#endregion
|
|
1422
|
+
//#region src/components/open-file-upload-list.tsx
|
|
1423
|
+
function OpenFileUploadList() {
|
|
1424
|
+
const uploads = useSyncExternalStore(subscribeOpenFileUploads, getOpenFileUploads);
|
|
1425
|
+
return /* @__PURE__ */ jsx(UploadFileListContainer, {
|
|
1426
|
+
uploadsArray: uploads,
|
|
1427
|
+
uploadsCount: uploads.length,
|
|
1428
|
+
removeUpload: removeOpenFileUpload,
|
|
1429
|
+
clearAllUploads: clearOpenFileUploads,
|
|
1430
|
+
setSelectedNode
|
|
1431
|
+
});
|
|
1432
|
+
}
|
|
1433
|
+
//#endregion
|
|
1221
1434
|
//#region src/components/package-install-prompt.tsx
|
|
1222
1435
|
function PackageInstallPrompt() {
|
|
1223
1436
|
const pendingInstallations = usePendingInstallations();
|
|
@@ -1233,6 +1446,34 @@ function PackageInstallPrompt() {
|
|
|
1233
1446
|
});
|
|
1234
1447
|
}
|
|
1235
1448
|
//#endregion
|
|
1449
|
+
//#region src/components/renown-wallet-providers.tsx
|
|
1450
|
+
function resolveColor(expr, fallback) {
|
|
1451
|
+
if (typeof document === "undefined") return fallback;
|
|
1452
|
+
const probe = document.createElement("span");
|
|
1453
|
+
probe.style.color = fallback;
|
|
1454
|
+
probe.style.color = expr;
|
|
1455
|
+
probe.style.display = "none";
|
|
1456
|
+
document.body.appendChild(probe);
|
|
1457
|
+
const resolved = getComputedStyle(probe).color;
|
|
1458
|
+
probe.remove();
|
|
1459
|
+
return resolved || fallback;
|
|
1460
|
+
}
|
|
1461
|
+
function RenownWalletProviders({ children }) {
|
|
1462
|
+
const adapters = getRuntimeConfig().connect.renown?.adapters;
|
|
1463
|
+
const { theme } = useTheme();
|
|
1464
|
+
const walletTheme = useMemo(() => adapters ? {
|
|
1465
|
+
mode: theme,
|
|
1466
|
+
accentColor: resolveColor("var(--primary)", "#0084ff"),
|
|
1467
|
+
accentColorForeground: resolveColor("var(--primary-foreground)", "#ffffff")
|
|
1468
|
+
} : void 0, [theme, adapters]);
|
|
1469
|
+
if (!adapters) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
1470
|
+
return /* @__PURE__ */ jsx(RenownWalletProvider, {
|
|
1471
|
+
adapters,
|
|
1472
|
+
theme: walletTheme,
|
|
1473
|
+
children
|
|
1474
|
+
});
|
|
1475
|
+
}
|
|
1476
|
+
//#endregion
|
|
1236
1477
|
//#region src/components/app.tsx
|
|
1237
1478
|
const App = () => {
|
|
1238
1479
|
useTheme();
|
|
@@ -1258,14 +1499,18 @@ const App = () => {
|
|
|
1258
1499
|
else if (connectConfig.offline) serviceWorkerManager.registerServiceWorker(false);
|
|
1259
1500
|
else serviceWorkerManager.unregisterAll();
|
|
1260
1501
|
}, []);
|
|
1261
|
-
|
|
1502
|
+
useEffect(() => {
|
|
1503
|
+
initLaunchQueueFileHandling();
|
|
1504
|
+
}, []);
|
|
1505
|
+
return /* @__PURE__ */ jsx(SentryProvider, { children: /* @__PURE__ */ jsxs(RenownWalletProviders, { children: [
|
|
1262
1506
|
/* @__PURE__ */ jsx(ToastContainer, { position: "bottom-right" }),
|
|
1263
1507
|
/* @__PURE__ */ jsx(MissingModelBanner, {}),
|
|
1264
1508
|
/* @__PURE__ */ jsx(Router, {}),
|
|
1509
|
+
/* @__PURE__ */ jsx(OpenFileUploadList, {}),
|
|
1265
1510
|
/* @__PURE__ */ jsx(PackageInstallPrompt, {}),
|
|
1266
1511
|
/* @__PURE__ */ jsx(Analytics, {}),
|
|
1267
1512
|
/* @__PURE__ */ jsx(OpenPanel, {})
|
|
1268
|
-
] });
|
|
1513
|
+
] }) });
|
|
1269
1514
|
};
|
|
1270
1515
|
//#endregion
|
|
1271
1516
|
//#region src/components/cookie-banner.tsx
|
|
@@ -1532,6 +1777,7 @@ function useDriveAuthGate() {
|
|
|
1532
1777
|
//#region src/pages/content.tsx
|
|
1533
1778
|
function Content() {
|
|
1534
1779
|
const { gate } = useDriveAuthGate();
|
|
1780
|
+
const openLogin = useOpenRenownLogin();
|
|
1535
1781
|
const [selectedDrive] = useSelectedDriveSafe();
|
|
1536
1782
|
const selectedFolder = useSelectedFolder();
|
|
1537
1783
|
const selectedDocumentId = useSelectedDocumentId();
|
|
@@ -1545,7 +1791,7 @@ function Content() {
|
|
|
1545
1791
|
className: "flex h-full items-center justify-center p-4",
|
|
1546
1792
|
children: /* @__PURE__ */ jsx(DriveAuthGate, {
|
|
1547
1793
|
mode: gate,
|
|
1548
|
-
onLogin:
|
|
1794
|
+
onLogin: openLogin,
|
|
1549
1795
|
onLogout: () => void logout()
|
|
1550
1796
|
})
|
|
1551
1797
|
}) : !selectedDocumentId && !selectedDrive && !selectedFolder ? /* @__PURE__ */ jsx(HomeScreenContainer, {}) : /* @__PURE__ */ jsx(AppContainer, {}) });
|
|
@@ -1613,6 +1859,7 @@ const Router = () => {
|
|
|
1613
1859
|
//#region src/components/sidebar.tsx
|
|
1614
1860
|
function Sidebar() {
|
|
1615
1861
|
const user = useUser();
|
|
1862
|
+
const openLogin = useOpenRenownLogin();
|
|
1616
1863
|
const drives = useDrives();
|
|
1617
1864
|
const isAddDriveEnabled = useIsAddDriveEnabled();
|
|
1618
1865
|
const [selectedDrive] = useSelectedDriveSafe();
|
|
@@ -1632,7 +1879,7 @@ function Sidebar() {
|
|
|
1632
1879
|
onClick: () => setSelectedDrive(void 0),
|
|
1633
1880
|
onClickSettings,
|
|
1634
1881
|
address: user?.address,
|
|
1635
|
-
onLogin:
|
|
1882
|
+
onLogin: openLogin,
|
|
1636
1883
|
onDisconnect: () => {
|
|
1637
1884
|
logout();
|
|
1638
1885
|
},
|
|
@@ -1789,18 +2036,18 @@ const MigrationBanner = () => {
|
|
|
1789
2036
|
};
|
|
1790
2037
|
//#endregion
|
|
1791
2038
|
//#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-
|
|
2039
|
+
const AddDriveModal$1 = lazy(() => import("./AddDriveModal-Cy4_b0wO.js").then((m) => ({ default: m.AddDriveModal })));
|
|
2040
|
+
const ClearStorageModal = lazy(() => import("./ClearStorageModal-DzbBamBg.js").then((m) => ({ default: m.ClearStorageModal })));
|
|
2041
|
+
const CookiesPolicyModal = lazy(() => import("./CookiesPolicyModal-Dpx-2TgP.js").then((m) => ({ default: m.CookiesPolicyModal })));
|
|
2042
|
+
const CreateDocumentModal$1 = lazy(() => import("./CreateDocumentModal-u-IaJUQ0.js").then((m) => ({ default: m.CreateDocumentModal })));
|
|
2043
|
+
const DebugSettingsModal = lazy(() => import("./DebugSettingsModal-B64Dd6MI.js").then((m) => ({ default: m.DebugSettingsModal })));
|
|
2044
|
+
const DeleteDriveModal = lazy(() => import("./DeleteDriveModal-CJKhWtli.js").then((m) => ({ default: m.DeleteDriveModal })));
|
|
2045
|
+
const DeleteItemModal = lazy(() => import("./DeleteItemModal-DiieJw_o.js").then((m) => ({ default: m.DeleteItemModal })));
|
|
2046
|
+
const DisclaimerModal = lazy(() => import("./DisclaimerModal-DAvYIF9-.js").then((m) => ({ default: m.DisclaimerModal })));
|
|
2047
|
+
const DriveSettingsModal$1 = lazy(() => import("./DriveSettingsModal-CqFeWu4r.js").then((m) => ({ default: m.DriveSettingsModal })));
|
|
2048
|
+
const DownloadDocumentWithErrorsModal = lazy(() => import("./DownloadDocumentWithErrorsModal-CE4fa1k5.js").then((m) => ({ default: m.DownloadDocumentWithErrorsModal })));
|
|
2049
|
+
const SettingsModal$1 = lazy(() => import("./SettingsModal-Cqb-1c4T.js").then((m) => ({ default: m.SettingsModal })));
|
|
2050
|
+
const UpgradeDriveModal = lazy(() => import("./UpgradeDriveModal-rUHyJTc7.js").then((m) => ({ default: m.UpgradeDriveModal })));
|
|
1804
2051
|
const modalComponents = {
|
|
1805
2052
|
addDrive: AddDriveModal$1,
|
|
1806
2053
|
clearStorage: ClearStorageModal,
|
|
@@ -1812,11 +2059,13 @@ const modalComponents = {
|
|
|
1812
2059
|
disclaimer: DisclaimerModal,
|
|
1813
2060
|
driveSettings: DriveSettingsModal$1,
|
|
1814
2061
|
downloadDocumentWithErrors: DownloadDocumentWithErrorsModal,
|
|
1815
|
-
inspector: lazy(() => import("./InspectorModal-
|
|
2062
|
+
inspector: lazy(() => import("./InspectorModal-B9EdY0kb.js").then((m) => ({ default: m.InspectorModal }))),
|
|
1816
2063
|
settings: SettingsModal$1,
|
|
1817
2064
|
upgradeDrive: UpgradeDriveModal,
|
|
1818
|
-
missingPackage: lazy(() => import("./MissingPackageModal-
|
|
1819
|
-
driveAuthRequired: lazy(() => import("./DriveAuthRequiredModal-
|
|
2065
|
+
missingPackage: lazy(() => import("./MissingPackageModal-C3acJ9r0.js").then((m) => ({ default: m.ConnectMissingPackageModal }))),
|
|
2066
|
+
driveAuthRequired: lazy(() => import("./DriveAuthRequiredModal-DSM6uNlb.js").then((m) => ({ default: m.DriveAuthRequiredModal }))),
|
|
2067
|
+
openFileDocuments: lazy(() => import("./OpenFileDocumentsModal-V2KByPpZ.js").then((m) => ({ default: m.OpenFileDocumentsModal }))),
|
|
2068
|
+
login: lazy(() => import("./LoginModal-BGTKLJx0.js").then((m) => ({ default: m.LoginModal })))
|
|
1820
2069
|
};
|
|
1821
2070
|
const ModalsContainer = lazy(() => {
|
|
1822
2071
|
return Promise.resolve({ default: () => {
|
|
@@ -1856,7 +2105,7 @@ const ServiceWorkerUpdatePrompt = () => {
|
|
|
1856
2105
|
//#endregion
|
|
1857
2106
|
//#region src/components/app-loader.tsx
|
|
1858
2107
|
const AppLoader = (props) => {
|
|
1859
|
-
const Load = lazy(() => import("./load-
|
|
2108
|
+
const Load = lazy(() => import("./load-C1TQWaRI.js").then((m) => m.loadComponent(props.localPackage)));
|
|
1860
2109
|
return /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsxs(ErrorBoundary$1, {
|
|
1861
2110
|
fallbackRender: (props) => /* @__PURE__ */ jsx(AppSkeleton, { children: /* @__PURE__ */ jsx(DetailedFallback, { ...props }) }),
|
|
1862
2111
|
resetKeys: [props.localPackage],
|
|
@@ -1885,7 +2134,7 @@ const AppLoader = (props) => {
|
|
|
1885
2134
|
}) });
|
|
1886
2135
|
};
|
|
1887
2136
|
//#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 };
|
|
2137
|
+
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
2138
|
|
|
1890
|
-
//# sourceMappingURL=app-loader-
|
|
1891
|
-
//# debugId=
|
|
2139
|
+
//# sourceMappingURL=app-loader-C4GMxAYB.js.map
|
|
2140
|
+
//# debugId=fe0f49a2-5e6c-5a37-b864-71ff7d56b29f
|