This commit is contained in:
Maze Winther
2026-01-21 00:59:03 +01:00
parent 7f50de14fc
commit e1d82eca09
28 changed files with 1223 additions and 1009 deletions
@@ -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;
}