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

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 (164) hide show
  1. package/README.md +77 -77
  2. package/dist/export/getting-started.d.ts +1 -1
  3. package/dist/hooks/common/errors.d.ts +12 -12
  4. package/dist/hooks/common/errors.js +1 -1
  5. package/dist/hooks/common/errors.js.map +1 -1
  6. package/dist/hooks/index.d.ts +1 -1
  7. package/dist/screens/accept-invitation.d.ts +1 -1
  8. package/dist/screens/accept-invitation.js.map +1 -1
  9. package/dist/screens/consent.d.ts +1 -1
  10. package/dist/screens/consent.js.map +1 -1
  11. package/dist/screens/customized-consent.d.ts +1 -1
  12. package/dist/screens/customized-consent.js.map +1 -1
  13. package/dist/screens/device-code-activation-allowed.d.ts +1 -1
  14. package/dist/screens/device-code-activation-allowed.js.map +1 -1
  15. package/dist/screens/device-code-activation-denied.d.ts +1 -1
  16. package/dist/screens/device-code-activation-denied.js.map +1 -1
  17. package/dist/screens/device-code-activation.d.ts +1 -1
  18. package/dist/screens/device-code-activation.js.map +1 -1
  19. package/dist/screens/device-code-confirmation.d.ts +1 -1
  20. package/dist/screens/device-code-confirmation.js.map +1 -1
  21. package/dist/screens/email-identifier-challenge.d.ts +1 -1
  22. package/dist/screens/email-identifier-challenge.js.map +1 -1
  23. package/dist/screens/email-otp-challenge.d.ts +1 -1
  24. package/dist/screens/email-otp-challenge.js.map +1 -1
  25. package/dist/screens/email-verification-result.d.ts +1 -1
  26. package/dist/screens/email-verification-result.js.map +1 -1
  27. package/dist/screens/interstitial-captcha.d.ts +1 -1
  28. package/dist/screens/interstitial-captcha.js.map +1 -1
  29. package/dist/screens/login-email-verification.d.ts +1 -1
  30. package/dist/screens/login-email-verification.js.map +1 -1
  31. package/dist/screens/login-id.d.ts +1 -1
  32. package/dist/screens/login-id.js.map +1 -1
  33. package/dist/screens/login-password.d.ts +1 -1
  34. package/dist/screens/login-password.js.map +1 -1
  35. package/dist/screens/login-passwordless-email-code.d.ts +1 -1
  36. package/dist/screens/login-passwordless-email-code.js.map +1 -1
  37. package/dist/screens/login-passwordless-sms-otp.d.ts +1 -1
  38. package/dist/screens/login-passwordless-sms-otp.js.map +1 -1
  39. package/dist/screens/login.d.ts +1 -1
  40. package/dist/screens/login.js.map +1 -1
  41. package/dist/screens/logout-aborted.d.ts +1 -1
  42. package/dist/screens/logout-aborted.js.map +1 -1
  43. package/dist/screens/logout-complete.d.ts +1 -1
  44. package/dist/screens/logout-complete.js.map +1 -1
  45. package/dist/screens/logout.d.ts +1 -1
  46. package/dist/screens/logout.js.map +1 -1
  47. package/dist/screens/mfa-begin-enroll-options.d.ts +1 -1
  48. package/dist/screens/mfa-begin-enroll-options.js.map +1 -1
  49. package/dist/screens/mfa-country-codes.d.ts +1 -1
  50. package/dist/screens/mfa-country-codes.js.map +1 -1
  51. package/dist/screens/mfa-detect-browser-capabilities.d.ts +1 -1
  52. package/dist/screens/mfa-detect-browser-capabilities.js.map +1 -1
  53. package/dist/screens/mfa-email-challenge.d.ts +1 -1
  54. package/dist/screens/mfa-email-challenge.js.map +1 -1
  55. package/dist/screens/mfa-email-list.d.ts +1 -1
  56. package/dist/screens/mfa-email-list.js.map +1 -1
  57. package/dist/screens/mfa-enroll-result.d.ts +1 -1
  58. package/dist/screens/mfa-enroll-result.js.map +1 -1
  59. package/dist/screens/mfa-login-options.d.ts +1 -1
  60. package/dist/screens/mfa-login-options.js.map +1 -1
  61. package/dist/screens/mfa-otp-challenge.d.ts +1 -1
  62. package/dist/screens/mfa-otp-challenge.js.map +1 -1
  63. package/dist/screens/mfa-otp-enrollment-code.d.ts +1 -1
  64. package/dist/screens/mfa-otp-enrollment-code.js.map +1 -1
  65. package/dist/screens/mfa-otp-enrollment-qr.d.ts +1 -1
  66. package/dist/screens/mfa-otp-enrollment-qr.js.map +1 -1
  67. package/dist/screens/mfa-phone-challenge.d.ts +1 -1
  68. package/dist/screens/mfa-phone-challenge.js.map +1 -1
  69. package/dist/screens/mfa-phone-enrollment.d.ts +1 -1
  70. package/dist/screens/mfa-phone-enrollment.js.map +1 -1
  71. package/dist/screens/mfa-push-challenge-push.d.ts +1 -1
  72. package/dist/screens/mfa-push-challenge-push.js.map +1 -1
  73. package/dist/screens/mfa-push-enrollment-qr.d.ts +3 -2
  74. package/dist/screens/mfa-push-enrollment-qr.js +1 -1
  75. package/dist/screens/mfa-push-enrollment-qr.js.map +1 -1
  76. package/dist/screens/mfa-push-list.d.ts +1 -1
  77. package/dist/screens/mfa-push-list.js.map +1 -1
  78. package/dist/screens/mfa-push-welcome.d.ts +1 -1
  79. package/dist/screens/mfa-push-welcome.js.map +1 -1
  80. package/dist/screens/mfa-recovery-code-challenge-new-code.d.ts +1 -1
  81. package/dist/screens/mfa-recovery-code-challenge-new-code.js.map +1 -1
  82. package/dist/screens/mfa-recovery-code-challenge.d.ts +1 -1
  83. package/dist/screens/mfa-recovery-code-challenge.js.map +1 -1
  84. package/dist/screens/mfa-recovery-code-enrollment.d.ts +1 -1
  85. package/dist/screens/mfa-recovery-code-enrollment.js.map +1 -1
  86. package/dist/screens/mfa-sms-challenge.d.ts +1 -1
  87. package/dist/screens/mfa-sms-challenge.js.map +1 -1
  88. package/dist/screens/mfa-sms-enrollment.d.ts +1 -1
  89. package/dist/screens/mfa-sms-enrollment.js.map +1 -1
  90. package/dist/screens/mfa-sms-list.d.ts +1 -1
  91. package/dist/screens/mfa-sms-list.js.map +1 -1
  92. package/dist/screens/mfa-voice-challenge.d.ts +1 -1
  93. package/dist/screens/mfa-voice-challenge.js.map +1 -1
  94. package/dist/screens/mfa-voice-enrollment.d.ts +1 -1
  95. package/dist/screens/mfa-voice-enrollment.js.map +1 -1
  96. package/dist/screens/mfa-webauthn-change-key-nickname.d.ts +1 -1
  97. package/dist/screens/mfa-webauthn-change-key-nickname.js.map +1 -1
  98. package/dist/screens/mfa-webauthn-enrollment-success.d.ts +1 -1
  99. package/dist/screens/mfa-webauthn-enrollment-success.js.map +1 -1
  100. package/dist/screens/mfa-webauthn-error.d.ts +1 -1
  101. package/dist/screens/mfa-webauthn-error.js.map +1 -1
  102. package/dist/screens/mfa-webauthn-not-available-error.d.ts +1 -1
  103. package/dist/screens/mfa-webauthn-not-available-error.js.map +1 -1
  104. package/dist/screens/mfa-webauthn-platform-challenge.d.ts +1 -1
  105. package/dist/screens/mfa-webauthn-platform-challenge.js.map +1 -1
  106. package/dist/screens/mfa-webauthn-platform-enrollment.d.ts +1 -1
  107. package/dist/screens/mfa-webauthn-platform-enrollment.js.map +1 -1
  108. package/dist/screens/mfa-webauthn-roaming-challenge.d.ts +1 -1
  109. package/dist/screens/mfa-webauthn-roaming-challenge.js.map +1 -1
  110. package/dist/screens/mfa-webauthn-roaming-enrollment.d.ts +1 -1
  111. package/dist/screens/mfa-webauthn-roaming-enrollment.js.map +1 -1
  112. package/dist/screens/organization-picker.d.ts +1 -1
  113. package/dist/screens/organization-picker.js.map +1 -1
  114. package/dist/screens/organization-selection.d.ts +1 -1
  115. package/dist/screens/organization-selection.js.map +1 -1
  116. package/dist/screens/passkey-enrollment-local.d.ts +1 -1
  117. package/dist/screens/passkey-enrollment-local.js.map +1 -1
  118. package/dist/screens/passkey-enrollment.d.ts +1 -1
  119. package/dist/screens/passkey-enrollment.js.map +1 -1
  120. package/dist/screens/phone-identifier-challenge.d.ts +1 -1
  121. package/dist/screens/phone-identifier-challenge.js.map +1 -1
  122. package/dist/screens/phone-identifier-enrollment.d.ts +1 -1
  123. package/dist/screens/phone-identifier-enrollment.js.map +1 -1
  124. package/dist/screens/redeem-ticket.d.ts +1 -1
  125. package/dist/screens/redeem-ticket.js.map +1 -1
  126. package/dist/screens/reset-password-email.d.ts +1 -1
  127. package/dist/screens/reset-password-email.js.map +1 -1
  128. package/dist/screens/reset-password-error.d.ts +1 -1
  129. package/dist/screens/reset-password-error.js.map +1 -1
  130. package/dist/screens/reset-password-mfa-email-challenge.d.ts +1 -1
  131. package/dist/screens/reset-password-mfa-email-challenge.js.map +1 -1
  132. package/dist/screens/reset-password-mfa-otp-challenge.d.ts +1 -1
  133. package/dist/screens/reset-password-mfa-otp-challenge.js.map +1 -1
  134. package/dist/screens/reset-password-mfa-phone-challenge.d.ts +1 -1
  135. package/dist/screens/reset-password-mfa-phone-challenge.js.map +1 -1
  136. package/dist/screens/reset-password-mfa-push-challenge-push.d.ts +1 -1
  137. package/dist/screens/reset-password-mfa-push-challenge-push.js.map +1 -1
  138. package/dist/screens/reset-password-mfa-recovery-code-challenge.d.ts +1 -1
  139. package/dist/screens/reset-password-mfa-recovery-code-challenge.js.map +1 -1
  140. package/dist/screens/reset-password-mfa-sms-challenge.d.ts +1 -1
  141. package/dist/screens/reset-password-mfa-sms-challenge.js.map +1 -1
  142. package/dist/screens/reset-password-mfa-voice-challenge.d.ts +1 -1
  143. package/dist/screens/reset-password-mfa-voice-challenge.js.map +1 -1
  144. package/dist/screens/reset-password-mfa-webauthn-platform-challenge.d.ts +1 -1
  145. package/dist/screens/reset-password-mfa-webauthn-platform-challenge.js.map +1 -1
  146. package/dist/screens/reset-password-mfa-webauthn-roaming-challenge.d.ts +1 -1
  147. package/dist/screens/reset-password-mfa-webauthn-roaming-challenge.js.map +1 -1
  148. package/dist/screens/reset-password-request.d.ts +1 -1
  149. package/dist/screens/reset-password-request.js.map +1 -1
  150. package/dist/screens/reset-password-success.d.ts +1 -1
  151. package/dist/screens/reset-password-success.js.map +1 -1
  152. package/dist/screens/reset-password.d.ts +1 -1
  153. package/dist/screens/reset-password.js.map +1 -1
  154. package/dist/screens/signup-id.d.ts +1 -1
  155. package/dist/screens/signup-id.js.map +1 -1
  156. package/dist/screens/signup-password.d.ts +1 -1
  157. package/dist/screens/signup-password.js.map +1 -1
  158. package/dist/screens/signup.d.ts +1 -1
  159. package/dist/screens/signup.js.map +1 -1
  160. package/dist/state/error-store.d.ts +11 -11
  161. package/dist/state/error-store.js +1 -1
  162. package/dist/state/error-store.js.map +1 -1
  163. package/dist/telemetry.js +1 -1
  164. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"reset-password-success.js","sources":["../../src/screens/reset-password-success.tsx"],"sourcesContent":["import ResetPasswordSuccess from '@auth0/auth0-acul-js/reset-password-success';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type { ResetPasswordSuccessMembers } from '@auth0/auth0-acul-js/reset-password-success';\n\n// Register the singleton instance of ResetPasswordSuccess\nconst instance = registerScreen<ResetPasswordSuccessMembers>(ResetPasswordSuccess)!;\n\n// Context hooks\nconst factory = new ContextHooks<ResetPasswordSuccessMembers>(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// 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 ResetPasswordSuccess\nexport const useResetPasswordSuccess = (): ResetPasswordSuccessMembers =>\n useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","ResetPasswordSuccess","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","useResetPasswordSuccess","useMemo"],"mappings":"6XASA,MAAMA,EAAWC,EAA4CC,GAGvDC,EAAU,IAAIC,EAA0CJ,IACjDK,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAcSW,EAA0B,IACrCC,EAAQ,IAAMf,EAAU"}
