feat: copy/pasting for elements

This commit is contained in:
Maze Winther
2025-08-28 22:37:51 +02:00
parent 70a9bfebb1
commit a7d90f7eac
6 changed files with 136 additions and 7 deletions
+17
View File
@@ -202,6 +202,23 @@ export function useEditorActions() {
undefined
);
useActionHandler(
"copy-selected",
() => {
if (selectedElements.length === 0) return;
useTimelineStore.getState().copySelected();
},
undefined
);
useActionHandler(
"paste-selected",
() => {
useTimelineStore.getState().pasteAtTime(currentTime);
},
undefined
);
useActionHandler(
"toggle-snapping",
() => {
@@ -63,6 +63,14 @@ const actionDescriptions: Record<
"toggle-snapping": { description: "Toggle snapping", category: "Editing" },
undo: { description: "Undo", category: "History" },
redo: { description: "Redo", category: "History" },
"copy-selected": {
description: "Copy selected elements",
category: "Editing",
},
"paste-selected": {
description: "Paste elements at playhead",
category: "Editing",
},
};
// Convert key binding format to display format