@svadmin/ui 0.120.0 → 0.122.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/app.css +336 -7
  2. package/dist/app.theme.css +336 -7
  3. package/dist/components/AboutSettings.svelte +1 -1
  4. package/dist/components/AnnouncementBanner.svelte +314 -0
  5. package/dist/components/AnnouncementBanner.svelte.d.ts +45 -0
  6. package/dist/components/AsyncExportModal.svelte +551 -0
  7. package/dist/components/AsyncExportModal.svelte.d.ts +50 -0
  8. package/dist/components/AudioFeedbackProvider.svelte +131 -0
  9. package/dist/components/AudioFeedbackProvider.svelte.d.ts +11 -0
  10. package/dist/components/AuditLogViewer.svelte +1 -1
  11. package/dist/components/CanvasAnnotation.svelte +1 -1
  12. package/dist/components/ColumnFilterBuilder.svelte +135 -0
  13. package/dist/components/ColumnFilterBuilder.svelte.d.ts +20 -0
  14. package/dist/components/ColumnSettings.svelte +1 -1
  15. package/dist/components/ColumnVisibilityDrawer.svelte +541 -0
  16. package/dist/components/ColumnVisibilityDrawer.svelte.d.ts +16 -0
  17. package/dist/components/ConcurrentConflictModal.svelte +7 -7
  18. package/dist/components/ContextMenu.svelte +268 -0
  19. package/dist/components/ContextMenu.svelte.d.ts +22 -0
  20. package/dist/components/ConversionFunnel.svelte +154 -0
  21. package/dist/components/ConversionFunnel.svelte.d.ts +22 -0
  22. package/dist/components/CronExpressionBuilder.svelte +1 -1
  23. package/dist/components/DecisionTable.svelte +1 -1
  24. package/dist/components/DevTools.svelte +1 -1
  25. package/dist/components/DraggableRowTable.svelte +1 -1
  26. package/dist/components/DualApprovalGate.svelte +418 -0
  27. package/dist/components/DualApprovalGate.svelte.d.ts +39 -0
  28. package/dist/components/EditableTable.svelte +1 -1
  29. package/dist/components/ExcelImportWizard.svelte +2 -2
  30. package/dist/components/GlobalShortcuts.svelte +1 -1
  31. package/dist/components/ImageCropper.svelte +1 -1
  32. package/dist/components/ImportWizard.svelte +1 -1
  33. package/dist/components/JsonSchemaForm.svelte +1 -1
  34. package/dist/components/JsonViewer.svelte +323 -0
  35. package/dist/components/JsonViewer.svelte.d.ts +20 -0
  36. package/dist/components/KeyboardShortcutsModal.svelte +362 -0
  37. package/dist/components/KeyboardShortcutsModal.svelte.d.ts +22 -0
  38. package/dist/components/KpiCard.svelte +250 -0
  39. package/dist/components/KpiCard.svelte.d.ts +44 -0
  40. package/dist/components/MasterDetailView.svelte +1 -1
  41. package/dist/components/MetricGrid.svelte +2 -2
  42. package/dist/components/MicroAppBridge.svelte +59 -0
  43. package/dist/components/MicroAppBridge.svelte.d.ts +11 -0
  44. package/dist/components/OfflineSyncBanner.svelte +1 -1
  45. package/dist/components/OrgChart.svelte +1 -1
  46. package/dist/components/OrgTreePicker.svelte +1 -1
  47. package/dist/components/OtpInput.svelte +209 -0
  48. package/dist/components/OtpInput.svelte.d.ts +17 -0
  49. package/dist/components/PdfDocumentViewer.svelte +2 -2
  50. package/dist/components/PivotDrilldownModal.svelte +6 -6
  51. package/dist/components/PivotTable.svelte +1 -1
  52. package/dist/components/PricingCard.svelte +1 -1
  53. package/dist/components/PricingTable.svelte +1 -1
  54. package/dist/components/PrintableBill.svelte +2 -2
  55. package/dist/components/PrintableReportLayout.svelte +259 -0
  56. package/dist/components/PrintableReportLayout.svelte.d.ts +32 -0
  57. package/dist/components/ProSkeleton.svelte +6 -6
  58. package/dist/components/RecordCompareModal.svelte +428 -0
  59. package/dist/components/RecordCompareModal.svelte.d.ts +42 -0
  60. package/dist/components/ResultPage.svelte +166 -0
  61. package/dist/components/ResultPage.svelte.d.ts +28 -0
  62. package/dist/components/SafeDeleteConfirm.svelte +5 -5
  63. package/dist/components/SankeyChart.svelte +111 -0
  64. package/dist/components/SankeyChart.svelte.d.ts +22 -0
  65. package/dist/components/SchemaVisualModeler.svelte +336 -0
  66. package/dist/components/SchemaVisualModeler.svelte.d.ts +17 -0
  67. package/dist/components/SensitiveDataMask.svelte +81 -22
  68. package/dist/components/SensitiveDataMask.svelte.d.ts +15 -10
  69. package/dist/components/SessionTimeoutGuard.svelte +154 -0
  70. package/dist/components/SessionTimeoutGuard.svelte.d.ts +25 -0
  71. package/dist/components/SignaturePad.svelte +231 -67
  72. package/dist/components/SignaturePad.svelte.d.ts +6 -5
  73. package/dist/components/SliderCaptcha.svelte +1 -1
  74. package/dist/components/SplitPaneLayout.svelte +1 -1
  75. package/dist/components/SpreadsheetView.svelte +1 -1
  76. package/dist/components/StepForm.svelte +1 -1
  77. package/dist/components/StepWizard.svelte +513 -0
  78. package/dist/components/StepWizard.svelte.d.ts +49 -0
  79. package/dist/components/TableClipboardManager.svelte +307 -0
  80. package/dist/components/TableClipboardManager.svelte.d.ts +13 -0
  81. package/dist/components/TaskCenter.svelte +9 -9
  82. package/dist/components/TextDiffViewer.svelte +613 -0
  83. package/dist/components/TextDiffViewer.svelte.d.ts +39 -0
  84. package/dist/components/Tour.svelte +71 -13
  85. package/dist/components/Tour.svelte.d.ts +1 -1
  86. package/dist/components/TreeTransfer.svelte +1 -1
  87. package/dist/components/TrendIndicator.svelte +21 -13
  88. package/dist/components/TrendIndicator.svelte.d.ts +4 -2
  89. package/dist/components/UnsavedChangesGuard.svelte +138 -0
  90. package/dist/components/UnsavedChangesGuard.svelte.d.ts +32 -0
  91. package/dist/components/UsageCard.svelte +1 -1
  92. package/dist/components/VersionDiffViewer.svelte +1 -1
  93. package/dist/components/VirtualTable.svelte +1 -1
  94. package/dist/components/VirtualTreeSelect.svelte +1 -1
  95. package/dist/components/WatermarkContainer.svelte +196 -0
  96. package/dist/components/WatermarkContainer.svelte.d.ts +20 -0
  97. package/dist/components/WorkflowDesigner.svelte +3 -3
  98. package/dist/components/WorkflowProcessCard.svelte +1 -1
  99. package/dist/components/WorkflowStepper.svelte +250 -0
  100. package/dist/components/WorkflowStepper.svelte.d.ts +27 -0
  101. package/dist/components/charts/GaugeChart.svelte +1 -1
  102. package/dist/components/useAudioAlert.d.svelte.ts +1 -0
  103. package/dist/components/useAudioAlert.svelte.d.ts +13 -0
  104. package/dist/components/useAudioAlert.svelte.js +90 -0
  105. package/dist/components/useHotkeys.d.svelte.ts +1 -0
  106. package/dist/components/useHotkeys.svelte.d.ts +44 -0
  107. package/dist/components/useHotkeys.svelte.js +190 -0
  108. package/dist/components/useMicroAppEvent.d.svelte.ts +1 -0
  109. package/dist/components/useMicroAppEvent.svelte.d.ts +16 -0
  110. package/dist/components/useMicroAppEvent.svelte.js +61 -0
  111. package/dist/components/usePrintExport.d.svelte.ts +1 -0
  112. package/dist/components/usePrintExport.svelte.d.ts +11 -0
  113. package/dist/components/usePrintExport.svelte.js +45 -0
  114. package/dist/components/useSessionTimeout.d.svelte.ts +1 -0
  115. package/dist/components/useSessionTimeout.svelte.d.ts +28 -0
  116. package/dist/components/useSessionTimeout.svelte.js +182 -0
  117. package/dist/components/useTableClipboard.d.svelte.ts +1 -0
  118. package/dist/components/useTableClipboard.svelte.d.ts +28 -0
  119. package/dist/components/useTableClipboard.svelte.js +116 -0
  120. package/dist/components/useUnsavedChanges.d.svelte.ts +1 -0
  121. package/dist/components/useUnsavedChanges.svelte.d.ts +22 -0
  122. package/dist/components/useUnsavedChanges.svelte.js +105 -0
  123. package/dist/index.d.ts +47 -28
  124. package/dist/index.js +49 -2
  125. package/package.json +1 -1