1
+ {"version":3,"file":"reset-password-success.js","sources":["../../src/screens/reset-password-success.tsx"],"sourcesContent":["import ResetPasswordSuccess from '@auth0/auth0-acul-js/reset-password-success';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type { ResetPasswordSuccessMembers } from '@auth0/auth0-acul-js/reset-password-success';\n\n// Register the singleton instance of ResetPasswordSuccess\nconst instance = registerScreen<ResetPasswordSuccessMembers>(ResetPasswordSuccess)!;\n\n// Context hooks\nconst factory = new ContextHooks<ResetPasswordSuccessMembers>(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// Common hooks\nexport { useCurrentScreen, useErrors, useAuth0Themes } from '../hooks';\n\n// Main instance hook. Returns singleton instance of ResetPasswordSuccess\nexport const useResetPasswordSuccess = (): ResetPasswordSuccessMembers =>\n useMemo(() => instance, []);\n"],"names":["instance","registerScreen","ResetPasswordSuccess","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","useResetPasswordSuccess","useMemo"],"mappings":"6XASA,MAAMA,EAAWC,EAA4CC,GAGvDC,EAAU,IAAIC,EAA0CJ,IACjDK,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAMSW,EAA0B,IACrCC,EAAQ,IAAMf,EAAU"}
@@ -2,5 +2,5 @@ import type { ResetPasswordMembers, ResetPasswordOptions } from '@auth0/auth0-ac
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").ScreenMembersOnResetPassword, useTransaction: () => import("@auth0/auth0-acul-js").TransactionMembersOnResetPassword, useUntrustedData: () => import("@auth0/auth0-acul-js").UntrustedDataMembers;
3
3
  export declare const resetPassword: (payload: ResetPasswordOptions) => void | Promise<void>;
