@dropins/storefront-pdp 1.1.1-beta1 → 1.1.2-alpha1
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/fetch-graphql/fetch-graphql.d.ts +3 -3
- package/api/initialize/initialize.d.ts +3 -3
- package/chunks/Zoom.js +1 -1
- package/containers/ProductAttributes/ProductAttributes.d.ts +1 -1
- package/containers/ProductDescription/ProductDescription.d.ts +1 -1
- package/containers/ProductDetails/ProductDetails.d.ts +3 -3
- package/containers/ProductDetails.js +1 -1
- package/containers/ProductGallery/ProductGallery.d.ts +1 -1
- package/containers/ProductHeader/ProductHeader.d.ts +1 -1
- package/containers/ProductOptions/ProductOptions.d.ts +1 -1
- package/containers/ProductPrice/ProductPrice.d.ts +1 -1
- package/containers/ProductQuantity/ProductQuantity.d.ts +1 -1
- package/containers/ProductShortDescription/ProductShortDescription.d.ts +1 -1
- package/package.json +1 -1
- package/render/render.d.ts +1 -1
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
* is strictly forbidden unless prior written permission is obtained
|
|
14
14
|
* from Adobe.
|
|
15
15
|
*/
|
|
16
|
-
export declare const setEndpoint: (endpoint: string) => void, setFetchGraphQlHeader: (key: string, value: string | null) => void, removeFetchGraphQlHeader: (key: string) => void, setFetchGraphQlHeaders: (header: import('@adobe/fetch-graphql').Header) => void, fetchGraphQl: <T = any>(query: string, options?: import('@adobe/fetch-graphql').FetchOptions | undefined) => Promise<{
|
|
17
|
-
errors?: import('@adobe/fetch-graphql').FetchQueryError | undefined;
|
|
16
|
+
export declare const setEndpoint: (endpoint: string) => void, setFetchGraphQlHeader: (key: string, value: string | null) => void, removeFetchGraphQlHeader: (key: string) => void, setFetchGraphQlHeaders: (header: import('@adobe-commerce/fetch-graphql').Header) => void, fetchGraphQl: <T = any>(query: string, options?: import('@adobe-commerce/fetch-graphql').FetchOptions | undefined) => Promise<{
|
|
17
|
+
errors?: import('@adobe-commerce/fetch-graphql').FetchQueryError | undefined;
|
|
18
18
|
data: T;
|
|
19
19
|
}>, getConfig: () => {
|
|
20
20
|
endpoint: string | undefined;
|
|
21
|
-
fetchGraphQlHeaders: import('@adobe/fetch-graphql').Header | undefined;
|
|
21
|
+
fetchGraphQlHeaders: import('@adobe-commerce/fetch-graphql').Header | undefined;
|
|
22
22
|
};
|
|
23
23
|
//# sourceMappingURL=fetch-graphql.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Initializer } from '
|
|
2
|
-
import { Lang } from '
|
|
1
|
+
import { Initializer } from '../../../@adobe-commerce/elsie/src/lib';
|
|
2
|
+
import { Lang } from '../../../@adobe-commerce/elsie/src/i18n';
|
|
3
3
|
import { ProductModel } from '../../data/models';
|
|
4
4
|
|
|
5
5
|
type ConfigProps = {
|
|
@@ -22,6 +22,6 @@ type ConfigProps = {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
export declare const initialize: Initializer<ConfigProps>;
|
|
25
|
-
export declare const config: import('
|
|
25
|
+
export declare const config: import('../../../@adobe-commerce/elsie/src/lib').Config<ConfigProps>;
|
|
26
26
|
export {};
|
|
27
27
|
//# sourceMappingURL=initialize.d.ts.map
|
package/chunks/Zoom.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsxs as K,jsx as P,Fragment as be}from"@dropins/tools/preact-jsx-runtime.js";import*as ne from"@dropins/tools/preact-compat.js";import{useState as $,Children as F,useRef as V,useMemo as ve,useEffect as B,useCallback as oe}from"@dropins/tools/preact-compat.js";import{debounce as ye,classes as D}from"@dropins/tools/lib.js";import{Button as me,Icon as Ne}from"@dropins/tools/components.js";/* empty css */import{useText as R}from"@dropins/tools/i18n.js";import{cloneElement as Ee}from"@dropins/tools/preact.js";const De=a=>ne.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},ne.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),Ce=a=>ne.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},ne.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 5.64001L5.62988 18.37",stroke:"currentColor"}),ne.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 18.37L5.62988 5.64001",stroke:"currentColor"})),We=24,we=16,J=2,ke="32";var Me=(a=>(a[a.small=16]="small",a[a.medium=24]="medium",a[a.large=64]="large",a))(Me||{});const Be=({show:a=1,scrollbar:g=!1,peak:b=!1,arrows:u=!1,controls:n="dots",arrowsOnMainImage:T=!1,loop:s=!1,gap:v=null,direction:x="horizontal",width:W="100%",height:Q="100%",defaultIndex:X=0,className:ae,children:k,thumbnails:G=null,isZoomed:N,...q})=>{const z=R("PDP.Carousel.label").label,ie=R("PDP.Carousel.Slide.label").label,ue=R("PDP.Carousel.Previous.label").label,H=R("PDP.Carousel.Next.label").label,he=R("PDP.Carousel.Controls.label").label,le=R("PDP.Carousel.Controls.Button.label").label,[f,fe]=$(()=>Le(a)),_=Math.ceil(F.count(k)/f),C=b?We:0,U=v?Me[v]:0,O=F.count(k)%f,[h,de]=$(s?M()?X-1:X+1:X),t=V([]),[w,E]=$(0),[L,Z]=$(0),I=ve(()=>F.toArray(G),[G]),d=ve(()=>{const e=F.toArray(k).reduce((r,l,o)=>o%f===0?[...r,[l]]:[...r.slice(0,-1),[...r[r.length-1],l]],[]);return!s||e.length===1?e:s&&F.count(k)%f===0?[e[_-1]].concat(e).concat([e[0],e[1]]):[F.toArray(k).slice(-f)].concat(e).concat([e[0],e[1]])},[k,f,_,s]),Y=V(null),j=V(null),p=n==="thumbnailsRow"||n==="thumbnailsColumn";B(()=>{const e=Y.current;if(!e)return;const r=ye(()=>{E(e.offsetWidth??0),Z(e.offsetHeight??0);const o=window.innerWidth,i=Le(a,o);i!==f&&fe(i)},50),l=new ResizeObserver(r);return l.observe(e),()=>{l.unobserve(e)}},[f,a]);const ee=oe(e=>{const r=s?e-1:e,l=t==null?void 0:t.current[0],o=(l==null?void 0:l.offsetWidth)+we,i=(l==null?void 0:l.offsetHeight)+we,c=j.current,A=n==="thumbnailsRow",ce=n==="thumbnailsColumn",S=A?c==null?void 0:c.offsetWidth:c==null?void 0:c.offsetHeight,m=A?o:i;(A||ce)&&S&&(m*(r+1)>S&&(c.style.scrollBehavior="smooth",A?c.scrollLeft=M()?c.scrollWidth-c.clientWidth-(r+J)*m:(r+J)*m:c.scrollTop=(r+J)*m),(M()&&(A?c.scrollLeft:c.scrollTop)<=-m*r||!M()&&(A?c.scrollLeft:c.scrollTop)>m*r)&&(c.style.scrollBehavior="smooth",A?c.scrollLeft=M()?-(r-J)*m:(r-J)*m:c.scrollTop=(r-J)*m))},[n,s]);B(()=>{ee(h)},[h,ee]);const y=oe((e,r,l)=>{p&&ee(e);const o=Y.current,i=C?o.offsetWidth-C:o.offsetWidth-C+U;if(!Array.from(o.querySelectorAll("[data-index]")).filter(S=>{const m=Number(S.getAttribute("data-index"));return!isNaN(m)&&m>-1})[e])return;if(l){const S=e===0?_:0,m=i*(_+(O||f)/f);if(M()){if(o.scrollLeft<=0&&o.scrollLeft>-(i-5)){y(1,!0);return}if(o.scrollLeft<i-m&&o.scrollLeft>=-m){y(_,!0);return}o.style.scrollBehavior="auto",o.scrollLeft=S===0?0:-m,y(S===0?1:_,!0)}else{if(o.scrollLeft>=0&&o.scrollLeft<i-5){y(1,!0);return}if(o.scrollLeft>m-i&&o.scrollLeft<=m){y(_,!0);return}o.style.scrollBehavior="auto",o.scrollLeft=S===0?0:m,y(S===0?1:_,!0);return}}const ce=(o.offsetWidth-U)/f*d[e].length-C;o.style.scrollBehavior=r?"smooth":"auto",o.scrollLeft=M()?-(d[e].length===f?i*e:i*(e-1)-ce):d[e].length===f?i*e:i*(e-1)+ce},[U,_,C,f,O,d,ee,n]),te=oe(()=>{if(s){const r=h-1;y(r,!0,M()?h===_-1:h===1);return}const e=h<=0?0:h-1;y(e,!0)},[h,y,s]),re=oe(()=>{const e=d.length-1;if(s){const l=h+1;y(l,!0,M()?h===0:h===_);return}const r=h>=e?e:h+1;y(r,!0)},[d.length,s,h,y,_]);B(()=>{const e=r=>{r.key==="ArrowLeft"&&(r.preventDefault(),M()?re():te()),r.key==="ArrowRight"&&(r.preventDefault(),M()?te():re())};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[re,te]),B(()=>{y(s?X+1:X,!1)},[X,y,s]);const pe=ye(()=>{const e=Y.current,r=C?e.offsetWidth-C:e.offsetWidth-C+U,l=Math.abs(e.scrollLeft)/r,o=Math.abs(Math.round(l)-l<1?Math.round(l):Math.ceil(l));if(p&&ee(o),s){const i=r*(_+(O||f)/f),c=M()?-e.scrollLeft:e.scrollLeft;if(Math.ceil(Math.abs(c))>=Math.ceil(i)-5){e.style.scrollBehavior="auto",e.scrollLeft=M()?-e.offsetWidth+(Math.ceil(c)-Math.ceil(i)-C):e.offsetWidth+(Math.ceil(c)-Math.ceil(i)-C);return}if(Math.abs(c)===0){e.style.scrollBehavior="auto",e.scrollLeft=M()?-(i-e.offsetWidth+C):i-e.offsetWidth+C;return}}h!==o&&de(o)},100);B(()=>{const e=Y.current;return e==null||e.addEventListener("scroll",pe),()=>{e==null||e.removeEventListener("scroll",pe)}},[pe]);const se=(e,r,l)=>P(me,{className:D([["pdp-carousel__button",!e],[`pdp-carousel__button--${r}`,!e],[`pdp-carousel__button--${n}`,e]]),style:{"--height":`${L}px`},variant:"tertiary","aria-label":r==="next"?H:ue,onClick:l,disabled:s?!1:r==="next"?h>=d.length-1:h<1,children:P(Ne,{className:D([["pdp-carousel__button__icon",!e],[`pdp-carousel__button__icon--${r}`,!e],[`pdp-carousel__button__icon--${n}--${r}`,e]]),size:ke,source:De})}),ge=u&&d.length!=1&&se(p,"prev",te),_e=u&&d.length!=1&&se(p,"next",re),Pe=u&&d.length!=1&&se(!1,"prev",te),xe=u&&d.length!=1&&se(!1,"next",re);return K("div",{role:"region","aria-roledescription":z,className:D(["pdp-carousel",["pdp-carousel--main-image-controls",T],["pdp-carousel--arrows",u&&!p],[`pdp-carousel--${n}`,p],ae]),style:{"--flex-carousel":n==="thumbnailsColumn"?"row-reverse":"column","--gap":p?"0":"var(--spacing-small)","--width":W},...q,children:[P("div",{ref:Y,className:D(["pdp-carousel__wrapper",`pdp-carousel__wrapper--${x}`,["pdp-carousel__wrapper--scrollbar",g],["pdp-carousel__wrapper--peak",b]]),style:{"--total-width":n==="thumbnailsColumn"?"81.6%":"100%","--height":n==="thumbnailsColumn"?"auto":Q,"--gap":v?`var(--spacing-${v})`:"0px","--per-page":f},tabIndex:0,children:d.map((e,r)=>{const l=e.length<f;return P("div",{role:"group","aria-roledescription":ie,"data-index":r,className:D(["pdp-carousel__slide",`pdp-carousel__slide--${x}`,["pdp-carousel__slide--active",h===r],["pdp-carousel__slide--orphan",l]]),style:{"--length":e.length},children:e},r)})}),!p&&K(be,{children:[ge,_e]}),p&&T&&K(be,{children:[Pe,xe]}),n&&d.length!=1&&K("div",{className:D([[`pdp-carousel__controls__container--${n}`,p],["pdp-carousel__controls__container--no-arrows",!u||T]]),style:{"--width":n==="thumbnailsRow"?`${w}px`:W,"--height":`${L}px`,"--nr-thumbnails":I.length},children:[(p||N)&&!T&&ge,P("div",{ref:j,className:D([[`pdp-carousel__controls__wrapper--${n}`,p],["pdp-carousel__controls__wrapper",p]]),children:P("div",{role:"group","aria-label":he,className:D(["pdp-carousel__controls",[`pdp-carousel__controls--${n}`,p]]),children:(s?d.slice(0,_):d).map((e,r)=>{const l=s?_:d.length,o=s?h-1===r:h===r;return p?K("label",{className:D(["pdp-carousel__thumbnail__container"]),ref:i=>{i&&(t.current[r]=i)},children:[P("input",{type:"radio",name:"carousel-thumbnails","aria-label":le.replace("{key}",String(r+1)).replace("{total}",String(l)),checked:o&&w!==0,onChange:()=>{y(s?r+1:r,!0)},...q,className:D(["pdp-carousel__thumbnail",["pdp-carousel__thumbnail--selected",o&&w!==0]])}),P("span",{className:D(["pdp-carousel__thumbnail__span"]),children:I[r]})]},r):P("button",{"aria-label":le.replace("{key}",String(r+1)).replace("{total}",String(l)),onClick:()=>{y(s?r+1:r,!0)},className:D(["pdp-carousel__controls__button",["pdp-carousel__controls__button--active",o]])},r)})})}),(p||N)&&!T&&_e]})]})};function Le(a,g=0){if(typeof a=="number")return a;const{small:b,medium:u,large:n}=a,s=[{breakpoint:1024,value:n},{breakpoint:786,value:u},{breakpoint:0,value:b}].find(({breakpoint:v})=>g>v);return s?s.value:b}function M(){return document.documentElement.dir==="rtl"}const ze=({centered:a,onClose:g,className:b,children:u,...n})=>{const T=R("PDP.Overlay.Close.label").label,s=V(null),v=oe(()=>{g==null||g()},[g]);return B(()=>{const x=W=>{W.key==="Escape"&&v()};return document.addEventListener("keydown",x),()=>{document.removeEventListener("keydown",x)}},[v]),B(()=>{const x=s.current;x==null||x.focus();const W=document.scrollingElement,Q=W.style.overflow;return W.style.overflow="hidden",()=>{W.style.overflow=Q}},[]),K("div",{...n,className:D(["pdp-overlay",["pdp-overlay--centered",a],b]),ref:s,role:"dialog","aria-describedby":"overlay-content",tabindex:0,children:[P("div",{className:"pdp-overlay__content",id:"overlay-content",children:u}),P(me,{"aria-label":T,variant:"tertiary",className:"pdp-overlay__close-button",onClick:v,icon:P(Ce,{})})]})},He=({children:a,scale:g=2,closeButton:b=!0})=>{const[u,n]=$(!1),[T,s]=$("pdp-zoom"),[v,x]=$(!1),[W,Q]=$({x:0,y:0}),[X,ae]=$({x:0,y:0}),[k,G]=$({x:0,y:0}),N=V(null),q=V(!1),z=V(null),ie=t=>{!u||t.type!=="touchstart"||(Q({x:t.touches[0].clientX,y:t.touches[0].clientY}),ae({x:k.x,y:k.y}),x(!0))},ue=t=>{var p;if(!v||t.type!=="touchmove")return;const w=(p=t.currentTarget)==null?void 0:p.getBoundingClientRect(),E=(100-100/g)/2,L=t.touches[0].clientX-W.x,Z=t.touches[0].clientY-W.y,I=L*100/(w.width*g),d=Z*100/(w.height*g),Y=X.x+I,j=X.y+d;G({x:Math.max(-E,Math.min(Y,E))||0,y:Math.max(-E,Math.min(j,E))||0}),t.preventDefault()},H=t=>{var j;const w=(j=t.currentTarget)==null?void 0:j.getBoundingClientRect(),E=(100-100/g)/2;let L=null;if("touches"in t)if(t.touches.length>0)L=t.touches[0],z.current={clientX:L.clientX,clientY:L.clientY};else if(t.type==="touchend"&&N.current)L={clientX:N.current.x,clientY:N.current.y};else if(z.current)L=z.current;else return;else if(t instanceof MouseEvent)L=t;else return;const Z=(L.clientX-w.left)/w.width*100,I=(L.clientY-w.top)/w.height*100,d=(50-Z)*(g-1)/g,Y=(50-I)*(g-1)/g;G({x:Math.max(-E,Math.min(d,E))||0,y:Math.max(-E,Math.min(Y,E))||0})},he=t=>{if(b)N.current={x:t.touches[0].clientX,y:t.touches[0].clientY,time:Date.now()},z.current={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY},q.current=!1,u&&ie(t);else{if(v)return;!u&&H(t),n(!u),t.preventDefault()}},le=t=>{if(t.touches.length!==0){if(z.current={clientX:t.touches[0].clientX,clientY:t.touches[0].clientY},b){if(!N.current)return;if(v){ue(t);return}const w=t.touches[0].clientX,E=t.touches[0].clientY,L=Math.abs(w-N.current.x),Z=Math.abs(E-N.current.y);(L>10||Z>10)&&(q.current=!0)}u&&H(t)}},f=t=>{if(b){if(!N.current)return;const w=Date.now()-N.current.time;!q.current&&w<300&&!v&&(n(!0),H(t),t.preventDefault()),x(!1),N.current=null}else n(!1)},fe=t=>{"touches"in t||v||(u?!b&&n(!1):(n(!0),H(t)),t.preventDefault())},_=t=>{"touches"in t||u&&H(t)},C=t=>{if(!("touches"in t)){if(b){x(!1);return}n(!1)}},U=t=>{n(!1),t.stopPropagation()},O=u?`scale(${g}) translateX(${k.x}%) translateY(${k.y}%)`:"none",h=R("PDP.Zoom.Close.label").label,de=Ee(F.only(a),{draggable:!1,style:{"--transform":O}});return B(()=>{s(u?`pdp-zoom ${b?"pdp-zoom--no-effects":"pdp-zoom--zoomed"}`:"pdp-zoom")},[u,b]),K("figure",{className:T,onClick:fe,onMouseMove:_,onMouseLeave:C,onTouchStart:he,onTouchMove:le,onTouchEnd:f,children:[de,b&&u&&P(me,{"aria-label":h,variant:"tertiary",className:"pdp-zoom__close-button",icon:P(Ce,{}),onClick:U})]})};export{Be as C,ze as O,He as Z};
|
|
3
|
+
import{jsxs as F,jsx as C,Fragment as bt}from"@dropins/tools/preact-jsx-runtime.js";import*as ot from"@dropins/tools/preact-compat.js";import{useState as X,Children as j,useRef as K,useMemo as vt,useEffect as R,useCallback as rt}from"@dropins/tools/preact-compat.js";import{debounce as yt,classes as N}from"@dropins/tools/lib.js";import{Button as mt,Icon as Wt}from"@dropins/tools/components.js";/* empty css */import{useText as A}from"@dropins/tools/i18n.js";import{cloneElement as Et}from"@dropins/tools/preact.js";const kt=c=>ot.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c},ot.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),Ct=c=>ot.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...c},ot.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 5.64001L5.62988 18.37",stroke:"currentColor"}),ot.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 18.37L5.62988 5.64001",stroke:"currentColor"})),$t=24,wt=16,Xt="32";var Mt=(c=>(c[c.small=16]="small",c[c.medium=24]="medium",c[c.large=64]="large",c))(Mt||{});const Ht=({show:c=1,scrollbar:m=!1,peak:_=!1,arrows:i=!1,controls:n="dots",arrowsOnMainImage:$=!1,loop:l=!1,gap:b=null,direction:M="horizontal",width:W="100%",height:J="100%",defaultIndex:Y=0,className:ct,children:E,thumbnails:Q=null,isZoomed:P,...V})=>{const z=A("PDP.Carousel.label").label,at=A("PDP.Carousel.Slide.label").label,it=A("PDP.Carousel.Previous.label").label,B=A("PDP.Carousel.Next.label").label,ut=A("PDP.Carousel.Controls.label").label,nt=A("PDP.Carousel.Controls.Button.label").label,[h,ht]=X(()=>Lt(c)),g=Math.ceil(j.count(E)/h),L=_?$t:0,q=b?Mt[b]:0,H=j.count(E)%h,[u,ft]=X(l?k()?Y-1:Y+1:Y),e=K([]),[y,x]=X(0),[w,O]=X(0),I=vt(()=>j.toArray(Q),[Q]),f=vt(()=>{const t=j.toArray(E).reduce((r,s,o)=>o%h===0?[...r,[s]]:[...r.slice(0,-1),[...r[r.length-1],s]],[]);return!l||t.length===1?t:l&&j.count(E)%h===0?[t[g-1]].concat(t).concat([t[0],t[1]]):[j.toArray(E).slice(-h)].concat(t).concat([t[0],t[1]])},[E,h,g,l]),S=K(null),Z=K(null),d=n==="thumbnailsRow"||n==="thumbnailsColumn";R(()=>{const t=S.current;if(!t)return;const r=yt(()=>{x(t.offsetWidth??0),O(t.offsetHeight??0);const o=window.innerWidth,a=Lt(c,o);a!==h&&ht(a)},50),s=new ResizeObserver(r);return s.observe(t),()=>{s.unobserve(t)}},[h,c]);const G=rt(t=>{const r=l?t-1:t,s=e==null?void 0:e.current[0],o=(s==null?void 0:s.offsetWidth)+wt,a=(s==null?void 0:s.offsetHeight)+wt,p=Z.current,U=n==="thumbnailsRow",lt=n==="thumbnailsColumn",T=U?p==null?void 0:p.offsetWidth:p==null?void 0:p.offsetHeight,D=U?o:a;if((U||lt)&&T){const Nt=Math.floor((U?p.clientWidth:p.clientHeight)/D),Dt=Math.floor(Nt/2),pt=(r-Dt)*D;p.style.scrollBehavior="smooth",U?p.scrollLeft=k()?-(p.scrollWidth-p.clientWidth-pt):pt:p.scrollTop=pt}},[n,l]);R(()=>{G(u)},[u,G]);const v=rt((t,r,s)=>{d&&G(t);const o=S.current,a=L?o.offsetWidth-L:o.offsetWidth-L+q;if(!Array.from(o.querySelectorAll("[data-index]")).filter(T=>{const D=Number(T.getAttribute("data-index"));return!isNaN(D)&&D>-1})[t])return;if(s){const T=t===0?g:0,D=a*(g+(H||h)/h);if(k()){if(o.scrollLeft<=0&&o.scrollLeft>-(a-5)){v(1,!0);return}if(o.scrollLeft<a-D&&o.scrollLeft>=-D){v(g,!0);return}o.style.scrollBehavior="auto",o.scrollLeft=T===0?0:-D,v(T===0?1:g,!0)}else{if(o.scrollLeft>=0&&o.scrollLeft<a-5){v(1,!0);return}if(o.scrollLeft>D-a&&o.scrollLeft<=D){v(g,!0);return}o.style.scrollBehavior="auto",o.scrollLeft=T===0?0:D,v(T===0?1:g,!0);return}}const lt=(o.offsetWidth-q)/h*f[t].length-L;o.style.scrollBehavior=r?"smooth":"auto",o.scrollLeft=k()?-(f[t].length===h?a*t:a*(t-1)-lt):f[t].length===h?a*t:a*(t-1)+lt},[q,g,L,h,H,f,G,n]),tt=rt(()=>{if(l){const r=u-1;v(r,!0,k()?u===g-1:u===1);return}const t=u<=0?0:u-1;v(t,!0)},[u,v,l]),et=rt(()=>{const t=f.length-1;if(l){const s=u+1;v(s,!0,k()?u===0:u===g);return}const r=u>=t?t:u+1;v(r,!0)},[f.length,l,u,v,g]);R(()=>{const t=r=>{r.key==="ArrowLeft"&&(r.preventDefault(),k()?et():tt()),r.key==="ArrowRight"&&(r.preventDefault(),k()?tt():et())};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[et,tt]),R(()=>{v(l?Y+1:Y,!1)},[Y,v,l]);const dt=yt(()=>{const t=S.current,r=L?t.offsetWidth-L:t.offsetWidth-L+q,s=Math.abs(t.scrollLeft)/r,o=Math.abs(Math.round(s)-s<1?Math.round(s):Math.ceil(s));if(d&&G(o),l){const a=r*(g+(H||h)/h),p=k()?-t.scrollLeft:t.scrollLeft;if(Math.ceil(Math.abs(p))>=Math.ceil(a)-5){t.style.scrollBehavior="auto",t.scrollLeft=k()?-t.offsetWidth+(Math.ceil(p)-Math.ceil(a)-L):t.offsetWidth+(Math.ceil(p)-Math.ceil(a)-L);return}if(Math.abs(p)===0){t.style.scrollBehavior="auto",t.scrollLeft=k()?-(a-t.offsetWidth+L):a-t.offsetWidth+L;return}}u!==o&&ft(o)},100);R(()=>{const t=S.current;return t==null||t.addEventListener("scroll",dt),()=>{t==null||t.removeEventListener("scroll",dt)}},[dt]);const st=(t,r,s)=>C(mt,{className:N([["pdp-carousel__button",!t],[`pdp-carousel__button--${r}`,!t],[`pdp-carousel__button--${n}`,t]]),style:{"--height":`${w}px`},variant:"tertiary","aria-label":r==="next"?B:it,onClick:s,disabled:l?!1:r==="next"?u>=f.length-1:u<1,children:C(Wt,{className:N([["pdp-carousel__button__icon",!t],[`pdp-carousel__button__icon--${r}`,!t],[`pdp-carousel__button__icon--${n}--${r}`,t]]),size:Xt,source:kt})}),gt=i&&f.length!=1&&st(d,"prev",tt),_t=i&&f.length!=1&&st(d,"next",et),Pt=i&&f.length!=1&&st(!1,"prev",tt),xt=i&&f.length!=1&&st(!1,"next",et);return F("div",{role:"region","aria-roledescription":z,className:N(["pdp-carousel",["pdp-carousel--main-image-controls",$],["pdp-carousel--arrows",i&&!d],[`pdp-carousel--${n}`,d],ct]),style:{"--flex-carousel":n==="thumbnailsColumn"?"row-reverse":"column","--gap":d?"0":"var(--spacing-small)","--width":W},...V,children:[C("div",{ref:S,className:N(["pdp-carousel__wrapper",`pdp-carousel__wrapper--${M}`,["pdp-carousel__wrapper--scrollbar",m],["pdp-carousel__wrapper--peak",_]]),style:{"--total-width":n==="thumbnailsColumn"?"81.6%":"100%","--height":n==="thumbnailsColumn"?"auto":J,"--gap":b?`var(--spacing-${b})`:"0px","--per-page":h},tabIndex:0,children:f.map((t,r)=>{const s=t.length<h;return C("div",{role:"group","aria-roledescription":at,"data-index":r,className:N(["pdp-carousel__slide",`pdp-carousel__slide--${M}`,["pdp-carousel__slide--active",u===r],["pdp-carousel__slide--orphan",s]]),style:{"--length":t.length},children:t},r)})}),!d&&F(bt,{children:[gt,_t]}),d&&$&&F(bt,{children:[Pt,xt]}),n&&f.length!=1&&F("div",{className:N([[`pdp-carousel__controls__container--${n}`,d],["pdp-carousel__controls__container--no-arrows",!i||$]]),style:{"--width":n==="thumbnailsRow"?`${y}px`:W,"--height":`${w}px`,"--nr-thumbnails":I.length},children:[(d||P)&&!$&>,C("div",{ref:Z,className:N([[`pdp-carousel__controls__wrapper--${n}`,d],["pdp-carousel__controls__wrapper",d]]),children:C("div",{role:"group","aria-label":ut,className:N(["pdp-carousel__controls",[`pdp-carousel__controls--${n}`,d]]),children:(l?f.slice(0,g):f).map((t,r)=>{const s=l?g:f.length,o=l?u-1===r:u===r;return d?F("label",{className:N(["pdp-carousel__thumbnail__container"]),ref:a=>{a&&(e.current[r]=a)},children:[C("input",{type:"radio",name:"carousel-thumbnails","aria-label":nt.replace("{key}",String(r+1)).replace("{total}",String(s)),checked:o&&y!==0,onChange:()=>{v(l?r+1:r,!0)},...V,className:N(["pdp-carousel__thumbnail",["pdp-carousel__thumbnail--selected",o&&y!==0]])}),C("span",{className:N(["pdp-carousel__thumbnail__span"]),children:I[r]})]},r):C("button",{"aria-label":nt.replace("{key}",String(r+1)).replace("{total}",String(s)),onClick:()=>{v(l?r+1:r,!0)},className:N(["pdp-carousel__controls__button",["pdp-carousel__controls__button--active",o]])},r)})})}),(d||P)&&!$&&_t]})]})};function Lt(c,m=0){if(typeof c=="number")return c;const{small:_,medium:i,large:n}=c,l=[{breakpoint:1024,value:n},{breakpoint:786,value:i},{breakpoint:0,value:_}].find(({breakpoint:b})=>m>b);return l?l.value:_}function k(){return document.documentElement.dir==="rtl"}const Ot=({centered:c,onClose:m,className:_,children:i,...n})=>{const $=A("PDP.Overlay.Close.label").label,l=K(null),b=rt(()=>{m==null||m()},[m]);return R(()=>{const M=W=>{W.key==="Escape"&&b()};return document.addEventListener("keydown",M),()=>{document.removeEventListener("keydown",M)}},[b]),R(()=>{const M=l.current;M==null||M.focus();const W=document.scrollingElement,J=W.style.overflow;return W.style.overflow="hidden",()=>{W.style.overflow=J}},[]),F("div",{...n,className:N(["pdp-overlay",["pdp-overlay--centered",c],_]),ref:l,role:"dialog","aria-describedby":"overlay-content",tabindex:0,children:[C("div",{className:"pdp-overlay__content",id:"overlay-content",children:i}),C(mt,{"aria-label":$,variant:"tertiary",className:"pdp-overlay__close-button",onClick:b,icon:C(Ct,{})})]})},Zt=({children:c,scale:m=2,closeButton:_=!0})=>{const[i,n]=X(!1),[$,l]=X("pdp-zoom"),[b,M]=X(!1),[W,J]=X({x:0,y:0}),[Y,ct]=X({x:0,y:0}),[E,Q]=X({x:0,y:0}),P=K(null),V=K(!1),z=K(null),at=e=>{!i||e.type!=="touchstart"||(J({x:e.touches[0].clientX,y:e.touches[0].clientY}),ct({x:E.x,y:E.y}),M(!0))},it=e=>{var d;if(!b||e.type!=="touchmove")return;const y=(d=e.currentTarget)==null?void 0:d.getBoundingClientRect(),x=(100-100/m)/2,w=e.touches[0].clientX-W.x,O=e.touches[0].clientY-W.y,I=w*100/(y.width*m),f=O*100/(y.height*m),S=Y.x+I,Z=Y.y+f;Q({x:Math.max(-x,Math.min(S,x))||0,y:Math.max(-x,Math.min(Z,x))||0}),e.preventDefault()},B=e=>{var Z;const y=(Z=e.currentTarget)==null?void 0:Z.getBoundingClientRect(),x=(100-100/m)/2;let w=null;if("touches"in e)if(e.touches.length>0)w=e.touches[0],z.current={clientX:w.clientX,clientY:w.clientY};else if(e.type==="touchend"&&P.current)w={clientX:P.current.x,clientY:P.current.y};else if(z.current)w=z.current;else return;else if(e instanceof MouseEvent)w=e;else return;const O=(w.clientX-y.left)/y.width*100,I=(w.clientY-y.top)/y.height*100,f=(50-O)*(m-1)/m,S=(50-I)*(m-1)/m;Q({x:Math.max(-x,Math.min(f,x))||0,y:Math.max(-x,Math.min(S,x))||0})},ut=e=>{if(_)P.current={x:e.touches[0].clientX,y:e.touches[0].clientY,time:Date.now()},z.current={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY},V.current=!1,i&&at(e);else{if(b)return;!i&&B(e),n(!i),e.preventDefault()}},nt=e=>{if(e.touches.length!==0){if(z.current={clientX:e.touches[0].clientX,clientY:e.touches[0].clientY},_){if(!P.current)return;if(b){it(e);return}const y=e.touches[0].clientX,x=e.touches[0].clientY,w=Math.abs(y-P.current.x),O=Math.abs(x-P.current.y);(w>10||O>10)&&(V.current=!0)}i&&B(e)}},h=e=>{if(_){if(!P.current)return;const y=Date.now()-P.current.time;!V.current&&y<300&&!b&&(n(!0),B(e),e.preventDefault()),M(!1),P.current=null}else n(!1)},ht=e=>{"touches"in e||b||(i?!_&&n(!1):(n(!0),B(e)),e.preventDefault())},g=e=>{"touches"in e||i&&B(e)},L=e=>{if(!("touches"in e)){if(_){M(!1);return}n(!1)}},q=e=>{n(!1),e.stopPropagation()},H=i?`scale(${m}) translateX(${E.x}%) translateY(${E.y}%)`:"none",u=A("PDP.Zoom.Close.label").label,ft=Et(j.only(c),{draggable:!1,style:{"--transform":H}});return R(()=>{l(i?`pdp-zoom ${_?"pdp-zoom--no-effects":"pdp-zoom--zoomed"}`:"pdp-zoom")},[i,_]),F("figure",{className:$,onClick:ht,onMouseMove:g,onMouseLeave:L,onTouchStart:ut,onTouchMove:nt,onTouchEnd:h,children:[ft,_&&i&&C(mt,{"aria-label":u,variant:"tertiary",className:"pdp-zoom__close-button",icon:C(Ct,{}),onClick:q})]})};export{Ht as C,Ot as O,Zt as Z};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
-
import { Container } from '
|
|
2
|
+
import { Container } from '../../../@adobe-commerce/elsie/src/lib';
|
|
3
3
|
import { ProductModel } from '../../data/models';
|
|
4
4
|
|
|
5
5
|
export interface ProductAttributesProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
-
import { Container } from '
|
|
2
|
+
import { Container } from '../../../@adobe-commerce/elsie/src/lib';
|
|
3
3
|
import { ProductModel } from '../../data/models';
|
|
4
4
|
|
|
5
5
|
export interface ProductDescriptionProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
-
import { Container, SlotProps, SlotMethod, ResolveImageUrlOptions } from '
|
|
3
|
-
import { ButtonProps } from '
|
|
2
|
+
import { Container, SlotProps, SlotMethod, ResolveImageUrlOptions } from '../../../@adobe-commerce/elsie/src/lib';
|
|
3
|
+
import { ButtonProps } from '../../../@adobe-commerce/elsie/src/components';
|
|
4
4
|
import { ProductModel } from '../../data/models';
|
|
5
5
|
|
|
6
|
-
type IconType = keyof typeof import('@
|
|
6
|
+
type IconType = keyof typeof import('@adobe-commerce/elsie/icons');
|
|
7
7
|
export type Values = {
|
|
8
8
|
sku: string;
|
|
9
9
|
quantity: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsx as e,jsxs as V,Fragment as Nt}from"@dropins/tools/preact-jsx-runtime.js";import{useState as z,Children as ot,useEffect as f,useCallback as g,useMemo as vt}from"@dropins/tools/preact-compat.js";import{VComponent as o,classes as s,Slot as A,toLanguageTag as ut}from"@dropins/tools/lib.js";import{Incrementer as Ot,Breadcrumbs as dt,Button as bt,Icon as lt,Image as At}from"@dropins/tools/components.js";/* empty css */import{Z as It,C,O as Dt}from"../chunks/Zoom.js";import{useText as B}from"@dropins/tools/i18n.js";import{P as Pt}from"../chunks/PriceRange.js";import{S as wt}from"../chunks/Swatches.js";import"@dropins/tools/preact.js";import{c as St,h as ht,p as st,l as Vt,t as kt}from"../chunks/isProductConfigurationValid.js";import{events as tt}from"@dropins/tools/event-bus.js";import{i as Ut,t as Bt}from"../chunks/date.js";import"../fragments.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getProductConfigurationValues.js";const xt=({title:a,breadcrumbs:N,galleryContent:y,infoContent:v,productContent:O,sku:I,outOfStock:x,shortDescription:L,description:r,attributes:et,images:c,options:h,price:u,specialPrice:Z,className:G,children:it,quantity:K,actions:M,carouselConfig:n,zoomType:J="overlay",closeButton:nt=!0,...rt})=>{var q,F,E,m,$,j,W,X,Y;const pt=B("PDP.Product.RegularPrice.label").label,k=B("PDP.Product.SpecialPrice.label").label,ct=B("PDP.Product.OutOfStock.label").label,U=B("PDP.Product.Image.label").label,[H,t]=z(null),D=c!=null&&c.length?c.map((w,S)=>{var Q;const R=((Q=a==null?void 0:a.props)==null?void 0:Q.children)&&(U==null?void 0:U.replace("{product}",a.props.children.toString()).replace("{key}",String(S+1)).replace("{total}",String(c.length)));return J==="zoom"?e(It,{closeButton:nt,children:e(o,{node:w,loading:S===0?"eager":"lazy",alt:R},S)}):e(o,{node:w,loading:S===0?"eager":"lazy",alt:R,onClick:()=>t(S)},S)}):e("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0}),P=(q=n==null?void 0:n.thumbnails)!=null&&q.length?n.thumbnails.map((w,S)=>{var R;return e(o,{node:w,loading:(n==null?void 0:n.thumbnailsLoadingMode)||"lazy",alt:((R=a==null?void 0:a.props)==null?void 0:R.children)&&(U==null?void 0:U.replace("{product}",a.props.children.toString()).replace("{key}",String(S+1)).replace("{total}",String(c.length)))},S)}):e("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0});return V("div",{...rt,className:s(["pdp-product",G]),children:[N&&e(o,{node:N,className:"pdp-product__breadcrumbs"}),V("div",{className:"pdp-product__column-container pdp-product__gallery-column",children:[e("div",{className:"pdp-product__column-body",children:(F=n==null?void 0:n.controls)!=null&&F.desktop?e(C,{className:"pdp-product__overlay__carousel",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?n.controls.desktop:"dots",arrowsOnMainImage:n==null?void 0:n.arrowsOnMainImage,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,peak:((E=n==null?void 0:n.thumbnails)==null?void 0:E.length)>1&&((m=n==null?void 0:n.peak)==null?void 0:m.desktop)||!1,gap:(n==null?void 0:n.gap)||null,width:"100%",height:"100%",defaultIndex:H||0,thumbnails:P,children:D}):e(Lt,{className:"pdp-product__images",gap:"small",children:D})}),y&&e(o,{node:y,className:"pdp-product__gallery-content"})]}),V("div",{className:"pdp-product__column-container pdp-product__content-column",children:[V("div",{className:"pdp-product__column-body",children:[V("div",{className:"pdp-product__header",children:[a&&e(o,{node:a,className:"pdp-product__title"}),I&&e(o,{node:I,className:"pdp-product__sku"})]}),V("div",{className:"pdp-product__prices",children:[Z&&e(o,{node:Z,className:s(["pdp-product__price-special","pdp-product__price"]),"aria-label":k,role:"text"}),u&&e(o,{node:u,className:s(["pdp-product__price-regular","pdp-product__price--grey"]),"aria-label":pt,role:"text"})]}),($=n==null?void 0:n.controls)!=null&&$.mobile&&((j=n==null?void 0:n.controls)==null?void 0:j.mobile)==="thumbnailsRow"?e(C,{className:"pdp-product__images pdp-product__images--carousel pdp-product__images--carousel--thumbnails",width:"100%",height:"auto",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"thumbnailsRow":null,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,peak:((W=n==null?void 0:n.thumbnails)==null?void 0:W.length)>1&&((X=n==null?void 0:n.peak)==null?void 0:X.mobile)||!1,gap:(n==null?void 0:n.gap)||null,thumbnails:P,children:D}):e(C,{className:"pdp-product__images pdp-product__images--carousel",peak:((Y=n==null?void 0:n.peak)==null?void 0:Y.mobile)&&(c==null?void 0:c.length)>1,gap:(n==null?void 0:n.gap)||null,width:"100%",height:"auto",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"dots":null,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,children:D}),V("div",{className:s(["pdp-product__actions",["pdp-product__actions--out-of-stock",x]]),children:[x&&e("div",{className:"pdp-product__out-of-stock__text",children:ct}),h&&e(o,{node:h,className:s(["pdp-product__options"])}),K&&e("div",{className:"pdp-product__quantity",children:e(o,{node:K})}),M&&e(o,{node:M,className:s(["pdp-product__buttons"])})]}),L&&e(o,{node:L,className:s(["pdp-product__short_description"])}),r&&e(o,{node:r,className:s(["pdp-product__description"])}),et?e("div",{className:"pdp-product__attributes",children:et}):null]}),v&&e(o,{node:v,className:"pdp-product__info-content"})]}),O&&e(o,{node:O,className:"pdp-product__content"}),H===null?null:e(Dt,{className:"pdp-product__overlay",onClose:()=>t(null),centered:!0,children:e(C,{className:"pdp-product__overlay__carousel",arrows:(c==null?void 0:c.length)>1,width:"100%",height:"100%",defaultIndex:H||0,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"dots":null,isZoomed:!0,children:D})})]})},Lt=({children:a,gap:N=null,className:y,style:v,...O})=>{const I=ot.count(a);return e("div",{...O,className:s(["pdp-gallery-grid",y]),style:{"--gap":N?`var(--spacing-${N})`:"0px",...v},children:ot.map(a,(x,L)=>e("div",{className:"pdp-gallery-grid__item",children:e(o,{node:x,loading:L===0?"eager":"lazy"},x.props.src)},I+L))})},Mt=({sku:a,hideSku:N,hideQuantity:y,hideShortDescription:v,hideDescription:O,hideAttributes:I,hideURLParams:x,hideSelectedOptionValue:L,slots:r,children:et,initialData:c,carousel:h,optionsConfig:u,useACDL:Z,onAddToCart:G,zoomType:it,closeButton:K=!0,disableDropdownPreselection:M,...n})=>{var Q,at,_t,mt;const J=B("PDP.Product.AddToCart.label").label,nt=B("PDP.Product.Incrementer.label").label,rt=B("PDP.Product.Details.label").label,pt=B("PDP.Swatches.ChooseOption.label").label,[k,ct]=z(St.getConfig().defaultLocale||"en-US"),[U,H]=z(),[t=null,D]=z(c),[P,q]=z(()=>{const p={sku:a,quantity:1};return t!=null&&t.optionUIDs&&(p.optionsUIDs=t.optionUIDs),p}),[F,E]=z(()=>{var p,d;return!(t!=null&&t.options&&((p=t==null?void 0:t.options)==null?void 0:p.length)>0&&((d=t==null?void 0:t.optionUIDs)==null?void 0:d.length)!==(t==null?void 0:t.options.length))}),m={data:t,values:P,valid:F};function $(p){return p==null?void 0:p.some(d=>(d==null?void 0:d.typename)==="ProductViewOptionValueProduct")}f(()=>{const p=tt.on("pdp/data",l=>{D(l),q(i=>({...i,sku:l.sku,optionsUIDs:l.optionUIDs}))}),d=tt.on("pdp/setValues",l=>{q(i=>({...i,...l}))});return()=>{d==null||d.off(),p==null||p.off()}},[]),f(()=>{const p=tt.on("locale",d=>{d!==k&&(ct(d),ht(a,{preselectFirstOption:!M,anchors:u==null?void 0:u.anchorOptions}).then(D))});return()=>{p==null||p.off()}},[M,k,u==null?void 0:u.anchorOptions,a]),f(()=>{Z&&c&&Object.keys(c).length>0&&st(c)},[c]);const j=g(p=>{q(d=>({...d,...p}))},[]);f(()=>{tt.emit("pdp/values",P)},[JSON.stringify(P)]);const W=g(async p=>{var i,_;let d=Object.entries(p).filter(([b,T])=>T.label!==pt).map(([b,T])=>p[b].value).filter(b=>b!==void 0);!x&&(t!=null&&t.options)&&!$(t.options)&&Vt({optionsUIDs:d.join(",")}),j({optionsUIDs:d}),E((d==null?void 0:d.length)===((i=t==null?void 0:t.options)==null?void 0:i.length));const l=await ht(a,{anchors:u==null?void 0:u.anchorOptions,isBundle:t==null?void 0:t.isBundle,optionsUIDs:d,preselectFirstOption:!M});D(l),(_=u==null?void 0:u.anchorOptions)!=null&&_.length&&X(l,d)},[a]),X=g((p,d)=>{var _;const l=(p==null?void 0:p.optionUIDs)??[];d.every(b=>l.includes(b))||(H(p==null?void 0:p.options),j({optionsUIDs:l}),E((l==null?void 0:l.length)===((_=p==null?void 0:p.options)==null?void 0:_.length)))},[a]),Y=g(p=>{Object.keys(p).length!==0&&E(!1)},[]),w=vt(()=>{var p;return(p=t==null?void 0:t.attributes)==null?void 0:p.map(({label:d,value:l},i)=>{const _=Ut(l)?Bt(l,k):l.toString();return V("li",{children:[d,": ",e("span",{dangerouslySetInnerHTML:{__html:_}})]},i)})},[t==null?void 0:t.attributes,k]),S=!y&&(t!=null&&t.inStock)?e(A,{name:"Quantity",slot:r==null?void 0:r.Quantity,context:{...m},children:e(Ot,{name:"quantity",defaultValue:P.quantity.toString(),value:P.quantity.toString(),min:1,"aria-label":nt,className:"pdp-product__quantity",onValue:p=>{j({quantity:Number(p)})}},"quantity")}):void 0,R=()=>{if(t!=null&&t.options)return e(A,{name:"Options",slot:r==null?void 0:r.Options,context:{...m},children:e(wt,{selectedUIDs:P.optionsUIDs,options:t.options,defaultOptions:P.optionsUIDs,selectionsToUpdate:U,hideSelectedValue:L,disablePreselections:M,onValues:W,onErrors:Y})})};return e("div",{...n,children:e(xt,{title:e(A,{name:"Title",slot:r==null?void 0:r.Title,context:{...m},children:t==null?void 0:t.name}),sku:N?void 0:e(A,{name:"SKU",slot:r==null?void 0:r.SKU,context:{...m},children:t==null?void 0:t.sku}),options:R(),breadcrumbs:(r==null?void 0:r.Breadcrumbs)&&e(A,{name:"Breadcrumbs",slot:r==null?void 0:r.Breadcrumbs,context:{...m,setSeparator(p){this._registerMethod((...d)=>{const l=p(...d),i=l&&e(lt,{source:l});this._setProps(_=>({..._,separator:i,children:[e(dt,{separator:i,categories:_.categories})]}))})},appendLink(p){this._registerMethod((...d)=>{const{text:l,...i}=p(...d),_=e("a",{...i,children:l});this._setProps(b=>{const T=[...b.categories||[],_];return{...b,categories:T,children:[e(dt,{separator:b.separator,categories:T})]}})})},appendHTMLElement(p){this._registerMethod((...d)=>{const l=p(...d),i=this._htmlElementToVNode(l);this._setProps(_=>{const b=[..._.categories||[],i];return{..._,categories:b,children:[e(dt,{separator:_.separator,categories:b})]}})})}}}),quantity:S,actions:e(A,{name:"Actions",slot:r==null?void 0:r.Actions,context:{...m,appendButton(p){this._registerMethod((...d)=>{const l=p(...d);if(!l)return;const{text:i,icon:_,...b}=l,T=e(bt,{type:"button",...b,icon:_&&e(lt,{source:_}),children:i});this._setProps(yt=>({children:[...yt.children||[],T]}))})}},children:!(r!=null&&r.Actions)&&e(bt,{size:"medium",type:"submit",icon:e(lt,{source:"Cart"}),disabled:!(t!=null&&t.inStock)||!F,"aria-label":J,onClick:()=>G==null?void 0:G(P),children:J})}),shortDescription:v?void 0:e(A,{name:"ShortDescription",slot:r==null?void 0:r.ShortDescription,context:{...m},children:e("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.shortDescription)??""}})}),description:O?void 0:e(A,{name:"Description",slot:r==null?void 0:r.Description,context:{...m},children:e("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.description)??""}})}),images:((Q=t==null?void 0:t.images)==null?void 0:Q.map(({label:p,url:d})=>{var l,i;return e(At,{title:p,alt:p,src:d,width:((l=h==null?void 0:h.imageParams)==null?void 0:l.width)??960,height:((i=h==null?void 0:h.imageParams)==null?void 0:i.height)??1191,params:(h==null?void 0:h.imageParams)??{width:960}},d)}))??[],specialPrice:(at=t==null?void 0:t.prices)!=null&&at.visible?e(A,{name:"SpecialPrice",slot:r==null?void 0:r.SpecialPrice,context:{...m},children:e(Pt,{...t.prices.final,locale:ut(k)})}):void 0,price:(_t=t==null?void 0:t.prices)!=null&&_t.visible&&t.prices.regular&&t.prices.final.amount!==(t==null?void 0:t.prices.regular.amount)?e(A,{name:"RegularPrice",slot:r==null?void 0:r.RegularPrice,context:{...m},children:e(Pt,{...t.prices.regular,locale:ut(k)})}):void 0,zoomType:it,closeButton:K,carouselConfig:{...h,thumbnails:h&&Object.keys(h).length?((mt=t==null?void 0:t.images)==null?void 0:mt.map(({label:p,url:d})=>{var l,i;return e(At,{title:p,alt:p,src:d,width:((l=h==null?void 0:h.thumbnailParams)==null?void 0:l.width)??200,height:((i=h==null?void 0:h.thumbnailParams)==null?void 0:i.height)??248,params:(h==null?void 0:h.thumbnailParams)??{width:200}},d)}))??[]:[]},outOfStock:!(t!=null&&t.inStock),attributes:I?void 0:e(A,{name:"Attributes",slot:r==null?void 0:r.Attributes,context:{...m},children:w!=null&&w.length?V(Nt,{children:[rt,e("ul",{children:w})]}):null}),galleryContent:(r==null?void 0:r.GalleryContent)&&e(A,{name:"GalleryContent",slot:r.GalleryContent,context:{...m}}),infoContent:(r==null?void 0:r.InfoContent)&&e(A,{name:"InfoContent",slot:r.InfoContent,context:{...m}}),productContent:(r==null?void 0:r.Content)&&e(A,{name:"Content",slot:r.Content,context:{...m}})})})};Mt.getInitialData=async function({sku:a,disableDropdownPreselection:N=!1,optionsConfig:y}){var O,I;const v=(I=(O=St.getConfig().models)==null?void 0:O.ProductDetails)==null?void 0:I.initialData;return v?kt(v):ht(a,{preselectFirstOption:!N,anchors:y==null?void 0:y.anchorOptions})};export{Mt as ProductDetails,Mt as default};
|
|
3
|
+
import{jsx as e,jsxs as V,Fragment as Nt}from"@dropins/tools/preact-jsx-runtime.js";import{useState as z,Children as ot,useEffect as f,useCallback as g,useMemo as vt}from"@dropins/tools/preact-compat.js";import{VComponent as o,classes as s,Slot as A,toLanguageTag as ut}from"@dropins/tools/lib.js";import{Incrementer as Ot,Image as bt,Button as At,Icon as dt,Breadcrumbs as lt}from"@dropins/tools/components.js";/* empty css */import{Z as It,C,O as Dt}from"../chunks/Zoom.js";import{useText as B}from"@dropins/tools/i18n.js";import{P as Pt}from"../chunks/PriceRange.js";import{S as wt}from"../chunks/Swatches.js";import"@dropins/tools/preact.js";import{c as St,h as ht,p as st,l as Vt,t as kt}from"../chunks/isProductConfigurationValid.js";import{events as tt}from"@dropins/tools/event-bus.js";import{i as Ut,t as Bt}from"../chunks/date.js";import"../fragments.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getProductConfigurationValues.js";const xt=({title:a,breadcrumbs:N,galleryContent:y,infoContent:v,productContent:O,sku:I,outOfStock:x,shortDescription:L,description:r,attributes:et,images:c,options:h,price:u,specialPrice:Z,className:G,children:it,quantity:K,actions:M,carouselConfig:n,zoomType:J="overlay",closeButton:nt=!0,...rt})=>{var q,F,E,m,$,j,W,X,Y;const pt=B("PDP.Product.RegularPrice.label").label,k=B("PDP.Product.SpecialPrice.label").label,ct=B("PDP.Product.OutOfStock.label").label,U=B("PDP.Product.Image.label").label,[H,t]=z(null),D=c!=null&&c.length?c.map((w,S)=>{var Q;const R=((Q=a==null?void 0:a.props)==null?void 0:Q.children)&&(U==null?void 0:U.replace("{product}",a.props.children.toString()).replace("{key}",String(S+1)).replace("{total}",String(c.length)));return J==="zoom"?e(It,{closeButton:nt,children:e(o,{node:w,loading:S===0?"eager":"lazy",alt:R},S)}):e(o,{node:w,loading:S===0?"eager":"lazy",alt:R,onClick:()=>t(S)},S)}):e("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0}),P=(q=n==null?void 0:n.thumbnails)!=null&&q.length?n.thumbnails.map((w,S)=>{var R;return e(o,{node:w,loading:(n==null?void 0:n.thumbnailsLoadingMode)||"lazy",alt:((R=a==null?void 0:a.props)==null?void 0:R.children)&&(U==null?void 0:U.replace("{product}",a.props.children.toString()).replace("{key}",String(S+1)).replace("{total}",String(c.length)))},S)}):e("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0});return V("div",{...rt,className:s(["pdp-product",G]),children:[N&&e(o,{node:N,className:"pdp-product__breadcrumbs"}),V("div",{className:"pdp-product__column-container pdp-product__gallery-column",children:[e("div",{className:"pdp-product__column-body",children:(F=n==null?void 0:n.controls)!=null&&F.desktop?e(C,{className:"pdp-product__overlay__carousel",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?n.controls.desktop:"dots",arrowsOnMainImage:n==null?void 0:n.arrowsOnMainImage,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,peak:((E=n==null?void 0:n.thumbnails)==null?void 0:E.length)>1&&((m=n==null?void 0:n.peak)==null?void 0:m.desktop)||!1,gap:(n==null?void 0:n.gap)||null,width:"100%",height:"100%",defaultIndex:H||0,thumbnails:P,children:D}):e(Lt,{className:"pdp-product__images",gap:"small",children:D})}),y&&e(o,{node:y,className:"pdp-product__gallery-content"})]}),V("div",{className:"pdp-product__column-container pdp-product__content-column",children:[V("div",{className:"pdp-product__column-body",children:[V("div",{className:"pdp-product__header",children:[a&&e(o,{node:a,className:"pdp-product__title"}),I&&e(o,{node:I,className:"pdp-product__sku"})]}),V("div",{className:"pdp-product__prices",children:[Z&&e(o,{node:Z,className:s(["pdp-product__price-special","pdp-product__price"]),"aria-label":k,role:"text"}),u&&e(o,{node:u,className:s(["pdp-product__price-regular","pdp-product__price--grey"]),"aria-label":pt,role:"text"})]}),($=n==null?void 0:n.controls)!=null&&$.mobile&&((j=n==null?void 0:n.controls)==null?void 0:j.mobile)==="thumbnailsRow"?e(C,{className:"pdp-product__images pdp-product__images--carousel pdp-product__images--carousel--thumbnails",width:"100%",height:"auto",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"thumbnailsRow":null,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,peak:((W=n==null?void 0:n.thumbnails)==null?void 0:W.length)>1&&((X=n==null?void 0:n.peak)==null?void 0:X.mobile)||!1,gap:(n==null?void 0:n.gap)||null,thumbnails:P,children:D}):e(C,{className:"pdp-product__images pdp-product__images--carousel",peak:((Y=n==null?void 0:n.peak)==null?void 0:Y.mobile)&&(c==null?void 0:c.length)>1,gap:(n==null?void 0:n.gap)||null,width:"100%",height:"auto",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"dots":null,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,children:D}),V("div",{className:s(["pdp-product__actions",["pdp-product__actions--out-of-stock",x]]),children:[x&&e("div",{className:"pdp-product__out-of-stock__text",children:ct}),h&&e(o,{node:h,className:s(["pdp-product__options"])}),K&&e("div",{className:"pdp-product__quantity",children:e(o,{node:K})}),M&&e(o,{node:M,className:s(["pdp-product__buttons"])})]}),L&&e(o,{node:L,className:s(["pdp-product__short_description"])}),r&&e(o,{node:r,className:s(["pdp-product__description"])}),et?e("div",{className:"pdp-product__attributes",children:et}):null]}),v&&e(o,{node:v,className:"pdp-product__info-content"})]}),O&&e(o,{node:O,className:"pdp-product__content"}),H===null?null:e(Dt,{className:"pdp-product__overlay",onClose:()=>t(null),centered:!0,children:e(C,{className:"pdp-product__overlay__carousel",arrows:(c==null?void 0:c.length)>1,width:"100%",height:"100%",defaultIndex:H||0,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"dots":null,isZoomed:!0,children:D})})]})},Lt=({children:a,gap:N=null,className:y,style:v,...O})=>{const I=ot.count(a);return e("div",{...O,className:s(["pdp-gallery-grid",y]),style:{"--gap":N?`var(--spacing-${N})`:"0px",...v},children:ot.map(a,(x,L)=>e("div",{className:"pdp-gallery-grid__item",children:e(o,{node:x,loading:L===0?"eager":"lazy"},x.props.src)},I+L))})},Mt=({sku:a,hideSku:N,hideQuantity:y,hideShortDescription:v,hideDescription:O,hideAttributes:I,hideURLParams:x,hideSelectedOptionValue:L,slots:r,children:et,initialData:c,carousel:h,optionsConfig:u,useACDL:Z,onAddToCart:G,zoomType:it,closeButton:K=!0,disableDropdownPreselection:M,...n})=>{var Q,at,_t,mt;const J=B("PDP.Product.AddToCart.label").label,nt=B("PDP.Product.Incrementer.label").label,rt=B("PDP.Product.Details.label").label,pt=B("PDP.Swatches.ChooseOption.label").label,[k,ct]=z(St.getConfig().defaultLocale||"en-US"),[U,H]=z(),[t=null,D]=z(c),[P,q]=z(()=>{const p={sku:a,quantity:1};return t!=null&&t.optionUIDs&&(p.optionsUIDs=t.optionUIDs),p}),[F,E]=z(()=>{var p,d;return!(t!=null&&t.options&&((p=t==null?void 0:t.options)==null?void 0:p.length)>0&&((d=t==null?void 0:t.optionUIDs)==null?void 0:d.length)!==(t==null?void 0:t.options.length))}),m={data:t,values:P,valid:F};function $(p){return p==null?void 0:p.some(d=>(d==null?void 0:d.typename)==="ProductViewOptionValueProduct")}f(()=>{const p=tt.on("pdp/data",l=>{D(l),q(i=>({...i,sku:l.sku,optionsUIDs:l.optionUIDs}))}),d=tt.on("pdp/setValues",l=>{q(i=>({...i,...l}))});return()=>{d==null||d.off(),p==null||p.off()}},[]),f(()=>{const p=tt.on("locale",d=>{d!==k&&(ct(d),ht(a,{preselectFirstOption:!M,anchors:u==null?void 0:u.anchorOptions}).then(D))});return()=>{p==null||p.off()}},[M,k,u==null?void 0:u.anchorOptions,a]),f(()=>{Z&&c&&Object.keys(c).length>0&&st(c)},[c]);const j=g(p=>{q(d=>({...d,...p}))},[]);f(()=>{tt.emit("pdp/values",P)},[JSON.stringify(P)]);const W=g(async p=>{var i,_;let d=Object.entries(p).filter(([b,T])=>T.label!==pt).map(([b,T])=>p[b].value).filter(b=>b!==void 0);!x&&(t!=null&&t.options)&&!$(t.options)&&Vt({optionsUIDs:d.join(",")}),j({optionsUIDs:d}),E((d==null?void 0:d.length)===((i=t==null?void 0:t.options)==null?void 0:i.length));const l=await ht(a,{anchors:u==null?void 0:u.anchorOptions,isBundle:t==null?void 0:t.isBundle,optionsUIDs:d,preselectFirstOption:!M});D(l),(_=u==null?void 0:u.anchorOptions)!=null&&_.length&&X(l,d)},[a]),X=g((p,d)=>{var _;const l=(p==null?void 0:p.optionUIDs)??[];d.every(b=>l.includes(b))||(H(p==null?void 0:p.options),j({optionsUIDs:l}),E((l==null?void 0:l.length)===((_=p==null?void 0:p.options)==null?void 0:_.length)))},[a]),Y=g(p=>{Object.keys(p).length!==0&&E(!1)},[]),w=vt(()=>{var p;return(p=t==null?void 0:t.attributes)==null?void 0:p.map(({label:d,value:l},i)=>{const _=Ut(l)?Bt(l,k):l.toString();return V("li",{children:[d,": ",e("span",{dangerouslySetInnerHTML:{__html:_}})]},i)})},[t==null?void 0:t.attributes,k]),S=!y&&(t!=null&&t.inStock)?e(A,{name:"Quantity",slot:r==null?void 0:r.Quantity,context:{...m},children:e(Ot,{name:"quantity",defaultValue:P.quantity.toString(),value:P.quantity.toString(),min:1,"aria-label":nt,className:"pdp-product__quantity",onValue:p=>{j({quantity:Number(p)})}},"quantity")}):void 0,R=()=>{if(t!=null&&t.options)return e(A,{name:"Options",slot:r==null?void 0:r.Options,context:{...m},children:e(wt,{selectedUIDs:P.optionsUIDs,options:t.options,defaultOptions:P.optionsUIDs,selectionsToUpdate:U,hideSelectedValue:L,disablePreselections:M,onValues:W,onErrors:Y})})};return e("div",{...n,children:e(xt,{title:e(A,{name:"Title",slot:r==null?void 0:r.Title,context:{...m},children:t==null?void 0:t.name}),sku:N?void 0:e(A,{name:"SKU",slot:r==null?void 0:r.SKU,context:{...m},children:t==null?void 0:t.sku}),options:R(),breadcrumbs:(r==null?void 0:r.Breadcrumbs)&&e(A,{name:"Breadcrumbs",slot:r==null?void 0:r.Breadcrumbs,context:{...m,setSeparator(p){this._registerMethod((...d)=>{const l=p(...d),i=l&&e(dt,{source:l});this._setProps(_=>({..._,separator:i,children:[e(lt,{separator:i,categories:_.categories})]}))})},appendLink(p){this._registerMethod((...d)=>{const{text:l,...i}=p(...d),_=e("a",{...i,children:l});this._setProps(b=>{const T=[...b.categories||[],_];return{...b,categories:T,children:[e(lt,{separator:b.separator,categories:T})]}})})},appendHTMLElement(p){this._registerMethod((...d)=>{const l=p(...d),i=this._htmlElementToVNode(l);this._setProps(_=>{const b=[..._.categories||[],i];return{..._,categories:b,children:[e(lt,{separator:_.separator,categories:b})]}})})}}}),quantity:S,actions:e(A,{name:"Actions",slot:r==null?void 0:r.Actions,context:{...m,appendButton(p){this._registerMethod((...d)=>{const l=p(...d);if(!l)return;const{text:i,icon:_,...b}=l,T=e(At,{type:"button",...b,icon:_&&e(dt,{source:_}),children:i});this._setProps(yt=>({children:[...yt.children||[],T]}))})}},children:!(r!=null&&r.Actions)&&e(At,{size:"medium",type:"submit",icon:e(dt,{source:"Cart"}),disabled:!(t!=null&&t.inStock)||!F,"aria-label":J,onClick:()=>G==null?void 0:G(P),children:J})}),shortDescription:v?void 0:e(A,{name:"ShortDescription",slot:r==null?void 0:r.ShortDescription,context:{...m},children:e("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.shortDescription)??""}})}),description:O?void 0:e(A,{name:"Description",slot:r==null?void 0:r.Description,context:{...m},children:e("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.description)??""}})}),images:((Q=t==null?void 0:t.images)==null?void 0:Q.map(({label:p,url:d})=>{var l,i;return e(bt,{title:p,alt:p,src:d,width:((l=h==null?void 0:h.imageParams)==null?void 0:l.width)??960,height:((i=h==null?void 0:h.imageParams)==null?void 0:i.height)??1191,params:(h==null?void 0:h.imageParams)??{width:960}},d)}))??[],specialPrice:(at=t==null?void 0:t.prices)!=null&&at.visible?e(A,{name:"SpecialPrice",slot:r==null?void 0:r.SpecialPrice,context:{...m},children:e(Pt,{...t.prices.final,locale:ut(k)})}):void 0,price:(_t=t==null?void 0:t.prices)!=null&&_t.visible&&t.prices.regular&&t.prices.final.amount!==(t==null?void 0:t.prices.regular.amount)?e(A,{name:"RegularPrice",slot:r==null?void 0:r.RegularPrice,context:{...m},children:e(Pt,{...t.prices.regular,locale:ut(k)})}):void 0,zoomType:it,closeButton:K,carouselConfig:{...h,thumbnails:h&&Object.keys(h).length?((mt=t==null?void 0:t.images)==null?void 0:mt.map(({label:p,url:d})=>{var l,i;return e(bt,{title:p,alt:p,src:d,width:((l=h==null?void 0:h.thumbnailParams)==null?void 0:l.width)??200,height:((i=h==null?void 0:h.thumbnailParams)==null?void 0:i.height)??248,params:(h==null?void 0:h.thumbnailParams)??{width:200}},d)}))??[]:[]},outOfStock:!(t!=null&&t.inStock),attributes:I?void 0:e(A,{name:"Attributes",slot:r==null?void 0:r.Attributes,context:{...m},children:w!=null&&w.length?V(Nt,{children:[rt,e("ul",{children:w})]}):null}),galleryContent:(r==null?void 0:r.GalleryContent)&&e(A,{name:"GalleryContent",slot:r.GalleryContent,context:{...m}}),infoContent:(r==null?void 0:r.InfoContent)&&e(A,{name:"InfoContent",slot:r.InfoContent,context:{...m}}),productContent:(r==null?void 0:r.Content)&&e(A,{name:"Content",slot:r.Content,context:{...m}})})})};Mt.getInitialData=async function({sku:a,disableDropdownPreselection:N=!1,optionsConfig:y}){var O,I;const v=(I=(O=St.getConfig().models)==null?void 0:O.ProductDetails)==null?void 0:I.initialData;return v?kt(v):ht(a,{preselectFirstOption:!N,anchors:y==null?void 0:y.anchorOptions})};export{Mt as ProductDetails,Mt as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
-
import { Container, ResolveImageUrlOptions } from '
|
|
2
|
+
import { Container, ResolveImageUrlOptions } from '../../../@adobe-commerce/elsie/src/lib';
|
|
3
3
|
import { ProductModel } from '../../data/models/product-model';
|
|
4
4
|
|
|
5
5
|
export interface ProductGalleryProps extends Omit<HTMLAttributes<HTMLDivElement>, 'controls'> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
-
import { Container } from '
|
|
2
|
+
import { Container } from '../../../@adobe-commerce/elsie/src/lib';
|
|
3
3
|
import { ProductModel } from '../../data/models';
|
|
4
4
|
|
|
5
5
|
export interface ProductHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
-
import { Container, SlotProps } from '
|
|
2
|
+
import { Container, SlotProps } from '../../../@adobe-commerce/elsie/src/lib';
|
|
3
3
|
import { ProductModel } from '../../data/models';
|
|
4
4
|
|
|
5
5
|
export interface ProductOptionsProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
-
import { Container } from '
|
|
2
|
+
import { Container } from '../../../@adobe-commerce/elsie/src/lib';
|
|
3
3
|
import { ProductModel } from '../../data/models';
|
|
4
4
|
|
|
5
5
|
export interface ProductPriceProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
-
import { Container } from '
|
|
2
|
+
import { Container } from '../../../@adobe-commerce/elsie/src/lib';
|
|
3
3
|
import { ProductModel } from '../../data/models';
|
|
4
4
|
|
|
5
5
|
export interface ProductQuantityProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
-
import { Container } from '
|
|
2
|
+
import { Container } from '../../../@adobe-commerce/elsie/src/lib';
|
|
3
3
|
import { ProductModel } from '../../data/models';
|
|
4
4
|
|
|
5
5
|
export interface ProductShortDescriptionProps extends HTMLAttributes<HTMLDivElement> {
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-pdp", "version": "1.1.
|
|
1
|
+
{"name": "@dropins/storefront-pdp", "version": "1.1.2-alpha1", "@dropins/tools": "~1.0.0", "license": "SEE LICENSE IN LICENSE.md"}
|
package/render/render.d.ts
CHANGED