@calimero-network/mero-react 9.15.0 → 9.16.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/README.md +10 -1
- package/dist/index.cjs +181 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -1
- package/dist/index.d.ts +35 -1
- package/dist/index.js +179 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -680,6 +680,15 @@ declare function onInvitation(listener: Listener): () => void;
|
|
|
680
680
|
* to know, such as a bootstrap deciding where to land the user.
|
|
681
681
|
*/
|
|
682
682
|
declare function peekInvitation(): CapturedInvitation | null;
|
|
683
|
+
/**
|
|
684
|
+
* Be told when the captured invitation changes: one arrives, or it is acked.
|
|
685
|
+
*
|
|
686
|
+
* Unlike `onInvitation` this takes nothing: the invitation stays buffered for
|
|
687
|
+
* whoever redeems it. It is for UI that only needs to know one is pending — the
|
|
688
|
+
* logged-out invitation screen — and pairs with `peekInvitation` as a
|
|
689
|
+
* `useSyncExternalStore` source.
|
|
690
|
+
*/
|
|
691
|
+
declare function subscribeInvitation(watcher: () => void): () => void;
|
|
683
692
|
/** Test seam: drop the controller and any buffered intent. */
|
|
684
693
|
declare function resetInvitationCaptureForTests(): void;
|
|
685
694
|
|
|
@@ -927,6 +936,31 @@ interface JoinSyncBannerProps {
|
|
|
927
936
|
*/
|
|
928
937
|
declare function JoinSyncBanner({ show, what, onDismiss, className, style, children, }: JoinSyncBannerProps): react_jsx_runtime.JSX.Element | null;
|
|
929
938
|
|
|
939
|
+
interface InvitationGateProps {
|
|
940
|
+
/**
|
|
941
|
+
* The app, shown as usual unless an invitation is waiting on a login. Leave
|
|
942
|
+
* out to mount the gate beside the app instead, as a full-page layer.
|
|
943
|
+
*/
|
|
944
|
+
children?: ReactNode;
|
|
945
|
+
/**
|
|
946
|
+
* The app's invitation codec, the same `parse` it gives `useInviteRedemption`.
|
|
947
|
+
* Decoding needs no session, so the screen can name what is being joined.
|
|
948
|
+
* Without it the screen falls back to the noun.
|
|
949
|
+
*/
|
|
950
|
+
parse?: (token: string, params: Record<string, string>) => ParsedInvitation | null;
|
|
951
|
+
/** What the app calls the thing being joined: "team", "workspace", "vault". */
|
|
952
|
+
noun?: string;
|
|
953
|
+
/** The app's name, so a person knows where the invitation is taking them. */
|
|
954
|
+
appName?: string;
|
|
955
|
+
/** Optional: the app's own words about what joining gives you. */
|
|
956
|
+
detail?: string;
|
|
957
|
+
/** Passed to the login button (theme, `cloud`, `connectionType`). */
|
|
958
|
+
connectButtonProps?: Omit<ConnectButtonProps, 'label'>;
|
|
959
|
+
}
|
|
960
|
+
/** The captured invitation, re-rendering when one arrives or is acked. */
|
|
961
|
+
declare function usePendingInvitation(): CapturedInvitation | null;
|
|
962
|
+
declare function InvitationGate({ children, parse, noun, appName, detail, connectButtonProps, }: InvitationGateProps): react_jsx_runtime.JSX.Element | null;
|
|
963
|
+
|
|
930
964
|
interface JoinInvitationInput {
|
|
931
965
|
readonly namespaceId: string;
|
|
932
966
|
/** The context the invitation was for, when it names one; a workspace invitation names none. */
|
|
@@ -1815,4 +1849,4 @@ declare function clearAllStorage(): void;
|
|
|
1815
1849
|
*/
|
|
1816
1850
|
declare function isDesktopWindow(): boolean;
|
|
1817
1851
|
|
|
1818
|
-
export { type AccountEnrolment, AccountSignInPanel, type AccountSignInPanelProps, type AppContext, AppMode, type ApplicationContextRecord, type BlobHookOptions, CalimeroLogo, type CalimeroLogoProps, type CapturedInvitation, ConnectButton, ConnectButtonAccount, type ConnectButtonAccountProps, type ConnectButtonProps, ConnectionType, type ContextDiscoveryOptions, type ContextDiscoveryState, type CreatePrivateContextRequest, type CustomConnectionConfig, DEFAULT_MIGRATION_POLL_INTERVAL_MS, type ExecutionResult, INVITATION_PARAM, INVITATION_READY_MS, InvitationDialog, type InvitationDialogProps, type InvitationDialogStage, type InviteRedemption, type InviteState, JOIN_ACTION, JOIN_SYNC_MAX_MS, JOIN_SYNC_POLL_MS, JOIN_SYNC_WATCHDOG_MS, type JoinInvitationInput, type JoinInvitationResult, type JoinInvitationStep, JoinSyncBanner, type JoinSyncBannerProps, type JoinSyncOptions, type JoinSyncState, LoginModal, type LoginModalProps, type LoginModalTab, MAX_AUTO_JOIN_ATTEMPTS, MERO_CSS_VARS, type MeroCapabilities, MeroContext, type MeroContextValue, MeroProvider, type MeroProviderConfig, type MeroProviderProps, type MeroTheme, MigrationAdminPanel, type MigrationAdminPanelProps, MigrationPendingBanner, type MigrationPendingBannerProps, type MutationOptions, type ParsedInvitation, type ResolvedMeroTheme, type SetMetadataInput, type SubscriptionEventData, type SubscriptionInput, type UseAccountEnrolmentOptions, type UseBlobUrlOptions, type UseDelegatedBootstrapOptions, type UseDelegatedBootstrapResult, type UseEphemeralOptions, type UseEphemeralResult, type UseInviteRedemptionOptions, buildInviteLink, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearNamespaceJustJoined, clearNodeUrl, clearTokenNodeUrl, cssVar, defaultMeroTheme, describeInviteFailure, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getPermissionsForMode, getTokenNodeUrl, invitationFromRaw, isDesktopWindow, isFinalInvitationError, isNamespaceJustJoined, isReturningFromWallet, localStorageTokenStorage, markNamespaceJustJoined, onInvitation, peekInvitation, primeInvitationCapture, resetInvitationCaptureForTests, resolveMeroTheme, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, subscribeJustJoined, themeToCssVars, urlWithoutInvitation, 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, useInviteRedemption, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useJoinSync, 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 };
|
|
1852
|
+
export { type AccountEnrolment, AccountSignInPanel, type AccountSignInPanelProps, type AppContext, AppMode, type ApplicationContextRecord, type BlobHookOptions, CalimeroLogo, type CalimeroLogoProps, type CapturedInvitation, ConnectButton, ConnectButtonAccount, type ConnectButtonAccountProps, type ConnectButtonProps, ConnectionType, type ContextDiscoveryOptions, type ContextDiscoveryState, type CreatePrivateContextRequest, type CustomConnectionConfig, DEFAULT_MIGRATION_POLL_INTERVAL_MS, type ExecutionResult, INVITATION_PARAM, INVITATION_READY_MS, InvitationDialog, type InvitationDialogProps, type InvitationDialogStage, InvitationGate, type InvitationGateProps, type InviteRedemption, type InviteState, JOIN_ACTION, JOIN_SYNC_MAX_MS, JOIN_SYNC_POLL_MS, JOIN_SYNC_WATCHDOG_MS, type JoinInvitationInput, type JoinInvitationResult, type JoinInvitationStep, JoinSyncBanner, type JoinSyncBannerProps, type JoinSyncOptions, type JoinSyncState, LoginModal, type LoginModalProps, type LoginModalTab, MAX_AUTO_JOIN_ATTEMPTS, MERO_CSS_VARS, type MeroCapabilities, MeroContext, type MeroContextValue, MeroProvider, type MeroProviderConfig, type MeroProviderProps, type MeroTheme, MigrationAdminPanel, type MigrationAdminPanelProps, MigrationPendingBanner, type MigrationPendingBannerProps, type MutationOptions, type ParsedInvitation, type ResolvedMeroTheme, type SetMetadataInput, type SubscriptionEventData, type SubscriptionInput, type UseAccountEnrolmentOptions, type UseBlobUrlOptions, type UseDelegatedBootstrapOptions, type UseDelegatedBootstrapResult, type UseEphemeralOptions, type UseEphemeralResult, type UseInviteRedemptionOptions, buildInviteLink, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearNamespaceJustJoined, clearNodeUrl, clearTokenNodeUrl, cssVar, defaultMeroTheme, describeInviteFailure, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getPermissionsForMode, getTokenNodeUrl, invitationFromRaw, isDesktopWindow, isFinalInvitationError, isNamespaceJustJoined, isReturningFromWallet, localStorageTokenStorage, markNamespaceJustJoined, onInvitation, peekInvitation, primeInvitationCapture, resetInvitationCaptureForTests, resolveMeroTheme, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, subscribeInvitation, subscribeJustJoined, themeToCssVars, urlWithoutInvitation, 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, useInviteRedemption, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useJoinSync, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaceIdentity, useNamespaces, useNamespacesForApplication, useNodeIdentity, usePendingInvitation, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
|
package/dist/index.d.ts
CHANGED
|
@@ -680,6 +680,15 @@ declare function onInvitation(listener: Listener): () => void;
|
|
|
680
680
|
* to know, such as a bootstrap deciding where to land the user.
|
|
681
681
|
*/
|
|
682
682
|
declare function peekInvitation(): CapturedInvitation | null;
|
|
683
|
+
/**
|
|
684
|
+
* Be told when the captured invitation changes: one arrives, or it is acked.
|
|
685
|
+
*
|
|
686
|
+
* Unlike `onInvitation` this takes nothing: the invitation stays buffered for
|
|
687
|
+
* whoever redeems it. It is for UI that only needs to know one is pending — the
|
|
688
|
+
* logged-out invitation screen — and pairs with `peekInvitation` as a
|
|
689
|
+
* `useSyncExternalStore` source.
|
|
690
|
+
*/
|
|
691
|
+
declare function subscribeInvitation(watcher: () => void): () => void;
|
|
683
692
|
/** Test seam: drop the controller and any buffered intent. */
|
|
684
693
|
declare function resetInvitationCaptureForTests(): void;
|
|
685
694
|
|
|
@@ -927,6 +936,31 @@ interface JoinSyncBannerProps {
|
|
|
927
936
|
*/
|
|
928
937
|
declare function JoinSyncBanner({ show, what, onDismiss, className, style, children, }: JoinSyncBannerProps): react_jsx_runtime.JSX.Element | null;
|
|
929
938
|
|
|
939
|
+
interface InvitationGateProps {
|
|
940
|
+
/**
|
|
941
|
+
* The app, shown as usual unless an invitation is waiting on a login. Leave
|
|
942
|
+
* out to mount the gate beside the app instead, as a full-page layer.
|
|
943
|
+
*/
|
|
944
|
+
children?: ReactNode;
|
|
945
|
+
/**
|
|
946
|
+
* The app's invitation codec, the same `parse` it gives `useInviteRedemption`.
|
|
947
|
+
* Decoding needs no session, so the screen can name what is being joined.
|
|
948
|
+
* Without it the screen falls back to the noun.
|
|
949
|
+
*/
|
|
950
|
+
parse?: (token: string, params: Record<string, string>) => ParsedInvitation | null;
|
|
951
|
+
/** What the app calls the thing being joined: "team", "workspace", "vault". */
|
|
952
|
+
noun?: string;
|
|
953
|
+
/** The app's name, so a person knows where the invitation is taking them. */
|
|
954
|
+
appName?: string;
|
|
955
|
+
/** Optional: the app's own words about what joining gives you. */
|
|
956
|
+
detail?: string;
|
|
957
|
+
/** Passed to the login button (theme, `cloud`, `connectionType`). */
|
|
958
|
+
connectButtonProps?: Omit<ConnectButtonProps, 'label'>;
|
|
959
|
+
}
|
|
960
|
+
/** The captured invitation, re-rendering when one arrives or is acked. */
|
|
961
|
+
declare function usePendingInvitation(): CapturedInvitation | null;
|
|
962
|
+
declare function InvitationGate({ children, parse, noun, appName, detail, connectButtonProps, }: InvitationGateProps): react_jsx_runtime.JSX.Element | null;
|
|
963
|
+
|
|
930
964
|
interface JoinInvitationInput {
|
|
931
965
|
readonly namespaceId: string;
|
|
932
966
|
/** The context the invitation was for, when it names one; a workspace invitation names none. */
|
|
@@ -1815,4 +1849,4 @@ declare function clearAllStorage(): void;
|
|
|
1815
1849
|
*/
|
|
1816
1850
|
declare function isDesktopWindow(): boolean;
|
|
1817
1851
|
|
|
1818
|
-
export { type AccountEnrolment, AccountSignInPanel, type AccountSignInPanelProps, type AppContext, AppMode, type ApplicationContextRecord, type BlobHookOptions, CalimeroLogo, type CalimeroLogoProps, type CapturedInvitation, ConnectButton, ConnectButtonAccount, type ConnectButtonAccountProps, type ConnectButtonProps, ConnectionType, type ContextDiscoveryOptions, type ContextDiscoveryState, type CreatePrivateContextRequest, type CustomConnectionConfig, DEFAULT_MIGRATION_POLL_INTERVAL_MS, type ExecutionResult, INVITATION_PARAM, INVITATION_READY_MS, InvitationDialog, type InvitationDialogProps, type InvitationDialogStage, type InviteRedemption, type InviteState, JOIN_ACTION, JOIN_SYNC_MAX_MS, JOIN_SYNC_POLL_MS, JOIN_SYNC_WATCHDOG_MS, type JoinInvitationInput, type JoinInvitationResult, type JoinInvitationStep, JoinSyncBanner, type JoinSyncBannerProps, type JoinSyncOptions, type JoinSyncState, LoginModal, type LoginModalProps, type LoginModalTab, MAX_AUTO_JOIN_ATTEMPTS, MERO_CSS_VARS, type MeroCapabilities, MeroContext, type MeroContextValue, MeroProvider, type MeroProviderConfig, type MeroProviderProps, type MeroTheme, MigrationAdminPanel, type MigrationAdminPanelProps, MigrationPendingBanner, type MigrationPendingBannerProps, type MutationOptions, type ParsedInvitation, type ResolvedMeroTheme, type SetMetadataInput, type SubscriptionEventData, type SubscriptionInput, type UseAccountEnrolmentOptions, type UseBlobUrlOptions, type UseDelegatedBootstrapOptions, type UseDelegatedBootstrapResult, type UseEphemeralOptions, type UseEphemeralResult, type UseInviteRedemptionOptions, buildInviteLink, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearNamespaceJustJoined, clearNodeUrl, clearTokenNodeUrl, cssVar, defaultMeroTheme, describeInviteFailure, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getPermissionsForMode, getTokenNodeUrl, invitationFromRaw, isDesktopWindow, isFinalInvitationError, isNamespaceJustJoined, isReturningFromWallet, localStorageTokenStorage, markNamespaceJustJoined, onInvitation, peekInvitation, primeInvitationCapture, resetInvitationCaptureForTests, resolveMeroTheme, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, subscribeJustJoined, themeToCssVars, urlWithoutInvitation, 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, useInviteRedemption, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useJoinSync, 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 };
|
|
1852
|
+
export { type AccountEnrolment, AccountSignInPanel, type AccountSignInPanelProps, type AppContext, AppMode, type ApplicationContextRecord, type BlobHookOptions, CalimeroLogo, type CalimeroLogoProps, type CapturedInvitation, ConnectButton, ConnectButtonAccount, type ConnectButtonAccountProps, type ConnectButtonProps, ConnectionType, type ContextDiscoveryOptions, type ContextDiscoveryState, type CreatePrivateContextRequest, type CustomConnectionConfig, DEFAULT_MIGRATION_POLL_INTERVAL_MS, type ExecutionResult, INVITATION_PARAM, INVITATION_READY_MS, InvitationDialog, type InvitationDialogProps, type InvitationDialogStage, InvitationGate, type InvitationGateProps, type InviteRedemption, type InviteState, JOIN_ACTION, JOIN_SYNC_MAX_MS, JOIN_SYNC_POLL_MS, JOIN_SYNC_WATCHDOG_MS, type JoinInvitationInput, type JoinInvitationResult, type JoinInvitationStep, JoinSyncBanner, type JoinSyncBannerProps, type JoinSyncOptions, type JoinSyncState, LoginModal, type LoginModalProps, type LoginModalTab, MAX_AUTO_JOIN_ATTEMPTS, MERO_CSS_VARS, type MeroCapabilities, MeroContext, type MeroContextValue, MeroProvider, type MeroProviderConfig, type MeroProviderProps, type MeroTheme, MigrationAdminPanel, type MigrationAdminPanelProps, MigrationPendingBanner, type MigrationPendingBannerProps, type MutationOptions, type ParsedInvitation, type ResolvedMeroTheme, type SetMetadataInput, type SubscriptionEventData, type SubscriptionInput, type UseAccountEnrolmentOptions, type UseBlobUrlOptions, type UseDelegatedBootstrapOptions, type UseDelegatedBootstrapResult, type UseEphemeralOptions, type UseEphemeralResult, type UseInviteRedemptionOptions, buildInviteLink, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearNamespaceJustJoined, clearNodeUrl, clearTokenNodeUrl, cssVar, defaultMeroTheme, describeInviteFailure, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getPermissionsForMode, getTokenNodeUrl, invitationFromRaw, isDesktopWindow, isFinalInvitationError, isNamespaceJustJoined, isReturningFromWallet, localStorageTokenStorage, markNamespaceJustJoined, onInvitation, peekInvitation, primeInvitationCapture, resetInvitationCaptureForTests, resolveMeroTheme, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, subscribeInvitation, subscribeJustJoined, themeToCssVars, urlWithoutInvitation, 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, useInviteRedemption, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useJoinSync, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaceIdentity, useNamespaces, useNamespacesForApplication, useNodeIdentity, usePendingInvitation, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ function styleInject(css, { insertAt } = {}) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
// src/components/styles.css
|
|
31
|
-
styleInject(':root {\n --mero-bg: #0d1117;\n --mero-bg-secondary: #161b22;\n --mero-bg-tertiary: #1c2128;\n --mero-text: #e6edf3;\n --mero-text-secondary: #8b949e;\n --mero-accent: #a5ff11;\n --mero-accent-hover: #8ed40d;\n --mero-on-primary: #0d1117;\n --mero-error: #ff6b6b;\n --mero-border: #30363d;\n --mero-disabled: #555555;\n --mero-shadow: rgba(0, 0, 0, 0.5);\n --mero-overlay: rgba(0, 0, 0, 0.75);\n --mero-radius: 8px;\n}\n.mero-connect-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 10px 20px;\n background-color: var(--mero-accent);\n border: 1px solid var(--mero-accent);\n border-radius: var(--mero-radius);\n cursor: pointer;\n font-size: 14px;\n font-weight: 600;\n letter-spacing: 0.01em;\n color: var(--mero-on-primary);\n transition:\n background-color 0.15s ease,\n border-color 0.15s ease,\n box-shadow 0.15s ease,\n transform 0.1s ease;\n min-width: 140px;\n box-sizing: border-box;\n font-family:\n "Inter",\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n Oxygen,\n Ubuntu,\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n line-height: 1;\n}\n.mero-connect-button:hover:not(.mero-connected):not(.mero-reconnecting) {\n background-color: var(--mero-accent-hover);\n border-color: var(--mero-accent-hover);\n box-shadow: 0 0 0 4px rgba(165, 255, 17, 0.18);\n box-shadow: 0 0 0 4px color-mix(in srgb, var(--mero-accent) 18%, transparent);\n}\n.mero-connect-button:active:not(.mero-connected):not(.mero-reconnecting) {\n transform: translateY(1px);\n}\n.mero-connect-button:focus-visible {\n outline: none;\n box-shadow: 0 0 0 3px rgba(165, 255, 17, 0.45);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mero-accent) 45%, transparent);\n}\n.mero-connect-button.mero-logo-only {\n min-width: 0;\n width: 40px;\n height: 40px;\n padding: 0;\n gap: 0;\n}\n.mero-connect-button.mero-connected {\n background-color: var(--mero-accent);\n color: var(--mero-on-primary);\n border-color: var(--mero-accent);\n}\n.mero-connect-button.mero-connected:hover {\n background-color: var(--mero-accent-hover);\n border-color: var(--mero-accent-hover);\n}\n.mero-connect-button.mero-reconnecting {\n background-color: var(--mero-bg-secondary);\n color: var(--mero-text-secondary);\n border-color: var(--mero-border);\n cursor: not-allowed;\n}\n.mero-connect-container {\n position: relative;\n display: inline-block;\n}\n.mero-dropdown {\n position: absolute;\n top: 100%;\n left: 0;\n background-color: var(--mero-bg-secondary);\n border: 1px solid var(--mero-border);\n border-radius: var(--mero-radius);\n margin-top: 6px;\n padding: 0;\n z-index: 1001;\n width: 100%;\n min-width: 180px;\n overflow: hidden;\n box-shadow: 0 8px 24px var(--mero-shadow);\n}\n.mero-dropdown-info {\n padding: 10px 16px;\n color: var(--mero-text-secondary);\n font-size: 13px;\n border-bottom: 1px solid var(--mero-border);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 220px;\n}\n.mero-dropdown-item {\n display: block;\n width: 100%;\n padding: 10px 16px;\n background: none;\n border: none;\n color: var(--mero-text);\n text-align: left;\n cursor: pointer;\n font-size: 14px;\n text-decoration: none;\n font-family: inherit;\n}\n.mero-dropdown-item:hover {\n background-color: var(--mero-accent);\n color: var(--mero-on-primary);\n}\n.mero-logo {\n width: 24px;\n height: 24px;\n color: currentColor;\n}\n@keyframes meroFadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes meroSlideIn {\n from {\n transform: translateY(-12px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n@keyframes meroSpin {\n to {\n transform: rotate(360deg);\n }\n}\n.mero-invite-overlay {\n position: fixed;\n inset: 0;\n z-index: 2147483646;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 16px;\n background: var(--mero-overlay);\n font-family:\n "Inter",\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n Oxygen,\n Ubuntu,\n sans-serif;\n -webkit-font-smoothing: antialiased;\n}\n.mero-invite-dialog {\n box-sizing: border-box;\n width: min(420px, 100%);\n padding: 24px;\n border: 1px solid var(--mero-border);\n border-radius: calc(var(--mero-radius) * 1.5);\n background: var(--mero-bg-secondary);\n color: var(--mero-text);\n box-shadow: 0 16px 48px var(--mero-shadow);\n outline: none;\n animation: mero-invite-in 0.16s ease-out;\n}\n.mero-invite-app {\n margin: 0 0 12px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--mero-text-secondary);\n}\n.mero-invite-head {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n.mero-invite-title {\n margin: 0;\n min-width: 0;\n font-size: 18px;\n font-weight: 600;\n line-height: 1.3;\n overflow-wrap: anywhere;\n}\n.mero-invite-body {\n margin: 12px 0 0;\n font-size: 14px;\n line-height: 1.5;\n color: var(--mero-text-secondary);\n}\n.mero-invite-body-error {\n color: var(--mero-error);\n}\n.mero-invite-icon {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border-radius: 50%;\n background: var(--mero-bg-tertiary);\n color: var(--mero-accent);\n}\n.mero-invite-icon-error {\n color: var(--mero-error);\n}\n.mero-invite-spinner {\n box-sizing: border-box;\n width: 36px;\n height: 36px;\n border: 3px solid var(--mero-bg-tertiary);\n border-top-color: var(--mero-accent);\n background: none;\n animation: mero-invite-spin 0.8s linear infinite;\n}\n.mero-invite-progress {\n position: relative;\n height: 3px;\n margin-top: 16px;\n overflow: hidden;\n border-radius: 2px;\n background: var(--mero-bg-tertiary);\n}\n.mero-invite-progress-bar {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 40%;\n border-radius: 2px;\n background: var(--mero-accent);\n animation: mero-invite-progress 1.4s ease-in-out infinite;\n}\n.mero-invite-actions {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 20px;\n}\n.mero-invite-actions:empty {\n display: none;\n}\n.mero-invite-button {\n padding: 9px 16px;\n border-radius: var(--mero-radius);\n font: inherit;\n font-size: 14px;\n font-weight: 600;\n line-height: 1.2;\n cursor: pointer;\n transition: background-color 0.15s ease, border-color 0.15s ease;\n}\n.mero-invite-button:focus-visible {\n outline: 2px solid var(--mero-accent);\n outline-offset: 2px;\n}\n.mero-invite-primary {\n border: 1px solid var(--mero-accent);\n background: var(--mero-accent);\n color: var(--mero-on-primary);\n}\n.mero-invite-primary:hover {\n border-color: var(--mero-accent-hover);\n background: var(--mero-accent-hover);\n}\n.mero-invite-secondary {\n border: 1px solid var(--mero-border);\n background: transparent;\n color: var(--mero-text);\n}\n.mero-invite-secondary:hover {\n background: var(--mero-bg-tertiary);\n}\n@keyframes mero-invite-spin {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes mero-invite-progress {\n from {\n left: -40%;\n }\n to {\n left: 100%;\n }\n}\n@keyframes mero-invite-in {\n from {\n opacity: 0;\n transform: translateY(6px) scale(0.98);\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .mero-invite-dialog,\n .mero-invite-spinner,\n .mero-invite-progress-bar {\n animation: none;\n }\n}\n');
|
|
31
|
+
styleInject(':root {\n --mero-bg: #0d1117;\n --mero-bg-secondary: #161b22;\n --mero-bg-tertiary: #1c2128;\n --mero-text: #e6edf3;\n --mero-text-secondary: #8b949e;\n --mero-accent: #a5ff11;\n --mero-accent-hover: #8ed40d;\n --mero-on-primary: #0d1117;\n --mero-error: #ff6b6b;\n --mero-border: #30363d;\n --mero-disabled: #555555;\n --mero-shadow: rgba(0, 0, 0, 0.5);\n --mero-overlay: rgba(0, 0, 0, 0.75);\n --mero-radius: 8px;\n}\n.mero-connect-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 10px 20px;\n background-color: var(--mero-accent);\n border: 1px solid var(--mero-accent);\n border-radius: var(--mero-radius);\n cursor: pointer;\n font-size: 14px;\n font-weight: 600;\n letter-spacing: 0.01em;\n color: var(--mero-on-primary);\n transition:\n background-color 0.15s ease,\n border-color 0.15s ease,\n box-shadow 0.15s ease,\n transform 0.1s ease;\n min-width: 140px;\n box-sizing: border-box;\n font-family:\n "Inter",\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n Oxygen,\n Ubuntu,\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n line-height: 1;\n}\n.mero-connect-button:hover:not(.mero-connected):not(.mero-reconnecting) {\n background-color: var(--mero-accent-hover);\n border-color: var(--mero-accent-hover);\n box-shadow: 0 0 0 4px rgba(165, 255, 17, 0.18);\n box-shadow: 0 0 0 4px color-mix(in srgb, var(--mero-accent) 18%, transparent);\n}\n.mero-connect-button:active:not(.mero-connected):not(.mero-reconnecting) {\n transform: translateY(1px);\n}\n.mero-connect-button:focus-visible {\n outline: none;\n box-shadow: 0 0 0 3px rgba(165, 255, 17, 0.45);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mero-accent) 45%, transparent);\n}\n.mero-connect-button.mero-logo-only {\n min-width: 0;\n width: 40px;\n height: 40px;\n padding: 0;\n gap: 0;\n}\n.mero-connect-button.mero-connected {\n background-color: var(--mero-accent);\n color: var(--mero-on-primary);\n border-color: var(--mero-accent);\n}\n.mero-connect-button.mero-connected:hover {\n background-color: var(--mero-accent-hover);\n border-color: var(--mero-accent-hover);\n}\n.mero-connect-button.mero-reconnecting {\n background-color: var(--mero-bg-secondary);\n color: var(--mero-text-secondary);\n border-color: var(--mero-border);\n cursor: not-allowed;\n}\n.mero-connect-container {\n position: relative;\n display: inline-block;\n}\n.mero-dropdown {\n position: absolute;\n top: 100%;\n left: 0;\n background-color: var(--mero-bg-secondary);\n border: 1px solid var(--mero-border);\n border-radius: var(--mero-radius);\n margin-top: 6px;\n padding: 0;\n z-index: 1001;\n width: 100%;\n min-width: 180px;\n overflow: hidden;\n box-shadow: 0 8px 24px var(--mero-shadow);\n}\n.mero-dropdown-info {\n padding: 10px 16px;\n color: var(--mero-text-secondary);\n font-size: 13px;\n border-bottom: 1px solid var(--mero-border);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 220px;\n}\n.mero-dropdown-item {\n display: block;\n width: 100%;\n padding: 10px 16px;\n background: none;\n border: none;\n color: var(--mero-text);\n text-align: left;\n cursor: pointer;\n font-size: 14px;\n text-decoration: none;\n font-family: inherit;\n}\n.mero-dropdown-item:hover {\n background-color: var(--mero-accent);\n color: var(--mero-on-primary);\n}\n.mero-logo {\n width: 24px;\n height: 24px;\n color: currentColor;\n}\n@keyframes meroFadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes meroSlideIn {\n from {\n transform: translateY(-12px);\n opacity: 0;\n }\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n@keyframes meroSpin {\n to {\n transform: rotate(360deg);\n }\n}\n.mero-invite-overlay {\n position: fixed;\n inset: 0;\n z-index: 2147483646;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 16px;\n background: var(--mero-overlay);\n font-family:\n "Inter",\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n Oxygen,\n Ubuntu,\n sans-serif;\n -webkit-font-smoothing: antialiased;\n}\n.mero-invite-dialog {\n box-sizing: border-box;\n width: min(420px, 100%);\n padding: 24px;\n border: 1px solid var(--mero-border);\n border-radius: calc(var(--mero-radius) * 1.5);\n background: var(--mero-bg-secondary);\n color: var(--mero-text);\n box-shadow: 0 16px 48px var(--mero-shadow);\n outline: none;\n animation: mero-invite-in 0.16s ease-out;\n}\n.mero-invite-app {\n margin: 0 0 12px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--mero-text-secondary);\n}\n.mero-invite-head {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n.mero-invite-title {\n margin: 0;\n min-width: 0;\n font-size: 18px;\n font-weight: 600;\n line-height: 1.3;\n overflow-wrap: anywhere;\n}\n.mero-invite-body {\n margin: 12px 0 0;\n font-size: 14px;\n line-height: 1.5;\n color: var(--mero-text-secondary);\n}\n.mero-invite-body-error {\n color: var(--mero-error);\n}\n.mero-invite-icon {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border-radius: 50%;\n background: var(--mero-bg-tertiary);\n color: var(--mero-accent);\n}\n.mero-invite-icon-error {\n color: var(--mero-error);\n}\n.mero-invite-spinner {\n box-sizing: border-box;\n width: 36px;\n height: 36px;\n border: 3px solid var(--mero-bg-tertiary);\n border-top-color: var(--mero-accent);\n background: none;\n animation: mero-invite-spin 0.8s linear infinite;\n}\n.mero-invite-progress {\n position: relative;\n height: 3px;\n margin-top: 16px;\n overflow: hidden;\n border-radius: 2px;\n background: var(--mero-bg-tertiary);\n}\n.mero-invite-progress-bar {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 40%;\n border-radius: 2px;\n background: var(--mero-accent);\n animation: mero-invite-progress 1.4s ease-in-out infinite;\n}\n.mero-invite-actions {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: 8px;\n margin-top: 20px;\n}\n.mero-invite-actions:empty {\n display: none;\n}\n.mero-invite-button {\n padding: 9px 16px;\n border-radius: var(--mero-radius);\n font: inherit;\n font-size: 14px;\n font-weight: 600;\n line-height: 1.2;\n cursor: pointer;\n transition: background-color 0.15s ease, border-color 0.15s ease;\n}\n.mero-invite-button:focus-visible {\n outline: 2px solid var(--mero-accent);\n outline-offset: 2px;\n}\n.mero-invite-primary {\n border: 1px solid var(--mero-accent);\n background: var(--mero-accent);\n color: var(--mero-on-primary);\n}\n.mero-invite-primary:hover {\n border-color: var(--mero-accent-hover);\n background: var(--mero-accent-hover);\n}\n.mero-invite-secondary {\n border: 1px solid var(--mero-border);\n background: transparent;\n color: var(--mero-text);\n}\n.mero-invite-secondary:hover {\n background: var(--mero-bg-tertiary);\n}\n.mero-invite-landing {\n position: fixed;\n inset: 0;\n z-index: 9999;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 16px;\n overflow-y: auto;\n background: var(--mero-bg);\n color: var(--mero-text);\n font-family:\n "Inter",\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n Oxygen,\n Ubuntu,\n sans-serif;\n -webkit-font-smoothing: antialiased;\n}\n.mero-invite-landing-card {\n width: min(460px, 100%);\n}\n.mero-invite-landing-card .mero-invite-title {\n font-size: 22px;\n}\n.mero-invite-landing-login {\n display: inline-flex;\n}\n.mero-invite-landing-login .mero-connect-button {\n min-width: 0;\n padding: 9px 16px;\n line-height: 1.2;\n}\n@keyframes mero-invite-spin {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes mero-invite-progress {\n from {\n left: -40%;\n }\n to {\n left: 100%;\n }\n}\n@keyframes mero-invite-in {\n from {\n opacity: 0;\n transform: translateY(6px) scale(0.98);\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .mero-invite-dialog,\n .mero-invite-spinner,\n .mero-invite-progress-bar {\n animation: none;\n }\n}\n');
|
|
32
32
|
|
|
33
33
|
// src/types.ts
|
|
34
34
|
var AppMode = /* @__PURE__ */ ((AppMode2) => {
|
|
@@ -4051,6 +4051,10 @@ function buildInviteLink(slug, token, extra = {}) {
|
|
|
4051
4051
|
}
|
|
4052
4052
|
return createLink(slug, JOIN_ACTION, params);
|
|
4053
4053
|
}
|
|
4054
|
+
var watchers = /* @__PURE__ */ new Set();
|
|
4055
|
+
function notifyWatchers() {
|
|
4056
|
+
for (const watcher of watchers) watcher();
|
|
4057
|
+
}
|
|
4054
4058
|
var MAX_AUTO_JOIN_ATTEMPTS = 3;
|
|
4055
4059
|
var listeners = /* @__PURE__ */ new Set();
|
|
4056
4060
|
var buffered = null;
|
|
@@ -4136,6 +4140,7 @@ function urlWithoutInvitation(href) {
|
|
|
4136
4140
|
}
|
|
4137
4141
|
function deliver(invitation) {
|
|
4138
4142
|
current = invitation;
|
|
4143
|
+
notifyWatchers();
|
|
4139
4144
|
if (listeners.size === 0) {
|
|
4140
4145
|
buffered = invitation;
|
|
4141
4146
|
return;
|
|
@@ -4174,8 +4179,12 @@ function ensureController() {
|
|
|
4174
4179
|
params: { ...intent.params, [INVITATION_PARAM]: token },
|
|
4175
4180
|
resolve: () => {
|
|
4176
4181
|
forgetAttempts(token);
|
|
4177
|
-
if (
|
|
4182
|
+
if (buffered?.token === token) buffered = null;
|
|
4178
4183
|
intent.resolve();
|
|
4184
|
+
if (current?.token === token) {
|
|
4185
|
+
current = null;
|
|
4186
|
+
notifyWatchers();
|
|
4187
|
+
}
|
|
4179
4188
|
},
|
|
4180
4189
|
autoJoin: spendAttempt(token)
|
|
4181
4190
|
});
|
|
@@ -4203,6 +4212,13 @@ function peekInvitation() {
|
|
|
4203
4212
|
ensureController();
|
|
4204
4213
|
return current;
|
|
4205
4214
|
}
|
|
4215
|
+
function subscribeInvitation(watcher) {
|
|
4216
|
+
ensureController();
|
|
4217
|
+
watchers.add(watcher);
|
|
4218
|
+
return () => {
|
|
4219
|
+
watchers.delete(watcher);
|
|
4220
|
+
};
|
|
4221
|
+
}
|
|
4206
4222
|
function resetInvitationCaptureForTests() {
|
|
4207
4223
|
controller?.dispose();
|
|
4208
4224
|
controller = null;
|
|
@@ -4211,6 +4227,7 @@ function resetInvitationCaptureForTests() {
|
|
|
4211
4227
|
current = null;
|
|
4212
4228
|
attemptsKey = "calimero:invitation-attempts";
|
|
4213
4229
|
ownSlugs = /* @__PURE__ */ new Set();
|
|
4230
|
+
notifyWatchers();
|
|
4214
4231
|
}
|
|
4215
4232
|
|
|
4216
4233
|
// src/invitations/describeInviteFailure.ts
|
|
@@ -4824,6 +4841,165 @@ function Spinner() {
|
|
|
4824
4841
|
}
|
|
4825
4842
|
);
|
|
4826
4843
|
}
|
|
4844
|
+
function usePendingInvitation() {
|
|
4845
|
+
return useSyncExternalStore(subscribeInvitation, peekInvitation, () => null);
|
|
4846
|
+
}
|
|
4847
|
+
function InvitationGate({
|
|
4848
|
+
children,
|
|
4849
|
+
parse,
|
|
4850
|
+
noun = "team",
|
|
4851
|
+
appName,
|
|
4852
|
+
detail,
|
|
4853
|
+
connectButtonProps
|
|
4854
|
+
}) {
|
|
4855
|
+
const session = useContext(MeroContext);
|
|
4856
|
+
const pending = usePendingInvitation();
|
|
4857
|
+
const parsed = useMemo(() => {
|
|
4858
|
+
if (!pending || !parse) return null;
|
|
4859
|
+
try {
|
|
4860
|
+
const result = parse(pending.token, pending.params);
|
|
4861
|
+
return result?.namespaceId ? result : void 0;
|
|
4862
|
+
} catch {
|
|
4863
|
+
return void 0;
|
|
4864
|
+
}
|
|
4865
|
+
}, [pending, parse]);
|
|
4866
|
+
const state = !pending || !session || session.isAuthenticated ? null : session.isLoading ? "checking" : parsed === void 0 ? "invalid" : "invited";
|
|
4867
|
+
if (!state) return children === void 0 ? null : /* @__PURE__ */ jsx(Fragment, { children });
|
|
4868
|
+
const page = /* @__PURE__ */ jsx(
|
|
4869
|
+
InvitationScreen,
|
|
4870
|
+
{
|
|
4871
|
+
state,
|
|
4872
|
+
teamName: parsed?.teamName,
|
|
4873
|
+
noun,
|
|
4874
|
+
appName,
|
|
4875
|
+
detail,
|
|
4876
|
+
connectButtonProps,
|
|
4877
|
+
onDecline: () => pending?.resolve()
|
|
4878
|
+
}
|
|
4879
|
+
);
|
|
4880
|
+
if (children !== void 0 || typeof document === "undefined") return page;
|
|
4881
|
+
return createPortal(page, document.body);
|
|
4882
|
+
}
|
|
4883
|
+
function InvitationScreen({
|
|
4884
|
+
state,
|
|
4885
|
+
teamName,
|
|
4886
|
+
noun,
|
|
4887
|
+
appName,
|
|
4888
|
+
detail,
|
|
4889
|
+
connectButtonProps,
|
|
4890
|
+
onDecline
|
|
4891
|
+
}) {
|
|
4892
|
+
const titleId = useId();
|
|
4893
|
+
const bodyId = useId();
|
|
4894
|
+
const cardRef = useRef(null);
|
|
4895
|
+
const loginRef = useRef(null);
|
|
4896
|
+
const continueRef = useRef(null);
|
|
4897
|
+
useEffect(() => {
|
|
4898
|
+
if (state === "checking") return;
|
|
4899
|
+
const target = state === "invited" ? loginRef.current?.querySelector("button") : continueRef.current;
|
|
4900
|
+
(target ?? cardRef.current)?.focus();
|
|
4901
|
+
}, [state]);
|
|
4902
|
+
const onKeyDown = (event) => {
|
|
4903
|
+
if (event.key !== "Tab" || !cardRef.current) return;
|
|
4904
|
+
const focusable = cardRef.current.querySelectorAll(
|
|
4905
|
+
'button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])'
|
|
4906
|
+
);
|
|
4907
|
+
if (focusable.length === 0) return;
|
|
4908
|
+
const first = focusable[0];
|
|
4909
|
+
const last = focusable[focusable.length - 1];
|
|
4910
|
+
if (event.shiftKey && document.activeElement === first) {
|
|
4911
|
+
event.preventDefault();
|
|
4912
|
+
last.focus();
|
|
4913
|
+
} else if (!event.shiftKey && document.activeElement === last) {
|
|
4914
|
+
event.preventDefault();
|
|
4915
|
+
first.focus();
|
|
4916
|
+
}
|
|
4917
|
+
};
|
|
4918
|
+
if (state === "checking") {
|
|
4919
|
+
return /* @__PURE__ */ jsx(
|
|
4920
|
+
"div",
|
|
4921
|
+
{
|
|
4922
|
+
className: "mero-invite-landing",
|
|
4923
|
+
role: "status",
|
|
4924
|
+
"aria-busy": "true",
|
|
4925
|
+
"aria-label": "Checking your session",
|
|
4926
|
+
"data-testid": "invite-landing",
|
|
4927
|
+
"data-state": "checking",
|
|
4928
|
+
children: /* @__PURE__ */ jsx("span", { className: "mero-invite-icon mero-invite-spinner", "aria-hidden": "true" })
|
|
4929
|
+
}
|
|
4930
|
+
);
|
|
4931
|
+
}
|
|
4932
|
+
const invalid = state === "invalid";
|
|
4933
|
+
const title = invalid ? "This invitation can't be read" : teamName ? `You're invited to join \u201C${teamName}\u201D` : `You're invited to join a ${noun}`;
|
|
4934
|
+
const where = appName ? ` in ${appName}` : "";
|
|
4935
|
+
const body = invalid ? "The link may have been cut short when it was shared. Ask whoever sent it for a new one." : `Someone sent you a link to join this ${noun}${where}. Log in to accept it; you'll be asked to confirm before you join.`;
|
|
4936
|
+
return /* @__PURE__ */ jsx("div", { className: "mero-invite-landing", children: /* @__PURE__ */ jsxs(
|
|
4937
|
+
"div",
|
|
4938
|
+
{
|
|
4939
|
+
ref: cardRef,
|
|
4940
|
+
className: "mero-invite-dialog mero-invite-landing-card",
|
|
4941
|
+
role: "dialog",
|
|
4942
|
+
"aria-modal": "true",
|
|
4943
|
+
"aria-labelledby": titleId,
|
|
4944
|
+
"aria-describedby": bodyId,
|
|
4945
|
+
tabIndex: -1,
|
|
4946
|
+
"data-testid": "invite-landing",
|
|
4947
|
+
"data-state": state,
|
|
4948
|
+
onKeyDown,
|
|
4949
|
+
children: [
|
|
4950
|
+
appName ? /* @__PURE__ */ jsx("p", { className: "mero-invite-app", children: appName }) : null,
|
|
4951
|
+
/* @__PURE__ */ jsxs("div", { className: "mero-invite-head", children: [
|
|
4952
|
+
/* @__PURE__ */ jsx(InviteIcon2, { error: invalid }),
|
|
4953
|
+
/* @__PURE__ */ jsx("h1", { id: titleId, className: "mero-invite-title", children: title })
|
|
4954
|
+
] }),
|
|
4955
|
+
/* @__PURE__ */ jsx("p", { id: bodyId, className: "mero-invite-body", children: body }),
|
|
4956
|
+
detail && !invalid ? /* @__PURE__ */ jsx("p", { className: "mero-invite-body", children: detail }) : null,
|
|
4957
|
+
/* @__PURE__ */ jsx("div", { className: "mero-invite-actions", children: invalid ? /* @__PURE__ */ jsx(
|
|
4958
|
+
"button",
|
|
4959
|
+
{
|
|
4960
|
+
ref: continueRef,
|
|
4961
|
+
type: "button",
|
|
4962
|
+
className: "mero-invite-button mero-invite-primary",
|
|
4963
|
+
onClick: onDecline,
|
|
4964
|
+
"data-testid": "invite-landing-decline",
|
|
4965
|
+
children: "Continue"
|
|
4966
|
+
}
|
|
4967
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4968
|
+
/* @__PURE__ */ jsx(
|
|
4969
|
+
"button",
|
|
4970
|
+
{
|
|
4971
|
+
type: "button",
|
|
4972
|
+
className: "mero-invite-button mero-invite-secondary",
|
|
4973
|
+
onClick: onDecline,
|
|
4974
|
+
"data-testid": "invite-landing-decline",
|
|
4975
|
+
children: "Not now"
|
|
4976
|
+
}
|
|
4977
|
+
),
|
|
4978
|
+
/* @__PURE__ */ jsx(
|
|
4979
|
+
"div",
|
|
4980
|
+
{
|
|
4981
|
+
ref: loginRef,
|
|
4982
|
+
className: "mero-invite-landing-login",
|
|
4983
|
+
"data-testid": "invite-landing-login",
|
|
4984
|
+
children: /* @__PURE__ */ jsx(ConnectButton, { ...connectButtonProps, label: "Log in to join" })
|
|
4985
|
+
}
|
|
4986
|
+
)
|
|
4987
|
+
] }) })
|
|
4988
|
+
]
|
|
4989
|
+
}
|
|
4990
|
+
) });
|
|
4991
|
+
}
|
|
4992
|
+
function InviteIcon2({ error }) {
|
|
4993
|
+
const path = error ? "M12 7v6m0 4h.01" : "M4 7l8 6 8-6M5 6h14a1 1 0 011 1v10a1 1 0 01-1 1H5a1 1 0 01-1-1V7a1 1 0 011-1z";
|
|
4994
|
+
return /* @__PURE__ */ jsx(
|
|
4995
|
+
"span",
|
|
4996
|
+
{
|
|
4997
|
+
className: error ? "mero-invite-icon mero-invite-icon-error" : "mero-invite-icon",
|
|
4998
|
+
"aria-hidden": "true",
|
|
4999
|
+
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "18", height: "18", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: path }) })
|
|
5000
|
+
}
|
|
5001
|
+
);
|
|
5002
|
+
}
|
|
4827
5003
|
function statusOf(err) {
|
|
4828
5004
|
if (!err || typeof err !== "object") return void 0;
|
|
4829
5005
|
const e = err;
|
|
@@ -4934,6 +5110,6 @@ function useJoinInvitation() {
|
|
|
4934
5110
|
return { joinInvitation, joining, memberships, invitationRedeemer };
|
|
4935
5111
|
}
|
|
4936
5112
|
|
|
4937
|
-
export { AccountSignInPanel, AppMode, CalimeroLogo, ConnectButton, ConnectButtonAccount, ConnectionType, DEFAULT_MIGRATION_POLL_INTERVAL_MS, INVITATION_PARAM, INVITATION_READY_MS, InvitationDialog, JOIN_ACTION, JOIN_SYNC_MAX_MS, JOIN_SYNC_POLL_MS, JOIN_SYNC_WATCHDOG_MS, JoinSyncBanner, LoginModal, MAX_AUTO_JOIN_ATTEMPTS, MERO_CSS_VARS, MeroContext, MeroProvider, MigrationAdminPanel, MigrationPendingBanner, buildInviteLink, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearNamespaceJustJoined, clearNodeUrl, clearTokenNodeUrl, cssVar, defaultMeroTheme, describeInviteFailure, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getPermissionsForMode, getTokenNodeUrl, invitationFromRaw, isDesktopWindow, isFinalInvitationError, isNamespaceJustJoined, isReturningFromWallet, localStorageTokenStorage, markNamespaceJustJoined, onInvitation, peekInvitation, primeInvitationCapture, resetInvitationCaptureForTests, resolveMeroTheme, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, subscribeJustJoined, themeToCssVars, urlWithoutInvitation, 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, useInviteRedemption, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useJoinSync, 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 };
|
|
5113
|
+
export { AccountSignInPanel, AppMode, CalimeroLogo, ConnectButton, ConnectButtonAccount, ConnectionType, DEFAULT_MIGRATION_POLL_INTERVAL_MS, INVITATION_PARAM, INVITATION_READY_MS, InvitationDialog, InvitationGate, JOIN_ACTION, JOIN_SYNC_MAX_MS, JOIN_SYNC_POLL_MS, JOIN_SYNC_WATCHDOG_MS, JoinSyncBanner, LoginModal, MAX_AUTO_JOIN_ATTEMPTS, MERO_CSS_VARS, MeroContext, MeroProvider, MigrationAdminPanel, MigrationPendingBanner, buildInviteLink, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearNamespaceJustJoined, clearNodeUrl, clearTokenNodeUrl, cssVar, defaultMeroTheme, describeInviteFailure, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getPermissionsForMode, getTokenNodeUrl, invitationFromRaw, isDesktopWindow, isFinalInvitationError, isNamespaceJustJoined, isReturningFromWallet, localStorageTokenStorage, markNamespaceJustJoined, onInvitation, peekInvitation, primeInvitationCapture, resetInvitationCaptureForTests, resolveMeroTheme, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, subscribeInvitation, subscribeJustJoined, themeToCssVars, urlWithoutInvitation, 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, useInviteRedemption, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useJoinSync, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaceIdentity, useNamespaces, useNamespacesForApplication, useNodeIdentity, usePendingInvitation, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
|
|
4938
5114
|
//# sourceMappingURL=index.js.map
|
|
4939
5115
|
//# sourceMappingURL=index.js.map
|