4
4
  export { usePasswordValidation } from '../hooks/utility/validate-password';
5
- export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
5
+ export { useCurrentScreen, useErrors, useAuth0Themes } from '../hooks';
6
6
  export declare const useResetPassword: () => ResetPasswordMembers;
@@ -1 +1 @@
1
- {"version":3,"file":"reset-password.js","sources":["../../src/screens/reset-password.tsx"],"sourcesContent":["import ResetPassword from '@auth0/auth0-acul-js/reset-password';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n ResetPasswordMembers,\n ResetPasswordOptions,\n} from '@auth0/auth0-acul-js/reset-password';\n\n// Register the singleton instance of ResetPassword\nconst instance = registerScreen<ResetPasswordMembers>(ResetPassword)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<ResetPasswordMembers>(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 resetPassword = (payload: ResetPasswordOptions) =>\n withError(instance.resetPassword(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 ResetPassword\nexport const useResetPassword = (): ResetPasswordMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","ResetPassword","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","resetPassword","payload","useResetPassword","useMemo"],"mappings":"ufAaA,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,EAAiBC,GAC5Bd,EAAUH,EAASgB,cAAcC,IAiBtBC,EAAmB,IAA4BC,EAAQ,IAAMnB,EAAU"}
1
+ {"version":3,"file":"reset-password.js","sources":["../../src/screens/reset-password.tsx"],"sourcesContent":["import ResetPassword from '@auth0/auth0-acul-js/reset-password';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n ResetPasswordMembers,\n ResetPasswordOptions,\n} from '@auth0/auth0-acul-js/reset-password';\n\n// Register the singleton instance of ResetPassword\nconst instance = registerScreen<ResetPasswordMembers>(ResetPassword)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<ResetPasswordMembers>(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 resetPassword = (payload: ResetPasswordOptions) =>\n withError(instance.resetPassword(payload));\n\n// Utility Hooks\nexport { usePasswordValidation } from '../hooks/utility/validate-password';\n\n// Common hooks\nexport { useCurrentScreen, useErrors, useAuth0Themes } from '../hooks';\n\n// Main instance hook. Returns singleton instance of ResetPassword\nexport const useResetPassword = (): ResetPasswordMembers => useMemo(() => instance, []);\n"],"names":["instance","registerScreen","ResetPassword","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","resetPassword","payload","useResetPassword","useMemo"],"mappings":"ufAaA,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,EAAiBC,GAC5Bd,EAAUH,EAASgB,cAAcC,IAStBC,EAAmB,IAA4BC,EAAQ,IAAMnB,EAAU"}
@@ -5,5 +5,5 @@ export declare const federatedSignup: (payload: FederatedSignupOptions) => void
5
5
  export declare const pickCountryCode: (payload?: CustomOptions) => void | Promise<void>;
