pushfeedback 0.1.63 → 0.1.65

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.
@@ -6,12 +6,15 @@ export class FeedbackModal {
6
6
  clearTimeout(this.scrollTimeout);
7
7
  this.scrollTimeout = setTimeout(() => {
8
8
  document.documentElement.classList.remove('feedback-modal-screenshot-closing');
9
- document.documentElement.style.top = "";
9
+ document.documentElement.style.top = '';
10
10
  window.removeEventListener('scroll', this.onScrollDebounced);
11
11
  }, 200);
12
12
  };
13
13
  this.handleSubmit = async (event) => {
14
14
  event.preventDefault();
15
+ if (this.isEmailRequired && !this.formEmail) {
16
+ return;
17
+ }
15
18
  this.resetOverflow();
16
19
  this.showScreenshotMode = false;
17
20
  this.showScreenshotTopBar = false;
@@ -33,8 +36,8 @@ export class FeedbackModal {
33
36
  method: 'POST',
34
37
  body: JSON.stringify(body),
35
38
  headers: {
36
- 'Content-Type': 'application/json'
37
- }
39
+ 'Content-Type': 'application/json',
40
+ },
38
41
  });
39
42
  if (res.status === 201) {
40
43
  const feedback_with_id = Object.assign(Object.assign({}, body), { id: await res.json() });
@@ -118,7 +121,7 @@ export class FeedbackModal {
118
121
  const rect = elementUnder.getBoundingClientRect();
119
122
  this.screenshotModal.style.display = '';
120
123
  // Get the bounding box of the element selected
121
- this.elementSelected.style.position = "absolute";
124
+ this.elementSelected.style.position = 'absolute';
122
125
  this.elementSelected.style.left = `${rect.left}px`;
123
126
  this.elementSelected.style.top = `${rect.top}px`;
124
127
  this.elementSelected.style.width = `${rect.width}px`;
@@ -126,34 +129,33 @@ export class FeedbackModal {
126
129
  this.elementSelected.classList.add('feedback-modal-element-hover');
127
130
  // Set the background color of nonselected areas
128
131
  // Top
129
- this.topSide.style.position = "absolute";
132
+ this.topSide.style.position = 'absolute';
130
133
  this.topSide.style.left = `${rect.left}px`;
131
134
  this.topSide.style.top = '0px';
132
135
  this.topSide.style.width = `${rect.width + borderOffset}px`;
133
136
  this.topSide.style.height = `${rect.top}px`;
134
- this.topSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
137
+ this.topSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
135
138
  // Left
136
- this.leftSide.style.position = "absolute";
139
+ this.leftSide.style.position = 'absolute';
137
140
  this.leftSide.style.left = '0px';
138
141
  this.leftSide.style.top = '0px';
139
142
  this.leftSide.style.width = `${rect.left}px`;
140
143
  this.leftSide.style.height = '100vh';
141
- this.leftSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
144
+ this.leftSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
142
145
  // Bottom
143
- this.bottomSide.style.position = "absolute";
146
+ this.bottomSide.style.position = 'absolute';
144
147
  this.bottomSide.style.left = `${rect.left}px`;
145
148
  this.bottomSide.style.top = `${rect.bottom + borderOffset}px`;
146
149
  this.bottomSide.style.width = `${rect.width + borderOffset}px`;
147
150
  this.bottomSide.style.height = '100vh';
148
- this.bottomSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
151
+ this.bottomSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
149
152
  // Right
150
- this.rightSide.style.position = "absolute";
153
+ this.rightSide.style.position = 'absolute';
151
154
  this.rightSide.style.left = `${rect.right + borderOffset}px`;
152
- ;
153
155
  this.rightSide.style.top = '0px';
154
156
  this.rightSide.style.width = '100%';
155
157
  this.rightSide.style.height = '100vh';
156
- this.rightSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
158
+ this.rightSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
157
159
  // Restore the visibility of the screenshot-modal
158
160
  this.screenshotModal.style.backgroundColor = 'transparent';
159
161
  };
@@ -205,36 +207,37 @@ export class FeedbackModal {
205
207
  this.overlayVisible = false;
206
208
  this.isAnimating = false;
207
209
  this.customFont = false;
208
- this.errorMessage = "Please try again later.";
209
- this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
210
- this.errorMessage404 = "We could not find the provided project ID in PushFeedback.";
211
- this.modalTitle = 'Share your feedback';
212
- this.modalTitleSuccess = 'Thanks for your feedback!';
213
- this.modalTitleError = "Oops!";
214
- this.modalPosition = 'center';
215
- this.sendButtonText = 'Send';
216
- this.successMessage = "";
217
- this.project = '';
218
- this.screenshotButtonText = 'Add a screenshot';
219
- this.screenshotTopbarText = 'Select an element on this page';
220
- this.hideEmail = false;
221
210
  this.emailAddress = '';
222
- this.emailPlaceholder = 'Email address (optional)';
223
- this.messagePlaceholder = 'Comments';
224
- this.hideRating = false;
225
- this.rating = undefined;
211
+ this.hideEmail = false;
212
+ this.isEmailRequired = false;
226
213
  this.ratingMode = 'thumbs';
227
- this.ratingPlaceholder = 'Was this page helpful?';
228
- this.ratingStarsPlaceholder = 'How would you rate this page?';
229
- this.footerText = '';
230
- this.showModal = false;
231
- this.showScreenshotMode = false;
232
- this.showScreenshotTopBar = false;
233
214
  this.hasSelectedElement = false;
234
- this.hideScreenshotButton = false;
235
215
  this.hidePrivacyPolicy = true;
236
- this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
216
+ this.hideRating = false;
217
+ this.hideScreenshotButton = false;
218
+ this.project = '';
219
+ this.showScreenshotMode = false;
220
+ this.showScreenshotTopBar = false;
221
+ this.showModal = false;
222
+ this.rating = undefined;
237
223
  this.fetchData = true;
224
+ this.emailPlaceholder = 'Email address (optional)';
225
+ this.errorMessage = 'Please try again later.';
226
+ this.errorMessage403 = 'The request URL does not match the one defined in PushFeedback for this project.';
227
+ this.errorMessage404 = 'We could not find the provided project ID in PushFeedback.';
228
+ this.messagePlaceholder = 'Comments';
229
+ this.footerText = '';
230
+ this.modalPosition = 'center';
231
+ this.modalTitle = 'Share your feedback';
232
+ this.modalTitleError = 'Oops!';
233
+ this.modalTitleSuccess = 'Thanks for your feedback!';
234
+ this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
235
+ this.ratingPlaceholder = 'Was this page helpful?';
236
+ this.ratingStarsPlaceholder = 'How would you rate this page?';
237
+ this.sendButtonText = 'Send';
238
+ this.screenshotButtonText = 'Add a screenshot';
239
+ this.screenshotTopbarText = 'Select an element on this page';
240
+ this.successMessage = '';
238
241
  }
239
242
  componentWillLoad() {
240
243
  if (this.fetchData)
@@ -243,7 +246,7 @@ export class FeedbackModal {
243
246
  if (this.rating) {
244
247
  this.selectedRating = this.rating;
245
248
  }
246
- if (this.ratingMode == "thumbs" && this.rating == 0) {
249
+ if (this.ratingMode == 'thumbs' && this.rating == 0) {
247
250
  this.selectedRating = 5;
248
251
  }
249
252
  }
@@ -282,11 +285,12 @@ export class FeedbackModal {
282
285
  y: window.scrollY,
283
286
  width: window.innerWidth,
284
287
  height: window.innerHeight,
285
- }).then(canvas => {
288
+ })
289
+ .then((canvas) => {
286
290
  const dataUrl = canvas.toDataURL();
287
291
  resolve(dataUrl);
288
292
  })
289
- .catch(error => {
293
+ .catch((error) => {
290
294
  console.error(error);
291
295
  reject(error);
292
296
  });
@@ -303,16 +307,22 @@ export class FeedbackModal {
303
307
  this.selectedRating = newRating;
304
308
  }
305
309
  render() {
306
- return (h("div", { class: `feedback-modal-wrapper ${this.customFont ? 'feedback-modal-wrapper--custom-font' : ''}` }, this.showScreenshotMode && (h("div", { class: "feedback-modal-screenshot", ref: el => (this.screenshotModal = el), onMouseMove: this.handleMouseOverScreenShot }, h("div", { class: "feedback-modal-screenshot-element-selected", ref: el => (this.elementSelected = el), onClick: this.handleMouseClickedSelectedElement }), h("div", { class: "top-side", ref: el => (this.topSide = el) }), h("div", { class: "left-side", ref: el => (this.leftSide = el) }), h("div", { class: "bottom-side", ref: el => (this.bottomSide = el) }), h("div", { class: "right-side", ref: el => (this.rightSide = el) }), this.showScreenshotTopBar && (h("div", { class: "feedback-modal-screenshot-header", onClick: this.closeScreenShot }, h("span", null, this.screenshotTopbarText), h("span", { class: "feedback-modal-screenshot-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" }))))))), 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 ? 'feedback-modal-rating-button--selected' : ''}`, onClick: (event) => {
310
+ return (h("div", { class: `feedback-modal-wrapper ${this.customFont ? 'feedback-modal-wrapper--custom-font' : ''}` }, this.showScreenshotMode && (h("div", { class: "feedback-modal-screenshot", ref: (el) => (this.screenshotModal = el), onMouseMove: this.handleMouseOverScreenShot }, h("div", { class: "feedback-modal-screenshot-element-selected", ref: (el) => (this.elementSelected = el), onClick: this.handleMouseClickedSelectedElement }), h("div", { class: "top-side", ref: (el) => (this.topSide = el) }), h("div", { class: "left-side", ref: (el) => (this.leftSide = el) }), h("div", { class: "bottom-side", ref: (el) => (this.bottomSide = el) }), h("div", { class: "right-side", ref: (el) => (this.rightSide = el) }), this.showScreenshotTopBar && (h("div", { class: "feedback-modal-screenshot-header", onClick: this.closeScreenShot }, h("span", null, this.screenshotTopbarText), h("span", { class: "feedback-modal-screenshot-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" }))))))), 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
311
+ ? 'feedback-modal-rating-button--selected'
312
+ : ''}`, onClick: (event) => {
307
313
  event.preventDefault();
308
314
  this.handleRatingChange(1);
309
- } }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3" }))), h("button", { title: "No", class: `feedback-modal-rating-button ${this.selectedRating === 5 ? 'feedback-modal-rating-button--selected' : ''}`, onClick: (event) => {
315
+ } }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3" }))), h("button", { title: "No", class: `feedback-modal-rating-button ${this.selectedRating === 5
316
+ ? 'feedback-modal-rating-button--selected'
317
+ : ''}`, onClick: (event) => {
310
318
  event.preventDefault();
311
319
  this.handleRatingChange(5);
312
- } }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17" })))))) : (h("div", { class: "feedback-modal-rating-content" }, h("span", { class: "feedback-modal-input-heading" }, this.ratingStarsPlaceholder), h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--stars" }, [1, 2, 3, 4, 5].map((rating) => (h("button", { key: rating, class: `feedback-modal-rating-button ${this.selectedRating >= rating ? 'feedback-modal-rating-button--selected' : ''}`, onClick: (event) => {
320
+ } }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#5F6368", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("path", { d: "M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17" })))))) : (h("div", { class: "feedback-modal-rating-content" }, h("span", { class: "feedback-modal-input-heading" }, this.ratingStarsPlaceholder), h("div", { class: "feedback-modal-rating-buttons feedback-modal-rating-buttons--stars" }, [1, 2, 3, 4, 5].map((rating) => (h("button", { key: rating, class: `feedback-modal-rating-button ${this.selectedRating >= rating
321
+ ? 'feedback-modal-rating-button--selected'
322
+ : ''}`, onClick: (event) => {
313
323
  event.preventDefault();
314
324
  this.handleRatingChange(rating);
315
- } }, 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 }))), 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 }, 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.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 })))))));
325
+ } }, 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 }, 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.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 }))))))));
316
326
  }
317
327
  componentDidRender() {
318
328
  if (this.showModal) {
@@ -361,7 +371,7 @@ export class FeedbackModal {
361
371
  "reflect": false,
362
372
  "defaultValue": "false"
363
373
  },
364
- "errorMessage": {
374
+ "emailAddress": {
365
375
  "type": "string",
366
376
  "mutable": false,
367
377
  "complexType": {
@@ -375,16 +385,16 @@ export class FeedbackModal {
375
385
  "tags": [],
376
386
  "text": ""
377
387
  },
378
- "attribute": "error-message",
388
+ "attribute": "email-address",
379
389
  "reflect": false,
380
- "defaultValue": "\"Please try again later.\""
390
+ "defaultValue": "''"
381
391
  },
382
- "errorMessage403": {
383
- "type": "string",
392
+ "hideEmail": {
393
+ "type": "boolean",
384
394
  "mutable": false,
385
395
  "complexType": {
386
- "original": "string",
387
- "resolved": "string",
396
+ "original": "boolean",
397
+ "resolved": "boolean",
388
398
  "references": {}
389
399
  },
390
400
  "required": false,
@@ -393,16 +403,16 @@ export class FeedbackModal {
393
403
  "tags": [],
394
404
  "text": ""
395
405
  },
396
- "attribute": "error-message-4-0-3",
406
+ "attribute": "hide-email",
397
407
  "reflect": false,
398
- "defaultValue": "\"The request URL does not match the one defined in PushFeedback for this project.\""
408
+ "defaultValue": "false"
399
409
  },
400
- "errorMessage404": {
401
- "type": "string",
410
+ "isEmailRequired": {
411
+ "type": "boolean",
402
412
  "mutable": false,
403
413
  "complexType": {
404
- "original": "string",
405
- "resolved": "string",
414
+ "original": "boolean",
415
+ "resolved": "boolean",
406
416
  "references": {}
407
417
  },
408
418
  "required": false,
@@ -411,11 +421,11 @@ export class FeedbackModal {
411
421
  "tags": [],
412
422
  "text": ""
413
423
  },
414
- "attribute": "error-message-4-0-4",
424
+ "attribute": "is-email-required",
415
425
  "reflect": false,
416
- "defaultValue": "\"We could not find the provided project ID in PushFeedback.\""
426
+ "defaultValue": "false"
417
427
  },
418
- "modalTitle": {
428
+ "ratingMode": {
419
429
  "type": "string",
420
430
  "mutable": false,
421
431
  "complexType": {
@@ -429,16 +439,16 @@ export class FeedbackModal {
429
439
  "tags": [],
430
440
  "text": ""
431
441
  },
432
- "attribute": "modal-title",
442
+ "attribute": "rating-mode",
433
443
  "reflect": false,
434
- "defaultValue": "'Share your feedback'"
444
+ "defaultValue": "'thumbs'"
435
445
  },
436
- "modalTitleSuccess": {
437
- "type": "string",
438
- "mutable": false,
446
+ "hasSelectedElement": {
447
+ "type": "boolean",
448
+ "mutable": true,
439
449
  "complexType": {
440
- "original": "string",
441
- "resolved": "string",
450
+ "original": "boolean",
451
+ "resolved": "boolean",
442
452
  "references": {}
443
453
  },
444
454
  "required": false,
@@ -447,16 +457,16 @@ export class FeedbackModal {
447
457
  "tags": [],
448
458
  "text": ""
449
459
  },
450
- "attribute": "modal-title-success",
451
- "reflect": false,
452
- "defaultValue": "'Thanks for your feedback!'"
460
+ "attribute": "has-selected-element",
461
+ "reflect": true,
462
+ "defaultValue": "false"
453
463
  },
454
- "modalTitleError": {
455
- "type": "string",
464
+ "hidePrivacyPolicy": {
465
+ "type": "boolean",
456
466
  "mutable": false,
457
467
  "complexType": {
458
- "original": "string",
459
- "resolved": "string",
468
+ "original": "boolean",
469
+ "resolved": "boolean",
460
470
  "references": {}
461
471
  },
462
472
  "required": false,
@@ -465,16 +475,16 @@ export class FeedbackModal {
465
475
  "tags": [],
466
476
  "text": ""
467
477
  },
468
- "attribute": "modal-title-error",
478
+ "attribute": "hide-privacy-policy",
469
479
  "reflect": false,
470
- "defaultValue": "\"Oops!\""
480
+ "defaultValue": "true"
471
481
  },
472
- "modalPosition": {
473
- "type": "string",
482
+ "hideRating": {
483
+ "type": "boolean",
474
484
  "mutable": false,
475
485
  "complexType": {
476
- "original": "string",
477
- "resolved": "string",
486
+ "original": "boolean",
487
+ "resolved": "boolean",
478
488
  "references": {}
479
489
  },
480
490
  "required": false,
@@ -483,16 +493,16 @@ export class FeedbackModal {
483
493
  "tags": [],
484
494
  "text": ""
485
495
  },
486
- "attribute": "modal-position",
496
+ "attribute": "hide-rating",
487
497
  "reflect": false,
488
- "defaultValue": "'center'"
498
+ "defaultValue": "false"
489
499
  },
490
- "sendButtonText": {
491
- "type": "string",
500
+ "hideScreenshotButton": {
501
+ "type": "boolean",
492
502
  "mutable": false,
493
503
  "complexType": {
494
- "original": "string",
495
- "resolved": "string",
504
+ "original": "boolean",
505
+ "resolved": "boolean",
496
506
  "references": {}
497
507
  },
498
508
  "required": false,
@@ -501,11 +511,11 @@ export class FeedbackModal {
501
511
  "tags": [],
502
512
  "text": ""
503
513
  },
504
- "attribute": "send-button-text",
514
+ "attribute": "hide-screenshot-button",
505
515
  "reflect": false,
506
- "defaultValue": "'Send'"
516
+ "defaultValue": "false"
507
517
  },
508
- "successMessage": {
518
+ "project": {
509
519
  "type": "string",
510
520
  "mutable": false,
511
521
  "complexType": {
@@ -519,16 +529,16 @@ export class FeedbackModal {
519
529
  "tags": [],
520
530
  "text": ""
521
531
  },
522
- "attribute": "success-message",
532
+ "attribute": "project",
523
533
  "reflect": false,
524
- "defaultValue": "\"\""
534
+ "defaultValue": "''"
525
535
  },
526
- "project": {
527
- "type": "string",
528
- "mutable": false,
536
+ "showScreenshotMode": {
537
+ "type": "boolean",
538
+ "mutable": true,
529
539
  "complexType": {
530
- "original": "string",
531
- "resolved": "string",
540
+ "original": "boolean",
541
+ "resolved": "boolean",
532
542
  "references": {}
533
543
  },
534
544
  "required": false,
@@ -537,16 +547,16 @@ export class FeedbackModal {
537
547
  "tags": [],
538
548
  "text": ""
539
549
  },
540
- "attribute": "project",
541
- "reflect": false,
542
- "defaultValue": "''"
550
+ "attribute": "show-screenshot-mode",
551
+ "reflect": true,
552
+ "defaultValue": "false"
543
553
  },
544
- "screenshotButtonText": {
545
- "type": "string",
546
- "mutable": false,
554
+ "showScreenshotTopBar": {
555
+ "type": "boolean",
556
+ "mutable": true,
547
557
  "complexType": {
548
- "original": "string",
549
- "resolved": "string",
558
+ "original": "boolean",
559
+ "resolved": "boolean",
550
560
  "references": {}
551
561
  },
552
562
  "required": false,
@@ -555,16 +565,34 @@ export class FeedbackModal {
555
565
  "tags": [],
556
566
  "text": ""
557
567
  },
558
- "attribute": "screenshot-button-text",
559
- "reflect": false,
560
- "defaultValue": "'Add a screenshot'"
568
+ "attribute": "show-screenshot-top-bar",
569
+ "reflect": true,
570
+ "defaultValue": "false"
561
571
  },
562
- "screenshotTopbarText": {
563
- "type": "string",
572
+ "showModal": {
573
+ "type": "boolean",
574
+ "mutable": true,
575
+ "complexType": {
576
+ "original": "boolean",
577
+ "resolved": "boolean",
578
+ "references": {}
579
+ },
580
+ "required": false,
581
+ "optional": false,
582
+ "docs": {
583
+ "tags": [],
584
+ "text": ""
585
+ },
586
+ "attribute": "show-modal",
587
+ "reflect": true,
588
+ "defaultValue": "false"
589
+ },
590
+ "rating": {
591
+ "type": "number",
564
592
  "mutable": false,
565
593
  "complexType": {
566
- "original": "string",
567
- "resolved": "string",
594
+ "original": "number",
595
+ "resolved": "number",
568
596
  "references": {}
569
597
  },
570
598
  "required": false,
@@ -573,11 +601,10 @@ export class FeedbackModal {
573
601
  "tags": [],
574
602
  "text": ""
575
603
  },
576
- "attribute": "screenshot-topbar-text",
577
- "reflect": false,
578
- "defaultValue": "'Select an element on this page'"
604
+ "attribute": "rating",
605
+ "reflect": false
579
606
  },
580
- "hideEmail": {
607
+ "fetchData": {
581
608
  "type": "boolean",
582
609
  "mutable": false,
583
610
  "complexType": {
@@ -591,11 +618,11 @@ export class FeedbackModal {
591
618
  "tags": [],
592
619
  "text": ""
593
620
  },
594
- "attribute": "hide-email",
621
+ "attribute": "fetch-data",
595
622
  "reflect": false,
596
- "defaultValue": "false"
623
+ "defaultValue": "true"
597
624
  },
598
- "emailAddress": {
625
+ "emailPlaceholder": {
599
626
  "type": "string",
600
627
  "mutable": false,
601
628
  "complexType": {
@@ -609,11 +636,11 @@ export class FeedbackModal {
609
636
  "tags": [],
610
637
  "text": ""
611
638
  },
612
- "attribute": "email-address",
639
+ "attribute": "email-placeholder",
613
640
  "reflect": false,
614
- "defaultValue": "''"
641
+ "defaultValue": "'Email address (optional)'"
615
642
  },
616
- "emailPlaceholder": {
643
+ "errorMessage": {
617
644
  "type": "string",
618
645
  "mutable": false,
619
646
  "complexType": {
@@ -627,11 +654,11 @@ export class FeedbackModal {
627
654
  "tags": [],
628
655
  "text": ""
629
656
  },
630
- "attribute": "email-placeholder",
657
+ "attribute": "error-message",
631
658
  "reflect": false,
632
- "defaultValue": "'Email address (optional)'"
659
+ "defaultValue": "'Please try again later.'"
633
660
  },
634
- "messagePlaceholder": {
661
+ "errorMessage403": {
635
662
  "type": "string",
636
663
  "mutable": false,
637
664
  "complexType": {
@@ -645,16 +672,16 @@ export class FeedbackModal {
645
672
  "tags": [],
646
673
  "text": ""
647
674
  },
648
- "attribute": "message-placeholder",
675
+ "attribute": "error-message-4-0-3",
649
676
  "reflect": false,
650
- "defaultValue": "'Comments'"
677
+ "defaultValue": "'The request URL does not match the one defined in PushFeedback for this project.'"
651
678
  },
652
- "hideRating": {
653
- "type": "boolean",
679
+ "errorMessage404": {
680
+ "type": "string",
654
681
  "mutable": false,
655
682
  "complexType": {
656
- "original": "boolean",
657
- "resolved": "boolean",
683
+ "original": "string",
684
+ "resolved": "string",
658
685
  "references": {}
659
686
  },
660
687
  "required": false,
@@ -663,16 +690,16 @@ export class FeedbackModal {
663
690
  "tags": [],
664
691
  "text": ""
665
692
  },
666
- "attribute": "hide-rating",
693
+ "attribute": "error-message-4-0-4",
667
694
  "reflect": false,
668
- "defaultValue": "false"
695
+ "defaultValue": "'We could not find the provided project ID in PushFeedback.'"
669
696
  },
670
- "rating": {
671
- "type": "number",
697
+ "messagePlaceholder": {
698
+ "type": "string",
672
699
  "mutable": false,
673
700
  "complexType": {
674
- "original": "number",
675
- "resolved": "number",
701
+ "original": "string",
702
+ "resolved": "string",
676
703
  "references": {}
677
704
  },
678
705
  "required": false,
@@ -681,10 +708,11 @@ export class FeedbackModal {
681
708
  "tags": [],
682
709
  "text": ""
683
710
  },
684
- "attribute": "rating",
685
- "reflect": false
711
+ "attribute": "message-placeholder",
712
+ "reflect": false,
713
+ "defaultValue": "'Comments'"
686
714
  },
687
- "ratingMode": {
715
+ "footerText": {
688
716
  "type": "string",
689
717
  "mutable": false,
690
718
  "complexType": {
@@ -698,11 +726,11 @@ export class FeedbackModal {
698
726
  "tags": [],
699
727
  "text": ""
700
728
  },
701
- "attribute": "rating-mode",
729
+ "attribute": "footer-text",
702
730
  "reflect": false,
703
- "defaultValue": "'thumbs'"
731
+ "defaultValue": "''"
704
732
  },
705
- "ratingPlaceholder": {
733
+ "modalPosition": {
706
734
  "type": "string",
707
735
  "mutable": false,
708
736
  "complexType": {
@@ -716,11 +744,11 @@ export class FeedbackModal {
716
744
  "tags": [],
717
745
  "text": ""
718
746
  },
719
- "attribute": "rating-placeholder",
747
+ "attribute": "modal-position",
720
748
  "reflect": false,
721
- "defaultValue": "'Was this page helpful?'"
749
+ "defaultValue": "'center'"
722
750
  },
723
- "ratingStarsPlaceholder": {
751
+ "modalTitle": {
724
752
  "type": "string",
725
753
  "mutable": false,
726
754
  "complexType": {
@@ -734,11 +762,11 @@ export class FeedbackModal {
734
762
  "tags": [],
735
763
  "text": ""
736
764
  },
737
- "attribute": "rating-stars-placeholder",
765
+ "attribute": "modal-title",
738
766
  "reflect": false,
739
- "defaultValue": "'How would you rate this page?'"
767
+ "defaultValue": "'Share your feedback'"
740
768
  },
741
- "footerText": {
769
+ "modalTitleError": {
742
770
  "type": "string",
743
771
  "mutable": false,
744
772
  "complexType": {
@@ -752,16 +780,16 @@ export class FeedbackModal {
752
780
  "tags": [],
753
781
  "text": ""
754
782
  },
755
- "attribute": "footer-text",
783
+ "attribute": "modal-title-error",
756
784
  "reflect": false,
757
- "defaultValue": "''"
785
+ "defaultValue": "'Oops!'"
758
786
  },
759
- "showModal": {
760
- "type": "boolean",
761
- "mutable": true,
787
+ "modalTitleSuccess": {
788
+ "type": "string",
789
+ "mutable": false,
762
790
  "complexType": {
763
- "original": "boolean",
764
- "resolved": "boolean",
791
+ "original": "string",
792
+ "resolved": "string",
765
793
  "references": {}
766
794
  },
767
795
  "required": false,
@@ -770,16 +798,16 @@ export class FeedbackModal {
770
798
  "tags": [],
771
799
  "text": ""
772
800
  },
773
- "attribute": "show-modal",
774
- "reflect": true,
775
- "defaultValue": "false"
801
+ "attribute": "modal-title-success",
802
+ "reflect": false,
803
+ "defaultValue": "'Thanks for your feedback!'"
776
804
  },
777
- "showScreenshotMode": {
778
- "type": "boolean",
779
- "mutable": true,
805
+ "privacyPolicyText": {
806
+ "type": "string",
807
+ "mutable": false,
780
808
  "complexType": {
781
- "original": "boolean",
782
- "resolved": "boolean",
809
+ "original": "string",
810
+ "resolved": "string",
783
811
  "references": {}
784
812
  },
785
813
  "required": false,
@@ -788,16 +816,16 @@ export class FeedbackModal {
788
816
  "tags": [],
789
817
  "text": ""
790
818
  },
791
- "attribute": "show-screenshot-mode",
792
- "reflect": true,
793
- "defaultValue": "false"
819
+ "attribute": "privacy-policy-text",
820
+ "reflect": false,
821
+ "defaultValue": "\"I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.\""
794
822
  },
795
- "showScreenshotTopBar": {
796
- "type": "boolean",
797
- "mutable": true,
823
+ "ratingPlaceholder": {
824
+ "type": "string",
825
+ "mutable": false,
798
826
  "complexType": {
799
- "original": "boolean",
800
- "resolved": "boolean",
827
+ "original": "string",
828
+ "resolved": "string",
801
829
  "references": {}
802
830
  },
803
831
  "required": false,
@@ -806,16 +834,16 @@ export class FeedbackModal {
806
834
  "tags": [],
807
835
  "text": ""
808
836
  },
809
- "attribute": "show-screenshot-top-bar",
810
- "reflect": true,
811
- "defaultValue": "false"
837
+ "attribute": "rating-placeholder",
838
+ "reflect": false,
839
+ "defaultValue": "'Was this page helpful?'"
812
840
  },
813
- "hasSelectedElement": {
814
- "type": "boolean",
815
- "mutable": true,
841
+ "ratingStarsPlaceholder": {
842
+ "type": "string",
843
+ "mutable": false,
816
844
  "complexType": {
817
- "original": "boolean",
818
- "resolved": "boolean",
845
+ "original": "string",
846
+ "resolved": "string",
819
847
  "references": {}
820
848
  },
821
849
  "required": false,
@@ -824,16 +852,16 @@ export class FeedbackModal {
824
852
  "tags": [],
825
853
  "text": ""
826
854
  },
827
- "attribute": "has-selected-element",
828
- "reflect": true,
829
- "defaultValue": "false"
855
+ "attribute": "rating-stars-placeholder",
856
+ "reflect": false,
857
+ "defaultValue": "'How would you rate this page?'"
830
858
  },
831
- "hideScreenshotButton": {
832
- "type": "boolean",
859
+ "sendButtonText": {
860
+ "type": "string",
833
861
  "mutable": false,
834
862
  "complexType": {
835
- "original": "boolean",
836
- "resolved": "boolean",
863
+ "original": "string",
864
+ "resolved": "string",
837
865
  "references": {}
838
866
  },
839
867
  "required": false,
@@ -842,16 +870,16 @@ export class FeedbackModal {
842
870
  "tags": [],
843
871
  "text": ""
844
872
  },
845
- "attribute": "hide-screenshot-button",
873
+ "attribute": "send-button-text",
846
874
  "reflect": false,
847
- "defaultValue": "false"
875
+ "defaultValue": "'Send'"
848
876
  },
849
- "hidePrivacyPolicy": {
850
- "type": "boolean",
877
+ "screenshotButtonText": {
878
+ "type": "string",
851
879
  "mutable": false,
852
880
  "complexType": {
853
- "original": "boolean",
854
- "resolved": "boolean",
881
+ "original": "string",
882
+ "resolved": "string",
855
883
  "references": {}
856
884
  },
857
885
  "required": false,
@@ -860,11 +888,11 @@ export class FeedbackModal {
860
888
  "tags": [],
861
889
  "text": ""
862
890
  },
863
- "attribute": "hide-privacy-policy",
891
+ "attribute": "screenshot-button-text",
864
892
  "reflect": false,
865
- "defaultValue": "true"
893
+ "defaultValue": "'Add a screenshot'"
866
894
  },
867
- "privacyPolicyText": {
895
+ "screenshotTopbarText": {
868
896
  "type": "string",
869
897
  "mutable": false,
870
898
  "complexType": {
@@ -878,16 +906,16 @@ export class FeedbackModal {
878
906
  "tags": [],
879
907
  "text": ""
880
908
  },
881
- "attribute": "privacy-policy-text",
909
+ "attribute": "screenshot-topbar-text",
882
910
  "reflect": false,
883
- "defaultValue": "\"I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.\""
911
+ "defaultValue": "'Select an element on this page'"
884
912
  },
885
- "fetchData": {
886
- "type": "boolean",
913
+ "successMessage": {
914
+ "type": "string",
887
915
  "mutable": false,
888
916
  "complexType": {
889
- "original": "boolean",
890
- "resolved": "boolean",
917
+ "original": "string",
918
+ "resolved": "string",
891
919
  "references": {}
892
920
  },
893
921
  "required": false,
@@ -896,9 +924,9 @@ export class FeedbackModal {
896
924
  "tags": [],
897
925
  "text": ""
898
926
  },
899
- "attribute": "fetch-data",
927
+ "attribute": "success-message",
900
928
  "reflect": false,
901
- "defaultValue": "true"
929
+ "defaultValue": "''"
902
930
  }
903
931
  };
904
932
  }