solfaces 1.0.1 → 2.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.
Files changed (69) hide show
  1. package/README.md +359 -87
  2. package/dist/agent/index.cjs +14 -14
  3. package/dist/agent/index.js +4 -4
  4. package/dist/agent/mcp-server.cjs +716 -277
  5. package/dist/{chunk-VMNATBH3.cjs → chunk-23XJ5VDX.cjs} +37 -27
  6. package/dist/chunk-23XJ5VDX.cjs.map +1 -0
  7. package/dist/chunk-46ZEFA6R.cjs +243 -0
  8. package/dist/chunk-46ZEFA6R.cjs.map +1 -0
  9. package/dist/{chunk-A6N3RPEA.cjs → chunk-546TBMAR.cjs} +6 -6
  10. package/dist/{chunk-A6N3RPEA.cjs.map → chunk-546TBMAR.cjs.map} +1 -1
  11. package/dist/chunk-6QRDULAO.cjs +191 -0
  12. package/dist/chunk-6QRDULAO.cjs.map +1 -0
  13. package/dist/chunk-6UWILY7E.cjs +647 -0
  14. package/dist/chunk-6UWILY7E.cjs.map +1 -0
  15. package/dist/chunk-DRUSCLEF.js +177 -0
  16. package/dist/chunk-DRUSCLEF.js.map +1 -0
  17. package/dist/chunk-HCEE4K4T.js +625 -0
  18. package/dist/chunk-HCEE4K4T.js.map +1 -0
  19. package/dist/chunk-JS527VKL.js +238 -0
  20. package/dist/chunk-JS527VKL.js.map +1 -0
  21. package/dist/{chunk-SNJABBAT.js → chunk-LRHYF5QN.js} +3 -3
  22. package/dist/{chunk-SNJABBAT.js.map → chunk-LRHYF5QN.js.map} +1 -1
  23. package/dist/{chunk-RX6D5FGH.js → chunk-TTGJZEPV.js} +30 -20
  24. package/dist/chunk-TTGJZEPV.js.map +1 -0
  25. package/dist/core/index.cjs +69 -29
  26. package/dist/core/index.d.cts +29 -47
  27. package/dist/core/index.d.ts +29 -47
  28. package/dist/core/index.js +3 -3
  29. package/dist/index.cjs +75 -35
  30. package/dist/index.d.cts +2 -2
  31. package/dist/index.d.ts +2 -2
  32. package/dist/index.js +5 -5
  33. package/dist/react/index.cjs +431 -397
  34. package/dist/react/index.cjs.map +1 -1
  35. package/dist/react/index.d.cts +3 -2
  36. package/dist/react/index.d.ts +3 -2
  37. package/dist/react/index.js +427 -393
  38. package/dist/react/index.js.map +1 -1
  39. package/dist/solfaces.cdn.global.js +2 -2
  40. package/dist/solfaces.cdn.global.js.map +1 -1
  41. package/dist/themes/index.cjs +29 -17
  42. package/dist/themes/index.d.cts +10 -7
  43. package/dist/themes/index.d.ts +10 -7
  44. package/dist/themes/index.js +1 -1
  45. package/dist/{traits-DAFZnXeS.d.cts → traits-QlWuxZDD.d.cts} +45 -1
  46. package/dist/{traits-DAFZnXeS.d.ts → traits-QlWuxZDD.d.ts} +45 -1
  47. package/dist/vanilla/index.cjs +20 -8
  48. package/dist/vanilla/index.cjs.map +1 -1
  49. package/dist/vanilla/index.d.cts +1 -1
  50. package/dist/vanilla/index.d.ts +1 -1
  51. package/dist/vanilla/index.js +17 -5
  52. package/dist/vanilla/index.js.map +1 -1
  53. package/package.json +1 -2
  54. package/python/solfaces.py +557 -235
  55. package/skill.md +210 -65
  56. package/dist/chunk-2DIKGLXZ.cjs +0 -126
  57. package/dist/chunk-2DIKGLXZ.cjs.map +0 -1
  58. package/dist/chunk-CVFO7YHY.cjs +0 -97
  59. package/dist/chunk-CVFO7YHY.cjs.map +0 -1
  60. package/dist/chunk-H3SK3MNX.cjs +0 -409
  61. package/dist/chunk-H3SK3MNX.cjs.map +0 -1
  62. package/dist/chunk-KSGFMW33.js +0 -401
  63. package/dist/chunk-KSGFMW33.js.map +0 -1
  64. package/dist/chunk-LQWJRHGC.js +0 -86
  65. package/dist/chunk-LQWJRHGC.js.map +0 -1
  66. package/dist/chunk-RX6D5FGH.js.map +0 -1
  67. package/dist/chunk-VMNATBH3.cjs.map +0 -1
  68. package/dist/chunk-WURY4QGH.js +0 -117
  69. package/dist/chunk-WURY4QGH.js.map +0 -1
