Files
pdf/frontend/src/lib/tools.ts
T

73 lines
1.8 KiB
TypeScript

export type ToolId =
| 'select'
| 'pan'
| 'highlight'
| 'draw'
| 'comment'
| 'textbox'
| 'edit_text'
| 'signature'
| 'stamp'
| 'redact'
| 'underline'
| 'strikeout'
| 'squiggly'
| 'stream_edit';
export interface ToolSettings {
highlightColor: string;
highlightOpacity: number;
inkColor: string;
inkThickness: number;
textColor: string;
fontSize: number;
underlineColor: string;
strikeoutColor: string;
squigglyColor: string;
}
export const DEFAULT_TOOL_SETTINGS: ToolSettings = {
highlightColor: '#facc15',
highlightOpacity: 0.4,
inkColor: '#2563eb',
inkThickness: 2,
textColor: '#1f2937',
fontSize: 14,
underlineColor: '#2563eb',
strikeoutColor: '#dc2626',
squigglyColor: '#16a34a',
};
export const TOOL_SHORTCUTS: Record<string, ToolId> = {
v: 'select',
h: 'pan',
k: 'highlight',
d: 'draw',
c: 'comment',
t: 'textbox',
e: 'edit_text',
s: 'signature',
m: 'stamp',
r: 'redact',
u: 'underline',
x: 'strikeout',
w: 'squiggly',
q: 'stream_edit',
};
export interface StampPreset {
label: string;
textColor: string;
backgroundColor: string;
borderColor: string;
}
export const STAMP_PRESETS: StampPreset[] = [
{ label: 'APPROVED', textColor: '#16a34a', backgroundColor: '#dcfce7', borderColor: '#16a34a' },
{ label: 'DRAFT', textColor: '#6b7280', backgroundColor: '#f3f4f6', borderColor: '#6b7280' },
{ label: 'CONFIDENTIAL', textColor: '#dc2626', backgroundColor: '#fee2e2', borderColor: '#dc2626' },
{ label: 'REVIEWED', textColor: '#2563eb', backgroundColor: '#dbeafe', borderColor: '#2563eb' },
{ label: 'FINAL', textColor: '#7c3aed', backgroundColor: '#ede9fe', borderColor: '#7c3aed' },
{ label: 'VOID', textColor: '#dc2626', backgroundColor: '#fee2e2', borderColor: '#dc2626' },
];