@clerk/shared 4.0.0-snapshot.v20251208202852 → 4.0.0-snapshot.v20251215203425

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.
Files changed (122) hide show
  1. package/dist/runtime/alternativePhoneCode.d.mts +1 -1
  2. package/dist/runtime/alternativePhoneCode.d.ts +1 -1
  3. package/dist/runtime/authorization-errors.d.mts +1 -1
  4. package/dist/runtime/authorization-errors.d.ts +1 -1
  5. package/dist/runtime/authorization.d.mts +1 -1
  6. package/dist/runtime/authorization.d.ts +1 -1
  7. package/dist/runtime/clerkEventBus.d.mts +1 -1
  8. package/dist/runtime/clerkEventBus.d.ts +1 -1
  9. package/dist/runtime/color.d.mts +1 -1
  10. package/dist/runtime/color.d.ts +1 -1
  11. package/dist/runtime/deriveState.d.mts +1 -1
  12. package/dist/runtime/deriveState.d.ts +1 -1
  13. package/dist/runtime/{error-CWA4ukvl.d.mts → error-Btp0PBNP.d.mts} +2 -2
  14. package/dist/runtime/{error-CWA4ukvl.d.mts.map → error-Btp0PBNP.d.mts.map} +1 -1
  15. package/dist/runtime/{error-DSsmf214.d.ts → error-FQfTKcEF.d.ts} +2 -2
  16. package/dist/runtime/{error-DSsmf214.d.ts.map → error-FQfTKcEF.d.ts.map} +1 -1
  17. package/dist/runtime/error.d.mts +2 -2
  18. package/dist/runtime/error.d.ts +2 -2
  19. package/dist/runtime/globs.d.mts.map +1 -1
  20. package/dist/runtime/globs.d.ts.map +1 -1
  21. package/dist/runtime/{index-CBjE4nAT.d.mts → index-6lIp5q8s.d.mts} +195 -143
  22. package/dist/runtime/index-6lIp5q8s.d.mts.map +1 -0
  23. package/dist/runtime/{index-eJWs3zJx.d.ts → index-TCL_gZUn.d.ts} +195 -143
  24. package/dist/runtime/index-TCL_gZUn.d.ts.map +1 -0
  25. package/dist/runtime/internal/clerk-js/completeSignUpFlow.d.mts +1 -1
  26. package/dist/runtime/internal/clerk-js/completeSignUpFlow.d.ts +1 -1
  27. package/dist/runtime/internal/clerk-js/componentGuards.d.mts +1 -1
  28. package/dist/runtime/internal/clerk-js/componentGuards.d.ts +1 -1
  29. package/dist/runtime/internal/clerk-js/injectedWeb3Providers.d.mts +1 -1
  30. package/dist/runtime/internal/clerk-js/injectedWeb3Providers.d.ts +1 -1
  31. package/dist/runtime/internal/clerk-js/organization.d.mts +1 -1
  32. package/dist/runtime/internal/clerk-js/organization.d.ts +1 -1
  33. package/dist/runtime/internal/clerk-js/organization.js +1 -1
  34. package/dist/runtime/internal/clerk-js/organization.js.map +1 -1
  35. package/dist/runtime/internal/clerk-js/organization.mjs +1 -1
  36. package/dist/runtime/internal/clerk-js/organization.mjs.map +1 -1
  37. package/dist/runtime/internal/clerk-js/passkeys.d.mts +2 -2
  38. package/dist/runtime/internal/clerk-js/passkeys.d.ts +2 -2
  39. package/dist/runtime/internal/clerk-js/passwords/complexity.d.mts +1 -1
  40. package/dist/runtime/internal/clerk-js/passwords/complexity.d.ts +1 -1
  41. package/dist/runtime/internal/clerk-js/passwords/loadZxcvbn.d.mts +1 -1
  42. package/dist/runtime/internal/clerk-js/passwords/loadZxcvbn.d.ts +1 -1
  43. package/dist/runtime/internal/clerk-js/passwords/password.d.mts +1 -1
  44. package/dist/runtime/internal/clerk-js/passwords/password.d.ts +1 -1
  45. package/dist/runtime/internal/clerk-js/passwords/strength.d.mts +1 -1
  46. package/dist/runtime/internal/clerk-js/passwords/strength.d.ts +1 -1
  47. package/dist/runtime/internal/clerk-js/queryParams.d.mts +2 -2
  48. package/dist/runtime/internal/clerk-js/queryParams.d.ts +2 -2
  49. package/dist/runtime/internal/clerk-js/redirectUrls.d.mts +1 -1
  50. package/dist/runtime/internal/clerk-js/redirectUrls.d.ts +1 -1
  51. package/dist/runtime/internal/clerk-js/sessionTasks.d.mts +2 -2
  52. package/dist/runtime/internal/clerk-js/sessionTasks.d.ts +2 -2
  53. package/dist/runtime/internal/clerk-js/url.d.mts +2 -2
  54. package/dist/runtime/internal/clerk-js/url.d.ts +2 -2
  55. package/dist/runtime/internal/clerk-js/user.d.mts +1 -1
  56. package/dist/runtime/internal/clerk-js/user.d.ts +1 -1
  57. package/dist/runtime/internal/clerk-js/web3.d.mts +1 -1
  58. package/dist/runtime/internal/clerk-js/web3.d.ts +1 -1
  59. package/dist/runtime/jwtPayloadParser.d.mts +1 -1
  60. package/dist/runtime/jwtPayloadParser.d.ts +1 -1
  61. package/dist/runtime/keys.d.mts +1 -1
  62. package/dist/runtime/keys.d.ts +1 -1
  63. package/dist/runtime/loadClerkJsScript.d.mts +1 -1
  64. package/dist/runtime/loadClerkJsScript.d.ts +1 -1
  65. package/dist/runtime/loadClerkJsScript.js +2 -2
  66. package/dist/runtime/loadClerkJsScript.js.map +1 -1
  67. package/dist/runtime/loadClerkJsScript.mjs +2 -2
  68. package/dist/runtime/loadClerkJsScript.mjs.map +1 -1
  69. package/dist/runtime/oauth.d.mts +1 -1
  70. package/dist/runtime/oauth.d.ts +1 -1
  71. package/dist/runtime/{organization-BzYWUtt4.js → organization-BOnxJJGM.js} +5 -6
  72. package/dist/runtime/organization-BOnxJJGM.js.map +1 -0
  73. package/dist/runtime/{organization-JwY1zGRo.mjs → organization-CDNOZNzF.mjs} +5 -6
  74. package/dist/runtime/organization-CDNOZNzF.mjs.map +1 -0
  75. package/dist/runtime/organization.d.mts +5 -6
  76. package/dist/runtime/organization.d.mts.map +1 -1
  77. package/dist/runtime/organization.d.ts +5 -6
  78. package/dist/runtime/organization.d.ts.map +1 -1
  79. package/dist/runtime/organization.js +1 -1
  80. package/dist/runtime/organization.mjs +1 -1
  81. package/dist/runtime/pathMatcher.d.mts +1 -1
  82. package/dist/runtime/pathMatcher.d.ts +1 -1
  83. package/dist/runtime/react/index.d.mts +66 -24
  84. package/dist/runtime/react/index.d.mts.map +1 -1
  85. package/dist/runtime/react/index.d.ts +66 -24
  86. package/dist/runtime/react/index.d.ts.map +1 -1
  87. package/dist/runtime/react/index.js +91 -6
  88. package/dist/runtime/react/index.js.map +1 -1
  89. package/dist/runtime/react/index.mjs +90 -7
  90. package/dist/runtime/react/index.mjs.map +1 -1
  91. package/dist/runtime/router.d.mts +1 -1
  92. package/dist/runtime/router.d.mts.map +1 -1
  93. package/dist/runtime/router.d.ts +1 -1
  94. package/dist/runtime/saml.d.mts +1 -1
  95. package/dist/runtime/saml.d.ts +1 -1
  96. package/dist/runtime/telemetry.d.mts +1 -1
  97. package/dist/runtime/telemetry.d.ts +1 -1
  98. package/dist/runtime/types/index.d.mts +1 -1
  99. package/dist/runtime/types/index.d.ts +1 -1
  100. package/dist/runtime/ui/index.d.mts +1 -1
  101. package/dist/runtime/ui/index.d.ts +1 -1
  102. package/dist/runtime/{url-CeALciQG.d.ts → url-8kDLvJOc.d.ts} +2 -2
  103. package/dist/runtime/{url-CeALciQG.d.ts.map → url-8kDLvJOc.d.ts.map} +1 -1
  104. package/dist/runtime/{url-BQX5m-Ax.d.mts → url-CixoZcz6.d.mts} +2 -2
  105. package/dist/runtime/{url-BQX5m-Ax.d.mts.map → url-CixoZcz6.d.mts.map} +1 -1
  106. package/dist/runtime/{versionSelector-BCQasG48.mjs → versionSelector-CxJwijym.mjs} +3 -3
  107. package/dist/runtime/{versionSelector-BCQasG48.mjs.map → versionSelector-CxJwijym.mjs.map} +1 -1
  108. package/dist/runtime/{versionSelector-CwoA_vh7.js → versionSelector-Dk9qBo_s.js} +3 -3
  109. package/dist/runtime/{versionSelector-CwoA_vh7.js.map → versionSelector-Dk9qBo_s.js.map} +1 -1
  110. package/dist/runtime/versionSelector.js +1 -1
  111. package/dist/runtime/versionSelector.mjs +1 -1
  112. package/dist/runtime/web3.d.mts +1 -1
  113. package/dist/runtime/web3.d.ts +1 -1
  114. package/dist/types/index.d.mts +194 -142
  115. package/dist/types/index.d.mts.map +1 -1
  116. package/dist/types/index.d.ts +194 -142
  117. package/dist/types/index.d.ts.map +1 -1
  118. package/package.json +1 -1
  119. package/dist/runtime/index-CBjE4nAT.d.mts.map +0 -1
  120. package/dist/runtime/index-eJWs3zJx.d.ts.map +0 -1
  121. package/dist/runtime/organization-BzYWUtt4.js.map +0 -1
  122. package/dist/runtime/organization-JwY1zGRo.mjs.map +0 -1
