@powerhousedao/connect 1.0.16-dev.0 → 1.0.16-dev.2
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/assets/{app-CMOavKiq.js → app-DhH3gUSI.js} +60 -56
- package/dist/assets/{app-loader-DC5IyHMQ.js → app-loader-Btk_wf_z.js} +123 -67
- package/dist/assets/{ccip-DSbQ3ps3.js → ccip-D9a0ttP2.js} +3 -3
- package/dist/assets/{content-CHzDFdGF.js → content-BlRqE_8w.js} +18 -3
- package/dist/assets/{index-DPALYL1s.js → index-BuxuyYQU.js} +3 -3
- package/dist/assets/{index-CL8GxjbV.js → index-D3bygFYe.js} +4 -4
- package/dist/assets/{index-BAzB-bGZ.js → index-Whh7mT2J.js} +3 -3
- package/dist/assets/{main.glrVfQff.js → main.C1DJvpcL.js} +1 -1
- package/dist/index.html +2 -34
- package/dist/vite-envs.sh +1 -1
- package/package.json +9 -9
- package/dist/modules/@powerhousedao/reactor-browser/chunk-2ESYSVXG.js +0 -48
- package/dist/modules/@powerhousedao/reactor-browser/chunk-2ONJ2PX4.js +0 -50
- package/dist/modules/@powerhousedao/reactor-browser/chunk-2X2M6BYG.js +0 -2542
- package/dist/modules/@powerhousedao/reactor-browser/chunk-7MMXY5VI.js +0 -14203
- package/dist/modules/@powerhousedao/reactor-browser/chunk-7OQWVUC5.js +0 -43
- package/dist/modules/@powerhousedao/reactor-browser/chunk-C7QRY43M.js +0 -786
- package/dist/modules/@powerhousedao/reactor-browser/chunk-CO2RVWYY.js +0 -67
- package/dist/modules/@powerhousedao/reactor-browser/chunk-DKDARAJS.js +0 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-EB4SAP74.js +0 -178
- package/dist/modules/@powerhousedao/reactor-browser/chunk-FQF4YAVC.js +0 -11917
- package/dist/modules/@powerhousedao/reactor-browser/chunk-GDP7BUIH.js +0 -45
- package/dist/modules/@powerhousedao/reactor-browser/chunk-IQTSFTNF.js +0 -48
- package/dist/modules/@powerhousedao/reactor-browser/chunk-J5TYPY7U.js +0 -36
- package/dist/modules/@powerhousedao/reactor-browser/chunk-KEMIF43H.js +0 -82
- package/dist/modules/@powerhousedao/reactor-browser/chunk-LH2T6NLN.js +0 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-LRNZZ3SR.js +0 -14
- package/dist/modules/@powerhousedao/reactor-browser/chunk-NHD6VUCD.js +0 -53
- package/dist/modules/@powerhousedao/reactor-browser/chunk-OHBF7Q5F.js +0 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-OVGOA2P5.js +0 -11
- package/dist/modules/@powerhousedao/reactor-browser/chunk-P6NJ6IAQ.js +0 -12
- package/dist/modules/@powerhousedao/reactor-browser/chunk-RGIB4DD4.js +0 -162
- package/dist/modules/@powerhousedao/reactor-browser/chunk-SNZRCTNV.js +0 -2477
- package/dist/modules/@powerhousedao/reactor-browser/chunk-TNPKLKIJ.js +0 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-U34SEKEB.js +0 -250
- package/dist/modules/@powerhousedao/reactor-browser/chunk-U36SV333.js +0 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-VT7IMWQB.js +0 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-XBTEGV5M.js +0 -17
- package/dist/modules/@powerhousedao/reactor-browser/chunk-Y2AV245J.js +0 -113
- package/dist/modules/@powerhousedao/reactor-browser/chunk-Y7NTRTMT.js +0 -25
- package/dist/modules/@powerhousedao/reactor-browser/chunk-YG67WAIS.js +0 -0
- package/dist/modules/@powerhousedao/reactor-browser/chunk-YWKVPJNL.js +0 -52
- package/dist/modules/@powerhousedao/reactor-browser/chunk-ZL5IPB6D.js +0 -0
- package/dist/modules/@powerhousedao/reactor-browser/context/index.js +0 -16
- package/dist/modules/@powerhousedao/reactor-browser/context/read-mode.js +0 -15
- package/dist/modules/@powerhousedao/reactor-browser/crypto/browser.js +0 -7
- package/dist/modules/@powerhousedao/reactor-browser/crypto/index.js +0 -7
- package/dist/modules/@powerhousedao/reactor-browser/document-model.js +0 -10
- package/dist/modules/@powerhousedao/reactor-browser/hooks/document-state.js +0 -96
- package/dist/modules/@powerhousedao/reactor-browser/hooks/index.js +0 -98
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useAddDebouncedOperations.js +0 -11
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useConnectCrypto.js +0 -12
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocument.js +0 -7
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentDispatch.js +0 -7
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentDrives.js +0 -13
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDocumentEditor.js +0 -20
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActions.js +0 -9
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActionsWithUiNodes.js +0 -14
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveContext.js +0 -9
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useUiNodesContext.js +0 -46
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useUserPermissions.js +0 -7
- package/dist/modules/@powerhousedao/reactor-browser/index.js +0 -127
- package/dist/modules/@powerhousedao/reactor-browser/reactor.js +0 -11
- package/dist/modules/@powerhousedao/reactor-browser/renown/constants.js +0 -53
- package/dist/modules/@powerhousedao/reactor-browser/renown/types.js +0 -1
- package/dist/modules/@powerhousedao/reactor-browser/storage/index.js +0 -1
- package/dist/modules/@powerhousedao/reactor-browser/storage/types.js +0 -1
- package/dist/modules/@powerhousedao/reactor-browser/types/drive-editor.js +0 -1
- package/dist/modules/@powerhousedao/reactor-browser/types/index.js +0 -2
- package/dist/modules/@powerhousedao/reactor-browser/uiNodes/constants.js +0 -37
- package/dist/modules/@powerhousedao/reactor-browser/uiNodes/types.js +0 -1
- package/dist/modules/@powerhousedao/reactor-browser/utils/export-document.js +0 -8
- package/dist/modules/@powerhousedao/reactor-browser/utils/index.js +0 -9
- package/dist/modules/@powerhousedao/reactor-browser/utils/signature.js +0 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ccip-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ccip-D9a0ttP2.js","assets/main.C1DJvpcL.js","assets/app-loader-Btk_wf_z.js","assets/app-loader-DiF8OhX3.css","assets/index-BuxuyYQU.js","assets/style-Ce3V83BE.css","assets/index-D3bygFYe.js","assets/content-BlRqE_8w.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __typeError = (msg) => {
|
|
4
4
|
throw TypeError(msg);
|
|
@@ -19,9 +19,9 @@ var __privateWrapper = (obj, member, setter, getter) => ({
|
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
var _focused, _cleanup, _setup, _a, _online, _cleanup2, _setup2, _b, _gcTimeout, _c, _initialState, _revertState, _cache, _client, _retryer, _defaultOptions, _abortSignalConsumed, _Query_instances, dispatch_fn, _d, _queries, _e2, _observers, _mutationCache, _retryer2, _Mutation_instances, dispatch_fn2, _f, _mutations, _scopes, _mutationId, _g, _queryCache, _mutationCache2, _defaultOptions2, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _h, _client2, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _currentThenable, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _QueryObserver_instances, executeFetch_fn, updateStaleTimeout_fn, computeRefetchInterval_fn, updateRefetchInterval_fn, updateTimers_fn, clearStaleTimeout_fn, clearRefetchInterval_fn, updateQuery_fn, notify_fn, _i;
|
|
22
|
-
import { _ as __vitePreload } from "./main.
|
|
22
|
+
import { _ as __vitePreload } from "./main.C1DJvpcL.js";
|
|
23
23
|
import { jsx as jsx$1, Fragment, jsxs } from "react/jsx-runtime";
|
|
24
|
-
import { c as createAction, a as createReducer, i as isDocumentAction, R as ReorderStateExamplesInputSchema, D as DeleteStateExampleInputSchema, U as UpdateStateExampleInputSchema, A as AddStateExampleInputSchema, S as SetInitialStateInputSchema, b as SetStateSchemaInputSchema, d as ReorderModuleOperationsInputSchema, e as DeleteOperationInputSchema, M as MoveOperationInputSchema, f as SetOperationReducerInputSchema, g as SetOperationTemplateInputSchema, h as SetOperationDescriptionInputSchema, j as SetOperationSchemaInputSchema, k as SetOperationScopeInputSchema, l as SetOperationNameInputSchema, m as AddOperationInputSchema, n as ReorderOperationExamplesInputSchema, o as DeleteOperationExampleInputSchema, p as UpdateOperationExampleInputSchema, q as AddOperationExampleInputSchema, r as ReorderOperationErrorsInputSchema, s as DeleteOperationErrorInputSchema, t as SetOperationErrorTemplateInputSchema, u as SetOperationErrorDescriptionInputSchema, v as SetOperationErrorNameInputSchema, w as SetOperationErrorCodeInputSchema, x as AddOperationErrorInputSchema, y as ReorderModulesInputSchema, z as DeleteModuleInputSchema, B as SetModuleDescriptionInputSchema, C as SetModuleNameInputSchema, E as AddModuleInputSchema, F as ReorderChangeLogItemsInputSchema, G as DeleteChangeLogItemInputSchema, H as UpdateChangeLogItemInputSchema, I as AddChangeLogItemInputSchema, J as SetAuthorWebsiteInputSchema, K as SetAuthorNameInputSchema, L as SetModelDescriptionInputSchema, N as SetModelExtensionInputSchema, O as SetModelIdInputSchema, P as SetModelNameInputSchema, Q as baseCreateExtendedState, T as baseCreateDocument, V as baseSaveToFile, W as baseSaveToFileHandle, X as baseLoadFromFile, Y as baseLoadFromInput, Z as pascalCase, _ as Icon, $ as getDefaultExportFromCjs, a0 as LOCAL, a1 as commonjsGlobal, a2 as PUBLIC, a3 as SWITCHBOARD, a4 as locationInfoByLocation, a5 as sharingTypeOptions, a6 as objectType, a7 as recordType, a8 as stringType, a9 as capitalCase, aa as CLOUD, ab as createZip, ac as logger$1, ad as LZString, ae as buildSignedOperation, af as getI18n, ag as getDefaults, ah as connectConfig, ai as hashDocumentStateForScope, aj as setErrorHandler, ak as driveDocumentModelModule, al as createBrowserDocumentDriveServer, am as hashKey$1, an as childLogger, ao as reducer$8, ap as isDocumentDrive, aq as generateAddNodeAction, ar as isFileNode, as as uploadDocumentOperations, at as updateFile, au as addFolder, av as isFolderNode, aw as deleteNode, ax as updateNode, ay as FILE, az as moveNode, aA as generateNodesCopy, aB as copyNode, aC as createState$1, aD as setDriveName, aE as setAvailableOffline, aF as setSharingType, aG as SynchronizationUnitNotFoundError, aH as removeTrigger, aI as generateUUID, aJ as PullResponderTransmitter, aK as addTrigger, aL as ReadDriveNotFoundError, aM as openUrl, aN as getNodeOptions, aO as DRIVE, aP as FOLDER, aQ as requestPublicDrive, aR as serviceWorkerManager, aS as packageJson, aT as t$1, aU as gql, aV as request } from "./app-loader-
|
|
24
|
+
import { c as createAction, a as createReducer, i as isDocumentAction, R as ReorderStateExamplesInputSchema, D as DeleteStateExampleInputSchema, U as UpdateStateExampleInputSchema, A as AddStateExampleInputSchema, S as SetInitialStateInputSchema, b as SetStateSchemaInputSchema, d as ReorderModuleOperationsInputSchema, e as DeleteOperationInputSchema, M as MoveOperationInputSchema, f as SetOperationReducerInputSchema, g as SetOperationTemplateInputSchema, h as SetOperationDescriptionInputSchema, j as SetOperationSchemaInputSchema, k as SetOperationScopeInputSchema, l as SetOperationNameInputSchema, m as AddOperationInputSchema, n as ReorderOperationExamplesInputSchema, o as DeleteOperationExampleInputSchema, p as UpdateOperationExampleInputSchema, q as AddOperationExampleInputSchema, r as ReorderOperationErrorsInputSchema, s as DeleteOperationErrorInputSchema, t as SetOperationErrorTemplateInputSchema, u as SetOperationErrorDescriptionInputSchema, v as SetOperationErrorNameInputSchema, w as SetOperationErrorCodeInputSchema, x as AddOperationErrorInputSchema, y as ReorderModulesInputSchema, z as DeleteModuleInputSchema, B as SetModuleDescriptionInputSchema, C as SetModuleNameInputSchema, E as AddModuleInputSchema, F as ReorderChangeLogItemsInputSchema, G as DeleteChangeLogItemInputSchema, H as UpdateChangeLogItemInputSchema, I as AddChangeLogItemInputSchema, J as SetAuthorWebsiteInputSchema, K as SetAuthorNameInputSchema, L as SetModelDescriptionInputSchema, N as SetModelExtensionInputSchema, O as SetModelIdInputSchema, P as SetModelNameInputSchema, Q as baseCreateExtendedState, T as baseCreateDocument, V as baseSaveToFile, W as baseSaveToFileHandle, X as baseLoadFromFile, Y as baseLoadFromInput, Z as pascalCase, _ as Icon, $ as getDefaultExportFromCjs, a0 as LOCAL, a1 as commonjsGlobal, a2 as PUBLIC, a3 as SWITCHBOARD, a4 as locationInfoByLocation, a5 as sharingTypeOptions, a6 as objectType, a7 as recordType, a8 as stringType, a9 as capitalCase, aa as CLOUD, ab as createZip, ac as logger$1, ad as LZString, ae as buildSignedOperation, af as getI18n, ag as getDefaults, ah as connectConfig, ai as hashDocumentStateForScope, aj as setErrorHandler, ak as driveDocumentModelModule, al as createBrowserDocumentDriveServer, am as hashKey$1, an as childLogger, ao as reducer$8, ap as isDocumentDrive, aq as generateAddNodeAction, ar as isFileNode, as as uploadDocumentOperations, at as updateFile, au as addFolder, av as isFolderNode, aw as deleteNode, ax as updateNode, ay as FILE, az as moveNode, aA as generateNodesCopy, aB as copyNode, aC as createState$1, aD as setDriveName, aE as setAvailableOffline, aF as setSharingType, aG as SynchronizationUnitNotFoundError, aH as removeTrigger, aI as generateUUID, aJ as PullResponderTransmitter, aK as addTrigger, aL as ReadDriveNotFoundError, aM as openUrl, aN as getNodeOptions, aO as DRIVE, aP as FOLDER, aQ as requestPublicDrive, aR as serviceWorkerManager, aS as packageJson, aT as t$1, aU as gql, aV as request } from "./app-loader-Btk_wf_z.js";
|
|
25
25
|
import * as React from "react";
|
|
26
26
|
import React__default, { useLayoutEffect, useEffect, useState, forwardRef, useRef, useCallback, useContext, useMemo, createContext, Component, Fragment as Fragment$1, createElement, useSyncExternalStore, useId as useId$1, isValidElement, cloneElement, Children, useReducer, useDebugValue, Suspense } from "react";
|
|
27
27
|
import "@powerhousedao/reactor-browser";
|
|
@@ -20574,7 +20574,7 @@ async function call(client2, args) {
|
|
|
20574
20574
|
} catch (err) {
|
|
20575
20575
|
const data2 = getRevertErrorData(err);
|
|
20576
20576
|
const { offchainLookup, offchainLookupSignature } = await __vitePreload(async () => {
|
|
20577
|
-
const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-
|
|
20577
|
+
const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-D9a0ttP2.js");
|
|
20578
20578
|
return { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 };
|
|
20579
20579
|
}, true ? __vite__mapDeps([0,1,2,3]) : void 0);
|
|
20580
20580
|
if (client2.ccipRead !== false && (data2 == null ? void 0 : data2.slice(0, 10)) === offchainLookupSignature && to)
|
|
@@ -71667,7 +71667,7 @@ const useFilteredDocumentModels = () => {
|
|
|
71667
71667
|
return filteredDocumentModels;
|
|
71668
71668
|
};
|
|
71669
71669
|
async function loadBaseEditors() {
|
|
71670
|
-
const documentModelEditor = await __vitePreload(() => import("./index-
|
|
71670
|
+
const documentModelEditor = await __vitePreload(() => import("./index-BuxuyYQU.js"), true ? __vite__mapDeps([4,2,1,3]) : void 0);
|
|
71671
71671
|
await __vitePreload(() => Promise.resolve({}), true ? __vite__mapDeps([5]) : void 0);
|
|
71672
71672
|
const module = documentModelEditor.documentModelEditorModule;
|
|
71673
71673
|
return [module];
|
|
@@ -71708,7 +71708,7 @@ async function initReactor(reactor) {
|
|
|
71708
71708
|
}
|
|
71709
71709
|
const drives = await reactor.getDrives();
|
|
71710
71710
|
if (!drives.length && connectConfig.drives.sections.LOCAL.enabled) {
|
|
71711
|
-
reactor.addDrive({
|
|
71711
|
+
return reactor.addDrive({
|
|
71712
71712
|
global: {
|
|
71713
71713
|
id: hashKey$1(),
|
|
71714
71714
|
name: "My Local Drive",
|
|
@@ -71818,11 +71818,11 @@ const connectCrypto = (async () => {
|
|
|
71818
71818
|
return window.connectCrypto;
|
|
71819
71819
|
}
|
|
71820
71820
|
const { ConnectCrypto } = await __vitePreload(async () => {
|
|
71821
|
-
const { ConnectCrypto: ConnectCrypto2 } = await import("./index-
|
|
71821
|
+
const { ConnectCrypto: ConnectCrypto2 } = await import("./index-D3bygFYe.js");
|
|
71822
71822
|
return { ConnectCrypto: ConnectCrypto2 };
|
|
71823
71823
|
}, true ? __vite__mapDeps([6,1,2,3]) : void 0);
|
|
71824
71824
|
const { BrowserKeyStorage } = await __vitePreload(async () => {
|
|
71825
|
-
const { BrowserKeyStorage: BrowserKeyStorage2 } = await import("./index-
|
|
71825
|
+
const { BrowserKeyStorage: BrowserKeyStorage2 } = await import("./index-D3bygFYe.js");
|
|
71826
71826
|
return { BrowserKeyStorage: BrowserKeyStorage2 };
|
|
71827
71827
|
}, true ? __vite__mapDeps([6,1,2,3]) : void 0);
|
|
71828
71828
|
const connectCrypto2 = new ConnectCrypto(new BrowserKeyStorage());
|
|
@@ -71871,7 +71871,7 @@ function useRenown() {
|
|
|
71871
71871
|
return;
|
|
71872
71872
|
}
|
|
71873
71873
|
const { initRenownBrowser } = await __vitePreload(async () => {
|
|
71874
|
-
const { initRenownBrowser: initRenownBrowser2 } = await import("./index-
|
|
71874
|
+
const { initRenownBrowser: initRenownBrowser2 } = await import("./index-D3bygFYe.js");
|
|
71875
71875
|
return { initRenownBrowser: initRenownBrowser2 };
|
|
71876
71876
|
}, true ? __vite__mapDeps([6,1,2,3]) : void 0);
|
|
71877
71877
|
const renownBrowser = initRenownBrowser(did2);
|
|
@@ -72095,7 +72095,7 @@ function useDocumentDrives() {
|
|
|
72095
72095
|
const [status, setStatus] = useAtom(
|
|
72096
72096
|
documentDrivesInitializedMapAtomFamily(reactor)
|
|
72097
72097
|
);
|
|
72098
|
-
if (status === "INITIAL") {
|
|
72098
|
+
if (status === "INITIAL" && reactor) {
|
|
72099
72099
|
setStatus("LOADING");
|
|
72100
72100
|
refreshDocumentDrives().then(() => setStatus("LOADED")).catch(() => setStatus("ERROR"));
|
|
72101
72101
|
}
|
|
@@ -79416,6 +79416,7 @@ const DangerZone = ({
|
|
|
79416
79416
|
),
|
|
79417
79417
|
onContinue: () => {
|
|
79418
79418
|
clearStorage().then(() => {
|
|
79419
|
+
navigate("/");
|
|
79419
79420
|
onRefresh();
|
|
79420
79421
|
}).catch(logger$1.error);
|
|
79421
79422
|
},
|
|
@@ -80231,7 +80232,7 @@ function Home() {
|
|
|
80231
80232
|
/* @__PURE__ */ jsx$1(HomeScreenAddDriveItem, { onClick: onAddDriveClick })
|
|
80232
80233
|
] });
|
|
80233
80234
|
}
|
|
80234
|
-
const Content = React__default.lazy(() => __vitePreload(() => import("./content-
|
|
80235
|
+
const Content = React__default.lazy(() => __vitePreload(() => import("./content-BlRqE_8w.js"), true ? __vite__mapDeps([7,2,1,3]) : void 0));
|
|
80235
80236
|
async function createRouter(routes) {
|
|
80236
80237
|
var _a2;
|
|
80237
80238
|
const isPackaged = await ((_a2 = window.electronAPI) == null ? void 0 : _a2.isPackaged());
|
|
@@ -80359,51 +80360,54 @@ export {
|
|
|
80359
80360
|
useFilteredDocumentModels as a2,
|
|
80360
80361
|
useDriveEditor as a3,
|
|
80361
80362
|
useDocumentDriveById as a4,
|
|
80362
|
-
|
|
80363
|
-
|
|
80364
|
-
|
|
80365
|
-
|
|
80366
|
-
|
|
80367
|
-
|
|
80368
|
-
|
|
80369
|
-
|
|
80370
|
-
|
|
80371
|
-
|
|
80372
|
-
|
|
80373
|
-
|
|
80374
|
-
|
|
80375
|
-
|
|
80376
|
-
|
|
80377
|
-
|
|
80378
|
-
|
|
80379
|
-
|
|
80380
|
-
|
|
80381
|
-
|
|
80382
|
-
|
|
80383
|
-
|
|
80384
|
-
|
|
80385
|
-
|
|
80386
|
-
|
|
80387
|
-
|
|
80388
|
-
|
|
80389
|
-
|
|
80390
|
-
|
|
80391
|
-
|
|
80392
|
-
|
|
80393
|
-
|
|
80394
|
-
|
|
80395
|
-
|
|
80396
|
-
|
|
80397
|
-
|
|
80398
|
-
|
|
80399
|
-
|
|
80400
|
-
|
|
80401
|
-
|
|
80402
|
-
|
|
80403
|
-
|
|
80404
|
-
|
|
80405
|
-
|
|
80406
|
-
|
|
80363
|
+
useParams as a5,
|
|
80364
|
+
useDocumentDrives as a6,
|
|
80365
|
+
toast as a7,
|
|
80366
|
+
clsx as a8,
|
|
80367
|
+
get as a9,
|
|
80368
|
+
setOperationSchema as aA,
|
|
80369
|
+
setOperationDescription as aB,
|
|
80370
|
+
deleteOperation as aC,
|
|
80371
|
+
addOperationError as aD,
|
|
80372
|
+
deleteOperationError as aE,
|
|
80373
|
+
setOperationErrorName as aF,
|
|
80374
|
+
BaseError$4 as aG,
|
|
80375
|
+
getUrl as aH,
|
|
80376
|
+
stringify$1 as aI,
|
|
80377
|
+
decodeErrorResult as aJ,
|
|
80378
|
+
isAddressEqual as aK,
|
|
80379
|
+
call as aL,
|
|
80380
|
+
concat$1 as aM,
|
|
80381
|
+
encodeAbiParameters as aN,
|
|
80382
|
+
HttpRequestError as aO,
|
|
80383
|
+
isHex as aP,
|
|
80384
|
+
app as aQ,
|
|
80385
|
+
set as aa,
|
|
80386
|
+
appendErrors as ab,
|
|
80387
|
+
useFormContext as ac,
|
|
80388
|
+
Primitive as ad,
|
|
80389
|
+
cva as ae,
|
|
80390
|
+
FormProvider as af,
|
|
80391
|
+
Controller as ag,
|
|
80392
|
+
Slot as ah,
|
|
80393
|
+
useForm as ai,
|
|
80394
|
+
Root2 as aj,
|
|
80395
|
+
List as ak,
|
|
80396
|
+
Trigger as al,
|
|
80397
|
+
Content$2 as am,
|
|
80398
|
+
setModelName as an,
|
|
80399
|
+
setModelId as ao,
|
|
80400
|
+
setModelDescription as ap,
|
|
80401
|
+
setModelExtension as aq,
|
|
80402
|
+
setAuthorName as ar,
|
|
80403
|
+
setAuthorWebsite as as,
|
|
80404
|
+
setStateSchema as at,
|
|
80405
|
+
setInitialState as au,
|
|
80406
|
+
addModule as av,
|
|
80407
|
+
setModuleName as aw,
|
|
80408
|
+
deleteModule as ax,
|
|
80409
|
+
addOperation as ay,
|
|
80410
|
+
setOperationName as az,
|
|
80407
80411
|
addExternalPackage as b,
|
|
80408
80412
|
RENOWN_NETWORK_ID as c,
|
|
80409
80413
|
RENOWN_CHAIN_ID as d,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-DhH3gUSI.js","assets/main.C1DJvpcL.js","assets/app-CDOWlDp2.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __typeError = (msg) => {
|
|
4
4
|
throw TypeError(msg);
|
|
@@ -11,7 +11,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
11
11
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
12
12
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
13
13
|
var _tags, _levelString, _errorHandler, _ConsoleLogger_instances, levelValue_get, _getDocumentModelModule, _drives, _ReadModeService_instances, parseGraphQLErrors_fn, fetchDrive_fn, _a, _ServiceWorkerManager_instances, handleServiceWorkerMessage_fn, handleServiceWorker_fn;
|
|
14
|
-
import { _ as __vitePreload } from "./main.
|
|
14
|
+
import { _ as __vitePreload } from "./main.C1DJvpcL.js";
|
|
15
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
16
|
import { useState, useEffect, Suspense, lazy } from "react";
|
|
17
17
|
function _mergeNamespaces(n, m) {
|
|
@@ -22508,6 +22508,7 @@ class DefaultDrivesManager {
|
|
|
22508
22508
|
}
|
|
22509
22509
|
const PULL_DRIVE_INTERVAL = 1500;
|
|
22510
22510
|
const MAX_REVISIONS_PER_ACK = 100;
|
|
22511
|
+
const MAX_PULLS = 50;
|
|
22511
22512
|
let _staticLogger;
|
|
22512
22513
|
const staticLogger = () => {
|
|
22513
22514
|
if (!_staticLogger) {
|
|
@@ -22685,6 +22686,8 @@ class PullResponderTransmitter {
|
|
|
22685
22686
|
* All other errors are caught, logged, and passed to `onError`.
|
|
22686
22687
|
*
|
|
22687
22688
|
* Because of this, `onError` _may be called multiple times_.
|
|
22689
|
+
*
|
|
22690
|
+
* @returns boolean indicating whether there might be more data to pull
|
|
22688
22691
|
*/
|
|
22689
22692
|
static async executePull(driveId, trigger, onStrandUpdate, onError, onRevisions, onAcknowledge) {
|
|
22690
22693
|
var _a2, _b;
|
|
@@ -22710,7 +22713,7 @@ class PullResponderTransmitter {
|
|
|
22710
22713
|
} catch (error2) {
|
|
22711
22714
|
staticLogger().error(`Could not resolve 'Listener not found' error by registering a new pull responder for drive: ${driveId}, listenerId: ${listenerId}: ${error2}`);
|
|
22712
22715
|
onError(error2);
|
|
22713
|
-
return;
|
|
22716
|
+
return false;
|
|
22714
22717
|
}
|
|
22715
22718
|
break;
|
|
22716
22719
|
}
|
|
@@ -22719,7 +22722,7 @@ class PullResponderTransmitter {
|
|
|
22719
22722
|
if (!strands) {
|
|
22720
22723
|
staticLogger().error(`Error pulling strands for drive, and could not auto-register: ${driveId}, listenerId: ${trigger.data.listenerId}: ${error}`);
|
|
22721
22724
|
onError(error);
|
|
22722
|
-
return;
|
|
22725
|
+
return false;
|
|
22723
22726
|
}
|
|
22724
22727
|
if (!strands.length) {
|
|
22725
22728
|
staticLogger().verbose(`[SYNC DEBUG] No strands returned in pull cycle for drive: ${driveId}, listenerId: ${trigger.data.listenerId}`);
|
|
@@ -22729,7 +22732,7 @@ class PullResponderTransmitter {
|
|
|
22729
22732
|
staticLogger().error(`Error calling onRevisions for drive: ${driveId}, listenerId: ${trigger.data.listenerId}: ${error2}`);
|
|
22730
22733
|
onError(error2);
|
|
22731
22734
|
}
|
|
22732
|
-
return;
|
|
22735
|
+
return false;
|
|
22733
22736
|
}
|
|
22734
22737
|
staticLogger().verbose(`[SYNC DEBUG] Processing ${strands.length} strands in pull cycle for drive: ${driveId}, listenerId: ${trigger.data.listenerId}`);
|
|
22735
22738
|
const listenerRevisions = [];
|
|
@@ -22794,6 +22797,7 @@ class PullResponderTransmitter {
|
|
|
22794
22797
|
staticLogger().error(`Error calling onAcknowledge for drive: ${driveId}, listenerId: ${trigger.data.listenerId}: ${error2}`);
|
|
22795
22798
|
onError(error2);
|
|
22796
22799
|
}
|
|
22800
|
+
return strands.length > 0;
|
|
22797
22801
|
}
|
|
22798
22802
|
static setupPull(driveId, trigger, onStrandUpdate, onError, onRevisions, onAcknowledge) {
|
|
22799
22803
|
staticLogger().verbose(`[SYNC DEBUG] PullResponderTransmitter.setupPull initiated for drive: ${driveId}, listenerId: ${trigger.data.listenerId}`);
|
|
@@ -22814,7 +22818,15 @@ class PullResponderTransmitter {
|
|
|
22814
22818
|
const executeLoop = async () => {
|
|
22815
22819
|
while (!isCancelled) {
|
|
22816
22820
|
staticLogger().verbose(`[SYNC DEBUG] Starting pull cycle for drive: ${driveId}, listenerId: ${trigger.data.listenerId}`);
|
|
22817
|
-
|
|
22821
|
+
let counter = 0;
|
|
22822
|
+
let hasMore = true;
|
|
22823
|
+
while (hasMore && !isCancelled && counter < MAX_PULLS) {
|
|
22824
|
+
counter++;
|
|
22825
|
+
hasMore = await this.executePull(driveId, trigger, onStrandUpdate, onError, onRevisions, onAcknowledge);
|
|
22826
|
+
if (hasMore) {
|
|
22827
|
+
staticLogger().verbose(`[SYNC DEBUG] More strands available, continuing pull cycle for drive: ${driveId}, listenerId: ${trigger.data.listenerId}`);
|
|
22828
|
+
}
|
|
22829
|
+
}
|
|
22818
22830
|
staticLogger().verbose(`[SYNC DEBUG] Completed pull cycle for drive: ${driveId}, listenerId: ${trigger.data.listenerId}, waiting ${loopInterval}ms for next cycle`);
|
|
22819
22831
|
await new Promise((resolve) => {
|
|
22820
22832
|
staticLogger().verbose(`Scheduling next pull in ${loopInterval} ms`);
|
|
@@ -23096,10 +23108,10 @@ class BaseDocumentDriveServer {
|
|
|
23096
23108
|
__publicField(this, "queueDelegate", {
|
|
23097
23109
|
exists: (documentId) => this.documentStorage.exists(documentId),
|
|
23098
23110
|
processOperationJob: async ({ driveId, documentId, operations, options }) => {
|
|
23099
|
-
return !documentId || driveId === documentId ? this.
|
|
23111
|
+
return !documentId || driveId === documentId ? this.processDriveOperations(driveId, operations, options) : this.processOperations(driveId, documentId, operations, options);
|
|
23100
23112
|
},
|
|
23101
23113
|
processActionJob: async ({ driveId, documentId, actions: actions2, options }) => {
|
|
23102
|
-
return documentId ? this.
|
|
23114
|
+
return documentId ? this.processActions(driveId, documentId, actions2, options) : this.processDriveActions(driveId, actions2, options);
|
|
23103
23115
|
},
|
|
23104
23116
|
processJob: async (job) => {
|
|
23105
23117
|
if (isOperationJob(job)) {
|
|
@@ -23275,7 +23287,7 @@ class BaseDocumentDriveServer {
|
|
|
23275
23287
|
return this.triggerMap.delete(driveId);
|
|
23276
23288
|
}
|
|
23277
23289
|
async _initializeDrive(driveId) {
|
|
23278
|
-
var _a2, _b, _c
|
|
23290
|
+
var _a2, _b, _c;
|
|
23279
23291
|
const drive = await this.getDrive(driveId);
|
|
23280
23292
|
this.logger.verbose(`[SYNC DEBUG] Initializing drive ${driveId} with slug "${drive.state.global.slug}"`);
|
|
23281
23293
|
await this.synchronizationManager.initializeDriveSyncStatus(driveId, drive);
|
|
@@ -23287,16 +23299,16 @@ class BaseDocumentDriveServer {
|
|
|
23287
23299
|
for (const zodListener of drive.state.local.listeners) {
|
|
23288
23300
|
if (((_a2 = zodListener.callInfo) == null ? void 0 : _a2.transmitterType) === "SwitchboardPush") {
|
|
23289
23301
|
this.logger.verbose(`[SYNC DEBUG] Setting up SwitchboardPush listener ${zodListener.listenerId} for drive ${driveId}`);
|
|
23290
|
-
const transmitter = new SwitchboardPushTransmitter(
|
|
23291
|
-
this.logger.verbose(`[SYNC DEBUG] Created SwitchboardPush transmitter with URL: ${
|
|
23302
|
+
const transmitter = new SwitchboardPushTransmitter(zodListener.callInfo.data ?? "");
|
|
23303
|
+
this.logger.verbose(`[SYNC DEBUG] Created SwitchboardPush transmitter with URL: ${zodListener.callInfo.data || "none"}`);
|
|
23292
23304
|
await this.listenerManager.setListener(driveId, {
|
|
23293
23305
|
block: zodListener.block,
|
|
23294
23306
|
driveId: drive.state.global.id,
|
|
23295
23307
|
filter: {
|
|
23296
|
-
branch:
|
|
23297
|
-
documentId:
|
|
23298
|
-
documentType:
|
|
23299
|
-
scope:
|
|
23308
|
+
branch: zodListener.filter.branch ?? [],
|
|
23309
|
+
documentId: zodListener.filter.documentId ?? [],
|
|
23310
|
+
documentType: zodListener.filter.documentType ?? [],
|
|
23311
|
+
scope: zodListener.filter.scope ?? []
|
|
23300
23312
|
},
|
|
23301
23313
|
listenerId: zodListener.listenerId,
|
|
23302
23314
|
callInfo: zodListener.callInfo,
|
|
@@ -23306,7 +23318,7 @@ class BaseDocumentDriveServer {
|
|
|
23306
23318
|
}).then(() => {
|
|
23307
23319
|
this.logger.verbose(`[SYNC DEBUG] Successfully set up listener ${zodListener.listenerId} for drive ${driveId}`);
|
|
23308
23320
|
});
|
|
23309
|
-
} else if (((
|
|
23321
|
+
} else if (((_b = zodListener.callInfo) == null ? void 0 : _b.transmitterType) === "PullResponder") {
|
|
23310
23322
|
this.logger.verbose(`[SYNC DEBUG] Setting up PullResponder listener ${zodListener.listenerId} for drive ${driveId}`);
|
|
23311
23323
|
const pullResponderListener = {
|
|
23312
23324
|
driveId,
|
|
@@ -23325,7 +23337,7 @@ class BaseDocumentDriveServer {
|
|
|
23325
23337
|
pullResponderListener.transmitter = pullResponder;
|
|
23326
23338
|
await this.listenerManager.setListener(driveId, pullResponderListener);
|
|
23327
23339
|
} else {
|
|
23328
|
-
this.logger.error(`Skipping listener ${zodListener.listenerId} with unsupported type ${((
|
|
23340
|
+
this.logger.error(`Skipping listener ${zodListener.listenerId} with unsupported type ${((_c = zodListener.callInfo) == null ? void 0 : _c.transmitterType) || "unknown"}`);
|
|
23329
23341
|
}
|
|
23330
23342
|
}
|
|
23331
23343
|
}
|
|
@@ -23446,7 +23458,7 @@ class BaseDocumentDriveServer {
|
|
|
23446
23458
|
} catch (e) {
|
|
23447
23459
|
this.logger.error("Error getting drive from cache", e);
|
|
23448
23460
|
}
|
|
23449
|
-
const driveStorage = await this.
|
|
23461
|
+
const driveStorage = await this.documentStorage.getBySlug(slug);
|
|
23450
23462
|
const document = this._buildDocument(driveStorage, options);
|
|
23451
23463
|
if (!isDocumentDrive(document)) {
|
|
23452
23464
|
throw new Error(`Document with slug ${slug} is not a Document Drive`);
|
|
@@ -23749,7 +23761,7 @@ class BaseDocumentDriveServer {
|
|
|
23749
23761
|
actions: actions2,
|
|
23750
23762
|
options
|
|
23751
23763
|
});
|
|
23752
|
-
return new Promise((resolve, reject) => {
|
|
23764
|
+
return await new Promise((resolve, reject) => {
|
|
23753
23765
|
const unsubscribe = this.queueManager.on("jobCompleted", (job, result) => {
|
|
23754
23766
|
if (job.jobId === jobId) {
|
|
23755
23767
|
unsubscribe();
|
|
@@ -23780,7 +23792,7 @@ class BaseDocumentDriveServer {
|
|
|
23780
23792
|
actions: actions2,
|
|
23781
23793
|
options
|
|
23782
23794
|
});
|
|
23783
|
-
return new Promise((resolve, reject) => {
|
|
23795
|
+
return await new Promise((resolve, reject) => {
|
|
23784
23796
|
const unsubscribe = this.queueManager.on("jobCompleted", (job, result) => {
|
|
23785
23797
|
if (job.jobId === jobId) {
|
|
23786
23798
|
unsubscribe();
|
|
@@ -23802,6 +23814,9 @@ class BaseDocumentDriveServer {
|
|
|
23802
23814
|
}
|
|
23803
23815
|
}
|
|
23804
23816
|
async addOperations(driveId, documentId, operations, options) {
|
|
23817
|
+
return this.queueOperations(driveId, documentId, operations, options);
|
|
23818
|
+
}
|
|
23819
|
+
async processOperations(driveId, documentId, operations, options) {
|
|
23805
23820
|
const result = await this.resultIfExistingOperations(driveId, documentId, operations);
|
|
23806
23821
|
if (result) {
|
|
23807
23822
|
return result;
|
|
@@ -23946,7 +23961,7 @@ class BaseDocumentDriveServer {
|
|
|
23946
23961
|
operations,
|
|
23947
23962
|
options
|
|
23948
23963
|
});
|
|
23949
|
-
return new Promise((resolve, reject) => {
|
|
23964
|
+
return await new Promise((resolve, reject) => {
|
|
23950
23965
|
const unsubscribe = this.queueManager.on("jobCompleted", (job, result2) => {
|
|
23951
23966
|
if (job.jobId === jobId) {
|
|
23952
23967
|
unsubscribe();
|
|
@@ -23968,6 +23983,9 @@ class BaseDocumentDriveServer {
|
|
|
23968
23983
|
}
|
|
23969
23984
|
}
|
|
23970
23985
|
async addDriveOperations(driveId, operations, options) {
|
|
23986
|
+
return this.queueDriveOperations(driveId, operations, options);
|
|
23987
|
+
}
|
|
23988
|
+
async processDriveOperations(driveId, operations, options) {
|
|
23971
23989
|
let document;
|
|
23972
23990
|
const operationsApplied = [];
|
|
23973
23991
|
const signals = [];
|
|
@@ -24066,18 +24084,23 @@ class BaseDocumentDriveServer {
|
|
|
24066
24084
|
return this.addActions(driveId, documentId, [action], options);
|
|
24067
24085
|
}
|
|
24068
24086
|
async addActions(driveId, documentId, actions2, options) {
|
|
24087
|
+
return this.queueActions(driveId, documentId, actions2, options);
|
|
24088
|
+
}
|
|
24089
|
+
async processActions(driveId, documentId, actions2, options) {
|
|
24069
24090
|
const document = await this.getDocument(driveId, documentId);
|
|
24070
24091
|
const operations = this._buildOperations(document, actions2);
|
|
24071
|
-
return this.
|
|
24092
|
+
return this.processOperations(driveId, documentId, operations, options);
|
|
24072
24093
|
}
|
|
24073
24094
|
async addDriveAction(driveId, action, options) {
|
|
24074
24095
|
return this.addDriveActions(driveId, [action], options);
|
|
24075
24096
|
}
|
|
24076
24097
|
async addDriveActions(driveId, actions2, options) {
|
|
24098
|
+
return this.queueDriveActions(driveId, actions2, options);
|
|
24099
|
+
}
|
|
24100
|
+
async processDriveActions(driveId, actions2, options) {
|
|
24077
24101
|
const document = await this.getDrive(driveId);
|
|
24078
24102
|
const operations = this._buildOperations(document, actions2);
|
|
24079
|
-
|
|
24080
|
-
return result;
|
|
24103
|
+
return this.processDriveOperations(driveId, operations, options);
|
|
24081
24104
|
}
|
|
24082
24105
|
async detachDrive(driveId) {
|
|
24083
24106
|
const documentDrive = await this.getDrive(driveId);
|
|
@@ -24156,8 +24179,10 @@ class MemoryStorage {
|
|
|
24156
24179
|
constructor() {
|
|
24157
24180
|
__publicField(this, "documents");
|
|
24158
24181
|
__publicField(this, "driveManifests");
|
|
24182
|
+
__publicField(this, "slugToDocumentId");
|
|
24159
24183
|
this.documents = {};
|
|
24160
24184
|
this.driveManifests = {};
|
|
24185
|
+
this.slugToDocumentId = {};
|
|
24161
24186
|
}
|
|
24162
24187
|
////////////////////////////////
|
|
24163
24188
|
// IDocumentStorage
|
|
@@ -24167,7 +24192,15 @@ class MemoryStorage {
|
|
|
24167
24192
|
}
|
|
24168
24193
|
// TODO: this should throw an error if the document already exists.
|
|
24169
24194
|
create(documentId, document) {
|
|
24195
|
+
var _a2;
|
|
24170
24196
|
this.documents[documentId] = document;
|
|
24197
|
+
const slug = (_a2 = document.initialState.state.global) == null ? void 0 : _a2.slug;
|
|
24198
|
+
if (slug) {
|
|
24199
|
+
if (this.slugToDocumentId[slug]) {
|
|
24200
|
+
throw new Error(`Document with slug ${slug} already exists`);
|
|
24201
|
+
}
|
|
24202
|
+
this.slugToDocumentId[slug] = documentId;
|
|
24203
|
+
}
|
|
24171
24204
|
return Promise.resolve();
|
|
24172
24205
|
}
|
|
24173
24206
|
get(documentId) {
|
|
@@ -24177,7 +24210,22 @@ class MemoryStorage {
|
|
|
24177
24210
|
}
|
|
24178
24211
|
return Promise.resolve(document);
|
|
24179
24212
|
}
|
|
24213
|
+
getBySlug(slug) {
|
|
24214
|
+
const documentId = this.slugToDocumentId[slug];
|
|
24215
|
+
if (!documentId) {
|
|
24216
|
+
throw new Error(`Document with slug ${slug} not found`);
|
|
24217
|
+
}
|
|
24218
|
+
return this.get(documentId);
|
|
24219
|
+
}
|
|
24180
24220
|
async delete(documentId) {
|
|
24221
|
+
var _a2;
|
|
24222
|
+
const document = this.documents[documentId];
|
|
24223
|
+
if (document) {
|
|
24224
|
+
const slug = (_a2 = document.initialState.state.global) == null ? void 0 : _a2.slug;
|
|
24225
|
+
if (slug && this.slugToDocumentId[slug] === documentId) {
|
|
24226
|
+
delete this.slugToDocumentId[slug];
|
|
24227
|
+
}
|
|
24228
|
+
}
|
|
24181
24229
|
const drives = await this.getDrives();
|
|
24182
24230
|
for (const driveId of drives) {
|
|
24183
24231
|
if (driveId === documentId)
|
|
@@ -24221,6 +24269,7 @@ class MemoryStorage {
|
|
|
24221
24269
|
async clearStorage() {
|
|
24222
24270
|
this.documents = {};
|
|
24223
24271
|
this.driveManifests = {};
|
|
24272
|
+
this.slugToDocumentId = {};
|
|
24224
24273
|
}
|
|
24225
24274
|
async addDocumentOperations(drive, id, operations, header) {
|
|
24226
24275
|
const document = await this.get(id);
|
|
@@ -24237,27 +24286,7 @@ class MemoryStorage {
|
|
|
24237
24286
|
async getDrives() {
|
|
24238
24287
|
return Object.keys(this.driveManifests);
|
|
24239
24288
|
}
|
|
24240
|
-
async getDriveBySlug(slug) {
|
|
24241
|
-
for (const driveId of Object.keys(this.driveManifests)) {
|
|
24242
|
-
const drive = this.documents[driveId];
|
|
24243
|
-
if (drive.initialState.state.global.slug === slug) {
|
|
24244
|
-
return drive;
|
|
24245
|
-
}
|
|
24246
|
-
}
|
|
24247
|
-
throw new Error(`Drive with slug ${slug} not found`);
|
|
24248
|
-
}
|
|
24249
24289
|
async createDrive(id, drive) {
|
|
24250
|
-
const slug = drive.initialState.state.global.slug;
|
|
24251
|
-
if (slug) {
|
|
24252
|
-
let existingDrive;
|
|
24253
|
-
try {
|
|
24254
|
-
existingDrive = await this.getDriveBySlug(slug);
|
|
24255
|
-
} catch {
|
|
24256
|
-
}
|
|
24257
|
-
if (existingDrive) {
|
|
24258
|
-
throw new Error(`Drive with slug ${slug} already exists`);
|
|
24259
|
-
}
|
|
24260
|
-
}
|
|
24261
24290
|
await this.create(id, drive);
|
|
24262
24291
|
this.updateDriveManifest(id, { documentIds: /* @__PURE__ */ new Set() });
|
|
24263
24292
|
}
|
|
@@ -24274,6 +24303,7 @@ class MemoryStorage {
|
|
|
24274
24303
|
const manifest = this.getManifest(id);
|
|
24275
24304
|
const drives = await this.getDrives();
|
|
24276
24305
|
await Promise.all([...manifest.documentIds].map((docId) => {
|
|
24306
|
+
var _a2;
|
|
24277
24307
|
for (const driveId of drives) {
|
|
24278
24308
|
if (driveId === id) {
|
|
24279
24309
|
continue;
|
|
@@ -24283,6 +24313,13 @@ class MemoryStorage {
|
|
|
24283
24313
|
return;
|
|
24284
24314
|
}
|
|
24285
24315
|
}
|
|
24316
|
+
const document = this.documents[docId];
|
|
24317
|
+
if (document) {
|
|
24318
|
+
const slug = (_a2 = document.initialState.state.global) == null ? void 0 : _a2.slug;
|
|
24319
|
+
if (slug && this.slugToDocumentId[slug] === docId) {
|
|
24320
|
+
delete this.slugToDocumentId[slug];
|
|
24321
|
+
}
|
|
24322
|
+
}
|
|
24286
24323
|
delete this.documents[docId];
|
|
24287
24324
|
}));
|
|
24288
24325
|
delete this.driveManifests[id];
|
|
@@ -25781,7 +25818,7 @@ const nodeOptionsMap = {
|
|
|
25781
25818
|
};
|
|
25782
25819
|
const name = "@powerhousedao/connect";
|
|
25783
25820
|
const productName = "Powerhouse-Connect";
|
|
25784
|
-
const version$1 = "1.0.16-dev.
|
|
25821
|
+
const version$1 = "1.0.16-dev.2";
|
|
25785
25822
|
const description = "Powerhouse Connect";
|
|
25786
25823
|
const main = "./dist/index.html";
|
|
25787
25824
|
const type = "module";
|
|
@@ -28588,8 +28625,18 @@ const _BrowserStorage = class _BrowserStorage {
|
|
|
28588
28625
|
}
|
|
28589
28626
|
// TODO: this should throw an error if the document already exists.
|
|
28590
28627
|
async create(documentId, document) {
|
|
28628
|
+
var _a2;
|
|
28591
28629
|
const db = await this.db;
|
|
28592
28630
|
await db.setItem(this.buildDocumentKey(documentId), document);
|
|
28631
|
+
const slug = ((_a2 = document.initialState.state.global) == null ? void 0 : _a2.slug) ?? documentId;
|
|
28632
|
+
if (slug) {
|
|
28633
|
+
const slugManifest = await this.getSlugManifest();
|
|
28634
|
+
if (slugManifest.slugToId[slug]) {
|
|
28635
|
+
throw new Error(`Document with slug ${slug} already exists`);
|
|
28636
|
+
}
|
|
28637
|
+
slugManifest.slugToId[slug] = documentId;
|
|
28638
|
+
await this.updateSlugManifest(slugManifest);
|
|
28639
|
+
}
|
|
28593
28640
|
}
|
|
28594
28641
|
async get(documentId) {
|
|
28595
28642
|
const db = await this.db;
|
|
@@ -28599,12 +28646,32 @@ const _BrowserStorage = class _BrowserStorage {
|
|
|
28599
28646
|
}
|
|
28600
28647
|
return document;
|
|
28601
28648
|
}
|
|
28649
|
+
async getBySlug(slug) {
|
|
28650
|
+
const slugManifest = await this.getSlugManifest();
|
|
28651
|
+
const documentId = slugManifest.slugToId[slug];
|
|
28652
|
+
if (!documentId) {
|
|
28653
|
+
throw new Error(`Document with slug ${slug} not found`);
|
|
28654
|
+
}
|
|
28655
|
+
return this.get(documentId);
|
|
28656
|
+
}
|
|
28602
28657
|
async delete(documentId) {
|
|
28658
|
+
var _a2;
|
|
28603
28659
|
const db = await this.db;
|
|
28604
28660
|
const document = await db.getItem(this.buildDocumentKey(documentId));
|
|
28605
28661
|
if (!document) {
|
|
28606
28662
|
return false;
|
|
28607
28663
|
}
|
|
28664
|
+
try {
|
|
28665
|
+
const slug = (_a2 = document.initialState.state.global) == null ? void 0 : _a2.slug;
|
|
28666
|
+
if (slug) {
|
|
28667
|
+
const slugManifest = await this.getSlugManifest();
|
|
28668
|
+
if (slugManifest.slugToId[slug] === documentId) {
|
|
28669
|
+
delete slugManifest.slugToId[slug];
|
|
28670
|
+
await this.updateSlugManifest(slugManifest);
|
|
28671
|
+
}
|
|
28672
|
+
}
|
|
28673
|
+
} catch (error) {
|
|
28674
|
+
}
|
|
28608
28675
|
const drives = await this.getDrives();
|
|
28609
28676
|
for (const driveId of drives) {
|
|
28610
28677
|
if (driveId === documentId)
|
|
@@ -28655,6 +28722,15 @@ const _BrowserStorage = class _BrowserStorage {
|
|
|
28655
28722
|
const db = await this.db;
|
|
28656
28723
|
await db.setItem(this.buildManifestKey(driveId), manifest);
|
|
28657
28724
|
}
|
|
28725
|
+
async getSlugManifest() {
|
|
28726
|
+
const db = await this.db;
|
|
28727
|
+
const manifest = await db.getItem(_BrowserStorage.SLUG_MANIFEST_KEY);
|
|
28728
|
+
return manifest || { slugToId: {} };
|
|
28729
|
+
}
|
|
28730
|
+
async updateSlugManifest(manifest) {
|
|
28731
|
+
const db = await this.db;
|
|
28732
|
+
await db.setItem(_BrowserStorage.SLUG_MANIFEST_KEY, manifest);
|
|
28733
|
+
}
|
|
28658
28734
|
async clearStorage() {
|
|
28659
28735
|
return (await this.db).clear();
|
|
28660
28736
|
}
|
|
@@ -28676,28 +28752,7 @@ const _BrowserStorage = class _BrowserStorage {
|
|
|
28676
28752
|
const keys = await db.keys();
|
|
28677
28753
|
return keys.filter((key) => key.startsWith(_BrowserStorage.MANIFEST_KEY)).map((key) => key.slice(_BrowserStorage.MANIFEST_KEY.length + _BrowserStorage.SEP.length));
|
|
28678
28754
|
}
|
|
28679
|
-
async getDriveBySlug(slug) {
|
|
28680
|
-
const drives = (await this.getDrives()).reverse();
|
|
28681
|
-
for (const drive of drives) {
|
|
28682
|
-
const driveData = await this.get(drive);
|
|
28683
|
-
if (driveData.initialState.state.global.slug === slug) {
|
|
28684
|
-
return driveData;
|
|
28685
|
-
}
|
|
28686
|
-
}
|
|
28687
|
-
throw new Error(`Drive with slug ${slug} not found`);
|
|
28688
|
-
}
|
|
28689
28755
|
async createDrive(id, drive) {
|
|
28690
|
-
const slug = drive.initialState.state.global.slug;
|
|
28691
|
-
if (slug) {
|
|
28692
|
-
let existingDrive;
|
|
28693
|
-
try {
|
|
28694
|
-
existingDrive = await this.getDriveBySlug(slug);
|
|
28695
|
-
} catch {
|
|
28696
|
-
}
|
|
28697
|
-
if (existingDrive) {
|
|
28698
|
-
throw new Error(`Drive with slug ${slug} already exists`);
|
|
28699
|
-
}
|
|
28700
|
-
}
|
|
28701
28756
|
await this.create(id, drive);
|
|
28702
28757
|
await this.updateDriveManifest(id, { documentIds: [] });
|
|
28703
28758
|
}
|
|
@@ -28783,6 +28838,7 @@ __publicField(_BrowserStorage, "DBName", "DOCUMENT_DRIVES");
|
|
|
28783
28838
|
__publicField(_BrowserStorage, "SEP", ":");
|
|
28784
28839
|
__publicField(_BrowserStorage, "DOCUMENT_KEY", "DOCUMENT");
|
|
28785
28840
|
__publicField(_BrowserStorage, "MANIFEST_KEY", "MANIFEST");
|
|
28841
|
+
__publicField(_BrowserStorage, "SLUG_MANIFEST_KEY", "SLUG_MANIFEST");
|
|
28786
28842
|
let BrowserStorage = _BrowserStorage;
|
|
28787
28843
|
const DEFAULT_DRIVES_URL = window.__VITE_ENVS.PH_CONNECT_DEFAULT_DRIVES_URL || void 0;
|
|
28788
28844
|
const defaultDrivesUrl = DEFAULT_DRIVES_URL ? DEFAULT_DRIVES_URL.split(",") : [];
|
|
@@ -31386,7 +31442,7 @@ if (window.__VITE_ENVS.MODE === "development") {
|
|
|
31386
31442
|
} else {
|
|
31387
31443
|
serviceWorkerManager.registerServiceWorker(false);
|
|
31388
31444
|
}
|
|
31389
|
-
const App = lazy(() => __vitePreload(() => import("./app-
|
|
31445
|
+
const App = lazy(() => __vitePreload(() => import("./app-DhH3gUSI.js").then((n) => n.aQ), true ? __vite__mapDeps([0,1,2]) : void 0));
|
|
31390
31446
|
const AppLoader = /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(App, {}) });
|
|
31391
31447
|
const appLoader = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
31392
31448
|
__proto__: null,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./main.
|
|
1
|
+
import { aG as BaseError, aH as getUrl, aI as stringify, aJ as decodeErrorResult, aK as isAddressEqual, aL as call, aM as concat, aN as encodeAbiParameters, aO as HttpRequestError, aP as isHex } from "./app-DhH3gUSI.js";
|
|
2
|
+
import "./main.C1DJvpcL.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
|
-
import "./app-loader-
|
|
4
|
+
import "./app-loader-Btk_wf_z.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "@powerhousedao/reactor-browser";
|
|
7
7
|
import "react-dom";
|