6
6
  export { useSignupIdentifiers } from '../hooks/utility/signup-identifiers';
7
7
  export { useUsernameValidation } from '../hooks/utility/validate-username';
8
- export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
8
+ export { useCurrentScreen, useErrors, useAuth0Themes } from '../hooks';
9
9
  export declare const useSignupId: () => SignupIdMembers;
@@ -1 +1 @@
1
- {"version":3,"file":"signup-id.js","sources":["../../src/screens/signup-id.tsx"],"sourcesContent":["import SignupId from '@auth0/auth0-acul-js/signup-id';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n SignupIdMembers,\n SignupOptions,\n FederatedSignupOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/signup-id';\n\n// Register the singleton instance of SignupId\nconst instance = registerScreen<SignupIdMembers>(SignupId)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<SignupIdMembers>(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: SignupOptions) => withError(instance.signup(payload));\nexport const federatedSignup = (payload: FederatedSignupOptions) =>\n withError(instance.federatedSignup(payload));\nexport const pickCountryCode = (payload?: CustomOptions) =>\n withError(instance.pickCountryCode(payload));\n\n// Utility Hooks\nexport { useSignupIdentifiers } from '../hooks/utility/signup-identifiers';\n\n// Utility Hooks\nexport { useUsernameValidation } from '../hooks/utility/validate-username';\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 SignupId\nexport const useSignupId = (): SignupIdMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","SignupId","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","signup","payload","federatedSignup","pickCountryCode","useSignupId","useMemo"],"mappings":"2jBAeA,MAAMA,EAAWC,EAAgCC,IAG3CC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAA8BN,IACrCO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAUC,GAA2Bd,EAAUH,EAASgB,OAAOC,IAC/DC,EAAmBD,GAC9Bd,EAAUH,EAASkB,gBAAgBD,IACxBE,EAAmBF,GAC9Bd,EAAUH,EAASmB,gBAAgBF,IAoBxBG,EAAc,IAAuBC,EAAQ,IAAMrB,EAAU"}
1
+ {"version":3,"file":"signup-id.js","sources":["../../src/screens/signup-id.tsx"],"sourcesContent":["import SignupId from '@auth0/auth0-acul-js/signup-id';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n SignupIdMembers,\n SignupOptions,\n FederatedSignupOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/signup-id';\n\n// Register the singleton instance of SignupId\nconst instance = registerScreen<SignupIdMembers>(SignupId)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<SignupIdMembers>(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: SignupOptions) => withError(instance.signup(payload));\nexport const federatedSignup = (payload: FederatedSignupOptions) =>\n withError(instance.federatedSignup(payload));\nexport const pickCountryCode = (payload?: CustomOptions) =>\n withError(instance.pickCountryCode(payload));\n\n// Utility Hooks\nexport { useSignupIdentifiers } from '../hooks/utility/signup-identifiers';\n\n// Utility Hooks\nexport { useUsernameValidation } from '../hooks/utility/validate-username';\n\n// Common hooks\nexport { useCurrentScreen, useErrors, useAuth0Themes } from '../hooks';\n\n// Main instance hook. Returns singleton instance of SignupId\nexport const useSignupId = (): SignupIdMembers => useMemo(() => instance, []);\n"],"names":["instance","registerScreen","SignupId","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","signup","payload","federatedSignup","pickCountryCode","useSignupId","useMemo"],"mappings":"2jBAeA,MAAMA,EAAWC,EAAgCC,IAG3CC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAA8BN,IACrCO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAUC,GAA2Bd,EAAUH,EAASgB,OAAOC,IAC/DC,EAAmBD,GAC9Bd,EAAUH,EAASkB,gBAAgBD,IACxBE,EAAmBF,GAC9Bd,EAAUH,EAASmB,gBAAgBF,IAYxBG,EAAc,IAAuBC,EAAQ,IAAMrB,EAAU"}
@@ -4,5 +4,5 @@ export declare const signup: (payload: SignupPasswordOptions) => void | Promise<
4
4
  export declare const federatedSignup: (payload: FederatedSignupOptions) => void | Promise<void>;
