mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
shipping
This commit is contained in:
@@ -539,7 +539,7 @@ export function useElementInteraction({
|
||||
const clickOffsetTime = getClickOffsetTime({
|
||||
clientX: event.clientX,
|
||||
elementRect: (
|
||||
event.currentTarget as HTMLElement
|
||||
event.currentTarget
|
||||
).getBoundingClientRect(),
|
||||
zoomLevel,
|
||||
});
|
||||
|
||||
@@ -50,7 +50,7 @@ export function useTimelineDragDrop({
|
||||
if (dragData.type === "text") return "text";
|
||||
if (dragData.type === "sticker") return "sticker";
|
||||
if (dragData.type === "media") {
|
||||
return dragData.mediaType as ElementType;
|
||||
return dragData.mediaType;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
@@ -102,7 +102,7 @@ export function useTimelineSnapping({
|
||||
|
||||
return {
|
||||
snappedTime: closestSnapPoint
|
||||
? (closestSnapPoint as SnapPoint).time
|
||||
? closestSnapPoint.time
|
||||
: targetTime,
|
||||
snapPoint: closestSnapPoint,
|
||||
snapDistance: closestDistance,
|
||||
|
||||
@@ -52,18 +52,15 @@ export function useKeyboardShortcutsHelp() {
|
||||
}
|
||||
|
||||
for (const [actionId, keys] of Object.entries(actionToKeys)) {
|
||||
if (!Object.prototype.hasOwnProperty.call(ACTIONS, actionId)) {
|
||||
continue;
|
||||
}
|
||||
if (!isAction(actionId)) continue;
|
||||
|
||||
const action = actionId as TAction;
|
||||
const actionDef = ACTIONS[action];
|
||||
const actionDef = ACTIONS[actionId];
|
||||
result.push({
|
||||
id: actionId,
|
||||
keys,
|
||||
description: actionDef.description,
|
||||
category: actionDef.category,
|
||||
action,
|
||||
action: actionId,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -79,3 +76,7 @@ export function useKeyboardShortcutsHelp() {
|
||||
shortcuts,
|
||||
};
|
||||
}
|
||||
|
||||
function isAction(id: string): id is TAction {
|
||||
return id in ACTIONS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user