@powerhousedao/reactor-browser 6.2.3-dev.7 → 6.2.3-dev.71
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/{attachment-service-D3EhiAJ7.d.ts → attachment-service-CAf9N-15.d.ts} +365 -66
- package/dist/attachment-service-CAf9N-15.d.ts.map +1 -0
- package/dist/{client-DjK30EQ-.js → client-BFnMV-EO.js} +39 -22
- package/dist/client-BFnMV-EO.js.map +1 -0
- package/dist/{client-BIHN_UyR.d.ts → client-BnGewICj.d.ts} +3 -3
- package/dist/client-BnGewICj.d.ts.map +1 -0
- package/dist/{client-D66jVnot.js → client-CXDpILj6.js} +232 -32
- package/dist/client-CXDpILj6.js.map +1 -0
- package/dist/dispatch-Dd_WEz35.js +870 -0
- package/dist/dispatch-Dd_WEz35.js.map +1 -0
- package/dist/document-by-id-DqAyjr9P.js +16 -0
- package/dist/document-by-id-DqAyjr9P.js.map +1 -0
- package/dist/document-model-modules-DROQT_yu.js +431 -0
- package/dist/document-model-modules-DROQT_yu.js.map +1 -0
- package/dist/{document-operations-WeE6wIDt.js → document-operations-C6khz2If.js} +958 -204
- package/dist/document-operations-C6khz2If.js.map +1 -0
- package/dist/{global-OuINvEGT.d.ts → global-D-VZTZRz.d.ts} +113 -20
- package/dist/global-D-VZTZRz.d.ts.map +1 -0
- package/dist/{index-B33TKEqp.d.ts → index-XfcUiODQ.d.ts} +19 -98
- package/dist/index-XfcUiODQ.d.ts.map +1 -0
- package/dist/{index-BIVDXw3K.d.ts → index-rtDmzViP.d.ts} +3 -3
- package/dist/index-rtDmzViP.d.ts.map +1 -0
- package/dist/index.d.ts +713 -391
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +469 -72
- package/dist/index.js.map +1 -1
- package/dist/inspector-proxy-DODqs15F.d.ts +25 -0
- package/dist/inspector-proxy-DODqs15F.d.ts.map +1 -0
- package/dist/make-ph-event-functions-B5GU5xcR.js +180 -0
- package/dist/make-ph-event-functions-B5GU5xcR.js.map +1 -0
- package/dist/navigation-BqphkrOB.js +302 -0
- package/dist/navigation-BqphkrOB.js.map +1 -0
- package/dist/{pglite-CntadC_p-9NDG14dS.d.ts → pglite-CntadC_p-DTkdF8sr.d.ts} +11 -33
- package/dist/pglite-CntadC_p-DTkdF8sr.d.ts.map +1 -0
- package/dist/{relational-D1RB45sA.js → relational-DZuyKp2y.js} +66 -5
- package/dist/relational-DZuyKp2y.js.map +1 -0
- package/dist/{renown-rqK8sokh.js → renown-BtjgHBjH.js} +33 -28
- package/dist/{renown-rqK8sokh.js.map → renown-BtjgHBjH.js.map} +1 -1
- package/dist/{renown-BHxwP7xU.js → renown-BxkZYzbQ.js} +2 -2
- package/dist/{renown-BHxwP7xU.js.map → renown-BxkZYzbQ.js.map} +1 -1
- package/dist/src/ai/index.d.ts +51 -62
- package/dist/src/ai/index.d.ts.map +1 -1
- package/dist/src/ai/index.js +6 -9
- package/dist/src/ai/index.js.map +1 -1
- package/dist/src/analytics/index.d.ts +36 -44
- package/dist/src/analytics/index.d.ts.map +1 -1
- package/dist/src/analytics/index.js +4 -4
- package/dist/src/analytics/index.js.map +1 -1
- package/dist/src/document-model.d.ts +3 -4
- package/dist/src/document-model.d.ts.map +1 -1
- package/dist/src/document-model.js.map +1 -1
- package/dist/src/graphql/client.d.ts +4 -3
- package/dist/src/graphql/client.js +1 -1
- package/dist/src/graphql-client/entry.d.ts +5 -4
- package/dist/src/graphql-client/entry.js +4 -4
- package/dist/src/relational/index.d.ts +15 -9
- package/dist/src/relational/index.d.ts.map +1 -1
- package/dist/src/relational/index.js +1 -1
- package/dist/src/renown/index.d.ts +3 -2
- package/dist/src/renown/index.js +2 -2
- package/dist/src/rpc/index.d.ts +178 -138
- package/dist/src/rpc/index.d.ts.map +1 -1
- package/dist/src/rpc/index.js +420 -619
- package/dist/src/rpc/index.js.map +1 -1
- package/dist/{store-BJYcr_FL.js → store-DInXcjal.js} +1 -1
- package/dist/{store-BJYcr_FL.js.map → store-DInXcjal.js.map} +1 -1
- package/dist/{switchboard-CaXQ4-5Q.js → switchboard-cwUp3FxP.js} +98 -11
- package/dist/switchboard-cwUp3FxP.js.map +1 -0
- package/dist/{types-Dcv1ZLoW.d.ts → types-0Fh1tNjy.d.ts} +242 -17
- package/dist/types-0Fh1tNjy.d.ts.map +1 -0
- package/dist/{types-6vDzbRRS.d.ts → types-520nWrB3.d.ts} +2 -2
- package/dist/types-520nWrB3.d.ts.map +1 -0
- package/package.json +20 -21
- package/dist/attachment-service-D3EhiAJ7.d.ts.map +0 -1
- package/dist/client-BIHN_UyR.d.ts.map +0 -1
- package/dist/client-D66jVnot.js.map +0 -1
- package/dist/client-DjK30EQ-.js.map +0 -1
- package/dist/document-by-id-B4FIzG1w.js +0 -519
- package/dist/document-by-id-B4FIzG1w.js.map +0 -1
- package/dist/document-model-modules-bTP87nyr.js +0 -419
- package/dist/document-model-modules-bTP87nyr.js.map +0 -1
- package/dist/document-operations-WeE6wIDt.js.map +0 -1
- package/dist/global-OuINvEGT.d.ts.map +0 -1
- package/dist/index-B33TKEqp.d.ts.map +0 -1
- package/dist/index-BIVDXw3K.d.ts.map +0 -1
- package/dist/inspector-proxy-6h5VKAwt.d.ts +0 -257
- package/dist/inspector-proxy-6h5VKAwt.d.ts.map +0 -1
- package/dist/make-ph-event-functions-DBq3iWYn.js +0 -53
- package/dist/make-ph-event-functions-DBq3iWYn.js.map +0 -1
- package/dist/pglite-CntadC_p-9NDG14dS.d.ts.map +0 -1
- package/dist/relational-D1RB45sA.js.map +0 -1
- package/dist/switchboard-CaXQ4-5Q.js.map +0 -1
- package/dist/types-6vDzbRRS.d.ts.map +0 -1
- package/dist/types-Dcv1ZLoW.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { a as
|
|
1
|
+
import { a as createPHStore, c as getPHStore, d as subscribePHStore, f as usePHStore, i as bindPHStoreToWindow, l as getPHStoreSubscribe, n as subscribeToPHValue, o as ensurePHStore, r as PHStoreProvider, s as getActivePHStore, t as makePHEventFunctions, u as notifyPHStore } from "./make-ph-event-functions-B5GU5xcR.js";
|
|
2
|
+
import { S as dispatchActions, a as useDocument, b as DocumentRefetcher, c as useDocuments, d as useGetDocuments, f as DocumentCache, g as readPromiseState, h as isOperationCache, i as setDocumentCache, l as useGetDocument, m as addPromiseState, n as useDispatch, o as useDocumentCache, p as IDLE_OPERATIONS_ENTRY, r as addDocumentCacheEventHandler, s as useDocumentSafe, t as createDispatch, u as useGetDocumentAsync, x as IDLE_REFETCH_STATE } from "./dispatch-Dd_WEz35.js";
|
|
3
|
+
import { A as addDrivesEventHandler, B as UnsupportedDocumentTypeError, C as setSelectedNode, D as usePreloadNode, E as useOpenNode, F as isInitialSyncInFlight, H as makeAuthMiddleware, I as listSyncRemotes, L as DocumentModelNotFoundError, M as useDrives, N as DriveProvider, P as useDriveContext, R as DocumentTypeMismatchError, S as selectNode, T as useNodeTarget, V as ambientRenownTokenProvider, _ as useSetSelectedDrive, a as setVetraPackageManager, b as getNodeTarget, c as addSelectedDriveIdEventHandler, d as setSelectedDrive, f as setSelectedDriveId, g as useSelectedDriveSafe, h as useSelectedDriveId, i as onVetraPackageManager, j as setDrives, k as useSetSelectedNode, l as preloadDrive, m as useSelectedDrive, n as useDocumentModelModules, o as useVetraPackageManager, p as usePreloadDrive, r as addVetraPackageManagerEventHandler, s as useVetraPackages, t as useDocumentModelModuleById, u as selectDrive, v as addResetSelectedNodeEventHandler, w as setSelectedNodeId, x as preloadNode, y as addSelectedNodeIdEventHandler, z as NoSelectedDocumentError } from "./document-model-modules-DROQT_yu.js";
|
|
4
|
+
import { A as extractNodeIdFromSlug, C as setSearchParams, D as extractDriveIdFromSlug, E as extractDriveIdFromPath, F as getPathWithoutBase, I as makeDriveSlug, L as makeDriveUrlComponent, M as findDerivedId, N as findDriveBySlug, O as extractDriveSlugFromPath, P as findUuid, R as makeNodeSlug, S as setBrowserOpenSync, T as createUrlWithPreservedParams, _ as preloadTarget, a as SETTINGS_PATH, b as searchParamsToString, c as getCurrentPathname, d as hasHostNavigation, f as isGlobalSearchParam, g as openedFromIndex, h as openTargetWith, i as PH_LOCATION_CHANGE_EVENT, j as extractNodeSlugFromPath, k as extractNodeIdFromPath, l as getPHNavigation, m as openTarget, n as GLOBAL_SEARCH_PARAMS, o as applySearchUpdate, p as isSettingsTarget, r as OPENED_FROM_STATE_KEY, s as browserNavigation, t as FEATURE_FLAG_PARAM_PREFIX, u as getTargetHref, v as recordToSearch, w as targetPathname, x as searchToRecord, y as resolveSearchUpdate, z as resolveUrlPathname } from "./navigation-BqphkrOB.js";
|
|
5
|
+
import { $ as addIsAnalyticsExternalProcessorsEnabledEventHandler, $i as isRoutedModal, $n as useIsEditorDebugModeEnabled, $r as signStampedAction, $t as setIsDeleteLocalDrivesEnabled, A as useDropTarget, Ai as renameDriveNode, An as useAnalyticsDatabaseName, Ar as phDocumentEditorConfigHooks, At as addVersionEventHandler, B as addCliVersionEventHandler, Bi as setFullReactorClient, Bn as useIsAddDriveEnabled, Br as isGraphQLReactorClient, Bt as setDrivesPreserveStrategy, C as usePackageDiscoveryService, Ci as deleteNode, Cn as setSentryRelease, Cr as useWarnOutdatedApp, Ct as addRouterBasenameEventHandler, D as addDraggingNodeEventHandler, Di as getDocumentExtension, Dn as setVersionCheckInterval, Dr as isExternalControlsEnabledEventFunctions, Dt as addStudioModeEventHandler, E as useGraphQLReactorClient, Ei as fetchDocumentOperations, En as setVersion, Er as addIsExternalControlsEnabledEventHandler, Et as addSentryReleaseEventHandler, F as setAttachmentService, Fi as isDocumentTypeSupported, Fn as useDrivesPreserveStrategy, Fr as useAllowedDocumentTypes, Ft as setAnalyticsDatabaseName, G as addFileUploadOperationsChunkSizeEventHandler, Gi as usePGlite, Gn as useIsAnalyticsExternalProcessorsEnabled, Gr as subscriptionsUrlFromGraphqlUrl, Gt as setIsAddDriveEnabled, H as addDisabledEditorsEventHandler, Hi as setReactorClientModule, Hn as useIsAddPublicDrivesEnabled, Hr as isAuthRefusalClose, Ht as setFileUploadOperationsChunkSize, I as useAttachmentService, Ii as addFullReactorClientEventHandler, In as useEnabledEditors, Ir as useIsDragAndDropEnabled, It as setBasePath, J as addIsAddDriveEnabledEventHandler, Ji as useSync, Jn as useIsDeleteLocalDrivesEnabled, Jr as subgraphUrlFromGraphqlUrl, Jt as setIsAnalyticsDatabaseWorkerEnabled, K as addGaTrackingIdEventHandler, Ki as useReactorClient, Kn as useIsCloudDrivesEnabled, Kr as SubgraphSdkRegistry, Kt as setIsAddLocalDrivesEnabled, L as addAllowListEventHandler, Li as addReactorClientEventHandler, Ln as useFileUploadOperationsChunkSize, Lr as useIsExternalControlsEnabled, Lt as setCliVersion, M as setFeatures, Mi as setPreferredEditorOnNode, Mn as useCliVersion, Mr as setAllowedDocumentTypes, Mt as phGlobalConfigHooks, N as useFeatures, Ni as upgradeDocument, Nn as useDefaultDrivesUrl, Nr as setIsDragAndDropEnabled, Nt as phGlobalConfigSetters, O as useDragNode, Oi as loadFile, On as setWarnOutdatedApp, Or as phAppConfigHooks, Ot as addSwitchboardUrlEventHandler, P as addAttachmentServiceEventHandler, Pi as getUserPermissions, Pn as useDisabledEditors, Pr as setIsExternalControlsEnabled, Pt as setAllowList, Q as addIsAnalyticsEnabledEventHandler, Qi as closePHModal, Qn as useIsDriveAnalyticsEnabled, Qr as prepareSignedActions, Qt as setIsDeleteCloudDrivesEnabled, R as addAnalyticsDatabaseNameEventHandler, Ri as addReactorClientModuleEventHandler, Rn as useGaTrackingId, Rr as GraphQLReactorClient, Rt as setDefaultDrivesUrl, S as setPackageDiscoveryService, Si as copyNode$1, Sn as setSentryEnv, Sr as useVersionCheckInterval, St as addRequiresHardRefreshEventHandler, T as setGraphQLReactorClient, Ti as extractInitialState, Tn as setSwitchboardUrl, Tr as addIsDragAndDropEnabledEventHandler, Tt as addSentryEnvEventHandler, U as addDrivesPreserveStrategyEventHandler, Ui as useDatabase, Un as useIsAnalyticsDatabaseWorkerEnabled, Ur as makeAuthConnectionParams, Ut as setGaTrackingId, V as addDefaultDrivesUrlEventHandler, Vi as setReactorClient, Vn as useIsAddLocalDrivesEnabled, Vr as viewFilterInputFromViewFilter, Vt as setEnabledEditors, W as addEnabledEditorsEventHandler, Wi as useModelRegistry, Wn as useIsAnalyticsEnabled, Wr as startDocumentChangesSubscription, Wt as setIsAddCloudDrivesEnabled, X as addIsAddPublicDrivesEnabledEventHandler, Xi as MODAL_SEARCH_PARAM, Xn as useIsDiffAnalyticsEnabled, Xr as packageFromDocumentModels, Xt as setIsAnalyticsExternalProcessorsEnabled, Y as addIsAddLocalDrivesEnabledEventHandler, Yi as useSyncList, Yn as useIsDeletePublicDrivesEnabled, Yr as StaticPackageManager, Yt as setIsAnalyticsEnabled, Z as addIsAnalyticsDatabaseWorkerEnabledEventHandler, Zi as addModalEventHandler, Zn as useIsDocumentModelSelectionSettingsEnabled, Zr as resolveDocumentModelModule, Zt as setIsCloudDrivesEnabled, _ as addSetSelectedDriveOnPopStateEventHandler, _i as DEFAULT_DRIVE_EDITOR_ID, _n as setRenownNetworkId, _r as useSentryEnv, _t as addLogLevelEventHandler, a as addPHEventHandlers, aa as showDeleteNodeModal, ai as GraphQLWrongBackendError, an as setIsEditorReadModeEnabled, ar as useIsPublicDrivesEnabled, at as addIsDocumentModelSelectionSettingsEnabledEventHandler, b as syncSelectionFromPath, bi as addFileWithProgress, bn as setRouterBasename, br as useSwitchboardUrl, bt as addRenownNetworkIdEventHandler, c as addToastEventHandler, ca as withoutModalSearch, ci as phDocumentFromMutation, cn as setIsExternalRelationalProcessorsEnabled, cr as useLocalDrivesEnabled, ct as addIsEditorReadModeEnabledEventHandler, d as addSelectedTimelineRevisionEventHandler, di as buildPulledDocument, dn as setIsRelationalProcessorsEnabled, dr as useRenownChainId, dt as addIsExternalRelationalProcessorsEnabledEventHandler, ea as modalFromSearch, ei as stampAction, en as setIsDeletePublicDrivesEnabled, er as useIsEditorReadModeEnabled, et as addIsCloudDrivesEnabledEventHandler, f as setSelectedTimelineRevision, fi as convertRemoteOperations, fn as setIsSentryTracingEnabled, fr as useRenownNetworkId, ft as addIsLocalDrivesEnabledEventHandler, g as useSelectedTimelineItem, gi as COMMON_PACKAGE_ID, gn as setRenownChainId, gr as useSentryDsn, gt as addLocalDrivesEnabledEventHandler, h as setSelectedTimelineItem, hi as screamingSnakeToCamel, hn as setRenownAdapters, hr as useRouterBasename, ht as addIsSentryTracingEnabledEventHandler, i as useSwitchboardClient, ia as showCreateDocumentModal, ii as GraphQLOperationNotSupportedError, in as setIsEditorDebugModeEnabled, ir as useIsLocalDrivesEnabled, it as addIsDiffAnalyticsEnabledEventHandler, j as addFeaturesEventHandler, ji as renameNode, jn as useBasePath, jr as phDocumentEditorConfigSetters, jt as addWarnOutdatedAppEventHandler, k as useDropNode, ki as moveNode$1, kn as useAllowList, kr as phAppConfigSetters, kt as addVersionCheckIntervalEventHandler, l as setPHToast, li as revisionMapFromRevisionsList, ln as setIsLocalDrivesEnabled, lr as useLogLevel, lt as addIsExternalPackagesEnabledEventHandler, m as addSelectedTimelineItemEventHandler, mi as hasRevisionConflict, mn as setLogLevel, mr as useRequiresHardRefresh, mt as addIsRelationalProcessorsEnabledEventHandler, n as GraphQLReactorProvider, na as modalSearch, ni as ReactorOperationFieldsFragmentDoc, nn as setIsDocumentModelSelectionSettingsEnabled, nr as useIsExternalProcessorsEnabled, nt as addIsDeleteLocalDrivesEnabledEventHandler, o as callEventHandlerRegisterFunctions, oa as showPHModal, oi as isoStringFromDateTime, on as setIsExternalPackagesEnabled, or as useIsRelationalProcessorsEnabled, ot as addIsDriveAnalyticsEnabledEventHandler, p as useSelectedTimelineRevision, pi as extractRevisionMap, pn as setLocalDrivesEnabled, pr as useRenownUrl, pt as addIsPublicDrivesEnabledEventHandler, q as addIsAddCloudDrivesEnabledEventHandler, qi as useReactorClientModule, qn as useIsDeleteCloudDrivesEnabled, qr as describeGraphQLDocument, qt as setIsAddPublicDrivesEnabled, r as ensurePHEventHandlers, ra as setPHModal, ri as BatchJobFailedError, rn as setIsDriveAnalyticsEnabled, rr as useIsExternalRelationalProcessorsEnabled, rt as addIsDeletePublicDrivesEnabledEventHandler, s as commonGlobalEventHandlerFunctions, sa as usePHModal, si as phDocumentFromGetDocument, sn as setIsExternalProcessorsEnabled, sr as useIsSentryTracingEnabled, st as addIsEditorDebugModeEnabledEventHandler, t as useDocumentOperations, ta as modalHref, ti as MutateDocumentWithOperationsDocument, tn as setIsDiffAnalyticsEnabled, tr as useIsExternalPackagesEnabled, tt as addIsDeleteCloudDrivesEnabledEventHandler, u as usePHToast, ui as ConflictError, un as setIsPublicDrivesEnabled, ur as useRenownAdapters, ut as addIsExternalProcessorsEnabledEventHandler, v as addSetSelectedNodeOnPopStateEventHandler, vi as DRIVE_DOCUMENT_TYPES, vn as setRenownUrl, vr as useSentryRelease, vt as addRenownAdaptersEventHandler, w as addGraphQLReactorClientEventHandler, wi as exportFile, wn as setStudioMode, wr as addAllowedDocumentTypesEventHandler, wt as addSentryDsnEventHandler, x as addPackageDiscoveryServiceEventHandler, xi as addFolder, xn as setSentryDsn, xr as useVersion, xt as addRenownUrlEventHandler, y as addSyncSelectionOnPopStateEventHandler, yi as addDocument, yn as setRequiresHardRefresh, yr as useStudioMode, yt as addRenownChainIdEventHandler, z as addBasePathEventHandler, zi as getFullReactorClient, zn as useIsAddCloudDrivesEnabled, zr as findIsServableOverGraphQL, zt as setDisabledEditors } from "./document-operations-C6khz2If.js";
|
|
6
|
+
import { a as setGlobal, i as getGlobal, n as getAnalyticsStore, r as clearGlobal, t as createAnalyticsStore } from "./store-DInXcjal.js";
|
|
6
7
|
import { baseDocumentModels, baseDocumentModelsMap } from "./src/document-model.js";
|
|
7
|
-
import {
|
|
8
|
-
import { a as useRenown, c as RENOWN_INITIAL_UNKNOWN, d as useRenownInitialUser, f as addLoadingEventHandler, h as useLoading, i as useLoginStatus, l as RenownInitialUserProvider, m as setLoading, n as setRenown, o as useUser, p as loading, r as useDid, s as RENOWN_INITIAL_ANONYMOUS, t as addRenownEventHandler, u as useRenownInitialAuth } from "./renown-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { i as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
8
|
+
import { a as PropagationMode, r as GetDocumentWithOperationsDocument, t as createClient } from "./client-CXDpILj6.js";
|
|
9
|
+
import { a as useRenown, c as RENOWN_INITIAL_UNKNOWN, d as useRenownInitialUser, f as addLoadingEventHandler, h as useLoading, i as useLoginStatus, l as RenownInitialUserProvider, m as setLoading, n as setRenown, o as useUser, p as loading, r as useDid, s as RENOWN_INITIAL_ANONYMOUS, t as addRenownEventHandler, u as useRenownInitialAuth } from "./renown-BxkZYzbQ.js";
|
|
10
|
+
import { C as sortNodesByName, S as isFolderNodeKind, _ as useDocumentsInSelectedDrive, b as useNodesInSelectedDrive, c as useSelectedDocument, d as useSelectedDocumentSafe, f as EditorDocumentProvider, g as useDocumentTypesInSelectedDrive, h as useSelectedNode, l as useSelectedDocumentId, m as useDocumentOfType, p as useEditorDocumentContext, t as GQL_CHANNEL_SUFFIX, u as useSelectedDocumentOfType, v as useFileNodesInSelectedDrive, x as isFileNodeKind, y as useFolderNodesInSelectedDrive } from "./switchboard-cwUp3FxP.js";
|
|
11
|
+
import { n as useDocumentsByIds, t as useDocumentById } from "./document-by-id-DqAyjr9P.js";
|
|
12
|
+
import { A as RENOWN_CHAIN_ID, C as logout, D as CREDENTIAL_TYPES, E as CREDENTIAL_SUBJECT_TYPE, M as RENOWN_RETURN_URL_STRIPPED_PARAMS, N as RENOWN_URL, O as DOMAIN_TYPE, P as VERIFIABLE_CREDENTIAL_EIP712_TYPE, S as login, T as CREDENTIAL_SCHEMA_EIP712_TYPE, _ as RenownLogo, a as Renown, b as useRenownAuth, c as useRenownSessionSynced, d as RenownAuthButton, f as RenownUserButton, g as DisconnectIcon, h as CopyIcon, i as RenownWalletProvider, j as RENOWN_NETWORK_ID, k as ISSUER_TYPE, l as initConnectCrypto, m as ChevronDownIcon, n as useRenownLoginMethods, o as useRenownInit, p as RenownLoginButton, r as RenownProvider, s as useRenownSessionCookie, t as useRenownWalletAdapter, u as initRenownCrypto, v as SpinnerIcon, w as openRenown, x as useRenownAuthAsync, y as UserIcon } from "./renown-BtjgHBjH.js";
|
|
13
|
+
import { i as setPGliteDB, n as useRelationalQuery, r as useRelationalDb, t as createProcessorQuery } from "./relational-DZuyKp2y.js";
|
|
14
|
+
import { a as getPackagesByDocumentType, c as trimTrailingSlash, i as getPackages, l as SYNC_REMOTES_CHANGED_EVENT, n as getPackageInfo, o as getPackagesForDocumentType, r as getPackagePage, s as searchPackages, t as RegistryClient } from "./client-BFnMV-EO.js";
|
|
15
|
+
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
16
|
+
import { AuthEnforcementDisabledError, ChannelScheme, DocumentChangeType, DocumentChangeType as DocumentChangeType$1, DocumentIntegrityService, DriveCollectionId, DriveCollectionId as DriveCollectionId$1, DriveRequestError, GqlRequestChannel, InMemoryQueue, IntervalPollTimer, PollBehavior, PropagationMode as PropagationMode$1, REACTOR_SCHEMA, REACTOR_SCHEMA as REACTOR_SCHEMA$1, ReactorBuilder, ReactorClientBuilder, RelationalDbProcessor, SyncEventTypes, SyncOperationStatus, SyncStatus, driveIdFromUrl, isDriveAuthError, isDriveAuthError as isDriveAuthError$1, parseDriveUrl } from "@powerhousedao/reactor";
|
|
15
17
|
import { DriveDocumentSchema, driveCreateDocument, getDescendants, getNextCopyNumber, isFileNode, isFolderNode, setAvailableOffline, setDriveIcon, setDriveName, setSharingType } from "@powerhousedao/shared/document-drive";
|
|
18
|
+
import { DEFAULT_SIGNATURE_POLICY, actionSignerIdentity, actionSigningTarget, createZip, isDocumentZip, parseBulkArchive, requestedSignaturePolicy, toTransportAction, validateInitialState, validateModules, validateStateSchemaName, withSignaturePolicy, zipEntries } from "@powerhousedao/shared/document-model";
|
|
16
19
|
import { allPass, filter, find, forEach, funnel, hasAtLeast, isArray, isDefined, isIncludedIn, isStrictEqual, isTruthy, last, map, mapToObj, once, pipe, prop, split, unique } from "remeda";
|
|
17
20
|
import { pascalCase } from "change-case";
|
|
18
|
-
import {
|
|
21
|
+
import { ClientError } from "graphql-request";
|
|
19
22
|
import { Kind, parse } from "graphql";
|
|
20
23
|
import { z } from "zod";
|
|
21
24
|
import normalizeException from "normalize-exception";
|
|
@@ -65,7 +68,7 @@ async function expandBulkArchive(file, driveId, targetParent) {
|
|
|
65
68
|
}];
|
|
66
69
|
const entries = await parseBulkArchive(data);
|
|
67
70
|
if (!(await Promise.all(entries.map((entry) => isDocumentZip(entry.data)))).some(Boolean)) throw new Error("Archive contains no Powerhouse documents");
|
|
68
|
-
const reactorClient =
|
|
71
|
+
const reactorClient = getPHStore()?.reactorClient;
|
|
69
72
|
if (!reactorClient) throw new Error("ReactorClient not initialized");
|
|
70
73
|
const knownNodes = [...(await reactorClient.get(driveId)).state.global.nodes];
|
|
71
74
|
const dirToNode = /* @__PURE__ */ new Map();
|
|
@@ -127,11 +130,11 @@ async function buildFolderZip(drive, folderNode, fetchDocument, onProgress) {
|
|
|
127
130
|
const allNodes = drive.state.global.nodes;
|
|
128
131
|
const topName = sanitize(folderNode?.name ?? (drive.state.global.name || drive.header.name));
|
|
129
132
|
const subtree = folderNode ? [folderNode, ...getDescendants(folderNode, allNodes)] : allNodes;
|
|
130
|
-
const entries = { [topName + "/"]: new Uint8Array(0) };
|
|
133
|
+
const entries = { [topName + "/"]: /* @__PURE__ */ new Uint8Array(0) };
|
|
131
134
|
for (const node of subtree) {
|
|
132
135
|
if (!isFolderNode(node)) continue;
|
|
133
136
|
const dir = [topName, ...segmentsBelow(folderNode, node, allNodes)].join("/");
|
|
134
|
-
entries[dir + "/"] = new Uint8Array(0);
|
|
137
|
+
entries[dir + "/"] = /* @__PURE__ */ new Uint8Array(0);
|
|
135
138
|
}
|
|
136
139
|
const files = subtree.filter(isFileNode);
|
|
137
140
|
const failed = [];
|
|
@@ -176,7 +179,7 @@ async function buildFolderZip(drive, folderNode, fetchDocument, onProgress) {
|
|
|
176
179
|
* showSaveFilePicker (fallback: blob download), mirroring exportFile.
|
|
177
180
|
*/
|
|
178
181
|
async function downloadFolderZip(drive, folderNode, onProgress) {
|
|
179
|
-
const reactorClient =
|
|
182
|
+
const reactorClient = getPHStore()?.reactorClient;
|
|
180
183
|
if (!reactorClient) throw new Error("ReactorClient not initialized");
|
|
181
184
|
const result = await buildFolderZip(drive, folderNode, async (id) => {
|
|
182
185
|
const doc = await reactorClient.get(id);
|
|
@@ -254,24 +257,39 @@ async function waitForDocumentReady(reactorClient, documentId, options) {
|
|
|
254
257
|
}, timeoutMs);
|
|
255
258
|
});
|
|
256
259
|
}
|
|
260
|
+
/** The full client's creation default, else the library's. */
|
|
261
|
+
async function createSignaturePolicy() {
|
|
262
|
+
const client = getFullReactorClient();
|
|
263
|
+
return client ? client.getCreateSignaturePolicy() : DEFAULT_SIGNATURE_POLICY;
|
|
264
|
+
}
|
|
265
|
+
/** What the full client selects for a drive, which has no parent. */
|
|
266
|
+
async function createProtocolVersions() {
|
|
267
|
+
const client = getFullReactorClient();
|
|
268
|
+
return client ? client.getCreateProtocolVersions() : {};
|
|
269
|
+
}
|
|
257
270
|
async function addDrive(input, preferredEditor) {
|
|
258
271
|
const { isAllowedToCreateDocuments } = getUserPermissions();
|
|
259
272
|
if (!isAllowedToCreateDocuments) throw new Error("User is not allowed to create drives");
|
|
260
|
-
const reactorClient =
|
|
273
|
+
const reactorClient = getPHStore()?.reactorClient;
|
|
261
274
|
if (!reactorClient) throw new Error("ReactorClient not initialized");
|
|
262
|
-
const driveDoc = driveCreateDocument({ global: {
|
|
275
|
+
const driveDoc = withSignaturePolicy(driveCreateDocument({ global: {
|
|
263
276
|
name: input.global.name || "",
|
|
264
277
|
icon: input.global.icon ?? null,
|
|
265
278
|
nodes: []
|
|
266
|
-
} })
|
|
267
|
-
|
|
279
|
+
} }), requestedSignaturePolicy(input, input.id ? "legacy" : await createSignaturePolicy()), {
|
|
280
|
+
id: input.id || void 0,
|
|
281
|
+
protocolVersions: {
|
|
282
|
+
...await createProtocolVersions(),
|
|
283
|
+
...input.protocolVersions
|
|
284
|
+
}
|
|
285
|
+
});
|
|
268
286
|
if (preferredEditor) driveDoc.header.meta = { preferredEditor };
|
|
269
287
|
return await reactorClient.create(driveDoc);
|
|
270
288
|
}
|
|
271
289
|
async function addRemoteDrive(url, driveId, options) {
|
|
272
|
-
const reactorClient =
|
|
290
|
+
const reactorClient = getFullReactorClient();
|
|
273
291
|
if (!reactorClient) throw new Error("ReactorClient not initialized");
|
|
274
|
-
const sync =
|
|
292
|
+
const sync = getPHStore()?.reactorClientModule?.reactorModule?.syncModule?.syncManager;
|
|
275
293
|
if (!sync) throw new Error("Sync not initialized");
|
|
276
294
|
let driveInfo;
|
|
277
295
|
try {
|
|
@@ -307,9 +325,9 @@ async function addRemoteDrive(url, driveId, options) {
|
|
|
307
325
|
async function deleteDrive(driveId) {
|
|
308
326
|
const { isAllowedToCreateDocuments } = getUserPermissions();
|
|
309
327
|
if (!isAllowedToCreateDocuments) throw new Error("User is not allowed to delete drives");
|
|
310
|
-
const reactorClient =
|
|
328
|
+
const reactorClient = getPHStore()?.reactorClient;
|
|
311
329
|
if (!reactorClient) throw new Error("ReactorClient not initialized");
|
|
312
|
-
const sync =
|
|
330
|
+
const sync = getPHStore()?.reactorClientModule?.reactorModule?.syncModule?.syncManager;
|
|
313
331
|
if (sync) {
|
|
314
332
|
const collectionId = DriveCollectionId$1.forDrive(driveId);
|
|
315
333
|
const remotes = sync.list().filter((remote) => remote.meta.collectionId.equals(collectionId));
|
|
@@ -320,28 +338,28 @@ async function deleteDrive(driveId) {
|
|
|
320
338
|
async function renameDrive(driveId, name) {
|
|
321
339
|
const { isAllowedToCreateDocuments } = getUserPermissions();
|
|
322
340
|
if (!isAllowedToCreateDocuments) throw new Error("User is not allowed to rename drives");
|
|
323
|
-
const reactorClient =
|
|
341
|
+
const reactorClient = getFullReactorClient();
|
|
324
342
|
if (!reactorClient) throw new Error("ReactorClient not initialized");
|
|
325
343
|
return await reactorClient.rename(driveId, name);
|
|
326
344
|
}
|
|
327
345
|
async function setDriveAvailableOffline(driveId, availableOffline) {
|
|
328
346
|
const { isAllowedToCreateDocuments } = getUserPermissions();
|
|
329
347
|
if (!isAllowedToCreateDocuments) throw new Error("User is not allowed to change drive availability");
|
|
330
|
-
const reactorClient =
|
|
348
|
+
const reactorClient = getPHStore()?.reactorClient;
|
|
331
349
|
if (!reactorClient) throw new Error("ReactorClient not initialized");
|
|
332
350
|
return await reactorClient.execute(driveId, "main", [setAvailableOffline({ availableOffline })]);
|
|
333
351
|
}
|
|
334
352
|
async function setDriveSharingType(driveId, sharingType) {
|
|
335
353
|
const { isAllowedToCreateDocuments } = getUserPermissions();
|
|
336
354
|
if (!isAllowedToCreateDocuments) throw new Error("User is not allowed to change drive sharing type");
|
|
337
|
-
const reactorClient =
|
|
355
|
+
const reactorClient = getPHStore()?.reactorClient;
|
|
338
356
|
if (!reactorClient) throw new Error("ReactorClient not initialized");
|
|
339
357
|
return await reactorClient.execute(driveId, "main", [setSharingType({ type: sharingType })]);
|
|
340
358
|
}
|
|
341
359
|
async function setDriveMetadata(driveId, metadata) {
|
|
342
360
|
const { isAllowedToCreateDocuments } = getUserPermissions();
|
|
343
361
|
if (!isAllowedToCreateDocuments) throw new Error("User is not allowed to update drive metadata");
|
|
344
|
-
const reactorClient =
|
|
362
|
+
const reactorClient = getPHStore()?.reactorClient;
|
|
345
363
|
if (!reactorClient) throw new Error("ReactorClient not initialized");
|
|
346
364
|
const actions = [];
|
|
347
365
|
if (metadata.name) actions.push(setDriveName({ name: metadata.name }));
|
|
@@ -350,12 +368,6 @@ async function setDriveMetadata(driveId, metadata) {
|
|
|
350
368
|
return await reactorClient.execute(driveId, "main", actions);
|
|
351
369
|
}
|
|
352
370
|
//#endregion
|
|
353
|
-
//#region src/constants.ts
|
|
354
|
-
const DEFAULT_DRIVE_EDITOR_ID = "powerhouse/generic-drive-explorer";
|
|
355
|
-
const COMMON_PACKAGE_ID = "powerhouse/common";
|
|
356
|
-
/** Document types that represent a "drive": a container of nodes. */
|
|
357
|
-
const DRIVE_DOCUMENT_TYPES = ["powerhouse/document-drive", "powerhouse/reactor-drive"];
|
|
358
|
-
//#endregion
|
|
359
371
|
//#region src/graphql/adapters.ts
|
|
360
372
|
function phDocumentFromQuery(document, documentSchema) {
|
|
361
373
|
const phDocument = {
|
|
@@ -415,7 +427,7 @@ const graphqlDocumentsEvents = ["DeleteDocuments"];
|
|
|
415
427
|
//#endregion
|
|
416
428
|
//#region src/graphql/fetchers.ts
|
|
417
429
|
async function reactorGraphqlFetchDocument(identifier, documentSchema) {
|
|
418
|
-
const client =
|
|
430
|
+
const client = getPHStore()?.reactorGraphQLClient;
|
|
419
431
|
if (!client) throw new Error("Please call `useInitReactorGraphqlClient` to use its functions");
|
|
420
432
|
try {
|
|
421
433
|
const document = (await client.GetDocument({ identifier })).document?.document;
|
|
@@ -426,7 +438,7 @@ async function reactorGraphqlFetchDocument(identifier, documentSchema) {
|
|
|
426
438
|
}
|
|
427
439
|
}
|
|
428
440
|
async function reactorGraphqlBatchFetchDocuments(identifiers) {
|
|
429
|
-
if (!
|
|
441
|
+
if (!getPHStore()?.reactorGraphQLClient) throw new Error("Please call `useInitReactorGraphqlClient` to use its functions");
|
|
430
442
|
const promises = map(identifiers, (identifier) => reactorGraphqlFetchDocument(identifier));
|
|
431
443
|
return await Promise.all(promises);
|
|
432
444
|
}
|
|
@@ -511,11 +523,34 @@ var DocumentFetcher = class {
|
|
|
511
523
|
};
|
|
512
524
|
//#endregion
|
|
513
525
|
//#region src/graphql/graphql-client-document-cache.ts
|
|
526
|
+
function isMissingDocumentMessage(message) {
|
|
527
|
+
return message.includes("Document not found") || /Document \S+ was purged/.test(message);
|
|
528
|
+
}
|
|
529
|
+
async function fetchDocumentForRefetch(identifier) {
|
|
530
|
+
const client = getPHStore()?.reactorGraphQLClient;
|
|
531
|
+
if (!client) throw new Error("Please call `useInitReactorGraphqlClient` to use its functions");
|
|
532
|
+
const notFound = (cause) => new Error(`Document not found: ${identifier}`, { cause });
|
|
533
|
+
let result;
|
|
534
|
+
try {
|
|
535
|
+
result = await client.GetDocument({ identifier });
|
|
536
|
+
} catch (error) {
|
|
537
|
+
if ((error instanceof ClientError ? (error.response.errors ?? []).map((e) => e.message) : []).some(isMissingDocumentMessage)) throw notFound(error);
|
|
538
|
+
throw error;
|
|
539
|
+
}
|
|
540
|
+
const document = result.document?.document;
|
|
541
|
+
if (!document) throw notFound();
|
|
542
|
+
return phDocumentFromQuery(document);
|
|
543
|
+
}
|
|
514
544
|
var GraphQLClientDocumentCache = class {
|
|
515
545
|
fetcher;
|
|
516
546
|
documents = /* @__PURE__ */ new Map();
|
|
517
547
|
batchPromises = /* @__PURE__ */ new Map();
|
|
518
548
|
listeners = /* @__PURE__ */ new Map();
|
|
549
|
+
refetcher = new DocumentRefetcher({
|
|
550
|
+
documents: this.documents,
|
|
551
|
+
fetch: fetchDocumentForRefetch,
|
|
552
|
+
notify: (id) => this.notify(id)
|
|
553
|
+
});
|
|
519
554
|
constructor() {
|
|
520
555
|
this.fetcher = new DocumentFetcher();
|
|
521
556
|
window.addEventListener("MutateDocument", (event) => {
|
|
@@ -527,10 +562,9 @@ var GraphQLClientDocumentCache = class {
|
|
|
527
562
|
}
|
|
528
563
|
get(id, refetch) {
|
|
529
564
|
const current = this.documents.get(id);
|
|
530
|
-
if (current)
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
}
|
|
565
|
+
if (current && !refetch) return current;
|
|
566
|
+
if (current && current.status !== "rejected") return this.refetcher.refetch(id);
|
|
567
|
+
this.refetcher.forget(id);
|
|
534
568
|
const promise = addPromiseState(this.fetcher.get(id).then((document) => {
|
|
535
569
|
this.invalidateBatchesContaining(id);
|
|
536
570
|
return document;
|
|
@@ -538,6 +572,9 @@ var GraphQLClientDocumentCache = class {
|
|
|
538
572
|
this.documents.set(id, promise);
|
|
539
573
|
return promise;
|
|
540
574
|
}
|
|
575
|
+
getRefetchState(id) {
|
|
576
|
+
return this.refetcher.getState(id);
|
|
577
|
+
}
|
|
541
578
|
getBatch(ids) {
|
|
542
579
|
const key = ids.join(",");
|
|
543
580
|
const cached = this.batchPromises.get(key);
|
|
@@ -590,12 +627,12 @@ var GraphQLClientDocumentCache = class {
|
|
|
590
627
|
for (const listener of listeners) listener();
|
|
591
628
|
}
|
|
592
629
|
async handleDocumentMutated(id) {
|
|
593
|
-
this.
|
|
594
|
-
await this.get(id);
|
|
595
|
-
this.notify(id);
|
|
630
|
+
if (!this.documents.has(id)) return;
|
|
631
|
+
await this.get(id, true);
|
|
596
632
|
}
|
|
597
633
|
handleDocumentDeleted(id) {
|
|
598
634
|
this.documents.delete(id);
|
|
635
|
+
this.refetcher.forget(id);
|
|
599
636
|
this.invalidateBatchesContaining(id);
|
|
600
637
|
this.notify(id);
|
|
601
638
|
}
|
|
@@ -606,7 +643,7 @@ var GraphQLClientDocumentCache = class {
|
|
|
606
643
|
//#endregion
|
|
607
644
|
//#region src/graphql/mutators.ts
|
|
608
645
|
async function reactorGraphqlCreateDocument(document, parentIdentifier = DEFAULT_DRIVE_ID) {
|
|
609
|
-
const client =
|
|
646
|
+
const client = getPHStore()?.reactorGraphQLClient;
|
|
610
647
|
if (!client) throw new Error("Please call `useInitReactorGraphqlClient` to use its functions");
|
|
611
648
|
return await client.CreateDocument({
|
|
612
649
|
document,
|
|
@@ -614,17 +651,17 @@ async function reactorGraphqlCreateDocument(document, parentIdentifier = DEFAULT
|
|
|
614
651
|
});
|
|
615
652
|
}
|
|
616
653
|
async function reactorGraphqlDeleteDocument(identifier) {
|
|
617
|
-
const client =
|
|
654
|
+
const client = getPHStore()?.reactorGraphQLClient;
|
|
618
655
|
if (!client) throw new Error("Please call `useInitReactorGraphqlClient` to use its functions");
|
|
619
656
|
return await client.DeleteDocument({ identifier });
|
|
620
657
|
}
|
|
621
658
|
async function reactorGraphqlDeleteDocuments(identifiers) {
|
|
622
|
-
const client =
|
|
659
|
+
const client = getPHStore()?.reactorGraphQLClient;
|
|
623
660
|
if (!client) throw new Error("Please call `useInitReactorGraphqlClient` to use its functions");
|
|
624
661
|
return await client.DeleteDocuments({ identifiers });
|
|
625
662
|
}
|
|
626
663
|
async function reactorGraphqlMutateDocument(documentIdentifier, ...actions) {
|
|
627
|
-
const client =
|
|
664
|
+
const client = getPHStore()?.reactorGraphQLClient;
|
|
628
665
|
if (!client) throw new Error("Please call `useInitReactorGraphqlClient` to use its functions");
|
|
629
666
|
return await client.MutateDocument({
|
|
630
667
|
documentIdentifier,
|
|
@@ -641,9 +678,11 @@ function useAllowedDocumentModelModules() {
|
|
|
641
678
|
}
|
|
642
679
|
//#endregion
|
|
643
680
|
//#region src/hooks/selected-folder.ts
|
|
644
|
-
/** Returns the selected folder. */
|
|
681
|
+
/** Returns the selected folder: the drive app's open folder, else the app's. */
|
|
645
682
|
function useSelectedFolder() {
|
|
683
|
+
const context = useDriveContext();
|
|
646
684
|
const selectedNode = useSelectedNode();
|
|
685
|
+
if (context?.folder) return context.folder;
|
|
647
686
|
if (isFolderNodeKind(selectedNode)) return selectedNode;
|
|
648
687
|
}
|
|
649
688
|
//#endregion
|
|
@@ -1013,6 +1052,14 @@ function useEditorModulesForDocumentType(documentType) {
|
|
|
1013
1052
|
if (!documentType) return void 0;
|
|
1014
1053
|
return editorModules?.filter((module) => module.documentTypes.includes(documentType));
|
|
1015
1054
|
}
|
|
1055
|
+
/** The editor for `document`: its preferred editor if that edits its type,
|
|
1056
|
+
* else the first editor for its type. */
|
|
1057
|
+
function useEditorModuleFor(document) {
|
|
1058
|
+
const documentType = document?.header.documentType;
|
|
1059
|
+
const preferred = useEditorModuleById(document?.header.meta?.preferredEditor);
|
|
1060
|
+
const fallback = useFallbackEditorModule(documentType);
|
|
1061
|
+
return !!documentType && !!preferred && (preferred.documentTypes.includes(documentType) || preferred.documentTypes.includes("*")) ? preferred : fallback;
|
|
1062
|
+
}
|
|
1016
1063
|
//#endregion
|
|
1017
1064
|
//#region src/utils/preload-editor.ts
|
|
1018
1065
|
function preloadEditorModule(module) {
|
|
@@ -1174,24 +1221,24 @@ function useInitReactorGraphqlClient(switchboardUrl = DEFAULT_SWITCHBOARD_URL, d
|
|
|
1174
1221
|
return hasInit;
|
|
1175
1222
|
}
|
|
1176
1223
|
async function reactorGraphqlFetchDrive(identifier) {
|
|
1177
|
-
const client =
|
|
1224
|
+
const client = getPHStore()?.reactorGraphQLClient;
|
|
1178
1225
|
if (!client) throw new Error("Please call `useInitReactorGraphqlClient` to use its functions");
|
|
1179
1226
|
const result = await client.GetDocument({ identifier });
|
|
1180
1227
|
if (!result.document?.document) throw new Error("Could not fetch drive with id: " + identifier);
|
|
1181
1228
|
return phDocumentFromQuery(result.document.document, DriveDocumentSchema);
|
|
1182
1229
|
}
|
|
1183
1230
|
async function reactorGraphqlSyncDrive(driveId) {
|
|
1184
|
-
if (!
|
|
1231
|
+
if (!getPHStore()?.reactorGraphQLClient) throw new Error("Please call `useInitReactorGraphqlClient` to use its functions");
|
|
1185
1232
|
const drive = await reactorGraphqlFetchDrive(driveId);
|
|
1186
1233
|
setDrives([drive]);
|
|
1187
|
-
|
|
1234
|
+
selectDrive(drive);
|
|
1188
1235
|
}
|
|
1189
1236
|
async function initGraphQLReactorClientWithDocumentCache(switchboardUrl, driveId) {
|
|
1190
|
-
if (!window.ph) window.ph = {};
|
|
1191
1237
|
callEventHandlerRegisterFunctions(commonGlobalEventHandlerFunctions);
|
|
1192
|
-
|
|
1238
|
+
const client = createClient(switchboardUrl, documentCacheClientMiddleware);
|
|
1239
|
+
setGraphQLReactorClient(client);
|
|
1193
1240
|
await reactorGraphqlSyncDrive(driveId);
|
|
1194
|
-
|
|
1241
|
+
selectNode(void 0);
|
|
1195
1242
|
setDocumentCache(new GraphQLClientDocumentCache());
|
|
1196
1243
|
forEach(graphqlEventsToSyncDrive, (name) => {
|
|
1197
1244
|
window.addEventListener(name, () => {
|
|
@@ -1232,6 +1279,7 @@ function resolveNode(driveId, node) {
|
|
|
1232
1279
|
return node?.id !== driveId ? node : void 0;
|
|
1233
1280
|
}
|
|
1234
1281
|
function useNodeActions() {
|
|
1282
|
+
const setSelectedNode = useSetSelectedNode();
|
|
1235
1283
|
const [selectedDrive] = useSelectedDriveSafe();
|
|
1236
1284
|
const selectedFolder = useSelectedFolder();
|
|
1237
1285
|
const selectedParentFolder = useFolderById(useSelectedNode()?.parentFolder);
|
|
@@ -1239,7 +1287,8 @@ function useNodeActions() {
|
|
|
1239
1287
|
const drives = useDrives();
|
|
1240
1288
|
async function onAddFile(file, parent) {
|
|
1241
1289
|
if (!selectedDriveId) return;
|
|
1242
|
-
|
|
1290
|
+
const fileName = file.name.replace(/\..+/gim, "");
|
|
1291
|
+
return addFileWithProgress(file, selectedDriveId, fileName, resolveNode(selectedDriveId, parent)?.id, void 0, void 0, "duplicate");
|
|
1243
1292
|
}
|
|
1244
1293
|
async function onAddFolder(name, parent) {
|
|
1245
1294
|
if (!selectedDriveId) return;
|
|
@@ -1260,7 +1309,8 @@ function useNodeActions() {
|
|
|
1260
1309
|
console.error(`Node ${src.id} not found`);
|
|
1261
1310
|
return;
|
|
1262
1311
|
}
|
|
1263
|
-
|
|
1312
|
+
const resolvedTarget = resolveNode(selectedDriveId, target);
|
|
1313
|
+
await copyNode$1(selectedDriveId, resolvedSrc, resolvedTarget);
|
|
1264
1314
|
}
|
|
1265
1315
|
async function onMoveNode(src, target) {
|
|
1266
1316
|
if (!selectedDriveId) return;
|
|
@@ -1280,7 +1330,8 @@ function useNodeActions() {
|
|
|
1280
1330
|
console.error(`Node ${src.id} not found`);
|
|
1281
1331
|
return;
|
|
1282
1332
|
}
|
|
1283
|
-
|
|
1333
|
+
const target = resolveNode(selectedDriveId, selectedFolder ?? selectedParentFolder);
|
|
1334
|
+
await copyNode$1(selectedDriveId, resolvedSrc, target);
|
|
1284
1335
|
}
|
|
1285
1336
|
async function onAddAndSelectNewFolder(name) {
|
|
1286
1337
|
if (!name) return;
|
|
@@ -1340,6 +1391,71 @@ function useParentFolderForSelectedNode() {
|
|
|
1340
1391
|
return useNodeParentFolderById(useSelectedNode()?.id);
|
|
1341
1392
|
}
|
|
1342
1393
|
//#endregion
|
|
1394
|
+
//#region src/hooks/url-state.ts
|
|
1395
|
+
/** The nearest store's navigation, else the bound store's, else the browser's.
|
|
1396
|
+
* Hosts set it once, so hook order holds. */
|
|
1397
|
+
function usePHNavigation() {
|
|
1398
|
+
return usePHStore()?.navigation ?? getPHNavigation();
|
|
1399
|
+
}
|
|
1400
|
+
/** The current query params. */
|
|
1401
|
+
function useSearchParams() {
|
|
1402
|
+
return usePHNavigation().useSearchParams();
|
|
1403
|
+
}
|
|
1404
|
+
/** Sets query params: an object merges into them, a function returns them all. */
|
|
1405
|
+
function useSetSearchParams() {
|
|
1406
|
+
return usePHNavigation().useSetSearchParams();
|
|
1407
|
+
}
|
|
1408
|
+
//#endregion
|
|
1409
|
+
//#region src/hooks/revision-history.ts
|
|
1410
|
+
/** The query param that opens the document's revision history: `?history`. */
|
|
1411
|
+
const REVISION_HISTORY_PARAM = "history";
|
|
1412
|
+
/** The history page shown, from 1 (the newest operations): `?history&historyPage=2`.
|
|
1413
|
+
* Its own name: a drive app or editor may page by `page`. */
|
|
1414
|
+
const REVISION_HISTORY_PAGE_PARAM = "historyPage";
|
|
1415
|
+
/** The page a `page` param names: a positive integer, else the first. */
|
|
1416
|
+
function parseRevisionHistoryPage(value) {
|
|
1417
|
+
const page = Number(value);
|
|
1418
|
+
return Number.isSafeInteger(page) && page > 0 ? page : 1;
|
|
1419
|
+
}
|
|
1420
|
+
/** Whether the URL opens the revision history. */
|
|
1421
|
+
function useRevisionHistoryVisible() {
|
|
1422
|
+
return useSearchParams()[REVISION_HISTORY_PARAM] !== void 0;
|
|
1423
|
+
}
|
|
1424
|
+
/** The revision history page the URL names, from 1. */
|
|
1425
|
+
function useRevisionHistoryPage() {
|
|
1426
|
+
return parseRevisionHistoryPage(useSearchParams()[REVISION_HISTORY_PAGE_PARAM]);
|
|
1427
|
+
}
|
|
1428
|
+
/** Shows the revision history: a new history entry, so Back closes it. */
|
|
1429
|
+
function showRevisionHistory() {
|
|
1430
|
+
setSearchParams((prev) => ({
|
|
1431
|
+
...prev,
|
|
1432
|
+
[REVISION_HISTORY_PARAM]: ""
|
|
1433
|
+
}));
|
|
1434
|
+
}
|
|
1435
|
+
/** Hides the revision history. */
|
|
1436
|
+
function hideRevisionHistory() {
|
|
1437
|
+
setSearchParams((prev) => ({
|
|
1438
|
+
...prev,
|
|
1439
|
+
[REVISION_HISTORY_PARAM]: void 0,
|
|
1440
|
+
[REVISION_HISTORY_PAGE_PARAM]: void 0
|
|
1441
|
+
}));
|
|
1442
|
+
}
|
|
1443
|
+
/** Opens history page `page`, from 1; Back returns to the page before. */
|
|
1444
|
+
function setRevisionHistoryPage(page) {
|
|
1445
|
+
setSearchParams((prev) => ({
|
|
1446
|
+
...prev,
|
|
1447
|
+
[REVISION_HISTORY_PARAM]: "",
|
|
1448
|
+
[REVISION_HISTORY_PAGE_PARAM]: page > 1 ? String(page) : void 0
|
|
1449
|
+
}));
|
|
1450
|
+
}
|
|
1451
|
+
/** Shows or hides the revision history. */
|
|
1452
|
+
function setRevisionHistoryVisible(visible) {
|
|
1453
|
+
if (visible) showRevisionHistory();
|
|
1454
|
+
else hideRevisionHistory();
|
|
1455
|
+
}
|
|
1456
|
+
/** @deprecated The revision history is a URL param now; there is no store value to watch. */
|
|
1457
|
+
function addRevisionHistoryVisibleEventHandler() {}
|
|
1458
|
+
//#endregion
|
|
1343
1459
|
//#region src/hooks/subgraph-modules.ts
|
|
1344
1460
|
function useSubgraphModules() {
|
|
1345
1461
|
return useVetraPackages().flatMap((pkg) => pkg.subgraphs || []);
|
|
@@ -1707,13 +1823,17 @@ function getSyncStatus(documentId, sharingType) {
|
|
|
1707
1823
|
return Promise.resolve(getSyncStatusSync(documentId, sharingType));
|
|
1708
1824
|
}
|
|
1709
1825
|
function getSyncStatusSync(documentId, sharingType) {
|
|
1710
|
-
if (sharingType === "LOCAL") return;
|
|
1711
|
-
const syncManager =
|
|
1826
|
+
if (sharingType === "LOCAL" || typeof window === "undefined") return;
|
|
1827
|
+
const syncManager = getPHStore()?.reactorClientModule?.reactorModule?.syncModule?.syncManager;
|
|
1712
1828
|
if (!syncManager) return;
|
|
1713
1829
|
const status = syncManager.getSyncStatus(documentId);
|
|
1714
1830
|
if (status === void 0) return;
|
|
1715
1831
|
return syncStatusToUI[status];
|
|
1716
1832
|
}
|
|
1833
|
+
/** A drive's display name: the header's (renames set it), else its creation name. */
|
|
1834
|
+
function getDriveName(drive) {
|
|
1835
|
+
return drive.header.name || drive.state.global.name;
|
|
1836
|
+
}
|
|
1717
1837
|
//#endregion
|
|
1718
1838
|
//#region src/utils/get-revision-from-date.ts
|
|
1719
1839
|
const getRevisionFromDate = (startDate, endDate, operations = []) => {
|
|
@@ -1904,7 +2024,7 @@ function buildDocumentSubgraphUrl(channelUrl, documentType, identifier, model, a
|
|
|
1904
2024
|
}
|
|
1905
2025
|
//#endregion
|
|
1906
2026
|
//#region src/utils/upgrade-preview.ts
|
|
1907
|
-
const NON_DOMAIN_SCOPES = new Set(["auth", "document"]);
|
|
2027
|
+
const NON_DOMAIN_SCOPES = /* @__PURE__ */ new Set(["auth", "document"]);
|
|
1908
2028
|
function isPlainObject(value) {
|
|
1909
2029
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1910
2030
|
}
|
|
@@ -1992,7 +2112,7 @@ function getDocumentUpgradePreview(document, registry) {
|
|
|
1992
2112
|
}
|
|
1993
2113
|
const addedFields = [];
|
|
1994
2114
|
const removedFields = [];
|
|
1995
|
-
const scopes = new Set([...Object.keys(document.state), ...Object.keys(upgraded.state)]);
|
|
2115
|
+
const scopes = /* @__PURE__ */ new Set([...Object.keys(document.state), ...Object.keys(upgraded.state)]);
|
|
1996
2116
|
for (const scope of scopes) {
|
|
1997
2117
|
if (NON_DOMAIN_SCOPES.has(scope)) continue;
|
|
1998
2118
|
const beforeScope = document.state[scope];
|
|
@@ -2075,7 +2195,9 @@ const useOnDropFile = (documentTypesOverride) => {
|
|
|
2075
2195
|
console.warn("No selected drive - upload skipped");
|
|
2076
2196
|
return;
|
|
2077
2197
|
}
|
|
2078
|
-
|
|
2198
|
+
const fileName = file.name.replace(/\..+/gim, "");
|
|
2199
|
+
const targetNodeId = targetFolder?.id ?? selectedFolder?.id;
|
|
2200
|
+
return await addFileWithProgress(file, selectedDriveId, fileName, targetNodeId, onProgress, documentTypesOverride ?? documentTypes, resolveConflict);
|
|
2079
2201
|
};
|
|
2080
2202
|
return onDropFile;
|
|
2081
2203
|
};
|
|
@@ -2094,6 +2216,45 @@ function useUserPermissions() {
|
|
|
2094
2216
|
};
|
|
2095
2217
|
}
|
|
2096
2218
|
//#endregion
|
|
2219
|
+
//#region src/hooks/close-node.ts
|
|
2220
|
+
/** Leaves a node's view: back to the entry it was opened from, past entries
|
|
2221
|
+
* pushed inside it; else, e.g. after a deep link, to its parent in place. */
|
|
2222
|
+
function useCloseNode(nodeId) {
|
|
2223
|
+
const navigation = usePHNavigation();
|
|
2224
|
+
const setSelectedNode = useSetSelectedNode();
|
|
2225
|
+
const parentFolder = useNodeParentFolderById(nodeId);
|
|
2226
|
+
return () => {
|
|
2227
|
+
if (navigation.closeOpened?.()) return;
|
|
2228
|
+
setSelectedNode(parentFolder, { replace: true });
|
|
2229
|
+
};
|
|
2230
|
+
}
|
|
2231
|
+
//#endregion
|
|
2232
|
+
//#region src/hooks/link-props.ts
|
|
2233
|
+
/** A plain primary click; modified and other-button clicks stay the browser's. */
|
|
2234
|
+
function isPlainClick(event) {
|
|
2235
|
+
return !event.defaultPrevented && event.button === 0 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey;
|
|
2236
|
+
}
|
|
2237
|
+
/** Props for an `<a>` that opens `target` in the app on a plain click, and
|
|
2238
|
+
* leaves new tabs and windows to the browser; acts on the store in context. */
|
|
2239
|
+
function useLinkProps(target, open) {
|
|
2240
|
+
const navigation = usePHNavigation();
|
|
2241
|
+
const href = navigation.hrefFor?.(target) ?? targetPathname(target);
|
|
2242
|
+
const isCurrent = navigation.useIsCurrent?.(target) ?? false;
|
|
2243
|
+
const preload = () => navigation.preload?.(target);
|
|
2244
|
+
const openTarget = open ?? (() => openTargetWith(navigation, target));
|
|
2245
|
+
return {
|
|
2246
|
+
href,
|
|
2247
|
+
onClick: (event) => {
|
|
2248
|
+
if (!isPlainClick(event)) return;
|
|
2249
|
+
event.preventDefault();
|
|
2250
|
+
openTarget();
|
|
2251
|
+
},
|
|
2252
|
+
onMouseEnter: preload,
|
|
2253
|
+
onFocus: preload,
|
|
2254
|
+
"aria-current": isCurrent ? "page" : void 0
|
|
2255
|
+
};
|
|
2256
|
+
}
|
|
2257
|
+
//#endregion
|
|
2097
2258
|
//#region src/hooks/attachment-progress.ts
|
|
2098
2259
|
const IDLE_PROGRESS = {
|
|
2099
2260
|
percent: 0,
|
|
@@ -2444,7 +2605,8 @@ async function dropAllReactorStorage(pg) {
|
|
|
2444
2605
|
const DEFAULT_DEBOUNCE_DELAY_MS = 200;
|
|
2445
2606
|
const DEFAULT_IMMEDIATE_THRESHOLD_MS = 1e3;
|
|
2446
2607
|
async function _refreshReactorData(reactor) {
|
|
2447
|
-
|
|
2608
|
+
const drives = await getDrives(reactor);
|
|
2609
|
+
setDrives(drives);
|
|
2448
2610
|
}
|
|
2449
2611
|
async function _refreshReactorDataClient(reactor) {
|
|
2450
2612
|
if (!reactor) return;
|
|
@@ -2491,6 +2653,215 @@ function createDebouncedRefreshReactorDataClient(debounceDelayMs = DEFAULT_DEBOU
|
|
|
2491
2653
|
const refreshReactorData = createDebouncedRefreshReactorData();
|
|
2492
2654
|
const refreshReactorDataClient = createDebouncedRefreshReactorDataClient();
|
|
2493
2655
|
//#endregion
|
|
2656
|
+
//#region src/routing/drive-arrivals.ts
|
|
2657
|
+
let pendingAdds = 0;
|
|
2658
|
+
const addListeners = /* @__PURE__ */ new Set();
|
|
2659
|
+
function notifyAdds() {
|
|
2660
|
+
for (const listener of [...addListeners]) listener();
|
|
2661
|
+
}
|
|
2662
|
+
/** Counts a background drive addition as pending until it settles. */
|
|
2663
|
+
function trackDriveArrival(promise) {
|
|
2664
|
+
pendingAdds++;
|
|
2665
|
+
notifyAdds();
|
|
2666
|
+
return promise.finally(() => {
|
|
2667
|
+
pendingAdds--;
|
|
2668
|
+
notifyAdds();
|
|
2669
|
+
});
|
|
2670
|
+
}
|
|
2671
|
+
/** Resolves once `store.drives` lists `driveId`, or after `maxWaitMs`: a
|
|
2672
|
+
* finished first pull does not mean the drive is listed yet. */
|
|
2673
|
+
function untilDriveListed(store, driveId, maxWaitMs = 15e3) {
|
|
2674
|
+
const listed = () => !!store.drives?.some((d) => d.header.id === driveId);
|
|
2675
|
+
if (listed()) return Promise.resolve();
|
|
2676
|
+
return new Promise((resolve) => {
|
|
2677
|
+
const finish = () => {
|
|
2678
|
+
clearTimeout(timer);
|
|
2679
|
+
unsubscribe();
|
|
2680
|
+
resolve();
|
|
2681
|
+
};
|
|
2682
|
+
const timer = setTimeout(finish, maxWaitMs);
|
|
2683
|
+
const unsubscribe = subscribePHStore(store, () => {
|
|
2684
|
+
if (listed()) finish();
|
|
2685
|
+
}, "drives");
|
|
2686
|
+
});
|
|
2687
|
+
}
|
|
2688
|
+
const REMOTE_EVENTS = [SyncEventTypes.CONNECTION_STATE_CHANGED, SYNC_REMOTES_CHANGED_EVENT];
|
|
2689
|
+
/** Drives still on their way into `store`: being added or first syncing. */
|
|
2690
|
+
function createDriveArrivals(store) {
|
|
2691
|
+
return {
|
|
2692
|
+
isPending: () => store.drives === void 0 || pendingAdds > 0 || isInitialSyncInFlight(store),
|
|
2693
|
+
isDrivePending: (driveId) => isInitialSyncInFlight(store, driveId),
|
|
2694
|
+
subscribe(listener) {
|
|
2695
|
+
const watched = /* @__PURE__ */ new Map();
|
|
2696
|
+
const listenToRemotes = () => {
|
|
2697
|
+
const channels = /* @__PURE__ */ new Set();
|
|
2698
|
+
for (const { channel } of listSyncRemotes(store)) {
|
|
2699
|
+
channels.add(channel);
|
|
2700
|
+
if (watched.has(channel)) continue;
|
|
2701
|
+
try {
|
|
2702
|
+
watched.set(channel, channel.onConnectionStateChange(listener));
|
|
2703
|
+
} catch {
|
|
2704
|
+
watched.set(channel, () => {});
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
for (const [channel, unsubscribe] of watched) {
|
|
2708
|
+
if (channels.has(channel)) continue;
|
|
2709
|
+
unsubscribe();
|
|
2710
|
+
watched.delete(channel);
|
|
2711
|
+
}
|
|
2712
|
+
};
|
|
2713
|
+
const onChange = () => {
|
|
2714
|
+
listenToRemotes();
|
|
2715
|
+
listener();
|
|
2716
|
+
};
|
|
2717
|
+
let unsubscribeBus = [];
|
|
2718
|
+
const listenToBus = () => {
|
|
2719
|
+
for (const unsubscribe of unsubscribeBus) unsubscribe();
|
|
2720
|
+
const bus = store.reactorClientModule?.reactorModule?.eventBus;
|
|
2721
|
+
unsubscribeBus = bus ? REMOTE_EVENTS.map((type) => bus.subscribe(type, onChange)) : [];
|
|
2722
|
+
};
|
|
2723
|
+
const onModuleChange = () => {
|
|
2724
|
+
listenToBus();
|
|
2725
|
+
onChange();
|
|
2726
|
+
};
|
|
2727
|
+
listenToRemotes();
|
|
2728
|
+
listenToBus();
|
|
2729
|
+
addListeners.add(onChange);
|
|
2730
|
+
const unsubscribes = [subscribePHStore(store, onChange, "drives"), subscribePHStore(store, onModuleChange, "reactorClientModule")];
|
|
2731
|
+
return () => {
|
|
2732
|
+
addListeners.delete(onChange);
|
|
2733
|
+
for (const unsubscribe of unsubscribes) unsubscribe();
|
|
2734
|
+
for (const unsubscribe of unsubscribeBus) unsubscribe();
|
|
2735
|
+
for (const unsubscribe of watched.values()) unsubscribe();
|
|
2736
|
+
watched.clear();
|
|
2737
|
+
};
|
|
2738
|
+
}
|
|
2739
|
+
};
|
|
2740
|
+
}
|
|
2741
|
+
//#endregion
|
|
2742
|
+
//#region src/routing/resolve-drive-route.ts
|
|
2743
|
+
/** How long a navigation waits for its document and editor before it shows;
|
|
2744
|
+
* past it the view commits and renders them as they load. */
|
|
2745
|
+
const PREFETCH_WAIT_MS = 3e3;
|
|
2746
|
+
const DRIVE_ARRIVAL_MAX_WAIT_MS = 15e3;
|
|
2747
|
+
/** A listed drive by slug, id, or a `<name>-<id>` slug's trailing id. */
|
|
2748
|
+
function findDriveBySlugOrId(store, ref) {
|
|
2749
|
+
return findDriveBySlug(store.drives, ref);
|
|
2750
|
+
}
|
|
2751
|
+
function findNode(drive, nodeId) {
|
|
2752
|
+
return drive?.state.global.nodes.find((node) => node.id === nodeId);
|
|
2753
|
+
}
|
|
2754
|
+
/** Resolves with `read()` once it is defined, nothing is still arriving, the
|
|
2755
|
+
* signal aborts or the cap passes. */
|
|
2756
|
+
function waitForArrival(read, arrivals, signal, maxWaitMs = DRIVE_ARRIVAL_MAX_WAIT_MS) {
|
|
2757
|
+
const value = read();
|
|
2758
|
+
if (value !== void 0 || !arrivals?.isPending() || signal.aborted) return Promise.resolve(value);
|
|
2759
|
+
return new Promise((resolve) => {
|
|
2760
|
+
let unsubscribe = () => {};
|
|
2761
|
+
const finish = (result) => {
|
|
2762
|
+
clearTimeout(timer);
|
|
2763
|
+
unsubscribe();
|
|
2764
|
+
signal.removeEventListener("abort", onAbort);
|
|
2765
|
+
resolve(result);
|
|
2766
|
+
};
|
|
2767
|
+
const onAbort = () => finish(void 0);
|
|
2768
|
+
const timer = setTimeout(onAbort, maxWaitMs);
|
|
2769
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
2770
|
+
unsubscribe = arrivals.subscribe(() => {
|
|
2771
|
+
const next = read();
|
|
2772
|
+
if (next !== void 0 || !arrivals.isPending()) finish(next);
|
|
2773
|
+
});
|
|
2774
|
+
});
|
|
2775
|
+
}
|
|
2776
|
+
/** Asks the reactor directly: a just-created drive may not be listed yet. */
|
|
2777
|
+
async function fetchDrive(store, ref, signal) {
|
|
2778
|
+
try {
|
|
2779
|
+
const document = await store.reactorClient?.get(ref, void 0, signal);
|
|
2780
|
+
return DRIVE_DOCUMENT_TYPES.includes(document?.header.documentType ?? "") ? document : void 0;
|
|
2781
|
+
} catch {
|
|
2782
|
+
return;
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
function editorModules(store) {
|
|
2786
|
+
return store.vetraPackageManager?.packages.flatMap((pkg) => pkg.editors) ?? [];
|
|
2787
|
+
}
|
|
2788
|
+
async function preloadModule(module) {
|
|
2789
|
+
try {
|
|
2790
|
+
await (module ? preloadEditorModule(module) : void 0);
|
|
2791
|
+
} catch {}
|
|
2792
|
+
}
|
|
2793
|
+
function documentEditor(store, document) {
|
|
2794
|
+
const { documentType, meta } = document.header;
|
|
2795
|
+
const modules = editorModules(store);
|
|
2796
|
+
return modules.find((module) => module.config.id === meta?.preferredEditor) ?? modules.find((module) => module.documentTypes.includes(documentType));
|
|
2797
|
+
}
|
|
2798
|
+
function driveApp(store, drive) {
|
|
2799
|
+
const id = drive.header.meta?.preferredEditor ?? "powerhouse/generic-drive-explorer";
|
|
2800
|
+
return editorModules(store).find((module) => module.config.id === id);
|
|
2801
|
+
}
|
|
2802
|
+
/** Loads a drive's app module so its view renders without suspending;
|
|
2803
|
+
* undefined when it is already loaded, so a warm open waits on nothing. */
|
|
2804
|
+
function preloadDriveApp(store, drive) {
|
|
2805
|
+
const module = driveApp(store, drive);
|
|
2806
|
+
return module && preloadEditorModule(module)?.then(noop, noop);
|
|
2807
|
+
}
|
|
2808
|
+
const noop = () => void 0;
|
|
2809
|
+
/** Warms a file node's document and its editor module. */
|
|
2810
|
+
async function prefetchDocument(store, node) {
|
|
2811
|
+
if (!isFileNode(node)) return;
|
|
2812
|
+
try {
|
|
2813
|
+
const document = await store.documentCache?.get(node.id);
|
|
2814
|
+
if (document) await preloadModule(documentEditor(store, document));
|
|
2815
|
+
} catch {}
|
|
2816
|
+
}
|
|
2817
|
+
/** Resolves once `work` settles, `ms` pass or `signal` aborts. */
|
|
2818
|
+
function settleWithin(work, ms, signal) {
|
|
2819
|
+
if (signal.aborted) return Promise.resolve();
|
|
2820
|
+
return new Promise((resolve) => {
|
|
2821
|
+
const done = () => {
|
|
2822
|
+
clearTimeout(timer);
|
|
2823
|
+
signal.removeEventListener("abort", done);
|
|
2824
|
+
resolve();
|
|
2825
|
+
};
|
|
2826
|
+
const timer = setTimeout(done, ms);
|
|
2827
|
+
signal.addEventListener("abort", done, { once: true });
|
|
2828
|
+
work.then(done, done);
|
|
2829
|
+
});
|
|
2830
|
+
}
|
|
2831
|
+
/** Resolves a drive route's slugs, waiting for drives that are still syncing,
|
|
2832
|
+
* and warms what the resolved view needs. */
|
|
2833
|
+
async function resolveDriveRoute(options) {
|
|
2834
|
+
const { store, driveSlug, nodeSlug, signal } = options;
|
|
2835
|
+
const arrivals = options.preload ? void 0 : options.arrivals;
|
|
2836
|
+
const drive = await waitForArrival(() => findDriveBySlugOrId(store, driveSlug), arrivals, signal) ?? await fetchDrive(store, extractDriveIdFromSlug(driveSlug) ?? driveSlug, signal);
|
|
2837
|
+
if (!drive) return { kind: "drive-not-found" };
|
|
2838
|
+
const driveId = drive.header.id;
|
|
2839
|
+
const appPreload = preloadDriveApp(store, drive);
|
|
2840
|
+
if (!nodeSlug) {
|
|
2841
|
+
if (appPreload) await settleWithin(appPreload, PREFETCH_WAIT_MS, signal);
|
|
2842
|
+
return {
|
|
2843
|
+
kind: "drive",
|
|
2844
|
+
driveId
|
|
2845
|
+
};
|
|
2846
|
+
}
|
|
2847
|
+
const nodeId = extractNodeIdFromSlug(nodeSlug) ?? drive.state.global.nodes.find((n) => n.id === nodeSlug || makeNodeSlug(n) === nodeSlug)?.id;
|
|
2848
|
+
const driveArrivals = arrivals && {
|
|
2849
|
+
...arrivals,
|
|
2850
|
+
isPending: () => arrivals.isDrivePending(driveId)
|
|
2851
|
+
};
|
|
2852
|
+
const node = nodeId ? await waitForArrival(() => findNode(findDriveBySlugOrId(store, driveId) ?? drive, nodeId), driveArrivals, signal) ?? findNode(await fetchDrive(store, driveId, signal), nodeId) : void 0;
|
|
2853
|
+
if (!node) return {
|
|
2854
|
+
kind: "node-not-found",
|
|
2855
|
+
driveId
|
|
2856
|
+
};
|
|
2857
|
+
await settleWithin(Promise.all([appPreload, prefetchDocument(store, node)]), PREFETCH_WAIT_MS, signal);
|
|
2858
|
+
return {
|
|
2859
|
+
kind: "drive",
|
|
2860
|
+
driveId,
|
|
2861
|
+
nodeId: node.id
|
|
2862
|
+
};
|
|
2863
|
+
}
|
|
2864
|
+
//#endregion
|
|
2494
2865
|
//#region src/remote-controller/action-tracker.ts
|
|
2495
2866
|
/**
|
|
2496
2867
|
* Tracks pending actions with their operation context (prevOpHash, prevOpIndex).
|
|
@@ -2532,6 +2903,7 @@ var ActionTracker = class {
|
|
|
2532
2903
|
*/
|
|
2533
2904
|
const DEFAULT_PAGE_SIZE = 100;
|
|
2534
2905
|
var RemoteClient = class {
|
|
2906
|
+
client;
|
|
2535
2907
|
pageSize;
|
|
2536
2908
|
constructor(client, pageSize) {
|
|
2537
2909
|
this.client = client;
|
|
@@ -2757,6 +3129,8 @@ var RemoteDocumentController = class RemoteDocumentController {
|
|
|
2757
3129
|
tracker = new ActionTracker();
|
|
2758
3130
|
options;
|
|
2759
3131
|
documentId;
|
|
3132
|
+
/** The remote's id for the document; `documentId` may be a slug. */
|
|
3133
|
+
canonicalDocumentId;
|
|
2760
3134
|
remoteRevision = {};
|
|
2761
3135
|
hasPulled = false;
|
|
2762
3136
|
pushScheduled = false;
|
|
@@ -2815,6 +3189,7 @@ var RemoteDocumentController = class RemoteDocumentController {
|
|
|
2815
3189
|
try {
|
|
2816
3190
|
await this.ensureRemoteDocument();
|
|
2817
3191
|
if (this.options.onConflict && tracked.length > 0) tracked = await this.handleConflicts(tracked, this.options.onConflict);
|
|
3192
|
+
if (this.options.signer && tracked.length > 0) await this.resolveCanonicalDocumentId();
|
|
2818
3193
|
} catch (error) {
|
|
2819
3194
|
this.tracker.restore(tracked);
|
|
2820
3195
|
throw error;
|
|
@@ -2845,7 +3220,9 @@ var RemoteDocumentController = class RemoteDocumentController {
|
|
|
2845
3220
|
async pull() {
|
|
2846
3221
|
if (this.documentId === "") throw new Error("Cannot pull: no document ID set");
|
|
2847
3222
|
const { remoteDoc, operations } = await this.fetchDocumentAndOperations();
|
|
2848
|
-
|
|
3223
|
+
this.canonicalDocumentId = remoteDoc.id;
|
|
3224
|
+
const initialDoc = this.inner.module.utils.createDocument();
|
|
3225
|
+
const pulledDocument = buildPulledDocument(remoteDoc, operations, initialDoc, this.options.branch ?? "main");
|
|
2849
3226
|
const ControllerClass = this.inner.constructor;
|
|
2850
3227
|
this.inner = new ControllerClass(pulledDocument);
|
|
2851
3228
|
this.setupActionInterceptors();
|
|
@@ -2858,7 +3235,8 @@ var RemoteDocumentController = class RemoteDocumentController {
|
|
|
2858
3235
|
* Pull an existing document from remote and create a controller for it.
|
|
2859
3236
|
*/
|
|
2860
3237
|
static async pull(ControllerClass, options) {
|
|
2861
|
-
const
|
|
3238
|
+
const temp = new ControllerClass();
|
|
3239
|
+
const remote = new RemoteDocumentController(temp, options);
|
|
2862
3240
|
if (options.documentId) await remote.pull();
|
|
2863
3241
|
return remote;
|
|
2864
3242
|
}
|
|
@@ -2873,7 +3251,9 @@ var RemoteDocumentController = class RemoteDocumentController {
|
|
|
2873
3251
|
/** Create the document on the remote if it doesn't exist yet. */
|
|
2874
3252
|
async ensureRemoteDocument() {
|
|
2875
3253
|
if (this.documentId !== "") return;
|
|
2876
|
-
|
|
3254
|
+
const remoteDoc = await this.remoteClient.createEmptyDocument(this.inner.header.documentType, this.options.parentIdentifier);
|
|
3255
|
+
this.documentId = remoteDoc.id;
|
|
3256
|
+
this.canonicalDocumentId = remoteDoc.id;
|
|
2877
3257
|
}
|
|
2878
3258
|
/** Set up interceptors for all action methods on the inner controller. */
|
|
2879
3259
|
setupActionInterceptors() {
|
|
@@ -2928,6 +3308,7 @@ var RemoteDocumentController = class RemoteDocumentController {
|
|
|
2928
3308
|
async handleConflicts(localTracked, strategy) {
|
|
2929
3309
|
const remoteResult = await this.remoteClient.getDocument(this.documentId, this.options.branch);
|
|
2930
3310
|
if (!remoteResult) throw new Error(`Document "${this.documentId}" not found on remote`);
|
|
3311
|
+
this.canonicalDocumentId ??= remoteResult.document.id;
|
|
2931
3312
|
const currentRevision = extractRevisionMap(remoteResult.document.revisionsList);
|
|
2932
3313
|
const localScopes = new Set(localTracked.map((t) => t.action.scope));
|
|
2933
3314
|
if (!hasRevisionConflict(currentRevision, this.remoteRevision, localScopes)) return localTracked;
|
|
@@ -2976,18 +3357,34 @@ var RemoteDocumentController = class RemoteDocumentController {
|
|
|
2976
3357
|
}
|
|
2977
3358
|
return actions;
|
|
2978
3359
|
}
|
|
3360
|
+
/**
|
|
3361
|
+
* The remote's id for `documentId`, which may be a slug. A signature binds
|
|
3362
|
+
* the id the remote verifies against, so a slug is never signed.
|
|
3363
|
+
*/
|
|
3364
|
+
async resolveCanonicalDocumentId() {
|
|
3365
|
+
if (this.canonicalDocumentId) return this.canonicalDocumentId;
|
|
3366
|
+
let result;
|
|
3367
|
+
try {
|
|
3368
|
+
result = await this.remoteClient.getDocument(this.documentId, this.options.branch);
|
|
3369
|
+
} catch (error) {
|
|
3370
|
+
throw new Error(`Cannot sign for "${this.documentId}": its document id could not be resolved on the remote`, { cause: error });
|
|
3371
|
+
}
|
|
3372
|
+
if (!result) throw new Error(`Cannot sign for "${this.documentId}": no document with that identifier on the remote`);
|
|
3373
|
+
this.canonicalDocumentId = result.document.id;
|
|
3374
|
+
return result.document.id;
|
|
3375
|
+
}
|
|
2979
3376
|
/** Sign an action using the configured signer, preserving existing signatures. */
|
|
2980
3377
|
async signAction(action) {
|
|
2981
3378
|
const signer = this.options.signer;
|
|
2982
|
-
const
|
|
3379
|
+
const target = actionSigningTarget(action, await this.resolveCanonicalDocumentId(), this.options.branch ?? "main");
|
|
3380
|
+
const signature = await signer.signAction(action, target);
|
|
2983
3381
|
const existingSignatures = action.context?.signer?.signatures ?? [];
|
|
2984
3382
|
return {
|
|
2985
3383
|
...action,
|
|
2986
3384
|
context: {
|
|
2987
3385
|
...action.context,
|
|
2988
3386
|
signer: {
|
|
2989
|
-
|
|
2990
|
-
app: signer.app,
|
|
3387
|
+
...actionSignerIdentity(signer),
|
|
2991
3388
|
signatures: [...existingSignatures, signature]
|
|
2992
3389
|
}
|
|
2993
3390
|
}
|
|
@@ -3136,6 +3533,6 @@ var BrowserLocalStorage = class extends BaseStorage {
|
|
|
3136
3533
|
}
|
|
3137
3534
|
};
|
|
3138
3535
|
//#endregion
|
|
3139
|
-
export { ActionTracker, BaseStorage, BrowserLocalStorage, COMMON_PACKAGE_ID, CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, ChannelScheme, ChevronDownIcon, ConflictError, CopyIcon, DEFAULT_DRIVE_EDITOR_ID, DEFAULT_DRIVE_ID, DEFAULT_SWITCHBOARD_URL, DOMAIN_TYPE, DRIVE_DOCUMENT_TYPES, DisconnectIcon, DocumentCache, DocumentChangeType, DocumentIntegrityService, DocumentModelNotFoundError, DocumentTypeMismatchError, DriveCollectionId, EDITOR_FILE_DROP_OPT_OUT_ATTR, GqlRequestChannel, GraphQLClientDocumentCache, GraphQLReactorClient, GraphQLReactorProvider, ISSUER_TYPE, InMemoryQueue, IntervalPollTimer, MutateDocumentWithOperationsDocument, NoSelectedDocumentError, PollBehavior, PropagationMode, REACTOR_SCHEMA, RENOWN_CHAIN_ID, RENOWN_INITIAL_ANONYMOUS, RENOWN_INITIAL_UNKNOWN, RENOWN_NETWORK_ID, RENOWN_RETURN_URL_STRIPPED_PARAMS, RENOWN_URL, ReactorBuilder, ReactorClientBuilder, ReactorOperationFieldsFragmentDoc, RegistryClient, RelationalDbProcessor, RemoteClient, RemoteDocumentController, Renown, RenownAuthButton, RenownInitialUserProvider, RenownLoginButton, RenownLogo, RenownProvider, RenownUserButton, RenownWalletProvider, SpinnerIcon, StaticPackageManager, SubgraphSdkRegistry, SyncOperationStatus, UnsupportedDocumentTypeError, UserIcon, VERIFIABLE_CREDENTIAL_EIP712_TYPE, addAllowListEventHandler, addAllowedDocumentTypesEventHandler, addAnalyticsDatabaseNameEventHandler, addAttachmentServiceEventHandler, addBasePathEventHandler, addCliVersionEventHandler, addDefaultDrivesUrlEventHandler, addDisabledEditorsEventHandler, addDocument, addDocumentCacheEventHandler, addDraggingNodeEventHandler, addDrive, addDrivesEventHandler, addDrivesPreserveStrategyEventHandler, addEnabledEditorsEventHandler, addFeaturesEventHandler, addFileUploadOperationsChunkSizeEventHandler, addFileWithProgress, addFolder, addGaTrackingIdEventHandler, addGraphQLReactorClientEventHandler, addIsAddCloudDrivesEnabledEventHandler, addIsAddDriveEnabledEventHandler, addIsAddLocalDrivesEnabledEventHandler, addIsAddPublicDrivesEnabledEventHandler, addIsAnalyticsDatabaseWorkerEnabledEventHandler, addIsAnalyticsEnabledEventHandler, addIsAnalyticsExternalProcessorsEnabledEventHandler, addIsCloudDrivesEnabledEventHandler, addIsDeleteCloudDrivesEnabledEventHandler, addIsDeleteLocalDrivesEnabledEventHandler, addIsDeletePublicDrivesEnabledEventHandler, addIsDiffAnalyticsEnabledEventHandler, addIsDocumentModelSelectionSettingsEnabledEventHandler, addIsDragAndDropEnabledEventHandler, addIsDriveAnalyticsEnabledEventHandler, addIsEditorDebugModeEnabledEventHandler, addIsEditorReadModeEnabledEventHandler, addIsExternalControlsEnabledEventHandler, addIsExternalPackagesEnabledEventHandler, addIsExternalProcessorsEnabledEventHandler, addIsExternalRelationalProcessorsEnabledEventHandler, addIsLocalDrivesEnabledEventHandler, addIsPublicDrivesEnabledEventHandler, addIsRelationalProcessorsEnabledEventHandler, addIsSentryTracingEnabledEventHandler, addLoadingEventHandler, addLocalDrivesEnabledEventHandler, addLogLevelEventHandler, addModalEventHandler, addPHEventHandlers, addPackageDiscoveryServiceEventHandler, addPromiseState, addReactorClientEventHandler, addReactorClientModuleEventHandler, addRemoteDrive, addRenownAdaptersEventHandler, addRenownChainIdEventHandler, addRenownEventHandler, addRenownNetworkIdEventHandler, addRenownUrlEventHandler, addRequiresHardRefreshEventHandler, addResetSelectedNodeEventHandler, addRevisionHistoryVisibleEventHandler, addRouterBasenameEventHandler, addSelectedDriveIdEventHandler, addSelectedNodeIdEventHandler, addSelectedTimelineItemEventHandler, addSelectedTimelineRevisionEventHandler, addSentryDsnEventHandler, addSentryEnvEventHandler, addSentryReleaseEventHandler, addSetSelectedDriveOnPopStateEventHandler, addSetSelectedNodeOnPopStateEventHandler, addStudioModeEventHandler, addSwitchboardUrlEventHandler, addToastEventHandler, addVersionCheckIntervalEventHandler, addVersionEventHandler, addVetraPackageManagerEventHandler, addWarnOutdatedAppEventHandler, ambientRenownTokenProvider, baseDocumentModels, baseDocumentModelsMap, buildDocumentSubgraphQuery, buildDocumentSubgraphUrl, buildFolderZip, callEventHandlerRegisterFunctions, callGlobalSetterForKey, clearGlobal, closePHModal, commonGlobalEventHandlerFunctions, convertRemoteOperations, createAnalyticsStore, createClient, createProcessorQuery, createUrlWithPreservedParams, deleteDrive, deleteNode, deriveSystemUrl, describeGraphQLDocument, diffStateShapes, dispatchActions, downloadDocument, downloadFolderZip, driveIdFromUrl, dropAllReactorStorage, ensurePHEventHandlers, expandBulkArchive, exportFile, extractDriveIdFromPath, extractDriveIdFromSlug, extractDriveSlugFromPath, extractNodeIdFromPath, extractNodeIdFromSlug, extractNodeSlugFromPath, fetchDriveInfo, findUuid, getAnalyticsStore, getDocumentExtension, getDocumentGraphqlQuery, getDocumentStateSelection, getDocumentUpgradePreview, getDocumentVersionStatus, getDriveIdBySlug, getDrives, getGlobal, getPackageInfo, getPackagePage, getPackages, getPackagesByDocumentType, getPackagesForDocumentType, getPathWithoutBase, getRevisionFromDate, getSlugFromDriveUrl, getSwitchboardBaseFromChannelUrl, getSwitchboardGatewayUrlFromDriveUrl, getSyncStatus, getSyncStatusSync, getUserPermissions, graphqlDocumentEvents, graphqlDocumentsEvents, graphqlEventsToSyncDrive, hasPreloadBandwidth, hideRevisionHistory, identifierFromMutateDocumentOperationVariables, initConnectCrypto, initRenownCrypto, initTheme, isAuthRefusalClose, isDocumentTypeSupported, isDriveAuthError, isExternalControlsEnabledEventFunctions, isFileNodeKind, isFolderNodeKind, isGraphQLReactorClient, loadFile, loading, login, logout, makeAuthConnectionParams, makeAuthMiddleware, makeDriveUrlComponent, makeNodeSlug, makePHEventFunctions, openRenown, packageFromDocumentModels, parseDriveUrl, phAppConfigHooks, phAppConfigSetters, phDocumentEditorConfigHooks, phDocumentEditorConfigSetters, phDocumentFromGetDocument, phDocumentFromMutation, phDocumentFromQuery, phDocumentsFromQuery, phGlobalConfigHooks, phGlobalConfigSetters, preloadEditorModule, prepareSignedActions, reactorGraphqlBatchFetchDocuments, reactorGraphqlCreateDocument, reactorGraphqlDeleteDocument, reactorGraphqlDeleteDocuments, reactorGraphqlFetchDocument, reactorGraphqlMutateDocument, readPromiseState, refreshReactorData, refreshReactorDataClient, renameDrive, renameDriveNode, resolveDocumentModelModule, resolveUrlPathname, revisionMapFromRevisionsList, setAllowList, setAllowedDocumentTypes, setAnalyticsDatabaseName, setAttachmentService, setBasePath, setCliVersion, setDefaultDrivesUrl, setDefaultPHGlobalConfig, setDisabledEditors, setDocumentCache, setDriveAvailableOffline, setDriveMetadata, setDriveSharingType, setDrives, setDrivesPreserveStrategy, setEnabledEditors, setFeatures, setFileUploadOperationsChunkSize, setGaTrackingId, setGlobal, setGraphQLReactorClient, setIsAddCloudDrivesEnabled, setIsAddDriveEnabled, setIsAddLocalDrivesEnabled, setIsAddPublicDrivesEnabled, setIsAnalyticsDatabaseWorkerEnabled, setIsAnalyticsEnabled, setIsAnalyticsExternalProcessorsEnabled, setIsCloudDrivesEnabled, setIsDeleteCloudDrivesEnabled, setIsDeleteLocalDrivesEnabled, setIsDeletePublicDrivesEnabled, setIsDiffAnalyticsEnabled, setIsDocumentModelSelectionSettingsEnabled, setIsDragAndDropEnabled, setIsDriveAnalyticsEnabled, setIsEditorDebugModeEnabled, setIsEditorReadModeEnabled, setIsExternalControlsEnabled, setIsExternalPackagesEnabled, setIsExternalProcessorsEnabled, setIsExternalRelationalProcessorsEnabled, setIsLocalDrivesEnabled, setIsPublicDrivesEnabled, setIsRelationalProcessorsEnabled, setIsSentryTracingEnabled, setLoading, setLocalDrivesEnabled, setLogLevel, setPGliteDB, setPHAppConfig, setPHAppConfigByKey, setPHDocumentEditorConfig, setPHDocumentEditorConfigByKey, setPHGlobalConfig, setPHGlobalConfigByKey, setPHModal, setPHToast, setPackageDiscoveryService, setPreferredEditorOnNode, setReactorClient, setReactorClientModule, setRenown, setRenownAdapters, setRenownChainId, setRenownNetworkId, setRenownUrl, setRequiresHardRefresh, setRevisionHistoryVisible, setRouterBasename, setSelectedDrive, setSelectedDriveId, setSelectedNode, setSelectedTimelineItem, setSelectedTimelineRevision, setSentryDsn, setSentryEnv, setSentryRelease, setStudioMode, setSwitchboardUrl, setVersion, setVersionCheckInterval, setVetraPackageManager, setWarnOutdatedApp, showCreateDocumentModal, showDeleteNodeModal, showPHModal, showRevisionHistory, signStampedAction, sortNodesByName, stampAction, startDocumentChangesSubscription, subgraphUrlFromGraphqlUrl, subscriptionsUrlFromGraphqlUrl, trimTrailingSlash, truncateAllTables, upgradeDocument, useAllowList, useAllowedDocumentModelModules, useAllowedDocumentTypes, useAnalyticsDatabaseName, useAppModuleById, useAppModules, useAttachmentPreview, useAttachmentService, useAttachmentUpload, useAttachments, useBasePath, useCanExecute, useCliVersion, useConnectionState, useConnectionStates, useDatabase, useDefaultAppModule, useDefaultDrivesUrl, useDid, useDisabledEditors, useDispatch, useDocument, useDocumentById, useDocumentCache, useDocumentModelModuleById, useDocumentModelModules, useDocumentOfType, useDocumentOperations, useDocumentSafe, useDocumentTypes, useDocumentTypesInSelectedDrive, useDocumentVersionStatus, useDocuments, useDocumentsByIds, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useDownloadDocument, useDownloadFolder, useDragNode, useDriveById, useDriveSystemInfo, useDrives, useDrivesPreserveStrategy, useDropFile, useDropNode, useEditorFileDrop, useEditorModuleById, useEditorModules, useEditorModulesForDocumentType, useEditorPreloader, useEnabledEditors, useFallbackEditorModule, useFeatures, useFileNodesInSelectedDrive, useFileNodesInSelectedFolder, useFileUploadOperationsChunkSize, useFolderById, useFolderNodesInSelectedDrive, useFolderNodesInSelectedFolder, useGaTrackingId, useGetDocument, useGetDocumentAsync, useGetDocuments, useGetSwitchboardLink, useGraphQLReactorClient, useInitReactorGraphqlClient, useIsAddCloudDrivesEnabled, useIsAddDriveEnabled, useIsAddLocalDrivesEnabled, useIsAddPublicDrivesEnabled, useIsAnalyticsDatabaseWorkerEnabled, useIsAnalyticsEnabled, useIsAnalyticsExternalProcessorsEnabled, useIsCloudDrivesEnabled, useIsDeleteCloudDrivesEnabled, useIsDeleteLocalDrivesEnabled, useIsDeletePublicDrivesEnabled, useIsDiffAnalyticsEnabled, useIsDocumentModelSelectionSettingsEnabled, useIsDragAndDropEnabled, useIsDriveAnalyticsEnabled, useIsEditorDebugModeEnabled, useIsEditorReadModeEnabled, useIsExternalControlsEnabled, useIsExternalPackagesEnabled, useIsExternalProcessorsEnabled, useIsExternalRelationalProcessorsEnabled, useIsLocalDrivesEnabled, useIsPublicDrivesEnabled, useIsRelationalProcessorsEnabled, useIsSentryTracingEnabled, useLoading, useLocalDrivesEnabled, useLogLevel, useLoginStatus, useModelRegistry, useNodeActions, useNodeById, useNodeParentFolderById, useNodePathById, useNodesInSelectedDrive, useNodesInSelectedDriveOrFolder, useNodesInSelectedFolder, useOnDropFile, usePGlite, usePHAppConfigByKey, usePHDocumentEditorConfigByKey, usePHGlobalConfigByKey, usePHModal, usePHToast, usePackageDiscoveryService, useParentFolderForSelectedNode, useReactorClient, useReactorClientModule, useRelationalDb, useRelationalQuery, useRenown, useRenownAdapters, useRenownAuth, useRenownAuthAsync, useRenownChainId, useRenownInit, useRenownInitialAuth, useRenownInitialUser, useRenownLoginMethods, useRenownNetworkId, useRenownSessionCookie, useRenownSessionSynced, useRenownUrl, useRenownWalletAdapter, useRequiresHardRefresh, useResetPHGlobalConfig, useRevisionHistoryVisible, useRouterBasename, useSelectedDocument, useSelectedDocumentId, useSelectedDocumentOfType, useSelectedDocumentSafe, useSelectedDrive, useSelectedDriveId, useSelectedDriveSafe, useSelectedFolder, useSelectedNode, useSelectedNodePath, useSelectedTimelineItem, useSelectedTimelineRevision, useSentryDsn, useSentryEnv, useSentryRelease, useSetDefaultPHGlobalConfig, useSetPHAppConfig, useSetPHDocumentEditorConfig, useSetPHGlobalConfig, useStudioMode, useSubgraphModules, useSupportedDocumentTypesInReactor, useSwitchboardClient, useSwitchboardUrl, useSync, useSyncList, useTheme, useUser, useUserPermissions, useVersion, useVersionCheckInterval, useVetraPackageManager, useVetraPackages, useWarnOutdatedApp, validateDocument, viewFilterInputFromViewFilter, waitForDocumentReady };
|
|
3536
|
+
export { ActionTracker, BaseStorage, BatchJobFailedError, BrowserLocalStorage, COMMON_PACKAGE_ID, CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, ChannelScheme, ChevronDownIcon, ConflictError, CopyIcon, DEFAULT_DRIVE_EDITOR_ID, DEFAULT_DRIVE_ID, DEFAULT_SWITCHBOARD_URL, DOMAIN_TYPE, DRIVE_ARRIVAL_MAX_WAIT_MS, DRIVE_DOCUMENT_TYPES, DisconnectIcon, DocumentCache, DocumentChangeType, DocumentIntegrityService, DocumentModelNotFoundError, DocumentTypeMismatchError, DriveCollectionId, DriveProvider, EDITOR_FILE_DROP_OPT_OUT_ATTR, EditorDocumentProvider, FEATURE_FLAG_PARAM_PREFIX, GLOBAL_SEARCH_PARAMS, GqlRequestChannel, GraphQLClientDocumentCache, GraphQLOperationNotSupportedError, GraphQLReactorClient, GraphQLReactorProvider, GraphQLWrongBackendError, IDLE_OPERATIONS_ENTRY, IDLE_REFETCH_STATE, ISSUER_TYPE, InMemoryQueue, IntervalPollTimer, MODAL_SEARCH_PARAM, MutateDocumentWithOperationsDocument, NoSelectedDocumentError, OPENED_FROM_STATE_KEY, PHStoreProvider, PH_LOCATION_CHANGE_EVENT, PREFETCH_WAIT_MS, PollBehavior, PropagationMode, REACTOR_SCHEMA, RENOWN_CHAIN_ID, RENOWN_INITIAL_ANONYMOUS, RENOWN_INITIAL_UNKNOWN, RENOWN_NETWORK_ID, RENOWN_RETURN_URL_STRIPPED_PARAMS, RENOWN_URL, REVISION_HISTORY_PAGE_PARAM, REVISION_HISTORY_PARAM, ReactorBuilder, ReactorClientBuilder, ReactorOperationFieldsFragmentDoc, RegistryClient, RelationalDbProcessor, RemoteClient, RemoteDocumentController, Renown, RenownAuthButton, RenownInitialUserProvider, RenownLoginButton, RenownLogo, RenownProvider, RenownUserButton, RenownWalletProvider, SETTINGS_PATH, SpinnerIcon, StaticPackageManager, SubgraphSdkRegistry, SyncOperationStatus, UnsupportedDocumentTypeError, UserIcon, VERIFIABLE_CREDENTIAL_EIP712_TYPE, addAllowListEventHandler, addAllowedDocumentTypesEventHandler, addAnalyticsDatabaseNameEventHandler, addAttachmentServiceEventHandler, addBasePathEventHandler, addCliVersionEventHandler, addDefaultDrivesUrlEventHandler, addDisabledEditorsEventHandler, addDocument, addDocumentCacheEventHandler, addDraggingNodeEventHandler, addDrive, addDrivesEventHandler, addDrivesPreserveStrategyEventHandler, addEnabledEditorsEventHandler, addFeaturesEventHandler, addFileUploadOperationsChunkSizeEventHandler, addFileWithProgress, addFolder, addFullReactorClientEventHandler, addGaTrackingIdEventHandler, addGraphQLReactorClientEventHandler, addIsAddCloudDrivesEnabledEventHandler, addIsAddDriveEnabledEventHandler, addIsAddLocalDrivesEnabledEventHandler, addIsAddPublicDrivesEnabledEventHandler, addIsAnalyticsDatabaseWorkerEnabledEventHandler, addIsAnalyticsEnabledEventHandler, addIsAnalyticsExternalProcessorsEnabledEventHandler, addIsCloudDrivesEnabledEventHandler, addIsDeleteCloudDrivesEnabledEventHandler, addIsDeleteLocalDrivesEnabledEventHandler, addIsDeletePublicDrivesEnabledEventHandler, addIsDiffAnalyticsEnabledEventHandler, addIsDocumentModelSelectionSettingsEnabledEventHandler, addIsDragAndDropEnabledEventHandler, addIsDriveAnalyticsEnabledEventHandler, addIsEditorDebugModeEnabledEventHandler, addIsEditorReadModeEnabledEventHandler, addIsExternalControlsEnabledEventHandler, addIsExternalPackagesEnabledEventHandler, addIsExternalProcessorsEnabledEventHandler, addIsExternalRelationalProcessorsEnabledEventHandler, addIsLocalDrivesEnabledEventHandler, addIsPublicDrivesEnabledEventHandler, addIsRelationalProcessorsEnabledEventHandler, addIsSentryTracingEnabledEventHandler, addLoadingEventHandler, addLocalDrivesEnabledEventHandler, addLogLevelEventHandler, addModalEventHandler, addPHEventHandlers, addPackageDiscoveryServiceEventHandler, addPromiseState, addReactorClientEventHandler, addReactorClientModuleEventHandler, addRemoteDrive, addRenownAdaptersEventHandler, addRenownChainIdEventHandler, addRenownEventHandler, addRenownNetworkIdEventHandler, addRenownUrlEventHandler, addRequiresHardRefreshEventHandler, addResetSelectedNodeEventHandler, addRevisionHistoryVisibleEventHandler, addRouterBasenameEventHandler, addSelectedDriveIdEventHandler, addSelectedNodeIdEventHandler, addSelectedTimelineItemEventHandler, addSelectedTimelineRevisionEventHandler, addSentryDsnEventHandler, addSentryEnvEventHandler, addSentryReleaseEventHandler, addSetSelectedDriveOnPopStateEventHandler, addSetSelectedNodeOnPopStateEventHandler, addStudioModeEventHandler, addSwitchboardUrlEventHandler, addSyncSelectionOnPopStateEventHandler, addToastEventHandler, addVersionCheckIntervalEventHandler, addVersionEventHandler, addVetraPackageManagerEventHandler, addWarnOutdatedAppEventHandler, ambientRenownTokenProvider, applySearchUpdate, baseDocumentModels, baseDocumentModelsMap, bindPHStoreToWindow, browserNavigation, buildDocumentSubgraphQuery, buildDocumentSubgraphUrl, buildFolderZip, callEventHandlerRegisterFunctions, callGlobalSetterForKey, clearGlobal, closePHModal, commonGlobalEventHandlerFunctions, convertRemoteOperations, createAnalyticsStore, createClient, createDispatch, createDriveArrivals, createPHStore, createProcessorQuery, createUrlWithPreservedParams, deleteDrive, deleteNode, deriveSystemUrl, describeGraphQLDocument, diffStateShapes, dispatchActions, downloadDocument, downloadFolderZip, driveIdFromUrl, dropAllReactorStorage, ensurePHEventHandlers, ensurePHStore, expandBulkArchive, exportFile, extractDriveIdFromPath, extractDriveIdFromSlug, extractDriveSlugFromPath, extractNodeIdFromPath, extractNodeIdFromSlug, extractNodeSlugFromPath, fetchDrive, fetchDriveInfo, findDerivedId, findDriveBySlug, findDriveBySlugOrId, findIsServableOverGraphQL, findUuid, getActivePHStore, getAnalyticsStore, getCurrentPathname, getDocumentExtension, getDocumentGraphqlQuery, getDocumentStateSelection, getDocumentUpgradePreview, getDocumentVersionStatus, getDriveIdBySlug, getDriveName, getDrives, getFullReactorClient, getGlobal, getNodeTarget, getPHNavigation, getPHStore, getPHStoreSubscribe, getPackageInfo, getPackagePage, getPackages, getPackagesByDocumentType, getPackagesForDocumentType, getPathWithoutBase, getRevisionFromDate, getSlugFromDriveUrl, getSwitchboardBaseFromChannelUrl, getSwitchboardGatewayUrlFromDriveUrl, getSyncStatus, getSyncStatusSync, getTargetHref, getUserPermissions, graphqlDocumentEvents, graphqlDocumentsEvents, graphqlEventsToSyncDrive, hasHostNavigation, hasPreloadBandwidth, hideRevisionHistory, identifierFromMutateDocumentOperationVariables, initConnectCrypto, initRenownCrypto, initTheme, isAuthRefusalClose, isDocumentTypeSupported, isDriveAuthError, isExternalControlsEnabledEventFunctions, isFileNodeKind, isFolderNodeKind, isGlobalSearchParam, isGraphQLReactorClient, isOperationCache, isPlainClick, isRoutedModal, isSettingsTarget, isoStringFromDateTime, loadFile, loading, login, logout, makeAuthConnectionParams, makeAuthMiddleware, makeDriveSlug, makeDriveUrlComponent, makeNodeSlug, makePHEventFunctions, modalFromSearch, modalHref, modalSearch, notifyPHStore, onVetraPackageManager, openRenown, openTarget, openTargetWith, openedFromIndex, packageFromDocumentModels, parseDriveUrl, parseRevisionHistoryPage, phAppConfigHooks, phAppConfigSetters, phDocumentEditorConfigHooks, phDocumentEditorConfigSetters, phDocumentFromGetDocument, phDocumentFromMutation, phDocumentFromQuery, phDocumentsFromQuery, phGlobalConfigHooks, phGlobalConfigSetters, prefetchDocument, preloadDrive, preloadDriveApp, preloadEditorModule, preloadNode, preloadTarget, prepareSignedActions, reactorGraphqlBatchFetchDocuments, reactorGraphqlCreateDocument, reactorGraphqlDeleteDocument, reactorGraphqlDeleteDocuments, reactorGraphqlFetchDocument, reactorGraphqlMutateDocument, readPromiseState, recordToSearch, refreshReactorData, refreshReactorDataClient, renameDrive, renameDriveNode, resolveDocumentModelModule, resolveDriveRoute, resolveSearchUpdate, resolveUrlPathname, revisionMapFromRevisionsList, searchPackages, searchParamsToString, searchToRecord, setAllowList, setAllowedDocumentTypes, setAnalyticsDatabaseName, setAttachmentService, setBasePath, setBrowserOpenSync, setCliVersion, setDefaultDrivesUrl, setDefaultPHGlobalConfig, setDisabledEditors, setDocumentCache, setDriveAvailableOffline, setDriveMetadata, setDriveSharingType, setDrives, setDrivesPreserveStrategy, setEnabledEditors, setFeatures, setFileUploadOperationsChunkSize, setFullReactorClient, setGaTrackingId, setGlobal, setGraphQLReactorClient, setIsAddCloudDrivesEnabled, setIsAddDriveEnabled, setIsAddLocalDrivesEnabled, setIsAddPublicDrivesEnabled, setIsAnalyticsDatabaseWorkerEnabled, setIsAnalyticsEnabled, setIsAnalyticsExternalProcessorsEnabled, setIsCloudDrivesEnabled, setIsDeleteCloudDrivesEnabled, setIsDeleteLocalDrivesEnabled, setIsDeletePublicDrivesEnabled, setIsDiffAnalyticsEnabled, setIsDocumentModelSelectionSettingsEnabled, setIsDragAndDropEnabled, setIsDriveAnalyticsEnabled, setIsEditorDebugModeEnabled, setIsEditorReadModeEnabled, setIsExternalControlsEnabled, setIsExternalPackagesEnabled, setIsExternalProcessorsEnabled, setIsExternalRelationalProcessorsEnabled, setIsLocalDrivesEnabled, setIsPublicDrivesEnabled, setIsRelationalProcessorsEnabled, setIsSentryTracingEnabled, setLoading, setLocalDrivesEnabled, setLogLevel, setPGliteDB, setPHAppConfig, setPHAppConfigByKey, setPHDocumentEditorConfig, setPHDocumentEditorConfigByKey, setPHGlobalConfig, setPHGlobalConfigByKey, setPHModal, setPHToast, setPackageDiscoveryService, setPreferredEditorOnNode, setReactorClient, setReactorClientModule, setRenown, setRenownAdapters, setRenownChainId, setRenownNetworkId, setRenownUrl, setRequiresHardRefresh, setRevisionHistoryPage, setRevisionHistoryVisible, setRouterBasename, setSearchParams, setSelectedDrive, setSelectedDriveId, setSelectedNode, setSelectedNodeId, setSelectedTimelineItem, setSelectedTimelineRevision, setSentryDsn, setSentryEnv, setSentryRelease, setStudioMode, setSwitchboardUrl, setVersion, setVersionCheckInterval, setVetraPackageManager, setWarnOutdatedApp, showCreateDocumentModal, showDeleteNodeModal, showPHModal, showRevisionHistory, signStampedAction, sortNodesByName, stampAction, startDocumentChangesSubscription, subgraphUrlFromGraphqlUrl, subscribePHStore, subscribeToPHValue, subscriptionsUrlFromGraphqlUrl, syncSelectionFromPath, targetPathname, trackDriveArrival, trimTrailingSlash, truncateAllTables, untilDriveListed, upgradeDocument, useAllowList, useAllowedDocumentModelModules, useAllowedDocumentTypes, useAnalyticsDatabaseName, useAppModuleById, useAppModules, useAttachmentPreview, useAttachmentService, useAttachmentUpload, useAttachments, useBasePath, useCanExecute, useCliVersion, useCloseNode, useConnectionState, useConnectionStates, useDatabase, useDefaultAppModule, useDefaultDrivesUrl, useDid, useDisabledEditors, useDispatch, useDocument, useDocumentById, useDocumentCache, useDocumentModelModuleById, useDocumentModelModules, useDocumentOfType, useDocumentOperations, useDocumentSafe, useDocumentTypes, useDocumentTypesInSelectedDrive, useDocumentVersionStatus, useDocuments, useDocumentsByIds, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useDownloadDocument, useDownloadFolder, useDragNode, useDriveById, useDriveContext, useDriveSystemInfo, useDrives, useDrivesPreserveStrategy, useDropFile, useDropNode, useEditorDocumentContext, useEditorFileDrop, useEditorModuleById, useEditorModuleFor, useEditorModules, useEditorModulesForDocumentType, useEditorPreloader, useEnabledEditors, useFallbackEditorModule, useFeatures, useFileNodesInSelectedDrive, useFileNodesInSelectedFolder, useFileUploadOperationsChunkSize, useFolderById, useFolderNodesInSelectedDrive, useFolderNodesInSelectedFolder, useGaTrackingId, useGetDocument, useGetDocumentAsync, useGetDocuments, useGetSwitchboardLink, useGraphQLReactorClient, useInitReactorGraphqlClient, useIsAddCloudDrivesEnabled, useIsAddDriveEnabled, useIsAddLocalDrivesEnabled, useIsAddPublicDrivesEnabled, useIsAnalyticsDatabaseWorkerEnabled, useIsAnalyticsEnabled, useIsAnalyticsExternalProcessorsEnabled, useIsCloudDrivesEnabled, useIsDeleteCloudDrivesEnabled, useIsDeleteLocalDrivesEnabled, useIsDeletePublicDrivesEnabled, useIsDiffAnalyticsEnabled, useIsDocumentModelSelectionSettingsEnabled, useIsDragAndDropEnabled, useIsDriveAnalyticsEnabled, useIsEditorDebugModeEnabled, useIsEditorReadModeEnabled, useIsExternalControlsEnabled, useIsExternalPackagesEnabled, useIsExternalProcessorsEnabled, useIsExternalRelationalProcessorsEnabled, useIsLocalDrivesEnabled, useIsPublicDrivesEnabled, useIsRelationalProcessorsEnabled, useIsSentryTracingEnabled, useLinkProps, useLoading, useLocalDrivesEnabled, useLogLevel, useLoginStatus, useModelRegistry, useNodeActions, useNodeById, useNodeParentFolderById, useNodePathById, useNodeTarget, useNodesInSelectedDrive, useNodesInSelectedDriveOrFolder, useNodesInSelectedFolder, useOnDropFile, useOpenNode, usePGlite, usePHAppConfigByKey, usePHDocumentEditorConfigByKey, usePHGlobalConfigByKey, usePHModal, usePHNavigation, usePHStore, usePHToast, usePackageDiscoveryService, useParentFolderForSelectedNode, usePreloadDrive, usePreloadNode, useReactorClient, useReactorClientModule, useRelationalDb, useRelationalQuery, useRenown, useRenownAdapters, useRenownAuth, useRenownAuthAsync, useRenownChainId, useRenownInit, useRenownInitialAuth, useRenownInitialUser, useRenownLoginMethods, useRenownNetworkId, useRenownSessionCookie, useRenownSessionSynced, useRenownUrl, useRenownWalletAdapter, useRequiresHardRefresh, useResetPHGlobalConfig, useRevisionHistoryPage, useRevisionHistoryVisible, useRouterBasename, useSearchParams, useSelectedDocument, useSelectedDocumentId, useSelectedDocumentOfType, useSelectedDocumentSafe, useSelectedDrive, useSelectedDriveId, useSelectedDriveSafe, useSelectedFolder, useSelectedNode, useSelectedNodePath, useSelectedTimelineItem, useSelectedTimelineRevision, useSentryDsn, useSentryEnv, useSentryRelease, useSetDefaultPHGlobalConfig, useSetPHAppConfig, useSetPHDocumentEditorConfig, useSetPHGlobalConfig, useSetSearchParams, useSetSelectedDrive, useSetSelectedNode, useStudioMode, useSubgraphModules, useSupportedDocumentTypesInReactor, useSwitchboardClient, useSwitchboardUrl, useSync, useSyncList, useTheme, useUser, useUserPermissions, useVersion, useVersionCheckInterval, useVetraPackageManager, useVetraPackages, useWarnOutdatedApp, validateDocument, viewFilterInputFromViewFilter, waitForArrival, waitForDocumentReady, withoutModalSearch };
|
|
3140
3537
|
|
|
3141
3538
|
//# sourceMappingURL=index.js.map
|