@auth0/auth0-acul-react 1.0.0-alpha.1 → 1.0.0-alpha.2

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 (39) hide show
  1. package/README.md +213 -10
  2. package/dist/export/getting-started.d.ts +1 -1
  3. package/dist/export/hooks.d.ts +1 -1
  4. package/dist/hooks/common/errors.d.ts +11 -11
  5. package/dist/hooks/common/errors.js +1 -1
  6. package/dist/hooks/common/errors.js.map +1 -1
  7. package/dist/hooks/index.d.ts +1 -0
  8. package/dist/hooks/utility/passkey-autofill.d.ts +86 -0
  9. package/dist/hooks/utility/passkey-autofill.js +2 -0
  10. package/dist/hooks/utility/passkey-autofill.js.map +1 -0
  11. package/dist/hooks/utility/polling-manager.d.ts +1 -0
  12. package/dist/hooks/utility/polling-manager.js.map +1 -1
  13. package/dist/hooks/utility/validate-password.js +1 -1
  14. package/dist/hooks/utility/validate-password.js.map +1 -1
  15. package/dist/hooks/utility/validate-username.js +1 -1
  16. package/dist/hooks/utility/validate-username.js.map +1 -1
  17. package/dist/screens/login-id.d.ts +1 -0
  18. package/dist/screens/login-id.js +1 -1
  19. package/dist/screens/login-id.js.map +1 -1
  20. package/dist/screens/login-password.d.ts +2 -1
  21. package/dist/screens/login-password.js +1 -1
  22. package/dist/screens/login-password.js.map +1 -1
  23. package/dist/screens/mfa-login-options.d.ts +2 -1
  24. package/dist/screens/mfa-login-options.js +1 -1
  25. package/dist/screens/mfa-login-options.js.map +1 -1
  26. package/dist/screens/mfa-push-enrollment-qr.d.ts +1 -0
  27. package/dist/screens/mfa-push-enrollment-qr.js +1 -1
  28. package/dist/screens/mfa-push-enrollment-qr.js.map +1 -1
  29. package/dist/screens/phone-identifier-challenge.d.ts +2 -0
  30. package/dist/screens/phone-identifier-challenge.js +1 -1
  31. package/dist/screens/phone-identifier-challenge.js.map +1 -1
  32. package/dist/screens/signup-password.d.ts +2 -1
  33. package/dist/screens/signup-password.js +1 -1
  34. package/dist/screens/signup-password.js.map +1 -1
  35. package/dist/state/error-store.d.ts +4 -4
  36. package/dist/state/error-store.js +1 -1
  37. package/dist/state/error-store.js.map +1 -1
  38. package/dist/telemetry.js +1 -1
  39. package/package.json +4 -3
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Auth0 ACUL React SDK
2
2
 
