Checkpoint: headless JSON architecture documented + cleanup (Stufe 1+2)
Restore point before Stufe 3 (central resolver-service refactoring). Includes this session's work: - Success Story (usecase) rebuild: new fields/tabs, UsecaseSerializer, thin List/Show renderers, MM relations, inline content elements. - vitec_columns content block (two-column layout with per-item content) incl. unified header section; special-cased JSON resolution. - Container per-column flex (items[].config align/justify) + gap on parent. - Unified header section across CEs/plugins/containers; header fields in JSON. - ISO-style architecture spec: Documentation/Headless-JSON-Architecture.md. - Cleanup: removed local scratch + verified .bak backups. - Fixes: B-6 (undefined thumbnail variable in Downloadcardcollection image resolver), B-7 (unsatisfiable legacy CType OR branch in Downloadcard/Datasheets). Rollback: git reset --hard snapshot-2026-07-09-pre-stufe3 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
c6759186cb
commit
bb7c03235d
237 files changed
+6698
-1749
No files matched your search
@@ -0,0 +1 @@
|
||||
import{C as e,D as t,O as n,Q as r,V as i,Z as a,a as o,k as s,n as c,tt as l,w as u}from"./index-7LYai_r-.js";import{t as d}from"./jszip.min-B_jfdBDa.js";var f=l(r(),1),p=l(d(),1),m=a(),h=`vitec_datasheets_view`,g=`vitec_datasheets_favorites`,_=e=>e?e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.round(e/1024)} KB`:``;async function v(e,t){let n=new p.default;await Promise.all(e.map(async e=>{let t=e.datasheet?.file?.url;if(!t)return;let r=await fetch(i(t,o.base_url,o.router_mode));r.ok&&n.file(e.datasheet?.file?.name??`${e.product?.slug??`datasheet`}.pdf`,await r.blob())}));let r=await n.generateAsync({type:`blob`}),a=Object.assign(document.createElement(`a`),{href:URL.createObjectURL(r),download:t});a.click(),URL.revokeObjectURL(a.href)}function y({ext:e}){return e?(0,m.jsx)(s,{component:`span`,sx:{fontSize:`0.5625rem`,fontWeight:700,letterSpacing:`0.06em`,px:`0.3125rem`,py:`0.125rem`,borderRadius:`0.1875rem`,background:`rgba(var(--vitec-brand), 1)`,color:`#fff`,textTransform:`uppercase`,flexShrink:0},children:e}):null}function b({href:e}){return(0,m.jsxs)(t,{component:`a`,href:e,target:`_blank`,rel:`noreferrer noopener`,sx:{display:`inline-flex`,alignItems:`center`,gap:`0.3rem`,fontSize:`0.8125rem`,fontWeight:600,color:`rgba(var(--vitec-orange), 1)`,textDecoration:`none`,"&:hover":{color:`rgba(var(--vitec-orange-dark), 1)`},flexShrink:0},children:[(0,m.jsxs)(`svg`,{width:`13`,height:`13`,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`})]}),`Download`]})}function x({active:e,onToggle:t,size:n=18}){return(0,m.jsx)(`button`,{onClick:t,title:e?`Remove from favorites`:`Add to favorites`,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,padding:0,border:`none`,outline:`none`,background:`none`,cursor:`pointer`,transition:`transform 0.15s`,lineHeight:0},onMouseEnter:e=>{e.currentTarget.style.transform=`scale(1.2)`},onMouseLeave:e=>{e.currentTarget.style.transform=`scale(1)`},children:(0,m.jsx)(`svg`,{width:n,height:n,viewBox:`0 0 24 24`,fill:e?`#f59e0b`:`none`,stroke:e?`#f59e0b`:`#9ca3af`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,m.jsx)(`polygon`,{points:`12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2`})})})}function S(){return(0,m.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,"aria-hidden":`true`,style:{display:`block`},children:[(0,m.jsx)(`rect`,{x:`1`,y:`1`,width:`6`,height:`6`,rx:`1`,fill:`currentColor`}),(0,m.jsx)(`rect`,{x:`9`,y:`1`,width:`6`,height:`6`,rx:`1`,fill:`currentColor`}),(0,m.jsx)(`rect`,{x:`1`,y:`9`,width:`6`,height:`6`,rx:`1`,fill:`currentColor`}),(0,m.jsx)(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,fill:`currentColor`})]})}function C(){return(0,m.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,"aria-hidden":`true`,style:{display:`block`},children:[(0,m.jsx)(`rect`,{x:`1`,y:`2`,width:`14`,height:`2.5`,rx:`1`,fill:`currentColor`}),(0,m.jsx)(`rect`,{x:`1`,y:`7`,width:`14`,height:`2.5`,rx:`1`,fill:`currentColor`}),(0,m.jsx)(`rect`,{x:`1`,y:`11.5`,width:`14`,height:`2.5`,rx:`1`,fill:`currentColor`})]})}function w({view:e,onChange:t}){let n=e=>({display:`flex`,alignItems:`center`,justifyContent:`center`,width:`2rem`,height:`2rem`,padding:0,border:`none`,borderRadius:`0.25rem`,background:e?`rgba(var(--vitec-brand), 1)`:`transparent`,color:e?`#ffffff`:`#6b7280`,cursor:e?`default`:`pointer`,transition:`background 0.15s, color 0.15s`});return(0,m.jsxs)(`div`,{style:{display:`flex`,border:`1px solid #e5e7eb`,borderRadius:`0.375rem`,padding:`0.1875rem`,gap:`0.1875rem`,background:`#fff`},children:[(0,m.jsx)(`button`,{onClick:()=>t(`grid`),title:`Grid view`,style:n(e===`grid`),children:(0,m.jsx)(S,{})}),(0,m.jsx)(`button`,{onClick:()=>t(`table`),title:`Table view`,style:n(e===`table`),children:(0,m.jsx)(C,{})})]})}function T({value:e,onChange:n}){return(0,m.jsxs)(t,{sx:{display:`flex`,alignItems:`center`,gap:`0.625rem`,px:`0.875rem`,py:`0.5rem`,borderRadius:`0.5rem`,border:`1.5px solid`,borderColor:e?`rgba(var(--vitec-brand), 1)`:`divider`,bgcolor:`#fff`,maxWidth:`24rem`,transition:`border-color 0.15s`,"&:focus-within":{borderColor:`rgba(var(--vitec-brand), 1)`}},children:[(0,m.jsx)(t,{sx:{color:`text.disabled`,flexShrink:0,display:`flex`},children:(0,m.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,m.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,m.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]})}),(0,m.jsx)(t,{component:`input`,value:e,onChange:e=>n(e.target.value),placeholder:`Search datasheets…`,sx:{flex:1,border:`none`,outline:`none`,background:`transparent`,fontSize:`0.875
Line truncated
|
||||
Reference in new issue
Block a user