@@ -21,12 +21,53 @@ interface SolFaceTheme {
21
21
  accessoryColor?: string;
22
22
  eyeWhiteColor?: string;
23
23
  noseColor?: string;
24
+ glassesColor?: string;
25
+ earringColor?: string;
26
+ headbandColor?: string;
24
27
  bgOpacity?: number;
25
28
  bgRadius?: number;
26
29
  border?: {
27
30
  color: string;
28
31
  width: number;
29
32
  };
33
+ flat?: boolean;
34
+ cheekEnabled?: boolean;
35
+ cheekColor?: string;
36
+ cheekOpacity?: number;
37
+ skinOpacity?: number;
38
+ shadowEnabled?: boolean;
39
+ _pixel?: boolean;
40
+ _pixelDensity?: number;
41
+ _pixelRounded?: boolean;
42
+ _pixelOutline?: boolean;
43
+ _pixelOutlineColor?: string;
44
+ _pixelOutlineWidth?: number;
45
+ _pixelContrast?: number;
46
+ _pixelSaturation?: number;
47
+ _pixelBrightness?: number;
48
+ _pixelScanlines?: boolean;
49
+ _pixelScanlineOpacity?: number;
50
+ _pixelScanlineSpacing?: number;
51
+ _pixelGrid?: boolean;
52
+ _pixelGridOpacity?: number;
53
+ _pixelGridColor?: string;
54
+ _pixelShadow?: boolean;
55
+ _pixelShadowColor?: string;
56
+ _pixelShadowOffset?: number;
57
+ _glass?: boolean;
58
+ _blurRadius?: number;
59
+ _saturate?: number;
60
+ _tintOpacity?: number;
61
+ _tintColor?: string;
62
+ _borderOpacity?: number;
63
+ _borderWidth?: number;
64
+ _borderColor?: string;
65
+ _specularOpacity?: number;
66
+ _specularColor?: string;
67
+ _specularEnd?: number;
68
+ _lightAngle?: number;
69
+ _rimIntensity?: number;
70
+ _shadow?: string;
30
71
  }
