- 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})
15 lines
633 B
TypeScript
15 lines
633 B
TypeScript
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' })
|
||
}
|