@powerhousedao/connect 1.0.16-dev.1 → 1.0.16-dev.3
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-mup06TxF.js → app-DwbSet2T.js} +3794 -1119
- package/dist/assets/{app-loader-ByxyqGmZ.js → app-loader-BdSc2Vvq.js} +215 -170
- package/dist/assets/{ccip-ASjKzegb.js → ccip-DZZrGkgi.js} +3 -9
- package/dist/assets/{content-DmxMPHbR.js → content-DhXca2Mw.js} +433 -22
- package/dist/assets/{index-B8rDFj5N.js → index-UNOfsmTA.js} +3 -9
- package/dist/assets/{index-Bf_-VrwW.js → index-eML1bcMq.js} +3 -3
- package/dist/assets/index-ft3Wt36_.js +404 -0
- package/dist/assets/{main.BooYX2Lr.js → main.OXkp562h.js} +1 -1
- package/dist/index.html +2 -34
- package/dist/vite-envs.sh +1 -1
- package/package.json +6 -6
- package/dist/assets/index-10OwZr6e.js +0 -2560
- 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-7OQWVUC5.js +0 -43
- package/dist/modules/@powerhousedao/reactor-browser/chunk-7RTGQTV5.js +0 -14215
- 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-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-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-NPCM4GRM.js +0 -82
- 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-REEGAZVT.js +0 -113
- package/dist/modules/@powerhousedao/reactor-browser/chunk-RGIB4DD4.js +0 -162
- package/dist/modules/@powerhousedao/reactor-browser/chunk-RUNTF5WD.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-ULJSSMFA.js +0 -178
- 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-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/app-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-DwbSet2T.js","assets/main.OXkp562h.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.OXkp562h.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) {
|
|
@@ -23108,10 +23108,10 @@ class BaseDocumentDriveServer {
|
|
|
23108
23108
|
__publicField(this, "queueDelegate", {
|
|
23109
23109
|
exists: (documentId) => this.documentStorage.exists(documentId),
|
|
23110
23110
|
processOperationJob: async ({ driveId, documentId, operations, options }) => {
|
|
23111
|
-
return !documentId || driveId === documentId ? this.
|
|
23111
|
+
return !documentId || driveId === documentId ? this.processDriveOperations(driveId, operations, options) : this.processOperations(driveId, documentId, operations, options);
|
|
23112
23112
|
},
|
|
23113
23113
|
processActionJob: async ({ driveId, documentId, actions: actions2, options }) => {
|
|
23114
|
-
return documentId ? this.
|
|
23114
|
+
return documentId ? this.processActions(driveId, documentId, actions2, options) : this.processDriveActions(driveId, actions2, options);
|
|
23115
23115
|
},
|
|
23116
23116
|
processJob: async (job) => {
|
|
23117
23117
|
if (isOperationJob(job)) {
|
|
@@ -23287,7 +23287,7 @@ class BaseDocumentDriveServer {
|
|
|
23287
23287
|
return this.triggerMap.delete(driveId);
|
|
23288
23288
|
}
|
|
23289
23289
|
async _initializeDrive(driveId) {
|
|
23290
|
-
var _a2, _b, _c
|
|
23290
|
+
var _a2, _b, _c;
|
|
23291
23291
|
const drive = await this.getDrive(driveId);
|
|
23292
23292
|
this.logger.verbose(`[SYNC DEBUG] Initializing drive ${driveId} with slug "${drive.state.global.slug}"`);
|
|
23293
23293
|
await this.synchronizationManager.initializeDriveSyncStatus(driveId, drive);
|
|
@@ -23299,16 +23299,16 @@ class BaseDocumentDriveServer {
|
|
|
23299
23299
|
for (const zodListener of drive.state.local.listeners) {
|
|
23300
23300
|
if (((_a2 = zodListener.callInfo) == null ? void 0 : _a2.transmitterType) === "SwitchboardPush") {
|
|
23301
23301
|
this.logger.verbose(`[SYNC DEBUG] Setting up SwitchboardPush listener ${zodListener.listenerId} for drive ${driveId}`);
|
|
23302
|
-
const transmitter = new SwitchboardPushTransmitter(
|
|
23303
|
-
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"}`);
|
|
23304
23304
|
await this.listenerManager.setListener(driveId, {
|
|
23305
23305
|
block: zodListener.block,
|
|
23306
23306
|
driveId: drive.state.global.id,
|
|
23307
23307
|
filter: {
|
|
23308
|
-
branch:
|
|
23309
|
-
documentId:
|
|
23310
|
-
documentType:
|
|
23311
|
-
scope:
|
|
23308
|
+
branch: zodListener.filter.branch ?? [],
|
|
23309
|
+
documentId: zodListener.filter.documentId ?? [],
|
|
23310
|
+
documentType: zodListener.filter.documentType ?? [],
|
|
23311
|
+
scope: zodListener.filter.scope ?? []
|
|
23312
23312
|
},
|
|
23313
23313
|
listenerId: zodListener.listenerId,
|
|
23314
23314
|
callInfo: zodListener.callInfo,
|
|
@@ -23318,7 +23318,7 @@ class BaseDocumentDriveServer {
|
|
|
23318
23318
|
}).then(() => {
|
|
23319
23319
|
this.logger.verbose(`[SYNC DEBUG] Successfully set up listener ${zodListener.listenerId} for drive ${driveId}`);
|
|
23320
23320
|
});
|
|
23321
|
-
} else if (((
|
|
23321
|
+
} else if (((_b = zodListener.callInfo) == null ? void 0 : _b.transmitterType) === "PullResponder") {
|
|
23322
23322
|
this.logger.verbose(`[SYNC DEBUG] Setting up PullResponder listener ${zodListener.listenerId} for drive ${driveId}`);
|
|
23323
23323
|
const pullResponderListener = {
|
|
23324
23324
|
driveId,
|
|
@@ -23337,7 +23337,7 @@ class BaseDocumentDriveServer {
|
|
|
23337
23337
|
pullResponderListener.transmitter = pullResponder;
|
|
23338
23338
|
await this.listenerManager.setListener(driveId, pullResponderListener);
|
|
23339
23339
|
} else {
|
|
23340
|
-
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"}`);
|
|
23341
23341
|
}
|
|
23342
23342
|
}
|
|
23343
23343
|
}
|
|
@@ -23458,7 +23458,7 @@ class BaseDocumentDriveServer {
|
|
|
23458
23458
|
} catch (e) {
|
|
23459
23459
|
this.logger.error("Error getting drive from cache", e);
|
|
23460
23460
|
}
|
|
23461
|
-
const driveStorage = await this.
|
|
23461
|
+
const driveStorage = await this.documentStorage.getBySlug(slug);
|
|
23462
23462
|
const document = this._buildDocument(driveStorage, options);
|
|
23463
23463
|
if (!isDocumentDrive(document)) {
|
|
23464
23464
|
throw new Error(`Document with slug ${slug} is not a Document Drive`);
|
|
@@ -23761,7 +23761,7 @@ class BaseDocumentDriveServer {
|
|
|
23761
23761
|
actions: actions2,
|
|
23762
23762
|
options
|
|
23763
23763
|
});
|
|
23764
|
-
return new Promise((resolve, reject) => {
|
|
23764
|
+
return await new Promise((resolve, reject) => {
|
|
23765
23765
|
const unsubscribe = this.queueManager.on("jobCompleted", (job, result) => {
|
|
23766
23766
|
if (job.jobId === jobId) {
|
|
23767
23767
|
unsubscribe();
|
|
@@ -23792,7 +23792,7 @@ class BaseDocumentDriveServer {
|
|
|
23792
23792
|
actions: actions2,
|
|
23793
23793
|
options
|
|
23794
23794
|
});
|
|
23795
|
-
return new Promise((resolve, reject) => {
|
|
23795
|
+
return await new Promise((resolve, reject) => {
|
|
23796
23796
|
const unsubscribe = this.queueManager.on("jobCompleted", (job, result) => {
|
|
23797
23797
|
if (job.jobId === jobId) {
|
|
23798
23798
|
unsubscribe();
|
|
@@ -23814,6 +23814,9 @@ class BaseDocumentDriveServer {
|
|
|
23814
23814
|
}
|
|
23815
23815
|
}
|
|
23816
23816
|
async addOperations(driveId, documentId, operations, options) {
|
|
23817
|
+
return this.queueOperations(driveId, documentId, operations, options);
|
|
23818
|
+
}
|
|
23819
|
+
async processOperations(driveId, documentId, operations, options) {
|
|
23817
23820
|
const result = await this.resultIfExistingOperations(driveId, documentId, operations);
|
|
23818
23821
|
if (result) {
|
|
23819
23822
|
return result;
|
|
@@ -23958,7 +23961,7 @@ class BaseDocumentDriveServer {
|
|
|
23958
23961
|
operations,
|
|
23959
23962
|
options
|
|
23960
23963
|
});
|
|
23961
|
-
return new Promise((resolve, reject) => {
|
|
23964
|
+
return await new Promise((resolve, reject) => {
|
|
23962
23965
|
const unsubscribe = this.queueManager.on("jobCompleted", (job, result2) => {
|
|
23963
23966
|
if (job.jobId === jobId) {
|
|
23964
23967
|
unsubscribe();
|
|
@@ -23980,6 +23983,9 @@ class BaseDocumentDriveServer {
|
|
|
23980
23983
|
}
|
|
23981
23984
|
}
|
|
23982
23985
|
async addDriveOperations(driveId, operations, options) {
|
|
23986
|
+
return this.queueDriveOperations(driveId, operations, options);
|
|
23987
|
+
}
|
|
23988
|
+
async processDriveOperations(driveId, operations, options) {
|
|
23983
23989
|
let document;
|
|
23984
23990
|
const operationsApplied = [];
|
|
23985
23991
|
const signals = [];
|
|
@@ -24078,18 +24084,23 @@ class BaseDocumentDriveServer {
|
|
|
24078
24084
|
return this.addActions(driveId, documentId, [action], options);
|
|
24079
24085
|
}
|
|
24080
24086
|
async addActions(driveId, documentId, actions2, options) {
|
|
24087
|
+
return this.queueActions(driveId, documentId, actions2, options);
|
|
24088
|
+
}
|
|
24089
|
+
async processActions(driveId, documentId, actions2, options) {
|
|
24081
24090
|
const document = await this.getDocument(driveId, documentId);
|
|
24082
24091
|
const operations = this._buildOperations(document, actions2);
|
|
24083
|
-
return this.
|
|
24092
|
+
return this.processOperations(driveId, documentId, operations, options);
|
|
24084
24093
|
}
|
|
24085
24094
|
async addDriveAction(driveId, action, options) {
|
|
24086
24095
|
return this.addDriveActions(driveId, [action], options);
|
|
24087
24096
|
}
|
|
24088
24097
|
async addDriveActions(driveId, actions2, options) {
|
|
24098
|
+
return this.queueDriveActions(driveId, actions2, options);
|
|
24099
|
+
}
|
|
24100
|
+
async processDriveActions(driveId, actions2, options) {
|
|
24089
24101
|
const document = await this.getDrive(driveId);
|
|
24090
24102
|
const operations = this._buildOperations(document, actions2);
|
|
24091
|
-
|
|
24092
|
-
return result;
|
|
24103
|
+
return this.processDriveOperations(driveId, operations, options);
|
|
24093
24104
|
}
|
|
24094
24105
|
async detachDrive(driveId) {
|
|
24095
24106
|
const documentDrive = await this.getDrive(driveId);
|
|
@@ -24168,8 +24179,10 @@ class MemoryStorage {
|
|
|
24168
24179
|
constructor() {
|
|
24169
24180
|
__publicField(this, "documents");
|
|
24170
24181
|
__publicField(this, "driveManifests");
|
|
24182
|
+
__publicField(this, "slugToDocumentId");
|
|
24171
24183
|
this.documents = {};
|
|
24172
24184
|
this.driveManifests = {};
|
|
24185
|
+
this.slugToDocumentId = {};
|
|
24173
24186
|
}
|
|
24174
24187
|
////////////////////////////////
|
|
24175
24188
|
// IDocumentStorage
|
|
@@ -24179,7 +24192,15 @@ class MemoryStorage {
|
|
|
24179
24192
|
}
|
|
24180
24193
|
// TODO: this should throw an error if the document already exists.
|
|
24181
24194
|
create(documentId, document) {
|
|
24195
|
+
var _a2;
|
|
24182
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
|
+
}
|
|
24183
24204
|
return Promise.resolve();
|
|
24184
24205
|
}
|
|
24185
24206
|
get(documentId) {
|
|
@@ -24189,7 +24210,22 @@ class MemoryStorage {
|
|
|
24189
24210
|
}
|
|
24190
24211
|
return Promise.resolve(document);
|
|
24191
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
|
+
}
|
|
24192
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
|
+
}
|
|
24193
24229
|
const drives = await this.getDrives();
|
|
24194
24230
|
for (const driveId of drives) {
|
|
24195
24231
|
if (driveId === documentId)
|
|
@@ -24233,6 +24269,7 @@ class MemoryStorage {
|
|
|
24233
24269
|
async clearStorage() {
|
|
24234
24270
|
this.documents = {};
|
|
24235
24271
|
this.driveManifests = {};
|
|
24272
|
+
this.slugToDocumentId = {};
|
|
24236
24273
|
}
|
|
24237
24274
|
async addDocumentOperations(drive, id, operations, header) {
|
|
24238
24275
|
const document = await this.get(id);
|
|
@@ -24249,27 +24286,7 @@ class MemoryStorage {
|
|
|
24249
24286
|
async getDrives() {
|
|
24250
24287
|
return Object.keys(this.driveManifests);
|
|
24251
24288
|
}
|
|
24252
|
-
async getDriveBySlug(slug) {
|
|
24253
|
-
for (const driveId of Object.keys(this.driveManifests)) {
|
|
24254
|
-
const drive = this.documents[driveId];
|
|
24255
|
-
if (drive.initialState.state.global.slug === slug) {
|
|
24256
|
-
return drive;
|
|
24257
|
-
}
|
|
24258
|
-
}
|
|
24259
|
-
throw new Error(`Drive with slug ${slug} not found`);
|
|
24260
|
-
}
|
|
24261
24289
|
async createDrive(id, drive) {
|
|
24262
|
-
const slug = drive.initialState.state.global.slug;
|
|
24263
|
-
if (slug) {
|
|
24264
|
-
let existingDrive;
|
|
24265
|
-
try {
|
|
24266
|
-
existingDrive = await this.getDriveBySlug(slug);
|
|
24267
|
-
} catch {
|
|
24268
|
-
}
|
|
24269
|
-
if (existingDrive) {
|
|
24270
|
-
throw new Error(`Drive with slug ${slug} already exists`);
|
|
24271
|
-
}
|
|
24272
|
-
}
|
|
24273
24290
|
await this.create(id, drive);
|
|
24274
24291
|
this.updateDriveManifest(id, { documentIds: /* @__PURE__ */ new Set() });
|
|
24275
24292
|
}
|
|
@@ -24286,6 +24303,7 @@ class MemoryStorage {
|
|
|
24286
24303
|
const manifest = this.getManifest(id);
|
|
24287
24304
|
const drives = await this.getDrives();
|
|
24288
24305
|
await Promise.all([...manifest.documentIds].map((docId) => {
|
|
24306
|
+
var _a2;
|
|
24289
24307
|
for (const driveId of drives) {
|
|
24290
24308
|
if (driveId === id) {
|
|
24291
24309
|
continue;
|
|
@@ -24295,6 +24313,13 @@ class MemoryStorage {
|
|
|
24295
24313
|
return;
|
|
24296
24314
|
}
|
|
24297
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
|
+
}
|
|
24298
24323
|
delete this.documents[docId];
|
|
24299
24324
|
}));
|
|
24300
24325
|
delete this.driveManifests[id];
|
|
@@ -25793,7 +25818,7 @@ const nodeOptionsMap = {
|
|
|
25793
25818
|
};
|
|
25794
25819
|
const name = "@powerhousedao/connect";
|
|
25795
25820
|
const productName = "Powerhouse-Connect";
|
|
25796
|
-
const version$1 = "1.0.16-dev.
|
|
25821
|
+
const version$1 = "1.0.16-dev.3";
|
|
25797
25822
|
const description = "Powerhouse Connect";
|
|
25798
25823
|
const main = "./dist/index.html";
|
|
25799
25824
|
const type = "module";
|
|
@@ -28600,8 +28625,18 @@ const _BrowserStorage = class _BrowserStorage {
|
|
|
28600
28625
|
}
|
|
28601
28626
|
// TODO: this should throw an error if the document already exists.
|
|
28602
28627
|
async create(documentId, document) {
|
|
28628
|
+
var _a2;
|
|
28603
28629
|
const db = await this.db;
|
|
28604
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
|
+
}
|
|
28605
28640
|
}
|
|
28606
28641
|
async get(documentId) {
|
|
28607
28642
|
const db = await this.db;
|
|
@@ -28611,12 +28646,32 @@ const _BrowserStorage = class _BrowserStorage {
|
|
|
28611
28646
|
}
|
|
28612
28647
|
return document;
|
|
28613
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
|
+
}
|
|
28614
28657
|
async delete(documentId) {
|
|
28658
|
+
var _a2;
|
|
28615
28659
|
const db = await this.db;
|
|
28616
28660
|
const document = await db.getItem(this.buildDocumentKey(documentId));
|
|
28617
28661
|
if (!document) {
|
|
28618
28662
|
return false;
|
|
28619
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
|
+
}
|
|
28620
28675
|
const drives = await this.getDrives();
|
|
28621
28676
|
for (const driveId of drives) {
|
|
28622
28677
|
if (driveId === documentId)
|
|
@@ -28667,6 +28722,15 @@ const _BrowserStorage = class _BrowserStorage {
|
|
|
28667
28722
|
const db = await this.db;
|
|
28668
28723
|
await db.setItem(this.buildManifestKey(driveId), manifest);
|
|
28669
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
|
+
}
|
|
28670
28734
|
async clearStorage() {
|
|
28671
28735
|
return (await this.db).clear();
|
|
28672
28736
|
}
|
|
@@ -28688,28 +28752,7 @@ const _BrowserStorage = class _BrowserStorage {
|
|
|
28688
28752
|
const keys = await db.keys();
|
|
28689
28753
|
return keys.filter((key) => key.startsWith(_BrowserStorage.MANIFEST_KEY)).map((key) => key.slice(_BrowserStorage.MANIFEST_KEY.length + _BrowserStorage.SEP.length));
|
|
28690
28754
|
}
|
|
28691
|
-
async getDriveBySlug(slug) {
|
|
28692
|
-
const drives = (await this.getDrives()).reverse();
|
|
28693
|
-
for (const drive of drives) {
|
|
28694
|
-
const driveData = await this.get(drive);
|
|
28695
|
-
if (driveData.initialState.state.global.slug === slug) {
|
|
28696
|
-
return driveData;
|
|
28697
|
-
}
|
|
28698
|
-
}
|
|
28699
|
-
throw new Error(`Drive with slug ${slug} not found`);
|
|
28700
|
-
}
|
|
28701
28755
|
async createDrive(id, drive) {
|
|
28702
|
-
const slug = drive.initialState.state.global.slug;
|
|
28703
|
-
if (slug) {
|
|
28704
|
-
let existingDrive;
|
|
28705
|
-
try {
|
|
28706
|
-
existingDrive = await this.getDriveBySlug(slug);
|
|
28707
|
-
} catch {
|
|
28708
|
-
}
|
|
28709
|
-
if (existingDrive) {
|
|
28710
|
-
throw new Error(`Drive with slug ${slug} already exists`);
|
|
28711
|
-
}
|
|
28712
|
-
}
|
|
28713
28756
|
await this.create(id, drive);
|
|
28714
28757
|
await this.updateDriveManifest(id, { documentIds: [] });
|
|
28715
28758
|
}
|
|
@@ -28795,6 +28838,7 @@ __publicField(_BrowserStorage, "DBName", "DOCUMENT_DRIVES");
|
|
|
28795
28838
|
__publicField(_BrowserStorage, "SEP", ":");
|
|
28796
28839
|
__publicField(_BrowserStorage, "DOCUMENT_KEY", "DOCUMENT");
|
|
28797
28840
|
__publicField(_BrowserStorage, "MANIFEST_KEY", "MANIFEST");
|
|
28841
|
+
__publicField(_BrowserStorage, "SLUG_MANIFEST_KEY", "SLUG_MANIFEST");
|
|
28798
28842
|
let BrowserStorage = _BrowserStorage;
|
|
28799
28843
|
const DEFAULT_DRIVES_URL = window.__VITE_ENVS.PH_CONNECT_DEFAULT_DRIVES_URL || void 0;
|
|
28800
28844
|
const defaultDrivesUrl = DEFAULT_DRIVES_URL ? DEFAULT_DRIVES_URL.split(",") : [];
|
|
@@ -31398,7 +31442,7 @@ if (window.__VITE_ENVS.MODE === "development") {
|
|
|
31398
31442
|
} else {
|
|
31399
31443
|
serviceWorkerManager.registerServiceWorker(false);
|
|
31400
31444
|
}
|
|
31401
|
-
const App = lazy(() => __vitePreload(() => import("./app-
|
|
31445
|
+
const App = lazy(() => __vitePreload(() => import("./app-DwbSet2T.js").then((n) => n.aY), true ? __vite__mapDeps([0,1,2]) : void 0));
|
|
31402
31446
|
const AppLoader = /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(App, {}) });
|
|
31403
31447
|
const appLoader = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
31404
31448
|
__proto__: null,
|
|
@@ -31445,29 +31489,29 @@ export {
|
|
|
31445
31489
|
recordType as a7,
|
|
31446
31490
|
stringType as a8,
|
|
31447
31491
|
capitalCase as a9,
|
|
31448
|
-
|
|
31449
|
-
|
|
31450
|
-
|
|
31451
|
-
|
|
31452
|
-
|
|
31453
|
-
|
|
31454
|
-
|
|
31455
|
-
|
|
31456
|
-
|
|
31457
|
-
|
|
31458
|
-
|
|
31459
|
-
|
|
31460
|
-
|
|
31461
|
-
|
|
31462
|
-
|
|
31463
|
-
|
|
31464
|
-
|
|
31465
|
-
|
|
31466
|
-
|
|
31467
|
-
|
|
31468
|
-
|
|
31469
|
-
|
|
31470
|
-
|
|
31492
|
+
moveNode as aA,
|
|
31493
|
+
generateNodesCopy as aB,
|
|
31494
|
+
copyNode as aC,
|
|
31495
|
+
createState as aD,
|
|
31496
|
+
setDriveName as aE,
|
|
31497
|
+
setAvailableOffline as aF,
|
|
31498
|
+
setSharingType as aG,
|
|
31499
|
+
SynchronizationUnitNotFoundError as aH,
|
|
31500
|
+
removeTrigger as aI,
|
|
31501
|
+
generateUUID as aJ,
|
|
31502
|
+
PullResponderTransmitter as aK,
|
|
31503
|
+
addTrigger as aL,
|
|
31504
|
+
ReadDriveNotFoundError as aM,
|
|
31505
|
+
openUrl as aN,
|
|
31506
|
+
getNodeOptions as aO,
|
|
31507
|
+
DRIVE as aP,
|
|
31508
|
+
FOLDER as aQ,
|
|
31509
|
+
requestPublicDrive as aR,
|
|
31510
|
+
serviceWorkerManager as aS,
|
|
31511
|
+
packageJson as aT,
|
|
31512
|
+
t as aU,
|
|
31513
|
+
gql as aV,
|
|
31514
|
+
request as aW,
|
|
31471
31515
|
getDimensions as aX,
|
|
31472
31516
|
READ as aY,
|
|
31473
31517
|
nodeOptionsMap as aZ,
|
|
@@ -31481,25 +31525,25 @@ export {
|
|
|
31481
31525
|
getDefaults as ag,
|
|
31482
31526
|
connectConfig as ah,
|
|
31483
31527
|
hashDocumentStateForScope as ai,
|
|
31484
|
-
|
|
31485
|
-
|
|
31486
|
-
|
|
31487
|
-
|
|
31488
|
-
|
|
31489
|
-
|
|
31490
|
-
|
|
31491
|
-
|
|
31492
|
-
|
|
31493
|
-
|
|
31494
|
-
|
|
31495
|
-
|
|
31496
|
-
|
|
31497
|
-
|
|
31498
|
-
|
|
31499
|
-
|
|
31500
|
-
|
|
31528
|
+
getAugmentedNamespace as aj,
|
|
31529
|
+
setErrorHandler as ak,
|
|
31530
|
+
driveDocumentModelModule as al,
|
|
31531
|
+
createBrowserDocumentDriveServer as am,
|
|
31532
|
+
hashKey as an,
|
|
31533
|
+
childLogger as ao,
|
|
31534
|
+
reducer as ap,
|
|
31535
|
+
isDocumentDrive as aq,
|
|
31536
|
+
generateAddNodeAction as ar,
|
|
31537
|
+
isFileNode as as,
|
|
31538
|
+
uploadDocumentOperations as at,
|
|
31539
|
+
updateFile as au,
|
|
31540
|
+
addFolder as av,
|
|
31541
|
+
isFolderNode as aw,
|
|
31542
|
+
deleteNode as ax,
|
|
31543
|
+
updateNode as ay,
|
|
31544
|
+
FILE as az,
|
|
31501
31545
|
SetStateSchemaInputSchema as b,
|
|
31502
|
-
|
|
31546
|
+
GraphQLFloat as b$,
|
|
31503
31547
|
RENAME as b0,
|
|
31504
31548
|
WRITE as b1,
|
|
31505
31549
|
DUPLICATE as b2,
|
|
@@ -31507,73 +31551,74 @@ export {
|
|
|
31507
31551
|
garbageCollect as b4,
|
|
31508
31552
|
sortOperations as b5,
|
|
31509
31553
|
UI_NODE as b6,
|
|
31510
|
-
|
|
31511
|
-
|
|
31512
|
-
|
|
31513
|
-
|
|
31514
|
-
|
|
31515
|
-
|
|
31516
|
-
|
|
31517
|
-
|
|
31518
|
-
|
|
31519
|
-
|
|
31520
|
-
|
|
31521
|
-
|
|
31522
|
-
|
|
31523
|
-
|
|
31524
|
-
|
|
31525
|
-
|
|
31526
|
-
|
|
31527
|
-
|
|
31528
|
-
|
|
31529
|
-
|
|
31530
|
-
|
|
31531
|
-
|
|
31532
|
-
|
|
31533
|
-
|
|
31534
|
-
|
|
31535
|
-
|
|
31536
|
-
|
|
31537
|
-
|
|
31538
|
-
|
|
31539
|
-
|
|
31540
|
-
|
|
31541
|
-
|
|
31542
|
-
|
|
31543
|
-
|
|
31544
|
-
|
|
31545
|
-
|
|
31546
|
-
|
|
31547
|
-
|
|
31548
|
-
|
|
31549
|
-
|
|
31550
|
-
|
|
31551
|
-
|
|
31552
|
-
|
|
31553
|
-
|
|
31554
|
-
|
|
31555
|
-
|
|
31556
|
-
|
|
31557
|
-
|
|
31558
|
-
|
|
31559
|
-
|
|
31560
|
-
|
|
31561
|
-
|
|
31562
|
-
|
|
31563
|
-
|
|
31564
|
-
|
|
31565
|
-
|
|
31554
|
+
generateId as b7,
|
|
31555
|
+
undo as b8,
|
|
31556
|
+
redo as b9,
|
|
31557
|
+
isListType as bA,
|
|
31558
|
+
snakeCase as bB,
|
|
31559
|
+
constantCase as bC,
|
|
31560
|
+
isAbstractType as bD,
|
|
31561
|
+
BREAK as bE,
|
|
31562
|
+
GraphQLInputObjectType as bF,
|
|
31563
|
+
GraphQLList as bG,
|
|
31564
|
+
GraphQLEnumType as bH,
|
|
31565
|
+
GraphQLObjectType as bI,
|
|
31566
|
+
GraphQLInterfaceType as bJ,
|
|
31567
|
+
SchemaMetaFieldDef as bK,
|
|
31568
|
+
TypeMetaFieldDef as bL,
|
|
31569
|
+
TypeNameMetaFieldDef as bM,
|
|
31570
|
+
isCompositeType as bN,
|
|
31571
|
+
isOutputType as bO,
|
|
31572
|
+
isInputType as bP,
|
|
31573
|
+
GraphQLBoolean as bQ,
|
|
31574
|
+
assertAbstractType as bR,
|
|
31575
|
+
doTypesOverlap as bS,
|
|
31576
|
+
DirectiveLocation as bT,
|
|
31577
|
+
specifiedRules as bU,
|
|
31578
|
+
NoUnusedFragmentsRule as bV,
|
|
31579
|
+
ExecutableDefinitionsRule as bW,
|
|
31580
|
+
validate as bX,
|
|
31581
|
+
validateSchema as bY,
|
|
31582
|
+
GraphQLID as bZ,
|
|
31583
|
+
GraphQLString as b_,
|
|
31584
|
+
useDocumentDispatch as ba,
|
|
31585
|
+
inspect as bb,
|
|
31586
|
+
GraphQLError as bc,
|
|
31587
|
+
getNamedType as bd,
|
|
31588
|
+
invariant as be,
|
|
31589
|
+
isInputObjectType as bf,
|
|
31590
|
+
isScalarType as bg,
|
|
31591
|
+
isObjectType as bh,
|
|
31592
|
+
isInterfaceType as bi,
|
|
31593
|
+
isUnionType as bj,
|
|
31594
|
+
isEnumType as bk,
|
|
31595
|
+
print as bl,
|
|
31596
|
+
isPrintableAsBlockString as bm,
|
|
31597
|
+
Kind as bn,
|
|
31598
|
+
astFromValue as bo,
|
|
31599
|
+
DEFAULT_DEPRECATION_REASON as bp,
|
|
31600
|
+
isSpecifiedDirective as bq,
|
|
31601
|
+
isSpecifiedScalarType as br,
|
|
31602
|
+
isIntrospectionType as bs,
|
|
31603
|
+
z as bt,
|
|
31604
|
+
GraphQLScalarType as bu,
|
|
31605
|
+
parse as bv,
|
|
31606
|
+
visit as bw,
|
|
31607
|
+
buildASTSchema as bx,
|
|
31608
|
+
extendSchema as by,
|
|
31609
|
+
getNullableType as bz,
|
|
31566
31610
|
createAction as c,
|
|
31567
|
-
|
|
31568
|
-
|
|
31569
|
-
|
|
31570
|
-
|
|
31571
|
-
|
|
31572
|
-
|
|
31573
|
-
|
|
31574
|
-
|
|
31575
|
-
|
|
31576
|
-
|
|
31611
|
+
GraphQLInt as c0,
|
|
31612
|
+
GraphQLDirective as c1,
|
|
31613
|
+
GraphQLUnionType as c2,
|
|
31614
|
+
isNonNullType as c3,
|
|
31615
|
+
GraphQLNonNull as c4,
|
|
31616
|
+
isNamedType as c5,
|
|
31617
|
+
isLeafType as c6,
|
|
31618
|
+
GraphQLSchema as c7,
|
|
31619
|
+
buildSchema as c8,
|
|
31620
|
+
sentenceCase as c9,
|
|
31621
|
+
appLoader as ca,
|
|
31577
31622
|
ReorderModuleOperationsInputSchema as d,
|
|
31578
31623
|
DeleteOperationInputSchema as e,
|
|
31579
31624
|
SetOperationReducerInputSchema as f,
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./main.
|
|
1
|
+
import { aO as BaseError, aP as getUrl, aQ as stringify, aR as decodeErrorResult, aS as isAddressEqual, aT as call, aU as concat, aV as encodeAbiParameters, aW as HttpRequestError, aX as isHex } from "./app-DwbSet2T.js";
|
|
2
|
+
import "./main.OXkp562h.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
|
-
import "./app-loader-
|
|
4
|
+
import "./app-loader-BdSc2Vvq.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import "@powerhousedao/reactor-browser";
|
|
7
6
|
import "react-dom";
|
|
8
|
-
import "@powerhousedao/reactor-browser/hooks/useUiNodesContext";
|
|
9
|
-
import "@powerhousedao/reactor-browser/hooks/useDriveActionsWithUiNodes";
|
|
10
|
-
import "@powerhousedao/reactor-browser/hooks/useDriveContext";
|
|
11
|
-
import "@powerhousedao/reactor-browser/uiNodes/constants";
|
|
12
|
-
import "@powerhousedao/reactor-browser/hooks/document-state";
|
|
13
7
|
class OffchainLookupError extends BaseError {
|
|
14
8
|
constructor({ callbackSelector, cause, data, extraData, sender, urls }) {
|
|
15
9
|
var _a;
|