solfaces 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +518 -0
- package/dist/agent/index.cjs +51 -0
- package/dist/agent/index.cjs.map +1 -0
- package/dist/agent/index.d.cts +65 -0
- package/dist/agent/index.d.ts +65 -0
- package/dist/agent/index.js +6 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/mcp-server.cjs +836 -0
- package/dist/chunk-2DIKGLXZ.cjs +126 -0
- package/dist/chunk-2DIKGLXZ.cjs.map +1 -0
- package/dist/chunk-A6N3RPEA.cjs +111 -0
- package/dist/chunk-A6N3RPEA.cjs.map +1 -0
- package/dist/chunk-CVFO7YHY.cjs +97 -0
- package/dist/chunk-CVFO7YHY.cjs.map +1 -0
- package/dist/chunk-H3SK3MNX.cjs +409 -0
- package/dist/chunk-H3SK3MNX.cjs.map +1 -0
- package/dist/chunk-KSGFMW33.js +401 -0
- package/dist/chunk-KSGFMW33.js.map +1 -0
- package/dist/chunk-LQWJRHGC.js +86 -0
- package/dist/chunk-LQWJRHGC.js.map +1 -0
- package/dist/chunk-RX6D5FGH.js +211 -0
- package/dist/chunk-RX6D5FGH.js.map +1 -0
- package/dist/chunk-SNJABBAT.js +107 -0
- package/dist/chunk-SNJABBAT.js.map +1 -0
- package/dist/chunk-VMNATBH3.cjs +222 -0
- package/dist/chunk-VMNATBH3.cjs.map +1 -0
- package/dist/chunk-WURY4QGH.js +117 -0
- package/dist/chunk-WURY4QGH.js.map +1 -0
- package/dist/core/index.cjs +82 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +104 -0
- package/dist/core/index.d.ts +104 -0
- package/dist/core/index.js +5 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index.cjs +100 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/react/index.cjs +543 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +28 -0
- package/dist/react/index.d.ts +28 -0
- package/dist/react/index.js +541 -0
- package/dist/react/index.js.map +1 -0
- package/dist/solfaces.cdn.global.js +3 -0
- package/dist/solfaces.cdn.global.js.map +1 -0
- package/dist/themes/index.cjs +48 -0
- package/dist/themes/index.cjs.map +1 -0
- package/dist/themes/index.d.cts +14 -0
- package/dist/themes/index.d.ts +14 -0
- package/dist/themes/index.js +3 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/traits-DAFZnXeS.d.cts +61 -0
- package/dist/traits-DAFZnXeS.d.ts +61 -0
- package/dist/vanilla/index.cjs +43 -0
- package/dist/vanilla/index.cjs.map +1 -0
- package/dist/vanilla/index.d.cts +7 -0
- package/dist/vanilla/index.d.ts +7 -0
- package/dist/vanilla/index.js +39 -0
- package/dist/vanilla/index.js.map +1 -0
- package/package.json +100 -0
- package/python/solfaces.py +475 -0
- package/skill.md +463 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";var SolFaces=(()=>{var R=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var he=Object.prototype.hasOwnProperty;var de=(r,e)=>{for(var o in e)R(r,o,{get:e[o],enumerable:!0})},ue=(r,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ye(e))!he.call(r,n)&&n!==o&&R(r,n,{get:()=>e[n],enumerable:!(t=le(e,n))||t.enumerable});return r};var fe=r=>ue(R({},"__esModule",{value:!0}),r);var Ue={};de(Ue,{default:()=>ze});var Y=["#ffd5b0","#f4c794","#e0a370","#c68642","#8d5524","#4a2c17"],Q=["#3d2b1f","#4a80c4","#5a9a5a","#c89430","#8a8a8a"],G=["#1a1a1a","#6b3a2a","#d4a844","#c44a20","#c8e64a","#6090e0","#14F195","#e040c0"],P=["#c8e64a","#6090e0","#14F195","#e8dcc8","#f85149"];function j(r){let e=5381;for(let o=0;o<r.length;o++)e=(e<<5)+e+r.charCodeAt(o)|0;return e>>>0}function $e(r){let e=r|0;return()=>{e=e+1831565813|0;let o=Math.imul(e^e>>>15,1|e);return o=o+Math.imul(o^o>>>7,61|o)^o,((o^o>>>14)>>>0)/4294967296}}function d(r,e){let o=j(r),t=$e(o),n={faceShape:Math.floor(t()*4),skinColor:Math.floor(t()*6),eyeStyle:Math.floor(t()*8),eyeColor:Math.floor(t()*5),eyebrows:Math.floor(t()*5),nose:Math.floor(t()*4),mouth:Math.floor(t()*6),hairStyle:Math.floor(t()*8),hairColor:Math.floor(t()*8),accessory:Math.floor(t()*6),bgColor:Math.floor(t()*5)};return e?{...n,...e}:n}var ge=["Round","Square","Oval","Hexagon"],pe=["Light Peach","Warm Tan","Golden Brown","Medium Brown","Deep Brown","Rich Dark Brown"],me=["Round","Dots","Almond","Wide","Sleepy","Winking","Lashes","Narrow"],be=["Dark Brown","Blue","Green","Amber","Gray"],xe=["None","Thin","Thick","Arched","Angled"],Se=["None","Dot","Triangle","Button"],ke=["Smile","Neutral","Grin","Open","Smirk","Wide Smile"],Ce=["Bald","Short","Spiky","Swept","Mohawk","Long","Bob","Buzz"],we=["Black","Brown","Blonde","Ginger","Neon Lime","Neon Blue","Solana Mint","Neon Magenta"],Te=["None","None","Round Glasses","Square Glasses","Earring","Bandana"],Le=["Lime","Blue","Mint","Sand","Red"];function q(r){return{faceShape:ge[r.faceShape]??"Round",skinColor:pe[r.skinColor]??"Warm Tan",eyeStyle:me[r.eyeStyle]??"Round",eyeColor:be[r.eyeColor]??"Dark Brown",eyebrows:xe[r.eyebrows]??"None",nose:Se[r.nose]??"None",mouth:ke[r.mouth]??"Smile",hairStyle:Ce[r.hairStyle]??"Bald",hairColor:we[r.hairColor]??"Black",accessory:Te[r.accessory]??"None",bgColor:Le[r.bgColor]??"Lime"}}function z(r){return(j(r)>>>0).toString(16).padStart(8,"0")}function U(r,e){if(!(!r||!e))return e[r]}function Re(r,e){return r.faceShape===0?`<circle cx="32" cy="34" r="20" fill="${e}"/>`:r.faceShape===1?`<rect x="12" y="14" width="40" height="40" rx="8" ry="8" fill="${e}"/>`:r.faceShape===2?`<ellipse cx="32" cy="34" rx="18" ry="22" fill="${e}"/>`:r.faceShape===3?`<path d="M32 12 L50 24 L50 44 L32 56 L14 44 L14 24 Z" fill="${e}" stroke-linejoin="round"/>`:`<circle cx="32" cy="34" r="20" fill="${e}"/>`}function Ee(r,e,o="white"){switch(r.eyeStyle){case 0:return`<circle cx="24" cy="30" r="3.5" fill="${o}"/><circle cx="25" cy="30" r="2" fill="${e}"/><circle cx="40" cy="30" r="3.5" fill="${o}"/><circle cx="41" cy="30" r="2" fill="${e}"/>`;case 1:return`<circle cx="24" cy="30" r="2" fill="${e}"/><circle cx="40" cy="30" r="2" fill="${e}"/>`;case 2:return`<ellipse cx="24" cy="30" rx="4" ry="2.5" fill="${o}"/><circle cx="${24+.5}" cy="30" r="1.5" fill="${e}"/><ellipse cx="40" cy="30" rx="4" ry="2.5" fill="${o}"/><circle cx="${40+.5}" cy="30" r="1.5" fill="${e}"/>`;case 3:return`<circle cx="24" cy="30" r="4.5" fill="${o}"/><circle cx="24" cy="${30+.5}" r="2.5" fill="${e}"/><circle cx="40" cy="30" r="4.5" fill="${o}"/><circle cx="40" cy="${30+.5}" r="2.5" fill="${e}"/>`;case 4:return`<ellipse cx="24" cy="31" rx="3.5" ry="2" fill="${o}"/><circle cx="24" cy="31" r="1.5" fill="${e}"/><line x1="20" y1="${30-.5}" x2="28" y2="${30-.5}" stroke="${e}" stroke-width="1" stroke-linecap="round"/><ellipse cx="40" cy="31" rx="3.5" ry="2" fill="${o}"/><circle cx="40" cy="31" r="1.5" fill="${e}"/><line x1="36" y1="${30-.5}" x2="44" y2="${30-.5}" stroke="${e}" stroke-width="1" stroke-linecap="round"/>`;case 5:return`<path d="M21 30 Q24 33 27 30" fill="none" stroke="${e}" stroke-width="1.5" stroke-linecap="round"/><circle cx="40" cy="30" r="3.5" fill="${o}"/><circle cx="41" cy="30" r="2" fill="${e}"/>`;case 6:return`<circle cx="24" cy="30" r="3" fill="${o}"/><circle cx="${24+.5}" cy="30" r="1.5" fill="${e}"/><line x1="26" y1="27" x2="${24+3.5}" y2="${30-4.5}" stroke="${e}" stroke-width="0.8" stroke-linecap="round"/><line x1="27" y1="28" x2="${24+4.5}" y2="27" stroke="${e}" stroke-width="0.8" stroke-linecap="round"/><circle cx="40" cy="30" r="3" fill="${o}"/><circle cx="${40+.5}" cy="30" r="1.5" fill="${e}"/><line x1="42" y1="27" x2="${40+3.5}" y2="${30-4.5}" stroke="${e}" stroke-width="0.8" stroke-linecap="round"/><line x1="43" y1="28" x2="${40+4.5}" y2="27" stroke="${e}" stroke-width="0.8" stroke-linecap="round"/>`;case 7:return`<ellipse cx="24" cy="30" rx="4" ry="1.2" fill="${o}"/><ellipse cx="${24+.5}" cy="30" rx="2" ry="1" fill="${e}"/><ellipse cx="40" cy="30" rx="4" ry="1.2" fill="${o}"/><ellipse cx="${40+.5}" cy="30" rx="2" ry="1" fill="${e}"/>`;default:return`<circle cx="24" cy="30" r="3" fill="${o}"/><circle cx="25" cy="30" r="2" fill="${e}"/><circle cx="40" cy="30" r="3" fill="${o}"/><circle cx="41" cy="30" r="2" fill="${e}"/>`}}function Fe(r,e="#2a2020"){switch(r.eyebrows){case 0:return"";case 1:return`<line x1="21" y1="25" x2="27" y2="25" stroke="${e}" stroke-width="0.8" stroke-linecap="round"/><line x1="37" y1="25" x2="43" y2="25" stroke="${e}" stroke-width="0.8" stroke-linecap="round"/>`;case 2:return`<line x1="${24-3.5}" y1="25" x2="${24+3.5}" y2="25" stroke="${e}" stroke-width="2" stroke-linecap="round"/><line x1="${40-3.5}" y1="25" x2="${40+3.5}" y2="25" stroke="${e}" stroke-width="2" stroke-linecap="round"/>`;case 3:return`<path d="M${24-3.5} 26 Q24 23 ${24+3.5} 26" fill="none" stroke="${e}" stroke-width="1" stroke-linecap="round"/><path d="M${40-3.5} 26 Q40 23 ${40+3.5} 26" fill="none" stroke="${e}" stroke-width="1" stroke-linecap="round"/>`;case 4:return`<line x1="21" y1="24" x2="27" y2="26" stroke="${e}" stroke-width="1.2" stroke-linecap="round"/><line x1="37" y1="26" x2="43" y2="24" stroke="${e}" stroke-width="1.2" stroke-linecap="round"/>`;default:return""}}function Oe(r,e,o){let i=o??e+"aa";switch(r.nose){case 0:return"";case 1:return`<circle cx="32" cy="36" r="1.5" fill="${i}"/>`;case 2:return`<path d="M32 ${36-1.5} L${32+2.5} 38 L${32-2.5} 38 Z" fill="${i}"/>`;case 3:return`<circle cx="${32-1.5}" cy="36" r="1" fill="${i}"/><circle cx="${32+1.5}" cy="36" r="1" fill="${i}"/>`;default:return""}}function Be(r,e="#c05050",o="white"){switch(r.mouth){case 0:return`<path d="M28 42 Q32 46 36 42" fill="none" stroke="${e}" stroke-width="1.2" stroke-linecap="round"/>`;case 1:return`<line x1="29" y1="43" x2="35" y2="43" stroke="${e}" stroke-width="1.2" stroke-linecap="round"/>`;case 2:return`<path d="M26 42 Q32 47 38 42" fill="none" stroke="${e}" stroke-width="1.5" stroke-linecap="round"/>`;case 3:return`<ellipse cx="32" cy="43" rx="3" ry="2.5" fill="${e}" opacity="0.8"/>`;case 4:return`<path d="M28 43 Q31 43 36 41" fill="none" stroke="${e}" stroke-width="1.2" stroke-linecap="round"/>`;case 5:return`<path d="M26 42 Q32 48 38 42" fill="${o}" stroke="${e}" stroke-width="1"/>`;default:return`<path d="M28 42 Q32 46 36 42" fill="none" stroke="${e}" stroke-width="1.2" stroke-linecap="round"/>`}}function Me(r,e){switch(r.hairStyle){case 0:return"";case 1:return`<rect x="14" y="12" width="36" height="12" rx="6" ry="6" fill="${e}"/>`;case 2:return`<g fill="${e}"><rect x="14" y="16" width="36" height="8" rx="2"/><polygon points="18,16 22,6 26,16"/><polygon points="26,16 30,4 34,16"/><polygon points="34,16 38,6 42,16"/><polygon points="42,16 46,10 48,16"/></g>`;case 3:return`<g fill="${e}"><rect x="14" y="14" width="36" height="10" rx="4"/><path d="M14 18 Q8 14 10 8 Q14 10 20 14 Z"/></g>`;case 4:return`<rect x="26" y="4" width="12" height="20" rx="4" ry="2" fill="${e}"/>`;case 5:return`<g fill="${e}"><rect x="14" y="12" width="36" height="10" rx="4"/><rect x="10" y="18" width="8" height="24" rx="3"/><rect x="46" y="18" width="8" height="24" rx="3"/></g>`;case 6:return`<path d="M12 22 Q12 10 32 10 Q52 10 52 22 L52 38 Q52 42 48 42 L48 26 Q48 16 32 16 Q16 16 16 26 L16 42 Q12 42 12 38 Z" fill="${e}"/>`;case 7:return`<rect x="15" y="13" width="34" height="9" rx="8" ry="4" fill="${e}" opacity="0.7"/>`;default:return""}}function _e(r,e="#444"){return r.accessory<=1?"":r.accessory===2?`<g fill="none" stroke="${e}" stroke-width="1"><circle cx="24" cy="30" r="5"/><circle cx="40" cy="30" r="5"/><line x1="29" y1="30" x2="35" y2="30"/><line x1="19" y1="30" x2="14" y2="28"/><line x1="45" y1="30" x2="50" y2="28"/></g>`:r.accessory===3?`<g fill="none" stroke="${e}" stroke-width="1"><rect x="19" y="26" width="10" height="8" rx="1"/><rect x="35" y="26" width="10" height="8" rx="1"/><line x1="29" y1="30" x2="35" y2="30"/><line x1="19" y1="30" x2="14" y2="28"/><line x1="45" y1="30" x2="50" y2="28"/></g>`:r.accessory===4?`<circle cx="11" cy="36" r="2" fill="${e}" stroke="${e}" stroke-width="0.5"/>`:r.accessory===5?`<g><rect x="12" y="20" width="40" height="4" rx="1" fill="${e}"/><path d="M12 22 L8 26 L12 24 Z" fill="${e}"/></g>`:""}function p(r,e){let{size:o=64,theme:t,traitOverrides:n,enableBlink:i,className:c,colorOverrides:s}=e??{},l=d(r,n),b=t?.skinColors??Y,x=t?.eyeColors??Q,u=t?.hairColors??G,h=t?.bgColors??P,f=s?.skin??b[l.skinColor%b.length],y=s?.eyes??x[l.eyeColor%x.length],S=s?.hair??u[l.hairColor%u.length],k=s?.bg??h[l.bgColor%h.length],T=t?.bgOpacity??.15,C=t?.bgRadius??4,$=s?.mouth??t?.mouthColor??"#c05050",te=s?.eyebrow??t?.eyebrowColor??"#2a2020",ne=s?.accessory??t?.accessoryColor??"#444",D=s?.eyeWhite??t?.eyeWhiteColor??"white",ie=s?.nose??t?.noseColor,se=c?` class="${c}"`:"",a=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="${o}" height="${o}"${se}>`;a+=`<rect x="0" y="0" width="64" height="64" fill="${k}" opacity="${T}" rx="${C}"/>`;let L=!!i,ae=typeof i=="object"?i.duration??4:4,W=typeof i=="object"?i.delay??0:0;if(L){let g=`sf-${r.slice(0,8)}`,ce=W?` ${W}s`:"";a+=`<style>@keyframes ${g}-blink{0%,90%,100%{transform:scaleY(1)}95%{transform:scaleY(0.1)}}.${g}-eyes{animation:${g}-blink ${ae}s ease-in-out${ce} infinite;transform-origin:32px 30px}</style>`}if(a+=Me(l,S),a+=Re(l,f),L){let g=`sf-${r.slice(0,8)}`;a+=`<g class="${g}-eyes">`}return a+=Ee(l,y,D),L&&(a+="</g>"),a+=Fe(l,te),a+=Oe(l,f,ie),a+=Be(l,$,D),a+=_e(l,ne),t?.border&&(a+=`<rect x="0" y="0" width="64" height="64" fill="none" stroke="${t.border.color}" stroke-width="${t.border.width}" rx="${C}"/>`),a+="</svg>",a}function E(r,e){let o=p(r,e);return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(o)}`}function Z(r,e){let o=p(r,e);return`data:image/svg+xml;base64,${btoa(o)}`}var F={0:"round",1:"square with softly rounded corners",2:"oval",3:"angular, hexagonal"},O={0:"light peach",1:"warm tan",2:"golden brown",3:"medium brown",4:"deep brown",5:"rich dark brown"},B={0:"round, wide-open",1:"small and dot-like",2:"almond-shaped",3:"wide and expressive",4:"sleepy, half-lidded",5:"playfully winking",6:"adorned with lashes",7:"narrow and observant"},M={0:"dark brown",1:"blue",2:"green",3:"amber",4:"gray"},K={0:"",1:"thin",2:"thick, prominent",3:"elegantly arched",4:"sharply angled"},V={0:"",1:"a small dot nose",2:"a triangular nose",3:"a button nose with visible nostrils"},_={0:"a gentle smile",1:"a neutral, straight expression",2:"a wide grin",3:"a small, open mouth",4:"a confident smirk",5:"a broad, toothy smile"},A={0:"bald, with no hair",1:"short, neatly cropped hair",2:"tall, spiky hair",3:"side-swept hair",4:"a bold mohawk",5:"long hair that falls past the shoulders",6:"a clean bob cut",7:"a close buzz cut"},v={0:"jet black",1:"brown",2:"blonde",3:"ginger red",4:"neon lime green",5:"neon blue",6:"Solana mint green",7:"neon magenta"},I={0:"",1:"",2:"round glasses",3:"square-framed glasses",4:"a gold earring",5:"a red bandana"},J={0:"lime green",1:"blue",2:"Solana mint green",3:"warm sand",4:"red"};function w(r,e){let o=d(r),{includeBackground:t=!0,format:n="paragraph",perspective:i="third",name:c}=e??{};return n==="structured"?ve(o,t):n==="compact"?Ie(o):Ae(o,i,c,t)}function Ae(r,e,o,t){let n=[],i=e==="first"?o?`I'm ${o}. I have`:"I have":o?`${o} has`:"This SolFace has",c=e==="first"?"have":"has",s=e==="first"?"my":"their",l=e==="first"?"I'm":"They're";n.push(`${i} a ${F[r.faceShape]??"round"} face with ${O[r.skinColor]??"warm"} skin`);let b=B[r.eyeStyle]??"round",x=M[r.eyeColor]??"dark";n.push(`${b} ${x} eyes`);let u=K[r.eyebrows];u&&n.push(`${u} eyebrows`);let h=A[r.hairStyle]??"",f=v[r.hairColor]??"";r.hairStyle===0?n.push("and is bald"):h.startsWith("a ")?n.push(`and a ${f} ${h.slice(2)}`):n.push(`and ${f} ${h}`);let y=n[0];n.length>2?y+=", "+n.slice(1,-1).join(", ")+", "+n[n.length-1]:n.length===2&&(y+=" and "+n[1]),y+=".";let S=V[r.nose];if(S){let $=e==="first"?"I have":(o??"They")+(o?" has":" have");y+=` ${$} ${S}.`}let k=I[r.accessory];k&&(y+=` ${l} wearing ${k}.`);let T=_[r.mouth]??"a smile",C=e==="first"?"I have":(o??"They")+(o?" has":" have");if(y+=` ${C} ${T}.`,t){let $=J[r.bgColor]??"colorful";y+=` The background is ${$}.`}return y}function ve(r,e){let o=[`Face: ${F[r.faceShape]??"round"}`,`Skin: ${O[r.skinColor]??"warm"}`,`Eyes: ${B[r.eyeStyle]??"round"}, ${M[r.eyeColor]??"dark"}`],t=K[r.eyebrows];t&&o.push(`Eyebrows: ${t}`);let n=V[r.nose];if(n&&o.push(`Nose: ${n.replace(/^a /,"")}`),o.push(`Mouth: ${_[r.mouth]??"smile"}`),r.hairStyle===0)o.push("Hair: bald");else{let c=A[r.hairStyle]??"",s=v[r.hairColor]??"";o.push(`Hair: ${s} ${c.startsWith("a ")?c.slice(2):c}`)}let i=I[r.accessory];return i&&o.push(`Accessory: ${i}`),e&&o.push(`Background: ${J[r.bgColor]??"colorful"}`),o.join(`
|
|
2
|
+
`)}function Ie(r){let e=[];if(e.push(`${F[r.faceShape]??"round"} face`),e.push(`${O[r.skinColor]??"warm"} skin`),e.push(`${M[r.eyeColor]??"dark"} ${B[r.eyeStyle]??"round"} eyes`),r.hairStyle===0)e.push("bald");else{let t=(A[r.hairStyle]??"hair").replace(/,.*/,""),n=v[r.hairColor]??"";e.push(`${n} ${t.startsWith("a ")?t.slice(2):t}`)}let o=I[r.accessory];return o&&e.push(o),e.push((_[r.mouth]??"smiling").replace(/^a /,"")),e.join(", ")}function H(r){return`SolFace avatar: ${w(r,{format:"compact",includeBackground:!1})}`}function X(r,e){let o=w(r,{perspective:"first",name:e,includeBackground:!1,format:"paragraph"});return`My visual identity is a SolFace avatar (ID: ${(He(r)>>>0).toString(16).padStart(8,"0")}) derived from my wallet address. ${o} This appearance is deterministic \u2014 anyone who looks up my wallet will see the same face.`}function He(r){let e=5381;for(let o=0;o<r.length;o++)e=(e<<5)+e+r.charCodeAt(o)|0;return e>>>0}var Ne={bgColors:["#14F195","#9945FF","#00C2FF","#FFD700","#FF6B6B"],bgOpacity:.2,bgRadius:4},De={bgColors:["#1a1b23","#2d1b69","#0a2463","#1b2838","#2a0a3a"],mouthColor:"#e06070",eyebrowColor:"#aaa",accessoryColor:"#888",eyeWhiteColor:"#e0e0e0",bgOpacity:1,bgRadius:4},We={bgColors:["#f0f4ff","#fff0f5","#f0fff0","#fffff0","#f5f0ff"],bgOpacity:1,bgRadius:8},Ye={skinColors:["#e0e0e0","#c0c0c0","#a0a0a0","#808080","#606060","#404040"],eyeColors:["#333","#555","#777","#999","#bbb"],hairColors:["#1a1a1a","#333","#555","#777","#999","#bbb","#ddd","#eee"],bgColors:["#f0f0f0","#e0e0e0","#d0d0d0","#c0c0c0","#b0b0b0"],mouthColor:"#666",eyebrowColor:"#555",accessoryColor:"#777",eyeWhiteColor:"#f0f0f0",bgOpacity:.3,bgRadius:4},Qe={bgColors:["#0d0d0d","#1a0a2e","#0a1628","#0d1a0d","#1a0a0a"],hairColors:["#ff00ff","#00ffff","#ff6600","#39ff14","#ff3366","#6600ff","#ffff00","#00ff99"],eyeColors:["#ff00ff","#00ffff","#39ff14","#ff6600","#ffff00"],mouthColor:"#ff3366",eyebrowColor:"#ccc",accessoryColor:"#00ffff",eyeWhiteColor:"#1a1a1a",bgOpacity:1,bgRadius:4,border:{color:"#39ff14",width:1}},Ge={bgColors:["#131b2e","#1b2540","#0f1926","#1e2d4a","#162033"],mouthColor:"#c7d4e8",eyebrowColor:"#8899aa",accessoryColor:"#6882a0",eyeWhiteColor:"#d0d8e8",bgOpacity:1,bgRadius:6,border:{color:"#3a5a8c",width:.5}},Pe={bgColors:["#1c0e30","#2a1548","#1e0f36","#251240","#20103a"],mouthColor:"#d4a0e8",eyebrowColor:"#9966cc",accessoryColor:"#ab8dd6",eyeWhiteColor:"#d8c8e8",bgOpacity:1,bgRadius:6,border:{color:"#ab8dd6",width:.5}},je={bgRadius:999},m={solana:Ne,dark:De,light:We,mono:Ye,neon:Qe,jupiter:Ge,phantom:Pe,circle:je};function ee(r,e){let o=m[r];return o?e?{...o,...e}:o:e??{}}function re(r,e,o){let t=typeof r=="string"?document.querySelector(r):r;return t?(t.innerHTML=p(e,o),()=>{t.innerHTML=""}):(console.warn(`[SolFaces] Element not found: ${r}`),()=>{})}function qe(r,e,o){let t=typeof r=="string"?document.querySelector(r):r;t&&(t.src=E(e,o),t.alt=H(e))}function N(r=document){r.querySelectorAll("[data-solface]").forEach(o=>{let t=o.getAttribute("data-solface");if(!t)return;let n=parseInt(o.getAttribute("data-solface-size")??"64",10),i=o.getAttribute("data-solface-blink")==="true",c=o.getAttribute("data-solface-theme"),s=c&&c in m?m[c]:void 0;re(o,t,{size:n,enableBlink:i,theme:s})})}var oe={generateTraits:d,getTraitLabels:q,traitHash:z,resolveTheme:U,renderSVG:p,renderDataURI:E,renderBase64:Z,describe:w,altText:H,agentPrompt:X,mount:re,setImg:qe,autoInit:N,themes:m,getTheme:ee};typeof window<"u"&&(window.SolFaces=oe);typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{document.querySelector("[data-solface]")&&N()}):document.querySelector("[data-solface]")&&N());var ze=oe;return fe(Ue);})();
|
|
3
|
+
//# sourceMappingURL=solfaces.cdn.global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cdn.ts","../src/core/traits.ts","../src/core/renderer.ts","../src/core/describe.ts","../src/themes/presets.ts"],"sourcesContent":["// ═══════════════════════════════════════════════════════════════\n// SOLFACES — CDN Bundle (IIFE / UMD)\n// Single <script> tag integration. No build step required.\n//\n// Usage:\n// <script src=\"https://unpkg.com/solfaces/dist/solfaces.cdn.js\"></script>\n// <div data-solface=\"7xKXq...\" data-solface-size=\"48\"></div>\n// <script>SolFaces.autoInit();</script>\n//\n// Or programmatic:\n// <script>\n// const svg = SolFaces.renderSVG(\"7xKXq...\", { size: 64 });\n// document.getElementById(\"avatar\").innerHTML = svg;\n// </script>\n// ═══════════════════════════════════════════════════════════════\n\nimport { generateTraits, getTraitLabels, traitHash, resolveTheme } from \"./core/traits\";\nimport { renderSolFaceSVG, renderSolFaceDataURI, renderSolFaceBase64 } from \"./core/renderer\";\nimport { describeAppearance, solFaceAltText, agentAppearancePrompt } from \"./core/describe\";\nimport { PRESET_THEMES, getPresetTheme } from \"./themes/presets\";\n\nimport type { SolFaceTheme, RenderOptions } from \"./core/traits\";\n\n// ─── DOM Helpers ─────────────────────────────────────────────\n\nfunction mountSolFace(\n element: HTMLElement | string,\n walletAddress: string,\n options?: RenderOptions\n): () => void {\n const el = typeof element === \"string\"\n ? document.querySelector<HTMLElement>(element)\n : element;\n\n if (!el) {\n console.warn(`[SolFaces] Element not found: ${element}`);\n return () => {};\n }\n\n el.innerHTML = renderSolFaceSVG(walletAddress, options);\n return () => { el.innerHTML = \"\"; };\n}\n\nfunction setSolFaceImg(\n img: HTMLImageElement | string,\n walletAddress: string,\n options?: RenderOptions\n): void {\n const el = typeof img === \"string\"\n ? document.querySelector<HTMLImageElement>(img)\n : img;\n\n if (!el) return;\n el.src = renderSolFaceDataURI(walletAddress, options);\n el.alt = solFaceAltText(walletAddress);\n}\n\nfunction autoInit(root: HTMLElement | Document = document): void {\n const elements = root.querySelectorAll<HTMLElement>(\"[data-solface]\");\n elements.forEach((el) => {\n const wallet = el.getAttribute(\"data-solface\");\n if (!wallet) return;\n\n const size = parseInt(el.getAttribute(\"data-solface-size\") ?? \"64\", 10);\n const blink = el.getAttribute(\"data-solface-blink\") === \"true\";\n const themeName = el.getAttribute(\"data-solface-theme\") as string | null;\n\n const theme = themeName && themeName in PRESET_THEMES\n ? PRESET_THEMES[themeName as keyof typeof PRESET_THEMES]\n : undefined;\n\n mountSolFace(el, wallet, { size, enableBlink: blink, theme });\n });\n}\n\n// ─── Global API ──────────────────────────────────────────────\n\nconst SolFaces = {\n // Core\n generateTraits,\n getTraitLabels,\n traitHash,\n resolveTheme,\n\n // Rendering\n renderSVG: renderSolFaceSVG,\n renderDataURI: renderSolFaceDataURI,\n renderBase64: renderSolFaceBase64,\n\n // AI / Description\n describe: describeAppearance,\n altText: solFaceAltText,\n agentPrompt: agentAppearancePrompt,\n\n // DOM\n mount: mountSolFace,\n setImg: setSolFaceImg,\n autoInit,\n\n // Themes\n themes: PRESET_THEMES,\n getTheme: getPresetTheme,\n};\n\n// Attach to window for <script> tag usage\nif (typeof window !== \"undefined\") {\n (window as any).SolFaces = SolFaces;\n}\n\n// Auto-initialize on DOMContentLoaded if data-solface elements exist\nif (typeof document !== \"undefined\") {\n if (document.readyState === \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", () => {\n if (document.querySelector(\"[data-solface]\")) {\n autoInit();\n }\n });\n } else {\n // DOM already ready\n if (document.querySelector(\"[data-solface]\")) {\n autoInit();\n }\n }\n}\n\nexport default SolFaces;\n","// ═══════════════════════════════════════════════════\n// SOLFACES — Deterministic avatar trait engine\n// ═══════════════════════════════════════════════════\n\n// ─── Types ────────────────────────────────────────\n\nexport interface SolFaceTraits {\n faceShape: number; // 0-3\n skinColor: number; // 0-5\n eyeStyle: number; // 0-7\n eyeColor: number; // 0-4\n eyebrows: number; // 0-4\n nose: number; // 0-3\n mouth: number; // 0-5\n hairStyle: number; // 0-7\n hairColor: number; // 0-7\n accessory: number; // 0-5 (0-1 = none, 2-5 = items)\n bgColor: number; // 0-4\n}\n\nexport interface SolFaceTheme {\n skinColors?: string[];\n eyeColors?: string[];\n hairColors?: string[];\n bgColors?: string[];\n mouthColor?: string;\n eyebrowColor?: string;\n accessoryColor?: string;\n eyeWhiteColor?: string;\n noseColor?: string;\n bgOpacity?: number;\n bgRadius?: number;\n border?: { color: string; width: number };\n}\n\nexport interface RenderOptions {\n size?: number;\n theme?: SolFaceTheme;\n traitOverrides?: Partial<SolFaceTraits>;\n enableBlink?: boolean | {\n duration?: number;\n delay?: number;\n };\n className?: string;\n colorOverrides?: {\n skin?: string;\n eyes?: string;\n hair?: string;\n bg?: string;\n mouth?: string;\n eyebrow?: string;\n accessory?: string;\n nose?: string;\n eyeWhite?: string;\n };\n}\n\n// ─── Color Palettes ──────────────────────────────\n\nexport const SKIN_COLORS = [\n \"#ffd5b0\", \"#f4c794\", \"#e0a370\",\n \"#c68642\", \"#8d5524\", \"#4a2c17\",\n];\n\nexport const EYE_COLORS = [\n \"#3d2b1f\", // dark brown\n \"#4a80c4\", // blue\n \"#5a9a5a\", // green\n \"#c89430\", // amber\n \"#8a8a8a\", // gray\n];\n\nexport const HAIR_COLORS = [\n \"#1a1a1a\", // black\n \"#6b3a2a\", // brown\n \"#d4a844\", // blonde\n \"#c44a20\", // ginger\n \"#c8e64a\", // neon lime\n \"#6090e0\", // neon blue\n \"#14F195\", // neon mint\n \"#e040c0\", // neon magenta\n];\n\nexport const BG_COLORS = [\n \"#c8e64a\", \"#6090e0\", \"#14F195\", \"#e8dcc8\", \"#f85149\",\n];\n\n// ─── Hashing (djb2) ─────────────────────────────\n\nfunction djb2(str: string): number {\n let hash = 5381;\n for (let i = 0; i < str.length; i++) {\n hash = ((hash << 5) + hash + str.charCodeAt(i)) | 0;\n }\n return hash >>> 0;\n}\n\n// ─── PRNG (mulberry32) ──────────────────────────\n\nfunction mulberry32(seed: number): () => number {\n let s = seed | 0;\n return () => {\n s = (s + 0x6d2b79f5) | 0;\n let t = Math.imul(s ^ (s >>> 15), 1 | s);\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n\n// ─── Trait Generation ───────────────────────────\n\nexport function generateTraits(\n walletAddress: string,\n overrides?: Partial<SolFaceTraits>\n): SolFaceTraits {\n const seed = djb2(walletAddress);\n const rand = mulberry32(seed);\n\n const traits: SolFaceTraits = {\n faceShape: Math.floor(rand() * 4),\n skinColor: Math.floor(rand() * 6),\n eyeStyle: Math.floor(rand() * 8),\n eyeColor: Math.floor(rand() * 5),\n eyebrows: Math.floor(rand() * 5),\n nose: Math.floor(rand() * 4),\n mouth: Math.floor(rand() * 6),\n hairStyle: Math.floor(rand() * 8),\n hairColor: Math.floor(rand() * 8),\n accessory: Math.floor(rand() * 6),\n bgColor: Math.floor(rand() * 5),\n };\n\n return overrides ? { ...traits, ...overrides } : traits;\n}\n\n// ─── Trait Labels ───────────────────────────────\n\nconst FACE_LABELS = [\"Round\", \"Square\", \"Oval\", \"Hexagon\"];\nconst SKIN_LABELS = [\"Light Peach\", \"Warm Tan\", \"Golden Brown\", \"Medium Brown\", \"Deep Brown\", \"Rich Dark Brown\"];\nconst EYE_STYLE_LABELS = [\"Round\", \"Dots\", \"Almond\", \"Wide\", \"Sleepy\", \"Winking\", \"Lashes\", \"Narrow\"];\nconst EYE_COLOR_LABELS = [\"Dark Brown\", \"Blue\", \"Green\", \"Amber\", \"Gray\"];\nconst BROW_LABELS = [\"None\", \"Thin\", \"Thick\", \"Arched\", \"Angled\"];\nconst NOSE_LABELS = [\"None\", \"Dot\", \"Triangle\", \"Button\"];\nconst MOUTH_LABELS = [\"Smile\", \"Neutral\", \"Grin\", \"Open\", \"Smirk\", \"Wide Smile\"];\nconst HAIR_STYLE_LABELS = [\"Bald\", \"Short\", \"Spiky\", \"Swept\", \"Mohawk\", \"Long\", \"Bob\", \"Buzz\"];\nconst HAIR_COLOR_LABELS = [\"Black\", \"Brown\", \"Blonde\", \"Ginger\", \"Neon Lime\", \"Neon Blue\", \"Solana Mint\", \"Neon Magenta\"];\nconst ACCESSORY_LABELS = [\"None\", \"None\", \"Round Glasses\", \"Square Glasses\", \"Earring\", \"Bandana\"];\nconst BG_COLOR_LABELS = [\"Lime\", \"Blue\", \"Mint\", \"Sand\", \"Red\"];\n\nexport function getTraitLabels(traits: SolFaceTraits): Record<string, string> {\n return {\n faceShape: FACE_LABELS[traits.faceShape] ?? \"Round\",\n skinColor: SKIN_LABELS[traits.skinColor] ?? \"Warm Tan\",\n eyeStyle: EYE_STYLE_LABELS[traits.eyeStyle] ?? \"Round\",\n eyeColor: EYE_COLOR_LABELS[traits.eyeColor] ?? \"Dark Brown\",\n eyebrows: BROW_LABELS[traits.eyebrows] ?? \"None\",\n nose: NOSE_LABELS[traits.nose] ?? \"None\",\n mouth: MOUTH_LABELS[traits.mouth] ?? \"Smile\",\n hairStyle: HAIR_STYLE_LABELS[traits.hairStyle] ?? \"Bald\",\n hairColor: HAIR_COLOR_LABELS[traits.hairColor] ?? \"Black\",\n accessory: ACCESSORY_LABELS[traits.accessory] ?? \"None\",\n bgColor: BG_COLOR_LABELS[traits.bgColor] ?? \"Lime\",\n };\n}\n\n// ─── Trait Hash ─────────────────────────────────\n\nexport function traitHash(walletAddress: string): string {\n return (djb2(walletAddress) >>> 0).toString(16).padStart(8, \"0\");\n}\n\n// ─── Theme Resolution ───────────────────────────\n\nexport function resolveTheme(\n themeName?: string,\n themes?: Record<string, SolFaceTheme>\n): SolFaceTheme | undefined {\n if (!themeName || !themes) return undefined;\n return themes[themeName];\n}\n","// ═══════════════════════════════════════════════════════════════\n// SOLFACES — SVG String Renderer\n// Generates SVG markup as strings for server-side and non-React use.\n// ═══════════════════════════════════════════════════════════════\n\nimport {\n generateTraits,\n SKIN_COLORS,\n EYE_COLORS,\n HAIR_COLORS,\n BG_COLORS,\n type SolFaceTraits,\n type SolFaceTheme,\n type RenderOptions,\n} from \"./traits\";\n\nexport type { RenderOptions } from \"./traits\";\n\n// ─── Face Shape ─────────────────────────────────\n\nfunction renderFace(t: SolFaceTraits, skin: string): string {\n if (t.faceShape === 0) return `<circle cx=\"32\" cy=\"34\" r=\"20\" fill=\"${skin}\"/>`;\n if (t.faceShape === 1) return `<rect x=\"12\" y=\"14\" width=\"40\" height=\"40\" rx=\"8\" ry=\"8\" fill=\"${skin}\"/>`;\n if (t.faceShape === 2) return `<ellipse cx=\"32\" cy=\"34\" rx=\"18\" ry=\"22\" fill=\"${skin}\"/>`;\n if (t.faceShape === 3) return `<path d=\"M32 12 L50 24 L50 44 L32 56 L14 44 L14 24 Z\" fill=\"${skin}\" stroke-linejoin=\"round\"/>`;\n return `<circle cx=\"32\" cy=\"34\" r=\"20\" fill=\"${skin}\"/>`;\n}\n\n// ─── Eyes ────────────────────────────────────────\n\nfunction renderEyes(t: SolFaceTraits, c: string, w: string = \"white\"): string {\n const l = 24, r = 40, y = 30;\n\n switch (t.eyeStyle) {\n case 0: // Round\n return `<circle cx=\"${l}\" cy=\"${y}\" r=\"3.5\" fill=\"${w}\"/><circle cx=\"${l + 1}\" cy=\"${y}\" r=\"2\" fill=\"${c}\"/><circle cx=\"${r}\" cy=\"${y}\" r=\"3.5\" fill=\"${w}\"/><circle cx=\"${r + 1}\" cy=\"${y}\" r=\"2\" fill=\"${c}\"/>`;\n case 1: // Dots\n return `<circle cx=\"${l}\" cy=\"${y}\" r=\"2\" fill=\"${c}\"/><circle cx=\"${r}\" cy=\"${y}\" r=\"2\" fill=\"${c}\"/>`;\n case 2: // Almond\n return `<ellipse cx=\"${l}\" cy=\"${y}\" rx=\"4\" ry=\"2.5\" fill=\"${w}\"/><circle cx=\"${l + 0.5}\" cy=\"${y}\" r=\"1.5\" fill=\"${c}\"/><ellipse cx=\"${r}\" cy=\"${y}\" rx=\"4\" ry=\"2.5\" fill=\"${w}\"/><circle cx=\"${r + 0.5}\" cy=\"${y}\" r=\"1.5\" fill=\"${c}\"/>`;\n case 3: // Wide\n return `<circle cx=\"${l}\" cy=\"${y}\" r=\"4.5\" fill=\"${w}\"/><circle cx=\"${l}\" cy=\"${y + 0.5}\" r=\"2.5\" fill=\"${c}\"/><circle cx=\"${r}\" cy=\"${y}\" r=\"4.5\" fill=\"${w}\"/><circle cx=\"${r}\" cy=\"${y + 0.5}\" r=\"2.5\" fill=\"${c}\"/>`;\n case 4: // Sleepy\n return `<ellipse cx=\"${l}\" cy=\"${y + 1}\" rx=\"3.5\" ry=\"2\" fill=\"${w}\"/><circle cx=\"${l}\" cy=\"${y + 1}\" r=\"1.5\" fill=\"${c}\"/><line x1=\"${l - 4}\" y1=\"${y - 0.5}\" x2=\"${l + 4}\" y2=\"${y - 0.5}\" stroke=\"${c}\" stroke-width=\"1\" stroke-linecap=\"round\"/><ellipse cx=\"${r}\" cy=\"${y + 1}\" rx=\"3.5\" ry=\"2\" fill=\"${w}\"/><circle cx=\"${r}\" cy=\"${y + 1}\" r=\"1.5\" fill=\"${c}\"/><line x1=\"${r - 4}\" y1=\"${y - 0.5}\" x2=\"${r + 4}\" y2=\"${y - 0.5}\" stroke=\"${c}\" stroke-width=\"1\" stroke-linecap=\"round\"/>`;\n case 5: // Winking\n return `<path d=\"M${l - 3} ${y} Q${l} ${y + 3} ${l + 3} ${y}\" fill=\"none\" stroke=\"${c}\" stroke-width=\"1.5\" stroke-linecap=\"round\"/><circle cx=\"${r}\" cy=\"${y}\" r=\"3.5\" fill=\"${w}\"/><circle cx=\"${r + 1}\" cy=\"${y}\" r=\"2\" fill=\"${c}\"/>`;\n case 6: // Lashes\n return `<circle cx=\"${l}\" cy=\"${y}\" r=\"3\" fill=\"${w}\"/><circle cx=\"${l + 0.5}\" cy=\"${y}\" r=\"1.5\" fill=\"${c}\"/><line x1=\"${l + 2}\" y1=\"${y - 3}\" x2=\"${l + 3.5}\" y2=\"${y - 4.5}\" stroke=\"${c}\" stroke-width=\"0.8\" stroke-linecap=\"round\"/><line x1=\"${l + 3}\" y1=\"${y - 2}\" x2=\"${l + 4.5}\" y2=\"${y - 3}\" stroke=\"${c}\" stroke-width=\"0.8\" stroke-linecap=\"round\"/><circle cx=\"${r}\" cy=\"${y}\" r=\"3\" fill=\"${w}\"/><circle cx=\"${r + 0.5}\" cy=\"${y}\" r=\"1.5\" fill=\"${c}\"/><line x1=\"${r + 2}\" y1=\"${y - 3}\" x2=\"${r + 3.5}\" y2=\"${y - 4.5}\" stroke=\"${c}\" stroke-width=\"0.8\" stroke-linecap=\"round\"/><line x1=\"${r + 3}\" y1=\"${y - 2}\" x2=\"${r + 4.5}\" y2=\"${y - 3}\" stroke=\"${c}\" stroke-width=\"0.8\" stroke-linecap=\"round\"/>`;\n case 7: // Narrow\n return `<ellipse cx=\"${l}\" cy=\"${y}\" rx=\"4\" ry=\"1.2\" fill=\"${w}\"/><ellipse cx=\"${l + 0.5}\" cy=\"${y}\" rx=\"2\" ry=\"1\" fill=\"${c}\"/><ellipse cx=\"${r}\" cy=\"${y}\" rx=\"4\" ry=\"1.2\" fill=\"${w}\"/><ellipse cx=\"${r + 0.5}\" cy=\"${y}\" rx=\"2\" ry=\"1\" fill=\"${c}\"/>`;\n default:\n return `<circle cx=\"${l}\" cy=\"${y}\" r=\"3\" fill=\"${w}\"/><circle cx=\"${l + 1}\" cy=\"${y}\" r=\"2\" fill=\"${c}\"/><circle cx=\"${r}\" cy=\"${y}\" r=\"3\" fill=\"${w}\"/><circle cx=\"${r + 1}\" cy=\"${y}\" r=\"2\" fill=\"${c}\"/>`;\n }\n}\n\n// ─── Eyebrows ───────────────────────────────────\n\nfunction renderEyebrows(t: SolFaceTraits, col: string = \"#2a2020\"): string {\n const l = 24, r = 40, y = 25;\n\n switch (t.eyebrows) {\n case 0: return \"\";\n case 1: // Thin\n return `<line x1=\"${l - 3}\" y1=\"${y}\" x2=\"${l + 3}\" y2=\"${y}\" stroke=\"${col}\" stroke-width=\"0.8\" stroke-linecap=\"round\"/><line x1=\"${r - 3}\" y1=\"${y}\" x2=\"${r + 3}\" y2=\"${y}\" stroke=\"${col}\" stroke-width=\"0.8\" stroke-linecap=\"round\"/>`;\n case 2: // Thick\n return `<line x1=\"${l - 3.5}\" y1=\"${y}\" x2=\"${l + 3.5}\" y2=\"${y}\" stroke=\"${col}\" stroke-width=\"2\" stroke-linecap=\"round\"/><line x1=\"${r - 3.5}\" y1=\"${y}\" x2=\"${r + 3.5}\" y2=\"${y}\" stroke=\"${col}\" stroke-width=\"2\" stroke-linecap=\"round\"/>`;\n case 3: // Arched\n return `<path d=\"M${l - 3.5} ${y + 1} Q${l} ${y - 2} ${l + 3.5} ${y + 1}\" fill=\"none\" stroke=\"${col}\" stroke-width=\"1\" stroke-linecap=\"round\"/><path d=\"M${r - 3.5} ${y + 1} Q${r} ${y - 2} ${r + 3.5} ${y + 1}\" fill=\"none\" stroke=\"${col}\" stroke-width=\"1\" stroke-linecap=\"round\"/>`;\n case 4: // Angled\n return `<line x1=\"${l - 3}\" y1=\"${y - 1}\" x2=\"${l + 3}\" y2=\"${y + 1}\" stroke=\"${col}\" stroke-width=\"1.2\" stroke-linecap=\"round\"/><line x1=\"${r - 3}\" y1=\"${y + 1}\" x2=\"${r + 3}\" y2=\"${y - 1}\" stroke=\"${col}\" stroke-width=\"1.2\" stroke-linecap=\"round\"/>`;\n default: return \"\";\n }\n}\n\n// ─── Nose ───────────────────────────────────────\n\nfunction renderNose(t: SolFaceTraits, skin: string, noseCol?: string): string {\n const cx = 32, y = 36;\n const sh = noseCol ?? (skin + \"aa\");\n\n switch (t.nose) {\n case 0: return \"\";\n case 1: return `<circle cx=\"${cx}\" cy=\"${y}\" r=\"1.5\" fill=\"${sh}\"/>`;\n case 2: return `<path d=\"M${cx} ${y - 1.5} L${cx + 2.5} ${y + 2} L${cx - 2.5} ${y + 2} Z\" fill=\"${sh}\"/>`;\n case 3: return `<circle cx=\"${cx - 1.5}\" cy=\"${y}\" r=\"1\" fill=\"${sh}\"/><circle cx=\"${cx + 1.5}\" cy=\"${y}\" r=\"1\" fill=\"${sh}\"/>`;\n default: return \"\";\n }\n}\n\n// ─── Mouth ──────────────────────────────────────\n\nfunction renderMouth(t: SolFaceTraits, col: string = \"#c05050\", teethCol: string = \"white\"): string {\n const cx = 32, y = 42;\n\n switch (t.mouth) {\n case 0: // Smile\n return `<path d=\"M${cx - 4} ${y} Q${cx} ${y + 4} ${cx + 4} ${y}\" fill=\"none\" stroke=\"${col}\" stroke-width=\"1.2\" stroke-linecap=\"round\"/>`;\n case 1: // Neutral\n return `<line x1=\"${cx - 3}\" y1=\"${y + 1}\" x2=\"${cx + 3}\" y2=\"${y + 1}\" stroke=\"${col}\" stroke-width=\"1.2\" stroke-linecap=\"round\"/>`;\n case 2: // Grin\n return `<path d=\"M${cx - 6} ${y} Q${cx} ${y + 5} ${cx + 6} ${y}\" fill=\"none\" stroke=\"${col}\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>`;\n case 3: // Open\n return `<ellipse cx=\"${cx}\" cy=\"${y + 1}\" rx=\"3\" ry=\"2.5\" fill=\"${col}\" opacity=\"0.8\"/>`;\n case 4: // Smirk\n return `<path d=\"M${cx - 4} ${y + 1} Q${cx - 1} ${y + 1} ${cx + 4} ${y - 1}\" fill=\"none\" stroke=\"${col}\" stroke-width=\"1.2\" stroke-linecap=\"round\"/>`;\n case 5: // Wide smile\n return `<path d=\"M${cx - 6} ${y} Q${cx} ${y + 6} ${cx + 6} ${y}\" fill=\"${teethCol}\" stroke=\"${col}\" stroke-width=\"1\"/>`;\n default:\n return `<path d=\"M${cx - 4} ${y} Q${cx} ${y + 4} ${cx + 4} ${y}\" fill=\"none\" stroke=\"${col}\" stroke-width=\"1.2\" stroke-linecap=\"round\"/>`;\n }\n}\n\n// ─── Hair ───────────────────────────────────────\n\nfunction renderHair(t: SolFaceTraits, col: string): string {\n switch (t.hairStyle) {\n case 0: return \"\"; // Bald\n case 1: return `<rect x=\"14\" y=\"12\" width=\"36\" height=\"12\" rx=\"6\" ry=\"6\" fill=\"${col}\"/>`;\n case 2: return `<g fill=\"${col}\"><rect x=\"14\" y=\"16\" width=\"36\" height=\"8\" rx=\"2\"/><polygon points=\"18,16 22,6 26,16\"/><polygon points=\"26,16 30,4 34,16\"/><polygon points=\"34,16 38,6 42,16\"/><polygon points=\"42,16 46,10 48,16\"/></g>`;\n case 3: return `<g fill=\"${col}\"><rect x=\"14\" y=\"14\" width=\"36\" height=\"10\" rx=\"4\"/><path d=\"M14 18 Q8 14 10 8 Q14 10 20 14 Z\"/></g>`;\n case 4: return `<rect x=\"26\" y=\"4\" width=\"12\" height=\"20\" rx=\"4\" ry=\"2\" fill=\"${col}\"/>`;\n case 5: return `<g fill=\"${col}\"><rect x=\"14\" y=\"12\" width=\"36\" height=\"10\" rx=\"4\"/><rect x=\"10\" y=\"18\" width=\"8\" height=\"24\" rx=\"3\"/><rect x=\"46\" y=\"18\" width=\"8\" height=\"24\" rx=\"3\"/></g>`;\n case 6: return `<path d=\"M12 22 Q12 10 32 10 Q52 10 52 22 L52 38 Q52 42 48 42 L48 26 Q48 16 32 16 Q16 16 16 26 L16 42 Q12 42 12 38 Z\" fill=\"${col}\"/>`;\n case 7: return `<rect x=\"15\" y=\"13\" width=\"34\" height=\"9\" rx=\"8\" ry=\"4\" fill=\"${col}\" opacity=\"0.7\"/>`;\n default: return \"\";\n }\n}\n\n// ─── Accessories ────────────────────────────────\n\nfunction renderAccessory(t: SolFaceTraits, col: string = \"#444\"): string {\n if (t.accessory <= 1) return \"\";\n if (t.accessory === 2) return `<g fill=\"none\" stroke=\"${col}\" stroke-width=\"1\"><circle cx=\"24\" cy=\"30\" r=\"5\"/><circle cx=\"40\" cy=\"30\" r=\"5\"/><line x1=\"29\" y1=\"30\" x2=\"35\" y2=\"30\"/><line x1=\"19\" y1=\"30\" x2=\"14\" y2=\"28\"/><line x1=\"45\" y1=\"30\" x2=\"50\" y2=\"28\"/></g>`;\n if (t.accessory === 3) return `<g fill=\"none\" stroke=\"${col}\" stroke-width=\"1\"><rect x=\"19\" y=\"26\" width=\"10\" height=\"8\" rx=\"1\"/><rect x=\"35\" y=\"26\" width=\"10\" height=\"8\" rx=\"1\"/><line x1=\"29\" y1=\"30\" x2=\"35\" y2=\"30\"/><line x1=\"19\" y1=\"30\" x2=\"14\" y2=\"28\"/><line x1=\"45\" y1=\"30\" x2=\"50\" y2=\"28\"/></g>`;\n if (t.accessory === 4) return `<circle cx=\"11\" cy=\"36\" r=\"2\" fill=\"${col}\" stroke=\"${col}\" stroke-width=\"0.5\"/>`;\n if (t.accessory === 5) return `<g><rect x=\"12\" y=\"20\" width=\"40\" height=\"4\" rx=\"1\" fill=\"${col}\"/><path d=\"M12 22 L8 26 L12 24 Z\" fill=\"${col}\"/></g>`;\n return \"\";\n}\n\n// ─── Main Render Functions ──────────────────────\n\nexport function renderSolFaceSVG(\n walletAddress: string,\n options?: RenderOptions\n): string {\n const { size = 64, theme, traitOverrides, enableBlink, className, colorOverrides } = options ?? {};\n const traits = generateTraits(walletAddress, traitOverrides);\n\n const skinColors = theme?.skinColors ?? SKIN_COLORS;\n const eyeColors = theme?.eyeColors ?? EYE_COLORS;\n const hairColors = theme?.hairColors ?? HAIR_COLORS;\n const bgColors = theme?.bgColors ?? BG_COLORS;\n\n const skin = colorOverrides?.skin ?? skinColors[traits.skinColor % skinColors.length];\n const eyeCol = colorOverrides?.eyes ?? eyeColors[traits.eyeColor % eyeColors.length];\n const hairCol = colorOverrides?.hair ?? hairColors[traits.hairColor % hairColors.length];\n const bgCol = colorOverrides?.bg ?? bgColors[traits.bgColor % bgColors.length];\n\n const bgOpacity = theme?.bgOpacity ?? 0.15;\n const bgRadius = theme?.bgRadius ?? 4;\n const mouthCol = colorOverrides?.mouth ?? theme?.mouthColor ?? \"#c05050\";\n const browCol = colorOverrides?.eyebrow ?? theme?.eyebrowColor ?? \"#2a2020\";\n const accCol = colorOverrides?.accessory ?? theme?.accessoryColor ?? \"#444\";\n const eyeWhite = colorOverrides?.eyeWhite ?? theme?.eyeWhiteColor ?? \"white\";\n const noseCol = colorOverrides?.nose ?? theme?.noseColor;\n\n const classAttr = className ? ` class=\"${className}\"` : \"\";\n let svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\" width=\"${size}\" height=\"${size}\"${classAttr}>`;\n\n svg += `<rect x=\"0\" y=\"0\" width=\"64\" height=\"64\" fill=\"${bgCol}\" opacity=\"${bgOpacity}\" rx=\"${bgRadius}\"/>`;\n\n const blinkEnabled = !!enableBlink;\n const blinkDuration = typeof enableBlink === \"object\" ? (enableBlink.duration ?? 4) : 4;\n const blinkDelay = typeof enableBlink === \"object\" ? (enableBlink.delay ?? 0) : 0;\n\n if (blinkEnabled) {\n const uid = `sf-${walletAddress.slice(0, 8)}`;\n const delayStr = blinkDelay ? ` ${blinkDelay}s` : \"\";\n svg += `<style>@keyframes ${uid}-blink{0%,90%,100%{transform:scaleY(1)}95%{transform:scaleY(0.1)}}.${uid}-eyes{animation:${uid}-blink ${blinkDuration}s ease-in-out${delayStr} infinite;transform-origin:32px 30px}</style>`;\n }\n\n svg += renderHair(traits, hairCol);\n svg += renderFace(traits, skin);\n\n if (blinkEnabled) {\n const uid = `sf-${walletAddress.slice(0, 8)}`;\n svg += `<g class=\"${uid}-eyes\">`;\n }\n svg += renderEyes(traits, eyeCol, eyeWhite);\n if (blinkEnabled) svg += `</g>`;\n\n svg += renderEyebrows(traits, browCol);\n svg += renderNose(traits, skin, noseCol);\n svg += renderMouth(traits, mouthCol, eyeWhite);\n svg += renderAccessory(traits, accCol);\n\n if (theme?.border) {\n svg += `<rect x=\"0\" y=\"0\" width=\"64\" height=\"64\" fill=\"none\" stroke=\"${theme.border.color}\" stroke-width=\"${theme.border.width}\" rx=\"${bgRadius}\"/>`;\n }\n\n svg += `</svg>`;\n\n return svg;\n}\n\nexport function renderSolFaceDataURI(\n walletAddress: string,\n options?: RenderOptions\n): string {\n const svg = renderSolFaceSVG(walletAddress, options);\n return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;\n}\n\nexport function renderSolFaceBase64(\n walletAddress: string,\n options?: RenderOptions\n): string {\n const svg = renderSolFaceSVG(walletAddress, options);\n return `data:image/svg+xml;base64,${btoa(svg)}`;\n}\n","// ═══════════════════════════════════════════════════════════════\n// SOLFACES — AI Agent Description Generator\n// Produces natural language descriptions of a wallet's SolFace\n// for use in system prompts, bios, and self-reference.\n// ═══════════════════════════════════════════════════════════════\n\nimport { generateTraits, type SolFaceTraits } from \"./traits\";\n\n// ─── Vocabulary Maps ─────────────────────────────────────────\n\nconst FACE_SHAPES: Record<number, string> = {\n 0: \"round\",\n 1: \"square with softly rounded corners\",\n 2: \"oval\",\n 3: \"angular, hexagonal\",\n};\n\nconst SKIN_TONES: Record<number, string> = {\n 0: \"light peach\",\n 1: \"warm tan\",\n 2: \"golden brown\",\n 3: \"medium brown\",\n 4: \"deep brown\",\n 5: \"rich dark brown\",\n};\n\nconst EYE_STYLES: Record<number, string> = {\n 0: \"round, wide-open\",\n 1: \"small and dot-like\",\n 2: \"almond-shaped\",\n 3: \"wide and expressive\",\n 4: \"sleepy, half-lidded\",\n 5: \"playfully winking\",\n 6: \"adorned with lashes\",\n 7: \"narrow and observant\",\n};\n\nconst EYE_COLORS_DESC: Record<number, string> = {\n 0: \"dark brown\",\n 1: \"blue\",\n 2: \"green\",\n 3: \"amber\",\n 4: \"gray\",\n};\n\nconst EYEBROW_STYLES: Record<number, string> = {\n 0: \"\", // none — omitted from description\n 1: \"thin\",\n 2: \"thick, prominent\",\n 3: \"elegantly arched\",\n 4: \"sharply angled\",\n};\n\nconst NOSE_STYLES: Record<number, string> = {\n 0: \"\", // none\n 1: \"a small dot nose\",\n 2: \"a triangular nose\",\n 3: \"a button nose with visible nostrils\",\n};\n\nconst MOUTH_STYLES: Record<number, string> = {\n 0: \"a gentle smile\",\n 1: \"a neutral, straight expression\",\n 2: \"a wide grin\",\n 3: \"a small, open mouth\",\n 4: \"a confident smirk\",\n 5: \"a broad, toothy smile\",\n};\n\nconst HAIR_STYLES: Record<number, string> = {\n 0: \"bald, with no hair\",\n 1: \"short, neatly cropped hair\",\n 2: \"tall, spiky hair\",\n 3: \"side-swept hair\",\n 4: \"a bold mohawk\",\n 5: \"long hair that falls past the shoulders\",\n 6: \"a clean bob cut\",\n 7: \"a close buzz cut\",\n};\n\nconst HAIR_COLORS_DESC: Record<number, string> = {\n 0: \"jet black\",\n 1: \"brown\",\n 2: \"blonde\",\n 3: \"ginger red\",\n 4: \"neon lime green\",\n 5: \"neon blue\",\n 6: \"Solana mint green\",\n 7: \"neon magenta\",\n};\n\nconst ACCESSORY_DESC: Record<number, string> = {\n 0: \"\",\n 1: \"\",\n 2: \"round glasses\",\n 3: \"square-framed glasses\",\n 4: \"a gold earring\",\n 5: \"a red bandana\",\n};\n\nconst BG_COLORS_DESC: Record<number, string> = {\n 0: \"lime green\",\n 1: \"blue\",\n 2: \"Solana mint green\",\n 3: \"warm sand\",\n 4: \"red\",\n};\n\n// ─── Description Builder ─────────────────────────────────────\n\nexport interface DescribeOptions {\n /** Include background color in description. Default: true */\n includeBackground?: boolean;\n /** Output format. Default: \"paragraph\" */\n format?: \"paragraph\" | \"structured\" | \"compact\";\n /** Perspective: how the description is framed. Default: \"third\" */\n perspective?: \"first\" | \"third\";\n /** Optional name to use instead of \"This SolFace\" / \"I\". */\n name?: string;\n}\n\n/**\n * Generate a natural language description of a SolFace avatar.\n *\n * Designed for AI agent system prompts, profile bios, alt text,\n * and anywhere a wallet's visual identity needs to be described in words.\n *\n * @example\n * ```ts\n * // For an AI agent's system prompt\n * const desc = describeAppearance(\"7xKXq...\", {\n * perspective: \"first\",\n * name: \"Atlas\",\n * });\n * // → \"I'm Atlas. I have a round face with light peach skin, wide\n * // and expressive blue eyes with elegantly arched eyebrows, and\n * // tall, spiky Solana mint green hair. I'm wearing round glasses\n * // and have a confident smirk.\"\n *\n * // For alt text\n * const alt = describeAppearance(\"7xKXq...\", { format: \"compact\" });\n * // → \"Round face, light peach skin, blue wide eyes, spiky mint hair, round glasses, smirking\"\n * ```\n */\nexport function describeAppearance(\n walletAddress: string,\n options?: DescribeOptions\n): string {\n const traits = generateTraits(walletAddress);\n const {\n includeBackground = true,\n format = \"paragraph\",\n perspective = \"third\",\n name,\n } = options ?? {};\n\n if (format === \"structured\") {\n return buildStructured(traits, includeBackground);\n }\n if (format === \"compact\") {\n return buildCompact(traits);\n }\n return buildParagraph(traits, perspective, name, includeBackground);\n}\n\n/**\n * Generate description from pre-computed traits (for when you already have them).\n */\nexport function describeTraits(\n traits: SolFaceTraits,\n options?: DescribeOptions\n): string {\n const {\n includeBackground = true,\n format = \"paragraph\",\n perspective = \"third\",\n name,\n } = options ?? {};\n\n if (format === \"structured\") return buildStructured(traits, includeBackground);\n if (format === \"compact\") return buildCompact(traits);\n return buildParagraph(traits, perspective, name, includeBackground);\n}\n\n// ─── Builders ────────────────────────────────────────────────\n\nfunction buildParagraph(\n t: SolFaceTraits,\n perspective: \"first\" | \"third\",\n name?: string,\n includeBg?: boolean\n): string {\n const parts: string[] = [];\n\n // Subject intro\n const subject = perspective === \"first\"\n ? (name ? `I'm ${name}. I have` : \"I have\")\n : (name ? `${name} has` : \"This SolFace has\");\n\n const have = perspective === \"first\" ? \"have\" : \"has\";\n const my = perspective === \"first\" ? \"my\" : \"their\";\n const im = perspective === \"first\" ? \"I'm\" : \"They're\";\n\n // Face + skin\n parts.push(`${subject} a ${FACE_SHAPES[t.faceShape] ?? \"round\"} face with ${SKIN_TONES[t.skinColor] ?? \"warm\"} skin`);\n\n // Eyes\n const eyeStyle = EYE_STYLES[t.eyeStyle] ?? \"round\";\n const eyeColor = EYE_COLORS_DESC[t.eyeColor] ?? \"dark\";\n parts.push(`${eyeStyle} ${eyeColor} eyes`);\n\n // Eyebrows (if present)\n const brows = EYEBROW_STYLES[t.eyebrows];\n if (brows) {\n parts.push(`${brows} eyebrows`);\n }\n\n // Hair\n const hairStyle = HAIR_STYLES[t.hairStyle] ?? \"\";\n const hairColor = HAIR_COLORS_DESC[t.hairColor] ?? \"\";\n if (t.hairStyle === 0) {\n parts.push(\"and is bald\");\n } else if (hairStyle.startsWith(\"a \")) {\n parts.push(`and a ${hairColor} ${hairStyle.slice(2)}`);\n } else {\n parts.push(`and ${hairColor} ${hairStyle}`);\n }\n\n // Build the main sentence\n let desc = parts[0];\n if (parts.length > 2) {\n // \"face with skin, eyes, eyebrows, and hair\"\n desc += \", \" + parts.slice(1, -1).join(\", \") + \", \" + parts[parts.length - 1];\n } else if (parts.length === 2) {\n desc += \" and \" + parts[1];\n }\n desc += \".\";\n\n // Nose\n const nose = NOSE_STYLES[t.nose];\n if (nose) {\n const noseSubject = perspective === \"first\" ? \"I have\" : (name ?? \"They\") + (name ? \" has\" : \" have\");\n desc += ` ${noseSubject} ${nose}.`;\n }\n\n // Accessory\n const acc = ACCESSORY_DESC[t.accessory];\n if (acc) {\n desc += ` ${im} wearing ${acc}.`;\n }\n\n // Mouth\n const mouth = MOUTH_STYLES[t.mouth] ?? \"a smile\";\n const mouthVerb = perspective === \"first\" ? \"I have\" : (name ?? \"They\") + (name ? \" has\" : \" have\");\n desc += ` ${mouthVerb} ${mouth}.`;\n\n // Background\n if (includeBg) {\n const bg = BG_COLORS_DESC[t.bgColor] ?? \"colorful\";\n desc += ` The background is ${bg}.`;\n }\n\n return desc;\n}\n\nfunction buildStructured(t: SolFaceTraits, includeBg: boolean): string {\n const lines: string[] = [\n `Face: ${FACE_SHAPES[t.faceShape] ?? \"round\"}`,\n `Skin: ${SKIN_TONES[t.skinColor] ?? \"warm\"}`,\n `Eyes: ${EYE_STYLES[t.eyeStyle] ?? \"round\"}, ${EYE_COLORS_DESC[t.eyeColor] ?? \"dark\"}`,\n ];\n\n const brows = EYEBROW_STYLES[t.eyebrows];\n if (brows) lines.push(`Eyebrows: ${brows}`);\n\n const nose = NOSE_STYLES[t.nose];\n if (nose) lines.push(`Nose: ${nose.replace(/^a /, \"\")}`);\n\n lines.push(`Mouth: ${MOUTH_STYLES[t.mouth] ?? \"smile\"}`);\n\n if (t.hairStyle === 0) {\n lines.push(\"Hair: bald\");\n } else {\n const hs = HAIR_STYLES[t.hairStyle] ?? \"\";\n const hc = HAIR_COLORS_DESC[t.hairColor] ?? \"\";\n lines.push(`Hair: ${hc} ${hs.startsWith(\"a \") ? hs.slice(2) : hs}`);\n }\n\n const acc = ACCESSORY_DESC[t.accessory];\n if (acc) lines.push(`Accessory: ${acc}`);\n\n if (includeBg) {\n lines.push(`Background: ${BG_COLORS_DESC[t.bgColor] ?? \"colorful\"}`);\n }\n\n return lines.join(\"\\n\");\n}\n\nfunction buildCompact(t: SolFaceTraits): string {\n const parts: string[] = [];\n\n parts.push(`${FACE_SHAPES[t.faceShape] ?? \"round\"} face`);\n parts.push(`${SKIN_TONES[t.skinColor] ?? \"warm\"} skin`);\n parts.push(`${EYE_COLORS_DESC[t.eyeColor] ?? \"dark\"} ${EYE_STYLES[t.eyeStyle] ?? \"round\"} eyes`);\n\n if (t.hairStyle === 0) {\n parts.push(\"bald\");\n } else {\n const hs = (HAIR_STYLES[t.hairStyle] ?? \"hair\").replace(/,.*/, \"\");\n const hc = HAIR_COLORS_DESC[t.hairColor] ?? \"\";\n parts.push(`${hc} ${hs.startsWith(\"a \") ? hs.slice(2) : hs}`);\n }\n\n const acc = ACCESSORY_DESC[t.accessory];\n if (acc) parts.push(acc);\n\n parts.push((MOUTH_STYLES[t.mouth] ?? \"smiling\").replace(/^a /, \"\"));\n\n return parts.join(\", \");\n}\n\n// ─── Alt Text Helper ─────────────────────────────────────────\n\n/**\n * Generate accessible alt text for a SolFace avatar.\n * Shorter than full description, optimized for screen readers.\n */\nexport function solFaceAltText(walletAddress: string): string {\n return `SolFace avatar: ${describeAppearance(walletAddress, { format: \"compact\", includeBackground: false })}`;\n}\n\n// ─── System Prompt Helper ────────────────────────────────────\n\n/**\n * Generate a system prompt snippet for an AI agent describing its appearance.\n *\n * @example\n * ```ts\n * const appearance = agentAppearancePrompt(\"7xKXq...\", \"Atlas\");\n * // Use in system prompt:\n * // `You are Atlas, an AI agent. ${appearance}`\n * ```\n */\nexport function agentAppearancePrompt(\n walletAddress: string,\n agentName?: string\n): string {\n const desc = describeAppearance(walletAddress, {\n perspective: \"first\",\n name: agentName,\n includeBackground: false,\n format: \"paragraph\",\n });\n\n const hash = (djb2Simple(walletAddress) >>> 0).toString(16).padStart(8, \"0\");\n\n return `My visual identity is a SolFace avatar (ID: ${hash}) derived from my wallet address. ${desc} This appearance is deterministic — anyone who looks up my wallet will see the same face.`;\n}\n\n// Inline djb2 to avoid circular dependency\nfunction djb2Simple(str: string): number {\n let hash = 5381;\n for (let i = 0; i < str.length; i++) {\n hash = ((hash << 5) + hash + str.charCodeAt(i)) | 0;\n }\n return hash >>> 0;\n}\n","// ═══════════════════════════════════════════════════════════════\n// SOLFACES — Preset Themes\n// ═══════════════════════════════════════════════════════════════\n\nimport type { SolFaceTheme } from \"../core/traits\";\n\n// ─── Presets ────────────────────────────────────\n\nexport const solanaTheme: SolFaceTheme = {\n bgColors: [\"#14F195\", \"#9945FF\", \"#00C2FF\", \"#FFD700\", \"#FF6B6B\"],\n bgOpacity: 0.2,\n bgRadius: 4,\n};\n\nexport const darkTheme: SolFaceTheme = {\n bgColors: [\"#1a1b23\", \"#2d1b69\", \"#0a2463\", \"#1b2838\", \"#2a0a3a\"],\n mouthColor: \"#e06070\",\n eyebrowColor: \"#aaa\",\n accessoryColor: \"#888\",\n eyeWhiteColor: \"#e0e0e0\",\n bgOpacity: 1,\n bgRadius: 4,\n};\n\nexport const lightTheme: SolFaceTheme = {\n bgColors: [\"#f0f4ff\", \"#fff0f5\", \"#f0fff0\", \"#fffff0\", \"#f5f0ff\"],\n bgOpacity: 1,\n bgRadius: 8,\n};\n\nexport const monoTheme: SolFaceTheme = {\n skinColors: [\"#e0e0e0\", \"#c0c0c0\", \"#a0a0a0\", \"#808080\", \"#606060\", \"#404040\"],\n eyeColors: [\"#333\", \"#555\", \"#777\", \"#999\", \"#bbb\"],\n hairColors: [\"#1a1a1a\", \"#333\", \"#555\", \"#777\", \"#999\", \"#bbb\", \"#ddd\", \"#eee\"],\n bgColors: [\"#f0f0f0\", \"#e0e0e0\", \"#d0d0d0\", \"#c0c0c0\", \"#b0b0b0\"],\n mouthColor: \"#666\",\n eyebrowColor: \"#555\",\n accessoryColor: \"#777\",\n eyeWhiteColor: \"#f0f0f0\",\n bgOpacity: 0.3,\n bgRadius: 4,\n};\n\nexport const neonTheme: SolFaceTheme = {\n bgColors: [\"#0d0d0d\", \"#1a0a2e\", \"#0a1628\", \"#0d1a0d\", \"#1a0a0a\"],\n hairColors: [\"#ff00ff\", \"#00ffff\", \"#ff6600\", \"#39ff14\", \"#ff3366\", \"#6600ff\", \"#ffff00\", \"#00ff99\"],\n eyeColors: [\"#ff00ff\", \"#00ffff\", \"#39ff14\", \"#ff6600\", \"#ffff00\"],\n mouthColor: \"#ff3366\",\n eyebrowColor: \"#ccc\",\n accessoryColor: \"#00ffff\",\n eyeWhiteColor: \"#1a1a1a\",\n bgOpacity: 1,\n bgRadius: 4,\n border: { color: \"#39ff14\", width: 1 },\n};\n\nexport const jupiterTheme: SolFaceTheme = {\n bgColors: [\"#131b2e\", \"#1b2540\", \"#0f1926\", \"#1e2d4a\", \"#162033\"],\n mouthColor: \"#c7d4e8\",\n eyebrowColor: \"#8899aa\",\n accessoryColor: \"#6882a0\",\n eyeWhiteColor: \"#d0d8e8\",\n bgOpacity: 1,\n bgRadius: 6,\n border: { color: \"#3a5a8c\", width: 0.5 },\n};\n\nexport const phantomTheme: SolFaceTheme = {\n bgColors: [\"#1c0e30\", \"#2a1548\", \"#1e0f36\", \"#251240\", \"#20103a\"],\n mouthColor: \"#d4a0e8\",\n eyebrowColor: \"#9966cc\",\n accessoryColor: \"#ab8dd6\",\n eyeWhiteColor: \"#d8c8e8\",\n bgOpacity: 1,\n bgRadius: 6,\n border: { color: \"#ab8dd6\", width: 0.5 },\n};\n\nexport const circleTheme: SolFaceTheme = {\n bgRadius: 999,\n};\n\n// ─── Theme Map ──────────────────────────────────\n\nexport const PRESET_THEMES: Record<string, SolFaceTheme> = {\n solana: solanaTheme,\n dark: darkTheme,\n light: lightTheme,\n mono: monoTheme,\n neon: neonTheme,\n jupiter: jupiterTheme,\n phantom: phantomTheme,\n circle: circleTheme,\n};\n\nexport function getPresetTheme(\n name: string,\n overrides?: Partial<SolFaceTheme>\n): SolFaceTheme {\n const base = PRESET_THEMES[name];\n if (!base) return (overrides as SolFaceTheme) ?? {};\n return overrides ? { ...base, ...overrides } : base;\n}\n"],"mappings":"scAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KC2DO,IAAMC,EAAc,CACzB,UAAW,UAAW,UACtB,UAAW,UAAW,SACxB,EAEaC,EAAa,CACxB,UACA,UACA,UACA,UACA,SACF,EAEaC,EAAc,CACzB,UACA,UACA,UACA,UACA,UACA,UACA,UACA,SACF,EAEaC,EAAY,CACvB,UAAW,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AAI,EAGA,OAAQO,EACR,SAAUS,EACZ,EAGI,OAAO,OAAW,MACnB,OAAe,SAAWR,IAIzB,OAAO,SAAa,MAClB,SAAS,aAAe,UAC1B,SAAS,iBAAiB,mBAAoB,IAAM,CAC9C,SAAS,cAAc,gBAAgB,GACzCR,EAAS,CAEb,CAAC,EAGG,SAAS,cAAc,gBAAgB,GACzCA,EAAS,GAKf,IAAOiB,GAAQT","names":["cdn_exports","__export","cdn_default","SKIN_COLORS","EYE_COLORS","HAIR_COLORS","BG_COLORS","djb2","str","hash","i","mulberry32","seed","s","t","generateTraits","walletAddress","overrides","rand","traits","FACE_LABELS","SKIN_LABELS","EYE_STYLE_LABELS","EYE_COLOR_LABELS","BROW_LABELS","NOSE_LABELS","MOUTH_LABELS","HAIR_STYLE_LABELS","HAIR_COLOR_LABELS","ACCESSORY_LABELS","BG_COLOR_LABELS","getTraitLabels","traitHash","resolveTheme","themeName","themes","renderFace","t","skin","renderEyes","c","w","renderEyebrows","col","renderNose","noseCol","sh","renderMouth","teethCol","renderHair","renderAccessory","renderSolFaceSVG","walletAddress","options","size","theme","traitOverrides","enableBlink","className","colorOverrides","traits","generateTraits","skinColors","SKIN_COLORS","eyeColors","EYE_COLORS","hairColors","HAIR_COLORS","bgColors","BG_COLORS","eyeCol","hairCol","bgCol","bgOpacity","bgRadius","mouthCol","browCol","accCol","eyeWhite","classAttr","svg","blinkEnabled","blinkDuration","blinkDelay","uid","delayStr","renderSolFaceDataURI","renderSolFaceBase64","FACE_SHAPES","SKIN_TONES","EYE_STYLES","EYE_COLORS_DESC","EYEBROW_STYLES","NOSE_STYLES","MOUTH_STYLES","HAIR_STYLES","HAIR_COLORS_DESC","ACCESSORY_DESC","BG_COLORS_DESC","describeAppearance","walletAddress","options","traits","generateTraits","includeBackground","format","perspective","name","buildStructured","buildCompact","buildParagraph","buildParagraph","t","perspective","name","includeBg","parts","subject","have","my","im","FACE_SHAPES","SKIN_TONES","eyeStyle","EYE_STYLES","eyeColor","EYE_COLORS_DESC","brows","EYEBROW_STYLES","hairStyle","HAIR_STYLES","hairColor","HAIR_COLORS_DESC","desc","nose","NOSE_STYLES","noseSubject","acc","ACCESSORY_DESC","mouth","MOUTH_STYLES","mouthVerb","bg","BG_COLORS_DESC","buildStructured","lines","hs","hc","buildCompact","solFaceAltText","walletAddress","describeAppearance","agentAppearancePrompt","agentName","djb2Simple","str","hash","i","solanaTheme","darkTheme","lightTheme","monoTheme","neonTheme","jupiterTheme","phantomTheme","circleTheme","PRESET_THEMES","getPresetTheme","name","overrides","base","mountSolFace","element","walletAddress","options","el","renderSolFaceSVG","setSolFaceImg","img","renderSolFaceDataURI","solFaceAltText","autoInit","root","wallet","size","blink","themeName","theme","PRESET_THEMES","SolFaces","generateTraits","getTraitLabels","traitHash","resolveTheme","renderSolFaceBase64","describeAppearance","agentAppearancePrompt","getPresetTheme","cdn_default"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkCVFO7YHY_cjs = require('../chunk-CVFO7YHY.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "PRESET_THEMES", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkCVFO7YHY_cjs.PRESET_THEMES; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "circleTheme", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunkCVFO7YHY_cjs.circleTheme; }
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "darkTheme", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return chunkCVFO7YHY_cjs.darkTheme; }
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "getPresetTheme", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return chunkCVFO7YHY_cjs.getPresetTheme; }
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "jupiterTheme", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return chunkCVFO7YHY_cjs.jupiterTheme; }
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "lightTheme", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return chunkCVFO7YHY_cjs.lightTheme; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "monoTheme", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return chunkCVFO7YHY_cjs.monoTheme; }
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, "neonTheme", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return chunkCVFO7YHY_cjs.neonTheme; }
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "phantomTheme", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return chunkCVFO7YHY_cjs.phantomTheme; }
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "solanaTheme", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () { return chunkCVFO7YHY_cjs.solanaTheme; }
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=index.cjs.map
|
|
48
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { a as SolFaceTheme } from '../traits-DAFZnXeS.cjs';
|
|
2
|
+
|
|
3
|
+
declare const solanaTheme: SolFaceTheme;
|
|
4
|
+
declare const darkTheme: SolFaceTheme;
|
|
5
|
+
declare const lightTheme: SolFaceTheme;
|
|
6
|
+
declare const monoTheme: SolFaceTheme;
|
|
7
|
+
declare const neonTheme: SolFaceTheme;
|
|
8
|
+
declare const jupiterTheme: SolFaceTheme;
|
|
9
|
+
declare const phantomTheme: SolFaceTheme;
|
|
10
|
+
declare const circleTheme: SolFaceTheme;
|
|
11
|
+
declare const PRESET_THEMES: Record<string, SolFaceTheme>;
|
|
12
|
+
declare function getPresetTheme(name: string, overrides?: Partial<SolFaceTheme>): SolFaceTheme;
|
|
13
|
+
|
|
14
|
+
export { PRESET_THEMES, circleTheme, darkTheme, getPresetTheme, jupiterTheme, lightTheme, monoTheme, neonTheme, phantomTheme, solanaTheme };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { a as SolFaceTheme } from '../traits-DAFZnXeS.js';
|
|
2
|
+
|
|
3
|
+
declare const solanaTheme: SolFaceTheme;
|
|
4
|
+
declare const darkTheme: SolFaceTheme;
|
|
5
|
+
declare const lightTheme: SolFaceTheme;
|
|
6
|
+
declare const monoTheme: SolFaceTheme;
|
|
7
|
+
declare const neonTheme: SolFaceTheme;
|
|
8
|
+
declare const jupiterTheme: SolFaceTheme;
|
|
9
|
+
declare const phantomTheme: SolFaceTheme;
|
|
10
|
+
declare const circleTheme: SolFaceTheme;
|
|
11
|
+
declare const PRESET_THEMES: Record<string, SolFaceTheme>;
|
|
12
|
+
declare function getPresetTheme(name: string, overrides?: Partial<SolFaceTheme>): SolFaceTheme;
|
|
13
|
+
|
|
14
|
+
export { PRESET_THEMES, circleTheme, darkTheme, getPresetTheme, jupiterTheme, lightTheme, monoTheme, neonTheme, phantomTheme, solanaTheme };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
interface SolFaceTraits {
|
|
2
|
+
faceShape: number;
|
|
3
|
+
skinColor: number;
|
|
4
|
+
eyeStyle: number;
|
|
5
|
+
eyeColor: number;
|
|
6
|
+
eyebrows: number;
|
|
7
|
+
nose: number;
|
|
8
|
+
mouth: number;
|
|
9
|
+
hairStyle: number;
|
|
10
|
+
hairColor: number;
|
|
11
|
+
accessory: number;
|
|
12
|
+
bgColor: number;
|
|
13
|
+
}
|
|
14
|
+
interface SolFaceTheme {
|
|
15
|
+
skinColors?: string[];
|
|
16
|
+
eyeColors?: string[];
|
|
17
|
+
hairColors?: string[];
|
|
18
|
+
bgColors?: string[];
|
|
19
|
+
mouthColor?: string;
|
|
20
|
+
eyebrowColor?: string;
|
|
21
|
+
accessoryColor?: string;
|
|
22
|
+
eyeWhiteColor?: string;
|
|
23
|
+
noseColor?: string;
|
|
24
|
+
bgOpacity?: number;
|
|
25
|
+
bgRadius?: number;
|
|
26
|
+
border?: {
|
|
27
|
+
color: string;
|
|
28
|
+
width: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
interface RenderOptions {
|
|
32
|
+
size?: number;
|
|
33
|
+
theme?: SolFaceTheme;
|
|
34
|
+
traitOverrides?: Partial<SolFaceTraits>;
|
|
35
|
+
enableBlink?: boolean | {
|
|
36
|
+
duration?: number;
|
|
37
|
+
delay?: number;
|
|
38
|
+
};
|
|
39
|
+
className?: string;
|
|
40
|
+
colorOverrides?: {
|
|
41
|
+
skin?: string;
|
|
42
|
+
eyes?: string;
|
|
43
|
+
hair?: string;
|
|
44
|
+
bg?: string;
|
|
45
|
+
mouth?: string;
|
|
46
|
+
eyebrow?: string;
|
|
47
|
+
accessory?: string;
|
|
48
|
+
nose?: string;
|
|
49
|
+
eyeWhite?: string;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
declare const SKIN_COLORS: string[];
|
|
53
|
+
declare const EYE_COLORS: string[];
|
|
54
|
+
declare const HAIR_COLORS: string[];
|
|
55
|
+
declare const BG_COLORS: string[];
|
|
56
|
+
declare function generateTraits(walletAddress: string, overrides?: Partial<SolFaceTraits>): SolFaceTraits;
|
|
57
|
+
declare function getTraitLabels(traits: SolFaceTraits): Record<string, string>;
|
|
58
|
+
declare function traitHash(walletAddress: string): string;
|
|
59
|
+
declare function resolveTheme(themeName?: string, themes?: Record<string, SolFaceTheme>): SolFaceTheme | undefined;
|
|
60
|
+
|
|
61
|
+
export { BG_COLORS as B, EYE_COLORS as E, HAIR_COLORS as H, type RenderOptions as R, SKIN_COLORS as S, type SolFaceTheme as a, type SolFaceTraits as b, getTraitLabels as c, generateTraits as g, resolveTheme as r, traitHash as t };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
interface SolFaceTraits {
|
|
2
|
+
faceShape: number;
|
|
3
|
+
skinColor: number;
|
|
4
|
+
eyeStyle: number;
|
|
5
|
+
eyeColor: number;
|
|
6
|
+
eyebrows: number;
|
|
7
|
+
nose: number;
|
|
8
|
+
mouth: number;
|
|
9
|
+
hairStyle: number;
|
|
10
|
+
hairColor: number;
|
|
11
|
+
accessory: number;
|
|
12
|
+
bgColor: number;
|
|
13
|
+
}
|
|
14
|
+
interface SolFaceTheme {
|
|
15
|
+
skinColors?: string[];
|
|
16
|
+
eyeColors?: string[];
|
|
17
|
+
hairColors?: string[];
|
|
18
|
+
bgColors?: string[];
|
|
19
|
+
mouthColor?: string;
|
|
20
|
+
eyebrowColor?: string;
|
|
21
|
+
accessoryColor?: string;
|
|
22
|
+
eyeWhiteColor?: string;
|
|
23
|
+
noseColor?: string;
|
|
24
|
+
bgOpacity?: number;
|
|
25
|
+
bgRadius?: number;
|
|
26
|
+
border?: {
|
|
27
|
+
color: string;
|
|
28
|
+
width: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
interface RenderOptions {
|
|
32
|
+
size?: number;
|
|
33
|
+
theme?: SolFaceTheme;
|
|
34
|
+
traitOverrides?: Partial<SolFaceTraits>;
|
|
35
|
+
enableBlink?: boolean | {
|
|
36
|
+
duration?: number;
|
|
37
|
+
delay?: number;
|
|
38
|
+
};
|
|
39
|
+
className?: string;
|
|
40
|
+
colorOverrides?: {
|
|
41
|
+
skin?: string;
|
|
42
|
+
eyes?: string;
|
|
43
|
+
hair?: string;
|
|
44
|
+
bg?: string;
|
|
45
|
+
mouth?: string;
|
|
46
|
+
eyebrow?: string;
|
|
47
|
+
accessory?: string;
|
|
48
|
+
nose?: string;
|
|
49
|
+
eyeWhite?: string;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
declare const SKIN_COLORS: string[];
|
|
53
|
+
declare const EYE_COLORS: string[];
|
|
54
|
+
declare const HAIR_COLORS: string[];
|
|
55
|
+
declare const BG_COLORS: string[];
|
|
56
|
+
declare function generateTraits(walletAddress: string, overrides?: Partial<SolFaceTraits>): SolFaceTraits;
|
|
57
|
+
declare function getTraitLabels(traits: SolFaceTraits): Record<string, string>;
|
|
58
|
+
declare function traitHash(walletAddress: string): string;
|
|
59
|
+
declare function resolveTheme(themeName?: string, themes?: Record<string, SolFaceTheme>): SolFaceTheme | undefined;
|
|
60
|
+
|
|
61
|
+
export { BG_COLORS as B, EYE_COLORS as E, HAIR_COLORS as H, type RenderOptions as R, SKIN_COLORS as S, type SolFaceTheme as a, type SolFaceTraits as b, getTraitLabels as c, generateTraits as g, resolveTheme as r, traitHash as t };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkH3SK3MNX_cjs = require('../chunk-H3SK3MNX.cjs');
|
|
4
|
+
require('../chunk-2DIKGLXZ.cjs');
|
|
5
|
+
var chunkCVFO7YHY_cjs = require('../chunk-CVFO7YHY.cjs');
|
|
6
|
+
|
|
7
|
+
// src/vanilla/index.ts
|
|
8
|
+
function mountSolFace(element, walletAddress, options) {
|
|
9
|
+
const el = typeof element === "string" ? document.querySelector(element) : element;
|
|
10
|
+
if (!el) {
|
|
11
|
+
console.warn(`[SolFaces] Element not found: ${element}`);
|
|
12
|
+
return () => {
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
el.innerHTML = chunkH3SK3MNX_cjs.renderSolFaceSVG(walletAddress, options);
|
|
16
|
+
return () => {
|
|
17
|
+
el.innerHTML = "";
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function setSolFaceImg(img, walletAddress, options) {
|
|
21
|
+
const el = typeof img === "string" ? document.querySelector(img) : img;
|
|
22
|
+
if (!el) return;
|
|
23
|
+
el.src = chunkH3SK3MNX_cjs.renderSolFaceDataURI(walletAddress, options);
|
|
24
|
+
el.alt = chunkH3SK3MNX_cjs.solFaceAltText(walletAddress);
|
|
25
|
+
}
|
|
26
|
+
function autoInit(root = document) {
|
|
27
|
+
const elements = root.querySelectorAll("[data-solface]");
|
|
28
|
+
elements.forEach((el) => {
|
|
29
|
+
const wallet = el.getAttribute("data-solface");
|
|
30
|
+
if (!wallet) return;
|
|
31
|
+
const size = parseInt(el.getAttribute("data-solface-size") ?? "64", 10);
|
|
32
|
+
const blink = el.getAttribute("data-solface-blink") === "true";
|
|
33
|
+
const themeName = el.getAttribute("data-solface-theme");
|
|
34
|
+
const theme = themeName && themeName in chunkCVFO7YHY_cjs.PRESET_THEMES ? chunkCVFO7YHY_cjs.PRESET_THEMES[themeName] : void 0;
|
|
35
|
+
mountSolFace(el, wallet, { size, enableBlink: blink, theme });
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
exports.autoInit = autoInit;
|
|
40
|
+
exports.mountSolFace = mountSolFace;
|
|
41
|
+
exports.setSolFaceImg = setSolFaceImg;
|
|
42
|
+
//# sourceMappingURL=index.cjs.map
|
|
43
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/vanilla/index.ts"],"names":["renderSolFaceSVG","renderSolFaceDataURI","solFaceAltText","PRESET_THEMES"],"mappings":";;;;;;;AAUO,SAAS,YAAA,CACd,OAAA,EACA,aAAA,EACA,OAAA,EACY;AACZ,EAAA,MAAM,KAAK,OAAO,OAAA,KAAY,WAC1B,QAAA,CAAS,aAAA,CAA2B,OAAO,CAAA,GAC3C,OAAA;AAEJ,EAAA,IAAI,CAAC,EAAA,EAAI;AACP,IAAA,OAAA,CAAQ,IAAA,CAAK,CAAA,8BAAA,EAAiC,OAAO,CAAA,CAAE,CAAA;AACvD,IAAA,OAAO,MAAM;AAAA,IAAC,CAAA;AAAA,EAChB;AAEA,EAAA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"index.cjs","sourcesContent":["// ═══════════════════════════════════════════════════════════════\n// SOLFACES — Vanilla DOM Helpers\n// Mount avatars directly into DOM elements without React.\n// ═══════════════════════════════════════════════════════════════\n\nimport { renderSolFaceSVG, renderSolFaceDataURI } from \"../core/renderer\";\nimport { solFaceAltText } from \"../core/describe\";\nimport { PRESET_THEMES } from \"../themes/presets\";\nimport type { RenderOptions } from \"../core/traits\";\n\nexport function mountSolFace(\n element: HTMLElement | string,\n walletAddress: string,\n options?: RenderOptions\n): () => void {\n const el = typeof element === \"string\"\n ? document.querySelector<HTMLElement>(element)\n : element;\n\n if (!el) {\n console.warn(`[SolFaces] Element not found: ${element}`);\n return () => {};\n }\n\n el.innerHTML = renderSolFaceSVG(walletAddress, options);\n return () => { el.innerHTML = \"\"; };\n}\n\nexport function setSolFaceImg(\n img: HTMLImageElement | string,\n walletAddress: string,\n options?: RenderOptions\n): void {\n const el = typeof img === \"string\"\n ? document.querySelector<HTMLImageElement>(img)\n : img;\n\n if (!el) return;\n el.src = renderSolFaceDataURI(walletAddress, options);\n el.alt = solFaceAltText(walletAddress);\n}\n\nexport function autoInit(root: HTMLElement | Document = document): void {\n const elements = root.querySelectorAll<HTMLElement>(\"[data-solface]\");\n elements.forEach((el) => {\n const wallet = el.getAttribute(\"data-solface\");\n if (!wallet) return;\n\n const size = parseInt(el.getAttribute(\"data-solface-size\") ?? \"64\", 10);\n const blink = el.getAttribute(\"data-solface-blink\") === \"true\";\n const themeName = el.getAttribute(\"data-solface-theme\") as string | null;\n\n const theme = themeName && themeName in PRESET_THEMES\n ? PRESET_THEMES[themeName as keyof typeof PRESET_THEMES]\n : undefined;\n\n mountSolFace(el, wallet, { size, enableBlink: blink, theme });\n });\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { R as RenderOptions } from '../traits-DAFZnXeS.cjs';
|
|
2
|
+
|
|
3
|
+
declare function mountSolFace(element: HTMLElement | string, walletAddress: string, options?: RenderOptions): () => void;
|
|
4
|
+
declare function setSolFaceImg(img: HTMLImageElement | string, walletAddress: string, options?: RenderOptions): void;
|
|
5
|
+
declare function autoInit(root?: HTMLElement | Document): void;
|
|
6
|
+
|
|
7
|
+
export { autoInit, mountSolFace, setSolFaceImg };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { R as RenderOptions } from '../traits-DAFZnXeS.js';
|
|
2
|
+
|
|
3
|
+
declare function mountSolFace(element: HTMLElement | string, walletAddress: string, options?: RenderOptions): () => void;
|
|
4
|
+
declare function setSolFaceImg(img: HTMLImageElement | string, walletAddress: string, options?: RenderOptions): void;
|
|
5
|
+
declare function autoInit(root?: HTMLElement | Document): void;
|
|
6
|
+
|
|
7
|
+
export { autoInit, mountSolFace, setSolFaceImg };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { renderSolFaceSVG, renderSolFaceDataURI, solFaceAltText } from '../chunk-KSGFMW33.js';
|
|
2
|
+
import '../chunk-WURY4QGH.js';
|
|
3
|
+
import { PRESET_THEMES } from '../chunk-LQWJRHGC.js';
|
|
4
|
+
|
|
5
|
+
// src/vanilla/index.ts
|
|
6
|
+
function mountSolFace(element, walletAddress, options) {
|
|
7
|
+
const el = typeof element === "string" ? document.querySelector(element) : element;
|
|
8
|
+
if (!el) {
|
|
9
|
+
console.warn(`[SolFaces] Element not found: ${element}`);
|
|
10
|
+
return () => {
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
el.innerHTML = renderSolFaceSVG(walletAddress, options);
|
|
14
|
+
return () => {
|
|
15
|
+
el.innerHTML = "";
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function setSolFaceImg(img, walletAddress, options) {
|
|
19
|
+
const el = typeof img === "string" ? document.querySelector(img) : img;
|
|
20
|
+
if (!el) return;
|
|
21
|
+
el.src = renderSolFaceDataURI(walletAddress, options);
|
|
22
|
+
el.alt = solFaceAltText(walletAddress);
|
|
23
|
+
}
|
|
24
|
+
function autoInit(root = document) {
|
|
25
|
+
const elements = root.querySelectorAll("[data-solface]");
|
|
26
|
+
elements.forEach((el) => {
|
|
27
|
+
const wallet = el.getAttribute("data-solface");
|
|
28
|
+
if (!wallet) return;
|
|
29
|
+
const size = parseInt(el.getAttribute("data-solface-size") ?? "64", 10);
|
|
30
|
+
const blink = el.getAttribute("data-solface-blink") === "true";
|
|
31
|
+
const themeName = el.getAttribute("data-solface-theme");
|
|
32
|
+
const theme = themeName && themeName in PRESET_THEMES ? PRESET_THEMES[themeName] : void 0;
|
|
33
|
+
mountSolFace(el, wallet, { size, enableBlink: blink, theme });
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { autoInit, mountSolFace, setSolFaceImg };
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/vanilla/index.ts"],"names":[],"mappings":";;;;;AAUO,SAAS,YAAA,CACd,OAAA,EACA,aAAA,EACA,OAAA,EACY;AACZ,EAAA,MAAM,KAAK,OAAO,OAAA,KAAY,WAC1B,QAAA,CAAS,aAAA,CAA2B,OAAO,CAAA,GAC3C,OAAA;AAEJ,EAAA,IAAI,CAAC,EAAA,EAAI;AACP,IAAA,OAAA,CAAQ,IAAA,CAAK,CAAA,8BAAA,EAAiC,OAAO,CAAA,CAAE,CAAA;AACvD,IAAA,OAAO,MAAM;AAAA,IAAC,CAAA;AAAA,EAChB;AAEA,EAAA,EAAA,CAAG,SAAA,GAAY,gBAAA,CAAiB,aAAA,EAAe,OAAO,CAAA;AACtD,EAAA,OAAO,MAAM;AAAE,IAAA,EAAA,CAAG,SAAA,GAAY,EAAA;AAAA,EAAI,CAAA;AACpC;AAEO,SAAS,aAAA,CACd,GAAA,EACA,aAAA,EACA,OAAA,EACM;AACN,EAAA,MAAM,KAAK,OAAO,GAAA,KAAQ,WACtB,QAAA,CAAS,aAAA,CAAgC,GAAG,CAAA,GAC5C,GAAA;AAEJ,EAAA,IAAI,CAAC,EAAA,EAAI;AACT,EAAA,EAAA,CAAG,GAAA,GAAM,oBAAA,CAAqB,aAAA,EAAe,OAAO,CAAA;AACpD,EAAA,EAAA,CAAG,GAAA,GAAM,eAAe,aAAa,CAAA;AACvC;AAEO,SAAS,QAAA,CAAS,OAA+B,QAAA,EAAgB;AACtE,EAAA,MAAM,QAAA,GAAW,IAAA,CAAK,gBAAA,CAA8B,gBAAgB,CAAA;AACpE,EAAA,QAAA,CAAS,OAAA,CAAQ,CAAC,EAAA,KAAO;AACvB,IAAA,MAAM,MAAA,GAAS,EAAA,CAAG,YAAA,CAAa,cAAc,CAAA;AAC7C,IAAA,IAAI,CAAC,MAAA,EAAQ;AAEb,IAAA,MAAM,OAAO,QAAA,CAAS,EAAA,CAAG,aAAa,mBAAmB,CAAA,IAAK,MAAM,EAAE,CAAA;AACtE,IAAA,MAAM,KAAA,GAAQ,EAAA,CAAG,YAAA,CAAa,oBAAoB,CAAA,KAAM,MAAA;AACxD,IAAA,MAAM,SAAA,GAAY,EAAA,CAAG,YAAA,CAAa,oBAAoB,CAAA;AAEtD,IAAA,MAAM,QAAQ,SAAA,IAAa,SAAA,IAAa,aAAA,GACpC,aAAA,CAAc,SAAuC,CAAA,GACrD,MAAA;AAEJ,IAAA,YAAA,CAAa,IAAI,MAAA,EAAQ,EAAE,MAAM,WAAA,EAAa,KAAA,EAAO,OAAO,CAAA;AAAA,EAC9D,CAAC,CAAA;AACH","file":"index.js","sourcesContent":["// ═══════════════════════════════════════════════════════════════\n// SOLFACES — Vanilla DOM Helpers\n// Mount avatars directly into DOM elements without React.\n// ═══════════════════════════════════════════════════════════════\n\nimport { renderSolFaceSVG, renderSolFaceDataURI } from \"../core/renderer\";\nimport { solFaceAltText } from \"../core/describe\";\nimport { PRESET_THEMES } from \"../themes/presets\";\nimport type { RenderOptions } from \"../core/traits\";\n\nexport function mountSolFace(\n element: HTMLElement | string,\n walletAddress: string,\n options?: RenderOptions\n): () => void {\n const el = typeof element === \"string\"\n ? document.querySelector<HTMLElement>(element)\n : element;\n\n if (!el) {\n console.warn(`[SolFaces] Element not found: ${element}`);\n return () => {};\n }\n\n el.innerHTML = renderSolFaceSVG(walletAddress, options);\n return () => { el.innerHTML = \"\"; };\n}\n\nexport function setSolFaceImg(\n img: HTMLImageElement | string,\n walletAddress: string,\n options?: RenderOptions\n): void {\n const el = typeof img === \"string\"\n ? document.querySelector<HTMLImageElement>(img)\n : img;\n\n if (!el) return;\n el.src = renderSolFaceDataURI(walletAddress, options);\n el.alt = solFaceAltText(walletAddress);\n}\n\nexport function autoInit(root: HTMLElement | Document = document): void {\n const elements = root.querySelectorAll<HTMLElement>(\"[data-solface]\");\n elements.forEach((el) => {\n const wallet = el.getAttribute(\"data-solface\");\n if (!wallet) return;\n\n const size = parseInt(el.getAttribute(\"data-solface-size\") ?? \"64\", 10);\n const blink = el.getAttribute(\"data-solface-blink\") === \"true\";\n const themeName = el.getAttribute(\"data-solface-theme\") as string | null;\n\n const theme = themeName && themeName in PRESET_THEMES\n ? PRESET_THEMES[themeName as keyof typeof PRESET_THEMES]\n : undefined;\n\n mountSolFace(el, wallet, { size, enableBlink: blink, theme });\n });\n}\n"]}
|