Files
figma-ai-plugin/src/main.ts
T
Hermes Agent 26d391f90a fix: drag works from first attempt + size in window header
- ui.tsx: pass min/max opts to useWindowResize (fixes first-drag bug)
- ui.tsx: move live size to top toolbar (left of expand button)
- main.ts: set figma window title with startup size via showUI({title})
2026-09-09 12:50:35 +02:00

15 lines
633 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { emit, on, showUI } from '@create-figma-plugin/utilities'
export default function () {
// Глобальный ярлык relaunch в правой панели Figma (команда runAI из manifest.json)
figma.root.setRelaunchData({ runAI: '' })
// Ресайз окна плагина (drag за угол в UI -> useWindowResize -> RESIZE_WINDOW)
on('RESIZE_WINDOW', function (windowSize: { width: number; height: number }) {
const { width, height } = windowSize
figma.ui.resize(width, height)
})
showUI({ width: 320, height: 200, themeColors: true, title: 'AI assistant (MVP) — 320×200' })
}