31
72
  interface RenderOptions {
32
73
  size?: number;
@@ -37,6 +78,7 @@ interface RenderOptions {
37
78
  delay?: number;
38
79
  };
39
80
  className?: string;
81
+ detail?: "full" | "simplified" | "auto";
40
82
  colorOverrides?: {
41
83
  skin?: string;
42
84
  eyes?: string;
@@ -54,8 +96,10 @@ declare const EYE_COLORS: string[];
54
96
  declare const HAIR_COLORS: string[];
55
97
  declare const BG_COLORS: string[];
56
98
  declare function generateTraits(walletAddress: string, overrides?: Partial<SolFaceTraits>): SolFaceTraits;
99
+ declare function effectiveAccessory(traits: SolFaceTraits): number;
57
100
  declare function getTraitLabels(traits: SolFaceTraits): Record<string, string>;
58
101
  declare function traitHash(walletAddress: string): string;
59
102
  declare function resolveTheme(themeName?: string, themes?: Record<string, SolFaceTheme>): SolFaceTheme | undefined;
103
+ declare function mergeTheme(base: SolFaceTheme | null | undefined, overrides: SolFaceTheme | null | undefined): SolFaceTheme | null;
60
104
 
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 };
105
+ 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, effectiveAccessory as e, generateTraits as g, mergeTheme as m, resolveTheme as r, traitHash as t };
@@ -21,12 +21,53 @@ interface SolFaceTheme {
21
21
  accessoryColor?: string;
22
22
  eyeWhiteColor?: string;
23
23
  noseColor?: string;
24
+ glassesColor?: string;
25
+ earringColor?: string;
26
+ headbandColor?: string;
24
27
  bgOpacity?: number;
25
28
  bgRadius?: number;
26
29
  border?: {
27
30
  color: string;
28
31
  width: number;
29
32
  };
33
+ flat?: boolean;
34
+ cheekEnabled?: boolean;
35
+ cheekColor?: string;
36
+ cheekOpacity?: number;
37
+ skinOpacity?: number;
38
+ shadowEnabled?: boolean;
39
+ _pixel?: boolean;
40
+ _pixelDensity?: number;
41
+ _pixelRounded?: boolean;
42
+ _pixelOutline?: boolean;
43
+ _pixelOutlineColor?: string;
44
+ _pixelOutlineWidth?: number;
45
+ _pixelContrast?: number;
46
+ _pixelSaturation?: number;
47
+ _pixelBrightness?: number;
48
+ _pixelScanlines?: boolean;
49
+ _pixelScanlineOpacity?: number;
50
+ _pixelScanlineSpacing?: number;
51
+ _pixelGrid?: boolean;
52
+ _pixelGridOpacity?: number;
53
+ _pixelGridColor?: string;
54
+ _pixelShadow?: boolean;
55
+ _pixelShadowColor?: string;
56
+ _pixelShadowOffset?: number;
57
+ _glass?: boolean;
58
+ _blurRadius?: number;
59
+ _saturate?: number;
60
+ _tintOpacity?: number;
61
+ _tintColor?: string;
62
+ _borderOpacity?: number;
63
+ _borderWidth?: number;
64
+ _borderColor?: string;
65
+ _specularOpacity?: number;
66
+ _specularColor?: string;
67
+ _specularEnd?: number;
68
+ _lightAngle?: number;
69
+ _rimIntensity?: number;
70
+ _shadow?: string;
30
71
  }
31
72
  interface RenderOptions {
32
73
  size?: number;
@@ -37,6 +78,7 @@ interface RenderOptions {
37
78
  delay?: number;
38
79
  };
39
80
  className?: string;
81
+ detail?: "full" | "simplified" | "auto";
40
82
  colorOverrides?: {
41
83
  skin?: string;
42
84
  eyes?: string;
@@ -54,8 +96,10 @@ declare const EYE_COLORS: string[];
54
96
  declare const HAIR_COLORS: string[];
55
97
  declare const BG_COLORS: string[];
56
98
  declare function generateTraits(walletAddress: string, overrides?: Partial<SolFaceTraits>): SolFaceTraits;
99
+ declare function effectiveAccessory(traits: SolFaceTraits): number;
57
100
  declare function getTraitLabels(traits: SolFaceTraits): Record<string, string>;
58
101
  declare function traitHash(walletAddress: string): string;
59
102
  declare function resolveTheme(themeName?: string, themes?: Record<string, SolFaceTheme>): SolFaceTheme | undefined;
103
+ declare function mergeTheme(base: SolFaceTheme | null | undefined, overrides: SolFaceTheme | null | undefined): SolFaceTheme | null;
60
104
 
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 };
105
+ 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, effectiveAccessory as e, generateTraits as g, mergeTheme as m, resolveTheme as r, traitHash as t };
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkH3SK3MNX_cjs = require('../chunk-H3SK3MNX.cjs');
4
- require('../chunk-2DIKGLXZ.cjs');
5
- var chunkCVFO7YHY_cjs = require('../chunk-CVFO7YHY.cjs');
3
+ var chunk46ZEFA6R_cjs = require('../chunk-46ZEFA6R.cjs');
4
+ var chunk6UWILY7E_cjs = require('../chunk-6UWILY7E.cjs');
5
+ var chunk6QRDULAO_cjs = require('../chunk-6QRDULAO.cjs');
6
6
 
7
7
  // src/vanilla/index.ts
