@powerhousedao/connect 6.2.1-dev.0 → 6.2.1
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-D-nbV40j.js → AddDriveModal-vA-eqqPS.js} +24 -10
- package/dist/AddDriveModal-vA-eqqPS.js.map +1 -0
- package/dist/{ClearStorageModal-BoHhAIcb.js → ClearStorageModal-Dm00WyUu.js} +4 -4
- package/dist/{ClearStorageModal-BoHhAIcb.js.map → ClearStorageModal-Dm00WyUu.js.map} +1 -1
- package/dist/{CookiesPolicyModal-CkcUKPLb.js → CookiesPolicyModal-1nOh6oN3.js} +3 -3
- package/dist/{CookiesPolicyModal-CkcUKPLb.js.map → CookiesPolicyModal-1nOh6oN3.js.map} +1 -1
- package/dist/{CreateDocumentModal-CvsTh0HM.js → CreateDocumentModal-nQbLVDq3.js} +3 -3
- package/dist/{CreateDocumentModal-CvsTh0HM.js.map → CreateDocumentModal-nQbLVDq3.js.map} +1 -1
- package/dist/{DebugSettingsModal-BVerP6Sp.js → DebugSettingsModal-CWZkbU7v.js} +6 -6
- package/dist/{DebugSettingsModal-BVerP6Sp.js.map → DebugSettingsModal-CWZkbU7v.js.map} +1 -1
- package/dist/{DeleteDriveModal-DSTK8FYk.js → DeleteDriveModal-6P0T1QgD.js} +4 -4
- package/dist/{DeleteDriveModal-DSTK8FYk.js.map → DeleteDriveModal-6P0T1QgD.js.map} +1 -1
- package/dist/{DeleteItemModal-B2nJmjsP.js → DeleteItemModal-BmV1aQyZ.js} +4 -4
- package/dist/{DeleteItemModal-B2nJmjsP.js.map → DeleteItemModal-BmV1aQyZ.js.map} +1 -1
- package/dist/{DisclaimerModal-D5FO34u9.js → DisclaimerModal-CVTFfN0_.js} +3 -3
- package/dist/{DisclaimerModal-D5FO34u9.js.map → DisclaimerModal-CVTFfN0_.js.map} +1 -1
- package/dist/{DownloadDocumentWithErrorsModal-tEr3bbtN.js → DownloadDocumentWithErrorsModal-CXeFUtaz.js} +3 -3
- package/dist/{DownloadDocumentWithErrorsModal-tEr3bbtN.js.map → DownloadDocumentWithErrorsModal-CXeFUtaz.js.map} +1 -1
- package/dist/{DriveAuthRequiredModal-BA2vS3oF.js → DriveAuthRequiredModal-DDlfeXD_.js} +3 -3
- package/dist/{DriveAuthRequiredModal-BA2vS3oF.js.map → DriveAuthRequiredModal-DDlfeXD_.js.map} +1 -1
- package/dist/{DriveSettingsModal-kR3hQnh4.js → DriveSettingsModal-CsNFEJ9E.js} +4 -4
- package/dist/DriveSettingsModal-CsNFEJ9E.js.map +1 -0
- package/dist/{InspectorModal-YtFXHkxp.js → InspectorModal-wChBJ6R5.js} +35 -84
- package/dist/InspectorModal-wChBJ6R5.js.map +1 -0
- package/dist/{MissingPackageModal-BQcCQbOn.js → MissingPackageModal-Bn036mWQ.js} +4 -4
- package/dist/{MissingPackageModal-BQcCQbOn.js.map → MissingPackageModal-Bn036mWQ.js.map} +1 -1
- package/dist/{SettingsModal-Cs-Wu3Rm.js → SettingsModal-1i3Dr5eT.js} +9 -9
- package/dist/SettingsModal-1i3Dr5eT.js.map +1 -0
- package/dist/{UpgradeDriveModal-BZGSE9_r.js → UpgradeDriveModal-C7lV4rAX.js} +3 -3
- package/dist/{UpgradeDriveModal-BZGSE9_r.js.map → UpgradeDriveModal-C7lV4rAX.js.map} +1 -1
- package/dist/{app-loader-CJrQEUby.js → app-loader-C5IWlQ7x.js} +258 -193
- package/dist/app-loader-C5IWlQ7x.js.map +1 -0
- package/dist/app-loader-DYpRh5ax.js +4 -0
- package/dist/{build-info-DtsaVWhi.js → build-info-zGvEjLMy.js} +5 -8
- package/dist/{build-info-DtsaVWhi.js.map → build-info-zGvEjLMy.js.map} +1 -1
- package/dist/components-CiPNtuf_.js +5 -0
- package/dist/{connect.config-p8UTNojR.js → connect.config-BDYNejx3.js} +3 -3
- package/dist/{connect.config-p8UTNojR.js.map → connect.config-BDYNejx3.js.map} +1 -1
- package/dist/{load-HWRrVQ7W.js → load-Bt4B0U-v.js} +11 -11
- package/dist/{load-HWRrVQ7W.js.map → load-Bt4B0U-v.js.map} +1 -1
- package/dist/main.js +1 -1
- package/dist/{package-CSEQB3Fe.js → package-CNJ1Q-58.js} +4 -5
- package/dist/package-CNJ1Q-58.js.map +1 -0
- package/dist/{pglite-major-B39aOEiE.js → pglite-runtime-CHa5UyCw.js} +47 -8
- package/dist/pglite-runtime-CHa5UyCw.js.map +1 -0
- package/dist/{pglite-seed-OvaK2kRv.js → pglite-seed-CvnZdEbx.js} +4 -4
- package/dist/{pglite-seed-OvaK2kRv.js.map → pglite-seed-CvnZdEbx.js.map} +1 -1
- package/dist/{reactor-CGjsDjJC.js → reactor-DWY9_ifj.js} +17 -229
- package/dist/reactor-DWY9_ifj.js.map +1 -0
- package/dist/{registerServiceWorker-BGIXpgGV.js → registerServiceWorker-Dc4QY0Sd.js} +4 -4
- package/dist/{registerServiceWorker-BGIXpgGV.js.map → registerServiceWorker-Dc4QY0Sd.js.map} +1 -1
- package/dist/{reload-connect-toast-D1Iqw9E_.js → reload-connect-toast-DIFQ9FCX.js} +3 -3
- package/dist/{reload-connect-toast-D1Iqw9E_.js.map → reload-connect-toast-DIFQ9FCX.js.map} +1 -1
- package/dist/start-connect.js +1 -1
- package/dist/{toast-4t-VimvD.js → toast-BEy42aYx.js} +3 -3
- package/dist/{toast-4t-VimvD.js.map → toast-BEy42aYx.js.map} +1 -1
- package/dist/{useRegistryPackages-BaYtekjQ.js → useRegistryPackages-B-gFECmd.js} +3 -3
- package/dist/{useRegistryPackages-BaYtekjQ.js.map → useRegistryPackages-B-gFECmd.js.map} +1 -1
- package/package.json +10 -11
- package/dist/AddDriveModal-D-nbV40j.js.map +0 -1
- package/dist/DriveSettingsModal-kR3hQnh4.js.map +0 -1
- package/dist/InspectorModal-YtFXHkxp.js.map +0 -1
- package/dist/SettingsModal-Cs-Wu3Rm.js.map +0 -1
- package/dist/app-loader-CJrQEUby.js.map +0 -1
- package/dist/app-loader-Da5NyqEp.js +0 -4
- package/dist/components-CYms4mPU.js +0 -5
- package/dist/connection-state-B7b2E8-L.js +0 -123
- package/dist/connection-state-B7b2E8-L.js.map +0 -1
- package/dist/package-CSEQB3Fe.js.map +0 -1
- package/dist/pglite-major-B39aOEiE.js.map +0 -1
- package/dist/pglite-migrate-core-Boxqqx-c.js +0 -143
- package/dist/pglite-migrate-core-Boxqqx-c.js.map +0 -1
- package/dist/reactor-CGjsDjJC.js.map +0 -1
- package/dist/reactor.worker.d.ts +0 -1
- package/dist/reactor.worker.js +0 -316
- package/dist/reactor.worker.js.map +0 -1
|
@@ -1,15 +1,13 @@
|
|
|
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]="
|
|
3
|
-
import { a as resolvePgMajorForRuntime,
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as clearReactorStorage } from "./reactor-CGjsDjJC.js";
|
|
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]="61f6b7c3-941a-50ce-8a62-f1a57c6db24f")}catch(e){}}();
|
|
3
|
+
import { a as loadPgDump, n as getCachedReactorPgMajor, o as resolvePgMajorForRuntime, s as subscribeReactorPgMajor } from "./pglite-runtime-CHa5UyCw.js";
|
|
4
|
+
import { t as PENDING_PG_SEED_KEY } from "./pglite-seed-CvnZdEbx.js";
|
|
5
|
+
import { t as clearReactorStorage } from "./reactor-DWY9_ifj.js";
|
|
7
6
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
import { Kysely, sql } from "kysely";
|
|
9
|
-
import { PGliteDialect } from "kysely-pglite-dialect";
|
|
10
7
|
import { useCallback, useMemo, useSyncExternalStore } from "react";
|
|
11
8
|
import { DocumentIntegrityService, InMemoryQueue, PollBehavior, REACTOR_SCHEMA, addRemoteDrive, closePHModal, useConnectionStates, useDatabase, usePGlite, usePHModal, useReactorClientModule, useSync } from "@powerhousedao/reactor-browser";
|
|
12
9
|
import { InspectorModal as InspectorModal$1 } from "@powerhousedao/design-system/connect";
|
|
10
|
+
import { sql } from "kysely";
|
|
13
11
|
//#region src/components/modal/modals/InspectorModal/useDbExplorer.ts
|
|
14
12
|
async function quiesceQueue(queue) {
|
|
15
13
|
await new Promise((resolve) => queue.block(() => resolve()));
|
|
@@ -27,19 +25,12 @@ const PRIORITY_COLUMNS = [
|
|
|
27
25
|
"index",
|
|
28
26
|
"skip"
|
|
29
27
|
];
|
|
30
|
-
function createWorkerReactorDatabase(inspector) {
|
|
31
|
-
return new Kysely({ dialect: new PGliteDialect({ query: async (statement, params) => ({ rows: await inspector.queryReactorDb(statement, params) }) }) });
|
|
32
|
-
}
|
|
33
28
|
function useDbExplorer() {
|
|
34
|
-
const
|
|
29
|
+
const database = useDatabase();
|
|
35
30
|
const pglite = usePGlite();
|
|
36
|
-
const
|
|
37
|
-
const reactorClientModule = module?.kind === "browser" ? module : void 0;
|
|
31
|
+
const reactorClientModule = useReactorClientModule();
|
|
38
32
|
const reactor = reactorClientModule?.reactorModule?.reactor;
|
|
39
33
|
const queue = reactorClientModule?.reactorModule?.queue;
|
|
40
|
-
const workerModule = module?.kind === "worker" ? module : void 0;
|
|
41
|
-
const workerDatabase = useMemo(() => workerModule ? createWorkerReactorDatabase(workerModule.inspector) : void 0, [workerModule]);
|
|
42
|
-
const database = browserDatabase ?? workerDatabase;
|
|
43
34
|
const getTables = useCallback(async () => {
|
|
44
35
|
if (!database) return [];
|
|
45
36
|
const result = await sql`
|
|
@@ -180,19 +171,17 @@ function useDbExplorer() {
|
|
|
180
171
|
queue,
|
|
181
172
|
reactor
|
|
182
173
|
]);
|
|
183
|
-
const getDefaultSort = useCallback((table) => {
|
|
184
|
-
if (table === "Operation") return {
|
|
185
|
-
column: "timestampUtcMs",
|
|
186
|
-
direction: "desc"
|
|
187
|
-
};
|
|
188
|
-
}, []);
|
|
189
|
-
const canModifyDb = !!pglite;
|
|
190
174
|
return {
|
|
191
175
|
getTables,
|
|
192
176
|
getTableRows,
|
|
193
|
-
getDefaultSort
|
|
194
|
-
|
|
195
|
-
|
|
177
|
+
getDefaultSort: useCallback((table) => {
|
|
178
|
+
if (table === "Operation") return {
|
|
179
|
+
column: "timestampUtcMs",
|
|
180
|
+
direction: "desc"
|
|
181
|
+
};
|
|
182
|
+
}, []),
|
|
183
|
+
onExportDb,
|
|
184
|
+
onImportDb
|
|
196
185
|
};
|
|
197
186
|
}
|
|
198
187
|
//#endregion
|
|
@@ -223,29 +212,24 @@ function useDebugInspector() {
|
|
|
223
212
|
//#endregion
|
|
224
213
|
//#region src/components/modal/modals/InspectorModal/useIntegrityInspector.ts
|
|
225
214
|
function useIntegrityInspector() {
|
|
226
|
-
const
|
|
227
|
-
const reactorModule = module?.kind === "browser" ? module.reactorModule : void 0;
|
|
228
|
-
const inspector = module?.kind === "worker" ? module.inspector : void 0;
|
|
215
|
+
const reactorModule = useReactorClientModule()?.reactorModule;
|
|
229
216
|
const service = useMemo(() => {
|
|
230
217
|
if (!reactorModule) return void 0;
|
|
231
218
|
return new DocumentIntegrityService(reactorModule.keyframeStore, reactorModule.operationStore, reactorModule.writeCache, reactorModule.documentView, reactorModule.documentModelRegistry);
|
|
232
219
|
}, [reactorModule]);
|
|
233
220
|
const onValidate = useCallback(async (documentId, branch) => {
|
|
234
|
-
if (inspector) return await inspector.validateDocument(documentId, branch);
|
|
235
221
|
if (!service) throw new Error("Reactor module not available");
|
|
236
222
|
return service.validateDocument(documentId, branch);
|
|
237
|
-
}, [service
|
|
223
|
+
}, [service]);
|
|
238
224
|
const onRebuildKeyframes = useCallback(async (documentId, branch) => {
|
|
239
|
-
if (inspector) return await inspector.rebuildKeyframes(documentId, branch);
|
|
240
225
|
if (!service) throw new Error("Reactor module not available");
|
|
241
226
|
return service.rebuildKeyframes(documentId, branch);
|
|
242
|
-
}, [service
|
|
227
|
+
}, [service]);
|
|
243
228
|
const onRebuildSnapshots = useCallback(async (documentId, branch) => {
|
|
244
|
-
if (inspector) return await inspector.rebuildSnapshots(documentId, branch);
|
|
245
229
|
if (!service) throw new Error("Reactor module not available");
|
|
246
230
|
return service.rebuildSnapshots(documentId, branch);
|
|
247
|
-
}, [service
|
|
248
|
-
if (!service
|
|
231
|
+
}, [service]);
|
|
232
|
+
if (!service) return;
|
|
249
233
|
return {
|
|
250
234
|
onValidate,
|
|
251
235
|
onRebuildKeyframes,
|
|
@@ -255,12 +239,9 @@ function useIntegrityInspector() {
|
|
|
255
239
|
//#endregion
|
|
256
240
|
//#region src/components/modal/modals/InspectorModal/useProcessorsInspector.ts
|
|
257
241
|
function useProcessorsInspector() {
|
|
258
|
-
const
|
|
259
|
-
const
|
|
260
|
-
const inspector = module?.kind === "worker" ? module.inspector : void 0;
|
|
261
|
-
const available = useMemo(() => processorManager != null || inspector != null, [processorManager, inspector]);
|
|
242
|
+
const processorManager = useReactorClientModule()?.reactorModule?.processorManager;
|
|
243
|
+
const hasProcessorManager = useMemo(() => processorManager != null, [processorManager]);
|
|
262
244
|
const getProcessors = useCallback(() => {
|
|
263
|
-
if (inspector) return inspector.getProcessors();
|
|
264
245
|
if (!processorManager) return Promise.resolve([]);
|
|
265
246
|
return Promise.resolve(processorManager.getAll().map((tracked) => ({
|
|
266
247
|
processorId: tracked.processorId,
|
|
@@ -272,17 +253,13 @@ function useProcessorsInspector() {
|
|
|
272
253
|
lastError: tracked.lastError,
|
|
273
254
|
lastErrorTimestamp: tracked.lastErrorTimestamp
|
|
274
255
|
})));
|
|
275
|
-
}, [processorManager
|
|
256
|
+
}, [processorManager]);
|
|
276
257
|
const onRetry = useCallback(async (processorId) => {
|
|
277
|
-
if (inspector) {
|
|
278
|
-
await inspector.retryProcessor(processorId);
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
258
|
if (!processorManager) return;
|
|
282
259
|
const tracked = processorManager.get(processorId);
|
|
283
260
|
if (tracked) await tracked.retry();
|
|
284
|
-
}, [processorManager
|
|
285
|
-
if (!
|
|
261
|
+
}, [processorManager]);
|
|
262
|
+
if (!hasProcessorManager) return;
|
|
286
263
|
return {
|
|
287
264
|
getProcessors,
|
|
288
265
|
onRetry
|
|
@@ -291,15 +268,11 @@ function useProcessorsInspector() {
|
|
|
291
268
|
//#endregion
|
|
292
269
|
//#region src/components/modal/modals/InspectorModal/useQueueInspector.ts
|
|
293
270
|
function useQueueInspector() {
|
|
294
|
-
const
|
|
295
|
-
const reactorClientModule = module?.kind === "browser" ? module : void 0;
|
|
296
|
-
const inspector = module?.kind === "worker" ? module.inspector : void 0;
|
|
297
|
-
const queue = reactorClientModule?.reactorModule?.queue;
|
|
271
|
+
const queue = useReactorClientModule()?.reactorModule?.queue;
|
|
298
272
|
const inMemoryQueue = useMemo(() => {
|
|
299
273
|
if (queue instanceof InMemoryQueue) return queue;
|
|
300
274
|
}, [queue]);
|
|
301
275
|
const getQueueState = useCallback(() => {
|
|
302
|
-
if (inspector) return inspector.getQueueState();
|
|
303
276
|
if (!inMemoryQueue) return Promise.resolve({
|
|
304
277
|
isPaused: false,
|
|
305
278
|
pendingJobs: [],
|
|
@@ -321,22 +294,15 @@ function useQueueInspector() {
|
|
|
321
294
|
totalPending: pendingJobs.length,
|
|
322
295
|
totalExecuting: executingJobs.length
|
|
323
296
|
});
|
|
324
|
-
}, [inMemoryQueue
|
|
325
|
-
const onPause = useCallback(
|
|
326
|
-
if (inspector) {
|
|
327
|
-
await inspector.pauseQueue();
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
297
|
+
}, [inMemoryQueue]);
|
|
298
|
+
const onPause = useCallback(() => {
|
|
330
299
|
if (inMemoryQueue) inMemoryQueue.pause();
|
|
331
|
-
|
|
300
|
+
return Promise.resolve();
|
|
301
|
+
}, [inMemoryQueue]);
|
|
332
302
|
const onResume = useCallback(async () => {
|
|
333
|
-
if (inspector) {
|
|
334
|
-
await inspector.resumeQueue();
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
303
|
if (inMemoryQueue) await inMemoryQueue.resume();
|
|
338
|
-
}, [inMemoryQueue
|
|
339
|
-
if (!inMemoryQueue
|
|
304
|
+
}, [inMemoryQueue]);
|
|
305
|
+
if (!inMemoryQueue) return;
|
|
340
306
|
return {
|
|
341
307
|
getQueueState,
|
|
342
308
|
onPause,
|
|
@@ -362,19 +328,6 @@ function useRemotesInspector() {
|
|
|
362
328
|
};
|
|
363
329
|
}
|
|
364
330
|
//#endregion
|
|
365
|
-
//#region src/components/modal/modals/InspectorModal/useWorkerInspector.ts
|
|
366
|
-
function useWorkerInspector() {
|
|
367
|
-
const module = useReactorClientModule();
|
|
368
|
-
const adminClient = module?.kind === "worker" ? module.adminClient : void 0;
|
|
369
|
-
return useMemo(() => {
|
|
370
|
-
if (!adminClient) return;
|
|
371
|
-
return {
|
|
372
|
-
getInfo: () => adminClient.info(),
|
|
373
|
-
onRestart: () => adminClient.restart()
|
|
374
|
-
};
|
|
375
|
-
}, [adminClient]);
|
|
376
|
-
}
|
|
377
|
-
//#endregion
|
|
378
331
|
//#region src/components/modal/modals/InspectorModal/InspectorModal.tsx
|
|
379
332
|
const DEFAULT_PAGE_SIZE = 25;
|
|
380
333
|
const InspectorModal = () => {
|
|
@@ -384,7 +337,6 @@ const InspectorModal = () => {
|
|
|
384
337
|
const queueInspectorProps = useQueueInspector();
|
|
385
338
|
const processorsInspectorProps = useProcessorsInspector();
|
|
386
339
|
const integrityInspectorProps = useIntegrityInspector();
|
|
387
|
-
const workerInspectorProps = useWorkerInspector();
|
|
388
340
|
const { currentPgVersion, supportedPgVersions, onResetToPgVersion } = useDebugInspector();
|
|
389
341
|
return /* @__PURE__ */ jsx(InspectorModal$1, {
|
|
390
342
|
open,
|
|
@@ -414,12 +366,11 @@ const InspectorModal = () => {
|
|
|
414
366
|
},
|
|
415
367
|
queueInspectorProps,
|
|
416
368
|
processorsInspectorProps,
|
|
417
|
-
integrityInspectorProps
|
|
418
|
-
workerInspectorProps
|
|
369
|
+
integrityInspectorProps
|
|
419
370
|
});
|
|
420
371
|
};
|
|
421
372
|
//#endregion
|
|
422
373
|
export { InspectorModal };
|
|
423
374
|
|
|
424
|
-
//# sourceMappingURL=InspectorModal-
|
|
425
|
-
//# debugId=
|
|
375
|
+
//# sourceMappingURL=InspectorModal-wChBJ6R5.js.map
|
|
376
|
+
//# debugId=61f6b7c3-941a-50ce-8a62-f1a57c6db24f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InspectorModal-wChBJ6R5.js","sources":["../src/components/modal/modals/InspectorModal/useDbExplorer.ts","../src/components/modal/modals/InspectorModal/useDebugInspector.ts","../src/components/modal/modals/InspectorModal/useIntegrityInspector.ts","../src/components/modal/modals/InspectorModal/useProcessorsInspector.ts","../src/components/modal/modals/InspectorModal/useQueueInspector.ts","../src/components/modal/modals/InspectorModal/useRemotesInspector.ts","../src/components/modal/modals/InspectorModal/InspectorModal.tsx"],"sourcesContent":["import {\n getCachedReactorPgMajor,\n loadPgDump,\n resolvePgMajorForRuntime,\n} from \"@powerhousedao/connect/utils\";\nimport type {\n FilterGroup,\n SortOptions,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n REACTOR_SCHEMA,\n useDatabase,\n usePGlite,\n useReactorClientModule,\n type IQueue,\n} from \"@powerhousedao/reactor-browser\";\nimport { sql } from \"kysely\";\nimport { useCallback } from \"react\";\n\nasync function quiesceQueue(queue: IQueue): Promise<void> {\n await new Promise<void>((resolve) => queue.block(() => resolve()));\n}\n\n// The reactor runs with `relaxedDurability: true`, which makes PGlite's\n// `syncToFs()` fire the IDBFS→IndexedDB write and return without awaiting\n// Emscripten's syncfs callback. `close()` also doesn't flush. Calling\n// `FS.syncfs(false, cb)` directly gives us a callback that fires from the\n// IDBFS transaction's `oncomplete` — i.e. after IDB has actually committed.\nasync function syncPgliteToIdb(pglite: {\n readonly Module: {\n readonly FS: {\n syncfs(populate: boolean, cb: (err: Error | null) => void): void;\n };\n };\n}): Promise<void> {\n await new Promise<void>((resolve, reject) => {\n pglite.Module.FS.syncfs(false, (err) => (err ? reject(err) : resolve()));\n });\n}\n\ntype ColumnInfo = {\n readonly name: string;\n readonly dataType: string;\n readonly isNullable: boolean;\n};\n\ntype TableInfo = {\n readonly name: string;\n readonly columns: ColumnInfo[];\n};\n\ntype ColumnRow = {\n table_name: string;\n column_name: string;\n data_type: string;\n is_nullable: string;\n};\n\ntype GetTableRowsOptions = {\n readonly schema?: string;\n readonly limit: number;\n readonly offset: number;\n readonly sort?: SortOptions;\n readonly filters?: FilterGroup;\n};\n\ntype TablePage = {\n readonly columns: string[];\n readonly rows: Record<string, unknown>[];\n readonly total: number | null;\n};\n\nconst PRIORITY_COLUMNS = [\n \"documentType\",\n \"documentId\",\n \"scope\",\n \"branch\",\n \"index\",\n \"skip\",\n] as const;\n\nexport function useDbExplorer() {\n const database = useDatabase();\n const pglite = usePGlite();\n const reactorClientModule = useReactorClientModule();\n const reactor = reactorClientModule?.reactorModule?.reactor;\n const queue = reactorClientModule?.reactorModule?.queue;\n\n const getTables = useCallback(async (): Promise<TableInfo[]> => {\n if (!database) return [];\n\n const result = await sql<ColumnRow>`\n SELECT\n c.table_name,\n c.column_name,\n c.data_type,\n c.is_nullable\n FROM information_schema.columns c\n INNER JOIN information_schema.tables t\n ON c.table_name = t.table_name\n AND c.table_schema = t.table_schema\n WHERE c.table_schema = ${REACTOR_SCHEMA}\n AND t.table_type = 'BASE TABLE'\n ORDER BY c.table_name, c.ordinal_position\n `.execute(database);\n\n const tableMap = new Map<string, ColumnInfo[]>();\n for (const row of result.rows) {\n if (!tableMap.has(row.table_name)) {\n tableMap.set(row.table_name, []);\n }\n tableMap.get(row.table_name)!.push({\n name: row.column_name,\n dataType: row.data_type,\n isNullable: row.is_nullable === \"YES\",\n });\n }\n\n return Array.from(tableMap).map(([name, columns]) => {\n const columnNames = columns.map((col) => col.name);\n const orderedColumns = [\n ...PRIORITY_COLUMNS.filter((col) => columnNames.includes(col)).map(\n (col) => columns.find((c) => c.name === col)!,\n ),\n ...columns.filter(\n (col) =>\n !PRIORITY_COLUMNS.includes(\n col.name as (typeof PRIORITY_COLUMNS)[number],\n ),\n ),\n ];\n return {\n name,\n columns: orderedColumns,\n };\n });\n }, [database]);\n\n const getTableRows = useCallback(\n async (table: string, options: GetTableRowsOptions): Promise<TablePage> => {\n if (!database) {\n return { columns: [], rows: [], total: null };\n }\n\n const limit = options.limit;\n const offset = options.offset;\n const sort = options.sort;\n const filters = options.filters;\n const tableRef = sql.raw(`${REACTOR_SCHEMA}.\"${table}\"`);\n\n // Build WHERE clause from filters\n let whereClause = sql``;\n if (filters?.clauses && filters.clauses.length > 0) {\n const conditions: ReturnType<typeof sql>[] = [];\n\n for (let i = 0; i < filters.clauses.length; i++) {\n const clause = filters.clauses[i];\n if (!clause) continue;\n\n const columnRef = sql.raw(`\"${clause.column}\"`);\n\n let condition: ReturnType<typeof sql>;\n\n if (clause.operator === \"IS NULL\") {\n condition = sql`${columnRef} IS NULL`;\n } else if (clause.operator === \"IS NOT NULL\") {\n condition = sql`${columnRef} IS NOT NULL`;\n } else if (\n clause.operator === \"LIKE\" ||\n clause.operator === \"ILIKE\"\n ) {\n const value = clause.value;\n const operator =\n clause.operator === \"LIKE\" ? sql`LIKE` : sql`ILIKE`;\n condition = sql`${columnRef} ${operator} ${value}`;\n } else {\n // For =, !=, >, <, >=, <=\n const operator = sql.raw(clause.operator);\n const value = clause.value;\n\n // Try to parse as number if it looks like a number\n let parsedValue: string | number = value;\n if (value !== \"\" && !isNaN(Number(value)) && value.trim() !== \"\") {\n parsedValue = Number(value);\n }\n\n condition = sql`${columnRef} ${operator} ${parsedValue}`;\n }\n\n conditions.push(condition);\n\n // Add connector if not the last clause\n if (i < filters.clauses.length - 1) {\n const connector = filters.connectors?.[i] ?? \"AND\";\n conditions.push(sql.raw(connector));\n }\n }\n\n // Combine all conditions\n if (conditions.length > 0) {\n whereClause = sql`WHERE ${sql.join(conditions, sql` `)}`;\n }\n }\n\n // Build main query\n let query;\n if (sort) {\n const columnRef = sql.raw(`\"${sort.column}\"`);\n const direction = sort.direction === \"desc\" ? sql`DESC` : sql`ASC`;\n query = sql<Record<string, unknown>>`\n SELECT * FROM ${tableRef}\n ${whereClause}\n ORDER BY ${columnRef} ${direction}\n LIMIT ${limit} OFFSET ${offset}\n `;\n } else {\n query = sql<Record<string, unknown>>`\n SELECT * FROM ${tableRef}\n ${whereClause}\n LIMIT ${limit} OFFSET ${offset}\n `;\n }\n\n const result = await query.execute(database);\n\n // Build count query with same filters\n const countQuery = sql<{ count: string }>`\n SELECT COUNT(*) as count FROM ${tableRef}\n ${whereClause}\n `;\n const countResult = await countQuery.execute(database);\n const total = countResult.rows[0]\n ? parseInt(countResult.rows[0].count, 10)\n : null;\n\n const rawColumns =\n result.rows.length > 0 ? Object.keys(result.rows[0]) : [];\n const columns = [\n ...PRIORITY_COLUMNS.filter((col) => rawColumns.includes(col)),\n ...rawColumns.filter(\n (col) =>\n !PRIORITY_COLUMNS.includes(\n col as (typeof PRIORITY_COLUMNS)[number],\n ),\n ),\n ];\n\n return {\n columns,\n rows: result.rows,\n total,\n };\n },\n [database],\n );\n\n const onExportDb = useCallback(async () => {\n if (!pglite) return;\n\n if (queue) await quiesceQueue(queue);\n\n try {\n const major = resolvePgMajorForRuntime(getCachedReactorPgMajor() ?? null);\n const pgDump = await loadPgDump(major);\n const dump = await pgDump({ pg: pglite });\n const sqlContent = await dump.text();\n\n const blob = new Blob([sqlContent], { type: \"text/sql\" });\n const url = URL.createObjectURL(blob);\n const a = document.createElement(\"a\");\n a.href = url;\n a.download = `database-export-${Date.now()}.sql`;\n a.click();\n URL.revokeObjectURL(url);\n } finally {\n queue?.unblock();\n }\n }, [pglite, queue]);\n\n const onImportDb = useCallback(\n async (sqlContent: string) => {\n if (!pglite) return;\n\n if (queue) await quiesceQueue(queue);\n\n if (reactor) {\n const status = reactor.kill();\n await status.completed;\n }\n\n // Drop every user-created schema before restoring. Processors may own\n // schemas beyond `reactor`, so dropping only that one leaves orphans\n // whose tables collide with whatever the dump recreates. The dump\n // itself emits `CREATE SCHEMA ...;` statements, so we don't pre-create.\n // `standard_conforming_strings=off` matches pg_dump's escape-string\n // literals so doubled backslashes in JSONB collapse correctly.\n await pglite.transaction(async (tx) => {\n const schemas = await tx.query<{ nspname: string }>(\n `SELECT nspname FROM pg_namespace\n WHERE nspname NOT IN ('pg_catalog', 'pg_toast', 'information_schema', 'public')\n AND nspname NOT LIKE 'pg_temp_%'\n AND nspname NOT LIKE 'pg_toast_temp_%'`,\n );\n for (const { nspname } of schemas.rows) {\n await tx.exec(`DROP SCHEMA IF EXISTS \"${nspname}\" CASCADE`);\n }\n try {\n await tx.exec(\"SET standard_conforming_strings = off;\");\n } catch {\n // PG17 still accepts this but log if it ever fails.\n }\n await tx.exec(sqlContent);\n await tx.exec(`SET search_path TO ${REACTOR_SCHEMA}`);\n });\n\n // Flush IDBFS → IndexedDB synchronously. PGlite's own syncToFs is\n // fire-and-forget under relaxedDurability, and close() doesn't run\n // a final sync, so we drive Emscripten's syncfs directly — its\n // callback fires from the IDB transaction's oncomplete, guaranteeing\n // the writes have committed before we reload.\n await syncPgliteToIdb(pglite);\n\n window.location.reload();\n // reload() is asynchronous; without blocking here the DBExplorer caller\n // would continue and call loadTables() against an in-flight shutdown.\n await new Promise(() => {});\n },\n [pglite, queue, reactor],\n );\n\n const getDefaultSort = useCallback(\n (table: string): SortOptions | undefined => {\n if (table === \"Operation\") {\n return { column: \"timestampUtcMs\", direction: \"desc\" };\n }\n return undefined;\n },\n [],\n );\n\n return {\n getTables,\n getTableRows,\n getDefaultSort,\n onExportDb,\n onImportDb,\n };\n}\n","import { clearReactorStorage } from \"@powerhousedao/connect/store\";\nimport {\n getCachedReactorPgMajor,\n PENDING_PG_SEED_KEY,\n subscribeReactorPgMajor,\n} from \"@powerhousedao/connect/utils\";\nimport { useCallback, useSyncExternalStore } from \"react\";\n\nconst SUPPORTED_PG_VERSIONS = [16, 17] as const;\n\nexport function useDebugInspector() {\n const currentPgVersion = useSyncExternalStore(\n subscribeReactorPgMajor,\n getCachedReactorPgMajor,\n () => undefined,\n );\n\n const onResetToPgVersion = useCallback(async (major: number) => {\n console.info(`[debug-inspector] Reset requested: PG${major}`);\n try {\n localStorage.setItem(PENDING_PG_SEED_KEY, String(major));\n console.info(`[debug-inspector] Clearing reactor storage...`);\n await clearReactorStorage();\n console.info(`[debug-inspector] Storage cleared. Reloading...`);\n window.location.reload();\n } catch (err) {\n console.error(\"[debug-inspector] Reset failed:\", err);\n localStorage.removeItem(PENDING_PG_SEED_KEY);\n throw err;\n }\n }, []);\n\n return {\n supportedPgVersions: SUPPORTED_PG_VERSIONS,\n currentPgVersion: currentPgVersion ?? null,\n onResetToPgVersion,\n };\n}\n","import type { IntegrityInspectorProps } from \"@powerhousedao/design-system/connect\";\nimport {\n DocumentIntegrityService,\n useReactorClientModule,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useIntegrityInspector(): IntegrityInspectorProps | undefined {\n const reactorClientModule = useReactorClientModule();\n const reactorModule = reactorClientModule?.reactorModule;\n\n const service = useMemo(() => {\n if (!reactorModule) return undefined;\n\n return new DocumentIntegrityService(\n reactorModule.keyframeStore,\n reactorModule.operationStore,\n reactorModule.writeCache,\n reactorModule.documentView,\n reactorModule.documentModelRegistry,\n );\n }, [reactorModule]);\n\n const onValidate = useCallback(\n async (documentId: string, branch?: string) => {\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.validateDocument(documentId, branch);\n },\n [service],\n );\n\n const onRebuildKeyframes = useCallback(\n async (documentId: string, branch?: string) => {\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.rebuildKeyframes(documentId, branch);\n },\n [service],\n );\n\n const onRebuildSnapshots = useCallback(\n async (documentId: string, branch?: string) => {\n if (!service) {\n throw new Error(\"Reactor module not available\");\n }\n return service.rebuildSnapshots(documentId, branch);\n },\n [service],\n );\n\n if (!service) {\n return undefined;\n }\n\n return {\n onValidate,\n onRebuildKeyframes,\n onRebuildSnapshots,\n };\n}\n","import type { ProcessorsInspectorProps } from \"@powerhousedao/design-system/connect\";\nimport { useReactorClientModule } from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useProcessorsInspector(): ProcessorsInspectorProps | undefined {\n const reactorClientModule = useReactorClientModule();\n const processorManager = reactorClientModule?.reactorModule?.processorManager;\n\n const hasProcessorManager = useMemo(\n () => processorManager != null,\n [processorManager],\n );\n\n const getProcessors = useCallback(() => {\n if (!processorManager) {\n return Promise.resolve([]);\n }\n\n return Promise.resolve(\n processorManager.getAll().map((tracked) => ({\n processorId: tracked.processorId,\n factoryId: tracked.factoryId,\n driveId: tracked.driveId,\n processorIndex: tracked.processorIndex,\n lastOrdinal: tracked.lastOrdinal,\n status: tracked.status,\n lastError: tracked.lastError,\n lastErrorTimestamp: tracked.lastErrorTimestamp,\n })),\n );\n }, [processorManager]);\n\n const onRetry = useCallback(\n async (processorId: string) => {\n if (!processorManager) return;\n const tracked = processorManager.get(processorId);\n if (tracked) {\n await tracked.retry();\n }\n },\n [processorManager],\n );\n\n if (!hasProcessorManager) {\n return undefined;\n }\n\n return {\n getProcessors,\n onRetry,\n };\n}\n","import type {\n QueueInspectorProps,\n QueueState,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n InMemoryQueue,\n useReactorClientModule,\n type Job,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback, useMemo } from \"react\";\n\nexport function useQueueInspector(): QueueInspectorProps | undefined {\n const reactorClientModule = useReactorClientModule();\n const queue = reactorClientModule?.reactorModule?.queue;\n\n const inMemoryQueue = useMemo(() => {\n if (queue instanceof InMemoryQueue) {\n return queue;\n }\n return undefined;\n }, [queue]);\n\n const getQueueState = useCallback((): Promise<QueueState> => {\n if (!inMemoryQueue) {\n return Promise.resolve({\n isPaused: false,\n pendingJobs: [],\n executingJobs: [],\n totalPending: 0,\n totalExecuting: 0,\n });\n }\n\n const pendingJobs = inMemoryQueue.getPendingJobs();\n const executingJobIds = inMemoryQueue.getExecutingJobIds();\n\n const executingJobs: Job[] = [];\n for (const jobIdSet of executingJobIds.values()) {\n for (const jobId of jobIdSet) {\n const job = inMemoryQueue.getJob(jobId);\n if (job) {\n executingJobs.push(job);\n }\n }\n }\n\n return Promise.resolve({\n isPaused: inMemoryQueue.paused,\n pendingJobs,\n executingJobs,\n totalPending: pendingJobs.length,\n totalExecuting: executingJobs.length,\n });\n }, [inMemoryQueue]);\n\n const onPause = useCallback((): Promise<void> => {\n if (inMemoryQueue) {\n inMemoryQueue.pause();\n }\n return Promise.resolve();\n }, [inMemoryQueue]);\n\n const onResume = useCallback(async (): Promise<void> => {\n if (inMemoryQueue) {\n await inMemoryQueue.resume();\n }\n }, [inMemoryQueue]);\n\n if (!inMemoryQueue) {\n return undefined;\n }\n\n return {\n getQueueState,\n onPause,\n onResume,\n };\n}\n","import type {\n ConnectionStateSnapshot,\n Remote,\n} from \"@powerhousedao/reactor-browser\";\nimport {\n addRemoteDrive,\n PollBehavior,\n useConnectionStates,\n useSync,\n} from \"@powerhousedao/reactor-browser\";\nimport { useCallback } from \"react\";\n\nexport function useRemotesInspector(): {\n getRemotes: () => Promise<Remote[]>;\n removeRemote: (name: string) => Promise<void>;\n addRemoteManual: (url: string) => Promise<void>;\n triggerPull: (name: string) => void;\n connectionStates: ReadonlyMap<string, ConnectionStateSnapshot>;\n} {\n const syncManager = useSync();\n if (!syncManager) {\n throw new Error(\"Sync manager not found\");\n }\n\n const connectionStates = useConnectionStates();\n\n const getRemotes = useCallback(() => {\n return Promise.resolve(syncManager.list());\n }, [syncManager]);\n\n const removeRemote = useCallback(\n (name: string) => syncManager.remove(name),\n [syncManager],\n );\n\n const addRemoteManual = useCallback(async (url: string) => {\n await addRemoteDrive(url, undefined, {\n pollBehavior: PollBehavior.Manual,\n });\n }, []);\n\n const triggerPull = useCallback(\n (name: string) => syncManager.triggerPull(name),\n [syncManager],\n );\n\n return {\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n };\n}\n","import { InspectorModal as ConnectInspectorModal } from \"@powerhousedao/design-system/connect\";\nimport { REACTOR_SCHEMA } from \"@powerhousedao/reactor-browser\";\nimport { closePHModal, usePHModal } from \"@powerhousedao/reactor-browser\";\nimport { useDbExplorer } from \"./useDbExplorer.js\";\nimport { useDebugInspector } from \"./useDebugInspector.js\";\nimport { useIntegrityInspector } from \"./useIntegrityInspector.js\";\nimport { useProcessorsInspector } from \"./useProcessorsInspector.js\";\nimport { useQueueInspector } from \"./useQueueInspector.js\";\nimport { useRemotesInspector } from \"./useRemotesInspector.js\";\n\nconst DEFAULT_PAGE_SIZE = 25;\n\nexport const InspectorModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"inspector\";\n\n const { getTables, getTableRows, getDefaultSort, onExportDb, onImportDb } =\n useDbExplorer();\n const {\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n } = useRemotesInspector();\n const queueInspectorProps = useQueueInspector();\n const processorsInspectorProps = useProcessorsInspector();\n const integrityInspectorProps = useIntegrityInspector();\n const { currentPgVersion, supportedPgVersions, onResetToPgVersion } =\n useDebugInspector();\n\n return (\n <ConnectInspectorModal\n open={open}\n onOpenChange={(status) => {\n if (!status) closePHModal();\n }}\n dbExplorerProps={{\n schema: REACTOR_SCHEMA,\n getTables,\n getTableRows,\n getDefaultSort,\n pageSize: DEFAULT_PAGE_SIZE,\n onExportDb,\n onImportDb,\n pgVersionControl: {\n currentPgVersion,\n supportedPgVersions,\n onResetToPgVersion,\n },\n }}\n remotesInspectorProps={{\n getRemotes,\n removeRemote,\n addRemoteManual,\n triggerPull,\n connectionStates,\n }}\n queueInspectorProps={queueInspectorProps}\n processorsInspectorProps={processorsInspectorProps}\n integrityInspectorProps={integrityInspectorProps}\n />\n );\n};\n"],"names":["ConnectInspectorModal"],"mappings":";;;;;;;;;;;AAmBA,eAAe,aAAa,OAA8B;AACxD,OAAM,IAAI,SAAe,YAAY,MAAM,YAAY,SAAS,CAAC,CAAC;;AAQpE,eAAe,gBAAgB,QAMb;AAChB,OAAM,IAAI,SAAe,SAAS,WAAW;AAC3C,SAAO,OAAO,GAAG,OAAO,QAAQ,QAAS,MAAM,OAAO,IAAI,GAAG,SAAS,CAAE;GACxE;;AAmCJ,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,gBAAgB;CAC9B,MAAM,WAAW,aAAa;CAC9B,MAAM,SAAS,WAAW;CAC1B,MAAM,sBAAsB,wBAAwB;CACpD,MAAM,UAAU,qBAAqB,eAAe;CACpD,MAAM,QAAQ,qBAAqB,eAAe;CAElD,MAAM,YAAY,YAAY,YAAkC;AAC9D,MAAI,CAAC,SAAU,QAAO,EAAE;EAExB,MAAM,SAAS,MAAM,GAAc;;;;;;;;;;+BAUR,eAAe;;;MAGxC,QAAQ,SAAS;EAEnB,MAAM,2BAAW,IAAI,KAA2B;AAChD,OAAK,MAAM,OAAO,OAAO,MAAM;AAC7B,OAAI,CAAC,SAAS,IAAI,IAAI,WAAW,CAC/B,UAAS,IAAI,IAAI,YAAY,EAAE,CAAC;AAElC,YAAS,IAAI,IAAI,WAAW,CAAE,KAAK;IACjC,MAAM,IAAI;IACV,UAAU,IAAI;IACd,YAAY,IAAI,gBAAgB;IACjC,CAAC;;AAGJ,SAAO,MAAM,KAAK,SAAS,CAAC,KAAK,CAAC,MAAM,aAAa;GACnD,MAAM,cAAc,QAAQ,KAAK,QAAQ,IAAI,KAAK;AAYlD,UAAO;IACL;IACA,SAbqB,CACrB,GAAG,iBAAiB,QAAQ,QAAQ,YAAY,SAAS,IAAI,CAAC,CAAC,KAC5D,QAAQ,QAAQ,MAAM,MAA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AChB;IACA;IACA;IACD;GACF;EACD,uBAAuB;GACrB;GACA;GACA;GACA;GACA;GACD;EACoB;EACK;EACD;EACzB,CAAA","debug_id":"61f6b7c3-941a-50ce-8a62-f1a57c6db24f"}
|
|
@@ -1,6 +1,6 @@
|
|
|
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]="
|
|
3
|
-
import { t as useRegistryPackages } from "./useRegistryPackages-
|
|
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]="7bca2e2d-003c-5f8a-ac47-599074d6a710")}catch(e){}}();
|
|
3
|
+
import { t as useRegistryPackages } from "./useRegistryPackages-B-gFECmd.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { closePHModal, usePHModal, useVetraPackageManager } from "@powerhousedao/reactor-browser";
|
|
6
6
|
import { PackageInstallModal } from "@powerhousedao/design-system/connect";
|
|
@@ -33,5 +33,5 @@ function ConnectMissingPackageModal() {
|
|
|
33
33
|
//#endregion
|
|
34
34
|
export { ConnectMissingPackageModal };
|
|
35
35
|
|
|
36
|
-
//# sourceMappingURL=MissingPackageModal-
|
|
37
|
-
//# debugId=
|
|
36
|
+
//# sourceMappingURL=MissingPackageModal-Bn036mWQ.js.map
|
|
37
|
+
//# debugId=7bca2e2d-003c-5f8a-ac47-599074d6a710
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MissingPackageModal-
|
|
1
|
+
{"version":3,"file":"MissingPackageModal-Bn036mWQ.js","sources":["../src/components/modal/modals/MissingPackageModal.tsx"],"sourcesContent":["import { useRegistryPackages } from \"@powerhousedao/connect/hooks\";\nimport {\n PackageInstallModal,\n type PendingPackageInstallation,\n} from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n usePHModal,\n useVetraPackageManager,\n} from \"@powerhousedao/reactor-browser\";\n\nexport function ConnectMissingPackageModal() {\n const phModal = usePHModal();\n const { registryPackageList, updateRegistryPackageStatus } =\n useRegistryPackages();\n const packageManager = useVetraPackageManager();\n const open = phModal?.type === \"missingPackage\";\n\n const documentType = open ? phModal.documentType : undefined;\n\n if (!packageManager || !documentType) return null;\n\n const pendingInstallations: PendingPackageInstallation[] = registryPackageList\n .filter((rp) => rp.documentTypes.includes(documentType))\n .map((rp) => ({\n documentType,\n packageName: rp.name,\n }));\n\n async function onInstall(packageName: string) {\n const result = await packageManager?.addPackage(packageName);\n if (result?.type === \"success\") {\n updateRegistryPackageStatus(packageName, \"registry-install\");\n }\n }\n\n function onDismiss(packageName: string) {\n updateRegistryPackageStatus(packageName, \"dismissed\");\n }\n\n return (\n <PackageInstallModal\n pendingInstallations={pendingInstallations}\n onInstall={onInstall}\n onDismiss={onDismiss}\n onOpenChange={(status: boolean) => {\n if (!status) return closePHModal();\n }}\n />\n );\n}\n"],"names":[],"mappings":";;;;;;;AAWA,SAAgB,6BAA6B;CAC3C,MAAM,UAAU,YAAY;CAC5B,MAAM,EAAE,qBAAqB,gCAC3B,qBAAqB;CACvB,MAAM,iBAAiB,wBAAwB;CAG/C,MAAM,eAFO,SAAS,SAAS,mBAEH,QAAQ,eAAe,KAAA;AAEnD,KAAI,CAAC,kBAAkB,CAAC,aAAc,QAAO;CAE7C,MAAM,uBAAqD,oBACxD,QAAQ,OAAO,GAAG,cAAc,SAAS,aAAa,CAAC,CACvD,KAAK,QAAQ;EACZ;EACA,aAAa,GAAG;EACjB,EAAE;CAEL,eAAe,UAAU,aAAqB;AAE5C,OADe,MAAM,gBAAgB,WAAW,YAAY,GAChD,SAAS,UACnB,6BAA4B,aAAa,mBAAmB;;CAIhE,SAAS,UAAU,aAAqB;AACtC,8BAA4B,aAAa,YAAY;;AAGvD,QACE,oBAAC,qBAAD;EACwB;EACX;EACA;EACX,eAAe,WAAoB;AACjC,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,CAAA","debug_id":"7bca2e2d-003c-5f8a-ac47-599074d6a710"}
|
|
@@ -1,10 +1,10 @@
|
|
|
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]="
|
|
3
|
-
import { t as package_default } from "./package-
|
|
4
|
-
import {
|
|
5
|
-
import { r as connectConfig } from "./connect.config-
|
|
6
|
-
import { n as toast } from "./toast-
|
|
7
|
-
import { t as useRegistryPackages } from "./useRegistryPackages-
|
|
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]="69db0603-fc77-53af-835c-a9a02e9b8612")}catch(e){}}();
|
|
3
|
+
import { t as package_default } from "./package-CNJ1Q-58.js";
|
|
4
|
+
import { n as getGitUrl, r as shortGitSha, t as getGitSha } from "./build-info-zGvEjLMy.js";
|
|
5
|
+
import { r as connectConfig } from "./connect.config-BDYNejx3.js";
|
|
6
|
+
import { n as toast } from "./toast-BEy42aYx.js";
|
|
7
|
+
import { t as useRegistryPackages } from "./useRegistryPackages-B-gFECmd.js";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { t } from "i18next";
|
|
10
10
|
import { useCallback, useMemo, useState } from "react";
|
|
@@ -76,7 +76,7 @@ function AppGitHash() {
|
|
|
76
76
|
function ConnectedDrives() {
|
|
77
77
|
const drives = useDrives() ?? [];
|
|
78
78
|
const remotes = useSyncList();
|
|
79
|
-
const remoteDrives = useMemo(() => drives.filter((d) => remotes.some((r) => r.
|
|
79
|
+
const remoteDrives = useMemo(() => drives.filter((d) => remotes.some((r) => r.collectionId.equals(DriveCollectionId.forDrive(d.header.id)))), [drives, remotes]);
|
|
80
80
|
return /* @__PURE__ */ jsxs("div", {
|
|
81
81
|
className: "my-4 bg-background p-3",
|
|
82
82
|
children: [/* @__PURE__ */ jsx("h2", {
|
|
@@ -285,5 +285,5 @@ const SettingsModal = () => {
|
|
|
285
285
|
//#endregion
|
|
286
286
|
export { SettingsModal };
|
|
287
287
|
|
|
288
|
-
//# sourceMappingURL=SettingsModal-
|
|
289
|
-
//# debugId=
|
|
288
|
+
//# sourceMappingURL=SettingsModal-1i3Dr5eT.js.map
|
|
289
|
+
//# debugId=69db0603-fc77-53af-835c-a9a02e9b8612
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsModal-1i3Dr5eT.js","sources":["../src/components/modal/modals/settings/about.tsx","../src/components/modal/modals/settings/danger-zone.tsx","../src/components/modal/modals/settings/default-editor.tsx","../src/components/modal/modals/settings/package-manager.tsx","../src/components/modal/modals/SettingsModal.tsx"],"sourcesContent":["import { connectConfig } from \"@powerhousedao/connect/config\";\nimport {\n getGitSha,\n getGitUrl,\n packageJson,\n shortGitSha,\n} from \"@powerhousedao/connect/utils\";\nimport { Icon } from \"@powerhousedao/design-system\";\nimport { About as BaseAbout } from \"@powerhousedao/design-system/connect\";\nimport {\n closePHModal,\n DriveCollectionId,\n showPHModal,\n useDrives,\n useDriveSystemInfo,\n useSyncList,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\nimport { useMemo } from \"react\";\n\nexport const About: React.FC = () => {\n const onOpenInspector = () => {\n closePHModal();\n showPHModal({ type: \"inspector\" });\n };\n\n return (\n <div>\n <BaseAbout\n packageJson={packageJson}\n phCliVersion={\n typeof connectConfig.phCliVersion === \"string\"\n ? connectConfig.phCliVersion\n : undefined\n }\n />\n <AppGitHash />\n <ConnectedDrives />\n <div className=\"bg-background p-3\">\n <h2 className=\"mb-2 font-semibold text-foreground\">Inspector</h2>\n <p className=\"mb-3 text-sm font-normal text-foreground\">\n Explore the local database and sync state for debugging.\n </p>\n <button\n className=\"flex items-center gap-x-2 rounded-md border border-border bg-transparent px-3 py-1 text-sm font-medium text-foreground transition-colors hover:hover-effect\"\n onClick={onOpenInspector}\n type=\"button\"\n >\n Open Inspector <Icon name=\"CircleInfo\" size={16} />\n </button>\n </div>\n </div>\n );\n};\n\nfunction AppGitHash() {\n const sha = getGitSha();\n if (sha === \"unknown\") return null;\n const url = getGitUrl();\n const label = shortGitSha(sha);\n return (\n <div className=\"bg-background p-3 text-sm\">\n <span className=\"font-semibold\">Git hash: </span>\n {url ? (\n <a\n className=\"font-mono underline\"\n href={url}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n title={sha}\n >\n {label}\n </a>\n ) : (\n <span className=\"font-mono\" title={sha}>\n {label}\n </span>\n )}\n </div>\n );\n}\n\nfunction ConnectedDrives() {\n const drives = useDrives() ?? [];\n const remotes = useSyncList();\n\n const remoteDrives = useMemo(\n () =>\n drives.filter((d) =>\n remotes.some((r) =>\n r.collectionId.equals(DriveCollectionId.forDrive(d.header.id)),\n ),\n ),\n [drives, remotes],\n );\n\n return (\n <div className=\"my-4 bg-background p-3\">\n <h2 className=\"mb-2 font-semibold text-foreground\">Connected drives</h2>\n {remoteDrives.length === 0 ? (\n <p className=\"text-sm font-normal text-foreground\">\n No connected remote drives.\n </p>\n ) : (\n <ul className=\"flex flex-col gap-3\">\n {remoteDrives.map((drive) => (\n <DriveAboutEntry key={drive.header.id} drive={drive} />\n ))}\n </ul>\n )}\n </div>\n );\n}\n\nfunction DriveAboutEntry({ drive }: { drive: DocumentDriveDocument }) {\n const info = useDriveSystemInfo(drive);\n const name = drive.state.global.name || drive.header.name;\n\n return (\n <li className=\"text-sm text-foreground\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"font-medium\">{name}</span>\n {info.status === \"ready\" && (\n <span className=\"text-xs text-muted-foreground\">{info.host}</span>\n )}\n </div>\n {info.status === \"loading\" && (\n <div className=\"mt-1 text-xs text-muted-foreground\">Loading…</div>\n )}\n {info.status === \"error\" && (\n <div className=\"mt-1 text-xs text-destructive\">\n Could not load system info\n </div>\n )}\n {info.status === \"ready\" && (\n <div className=\"mt-1 text-xs text-foreground\">\n <div>\n <span className=\"font-medium\">Version:</span> {info.version}\n </div>\n <div>\n <span className=\"font-medium\">Git hash: </span>\n {info.gitUrl ? (\n <a\n className=\"font-mono hover:underline\"\n href={info.gitUrl}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n title={info.gitHash}\n >\n {shortGitSha(info.gitHash)}\n </a>\n ) : (\n <span className=\"font-mono\" title={info.gitHash}>\n {shortGitSha(info.gitHash)}\n </span>\n )}\n </div>\n </div>\n )}\n {info.status === \"local\" && (\n <div className=\"mt-1 text-xs text-muted-foreground\">\n Local drive — N/A\n </div>\n )}\n </li>\n );\n}\n","import { DangerZone as BaseDangerZone } from \"@powerhousedao/design-system/connect\";\nimport {\n deleteDrive,\n setSelectedDrive,\n showPHModal,\n useDrives,\n} from \"@powerhousedao/reactor-browser\";\nimport type { DocumentDriveDocument } from \"@powerhousedao/shared/document-drive\";\n\nexport const DangerZone: React.FC = () => {\n const drives = useDrives();\n\n const handleDeleteDrive = async (drive: DocumentDriveDocument) => {\n await deleteDrive(drive.header.id);\n setSelectedDrive(undefined);\n };\n\n const handleClearStorage = () => {\n showPHModal({ type: \"clearStorage\" });\n };\n\n return (\n <BaseDangerZone\n drives={drives ?? []}\n onDeleteDrive={(drive) => {\n void handleDeleteDrive(drive);\n }}\n onClearStorage={handleClearStorage}\n />\n );\n};\n","import { DefaultEditor as BaseDefaultEditor } from \"@powerhousedao/design-system/connect\";\nimport { useCallback, useState } from \"react\";\n\nconst documentModelEditorOptions = [\n { label: \"V1\", value: \"document-model-editor\" },\n { label: \"V2\", value: \"document-model-editor-v2\" },\n] as const;\n\nexport const DefaultEditor: React.FC = () => {\n const [documentModelEditor, setDocumentModelEditor] = useState<\n (typeof documentModelEditorOptions)[number]\n >(documentModelEditorOptions[1]);\n\n const handleSetDocumentEditor = useCallback((value: string) => {\n const option = documentModelEditorOptions.find((dm) => dm.value == value);\n if (option) {\n setDocumentModelEditor(option);\n }\n }, []);\n\n return (\n <BaseDefaultEditor\n documentModelEditor={documentModelEditor.value}\n setDocumentModelEditor={handleSetDocumentEditor}\n documentModelEditorOptions={\n documentModelEditorOptions as unknown as {\n value: string;\n label: string;\n }[]\n }\n />\n );\n};\n","import { useRegistryPackages } from \"@powerhousedao/connect/hooks\";\nimport { toast } from \"@powerhousedao/connect/services\";\nimport { PackageManager } from \"@powerhousedao/design-system/connect\";\nimport { useVetraPackageManager } from \"@powerhousedao/reactor-browser\";\nimport React from \"react\";\n\n/**\n * Split a `name@tag` spec into its bare package name. Mirrors the design-system's\n * `parsePackageSpec` — duplicated here to avoid reaching into a deep subpath\n * export. Scoped names split on the LAST `@`, unscoped on the first.\n */\nfunction parseBareName(spec: string): string {\n const trimmed = spec.trim();\n const at = trimmed.startsWith(\"@\")\n ? trimmed.lastIndexOf(\"@\")\n : trimmed.indexOf(\"@\");\n return at > 0 ? trimmed.slice(0, at) : trimmed;\n}\n\nexport const ConnectPackageManager: React.FC = () => {\n const packageManager = useVetraPackageManager();\n const {\n registryPackageList,\n updateRegistryPackageStatus,\n registerFallbackRegistryPackage,\n } = useRegistryPackages();\n\n async function handleInstall(packageSpec: string) {\n if (!packageManager) return;\n\n // The spec may include an explicit `@tag` / `@version` suffix from the\n // search input. Pass it through to the package manager as-is (the CDN\n // route already handles `name@tag` specs), but track status under the\n // bare name so the Settings list doesn't fragment.\n const bareName = parseBareName(packageSpec);\n // Packages that were in `/packages` when the user clicked Install go\n // through `updateRegistryPackageStatus` and hit an existing entry.\n // Packages that landed via the npm-uplink fallback weren't in the list,\n // so we register them explicitly rather than silently upserting a\n // placeholder — keeping the \"does not exist\" error as a signal for any\n // other code path that reaches update without a matching entry.\n const wasKnownToRegistry = registryPackageList.some(\n (p) => p.name === bareName,\n );\n const result = await packageManager.addPackage(packageSpec);\n if (result.type === \"success\") {\n if (wasKnownToRegistry) {\n updateRegistryPackageStatus(bareName, \"registry-install\");\n } else {\n registerFallbackRegistryPackage(\n bareName,\n result.package,\n packageManager.getPackageVersion(bareName) ??\n packageManager.getPackageVersion(packageSpec),\n \"registry-install\",\n );\n }\n toast(`Package \"${packageSpec}\" installed successfully`, {\n type: \"connect-success\",\n });\n } else {\n const message = result.error.message;\n // `BrowserPackageManager` raises a generic \"Failed to fetch dynamically\n // imported module\" when the registry CDN returns an error. That covers\n // both \"the name exists nowhere (not on this registry AND not on the\n // npmjs uplink)\" and \"the tarball is there but doesn't look like a\n // Powerhouse package\". Tell the user in plain terms before dumping the\n // raw error so the \"install from npm\" fallback case is self-explanatory.\n const isLikelyNotFound = /failed to fetch|404|not found/i.test(message);\n const userMessage = isLikelyNotFound\n ? `Could not install \"${packageSpec}\". The package isn't available on this registry, and the npmjs.org fallback could not resolve it either.`\n : `Failed to install \"${packageSpec}\": ${message}`;\n toast(userMessage, { type: \"error\" });\n }\n }\n\n function handleUninstall(packageName: string) {\n if (!packageManager) return;\n try {\n packageManager.removePackage(packageName);\n updateRegistryPackageStatus(packageName, \"available\");\n\n toast(`Package \"${packageName}\" uninstalled successfully`, {\n type: \"connect-success\",\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : \"Unknown error\";\n toast(`Failed to uninstall \"${packageName}\": ${message}`, {\n type: \"error\",\n });\n }\n }\n\n return (\n <div className=\"flex h-full flex-1 flex-col\">\n <PackageManager\n mutable={true}\n registryPackageList={registryPackageList}\n onInstall={handleInstall}\n onUninstall={handleUninstall}\n />\n </div>\n );\n};\n","import {\n SettingsModal as SettingsModalV2,\n ThemeSwitch,\n} from \"@powerhousedao/design-system/connect\";\nimport { closePHModal, usePHModal } from \"@powerhousedao/reactor-browser\";\nimport { t } from \"i18next\";\nimport { CircleHelp, Package, PenLine, TriangleAlert } from \"lucide-react\";\nimport React, { useMemo } from \"react\";\nimport { About } from \"./settings/about.js\";\nimport { DangerZone } from \"./settings/danger-zone.js\";\nimport { DefaultEditor } from \"./settings/default-editor.js\";\nimport { ConnectPackageManager } from \"./settings/package-manager.js\";\n\nconst iconProps = { size: 16 } as const;\n\nexport const SettingsModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"settings\";\n\n const tabs = useMemo(\n () => [\n {\n id: \"package-manager\",\n icon: <Package {...iconProps} />,\n label: \"Package Manager\",\n content: ConnectPackageManager,\n },\n {\n id: \"default-editors\",\n icon: <PenLine {...iconProps} />,\n label: \"Default Editors\",\n content: DefaultEditor,\n },\n {\n id: \"danger-zone\",\n icon: <TriangleAlert {...iconProps} className=\"text-destructive\" />,\n label: <span className=\"text-destructive\">Danger Zone</span>,\n content: () => <DangerZone />,\n },\n {\n id: \"about\",\n icon: <CircleHelp {...iconProps} />,\n label: \"About\",\n content: About,\n },\n ],\n [],\n );\n\n return (\n <SettingsModalV2\n open={open}\n title={t(\"modals.connectSettings.title\")}\n onOpenChange={(status: boolean) => {\n if (!status) return closePHModal();\n }}\n tabs={tabs}\n navFooter={<ThemeSwitch horizontal />}\n />\n );\n};\n"],"names":["About","BaseAbout","packageJson","DangerZone","BaseDangerZone","DefaultEditor","BaseDefaultEditor","DefaultEditor","DangerZone","About","SettingsModalV2"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAaA,gBAAwB;CACnC,MAAM,wBAAwB;AAC5B,gBAAc;AACd,cAAY,EAAE,MAAM,aAAa,CAAC;;AAGpC,QACE,qBAAC,OAAD,EAAA,UAAA;EACE,oBAACC,OAAD;GACE,aAAaC;GACb,cACE,OAAO,cAAc,iBAAiB,WAClC,cAAc,eACd,KAAA;GAEN,CAAA;EACF,oBAAC,YAAD,EAAc,CAAA;EACd,oBAAC,iBAAD,EAAmB,CAAA;EACnB,qBAAC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,QAAO,cAAc;;EAE9B;EACN,WAAW,oBAAC,aAAD,EAAa,YAAA,MAAa,CAAA;EACrC,CAAA","debug_id":"69db0603-fc77-53af-835c-a9a02e9b8612"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c6e40a20-1073-5d21-ba94-170c9adec293")}catch(e){}}();
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
import "react";
|
|
@@ -30,5 +30,5 @@ const UpgradeDriveModal = () => {
|
|
|
30
30
|
//#endregion
|
|
31
31
|
export { UpgradeDriveModal };
|
|
32
32
|
|
|
33
|
-
//# sourceMappingURL=UpgradeDriveModal-
|
|
34
|
-
//# debugId=
|
|
33
|
+
//# sourceMappingURL=UpgradeDriveModal-C7lV4rAX.js.map
|
|
34
|
+
//# debugId=c6e40a20-1073-5d21-ba94-170c9adec293
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpgradeDriveModal-
|
|
1
|
+
{"version":3,"file":"UpgradeDriveModal-C7lV4rAX.js","sources":["../src/components/modal/modals/UpgradeDriveModal.tsx"],"sourcesContent":["import { ConnectUpgradeDriveModal } from \"@powerhousedao/design-system/connect\";\nimport { closePHModal, usePHModal } from \"@powerhousedao/reactor-browser\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nexport const UpgradeDriveModal: React.FC = () => {\n const phModal = usePHModal();\n const open = phModal?.type === \"upgradeDrive\";\n const driveId = open ? phModal.driveId : undefined;\n\n const { t } = useTranslation();\n\n const onContinue = () => {\n // TODO: Implement upgrade drive\n console.log(\"Upgrade drive: \", driveId);\n closePHModal();\n };\n\n return (\n <ConnectUpgradeDriveModal\n open={open}\n onContinue={onContinue}\n header={t(\"modals.upgradeDrive.header\")}\n body={t(\"modals.upgradeDrive.body\")}\n cancelLabel={t(\"common.cancel\")}\n continueLabel={t(\"common.continue\")}\n onOpenChange={(status: boolean) => {\n if (!status) return closePHModal();\n }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAKA,MAAa,0BAAoC;CAC/C,MAAM,UAAU,YAAY;CAC5B,MAAM,OAAO,SAAS,SAAS;CAC/B,MAAM,UAAU,OAAO,QAAQ,UAAU,KAAA;CAEzC,MAAM,EAAE,MAAM,gBAAgB;CAE9B,MAAM,mBAAmB;AAEvB,UAAQ,IAAI,mBAAmB,QAAQ;AACvC,gBAAc;;AAGhB,QACE,oBAAC,0BAAD;EACQ;EACM;EACZ,QAAQ,EAAE,6BAA6B;EACvC,MAAM,EAAE,2BAA2B;EACnC,aAAa,EAAE,gBAAgB;EAC/B,eAAe,EAAE,kBAAkB;EACnC,eAAe,WAAoB;AACjC,OAAI,CAAC,OAAQ,QAAO,cAAc;;EAEpC,CAAA","debug_id":"c6e40a20-1073-5d21-ba94-170c9adec293"}
|