pushfeedback 0.1.75 → 0.1.78
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.
- package/dist/cjs/canvas-editor_3.cjs.entry.js +40 -10
- package/dist/collection/components/canvas-editor/canvas-editor.css +177 -50
- package/dist/collection/components/canvas-editor/canvas-editor.js +36 -6
- package/dist/collection/components/feedback-modal/feedback-modal.css +174 -46
- package/dist/collection/components/feedback-modal/feedback-modal.js +2 -2
- package/dist/components/canvas-editor2.js +37 -7
- package/dist/components/feedback-modal2.js +3 -3
- package/dist/esm/canvas-editor_3.entry.js +40 -10
- package/dist/pushfeedback/p-ae56e858.entry.js +1 -0
- package/dist/pushfeedback/pushfeedback.esm.js +1 -1
- package/dist/types/components/canvas-editor/canvas-editor.d.ts +4 -0
- package/package.json +1 -1
- package/dist/pushfeedback/p-d9e138b1.entry.js +0 -1
|
@@ -22,31 +22,37 @@
|
|
|
22
22
|
|
|
23
23
|
.canvas-editor-modal {
|
|
24
24
|
width: 95vw;
|
|
25
|
-
|
|
26
|
-
max-
|
|
25
|
+
height: 95vh;
|
|
26
|
+
max-width: none;
|
|
27
|
+
max-height: none;
|
|
27
28
|
background: var(--feedback-canvas-editor-bg-color, #ffffff);
|
|
28
|
-
border-radius:
|
|
29
|
-
border: 1px solid
|
|
29
|
+
border-radius: 12px;
|
|
30
|
+
border: 1px solid rgba(0, 0, 0, 0.08);
|
|
30
31
|
display: flex;
|
|
31
32
|
flex-direction: column;
|
|
32
33
|
overflow: hidden;
|
|
33
|
-
box-shadow:
|
|
34
|
+
box-shadow:
|
|
35
|
+
0 0 0 1px rgba(0, 0, 0, 0.02),
|
|
36
|
+
0 8px 16px rgba(0, 0, 0, 0.08),
|
|
37
|
+
0 16px 32px rgba(0, 0, 0, 0.08),
|
|
38
|
+
0 32px 64px rgba(0, 0, 0, 0.06);
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
.canvas-editor-header {
|
|
37
|
-
background: var(--feedback-canvas-editor-header-bg-color, #
|
|
38
|
-
border-bottom: 1px solid
|
|
39
|
-
padding:
|
|
42
|
+
background: var(--feedback-canvas-editor-header-bg-color, #fafafa);
|
|
43
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
|
44
|
+
padding: 16px 20px;
|
|
40
45
|
display: flex;
|
|
41
46
|
flex-direction: column;
|
|
42
|
-
gap:
|
|
47
|
+
gap: 16px;
|
|
43
48
|
}
|
|
44
49
|
|
|
45
50
|
.canvas-editor-title h3 {
|
|
46
51
|
margin: 0;
|
|
47
|
-
font-size:
|
|
52
|
+
font-size: 18px;
|
|
48
53
|
font-weight: 600;
|
|
49
|
-
color: var(--feedback-canvas-editor-tool-text-color, #
|
|
54
|
+
color: var(--feedback-canvas-editor-tool-text-color, #1a1a1a);
|
|
55
|
+
letter-spacing: -0.02em;
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
.canvas-editor-toolbar {
|
|
@@ -75,11 +81,12 @@
|
|
|
75
81
|
align-items: center;
|
|
76
82
|
justify-content: center;
|
|
77
83
|
background: var(--feedback-canvas-editor-tool-bg-color, #ffffff);
|
|
78
|
-
border:
|
|
79
|
-
border-radius:
|
|
84
|
+
border: 1.5px solid rgba(0, 0, 0, 0.08);
|
|
85
|
+
border-radius: 8px;
|
|
80
86
|
cursor: pointer;
|
|
81
|
-
transition: all 0.2s
|
|
87
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
82
88
|
padding: 0;
|
|
89
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
83
90
|
}
|
|
84
91
|
|
|
85
92
|
.tool-btn svg {
|
|
@@ -89,13 +96,18 @@
|
|
|
89
96
|
}
|
|
90
97
|
|
|
91
98
|
.tool-btn:hover:not(:disabled) {
|
|
92
|
-
background: var(--feedback-canvas-editor-tool-bg-hover, #
|
|
99
|
+
background: var(--feedback-canvas-editor-tool-bg-hover, #f5f5f5);
|
|
100
|
+
border-color: rgba(0, 0, 0, 0.12);
|
|
101
|
+
transform: translateY(-1px);
|
|
102
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
|
|
93
103
|
}
|
|
94
104
|
|
|
95
105
|
.tool-btn.active,
|
|
96
106
|
.tool-btn.active:hover {
|
|
97
107
|
background: var(--feedback-canvas-editor-tool-bg-active, #0070f4);
|
|
98
108
|
color: var(--feedback-canvas-editor-tool-text-active, #ffffff);
|
|
109
|
+
border-color: var(--feedback-canvas-editor-tool-bg-active, #0070f4);
|
|
110
|
+
box-shadow: 0 2px 8px rgba(0, 112, 244, 0.3);
|
|
99
111
|
}
|
|
100
112
|
|
|
101
113
|
.tool-btn.active svg {
|
|
@@ -115,15 +127,32 @@
|
|
|
115
127
|
margin: 0 4px;
|
|
116
128
|
}
|
|
117
129
|
|
|
118
|
-
.undo-btn
|
|
130
|
+
.undo-btn,
|
|
131
|
+
.delete-btn {
|
|
119
132
|
background: var(--feedback-canvas-editor-tool-bg-color, #ffffff) !important;
|
|
120
133
|
border: 1px solid var(--feedback-canvas-editor-border-color, #e0e0e0) !important;
|
|
121
134
|
}
|
|
122
135
|
|
|
123
|
-
.undo-btn:hover:not(:disabled)
|
|
136
|
+
.undo-btn:hover:not(:disabled),
|
|
137
|
+
.delete-btn:hover:not(:disabled) {
|
|
124
138
|
background: var(--feedback-canvas-editor-tool-bg-hover, #f0f0f0) !important;
|
|
125
139
|
}
|
|
126
140
|
|
|
141
|
+
.undo-btn:disabled,
|
|
142
|
+
.delete-btn:disabled {
|
|
143
|
+
opacity: 0.3;
|
|
144
|
+
cursor: not-allowed;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.delete-btn:hover:not(:disabled) {
|
|
148
|
+
background: #fee !important;
|
|
149
|
+
border-color: #fcc !important;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.delete-btn:hover:not(:disabled) svg {
|
|
153
|
+
color: #c53030;
|
|
154
|
+
}
|
|
155
|
+
|
|
127
156
|
.color-palette {
|
|
128
157
|
display: flex;
|
|
129
158
|
align-items: center;
|
|
@@ -139,19 +168,21 @@
|
|
|
139
168
|
.color-btn {
|
|
140
169
|
width: 32px;
|
|
141
170
|
height: 32px;
|
|
142
|
-
border-radius:
|
|
171
|
+
border-radius: 8px;
|
|
143
172
|
border: 2px solid transparent;
|
|
144
173
|
cursor: pointer;
|
|
145
|
-
transition: all 0.2s
|
|
174
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
146
175
|
display: flex;
|
|
147
176
|
align-items: center;
|
|
148
177
|
justify-content: center;
|
|
149
178
|
background: var(--feedback-canvas-editor-tool-bg-color, #ffffff);
|
|
150
|
-
border:
|
|
179
|
+
border: 2px solid rgba(0, 0, 0, 0.08);
|
|
180
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
151
181
|
}
|
|
152
182
|
|
|
153
183
|
.color-btn:hover {
|
|
154
|
-
transform: scale(1.
|
|
184
|
+
transform: translateY(-2px) scale(1.05);
|
|
185
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
|
|
155
186
|
}
|
|
156
187
|
|
|
157
188
|
.color-btn.active {
|
|
@@ -196,41 +227,61 @@
|
|
|
196
227
|
|
|
197
228
|
.size-slider {
|
|
198
229
|
width: 80px;
|
|
199
|
-
height:
|
|
230
|
+
height: 14px;
|
|
200
231
|
-webkit-appearance: none;
|
|
201
232
|
appearance: none;
|
|
202
233
|
background: transparent;
|
|
234
|
+
border-radius: 2px;
|
|
235
|
+
outline: none;
|
|
203
236
|
cursor: pointer;
|
|
237
|
+
border: none;
|
|
238
|
+
position: relative;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.size-slider::before {
|
|
242
|
+
content: '';
|
|
243
|
+
position: absolute;
|
|
244
|
+
top: 50%;
|
|
245
|
+
left: 0;
|
|
246
|
+
right: 0;
|
|
247
|
+
height: 4px;
|
|
248
|
+
background: rgba(0, 0, 0, 0.15);
|
|
249
|
+
border-radius: 2px;
|
|
250
|
+
transform: translateY(-50%);
|
|
251
|
+
pointer-events: none;
|
|
204
252
|
}
|
|
205
253
|
|
|
206
254
|
.size-slider::-webkit-slider-track {
|
|
207
255
|
width: 100%;
|
|
208
256
|
height: 4px;
|
|
209
|
-
background:
|
|
257
|
+
background: transparent;
|
|
210
258
|
border-radius: 2px;
|
|
259
|
+
border: none;
|
|
211
260
|
}
|
|
212
261
|
|
|
213
262
|
.size-slider::-webkit-slider-thumb {
|
|
214
263
|
-webkit-appearance: none;
|
|
215
264
|
appearance: none;
|
|
216
|
-
width:
|
|
217
|
-
height:
|
|
265
|
+
width: 14px;
|
|
266
|
+
height: 14px;
|
|
218
267
|
background: var(--feedback-primary-color, #0070f4);
|
|
219
268
|
border-radius: 50%;
|
|
220
269
|
cursor: pointer;
|
|
270
|
+
position: relative;
|
|
271
|
+
z-index: 1;
|
|
221
272
|
}
|
|
222
273
|
|
|
223
274
|
.size-slider::-moz-range-track {
|
|
224
275
|
width: 100%;
|
|
225
276
|
height: 4px;
|
|
226
|
-
background:
|
|
277
|
+
background: transparent;
|
|
227
278
|
border-radius: 2px;
|
|
228
279
|
border: none;
|
|
229
280
|
}
|
|
230
281
|
|
|
231
282
|
.size-slider::-moz-range-thumb {
|
|
232
|
-
width:
|
|
233
|
-
height:
|
|
283
|
+
width: 14px;
|
|
284
|
+
height: 14px;
|
|
234
285
|
background: var(--feedback-primary-color, #0070f4);
|
|
235
286
|
border-radius: 50%;
|
|
236
287
|
border: none;
|
|
@@ -240,15 +291,15 @@
|
|
|
240
291
|
.size-slider::-ms-track {
|
|
241
292
|
width: 100%;
|
|
242
293
|
height: 4px;
|
|
243
|
-
background:
|
|
294
|
+
background: transparent;
|
|
244
295
|
border-radius: 2px;
|
|
245
296
|
border: none;
|
|
246
297
|
color: transparent;
|
|
247
298
|
}
|
|
248
299
|
|
|
249
300
|
.size-slider::-ms-thumb {
|
|
250
|
-
width:
|
|
251
|
-
height:
|
|
301
|
+
width: 14px;
|
|
302
|
+
height: 14px;
|
|
252
303
|
background: var(--feedback-primary-color, #0070f4);
|
|
253
304
|
border-radius: 50%;
|
|
254
305
|
border: none;
|
|
@@ -296,38 +347,49 @@
|
|
|
296
347
|
.action-btn {
|
|
297
348
|
display: flex;
|
|
298
349
|
align-items: center;
|
|
299
|
-
gap:
|
|
300
|
-
padding:
|
|
301
|
-
border:
|
|
302
|
-
border-radius:
|
|
350
|
+
gap: 8px;
|
|
351
|
+
padding: 0 20px;
|
|
352
|
+
border: 1.5px solid rgba(0, 0, 0, 0.08);
|
|
353
|
+
border-radius: 8px;
|
|
303
354
|
cursor: pointer;
|
|
304
|
-
font-size:
|
|
355
|
+
font-size: 14px;
|
|
305
356
|
font-weight: 500;
|
|
306
|
-
transition: all 0.2s
|
|
307
|
-
min-width:
|
|
357
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
358
|
+
min-width: 80px;
|
|
308
359
|
justify-content: center;
|
|
309
|
-
height:
|
|
360
|
+
height: 40px;
|
|
361
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
310
362
|
}
|
|
311
363
|
|
|
312
364
|
.action-btn.secondary {
|
|
313
365
|
background: var(--feedback-canvas-editor-tool-bg-color, #ffffff);
|
|
314
366
|
color: var(--feedback-canvas-editor-tool-text-color, #333);
|
|
315
|
-
border-color:
|
|
367
|
+
border-color: rgba(0, 0, 0, 0.08);
|
|
316
368
|
}
|
|
317
369
|
|
|
318
370
|
.action-btn.secondary:hover {
|
|
319
|
-
background: var(--feedback-canvas-editor-tool-bg-hover, #
|
|
371
|
+
background: var(--feedback-canvas-editor-tool-bg-hover, #f5f5f5);
|
|
372
|
+
border-color: rgba(0, 0, 0, 0.12);
|
|
373
|
+
transform: translateY(-1px);
|
|
374
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
|
|
320
375
|
}
|
|
321
376
|
|
|
322
377
|
.action-btn.primary {
|
|
323
378
|
background: var(--feedback-primary-color, #0070f4);
|
|
324
379
|
color: #ffffff;
|
|
325
380
|
border-color: var(--feedback-primary-color, #0070f4);
|
|
381
|
+
box-shadow: 0 2px 4px rgba(0, 112, 244, 0.2);
|
|
326
382
|
}
|
|
327
383
|
|
|
328
384
|
.action-btn.primary:hover {
|
|
329
385
|
background: #0056cc;
|
|
330
386
|
border-color: #0056cc;
|
|
387
|
+
transform: translateY(-1px);
|
|
388
|
+
box-shadow: 0 6px 12px rgba(0, 112, 244, 0.3);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.action-btn:active {
|
|
392
|
+
transform: translateY(0);
|
|
331
393
|
}
|
|
332
394
|
|
|
333
395
|
.action-btn.small {
|
|
@@ -349,32 +411,93 @@
|
|
|
349
411
|
display: flex;
|
|
350
412
|
align-items: center;
|
|
351
413
|
justify-content: center;
|
|
352
|
-
padding:
|
|
414
|
+
padding: 24px;
|
|
353
415
|
background: var(--feedback-canvas-editor-content-bg, #f5f5f5);
|
|
354
416
|
overflow: hidden;
|
|
355
417
|
min-height: 0;
|
|
356
418
|
min-width: 0;
|
|
419
|
+
position: relative;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/* Hide scroll indicators when at the edges */
|
|
423
|
+
.canvas-editor-content::-webkit-scrollbar {
|
|
424
|
+
width: 8px;
|
|
425
|
+
height: 8px;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.canvas-editor-content::-webkit-scrollbar-track {
|
|
429
|
+
background: transparent;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.canvas-editor-content::-webkit-scrollbar-thumb {
|
|
433
|
+
background: rgba(0, 0, 0, 0.2);
|
|
434
|
+
border-radius: 4px;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.canvas-editor-content::-webkit-scrollbar-thumb:hover {
|
|
438
|
+
background: rgba(0, 0, 0, 0.3);
|
|
357
439
|
}
|
|
358
440
|
|
|
359
441
|
.annotation-canvas {
|
|
360
|
-
max-width: 100
|
|
361
|
-
max-height: 100
|
|
362
|
-
width: auto;
|
|
363
|
-
height: auto;
|
|
442
|
+
max-width: calc(100% - 48px);
|
|
443
|
+
max-height: calc(100% - 48px);
|
|
444
|
+
width: auto !important;
|
|
445
|
+
height: auto !important;
|
|
364
446
|
cursor: crosshair;
|
|
365
|
-
border-radius:
|
|
366
|
-
box-shadow:
|
|
447
|
+
border-radius: 8px;
|
|
448
|
+
box-shadow:
|
|
449
|
+
0 0 0 1px rgba(0, 0, 0, 0.04),
|
|
450
|
+
0 4px 6px rgba(0, 0, 0, 0.06),
|
|
451
|
+
0 8px 16px rgba(0, 0, 0, 0.08);
|
|
367
452
|
background: #ffffff;
|
|
368
|
-
transition: box-shadow 0.3s
|
|
453
|
+
transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
369
454
|
object-fit: contain;
|
|
370
455
|
display: block;
|
|
456
|
+
margin: auto;
|
|
371
457
|
}
|
|
372
458
|
|
|
373
459
|
.annotation-canvas:hover {
|
|
374
|
-
box-shadow:
|
|
460
|
+
box-shadow:
|
|
461
|
+
0 0 0 1px rgba(0, 0, 0, 0.06),
|
|
462
|
+
0 6px 10px rgba(0, 0, 0, 0.08),
|
|
463
|
+
0 12px 24px rgba(0, 0, 0, 0.1);
|
|
375
464
|
}
|
|
376
465
|
|
|
377
466
|
/* Responsive Design */
|
|
467
|
+
|
|
468
|
+
/* Extra large screens */
|
|
469
|
+
@media screen and (min-width: 1920px) {
|
|
470
|
+
.canvas-editor-modal {
|
|
471
|
+
width: 90vw;
|
|
472
|
+
height: 90vh;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.canvas-editor-content {
|
|
476
|
+
padding: 32px;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/* Large screens */
|
|
481
|
+
@media screen and (min-width: 1200px) and (max-width: 1919px) {
|
|
482
|
+
.canvas-editor-modal {
|
|
483
|
+
width: 92vw;
|
|
484
|
+
height: 92vh;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
.canvas-editor-content {
|
|
488
|
+
padding: 28px;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/* Medium screens */
|
|
493
|
+
@media screen and (min-width: 769px) and (max-width: 1199px) {
|
|
494
|
+
.canvas-editor-modal {
|
|
495
|
+
width: 95vw;
|
|
496
|
+
height: 95vh;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/* Mobile and tablet */
|
|
378
501
|
@media screen and (max-width: 768px) {
|
|
379
502
|
.canvas-editor-modal {
|
|
380
503
|
width: 100vw;
|
|
@@ -401,4 +524,8 @@
|
|
|
401
524
|
margin-top: 8px;
|
|
402
525
|
min-width: auto;
|
|
403
526
|
}
|
|
527
|
+
|
|
528
|
+
.canvas-editor-content {
|
|
529
|
+
padding: 16px;
|
|
530
|
+
}
|
|
404
531
|
}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
2
|
export class CanvasEditor {
|
|
3
3
|
constructor() {
|
|
4
|
+
this.handleWindowResize = () => {
|
|
5
|
+
// Debounce resize events
|
|
6
|
+
if (this.resizeTimeout) {
|
|
7
|
+
clearTimeout(this.resizeTimeout);
|
|
8
|
+
}
|
|
9
|
+
this.resizeTimeout = setTimeout(() => {
|
|
10
|
+
if (this.showCanvasEditor && this.originalImageData) {
|
|
11
|
+
this.initializeCanvas();
|
|
12
|
+
}
|
|
13
|
+
}, 250);
|
|
14
|
+
};
|
|
4
15
|
this.openScreenShot = async () => {
|
|
5
16
|
// Show loading state immediately
|
|
6
17
|
this.takingScreenshot = true;
|
|
@@ -96,14 +107,16 @@ export class CanvasEditor {
|
|
|
96
107
|
// Set canvas to original image dimensions
|
|
97
108
|
this.canvasRef.width = img.width;
|
|
98
109
|
this.canvasRef.height = img.height;
|
|
99
|
-
// Get available container dimensions
|
|
100
|
-
const containerWidth = this.canvasRef.parentElement.clientWidth -
|
|
101
|
-
const containerHeight = this.canvasRef.parentElement.clientHeight -
|
|
110
|
+
// Get available container dimensions with more generous padding
|
|
111
|
+
const containerWidth = this.canvasRef.parentElement.clientWidth - 48;
|
|
112
|
+
const containerHeight = this.canvasRef.parentElement.clientHeight - 48;
|
|
102
113
|
// Calculate scale factors for both dimensions
|
|
103
114
|
const scaleX = containerWidth / img.width;
|
|
104
115
|
const scaleY = containerHeight / img.height;
|
|
105
|
-
// Use
|
|
106
|
-
|
|
116
|
+
// Use a more aggressive scaling approach for large screens
|
|
117
|
+
// Allow scaling up to 1.5x on very large screens, but still maintain aspect ratio
|
|
118
|
+
const maxScale = window.innerWidth > 1920 ? 1.5 : (window.innerWidth > 1200 ? 1.2 : 1);
|
|
119
|
+
const scale = Math.min(scaleX, scaleY, maxScale);
|
|
107
120
|
// Calculate final display dimensions
|
|
108
121
|
const displayWidth = img.width * scale;
|
|
109
122
|
const displayHeight = img.height * scale;
|
|
@@ -255,6 +268,16 @@ export class CanvasEditor {
|
|
|
255
268
|
this.annotations = this.annotations.slice(0, -1);
|
|
256
269
|
this.redrawAnnotations();
|
|
257
270
|
};
|
|
271
|
+
this.deleteSelectedAnnotation = () => {
|
|
272
|
+
if (this.selectedAnnotation) {
|
|
273
|
+
const index = this.annotations.findIndex(a => a === this.selectedAnnotation);
|
|
274
|
+
if (index !== -1) {
|
|
275
|
+
this.annotations = this.annotations.filter((_, i) => i !== index);
|
|
276
|
+
this.selectedAnnotation = null;
|
|
277
|
+
this.redrawAnnotations();
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
};
|
|
258
281
|
// Handle color slot editing
|
|
259
282
|
this.handleColorSlotClick = (colorIndex) => {
|
|
260
283
|
if (this.editingColorIndex === colorIndex) {
|
|
@@ -768,6 +791,13 @@ export class CanvasEditor {
|
|
|
768
791
|
this.initializeCanvas();
|
|
769
792
|
}, 100);
|
|
770
793
|
}
|
|
794
|
+
// Add window resize listener for canvas adaptation
|
|
795
|
+
this.handleWindowResize = this.handleWindowResize.bind(this);
|
|
796
|
+
window.addEventListener('resize', this.handleWindowResize);
|
|
797
|
+
}
|
|
798
|
+
disconnectedCallback() {
|
|
799
|
+
// Clean up resize listener
|
|
800
|
+
window.removeEventListener('resize', this.handleWindowResize);
|
|
771
801
|
}
|
|
772
802
|
async captureViewportScreenshot() {
|
|
773
803
|
try {
|
|
@@ -828,7 +858,7 @@ export class CanvasEditor {
|
|
|
828
858
|
}
|
|
829
859
|
render() {
|
|
830
860
|
var _a, _b, _c, _d, _e, _f;
|
|
831
|
-
return (h("div", { class: "canvas-editor-wrapper" }, this.showCanvasEditor && (h("div", { class: "canvas-editor-overlay" }, h("div", { class: "canvas-editor-modal" }, h("div", { class: "canvas-editor-header" }, h("div", { class: "canvas-editor-title" }, h("h3", null, this.canvasEditorTitle)), h("div", { class: "canvas-editor-toolbar" }, h("div", { class: "toolbar-section" }, h("div", { class: "tool-group" }, h("button", { class: `tool-btn ${this.canvasDrawingTool === 'rectangle' ? 'active' : ''}`, onClick: () => this.canvasDrawingTool = 'rectangle', title: "Rectangle" }, h("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("rect", {
|
|
861
|
+
return (h("div", { class: "canvas-editor-wrapper" }, this.showCanvasEditor && (h("div", { class: "canvas-editor-overlay" }, h("div", { class: "canvas-editor-modal" }, h("div", { class: "canvas-editor-header" }, h("div", { class: "canvas-editor-title" }, h("h3", null, this.canvasEditorTitle)), h("div", { class: "canvas-editor-toolbar" }, h("div", { class: "toolbar-section" }, h("div", { class: "tool-group" }, h("button", { class: `tool-btn ${this.canvasDrawingTool === 'rectangle' ? 'active' : ''}`, onClick: () => this.canvasDrawingTool = 'rectangle', title: "Rectangle" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "lucide lucide-square" }, h("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }))), h("button", { class: `tool-btn ${this.canvasDrawingTool === 'line' ? 'active' : ''}`, onClick: () => this.canvasDrawingTool = 'line', title: "Line" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "lucide lucide-minus" }, h("path", { d: "M5 12h14" }))), h("button", { class: `tool-btn ${this.canvasDrawingTool === 'arrow' ? 'active' : ''}`, onClick: () => this.canvasDrawingTool = 'arrow', title: "Arrow" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "lucide lucide-move-up-right" }, h("path", { d: "M13 5H19V11" }), h("path", { d: "M19 5L5 19" }))), h("button", { class: `tool-btn ${this.canvasDrawingTool === 'text' ? 'active' : ''}`, onClick: () => this.canvasDrawingTool = 'text', title: "Text" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "lucide lucide-type" }, h("path", { d: "M12 4v16" }), h("path", { d: "M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2" }), h("path", { d: "M9 20h6" }))), h("div", { class: "toolbar-divider" }), h("button", { class: "tool-btn undo-btn", onClick: this.undoLastAnnotation, disabled: this.annotations.length === 0, title: "Undo" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "lucide lucide-undo" }, h("path", { d: "M3 7v6h6" }), h("path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13" }))), this.selectedAnnotation && (h("button", { class: "tool-btn delete-btn", onClick: this.deleteSelectedAnnotation, title: "Delete" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "lucide lucide-trash-2" }, h("path", { d: "M3 6h18" }), h("path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" }), h("path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" }), h("line", { x1: "10", x2: "10", y1: "11", y2: "17" }), h("line", { x1: "14", x2: "14", y1: "11", y2: "17" })))))), h("div", { class: "toolbar-section" }, h("div", { class: "color-palette" }, this.defaultColors.map((color, index) => (h("div", { class: "color-slot-wrapper" }, h("button", { class: `color-btn ${this.canvasDrawingColor === color ? 'active' : ''} ${this.editingColorIndex === index ? 'editing' : ''}`, style: { backgroundColor: color }, onClick: () => this.handleColorSlotClick(index), title: `Color ${index + 1} - Click to customize` }, this.editingColorIndex === index && (h("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "white", "stroke-width": "2" }, h("path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" })))), this.editingColorIndex === index && this.showColorPicker && (h("div", { class: "color-picker-dropdown" }, h("input", { type: "color", value: color, onInput: (e) => this.handleColorPickerInput(e), onClick: (e) => this.handleColorPickerClick(e) })))))))), (this.selectedAnnotation || this.canvasDrawingTool) && (h("div", { class: "toolbar-section selected-annotation-controls" }, (((_a = this.selectedAnnotation) === null || _a === void 0 ? void 0 : _a.type) === 'text' || (!this.selectedAnnotation && this.canvasDrawingTool === 'text')) && (h("div", { class: "text-controls" }, h("div", { class: "font-size-control" }, h("label", null, this.sizeLabelText), h("input", { type: "range", min: "8", max: "72", value: ((_b = this.selectedAnnotation) === null || _b === void 0 ? void 0 : _b.fontSize) || this.canvasTextSize, onInput: (e) => {
|
|
832
862
|
const newSize = parseInt(e.target.value);
|
|
833
863
|
if (this.selectedAnnotation) {
|
|
834
864
|
this.updateSelectedTextSize(newSize);
|