@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
@@ -6,7 +6,7 @@ require('../keys-wr08qE7Y.js');
6
6
  const require_authorization_errors = require('../authorization-errors-B7aH39AU.js');
7
7
  const require_authorization = require('../authorization-R5uuaK2u.js');
8
8
  const require_error = require('../error-C4TyorFL.js');
9
- const require_organization = require('../organization-BzYWUtt4.js');
9
+ const require_organization = require('../organization-BOnxJJGM.js');
10
10
  require('../noop-DEV2Xnb4.js');
11
11
  require('../underscore-moIbQc1H.js');
12
12
  const require_telemetry = require('../telemetry-CXXDXYfo.js');
@@ -586,7 +586,7 @@ const undefinedPaginatedResource$1 = {
586
586
  setData: void 0
587
587
  };
588
588
  /**
589
- * The `useOrganization()` hook retrieves attributes of the currently active organization.
589
+ * The `useOrganization()` hook retrieves attributes of the currently Active Organization.
590
590
  *
591
591
  * @example
592
592
  * ### Expand and paginate attributes
@@ -621,7 +621,7 @@ const undefinedPaginatedResource$1 = {
621
621
  * @example
622
622
  * ### Infinite pagination
623
623
  *
624
- * 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.
624
+ * 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.
625
625
  *
626
626
  * ```tsx
627
627
  * import { useOrganization } from '@clerk/react'
@@ -665,7 +665,7 @@ const undefinedPaginatedResource$1 = {
665
665
  * @example
666
666
  * ### Simple pagination
667
667
  *
668
- * 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.
668
+ * 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.
669
669
  *
670
670
  * Notice the difference between this example's pagination and the infinite pagination example above.
671
671
  *
@@ -928,7 +928,7 @@ const undefinedPaginatedResource = {
928
928
  * @example
929
929
  * ### Infinite pagination
930
930
  *
931
- * 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.
931
+ * 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.
932
932
  *
933
933
  * ```tsx {{ filename: 'src/components/JoinedOrganizations.tsx' }}
934
934
  * import { useOrganizationList } from '@clerk/react'
@@ -1603,7 +1603,7 @@ function useBillingHookEnabled(params) {
1603
1603
  //#region src/react/hooks/createBillingPaginatedHook.tsx
1604
1604
  /**
1605
1605
  * A hook factory that creates paginated data fetching hooks for commerce-related resources.
1606
- * It provides a standardized way to create hooks that can fetch either user or organization resources
1606
+ * It provides a standardized way to create hooks that can fetch either user or Organization resources
1607
1607
  * with built-in pagination support.
1608
1608
  *
1609
1609
  * The generated hooks handle:
@@ -2502,11 +2502,95 @@ const usePaymentElement = () => {
2502
2502
  };
2503
2503
  };
2504
2504
 
2505
+ //#endregion
2506
+ //#region src/react/portal-root-manager.ts
2507
+ /**
2508
+ * PortalRootManager manages a stack of portal root containers.
2509
+ * This allows PortalProvider to work across separate React trees
2510
+ * (e.g., when Clerk modals are rendered in a different tree via Components.tsx).
2511
+ */
2512
+ var PortalRootManager = class {
2513
+ stack = [];
2514
+ /**
2515
+ * Push a new portal root getter onto the stack.
2516
+ * @param getContainer Function that returns the container element
2517
+ */
2518
+ push(getContainer) {
2519
+ this.stack.push(getContainer);
2520
+ }
2521
+ /**
2522
+ * Pop the most recent portal root from the stack.
2523
+ */
2524
+ pop() {
2525
+ this.stack.pop();
2526
+ }
2527
+ /**
2528
+ * Get the current (topmost) portal root container.
2529
+ * @returns The container element or null if no provider is active
2530
+ */
2531
+ getCurrent() {
2532
+ if (this.stack.length === 0) return null;
2533
+ const getContainer = this.stack[this.stack.length - 1];
2534
+ return getContainer();
2535
+ }
2536
+ };
2537
+ const portalRootManager = new PortalRootManager();
2538
+
2539
+ //#endregion
2540
+ //#region src/react/PortalProvider.tsx
2541
+ const [PortalContext, , usePortalContextWithoutGuarantee] = createContextAndHook("PortalProvider");
2542
+ /**
2543
+ * PortalProvider allows you to specify a custom container for all Clerk floating UI elements
2544
+ * (popovers, modals, tooltips, etc.) that use portals.
2545
+ *
2546
+ * This is particularly useful when using Clerk components inside external UI libraries
2547
+ * like Radix Dialog or React Aria Components, where portaled elements need to render
2548
+ * within the dialog's container to remain interactable.
2549
+ *
2550
+ * @example
2551
+ * ```tsx
2552
+ * function Example() {
2553
+ * const containerRef = useRef(null);
2554
+ * return (
2555
+ * <RadixDialog ref={containerRef}>
2556
+ * <PortalProvider getContainer={() => containerRef.current}>
2557
+ * <UserButton />
2558
+ * </PortalProvider>
2559
+ * </RadixDialog>
2560
+ * );
2561
+ * }
2562
+ * ```
2563
+ */
2564
+ const PortalProvider = ({ children, getContainer }) => {
2565
+ const getContainerRef = (0, react.useRef)(getContainer);
2566
+ getContainerRef.current = getContainer;
2567
+ (0, react.useEffect)(() => {
2568
+ const getContainerWrapper = () => getContainerRef.current();
2569
+ portalRootManager.push(getContainerWrapper);
2570
+ return () => {
2571
+ portalRootManager.pop();
2572
+ };
2573
+ }, []);
2574
+ const contextValue = react.default.useMemo(() => ({ value: { getContainer } }), [getContainer]);
2575
+ return /* @__PURE__ */ react.default.createElement(PortalContext.Provider, { value: contextValue }, children);
2576
+ };
2577
+ /**
2578
+ * Hook to get the current portal root container.
2579
+ * First checks React context (for same-tree components),
2580
+ * then falls back to PortalRootManager (for cross-tree like modals).
2581
+ */
2582
+ const usePortalRoot = () => {
2583
+ const contextValue = usePortalContextWithoutGuarantee();
2584
+ if (contextValue && "getContainer" in contextValue && contextValue.getContainer) return contextValue.getContainer;
2585
+ return portalRootManager.getCurrent.bind(portalRootManager);
2586
+ };
2587
+
2505
2588
  //#endregion
2506
2589
  exports.ClerkInstanceContext = ClerkInstanceContext;
2507
2590
  exports.ClientContext = ClientContext;
2508
2591
  exports.OptionsContext = OptionsContext;
2509
2592
  exports.OrganizationProvider = OrganizationProvider;
2593
+ exports.PortalProvider = PortalProvider;
2510
2594
  exports.SessionContext = SessionContext;
2511
2595
  exports.UserContext = UserContext;
2512
2596
  exports.__experimental_CheckoutProvider = __experimental_CheckoutProvider;
@@ -2536,6 +2620,7 @@ exports.useOptionsContext = useOptionsContext;
2536
2620
  exports.useOrganization = useOrganization;
2537
2621
  exports.useOrganizationContext = useOrganizationContext;
2538
2622
  exports.useOrganizationList = useOrganizationList;
2623
+ exports.usePortalRoot = usePortalRoot;
2539
2624
  exports.useReverification = useReverification;
2540
2625
  exports.useSafeLayoutEffect = useSafeLayoutEffect;
2541
2626
  exports.useSession = useSession;