pushfeedback 0.1.65 → 0.1.67

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.
@@ -16,6 +16,7 @@ const FeedbackButton = class {
16
16
  this.hideIcon = false;
17
17
  this.hideMobile = false;
18
18
  this.sessionId = '';
19
+ this.metadata = '';
19
20
  this.submit = false;
20
21
  this.customFont = false;
21
22
  this.emailAddress = '';
@@ -41,7 +42,9 @@ const FeedbackButton = class {
41
42
  this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
42
43
  this.ratingPlaceholder = 'Was this page helpful?';
43
44
  this.ratingStarsPlaceholder = 'How would you rate this page?';
45
+ this.screenshotAttachedText = 'Screenshot attached';
44
46
  this.screenshotButtonText = 'Add a screenshot';
47
+ this.screenshotTakingText = 'Taking screenshot...';
45
48
  this.screenshotTopbarText = 'Select an element on this page';
46
49
  this.sendButtonText = 'Send';
47
50
  this.successMessage = '';
@@ -55,6 +58,9 @@ const FeedbackButton = class {
55
58
  this.sessionId = storedSessionId;
56
59
  }
57
60
  }
61
+ else {
62
+ localStorage.setItem('pushfeedback_sessionid', this.sessionId);
63
+ }
58
64
  }
59
65
  componentDidLoad() {
60
66
  if (this.buttonPosition === 'center-right') {
@@ -90,13 +96,16 @@ const FeedbackButton = class {
90
96
  'errorMessage404',
91
97
  'footerText',
92
98
  'messagePlaceholder',
99
+ 'metadata',
93
100
  'modalTitle',
94
101
  'modalTitleError',
95
102
  'modalTitleSuccess',
96
103
  'privacyPolicyText',
97
104
  'ratingPlaceholder',
98
105
  'ratingStarsPlaceholder',
106
+ 'screenshotAttachedText',
99
107
  'screenshotButtonText',
108
+ 'screenshotTakingText',
100
109
  'screenshotTopbarText',
101
110
  'sendButtonText',
102
111
  'successMessage',
@@ -138,6 +147,7 @@ const FeedbackButton = class {
138
147
  rating: this.rating || -1,
139
148
  ratingMode: this.ratingMode,
140
149
  message: '',
150
+ metadata: this.metadata,
141
151
  session: localStorage.getItem('pushfeedback_sessionid') || '',
142
152
  };
143
153
  const res = await fetch('https://app.pushfeedback.com/api/feedback/', {
@@ -8966,7 +8976,7 @@ var html2canvasPro = createCommonjsModule(function (module, exports) {
8966
8976
  //# sourceMappingURL=html2canvas-pro.js.map
8967
8977
  });
8968
8978
 
8969
- const feedbackModalCss = ".text-center{flex-grow:1;text-align:center}.feedback-modal-wrapper *{font-family:var(--feedback-font-family)}.feedback-modal-wrapper--custom-font *{font-family:inherit}.feedback-modal-wrapper{position:absolute;z-index:var(--feedback-modal-modal-wrapper-z-index)}.feedback-overlay{background-color:var(--feedback-modal-screenshot-bg-color);height:100%;left:0;opacity:0;position:fixed;top:0;width:100%;z-index:var(--feedback-modal-screnshot-z-index);transition:opacity 0.2s ease-out}.feedback-overlay--visible{opacity:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;left:50%;max-width:90%;padding:20px;position:fixed;top:50%;transform:translate(-50%, -50%) scale(0.95);opacity:0;width:100%;z-index:var(--feedback-modal-content-z-index);transition:transform 0.2s ease-out, opacity 0.2s ease-out}.feedback-modal-content--open{transform:translate(-50%, -50%) scale(1);opacity:1}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);display:flex;font-size:var(--feedback-header-font-size);font-weight:var(--feedback-modal-header-font-weight);justify-content:space-between;margin-bottom:20px}.feedback-modal-rating-buttons{width:100%;margin-bottom:20px}.feedback-modal-rating-button{padding:0;background-color:transparent;border:transparent;margin-right:5px;cursor:pointer}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button{border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);font-size:var(--feedback-modal-button-font-size);font-weight:500;margin-right:10px;justify-content:center;padding:5px 10px}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button:hover,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--selected{background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-text-color-active)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button:hover svg,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--selected svg{stroke:var(--feedback-modal-rating-button-selected-color)}.feedback-modal-rating-buttons svg{stroke:var(--feedback-modal-rating-button-color);cursor:pointer}.feedback-modal-rating-buttons--stars .feedback-modal-rating-button--selected svg{fill:var(--feedback-modal-rating-button-stars-selected-color);stroke:var(--feedback-modal-rating-button-stars-selected-color)}.feedback-modal-text textarea{background-color:var(--feedback-modal-input-bg-color);border:1px solid var(--feedback-modal-input-border-color);border-radius:var(--feedback-modal-input-border-radius);box-sizing:border-box;color:var(--feedback-modal-input-text-color);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:100px;min-height:100px;padding:10px;resize:vertical;width:100%}.feedback-modal-email input{background-color:var(--feedback-modal-input-bg-color);border:1px solid var(--feedback-modal-input-border-color);border-radius:var(--feedback-modal-input-border-radius);box-sizing:border-box;color:var(--feedback-modal-input-text-color);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:40px;padding:10px;width:100%;margin-bottom:20px}.feedback-modal-privacy{font-size:var(--feedback-modal-input-font-size);margin-bottom:20px}.feedback-modal-text textarea:focus,.feedback-modal-email input:focus{border:1px solid var(--feedback-modal-input-border-color-focused);outline:none}.feedback-modal-buttons{display:flex;flex-direction:column}.feedback-modal-buttons .feedback-modal-button{margin-bottom:20px}.feedback-modal-button{align-items:center;background-color:transparent;border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);cursor:pointer;display:flex;font-size:var(--feedback-modal-button-font-size);font-weight:500;justify-content:center;min-height:40px;padding:5px 10px}.feedback-modal-button svg{margin-right:6px}.feedback-modal-button path{fill:var(--feedback-modal-button-icon-color)}.feedback-modal-button:hover path,.feedback-modal-button--active path{fill:var(--feedback-modal-button-icon-color-active)}.feedback-modal-button--submit{background-color:var(--feedback-modal-button-submit-bg-color);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-submit-text-color)}.feedback-modal-button:hover,.feedback-modal-button--active{background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-text-color-active)}.feedback-modal-button--submit:hover{background-color:var(--feedback-modal-button-submit-bg-color-hover);border:1px solid var(--feedback-modal-button-submit-border-color-hover);color:var(--feedback-modal-button-submit-text-color-hover)}.feedback-modal-input-heading{display:block;font-size:14px;font-weight:300;padding-bottom:10px}.feedback-modal-footer{font-size:12px;text-align:center}.feedback-modal-footer a{color:var(--feedback-modal-footer-link);font-weight:500;text-decoration:none}.feedback-logo,.feedback-footer-text{display:block;text-align:center;margin-top:5px}.feedback-footer-text{margin-top:10px;line-height:1.5}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;height:22px;margin-left:auto;padding:0;width:22px}.feedback-modal-close svg{stroke:var(--feedback-modal-close-color)}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);height:100%;left:0;position:fixed;top:0;width:100%;z-index:var(--feedback-modal-screnshot-z-index)}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-screenshot-header-text-color);cursor:pointer;display:flex;left:50%;top:20px;transform:translateX(-50%);padding:10px;position:fixed;width:max-content;z-index:var(--feedback-modal-screenshot-header-z-index)}.feedback-modal-screenshot-close{height:24px;padding-left:10px;width:24px}.feedback-modal-screenshot-close svg{stroke:var(--feedback-modal-close-color)}.feedback-modal-message{font-size:var(--feedback-modal-message-font-size);margin-top:0}.feedback-modal-element-hover{background-color:transparent;cursor:pointer;border:1px solid var(--feedback-modal-element-hover-border-color)}.feedback-modal-element-selected{background-color:transparent;border:1px solid var(--feedback-modal-element-selected-border-color)}@media screen and (min-width: 768px){.feedback-modal-content{max-width:var(--feedback-modal-content-max-width)}.feedback-modal-content.feedback-modal-content--bottom-right{bottom:var(--feedback-modal-content-position-bottom);left:initial;right:var(--feedback-modal-content-position-right);top:initial;transform:initial}.feedback-modal-content.feedback-modal-content--bottom-left{bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left);top:initial;transform:initial}.feedback-modal-content.feedback-modal-content--top-right{right:var(--feedback-modal-content-position-right);top:var(--feedback-modal-content-position-top);transform:initial}.feedback-modal-content.feedback-modal-content--top-left{left:var(--feedback-modal-content-position-left);top:var(--feedback-modal-content-position-top);transform:initial}.feedback-modal-content.feedback-modal-content--center-left{left:5px;right:auto;top:50%;transform:translateY(-50%)}.feedback-modal-content.feedback-modal-content--center-right{left:auto;right:5px;top:50%;transform:translateY(-50%)}.feedback-modal-content.feedback-modal-content--sidebar-left.feedback-modal-content--open,.feedback-modal-content.feedback-modal-content--sidebar-right.feedback-modal-content--open{transform:translateX(0)}.feedback-modal-content.feedback-modal-content--sidebar-left{max-width:var(--feedback-modal-content-sidebar-max-width);left:0;right:auto;height:100vh;top:0;transform:translateX(-100%);transition:transform 0.5s ease-in-out;border-radius:0}.feedback-modal-content.feedback-modal-content--sidebar-right{max-width:var(--feedback-modal-content-sidebar-max-width);left:auto;right:0;height:100vh;top:0;transform:translateX(100%);transition:transform 0.5s ease-in-out;border-radius:0}.feedback-modal-text textarea{height:150px;min-height:150px}.feedback-modal-content.feedback-modal-content--bottom-right{transform:translateY(20px)}.feedback-modal-content.feedback-modal-content--bottom-right.feedback-modal-content--open{transform:translateY(0)}.feedback-modal-content.feedback-modal-content--bottom-left{transform:translateY(20px)}.feedback-modal-content.feedback-modal-content--bottom-left.feedback-modal-content--open{transform:translateY(0)}.feedback-modal-content.feedback-modal-content--top-right{transform:translateY(-20px)}.feedback-modal-content.feedback-modal-content--top-right.feedback-modal-content--open{transform:translateY(0)}.feedback-modal-content.feedback-modal-content--top-left{transform:translateY(-20px)}.feedback-modal-content.feedback-modal-content--top-left.feedback-modal-content--open{transform:translateY(0)}}";
8979
+ const feedbackModalCss = ".text-center{flex-grow:1;text-align:center}.feedback-modal-wrapper *{font-family:var(--feedback-font-family)}.feedback-modal-wrapper--custom-font *{font-family:inherit}.feedback-modal-wrapper{position:absolute;z-index:var(--feedback-modal-modal-wrapper-z-index)}.feedback-overlay{background-color:var(--feedback-modal-screenshot-bg-color);height:100%;left:0;opacity:0;position:fixed;top:0;width:100%;z-index:var(--feedback-modal-screnshot-z-index);transition:opacity 0.2s ease-out}.feedback-overlay--visible{opacity:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;left:50%;max-width:90%;padding:20px;position:fixed;top:50%;transform:translate(-50%, -50%) scale(0.95);opacity:0;width:100%;z-index:var(--feedback-modal-content-z-index);transition:transform 0.2s ease-out, opacity 0.2s ease-out}.feedback-modal-content--open{transform:translate(-50%, -50%) scale(1);opacity:1}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);display:flex;font-size:var(--feedback-header-font-size);font-weight:var(--feedback-modal-header-font-weight);justify-content:space-between;margin-bottom:20px}.feedback-modal-rating-buttons{width:100%;margin-bottom:20px}.feedback-modal-rating-button{padding:0;background-color:transparent;border:transparent;margin-right:5px;cursor:pointer}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button{border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);font-size:var(--feedback-modal-button-font-size);font-weight:500;margin-right:10px;justify-content:center;padding:5px 10px}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button:hover,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--selected{background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-text-color-active)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button:hover svg,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--selected svg{stroke:var(--feedback-modal-rating-button-selected-color)}.feedback-modal-rating-buttons svg{stroke:var(--feedback-modal-rating-button-color);cursor:pointer}.feedback-modal-rating-buttons--stars .feedback-modal-rating-button--selected svg{fill:var(--feedback-modal-rating-button-stars-selected-color);stroke:var(--feedback-modal-rating-button-stars-selected-color)}.feedback-modal-text textarea{background-color:var(--feedback-modal-input-bg-color);border:1px solid var(--feedback-modal-input-border-color);border-radius:var(--feedback-modal-input-border-radius);box-sizing:border-box;color:var(--feedback-modal-input-text-color);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:100px;min-height:100px;padding:10px;resize:vertical;width:100%}.feedback-modal-email input{background-color:var(--feedback-modal-input-bg-color);border:1px solid var(--feedback-modal-input-border-color);border-radius:var(--feedback-modal-input-border-radius);box-sizing:border-box;color:var(--feedback-modal-input-text-color);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:40px;padding:10px;width:100%;margin-bottom:20px}.feedback-modal-privacy{font-size:var(--feedback-modal-input-font-size);margin-bottom:20px}.feedback-modal-text textarea:focus,.feedback-modal-email input:focus{border:1px solid var(--feedback-modal-input-border-color-focused);outline:none}.feedback-modal-buttons{display:flex;flex-direction:column}.feedback-modal-buttons .feedback-modal-button{margin-bottom:20px}.feedback-modal-button{align-items:center;background-color:transparent;border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);cursor:pointer;display:flex;font-size:var(--feedback-modal-button-font-size);font-weight:500;justify-content:center;min-height:40px;padding:5px 10px}.feedback-modal-button svg{margin-right:6px}.feedback-modal-button path{fill:var(--feedback-modal-button-icon-color)}.feedback-modal-button:hover path,.feedback-modal-button--active path{fill:var(--feedback-modal-button-icon-color-active)}.feedback-modal-button--submit{background-color:var(--feedback-modal-button-submit-bg-color);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-submit-text-color)}.feedback-modal-button:hover,.feedback-modal-button--active{background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-text-color-active)}.feedback-modal-button--submit:hover{background-color:var(--feedback-modal-button-submit-bg-color-hover);border:1px solid var(--feedback-modal-button-submit-border-color-hover);color:var(--feedback-modal-button-submit-text-color-hover)}.feedback-modal-input-heading{display:block;font-size:14px;font-weight:300;padding-bottom:10px}.feedback-modal-footer{font-size:12px;text-align:center}.feedback-modal-footer a{color:var(--feedback-modal-footer-link);font-weight:500;text-decoration:none}.feedback-logo,.feedback-footer-text{display:block;text-align:center;margin-top:5px}.feedback-footer-text{margin-top:10px;line-height:1.5}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;height:22px;margin-left:auto;padding:0;width:22px}.feedback-modal-close svg{stroke:var(--feedback-modal-close-color)}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);height:100%;left:0;position:fixed;top:0;width:100%;z-index:var(--feedback-modal-screnshot-z-index)}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-screenshot-header-text-color);cursor:pointer;display:flex;left:50%;top:20px;transform:translateX(-50%);padding:10px;position:fixed;width:max-content;z-index:var(--feedback-modal-screenshot-header-z-index)}.feedback-modal-screenshot-close{height:24px;padding-left:10px;width:24px}.feedback-modal-screenshot-close svg{stroke:var(--feedback-modal-close-color)}.feedback-modal-message{font-size:var(--feedback-modal-message-font-size);margin-top:0}.feedback-modal-element-hover{background-color:transparent;cursor:pointer;border:1px solid var(--feedback-modal-element-hover-border-color)}.feedback-modal-element-selected{background-color:transparent;border:3px solid var(--feedback-modal-element-selected-border-color) !important;box-shadow:0 0 0 2px rgba(0, 123, 255, 0.3) !important}.screenshot-preview{display:inline-block;width:30px;height:30px;overflow:hidden;border-radius:4px;margin-right:10px;box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);cursor:pointer;transition:transform 0.2s ease}.screenshot-preview:hover{transform:scale(1.1)}.screenshot-preview img{width:100%;height:100%;object-fit:cover}.preview-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.8);z-index:10000;display:flex;align-items:center;justify-content:center;cursor:pointer}.preview-modal{position:relative;max-width:90vw;max-height:90vh;border-radius:8px;overflow:hidden;cursor:default}.preview-modal img{max-width:100%;max-height:100%;display:block}@media screen and (min-width: 768px){.feedback-modal-content{max-width:var(--feedback-modal-content-max-width)}.feedback-modal-content.feedback-modal-content--bottom-right{bottom:var(--feedback-modal-content-position-bottom);left:initial;right:var(--feedback-modal-content-position-right);top:initial;transform:initial}.feedback-modal-content.feedback-modal-content--bottom-left{bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left);top:initial;transform:initial}.feedback-modal-content.feedback-modal-content--top-right{right:var(--feedback-modal-content-position-right);top:var(--feedback-modal-content-position-top);transform:initial}.feedback-modal-content.feedback-modal-content--top-left{left:var(--feedback-modal-content-position-left);top:var(--feedback-modal-content-position-top);transform:initial}.feedback-modal-content.feedback-modal-content--center-left{left:5px;right:auto;top:50%;transform:translateY(-50%)}.feedback-modal-content.feedback-modal-content--center-right{left:auto;right:5px;top:50%;transform:translateY(-50%)}.feedback-modal-content.feedback-modal-content--sidebar-left.feedback-modal-content--open,.feedback-modal-content.feedback-modal-content--sidebar-right.feedback-modal-content--open{transform:translateX(0)}.feedback-modal-content.feedback-modal-content--sidebar-left{max-width:var(--feedback-modal-content-sidebar-max-width);left:0;right:auto;height:100vh;top:0;transform:translateX(-100%);transition:transform 0.5s ease-in-out;border-radius:0}.feedback-modal-content.feedback-modal-content--sidebar-right{max-width:var(--feedback-modal-content-sidebar-max-width);left:auto;right:0;height:100vh;top:0;transform:translateX(100%);transition:transform 0.5s ease-in-out;border-radius:0}.feedback-modal-text textarea{height:150px;min-height:150px}.feedback-modal-content.feedback-modal-content--bottom-right{transform:translateY(20px)}.feedback-modal-content.feedback-modal-content--bottom-right.feedback-modal-content--open{transform:translateY(0)}.feedback-modal-content.feedback-modal-content--bottom-left{transform:translateY(20px)}.feedback-modal-content.feedback-modal-content--bottom-left.feedback-modal-content--open{transform:translateY(0)}.feedback-modal-content.feedback-modal-content--top-right{transform:translateY(-20px)}.feedback-modal-content.feedback-modal-content--top-right.feedback-modal-content--open{transform:translateY(0)}.feedback-modal-content.feedback-modal-content--top-left{transform:translateY(-20px)}.feedback-modal-content.feedback-modal-content--top-left.feedback-modal-content--open{transform:translateY(0)}}";
8970
8980
 
8971
8981
  const FeedbackModal = class {
8972
8982
  constructor(hostRef) {
@@ -9000,6 +9010,7 @@ const FeedbackModal = class {
9000
9010
  screenshot: this.encodedScreenshot,
9001
9011
  rating: this.selectedRating,
9002
9012
  ratingMode: this.ratingMode,
9013
+ metadata: this.metadata,
9003
9014
  verification: this.formVerification,
9004
9015
  session: localStorage.getItem('pushfeedback_sessionid') || '',
9005
9016
  };
@@ -9052,11 +9063,19 @@ const FeedbackModal = class {
9052
9063
  this.showScreenshotTopBar = false;
9053
9064
  this.hasSelectedElement = false;
9054
9065
  this.encodedScreenshot = null;
9066
+ // Remove highlight from ALL selected elements
9067
+ document.querySelectorAll('.feedback-modal-element-selected').forEach(el => {
9068
+ el.classList.remove('feedback-modal-element-selected');
9069
+ });
9070
+ this.takingScreenshot = false;
9071
+ this.originalElement = null;
9072
+ this.selectedElementBounds = null;
9055
9073
  this.formSuccess = false;
9056
9074
  this.formError = false;
9057
9075
  this.formErrorStatus = 500;
9058
9076
  this.formMessage = '';
9059
9077
  this.formEmail = '';
9078
+ this.showPreviewModal = false;
9060
9079
  this.resetOverflow();
9061
9080
  }, 200);
9062
9081
  };
@@ -9065,22 +9084,31 @@ const FeedbackModal = class {
9065
9084
  this.showModal = false;
9066
9085
  this.showScreenshotMode = true;
9067
9086
  this.showScreenshotTopBar = true;
9087
+ // Clear previous screenshot and selection data
9068
9088
  this.encodedScreenshot = null;
9069
- if (window.innerWidth > document.documentElement.clientWidth) {
9070
- document.documentElement.classList.add('feedback-modal-screenshot-open--scroll');
9071
- }
9072
- const scrollY = window.scrollY;
9073
- document.documentElement.style.top = `-${scrollY}px`;
9074
- window.scrollTo(0, parseInt(document.documentElement.style.top || '0') * -1);
9075
- document.documentElement.classList.add('feedback-modal-screenshot-open');
9089
+ this.originalElement = null;
9090
+ this.selectedElementBounds = null;
9091
+ this.hoveredElement = null;
9092
+ this.hoveredElementBounds = null;
9093
+ // NO CSS CLASSES - they cause scroll jumping
9076
9094
  };
9077
9095
  this.closeScreenShot = () => {
9096
+ // Remove highlight from ALL selected elements
9097
+ document.querySelectorAll('.feedback-modal-element-selected').forEach(el => {
9098
+ el.classList.remove('feedback-modal-element-selected');
9099
+ });
9100
+ // Reset loading state
9101
+ this.takingScreenshot = false;
9078
9102
  this.showModal = false;
9079
9103
  this.showScreenshotMode = false;
9080
9104
  this.showScreenshotTopBar = false;
9081
- this.hasSelectedElement = false;
9082
- this.encodedScreenshot = null;
9083
- this.resetOverflow();
9105
+ };
9106
+ this.openPreviewModal = (event) => {
9107
+ event.stopPropagation(); // Prevent button click from firing
9108
+ this.showPreviewModal = true;
9109
+ };
9110
+ this.closePreviewModal = () => {
9111
+ this.showPreviewModal = false;
9084
9112
  };
9085
9113
  this.handleMouseOverScreenShot = (event) => {
9086
9114
  event.preventDefault();
@@ -9091,6 +9119,9 @@ const FeedbackModal = class {
9091
9119
  const elementUnder = document.elementFromPoint(event.clientX, event.clientY);
9092
9120
  const rect = elementUnder.getBoundingClientRect();
9093
9121
  this.screenshotModal.style.display = '';
9122
+ // Store the hovered element and its bounds for later use
9123
+ this.hoveredElement = elementUnder;
9124
+ this.hoveredElementBounds = rect;
9094
9125
  // Get the bounding box of the element selected
9095
9126
  this.elementSelected.style.position = 'absolute';
9096
9127
  this.elementSelected.style.left = `${rect.left}px`;
@@ -9132,35 +9163,45 @@ const FeedbackModal = class {
9132
9163
  };
9133
9164
  this.handleMouseClickedSelectedElement = async (event) => {
9134
9165
  event.preventDefault();
9135
- if (!this.elementSelected) {
9166
+ if (!this.elementSelected || !this.hoveredElement) {
9136
9167
  return;
9137
9168
  }
9138
9169
  this.hasSelectedElement = true;
9139
- this.elementSelected.classList.add('feedback-modal-element-selected');
9140
- // Get the top position including the scroll offset
9141
- const rectTop = this.elementSelected.getBoundingClientRect().top;
9142
- const topWithScroll = rectTop + window.scrollY;
9143
- // Move the element with the scroll offset
9144
- this.elementSelected.style.top = `${topWithScroll}px`;
9145
- // Clone the selected element and append it to the body
9146
- const clonedElementSelected = this.elementSelected.cloneNode(true);
9147
- document.body.appendChild(clonedElementSelected);
9148
- // Reset the top position of the original element
9149
- this.elementSelected.style.top = `${rectTop}px`;
9150
- this.showScreenshotTopBar = false;
9151
- this.showModal = false;
9170
+ // Remove highlight from ALL previously selected elements
9171
+ document.querySelectorAll('.feedback-modal-element-selected').forEach(el => {
9172
+ el.classList.remove('feedback-modal-element-selected');
9173
+ });
9174
+ // Add highlight to newly selected element
9175
+ this.hoveredElement.classList.add('feedback-modal-element-selected');
9176
+ // Store element bounds in viewport coordinates
9177
+ this.selectedElementBounds = this.hoveredElementBounds;
9178
+ this.originalElement = this.hoveredElement;
9179
+ // Show loading state in top bar
9180
+ this.takingScreenshot = true;
9181
+ // Take screenshot FIRST while highlight is still visible
9152
9182
  try {
9153
9183
  const dataUrl = await this.captureScreenshot();
9154
9184
  console.log('Screenshot captured');
9155
9185
  this.encodedScreenshot = dataUrl;
9186
+ // Reset loading state
9187
+ this.takingScreenshot = false;
9188
+ // NOW hide screenshot interface after capturing
9189
+ this.showScreenshotTopBar = false;
9190
+ this.showScreenshotMode = false;
9191
+ // Restore normal page state
9192
+ this.resetOverflow();
9193
+ // Show modal with the captured screenshot
9194
+ this.showModal = true;
9156
9195
  }
9157
9196
  catch (error) {
9158
9197
  console.error('Failed to capture screenshot:', error);
9159
9198
  this.hasSelectedElement = false;
9160
- }
9161
- finally {
9162
- // Remove the cloned element and show the modal again
9163
- document.body.removeChild(clonedElementSelected);
9199
+ // Reset loading state on error
9200
+ this.takingScreenshot = false;
9201
+ // Still need to cleanup on error
9202
+ this.showScreenshotTopBar = false;
9203
+ this.showScreenshotMode = false;
9204
+ this.resetOverflow();
9164
9205
  this.showModal = true;
9165
9206
  }
9166
9207
  };
@@ -9191,6 +9232,7 @@ const FeedbackModal = class {
9191
9232
  this.showScreenshotTopBar = false;
9192
9233
  this.showModal = false;
9193
9234
  this.rating = undefined;
9235
+ this.metadata = undefined;
9194
9236
  this.fetchData = true;
9195
9237
  this.emailPlaceholder = 'Email address (optional)';
9196
9238
  this.errorMessage = 'Please try again later.';
@@ -9206,9 +9248,13 @@ const FeedbackModal = class {
9206
9248
  this.ratingPlaceholder = 'Was this page helpful?';
9207
9249
  this.ratingStarsPlaceholder = 'How would you rate this page?';
9208
9250
  this.sendButtonText = 'Send';
9251
+ this.screenshotAttachedText = 'Screenshot attached';
9209
9252
  this.screenshotButtonText = 'Add a screenshot';
9253
+ this.screenshotTakingText = 'Taking screenshot...';
9210
9254
  this.screenshotTopbarText = 'Select an element on this page';
9211
9255
  this.successMessage = '';
9256
+ this.takingScreenshot = false;
9257
+ this.showPreviewModal = false;
9212
9258
  }
9213
9259
  componentWillLoad() {
9214
9260
  if (this.fetchData)
@@ -9232,15 +9278,10 @@ const FeedbackModal = class {
9232
9278
  }
9233
9279
  }
9234
9280
  resetOverflow() {
9281
+ // Just clean up any stray classes, don't add/remove during screenshot
9235
9282
  document.documentElement.classList.remove('feedback-modal-screenshot-open');
9236
9283
  document.documentElement.classList.remove('feedback-modal-screenshot-open--scroll');
9237
- document.documentElement.classList.add('feedback-modal-screenshot-closing');
9238
- // Only restore scroll position if we previously modified it
9239
- if (document.documentElement.style.top) {
9240
- window.scrollTo(0, parseInt(document.documentElement.style.top || '0') * -1);
9241
- document.documentElement.style.top = '';
9242
- }
9243
- window.addEventListener('scroll', this.onScrollDebounced);
9284
+ document.documentElement.classList.remove('feedback-modal-screenshot-closing');
9244
9285
  }
9245
9286
  handleMessageInput(event) {
9246
9287
  this.formMessage = event.target.value;
@@ -9250,22 +9291,44 @@ const FeedbackModal = class {
9250
9291
  }
9251
9292
  captureScreenshot() {
9252
9293
  return new Promise((resolve, reject) => {
9253
- requestAnimationFrame(() => {
9254
- html2canvasPro(document.body, {
9255
- x: window.scrollX,
9256
- y: window.scrollY,
9257
- width: window.innerWidth,
9258
- height: window.innerHeight,
9259
- })
9260
- .then((canvas) => {
9261
- const dataUrl = canvas.toDataURL();
9262
- resolve(dataUrl);
9263
- })
9264
- .catch((error) => {
9265
- console.error(error);
9266
- reject(error);
9294
+ // Add a small delay to ensure CSS highlight is applied
9295
+ setTimeout(() => {
9296
+ requestAnimationFrame(() => {
9297
+ if (!this.selectedElementBounds) {
9298
+ reject(new Error('No element selected'));
9299
+ return;
9300
+ }
9301
+ // Capture what's currently visible in the viewport
9302
+ html2canvasPro(document.body, {
9303
+ x: window.scrollX,
9304
+ y: window.scrollY,
9305
+ width: window.innerWidth,
9306
+ height: window.innerHeight,
9307
+ scrollX: window.scrollX,
9308
+ scrollY: window.scrollY,
9309
+ allowTaint: false,
9310
+ useCORS: true,
9311
+ scale: 1,
9312
+ backgroundColor: '#ffffff',
9313
+ logging: true,
9314
+ foreignObjectRendering: false,
9315
+ imageTimeout: 10000,
9316
+ ignoreElements: (element) => {
9317
+ // Only ignore screenshot UI, keep everything else including highlights
9318
+ return element.classList.contains('feedback-modal-screenshot-header') ||
9319
+ element.classList.contains('feedback-overlay');
9320
+ }
9321
+ })
9322
+ .then((canvas) => {
9323
+ const dataUrl = canvas.toDataURL();
9324
+ resolve(dataUrl);
9325
+ })
9326
+ .catch((error) => {
9327
+ console.error('Failed to capture screenshot:', error);
9328
+ reject(error);
9329
+ });
9267
9330
  });
9268
- });
9331
+ }, 100); // Small delay to ensure CSS is applied
9269
9332
  });
9270
9333
  }
9271
9334
  handleCheckboxChange(event) {
@@ -9278,7 +9341,7 @@ const FeedbackModal = class {
9278
9341
  this.selectedRating = newRating;
9279
9342
  }
9280
9343
  render() {
9281
- return (index.h("div", { class: `feedback-modal-wrapper ${this.customFont ? 'feedback-modal-wrapper--custom-font' : ''}` }, this.showScreenshotMode && (index.h("div", { class: "feedback-modal-screenshot", ref: (el) => (this.screenshotModal = el), onMouseMove: this.handleMouseOverScreenShot }, index.h("div", { class: "feedback-modal-screenshot-element-selected", ref: (el) => (this.elementSelected = el), onClick: this.handleMouseClickedSelectedElement }), index.h("div", { class: "top-side", ref: (el) => (this.topSide = el) }), index.h("div", { class: "left-side", ref: (el) => (this.leftSide = el) }), index.h("div", { class: "bottom-side", ref: (el) => (this.bottomSide = el) }), index.h("div", { class: "right-side", ref: (el) => (this.rightSide = el) }), this.showScreenshotTopBar && (index.h("div", { class: "feedback-modal-screenshot-header", onClick: this.closeScreenShot }, index.h("span", null, this.screenshotTopbarText), index.h("span", { class: "feedback-modal-screenshot-close" }, index.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" }, index.h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), index.h("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))))))), this.showModal && (index.h("div", { class: `feedback-overlay ${this.isAnimating ? 'feedback-overlay--visible' : ''}` })), this.showModal && (index.h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.isAnimating ? 'feedback-modal-content--open' : ''}`, ref: (el) => (this.modalContent = el) }, index.h("div", { class: "feedback-modal-header" }, !this.formSuccess && !this.formError ? (index.h("span", null, this.modalTitle)) : this.formSuccess ? (index.h("span", null, this.modalTitleSuccess)) : (index.h("span", null, this.modalTitleError)), index.h("button", { class: "feedback-modal-close", onClick: this.close }, index.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" }, index.h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), index.h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))), index.h("div", { class: "feedback-modal-body" }, !this.formSuccess && !this.formError ? (index.h("form", { onSubmit: this.handleSubmit }, !this.hideRating && (index.h("div", { class: "feedback-modal-rating" }, this.ratingMode === 'thumbs' ? (index.h("div", { class: "feedback-modal-rating-content" }, index.h("span", { class: "feedback-modal-input-heading" }, this.ratingPlaceholder), index.h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--thumbs" }, index.h("button", { title: "Yes", class: `feedback-modal-rating-button ${this.selectedRating === 1
9344
+ return (index.h("div", { class: `feedback-modal-wrapper ${this.customFont ? 'feedback-modal-wrapper--custom-font' : ''}` }, this.showScreenshotMode && (index.h("div", { class: "feedback-modal-screenshot", ref: (el) => (this.screenshotModal = el), onMouseMove: this.handleMouseOverScreenShot }, index.h("div", { class: "feedback-modal-screenshot-element-selected", ref: (el) => (this.elementSelected = el), onClick: this.handleMouseClickedSelectedElement }), index.h("div", { class: "top-side", ref: (el) => (this.topSide = el) }), index.h("div", { class: "left-side", ref: (el) => (this.leftSide = el) }), index.h("div", { class: "bottom-side", ref: (el) => (this.bottomSide = el) }), index.h("div", { class: "right-side", ref: (el) => (this.rightSide = el) }), this.showScreenshotTopBar && (index.h("div", { class: "feedback-modal-screenshot-header", onClick: this.closeScreenShot }, index.h("span", null, this.takingScreenshot ? this.screenshotTakingText : this.screenshotTopbarText), index.h("span", { class: "feedback-modal-screenshot-close" }, index.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" }, index.h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), index.h("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))))))), this.showModal && (index.h("div", { class: `feedback-overlay ${this.isAnimating ? 'feedback-overlay--visible' : ''}` })), this.showModal && (index.h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.isAnimating ? 'feedback-modal-content--open' : ''}`, ref: (el) => (this.modalContent = el) }, index.h("div", { class: "feedback-modal-header" }, !this.formSuccess && !this.formError ? (index.h("span", null, this.modalTitle)) : this.formSuccess ? (index.h("span", null, this.modalTitleSuccess)) : (index.h("span", null, this.modalTitleError)), index.h("button", { class: "feedback-modal-close", onClick: this.close }, index.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" }, index.h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), index.h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })))), index.h("div", { class: "feedback-modal-body" }, !this.formSuccess && !this.formError ? (index.h("form", { onSubmit: this.handleSubmit }, !this.hideRating && (index.h("div", { class: "feedback-modal-rating" }, this.ratingMode === 'thumbs' ? (index.h("div", { class: "feedback-modal-rating-content" }, index.h("span", { class: "feedback-modal-input-heading" }, this.ratingPlaceholder), index.h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--thumbs" }, index.h("button", { title: "Yes", class: `feedback-modal-rating-button ${this.selectedRating === 1
9282
9345
  ? 'feedback-modal-rating-button--selected'
9283
9346
  : ''}`, onClick: (event) => {
9284
9347
  event.preventDefault();
@@ -9293,7 +9356,7 @@ const FeedbackModal = class {
9293
9356
  : ''}`, onClick: (event) => {
9294
9357
  event.preventDefault();
9295
9358
  this.handleRatingChange(rating);
9296
- } }, index.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" }, index.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" })))))))))), index.h("div", { class: "feedback-modal-text" }, index.h("textarea", { placeholder: this.messagePlaceholder, value: this.formMessage, onInput: (event) => this.handleMessageInput(event) })), !this.hideEmail && (index.h("div", { class: "feedback-modal-email" }, index.h("input", { placeholder: this.emailPlaceholder, type: "email", onInput: (event) => this.handleEmailInput(event), value: this.formEmail, required: this.isEmailRequired }))), index.h("div", { class: "feedback-verification" }, index.h("input", { type: "text", name: "verification", style: { display: 'none' }, onInput: (event) => this.handleVerification(event), value: this.formVerification })), !this.hidePrivacyPolicy && (index.h("div", { class: "feedback-modal-privacy" }, index.h("input", { type: "checkbox", id: "privacyPolicy", onChange: (ev) => this.handleCheckboxChange(ev), required: true }), index.h("span", { innerHTML: this.privacyPolicyText }))), index.h("div", { class: `feedback-modal-buttons ${this.hideScreenshotButton ? 'single' : ''}` }, !this.hideScreenshotButton && (index.h("button", { type: "button", class: `feedback-modal-button feedback-modal-button--screenshot ${this.encodedScreenshot ? 'feedback-modal-button--active' : ''}`, onClick: this.openScreenShot, disabled: this.sending }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 -960 960 960", width: "24" }, index.h("path", { d: "M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80ZM200-200v-200h80v120h120v80H200Zm0-360v-200h200v80H280v120h-80Zm480 0v-120H560v-80h200v200h-80Z" })), this.screenshotButtonText)), index.h("button", { class: "feedback-modal-button feedback-modal-button--submit", type: "submit", disabled: this.sending }, this.sendButtonText)))) : this.formSuccess && !this.formError ? (index.h("div", { class: "feedback-modal-success" }, index.h("p", { class: "feedback-modal-message" }, this.successMessage))) : this.formError && this.formErrorStatus == 404 ? (index.h("p", { class: "feedback-modal-message" }, this.errorMessage404)) : this.formError && this.formErrorStatus == 403 ? (index.h("p", { class: "feedback-modal-message" }, this.errorMessage403)) : this.formError ? (index.h("p", { class: "feedback-modal-message" }, this.errorMessage)) : (index.h("span", null))), index.h("div", { class: "feedback-modal-footer" }, index.h("div", { class: "feedback-logo", style: { display: this.whitelabel ? 'none' : 'block' } }, "Powered by", ' ', index.h("a", { target: "_blank", href: "https://pushfeedback.com" }, "PushFeedback.com")), this.footerText && (index.h("div", { class: "feedback-footer-text" }, index.h("span", { innerHTML: this.footerText }))))))));
9359
+ } }, index.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" }, index.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" })))))))))), index.h("div", { class: "feedback-modal-text" }, index.h("textarea", { placeholder: this.messagePlaceholder, value: this.formMessage, onInput: (event) => this.handleMessageInput(event) })), !this.hideEmail && (index.h("div", { class: "feedback-modal-email" }, index.h("input", { placeholder: this.emailPlaceholder, type: "email", onInput: (event) => this.handleEmailInput(event), value: this.formEmail, required: this.isEmailRequired }))), index.h("div", { class: "feedback-verification" }, index.h("input", { type: "text", name: "verification", style: { display: 'none' }, onInput: (event) => this.handleVerification(event), value: this.formVerification })), !this.hidePrivacyPolicy && (index.h("div", { class: "feedback-modal-privacy" }, index.h("input", { type: "checkbox", id: "privacyPolicy", onChange: (ev) => this.handleCheckboxChange(ev), required: true }), index.h("span", { innerHTML: this.privacyPolicyText }))), index.h("div", { class: `feedback-modal-buttons ${this.hideScreenshotButton ? 'single' : ''}` }, !this.hideScreenshotButton && (index.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.encodedScreenshot && (index.h("div", { class: "screenshot-preview", onClick: this.openPreviewModal }, index.h("img", { src: this.encodedScreenshot, alt: "Screenshot Preview" }))), !this.encodedScreenshot && (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 -960 960 960", width: "24" }, index.h("path", { d: "M680-80v-120H560v-80h120v-120h80v120h120v80H760v120h-80ZM200-200v-200h80v120h120v80H200Zm0-360v-200h200v80H280v120h-80Zm480 0v-120H560v-80h200v200h-80Z" }))), this.encodedScreenshot ? this.screenshotAttachedText : this.screenshotButtonText)), index.h("button", { class: "feedback-modal-button feedback-modal-button--submit", type: "submit", disabled: this.sending }, this.sendButtonText)))) : this.formSuccess && !this.formError ? (index.h("div", { class: "feedback-modal-success" }, index.h("p", { class: "feedback-modal-message" }, this.successMessage))) : this.formError && this.formErrorStatus == 404 ? (index.h("p", { class: "feedback-modal-message" }, this.errorMessage404)) : this.formError && this.formErrorStatus == 403 ? (index.h("p", { class: "feedback-modal-message" }, this.errorMessage403)) : this.formError ? (index.h("p", { class: "feedback-modal-message" }, this.errorMessage)) : (index.h("span", null))), index.h("div", { class: "feedback-modal-footer" }, index.h("div", { class: "feedback-logo", style: { display: this.whitelabel ? 'none' : 'block' } }, "Powered by", ' ', index.h("a", { target: "_blank", href: "https://pushfeedback.com" }, "PushFeedback.com")), this.footerText && (index.h("div", { class: "feedback-footer-text" }, index.h("span", { innerHTML: this.footerText })))))), this.showPreviewModal && (index.h("div", { class: "preview-modal-overlay", onClick: this.closePreviewModal }, index.h("div", { class: "preview-modal" }, index.h("img", { src: this.encodedScreenshot, alt: "Screenshot Preview", onClick: (e) => e.stopPropagation() }))))));
9297
9360
  }
9298
9361
  componentDidRender() {
9299
9362
  if (this.showModal) {
@@ -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"],"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"],"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"],"screenshotButtonText":[1,"screenshot-button-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],"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"],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"successMessage":[1,"success-message"],"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],"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"],"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"],"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],"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"],"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"],"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"],"screenshotButtonText":[1,"screenshot-button-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],"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"],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"successMessage":[1,"success-message"],"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],"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"],"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"],"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],"openModal":[64]}]]]], options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;
@@ -6,6 +6,7 @@ export class FeedbackButton {
6
6
  this.hideIcon = false;
7
7
  this.hideMobile = false;
8
8
  this.sessionId = '';
9
+ this.metadata = '';
9
10
  this.submit = false;
10
11
  this.customFont = false;
11
12
  this.emailAddress = '';
@@ -31,7 +32,9 @@ export class FeedbackButton {
31
32
  this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
32
33
  this.ratingPlaceholder = 'Was this page helpful?';
33
34
  this.ratingStarsPlaceholder = 'How would you rate this page?';
35
+ this.screenshotAttachedText = 'Screenshot attached';
34
36
  this.screenshotButtonText = 'Add a screenshot';
37
+ this.screenshotTakingText = 'Taking screenshot...';
35
38
  this.screenshotTopbarText = 'Select an element on this page';
36
39
  this.sendButtonText = 'Send';
37
40
  this.successMessage = '';
@@ -45,6 +48,9 @@ export class FeedbackButton {
45
48
  this.sessionId = storedSessionId;
46
49
  }
47
50
  }
51
+ else {
52
+ localStorage.setItem('pushfeedback_sessionid', this.sessionId);
53
+ }
48
54
  }