3
+ ![ACUL React SDK](https://cdn.auth0.com/website/sdks/banners/auth0-acul-react-banner.png)
4
+
3
5
  <div align="center">
4
6
 
5
7
  [![NPM Version](https://img.shields.io/npm/v/@auth0/auth0-acul-react)](https://www.npmjs.com/package/@auth0/auth0-acul-react)
@@ -11,7 +13,7 @@
11
13
 
12
14
  <div align='center'>
13
15
 
14
- 📚 [Documentation](#-documentation) | 🚀 [Getting Started](#-getting-started) | 💻 [API Reference](#-api-reference) | 💬 [Feedback](#-feedback)
16
+ 📚 [Documentation](#documentation) | 🚀 [Getting Started](#getting-started) | 💻 [API Reference](#api-reference) | 🪝 [Hooks](#hooks) | [Examples](#examples) | 💬 [Feedback](#feedback)
15
17
 
16
18
  </div>
17
19
 
@@ -23,7 +25,24 @@ Developers using Auth0’s Universal Login can use this React SDK to customize s
23
25
  >
24
26
  > This feature is still in **Early Access**.
25
27
 
26
- ## Installation
28
+ <a id="documentation"></a>
29
+ ## 📚 Documentation
30
+
31
+ - [Quickstart](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/sdk-quickstart) - our guide for setting up the SDK on your app.
32
+ - [Guides](https://auth0.com/docs/customize/login-pages/advanced-customizations/screens) - more guides for common use cases
33
+ - [Examples](https://github.com/auth0/universal-login/tree/master/packages/auth0-acul-react/examples) - code snippets for different customization use cases.
34
+
35
+ <a id="getting-started"></a>
36
+ ## 🚀 Getting started
37
+
38
+ ### Prerequisites
39
+ Before starting, ensure that you have the following setup:
40
+
41
+ 1. **Custom Domain**: Ensure that a custom domain is configured for your Auth0 tenant.
42
+ 2. **Screen Configuration**: Set up the required authentication screens within your Auth0 flow.
43
+ For detailed steps, refer to the [Configure ACUL Screens](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens).
44
+
45
+ ### Installation
27
46
 
28
47
  ```bash
29
48
  npm install @auth0/auth0-acul-react
@@ -33,11 +52,13 @@ Peer dependency:
33
52
  ```bash
34
53
  npm install react
35
54
  ```
36
- ---
37
- ## Importing the SDK
38
- The SDK supports `partial imports` for each screen, allowing you to include only the code you need for your specific use case. This helps keep your bundle size small and improves performance.
39
- Also, you can use a `root import` to load all screens from a single bundle if your app requires it.
40
- ### Partial Imports
55
+
56
+ ### Importing the SDK
57
+ The SDK supports `partial imports` for each screen, allowing you to include only the code you need for your specific use case. This helps keep your bundle size small and improves performance.
58
+
59
+ Also, you can use a `root import` to load all screens from a single bundle if your app requires it.
60
+
61
+ #### Partial Imports
41
62
  Each screen has its own set of hooks and methods. You can import only what you need for the screen you're building.
42
63
 
43
64
  The following example shows how to import and use SDK to build `login-id` screen.
@@ -71,7 +92,7 @@ import {
71
92
 
72
93
  ---
73
94
 
74
- ### Root Imports
95
+ #### Root Imports
75
96
 
76
97
  The SDK also supports a root import, which lets you load all screens from a single bundle.
77
98
  This is useful if your app dynamically renders different screens at runtime based on the current Auth0 flow, for example, when you want one unified build that can handle all possible screens.
@@ -94,7 +115,7 @@ import {
94
115
  ```
95
116
  ---
96
117
 
97
- ### Types / Interfaces
118
+ #### Types / Interfaces
98
119
  Typescript types and interfaces can be imported from `@auth0/auth0-acul-react/types` for type safety and better DX.
99
120
  ```tsx
100
121
  import type {
@@ -110,10 +131,192 @@ Refer to our [API Reference](#-api-reference) for the full list of available typ
110
131
 
111
132
  ---
112
133
 
134
+ <a id="api-reference"></a>
135
+ ## 💻 API Reference
136
+ ### Screens
137
+
138
+ | No. | Prompt | Screen Name | Documentation Link |
139
+ |--------|--------------------|-------------------|--------------------------------------------------------------------------------------------|
140
+ | 1 | login | login | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.Login) |
141
+ | 2 | loginId | login-id | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.LoginId) |
142
+ | 3 | login-password | login-password | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.LoginPassword) |
143
+ | 4 | signup-id | signup-id | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.SignupId) |
144
+ | 5 | signup-password | signup-password | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.SignupPassword) |
145
+
146
+ <details>
147
+ <summary>Explore more screens...</summary>
148
+
149
+ | No. | Prompt | Screen Name | Documentation Link |
150
+ |--------|--------------------------------|-------------------------------------------|-------------------------------------------------------------------------------------------------------|
151
+ | 6 | login-passwordless | login-passwordless-email-code | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.LoginPasswordlessEmailCode) |
152
+ | 7 | login-passwordless | login-passwordless-sms-otp | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.LoginPasswordlessSmsOtp) |
153
+ | 8 | passkeys | passkey-enrollment | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.PasskeyEnrollment) |
154
+ | 9 | passkeys | passkey-enrollment-local | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.PasskeyEnrollmentLocal) |
155
+ | 10 | phone-identifier-enrollment | phone-identifier-enrollment | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.PhoneIdentifierEnrollment) |
156
+ | 11 | phone-identifier-challenge | phone-identifier-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.PhoneIdentifierChallenge) |
157
+ | 12 | email-identifier-challenge | email-identifier-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.EmailIdentifierChallenge) |
158
+ | 13 | captcha | interstitial-captcha | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.InterstitialCaptcha) |
159
+ | 14 | reset-password | reset-password-email | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.ResetPasswordEmail) |
160
+ | 15 | reset-password | reset-password-request | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.ResetPasswordRequest) |
161
+ | 16 | reset-password | reset-password | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.ResetPassword) |
162
+ | 17 | reset-password | reset-password-error | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.ResetPasswordError) |
163
+ | 18 | reset-password | reset-password-success | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.ResetPasswordSuccess) |
164
+ | 19 | signup | signup | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.Signup) |
165
+ | 20 | mfa | mfa-detect-browser-capabilities | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaDetectBrowserCapabilities) |
166
+ | 21 | mfa | mfa-enroll-result | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaEnrollResult) |
167
+ | 22 | mfa | mfa-begin-enroll-options | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaBeginEnrollOptions) |
168
+ | 23 | mfa | mfa-login-options | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaLoginOptions) |
169
+ | 24 | mfa-push | mfa-push-enrollment-qr | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaPushEnrollmentQr) |
170
+ | 25 | mfa-push | mfa-push-welcome | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaPushWelcome) |
171
+ | 26 | mfa-push | mfa-push-challenge-push | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaPushChallengePush) |
172
+ | 27 | mfa-push | mfa-push-list | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaPushList) |
173
+ | 28 | mfa-sms | mfa-country-codes | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaCountryCodes) |
174
+ | 29 | mfa-sms | mfa-sms-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaSmsChallenge) |
175
+ | 30 | mfa-sms | mfa-sms-enrollment | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaSmsEnrollment) |
176
+ | 31 | mfa-sms | mfa-sms-list | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaSmsList) |
177
+ | 32 | mfa-email | mfa-email-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaEmailChallenge) |
178
+ | 33 | mfa-email | mfa-email-list | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaEmailList) |
179
+ | 34 | invitatino | accept-invitation | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.AcceptInvitation) |
180
+ | 35 | organizations | organization-picker | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.OrganizationPicker) |
181
+ | 36 | organizations | organization-selection | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.OrganizationSelection) |
182
+ | 37 | reset-password | mfa-otp-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaOtpChallenge) |
183
+ | 38 | mfa-otp | mfa-otp-enrollment-code | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaOtpEnrollmentCode) |
184
+ | 39 | mfa-otp | mfa-otp-enrollment-qr | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaOtpEnrollmentQr) |
185
+ | 40 | reset-password | reset-password-mfa-email-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.ResetPasswordMfaEmailChallenge) |
186
+ | 41 | reset-password | reset-password-mfa-push-challenge-push | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.ResetPasswordMfaPushChallengePush)|
187
+ | 42 | reset-password | mfa-sms-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.ResetPasswordMfaSmsChallenge) |
188
+ | 43 | reset-password | reset-password-mfa-otp-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.OrganizationSelection) |
189
+ | 44 | mfa-phone | mfa-phone-enrollment | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaPhoneEnrollment) |
190
+ | 45 | mfa-voice | mfa-voice-enrollment | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaVoiceEnrollment) |
191
+ | 46 | mfa-recovery-code | mfa-recovery-code-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaRecoveryCodeChallenge) |
192
+ | 47 | device-flow | device-code-activation-allowed | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.DeviceCodeActivationAllowed) |
193
+ | 48 | device-flow | device-code-activation-denied | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.DeviceCodeActivationDenied) |
194
+ | 49 | device-flow | device-code-activation | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.DeviceCodeActivation) |
195
+ | 50 | reset-password | reset-password-mfa-recovery-code-challenge | [Link](https://auth0.github.io/universallogin/classes/Classes.ResetPasswordMfaRecoveryCodeChallenge) |
196
+ | 51 | reset-password | reset-password-mfa-voice | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.ResetPasswordMfaVoiceChallenge) |
197
+ | 52 | common | redeem-ticket | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.RedeemTicket) |
198
+ | 53 | device-flow | device-code-confirmation | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.DeviceCodeConfirmation) |
199
+ | 54 | mfa-phone | mfa-phone-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaPhoneChallenge) |
200
+ | 55 | mfa-voice | mfa-voice-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaVoiceChallenge) |
201
+ | 56 | mfa-recovery-code | mfa-recovery-code-enrollment | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaRecoveryCodeEnrollment) |
202
+ | 57 | reset-password | reset-password-mfa-phone-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.ResetPasswordMfaPhoneChallenge) |
203
+ | 58 | mfa-recovery-code | mfa-recovery-code-challenge-new-code | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaRecoveryCodeChallengeNewCode) |
204
+ | 59 | logout | logout | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.Logout) |
205
+ | 60 | logout | logout-aborted | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.LogoutAborted) |
206
+ | 61 | logout | logout-complete | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.LogoutComplete) |
207
+ | 62 | email-verification | email-verification-result | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.EmailVerificationResult) |
208
+ | 63 | login-email-verification | login-email-verification | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.LoginEmailVerification) |
209
+ | 64 |mfa-webauthn | mfa-webauthn-platform-enrollment | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaWebAuthnPlatformEnrollment) |
210
+ | 65 |mfa-webauthn | mfa-webauthn-error | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaWebAuthnError) |
211
+ | 66 |mfa-webauthn | mfa-webauthn-roaming-enrollment | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaWebAuthnRoamingEnrollment) |
212
+ | 67 |mfa-webauthn | mfa-webauthn-roaming-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaWebAuthnRoamingChallenge) |
213
+ | 68 |mfa-webauthn | mfa-webauthn-platform-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaWebAuthnPlatformChallenge) |
214
+ | 69 |mfa-webauthn | mfa-webauthn-enrollment-success | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaWebAuthnEnrollmentSuccess) |
215
+ | 70 |mfa-webauthn | mfa-webauthn-change-key-nickname | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaWebAuthnChangeKeyNickname) |
216
+ | 71 |mfa-webauthn | mfa-webauthn-not-available-error | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.MfaWebAuthnNotAvailableError) |
217
+ | 72 |reset-password | reset-password-mfa-webauthn-platform-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.ResetPasswordMfaWebAuthnPlatformChallenge) |
218
+ | 73 |reset-password | reset-password-mfa-webauthn-roaming-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.ResetPasswordMfaWebAuthnRoamingChallenge) |
219
+ | 74 |consent | consent | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.consent) |
220
+ | 75 |customized-consent | customized-consent | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.CustomizedConsent) |
221
+ | 76 |email-otp-challenge | email-otp-challenge | [Link](https://acul-docs.netlify.app/auth0-acul-react/modules/Screens.EmailOTPChallenge) |
222
+ </details>
223
+
224
+ ---
225
+
226
+ ## Hooks
227
+ ### Context Hooks (Available in all screens)
228
+ - `useUser()` - Current user information
229
+ - `useTenant()` - Tenant configuration
230
+ - `useClient()` - Application client information
231
+ - `useScreen()` - Current screen data and configuration
232
+ - `useTransaction()` - Transaction state and methods
233
+ - `useBranding()` - Tenant branding and theme
234
+ - `useOrganization()` - Organization context (if applicable)
235
+ - `usePrompt()` - Current authentication prompt
236
+ - `useUntrustedData()` - Untrusted data from the authentication flow
237
+
238
+ ### Utility Hooks
239
+ Specialized hooks for form validation, polling, and identifier management:
240
+
241
+ #### Identifier Management
242
+ - `useLoginIdentifiers()` - Get available login identifier types (email, phone, username)
243
+ - `useSignupIdentifiers()` - Get available signup identifier types, each with its `required` status
244
+
245
+ #### Form Validation
246
+ - `usePasswordValidation(password, rules)` - Real-time password strength validation
247
+ - `useUsernameValidation(username)` - Username format and availability validation
248
+
249
+ #### MFA & Polling
250
+ - `useMfaPolling(options)` - Manage MFA push notification polling lifecycle
251
+ - `useResend(options)` - Handle resend operations with cooldown timers
252
+
253
+ ### Common Hooks
254
+ General-purpose hooks available across all screens:
255
+
256
+ #### Screen Management
257
+ - `useCurrentScreen()` - Get complete current screen context data
258
+ - `useAuth0Themes()` - Access tenant branding and theme configuration
259
+
260
+ #### Error Handling
261
+ - `useErrors(options)` - Comprehensive error management with categorization
262
+ - Filter by error kind: `'validation'`, `'auth0'`, `'configuration'`
263
+ - Filter by field name for form-specific errors
264
+ - Dismiss individual or all errors
265
+
266
+ ### Screen-Specific Action Methods
267
+ Each screen module exports methods for screen actions:
268
+
269
+ ```tsx
270
+ // Login ID Screen
271
+ import {
272
+ loginMethod,
273
+ continueWithFederatedLogin
274
+ } from '@auth0/auth0-acul-react/login-id';
275
+
276
+ // Password Screen
277
+ import {
278
+ loginMethod,
279
+ forgotPasswordMethod
280
+ } from '@auth0/auth0-acul-react/login-password';
281
+
282
+ // MFA Push Challenge
283
+ import {
284
+ continueMethod,
285
+ resendPushNotification,
286
+ useMfaPolling
287
+ } from '@auth0/auth0-acul-react/mfa-push-challenge-push';
288
+ ```
289
+
113
290
  ## Examples
114
- Check out the [`examples/`](https://github.com/auth0/universal-login/tree/main/packages/auth0-acul-react/examples) directory for complete, working examples of how to use this SDK to build custom Universal Login screens.
291
+ - [React Examples](https://github.com/auth0/universal-login/tree/master/packages/auth0-acul-react/examples) - Complete React component examples
292
+ - [React Boilerplate](https://github.com/auth0/auth0-acul-react-boilerplate) - Full React application template
115
293
 
116
294
  ---
295
+
296
+ <a id="feedback"></a>
297
+ ## 💬 Feedback
298
+
299
+ ### Contributing
300
+
301
+ We appreciate feedback and contribution to this repo! Before you get started, please see the following:
302
+
303
+ - [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
304
+ - [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)
305
+
306
+ ### Raise an issue
307
+
308
+ To provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/auth0/universal-login/issues).
309
+
310
+ ### Vulnerability Reporting
311
+
312
+ Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues.
313
+
314
+ ### Legal
315
+
316
+ **Early Access.** This SDK and its associated product are made available only in Early Access ("EA") format and are governed by the Free Trial terms of the [Okta Master Subscription Agreement](https://www.okta.com/agreements/#mastersubscriptionagreement). If Okta elects to make a version of this SDK and its associated product Generally Available ("GA"), such GA version may have different pricing, product and feature configurations, and use of the GA product and SDK will be subject to the standard terms of the Agreement (or other such titled written or electronic agreement addressing the same subject matter) between Okta and Customer."
317
+
318
+ ---
319
+
117
320
  <p align="center">
118
321
  <picture>
119
322
  <source media="(prefers-color-scheme: light)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png" width="150">
@@ -208,7 +208,7 @@
208
208
  *
209
209
  * #### Error Handling
210
210
  * - `useErrors(options)` - Comprehensive error management with categorization
211
- * - Filter by error kind: `'client'`, `'server'`, `'dev'`
211
+ * - Filter by error kind: `'validation'`, `'auth0'`, `'configuration'`
212
212
  * - Filter by field name for form-specific errors
213
213
  * - Dismiss individual or all errors
214
214
  *
@@ -1 +1 @@
1
- export { usePasswordValidation, useUsernameValidation, useResend, useMfaPolling, useErrors, useAuth0Themes, useCurrentScreen, useLoginIdentifiers, useSignupIdentifiers, } from '../hooks';
1
+ export { usePasswordValidation, useUsernameValidation, useResend, useMfaPolling, useErrors, useAuth0Themes, useCurrentScreen, useLoginIdentifiers, useSignupIdentifiers, usePasskeyAutofill, } from '../hooks';
@@ -19,14 +19,14 @@ export interface UseErrorsResult {
19
19
  /**
20
20
  * React hook for reading and managing errors in ACUL (Advanced Customization of Universal Login).
21
21
  * With all validation and server-side errors. It groups errors into three kinds:
22
- * - `server` — errors returned by Auth0 or your own backend.
23
- * - `client` — errors from client-side validation (e.g., invalid form input).
24
- * - `developer` — errors caused by incorrect integration or SDK misuse.
22
+ * - `auth0` — errors returned by Auth0 or your own backend.
23
+ * - `validation` — errors from client-side validation (e.g., invalid form input).
24
+ * - `configuration` — errors caused by incorrect integration or SDK misuse.
25
25
  *
26
26
  * @supportedScreens
27
27
  * - The `useErrors` hook is available on every ACUL screen.
28
28
  *
29
- * @param options.includeDevErrors - When `true`, developer errors are included in
29
+ * @param options.includeDevErrors - When `true`, configuration errors are included in
30
30
  * the returned list. Defaults to `false`.
31
31
  *
32
32
  * @returns An object of type {@link UseErrorsResult}, containing:
@@ -51,7 +51,7 @@ export interface UseErrorsResult {
51
51
  * <div>
52
52
  * {hasError && (
53
53
  * <div className="mb-4">
54
- * {errors.byKind("server").map(err => (
54
+ * {errors.byKind("auth0").map(err => (
55
55
  * <div key={err.id} className="text-red-600">
56
56
  * {err.message}
57
57
  * <button onClick={() => dismiss(err.id)}>Dismiss</button>
@@ -68,10 +68,10 @@ export interface UseErrorsResult {
68
68
  *
69
69
  * In addition to rendering messages, you can filter by field or kind:
70
70
  * ```ts
71
- * console.log(errors.byKind('client')); // all client errors
72
- * console.log(errors.byKind('client', { field: 'username' })); // client errors for field 'username'
71
+ * console.log(errors.byKind('validation')); // all validation errors
72
+ * console.log(errors.byKind('validation', { field: 'username' })); // validation errors for field 'username'
73
73
  * console.log(errors.byField('username')); // all errors for field 'username'
74
- * console.log(errors.byField('username', { kind: 'server' })); // server errors for field 'username'
74
+ * console.log(errors.byField('username', { kind: 'auth0' })); // auth0 errors for field 'username'
75
75
  * ```
76
76
  */
77
77
  export declare function useErrors(options?: UseErrorOptions): UseErrorsResult;
@@ -83,11 +83,11 @@ declare function withError<T>(actionOrPromise: (() => T | Promise<T>) | Promise<
83
83
  */
84
84
  export declare const errorManager: {
85
85
  withError: typeof withError;
86
- replaceClientErrors(list: Array<Omit<ErrorItem, "id">>, opts?: {
86
+ replaceValidationErrors(list: Array<Omit<ErrorItem, "id">>, opts?: {
87
87
  byField?: string;
88
88
  }): void;
89
- clearClientErrors(): void;
90
- pushClientErrors(list: Omit<ErrorItem, "id"> | Array<Omit<ErrorItem, "id">>): void;
89
+ clearValidationErrors(): void;
90
+ pushValidationErrors(list: Omit<ErrorItem, "id"> | Array<Omit<ErrorItem, "id">>): void;
91
91
  replaceDeveloperErrors(list: Array<Omit<ErrorItem, "id">>, opts?: {
92
92
  byField?: string;
93
93
  }): void;
@@ -1,2 +1,2 @@
1
- import{getErrors as e,UserInputError as r,SDKUsageError as t,Auth0ServerError as n}from"@auth0/auth0-acul-js";import{useSyncExternalStore as c,useRef as o,useEffect as l,useMemo as s,useCallback as i}from"react";import{errorStore as a,ERROR_KINDS as p}from"../../state/error-store.js";function d(e,r){return r?e.filter(e=>e.field===r):e}const u=new WeakMap,v=new WeakMap,f=new WeakMap,h=(e,r)=>{const t="server"===e?u:"client"===e?v:f,n=t.get(r);if(n)return n;const c=Object.freeze(r.map(r=>Object.freeze({...r,kind:e})));return t.set(r,c),c};function b(r={}){const{includeDevErrors:t=!1}=r,n=c(e=>a.subscribe(e),()=>a.snapshot()),u=o(!1);l(()=>{if(u.current)return;u.current=!0;const r=e?.()??[];a.replace("server",r)},[]);const v=s(()=>h("server",n.server),[n.server]),f=s(()=>h("client",n.client),[n.client]),b=s(()=>h("developer",n.developer),[n.developer]),E=s(()=>Object.freeze([...t?b:[],...f,...v]),[t,b,f,v]),y=s(()=>{const e=Object.assign([...E],{byKind(e,r){const t="client"===e?f:"developer"===e?b:v;return r?.field?Object.freeze(d(t,r.field)):t},byField:(r,t)=>t?.kind?e.byKind(t.kind,{field:r}):Object.freeze(d(E,r))});return Object.freeze(e)},[E,f,b,v]),m=E.length>0,k=i(e=>{a.remove(p,e)},[]),w=i(()=>{a.clear(p)},[]);return s(()=>({errors:y,hasError:m,dismiss:k,dismissAll:w}),[y,m,k,w])}const E={withError:function(e){const c=e=>{const c=function(e){return e instanceof r?"client":e instanceof t?"developer":e instanceof n?"server":null}(e),o=function(e){return{code:e?.code??(e instanceof Error?e.name:void 0)??"unknown_error",message:e?.message??"Unknown error",field:e?.field}}(e);switch(c){case"client":E.replaceClientErrors([o]);break;case"developer":E.replaceDeveloperErrors([o]);break;case"server":E.replaceServerErrors([o]);break;default:throw console.error("[auth0-acul-react] Unhandled error:",e),e}};if("function"==typeof e)try{const r=e();return"object"==typeof(o=r)&&null!==o&&"then"in o&&"function"==typeof o.then?r.catch(e=>{throw c(e),e}):r}catch(e){throw c(e),e}var o;return e.catch(e=>{throw c(e),e})},replaceClientErrors(e,r){r?.byField?a.replacePartial("client",e,r.byField):a.replace("client",e)},clearClientErrors(){a.clear(["client"])},pushClientErrors(e){a.push("client",e)},replaceDeveloperErrors(e,r){r?.byField?a.replacePartial("developer",e,r.byField):a.replace("developer",e)},clearDeveloperErrors(){a.clear(["developer"])},pushDeveloperErrors(e){a.push("developer",e)},replaceServerErrors(e,r){r?.byField?a.replacePartial("server",e,r.byField):a.replace("server",e)},clearServerErrors(){a.clear(["server"])},pushServerErrors(e){a.push("server",e)},syncServerErrors(){const r=e?.()??[];a.replace("server",r)}};export{E as errorManager,b as useErrors};
1
+ import{getErrors as r,ValidationError as e,ConfigurationError as t,Auth0Error as a}from"@auth0/auth0-acul-js";import{useSyncExternalStore as n,useRef as o,useEffect as i,useMemo as c,useCallback as l}from"react";import{errorStore as s,ERROR_KINDS as u}from"../../state/error-store.js";function f(r,e){return e?r.filter(r=>r.field===e):r}const d=new WeakMap,h=new WeakMap,p=new WeakMap,v=(r,e)=>{const t="auth0"===r?d:"validation"===r?h:p,a=t.get(e);if(a)return a;const n=Object.freeze(e.map(e=>Object.freeze({...e,kind:r})));return t.set(e,n),n};function b(e={}){const{includeDevErrors:t=!1}=e,a=n(r=>s.subscribe(r),()=>s.snapshot()),d=o(!1);i(()=>{if(d.current)return;d.current=!0;const e=r?.()??[];s.replace("auth0",e)},[]);const h=c(()=>v("auth0",a.auth0),[a.auth0]),p=c(()=>v("validation",a.validation),[a.validation]),b=c(()=>v("configuration",a.configuration),[a.configuration]),E=c(()=>Object.freeze([...t?b:[],...p,...h]),[t,b,p,h]),g=c(()=>{const r=Object.assign([...E],{byKind(r,e){let t;return t="validation"===r?p:"configuration"===r?b:h,e?.field?Object.freeze(f(t,e.field)):t},byField:(e,t)=>t?.kind?r.byKind(t.kind,{field:e}):Object.freeze(f(E,e))});return Object.freeze(r)},[E,p,b,h]),y=E.length>0,m=l(r=>{s.remove(u,r)},[]),k=l(()=>{s.clear(u)},[]);return c(()=>({errors:g,hasError:y,dismiss:m,dismissAll:k}),[g,y,m,k])}const E={withError:function(r){const n=r=>{const n=function(r){return r instanceof e?"validation":r instanceof t?"configuration":r instanceof a?"auth0":null}(r),o=function(r){return{code:r?.code??(r instanceof Error?r.name:void 0)??"unknown_error",message:r?.message??"Unknown error",field:r?.field}}(r);switch(n){case"validation":E.replaceValidationErrors([o]);break;case"configuration":E.replaceDeveloperErrors([o]);break;case"auth0":E.replaceServerErrors([o]);break;default:throw console.error("[auth0-acul-react] Unhandled error:",r),r}};if("function"==typeof r)try{const e=r();return"object"==typeof(o=e)&&null!==o&&"then"in o&&"function"==typeof o.then?e.catch(r=>{throw n(r),r}):e}catch(r){throw n(r),r}var o;return r.catch(r=>{throw n(r),r})},replaceValidationErrors(r,e){e?.byField?s.replacePartial("validation",r,e.byField):s.replace("validation",r)},clearValidationErrors(){s.clear(["validation"])},pushValidationErrors(r){s.push("validation",r)},replaceDeveloperErrors(r,e){e?.byField?s.replacePartial("configuration",r,e.byField):s.replace("configuration",r)},clearDeveloperErrors(){s.clear(["configuration"])},pushDeveloperErrors(r){s.push("configuration",r)},replaceServerErrors(r,e){e?.byField?s.replacePartial("auth0",r,e.byField):s.replace("auth0",r)},clearServerErrors(){s.clear(["auth0"])},pushServerErrors(r){s.push("auth0",r)},syncServerErrors(){const e=r?.()??[];s.replace("auth0",e)}};export{E as errorManager,b as useErrors};
2
2
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sources":["../../../src/hooks/common/errors.ts"],"sourcesContent":["import {\n SDKUsageError,\n UserInputError,\n Auth0ServerError,\n getErrors as getServerErrors,\n type Error as Auth0Error,\n} from '@auth0/auth0-acul-js';\nimport { useEffect, useMemo, useRef, useSyncExternalStore, useCallback } from 'react';\n\nimport { errorStore, ERROR_KINDS, type ErrorItem, type ErrorKind } from '../../state/error-store';\n\nexport interface ErrorsResult extends ReadonlyArray<ErrorItem> {\n byKind(kind: ErrorKind, opts?: { field?: string }): ReadonlyArray<ErrorItem>;\n byField(field: string, opts?: { kind?: ErrorKind }): ReadonlyArray<ErrorItem>;\n}\n\nexport interface UseErrorOptions {\n includeDevErrors?: boolean;\n}\n\nexport interface UseErrorsResult {\n errors: ErrorsResult;\n hasError: boolean;\n dismiss: (id: string) => void;\n dismissAll: () => void;\n}\n\nfunction classifyKind(e: unknown): ErrorKind | null {\n if (e instanceof UserInputError) {\n return 'client';\n }\n if (e instanceof SDKUsageError) {\n return 'developer';\n }\n if (e instanceof Auth0ServerError) {\n return 'server';\n }\n return null;\n}\n\nfunction toErrorObject(e: unknown): Omit<ErrorItem, 'id'> {\n return {\n code: (e as Auth0Error)?.code ?? (e instanceof Error ? e.name : undefined) ?? 'unknown_error',\n message: (e as Auth0Error)?.message ?? 'Unknown error',\n field: (e as Auth0Error)?.field,\n };\n}\n\nfunction filterByField<T extends { field?: string }>(\n list: ReadonlyArray<T>,\n field?: string\n): ReadonlyArray<T> {\n if (!field) {\n return list;\n }\n return list.filter((e) => e.field === field);\n}\n\n// caches for tagging\nconst cacheServer = new WeakMap<ReadonlyArray<ErrorItem>, ReadonlyArray<ErrorItem>>();\nconst cacheClient = new WeakMap<ReadonlyArray<ErrorItem>, ReadonlyArray<ErrorItem>>();\nconst cacheDev = new WeakMap<ReadonlyArray<ErrorItem>, ReadonlyArray<ErrorItem>>();\n\nconst tag = (kind: ErrorKind, arr: ReadonlyArray<ErrorItem>): ReadonlyArray<ErrorItem> => {\n const cache = kind === 'server' ? cacheServer : kind === 'client' ? cacheClient : cacheDev;\n const hit = cache.get(arr);\n if (hit) {\n return hit;\n }\n const out = Object.freeze(arr.map((e) => Object.freeze({ ...e, kind })));\n cache.set(arr, out);\n return out;\n};\n\n/**\n * React hook for reading and managing errors in ACUL (Advanced Customization of Universal Login).\n * With all validation and server-side errors. It groups errors into three kinds:\n * - `server` — errors returned by Auth0 or your own backend.\n * - `client` — errors from client-side validation (e.g., invalid form input).\n * - `developer` — errors caused by incorrect integration or SDK misuse.\n *\n * @supportedScreens\n * - The `useErrors` hook is available on every ACUL screen.\n *\n * @param options.includeDevErrors - When `true`, developer errors are included in\n * the returned list. Defaults to `false`.\n *\n * @returns An object of type {@link UseErrorsResult}, containing:\n * - `errors` — the full error list of type {@link ErrorsResult}, with helpers:\n * - `errors.byKind(kind, filter?)` — filter by error kind and optionally by field.\n * - `errors.byField(field, filter?)` — filter by field and optionally by kind.\n * - `hasError` — `true` if any error is currently present.\n * - `dismiss(id)` — remove a specific error by its ID.\n * - `dismissAll()` — clear all tracked errors.\n *\n * Typical usage is inside a form or screen component where you need to\n * reactively display errors and provide ways to dismiss them:\n *\n * @example\n * ```tsx\n * import { useErrors } from \"@auth0/auth0-acul-react\";\n *\n * export function SignupForm() {\n * const { errors, hasError, dismiss, dismissAll } = useErrors();\n *\n * return (\n * <div>\n * {hasError && (\n * <div className=\"mb-4\">\n * {errors.byKind(\"server\").map(err => (\n * <div key={err.id} className=\"text-red-600\">\n * {err.message}\n * <button onClick={() => dismiss(err.id)}>Dismiss</button>\n * </div>\n * ))}\n * </div>\n * )}\n *\n * <button onClick={dismissAll}>Clear All Errors</button>\n * </div>\n * );\n * }\n * ```\n *\n * In addition to rendering messages, you can filter by field or kind:\n * ```ts\n * console.log(errors.byKind('client')); // all client errors\n * console.log(errors.byKind('client', { field: 'username' })); // client errors for field 'username'\n * console.log(errors.byField('username')); // all errors for field 'username'\n * console.log(errors.byField('username', { kind: 'server' })); // server errors for field 'username'\n * ```\n */\n\nexport function useErrors(options: UseErrorOptions = {}): UseErrorsResult {\n const { includeDevErrors = false } = options;\n\n const snap = useSyncExternalStore(\n (cb) => errorStore.subscribe(cb),\n () => errorStore.snapshot()\n );\n\n const didInit = useRef(false);\n useEffect(() => {\n if (didInit.current) {\n return;\n }\n didInit.current = true;\n\n // Get server errors directly from TS SDK on first render.\n const server = (getServerErrors?.() ?? []) as Array<Omit<ErrorItem, 'id'>>;\n errorStore.replace('server', server);\n }, []);\n\n const serverTagged = useMemo(() => tag('server', snap.server), [snap.server]);\n const clientTagged = useMemo(() => tag('client', snap.client), [snap.client]);\n const devTagged = useMemo(() => tag('developer', snap.developer), [snap.developer]);\n\n const all = useMemo<ReadonlyArray<ErrorItem>>(\n () => Object.freeze([...(includeDevErrors ? devTagged : []), ...clientTagged, ...serverTagged]),\n [includeDevErrors, devTagged, clientTagged, serverTagged]\n );\n\n const errors: ErrorsResult = useMemo(() => {\n const arr = Object.assign([...all], {\n byKind(kind: ErrorKind, opts?: { field?: string }): ReadonlyArray<ErrorItem> {\n const base =\n kind === 'client' ? clientTagged : kind === 'developer' ? devTagged : serverTagged;\n return opts?.field ? Object.freeze(filterByField(base, opts.field)) : base;\n },\n byField(field: string, opts?: { kind?: ErrorKind }): ReadonlyArray<ErrorItem> {\n if (opts?.kind) {\n return arr.byKind(opts.kind, { field });\n }\n return Object.freeze(filterByField(all, field));\n },\n });\n return Object.freeze(arr);\n }, [all, clientTagged, devTagged, serverTagged]);\n\n const hasError = all.length > 0;\n\n const dismiss = useCallback((id: string) => {\n errorStore.remove(ERROR_KINDS, id);\n }, []);\n\n const dismissAll = useCallback(() => {\n errorStore.clear(ERROR_KINDS);\n }, []);\n\n return useMemo(\n () => ({ errors, hasError, dismiss, dismissAll }),\n [errors, hasError, dismiss, dismissAll]\n );\n}\n\n// ---------------- INTERNAL (SDK-only) ----------------\nconst isPromise = (v: unknown): v is Promise<unknown> =>\n typeof v === 'object' &&\n v !== null &&\n 'then' in v &&\n typeof (v as { then: unknown }).then === 'function';\n\nfunction withError<T>(actionOrPromise: (() => T | Promise<T>) | Promise<T>): T | Promise<T> {\n const handle = (e: unknown) => {\n const kind = classifyKind(e);\n const normalized = toErrorObject(e);\n switch (kind) {\n case 'client':\n errorManager.replaceClientErrors([normalized]);\n break;\n case 'developer':\n errorManager.replaceDeveloperErrors([normalized]);\n break;\n case 'server':\n errorManager.replaceServerErrors([normalized]);\n break;\n default: {\n console.error('[auth0-acul-react] Unhandled error:', e);\n throw e;\n }\n }\n };\n\n if (typeof actionOrPromise === 'function') {\n try {\n const result = (actionOrPromise as () => T | Promise<T>)();\n return isPromise(result)\n ? result.catch((e) => {\n handle(e);\n throw e;\n })\n : result;\n } catch (e) {\n handle(e);\n throw e;\n }\n }\n\n return actionOrPromise.catch((e) => {\n handle(e);\n throw e;\n });\n}\n\n/**\n * @hidden\n * Internal error manager for use by SDK methods.\n * Use the `useErrors` hook in React components instead.\n */\nexport const errorManager = {\n withError,\n\n replaceClientErrors(list: Array<Omit<ErrorItem, 'id'>>, opts?: { byField?: string }) {\n if (opts?.byField) {\n errorStore.replacePartial('client', list, opts.byField);\n } else {\n errorStore.replace('client', list);\n }\n },\n clearClientErrors() {\n errorStore.clear(['client']);\n },\n pushClientErrors(list: Omit<ErrorItem, 'id'> | Array<Omit<ErrorItem, 'id'>>) {\n errorStore.push('client', list);\n },\n\n replaceDeveloperErrors(list: Array<Omit<ErrorItem, 'id'>>, opts?: { byField?: string }) {\n if (opts?.byField) {\n errorStore.replacePartial('developer', list, opts.byField);\n } else {\n errorStore.replace('developer', list);\n }\n },\n clearDeveloperErrors() {\n errorStore.clear(['developer']);\n },\n pushDeveloperErrors(list: Omit<ErrorItem, 'id'> | Array<Omit<ErrorItem, 'id'>>) {\n errorStore.push('developer', list);\n },\n\n replaceServerErrors(list: Array<Omit<ErrorItem, 'id'>>, opts?: { byField?: string }) {\n if (opts?.byField) {\n errorStore.replacePartial('server', list, opts.byField);\n } else {\n errorStore.replace('server', list);\n }\n },\n clearServerErrors() {\n errorStore.clear(['server']);\n },\n pushServerErrors(list: Omit<ErrorItem, 'id'> | Array<Omit<ErrorItem, 'id'>>) {\n errorStore.push('server', list);\n },\n\n syncServerErrors() {\n const server = (getServerErrors?.() ?? []) as Array<Omit<ErrorItem, 'id'>>;\n errorStore.replace('server', server);\n },\n};\n\nexport { ErrorItem, ErrorKind };\n"],"names":["filterByField","list","field","filter","e","cacheServer","WeakMap","cacheClient","cacheDev","tag","kind","arr","cache","hit","get","out","Object","freeze","map","set","useErrors","options","includeDevErrors","snap","useSyncExternalStore","cb","errorStore","subscribe","snapshot","didInit","useRef","useEffect","current","server","getServerErrors","replace","serverTagged","useMemo","clientTagged","client","devTagged","developer","all","errors","assign","byKind","opts","base","byField","hasError","length","dismiss","useCallback","id","remove","ERROR_KINDS","dismissAll","clear","errorManager","withError","actionOrPromise","handle","UserInputError","SDKUsageError","Auth0ServerError","classifyKind","normalized","code","Error","name","undefined","message","toErrorObject","replaceClientErrors","replaceDeveloperErrors","replaceServerErrors","console","error","result","v","then","catch","replacePartial","clearClientErrors","pushClientErrors","push","clearDeveloperErrors","pushDeveloperErrors","clearServerErrors","pushServerErrors","syncServerErrors"],"mappings":"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"}
1
+ {"version":3,"file":"errors.js","sources":["../../../src/hooks/common/errors.ts"],"sourcesContent":["import {\n ConfigurationError,\n ValidationError,\n Auth0Error as Auth0ServerError,\n getErrors as getServerErrors,\n type Error as Auth0Error,\n} from '@auth0/auth0-acul-js';\nimport { useEffect, useMemo, useRef, useSyncExternalStore, useCallback } from 'react';\n\nimport { errorStore, ERROR_KINDS, type ErrorItem, type ErrorKind } from '../../state/error-store';\n\nexport interface ErrorsResult extends ReadonlyArray<ErrorItem> {\n byKind(kind: ErrorKind, opts?: { field?: string }): ReadonlyArray<ErrorItem>;\n byField(field: string, opts?: { kind?: ErrorKind }): ReadonlyArray<ErrorItem>;\n}\n\nexport interface UseErrorOptions {\n includeDevErrors?: boolean;\n}\n\nexport interface UseErrorsResult {\n errors: ErrorsResult;\n hasError: boolean;\n dismiss: (id: string) => void;\n dismissAll: () => void;\n}\n\nfunction classifyKind(e: unknown): ErrorKind | null {\n if (e instanceof ValidationError) {\n return 'validation';\n }\n if (e instanceof ConfigurationError) {\n return 'configuration';\n }\n if (e instanceof Auth0ServerError) {\n return 'auth0';\n }\n return null;\n}\n\nfunction toErrorObject(e: unknown): Omit<ErrorItem, 'id'> {\n return {\n code: (e as Auth0Error)?.code ?? (e instanceof Error ? e.name : undefined) ?? 'unknown_error',\n message: (e as Auth0Error)?.message ?? 'Unknown error',\n field: (e as Auth0Error)?.field,\n };\n}\n\nfunction filterByField<T extends { field?: string }>(\n list: ReadonlyArray<T>,\n field?: string\n): ReadonlyArray<T> {\n if (!field) {\n return list;\n }\n return list.filter((e) => e.field === field);\n}\n\n// caches for tagging\nconst cacheServer = new WeakMap<ReadonlyArray<ErrorItem>, ReadonlyArray<ErrorItem>>();\nconst cacheValidation = new WeakMap<ReadonlyArray<ErrorItem>, ReadonlyArray<ErrorItem>>();\nconst cacheDev = new WeakMap<ReadonlyArray<ErrorItem>, ReadonlyArray<ErrorItem>>();\n\nconst tag = (kind: ErrorKind, arr: ReadonlyArray<ErrorItem>): ReadonlyArray<ErrorItem> => {\n const cache = kind === 'auth0' ? cacheServer : kind === 'validation' ? cacheValidation : cacheDev;\n const hit = cache.get(arr);\n if (hit) {\n return hit;\n }\n const out = Object.freeze(arr.map((e) => Object.freeze({ ...e, kind })));\n cache.set(arr, out);\n return out;\n};\n\n/**\n * React hook for reading and managing errors in ACUL (Advanced Customization of Universal Login).\n * With all validation and server-side errors. It groups errors into three kinds:\n * - `auth0` — errors returned by Auth0 or your own backend.\n * - `validation` — errors from client-side validation (e.g., invalid form input).\n * - `configuration` — errors caused by incorrect integration or SDK misuse.\n *\n * @supportedScreens\n * - The `useErrors` hook is available on every ACUL screen.\n *\n * @param options.includeDevErrors - When `true`, configuration errors are included in\n * the returned list. Defaults to `false`.\n *\n * @returns An object of type {@link UseErrorsResult}, containing:\n * - `errors` — the full error list of type {@link ErrorsResult}, with helpers:\n * - `errors.byKind(kind, filter?)` — filter by error kind and optionally by field.\n * - `errors.byField(field, filter?)` — filter by field and optionally by kind.\n * - `hasError` — `true` if any error is currently present.\n * - `dismiss(id)` — remove a specific error by its ID.\n * - `dismissAll()` — clear all tracked errors.\n *\n * Typical usage is inside a form or screen component where you need to\n * reactively display errors and provide ways to dismiss them:\n *\n * @example\n * ```tsx\n * import { useErrors } from \"@auth0/auth0-acul-react\";\n *\n * export function SignupForm() {\n * const { errors, hasError, dismiss, dismissAll } = useErrors();\n *\n * return (\n * <div>\n * {hasError && (\n * <div className=\"mb-4\">\n * {errors.byKind(\"auth0\").map(err => (\n * <div key={err.id} className=\"text-red-600\">\n * {err.message}\n * <button onClick={() => dismiss(err.id)}>Dismiss</button>\n * </div>\n * ))}\n * </div>\n * )}\n *\n * <button onClick={dismissAll}>Clear All Errors</button>\n * </div>\n * );\n * }\n * ```\n *\n * In addition to rendering messages, you can filter by field or kind:\n * ```ts\n * console.log(errors.byKind('validation')); // all validation errors\n * console.log(errors.byKind('validation', { field: 'username' })); // validation errors for field 'username'\n * console.log(errors.byField('username')); // all errors for field 'username'\n * console.log(errors.byField('username', { kind: 'auth0' })); // auth0 errors for field 'username'\n * ```\n */\n\nexport function useErrors(options: UseErrorOptions = {}): UseErrorsResult {\n const { includeDevErrors = false } = options;\n\n const snap = useSyncExternalStore(\n (cb) => errorStore.subscribe(cb),\n () => errorStore.snapshot()\n );\n\n const didInit = useRef(false);\n useEffect(() => {\n if (didInit.current) {\n return;\n }\n didInit.current = true;\n\n // Get server errors directly from TS SDK on first render.\n const server = (getServerErrors?.() ?? []) as Array<Omit<ErrorItem, 'id'>>;\n errorStore.replace('auth0', server);\n }, []);\n\n const serverTagged = useMemo(() => tag('auth0', snap.auth0), [snap.auth0]);\n const clientTagged = useMemo(() => tag('validation', snap.validation), [snap.validation]);\n const devTagged = useMemo(() => tag('configuration', snap.configuration), [snap.configuration]);\n\n const all = useMemo<ReadonlyArray<ErrorItem>>(\n () => Object.freeze([...(includeDevErrors ? devTagged : []), ...clientTagged, ...serverTagged]),\n [includeDevErrors, devTagged, clientTagged, serverTagged]\n );\n\n const errors: ErrorsResult = useMemo(() => {\n const arr = Object.assign([...all], {\n byKind(kind: ErrorKind, opts?: { field?: string }): ReadonlyArray<ErrorItem> {\n let base: ReadonlyArray<ErrorItem>;\n if (kind === 'validation') {\n base = clientTagged;\n } else if (kind === 'configuration') {\n base = devTagged;\n } else {\n base = serverTagged;\n }\n if (opts?.field) {\n return Object.freeze(filterByField(base, opts.field));\n }\n return base;\n },\n byField(field: string, opts?: { kind?: ErrorKind }): ReadonlyArray<ErrorItem> {\n if (opts?.kind) {\n return arr.byKind(opts.kind, { field });\n }\n return Object.freeze(filterByField(all, field));\n },\n });\n return Object.freeze(arr);\n }, [all, clientTagged, devTagged, serverTagged]);\n\n const hasError = all.length > 0;\n\n const dismiss = useCallback((id: string) => {\n errorStore.remove(ERROR_KINDS, id);\n }, []);\n\n const dismissAll = useCallback(() => {\n errorStore.clear(ERROR_KINDS);\n }, []);\n\n return useMemo(\n () => ({ errors, hasError, dismiss, dismissAll }),\n [errors, hasError, dismiss, dismissAll]\n );\n}\n\n// ---------------- INTERNAL (SDK-only) ----------------\nconst isPromise = (v: unknown): v is Promise<unknown> =>\n typeof v === 'object' &&\n v !== null &&\n 'then' in v &&\n typeof (v as { then: unknown }).then === 'function';\n\nfunction withError<T>(actionOrPromise: (() => T | Promise<T>) | Promise<T>): T | Promise<T> {\n const handle = (e: unknown) => {\n const kind = classifyKind(e);\n const normalized = toErrorObject(e);\n switch (kind) {\n case 'validation':\n errorManager.replaceValidationErrors([normalized]);\n break;\n case 'configuration':\n errorManager.replaceDeveloperErrors([normalized]);\n break;\n case 'auth0':\n errorManager.replaceServerErrors([normalized]);\n break;\n default: {\n console.error('[auth0-acul-react] Unhandled error:', e);\n throw e;\n }\n }\n };\n\n if (typeof actionOrPromise === 'function') {\n try {\n const result = (actionOrPromise as () => T | Promise<T>)();\n return isPromise(result)\n ? result.catch((e) => {\n handle(e);\n throw e;\n })\n : result;\n } catch (e) {\n handle(e);\n throw e;\n }\n }\n\n return actionOrPromise.catch((e) => {\n handle(e);\n throw e;\n });\n}\n\n/**\n * @hidden\n * Internal error manager for use by SDK methods.\n * Use the `useErrors` hook in React components instead.\n */\nexport const errorManager = {\n withError,\n\n replaceValidationErrors(list: Array<Omit<ErrorItem, 'id'>>, opts?: { byField?: string }) {\n if (opts?.byField) {\n errorStore.replacePartial('validation', list, opts.byField);\n } else {\n errorStore.replace('validation', list);\n }\n },\n clearValidationErrors() {\n errorStore.clear(['validation']);\n },\n pushValidationErrors(list: Omit<ErrorItem, 'id'> | Array<Omit<ErrorItem, 'id'>>) {\n errorStore.push('validation', list);\n },\n\n replaceDeveloperErrors(list: Array<Omit<ErrorItem, 'id'>>, opts?: { byField?: string }) {\n if (opts?.byField) {\n errorStore.replacePartial('configuration', list, opts.byField);\n } else {\n errorStore.replace('configuration', list);\n }\n },\n clearDeveloperErrors() {\n errorStore.clear(['configuration']);\n },\n pushDeveloperErrors(list: Omit<ErrorItem, 'id'> | Array<Omit<ErrorItem, 'id'>>) {\n errorStore.push('configuration', list);\n },\n\n replaceServerErrors(list: Array<Omit<ErrorItem, 'id'>>, opts?: { byField?: string }) {\n if (opts?.byField) {\n errorStore.replacePartial('auth0', list, opts.byField);\n } else {\n errorStore.replace('auth0', list);\n }\n },\n clearServerErrors() {\n errorStore.clear(['auth0']);\n },\n pushServerErrors(list: Omit<ErrorItem, 'id'> | Array<Omit<ErrorItem, 'id'>>) {\n errorStore.push('auth0', list);\n },\n\n syncServerErrors() {\n const server = (getServerErrors?.() ?? []) as Array<Omit<ErrorItem, 'id'>>;\n errorStore.replace('auth0', server);\n },\n};\n\nexport { ErrorItem, ErrorKind };\n"],"names":["filterByField","list","field","filter","e","cacheServer","WeakMap","cacheValidation","cacheDev","tag","kind","arr","cache","hit","get","out","Object","freeze","map","set","useErrors","options","includeDevErrors","snap","useSyncExternalStore","cb","errorStore","subscribe","snapshot","didInit","useRef","useEffect","current","server","getServerErrors","replace","serverTagged","useMemo","auth0","clientTagged","validation","devTagged","configuration","all","errors","assign","byKind","opts","base","byField","hasError","length","dismiss","useCallback","id","remove","ERROR_KINDS","dismissAll","clear","errorManager","withError","actionOrPromise","handle","ValidationError","ConfigurationError","Auth0ServerError","classifyKind","normalized","code","Error","name","undefined","message","toErrorObject","replaceValidationErrors","replaceDeveloperErrors","replaceServerErrors","console","error","result","v","then","catch","replacePartial","clearValidationErrors","pushValidationErrors","push","clearDeveloperErrors","pushDeveloperErrors","clearServerErrors","pushServerErrors","syncServerErrors"],"mappings":"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"}
@@ -8,3 +8,4 @@ export { useMfaPolling, type MfaPollingResult, type ULError } from './utility/po
8
8
  export { useResend, type UseResendReturn, type UseResendOptions } from './utility/resend-manager';
9
9
  export { usePasswordValidation, type PasswordValidationResult, type PasswordComplexityRule, } from './utility/validate-password';
10
10
  export { useUsernameValidation, type UsernameValidationResult, type UsernameValidationError, } from './utility/validate-username';
11
+ export { usePasskeyAutofill, type UsePasskeyAutofillResult } from './utility/passkey-autofill';
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Result object returned by {@link usePasskeyAutofill}.
3
+ *
4
+ * Provides a ref that can be attached to the username `<input>` element
5
+ * to automatically enable browser Conditional UI (passkey autofill).
6
+ *
7
+ * @see {@link usePasskeyAutofill}
8
+ * @category Passkeys
9
+ * @public
10
+ */
11
+ export interface UsePasskeyAutofillResult {
12
+ /**
13
+ * A React ref that can be bound to the username `<input>` element.
14
+ *
15
+ * When attached, the SDK ensures the input’s `autocomplete`
16
+ * attribute is correctly set to `"username webauthn"`.
17
+ *
18
+ * If the developer already declared this attribute in markup,
19
+ * the ref is optional, the hook will still register Conditional
20
+ * Mediation correctly even without it.
21
+ */
22
+ inputRef: React.RefObject<HTMLInputElement>;
23
+ }
24
+ /**
25
+ * React hook that enables browser **Conditional UI** (passkey autofill)
26
+ * for the login identifier field on the `login-id` screen.
27
+ *
28
+ * ---
29
+ * ### Behavior
30
+ * - The hook automatically initializes the browser’s Conditional Mediation
31
+ * API (`navigator.credentials.get({ mediation: "conditional" })`),
32
+ * allowing passkeys stored on the user’s device to appear directly in
33
+ * the username field’s autocomplete dropdown.
34
+ * - It **fails silently** on unsupported browsers and **never blocks** user input.
35
+ * - The registration is performed once per page lifecycle.
36
+ *
37
+ * ---
38
+ * ### Using the returned `ref`
39
+ * The returned `inputRef` is **optional**.
40
+ * - If you bind it to your `<input>` element, the SDK will ensure the element’s
41
+ * `autocomplete` attribute is correctly set to `"username webauthn"`.
42
+ * - If your input element **already has**
43
+ * `autocomplete="username webauthn"` declared in markup,
44
+ * you can skip binding the `ref` entirely, the hook will still register
45
+ * Conditional Mediation correctly. See {@link UsePasskeyAutofillResult}
46
+ *
47
+ * ---
48
+ * ### Example
49
+ * ```tsx
50
+ * import { usePasskeyAutofill } from '@auth0/auth0-acul-react/login-id';
51
+ *
52
+ * export function LoginForm() {
53
+ * // Option 1: bind the ref for automatic attribute handling
54
+ * const { inputRef } = usePasskeyAutofill();
55
+ *
56
+ * return (
57
+ * <input
58
+ * ref={inputRef}
59
+ * id="username"
60
+ * placeholder="Username"
61
+ * autoComplete="username webauthn"
62
+ * />
63
+ * );
64
+ * }
65
+ *
66
+ * // Option 2: works equally well without using the ref
67
+ * export function LoginFormWithoutRef() {
68
+ * usePasskeyAutofill(); // just call the hook once
69
+ *
70
+ * return (
71
+ * <input
72
+ * id="username"
73
+ * placeholder="Username"
74
+ * autoComplete="username webauthn"
75
+ * />
76
+ * );
77
+ * }
78
+ * ```
79
+ *
80
+ * ---
81
+ * @supportedScreens
82
+ * - `login-id`
83
+ *
84
+ * @category Passkeys
85
+ */
86
+ export declare function usePasskeyAutofill(): UsePasskeyAutofillResult;
@@ -0,0 +1,2 @@
1
+ import{useRef as t,useLayoutEffect as e}from"react";import{getScreen as r}from"../../state/instance-store.js";const o="username webauthn";function n(){const n=r(),s=t(null),i=t(!1);return e(()=>{if(!i.current){i.current=!0;try{if(!n||"function"!=typeof n.registerPasskeyAutofill)return void console.warn("Passkey autofill unavailable: missing instance method");const t=s.current,e=t?.id;if(n.registerPasskeyAutofill(e),t){(t.getAttribute("autocomplete")??"").trim().toLowerCase()!==o&&t.setAttribute("autocomplete",o)}}catch(t){console.warn("usePasskeyAutofill failed:",t)}}},[n]),{inputRef:s}}export{n as usePasskeyAutofill};
2
+ //# sourceMappingURL=passkey-autofill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"passkey-autofill.js","sources":["../../../src/hooks/utility/passkey-autofill.ts"],"sourcesContent":["import { useLayoutEffect, useRef } from 'react';\n\nimport { getScreen } from '../../state/instance-store';\n\nimport type { LoginIdMembers } from '@auth0/auth0-acul-js/login-id';\n\nconst REQUIRED_TOKENS = 'username webauthn';\n\n/**\n * Result object returned by {@link usePasskeyAutofill}.\n *\n * Provides a ref that can be attached to the username `<input>` element\n * to automatically enable browser Conditional UI (passkey autofill).\n *\n * @see {@link usePasskeyAutofill}\n * @category Passkeys\n * @public\n */\nexport interface UsePasskeyAutofillResult {\n /**\n * A React ref that can be bound to the username `<input>` element.\n *\n * When attached, the SDK ensures the input’s `autocomplete`\n * attribute is correctly set to `\"username webauthn\"`.\n *\n * If the developer already declared this attribute in markup,\n * the ref is optional, the hook will still register Conditional\n * Mediation correctly even without it.\n */\n inputRef: React.RefObject<HTMLInputElement>;\n}\n\n/**\n * React hook that enables browser **Conditional UI** (passkey autofill)\n * for the login identifier field on the `login-id` screen.\n *\n * ---\n * ### Behavior\n * - The hook automatically initializes the browser’s Conditional Mediation\n * API (`navigator.credentials.get({ mediation: \"conditional\" })`),\n * allowing passkeys stored on the user’s device to appear directly in\n * the username field’s autocomplete dropdown.\n * - It **fails silently** on unsupported browsers and **never blocks** user input.\n * - The registration is performed once per page lifecycle.\n *\n * ---\n * ### Using the returned `ref`\n * The returned `inputRef` is **optional**.\n * - If you bind it to your `<input>` element, the SDK will ensure the element’s\n * `autocomplete` attribute is correctly set to `\"username webauthn\"`.\n * - If your input element **already has**\n * `autocomplete=\"username webauthn\"` declared in markup,\n * you can skip binding the `ref` entirely, the hook will still register\n * Conditional Mediation correctly. See {@link UsePasskeyAutofillResult}\n *\n * ---\n * ### Example\n * ```tsx\n * import { usePasskeyAutofill } from '@auth0/auth0-acul-react/login-id';\n *\n * export function LoginForm() {\n * // Option 1: bind the ref for automatic attribute handling\n * const { inputRef } = usePasskeyAutofill();\n *\n * return (\n * <input\n * ref={inputRef}\n * id=\"username\"\n * placeholder=\"Username\"\n * autoComplete=\"username webauthn\"\n * />\n * );\n * }\n *\n * // Option 2: works equally well without using the ref\n * export function LoginFormWithoutRef() {\n * usePasskeyAutofill(); // just call the hook once\n *\n * return (\n * <input\n * id=\"username\"\n * placeholder=\"Username\"\n * autoComplete=\"username webauthn\"\n * />\n * );\n * }\n * ```\n *\n * ---\n * @supportedScreens\n * - `login-id`\n *\n * @category Passkeys\n */\nexport function usePasskeyAutofill(): UsePasskeyAutofillResult {\n const instance = getScreen<LoginIdMembers>();\n const inputRef = useRef<HTMLInputElement>(null);\n const initializedRef = useRef(false);\n\n useLayoutEffect(() => {\n if (initializedRef.current) return;\n initializedRef.current = true;\n\n try {\n if (!instance || typeof instance.registerPasskeyAutofill !== 'function') {\n console.warn('Passkey autofill unavailable: missing instance method');\n return;\n }\n\n const el = inputRef.current;\n const inputId = el?.id;\n\n // Fire-and-forget registration (fails silently)\n void instance.registerPasskeyAutofill(inputId);\n\n // Optionally correct the autocomplete attribute if the ref was used\n if (el) {\n const current = (el.getAttribute('autocomplete') ?? '').trim().toLowerCase();\n if (current !== REQUIRED_TOKENS) {\n el.setAttribute('autocomplete', REQUIRED_TOKENS);\n }\n }\n } catch (err) {\n console.warn('usePasskeyAutofill failed:', err);\n }\n }, [instance]);\n\n return { inputRef };\n}\n"],"names":["REQUIRED_TOKENS","usePasskeyAutofill","instance","getScreen","inputRef","useRef","initializedRef","useLayoutEffect","current","registerPasskeyAutofill","console","warn","el","inputId","id","getAttribute","trim","toLowerCase","setAttribute","err"],"mappings":"8GAMA,MAAMA,EAAkB,6BAwFRC,IACd,MAAMC,EAAWC,IACXC,EAAWC,EAAyB,MACpCC,EAAiBD,GAAO,GA8B9B,OA5BAE,EAAgB,KACd,IAAID,EAAeE,QAAnB,CACAF,EAAeE,SAAU,EAEzB,IACE,IAAKN,GAAwD,mBAArCA,EAASO,wBAE/B,YADAC,QAAQC,KAAK,yDAIf,MAAMC,EAAKR,EAASI,QACdK,EAAUD,GAAIE,GAMpB,GAHKZ,EAASO,wBAAwBI,GAGlCD,EAAI,EACWA,EAAGG,aAAa,iBAAmB,IAAIC,OAAOC,gBAC/CjB,GACdY,EAAGM,aAAa,eAAgBlB,EAEpC,CACF,CAAE,MAAOmB,GACPT,QAAQC,KAAK,6BAA8BQ,EAC7C,CAxB4B,GAyB3B,CAACjB,IAEG,CAAEE,WACX"}
@@ -52,6 +52,7 @@ export interface MfaPollingResult {
52
52
  *@supportedScreens
53
53
  * - `mfa-push-challenge-push`
54
54
  * - `reset-password-mfa-push-challenge-push`
55
+ * - `mfa-push-enrollment-qr`
55
56
  *
56
57
  * @returns object {@link MfaPollingResult} containing:
57
58
  * - `isRunning` — `true` while polling is active.
@@ -1 +1 @@
1
- {"version":3,"file":"polling-manager.js","sources":["../../../src/hooks/utility/polling-manager.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { getScreen } from '../../state/instance-store';\nimport { errorManager } from '../common/errors';\n\nimport type {\n MfaPollingOptions,\n MfaPushPollingControl,\n Error as ULError,\n} from '@auth0/auth0-acul-js';\n\n/**\n * Result object returned by {@link useMfaPolling}.\n *\n * @public\n */\nexport interface MfaPollingResult {\n /**\n * Indicates whether the MFA push polling process is currently active.\n *\n * - `true` — Polling is running and awaiting completion.\n * - `false` — Polling has stopped, either due to completion,\n * manual cancellation, or component unmount.\n */\n isRunning: boolean;\n\n /**\n * Starts or resumes the polling process.\n *\n * - If polling is already active, this call has no effect.\n * - If previously stopped, calling this restarts the polling loop.\n */\n startPolling: () => void;\n\n /**\n * Stops the polling process immediately.\n *\n * - Cancels any scheduled timers or in-flight requests.\n * - Safe to call multiple times; subsequent calls have no effect.\n */\n stopPolling: () => void;\n}\n\n/**\n * React hook to manage MFA push polling (e.g., waiting for a push notification approval)\n * on an Auth0 Advanced Customization of Universal Login (ACUL) screen.\n *\n * This hook sets up and controls a long-running polling loop that repeatedly checks\n * the MFA push challenge endpoint until one of the following occurs:\n *\n * - The challenge is **approved or denied** by the user, triggering `options.onCompleted`.\n * - An **error** occurs (network error, non-200/429 response), triggering `options.onError`.\n * - The **component unmounts** or `stopPolling()` is called, which cancels polling.\n *\n * ### Key Features\n * - `isRunning` is **reactive** — it updates automatically if the polling loop\n * stops internally or is canceled.\n * - Uses a **stable single polling instance** (`useRef`) to prevent\n * duplicate network calls and unintended restarts during React re-renders.\n * - **Automatic cleanup** on unmount: no orphan timers or leaked XHR requests.\n *\n * @param options - {@link MfaPollingOptions} specifying the polling interval,\n * success callback (`onCompleted`), and optional error handler (`onError`).\n *\n *@supportedScreens\n * - `mfa-push-challenge-push`\n * - `reset-password-mfa-push-challenge-push`\n *\n * @returns object {@link MfaPollingResult} containing:\n * - `isRunning` — `true` while polling is active.\n * - `startPolling()` — starts or resumes polling.\n * - `stopPolling()` — stops polling immediately.\n *\n * @example\n * ```tsx\n * import { useMfaPolling } from '@auth0/auth0-acul-react/mfa-push-challenge-push';\n *\n * export function MfaPushStatus() {\n * const { isRunning, startPolling, stopPolling } = useMfaPolling({\n * intervalMs: 5000,\n * onCompleted: () => console.log('Push approved!/denied'),\n * onError: (error) => console.error('Polling error:', error)\n * });\n *\n * return (\n * <div>\n * <button onClick={startPolling} disabled={isRunning}>\n * {isRunning ? 'Waiting for approval…' : 'Start MFA Polling'}\n * </button>\n * {isRunning && <button onClick={stopPolling}>Cancel</button>}\n * </div>\n * );\n * }\n * ```\n *\n * @remarks\n * - The `onError` callback receives an {@link ULError} object\n * with `status` and `responseText` describing the server response.\n * - Internal rate-limit responses (`429`) are automatically handled:\n * polling waits for the reset window before retrying.\n * - Calling `startPolling()` repeatedly while running is safe and idempotent.\n *\n * @public\n */\nexport function useMfaPolling(options?: MfaPollingOptions): MfaPollingResult {\n const [isRunning, setIsRunning] = useState(false);\n\n // Wrap callbacks safely to immediately update `isRunning` on completion/error.\n const wrappedOptions: MfaPollingOptions = useMemo(() => {\n const safe = options ?? {};\n return {\n ...safe,\n onCompleted: () => {\n setIsRunning(false);\n safe.onCompleted?.();\n },\n onError: (error: ULError) => {\n setIsRunning(false);\n errorManager.pushServerErrors([error]);\n safe.onError?.(error);\n },\n };\n }, [options]);\n\n // Stable screen instance\n const screen = useMemo(\n () => getScreen<{ pollingManager: (o: MfaPollingOptions) => MfaPushPollingControl }>(),\n []\n );\n\n // Single polling control instance per component\n const pollingControlRef = useRef<MfaPushPollingControl | null>(null);\n if (pollingControlRef.current === null) {\n pollingControlRef.current = screen.pollingManager(wrappedOptions);\n }\n const pollingControl = pollingControlRef.current;\n\n const startPolling = useCallback(() => {\n pollingControl.startPolling();\n setIsRunning(true);\n }, [pollingControl]);\n\n const stopPolling = useCallback(() => {\n pollingControl.stopPolling();\n setIsRunning(false);\n }, [pollingControl]);\n\n // One effect handles cleanup and state sync\n useEffect(() => {\n let mounted = true;\n\n const tick = () => {\n if (!mounted) {\n return;\n }\n const running = pollingControl.isRunning();\n setIsRunning(running);\n if (running) {\n requestAnimationFrame(tick);\n }\n };\n tick();\n\n return () => {\n mounted = false;\n pollingControl.stopPolling();\n };\n }, [pollingControl]);\n\n return { isRunning, startPolling, stopPolling };\n}\n\nexport type { MfaPollingOptions, ULError };\n"],"names":["useMfaPolling","options","isRunning","setIsRunning","useState","wrappedOptions","useMemo","safe","onCompleted","onError","error","errorManager","pushServerErrors","screen","getScreen","pollingControlRef","useRef","current","pollingManager","pollingControl","startPolling","useCallback","stopPolling","useEffect","mounted","tick","running","requestAnimationFrame"],"mappings":"uMAwGM,SAAUA,EAAcC,GAC5B,MAAOC,EAAWC,GAAgBC,GAAS,GAGrCC,EAAoCC,EAAQ,KAChD,MAAMC,EAAON,GAAW,CAAA,EACxB,MAAO,IACFM,EACHC,YAAa,KACXL,GAAa,GACbI,EAAKC,iBAEPC,QAAUC,IACRP,GAAa,GACbQ,EAAaC,iBAAiB,CAACF,IAC/BH,EAAKE,UAAUC,MAGlB,CAACT,IAGEY,EAASP,EACb,IAAMQ,IACN,IAIIC,EAAoBC,EAAqC,MAC7B,OAA9BD,EAAkBE,UACpBF,EAAkBE,QAAUJ,EAAOK,eAAeb,IAEpD,MAAMc,EAAiBJ,EAAkBE,QAEnCG,EAAeC,EAAY,KAC/BF,EAAeC,eACfjB,GAAa,IACZ,CAACgB,IAEEG,EAAcD,EAAY,KAC9BF,EAAeG,cACfnB,GAAa,IACZ,CAACgB,IAwBJ,OArBAI,EAAU,KACR,IAAIC,GAAU,EAEd,MAAMC,EAAO,KACX,IAAKD,EACH,OAEF,MAAME,EAAUP,EAAejB,YAC/BC,EAAauB,GACTA,GACFC,sBAAsBF,IAK1B,OAFAA,IAEO,KACLD,GAAU,EACVL,EAAeG,gBAEhB,CAACH,IAEG,CAAEjB,YAAWkB,eAAcE,cACpC"}
1
+ {"version":3,"file":"polling-manager.js","sources":["../../../src/hooks/utility/polling-manager.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { getScreen } from '../../state/instance-store';\nimport { errorManager } from '../common/errors';\n\nimport type {\n MfaPollingOptions,\n MfaPushPollingControl,\n Error as ULError,\n} from '@auth0/auth0-acul-js';\n\n/**\n * Result object returned by {@link useMfaPolling}.\n *\n * @public\n */\nexport interface MfaPollingResult {\n /**\n * Indicates whether the MFA push polling process is currently active.\n *\n * - `true` — Polling is running and awaiting completion.\n * - `false` — Polling has stopped, either due to completion,\n * manual cancellation, or component unmount.\n */\n isRunning: boolean;\n\n /**\n * Starts or resumes the polling process.\n *\n * - If polling is already active, this call has no effect.\n * - If previously stopped, calling this restarts the polling loop.\n */\n startPolling: () => void;\n\n /**\n * Stops the polling process immediately.\n *\n * - Cancels any scheduled timers or in-flight requests.\n * - Safe to call multiple times; subsequent calls have no effect.\n */\n stopPolling: () => void;\n}\n\n/**\n * React hook to manage MFA push polling (e.g., waiting for a push notification approval)\n * on an Auth0 Advanced Customization of Universal Login (ACUL) screen.\n *\n * This hook sets up and controls a long-running polling loop that repeatedly checks\n * the MFA push challenge endpoint until one of the following occurs:\n *\n * - The challenge is **approved or denied** by the user, triggering `options.onCompleted`.\n * - An **error** occurs (network error, non-200/429 response), triggering `options.onError`.\n * - The **component unmounts** or `stopPolling()` is called, which cancels polling.\n *\n * ### Key Features\n * - `isRunning` is **reactive** — it updates automatically if the polling loop\n * stops internally or is canceled.\n * - Uses a **stable single polling instance** (`useRef`) to prevent\n * duplicate network calls and unintended restarts during React re-renders.\n * - **Automatic cleanup** on unmount: no orphan timers or leaked XHR requests.\n *\n * @param options - {@link MfaPollingOptions} specifying the polling interval,\n * success callback (`onCompleted`), and optional error handler (`onError`).\n *\n *@supportedScreens\n * - `mfa-push-challenge-push`\n * - `reset-password-mfa-push-challenge-push`\n * - `mfa-push-enrollment-qr`\n *\n * @returns object {@link MfaPollingResult} containing:\n * - `isRunning` — `true` while polling is active.\n * - `startPolling()` — starts or resumes polling.\n * - `stopPolling()` — stops polling immediately.\n *\n * @example\n * ```tsx\n * import { useMfaPolling } from '@auth0/auth0-acul-react/mfa-push-challenge-push';\n *\n * export function MfaPushStatus() {\n * const { isRunning, startPolling, stopPolling } = useMfaPolling({\n * intervalMs: 5000,\n * onCompleted: () => console.log('Push approved!/denied'),\n * onError: (error) => console.error('Polling error:', error)\n * });\n *\n * return (\n * <div>\n * <button onClick={startPolling} disabled={isRunning}>\n * {isRunning ? 'Waiting for approval…' : 'Start MFA Polling'}\n * </button>\n * {isRunning && <button onClick={stopPolling}>Cancel</button>}\n * </div>\n * );\n * }\n * ```\n *\n * @remarks\n * - The `onError` callback receives an {@link ULError} object\n * with `status` and `responseText` describing the server response.\n * - Internal rate-limit responses (`429`) are automatically handled:\n * polling waits for the reset window before retrying.\n * - Calling `startPolling()` repeatedly while running is safe and idempotent.\n *\n * @public\n */\nexport function useMfaPolling(options?: MfaPollingOptions): MfaPollingResult {\n const [isRunning, setIsRunning] = useState(false);\n\n // Wrap callbacks safely to immediately update `isRunning` on completion/error.\n const wrappedOptions: MfaPollingOptions = useMemo(() => {\n const safe = options ?? {};\n return {\n ...safe,\n onCompleted: () => {\n setIsRunning(false);\n safe.onCompleted?.();\n },\n onError: (error: ULError) => {\n setIsRunning(false);\n errorManager.pushServerErrors([error]);\n safe.onError?.(error);\n },\n };\n }, [options]);\n\n // Stable screen instance\n const screen = useMemo(\n () => getScreen<{ pollingManager: (o: MfaPollingOptions) => MfaPushPollingControl }>(),\n []\n );\n\n // Single polling control instance per component\n const pollingControlRef = useRef<MfaPushPollingControl | null>(null);\n if (pollingControlRef.current === null) {\n pollingControlRef.current = screen.pollingManager(wrappedOptions);\n }\n const pollingControl = pollingControlRef.current;\n\n const startPolling = useCallback(() => {\n pollingControl.startPolling();\n setIsRunning(true);\n }, [pollingControl]);\n\n const stopPolling = useCallback(() => {\n pollingControl.stopPolling();\n setIsRunning(false);\n }, [pollingControl]);\n\n // One effect handles cleanup and state sync\n useEffect(() => {\n let mounted = true;\n\n const tick = () => {\n if (!mounted) {\n return;\n }\n const running = pollingControl.isRunning();\n setIsRunning(running);\n if (running) {\n requestAnimationFrame(tick);\n }\n };\n tick();\n\n return () => {\n mounted = false;\n pollingControl.stopPolling();\n };\n }, [pollingControl]);\n\n return { isRunning, startPolling, stopPolling };\n}\n\nexport type { MfaPollingOptions, ULError };\n"],"names":["useMfaPolling","options","isRunning","setIsRunning","useState","wrappedOptions","useMemo","safe","onCompleted","onError","error","errorManager","pushServerErrors","screen","getScreen","pollingControlRef","useRef","current","pollingManager","pollingControl","startPolling","useCallback","stopPolling","useEffect","mounted","tick","running","requestAnimationFrame"],"mappings":"uMAyGM,SAAUA,EAAcC,GAC5B,MAAOC,EAAWC,GAAgBC,GAAS,GAGrCC,EAAoCC,EAAQ,KAChD,MAAMC,EAAON,GAAW,CAAA,EACxB,MAAO,IACFM,EACHC,YAAa,KACXL,GAAa,GACbI,EAAKC,iBAEPC,QAAUC,IACRP,GAAa,GACbQ,EAAaC,iBAAiB,CAACF,IAC/BH,EAAKE,UAAUC,MAGlB,CAACT,IAGEY,EAASP,EACb,IAAMQ,IACN,IAIIC,EAAoBC,EAAqC,MAC7B,OAA9BD,EAAkBE,UACpBF,EAAkBE,QAAUJ,EAAOK,eAAeb,IAEpD,MAAMc,EAAiBJ,EAAkBE,QAEnCG,EAAeC,EAAY,KAC/BF,EAAeC,eACfjB,GAAa,IACZ,CAACgB,IAEEG,EAAcD,EAAY,KAC9BF,EAAeG,cACfnB,GAAa,IACZ,CAACgB,IAwBJ,OArBAI,EAAU,KACR,IAAIC,GAAU,EAEd,MAAMC,EAAO,KACX,IAAKD,EACH,OAEF,MAAME,EAAUP,EAAejB,YAC/BC,EAAauB,GACTA,GACFC,sBAAsBF,IAK1B,OAFAA,IAEO,KACLD,GAAU,EACVL,EAAeG,gBAEhB,CAACH,IAEG,CAAEjB,YAAWkB,eAAcE,cACpC"}
@@ -1,2 +1,2 @@
1
- import{useMemo as r}from"react";import{getScreen as e}from"../../state/instance-store.js";import{errorManager as s}from"../common/errors.js";function o(o,t){return r(()=>{const r=e().validatePassword(o);return t?.includeInErrors&&s.replaceClientErrors(r.isValid?[]:[{code:"password-policy-error",field:"password",message:"The password does not meet the required criteria.",rules:r.results}],{byField:"password"}),r},[o,t?.includeInErrors])}export{o as usePasswordValidation};
1
+ import{useMemo as r}from"react";import{getScreen as e}from"../../state/instance-store.js";import{errorManager as o}from"../common/errors.js";function s(s,t){return r(()=>{const r=e().validatePassword(s);return t?.includeInErrors&&o.replaceValidationErrors(r.isValid?[]:[{code:"password-policy-error",field:"password",message:"The password does not meet the required criteria.",rules:r.results}],{byField:"password"}),r},[s,t?.includeInErrors])}export{s as usePasswordValidation};
2
2
  //# sourceMappingURL=validate-password.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-password.js","sources":["../../../src/hooks/utility/validate-password.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { getScreen } from '../../state/instance-store';\nimport { errorManager } from '../common/errors';\n\nimport type { PasswordValidationResult } from '@auth0/auth0-acul-js';\n\ninterface WithValidatePassword {\n validatePassword: (password: string) => PasswordValidationResult;\n}\n\n/**\n * This React hook validates a password against the current Auth0 password policy\n * and returns a structured result describing whether the password satisfies each rule.\n *\n * Optionally, it can send the validation results to the global error manager so that\n * form error components can update automatically.\n *\n * @supportedScreens\n * - `signup`\n * - `signup-password`\n * - `reset-password`\n *\n * @param password\n * - The password to validate.\n * @param options.includeInErrors\n * - If `true`, validation errors are stored in the global error manager under the `password` field. Defaults to `false`.\n *\n * @returns A {@link PasswordValidationResult} object containing:\n * - `isValid` — `true` if the password satisfies all configured rules.\n * - `results` — an array of per-rule results with `code`, `label`, `status`, and `isValid`.\n *\n * @example This example shows how to use the hook in a functional component on \"signup\" screen.\n * ```tsx\n * import { usePasswordValidation } from '@auth0/auth0-acul-react/signup';\n * const { isValid, results} = usePasswordValidation(password, { includeInErrors: true });\n *\n * if (!isValid) {\n * console.log(results);\n * }\n * ```\n */\nexport function usePasswordValidation(\n password: string,\n options?: { includeInErrors?: boolean }\n): PasswordValidationResult {\n return useMemo(() => {\n const instance = getScreen<WithValidatePassword>();\n const validation = instance.validatePassword(password);\n\n if (options?.includeInErrors) {\n errorManager.replaceClientErrors(\n validation.isValid\n ? []\n : [\n {\n code: 'password-policy-error',\n field: 'password',\n message: 'The password does not meet the required criteria.',\n rules: validation.results,\n },\n ],\n { byField: 'password' }\n );\n }\n\n return validation;\n }, [password, options?.includeInErrors]);\n}\n\nexport { PasswordValidationResult, PasswordComplexityRule } from '@auth0/auth0-acul-js';\n"],"names":["usePasswordValidation","password","options","useMemo","validation","getScreen","validatePassword","includeInErrors","errorManager","replaceClientErrors","isValid","code","field","message","rules","results","byField"],"mappings":"6IA0CM,SAAUA,EACdC,EACAC,GAEA,OAAOC,EAAQ,KACb,MACMC,EADWC,IACWC,iBAAiBL,GAkB7C,OAhBIC,GAASK,iBACXC,EAAaC,oBACXL,EAAWM,QACP,GACA,CACE,CACEC,KAAM,wBACNC,MAAO,WACPC,QAAS,oDACTC,MAAOV,EAAWW,UAG1B,CAAEC,QAAS,aAIRZ,GACN,CAACH,EAAUC,GAASK,iBACzB"}
1
+ {"version":3,"file":"validate-password.js","sources":["../../../src/hooks/utility/validate-password.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { getScreen } from '../../state/instance-store';\nimport { errorManager } from '../common/errors';\n\nimport type { PasswordValidationResult } from '@auth0/auth0-acul-js';\n\ninterface WithValidatePassword {\n validatePassword: (password: string) => PasswordValidationResult;\n}\n\n/**\n * This React hook validates a password against the current Auth0 password policy\n * and returns a structured result describing whether the password satisfies each rule.\n *\n * Optionally, it can send the validation results to the global error manager so that\n * form error components can update automatically.\n *\n * @supportedScreens\n * - `signup`\n * - `signup-password`\n * - `reset-password`\n *\n * @param password\n * - The password to validate.\n * @param options.includeInErrors\n * - If `true`, validation errors are stored in the global error manager under the `password` field. Defaults to `false`.\n *\n * @returns A {@link PasswordValidationResult} object containing:\n * - `isValid` — `true` if the password satisfies all configured rules.\n * - `results` — an array of per-rule results with `code`, `label`, `status`, and `isValid`.\n *\n * @example This example shows how to use the hook in a functional component on \"signup\" screen.\n * ```tsx\n * import { usePasswordValidation } from '@auth0/auth0-acul-react/signup';\n * const { isValid, results} = usePasswordValidation(password, { includeInErrors: true });\n *\n * if (!isValid) {\n * console.log(results);\n * }\n * ```\n */\nexport function usePasswordValidation(\n password: string,\n options?: { includeInErrors?: boolean }\n): PasswordValidationResult {\n return useMemo(() => {\n const instance = getScreen<WithValidatePassword>();\n const validation = instance.validatePassword(password);\n\n if (options?.includeInErrors) {\n errorManager.replaceValidationErrors(\n validation.isValid\n ? []\n : [\n {\n code: 'password-policy-error',\n field: 'password',\n message: 'The password does not meet the required criteria.',\n rules: validation.results,\n },\n ],\n { byField: 'password' }\n );\n }\n\n return validation;\n }, [password, options?.includeInErrors]);\n}\n\nexport { PasswordValidationResult, PasswordComplexityRule } from '@auth0/auth0-acul-js';\n"],"names":["usePasswordValidation","password","options","useMemo","validation","getScreen","validatePassword","includeInErrors","errorManager","replaceValidationErrors","isValid","code","field","message","rules","results","byField"],"mappings":"6IA0CM,SAAUA,EACdC,EACAC,GAEA,OAAOC,EAAQ,KACb,MACMC,EADWC,IACWC,iBAAiBL,GAkB7C,OAhBIC,GAASK,iBACXC,EAAaC,wBACXL,EAAWM,QACP,GACA,CACE,CACEC,KAAM,wBACNC,MAAO,WACPC,QAAS,oDACTC,MAAOV,EAAWW,UAG1B,CAAEC,QAAS,aAIRZ,GACN,CAACH,EAAUC,GAASK,iBACzB"}
@@ -1,2 +1,2 @@
1
- import{useMemo as r}from"react";import{getScreen as e}from"../../state/instance-store.js";import{errorManager as o}from"../common/errors.js";function s(s,n){return r(()=>{const r=e().validateUsername(s);return n?.includeInErrors&&o.replaceClientErrors(r.errors,{byField:"username"}),{isValid:r.isValid,errors:r.errors}},[s,n?.includeInErrors])}export{s as useUsernameValidation};
1
+ import{useMemo as r}from"react";import{getScreen as e}from"../../state/instance-store.js";import{errorManager as o}from"../common/errors.js";function s(s,i){return r(()=>{const r=e().validateUsername(s);return i?.includeInErrors&&o.replaceValidationErrors(r.errors,{byField:"username"}),{isValid:r.isValid,errors:r.errors}},[s,i?.includeInErrors])}export{s as useUsernameValidation};
2
2
  //# sourceMappingURL=validate-username.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate-username.js","sources":["../../../src/hooks/utility/validate-username.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { getScreen } from '../../state/instance-store';\nimport { errorManager } from '../common/errors';\n\nimport type { UsernameValidationResult } from '@auth0/auth0-acul-js';\n\ninterface WithValidateUsername {\n validateUsername: (username: string) => UsernameValidationResult;\n}\n\n/**\n * React hook for validating a username against the current Auth0 username policy.\n *\n * This hook checks the provided username against all configured validation rules\n * and returns a structured result describing whether it passes.\n * Optionally, it can send validation errors to the global error manager so that\n * UI components observing the `username` field can automatically display or react\n * to these errors.\n *\n * @supportedScreens\n * - `signup`\n * - `signup-id`\n *\n * @param username - The username string to validate.\n * @param options.includeInErrors - When `true`, validation errors are stored in the\n * global error manager under the `username` field. Defaults to `false`.\n *\n * @returns A {@link UsernameValidationResult} object with:\n * - `isValid` — `true` if the username satisfies all configured rules.\n * - `errors` — an array of per-rule validation errors with `code`, `message`, and `isValid`.\n *\n * @example\n * ```tsx\n * import { useUsernameValidation } from \"@auth0/auth0-acul-react/signup\";\n *\n * export function UsernameField() {\n * const { isValid, errors } = useUsernameValidation(username, { includeInErrors: true });\n *\n * return (\n * <div>\n * <input\n * value={username}\n * onChange={e => setUsername(e.target.value)}\n * aria-invalid={!isValid}\n * />\n *\n * {!isValid && (\n * <ul>\n * {errors.map(err => (\n * <li key={err.code}>{err.message}</li>\n * ))}\n * </ul>\n * )}\n * </div>\n * );\n * }\n * ```\n *\n * @remarks\n * - When `includeInErrors` is enabled, the hook automatically updates the errors to the error-store\n * which can be consumed by `useErrors` hook.\n * - The hook only recomputes when `username` or `options.includeInErrors` change.\n */\nexport function useUsernameValidation(\n username: string,\n options?: { includeInErrors?: boolean }\n): UsernameValidationResult {\n return useMemo(() => {\n const instance = getScreen<WithValidateUsername>();\n const result = instance.validateUsername(username);\n\n if (options?.includeInErrors) {\n errorManager.replaceClientErrors(result.errors, { byField: 'username' });\n }\n\n return { isValid: result.isValid, errors: result.errors };\n }, [username, options?.includeInErrors]);\n}\n\nexport type { UsernameValidationResult, UsernameValidationError } from '@auth0/auth0-acul-js';\n"],"names":["useUsernameValidation","username","options","useMemo","result","getScreen","validateUsername","includeInErrors","errorManager","replaceClientErrors","errors","byField","isValid"],"mappings":"6IAgEM,SAAUA,EACdC,EACAC,GAEA,OAAOC,EAAQ,KACb,MACMC,EADWC,IACOC,iBAAiBL,GAMzC,OAJIC,GAASK,iBACXC,EAAaC,oBAAoBL,EAAOM,OAAQ,CAAEC,QAAS,aAGtD,CAAEC,QAASR,EAAOQ,QAASF,OAAQN,EAAOM,SAChD,CAACT,EAAUC,GAASK,iBACzB"}
1
+ {"version":3,"file":"validate-username.js","sources":["../../../src/hooks/utility/validate-username.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { getScreen } from '../../state/instance-store';\nimport { errorManager } from '../common/errors';\n\nimport type { UsernameValidationResult } from '@auth0/auth0-acul-js';\n\ninterface WithValidateUsername {\n validateUsername: (username: string) => UsernameValidationResult;\n}\n\n/**\n * React hook for validating a username against the current Auth0 username policy.\n *\n * This hook checks the provided username against all configured validation rules\n * and returns a structured result describing whether it passes.\n * Optionally, it can send validation errors to the global error manager so that\n * UI components observing the `username` field can automatically display or react\n * to these errors.\n *\n * @supportedScreens\n * - `signup`\n * - `signup-id`\n *\n * @param username - The username string to validate.\n * @param options.includeInErrors - When `true`, validation errors are stored in the\n * global error manager under the `username` field. Defaults to `false`.\n *\n * @returns A {@link UsernameValidationResult} object with:\n * - `isValid` — `true` if the username satisfies all configured rules.\n * - `errors` — an array of per-rule validation errors with `code`, `message`, and `isValid`.\n *\n * @example\n * ```tsx\n * import { useUsernameValidation } from \"@auth0/auth0-acul-react/signup\";\n *\n * export function UsernameField() {\n * const { isValid, errors } = useUsernameValidation(username, { includeInErrors: true });\n *\n * return (\n * <div>\n * <input\n * value={username}\n * onChange={e => setUsername(e.target.value)}\n * aria-invalid={!isValid}\n * />\n *\n * {!isValid && (\n * <ul>\n * {errors.map(err => (\n * <li key={err.code}>{err.message}</li>\n * ))}\n * </ul>\n * )}\n * </div>\n * );\n * }\n * ```\n *\n * @remarks\n * - When `includeInErrors` is enabled, the hook automatically updates the errors to the error-store\n * which can be consumed by `useErrors` hook.\n * - The hook only recomputes when `username` or `options.includeInErrors` change.\n */\nexport function useUsernameValidation(\n username: string,\n options?: { includeInErrors?: boolean }\n): UsernameValidationResult {\n return useMemo(() => {\n const instance = getScreen<WithValidateUsername>();\n const result = instance.validateUsername(username);\n\n if (options?.includeInErrors) {\n errorManager.replaceValidationErrors(result.errors, { byField: 'username' });\n }\n\n return { isValid: result.isValid, errors: result.errors };\n }, [username, options?.includeInErrors]);\n}\n\nexport type { UsernameValidationResult, UsernameValidationError } from '@auth0/auth0-acul-js';\n"],"names":["useUsernameValidation","username","options","useMemo","result","getScreen","validateUsername","includeInErrors","errorManager","replaceValidationErrors","errors","byField","isValid"],"mappings":"6IAgEM,SAAUA,EACdC,EACAC,GAEA,OAAOC,EAAQ,KACb,MACMC,EADWC,IACOC,iBAAiBL,GAMzC,OAJIC,GAASK,iBACXC,EAAaC,wBAAwBL,EAAOM,OAAQ,CAAEC,QAAS,aAG1D,CAAEC,QAASR,EAAOQ,QAASF,OAAQN,EAAOM,SAChD,CAACT,EAAUC,GAASK,iBACzB"}
@@ -5,5 +5,6 @@ export declare const federatedLogin: (payload: FederatedLoginOptions) => void |
5
5
  export declare const passkeyLogin: (payload?: CustomOptions) => void | Promise<void>;
6
6
  export declare const pickCountryCode: (payload?: CustomOptions) => void | Promise<void>;
7
7
  export { useLoginIdentifiers } from '../hooks/utility/login-identifiers';
8
+ export { usePasskeyAutofill } from '../hooks/utility/passkey-autofill';
8
9
  export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
9
10
  export declare const useLoginId: () => LoginIdMembers;
@@ -1,2 +1,2 @@
1
- import o from"@auth0/auth0-acul-js/login-id";import{useMemo as e}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as r}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";export{useLoginIdentifiers}from"../hooks/utility/login-identifiers.js";import{registerScreen as t}from"../state/instance-store.js";const n=t(o),{withError:i}=r,m=new s(n),{useUser:u,useTenant:a,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:d,useTransaction:g,useUntrustedData:j}=m,k=o=>i(n.login(o)),x=o=>i(n.federatedLogin(o)),l=o=>i(n.passkeyLogin(o)),C=o=>i(n.pickCountryCode(o)),y=()=>e(()=>n,[]);export{x as federatedLogin,k as login,l as passkeyLogin,C as pickCountryCode,c as useBranding,h as useClient,y as useLoginId,p as useOrganization,f as usePrompt,d as useScreen,a as useTenant,g as useTransaction,j as useUntrustedData,u as useUser};
1
+ import o from"@auth0/auth0-acul-js/login-id";import{useMemo as e}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as r}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";export{useLoginIdentifiers}from"../hooks/utility/login-identifiers.js";import{registerScreen as t}from"../state/instance-store.js";export{usePasskeyAutofill}from"../hooks/utility/passkey-autofill.js";const n=t(o),{withError:i}=r,u=new s(n),{useUser:m,useTenant:a,useBranding:c,useClient:f,useOrganization:p,usePrompt:h,useScreen:k,useTransaction:l,useUntrustedData:d}=u,j=o=>i(n.login(o)),g=o=>i(n.federatedLogin(o)),x=o=>i(n.passkeyLogin(o)),y=o=>i(n.pickCountryCode(o)),C=()=>e(()=>n,[]);export{g as federatedLogin,j as login,x as passkeyLogin,y as pickCountryCode,c as useBranding,f as useClient,C as useLoginId,p as useOrganization,h as usePrompt,k as useScreen,a as useTenant,l as useTransaction,d as useUntrustedData,m as useUser};
2
2
  //# sourceMappingURL=login-id.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"login-id.js","sources":["../../src/screens/login-id.tsx"],"sourcesContent":["import LoginId from '@auth0/auth0-acul-js/login-id';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n LoginIdMembers,\n LoginOptions,\n FederatedLoginOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/login-id';\n\n// Register the singleton instance of LoginId\nconst instance = registerScreen<LoginIdMembers>(LoginId)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<LoginIdMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const login = (payload: LoginOptions) => withError(instance.login(payload));\nexport const federatedLogin = (payload: FederatedLoginOptions) =>\n withError(instance.federatedLogin(payload));\nexport const passkeyLogin = (payload?: CustomOptions) => withError(instance.passkeyLogin(payload));\nexport const pickCountryCode = (payload?: CustomOptions) =>\n withError(instance.pickCountryCode(payload));\n\n// Utility Hooks\nexport { useLoginIdentifiers } from '../hooks/utility/login-identifiers';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of LoginId\nexport const useLoginId = (): LoginIdMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","LoginId","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","login","payload","federatedLogin","passkeyLogin","pickCountryCode","useLoginId","useMemo"],"mappings":"+eAeA,MAAMA,EAAWC,EAA+BC,IAG1CC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAA6BN,IACpCO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAASC,GAA0Bd,EAAUH,EAASgB,MAAMC,IAC5DC,EAAkBD,GAC7Bd,EAAUH,EAASkB,eAAeD,IACvBE,EAAgBF,GAA4Bd,EAAUH,EAASmB,aAAaF,IAC5EG,EAAmBH,GAC9Bd,EAAUH,EAASoB,gBAAgBH,IAiBxBI,EAAa,IAAsBC,EAAQ,IAAMtB,EAAU"}
1
+ {"version":3,"file":"login-id.js","sources":["../../src/screens/login-id.tsx"],"sourcesContent":["import LoginId from '@auth0/auth0-acul-js/login-id';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n LoginIdMembers,\n LoginOptions,\n FederatedLoginOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/login-id';\n\n// Register the singleton instance of LoginId\nconst instance = registerScreen<LoginIdMembers>(LoginId)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<LoginIdMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const login = (payload: LoginOptions) => withError(instance.login(payload));\nexport const federatedLogin = (payload: FederatedLoginOptions) =>\n withError(instance.federatedLogin(payload));\nexport const passkeyLogin = (payload?: CustomOptions) => withError(instance.passkeyLogin(payload));\nexport const pickCountryCode = (payload?: CustomOptions) =>\n withError(instance.pickCountryCode(payload));\n\n// Utility Hooks\nexport { useLoginIdentifiers } from '../hooks/utility/login-identifiers';\n\n// Utility Hooks\nexport { usePasskeyAutofill } from '../hooks/utility/passkey-autofill';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of LoginId\nexport const useLoginId = (): LoginIdMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","LoginId","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","login","payload","federatedLogin","passkeyLogin","pickCountryCode","useLoginId","useMemo"],"mappings":"ojBAeA,MAAMA,EAAWC,EAA+BC,IAG1CC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAA6BN,IACpCO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAASC,GAA0Bd,EAAUH,EAASgB,MAAMC,IAC5DC,EAAkBD,GAC7Bd,EAAUH,EAASkB,eAAeD,IACvBE,EAAgBF,GAA4Bd,EAAUH,EAASmB,aAAaF,IAC5EG,EAAmBH,GAC9Bd,EAAUH,EAASoB,gBAAgBH,IAoBxBI,EAAa,IAAsBC,EAAQ,IAAMtB,EAAU"}
@@ -1,6 +1,7 @@
1
- import type { LoginPasswordMembers, LoginPasswordOptions, FederatedLoginOptions } from '@auth0/auth0-acul-js/login-password';
1
+ import type { LoginPasswordMembers, LoginPasswordOptions, FederatedLoginOptions, SwitchConnectionOptions } from '@auth0/auth0-acul-js/login-password';
2
2
  export declare const useUser: () => import("@auth0/auth0-acul-js").UserMembers, useTenant: () => import("@auth0/auth0-acul-js").TenantMembers, useBranding: () => import("@auth0/auth0-acul-js").BrandingMembers, useClient: () => import("@auth0/auth0-acul-js").ClientMembers, useOrganization: () => import("@auth0/auth0-acul-js").OrganizationMembers, usePrompt: () => import("@auth0/auth0-acul-js").PromptMembers, useScreen: () => import("@auth0/auth0-acul-js").ScreenMembersOnLoginPassword, useTransaction: () => import("@auth0/auth0-acul-js").TransactionMembersOnLoginPassword, useUntrustedData: () => import("@auth0/auth0-acul-js").UntrustedDataMembers;
3
3
  export declare const login: (payload: LoginPasswordOptions) => void | Promise<void>;
4
4
  export declare const federatedLogin: (payload: FederatedLoginOptions) => void | Promise<void>;
5
+ export declare const switchConnection: (payload: SwitchConnectionOptions) => void | Promise<void>;
5
6
  export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
6
7
  export declare const useLoginPassword: () => LoginPasswordMembers;
@@ -1,2 +1,2 @@
1
- import o from"@auth0/auth0-acul-js/login-password";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as e}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";const n=t(o),{withError:m}=e,u=new s(n),{useUser:a,useTenant:i,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:j,useTransaction:d,useUntrustedData:x}=u,g=o=>m(n.login(o)),k=o=>m(n.federatedLogin(o)),l=()=>r(()=>n,[]);export{k as federatedLogin,g as login,c as useBranding,h as useClient,l as useLoginPassword,p as useOrganization,f as usePrompt,j as useScreen,i as useTenant,d as useTransaction,x as useUntrustedData,a as useUser};
1
+ import o from"@auth0/auth0-acul-js/login-password";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as e}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";const n=t(o),{withError:m}=e,u=new s(n),{useUser:i,useTenant:a,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:j,useTransaction:d,useUntrustedData:x}=u,g=o=>m(n.login(o)),k=o=>m(n.federatedLogin(o)),l=o=>m(n.switchConnection(o)),w=()=>r(()=>n,[]);export{k as federatedLogin,g as login,l as switchConnection,c as useBranding,h as useClient,w as useLoginPassword,p as useOrganization,f as usePrompt,j as useScreen,a as useTenant,d as useTransaction,x as useUntrustedData,i as useUser};
2
2
  //# sourceMappingURL=login-password.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"login-password.js","sources":["../../src/screens/login-password.tsx"],"sourcesContent":["import LoginPassword from '@auth0/auth0-acul-js/login-password';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n LoginPasswordMembers,\n LoginPasswordOptions,\n FederatedLoginOptions,\n} from '@auth0/auth0-acul-js/login-password';\n\n// Register the singleton instance of LoginPassword\nconst instance = registerScreen<LoginPasswordMembers>(LoginPassword)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<LoginPasswordMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const login = (payload: LoginPasswordOptions) => withError(instance.login(payload));\nexport const federatedLogin = (payload: FederatedLoginOptions) =>\n withError(instance.federatedLogin(payload));\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of LoginPassword\nexport const useLoginPassword = (): LoginPasswordMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","LoginPassword","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","login","payload","federatedLogin","useLoginPassword","useMemo"],"mappings":"8aAcA,MAAMA,EAAWC,EAAqCC,IAGhDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAmCN,IAC1CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAASC,GAAkCd,EAAUH,EAASgB,MAAMC,IACpEC,EAAkBD,GAC7Bd,EAAUH,EAASkB,eAAeD,IAcvBE,EAAmB,IAA4BC,EAAQ,IAAMpB,EAAU"}
1
+ {"version":3,"file":"login-password.js","sources":["../../src/screens/login-password.tsx"],"sourcesContent":["import LoginPassword from '@auth0/auth0-acul-js/login-password';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n LoginPasswordMembers,\n LoginPasswordOptions,\n FederatedLoginOptions,\n SwitchConnectionOptions,\n} from '@auth0/auth0-acul-js/login-password';\n\n// Register the singleton instance of LoginPassword\nconst instance = registerScreen<LoginPasswordMembers>(LoginPassword)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<LoginPasswordMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const login = (payload: LoginPasswordOptions) => withError(instance.login(payload));\nexport const federatedLogin = (payload: FederatedLoginOptions) =>\n withError(instance.federatedLogin(payload));\nexport const switchConnection = (payload: SwitchConnectionOptions) =>\n withError(instance.switchConnection(payload));\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of LoginPassword\nexport const useLoginPassword = (): LoginPasswordMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","LoginPassword","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","login","payload","federatedLogin","switchConnection","useLoginPassword","useMemo"],"mappings":"8aAeA,MAAMA,EAAWC,EAAqCC,IAGhDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAmCN,IAC1CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAASC,GAAkCd,EAAUH,EAASgB,MAAMC,IACpEC,EAAkBD,GAC7Bd,EAAUH,EAASkB,eAAeD,IACvBE,EAAoBF,GAC/Bd,EAAUH,EAASmB,iBAAiBF,IAczBG,EAAmB,IAA4BC,EAAQ,IAAMrB,EAAU"}
@@ -1,5 +1,6 @@
1
- import type { MfaLoginOptionsMembers, LoginEnrollOptions } from '@auth0/auth0-acul-js/mfa-login-options';
1
+ import type { MfaLoginOptionsMembers, LoginEnrollOptions, CustomOptions } from '@auth0/auth0-acul-js/mfa-login-options';
2
2
  export declare const useUser: () => import("@auth0/auth0-acul-js").UserMembers, useTenant: () => import("@auth0/auth0-acul-js").TenantMembers, useBranding: () => import("@auth0/auth0-acul-js").BrandingMembers, useClient: () => import("@auth0/auth0-acul-js").ClientMembers, useOrganization: () => import("@auth0/auth0-acul-js").OrganizationMembers, usePrompt: () => import("@auth0/auth0-acul-js").PromptMembers, useScreen: () => import("@auth0/auth0-acul-js").ScreenMembersOnMfaLoginOptions, useTransaction: () => import("@auth0/auth0-acul-js").TransactionMembers, useUntrustedData: () => import("@auth0/auth0-acul-js").UntrustedDataMembers;
3
3
  export declare const enroll: (payload: LoginEnrollOptions) => void | Promise<void>;
4
+ export declare const returnToPrevious: (payload?: CustomOptions) => void | Promise<void>;
4
5
  export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
5
6
  export declare const useMfaLoginOptions: () => MfaLoginOptionsMembers;
@@ -1,2 +1,2 @@
1
- import o from"@auth0/auth0-acul-js/mfa-login-options";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as e}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";const n=t(o),{withError:m}=e,u=new s(n),{useUser:a,useTenant:i,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:j,useTransaction:x,useUntrustedData:k}=u,l=o=>m(n.enroll(o)),d=()=>r(()=>n,[]);export{l as enroll,c as useBranding,h as useClient,d as useMfaLoginOptions,p as useOrganization,f as usePrompt,j as useScreen,i as useTenant,x as useTransaction,k as useUntrustedData,a as useUser};
1
+ import o from"@auth0/auth0-acul-js/mfa-login-options";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as e}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";const n=t(o),{withError:m}=e,u=new s(n),{useUser:a,useTenant:i,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:j,useTransaction:x,useUntrustedData:k}=u,l=o=>m(n.enroll(o)),T=o=>m(n.returnToPrevious(o)),d=()=>r(()=>n,[]);export{l as enroll,T as returnToPrevious,c as useBranding,h as useClient,d as useMfaLoginOptions,p as useOrganization,f as usePrompt,j as useScreen,i as useTenant,x as useTransaction,k as useUntrustedData,a as useUser};
2
2
  //# sourceMappingURL=mfa-login-options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mfa-login-options.js","sources":["../../src/screens/mfa-login-options.tsx"],"sourcesContent":["import MfaLoginOptions from '@auth0/auth0-acul-js/mfa-login-options';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n MfaLoginOptionsMembers,\n LoginEnrollOptions,\n} from '@auth0/auth0-acul-js/mfa-login-options';\n\n// Register the singleton instance of MfaLoginOptions\nconst instance = registerScreen<MfaLoginOptionsMembers>(MfaLoginOptions)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<MfaLoginOptionsMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const enroll = (payload: LoginEnrollOptions) => withError(instance.enroll(payload));\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of MfaLoginOptions\nexport const useMfaLoginOptions = (): MfaLoginOptionsMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","MfaLoginOptions","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","enroll","payload","useMfaLoginOptions","useMemo"],"mappings":"ibAaA,MAAMA,EAAWC,EAAuCC,IAGlDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAqCN,IAC5CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAUC,GAAgCd,EAAUH,EAASgB,OAAOC,IAcpEC,EAAqB,IAA8BC,EAAQ,IAAMnB,EAAU"}
