Open History to see the last commit
1import type { PreviewAnnotationSubmission } from "@t3tools/contracts";
2
3interface AnnotationKeyboardEvent {
4 readonly key: string;
5 readonly metaKey: boolean;
6 readonly ctrlKey: boolean;
7 readonly shiftKey: boolean;
8 readonly isComposing: boolean;
9}
10
11export function resolveAnnotationSubmission(
12 event: AnnotationKeyboardEvent,
13): PreviewAnnotationSubmission | null {
14 if (event.key !== "Enter" || event.shiftKey || event.isComposing) return null;
15 return event.metaKey || event.ctrlKey ? "send" : "attach";
16}