@dropins/storefront-auth 0.0.1-alpha5 → 0.0.1-alpha6
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/confirmEmail/confirmEmail.d.ts +4 -0
- package/api/confirmEmail/graphql/confirmEmail.graphql.d.ts +2 -0
- package/api/confirmEmail/index.d.ts +2 -0
- package/api/createCustomer/createCustomer.d.ts +4 -0
- package/api/createCustomer/graphql/createCustomer.graphql.d.ts +2 -0
- package/api/createCustomer/graphql/createCustomerV2.graphql.d.ts +2 -0
- package/api/createCustomer/index.d.ts +2 -0
- package/api/createCustomerAddress/createCustomerAddress.d.ts +4 -0
- package/api/createCustomerAddress/graphql/createCustomerAddress.graphql.d.ts +2 -0
- package/api/createCustomerAddress/index.d.ts +2 -0
- package/api/fetch-graphql/fetch-graphql.d.ts +8 -0
- package/api/fetch-graphql/index.d.ts +2 -0
- package/api/getAttributesForm/getAttributesForm.d.ts +4 -0
- package/api/getAttributesForm/graphql/getAttributesForm.graphql.d.ts +2 -0
- package/api/getAttributesForm/index.d.ts +2 -0
- package/api/getCustomerData/getCustomerData.d.ts +4 -0
- package/api/getCustomerData/graphql/getCustomerData.graphql.d.ts +2 -0
- package/api/getCustomerData/index.d.ts +2 -0
- package/api/getCustomerToken/getCustomerToken.d.ts +15 -0
- package/api/getCustomerToken/graphql/getCustomerToken.graphql.d.ts +2 -0
- package/api/getCustomerToken/index.d.ts +2 -0
- package/api/getStoreConfig/getStoreConfig.d.ts +4 -0
- package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +2 -0
- package/api/getStoreConfig/index.d.ts +2 -0
- package/api/index.d.ts +14 -0
- package/api/initialize/index.d.ts +2 -0
- package/api/initialize/initialize.d.ts +14 -0
- package/api/requestPasswordResetEmail/graphql/requestPasswordResetEmail.graphql.d.ts +2 -0
- package/api/requestPasswordResetEmail/index.d.ts +2 -0
- package/api/requestPasswordResetEmail/requestPasswordResetEmail.d.ts +4 -0
- package/api/resendConfirmationEmail/graphql/resendConfirmationEmail.graphql.d.ts +2 -0
- package/api/resendConfirmationEmail/index.d.ts +2 -0
- package/api/resendConfirmationEmail/resendConfirmationEmail.d.ts +4 -0
- package/api/resetPassword/graphql/resetPassword.graphql.d.ts +2 -0
- package/api/resetPassword/index.d.ts +2 -0
- package/api/resetPassword/resetPassword.d.ts +4 -0
- package/api/revokeCustomerToken/graphql/revokeCustomerToken.graphql.d.ts +2 -0
- package/api/revokeCustomerToken/index.d.ts +2 -0
- package/api/revokeCustomerToken/revokeCustomerToken.d.ts +4 -0
- package/api.d.ts +1 -0
- package/api.js +3 -4
- package/chunks/EmailConfirmationForm.js +1 -2
- package/chunks/PasswordField.js +1 -2
- package/chunks/ResetPasswordForm.js +1 -2
- package/chunks/SignInForm.js +1 -2
- package/chunks/SignUpForm.js +1 -2
- package/chunks/SkeletonLoader.js +1 -2
- package/chunks/confirmEmail.js +1 -2
- package/chunks/createCustomerAddress.js +5 -6
- package/chunks/getStoreConfig.js +4 -5
- package/chunks/index.js +1 -2
- package/chunks/index2.js +1 -2
- package/chunks/index3.js +1 -2
- package/chunks/initialize.js +0 -1
- package/chunks/requestPasswordResetEmail.js +2 -3
- package/chunks/resendConfirmationEmail.js +1 -2
- package/chunks/resetPassword.js +2 -3
- package/chunks/setReCaptchaToken.js +1 -0
- package/chunks/simplifyTransformAttributesForm.js +0 -1
- package/chunks/transform-attributes-form.js +0 -1
- package/chunks/useInLineAlert.js +1 -2
- package/chunks/usePasswordValidationMessage.js +1 -2
- package/components/EmailConfirmationForm/EmailConfirmationForm.d.ts +5 -0
- package/components/EmailConfirmationForm/index.d.ts +3 -0
- package/components/PasswordValidationMessage/PasswordValidationMessage.d.ts +12 -0
- package/components/PasswordValidationMessage/index.d.ts +3 -0
- package/components/ResetPasswordForm/ResetPasswordForm.d.ts +6 -0
- package/components/ResetPasswordForm/index.d.ts +3 -0
- package/components/SignInForm/SignInForm.d.ts +5 -0
- package/components/SignInForm/index.d.ts +3 -0
- package/components/SignUpForm/SignUpForm.d.ts +5 -0
- package/components/SignUpForm/index.d.ts +3 -0
- package/components/SkeletonLoader/SkeletonLoader.d.ts +5 -0
- package/components/SkeletonLoader/Skeletons/ResetPasswordSkeleton.d.ts +2 -0
- package/components/SkeletonLoader/Skeletons/SignInSkeleton.d.ts +2 -0
- package/components/SkeletonLoader/Skeletons/SignUpSkeleton.d.ts +2 -0
- package/components/SkeletonLoader/Skeletons/index.d.ts +4 -0
- package/components/SkeletonLoader/index.d.ts +3 -0
- package/components/SuccessNotificationForm/SuccessNotificationForm.d.ts +6 -0
- package/components/SuccessNotificationForm/index.d.ts +3 -0
- package/components/UI/Button/Button.d.ts +16 -0
- package/components/UI/Button/index.d.ts +3 -0
- package/components/UI/CheckboxField/CheckboxField.d.ts +13 -0
- package/components/UI/CheckboxField/index.d.ts +3 -0
- package/components/UI/DateField/DateField.d.ts +13 -0
- package/components/UI/DateField/index.d.ts +3 -0
- package/components/UI/Form/Form.d.ts +5 -0
- package/components/UI/Form/index.d.ts +3 -0
- package/components/UI/FormInputs/FormInputs.d.ts +12 -0
- package/components/UI/FormInputs/index.d.ts +3 -0
- package/components/UI/PasswordField/PasswordField.d.ts +15 -0
- package/components/UI/PasswordField/index.d.ts +3 -0
- package/components/UI/SelectField/SelectField.d.ts +17 -0
- package/components/UI/SelectField/index.d.ts +3 -0
- package/components/UI/TextArea/TextArea.d.ts +13 -0
- package/components/UI/TextArea/index.d.ts +3 -0
- package/components/UI/TextField/TextField.d.ts +13 -0
- package/components/UI/TextField/index.d.ts +3 -0
- package/components/UI/Title/Title.d.ts +11 -0
- package/components/UI/Title/index.d.ts +3 -0
- package/components/UI/index.d.ts +11 -0
- package/components/UpdatePasswordForm/UpdatePasswordForm.d.ts +5 -0
- package/components/UpdatePasswordForm/index.d.ts +3 -0
- package/components/index.d.ts +18 -0
- package/configs/cookieConfigs.d.ts +7 -0
- package/configs/defaultCreateUserConfigs.d.ts +16 -0
- package/configs/patternConfigs.d.ts +3 -0
- package/containers/AuthCombine/AuthCombine.d.ts +5 -0
- package/containers/AuthCombine/index.d.ts +3 -0
- package/containers/AuthCombine.d.ts +3 -0
- package/containers/AuthCombine.js +1 -2
- package/containers/ResetPassword/ResetPassword.d.ts +5 -0
- package/containers/ResetPassword/index.d.ts +3 -0
- package/containers/ResetPassword.d.ts +3 -0
- package/containers/ResetPassword.js +1 -2
- package/containers/SignIn/SignIn.d.ts +5 -0
- package/containers/SignIn/index.d.ts +3 -0
- package/containers/SignIn.d.ts +3 -0
- package/containers/SignIn.js +1 -2
- package/containers/SignUp/SignUp.d.ts +5 -0
- package/containers/SignUp/index.d.ts +3 -0
- package/containers/SignUp.d.ts +3 -0
- package/containers/SignUp.js +1 -2
- package/containers/SuccessNotification/SuccessNotification.d.ts +5 -0
- package/containers/SuccessNotification/index.d.ts +3 -0
- package/containers/SuccessNotification.d.ts +3 -0
- package/containers/SuccessNotification.js +1 -2
- package/containers/UpdatePassword/UpdatePassword.d.ts +5 -0
- package/containers/UpdatePassword/index.d.ts +3 -0
- package/containers/UpdatePassword.d.ts +3 -0
- package/containers/UpdatePassword.js +1 -2
- package/containers/index.d.ts +7 -0
- package/data/models/attributes-form.d.ts +25 -0
- package/data/models/customer-data.d.ts +6 -0
- package/data/models/index.d.ts +7 -0
- package/data/models/password-reset-email.d.ts +5 -0
- package/data/models/reset-password.d.ts +5 -0
- package/data/models/revoke-customer-token.d.ts +5 -0
- package/data/models/store-config.d.ts +8 -0
- package/data/transforms/index.d.ts +7 -0
- package/data/transforms/transform-attributes-form.d.ts +5 -0
- package/data/transforms/transform-auth.d.ts +37 -0
- package/data/transforms/transform-customer-data.d.ts +5 -0
- package/data/transforms/transform-password-reset-email.d.ts +5 -0
- package/data/transforms/transform-reset-password.d.ts +5 -0
- package/data/transforms/transform-revoke-customer-token.d.ts +5 -0
- package/data/transforms/transform-store-config.d.ts +5 -0
- package/hooks/api/useGetAttributesForm.d.ts +14 -0
- package/hooks/api/useGetStoreConfigs.d.ts +8 -0
- package/hooks/components/useEmailConfirmationForm.d.ts +7 -0
- package/hooks/components/usePasswordValidationMessage.d.ts +16 -0
- package/hooks/components/useResetPasswordForm.d.ts +8 -0
- package/hooks/components/useSignInForm.d.ts +21 -0
- package/hooks/components/useSignUpForm.d.ts +20 -0
- package/hooks/components/useUpdatePasswordForm.d.ts +14 -0
- package/hooks/ui/useForm.d.ts +11 -0
- package/hooks/useEmailConfirmation.d.ts +11 -0
- package/hooks/useInLineAlert.d.ts +7 -0
- package/i18n/en_US.json.d.ts +66 -0
- package/icons/index.d.ts +4 -0
- package/lib/acdl.d.ts +9 -0
- package/lib/checkIsFunction.d.ts +2 -0
- package/lib/clearUrlAndReplace.d.ts +2 -0
- package/lib/convertToInputDateFormat.d.ts +2 -0
- package/lib/cookieUtils.d.ts +3 -0
- package/lib/fetch-error.d.ts +5 -0
- package/lib/generateRandomDigits.d.ts +2 -0
- package/lib/getFormValues.d.ts +2 -0
- package/lib/getUrlParam.d.ts +2 -0
- package/lib/mergeFormObjects.d.ts +3 -0
- package/lib/network-error.d.ts +6 -0
- package/lib/setLoadingState.d.ts +2 -0
- package/lib/setReCaptchaToken.d.ts +2 -0
- package/lib/simplifyTransformAttributesForm.d.ts +2 -0
- package/lib/validationUniqueSymbolsPassword.d.ts +2 -0
- package/package.json +1 -1
- package/render/Provider.d.ts +8 -0
- package/render/index.d.ts +2 -0
- package/render/render.d.ts +4 -0
- package/render.d.ts +1 -0
- package/render.js +1 -2
- package/types/api/confirmEmail.types.d.ts +17 -0
- package/types/api/createCustomer.types.d.ts +24 -0
- package/types/api/createCustomerAddress.types.d.ts +47 -0
- package/types/api/getAttributesForm.types.d.ts +29 -0
- package/types/api/getCustomerData.types.d.ts +13 -0
- package/types/api/getCustomerToken.types.d.ts +11 -0
- package/types/api/passwordResetEmail.types.d.ts +9 -0
- package/types/api/resendConfirmationEmail.types.d.ts +9 -0
- package/types/api/resetPassword.types.d.ts +9 -0
- package/types/api/revokeCustomerToken.types.d.ts +9 -0
- package/types/api/storeConfig.types.d.ts +16 -0
- package/types/authCombine.types.d.ts +12 -0
- package/types/emailConfirmationForm.types.d.ts +14 -0
- package/types/form.types.d.ts +11 -0
- package/types/index.d.ts +22 -0
- package/types/notification.types.d.ts +15 -0
- package/types/resetPassword.types.d.ts +15 -0
- package/types/signIn.types.d.ts +34 -0
- package/types/signUp.types.d.ts +41 -0
- package/types/skeletonLoader.types.d.ts +6 -0
- package/types/successNotification.types.d.ts +13 -0
- package/types/updatePassword.types.d.ts +24 -0
- package/api.js.map +0 -1
- package/chunks/EmailConfirmationForm.js.map +0 -1
- package/chunks/PasswordField.js.map +0 -1
- package/chunks/ResetPasswordForm.js.map +0 -1
- package/chunks/SignInForm.js.map +0 -1
- package/chunks/SignUpForm.js.map +0 -1
- package/chunks/SkeletonLoader.js.map +0 -1
- package/chunks/confirmEmail.js.map +0 -1
- package/chunks/createCustomerAddress.js.map +0 -1
- package/chunks/getStoreConfig.js.map +0 -1
- package/chunks/index.js.map +0 -1
- package/chunks/index2.js.map +0 -1
- package/chunks/index3.js.map +0 -1
- package/chunks/initialize.js.map +0 -1
- package/chunks/network-error.js +0 -2
- package/chunks/network-error.js.map +0 -1
- package/chunks/requestPasswordResetEmail.js.map +0 -1
- package/chunks/resendConfirmationEmail.js.map +0 -1
- package/chunks/resetPassword.js.map +0 -1
- package/chunks/simplifyTransformAttributesForm.js.map +0 -1
- package/chunks/transform-attributes-form.js.map +0 -1
- package/chunks/useInLineAlert.js.map +0 -1
- package/chunks/usePasswordValidationMessage.js.map +0 -1
- package/containers/AuthCombine.js.map +0 -1
- package/containers/ResetPassword.js.map +0 -1
- package/containers/SignIn.js.map +0 -1
- package/containers/SignUp.js.map +0 -1
- package/containers/SuccessNotification.js.map +0 -1
- package/containers/UpdatePassword.js.map +0 -1
- package/render.js.map +0 -1
package/containers/SignIn.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=SignIn.js.map
|
|
1
|
+
import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{S as l}from"../chunks/SignInForm.js";import"@dropins/tools/lib.js";import"../chunks/useInLineAlert.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/components.js";import"@dropins/tools/recaptcha.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/event-bus.js";import"../chunks/getStoreConfig.js";import"../chunks/setReCaptchaToken.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/initialize.js";import"../chunks/resendConfirmationEmail.js";import"../chunks/simplifyTransformAttributesForm.js";import"../chunks/transform-attributes-form.js";import"../chunks/confirmEmail.js";import"../chunks/EmailConfirmationForm.js";import"../chunks/PasswordField.js";const G=({enableEmailConfirmation:i,initialEmailValue:o,formSize:t,renderSignUpLink:m,hideCloseBtnOnEmailConfirmation:p,routeRedirectOnEmailConfirmationClose:n,routeRedirectOnSignIn:s,routeForgotPassword:a,routeSignUp:e,onSuccessCallback:c,onErrorCallback:d,onSignUpLinkClick:f,successNotificationForm:g})=>r("div",{className:"auth-sign-in",children:r(l,{formSize:t,renderSignUpLink:m,initialEmailValue:o,enableEmailConfirmation:i,hideCloseBtnOnEmailConfirmation:p,routeRedirectOnEmailConfirmationClose:n,routeSignUp:e,onErrorCallback:d,onSuccessCallback:c,onSignUpLinkClick:f,routeForgotPassword:a,routeRedirectOnSignIn:s,successNotificationForm:g})});export{G as SignIn,G as default};
|
package/containers/SignUp.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=SignUp.js.map
|
|
1
|
+
import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{S as l}from"../chunks/SignUpForm.js";import"@dropins/tools/lib.js";import"../chunks/usePasswordValidationMessage.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/i18n.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import"../chunks/getStoreConfig.js";import"../chunks/setReCaptchaToken.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/initialize.js";import"@dropins/tools/preact-hooks.js";import"../chunks/createCustomerAddress.js";import"../chunks/transform-attributes-form.js";import"../chunks/simplifyTransformAttributesForm.js";import"../chunks/useInLineAlert.js";import"@dropins/tools/components.js";import"../chunks/SkeletonLoader.js";import"../chunks/EmailConfirmationForm.js";import"../chunks/resendConfirmationEmail.js";import"../chunks/PasswordField.js";const J=({formSize:i,apiVersion2:o,addressesData:t,inputsDefaultValueSet:m,displayNewsletterCheckbox:p,displayTermsOfUseCheckbox:s,fieldsConfigForApiVersion1:a,hideCloseBtnOnEmailConfirmation:n,routeRedirectOnEmailConfirmationClose:e,routeRedirectOnSignIn:u,successNotificationForm:c,onSuccessCallback:d,onErrorCallback:f,routeSignIn:g})=>r("div",{className:"auth-sign-up",children:r(l,{formSize:i,apiVersion2:o,addressesData:t,inputsDefaultValueSet:m,fieldsConfigForApiVersion1:a,displayNewsletterCheckbox:p,displayTermsOfUseCheckbox:s,hideCloseBtnOnEmailConfirmation:n,routeRedirectOnEmailConfirmationClose:e,routeRedirectOnSignIn:u,routeSignIn:g,successNotificationForm:c,onErrorCallback:f,onSuccessCallback:d})});export{J as SignUp,J as default};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=SuccessNotification.js.map
|
|
1
|
+
import{jsxs as l,jsx as t}from"@dropins/tools/preact-jsx-runtime.js";import{classes as f}from"@dropins/tools/lib.js";import{Button as u}from"@dropins/tools/components.js";const m=({formSize:o="default",className:s="",headingText:a="",messageText:e="",primaryButtonText:i="",secondaryButtonText:c="",onPrimaryButtonClick:n,onSecondaryButtonClick:r})=>!i&&!c?null:l("div",{className:f(["auth-successNotificationForm",o,s]),children:[t("p",{className:"auth-successNotificationForm__title","data-testid":"notification-title",children:a}),t("p",{className:"auth-successNotificationForm__content-text","data-testid":"notification-content",children:e}),t(u,{type:"button",className:"auth-successNotificationForm__button auth-successNotificationForm__button--top",onClick:n,children:i}),t(u,{type:"button",variant:"tertiary",onClick:r,children:c})]}),p=({formSize:o="default",className:s,headingText:a,messageText:e,primaryButtonText:i,secondaryButtonText:c,onPrimaryButtonClick:n,onSecondaryButtonClick:r})=>t("div",{className:"auth-success-notification",children:t(m,{formSize:o,className:s,headingText:a,messageText:e,primaryButtonText:i,secondaryButtonText:c,onPrimaryButtonClick:n,onSecondaryButtonClick:r})});export{p as SuccessNotification,p as default};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{classes as S}from"@dropins/tools/lib.js";import{v as z,u as H,a as J,P as K}from"../chunks/usePasswordValidationMessage.js";import"@dropins/tools/event-bus.js";import{a as Q}from"../chunks/getStoreConfig.js";import{r as X}from"../chunks/resetPassword.js";import{c as q,g as Y,u as Z,T as $,F as E,B as W}from"../chunks/useInLineAlert.js";import{useState as w,useEffect as O,useCallback as
|
|
2
|
-
//# sourceMappingURL=UpdatePassword.js.map
|
|
1
|
+
import{jsxs as k,jsx as l}from"@dropins/tools/preact-jsx-runtime.js";import{classes as S}from"@dropins/tools/lib.js";import{v as z,u as H,a as J,P as K}from"../chunks/usePasswordValidationMessage.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{a as Q}from"../chunks/getStoreConfig.js";import{r as X}from"../chunks/resetPassword.js";import{c as q,g as Y,u as Z,T as $,F as E,B as W}from"../chunks/useInLineAlert.js";import{useState as w,useEffect as O,useCallback as j}from"@dropins/tools/preact-hooks.js";import{useText as D}from"@dropins/tools/i18n.js";import{InLineAlert as C}from"@dropins/tools/components.js";import{P as R}from"../chunks/PasswordField.js";import"@dropins/tools/preact-compat.js";import"../chunks/setReCaptchaToken.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/initialize.js";const B=(r,m)=>r.split("&").filter(a=>a.includes(m)).map(a=>a.split("=")[1])[0],tt=({isEmailConfirmationRequired:r,signInOnSuccess:m,passwordConfigs:s,routeRedirectOnSignIn:a,routeWrongUrlRedirect:d,onErrorCallback:o,onSuccessCallback:n,handleSetInLineAlertProps:i,routeRedirectOnPasswordUpdate:f})=>{const t=D({errorNotification:"Auth.Notification.errorNotification",updatePasswordMessage:"Auth.Notification.updatePasswordMessage",customerTokenErrorMessage:"Auth.Api.customerTokenErrorMessage"}),[v,h]=w({userName:"",status:!1}),[L,N]=w(""),[y,x]=w(!1),[p,b]=w(""),[F,U]=w(""),[P,_]=w(!1);O(()=>{const{search:c}=window.location;!c.includes("token=")&&!c.includes("email=")&&q(d)&&(window.location.href=d());const e=decodeURIComponent(c),T=B(e,"token"),V=B(e,"email");b(V),U(T)},[d]);const g=j(async c=>{c.preventDefault(),_(!0);const e=Y(c.target),T=(e==null?void 0:e.password)&&p&&F,V=(s==null?void 0:s.requiredCharacterClasses)||0,I=(s==null?void 0:s.minLength)||0;if(!z(e==null?void 0:e.password,V)||e.password.length<+I){x(!0),_(!1);return}if(!T){i({type:"error",text:t.errorNotification}),_(!1);return}const{message:A,success:M}=await X(p,F,e.password);if(M){if(r||!r&&!m){q(f)&&(window.location.href=f()),x(!0),_(!1),i({type:"success",text:t.updatePasswordMessage}),N("");return}const u=await Q({email:p,password:e.password,handleSetInLineAlertProps:i,onErrorCallback:o,translations:t});u!=null&&u.userName&&(q(a)?window.location.href=a():(h({userName:u==null?void 0:u.userName,status:!0}),n==null||n(u==null?void 0:u.userName)))}else i({type:"error",text:A}),o==null||o({message:A,success:M});_(!1)},[p,F,s,r,t,m,i,a,f,o,n]),G=j(c=>{N(c)},[]);return{isSuccessful:v,updatePasswordValue:L,isClickSubmit:y,isLoading:P,submitUpdatePassword:g,handleSetUpdatePasswordValue:G}},st=({signInOnSuccess:r=!0,formSize:m="default",routeRedirectOnSignIn:s,routeWrongUrlRedirect:a,successNotificationForm:d,onErrorCallback:o,onSuccessCallback:n,routeRedirectOnPasswordUpdate:i})=>{const f=D({title:"Auth.UpdatePasswordForm.title",buttonPrimary:"Auth.UpdatePasswordForm.buttonPrimary"}),{passwordConfigs:t,isEmailConfirmationRequired:v}=H(),{inLineAlertProps:h,handleSetInLineAlertProps:L}=Z(),{isSuccessful:N,updatePasswordValue:y,isClickSubmit:x,isLoading:p,submitUpdatePassword:b,handleSetUpdatePasswordValue:F}=tt({isEmailConfirmationRequired:v,signInOnSuccess:r,passwordConfigs:t,routeRedirectOnSignIn:s,routeWrongUrlRedirect:a,onErrorCallback:o,onSuccessCallback:n,handleSetInLineAlertProps:L,routeRedirectOnPasswordUpdate:i}),{isValidUniqueSymbols:U,defaultLengthMessage:P}=J({password:y,isClickSubmit:x,passwordConfigs:t});return d&&N.status?d(N.userName):k("div",{className:S(["auth-updatePasswordForm",m]),children:[l($,{text:f.title,bottomLine:!1,className:"auth-updatePasswordForm__title"}),h.text?l(C,{className:"auth-updatePasswordForm__notification",variant:"secondary",heading:h.text,icon:h.icon}):null,k(E,{name:"updatePassword_form",className:"auth-updatePasswordForm__form",submitCallback:b,isLoading:p,fieldsConfig:[],children:[l(R,{initialPassword:y,required:!0,className:"auth-updatePasswordForm__form__item",setPasswordValueCallback:F,isError:U==="error"||(P==null?void 0:P.status)==="error",children:l(K,{minLength:t==null?void 0:t.minLength,requiredCharacterClasses:t==null?void 0:t.requiredCharacterClasses,validateLengthConfig:P,isValidUniqueSymbols:U})}),l("div",{className:"auth-updatePasswordForm__button",children:l(W,{type:"submit",buttonText:f.buttonPrimary,variant:"primary",enableLoader:p})})]})]})},Nt=({formSize:r,signInOnSuccess:m,routeRedirectOnPasswordUpdate:s,routeRedirectOnSignIn:a,routeWrongUrlRedirect:d,successNotificationForm:o,onErrorCallback:n,onSuccessCallback:i})=>l("div",{className:"auth-update-password",children:l(st,{formSize:r,signInOnSuccess:m,routeRedirectOnSignIn:a,routeWrongUrlRedirect:d,onErrorCallback:n,onSuccessCallback:i,successNotificationForm:o,routeRedirectOnPasswordUpdate:s})});export{Nt as UpdatePassword,Nt as default};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface AttributesFormItemsProps {
|
|
2
|
+
code: string;
|
|
3
|
+
name: string;
|
|
4
|
+
id: string;
|
|
5
|
+
defaultValue: string;
|
|
6
|
+
entity_type: string;
|
|
7
|
+
className: null | string;
|
|
8
|
+
fieldType: string;
|
|
9
|
+
required: boolean;
|
|
10
|
+
is_unique: boolean;
|
|
11
|
+
label: string;
|
|
12
|
+
orderNumber: number;
|
|
13
|
+
options: {
|
|
14
|
+
is_default: boolean;
|
|
15
|
+
label: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}[];
|
|
18
|
+
}
|
|
19
|
+
export interface AttributesFormModel {
|
|
20
|
+
fields?: AttributesFormItemsProps[];
|
|
21
|
+
errors?: {
|
|
22
|
+
message: string;
|
|
23
|
+
}[];
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=attributes-form.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './transform-auth';
|
|
2
|
+
export * from './transform-store-config';
|
|
3
|
+
export * from './transform-password-reset-email';
|
|
4
|
+
export * from './transform-revoke-customer-token';
|
|
5
|
+
export * from './transform-customer-data';
|
|
6
|
+
export * from './transform-attributes-form';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { getAttributesFormResponse } from '../../types';
|
|
2
|
+
import { AttributesFormModel } from '../models';
|
|
3
|
+
|
|
4
|
+
export declare const transformAttributesForm: (response: getAttributesFormResponse) => AttributesFormModel;
|
|
5
|
+
//# sourceMappingURL=transform-attributes-form.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const loginContext: (ctx: any) => {
|
|
2
|
+
personalEmail: {
|
|
3
|
+
address: any;
|
|
4
|
+
};
|
|
5
|
+
userAccount: {
|
|
6
|
+
login: boolean;
|
|
7
|
+
};
|
|
8
|
+
commerce: {
|
|
9
|
+
commerceScope: {
|
|
10
|
+
storeCode: any;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const logoutContext: (ctx: any) => {
|
|
15
|
+
userAccount: {
|
|
16
|
+
logout: boolean;
|
|
17
|
+
};
|
|
18
|
+
commerce: {
|
|
19
|
+
commerceScope: {
|
|
20
|
+
storeCode: any;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const createAccountContext: (ctx: any) => {
|
|
25
|
+
personalEmail: {
|
|
26
|
+
address: any;
|
|
27
|
+
};
|
|
28
|
+
userAccount: {
|
|
29
|
+
updateProfile: any;
|
|
30
|
+
};
|
|
31
|
+
commerce: {
|
|
32
|
+
commerceScope: {
|
|
33
|
+
storeCode: any;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=transform-auth.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PasswordResetEmailResponse } from '../../types';
|
|
2
|
+
import { PasswordResetEmailModel } from '../models';
|
|
3
|
+
|
|
4
|
+
export declare const transformPasswordResetEmail: (response: PasswordResetEmailResponse) => PasswordResetEmailModel;
|
|
5
|
+
//# sourceMappingURL=transform-password-reset-email.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { RevokeCustomerTokenResponse } from '../../types/api/revokeCustomerToken.types';
|
|
2
|
+
import { RevokeCustomerTokenModel } from '../models';
|
|
3
|
+
|
|
4
|
+
export declare const transformRevokeCustomerToken: (response: RevokeCustomerTokenResponse) => RevokeCustomerTokenModel;
|
|
5
|
+
//# sourceMappingURL=transform-revoke-customer-token.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { inputsDefaultValueSetProps } from '../../types';
|
|
2
|
+
import { SignUpFieldsProps } from '../../configs/defaultCreateUserConfigs';
|
|
3
|
+
import { AttributesFormItemsProps } from '../../data/models';
|
|
4
|
+
|
|
5
|
+
interface UseGetAttributesFormProps {
|
|
6
|
+
fieldsConfigForApiVersion1: SignUpFieldsProps[];
|
|
7
|
+
apiVersion2: boolean;
|
|
8
|
+
inputsDefaultValueSet?: inputsDefaultValueSetProps[];
|
|
9
|
+
}
|
|
10
|
+
export declare const useGetAttributesForm: ({ inputsDefaultValueSet, fieldsConfigForApiVersion1, apiVersion2, }: UseGetAttributesFormProps) => {
|
|
11
|
+
fieldsListConfigs: AttributesFormItemsProps[];
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=useGetAttributesForm.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useEmailConfirmationFormProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare const useEmailConfirmationForm: ({ userEmail, handleSetInLineAlertProps, }: useEmailConfirmationFormProps) => {
|
|
4
|
+
handleEmailConfirmation: () => Promise<void>;
|
|
5
|
+
disabledButton: boolean;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=useEmailConfirmationForm.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ValidateLengthConfigProps, statusTypes } from '../../types';
|
|
2
|
+
|
|
3
|
+
interface UsePasswordValidationMessageProps {
|
|
4
|
+
passwordConfigs: {
|
|
5
|
+
minLength: number;
|
|
6
|
+
requiredCharacterClasses: number;
|
|
7
|
+
} | null;
|
|
8
|
+
isClickSubmit: boolean;
|
|
9
|
+
password: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const usePasswordValidationMessage: ({ passwordConfigs, isClickSubmit, password, }: UsePasswordValidationMessageProps) => {
|
|
12
|
+
isValidUniqueSymbols: statusTypes;
|
|
13
|
+
defaultLengthMessage: ValidateLengthConfigProps | undefined;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=usePasswordValidationMessage.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UseResetPasswordFormProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare const useResetPasswordForm: ({ routeSignIn, onErrorCallback, setActiveComponent, handleSetInLineAlertProps, }: UseResetPasswordFormProps) => {
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
submitResetPassword: (event: any) => Promise<void>;
|
|
6
|
+
redirectToSignInPage: () => void;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=useResetPasswordForm.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useSignInFormProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare const useSignInForm: ({ emailConfirmationStatusMessage, translations, initialEmailValue, routeSignUp, routeForgotPassword, routeRedirectOnSignIn, onErrorCallback, setActiveComponent, onSuccessCallback, onSignUpLinkClick, handleSetInLineAlertProps, routeRedirectOnEmailConfirmationClose, }: useSignInFormProps) => {
|
|
4
|
+
userEmail: string;
|
|
5
|
+
defaultEnhancedEmailFields: any;
|
|
6
|
+
passwordError: boolean;
|
|
7
|
+
isSuccessful: {
|
|
8
|
+
userName: string;
|
|
9
|
+
status: boolean;
|
|
10
|
+
};
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
signInPasswordValue: string;
|
|
13
|
+
showEmailConfirmationForm: boolean;
|
|
14
|
+
setShowEmailConfirmationForm: import('preact/hooks').Dispatch<import('preact/hooks').StateUpdater<boolean>>;
|
|
15
|
+
setSignInPasswordValue: import('preact/hooks').Dispatch<import('preact/hooks').StateUpdater<string>>;
|
|
16
|
+
submitLogInUser: (event: any) => Promise<void>;
|
|
17
|
+
forgotPasswordCallback: () => void;
|
|
18
|
+
onSignUpLinkClickCallback: () => void;
|
|
19
|
+
handledOnPrimaryButtonClick: () => void;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=useSignInForm.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UseSingUpFormProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare const useSignUpForm: ({ addressesData, translations, isEmailConfirmationRequired, apiVersion2, passwordConfigs, routeRedirectOnSignIn, routeSignIn, onErrorCallback, onSuccessCallback, setActiveComponent, handleSetInLineAlertProps, routeRedirectOnEmailConfirmationClose, }: UseSingUpFormProps) => {
|
|
4
|
+
isKeepMeLogged: boolean;
|
|
5
|
+
userEmail: string;
|
|
6
|
+
showEmailConfirmationForm: boolean;
|
|
7
|
+
isSuccessful: {
|
|
8
|
+
userName: string;
|
|
9
|
+
status: boolean;
|
|
10
|
+
};
|
|
11
|
+
isClickSubmit: boolean;
|
|
12
|
+
signUpPasswordValue: string;
|
|
13
|
+
isLoading: boolean;
|
|
14
|
+
onSubmitSignUp: (event: SubmitEvent, isValid: boolean) => Promise<void>;
|
|
15
|
+
signInButton: () => void;
|
|
16
|
+
handleSetSignUpPasswordValue: (value: string) => void;
|
|
17
|
+
onKeepMeLoggedChange: ({ target }: any) => void;
|
|
18
|
+
handleHideEmailConfirmationForm: () => void;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=useSignUpForm.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UseUpdatePasswordFormProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare const useUpdatePasswordForm: ({ isEmailConfirmationRequired, signInOnSuccess, passwordConfigs, routeRedirectOnSignIn, routeWrongUrlRedirect, onErrorCallback, onSuccessCallback, handleSetInLineAlertProps, routeRedirectOnPasswordUpdate, }: UseUpdatePasswordFormProps) => {
|
|
4
|
+
isSuccessful: {
|
|
5
|
+
userName: string;
|
|
6
|
+
status: boolean;
|
|
7
|
+
};
|
|
8
|
+
updatePasswordValue: string;
|
|
9
|
+
isClickSubmit: boolean;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
submitUpdatePassword: (event: Event) => Promise<void>;
|
|
12
|
+
handleSetUpdatePasswordValue: (value: string) => void;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useUpdatePasswordForm.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useFormProps } from '../../types';
|
|
2
|
+
|
|
3
|
+
export declare const useForm: ({ submitCallback, isLoading, fieldsConfig, }: useFormProps) => {
|
|
4
|
+
formData: Record<string, string>;
|
|
5
|
+
errors: Record<string, string>;
|
|
6
|
+
formRef: import('preact').RefObject<HTMLFormElement>;
|
|
7
|
+
handleChange: ({ target: { name, value, type, checked } }: any) => void;
|
|
8
|
+
handleBlur: (event: any) => void;
|
|
9
|
+
handleSubmit: (event: any) => void;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=useForm.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface useEmailConfirmationProps {
|
|
2
|
+
enableEmailConfirmation: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare const useEmailConfirmation: ({ enableEmailConfirmation, }: useEmailConfirmationProps) => {
|
|
5
|
+
emailConfirmationStatusMessage: {
|
|
6
|
+
text: string;
|
|
7
|
+
status: '' | 'success' | 'error';
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=useEmailConfirmation.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { inLineAlertInterface } from '../types';
|
|
2
|
+
|
|
3
|
+
export declare const useInLineAlert: () => {
|
|
4
|
+
inLineAlertProps: inLineAlertInterface;
|
|
5
|
+
handleSetInLineAlertProps: (notification: inLineAlertInterface | undefined) => void;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=useInLineAlert.d.ts.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"Auth": {
|
|
3
|
+
"PasswordValidationMessage": {
|
|
4
|
+
"chartTwoSymbols": "Use characters and numbers or symbols",
|
|
5
|
+
"chartThreeSymbols": "Use characters, numbers and symbols",
|
|
6
|
+
"chartFourSymbols": "Use uppercase characters, lowercase characters, numbers and symbols",
|
|
7
|
+
"messageLengthPassword": "At least {minLength} characters long"
|
|
8
|
+
},
|
|
9
|
+
"ResetPasswordForm": {
|
|
10
|
+
"title": "Reset your password",
|
|
11
|
+
"buttonPrimary": "Reset password",
|
|
12
|
+
"buttonSecondary": "Back to sign in"
|
|
13
|
+
},
|
|
14
|
+
"SignInForm": {
|
|
15
|
+
"title": "Sign in",
|
|
16
|
+
"buttonPrimary": "Sign in",
|
|
17
|
+
"buttonSecondary": "Sign up",
|
|
18
|
+
"buttonTertiary": "Forgot password?"
|
|
19
|
+
},
|
|
20
|
+
"SignUpForm": {
|
|
21
|
+
"title": "Sign up",
|
|
22
|
+
"buttonPrimary": "Create account",
|
|
23
|
+
"buttonSecondary": "Already a member? Sign in",
|
|
24
|
+
"privacyPolicyDefaultText": "I’ve read and accept the Terms of Use and Privacy Policy.",
|
|
25
|
+
"subscribedDefaultText": "Subscribe to our newsletter and be the first to know about new arrivals, sales and exclusive offers.",
|
|
26
|
+
"keepMeLoggedText": "Keep me logged in after account creation",
|
|
27
|
+
"failedCreateCustomerAddress": "Failed to create customer addresses:"
|
|
28
|
+
},
|
|
29
|
+
"UpdatePasswordForm": {
|
|
30
|
+
"title": "Update password",
|
|
31
|
+
"buttonPrimary": "Update password"
|
|
32
|
+
},
|
|
33
|
+
"FormText": {
|
|
34
|
+
"requiredFieldError": "This is a required field."
|
|
35
|
+
},
|
|
36
|
+
"EmailConfirmationForm": {
|
|
37
|
+
"title": "Verify your email address",
|
|
38
|
+
"subtitle": "We`ve sent an email to",
|
|
39
|
+
"mainText": "Check your inbox and click on the link we just send you to confirm your email address and activate your account.",
|
|
40
|
+
"buttonSecondary": "Resend email",
|
|
41
|
+
"buttonPrimary": "Close",
|
|
42
|
+
"accountConfirmMessage": "Account confirmed",
|
|
43
|
+
"accountConfirmationEmailSuccessMessage": "Congratulations! Your account at {email} email has been successfully confirmed."
|
|
44
|
+
},
|
|
45
|
+
"Notification": {
|
|
46
|
+
"errorNotification": "Your password update failed due to validation errors. Please check your information and try again.",
|
|
47
|
+
"updatePasswordMessage": "The password has been updated. Now you can log in with the new password.",
|
|
48
|
+
"successPasswordResetEmailNotification": "If there is an account associated with {email} you will receive an email with a link to reset your password.",
|
|
49
|
+
"resendEmailNotification": {
|
|
50
|
+
"informationText": "This account is not confirmed.",
|
|
51
|
+
"buttonText": "Click here",
|
|
52
|
+
"additionalText": "to resend confirmation email."
|
|
53
|
+
},
|
|
54
|
+
"emailConfirmationMessage": "Please check your email for confirmation link.",
|
|
55
|
+
"technicalErrors": {
|
|
56
|
+
"technicalErrorSendEmail": "A technical error occurred while trying to send the email. Please try again later."
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"Api": {
|
|
60
|
+
"customerTokenErrorMessage": "Unable to log in. Please try again later or contact support if the issue persists."
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
;
|
|
65
|
+
|
|
66
|
+
export default _default;
|
package/icons/index.d.ts
ADDED
package/lib/acdl.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare enum EventsList {
|
|
2
|
+
CREATE_ACCOUNT_EVENT = "create-account",
|
|
3
|
+
SIGN_IN = "sign-in",
|
|
4
|
+
SIGN_OUT = "sign-out"
|
|
5
|
+
}
|
|
6
|
+
export declare function pushEvent(event: string): void;
|
|
7
|
+
declare const publishEvents: (eventType: string, eventParams: any) => null | undefined;
|
|
8
|
+
export { EventsList, publishEvents };
|
|
9
|
+
//# sourceMappingURL=acdl.d.ts.map
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-auth", "version": "0.0.1-
|
|
1
|
+
{"name": "@dropins/storefront-auth", "version": "0.0.1-alpha6", "@dropins/elsie": "~0.26.0"}
|