@@ -1,16 +1,17 @@
1
1
  <script lang="ts">
2
2
  import { onMount } from 'svelte';
3
3
  import { Button } from './ui/button/index.js';
4
- import { RotateCcw, Trash2, Check, Download } from '@lucide/svelte';
4
+ import { RotateCcw, RotateCw, Trash2, Check, Download, FileCode } from '@lucide/svelte';
5
5
  import { cn } from '../utils.js';
6
6
 
7
- interface Props {
7
+ export interface SignaturePadProps {
8
8
  value?: string;
9
9
  width?: number;
10
10
  height?: number;
11
11
  strokeColor?: string;
12
12
  strokeWidth?: number;
13
13
  disabled?: boolean;
14
+ withTimestamp?: boolean;
14
15
  onchange?: (dataUrl: string) => void;
15
16
  onsave?: (dataUrl: string) => void;
16
17
  class?: string;
@@ -23,22 +24,26 @@
23
24
  strokeColor = 'currentColor',
24
25
  strokeWidth = 2.5,
25
26
  disabled = false,
27
+ withTimestamp = false,
26
28
  onchange,
27
29
  onsave,
28
30
  class: className = '',
29
- }: Props = $props();
31
+ }: SignaturePadProps = $props();
30
32
 
31
33
  let canvasEl = $state<HTMLCanvasElement | null>(null);