1
+ {"version":3,"file":"mfa-login-options.js","sources":["../../src/screens/mfa-login-options.tsx"],"sourcesContent":["import MfaLoginOptions from '@auth0/auth0-acul-js/mfa-login-options';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n MfaLoginOptionsMembers,\n LoginEnrollOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/mfa-login-options';\n\n// Register the singleton instance of MfaLoginOptions\nconst instance = registerScreen<MfaLoginOptionsMembers>(MfaLoginOptions)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<MfaLoginOptionsMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const enroll = (payload: LoginEnrollOptions) => withError(instance.enroll(payload));\nexport const returnToPrevious = (payload?: CustomOptions) =>\n withError(instance.returnToPrevious(payload));\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of MfaLoginOptions\nexport const useMfaLoginOptions = (): MfaLoginOptionsMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","MfaLoginOptions","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","enroll","payload","returnToPrevious","useMfaLoginOptions","useMemo"],"mappings":"ibAcA,MAAMA,EAAWC,EAAuCC,IAGlDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAqCN,IAC5CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAUC,GAAgCd,EAAUH,EAASgB,OAAOC,IACpEC,EAAoBD,GAC/Bd,EAAUH,EAASkB,iBAAiBD,IAczBE,EAAqB,IAA8BC,EAAQ,IAAMpB,EAAU"}
@@ -1,5 +1,6 @@
1
1
  import type { MfaPushEnrollmentQrMembers, CustomOptions } from '@auth0/auth0-acul-js/mfa-push-enrollment-qr';
