efficient-storefront-blocks 0.131.1 → 0.132.0
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/CHANGELOG.md +20 -0
- package/dist/chunks/{CustomHtmlCodeWindow-JINOMDUB.js → CustomHtmlCodeWindow-2WCOBTZI.js} +1 -1
- package/dist/chunks/{EditorPreviewCheckout-B5B4BHEG.js → EditorPreviewCheckout-CXHJMY3C.js} +1 -1
- package/dist/chunks/SiteEditorProvider-IOAQH4S4.js +1 -0
- package/dist/chunks/{chunk-3QCDDPXL.js → chunk-3P4XQK3S.js} +1 -1
- package/dist/chunks/{chunk-QYTBEMMG.js → chunk-3RAPOAJE.js} +2 -2
- package/dist/chunks/{chunk-43XANC6T.js → chunk-OBAUAKZL.js} +1 -1
- package/dist/chunks/{chunk-GVSVEV2H.js → chunk-PB4FLVPH.js} +8 -8
- package/dist/chunks/{chunk-SV3VVDBH.js → chunk-TNWF32DT.js} +1 -1
- package/dist/chunks/{chunk-7W33H2GG.js → chunk-UFQDBLLF.js} +1 -1
- package/dist/chunks/{chunk-R5FDAR72.js → chunk-XXVOKKJV.js} +1 -1
- package/dist/chunks/{chunk-PJVO662Y.js → chunk-ZHLVGCNF.js} +1 -1
- package/dist/chunks/{fitment-data-FRSLYOCL.js → fitment-data-MW7I7F7T.js} +1 -1
- package/dist/chunks/{section-css-style-3IQWMPDP.js → section-css-style-7OKHUI7L.js} +1 -1
- package/dist/editor/lib/document/blocks/commerce/GalleryB/fields.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +1 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +28 -28
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/GalleryCard.d.ts +2 -1
- package/dist/render/components/GalleryCard.js +1 -1
- package/dist/render/components/GalleryGrid.d.ts +2 -1
- package/dist/render/components/GalleryGrid.js +3 -3
- package/dist/render/components/GalleryItem.d.ts +1 -0
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/lib/document/blocks/commerce/GalleryB/render.js +1 -1
- package/dist/render/lib/sections/gallery-mosaic.d.ts +3 -0
- package/dist/render/lib/sections/gallery-mosaic.js +1 -0
- package/dist/render/lib/sections/gallery-toolbar.js +1 -1
- package/dist/routine-index.json +1 -1
- package/dist/value-index.json +1 -1
- package/dist/words.d.ts +2 -0
- package/dist/words.js +2 -2
- package/package.json +2 -2
- package/dist/chunks/SiteEditorProvider-CJRYE2LF.js +0 -1
- /package/dist/chunks/{chunk-TICXZI44.js → chunk-2NWFNMO3.js} +0 -0
- /package/dist/chunks/{chunk-QYTBEMMG.js.LEGAL.txt → chunk-3RAPOAJE.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-FVHAKC6L.js → chunk-AHUOASUP.js} +0 -0
- /package/dist/chunks/{chunk-43XANC6T.js.LEGAL.txt → chunk-OBAUAKZL.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-T5PQ7BY4.js → chunk-YDV7IGPY.js} +0 -0
|
@@ -24,6 +24,7 @@ interface Props {
|
|
|
24
24
|
displayPhone?: unknown;
|
|
25
25
|
styleOwner?: string;
|
|
26
26
|
editing?: boolean;
|
|
27
|
+
setCount?: number;
|
|
27
28
|
}
|
|
28
|
-
export default function GalleryCard({ build, hiddenMobile, alwaysShowOverlay, forceHover, index, total, ratio, captionPlace, display, displayPhone, styleOwner, editing }: Props): import("react").JSX.Element;
|
|
29
|
+
export default function GalleryCard({ build, hiddenMobile, alwaysShowOverlay, forceHover, index, total, ratio, captionPlace, display, displayPhone, styleOwner, editing, setCount }: Props): import("react").JSX.Element;
|
|
29
30
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as s}from"react/jsx-runtime";import{useState as S}from"react";import T from"next/image";import u from"efficient-web-builder/render/components/Placeholder";import{withRMark as d}from"efficient-web-builder/render/components/RMark";import{galleryCaptionIsBelow as _,galleryCardRatioClass as w}from"efficient-web-builder/format/lib/content/gallery-card-layout";import{partDisplayClass as R}from"efficient-web-builder/format/lib/content/part-display";import{PART_STYLE_KIND_ATTR as A,PART_STYLE_OWNER_ATTR as C}from"efficient-web-builder/render/lib/document/text-parts";import E from"efficient-web-builder/render/components/PartStyledKind";import{gallerySetChip as L}from"../lib/sections/gallery-mosaic.js";const P=(e,o)=>`${String(e).padStart(2,"0")} / ${String(o).padStart(2,"0")}`;function D({build:e,hiddenMobile:o,alwaysShowOverlay:n,forceHover:l,index:c,total:m,ratio:p,captionPlace:b,display:N,displayPhone:z,styleOwner:h,editing:f=!1,setCount:v}){const a=g=>R(N,z,g),r=g=>f&&h?{[C]:h,[A]:`@${g}`}:{},i=(g,y)=>!f&&h?t(E,{kind:`@${g}`,shared:!0,children:y}):y,[k,j]=S(!1);if(v!=null)return t(I,{build:e,count:v,ratio:p,shown:a,keptAttrs:r,kept:i});const $=_(b),x=s("div",{className:["sf-card group relative overflow-hidden bg-surface-2",w(p),o?"max-view-wide:hidden":""].join(" "),children:[s("div",{className:["absolute inset-0 z-[1] flex items-center justify-center transition-[transform,filter,opacity] duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",l?"scale-[1.06] opacity-0 [filter:brightness(0.5)]":"group-hover:scale-[1.06] group-hover:opacity-0 group-hover:[filter:brightness(0.5)]"].join(" "),children:[t(u,{label:e.imageLabel,src:e.imageSrc}),!n&&t("div",{className:"absolute inset-0",style:{background:"rgba(0,0,0,0.35)"}})]}),t("div",{className:["absolute inset-0 z-[1] flex items-center justify-center transition-[transform,filter,opacity] duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",l?"opacity-100 scale-[1.06] [filter:brightness(0.5)]":"opacity-0 group-hover:scale-[1.06] group-hover:opacity-100 group-hover:[filter:brightness(0.5)]"].join(" "),style:{background:"var(--site-surface)"},children:e.detailSrc&&t(T,{src:e.detailSrc,alt:"",fill:!0,sizes:"(max-width: 800px) 100vw, (max-width: 1500px) 33vw, 25vw",loading:"lazy",className:"absolute inset-0 z-[3] object-cover",style:{display:k?"none":"block"},onError:()=>j(!0)})}),(e.process||c!=null&&m!=null)&&s("div",{className:"pointer-events-none absolute top-3 left-3 right-3 z-[3] flex items-baseline gap-2 max-view-wide:top-2.5 max-view-wide:left-2.5 max-view-wide:right-2.5",children:[e.process&&t("span",{...r("tag"),className:["min-w-0 truncate font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] text-accent",a("tag"),"transition-opacity duration-300 ease-out",n||l?"opacity-100":"opacity-0 group-hover:opacity-100 max-view-wide:opacity-100"].join(" "),children:i("tag",d(e.process))}),c!=null&&m!=null&&t("span",{...r("number"),className:`ml-auto shrink-0 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] ${a("number")}`.trim(),style:{color:"rgba(245,241,232,0.7)"},children:i("number",P(c,m))})]}),t("div",{className:["absolute inset-0 z-[2]","transition-[opacity,transform] duration-300 ease-out",n||l?"opacity-100 translate-y-0":"opacity-0 translate-y-2 group-hover:opacity-100 group-hover:translate-y-0 max-view-wide:opacity-100 max-view-wide:translate-y-0"].join(" "),style:{color:"var(--overlay-fg)",background:n?"linear-gradient(180deg, rgba(10,10,10,.55) 0%, transparent 35%, transparent 55%, rgba(10,10,10,.92) 100%)":"linear-gradient(180deg, transparent 40%, rgba(10,10,10,.85) 100%)"},children:s("div",{className:"absolute inset-x-0 bottom-0 top-9 flex flex-col justify-end gap-1 overflow-hidden p-6 max-view-wide:top-8 max-view-wide:p-3.5",children:[e.car&&t("div",{...r("eyebrow"),className:`truncate font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.2em] text-accent max-view-wide:text-[length:var(--size-label,11px)] max-view-wide:tracking-[0.15em] ${a("eyebrow")}`.trim(),children:i("eyebrow",e.car)}),e.wheel&&t("div",{...r("title"),className:`font-heading3 text-[length:var(--size-headingSmall,22px)] font-medium leading-[1.05] tracking-[-0.02em] max-view-wide:text-[length:var(--size-body,16px)] ${n?"uppercase ":""}${a("title")}`.trim(),children:i("title",e.wheel)}),e.finish&&t("div",{...r("meta"),className:`mt-1.5 flex gap-3.5 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.12em] ${a("meta")}`.trim(),style:{color:"rgba(245,241,232,0.7)"},children:t("span",{children:i("meta",d(e.finish))})})]})})]});return $?s("div",{className:o?"max-view-wide:hidden":"",children:[x,s("div",{className:"bg-surface px-3.5 pt-3 pb-3.5",children:[e.wheel&&t("div",{...r("title"),className:`font-display text-[length:var(--size-body,15px)] font-medium leading-[1.25] tracking-[-0.01em] text-fg ${a("title")}`.trim(),children:i("title",e.wheel)}),(e.finish||e.car)&&t("div",{...r(e.finish?"meta":"eyebrow"),className:`mt-0.5 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] text-fg-dim ${a(e.finish?"meta":"eyebrow")}`.trim(),children:i(e.finish?"meta":"eyebrow",d(e.finish||e.car))})]})]}):x}function I({build:e,count:o,ratio:n,shown:l,keptAttrs:c,kept:m}){const p=L(o);return s("div",{className:`sf-card relative overflow-hidden bg-surface-2 ${w(n)}`,style:{color:"var(--overlay-fg)"},children:[t("div",{className:"absolute inset-0 flex items-center justify-center",children:t(u,{label:e.imageLabel,src:e.imageSrc})}),t("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--overlay-scrim) 0%, transparent) 45%, color-mix(in srgb, var(--overlay-scrim) 70%, transparent))"}}),p&&t("span",{"data-gallery-set-chip":"",className:"absolute right-3 top-3 z-1 bg-overlay-scrim/45 px-2 py-1 text-[length:var(--size-label,11px)] tracking-[0.12em]",children:p}),s("div",{className:"absolute bottom-[18px] left-5 right-5 z-1 max-view-wide:bottom-2.5 max-view-wide:left-3",children:[e.wheel&&t("div",{...c("title"),className:`text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] opacity-85 ${l("title")}`.trim(),children:m("title",d(e.wheel))}),e.car&&t("div",{...c("eyebrow"),className:`mt-1 text-lg leading-normal max-view-wide:text-sm ${l("eyebrow")}`.trim(),children:m("eyebrow",e.car)})]})]})}export{D as default,P as galleryTileNumber};
|
|
@@ -24,5 +24,6 @@ export interface GalleryGridProps {
|
|
|
24
24
|
layoutPhone?: string;
|
|
25
25
|
gap?: number | string;
|
|
26
26
|
gapPhone?: unknown;
|
|
27
|
+
sets?: boolean;
|
|
27
28
|
}
|
|
28
|
-
export default function GalleryGrid({ items: Items, template, nodeId, sourced, num, title, linkText, linkHref, galleryHref, submitHref, previewHover, display, displayPhone, styleOwner, layout, layoutPhone, columns, columnsMobile, gap: gapProp, gapPhone, omitHead, pads, editing, }: GalleryGridProps): import("react").JSX.Element;
|
|
29
|
+
export default function GalleryGrid({ items: Items, template, nodeId, sourced, num, title, linkText, linkHref, galleryHref, submitHref, previewHover, display, displayPhone, styleOwner, layout, layoutPhone, columns, columnsMobile, gap: gapProp, gapPhone, sets, omitHead, pads, editing, }: GalleryGridProps): import("react").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
2
|
-
`),b=f(()=>
|
|
3
|
-
`):[]:c?.blockIds,[
|
|
1
|
+
"use client";import{jsx as r,jsxs as ce}from"react/jsx-runtime";import{useCallback as j,useMemo as f,useState as B}from"react";import{usePathname as me}from"next/navigation";import{containerGapProps as pe}from"efficient-web-builder/format/lib/content/container-gap";import fe from"efficient-web-builder/render/components/Btn";import ge,{GALLERY_GRID_ATTR as ue,GalleryLinksContext as ye,GalleryTilesContext as he}from"./GalleryItem.js";import{useShopperGallery as we}from"./catalog/ShopperScope.js";import{galleryShownIds as Le,galleryToolbarIdle as Se,WALL_PLACED_CELL as Ce,WALL_PLACED_CSS as xe,wallSpanAt as ve}from"../lib/sections/gallery-toolbar.js";import{GALLERY_MOSAIC_LAYOUT as Ge,galleryMosaicRowsCss as Ne}from"../lib/sections/gallery-mosaic.js";import{useSiteSells as _e}from"./SiteRecordContext.js";import{SharedPartKinds as Ae}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as Pe}from"efficient-web-builder/render/components/goldPhrases";import ke from"efficient-web-builder/render/components/SectionHeader";import{FRAME_120 as Oe,framedBandPad as be,headIsEmpty as Ie,withBandClasses as Te}from"../lib/sections/band-padding.js";import{galleryFrame as Ee,galleryTemplate as Re}from"../lib/sections/gallery-frame.js";import{SITE_COLUMN as Me,withSideOnce as je}from"efficient-web-builder/format/lib/content/page-width";import{resolveGridColumns as Be,resolveGridMobileColumns as $e}from"efficient-web-builder/format/lib/content/grid-span";import{galleryLayoutClass as $,galleryLayoutCss as De,resolveGalleryLayout as Ye}from"efficient-web-builder/format/lib/content/gallery-layout";import{HideTaker as ze}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as Fe}from"efficient-web-builder/render/components/SideSpaceOnce";function Ue({items:c,template:D,nodeId:Y,sourced:a,num:x,title:w,linkText:v,linkHref:z,galleryHref:g="/gallery",submitHref:F="/contact",previewHover:U,display:W,displayPhone:K,styleOwner:V,layout:G,layoutPhone:q,columns:u,columnsMobile:H,gap:J,gapPhone:Q,sets:N=!1,omitHead:L=!1,pads:X,editing:_=!1}){const Z=Fe(),ee=me(),le=_e(),se=g!==ee&&(le||g!=="/gallery"),y={layout:G,layoutPhone:q},m=Ye(y),re=!m&&u!=null&&u!=="",i=pe("GalleryB",J,"both",Q),A=m?{className:`sf-card-grid sf-gallery-zone ${$(y)} grid${i.className}`,style:i.style}:re?{className:`sf-card-grid sf-grid-zone grid${i.className}`,style:{...i.style,"--sf-grid-cols":String(Be(u)),"--sf-grid-cols-phone":String($e(H,u))}}:{className:`sf-card-grid grid grid-cols-4${i.className} max-[1500px]:grid-cols-3 max-view-wide:grid-cols-1`,style:i.style},P=v?{text:v,href:z||"#"}:void 0,ne=w?Pe(w,!1):void 0,[k,te]=B({}),O=j((e,s)=>{te(l=>{const o=l[e.id];if(s){if(!o)return l;const{[e.id]:We,...de}=l;return de}return o&&o.tag===e.tag&&o.name===e.name?l:{...l,[e.id]:e}})},[]),h=a?.map(e=>e.tile.id).join(`
|
|
2
|
+
`),b=f(()=>h!==void 0?h?h.split(`
|
|
3
|
+
`):[]:c?.blockIds,[h,c?.blockIds]),d=f(()=>(b??[]).map(e=>k[e]).filter(e=>!!e),[b,k]),{ref:oe,toolbar:p}=we(d),I=p!==null&&!Se(p,d),n=f(()=>I&&p?Le(d,p):null,[I,p,d]),t=f(()=>n??d.map(e=>e.id),[n,d]),[T,ae]=B(null),E=j((e,s)=>{const l=t.indexOf(e);l<0||t.length<2||ae({id:t[(l+s+t.length)%t.length],at:s>0?"first":"last"})},[t]),ie=f(()=>{const e=new Map((n??[]).map((s,l)=>[s,l]));return{report:O,positionOf:s=>{const l=n?e.get(s):void 0;return l===void 0?null:{index:l+1,total:n.length}},walkCount:t.length,walk:E,opening:T}},[O,n,t.length,E,T]),S=n?e=>{const s=n.indexOf(e);if(s<0)return{style:{display:"none"}};if(!m)return{style:{order:s}};const l=ve(m,s,n.length);return{className:Ce,style:{order:s,"--sf-wall-c":l.col,"--sf-wall-r":l.row,"--sf-wall-cp":l.colPhone,"--sf-wall-rp":l.rowPhone}}}:void 0,R=m?De(y)+(G===Ge?Ne($(y)):""):"",C=be(X,Oe,{noTop:L,nonNegative:!0}),M=Re(D,!a);return r(ze,{as:"section",ref:oe,...C.attrs,className:Te(Ee(L,!!M),C),style:C.style,children:ce("div",{className:je(Me,Z),children:[L||!_&&Ie(x,w,P?.text)?null:r(ke,{num:x,title:ne,link:P}),R?r("style",{dangerouslySetInnerHTML:{__html:R+(n?xe:"")}}):null,(c||a)&&r(ye.Provider,{value:{galleryHref:g,submitHref:F,previewHover:U,display:W,displayPhone:K,styleOwner:V,wordsAtRest:!!a,ownerId:Y,Template:M,...N?{sets:N}:{}},children:r(he.Provider,{value:ie,children:r(Ae,{children:r("div",{[ue]:"",style:{display:"contents"},children:a?r("div",{...A,children:a.map(({tile:e,...s})=>{const l=r(ge,{...s,tile:e,editing:_},e.id),o=S?.(e.id);return o?r("div",{className:o.className,style:o.style,children:l},e.id):l})}):c?r(c,{...A,minEmptyHeight:320,...S?{cell:S}:{}}):null})})})}),se&&r("div",{className:"mt-12 flex flex-col items-center gap-3",children:r(fe,{href:g,variant:"ghost",children:"See Gallery"})})]})})}export{Ue as default};
|
|
@@ -12,6 +12,7 @@ export declare const GalleryLinksContext: import("react").Context<{
|
|
|
12
12
|
wordsAtRest?: boolean;
|
|
13
13
|
Template?: ReturnType<typeof galleryTemplate>;
|
|
14
14
|
ownerId?: string;
|
|
15
|
+
sets?: boolean;
|
|
15
16
|
}>;
|
|
16
17
|
export declare const GALLERY_TILE_PARTS: readonly [{
|
|
17
18
|
readonly id: "tag";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as n,Fragment as x}from"react/jsx-runtime";import{createContext as V,useCallback as ae,useContext as X,useEffect as q,useRef as se,useState as I}from"react";import P from"next/link";import{slugify as ie}from"efficient-shell/format";import{CardTemplateRows as ce}from"efficient-web-builder/render/components/CardRowContext";import{BOX_HOLDS_NO_GUTTER_CLASS as pe,SIDE_ONCE_HOLDS_CLASS as de}from"efficient-web-builder/format/lib/content/page-width";import me,{galleryTileNumber as fe}from"./GalleryCard.js";import he,{LightboxClose as xe,LIGHTBOX_CLOSE_TINT as ue}from"./Lightbox.js";import{useSiteSells as ge}from"./SiteRecordContext.js";import{renderGold as f,renderHeadline as Z}from"efficient-web-builder/render/components/goldPhrases";import{sizedImage as be}from"efficient-web-builder/format/lib/sized-image";import{useBrowserLayoutEffect as ve}from"efficient-shell/hooks";import{HideTaker as J}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as we}from"efficient-web-builder/render/components/SideSpaceOnce";const ye="(max-width: 1100px) 100vw, min(59vw, 1050px)",ke=V({}),Ue=[{id:"tag",label:"Tag"},{id:"eyebrow",label:"Eyebrow"},{id:"title",label:"Title"},{id:"meta",label:"Meta"},{id:"number",label:"Card number"}],Ne=V(null),Se="data-gallery-grid",z="data-gallery-tile";function Le(t,o){const[a,i]=I(null);return q(()=>{const c=t.current,s=c?.closest(`[${Se}]`);if(!c||!s)return;const w=()=>{const k=Array.from(s.querySelectorAll(`[${z}]`)),N=k.indexOf(c),u=N>=0?{index:N+1,total:k.length}:null;i(g=>g?.index===u?.index&&g?.total===u?.total?g:u)};if(w(),!o)return;const y=new MutationObserver(w);return y.observe(s,{childList:!0,subtree:!0}),()=>y.disconnect()},[t,o]),a}const Ve={process:"Category",eyebrow:"Subtitle",name:"Item name",meta:"Detail"},_e=()=>({image:"",href:"#",process:"",eyebrow:"",name:"",meta:""}),Xe=Array.from({length:6},_e);function Ce(t){const o=(t.photos??[]).map(s=>s?.src).filter(s=>!!s),a=t.image||o[0]||"",i=[a,...o].filter(s=>!!s),c=ie(t.name)||"gallery-item";return{car:t.eyebrow??"",wheel:t.name??"",process:t.process??"",finish:t.meta??"",imageLabel:`${c}.jpg`,detailLabel:`${c}-detail.jpg`,imageSrc:a||void 0,detailSrc:o[0]||a||void 0,photos:i,href:t.href}}function Te({editing:t=!1,previewHover:o,ratio:a,captionPlace:i,tile:c,...s}){const w=we(),{galleryHref:y="/gallery",submitHref:k="/contact",previewHover:N,display:u,displayPhone:g,styleOwner:ee,photosOnly:te=!1,wordsAtRest:re=!1,Template:A,ownerId:oe}=X(ke),e=Ce(s),b=ge()&&!te,H=!b&&!Oe(e),p=e.photos??(e.imageSrc?[e.imageSrc]:[]),$=se(null),j=ae(l=>{$.current=l},[]),ne=Le($,t),h=X(Ne),S=h?.report,d=c?.id,G=c?.tag??"",R=c?.name??"";ve(()=>{if(!S||!d)return;const l={id:d,tag:G,name:R};return S(l),()=>S(l,!0)},[S,d,G,R]);const v=(d?h?.positionOf(d):null)??ne,B=t&&(!!o||!!N),[le,m]=I(!1),[L,C]=I(0),M=!!d&&!!h&&h.walkCount>1,D=l=>{const E=L+l;if(M&&(E<0||E>=p.length)){m(!1),h.walk(d,l);return}C((E+p.length)%p.length)},Y=()=>D(-1),W=()=>D(1),T=p.length>1||M,_=h?.opening;q(()=>{!_||_.id!==d||(C(_.at==="last"?Math.max(0,p.length-1):0),m(!0))},[_,d]);const O=p[L]??e.imageSrc??"",F=p.slice(1),U=A?r("div",{className:`block w-full min-w-0 ${pe}${w?` ${de}`:""}`,children:r(ce,{ownerId:oe??"GalleryB",ownerType:"GalleryB",Template:A,rows:[{key:d??e.imageSrc??"tile",image:e.imageSrc??"",tag:e.process,number:v?fe(v.index,v.total):"",eyebrow:e.car,name:e.wheel,meta:e.finish,href:e.href??""}],items:[{hoverMedia:F.length?{photos:[{finish:"",items:F.map(l=>({url:l,kind:"image"}))}]}:null}],previewHover:B,fallback:null,children:l=>l})}):r(me,{build:e,forceHover:B,alwaysShowOverlay:re,index:v?.index,total:v?.total,ratio:a,captionPlace:i,display:u,displayPhone:g,styleOwner:ee,editing:t});return n(x,{children:[t?r(J,{as:"div",ref:j,[z]:"",className:"block w-full text-left",children:U}):r(J,{as:"button",ref:j,[z]:"",type:"button","aria-label":b?`Open ${e.car||"build"} on ${e.wheel||"wheel"}`:Q(e),onClick:()=>{C(0),m(!0)},className:"block w-full cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",children:U}),r(he,{open:le,onClose:()=>m(!1),label:b?`${e.car} on ${e.wheel}`:Q(e),onPrev:T?Y:void 0,onNext:T?W:void 0,className:"flex items-center justify-center p-6 max-[700px]:p-3",children:n("div",{onClick:l=>l.stopPropagation(),className:`relative grid w-[min(1800px,100%)] max-h-[calc(100vh-48px)] ${H?"grid-cols-1":"grid-cols-[1.4fr_1fr]"} overflow-hidden border border-line bg-bg max-view-desktop:grid-cols-1 max-view-desktop:overflow-auto`,style:{boxShadow:"0 60px 120px -20px color-mix(in srgb, var(--sf-shadow-color, #141416) 70%, transparent)"},children:[r(xe,{label:"Close popup",className:"absolute right-[24px] top-[24px] z-[5] flex h-[56px] w-[56px] items-center justify-center border border-line font-mono text-[length:var(--size-label,21px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:ue},children:"✕"}),n("div",{className:"relative flex min-h-[690px] items-center justify-center overflow-hidden bg-surface-2 max-view-desktop:min-h-[450px]",children:[O&&r("img",{...be(O,{fallbackWidth:1280}),sizes:ye,alt:`${(b?e.car:e.wheel||e.car)||"Photo"} — ${L+1} of ${p.length}`,className:"block h-full max-h-[88vh] w-full object-cover"},O),T&&n(x,{children:[r("button",{type:"button","aria-label":"Previous photo",onClick:Y,className:"absolute left-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),r("button",{type:"button","aria-label":"Next photo",onClick:W,className:"absolute right-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"}),p.length>1&&n("span",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[L+1," / ",p.length]})]})]}),b?n("div",{className:"flex flex-col gap-[30px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[e.process&&r("span",{className:"font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.3em] text-accent",children:f(e.process)}),e.wheel&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:Z(e.wheel,!1)}),e.car&&n("div",{className:"font-heading3 text-[length:var(--size-headingSmall,27px)] leading-[1.4] text-fg",children:["on ",r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em]",children:f(e.car,!0)})]}),n("dl",{className:"mt-3 grid grid-cols-[auto_1fr] gap-x-7 gap-y-[18px] border-y border-line py-[30px] font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em]",children:[e.wheel&&n(x,{children:[r("dt",{className:"text-fg-dim",children:"Wheel"}),r("dd",{className:"text-fg",children:f(e.wheel)})]}),e.process&&n(x,{children:[r("dt",{className:"text-fg-dim",children:"Process"}),r("dd",{className:"text-fg",children:f(e.process)})]}),e.finish&&n(x,{children:[r("dt",{className:"text-fg-dim",children:"Finish"}),r("dd",{className:"text-fg",children:f(e.finish)})]}),e.car&&n(x,{children:[r("dt",{className:"text-fg-dim",children:"Vehicle"}),r("dd",{className:"text-fg",children:f(e.car)})]})]}),n("div",{className:"mt-auto flex flex-col gap-3.5 pt-6",children:[n(P,{href:e.href||"/wheels",onClick:()=>m(!1),className:"group flex items-center justify-between gap-6 border border-btn bg-btn px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg",children:[r("span",{children:"View product"}),r("span",{className:"transition-transform group-hover:translate-x-[6px]",children:"→"})]}),n(P,{href:y,onClick:()=>m(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"See more builds"}),r("span",{children:"→"})]}),n(P,{href:k,onClick:()=>m(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"Submit your build"}),r("span",{children:"→"})]})]})]}):!H&&r(Ee,{build:e})]})})]})}function K(t){return[t.process,t.car,t.finish].filter((o,a,i)=>!!o&&o!==t.wheel&&i.indexOf(o)===a)}function Oe(t){return!!t.wheel||K(t).length>0}function Q(t){const o=t.wheel||t.car;return o?`Open photo of ${o}`:"Open photo"}function Ee({build:t}){const o=t.wheel,a=K(t);return n("div",{className:"flex flex-col gap-[24px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[o&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:Z(o,!1)}),a.map(i=>r("p",{className:"text-[length:var(--size-body,18px)] leading-[1.5] text-fg",children:f(i)},i))]})}export{Se as GALLERY_GRID_ATTR,Ve as GALLERY_ITEM_HINTS,Xe as GALLERY_ITEM_SEEDS,z as GALLERY_TILE_ATTR,Ue as GALLERY_TILE_PARTS,ke as GalleryLinksContext,Ne as GalleryTilesContext,Te as default};
|
|
1
|
+
"use client";import{jsx as r,jsxs as l,Fragment as y}from"react/jsx-runtime";import{createContext as K,useCallback as de,useContext as J,useEffect as Q,useRef as me,useState as z}from"react";import I from"next/link";import{SiteLink as pe}from"efficient-web-builder/render/lib/site-runtime";import{GALLERY_PHONE_BREAKPOINT as fe}from"efficient-web-builder/format/lib/content/gallery-layout";import{slugify as he}from"efficient-shell/format";import{CardTemplateRows as xe}from"efficient-web-builder/render/components/CardRowContext";import{BOX_HOLDS_NO_GUTTER_CLASS as ge,SIDE_ONCE_HOLDS_CLASS as ue}from"efficient-web-builder/format/lib/content/page-width";import be,{galleryTileNumber as we}from"./GalleryCard.js";import ee,{LightboxClose as te,LIGHTBOX_CLOSE_TINT as ve}from"./Lightbox.js";import{useSiteSells as ye}from"./SiteRecordContext.js";import{renderGold as b,renderHeadline as re}from"efficient-web-builder/render/components/goldPhrases";import{sizedImage as A}from"efficient-web-builder/format/lib/sized-image";import{useBrowserLayoutEffect as Ne}from"efficient-shell/hooks";import{HideTaker as oe}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as ke}from"efficient-web-builder/render/components/SideSpaceOnce";const Se="(max-width: 1100px) 100vw, min(59vw, 1050px)",_e=K({}),et=[{id:"tag",label:"Tag"},{id:"eyebrow",label:"Eyebrow"},{id:"title",label:"Title"},{id:"meta",label:"Meta"},{id:"number",label:"Card number"}],Ce=K(null),Le="data-gallery-grid",j="data-gallery-tile";function Te(t,o){const[a,c]=z(null);return Q(()=>{const i=t.current,n=i?.closest(`[${Le}]`);if(!i||!n)return;const w=()=>{const g=Array.from(n.querySelectorAll(`[${j}]`)),f=g.indexOf(i),m=f>=0?{index:f+1,total:g.length}:null;c(N=>N?.index===m?.index&&N?.total===m?.total?N:m)};if(w(),!o)return;const x=new MutationObserver(w);return x.observe(n,{childList:!0,subtree:!0}),()=>x.disconnect()},[t,o]),a}const tt={process:"Category",eyebrow:"Subtitle",name:"Item name",meta:"Detail"},$e=()=>({image:"",href:"#",process:"",eyebrow:"",name:"",meta:""}),rt=Array.from({length:6},$e);function Ee(t){const o=(t.photos??[]).map(n=>n?.src).filter(n=>!!n),a=t.image||o[0]||"",c=[a,...o].filter(n=>!!n),i=he(t.name)||"gallery-item";return{car:t.eyebrow??"",wheel:t.name??"",process:t.process??"",finish:t.meta??"",imageLabel:`${i}.jpg`,detailLabel:`${i}-detail.jpg`,imageSrc:a||void 0,detailSrc:o[0]||a||void 0,photos:c,href:t.href}}function Oe({editing:t=!1,previewHover:o,ratio:a,captionPlace:c,tile:i,...n}){const w=ke(),{galleryHref:x="/gallery",submitHref:g="/contact",previewHover:f,display:m,displayPhone:N,styleOwner:ae,photosOnly:ne=!1,wordsAtRest:ie=!1,Template:G,ownerId:se,sets:R=!1}=J(_e),e=Ee(n),k=ye()&&!ne,B=!k&&!Pe(e),d=e.photos??(e.imageSrc?[e.imageSrc]:[]),M=me(null),D=de(s=>{M.current=s},[]),ce=Te(M,t),v=J(Ce),C=v?.report,p=i?.id,W=i?.tag??"",Y=i?.name??"";Ne(()=>{if(!C||!p)return;const s={id:p,tag:W,name:Y};return C(s),()=>C(s,!0)},[C,p,W,Y]);const S=(p?v?.positionOf(p):null)??ce,F=t&&(!!o||!!f),[U,h]=z(!1),[_,L]=z(0),X=!!p&&!!v&&v.walkCount>1,V=s=>{const P=_+s;if(X&&(P<0||P>=d.length)){h(!1),v.walk(p,s);return}L((P+d.length)%d.length)},T=()=>V(-1),$=()=>V(1),u=d.length>1||X,E=v?.opening;Q(()=>{!E||E.id!==p||(L(E.at==="last"?Math.max(0,d.length-1):0),h(!0))},[E,p]);const O=d[_]??e.imageSrc??"",Z=d.slice(1),q=G?r("div",{className:`block w-full min-w-0 ${ge}${w?` ${ue}`:""}`,children:r(xe,{ownerId:se??"GalleryB",ownerType:"GalleryB",Template:G,rows:[{key:p??e.imageSrc??"tile",image:e.imageSrc??"",tag:e.process,number:S?we(S.index,S.total):"",eyebrow:e.car,name:e.wheel,meta:e.finish,href:e.href??""}],items:[{hoverMedia:Z.length?{photos:[{finish:"",items:Z.map(s=>({url:s,kind:"image"}))}]}:null}],previewHover:F,fallback:null,children:s=>s})}):r(be,{build:e,forceHover:F,alwaysShowOverlay:ie,index:S?.index,total:S?.total,ratio:a,captionPlace:c,display:m,displayPhone:N,styleOwner:ae,editing:t,...R?{setCount:d.length}:{}});return l(y,{children:[t?r(oe,{as:"div",ref:D,[j]:"",className:"block w-full text-left",children:q}):r(oe,{as:"button",ref:D,[j]:"",type:"button","aria-label":k?`Open ${e.car||"build"} on ${e.wheel||"wheel"}`:H(e),onClick:()=>{L(0),h(!0)},className:"block w-full cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",children:q}),R?r(ee,{open:U,onClose:()=>h(!1),label:e.car&&e.wheel?`${e.car} on ${e.wheel}`:H(e),onPrev:u?T:void 0,onNext:u?$:void 0,className:"bg-bg",children:r(je,{build:e,set:d,index:_,onPick:L,onPrev:u?T:void 0,onNext:u?$:void 0,onLeave:()=>h(!1)})}):r(ee,{open:U,onClose:()=>h(!1),label:k?`${e.car} on ${e.wheel}`:H(e),onPrev:u?T:void 0,onNext:u?$:void 0,className:"flex items-center justify-center p-6 max-[700px]:p-3",children:l("div",{onClick:s=>s.stopPropagation(),className:`relative grid w-[min(1800px,100%)] max-h-[calc(100vh-48px)] ${B?"grid-cols-1":"grid-cols-[1.4fr_1fr]"} overflow-hidden border border-line bg-bg max-view-desktop:grid-cols-1 max-view-desktop:overflow-auto`,style:{boxShadow:"0 60px 120px -20px color-mix(in srgb, var(--sf-shadow-color, #141416) 70%, transparent)"},children:[r(te,{label:"Close popup",className:"absolute right-[24px] top-[24px] z-[5] flex h-[56px] w-[56px] items-center justify-center border border-line font-mono text-[length:var(--size-label,21px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:ve},children:"✕"}),l("div",{className:"relative flex min-h-[690px] items-center justify-center overflow-hidden bg-surface-2 max-view-desktop:min-h-[450px]",children:[O&&r("img",{...A(O,{fallbackWidth:1280}),sizes:Se,alt:`${(k?e.car:e.wheel||e.car)||"Photo"} — ${_+1} of ${d.length}`,className:"block h-full max-h-[88vh] w-full object-cover"},O),u&&l(y,{children:[r("button",{type:"button","aria-label":"Previous photo",onClick:T,className:"absolute left-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),r("button",{type:"button","aria-label":"Next photo",onClick:$,className:"absolute right-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"}),d.length>1&&l("span",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[_+1," / ",d.length]})]})]}),k?l("div",{className:"flex flex-col gap-[30px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[e.process&&r("span",{className:"font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.3em] text-accent",children:b(e.process)}),e.wheel&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:re(e.wheel,!1)}),e.car&&l("div",{className:"font-heading3 text-[length:var(--size-headingSmall,27px)] leading-[1.4] text-fg",children:["on ",r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em]",children:b(e.car,!0)})]}),l("dl",{className:"mt-3 grid grid-cols-[auto_1fr] gap-x-7 gap-y-[18px] border-y border-line py-[30px] font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em]",children:[e.wheel&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Wheel"}),r("dd",{className:"text-fg",children:b(e.wheel)})]}),e.process&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Process"}),r("dd",{className:"text-fg",children:b(e.process)})]}),e.finish&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Finish"}),r("dd",{className:"text-fg",children:b(e.finish)})]}),e.car&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Vehicle"}),r("dd",{className:"text-fg",children:b(e.car)})]})]}),l("div",{className:"mt-auto flex flex-col gap-3.5 pt-6",children:[l(I,{href:e.href||"/wheels",onClick:()=>h(!1),className:"group flex items-center justify-between gap-6 border border-btn bg-btn px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg",children:[r("span",{children:"View product"}),r("span",{className:"transition-transform group-hover:translate-x-[6px]",children:"→"})]}),l(I,{href:x,onClick:()=>h(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"See more builds"}),r("span",{children:"→"})]}),l(I,{href:g,onClick:()=>h(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"Submit your build"}),r("span",{children:"→"})]})]})]}):!B&&r(ze,{build:e})]})})]})}function le(t){return[t.process,t.car,t.finish].filter((o,a,c)=>!!o&&o!==t.wheel&&c.indexOf(o)===a)}function Pe(t){return!!t.wheel||le(t).length>0}function H(t){const o=t.wheel||t.car;return o?`Open photo of ${o}`:"Open photo"}function ze({build:t}){const o=t.wheel,a=le(t);return l("div",{className:"flex flex-col gap-[24px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[o&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:re(o,!1)}),a.map(c=>r("p",{className:"text-[length:var(--size-body,18px)] leading-[1.5] text-fg",children:b(c)},c))]})}const Ie=360,Ae="120px";function je({build:t,set:o,index:a,onPick:c,onPrev:i,onNext:n,onLeave:w}){const x=o[a]??t.imageSrc??"",g="absolute top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg bg-bg text-lg text-fg max-view-wide:hidden";return l("div",{onClick:f=>f.stopPropagation(),className:"grid h-full w-full grid-cols-[1fr_360px] bg-bg text-fg max-view-wide:grid-cols-1 max-view-wide:grid-rows-[auto_1fr] max-view-wide:overflow-auto",children:[l("div",{className:"relative grid min-h-0 place-items-center bg-surface-2 py-12 max-view-wide:p-0",children:[x&&r("img",{...A(x,{fallbackWidth:1280}),sizes:`(max-width: ${fe}px) 100vw, calc(100vw - ${Ie}px)`,alt:`${t.car||t.wheel||"Photo"} — ${a+1} of ${o.length}`,className:"block max-h-[calc(100vh-96px)] max-w-[calc(100%-192px)] max-view-wide:max-h-[60vh] max-view-wide:max-w-full"},x),i&&r("button",{type:"button","aria-label":"Previous photo",onClick:i,className:`${g} left-6`,children:"‹"}),n&&r("button",{type:"button","aria-label":"Next photo",onClick:n,className:`${g} right-6`,children:"›"})]}),l("div",{"data-gallery-set-side":"",className:"flex min-h-0 flex-col overflow-auto p-8 max-view-wide:px-4 max-view-wide:py-5",children:[r(te,{label:"Close popup",className:"flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center self-end border border-fg bg-bg text-lg text-fg max-view-wide:fixed max-view-wide:right-3 max-view-wide:top-3 max-view-wide:z-5",children:"✕"}),t.wheel&&r("div",{className:"mt-10 text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-fg-dim max-view-wide:mt-0",children:t.wheel}),t.car&&r("div",{className:"mt-2 mb-2 text-2xl leading-normal",children:t.car}),l("div",{className:"text-xs leading-normal text-fg-dim",children:[a+1," / ",o.length]}),o.length>1&&r("div",{className:"mt-8 grid grid-cols-3 gap-2 max-view-wide:grid-cols-5",children:o.map((f,m)=>r("button",{type:"button","data-gallery-set-thumb":"","aria-label":`Show photo ${m+1}`,"aria-current":m===a?"true":void 0,onClick:()=>c(m),className:`block cursor-pointer p-0 ${m===a?"opacity-100 outline outline-1 outline-offset-2 outline-fg":"opacity-50"}`,children:r("img",{...A(f,{fallbackWidth:320,maxWidth:640}),sizes:Ae,alt:"",loading:"lazy",className:"block aspect-[4/3] w-full object-cover"})},`${f}-${m}`))}),t.wheel&&t.href&&l(pe,{href:t.href,onClick:w,className:"mt-auto inline-block self-start border border-fg px-8 py-3 text-xs text-fg max-view-wide:mt-6",children:["See ",t.wheel]})]})]})}export{Le as GALLERY_GRID_ATTR,tt as GALLERY_ITEM_HINTS,rt as GALLERY_ITEM_SEEDS,j as GALLERY_TILE_ATTR,et as GALLERY_TILE_PARTS,_e as GalleryLinksContext,Ce as GalleryTilesContext,Oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as g,jsx as d}from"react/jsx-runtime";import{phoneKey as H}from"efficient-easel/draw";import k,{SourcedGalleryGrid as P}from"../../../../../components/pdp-dynamic/DynamicGalleryGrid.js";import{declaredBlockSource as h,sourcedRows as x}from"efficient-web-builder/format/lib/content/block-sources";import y from"../../../../../components/GalleryGrid.js";import{PRODUCT_PICTURES_SOURCE as w,productPictureTiles as T,productPicturesLayout as v}from"../../../../sections/product-pictures.js";import{hidableText as a}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as G}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as
|
|
1
|
+
import{Fragment as g,jsx as d}from"react/jsx-runtime";import{phoneKey as H}from"efficient-easel/draw";import k,{SourcedGalleryGrid as P}from"../../../../../components/pdp-dynamic/DynamicGalleryGrid.js";import{declaredBlockSource as h,sourcedRows as x}from"efficient-web-builder/format/lib/content/block-sources";import y from"../../../../../components/GalleryGrid.js";import{PRODUCT_PICTURES_SOURCE as w,productPictureTiles as T,productPicturesLayout as v}from"../../../../sections/product-pictures.js";import{hidableText as a}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as G}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as i}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{bandPadProps as u}from"../../../../sections/band-padding.js";import{GalleryBMeta as B,GALLERY_B_PH as l}from"./meta.js";const U={...B,render:e=>{const m=G(e.headPlacement)==="own-box",t=n=>m?void 0:n,o={num:t(i(e.num,l.num,e.editor)),title:t(i(e.title,l.title,e.editor)),omitHead:m,linkText:t(i(e.linkText,l.link,e.editor)),linkHref:t(a(e.linkHref)||"/contact"),galleryHref:a(e.galleryHref)||"/gallery",previewHover:e.previewHover,display:e.display,displayPhone:e.displayPhone,styleOwner:e.id,layout:e.layout,layoutPhone:e.layoutPhone,columns:e.columns,columnsMobile:e.columnsMobile,gap:e.gap,gapPhone:e[H("gap")],sets:e.sets===!0,pads:u(e),editing:e.editor?.isEditing,template:e.template,nodeId:typeof e.id=="string"?e.id:void 0},c=h(e);if(c===w){const n=!!e.editor?.isEditing,r=T(e,n,e.limit);return!n&&r.length===0?d(g,{}):d(y,{...o,layout:v(e),sourced:r})}if(c!==""){const n=!!e.editor?.isEditing,{rows:r,sample:f}=x(e,n);return d(P,{num:t(i(e.num,l.num,e.editor)),title:t(i(e.title,l.title,e.editor)),linkText:t(i(e.linkText,l.link,e.editor)),linkHref:t(a(e.linkHref)||"/contact"),omitHead:m,rows:f?[]:r,limit:e.limit,layout:e.layout,editing:n,pads:u(e)})}return e.dynamic?d(k,{num:t(i(e.num,l.num,e.editor)),title:t(i(e.title,l.title,e.editor)),linkText:t(i(e.linkText,l.link,e.editor)),linkHref:t(a(e.linkHref)||"/contact"),omitHead:m,galleryHref:a(e.galleryHref)||"/gallery",zone:e.mediaZone||"all",photoDisplay:e.photoDisplay||"covers",previewHover:e.previewHover,display:e.display,displayPhone:e.displayPhone,styleOwner:e.id,editing:e.editor?.isEditing,pads:u(e),template:o.template,nodeId:o.nodeId}):d(y,{...o,items:e.items})}};export{U as GalleryBRender};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{GALLERY_PHONE_BREAKPOINT as t}from"efficient-web-builder/format/lib/content/gallery-layout";const n="mosaic",s=260,e=150;function a(o){const r=`.${o}.sf-gallery-zone`;return`${r}{grid-auto-rows:${s}px}@media (max-width:${t}px){${r}{grid-auto-rows:${e}px}}`}function p(o){return o>1?`${o} photos`:""}export{n as GALLERY_MOSAIC_LAYOUT,a as galleryMosaicRowsCss,p as gallerySetChip};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{galleryCellAt as a}from"efficient-web-builder/format/lib/content/gallery-layout";const u=["newest","name"],f={newest:"Newest",name:"Name A–Z"},w={tag:null,sort:"newest"};function i(n){const r=[];for(const o of n){const t=o.tag.trim();t&&!r.includes(t)&&r.push(t)}return r}function s(n,r){return n!==null&&i(r).includes(n)?n:null}function L(n,r){return s(n.tag,r)===null&&n.sort==="newest"}function g(n,r){const o=s(r.tag,n),t=o===null?[...n]:n.filter(e=>e.tag.trim()===o);return r.sort==="name"&&t.sort((e,l)=>e.name.localeCompare(l.name)),t.map(e=>e.id)}function d(n,r,o){const[t,e]=a(n,!1,r,o),[l,c]=a(n,!0,r,o);return{col:t,row:e,colPhone:l,rowPhone:c}}const p="sf-wall-placed",x=`.${p}{grid-column:span var(--sf-wall-c) !important;grid-row:span var(--sf-wall-r) !important}@media (max-width:800px){.${p}{grid-column:span var(--sf-wall-cp) !important;grid-row:span var(--sf-wall-rp) !important}}`;export{w as EMPTY_GALLERY_TOOLBAR,u as GALLERY_SORT_KEYS,f as GALLERY_SORT_LABELS,p as WALL_PLACED_CELL,x as WALL_PLACED_CSS,s as clampGalleryTag,g as galleryShownIds,i as galleryTags,L as galleryToolbarIdle,d as wallSpanAt};
|