feat: window docking buttons (left/center/right) via figma.ui.reposition

- main.ts: add DOCK_WINDOW handler using figma.viewport.bounds + figma.ui.resize/reposition
- ui.tsx: add dock buttons (Left/Center/Right) + keep expand/collapse + drag handle
This commit is contained in:
Hermes Agent committed 2026-09-09 13:08:11 +02:00
1 parent f3575e30ee
commit bc9b2e60e9
2 files changed
+32

No files matched your search

+14
View File
@@ -4,6 +4,7 @@ import {
Text,
Muted,
VerticalSpace,
Button,
IconButton,
IconExpand24,
IconCollapse24,
@@ -58,6 +59,14 @@ function Plugin () {
emit('RESIZE_WINDOW', next)
}
function dockWindow (position: 'left' | 'right' | 'center') {
emit('DOCK_WINDOW', {
position,
width: currentWindowSize.width,
height: currentWindowSize.height
})
}
const isMaximized =
currentWindowSize.width >= MAX_WINDOW_SIZE.width &&
currentWindowSize.height >= MAX_WINDOW_SIZE.height
@@ -74,6 +83,11 @@ function Plugin () {
{isMaximized ? <IconCollapse24 /> : <IconExpand24 />}
</IconButton>
</div>
<div style={{ display: 'flex', gap: '4px', flexWrap: 'wrap' }}>
<Button onClick={function () { dockWindow('left') }}>◧ Лево</Button>
<Button onClick={function () { dockWindow('center') }}>▣ Центр</Button>
<Button onClick={function () { dockWindow('right') }}>Право ◨</Button>
</div>
<div
style={{
flex: 1,