efficient-storefront-blocks 0.133.8 → 0.133.10

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.
@@ -1 +1 @@
1
- "use client";import{jsx as b,Fragment as I,jsxs as N}from"react/jsx-runtime";import{createContext as A,useCallback as O,useContext as R,useEffect as j,useLayoutEffect as H,useRef as g,useState as K}from"react";import{createPortal as P}from"react-dom";import{SITE_BLUR as B,SITE_TINT as $}from"./PopupFrame.js";import{useModalDismiss as F}from"./useModalDismiss.js";const G=".sf-themed-content",_="sf-section-accent";function M(n,o){const s={};let i=!1;const c=[];for(let e=n;e&&e!==o;e=e.parentElement)c.push(e);for(const e of c.reverse()){e.classList.contains(_)&&(i=!0);const l=e.style;if(l)for(let u=0;u<l.length;u+=1){const a=l.item(u);a.startsWith("--")&&(s[a]=l.getPropertyValue(a))}}return{className:i?`contents ${_}`:"contents",style:s}}function V(n){const o=n.querySelectorAll("a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])");return Array.from(o).filter(s=>!s.hasAttribute("hidden")&&s.getAttribute("aria-hidden")!=="true")}const S=A(()=>{});function X({open:n,onClose:o,label:s,onPrev:i,onNext:c,className:e="",children:l}){const u=g(null),a=g(null),[h,v]=K(null);H(()=>{if(!n){v(null);return}const t=u.current;if(!t)return;const f=t.closest(G)??t.ownerDocument.body;v({host:f,theme:M(t,f)})},[n]);const p=g({onClose:o,onPrev:i,onNext:c});p.current={onClose:o,onPrev:i,onNext:c};const x=n&&h!==null,D=O(()=>p.current.onClose(),[]);return F({active:x,onDismiss:D,scopeRef:a}),j(()=>{if(!x)return;const t=a.current,f=t?.ownerDocument??document,y=f.activeElement;t?.focus();const E=r=>{if(r.key==="ArrowLeft")p.current.onPrev?.();else if(r.key==="ArrowRight")p.current.onNext?.();else if(r.key==="Tab"&&t){const d=V(t);if(d.length===0){r.preventDefault(),t.focus();return}const L=d[0],k=d[d.length-1],m=f.activeElement,w=!!m&&t.contains(m)&&m!==t;if(r.shiftKey&&(!w||m===L))r.preventDefault(),k.focus();else if(!r.shiftKey&&(!w||m===k))r.preventDefault(),L.focus();else{r.preventDefault();const C=d.indexOf(m);d[r.shiftKey?C-1:C+1]?.focus()}}},T=f.defaultView??window;return T.addEventListener("keydown",E),()=>{T.removeEventListener("keydown",E),y&&y.isConnected&&y.focus()}},[x]),n?N(I,{children:[b("span",{ref:u,hidden:!0}),h&&P(b("div",{className:h.theme.className,style:h.theme.style,children:b("div",{ref:a,role:"dialog","aria-modal":"true","aria-label":s,tabIndex:-1,onClick:o,className:`fixed inset-0 z-(--sf-layer-lightbox) outline-none ${B[8]} ${e}`,style:{background:$},children:b(S.Provider,{value:o,children:l})})}),h.host)]}):null}const Q="color-mix(in oklab, var(--bg) 70%, transparent)";function Y({className:n="absolute right-5 top-5 flex h-10 w-10 cursor-pointer items-center justify-center border border-fg-dim/40 text-fg-dim transition-colors hover:border-accent hover:text-accent",style:o,label:s="Close",children:i="×"}){const c=R(S);return b("button",{type:"button","aria-label":s,onClick:e=>{e.stopPropagation(),c()},className:n,style:o,children:i})}export{Q as LIGHTBOX_CLOSE_TINT,G as LIGHTBOX_HOST_SELECTOR,Y as LightboxClose,X as default};
1
+ "use client";import{jsx as x,Fragment as A,jsxs as I}from"react/jsx-runtime";import{createContext as O,useCallback as R,useContext as $,useEffect as j,useLayoutEffect as H,useRef as v,useState as K}from"react";import{createPortal as P}from"react-dom";import{SITE_BLUR as B,SITE_TINT as M}from"./PopupFrame.js";import{useModalDismiss as F}from"./useModalDismiss.js";const w="sf-themed-content",G=`.${w}`,N="sf-section-accent";function V(n,s){const r={};let i=!1;const c=[];for(let e=n;e&&e!==s;e=e.parentElement)c.push(e);for(const e of c.reverse()){e.classList.contains(N)&&(i=!0);const l=e.style;if(l)for(let u=0;u<l.length;u+=1){const a=l.item(u);a.startsWith("--")&&(r[a]=l.getPropertyValue(a))}}return{className:i?`contents ${N}`:"contents",style:r}}function X(n){const s=n.querySelectorAll("a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])");return Array.from(s).filter(r=>!r.hasAttribute("hidden")&&r.getAttribute("aria-hidden")!=="true")}const S=O(()=>{});function q({open:n,onClose:s,label:r,onPrev:i,onNext:c,className:e="",children:l}){const u=v(null),a=v(null),[p,E]=K(null);H(()=>{if(!n){E(null);return}const t=u.current;if(!t)return;const f=t.closest(G),d=f?.parentElement??t.ownerDocument.body,m=V(t,d);E({host:d,theme:f?{...m,className:`${m.className} ${w}`}:m})},[n]);const y=v({onClose:s,onPrev:i,onNext:c});y.current={onClose:s,onPrev:i,onNext:c};const g=n&&p!==null,D=R(()=>y.current.onClose(),[]);return F({active:g,onDismiss:D,scopeRef:a}),j(()=>{if(!g)return;const t=a.current,f=t?.ownerDocument??document,d=f.activeElement;t?.focus();const m=o=>{if(o.key==="ArrowLeft")y.current.onPrev?.();else if(o.key==="ArrowRight")y.current.onNext?.();else if(o.key==="Tab"&&t){const h=X(t);if(h.length===0){o.preventDefault(),t.focus();return}const C=h[0],L=h[h.length-1],b=f.activeElement,_=!!b&&t.contains(b)&&b!==t;if(o.shiftKey&&(!_||b===C))o.preventDefault(),L.focus();else if(!o.shiftKey&&(!_||b===L))o.preventDefault(),C.focus();else{o.preventDefault();const k=h.indexOf(b);h[o.shiftKey?k-1:k+1]?.focus()}}},T=f.defaultView??window;return T.addEventListener("keydown",m),()=>{T.removeEventListener("keydown",m),d&&d.isConnected&&d.focus()}},[g]),n?I(A,{children:[x("span",{ref:u,hidden:!0}),p&&P(x("div",{className:p.theme.className,style:p.theme.style,children:x("div",{ref:a,role:"dialog","aria-modal":"true","aria-label":r,tabIndex:-1,onClick:s,className:`fixed inset-0 z-(--sf-layer-lightbox) outline-none ${B[8]} ${e}`,style:{background:M},children:x(S.Provider,{value:s,children:l})})}),p.host)]}):null}const Y="color-mix(in oklab, var(--bg) 70%, transparent)";function Z({className:n="absolute right-5 top-5 flex h-10 w-10 cursor-pointer items-center justify-center border border-fg-dim/40 text-fg-dim transition-colors hover:border-accent hover:text-accent",style:s,label:r="Close",children:i="×"}){const c=$(S);return x("button",{type:"button","aria-label":r,onClick:e=>{e.stopPropagation(),c()},className:n,style:s,children:i})}export{Y as LIGHTBOX_CLOSE_TINT,G as LIGHTBOX_HOST_SELECTOR,Z as LightboxClose,q as default};
@@ -1 +1 @@
1
- "use client";import{jsx as l,Fragment as O,jsxs as u}from"react/jsx-runtime";import{useRef as G}from"react";import{photoLabel as N}from"./product-hero/hero-view.js";import R from"./product-hero/SpinLayer.js";import{stageControls as $,useHeldStagePhoto as I}from"./product-hero/stage-photo.js";import{DEFAULT_HERO_CLOSE_UPS_FILL as z,DEFAULT_HERO_GALLERY_GAP as F,DEFAULT_HERO_GALLERY_MARKS as v,DEFAULT_HERO_GALLERY_MODE as B,DEFAULT_HERO_GALLERY_SHOW as V,DEFAULT_HERO_IMAGE_FIT as Y,DEFAULT_HERO_PHOTO_GROUND as w,parseHeroGalleryGap as W,parseHeroCloseUpsFill as q,parseHeroGalleryMarks as X,parseHeroGalleryMode as Z,parseHeroGalleryShow as K,parseHeroImageFit as J,parseHeroPhotoGround as Q,resolveHeroImageFit as ee}from"../lib/sections/hero-gallery.js";import{spinSetFor as te}from"../lib/sections/spin-sets.js";import{productHasComposedRender as ae}from"../lib/wheels/set-mode.js";import{HideTaker as C}from"efficient-web-builder/render/components/ViewHideRoot";import{swipeEnabled as le,swipeStep as ne}from"efficient-web-builder/format/lib/hero-swipe";function oe({product:t,view:e,angleIdx:o,onSelect:c,isLight:n,onLightbox:s,galleryMode:i=B,imageFit:h=Y,style:a,takesViewHide:m=!1,spin:p=re,ground:d=w,show:g=V,marks:y=v,gap:S=F,closeUpsFill:_=z}){const b=te(p,t.slug,e.metaValue),L=se(Q(d),n),f=K(g)==="closeUps"||b?ie(e):e,E=X(y),T=ce(e,f,q(_)),r=Z(i),x=ee(J(h),ae(t)),H=l(ue,{name:t.name,view:f,wellGround:L,angleIdx:o,onSelect:c,onLightbox:s,fit:x,spinSet:b,marks:E,fillsTile:T});return r==="stacked"?l(C,{as:"div",takes:m,"data-hero-gallery":r,"data-hero-fit":x,style:a,children:f.photos.length<2&&!b?H:u(O,{children:[l(me,{name:t.name,view:f,wellGround:L,onLightbox:s,fit:x,spinSet:b,gap:W(S),fillsTile:T}),l(pe,{angleIdx:o,total:U(f),onSelect:c,children:H})]})}):u(C,{as:"div",takes:m,"data-hero-gallery":r,"data-hero-fit":x,className:r==="tiled"?"flex items-start gap-3 max-view-tablet:gap-2":void 0,style:a,children:[l("div",{className:r==="tiled"?"min-w-0 flex-1":void 0,children:H}),r!=="main"&&l(he,{name:t.name,view:f,angleIdx:o,onSelect:c,isLight:n,tiled:r==="tiled"})]})}function U(t){return t.photos.length>0?t.photos.length:t.thumbFallbackCells}const j="relative flex aspect-square items-center justify-center overflow-hidden",re={},k="sf-photo-ground-studio";function se(t,e){return t==="studio"?k:e?"bg-bg":""}function ie(t){return t.photos.length===0||t.closeUps.length===0?t:{...t,photos:[t.photos[0],...t.closeUps.map(e=>e.url)],captions:[t.captions[0],...t.closeUps.map(e=>e.title)]}}const A=()=>!1;function ce(t,e,o){if(!o||e===t)return A;const c=new Set(t.closeUps.map(n=>n.url));return(n,s)=>s>0&&n!==void 0&&c.has(n)}const M=(t,e,o)=>[t,e.metaValue,o].filter(Boolean).join(" — "),P=(t,e)=>[t,e.metaValue].filter(Boolean).join(" "),D=(t,e)=>`Open ${[t,e.metaValue].filter(Boolean).join(" ")} at full resolution`;function me({name:t,view:e,wellGround:o,onLightbox:c,fit:n,spinSet:s,gap:i,fillsTile:h=A}){const a=s?l(R,{set:s,name:P(t,e)}):null,m=i===F;return l("div",{"data-hero-stack":!0,className:m?"flex flex-col gap-2 max-view-tablet:hidden":"flex flex-col max-view-tablet:hidden",style:m?void 0:{gap:`${i}px`},children:e.photos.map((p,d)=>{const g=M(t,e,N(e,d));return l("div",{"data-hero-stack-photo":!0,className:[j,o].join(" "),style:{color:e.tint},children:d===0&&a?a:e.stageImage({photo:p,alt:g,label:D(t,e),onZoom:()=>c(p,g),fit:n,eager:d===0,fillsTile:h(p,d)})},p)})})}function pe({angleIdx:t,total:e,onSelect:o,children:c}){const n=G(null),s=G(null),i=le({count:e}),h=a=>({x:a.touches[0].clientX,y:a.touches[0].clientY});return l("div",{"data-hero-phone-stage":!0,className:"view-tablet:hidden",onTouchStart:a=>{n.current=i&&a.touches.length===1?h(a):null,s.current=n.current},onTouchMove:a=>{n.current&&(a.touches.length!==1?n.current=null:s.current=h(a))},onTouchEnd:()=>{const a=n.current,m=s.current;if(n.current=null,s.current=null,!a||!m)return;const p=ne(m.x-a.x,m.y-a.y,t,e);p!==t&&o(p)},children:c})}const de=6;function ue({name:t,view:e,angleIdx:o,onSelect:c,onLightbox:n,fit:s,spinSet:i,wellGround:h,marks:a,fillsTile:m=A}){const p=e.photos[Math.min(o,e.photos.length-1)],d=I(e.photos,p),g=U(e),y=g>=2,S=String(g).padStart(2,"0"),_=Math.min(o,Math.max(e.photos.length-1,0)),b=y||e.captions[_]?N(e,_):"",L=M(t,e,b),f="max-view-tablet:static",E=[`${j} max-view-tablet:col-span-2`,h].join(" ");return u("div",{className:"relative max-view-tablet:grid max-view-tablet:grid-cols-[minmax(0,1fr)_auto] max-view-tablet:items-start max-view-tablet:gap-x-3 max-view-tablet:gap-y-2",style:{color:e.tint},children:[a&&u("div",{className:`absolute left-0 top-0 z-10 flex items-center gap-3 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.2em] text-fg ${f} max-view-tablet:min-w-0 max-view-tablet:flex-wrap max-view-tablet:gap-x-2 max-view-tablet:gap-y-1`,children:[y&&u(O,{children:[u("span",{className:"text-accent",children:[String(o+1).padStart(2,"0")," / ",S]}),l("span",{className:"text-fg-dim",children:"·"})]}),l("span",{children:t}),e.metaValue&&u(O,{children:[l("span",{className:"text-fg-dim",children:"·"}),l("span",{className:"text-accent",children:e.metaValue})]})]}),a&&y&&l("div",{className:`absolute right-5 top-5 z-10 flex gap-1 ${f}`,children:$(o,g,c).map(r=>l("button",{type:"button","aria-label":r.label,title:r.label,onClick:r.onClick,className:"flex h-7 w-7 items-center justify-center border border-fg-dim/60 text-fg transition-colors hover:border-accent hover:text-accent",children:r.glyph},r.label))}),u("div",{className:E,children:[h!==k&&["top-3 left-3","top-3 right-3","bottom-3 left-3","bottom-3 right-3"].map((r,x)=>l("span",{className:`absolute ${r} h-3 w-3 border border-fg-dim/40`,style:{borderTop:r.includes("top")?"1px solid var(--site-line)":"none",borderBottom:r.includes("bottom")?"1px solid var(--site-line)":"none",borderLeft:r.includes("left")?"1px solid var(--site-line)":"none",borderRight:r.includes("right")?"1px solid var(--site-line)":"none"}},x)),i&&_===0?l(R,{set:i,name:P(t,e)}):e.stageImage({photo:d,alt:L,label:D(t,e),onZoom:()=>n(d,L),fit:s,fillsTile:m(d,e.photos.indexOf(d??""))})]}),a&&u("div",{className:`absolute bottom-0 left-0 right-0 z-10 flex items-end justify-between gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim ${f} max-view-tablet:col-span-2 max-view-tablet:flex-wrap`,children:[u("span",{className:"flex min-w-0 flex-col gap-1",children:[e.specCaption&&l("span",{children:e.specCaption}),e.referenceNote&&l("span",{"data-hero-reference-note":!0,children:e.referenceNote}),e.galleryHint&&l("span",{"data-hero-gallery-hint":!0,children:e.galleryHint})]}),l("span",{children:e.originCaption})]})]})}function he({name:t,view:e,angleIdx:o,onSelect:c,isLight:n,tiled:s=!1}){const i=U(e);return i<2?null:l("div",{className:s?"order-[-1] flex w-16 flex-col gap-2 max-view-tablet:w-12 max-view-tablet:gap-1":"mt-2 grid grid-cols-4 gap-2 max-view-tablet:gap-1",style:!s&&i>4?{gridTemplateColumns:`repeat(${Math.min(i,de)}, minmax(0, 1fr))`}:void 0,children:Array.from({length:i}).map((h,a)=>{const m=e.photos[a];return u("button",{type:"button",onClick:()=>c(a),"aria-label":`View ${N(e,a)}`,"aria-pressed":a===o,className:["relative flex aspect-square items-center justify-center overflow-hidden transition-colors",n?"bg-bg":"",a===o?"border border-accent":"border border-transparent hover:border-fg-dim"].join(" "),style:{color:e.tint},children:[l("span",{className:"absolute top-1.5 left-2 z-10 font-mono text-[length:var(--size-label,8px)] uppercase tracking-[0.18em] text-fg-dim",children:String(a+1).padStart(2,"0")}),e.thumbImage({photo:m,alt:`${t} — ${N(e,a)}`})]},a)})})}export{oe as default};
1
+ "use client";import{jsx as o,Fragment as O,jsxs as u}from"react/jsx-runtime";import{useRef as G}from"react";import{photoLabel as N}from"./product-hero/hero-view.js";import R from"./product-hero/SpinLayer.js";import{stageControls as $,useHeldStagePhoto as I}from"./product-hero/stage-photo.js";import{DEFAULT_HERO_CLOSE_UPS_FILL as z,DEFAULT_HERO_GALLERY_GAP as F,DEFAULT_HERO_GALLERY_MARKS as B,DEFAULT_HERO_GALLERY_MODE as V,DEFAULT_HERO_GALLERY_SHOW as v,DEFAULT_HERO_IMAGE_FIT as Y,DEFAULT_HERO_PHOTO_GROUND as W,parseHeroGalleryGap as q,parseHeroCloseUpsFill as X,parseHeroGalleryMarks as Z,parseHeroGalleryMode as w,parseHeroGalleryShow as K,parseHeroImageFit as J,parseHeroPhotoGround as Q,resolveHeroImageFit as ee}from"../lib/sections/hero-gallery.js";import{spinSetFor as te}from"../lib/sections/spin-sets.js";import{productHasComposedRender as ae}from"../lib/wheels/set-mode.js";import{HideTaker as C}from"efficient-web-builder/render/components/ViewHideRoot";import{swipeEnabled as oe,swipeStep as le}from"efficient-web-builder/format/lib/hero-swipe";function ne({product:t,view:e,angleIdx:n,onSelect:c,isLight:l,onLightbox:s,galleryMode:i=V,imageFit:h=Y,style:a,takesViewHide:m=!1,spin:p=re,ground:d=W,show:g=v,marks:y=B,gap:S=F,closeUpsFill:_=z}){const b=te(p,t.slug,e.metaValue),L=se(Q(d),l),f=K(g)==="closeUps"||b?ie(e):e,E=Z(y),T=ce(e,f,X(_)),r=w(i),x=ee(J(h),ae(t)),H=o(ue,{name:t.name,view:f,wellGround:L,angleIdx:n,onSelect:c,onLightbox:s,fit:x,spinSet:b,marks:E,fillsTile:T});return r==="stacked"?o(C,{as:"div",takes:m,"data-hero-gallery":r,"data-hero-fit":x,style:a,children:f.photos.length<2&&!b?H:u(O,{children:[o(me,{name:t.name,view:f,wellGround:L,onLightbox:s,fit:x,spinSet:b,gap:q(S),fillsTile:T}),o(pe,{angleIdx:n,total:U(f),onSelect:c,children:H})]})}):u(C,{as:"div",takes:m,"data-hero-gallery":r,"data-hero-fit":x,className:r==="tiled"?"flex items-start gap-3 max-view-tablet:gap-2":void 0,style:a,children:[o("div",{className:r==="tiled"?"min-w-0 flex-1":void 0,children:H}),r!=="main"&&o(he,{name:t.name,view:f,angleIdx:n,onSelect:c,isLight:l,tiled:r==="tiled"})]})}function U(t){return t.photos.length>0?t.photos.length:t.thumbFallbackCells}const j="relative flex aspect-square items-center justify-center overflow-hidden",re={},k="sf-photo-ground-studio";function se(t,e){return t==="studio"?k:e?"bg-bg":""}function ie(t){return t.photos.length===0||t.closeUps.length===0?t:{...t,photos:[t.photos[0],...t.closeUps.map(e=>e.url)],captions:[t.captions[0],...t.closeUps.map(e=>e.title)]}}const A=()=>!1;function ce(t,e,n){if(!n||e===t)return A;const c=new Set(t.closeUps.map(l=>l.url));return(l,s)=>s>0&&l!==void 0&&c.has(l)}const M=(t,e,n)=>[t,e.metaValue,n].filter(Boolean).join(" — "),P=(t,e)=>[t,e.metaValue].filter(Boolean).join(" "),D=(t,e)=>`Open ${[t,e.metaValue].filter(Boolean).join(" ")} at full resolution`;function me({name:t,view:e,wellGround:n,onLightbox:c,fit:l,spinSet:s,gap:i,fillsTile:h=A}){const a=s?o(R,{set:s,name:P(t,e),poster:e.photos[0]}):null,m=i===F;return o("div",{"data-hero-stack":!0,className:m?"flex flex-col gap-2 max-view-tablet:hidden":"flex flex-col max-view-tablet:hidden",style:m?void 0:{gap:`${i}px`},children:e.photos.map((p,d)=>{const g=M(t,e,N(e,d));return o("div",{"data-hero-stack-photo":!0,className:[j,n].join(" "),style:{color:e.tint},children:d===0&&a?a:e.stageImage({photo:p,alt:g,label:D(t,e),onZoom:()=>c(p,g),fit:l,eager:d===0,fillsTile:h(p,d)})},p)})})}function pe({angleIdx:t,total:e,onSelect:n,children:c}){const l=G(null),s=G(null),i=oe({count:e}),h=a=>({x:a.touches[0].clientX,y:a.touches[0].clientY});return o("div",{"data-hero-phone-stage":!0,className:"view-tablet:hidden",onTouchStart:a=>{l.current=i&&a.touches.length===1?h(a):null,s.current=l.current},onTouchMove:a=>{l.current&&(a.touches.length!==1?l.current=null:s.current=h(a))},onTouchEnd:()=>{const a=l.current,m=s.current;if(l.current=null,s.current=null,!a||!m)return;const p=le(m.x-a.x,m.y-a.y,t,e);p!==t&&n(p)},children:c})}const de=6;function ue({name:t,view:e,angleIdx:n,onSelect:c,onLightbox:l,fit:s,spinSet:i,wellGround:h,marks:a,fillsTile:m=A}){const p=e.photos[Math.min(n,e.photos.length-1)],d=I(e.photos,p),g=U(e),y=g>=2,S=String(g).padStart(2,"0"),_=Math.min(n,Math.max(e.photos.length-1,0)),b=y||e.captions[_]?N(e,_):"",L=M(t,e,b),f="max-view-tablet:static",E=[`${j} max-view-tablet:col-span-2`,h].join(" ");return u("div",{className:"relative max-view-tablet:grid max-view-tablet:grid-cols-[minmax(0,1fr)_auto] max-view-tablet:items-start max-view-tablet:gap-x-3 max-view-tablet:gap-y-2",style:{color:e.tint},children:[a&&u("div",{className:`absolute left-0 top-0 z-10 flex items-center gap-3 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.2em] text-fg ${f} max-view-tablet:min-w-0 max-view-tablet:flex-wrap max-view-tablet:gap-x-2 max-view-tablet:gap-y-1`,children:[y&&u(O,{children:[u("span",{className:"text-accent",children:[String(n+1).padStart(2,"0")," / ",S]}),o("span",{className:"text-fg-dim",children:"·"})]}),o("span",{children:t}),e.metaValue&&u(O,{children:[o("span",{className:"text-fg-dim",children:"·"}),o("span",{className:"text-accent",children:e.metaValue})]})]}),a&&y&&o("div",{className:`absolute right-5 top-5 z-10 flex gap-1 ${f}`,children:$(n,g,c).map(r=>o("button",{type:"button","aria-label":r.label,title:r.label,onClick:r.onClick,className:"flex h-7 w-7 items-center justify-center border border-fg-dim/60 text-fg transition-colors hover:border-accent hover:text-accent",children:r.glyph},r.label))}),u("div",{className:E,children:[h!==k&&["top-3 left-3","top-3 right-3","bottom-3 left-3","bottom-3 right-3"].map((r,x)=>o("span",{className:`absolute ${r} h-3 w-3 border border-fg-dim/40`,style:{borderTop:r.includes("top")?"1px solid var(--site-line)":"none",borderBottom:r.includes("bottom")?"1px solid var(--site-line)":"none",borderLeft:r.includes("left")?"1px solid var(--site-line)":"none",borderRight:r.includes("right")?"1px solid var(--site-line)":"none"}},x)),i&&_===0?o(R,{set:i,name:P(t,e),poster:e.photos[0]}):e.stageImage({photo:d,alt:L,label:D(t,e),onZoom:()=>l(d,L),fit:s,fillsTile:m(d,e.photos.indexOf(d??""))})]}),a&&u("div",{className:`absolute bottom-0 left-0 right-0 z-10 flex items-end justify-between gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim ${f} max-view-tablet:col-span-2 max-view-tablet:flex-wrap`,children:[u("span",{className:"flex min-w-0 flex-col gap-1",children:[e.specCaption&&o("span",{children:e.specCaption}),e.referenceNote&&o("span",{"data-hero-reference-note":!0,children:e.referenceNote}),e.galleryHint&&o("span",{"data-hero-gallery-hint":!0,children:e.galleryHint})]}),o("span",{children:e.originCaption})]})]})}function he({name:t,view:e,angleIdx:n,onSelect:c,isLight:l,tiled:s=!1}){const i=U(e);return i<2?null:o("div",{className:s?"order-[-1] flex w-16 flex-col gap-2 max-view-tablet:w-12 max-view-tablet:gap-1":"mt-2 grid grid-cols-4 gap-2 max-view-tablet:gap-1",style:!s&&i>4?{gridTemplateColumns:`repeat(${Math.min(i,de)}, minmax(0, 1fr))`}:void 0,children:Array.from({length:i}).map((h,a)=>{const m=e.photos[a];return u("button",{type:"button",onClick:()=>c(a),"aria-label":`View ${N(e,a)}`,"aria-pressed":a===n,className:["relative flex aspect-square items-center justify-center overflow-hidden transition-colors",l?"bg-bg":"",a===n?"border border-accent":"border border-transparent hover:border-fg-dim"].join(" "),style:{color:e.tint},children:[o("span",{className:"absolute top-1.5 left-2 z-10 font-mono text-[length:var(--size-label,8px)] uppercase tracking-[0.18em] text-fg-dim",children:String(a+1).padStart(2,"0")}),e.thumbImage({photo:m,alt:`${t} — ${N(e,a)}`})]},a)})})}export{ne as default};
@@ -1,16 +1,19 @@
1
1
  import type { SlotComponent } from "efficient-easel/blocks";
