@dropins/storefront-auth 0.0.1-alpha11 → 0.0.1-alpha13
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/getAttributesForm/getAttributesForm.d.ts +1 -1
- package/api/getAttributesForm/graphql/getAttributesForm.graphql.d.ts +1 -1
- package/api/getCustomerToken/getCustomerToken.d.ts +2 -2
- package/chunks/SignInForm.js +1 -1
- package/chunks/SignUpForm.js +1 -1
- package/chunks/createCustomerAddress.js +12 -4
- package/chunks/simplifyTransformAttributesForm.js +1 -1
- package/chunks/transform-attributes-form.js +1 -1
- package/chunks/useInLineAlert.js +1 -1
- package/components/UI/FormInputs/FormInputs.d.ts +1 -9
- package/configs/defaultCreateUserConfigs.d.ts +3 -10
- package/containers/UpdatePassword.js +1 -1
- package/data/models/attributes-form.d.ts +35 -16
- package/data/transforms/transform-attributes-form.d.ts +2 -1
- package/hooks/components/useSignInForm.d.ts +2 -1
- package/hooks/components/useUpdatePasswordForm.d.ts +3 -1
- package/hooks/useInLineAlert.d.ts +3 -3
- package/i18n/en_US.json.d.ts +7 -3
- package/lib/simplifyTransformAttributesForm.d.ts +1 -1
- package/package.json +1 -1
- package/render.js +3 -3
- package/types/api/getAttributesForm.types.d.ts +2 -0
- package/types/emailConfirmationForm.types.d.ts +4 -4
- package/types/form.types.d.ts +20 -0
- package/types/notification.types.d.ts +5 -1
- package/types/resetPassword.types.d.ts +2 -2
- package/types/signIn.types.d.ts +2 -2
- package/types/signUp.types.d.ts +2 -2
- package/types/updatePassword.types.d.ts +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AttributesFormModel } from '../../data/models';
|
|
2
2
|
|
|
3
|
-
export declare const getAttributesForm: (formCode: string) => Promise<AttributesFormModel>;
|
|
3
|
+
export declare const getAttributesForm: (formCode: string) => Promise<AttributesFormModel[]>;
|
|
4
4
|
//# sourceMappingURL=getAttributesForm.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const GET_ATTRIBUTES_FORM = "\n query GET_ATTRIBUTES_FORM($formCode: String!) {\n attributesForm(formCode: $formCode) {\n items {\n code\n default_value\n entity_type\n frontend_class\n frontend_input\n is_required\n is_unique\n label\n options {\n is_default\n label\n value\n }\n }\n errors {\n type\n message\n }\n }\n }\n";
|
|
1
|
+
export declare const GET_ATTRIBUTES_FORM = "\n query GET_ATTRIBUTES_FORM($formCode: String!) {\n attributesForm(formCode: $formCode) {\n items {\n code\n default_value\n entity_type\n frontend_class\n frontend_input\n is_required\n is_unique\n label\n options {\n is_default\n label\n value\n }\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n validate_rules {\n name\n value\n }\n }\n }\n errors {\n type\n message\n }\n }\n }\n";
|
|
2
2
|
//# sourceMappingURL=getAttributesForm.graphql.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InLineAlertInterface } from '../../types';
|
|
2
2
|
|
|
3
3
|
interface getCustomerTokenProps {
|
|
4
4
|
email: string;
|
|
5
5
|
password: string;
|
|
6
|
-
handleSetInLineAlertProps: (value?:
|
|
6
|
+
handleSetInLineAlertProps: (value?: InLineAlertInterface) => void;
|
|
7
7
|
translations: Record<string, string>;
|
|
8
8
|
onErrorCallback?: (value?: unknown) => void;
|
|
9
9
|
}
|
package/chunks/SignInForm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as n,jsxs as P}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as $,classes as z}from"@dropins/tools/lib.js";import{g as O,c as y,u as R,T as tt,F as at,B as K}from"./useInLineAlert.js";import{useState as g,useCallback as x,useEffect as q,useMemo as st}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{a as et}from"./getCustomerToken.js";import{r as rt}from"./resendConfirmationEmail.js";import{s as ot,a as it}from"./simplifyTransformAttributesForm.js";import{c as nt}from"./confirmEmail.js";import{useText as Q}from"@dropins/tools/i18n.js";import{InLineAlert as ct,InputPassword as mt}from"@dropins/tools/components.js";import{E as ut}from"./EmailConfirmationForm.js";const lt=({emailConfirmationStatusMessage:t,translations:r,initialEmailValue:o,routeSignUp:c,routeForgotPassword:m,routeRedirectOnSignIn:F,onErrorCallback:b,setActiveComponent:a,onSuccessCallback:u,onSignUpLinkClick:h,handleSetInLineAlertProps:s,routeRedirectOnEmailConfirmationClose:_})=>{const[C,L]=g(""),[l,E]=g(!1),[f,N]=g(""),[S,w]=g(!1),[M,B]=g({userName:"",status:!1}),[p,I]=g(!1),[T,U]=g(!1),[v,k]=g([]),A=x(async d=>{await rt(d),s({text:"",type:"success"}),E(!0),w(!1),k([])},[s]);q(()=>{T&&(f.length?w(!1):w(!0))},[T,f]),q(()=>{t!=null&&t.text&&s({text:t.text,type:t.status?t.status:void 0})},[t,s]);const j=x(async d=>{var H;s({text:"",type:"success"}),I(!0),U(!0);const i=O(d.target);if(i.password||(w(!0),I(!1)),i!=null&&i.email&&(i!=null&&i.password)){const{email:G,password:Y}=i,e=await et({email:G,password:Y,handleSetInLineAlertProps:s,onErrorCallback:b,translations:r});if((H=e==null?void 0:e.errorMessage)!=null&&H.length){L(G);const J=e.errorMessage.includes("This account isn't confirmed. Verify and try again."),Z=J?r.resendEmailInformationText:e.errorMessage;J&&k([{label:r.resendEmailButtonText,onClick:()=>{A(G)}}]),s({text:Z,type:"error"}),N("")}e!=null&&e.userName&&(d.target.reset(),y(F)?window.location.href=F():(u==null||u({userName:e==null?void 0:e.userName,status:!0}),B({userName:e==null?void 0:e.userName,status:!0}))),w(!1)}I(!1)},[s,b,r,A,F,u]),D=x(()=>{if(y(a)){a("resetPasswordForm");return}y(m)&&(window.location.href=m())},[m,a]),V=x(()=>{if(y(h)&&h(),y(a)){a("signUpForm");return}y(c)&&(window.location.href=c())},[h,c,a]),W=st(()=>{const d=ot(it);return o!=null&&o.length?d==null?void 0:d.map(i=>({...i,defaultValue:o})):d},[o]),X=x(()=>{s({}),y(_)?window.location.href=_():E(!1)},[s,_]);return{additionalActionsAlert:v,userEmail:C,defaultEnhancedEmailFields:W,passwordError:S,isSuccessful:M,isLoading:p,signInPasswordValue:f,showEmailConfirmationForm:l,setShowEmailConfirmationForm:E,setSignInPasswordValue:N,submitLogInUser:j,forgotPasswordCallback:D,onSignUpLinkClickCallback:V,handledOnPrimaryButtonClick:X}},ft=()=>{let t=new URL(window.location.href),r=t.searchParams.get("email"),o=t.searchParams.get("key");r&&o&&(t.searchParams.delete("email"),t.searchParams.delete("key"),window.history.replaceState({},document.title,t.toString()))},dt=({enableEmailConfirmation:t})=>{const r=Q({accountConfirmMessage:"Auth.EmailConfirmationForm.accountConfirmMessage",accountConfirmationEmailSuccessMessage:"Auth.EmailConfirmationForm.accountConfirmationEmailSuccessMessage"}),[o,c]=g({text:"",status:""});return q(()=>{if(t){const{search:m}=window.location;m.includes("email=")&&m.includes("key=")&&(async()=>{var u,h,s;const b=new URLSearchParams(m),a=await nt({customerEmail:b.get("email"),customerConfirmationKey:b.get("key")});if(!a)return null;(u=a==null?void 0:a.errors)!=null&&u.length?c({text:a==null?void 0:a.errors[0].message,status:"error"}):(c({text:a.data.confirmEmail.customer.email?r.accountConfirmationEmailSuccessMessage.replace("{email}",(s=(h=a==null?void 0:a.data)==null?void 0:h.confirmEmail.customer)==null?void 0:s.email):r.accountConfirmMessage,status:"success"}),ft())})()}},[t,r]),{emailConfirmationStatusMessage:o}},kt=({slots:t,formSize:r="default",initialEmailValue:o="",renderSignUpLink:c=!1,enableEmailConfirmation:m=!1,hideCloseBtnOnEmailConfirmation:F=!1,routeRedirectOnEmailConfirmationClose:b,routeRedirectOnSignIn:a,routeForgotPassword:u,routeSignUp:h,onSuccessCallback:s,setActiveComponent:_,onErrorCallback:C,onSignUpLinkClick:L})=>{const l=Q({title:"Auth.SignInForm.title",buttonPrimary:"Auth.SignInForm.buttonPrimary",buttonSecondary:"Auth.SignInForm.buttonSecondary",buttonTertiary:"Auth.SignInForm.buttonTertiary",resendEmailInformationText:"Auth.Notification.resendEmailNotification.informationText",resendEmailButtonText:"Auth.Notification.resendEmailNotification.buttonText",customerTokenErrorMessage:"Auth.Api.customerTokenErrorMessage",placeholder:"Auth.InputPassword.placeholder",floatingLabel:"Auth.InputPassword.floatingLabel"}),{emailConfirmationStatusMessage:E}=dt({enableEmailConfirmation:m}),{inLineAlertProps:f,handleSetInLineAlertProps:N}=R(),{userEmail:S,additionalActionsAlert:w,defaultEnhancedEmailFields:M,passwordError:B,isSuccessful:p,isLoading:I,signInPasswordValue:T,showEmailConfirmationForm:U,setSignInPasswordValue:v,submitLogInUser:k,forgotPasswordCallback:A,onSignUpLinkClickCallback:j,handledOnPrimaryButtonClick:D}=lt({translations:l,emailConfirmationStatusMessage:E,initialEmailValue:o,routeSignUp:h,routeForgotPassword:u,routeRedirectOnSignIn:a,setActiveComponent:_,onErrorCallback:C,onSuccessCallback:s,onSignUpLinkClick:L,handleSetInLineAlertProps:N,routeRedirectOnEmailConfirmationClose:b});return p.status&&(t!=null&&t.SuccessNotification)?n($,{"data-testid":"successNotificationTestId",name:"SuccessNotification",slot:t==null?void 0:t.SuccessNotification,context:{isSuccessful:p}}):U?n(ut,{formSize:r,userEmail:S,inLineAlertProps:f,hideCloseBtnOnEmailConfirmation:F,handleSetInLineAlertProps:N,onPrimaryButtonClick:D}):P("div",{className:z(["auth-signInForm",r]),"data-testid":"signInForm",children:[n(tt,{text:l.title,bottomLine:!1,className:"auth-signInForm__title"}),f.text?n(ct,{"data-testid":"authInLineAlert",className:"auth-signInForm__notification",type:f.type,variant:"secondary",heading:f.text,icon:f.icon,additionalActions:w}):null,P(at,{name:"signIn_form",className:"auth-signInForm__form",submitCallback:k,isLoading:I,fieldsConfig:M,children:[n(mt,{hideStatusIndicator:!0,className:"auth-signInForm__form__password",autoComplete:"current-password",error:B,defaultValue:T,onValue:v,placeholder:l.placeholder,floatingLabel:l.floatingLabel}),P("div",{className:"auth-signInForm__form__buttons",children:[P("div",{className:"auth-signInForm__form__buttons--combine",children:[n(K,{type:"button",variant:"tertiary",style:{padding:0},buttonText:l.buttonTertiary,className:"auth-signInForm__button auth-signInForm__button--forgot",enableLoader:!1,onClick:A,"data-testid":"switchToSignUp"}),c?n("span",{}):null,c?n(K,{type:"button",variant:"tertiary",style:{padding:0},buttonText:l.buttonSecondary,className:"auth-signInForm__button auth-signInForm__button--signup",enableLoader:!1,onClick:j}):null]}),n(K,{type:"submit",buttonText:l.buttonPrimary,variant:"primary",className:"auth-signInForm__button auth-signInForm__button--submit",enableLoader:I})]})]}),n("div",{id:"generateCustomerToken"})]})};export{kt as S};
|
package/chunks/SignUpForm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i,jsxs as k}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as ce,classes as le}from"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{g as fe,c as de,a as ge}from"./createCustomerAddress.js";import{useState as b,useEffect as he,useCallback as G}from"@dropins/tools/preact-hooks.js";import{s as ee,b as pe,c as Fe}from"./simplifyTransformAttributesForm.js";import{v as Ue,u as be,a as ye}from"./usePasswordValidationMessage.js";import{a as _e}from"./getCustomerToken.js";import{p as te,E as re}from"./getStoreConfig.js";import{c as H,g as Te,u as Ne,T as Le,F as xe,B as ie}from"./useInLineAlert.js";import{InLineAlert as Pe,InputPassword as Ee,Field as Q,Checkbox as X}from"@dropins/tools/components.js";import{S as Se}from"./SkeletonLoader.js";import{E as we}from"./EmailConfirmationForm.js";import{useText as ve}from"@dropins/tools/i18n.js";const se=(e,t)=>t!=null&&t.length?e.map(s=>{var r;const a=(r=t.find(({code:y})=>y===s.code))==null?void 0:r.defaultValue;return a?{...s,defaultValue:a}:s}):e,Me=({inputsDefaultValueSet:e,fieldsConfigForApiVersion1:t,apiVersion2:s})=>{const[a,r]=b([]);return he(()=>{(async()=>{if(s){const u=await fe("customer_account_create");if(u!=null&&u.length)if(e!=null&&e.length){const m=se(u,e);r(m)}else r(u)}else{const u=ee(pe),m=ee(t),h=se(u,e);r(t&&t.length?m:h)}})()},[s,t,e]),{fieldsListConfigs:a}},Ae=e=>{switch(e){case"true":case"on":return!0;case"false":case"off":return!1;default:return e}},qe=(e,t)=>{if(!t)return e;const s={};s.custom_attributes=[];for(const a in e)Object.prototype.hasOwnProperty.call(Fe,a)?s[a]=e[a]:s.custom_attributes.push({attribute_code:a,value:Ae(e[a])});return s},Ce=({addressesData:e,translations:t,isEmailConfirmationRequired:s,apiVersion2:a=!0,passwordConfigs:r,isAutoSignInEnabled:y,routeRedirectOnSignIn:u,routeSignIn:m,onErrorCallback:h,onSuccessCallback:n,setActiveComponent:l,handleSetInLineAlertProps:f,routeRedirectOnEmailConfirmationClose:x})=>{const[O,w]=b(""),[p,o]=b(!1),[c,T]=b({userName:"",status:!1}),[v,d]=b(""),[M,A]=b(!1),[V,F]=b(!1),[q,C]=b(!0),P=G(({target:U})=>{C(U.checked)},[]),I=G(()=>{if(H(l)){l("signInForm");return}H(m)&&(window.location.href=m())},[l,m]),W=G(U=>{d(U)},[]),j=G(()=>{f({}),d(""),H(x)?window.location.href=x():(o(!1),l==null||l("signInForm"))},[f,x,l]);return{isKeepMeLogged:q,userEmail:O,showEmailConfirmationForm:p,isSuccessful:c,isClickSubmit:M,signUpPasswordValue:v,isLoading:V,onSubmitSignUp:async(U,$)=>{var Z,z,D;if(f({}),F(!0),!$){A(!0),F(!1);return}const B=a?"createCustomerV2":"createCustomer",_=Te(U.target),{email:E,password:S,is_subscribed:ae}=_,oe=(r==null?void 0:r.requiredCharacterClasses)||0,ue=(r==null?void 0:r.minLength)||1;if(!Ue(S,oe)||ue>(S==null?void 0:S.length)){A(!0),F(!1);return}const ne=qe({..._,is_subscribed:!!ae||!1},a),{data:N,errors:L}=await de(ne,a),K=((z=(Z=N==null?void 0:N.createCustomer)==null?void 0:Z.customer)==null?void 0:z.firstname)||"";if(L&&(L!=null&&L.length))f==null||f({type:"error",text:L[0].message}),h==null||h(L),te(re.CREATE_ACCOUNT_EVENT,{updateProfile:!1}),w(E);else{const J={email:"",...N==null?void 0:N[B]};if(te(re.CREATE_ACCOUNT_EVENT,{email:J==null?void 0:J.email,updateProfile:!0}),s||!y){if(n==null||n({userName:K,status:!0}),s){(D=U.target)==null||D.reset(),d(""),o(!0),w(E),F(!1);return}if(!y){F(!1),T({userName:K,status:!0});return}}const g=await _e({email:E,password:S,translations:t,handleSetInLineAlertProps:f,onErrorCallback:h});if(g!=null&&g.userName){if(e!=null&&e.length)for(const R of e)try{await ge(R)}catch(me){console.error(t.failedCreateCustomerAddress,R,me)}H(u)?window.location.href=u():(n==null||n({userName:g==null?void 0:g.userName,status:!0}),T({userName:g==null?void 0:g.userName,status:!0}))}else n==null||n({userName:K,status:!0}),T({userName:K,status:!0})}F(!1)},signInButton:I,handleSetSignUpPasswordValue:W,onKeepMeLoggedChange:P,handleHideEmailConfirmationForm:j}},Ze=({addressesData:e,formSize:t="default",inputsDefaultValueSet:s,fieldsConfigForApiVersion1:a,apiVersion2:r=!0,isAutoSignInEnabled:y=!0,displayTermsOfUseCheckbox:u=!1,displayNewsletterCheckbox:m=!1,hideCloseBtnOnEmailConfirmation:h=!1,routeRedirectOnEmailConfirmationClose:n,routeRedirectOnSignIn:l,routeSignIn:f,onErrorCallback:x,onSuccessCallback:O,setActiveComponent:w,slots:p})=>{const o=ve({title:"Auth.SignUpForm.title",buttonPrimary:"Auth.SignUpForm.buttonPrimary",buttonSecondary:"Auth.SignUpForm.buttonSecondary",privacyPolicyDefaultText:"Auth.SignUpForm.privacyPolicyDefaultText",subscribedDefaultText:"Auth.SignUpForm.subscribedDefaultText",keepMeLoggedText:"Auth.SignUpForm.keepMeLoggedText",customerTokenErrorMessage:"Auth.Api.customerTokenErrorMessage",failedCreateCustomerAddress:"Auth.SignUpForm.failedCreateCustomerAddress",placeholder:"Auth.InputPassword.placeholder",floatingLabel:"Auth.InputPassword.floatingLabel"}),{passwordConfigs:c,isEmailConfirmationRequired:T}=be(),{fieldsListConfigs:v}=Me({fieldsConfigForApiVersion1:a,apiVersion2:r,inputsDefaultValueSet:s}),{inLineAlertProps:d,handleSetInLineAlertProps:M}=Ne(),{isKeepMeLogged:A,userEmail:V,showEmailConfirmationForm:F,isSuccessful:q,isClickSubmit:C,signUpPasswordValue:P,isLoading:I,onSubmitSignUp:W,signInButton:j,handleSetSignUpPasswordValue:Y,onKeepMeLoggedChange:U,handleHideEmailConfirmationForm:$}=Ce({addressesData:e,translations:o,isEmailConfirmationRequired:T,apiVersion2:r,passwordConfigs:c,isAutoSignInEnabled:y,routeRedirectOnSignIn:l,routeSignIn:f,onErrorCallback:x,onSuccessCallback:O,setActiveComponent:w,handleSetInLineAlertProps:M,routeRedirectOnEmailConfirmationClose:n}),{isValidUniqueSymbols:B,defaultLengthMessage:_}=ye({password:P,isClickSubmit:C,passwordConfigs:c}),E=!T&&(e==null?void 0:e.length);return!v.length&&r?i("div",{className:`auth-signUpForm ${t} skeleton-loader`,"data-testid":"SignUpForm",children:i(Se,{activeSkeleton:"signUpForm"})}):q.status&&(p!=null&&p.SuccessNotification)?i(ce,{"data-testid":"successNotificationTestId",name:"SuccessNotification",slot:p==null?void 0:p.SuccessNotification,context:{isSuccessful:q}}):F?i(we,{formSize:t,userEmail:V,inLineAlertProps:d,hideCloseBtnOnEmailConfirmation:h,handleSetInLineAlertProps:M,onPrimaryButtonClick:$}):k("div",{className:le(["auth-signUpForm",t]),"data-testid":"SignUpForm",children:[i(Le,{text:o.title,bottomLine:!1,className:"auth-signUpForm__title"}),d.text?i(Pe,{className:"auth-signUpForm__notification",type:d.type,variant:"secondary",heading:d.text,icon:d.icon}):null,k(xe,{submitCallback:W,className:"auth-signUpForm__form",isLoading:I,name:"signUp_form",fieldsConfig:v,children:[i(Ee,{validateLengthConfig:_,className:"auth-signUpForm__form__field",autoComplete:"current-password",name:"password",minLength:c==null?void 0:c.minLength,error:B==="error"||(_==null?void 0:_.status)==="error"||C&&P.length<=0,defaultValue:P,uniqueSymbolsStatus:B,requiredCharacterClasses:c==null?void 0:c.requiredCharacterClasses,onValue:Y,placeholder:o.placeholder,floatingLabel:o.floatingLabel,children:E?i("div",{className:"auth-signUpForm__automatic-login",children:i(Q,{children:i(X,{name:"",placeholder:o.keepMeLoggedText,label:o.keepMeLoggedText,checked:A,onChange:U})})}):null}),m||u?k("div",{className:"auth-signUpForm__item auth-signUpForm__checkbox",children:[m?i(Q,{children:i(X,{"data-testid":"isSubscribed",name:"is_subscribed",placeholder:o.subscribedDefaultText,label:o.subscribedDefaultText})}):null,u?i(Q,{children:i(X,{"data-testid":"privacyPolicy",name:"privacyPolicy",placeholder:o.privacyPolicyDefaultText,label:o.privacyPolicyDefaultText})}):null]}):null,k("div",{className:"auth-signUpForm-buttons",children:[i(ie,{type:"button",variant:"tertiary",style:{padding:0},buttonText:o.buttonSecondary,enableLoader:!1,onClick:j}),i(ie,{type:"submit",buttonText:o.buttonPrimary,variant:"primary",enableLoader:I})]})]}),i("div",{id:"createCustomerV2"})]})};export{Ze as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as
|
|
1
|
+
import{f as a,h as s}from"./network-error.js";import{s as n}from"./setReCaptchaToken.js";import{t as i}from"./transform-attributes-form.js";import{h as o}from"./getStoreConfig.js";const u=`
|
|
2
2
|
mutation CREATE_CUSTOMER($input: CustomerInput!) {
|
|
3
3
|
createCustomer(input: $input) {
|
|
4
4
|
customer {
|
|
@@ -20,7 +20,7 @@ import{f as s,h as a}from"./network-error.js";import{s as n}from"./setReCaptchaT
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
`,
|
|
23
|
+
`,p=async(r,t)=>(await n(),await a(t?m:u,{method:"POST",variables:{input:{...r}}}).catch(s)),c=`
|
|
24
24
|
query GET_ATTRIBUTES_FORM($formCode: String!) {
|
|
25
25
|
attributesForm(formCode: $formCode) {
|
|
26
26
|
items {
|
|
@@ -37,6 +37,14 @@ import{f as s,h as a}from"./network-error.js";import{s as n}from"./setReCaptchaT
|
|
|
37
37
|
label
|
|
38
38
|
value
|
|
39
39
|
}
|
|
40
|
+
... on CustomerAttributeMetadata {
|
|
41
|
+
multiline_count
|
|
42
|
+
sort_order
|
|
43
|
+
validate_rules {
|
|
44
|
+
name
|
|
45
|
+
value
|
|
46
|
+
}
|
|
47
|
+
}
|
|
40
48
|
}
|
|
41
49
|
errors {
|
|
42
50
|
type
|
|
@@ -44,10 +52,10 @@ import{f as s,h as a}from"./network-error.js";import{s as n}from"./setReCaptchaT
|
|
|
44
52
|
}
|
|
45
53
|
}
|
|
46
54
|
}
|
|
47
|
-
`,
|
|
55
|
+
`,T=async r=>await a(c.replace(/\s+/g," ").trim(),{method:"GET",cache:"force-cache",variables:{formCode:r}}).then(t=>{var e;return(e=t.errors)!=null&&e.length?o(t.errors):i(t)}).catch(s),d=`
|
|
48
56
|
mutation CREATE_CUSTOMER_ADDRESS($input: CustomerAddressInput!) {
|
|
49
57
|
createCustomerAddress(input:$input) {
|
|
50
58
|
firstname
|
|
51
59
|
}
|
|
52
60
|
}
|
|
53
|
-
`,f=async r=>await
|
|
61
|
+
`,f=async r=>await a(d,{method:"POST",variables:{input:r}}).then(t=>{var e;return(e=t.errors)!=null&&e.length?o(t.errors):t.data.createCustomerAddress.firstname||""}).catch(s);export{f as a,p as c,T as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t
|
|
1
|
+
import{t}from"./transform-attributes-form.js";const n=[{code:"email",default_value:"",entity_type:"CUSTOMER",frontend_class:"auth-signInForm__form__email",frontend_input:"TEXT",is_required:!0,multiline_count:1,sort_order:1,is_unique:!1,label:"Email",options:[]}],_=[{code:"email",default_value:"",entity_type:"CUSTOMER",frontend_class:"auth-resetPasswordForm__form__item",frontend_input:"TEXT",is_required:!0,is_unique:!1,label:"Email",options:[]}],a=[{code:"email",default_value:"",entity_type:"CUSTOMER",frontend_class:"",frontend_input:"TEXT",is_required:!0,is_unique:!1,label:"Email",multiline_count:1,sort_order:1,options:[]},{code:"firstname",default_value:"",entity_type:"CUSTOMER",frontend_class:"",frontend_input:"TEXT",is_required:!0,is_unique:!1,label:"First name",multiline_count:1,sort_order:2,options:[]},{code:"lastname",default_value:"",entity_type:"CUSTOMER",frontend_class:"",frontend_input:"TEXT",is_required:!1,is_unique:!1,label:"Last name",multiline_count:1,sort_order:3,options:[]}],i={date_of_birth:"",dob:"",email:"",firstname:"",gender:"",is_subscribed:"",lastname:"",middlename:"",password:"",prefix:"",suffix:"",taxvat:""},o=e=>e!=null&&e.length?t({data:{attributesForm:{items:e}}}):[];export{_ as D,n as a,a as b,i as c,o as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const $=u=>{let i=[];return u.forEach(t=>{if(t.fieldType!=="MULTILINE"&&t.multilineCount<2)return null;for(let r=2;r<=t.multilineCount;r++){const e={...t,name:`${t.code}_${r}`,code:`${t.code}_${r}`,id:`${t.code}_${r}`};i.push(e)}}),i},b=u=>{var e,l,a;const i=((l=(e=u==null?void 0:u.data)==null?void 0:e.attributesForm)==null?void 0:l.items)||[];if(!i.length)return[];const t=(a=i.filter(n=>{var o;return!((o=n.frontend_input)!=null&&o.includes("HIDDEN"))}))==null?void 0:a.map(({default_value:n,frontend_input:o,frontend_class:s,is_required:m,multiline_count:f,sort_order:y,code:c,is_unique:_,entity_type:I,...N})=>{const d=c==="country_id";return{...N,entityType:I,unique:_,defaultValue:n??"",fieldType:o,className:s??"",required:!!m,orderNumber:+y,multilineCount:f??0,name:d?"country_code":c,id:d?"country_code":c,code:d?"country_code":c}}),r=$(t);return t.concat(r).sort((n,o)=>n.orderNumber-o.orderNumber)};export{b as t};
|
package/chunks/useInLineAlert.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as _,jsx as d,Fragment as k}from"@dropins/tools/preact-jsx-runtime.js";import{useCallback as b,useRef as g,useState as v,useEffect as x}from"@dropins/tools/preact-hooks.js";import{classes as I}from"@dropins/tools/lib.js";import{Button as S,Field as M,Picker as V,Input as O,InputDate as R,Checkbox as y,TextArea as H}from"@dropins/tools/components.js";import{initReCaptcha as P}from"@dropins/tools/recaptcha.js";import{useText as q}from"@dropins/tools/i18n.js";import*as f from"@dropins/tools/preact-compat.js";import{memo as U,useCallback as N}from"@dropins/tools/preact-compat.js";const ee=r=>{if(!r)return null;const c=new FormData(r);if(c&&typeof c.entries=="function"){const u=c.entries();if(u&&typeof u[Symbol.iterator]=="function")return JSON.parse(JSON.stringify(Object.fromEntries(u)))||{}}return{}},re=r=>typeof r=="function",te=({type:r,buttonText:c,variant:u,className:l="",enableLoader:o=!1,onClick:s,style:h,icon:n,...p})=>{const $=b(T=>{s==null||s(T)},[s]);return _(S,{icon:n,style:h,type:r,variant:u,className:I(["auth-button",l,o?"enableLoader":""]),onClick:$,...p,children:[d("span",{className:"auth-button__text",children:c}),o?d("div",{className:"auth-button__loader-wrapper",children:d("span",{className:"auth-button__loader"})}):null]})},W=r=>r.reduce((c,{code:u,required:l,defaultValue:o})=>(l&&(c[u]=o),c),{}),G=({fieldsConfig:r,submitCallback:c})=>{const{requiredFieldError:u}=q({requiredFieldError:"Auth.FormText.requiredFieldError"}),l=g(null),[o,s]=v({}),[h,n]=v({});x(()=>{if(!r.length)return;const E=W(r);s(E)},[r==null?void 0:r.length]);const p=b((E,e)=>{const t=r.find(i=>i.code===E);return t!=null&&t.required&&!e?u:""},[r,u]),$=b(E=>{const{name:e,value:t,type:a,checked:i}=E==null?void 0:E.target,w=a==="checkbox"?i:t;s(D=>({...D,[e]:w}))},[]);x(()=>{P()},[]);const A=b(E=>{const{name:e,value:t,type:a,checked:i}=E==null?void 0:E.target,w=a==="checkbox"?i:t;n(D=>({...D,[e]:p(e,w)}))},[p]),T=b(E=>{E.preventDefault();let e=!0,t={},a=null;for(const[i,w]of Object.entries(o)){const D=p(i,w);D&&(t[i]=D,e=!1,a||(a=i))}if(n(t),a&&l.current){const i=l.current.elements.namedItem(a);i==null||i.focus()}c==null||c(E,e)},[o,p,c]);return{formData:o,errors:h,formRef:l,handleChange:$,handleBlur:A,handleSubmit:T}};var L=(r=>(r.BOOLEAN="BOOLEAN",r.DATE="DATE",r.DATETIME="DATETIME",r.DROPDOWN="DROPDOWN",r.FILE="FILE",r.GALLERY="GALLERY",r.HIDDEN="HIDDEN",r.IMAGE="IMAGE",r.MEDIA_IMAGE="MEDIA_IMAGE",r.MULTILINE="MULTILINE",r.MULTISELECT="MULTISELECT",r.PRICE="PRICE",r.SELECT="SELECT",r.TEXT="TEXT",r.TEXTAREA="TEXTAREA",r.UNDEFINED="UNDEFINED",r.VISUAL="VISUAL",r.WEIGHT="WEIGHT",r.EMPTY="",r))(L||{});const C=U(({loading:r,values:c,fields:u=[],errors:l,className:o="",onChange:s,onBlur:h})=>{const n=`${o}__field`,p=N((e,t,a)=>d(M,{error:a,className:I([n,`${n}--${e.id}`,[`${n}--${e.id}-hidden`,e.hidden],e.className]),"data-testid":`${o}--${e.id}`,disabled:r,children:d(V,{name:e.id,floatingLabel:`${e.label} ${e.required?"*":""}`,placeholder:e.label,"aria-label":e.label,options:e.options,onBlur:h,handleSelect:s,value:t||e.defaultValue})},e.id),[o,r,n,h,s]),$=N((e,t,a)=>d(M,{error:a,className:I([n,`${n}--${e.id}`,[`${n}--${e.id}-hidden`,e.hidden],e.className]),"data-testid":`${o}--${e.id}`,disabled:r,children:d(O,{type:"text",name:e.id,value:t===void 0?e.defaultValue:t,placeholder:e.label,floatingLabel:`${e.label} ${e.required?"*":""}`,onBlur:h,onChange:s})},e.id),[o,r,n,h,s]),A=N((e,t,a)=>d(M,{error:a,className:I([n,`${n}--${e.id}`,[`${n}--${e.id}-hidden`,e.hidden],e.className]),"data-testid":`${o}--${e.id}`,disabled:r,children:d(R,{type:"text",name:e.id,value:t||e.defaultValue,placeholder:e.label,floatingLabel:`${e.label} ${e.required?"*":""}`,onBlur:h,onChange:s})},e.id),[o,r,n,h,s]),T=N((e,t,a)=>d(M,{error:a,className:I([n,`${n}--${e.id}`,[`${n}--${e.id}-hidden`,e.hidden],e.className]),"data-testid":`${o}--${e.id}`,disabled:r,children:d(y,{name:e.id,checked:t||e.defaultValue,placeholder:e.label,label:`${e.label} ${e.required?"*":""}`,onBlur:h,onChange:s})},e.id),[o,r,n,h,s]),E=N((e,t,a)=>d(M,{error:a,className:I([n,`${n}--${e.id}`,[`${n}--${e.id}-hidden`,e.hidden],e.className]),"data-testid":`${o}--${e.id}`,disabled:r,children:d(H,{type:"text",name:e.id,value:t===void 0?e.defaultValue:t,label:`${e.label} ${e.required?"*":""}`,onBlur:h,onChange:s})},e.id),[o,r,n,h,s]);return u.length?d(k,{children:u.map(e=>{const t=(l==null?void 0:l[e.id])??void 0,a=(c==null?void 0:c[e.id])??void 0;switch(e.fieldType){case L.TEXT:return e.options.length?p(e,a,t):$(e,a,t);case L.MULTILINE:return $(e,a,t);case L.SELECT:return p(e,a,t);case L.DATE:return A(e,a,t);case L.BOOLEAN:return T(e,a,t);case"TEXTAREA":return E(e,a,t);default:return null}})}):null}),ne=({name:r,isLoading:c,children:u,className:l="defaultForm",fieldsConfig:o=[],submitCallback:s})=>{const{formData:h,errors:n,formRef:p,handleChange:$,handleBlur:A,handleSubmit:T}=G({submitCallback:s,fieldsConfig:o});return _("form",{onSubmit:T,className:l,name:r,ref:p,children:[d(C,{fields:o,onChange:$,onBlur:A,errors:n,values:h,className:l,isLoading:c}),u]})},ae=({children:r,text:c,bottomLine:u=!0,className:l})=>_("div",{className:I(["auth-title",l]),"data-testid":"auth-title_id",children:[_("div",{className:"auth-title__text",children:[d("h1",{className:"auth-title__heading",children:c}),r]}),u?d("div",{className:"auth-title__hr"}):null]}),Z=r=>f.createElement("svg",{id:"Icon_Warning_Base",width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},f.createElement("g",{clipPath:"url(#clip0_841_1324)"},f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),f.createElement("defs",null,f.createElement("clipPath",{id:"clip0_841_1324"},f.createElement("rect",{width:24,height:21,fill:"white",transform:"translate(0 1.5)"})))),B=r=>f.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.75 12.762L10.2385 15.75L17.25 9",stroke:"currentColor"})),X=r=>f.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),f.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),j={success:d(B,{}),warning:d(Z,{}),error:d(X,{})},oe=()=>{const[r,c]=v({}),u=b(l=>{if(!l||!l.type)return;const o=j[l.type];c({...l,icon:o})},[]);return{inLineAlertProps:r,handleSetInLineAlertProps:u}};export{te as B,ne as F,ae as T,re as c,ee as g,oe as u};
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { FunctionComponent } from 'preact';
|
|
2
|
+
import { FormInputsProps } from '../../../types';
|
|
2
3
|
|
|
3
|
-
export interface FormInputsProps {
|
|
4
|
-
className?: string;
|
|
5
|
-
errors?: Record<string, string>;
|
|
6
|
-
values?: Record<string, unknown>;
|
|
7
|
-
fields?: any;
|
|
8
|
-
isLoading?: boolean;
|
|
9
|
-
onChange?: (event: Event) => void;
|
|
10
|
-
onBlur?: (event: Event) => void;
|
|
11
|
-
}
|
|
12
4
|
export declare const FormInputs: FunctionComponent<FormInputsProps>;
|
|
13
5
|
//# sourceMappingURL=FormInputs.d.ts.map
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
entity_type: string;
|
|
5
|
-
frontend_class: string;
|
|
6
|
-
frontend_input: string;
|
|
7
|
-
is_required: boolean;
|
|
8
|
-
is_unique: boolean;
|
|
9
|
-
label: string;
|
|
10
|
-
options: any[];
|
|
1
|
+
import { getAttributesFormItems } from '../types';
|
|
2
|
+
|
|
3
|
+
export interface SignUpFieldsProps extends getAttributesFormItems {
|
|
11
4
|
}
|
|
12
5
|
export declare const DEFAULT__SIGN_IN_EMAIL_FIELD: SignUpFieldsProps[];
|
|
13
6
|
export declare const DEFAULT__RESET_PASSWORD_EMAIL_FIELD: Record<string, string | boolean | unknown>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i,jsxs as
|
|
1
|
+
import{jsx as i,jsxs as G}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as X,classes as Y}from"@dropins/tools/lib.js";import{v as Z,u as $,a as k}from"../chunks/usePasswordValidationMessage.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{a as W}from"../chunks/getCustomerToken.js";import{r as S}from"../chunks/resetPassword.js";import{c as g,g as C,u as O,T as R,F as tt,B as et}from"../chunks/useInLineAlert.js";import{useState as w,useEffect as z,useCallback as E}from"@dropins/tools/preact-hooks.js";import{useText as I}from"@dropins/tools/i18n.js";import{InLineAlert as at,InputPassword as st}from"@dropins/tools/components.js";import"../chunks/getStoreConfig.js";import"../chunks/network-error.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/initialize.js";import"../chunks/setReCaptchaToken.js";import"@dropins/tools/preact-compat.js";const H=(u,c)=>u.split("&").filter(e=>e.includes(c)).map(e=>e.split("=")[1])[0],rt=({isEmailConfirmationRequired:u,signInOnSuccess:c,passwordConfigs:s,routeRedirectOnSignIn:e,routeWrongUrlRedirect:r,onErrorCallback:d,onSuccessCallback:o,handleSetInLineAlertProps:m,routeRedirectOnPasswordUpdate:p})=>{const a=I({errorNotification:"Auth.Notification.errorNotification",updatePasswordMessage:"Auth.Notification.updatePasswordMessage",updatePasswordActionMessage:"Auth.Notification.updatePasswordActionMessage",customerTokenErrorMessage:"Auth.Api.customerTokenErrorMessage"}),[v,A]=w({userName:"",status:!1}),[y,L]=w(""),[F,x]=w(!1),[h,U]=w(""),[P,T]=w(""),[b,n]=w(!1),[N,_]=w(!1),[M,j]=w([]);z(()=>{F&&!M.length&&(y.length?_(!1):_(!0))},[F,y,M]),z(()=>{const{search:f}=window.location;!f.includes("token=")&&!f.includes("email=")&&g(r)&&(window.location.href=r());const t=decodeURIComponent(f),q=H(t,"token"),V=H(t,"email");U(V),T(q)},[r]);const J=E(async f=>{f.preventDefault(),n(!0),j([]);const t=C(f.target),q=(t==null?void 0:t.password)&&h&&P;t!=null&&t.password||(_(!0),n(!1));const V=(s==null?void 0:s.requiredCharacterClasses)??0,Q=(s==null?void 0:s.minLength)??0;if(!Z(t==null?void 0:t.password,V)||t.password.length<+Q){x(!0),n(!1);return}if(!q){m({type:"error",text:a.errorNotification}),n(!1);return}const{message:B,success:D}=await S(h,P,t.password);if(D){if(u||!u&&!c){o==null||o(),g(p)&&(window.location.href=p()),x(!0),n(!1),_(!1),L(""),j([{label:a.updatePasswordActionMessage,onClick:()=>{window.location.href=e==null?void 0:e()}}]),m({type:"success",text:a.updatePasswordMessage});return}const l=await W({email:h,password:t.password,handleSetInLineAlertProps:m,onErrorCallback:d,translations:a});l!=null&&l.userName&&(o==null||o(l==null?void 0:l.userName),g(e)?window.location.href=e():A({userName:l==null?void 0:l.userName,status:!0}))}else m({type:"error",text:B}),d==null||d({message:B,success:D});n(!1)},[h,P,a,c,s,u,e,m,p,d,o]),K=E(f=>{L(f)},[]);return{additionalActionsAlert:M,passwordError:N,isSuccessful:v,updatePasswordValue:y,isClickSubmit:F,isLoading:b,submitUpdatePassword:J,handleSetUpdatePasswordValue:K}},ot=({signInOnSuccess:u=!0,formSize:c="default",routeRedirectOnSignIn:s,routeWrongUrlRedirect:e,slots:r,onErrorCallback:d,onSuccessCallback:o,routeRedirectOnPasswordUpdate:m})=>{const p=I({title:"Auth.UpdatePasswordForm.title",buttonPrimary:"Auth.UpdatePasswordForm.buttonPrimary",placeholder:"Auth.InputPassword.placeholder",floatingLabel:"Auth.InputPassword.floatingLabel"}),{passwordConfigs:a,isEmailConfirmationRequired:v}=$(),{inLineAlertProps:A,handleSetInLineAlertProps:y}=O(),{additionalActionsAlert:L,passwordError:F,isSuccessful:x,updatePasswordValue:h,isClickSubmit:U,isLoading:P,submitUpdatePassword:T,handleSetUpdatePasswordValue:b}=rt({isEmailConfirmationRequired:v,signInOnSuccess:u,passwordConfigs:a,routeRedirectOnSignIn:s,routeWrongUrlRedirect:e,onErrorCallback:d,onSuccessCallback:o,handleSetInLineAlertProps:y,routeRedirectOnPasswordUpdate:m}),{isValidUniqueSymbols:n,defaultLengthMessage:N}=k({password:h,isClickSubmit:U,passwordConfigs:a});return x.status&&(r!=null&&r.SuccessNotification)?i(X,{"data-testid":"successNotificationTestId",name:"SuccessNotification",slot:r==null?void 0:r.SuccessNotification,context:{isSuccessful:x}}):G("div",{className:Y(["auth-updatePasswordForm",c]),children:[i(R,{text:p.title,bottomLine:!1,className:"auth-updatePasswordForm__title"}),A.text?i(at,{className:"auth-updatePasswordForm__notification",variant:"secondary",heading:A.text,icon:A.icon,additionalActions:L}):null,G(tt,{name:"updatePassword_form",className:"auth-updatePasswordForm__form",submitCallback:T,isLoading:P,fieldsConfig:[],children:[i("div",{style:"display: none;",children:i("input",{type:"text",id:"username",name:"username",autoComplete:"username"})}),i(st,{defaultValue:h,onValue:b,className:"auth-updatePasswordForm__form__item",autoComplete:"new-password",name:"password",error:F||n==="error"||(N==null?void 0:N.status)==="error",minLength:a==null?void 0:a.minLength,uniqueSymbolsStatus:n,validateLengthConfig:N,requiredCharacterClasses:a==null?void 0:a.requiredCharacterClasses,placeholder:p.placeholder,floatingLabel:p.floatingLabel}),i("div",{className:"auth-updatePasswordForm__button",children:i(et,{type:"submit",buttonText:p.buttonPrimary,variant:"primary",enableLoader:P})})]})]})},Lt=({slots:u,formSize:c,signInOnSuccess:s,routeRedirectOnPasswordUpdate:e,routeRedirectOnSignIn:r,routeWrongUrlRedirect:d,onErrorCallback:o,onSuccessCallback:m})=>i("div",{className:"auth-update-password",children:i(ot,{formSize:c,signInOnSuccess:s,routeRedirectOnSignIn:r,routeWrongUrlRedirect:d,onErrorCallback:o,onSuccessCallback:m,slots:u,routeRedirectOnPasswordUpdate:e})});export{Lt as UpdatePassword,Lt as default};
|
|
@@ -1,25 +1,44 @@
|
|
|
1
|
+
export declare enum FieldEnumList {
|
|
2
|
+
BOOLEAN = "BOOLEAN",
|
|
3
|
+
DATE = "DATE",
|
|
4
|
+
DATETIME = "DATETIME",
|
|
5
|
+
DROPDOWN = "DROPDOWN",
|
|
6
|
+
FILE = "FILE",
|
|
7
|
+
GALLERY = "GALLERY",
|
|
8
|
+
HIDDEN = "HIDDEN",
|
|
9
|
+
IMAGE = "IMAGE",
|
|
10
|
+
MEDIA_IMAGE = "MEDIA_IMAGE",
|
|
11
|
+
MULTILINE = "MULTILINE",
|
|
12
|
+
MULTISELECT = "MULTISELECT",
|
|
13
|
+
PRICE = "PRICE",
|
|
14
|
+
SELECT = "SELECT",
|
|
15
|
+
TEXT = "TEXT",
|
|
16
|
+
TEXTAREA = "TEXTAREA",
|
|
17
|
+
UNDEFINED = "UNDEFINED",
|
|
18
|
+
VISUAL = "VISUAL",
|
|
19
|
+
WEIGHT = "WEIGHT",
|
|
20
|
+
EMPTY = ""
|
|
21
|
+
}
|
|
1
22
|
export interface AttributesFormItemsProps {
|
|
2
|
-
code
|
|
3
|
-
name
|
|
4
|
-
id
|
|
5
|
-
defaultValue
|
|
6
|
-
|
|
7
|
-
className
|
|
8
|
-
fieldType
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
23
|
+
code?: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
id?: string;
|
|
26
|
+
defaultValue?: string | boolean | number;
|
|
27
|
+
entityType?: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
fieldType?: FieldEnumList;
|
|
30
|
+
multilineCount: number;
|
|
31
|
+
required?: boolean;
|
|
32
|
+
unique?: boolean;
|
|
33
|
+
label?: string;
|
|
12
34
|
orderNumber: number;
|
|
13
|
-
options
|
|
35
|
+
options?: {
|
|
14
36
|
is_default: boolean;
|
|
15
37
|
label: string;
|
|
16
38
|
value: string;
|
|
17
39
|
}[];
|
|
40
|
+
hidden?: boolean;
|
|
18
41
|
}
|
|
19
|
-
export interface AttributesFormModel {
|
|
20
|
-
fields?: AttributesFormItemsProps[];
|
|
21
|
-
errors?: {
|
|
22
|
-
message: string;
|
|
23
|
-
}[];
|
|
42
|
+
export interface AttributesFormModel extends AttributesFormItemsProps {
|
|
24
43
|
}
|
|
25
44
|
//# sourceMappingURL=attributes-form.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getAttributesFormResponse } from '../../types';
|
|
2
2
|
import { AttributesFormModel } from '../models';
|
|
3
3
|
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const cloneArrayIfExists: (fields: AttributesFormModel[]) => any;
|
|
5
|
+
export declare const transformAttributesForm: (response: getAttributesFormResponse) => AttributesFormModel[];
|
|
5
6
|
//# sourceMappingURL=transform-attributes-form.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { useSignInFormProps } from '../../types';
|
|
1
|
+
import { AdditionalActionsAlertProps, useSignInFormProps } from '../../types';
|
|
2
2
|
|
|
3
3
|
export declare const useSignInForm: ({ emailConfirmationStatusMessage, translations, initialEmailValue, routeSignUp, routeForgotPassword, routeRedirectOnSignIn, onErrorCallback, setActiveComponent, onSuccessCallback, onSignUpLinkClick, handleSetInLineAlertProps, routeRedirectOnEmailConfirmationClose, }: useSignInFormProps) => {
|
|
4
|
+
additionalActionsAlert: AdditionalActionsAlertProps;
|
|
4
5
|
userEmail: string;
|
|
5
6
|
defaultEnhancedEmailFields: any;
|
|
6
7
|
passwordError: boolean;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { UseUpdatePasswordFormProps } from '../../types';
|
|
1
|
+
import { AdditionalActionsAlertProps, UseUpdatePasswordFormProps } from '../../types';
|
|
2
2
|
|
|
3
3
|
export declare const useUpdatePasswordForm: ({ isEmailConfirmationRequired, signInOnSuccess, passwordConfigs, routeRedirectOnSignIn, routeWrongUrlRedirect, onErrorCallback, onSuccessCallback, handleSetInLineAlertProps, routeRedirectOnPasswordUpdate, }: UseUpdatePasswordFormProps) => {
|
|
4
|
+
additionalActionsAlert: AdditionalActionsAlertProps;
|
|
5
|
+
passwordError: boolean;
|
|
4
6
|
isSuccessful: {
|
|
5
7
|
userName: string;
|
|
6
8
|
status: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InLineAlertInterface } from '../types';
|
|
2
2
|
|
|
3
3
|
export declare const useInLineAlert: () => {
|
|
4
|
-
inLineAlertProps:
|
|
5
|
-
handleSetInLineAlertProps: (notification:
|
|
4
|
+
inLineAlertProps: InLineAlertInterface;
|
|
5
|
+
handleSetInLineAlertProps: (notification: InLineAlertInterface | undefined) => void;
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=useInLineAlert.d.ts.map
|
package/i18n/en_US.json.d.ts
CHANGED
|
@@ -44,12 +44,12 @@ declare const _default: {
|
|
|
44
44
|
},
|
|
45
45
|
"Notification": {
|
|
46
46
|
"errorNotification": "Your password update failed due to validation errors. Please check your information and try again.",
|
|
47
|
-
"updatePasswordMessage": "The password has been updated.
|
|
47
|
+
"updatePasswordMessage": "The password has been updated.",
|
|
48
|
+
"updatePasswordActionMessage": "Sign in",
|
|
48
49
|
"successPasswordResetEmailNotification": "If there is an account associated with {email} you will receive an email with a link to reset your password.",
|
|
49
50
|
"resendEmailNotification": {
|
|
50
51
|
"informationText": "This account is not confirmed.",
|
|
51
|
-
"buttonText": "
|
|
52
|
-
"additionalText": "to resend confirmation email."
|
|
52
|
+
"buttonText": "Resend confirmation email"
|
|
53
53
|
},
|
|
54
54
|
"emailConfirmationMessage": "Please check your email for confirmation link.",
|
|
55
55
|
"technicalErrors": {
|
|
@@ -64,6 +64,10 @@ declare const _default: {
|
|
|
64
64
|
},
|
|
65
65
|
"Api": {
|
|
66
66
|
"customerTokenErrorMessage": "Unable to log in. Please try again later or contact support if the issue persists."
|
|
67
|
+
},
|
|
68
|
+
"InputPassword": {
|
|
69
|
+
"placeholder": "Password",
|
|
70
|
+
"floatingLabel": "Password *"
|
|
67
71
|
}
|
|
68
72
|
}
|
|
69
73
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const simplifyTransformAttributesForm: (defaultSignUpFields: any) => import('../data/models').
|
|
1
|
+
export declare const simplifyTransformAttributesForm: (defaultSignUpFields: any) => import('../data/models').AttributesFormModel[];
|
|
2
2
|
//# sourceMappingURL=simplifyTransformAttributesForm.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-alpha13", "@dropins/elsie": "0.27.1-alpha591"}
|
package/render.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function(n,i){try{if(typeof document<"u"){const a=document.createElement("style"),o=i.styleId;for(const t in i.attributes)a.setAttribute(t,i.attributes[t]);a.setAttribute("data-dropin",o),a.appendChild(document.createTextNode(n));const r=document.querySelector('style[data-dropin="sdk"]');if(r)r.after(a);else{const t=document.querySelector('link[rel="stylesheet"], style');t?t.before(a):document.head.append(a)}}}catch(a){console.error("dropin-styles (injectCodeFunction)",a)}})(`.auth-successNotificationForm{display:flex;justify-content:center;align-items:center;flex-direction:column;border-radius:var(--shape-border-radius-2);background:var(--color-neutral-50, #fff);padding:var(--spacing-xbig) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-successNotificationForm{padding:var(--spacing-big) var(--spacing-xbig) var(--spacing-xxbig) var(--spacing-xbig)}}.auth-successNotificationForm.small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-successNotificationForm__title{color:var(--color-neutral-800, #2b2b2b);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-details-caption-1-letter-spacing);margin-bottom:var(--spacing-medium)}.auth-successNotificationForm__content-text{color:var(--color-neutral-800, #2b2b2b);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);text-align:center;margin-bottom:var(--spacing-xxbig)}.auth-successNotificationForm__button--top{margin-bottom:var(--spacing-xsmall)}
|
|
2
2
|
.auth-emailConfirmationForm{border-radius:8px;background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small);text-align:start}@media (min-width: 768px){.auth-emailConfirmationForm{padding:var(--spacing-big) var(--spacing-xbig) var(--spacing-xxbig) var(--spacing-xbig)}}.auth-emailConfirmationForm__title{font:var(--type-headline-2-default-font);letter-spacing:var(--type-display-1-letter-spacing);color:var(--color-neutral-800, #3d3d3d)}.auth-emailConfirmationForm__subtitle{display:block;font:var(--type-details-caption-2-font);letter-spacing:var(--type-button-2-letter-spacing);color:var(--color-neutral-700, #666666)}.auth-emailConfirmationForm__notification{margin-bottom:var(--spacing-medium)}.auth-emailConfirmationForm.small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-emailConfirmationForm.small .auth-emailConfirmationForm-buttons{grid-template-columns:1fr;gap:20px 0}.auth-emailConfirmationForm-buttons{display:grid;grid-template-columns:auto auto;justify-content:space-between}@media (max-width: 768px){.auth-emailConfirmationForm-buttons{gap:20px 0;grid-template-columns:1fr}}.auth-emailConfirmationForm__text{display:block;font-family:var(--type-body-1-default-font);letter-spacing:var(--type-display-1-letter-spacing);color:var(--neutrals-neutral-800);padding:var(--spacing-big) 0}.auth-emailConfirmationForm.small .auth-emailConfirmationForm-buttons{justify-content:center;flex-wrap:wrap}.auth-emailConfirmationForm.small .auth-emailConfirmationForm-buttons{flex-basis:100%;margin-top:var(--spacing-medium)}.auth-emailConfirmationForm.small .auth-emailConfirmationForm-buttons>span{display:none}.auth-emailConfirmationForm-buttons>span{border:1px solid var(--color-brand-500);margin:var(--spacing-small) var(--spacing-xsmall);font:var(--type-button-2-font)}@media (max-width: 768px){.auth-emailConfirmationForm-buttons{justify-content:center;flex-wrap:wrap}.auth-emailConfirmationForm-buttons{flex-basis:100%;margin-top:var(--spacing-medium)}.auth-emailConfirmationForm-buttons>span{display:none}}
|
|
3
|
-
.auth-resetPasswordForm{border-radius:var(--shape-border-radius-2);background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-resetPasswordForm{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}}.auth-resetPasswordForm.small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-resetPasswordForm.small .auth-resetPasswordForm__form__item,.auth-resetPasswordForm.small .auth-resetPasswordForm__title{margin-bottom:var(--spacing-medium)}.auth-resetPasswordForm__form{display:grid;grid-template-columns:1fr}.auth-resetPasswordForm__form__item{margin-bottom:var(--spacing-medium)}.auth-resetPasswordForm__buttons{display:grid;grid-template-columns:
|
|
3
|
+
.auth-resetPasswordForm{border-radius:var(--shape-border-radius-2);background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-resetPasswordForm{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}}.auth-resetPasswordForm.small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-resetPasswordForm.small .auth-resetPasswordForm__form__item,.auth-resetPasswordForm.small .auth-resetPasswordForm__title{margin-bottom:var(--spacing-medium)}.auth-resetPasswordForm__form{display:grid;grid-template-columns:1fr}.auth-resetPasswordForm__form__item{margin-bottom:var(--spacing-medium)}.auth-resetPasswordForm__buttons{display:grid;grid-template-columns:1fr;gap:20px 0}.auth-resetPasswordForm.small{grid-template-columns:1fr;gap:20px 0}.auth-resetPasswordForm__notification{margin-bottom:var(--spacing-medium)}.auth-resetPasswordForm__title{margin-bottom:var(--spacing-big)}@media (min-width: 768px){.auth-resetPasswordForm__title{margin-bottom:var(--spacing-xxbig)}}@media (min-width: 600px){.auth-resetPasswordForm__buttons{grid-template-columns:auto auto;justify-content:space-between}}
|
|
4
4
|
.auth-updatePasswordForm{border-radius:var(--shape-border-radius-2);background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-updatePasswordForm{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}}.auth-updatePasswordForm.small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-updatePasswordForm.small .auth-updatePasswordForm__form__item{margin-bottom:var(--spacing-big)}.auth-updatePasswordForm.small .auth-updatePasswordForm__title{margin-bottom:var(--spacing-small)}.auth-updatePasswordForm__title{margin-bottom:var(--spacing-big)}@media (min-width: 768px){.auth-updatePasswordForm__title{margin-bottom:var(--spacing-xxbig)}}.auth-updatePasswordForm__form .auth-updatePasswordForm__form__item{margin-bottom:var(--spacing-big)}@media (min-width: 768px){.auth-updatePasswordForm__form .auth-updatePasswordForm__form__item{margin-bottom:var(--spacing-xxbig)}}.auth-updatePasswordForm__notification{margin-bottom:var(--spacing-medium)}
|
|
5
5
|
.auth-signInForm{border-radius:var(--shape-border-radius-2);background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-signInForm{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}}.auth-signInForm__notification{margin-bottom:var(--spacing-medium)}.auth-signInForm.small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-signInForm.small .auth-signInForm__form__email,.auth-signInForm.small .auth-signInForm__form__password,.auth-signInForm.small .auth-signInForm__title{margin-bottom:var(--spacing-medium)}.auth-signInForm.small .auth-signInForm__form__buttons{grid-template-columns:1fr;gap:20px 0}.auth-signInForm__title{margin-bottom:var(--spacing-big)}@media (min-width: 768px){.auth-signInForm__title{margin-bottom:var(--spacing-xxbig)}}.auth-signInForm__form{display:grid;grid-template-columns:1fr}.auth-signInForm__form__email{margin-bottom:var(--spacing-medium)}.auth-signInForm__form__password{margin-bottom:var(--spacing-big)}.auth-signInForm__form__buttons{display:grid;grid-template-columns:auto auto;justify-content:space-between}@media (max-width: 768px){.auth-signInForm__form__buttons{gap:20px 0;grid-template-columns:1fr}}.auth-signInForm.small .auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine{justify-content:center;flex-wrap:wrap}.auth-signInForm.small .auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine .auth-signInForm__button--signup{flex-basis:100%;margin-top:20px}.auth-signInForm.small .auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine>span{display:none}.auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine{display:flex}.auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine>span{border:var(--shape-border-width-1) solid var(--color-brand-500);margin:13px 10px;font:var(--type-button-2-font)}.auth-signInForm__resend-email-notification button{font:var(--type-button-3-font);color:var(--textColor);display:inline;background-color:transparent;border:none;cursor:pointer;padding:0;margin:0}.auth-signInForm__resend-email-notification button:hover{color:var(--color-brand-700);text-decoration:solid underline var(--color-brand-700);text-underline-offset:6px;color:var(--color-informational-500)}@media (max-width: 768px){.auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine{justify-content:center;flex-wrap:wrap}.auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine .auth-signInForm__button--signup{flex-basis:100%;margin-top:20px}.auth-signInForm__form__buttons .auth-signInForm__form__buttons--combine>span{display:none}}
|
|
6
|
-
.auth-signUpForm{border-radius:var(--shape-border-radius-2);background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-signUpForm{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}}.auth-signUpForm.small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-signUpForm.small .auth-signUpForm__title{margin-bottom:var(--spacing-small)}.auth-signUpForm.small .auth-
|
|
6
|
+
.auth-signUpForm{border-radius:var(--shape-border-radius-2);background-color:var(--color-neutral-50, #fff);padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}@media (min-width: 768px){.auth-signUpForm{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}}.auth-signUpForm.small{padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium) var(--spacing-small)}.auth-signUpForm.small .auth-signUpForm__title{margin-bottom:var(--spacing-small)}.auth-signUpForm.small .auth-signUpForm__form__field .auth-signUpForm__form__field:nth-child(2),.auth-signUpForm.small .auth-signUpForm__form__field .auth-signUpForm__form__field:nth-child(3){flex-basis:100%}.auth-signUpForm.small .auth-signUpForm__form{grid-template-columns:1fr}.auth-signUpForm__title{margin-bottom:var(--spacing-big)}@media (min-width: 768px){.auth-signUpForm__title{margin-bottom:var(--spacing-xxbig)}}.auth-signUpForm__notification{margin-bottom:var(--spacing-medium)}.auth-signUpForm__form{display:flex;flex-wrap:wrap;flex-direction:row;gap:0 13px}.auth-signUpForm__form__field{margin-bottom:var(--spacing-medium);flex-basis:100%;flex-grow:1;flex-shrink:0}.auth-signUpForm__checkbox{margin-bottom:12px}.auth-signUpForm__automatic-login{margin-top:12px}.auth-signUpForm__form__field:nth-child(2),.auth-signUpForm__form__field:nth-child(3){flex-shrink:1;flex-grow:1;flex-basis:100%}.auth-signUpForm-buttons{flex-basis:100%;display:grid;grid-template-columns:1fr;gap:var(--spacing-medium) 0;justify-content:center;grid-area:buttons}@media (min-width: 768px){.auth-signUpForm-buttons{display:grid;grid-template-columns:auto auto;justify-content:space-between}.auth-signUpForm__form__field:nth-child(2),.auth-signUpForm__form__field:nth-child(3){flex-shrink:1;flex-grow:.5;flex-basis:48%}}
|
|
7
7
|
.auth-button{position:relative}.auth-button__loader-wrapper{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:0;display:none}.auth-custom-button__loader{width:20px;height:20px;border:5px solid #fff;border-radius:50%;display:inline-block;box-sizing:border-box;position:relative;animation:pulse 1s linear infinite}.auth-button__loader:after{content:"";position:absolute;width:20px;height:20px;border:5px solid #fff;border-radius:50%;display:inline-block;box-sizing:border-box;left:50%;top:50%;transform:translate(-50%,-50%);animation:scaleUp 1s linear infinite}@keyframes scaleUp{0%{transform:translate(-50%,-50%) scale(0)}60%,to{transform:translate(-50%,-50%) scale(1)}}@keyframes pulse{0%,60%,to{transform:scale(1)}80%{transform:scale(1.2)}}.auth-button.enableLoader .auth-button__text{opacity:0}.auth-button.enableLoader .auth-button__loader-wrapper{opacity:1;display:inline-flex}.auth-title__heading{color:var(--color-neutral-800, #2b2b2b);font:var(--type-headline-2-default-font);letter-spacing:var(--type-details-caption-1-letter-spacing)}.auth-title__text{display:flex;justify-content:space-between;align-items:center}.auth-title__hr{margin-top:var(--spacing-xsmall);border:none;border-bottom:var(--shape-border-width-2) solid var(--color-neutral-400, #d6d6d6)}`,{styleId:"Auth"});
|
|
8
|
-
import{jsx as
|
|
8
|
+
import{jsx as s}from"@dropins/tools/preact-jsx-runtime.js";import{deepmerge as l,Render as u}from"@dropins/tools/lib.js";import{useState as m,useEffect as f}from"@dropins/tools/preact-hooks.js";import{UIProvider as g}from"@dropins/tools/components.js";import{events as p}from"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{c as y}from"./chunks/initialize.js";const h={PasswordValidationMessage:{chartTwoSymbols:"Use characters and numbers or symbols",chartThreeSymbols:"Use characters, numbers and symbols",chartFourSymbols:"Use uppercase characters, lowercase characters, numbers and symbols",messageLengthPassword:"At least {minLength} characters long"},ResetPasswordForm:{title:"Reset your password",buttonPrimary:"Reset password",buttonSecondary:"Back to sign in"},SignInForm:{title:"Sign in",buttonPrimary:"Sign in",buttonSecondary:"Sign up",buttonTertiary:"Forgot password?"},SignUpForm:{title:"Sign up",buttonPrimary:"Create account",buttonSecondary:"Already a member? Sign in",privacyPolicyDefaultText:"I’ve read and accept the Terms of Use and Privacy Policy.",subscribedDefaultText:"Subscribe to our newsletter and be the first to know about new arrivals, sales and exclusive offers.",keepMeLoggedText:"Keep me logged in after account creation",failedCreateCustomerAddress:"Failed to create customer addresses:"},UpdatePasswordForm:{title:"Update password",buttonPrimary:"Update password"},FormText:{requiredFieldError:"This is a required field."},EmailConfirmationForm:{title:"Verify your email address",subtitle:"We`ve sent an email to",mainText:"Check your inbox and click on the link we just send you to confirm your email address and activate your account.",buttonSecondary:"Resend email",buttonPrimary:"Close",accountConfirmMessage:"Account confirmed",accountConfirmationEmailSuccessMessage:"Congratulations! Your account at {email} email has been successfully confirmed."},Notification:{errorNotification:"Your password update failed due to validation errors. Please check your information and try again.",updatePasswordMessage:"The password has been updated.",updatePasswordActionMessage:"Sign in",successPasswordResetEmailNotification:"If there is an account associated with {email} you will receive an email with a link to reset your password.",resendEmailNotification:{informationText:"This account is not confirmed.",buttonText:"Resend confirmation email"},emailConfirmationMessage:"Please check your email for confirmation link.",technicalErrors:{technicalErrorSendEmail:"A technical error occurred while trying to send the email. Please try again later."}},SuccessNotification:{headingText:"Welcome!",messageText:"We are glad to see you!",primaryButtonText:"Continue shopping",secondaryButtonText:"Logout"},Api:{customerTokenErrorMessage:"Unable to log in. Please try again later or contact support if the issue persists."},InputPassword:{placeholder:"Password",floatingLabel:"Password *"}},b={Auth:h},w={default:b},P=({children:i})=>{var o,r;const[e,n]=m("en_US"),c=(r=(o=y)==null?void 0:o.getConfig())==null?void 0:r.langDefinitions;f(()=>{const t=p.on("locale",a=>{a!==e&&n(a)},{eager:!0});return()=>{t==null||t.off()}},[e]);const d=l(w,c??{});return s(g,{lang:e,langDefinitions:d,children:i})},F=new u(s(P,{}));export{F as render};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export interface getAttributesFormItems {
|
|
2
2
|
code: string;
|
|
3
|
+
sort_order: number;
|
|
3
4
|
default_value: null | string;
|
|
4
5
|
entity_type: string;
|
|
5
6
|
frontend_class: null | string;
|
|
7
|
+
multiline_count: number;
|
|
6
8
|
frontend_input: string;
|
|
7
9
|
is_required: boolean;
|
|
8
10
|
is_unique: boolean;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InLineAlertInterface } from './notification.types';
|
|
2
2
|
|
|
3
3
|
export interface EmailConfirmationFormProps {
|
|
4
4
|
userEmail: string;
|
|
5
5
|
formSize: 'default' | 'small';
|
|
6
|
-
inLineAlertProps:
|
|
6
|
+
inLineAlertProps: InLineAlertInterface;
|
|
7
7
|
hideCloseBtnOnEmailConfirmation?: boolean;
|
|
8
|
-
handleSetInLineAlertProps: (value:
|
|
8
|
+
handleSetInLineAlertProps: (value: InLineAlertInterface) => void;
|
|
9
9
|
onPrimaryButtonClick: () => void;
|
|
10
10
|
}
|
|
11
11
|
export interface useEmailConfirmationFormProps extends Omit<EmailConfirmationFormProps, 'formSize' | 'inLineAlertProps' | 'onPrimaryButtonClick'> {
|
|
12
|
-
handleSetInLineAlertProps: (value:
|
|
12
|
+
handleSetInLineAlertProps: (value: InLineAlertInterface) => void;
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=emailConfirmationForm.types.d.ts.map
|
package/types/form.types.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AttributesFormItemsProps, FieldEnumList } from '../data/models';
|
|
2
|
+
|
|
1
3
|
export interface FormProps {
|
|
2
4
|
fieldsConfig?: any;
|
|
3
5
|
name?: string;
|
|
@@ -8,4 +10,22 @@ export interface FormProps {
|
|
|
8
10
|
}
|
|
9
11
|
export interface useFormProps extends Omit<FormProps, 'children' | 'className' | 'name'> {
|
|
10
12
|
}
|
|
13
|
+
export interface FormInputsProps {
|
|
14
|
+
className?: string;
|
|
15
|
+
errors?: Record<string, string>;
|
|
16
|
+
values?: Record<string, string | number | boolean>;
|
|
17
|
+
fields?: any;
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
onChange?: (event: Event) => void;
|
|
20
|
+
onBlur?: (event: Event) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface FieldsProps extends Omit<AttributesFormItemsProps, 'options'> {
|
|
23
|
+
className: string;
|
|
24
|
+
fieldType: FieldEnumList;
|
|
25
|
+
id: string;
|
|
26
|
+
options: {
|
|
27
|
+
value: string;
|
|
28
|
+
text: string;
|
|
29
|
+
}[];
|
|
30
|
+
}
|
|
11
31
|
//# sourceMappingURL=form.types.d.ts.map
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { VNode } from 'preact';
|
|
2
2
|
import { HTMLAttributes } from 'preact/compat';
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export type AdditionalActionsAlertProps = Array<{
|
|
5
|
+
label: string;
|
|
6
|
+
onClick: (event: Event) => void;
|
|
7
|
+
}>;
|
|
8
|
+
export interface InLineAlertInterface {
|
|
5
9
|
type?: 'success' | 'warning' | 'error';
|
|
6
10
|
text?: string;
|
|
7
11
|
icon?: VNode<HTMLAttributes<SVGSVGElement>> | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { activeComponentType } from './authCombine.types';
|
|
2
|
-
import {
|
|
2
|
+
import { InLineAlertInterface } from './notification.types';
|
|
3
3
|
|
|
4
4
|
export interface ResetPasswordProps {
|
|
5
5
|
formSize?: 'default' | 'small';
|
|
@@ -10,6 +10,6 @@ export interface ResetPasswordFormProps extends ResetPasswordProps {
|
|
|
10
10
|
setActiveComponent?: (componentName: activeComponentType) => void;
|
|
11
11
|
}
|
|
12
12
|
export interface UseResetPasswordFormProps extends Omit<ResetPasswordFormProps, 'formSize'> {
|
|
13
|
-
handleSetInLineAlertProps?: (value?:
|
|
13
|
+
handleSetInLineAlertProps?: (value?: InLineAlertInterface) => void;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=resetPassword.types.d.ts.map
|
package/types/signIn.types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
2
2
|
import { activeComponentType } from './authCombine.types';
|
|
3
|
-
import {
|
|
3
|
+
import { InLineAlertInterface } from './notification.types';
|
|
4
4
|
|
|
5
5
|
type DefaultSlotContext = {
|
|
6
6
|
isSuccessful: {
|
|
@@ -32,7 +32,7 @@ export interface SignInFormProps extends SignInProps {
|
|
|
32
32
|
setActiveComponent?: (componentName: activeComponentType) => void;
|
|
33
33
|
}
|
|
34
34
|
export interface useSignInFormProps extends Omit<SignInFormProps, 'formSize' | 'slots'> {
|
|
35
|
-
handleSetInLineAlertProps: (value?:
|
|
35
|
+
handleSetInLineAlertProps: (value?: InLineAlertInterface) => void;
|
|
36
36
|
emailConfirmationStatusMessage?: {
|
|
37
37
|
text: string;
|
|
38
38
|
status: '' | 'success' | 'error';
|
package/types/signUp.types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { activeComponentType } from './authCombine.types';
|
|
2
|
-
import {
|
|
2
|
+
import { InLineAlertInterface } from './notification.types';
|
|
3
3
|
import { AddressFormProps } from './api/createCustomerAddress.types';
|
|
4
4
|
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
5
5
|
|
|
@@ -43,7 +43,7 @@ export interface UseSingUpFormProps extends Omit<SignUpFormProps, 'formSize' | '
|
|
|
43
43
|
minLength: number;
|
|
44
44
|
requiredCharacterClasses: number;
|
|
45
45
|
} | null;
|
|
46
|
-
handleSetInLineAlertProps: (value?:
|
|
46
|
+
handleSetInLineAlertProps: (value?: InLineAlertInterface) => void;
|
|
47
47
|
isEmailConfirmationRequired?: boolean;
|
|
48
48
|
translations: Record<string, string>;
|
|
49
49
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
2
|
-
import {
|
|
2
|
+
import { InLineAlertInterface } from './notification.types';
|
|
3
3
|
|
|
4
4
|
type DefaultSlotContext = {
|
|
5
5
|
isSuccessful: {
|
|
@@ -14,7 +14,7 @@ export interface UpdatePasswordProps {
|
|
|
14
14
|
routeRedirectOnSignIn?: () => string;
|
|
15
15
|
routeWrongUrlRedirect?: () => string;
|
|
16
16
|
onErrorCallback?: (value: unknown) => void;
|
|
17
|
-
onSuccessCallback?: (value
|
|
17
|
+
onSuccessCallback?: (value?: string) => void;
|
|
18
18
|
slots?: {
|
|
19
19
|
SuccessNotification?: SlotProps<DefaultSlotContext>;
|
|
20
20
|
};
|
|
@@ -27,7 +27,7 @@ export interface UseUpdatePasswordFormProps extends Omit<UpdatePasswordFormProps
|
|
|
27
27
|
minLength: number;
|
|
28
28
|
requiredCharacterClasses: number;
|
|
29
29
|
} | null;
|
|
30
|
-
handleSetInLineAlertProps: (value?:
|
|
30
|
+
handleSetInLineAlertProps: (value?: InLineAlertInterface) => void;
|
|
31
31
|
}
|
|
32
32
|
export {};
|
|
33
33
|
//# sourceMappingURL=updatePassword.types.d.ts.map
|