@powerhousedao/reactor-browser 6.2.2-dev.12 → 6.2.2-dev.13
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/README.md +178 -0
- package/dist/client-DAJGpNZH.d.ts +14 -0
- package/dist/client-DAJGpNZH.d.ts.map +1 -0
- package/dist/index-B3keszpu.d.ts +144 -0
- package/dist/index-B3keszpu.d.ts.map +1 -0
- package/dist/index-Cd5nc0QC.d.ts +705 -0
- package/dist/index-Cd5nc0QC.d.ts.map +1 -0
- package/dist/index.d.ts +13 -381
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/{inspector-proxy-CvQDDxmT.d.ts → inspector-proxy-Doocf0nD.d.ts} +1 -1
- package/dist/{inspector-proxy-CvQDDxmT.d.ts.map → inspector-proxy-Doocf0nD.d.ts.map} +1 -1
- package/dist/{index-DS4W07Y8.d.ts → pglite-CntadC_p-BgIvrYtV.d.ts} +2 -142
- package/dist/pglite-CntadC_p-BgIvrYtV.d.ts.map +1 -0
- package/dist/{renown-D-1c_Bvx.js → renown-CjoxQPCi.js} +346 -16
- package/dist/renown-CjoxQPCi.js.map +1 -0
- package/dist/src/graphql/client.d.ts +2 -1
- package/dist/src/relational/index.d.ts +1 -1
- package/dist/src/renown/index.d.ts +2 -2
- package/dist/src/renown/index.js +2 -2
- package/dist/src/rpc/index.d.ts +2 -2
- package/dist/{client-09xv0Dq6.d.ts → types-CVZRGBXo.d.ts} +2 -11
- package/dist/types-CVZRGBXo.d.ts.map +1 -0
- package/package.json +9 -9
- package/dist/client-09xv0Dq6.d.ts.map +0 -1
- package/dist/index-D3bV5rcl.d.ts +0 -216
- package/dist/index-D3bV5rcl.d.ts.map +0 -1
- package/dist/index-DS4W07Y8.d.ts.map +0 -1
- package/dist/renown-D-1c_Bvx.js.map +0 -1
|
@@ -0,0 +1,705 @@
|
|
|
1
|
+
import { t as PGlite } from "./pglite-CntadC_p-BgIvrYtV.js";
|
|
2
|
+
import { c as ReactorGraphQLClient, r as GraphQLClientWindowEvents } from "./types-CVZRGBXo.js";
|
|
3
|
+
import { r as IWorkerAdminClient, t as IInspectorProxy } from "./inspector-proxy-Doocf0nD.js";
|
|
4
|
+
import { Action, DocumentAction, DocumentModelModule, PHDocument } from "@powerhousedao/shared/document-model";
|
|
5
|
+
import { DocumentDriveDocument } from "@powerhousedao/shared/document-drive";
|
|
6
|
+
import { IDocumentModelLoader, IReactorClient, InProcessReactorClientModule, InProcessReactorModule, ReactorClientModule, ReactorModule } from "@powerhousedao/reactor";
|
|
7
|
+
import { CSSProperties, DragEventHandler, ReactNode } from "react";
|
|
8
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
9
|
+
import * as _renown_sdk0 from "@renown/sdk";
|
|
10
|
+
import { CREDENTIAL_SCHEMA_EIP712_TYPE, CREDENTIAL_SUBJECT_TYPE, CREDENTIAL_TYPES, DOMAIN_TYPE, IRenown, ISSUER_TYPE, LoginStatus, User, VERIFIABLE_CREDENTIAL_EIP712_TYPE } from "@renown/sdk";
|
|
11
|
+
import { IAttachmentService } from "@powerhousedao/reactor-attachments/client";
|
|
12
|
+
import { LoginMethod, WalletAdaptersConfig, WalletController, WalletSession, WalletTheme } from "@renown/sdk/wallet";
|
|
13
|
+
import { DocumentModelLib, RegistryPackageSource } from "@powerhousedao/shared";
|
|
14
|
+
import { PHConnectRenownAdapters } from "@powerhousedao/shared/clis";
|
|
15
|
+
|
|
16
|
+
//#region src/types/documents.d.ts
|
|
17
|
+
type DocumentDispatch<TAction extends Action> = (actionOrActions: TAction | TAction[] | DocumentAction | DocumentAction[] | undefined, onErrors?: (errors: Error[]) => void, onSuccess?: (result: PHDocument) => void) => void;
|
|
18
|
+
type PromiseWithState<T> = Promise<T> & PromiseState<T>;
|
|
19
|
+
type FulfilledPromise<T> = Promise<T> & {
|
|
20
|
+
status: "fulfilled";
|
|
21
|
+
value: T;
|
|
22
|
+
};
|
|
23
|
+
type RejectedPromise<T> = Promise<T> & {
|
|
24
|
+
status: "rejected";
|
|
25
|
+
reason: unknown;
|
|
26
|
+
};
|
|
27
|
+
type PromiseState<T> = {
|
|
28
|
+
status: "pending";
|
|
29
|
+
} | {
|
|
30
|
+
status: "fulfilled";
|
|
31
|
+
value: T;
|
|
32
|
+
} | {
|
|
33
|
+
status: "rejected";
|
|
34
|
+
reason: unknown;
|
|
35
|
+
};
|
|
36
|
+
interface IDocumentCache {
|
|
37
|
+
get(id: string, refetch?: boolean): Promise<PHDocument>;
|
|
38
|
+
getBatch(ids: string[], refetch?: boolean): Promise<PHDocument[]>;
|
|
39
|
+
subscribe(id: string | string[], callback: () => void): () => void;
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/renown/use-renown-auth.d.ts
|
|
43
|
+
type RenownAuthStatus = LoginStatus | "loading";
|
|
44
|
+
interface RenownAuth {
|
|
45
|
+
status: RenownAuthStatus | undefined;
|
|
46
|
+
user: User | undefined;
|
|
47
|
+
address: string | undefined;
|
|
48
|
+
ensName: string | undefined;
|
|
49
|
+
avatarUrl: string | undefined;
|
|
50
|
+
profileId: string | undefined;
|
|
51
|
+
displayName: string | undefined;
|
|
52
|
+
displayAddress: string | undefined;
|
|
53
|
+
login: (session?: WalletSession, method?: LoginMethod) => void;
|
|
54
|
+
pending: boolean;
|
|
55
|
+
error: Error | undefined;
|
|
56
|
+
logout: () => Promise<void>;
|
|
57
|
+
openProfile: () => void;
|
|
58
|
+
}
|
|
59
|
+
declare function useRenownAuth(): RenownAuth;
|
|
60
|
+
type RenownAuthResolution = "authenticated" | "resolving" | "unauthenticated";
|
|
61
|
+
interface RenownAuthAsync extends RenownAuth {
|
|
62
|
+
/** Collapsed routing state; "resolving" until auth is known. */
|
|
63
|
+
state: RenownAuthResolution;
|
|
64
|
+
isResolving: boolean;
|
|
65
|
+
}
|
|
66
|
+
declare function useRenownAuthAsync(): RenownAuthAsync;
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/renown/utils.d.ts
|
|
69
|
+
declare function openRenown(documentId?: string): void;
|
|
70
|
+
declare function signIn(session: WalletSession): Promise<User | undefined>;
|
|
71
|
+
declare function setActiveWalletController(controller: WalletController | undefined): void;
|
|
72
|
+
declare function failWalletActivation(error: Error): void;
|
|
73
|
+
declare function getActiveWalletController(): WalletController | undefined;
|
|
74
|
+
declare function setWalletActivator(activator: (() => Promise<WalletController>) | undefined): void;
|
|
75
|
+
declare function getWalletActivator(): (() => Promise<WalletController>) | undefined;
|
|
76
|
+
declare function whenWalletControllerReady(): Promise<WalletController>;
|
|
77
|
+
/**
|
|
78
|
+
* Log in the user. Resolves the user DID from (in order):
|
|
79
|
+
* 1. Explicit `userDid` argument
|
|
80
|
+
* 2. `?user=` URL parameter (from Renown portal redirect)
|
|
81
|
+
* 3. Previously stored session in the Renown instance
|
|
82
|
+
*/
|
|
83
|
+
declare function login(userDid: string | undefined, renown: IRenown | undefined): Promise<User | undefined>;
|
|
84
|
+
declare function logout(): Promise<void>;
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/types/config.d.ts
|
|
87
|
+
type PHGlobalConfig = PHCommonGlobalConfig & PHAppConfig & PHDocumentEditorConfig & PHDrivesGlobalConfig & PHAnalyticsGlobalConfig & PHRelationalProcessorsGlobalConfig & PHProcessorsGlobalConfig & PHRenownGlobalConfig & PHSentryGlobalConfig;
|
|
88
|
+
type PHGlobalConfigKey = keyof PHGlobalConfig;
|
|
89
|
+
type PHGlobalConfigSetters = PHGlobalConfigSettersForKey<PHGlobalConfigKey>;
|
|
90
|
+
type PHGlobalConfigHooks = PHGlobalConfigHooksForKey<PHGlobalConfigKey>;
|
|
91
|
+
/**
|
|
92
|
+
* Editor configuration settings which are globally available to your custom apps.
|
|
93
|
+
*
|
|
94
|
+
* Setting these will override the defaults when your editor is mounted.
|
|
95
|
+
*/
|
|
96
|
+
type PHAppConfig = {
|
|
97
|
+
/** Allows you to specify the document types that are allowed to be added to the drive.
|
|
98
|
+
* An empty array means that any document type is allowed.
|
|
99
|
+
*/
|
|
100
|
+
allowedDocumentTypes?: string[]; /** Whether drag and drop is enabled for the app. */
|
|
101
|
+
isDragAndDropEnabled?: boolean;
|
|
102
|
+
};
|
|
103
|
+
type PHAppConfigKey = keyof PHAppConfig;
|
|
104
|
+
type PHAppConfigSetters = PHGlobalConfigSettersForKey<PHAppConfigKey>;
|
|
105
|
+
type PHAppConfigHooks = PHGlobalConfigHooksForKey<PHAppConfigKey>;
|
|
106
|
+
type PHDocumentEditorConfig = {
|
|
107
|
+
/** Whether external controls are enabled for the document editor. */isExternalControlsEnabled?: boolean;
|
|
108
|
+
};
|
|
109
|
+
type PHDocumentEditorConfigKey = keyof PHDocumentEditorConfig;
|
|
110
|
+
type PHDocumentEditorConfigSetters = PHGlobalConfigSettersForKey<PHDocumentEditorConfigKey>;
|
|
111
|
+
type PHDocumentEditorConfigHooks = PHGlobalConfigHooksForKey<PHDocumentEditorConfigKey>;
|
|
112
|
+
type PHCommonGlobalConfig = {
|
|
113
|
+
basePath?: string;
|
|
114
|
+
routerBasename?: string;
|
|
115
|
+
version?: string;
|
|
116
|
+
requiresHardRefresh?: boolean;
|
|
117
|
+
warnOutdatedApp?: boolean;
|
|
118
|
+
studioMode?: boolean;
|
|
119
|
+
versionCheckInterval?: number;
|
|
120
|
+
cliVersion?: string;
|
|
121
|
+
fileUploadOperationsChunkSize?: number;
|
|
122
|
+
gaTrackingId?: string;
|
|
123
|
+
isDocumentModelSelectionSettingsEnabled?: boolean;
|
|
124
|
+
isAddDriveEnabled?: boolean;
|
|
125
|
+
isPublicDrivesEnabled?: boolean;
|
|
126
|
+
isAddPublicDrivesEnabled?: boolean;
|
|
127
|
+
isDeletePublicDrivesEnabled?: boolean;
|
|
128
|
+
isCloudDrivesEnabled?: boolean;
|
|
129
|
+
isAddCloudDrivesEnabled?: boolean;
|
|
130
|
+
isDeleteCloudDrivesEnabled?: boolean;
|
|
131
|
+
isLocalDrivesEnabled?: boolean;
|
|
132
|
+
isAddLocalDrivesEnabled?: boolean;
|
|
133
|
+
isDeleteLocalDrivesEnabled?: boolean;
|
|
134
|
+
allowList?: string[];
|
|
135
|
+
analyticsDatabaseName?: string;
|
|
136
|
+
logLevel?: "debug" | "info" | "warn" | "error";
|
|
137
|
+
isEditorDebugModeEnabled?: boolean;
|
|
138
|
+
isEditorReadModeEnabled?: boolean;
|
|
139
|
+
disabledEditors?: string[];
|
|
140
|
+
enabledEditors?: string[];
|
|
141
|
+
};
|
|
142
|
+
type PHDrivesGlobalConfig = {
|
|
143
|
+
defaultDrivesUrl?: string;
|
|
144
|
+
drivesPreserveStrategy?: string;
|
|
145
|
+
};
|
|
146
|
+
type PHAnalyticsGlobalConfig = {
|
|
147
|
+
isAnalyticsEnabled?: boolean;
|
|
148
|
+
isAnalyticsDatabaseWorkerEnabled?: boolean;
|
|
149
|
+
isDiffAnalyticsEnabled?: boolean;
|
|
150
|
+
isDriveAnalyticsEnabled?: boolean;
|
|
151
|
+
isAnalyticsExternalProcessorsEnabled?: boolean;
|
|
152
|
+
};
|
|
153
|
+
type PHRelationalProcessorsGlobalConfig = {
|
|
154
|
+
isRelationalProcessorsEnabled?: boolean;
|
|
155
|
+
isExternalRelationalProcessorsEnabled?: boolean;
|
|
156
|
+
};
|
|
157
|
+
type PHProcessorsGlobalConfig = {
|
|
158
|
+
isExternalProcessorsEnabled?: boolean;
|
|
159
|
+
isExternalPackagesEnabled?: boolean;
|
|
160
|
+
};
|
|
161
|
+
type PHRenownGlobalConfig = {
|
|
162
|
+
renownUrl?: string;
|
|
163
|
+
renownNetworkId?: string;
|
|
164
|
+
renownChainId?: number;
|
|
165
|
+
switchboardUrl?: string;
|
|
166
|
+
renownAdapters?: PHConnectRenownAdapters;
|
|
167
|
+
};
|
|
168
|
+
type PHSentryGlobalConfig = {
|
|
169
|
+
sentryRelease?: string;
|
|
170
|
+
sentryDsn?: string;
|
|
171
|
+
sentryEnv?: string;
|
|
172
|
+
isSentryTracingEnabled?: boolean;
|
|
173
|
+
};
|
|
174
|
+
type PHGlobalConfigSettersForKey<T extends PHGlobalConfigKey> = { [K in T]: (value: PHGlobalConfig[K]) => void };
|
|
175
|
+
type PHGlobalConfigHooksForKey<TKey extends PHGlobalConfigKey> = { [K in TKey]: () => PHGlobalConfig[K] };
|
|
176
|
+
/** Helper type for ensuring keys are all present while still allowing them to be set */
|
|
177
|
+
type FullPHGlobalConfig = Record<PHGlobalConfigKey, PHGlobalConfig[PHGlobalConfigKey]>;
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/types/modals.d.ts
|
|
180
|
+
type PHModal = {
|
|
181
|
+
type: "createDocument";
|
|
182
|
+
documentType: string;
|
|
183
|
+
} | {
|
|
184
|
+
type: "deleteItem";
|
|
185
|
+
id: string;
|
|
186
|
+
} | {
|
|
187
|
+
type: "addDrive";
|
|
188
|
+
} | {
|
|
189
|
+
type: "upgradeDrive";
|
|
190
|
+
driveId: string;
|
|
191
|
+
} | {
|
|
192
|
+
type: "deleteDrive";
|
|
193
|
+
driveId: string;
|
|
194
|
+
} | {
|
|
195
|
+
type: "driveSettings";
|
|
196
|
+
driveId: string;
|
|
197
|
+
} | {
|
|
198
|
+
type: "settings";
|
|
199
|
+
} | {
|
|
200
|
+
type: "clearStorage";
|
|
201
|
+
} | {
|
|
202
|
+
type: "debugSettings";
|
|
203
|
+
} | {
|
|
204
|
+
type: "disclaimer";
|
|
205
|
+
} | {
|
|
206
|
+
type: "cookiesPolicy";
|
|
207
|
+
} | {
|
|
208
|
+
type: "downloadDocumentWithErrors";
|
|
209
|
+
documentId: string;
|
|
210
|
+
} | {
|
|
211
|
+
type: "inspector";
|
|
212
|
+
} | {
|
|
213
|
+
type: "missingPackage";
|
|
214
|
+
documentType: string;
|
|
215
|
+
} | {
|
|
216
|
+
type: "driveAuthRequired";
|
|
217
|
+
} | {
|
|
218
|
+
type: "openFileDocuments";
|
|
219
|
+
} | {
|
|
220
|
+
type: "login";
|
|
221
|
+
};
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/types/package-discovery.d.ts
|
|
224
|
+
type PendingInstallation = {
|
|
225
|
+
documentType: string;
|
|
226
|
+
packageNames: string[];
|
|
227
|
+
};
|
|
228
|
+
type FailedInstallationReason = "no-registry" | "not-in-registry" | "registry-error" | "install-failed" | "dismissed" | "offline";
|
|
229
|
+
type FailedInstallation = {
|
|
230
|
+
documentType: string;
|
|
231
|
+
reason: FailedInstallationReason;
|
|
232
|
+
packageNames: string[];
|
|
233
|
+
error: Error | null;
|
|
234
|
+
};
|
|
235
|
+
type DiscoveryEvent = {
|
|
236
|
+
type: "type-discovered";
|
|
237
|
+
documentType: string;
|
|
238
|
+
packageNames: string[];
|
|
239
|
+
} | {
|
|
240
|
+
type: "installation-prompted";
|
|
241
|
+
documentType: string;
|
|
242
|
+
packageNames: string[];
|
|
243
|
+
} | {
|
|
244
|
+
type: "installation-approved";
|
|
245
|
+
packageName: string;
|
|
246
|
+
documentTypes: string[];
|
|
247
|
+
} | {
|
|
248
|
+
type: "installation-dismissed";
|
|
249
|
+
packageName: string;
|
|
250
|
+
documentTypes: string[];
|
|
251
|
+
} | {
|
|
252
|
+
type: "installation-failed";
|
|
253
|
+
packageName: string;
|
|
254
|
+
error: Error;
|
|
255
|
+
} | {
|
|
256
|
+
type: "registry-query-failed";
|
|
257
|
+
documentType: string;
|
|
258
|
+
error: Error;
|
|
259
|
+
} | {
|
|
260
|
+
type: "load-failed";
|
|
261
|
+
documentType: string;
|
|
262
|
+
reason: FailedInstallationReason;
|
|
263
|
+
};
|
|
264
|
+
type DiscoveryEventListener = (event: DiscoveryEvent) => void;
|
|
265
|
+
interface IPackageDiscoveryService {
|
|
266
|
+
load(documentType: string): Promise<DocumentModelModule<any>>;
|
|
267
|
+
getPendingInstallations(): PendingInstallation[];
|
|
268
|
+
subscribePending(listener: () => void): () => void;
|
|
269
|
+
getFailedInstallations(): FailedInstallation[];
|
|
270
|
+
subscribeFailed(listener: () => void): () => void;
|
|
271
|
+
subscribeEvents(listener: DiscoveryEventListener): () => void;
|
|
272
|
+
approveInstallation(packageName: string): Promise<void>;
|
|
273
|
+
dismissInstallation(packageName: string): void;
|
|
274
|
+
promptInstallation(documentType: string): void;
|
|
275
|
+
retryInstallation(documentType: string): Promise<void>;
|
|
276
|
+
}
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region src/types/timeline.d.ts
|
|
279
|
+
type TimelineBarItem = {
|
|
280
|
+
id: string;
|
|
281
|
+
type: "bar";
|
|
282
|
+
addSize?: 0 | 1 | 2 | 3 | 4;
|
|
283
|
+
delSize?: 0 | 1 | 2 | 3 | 4;
|
|
284
|
+
timestampUtcMs?: string;
|
|
285
|
+
additions?: number;
|
|
286
|
+
deletions?: number;
|
|
287
|
+
revision?: number;
|
|
288
|
+
startDate?: Date;
|
|
289
|
+
endDate?: Date;
|
|
290
|
+
};
|
|
291
|
+
type TimelineDividerItem = {
|
|
292
|
+
id: string;
|
|
293
|
+
type: "divider";
|
|
294
|
+
timestampUtcMs?: string;
|
|
295
|
+
title?: string;
|
|
296
|
+
subtitle?: string;
|
|
297
|
+
revision?: number;
|
|
298
|
+
startDate?: Date;
|
|
299
|
+
endDate?: Date;
|
|
300
|
+
};
|
|
301
|
+
type TimelineItem = TimelineBarItem | TimelineDividerItem;
|
|
302
|
+
//#endregion
|
|
303
|
+
//#region src/types/toast.d.ts
|
|
304
|
+
type PHToastType = "default" | "success" | "error" | "warning" | "info" | "connect-success" | "connect-warning" | "connect-loading" | "connect-deleted";
|
|
305
|
+
type PHToastOptions = {
|
|
306
|
+
type?: PHToastType;
|
|
307
|
+
autoClose?: number | false;
|
|
308
|
+
containerId?: string;
|
|
309
|
+
};
|
|
310
|
+
type PHToastFn = (content: ReactNode | string, options?: PHToastOptions) => void;
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region src/types/vetra.d.ts
|
|
313
|
+
type IPackagesListener = (data: {
|
|
314
|
+
packages: DocumentModelLib[];
|
|
315
|
+
}) => void;
|
|
316
|
+
type IPackageListerUnsubscribe = () => void;
|
|
317
|
+
type PackageManagerInstallResult = {
|
|
318
|
+
type: "success";
|
|
319
|
+
package: DocumentModelLib;
|
|
320
|
+
} | {
|
|
321
|
+
type: "error";
|
|
322
|
+
error: Error;
|
|
323
|
+
};
|
|
324
|
+
interface IPackageManager extends IDocumentModelLoader {
|
|
325
|
+
registryUrl: string | null;
|
|
326
|
+
packages: DocumentModelLib[];
|
|
327
|
+
addPackage(packageName: string): Promise<PackageManagerInstallResult> | PackageManagerInstallResult;
|
|
328
|
+
addPackages(packageNames: string[]): Promise<PackageManagerInstallResult[]> | PackageManagerInstallResult[];
|
|
329
|
+
removePackage(name: string): void;
|
|
330
|
+
updateLocalPackage(pkg: DocumentModelLib, version?: string): void;
|
|
331
|
+
subscribe(handler: IPackagesListener): IPackageListerUnsubscribe;
|
|
332
|
+
getPackageSource: (packageName: string) => RegistryPackageSource | null;
|
|
333
|
+
getPackageVersion: (packageName: string) => string | undefined;
|
|
334
|
+
/**
|
|
335
|
+
* Registry-installed packages keyed by their storage name (the registry
|
|
336
|
+
* spec, e.g. "@powerhousedao/clint-common"). Used by callers that need to
|
|
337
|
+
* diff against an external source of truth such as the publish-reload
|
|
338
|
+
* channel's `/__packages` SSE feed.
|
|
339
|
+
*/
|
|
340
|
+
getRegistryPackages: () => {
|
|
341
|
+
name: string;
|
|
342
|
+
version: string | undefined;
|
|
343
|
+
}[];
|
|
344
|
+
addLocalPackage: (name: string, loadedPackage: DocumentModelLib, version?: string) => void;
|
|
345
|
+
}
|
|
346
|
+
//#endregion
|
|
347
|
+
//#region src/hooks/node-drag-and-drop.d.ts
|
|
348
|
+
type DraggingNode = {
|
|
349
|
+
srcId: string;
|
|
350
|
+
parentId: string | null | undefined;
|
|
351
|
+
};
|
|
352
|
+
declare const addDraggingNodeEventHandler: () => void;
|
|
353
|
+
declare function useDragNode(args: {
|
|
354
|
+
srcId: string | undefined;
|
|
355
|
+
parentId: string | null | undefined;
|
|
356
|
+
}): {
|
|
357
|
+
isDragging: boolean;
|
|
358
|
+
draggable: boolean;
|
|
359
|
+
onDragStart: DragEventHandler;
|
|
360
|
+
onDragEnd: DragEventHandler;
|
|
361
|
+
};
|
|
362
|
+
declare function useDropNode(targetId: string | undefined): {
|
|
363
|
+
isDropTarget: boolean;
|
|
364
|
+
onDragEnter: DragEventHandler;
|
|
365
|
+
onDragOver: DragEventHandler;
|
|
366
|
+
onDragLeave: DragEventHandler;
|
|
367
|
+
onDrop: DragEventHandler;
|
|
368
|
+
};
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region src/types/global.d.ts
|
|
371
|
+
interface BrowserReactorModule extends InProcessReactorModule {
|
|
372
|
+
pg: PGlite;
|
|
373
|
+
}
|
|
374
|
+
interface BrowserReactorClientModule extends InProcessReactorClientModule {
|
|
375
|
+
kind: "browser";
|
|
376
|
+
reactorModule: BrowserReactorModule | undefined;
|
|
377
|
+
}
|
|
378
|
+
type WorkerReactorModule = ReactorModule;
|
|
379
|
+
interface WorkerReactorClientModule extends ReactorClientModule {
|
|
380
|
+
kind: "worker";
|
|
381
|
+
reactorModule: WorkerReactorModule;
|
|
382
|
+
adminClient: IWorkerAdminClient;
|
|
383
|
+
inspector: IInspectorProxy;
|
|
384
|
+
}
|
|
385
|
+
type LOADING = null;
|
|
386
|
+
type PHGlobal = PHGlobalConfig & {
|
|
387
|
+
loading?: boolean;
|
|
388
|
+
reactorClientModule?: BrowserReactorClientModule | WorkerReactorClientModule;
|
|
389
|
+
reactorClient?: IReactorClient;
|
|
390
|
+
attachmentService?: IAttachmentService;
|
|
391
|
+
reactorGraphQLClient?: ReactorGraphQLClient | undefined;
|
|
392
|
+
renown?: IRenown | LOADING;
|
|
393
|
+
vetraPackageManager?: IPackageManager;
|
|
394
|
+
drives?: DocumentDriveDocument[];
|
|
395
|
+
documentCache?: IDocumentCache;
|
|
396
|
+
selectedDriveId?: string;
|
|
397
|
+
selectedNodeId?: string;
|
|
398
|
+
draggingNode?: DraggingNode;
|
|
399
|
+
modal?: PHModal;
|
|
400
|
+
selectedTimelineRevision?: string | number | null;
|
|
401
|
+
revisionHistoryVisible?: boolean;
|
|
402
|
+
selectedTimelineItem?: TimelineItem | null;
|
|
403
|
+
packageDiscoveryService?: IPackageDiscoveryService;
|
|
404
|
+
features?: Map<string, boolean>;
|
|
405
|
+
toast?: PHToastFn;
|
|
406
|
+
};
|
|
407
|
+
type PHGlobalKey = keyof PHGlobal;
|
|
408
|
+
type PHGlobalValue = PHGlobal[PHGlobalKey];
|
|
409
|
+
type UsePHGlobalValue<TValue extends PHGlobalValue> = () => TValue | undefined;
|
|
410
|
+
type SetPHGlobalValue<TValue extends PHGlobalValue> = (value: TValue | undefined) => void;
|
|
411
|
+
type AddPHGlobalEventHandler = () => void;
|
|
412
|
+
type PHGlobalEventHandlerAdders = Record<PHGlobalKey, AddPHGlobalEventHandler>;
|
|
413
|
+
type SetEvent<TKey extends PHGlobalKey> = CustomEvent<{ [key in TKey]: PHGlobal[TKey] | undefined }>;
|
|
414
|
+
declare global {
|
|
415
|
+
interface Window {
|
|
416
|
+
ph?: PHGlobal;
|
|
417
|
+
}
|
|
418
|
+
interface WindowEventMap extends GraphQLClientWindowEvents {}
|
|
419
|
+
} //# sourceMappingURL=global.d.ts.map
|
|
420
|
+
//#endregion
|
|
421
|
+
//#region src/hooks/renown.d.ts
|
|
422
|
+
/** Adds an event handler for the renown instance */
|
|
423
|
+
declare const addRenownEventHandler: () => void;
|
|
424
|
+
/** Returns the renown instance */
|
|
425
|
+
declare const useRenown: () => IRenown | LOADING | undefined;
|
|
426
|
+
/** Sets the renown instance */
|
|
427
|
+
declare const setRenown: (value: IRenown | LOADING | undefined) => void;
|
|
428
|
+
/** Returns the DID from the renown instance */
|
|
429
|
+
declare function useDid(): string | undefined;
|
|
430
|
+
/** Returns the current user from the renown instance, subscribing to user events */
|
|
431
|
+
declare function useUser(): User | undefined;
|
|
432
|
+
/** Returns the login status, subscribing to renown status events */
|
|
433
|
+
declare function useLoginStatus(): LoginStatus | "loading" | undefined;
|
|
434
|
+
//#endregion
|
|
435
|
+
//#region src/renown/components/RenownAuthButton.d.ts
|
|
436
|
+
interface RenownAuthButtonProps {
|
|
437
|
+
className?: string;
|
|
438
|
+
darkMode?: boolean;
|
|
439
|
+
loginContent?: ReactNode;
|
|
440
|
+
userContent?: ReactNode;
|
|
441
|
+
loadingContent?: ReactNode;
|
|
442
|
+
children?: (auth: RenownAuth) => ReactNode;
|
|
443
|
+
}
|
|
444
|
+
declare function RenownAuthButton({
|
|
445
|
+
className,
|
|
446
|
+
darkMode,
|
|
447
|
+
loginContent,
|
|
448
|
+
userContent,
|
|
449
|
+
loadingContent,
|
|
450
|
+
children
|
|
451
|
+
}: RenownAuthButtonProps): react_jsx_runtime0.JSX.Element;
|
|
452
|
+
//#endregion
|
|
453
|
+
//#region src/renown/components/RenownLoginButton.d.ts
|
|
454
|
+
interface RenownLoginButtonProps {
|
|
455
|
+
onLogin?: () => void;
|
|
456
|
+
darkMode?: boolean;
|
|
457
|
+
style?: CSSProperties;
|
|
458
|
+
className?: string;
|
|
459
|
+
asChild?: boolean;
|
|
460
|
+
children?: ReactNode;
|
|
461
|
+
}
|
|
462
|
+
declare function RenownLoginButton({
|
|
463
|
+
onLogin: onLoginProp,
|
|
464
|
+
style,
|
|
465
|
+
className,
|
|
466
|
+
asChild,
|
|
467
|
+
children
|
|
468
|
+
}: RenownLoginButtonProps): react_jsx_runtime0.JSX.Element;
|
|
469
|
+
//#endregion
|
|
470
|
+
//#region src/renown/components/RenownUserButton.d.ts
|
|
471
|
+
interface RenownUserButtonMenuItem {
|
|
472
|
+
label: string;
|
|
473
|
+
icon?: ReactNode;
|
|
474
|
+
onClick: () => void;
|
|
475
|
+
style?: CSSProperties;
|
|
476
|
+
}
|
|
477
|
+
interface RenownUserButtonProps {
|
|
478
|
+
address?: string;
|
|
479
|
+
username?: string;
|
|
480
|
+
avatarUrl?: string;
|
|
481
|
+
userId?: string;
|
|
482
|
+
onDisconnect?: () => void;
|
|
483
|
+
style?: CSSProperties;
|
|
484
|
+
className?: string;
|
|
485
|
+
asChild?: boolean;
|
|
486
|
+
children?: ReactNode;
|
|
487
|
+
menuItems?: RenownUserButtonMenuItem[];
|
|
488
|
+
}
|
|
489
|
+
declare function RenownUserButton({
|
|
490
|
+
address: addressProp,
|
|
491
|
+
username: usernameProp,
|
|
492
|
+
avatarUrl: avatarUrlProp,
|
|
493
|
+
userId: userIdProp,
|
|
494
|
+
onDisconnect: onDisconnectProp,
|
|
495
|
+
style,
|
|
496
|
+
className,
|
|
497
|
+
asChild,
|
|
498
|
+
children,
|
|
499
|
+
menuItems
|
|
500
|
+
}: RenownUserButtonProps): react_jsx_runtime0.JSX.Element;
|
|
501
|
+
//#endregion
|
|
502
|
+
//#region src/renown/components/icons.d.ts
|
|
503
|
+
interface IconProps {
|
|
504
|
+
size?: number;
|
|
505
|
+
width?: number;
|
|
506
|
+
height?: number;
|
|
507
|
+
color?: string;
|
|
508
|
+
style?: CSSProperties;
|
|
509
|
+
className?: string;
|
|
510
|
+
}
|
|
511
|
+
interface RenownLogoProps extends IconProps {
|
|
512
|
+
hovered?: boolean;
|
|
513
|
+
}
|
|
514
|
+
declare function RenownLogo({
|
|
515
|
+
width,
|
|
516
|
+
height,
|
|
517
|
+
hovered,
|
|
518
|
+
color,
|
|
519
|
+
className
|
|
520
|
+
}: RenownLogoProps): react_jsx_runtime0.JSX.Element;
|
|
521
|
+
declare function CopyIcon({
|
|
522
|
+
size,
|
|
523
|
+
color
|
|
524
|
+
}: IconProps): react_jsx_runtime0.JSX.Element;
|
|
525
|
+
declare function DisconnectIcon({
|
|
526
|
+
size,
|
|
527
|
+
color
|
|
528
|
+
}: IconProps): react_jsx_runtime0.JSX.Element;
|
|
529
|
+
declare function SpinnerIcon({
|
|
530
|
+
size,
|
|
531
|
+
color
|
|
532
|
+
}: IconProps): react_jsx_runtime0.JSX.Element;
|
|
533
|
+
declare function ChevronDownIcon({
|
|
534
|
+
size,
|
|
535
|
+
color,
|
|
536
|
+
style
|
|
537
|
+
}: IconProps): react_jsx_runtime0.JSX.Element;
|
|
538
|
+
declare function UserIcon({
|
|
539
|
+
size,
|
|
540
|
+
color
|
|
541
|
+
}: IconProps): react_jsx_runtime0.JSX.Element;
|
|
542
|
+
//#endregion
|
|
543
|
+
//#region src/renown/crypto.d.ts
|
|
544
|
+
/**
|
|
545
|
+
* @deprecated Use {@link initRenownCrypto} instead
|
|
546
|
+
*
|
|
547
|
+
* Initialize ConnectCrypto
|
|
548
|
+
* @returns ConnectCrypto instance
|
|
549
|
+
*/
|
|
550
|
+
declare function initConnectCrypto(): Promise<_renown_sdk0.RenownCrypto>;
|
|
551
|
+
/**
|
|
552
|
+
* Initialize RenownCrypto
|
|
553
|
+
* @returns RenownCrypto instance
|
|
554
|
+
*/
|
|
555
|
+
declare function initRenownCrypto(): Promise<_renown_sdk0.RenownCrypto>;
|
|
556
|
+
//#endregion
|
|
557
|
+
//#region src/renown/constants.d.ts
|
|
558
|
+
declare const RENOWN_URL = "https://www.renown.id";
|
|
559
|
+
declare const RENOWN_NETWORK_ID = "eip155";
|
|
560
|
+
declare const RENOWN_CHAIN_ID = "1";
|
|
561
|
+
//#endregion
|
|
562
|
+
//#region src/renown/initial-user.d.ts
|
|
563
|
+
interface RenownInitialUserProviderProps {
|
|
564
|
+
/** User resolved from a verified session cookie (see `verifyRenownSession`). */
|
|
565
|
+
initialUser?: User;
|
|
566
|
+
children: ReactNode;
|
|
567
|
+
}
|
|
568
|
+
declare function RenownInitialUserProvider({
|
|
569
|
+
initialUser,
|
|
570
|
+
children
|
|
571
|
+
}: RenownInitialUserProviderProps): react_jsx_runtime0.JSX.Element;
|
|
572
|
+
declare function useRenownInitialUser(): User | undefined;
|
|
573
|
+
//#endregion
|
|
574
|
+
//#region src/renown/use-renown-session-cookie.d.ts
|
|
575
|
+
interface RenownSessionCookieOptions {
|
|
576
|
+
/** Route handler that sets (POST) / clears (DELETE) the session cookie. */
|
|
577
|
+
endpoint?: string;
|
|
578
|
+
/** Bearer-token lifetime in seconds (default 7 days). */
|
|
579
|
+
expiresIn?: number;
|
|
580
|
+
/** When false the hook is inert (client-only apps with no server cookie). */
|
|
581
|
+
enabled?: boolean;
|
|
582
|
+
}
|
|
583
|
+
interface RenownSessionCookieState {
|
|
584
|
+
/** True once the cookie reflects the current authenticated user. */
|
|
585
|
+
synced: boolean;
|
|
586
|
+
}
|
|
587
|
+
declare function useRenownSessionCookie(options?: RenownSessionCookieOptions): RenownSessionCookieState;
|
|
588
|
+
declare function useRenownSessionSynced(): boolean;
|
|
589
|
+
//#endregion
|
|
590
|
+
//#region src/renown/use-renown-init.d.ts
|
|
591
|
+
interface RenownInitOptions {
|
|
592
|
+
appName: string;
|
|
593
|
+
/** Prefix for localStorage keys, so multiple apps can share a domain. */
|
|
594
|
+
namespace?: string;
|
|
595
|
+
url?: string;
|
|
596
|
+
switchboardUrl?: string;
|
|
597
|
+
/** Re-check the restored credential against the source (default "always"). */
|
|
598
|
+
revalidate?: "always" | "never";
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Hook that initializes the Renown SDK.
|
|
602
|
+
* Call once at the top of your app. Options are read only on first mount.
|
|
603
|
+
* Returns a promise that resolves with the Renown instance.
|
|
604
|
+
*
|
|
605
|
+
* @example
|
|
606
|
+
* ```tsx
|
|
607
|
+
* function App() {
|
|
608
|
+
* const renownPromise = useRenownInit({ appName: "my-app" });
|
|
609
|
+
* return <MyApp />;
|
|
610
|
+
* }
|
|
611
|
+
* ```
|
|
612
|
+
*/
|
|
613
|
+
declare function useRenownInit({
|
|
614
|
+
appName,
|
|
615
|
+
namespace,
|
|
616
|
+
url,
|
|
617
|
+
switchboardUrl,
|
|
618
|
+
revalidate
|
|
619
|
+
}: RenownInitOptions): Promise<IRenown>;
|
|
620
|
+
//#endregion
|
|
621
|
+
//#region src/renown/renown-init.d.ts
|
|
622
|
+
interface RenownProps extends RenownInitOptions {
|
|
623
|
+
onError?: (error: unknown) => void;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Side-effect component that initializes the Renown SDK.
|
|
627
|
+
* Renders nothing — place it alongside your app tree.
|
|
628
|
+
*
|
|
629
|
+
* @example
|
|
630
|
+
* ```tsx
|
|
631
|
+
* function App() {
|
|
632
|
+
* return (
|
|
633
|
+
* <>
|
|
634
|
+
* <Renown appName="my-app" onError={console.error} />
|
|
635
|
+
* <MyApp />
|
|
636
|
+
* </>
|
|
637
|
+
* );
|
|
638
|
+
* }
|
|
639
|
+
* ```
|
|
640
|
+
*/
|
|
641
|
+
declare function Renown({
|
|
642
|
+
onError,
|
|
643
|
+
...initOptions
|
|
644
|
+
}: RenownProps): null;
|
|
645
|
+
//#endregion
|
|
646
|
+
//#region src/renown/provider.d.ts
|
|
647
|
+
interface RenownProviderProps {
|
|
648
|
+
appName: string;
|
|
649
|
+
/** Prefix for localStorage keys, so multiple apps can share a domain. */
|
|
650
|
+
namespace?: string;
|
|
651
|
+
url?: string;
|
|
652
|
+
switchboardUrl?: string;
|
|
653
|
+
/** Wallet adapters for in-page sign-in; omit for redirect-only. */
|
|
654
|
+
adapters?: WalletAdaptersConfig;
|
|
655
|
+
theme?: WalletTheme;
|
|
656
|
+
/** Re-check the restored credential against the source (default "always"). */
|
|
657
|
+
revalidate?: "always" | "never";
|
|
658
|
+
/** Server-resolved session (SSR); its presence seeds from the cookie + enables cookie sync. Omit for client-only (seed = localStorage). */
|
|
659
|
+
session?: {
|
|
660
|
+
user?: User;
|
|
661
|
+
} | null;
|
|
662
|
+
/** Endpoint for the session-cookie sync (SSR). Default /api/renown/session. */
|
|
663
|
+
sessionEndpoint?: string;
|
|
664
|
+
onError?: (error: unknown) => void;
|
|
665
|
+
children: ReactNode;
|
|
666
|
+
}
|
|
667
|
+
declare function RenownProvider({
|
|
668
|
+
appName,
|
|
669
|
+
namespace,
|
|
670
|
+
url,
|
|
671
|
+
switchboardUrl,
|
|
672
|
+
adapters,
|
|
673
|
+
theme,
|
|
674
|
+
revalidate,
|
|
675
|
+
session,
|
|
676
|
+
sessionEndpoint,
|
|
677
|
+
onError,
|
|
678
|
+
children
|
|
679
|
+
}: RenownProviderProps): react_jsx_runtime0.JSX.Element;
|
|
680
|
+
//#endregion
|
|
681
|
+
//#region src/renown/wallet-provider.d.ts
|
|
682
|
+
interface RenownWalletProviderProps {
|
|
683
|
+
/** Per-adapter wallet config (e.g. `connect.renown.adapters`); a key's presence enables that adapter. Libraries load lazily on first login; `undefined`/empty = redirect-only. */
|
|
684
|
+
adapters: WalletAdaptersConfig | undefined;
|
|
685
|
+
/** Theme handed to each adapter UI: `"light"`, `"dark"`, or `{ mode, accentColor?, accentColorForeground? }`. */
|
|
686
|
+
theme?: WalletTheme;
|
|
687
|
+
children: ReactNode;
|
|
688
|
+
}
|
|
689
|
+
/** Drop-in provider for Renown in-page wallet sign-in: registers the login activator, lazy-mounts the configured adapters on first click, and merges their controllers for {@link useRenownAuth}. Full walkthrough + examples: the `@powerhousedao/reactor-browser` README ("Renown in-page sign-in") and the Academy Renown authentication guide. Pair with {@link useRenownLoginMethods} to build the login UI. */
|
|
690
|
+
declare function RenownWalletProvider({
|
|
691
|
+
adapters: adaptersConfig,
|
|
692
|
+
theme,
|
|
693
|
+
children
|
|
694
|
+
}: RenownWalletProviderProps): react_jsx_runtime0.JSX.Element;
|
|
695
|
+
//#endregion
|
|
696
|
+
//#region src/renown/login-methods.d.ts
|
|
697
|
+
interface RenownLoginMethod {
|
|
698
|
+
id: LoginMethod;
|
|
699
|
+
label: string;
|
|
700
|
+
}
|
|
701
|
+
/** Derive the offered login methods (wallet + Privy's methods) from an adapters config, for building a login UI. Reads config only — no wallet libraries load. Wire each to `useRenownAuth().login(undefined, id)`. Labels are overridable. See the reactor-browser README + Academy Renown auth guide. */
|
|
702
|
+
declare function useRenownLoginMethods(adapters: WalletAdaptersConfig | undefined, labels?: Partial<Record<LoginMethod, string>>): RenownLoginMethod[];
|
|
703
|
+
//#endregion
|
|
704
|
+
export { PHGlobalEventHandlerAdders as $, login as $t, CopyIcon as A, PHAppConfig as At, RenownAuthButton as B, PHGlobalConfig as Bt, RENOWN_CHAIN_ID as C, FailedInstallation as Ct, initConnectCrypto as D, PHModal as Dt, VERIFIABLE_CREDENTIAL_EIP712_TYPE as E, PendingInstallation as Et, RenownUserButton as F, PHDocumentEditorConfig as Ft, useLoginStatus as G, PHGlobalConfigSettersForKey as Gt, addRenownEventHandler as H, PHGlobalConfigHooksForKey as Ht, RenownUserButtonMenuItem as I, PHDocumentEditorConfigHooks as It, AddPHGlobalEventHandler as J, PHRenownGlobalConfig as Jt, useRenown as K, PHProcessorsGlobalConfig as Kt, RenownUserButtonProps as L, PHDocumentEditorConfigKey as Lt, RenownLogo as M, PHAppConfigKey as Mt, SpinnerIcon as N, PHAppConfigSetters as Nt, initRenownCrypto as O, FullPHGlobalConfig as Ot, UserIcon as P, PHCommonGlobalConfig as Pt, PHGlobal as Q, getWalletActivator as Qt, RenownLoginButton as R, PHDocumentEditorConfigSetters as Rt, ISSUER_TYPE as S, DiscoveryEventListener as St, RENOWN_URL as T, IPackageDiscoveryService as Tt, setRenown as U, PHGlobalConfigKey as Ut, RenownAuthButtonProps as V, PHGlobalConfigHooks as Vt, useDid as W, PHGlobalConfigSetters as Wt, BrowserReactorModule as X, failWalletActivation as Xt, BrowserReactorClientModule as Y, PHSentryGlobalConfig as Yt, LOADING as Z, getActiveWalletController as Zt, useRenownInitialUser as _, RejectedPromise as _n, PHToastType as _t, RenownProvider as a, whenWalletControllerReady as an, WorkerReactorClientModule as at, CREDENTIAL_TYPES as b, TimelineItem as bt, RenownProps as c, RenownAuthResolution as cn, addDraggingNodeEventHandler as ct, RenownSessionCookieOptions as d, useRenownAuthAsync as dn, IPackageListerUnsubscribe as dt, logout as en, PHGlobalKey as et, RenownSessionCookieState as f, DocumentDispatch as fn, IPackageManager as ft, RenownInitialUserProviderProps as g, PromiseWithState as gn, PHToastOptions as gt, RenownInitialUserProvider as h, PromiseState as hn, PHToastFn as ht, RenownWalletProviderProps as i, signIn as in, UsePHGlobalValue as it, DisconnectIcon as j, PHAppConfigHooks as jt, ChevronDownIcon as k, PHAnalyticsGlobalConfig as kt, RenownInitOptions as l, RenownAuthStatus as ln, useDragNode as lt, useRenownSessionSynced as m, IDocumentCache as mn, PackageManagerInstallResult as mt, useRenownLoginMethods as n, setActiveWalletController as nn, SetEvent as nt, RenownProviderProps as o, RenownAuth as on, WorkerReactorModule as ot, useRenownSessionCookie as p, FulfilledPromise as pn, IPackagesListener as pt, useUser as q, PHRelationalProcessorsGlobalConfig as qt, RenownWalletProvider as r, setWalletActivator as rn, SetPHGlobalValue as rt, Renown as s, RenownAuthAsync as sn, DraggingNode as st, RenownLoginMethod as t, openRenown as tn, PHGlobalValue as tt, useRenownInit as u, useRenownAuth as un, useDropNode as ut, CREDENTIAL_SCHEMA_EIP712_TYPE as v, TimelineBarItem as vt, RENOWN_NETWORK_ID as w, FailedInstallationReason as wt, DOMAIN_TYPE as x, DiscoveryEvent as xt, CREDENTIAL_SUBJECT_TYPE as y, TimelineDividerItem as yt, RenownLoginButtonProps as z, PHDrivesGlobalConfig as zt };
|
|
705
|
+
//# sourceMappingURL=index-Cd5nc0QC.d.ts.map
|