@powerhousedao/connect 1.0.0-dev.245 → 1.0.0-dev.247
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/.env +0 -5
- package/dist/assets/{app-BH-6rUAk.js → app-Bjaniq_f.js} +14 -56
- package/dist/assets/{app-76Vr3j5e.css → app-D9QJBr8i.css} +1 -1
- package/dist/assets/{app-loader-CQdXsdrs.js → app-loader-CnDRDKWw.js} +500 -369
- package/dist/assets/{ccip-DzlgrM-Q.js → ccip-BIN6bp0k.js} +3 -3
- package/dist/assets/{content-CGSfY9bJ.js → content-CT8IEBqv.js} +3 -3
- package/dist/assets/{index-Boh2tg26.js → index-BaBnabbX.js} +4 -4
- package/dist/assets/{index-BR7pEetO.js → index-BeBd0Q5I.js} +3 -3
- package/dist/assets/{index-Ck0OHqQ0.js → index-CWxXMTAJ.js} +3 -3
- package/dist/assets/{main.PwF6jbJu.js → main.DonDJ7tf.js} +1 -1
- package/dist/external-packages.js +5 -0
- package/dist/hmr.js +4 -1
- package/dist/index.html +1 -4
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-K62SYQYI.js → chunk-6MBHOHAA.js} +53 -5
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-UIXXJKR2.js → chunk-IC6B3767.js} +1 -1
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-4AV4NYOH.js → chunk-N5UNGAA6.js} +310 -223
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-GZM7UEXF.js → chunk-OYYVE7RP.js} +1 -1
- package/dist/modules/@powerhousedao/reactor-browser/{chunk-QVHWUIBE.js → chunk-UDKYG6I4.js} +1 -1
- package/dist/modules/@powerhousedao/reactor-browser/context/index.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/context/read-mode.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/hooks/index.js +3 -3
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActions.js +2 -2
- package/dist/modules/@powerhousedao/reactor-browser/hooks/useDriveActionsWithUiNodes.js +3 -3
- package/dist/modules/@powerhousedao/reactor-browser/index.js +5 -5
- package/dist/modules/@powerhousedao/reactor-browser/reactor.js +2 -2
- package/dist/swEnv.js +0 -3
- package/dist/vite-envs.sh +1 -28
- package/package.json +7 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { aD as BaseError, aE as getUrl, aF as stringify, aG as decodeErrorResult, aH as isAddressEqual, aI as call, aJ as concat, aK as encodeAbiParameters, aL as HttpRequestError, aM as isHex } from "./app-
|
|
2
|
-
import "./main.
|
|
1
|
+
import { aD as BaseError, aE as getUrl, aF as stringify, aG as decodeErrorResult, aH as isAddressEqual, aI as call, aJ as concat, aK as encodeAbiParameters, aL as HttpRequestError, aM as isHex } from "./app-Bjaniq_f.js";
|
|
2
|
+
import "./main.DonDJ7tf.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
|
-
import "./app-loader-
|
|
4
|
+
import "./app-loader-CnDRDKWw.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "@powerhousedao/reactor-browser";
|
|
7
7
|
import "react-dom";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
2
|
-
import { t as twMerge, B as Button, m as mergeClassNameProps, E as ERROR, M as MISSING, C as CONFLICT, S as SUCCESS, h as SYNCING, I as INITIAL_SYNC, i as ConnectDropdownMenu, u as useOnClickOutside, j as useEventListener, k as useCopyToClipboard, l as Select, n as ENSAvatar, P as Provider, o as Root3, T as Trigger, p as Portal, q as Content2, v as validateInitialState, w as validateStateSchemaName, x as validateModules, y as useUnwrappedReactor, z as useConnectDid, A as useConnectCrypto, D as useTranslation, F as useModal, G as useAtomValue, H as themeAtom, J as useUser, K as useUserPermissions, L as useUiNodes, N as exportFile, O as useGetDocumentModelModule, Q as addActionContext, U as signOperation, V as useDocumentDriveServer, W as useHotkeys, X as useGetEditor, Y as isSameDocument, Z as useNavigate, _ as ErrorBoundary, $ as DriveLayout, a0 as SearchBar, a1 as useAsyncReactor, a2 as useFilteredDocumentModels, a3 as useDriveEditor, a4 as useDocumentDriveById } from "./app-
|
|
2
|
+
import { t as twMerge, B as Button, m as mergeClassNameProps, E as ERROR, M as MISSING, C as CONFLICT, S as SUCCESS, h as SYNCING, I as INITIAL_SYNC, i as ConnectDropdownMenu, u as useOnClickOutside, j as useEventListener, k as useCopyToClipboard, l as Select, n as ENSAvatar, P as Provider, o as Root3, T as Trigger, p as Portal, q as Content2, v as validateInitialState, w as validateStateSchemaName, x as validateModules, y as useUnwrappedReactor, z as useConnectDid, A as useConnectCrypto, D as useTranslation, F as useModal, G as useAtomValue, H as themeAtom, J as useUser, K as useUserPermissions, L as useUiNodes, N as exportFile, O as useGetDocumentModelModule, Q as addActionContext, U as signOperation, V as useDocumentDriveServer, W as useHotkeys, X as useGetEditor, Y as isSameDocument, Z as useNavigate, _ as ErrorBoundary, $ as DriveLayout, a0 as SearchBar, a1 as useAsyncReactor, a2 as useFilteredDocumentModels, a3 as useDriveEditor, a4 as useDocumentDriveById } from "./app-Bjaniq_f.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import React__default, { useState, useCallback, useMemo, useEffect, Fragment, useRef, useLayoutEffect, memo as memo$1, createElement, useSyncExternalStore, Suspense } from "react";
|
|
5
|
-
import { _ as Icon, aX as getDimensions, aY as READ, aZ as nodeOptionsMap, a_ as defaultFileOptions, a$ as DELETE, b0 as RENAME, b1 as WRITE, b2 as DUPLICATE, b3 as defaultFolderOptions, b4 as garbageCollect, b5 as sortOperations, b6 as UI_NODE, aO as DRIVE, ay as FILE, b7 as undo, b8 as redo, ac as logger, b9 as useDocumentDispatch, aP as FOLDER, ak as driveDocumentModelModule } from "./app-loader-
|
|
5
|
+
import { _ as Icon, aX as getDimensions, aY as READ, aZ as nodeOptionsMap, a_ as defaultFileOptions, a$ as DELETE, b0 as RENAME, b1 as WRITE, b2 as DUPLICATE, b3 as defaultFolderOptions, b4 as garbageCollect, b5 as sortOperations, b6 as UI_NODE, aO as DRIVE, ay as FILE, b7 as undo, b8 as redo, ac as logger, b9 as useDocumentDispatch, aP as FOLDER, ak as driveDocumentModelModule } from "./app-loader-CnDRDKWw.js";
|
|
6
6
|
import { useDocument, useDocumentEditorProps } from "@powerhousedao/reactor-browser";
|
|
7
7
|
import { useUiNodesContext, FILE as FILE$1 } from "@powerhousedao/reactor-browser/hooks/useUiNodesContext";
|
|
8
8
|
import { useDriveActionsWithUiNodes } from "@powerhousedao/reactor-browser/hooks/useDriveActionsWithUiNodes";
|
|
@@ -10,7 +10,7 @@ import { useDriveContext, DriveContextProvider } from "@powerhousedao/reactor-br
|
|
|
10
10
|
import "@powerhousedao/reactor-browser/uiNodes/constants";
|
|
11
11
|
import { makeDriveDocumentStateHook } from "@powerhousedao/reactor-browser/hooks/document-state";
|
|
12
12
|
import { flushSync } from "react-dom";
|
|
13
|
-
import "./main.
|
|
13
|
+
import "./main.DonDJ7tf.js";
|
|
14
14
|
const PaginationButton = ({ active = false, ...props }) => {
|
|
15
15
|
const className = twMerge("h-8 min-w-8 border border-solid border-gray-300 bg-white px-3 py-1 text-xs text-gray-900 hover:bg-gray-100", !active && "border-0");
|
|
16
16
|
return jsx(Button, { color: "light", size: "small", ...mergeClassNameProps(props, className), children: props.children });
|
|
@@ -10,10 +10,10 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
10
10
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
12
|
var _DB_NAME, _STORE_NAME, _KEY, _db, _BrowserKeyStorage_instances, useStore_fn, _subtleCrypto, _keyPair, _keyPairStorage, _did, _ConnectCrypto_instances, initCrypto_fn, initialize_fn, parseDid_fn, generateECDSAKeyPair_fn, exportKeyPair_fn, importKeyPair_fn, _sign, _verify, _store, _namespace, _BaseStorage_instances, buildKey_fn, _baseUrl, _store2, _connectId, _eventEmitter, _Renown_instances, updateUser_fn, getCredential_fn;
|
|
13
|
-
import { _ as __vitePreload } from "./main.
|
|
14
|
-
import { aW as getAugmentedNamespace, $ as getDefaultExportFromCjs, ah as connectConfig, ac as logger } from "./app-loader-
|
|
15
|
-
import { e as eventsExports, R as RENOWN_URL, g as getEnsInfo } from "./app-
|
|
16
|
-
import { d, c, b, f, a, r, s } from "./app-
|
|
13
|
+
import { _ as __vitePreload } from "./main.DonDJ7tf.js";
|
|
14
|
+
import { aW as getAugmentedNamespace, $ as getDefaultExportFromCjs, ah as connectConfig, ac as logger } from "./app-loader-CnDRDKWw.js";
|
|
15
|
+
import { e as eventsExports, R as RENOWN_URL, g as getEnsInfo } from "./app-Bjaniq_f.js";
|
|
16
|
+
import { d, c, b, f, a, r, s } from "./app-Bjaniq_f.js";
|
|
17
17
|
import "react/jsx-runtime";
|
|
18
18
|
import "react";
|
|
19
19
|
import "@powerhousedao/reactor-browser";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { t as twMerge, a5 as clsx, a6 as get, a7 as set, a8 as appendErrors, a9 as useFormContext, aa as Primitive, ab as cva, ac as FormProvider, ad as Controller, ae as Slot, af as useForm, ag as Root2, ah as List, ai as Trigger, aj as Content, ak as setModelName, al as setModelId, am as setModelDescription, an as setModelExtension, ao as setAuthorName, ap as setAuthorWebsite, aq as setStateSchema, ar as setInitialState, as as addModule, at as setModuleName, au as deleteModule, av as addOperation, aw as setOperationName, ax as setOperationSchema, ay as setOperationDescription, az as deleteOperation, aA as addOperationError, aB as deleteOperationError, aC as setOperationErrorName } from "./app-
|
|
3
|
-
import { ba as inspect$1, bb as GraphQLError$1, bc as getNamedType, bd as invariant$2, be as isInputObjectType, bf as isScalarType, bg as isObjectType, bh as isInterfaceType, bi as isUnionType, bj as isEnumType, bk as print, bl as isPrintableAsBlockString, bm as Kind, bn as astFromValue$1, bo as DEFAULT_DEPRECATION_REASON, bp as isSpecifiedDirective, bq as isSpecifiedScalarType, br as isIntrospectionType, bs as z, bt as GraphQLScalarType, Z as pascalCase, bu as parse, bv as visit, bw as buildASTSchema, bx as extendSchema, by as getNullableType, bz as isListType, $ as getDefaultExportFromCjs, bA as snakeCase, bB as constantCase, bC as isAbstractType, bD as BREAK, bE as GraphQLInputObjectType, bF as GraphQLList, bG as GraphQLEnumType, bH as GraphQLObjectType, bI as GraphQLInterfaceType, bJ as SchemaMetaFieldDef, bK as TypeMetaFieldDef, bL as TypeNameMetaFieldDef, bM as isCompositeType, bN as isOutputType, bO as isInputType, bP as GraphQLBoolean, bQ as assertAbstractType, bR as doTypesOverlap, bS as DirectiveLocation, bT as specifiedRules$1, bU as NoUnusedFragmentsRule$1, bV as ExecutableDefinitionsRule$1, bW as validate$2, bX as validateSchema, bY as GraphQLID, bZ as GraphQLString, b_ as GraphQLFloat, b$ as GraphQLInt, c0 as GraphQLDirective, c1 as GraphQLUnionType, c2 as isNonNullType, c3 as GraphQLNonNull, c4 as isNamedType, c5 as isLeafType, c6 as GraphQLSchema, c7 as buildSchema, c8 as sentenceCase, am as hashKey } from "./app-loader-
|
|
2
|
+
import { t as twMerge, a5 as clsx, a6 as get, a7 as set, a8 as appendErrors, a9 as useFormContext, aa as Primitive, ab as cva, ac as FormProvider, ad as Controller, ae as Slot, af as useForm, ag as Root2, ah as List, ai as Trigger, aj as Content, ak as setModelName, al as setModelId, am as setModelDescription, an as setModelExtension, ao as setAuthorName, ap as setAuthorWebsite, aq as setStateSchema, ar as setInitialState, as as addModule, at as setModuleName, au as deleteModule, av as addOperation, aw as setOperationName, ax as setOperationSchema, ay as setOperationDescription, az as deleteOperation, aA as addOperationError, aB as deleteOperationError, aC as setOperationErrorName } from "./app-Bjaniq_f.js";
|
|
3
|
+
import { ba as inspect$1, bb as GraphQLError$1, bc as getNamedType, bd as invariant$2, be as isInputObjectType, bf as isScalarType, bg as isObjectType, bh as isInterfaceType, bi as isUnionType, bj as isEnumType, bk as print, bl as isPrintableAsBlockString, bm as Kind, bn as astFromValue$1, bo as DEFAULT_DEPRECATION_REASON, bp as isSpecifiedDirective, bq as isSpecifiedScalarType, br as isIntrospectionType, bs as z, bt as GraphQLScalarType, Z as pascalCase, bu as parse, bv as visit, bw as buildASTSchema, bx as extendSchema, by as getNullableType, bz as isListType, $ as getDefaultExportFromCjs, bA as snakeCase, bB as constantCase, bC as isAbstractType, bD as BREAK, bE as GraphQLInputObjectType, bF as GraphQLList, bG as GraphQLEnumType, bH as GraphQLObjectType, bI as GraphQLInterfaceType, bJ as SchemaMetaFieldDef, bK as TypeMetaFieldDef, bL as TypeNameMetaFieldDef, bM as isCompositeType, bN as isOutputType, bO as isInputType, bP as GraphQLBoolean, bQ as assertAbstractType, bR as doTypesOverlap, bS as DirectiveLocation, bT as specifiedRules$1, bU as NoUnusedFragmentsRule$1, bV as ExecutableDefinitionsRule$1, bW as validate$2, bX as validateSchema, bY as GraphQLID, bZ as GraphQLString, b_ as GraphQLFloat, b$ as GraphQLInt, c0 as GraphQLDirective, c1 as GraphQLUnionType, c2 as isNonNullType, c3 as GraphQLNonNull, c4 as isNamedType, c5 as isLeafType, c6 as GraphQLSchema, c7 as buildSchema, c8 as sentenceCase, am as hashKey } from "./app-loader-CnDRDKWw.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import React__default, { forwardRef, useRef, useCallback, useImperativeHandle, useEffect, useState, createContext, useContext, memo, useId, useMemo } from "react";
|
|
6
|
-
import "./main.
|
|
6
|
+
import "./main.DonDJ7tf.js";
|
|
7
7
|
import "@powerhousedao/reactor-browser";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
import "@powerhousedao/reactor-browser/hooks/useUiNodesContext";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-loader-
|
|
2
|
-
import { _ as __vitePreload } from "./main.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-loader-CnDRDKWw.js","assets/main.DonDJ7tf.js","assets/app-loader-Bnp0H-wa.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import { _ as __vitePreload } from "./main.DonDJ7tf.js";
|
|
3
3
|
import { createRoot } from "react-dom/client";
|
|
4
4
|
async function renderApp(element) {
|
|
5
|
-
const AppLoader = await __vitePreload(() => import("./app-loader-
|
|
5
|
+
const AppLoader = await __vitePreload(() => import("./app-loader-CnDRDKWw.js").then((n) => n.c9), true ? __vite__mapDeps([0,1,2]) : void 0);
|
|
6
6
|
createRoot(element).render(AppLoader.default);
|
|
7
7
|
}
|
|
8
8
|
const AppElement = document.getElementById("app");
|
|
@@ -99,7 +99,7 @@ const __vitePreload = function preload(baseModule, deps, importerUrl) {
|
|
|
99
99
|
return baseModule().catch(handlePreloadError);
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
|
-
__vitePreload(() => import("./index-
|
|
102
|
+
__vitePreload(() => import("./index-CWxXMTAJ.js"), true ? [] : void 0);
|
|
103
103
|
export {
|
|
104
104
|
__vitePreload as _
|
|
105
105
|
};
|
package/dist/hmr.js
CHANGED
package/dist/index.html
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"APP_VERSION": "IiI=",
|
|
8
8
|
"REQUIRES_HARD_REFRESH": "dHJ1ZQ==",
|
|
9
9
|
"SENTRY_RELEASE": "IiI=",
|
|
10
|
-
"LOAD_EXTERNAL_PACKAGES": "InRydWUi",
|
|
11
10
|
"BASE_PATH": "Ii8i",
|
|
12
11
|
"BASE_HREF": "Ii4vIg==",
|
|
13
12
|
"PH_CONNECT_APP_REQUIRES_HARD_REFRESH": "InRydWUi",
|
|
@@ -42,8 +41,6 @@
|
|
|
42
41
|
"PH_CONNECT_SENTRY_ENV": "InByb2Qi",
|
|
43
42
|
"PH_CONNECT_SENTRY_TRACING_ENABLED": "ImZhbHNlIg==",
|
|
44
43
|
"PH_CONNECT_GA_TRACKING_ID": "IiI=",
|
|
45
|
-
"LOCAL_DOCUMENT_MODELS": "IiI=",
|
|
46
|
-
"LOCAL_DOCUMENT_EDITORS": "IiI=",
|
|
47
44
|
"FILE_UPLOAD_OPERATIONS_CHUNK_SIZE": "IjUwIg==",
|
|
48
45
|
"PH_CONNECT_VERSION_CHECK_INTERVAL": "IjM2MDAwMDAi",
|
|
49
46
|
"PH_CONNECT_CLI_VERSION": "IiI="
|
|
@@ -97,4 +94,4 @@
|
|
|
97
94
|
"@powerhousedao/reactor-browser/utils/index": "/modules/@powerhousedao/reactor-browser/utils/index.js",
|
|
98
95
|
"@powerhousedao/reactor-browser/utils/signature": "/modules/@powerhousedao/reactor-browser/utils/signature.js"
|
|
99
96
|
}
|
|
100
|
-
}</script><script type="module" crossorigin="" src="/assets/main.
|
|
97
|
+
}</script><script type="module" crossorigin="" src="/assets/main.DonDJ7tf.js"></script></head><body><div id="app"></div></body></html>
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
ReactorBuilder,
|
|
5
5
|
memory_default,
|
|
6
6
|
mergeOperations
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-N5UNGAA6.js";
|
|
8
8
|
import {
|
|
9
9
|
__commonJS,
|
|
10
10
|
__require,
|
|
@@ -2208,6 +2208,10 @@ var BrowserStorage = class _BrowserStorage {
|
|
|
2208
2208
|
name: namespace ? `${namespace}:${_BrowserStorage.DBName}` : _BrowserStorage.DBName
|
|
2209
2209
|
}));
|
|
2210
2210
|
}
|
|
2211
|
+
async clear() {
|
|
2212
|
+
const db = await this.db;
|
|
2213
|
+
await db.clear();
|
|
2214
|
+
}
|
|
2211
2215
|
////////////////////////////////
|
|
2212
2216
|
// IDocumentStorage
|
|
2213
2217
|
////////////////////////////////
|
|
@@ -2228,13 +2232,57 @@ var BrowserStorage = class _BrowserStorage {
|
|
|
2228
2232
|
}
|
|
2229
2233
|
return document;
|
|
2230
2234
|
}
|
|
2235
|
+
async delete(documentId) {
|
|
2236
|
+
const db = await this.db;
|
|
2237
|
+
const document = await db.getItem(this.buildDocumentKey(documentId));
|
|
2238
|
+
if (!document) {
|
|
2239
|
+
return false;
|
|
2240
|
+
}
|
|
2241
|
+
const drives = await this.getDrives();
|
|
2242
|
+
for (const driveId of drives) {
|
|
2243
|
+
if (driveId === documentId)
|
|
2244
|
+
continue;
|
|
2245
|
+
await this.removeChild(driveId, documentId);
|
|
2246
|
+
}
|
|
2247
|
+
await db.removeItem(this.buildManifestKey(documentId));
|
|
2248
|
+
await db.removeItem(this.buildDocumentKey(documentId));
|
|
2249
|
+
return true;
|
|
2250
|
+
}
|
|
2251
|
+
async removeChild(parentId, childId) {
|
|
2252
|
+
const manifest = await this.getManifest(parentId);
|
|
2253
|
+
const docIndex = manifest.documentIds.indexOf(childId);
|
|
2254
|
+
if (docIndex !== -1) {
|
|
2255
|
+
manifest.documentIds.splice(docIndex, 1);
|
|
2256
|
+
await this.updateDriveManifest(parentId, manifest);
|
|
2257
|
+
return true;
|
|
2258
|
+
}
|
|
2259
|
+
return false;
|
|
2260
|
+
}
|
|
2261
|
+
async addChild(parentId, childId) {
|
|
2262
|
+
if (parentId === childId) {
|
|
2263
|
+
throw new Error("Cannot associate a document with itself");
|
|
2264
|
+
}
|
|
2265
|
+
const children = await this.getChildren(childId);
|
|
2266
|
+
if (children.includes(parentId)) {
|
|
2267
|
+
throw new Error("Cannot associate a document with its child");
|
|
2268
|
+
}
|
|
2269
|
+
const manifest = await this.getManifest(parentId);
|
|
2270
|
+
if (!manifest.documentIds.includes(childId)) {
|
|
2271
|
+
manifest.documentIds.push(childId);
|
|
2272
|
+
await this.updateDriveManifest(parentId, manifest);
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
async getChildren(parentId) {
|
|
2276
|
+
const manifest = await this.getManifest(parentId);
|
|
2277
|
+
return manifest.documentIds;
|
|
2278
|
+
}
|
|
2231
2279
|
////////////////////////////////
|
|
2232
2280
|
// IDriveStorage
|
|
2233
2281
|
////////////////////////////////
|
|
2234
2282
|
checkDocumentExists(drive, documentId) {
|
|
2235
2283
|
return this.exists(documentId);
|
|
2236
2284
|
}
|
|
2237
|
-
async
|
|
2285
|
+
async getManifest(driveId) {
|
|
2238
2286
|
const db = await this.db;
|
|
2239
2287
|
const manifest = await db.getItem(this.buildManifestKey(driveId));
|
|
2240
2288
|
return manifest || { documentIds: [] };
|
|
@@ -2244,7 +2292,7 @@ var BrowserStorage = class _BrowserStorage {
|
|
|
2244
2292
|
await db.setItem(this.buildManifestKey(driveId), manifest);
|
|
2245
2293
|
}
|
|
2246
2294
|
async getDocuments(drive) {
|
|
2247
|
-
const manifest = await this.
|
|
2295
|
+
const manifest = await this.getManifest(drive);
|
|
2248
2296
|
return manifest.documentIds;
|
|
2249
2297
|
}
|
|
2250
2298
|
async getDocument(driveId, id) {
|
|
@@ -2252,7 +2300,7 @@ var BrowserStorage = class _BrowserStorage {
|
|
|
2252
2300
|
}
|
|
2253
2301
|
async createDocument(drive, id, document) {
|
|
2254
2302
|
await this.create(id, document);
|
|
2255
|
-
const manifest = await this.
|
|
2303
|
+
const manifest = await this.getManifest(drive);
|
|
2256
2304
|
if (!manifest.documentIds.includes(id)) {
|
|
2257
2305
|
manifest.documentIds.push(id);
|
|
2258
2306
|
await this.updateDriveManifest(drive, manifest);
|
|
@@ -2260,7 +2308,7 @@ var BrowserStorage = class _BrowserStorage {
|
|
|
2260
2308
|
}
|
|
2261
2309
|
async deleteDocument(drive, id) {
|
|
2262
2310
|
await (await this.db).removeItem(this.buildDocumentKey(id));
|
|
2263
|
-
const manifest = await this.
|
|
2311
|
+
const manifest = await this.getManifest(drive);
|
|
2264
2312
|
const docIndex = manifest.documentIds.indexOf(id);
|
|
2265
2313
|
if (docIndex !== -1) {
|
|
2266
2314
|
manifest.documentIds.splice(docIndex, 1);
|