import {referencePreview} from '../lib/layout-images-client'; import {useState} from 'react'; import Head from 'next/head'; import {SourceCover,selections,type CoverValues} from './SourceCover'; import {tutorialPost} from '../content/tool-links'; export function LayoutSelection(){ const [active,setActive]=useState(0),[values,setValues]=useState(selections.map(l=>({fields:Object.fromEntries(Object.entries(l.fields).filter(([,v])=>v!==undefined)) as Record,color:'#83918a',accent:'#c3cec5'}))),[guides,setGuides]=useState(false),[status,setStatus]=useState(''); const layout=selections[active],current=values[active]; function update(patch:Partial){setValues(old=>old.map((v,i)=>i===active?{...v,...patch}:v));} async function download(format:'svg'|'json'){ try{setStatus('正在生成…');const r=await fetch('/studio/api/export/layout-selection?format='+format,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({layoutId:layout.id,...current})});if(!r.ok)throw Error();const url=URL.createObjectURL(await r.blob()),a=document.createElement('a');a.href=url;a.download=layout.id+'.'+format;a.click();setTimeout(()=>URL.revokeObjectURL(url),500);setStatus('已导出当前模板。')}catch{setStatus('导出失败,请重试。')} } return
三种排版 · Studio 工具
← PROMPT 使用教程STUDIO / LAYOUT SELECTION
REF-01 / REF-07 / REF-26

三个构图,各有位置。

切换真实原图对应的模板,分别试文字与配色。图位与装饰按教程构件重建为干净矢量;当前只放占位内容。