@cmmd-center/forge 0.13.108 → 0.13.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ import{fn as e,on as t}from"./CompositeItem-DYaCFJOM.js";var n=t(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),r=t(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),i=t(`chevrons-down`,[[`path`,{d:`m7 6 5 5 5-5`,key:`1lc07p`}],[`path`,{d:`m7 13 5 5 5-5`,key:`1d48rs`}]]),a=t(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),o=t(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),s=t(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),c=t(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),l=t(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),u=t(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),d=t(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),f=t(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),p=t(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),m=t(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),h=t(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),g=t(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),_={primaryColor:`#6366f1`,secondaryColor:`#8b5cf6`,accentColor:`#f59e0b`,backgroundColor:`#ffffff`,textColor:`#1f2937`,fontFamily:`Inter, sans-serif`,headingFontFamily:`Inter, sans-serif`},v={bold:{bg:`#1f2937`,accent:`#f59e0b`,text:`#ffffff`},minimal:{bg:`#ffffff`,accent:`#6366f1`,text:`#1f2937`},gradient:{bg:`#4f46e5`,accent:`#818cf8`,text:`#ffffff`},split:{bg:`#f8fafc`,accent:`#0ea5e9`,text:`#0f172a`},centered:{bg:`#fef3c7`,accent:`#d97706`,text:`#78350f`}},y=[`bold`,`minimal`,`gradient`,`split`,`centered`];function b(e){let t=e.toLowerCase();return t.includes(`bold`)||t.includes(`sale`)||t.includes(`announcement`)?`bold`:t.includes(`minimal`)||t.includes(`clean`)||t.includes(`simple`)?`minimal`:t.includes(`gradient`)||t.includes(`modern`)||t.includes(`tech`)?`gradient`:t.includes(`split`)||t.includes(`compare`)||t.includes(`versus`)?`split`:t.includes(`warm`)||t.includes(`friendly`)||t.includes(`welcome`)?`centered`:y[Math.floor(Math.random()*y.length)]??`bold`}function x(e){let t=e.replace(/^(create|make|design|generate)\s+(a|an|me)?\s*/i,``).replace(/\s*(instagram|facebook|twitter|linkedin|youtube|social media|post|story|banner|cover|thumbnail)\s*/gi,``).replace(/\s*(about|for|with|featuring)\s*/i,`|`).trim().split(`|`).map(e=>e.trim()).filter(Boolean),n=t[0]??``;if(t.length>=2)return{heading:S(n),subtext:S(t.slice(1).join(` `))};if(n.length>30){let e=n.split(` `),t=Math.ceil(e.length/2);return{heading:S(e.slice(0,t).join(` `)),subtext:S(e.slice(t).join(` `))}}return{heading:n?S(n):`Your Title Here`,subtext:`Add your message`}}function S(e){return e.charAt(0).toUpperCase()+e.slice(1)}function C(e,t,n,r=_){let i=b(e),a=v[i],{heading:o,subtext:s}=x(e),c=t>n;Math.abs(t-n);let l=[];switch(l.push({type:`rect`,left:0,top:0,width:t,height:n,fill:a.bg,selectable:!1,customId:`__bg__`,customName:`Background`}),i){case`bold`:l.push(...w(t,n,a,o,s,r));break;case`minimal`:l.push(...T(t,n,a,o,s,r));break;case`gradient`:l.push(...E(t,n,a,o,s,r));break;case`split`:l.push(...D(t,n,a,o,s,c,r));break;case`centered`:l.push(...O(t,n,a,o,s,r))}return{objects:l}}function w(e,t,n,r,i,a){let o=Math.min(e,t)*.08,s=Math.min(e,t)*.1,c=s*.4;return[{type:`rect`,left:0,top:0,width:e,height:t*.06,fill:n.accent,customName:`Accent Bar`},{type:`textbox`,left:o,top:t*.3,width:e-o*2,text:r.toUpperCase(),fontSize:s,fontFamily:a.headingFontFamily,fontWeight:`900`,fill:n.text,textAlign:`left`,customName:`Heading`},{type:`textbox`,left:o,top:t*.55,width:e-o*2,text:i,fontSize:c,fontFamily:a.fontFamily,fontWeight:`400`,fill:n.accent,textAlign:`left`,customName:`Subtext`},{type:`rect`,left:o,top:t*.85,width:e*.3,height:4,fill:n.accent,customName:`Accent Line`}]}function T(e,t,n,r,i,a){let o=Math.min(e,t)*.08,s=o*.45;return[{type:`rect`,left:e*.04,top:t*.04,width:e*.92,height:t*.92,fill:`transparent`,stroke:n.accent,strokeWidth:2,customName:`Frame`},{type:`textbox`,left:e*.1,top:t*.35,width:e*.8,text:r,fontSize:o,fontFamily:a.headingFontFamily,fontWeight:`600`,fill:n.text,textAlign:`center`,customName:`Heading`},{type:`rect`,left:e*.4,top:t*.52,width:e*.2,height:2,fill:n.accent,customName:`Divider`},{type:`textbox`,left:e*.15,top:t*.58,width:e*.7,text:i,fontSize:s,fontFamily:a.fontFamily,fontWeight:`400`,fill:`#6b7280`,textAlign:`center`,customName:`Subtext`}]}function E(e,t,n,r,i,a){let o=Math.min(e,t)*.09,s=o*.4;return[{type:`rect`,left:0,top:t*.6,width:e,height:t*.4,fill:`rgba(0,0,0,0.3)`,customName:`Overlay`},{type:`ellipse`,left:e*.7,top:-t*.15,rx:e*.25,ry:e*.25,fill:n.accent,opacity:.3,customName:`Deco Circle`},{type:`textbox`,left:e*.08,top:t*.35,width:e*.84,text:r,fontSize:o,fontFamily:a.headingFontFamily,fontWeight:`700`,fill:n.text,textAlign:`center`,customName:`Heading`},{type:`textbox`,left:e*.12,top:t*.65,width:e*.76,text:i,fontSize:s,fontFamily:a.fontFamily,fontWeight:`400`,fill:`rgba(255,255,255,0.85)`,textAlign:`center`,customName:`Subtext`}]}function D(e,t,n,r,i,a,o){let s=Math.min(e,t)*.08,c=s*.45;return a?[{type:`rect`,left:0,top:0,width:e*.45,height:t,fill:n.accent,customName:`Color Panel`},{type:`textbox`,left:e*.52,top:t*.3,width:e*.42,text:r,fontSize:s,fontFamily:o.headingFontFamily,fontWeight:`700`,fill:n.text,textAlign:`left`,customName:`Heading`},{type:`textbox`,left:e*.52,top:t*.55,width:e*.42,text:i,fontSize:c,fontFamily:o.fontFamily,fontWeight:`400`,fill:`#64748b`,textAlign:`left`,customName:`Subtext`}]:[{type:`rect`,left:0,top:0,width:e,height:t*.45,fill:n.accent,customName:`Color Panel`},{type:`textbox`,left:e*.08,top:t*.52,width:e*.84,text:r,fontSize:s,fontFamily:o.headingFontFamily,fontWeight:`700`,fill:n.text,textAlign:`center`,customName:`Heading`},{type:`textbox`,left:e*.12,top:t*.72,width:e*.76,text:i,fontSize:c,fontFamily:o.fontFamily,fontWeight:`400`,fill:`#64748b`,textAlign:`center`,customName:`Subtext`}]}function O(e,t,n,r,i,a){let o=Math.min(e,t)*.09,s=o*.4;return[{type:`rect`,left:e*.1,top:t*.15,width:e*.8,height:t*.7,fill:`rgba(255,255,255,0.7)`,rx:20,ry:20,customName:`Card`},{type:`textbox`,left:e*.15,top:t*.3,width:e*.7,text:r,fontSize:o,fontFamily:a.headingFontFamily,fontWeight:`700`,fill:n.text,textAlign:`center`,customName:`Heading`},{type:`textbox`,left:e*.18,top:t*.55,width:e*.64,text:i,fontSize:s,fontFamily:a.fontFamily,fontWeight:`400`,fill:n.text,textAlign:`center`,opacity:.7,customName:`Subtext`},{type:`rect`,left:e*.3,top:t*.72,width:e*.4,height:Math.min(e,t)*.07,fill:n.accent,rx:8,ry:8,customName:`CTA Button`},{type:`textbox`,left:e*.3,top:t*.725,width:e*.4,text:`Learn More`,fontSize:s*.9,fontFamily:a.fontFamily,fontWeight:`600`,fill:`#ffffff`,textAlign:`center`,customName:`CTA Text`}]}var k=[{id:`ig-post-bold`,name:`Bold Announcement`,category:`social`,presetId:`instagram-post`,style:`bold`,description:`High-impact Instagram post with bold typography`,previewPrompt:`New Product Launch`},{id:`ig-post-minimal`,name:`Clean & Minimal`,category:`social`,presetId:`instagram-post`,style:`minimal`,description:`Minimalist Instagram post with elegant framing`,previewPrompt:`Mindful Living`},{id:`ig-story-gradient`,name:`Gradient Story`,category:`social`,presetId:`instagram-story`,style:`gradient`,description:`Modern gradient Instagram story`,previewPrompt:`Summer Vibes`},{id:`fb-cover-split`,name:`Split Cover`,category:`social`,presetId:`facebook-cover`,style:`split`,description:`Two-tone Facebook cover photo`,previewPrompt:`Welcome to Our Community`},{id:`linkedin-minimal`,name:`Professional Banner`,category:`business`,presetId:`linkedin-banner`,style:`minimal`,description:`Clean LinkedIn banner for professionals`,previewPrompt:`Innovation & Strategy`},{id:`twitter-bold`,name:`Tweet Graphic`,category:`social`,presetId:`twitter-post`,style:`bold`,description:`Eye-catching Twitter/X post graphic`,previewPrompt:`Breaking News`},{id:`yt-gradient`,name:`YouTube Thumbnail`,category:`social`,presetId:`youtube-thumbnail`,style:`gradient`,description:`Vibrant YouTube thumbnail`,previewPrompt:`Top 10 Tips`},{id:`presentation-centered`,name:`Title Slide`,category:`presentation`,presetId:`presentation`,style:`centered`,description:`Warm presentation title slide`,previewPrompt:`Quarterly Review`},{id:`bcard-minimal`,name:`Business Card`,category:`business`,presetId:`business-card`,style:`minimal`,description:`Elegant business card layout`,previewPrompt:`Jane Smith | Designer`},{id:`invoice-split`,name:`Invoice Header`,category:`business`,presetId:`invoice`,style:`split`,description:`Professional invoice header layout`,previewPrompt:`Invoice #1234`},{id:`sale-bold`,name:`Flash Sale`,category:`marketing`,presetId:`instagram-post`,style:`bold`,description:`High-energy sale promotion post`,previewPrompt:`50% Off Everything`},{id:`launch-gradient`,name:`Product Launch`,category:`marketing`,presetId:`instagram-post`,style:`gradient`,description:`Modern product launch announcement`,previewPrompt:`Introducing Our New Product`}];function A(){let e=new Map;for(let t of k){let n=e.get(t.category)??[];n.push(t),e.set(t.category,n)}return e}var j=`forge:canvas-state:v1`;function M(){if(typeof window>`u`)return{};try{let e=localStorage.getItem(j);if(!e)return{};let t=JSON.parse(e),n={savedDesigns:t.savedDesigns??{},artboardPresetId:t.artboardPresetId??null,activeTool:t.activeTool??`select`};return t.brandKit&&(n.brandKit=t.brandKit),n}catch{return{}}}function N(e){if(!(typeof window>`u`))try{let t={savedDesigns:e.savedDesigns,artboardPresetId:e.artboardPresetId,activeTool:e.activeTool,brandKit:e.brandKit};localStorage.setItem(j,JSON.stringify(t))}catch{}}var P=M(),F={activeTool:P.activeTool??`select`,artboardPresetId:P.artboardPresetId??`instagram-post`,artboardWidth:1080,artboardHeight:1080,selectedObjectIds:[],selectedObjectProperties:null,propertiesPanelOpen:!1,historyStack:[],historyIndex:-1,layers:[],zoomLevel:1,savedDesigns:P.savedDesigns??{},brandKit:P.brandKit??_,pendingGeneratePrompt:null},I=e()((e,t)=>({...F,setActiveTool:n=>{e({activeTool:n}),N(t())},setArtboard:(n,r,i)=>{e({artboardPresetId:n,artboardWidth:r,artboardHeight:i}),N(t())},setSelectedObjects:(t,n)=>{e({selectedObjectIds:t,selectedObjectProperties:n,propertiesPanelOpen:t.length>0})},clearSelection:()=>{e({selectedObjectIds:[],selectedObjectProperties:null})},setPropertiesPanelOpen:t=>{e({propertiesPanelOpen:t})},pushHistorySnapshot:t=>{e(e=>{let n=[...e.historyStack.slice(0,e.historyIndex+1),t].slice(-50);return{historyStack:n,historyIndex:n.length-1}})},undo:()=>{let n=t();if(n.historyIndex<=0)return null;let r=n.historyIndex-1;return e({historyIndex:r}),n.historyStack[r]??null},redo:()=>{let n=t();if(n.historyIndex>=n.historyStack.length-1)return null;let r=n.historyIndex+1;return e({historyIndex:r}),n.historyStack[r]??null},setLayers:t=>{e({layers:t})},setZoomLevel:t=>{e({zoomLevel:t})},saveDesign:(n,r,i)=>{e(e=>({savedDesigns:{...e.savedDesigns,[n]:{json:i,name:r,updatedAt:new Date().toISOString()}}})),N(t())},loadDesign:e=>t().savedDesigns[e]?.json??null,deleteDesign:n=>{e(e=>{let{[n]:t,...r}=e.savedDesigns;return{savedDesigns:r}}),N(t())},resetHistory:()=>{e({historyStack:[],historyIndex:-1})},setBrandKit:n=>{e({brandKit:n}),N(t())},updateBrandKit:n=>{e(e=>({brandKit:{...e.brandKit,...n}})),N(t())},requestCanvasGenerate:t=>{e({pendingGeneratePrompt:t})},consumePendingGenerate:()=>{let n=t().pendingGeneratePrompt;return n&&e({pendingGeneratePrompt:null}),n}}));export{a as _,A as a,n as b,m as c,d,u as f,o as g,s as h,C as i,p as l,c as m,k as n,g as o,l as p,_ as r,h as s,I as t,f as u,i as v,r as y};
2
+ //# sourceMappingURL=canvasStateStore-CGGNH2My.js.map