2
2
  export declare const useUser: () => import("@auth0/auth0-acul-js").UserMembers, useTenant: () => import("@auth0/auth0-acul-js").TenantMembers, useBranding: () => import("@auth0/auth0-acul-js").BrandingMembers, useClient: () => import("@auth0/auth0-acul-js").ClientMembers, useOrganization: () => import("@auth0/auth0-acul-js").OrganizationMembers, usePrompt: () => import("@auth0/auth0-acul-js").PromptMembers, useScreen: () => import("@auth0/auth0-acul-js").ScreenMembersOnMfaPushEnrollmentQr, useTransaction: () => import("@auth0/auth0-acul-js").TransactionMembers, useUntrustedData: () => import("@auth0/auth0-acul-js").UntrustedDataMembers;
3
3
  export declare const pickAuthenticator: (payload?: CustomOptions) => void | Promise<void>;
4
+ export { useMfaPolling } from '../hooks/utility/polling-manager';
4
5
  export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
5
6
  export declare const useMfaPushEnrollmentQr: () => MfaPushEnrollmentQrMembers;
@@ -1,2 +1,2 @@
1
- import o from"@auth0/auth0-acul-js/mfa-push-enrollment-qr";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as e}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";const n=t(o),{withError:m}=e,u=new s(n),{useUser:a,useTenant:c,useBranding:i,useClient:h,useOrganization:p,usePrompt:f,useScreen:j,useTransaction:k,useUntrustedData:x}=u,l=o=>m(n.pickAuthenticator(o)),d=()=>r(()=>n,[]);export{l as pickAuthenticator,i as useBranding,h as useClient,d as useMfaPushEnrollmentQr,p as useOrganization,f as usePrompt,j as useScreen,c as useTenant,k as useTransaction,x as useUntrustedData,a as useUser};
1
+ import o from"@auth0/auth0-acul-js/mfa-push-enrollment-qr";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as e}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";export{useMfaPolling}from"../hooks/utility/polling-manager.js";const n=t(o),{withError:m}=e,u=new s(n),{useUser:a,useTenant:i,useBranding:c,useClient:h,useOrganization:p,usePrompt:f,useScreen:l,useTransaction:j,useUntrustedData:k}=u,x=o=>m(n.pickAuthenticator(o)),g=()=>r(()=>n,[]);export{x as pickAuthenticator,c as useBranding,h as useClient,g as useMfaPushEnrollmentQr,p as useOrganization,f as usePrompt,l as useScreen,i as useTenant,j as useTransaction,k as useUntrustedData,a as useUser};
2
2
  //# sourceMappingURL=mfa-push-enrollment-qr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mfa-push-enrollment-qr.js","sources":["../../src/screens/mfa-push-enrollment-qr.tsx"],"sourcesContent":["import MfaPushEnrollmentQr from '@auth0/auth0-acul-js/mfa-push-enrollment-qr';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n MfaPushEnrollmentQrMembers,\n CustomOptions,\n} from '@auth0/auth0-acul-js/mfa-push-enrollment-qr';\n\n// Register the singleton instance of MfaPushEnrollmentQr\nconst instance = registerScreen<MfaPushEnrollmentQrMembers>(MfaPushEnrollmentQr)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<MfaPushEnrollmentQrMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const pickAuthenticator = (payload?: CustomOptions) =>\n withError(instance.pickAuthenticator(payload));\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of MfaPushEnrollmentQr\nexport const useMfaPushEnrollmentQr = (): MfaPushEnrollmentQrMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","MfaPushEnrollmentQr","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","pickAuthenticator","payload","useMfaPushEnrollmentQr","useMemo"],"mappings":"sbAaA,MAAMA,EAAWC,EAA2CC,IAGtDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAyCN,IAChDO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAqBC,GAChCd,EAAUH,EAASgB,kBAAkBC,IAc1BC,EAAyB,IAAkCC,EAAQ,IAAMnB,EAAU"}