5
5
  export declare const switchConnection: (payload: SwitchConnectionOptions) => void | Promise<void>;
6
6
  export { usePasswordValidation } from '../hooks/utility/validate-password';
7
- export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
7
+ export { useCurrentScreen, useErrors, useAuth0Themes } from '../hooks';
8
8
  export declare const useSignupPassword: () => SignupPasswordMembers;
@@ -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 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"}
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 { useCurrentScreen, useErrors, useAuth0Themes } from '../hooks';\n\n// Main instance hook. Returns singleton instance of SignupPassword\nexport const useSignupPassword = (): SignupPasswordMembers => useMemo(() => instance, []);\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,IASzBG,EAAoB,IAA6BC,EAAQ,IAAMrB,EAAU"}
@@ -6,5 +6,5 @@ export declare const pickCountryCode: (payload?: CustomOptions) => void | Promis
6
6
  export { usePasswordValidation } from '../hooks/utility/validate-password';
7
7
  export { useSignupIdentifiers } from '../hooks/utility/signup-identifiers';
8
8
  export { useUsernameValidation } from '../hooks/utility/validate-username';
9
- export { useCurrentScreen, useErrors, useAuth0Themes, type UseErrorOptions, type UseErrorsResult, type ErrorsResult, type ErrorKind, } from '../hooks';
9
+ export { useCurrentScreen, useErrors, useAuth0Themes } from '../hooks';
10
10
  export declare const useSignup: () => SignupMembers;