49
55
  componentDidLoad() {
50
56
  if (this.buttonPosition === 'center-right') {
@@ -80,13 +86,16 @@ export class FeedbackButton {
80
86
  'errorMessage404',
81
87
  'footerText',
82
88
  'messagePlaceholder',
89
+ 'metadata',
83
90
  'modalTitle',
84
91
  'modalTitleError',
85
92
  'modalTitleSuccess',
86
93
  'privacyPolicyText',
87
94
  'ratingPlaceholder',
88
95
  'ratingStarsPlaceholder',
96
+ 'screenshotAttachedText',
89
97
  'screenshotButtonText',
98
+ 'screenshotTakingText',
90
99
  'screenshotTopbarText',
91
100
  'sendButtonText',
92
101
  'successMessage',
@@ -128,6 +137,7 @@ export class FeedbackButton {
128
137
  rating: this.rating || -1,
129
138
  ratingMode: this.ratingMode,
130
139
  message: '',
140
+ metadata: this.metadata,
131
141
  session: localStorage.getItem('pushfeedback_sessionid') || '',
132
142
  };
133
143
  const res = await fetch('https://app.pushfeedback.com/api/feedback/', {
@@ -265,6 +275,24 @@ export class FeedbackButton {
265
275
  "reflect": true,
266
276
  "defaultValue": "''"
267
277
  },
278
+ "metadata": {
279
+ "type": "string",
280
+ "mutable": false,
281
+ "complexType": {
282
+ "original": "string",
283
+ "resolved": "string",
284
+ "references": {}
285
+ },
286
+ "required": false,
287
+ "optional": false,
288
+ "docs": {
289
+ "tags": [],
290
+ "text": ""
291
+ },
292
+ "attribute": "metadata",
293
+ "reflect": false,
294
+ "defaultValue": "''"
295
+ },
268
296
  "submit": {
269
297
  "type": "boolean",
270
298
  "mutable": false,
@@ -714,6 +742,24 @@ export class FeedbackButton {
714
742
  "reflect": false,
715
743
  "defaultValue": "'How would you rate this page?'"
716
744
  },
745
+ "screenshotAttachedText": {
746
+ "type": "string",
747
+ "mutable": false,
748
+ "complexType": {
749
+ "original": "string",
750
+ "resolved": "string",
751
+ "references": {}
752
+ },
753
+ "required": false,
754
+ "optional": false,
755
+ "docs": {
756
+ "tags": [],
757
+ "text": ""
758
+ },
759
+ "attribute": "screenshot-attached-text",
760
+ "reflect": false,
761
+ "defaultValue": "'Screenshot attached'"
762
+ },
717
763
  "screenshotButtonText": {
718
764
  "type": "string",
719
765
  "mutable": false,
@@ -732,6 +778,24 @@ export class FeedbackButton {
732
778
  "reflect": false,
733
779
  "defaultValue": "'Add a screenshot'"
734
780
  },
781
+ "screenshotTakingText": {
782
+ "type": "string",
783
+ "mutable": false,
784
+ "complexType": {
785
+ "original": "string",
786
+ "resolved": "string",
787
+ "references": {}
788
+ },
789
+ "required": false,
790
+ "optional": false,
791
+ "docs": {
792
+ "tags": [],
793
+ "text": ""
794
+ },
795
+ "attribute": "screenshot-taking-text",
796
+ "reflect": false,
797
+ "defaultValue": "'Taking screenshot...'"
798
+ },
735
799
  "screenshotTopbarText": {
736
800
  "type": "string",
737
801
  "mutable": false,
@@ -318,7 +318,59 @@
318
318
 
319
319
  .feedback-modal-element-selected {
320
320
  background-color: transparent;
321
- border: 1px solid var(--feedback-modal-element-selected-border-color);
321
+ border: 3px solid var(--feedback-modal-element-selected-border-color) !important;
322
+ box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3) !important;
323
+ }
324
+
325
+ .screenshot-preview {
326
+ display: inline-block;
327
+ width: 30px;
328
+ height: 30px;
329
+ overflow: hidden;
330
+ border-radius: 4px;
331
+ margin-right: 10px;
332
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
333
+ cursor: pointer;
334
+ transition: transform 0.2s ease;
335
+ }
336
+
337
+ .screenshot-preview:hover {
338
+ transform: scale(1.1);
339
+ }
340
+
341
+ .screenshot-preview img {
342
+ width: 100%;
343
+ height: 100%;
344
+ object-fit: cover;
345
+ }
346
+
347
+ .preview-modal-overlay {
348
+ position: fixed;
349
+ top: 0;
350
+ left: 0;
351
+ right: 0;
352
+ bottom: 0;
353
+ background-color: rgba(0, 0, 0, 0.8);
354
+ z-index: 10000;
355
+ display: flex;
356
+ align-items: center;
357
+ justify-content: center;
358
+ cursor: pointer;
359
+ }
360
+
361
+ .preview-modal {
362
+ position: relative;
363
+ max-width: 90vw;
364
+ max-height: 90vh;
365
+ border-radius: 8px;
366
+ overflow: hidden;
367
+ cursor: default;
368
+ }
369
+
370
+ .preview-modal img {
371
+ max-width: 100%;
372
+ max-height: 100%;
373
+ display: block;
322
374
  }
323
375
 
324
376
  @media screen and (min-width: 768px) {