1
+ {"version":3,"file":"mfa-push-enrollment-qr.js","sources":["../../src/screens/mfa-push-enrollment-qr.tsx"],"sourcesContent":["import MfaPushEnrollmentQr from '@auth0/auth0-acul-js/mfa-push-enrollment-qr';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n MfaPushEnrollmentQrMembers,\n CustomOptions,\n} from '@auth0/auth0-acul-js/mfa-push-enrollment-qr';\n\n// Register the singleton instance of MfaPushEnrollmentQr\nconst instance = registerScreen<MfaPushEnrollmentQrMembers>(MfaPushEnrollmentQr)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<MfaPushEnrollmentQrMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const pickAuthenticator = (payload?: CustomOptions) =>\n withError(instance.pickAuthenticator(payload));\n\n// Utility Hooks\nexport { useMfaPolling } from '../hooks/utility/polling-manager';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of MfaPushEnrollmentQr\nexport const useMfaPushEnrollmentQr = (): MfaPushEnrollmentQrMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","MfaPushEnrollmentQr","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","pickAuthenticator","payload","useMfaPushEnrollmentQr","useMemo"],"mappings":"qfAaA,MAAMA,EAAWC,EAA2CC,IAGtDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAyCN,IAChDO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAqBC,GAChCd,EAAUH,EAASgB,kBAAkBC,IAiB1BC,EAAyB,IAAkCC,EAAQ,IAAMnB,EAAU"}
@@ -3,6 +3,8 @@ export declare const useUser: () => import("@auth0/auth0-acul-js").UserMembers,
3
3
  export declare const submitPhoneChallenge: (payload: PhoneChallengeOptions) => void | Promise<void>;
