@dropins/storefront-auth 0.0.1-alpha12 → 0.0.1-alpha14
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 +3 -1
- package/hooks/components/useUpdatePasswordForm.d.ts +3 -2
- package/hooks/useInLineAlert.d.ts +3 -3
- package/i18n/en_US.json.d.ts +3 -3
- package/lib/simplifyTransformAttributesForm.d.ts +1 -1
- package/package.json +1 -1
- package/render.js +2 -2
- 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 +4 -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 c,jsxs as A}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as $,classes as z}from"@dropins/tools/lib.js";import{g as V,c as y,u as O,T as R,F as tt,B as K}from"./useInLineAlert.js";import{useState as h,useCallback as E,useEffect as J,useMemo as at}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{a as st}from"./getCustomerToken.js";import{r as rt}from"./resendConfirmationEmail.js";import{s as et,a as ot}from"./simplifyTransformAttributesForm.js";import{c as it}from"./confirmEmail.js";import{useText as Q}from"@dropins/tools/i18n.js";import{InLineAlert as nt,InputPassword as ct}from"@dropins/tools/components.js";import{E as mt}from"./EmailConfirmationForm.js";const ut=({emailConfirmationStatusMessage:t,translations:e,initialEmailValue:i,routeSignUp:m,routeForgotPassword:u,routeRedirectOnSignIn:F,onErrorCallback:g,setActiveComponent:a,onSuccessCallback:l,onSignUpLinkClick:d,handleSetInLineAlertProps:s,routeRedirectOnEmailConfirmationClose:N})=>{const[P,L]=h(""),[f,x]=h(!1),[w,_]=h(""),[C,b]=h(!1),[M,S]=h({userName:"",status:!1}),[p,I]=h(!1),[B,T]=h([]),k=E(async o=>{s(),x(!0),b(!1),T([]),await rt(o)},[s]),U=E(o=>{o.length?b(!1):b(!0),_(o)},[]);J(()=>{t!=null&&t.text&&s({text:t.text,type:t.status?t.status:void 0})},[t,s]);const v=E(async o=>{var q;s(),I(!0);const n=V(o.target);if(n.password||(b(!0),I(!1)),n!=null&&n.email&&(n!=null&&n.password)){const{email:G,password:Y}=n,r=await st({email:G,password:Y,handleSetInLineAlertProps:s,onErrorCallback:g,translations:e});if((q=r==null?void 0:r.errorMessage)!=null&&q.length){L(G);const H=r.errorMessage.includes("This account isn't confirmed. Verify and try again."),Z=H?e.resendEmailInformationText:r.errorMessage;T(H?[{label:e.resendEmailButtonText,onClick:()=>{k(G)}}]:[]),s({text:Z,type:"error"}),_("")}r!=null&&r.userName&&(o.target.reset(),y(F)?window.location.href=F():(l==null||l({userName:r==null?void 0:r.userName,status:!0}),S({userName:r==null?void 0:r.userName,status:!0}))),b(!1)}I(!1)},[s,g,e,k,F,l]),j=E(()=>{if(y(a)){a("resetPasswordForm");return}y(u)&&(window.location.href=u())},[u,a]),D=E(()=>{if(y(d)&&d(),y(a)){a("signUpForm");return}y(m)&&(window.location.href=m())},[d,m,a]),W=at(()=>{const o=et(ot);return i!=null&&i.length?o==null?void 0:o.map(n=>({...n,defaultValue:i})):o},[i]),X=E(()=>{s(),y(N)?window.location.href=N():x(!1)},[s,N]);return{additionalActionsAlert:B,userEmail:P,defaultEnhancedEmailFields:W,passwordError:C,isSuccessful:M,isLoading:p,signInPasswordValue:w,showEmailConfirmationForm:f,setShowEmailConfirmationForm:x,setSignInPasswordValue:_,submitLogInUser:v,forgotPasswordCallback:j,onSignUpLinkClickCallback:D,handledOnPrimaryButtonClick:X,handleSetPassword:U}},lt=()=>{let t=new URL(window.location.href),e=t.searchParams.get("email"),i=t.searchParams.get("key");e&&i&&(t.searchParams.delete("email"),t.searchParams.delete("key"),window.history.replaceState({},document.title,t.toString()))},ft=({enableEmailConfirmation:t})=>{const e=Q({accountConfirmMessage:"Auth.EmailConfirmationForm.accountConfirmMessage",accountConfirmationEmailSuccessMessage:"Auth.EmailConfirmationForm.accountConfirmationEmailSuccessMessage"}),[i,m]=h({text:"",status:""});return J(()=>{if(t){const{search:u}=window.location;u.includes("email=")&&u.includes("key=")&&(async()=>{var l,d,s;const g=new URLSearchParams(u),a=await it({customerEmail:g.get("email"),customerConfirmationKey:g.get("key")});if(!a)return null;(l=a==null?void 0:a.errors)!=null&&l.length?m({text:a==null?void 0:a.errors[0].message,status:"error"}):(m({text:a.data.confirmEmail.customer.email?e.accountConfirmationEmailSuccessMessage.replace("{email}",(s=(d=a==null?void 0:a.data)==null?void 0:d.confirmEmail.customer)==null?void 0:s.email):e.accountConfirmMessage,status:"success"}),lt())})()}},[t,e]),{emailConfirmationStatusMessage:i}},pt=({slots:t,formSize:e="default",initialEmailValue:i="",renderSignUpLink:m=!1,enableEmailConfirmation:u=!1,hideCloseBtnOnEmailConfirmation:F=!1,routeRedirectOnEmailConfirmationClose:g,routeRedirectOnSignIn:a,routeForgotPassword:l,routeSignUp:d,onSuccessCallback:s,setActiveComponent:N,onErrorCallback:P,onSignUpLinkClick:L})=>{const f=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:x}=ft({enableEmailConfirmation:u}),{inLineAlertProps:w,handleSetInLineAlertProps:_}=O(),{userEmail:C,additionalActionsAlert:b,defaultEnhancedEmailFields:M,passwordError:S,isSuccessful:p,isLoading:I,signInPasswordValue:B,showEmailConfirmationForm:T,submitLogInUser:k,forgotPasswordCallback:U,onSignUpLinkClickCallback:v,handledOnPrimaryButtonClick:j,handleSetPassword:D}=ut({translations:f,emailConfirmationStatusMessage:x,initialEmailValue:i,routeSignUp:d,routeForgotPassword:l,routeRedirectOnSignIn:a,setActiveComponent:N,onErrorCallback:P,onSuccessCallback:s,onSignUpLinkClick:L,handleSetInLineAlertProps:_,routeRedirectOnEmailConfirmationClose:g});return p.status&&(t!=null&&t.SuccessNotification)?c($,{"data-testid":"successNotificationTestId",name:"SuccessNotification",slot:t==null?void 0:t.SuccessNotification,context:{isSuccessful:p}}):T?c(mt,{formSize:e,userEmail:C,inLineAlertProps:w,hideCloseBtnOnEmailConfirmation:F,handleSetInLineAlertProps:_,onPrimaryButtonClick:j}):A("div",{className:z(["auth-signInForm",e]),"data-testid":"signInForm",children:[c(R,{text:f.title,bottomLine:!1,className:"auth-signInForm__title"}),w.text?c(nt,{"data-testid":"authInLineAlert",className:"auth-signInForm__notification",type:w.type,variant:"secondary",heading:w.text,icon:w.icon,additionalActions:b}):null,A(tt,{name:"signIn_form",className:"auth-signInForm__form",submitCallback:k,isLoading:I,fieldsConfig:M,children:[c(ct,{hideStatusIndicator:!0,className:"auth-signInForm__form__password",autoComplete:"current-password",error:S,defaultValue:B,onValue:D,placeholder:f.placeholder,floatingLabel:f.floatingLabel}),A("div",{className:"auth-signInForm__form__buttons",children:[A("div",{className:"auth-signInForm__form__buttons--combine",children:[c(K,{type:"button",variant:"tertiary",style:{padding:0},buttonText:f.buttonTertiary,className:"auth-signInForm__button auth-signInForm__button--forgot",enableLoader:!1,onClick:U,"data-testid":"switchToSignUp"}),m?c("span",{}):null,m?c(K,{type:"button",variant:"tertiary",style:{padding:0},buttonText:f.buttonSecondary,className:"auth-signInForm__button auth-signInForm__button--signup",enableLoader:!1,onClick:v}):null]}),c(K,{type:"submit",buttonText:f.buttonPrimary,variant:"primary",className:"auth-signInForm__button auth-signInForm__button--submit",enableLoader:I})]})]}),c("div",{id:"generateCustomerToken"})]})};export{pt 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){c({});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
|
|
1
|
+
import{jsx as o,jsxs as E}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as Z,classes as $}from"@dropins/tools/lib.js";import{v as k,u as W,a as S}from"../chunks/usePasswordValidationMessage.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/recaptcha.js";import{a as O}from"../chunks/getCustomerToken.js";import{r as g}from"../chunks/resetPassword.js";import{c as B,g as R,u as C,T as tt,F as et,B as at}from"../chunks/useInLineAlert.js";import{useState as h,useEffect as H,useCallback as I}from"@dropins/tools/preact-hooks.js";import{useText as K}from"@dropins/tools/i18n.js";import{InLineAlert as st,InputPassword as rt}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 J=(u,l)=>u.split("&").filter(r=>r.includes(l)).map(r=>r.split("=")[1])[0],it=({isEmailConfirmationRequired:u,signInOnSuccess:l,passwordConfigs:t,routeRedirectOnSignIn:r,routeWrongUrlRedirect:f,onErrorCallback:a,onSuccessCallback:i,handleSetInLineAlertProps:d,routeRedirectOnPasswordUpdate:w,routeSignInPage:m})=>{const s=K({errorNotification:"Auth.Notification.errorNotification",updatePasswordMessage:"Auth.Notification.updatePasswordMessage",updatePasswordActionMessage:"Auth.Notification.updatePasswordActionMessage",customerTokenErrorMessage:"Auth.Api.customerTokenErrorMessage"}),[U,y]=h({userName:"",status:!1}),[F,_]=h(""),[L,x]=h(!1),[P,T]=h(""),[N,b]=h(""),[M,n]=h(!1),[A,v]=h(!1),[q,D]=h([]);H(()=>{L&&!q.length&&(F.length?v(!1):v(!0))},[L,F,q]),H(()=>{const{search:p}=window.location;!p.includes("token=")&&!p.includes("email=")&&B(f)&&(window.location.href=f());const e=decodeURIComponent(p),V=J(e,"token"),j=J(e,"email");T(j),b(V)},[f]);const Q=I(async p=>{p.preventDefault(),n(!0),D([]);const e=R(p.target),V=(e==null?void 0:e.password)&&P&&N;e!=null&&e.password||(v(!0),n(!1));const j=(t==null?void 0:t.requiredCharacterClasses)??0,Y=(t==null?void 0:t.minLength)??0;if(!k(e==null?void 0:e.password,j)||e.password.length<+Y){x(!0),n(!1);return}if(!V){d({type:"error",text:s.errorNotification}),n(!1);return}const{message:G,success:z}=await g(P,N,e.password);if(z){if(u||!u&&!l){i==null||i(),B(w)&&(window.location.href=w()),x(!0),n(!1),v(!1),_(""),D([{label:s.updatePasswordActionMessage,onClick:()=>{window.location.href=m==null?void 0:m()}}]),d({type:"success",text:s.updatePasswordMessage});return}const c=await O({email:P,password:e.password,handleSetInLineAlertProps:d,onErrorCallback:a,translations:s});c!=null&&c.userName&&(i==null||i(c==null?void 0:c.userName),B(r)?window.location.href=r():y({userName:c==null?void 0:c.userName,status:!0}))}else d({type:"error",text:G}),a==null||a({message:G,success:z});n(!1)},[P,N,t==null?void 0:t.requiredCharacterClasses,t==null?void 0:t.minLength,s,u,l,m,a,i,r,d,w]),X=I(p=>{_(p)},[]);return{additionalActionsAlert:q,passwordError:A,isSuccessful:U,updatePasswordValue:F,isClickSubmit:L,isLoading:M,submitUpdatePassword:Q,handleSetUpdatePasswordValue:X}},ot=({signInOnSuccess:u=!0,formSize:l="default",routeRedirectOnSignIn:t,routeWrongUrlRedirect:r,routeSignInPage:f,slots:a,onErrorCallback:i,onSuccessCallback:d,routeRedirectOnPasswordUpdate:w})=>{const m=K({title:"Auth.UpdatePasswordForm.title",buttonPrimary:"Auth.UpdatePasswordForm.buttonPrimary",placeholder:"Auth.InputPassword.placeholder",floatingLabel:"Auth.InputPassword.floatingLabel"}),{passwordConfigs:s,isEmailConfirmationRequired:U}=W(),{inLineAlertProps:y,handleSetInLineAlertProps:F}=C(),{additionalActionsAlert:_,passwordError:L,isSuccessful:x,updatePasswordValue:P,isClickSubmit:T,isLoading:N,submitUpdatePassword:b,handleSetUpdatePasswordValue:M}=it({isEmailConfirmationRequired:U,signInOnSuccess:u,passwordConfigs:s,routeRedirectOnSignIn:t,routeWrongUrlRedirect:r,onErrorCallback:i,onSuccessCallback:d,handleSetInLineAlertProps:F,routeRedirectOnPasswordUpdate:w,routeSignInPage:f}),{isValidUniqueSymbols:n,defaultLengthMessage:A}=S({password:P,isClickSubmit:T,passwordConfigs:s});return x.status&&(a!=null&&a.SuccessNotification)?o(Z,{"data-testid":"successNotificationTestId",name:"SuccessNotification",slot:a==null?void 0:a.SuccessNotification,context:{isSuccessful:x}}):E("div",{className:$(["auth-updatePasswordForm",l]),children:[o(tt,{text:m.title,bottomLine:!1,className:"auth-updatePasswordForm__title"}),y.text?o(st,{className:"auth-updatePasswordForm__notification",variant:"secondary",heading:y.text,icon:y.icon,additionalActions:_}):null,E(et,{name:"updatePassword_form",className:"auth-updatePasswordForm__form",submitCallback:b,isLoading:N,fieldsConfig:[],children:[o("div",{style:"display: none;",children:o("input",{type:"text",id:"username",name:"username",autoComplete:"username"})}),o(rt,{defaultValue:P,onValue:M,className:"auth-updatePasswordForm__form__item",autoComplete:"new-password",name:"password",error:L||n==="error"||(A==null?void 0:A.status)==="error",minLength:s==null?void 0:s.minLength,uniqueSymbolsStatus:n,validateLengthConfig:A,requiredCharacterClasses:s==null?void 0:s.requiredCharacterClasses,placeholder:m.placeholder,floatingLabel:m.floatingLabel}),o("div",{className:"auth-updatePasswordForm__button",children:o(at,{type:"submit",buttonText:m.buttonPrimary,variant:"primary",enableLoader:N})})]})]})},_t=({slots:u,formSize:l,signInOnSuccess:t,routeRedirectOnPasswordUpdate:r,routeRedirectOnSignIn:f,routeSignInPage:a,routeWrongUrlRedirect:i,onErrorCallback:d,onSuccessCallback:w})=>o("div",{className:"auth-update-password",children:o(ot,{formSize:l,signInOnSuccess:t,routeSignInPage:a,routeRedirectOnSignIn:f,routeWrongUrlRedirect:i,onErrorCallback:d,onSuccessCallback:w,slots:u,routeRedirectOnPasswordUpdate:r})});export{_t as UpdatePassword,_t 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;
|
|
@@ -17,5 +18,6 @@ export declare const useSignInForm: ({ emailConfirmationStatusMessage, translati
|
|
|
17
18
|
forgotPasswordCallback: () => void;
|
|
18
19
|
onSignUpLinkClickCallback: () => void;
|
|
19
20
|
handledOnPrimaryButtonClick: () => void;
|
|
21
|
+
handleSetPassword: (value: string) => void;
|
|
20
22
|
};
|
|
21
23
|
//# sourceMappingURL=useSignInForm.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { UseUpdatePasswordFormProps } from '../../types';
|
|
1
|
+
import { AdditionalActionsAlertProps, UseUpdatePasswordFormProps } from '../../types';
|
|
2
2
|
|
|
3
|
-
export declare const useUpdatePasswordForm: ({ isEmailConfirmationRequired, signInOnSuccess, passwordConfigs, routeRedirectOnSignIn, routeWrongUrlRedirect, onErrorCallback, onSuccessCallback, handleSetInLineAlertProps, routeRedirectOnPasswordUpdate, }: UseUpdatePasswordFormProps) => {
|
|
3
|
+
export declare const useUpdatePasswordForm: ({ isEmailConfirmationRequired, signInOnSuccess, passwordConfigs, routeRedirectOnSignIn, routeWrongUrlRedirect, onErrorCallback, onSuccessCallback, handleSetInLineAlertProps, routeRedirectOnPasswordUpdate, routeSignInPage, }: UseUpdatePasswordFormProps) => {
|
|
4
|
+
additionalActionsAlert: AdditionalActionsAlertProps;
|
|
4
5
|
passwordError: boolean;
|
|
5
6
|
isSuccessful: {
|
|
6
7
|
userName: string;
|
|
@@ -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": {
|
|
@@ -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-alpha14", "@dropins/elsie": "0.27.1-alpha591"}
|
package/render.js
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
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 s}from"@dropins/tools/preact-jsx-runtime.js";import{deepmerge 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: {
|
|
@@ -12,9 +12,10 @@ export interface UpdatePasswordProps {
|
|
|
12
12
|
formSize?: 'default' | 'small';
|
|
13
13
|
routeRedirectOnPasswordUpdate?: () => string;
|
|
14
14
|
routeRedirectOnSignIn?: () => string;
|
|
15
|
+
routeSignInPage?: () => string;
|
|
15
16
|
routeWrongUrlRedirect?: () => string;
|
|
16
17
|
onErrorCallback?: (value: unknown) => void;
|
|
17
|
-
onSuccessCallback?: (value
|
|
18
|
+
onSuccessCallback?: (value?: string) => void;
|
|
18
19
|
slots?: {
|
|
19
20
|
SuccessNotification?: SlotProps<DefaultSlotContext>;
|
|
20
21
|
};
|
|
@@ -27,7 +28,7 @@ export interface UseUpdatePasswordFormProps extends Omit<UpdatePasswordFormProps
|
|
|
27
28
|
minLength: number;
|
|
28
29
|
requiredCharacterClasses: number;
|
|
29
30
|
} | null;
|
|
30
|
-
handleSetInLineAlertProps: (value?:
|
|
31
|
+
handleSetInLineAlertProps: (value?: InLineAlertInterface) => void;
|
|
31
32
|
}
|
|
32
33
|
export {};
|
|
33
34
|
//# sourceMappingURL=updatePassword.types.d.ts.map
|