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