mirror of
https://github.com/hanzoai/extension.git
synced 2026-10-31 21:57:06 +00:00
New @hanzo/figma package: a Figma + FigJam plugin that rewrites, translates, content-fills, critiques (with a11y notes), renames layers, and generates copy variants for the selected layers — built on the published @hanzo/ai headless client against api.hanzo.ai. Two-thread architecture per the Figma plugin model: - code.ts (main): serializes the selection into a plain SelectionSnapshot (text nodes + structure + colors, node-budgeted) and applies write-backs (font-loaded setCharacters, rename, createText) — full figma.* access, no net. - ui.ts (iframe): the only place the model is called; streams via design-core, parses per action, posts edits/inserts back to code.ts over a typed postMessage protocol (messaging.ts). - design-core.ts (PURE): the design-action catalog (system+user prompt builders per action), selection->context assembly + budget truncation, response parsing (JSON id->value edit maps with id allow-listing, variant-list splitting), and the @hanzo/ai run funnels over an injectable client. Key pasted in the UI, validated via /v1/models, stored in figma.clientStorage; manifest networkAccess allowlists only api.hanzo.ai. esbuild build emits the three Figma files (code.js IIFE, ui.html with JS+CSS inlined, manifest.json). 56 vitest tests green (design-core + messaging guards); tsc --noEmit clean.
16 lines
395 B
JSON
16 lines
395 B
JSON
{
|
|
"compilerOptions": {
|
|
"target": "ES2020",
|
|
"module": "ESNext",
|
|
"moduleResolution": "bundler",
|
|
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
"strict": true,
|
|
"noEmit": true,
|
|
"esModuleInterop": true,
|
|
"skipLibCheck": true,
|
|
"forceConsistentCasingInFileNames": true,
|
|
"types": ["@figma/plugin-typings", "node"]
|
|
},
|
|
"include": ["src/**/*.ts", "tests/**/*.ts"]
|
|
}
|