32
34
  let isDrawing = $state(false);
33
35
  let isEmpty = $state(true);
34
- let history = $state<ImageData[]>([]);
36
+ let undoHistory = $state<ImageData[]>([]);
37
+ let redoHistory = $state<ImageData[]>([]);
35
38
 
36
39
  interface Point {
37
40
  x: number;
38
41
  y: number;
39
42
  }
40
43
 
41
- let points: Point[] = [];
44
+ let currentStroke = $state<Point[]>([]);
45
+ let allStrokes = $state<Point[][]>([]);
46
+ let redoStrokes = $state<Point[][]>([]);
42
47
 
43
48
  function getCanvasPos(e: MouseEvent | TouchEvent): Point | null {
44
49
  if (!canvasEl) return null;
@@ -64,18 +69,38 @@
64
69
  }
65
70
  }
66
71
 
72
+ function setupContext(ctx: CanvasRenderingContext2D) {
73
+ ctx.strokeStyle = strokeColor === 'currentColor'
74
+ ? (canvasEl ? getComputedStyle(canvasEl).color || 'rgb(24, 24, 27)' : 'rgb(24, 24, 27)')
75
+ : strokeColor;
76
+ ctx.lineWidth = strokeWidth;
77
+ ctx.lineCap = 'round';
78
+ ctx.lineJoin = 'round';
79
+ }
80
+
67
81
  function startDrawing(e: MouseEvent | TouchEvent) {
68
82
  if (disabled || !canvasEl) return;
69
83
  const pos = getCanvasPos(e);
70
84
  if (!pos) return;
71
85
 
72
86
  const ctx = canvasEl.getContext('2d');
73
- if (ctx) {
74
- history = [...history, ctx.getImageData(0, 0, canvasEl.width, canvasEl.height)];
75
- }
87
+ if (!ctx) return;
88
+
89
+ // Save state before this new stroke for undo
90
+ const snapshot = ctx.getImageData(0, 0, canvasEl.width, canvasEl.height);
91
+ undoHistory = [...undoHistory, snapshot];
92
+ redoHistory = [];
93
+ redoStrokes = [];
76
94
 
77
95
  isDrawing = true;
78
- points = [pos];
96
+ isEmpty = false;
97
+ currentStroke = [pos];
98
+
99
+ setupContext(ctx);
100
+ ctx.beginPath();
101
+ ctx.arc(pos.x, pos.y, strokeWidth / 2, 0, Math.PI * 2);
102
+ ctx.fillStyle = ctx.strokeStyle;
103
+ ctx.fill();
79
104
  }
