pushfeedback 0.1.63 → 0.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/feedback-button_2.cjs.entry.js +101 -94
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pushfeedback.cjs.js +1 -1
- package/dist/collection/components/feedback-button/feedback-button.js +212 -212
- package/dist/collection/components/feedback-modal/feedback-modal.js +212 -206
- package/dist/components/feedback-button.js +74 -74
- package/dist/components/feedback-modal2.js +73 -66
- package/dist/esm/feedback-button_2.entry.js +101 -94
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pushfeedback.js +1 -1
- package/dist/pushfeedback/{p-90a99a78.entry.js → p-1c7756d1.entry.js} +2 -2
- package/dist/pushfeedback/pushfeedback.esm.js +1 -1
- package/dist/types/components/feedback-button/feedback-button.d.ts +24 -24
- package/dist/types/components/feedback-modal/feedback-modal.d.ts +22 -22
- package/package.json +11 -3
|
@@ -7,39 +7,39 @@ const FeedbackButton = class {
|
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
8
|
this.feedbackSent = createEvent(this, "feedbackSent", 7);
|
|
9
9
|
this.feedbackError = createEvent(this, "feedbackError", 7);
|
|
10
|
-
this.
|
|
10
|
+
this.buttonPosition = 'default';
|
|
11
|
+
this.buttonStyle = 'default';
|
|
12
|
+
this.hideIcon = false;
|
|
13
|
+
this.hideMobile = false;
|
|
14
|
+
this.sessionId = '';
|
|
15
|
+
this.submit = false;
|
|
11
16
|
this.customFont = false;
|
|
12
|
-
this.errorMessage = "Please try again later.";
|
|
13
|
-
this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
|
|
14
|
-
this.errorMessage404 = "We could not find the provided project id in PushFeedback.";
|
|
15
|
-
this.modalTitle = 'Share your feedback';
|
|
16
|
-
this.modalTitleSuccess = 'Thanks for your feedback!';
|
|
17
|
-
this.modalTitleError = "Oops!";
|
|
18
|
-
this.modalPosition = 'center';
|
|
19
|
-
this.sendButtonText = 'Send';
|
|
20
|
-
this.successMessage = "";
|
|
21
|
-
this.project = '';
|
|
22
|
-
this.screenshotButtonText = 'Add a screenshot';
|
|
23
|
-
this.screenshotTopbarText = 'Select an element on this page';
|
|
24
|
-
this.hideEmail = false;
|
|
25
17
|
this.emailAddress = '';
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
18
|
+
this.fetchData = true;
|
|
19
|
+
this.hideEmail = false;
|
|
20
|
+
this.hidePrivacyPolicy = true;
|
|
28
21
|
this.hideRating = false;
|
|
22
|
+
this.hideScreenshotButton = false;
|
|
23
|
+
this.modalPosition = 'center';
|
|
24
|
+
this.project = '';
|
|
29
25
|
this.rating = undefined;
|
|
30
26
|
this.ratingMode = 'thumbs';
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
27
|
+
this.emailPlaceholder = 'Email address (optional)';
|
|
28
|
+
this.errorMessage = 'Please try again later.';
|
|
29
|
+
this.errorMessage403 = 'The request URL does not match the one defined in PushFeedback for this project.';
|
|
30
|
+
this.errorMessage404 = 'We could not find the provided project id in PushFeedback.';
|
|
33
31
|
this.footerText = '';
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.hidePrivacyPolicy = true;
|
|
39
|
-
this.hideMobile = false;
|
|
32
|
+
this.messagePlaceholder = 'Comments';
|
|
33
|
+
this.modalTitle = 'Share your feedback';
|
|
34
|
+
this.modalTitleError = 'Oops!';
|
|
35
|
+
this.modalTitleSuccess = 'Thanks for your feedback!';
|
|
40
36
|
this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
|
|
41
|
-
this.
|
|
42
|
-
this.
|
|
37
|
+
this.ratingPlaceholder = 'Was this page helpful?';
|
|
38
|
+
this.ratingStarsPlaceholder = 'How would you rate this page?';
|
|
39
|
+
this.screenshotButtonText = 'Add a screenshot';
|
|
40
|
+
this.screenshotTopbarText = 'Select an element on this page';
|
|
41
|
+
this.sendButtonText = 'Send';
|
|
42
|
+
this.successMessage = '';
|
|
43
43
|
}
|
|
44
44
|
componentWillLoad() {
|
|
45
45
|
if (!this.sessionId) {
|
|
@@ -58,7 +58,7 @@ const FeedbackButton = class {
|
|
|
58
58
|
if (this.isSafariBrowser()) {
|
|
59
59
|
adjustement = 5;
|
|
60
60
|
}
|
|
61
|
-
buttonContent.style.right = `${(buttonContent.offsetWidth + adjustement) / 2 * -1}px`;
|
|
61
|
+
buttonContent.style.right = `${((buttonContent.offsetWidth + adjustement) / 2) * -1}px`;
|
|
62
62
|
}
|
|
63
63
|
if (!this.customFont) {
|
|
64
64
|
this.loadInterFont();
|
|
@@ -68,34 +68,34 @@ const FeedbackButton = class {
|
|
|
68
68
|
this.feedbackModal = document.createElement('feedback-modal');
|
|
69
69
|
const props = [
|
|
70
70
|
'customFont',
|
|
71
|
+
'emailAddress',
|
|
72
|
+
'fetchData',
|
|
73
|
+
'hideEmail',
|
|
74
|
+
'hidePrivacyPolicy',
|
|
75
|
+
'hideRating',
|
|
76
|
+
'hideScreenshotButton',
|
|
77
|
+
'modalPosition',
|
|
78
|
+
'project',
|
|
79
|
+
'rating',
|
|
80
|
+
'ratingMode',
|
|
81
|
+
'emailPlaceholder',
|
|
71
82
|
'errorMessage',
|
|
72
83
|
'errorMessage403',
|
|
73
84
|
'errorMessage404',
|
|
85
|
+
'footerText',
|
|
86
|
+
'messagePlaceholder',
|
|
74
87
|
'modalTitle',
|
|
75
|
-
'modalTitleSuccess',
|
|
76
88
|
'modalTitleError',
|
|
77
|
-
'
|
|
78
|
-
'
|
|
79
|
-
'successMessage',
|
|
80
|
-
'project',
|
|
81
|
-
'screenshotButtonText',
|
|
82
|
-
'screenshotTopbarText',
|
|
83
|
-
'hideEmail',
|
|
84
|
-
'emailAddress',
|
|
85
|
-
'emailPlaceholder',
|
|
86
|
-
'messagePlaceholder',
|
|
87
|
-
'hideRating',
|
|
88
|
-
'rating',
|
|
89
|
-
'ratingMode',
|
|
89
|
+
'modalTitleSuccess',
|
|
90
|
+
'privacyPolicyText',
|
|
90
91
|
'ratingPlaceholder',
|
|
91
92
|
'ratingStarsPlaceholder',
|
|
92
|
-
'
|
|
93
|
-
'
|
|
94
|
-
'
|
|
95
|
-
'
|
|
96
|
-
'fetchData',
|
|
93
|
+
'screenshotButtonText',
|
|
94
|
+
'screenshotTopbarText',
|
|
95
|
+
'sendButtonText',
|
|
96
|
+
'successMessage',
|
|
97
97
|
];
|
|
98
|
-
props.forEach(prop => {
|
|
98
|
+
props.forEach((prop) => {
|
|
99
99
|
this.feedbackModal[prop] = this[prop];
|
|
100
100
|
});
|
|
101
101
|
document.body.appendChild(this.feedbackModal);
|
|
@@ -131,15 +131,15 @@ const FeedbackButton = class {
|
|
|
131
131
|
project: this.project,
|
|
132
132
|
rating: this.rating || -1,
|
|
133
133
|
ratingMode: this.ratingMode,
|
|
134
|
-
message:
|
|
134
|
+
message: '',
|
|
135
135
|
session: localStorage.getItem('pushfeedback_sessionid') || '',
|
|
136
136
|
};
|
|
137
137
|
const res = await fetch('https://app.pushfeedback.com/api/feedback/', {
|
|
138
138
|
method: 'POST',
|
|
139
139
|
body: JSON.stringify(body),
|
|
140
140
|
headers: {
|
|
141
|
-
'Content-Type': 'application/json'
|
|
142
|
-
}
|
|
141
|
+
'Content-Type': 'application/json',
|
|
142
|
+
},
|
|
143
143
|
});
|
|
144
144
|
if (res.status === 201) {
|
|
145
145
|
const feedback_with_id = Object.assign(Object.assign({}, body), { id: await res.json() });
|
|
@@ -8971,7 +8971,7 @@ const FeedbackModal = class {
|
|
|
8971
8971
|
clearTimeout(this.scrollTimeout);
|
|
8972
8972
|
this.scrollTimeout = setTimeout(() => {
|
|
8973
8973
|
document.documentElement.classList.remove('feedback-modal-screenshot-closing');
|
|
8974
|
-
document.documentElement.style.top =
|
|
8974
|
+
document.documentElement.style.top = '';
|
|
8975
8975
|
window.removeEventListener('scroll', this.onScrollDebounced);
|
|
8976
8976
|
}, 200);
|
|
8977
8977
|
};
|
|
@@ -8998,8 +8998,8 @@ const FeedbackModal = class {
|
|
|
8998
8998
|
method: 'POST',
|
|
8999
8999
|
body: JSON.stringify(body),
|
|
9000
9000
|
headers: {
|
|
9001
|
-
'Content-Type': 'application/json'
|
|
9002
|
-
}
|
|
9001
|
+
'Content-Type': 'application/json',
|
|
9002
|
+
},
|
|
9003
9003
|
});
|
|
9004
9004
|
if (res.status === 201) {
|
|
9005
9005
|
const feedback_with_id = Object.assign(Object.assign({}, body), { id: await res.json() });
|
|
@@ -9083,7 +9083,7 @@ const FeedbackModal = class {
|
|
|
9083
9083
|
const rect = elementUnder.getBoundingClientRect();
|
|
9084
9084
|
this.screenshotModal.style.display = '';
|
|
9085
9085
|
// Get the bounding box of the element selected
|
|
9086
|
-
this.elementSelected.style.position =
|
|
9086
|
+
this.elementSelected.style.position = 'absolute';
|
|
9087
9087
|
this.elementSelected.style.left = `${rect.left}px`;
|
|
9088
9088
|
this.elementSelected.style.top = `${rect.top}px`;
|
|
9089
9089
|
this.elementSelected.style.width = `${rect.width}px`;
|
|
@@ -9091,33 +9091,33 @@ const FeedbackModal = class {
|
|
|
9091
9091
|
this.elementSelected.classList.add('feedback-modal-element-hover');
|
|
9092
9092
|
// Set the background color of nonselected areas
|
|
9093
9093
|
// Top
|
|
9094
|
-
this.topSide.style.position =
|
|
9094
|
+
this.topSide.style.position = 'absolute';
|
|
9095
9095
|
this.topSide.style.left = `${rect.left}px`;
|
|
9096
9096
|
this.topSide.style.top = '0px';
|
|
9097
9097
|
this.topSide.style.width = `${rect.width + borderOffset}px`;
|
|
9098
9098
|
this.topSide.style.height = `${rect.top}px`;
|
|
9099
|
-
this.topSide.style.backgroundColor =
|
|
9099
|
+
this.topSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
|
|
9100
9100
|
// Left
|
|
9101
|
-
this.leftSide.style.position =
|
|
9101
|
+
this.leftSide.style.position = 'absolute';
|
|
9102
9102
|
this.leftSide.style.left = '0px';
|
|
9103
9103
|
this.leftSide.style.top = '0px';
|
|
9104
9104
|
this.leftSide.style.width = `${rect.left}px`;
|
|
9105
9105
|
this.leftSide.style.height = '100vh';
|
|
9106
|
-
this.leftSide.style.backgroundColor =
|
|
9106
|
+
this.leftSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
|
|
9107
9107
|
// Bottom
|
|
9108
|
-
this.bottomSide.style.position =
|
|
9108
|
+
this.bottomSide.style.position = 'absolute';
|
|
9109
9109
|
this.bottomSide.style.left = `${rect.left}px`;
|
|
9110
9110
|
this.bottomSide.style.top = `${rect.bottom + borderOffset}px`;
|
|
9111
9111
|
this.bottomSide.style.width = `${rect.width + borderOffset}px`;
|
|
9112
9112
|
this.bottomSide.style.height = '100vh';
|
|
9113
|
-
this.bottomSide.style.backgroundColor =
|
|
9113
|
+
this.bottomSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
|
|
9114
9114
|
// Right
|
|
9115
|
-
this.rightSide.style.position =
|
|
9115
|
+
this.rightSide.style.position = 'absolute';
|
|
9116
9116
|
this.rightSide.style.left = `${rect.right + borderOffset}px`;
|
|
9117
9117
|
this.rightSide.style.top = '0px';
|
|
9118
9118
|
this.rightSide.style.width = '100%';
|
|
9119
9119
|
this.rightSide.style.height = '100vh';
|
|
9120
|
-
this.rightSide.style.backgroundColor =
|
|
9120
|
+
this.rightSide.style.backgroundColor = 'rgba(0, 0, 0, 0.4)';
|
|
9121
9121
|
// Restore the visibility of the screenshot-modal
|
|
9122
9122
|
this.screenshotModal.style.backgroundColor = 'transparent';
|
|
9123
9123
|
};
|
|
@@ -9169,36 +9169,36 @@ const FeedbackModal = class {
|
|
|
9169
9169
|
this.overlayVisible = false;
|
|
9170
9170
|
this.isAnimating = false;
|
|
9171
9171
|
this.customFont = false;
|
|
9172
|
-
this.errorMessage = "Please try again later.";
|
|
9173
|
-
this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
|
|
9174
|
-
this.errorMessage404 = "We could not find the provided project ID in PushFeedback.";
|
|
9175
|
-
this.modalTitle = 'Share your feedback';
|
|
9176
|
-
this.modalTitleSuccess = 'Thanks for your feedback!';
|
|
9177
|
-
this.modalTitleError = "Oops!";
|
|
9178
|
-
this.modalPosition = 'center';
|
|
9179
|
-
this.sendButtonText = 'Send';
|
|
9180
|
-
this.successMessage = "";
|
|
9181
|
-
this.project = '';
|
|
9182
|
-
this.screenshotButtonText = 'Add a screenshot';
|
|
9183
|
-
this.screenshotTopbarText = 'Select an element on this page';
|
|
9184
|
-
this.hideEmail = false;
|
|
9185
9172
|
this.emailAddress = '';
|
|
9186
|
-
this.
|
|
9187
|
-
this.messagePlaceholder = 'Comments';
|
|
9188
|
-
this.hideRating = false;
|
|
9189
|
-
this.rating = undefined;
|
|
9173
|
+
this.hideEmail = false;
|
|
9190
9174
|
this.ratingMode = 'thumbs';
|
|
9191
|
-
this.ratingPlaceholder = 'Was this page helpful?';
|
|
9192
|
-
this.ratingStarsPlaceholder = 'How would you rate this page?';
|
|
9193
|
-
this.footerText = '';
|
|
9194
|
-
this.showModal = false;
|
|
9195
|
-
this.showScreenshotMode = false;
|
|
9196
|
-
this.showScreenshotTopBar = false;
|
|
9197
9175
|
this.hasSelectedElement = false;
|
|
9198
|
-
this.hideScreenshotButton = false;
|
|
9199
9176
|
this.hidePrivacyPolicy = true;
|
|
9200
|
-
this.
|
|
9177
|
+
this.hideRating = false;
|
|
9178
|
+
this.hideScreenshotButton = false;
|
|
9179
|
+
this.project = '';
|
|
9180
|
+
this.showScreenshotMode = false;
|
|
9181
|
+
this.showScreenshotTopBar = false;
|
|
9182
|
+
this.showModal = false;
|
|
9183
|
+
this.rating = undefined;
|
|
9201
9184
|
this.fetchData = true;
|
|
9185
|
+
this.emailPlaceholder = 'Email address (optional)';
|
|
9186
|
+
this.errorMessage = 'Please try again later.';
|
|
9187
|
+
this.errorMessage403 = 'The request URL does not match the one defined in PushFeedback for this project.';
|
|
9188
|
+
this.errorMessage404 = 'We could not find the provided project ID in PushFeedback.';
|
|
9189
|
+
this.messagePlaceholder = 'Comments';
|
|
9190
|
+
this.footerText = '';
|
|
9191
|
+
this.modalPosition = 'center';
|
|
9192
|
+
this.modalTitle = 'Share your feedback';
|
|
9193
|
+
this.modalTitleError = 'Oops!';
|
|
9194
|
+
this.modalTitleSuccess = 'Thanks for your feedback!';
|
|
9195
|
+
this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
|
|
9196
|
+
this.ratingPlaceholder = 'Was this page helpful?';
|
|
9197
|
+
this.ratingStarsPlaceholder = 'How would you rate this page?';
|
|
9198
|
+
this.sendButtonText = 'Send';
|
|
9199
|
+
this.screenshotButtonText = 'Add a screenshot';
|
|
9200
|
+
this.screenshotTopbarText = 'Select an element on this page';
|
|
9201
|
+
this.successMessage = '';
|
|
9202
9202
|
}
|
|
9203
9203
|
componentWillLoad() {
|
|
9204
9204
|
if (this.fetchData)
|
|
@@ -9207,7 +9207,7 @@ const FeedbackModal = class {
|
|
|
9207
9207
|
if (this.rating) {
|
|
9208
9208
|
this.selectedRating = this.rating;
|
|
9209
9209
|
}
|
|
9210
|
-
if (this.ratingMode ==
|
|
9210
|
+
if (this.ratingMode == 'thumbs' && this.rating == 0) {
|
|
9211
9211
|
this.selectedRating = 5;
|
|
9212
9212
|
}
|
|
9213
9213
|
}
|
|
@@ -9246,11 +9246,12 @@ const FeedbackModal = class {
|
|
|
9246
9246
|
y: window.scrollY,
|
|
9247
9247
|
width: window.innerWidth,
|
|
9248
9248
|
height: window.innerHeight,
|
|
9249
|
-
})
|
|
9249
|
+
})
|
|
9250
|
+
.then((canvas) => {
|
|
9250
9251
|
const dataUrl = canvas.toDataURL();
|
|
9251
9252
|
resolve(dataUrl);
|
|
9252
9253
|
})
|
|
9253
|
-
.catch(error => {
|
|
9254
|
+
.catch((error) => {
|
|
9254
9255
|
console.error(error);
|
|
9255
9256
|
reject(error);
|
|
9256
9257
|
});
|
|
@@ -9267,16 +9268,22 @@ const FeedbackModal = class {
|
|
|
9267
9268
|
this.selectedRating = newRating;
|
|
9268
9269
|
}
|
|
9269
9270
|
render() {
|
|
9270
|
-
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
|
|
9271
|
+
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
|
|
9272
|
+
? 'feedback-modal-rating-button--selected'
|
|
9273
|
+
: ''}`, onClick: (event) => {
|
|
9271
9274
|
event.preventDefault();
|
|
9272
9275
|
this.handleRatingChange(1);
|
|
9273
|
-
} }, 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
|
|
9276
|
+
} }, 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
|
|
9277
|
+
? 'feedback-modal-rating-button--selected'
|
|
9278
|
+
: ''}`, onClick: (event) => {
|
|
9274
9279
|
event.preventDefault();
|
|
9275
9280
|
this.handleRatingChange(5);
|
|
9276
|
-
} }, 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
|
|
9281
|
+
} }, 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
|
|
9282
|
+
? 'feedback-modal-rating-button--selected'
|
|
9283
|
+
: ''}`, onClick: (event) => {
|
|
9277
9284
|
event.preventDefault();
|
|
9278
9285
|
this.handleRatingChange(rating);
|
|
9279
|
-
} }, 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 ?
|
|
9286
|
+
} }, 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 }))))))));
|
|
9280
9287
|
}
|
|
9281
9288
|
componentDidRender() {
|
|
9282
9289
|
if (this.showModal) {
|
package/dist/esm/loader.js
CHANGED
|
@@ -11,7 +11,7 @@ const patchEsm = () => {
|
|
|
11
11
|
const defineCustomElements = (win, options) => {
|
|
12
12
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
13
13
|
return patchEsm().then(() => {
|
|
14
|
-
return bootstrapLazy([["feedback-button_2",[[1,"feedback-button",{"
|
|
14
|
+
return bootstrapLazy([["feedback-button_2",[[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"],"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"],"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);
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
|
package/dist/esm/pushfeedback.js
CHANGED
|
@@ -14,5 +14,5 @@ const patchBrowser = () => {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
patchBrowser().then(options => {
|
|
17
|
-
return bootstrapLazy([["feedback-button_2",[[1,"feedback-button",{"
|
|
17
|
+
return bootstrapLazy([["feedback-button_2",[[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"],"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"],"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);
|
|
18
18
|
});
|