From ea946b04e6e4d6717c3aeeecb980730876bd9e20 Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Sat, 28 Feb 2026 17:58:55 +0300 Subject: [PATCH] Add right-click context menu with full Figma-style actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CanvasContextMenu: reka-ui ContextMenu with dark theme matching editor - Clipboard: Copy, Cut, Paste here, Duplicate, Delete - Z-order: Bring to front (]), Send to back ([) - Move to page: submenu listing all other pages - Grouping: Group (⌘G), Ungroup (⇧⌘G), Add auto layout (⇧A) - Components: Create component (⌥⌘K), Create component set (⇧⌘K), Create instance, Go to main component, Detach instance (⌥⌘B) — component items styled in purple - Visibility: Show/Hide (⇧⌘H), Lock/Unlock (⇧⌘L) - Context-aware: items show/hide based on selection type and count - Right-click selects node under cursor before showing menu - Store: bringToFront, sendToBack, toggleVisibility, toggleLock, moveToPage, renameNode operations - Keyboard: ], [, ⇧⌘H, ⇧⌘L shortcuts --- src/components/CanvasContextMenu.vue | 323 +++++++++++++++++++++++++++ src/components/EditorCanvas.vue | 3 + src/composables/use-canvas-input.ts | 13 ++ src/composables/use-keyboard.ts | 21 ++ src/stores/editor.ts | 68 ++++++ 5 files changed, 428 insertions(+) create mode 100644 src/components/CanvasContextMenu.vue diff --git a/src/components/CanvasContextMenu.vue b/src/components/CanvasContextMenu.vue new file mode 100644 index 000000000..252e30581 --- /dev/null +++ b/src/components/CanvasContextMenu.vue @@ -0,0 +1,323 @@ + + + + + diff --git a/src/components/EditorCanvas.vue b/src/components/EditorCanvas.vue index 77aa58eed..ccd974a51 100644 --- a/src/components/EditorCanvas.vue +++ b/src/components/EditorCanvas.vue @@ -4,6 +4,7 @@ import { ref, computed } from 'vue' import { useCanvas } from '../composables/use-canvas' import { useCanvasInput } from '../composables/use-canvas-input' import { useEditorStore } from '../stores/editor' +import CanvasContextMenu from './CanvasContextMenu.vue' const store = useEditorStore() const canvasRef = ref(null) @@ -66,6 +67,7 @@ function onTextKeyDown(e: KeyboardEvent) {