80
105
 
81
106
  function draw(e: MouseEvent | TouchEvent) {
@@ -83,50 +108,45 @@
83
108
  const pos = getCanvasPos(e);
84
109
  if (!pos) return;
85
110
 
86
- points.push(pos);
87
111
  const ctx = canvasEl.getContext('2d');
88
112
  if (!ctx) return;
89
113
 
90
- ctx.strokeStyle = strokeColor === 'currentColor' ? (canvasEl ? getComputedStyle(canvasEl).color : 'rgb(0,0,0)') : strokeColor;
91
- ctx.lineWidth = strokeWidth;
92
- ctx.lineCap = 'round';
93
- ctx.lineJoin = 'round';
114
+ currentStroke.push(pos);
115
+ setupContext(ctx);
116
+
117
+ // Quadratic Bezier curve smoothing for natural calligraphy stroke
118
+ if (currentStroke.length >= 3) {
119
+ const p0 = currentStroke[currentStroke.length - 3];
120
+ const p1 = currentStroke[currentStroke.length - 2];
121
+ const p2 = currentStroke[currentStroke.length - 1];
122
+
123
+ if (p0 && p1 && p2) {
124
+ const mid1 = { x: (p0.x + p1.x) / 2, y: (p0.y + p1.y) / 2 };
125
+ const mid2 = { x: (p1.x + p2.x) / 2, y: (p1.y + p2.y) / 2 };
94
126
 
95
- if (points.length < 3) {
96
- const b = points[0];
97
- if (b) {
98
127
  ctx.beginPath();
99
- ctx.arc(b.x, b.y, ctx.lineWidth / 2, 0, Math.PI * 2, !0);
100
- ctx.fillStyle = ctx.strokeStyle;
101
- ctx.fill();
102
- ctx.closePath();
128
+ ctx.moveTo(mid1.x, mid1.y);
129
+ ctx.quadraticCurveTo(p1.x, p1.y, mid2.x, mid2.y);
130
+ ctx.stroke();
103
131
  }
104
- isEmpty = false;
105
- return;
106
- }
107
-
108
- ctx.beginPath();
109
- const p0 = points[0];
110
- if (p0) {
111
- ctx.moveTo(p0.x, p0.y);
112
- }
113
- for (let i = 1; i < points.length - 1; i++) {
114
- const pi = points[i];
115
- const pi1 = points[i + 1];
116
- if (pi && pi1) {
117
- const xc = (pi.x + pi1.x) / 2;
118
- const yc = (pi.y + pi1.y) / 2;
119
- ctx.quadraticCurveTo(pi.x, pi.y, xc, yc);
132
+ } else if (currentStroke.length === 2) {
133
+ const p0 = currentStroke[0];
134
+ if (p0) {
135
+ ctx.beginPath();
136
+ ctx.moveTo(p0.x, p0.y);
137
+ ctx.lineTo(pos.x, pos.y);
138
+ ctx.stroke();
120
139
  }
121
140
  }
122
- ctx.stroke();
123
- isEmpty = false;
124
141
  }
125
142
 
126
143
  function stopDrawing() {
127
144
  if (!isDrawing || !canvasEl) return;
128
145
  isDrawing = false;
129
- points = [];
146
+ if (currentStroke.length > 0) {
147
+ allStrokes = [...allStrokes, [...currentStroke]];
148
+ currentStroke = [];
149
+ }
130
150
 
131
151
  const dataUrl = canvasEl.toDataURL('image/png');
132
152
  value = dataUrl;
@@ -137,55 +157,170 @@
137
157
  if (!canvasEl) return;
138
158
  const ctx = canvasEl.getContext('2d');
139
159
  if (!ctx) return;
160
+
161
+ const snapshot = ctx.getImageData(0, 0, canvasEl.width, canvasEl.height);
162
+ undoHistory = [...undoHistory, snapshot];
163
+ redoHistory = [];
164
+ redoStrokes = [];
165
+ allStrokes = [];
166
+ currentStroke = [];
167
+
140
168
  ctx.clearRect(0, 0, canvasEl.width, canvasEl.height);
141
- history = [];
142
169
  isEmpty = true;
143
170
  value = '';
144
171
  onchange?.('');
145
172
  }
146
173
 
147
- export function toDataURL(type = 'image/png'): string {
148
- return canvasEl ? canvasEl.toDataURL(type) : '';
149
- }
150
-
151
- export function toSVG(): string {
152
- if (!canvasEl) return '';
153
- return `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}"><image href="${toDataURL()}" width="${width}" height="${height}" /></svg>`;
154
- }
155
-
156
- export function getIsEmpty(): boolean {
157
- return isEmpty;
158
- }
159
-
160
174
  export function undo() {
161
- if (!canvasEl || history.length === 0) return;
175
+ if (!canvasEl || undoHistory.length === 0) return;
162
176
  const ctx = canvasEl.getContext('2d');
163
177
  if (!ctx) return;
164
- const previous = history[history.length - 1];
165
- history = history.slice(0, -1);
178
+
179
+ const currentFrame = ctx.getImageData(0, 0, canvasEl.width, canvasEl.height);
180
+ redoHistory = [...redoHistory, currentFrame];
181
+
182
+ if (allStrokes.length > 0) {
183
+ const lastStroke = allStrokes[allStrokes.length - 1];
184
+ if (lastStroke) {
185
+ redoStrokes = [...redoStrokes, lastStroke];
186
+ }
187
+ allStrokes = allStrokes.slice(0, -1);
188
+ }
189
+
190
+ const previous = undoHistory[undoHistory.length - 1];
191
+ undoHistory = undoHistory.slice(0, -1);
166
192
  if (previous) {
167
193
  ctx.putImageData(previous, 0, 0);
168
194
  }
169
- isEmpty = history.length === 0;
195
+
196
+ isEmpty = undoHistory.length === 0 && allStrokes.length === 0;
170
197
  const dataUrl = isEmpty ? '' : canvasEl.toDataURL('image/png');
171
198
  value = dataUrl;
172
199
  onchange?.(dataUrl);
173
200
  }
174
201
 
202
+ export function redo() {
203
+ if (!canvasEl || redoHistory.length === 0) return;
204
+ const ctx = canvasEl.getContext('2d');
205
+ if (!ctx) return;
206
+
207
+ const currentFrame = ctx.getImageData(0, 0, canvasEl.width, canvasEl.height);
208
+ undoHistory = [...undoHistory, currentFrame];
209
+
210
+ const nextFrame = redoHistory[redoHistory.length - 1];
211
+ redoHistory = redoHistory.slice(0, -1);
212
+ if (nextFrame) {
213
+ ctx.putImageData(nextFrame, 0, 0);
214
+ }
215
+
216
+ if (redoStrokes.length > 0) {
217
+ const nextStroke = redoStrokes[redoStrokes.length - 1];
218
+ if (nextStroke) {
219
+ allStrokes = [...allStrokes, nextStroke];
220
+ }
221
+ redoStrokes = redoStrokes.slice(0, -1);
222
+ }
223
+
224
+ isEmpty = false;
225
+ const dataUrl = canvasEl.toDataURL('image/png');
226
+ value = dataUrl;
227
+ onchange?.(dataUrl);
228
+ }
229
+
230
+ export function toSVG(): string {
231
+ const strokeHex = strokeColor === 'currentColor' ? 'currentColor' : strokeColor;
232
+ let paths = '';
233
+
234
+ for (const stroke of allStrokes) {
235
+ if (stroke.length === 0) continue;
236
+ const first = stroke[0];
237
+ if (!first) continue;
238
+
239
+ if (stroke.length === 1) {
240
+ paths += `<circle cx="${first.x.toFixed(1)}" cy="${first.y.toFixed(1)}" r="${(strokeWidth / 2).toFixed(1)}" fill="${strokeHex}" />\n`;
241
+ continue;
242
+ }
243
+ let d = `M ${first.x.toFixed(1)} ${first.y.toFixed(1)}`;
244
+ if (stroke.length === 2) {
245
+ const second = stroke[1];
246
+ if (second) {
247
+ d += ` L ${second.x.toFixed(1)} ${second.y.toFixed(1)}`;
248
+ }
249
+ } else {
250
+ for (let i = 1; i < stroke.length - 1; i++) {
251
+ const p1 = stroke[i];
252
+ const p2 = stroke[i + 1];
253
+ if (p1 && p2) {
254
+ const mid = { x: (p1.x + p2.x) / 2, y: (p1.y + p2.y) / 2 };
255
+ d += ` Q ${p1.x.toFixed(1)} ${p1.y.toFixed(1)}, ${mid.x.toFixed(1)} ${mid.y.toFixed(1)}`;
256
+ }
257
+ }
258
+ const last = stroke[stroke.length - 1];
259
+ if (last) {
260
+ d += ` L ${last.x.toFixed(1)} ${last.y.toFixed(1)}`;
261
+ }
262
+ }
263
+ paths += `<path d="${d}" fill="none" stroke="${strokeHex}" stroke-width="${strokeWidth}" stroke-linecap="round" stroke-linejoin="round" />\n`;
264
+ }
265
+
266
+ let timestampSvg = '';
267
+ if (withTimestamp) {
268
+ const ts = new Date().toISOString().replace('T', ' ').slice(0, 19) + ' UTC';
269
+ timestampSvg = `<text x="${width - 12}" y="${height - 10}" text-anchor="end" font-family="monospace" font-size="10" fill="currentColor" opacity="0.65">Signed: ${ts} (Verified)</text>\n`;
270
+ }
271
+
272
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}">\n${paths}${timestampSvg}</svg>`;
273
+ }
274
+
275
+ export function toDataURL(type = 'image/png'): string {
276
+ if (!canvasEl || isEmpty) return '';
277
+ if (!withTimestamp) {
278
+ return canvasEl.toDataURL(type);
279
+ }
280
+
281
+ // Embed tamper-evident verification timestamp watermark
282
+ const offscreen = document.createElement('canvas');
283
+ offscreen.width = canvasEl.width;
284
+ offscreen.height = canvasEl.height;
285
+ const ctx = offscreen.getContext('2d');
286
+ if (!ctx) return canvasEl.toDataURL(type);
287
+
288
+ ctx.drawImage(canvasEl, 0, 0);
289
+ ctx.font = '10px monospace';
290
+ ctx.fillStyle = 'rgba(113, 113, 122, 0.8)';
291
+ ctx.textAlign = 'right';
292
+ const ts = new Date().toISOString().replace('T', ' ').slice(0, 19) + ' UTC';
293
+ ctx.fillText(`Signed: ${ts} (Verified)`, offscreen.width - 12, offscreen.height - 10);
294
+
295
+ return offscreen.toDataURL(type);
296
+ }
297
+
175
298
  function handleSave() {
176
299
  if (isEmpty || !canvasEl) return;
177
- const dataUrl = canvasEl.toDataURL('image/png');
300
+ const dataUrl = toDataURL('image/png');
178
301
  onsave?.(dataUrl);
179
302
  }
180
303
 
181
- function handleDownload() {
304
+ function handleDownloadPNG() {
182
305
  if (isEmpty || !canvasEl) return;
183
306
  const a = document.createElement('a');
184
- a.href = canvasEl.toDataURL('image/png');
307
+ a.href = toDataURL('image/png');
185
308
  a.download = `signature_${Date.now()}.png`;
186
309
  a.click();
187
310
  }
188
311
 
312
+ function handleDownloadSVG() {
313
+ if (isEmpty) return;
314
+ const svgContent = toSVG();
315
+ const blob = new Blob([svgContent], { type: 'image/svg+xml;charset=utf-8' });
316
+ const url = URL.createObjectURL(blob);
317
+ const a = document.createElement('a');
318
+ a.href = url;
319
+ a.download = `signature_${Date.now()}.svg`;
320
+ a.click();
321
+ URL.revokeObjectURL(url);
322
+ }
323
+
189
324
  onMount(() => {
190
325
  if (canvasEl && value) {
191
326
  const img = new Image();
@@ -201,10 +336,16 @@
201
336
  });
202
337
  </script>
203
338
 
204
- <div data-svadmin-component="SignaturePad" class={cn('rounded-xl border border-border bg-card p-4 shadow-xs text-xs space-y-3', className)}>
339
+ <div data-svadmin-component="SignaturePad" class={cn('rounded-md border border-border bg-card p-4 shadow-xs text-xs space-y-3', className)}>
205
340
  <div class="flex items-center justify-between gap-2 pb-2 border-b border-border/60">
206
- <div class="font-semibold text-foreground">
207
- Electronic Signature <span class="text-muted-foreground font-normal">(Sign inside the box)</span>
341
+ <div class="font-semibold text-foreground flex items-center gap-2">
342
+ <span>Electronic Signature</span>
343
+ <span class="text-muted-foreground font-normal">(Sign inside the box)</span>
344
+ {#if withTimestamp}
345
+ <span class="font-mono text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground">
346
+ Timestamped
347
+ </span>
348
+ {/if}
208
349
  </div>
209
350
 
210
351
  <div class="flex items-center gap-1.5">
@@ -212,13 +353,24 @@
212
353
  variant="ghost"
213
354
  size="sm"
214
355
  class="h-7 text-xs gap-1 text-muted-foreground hover:text-foreground"
215
- disabled={history.length === 0 || disabled}
356
+ disabled={undoHistory.length === 0 || disabled}
216
357
  onclick={undo}
217
358
  >
218
359
  <RotateCcw class="h-3 w-3" />
219
360
  Undo
220
361
  </Button>
221
362
 
363
+ <Button
364
+ variant="ghost"
365
+ size="sm"
366
+ class="h-7 text-xs gap-1 text-muted-foreground hover:text-foreground"
367
+ disabled={redoHistory.length === 0 || disabled}
368
+ onclick={redo}
369
+ >
370
+ <RotateCw class="h-3 w-3" />
371
+ Redo
372
+ </Button>
373
+
222
374
  <Button
223
375
  variant="ghost"
224
376
  size="sm"
@@ -230,6 +382,18 @@
230
382
  Clear
231
383
  </Button>
232
384
 
385
+ <Button
386
+ variant="outline"
387
+ size="sm"
388
+ class="h-7 text-xs gap-1 text-muted-foreground hover:text-foreground"
389
+ disabled={isEmpty || disabled}
390
+ onclick={handleDownloadSVG}
391
+ title="Export Vector SVG"
392
+ >
393
+ <FileCode class="h-3 w-3" />
394
+ SVG
395
+ </Button>
396
+
233
397
  {#if onsave}
234
398
  <Button
235
399
  size="sm"
@@ -244,9 +408,9 @@
244
408
  <Button
245
409
  variant="outline"
246
410
  size="sm"
247
- class="h-7 text-xs gap-1"
411
+ class="h-7 text-xs gap-1 text-muted-foreground hover:text-foreground"
248
412
  disabled={isEmpty || disabled}
249
- onclick={handleDownload}
413
+ onclick={handleDownloadPNG}
250
414
  >
251
415
  <Download class="h-3 w-3" />
252
416
  Download
@@ -1,20 +1,21 @@
1
- interface Props {
1
+ export interface SignaturePadProps {
2
2
  value?: string;
3
3
  width?: number;
4
4
  height?: number;
5
5
  strokeColor?: string;
6
6
  strokeWidth?: number;
7
7
  disabled?: boolean;
8
+ withTimestamp?: boolean;
8
9
  onchange?: (dataUrl: string) => void;
9
10
  onsave?: (dataUrl: string) => void;
10
11
  class?: string;
11
12
  }
12
- declare const SignaturePad: import("svelte").Component<Props, {
13
+ declare const SignaturePad: import("svelte").Component<SignaturePadProps, {
13
14
  clear: () => void;
14
- toDataURL: (type?: string) => string;
15
- toSVG: () => string;
16
- getIsEmpty: () => boolean;
17
15
  undo: () => void;
16
+ redo: () => void;
17
+ toSVG: () => string;
18
+ toDataURL: (type?: string) => string;
18
19
  }, "value">;
19
20
  type SignaturePad = ReturnType<typeof SignaturePad>;
20
21
  export default SignaturePad;
@@ -326,7 +326,7 @@
326
326
 
327
327
  <div
328
328
  class={cn(
329
- 'relative select-none rounded-xl border border-border bg-card p-3 shadow-md transition-all',
329
+ 'relative select-none rounded-md border border-border bg-card p-3 shadow-md transition-all',
330
330
  isShaking && 'animate-shake',
331
331
  className
332
332
  )}
@@ -67,7 +67,7 @@
67
67
  <div
68
68
  bind:this={containerEl}
69
69
  class={cn(
70
- 'relative flex w-full h-full min-h-72 rounded-xl border border-border bg-card shadow-xs overflow-hidden select-none',
70
+ 'relative flex w-full h-full min-h-72 rounded-md border border-border bg-card shadow-xs overflow-hidden select-none',
71
71
  direction === 'horizontal' ? 'flex-row' : 'flex-col',
72
72
  className
73
73
  )}
@@ -1057,7 +1057,7 @@
1057
1057
  }
1058
1058
  </script>
1059
1059
 
1060
- <div data-testid="spreadsheet-view" class={cn('rounded-xl border border-border bg-card shadow-xs text-xs space-y-2 p-3 overflow-hidden', className)}>
1060
+ <div data-testid="spreadsheet-view" class={cn('rounded-md border border-border bg-card shadow-xs text-xs space-y-2 p-3 overflow-hidden', className)}>
1061
1061
  <div class="flex flex-wrap items-center justify-between gap-2 pb-2 border-b border-border/60">
1062
1062
  <div class="flex items-center gap-2">
1063
1063
  <FileSpreadsheet class="h-4 w-4 text-primary shrink-0" />
@@ -73,7 +73,7 @@
73
73
  }
74
74
  </script>
75
75
 
76
- <div class={cn('space-y-6 rounded-xl border border-border bg-card p-6 shadow-xs', className)}>
76
+ <div class={cn('space-y-6 rounded-md border border-border bg-card p-6 shadow-xs', className)}>
77
77
  <!-- Step Navigation Header -->
78
78
  <div class="flex items-center justify-between gap-2 overflow-x-auto pb-4 border-b border-border/60">
79
79
  {#each steps as step, index (index)}