4
4
  export declare const resendCode: (payload?: CustomOptions) => void | Promise<void>;
5
5
  export declare const returnToPrevious: (payload?: CustomOptions) => void | Promise<void>;
6
+ export declare const switchToVoice: (payload?: CustomOptions) => void | Promise<void>;
7
+ export declare const switchToText: (payload?: CustomOptions) => void | Promise<void>;
6
8
  export { useResend } from '../hooks/utility/resend-manager';
7
9
  export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
8
10
  export declare const usePhoneIdentifierChallenge: () => PhoneIdentifierChallengeMembers;
@@ -1,2 +1,2 @@
1
- import e from"@auth0/auth0-acul-js/phone-identifier-challenge";import{useMemo as o}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as r}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";export{useResend}from"../hooks/utility/resend-manager.js";const n=t(e),{withError:m}=r,u=new s(n),{useUser:i,useTenant:a,useBranding:h,useClient:c,useOrganization:p,usePrompt:f,useScreen:d,useTransaction:j,useUntrustedData:l}=u,x=e=>m(n.submitPhoneChallenge(e)),k=e=>m(n.resendCode(e)),g=e=>m(n.returnToPrevious(e)),C=()=>o(()=>n,[]);export{k as resendCode,g as returnToPrevious,x as submitPhoneChallenge,h as useBranding,c as useClient,p as useOrganization,C as usePhoneIdentifierChallenge,f as usePrompt,d as useScreen,a as useTenant,j as useTransaction,l as useUntrustedData,i as useUser};
1
+ import e from"@auth0/auth0-acul-js/phone-identifier-challenge";import{useMemo as o}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as r}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as s}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";export{useResend}from"../hooks/utility/resend-manager.js";const n=t(e),{withError:m}=r,u=new s(n),{useUser:i,useTenant:a,useBranding:h,useClient:c,useOrganization:p,usePrompt:f,useScreen:d,useTransaction:j,useUntrustedData:x}=u,l=e=>m(n.submitPhoneChallenge(e)),T=e=>m(n.resendCode(e)),k=e=>m(n.returnToPrevious(e)),g=e=>m(n.switchToVoice(e)),w=e=>m(n.switchToText(e)),C=()=>o(()=>n,[]);export{T as resendCode,k as returnToPrevious,l as submitPhoneChallenge,w as switchToText,g as switchToVoice,h as useBranding,c as useClient,p as useOrganization,C as usePhoneIdentifierChallenge,f as usePrompt,d as useScreen,a as useTenant,j as useTransaction,x as useUntrustedData,i as useUser};
2
2
  //# sourceMappingURL=phone-identifier-challenge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"phone-identifier-challenge.js","sources":["../../src/screens/phone-identifier-challenge.tsx"],"sourcesContent":["import PhoneIdentifierChallenge from '@auth0/auth0-acul-js/phone-identifier-challenge';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n PhoneIdentifierChallengeMembers,\n PhoneChallengeOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/phone-identifier-challenge';\n\n// Register the singleton instance of PhoneIdentifierChallenge\nconst instance = registerScreen<PhoneIdentifierChallengeMembers>(PhoneIdentifierChallenge)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<PhoneIdentifierChallengeMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const submitPhoneChallenge = (payload: PhoneChallengeOptions) =>\n withError(instance.submitPhoneChallenge(payload));\nexport const resendCode = (payload?: CustomOptions) => withError(instance.resendCode(payload));\nexport const returnToPrevious = (payload?: CustomOptions) =>\n withError(instance.returnToPrevious(payload));\n\n// Utility Hooks\nexport { useResend } from '../hooks/utility/resend-manager';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of PhoneIdentifierChallenge\nexport const usePhoneIdentifierChallenge = (): PhoneIdentifierChallengeMembers =>\n useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","PhoneIdentifierChallenge","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","submitPhoneChallenge","payload","resendCode","returnToPrevious","usePhoneIdentifierChallenge","useMemo"],"mappings":"ofAcA,MAAMA,EAAWC,EAAgDC,IAG3DC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAA8CN,IACrDO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAwBC,GACnCd,EAAUH,EAASgB,qBAAqBC,IAC7BC,EAAcD,GAA4Bd,EAAUH,EAASkB,WAAWD,IACxEE,EAAoBF,GAC/Bd,EAAUH,EAASmB,iBAAiBF,IAiBzBG,EAA8B,IACzCC,EAAQ,IAAMrB,EAAU"}
