PageSourceSearch

https://snew.ai/assets/SocialAdComposedPreviewPage-BbmknILB.js

js snew.ai collected 2026-10-05 15:07:56 UTC 3,329 bytes, 1 lines download raw bytes

1import{r as s,j as t}from"./index-L9AYrVUw.js";import{c as b}from"./socialAdTextEngine-CXTvyP59.js";import{s as y}from"./socialAdComposedStyleResolver-Cgbeb0Cd.js";function C(){const[d,u]=s.useState(null),[l,g]=s.useState(null),[r,x]=s.useState("Sabor que explode na boca"),[i,h]=s.useState("Comprar agora"),[n,f]=s.useState("SNEW"),[a,m]=s.useState("#F04A2B"),[c,p]=s.useState(null);return s.useEffect(()=>{const e=document.createElement("canvas");e.width=1080,e.height=1080;const o=e.getContext("2d");o.fillStyle=a,o.fillRect(0,0,e.width,e.height),o.fillStyle="rgba(0,0,0,0.28)",o.beginPath(),o.ellipse(540,900,260,70,0,0,Math.PI*2),o.fill(),o.fillStyle="#ffffff",o.beginPath(),o.roundRect(400,500,280,380,40),o.fill(),o.fillStyle=a,o.fillRect(430,560,220,60),u(e.toDataURL("image/png"))},[a]),s.useEffect(()=>{d&&(p(null),b({baseImageUrl:d,textZone:y("top"),copy:{heading:r,cta:i,brand:n},brandPersonality:null}).then(e=>g({url:e.url,presetId:e.presetId,usedTarja:e.usedTarja,textColor:e.textColor,tarjaColor:e.tarjaColor})).catch(e=>p(String((e==null?void 0:e.message)??e))))},[d,r,i,n]),t.jsxs("div",{style:{padding:32,minHeight:"100vh",background:"#F2F2F2",fontFamily:"Inter, sans-serif"},children:[t.jsx("h1",{style:{fontSize:20,fontWeight:600,marginBottom:4},children:"Social Ad Composed — preview do motor de texto"}),t.jsx("p",{style:{fontSize:13,color:"#666",marginBottom:24},children:"Base sintética (fundo chapado + silhueta na parte inferior) → motor de layout compõe heading, CTA e brand na text zone reservada (top)."}),t.jsxs("div",{style:{display:"flex",gap:12,marginBottom:20,flexWrap:"wrap"},children:[t.jsxs("label",{style:{fontSize:12},children:["Heading",t.jsx("input",{value:r,onChange:e=>x(e.target.value),style:{display:"block",padding:6,border:"1px solid #ddd",borderRadius:6,width:260}})]}),t.jsxs("label",{style:{fontSize:12},children:["CTA",t.jsx("input",{value:i,onChange:e=>h(e.target.value),style:{display:"block",padding:6,border:"1px solid #ddd",borderRadius:6,width:160}})]}),t.jsxs("label",{style:{fontSize:12},children:["Brand",t.jsx("input",{value:n,onChange:e=>f(e.target.value),style:{display:"block",padding:6,border:"1px solid #ddd",borderRadius:6,width:160}})]}),t.jsxs("label",{style:{fontSize:12},children:["BG",t.jsx("input",{value:a,onChange:e=>m(e.target.value),style:{display:"block",padding:6,border:"1px solid #ddd",borderRadius:6,width:120}})]})]}),t.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:24,maxWidth:1100},children:[t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:12,color:"#666",marginBottom:8},children:"Base gerada (sem texto)"}),d&&t.jsx("img",{src:d,alt:"base",style:{width:"100%",borderRadius:12,border:"1px solid #ddd"}})]}),t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:12,color:"#666",marginBottom:8},children:"Após motor de texto"}),l?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:l.url,alt:"composed","data-testid":"composed-image",style:{width:"100%",borderRadius:12,border:"1px solid #ddd"}}),t.jsx("pre",{style:{fontSize:11,color:"#333",background:"#fff",padding:10,borderRadius:8,marginTop:10},children:JSON.stringify(l,(e,o)=>e==="url"?"<data-url>":o,2)})]}):c?t.jsxs("div",{style:{color:"#c00"},children:["Erro: ",c]}):t.jsx("div",{style:{color:"#999"},children:"Compondo…"})]})]})]})}export{C as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.