8
8
  function mountSolFace(element, walletAddress, options) {
@@ -12,7 +12,7 @@ function mountSolFace(element, walletAddress, options) {
12
12
  return () => {
13
13
  };
14
14
  }
15
- el.innerHTML = chunkH3SK3MNX_cjs.renderSolFaceSVG(walletAddress, options);
15
+ el.innerHTML = chunk6UWILY7E_cjs.renderSolFaceSVG(walletAddress, options);
16
16
  return () => {
17
17
  el.innerHTML = "";
18
18
  };
@@ -20,8 +20,8 @@ function mountSolFace(element, walletAddress, options) {
20
20
  function setSolFaceImg(img, walletAddress, options) {
21
21
  const el = typeof img === "string" ? document.querySelector(img) : img;
22
22
  if (!el) return;
23
- el.src = chunkH3SK3MNX_cjs.renderSolFaceDataURI(walletAddress, options);
24
- el.alt = chunkH3SK3MNX_cjs.solFaceAltText(walletAddress);
23
+ el.src = chunk6UWILY7E_cjs.renderSolFaceDataURI(walletAddress, options);
24
+ el.alt = chunk46ZEFA6R_cjs.solFaceAltText(walletAddress);
25
25
  }
26
26
  function autoInit(root = document) {
27
27
  const elements = root.querySelectorAll("[data-solface]");
@@ -31,8 +31,20 @@ function autoInit(root = document) {
31
31
  const size = parseInt(el.getAttribute("data-solface-size") ?? "64", 10);
32
32
  const blink = el.getAttribute("data-solface-blink") === "true";
33
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 });
34
+ const flat = el.getAttribute("data-solface-flat") === "true";
35
+ const detail = el.getAttribute("data-solface-detail");
36
+ let theme = themeName && themeName in chunk6QRDULAO_cjs.PRESET_THEMES ? chunk6QRDULAO_cjs.PRESET_THEMES[themeName] : void 0;
37
+ if (flat && theme) {
38
+ theme = { ...theme, flat: true };
39
+ } else if (flat) {
40
+ theme = { flat: true };
41
+ }
42
+ mountSolFace(el, wallet, {
43
+ size,
44
+ enableBlink: blink,
45
+ theme,
46
+ detail: detail ?? "auto"
47
+ });
36
48
  });
37
49
  }
38
50
 
@@ -1 +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,EAAA,CAAG,SAAA,GAAYA,kCAAA,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,GAAMC,sCAAA,CAAqB,aAAA,EAAe,OAAO,CAAA;AACpD,EAAA,EAAA,CAAG,GAAA,GAAMC,iCAAe,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,IAAaC,+BAAA,GACpCA,+BAAA,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.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"]}
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,EAAA,CAAG,SAAA,GAAYA,kCAAA,CAAiB,aAAA,EAAe,OAAO,CAAA;AACtD,EAAA,O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A,GAAQ,EAAE,GAAG,KAAA,EAAO,IAAA,EAAM,IAAA,EAAK;AAAA,IACjC,WAAW,IAAA,EAAM;AACf,MAAA,KAAA,GAAQ,EAAE,MAAM,IAAA,EAAK;AAAA,IACvB;AAEA,IAAA,YAAA,CAAa,IAAI,MAAA,EAAQ;AAAA,MACvB,IAAA;AAAA,MACA,WAAA,EAAa,KAAA;AAAA,MACb,KAAA;AAAA,MACA,QAAQ,MAAA,IAAU;AAAA,KACnB,CAAA;AAAA,EACH,CAAC,CAAA;AACH","file":"index.cjs","sourcesContent":["// ═══════════════════════════════════════════════════════════════\n// SOLFACES v2 — 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 const flat = el.getAttribute(\"data-solface-flat\") === \"true\";\n const detail = el.getAttribute(\"data-solface-detail\") as \"full\" | \"simplified\" | \"auto\" | null;\n\n let theme = themeName && themeName in PRESET_THEMES\n ? PRESET_THEMES[themeName as keyof typeof PRESET_THEMES]\n : undefined;\n\n // data-solface-flat overrides theme flat setting\n if (flat && theme) {\n theme = { ...theme, flat: true };\n } else if (flat) {\n theme = { flat: true };\n }\n\n mountSolFace(el, wallet, {\n size,\n enableBlink: blink,\n theme,\n detail: detail ?? \"auto\",\n });\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { R as RenderOptions } from '../traits-DAFZnXeS.cjs';
1
+ import { R as RenderOptions } from '../traits-QlWuxZDD.cjs';
2
2
 
3
3
  declare function mountSolFace(element: HTMLElement | string, walletAddress: string, options?: RenderOptions): () => void;