@@ -1 +1 @@
1
- {"version":3,"file":"signup.js","sources":["../../src/screens/signup.tsx"],"sourcesContent":["import Signup from '@auth0/auth0-acul-js/signup';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n SignupMembers,\n SignupOptions,\n FederatedSignupOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/signup';\n\n// Register the singleton instance of Signup\nconst instance = registerScreen<SignupMembers>(Signup)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<SignupMembers>(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: SignupOptions) => withError(instance.signup(payload));\nexport const federatedSignup = (payload: FederatedSignupOptions) =>\n withError(instance.federatedSignup(payload));\nexport const pickCountryCode = (payload?: CustomOptions) =>\n withError(instance.pickCountryCode(payload));\n\n// Utility Hooks\nexport { usePasswordValidation } from '../hooks/utility/validate-password';\n\n// Utility Hooks\nexport { useSignupIdentifiers } from '../hooks/utility/signup-identifiers';\n\n// Utility Hooks\nexport { useUsernameValidation } from '../hooks/utility/validate-username';\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 Signup\nexport const useSignup = (): SignupMembers => useMemo(() => instance, []);\n\n// Export all types from the core SDK for this screen\n"],"names":["instance","registerScreen","Signup","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","signup","payload","federatedSignup","pickCountryCode","useSignup","useMemo"],"mappings":"ioBAeA,MAAMA,EAAWC,EAA8BC,IAGzCC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAA4BN,IACnCO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAUC,GAA2Bd,EAAUH,EAASgB,OAAOC,IAC/DC,EAAmBD,GAC9Bd,EAAUH,EAASkB,gBAAgBD,IACxBE,EAAmBF,GAC9Bd,EAAUH,EAASmB,gBAAgBF,IAuBxBG,EAAY,IAAqBC,EAAQ,IAAMrB,EAAU"}
1
+ {"version":3,"file":"signup.js","sources":["../../src/screens/signup.tsx"],"sourcesContent":["import Signup from '@auth0/auth0-acul-js/signup';\nimport { useMemo } from 'react';\n\nimport { ContextHooks } from '../hooks';\nimport { errorManager } from '../hooks';\nimport { registerScreen } from '../state/instance-store';\n\nimport type {\n SignupMembers,\n SignupOptions,\n FederatedSignupOptions,\n CustomOptions,\n} from '@auth0/auth0-acul-js/signup';\n\n// Register the singleton instance of Signup\nconst instance = registerScreen<SignupMembers>(Signup)!;\n\n// Error wrapper\nconst { withError } = errorManager;\n\n// Context hooks\nconst factory = new ContextHooks<SignupMembers>(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: SignupOptions) => withError(instance.signup(payload));\nexport const federatedSignup = (payload: FederatedSignupOptions) =>\n withError(instance.federatedSignup(payload));\nexport const pickCountryCode = (payload?: CustomOptions) =>\n withError(instance.pickCountryCode(payload));\n\n// Utility Hooks\nexport { usePasswordValidation } from '../hooks/utility/validate-password';\n\n// Utility Hooks\nexport { useSignupIdentifiers } from '../hooks/utility/signup-identifiers';\n\n// Utility Hooks\nexport { useUsernameValidation } from '../hooks/utility/validate-username';\n\n// Common hooks\nexport { useCurrentScreen, useErrors, useAuth0Themes } from '../hooks';\n\n// Main instance hook. Returns singleton instance of Signup\nexport const useSignup = (): SignupMembers => useMemo(() => instance, []);\n"],"names":["instance","registerScreen","Signup","withError","errorManager","factory","ContextHooks","useUser","useTenant","useBranding","useClient","useOrganization","usePrompt","useScreen","useTransaction","useUntrustedData","signup","payload","federatedSignup","pickCountryCode","useSignup","useMemo"],"mappings":"ioBAeA,MAAMA,EAAWC,EAA8BC,IAGzCC,UAAEA,GAAcC,EAGhBC,EAAU,IAAIC,EAA4BN,IACnCO,QACXA,EAAOC,UACPA,EAASC,YACTA,EAAWC,UACXA,EAASC,gBACTA,EAAeC,UACfA,EAASC,UACTA,EAASC,eACTA,EAAcC,iBACdA,GACEV,EAGSW,EAAUC,GAA2Bd,EAAUH,EAASgB,OAAOC,IAC/DC,EAAmBD,GAC9Bd,EAAUH,EAASkB,gBAAgBD,IACxBE,EAAmBF,GAC9Bd,EAAUH,EAASmB,gBAAgBF,IAexBG,EAAY,IAAqBC,EAAQ,IAAMrB,EAAU"}
@@ -2,10 +2,10 @@ import type { Error as Auth0Error } from '@auth0/auth0-acul-js';
2
2
  export interface ErrorItem extends Auth0Error {
3
3
  id: string;
4
4
  label?: string;
5
- kind?: ErrorKind;
5
+ type?: ErrorType;
6
6
  }
