@clerk/react 6.0.0-snapshot.v20251204175016 → 6.0.0-snapshot.v20251211120550
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/{chunk-2XN2S2YH.mjs → chunk-4F7CSI4T.mjs} +2 -2
- package/dist/{chunk-PS5BRRRD.mjs → chunk-J32KHXBI.mjs} +1 -1
- package/dist/{chunk-PS5BRRRD.mjs.map → chunk-J32KHXBI.mjs.map} +1 -1
- package/dist/{chunk-ZXC453V5.mjs → chunk-YKGYOPLG.mjs} +27 -5
- package/dist/chunk-YKGYOPLG.mjs.map +1 -0
- package/dist/experimental.d.mts +4 -4
- package/dist/experimental.d.ts +4 -4
- package/dist/experimental.js +25 -2
- package/dist/experimental.js.map +1 -1
- package/dist/experimental.mjs +4 -2
- package/dist/experimental.mjs.map +1 -1
- package/dist/index.d.mts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +44 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -4
- package/dist/index.mjs.map +1 -1
- package/dist/internal.d.mts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js.map +1 -1
- package/dist/internal.mjs +2 -2
- package/dist/{types-Bjumu7Zt.d.mts → types-C7pBea4d.d.mts} +2 -2
- package/dist/{types-Bjumu7Zt.d.ts → types-C7pBea4d.d.ts} +2 -2
- package/dist/{useAuth-C6dUCIl3.d.mts → useAuth-CWdoLXfj.d.mts} +2 -2
- package/dist/{useAuth-hGxwSzMQ.d.ts → useAuth-D6F79Q4u.d.ts} +2 -2
- package/package.json +4 -4
- package/dist/chunk-ZXC453V5.mjs.map +0 -1
- /package/dist/{chunk-2XN2S2YH.mjs.map → chunk-4F7CSI4T.mjs.map} +0 -0
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal.ts","../src/errors/errorThrower.ts","../src/components/controlComponents.tsx","../src/contexts/IsomorphicClerkContext.tsx","../src/contexts/SessionContext.tsx","../src/hooks/useAuth.ts","../src/contexts/AuthContext.ts","../src/errors/messages.ts","../src/hooks/useAssertWrappedByClerkProvider.ts","../src/hooks/useEmailLink.ts","../src/hooks/useClerkSignal.ts","../src/hooks/index.ts","../src/components/withClerk.tsx","../src/hooks/useRoutingProps.ts"],"sourcesContent":["export { setErrorThrowerOptions } from './errors/errorThrower';\nexport { MultisessionAppSupport } from './components/controlComponents';\nexport { useRoutingProps } from './hooks/useRoutingProps';\nexport { useDerivedAuth } from './hooks/useAuth';\n\nexport {\n clerkJsScriptUrl,\n buildClerkJsScriptAttributes,\n clerkUiScriptUrl,\n buildClerkUiScriptAttributes,\n setClerkJsLoadingErrorPackageName,\n} from '@clerk/shared/loadClerkJsScript';\n\nexport type { Ui } from '@clerk/ui/internal';\n","import type { ErrorThrowerOptions } from '@clerk/shared/error';\nimport { buildErrorThrower } from '@clerk/shared/error';\n\nconst errorThrower = buildErrorThrower({ packageName: '@clerk/react' });\n\nexport { errorThrower };\n\n/**\n * Overrides options of the internal errorThrower (eg setting packageName prefix).\n *\n * @internal\n */\nexport function setErrorThrowerOptions(options: ErrorThrowerOptions) {\n errorThrower.setMessages(options).setPackageName(options);\n}\n","import { deprecated } from '@clerk/shared/deprecated';\nimport type {\n HandleOAuthCallbackParams,\n PendingSessionOptions,\n ProtectProps as _ProtectProps,\n} from '@clerk/shared/types';\nimport React from 'react';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useSessionContext } from '../contexts/SessionContext';\nimport { useAuth } from '../hooks';\nimport { useAssertWrappedByClerkProvider } from '../hooks/useAssertWrappedByClerkProvider';\nimport type { RedirectToSignInProps, RedirectToSignUpProps, RedirectToTasksProps, WithClerkProp } from '../types';\nimport { withClerk } from './withClerk';\n\nexport const SignedIn = ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => {\n useAssertWrappedByClerkProvider('SignedIn');\n\n const { userId } = useAuth({ treatPendingAsSignedOut });\n if (userId) {\n return children;\n }\n return null;\n};\n\nexport const SignedOut = ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => {\n useAssertWrappedByClerkProvider('SignedOut');\n\n const { userId } = useAuth({ treatPendingAsSignedOut });\n if (userId === null) {\n return children;\n }\n return null;\n};\n\nexport const ClerkLoaded = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkLoaded');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (!isomorphicClerk.loaded) {\n return null;\n }\n return children;\n};\n\nexport const ClerkLoading = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkLoading');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'loading') {\n return null;\n }\n return children;\n};\n\nexport const ClerkFailed = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkFailed');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'error') {\n return null;\n }\n return children;\n};\n\nexport const ClerkDegraded = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkDegraded');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'degraded') {\n return null;\n }\n return children;\n};\n\nexport type ProtectProps = React.PropsWithChildren<\n _ProtectProps & {\n fallback?: React.ReactNode;\n } & PendingSessionOptions\n>;\n\n/**\n * Use `<Protect/>` in order to prevent unauthenticated or unauthorized users from accessing the children passed to the component.\n *\n * Examples:\n * ```\n * <Protect permission=\"a_permission_key\" />\n * <Protect role=\"a_role_key\" />\n * <Protect condition={(has) => has({permission:\"a_permission_key\"})} />\n * <Protect condition={(has) => has({role:\"a_role_key\"})} />\n * <Protect fallback={<p>Unauthorized</p>} />\n * ```\n */\nexport const Protect = ({ children, fallback, treatPendingAsSignedOut, ...restAuthorizedParams }: ProtectProps) => {\n useAssertWrappedByClerkProvider('Protect');\n\n const { isLoaded, has, userId } = useAuth({ treatPendingAsSignedOut });\n\n /**\n * Avoid flickering children or fallback while clerk is loading sessionId or userId\n */\n if (!isLoaded) {\n return null;\n }\n\n /**\n * Fallback to UI provided by user or `null` if authorization checks failed\n */\n const unauthorized = fallback ?? null;\n\n const authorized = children;\n\n if (!userId) {\n return unauthorized;\n }\n\n /**\n * Check against the results of `has` called inside the callback\n */\n if (typeof restAuthorizedParams.condition === 'function') {\n if (restAuthorizedParams.condition(has)) {\n return authorized;\n }\n return unauthorized;\n }\n\n if (\n restAuthorizedParams.role ||\n restAuthorizedParams.permission ||\n restAuthorizedParams.feature ||\n restAuthorizedParams.plan\n ) {\n if (has(restAuthorizedParams)) {\n return authorized;\n }\n return unauthorized;\n }\n\n /**\n * If neither of the authorization params are passed behave as the `<SignedIn/>`.\n * If fallback is present render that instead of rendering nothing.\n */\n return authorized;\n};\n\nexport const RedirectToSignIn = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToSignInProps>) => {\n const { client, session } = clerk;\n\n const hasSignedInSessions = (client.signedInSessions?.length ?? 0) > 0;\n\n React.useEffect(() => {\n if (session === null && hasSignedInSessions) {\n void clerk.redirectToAfterSignOut();\n } else {\n void clerk.redirectToSignIn(props);\n }\n }, []);\n\n return null;\n}, 'RedirectToSignIn');\n\nexport const RedirectToSignUp = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToSignUpProps>) => {\n React.useEffect(() => {\n void clerk.redirectToSignUp(props);\n }, []);\n\n return null;\n}, 'RedirectToSignUp');\n\nexport const RedirectToTasks = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToTasksProps>) => {\n React.useEffect(() => {\n void clerk.redirectToTasks(props);\n }, []);\n\n return null;\n}, 'RedirectToTasks');\n\n/**\n * @function\n * @deprecated Use [`redirectToUserProfile()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-user-profile) instead.\n */\nexport const RedirectToUserProfile = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToUserProfile', 'Use the `redirectToUserProfile()` method instead.');\n void clerk.redirectToUserProfile();\n }, []);\n\n return null;\n}, 'RedirectToUserProfile');\n\n/**\n * @function\n * @deprecated Use [`redirectToOrganizationProfile()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-organization-profile) instead.\n */\nexport const RedirectToOrganizationProfile = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToOrganizationProfile', 'Use the `redirectToOrganizationProfile()` method instead.');\n void clerk.redirectToOrganizationProfile();\n }, []);\n\n return null;\n}, 'RedirectToOrganizationProfile');\n\n/**\n * @function\n * @deprecated Use [`redirectToCreateOrganization()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-create-organization) instead.\n */\nexport const RedirectToCreateOrganization = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToCreateOrganization', 'Use the `redirectToCreateOrganization()` method instead.');\n void clerk.redirectToCreateOrganization();\n }, []);\n\n return null;\n}, 'RedirectToCreateOrganization');\n\nexport const AuthenticateWithRedirectCallback = withClerk(\n ({ clerk, ...handleRedirectCallbackParams }: WithClerkProp<HandleOAuthCallbackParams>) => {\n React.useEffect(() => {\n void clerk.handleRedirectCallback(handleRedirectCallbackParams);\n }, []);\n\n return null;\n },\n 'AuthenticateWithRedirectCallback',\n);\n\nexport const MultisessionAppSupport = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('MultisessionAppSupport');\n\n const session = useSessionContext();\n return <React.Fragment key={session ? session.id : 'no-users'}>{children}</React.Fragment>;\n};\n","import { ClerkInstanceContext, useClerkInstanceContext } from '@clerk/shared/react';\n\nimport type { IsomorphicClerk } from '../isomorphicClerk';\n\nexport const IsomorphicClerkContext = ClerkInstanceContext;\nexport const useIsomorphicClerkContext = useClerkInstanceContext as unknown as () => IsomorphicClerk;\n","export { SessionContext, useSessionContext } from '@clerk/shared/react';\n","import { createCheckAuthorization, resolveAuthState } from '@clerk/shared/authorization';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type {\n CheckAuthorizationWithCustomPermissions,\n GetToken,\n JwtPayload,\n PendingSessionOptions,\n SignOut,\n UseAuthReturn,\n} from '@clerk/shared/types';\nimport { useCallback } from 'react';\n\nimport { useAuthContext } from '../contexts/AuthContext';\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { errorThrower } from '../errors/errorThrower';\nimport { invalidStateError } from '../errors/messages';\nimport { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvider';\nimport { createGetToken, createSignOut } from './utils';\n\n/**\n * @inline\n */\ntype UseAuthOptions = Record<string, any> | PendingSessionOptions | undefined | null;\n\n/**\n * The `useAuth()` hook provides access to the current user's authentication state and methods to manage the active session.\n *\n * > [!NOTE]\n * > To access auth data server-side, see the [`Auth` object reference doc](https://clerk.com/docs/reference/backend/types/auth-object).\n *\n * <If sdk=\"nextjs\">\n * By default, Next.js opts all routes into static rendering. If you need to opt a route or routes into dynamic rendering because you need to access the authentication data at request time, you can create a boundary by passing the `dynamic` prop to `<ClerkProvider>`. See the [guide on rendering modes](https://clerk.com/docs/guides/development/rendering-modes) for more information, including code examples.\n * </If>\n *\n * @unionReturnHeadings\n * [\"Initialization\", \"Signed out\", \"Signed in (no active organization)\", \"Signed in (with active organization)\"]\n *\n * @param [initialAuthStateOrOptions] - An object containing the initial authentication state or options for the `useAuth()` hook. If not provided, the hook will attempt to derive the state from the context. `treatPendingAsSignedOut` is a boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`.\n *\n * @function\n *\n * @example\n *\n * The following example demonstrates how to use the `useAuth()` hook to access the current auth state, like whether the user is signed in or not. It also includes a basic example for using the `getToken()` method to retrieve a session token for fetching data from an external resource.\n *\n * <Tabs items='React,Next.js'>\n * <Tab>\n *\n * ```tsx {{ filename: 'src/pages/ExternalDataPage.tsx' }}\n * import { useAuth } from '@clerk/react'\n *\n * export default function ExternalDataPage() {\n * const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth()\n *\n * const fetchExternalData = async () => {\n * const token = await getToken()\n *\n * // Fetch data from an external API\n * const response = await fetch('https://api.example.com/data', {\n * headers: {\n * Authorization: `Bearer ${token}`,\n * },\n * })\n *\n * return response.json()\n * }\n *\n * if (!isLoaded) {\n * return <div>Loading...</div>\n * }\n *\n * if (!isSignedIn) {\n * return <div>Sign in to view this page</div>\n * }\n *\n * return (\n * <div>\n * <p>\n * Hello, {userId}! Your current active session is {sessionId}.\n * </p>\n * <button onClick={fetchExternalData}>Fetch Data</button>\n * </div>\n * )\n * }\n * ```\n *\n * </Tab>\n * <Tab>\n *\n * {@include ../../docs/use-auth.md#nextjs-01}\n *\n * </Tab>\n * </Tabs>\n */\nexport const useAuth = (initialAuthStateOrOptions: UseAuthOptions = {}): UseAuthReturn => {\n useAssertWrappedByClerkProvider('useAuth');\n\n const { treatPendingAsSignedOut, ...rest } = initialAuthStateOrOptions ?? {};\n const initialAuthState = rest as any;\n\n const authContextFromHook = useAuthContext();\n let authContext = authContextFromHook;\n\n if (authContext.sessionId === undefined && authContext.userId === undefined) {\n authContext = initialAuthState != null ? initialAuthState : {};\n }\n\n const isomorphicClerk = useIsomorphicClerkContext();\n const getToken: GetToken = useCallback(createGetToken(isomorphicClerk), [isomorphicClerk]);\n const signOut: SignOut = useCallback(createSignOut(isomorphicClerk), [isomorphicClerk]);\n\n isomorphicClerk.telemetry?.record(eventMethodCalled('useAuth', { treatPendingAsSignedOut }));\n\n return useDerivedAuth(\n {\n ...authContext,\n getToken,\n signOut,\n },\n {\n treatPendingAsSignedOut,\n },\n );\n};\n\n/**\n * A hook that derives and returns authentication state and utility functions based on the provided auth object.\n *\n * @param authObject - An object containing authentication-related properties and functions.\n *\n * @returns A derived authentication state with helper methods. If the authentication state is invalid, an error is thrown.\n *\n * @remarks\n * This hook inspects session, user, and organization information to determine the current authentication state.\n * It returns an object that includes various properties such as whether the state is loaded, if a user is signed in,\n * session and user identifiers, organization roles, and a `has` function for authorization checks.\n * Additionally, it provides `signOut` and `getToken` functions if applicable.\n *\n * @example\n * ```tsx\n * const {\n * isLoaded,\n * isSignedIn,\n * userId,\n * orgId,\n * has,\n * signOut,\n * getToken\n * } = useDerivedAuth(authObject);\n * ```\n */\nexport function useDerivedAuth(\n authObject: any,\n { treatPendingAsSignedOut = true }: PendingSessionOptions = {},\n): UseAuthReturn {\n const { userId, orgId, orgRole, has, signOut, getToken, orgPermissions, factorVerificationAge, sessionClaims } =\n authObject ?? {};\n\n const derivedHas = useCallback(\n (params: Parameters<CheckAuthorizationWithCustomPermissions>[0]) => {\n if (has) {\n return has(params);\n }\n return createCheckAuthorization({\n userId,\n orgId,\n orgRole,\n orgPermissions,\n factorVerificationAge,\n features: ((sessionClaims as JwtPayload | undefined)?.fea as string) || '',\n plans: ((sessionClaims as JwtPayload | undefined)?.pla as string) || '',\n })(params);\n },\n [has, userId, orgId, orgRole, orgPermissions, factorVerificationAge, sessionClaims],\n );\n\n const payload = resolveAuthState({\n authObject: {\n ...authObject,\n getToken,\n signOut,\n has: derivedHas,\n },\n options: {\n treatPendingAsSignedOut,\n },\n });\n\n if (!payload) {\n return errorThrower.throw(invalidStateError);\n }\n\n return payload;\n}\n","import { createContextAndHook } from '@clerk/shared/react';\nimport type {\n ActClaim,\n JwtPayload,\n OrganizationCustomPermissionKey,\n OrganizationCustomRoleKey,\n SessionStatusClaim,\n} from '@clerk/shared/types';\n\nexport type AuthContextValue = {\n userId: string | null | undefined;\n sessionId: string | null | undefined;\n sessionStatus: SessionStatusClaim | null | undefined;\n sessionClaims: JwtPayload | null | undefined;\n actor: ActClaim | null | undefined;\n orgId: string | null | undefined;\n orgRole: OrganizationCustomRoleKey | null | undefined;\n orgSlug: string | null | undefined;\n orgPermissions: OrganizationCustomPermissionKey[] | null | undefined;\n factorVerificationAge: [number, number] | null;\n};\n\nexport const [AuthContext, useAuthContext] = createContextAndHook<AuthContextValue>('AuthContext');\n","export const noClerkProviderError = 'You must wrap your application in a <ClerkProvider> component.';\n\nexport const multipleClerkProvidersError =\n \"You've added multiple <ClerkProvider> components in your React component tree. Wrap your components in a single <ClerkProvider>.\";\n\nexport const multipleChildrenInButtonComponent = (name: string) =>\n `You've passed multiple children components to <${name}/>. You can only pass a single child component or text.`;\n\nexport const invalidStateError =\n 'Invalid state. Feel free to submit a bug or reach out to support here: https://clerk.com/support';\n\nexport const unsupportedNonBrowserDomainOrProxyUrlFunction =\n 'Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.';\n\nexport const userProfilePageRenderedError =\n '<UserProfile.Page /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.';\nexport const userProfileLinkRenderedError =\n '<UserProfile.Link /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.';\n\nexport const organizationProfilePageRenderedError =\n '<OrganizationProfile.Page /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.';\nexport const organizationProfileLinkRenderedError =\n '<OrganizationProfile.Link /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.';\n\nexport const customPagesIgnoredComponent = (componentName: string) =>\n `<${componentName} /> can only accept <${componentName}.Page /> and <${componentName}.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`;\n\nexport const customPageWrongProps = (componentName: string) =>\n `Missing props. <${componentName}.Page /> component requires the following props: url, label, labelIcon, alongside with children to be rendered inside the page.`;\n\nexport const customLinkWrongProps = (componentName: string) =>\n `Missing props. <${componentName}.Link /> component requires the following props: url, label and labelIcon.`;\n\nexport const useAuthHasRequiresRoleOrPermission =\n 'Missing parameters. `has` from `useAuth` requires a permission or role key to be passed. Example usage: `has({permission: \"org:posts:edit\"`';\n\nexport const noPathProvidedError = (componentName: string) =>\n `The <${componentName}/> component uses path-based routing by default unless a different routing strategy is provided using the \\`routing\\` prop. When path-based routing is used, you need to provide the path where the component is mounted on by using the \\`path\\` prop. Example: <${componentName} path={'/my-path'} />`;\n\nexport const incompatibleRoutingWithPathProvidedError = (componentName: string) =>\n `The \\`path\\` prop will only be respected when the Clerk component uses path-based routing. To resolve this error, pass \\`routing='path'\\` to the <${componentName}/> component, or drop the \\`path\\` prop to switch to hash-based routing. For more details please refer to our docs: https://clerk.com/docs`;\n\nexport const userButtonIgnoredComponent = `<UserButton /> can only accept <UserButton.UserProfilePage />, <UserButton.UserProfileLink /> and <UserButton.MenuItems /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`;\n\nexport const customMenuItemsIgnoredComponent =\n '<UserButton.MenuItems /> component can only accept <UserButton.Action /> and <UserButton.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.';\n\nexport const userButtonMenuItemsRenderedError =\n '<UserButton.MenuItems /> component needs to be a direct child of `<UserButton />`.';\n\nexport const userButtonMenuActionRenderedError =\n '<UserButton.Action /> component needs to be a direct child of `<UserButton.MenuItems />`.';\n\nexport const userButtonMenuLinkRenderedError =\n '<UserButton.Link /> component needs to be a direct child of `<UserButton.MenuItems />`.';\n\nexport const userButtonMenuItemLinkWrongProps =\n 'Missing props. <UserButton.Link /> component requires the following props: href, label and labelIcon.';\n\nexport const userButtonMenuItemsActionWrongsProps =\n 'Missing props. <UserButton.Action /> component requires the following props: label.';\n","import { useAssertWrappedByClerkProvider as useSharedAssertWrappedByClerkProvider } from '@clerk/shared/react';\n\nimport { errorThrower } from '../errors/errorThrower';\n\nexport const useAssertWrappedByClerkProvider = (source: string): void => {\n useSharedAssertWrappedByClerkProvider(() => {\n errorThrower.throwMissingClerkProviderError({ source });\n });\n};\n","import type {\n CreateEmailLinkFlowReturn,\n EmailAddressResource,\n SignInResource,\n SignInStartEmailLinkFlowParams,\n SignUpResource,\n StartEmailLinkFlowParams,\n} from '@clerk/shared/types';\nimport React from 'react';\n\ntype EmailLinkable = SignUpResource | EmailAddressResource | SignInResource;\ntype UseEmailLinkSignInReturn = CreateEmailLinkFlowReturn<SignInStartEmailLinkFlowParams, SignInResource>;\ntype UseEmailLinkSignUpReturn = CreateEmailLinkFlowReturn<StartEmailLinkFlowParams, SignUpResource>;\ntype UseEmailLinkEmailAddressReturn = CreateEmailLinkFlowReturn<StartEmailLinkFlowParams, EmailAddressResource>;\n\nfunction useEmailLink(resource: SignInResource): UseEmailLinkSignInReturn;\nfunction useEmailLink(resource: SignUpResource): UseEmailLinkSignUpReturn;\nfunction useEmailLink(resource: EmailAddressResource): UseEmailLinkEmailAddressReturn;\nfunction useEmailLink(\n resource: EmailLinkable,\n): UseEmailLinkSignInReturn | UseEmailLinkSignUpReturn | UseEmailLinkEmailAddressReturn {\n const { startEmailLinkFlow, cancelEmailLinkFlow } = React.useMemo(() => resource.createEmailLinkFlow(), [resource]);\n\n React.useEffect(() => {\n return cancelEmailLinkFlow;\n }, []);\n\n return {\n startEmailLinkFlow,\n cancelEmailLinkFlow,\n } as UseEmailLinkSignInReturn | UseEmailLinkSignUpReturn | UseEmailLinkEmailAddressReturn;\n}\n\nexport { useEmailLink };\n","import { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type { SignInSignalValue, SignUpSignalValue } from '@clerk/shared/types';\nimport { useCallback, useSyncExternalStore } from 'react';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvider';\n\nfunction useClerkSignal(signal: 'signIn'): SignInSignalValue;\nfunction useClerkSignal(signal: 'signUp'): SignUpSignalValue;\nfunction useClerkSignal(signal: 'signIn' | 'signUp'): SignInSignalValue | SignUpSignalValue {\n useAssertWrappedByClerkProvider('useClerkSignal');\n\n const clerk = useIsomorphicClerkContext();\n\n switch (signal) {\n case 'signIn':\n clerk.telemetry?.record(eventMethodCalled('useSignIn', { apiVersion: '2025-11' }));\n break;\n case 'signUp':\n clerk.telemetry?.record(eventMethodCalled('useSignUp', { apiVersion: '2025-11' }));\n break;\n default:\n break;\n }\n\n const subscribe = useCallback(\n (callback: () => void) => {\n if (!clerk.loaded) {\n return () => {};\n }\n\n return clerk.__internal_state.__internal_effect(() => {\n switch (signal) {\n case 'signIn':\n clerk.__internal_state.signInSignal();\n break;\n case 'signUp':\n clerk.__internal_state.signUpSignal();\n break;\n default:\n throw new Error(`Unknown signal: ${signal}`);\n }\n callback();\n });\n },\n [clerk, clerk.loaded, clerk.__internal_state],\n );\n const getSnapshot = useCallback(() => {\n switch (signal) {\n case 'signIn':\n return clerk.__internal_state.signInSignal() as SignInSignalValue;\n case 'signUp':\n return clerk.__internal_state.signUpSignal() as SignUpSignalValue;\n default:\n throw new Error(`Unknown signal: ${signal}`);\n }\n }, [clerk.__internal_state]);\n\n const value = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n\n return value;\n}\n\n/**\n * This hook allows you to access the Signal-based `SignIn` resource.\n *\n * @example\n * import { useSignInSignal } from \"@clerk/react/experimental\";\n *\n * function SignInForm() {\n * const { signIn, errors, fetchStatus } = useSignInSignal();\n * //\n * }\n *\n * @experimental This experimental API is subject to change.\n */\nexport function useSignIn() {\n return useClerkSignal('signIn');\n}\n\n/**\n * This hook allows you to access the Signal-based `SignUp` resource.\n *\n * @example\n * import { useSignUpSignal } from \"@clerk/react/experimental\";\n *\n * function SignUpForm() {\n * const { signUp, errors, fetchStatus } = useSignUpSignal();\n * //\n * }\n *\n * @experimental This experimental API is subject to change.\n */\nexport function useSignUp() {\n return useClerkSignal('signUp');\n}\n","export { useAuth } from './useAuth';\nexport { useEmailLink } from './useEmailLink';\nexport { useSignIn, useSignUp } from './useClerkSignal';\nexport {\n useClerk,\n useOrganization,\n useOrganizationList,\n useSessionList,\n useUser,\n useSession,\n useReverification,\n __experimental_useCheckout,\n __experimental_CheckoutProvider,\n __experimental_usePaymentElement,\n __experimental_PaymentElementProvider,\n __experimental_PaymentElement,\n} from '@clerk/shared/react';\n","import type { LoadedClerk, Without } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from '../hooks/useAssertWrappedByClerkProvider';\n\nexport const withClerk = <P extends { clerk: LoadedClerk; component?: string }>(\n Component: React.ComponentType<P>,\n displayNameOrOptions?: string | { component: string; renderWhileLoading?: boolean },\n) => {\n const passedDisplayedName =\n typeof displayNameOrOptions === 'string' ? displayNameOrOptions : displayNameOrOptions?.component;\n const displayName = passedDisplayedName || Component.displayName || Component.name || 'Component';\n Component.displayName = displayName;\n\n const options = typeof displayNameOrOptions === 'string' ? undefined : displayNameOrOptions;\n\n const HOC = (props: Without<P, 'clerk'>) => {\n useAssertWrappedByClerkProvider(displayName || 'withClerk');\n\n const clerk = useIsomorphicClerkContext();\n\n if (!clerk.loaded && !options?.renderWhileLoading) {\n return null;\n }\n\n return (\n <Component\n {...(props as P)}\n component={displayName}\n clerk={clerk}\n />\n );\n };\n HOC.displayName = `withClerk(${displayName})`;\n return HOC;\n};\n","import type { RoutingOptions } from '@clerk/shared/types';\n\nimport { errorThrower } from '../errors/errorThrower';\nimport { incompatibleRoutingWithPathProvidedError, noPathProvidedError } from '../errors/messages';\n\nexport function useRoutingProps<T extends RoutingOptions>(\n componentName: string,\n props: T,\n routingOptions?: RoutingOptions,\n): T {\n const path = props.path || routingOptions?.path;\n const routing = props.routing || routingOptions?.routing || 'path';\n\n if (routing === 'path') {\n if (!path) {\n return errorThrower.throw(noPathProvidedError(componentName));\n }\n\n return {\n ...routingOptions,\n ...props,\n routing: 'path',\n };\n }\n\n if (props.path) {\n return errorThrower.throw(incompatibleRoutingWithPathProvidedError(componentName));\n }\n\n return {\n ...routingOptions,\n ...props,\n path: undefined,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,mBAAkC;AAElC,IAAM,mBAAe,gCAAkB,EAAE,aAAa,eAAe,CAAC;AAS/D,SAAS,uBAAuB,SAA8B;AACnE,eAAa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,+BAAAA,QAAA,cAAC,eAAAA,QAAM,UAAN,EAAe,KAAK,UAAU,QAAQ,KAAK,cAAa,QAAS;AAC3E;;;AWnOO,SAAS,gBACd,eACA,OACA,gBACG;AACH,QAAM,OAAO,MAAM,SAAQ,iDAAgB;AAC3C,QAAM,UAAU,MAAM,YAAW,iDAAgB,YAAW;AAE5D,MAAI,YAAY,QAAQ;AACtB,QAAI,CAAC,MAAM;AACT,aAAO,aAAa,MAAM,oBAAoB,aAAa,CAAC;AAAA,IAC9D;AAEA,WAAO;AAAA,MACL,GAAG;AAAA,MACH,GAAG;AAAA,MACH,SAAS;AAAA,IACX;AAAA,EACF;AAEA,MAAI,MAAM,MAAM;AACd,WAAO,aAAa,MAAM,yCAAyC,aAAa,CAAC;AAAA,EACnF;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,IACH,MAAM;AAAA,EACR;AACF;;;Ab7BA,+BAMO;","names":["import_react","import_react","import_react","import_react","import_react","useSharedAssertWrappedByClerkProvider","import_react","import_telemetry","import_react","import_react","import_react","React","React"]}
|
|
1
|
+
{"version":3,"sources":["../src/internal.ts","../src/errors/errorThrower.ts","../src/components/controlComponents.tsx","../src/contexts/IsomorphicClerkContext.tsx","../src/contexts/SessionContext.tsx","../src/hooks/useAuth.ts","../src/contexts/AuthContext.ts","../src/errors/messages.ts","../src/hooks/useAssertWrappedByClerkProvider.ts","../src/hooks/useEmailLink.ts","../src/hooks/useClerkSignal.ts","../src/hooks/index.ts","../src/components/withClerk.tsx","../src/hooks/useRoutingProps.ts"],"sourcesContent":["export { setErrorThrowerOptions } from './errors/errorThrower';\nexport { MultisessionAppSupport } from './components/controlComponents';\nexport { useRoutingProps } from './hooks/useRoutingProps';\nexport { useDerivedAuth } from './hooks/useAuth';\n\nexport {\n clerkJsScriptUrl,\n buildClerkJsScriptAttributes,\n clerkUiScriptUrl,\n buildClerkUiScriptAttributes,\n setClerkJsLoadingErrorPackageName,\n} from '@clerk/shared/loadClerkJsScript';\n\nexport type { Ui } from '@clerk/ui/internal';\n","import type { ErrorThrowerOptions } from '@clerk/shared/error';\nimport { buildErrorThrower } from '@clerk/shared/error';\n\nconst errorThrower = buildErrorThrower({ packageName: '@clerk/react' });\n\nexport { errorThrower };\n\n/**\n * Overrides options of the internal errorThrower (eg setting packageName prefix).\n *\n * @internal\n */\nexport function setErrorThrowerOptions(options: ErrorThrowerOptions) {\n errorThrower.setMessages(options).setPackageName(options);\n}\n","import { deprecated } from '@clerk/shared/deprecated';\nimport type {\n HandleOAuthCallbackParams,\n PendingSessionOptions,\n ProtectProps as _ProtectProps,\n} from '@clerk/shared/types';\nimport React from 'react';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useSessionContext } from '../contexts/SessionContext';\nimport { useAuth } from '../hooks';\nimport { useAssertWrappedByClerkProvider } from '../hooks/useAssertWrappedByClerkProvider';\nimport type { RedirectToSignInProps, RedirectToSignUpProps, RedirectToTasksProps, WithClerkProp } from '../types';\nimport { withClerk } from './withClerk';\n\nexport const SignedIn = ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => {\n useAssertWrappedByClerkProvider('SignedIn');\n\n const { userId } = useAuth({ treatPendingAsSignedOut });\n if (userId) {\n return children;\n }\n return null;\n};\n\nexport const SignedOut = ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => {\n useAssertWrappedByClerkProvider('SignedOut');\n\n const { userId } = useAuth({ treatPendingAsSignedOut });\n if (userId === null) {\n return children;\n }\n return null;\n};\n\nexport const ClerkLoaded = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkLoaded');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (!isomorphicClerk.loaded) {\n return null;\n }\n return children;\n};\n\nexport const ClerkLoading = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkLoading');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'loading') {\n return null;\n }\n return children;\n};\n\nexport const ClerkFailed = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkFailed');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'error') {\n return null;\n }\n return children;\n};\n\nexport const ClerkDegraded = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('ClerkDegraded');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n if (isomorphicClerk.status !== 'degraded') {\n return null;\n }\n return children;\n};\n\nexport type ProtectProps = React.PropsWithChildren<\n _ProtectProps & {\n fallback?: React.ReactNode;\n } & PendingSessionOptions\n>;\n\n/**\n * Use `<Protect/>` in order to prevent unauthenticated or unauthorized users from accessing the children passed to the component.\n *\n * Examples:\n * ```\n * <Protect permission=\"a_permission_key\" />\n * <Protect role=\"a_role_key\" />\n * <Protect condition={(has) => has({permission:\"a_permission_key\"})} />\n * <Protect condition={(has) => has({role:\"a_role_key\"})} />\n * <Protect fallback={<p>Unauthorized</p>} />\n * ```\n */\nexport const Protect = ({ children, fallback, treatPendingAsSignedOut, ...restAuthorizedParams }: ProtectProps) => {\n useAssertWrappedByClerkProvider('Protect');\n\n const { isLoaded, has, userId } = useAuth({ treatPendingAsSignedOut });\n\n /**\n * Avoid flickering children or fallback while clerk is loading sessionId or userId\n */\n if (!isLoaded) {\n return null;\n }\n\n /**\n * Fallback to UI provided by user or `null` if authorization checks failed\n */\n const unauthorized = fallback ?? null;\n\n const authorized = children;\n\n if (!userId) {\n return unauthorized;\n }\n\n /**\n * Check against the results of `has` called inside the callback\n */\n if (typeof restAuthorizedParams.condition === 'function') {\n if (restAuthorizedParams.condition(has)) {\n return authorized;\n }\n return unauthorized;\n }\n\n if (\n restAuthorizedParams.role ||\n restAuthorizedParams.permission ||\n restAuthorizedParams.feature ||\n restAuthorizedParams.plan\n ) {\n if (has(restAuthorizedParams)) {\n return authorized;\n }\n return unauthorized;\n }\n\n /**\n * If neither of the authorization params are passed behave as the `<SignedIn/>`.\n * If fallback is present render that instead of rendering nothing.\n */\n return authorized;\n};\n\nexport const RedirectToSignIn = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToSignInProps>) => {\n const { client, session } = clerk;\n\n const hasSignedInSessions = (client.signedInSessions?.length ?? 0) > 0;\n\n React.useEffect(() => {\n if (session === null && hasSignedInSessions) {\n void clerk.redirectToAfterSignOut();\n } else {\n void clerk.redirectToSignIn(props);\n }\n }, []);\n\n return null;\n}, 'RedirectToSignIn');\n\nexport const RedirectToSignUp = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToSignUpProps>) => {\n React.useEffect(() => {\n void clerk.redirectToSignUp(props);\n }, []);\n\n return null;\n}, 'RedirectToSignUp');\n\nexport const RedirectToTasks = withClerk(({ clerk, ...props }: WithClerkProp<RedirectToTasksProps>) => {\n React.useEffect(() => {\n void clerk.redirectToTasks(props);\n }, []);\n\n return null;\n}, 'RedirectToTasks');\n\n/**\n * @function\n * @deprecated Use [`redirectToUserProfile()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-user-profile) instead.\n */\nexport const RedirectToUserProfile = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToUserProfile', 'Use the `redirectToUserProfile()` method instead.');\n void clerk.redirectToUserProfile();\n }, []);\n\n return null;\n}, 'RedirectToUserProfile');\n\n/**\n * @function\n * @deprecated Use [`redirectToOrganizationProfile()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-organization-profile) instead.\n */\nexport const RedirectToOrganizationProfile = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToOrganizationProfile', 'Use the `redirectToOrganizationProfile()` method instead.');\n void clerk.redirectToOrganizationProfile();\n }, []);\n\n return null;\n}, 'RedirectToOrganizationProfile');\n\n/**\n * @function\n * @deprecated Use [`redirectToCreateOrganization()`](https://clerk.com/docs/reference/javascript/clerk#redirect-to-create-organization) instead.\n */\nexport const RedirectToCreateOrganization = withClerk(({ clerk }) => {\n React.useEffect(() => {\n deprecated('RedirectToCreateOrganization', 'Use the `redirectToCreateOrganization()` method instead.');\n void clerk.redirectToCreateOrganization();\n }, []);\n\n return null;\n}, 'RedirectToCreateOrganization');\n\nexport const AuthenticateWithRedirectCallback = withClerk(\n ({ clerk, ...handleRedirectCallbackParams }: WithClerkProp<HandleOAuthCallbackParams>) => {\n React.useEffect(() => {\n void clerk.handleRedirectCallback(handleRedirectCallbackParams);\n }, []);\n\n return null;\n },\n 'AuthenticateWithRedirectCallback',\n);\n\nexport const MultisessionAppSupport = ({ children }: React.PropsWithChildren<unknown>) => {\n useAssertWrappedByClerkProvider('MultisessionAppSupport');\n\n const session = useSessionContext();\n return <React.Fragment key={session ? session.id : 'no-users'}>{children}</React.Fragment>;\n};\n","import { ClerkInstanceContext, useClerkInstanceContext } from '@clerk/shared/react';\n\nimport type { IsomorphicClerk } from '../isomorphicClerk';\n\nexport const IsomorphicClerkContext = ClerkInstanceContext;\nexport const useIsomorphicClerkContext = useClerkInstanceContext as unknown as () => IsomorphicClerk;\n","export { SessionContext, useSessionContext } from '@clerk/shared/react';\n","import { createCheckAuthorization, resolveAuthState } from '@clerk/shared/authorization';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type {\n CheckAuthorizationWithCustomPermissions,\n GetToken,\n JwtPayload,\n PendingSessionOptions,\n SignOut,\n UseAuthReturn,\n} from '@clerk/shared/types';\nimport { useCallback } from 'react';\n\nimport { useAuthContext } from '../contexts/AuthContext';\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { errorThrower } from '../errors/errorThrower';\nimport { invalidStateError } from '../errors/messages';\nimport { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvider';\nimport { createGetToken, createSignOut } from './utils';\n\n/**\n * @inline\n */\ntype UseAuthOptions = Record<string, any> | PendingSessionOptions | undefined | null;\n\n/**\n * The `useAuth()` hook provides access to the current user's authentication state and methods to manage the active session.\n *\n * > [!NOTE]\n * > To access auth data server-side, see the [`Auth` object reference doc](https://clerk.com/docs/reference/backend/types/auth-object).\n *\n * <If sdk=\"nextjs\">\n * By default, Next.js opts all routes into static rendering. If you need to opt a route or routes into dynamic rendering because you need to access the authentication data at request time, you can create a boundary by passing the `dynamic` prop to `<ClerkProvider>`. See the [guide on rendering modes](https://clerk.com/docs/guides/development/rendering-modes) for more information, including code examples.\n * </If>\n *\n * @unionReturnHeadings\n * [\"Initialization\", \"Signed out\", \"Signed in (no active organization)\", \"Signed in (with active organization)\"]\n *\n * @param [initialAuthStateOrOptions] - An object containing the initial authentication state or options for the `useAuth()` hook. If not provided, the hook will attempt to derive the state from the context. `treatPendingAsSignedOut` is a boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`.\n *\n * @function\n *\n * @example\n *\n * The following example demonstrates how to use the `useAuth()` hook to access the current auth state, like whether the user is signed in or not. It also includes a basic example for using the `getToken()` method to retrieve a session token for fetching data from an external resource.\n *\n * <Tabs items='React,Next.js'>\n * <Tab>\n *\n * ```tsx {{ filename: 'src/pages/ExternalDataPage.tsx' }}\n * import { useAuth } from '@clerk/react'\n *\n * export default function ExternalDataPage() {\n * const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth()\n *\n * const fetchExternalData = async () => {\n * const token = await getToken()\n *\n * // Fetch data from an external API\n * const response = await fetch('https://api.example.com/data', {\n * headers: {\n * Authorization: `Bearer ${token}`,\n * },\n * })\n *\n * return response.json()\n * }\n *\n * if (!isLoaded) {\n * return <div>Loading...</div>\n * }\n *\n * if (!isSignedIn) {\n * return <div>Sign in to view this page</div>\n * }\n *\n * return (\n * <div>\n * <p>\n * Hello, {userId}! Your current active session is {sessionId}.\n * </p>\n * <button onClick={fetchExternalData}>Fetch Data</button>\n * </div>\n * )\n * }\n * ```\n *\n * </Tab>\n * <Tab>\n *\n * {@include ../../docs/use-auth.md#nextjs-01}\n *\n * </Tab>\n * </Tabs>\n */\nexport const useAuth = (initialAuthStateOrOptions: UseAuthOptions = {}): UseAuthReturn => {\n useAssertWrappedByClerkProvider('useAuth');\n\n const { treatPendingAsSignedOut, ...rest } = initialAuthStateOrOptions ?? {};\n const initialAuthState = rest as any;\n\n const authContextFromHook = useAuthContext();\n let authContext = authContextFromHook;\n\n if (authContext.sessionId === undefined && authContext.userId === undefined) {\n authContext = initialAuthState != null ? initialAuthState : {};\n }\n\n const isomorphicClerk = useIsomorphicClerkContext();\n const getToken: GetToken = useCallback(createGetToken(isomorphicClerk), [isomorphicClerk]);\n const signOut: SignOut = useCallback(createSignOut(isomorphicClerk), [isomorphicClerk]);\n\n isomorphicClerk.telemetry?.record(eventMethodCalled('useAuth', { treatPendingAsSignedOut }));\n\n return useDerivedAuth(\n {\n ...authContext,\n getToken,\n signOut,\n },\n {\n treatPendingAsSignedOut,\n },\n );\n};\n\n/**\n * A hook that derives and returns authentication state and utility functions based on the provided auth object.\n *\n * @param authObject - An object containing authentication-related properties and functions.\n *\n * @returns A derived authentication state with helper methods. If the authentication state is invalid, an error is thrown.\n *\n * @remarks\n * This hook inspects session, user, and organization information to determine the current authentication state.\n * It returns an object that includes various properties such as whether the state is loaded, if a user is signed in,\n * session and user identifiers, Organization Roles, and a `has` function for authorization checks.\n * Additionally, it provides `signOut` and `getToken` functions if applicable.\n *\n * @example\n * ```tsx\n * const {\n * isLoaded,\n * isSignedIn,\n * userId,\n * orgId,\n * has,\n * signOut,\n * getToken\n * } = useDerivedAuth(authObject);\n * ```\n */\nexport function useDerivedAuth(\n authObject: any,\n { treatPendingAsSignedOut = true }: PendingSessionOptions = {},\n): UseAuthReturn {\n const { userId, orgId, orgRole, has, signOut, getToken, orgPermissions, factorVerificationAge, sessionClaims } =\n authObject ?? {};\n\n const derivedHas = useCallback(\n (params: Parameters<CheckAuthorizationWithCustomPermissions>[0]) => {\n if (has) {\n return has(params);\n }\n return createCheckAuthorization({\n userId,\n orgId,\n orgRole,\n orgPermissions,\n factorVerificationAge,\n features: ((sessionClaims as JwtPayload | undefined)?.fea as string) || '',\n plans: ((sessionClaims as JwtPayload | undefined)?.pla as string) || '',\n })(params);\n },\n [has, userId, orgId, orgRole, orgPermissions, factorVerificationAge, sessionClaims],\n );\n\n const payload = resolveAuthState({\n authObject: {\n ...authObject,\n getToken,\n signOut,\n has: derivedHas,\n },\n options: {\n treatPendingAsSignedOut,\n },\n });\n\n if (!payload) {\n return errorThrower.throw(invalidStateError);\n }\n\n return payload;\n}\n","import { createContextAndHook } from '@clerk/shared/react';\nimport type {\n ActClaim,\n JwtPayload,\n OrganizationCustomPermissionKey,\n OrganizationCustomRoleKey,\n SessionStatusClaim,\n} from '@clerk/shared/types';\n\nexport type AuthContextValue = {\n userId: string | null | undefined;\n sessionId: string | null | undefined;\n sessionStatus: SessionStatusClaim | null | undefined;\n sessionClaims: JwtPayload | null | undefined;\n actor: ActClaim | null | undefined;\n orgId: string | null | undefined;\n orgRole: OrganizationCustomRoleKey | null | undefined;\n orgSlug: string | null | undefined;\n orgPermissions: OrganizationCustomPermissionKey[] | null | undefined;\n factorVerificationAge: [number, number] | null;\n};\n\nexport const [AuthContext, useAuthContext] = createContextAndHook<AuthContextValue>('AuthContext');\n","export const noClerkProviderError = 'You must wrap your application in a <ClerkProvider> component.';\n\nexport const multipleClerkProvidersError =\n \"You've added multiple <ClerkProvider> components in your React component tree. Wrap your components in a single <ClerkProvider>.\";\n\nexport const multipleChildrenInButtonComponent = (name: string) =>\n `You've passed multiple children components to <${name}/>. You can only pass a single child component or text.`;\n\nexport const invalidStateError =\n 'Invalid state. Feel free to submit a bug or reach out to support here: https://clerk.com/support';\n\nexport const unsupportedNonBrowserDomainOrProxyUrlFunction =\n 'Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.';\n\nexport const userProfilePageRenderedError =\n '<UserProfile.Page /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.';\nexport const userProfileLinkRenderedError =\n '<UserProfile.Link /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.';\n\nexport const organizationProfilePageRenderedError =\n '<OrganizationProfile.Page /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.';\nexport const organizationProfileLinkRenderedError =\n '<OrganizationProfile.Link /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.';\n\nexport const customPagesIgnoredComponent = (componentName: string) =>\n `<${componentName} /> can only accept <${componentName}.Page /> and <${componentName}.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`;\n\nexport const customPageWrongProps = (componentName: string) =>\n `Missing props. <${componentName}.Page /> component requires the following props: url, label, labelIcon, alongside with children to be rendered inside the page.`;\n\nexport const customLinkWrongProps = (componentName: string) =>\n `Missing props. <${componentName}.Link /> component requires the following props: url, label and labelIcon.`;\n\nexport const useAuthHasRequiresRoleOrPermission =\n 'Missing parameters. `has` from `useAuth` requires a permission or role key to be passed. Example usage: `has({permission: \"org:posts:edit\"`';\n\nexport const noPathProvidedError = (componentName: string) =>\n `The <${componentName}/> component uses path-based routing by default unless a different routing strategy is provided using the \\`routing\\` prop. When path-based routing is used, you need to provide the path where the component is mounted on by using the \\`path\\` prop. Example: <${componentName} path={'/my-path'} />`;\n\nexport const incompatibleRoutingWithPathProvidedError = (componentName: string) =>\n `The \\`path\\` prop will only be respected when the Clerk component uses path-based routing. To resolve this error, pass \\`routing='path'\\` to the <${componentName}/> component, or drop the \\`path\\` prop to switch to hash-based routing. For more details please refer to our docs: https://clerk.com/docs`;\n\nexport const userButtonIgnoredComponent = `<UserButton /> can only accept <UserButton.UserProfilePage />, <UserButton.UserProfileLink /> and <UserButton.MenuItems /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`;\n\nexport const customMenuItemsIgnoredComponent =\n '<UserButton.MenuItems /> component can only accept <UserButton.Action /> and <UserButton.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.';\n\nexport const userButtonMenuItemsRenderedError =\n '<UserButton.MenuItems /> component needs to be a direct child of `<UserButton />`.';\n\nexport const userButtonMenuActionRenderedError =\n '<UserButton.Action /> component needs to be a direct child of `<UserButton.MenuItems />`.';\n\nexport const userButtonMenuLinkRenderedError =\n '<UserButton.Link /> component needs to be a direct child of `<UserButton.MenuItems />`.';\n\nexport const userButtonMenuItemLinkWrongProps =\n 'Missing props. <UserButton.Link /> component requires the following props: href, label and labelIcon.';\n\nexport const userButtonMenuItemsActionWrongsProps =\n 'Missing props. <UserButton.Action /> component requires the following props: label.';\n","import { useAssertWrappedByClerkProvider as useSharedAssertWrappedByClerkProvider } from '@clerk/shared/react';\n\nimport { errorThrower } from '../errors/errorThrower';\n\nexport const useAssertWrappedByClerkProvider = (source: string): void => {\n useSharedAssertWrappedByClerkProvider(() => {\n errorThrower.throwMissingClerkProviderError({ source });\n });\n};\n","import type {\n CreateEmailLinkFlowReturn,\n EmailAddressResource,\n SignInResource,\n SignInStartEmailLinkFlowParams,\n SignUpResource,\n StartEmailLinkFlowParams,\n} from '@clerk/shared/types';\nimport React from 'react';\n\ntype EmailLinkable = SignUpResource | EmailAddressResource | SignInResource;\ntype UseEmailLinkSignInReturn = CreateEmailLinkFlowReturn<SignInStartEmailLinkFlowParams, SignInResource>;\ntype UseEmailLinkSignUpReturn = CreateEmailLinkFlowReturn<StartEmailLinkFlowParams, SignUpResource>;\ntype UseEmailLinkEmailAddressReturn = CreateEmailLinkFlowReturn<StartEmailLinkFlowParams, EmailAddressResource>;\n\nfunction useEmailLink(resource: SignInResource): UseEmailLinkSignInReturn;\nfunction useEmailLink(resource: SignUpResource): UseEmailLinkSignUpReturn;\nfunction useEmailLink(resource: EmailAddressResource): UseEmailLinkEmailAddressReturn;\nfunction useEmailLink(\n resource: EmailLinkable,\n): UseEmailLinkSignInReturn | UseEmailLinkSignUpReturn | UseEmailLinkEmailAddressReturn {\n const { startEmailLinkFlow, cancelEmailLinkFlow } = React.useMemo(() => resource.createEmailLinkFlow(), [resource]);\n\n React.useEffect(() => {\n return cancelEmailLinkFlow;\n }, []);\n\n return {\n startEmailLinkFlow,\n cancelEmailLinkFlow,\n } as UseEmailLinkSignInReturn | UseEmailLinkSignUpReturn | UseEmailLinkEmailAddressReturn;\n}\n\nexport { useEmailLink };\n","import { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type { SignInSignalValue, SignUpSignalValue } from '@clerk/shared/types';\nimport { useCallback, useSyncExternalStore } from 'react';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from './useAssertWrappedByClerkProvider';\n\nfunction useClerkSignal(signal: 'signIn'): SignInSignalValue;\nfunction useClerkSignal(signal: 'signUp'): SignUpSignalValue;\nfunction useClerkSignal(signal: 'signIn' | 'signUp'): SignInSignalValue | SignUpSignalValue {\n useAssertWrappedByClerkProvider('useClerkSignal');\n\n const clerk = useIsomorphicClerkContext();\n\n switch (signal) {\n case 'signIn':\n clerk.telemetry?.record(eventMethodCalled('useSignIn', { apiVersion: '2025-11' }));\n break;\n case 'signUp':\n clerk.telemetry?.record(eventMethodCalled('useSignUp', { apiVersion: '2025-11' }));\n break;\n default:\n break;\n }\n\n const subscribe = useCallback(\n (callback: () => void) => {\n if (!clerk.loaded) {\n return () => {};\n }\n\n return clerk.__internal_state.__internal_effect(() => {\n switch (signal) {\n case 'signIn':\n clerk.__internal_state.signInSignal();\n break;\n case 'signUp':\n clerk.__internal_state.signUpSignal();\n break;\n default:\n throw new Error(`Unknown signal: ${signal}`);\n }\n callback();\n });\n },\n [clerk, clerk.loaded, clerk.__internal_state],\n );\n const getSnapshot = useCallback(() => {\n switch (signal) {\n case 'signIn':\n return clerk.__internal_state.signInSignal() as SignInSignalValue;\n case 'signUp':\n return clerk.__internal_state.signUpSignal() as SignUpSignalValue;\n default:\n throw new Error(`Unknown signal: ${signal}`);\n }\n }, [clerk.__internal_state]);\n\n const value = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n\n return value;\n}\n\n/**\n * This hook allows you to access the Signal-based `SignIn` resource.\n *\n * @example\n * import { useSignInSignal } from \"@clerk/react/experimental\";\n *\n * function SignInForm() {\n * const { signIn, errors, fetchStatus } = useSignInSignal();\n * //\n * }\n *\n * @experimental This experimental API is subject to change.\n */\nexport function useSignIn() {\n return useClerkSignal('signIn');\n}\n\n/**\n * This hook allows you to access the Signal-based `SignUp` resource.\n *\n * @example\n * import { useSignUpSignal } from \"@clerk/react/experimental\";\n *\n * function SignUpForm() {\n * const { signUp, errors, fetchStatus } = useSignUpSignal();\n * //\n * }\n *\n * @experimental This experimental API is subject to change.\n */\nexport function useSignUp() {\n return useClerkSignal('signUp');\n}\n","export { useAuth } from './useAuth';\nexport { useEmailLink } from './useEmailLink';\nexport { useSignIn, useSignUp } from './useClerkSignal';\nexport {\n useClerk,\n useOrganization,\n useOrganizationList,\n useSessionList,\n useUser,\n useSession,\n useReverification,\n __experimental_useCheckout,\n __experimental_CheckoutProvider,\n __experimental_usePaymentElement,\n __experimental_PaymentElementProvider,\n __experimental_PaymentElement,\n} from '@clerk/shared/react';\n","import type { LoadedClerk, Without } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { useIsomorphicClerkContext } from '../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from '../hooks/useAssertWrappedByClerkProvider';\n\nexport const withClerk = <P extends { clerk: LoadedClerk; component?: string }>(\n Component: React.ComponentType<P>,\n displayNameOrOptions?: string | { component: string; renderWhileLoading?: boolean },\n) => {\n const passedDisplayedName =\n typeof displayNameOrOptions === 'string' ? displayNameOrOptions : displayNameOrOptions?.component;\n const displayName = passedDisplayedName || Component.displayName || Component.name || 'Component';\n Component.displayName = displayName;\n\n const options = typeof displayNameOrOptions === 'string' ? undefined : displayNameOrOptions;\n\n const HOC = (props: Without<P, 'clerk'>) => {\n useAssertWrappedByClerkProvider(displayName || 'withClerk');\n\n const clerk = useIsomorphicClerkContext();\n\n if (!clerk.loaded && !options?.renderWhileLoading) {\n return null;\n }\n\n return (\n <Component\n {...(props as P)}\n component={displayName}\n clerk={clerk}\n />\n );\n };\n HOC.displayName = `withClerk(${displayName})`;\n return HOC;\n};\n","import type { RoutingOptions } from '@clerk/shared/types';\n\nimport { errorThrower } from '../errors/errorThrower';\nimport { incompatibleRoutingWithPathProvidedError, noPathProvidedError } from '../errors/messages';\n\nexport function useRoutingProps<T extends RoutingOptions>(\n componentName: string,\n props: T,\n routingOptions?: RoutingOptions,\n): T {\n const path = props.path || routingOptions?.path;\n const routing = props.routing || routingOptions?.routing || 'path';\n\n if (routing === 'path') {\n if (!path) {\n return errorThrower.throw(noPathProvidedError(componentName));\n }\n\n return {\n ...routingOptions,\n ...props,\n routing: 'path',\n };\n }\n\n if (props.path) {\n return errorThrower.throw(incompatibleRoutingWithPathProvidedError(componentName));\n }\n\n return {\n ...routingOptions,\n ...props,\n path: undefined,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,mBAAkC;AAElC,IAAM,mBAAe,gCAAkB,EAAE,aAAa,eAAe,CAAC;AAS/D,SAAS,uBAAuB,SAA8B;AACnE,eAAa,YAAY,OAAO,EAAE,eAAe,OAAO;AAC1D;;;ACdA,wBAA2B;AAM3B,IAAAA,iBAAkB;;;ACNlB,mBAA8D;AAKvD,IAAM,4BAA4B;;;ACLzC,IAAAC,gBAAkD;;;ACAlD,2BAA2D;AAC3D,uBAAkC;AASlC,IAAAC,gBAA4B;;;ACV5B,IAAAC,gBAAqC;AAsB9B,IAAM,CAAC,aAAa,cAAc,QAAI,oCAAuC,aAAa;;;ACd1F,IAAM,oBACX;AA2BK,IAAM,sBAAsB,CAAC,kBAClC,QAAQ,aAAa,qQAAqQ,aAAa;AAElS,IAAM,2CAA2C,CAAC,kBACvD,qJAAqJ,aAAa;;;ACxCpK,IAAAC,gBAAyF;AAIlF,IAAM,kCAAkC,CAAC,WAA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C;AAAA,EACnF;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,IACH,MAAM;AAAA,EACR;AACF;;;Ab7BA,+BAMO;","names":["import_react","import_react","import_react","import_react","import_react","useSharedAssertWrappedByClerkProvider","import_react","import_telemetry","import_react","import_react","import_react","React","React"]}
|
package/dist/internal.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MultisessionAppSupport
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4F7CSI4T.mjs";
|
|
4
4
|
import {
|
|
5
5
|
incompatibleRoutingWithPathProvidedError,
|
|
6
6
|
noPathProvidedError,
|
|
7
7
|
useDerivedAuth
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-J32KHXBI.mjs";
|
|
9
9
|
import {
|
|
10
10
|
errorThrower,
|
|
11
11
|
setErrorThrowerOptions
|
|
@@ -54,13 +54,13 @@ type PageProps<T extends string> = {
|
|
|
54
54
|
url?: never;
|
|
55
55
|
labelIcon?: never;
|
|
56
56
|
};
|
|
57
|
-
type UserProfilePageProps = PageProps<'account' | 'security'>;
|
|
57
|
+
type UserProfilePageProps = PageProps<'account' | 'security' | 'billing' | 'apiKeys'>;
|
|
58
58
|
type UserProfileLinkProps = {
|
|
59
59
|
url: string;
|
|
60
60
|
label: string;
|
|
61
61
|
labelIcon: React.ReactNode;
|
|
62
62
|
};
|
|
63
|
-
type OrganizationProfilePageProps = PageProps<'general' | 'members'>;
|
|
63
|
+
type OrganizationProfilePageProps = PageProps<'general' | 'members' | 'billing' | 'apiKeys'>;
|
|
64
64
|
type OrganizationProfileLinkProps = UserProfileLinkProps;
|
|
65
65
|
type ButtonActionProps<T extends string> = {
|
|
66
66
|
label: string;
|
|
@@ -54,13 +54,13 @@ type PageProps<T extends string> = {
|
|
|
54
54
|
url?: never;
|
|
55
55
|
labelIcon?: never;
|
|
56
56
|
};
|
|
57
|
-
type UserProfilePageProps = PageProps<'account' | 'security'>;
|
|
57
|
+
type UserProfilePageProps = PageProps<'account' | 'security' | 'billing' | 'apiKeys'>;
|
|
58
58
|
type UserProfileLinkProps = {
|
|
59
59
|
url: string;
|
|
60
60
|
label: string;
|
|
61
61
|
labelIcon: React.ReactNode;
|
|
62
62
|
};
|
|
63
|
-
type OrganizationProfilePageProps = PageProps<'general' | 'members'>;
|
|
63
|
+
type OrganizationProfilePageProps = PageProps<'general' | 'members' | 'billing' | 'apiKeys'>;
|
|
64
64
|
type OrganizationProfileLinkProps = UserProfileLinkProps;
|
|
65
65
|
type ButtonActionProps<T extends string> = {
|
|
66
66
|
label: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _clerk_shared_types from '@clerk/shared/types';
|
|
2
2
|
import { HandleOAuthCallbackParams, ProtectProps as ProtectProps$1, PendingSessionOptions, UseAuthReturn } from '@clerk/shared/types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { W as WithClerkProp } from './types-
|
|
4
|
+
import { W as WithClerkProp } from './types-C7pBea4d.mjs';
|
|
5
5
|
|
|
6
6
|
declare const SignedIn: ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => React.ReactNode;
|
|
7
7
|
declare const SignedOut: ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => React.ReactNode;
|
|
@@ -161,7 +161,7 @@ declare const useAuth: (initialAuthStateOrOptions?: UseAuthOptions) => UseAuthRe
|
|
|
161
161
|
* @remarks
|
|
162
162
|
* This hook inspects session, user, and organization information to determine the current authentication state.
|
|
163
163
|
* It returns an object that includes various properties such as whether the state is loaded, if a user is signed in,
|
|
164
|
-
* session and user identifiers,
|
|
164
|
+
* session and user identifiers, Organization Roles, and a `has` function for authorization checks.
|
|
165
165
|
* Additionally, it provides `signOut` and `getToken` functions if applicable.
|
|
166
166
|
*
|
|
167
167
|
* @example
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _clerk_shared_types from '@clerk/shared/types';
|
|
2
2
|
import { HandleOAuthCallbackParams, ProtectProps as ProtectProps$1, PendingSessionOptions, UseAuthReturn } from '@clerk/shared/types';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { W as WithClerkProp } from './types-
|
|
4
|
+
import { W as WithClerkProp } from './types-C7pBea4d.js';
|
|
5
5
|
|
|
6
6
|
declare const SignedIn: ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => React.ReactNode;
|
|
7
7
|
declare const SignedOut: ({ children, treatPendingAsSignedOut }: React.PropsWithChildren<PendingSessionOptions>) => React.ReactNode;
|
|
@@ -161,7 +161,7 @@ declare const useAuth: (initialAuthStateOrOptions?: UseAuthOptions) => UseAuthRe
|
|
|
161
161
|
* @remarks
|
|
162
162
|
* This hook inspects session, user, and organization information to determine the current authentication state.
|
|
163
163
|
* It returns an object that includes various properties such as whether the state is loaded, if a user is signed in,
|
|
164
|
-
* session and user identifiers,
|
|
164
|
+
* session and user identifiers, Organization Roles, and a `has` function for authorization checks.
|
|
165
165
|
* Additionally, it provides `signOut` and `getToken` functions if applicable.
|
|
166
166
|
*
|
|
167
167
|
* @example
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerk/react",
|
|
3
|
-
"version": "6.0.0-snapshot.
|
|
3
|
+
"version": "6.0.0-snapshot.v20251211120550",
|
|
4
4
|
"description": "Clerk React library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"clerk",
|
|
@@ -81,12 +81,12 @@
|
|
|
81
81
|
],
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"tslib": "2.8.1",
|
|
84
|
-
"@clerk/shared": "
|
|
84
|
+
"@clerk/shared": "4.0.0-snapshot.v20251211120550"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/semver": "^7.7.1",
|
|
88
|
-
"@clerk/
|
|
89
|
-
"@clerk/
|
|
88
|
+
"@clerk/ui": "1.0.0-snapshot.v20251211120550",
|
|
89
|
+
"@clerk/localizations": "4.0.0-snapshot.v20251211120550"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"react": "^18.0.0 || ^19.0.0 || ^19.0.0-0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/uiComponents.tsx","../src/utils/childrenUtils.tsx","../src/utils/isConstructor.ts","../src/utils/useMaxAllowedInstancesGuard.tsx","../src/utils/useCustomElementPortal.tsx","../src/utils/useCustomPages.tsx","../src/utils/componentValidation.ts","../src/utils/useCustomMenuItems.tsx","../src/utils/useWaitForComponentMount.ts","../src/components/ClerkHostRenderer.tsx"],"sourcesContent":["import type {\n APIKeysProps,\n CreateOrganizationProps,\n GoogleOneTapProps,\n OrganizationListProps,\n OrganizationProfileProps,\n OrganizationSwitcherProps,\n PricingTableProps,\n SignInProps,\n SignUpProps,\n TaskChooseOrganizationProps,\n UserAvatarProps,\n UserButtonProps,\n UserProfileProps,\n WaitlistProps,\n Without,\n} from '@clerk/shared/types';\nimport { logErrorInDevMode } from '@clerk/shared/utils';\nimport type { PropsWithChildren, ReactNode } from 'react';\nimport React, { createContext, createElement, useContext } from 'react';\n\nimport {\n organizationProfileLinkRenderedError,\n organizationProfilePageRenderedError,\n userButtonMenuActionRenderedError,\n userButtonMenuItemsRenderedError,\n userButtonMenuLinkRenderedError,\n userProfileLinkRenderedError,\n userProfilePageRenderedError,\n} from '../errors/messages';\nimport type {\n CustomPortalsRendererProps,\n MountProps,\n OrganizationProfileLinkProps,\n OrganizationProfilePageProps,\n UserButtonActionProps,\n UserButtonLinkProps,\n UserProfileLinkProps,\n UserProfilePageProps,\n WithClerkProp,\n} from '../types';\nimport {\n useOrganizationProfileCustomPages,\n useSanitizedChildren,\n useUserButtonCustomMenuItems,\n useUserProfileCustomPages,\n} from '../utils';\nimport { useWaitForComponentMount } from '../utils/useWaitForComponentMount';\nimport { ClerkHostRenderer } from './ClerkHostRenderer';\nimport { withClerk } from './withClerk';\n\ntype FallbackProp = {\n /**\n * An optional element to render while the component is mounting.\n */\n fallback?: ReactNode;\n};\n\ntype UserProfileExportType = typeof _UserProfile & {\n Page: typeof UserProfilePage;\n Link: typeof UserProfileLink;\n};\n\ntype UserButtonExportType = typeof _UserButton & {\n UserProfilePage: typeof UserProfilePage;\n UserProfileLink: typeof UserProfileLink;\n MenuItems: typeof MenuItems;\n Action: typeof MenuAction;\n Link: typeof MenuLink;\n /**\n * The `<Outlet />` component can be used in conjunction with `asProvider` in order to control rendering\n * of the `<UserButton />` without affecting its configuration or any custom pages that could be mounted\n * @experimental This API is experimental and may change at any moment.\n */\n __experimental_Outlet: typeof UserButtonOutlet;\n};\n\ntype UserButtonPropsWithoutCustomPages = Without<\n UserButtonProps,\n 'userProfileProps' | '__experimental_asStandalone'\n> & {\n userProfileProps?: Pick<UserProfileProps, 'additionalOAuthScopes' | 'appearance' | 'apiKeysProps'>;\n /**\n * Adding `asProvider` will defer rendering until the `<Outlet />` component is mounted.\n *\n * @experimental This API is experimental and may change at any moment.\n * @default undefined\n */\n __experimental_asProvider?: boolean;\n};\n\ntype OrganizationProfileExportType = typeof _OrganizationProfile & {\n Page: typeof OrganizationProfilePage;\n Link: typeof OrganizationProfileLink;\n};\n\ntype OrganizationSwitcherExportType = typeof _OrganizationSwitcher & {\n OrganizationProfilePage: typeof OrganizationProfilePage;\n OrganizationProfileLink: typeof OrganizationProfileLink;\n /**\n * The `<Outlet />` component can be used in conjunction with `asProvider` in order to control rendering\n * of the `<OrganizationSwitcher />` without affecting its configuration or any custom pages that could be mounted\n *\n * @experimental This API is experimental and may change at any moment.\n */\n __experimental_Outlet: typeof OrganizationSwitcherOutlet;\n};\n\ntype OrganizationSwitcherPropsWithoutCustomPages = Without<\n OrganizationSwitcherProps,\n 'organizationProfileProps' | '__experimental_asStandalone'\n> & {\n organizationProfileProps?: Pick<OrganizationProfileProps, 'appearance'>;\n /**\n * Adding `asProvider` will defer rendering until the `<Outlet />` component is mounted.\n *\n * @experimental This API is experimental and may change at any moment.\n * @default undefined\n */\n __experimental_asProvider?: boolean;\n};\n\nconst CustomPortalsRenderer = (props: CustomPortalsRendererProps) => {\n return (\n <>\n {props?.customPagesPortals?.map((portal, index) => createElement(portal, { key: index }))}\n {props?.customMenuItemsPortals?.map((portal, index) => createElement(portal, { key: index }))}\n </>\n );\n};\n\nexport const SignIn = withClerk(\n ({ clerk, component, fallback, ...props }: WithClerkProp<SignInProps & FallbackProp>) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;\n\n const rendererRootProps = {\n ...(shouldShowFallback && fallback && { style: { display: 'none' } }),\n };\n\n return (\n <>\n {shouldShowFallback && fallback}\n {clerk.loaded && (\n <ClerkHostRenderer\n component={component}\n mount={clerk.mountSignIn}\n unmount={clerk.unmountSignIn}\n updateProps={(clerk as any).__internal_updateProps}\n props={props}\n rootProps={rendererRootProps}\n />\n )}\n </>\n );\n },\n { component: 'SignIn', renderWhileLoading: true },\n);\n\nexport const SignUp = withClerk(\n ({ clerk, component, fallback, ...props }: WithClerkProp<SignUpProps & FallbackProp>) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;\n\n const rendererRootProps = {\n ...(shouldShowFallback && fallback && { style: { display: 'none' } }),\n };\n\n return (\n <>\n {shouldShowFallback && fallback}\n {clerk.loaded && (\n <ClerkHostRenderer\n component={component}\n mount={clerk.mountSignUp}\n unmount={clerk.unmountSignUp}\n updateProps={(clerk as any).__internal_updateProps}\n props={props}\n rootProps={rendererRootProps}\n />\n )}\n </>\n );\n },\n { component: 'SignUp', renderWhileLoading: true },\n);\n\nexport function UserProfilePage({ children }: PropsWithChildren<UserProfilePageProps>) {\n logErrorInDevMode(userProfilePageRenderedError);\n return <>{children}</>;\n}\n\nexport function UserProfileLink({ children }: PropsWithChildren<UserProfileLinkProps>) {\n logErrorInDevMode(userProfileLinkRenderedError);\n return <>{children}</>;\n}\n\nconst _UserProfile = withClerk(\n ({\n clerk,\n component,\n fallback,\n ...props\n }: WithClerkProp<PropsWithChildren<Without<UserProfileProps, 'customPages'>> & FallbackProp>) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;\n\n const rendererRootProps = {\n ...(shouldShowFallback && fallback && { style: { display: 'none' } }),\n };\n\n const { customPages, customPagesPortals } = useUserProfileCustomPages(props.children);\n return (\n <>\n {shouldShowFallback && fallback}\n <ClerkHostRenderer\n component={component}\n mount={clerk.mountUserProfile}\n unmount={clerk.unmountUserProfile}\n updateProps={(clerk as any).__internal_updateProps}\n props={{ ...props, customPages }}\n rootProps={rendererRootProps}\n >\n <CustomPortalsRenderer customPagesPortals={customPagesPortals} />\n </ClerkHostRenderer>\n </>\n );\n },\n { component: 'UserProfile', renderWhileLoading: true },\n);\n\nexport const UserProfile: UserProfileExportType = Object.assign(_UserProfile, {\n Page: UserProfilePage,\n Link: UserProfileLink,\n});\n\nconst UserButtonContext = createContext<MountProps>({\n mount: () => {},\n unmount: () => {},\n updateProps: () => {},\n});\n\nconst _UserButton = withClerk(\n ({\n clerk,\n component,\n fallback,\n ...props\n }: WithClerkProp<PropsWithChildren<UserButtonPropsWithoutCustomPages> & FallbackProp>) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;\n\n const rendererRootProps = {\n ...(shouldShowFallback && fallback && { style: { display: 'none' } }),\n };\n\n const { customPages, customPagesPortals } = useUserProfileCustomPages(props.children, {\n allowForAnyChildren: !!props.__experimental_asProvider,\n });\n const userProfileProps = { ...props.userProfileProps, customPages };\n const { customMenuItems, customMenuItemsPortals } = useUserButtonCustomMenuItems(props.children, {\n allowForAnyChildren: !!props.__experimental_asProvider,\n });\n const sanitizedChildren = useSanitizedChildren(props.children);\n\n const passableProps = {\n mount: clerk.mountUserButton,\n unmount: clerk.unmountUserButton,\n updateProps: (clerk as any).__internal_updateProps,\n props: { ...props, userProfileProps, customMenuItems },\n };\n const portalProps = {\n customPagesPortals: customPagesPortals,\n customMenuItemsPortals: customMenuItemsPortals,\n };\n\n return (\n <UserButtonContext.Provider value={passableProps}>\n {shouldShowFallback && fallback}\n {clerk.loaded && (\n <ClerkHostRenderer\n component={component}\n {...passableProps}\n hideRootHtmlElement={!!props.__experimental_asProvider}\n rootProps={rendererRootProps}\n >\n {/*This mimics the previous behaviour before asProvider existed*/}\n {props.__experimental_asProvider ? sanitizedChildren : null}\n <CustomPortalsRenderer {...portalProps} />\n </ClerkHostRenderer>\n )}\n </UserButtonContext.Provider>\n );\n },\n { component: 'UserButton', renderWhileLoading: true },\n);\n\nexport function MenuItems({ children }: PropsWithChildren) {\n logErrorInDevMode(userButtonMenuItemsRenderedError);\n return <>{children}</>;\n}\n\nexport function MenuAction({ children }: PropsWithChildren<UserButtonActionProps>) {\n logErrorInDevMode(userButtonMenuActionRenderedError);\n return <>{children}</>;\n}\n\nexport function MenuLink({ children }: PropsWithChildren<UserButtonLinkProps>) {\n logErrorInDevMode(userButtonMenuLinkRenderedError);\n return <>{children}</>;\n}\n\nexport function UserButtonOutlet(outletProps: Without<UserButtonProps, 'userProfileProps'>) {\n const providerProps = useContext(UserButtonContext);\n\n const portalProps = {\n ...providerProps,\n props: {\n ...providerProps.props,\n ...outletProps,\n },\n } satisfies MountProps;\n\n return <ClerkHostRenderer {...portalProps} />;\n}\n\nexport const UserButton: UserButtonExportType = Object.assign(_UserButton, {\n UserProfilePage,\n UserProfileLink,\n MenuItems,\n Action: MenuAction,\n Link: MenuLink,\n __experimental_Outlet: UserButtonOutlet,\n});\n\nexport function OrganizationProfilePage({ children }: PropsWithChildren<OrganizationProfilePageProps>) {\n logErrorInDevMode(organizationProfilePageRenderedError);\n return <>{children}</>;\n}\n\nexport function OrganizationProfileLink({ children }: PropsWithChildren<OrganizationProfileLinkProps>) {\n logErrorInDevMode(organizationProfileLinkRenderedError);\n return <>{children}</>;\n}\n\nconst _OrganizationProfile = withClerk(\n ({\n clerk,\n component,\n fallback,\n ...props\n }: WithClerkProp<PropsWithChildren<Without<OrganizationProfileProps, 'customPages'>> & FallbackProp>) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;\n\n const rendererRootProps = {\n ...(shouldShowFallback && fallback && { style: { display: 'none' } }),\n };\n\n const { customPages, customPagesPortals } = useOrganizationProfileCustomPages(props.children);\n return (\n <>\n {shouldShowFallback && fallback}\n {clerk.loaded && (\n <ClerkHostRenderer\n component={component}\n mount={clerk.mountOrganizationProfile}\n unmount={clerk.unmountOrganizationProfile}\n updateProps={(clerk as any).__internal_updateProps}\n props={{ ...props, customPages }}\n rootProps={rendererRootProps}\n >\n <CustomPortalsRenderer customPagesPortals={customPagesPortals} />\n </ClerkHostRenderer>\n )}\n </>\n );\n },\n { component: 'OrganizationProfile', renderWhileLoading: true },\n);\n\nexport const OrganizationProfile: OrganizationProfileExportType = Object.assign(_OrganizationProfile, {\n Page: OrganizationProfilePage,\n Link: OrganizationProfileLink,\n});\n\nexport const CreateOrganization = withClerk(\n ({ clerk, component, fallback, ...props }: WithClerkProp<CreateOrganizationProps & FallbackProp>) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;\n\n const rendererRootProps = {\n ...(shouldShowFallback && fallback && { style: { display: 'none' } }),\n };\n\n return (\n <>\n {shouldShowFallback && fallback}\n {clerk.loaded && (\n <ClerkHostRenderer\n component={component}\n mount={clerk.mountCreateOrganization}\n unmount={clerk.unmountCreateOrganization}\n updateProps={(clerk as any).__internal_updateProps}\n props={props}\n rootProps={rendererRootProps}\n />\n )}\n </>\n );\n },\n { component: 'CreateOrganization', renderWhileLoading: true },\n);\n\nconst OrganizationSwitcherContext = createContext<MountProps>({\n mount: () => {},\n unmount: () => {},\n updateProps: () => {},\n});\n\nconst _OrganizationSwitcher = withClerk(\n ({\n clerk,\n component,\n fallback,\n ...props\n }: WithClerkProp<PropsWithChildren<OrganizationSwitcherPropsWithoutCustomPages> & FallbackProp>) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;\n\n const rendererRootProps = {\n ...(shouldShowFallback && fallback && { style: { display: 'none' } }),\n };\n\n const { customPages, customPagesPortals } = useOrganizationProfileCustomPages(props.children, {\n allowForAnyChildren: !!props.__experimental_asProvider,\n });\n const organizationProfileProps = { ...props.organizationProfileProps, customPages };\n const sanitizedChildren = useSanitizedChildren(props.children);\n\n const passableProps = {\n mount: clerk.mountOrganizationSwitcher,\n unmount: clerk.unmountOrganizationSwitcher,\n updateProps: (clerk as any).__internal_updateProps,\n props: { ...props, organizationProfileProps },\n rootProps: rendererRootProps,\n component,\n };\n\n /**\n * Prefetch organization list\n */\n clerk.__experimental_prefetchOrganizationSwitcher();\n\n return (\n <OrganizationSwitcherContext.Provider value={passableProps}>\n <>\n {shouldShowFallback && fallback}\n {clerk.loaded && (\n <ClerkHostRenderer\n {...passableProps}\n hideRootHtmlElement={!!props.__experimental_asProvider}\n >\n {/*This mimics the previous behaviour before asProvider existed*/}\n {props.__experimental_asProvider ? sanitizedChildren : null}\n <CustomPortalsRenderer customPagesPortals={customPagesPortals} />\n </ClerkHostRenderer>\n )}\n </>\n </OrganizationSwitcherContext.Provider>\n );\n },\n { component: 'OrganizationSwitcher', renderWhileLoading: true },\n);\n\nexport function OrganizationSwitcherOutlet(\n outletProps: Without<OrganizationSwitcherProps, 'organizationProfileProps'>,\n) {\n const providerProps = useContext(OrganizationSwitcherContext);\n\n const portalProps = {\n ...providerProps,\n props: {\n ...providerProps.props,\n ...outletProps,\n },\n } satisfies MountProps;\n\n return <ClerkHostRenderer {...portalProps} />;\n}\n\nexport const OrganizationSwitcher: OrganizationSwitcherExportType = Object.assign(_OrganizationSwitcher, {\n OrganizationProfilePage,\n OrganizationProfileLink,\n __experimental_Outlet: OrganizationSwitcherOutlet,\n});\n\nexport const OrganizationList = withClerk(\n ({ clerk, component, fallback, ...props }: WithClerkProp<OrganizationListProps & FallbackProp>) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;\n\n const rendererRootProps = {\n ...(shouldShowFallback && fallback && { style: { display: 'none' } }),\n };\n\n return (\n <>\n {shouldShowFallback && fallback}\n {clerk.loaded && (\n <ClerkHostRenderer\n component={component}\n mount={clerk.mountOrganizationList}\n unmount={clerk.unmountOrganizationList}\n updateProps={(clerk as any).__internal_updateProps}\n props={props}\n rootProps={rendererRootProps}\n />\n )}\n </>\n );\n },\n { component: 'OrganizationList', renderWhileLoading: true },\n);\n\nexport const GoogleOneTap = withClerk(\n ({ clerk, component, fallback, ...props }: WithClerkProp<GoogleOneTapProps & FallbackProp>) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;\n\n const rendererRootProps = {\n ...(shouldShowFallback && fallback && { style: { display: 'none' } }),\n };\n\n return (\n <>\n {shouldShowFallback && fallback}\n {clerk.loaded && (\n <ClerkHostRenderer\n component={component}\n open={clerk.openGoogleOneTap}\n close={clerk.closeGoogleOneTap}\n updateProps={(clerk as any).__internal_updateProps}\n props={props}\n rootProps={rendererRootProps}\n />\n )}\n </>\n );\n },\n { component: 'GoogleOneTap', renderWhileLoading: true },\n);\n\nexport const Waitlist = withClerk(\n ({ clerk, component, fallback, ...props }: WithClerkProp<WaitlistProps & FallbackProp>) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;\n\n const rendererRootProps = {\n ...(shouldShowFallback && fallback && { style: { display: 'none' } }),\n };\n\n return (\n <>\n {shouldShowFallback && fallback}\n {clerk.loaded && (\n <ClerkHostRenderer\n component={component}\n mount={clerk.mountWaitlist}\n unmount={clerk.unmountWaitlist}\n updateProps={(clerk as any).__internal_updateProps}\n props={props}\n rootProps={rendererRootProps}\n />\n )}\n </>\n );\n },\n { component: 'Waitlist', renderWhileLoading: true },\n);\n\nexport const PricingTable = withClerk(\n ({ clerk, component, fallback, ...props }: WithClerkProp<PricingTableProps & FallbackProp>) => {\n const mountingStatus = useWaitForComponentMount(component, {\n // This attribute is added to the PricingTable root element after we've successfully fetched the plans asynchronously.\n selector: '[data-component-status=\"ready\"]',\n });\n const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;\n\n const rendererRootProps = {\n ...(shouldShowFallback && fallback && { style: { display: 'none' } }),\n };\n\n return (\n <>\n {shouldShowFallback && fallback}\n {clerk.loaded && (\n <ClerkHostRenderer\n component={component}\n mount={clerk.mountPricingTable}\n unmount={clerk.unmountPricingTable}\n updateProps={(clerk as any).__internal_updateProps}\n props={props}\n rootProps={rendererRootProps}\n />\n )}\n </>\n );\n },\n { component: 'PricingTable', renderWhileLoading: true },\n);\n\n/**\n * @experimental This component is in early access and may change in future releases.\n */\nexport const APIKeys = withClerk(\n ({ clerk, component, fallback, ...props }: WithClerkProp<APIKeysProps & FallbackProp>) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;\n\n const rendererRootProps = {\n ...(shouldShowFallback && fallback && { style: { display: 'none' } }),\n };\n\n return (\n <>\n {shouldShowFallback && fallback}\n {clerk.loaded && (\n <ClerkHostRenderer\n component={component}\n mount={clerk.mountAPIKeys}\n unmount={clerk.unmountAPIKeys}\n updateProps={(clerk as any).__internal_updateProps}\n props={props}\n rootProps={rendererRootProps}\n />\n )}\n </>\n );\n },\n { component: 'ApiKeys', renderWhileLoading: true },\n);\n\nexport const UserAvatar = withClerk(\n ({ clerk, component, fallback, ...props }: WithClerkProp<UserAvatarProps & FallbackProp>) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;\n\n const rendererRootProps = {\n ...(shouldShowFallback && fallback && { style: { display: 'none' } }),\n };\n\n return (\n <>\n {shouldShowFallback && fallback}\n {clerk.loaded && (\n <ClerkHostRenderer\n component={component}\n mount={clerk.mountUserAvatar}\n unmount={clerk.unmountUserAvatar}\n updateProps={(clerk as any).__internal_updateProps}\n props={props}\n rootProps={rendererRootProps}\n />\n )}\n </>\n );\n },\n { component: 'UserAvatar', renderWhileLoading: true },\n);\n\nexport const TaskChooseOrganization = withClerk(\n ({ clerk, component, fallback, ...props }: WithClerkProp<TaskChooseOrganizationProps & FallbackProp>) => {\n const mountingStatus = useWaitForComponentMount(component);\n const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded;\n\n const rendererRootProps = {\n ...(shouldShowFallback && fallback && { style: { display: 'none' } }),\n };\n\n return (\n <>\n {shouldShowFallback && fallback}\n {clerk.loaded && (\n <ClerkHostRenderer\n component={component}\n mount={clerk.mountTaskChooseOrganization}\n unmount={clerk.unmountTaskChooseOrganization}\n updateProps={(clerk as any).__internal_updateProps}\n props={props}\n rootProps={rendererRootProps}\n />\n )}\n </>\n );\n },\n { component: 'TaskChooseOrganization', renderWhileLoading: true },\n);\n","import React from 'react';\n\nimport { errorThrower } from '../errors/errorThrower';\nimport { multipleChildrenInButtonComponent } from '../errors/messages';\n\nexport const assertSingleChild =\n (children: React.ReactNode) =>\n (\n name:\n | 'SignInButton'\n | 'SignUpButton'\n | 'SignOutButton'\n | 'SignInWithMetamaskButton'\n | 'CheckoutButton'\n | 'SubscriptionDetailsButton'\n | 'PlanDetailsButton',\n ) => {\n try {\n return React.Children.only(children);\n } catch {\n return errorThrower.throw(multipleChildrenInButtonComponent(name));\n }\n };\n\nexport const normalizeWithDefaultValue = (children: React.ReactNode | undefined, defaultText: string) => {\n if (!children) {\n children = defaultText;\n }\n if (typeof children === 'string') {\n children = <button>{children}</button>;\n }\n return children;\n};\n\nexport const safeExecute =\n (cb: unknown) =>\n (...args: any) => {\n if (cb && typeof cb === 'function') {\n return cb(...args);\n }\n };\n","export function isConstructor<T>(f: any): f is T {\n return typeof f === 'function';\n}\n","import React from 'react';\n\nimport { errorThrower } from '../errors/errorThrower';\n\nconst counts = new Map<string, number>();\n\nexport function useMaxAllowedInstancesGuard(name: string, error: string, maxCount = 1): void {\n React.useEffect(() => {\n const count = counts.get(name) || 0;\n if (count == maxCount) {\n return errorThrower.throw(error);\n }\n counts.set(name, count + 1);\n\n return () => {\n counts.set(name, (counts.get(name) || 1) - 1);\n };\n }, []);\n}\n\nexport function withMaxAllowedInstancesGuard<P>(\n WrappedComponent: P,\n name: string,\n error: string,\n): P & { displayName: string } {\n // @ts-expect-error - simplified types to preserve generics in P\n const displayName = WrappedComponent.displayName || WrappedComponent.name || name || 'Component';\n const Hoc = (props: P) => {\n useMaxAllowedInstancesGuard(name, error);\n // @ts-expect-error - simplified types to preserve generics in P\n return <WrappedComponent {...(props as any)} />;\n };\n Hoc.displayName = `withMaxAllowedInstancesGuard(${displayName})`;\n // @ts-expect-error - simplified types to preserve generics in P\n return Hoc;\n}\n","import type React from 'react';\nimport { useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nexport type UseCustomElementPortalParams = {\n component: React.ReactNode;\n id: number;\n};\n\nexport type UseCustomElementPortalReturn = {\n portal: () => React.JSX.Element;\n mount: (node: Element) => void;\n unmount: () => void;\n id: number;\n};\n\n// This function takes a component as prop, and returns functions that mount and unmount\n// the given component into a given node\nexport const useCustomElementPortal = (elements: UseCustomElementPortalParams[]) => {\n const [nodeMap, setNodeMap] = useState<Map<string, Element | null>>(new Map());\n\n return elements.map(el => ({\n id: el.id,\n mount: (node: Element) => setNodeMap(prev => new Map(prev).set(String(el.id), node)),\n unmount: () =>\n setNodeMap(prev => {\n const newMap = new Map(prev);\n newMap.set(String(el.id), null);\n return newMap;\n }),\n portal: () => {\n const node = nodeMap.get(String(el.id));\n return node ? createPortal(el.component, node) : null;\n },\n }));\n};\n","import type { CustomPage } from '@clerk/shared/types';\nimport { logErrorInDevMode } from '@clerk/shared/utils';\nimport type { ReactElement } from 'react';\nimport React from 'react';\n\nimport {\n MenuItems,\n OrganizationProfileLink,\n OrganizationProfilePage,\n UserProfileLink,\n UserProfilePage,\n} from '../components/uiComponents';\nimport { customLinkWrongProps, customPagesIgnoredComponent, customPageWrongProps } from '../errors/messages';\nimport type { UserProfilePageProps } from '../types';\nimport { isThatComponent } from './componentValidation';\nimport type { UseCustomElementPortalParams, UseCustomElementPortalReturn } from './useCustomElementPortal';\nimport { useCustomElementPortal } from './useCustomElementPortal';\n\nexport const useUserProfileCustomPages = (\n children: React.ReactNode | React.ReactNode[],\n options?: UseCustomPagesOptions,\n) => {\n const reorderItemsLabels = ['account', 'security'];\n return useCustomPages(\n {\n children,\n reorderItemsLabels,\n LinkComponent: UserProfileLink,\n PageComponent: UserProfilePage,\n MenuItemsComponent: MenuItems,\n componentName: 'UserProfile',\n },\n options,\n );\n};\n\nexport const useOrganizationProfileCustomPages = (\n children: React.ReactNode | React.ReactNode[],\n options?: UseCustomPagesOptions,\n) => {\n const reorderItemsLabels = ['general', 'members'];\n return useCustomPages(\n {\n children,\n reorderItemsLabels,\n LinkComponent: OrganizationProfileLink,\n PageComponent: OrganizationProfilePage,\n componentName: 'OrganizationProfile',\n },\n options,\n );\n};\n\ntype UseCustomPagesParams = {\n children: React.ReactNode | React.ReactNode[];\n LinkComponent: any;\n PageComponent: any;\n MenuItemsComponent?: any;\n reorderItemsLabels: string[];\n componentName: string;\n};\n\ntype UseCustomPagesOptions = {\n allowForAnyChildren: boolean;\n};\n\ntype CustomPageWithIdType = UserProfilePageProps & { children?: React.ReactNode };\n\n/**\n * Exclude any children that is used for identifying Custom Pages or Custom Items.\n * Passing:\n * ```tsx\n * <UserProfile.Page/>\n * <OrganizationProfile.Link/>\n * <MyComponent>\n * <UserButton.MenuItems/>\n * ```\n * Gives back\n * ```tsx\n * <MyComponent>\n * ````\n */\nexport const useSanitizedChildren = (children: React.ReactNode) => {\n const sanitizedChildren: React.ReactNode[] = [];\n\n const excludedComponents: any[] = [\n OrganizationProfileLink,\n OrganizationProfilePage,\n MenuItems,\n UserProfilePage,\n UserProfileLink,\n ];\n\n React.Children.forEach(children, child => {\n if (!excludedComponents.some(component => isThatComponent(child, component))) {\n sanitizedChildren.push(child);\n }\n });\n\n return sanitizedChildren;\n};\n\nconst useCustomPages = (params: UseCustomPagesParams, options?: UseCustomPagesOptions) => {\n const { children, LinkComponent, PageComponent, MenuItemsComponent, reorderItemsLabels, componentName } = params;\n const { allowForAnyChildren = false } = options || {};\n const validChildren: CustomPageWithIdType[] = [];\n\n React.Children.forEach(children, child => {\n if (\n !isThatComponent(child, PageComponent) &&\n !isThatComponent(child, LinkComponent) &&\n !isThatComponent(child, MenuItemsComponent)\n ) {\n if (child && !allowForAnyChildren) {\n logErrorInDevMode(customPagesIgnoredComponent(componentName));\n }\n return;\n }\n\n const { props } = child as ReactElement;\n\n const { children, label, url, labelIcon } = props;\n\n if (isThatComponent(child, PageComponent)) {\n if (isReorderItem(props, reorderItemsLabels)) {\n // This is a reordering item\n validChildren.push({ label });\n } else if (isCustomPage(props)) {\n // this is a custom page\n validChildren.push({ label, labelIcon, children, url });\n } else {\n logErrorInDevMode(customPageWrongProps(componentName));\n return;\n }\n }\n\n if (isThatComponent(child, LinkComponent)) {\n if (isExternalLink(props)) {\n // This is an external link\n validChildren.push({ label, labelIcon, url });\n } else {\n logErrorInDevMode(customLinkWrongProps(componentName));\n return;\n }\n }\n });\n\n const customPageContents: UseCustomElementPortalParams[] = [];\n const customPageLabelIcons: UseCustomElementPortalParams[] = [];\n const customLinkLabelIcons: UseCustomElementPortalParams[] = [];\n\n validChildren.forEach((cp, index) => {\n if (isCustomPage(cp)) {\n customPageContents.push({ component: cp.children, id: index });\n customPageLabelIcons.push({ component: cp.labelIcon, id: index });\n return;\n }\n if (isExternalLink(cp)) {\n customLinkLabelIcons.push({ component: cp.labelIcon, id: index });\n }\n });\n\n const customPageContentsPortals = useCustomElementPortal(customPageContents);\n const customPageLabelIconsPortals = useCustomElementPortal(customPageLabelIcons);\n const customLinkLabelIconsPortals = useCustomElementPortal(customLinkLabelIcons);\n\n const customPages: CustomPage[] = [];\n const customPagesPortals: React.ComponentType[] = [];\n\n validChildren.forEach((cp, index) => {\n if (isReorderItem(cp, reorderItemsLabels)) {\n customPages.push({ label: cp.label });\n return;\n }\n if (isCustomPage(cp)) {\n const {\n portal: contentPortal,\n mount,\n unmount,\n } = customPageContentsPortals.find(p => p.id === index) as UseCustomElementPortalReturn;\n const {\n portal: labelPortal,\n mount: mountIcon,\n unmount: unmountIcon,\n } = customPageLabelIconsPortals.find(p => p.id === index) as UseCustomElementPortalReturn;\n customPages.push({ label: cp.label, url: cp.url, mount, unmount, mountIcon, unmountIcon });\n customPagesPortals.push(contentPortal);\n customPagesPortals.push(labelPortal);\n return;\n }\n if (isExternalLink(cp)) {\n const {\n portal: labelPortal,\n mount: mountIcon,\n unmount: unmountIcon,\n } = customLinkLabelIconsPortals.find(p => p.id === index) as UseCustomElementPortalReturn;\n customPages.push({ label: cp.label, url: cp.url, mountIcon, unmountIcon });\n customPagesPortals.push(labelPortal);\n return;\n }\n });\n\n return { customPages, customPagesPortals };\n};\n\nconst isReorderItem = (childProps: any, validItems: string[]): boolean => {\n const { children, label, url, labelIcon } = childProps;\n return !children && !url && !labelIcon && validItems.some(v => v === label);\n};\n\nconst isCustomPage = (childProps: any): boolean => {\n const { children, label, url, labelIcon } = childProps;\n return !!children && !!url && !!labelIcon && !!label;\n};\n\nconst isExternalLink = (childProps: any): boolean => {\n const { children, label, url, labelIcon } = childProps;\n return !children && !!url && !!labelIcon && !!label;\n};\n","import React from 'react';\n\nexport const isThatComponent = (v: any, component: React.ReactNode): v is React.ReactNode => {\n return !!v && React.isValidElement(v) && (v as React.ReactElement)?.type === component;\n};\n","import type { CustomMenuItem } from '@clerk/shared/types';\nimport { logErrorInDevMode } from '@clerk/shared/utils';\nimport type { ReactElement } from 'react';\nimport React from 'react';\n\nimport { MenuAction, MenuItems, MenuLink, UserProfileLink, UserProfilePage } from '../components/uiComponents';\nimport {\n customMenuItemsIgnoredComponent,\n userButtonIgnoredComponent,\n userButtonMenuItemLinkWrongProps,\n userButtonMenuItemsActionWrongsProps,\n} from '../errors/messages';\nimport type { UserButtonActionProps, UserButtonLinkProps } from '../types';\nimport { isThatComponent } from './componentValidation';\nimport type { UseCustomElementPortalParams, UseCustomElementPortalReturn } from './useCustomElementPortal';\nimport { useCustomElementPortal } from './useCustomElementPortal';\n\nexport const useUserButtonCustomMenuItems = (\n children: React.ReactNode | React.ReactNode[],\n options?: { allowForAnyChildren?: boolean },\n) => {\n const reorderItemsLabels = ['manageAccount', 'signOut'];\n return useCustomMenuItems({\n children,\n reorderItemsLabels,\n MenuItemsComponent: MenuItems,\n MenuActionComponent: MenuAction,\n MenuLinkComponent: MenuLink,\n UserProfileLinkComponent: UserProfileLink,\n UserProfilePageComponent: UserProfilePage,\n allowForAnyChildren: options?.allowForAnyChildren ?? false,\n });\n};\n\ntype UseCustomMenuItemsParams = {\n children: React.ReactNode | React.ReactNode[];\n MenuItemsComponent?: any;\n MenuActionComponent?: any;\n MenuLinkComponent?: any;\n UserProfileLinkComponent?: any;\n UserProfilePageComponent?: any;\n reorderItemsLabels: string[];\n allowForAnyChildren?: boolean;\n};\n\ntype CustomMenuItemType = UserButtonActionProps | UserButtonLinkProps;\n\nconst useCustomMenuItems = ({\n children,\n MenuItemsComponent,\n MenuActionComponent,\n MenuLinkComponent,\n UserProfileLinkComponent,\n UserProfilePageComponent,\n reorderItemsLabels,\n allowForAnyChildren = false,\n}: UseCustomMenuItemsParams) => {\n const validChildren: CustomMenuItemType[] = [];\n const customMenuItems: CustomMenuItem[] = [];\n const customMenuItemsPortals: React.ComponentType[] = [];\n\n React.Children.forEach(children, child => {\n if (\n !isThatComponent(child, MenuItemsComponent) &&\n !isThatComponent(child, UserProfileLinkComponent) &&\n !isThatComponent(child, UserProfilePageComponent)\n ) {\n if (child && !allowForAnyChildren) {\n logErrorInDevMode(userButtonIgnoredComponent);\n }\n return;\n }\n\n // Ignore UserProfileLinkComponent and UserProfilePageComponent\n if (isThatComponent(child, UserProfileLinkComponent) || isThatComponent(child, UserProfilePageComponent)) {\n return;\n }\n\n // Menu items children\n const { props } = child as ReactElement;\n\n React.Children.forEach(props.children, child => {\n if (!isThatComponent(child, MenuActionComponent) && !isThatComponent(child, MenuLinkComponent)) {\n if (child) {\n logErrorInDevMode(customMenuItemsIgnoredComponent);\n }\n\n return;\n }\n\n const { props } = child as ReactElement;\n\n const { label, labelIcon, href, onClick, open } = props;\n\n if (isThatComponent(child, MenuActionComponent)) {\n if (isReorderItem(props, reorderItemsLabels)) {\n // This is a reordering item\n validChildren.push({ label });\n } else if (isCustomMenuItem(props)) {\n const baseItem = {\n label,\n labelIcon,\n };\n\n if (onClick !== undefined) {\n validChildren.push({\n ...baseItem,\n onClick,\n });\n } else if (open !== undefined) {\n validChildren.push({\n ...baseItem,\n open: open.startsWith('/') ? open : `/${open}`,\n });\n } else {\n // Handle the case where neither onClick nor open is defined\n logErrorInDevMode('Custom menu item must have either onClick or open property');\n return;\n }\n } else {\n logErrorInDevMode(userButtonMenuItemsActionWrongsProps);\n return;\n }\n }\n\n if (isThatComponent(child, MenuLinkComponent)) {\n if (isExternalLink(props)) {\n validChildren.push({ label, labelIcon, href });\n } else {\n logErrorInDevMode(userButtonMenuItemLinkWrongProps);\n return;\n }\n }\n });\n });\n\n const customMenuItemLabelIcons: UseCustomElementPortalParams[] = [];\n const customLinkLabelIcons: UseCustomElementPortalParams[] = [];\n validChildren.forEach((mi, index) => {\n if (isCustomMenuItem(mi)) {\n customMenuItemLabelIcons.push({ component: mi.labelIcon, id: index });\n }\n if (isExternalLink(mi)) {\n customLinkLabelIcons.push({ component: mi.labelIcon, id: index });\n }\n });\n\n const customMenuItemLabelIconsPortals = useCustomElementPortal(customMenuItemLabelIcons);\n const customLinkLabelIconsPortals = useCustomElementPortal(customLinkLabelIcons);\n\n validChildren.forEach((mi, index) => {\n if (isReorderItem(mi, reorderItemsLabels)) {\n customMenuItems.push({\n label: mi.label,\n });\n }\n if (isCustomMenuItem(mi)) {\n const {\n portal: iconPortal,\n mount: mountIcon,\n unmount: unmountIcon,\n } = customMenuItemLabelIconsPortals.find(p => p.id === index) as UseCustomElementPortalReturn;\n const menuItem: CustomMenuItem = {\n label: mi.label,\n mountIcon,\n unmountIcon,\n };\n\n if ('onClick' in mi) {\n menuItem.onClick = mi.onClick;\n } else if ('open' in mi) {\n menuItem.open = mi.open;\n }\n customMenuItems.push(menuItem);\n customMenuItemsPortals.push(iconPortal);\n }\n if (isExternalLink(mi)) {\n const {\n portal: iconPortal,\n mount: mountIcon,\n unmount: unmountIcon,\n } = customLinkLabelIconsPortals.find(p => p.id === index) as UseCustomElementPortalReturn;\n customMenuItems.push({\n label: mi.label,\n href: mi.href,\n mountIcon,\n unmountIcon,\n });\n customMenuItemsPortals.push(iconPortal);\n }\n });\n\n return { customMenuItems, customMenuItemsPortals };\n};\n\nconst isReorderItem = (childProps: any, validItems: string[]): boolean => {\n const { children, label, onClick, labelIcon } = childProps;\n return !children && !onClick && !labelIcon && validItems.some(v => v === label);\n};\n\nconst isCustomMenuItem = (childProps: any): childProps is UserButtonActionProps => {\n const { label, labelIcon, onClick, open } = childProps;\n return !!labelIcon && !!label && (typeof onClick === 'function' || typeof open === 'string');\n};\n\nconst isExternalLink = (childProps: any): childProps is UserButtonLinkProps => {\n const { label, href, labelIcon } = childProps;\n return !!href && !!labelIcon && !!label;\n};\n","import { useEffect, useRef, useState } from 'react';\n\nconst createAwaitableMutationObserver = (\n globalOptions: MutationObserverInit & {\n isReady: (el: HTMLElement | null, selector: string) => boolean;\n },\n) => {\n const isReady = globalOptions?.isReady;\n\n return (options: { selector: string; root?: HTMLElement | null; timeout?: number }) =>\n new Promise<void>((resolve, reject) => {\n const { root = document?.body, selector, timeout = 0 } = options;\n\n if (!root) {\n reject(new Error('No root element provided'));\n return;\n }\n\n let elementToWatch: HTMLElement | null = root;\n if (selector) {\n elementToWatch = root?.querySelector(selector);\n }\n\n // Initial readiness check\n if (isReady(elementToWatch, selector)) {\n resolve();\n return;\n }\n\n // Set up a MutationObserver to detect when the element has children\n const observer = new MutationObserver(mutationsList => {\n for (const mutation of mutationsList) {\n if (!elementToWatch && selector) {\n elementToWatch = root?.querySelector(selector);\n }\n\n if (\n (globalOptions.childList && mutation.type === 'childList') ||\n (globalOptions.attributes && mutation.type === 'attributes')\n ) {\n if (isReady(elementToWatch, selector)) {\n observer.disconnect();\n resolve();\n return;\n }\n }\n }\n });\n\n observer.observe(root, globalOptions);\n\n // Set up an optional timeout to reject the promise if the element never gets child nodes\n if (timeout > 0) {\n setTimeout(() => {\n observer.disconnect();\n reject(new Error(`Timeout waiting for ${selector}`));\n }, timeout);\n }\n });\n};\n\nconst waitForElementChildren = createAwaitableMutationObserver({\n childList: true,\n subtree: true,\n isReady: (el, selector) => !!el?.childElementCount && el?.matches?.(selector) && el.childElementCount > 0,\n});\n\n/**\n * Detect when a Clerk component has mounted by watching DOM updates to an element with a `data-clerk-component=\"${component}\"` property.\n */\nexport function useWaitForComponentMount(\n component?: string,\n options?: { selector: string },\n): 'rendering' | 'rendered' | 'error' {\n const watcherRef = useRef<Promise<void>>();\n const [status, setStatus] = useState<'rendering' | 'rendered' | 'error'>('rendering');\n\n useEffect(() => {\n if (!component) {\n throw new Error('Clerk: no component name provided, unable to detect mount.');\n }\n\n if (typeof window !== 'undefined' && !watcherRef.current) {\n const defaultSelector = `[data-clerk-component=\"${component}\"]`;\n const selector = options?.selector;\n watcherRef.current = waitForElementChildren({\n selector: selector\n ? // Allows for `[data-clerk-component=\"xxxx\"][data-some-attribute=\"123\"] .my-class`\n defaultSelector + selector\n : defaultSelector,\n })\n .then(() => {\n setStatus('rendered');\n })\n .catch(() => {\n setStatus('error');\n });\n }\n }, [component, options?.selector]);\n\n return status;\n}\n","import { without } from '@clerk/shared/object';\nimport { isDeeplyEqual } from '@clerk/shared/react';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport type { MountProps, OpenProps } from '../types';\n\nconst isMountProps = (props: any): props is MountProps => {\n return 'mount' in props;\n};\n\nconst isOpenProps = (props: any): props is OpenProps => {\n return 'open' in props;\n};\n\nconst stripMenuItemIconHandlers = (\n menuItems?: Array<{\n mountIcon?: (el: HTMLDivElement) => void;\n unmountIcon?: (el: HTMLDivElement) => void;\n [key: string]: any;\n }>,\n) => {\n return menuItems?.map(({ mountIcon, unmountIcon, ...rest }) => rest);\n};\n\n// README: <ClerkHostRenderer/> should be a class pure component in order for mount and unmount\n// lifecycle props to be invoked correctly. Replacing the class component with a\n// functional component wrapped with a React.memo is not identical to the original\n// class implementation due to React intricacies such as the useEffect’s cleanup\n// seems to run AFTER unmount, while componentWillUnmount runs BEFORE.\n\n// More information can be found at https://clerk.slack.com/archives/C015S0BGH8R/p1624891993016300\n\n// The function Portal implementation is commented out for future reference.\n\n// const Portal = React.memo(({ props, mount, unmount }: MountProps) => {\n// const portalRef = React.createRef<HTMLDivElement>();\n\n// useEffect(() => {\n// if (portalRef.current) {\n// mount(portalRef.current, props);\n// }\n// return () => {\n// if (portalRef.current) {\n// unmount(portalRef.current);\n// }\n// };\n// }, []);\n\n// return <div ref={portalRef} />;\n// });\n\n// Portal.displayName = 'ClerkPortal';\n\n/**\n * Used to orchestrate mounting of Clerk components in a host React application.\n * Components are rendered into a specific DOM node using mount/unmount methods provided by the Clerk class.\n */\nexport class ClerkHostRenderer extends React.PureComponent<\n PropsWithChildren<\n (MountProps | OpenProps) & {\n component?: string;\n hideRootHtmlElement?: boolean;\n rootProps?: JSX.IntrinsicElements['div'];\n }\n >\n> {\n private rootRef = React.createRef<HTMLDivElement>();\n\n componentDidUpdate(_prevProps: Readonly<MountProps | OpenProps>) {\n if (!isMountProps(_prevProps) || !isMountProps(this.props)) {\n return;\n }\n\n // Remove children and customPages from props before comparing\n // children might hold circular references which deepEqual can't handle\n // and the implementation of customPages relies on props getting new references\n const prevProps = without(_prevProps.props, 'customPages', 'customMenuItems', 'children');\n const newProps = without(this.props.props, 'customPages', 'customMenuItems', 'children');\n\n // instead, we simply use the length of customPages to determine if it changed or not\n const customPagesChanged = prevProps.customPages?.length !== newProps.customPages?.length;\n const customMenuItemsChanged = prevProps.customMenuItems?.length !== newProps.customMenuItems?.length;\n\n // Strip out mountIcon and unmountIcon handlers since they're always generated as new function references,\n // which would cause unnecessary re-renders in deep equality checks\n const prevMenuItemsWithoutHandlers = stripMenuItemIconHandlers(_prevProps.props.customMenuItems);\n const newMenuItemsWithoutHandlers = stripMenuItemIconHandlers(this.props.props.customMenuItems);\n\n if (\n !isDeeplyEqual(prevProps, newProps) ||\n !isDeeplyEqual(prevMenuItemsWithoutHandlers, newMenuItemsWithoutHandlers) ||\n customPagesChanged ||\n customMenuItemsChanged\n ) {\n if (this.rootRef.current) {\n this.props.updateProps({ node: this.rootRef.current, props: this.props.props });\n }\n }\n }\n\n componentDidMount() {\n if (this.rootRef.current) {\n if (isMountProps(this.props)) {\n this.props.mount(this.rootRef.current, this.props.props);\n }\n\n if (isOpenProps(this.props)) {\n this.props.open(this.props.props);\n }\n }\n }\n\n componentWillUnmount() {\n if (this.rootRef.current) {\n if (isMountProps(this.props)) {\n this.props.unmount(this.rootRef.current);\n }\n if (isOpenProps(this.props)) {\n this.props.close();\n }\n }\n }\n\n render() {\n const { hideRootHtmlElement = false } = this.props;\n const rootAttributes = {\n ref: this.rootRef,\n ...this.props.rootProps,\n ...(this.props.component && { 'data-clerk-component': this.props.component }),\n };\n\n return (\n <>\n {!hideRootHtmlElement && <div {...rootAttributes} />}\n {this.props.children}\n </>\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAiBA,SAAS,qBAAAA,0BAAyB;AAElC,OAAOC,UAAS,eAAe,eAAe,kBAAkB;;;ACnBhE,OAAO,WAAW;AAKX,IAAM,oBACX,CAAC,aACD,CACE,SAQG;AACH,MAAI;AACF,WAAO,MAAM,SAAS,KAAK,QAAQ;AAAA,EACrC,QAAQ;AACN,WAAO,aAAa,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B,SAAS;AACzD,UAAM,qBAAqB,mBAAmB,eAAe,CAAC,MAAM;AAEpE,UAAM,oBAAoB;AAAA,MACxB,GAAI,sBAAsB,YAAY,EAAE,OAAO,EAAE,SAAS,OAAO,EAAE;AAAA,IACrE;AAEA,WACE,gBAAAA,OAAA,cAAAA,OAAA,gBACG,sBAAsB,UACtB,MAAM,UACL,gBAAAA,OAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,OAAO,MAAM;AAAA,QACb,SAAS,MAAM;AAAA,QACf,aAAc,MAAc;AAAA,QAC5B;AAAA,QACA,WAAW;AAAA;AAAA,IACb,CAEJ;AAAA,EAEJ;AAAA,EACA,EAAE,WAAW,0BAA0B,oBAAoB,KAAK;AAClE;","names":["logErrorInDevMode","React","React","React","React","React","React","children","logErrorInDevMode","React","React","logErrorInDevMode","child","props","isReorderItem","isExternalLink","useState","React","React","logErrorInDevMode"]}
|
|
File without changes
|