pushfeedback 0.1.82 → 0.1.83
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 +77 -57
- package/dist/collection/components/canvas-editor/canvas-editor.js +57 -42
- package/dist/collection/components/feedback-button/feedback-button.js +2 -2
- package/dist/collection/components/feedback-modal/feedback-modal.css +40 -0
- package/dist/collection/components/feedback-modal/feedback-modal.js +17 -12
- package/dist/components/canvas-editor2.js +57 -42
- package/dist/components/feedback-button.js +2 -2
- package/dist/components/feedback-modal2.js +18 -13
- package/dist/esm/canvas-editor_3.entry.js +77 -57
- package/dist/pushfeedback/p-1338beed.entry.js +1 -0
- package/dist/pushfeedback/pushfeedback.css +1 -1
- package/dist/pushfeedback/pushfeedback.esm.js +1 -1
- package/package.json +1 -1
- package/dist/pushfeedback/p-69f4eacb.entry.js +0 -1
|
@@ -24,7 +24,7 @@ export class CanvasEditor {
|
|
|
24
24
|
this.hideAllFeedbackElements();
|
|
25
25
|
try {
|
|
26
26
|
// Wait a moment for UI to update before capturing
|
|
27
|
-
await new Promise(resolve => setTimeout(resolve, 100));
|
|
27
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
28
28
|
// Capture viewport screenshot using browser API
|
|
29
29
|
const dataUrl = await this.captureViewportScreenshot();
|
|
30
30
|
this.originalImageData = dataUrl;
|
|
@@ -52,14 +52,14 @@ export class CanvasEditor {
|
|
|
52
52
|
this.hideAllFeedbackElements = () => {
|
|
53
53
|
// Hide all feedback buttons and modals on the page
|
|
54
54
|
const feedbackElements = document.querySelectorAll('feedback-button, feedback-modal');
|
|
55
|
-
feedbackElements.forEach(element => {
|
|
55
|
+
feedbackElements.forEach((element) => {
|
|
56
56
|
element.style.visibility = 'hidden';
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
59
|
this.showAllFeedbackElements = () => {
|
|
60
60
|
// Show all feedback buttons and modals on the page
|
|
61
61
|
const feedbackElements = document.querySelectorAll('feedback-button, feedback-modal');
|
|
62
|
-
feedbackElements.forEach(element => {
|
|
62
|
+
feedbackElements.forEach((element) => {
|
|
63
63
|
element.style.visibility = 'visible';
|
|
64
64
|
});
|
|
65
65
|
};
|
|
@@ -115,7 +115,7 @@ export class CanvasEditor {
|
|
|
115
115
|
const scaleY = containerHeight / img.height;
|
|
116
116
|
// Use a more aggressive scaling approach for large screens
|
|
117
117
|
// Allow scaling up to 1.5x on very large screens, but still maintain aspect ratio
|
|
118
|
-
const maxScale = window.innerWidth > 1920 ? 1.5 :
|
|
118
|
+
const maxScale = window.innerWidth > 1920 ? 1.5 : window.innerWidth > 1200 ? 1.2 : 1;
|
|
119
119
|
const scale = Math.min(scaleX, scaleY, maxScale);
|
|
120
120
|
// Calculate final display dimensions
|
|
121
121
|
const displayWidth = img.width * scale;
|
|
@@ -139,7 +139,7 @@ export class CanvasEditor {
|
|
|
139
139
|
this.canvasContext.clearRect(0, 0, this.canvasRef.width, this.canvasRef.height);
|
|
140
140
|
this.canvasContext.drawImage(img, 0, 0);
|
|
141
141
|
// Draw all annotations
|
|
142
|
-
this.annotations.forEach(annotation => {
|
|
142
|
+
this.annotations.forEach((annotation) => {
|
|
143
143
|
this.drawAnnotation(annotation);
|
|
144
144
|
});
|
|
145
145
|
};
|
|
@@ -189,7 +189,7 @@ export class CanvasEditor {
|
|
|
189
189
|
this.drawLineResizeHandles(annotation);
|
|
190
190
|
}
|
|
191
191
|
break;
|
|
192
|
-
case 'text':
|
|
192
|
+
case 'text': {
|
|
193
193
|
const fontSize = annotation.fontSize || 24;
|
|
194
194
|
this.canvasContext.fillStyle = annotation.color;
|
|
195
195
|
this.canvasContext.font = `${fontSize}px Arial`;
|
|
@@ -199,6 +199,7 @@ export class CanvasEditor {
|
|
|
199
199
|
this.drawTextSelectionIndicator(annotation);
|
|
200
200
|
}
|
|
201
201
|
break;
|
|
202
|
+
}
|
|
202
203
|
}
|
|
203
204
|
};
|
|
204
205
|
// Draw selection indicator for shapes
|
|
@@ -270,7 +271,7 @@ export class CanvasEditor {
|
|
|
270
271
|
};
|
|
271
272
|
this.deleteSelectedAnnotation = () => {
|
|
272
273
|
if (this.selectedAnnotation) {
|
|
273
|
-
const index = this.annotations.findIndex(a => a === this.selectedAnnotation);
|
|
274
|
+
const index = this.annotations.findIndex((a) => a === this.selectedAnnotation);
|
|
274
275
|
if (index !== -1) {
|
|
275
276
|
this.annotations = this.annotations.filter((_, i) => i !== index);
|
|
276
277
|
this.selectedAnnotation = null;
|
|
@@ -341,26 +342,32 @@ export class CanvasEditor {
|
|
|
341
342
|
this.isPointInResizeHandle = (x, y, annotation) => {
|
|
342
343
|
const handleSize = 8;
|
|
343
344
|
switch (annotation.type) {
|
|
344
|
-
case 'rectangle':
|
|
345
|
+
case 'rectangle': {
|
|
345
346
|
const right = annotation.startX + annotation.width;
|
|
346
347
|
const bottom = annotation.startY + annotation.height;
|
|
347
348
|
// Only check bottom-right corner handle
|
|
348
|
-
return x >= right - handleSize / 2 &&
|
|
349
|
-
|
|
349
|
+
return (x >= right - handleSize / 2 &&
|
|
350
|
+
x <= right + handleSize / 2 &&
|
|
351
|
+
y >= bottom - handleSize / 2 &&
|
|
352
|
+
y <= bottom + handleSize / 2);
|
|
353
|
+
}
|
|
350
354
|
case 'line':
|
|
351
|
-
case 'arrow':
|
|
355
|
+
case 'arrow': {
|
|
352
356
|
// Check both endpoint handles
|
|
353
357
|
const lineHandles = [
|
|
354
358
|
{ x: annotation.startX, y: annotation.startY, point: 'start' },
|
|
355
|
-
{ x: annotation.endX, y: annotation.endY, point: 'end' }
|
|
359
|
+
{ x: annotation.endX, y: annotation.endY, point: 'end' },
|
|
356
360
|
];
|
|
357
361
|
for (const handle of lineHandles) {
|
|
358
|
-
if (x >= handle.x - handleSize / 2 &&
|
|
359
|
-
|
|
362
|
+
if (x >= handle.x - handleSize / 2 &&
|
|
363
|
+
x <= handle.x + handleSize / 2 &&
|
|
364
|
+
y >= handle.y - handleSize / 2 &&
|
|
365
|
+
y <= handle.y + handleSize / 2) {
|
|
360
366
|
return handle.point; // Return which endpoint was clicked
|
|
361
367
|
}
|
|
362
368
|
}
|
|
363
369
|
return false;
|
|
370
|
+
}
|
|
364
371
|
default:
|
|
365
372
|
return false;
|
|
366
373
|
}
|
|
@@ -389,13 +396,13 @@ export class CanvasEditor {
|
|
|
389
396
|
// Define handle positions (2 endpoints)
|
|
390
397
|
const handles = [
|
|
391
398
|
{ x: annotation.startX, y: annotation.startY },
|
|
392
|
-
{ x: annotation.endX, y: annotation.endY } // End point
|
|
399
|
+
{ x: annotation.endX, y: annotation.endY }, // End point
|
|
393
400
|
];
|
|
394
401
|
// Draw each handle
|
|
395
402
|
this.canvasContext.fillStyle = '#0070F4'; // Primary color
|
|
396
403
|
this.canvasContext.strokeStyle = '#ffffff';
|
|
397
404
|
this.canvasContext.lineWidth = 2;
|
|
398
|
-
handles.forEach(handle => {
|
|
405
|
+
handles.forEach((handle) => {
|
|
399
406
|
this.canvasContext.fillRect(handle.x - handleSize / 2, handle.y - handleSize / 2, handleSize, handleSize);
|
|
400
407
|
this.canvasContext.strokeRect(handle.x - handleSize / 2, handle.y - handleSize / 2, handleSize, handleSize);
|
|
401
408
|
});
|
|
@@ -416,12 +423,12 @@ export class CanvasEditor {
|
|
|
416
423
|
if (!this.resizingAnnotation || !this.dragStartPos)
|
|
417
424
|
return;
|
|
418
425
|
const annotation = this.resizingAnnotation;
|
|
419
|
-
const index = this.annotations.findIndex(a => a === annotation);
|
|
426
|
+
const index = this.annotations.findIndex((a) => a === annotation);
|
|
420
427
|
if (index === -1)
|
|
421
428
|
return;
|
|
422
|
-
|
|
429
|
+
const updatedAnnotation = Object.assign({}, annotation);
|
|
423
430
|
switch (annotation.type) {
|
|
424
|
-
case 'rectangle':
|
|
431
|
+
case 'rectangle': {
|
|
425
432
|
// Rectangle resize logic - only bottom-right corner
|
|
426
433
|
const rectDeltaX = currentPos.x - this.dragStartPos.x;
|
|
427
434
|
const rectDeltaY = currentPos.y - this.dragStartPos.y;
|
|
@@ -429,6 +436,7 @@ export class CanvasEditor {
|
|
|
429
436
|
updatedAnnotation.width = Math.max(10, this.resizeStartDimensions.width + rectDeltaX);
|
|
430
437
|
updatedAnnotation.height = Math.max(10, this.resizeStartDimensions.height + rectDeltaY);
|
|
431
438
|
break;
|
|
439
|
+
}
|
|
432
440
|
case 'line':
|
|
433
441
|
case 'arrow':
|
|
434
442
|
// Line/arrow resize logic - move endpoints
|
|
@@ -451,7 +459,7 @@ export class CanvasEditor {
|
|
|
451
459
|
this.startTextEditing = (annotation) => {
|
|
452
460
|
const newText = prompt(this.editTextPromptText, annotation.text);
|
|
453
461
|
if (newText !== null && newText.trim()) {
|
|
454
|
-
const index = this.annotations.findIndex(a => a === annotation);
|
|
462
|
+
const index = this.annotations.findIndex((a) => a === annotation);
|
|
455
463
|
if (index !== -1) {
|
|
456
464
|
this.annotations[index] = Object.assign(Object.assign({}, annotation), { text: newText.trim() });
|
|
457
465
|
this.selectedAnnotation = this.annotations[index];
|
|
@@ -462,7 +470,7 @@ export class CanvasEditor {
|
|
|
462
470
|
// Update selected annotation font size
|
|
463
471
|
this.updateSelectedTextSize = (newSize) => {
|
|
464
472
|
if (this.selectedAnnotation && this.selectedAnnotation.type === 'text') {
|
|
465
|
-
const index = this.annotations.findIndex(a => a === this.selectedAnnotation);
|
|
473
|
+
const index = this.annotations.findIndex((a) => a === this.selectedAnnotation);
|
|
466
474
|
if (index !== -1) {
|
|
467
475
|
this.annotations[index] = Object.assign(Object.assign({}, this.selectedAnnotation), { fontSize: Math.max(8, Math.min(72, newSize)) });
|
|
468
476
|
this.selectedAnnotation = this.annotations[index];
|
|
@@ -472,8 +480,9 @@ export class CanvasEditor {
|
|
|
472
480
|
};
|
|
473
481
|
// Update selected annotation border width
|
|
474
482
|
this.updateSelectedBorderWidth = (newWidth) => {
|
|
475
|
-
if (this.selectedAnnotation &&
|
|
476
|
-
|
|
483
|
+
if (this.selectedAnnotation &&
|
|
484
|
+
['rectangle', 'line', 'arrow'].includes(this.selectedAnnotation.type)) {
|
|
485
|
+
const index = this.annotations.findIndex((a) => a === this.selectedAnnotation);
|
|
477
486
|
if (index !== -1) {
|
|
478
487
|
this.annotations[index] = Object.assign(Object.assign({}, this.selectedAnnotation), { lineWidth: Math.max(1, Math.min(20, newWidth)) });
|
|
479
488
|
this.selectedAnnotation = this.annotations[index];
|
|
@@ -536,7 +545,7 @@ export class CanvasEditor {
|
|
|
536
545
|
y: coords.y,
|
|
537
546
|
text,
|
|
538
547
|
color: this.canvasDrawingColor,
|
|
539
|
-
fontSize: this.canvasTextSize
|
|
548
|
+
fontSize: this.canvasTextSize,
|
|
540
549
|
};
|
|
541
550
|
this.annotations = [...this.annotations, annotation];
|
|
542
551
|
this.redrawAnnotations();
|
|
@@ -549,7 +558,7 @@ export class CanvasEditor {
|
|
|
549
558
|
startX: coords.x,
|
|
550
559
|
startY: coords.y,
|
|
551
560
|
color: this.canvasDrawingColor,
|
|
552
|
-
lineWidth: this.canvasLineWidth
|
|
561
|
+
lineWidth: this.canvasLineWidth,
|
|
553
562
|
};
|
|
554
563
|
}
|
|
555
564
|
};
|
|
@@ -589,7 +598,7 @@ export class CanvasEditor {
|
|
|
589
598
|
break;
|
|
590
599
|
}
|
|
591
600
|
// Update annotation in array
|
|
592
|
-
const index = this.annotations.findIndex(a => a === this.draggedAnnotation);
|
|
601
|
+
const index = this.annotations.findIndex((a) => a === this.draggedAnnotation);
|
|
593
602
|
if (index !== -1) {
|
|
594
603
|
this.annotations[index] = updatedAnnotation;
|
|
595
604
|
this.draggedAnnotation = updatedAnnotation;
|
|
@@ -702,22 +711,26 @@ export class CanvasEditor {
|
|
|
702
711
|
this.isPointInAnnotation = (x, y, annotation) => {
|
|
703
712
|
const tolerance = 10; // Click tolerance
|
|
704
713
|
switch (annotation.type) {
|
|
705
|
-
case 'rectangle':
|
|
714
|
+
case 'rectangle': {
|
|
706
715
|
const left = Math.min(annotation.startX, annotation.startX + annotation.width);
|
|
707
716
|
const right = Math.max(annotation.startX, annotation.startX + annotation.width);
|
|
708
717
|
const top = Math.min(annotation.startY, annotation.startY + annotation.height);
|
|
709
718
|
const bottom = Math.max(annotation.startY, annotation.startY + annotation.height);
|
|
710
|
-
return x >= left - tolerance &&
|
|
711
|
-
|
|
719
|
+
return (x >= left - tolerance &&
|
|
720
|
+
x <= right + tolerance &&
|
|
721
|
+
y >= top - tolerance &&
|
|
722
|
+
y <= bottom + tolerance);
|
|
723
|
+
}
|
|
712
724
|
case 'line':
|
|
713
|
-
case 'arrow':
|
|
725
|
+
case 'arrow': {
|
|
714
726
|
// Distance from point to line
|
|
715
727
|
const A = annotation.endY - annotation.startY;
|
|
716
728
|
const B = annotation.startX - annotation.endX;
|
|
717
729
|
const C = annotation.endX * annotation.startY - annotation.startX * annotation.endY;
|
|
718
730
|
const distance = Math.abs(A * x + B * y + C) / Math.sqrt(A * A + B * B);
|
|
719
731
|
return distance <= tolerance;
|
|
720
|
-
|
|
732
|
+
}
|
|
733
|
+
case 'text': {
|
|
721
734
|
// Use actual text dimensions for better dragging
|
|
722
735
|
const fontSize = annotation.fontSize || 24;
|
|
723
736
|
const textWidth = this.getTextWidth(annotation.text, fontSize);
|
|
@@ -727,8 +740,8 @@ export class CanvasEditor {
|
|
|
727
740
|
const textRight = annotation.x + textWidth + tolerance;
|
|
728
741
|
const textTop = annotation.y - textHeight - tolerance;
|
|
729
742
|
const textBottom = annotation.y + tolerance;
|
|
730
|
-
return x >= textLeft && x <= textRight &&
|
|
731
|
-
|
|
743
|
+
return x >= textLeft && x <= textRight && y >= textTop && y <= textBottom;
|
|
744
|
+
}
|
|
732
745
|
default:
|
|
733
746
|
return false;
|
|
734
747
|
}
|
|
@@ -810,10 +823,10 @@ export class CanvasEditor {
|
|
|
810
823
|
video: {
|
|
811
824
|
mediaSource: 'screen',
|
|
812
825
|
width: { ideal: window.innerWidth },
|
|
813
|
-
height: { ideal: window.innerHeight }
|
|
826
|
+
height: { ideal: window.innerHeight },
|
|
814
827
|
},
|
|
815
828
|
audio: false,
|
|
816
|
-
preferCurrentTab: true
|
|
829
|
+
preferCurrentTab: true,
|
|
817
830
|
});
|
|
818
831
|
// Create video element to capture frame
|
|
819
832
|
const video = document.createElement('video');
|
|
@@ -833,20 +846,20 @@ export class CanvasEditor {
|
|
|
833
846
|
const ctx = canvas.getContext('2d');
|
|
834
847
|
ctx.drawImage(video, 0, 0);
|
|
835
848
|
// Stop the stream
|
|
836
|
-
stream.getTracks().forEach(track => track.stop());
|
|
849
|
+
stream.getTracks().forEach((track) => track.stop());
|
|
837
850
|
// Convert to data URL
|
|
838
851
|
const dataUrl = canvas.toDataURL('image/png');
|
|
839
852
|
console.log('Screenshot captured successfully using Screen Capture API');
|
|
840
853
|
resolve(dataUrl);
|
|
841
854
|
}
|
|
842
855
|
catch (error) {
|
|
843
|
-
stream.getTracks().forEach(track => track.stop());
|
|
856
|
+
stream.getTracks().forEach((track) => track.stop());
|
|
844
857
|
reject(error);
|
|
845
858
|
}
|
|
846
859
|
}, 100);
|
|
847
860
|
};
|
|
848
861
|
video.onerror = () => {
|
|
849
|
-
stream.getTracks().forEach(track => track.stop());
|
|
862
|
+
stream.getTracks().forEach((track) => track.stop());
|
|
850
863
|
reject(new Error('Failed to load video for screenshot capture'));
|
|
851
864
|
};
|
|
852
865
|
});
|
|
@@ -858,7 +871,8 @@ export class CanvasEditor {
|
|
|
858
871
|
}
|
|
859
872
|
render() {
|
|
860
873
|
var _a, _b, _c, _d, _e, _f;
|
|
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' ||
|
|
874
|
+
return (h("div", { class: "canvas-editor-wrapper" }, this.showCanvasEditor && (h("div", { class: "canvas-editor-overlay", part: "overlay" }, h("div", { class: "canvas-editor-modal", part: "modal" }, h("div", { class: "canvas-editor-header", part: "header" }, h("div", { class: "canvas-editor-title", part: "title" }, h("h3", null, this.canvasEditorTitle)), h("div", { class: "canvas-editor-toolbar", part: "toolbar" }, h("div", { class: "toolbar-section" }, h("div", { class: "tool-group" }, h("button", { class: `tool-btn ${this.canvasDrawingTool === 'rectangle' ? 'active' : ''}`, part: "tool-button", 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' : ''}`, part: "tool-button", 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' : ''}`, part: "tool-button", 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' : ''}`, part: "tool-button", 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", part: "tool-button", 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", part: "tool-button", 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' ||
|
|
875
|
+
(!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) => {
|
|
862
876
|
const newSize = parseInt(e.target.value);
|
|
863
877
|
if (this.selectedAnnotation) {
|
|
864
878
|
this.updateSelectedTextSize(newSize);
|
|
@@ -866,8 +880,9 @@ export class CanvasEditor {
|
|
|
866
880
|
else {
|
|
867
881
|
this.canvasTextSize = newSize;
|
|
868
882
|
}
|
|
869
|
-
}, class: "size-slider" }), h("span", { class: "size-value" }, ((_c = this.selectedAnnotation) === null || _c === void 0 ? void 0 : _c.fontSize) || this.canvasTextSize, "px")), this.selectedAnnotation && (h("button", { class: "action-btn small", onClick: () => this.startTextEditing(this.selectedAnnotation) }, this.editTextButtonText)))), (
|
|
870
|
-
(!this.selectedAnnotation &&
|
|
883
|
+
}, class: "size-slider" }), h("span", { class: "size-value" }, ((_c = this.selectedAnnotation) === null || _c === void 0 ? void 0 : _c.fontSize) || this.canvasTextSize, "px")), this.selectedAnnotation && (h("button", { class: "action-btn small", onClick: () => this.startTextEditing(this.selectedAnnotation) }, this.editTextButtonText)))), (['rectangle', 'line', 'arrow'].includes((_d = this.selectedAnnotation) === null || _d === void 0 ? void 0 : _d.type) ||
|
|
884
|
+
(!this.selectedAnnotation &&
|
|
885
|
+
['rectangle', 'line', 'arrow'].includes(this.canvasDrawingTool))) && (h("div", { class: "shape-controls" }, h("div", { class: "border-width-control" }, h("label", null, this.borderLabelText), h("input", { type: "range", min: "1", max: "20", value: ((_e = this.selectedAnnotation) === null || _e === void 0 ? void 0 : _e.lineWidth) || this.canvasLineWidth, onInput: (e) => {
|
|
871
886
|
const newWidth = parseInt(e.target.value);
|
|
872
887
|
if (this.selectedAnnotation) {
|
|
873
888
|
this.updateSelectedBorderWidth(newWidth);
|
|
@@ -875,7 +890,7 @@ export class CanvasEditor {
|
|
|
875
890
|
else {
|
|
876
891
|
this.canvasLineWidth = newWidth;
|
|
877
892
|
}
|
|
878
|
-
}, class: "size-slider" }), h("span", { class: "size-value" }, ((_f = this.selectedAnnotation) === null || _f === void 0 ? void 0 : _f.lineWidth) || this.canvasLineWidth, "px")))))), h("div", { class: "toolbar-section" }, h("button", { class: "action-btn secondary", onClick: this.closeCanvasEditor }, this.canvasEditorCancelText), h("button", { class: "action-btn primary", onClick: this.saveAnnotations }, this.canvasEditorSaveText))), h("div", { class: "canvas-editor-content" }, h("canvas", { ref: (el) => this.canvasRef = el, class: "annotation-canvas", onMouseDown: this.handleCanvasMouseDown, onMouseMove: this.handleCanvasMouseMove, onMouseUp: this.handleCanvasMouseUp, onMouseLeave: this.handleCanvasMouseUp }))))))));
|
|
893
|
+
}, class: "size-slider" }), h("span", { class: "size-value" }, ((_f = this.selectedAnnotation) === null || _f === void 0 ? void 0 : _f.lineWidth) || this.canvasLineWidth, "px")))))), h("div", { class: "toolbar-section" }, h("button", { class: "action-btn secondary", part: "cancel-button", onClick: this.closeCanvasEditor }, this.canvasEditorCancelText), h("button", { class: "action-btn primary", part: "save-button", onClick: this.saveAnnotations }, this.canvasEditorSaveText))), h("div", { class: "canvas-editor-content", part: "content" }, h("canvas", { ref: (el) => (this.canvasRef = el), class: "annotation-canvas", part: "canvas", onMouseDown: this.handleCanvasMouseDown, onMouseMove: this.handleCanvasMouseMove, onMouseUp: this.handleCanvasMouseUp, onMouseLeave: this.handleCanvasMouseUp }))))))));
|
|
879
894
|
}
|
|
880
895
|
static get is() { return "canvas-editor"; }
|
|
881
896
|
static get encapsulation() { return "shadow"; }
|
|
@@ -188,7 +188,7 @@ export class FeedbackButton {
|
|
|
188
188
|
else if (res.status === 202) {
|
|
189
189
|
const limitExceededBody = {
|
|
190
190
|
message: "You received a new feedback entry. You've reached the 25 message limit for your current plan. Upgrade to continue receiving feedback.",
|
|
191
|
-
id: await res.json()
|
|
191
|
+
id: await res.json(),
|
|
192
192
|
};
|
|
193
193
|
this.feedbackSent.emit({ feedback: limitExceededBody });
|
|
194
194
|
}
|
|
@@ -210,7 +210,7 @@ export class FeedbackButton {
|
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
render() {
|
|
213
|
-
return (h(Host, null, h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle} feedback-button-content--${this.buttonPosition} ${this.customFont ? 'feedback-button-content--custom-font' : ''} ${this.hideMobile ? 'feedback-button-content--hide-mobile' : ''}`, onClick: () => this.showModal() }, !this.hideIcon && this.buttonStyle != 'default' && (h("span", { class: "feedback-button-content-icon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "icon-edit" }, h("path", { d: "M12 20h9" }), h("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" })))), h("slot", null))));
|
|
213
|
+
return (h(Host, null, h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle} feedback-button-content--${this.buttonPosition} ${this.customFont ? 'feedback-button-content--custom-font' : ''} ${this.hideMobile ? 'feedback-button-content--hide-mobile' : ''}`, part: "button", onClick: () => this.showModal() }, !this.hideIcon && this.buttonStyle != 'default' && (h("span", { class: "feedback-button-content-icon", part: "icon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "icon-edit" }, h("path", { d: "M12 20h9" }), h("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" })))), h("slot", null))));
|
|
214
214
|
}
|
|
215
215
|
static get is() { return "feedback-button"; }
|
|
216
216
|
static get encapsulation() { return "shadow"; }
|
|
@@ -154,6 +154,16 @@
|
|
|
154
154
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--positive {
|
|
158
|
+
background-color: var(--feedback-modal-rating-button-positive-bg-color);
|
|
159
|
+
border-color: var(--feedback-modal-rating-button-positive-border-color);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--negative {
|
|
163
|
+
background-color: var(--feedback-modal-rating-button-negative-bg-color);
|
|
164
|
+
border-color: var(--feedback-modal-rating-button-negative-border-color);
|
|
165
|
+
}
|
|
166
|
+
|
|
157
167
|
.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button:hover {
|
|
158
168
|
transform: translateY(-2px);
|
|
159
169
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
|
|
@@ -176,6 +186,36 @@
|
|
|
176
186
|
cursor: pointer;
|
|
177
187
|
}
|
|
178
188
|
|
|
189
|
+
.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--positive svg {
|
|
190
|
+
stroke: var(--feedback-modal-rating-button-positive-color);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--negative svg {
|
|
194
|
+
stroke: var(--feedback-modal-rating-button-negative-color);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--positive:hover,
|
|
198
|
+
.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--positive.feedback-modal-rating-button--selected {
|
|
199
|
+
background-color: var(--feedback-modal-rating-button-positive-selected-bg-color);
|
|
200
|
+
border-color: var(--feedback-modal-rating-button-positive-selected-border-color);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--negative:hover,
|
|
204
|
+
.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--negative.feedback-modal-rating-button--selected {
|
|
205
|
+
background-color: var(--feedback-modal-rating-button-negative-selected-bg-color);
|
|
206
|
+
border-color: var(--feedback-modal-rating-button-negative-selected-border-color);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--positive:hover svg,
|
|
210
|
+
.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--positive.feedback-modal-rating-button--selected svg {
|
|
211
|
+
stroke: var(--feedback-modal-rating-button-positive-selected-color);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--negative:hover svg,
|
|
215
|
+
.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--negative.feedback-modal-rating-button--selected svg {
|
|
216
|
+
stroke: var(--feedback-modal-rating-button-negative-selected-color);
|
|
217
|
+
}
|
|
218
|
+
|
|
179
219
|
.feedback-modal-rating-buttons--stars .feedback-modal-rating-button--selected svg {
|
|
180
220
|
fill: var(--feedback-modal-rating-button-stars-selected-color);
|
|
181
221
|
stroke: var(--feedback-modal-rating-button-stars-selected-color);
|
|
@@ -51,7 +51,7 @@ export class FeedbackModal {
|
|
|
51
51
|
else if (res.status === 202) {
|
|
52
52
|
const limitExceededBody = {
|
|
53
53
|
message: "You received a new feedback entry. You've reached the 25 message limit for your current plan. Upgrade to continue receiving feedback.",
|
|
54
|
-
id: await res.json()
|
|
54
|
+
id: await res.json(),
|
|
55
55
|
};
|
|
56
56
|
this.feedbackSent.emit({ feedback: limitExceededBody });
|
|
57
57
|
this.formSuccess = true;
|
|
@@ -94,7 +94,7 @@ export class FeedbackModal {
|
|
|
94
94
|
this.hasSelectedElement = false;
|
|
95
95
|
this.encodedScreenshot = null;
|
|
96
96
|
// Remove highlight from ALL selected elements
|
|
97
|
-
document.querySelectorAll('.feedback-modal-element-selected').forEach(el => {
|
|
97
|
+
document.querySelectorAll('.feedback-modal-element-selected').forEach((el) => {
|
|
98
98
|
el.classList.remove('feedback-modal-element-selected');
|
|
99
99
|
});
|
|
100
100
|
// Reset form states
|
|
@@ -272,7 +272,7 @@ export class FeedbackModal {
|
|
|
272
272
|
// Wait for grecaptcha to be available
|
|
273
273
|
let attempts = 0;
|
|
274
274
|
while (!window['grecaptcha'] && attempts < 50) {
|
|
275
|
-
await new Promise(resolve => setTimeout(resolve, 100));
|
|
275
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
276
276
|
attempts++;
|
|
277
277
|
}
|
|
278
278
|
if (!window['grecaptcha']) {
|
|
@@ -284,7 +284,7 @@ export class FeedbackModal {
|
|
|
284
284
|
window['grecaptcha'].ready(async () => {
|
|
285
285
|
try {
|
|
286
286
|
const token = await window['grecaptcha'].execute(this.recaptchaSiteKey, {
|
|
287
|
-
action: 'submit_feedback'
|
|
287
|
+
action: 'submit_feedback',
|
|
288
288
|
});
|
|
289
289
|
resolve(token);
|
|
290
290
|
}
|
|
@@ -322,23 +322,28 @@ export class FeedbackModal {
|
|
|
322
322
|
this.selectedRating = newRating;
|
|
323
323
|
}
|
|
324
324
|
render() {
|
|
325
|
-
return (h("div", { class: `feedback-modal-wrapper ${this.customFont ? 'feedback-modal-wrapper--custom-font' : ''} ${this.embedded ? 'feedback-modal-wrapper--embedded' : ''}
|
|
325
|
+
return (h("div", { class: `feedback-modal-wrapper ${this.customFont ? 'feedback-modal-wrapper--custom-font' : ''} ${this.embedded ? 'feedback-modal-wrapper--embedded' : ''}`, part: "wrapper" }, this.showCanvasEditor && (h("canvas-editor", { ref: (el) => (this.canvasEditorRef = el), exportparts: "overlay: canvas-editor-overlay, modal: canvas-editor-modal, header: canvas-editor-header, title: canvas-editor-title, toolbar: canvas-editor-toolbar, tool-button: canvas-editor-tool-button, cancel-button: canvas-editor-cancel-button, save-button: canvas-editor-save-button, content: canvas-editor-content, canvas: canvas-editor-canvas", "canvas-editor-title": this.screenshotEditorTitle, "canvas-editor-cancel-text": this.screenshotEditorCancelText, "canvas-editor-save-text": this.screenshotEditorSaveText, "screenshot-taking-text": this.screenshotTakingText, "screenshot-attached-text": this.screenshotAttachedText, "screenshot-button-text": this.screenshotButtonText, "auto-start-screenshot": this.autoStartCapture, "existing-screenshot": this.encodedScreenshot || '', "edit-text-button-text": this.screenshotEditTextButtonText, "size-label-text": this.screenshotSizeLabelText, "border-label-text": this.screenshotBorderLabelText, "edit-text-prompt-text": this.screenshotEditTextPromptText, "screenshot-error-general": this.screenshotErrorGeneral, "screenshot-error-permission": this.screenshotErrorPermission, "screenshot-error-not-supported": this.screenshotErrorNotSupported, "screenshot-error-not-found": this.screenshotErrorNotFound, "screenshot-error-cancelled": this.screenshotErrorCancelled, "screenshot-error-browser-not-supported": this.screenshotErrorBrowserNotSupported, "screenshot-error-unexpected": this.screenshotErrorUnexpected, onScreenshotReady: this.handleScreenshotReady, onScreenshotCancelled: this.handleScreenshotCancelled, onScreenshotFailed: this.handleScreenshotError })), this.showScreenshotError && (h("div", { class: "screenshot-error-notification" }, h("div", { class: "screenshot-error-content" }, h("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("circle", { cx: "12", cy: "12", r: "10" }), h("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), h("line", { x1: "9", y1: "9", x2: "15", y2: "15" })), h("span", null, this.screenshotError), h("button", { class: "error-close-btn", onClick: () => (this.showScreenshotError = false), title: "Close" }, h("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))))), this.showModal && !this.embedded && (h("div", { class: `feedback-overlay ${this.isAnimating ? 'feedback-overlay--visible' : ''}`, part: "overlay" })), this.showModal && (h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.isAnimating ? 'feedback-modal-content--open' : ''} ${this.embedded ? 'feedback-modal-content--embedded' : ''}`, part: "modal", ref: (el) => (this.modalContent = el) }, h("div", { class: `feedback-modal-header ${(this.formSuccess && !this.successMessage) || (this.formError && !this.errorMessage)
|
|
326
|
+
? 'feedback-modal-header--no-content'
|
|
327
|
+
: ''}`, part: "header" }, h("div", { class: "feedback-modal-header-content" }, !this.formSuccess && !this.formError ? (h("div", { class: "feedback-modal-header-text" }, h("span", { class: "feedback-modal-title", part: "title" }, this.modalTitle), !this.whitelabel && (h("span", { class: "feedback-modal-powered-by", part: "powered-by" }, "Powered by", ' ', h("a", { target: "_blank", href: "https://pushfeedback.com" }, "PushFeedback"))))) : this.formSuccess ? (h("span", { class: "feedback-modal-title", part: "title" }, this.modalTitleSuccess)) : (h("span", { class: "feedback-modal-title", part: "title" }, this.modalTitleError))), !this.embedded && (h("button", { class: "feedback-modal-close", part: "close-button", onClick: this.close }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "#191919", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-x" }, h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))))), h("div", { class: "feedback-modal-body", part: "body" }, !this.formSuccess && !this.formError ? (h("form", { part: "form", onSubmit: this.handleSubmit }, !this.hideRating && (h("div", { class: "feedback-modal-rating", part: "rating" }, this.ratingMode === 'thumbs' ? (h("div", { class: "feedback-modal-rating-content" }, h("span", { class: "feedback-modal-input-heading", part: "rating-title" }, this.ratingPlaceholder), h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--thumbs", part: "rating-buttons" }, h("button", { title: "Yes", class: `feedback-modal-rating-button feedback-modal-rating-button--positive ${this.selectedRating === 1
|
|
326
328
|
? 'feedback-modal-rating-button--selected'
|
|
327
|
-
: ''}`, onClick: (event) => {
|
|
329
|
+
: ''}`, part: "rating-button rating-button-positive", onClick: (event) => {
|
|
328
330
|
event.preventDefault();
|
|
329
331
|
this.handleRatingChange(1);
|
|
330
|
-
} }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3" }))), h("button", { title: "No", class: `feedback-modal-rating-button ${this.selectedRating === 5
|
|
332
|
+
} }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3" }))), h("button", { title: "No", class: `feedback-modal-rating-button feedback-modal-rating-button--negative ${this.selectedRating === 5
|
|
331
333
|
? 'feedback-modal-rating-button--selected'
|
|
332
|
-
: ''}`, onClick: (event) => {
|
|
334
|
+
: ''}`, part: "rating-button rating-button-negative", onClick: (event) => {
|
|
333
335
|
event.preventDefault();
|
|
334
336
|
this.handleRatingChange(5);
|
|
335
|
-
} }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17" })))))) : (h("div", { class: "feedback-modal-rating-content" }, h("span", { class: "feedback-modal-input-heading" }, this.ratingStarsPlaceholder), h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--stars" }, [1, 2, 3, 4, 5].map((rating) => (h("button", { key: rating, class: `feedback-modal-rating-button ${this.selectedRating >= rating
|
|
337
|
+
} }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17" })))))) : (h("div", { class: "feedback-modal-rating-content" }, h("span", { class: "feedback-modal-input-heading", part: "rating-title" }, this.ratingStarsPlaceholder), h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--stars", part: "rating-buttons" }, [1, 2, 3, 4, 5].map((rating) => (h("button", { key: rating, class: `feedback-modal-rating-button ${this.selectedRating >= rating
|
|
336
338
|
? 'feedback-modal-rating-button--selected'
|
|
337
|
-
: ''}`, onClick: (event) => {
|
|
339
|
+
: ''}`, part: "rating-button", onClick: (event) => {
|
|
338
340
|
event.preventDefault();
|
|
339
341
|
this.handleRatingChange(rating);
|
|
340
|
-
} }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" })))))))))), h("div", { class: "feedback-modal-text" }, h("textarea", { placeholder: this.messagePlaceholder, value: this.formMessage, onInput: (event) => this.handleMessageInput(event) })), !this.hideEmail && (h("div", { class: "feedback-modal-email" }, h("input", { placeholder: this.emailPlaceholder, type: "email", onInput: (event) => this.handleEmailInput(event), value: this.formEmail, required: this.isEmailRequired }))), h("div", { class: "feedback-verification" }, h("input", { type: "text", name: "verification", style: { display: 'none' }, onInput: (event) => this.handleVerification(event), value: this.formVerification })), !this.hidePrivacyPolicy && (h("div", { class: "feedback-modal-privacy" }, h("input", { type: "checkbox", id: "privacyPolicy", onChange: (ev) => this.handleCheckboxChange(ev), required: true }), h("span", { innerHTML: this.privacyPolicyText }))), h("div", { class: `feedback-modal-buttons ${this.hideScreenshotButton ? 'single' : ''}
|
|
341
|
-
|
|
342
|
+
} }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" })))))))))), h("div", { class: "feedback-modal-text" }, h("textarea", { part: "message-input", placeholder: this.messagePlaceholder, value: this.formMessage, onInput: (event) => this.handleMessageInput(event) })), !this.hideEmail && (h("div", { class: "feedback-modal-email" }, h("input", { part: "email-input", placeholder: this.emailPlaceholder, type: "email", onInput: (event) => this.handleEmailInput(event), value: this.formEmail, required: this.isEmailRequired }))), h("div", { class: "feedback-verification" }, h("input", { type: "text", name: "verification", style: { display: 'none' }, onInput: (event) => this.handleVerification(event), value: this.formVerification })), !this.hidePrivacyPolicy && (h("div", { class: "feedback-modal-privacy", part: "privacy" }, h("input", { type: "checkbox", id: "privacyPolicy", onChange: (ev) => this.handleCheckboxChange(ev), required: true }), h("span", { innerHTML: this.privacyPolicyText }))), h("div", { class: `feedback-modal-buttons ${this.hideScreenshotButton ? 'single' : ''}`, part: "buttons" }, !this.hideScreenshotButton && (h("button", { type: "button", class: `feedback-modal-button feedback-modal-button--screenshot ${this.encodedScreenshot ? 'feedback-modal-button--active' : ''}`, part: "screenshot-button", onClick: this.openScreenShot, disabled: this.sending || this.takingScreenshot }, this.encodedScreenshot && (h("div", { class: "screenshot-preview", onClick: this.openCanvasEditor }, h("img", { src: this.encodedScreenshot, alt: "Screenshot Preview" }))), !this.encodedScreenshot && !this.takingScreenshot && (h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 -960 960 960", width: "24" }, h("path", { d: "M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80ZM200-200v-200h80v120h120v80H200Zm0-360v-200h200v80H280v120h-80Zm480 0v-120H560v-80h200v200h-80Z" }))), this.takingScreenshot && (h("div", { class: "screenshot-loading" }, h("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#666", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather-loader" }, h("line", { x1: "12", y1: "2", x2: "12", y2: "6" }), h("line", { x1: "12", y1: "18", x2: "12", y2: "22" }), h("line", { x1: "4.93", y1: "4.93", x2: "7.76", y2: "7.76" }), h("line", { x1: "16.24", y1: "16.24", x2: "19.07", y2: "19.07" }), h("line", { x1: "2", y1: "12", x2: "6", y2: "12" }), h("line", { x1: "18", y1: "12", x2: "22", y2: "12" }), h("line", { x1: "4.93", y1: "19.07", x2: "7.76", y2: "16.24" }), h("line", { x1: "16.24", y1: "7.76", x2: "19.07", y2: "4.93" })))), this.takingScreenshot
|
|
343
|
+
? this.screenshotTakingText
|
|
344
|
+
: this.encodedScreenshot
|
|
345
|
+
? this.screenshotAttachedText
|
|
346
|
+
: this.screenshotButtonText)), h("button", { class: "feedback-modal-button feedback-modal-button--submit", part: "submit-button", type: "submit", disabled: this.sending }, this.sendButtonText)))) : this.formSuccess && !this.formError ? (h("div", { class: "feedback-modal-success" }, h("p", { class: "feedback-modal-message", part: "success-message" }, this.successMessage))) : this.formError && this.formErrorStatus == 404 ? (h("p", { class: "feedback-modal-message", part: "error-message" }, this.errorMessage404)) : this.formError && this.formErrorStatus == 403 ? (h("p", { class: "feedback-modal-message", part: "error-message" }, this.errorMessage403)) : this.formError ? (h("p", { class: "feedback-modal-message", part: "error-message" }, this.errorMessage)) : (h("span", null))), !this.formSuccess && !this.formError && (this.recaptchaEnabled || this.footerText) && (h("div", { class: "feedback-modal-footer", part: "footer" }, h("div", { class: "feedback-footer-combined" }, this.recaptchaEnabled && h("span", { innerHTML: this.recaptchaText }), this.recaptchaEnabled && this.footerText && ' ', this.footerText && h("span", { innerHTML: this.footerText }))))))));
|
|
342
347
|
}
|
|
343
348
|
componentDidRender() {
|
|
344
349
|
if (this.showModal) {
|