pushfeedback 0.1.68 → 0.1.69
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/feedback-button_2.cjs.entry.js +164 -8880
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pushfeedback.cjs.js +1 -1
- package/dist/collection/components/feedback-modal/feedback-modal.css +107 -0
- package/dist/collection/components/feedback-modal/feedback-modal.js +166 -74
- package/dist/components/feedback-modal2.js +167 -8880
- package/dist/esm/feedback-button_2.entry.js +164 -8880
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pushfeedback.js +1 -1
- package/dist/pushfeedback/p-e7f48090.entry.js +1 -0
- package/dist/pushfeedback/pushfeedback.esm.js +1 -1
- package/dist/types/components/feedback-modal/feedback-modal.d.ts +9 -0
- package/package.json +1 -1
- package/dist/pushfeedback/p-7406f7be.entry.js +0 -7
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"buttonPosition":[1,"button-position"],"buttonStyle":[1,"button-style"],"hideIcon":[4,"hide-icon"],"hideMobile":[4,"hide-mobile"],"sessionId":[1537,"session-id"],"metadata":[1],"submit":[4],"customFont":[4,"custom-font"],"emailAddress":[1,"email-address"],"isEmailRequired":[4,"is-email-required"],"fetchData":[4,"fetch-data"],"hideEmail":[4,"hide-email"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"hideRating":[4,"hide-rating"],"hideScreenshotButton":[4,"hide-screenshot-button"],"modalPosition":[1,"modal-position"],"project":[1],"rating":[2],"ratingMode":[1,"rating-mode"],"canvasEditorTitle":[1,"canvas-editor-title"],"canvasEditorCancelText":[1,"canvas-editor-cancel-text"],"canvasEditorSaveText":[1,"canvas-editor-save-text"],"emailPlaceholder":[1,"email-placeholder"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"footerText":[1,"footer-text"],"messagePlaceholder":[1,"message-placeholder"],"modalTitle":[1,"modal-title"],"modalTitleError":[1,"modal-title-error"],"modalTitleSuccess":[1,"modal-title-success"],"privacyPolicyText":[1,"privacy-policy-text"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"screenshotAttachedText":[1,"screenshot-attached-text"],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTakingText":[1,"screenshot-taking-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"]}],[1,"feedback-modal",{"customFont":[4,"custom-font"],"emailAddress":[1,"email-address"],"hideEmail":[4,"hide-email"],"isEmailRequired":[4,"is-email-required"],"ratingMode":[1,"rating-mode"],"hasSelectedElement":[1540,"has-selected-element"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"hideRating":[4,"hide-rating"],"hideScreenshotButton":[4,"hide-screenshot-button"],"project":[1],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"showModal":[1540,"show-modal"],"rating":[2],"metadata":[1],"fetchData":[4,"fetch-data"],"emailPlaceholder":[1,"email-placeholder"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"messagePlaceholder":[1,"message-placeholder"],"footerText":[1,"footer-text"],"modalPosition":[1,"modal-position"],"modalTitle":[1,"modal-title"],"modalTitleError":[1,"modal-title-error"],"modalTitleSuccess":[1,"modal-title-success"],"privacyPolicyText":[1,"privacy-policy-text"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"sendButtonText":[1,"send-button-text"],"screenshotAttachedText":[1,"screenshot-attached-text"],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTakingText":[1,"screenshot-taking-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"successMessage":[1,"success-message"],"canvasEditorTitle":[1,"canvas-editor-title"],"canvasEditorCancelText":[1,"canvas-editor-cancel-text"],"canvasEditorSaveText":[1,"canvas-editor-save-text"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formVerification":[32],"formError":[32],"formErrorStatus":[32],"encodedScreenshot":[32],"isPrivacyChecked":[32],"whitelabel":[32],"selectedRating":[32],"overlayVisible":[32],"isAnimating":[32],"takingScreenshot":[32],"showPreviewModal":[32],"showCanvasEditor":[32],"canvasDrawingTool":[32],"canvasDrawingColor":[32],"canvasLineWidth":[32],"isDrawing":[32],"annotations":[32],"currentAnnotation":[32],"isDragging":[32],"draggedAnnotation":[32],"dragStartPos":[32],"showColorPicker":[32],"editingColorIndex":[32],"isResizing":[32],"resizingAnnotation":[32],"resizeStartSize":[32],"hoveredAnnotation":[32],"resizeHandle":[32],"defaultColors":[32],"openModal":[64]}]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"buttonPosition":[1,"button-position"],"buttonStyle":[1,"button-style"],"hideIcon":[4,"hide-icon"],"hideMobile":[4,"hide-mobile"],"sessionId":[1537,"session-id"],"metadata":[1],"submit":[4],"customFont":[4,"custom-font"],"emailAddress":[1,"email-address"],"isEmailRequired":[4,"is-email-required"],"fetchData":[4,"fetch-data"],"hideEmail":[4,"hide-email"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"hideRating":[4,"hide-rating"],"hideScreenshotButton":[4,"hide-screenshot-button"],"modalPosition":[1,"modal-position"],"project":[1],"rating":[2],"ratingMode":[1,"rating-mode"],"canvasEditorTitle":[1,"canvas-editor-title"],"canvasEditorCancelText":[1,"canvas-editor-cancel-text"],"canvasEditorSaveText":[1,"canvas-editor-save-text"],"emailPlaceholder":[1,"email-placeholder"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"footerText":[1,"footer-text"],"messagePlaceholder":[1,"message-placeholder"],"modalTitle":[1,"modal-title"],"modalTitleError":[1,"modal-title-error"],"modalTitleSuccess":[1,"modal-title-success"],"privacyPolicyText":[1,"privacy-policy-text"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"screenshotAttachedText":[1,"screenshot-attached-text"],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTakingText":[1,"screenshot-taking-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"]}],[1,"feedback-modal",{"customFont":[4,"custom-font"],"emailAddress":[1,"email-address"],"hideEmail":[4,"hide-email"],"isEmailRequired":[4,"is-email-required"],"ratingMode":[1,"rating-mode"],"hasSelectedElement":[1540,"has-selected-element"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"hideRating":[4,"hide-rating"],"hideScreenshotButton":[4,"hide-screenshot-button"],"project":[1],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"showModal":[1540,"show-modal"],"rating":[2],"metadata":[1],"fetchData":[4,"fetch-data"],"emailPlaceholder":[1,"email-placeholder"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"messagePlaceholder":[1,"message-placeholder"],"footerText":[1,"footer-text"],"modalPosition":[1,"modal-position"],"modalTitle":[1,"modal-title"],"modalTitleError":[1,"modal-title-error"],"modalTitleSuccess":[1,"modal-title-success"],"privacyPolicyText":[1,"privacy-policy-text"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"sendButtonText":[1,"send-button-text"],"screenshotAttachedText":[1,"screenshot-attached-text"],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTakingText":[1,"screenshot-taking-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"successMessage":[1,"success-message"],"canvasEditorTitle":[1,"canvas-editor-title"],"canvasEditorCancelText":[1,"canvas-editor-cancel-text"],"canvasEditorSaveText":[1,"canvas-editor-save-text"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formVerification":[32],"formError":[32],"formErrorStatus":[32],"encodedScreenshot":[32],"isPrivacyChecked":[32],"whitelabel":[32],"selectedRating":[32],"overlayVisible":[32],"isAnimating":[32],"takingScreenshot":[32],"showPreviewModal":[32],"screenshotError":[32],"showScreenshotError":[32],"showCanvasEditor":[32],"canvasDrawingTool":[32],"canvasDrawingColor":[32],"canvasLineWidth":[32],"isDrawing":[32],"annotations":[32],"currentAnnotation":[32],"isDragging":[32],"draggedAnnotation":[32],"dragStartPos":[32],"showColorPicker":[32],"editingColorIndex":[32],"isResizing":[32],"resizingAnnotation":[32],"resizeStartSize":[32],"resizeStartDimensions":[32],"hoveredAnnotation":[32],"resizeHandle":[32],"defaultColors":[32],"openModal":[64]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"buttonPosition":[1,"button-position"],"buttonStyle":[1,"button-style"],"hideIcon":[4,"hide-icon"],"hideMobile":[4,"hide-mobile"],"sessionId":[1537,"session-id"],"metadata":[1],"submit":[4],"customFont":[4,"custom-font"],"emailAddress":[1,"email-address"],"isEmailRequired":[4,"is-email-required"],"fetchData":[4,"fetch-data"],"hideEmail":[4,"hide-email"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"hideRating":[4,"hide-rating"],"hideScreenshotButton":[4,"hide-screenshot-button"],"modalPosition":[1,"modal-position"],"project":[1],"rating":[2],"ratingMode":[1,"rating-mode"],"canvasEditorTitle":[1,"canvas-editor-title"],"canvasEditorCancelText":[1,"canvas-editor-cancel-text"],"canvasEditorSaveText":[1,"canvas-editor-save-text"],"emailPlaceholder":[1,"email-placeholder"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"footerText":[1,"footer-text"],"messagePlaceholder":[1,"message-placeholder"],"modalTitle":[1,"modal-title"],"modalTitleError":[1,"modal-title-error"],"modalTitleSuccess":[1,"modal-title-success"],"privacyPolicyText":[1,"privacy-policy-text"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"screenshotAttachedText":[1,"screenshot-attached-text"],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTakingText":[1,"screenshot-taking-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"]}],[1,"feedback-modal",{"customFont":[4,"custom-font"],"emailAddress":[1,"email-address"],"hideEmail":[4,"hide-email"],"isEmailRequired":[4,"is-email-required"],"ratingMode":[1,"rating-mode"],"hasSelectedElement":[1540,"has-selected-element"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"hideRating":[4,"hide-rating"],"hideScreenshotButton":[4,"hide-screenshot-button"],"project":[1],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"showModal":[1540,"show-modal"],"rating":[2],"metadata":[1],"fetchData":[4,"fetch-data"],"emailPlaceholder":[1,"email-placeholder"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"messagePlaceholder":[1,"message-placeholder"],"footerText":[1,"footer-text"],"modalPosition":[1,"modal-position"],"modalTitle":[1,"modal-title"],"modalTitleError":[1,"modal-title-error"],"modalTitleSuccess":[1,"modal-title-success"],"privacyPolicyText":[1,"privacy-policy-text"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"sendButtonText":[1,"send-button-text"],"screenshotAttachedText":[1,"screenshot-attached-text"],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTakingText":[1,"screenshot-taking-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"successMessage":[1,"success-message"],"canvasEditorTitle":[1,"canvas-editor-title"],"canvasEditorCancelText":[1,"canvas-editor-cancel-text"],"canvasEditorSaveText":[1,"canvas-editor-save-text"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formVerification":[32],"formError":[32],"formErrorStatus":[32],"encodedScreenshot":[32],"isPrivacyChecked":[32],"whitelabel":[32],"selectedRating":[32],"overlayVisible":[32],"isAnimating":[32],"takingScreenshot":[32],"showPreviewModal":[32],"showCanvasEditor":[32],"canvasDrawingTool":[32],"canvasDrawingColor":[32],"canvasLineWidth":[32],"isDrawing":[32],"annotations":[32],"currentAnnotation":[32],"isDragging":[32],"draggedAnnotation":[32],"dragStartPos":[32],"showColorPicker":[32],"editingColorIndex":[32],"isResizing":[32],"resizingAnnotation":[32],"resizeStartSize":[32],"hoveredAnnotation":[32],"resizeHandle":[32],"defaultColors":[32],"openModal":[64]}]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"buttonPosition":[1,"button-position"],"buttonStyle":[1,"button-style"],"hideIcon":[4,"hide-icon"],"hideMobile":[4,"hide-mobile"],"sessionId":[1537,"session-id"],"metadata":[1],"submit":[4],"customFont":[4,"custom-font"],"emailAddress":[1,"email-address"],"isEmailRequired":[4,"is-email-required"],"fetchData":[4,"fetch-data"],"hideEmail":[4,"hide-email"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"hideRating":[4,"hide-rating"],"hideScreenshotButton":[4,"hide-screenshot-button"],"modalPosition":[1,"modal-position"],"project":[1],"rating":[2],"ratingMode":[1,"rating-mode"],"canvasEditorTitle":[1,"canvas-editor-title"],"canvasEditorCancelText":[1,"canvas-editor-cancel-text"],"canvasEditorSaveText":[1,"canvas-editor-save-text"],"emailPlaceholder":[1,"email-placeholder"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"footerText":[1,"footer-text"],"messagePlaceholder":[1,"message-placeholder"],"modalTitle":[1,"modal-title"],"modalTitleError":[1,"modal-title-error"],"modalTitleSuccess":[1,"modal-title-success"],"privacyPolicyText":[1,"privacy-policy-text"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"screenshotAttachedText":[1,"screenshot-attached-text"],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTakingText":[1,"screenshot-taking-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"]}],[1,"feedback-modal",{"customFont":[4,"custom-font"],"emailAddress":[1,"email-address"],"hideEmail":[4,"hide-email"],"isEmailRequired":[4,"is-email-required"],"ratingMode":[1,"rating-mode"],"hasSelectedElement":[1540,"has-selected-element"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"hideRating":[4,"hide-rating"],"hideScreenshotButton":[4,"hide-screenshot-button"],"project":[1],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"showModal":[1540,"show-modal"],"rating":[2],"metadata":[1],"fetchData":[4,"fetch-data"],"emailPlaceholder":[1,"email-placeholder"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"messagePlaceholder":[1,"message-placeholder"],"footerText":[1,"footer-text"],"modalPosition":[1,"modal-position"],"modalTitle":[1,"modal-title"],"modalTitleError":[1,"modal-title-error"],"modalTitleSuccess":[1,"modal-title-success"],"privacyPolicyText":[1,"privacy-policy-text"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"sendButtonText":[1,"send-button-text"],"screenshotAttachedText":[1,"screenshot-attached-text"],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTakingText":[1,"screenshot-taking-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"successMessage":[1,"success-message"],"canvasEditorTitle":[1,"canvas-editor-title"],"canvasEditorCancelText":[1,"canvas-editor-cancel-text"],"canvasEditorSaveText":[1,"canvas-editor-save-text"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formVerification":[32],"formError":[32],"formErrorStatus":[32],"encodedScreenshot":[32],"isPrivacyChecked":[32],"whitelabel":[32],"selectedRating":[32],"overlayVisible":[32],"isAnimating":[32],"takingScreenshot":[32],"showPreviewModal":[32],"screenshotError":[32],"showScreenshotError":[32],"showCanvasEditor":[32],"canvasDrawingTool":[32],"canvasDrawingColor":[32],"canvasLineWidth":[32],"isDrawing":[32],"annotations":[32],"currentAnnotation":[32],"isDragging":[32],"draggedAnnotation":[32],"dragStartPos":[32],"showColorPicker":[32],"editingColorIndex":[32],"isResizing":[32],"resizingAnnotation":[32],"resizeStartSize":[32],"resizeStartDimensions":[32],"hoveredAnnotation":[32],"resizeHandle":[32],"defaultColors":[32],"openModal":[64]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -894,3 +894,110 @@
|
|
|
894
894
|
width: 100px;
|
|
895
895
|
}
|
|
896
896
|
}
|
|
897
|
+
|
|
898
|
+
/* Feather loader animation */
|
|
899
|
+
@keyframes feather-spin {
|
|
900
|
+
0% {
|
|
901
|
+
transform: rotate(0deg);
|
|
902
|
+
}
|
|
903
|
+
100% {
|
|
904
|
+
transform: rotate(360deg);
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
.feather-loader {
|
|
909
|
+
animation: feather-spin 1s linear infinite;
|
|
910
|
+
display: block;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
/* Screenshot Error Notification */
|
|
914
|
+
.screenshot-error-notification {
|
|
915
|
+
position: fixed;
|
|
916
|
+
top: 20px;
|
|
917
|
+
left: 50%;
|
|
918
|
+
transform: translateX(-50%);
|
|
919
|
+
z-index: 10001;
|
|
920
|
+
max-width: 500px;
|
|
921
|
+
width: 90%;
|
|
922
|
+
animation: slideDown 0.3s ease-out;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
@keyframes slideDown {
|
|
926
|
+
from {
|
|
927
|
+
opacity: 0;
|
|
928
|
+
transform: translateX(-50%) translateY(-20px);
|
|
929
|
+
}
|
|
930
|
+
to {
|
|
931
|
+
opacity: 1;
|
|
932
|
+
transform: translateX(-50%) translateY(0);
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
.screenshot-error-content {
|
|
937
|
+
background: #fee;
|
|
938
|
+
border: 1px solid #fcc;
|
|
939
|
+
border-radius: 8px;
|
|
940
|
+
padding: 12px 16px;
|
|
941
|
+
display: flex;
|
|
942
|
+
align-items: center;
|
|
943
|
+
gap: 12px;
|
|
944
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
945
|
+
color: #c53030;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
.screenshot-error-content svg:first-child {
|
|
949
|
+
color: #e53e3e;
|
|
950
|
+
flex-shrink: 0;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
.screenshot-error-content span {
|
|
954
|
+
flex: 1;
|
|
955
|
+
font-size: 14px;
|
|
956
|
+
line-height: 1.4;
|
|
957
|
+
font-weight: 500;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
.error-close-btn {
|
|
961
|
+
background: none;
|
|
962
|
+
border: none;
|
|
963
|
+
cursor: pointer;
|
|
964
|
+
padding: 4px;
|
|
965
|
+
border-radius: 4px;
|
|
966
|
+
color: #c53030;
|
|
967
|
+
flex-shrink: 0;
|
|
968
|
+
transition: background-color 0.2s ease;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
.error-close-btn:hover {
|
|
972
|
+
background: rgba(197, 48, 48, 0.1);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
/* Hide annotation controls on mobile */
|
|
976
|
+
@media (max-width: 768px) {
|
|
977
|
+
.canvas-editor-toolbar .tool-group,
|
|
978
|
+
.canvas-editor-toolbar .color-palette,
|
|
979
|
+
.canvas-editor-toolbar .size-control,
|
|
980
|
+
.canvas-editor-toolbar .toolbar-divider {
|
|
981
|
+
display: none !important;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
.canvas-editor-toolbar {
|
|
985
|
+
justify-content: center;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
.canvas-editor-toolbar .toolbar-section:first-child {
|
|
989
|
+
display: none;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
.canvas-editor-toolbar .toolbar-section:nth-child(2) {
|
|
993
|
+
display: none;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
.canvas-editor-toolbar .toolbar-section:nth-child(3) {
|
|
997
|
+
display: none;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
.canvas-editor-title {
|
|
1001
|
+
display: none;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { h } from '@stencil/core';
|
|
2
|
-
import html2canvas from 'html2canvas-pro';
|
|
3
2
|
export class FeedbackModal {
|
|
4
3
|
constructor() {
|
|
5
4
|
this.onScrollDebounced = () => {
|
|
@@ -96,10 +95,14 @@ export class FeedbackModal {
|
|
|
96
95
|
this.canvasRef = null;
|
|
97
96
|
this.canvasContext = null;
|
|
98
97
|
this.originalImageData = null;
|
|
98
|
+
// Reset error states
|
|
99
|
+
this.showScreenshotError = false;
|
|
100
|
+
this.screenshotError = '';
|
|
99
101
|
// Reset resizing states
|
|
100
102
|
this.isResizing = false;
|
|
101
103
|
this.resizingAnnotation = null;
|
|
102
104
|
this.resizeStartSize = 16;
|
|
105
|
+
this.resizeStartDimensions = null;
|
|
103
106
|
this.hoveredAnnotation = null;
|
|
104
107
|
this.resizeHandle = false;
|
|
105
108
|
// Reset form states
|
|
@@ -114,16 +117,30 @@ export class FeedbackModal {
|
|
|
114
117
|
this.openScreenShot = async () => {
|
|
115
118
|
// Show loading state immediately
|
|
116
119
|
this.takingScreenshot = true;
|
|
120
|
+
this.showScreenshotError = false;
|
|
121
|
+
// Clear any previous annotations when taking a new screenshot
|
|
122
|
+
this.annotations = [];
|
|
123
|
+
this.currentAnnotation = null;
|
|
124
|
+
this.isDrawing = false;
|
|
125
|
+
this.hoveredAnnotation = null;
|
|
126
|
+
// Hide the feedback modal temporarily to exclude it from screenshot
|
|
127
|
+
const wasModalVisible = this.showModal;
|
|
128
|
+
this.showModal = false;
|
|
129
|
+
// Also hide any feedback buttons on the page
|
|
130
|
+
this.hideAllFeedbackElements();
|
|
117
131
|
try {
|
|
118
|
-
//
|
|
132
|
+
// Wait a moment for UI to update before capturing
|
|
133
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
134
|
+
// Capture viewport screenshot using browser API
|
|
119
135
|
const dataUrl = await this.captureViewportScreenshot();
|
|
120
136
|
this.encodedScreenshot = dataUrl;
|
|
121
137
|
this.originalImageData = dataUrl;
|
|
122
138
|
// Reset loading state
|
|
123
139
|
this.takingScreenshot = false;
|
|
124
|
-
//
|
|
125
|
-
this.showModal = false;
|
|
140
|
+
// Go directly to canvas editor (don't restore modal)
|
|
126
141
|
this.showCanvasEditor = true;
|
|
142
|
+
// Restore feedback elements visibility
|
|
143
|
+
this.showAllFeedbackElements();
|
|
127
144
|
// Initialize canvas after a short delay to ensure DOM is ready
|
|
128
145
|
setTimeout(() => {
|
|
129
146
|
this.initializeCanvas();
|
|
@@ -133,10 +150,54 @@ export class FeedbackModal {
|
|
|
133
150
|
console.error('Failed to capture screenshot:', error);
|
|
134
151
|
// Reset loading state on error
|
|
135
152
|
this.takingScreenshot = false;
|
|
136
|
-
//
|
|
137
|
-
this.showModal =
|
|
153
|
+
// Restore modal and feedback elements on error
|
|
154
|
+
this.showModal = wasModalVisible;
|
|
155
|
+
this.showAllFeedbackElements();
|
|
156
|
+
// Show error message to user
|
|
157
|
+
this.handleScreenshotError(error);
|
|
138
158
|
}
|
|
139
159
|
};
|
|
160
|
+
this.hideAllFeedbackElements = () => {
|
|
161
|
+
// Hide all feedback buttons and modals on the page
|
|
162
|
+
const feedbackElements = document.querySelectorAll('feedback-button, feedback-modal');
|
|
163
|
+
feedbackElements.forEach(element => {
|
|
164
|
+
element.style.visibility = 'hidden';
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
this.showAllFeedbackElements = () => {
|
|
168
|
+
// Show all feedback buttons and modals on the page
|
|
169
|
+
const feedbackElements = document.querySelectorAll('feedback-button, feedback-modal');
|
|
170
|
+
feedbackElements.forEach(element => {
|
|
171
|
+
element.style.visibility = 'visible';
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
this.handleScreenshotError = (error) => {
|
|
175
|
+
let errorMessage = 'Failed to capture screenshot. ';
|
|
176
|
+
if (error.name === 'NotAllowedError') {
|
|
177
|
+
errorMessage += 'Permission denied. Please allow screen sharing to take screenshots.';
|
|
178
|
+
}
|
|
179
|
+
else if (error.name === 'NotSupportedError') {
|
|
180
|
+
errorMessage += 'Screen capture is not supported in this browser.';
|
|
181
|
+
}
|
|
182
|
+
else if (error.name === 'NotFoundError') {
|
|
183
|
+
errorMessage += 'No screen sources available for capture.';
|
|
184
|
+
}
|
|
185
|
+
else if (error.name === 'AbortError') {
|
|
186
|
+
errorMessage += 'Screenshot capture was cancelled.';
|
|
187
|
+
}
|
|
188
|
+
else if (error.message && error.message.includes('not supported')) {
|
|
189
|
+
errorMessage += 'Your browser does not support screen capture. Please use a browser like Chrome, Firefox, or Safari.';
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
errorMessage += 'An unexpected error occurred. Please try again.';
|
|
193
|
+
}
|
|
194
|
+
this.screenshotError = errorMessage;
|
|
195
|
+
this.showScreenshotError = true;
|
|
196
|
+
// Auto-hide error after 5 seconds
|
|
197
|
+
setTimeout(() => {
|
|
198
|
+
this.showScreenshotError = false;
|
|
199
|
+
}, 5000);
|
|
200
|
+
};
|
|
140
201
|
this.openCanvasEditor = (event) => {
|
|
141
202
|
if (event) {
|
|
142
203
|
event.stopPropagation();
|
|
@@ -228,7 +289,10 @@ export class FeedbackModal {
|
|
|
228
289
|
switch (annotation.type) {
|
|
229
290
|
case 'rectangle':
|
|
230
291
|
this.canvasContext.strokeRect(annotation.startX, annotation.startY, annotation.width, annotation.height);
|
|
231
|
-
//
|
|
292
|
+
// Draw resize handle if this annotation is hovered
|
|
293
|
+
if (this.hoveredAnnotation === annotation) {
|
|
294
|
+
this.drawRectangleResizeHandles(annotation);
|
|
295
|
+
}
|
|
232
296
|
break;
|
|
233
297
|
case 'line':
|
|
234
298
|
this.canvasContext.beginPath();
|
|
@@ -352,8 +416,11 @@ export class FeedbackModal {
|
|
|
352
416
|
return x >= handleX - handleSize / 2 && x <= handleX + handleSize / 2 &&
|
|
353
417
|
y >= handleY - handleSize / 2 && y <= handleY + handleSize / 2;
|
|
354
418
|
case 'rectangle':
|
|
355
|
-
|
|
356
|
-
|
|
419
|
+
const right = annotation.startX + annotation.width;
|
|
420
|
+
const bottom = annotation.startY + annotation.height;
|
|
421
|
+
// Only check bottom-right corner handle
|
|
422
|
+
return x >= right - handleSize / 2 && x <= right + handleSize / 2 &&
|
|
423
|
+
y >= bottom - handleSize / 2 && y <= bottom + handleSize / 2;
|
|
357
424
|
case 'line':
|
|
358
425
|
case 'arrow':
|
|
359
426
|
// Check both endpoint handles
|
|
@@ -411,11 +478,17 @@ export class FeedbackModal {
|
|
|
411
478
|
if (annotation.type === 'text') {
|
|
412
479
|
this.resizeStartSize = annotation.fontSize || 16;
|
|
413
480
|
}
|
|
481
|
+
else if (annotation.type === 'rectangle') {
|
|
482
|
+
this.resizeStartDimensions = { width: annotation.width, height: annotation.height };
|
|
483
|
+
}
|
|
414
484
|
};
|
|
415
485
|
// Enhanced mouse down handler with resize detection for all annotation types
|
|
416
486
|
this.handleCanvasMouseDown = (event) => {
|
|
417
487
|
if (!this.canvasRef)
|
|
418
488
|
return;
|
|
489
|
+
// Disable drawing on mobile devices
|
|
490
|
+
if (window.innerWidth <= 768)
|
|
491
|
+
return;
|
|
419
492
|
// Close color picker if open
|
|
420
493
|
if (this.showColorPicker) {
|
|
421
494
|
this.closeColorPicker();
|
|
@@ -471,6 +544,9 @@ export class FeedbackModal {
|
|
|
471
544
|
this.handleCanvasMouseMove = (event) => {
|
|
472
545
|
if (!this.canvasRef)
|
|
473
546
|
return;
|
|
547
|
+
// Disable drawing on mobile devices
|
|
548
|
+
if (window.innerWidth <= 768)
|
|
549
|
+
return;
|
|
474
550
|
const coords = this.getCanvasCoordinates(event);
|
|
475
551
|
// Handle resizing for any annotation type
|
|
476
552
|
if (this.isResizing && this.resizingAnnotation) {
|
|
@@ -552,12 +628,16 @@ export class FeedbackModal {
|
|
|
552
628
|
}
|
|
553
629
|
};
|
|
554
630
|
this.handleCanvasMouseUp = () => {
|
|
555
|
-
//
|
|
631
|
+
// Disable drawing on mobile devices
|
|
632
|
+
if (window.innerWidth <= 768)
|
|
633
|
+
return;
|
|
634
|
+
// Handle end of resizing
|
|
556
635
|
if (this.isResizing) {
|
|
557
636
|
this.isResizing = false;
|
|
558
637
|
this.resizingAnnotation = null;
|
|
559
638
|
this.dragStartPos = null;
|
|
560
639
|
this.resizeHandle = false;
|
|
640
|
+
this.resizeStartDimensions = null;
|
|
561
641
|
if (this.canvasRef) {
|
|
562
642
|
this.canvasRef.style.cursor = 'crosshair';
|
|
563
643
|
}
|
|
@@ -581,30 +661,21 @@ export class FeedbackModal {
|
|
|
581
661
|
this.currentAnnotation = null;
|
|
582
662
|
this.redrawAnnotations();
|
|
583
663
|
};
|
|
584
|
-
// Draw resize handles for rectangle annotation
|
|
664
|
+
// Draw resize handles for rectangle annotation (only bottom-right corner)
|
|
585
665
|
this.drawRectangleResizeHandles = (annotation) => {
|
|
586
666
|
if (!this.canvasContext || annotation.type !== 'rectangle')
|
|
587
667
|
return;
|
|
588
668
|
const handleSize = 8;
|
|
589
|
-
const left = annotation.startX;
|
|
590
|
-
const top = annotation.startY;
|
|
591
669
|
const right = annotation.startX + annotation.width;
|
|
592
670
|
const bottom = annotation.startY + annotation.height;
|
|
593
|
-
//
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
{ x: right, y: top },
|
|
597
|
-
{ x: right, y: bottom },
|
|
598
|
-
{ x: left, y: bottom } // Bottom-left
|
|
599
|
-
];
|
|
600
|
-
// Draw each handle
|
|
671
|
+
// Only draw bottom-right corner handle
|
|
672
|
+
const handle = { x: right, y: bottom };
|
|
673
|
+
// Draw the handle
|
|
601
674
|
this.canvasContext.fillStyle = '#0070F4'; // Primary color
|
|
602
675
|
this.canvasContext.strokeStyle = '#ffffff';
|
|
603
676
|
this.canvasContext.lineWidth = 2;
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
this.canvasContext.strokeRect(handle.x - handleSize / 2, handle.y - handleSize / 2, handleSize, handleSize);
|
|
607
|
-
});
|
|
677
|
+
this.canvasContext.fillRect(handle.x - handleSize / 2, handle.y - handleSize / 2, handleSize, handleSize);
|
|
678
|
+
this.canvasContext.strokeRect(handle.x - handleSize / 2, handle.y - handleSize / 2, handleSize, handleSize);
|
|
608
679
|
};
|
|
609
680
|
// Draw resize handles for line/arrow annotation
|
|
610
681
|
this.drawLineResizeHandles = (annotation) => {
|
|
@@ -694,8 +765,13 @@ export class FeedbackModal {
|
|
|
694
765
|
updatedAnnotation.fontSize = Math.round(newSize);
|
|
695
766
|
break;
|
|
696
767
|
case 'rectangle':
|
|
697
|
-
// Rectangle
|
|
698
|
-
|
|
768
|
+
// Rectangle resize logic - only bottom-right corner
|
|
769
|
+
const rectDeltaX = currentPos.x - this.dragStartPos.x;
|
|
770
|
+
const rectDeltaY = currentPos.y - this.dragStartPos.y;
|
|
771
|
+
// Update width and height based on original dimensions plus delta
|
|
772
|
+
updatedAnnotation.width = Math.max(10, this.resizeStartDimensions.width + rectDeltaX); // Minimum width of 10px
|
|
773
|
+
updatedAnnotation.height = Math.max(10, this.resizeStartDimensions.height + rectDeltaY); // Minimum height of 10px
|
|
774
|
+
break;
|
|
699
775
|
case 'line':
|
|
700
776
|
case 'arrow':
|
|
701
777
|
// Line/arrow resize logic - move endpoints
|
|
@@ -729,6 +805,8 @@ export class FeedbackModal {
|
|
|
729
805
|
this.isAnimating = false;
|
|
730
806
|
this.takingScreenshot = false;
|
|
731
807
|
this.showPreviewModal = false;
|
|
808
|
+
this.screenshotError = '';
|
|
809
|
+
this.showScreenshotError = false;
|
|
732
810
|
this.showCanvasEditor = false;
|
|
733
811
|
this.canvasDrawingTool = 'rectangle';
|
|
734
812
|
this.canvasDrawingColor = '#ff0000';
|
|
@@ -744,6 +822,7 @@ export class FeedbackModal {
|
|
|
744
822
|
this.isResizing = false;
|
|
745
823
|
this.resizingAnnotation = null;
|
|
746
824
|
this.resizeStartSize = 16;
|
|
825
|
+
this.resizeStartDimensions = null;
|
|
747
826
|
this.hoveredAnnotation = null;
|
|
748
827
|
this.resizeHandle = false;
|
|
749
828
|
this.defaultColors = ['#ff0000', '#00ff00', '#0000ff', '#000000'];
|
|
@@ -819,52 +898,62 @@ export class FeedbackModal {
|
|
|
819
898
|
handleEmailInput(event) {
|
|
820
899
|
this.formEmail = event.target.value;
|
|
821
900
|
}
|
|
822
|
-
captureViewportScreenshot() {
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
scrollY: 0,
|
|
838
|
-
allowTaint: false,
|
|
839
|
-
useCORS: true,
|
|
840
|
-
scale: 1,
|
|
841
|
-
backgroundColor: '#ffffff',
|
|
842
|
-
logging: false,
|
|
843
|
-
foreignObjectRendering: false,
|
|
844
|
-
imageTimeout: 15000,
|
|
845
|
-
windowWidth: viewportWidth,
|
|
846
|
-
windowHeight: viewportHeight,
|
|
847
|
-
removeContainer: true,
|
|
848
|
-
ignoreElements: (element) => {
|
|
849
|
-
// Ignore all feedback modal elements
|
|
850
|
-
return element.closest('feedback-modal') !== null ||
|
|
851
|
-
element.classList.contains('feedback-overlay') ||
|
|
852
|
-
element.classList.contains('feedback-modal-screenshot-header') ||
|
|
853
|
-
element.tagName === 'FEEDBACK-MODAL' ||
|
|
854
|
-
element.tagName === 'FEEDBACK-BUTTON';
|
|
855
|
-
}
|
|
856
|
-
})
|
|
857
|
-
.then((canvas) => {
|
|
858
|
-
const dataUrl = canvas.toDataURL('image/png');
|
|
859
|
-
console.log('Screenshot captured successfully, size:', canvas.width, 'x', canvas.height);
|
|
860
|
-
resolve(dataUrl);
|
|
861
|
-
})
|
|
862
|
-
.catch((error) => {
|
|
863
|
-
console.error('Failed to capture viewport screenshot:', error);
|
|
864
|
-
reject(error);
|
|
865
|
-
});
|
|
901
|
+
async captureViewportScreenshot() {
|
|
902
|
+
try {
|
|
903
|
+
// Check if Screen Capture API is supported
|
|
904
|
+
if (!navigator.mediaDevices || !navigator.mediaDevices.getDisplayMedia) {
|
|
905
|
+
throw new Error('Screen Capture API is not supported in this browser');
|
|
906
|
+
}
|
|
907
|
+
// Request screen capture with preference for current tab
|
|
908
|
+
const stream = await navigator.mediaDevices.getDisplayMedia({
|
|
909
|
+
video: {
|
|
910
|
+
mediaSource: 'screen',
|
|
911
|
+
width: { ideal: window.innerWidth },
|
|
912
|
+
height: { ideal: window.innerHeight }
|
|
913
|
+
},
|
|
914
|
+
audio: false,
|
|
915
|
+
preferCurrentTab: true
|
|
866
916
|
});
|
|
867
|
-
|
|
917
|
+
// Create video element to capture frame
|
|
918
|
+
const video = document.createElement('video');
|
|
919
|
+
video.srcObject = stream;
|
|
920
|
+
video.autoplay = true;
|
|
921
|
+
video.muted = true;
|
|
922
|
+
return new Promise((resolve, reject) => {
|
|
923
|
+
video.onloadedmetadata = () => {
|
|
924
|
+
video.play();
|
|
925
|
+
// Wait a moment for video to stabilize
|
|
926
|
+
setTimeout(() => {
|
|
927
|
+
try {
|
|
928
|
+
// Create canvas to capture frame
|
|
929
|
+
const canvas = document.createElement('canvas');
|
|
930
|
+
canvas.width = video.videoWidth;
|
|
931
|
+
canvas.height = video.videoHeight;
|
|
932
|
+
const ctx = canvas.getContext('2d');
|
|
933
|
+
ctx.drawImage(video, 0, 0);
|
|
934
|
+
// Stop the stream
|
|
935
|
+
stream.getTracks().forEach(track => track.stop());
|
|
936
|
+
// Convert to data URL
|
|
937
|
+
const dataUrl = canvas.toDataURL('image/png');
|
|
938
|
+
console.log('Screenshot captured successfully using Screen Capture API');
|
|
939
|
+
resolve(dataUrl);
|
|
940
|
+
}
|
|
941
|
+
catch (error) {
|
|
942
|
+
stream.getTracks().forEach(track => track.stop());
|
|
943
|
+
reject(error);
|
|
944
|
+
}
|
|
945
|
+
}, 100);
|
|
946
|
+
};
|
|
947
|
+
video.onerror = (_) => {
|
|
948
|
+
stream.getTracks().forEach(track => track.stop());
|
|
949
|
+
reject(new Error('Failed to load video for screenshot capture'));
|
|
950
|
+
};
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
catch (error) {
|
|
954
|
+
console.error('Screen capture failed:', error);
|
|
955
|
+
throw error;
|
|
956
|
+
}
|
|
868
957
|
}
|
|
869
958
|
handleCheckboxChange(event) {
|
|
870
959
|
this.isPrivacyChecked = event.target.checked;
|
|
@@ -876,7 +965,7 @@ export class FeedbackModal {
|
|
|
876
965
|
this.selectedRating = newRating;
|
|
877
966
|
}
|
|
878
967
|
render() {
|
|
879
|
-
return (h("div", { class: `feedback-modal-wrapper ${this.customFont ? 'feedback-modal-wrapper--custom-font' : ''}` }, this.showModal && (h("div", { class: `feedback-overlay ${this.isAnimating ? 'feedback-overlay--visible' : ''}` })), this.showModal && (h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.isAnimating ? 'feedback-modal-content--open' : ''}`, ref: (el) => (this.modalContent = el) }, h("div", { class: "feedback-modal-header" }, !this.formSuccess && !this.formError ? (h("span", null, this.modalTitle)) : this.formSuccess ? (h("span", null, this.modalTitleSuccess)) : (h("span", null, this.modalTitleError)), h("button", { class: "feedback-modal-close", 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" }, !this.formSuccess && !this.formError ? (h("form", { onSubmit: this.handleSubmit }, !this.hideRating && (h("div", { class: "feedback-modal-rating" }, this.ratingMode === 'thumbs' ? (h("div", { class: "feedback-modal-rating-content" }, h("span", { class: "feedback-modal-input-heading" }, this.ratingPlaceholder), h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--thumbs" }, h("button", { title: "Yes", class: `feedback-modal-rating-button ${this.selectedRating === 1
|
|
968
|
+
return (h("div", { class: `feedback-modal-wrapper ${this.customFont ? 'feedback-modal-wrapper--custom-font' : ''}` }, 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 && (h("div", { class: `feedback-overlay ${this.isAnimating ? 'feedback-overlay--visible' : ''}` })), this.showModal && (h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.isAnimating ? 'feedback-modal-content--open' : ''}`, ref: (el) => (this.modalContent = el) }, h("div", { class: "feedback-modal-header" }, !this.formSuccess && !this.formError ? (h("span", null, this.modalTitle)) : this.formSuccess ? (h("span", null, this.modalTitleSuccess)) : (h("span", null, this.modalTitleError)), h("button", { class: "feedback-modal-close", 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" }, !this.formSuccess && !this.formError ? (h("form", { onSubmit: this.handleSubmit }, !this.hideRating && (h("div", { class: "feedback-modal-rating" }, this.ratingMode === 'thumbs' ? (h("div", { class: "feedback-modal-rating-content" }, h("span", { class: "feedback-modal-input-heading" }, this.ratingPlaceholder), h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--thumbs" }, h("button", { title: "Yes", class: `feedback-modal-rating-button ${this.selectedRating === 1
|
|
880
969
|
? 'feedback-modal-rating-button--selected'
|
|
881
970
|
: ''}`, onClick: (event) => {
|
|
882
971
|
event.preventDefault();
|
|
@@ -891,7 +980,7 @@ export class FeedbackModal {
|
|
|
891
980
|
: ''}`, onClick: (event) => {
|
|
892
981
|
event.preventDefault();
|
|
893
982
|
this.handleRatingChange(rating);
|
|
894
|
-
} }, 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' : ''}` }, !this.hideScreenshotButton && (h("button", { type: "button", class: `feedback-modal-button feedback-modal-button--screenshot ${this.encodedScreenshot ? 'feedback-modal-button--active' : ''}`, 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
|
|
983
|
+
} }, 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' : ''}` }, !this.hideScreenshotButton && (h("button", { type: "button", class: `feedback-modal-button feedback-modal-button--screenshot ${this.encodedScreenshot ? 'feedback-modal-button--active' : ''}`, 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 ? this.screenshotTakingText :
|
|
895
984
|
this.encodedScreenshot ? this.screenshotAttachedText : this.screenshotButtonText)), h("button", { class: "feedback-modal-button feedback-modal-button--submit", type: "submit", disabled: this.sending }, this.sendButtonText)))) : this.formSuccess && !this.formError ? (h("div", { class: "feedback-modal-success" }, h("p", { class: "feedback-modal-message" }, this.successMessage))) : this.formError && this.formErrorStatus == 404 ? (h("p", { class: "feedback-modal-message" }, this.errorMessage404)) : this.formError && this.formErrorStatus == 403 ? (h("p", { class: "feedback-modal-message" }, this.errorMessage403)) : this.formError ? (h("p", { class: "feedback-modal-message" }, this.errorMessage)) : (h("span", null))), h("div", { class: "feedback-modal-footer" }, h("div", { class: "feedback-logo", style: { display: this.whitelabel ? 'none' : 'block' } }, "Powered by", ' ', h("a", { target: "_blank", href: "https://pushfeedback.com" }, "PushFeedback.com")), this.footerText && (h("div", { class: "feedback-footer-text" }, h("span", { innerHTML: this.footerText })))))), 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", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }))), h("button", { class: `tool-btn ${this.canvasDrawingTool === 'line' ? 'active' : ''}`, onClick: () => this.canvasDrawingTool = 'line', title: "Line" }, 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("line", { x1: "5", y1: "12", x2: "19", y2: "12" }))), h("button", { class: `tool-btn ${this.canvasDrawingTool === 'arrow' ? 'active' : ''}`, onClick: () => this.canvasDrawingTool = 'arrow', title: "Arrow" }, 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("line", { x1: "7", y1: "17", x2: "17", y2: "7" }), h("polyline", { points: "7,7 17,7 17,17" }))), h("button", { class: `tool-btn ${this.canvasDrawingTool === 'text' ? 'active' : ''}`, onClick: () => this.canvasDrawingTool = 'text', title: "Text" }, 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("polyline", { points: "4,7 4,4 20,4 20,7" }), h("line", { x1: "9", y1: "20", x2: "15", y2: "20" }), h("line", { x1: "12", y1: "4", x2: "12", y2: "20" }))), h("div", { class: "toolbar-divider" }), h("button", { class: "tool-btn undo-btn", onClick: this.undoLastAnnotation, disabled: this.annotations.length === 0, title: "Undo" }, 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("polyline", { points: "1,4 1,10 7,10" }), h("path", { d: "M3.51,15a9,9,0,0,0,14.85-3.36,9,9,0,0,0-9.19-10.15L1.83,10" }))))), 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) })))))))), h("div", { class: "toolbar-section" }, h("div", { class: "size-control" }, h("input", { type: "range", min: "1", max: "10", value: this.canvasLineWidth, onInput: (e) => this.canvasLineWidth = parseInt(e.target.value), class: "size-slider" }), h("span", { class: "size-value" }, 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 }))))))));
|
|
896
985
|
}
|
|
897
986
|
componentDidRender() {
|
|
@@ -1624,6 +1713,8 @@ export class FeedbackModal {
|
|
|
1624
1713
|
"isAnimating": {},
|
|
1625
1714
|
"takingScreenshot": {},
|
|
1626
1715
|
"showPreviewModal": {},
|
|
1716
|
+
"screenshotError": {},
|
|
1717
|
+
"showScreenshotError": {},
|
|
1627
1718
|
"showCanvasEditor": {},
|
|
1628
1719
|
"canvasDrawingTool": {},
|
|
1629
1720
|
"canvasDrawingColor": {},
|
|
@@ -1639,6 +1730,7 @@ export class FeedbackModal {
|
|
|
1639
1730
|
"isResizing": {},
|
|
1640
1731
|
"resizingAnnotation": {},
|
|
1641
1732
|
"resizeStartSize": {},
|
|
1733
|
+
"resizeStartDimensions": {},
|
|
1642
1734
|
"hoveredAnnotation": {},
|
|
1643
1735
|
"resizeHandle": {},
|
|
1644
1736
|
"defaultColors": {}
|