2
2
  import type { CardPressTitle } from "efficient-web-builder/render/lib/document/card-press-titles";
3
3
  import type { FirstShown } from "../../lib/wheels/shopper-first-paint.js";
4
+ import { type FilterChipsLook } from "../../lib/sections/filter-chips-look.js";
4
5
  export type ChipsOwner = {
5
6
  id: string;
6
7
  template?: SlotComponent;
7
8
  pressTitles?: readonly CardPressTitle[];
8
9
  };
9
- export default function ShopperChips({ owner, showCount, showClear, showSort, firstShown, editing, }: {
10
+ export default function ShopperChips({ owner, showCount, showClear, showSort, firstShown, editing, look, countWord, }: {
10
11
  owner: ChipsOwner;
11
12
  showCount: boolean;
12
13
  showClear: boolean;
13
14
  showSort: boolean;
15
+ look?: FilterChipsLook;
16
+ countWord?: string;
14
17
  firstShown?: FirstShown;
15
18
  editing?: boolean;
16
19
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as e,Fragment as y,jsxs as L}from"react/jsx-runtime";import{CardTemplateRows as N}from"efficient-web-builder/render/components/CardRowContext";import{cardRow as G}from"efficient-web-builder/format/lib/content/card-template";import{say as K}from"efficient-web-builder/format/lib/editor-words";import{useCurrency as O}from"../CurrencyContext.js";import{formatPrice as Y}from"../../lib/commerce.js";import{filterChipItems as j,filterStateWithoutChip as B,optionCardRows as M}from"../../lib/sections/filter-option-rows.js";import{PlpResultRange as R,PlpToolbar as S}from"../wheels-plp/PlpToolbar.js";import E from"./ClearAllButton.js";import P from"./SortSelect.js";import{hasActivePlpFilters as H,plpSortKeysFor as U,PLP_SORT_LABELS as W}from"../../lib/wheels/plp-filters.js";import{itemKind as X,plpKindNoun as Z}from"../../lib/catalog/plp-item.js";import{CATALOG_TEXT_SIZE as $}from"../../lib/sections/catalog-text-size.js";import{EMPTY_PLP_FILTERS as q}from"../../lib/wheels/plp-filters.js";import{GALLERY_SORT_KEYS as z,GALLERY_SORT_LABELS as D}from"../../lib/sections/gallery-toolbar.js";import{useShopperMember as J}from"./ShopperScope.js";import{HideTaker as k}from"efficient-web-builder/render/components/ViewHideRoot";import{FILTER_CHIPS_TYPE as Q}from"../../lib/document/document-nodes.js";const V="✕";function ee({owner:n,showCount:l,showClear:a,showSort:i,firstShown:r,editing:t}){const{ref:s,scope:o,gallery:f}=J("chips",null,{count:l,sort:i}),{currency:c}=O(),m=(!o?.live&&r?{state:o?.state??{...q,sort:r.sort},update:()=>{},clear:()=>{},total:r.total,range:r.range,kinds:r.kinds}:null)??(o?{...o,kinds:[...new Set(o.rows.map(X))]}:null);if(!m&&f)return e(k,{as:"div",ref:s,"data-shopper-chips":"",children:e(te,{owner:n,gallery:f,showCount:l,showClear:a,showSort:i,editing:t})});if(!m)return e(k,{as:"div",ref:s,"data-shopper-chips":"",children:t&&e("p",{className:`font-mono ${$.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:"Filter chips show the picks of a Filters block, or the Tags of a Gallery, in this Box"})});const{state:d,update:u,clear:_,total:p,range:b,kinds:h}=m,v=Z(h.length?h:["alloy-wheel"]),x=H(d),C=j(d,c,Y).map(g=>({...g,mark:V,press:()=>u(I=>B(I,g))})),w=L(y,{children:[l&&e("div",{"data-shopper-count":"",className:"contents",children:e(R,{total:p,range:b??{from:p?1:0,to:p},noun:v})}),C.length>0&&e(A,{owner:n,chips:C,editing:t}),a&&x&&e(E,{onClick:_})]}),F=U(h.length?h:["alloy-wheel"]);return e(k,{as:"div",ref:s,"data-shopper-chips":"",children:e(S,{start:w,end:i?e(P,{value:d.sort,keys:F,labels:W,onChange:g=>u({sort:g,page:1})}):void 0})})}function A({owner:n,chips:l,selected:a,editing:i}){const r=M(l,{item:t=>t,selected:(t,s)=>s===a,press:t=>t.press});return e("ul",{className:"flex list-none flex-wrap items-center gap-2",children:e(N,{ownerId:n.id,ownerType:Q,Template:n.template,rows:r.items.map(G),items:r.items,states:a===void 0?void 0:r.states,actions:i?void 0:r.actions,pressTitles:n.pressTitles,fallback:null,wrapCopy:t=>e("li",{children:t}),children:t=>t})})}function te({owner:n,gallery:l,showCount:a,showClear:i,showSort:r,editing:t}){const{tags:s,tag:o,sort:f,shown:c,pick:T,setSort:m,clear:d}=l,u=[{label:K("All"),mark:"",press:()=>T(null)},...s.map(p=>({label:p,mark:"",press:()=>T(p)}))],_=L(y,{children:[a&&e("div",{"data-shopper-count":"",className:"contents",children:e(R,{total:c,range:{from:c?1:0,to:c},noun:re})}),s.length>0&&e(A,{owner:n,chips:u,selected:o===null?0:s.indexOf(o)+1,editing:t}),i&&o!==null&&e(E,{onClick:d})]});return e(S,{start:_,end:r?e(P,{value:f,keys:z,labels:D,onChange:m}):void 0})}const re={many:"items"};export{ee as default};
1
+ "use client";import{jsx as e,Fragment as v,jsxs as L}from"react/jsx-runtime";import{CardTemplateRows as H}from"efficient-web-builder/render/components/CardRowContext";import{cardRow as M}from"efficient-web-builder/format/lib/content/card-template";import{say as U}from"efficient-web-builder/format/lib/editor-words";import{useCurrency as W}from"../CurrencyContext.js";import{formatPrice as D}from"../../lib/commerce.js";import{filterChipItems as X,filterStateWithoutChip as Z,optionCardRows as $}from"../../lib/sections/filter-option-rows.js";import{PlpResultRange as A,PlpToolbar as F}from"../wheels-plp/PlpToolbar.js";import N from"./ClearAllButton.js";import w from"./SortSelect.js";import{hasActivePlpFilters as q,plpSortKeysFor as z,PLP_SORT_LABELS as J}from"../../lib/wheels/plp-filters.js";import{itemKind as Q,plpKindNoun as V}from"../../lib/catalog/plp-item.js";import{CATALOG_TEXT_SIZE as ee}from"../../lib/sections/catalog-text-size.js";import{EMPTY_PLP_FILTERS as te}from"../../lib/wheels/plp-filters.js";import{GALLERY_SORT_KEYS as re,GALLERY_SORT_LABELS as se}from"../../lib/sections/gallery-toolbar.js";import{chipsTotalWords as I,DEFAULT_FILTER_CHIPS_LOOK as ne}from"../../lib/sections/filter-chips-look.js";import{useShopperMember as oe}from"./ShopperScope.js";import{HideTaker as C}from"efficient-web-builder/render/components/ViewHideRoot";import{FILTER_CHIPS_TYPE as ae}from"../../lib/document/document-nodes.js";const le="✕";function ie({owner:s,showCount:n,showClear:r,showSort:i,firstShown:o,editing:a,look:t=ne,countWord:d=""}){const{ref:p,scope:l,gallery:T}=oe("chips",null,{count:n,sort:i}),{currency:f}=W(),u=(!l?.live&&o?{state:l?.state??{...te,sort:o.sort},update:()=>{},clear:()=>{},total:o.total,range:o.range,kinds:o.kinds}:null)??(l?{...l,kinds:[...new Set(l.rows.map(Q))]}:null);if(!u&&T)return e(C,{as:"div",ref:p,"data-shopper-chips":"",children:e(pe,{owner:s,gallery:T,showCount:n,showClear:r,showSort:i,editing:a,look:t,countWord:d})});if(!u)return e(C,{as:"div",ref:p,"data-shopper-chips":"",children:a&&e("p",{className:`font-mono ${ee.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:"Filter chips show the picks of a Filters block, or the Tags of a Gallery, in this Box"})});const{state:h,update:y,clear:g,total:c,range:x,kinds:m}=u,R=V(m.length?m:["alloy-wheel"]),G=q(h),E=X(h,f,D).map(_=>({..._,mark:le,press:()=>y(B=>Z(B,_))})),b=t==="tabs",S=L(v,{children:[n&&!b&&e("div",{"data-shopper-count":"",className:"contents",children:e(A,{total:c,range:x??{from:c?1:0,to:c},noun:R})}),E.length>0&&e(K,{owner:s,chips:E,editing:a,under:b}),r&&G&&e(N,{onClick:g})]}),Y=z(m.length?m:["alloy-wheel"]),P=i?e(w,{value:h.sort,keys:Y,labels:J,onChange:_=>y({sort:_,page:1})}):void 0;return e(C,{as:"div",ref:p,"data-shopper-chips":"",children:b?e(O,{start:S,end:P,count:n?I(c,d,R.many):null}):e(F,{start:S,end:P})})}function O({start:s,end:n,count:r}){return L("div",{"data-chips-look":"tabs",className:"flex flex-col gap-y-6",children:[L("div",{className:"flex flex-wrap items-center justify-center gap-x-4 gap-y-2",children:[s,n]}),r!==null&&e("p",{"data-shopper-count":"",className:"font-mono text-xs tabular-nums text-fg-dim",children:r})]})}function K({owner:s,chips:n,selected:r,editing:i,under:o=!1}){const a=$(n,{item:t=>t,selected:(t,d)=>d===r,press:t=>t.press});return e("ul",{className:o?"flex list-none flex-wrap items-center justify-center gap-x-8 gap-y-2":"flex list-none flex-wrap items-center gap-2",children:e(H,{ownerId:s.id,ownerType:ae,Template:s.template,rows:a.items.map(M),items:a.items,states:r===void 0?void 0:a.states,stateLine:o?"under":void 0,actions:i?void 0:a.actions,pressTitles:s.pressTitles,fallback:null,wrapCopy:t=>e("li",{children:t}),children:t=>t})})}function pe({owner:s,gallery:n,showCount:r,showClear:i,showSort:o,editing:a,look:t,countWord:d}){const{tags:p,tag:l,sort:T,shown:f,pick:k,setSort:u,clear:h}=n,y=[{label:U("All"),mark:"",press:()=>k(null)},...p.map(m=>({label:m,mark:"",press:()=>k(m)}))],g=t==="tabs",c=L(v,{children:[r&&!g&&e("div",{"data-shopper-count":"",className:"contents",children:e(A,{total:f,range:{from:f?1:0,to:f},noun:j})}),p.length>0&&e(K,{owner:s,chips:y,selected:l===null?0:p.indexOf(l)+1,editing:a,under:g}),i&&l!==null&&e(N,{onClick:h})]}),x=o?e(w,{value:T,keys:re,labels:se,onChange:u}):void 0;return g?e(O,{start:c,end:x,count:r?I(f,d,j.many):null}):e(F,{start:c,end:x})}const j={many:"items"};export{ie as default};
@@ -3,7 +3,8 @@ export declare const SpinChoices: import("react").Context<{
3
3
  autoTurn: boolean;
4
4
  turnHint: boolean;
5
5
  }>;
6
- export default function SpinLayer({ set, name }: {
6
+ export default function SpinLayer({ set, name, poster }: {
7
7
  set: SpinSet;
8
8
  name: string;
9
+ poster?: string;
9
10
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as x,Fragment as ie,jsxs as M}from"react/jsx-runtime";import{createContext as Me,useCallback as ae,useContext as Le,useEffect as w,useRef as y,useState as h}from"react";import{VIEW_TABLET_MIN as De}from"efficient-easel/screen/lib/content/view-tiers";import{cssStringBody as Ne}from"efficient-web-builder/format/lib/document/style-text";import{HALF_SIZES as j,sizedImage as He}from"efficient-web-builder/format/lib/sized-image";import{prefersReducedMotion as X}from"efficient-web-builder/render/components/useReducedMotion";import{DEFAULT_SPIN_AUTO_TURN as Re,DEFAULT_SPIN_HINT as $e,SPIN_HINT_HIDE_MS as Ce,SPIN_HINT_SHOW_MS as ce,SPIN_RESUME_MS as Oe,isFullTurn as le,spinAutoTurnStep as We,spinBlend as Ue,spinClampPosition as je,spinFrameIndex as L,spinPositionAfterDrag as ue,spinCell as z,spinStartPosition as B}from"../../lib/sections/spin-sets.js";const Xe=.3,ze=.85,de=24,fe=4,me=1e3,he=77/72,pe=`${(1-he)/2*100}%`,we=`${he*100}%`,q={left:pe,top:pe,width:we,height:we},Be=`(max-width: ${De-.02}px)`,K=new Map,ge=new Map;function G(t,v){let p=K.get(t);return p||(p=new Promise(P=>{const a=new Image,b=()=>{K.delete(t),ge.delete(t),P(null)},d=()=>P({w:a.naturalWidth,h:a.naturalHeight});a.onload=()=>{if(typeof a.decode!="function")return d();a.decode().then(d,b)},a.onerror=b,v&&(a.sizes=j,a.srcset=v),a.src=t,ge.set(t,a)}),K.set(t,p)),p}const qe=Me({autoTurn:Re,turnHint:$e});let D=!1;const Ke="M3 4.5c3.2 3.6 18.8 3.6 22 0M5.6 2.6 3 4.5l3 1.2M22.4 2.6 25 4.5l-3 1.2",N=t=>He(t,{fallbackWidth:me,maxWidth:me}),ye=(t,v)=>!!t.frames&&v===t.frames[0],ve=t=>({...q,backgroundImage:`url("${Ne(t.url)}")`,backgroundSize:`${t.cols*100}% ${t.rows*100}%`,backgroundPosition:`${t.cols>1?t.col*100/(t.cols-1):0}% ${t.rows>1?t.row*100/(t.rows-1):0}%`});function Ge({set:t,name:v}){const[p,P]=h(()=>B(t)),a=y(null),b=y(0),d=y(p),F=y(null),S=y(null),{autoTurn:f,turnHint:H}=Le(qe),[be,R]=h(!1),[Se,Z]=h(!1),[$,Q]=h(0),V=y(0),[Ee,Y]=h(!1),[_e,ke]=h(!0),[J,xe]=h(null),i=t.count,[C,ee]=h(null),O=y(null),[E,te]=h(null),g=le(t),_=L(p,i,g),A=ae(e=>{const n=je(e,i,g);return d.current=n,P(n),n},[i,g]),T=ae(()=>cancelAnimationFrame(b.current),[]);w(()=>{const e=window.matchMedia?.(Be);if(!e)return te(!1);const n=()=>te(e.matches);return n(),e.addEventListener?.("change",n),()=>e.removeEventListener?.("change",n)},[]),w(()=>{if(!t.sheets||!t.startFrame||E===null)return;const e=E?t.sheets.phone:t.sheets.desktop,n=`${t.startFrame} ${e.urls[0]}`;if(S.current===n)return;S.current=n,ee({key:n,sheet:e,ready:new Set});const r=Math.floor(B(t)/(e.cols*e.rows)),u=e.urls.map((l,o)=>e.urls[(r+o)%e.urls.length]),c=N(t.startFrame);G(c.src,c.srcSet).then(()=>{for(const l of u)G(l).then(o=>{!o||o.w!==e.cols*e.frame||o.h!==e.rows*e.frame||S.current===n&&ee(m=>m?.key===n?{...m,ready:new Set(m.ready).add(l)}:m)})})},[t,E]),w(()=>{if(!t.frames)return;const e=t.frames,n=e[0];if(S.current===n)return;S.current=n;const r=L(B(t),i,le(t)),u=[];for(let l=0;l<fe;l+=1)for(let o=l;o<i;o+=fe)u.push((r+o)%i);const c=l=>{const o=N(e[l]);return G(o.src,o.srcSet)};c(u[0]).then(()=>Promise.all(u.slice(1).map(c))).then(l=>{S.current===n&&l.every(Boolean)&&xe(n)})},[i,t]),w(()=>T,[T]),w(()=>{if(!H||D)return;const e=window.setTimeout(()=>R(!D),ce),n=window.setTimeout(()=>{D=!0,R(!1)},ce+Ce);return()=>{window.clearTimeout(e),window.clearTimeout(n)}},[H]),w(()=>{const e=a.current;if(!f||!e)return;if(typeof IntersectionObserver>"u")return Y(!0);const n=new IntersectionObserver(r=>Y(r.some(u=>u.isIntersecting)));return n.observe(e),()=>n.disconnect()},[f]),w(()=>{if(!f)return;const e=()=>ke(document.visibilityState!=="hidden");return e(),document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[f]);const Pe=e=>{T(),f&&Z(!0),H&&(D=!0,R(!1)),e.currentTarget.setPointerCapture?.(e.pointerId),F.current={x0:e.clientX,f0:d.current,last:e.clientX,speed:0}},Ae=e=>{const n=F.current,r=a.current;!n||!r||(n.speed=e.clientX-n.last,n.last=e.clientX,A(ue(n.f0,e.clientX-n.x0,r.clientWidth,i)))},ne=()=>{const e=F.current;F.current=null,f&&e&&(Z(!1),Q(c=>c+1));const n=a.current;if(!e||!n||X())return;let r=Math.max(-de,Math.min(de,e.speed));const u=()=>{if(Math.abs(r)<Xe)return;const c=ue(d.current,r,n.clientWidth,i);A(c)===c&&(r*=ze,b.current=requestAnimationFrame(u))};b.current=requestAnimationFrame(u)},Ie=e=>{const n=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:0;if(e.key==="Home")A(0);else if(e.key==="End")A(i-1);else if(n)A(Math.round(d.current)+n);else return;T(),f&&Q(r=>r+1),e.preventDefault()},s=t.sheets&&C&&C.key.startsWith(`${t.startFrame} `)?C:null;s&&s.ready.has(z(s.sheet,_).url)&&(O.current={key:s.key,frame:_});const W=s&&O.current?.key===s.key?O.current.frame:null,I=s&&W!==null?{...z(s.sheet,W),cols:s.sheet.cols,rows:s.sheet.rows}:null,k=Ue(p,i,g,X()),U=s&&k.b!==null&&W===_?z(s.sheet,k.b):null,re=I&&U&&s.ready.has(U.url)?{...U,cols:I.cols,rows:I.rows}:null,oe=!s&&t.frames&&k.b!==null&&ye(t,J)?t.frames[k.b]:null,Fe=t.frames?ye(t,J):!!s&&s.ready.size===s.sheet.urls.length,se=f&&Fe&&Ee&&_e&&!Se;return w(()=>{if(!se)return;const e=V.current!==$;let n=-1,r=-1,u=1,c=0;const l=o=>{if(c=requestAnimationFrame(l),n<0&&(n=o),e&&o-n<Oe)return;if(V.current=$,r<0){r=o;return}const m=We(t,d.current,u,o-r);r=o,u=m.way;const Te=L(d.current,i,g);d.current=m.position,(!X()||L(m.position,i,g)!==Te)&&P(m.position)};return c=requestAnimationFrame(l),()=>cancelAnimationFrame(c)},[se,$,t,i,g]),M("div",{ref:a,"data-spin-well":!0,role:"slider",tabIndex:0,"aria-label":`${v}, 360° view: drag or use the arrow keys to turn`,"aria-valuemin":1,"aria-valuemax":i,"aria-valuenow":_+1,"aria-valuetext":`Angle ${_+1} of ${i}`,"data-spin-auto-turn":f?"":void 0,onKeyDown:Ie,className:"absolute inset-0 select-none overflow-hidden cursor-grab active:cursor-grabbing focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg",style:{touchAction:"pan-y"},onPointerDown:Pe,onPointerMove:Ae,onPointerUp:ne,onPointerCancel:ne,onTouchStart:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),onTouchEnd:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[I?M(ie,{children:[x("div",{"data-spin-frame":!0,className:"pointer-events-none absolute",style:ve(I)}),re?x("div",{"data-spin-frame":!0,className:"pointer-events-none absolute",style:{...ve(re),opacity:k.mix}}):null]}):M(ie,{children:[x("img",{...N(t.frames?t.frames[_]:t.startFrame??""),sizes:j,alt:"",draggable:!1,fetchPriority:"high","data-spin-frame":!0,className:"pointer-events-none absolute max-w-none object-contain",style:q}),oe?x("img",{...N(oe),sizes:j,alt:"",draggable:!1,"data-spin-frame":!0,className:"pointer-events-none absolute max-w-none object-contain",style:{...q,opacity:k.mix}}):null]}),be?M("span",{"data-spin-hint":!0,className:`pointer-events-none absolute inset-x-0 flex flex-col items-center gap-1 text-xs text-fg ${E?"bottom-3":"bottom-5"}`,children:[E?null:x("svg",{viewBox:"0 0 28 12",width:"28",height:"12","aria-hidden":"true",children:x("path",{d:Ke,fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}),E?"Swipe to turn":"Drag to turn"]}):null]})}export{qe as SpinChoices,Ge as default};
1
+ "use client";import{jsx as b,Fragment as de,jsxs as H}from"react/jsx-runtime";import{createContext as $e,useCallback as fe,useContext as Oe,useEffect as h,useRef as p,useState as d}from"react";import{VIEW_TABLET_MIN as Re}from"efficient-easel/screen/lib/content/view-tiers";import{cssStringBody as Ce}from"efficient-web-builder/format/lib/document/style-text";import{HALF_SIZES as $,sizedImage as We}from"efficient-web-builder/format/lib/sized-image";import{prefersReducedMotion as G}from"efficient-web-builder/render/components/useReducedMotion";import{STAGE_PHOTO_BOX as Ue}from"../../lib/sections/hero-gallery.js";import{DEFAULT_SPIN_AUTO_TURN as je,DEFAULT_SPIN_HINT as Xe,SPIN_HINT_HIDE_MS as ze,SPIN_HINT_SHOW_MS as me,SPIN_RESUME_MS as Be,isFullTurn as he,spinAutoTurnStep as qe,spinBlend as Ge,spinClampPosition as Ke,spinFrameIndex as O,spinPositionAfterDrag as pe,spinCell as K,spinStartPosition as Z}from"../../lib/sections/spin-sets.js";const Ze=.3,Qe=.85,we=24,ge=4,ye=1e3,be=77/72,ve=`${(1-be)/2*100}%`,Se=`${be*100}%`,Q={left:ve,top:ve,width:Se,height:Se},Ve=`(max-width: ${Re-.02}px)`,V=new Map,Ee=new Map;function Y(t,v){let w=V.get(t);return w||(w=new Promise(M=>{const l=new Image,A=()=>{V.delete(t),Ee.delete(t),M(null)},S=()=>M({w:l.naturalWidth,h:l.naturalHeight});l.onload=()=>{if(typeof l.decode!="function")return S();l.decode().then(S,A)},l.onerror=A,v&&(l.sizes=$,l.srcset=v),l.src=t,Ee.set(t,l)}),V.set(t,w)),w}const Ye=$e({autoTurn:je,turnHint:Xe});let R=!1;const Je="M3 4.5c3.2 3.6 18.8 3.6 22 0M5.6 2.6 3 4.5l3 1.2M22.4 2.6 25 4.5l-3 1.2",F=t=>We(t,{fallbackWidth:ye,maxWidth:ye}),_e=(t,v)=>!!t.frames&&v===t.frames[0],Pe=t=>({...Q,backgroundImage:`url("${Ce(t.url)}")`,backgroundSize:`${t.cols*100}% ${t.rows*100}%`,backgroundPosition:`${t.cols>1?t.col*100/(t.cols-1):0}% ${t.rows>1?t.row*100/(t.rows-1):0}%`});function et({set:t,name:v,poster:w}){const[M,l]=d(null),A=p(null),[S,J]=d(()=>Z(t)),L=p(null),C=p(0),g=p(S),N=p(null),E=p(null),{autoTurn:f,turnHint:W}=Oe(Ye),[ke,U]=d(!1),[xe,ee]=d(!1),[j,te]=d(0),ne=p(0),[Ae,re]=d(!1),[Ie,Te]=d(!0),[oe,Fe]=d(null),i=t.count,[X,se]=d(null),z=p(null),[_,ie]=d(null),y=he(t),P=O(S,i,y),I=t.frames?t.frames[P]:t.startFrame??"";h(()=>{const e=A.current;e?.complete&&e.naturalWidth>0&&l(I)},[I]);const T=fe(e=>{const n=Ke(e,i,y);return g.current=n,J(n),n},[i,y]),D=fe(()=>cancelAnimationFrame(C.current),[]);h(()=>{const e=window.matchMedia?.(Ve);if(!e)return ie(!1);const n=()=>ie(e.matches);return n(),e.addEventListener?.("change",n),()=>e.removeEventListener?.("change",n)},[]),h(()=>{if(!t.sheets||!t.startFrame||_===null)return;const e=_?t.sheets.phone:t.sheets.desktop,n=`${t.startFrame} ${e.urls[0]}`;if(E.current===n)return;E.current=n,se({key:n,sheet:e,ready:new Set});const r=Math.floor(Z(t)/(e.cols*e.rows)),u=e.urls.map((c,o)=>e.urls[(r+o)%e.urls.length]),a=F(t.startFrame);Y(a.src,a.srcSet).then(()=>{for(const c of u)Y(c).then(o=>{!o||o.w!==e.cols*e.frame||o.h!==e.rows*e.frame||E.current===n&&se(m=>m?.key===n?{...m,ready:new Set(m.ready).add(c)}:m)})})},[t,_]),h(()=>{if(!t.frames)return;const e=t.frames,n=e[0];if(E.current===n)return;E.current=n;const r=O(Z(t),i,he(t)),u=[];for(let c=0;c<ge;c+=1)for(let o=c;o<i;o+=ge)u.push((r+o)%i);const a=c=>{const o=F(e[c]);return Y(o.src,o.srcSet)};a(u[0]).then(()=>Promise.all(u.slice(1).map(a))).then(c=>{E.current===n&&c.every(Boolean)&&Fe(n)})},[i,t]),h(()=>D,[D]),h(()=>{if(!W||R)return;const e=window.setTimeout(()=>U(!R),me),n=window.setTimeout(()=>{R=!0,U(!1)},me+ze);return()=>{window.clearTimeout(e),window.clearTimeout(n)}},[W]),h(()=>{const e=L.current;if(!f||!e)return;if(typeof IntersectionObserver>"u")return re(!0);const n=new IntersectionObserver(r=>re(r.some(u=>u.isIntersecting)));return n.observe(e),()=>n.disconnect()},[f]),h(()=>{if(!f)return;const e=()=>Te(document.visibilityState!=="hidden");return e(),document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[f]);const Me=e=>{D(),f&&ee(!0),W&&(R=!0,U(!1)),e.currentTarget.setPointerCapture?.(e.pointerId),N.current={x0:e.clientX,f0:g.current,last:e.clientX,speed:0}},Le=e=>{const n=N.current,r=L.current;!n||!r||(n.speed=e.clientX-n.last,n.last=e.clientX,T(pe(n.f0,e.clientX-n.x0,r.clientWidth,i)))},ae=()=>{const e=N.current;N.current=null,f&&e&&(ee(!1),te(a=>a+1));const n=L.current;if(!e||!n||G())return;let r=Math.max(-we,Math.min(we,e.speed));const u=()=>{if(Math.abs(r)<Ze)return;const a=pe(g.current,r,n.clientWidth,i);T(a)===a&&(r*=Qe,C.current=requestAnimationFrame(u))};C.current=requestAnimationFrame(u)},Ne=e=>{const n=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:0;if(e.key==="Home")T(0);else if(e.key==="End")T(i-1);else if(n)T(Math.round(g.current)+n);else return;D(),f&&te(r=>r+1),e.preventDefault()},s=t.sheets&&X&&X.key.startsWith(`${t.startFrame} `)?X:null;s&&s.ready.has(K(s.sheet,P).url)&&(z.current={key:s.key,frame:P});const B=s&&z.current?.key===s.key?z.current.frame:null,k=s&&B!==null?{...K(s.sheet,B),cols:s.sheet.cols,rows:s.sheet.rows}:null,x=Ge(S,i,y,G()),q=s&&x.b!==null&&B===P?K(s.sheet,x.b):null,ce=k&&q&&s.ready.has(q.url)?{...q,cols:k.cols,rows:k.rows}:null,le=!s&&t.frames&&x.b!==null&&_e(t,oe)?t.frames[x.b]:null,De=t.frames?_e(t,oe):!!s&&s.ready.size===s.sheet.urls.length,ue=f&&De&&Ae&&Ie&&!xe;return h(()=>{if(!ue)return;const e=ne.current!==j;let n=-1,r=-1,u=1,a=0;const c=o=>{if(a=requestAnimationFrame(c),n<0&&(n=o),e&&o-n<Be)return;if(ne.current=j,r<0){r=o;return}const m=qe(t,g.current,u,o-r);r=o,u=m.way;const He=O(g.current,i,y);g.current=m.position,(!G()||O(m.position,i,y)!==He)&&J(m.position)};return a=requestAnimationFrame(c),()=>cancelAnimationFrame(a)},[ue,j,t,i,y]),H("div",{ref:L,"data-spin-well":!0,role:"slider",tabIndex:0,"aria-label":`${v}, 360° view: drag or use the arrow keys to turn`,"aria-valuemin":1,"aria-valuemax":i,"aria-valuenow":P+1,"aria-valuetext":`Angle ${P+1} of ${i}`,"data-spin-auto-turn":f?"":void 0,onKeyDown:Ne,className:"absolute inset-0 select-none overflow-hidden cursor-grab active:cursor-grabbing focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg",style:{touchAction:"pan-y"},onPointerDown:Me,onPointerMove:Le,onPointerUp:ae,onPointerCancel:ae,onTouchStart:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),onTouchEnd:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[k?H(de,{children:[b("div",{"data-spin-frame":!0,className:"pointer-events-none absolute",style:Pe(k)}),ce?b("div",{"data-spin-frame":!0,className:"pointer-events-none absolute",style:{...Pe(ce),opacity:x.mix}}):null]}):H(de,{children:[b("img",{...F(I),ref:A,onLoad:()=>l(I),sizes:$,alt:"",draggable:!1,fetchPriority:"high","data-spin-frame":!0,className:"pointer-events-none absolute max-w-none object-contain",style:Q}),le?b("img",{...F(le),sizes:$,alt:"",draggable:!1,"data-spin-frame":!0,className:"pointer-events-none absolute max-w-none object-contain",style:{...Q,opacity:x.mix}}):null]}),w&&!k&&M!==I?b("img",{...F(w),sizes:$,alt:"",draggable:!1,"data-spin-poster":!0,className:`pointer-events-none absolute inset-[6%] ${Ue} object-contain`}):null,ke?H("span",{"data-spin-hint":!0,className:`pointer-events-none absolute inset-x-0 flex flex-col items-center gap-1 text-xs text-fg ${_?"bottom-3":"bottom-5"}`,children:[_?null:b("svg",{viewBox:"0 0 28 12",width:"28",height:"12","aria-hidden":"true",children:b("path",{d:Je,fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}),_?"Swipe to turn":"Drag to turn"]}):null]})}export{Ye as SpinChoices,et as default};
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { ProductSelection } from "../useProductSelection.js";
3
3
  import type { StoreProduct } from "../../lib/catalog/store-product.js";
4
- import type { HeroImageFit } from "../../lib/sections/hero-gallery.js";
4
+ import { type HeroImageFit } from "../../lib/sections/hero-gallery.js";
5
5
  export interface HeroView {
6
6
  heading: string;
7
7
  photos: string[];
@@ -1 +1 @@
1
- "use client";import{jsx as a,Fragment as y,jsxs as N}from"react/jsx-runtime";import E from"./TyreHeroFitment.js";import{STAGE_IMAGE_SIZES as w}from"./stage-photo.js";import{HeroVehicleMemory as k}from"./VehicleQuestion.js";import z from"./WheelHeroFitment.js";import C from"../PreOrderPanel.js";import j from"efficient-web-builder/render/components/RMark";import P from"../TyreImage.js";import F from"../WheelImage.js";import I from"../WheelSvg.js";import{partVariant as S,wheelFinish as H}from"../../lib/catalog/from-wheel.js";import{tyreModelLine as L}from"../../lib/tyres/tyre-brand-name.js";import{axisRenderingsFor as R,lugRenderingsFor as _}from"../../lib/wheels/cover-rendering.js";import{namedDetailShots as A}from"../../lib/wheels/detail-shots.js";import{finishAngles as T}from"../../lib/wheels/finish-photos.js";import{selectedStuds as B}from"../../lib/wheels/selected-studs.js";import{REFERENCE_NOTE as O,stageIsFallback as V}from"../../lib/wheels/render-fit.js";import{PER_WHEEL_UNIT as W}from"../../lib/wheels/set-mode.js";import{variantSpecLabel as M}from"../../lib/wheels/variant-spec.js";function me(t,e){return t.captions[e]?.trim()||`Photo ${e+1}`}function ce({text:t}){return t==="FusionForge®"?N(y,{children:["FusionForge",a(j,{})]}):a(y,{children:t})}function pe(t,e,h){if(t.kind==="tyre"){const r=t.source,l=e.shown.size??r.sizes[0]??"",n=r.variants.find(m=>m.size===l),f=n?.specs.tireType??r.variants[0]?.specs.tireType??null,d=[n?.image,r.coverImage].filter(m=>!!m);return{heading:L(r.brand,r.name),photos:d.slice(0,1),tint:void 0,stageImage:()=>a(P,{image:n?.image??r.coverImage,size:l,type:f,sizes:w,priority:!0,className:"h-full w-full"}),thumbImage:()=>null,captions:[],closeUps:[],thumbFallbackCells:0,galleryHint:"",referenceNote:"",metaValue:l,specCaption:n?[n.specs.loadIndex,n.specs.speedRating].filter(Boolean).join(""):"",originCaption:r.brand,unitLabel:"per tyre",vehicle:a(E,{slug:r.slug,variants:r.variants,vehicle:e.vehicle,manualMode:e.manualMode,setManualMode:e.setManualMode}),vehicleMemory:e.manualMode?null:a(k,{vehicle:e.vehicle}),vehicleAnswersSpecs:!1,preOrder:null}}const o=t.source,i=H(o,e.shown.finish),s=S(o,e.part),c=B(e),x=s?.components.find(r=>r.hand!=="right")??s?.components[0],p=R(i,x?.renderKey),u=p?null:_(i,c),v=p?[...p]:u?[...u]:T(i),g=v.length>0?v:o.coverImage?[o.coverImage]:[];return{heading:t.name,photos:g,tint:i.color,stageImage:({photo:r,alt:l,label:n,onZoom:f,fit:d,eager:m=!0,fillsTile:b=!1})=>a(F,{src:r,alt:l,fill:!0,sizes:w,className:b||d==="cover"?"object-cover":"object-contain",priority:m,onImageClick:f,imageButtonClassName:b?"relative block h-full w-full cursor-zoom-in":"relative block h-[88%] w-[88%] cursor-zoom-in",imageButtonLabel:n,fallback:a(I,{spokes:o.spokes,mesh:o.mesh,className:"block h-[70%] w-[70%]"})}),thumbImage:({photo:r,alt:l})=>a(F,{src:r,alt:l,fill:!0,sizes:"(max-width: 720px) 20vw, (max-width: 1100px) 10vw, 120px",className:"object-contain",imageWrapperClassName:"relative h-[80%] w-[80%]",fallback:a(I,{spokes:o.spokes,mesh:o.mesh,className:"block h-[55%] w-[55%]"})}),captions:g.map(r=>i.captions?.[r]),closeUps:A(i,c),thumbFallbackCells:4,galleryHint:U(g,i,c,e.manualMode),referenceNote:!p&&V(i,s,c,u!=null)?O:"",metaValue:i.name,specCaption:s?M(s):"",originCaption:o.process==="FusionForge®"?"FusionForge® · Hybrid":`${o.process} · 1-piece`,unitLabel:W,vehicle:a(z,{selection:e,spec:s?M(s):"",vehicle:e.vehicle,wheel:o}),vehicleMemory:e.manualMode?null:a(k,{vehicle:e.vehicle}),vehicleAnswersSpecs:!0,preOrder:a(C,{wheel:o,editing:h})}}function U(t,e,h,o){return t.length>=2||h!=null||!Object.values(e.lugRenderings??{}).some(s=>Array.isArray(s)&&s.filter(Boolean).length>=2)?"":o?"Pick a bolt pattern to see every angle":"Pick your vehicle to see every angle"}export{ce as MarkedLabel,pe as heroView,me as photoLabel};
1
+ "use client";import{jsx as a,Fragment as y,jsxs as E}from"react/jsx-runtime";import N from"./TyreHeroFitment.js";import{STAGE_IMAGE_SIZES as w}from"./stage-photo.js";import{HeroVehicleMemory as k}from"./VehicleQuestion.js";import z from"./WheelHeroFitment.js";import C from"../PreOrderPanel.js";import P from"efficient-web-builder/render/components/RMark";import S from"../TyreImage.js";import F from"../WheelImage.js";import I from"../WheelSvg.js";import{partVariant as _,wheelFinish as j}from"../../lib/catalog/from-wheel.js";import{STAGE_PHOTO_BOX as H}from"../../lib/sections/hero-gallery.js";import{tyreModelLine as A}from"../../lib/tyres/tyre-brand-name.js";import{axisRenderingsFor as L,lugRenderingsFor as O}from"../../lib/wheels/cover-rendering.js";import{namedDetailShots as R}from"../../lib/wheels/detail-shots.js";import{finishAngles as T}from"../../lib/wheels/finish-photos.js";import{selectedStuds as B}from"../../lib/wheels/selected-studs.js";import{REFERENCE_NOTE as V,stageIsFallback as W}from"../../lib/wheels/render-fit.js";import{PER_WHEEL_UNIT as G}from"../../lib/wheels/set-mode.js";import{variantSpecLabel as M}from"../../lib/wheels/variant-spec.js";function pe(t,e){return t.captions[e]?.trim()||`Photo ${e+1}`}function he({text:t}){return t==="FusionForge®"?E(y,{children:["FusionForge",a(P,{})]}):a(y,{children:t})}function ue(t,e,h){if(t.kind==="tyre"){const r=t.source,l=e.shown.size??r.sizes[0]??"",n=r.variants.find(m=>m.size===l),f=n?.specs.tireType??r.variants[0]?.specs.tireType??null,d=[n?.image,r.coverImage].filter(m=>!!m);return{heading:A(r.brand,r.name),photos:d.slice(0,1),tint:void 0,stageImage:()=>a(S,{image:n?.image??r.coverImage,size:l,type:f,sizes:w,priority:!0,className:"h-full w-full"}),thumbImage:()=>null,captions:[],closeUps:[],thumbFallbackCells:0,galleryHint:"",referenceNote:"",metaValue:l,specCaption:n?[n.specs.loadIndex,n.specs.speedRating].filter(Boolean).join(""):"",originCaption:r.brand,unitLabel:"per tyre",vehicle:a(N,{slug:r.slug,variants:r.variants,vehicle:e.vehicle,manualMode:e.manualMode,setManualMode:e.setManualMode}),vehicleMemory:e.manualMode?null:a(k,{vehicle:e.vehicle}),vehicleAnswersSpecs:!1,preOrder:null}}const o=t.source,i=j(o,e.shown.finish),s=_(o,e.part),c=B(e),x=s?.components.find(r=>r.hand!=="right")??s?.components[0],p=L(i,x?.renderKey),u=p?null:O(i,c),v=p?[...p]:u?[...u]:T(i),g=v.length>0?v:o.coverImage?[o.coverImage]:[];return{heading:t.name,photos:g,tint:i.color,stageImage:({photo:r,alt:l,label:n,onZoom:f,fit:d,eager:m=!0,fillsTile:b=!1})=>a(F,{src:r,alt:l,fill:!0,sizes:w,className:b||d==="cover"?"object-cover":"object-contain",priority:m,onImageClick:f,imageButtonClassName:b?"relative block h-full w-full cursor-zoom-in":`relative block ${H} cursor-zoom-in`,imageButtonLabel:n,fallback:a(I,{spokes:o.spokes,mesh:o.mesh,className:"block h-[70%] w-[70%]"})}),thumbImage:({photo:r,alt:l})=>a(F,{src:r,alt:l,fill:!0,sizes:"(max-width: 720px) 20vw, (max-width: 1100px) 10vw, 120px",className:"object-contain",imageWrapperClassName:"relative h-[80%] w-[80%]",fallback:a(I,{spokes:o.spokes,mesh:o.mesh,className:"block h-[55%] w-[55%]"})}),captions:g.map(r=>i.captions?.[r]),closeUps:R(i,c),thumbFallbackCells:4,galleryHint:U(g,i,c,e.manualMode),referenceNote:!p&&W(i,s,c,u!=null)?V:"",metaValue:i.name,specCaption:s?M(s):"",originCaption:o.process==="FusionForge®"?"FusionForge® · Hybrid":`${o.process} · 1-piece`,unitLabel:G,vehicle:a(z,{selection:e,spec:s?M(s):"",vehicle:e.vehicle,wheel:o}),vehicleMemory:e.manualMode?null:a(k,{vehicle:e.vehicle}),vehicleAnswersSpecs:!0,preOrder:a(C,{wheel:o,editing:h})}}function U(t,e,h,o){return t.length>=2||h!=null||!Object.values(e.lugRenderings??{}).some(s=>Array.isArray(s)&&s.filter(Boolean).length>=2)?"":o?"Pick a bolt pattern to see every angle":"Pick your vehicle to see every angle"}export{he as MarkedLabel,ue as heroView,pe as photoLabel};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{CARD_TEMPLATE_SLOT as r}from"efficient-web-builder/format/lib/content/card-template";import{cardPressTitlesOf as i}from"efficient-web-builder/render/lib/document/card-press-titles";import o from"../../../../../components/catalog/ShopperChips.js";import{FIRST_SHOWN_PROP as s}from"../../../../wheels/shopper-first-paint.js";import{FilterChipsBlockMeta as m}from"./meta.js";const w={...m,render:t=>e(o,{owner:{id:String(t.id??""),template:t.template,pressTitles:i(t,r)},showCount:t.showCount!==!1,showClear:t.showClear!==!1,showSort:t.showSort===!0,firstShown:t[s],editing:t.editor?.isEditing})};export{w as FilterChipsBlockRender};
1
+ import{jsx as t}from"react/jsx-runtime";import{CARD_TEMPLATE_SLOT as e}from"efficient-web-builder/format/lib/content/card-template";import{cardPressTitlesOf as r}from"efficient-web-builder/render/lib/document/card-press-titles";import{hidableText as i}from"efficient-easel/screen/lib/document/hidable";import m from"../../../../../components/catalog/ShopperChips.js";import{FIRST_SHOWN_PROP as l}from"../../../../wheels/shopper-first-paint.js";import{FILTER_CHIPS_COUNT_WORD_PROP as s,FILTER_CHIPS_LOOK_PROP as h,resolveFilterChipsLook as f}from"../../../../sections/filter-chips-look.js";import{FilterChipsBlockMeta as C}from"./meta.js";const R={...C,render:o=>t(m,{owner:{id:String(o.id??""),template:o.template,pressTitles:r(o,e)},showCount:o.showCount!==!1,showClear:o.showClear!==!1,showSort:o.showSort===!0,firstShown:o[l],editing:o.editor?.isEditing,look:f(o[h]),countWord:i(o[s])})};export{R as FilterChipsBlockRender};
@@ -933,6 +933,16 @@
933
933
  }
934
934
  }
935
935
  },
936
+ "FilterChipsBlock": {
937
+ "countWord": {
938
+ "type": "custom",
939
+ "__text": {
940
+ "control": "plainText",
941
+ "label": "Count word",
942
+ "placeholder": "items"
943
+ }
944
+ }
945
+ },
936
946
  "AppointmentBooking": {
937
947
  "eyebrow": {
938
948
  "type": "custom",
@@ -0,0 +1,13 @@
1
+ export declare const FILTER_CHIPS_LOOK_PROP = "chipsLook";
2
+ export declare const FILTER_CHIPS_LOOK_OPTIONS: readonly [{
3
+ readonly value: "toolbar";
4
+ readonly label: "Toolbar";
5
+ }, {
6
+ readonly value: "tabs";
7
+ readonly label: "Tabs";
8
+ }];
9
+ export type FilterChipsLook = (typeof FILTER_CHIPS_LOOK_OPTIONS)[number]["value"];
10
+ export declare const DEFAULT_FILTER_CHIPS_LOOK: FilterChipsLook;
11
+ export declare function resolveFilterChipsLook(value: unknown): FilterChipsLook;
12
+ export declare const FILTER_CHIPS_COUNT_WORD_PROP = "countWord";
13
+ export declare function chipsTotalWords(total: number, word: string, fallback: string): string;
@@ -0,0 +1 @@
1
+ const _="chipsLook",n=[{value:"toolbar",label:"Toolbar"},{value:"tabs",label:"Tabs"}],s="toolbar";function l(o){return n.some(t=>t.value===o)?o:s}const O="countWord";function c(o,t,e){const r=t.trim()||e;return o===0?`No ${r}`:o===1&&r.length>1&&r.endsWith("s")?`1 ${r.slice(0,-1)}`:`${o} ${r}`}export{s as DEFAULT_FILTER_CHIPS_LOOK,O as FILTER_CHIPS_COUNT_WORD_PROP,n as FILTER_CHIPS_LOOK_OPTIONS,_ as FILTER_CHIPS_LOOK_PROP,c as chipsTotalWords,l as resolveFilterChipsLook};
@@ -5,6 +5,7 @@ export declare const HERO_GALLERY_MODES: readonly ["main", "thumbs", "tiled", "s
5
5
  export declare const DEFAULT_HERO_GALLERY_MODE: HeroGalleryMode;
6
6
  export declare function parseHeroGalleryMode(v: unknown): HeroGalleryMode;
7
7
  export type HeroImageFit = ImageFit;
8
+ export declare const STAGE_PHOTO_BOX = "h-[88%] w-[88%]";
8
9
  export declare const HERO_IMAGE_FITS: readonly HeroImageFit[];
9
10
  export declare const DEFAULT_HERO_IMAGE_FIT: HeroImageFit;
10
11
  export declare function parseHeroImageFit(v: unknown): HeroImageFit;
@@ -1 +1 @@
1
- import{parseOption as t}from"efficient-shell/format";import{PICTURE_GROUNDS as r}from"./picture-grounds.js";import{IMAGE_FIT_LABEL as n,parseImageFit as p}from"efficient-web-builder/format/lib/content/image-fit";const a=["main","thumbs","tiled","stacked"],s="thumbs";function f(e){return t(a,s,e)}const _=["contain","cover"],E="contain";function F(e){return p(e,E)}function U(){return _.map(e=>({label:n[e],value:e}))}function I(e,o){return o?"contain":e}const l=r.filter(e=>e.value!=="soft"),c="flat";function M(e){return t(l.map(o=>o.value),c,e)}const i=[{label:"Every picture",value:"all"},{label:"First picture + close-ups",value:"closeUps"}],u="all";function T(e){return t(i.map(o=>o.value),u,e)}const L=!1,D=e=>typeof e=="boolean"?e:L,O=!0;function S(e){return typeof e=="boolean"?e:O}const R=0,H=24,A=8;function b(e){const o=typeof e=="number"?e:Number.NaN;return Number.isFinite(o)?Math.min(H,Math.max(R,Math.round(o))):A}export{L as DEFAULT_HERO_CLOSE_UPS_FILL,A as DEFAULT_HERO_GALLERY_GAP,O as DEFAULT_HERO_GALLERY_MARKS,s as DEFAULT_HERO_GALLERY_MODE,u as DEFAULT_HERO_GALLERY_SHOW,E as DEFAULT_HERO_IMAGE_FIT,c as DEFAULT_HERO_PHOTO_GROUND,H as HERO_GALLERY_GAP_MAX,R as HERO_GALLERY_GAP_MIN,a as HERO_GALLERY_MODES,i as HERO_GALLERY_SHOWS,_ as HERO_IMAGE_FITS,l as HERO_PHOTO_GROUNDS,U as heroImageFitOptions,D as parseHeroCloseUpsFill,b as parseHeroGalleryGap,S as parseHeroGalleryMarks,f as parseHeroGalleryMode,T as parseHeroGalleryShow,F as parseHeroImageFit,M as parseHeroPhotoGround,I as resolveHeroImageFit};
1
+ import{parseOption as t}from"efficient-shell/format";import{PICTURE_GROUNDS as r}from"./picture-grounds.js";import{IMAGE_FIT_LABEL as n,parseImageFit as p}from"efficient-web-builder/format/lib/content/image-fit";const a=["main","thumbs","tiled","stacked"],s="thumbs";function f(e){return t(a,s,e)}const F="h-[88%] w-[88%]",_=["contain","cover"],E="contain";function T(e){return p(e,E)}function U(){return _.map(e=>({label:n[e],value:e}))}function I(e,o){return o?"contain":e}const l=r.filter(e=>e.value!=="soft"),c="flat";function M(e){return t(l.map(o=>o.value),c,e)}const i=[{label:"Every picture",value:"all"},{label:"First picture + close-ups",value:"closeUps"}],u="all";function D(e){return t(i.map(o=>o.value),u,e)}const O=!1,S=e=>typeof e=="boolean"?e:O,L=!0;function b(e){return typeof e=="boolean"?e:L}const H=0,R=24,A=8;function h(e){const o=typeof e=="number"?e:Number.NaN;return Number.isFinite(o)?Math.min(R,Math.max(H,Math.round(o))):A}export{O as DEFAULT_HERO_CLOSE_UPS_FILL,A as DEFAULT_HERO_GALLERY_GAP,L as DEFAULT_HERO_GALLERY_MARKS,s as DEFAULT_HERO_GALLERY_MODE,u as DEFAULT_HERO_GALLERY_SHOW,E as DEFAULT_HERO_IMAGE_FIT,c as DEFAULT_HERO_PHOTO_GROUND,R as HERO_GALLERY_GAP_MAX,H as HERO_GALLERY_GAP_MIN,a as HERO_GALLERY_MODES,i as HERO_GALLERY_SHOWS,_ as HERO_IMAGE_FITS,l as HERO_PHOTO_GROUNDS,F as STAGE_PHOTO_BOX,U as heroImageFitOptions,S as parseHeroCloseUpsFill,h as parseHeroGalleryGap,b as parseHeroGalleryMarks,f as parseHeroGalleryMode,D as parseHeroGalleryShow,T as parseHeroImageFit,M as parseHeroPhotoGround,I as resolveHeroImageFit};
@@ -15,6 +15,7 @@ export interface SpinSet {
15
15
  };
16
16
  arc?: number;
17
17
  start?: number;
18
+ autoArc?: number;
18
19
  }
19
20
  export type SpinSets = Record<string, Record<string, SpinSet>>;
20
21
  export declare const DEFAULT_SPIN_AUTO_TURN = false;
@@ -23,7 +24,8 @@ export declare function parseSpinSwitch(v: unknown): boolean;
23
24
  export declare const SPIN_HINT_SHOW_MS = 1000;
24
25
  export declare const SPIN_HINT_HIDE_MS = 6000;
25
26
  export declare const SPIN_TURN_MS = 14000;
26
- export declare const SPIN_RESUME_MS = 2500;
27
+ export declare const SPIN_RESUME_MS = 5000;
28
+ export declare const DEFAULT_SPIN_AUTO_ARC = 160;
27
29
  export declare function spinAutoTurnStep(set: SpinSet, position: number, way: 1 | -1, ms: number): {
28
30
  position: number;
29
31
  way: 1 | -1;
@@ -1 +1 @@
1
- import{resolveMedia as S}from"efficient-web-builder/render/lib/media";const a=4096,c=360,h=.9,A=!1,g=!1;function P(t){return t===!0}const d=1e3,E=6e3,m=14e3,M=1e-6,j=2500;function F(t,n,r,e){const o=p(t)?c:t.arc,s=n+r*e*t.count*c/(m*o);if(p(t))return{position:(s%t.count+t.count)%t.count,way:r};const i=t.count-M;return s>=i?{position:i,way:-1}:s<=0?{position:0,way:1}:{position:s,way:r}}const _=t=>Array.isArray(t)&&t.length>0&&t.every(n=>typeof n=="string"&&n.length>0),l=t=>S(t)??t,f=t=>Number.isInteger(t)&&t>0;function x(t,n){if(!t||typeof t!="object")return null;const{frame:r,cols:e,rows:o,urls:s}=t;return!f(r)||!f(e)||!f(o)||!_(s)||r*e>a||r*o>a||s.length!==Math.ceil(n/(e*o))?null:{frame:r,cols:e,rows:o,urls:s.map(l)}}function y(t){const{frames:n,count:r,startFrame:e,sheets:o}=t,s=_(n)?{count:n.length,frames:n.map(l)}:null;if(o&&typeof o=="object"&&f(r)&&typeof e=="string"&&e){const i=x(o.desktop,r),u=x(o.phone,r);if(i&&u)return{count:r,startFrame:l(e),sheets:{desktop:i,phone:u}}}return s}function N(t){if(!t||typeof t!="object")return null;const{arc:n,start:r}=t,e=y(t);if(!e)return null;if(n!==void 0){if(typeof n!="number"||!(n>0&&n<=c))return null;e.arc=n}return Number.isInteger(r)&&r>=0&&r<e.count&&(e.start=r),e}function U(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,e]of Object.entries(t)){if(!e||typeof e!="object"||Array.isArray(e))continue;const o={};for(const[s,i]of Object.entries(e)){const u=N(i);u&&(o[s]=u)}Object.keys(o).length>0&&(n[r]=o)}return n}function R(t,n,r){return r?t[n]?.[r]??null:null}function L(t,n){const r=Object.keys(t?.[n]??{});return r.length>0?{finish:r}:null}function p(t){return t.arc===void 0||t.arc>=c}function I(t){return p(t)?0:Math.floor(t.count/2)}function k(t){return t.start??I(t)}function T(t,n,r=!0){return r?(Math.floor(t)%n+n)%n:Math.max(0,Math.min(n-1,Math.floor(t)))}function D(t,n,r,e){const o=T(t,n,r),s=t-Math.floor(t),i=r?(o+1)%n:o+1<n?o+1:null;return e||s===0||i===null?{a:o,b:null,mix:0}:{a:o,b:i,mix:s}}function H(t,n,r){return r?t:Math.max(0,Math.min(n-1,t))}function O(t,n,r,e){return r<=0?t:t-n/r*e*h}function C(t,n){const r=t.cols*t.rows,e=n%r;return{url:t.urls[Math.floor(n/r)],col:e%t.cols,row:Math.floor(e/t.cols)}}export{A as DEFAULT_SPIN_AUTO_TURN,g as DEFAULT_SPIN_HINT,E as SPIN_HINT_HIDE_MS,d as SPIN_HINT_SHOW_MS,j as SPIN_RESUME_MS,a as SPIN_SHEET_MAX_SIDE,m as SPIN_TURN_MS,p as isFullTurn,U as parseSpinSets,P as parseSpinSwitch,F as spinAutoTurnStep,D as spinBlend,C as spinCell,H as spinClampPosition,T as spinFrameIndex,O as spinPositionAfterDrag,L as spinPreference,R as spinSetFor,k as spinStartPosition};
1
+ import{resolveMedia as m}from"efficient-web-builder/render/lib/media";const x=4096,c=360,M=.9,E=!1,U=!1;function F(t){return t===!0}const j=1e3,R=6e3,S=14e3,y=1e-6,L=5e3,N=160;function D(t,n,r,e){const o=t.autoArc??N;if(a(t)&&o<c)return g(t.count,o,n,r,e*t.count/S);const i=a(t)?c:t.arc,s=n+r*e*t.count*c/(S*i);if(a(t))return{position:(s%t.count+t.count)%t.count,way:r};const u=t.count-y;return s>=u?{position:u,way:-1}:s<=0?{position:0,way:1}:{position:s,way:r}}const h=t=>Array.isArray(t)&&t.length>0&&t.every(n=>typeof n=="string"&&n.length>0),_=t=>m(t)??t,p=t=>Number.isInteger(t)&&t>0;function A(t,n){if(!t||typeof t!="object")return null;const{frame:r,cols:e,rows:o,urls:i}=t;return!p(r)||!p(e)||!p(o)||!h(i)||r*e>x||r*o>x||i.length!==Math.ceil(n/(e*o))?null:{frame:r,cols:e,rows:o,urls:i.map(_)}}function T(t){const{frames:n,count:r,startFrame:e,sheets:o}=t,i=h(n)?{count:n.length,frames:n.map(_)}:null;if(o&&typeof o=="object"&&p(r)&&typeof e=="string"&&e){const s=A(o.desktop,r),u=A(o.phone,r);if(s&&u)return{count:r,startFrame:_(e),sheets:{desktop:s,phone:u}}}return i}function I(t){if(!t||typeof t!="object")return null;const{arc:n,start:r}=t,e=T(t);if(!e)return null;if(n!==void 0){if(typeof n!="number"||!(n>0&&n<=c))return null;e.arc=n}const{autoArc:o}=t;return typeof o=="number"&&o>0&&o<=c&&(e.autoArc=o),Number.isInteger(r)&&r>=0&&r<e.count&&(e.start=r),e}function O(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,e]of Object.entries(t)){if(!e||typeof e!="object"||Array.isArray(e))continue;const o={};for(const[i,s]of Object.entries(e)){const u=I(s);u&&(o[i]=u)}Object.keys(o).length>0&&(n[r]=o)}return n}function k(t,n,r){return r?t[n]?.[r]??null:null}function w(t,n){const r=Object.keys(t?.[n]??{});return r.length>0?{finish:r}:null}function a(t){return t.arc===void 0||t.arc>=c}function g(t,n,r,e,o){const i=t*n/(2*c),s=(r%t+t)%t,u=s>t/2?s-t:s;let f=u>i?-1:u<-i?1:e,l=u+f*o;return f===1&&u<=i&&l>=i?[l,f]=[i,-1]:f===-1&&u>=-i&&l<=-i&&([l,f]=[-i,1]),{position:(l%t+t)%t,way:f}}function b(t){return a(t)?0:Math.floor(t.count/2)}function H(t){return t.start??b(t)}function d(t,n,r=!0){return r?(Math.floor(t)%n+n)%n:Math.max(0,Math.min(n-1,Math.floor(t)))}function C(t,n,r,e){const o=d(t,n,r),i=t-Math.floor(t),s=r?(o+1)%n:o+1<n?o+1:null;return e||i===0||s===null?{a:o,b:null,mix:0}:{a:o,b:s,mix:i}}function W(t,n,r){return r?t:Math.max(0,Math.min(n-1,t))}function B(t,n,r,e){return r<=0?t:t-n/r*e*M}function G(t,n){const r=t.cols*t.rows,e=n%r;return{url:t.urls[Math.floor(n/r)],col:e%t.cols,row:Math.floor(e/t.cols)}}export{N as DEFAULT_SPIN_AUTO_ARC,E as DEFAULT_SPIN_AUTO_TURN,U as DEFAULT_SPIN_HINT,R as SPIN_HINT_HIDE_MS,j as SPIN_HINT_SHOW_MS,L as SPIN_RESUME_MS,x as SPIN_SHEET_MAX_SIDE,S as SPIN_TURN_MS,a as isFullTurn,O as parseSpinSets,F as parseSpinSwitch,D as spinAutoTurnStep,C as spinBlend,G as spinCell,W as spinClampPosition,d as spinFrameIndex,B as spinPositionAfterDrag,w as spinPreference,k as spinSetFor,H as spinStartPosition};