- Success Stories: full migration from old site (48/48, audited), markets n:n, quotation content block, columns content block, pretty SEO detail URLs via SuccessStoryPathRewrite middleware, list/detail split (list page 4 / story page), detailUrl/backUrl - New plugins: VITEC Locations (grid/list/map + RTE map text), VITEC Customer Logos (color/bw logic, only-show-selected), VITEC Card (one plugin for product/story/market/solution with reloading FlexForm + custom backend preview renderer) - Eventlist: layout dropdown (list/grid/teaserbar) in settings - Hero section CB: Images/Video tabs, background video + overlay - Product JSON: full category rootline (parents), fixed missing ConnectionPool import (all-products crash), category tree map - Backend preview CSS: container-query responsive (narrow columns) - Docs: ISO architecture spec, root + extension READMEs Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 line
6.0 KiB
JavaScript
1 line
6.0 KiB
JavaScript
import{A as e,b as t,d as n,f as r,ot as i,p as a,r as o,ut as s,x as c}from"./index-CM0zIqrs.js";var l=s(),u=i();function d({item:e}){let t=e.logo?.url,n=e.logo?.alternative||e.logo?.title||e.name,r=e.logo?.srcset?.map(e=>`${e.url} ${e.descriptor}`).join(`, `);return t?(0,u.jsx)(`img`,{src:t,srcSet:r||void 0,sizes:`200px`,alt:n,className:`vitec_customerlogos__logo-img${e.color?``:` vitec_customerlogos__logo-img--grey`}`,loading:`lazy`,decoding:`async`}):null}function f({logos:e}){let t=[...e,...e];return(0,u.jsx)(`div`,{className:`vitec_customerlogos__marquee`,"aria-label":`Customer logos`,"aria-hidden":`true`,children:(0,u.jsx)(`div`,{className:`vitec_customerlogos__marquee-track`,children:t.map((e,t)=>(0,u.jsx)(`div`,{className:`vitec_customerlogos__marquee-item`,children:(0,u.jsx)(d,{item:e})},`${e.id}-${t}`))})})}function p({logos:e}){return(0,u.jsx)(`ul`,{className:`vitec_customerlogos__grid`,"aria-label":`Customer logos`,children:e.map(e=>(0,u.jsx)(`li`,{className:`vitec_customerlogos__grid-item`,children:(0,u.jsx)(d,{item:e})},e.id))})}var m=24;function h(){return(0,u.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`,"aria-hidden":`true`,children:(0,u.jsx)(`path`,{d:`M11 4.5L6.5 9l4.5 4.5`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function g(){return(0,u.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`,"aria-hidden":`true`,children:(0,u.jsx)(`path`,{d:`M7 4.5L11.5 9 7 13.5`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function _({logos:e}){let t=(0,l.useRef)(null),n=(0,l.useRef)({dragging:!1,startX:0,startScrollLeft:0,moved:!1}),[r,i]=(0,l.useState)(!1),[a,o]=(0,l.useState)(!1),[s,c]=(0,l.useState)(0),[f,p]=(0,l.useState)(5),_=(0,l.useCallback)(()=>{let n=t.current;if(!n)return;let{scrollLeft:r,scrollWidth:a,clientWidth:s}=n;i(r>4),o(r<a-s-4);let l=n.children[0];if(l){let t=l.offsetWidth+m;if(t>0){let i=Math.round(r/t),a=Math.max(1,Math.floor((n.clientWidth+m)/t));p(a);let o=Math.max(1,e.length-a+1);c(Math.min(i,o-1))}}},[e.length]);(0,l.useEffect)(()=>{_();let e=new ResizeObserver(_);return t.current&&e.observe(t.current),()=>e.disconnect()},[_]),(0,l.useEffect)(()=>{let e=t.current;if(!e)return;let r=0,i=0,a=0,o=null,s=t=>{let s=t.touches[0];r=s.pageX,i=s.pageY,a=e.scrollLeft,o=null,n.current={dragging:!0,startX:s.pageX,startScrollLeft:e.scrollLeft,moved:!1},e.style.scrollSnapType=`none`},c=t=>{if(!n.current.dragging)return;let s=t.touches[0],c=s.pageX-r,l=s.pageY-i;o===null&&(o=Math.abs(c)>Math.abs(l)),o?(t.preventDefault(),Math.abs(c)>3&&(n.current.moved=!0),e.scrollLeft=a-c):(e.style.scrollSnapType=``,n.current.dragging=!1)},l=()=>{n.current.dragging&&(n.current.dragging=!1,e.style.scrollSnapType=``)};return e.addEventListener(`touchstart`,s,{passive:!0}),e.addEventListener(`touchmove`,c,{passive:!1}),e.addEventListener(`touchend`,l,{passive:!0}),()=>{e.removeEventListener(`touchstart`,s),e.removeEventListener(`touchmove`,c),e.removeEventListener(`touchend`,l)}},[]);let v=(0,l.useCallback)(e=>{let n=t.current;if(!n||!n.children[0])return;let r=n.children[0].offsetWidth+m;n.scrollBy({left:e*r,behavior:`smooth`})},[]),y=(0,l.useCallback)(e=>{let n=t.current;if(!n||!n.children[0])return;let r=n.children[0].offsetWidth+m;n.scrollTo({left:e*r,behavior:`smooth`})},[]),b=(0,l.useCallback)(e=>{let r=t.current;r&&(n.current={dragging:!0,startX:e.pageX,startScrollLeft:r.scrollLeft,moved:!1},r.style.scrollSnapType=`none`,r.style.cursor=`grabbing`,r.style.userSelect=`none`)},[]),x=(0,l.useCallback)(e=>{let r=n.current;if(!r.dragging)return;let i=t.current;if(!i)return;let a=e.pageX-r.startX;Math.abs(a)>3&&(r.moved=!0),i.scrollLeft=r.startScrollLeft-a},[]),S=(0,l.useCallback)(()=>{let e=t.current;!e||!n.current.dragging||(n.current.dragging=!1,e.style.cursor=``,e.style.userSelect=``,e.style.scrollSnapType=``)},[]),C=e.length>f,w=Math.max(1,e.length-f+1);return(0,u.jsxs)(`div`,{className:`vitec_customerlogos__carousel`,children:[C&&(0,u.jsx)(`div`,{className:`vitec_customerlogos__carousel-header`,children:(0,u.jsxs)(`div`,{className:`vitec_customerlogos__carousel-arrows`,children:[(0,u.jsx)(`button`,{className:`vitec_customerlogos__carousel-arrow`,onClick:()=>v(-1),disabled:!r,"aria-label":`Previous`,children:(0,u.jsx)(h,{})}),(0,u.jsx)(`button`,{className:`vitec_customerlogos__carousel-arrow`,onClick:()=>v(1),disabled:!a,"aria-label":`Next`,children:(0,u.jsx)(g,{})})]})}),(0,u.jsx)(`div`,{className:`vitec_customerlogos__carousel-track`,ref:t,onScroll:_,onMouseDown:b,onMouseMove:x,onMouseUp:S,onMouseLeave:S,onDragStart:e=>e.preventDefault(),children:e.map(e=>(0,u.jsx)(`div`,{className:`vitec_customerlogos__carousel-slide`,children:(0,u.jsx)(d,{item:e})},e.id))}),C&&(0,u.jsx)(`div`,{className:`vitec_customerlogos__carousel-dots`,role:`tablist`,children:Array.from({length:w}).map((e,t)=>(0,u.jsx)(`button`,{role:`tab`,"aria-selected":t===s,"aria-label":`Position ${t+1}`,className:`vitec_customerlogos__carousel-dot${t===s?` vitec_customerlogos__carousel-dot--active`:``}`,onClick:()=>y(t)},t))})]})}function v({logos:e}){return(0,u.jsx)(`ul`,{className:`vitec_customerlogos__list`,"aria-label":`Customer logos`,children:e.map(e=>(0,u.jsxs)(`li`,{className:`vitec_customerlogos__list-item`,children:[(0,u.jsx)(d,{item:e}),(0,u.jsx)(`span`,{className:`vitec_customerlogos__list-name`,children:e.name})]},e.id))})}function y({element:i,className:s,nested:l,devInfoTags:d,uid:m,spaceBefore:h,spaceAfter:g}){let y=i.content?.customerlogos??{},b=y.logos??[],x=y.layout??`marquee`,S=n(i),C=c(r(i)??3),w=t(a(i));return b.length?(0,u.jsx)(o,{className:s,devInfoTags:d,nested:l,uid:m,spaceBefore:h,spaceAfter:g,children:(0,u.jsxs)(`div`,{className:`vitec_customerlogos vitec_customerlogos--${x}`,children:[S&&(0,u.jsx)(e,{variant:C,className:`vitec_customerlogos__header`,sx:{textAlign:w},children:S}),x===`marquee`&&(0,u.jsx)(f,{logos:b}),x===`grid`&&(0,u.jsx)(p,{logos:b}),x===`carousel`&&(0,u.jsx)(_,{logos:b}),x===`list`&&(0,u.jsx)(v,{logos:b})]})}):null}export{y as VitecCustomerLogos}; |