7
- export type ErrorKind = 'auth0' | 'validation' | 'configuration';
8
- export declare const ERROR_KINDS: ErrorKind[];
7
+ export type ErrorType = 'auth0' | 'validation' | 'configuration';
8
+ export declare const ERROR_TYPES: ErrorType[];
9
9
  type Bucket = {
10
10
  auth0: ReadonlyArray<ErrorItem>;
11
11
  validation: ReadonlyArray<ErrorItem>;
@@ -25,22 +25,22 @@ declare class ErrorStore {
25
25
  snapshot(): Readonly<Bucket>;
26
26
  /** Add ids and freeze an array of ErrorItem-like objects. */
27
27
  private normalize;
28
- /** Replace an entire kind with a new list (generating ids if needed). */
29
- replace(kind: ErrorKind, list: Array<Omit<ErrorItem, 'id'> | ErrorItem>): void;
28
+ /** Replace an entire type with a new list (generating ids if needed). */
29
+ replace(type: ErrorType, list: Array<Omit<ErrorItem, 'id'> | ErrorItem>): void;
30
30
  /**
31
- * Replace only errors for a specific field within a kind.
31
+ * Replace only errors for a specific field within a type.
32
32
  * - Keeps all existing errors for other fields.
33
33
  * - Normalizes incoming errors and replaces matching field ones.
34
34
  */
35
- replacePartial(kind: ErrorKind, list: Array<Omit<ErrorItem, 'id'> | ErrorItem>, field: string): void;
36
- /** Append one or more items to a kind. */
37
- push(kind: ErrorKind, list: Omit<ErrorItem, 'id'> | ErrorItem | Array<Omit<ErrorItem, 'id'> | ErrorItem>): void;
35
+ replacePartial(type: ErrorType, list: Array<Omit<ErrorItem, 'id'> | ErrorItem>, field: string): void;
36
+ /** Append one or more items to a type. */
37
+ push(type: ErrorType, list: Omit<ErrorItem, 'id'> | ErrorItem | Array<Omit<ErrorItem, 'id'> | ErrorItem>): void;
38
38
  /** Clear one or more kinds (default: all kinds). */
39
- clear(kinds?: ErrorKind[]): void;
39
+ clear(kinds?: ErrorType[]): void;
40
40
  /**
41
41
  * Remove errors that match a given id or predicate from specified kinds.
42
42
  */
43
- remove(kinds: ErrorKind[] | undefined, test: string | ((e: ErrorItem) => boolean)): void;
43
+ remove(kinds: ErrorType[] | undefined, test: string | ((e: ErrorItem) => boolean)): void;
44
44
  private notify;
45
45
  }
46
46
  export declare const errorStore: ErrorStore;
@@ -1,2 +1,2 @@
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};
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_TYPES,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 = '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":"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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 type?: ErrorType;\n}\n\nexport type ErrorType = 'auth0' | 'validation' | 'configuration';\n\nexport const ERROR_TYPES: ErrorType[] = ['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 type with a new list (generating ids if needed). */\n replace(type: ErrorType, list: Array<Omit<ErrorItem, 'id'> | ErrorItem>) {\n const nextList = this.normalize(list);\n if (listsEqual(this.bucket[type], nextList)) return;\n\n this.bucket = Object.freeze({\n ...this.bucket,\n [type]: nextList,\n });\n this.notify();\n }\n\n /**\n * Replace only errors for a specific field within a type.\n * - Keeps all existing errors for other fields.\n * - Normalizes incoming errors and replaces matching field ones.\n */\n replacePartial(type: ErrorType, list: Array<Omit<ErrorItem, 'id'> | ErrorItem>, field: string) {\n const incoming = this.normalize(list);\n const existing = this.bucket[type].filter((e) => e.field !== field);\n const nextKindList = Object.freeze([...existing, ...incoming]);\n\n if (listsEqual(this.bucket[type], nextKindList)) return;\n\n this.bucket = Object.freeze({\n ...this.bucket,\n [type]: nextKindList,\n });\n this.notify();\n }\n\n /** Append one or more items to a type. */\n push(\n type: ErrorType,\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[type], ...this.normalize(arr)]);\n this.bucket = Object.freeze({\n ...this.bucket,\n [type]: nextKindList,\n });\n this.notify();\n }\n\n /** Clear one or more kinds (default: all kinds). */\n clear(kinds: ErrorType[] = ERROR_TYPES) {\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: ErrorType[] = ERROR_TYPES, 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_TYPES","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","type","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.2";
1
+ globalThis.__ACUL_SDK_NAME__="@auth0/auth0-acul-react",globalThis.__ACUL_SDK_VERSION__="1.0.0-alpha.3";
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.2",
3
+ "version": "1.0.0-alpha.3",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
@@ -50,7 +50,7 @@
50
50
  "ts-node": "^10.9.2"
51
51
  },
52
52
  "dependencies": {
53
- "@auth0/auth0-acul-js": "1.0.0-alpha.2"
53
+ "@auth0/auth0-acul-js": "1.0.0-alpha.3"
54
54
  },
55
55
  "files": [
56
56
  "dist",