@powerhousedao/reactor-browser 6.2.3 → 6.3.0-dev.10
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-But1Xljo.d.ts → attachment-service-B-AmTrs2.d.ts} +605 -56
- package/dist/attachment-service-B-AmTrs2.d.ts.map +1 -0
- package/dist/auth-DRbzRdeC.d.ts +32 -0
- package/dist/auth-DRbzRdeC.d.ts.map +1 -0
- package/dist/{client-BiJAJ9dW.js → client-BFnMV-EO.js} +39 -22
- package/dist/client-BFnMV-EO.js.map +1 -0
- package/dist/{client-CngU4mtn.d.ts → client-BP0hXjqq.d.ts} +3 -2
- package/dist/client-BP0hXjqq.d.ts.map +1 -0
- package/dist/client-wwavHFfs.js +135 -0
- package/dist/client-wwavHFfs.js.map +1 -0
- package/dist/{dispatch-qRXS70fh.js → dispatch-Cylwl2Dk.js} +363 -44
- package/dist/dispatch-Cylwl2Dk.js.map +1 -0
- package/dist/{document-by-id-B_8DA4yZ.js → document-by-id-DdvqanGR.js} +2 -2
- package/dist/{document-by-id-B_8DA4yZ.js.map → document-by-id-DdvqanGR.js.map} +1 -1
- package/dist/document-model-modules-BG-61uke.js +710 -0
- package/dist/document-model-modules-BG-61uke.js.map +1 -0
- package/dist/{document-operations-Bt-1-ThH.js → document-operations-DRMMwmGZ.js} +2160 -181
- package/dist/document-operations-DRMMwmGZ.js.map +1 -0
- package/dist/global-iARBhxNI.d.ts +612 -0
- package/dist/global-iARBhxNI.d.ts.map +1 -0
- package/dist/{index-BABMK8cO.d.ts → index-CNS_9THu.d.ts} +14 -4
- package/dist/index-CNS_9THu.d.ts.map +1 -0
- package/dist/index.d.ts +560 -79
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +790 -317
- 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/{relational-ChC_AWAK.js → relational-DZuyKp2y.js} +65 -5
- package/dist/relational-DZuyKp2y.js.map +1 -0
- package/dist/{renown-C9pYZRqf.js → renown-B3MUaiq7.js} +56 -25
- package/dist/renown-B3MUaiq7.js.map +1 -0
- package/dist/renown-CBoTdGrg.js +394 -0
- package/dist/renown-CBoTdGrg.js.map +1 -0
- package/dist/{client-VV9M73s_.js → schema-B5lftDPf.js} +295 -195
- package/dist/schema-B5lftDPf.js.map +1 -0
- package/dist/{types-B7-_l_wE.d.ts → schema-C6ECceaN.d.ts} +272 -82
- package/dist/schema-C6ECceaN.d.ts.map +1 -0
- package/dist/src/ai/index.d.ts +269 -24
- package/dist/src/ai/index.d.ts.map +1 -1
- package/dist/src/ai/index.js +1028 -168
- package/dist/src/ai/index.js.map +1 -1
- package/dist/src/analytics/index.js +3 -3
- package/dist/src/graphql/client.d.ts +2 -2
- package/dist/src/graphql/client.js +1 -1
- package/dist/src/graphql-client/entry.d.ts +6 -4
- package/dist/src/graphql-client/entry.js +4 -4
- package/dist/src/relational/index.d.ts +8 -1
- 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 +2 -2
- package/dist/src/renown/index.js +3 -3
- package/dist/src/rpc/index.d.ts +201 -144
- package/dist/src/rpc/index.d.ts.map +1 -1
- package/dist/src/rpc/index.js +562 -634
- package/dist/src/rpc/index.js.map +1 -1
- package/dist/switchboard-directory-vH6qtkh-.js +435 -0
- package/dist/switchboard-directory-vH6qtkh-.js.map +1 -0
- package/dist/switchboards-D-_JBUbF.d.ts +75 -0
- package/dist/switchboards-D-_JBUbF.d.ts.map +1 -0
- package/dist/types-BWx6FPO4.d.ts +63 -0
- package/dist/types-BWx6FPO4.d.ts.map +1 -0
- package/package.json +19 -17
- package/dist/attachment-service-But1Xljo.d.ts.map +0 -1
- package/dist/client-BiJAJ9dW.js.map +0 -1
- package/dist/client-CngU4mtn.d.ts.map +0 -1
- package/dist/client-VV9M73s_.js.map +0 -1
- package/dist/dispatch-qRXS70fh.js.map +0 -1
- package/dist/document-model-modules-D6I-UUXq.js +0 -386
- package/dist/document-model-modules-D6I-UUXq.js.map +0 -1
- package/dist/document-operations-Bt-1-ThH.js.map +0 -1
- package/dist/global-fql2bmb0.d.ts +0 -438
- package/dist/global-fql2bmb0.d.ts.map +0 -1
- package/dist/index-BABMK8cO.d.ts.map +0 -1
- package/dist/inspector-proxy-DCowaeeH.d.ts +0 -264
- package/dist/inspector-proxy-DCowaeeH.d.ts.map +0 -1
- package/dist/make-ph-event-functions-FzpvQtj6.js +0 -53
- package/dist/make-ph-event-functions-FzpvQtj6.js.map +0 -1
- package/dist/relational-ChC_AWAK.js.map +0 -1
- package/dist/renown-C9pYZRqf.js.map +0 -1
- package/dist/renown-Def5iO8k.js +0 -97
- package/dist/renown-Def5iO8k.js.map +0 -1
- package/dist/switchboard-CFyD_5_e.js +0 -323
- package/dist/switchboard-CFyD_5_e.js.map +0 -1
- package/dist/types-B7-_l_wE.d.ts.map +0 -1
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
import { i as IReactorBrowserClient$1, s as ReactorBrowserHalves$1, t as SwitchboardDirectory$1 } from "./switchboards-D-_JBUbF.js";
|
|
2
|
+
import { t as PGlite } from "./pglite-CntadC_p-DTkdF8sr.js";
|
|
3
|
+
import { c as ReactorGraphQLClient, r as GraphQLClientWindowEvents } from "./types-BWx6FPO4.js";
|
|
4
|
+
import { r as IWorkerAdminClient, t as IInspectorProxy } from "./inspector-proxy-DODqs15F.js";
|
|
5
|
+
import { DragEventHandler, ReactNode } from "react";
|
|
6
|
+
import { DocumentDispatch as DocumentDispatch$2, DocumentModelModule, Operation, PHDocument, PhAiToolDescriptor } from "@powerhousedao/shared/document-model";
|
|
7
|
+
import { IDocumentModelLoader, IReactorClient, InProcessReactorClientModule, InProcessReactorModule, ReactorClientModule, ReactorModule } from "@powerhousedao/reactor";
|
|
8
|
+
import { DocumentDriveDocument, Node } from "@powerhousedao/shared/document-drive";
|
|
9
|
+
import { IRenown } from "@renown/sdk";
|
|
10
|
+
import { IAttachmentService } from "@powerhousedao/reactor-attachments/client";
|
|
11
|
+
import { WorkerPackageSource } from "@powerhousedao/reactor/rpc";
|
|
12
|
+
import { PHGlobal, PHGlobalKey } from "@powerhousedao/reactor-browser";
|
|
13
|
+
import { PHConnectRenownAdapters } from "@powerhousedao/shared/clis";
|
|
14
|
+
import { DocumentModelLib, RegistryPackageSource } from "@powerhousedao/shared";
|
|
15
|
+
//#region src/types/documents.d.ts
|
|
16
|
+
type PromiseWithState<T> = Promise<T> & PromiseState<T>;
|
|
17
|
+
type FulfilledPromise<T> = Promise<T> & {
|
|
18
|
+
status: "fulfilled";
|
|
19
|
+
value: T;
|
|
20
|
+
};
|
|
21
|
+
type RejectedPromise<T> = Promise<T> & {
|
|
22
|
+
status: "rejected";
|
|
23
|
+
reason: unknown;
|
|
24
|
+
};
|
|
25
|
+
type PromiseState<T> = {
|
|
26
|
+
status: "pending";
|
|
27
|
+
} | {
|
|
28
|
+
status: "fulfilled";
|
|
29
|
+
value: T;
|
|
30
|
+
} | {
|
|
31
|
+
status: "rejected";
|
|
32
|
+
reason: unknown;
|
|
33
|
+
};
|
|
34
|
+
/** A refetch of an already-loaded document. `error` is the last failure that kept the loaded document. */
|
|
35
|
+
type DocumentRefetchState = {
|
|
36
|
+
isRefetching: boolean;
|
|
37
|
+
error: unknown;
|
|
38
|
+
};
|
|
39
|
+
interface IDocumentCache {
|
|
40
|
+
get(id: string, refetch?: boolean): Promise<PHDocument>;
|
|
41
|
+
getBatch(ids: string[], refetch?: boolean): Promise<PHDocument[]>;
|
|
42
|
+
subscribe(id: string | string[], callback: () => void): () => void;
|
|
43
|
+
/** Stable snapshot of the refetch of `id`. Optional: not every cache refetches in the background. */
|
|
44
|
+
getRefetchState?(id: string): DocumentRefetchState;
|
|
45
|
+
}
|
|
46
|
+
/** Snapshot of one document scope's operations as the cache knows them. */
|
|
47
|
+
type OperationsCacheEntry = {
|
|
48
|
+
/** `idle` means nothing has been requested since the last invalidation. */
|
|
49
|
+
status: "idle" | "pending" | "success" | "error";
|
|
50
|
+
/** Every operation loaded so far, oldest first, across all loaded pages. */
|
|
51
|
+
operations: readonly Operation[];
|
|
52
|
+
/** The rejection reason of the last failed page; `undefined` otherwise. */
|
|
53
|
+
error: unknown;
|
|
54
|
+
/** Whether the last loaded page reported a further page. */
|
|
55
|
+
hasNextPage: boolean;
|
|
56
|
+
};
|
|
57
|
+
/** The documents of one type loaded so far, in `find`'s order, across loaded pages. */
|
|
58
|
+
type DocumentsOfTypeEntry = {
|
|
59
|
+
/** `idle` means nothing has been requested yet. */
|
|
60
|
+
status: "idle" | "pending" | "success" | "error";
|
|
61
|
+
/** The ids loaded so far; the documents themselves are in the document cache. */
|
|
62
|
+
ids: readonly string[];
|
|
63
|
+
/** The rejection reason of the last failed page; `undefined` otherwise. */
|
|
64
|
+
error: unknown;
|
|
65
|
+
/** Whether the last loaded page reported a further page. */
|
|
66
|
+
hasNextPage: boolean;
|
|
67
|
+
};
|
|
68
|
+
/** Documents by type, a page at a time; loaded pages reload when one of the
|
|
69
|
+
* type is created or deleted, and a changed one updates in the document cache. */
|
|
70
|
+
interface IDocumentTypeCache {
|
|
71
|
+
/** Current snapshot of `type` paged by `limit`; a shared idle entry when nothing is loaded. */
|
|
72
|
+
getDocumentsOfTypeState(type: string, limit: number): DocumentsOfTypeEntry;
|
|
73
|
+
/** Loads the first page, once; settles when it has loaded or failed. */
|
|
74
|
+
loadDocumentsOfType(type: string, limit: number): Promise<void>;
|
|
75
|
+
/** Loads the page after the last one; no-op unless loaded with a next page. */
|
|
76
|
+
loadMoreDocumentsOfType(type: string, limit: number): void;
|
|
77
|
+
/** Subscribes to changes of `type` paged by `limit`. Returns the unsubscribe function. */
|
|
78
|
+
subscribeDocumentsOfType(type: string, limit: number, callback: () => void): () => void;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Operation history keyed by document id and scope. Pages are fetched
|
|
82
|
+
* oldest first and appended. A document change event drops every scope of
|
|
83
|
+
* that document so the next read starts from the first page again.
|
|
84
|
+
*/
|
|
85
|
+
interface IOperationCache {
|
|
86
|
+
/** Current snapshot; a shared idle entry when nothing is cached. */
|
|
87
|
+
getOperationsState(documentId: string, scope: string): OperationsCacheEntry;
|
|
88
|
+
/** Loads the first page. No-op unless the entry is idle. */
|
|
89
|
+
loadOperations(documentId: string, scope: string, limit: number): void;
|
|
90
|
+
/** Loads the page after the last one and appends it. No-op unless the entry is loaded and has a next page. */
|
|
91
|
+
loadMoreOperations(documentId: string, scope: string): void;
|
|
92
|
+
/** Drops every cached scope of the document, aborts in-flight requests, notifies listeners. */
|
|
93
|
+
invalidateOperations(documentId: string): void;
|
|
94
|
+
/** Subscribes to changes of any scope of the document. Returns the unsubscribe function. */
|
|
95
|
+
subscribeOperations(documentId: string, callback: () => void): () => void;
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/types/config.d.ts
|
|
99
|
+
type PHGlobalConfig$1 = PHCommonGlobalConfig & PHAppConfig$1 & PHDocumentEditorConfig$1 & PHDrivesGlobalConfig & PHAnalyticsGlobalConfig & PHRelationalProcessorsGlobalConfig & PHProcessorsGlobalConfig & PHRenownGlobalConfig & PHSentryGlobalConfig;
|
|
100
|
+
type PHGlobalConfigKey$1 = keyof PHGlobalConfig$1;
|
|
101
|
+
type PHGlobalConfigSetters$1 = PHGlobalConfigSettersForKey<PHGlobalConfigKey$1>;
|
|
102
|
+
type PHGlobalConfigHooks$1 = PHGlobalConfigHooksForKey<PHGlobalConfigKey$1>;
|
|
103
|
+
/**
|
|
104
|
+
* Editor configuration settings which are globally available to your custom apps.
|
|
105
|
+
*
|
|
106
|
+
* Setting these will override the defaults when your editor is mounted.
|
|
107
|
+
*/
|
|
108
|
+
type PHAppConfig$1 = {
|
|
109
|
+
/** Allows you to specify the document types that are allowed to be added to the drive.
|
|
110
|
+
* An empty array means that any document type is allowed.
|
|
111
|
+
*/
|
|
112
|
+
allowedDocumentTypes?: string[];
|
|
113
|
+
/** Whether drag and drop is enabled for the app. */
|
|
114
|
+
isDragAndDropEnabled?: boolean;
|
|
115
|
+
};
|
|
116
|
+
type PHAppConfigKey$1 = keyof PHAppConfig$1;
|
|
117
|
+
type PHAppConfigSetters$1 = PHGlobalConfigSettersForKey<PHAppConfigKey$1>;
|
|
118
|
+
type PHAppConfigHooks$1 = PHGlobalConfigHooksForKey<PHAppConfigKey$1>;
|
|
119
|
+
type PHDocumentEditorConfig$1 = {
|
|
120
|
+
/** Whether external controls are enabled for the document editor. */
|
|
121
|
+
isExternalControlsEnabled?: boolean;
|
|
122
|
+
};
|
|
123
|
+
type PHDocumentEditorConfigKey$1 = keyof PHDocumentEditorConfig$1;
|
|
124
|
+
type PHDocumentEditorConfigSetters$1 = PHGlobalConfigSettersForKey<PHDocumentEditorConfigKey$1>;
|
|
125
|
+
type PHDocumentEditorConfigHooks$1 = PHGlobalConfigHooksForKey<PHDocumentEditorConfigKey$1>;
|
|
126
|
+
type PHCommonGlobalConfig = {
|
|
127
|
+
basePath?: string;
|
|
128
|
+
routerBasename?: string;
|
|
129
|
+
version?: string;
|
|
130
|
+
requiresHardRefresh?: boolean;
|
|
131
|
+
warnOutdatedApp?: boolean;
|
|
132
|
+
studioMode?: boolean;
|
|
133
|
+
versionCheckInterval?: number;
|
|
134
|
+
cliVersion?: string;
|
|
135
|
+
fileUploadOperationsChunkSize?: number;
|
|
136
|
+
gaTrackingId?: string;
|
|
137
|
+
isDocumentModelSelectionSettingsEnabled?: boolean;
|
|
138
|
+
isAddDriveEnabled?: boolean;
|
|
139
|
+
isPublicDrivesEnabled?: boolean;
|
|
140
|
+
isAddPublicDrivesEnabled?: boolean;
|
|
141
|
+
isDeletePublicDrivesEnabled?: boolean;
|
|
142
|
+
isCloudDrivesEnabled?: boolean;
|
|
143
|
+
isAddCloudDrivesEnabled?: boolean;
|
|
144
|
+
isDeleteCloudDrivesEnabled?: boolean;
|
|
145
|
+
isLocalDrivesEnabled?: boolean;
|
|
146
|
+
isAddLocalDrivesEnabled?: boolean;
|
|
147
|
+
isDeleteLocalDrivesEnabled?: boolean;
|
|
148
|
+
allowList?: string[];
|
|
149
|
+
analyticsDatabaseName?: string;
|
|
150
|
+
logLevel?: "debug" | "info" | "warn" | "error";
|
|
151
|
+
isEditorDebugModeEnabled?: boolean;
|
|
152
|
+
isEditorReadModeEnabled?: boolean;
|
|
153
|
+
disabledEditors?: string[];
|
|
154
|
+
enabledEditors?: string[];
|
|
155
|
+
};
|
|
156
|
+
type PHDrivesGlobalConfig = {
|
|
157
|
+
defaultDrivesUrl?: string;
|
|
158
|
+
drivesPreserveStrategy?: string;
|
|
159
|
+
};
|
|
160
|
+
type PHAnalyticsGlobalConfig = {
|
|
161
|
+
isAnalyticsEnabled?: boolean;
|
|
162
|
+
isAnalyticsDatabaseWorkerEnabled?: boolean;
|
|
163
|
+
isDiffAnalyticsEnabled?: boolean;
|
|
164
|
+
isDriveAnalyticsEnabled?: boolean;
|
|
165
|
+
isAnalyticsExternalProcessorsEnabled?: boolean;
|
|
166
|
+
};
|
|
167
|
+
type PHRelationalProcessorsGlobalConfig = {
|
|
168
|
+
isRelationalProcessorsEnabled?: boolean;
|
|
169
|
+
isExternalRelationalProcessorsEnabled?: boolean;
|
|
170
|
+
};
|
|
171
|
+
type PHProcessorsGlobalConfig = {
|
|
172
|
+
isExternalProcessorsEnabled?: boolean;
|
|
173
|
+
isExternalPackagesEnabled?: boolean;
|
|
174
|
+
};
|
|
175
|
+
type PHRenownGlobalConfig = {
|
|
176
|
+
renownUrl?: string;
|
|
177
|
+
renownNetworkId?: string;
|
|
178
|
+
renownChainId?: number;
|
|
179
|
+
switchboardUrl?: string;
|
|
180
|
+
renownAdapters?: PHConnectRenownAdapters;
|
|
181
|
+
};
|
|
182
|
+
type PHSentryGlobalConfig = {
|
|
183
|
+
sentryRelease?: string;
|
|
184
|
+
sentryDsn?: string;
|
|
185
|
+
sentryEnv?: string;
|
|
186
|
+
isSentryTracingEnabled?: boolean;
|
|
187
|
+
};
|
|
188
|
+
type PHGlobalConfigSettersForKey<T extends PHGlobalConfigKey$1> = { [K in T]: (value: PHGlobalConfig$1[K]) => void; };
|
|
189
|
+
type PHGlobalConfigHooksForKey<TKey extends PHGlobalConfigKey$1> = { [K in TKey]: () => PHGlobalConfig$1[K]; };
|
|
190
|
+
/** Helper type for ensuring keys are all present while still allowing them to be set */
|
|
191
|
+
type FullPHGlobalConfig = Record<PHGlobalConfigKey$1, PHGlobalConfig$1[PHGlobalConfigKey$1]>;
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/types/modals.d.ts
|
|
194
|
+
type PHModal$1 = {
|
|
195
|
+
type: "createDocument";
|
|
196
|
+
documentType: string;
|
|
197
|
+
documentModelVersion?: number;
|
|
198
|
+
/** The drive to create it in; else the open drive, else the user picks one. */
|
|
199
|
+
driveId?: string;
|
|
200
|
+
} | {
|
|
201
|
+
type: "deleteItem";
|
|
202
|
+
id: string;
|
|
203
|
+
} | {
|
|
204
|
+
type: "addDrive";
|
|
205
|
+
} | {
|
|
206
|
+
type: "upgradeDrive";
|
|
207
|
+
driveId: string;
|
|
208
|
+
} | {
|
|
209
|
+
type: "deleteDrive";
|
|
210
|
+
driveId: string;
|
|
211
|
+
} | {
|
|
212
|
+
type: "driveSettings";
|
|
213
|
+
driveId: string;
|
|
214
|
+
} |
|
|
215
|
+
/** @deprecated Open `{ settings: true }` through the navigation instead. */
|
|
216
|
+
{
|
|
217
|
+
type: "settings";
|
|
218
|
+
} | {
|
|
219
|
+
type: "clearStorage";
|
|
220
|
+
} | {
|
|
221
|
+
type: "debugSettings";
|
|
222
|
+
} | {
|
|
223
|
+
type: "disclaimer";
|
|
224
|
+
} | {
|
|
225
|
+
type: "cookiesPolicy";
|
|
226
|
+
} | {
|
|
227
|
+
type: "downloadDocumentWithErrors";
|
|
228
|
+
documentId: string;
|
|
229
|
+
} | {
|
|
230
|
+
type: "inspector";
|
|
231
|
+
} | {
|
|
232
|
+
type: "documentVersionUnsupported";
|
|
233
|
+
documentType: string;
|
|
234
|
+
requiredVersion: number;
|
|
235
|
+
availableVersions: number[];
|
|
236
|
+
} | {
|
|
237
|
+
type: "confirmDocumentUpgrade";
|
|
238
|
+
documentId: string;
|
|
239
|
+
} | {
|
|
240
|
+
type: "driveAuthRequired";
|
|
241
|
+
} | {
|
|
242
|
+
type: "openFileDocuments";
|
|
243
|
+
} | {
|
|
244
|
+
type: "login";
|
|
245
|
+
};
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region src/types/package-discovery.d.ts
|
|
248
|
+
type PendingInstallation = {
|
|
249
|
+
documentType: string;
|
|
250
|
+
packageNames: string[];
|
|
251
|
+
};
|
|
252
|
+
type FailedInstallationReason = "no-registry" | "not-in-registry" | "registry-error" | "install-failed" | "dismissed" | "offline";
|
|
253
|
+
type FailedInstallation = {
|
|
254
|
+
documentType: string;
|
|
255
|
+
reason: FailedInstallationReason;
|
|
256
|
+
packageNames: string[];
|
|
257
|
+
error: Error | null;
|
|
258
|
+
};
|
|
259
|
+
type DiscoveryEvent = {
|
|
260
|
+
type: "type-discovered";
|
|
261
|
+
documentType: string;
|
|
262
|
+
packageNames: string[];
|
|
263
|
+
} | {
|
|
264
|
+
type: "installation-prompted";
|
|
265
|
+
documentType: string;
|
|
266
|
+
packageNames: string[];
|
|
267
|
+
} | {
|
|
268
|
+
type: "installation-approved";
|
|
269
|
+
packageName: string;
|
|
270
|
+
documentTypes: string[];
|
|
271
|
+
} | {
|
|
272
|
+
type: "installation-dismissed";
|
|
273
|
+
packageName: string;
|
|
274
|
+
documentTypes: string[];
|
|
275
|
+
} | {
|
|
276
|
+
type: "installation-failed";
|
|
277
|
+
packageName: string;
|
|
278
|
+
error: Error;
|
|
279
|
+
} | {
|
|
280
|
+
type: "registry-query-failed";
|
|
281
|
+
documentType: string;
|
|
282
|
+
error: Error;
|
|
283
|
+
} | {
|
|
284
|
+
type: "load-failed";
|
|
285
|
+
documentType: string;
|
|
286
|
+
reason: FailedInstallationReason;
|
|
287
|
+
};
|
|
288
|
+
type DiscoveryEventListener = (event: DiscoveryEvent) => void;
|
|
289
|
+
interface IPackageDiscoveryService {
|
|
290
|
+
load(documentType: string): Promise<DocumentModelModule<any>>;
|
|
291
|
+
getPendingInstallations(): PendingInstallation[];
|
|
292
|
+
subscribePending(listener: () => void): () => void;
|
|
293
|
+
getFailedInstallations(): FailedInstallation[];
|
|
294
|
+
subscribeFailed(listener: () => void): () => void;
|
|
295
|
+
subscribeEvents(listener: DiscoveryEventListener): () => void;
|
|
296
|
+
approveInstallation(packageName: string): Promise<void>;
|
|
297
|
+
dismissInstallation(packageName: string): void;
|
|
298
|
+
promptInstallation(documentType: string): void;
|
|
299
|
+
retryInstallation(documentType: string): Promise<void>;
|
|
300
|
+
}
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/types/timeline.d.ts
|
|
303
|
+
type TimelineBarItem = {
|
|
304
|
+
id: string;
|
|
305
|
+
type: "bar";
|
|
306
|
+
addSize?: 0 | 1 | 2 | 3 | 4;
|
|
307
|
+
delSize?: 0 | 1 | 2 | 3 | 4;
|
|
308
|
+
timestampUtcMs?: string;
|
|
309
|
+
additions?: number;
|
|
310
|
+
deletions?: number;
|
|
311
|
+
revision?: number;
|
|
312
|
+
startDate?: Date;
|
|
313
|
+
endDate?: Date;
|
|
314
|
+
};
|
|
315
|
+
type TimelineDividerItem = {
|
|
316
|
+
id: string;
|
|
317
|
+
type: "divider";
|
|
318
|
+
timestampUtcMs?: string;
|
|
319
|
+
title?: string;
|
|
320
|
+
subtitle?: string;
|
|
321
|
+
revision?: number;
|
|
322
|
+
startDate?: Date;
|
|
323
|
+
endDate?: Date;
|
|
324
|
+
};
|
|
325
|
+
type TimelineItem = TimelineBarItem | TimelineDividerItem;
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/types/toast.d.ts
|
|
328
|
+
type PHToastType = "default" | "success" | "error" | "warning" | "info" | "connect-success" | "connect-warning" | "connect-loading" | "connect-deleted";
|
|
329
|
+
type PHToastOptions = {
|
|
330
|
+
type?: PHToastType;
|
|
331
|
+
autoClose?: number | false;
|
|
332
|
+
containerId?: string;
|
|
333
|
+
};
|
|
334
|
+
type PHToastFn = (content: ReactNode | string, options?: PHToastOptions) => void;
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region src/types/vetra.d.ts
|
|
337
|
+
type IPackagesListener = (data: {
|
|
338
|
+
packages: DocumentModelLib[];
|
|
339
|
+
}) => void;
|
|
340
|
+
type IPackageListerUnsubscribe = () => void;
|
|
341
|
+
type PackageManagerInstallResult = {
|
|
342
|
+
type: "success";
|
|
343
|
+
package: DocumentModelLib;
|
|
344
|
+
} | {
|
|
345
|
+
type: "error";
|
|
346
|
+
error: Error;
|
|
347
|
+
};
|
|
348
|
+
interface IPackageManager extends IDocumentModelLoader {
|
|
349
|
+
registryUrl: string | null;
|
|
350
|
+
packages: DocumentModelLib[];
|
|
351
|
+
addPackage(packageName: string): Promise<PackageManagerInstallResult> | PackageManagerInstallResult;
|
|
352
|
+
addPackages(packageNames: string[]): Promise<PackageManagerInstallResult[]> | PackageManagerInstallResult[];
|
|
353
|
+
removePackage(name: string): void;
|
|
354
|
+
updateLocalPackage(pkg: DocumentModelLib, version?: string): void;
|
|
355
|
+
subscribe(handler: IPackagesListener): IPackageListerUnsubscribe;
|
|
356
|
+
getPackageSource: (packageName: string) => RegistryPackageSource | null;
|
|
357
|
+
getPackageVersion: (packageName: string) => string | undefined;
|
|
358
|
+
getPackageSpec: (packageName: string) => string | undefined;
|
|
359
|
+
/**
|
|
360
|
+
* Registry-installed packages keyed by their storage name (the registry
|
|
361
|
+
* spec, e.g. "@powerhousedao/clint-common"). Used by callers that need to
|
|
362
|
+
* diff against an external source of truth such as the publish-reload
|
|
363
|
+
* channel's `/__packages` SSE feed.
|
|
364
|
+
*/
|
|
365
|
+
getRegistryPackages: () => {
|
|
366
|
+
name: string;
|
|
367
|
+
version: string | undefined;
|
|
368
|
+
}[];
|
|
369
|
+
addLocalPackage: (name: string, loadedPackage: DocumentModelLib, version?: string) => void;
|
|
370
|
+
}
|
|
371
|
+
//#endregion
|
|
372
|
+
//#region src/hooks/node-drag-and-drop.d.ts
|
|
373
|
+
type DraggingNode = {
|
|
374
|
+
srcId: string;
|
|
375
|
+
parentId: string | null | undefined;
|
|
376
|
+
};
|
|
377
|
+
declare const addDraggingNodeEventHandler: () => void;
|
|
378
|
+
declare function useDragNode(args: {
|
|
379
|
+
srcId: string | undefined;
|
|
380
|
+
parentId: string | null | undefined;
|
|
381
|
+
}): {
|
|
382
|
+
isDragging: boolean;
|
|
383
|
+
draggable: boolean;
|
|
384
|
+
onDragStart: DragEventHandler;
|
|
385
|
+
onDragEnd: DragEventHandler;
|
|
386
|
+
};
|
|
387
|
+
declare function useDropNode(targetId: string | undefined): {
|
|
388
|
+
isDropTarget: boolean;
|
|
389
|
+
onDragEnter: DragEventHandler;
|
|
390
|
+
onDragOver: DragEventHandler;
|
|
391
|
+
onDragLeave: DragEventHandler;
|
|
392
|
+
onDrop: DragEventHandler;
|
|
393
|
+
};
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region src/hooks/ph-store.d.ts
|
|
396
|
+
/** PH state of one app (or one server request); assigning a key notifies. */
|
|
397
|
+
type PHStore = PHGlobal;
|
|
398
|
+
declare const ALL_KEYS: unique symbol;
|
|
399
|
+
declare function createPHStore(initial?: PHGlobal): PHStore;
|
|
400
|
+
/** Subscribes to changes of `key`, or of every key when omitted. */
|
|
401
|
+
declare function subscribePHStore(store: PHStore, listener: () => void, key?: PHGlobalKey | typeof ALL_KEYS): () => void;
|
|
402
|
+
/** Notifies `key`'s listeners without a change, as re-setting a value does. */
|
|
403
|
+
declare function notifyPHStore(store: PHStore, key: PHGlobalKey): void;
|
|
404
|
+
/** A subscribe for `key`, stable per store as useSyncExternalStore expects. */
|
|
405
|
+
declare function getPHStoreSubscribe(store: PHStore, key?: PHGlobalKey): (listener: () => void) => () => void;
|
|
406
|
+
/** The store bound with {@link bindPHStoreToWindow}, if any. */
|
|
407
|
+
declare function getActivePHStore(): PHGlobal | undefined;
|
|
408
|
+
/** The app's state outside React: the bound store, else `window.ph`. */
|
|
409
|
+
declare function getPHStore(): PHStore | undefined;
|
|
410
|
+
/** The bound store; otherwise binds `window.ph` if it is a store, else a new
|
|
411
|
+
* store that takes over a plain `window.ph`'s values. */
|
|
412
|
+
declare function ensurePHStore(): PHStore;
|
|
413
|
+
/** Makes `store` the app's state and `window.ph`; values set on a plain
|
|
414
|
+
* `window.ph` carry over where `store` has none. */
|
|
415
|
+
declare function bindPHStoreToWindow(store: PHStore): void;
|
|
416
|
+
/** Hooks below read from `store`; without a provider they read `window.ph`. */
|
|
417
|
+
declare function PHStoreProvider(props: {
|
|
418
|
+
store: PHStore;
|
|
419
|
+
children: ReactNode;
|
|
420
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
421
|
+
declare function usePHStore(): PHGlobal | undefined;
|
|
422
|
+
//#endregion
|
|
423
|
+
//#region src/hooks/drive-nodes.d.ts
|
|
424
|
+
/** One drive's cached nodes, read through `read.drives`. */
|
|
425
|
+
type DriveNodesEntry = {
|
|
426
|
+
readonly byId: ReadonlyMap<string, Node>;
|
|
427
|
+
/** "all" once a full listing landed; "partial" holds single fetches or a
|
|
428
|
+
* listing being refreshed. */
|
|
429
|
+
readonly loaded: "none" | "partial" | "all";
|
|
430
|
+
/** The drive's nodes from the last full listing, kept while it refreshes. */
|
|
431
|
+
readonly nodes?: Node[];
|
|
432
|
+
readonly loading?: Promise<Node[]>;
|
|
433
|
+
/** The drive changed while `loading` was in flight: that listing may miss
|
|
434
|
+
* the change, so another one follows as soon as it lands. */
|
|
435
|
+
readonly stale?: true;
|
|
436
|
+
/** The last full listing failed; hooks do not retry until invalidated. */
|
|
437
|
+
readonly error?: unknown;
|
|
438
|
+
};
|
|
439
|
+
/** Node caches by drive id; replaced, never mutated, so hooks see changes. */
|
|
440
|
+
type DriveNodesCache = ReadonlyMap<string, DriveNodesEntry>;
|
|
441
|
+
type DriveNodesOptions = {
|
|
442
|
+
/** Skip the cache and read through `read.drives`. */
|
|
443
|
+
refresh?: boolean;
|
|
444
|
+
store?: PHStore;
|
|
445
|
+
};
|
|
446
|
+
/** Returns the per-drive node caches */
|
|
447
|
+
declare const useDriveNodesCache: () => DriveNodesCache | undefined;
|
|
448
|
+
/** Adds an event handler for the drive node cache */
|
|
449
|
+
declare const addDriveNodesEventHandler: () => void;
|
|
450
|
+
/** Loads every node of a drive into the cache, paging through
|
|
451
|
+
* `read.drives.listNodes`; served from the cache once loaded. */
|
|
452
|
+
declare function loadDriveNodes(driveId: string, options?: DriveNodesOptions): Promise<Node[]>;
|
|
453
|
+
/** A node from the cache, else read through `read.drives.getNode`;
|
|
454
|
+
* undefined when the drive does not hold it. */
|
|
455
|
+
declare function getDriveNode(driveId: string, nodeId: string, options?: DriveNodesOptions): Promise<Node | undefined>;
|
|
456
|
+
/** A node from the cache only, without reading; for synchronous callers. */
|
|
457
|
+
declare function peekDriveNode(driveId: string, nodeId: string, store?: PHStore | undefined): Node | undefined;
|
|
458
|
+
/** Drops a drive's cached nodes; while a hook shows them, they reload and
|
|
459
|
+
* the old nodes stay visible until the new listing lands. */
|
|
460
|
+
declare function invalidateDriveNodes(driveId: string, store?: PHStore | undefined): void;
|
|
461
|
+
/**
|
|
462
|
+
* Notes that this tab wrote to a drive, so the drive change handler re-reads
|
|
463
|
+
* it on the change that follows instead of waiting out its interval: the
|
|
464
|
+
* person who added, renamed or removed a node expects to see it, while a
|
|
465
|
+
* drive being filled by someone else can wait.
|
|
466
|
+
*/
|
|
467
|
+
declare function markLocalDriveWrite(driveId: string): void;
|
|
468
|
+
/** Spends a drive's local-write mark; true when one was set. */
|
|
469
|
+
declare function takeLocalDriveWrite(driveId: string): boolean;
|
|
470
|
+
/** Takes a node out of a drive's cache after this tab removed it, so the
|
|
471
|
+
* listing drops it at once instead of after the next drive refresh. */
|
|
472
|
+
declare function dropDriveNode(driveId: string, nodeId: string, store?: PHStore | undefined): void;
|
|
473
|
+
/** Every node of a drive, loaded on first use; undefined until loaded. */
|
|
474
|
+
declare function useDriveNodes(driveId: string | null | undefined): Node[] | undefined;
|
|
475
|
+
/** One node of a drive, from the cache or read on its own. */
|
|
476
|
+
declare function useDriveNode(driveId: string | null | undefined, nodeId: string | null | undefined): Node | undefined;
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region src/types/global.d.ts
|
|
479
|
+
interface BrowserReactorModule extends InProcessReactorModule {
|
|
480
|
+
pg: PGlite;
|
|
481
|
+
}
|
|
482
|
+
interface BrowserReactorClientModule$1 extends InProcessReactorClientModule {
|
|
483
|
+
kind: "browser";
|
|
484
|
+
reactorModule: BrowserReactorModule | undefined;
|
|
485
|
+
}
|
|
486
|
+
type WorkerReactorModule = ReactorModule;
|
|
487
|
+
interface WorkerReactorClientModule$1 extends ReactorClientModule {
|
|
488
|
+
kind: "worker";
|
|
489
|
+
reactorModule: WorkerReactorModule;
|
|
490
|
+
adminClient: IWorkerAdminClient;
|
|
491
|
+
inspector: IInspectorProxy;
|
|
492
|
+
/**
|
|
493
|
+
* Loads (or, for a source already loaded, REPLACES) URL-addressed packages
|
|
494
|
+
* in the worker's registry. A vetra watch rebuild re-sends the project's
|
|
495
|
+
* models through this with a cache-busted URL. `specs` are registry packages
|
|
496
|
+
* (`name@version`), replaced when their version changes.
|
|
497
|
+
*/
|
|
498
|
+
registerPackages: (sources: WorkerPackageSource[], specs?: string[]) => Promise<void>;
|
|
499
|
+
}
|
|
500
|
+
type LOADING = null;
|
|
501
|
+
/** A drive, or a node in it. */
|
|
502
|
+
type PHDriveTarget = {
|
|
503
|
+
driveSlug: string;
|
|
504
|
+
nodeSlug?: string;
|
|
505
|
+
};
|
|
506
|
+
/** A settings tab by id; `true` opens the first one. */
|
|
507
|
+
type PHSettingsTarget$1 = {
|
|
508
|
+
settings: string | true;
|
|
509
|
+
};
|
|
510
|
+
/** What the app shows; `undefined` targets home. */
|
|
511
|
+
type PHNavigationTarget$1 = PHDriveTarget | PHSettingsTarget$1;
|
|
512
|
+
/** Query params to write; an `undefined` value removes the param. */
|
|
513
|
+
type PHSearchUpdate$1 = Record<string, string | undefined>;
|
|
514
|
+
type PHNavigateOptions$1 = {
|
|
515
|
+
replace?: boolean;
|
|
516
|
+
/** The target's own query params; the host decides which others survive. */
|
|
517
|
+
search?: PHSearchUpdate$1;
|
|
518
|
+
};
|
|
519
|
+
/** Merges an object into the current query params; a function returns them all. */
|
|
520
|
+
type SearchParamsUpdate$1 = PHSearchUpdate$1 | ((prev: Record<string, string>) => PHSearchUpdate$1);
|
|
521
|
+
type SetSearchParams$1 = (update: SearchParamsUpdate$1, options?: {
|
|
522
|
+
replace?: boolean;
|
|
523
|
+
}) => void;
|
|
524
|
+
/** Host-owned navigation and URL state; without one, the browser history is used.
|
|
525
|
+
* Set once on the store; its hooks must not change between renders. */
|
|
526
|
+
type PHNavigation$1 = {
|
|
527
|
+
location(): {
|
|
528
|
+
pathname: string;
|
|
529
|
+
search: string;
|
|
530
|
+
};
|
|
531
|
+
open(target: PHNavigationTarget$1 | undefined, options?: PHNavigateOptions$1): void;
|
|
532
|
+
/** The public href that opens `target`, base path included. */
|
|
533
|
+
hrefFor?(target: PHNavigationTarget$1 | undefined): string;
|
|
534
|
+
/** Whether `target` is what the location shows now; search params aside. */
|
|
535
|
+
useIsCurrent?(target: PHNavigationTarget$1 | undefined): boolean;
|
|
536
|
+
/** Warms what `target` shows, e.g. on hover; optional. */
|
|
537
|
+
preload?(target: PHNavigationTarget$1 | undefined): void;
|
|
538
|
+
/** Replaces the query params with what `update` returns, keeping the path. */
|
|
539
|
+
setSearch(update: (prev: Record<string, string>) => PHSearchUpdate$1, options?: {
|
|
540
|
+
replace?: boolean;
|
|
541
|
+
}): void;
|
|
542
|
+
/** The current query params. */
|
|
543
|
+
useSearchParams(): Record<string, string>;
|
|
544
|
+
/** A stable setter for the query params. */
|
|
545
|
+
useSetSearchParams(): SetSearchParams$1;
|
|
546
|
+
/** Returns to the entry from before the open document was opened, past any
|
|
547
|
+
* pushed inside it; false when this session didn't open it. */
|
|
548
|
+
closeOpened?(): boolean;
|
|
549
|
+
};
|
|
550
|
+
/** The backend (a Switchboard) refused this tab's caller. */
|
|
551
|
+
type BackendAuthState = {
|
|
552
|
+
requiresAuth: true;
|
|
553
|
+
/** The HTTP status that refused: 401 (anonymous) or 403 (known, not allowed). */
|
|
554
|
+
status: 401 | 403 | null;
|
|
555
|
+
/** The backend's name or URL, for the message. */
|
|
556
|
+
backend?: string;
|
|
557
|
+
/** When it was refused, ISO. */
|
|
558
|
+
at: string;
|
|
559
|
+
};
|
|
560
|
+
type PHGlobal$1 = PHGlobalConfig$1 & {
|
|
561
|
+
navigation?: PHNavigation$1;
|
|
562
|
+
loading?: boolean;
|
|
563
|
+
reactorClientModule?: BrowserReactorClientModule$1 | WorkerReactorClientModule$1;
|
|
564
|
+
reactorClient?: IReactorBrowserClient$1;
|
|
565
|
+
/** The client halves of `reactorClient`, set with it: reads and writes. */
|
|
566
|
+
reactor?: ReactorBrowserHalves$1;
|
|
567
|
+
/** Replaces `reactorClientModule.client` in full-client actions; Connect's router. */
|
|
568
|
+
fullReactorClient?: IReactorClient;
|
|
569
|
+
attachmentService?: IAttachmentService;
|
|
570
|
+
/** The switchboards the app reaches; see `resolveSwitchboard`. */
|
|
571
|
+
switchboards?: SwitchboardDirectory$1;
|
|
572
|
+
reactorGraphQLClient?: ReactorGraphQLClient | undefined;
|
|
573
|
+
renown?: IRenown | LOADING;
|
|
574
|
+
vetraPackageManager?: IPackageManager;
|
|
575
|
+
/** The tools the host app gives the AI agent; see `getHostAiTools`. */
|
|
576
|
+
aiTools?: () => Promise<PhAiToolDescriptor[]>;
|
|
577
|
+
drives?: DocumentDriveDocument[];
|
|
578
|
+
/**
|
|
579
|
+
* Set when the app's backend refused the caller (401/403): the UI shows a
|
|
580
|
+
* sign-in gate instead of the drives. See `hooks/backend-auth.ts`.
|
|
581
|
+
*/
|
|
582
|
+
backendAuth?: BackendAuthState;
|
|
583
|
+
/** Per-drive node caches; see `hooks/drive-nodes.ts`. */
|
|
584
|
+
driveNodes?: DriveNodesCache;
|
|
585
|
+
documentCache?: IDocumentCache;
|
|
586
|
+
selectedDriveId?: string;
|
|
587
|
+
selectedNodeId?: string;
|
|
588
|
+
draggingNode?: DraggingNode;
|
|
589
|
+
modal?: PHModal$1;
|
|
590
|
+
selectedTimelineRevision?: string | number | null;
|
|
591
|
+
selectedTimelineItem?: TimelineItem | null;
|
|
592
|
+
packageDiscoveryService?: IPackageDiscoveryService;
|
|
593
|
+
features?: Map<string, boolean>;
|
|
594
|
+
toast?: PHToastFn;
|
|
595
|
+
};
|
|
596
|
+
type PHGlobalKey$1 = keyof PHGlobal$1;
|
|
597
|
+
type PHGlobalValue = PHGlobal$1[PHGlobalKey$1];
|
|
598
|
+
type UsePHGlobalValue$1<TValue extends PHGlobalValue> = () => TValue | undefined;
|
|
599
|
+
type SetPHGlobalValue$1<TValue extends PHGlobalValue> = (value: TValue | undefined) => void;
|
|
600
|
+
type AddPHGlobalEventHandler$1 = () => void;
|
|
601
|
+
type PHGlobalEventHandlerAdders = Record<PHGlobalKey$1, AddPHGlobalEventHandler$1>;
|
|
602
|
+
type SetEvent<TKey extends PHGlobalKey$1> = CustomEvent<{ [key in TKey]: PHGlobal$1[TKey] | undefined; }>;
|
|
603
|
+
declare global {
|
|
604
|
+
interface Window {
|
|
605
|
+
ph?: PHGlobal$1;
|
|
606
|
+
}
|
|
607
|
+
interface WindowEventMap extends GraphQLClientWindowEvents {}
|
|
608
|
+
}
|
|
609
|
+
//#endregion
|
|
610
|
+
export { IPackageManager as $, loadDriveNodes as A, PHGlobalConfigKey$1 as At, createPHStore as B, FulfilledPromise as Bt, DriveNodesCache as C, PHDocumentEditorConfigHooks$1 as Ct, dropDriveNode as D, PHGlobalConfig$1 as Dt, addDriveNodesEventHandler as E, PHDrivesGlobalConfig as Et, useDriveNodes as F, PHRenownGlobalConfig as Ft, notifyPHStore as G, PromiseState as Gt, getActivePHStore as H, IDocumentTypeCache as Ht, useDriveNodesCache as I, PHSentryGlobalConfig as It, DraggingNode as J, subscribePHStore as K, PromiseWithState as Kt, PHStore as L, DocumentDispatch$2 as Lt, peekDriveNode as M, PHGlobalConfigSettersForKey as Mt, takeLocalDriveWrite as N, PHProcessorsGlobalConfig as Nt, getDriveNode as O, PHGlobalConfigHooks$1 as Ot, useDriveNode as P, PHRelationalProcessorsGlobalConfig as Pt, IPackageListerUnsubscribe as Q, PHStoreProvider as R, DocumentRefetchState as Rt, WorkerReactorModule as S, PHDocumentEditorConfig$1 as St, DriveNodesOptions as T, PHDocumentEditorConfigSetters$1 as Tt, getPHStore as U, IOperationCache as Ut, ensurePHStore as V, IDocumentCache as Vt, getPHStoreSubscribe as W, OperationsCacheEntry as Wt, useDragNode as X, addDraggingNodeEventHandler as Y, useDropNode as Z, SetEvent as _, PHAppConfig$1 as _t, LOADING as a, TimelineBarItem as at, UsePHGlobalValue$1 as b, PHAppConfigSetters$1 as bt, PHGlobalEventHandlerAdders as c, DiscoveryEvent as ct, PHNavigateOptions$1 as d, FailedInstallationReason as dt, IPackagesListener as et, PHNavigation$1 as f, IPackageDiscoveryService as ft, SearchParamsUpdate$1 as g, PHAnalyticsGlobalConfig as gt, PHSettingsTarget$1 as h, FullPHGlobalConfig as ht, BrowserReactorModule as i, PHToastType as it, markLocalDriveWrite as j, PHGlobalConfigSetters$1 as jt, invalidateDriveNodes as k, PHGlobalConfigHooksForKey as kt, PHGlobalKey$1 as l, DiscoveryEventListener as lt, PHSearchUpdate$1 as m, PHModal$1 as mt, BackendAuthState as n, PHToastFn as nt, PHDriveTarget as o, TimelineDividerItem as ot, PHNavigationTarget$1 as p, PendingInstallation as pt, usePHStore as q, RejectedPromise as qt, BrowserReactorClientModule$1 as r, PHToastOptions as rt, PHGlobal$1 as s, TimelineItem as st, AddPHGlobalEventHandler$1 as t, PackageManagerInstallResult as tt, PHGlobalValue as u, FailedInstallation as ut, SetPHGlobalValue$1 as v, PHAppConfigHooks$1 as vt, DriveNodesEntry as w, PHDocumentEditorConfigKey$1 as wt, WorkerReactorClientModule$1 as x, PHCommonGlobalConfig as xt, SetSearchParams$1 as y, PHAppConfigKey$1 as yt, bindPHStoreToWindow as z, DocumentsOfTypeEntry as zt };
|
|
611
|
+
export {};
|
|
612
|
+
//# sourceMappingURL=global-iARBhxNI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-iARBhxNI.d.ts","names":[],"sources":["../src/types/documents.ts","../src/types/config.ts","../src/types/modals.ts","../src/types/package-discovery.ts","../src/types/timeline.ts","../src/types/toast.ts","../src/types/vetra.ts","../src/hooks/node-drag-and-drop.ts","../src/hooks/ph-store.tsx","../src/hooks/drive-nodes.ts","../src/types/global.ts"],"mappings":";;;;;;;;;;;;;;;KAOY,iBAAiB,KAAK,QAAQ,KAAK,aAAa;KAEhD,iBAAiB,KAAK,QAAQ;EACxC;EACA,OAAO;;KAGG,gBAAgB,KAAK,QAAQ;EACvC;EACA;;KAGU,aAAa;EAEnB;;EAEA;EAAqB,OAAO;;EAC5B;EAAoB;;;KAGd;EACV;EACA;;UAGe;EACf,IAAI,YAAY,oBAAoB,QAAQ;EAC5C,SAAS,eAAe,oBAAoB,QAAQ;EACpD,UAAU,uBAAuB;;EAEjC,iBAAiB,aAAa;;;KAIpB;;EAEV;;EAEA,qBAAqB;;EAErB;;EAEA;;;KAIU;;EAEV;;EAEA;;EAEA;;EAEA;;;;UAKe;;EAEf,wBAAwB,cAAc,gBAAgB;;EAEtD,oBAAoB,cAAc,gBAAgB;;EAElD,wBAAwB,cAAc;;EAEtC,yBACE,cACA,eACA;;;;;;;UASa;;EAEf,mBAAmB,oBAAoB,gBAAgB;;EAEvD,eAAe,oBAAoB,eAAe;;EAElD,mBAAmB,oBAAoB;;EAEvC,qBAAq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Ae;EACf,QAAQ;EACR;EACA,uBAAuB;EACvB,0BAA0B;EAC1B,WAAW;EACX,QAAQ;;KAGE,sBAAoB;KACpB,gBAAgB,WAAS;KAEzB,mBAAiB,eAAe,uBACxC;KAGQ,mBAAiB,eAAe,kBAC1C,OAAO;KAGG;KAEA,6BAA6B,OACvC,eACA;KAGU,SAAS,aAAa,iBAAe,eAC9C,OAAO,OAAO,WAAS;QAGlB;YACI;IACR,KAAK;;YAEG,uBAAuB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as LOADING } from "./global-iARBhxNI.js";
|
|
2
2
|
import { CSSProperties, ReactNode } from "react";
|
|
3
|
-
import { CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, DOMAIN_TYPE, IRenown, ISSUER_TYPE, LoginStatus, User, VERIFIABLE_CREDENTIAL_EIP712_TYPE } from "@renown/sdk";
|
|
3
|
+
import { CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, DOMAIN_TYPE, DelegationClaims, DelegationScope, IRenown, ISSUER_TYPE, LoginStatus, User, VERIFIABLE_CREDENTIAL_EIP712_TYPE, createDelegation, decodeDelegation } from "@renown/sdk";
|
|
4
4
|
import { LoginMethod, WalletAdapterDescriptor, WalletController, WalletSession, WalletTheme } from "@renown/sdk/wallet";
|
|
5
5
|
//#region src/renown/use-renown-auth.d.ts
|
|
6
6
|
type RenownAuthStatus = LoginStatus | "loading";
|
|
@@ -29,6 +29,16 @@ interface RenownAuthAsync extends RenownAuth {
|
|
|
29
29
|
declare function useRenownAuthAsync(): RenownAuthAsync;
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/renown/session.d.ts
|
|
32
|
+
/**
|
|
33
|
+
* What a desktop shell offers a page. Its one window cannot hold a popup, and a
|
|
34
|
+
* redirect away from it leaves the app; `openExternal` hands a URL to the
|
|
35
|
+
* system browser.
|
|
36
|
+
*/
|
|
37
|
+
type DesktopShell = {
|
|
38
|
+
openExternal(url: string): void | Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
/** The shell around this window, when it offers one. */
|
|
41
|
+
declare function desktopShell(): DesktopShell | undefined;
|
|
32
42
|
declare function openRenown(documentId?: string): void;
|
|
33
43
|
declare function login(userDid: string | undefined, renown: IRenown | undefined): Promise<User | undefined>;
|
|
34
44
|
declare function logout(): Promise<void>;
|
|
@@ -266,6 +276,6 @@ declare function useRenownLoginMethods(labels?: Partial<Record<LoginMethod, stri
|
|
|
266
276
|
/** The controller of one adapter mounted by {@link RenownWalletProvider}, by its `meta.id`, typed as that adapter's own surface — e.g. `useRenownWalletAdapter<PrivyWalletController>("privy")` for headless email OTP. Rendering it activates the wallet tree (the adapter's library loads then), so call it from the sign-in screen, not the app shell. `undefined` until the adapter is mounted, or forever when no provider offers that id. */
|
|
267
277
|
declare function useRenownWalletAdapter<T extends WalletController = WalletController>(id: string): T | undefined;
|
|
268
278
|
//#endregion
|
|
269
|
-
export {
|
|
279
|
+
export { setRenown as $, DOMAIN_TYPE as A, CopyIcon as B, RenownInitialUserProvider as C, CREDENTIAL_SCHEMA_EIP712_TYPE as D, useRenownInitialUser as E, RENOWN_URL as F, RenownUserButton as G, RenownLogo as H, VERIFIABLE_CREDENTIAL_EIP712_TYPE as I, RenownLoginButton as J, RenownUserButtonMenuItem as K, initConnectCrypto as L, RENOWN_CHAIN_ID as M, RENOWN_NETWORK_ID as N, CREDENTIAL_SUBJECT_TYPE as O, RENOWN_RETURN_URL_STRIPPED_PARAMS as P, addRenownEventHandler as Q, initRenownCrypto as R, RenownInitialAuth as S, useRenownInitialAuth as T, SpinnerIcon as U, DisconnectIcon as V, UserIcon as W, RenownAuthButton as X, RenownLoginButtonProps as Y, RenownAuthButtonProps as Z, RenownSessionCookieState as _, useRenownWalletAdapter as a, desktopShell as at, RENOWN_INITIAL_ANONYMOUS as b, RenownWalletProvider as c, openRenown as ct, RenownProviderProps as d, RenownAuthResolution as dt, useDid as et, Renown as f, RenownAuthStatus as ft, RenownSessionCookieOptions as g, useRenownInit as h, decodeDelegation as i, DesktopShell as it, ISSUER_TYPE as j, CREDENTIAL_TYPES as k, RenownWalletProviderProps as l, RenownAuth as lt, RenownInitOptions as m, useRenownAuthAsync as mt, DelegationScope as n, useRenown as nt, RenownLoginMethod as o, login as ot, RenownProps as p, useRenownAuth as pt, RenownUserButtonProps as q, createDelegation as r, useUser as rt, useRenownLoginMethods as s, logout as st, DelegationClaims as t, useLoginStatus as tt, RenownProvider as u, RenownAuthAsync as ut, useRenownSessionCookie as v, RenownInitialUserProviderProps as w, RENOWN_INITIAL_UNKNOWN as x, useRenownSessionSynced as y, ChevronDownIcon as z };
|
|
270
280
|
export {};
|
|
271
|
-
//# sourceMappingURL=index-
|
|
281
|
+
//# sourceMappingURL=index-CNS_9THu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CNS_9THu.d.ts","names":[],"sources":["../src/renown/use-renown-auth.ts","../src/renown/session.ts","../src/hooks/renown.ts","../src/renown/components/RenownAuthButton.tsx","../src/renown/components/RenownLoginButton.tsx","../src/renown/components/RenownUserButton.tsx","../src/renown/components/icons.tsx","../src/renown/crypto.ts","../src/renown/constants.ts","../src/renown/initial-user.tsx","../src/renown/use-renown-session.ts","../src/renown/use-renown-init.ts","../src/renown/renown-init.tsx","../src/renown/provider.tsx","../src/renown/wallet-provider.tsx","../src/renown/login-methods.ts","../src/renown/use-renown-wallet-adapter.ts"],"mappings":";;;;;KAoBY,mBAAmB;UAEd;EACf,QAAQ;EACR,MAAM;EACN;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ,UAAU,eAAe,SAAS;EAC1C;EACA,OAAO;EACP,cAAc;EACd;;iBA+Bc,iBAAiB;KAuFrB;UAKK,wBAAwB;;EAEvC,OAAO;EACP;;iBAOc,sBAAsB;;;;;;;;KCnJ1B;EACV,aAAa,qBAAqB;;;iBA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