@calimero-network/mero-react 9.11.5 → 9.13.0
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/index.cjs +25 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +67 -5
- package/dist/index.d.ts +67 -5
- package/dist/index.js +24 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -224,6 +224,40 @@ interface MeroCapabilities {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
declare const MeroContext: React__default.Context<MeroContextValue | null>;
|
|
227
|
+
/**
|
|
228
|
+
* Permission grants requested for the client token at login.
|
|
229
|
+
*
|
|
230
|
+
* Cores since 0.11.0-rc.9 default-deny admin-api routes the token holds no
|
|
231
|
+
* scope for; cores >=0.11.0-rc.11 map the governance/blob/alias routes to the
|
|
232
|
+
* client-grantable `namespace` / `group` / `blob` / `context:alias`
|
|
233
|
+
* permissions, so app tokens must request them here or every workspace,
|
|
234
|
+
* group, blob and context-alias call 403s.
|
|
235
|
+
*
|
|
236
|
+
* `context:list` is included even in single-context mode because every app
|
|
237
|
+
* calls GET /admin-api/contexts/:id/identities-owned right after login, which
|
|
238
|
+
* maps to a `context:list` requirement.
|
|
239
|
+
*
|
|
240
|
+
* `context:subscribe` is what `/sse`, `/sse/subscription` and `/ws` require
|
|
241
|
+
* (core's `PermissionValidator`, `validator.rs`, maps all three to
|
|
242
|
+
* `Context(Subscribe(Global))`). Without it every event stream an app opens is
|
|
243
|
+
* refused `403` + `X-Auth-Error: permission_denied`, so the app renders, reads
|
|
244
|
+
* and writes, and simply never receives a live update. Only `AppMode.Admin`
|
|
245
|
+
* escaped, because `admin` covers every route.
|
|
246
|
+
*
|
|
247
|
+
* MEASURED against merod 0.11.0-rc.41 (build 88e323b): a client key minted with
|
|
248
|
+
* the MultiContext list below minus `context:subscribe` gets `403` on
|
|
249
|
+
* `GET /sse`; the same list with it gets `200`.
|
|
250
|
+
*
|
|
251
|
+
* `context:delete` is what `DELETE /admin-api/contexts/:id` requires
|
|
252
|
+
* (`validator.rs`). An app that may create contexts may delete them, so
|
|
253
|
+
* `useDeleteContext` works on a node instead of answering 403.
|
|
254
|
+
*
|
|
255
|
+
* Public: whatever mints a token for a mero-react app on its behalf (the
|
|
256
|
+
* desktop's per-app key, admin-dashboard's, auth-frontend's allowlist) should
|
|
257
|
+
* test against this rather than a hand copy. Three copies went without
|
|
258
|
+
* `context:delete` and every app's context delete answered 403.
|
|
259
|
+
*/
|
|
260
|
+
declare function getPermissionsForMode(mode: AppMode): string[];
|
|
227
261
|
interface MeroProviderProps extends MeroProviderConfig {
|
|
228
262
|
children: React__default.ReactNode;
|
|
229
263
|
}
|
|
@@ -336,8 +370,10 @@ interface ConnectButtonProps {
|
|
|
336
370
|
};
|
|
337
371
|
/**
|
|
338
372
|
* Offer the **Cloud** tab — sign in with a Calimero account — next to the
|
|
339
|
-
* node dialog. Default true
|
|
340
|
-
*
|
|
373
|
+
* node dialog. Default true in a browser, false inside a Calimero Desktop
|
|
374
|
+
* window (already bound to the desktop's node; see `isDesktopWindow`). With
|
|
375
|
+
* false the modal has no tabs, and this button reads no enrolment callback,
|
|
376
|
+
* leaving it to whichever component does.
|
|
341
377
|
*/
|
|
342
378
|
cloud?: boolean;
|
|
343
379
|
/**
|
|
@@ -354,7 +390,7 @@ interface ConnectButtonProps {
|
|
|
354
390
|
/**
|
|
355
391
|
* ConnectButton - Displays connection status and handles login/logout
|
|
356
392
|
*/
|
|
357
|
-
declare function ConnectButton({ connectionType, className, style, theme, logoOnly, label, cloud, accountDefaults, }: ConnectButtonProps): react_jsx_runtime.JSX.Element;
|
|
393
|
+
declare function ConnectButton({ connectionType, className, style, theme, logoOnly, label, cloud: cloudProp, accountDefaults, }: ConnectButtonProps): react_jsx_runtime.JSX.Element;
|
|
358
394
|
|
|
359
395
|
interface ConnectButtonAccountProps {
|
|
360
396
|
className?: string;
|
|
@@ -373,6 +409,12 @@ interface ConnectButtonAccountProps {
|
|
|
373
409
|
* - the **context** is chosen after connecting, from the account's own contexts,
|
|
374
410
|
* which `admin.getContexts()` answers caller-scoped through the request proof.
|
|
375
411
|
*/
|
|
412
|
+
/**
|
|
413
|
+
* Show the "I have an account" path. Default true in a browser, false inside
|
|
414
|
+
* a Calimero Desktop window, which is already bound to the desktop's node
|
|
415
|
+
* (see `isDesktopWindow`).
|
|
416
|
+
*/
|
|
417
|
+
cloud?: boolean;
|
|
376
418
|
defaults?: {
|
|
377
419
|
/**
|
|
378
420
|
* Point enrolment at a wallet other than the hosted one.
|
|
@@ -384,7 +426,7 @@ interface ConnectButtonAccountProps {
|
|
|
384
426
|
walletUrl?: string;
|
|
385
427
|
};
|
|
386
428
|
}
|
|
387
|
-
declare function ConnectButtonAccount({ className, style, theme, defaults, }: ConnectButtonAccountProps): react_jsx_runtime.JSX.Element;
|
|
429
|
+
declare function ConnectButtonAccount({ className, style, theme, defaults, cloud: cloudProp, }: ConnectButtonAccountProps): react_jsx_runtime.JSX.Element;
|
|
388
430
|
|
|
389
431
|
interface LoginModalProps {
|
|
390
432
|
/** Callback when user connects */
|
|
@@ -417,6 +459,8 @@ interface LoginModalProps {
|
|
|
417
459
|
* the modal is open. Nothing to wire; the modal must be inside a
|
|
418
460
|
* `MeroProvider`.
|
|
419
461
|
* - **`false`**: no Cloud tab and no tabs at all — the node dialog as it was.
|
|
462
|
+
* - **omitted inside a Calimero Desktop window**: as `false` — the window is
|
|
463
|
+
* already bound to the desktop's node. Pass a `cloud` object to override.
|
|
420
464
|
* The modal reads no enrolment callback, leaving it to whichever component
|
|
421
465
|
* does.
|
|
422
466
|
* - **An object**: the caller's own enrolment, used verbatim; the modal reads
|
|
@@ -1428,4 +1472,22 @@ declare function clearContextIdentity(): void;
|
|
|
1428
1472
|
*/
|
|
1429
1473
|
declare function clearAllStorage(): void;
|
|
1430
1474
|
|
|
1431
|
-
|
|
1475
|
+
/**
|
|
1476
|
+
* Is this page running inside a Calimero Desktop (Tauri) window?
|
|
1477
|
+
*
|
|
1478
|
+
* The desktop opens every app in its own webview, already bound to the node it
|
|
1479
|
+
* runs, so the Cloud sign-in (wallet → relay, no node) is the wrong door there:
|
|
1480
|
+
* it would leave the desktop's own node behind, and the wallet redirect would
|
|
1481
|
+
* navigate the app window off to another origin.
|
|
1482
|
+
*
|
|
1483
|
+
* Two signals, either is enough:
|
|
1484
|
+
* - `__TAURI_INTERNALS__`, which Tauri injects natively into every webview it
|
|
1485
|
+
* creates, remote URLs included — what mero-js's own Tauri check reads;
|
|
1486
|
+
* - `__TAURI_FETCH_PROXY_INJECTED__`, the marker the desktop's app-window
|
|
1487
|
+
* init script sets, in case a future Tauri stops exposing the former there.
|
|
1488
|
+
*
|
|
1489
|
+
* Read at call time and SSR-safe: false whenever there is no `window`.
|
|
1490
|
+
*/
|
|
1491
|
+
declare function isDesktopWindow(): boolean;
|
|
1492
|
+
|
|
1493
|
+
export { type AccountEnrolment, AccountSignInPanel, type AccountSignInPanelProps, type AppContext, AppMode, type ApplicationContextRecord, type BlobHookOptions, CalimeroLogo, type CalimeroLogoProps, ConnectButton, ConnectButtonAccount, type ConnectButtonAccountProps, type ConnectButtonProps, ConnectionType, type ContextDiscoveryOptions, type ContextDiscoveryState, type CreatePrivateContextRequest, type CustomConnectionConfig, DEFAULT_MIGRATION_POLL_INTERVAL_MS, type ExecutionResult, type JoinInvitationInput, type JoinInvitationResult, type JoinInvitationStep, LoginModal, type LoginModalProps, type LoginModalTab, MERO_CSS_VARS, type MeroCapabilities, MeroContext, type MeroContextValue, MeroProvider, type MeroProviderConfig, type MeroProviderProps, type MeroTheme, MigrationAdminPanel, type MigrationAdminPanelProps, MigrationPendingBanner, type MigrationPendingBannerProps, type MutationOptions, type ResolvedMeroTheme, type SetMetadataInput, type SubscriptionEventData, type SubscriptionInput, type UseAccountEnrolmentOptions, type UseBlobUrlOptions, type UseDelegatedBootstrapOptions, type UseDelegatedBootstrapResult, type UseEphemeralOptions, type UseEphemeralResult, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearNodeUrl, clearTokenNodeUrl, cssVar, defaultMeroTheme, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getPermissionsForMode, getTokenNodeUrl, isDesktopWindow, isFinalInvitationError, isReturningFromWallet, localStorageTokenStorage, resolveMeroTheme, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, themeToCssVars, useAccountEnrolment, useAddGroupMembers, useAppVersion, useApplicationContexts, useBlobInfo, useBlobUrl, useContextDiscovery, useContextGroup, useContexts, useCreateContext, useCreateGroupInNamespace, useCreateNamespace, useCreateNamespaceInvitation, useCreatePrivateContext, useDefaultCapabilities, useDelegatedBootstrap, useDeleteContext, useDeleteGroup, useDeleteNamespace, useDetachContextFromGroup, useEphemeral, useExecute, useGroupAppVersion, useGroupCapabilities, useGroupContexts, useGroupInfo, useGroupInvitations, useGroupMembers, useGroupMetadata, useGroupUpgradeStatus, useInstallFromRegistry, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaceIdentity, useNamespaces, useNamespacesForApplication, useNodeIdentity, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
|
package/dist/index.d.ts
CHANGED
|
@@ -224,6 +224,40 @@ interface MeroCapabilities {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
declare const MeroContext: React__default.Context<MeroContextValue | null>;
|
|
227
|
+
/**
|
|
228
|
+
* Permission grants requested for the client token at login.
|
|
229
|
+
*
|
|
230
|
+
* Cores since 0.11.0-rc.9 default-deny admin-api routes the token holds no
|
|
231
|
+
* scope for; cores >=0.11.0-rc.11 map the governance/blob/alias routes to the
|
|
232
|
+
* client-grantable `namespace` / `group` / `blob` / `context:alias`
|
|
233
|
+
* permissions, so app tokens must request them here or every workspace,
|
|
234
|
+
* group, blob and context-alias call 403s.
|
|
235
|
+
*
|
|
236
|
+
* `context:list` is included even in single-context mode because every app
|
|
237
|
+
* calls GET /admin-api/contexts/:id/identities-owned right after login, which
|
|
238
|
+
* maps to a `context:list` requirement.
|
|
239
|
+
*
|
|
240
|
+
* `context:subscribe` is what `/sse`, `/sse/subscription` and `/ws` require
|
|
241
|
+
* (core's `PermissionValidator`, `validator.rs`, maps all three to
|
|
242
|
+
* `Context(Subscribe(Global))`). Without it every event stream an app opens is
|
|
243
|
+
* refused `403` + `X-Auth-Error: permission_denied`, so the app renders, reads
|
|
244
|
+
* and writes, and simply never receives a live update. Only `AppMode.Admin`
|
|
245
|
+
* escaped, because `admin` covers every route.
|
|
246
|
+
*
|
|
247
|
+
* MEASURED against merod 0.11.0-rc.41 (build 88e323b): a client key minted with
|
|
248
|
+
* the MultiContext list below minus `context:subscribe` gets `403` on
|
|
249
|
+
* `GET /sse`; the same list with it gets `200`.
|
|
250
|
+
*
|
|
251
|
+
* `context:delete` is what `DELETE /admin-api/contexts/:id` requires
|
|
252
|
+
* (`validator.rs`). An app that may create contexts may delete them, so
|
|
253
|
+
* `useDeleteContext` works on a node instead of answering 403.
|
|
254
|
+
*
|
|
255
|
+
* Public: whatever mints a token for a mero-react app on its behalf (the
|
|
256
|
+
* desktop's per-app key, admin-dashboard's, auth-frontend's allowlist) should
|
|
257
|
+
* test against this rather than a hand copy. Three copies went without
|
|
258
|
+
* `context:delete` and every app's context delete answered 403.
|
|
259
|
+
*/
|
|
260
|
+
declare function getPermissionsForMode(mode: AppMode): string[];
|
|
227
261
|
interface MeroProviderProps extends MeroProviderConfig {
|
|
228
262
|
children: React__default.ReactNode;
|
|
229
263
|
}
|
|
@@ -336,8 +370,10 @@ interface ConnectButtonProps {
|
|
|
336
370
|
};
|
|
337
371
|
/**
|
|
338
372
|
* Offer the **Cloud** tab — sign in with a Calimero account — next to the
|
|
339
|
-
* node dialog. Default true
|
|
340
|
-
*
|
|
373
|
+
* node dialog. Default true in a browser, false inside a Calimero Desktop
|
|
374
|
+
* window (already bound to the desktop's node; see `isDesktopWindow`). With
|
|
375
|
+
* false the modal has no tabs, and this button reads no enrolment callback,
|
|
376
|
+
* leaving it to whichever component does.
|
|
341
377
|
*/
|
|
342
378
|
cloud?: boolean;
|
|
343
379
|
/**
|
|
@@ -354,7 +390,7 @@ interface ConnectButtonProps {
|
|
|
354
390
|
/**
|
|
355
391
|
* ConnectButton - Displays connection status and handles login/logout
|
|
356
392
|
*/
|
|
357
|
-
declare function ConnectButton({ connectionType, className, style, theme, logoOnly, label, cloud, accountDefaults, }: ConnectButtonProps): react_jsx_runtime.JSX.Element;
|
|
393
|
+
declare function ConnectButton({ connectionType, className, style, theme, logoOnly, label, cloud: cloudProp, accountDefaults, }: ConnectButtonProps): react_jsx_runtime.JSX.Element;
|
|
358
394
|
|
|
359
395
|
interface ConnectButtonAccountProps {
|
|
360
396
|
className?: string;
|
|
@@ -373,6 +409,12 @@ interface ConnectButtonAccountProps {
|
|
|
373
409
|
* - the **context** is chosen after connecting, from the account's own contexts,
|
|
374
410
|
* which `admin.getContexts()` answers caller-scoped through the request proof.
|
|
375
411
|
*/
|
|
412
|
+
/**
|
|
413
|
+
* Show the "I have an account" path. Default true in a browser, false inside
|
|
414
|
+
* a Calimero Desktop window, which is already bound to the desktop's node
|
|
415
|
+
* (see `isDesktopWindow`).
|
|
416
|
+
*/
|
|
417
|
+
cloud?: boolean;
|
|
376
418
|
defaults?: {
|
|
377
419
|
/**
|
|
378
420
|
* Point enrolment at a wallet other than the hosted one.
|
|
@@ -384,7 +426,7 @@ interface ConnectButtonAccountProps {
|
|
|
384
426
|
walletUrl?: string;
|
|
385
427
|
};
|
|
386
428
|
}
|
|
387
|
-
declare function ConnectButtonAccount({ className, style, theme, defaults, }: ConnectButtonAccountProps): react_jsx_runtime.JSX.Element;
|
|
429
|
+
declare function ConnectButtonAccount({ className, style, theme, defaults, cloud: cloudProp, }: ConnectButtonAccountProps): react_jsx_runtime.JSX.Element;
|
|
388
430
|
|
|
389
431
|
interface LoginModalProps {
|
|
390
432
|
/** Callback when user connects */
|
|
@@ -417,6 +459,8 @@ interface LoginModalProps {
|
|
|
417
459
|
* the modal is open. Nothing to wire; the modal must be inside a
|
|
418
460
|
* `MeroProvider`.
|
|
419
461
|
* - **`false`**: no Cloud tab and no tabs at all — the node dialog as it was.
|
|
462
|
+
* - **omitted inside a Calimero Desktop window**: as `false` — the window is
|
|
463
|
+
* already bound to the desktop's node. Pass a `cloud` object to override.
|
|
420
464
|
* The modal reads no enrolment callback, leaving it to whichever component
|
|
421
465
|
* does.
|
|
422
466
|
* - **An object**: the caller's own enrolment, used verbatim; the modal reads
|
|
@@ -1428,4 +1472,22 @@ declare function clearContextIdentity(): void;
|
|
|
1428
1472
|
*/
|
|
1429
1473
|
declare function clearAllStorage(): void;
|
|
1430
1474
|
|
|
1431
|
-
|
|
1475
|
+
/**
|
|
1476
|
+
* Is this page running inside a Calimero Desktop (Tauri) window?
|
|
1477
|
+
*
|
|
1478
|
+
* The desktop opens every app in its own webview, already bound to the node it
|
|
1479
|
+
* runs, so the Cloud sign-in (wallet → relay, no node) is the wrong door there:
|
|
1480
|
+
* it would leave the desktop's own node behind, and the wallet redirect would
|
|
1481
|
+
* navigate the app window off to another origin.
|
|
1482
|
+
*
|
|
1483
|
+
* Two signals, either is enough:
|
|
1484
|
+
* - `__TAURI_INTERNALS__`, which Tauri injects natively into every webview it
|
|
1485
|
+
* creates, remote URLs included — what mero-js's own Tauri check reads;
|
|
1486
|
+
* - `__TAURI_FETCH_PROXY_INJECTED__`, the marker the desktop's app-window
|
|
1487
|
+
* init script sets, in case a future Tauri stops exposing the former there.
|
|
1488
|
+
*
|
|
1489
|
+
* Read at call time and SSR-safe: false whenever there is no `window`.
|
|
1490
|
+
*/
|
|
1491
|
+
declare function isDesktopWindow(): boolean;
|
|
1492
|
+
|
|
1493
|
+
export { type AccountEnrolment, AccountSignInPanel, type AccountSignInPanelProps, type AppContext, AppMode, type ApplicationContextRecord, type BlobHookOptions, CalimeroLogo, type CalimeroLogoProps, ConnectButton, ConnectButtonAccount, type ConnectButtonAccountProps, type ConnectButtonProps, ConnectionType, type ContextDiscoveryOptions, type ContextDiscoveryState, type CreatePrivateContextRequest, type CustomConnectionConfig, DEFAULT_MIGRATION_POLL_INTERVAL_MS, type ExecutionResult, type JoinInvitationInput, type JoinInvitationResult, type JoinInvitationStep, LoginModal, type LoginModalProps, type LoginModalTab, MERO_CSS_VARS, type MeroCapabilities, MeroContext, type MeroContextValue, MeroProvider, type MeroProviderConfig, type MeroProviderProps, type MeroTheme, MigrationAdminPanel, type MigrationAdminPanelProps, MigrationPendingBanner, type MigrationPendingBannerProps, type MutationOptions, type ResolvedMeroTheme, type SetMetadataInput, type SubscriptionEventData, type SubscriptionInput, type UseAccountEnrolmentOptions, type UseBlobUrlOptions, type UseDelegatedBootstrapOptions, type UseDelegatedBootstrapResult, type UseEphemeralOptions, type UseEphemeralResult, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearNodeUrl, clearTokenNodeUrl, cssVar, defaultMeroTheme, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getPermissionsForMode, getTokenNodeUrl, isDesktopWindow, isFinalInvitationError, isReturningFromWallet, localStorageTokenStorage, resolveMeroTheme, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, themeToCssVars, useAccountEnrolment, useAddGroupMembers, useAppVersion, useApplicationContexts, useBlobInfo, useBlobUrl, useContextDiscovery, useContextGroup, useContexts, useCreateContext, useCreateGroupInNamespace, useCreateNamespace, useCreateNamespaceInvitation, useCreatePrivateContext, useDefaultCapabilities, useDelegatedBootstrap, useDeleteContext, useDeleteGroup, useDeleteNamespace, useDetachContextFromGroup, useEphemeral, useExecute, useGroupAppVersion, useGroupCapabilities, useGroupContexts, useGroupInfo, useGroupInvitations, useGroupMembers, useGroupMetadata, useGroupUpgradeStatus, useInstallFromRegistry, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaceIdentity, useNamespaces, useNamespacesForApplication, useNodeIdentity, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
|
package/dist/index.js
CHANGED
|
@@ -1024,6 +1024,13 @@ function useAccountEnrolment({
|
|
|
1024
1024
|
customWallet: walletOverride !== void 0
|
|
1025
1025
|
};
|
|
1026
1026
|
}
|
|
1027
|
+
|
|
1028
|
+
// src/utils/desktop.ts
|
|
1029
|
+
function isDesktopWindow() {
|
|
1030
|
+
if (typeof window === "undefined") return false;
|
|
1031
|
+
const w = window;
|
|
1032
|
+
return "__TAURI_INTERNALS__" in w || w.__TAURI_FETCH_PROXY_INJECTED__ === true;
|
|
1033
|
+
}
|
|
1027
1034
|
var CUSTOM_SELECTION = "__custom__";
|
|
1028
1035
|
var TABS = [
|
|
1029
1036
|
{ id: "node", label: "Node" },
|
|
@@ -1309,9 +1316,10 @@ function LoginModal({
|
|
|
1309
1316
|
cloud,
|
|
1310
1317
|
initialTab: initialTabProp
|
|
1311
1318
|
}) {
|
|
1312
|
-
const
|
|
1319
|
+
const ownCloud = cloud === void 0 && !isDesktopWindow();
|
|
1320
|
+
const own = useAccountEnrolment({ enabled: ownCloud });
|
|
1313
1321
|
const cloudTab = useMemo(
|
|
1314
|
-
() =>
|
|
1322
|
+
() => ownCloud ? {
|
|
1315
1323
|
onEnrol: () => {
|
|
1316
1324
|
void own.goToWallet();
|
|
1317
1325
|
},
|
|
@@ -1319,9 +1327,9 @@ function LoginModal({
|
|
|
1319
1327
|
walletUrl: own.walletUrl,
|
|
1320
1328
|
customWallet: own.customWallet
|
|
1321
1329
|
} : cloud || null,
|
|
1322
|
-
[cloud, own.goToWallet, own.note, own.walletUrl, own.customWallet]
|
|
1330
|
+
[cloud, ownCloud, own.goToWallet, own.note, own.walletUrl, own.customWallet]
|
|
1323
1331
|
);
|
|
1324
|
-
const initialTab = initialTabProp ?? (
|
|
1332
|
+
const initialTab = initialTabProp ?? (ownCloud && own.returning ? "cloud" : "node");
|
|
1325
1333
|
const [tab, setTab] = useState(initialTab);
|
|
1326
1334
|
useEffect(() => {
|
|
1327
1335
|
if (isOpen) setTab(initialTab);
|
|
@@ -1625,9 +1633,10 @@ function ConnectButton({
|
|
|
1625
1633
|
theme,
|
|
1626
1634
|
logoOnly = false,
|
|
1627
1635
|
label,
|
|
1628
|
-
cloud
|
|
1636
|
+
cloud: cloudProp,
|
|
1629
1637
|
accountDefaults
|
|
1630
1638
|
}) {
|
|
1639
|
+
const cloud = cloudProp ?? !isDesktopWindow();
|
|
1631
1640
|
const { isAuthenticated, connectToNode, logout, nodeUrl, isOnline, isDelegated } = useMero();
|
|
1632
1641
|
const enrolment = useAccountEnrolment({
|
|
1633
1642
|
walletUrl: accountDefaults?.walletUrl,
|
|
@@ -1805,8 +1814,10 @@ function ConnectButtonAccount({
|
|
|
1805
1814
|
className,
|
|
1806
1815
|
style,
|
|
1807
1816
|
theme,
|
|
1808
|
-
defaults = {}
|
|
1817
|
+
defaults = {},
|
|
1818
|
+
cloud: cloudProp
|
|
1809
1819
|
}) {
|
|
1820
|
+
const cloud = cloudProp ?? !isDesktopWindow();
|
|
1810
1821
|
const { isAuthenticated, isOnline, nodeUrl, isDelegated, connectToNode, logout } = useMero();
|
|
1811
1822
|
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
|
|
1812
1823
|
const [isNodeModalOpen, setIsNodeModalOpen] = useState(false);
|
|
@@ -1826,7 +1837,10 @@ function ConnectButtonAccount({
|
|
|
1826
1837
|
document.addEventListener("mousedown", onOutside);
|
|
1827
1838
|
return () => document.removeEventListener("mousedown", onOutside);
|
|
1828
1839
|
}, []);
|
|
1829
|
-
const { goToWallet, note, walletUrl } = useAccountEnrolment({
|
|
1840
|
+
const { goToWallet, note, walletUrl } = useAccountEnrolment({
|
|
1841
|
+
walletUrl: defaults.walletUrl,
|
|
1842
|
+
enabled: cloud
|
|
1843
|
+
});
|
|
1830
1844
|
if (isAuthenticated && !isOnline) {
|
|
1831
1845
|
return /* @__PURE__ */ jsx("div", { className: "mero-connect-container", style: { ...themeVars, display: "inline-block" }, children: /* @__PURE__ */ jsxs(
|
|
1832
1846
|
"button",
|
|
@@ -1905,7 +1919,7 @@ function ConnectButtonAccount({
|
|
|
1905
1919
|
]
|
|
1906
1920
|
}
|
|
1907
1921
|
),
|
|
1908
|
-
/* @__PURE__ */ jsx(
|
|
1922
|
+
cloud && /* @__PURE__ */ jsx(
|
|
1909
1923
|
"button",
|
|
1910
1924
|
{
|
|
1911
1925
|
className: ["mero-connect-button", className].filter(Boolean).join(" "),
|
|
@@ -1915,7 +1929,7 @@ function ConnectButtonAccount({
|
|
|
1915
1929
|
}
|
|
1916
1930
|
)
|
|
1917
1931
|
] }),
|
|
1918
|
-
isAccountOpen && /* @__PURE__ */ jsxs(
|
|
1932
|
+
cloud && isAccountOpen && /* @__PURE__ */ jsxs(
|
|
1919
1933
|
"div",
|
|
1920
1934
|
{
|
|
1921
1935
|
style: {
|
|
@@ -3865,6 +3879,6 @@ function useJoinInvitation() {
|
|
|
3865
3879
|
return { joinInvitation, joining, memberships, invitationRedeemer };
|
|
3866
3880
|
}
|
|
3867
3881
|
|
|
3868
|
-
export { AccountSignInPanel, AppMode, CalimeroLogo, ConnectButton, ConnectButtonAccount, ConnectionType, DEFAULT_MIGRATION_POLL_INTERVAL_MS, LoginModal, MERO_CSS_VARS, MeroContext, MeroProvider, MigrationAdminPanel, MigrationPendingBanner, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearNodeUrl, clearTokenNodeUrl, cssVar, defaultMeroTheme, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getTokenNodeUrl, isFinalInvitationError, isReturningFromWallet, localStorageTokenStorage, resolveMeroTheme, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, themeToCssVars, useAccountEnrolment, useAddGroupMembers, useAppVersion, useApplicationContexts, useBlobInfo, useBlobUrl, useContextDiscovery, useContextGroup, useContexts, useCreateContext, useCreateGroupInNamespace, useCreateNamespace, useCreateNamespaceInvitation, useCreatePrivateContext, useDefaultCapabilities, useDelegatedBootstrap, useDeleteContext, useDeleteGroup, useDeleteNamespace, useDetachContextFromGroup, useEphemeral, useExecute, useGroupAppVersion, useGroupCapabilities, useGroupContexts, useGroupInfo, useGroupInvitations, useGroupMembers, useGroupMetadata, useGroupUpgradeStatus, useInstallFromRegistry, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaceIdentity, useNamespaces, useNamespacesForApplication, useNodeIdentity, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
|
|
3882
|
+
export { AccountSignInPanel, AppMode, CalimeroLogo, ConnectButton, ConnectButtonAccount, ConnectionType, DEFAULT_MIGRATION_POLL_INTERVAL_MS, LoginModal, MERO_CSS_VARS, MeroContext, MeroProvider, MigrationAdminPanel, MigrationPendingBanner, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearNodeUrl, clearTokenNodeUrl, cssVar, defaultMeroTheme, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getPermissionsForMode, getTokenNodeUrl, isDesktopWindow, isFinalInvitationError, isReturningFromWallet, localStorageTokenStorage, resolveMeroTheme, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, themeToCssVars, useAccountEnrolment, useAddGroupMembers, useAppVersion, useApplicationContexts, useBlobInfo, useBlobUrl, useContextDiscovery, useContextGroup, useContexts, useCreateContext, useCreateGroupInNamespace, useCreateNamespace, useCreateNamespaceInvitation, useCreatePrivateContext, useDefaultCapabilities, useDelegatedBootstrap, useDeleteContext, useDeleteGroup, useDeleteNamespace, useDetachContextFromGroup, useEphemeral, useExecute, useGroupAppVersion, useGroupCapabilities, useGroupContexts, useGroupInfo, useGroupInvitations, useGroupMembers, useGroupMetadata, useGroupUpgradeStatus, useInstallFromRegistry, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaceIdentity, useNamespaces, useNamespacesForApplication, useNodeIdentity, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
|
|
3869
3883
|
//# sourceMappingURL=index.js.map
|
|
3870
3884
|
//# sourceMappingURL=index.js.map
|