1
+ {"version":3,"file":"phone-identifier-challenge.js","sources":["../../src/screens/phone-identifier-challenge.tsx"],"sourcesContent":["import PhoneIdentifierChallenge from '@auth0/auth0-acul-js/phone-identifier-challenge';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n PhoneIdentifierChallengeMembers,\n PhoneChallengeOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/phone-identifier-challenge';\n\n// Register the singleton instance of PhoneIdentifierChallenge\nconst instance = registerScreen<PhoneIdentifierChallengeMembers>(PhoneIdentifierChallenge)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<PhoneIdentifierChallengeMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const submitPhoneChallenge = (payload: PhoneChallengeOptions) =>\n withError(instance.submitPhoneChallenge(payload));\nexport const resendCode = (payload?: CustomOptions) => withError(instance.resendCode(payload));\nexport const returnToPrevious = (payload?: CustomOptions) =>\n withError(instance.returnToPrevious(payload));\nexport const switchToVoice = (payload?: CustomOptions) =>\n withError(instance.switchToVoice(payload));\nexport const switchToText = (payload?: CustomOptions) => withError(instance.switchToText(payload));\n\n// Utility Hooks\nexport { useResend } from '../hooks/utility/resend-manager';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of PhoneIdentifierChallenge\nexport const usePhoneIdentifierChallenge = (): PhoneIdentifierChallengeMembers =>\n useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","PhoneIdentifierChallenge","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","submitPhoneChallenge","payload","resendCode","returnToPrevious","switchToVoice","switchToText","usePhoneIdentifierChallenge","useMemo"],"mappings":"ofAcA,MAAMA,EAAWC,EAAgDC,IAG3DC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAA8CN,IACrDO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAwBC,GACnCd,EAAUH,EAASgB,qBAAqBC,IAC7BC,EAAcD,GAA4Bd,EAAUH,EAASkB,WAAWD,IACxEE,EAAoBF,GAC/Bd,EAAUH,EAASmB,iBAAiBF,IACzBG,EAAiBH,GAC5Bd,EAAUH,EAASoB,cAAcH,IACtBI,EAAgBJ,GAA4Bd,EAAUH,EAASqB,aAAaJ,IAiB5EK,EAA8B,IACzCC,EAAQ,IAAMvB,EAAU"}
@@ -1,7 +1,8 @@
1
- import type { SignupPasswordMembers, SignupPasswordOptions, FederatedSignupOptions } from '@auth0/auth0-acul-js/signup-password';
1
+ import type { SignupPasswordMembers, SignupPasswordOptions, FederatedSignupOptions, SwitchConnectionOptions } from '@auth0/auth0-acul-js/signup-password';
2
2
  export declare const useUser: () => import("@auth0/auth0-acul-js").UserMembers, useTenant: () => import("@auth0/auth0-acul-js").TenantMembers, useBranding: () => import("@auth0/auth0-acul-js").BrandingMembers, useClient: () => import("@auth0/auth0-acul-js").ClientMembers, useOrganization: () => import("@auth0/auth0-acul-js").OrganizationMembers, usePrompt: () => import("@auth0/auth0-acul-js").PromptMembers, useScreen: () => import("@auth0/auth0-acul-js").ScreenMembersOnSignupPassword, useTransaction: () => import("@auth0/auth0-acul-js").TransactionMembersOnSignupPassword, useUntrustedData: () => import("@auth0/auth0-acul-js").UntrustedDataMembers;
3
3
  export declare const signup: (payload: SignupPasswordOptions) => void | Promise<void>;
4
4
  export declare const federatedSignup: (payload: FederatedSignupOptions) => void | Promise<void>;
5
+ export declare const switchConnection: (payload: SwitchConnectionOptions) => void | Promise<void>;
5
6
  export { usePasswordValidation } from '../hooks/utility/validate-password';
6
7
  export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
7
8
  export declare const useSignupPassword: () => SignupPasswordMembers;
@@ -1,2 +1,2 @@
1
- import o from"@auth0/auth0-acul-js/signup-password";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as s}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as e}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";export{usePasswordValidation}from"../hooks/utility/validate-password.js";const n=t(o),{withError:m}=s,u=new e(n),{useUser:a,useTenant:i,useBranding:p,useClient:c,useOrganization:h,usePrompt:d,useScreen:f,useTransaction:j,useUntrustedData:x}=u,k=o=>m(n.signup(o)),g=o=>m(n.federatedSignup(o)),l=()=>r(()=>n,[]);export{g as federatedSignup,k as signup,p as useBranding,c as useClient,h as useOrganization,d as usePrompt,f as useScreen,l as useSignupPassword,i as useTenant,j as useTransaction,x as useUntrustedData,a as useUser};
1
+ import o from"@auth0/auth0-acul-js/signup-password";import{useMemo as r}from"react";export{useAuth0Themes}from"../hooks/common/auth0-themes.js";export{useCurrentScreen}from"../hooks/common/current-screen.js";import{errorManager as s}from"../hooks/common/errors.js";export{useErrors}from"../hooks/common/errors.js";import{ContextHooks as e}from"../hooks/context/index.js";import{registerScreen as t}from"../state/instance-store.js";export{usePasswordValidation}from"../hooks/utility/validate-password.js";const n=t(o),{withError:m}=s,u=new e(n),{useUser:a,useTenant:i,useBranding:c,useClient:p,useOrganization:h,usePrompt:d,useScreen:f,useTransaction:j,useUntrustedData:x}=u,k=o=>m(n.signup(o)),w=o=>m(n.federatedSignup(o)),g=o=>m(n.switchConnection(o)),l=()=>r(()=>n,[]);export{w as federatedSignup,k as signup,g as switchConnection,c as useBranding,p as useClient,h as useOrganization,d as usePrompt,f as useScreen,l as useSignupPassword,i as useTenant,j as useTransaction,x as useUntrustedData,a as useUser};
2
2
  //# sourceMappingURL=signup-password.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"signup-password.js","sources":["../../src/screens/signup-password.tsx"],"sourcesContent":["import SignupPassword from '@auth0/auth0-acul-js/signup-password';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n SignupPasswordMembers,\n SignupPasswordOptions,\n FederatedSignupOptions,\n} from '@auth0/auth0-acul-js/signup-password';\n\n// Register the singleton instance of SignupPassword\nconst instance = registerScreen<SignupPasswordMembers>(SignupPassword)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<SignupPasswordMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const signup = (payload: SignupPasswordOptions) => withError(instance.signup(payload));\nexport const federatedSignup = (payload: FederatedSignupOptions) =>\n withError(instance.federatedSignup(payload));\n\n// Utility Hooks\nexport { usePasswordValidation } from '../hooks/utility/validate-password';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of SignupPassword\nexport const useSignupPassword = (): SignupPasswordMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","SignupPassword","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","signup","payload","federatedSignup","useSignupPassword","useMemo"],"mappings":"wfAcA,MAAMA,EAAWC,EAAsCC,IAGjDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAoCN,IAC3CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAUC,GAAmCd,EAAUH,EAASgB,OAAOC,IACvEC,EAAmBD,GAC9Bd,EAAUH,EAASkB,gBAAgBD,IAiBxBE,EAAoB,IAA6BC,EAAQ,IAAMpB,EAAU"}
1
+ {"version":3,"file":"signup-password.js","sources":["../../src/screens/signup-password.tsx"],"sourcesContent":["import SignupPassword from '@auth0/auth0-acul-js/signup-password';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n SignupPasswordMembers,\n SignupPasswordOptions,\n FederatedSignupOptions,\n SwitchConnectionOptions,\n} from '@auth0/auth0-acul-js/signup-password';\n\n// Register the singleton instance of SignupPassword\nconst instance = registerScreen<SignupPasswordMembers>(SignupPassword)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<SignupPasswordMembers>(instance);\nexport const {\n useUser,\n useTenant,\n useBranding,\n useClient,\n useOrganization,\n usePrompt,\n useScreen,\n useTransaction,\n useUntrustedData,\n} = factory;\n\n// Submit functions\nexport const signup = (payload: SignupPasswordOptions) => withError(instance.signup(payload));\nexport const federatedSignup = (payload: FederatedSignupOptions) =>\n withError(instance.federatedSignup(payload));\nexport const switchConnection = (payload: SwitchConnectionOptions) =>\n withError(instance.switchConnection(payload));\n\n// Utility Hooks\nexport { usePasswordValidation } from '../hooks/utility/validate-password';\n\n// Common hooks\nexport {\n useCurrentScreen,\n useErrors,\n useAuth0Themes,\n type UseErrorOptions,\n type UseErrorsResult,\n type ErrorsResult,\n type ErrorKind,\n} from '../hooks';\n\n// Main instance hook. Returns singleton instance of SignupPassword\nexport const useSignupPassword = (): SignupPasswordMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","SignupPassword","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","signup","payload","federatedSignup","switchConnection","useSignupPassword","useMemo"],"mappings":"wfAeA,MAAMA,EAAWC,EAAsCC,IAGjDC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAAoCN,IAC3CO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAUC,GAAmCd,EAAUH,EAASgB,OAAOC,IACvEC,EAAmBD,GAC9Bd,EAAUH,EAASkB,gBAAgBD,IACxBE,EAAoBF,GAC/Bd,EAAUH,EAASmB,iBAAiBF,IAiBzBG,EAAoB,IAA6BC,EAAQ,IAAMrB,EAAU"}
@@ -4,12 +4,12 @@ export interface ErrorItem extends Auth0Error {
4
4
  label?: string;
5
5
  kind?: ErrorKind;
6
6
  }
7
- export type ErrorKind = 'server' | 'client' | 'developer';
7
+ export type ErrorKind = 'auth0' | 'validation' | 'configuration';
8
8
  export declare const ERROR_KINDS: ErrorKind[];
9
9
  type Bucket = {
10
- server: ReadonlyArray<ErrorItem>;
11
- client: ReadonlyArray<ErrorItem>;
12
- developer: ReadonlyArray<ErrorItem>;
10
+ auth0: ReadonlyArray<ErrorItem>;
11
+ validation: ReadonlyArray<ErrorItem>;
12
+ configuration: ReadonlyArray<ErrorItem>;
13
13
  };
14
14
  type Listener = () => void;
