Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

First implementation of copy

446f6e6e795293b9985761
diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx
index 445a09060..5f9ec0f26 100644
--- a/src/components/video-editor/VideoEditor.tsx
+++ b/src/components/video-editor/VideoEditor.tsx
@@ -87,6 +87,16 @@ import {
toFileUrl,
validateProjectData,
} from "./projectPersistence";
+import {
+ applyAnnotationAttributes,
+ applySpeedAttributes,
+ applyZoomAttributes,
+ buildPastedAnnotation,
+ type CopiedRegion,
+ extractAnnotationAttributes,
+ extractSpeedAttributes,
+ extractZoomAttributes,
+} from "./regionClipboard";
import { SettingsPanel } from "./SettingsPanel";
import TimelineEditor from "./timeline/TimelineEditor";
import { buildAutoZoomSuggestions } from "./timeline/zoomSuggestionUtils";
@@ -300,6 +310,9 @@ export default function VideoEditor() {
const nextTrimIdRef = useRef(1);
const nextSpeedIdRef = useRef(1);
+ // Session clipboard for "copy/paste region attributes" (not undoable, not persisted).
+ const regionClipboardRef = useRef<CopiedRegion | null>(null);
+
const { shortcuts, isMac } = useShortcuts();
// Windows recordings include captured cursor assets. macOS hides the system
// cursor in ScreenCaptureKit and renders telemetry samples with OpenScreen's
@@ -1640,6 +1653,174 @@ export default function VideoEditor() {
[pushState],
);
+ const handleCopySelected = useCallback(() => {
+ if (selectedZoomId) {
+ const region = zoomRegions.find((r) => r.id === selectedZoomId);
+ if (region) {
+ regionClipboardRef.current = extractZoomAttributes(region);
+ toast.success(t("regionClipboard.copied", { region: t("regionClipboard.kinds.zoom") }));
+ }
+ return;
+ }
+ if (selectedSpeedId) {
+ const region = speedRegions.find((r) => r.id === selectedSpeedId);
+ if (region) {
+ regionClipboardRef.current = extractSpeedAttributes(region);
+ toast.success(t("regionClipboard.copied", { region: t("regionClipboard.kinds.speed") }));
+ }
+ return;
+ }
+ if (selectedAnnotationId) {
+ const region = annotationRegions.find((r) => r.id === selectedAnnotationId);
+ if (region) {
+ regionClipboardRef.current = extractAnnotationAttributes(region);
+ toast.success(
+ t("regionClipboard.copied", { region: t("regionClipboard.kinds.annotation") }),
+ );
+ }
+ return;
+ }
+ toast.info(t("regionClipboard.nothingToCopy"));
+ }, [
+ selectedZoomId,
+ selectedSpeedId,
+ selectedAnnotationId,
+ zoomRegions,
+ speedRegions,
+ annotationRegions,
+ t,
+ ]);
+
+ const handlePaste = useCallback(() => {
+ const copied = regionClipboardRef.current;
+ // If there's nothing in the clipboard, show a message and return early.
+ if (!copied) {
+ toast.info(t("regionClipboard.nothingToPaste"));
+ return;
+ }
+
+ const regionLabel = t(`regionClipboard.kinds.${copied.kind}`);
+ const pastedToast = () => toast.success(t("regionClipboard.pasted", { region: regionLabel }));
+
+ // Apply onto the selected region of the same kind, keeping its timing.
+ if (copied.kind === "zoom" && selectedZoomId) {
+ pushState((prev) => ({
+ zoomRegions: prev.zoomRegions.map((r) =>
+ r.id === selectedZoomId ? applyZoomAttributes(r, copied) : r,
+ ),
+ }));
+ pastedToast();
+ return;
+ }
+ if (copied.kind === "speed" && selectedSpeedId) {
+ pushState((prev) => ({
+ speedRegions: prev.speedRegions.map((r) =>
+ r.id === selectedSpeedId ? applySpeedAttributes(r, copied) : r,
+ ),
+ }));
+ pastedToast();
+ return;
+ }
+ if (copied.kind === "annotation" && selectedAnnotationId) {
+ pushState((prev) => ({
+ annotationRegions: prev.annotationRegions.map((r) =>
+ r.id === selectedAnnotationId ? applyAnnotationAttributes(r, copied) : r,
+ ),
+ }));
+ pastedToast();
+ return;
+ }
+
+ // Nothing matching selected → create a new region at the playhead.
+ const totalMs = Math.round(duration * 1000);
+ if (totalMs <= 0) return;
+ const defaultDuration = Math.min(Math.max(1000, Math.round(totalMs * 0.05)), totalMs);
+ const startPos = Math.max(0, Math.min(Math.round(currentTime * 1000), totalMs));
+
+ if (copied.kind === "zoom") {
+ const sorted = [...zoomRegions].sort((a, b) => a.startMs - b.startMs);
+ const nextRegion = sorted.find((r) => r.startMs > startPos);
+ const gapToNext = nextRegion ? nextRegion.startMs - startPos : totalMs - startPos;
+ const overlapping = sorted.some((r) => startPos >= r.startMs && startPos < r.endMs);
+
+ if (overlapping || gapToNext <= 0) {
+ toast.error(t("regionClipboard.cannotPlace"));
+ return;
+ }
+ const id = `zoom-${nextZoomIdRef.current++}`;
+ const region = applyZoomAttributes(
+ {
+ id,
+ startMs: startPos,
+ endMs: startPos + Math.min(defaultDuration, gapToNext),
+ depth: DEFAULT_ZOOM_DEPTH,
+ focus: { cx: 0.5, cy: 0.5 },
+ source: "manual",
+ },
+ copied,
+ );
+ pushState((prev) => ({ zoomRegions: [...prev.zoomRegions, region] }));
+ handleSelectZoom(id);
+ pastedToast();
+ return;
+ }
+
+ if (copied.kind === "speed") {
+ const sorted = [...speedRegions].sort((a, b) => a.startMs - b.startMs);
+ const nextRegion = sorted.find((r) => r.startMs > startPos);
+ const gapToNext = nextRegion ? nextRegion.startMs - startPos : totalMs - startPos;
+ const overlapping = sorted.some((r) => startPos >= r.startMs && startPos < r.endMs);
+
+ if (overlapping || gapToNext <= 0) {
+ toast.error(t("regionClipboard.cannotPlace"));
+ return;
+ }
+ const id = `speed-${nextSpeedIdRef.current++}`;
+ const region = applySpeedAttributes(
+ {
+ id,
+ startMs: startPos,
+ endMs: startPos + Math.min(defaultDuration, gapToNext),
+ speed: DEFAULT_PLAYBACK_SPEED,
+ },
+ copied,
+ );
+ pushState((prev) => ({ speedRegions: [...prev.speedRegions, region] }));
+ handleSelectSpeed(id);
+ pastedToast();
+ return;
+ }
+
+ // Annotation — overlaps are allowed. A brand-new region clones the full copy
+ // (type, content, styling, position), unlike the styling-only overwrite above.
+ const id = `annotation-${nextAnnotationIdRef.current++}`;
+ const region = buildPastedAnnotation(
+ {
+ id,
+ startMs: startPos,
+ endMs: Math.min(startPos + defaultDuration, totalMs),
+ zIndex: nextAnnotationZIndexRef.current++,
+ },
+ copied,
+ );
+ pushState((prev) => ({ annotationRegions: [...prev.annotationRegions, region] }));
+ handleSelectAnnotation(id);
+ pastedToast();
+ }, [
+ selectedZoomId,
+ selectedSpeedId,
+ selectedAnnotationId,
+ zoomRegions,
+ speedRegions,
+ duration,
+ currentTime,
+ pushState,
+ handleSelectZoom,
+ handleSelectSpeed,
+ handleSelectAnnotation,
+ t,
+ ]);
+
useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
const mod = e.ctrlKey || e.metaKey;
@@ -1658,6 +1839,25 @@ export default function VideoEditor() {
return;
}
+ // Copy/paste region attributes. Skipped while typing in a field so native
+ // text copy/paste keeps working.
+ const editingText =
+ e.target instanceof HTMLInputElement ||
+ e.target instanceof HTMLTextAreaElement ||
+ (e.target instanceof HTMLElement && e.target.isContentEditable);
+ if (!editingText) {
+ if (matchesShortcut(e, shortcuts.copySelected, isMac)) {
+ e.preventDefault();
+ handleCopySelected();
+ return;
+ }
+ if (matchesShortcut(e, shortcuts.paste, isMac)) {
+ e.preventDefault();
+ handlePaste();
+ return;
+ }
+ }
+
// Frame-step navigation (arrow keys, no modifiers)
if (
(e.key === "ArrowLeft" || e.key === "ArrowRight") &&
@@ -1714,7 +1914,7 @@ export default function VideoEditor() {
window.addEventListener("keydown", handleKeyDown, { capture: true });
return () => window.removeEventListener("keydown", handleKeyDown, { capture: true });
- }, [undo, redo, shortcuts, isMac]);
+ }, [undo, redo, shortcuts, isMac, handleCopySelected, handlePaste]);
useEffect(() => {
if (selectedZoomId && !zoomRegions.some((region) => region.id === selectedZoomId)) {
diff --git a/src/components/video-editor/regionClipboard.test.ts b/src/components/video-editor/regionClipboard.test.ts
new file mode 100644
index 000000000..5a3fce0d9
--- /dev/null
+++ b/src/components/video-editor/regionClipboard.test.ts
@@ -0,0 +1,161 @@
+import { describe, expect, it } from "vitest";
+import {
+ applyAnnotationAttributes,
+ applySpeedAttributes,
+ applyZoomAttributes,
+ buildPastedAnnotation,
+ extractAnnotationAttributes,
+ extractSpeedAttributes,
+ extractZoomAttributes,
+} from "./regionClipboard";
+import {
+ type AnnotationRegion,
+ DEFAULT_ANNOTATION_POSITION,
+ DEFAULT_ANNOTATION_SIZE,
+ DEFAULT_ANNOTATION_STYLE,
+ DEFAULT_FIGURE_DATA,
+ type SpeedRegion,
+ type ZoomRegion,
+} from "./types";
+
+const zoom: ZoomRegion = {
+ id: "zoom-1",
+ startMs: 1000,
+ endMs: 3000,
+ depth: 4,
+ customScale: 2.75,
+ focus: { cx: 0.2, cy: 0.8 },
+ focusMode: "manual",
+ rotationPreset: "iso",
+ source: "manual",
+};
+
+const speed: SpeedRegion = { id: "speed-1", startMs: 0, endMs: 500, speed: 2 };
+
+const annotation: AnnotationRegion = {
+ id: "annotation-1",
+ startMs: 0,
+ endMs: 2000,
+ type: "figure",
+ content: "hello",
+ position: { x: 10, y: 90 },
+ size: { width: 40, height: 25 },
+ style: { ...DEFAULT_ANNOTATION_STYLE, color: "#ff0000", textAnimation: "pop" },
+ zIndex: 3,
+ figureData: { ...DEFAULT_FIGURE_DATA, color: "#123456" },
+};
+
+describe("zoom attribute copy/paste", () => {
+ it("round-trips the copyable attributes onto a different clip while keeping its identity/timing", () => {
+ const attrs = extractZoomAttributes(zoom);
+ const target: ZoomRegion = {
+ id: "zoom-2",
+ startMs: 9000,
+ endMs: 9500,
+ depth: 1,
+ focus: { cx: 0.5, cy: 0.5 },
+ source: "manual",
+ };
+ const result = applyZoomAttributes(target, attrs);
+
+ expect(result.id).toBe("zoom-2");
+ expect(result.startMs).toBe(9000);
+ expect(result.endMs).toBe(9500);
+ expect(result.depth).toBe(4);
+ expect(result.customScale).toBe(2.75);
+ expect(result.focus).toEqual({ cx: 0.2, cy: 0.8 });
+ expect(result.focusMode).toBe("manual");
+ expect(result.rotationPreset).toBe("iso");
+ });
+
+ it("deep-copies focus so the source and target are decoupled", () => {
+ const attrs = extractZoomAttributes(zoom);
+ const result = applyZoomAttributes({ ...zoom, id: "zoom-2" }, attrs);
+ result.focus.cx = 0.99;
+ expect(zoom.focus.cx).toBe(0.2);
+ });
+});
+
+describe("speed attribute copy/paste", () => {
+ it("copies only the speed value", () => {
+ const attrs = extractSpeedAttributes(speed);
+ const target: SpeedRegion = { id: "speed-2", startMs: 4000, endMs: 5000, speed: 1 };
+ const result = applySpeedAttributes(target, attrs);
+ expect(result).toEqual({ id: "speed-2", startMs: 4000, endMs: 5000, speed: 2 });
+ });
+});
+
+describe("annotation copy captures everything", () => {
+ it("captures styling plus content, type, and position", () => {
+ const attrs = extractAnnotationAttributes(annotation);
+ expect(attrs.type).toBe("figure");
+ expect(attrs.content).toBe("hello");
+ expect(attrs.position).toEqual({ x: 10, y: 90 });
+ expect(attrs.style.color).toBe("#ff0000");
+ expect(attrs.figureData?.color).toBe("#123456");
+ });
+});
+
+describe("paste onto an existing annotation applies styling only", () => {
+ it("overwrites the look/feel but keeps the target's content, position, timing, and zIndex", () => {
+ const attrs = extractAnnotationAttributes(annotation);
+ const target: AnnotationRegion = {
+ id: "annotation-2",
+ startMs: 7000,
+ endMs: 8000,
+ type: "text",
+ content: "world",
+ position: { ...DEFAULT_ANNOTATION_POSITION },
+ size: { ...DEFAULT_ANNOTATION_SIZE },
+ style: { ...DEFAULT_ANNOTATION_STYLE },
+ zIndex: 9,
+ };
+ const result = applyAnnotationAttributes(target, attrs);
+
+ expect(result.content).toBe("world");
+ expect(result.position).toEqual(DEFAULT_ANNOTATION_POSITION);
+ expect(result.startMs).toBe(7000);
+ expect(result.zIndex).toBe(9);
+ expect(result.style.color).toBe("#ff0000");
+ expect(result.style.textAnimation).toBe("pop");
+ expect(result.size).toEqual({ width: 40, height: 25 });
+ expect(result.figureData?.color).toBe("#123456");
+ });
+
+ it("keeps the target's own figure data when the copied region has none", () => {
+ const textAttrs = extractAnnotationAttributes({ ...annotation, figureData: undefined });
+ const figureTarget: AnnotationRegion = { ...annotation, id: "annotation-3" };
+ const result = applyAnnotationAttributes(figureTarget, textAttrs);
+ expect(result.figureData?.color).toBe("#123456");
+ });
+});
+
+describe("paste as a new annotation clones the full copy", () => {
+ it("clones type, content, styling, and position; takes timing/identity from the base", () => {
+ const attrs = extractAnnotationAttributes(annotation);
+ const result = buildPastedAnnotation(
+ { id: "annotation-4", startMs: 12000, endMs: 14000, zIndex: 5 },
+ attrs,
+ );
+
+ expect(result.id).toBe("annotation-4");
+ expect(result.startMs).toBe(12000);
+ expect(result.endMs).toBe(14000);
+ expect(result.zIndex).toBe(5);
+ expect(result.type).toBe("figure");
+ expect(result.content).toBe("hello");
+ expect(result.position).toEqual({ x: 10, y: 90 });
+ expect(result.style.color).toBe("#ff0000");
+ expect(result.figureData?.color).toBe("#123456");
+ });
+
+ it("deep-copies position so source and clone are decoupled", () => {
+ const attrs = extractAnnotationAttributes(annotation);
+ const result = buildPastedAnnotation(
+ { id: "annotation-5", startMs: 0, endMs: 1000, zIndex: 1 },
+ attrs,
+ );
+ result.position.x = 99;
+ expect(annotation.position.x).toBe(10);
+ });
+});
diff --git a/src/components/video-editor/regionClipboard.ts b/src/components/video-editor/regionClipboard.ts
new file mode 100644
index 000000000..fdacafaad
--- /dev/null
+++ b/src/components/video-editor/regionClipboard.ts
@@ -0,0 +1,132 @@
+import type {
+ AnnotationPosition,
+ AnnotationRegion,
+ AnnotationSize,
+ AnnotationTextStyle,
+ AnnotationType,
+ FigureData,
+ PlaybackSpeed,
+ Rotation3DPreset,
+ SpeedRegion,
+ ZoomDepth,
+ ZoomFocus,
+ ZoomFocusMode,
+ ZoomRegion,
+} from "./types";
+
+/** Timeline Region kinds whose attributes can be copied. Trim has no attributes */
+export type RegionKind = "zoom" | "speed" | "annotation";
+
+/** ZoomRegion attributes that can be copied */
+export interface ZoomAttributes {
+ kind: "zoom";
+ depth: ZoomDepth;
+ customScale?: number;
+ focus: ZoomFocus;
+ focusMode?: ZoomFocusMode;
+ rotationPreset?: Rotation3DPreset;
+}
+
+/** SpeedRegion attributes that can be copied */
+export interface SpeedAttributes {
+ kind: "speed";
+ speed: PlaybackSpeed;
+}
+
+/** AnnotationRegion attributes that can be copied. Copy captures everything; paste then
+ * uses only the styling for an existing region, or the full set for a brand-new one. */
+export interface AnnotationAttributes {
+ kind: "annotation";
+ // Styling — applied both when pasting onto an existing region and onto a new one.
+ style: AnnotationTextStyle;
+ size: AnnotationSize;
+ figureData?: FigureData;
+ // Content & placement — used only when pasting as a brand-new region.
+ type: AnnotationType;
+ content: string;
+ textContent?: string;
+ imageContent?: string;
+ position: AnnotationPosition;
+}
+
+export type CopiedRegion = ZoomAttributes | SpeedAttributes | AnnotationAttributes;
+
+export function extractZoomAttributes(region: ZoomRegion): ZoomAttributes {
+ return {
+ kind: "zoom",
+ depth: region.depth,
+ customScale: region.customScale,
+ focus: { ...region.focus },
+ focusMode: region.focusMode,
+ rotationPreset: region.rotationPreset,
+ };
+}
+
+export function extractSpeedAttributes(region: SpeedRegion): SpeedAttributes {
+ return { kind: "speed", speed: region.speed };
+}
+
+export function extractAnnotationAttributes(region: AnnotationRegion): AnnotationAttributes {
+ return {
+ kind: "annotation",
+ style: { ...region.style },
+ size: { ...region.size },
+ figureData: region.figureData ? { ...region.figureData } : undefined,
+ type: region.type,
+ content: region.content,
+ textContent: region.textContent,
+ imageContent: region.imageContent,
+ position: { ...region.position },
+ };
+}
+
+/** Returns a new region with the copied attributes overwriting its own. Identity and
+ * timing (id, startMs, endMs) are preserved; nested objects are deep-copied. */
+export function applyZoomAttributes(region: ZoomRegion, attrs: ZoomAttributes): ZoomRegion {
+ return {
+ ...region,
+ depth: attrs.depth,
+ customScale: attrs.customScale,
+ focus: { ...attrs.focus },
+ focusMode: attrs.focusMode,
+ rotationPreset: attrs.rotationPreset,
+ };
+}
+
+export function applySpeedAttributes(region: SpeedRegion, attrs: SpeedAttributes): SpeedRegion {
+ return { ...region, speed: attrs.speed };
+}
+
+/** Pastes onto an EXISTING annotation: only the styling is overwritten — the target keeps
+ * its own type, text/image content, position, timing, and stacking order. */
+export function applyAnnotationAttributes(
+ region: AnnotationRegion,
+ attrs: AnnotationAttributes,
+): AnnotationRegion {
+ return {
+ ...region,
+ style: { ...attrs.style },
+ size: { ...attrs.size },
+ // Keep the target's own figure data when the copied region has none (e.g. text → figure).
+ figureData: attrs.figureData ? { ...attrs.figureData } : region.figureData,
+ };
+}
+
+/** Builds a BRAND-NEW annotation from a full copy: clones type, content, styling, size,
+ * figure data, and position. Identity, timing, and stacking order come from `base`. */
+export function buildPastedAnnotation(
+ base: Pick<AnnotationRegion, "id" | "startMs" | "endMs" | "zIndex">,
+ attrs: AnnotationAttributes,
+): AnnotationRegion {
+ return {
+ ...base,
+ type: attrs.type,
+ content: attrs.content,
+ textContent: attrs.textContent,
+ imageContent: attrs.imageContent,
+ position: { ...attrs.position },
+ size: { ...attrs.size },
+ style: { ...attrs.style },
+ figureData: attrs.figureData ? { ...attrs.figureData } : undefined,
+ };
+}
diff --git a/src/i18n/locales/ar/editor.json b/src/i18n/locales/ar/editor.json
index 39750e5eb..3ba6a4eea 100644
--- a/src/i18n/locales/ar/editor.json
+++ b/src/i18n/locales/ar/editor.json
@@ -77,5 +77,17 @@
"couldNotOpenTitle": "تعذّر فتح الملف",
"couldNotOpenMessage": "تعذّر فتح ملف المشروع. ربما تم نقل الفيديو المرجعي أو حذفه."
}
+ },
+ "regionClipboard": {
+ "copied": "تم نسخ سمات {{region}}",
+ "pasted": "تم لصق سمات {{region}}",
+ "nothingToCopy": "حدد منطقة لنسخ سماتها",
+ "nothingToPaste": "لم يتم نسخ أي سمات بعد",
+ "cannotPlace": "لا يمكن وضع المنطقة هنا: ستتداخل مع منطقة أخرى",
+ "kinds": {
+ "zoom": "تكبير",
+ "speed": "سرعة",
+ "annotation": "نص"
+ }
}
}
diff --git a/src/i18n/locales/ar/shortcuts.json b/src/i18n/locales/ar/shortcuts.json
index b18e3195e..44c2f22fd 100644
--- a/src/i18n/locales/ar/shortcuts.json
+++ b/src/i18n/locales/ar/shortcuts.json
@@ -23,7 +23,9 @@
"addBlur": "إضافة تمويه",
"addKeyframe": "إضافة إطار رئيسي",
"deleteSelected": "حذف المحدد",
- "playPause": "تشغيل / إيقاف مؤقت"
+ "playPause": "تشغيل / إيقاف مؤقت",
+ "copySelected": "نسخ المحدد",
+ "paste": "لصق"
},
"fixedActions": {
"undo": "تراجع",
diff --git a/src/i18n/locales/en/editor.json b/src/i18n/locales/en/editor.json
index d6a56f033..f3d9c1bc6 100644
--- a/src/i18n/locales/en/editor.json
+++ b/src/i18n/locales/en/editor.json
@@ -77,5 +77,17 @@
"couldNotOpenTitle": "Could Not Open File",
"couldNotOpenMessage": "The project file could not be opened. The video it references may have been moved or deleted."
}
+ },
+ "regionClipboard": {
+ "copied": "{{region}} attributes copied",
+ "pasted": "{{region}} attributes pasted",
+ "nothingToCopy": "Select a region to copy its attributes",
+ "nothingToPaste": "No attributes copied yet",
+ "cannotPlace": "Can't place the region here — it would overlap another",
+ "kinds": {
+ "zoom": "Zoom",
+ "speed": "Speed",
+ "annotation": "Text"
+ }
}
}
diff --git a/src/i18n/locales/en/shortcuts.json b/src/i18n/locales/en/shortcuts.json
index 8994df130..d5a4b0dd8 100644
--- a/src/i18n/locales/en/shortcuts.json
+++ b/src/i18n/locales/en/shortcuts.json
@@ -23,7 +23,9 @@
"addBlur": "Add Blur",
"addKeyframe": "Add Keyframe",
"deleteSelected": "Delete Selected",
- "playPause": "Play / Pause"
+ "playPause": "Play / Pause",
+ "copySelected": "Copy Selected",
+ "paste": "Paste"
},
"fixedActions": {
"undo": "Undo",
diff --git a/src/i18n/locales/es/editor.json b/src/i18n/locales/es/editor.json
index 277ce40ff..bc12b8fd7 100644
--- a/src/i18n/locales/es/editor.json
+++ b/src/i18n/locales/es/editor.json
@@ -77,5 +77,17 @@
"couldNotOpenTitle": "No se pudo abrir el archivo",
"couldNotOpenMessage": "No se pudo abrir el archivo de proyecto. El video al que hace referencia puede haber sido movido o eliminado."
}
+ },
+ "regionClipboard": {
+ "copied": "Atributos de {{region}} copiados",
+ "pasted": "Atributos de {{region}} pegados",
+ "nothingToCopy": "Selecciona una región para copiar sus atributos",
+ "nothingToPaste": "Aún no se han copiado atributos",
+ "cannotPlace": "No se puede colocar la región aquí: se superpondría con otra",
+ "kinds": {
+ "zoom": "Zoom",
+ "speed": "Velocidad",
+ "annotation": "Texto"
+ }
}
}
diff --git a/src/i18n/locales/es/shortcuts.json b/src/i18n/locales/es/shortcuts.json
index 49767d560..b23a1cbe0 100644
--- a/src/i18n/locales/es/shortcuts.json
+++ b/src/i18n/locales/es/shortcuts.json
@@ -23,7 +23,9 @@
"addBlur": "Agregar desenfoque",
"addKeyframe": "Agregar fotograma clave",
"deleteSelected": "Eliminar seleccionado",
- "playPause": "Reproducir / Pausar"
+ "playPause": "Reproducir / Pausar",
+ "copySelected": "Copiar selección",
+ "paste": "Pegar"
},
"fixedActions": {
"undo": "Deshacer",
diff --git a/src/i18n/locales/fr/editor.json b/src/i18n/locales/fr/editor.json
index 40dc24fd7..d3cc39523 100644
--- a/src/i18n/locales/fr/editor.json
+++ b/src/i18n/locales/fr/editor.json
@@ -77,5 +77,17 @@
"couldNotOpenTitle": "Impossible d'ouvrir le fichier",
"couldNotOpenMessage": "Le fichier de projet n'a pas pu être ouvert. La vidéo qu'il référence a peut-être été déplacée ou supprimée."
}
+ },
+ "regionClipboard": {
+ "copied": "Attributs de {{region}} copiés",
+ "pasted": "Attributs de {{region}} collés",
+ "nothingToCopy": "Sélectionnez une région pour copier ses attributs",
+ "nothingToPaste": "Aucun attribut copié pour l'instant",
+ "cannotPlace": "Impossible de placer la région ici : elle chevaucherait une autre",
+ "kinds": {
+ "zoom": "Zoom",
+ "speed": "Vitesse",
+ "annotation": "Texte"
+ }
}
}
diff --git a/src/i18n/locales/fr/shortcuts.json b/src/i18n/locales/fr/shortcuts.json
index eec8a5914..56451fcca 100644
--- a/src/i18n/locales/fr/shortcuts.json
+++ b/src/i18n/locales/fr/shortcuts.json
@@ -23,7 +23,9 @@
"addBlur": "Ajouter un flou",
"addKeyframe": "Ajouter une image-clé",
"deleteSelected": "Supprimer la sélection",
- "playPause": "Lecture / Pause"
+ "playPause": "Lecture / Pause",
+ "copySelected": "Copier la sélection",
+ "paste": "Coller"
},
"fixedActions": {
"undo": "Annuler",
diff --git a/src/i18n/locales/it/editor.json b/src/i18n/locales/it/editor.json
index 0e94b9a9f..54edc4787 100644
--- a/src/i18n/locales/it/editor.json
+++ b/src/i18n/locales/it/editor.json
@@ -61,5 +61,17 @@
"noAudio": "Questo video non contiene audio utilizzabile per la trascrizione.",
"failed": "Impossibile generare i sottotitoli.",
"truncated": "Sono stati trascritti solo i primi {{minutes}} minuti."
+ },
+ "regionClipboard": {
+ "copied": "Attributi di {{region}} copiati",
+ "pasted": "Attributi di {{region}} incollati",
+ "nothingToCopy": "Seleziona una regione per copiarne gli attributi",
+ "nothingToPaste": "Nessun attributo copiato",
+ "cannotPlace": "Impossibile posizionare la regione qui: si sovrapporrebbe a un'altra",
+ "kinds": {
+ "zoom": "Zoom",
+ "speed": "Velocità",
+ "annotation": "Testo"
+ }
}
}
diff --git a/src/i18n/locales/it/shortcuts.json b/src/i18n/locales/it/shortcuts.json
index 051a88871..528d149bc 100644
--- a/src/i18n/locales/it/shortcuts.json
+++ b/src/i18n/locales/it/shortcuts.json
@@ -23,7 +23,9 @@
"addBlur": "Aggiungi sfocatura",
"addKeyframe": "Aggiungi fotogramma chiave",
"deleteSelected": "Elimina selezionato",
- "playPause": "Riproduci / Pausa"
+ "playPause": "Riproduci / Pausa",
+ "copySelected": "Copia selezione",
+ "paste": "Incolla"
},
"fixedActions": {
"undo": "Annulla",
diff --git a/src/i18n/locales/ja-JP/editor.json b/src/i18n/locales/ja-JP/editor.json
index 8e0da42e1..0c416c661 100644
--- a/src/i18n/locales/ja-JP/editor.json
+++ b/src/i18n/locales/ja-JP/editor.json
@@ -77,5 +77,17 @@
"couldNotOpenTitle": "ファイルを開けませんでした",
"couldNotOpenMessage": "プロジェクトファイルを開けませんでした。参照している動画が移動または削除された可能性があります。"
}
+ },
+ "regionClipboard": {
+ "copied": "{{region}}の属性をコピーしました",
+ "pasted": "{{region}}の属性を貼り付けました",
+ "nothingToCopy": "属性をコピーする領域を選択してください",
+ "nothingToPaste": "コピーされた属性がありません",
+ "cannotPlace": "ここには領域を配置できません(他の領域と重なります)",
+ "kinds": {
+ "zoom": "ズーム",
+ "speed": "速度",
+ "annotation": "テキスト"
+ }
}
}
diff --git a/src/i18n/locales/ja-JP/shortcuts.json b/src/i18n/locales/ja-JP/shortcuts.json
index 1d574198e..fc5d6de32 100644
--- a/src/i18n/locales/ja-JP/shortcuts.json
+++ b/src/i18n/locales/ja-JP/shortcuts.json
@@ -23,7 +23,9 @@
"addBlur": "ぼかしを追加",
"addKeyframe": "キーフレームを追加",
"deleteSelected": "選択を削除",
- "playPause": "再生 / 一時停止"
+ "playPause": "再生 / 一時停止",
+ "copySelected": "選択をコピー",
+ "paste": "貼り付け"
},
"fixedActions": {
"undo": "元に戻す",
diff --git a/src/i18n/locales/ko-KR/editor.json b/src/i18n/locales/ko-KR/editor.json
index a63a22a57..2d432941e 100644
--- a/src/i18n/locales/ko-KR/editor.json
+++ b/src/i18n/locales/ko-KR/editor.json
@@ -77,5 +77,17 @@
"couldNotOpenTitle": "파일을 열 수 없음",
"couldNotOpenMessage": "프로젝트 파일을 열 수 없습니다. 참조된 동영상이 이동되었거나 삭제되었을 수 있습니다."
}
+ },
+ "regionClipboard": {
+ "copied": "{{region}} 속성을 복사했습니다",
+ "pasted": "{{region}} 속성을 붙여넣었습니다",
+ "nothingToCopy": "속성을 복사할 영역을 선택하세요",
+ "nothingToPaste": "복사된 속성이 없습니다",
+ "cannotPlace": "여기에는 영역을 배치할 수 없습니다. 다른 영역과 겹칩니다",
+ "kinds": {
+ "zoom": "줌",
+ "speed": "속도",
+ "annotation": "텍스트"
+ }
}
}
diff --git a/src/i18n/locales/ko-KR/shortcuts.json b/src/i18n/locales/ko-KR/shortcuts.json
index ddac29542..53a2de968 100644
--- a/src/i18n/locales/ko-KR/shortcuts.json
+++ b/src/i18n/locales/ko-KR/shortcuts.json
@@ -23,7 +23,9 @@
"addKeyframe": "키프레임 추가",
"deleteSelected": "선택 항목 삭제",
"playPause": "재생 / 일시정지",
- "addBlur": "블러 추가"
+ "addBlur": "블러 추가",
+ "copySelected": "선택 항목 복사",
+ "paste": "붙여넣기"
},
"fixedActions": {
"undo": "실행 취소",
diff --git a/src/i18n/locales/pt-BR/editor.json b/src/i18n/locales/pt-BR/editor.json
index b0e9ab8c9..c78545713 100644
--- a/src/i18n/locales/pt-BR/editor.json
+++ b/src/i18n/locales/pt-BR/editor.json
@@ -60,5 +60,17 @@
"noAudio": "Este vídeo não tem áudio utilizável para transcrição.",
"failed": "Não foi possível gerar as legendas.",
"truncated": "Apenas os primeiros {{minutes}} minutos foram transcritos."
+ },
+ "regionClipboard": {
+ "copied": "Atributos de {{region}} copiados",
+ "pasted": "Atributos de {{region}} colados",
+ "nothingToCopy": "Selecione uma região para copiar seus atributos",
+ "nothingToPaste": "Nenhum atributo copiado ainda",
+ "cannotPlace": "Não é possível colocar a região aqui: ela se sobreporia a outra",
+ "kinds": {
+ "zoom": "Zoom",
+ "speed": "Velocidade",
+ "annotation": "Texto"
+ }
}
}
diff --git a/src/i18n/locales/pt-BR/shortcuts.json b/src/i18n/locales/pt-BR/shortcuts.json
index 208cd1dc8..0187ed554 100644
--- a/src/i18n/locales/pt-BR/shortcuts.json
+++ b/src/i18n/locales/pt-BR/shortcuts.json
@@ -21,7 +21,9 @@
"addBlur": "Adicionar Desfoque",
"addKeyframe": "Adicionar Quadro-chave",
"deleteSelected": "Excluir Selecionado",
- "playPause": "Reproduzir / Pausar"
+ "playPause": "Reproduzir / Pausar",
+ "copySelected": "Copiar seleção",
+ "paste": "Colar"
},
"fixedActions": {
"undo": "Desfazer",
diff --git a/src/i18n/locales/ru/editor.json b/src/i18n/locales/ru/editor.json
index 78fa129a1..c654c14dd 100644
--- a/src/i18n/locales/ru/editor.json
+++ b/src/i18n/locales/ru/editor.json
@@ -77,5 +77,17 @@
"couldNotOpenTitle": "Не удалось открыть файл",
"couldNotOpenMessage": "Не удалось открыть файл проекта. Видео, на которое он ссылается, возможно, было перемещено или удалено."
}
+ },
+ "regionClipboard": {
+ "copied": "Атрибуты «{{region}}» скопированы",
+ "pasted": "Атрибуты «{{region}}» вставлены",
+ "nothingToCopy": "Выберите регион, чтобы скопировать его атрибуты",
+ "nothingToPaste": "Атрибуты ещё не скопированы",
+ "cannotPlace": "Не удаётся разместить регион здесь: он перекрыл бы другой",
+ "kinds": {
+ "zoom": "Масштаб",
+ "speed": "Скорость",
+ "annotation": "Текст"
+ }
}
}
diff --git a/src/i18n/locales/ru/shortcuts.json b/src/i18n/locales/ru/shortcuts.json
index b6e1faa5c..47ae35f24 100644
--- a/src/i18n/locales/ru/shortcuts.json
+++ b/src/i18n/locales/ru/shortcuts.json
@@ -23,7 +23,9 @@
"addBlur": "Добавить размытие",
"addKeyframe": "Добавить ключевой кадр",
"deleteSelected": "Удалить выбранное",
- "playPause": "Воспроизведение / Пауза"
+ "playPause": "Воспроизведение / Пауза",
+ "copySelected": "Копировать выбранное",
+ "paste": "Вставить"
},
"fixedActions": {
"undo": "Отменить",
diff --git a/src/i18n/locales/tr/editor.json b/src/i18n/locales/tr/editor.json
index 89203e719..7e69e891a 100644
--- a/src/i18n/locales/tr/editor.json
+++ b/src/i18n/locales/tr/editor.json
@@ -77,5 +77,17 @@
"couldNotOpenTitle": "Dosya Açılamadı",
"couldNotOpenMessage": "Proje dosyası açılamadı. Başvurulan video taşınmış veya silinmiş olabilir."
}
+ },
+ "regionClipboard": {
+ "copied": "{{region}} öznitelikleri kopyalandı",
+ "pasted": "{{region}} öznitelikleri yapıştırıldı",
+ "nothingToCopy": "Özniteliklerini kopyalamak için bir bölge seçin",
+ "nothingToPaste": "Henüz öznitelik kopyalanmadı",
+ "cannotPlace": "Bölge buraya yerleştirilemiyor: başka bir bölgeyle çakışır",
+ "kinds": {
+ "zoom": "Yakınlaştırma",
+ "speed": "Hız",
+ "annotation": "Metin"
+ }
}
}
diff --git a/src/i18n/locales/tr/shortcuts.json b/src/i18n/locales/tr/shortcuts.json
index 62cdfaf5f..24c1ea502 100644
--- a/src/i18n/locales/tr/shortcuts.json
+++ b/src/i18n/locales/tr/shortcuts.json
@@ -23,7 +23,9 @@
"addBlur": "Bulanik Ekle",
"addKeyframe": "Anahtar Kare Ekle",
"deleteSelected": "Seçileni Sil",
- "playPause": "Oynat / Duraklat"
+ "playPause": "Oynat / Duraklat",
+ "copySelected": "Seçileni Kopyala",
+ "paste": "Yapıştır"
},
"fixedActions": {
"undo": "Geri Al",
diff --git a/src/i18n/locales/vi/editor.json b/src/i18n/locales/vi/editor.json
index 90004091e..f754233dc 100644
--- a/src/i18n/locales/vi/editor.json
+++ b/src/i18n/locales/vi/editor.json
@@ -77,5 +77,17 @@
"couldNotOpenTitle": "Không thể mở tệp",
"couldNotOpenMessage": "Không thể mở tệp dự án. Video mà nó tham chiếu có thể đã bị di chuyển hoặc xóa."
}
+ },
+ "regionClipboard": {
+ "copied": "Đã sao chép thuộc tính {{region}}",
+ "pasted": "Đã dán thuộc tính {{region}}",
+ "nothingToCopy": "Chọn một vùng để sao chép thuộc tính của nó",
+ "nothingToPaste": "Chưa sao chép thuộc tính nào",
+ "cannotPlace": "Không thể đặt vùng ở đây: nó sẽ chồng lên vùng khác",
+ "kinds": {
+ "zoom": "Thu phóng",
+ "speed": "Tốc độ",
+ "annotation": "Văn bản"
+ }
}
}
diff --git a/src/i18n/locales/vi/shortcuts.json b/src/i18n/locales/vi/shortcuts.json
index 46ec9b5e5..a1226b0ef 100644
--- a/src/i18n/locales/vi/shortcuts.json
+++ b/src/i18n/locales/vi/shortcuts.json
@@ -23,7 +23,9 @@
"addBlur": "Thêm Làm mờ",
"addKeyframe": "Thêm Khung hình chính",
"deleteSelected": "Xóa mục đã chọn",
- "playPause": "Phát / Tạm dừng"
+ "playPause": "Phát / Tạm dừng",
+ "copySelected": "Sao chép mục đã chọn",
+ "paste": "Dán"
},
"fixedActions": {
"undo": "Hoàn tác",
diff --git a/src/i18n/locales/zh-CN/editor.json b/src/i18n/locales/zh-CN/editor.json
index 58f6ae27b..fae1ff2aa 100644
--- a/src/i18n/locales/zh-CN/editor.json
+++ b/src/i18n/locales/zh-CN/editor.json
@@ -77,5 +77,17 @@
"couldNotOpenTitle": "无法打开文件",
"couldNotOpenMessage": "无法打开项目文件。它引用的视频可能已被移动或删除。"
}
+ },
+ "regionClipboard": {
+ "copied": "已复制{{region}}属性",
+ "pasted": "已粘贴{{region}}属性",
+ "nothingToCopy": "选择一个区域以复制其属性",
+ "nothingToPaste": "尚未复制任何属性",
+ "cannotPlace": "无法在此放置区域:会与其他区域重叠",
+ "kinds": {
+ "zoom": "缩放",
+ "speed": "速度",
+ "annotation": "文本"
+ }
}
}
diff --git a/src/i18n/locales/zh-CN/shortcuts.json b/src/i18n/locales/zh-CN/shortcuts.json
index eb357e0e3..b3204cb2b 100644
--- a/src/i18n/locales/zh-CN/shortcuts.json
+++ b/src/i18n/locales/zh-CN/shortcuts.json
@@ -23,7 +23,9 @@
"addBlur": "添加模糊",
"addKeyframe": "添加关键帧",
"deleteSelected": "删除所选",
- "playPause": "播放 / 暂停"
+ "playPause": "播放 / 暂停",
+ "copySelected": "复制所选",
+ "paste": "粘贴"
},
"fixedActions": {
"undo": "撤销",
diff --git a/src/i18n/locales/zh-TW/editor.json b/src/i18n/locales/zh-TW/editor.json
index 8a6485409..9038f7e3a 100644
--- a/src/i18n/locales/zh-TW/editor.json
+++ b/src/i18n/locales/zh-TW/editor.json
@@ -77,5 +77,17 @@
"couldNotOpenTitle": "無法開啟檔案",
"couldNotOpenMessage": "無法開啟專案檔案。它所參照的影片可能已被移動或刪除。"
}
+ },
+ "regionClipboard": {
+ "copied": "已複製{{region}}屬性",
+ "pasted": "已貼上{{region}}屬性",
+ "nothingToCopy": "選擇一個區域以複製其屬性",
+ "nothingToPaste": "尚未複製任何屬性",
+ "cannotPlace": "無法在此放置區域:會與其他區域重疊",
+ "kinds": {
+ "zoom": "縮放",
+ "speed": "速度",
+ "annotation": "文字"
+ }
}
}
diff --git a/src/i18n/locales/zh-TW/shortcuts.json b/src/i18n/locales/zh-TW/shortcuts.json
index 34ab7de81..65f148478 100644
--- a/src/i18n/locales/zh-TW/shortcuts.json
+++ b/src/i18n/locales/zh-TW/shortcuts.json
@@ -23,7 +23,9 @@
"addBlur": "新增模糊",
"addKeyframe": "新增關鍵影格",
"deleteSelected": "刪除所選",
- "playPause": "播放 / 暫停"
+ "playPause": "播放 / 暫停",
+ "copySelected": "複製所選",
+ "paste": "貼上"
},
"fixedActions": {
"undo": "復原",
diff --git a/src/lib/shortcuts.ts b/src/lib/shortcuts.ts
index 485fe89df..16129ef4c 100644
--- a/src/lib/shortcuts.ts
+++ b/src/lib/shortcuts.ts
@@ -8,6 +8,8 @@ export const SHORTCUT_ACTIONS = [
"addKeyframe",
"deleteSelected",
"playPause",
+ "copySelected",
+ "paste",
] as const;
export type ShortcutAction = (typeof SHORTCUT_ACTIONS)[number];
@@ -115,6 +117,8 @@ export const DEFAULT_SHORTCUTS: ShortcutsConfig = {
addKeyframe: { key: "f" },
deleteSelected: { key: "d", ctrl: true },
playPause: { key: " " },
+ copySelected: { key: "c", ctrl: true },
+ paste: { key: "v", ctrl: true },
};
export const SHORTCUT_LABELS: Record<ShortcutAction, string> = {
@@ -127,6 +131,8 @@ export const SHORTCUT_LABELS: Record<ShortcutAction, string> = {
addKeyframe: "Add Keyframe",
deleteSelected: "Delete Selected",
playPause: "Play / Pause",
+ copySelected: "Copy Selected",
+ paste: "Paste",
};
export function matchesShortcut(