mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
fix: global biome exe, fix missing args
This commit is contained in:
@@ -28,52 +28,52 @@ export function useEditorActions() {
|
|||||||
// Playback actions
|
// Playback actions
|
||||||
useActionHandler("toggle-play", () => {
|
useActionHandler("toggle-play", () => {
|
||||||
toggle();
|
toggle();
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
useActionHandler("stop-playback", () => {
|
useActionHandler("stop-playback", () => {
|
||||||
if (isPlaying) {
|
if (isPlaying) {
|
||||||
toggle();
|
toggle();
|
||||||
}
|
}
|
||||||
seek(0);
|
seek(0);
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
useActionHandler("seek-forward", (args) => {
|
useActionHandler("seek-forward", (args) => {
|
||||||
const seconds = args?.seconds ?? 1;
|
const seconds = args?.seconds ?? 1;
|
||||||
seek(Math.min(duration, currentTime + seconds));
|
seek(Math.min(duration, currentTime + seconds));
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
useActionHandler("seek-backward", (args) => {
|
useActionHandler("seek-backward", (args) => {
|
||||||
const seconds = args?.seconds ?? 1;
|
const seconds = args?.seconds ?? 1;
|
||||||
seek(Math.max(0, currentTime - seconds));
|
seek(Math.max(0, currentTime - seconds));
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
useActionHandler("frame-step-forward", () => {
|
useActionHandler("frame-step-forward", () => {
|
||||||
const projectFps = activeProject?.fps || 30;
|
const projectFps = activeProject?.fps || 30;
|
||||||
seek(Math.min(duration, currentTime + 1 / projectFps));
|
seek(Math.min(duration, currentTime + 1 / projectFps));
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
useActionHandler("frame-step-backward", () => {
|
useActionHandler("frame-step-backward", () => {
|
||||||
const projectFps = activeProject?.fps || 30;
|
const projectFps = activeProject?.fps || 30;
|
||||||
seek(Math.max(0, currentTime - 1 / projectFps));
|
seek(Math.max(0, currentTime - 1 / projectFps));
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
useActionHandler("jump-forward", (args) => {
|
useActionHandler("jump-forward", (args) => {
|
||||||
const seconds = args?.seconds ?? 5;
|
const seconds = args?.seconds ?? 5;
|
||||||
seek(Math.min(duration, currentTime + seconds));
|
seek(Math.min(duration, currentTime + seconds));
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
useActionHandler("jump-backward", (args) => {
|
useActionHandler("jump-backward", (args) => {
|
||||||
const seconds = args?.seconds ?? 5;
|
const seconds = args?.seconds ?? 5;
|
||||||
seek(Math.max(0, currentTime - seconds));
|
seek(Math.max(0, currentTime - seconds));
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
useActionHandler("goto-start", () => {
|
useActionHandler("goto-start", () => {
|
||||||
seek(0);
|
seek(0);
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
useActionHandler("goto-end", () => {
|
useActionHandler("goto-end", () => {
|
||||||
seek(duration);
|
seek(duration);
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
// Timeline editing actions
|
// Timeline editing actions
|
||||||
useActionHandler("split-element", () => {
|
useActionHandler("split-element", () => {
|
||||||
@@ -98,7 +98,7 @@ export function useEditorActions() {
|
|||||||
toast.error("Playhead must be within selected element");
|
toast.error("Playhead must be within selected element");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
useActionHandler("delete-selected", () => {
|
useActionHandler("delete-selected", () => {
|
||||||
if (selectedElements.length === 0) {
|
if (selectedElements.length === 0) {
|
||||||
@@ -110,7 +110,7 @@ export function useEditorActions() {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
clearSelectedElements();
|
clearSelectedElements();
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
useActionHandler("select-all", () => {
|
useActionHandler("select-all", () => {
|
||||||
const allElements = tracks.flatMap((track: any) =>
|
const allElements = tracks.flatMap((track: any) =>
|
||||||
@@ -120,7 +120,7 @@ export function useEditorActions() {
|
|||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
setSelectedElements(allElements);
|
setSelectedElements(allElements);
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
useActionHandler("duplicate-selected", () => {
|
useActionHandler("duplicate-selected", () => {
|
||||||
if (selectedElements.length !== 1) {
|
if (selectedElements.length !== 1) {
|
||||||
@@ -144,18 +144,18 @@ export function useEditorActions() {
|
|||||||
startTime: newStartTime,
|
startTime: newStartTime,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
useActionHandler("toggle-snapping", () => {
|
useActionHandler("toggle-snapping", () => {
|
||||||
toggleSnapping();
|
toggleSnapping();
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
// History actions
|
// History actions
|
||||||
useActionHandler("undo", () => {
|
useActionHandler("undo", () => {
|
||||||
undo();
|
undo();
|
||||||
});
|
}, undefined);
|
||||||
|
|
||||||
useActionHandler("redo", () => {
|
useActionHandler("redo", () => {
|
||||||
redo();
|
redo();
|
||||||
});
|
}, undefined);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user