15
15
  /**
@@ -1,2 +1,2 @@
1
- const e=["server","client","developer"];function t(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r].id!==t[r].id)return!1;return!0}const r=Object.freeze({server:Object.freeze([]),client:Object.freeze([]),developer:Object.freeze([])});let s=0;const i=new class{constructor(){this.bucket=r,this.listeners=new Set}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}snapshot(){return this.bucket}normalize(e){return Object.freeze(e.map(e=>Object.freeze({...e,id:e.id??`${Date.now()}-${s++}`})))}replace(e,r){const s=this.normalize(r);t(this.bucket[e],s)||(this.bucket=Object.freeze({...this.bucket,[e]:s}),this.notify())}replacePartial(e,r,s){const i=this.normalize(r),c=this.bucket[e].filter(e=>e.field!==s),n=Object.freeze([...c,...i]);t(this.bucket[e],n)||(this.bucket=Object.freeze({...this.bucket,[e]:n}),this.notify())}push(e,t){const r=Array.isArray(t)?t:[t];if(0===r.length)return;const s=Object.freeze([...this.bucket[e],...this.normalize(r)]);this.bucket=Object.freeze({...this.bucket,[e]:s}),this.notify()}clear(t=e){let r=!1;const s={...this.bucket};for(const e of t)this.bucket[e].length>0&&(s[e]=Object.freeze([]),r=!0);r&&(this.bucket=Object.freeze(s),this.notify())}remove(t=e,r){const s="string"==typeof r?e=>e.id===r:r;let i=!1;const c={...this.bucket};for(const e of t){const t=this.bucket[e].filter(e=>!s(e));t.length!==this.bucket[e].length&&(c[e]=Object.freeze(t),i=!0)}i&&(this.bucket=Object.freeze(c),this.notify())}notify(){for(const e of this.listeners)e()}};export{e as ERROR_KINDS,i as errorStore};
1
+ const e=["auth0","validation","configuration"];function t(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i].id!==t[i].id)return!1;return!0}const i=Object.freeze({auth0:Object.freeze([]),validation:Object.freeze([]),configuration:Object.freeze([])});let s=0;const r=new class{constructor(){this.bucket=i,this.listeners=new Set}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}snapshot(){return this.bucket}normalize(e){return Object.freeze(e.map(e=>Object.freeze({...e,id:e.id??`${Date.now()}-${s++}`})))}replace(e,i){const s=this.normalize(i);t(this.bucket[e],s)||(this.bucket=Object.freeze({...this.bucket,[e]:s}),this.notify())}replacePartial(e,i,s){const r=this.normalize(i),c=this.bucket[e].filter(e=>e.field!==s),n=Object.freeze([...c,...r]);t(this.bucket[e],n)||(this.bucket=Object.freeze({...this.bucket,[e]:n}),this.notify())}push(e,t){const i=Array.isArray(t)?t:[t];if(0===i.length)return;const s=Object.freeze([...this.bucket[e],...this.normalize(i)]);this.bucket=Object.freeze({...this.bucket,[e]:s}),this.notify()}clear(t=e){let i=!1;const s={...this.bucket};for(const e of t)this.bucket[e].length>0&&(s[e]=Object.freeze([]),i=!0);i&&(this.bucket=Object.freeze(s),this.notify())}remove(t=e,i){const s="string"==typeof i?e=>e.id===i:i;let r=!1;const c={...this.bucket};for(const e of t){const t=this.bucket[e].filter(e=>!s(e));t.length!==this.bucket[e].length&&(c[e]=Object.freeze(t),r=!0)}r&&(this.bucket=Object.freeze(c),this.notify())}notify(){for(const e of this.listeners)e()}};export{e as ERROR_KINDS,r as errorStore};
2
2
  //# sourceMappingURL=error-store.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-store.js","sources":["../../src/state/error-store.ts"],"sourcesContent":["import type { Error as Auth0Error } from '@auth0/auth0-acul-js';\n\nexport interface ErrorItem extends Auth0Error {\n id: string;\n label?: string;\n kind?: ErrorKind;\n}\n\nexport type ErrorKind = 'server' | 'client' | 'developer';\n\nexport const ERROR_KINDS: ErrorKind[] = ['server', 'client', 'developer'];\n\ntype Bucket = {\n server: ReadonlyArray<ErrorItem>;\n client: ReadonlyArray<ErrorItem>;\n developer: ReadonlyArray<ErrorItem>;\n};\n\ntype Listener = () => void;\n\n/** Compare two error lists by id only for maximal speed. */\nfunction listsEqual(a: ReadonlyArray<ErrorItem>, b: ReadonlyArray<ErrorItem>) {\n if (a === b) return true;\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i].id !== b[i].id) return false;\n }\n return true;\n}\n\nconst EMPTY_BUCKET: Bucket = Object.freeze({\n server: Object.freeze([]),\n client: Object.freeze([]),\n developer: Object.freeze([]),\n});\n\nlet nextId = 0;\nconst genId = () => `${Date.now()}-${nextId++}`;\n\n/**\n * Global error store for ACUL (one screen per page).\n * - Holds a single bucket of errors across the current page.\n * - Generates stable ids for every inserted error.\n * - Emits immutable snapshots to subscribers.\n */\nclass ErrorStore {\n private bucket: Bucket = EMPTY_BUCKET;\n private listeners: Set<Listener> = new Set();\n\n subscribe(cb: Listener): () => void {\n this.listeners.add(cb);\n return () => this.listeners.delete(cb);\n }\n\n snapshot(): Readonly<Bucket> {\n return this.bucket;\n }\n\n /** Add ids and freeze an array of ErrorItem-like objects. */\n private normalize(\n list: Array<Omit<ErrorItem, 'id'> & { id?: string }>\n ): ReadonlyArray<ErrorItem> {\n return Object.freeze(\n list.map((e) =>\n Object.freeze({\n ...e,\n id: e.id ?? genId(),\n })\n )\n );\n }\n\n /** Replace an entire kind with a new list (generating ids if needed). */\n replace(kind: ErrorKind, list: Array<Omit<ErrorItem, 'id'> | ErrorItem>) {\n const nextList = this.normalize(list);\n if (listsEqual(this.bucket[kind], nextList)) return;\n\n this.bucket = Object.freeze({\n ...this.bucket,\n [kind]: nextList,\n });\n this.notify();\n }\n\n /**\n * Replace only errors for a specific field within a kind.\n * - Keeps all existing errors for other fields.\n * - Normalizes incoming errors and replaces matching field ones.\n */\n replacePartial(kind: ErrorKind, list: Array<Omit<ErrorItem, 'id'> | ErrorItem>, field: string) {\n const incoming = this.normalize(list);\n const existing = this.bucket[kind].filter((e) => e.field !== field);\n const nextKindList = Object.freeze([...existing, ...incoming]);\n\n if (listsEqual(this.bucket[kind], nextKindList)) return;\n\n this.bucket = Object.freeze({\n ...this.bucket,\n [kind]: nextKindList,\n });\n this.notify();\n }\n\n /** Append one or more items to a kind. */\n push(\n kind: ErrorKind,\n list: Omit<ErrorItem, 'id'> | ErrorItem | Array<Omit<ErrorItem, 'id'> | ErrorItem>\n ) {\n const arr = Array.isArray(list) ? list : [list];\n if (arr.length === 0) return;\n\n const nextKindList = Object.freeze([...this.bucket[kind], ...this.normalize(arr)]);\n this.bucket = Object.freeze({\n ...this.bucket,\n [kind]: nextKindList,\n });\n this.notify();\n }\n\n /** Clear one or more kinds (default: all kinds). */\n clear(kinds: ErrorKind[] = ERROR_KINDS) {\n let changed = false;\n const next: Bucket = { ...this.bucket };\n\n for (const k of kinds) {\n if (this.bucket[k].length > 0) {\n next[k] = Object.freeze([]);\n changed = true;\n }\n }\n\n if (!changed) return;\n this.bucket = Object.freeze(next);\n this.notify();\n }\n\n /**\n * Remove errors that match a given id or predicate from specified kinds.\n */\n remove(kinds: ErrorKind[] = ERROR_KINDS, test: string | ((e: ErrorItem) => boolean)) {\n const isMatch = typeof test === 'string' ? (e: ErrorItem) => e.id === test : test;\n\n let changed = false;\n const next: Bucket = { ...this.bucket };\n\n for (const k of kinds) {\n const filtered = this.bucket[k].filter((e) => !isMatch(e));\n if (filtered.length !== this.bucket[k].length) {\n next[k] = Object.freeze(filtered);\n changed = true;\n }\n }\n\n if (!changed) return;\n this.bucket = Object.freeze(next);\n this.notify();\n }\n\n private notify() {\n for (const cb of this.listeners) cb();\n }\n}\n\nexport const errorStore = new ErrorStore();\n"],"names":["ERROR_KINDS","listsEqual","a","b","length","i","id","EMPTY_BUCKET","Object","freeze","server","client","developer","nextId","errorStore","constructor","this","bucket","listeners","Set","subscribe","cb","add","delete","snapshot","normalize","list","map","e","Date","now","replace","kind","nextList","notify","replacePartial","field","incoming","existing","filter","nextKindList","push","arr","Array","isArray","clear","kinds","changed","next","k","remove","test","isMatch","filtered"],"mappings":"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"}
1
+ {"version":3,"file":"error-store.js","sources":["../../src/state/error-store.ts"],"sourcesContent":["import type { Error as Auth0Error } from '@auth0/auth0-acul-js';\n\nexport interface ErrorItem extends Auth0Error {\n id: string;\n label?: string;\n kind?: ErrorKind;\n}\n\nexport type ErrorKind = 'auth0' | 'validation' | 'configuration';\n\nexport const ERROR_KINDS: ErrorKind[] = ['auth0', 'validation', 'configuration'];\n\ntype Bucket = {\n auth0: ReadonlyArray<ErrorItem>;\n validation: ReadonlyArray<ErrorItem>;\n configuration: ReadonlyArray<ErrorItem>;\n};\n\ntype Listener = () => void;\n\n/** Compare two error lists by id only for maximal speed. */\nfunction listsEqual(a: ReadonlyArray<ErrorItem>, b: ReadonlyArray<ErrorItem>) {\n if (a === b) return true;\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i].id !== b[i].id) return false;\n }\n return true;\n}\n\nconst EMPTY_BUCKET: Bucket = Object.freeze({\n auth0: Object.freeze([]),\n validation: Object.freeze([]),\n configuration: Object.freeze([]),\n});\n\nlet nextId = 0;\nconst genId = () => `${Date.now()}-${nextId++}`;\n\n/**\n * Global error store for ACUL (one screen per page).\n * - Holds a single bucket of errors across the current page.\n * - Generates stable ids for every inserted error.\n * - Emits immutable snapshots to subscribers.\n */\nclass ErrorStore {\n private bucket: Bucket = EMPTY_BUCKET;\n private listeners: Set<Listener> = new Set();\n\n subscribe(cb: Listener): () => void {\n this.listeners.add(cb);\n return () => this.listeners.delete(cb);\n }\n\n snapshot(): Readonly<Bucket> {\n return this.bucket;\n }\n\n /** Add ids and freeze an array of ErrorItem-like objects. */\n private normalize(\n list: Array<Omit<ErrorItem, 'id'> & { id?: string }>\n ): ReadonlyArray<ErrorItem> {\n return Object.freeze(\n list.map((e) =>\n Object.freeze({\n ...e,\n id: e.id ?? genId(),\n })\n )\n );\n }\n\n /** Replace an entire kind with a new list (generating ids if needed). */\n replace(kind: ErrorKind, list: Array<Omit<ErrorItem, 'id'> | ErrorItem>) {\n const nextList = this.normalize(list);\n if (listsEqual(this.bucket[kind], nextList)) return;\n\n this.bucket = Object.freeze({\n ...this.bucket,\n [kind]: nextList,\n });\n this.notify();\n }\n\n /**\n * Replace only errors for a specific field within a kind.\n * - Keeps all existing errors for other fields.\n * - Normalizes incoming errors and replaces matching field ones.\n */\n replacePartial(kind: ErrorKind, list: Array<Omit<ErrorItem, 'id'> | ErrorItem>, field: string) {\n const incoming = this.normalize(list);\n const existing = this.bucket[kind].filter((e) => e.field !== field);\n const nextKindList = Object.freeze([...existing, ...incoming]);\n\n if (listsEqual(this.bucket[kind], nextKindList)) return;\n\n this.bucket = Object.freeze({\n ...this.bucket,\n [kind]: nextKindList,\n });\n this.notify();\n }\n\n /** Append one or more items to a kind. */\n push(\n kind: ErrorKind,\n list: Omit<ErrorItem, 'id'> | ErrorItem | Array<Omit<ErrorItem, 'id'> | ErrorItem>\n ) {\n const arr = Array.isArray(list) ? list : [list];\n if (arr.length === 0) return;\n\n const nextKindList = Object.freeze([...this.bucket[kind], ...this.normalize(arr)]);\n this.bucket = Object.freeze({\n ...this.bucket,\n [kind]: nextKindList,\n });\n this.notify();\n }\n\n /** Clear one or more kinds (default: all kinds). */\n clear(kinds: ErrorKind[] = ERROR_KINDS) {\n let changed = false;\n const next: Bucket = { ...this.bucket };\n\n for (const k of kinds) {\n if (this.bucket[k].length > 0) {\n next[k] = Object.freeze([]);\n changed = true;\n }\n }\n\n if (!changed) return;\n this.bucket = Object.freeze(next);\n this.notify();\n }\n\n /**\n * Remove errors that match a given id or predicate from specified kinds.\n */\n remove(kinds: ErrorKind[] = ERROR_KINDS, test: string | ((e: ErrorItem) => boolean)) {\n const isMatch = typeof test === 'string' ? (e: ErrorItem) => e.id === test : test;\n\n let changed = false;\n const next: Bucket = { ...this.bucket };\n\n for (const k of kinds) {\n const filtered = this.bucket[k].filter((e) => !isMatch(e));\n if (filtered.length !== this.bucket[k].length) {\n next[k] = Object.freeze(filtered);\n changed = true;\n }\n }\n\n if (!changed) return;\n this.bucket = Object.freeze(next);\n this.notify();\n }\n\n private notify() {\n for (const cb of this.listeners) cb();\n }\n}\n\nexport const errorStore = new ErrorStore();\n"],"names":["ERROR_KINDS","listsEqual","a","b","length","i","id","EMPTY_BUCKET","Object","freeze","auth0","validation","configuration","nextId","errorStore","constructor","this","bucket","listeners","Set","subscribe","cb","add","delete","snapshot","normalize","list","map","e","Date","now","replace","kind","nextList","notify","replacePartial","field","incoming","existing","filter","nextKindList","push","arr","Array","isArray","clear","kinds","changed","next","k","remove","test","isMatch","filtered"],"mappings":"AAUO,MAAMA,EAA2B,CAAC,QAAS,aAAc,iBAWhE,SAASC,EAAWC,EAA6BC,GAC/C,GAAID,IAAMC,EAAG,OAAO,EACpB,GAAID,EAAEE,SAAWD,EAAEC,OAAQ,OAAO,EAClC,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAEE,OAAQC,IAC5B,GAAIH,EAAEG,GAAGC,KAAOH,EAAEE,GAAGC,GAAI,OAAO,EAElC,OAAO,CACT,CAEA,MAAMC,EAAuBC,OAAOC,OAAO,CACzCC,MAAOF,OAAOC,OAAO,IACrBE,WAAYH,OAAOC,OAAO,IAC1BG,cAAeJ,OAAOC,OAAO,MAG/B,IAAII,EAAS,EA+HN,MAAMC,EAAa,IAtH1B,MAAA,WAAAC,GACUC,KAAAC,OAAiBV,EACjBS,KAAAE,UAA2B,IAAIC,GAkHzC,CAhHE,SAAAC,CAAUC,GAER,OADAL,KAAKE,UAAUI,IAAID,GACZ,IAAML,KAAKE,UAAUK,OAAOF,EACrC,CAEA,QAAAG,GACE,OAAOR,KAAKC,MACd,CAGQ,SAAAQ,CACNC,GAEA,OAAOlB,OAAOC,OACZiB,EAAKC,IAAKC,GACRpB,OAAOC,OAAO,IACTmB,EACHtB,GAAIsB,EAAEtB,IA7BI,GAAGuB,KAAKC,SAASjB,SAiCnC,CAGA,OAAAkB,CAAQC,EAAiBN,GACvB,MAAMO,EAAWjB,KAAKS,UAAUC,GAC5BzB,EAAWe,KAAKC,OAAOe,GAAOC,KAElCjB,KAAKC,OAAST,OAAOC,OAAO,IACvBO,KAAKC,OACRe,CAACA,GAAOC,IAEVjB,KAAKkB,SACP,CAOA,cAAAC,CAAeH,EAAiBN,EAAgDU,GAC9E,MAAMC,EAAWrB,KAAKS,UAAUC,GAC1BY,EAAWtB,KAAKC,OAAOe,GAAMO,OAAQX,GAAMA,EAAEQ,QAAUA,GACvDI,EAAehC,OAAOC,OAAO,IAAI6B,KAAaD,IAEhDpC,EAAWe,KAAKC,OAAOe,GAAOQ,KAElCxB,KAAKC,OAAST,OAAOC,OAAO,IACvBO,KAAKC,OACRe,CAACA,GAAOQ,IAEVxB,KAAKkB,SACP,CAGA,IAAAO,CACET,EACAN,GAEA,MAAMgB,EAAMC,MAAMC,QAAQlB,GAAQA,EAAO,CAACA,GAC1C,GAAmB,IAAfgB,EAAItC,OAAc,OAEtB,MAAMoC,EAAehC,OAAOC,OAAO,IAAIO,KAAKC,OAAOe,MAAUhB,KAAKS,UAAUiB,KAC5E1B,KAAKC,OAAST,OAAOC,OAAO,IACvBO,KAAKC,OACRe,CAACA,GAAOQ,IAEVxB,KAAKkB,QACP,CAGA,KAAAW,CAAMC,EAAqB9C,GACzB,IAAI+C,GAAU,EACd,MAAMC,EAAe,IAAKhC,KAAKC,QAE/B,IAAK,MAAMgC,KAAKH,EACV9B,KAAKC,OAAOgC,GAAG7C,OAAS,IAC1B4C,EAAKC,GAAKzC,OAAOC,OAAO,IACxBsC,GAAU,GAITA,IACL/B,KAAKC,OAAST,OAAOC,OAAOuC,GAC5BhC,KAAKkB,SACP,CAKA,MAAAgB,CAAOJ,EAAqB9C,EAAamD,GACvC,MAAMC,EAA0B,iBAATD,EAAqBvB,GAAiBA,EAAEtB,KAAO6C,EAAOA,EAE7E,IAAIJ,GAAU,EACd,MAAMC,EAAe,IAAKhC,KAAKC,QAE/B,IAAK,MAAMgC,KAAKH,EAAO,CACrB,MAAMO,EAAWrC,KAAKC,OAAOgC,GAAGV,OAAQX,IAAOwB,EAAQxB,IACnDyB,EAASjD,SAAWY,KAAKC,OAAOgC,GAAG7C,SACrC4C,EAAKC,GAAKzC,OAAOC,OAAO4C,GACxBN,GAAU,EAEd,CAEKA,IACL/B,KAAKC,OAAST,OAAOC,OAAOuC,GAC5BhC,KAAKkB,SACP,CAEQ,MAAAA,GACN,IAAK,MAAMb,KAAML,KAAKE,UAAWG,GACnC"}
package/dist/telemetry.js CHANGED
@@ -1,2 +1,2 @@
1
- globalThis.__ACUL_SDK_NAME__="@auth0/auth0-acul-react",globalThis.__ACUL_SDK_VERSION__="1.0.0-alpha.1";
1
+ globalThis.__ACUL_SDK_NAME__="@auth0/auth0-acul-react",globalThis.__ACUL_SDK_VERSION__="1.0.0-alpha.2";
2
2
  //# sourceMappingURL=telemetry.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auth0/auth0-acul-react",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.2",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
@@ -14,7 +14,8 @@
14
14
  "lint": "eslint src --ext .ts,.tsx",
15
15
  "lint:fix": "eslint src --ext .ts,.tsx --fix",
16
16
  "docs": "typedoc --options typedoc.js",
17
- "postbuild": "npm run docs"
17
+ "postbuild": "npm run docs",
18
+ "build:local": "NODE_ENV=production rollup -c rollup.config.mjs"
18
19
  },
19
20
  "author": "Auth0",
20
21
  "license": "MIT",
@@ -49,7 +50,7 @@
49
50
  "ts-node": "^10.9.2"
50
51
  },
51
52
  "dependencies": {
52
- "@auth0/auth0-acul-js": "1.0.0-alpha.1"
53
+ "@auth0/auth0-acul-js": "1.0.0-alpha.2"
53
54
  },
54
55
  "files": [
55
56
  "dist",