@@ -5,7 +5,7 @@ import "../keys-BGyzAyGu.mjs";
5
5
  import { n as reverificationError, t as isReverificationHint } from "../authorization-errors-CBHAr6Ld.mjs";
6
6
  import { i as validateReverificationConfig } from "../authorization-BpjgWZx-.mjs";
7
7
  import { g as ClerkRuntimeError, i as isClerkAPIResponseError } from "../error-D6MGXq-n.mjs";
8
- import { t as getCurrentOrganizationMembership } from "../organization-JwY1zGRo.mjs";
8
+ import { t as getCurrentOrganizationMembership } from "../organization-CDNOZNzF.mjs";
9
9
  import "../noop-Dzu7lrge.mjs";
10
10
  import "../underscore-Cv_9NQ-X.mjs";
11
11
  import { a as eventMethodCalled } from "../telemetry-DnVD78JJ.mjs";
@@ -581,7 +581,7 @@ const undefinedPaginatedResource$1 = {
581
581
  setData: void 0
582
582
  };
583
583
  /**
584
- * The `useOrganization()` hook retrieves attributes of the currently active organization.
584
+ * The `useOrganization()` hook retrieves attributes of the currently Active Organization.
585
585
  *
586
586
  * @example
587
587
  * ### Expand and paginate attributes
@@ -616,7 +616,7 @@ const undefinedPaginatedResource$1 = {
616
616
  * @example
617
617
  * ### Infinite pagination
618
618
  *
619
- * The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list.
619
+ * The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `memberships` attribute will be populated with the first page of the Organization's memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list.
620
620
  *
621
621
  * ```tsx
622
622
  * import { useOrganization } from '@clerk/react'
@@ -660,7 +660,7 @@ const undefinedPaginatedResource$1 = {
660
660
  * @example
661
661
  * ### Simple pagination
662
662
  *
663
- * The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of memberships.
663
+ * The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `memberships` attribute will be populated with the first page of the Organization's memberships. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of memberships.
664
664
  *
665
665
  * Notice the difference between this example's pagination and the infinite pagination example above.
666
666
  *
@@ -923,7 +923,7 @@ const undefinedPaginatedResource = {
923
923
  * @example
924
924
  * ### Infinite pagination
925
925
  *
926
- * The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `userMemberships` attribute will be populated with the first page of the user's organization memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list.
926
+ * The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `userMemberships` attribute will be populated with the first page of the user's Organization memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list.
927
927
  *
928
928
  * ```tsx {{ filename: 'src/components/JoinedOrganizations.tsx' }}
929
929
  * import { useOrganizationList } from '@clerk/react'
@@ -1598,7 +1598,7 @@ function useBillingHookEnabled(params) {
1598
1598
  //#region src/react/hooks/createBillingPaginatedHook.tsx
1599
1599
  /**
1600
1600
  * A hook factory that creates paginated data fetching hooks for commerce-related resources.
1601
- * It provides a standardized way to create hooks that can fetch either user or organization resources
1601
+ * It provides a standardized way to create hooks that can fetch either user or Organization resources
1602
1602
  * with built-in pagination support.
1603
1603
  *
1604
1604
  * The generated hooks handle:
@@ -2498,5 +2498,88 @@ const usePaymentElement = () => {
2498
2498
  };
2499
2499
 
2500
2500
  //#endregion
2501
- export { ClerkInstanceContext, ClientContext, OptionsContext, OrganizationProvider, SessionContext, UserContext, __experimental_CheckoutProvider, PaymentElement as __experimental_PaymentElement, PaymentElementProvider as __experimental_PaymentElementProvider, useAPIKeys as __experimental_useAPIKeys, useCheckout as __experimental_useCheckout, usePaymentAttempts as __experimental_usePaymentAttempts, usePaymentElement as __experimental_usePaymentElement, usePaymentMethods as __experimental_usePaymentMethods, usePlans as __experimental_usePlans, useStatements as __experimental_useStatements, useSubscription as __experimental_useSubscription, __internal_usePaymentAttemptQuery, usePlanDetailsQuery as __internal_usePlanDetailsQuery, __internal_useStatementQuery, assertContextExists, createContextAndHook, isDeeplyEqual, useAssertWrappedByClerkProvider, useAttemptToEnableOrganizations, useClerk, useClerkInstanceContext, useClientContext, useDeepEqualMemo, useOptionsContext, useOrganization, useOrganizationContext, useOrganizationList, useReverification, useSafeLayoutEffect, useSession, useSessionContext, useSessionList, useUser, useUserContext };
2501
+ //#region src/react/portal-root-manager.ts
2502
+ /**
2503
+ * PortalRootManager manages a stack of portal root containers.
2504
+ * This allows PortalProvider to work across separate React trees
2505
+ * (e.g., when Clerk modals are rendered in a different tree via Components.tsx).
2506
+ */
2507
+ var PortalRootManager = class {
2508
+ stack = [];
2509
+ /**
2510
+ * Push a new portal root getter onto the stack.
2511
+ * @param getContainer Function that returns the container element
2512
+ */
2513
+ push(getContainer) {
2514
+ this.stack.push(getContainer);
2515
+ }
2516
+ /**
2517
+ * Pop the most recent portal root from the stack.
2518
+ */
2519
+ pop() {
2520
+ this.stack.pop();
2521
+ }
2522
+ /**
2523
+ * Get the current (topmost) portal root container.
2524
+ * @returns The container element or null if no provider is active
2525
+ */
2526
+ getCurrent() {
2527
+ if (this.stack.length === 0) return null;
2528
+ const getContainer = this.stack[this.stack.length - 1];
2529
+ return getContainer();
2530
+ }
2531
+ };
2532
+ const portalRootManager = new PortalRootManager();
2533
+
2534
+ //#endregion
2535
+ //#region src/react/PortalProvider.tsx
2536
+ const [PortalContext, , usePortalContextWithoutGuarantee] = createContextAndHook("PortalProvider");
2537
+ /**
2538
+ * PortalProvider allows you to specify a custom container for all Clerk floating UI elements
2539
+ * (popovers, modals, tooltips, etc.) that use portals.
2540
+ *
2541
+ * This is particularly useful when using Clerk components inside external UI libraries
2542
+ * like Radix Dialog or React Aria Components, where portaled elements need to render
2543
+ * within the dialog's container to remain interactable.
2544
+ *
2545
+ * @example
2546
+ * ```tsx
2547
+ * function Example() {
2548
+ * const containerRef = useRef(null);
2549
+ * return (
2550
+ * <RadixDialog ref={containerRef}>
2551
+ * <PortalProvider getContainer={() => containerRef.current}>
2552
+ * <UserButton />
2553
+ * </PortalProvider>
2554
+ * </RadixDialog>
2555
+ * );
2556
+ * }
2557
+ * ```
2558
+ */
2559
+ const PortalProvider = ({ children, getContainer }) => {
2560
+ const getContainerRef = useRef(getContainer);
2561
+ getContainerRef.current = getContainer;
2562
+ useEffect(() => {
2563
+ const getContainerWrapper = () => getContainerRef.current();
2564
+ portalRootManager.push(getContainerWrapper);
2565
+ return () => {
2566
+ portalRootManager.pop();
2567
+ };
2568
+ }, []);
2569
+ const contextValue = React.useMemo(() => ({ value: { getContainer } }), [getContainer]);
2570
+ return /* @__PURE__ */ React.createElement(PortalContext.Provider, { value: contextValue }, children);
2571
+ };
2572
+ /**
2573
+ * Hook to get the current portal root container.
2574
+ * First checks React context (for same-tree components),
2575
+ * then falls back to PortalRootManager (for cross-tree like modals).
2576
+ */
2577
+ const usePortalRoot = () => {
2578
+ const contextValue = usePortalContextWithoutGuarantee();
2579
+ if (contextValue && "getContainer" in contextValue && contextValue.getContainer) return contextValue.getContainer;
2580
+ return portalRootManager.getCurrent.bind(portalRootManager);
2581
+ };
2582
+
2583
+ //#endregion
2584
+ export { ClerkInstanceContext, ClientContext, OptionsContext, OrganizationProvider, PortalProvider, SessionContext, UserContext, __experimental_CheckoutProvider, PaymentElement as __experimental_PaymentElement, PaymentElementProvider as __experimental_PaymentElementProvider, useAPIKeys as __experimental_useAPIKeys, useCheckout as __experimental_useCheckout, usePaymentAttempts as __experimental_usePaymentAttempts, usePaymentElement as __experimental_usePaymentElement, usePaymentMethods as __experimental_usePaymentMethods, usePlans as __experimental_usePlans, useStatements as __experimental_useStatements, useSubscription as __experimental_useSubscription, __internal_usePaymentAttemptQuery, usePlanDetailsQuery as __internal_usePlanDetailsQuery, __internal_useStatementQuery, assertContextExists, createContextAndHook, isDeeplyEqual, useAssertWrappedByClerkProvider, useAttemptToEnableOrganizations, useClerk, useClerkInstanceContext, useClientContext, useDeepEqualMemo, useOptionsContext, useOrganization, useOrganizationContext, useOrganizationList, usePortalRoot, useReverification, useSafeLayoutEffect, useSession, useSessionContext, useSessionList, useUser, useUserContext };
2502
2585
  //# sourceMappingURL=index.mjs.map