- 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
4.7 KiB
JavaScript
1 line
4.7 KiB
JavaScript
import{A as e,J as t,M as n,O as r,T as i,c as a,d as o,mt as s,ot as c,r as l,ut as u}from"./index-CM0zIqrs.js";import{t as d}from"./jszip.min-DxLKr7hR.js";var f=u(),p=s(d(),1),m=c(),h=`linear-gradient(135deg, rgba(var(--vitec-brand), 1) 0%, rgba(var(--vitec-navy-deep), 1) 100%)`;async function g(e,n){let r=new p.default;await Promise.all(e.map(async e=>{let n=e.file?.url;if(!n)return;let i=t(n,a.base_url,a.router_mode),o=await fetch(i);if(!o.ok)return;let s=await o.blob();r.file(e.file?.name??`download_${e.uid}.pdf`,s)}));let i=await r.generateAsync({type:`blob`}),o=URL.createObjectURL(i),s=document.createElement(`a`);s.href=o,s.download=n,s.click(),URL.revokeObjectURL(o)}function _({download:e}){let n=e.file,i=n?.url?t(n.url,a.base_url,a.router_mode):void 0,o=e.title??n?.name??`Download`;return(0,m.jsxs)(r,{component:`a`,href:i??`#`,target:`_blank`,rel:`noreferrer noopener`,sx:{display:`flex`,alignItems:`baseline`,gap:`0.4rem`,color:`rgba(255,255,255,0.85)`,textDecoration:`none`,fontSize:`0.8125rem`,lineHeight:1.4,"&:hover":{color:`#fff`,textDecoration:`underline`}},children:[(0,m.jsx)(r,{component:`span`,sx:{flexShrink:0,mt:`0.2em`,color:`rgba(var(--vitec-orange), 1)`,fontSize:`0.5rem`},children:`■`}),(0,m.jsx)(`span`,{children:o})]})}function v({downloads:e,zipName:t}){let[i,a]=(0,f.useState)(`idle`);return(0,m.jsxs)(r,{component:`button`,onClick:async n=>{if(n.preventDefault(),i!==`loading`){a(`loading`);try{await g(e,t),a(`idle`)}catch{a(`error`),setTimeout(()=>a(`idle`),3e3)}}},disabled:i===`loading`,sx:{display:`inline-flex`,alignItems:`center`,gap:`0.4rem`,alignSelf:`flex-start`,mt:`auto`,fontSize:`0.8125rem`,fontWeight:600,color:i===`error`?`rgba(255,180,180,1)`:`#fff`,background:`none`,border:`1.5px solid`,borderColor:i===`error`?`rgba(255,120,120,0.6)`:`rgba(255,255,255,0.5)`,borderRadius:`0.375rem`,px:`0.875rem`,py:`0.4375rem`,cursor:i===`loading`?`default`:`pointer`,transition:`border-color 0.15s, background 0.15s`,"&:hover:not(:disabled)":{borderColor:`#fff`,bgcolor:`rgba(255,255,255,0.1)`}},children:[i===`loading`?(0,m.jsx)(n,{size:12,sx:{color:`inherit`}}):(0,m.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,m.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,m.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,m.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]}),i===`error`?`Download failed`:`Download All Documents (ZIP)`]})}function y({element:n,className:s,nested:c,devInfoTags:u,uid:d,spaceBefore:f,spaceAfter:p}){let g=n.content?.downloadcardcollection??n.data?.downloadcardcollection,y=g?.downloads??[],b=o(n),x=g?.image,S=x&&`publicUrl`in x?x.publicUrl:void 0,C=y[0]?.file?.thumbnail,w=S??(C?t(C,a.base_url,a.router_mode):void 0),T=y.filter(e=>e.file?.url),E=`${(b??`documents`).toLowerCase().replace(/\s+/g,`-`)}.zip`;return y.length===0?null:(0,m.jsx)(l,{className:s,devInfoTags:u,nested:c,uid:d,spaceBefore:f,spaceAfter:p,children:(0,m.jsxs)(r,{className:`vitec_downloadcardcollection`,sx:{display:`flex`,borderRadius:`0.75rem`,overflow:`hidden`,boxShadow:`0 0.125rem 0.75rem rgba(0,0,0,0.08)`,minHeight:`10rem`},children:[(0,m.jsx)(r,{sx:{width:`38%`,flexShrink:0,bgcolor:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`,overflow:`hidden`,p:w?0:`1.5rem`},children:w?(0,m.jsx)(r,{component:`img`,src:w,alt:b??`Downloads`,loading:`lazy`,sx:{width:`100%`,height:`100%`,objectFit:`contain`,objectPosition:`top center`,display:`block`,p:`0.75rem`}}):(0,m.jsx)(r,{sx:{color:`text.disabled`,opacity:.3},children:(0,m.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,m.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,m.jsx)(`polyline`,{points:`14 2 14 8 20 8`}),(0,m.jsx)(`line`,{x1:`8`,y1:`13`,x2:`16`,y2:`13`}),(0,m.jsx)(`line`,{x1:`8`,y1:`17`,x2:`16`,y2:`17`}),(0,m.jsx)(`polyline`,{points:`10 9 9 9 8 9`})]})})}),(0,m.jsxs)(r,{sx:{flex:1,background:h,color:`#fff`,display:`flex`,flexDirection:`column`,p:`1.25rem 1.25rem 1rem`,gap:`0.75rem`},children:[(0,m.jsxs)(i,{direction:`row`,alignItems:`center`,spacing:1,children:[(0,m.jsx)(e,{component:`span`,sx:{fontSize:`0.6875rem`,fontWeight:700,letterSpacing:`0.06em`,textTransform:`uppercase`,opacity:.85,whiteSpace:`nowrap`,color:`inherit`},children:b??`Download Collection`}),(0,m.jsx)(r,{sx:{flex:1,height:`1px`,bgcolor:`rgba(255,255,255,0.3)`}})]}),(0,m.jsx)(i,{spacing:.375,sx:{flex:1},children:y.map(e=>(0,m.jsx)(_,{download:e},e.uid??e.slug??e.title))}),T.length>1&&(0,m.jsx)(v,{downloads:T,zipName:E})]})]})})}export{y as VitecDownloadCardCollection}; |