@dropins/storefront-auth 2.1.0 → 2.2.0-alpha001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/getCustomerRolePermissions/getCustomerRolePermissions.d.ts +24 -0
- package/api/getCustomerRolePermissions/graphql/getCustomerRolePermissions.graphql.d.ts +2 -0
- package/api/getCustomerRolePermissions/index.d.ts +10 -0
- package/api/index.d.ts +1 -0
- package/api.js +34 -1
- package/api.js.map +1 -1
- package/chunks/Button.js.map +1 -1
- package/chunks/Button2.js.map +1 -1
- package/chunks/ResetPasswordForm.js.map +1 -1
- package/chunks/SignInForm.js.map +1 -1
- package/chunks/SignUpForm.js.map +1 -1
- package/chunks/SkeletonLoader.js.map +1 -1
- package/chunks/acdl.js.map +1 -1
- package/chunks/confirmEmail.js.map +1 -1
- package/chunks/createCustomerAddress.js.map +1 -1
- package/chunks/focusOnEmptyPasswordField.js.map +1 -1
- package/chunks/getCustomerToken.js +3 -3
- package/chunks/getCustomerToken.js.map +1 -1
- package/chunks/initialize.js.map +1 -1
- package/chunks/network-error.js +1 -1
- package/chunks/network-error.js.map +1 -1
- package/chunks/requestPasswordResetEmail.js.map +1 -1
- package/chunks/resendConfirmationEmail.js.map +1 -1
- package/chunks/resetPassword.js.map +1 -1
- package/chunks/revokeCustomerToken.js.map +1 -1
- package/chunks/setReCaptchaToken.js +1 -1
- package/chunks/setReCaptchaToken.js.map +1 -1
- package/chunks/simplifyTransformAttributesForm.js.map +1 -1
- package/chunks/transform-attributes-form.js.map +1 -1
- package/chunks/usePasswordValidationMessage.js.map +1 -1
- package/chunks/verifyToken.js +1 -1
- package/chunks/verifyToken.js.map +1 -1
- package/containers/AuthCombine.js.map +1 -1
- package/containers/ResetPassword.js.map +1 -1
- package/containers/SignIn.js.map +1 -1
- package/containers/SignUp.js.map +1 -1
- package/containers/SuccessNotification.js.map +1 -1
- package/containers/UpdatePassword.js.map +1 -1
- package/fragments.js.map +1 -1
- package/package.json +1 -1
- package/render.js.map +1 -1
package/containers/SignIn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignIn.js","sources":["/@dropins/storefront-auth/src/containers/SignIn/SignIn.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { SignInForm } from '@/auth/components';\nimport { SignInProps } from '@/auth/types';\n\nexport const SignIn: Container<SignInProps> = ({\n slots,\n labels,\n enableEmailConfirmation,\n initialEmailValue,\n formSize,\n renderSignUpLink,\n hideCloseBtnOnEmailConfirmation,\n routeRedirectOnEmailConfirmationClose,\n routeRedirectOnSignIn,\n routeForgotPassword,\n routeSignUp,\n onSuccessCallback,\n onErrorCallback,\n onSignUpLinkClick,\n}) => {\n return (\n <div className=\"auth-sign-in\">\n <SignInForm\n slots={slots}\n labels={labels}\n formSize={formSize}\n renderSignUpLink={renderSignUpLink}\n initialEmailValue={initialEmailValue}\n enableEmailConfirmation={enableEmailConfirmation}\n hideCloseBtnOnEmailConfirmation={hideCloseBtnOnEmailConfirmation}\n routeRedirectOnEmailConfirmationClose={\n routeRedirectOnEmailConfirmationClose\n }\n routeSignUp={routeSignUp}\n onErrorCallback={onErrorCallback}\n onSuccessCallback={onSuccessCallback}\n onSignUpLinkClick={onSignUpLinkClick}\n routeForgotPassword={routeForgotPassword}\n routeRedirectOnSignIn={routeRedirectOnSignIn}\n />\n </div>\n );\n};\n"],"names":["SignIn","slots","labels","enableEmailConfirmation","initialEmailValue","formSize","renderSignUpLink","hideCloseBtnOnEmailConfirmation","routeRedirectOnEmailConfirmationClose","routeRedirectOnSignIn","routeForgotPassword","routeSignUp","onSuccessCallback","onErrorCallback","onSignUpLinkClick","jsx","SignInForm"],"mappings":"s4BAqBO,MAAMA,EAAiC,CAAC,CAC7C,MAAAC,EACA,OAAAC,EACA,wBAAAC,EACA,kBAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,gCAAAC,EACA,sCAAAC,EACA,sBAAAC,EACA,oBAAAC,EACA,YAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,kBAAAC,CACF,IAEIC,EAAC,
|
|
1
|
+
{"version":3,"file":"SignIn.js","sources":["/@dropins/storefront-auth/src/containers/SignIn/SignIn.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { SignInForm } from '@/auth/components';\nimport { SignInProps } from '@/auth/types';\n\nexport const SignIn: Container<SignInProps> = ({\n slots,\n labels,\n enableEmailConfirmation,\n initialEmailValue,\n formSize,\n renderSignUpLink,\n hideCloseBtnOnEmailConfirmation,\n routeRedirectOnEmailConfirmationClose,\n routeRedirectOnSignIn,\n routeForgotPassword,\n routeSignUp,\n onSuccessCallback,\n onErrorCallback,\n onSignUpLinkClick,\n}) => {\n return (\n <div className=\"auth-sign-in\">\n <SignInForm\n slots={slots}\n labels={labels}\n formSize={formSize}\n renderSignUpLink={renderSignUpLink}\n initialEmailValue={initialEmailValue}\n enableEmailConfirmation={enableEmailConfirmation}\n hideCloseBtnOnEmailConfirmation={hideCloseBtnOnEmailConfirmation}\n routeRedirectOnEmailConfirmationClose={\n routeRedirectOnEmailConfirmationClose\n }\n routeSignUp={routeSignUp}\n onErrorCallback={onErrorCallback}\n onSuccessCallback={onSuccessCallback}\n onSignUpLinkClick={onSignUpLinkClick}\n routeForgotPassword={routeForgotPassword}\n routeRedirectOnSignIn={routeRedirectOnSignIn}\n />\n </div>\n );\n};\n"],"names":["SignIn","slots","labels","enableEmailConfirmation","initialEmailValue","formSize","renderSignUpLink","hideCloseBtnOnEmailConfirmation","routeRedirectOnEmailConfirmationClose","routeRedirectOnSignIn","routeForgotPassword","routeSignUp","onSuccessCallback","onErrorCallback","onSignUpLinkClick","jsx","SignInForm"],"mappings":"s4BAqBO,MAAMA,EAAiC,CAAC,CAC7C,MAAAC,EACA,OAAAC,EACA,wBAAAC,EACA,kBAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,gCAAAC,EACA,sCAAAC,EACA,sBAAAC,EACA,oBAAAC,EACA,YAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,kBAAAC,CACF,IAEIC,EAAC,MAAA,CAAI,UAAU,eACb,SAAAA,EAACC,EAAA,CACC,MAAAf,EACA,OAAAC,EACA,SAAAG,EACA,iBAAAC,EACA,kBAAAF,EACA,wBAAAD,EACA,gCAAAI,EACA,sCAAAC,EAGA,YAAAG,EACA,gBAAAE,EACA,kBAAAD,EACA,kBAAAE,EACA,oBAAAJ,EACA,sBAAAD,CAAA,CAAA,EAEJ"}
|
package/containers/SignUp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignUp.js","sources":["/@dropins/storefront-auth/src/containers/SignUp/SignUp.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { SignUpForm } from '@/auth/components';\nimport { SignUpProps } from '@/auth/types';\n\nexport const SignUp: Container<SignUpProps> = ({\n slots,\n formSize,\n apiVersion2,\n addressesData,\n isAutoSignInEnabled,\n requireRetypePassword,\n inputsDefaultValueSet,\n fieldsConfigForApiVersion1,\n hideCloseBtnOnEmailConfirmation,\n routeRedirectOnEmailConfirmationClose,\n routeRedirectOnSignIn,\n onSuccessCallback,\n onErrorCallback,\n routeSignIn,\n}) => {\n return (\n <div className=\"auth-sign-up\">\n <SignUpForm\n requireRetypePassword={requireRetypePassword}\n formSize={formSize}\n apiVersion2={apiVersion2}\n addressesData={addressesData}\n isAutoSignInEnabled={isAutoSignInEnabled}\n inputsDefaultValueSet={inputsDefaultValueSet}\n fieldsConfigForApiVersion1={fieldsConfigForApiVersion1}\n hideCloseBtnOnEmailConfirmation={hideCloseBtnOnEmailConfirmation}\n routeRedirectOnEmailConfirmationClose={\n routeRedirectOnEmailConfirmationClose\n }\n routeRedirectOnSignIn={routeRedirectOnSignIn}\n routeSignIn={routeSignIn}\n slots={slots}\n onErrorCallback={onErrorCallback}\n onSuccessCallback={onSuccessCallback}\n />\n </div>\n );\n};\n"],"names":["SignUp","slots","formSize","apiVersion2","addressesData","isAutoSignInEnabled","requireRetypePassword","inputsDefaultValueSet","fieldsConfigForApiVersion1","hideCloseBtnOnEmailConfirmation","routeRedirectOnEmailConfirmationClose","routeRedirectOnSignIn","onSuccessCallback","onErrorCallback","routeSignIn","jsx","SignUpForm"],"mappings":"q+BAqBO,MAAMA,EAAiC,CAAC,CAC7C,MAAAC,EACA,SAAAC,EACA,YAAAC,EACA,cAAAC,EACA,oBAAAC,EACA,sBAAAC,EACA,sBAAAC,EACA,2BAAAC,EACA,gCAAAC,EACA,sCAAAC,EACA,sBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,YAAAC,CACF,IAEIC,EAAC,
|
|
1
|
+
{"version":3,"file":"SignUp.js","sources":["/@dropins/storefront-auth/src/containers/SignUp/SignUp.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { SignUpForm } from '@/auth/components';\nimport { SignUpProps } from '@/auth/types';\n\nexport const SignUp: Container<SignUpProps> = ({\n slots,\n formSize,\n apiVersion2,\n addressesData,\n isAutoSignInEnabled,\n requireRetypePassword,\n inputsDefaultValueSet,\n fieldsConfigForApiVersion1,\n hideCloseBtnOnEmailConfirmation,\n routeRedirectOnEmailConfirmationClose,\n routeRedirectOnSignIn,\n onSuccessCallback,\n onErrorCallback,\n routeSignIn,\n}) => {\n return (\n <div className=\"auth-sign-up\">\n <SignUpForm\n requireRetypePassword={requireRetypePassword}\n formSize={formSize}\n apiVersion2={apiVersion2}\n addressesData={addressesData}\n isAutoSignInEnabled={isAutoSignInEnabled}\n inputsDefaultValueSet={inputsDefaultValueSet}\n fieldsConfigForApiVersion1={fieldsConfigForApiVersion1}\n hideCloseBtnOnEmailConfirmation={hideCloseBtnOnEmailConfirmation}\n routeRedirectOnEmailConfirmationClose={\n routeRedirectOnEmailConfirmationClose\n }\n routeRedirectOnSignIn={routeRedirectOnSignIn}\n routeSignIn={routeSignIn}\n slots={slots}\n onErrorCallback={onErrorCallback}\n onSuccessCallback={onSuccessCallback}\n />\n </div>\n );\n};\n"],"names":["SignUp","slots","formSize","apiVersion2","addressesData","isAutoSignInEnabled","requireRetypePassword","inputsDefaultValueSet","fieldsConfigForApiVersion1","hideCloseBtnOnEmailConfirmation","routeRedirectOnEmailConfirmationClose","routeRedirectOnSignIn","onSuccessCallback","onErrorCallback","routeSignIn","jsx","SignUpForm"],"mappings":"q+BAqBO,MAAMA,EAAiC,CAAC,CAC7C,MAAAC,EACA,SAAAC,EACA,YAAAC,EACA,cAAAC,EACA,oBAAAC,EACA,sBAAAC,EACA,sBAAAC,EACA,2BAAAC,EACA,gCAAAC,EACA,sCAAAC,EACA,sBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,YAAAC,CACF,IAEIC,EAAC,MAAA,CAAI,UAAU,eACb,SAAAA,EAACC,EAAA,CACC,sBAAAV,EACA,SAAAJ,EACA,YAAAC,EACA,cAAAC,EACA,oBAAAC,EACA,sBAAAE,EACA,2BAAAC,EACA,gCAAAC,EACA,sCAAAC,EAGA,sBAAAC,EACA,YAAAG,EACA,MAAAb,EACA,gBAAAY,EACA,kBAAAD,CAAA,CAAA,EAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuccessNotification.js","sources":["/@dropins/storefront-auth/src/components/SuccessNotificationForm/SuccessNotificationForm.tsx","/@dropins/storefront-auth/src/containers/SuccessNotification/SuccessNotification.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes, Slot } from '@adobe-commerce/elsie/lib';\nimport '@/auth/components/SuccessNotificationForm/SuccessNotificationForm.css';\nimport { Button } from '@adobe-commerce/elsie/components';\nimport { SuccessNotificationFormProps } from '@/auth/types';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { revokeCustomerToken } from '@/auth/api';\n\nexport const SuccessNotificationForm: FunctionComponent<\n SuccessNotificationFormProps & HTMLAttributes<HTMLDivElement>\n> = ({ formSize = 'default', className = '', slots, labels }) => {\n const translations = useText({\n headingText: 'Auth.SuccessNotification.headingText',\n messageText: 'Auth.SuccessNotification.messageText',\n primaryButtonText: 'Auth.SuccessNotification.primaryButtonText',\n secondaryButtonText: 'Auth.SuccessNotification.secondaryButtonText',\n });\n\n return (\n <div\n className={classes([\n 'auth-success-notification-form',\n `auth-success-notification-form--${formSize}`,\n className,\n ])}\n id=\"welcome-message\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-labelledby={labels?.headingText ?? translations.headingText}\n aria-describedby={labels?.messageText ?? translations.messageText}\n tab-index=\"-1\"\n >\n <p\n id=\"welcome-heading\"\n className=\"auth-success-notification-form__title\"\n data-testid=\"notification-title\"\n >\n {labels?.headingText ?? translations.headingText}\n </p>\n <p\n id=\"welcome-details\"\n className=\"auth-success-notification-form__content-text\"\n data-testid=\"notification-content\"\n >\n {labels?.messageText ?? translations.messageText}\n </p>\n {slots?.SuccessNotificationActions ? (\n <Slot\n data-testid=\"successNotificationActions\"\n name=\"SuccessNotificationActions\"\n slot={slots?.SuccessNotificationActions}\n context={{}}\n />\n ) : (\n <>\n <Button\n data-testid=\"primaryButton\"\n type=\"button\"\n className=\"auth-success-notification-form__button auth-success-notification-form__button--top\"\n onClick={() => (window.location.href = '/')}\n >\n {translations.primaryButtonText}\n </Button>\n <Button\n data-testid=\"secondaryButton\"\n type=\"button\"\n variant=\"tertiary\"\n onClick={async () => {\n await revokeCustomerToken();\n window.location.href = '/';\n }}\n >\n {translations.secondaryButtonText}\n </Button>\n </>\n )}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { SuccessNotificationForm } from '@/auth/components';\nimport { SuccessNotificationProps } from '@/auth/types';\n\nexport const SuccessNotification: Container<SuccessNotificationProps> = ({\n formSize = 'default',\n slots,\n className,\n labels,\n}) => {\n return (\n <div className=\"auth-success-notification\">\n <SuccessNotificationForm\n formSize={formSize}\n className={className}\n slots={slots}\n labels={labels}\n />\n </div>\n );\n};\n"],"names":["SuccessNotificationForm","formSize","className","slots","labels","translations","useText","jsxs","classes","jsx","Slot","Fragment","Button","revokeCustomerToken","SuccessNotification"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SuccessNotification.js","sources":["/@dropins/storefront-auth/src/components/SuccessNotificationForm/SuccessNotificationForm.tsx","/@dropins/storefront-auth/src/containers/SuccessNotification/SuccessNotification.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { HTMLAttributes } from 'preact/compat';\nimport { classes, Slot } from '@adobe-commerce/elsie/lib';\nimport '@/auth/components/SuccessNotificationForm/SuccessNotificationForm.css';\nimport { Button } from '@adobe-commerce/elsie/components';\nimport { SuccessNotificationFormProps } from '@/auth/types';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { revokeCustomerToken } from '@/auth/api';\n\nexport const SuccessNotificationForm: FunctionComponent<\n SuccessNotificationFormProps & HTMLAttributes<HTMLDivElement>\n> = ({ formSize = 'default', className = '', slots, labels }) => {\n const translations = useText({\n headingText: 'Auth.SuccessNotification.headingText',\n messageText: 'Auth.SuccessNotification.messageText',\n primaryButtonText: 'Auth.SuccessNotification.primaryButtonText',\n secondaryButtonText: 'Auth.SuccessNotification.secondaryButtonText',\n });\n\n return (\n <div\n className={classes([\n 'auth-success-notification-form',\n `auth-success-notification-form--${formSize}`,\n className,\n ])}\n id=\"welcome-message\"\n role=\"alert\"\n aria-live=\"assertive\"\n aria-labelledby={labels?.headingText ?? translations.headingText}\n aria-describedby={labels?.messageText ?? translations.messageText}\n tab-index=\"-1\"\n >\n <p\n id=\"welcome-heading\"\n className=\"auth-success-notification-form__title\"\n data-testid=\"notification-title\"\n >\n {labels?.headingText ?? translations.headingText}\n </p>\n <p\n id=\"welcome-details\"\n className=\"auth-success-notification-form__content-text\"\n data-testid=\"notification-content\"\n >\n {labels?.messageText ?? translations.messageText}\n </p>\n {slots?.SuccessNotificationActions ? (\n <Slot\n data-testid=\"successNotificationActions\"\n name=\"SuccessNotificationActions\"\n slot={slots?.SuccessNotificationActions}\n context={{}}\n />\n ) : (\n <>\n <Button\n data-testid=\"primaryButton\"\n type=\"button\"\n className=\"auth-success-notification-form__button auth-success-notification-form__button--top\"\n onClick={() => (window.location.href = '/')}\n >\n {translations.primaryButtonText}\n </Button>\n <Button\n data-testid=\"secondaryButton\"\n type=\"button\"\n variant=\"tertiary\"\n onClick={async () => {\n await revokeCustomerToken();\n window.location.href = '/';\n }}\n >\n {translations.secondaryButtonText}\n </Button>\n </>\n )}\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { SuccessNotificationForm } from '@/auth/components';\nimport { SuccessNotificationProps } from '@/auth/types';\n\nexport const SuccessNotification: Container<SuccessNotificationProps> = ({\n formSize = 'default',\n slots,\n className,\n labels,\n}) => {\n return (\n <div className=\"auth-success-notification\">\n <SuccessNotificationForm\n formSize={formSize}\n className={className}\n slots={slots}\n labels={labels}\n />\n </div>\n );\n};\n"],"names":["SuccessNotificationForm","formSize","className","slots","labels","translations","useText","jsxs","classes","jsx","Slot","Fragment","Button","revokeCustomerToken","SuccessNotification"],"mappings":"kmBA0BO,MAAMA,EAET,CAAC,CAAE,SAAAC,EAAW,UAAW,UAAAC,EAAY,GAAI,MAAAC,EAAO,OAAAC,KAAa,CAC/D,MAAMC,EAAeC,EAAQ,CAC3B,YAAa,uCACb,YAAa,uCACb,kBAAmB,6CACnB,oBAAqB,8CAAA,CACtB,EAED,OACEC,EAAC,MAAA,CACC,UAAWC,EAAQ,CACjB,iCACA,mCAAmCP,CAAQ,GAC3CC,CAAA,CACD,EACD,GAAG,kBACH,KAAK,QACL,YAAU,YACV,mBAAiBE,GAAA,YAAAA,EAAQ,cAAeC,EAAa,YACrD,oBAAkBD,GAAA,YAAAA,EAAQ,cAAeC,EAAa,YACtD,YAAU,KAEV,SAAA,CAAAI,EAAC,IAAA,CACC,GAAG,kBACH,UAAU,wCACV,cAAY,qBAEX,UAAAL,GAAA,YAAAA,EAAQ,cAAeC,EAAa,WAAA,CAAA,EAEvCI,EAAC,IAAA,CACC,GAAG,kBACH,UAAU,+CACV,cAAY,uBAEX,UAAAL,GAAA,YAAAA,EAAQ,cAAeC,EAAa,WAAA,CAAA,EAEtCF,GAAA,MAAAA,EAAO,2BACNM,EAACC,EAAA,CACC,cAAY,6BACZ,KAAK,6BACL,KAAMP,GAAA,YAAAA,EAAO,2BACb,QAAS,CAAA,CAAC,CAAA,EAGZI,EAAAI,EAAA,CACE,SAAA,CAAAF,EAACG,EAAA,CACC,cAAY,gBACZ,KAAK,SACL,UAAU,qFACV,QAAS,IAAO,OAAO,SAAS,KAAO,IAEtC,SAAAP,EAAa,iBAAA,CAAA,EAEhBI,EAACG,EAAA,CACC,cAAY,kBACZ,KAAK,SACL,QAAQ,WACR,QAAS,SAAY,CACnB,MAAMC,EAAA,EACN,OAAO,SAAS,KAAO,GACzB,EAEC,SAAAR,EAAa,mBAAA,CAAA,CAChB,CAAA,CACF,CAAA,CAAA,CAAA,CAIR,EC3EaS,EAA2D,CAAC,CACvE,SAAAb,EAAW,UACX,MAAAE,EACA,UAAAD,EACA,OAAAE,CACF,IAEIK,EAAC,MAAA,CAAI,UAAU,4BACb,SAAAA,EAACT,EAAA,CACC,SAAAC,EACA,UAAAC,EACA,MAAAC,EACA,OAAAC,CAAA,CAAA,EAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdatePassword.js","sources":["/@dropins/storefront-auth/src/lib/getUrlParam.ts","/@dropins/storefront-auth/src/hooks/components/useUpdatePasswordForm.tsx","/@dropins/storefront-auth/src/components/UpdatePasswordForm/UpdatePasswordForm.tsx","/@dropins/storefront-auth/src/containers/UpdatePassword/UpdatePassword.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const getUrlParam = (url: string, param: string): string => {\n const result = url\n .split('&')\n .filter((el) => el.includes(param))\n .map((item) => {\n return item.split('=')[1];\n });\n\n return result[0];\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { resetPassword, getCustomerToken } from '@/auth/api';\nimport { getFormValues } from '@/auth/lib/getFormValues';\nimport { getUrlParam } from '@/auth/lib/getUrlParam';\nimport { validationUniqueSymbolsPassword } from '@/auth/lib/validationUniqueSymbolsPassword';\nimport { useCallback, useEffect, useState } from 'preact/hooks';\nimport {\n AdditionalActionsAlertProps,\n UseUpdatePasswordFormProps,\n} from '@/auth/types';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { checkIsFunction } from '@/auth/lib/checkIsFunction';\n\nexport const useUpdatePasswordForm = ({\n isEmailConfirmationRequired,\n signInOnSuccess,\n passwordConfigs,\n routeRedirectOnSignIn,\n routeWrongUrlRedirect,\n onErrorCallback,\n onSuccessCallback,\n handleSetInLineAlertProps,\n routeRedirectOnPasswordUpdate,\n routeSignInPage,\n}: UseUpdatePasswordFormProps) => {\n const translations = useText({\n errorNotification: 'Auth.Notification.errorNotification',\n updatePasswordMessage: 'Auth.Notification.updatePasswordMessage',\n updatePasswordActionMessage:\n 'Auth.Notification.updatePasswordActionMessage',\n customerTokenErrorMessage: 'Auth.Api.customerTokenErrorMessage',\n });\n\n const [isSuccessful, setIsSuccessful] = useState({\n userName: '',\n status: false,\n });\n const [updatePasswordValue, setUpdatePasswordValue] = useState('');\n const [isClickSubmit, setIsClickSubmit] = useState(false);\n const [email, setEmail] = useState('');\n const [token, setToken] = useState('');\n const [isLoading, setIsLoading] = useState(false);\n const [passwordError, setPasswordError] = useState(false);\n const [additionalActionsAlert, setAdditionalActionsAlert] =\n useState<AdditionalActionsAlertProps>([]);\n\n useEffect(() => {\n if (isClickSubmit && !additionalActionsAlert.length) {\n if (updatePasswordValue.length) {\n setPasswordError(false);\n } else {\n setPasswordError(true);\n }\n }\n }, [isClickSubmit, updatePasswordValue, additionalActionsAlert]);\n\n useEffect(() => {\n const { search } = window.location;\n\n if (\n !search.includes('token=') &&\n !search.includes('email=') &&\n checkIsFunction(routeWrongUrlRedirect)\n ) {\n window.location.href = routeWrongUrlRedirect();\n }\n\n const url = decodeURIComponent(search);\n const tokenParam = getUrlParam(url, 'token');\n const emailParam = getUrlParam(url, 'email');\n\n setEmail(emailParam);\n setToken(tokenParam);\n }, [routeWrongUrlRedirect]);\n\n const submitUpdatePassword = useCallback(\n async (event: Event): Promise<void> => {\n event.preventDefault();\n\n setIsLoading(true);\n setAdditionalActionsAlert([]);\n\n const formValues = getFormValues(event.target);\n const validationData = formValues?.password && email && token;\n\n if (!formValues?.password) {\n setPasswordError(true);\n setIsLoading(false);\n }\n\n const requiredCharacterClasses =\n passwordConfigs?.requiredCharacterClasses ?? 0;\n const minLength = passwordConfigs?.minLength ?? 0;\n\n if (\n !validationUniqueSymbolsPassword(\n formValues?.password,\n requiredCharacterClasses\n ) ||\n formValues.password.length < +minLength\n ) {\n setIsClickSubmit(true);\n setIsLoading(false);\n\n return;\n }\n\n if (!validationData) {\n handleSetInLineAlertProps({\n type: 'error',\n text: translations.errorNotification,\n });\n\n setIsLoading(false);\n\n return;\n }\n\n const { message, success } = await resetPassword(\n email,\n token,\n formValues.password\n );\n\n if (success) {\n if (\n isEmailConfirmationRequired ||\n (!isEmailConfirmationRequired && !signInOnSuccess)\n ) {\n onSuccessCallback?.();\n\n if (checkIsFunction(routeRedirectOnPasswordUpdate)) {\n window.location.href = routeRedirectOnPasswordUpdate();\n }\n\n setIsClickSubmit(true);\n setIsLoading(false);\n setPasswordError(false);\n setUpdatePasswordValue('');\n setAdditionalActionsAlert([\n {\n label: translations.updatePasswordActionMessage,\n onClick: () => {\n window.location.href = routeSignInPage?.() as string;\n },\n },\n ]);\n handleSetInLineAlertProps({\n type: 'success',\n text: translations.updatePasswordMessage,\n });\n\n return;\n }\n\n const loginResponse = await getCustomerToken({\n email,\n password: formValues.password,\n handleSetInLineAlertProps,\n onErrorCallback,\n translations,\n });\n\n if (loginResponse?.userName) {\n onSuccessCallback?.(loginResponse?.userName);\n\n if (checkIsFunction(routeRedirectOnSignIn)) {\n window.location.href = routeRedirectOnSignIn();\n } else {\n setIsSuccessful({\n userName: loginResponse?.userName,\n status: true,\n });\n }\n }\n } else {\n handleSetInLineAlertProps({ type: 'error', text: message });\n onErrorCallback?.({ message, success });\n }\n\n setIsLoading(false);\n },\n [\n email,\n token,\n passwordConfigs?.requiredCharacterClasses,\n passwordConfigs?.minLength,\n translations,\n isEmailConfirmationRequired,\n signInOnSuccess,\n routeSignInPage,\n onErrorCallback,\n onSuccessCallback,\n routeRedirectOnSignIn,\n handleSetInLineAlertProps,\n routeRedirectOnPasswordUpdate,\n ]\n );\n\n const handleSetUpdatePasswordValue = useCallback((value: string) => {\n setUpdatePasswordValue(value);\n }, []);\n\n return {\n additionalActionsAlert,\n passwordError,\n isSuccessful,\n updatePasswordValue,\n isClickSubmit,\n isLoading,\n submitUpdatePassword,\n handleSetUpdatePasswordValue,\n setIsClickSubmit,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { classes, Slot } from '@adobe-commerce/elsie/lib';\nimport { useGetStoreConfigs } from '@/auth/hooks/api/useGetStoreConfigs';\nimport { usePasswordValidationMessage } from '@/auth/hooks/components/usePasswordValidationMessage';\nimport { useUpdatePasswordForm } from '@/auth/hooks/components/useUpdatePasswordForm';\nimport { UpdatePasswordFormProps } from '@/auth/types';\nimport { Form, Button } from '@/auth/components';\nimport { useInLineAlert } from '@/auth/hooks/useInLineAlert';\nimport { Header, InLineAlert, InputPassword } from '@adobe-commerce/elsie/components';\nimport '@/auth/components/UpdatePasswordForm/UpdatePasswordForm.css';\nimport { useCustomTranslations } from '@/auth/hooks/useCustomTranslations';\n\nexport const UpdatePasswordForm: FunctionComponent<UpdatePasswordFormProps> = ({\n signInOnSuccess = true,\n formSize = 'default',\n routeRedirectOnSignIn,\n routeWrongUrlRedirect,\n routeSignInPage,\n slots,\n onErrorCallback,\n onSuccessCallback,\n routeRedirectOnPasswordUpdate,\n}) => {\n /**\n * useCustomTranslations is required to support extensibility of error messages.\n * Ensure all error-related translation paths include \".default\"\n * to allow future handling of dynamic or nested error messages.\n */\n const translations = useCustomTranslations({\n title: 'Auth.UpdatePasswordForm.title',\n buttonPrimary: 'Auth.UpdatePasswordForm.buttonPrimary',\n placeholder: 'Auth.InputPassword.placeholder',\n floatingLabel: 'Auth.InputPassword.floatingLabel',\n requiredFieldError: 'Auth.FormText.requiredFieldError.default',\n });\n\n const { passwordConfigs, isEmailConfirmationRequired } = useGetStoreConfigs();\n\n const { inLineAlertProps, handleSetInLineAlertProps } = useInLineAlert();\n\n const {\n additionalActionsAlert,\n passwordError,\n isSuccessful,\n updatePasswordValue,\n isClickSubmit,\n isLoading,\n submitUpdatePassword,\n handleSetUpdatePasswordValue,\n } = useUpdatePasswordForm({\n isEmailConfirmationRequired,\n signInOnSuccess,\n passwordConfigs,\n routeRedirectOnSignIn,\n routeWrongUrlRedirect,\n onErrorCallback,\n onSuccessCallback,\n handleSetInLineAlertProps,\n routeRedirectOnPasswordUpdate,\n routeSignInPage,\n });\n\n const { isValidUniqueSymbols, defaultLengthMessage } =\n usePasswordValidationMessage({\n password: updatePasswordValue,\n isClickSubmit,\n passwordConfigs,\n });\n\n if (isSuccessful.status && slots?.SuccessNotification) {\n return (\n <Slot\n data-testid=\"successNotificationTestId\"\n name=\"SuccessNotification\"\n slot={slots?.SuccessNotification}\n context={{ isSuccessful }}\n />\n );\n }\n\n return (\n <div\n className={classes([\n 'auth-update-password-form',\n `auth-update-password-form--${formSize}`,\n ])}\n >\n <Header\n title={translations.title}\n divider={false}\n className=\"auth-update-password-form__title\"\n />\n <InLineAlert\n className={classes([\n 'auth-update-password-form__notification',\n [\n 'auth-update-password-form__notification--show',\n !!inLineAlertProps?.text,\n ],\n ])}\n variant=\"secondary\"\n heading={inLineAlertProps?.text as string}\n icon={inLineAlertProps.icon}\n additionalActions={additionalActionsAlert}\n />\n <Form\n name=\"updatePassword_form\"\n className=\"auth-update-password-form__form\"\n onSubmit={submitUpdatePassword}\n loading={isLoading}\n fieldsConfig={[]}\n >\n <div style=\"display: none;\">\n <input\n type=\"text\"\n id=\"username\"\n name=\"username\"\n autoComplete=\"username\"\n />\n </div>\n <InputPassword\n defaultValue={updatePasswordValue}\n onValue={handleSetUpdatePasswordValue}\n className=\"auth-update-password-form__form__item\"\n autoComplete={'new-password'}\n name={'password'}\n errorMessage={\n passwordError ||\n isValidUniqueSymbols === 'error' ||\n defaultLengthMessage?.status === 'error'\n ? translations.requiredFieldError\n : undefined\n }\n minLength={passwordConfigs?.minLength}\n uniqueSymbolsStatus={isValidUniqueSymbols}\n validateLengthConfig={defaultLengthMessage}\n requiredCharacterClasses={passwordConfigs?.requiredCharacterClasses}\n placeholder={translations.placeholder}\n floatingLabel={translations.floatingLabel}\n />\n\n <div className=\"auth-update-password-form__button\">\n <Button\n type=\"submit\"\n buttonText={translations.buttonPrimary}\n variant=\"primary\"\n enableLoader={isLoading}\n />\n </div>\n </Form>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { UpdatePasswordForm } from '@/auth/components';\nimport { UpdatePasswordProps } from '@/auth/types';\n\nexport const UpdatePassword: Container<UpdatePasswordProps> = ({\n slots,\n formSize,\n signInOnSuccess,\n routeRedirectOnPasswordUpdate,\n routeRedirectOnSignIn,\n routeSignInPage,\n routeWrongUrlRedirect,\n onErrorCallback,\n onSuccessCallback,\n}) => {\n return (\n <div className=\"auth-update-password\">\n <UpdatePasswordForm\n formSize={formSize}\n signInOnSuccess={signInOnSuccess}\n routeSignInPage={routeSignInPage}\n routeRedirectOnSignIn={routeRedirectOnSignIn}\n routeWrongUrlRedirect={routeWrongUrlRedirect}\n onErrorCallback={onErrorCallback}\n onSuccessCallback={onSuccessCallback}\n slots={slots}\n routeRedirectOnPasswordUpdate={routeRedirectOnPasswordUpdate}\n />\n </div>\n );\n};\n"],"names":["getUrlParam","url","param","el","item","useUpdatePasswordForm","isEmailConfirmationRequired","signInOnSuccess","passwordConfigs","routeRedirectOnSignIn","routeWrongUrlRedirect","onErrorCallback","onSuccessCallback","handleSetInLineAlertProps","routeRedirectOnPasswordUpdate","routeSignInPage","translations","useText","isSuccessful","setIsSuccessful","useState","updatePasswordValue","setUpdatePasswordValue","isClickSubmit","setIsClickSubmit","email","setEmail","token","setToken","isLoading","setIsLoading","passwordError","setPasswordError","additionalActionsAlert","setAdditionalActionsAlert","useEffect","search","checkIsFunction","tokenParam","emailParam","submitUpdatePassword","useCallback","event","formValues","getFormValues","validationData","requiredCharacterClasses","minLength","validationUniqueSymbolsPassword","message","success","resetPassword","loginResponse","getCustomerToken","handleSetUpdatePasswordValue","value","UpdatePasswordForm","formSize","slots","useCustomTranslations","useGetStoreConfigs","inLineAlertProps","useInLineAlert","isValidUniqueSymbols","defaultLengthMessage","usePasswordValidationMessage","jsx","Slot","jsxs","classes","Header","InLineAlert","Form","InputPassword","Button","UpdatePassword"],"mappings":"y9BAiBa,MAAAA,EAAc,CAACC,EAAaC,IACxBD,EACZ,MAAM,GAAG,EACT,OAAQE,GAAOA,EAAG,SAASD,CAAK,CAAC,EACjC,IAAKE,GACGA,EAAK,MAAM,GAAG,EAAE,CAAC,CACzB,EAEW,CAAC,ECIJC,GAAwB,CAAC,CACpC,4BAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,sBAAAC,EACA,sBAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,8BAAAC,EACA,gBAAAC,CACF,IAAkC,CAChC,MAAMC,EAAeC,GAAQ,CAC3B,kBAAmB,sCACnB,sBAAuB,0CACvB,4BACE,gDACF,0BAA2B,oCAAA,CAC5B,EAEK,CAACC,EAAcC,CAAe,EAAIC,EAAS,CAC/C,SAAU,GACV,OAAQ,EAAA,CACT,EACK,CAACC,EAAqBC,CAAsB,EAAIF,EAAS,EAAE,EAC3D,CAACG,EAAeC,CAAgB,EAAIJ,EAAS,EAAK,EAClD,CAACK,EAAOC,CAAQ,EAAIN,EAAS,EAAE,EAC/B,CAACO,EAAOC,CAAQ,EAAIR,EAAS,EAAE,EAC/B,CAACS,EAAWC,CAAY,EAAIV,EAAS,EAAK,EAC1C,CAACW,EAAeC,CAAgB,EAAIZ,EAAS,EAAK,EAClD,CAACa,EAAwBC,CAAyB,EACtDd,EAAsC,CAAA,CAAE,EAE1Ce,EAAU,IAAM,CACVZ,GAAiB,CAACU,EAAuB,SACvCZ,EAAoB,OACtBW,EAAiB,EAAK,EAEtBA,EAAiB,EAAI,EAGxB,EAAA,CAACT,EAAeF,EAAqBY,CAAsB,CAAC,EAE/DE,EAAU,IAAM,CACR,KAAA,CAAE,OAAAC,GAAW,OAAO,SAGxB,CAACA,EAAO,SAAS,Q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AA,CACC,KAAK,OACL,GAAG,WACH,KAAK,WACL,aAAa,UAAA,CAAA,EAEjB,EACAA,EAACO,EAAA,CACC,aAAcpD,EACd,QAASiC,EACT,UAAU,wCACV,aAAc,eACd,KAAM,WACN,aACEvB,GACAgC,IAAyB,UACzBC,GAAA,YAAAA,EAAsB,UAAW,QAC7BhD,EAAa,mBACb,OAEN,UAAWR,GAAA,YAAAA,EAAiB,UAC5B,oBAAqBuD,EACrB,qBAAsBC,EACtB,yBAA0BxD,GAAA,YAAAA,EAAiB,yBAC3C,YAAaQ,EAAa,YAC1B,cAAeA,EAAa,aAAA,CAC9B,EAEAkD,EAAC,MAAI,CAAA,UAAU,oCACb,SAAAA,EAACQ,GAAA,CACC,KAAK,SACL,WAAY1D,EAAa,cACzB,QAAQ,UACR,aAAca,CAAA,CAAA,CAElB,CAAA,CAAA,CAAA,CAAA,CACF,CAAA,CACF,CAEJ,ECpJa8C,GAAiD,CAAC,CAC7D,MAAAjB,EACA,SAAAD,EACA,gBAAAlD,EACA,8BAAAO,EACA,sBAAAL,EACA,gBAAAM,EACA,sBAAAL,EACA,gBAAAC,EACA,kBAAAC,CACF,IAEIsD,EAAC,MAAI,CAAA,UAAU,uBACb,SAAAA,EAACV,GAAA,CACC,SAAAC,EACA,gBAAAlD,EACA,gBAAAQ,EACA,sBAAAN,EACA,sBAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,MAAA8C,EACA,8BAAA5C,CAAA,CAAA,EAEJ"}
|
|
1
|
+
{"version":3,"file":"UpdatePassword.js","sources":["/@dropins/storefront-auth/src/lib/getUrlParam.ts","/@dropins/storefront-auth/src/hooks/components/useUpdatePasswordForm.tsx","/@dropins/storefront-auth/src/components/UpdatePasswordForm/UpdatePasswordForm.tsx","/@dropins/storefront-auth/src/containers/UpdatePassword/UpdatePassword.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const getUrlParam = (url: string, param: string): string => {\n const result = url\n .split('&')\n .filter((el) => el.includes(param))\n .map((item) => {\n return item.split('=')[1];\n });\n\n return result[0];\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { resetPassword, getCustomerToken } from '@/auth/api';\nimport { getFormValues } from '@/auth/lib/getFormValues';\nimport { getUrlParam } from '@/auth/lib/getUrlParam';\nimport { validationUniqueSymbolsPassword } from '@/auth/lib/validationUniqueSymbolsPassword';\nimport { useCallback, useEffect, useState } from 'preact/hooks';\nimport {\n AdditionalActionsAlertProps,\n UseUpdatePasswordFormProps,\n} from '@/auth/types';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { checkIsFunction } from '@/auth/lib/checkIsFunction';\n\nexport const useUpdatePasswordForm = ({\n isEmailConfirmationRequired,\n signInOnSuccess,\n passwordConfigs,\n routeRedirectOnSignIn,\n routeWrongUrlRedirect,\n onErrorCallback,\n onSuccessCallback,\n handleSetInLineAlertProps,\n routeRedirectOnPasswordUpdate,\n routeSignInPage,\n}: UseUpdatePasswordFormProps) => {\n const translations = useText({\n errorNotification: 'Auth.Notification.errorNotification',\n updatePasswordMessage: 'Auth.Notification.updatePasswordMessage',\n updatePasswordActionMessage:\n 'Auth.Notification.updatePasswordActionMessage',\n customerTokenErrorMessage: 'Auth.Api.customerTokenErrorMessage',\n });\n\n const [isSuccessful, setIsSuccessful] = useState({\n userName: '',\n status: false,\n });\n const [updatePasswordValue, setUpdatePasswordValue] = useState('');\n const [isClickSubmit, setIsClickSubmit] = useState(false);\n const [email, setEmail] = useState('');\n const [token, setToken] = useState('');\n const [isLoading, setIsLoading] = useState(false);\n const [passwordError, setPasswordError] = useState(false);\n const [additionalActionsAlert, setAdditionalActionsAlert] =\n useState<AdditionalActionsAlertProps>([]);\n\n useEffect(() => {\n if (isClickSubmit && !additionalActionsAlert.length) {\n if (updatePasswordValue.length) {\n setPasswordError(false);\n } else {\n setPasswordError(true);\n }\n }\n }, [isClickSubmit, updatePasswordValue, additionalActionsAlert]);\n\n useEffect(() => {\n const { search } = window.location;\n\n if (\n !search.includes('token=') &&\n !search.includes('email=') &&\n checkIsFunction(routeWrongUrlRedirect)\n ) {\n window.location.href = routeWrongUrlRedirect();\n }\n\n const url = decodeURIComponent(search);\n const tokenParam = getUrlParam(url, 'token');\n const emailParam = getUrlParam(url, 'email');\n\n setEmail(emailParam);\n setToken(tokenParam);\n }, [routeWrongUrlRedirect]);\n\n const submitUpdatePassword = useCallback(\n async (event: Event): Promise<void> => {\n event.preventDefault();\n\n setIsLoading(true);\n setAdditionalActionsAlert([]);\n\n const formValues = getFormValues(event.target);\n const validationData = formValues?.password && email && token;\n\n if (!formValues?.password) {\n setPasswordError(true);\n setIsLoading(false);\n }\n\n const requiredCharacterClasses =\n passwordConfigs?.requiredCharacterClasses ?? 0;\n const minLength = passwordConfigs?.minLength ?? 0;\n\n if (\n !validationUniqueSymbolsPassword(\n formValues?.password,\n requiredCharacterClasses\n ) ||\n formValues.password.length < +minLength\n ) {\n setIsClickSubmit(true);\n setIsLoading(false);\n\n return;\n }\n\n if (!validationData) {\n handleSetInLineAlertProps({\n type: 'error',\n text: translations.errorNotification,\n });\n\n setIsLoading(false);\n\n return;\n }\n\n const { message, success } = await resetPassword(\n email,\n token,\n formValues.password\n );\n\n if (success) {\n if (\n isEmailConfirmationRequired ||\n (!isEmailConfirmationRequired && !signInOnSuccess)\n ) {\n onSuccessCallback?.();\n\n if (checkIsFunction(routeRedirectOnPasswordUpdate)) {\n window.location.href = routeRedirectOnPasswordUpdate();\n }\n\n setIsClickSubmit(true);\n setIsLoading(false);\n setPasswordError(false);\n setUpdatePasswordValue('');\n setAdditionalActionsAlert([\n {\n label: translations.updatePasswordActionMessage,\n onClick: () => {\n window.location.href = routeSignInPage?.() as string;\n },\n },\n ]);\n handleSetInLineAlertProps({\n type: 'success',\n text: translations.updatePasswordMessage,\n });\n\n return;\n }\n\n const loginResponse = await getCustomerToken({\n email,\n password: formValues.password,\n handleSetInLineAlertProps,\n onErrorCallback,\n translations,\n });\n\n if (loginResponse?.userName) {\n onSuccessCallback?.(loginResponse?.userName);\n\n if (checkIsFunction(routeRedirectOnSignIn)) {\n window.location.href = routeRedirectOnSignIn();\n } else {\n setIsSuccessful({\n userName: loginResponse?.userName,\n status: true,\n });\n }\n }\n } else {\n handleSetInLineAlertProps({ type: 'error', text: message });\n onErrorCallback?.({ message, success });\n }\n\n setIsLoading(false);\n },\n [\n email,\n token,\n passwordConfigs?.requiredCharacterClasses,\n passwordConfigs?.minLength,\n translations,\n isEmailConfirmationRequired,\n signInOnSuccess,\n routeSignInPage,\n onErrorCallback,\n onSuccessCallback,\n routeRedirectOnSignIn,\n handleSetInLineAlertProps,\n routeRedirectOnPasswordUpdate,\n ]\n );\n\n const handleSetUpdatePasswordValue = useCallback((value: string) => {\n setUpdatePasswordValue(value);\n }, []);\n\n return {\n additionalActionsAlert,\n passwordError,\n isSuccessful,\n updatePasswordValue,\n isClickSubmit,\n isLoading,\n submitUpdatePassword,\n handleSetUpdatePasswordValue,\n setIsClickSubmit,\n };\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { classes, Slot } from '@adobe-commerce/elsie/lib';\nimport { useGetStoreConfigs } from '@/auth/hooks/api/useGetStoreConfigs';\nimport { usePasswordValidationMessage } from '@/auth/hooks/components/usePasswordValidationMessage';\nimport { useUpdatePasswordForm } from '@/auth/hooks/components/useUpdatePasswordForm';\nimport { UpdatePasswordFormProps } from '@/auth/types';\nimport { Form, Button } from '@/auth/components';\nimport { useInLineAlert } from '@/auth/hooks/useInLineAlert';\nimport { Header, InLineAlert, InputPassword } from '@adobe-commerce/elsie/components';\nimport '@/auth/components/UpdatePasswordForm/UpdatePasswordForm.css';\nimport { useCustomTranslations } from '@/auth/hooks/useCustomTranslations';\n\nexport const UpdatePasswordForm: FunctionComponent<UpdatePasswordFormProps> = ({\n signInOnSuccess = true,\n formSize = 'default',\n routeRedirectOnSignIn,\n routeWrongUrlRedirect,\n routeSignInPage,\n slots,\n onErrorCallback,\n onSuccessCallback,\n routeRedirectOnPasswordUpdate,\n}) => {\n /**\n * useCustomTranslations is required to support extensibility of error messages.\n * Ensure all error-related translation paths include \".default\"\n * to allow future handling of dynamic or nested error messages.\n */\n const translations = useCustomTranslations({\n title: 'Auth.UpdatePasswordForm.title',\n buttonPrimary: 'Auth.UpdatePasswordForm.buttonPrimary',\n placeholder: 'Auth.InputPassword.placeholder',\n floatingLabel: 'Auth.InputPassword.floatingLabel',\n requiredFieldError: 'Auth.FormText.requiredFieldError.default',\n });\n\n const { passwordConfigs, isEmailConfirmationRequired } = useGetStoreConfigs();\n\n const { inLineAlertProps, handleSetInLineAlertProps } = useInLineAlert();\n\n const {\n additionalActionsAlert,\n passwordError,\n isSuccessful,\n updatePasswordValue,\n isClickSubmit,\n isLoading,\n submitUpdatePassword,\n handleSetUpdatePasswordValue,\n } = useUpdatePasswordForm({\n isEmailConfirmationRequired,\n signInOnSuccess,\n passwordConfigs,\n routeRedirectOnSignIn,\n routeWrongUrlRedirect,\n onErrorCallback,\n onSuccessCallback,\n handleSetInLineAlertProps,\n routeRedirectOnPasswordUpdate,\n routeSignInPage,\n });\n\n const { isValidUniqueSymbols, defaultLengthMessage } =\n usePasswordValidationMessage({\n password: updatePasswordValue,\n isClickSubmit,\n passwordConfigs,\n });\n\n if (isSuccessful.status && slots?.SuccessNotification) {\n return (\n <Slot\n data-testid=\"successNotificationTestId\"\n name=\"SuccessNotification\"\n slot={slots?.SuccessNotification}\n context={{ isSuccessful }}\n />\n );\n }\n\n return (\n <div\n className={classes([\n 'auth-update-password-form',\n `auth-update-password-form--${formSize}`,\n ])}\n >\n <Header\n title={translations.title}\n divider={false}\n className=\"auth-update-password-form__title\"\n />\n <InLineAlert\n className={classes([\n 'auth-update-password-form__notification',\n [\n 'auth-update-password-form__notification--show',\n !!inLineAlertProps?.text,\n ],\n ])}\n variant=\"secondary\"\n heading={inLineAlertProps?.text as string}\n icon={inLineAlertProps.icon}\n additionalActions={additionalActionsAlert}\n />\n <Form\n name=\"updatePassword_form\"\n className=\"auth-update-password-form__form\"\n onSubmit={submitUpdatePassword}\n loading={isLoading}\n fieldsConfig={[]}\n >\n <div style=\"display: none;\">\n <input\n type=\"text\"\n id=\"username\"\n name=\"username\"\n autoComplete=\"username\"\n />\n </div>\n <InputPassword\n defaultValue={updatePasswordValue}\n onValue={handleSetUpdatePasswordValue}\n className=\"auth-update-password-form__form__item\"\n autoComplete={'new-password'}\n name={'password'}\n errorMessage={\n passwordError ||\n isValidUniqueSymbols === 'error' ||\n defaultLengthMessage?.status === 'error'\n ? translations.requiredFieldError\n : undefined\n }\n minLength={passwordConfigs?.minLength}\n uniqueSymbolsStatus={isValidUniqueSymbols}\n validateLengthConfig={defaultLengthMessage}\n requiredCharacterClasses={passwordConfigs?.requiredCharacterClasses}\n placeholder={translations.placeholder}\n floatingLabel={translations.floatingLabel}\n />\n\n <div className=\"auth-update-password-form__button\">\n <Button\n type=\"submit\"\n buttonText={translations.buttonPrimary}\n variant=\"primary\"\n enableLoader={isLoading}\n />\n </div>\n </Form>\n </div>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Container } from '@adobe-commerce/elsie/lib';\nimport { UpdatePasswordForm } from '@/auth/components';\nimport { UpdatePasswordProps } from '@/auth/types';\n\nexport const UpdatePassword: Container<UpdatePasswordProps> = ({\n slots,\n formSize,\n signInOnSuccess,\n routeRedirectOnPasswordUpdate,\n routeRedirectOnSignIn,\n routeSignInPage,\n routeWrongUrlRedirect,\n onErrorCallback,\n onSuccessCallback,\n}) => {\n return (\n <div className=\"auth-update-password\">\n <UpdatePasswordForm\n formSize={formSize}\n signInOnSuccess={signInOnSuccess}\n routeSignInPage={routeSignInPage}\n routeRedirectOnSignIn={routeRedirectOnSignIn}\n routeWrongUrlRedirect={routeWrongUrlRedirect}\n onErrorCallback={onErrorCallback}\n onSuccessCallback={onSuccessCallback}\n slots={slots}\n routeRedirectOnPasswordUpdate={routeRedirectOnPasswordUpdate}\n />\n </div>\n );\n};\n"],"names":["getUrlParam","url","param","el","item","useUpdatePasswordForm","isEmailConfirmationRequired","signInOnSuccess","passwordConfigs","routeRedirectOnSignIn","routeWrongUrlRedirect","onErrorCallback","onSuccessCallback","handleSetInLineAlertProps","routeRedirectOnPasswordUpdate","routeSignInPage","translations","useText","isSuccessful","setIsSuccessful","useState","updatePasswordValue","setUpdatePasswordValue","isClickSubmit","setIsClickSubmit","email","setEmail","token","setToken","isLoading","setIsLoading","passwordError","setPasswordError","additionalActionsAlert","setAdditionalActionsAlert","useEffect","search","checkIsFunction","tokenParam","emailParam","submitUpdatePassword","useCallback","event","formValues","getFormValues","validationData","requiredCharacterClasses","minLength","validationUniqueSymbolsPassword","message","success","resetPassword","loginResponse","getCustomerToken","handleSetUpdatePasswordValue","value","UpdatePasswordForm","formSize","slots","useCustomTranslations","useGetStoreConfigs","inLineAlertProps","useInLineAlert","isValidUniqueSymbols","defaultLengthMessage","usePasswordValidationMessage","jsx","Slot","jsxs","classes","Header","InLineAlert","Form","InputPassword","Button","UpdatePassword"],"mappings":"y9BAiBO,MAAMA,EAAc,CAACC,EAAaC,IACxBD,EACZ,MAAM,GAAG,EACT,OAAQE,GAAOA,EAAG,SAASD,CAAK,CAAC,EACjC,IAAKE,GACGA,EAAK,MAAM,GAAG,EAAE,CAAC,CACzB,EAEW,CAAC,ECIJC,GAAwB,CAAC,CACpC,4BAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,sBAAAC,EACA,sBAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,8BAAAC,EACA,gBAAAC,CACF,IAAkC,CAChC,MAAMC,EAAeC,GAAQ,CAC3B,kBAAmB,sCACnB,sBAAuB,0CACvB,4BACE,gDACF,0BAA2B,oCAAA,CAC5B,EAEK,CAACC,EAAcC,CAAe,EAAIC,EAAS,CAC/C,SAAU,GACV,OAAQ,EAAA,CACT,EACK,CAACC,EAAqBC,CAAsB,EAAIF,EAAS,EAAE,EAC3D,CAACG,EAAeC,CAAgB,EAAIJ,EAAS,EAAK,EAClD,CAACK,EAAOC,CAAQ,EAAIN,EAAS,EAAE,EAC/B,CAACO,EAAOC,CAAQ,EAAIR,EAAS,EAAE,EAC/B,CAACS,EAAWC,CAAY,EAAIV,EAAS,EAAK,EAC1C,CAACW,EAAeC,CAAgB,EAAIZ,EAAS,EAAK,EAClD,CAACa,E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1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fragments.js","sources":["/@dropins/storefront-auth/src/api/graphql/CustomerFragment.graphql.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const CUSTOMER_INFORMATION_FRAGMENT = /* GraphQL */ `\n fragment CUSTOMER_INFORMATION_FRAGMENT on Customer {\n __typename\n firstname\n lastname\n email\n }\n`;\n"],"names":["CUSTOMER_INFORMATION_FRAGMENT"],"mappings":"
|
|
1
|
+
{"version":3,"file":"fragments.js","sources":["/@dropins/storefront-auth/src/api/graphql/CustomerFragment.graphql.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nexport const CUSTOMER_INFORMATION_FRAGMENT = /* GraphQL */ `\n fragment CUSTOMER_INFORMATION_FRAGMENT on Customer {\n __typename\n firstname\n lastname\n email\n }\n`;\n"],"names":["CUSTOMER_INFORMATION_FRAGMENT"],"mappings":"AAiBO,MAAMA,EAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-auth", "version": "2.
|
|
1
|
+
{"name": "@dropins/storefront-auth", "version": "2.2.0-alpha001", "@dropins/tools": "1.4.1-alpha009", "license": "SEE LICENSE IN LICENSE.md"}
|
package/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sources":["/@dropins/storefront-auth/src/render/Provider.tsx","/@dropins/storefront-auth/src/render/render.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { UIProvider } from '@adobe-commerce/elsie/components';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { config } from '@/auth/api';\nimport { deepmerge } from '@adobe-commerce/elsie/lib';\n\nimport en_US from '../i18n/en_US.json';\n\n// Langs\nconst langDefinitions = {\n default: en_US,\n};\n\ninterface CartProviderProps {\n children?: any;\n}\n\nexport const Provider: FunctionComponent<CartProviderProps> = ({\n children,\n}) => {\n const [locale, setLang] = useState<Lang>('en_US');\n\n const userLangDefinitions = config?.getConfig()?.langDefinitions;\n\n // Events\n useEffect(() => {\n const localeEvent = events.on(\n 'locale',\n (payload) => {\n if (payload !== locale) setLang(payload as Lang);\n },\n { eager: true }\n );\n return () => {\n localeEvent?.off();\n };\n }, [locale]);\n\n // Merge language definitions with user language definitions\n const definitions = deepmerge(langDefinitions, userLangDefinitions ?? {});\n\n return (\n <UIProvider lang={locale} langDefinitions={definitions}>\n {children}\n </UIProvider>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Render } from '@adobe-commerce/elsie/lib';\nimport { Provider } from './Provider';\n\nexport const render = new Render(<Provider />);\n"],"names":["langDefinitions","en_US","Provider","children","locale","setLang","useState","userLangDefinitions","_b","_a","config","useEffect","localeEvent","events","payload","definitions","deepmerge","UIProvider","render","Render","jsx"],"mappings":"ioHA4BMA,EAAkB,CACtB,QAASC,CACX,EAMaC,EAAiD,CAAC,CAC7D,SAAAC,CACF,IAAM,SACJ,KAAM,CAACC,EAAQC,CAAO,EAAIC,EAAe,OAAO,EAE1CC,GAAsBC,GAAAC,EAAAC,IAAA,YAAAD,EAAQ,cAAR,YAAAD,EAAqB,gBAGjDG,EAAU,IAAM,CACd,MAAMC,EAAcC,EAAO,GACzB,SACCC,GAAY,CACPA,IAAYV,GAAQC,EAAQS,CAAe,CACjD,EACA,CAAE,MAAO,
|
|
1
|
+
{"version":3,"file":"render.js","sources":["/@dropins/storefront-auth/src/render/Provider.tsx","/@dropins/storefront-auth/src/render/render.tsx"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { UIProvider } from '@adobe-commerce/elsie/components';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { config } from '@/auth/api';\nimport { deepmerge } from '@adobe-commerce/elsie/lib';\n\nimport en_US from '../i18n/en_US.json';\n\n// Langs\nconst langDefinitions = {\n default: en_US,\n};\n\ninterface CartProviderProps {\n children?: any;\n}\n\nexport const Provider: FunctionComponent<CartProviderProps> = ({\n children,\n}) => {\n const [locale, setLang] = useState<Lang>('en_US');\n\n const userLangDefinitions = config?.getConfig()?.langDefinitions;\n\n // Events\n useEffect(() => {\n const localeEvent = events.on(\n 'locale',\n (payload) => {\n if (payload !== locale) setLang(payload as Lang);\n },\n { eager: true }\n );\n return () => {\n localeEvent?.off();\n };\n }, [locale]);\n\n // Merge language definitions with user language definitions\n const definitions = deepmerge(langDefinitions, userLangDefinitions ?? {});\n\n return (\n <UIProvider lang={locale} langDefinitions={definitions}>\n {children}\n </UIProvider>\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { Render } from '@adobe-commerce/elsie/lib';\nimport { Provider } from './Provider';\n\nexport const render = new Render(<Provider />);\n"],"names":["langDefinitions","en_US","Provider","children","locale","setLang","useState","userLangDefinitions","_b","_a","config","useEffect","localeEvent","events","payload","definitions","deepmerge","UIProvider","render","Render","jsx"],"mappings":"ioHA4BMA,EAAkB,CACtB,QAASC,CACX,EAMaC,EAAiD,CAAC,CAC7D,SAAAC,CACF,IAAM,SACJ,KAAM,CAACC,EAAQC,CAAO,EAAIC,EAAe,OAAO,EAE1CC,GAAsBC,GAAAC,EAAAC,IAAA,YAAAD,EAAQ,cAAR,YAAAD,EAAqB,gBAGjDG,EAAU,IAAM,CACd,MAAMC,EAAcC,EAAO,GACzB,SACCC,GAAY,CACPA,IAAYV,GAAQC,EAAQS,CAAe,CACjD,EACA,CAAE,MAAO,EAAA,CAAK,EAEhB,MAAO,IAAM,CACXF,GAAA,MAAAA,EAAa,KACf,CACF,EAAG,CAACR,CAAM,CAAC,EAGX,MAAMW,EAAcC,EAAUhB,EAAiBO,GAAuB,CAAA,CAAE,EAExE,SACGU,EAAA,CAAW,KAAMb,EAAQ,gBAAiBW,EACxC,SAAAZ,EACH,CAEJ,EC7Cae,EAAS,IAAIC,EAAOC,EAAClB,IAAS,CAAE"}
|