4
4
  declare function setSolFaceImg(img: HTMLImageElement | string, walletAddress: string, options?: RenderOptions): void;
@@ -1,4 +1,4 @@
1
- import { R as RenderOptions } from '../traits-DAFZnXeS.js';
1
+ import { R as RenderOptions } from '../traits-QlWuxZDD.js';
2
2
 
3
3
  declare function mountSolFace(element: HTMLElement | string, walletAddress: string, options?: RenderOptions): () => void;
4
4
  declare function setSolFaceImg(img: HTMLImageElement | string, walletAddress: string, options?: RenderOptions): void;
@@ -1,6 +1,6 @@
1
- import { renderSolFaceSVG, renderSolFaceDataURI, solFaceAltText } from '../chunk-KSGFMW33.js';
2
- import '../chunk-WURY4QGH.js';
3
- import { PRESET_THEMES } from '../chunk-LQWJRHGC.js';
1
+ import { solFaceAltText } from '../chunk-JS527VKL.js';
2
+ import { renderSolFaceSVG, renderSolFaceDataURI } from '../chunk-HCEE4K4T.js';
3
+ import { PRESET_THEMES } from '../chunk-DRUSCLEF.js';
4
4
 
5
5
  // src/vanilla/index.ts
6
6
  function mountSolFace(element, walletAddress, options) {
@@ -29,8 +29,20 @@ function autoInit(root = document) {
29
29
  const size = parseInt(el.getAttribute("data-solface-size") ?? "64", 10);
30
30
  const blink = el.getAttribute("data-solface-blink") === "true";
31
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 });
32
+ const flat = el.getAttribute("data-solface-flat") === "true";
33
+ const detail = el.getAttribute("data-solface-detail");
34
+ let theme = themeName && themeName in PRESET_THEMES ? PRESET_THEMES[themeName] : void 0;
35
+ if (flat && theme) {
36
+ theme = { ...theme, flat: true };
37
+ } else if (flat) {
38
+ theme = { flat: true };
39
+ }
40
+ mountSolFace(el, wallet, {
41
+ size,
42
+ enableBlink: blink,
43
+ theme,
44
+ detail: detail ?? "auto"
45
+ });
34
46
  });
35
47
  }
36
48
 
@@ -1 +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"]}
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,IAA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AAO,IAAA,EAAM,IAAA,EAAK;AAAA,IACjC,WAAW,IAAA,EAAM;AACf,MAAA,KAAA,GAAQ,EAAE,MAAM,IAAA,EAAK;AAAA,IACvB;AAEA,IAAA,YAAA,CAAa,IAAI,MAAA,EAAQ;AAAA,MACvB,IAAA;AAAA,MACA,WAAA,EAAa,KAAA;AAAA,MACb,KAAA;AAAA,MACA,QAAQ,MAAA,IAAU;AAAA,KACnB,CAAA;AAAA,EACH,CAAC,CAAA;AACH","file":"index.js","sourcesContent":["// ═══════════════════════════════════════════════════════════════\n// SOLFACES v2 — 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 const flat = el.getAttribute(\"data-solface-flat\") === \"true\";\n const detail = el.getAttribute(\"data-solface-detail\") as \"full\" | \"simplified\" | \"auto\" | null;\n\n let theme = themeName && themeName in PRESET_THEMES\n ? PRESET_THEMES[themeName as keyof typeof PRESET_THEMES]\n : undefined;\n\n // data-solface-flat overrides theme flat setting\n if (flat && theme) {\n theme = { ...theme, flat: true };\n } else if (flat) {\n theme = { flat: true };\n }\n\n mountSolFace(el, wallet, {\n size,\n enableBlink: blink,\n theme,\n detail: detail ?? \"auto\",\n });\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solfaces",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "description": "Deterministic wallet avatars for the Solana ecosystem. Zero-dependency trait engine with React, vanilla JS, and server-side rendering support.",
5
5
  "author": "https://github.com/jorger3301",
6
6
  "license": "MIT",
@@ -8,7 +8,6 @@
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/jorger3301/solfaces.git"
10
10
  },
11
- "homepage": "https://solfaces.dev",
12
11
  "keywords": [
13
12
  "solana",
14
13
  "avatar",