pushfeedback 0.1.43 → 0.1.44
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 +409 -409
- package/dist/collection/components/feedback-button/feedback-button.css +8 -0
- package/dist/collection/components/feedback-button/feedback-button.js +671 -671
- package/dist/collection/components/feedback-modal/feedback-modal.css +1 -1
- package/dist/collection/components/feedback-modal/feedback-modal.js +845 -845
- package/dist/collection/index.js +1 -1
- package/dist/components/feedback-button.js +168 -168
- package/dist/components/feedback-modal2.js +348 -348
- package/dist/esm/feedback-button_2.entry.js +409 -409
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/pushfeedback/{p-4571809a.entry.js → p-fb4e4a0c.entry.js} +2 -2
- package/dist/pushfeedback/pushfeedback.esm.js +1 -1
- package/dist/types/components/feedback-button/feedback-button.d.ts +43 -43
- package/dist/types/components/feedback-modal/feedback-modal.d.ts +67 -67
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -7844,355 +7844,355 @@ var html2canvas = createCommonjsModule(function (module, exports) {
|
|
|
7844
7844
|
//# sourceMappingURL=html2canvas.js.map
|
|
7845
7845
|
});
|
|
7846
7846
|
|
|
7847
|
-
const feedbackModalCss = ".text-center{flex-grow:1;text-align:center}.feedback-modal-wrapper{position:absolute;z-index:var(--feedback-modal-wrapper-z-index)}.feedback-overlay{background-color:var(--feedback-modal-screenshot-bg-color);height:100%;left:0;position:fixed;top:0;width:100%;z-index:var(--feedback-modal-screnshot-z-index)}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);left:50%;max-width:90%;padding:20px;position:fixed;top:50%;transform:translate(-50%, -50%);width:100%;z-index:var(--feedback-modal-content-z-index)}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);display:flex;font-family:var(--feedback-modal-header-font-family);font-size:var(--feedback-header-font-size);font-weight:var(--feedback-modal-header-font-weight);justify-content:space-between;margin-bottom:20px}.feedback-modal-rating-buttons{width:100%;margin-bottom:20px}.feedback-modal-rating-button{padding:0;background-color:transparent;border:transparent;margin-right:5px;cursor:pointer}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button{border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);font-size:var(--feedback-modal-button-font-size);font-family:var(--feedback-modal-content-font-family);font-weight:500;margin-right:10px;justify-content:center;padding:5px 10px}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button:hover,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--selected{background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-text-color-active)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button:hover svg,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--selected svg{stroke:var(--feedback-modal-rating-button-selected-color)}.feedback-modal-rating-buttons svg{stroke:var(--feedback-modal-rating-button-color);cursor:pointer}.feedback-modal-rating-buttons--stars .feedback-modal-rating-button--selected svg{fill:var(--feedback-modal-rating-button-stars-selected-color);stroke:var(--feedback-modal-rating-button-stars-selected-color)}.feedback-modal-text textarea{background-color:var(--feedback-modal-input-bg-color);border:1px solid var(--feedback-modal-input-border-color);border-radius:var(--feedback-modal-input-border-radius);box-sizing:border-box;color:var(--feedback-modal-input-text-color);font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:100px;min-height:100px;padding:10px;resize:vertical;width:100%}.feedback-modal-email input{background-color:var(--feedback-modal-input-bg-color);border:1px solid var(--feedback-modal-input-border-color);border-radius:var(--feedback-modal-input-border-radius);box-sizing:border-box;color:var(--feedback-modal-input-text-color);font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:40px;padding:10px;width:100%;margin-bottom:20px}.feedback-modal-privacy{font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px}.feedback-modal-text textarea:focus,.feedback-modal-email input:focus{border:1px solid var(--feedback-modal-input-border-color-focused);outline:none}.feedback-modal-buttons{display:flex;flex-direction:column}.feedback-modal-buttons .feedback-modal-button{margin-bottom:20px}.feedback-modal-button{align-items:center;background-color:transparent;border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);cursor:pointer;display:flex;font-size:var(--feedback-modal-button-font-size);font-family:var(--feedback-modal-content-font-family);font-weight:500;justify-content:center;min-height:40px;padding:5px 10px}.feedback-modal-button svg{margin-right:6px}.feedback-modal-button path{fill:var(--feedback-modal-button-icon-color)}.feedback-modal-button:hover path,.feedback-modal-button--active path{fill:var(--feedback-modal-button-icon-color-active)}.feedback-modal-button--submit{background-color:var(--feedback-modal-button-submit-bg-color);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-submit-text-color)}.feedback-modal-button:hover,.feedback-modal-button--active{background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-text-color-active)}.feedback-modal-button--submit:hover{background-color:var(--feedback-modal-button-submit-bg-color-hover);border:1px solid var(--feedback-modal-button-submit-border-color-hover);color:var(--feedback-modal-button-submit-text-color-hover)}.feedback-modal-input-heading{display:block;font-size:14px;font-weight:300;padding-bottom:10px;font-family:var(--feedback-modal-content-font-family)}.feedback-modal-footer{font-size:12px;text-align:center}.feedback-modal-footer a{color:var(--feedback-modal-footer-link);font-weight:500;text-decoration:none}.feedback-logo{align-items:center;display:flex;justify-content:center;margin-top:5px}.feedback-logo a{margin-left:3px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;height:22px;margin-left:auto;padding:0;width:22px}.feedback-modal-close svg{stroke:var(--feedback-modal-close-color)}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);height:100%;left:0;position:fixed;top:0;width:100%;z-index:var(--feedback-modal-screnshot-z-index)}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-screenshot-header-text-color);cursor:pointer;display:flex;font-family:var(--feedback-modal-content-font-family);left:50%;top:20px;transform:translateX(-50%);padding:10px;position:fixed;width:max-content;z-index:var(--feedback-modal-screenshot-header-z-index)}.feedback-modal-screenshot-close{height:24px;padding-left:10px;width:24px}.feedback-modal-screenshot-close svg{stroke:var(--feedback-modal-close-color)}.feedback-modal-message{font-size:var(--feedback-modal-message-font-size);margin-top:0}.feedback-modal-element-hover{background-color:transparent;cursor:pointer;border:1px solid var(--feedback-modal-element-hover-border-color)}.feedback-modal-element-selected{background-color:transparent;border:1px solid var(--feedback-modal-element-selected-border-color)}@media screen and (min-width: 768px){.feedback-modal-content{max-width:600px}.feedback-modal-content.feedback-modal-content--bottom-right{bottom:var(--feedback-modal-content-position-bottom);left:initial;right:var(--feedback-modal-content-position-right);top:initial;transform:initial}.feedback-modal-content.feedback-modal-content--bottom-left{bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left);top:initial;transform:initial}.feedback-modal-content.feedback-modal-content--top-right{right:var(--feedback-modal-content-position-right);top:var(--feedback-modal-content-position-top);transform:initial}.feedback-modal-content.feedback-modal-content--top-left{left:var(--feedback-modal-content-position-left);top:var(--feedback-modal-content-position-top);transform:initial}.feedback-modal-content.feedback-modal-content--center-left{left:5px;right:auto;top:50%;transform:translateY(-50%)}.feedback-modal-content.feedback-modal-content--center-right{left:auto;right:5px;top:50%;transform:translateY(-50%)}.feedback-modal-content.feedback-modal-content--sidebar-left.feedback-modal-content--open,.feedback-modal-content.feedback-modal-content--sidebar-right.feedback-modal-content--open{transform:translateX(0)}.feedback-modal-content.feedback-modal-content--sidebar-left{max-width:300px;left:0;right:auto;height:100vh;top:0;transform:translateX(-100%);transition:transform 0.5s ease-in-out;border-radius:0}.feedback-modal-content.feedback-modal-content--sidebar-right{max-width:300px;left:auto;right:0;height:100vh;top:0;transform:translateX(100%);transition:transform 0.5s ease-in-out;border-radius:0}.feedback-modal-text textarea{height:150px;min-height:150px}}";
|
|
7847
|
+
const feedbackModalCss = ".text-center{flex-grow:1;text-align:center}.feedback-modal-wrapper{position:absolute;z-index:var(--feedback-modal-modal-wrapper-z-index)}.feedback-overlay{background-color:var(--feedback-modal-screenshot-bg-color);height:100%;left:0;position:fixed;top:0;width:100%;z-index:var(--feedback-modal-screnshot-z-index)}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);left:50%;max-width:90%;padding:20px;position:fixed;top:50%;transform:translate(-50%, -50%);width:100%;z-index:var(--feedback-modal-content-z-index)}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);display:flex;font-family:var(--feedback-modal-header-font-family);font-size:var(--feedback-header-font-size);font-weight:var(--feedback-modal-header-font-weight);justify-content:space-between;margin-bottom:20px}.feedback-modal-rating-buttons{width:100%;margin-bottom:20px}.feedback-modal-rating-button{padding:0;background-color:transparent;border:transparent;margin-right:5px;cursor:pointer}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button{border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);font-size:var(--feedback-modal-button-font-size);font-family:var(--feedback-modal-content-font-family);font-weight:500;margin-right:10px;justify-content:center;padding:5px 10px}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button:hover,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--selected{background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-text-color-active)}.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button:hover svg,.feedback-modal-rating-buttons--thumbs .feedback-modal-rating-button--selected svg{stroke:var(--feedback-modal-rating-button-selected-color)}.feedback-modal-rating-buttons svg{stroke:var(--feedback-modal-rating-button-color);cursor:pointer}.feedback-modal-rating-buttons--stars .feedback-modal-rating-button--selected svg{fill:var(--feedback-modal-rating-button-stars-selected-color);stroke:var(--feedback-modal-rating-button-stars-selected-color)}.feedback-modal-text textarea{background-color:var(--feedback-modal-input-bg-color);border:1px solid var(--feedback-modal-input-border-color);border-radius:var(--feedback-modal-input-border-radius);box-sizing:border-box;color:var(--feedback-modal-input-text-color);font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:100px;min-height:100px;padding:10px;resize:vertical;width:100%}.feedback-modal-email input{background-color:var(--feedback-modal-input-bg-color);border:1px solid var(--feedback-modal-input-border-color);border-radius:var(--feedback-modal-input-border-radius);box-sizing:border-box;color:var(--feedback-modal-input-text-color);font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px;height:40px;padding:10px;width:100%;margin-bottom:20px}.feedback-modal-privacy{font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);margin-bottom:20px}.feedback-modal-text textarea:focus,.feedback-modal-email input:focus{border:1px solid var(--feedback-modal-input-border-color-focused);outline:none}.feedback-modal-buttons{display:flex;flex-direction:column}.feedback-modal-buttons .feedback-modal-button{margin-bottom:20px}.feedback-modal-button{align-items:center;background-color:transparent;border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);cursor:pointer;display:flex;font-size:var(--feedback-modal-button-font-size);font-family:var(--feedback-modal-content-font-family);font-weight:500;justify-content:center;min-height:40px;padding:5px 10px}.feedback-modal-button svg{margin-right:6px}.feedback-modal-button path{fill:var(--feedback-modal-button-icon-color)}.feedback-modal-button:hover path,.feedback-modal-button--active path{fill:var(--feedback-modal-button-icon-color-active)}.feedback-modal-button--submit{background-color:var(--feedback-modal-button-submit-bg-color);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-submit-text-color)}.feedback-modal-button:hover,.feedback-modal-button--active{background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active);color:var(--feedback-modal-button-text-color-active)}.feedback-modal-button--submit:hover{background-color:var(--feedback-modal-button-submit-bg-color-hover);border:1px solid var(--feedback-modal-button-submit-border-color-hover);color:var(--feedback-modal-button-submit-text-color-hover)}.feedback-modal-input-heading{display:block;font-size:14px;font-weight:300;padding-bottom:10px;font-family:var(--feedback-modal-content-font-family)}.feedback-modal-footer{font-size:12px;text-align:center}.feedback-modal-footer a{color:var(--feedback-modal-footer-link);font-weight:500;text-decoration:none}.feedback-logo{align-items:center;display:flex;justify-content:center;margin-top:5px}.feedback-logo a{margin-left:3px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;height:22px;margin-left:auto;padding:0;width:22px}.feedback-modal-close svg{stroke:var(--feedback-modal-close-color)}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);height:100%;left:0;position:fixed;top:0;width:100%;z-index:var(--feedback-modal-screnshot-z-index)}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-screenshot-header-text-color);cursor:pointer;display:flex;font-family:var(--feedback-modal-content-font-family);left:50%;top:20px;transform:translateX(-50%);padding:10px;position:fixed;width:max-content;z-index:var(--feedback-modal-screenshot-header-z-index)}.feedback-modal-screenshot-close{height:24px;padding-left:10px;width:24px}.feedback-modal-screenshot-close svg{stroke:var(--feedback-modal-close-color)}.feedback-modal-message{font-size:var(--feedback-modal-message-font-size);margin-top:0}.feedback-modal-element-hover{background-color:transparent;cursor:pointer;border:1px solid var(--feedback-modal-element-hover-border-color)}.feedback-modal-element-selected{background-color:transparent;border:1px solid var(--feedback-modal-element-selected-border-color)}@media screen and (min-width: 768px){.feedback-modal-content{max-width:600px}.feedback-modal-content.feedback-modal-content--bottom-right{bottom:var(--feedback-modal-content-position-bottom);left:initial;right:var(--feedback-modal-content-position-right);top:initial;transform:initial}.feedback-modal-content.feedback-modal-content--bottom-left{bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left);top:initial;transform:initial}.feedback-modal-content.feedback-modal-content--top-right{right:var(--feedback-modal-content-position-right);top:var(--feedback-modal-content-position-top);transform:initial}.feedback-modal-content.feedback-modal-content--top-left{left:var(--feedback-modal-content-position-left);top:var(--feedback-modal-content-position-top);transform:initial}.feedback-modal-content.feedback-modal-content--center-left{left:5px;right:auto;top:50%;transform:translateY(-50%)}.feedback-modal-content.feedback-modal-content--center-right{left:auto;right:5px;top:50%;transform:translateY(-50%)}.feedback-modal-content.feedback-modal-content--sidebar-left.feedback-modal-content--open,.feedback-modal-content.feedback-modal-content--sidebar-right.feedback-modal-content--open{transform:translateX(0)}.feedback-modal-content.feedback-modal-content--sidebar-left{max-width:300px;left:0;right:auto;height:100vh;top:0;transform:translateX(-100%);transition:transform 0.5s ease-in-out;border-radius:0}.feedback-modal-content.feedback-modal-content--sidebar-right{max-width:300px;left:auto;right:0;height:100vh;top:0;transform:translateX(100%);transition:transform 0.5s ease-in-out;border-radius:0}.feedback-modal-text textarea{height:150px;min-height:150px}}";
|
|
7848
7848
|
|
|
7849
|
-
const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7850
|
-
constructor() {
|
|
7851
|
-
super();
|
|
7852
|
-
this.__registerHost();
|
|
7853
|
-
this.__attachShadow();
|
|
7854
|
-
this.onScrollDebounced = () => {
|
|
7855
|
-
clearTimeout(this.scrollTimeout);
|
|
7856
|
-
this.scrollTimeout = setTimeout(() => {
|
|
7857
|
-
document.documentElement.classList.remove('feedback-modal-screenshot-closing');
|
|
7858
|
-
document.documentElement.style.top = "";
|
|
7859
|
-
window.removeEventListener('scroll', this.onScrollDebounced);
|
|
7860
|
-
}, 200);
|
|
7861
|
-
};
|
|
7862
|
-
this.handleSubmit = async (event) => {
|
|
7863
|
-
event.preventDefault();
|
|
7864
|
-
this.resetOverflow();
|
|
7865
|
-
this.showScreenshotMode = false;
|
|
7866
|
-
this.showScreenshotTopBar = false;
|
|
7867
|
-
this.showModal = false;
|
|
7868
|
-
this.sending = true;
|
|
7869
|
-
try {
|
|
7870
|
-
const res = await fetch('https://app.pushfeedback.com/api/feedback/', {
|
|
7871
|
-
method: 'POST',
|
|
7872
|
-
body: JSON.stringify({
|
|
7873
|
-
url: window.location.href,
|
|
7874
|
-
message: this.formMessage,
|
|
7875
|
-
email: this.formEmail,
|
|
7876
|
-
project: this.project,
|
|
7877
|
-
screenshot: this.encodedScreenshot,
|
|
7878
|
-
rating: this.selectedRating,
|
|
7879
|
-
ratingMode: this.ratingMode,
|
|
7880
|
-
verification: this.formVerification,
|
|
7881
|
-
session: localStorage.getItem('pushfeedback_sessionid') || '',
|
|
7882
|
-
}),
|
|
7883
|
-
headers: {
|
|
7884
|
-
'Content-Type': 'application/json'
|
|
7885
|
-
}
|
|
7886
|
-
});
|
|
7887
|
-
if (res.status === 201) {
|
|
7888
|
-
this.formSuccess = true;
|
|
7889
|
-
this.formError = false;
|
|
7890
|
-
}
|
|
7891
|
-
else {
|
|
7892
|
-
this.formSuccess = false;
|
|
7893
|
-
this.formError = true;
|
|
7894
|
-
this.formErrorStatus = res.status;
|
|
7895
|
-
}
|
|
7896
|
-
}
|
|
7897
|
-
catch (error) {
|
|
7898
|
-
console.log(error);
|
|
7899
|
-
this.formSuccess = false;
|
|
7900
|
-
this.formError = true;
|
|
7901
|
-
this.formErrorStatus = 500;
|
|
7902
|
-
}
|
|
7903
|
-
finally {
|
|
7904
|
-
this.sending = false;
|
|
7905
|
-
this.showModal = true;
|
|
7906
|
-
}
|
|
7907
|
-
};
|
|
7908
|
-
this.close = () => {
|
|
7909
|
-
this.sending = false;
|
|
7910
|
-
this.showModal = false;
|
|
7911
|
-
this.showScreenshotMode = false;
|
|
7912
|
-
this.showScreenshotTopBar = false;
|
|
7913
|
-
this.hasSelectedElement = false;
|
|
7914
|
-
this.encodedScreenshot = null;
|
|
7915
|
-
this.formSuccess = false;
|
|
7916
|
-
this.formError = false;
|
|
7917
|
-
this.formErrorStatus = 500;
|
|
7918
|
-
this.formMessage = '';
|
|
7919
|
-
this.formEmail = '';
|
|
7920
|
-
this.resetOverflow();
|
|
7921
|
-
};
|
|
7922
|
-
this.openScreenShot = () => {
|
|
7923
|
-
this.hasSelectedElement = false;
|
|
7924
|
-
this.showModal = false;
|
|
7925
|
-
this.showScreenshotMode = true;
|
|
7926
|
-
this.showScreenshotTopBar = true;
|
|
7927
|
-
this.encodedScreenshot = null;
|
|
7928
|
-
if (window.innerWidth > document.documentElement.clientWidth) {
|
|
7929
|
-
document.documentElement.classList.add('feedback-modal-screenshot-open--scroll');
|
|
7930
|
-
}
|
|
7931
|
-
const scrollY = window.scrollY;
|
|
7932
|
-
document.documentElement.style.top = `-${scrollY}px`;
|
|
7933
|
-
window.scrollTo(0, parseInt(document.documentElement.style.top || '0') * -1);
|
|
7934
|
-
document.documentElement.classList.add('feedback-modal-screenshot-open');
|
|
7935
|
-
};
|
|
7936
|
-
this.closeScreenShot = () => {
|
|
7937
|
-
this.showModal = false;
|
|
7938
|
-
this.showScreenshotMode = false;
|
|
7939
|
-
this.showScreenshotTopBar = false;
|
|
7940
|
-
this.hasSelectedElement = false;
|
|
7941
|
-
this.encodedScreenshot = null;
|
|
7942
|
-
this.resetOverflow();
|
|
7943
|
-
};
|
|
7944
|
-
this.handleMouseOverScreenShot = (event) => {
|
|
7945
|
-
event.preventDefault();
|
|
7946
|
-
if (this.hasSelectedElement)
|
|
7947
|
-
return;
|
|
7948
|
-
const borderOffset = 2;
|
|
7949
|
-
this.screenshotModal.style.display = 'none';
|
|
7950
|
-
const elementUnder = document.elementFromPoint(event.clientX, event.clientY);
|
|
7951
|
-
const rect = elementUnder.getBoundingClientRect();
|
|
7952
|
-
this.screenshotModal.style.display = '';
|
|
7953
|
-
// Get the bounding box of the element selected
|
|
7954
|
-
this.elementSelected.style.position = "absolute";
|
|
7955
|
-
this.elementSelected.style.left = `${rect.left}px`;
|
|
7956
|
-
this.elementSelected.style.top = `${rect.top}px`;
|
|
7957
|
-
this.elementSelected.style.width = `${rect.width}px`;
|
|
7958
|
-
this.elementSelected.style.height = `${rect.height}px`;
|
|
7959
|
-
this.elementSelected.classList.add('feedback-modal-element-hover');
|
|
7960
|
-
// Set the background color of nonselected areas
|
|
7961
|
-
// Top
|
|
7962
|
-
this.topSide.style.position = "absolute";
|
|
7963
|
-
this.topSide.style.left = `${rect.left}px`;
|
|
7964
|
-
this.topSide.style.top = '0px';
|
|
7965
|
-
this.topSide.style.width = `${rect.width + borderOffset}px`;
|
|
7966
|
-
this.topSide.style.height = `${rect.top}px`;
|
|
7967
|
-
this.topSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
|
|
7968
|
-
// Left
|
|
7969
|
-
this.leftSide.style.position = "absolute";
|
|
7970
|
-
this.leftSide.style.left = '0px';
|
|
7971
|
-
this.leftSide.style.top = '0px';
|
|
7972
|
-
this.leftSide.style.width = `${rect.left}px`;
|
|
7973
|
-
this.leftSide.style.height = '100vh';
|
|
7974
|
-
this.leftSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
|
|
7975
|
-
// Bottom
|
|
7976
|
-
this.bottomSide.style.position = "absolute";
|
|
7977
|
-
this.bottomSide.style.left = `${rect.left}px`;
|
|
7978
|
-
this.bottomSide.style.top = `${rect.bottom + borderOffset}px`;
|
|
7979
|
-
this.bottomSide.style.width = `${rect.width + borderOffset}px`;
|
|
7980
|
-
this.bottomSide.style.height = '100vh';
|
|
7981
|
-
this.bottomSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
|
|
7982
|
-
// Right
|
|
7983
|
-
this.rightSide.style.position = "absolute";
|
|
7984
|
-
this.rightSide.style.left = `${rect.right + borderOffset}px`;
|
|
7985
|
-
this.rightSide.style.top = '0px';
|
|
7986
|
-
this.rightSide.style.width = '100%';
|
|
7987
|
-
this.rightSide.style.height = '100vh';
|
|
7988
|
-
this.rightSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
|
|
7989
|
-
// Restore the visibility of the screenshot-modal
|
|
7990
|
-
this.screenshotModal.style.backgroundColor = 'transparent';
|
|
7991
|
-
};
|
|
7992
|
-
this.handleMouseClickedSelectedElement = async (event) => {
|
|
7993
|
-
event.preventDefault();
|
|
7994
|
-
if (!this.elementSelected) {
|
|
7995
|
-
return;
|
|
7996
|
-
}
|
|
7997
|
-
this.hasSelectedElement = true;
|
|
7998
|
-
this.elementSelected.classList.add('feedback-modal-element-selected');
|
|
7999
|
-
// Get the top position including the scroll offset
|
|
8000
|
-
const rectTop = this.elementSelected.getBoundingClientRect().top;
|
|
8001
|
-
const topWithScroll = rectTop + window.scrollY;
|
|
8002
|
-
// Move the element with the scroll offset
|
|
8003
|
-
this.elementSelected.style.top = `${topWithScroll}px`;
|
|
8004
|
-
// Clone the selected element and append it to the body
|
|
8005
|
-
const clonedElementSelected = this.elementSelected.cloneNode(true);
|
|
8006
|
-
document.body.appendChild(clonedElementSelected);
|
|
8007
|
-
// Reset the top position of the original element
|
|
8008
|
-
this.elementSelected.style.top = `${rectTop}px`;
|
|
8009
|
-
this.showScreenshotTopBar = false;
|
|
8010
|
-
this.showModal = false;
|
|
8011
|
-
try {
|
|
8012
|
-
const dataUrl = await this.captureScreenshot();
|
|
8013
|
-
console.log('Screenshot captured');
|
|
8014
|
-
this.encodedScreenshot = dataUrl;
|
|
8015
|
-
}
|
|
8016
|
-
catch (error) {
|
|
8017
|
-
console.error('Failed to capture screenshot:', error);
|
|
8018
|
-
this.hasSelectedElement = false;
|
|
8019
|
-
}
|
|
8020
|
-
finally {
|
|
8021
|
-
// Remove the cloned element and show the modal again
|
|
8022
|
-
document.body.removeChild(clonedElementSelected);
|
|
8023
|
-
this.showModal = true;
|
|
8024
|
-
}
|
|
8025
|
-
};
|
|
8026
|
-
this.sending = false;
|
|
8027
|
-
this.formMessage = '';
|
|
8028
|
-
this.formEmail = '';
|
|
8029
|
-
this.formSuccess = false;
|
|
8030
|
-
this.formVerification = '';
|
|
8031
|
-
this.formError = false;
|
|
8032
|
-
this.formErrorStatus = 500;
|
|
8033
|
-
this.encodedScreenshot = undefined;
|
|
8034
|
-
this.isPrivacyChecked = false;
|
|
8035
|
-
this.whitelabel = false;
|
|
8036
|
-
this.selectedRating = 0;
|
|
8037
|
-
this.errorMessage = "Please try again later.";
|
|
8038
|
-
this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
|
|
8039
|
-
this.errorMessage404 = "We could not find the provided project ID in PushFeedback.";
|
|
8040
|
-
this.modalTitle = 'Share your feedback';
|
|
8041
|
-
this.modalTitleSuccess = 'Thanks for your feedback!';
|
|
8042
|
-
this.modalTitleError = "Oops!";
|
|
8043
|
-
this.modalPosition = 'center';
|
|
8044
|
-
this.sendButtonText = 'Send';
|
|
8045
|
-
this.successMessage = "";
|
|
8046
|
-
this.project = '';
|
|
8047
|
-
this.screenshotButtonText = 'Add a screenshot';
|
|
8048
|
-
this.screenshotTopbarText = 'Select an element on this page';
|
|
8049
|
-
this.hideEmail = false;
|
|
8050
|
-
this.emailAddress = '';
|
|
8051
|
-
this.emailPlaceholder = 'Email address (optional)';
|
|
8052
|
-
this.messagePlaceholder = 'Comments';
|
|
8053
|
-
this.hideRating = false;
|
|
8054
|
-
this.rating = undefined;
|
|
8055
|
-
this.ratingMode = 'thumbs';
|
|
8056
|
-
this.ratingPlaceholder = 'Was this page helpful?';
|
|
8057
|
-
this.ratingStarsPlaceholder = 'How would you rate this page?';
|
|
8058
|
-
this.showModal = false;
|
|
8059
|
-
this.showScreenshotMode = false;
|
|
8060
|
-
this.showScreenshotTopBar = false;
|
|
8061
|
-
this.hasSelectedElement = false;
|
|
8062
|
-
this.hideScreenshotButton = false;
|
|
8063
|
-
this.hidePrivacyPolicy = true;
|
|
8064
|
-
this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
|
|
8065
|
-
this.fetchData = true;
|
|
8066
|
-
}
|
|
8067
|
-
componentWillLoad() {
|
|
8068
|
-
if (this.fetchData)
|
|
8069
|
-
this.fetchProjectData();
|
|
8070
|
-
this.formEmail = this.emailAddress;
|
|
8071
|
-
if (this.rating) {
|
|
8072
|
-
this.selectedRating = this.rating;
|
|
8073
|
-
}
|
|
8074
|
-
if (this.ratingMode == "thumbs" && this.rating == 0) {
|
|
8075
|
-
this.selectedRating = 5;
|
|
8076
|
-
}
|
|
8077
|
-
}
|
|
8078
|
-
async fetchProjectData() {
|
|
8079
|
-
try {
|
|
8080
|
-
const response = await fetch('https://app.pushfeedback.com/api/projects/' + this.project + '/');
|
|
8081
|
-
const data = await response.json();
|
|
8082
|
-
this.whitelabel = data.whitelabel;
|
|
8083
|
-
}
|
|
8084
|
-
catch (error) {
|
|
8085
|
-
console.log(error);
|
|
8086
|
-
}
|
|
8087
|
-
}
|
|
8088
|
-
resetOverflow() {
|
|
8089
|
-
document.documentElement.classList.remove('feedback-modal-screenshot-open');
|
|
8090
|
-
document.documentElement.classList.remove('feedback-modal-screenshot-open--scroll');
|
|
8091
|
-
document.documentElement.classList.add('feedback-modal-screenshot-closing');
|
|
8092
|
-
window.scrollTo(0, parseInt(document.documentElement.style.top || '0') * -1);
|
|
8093
|
-
window.addEventListener('scroll', this.onScrollDebounced);
|
|
8094
|
-
}
|
|
8095
|
-
handleMessageInput(event) {
|
|
8096
|
-
this.formMessage = event.target.value;
|
|
8097
|
-
}
|
|
8098
|
-
handleEmailInput(event) {
|
|
8099
|
-
this.formEmail = event.target.value;
|
|
8100
|
-
}
|
|
8101
|
-
captureScreenshot() {
|
|
8102
|
-
return new Promise((resolve, reject) => {
|
|
8103
|
-
requestAnimationFrame(() => {
|
|
8104
|
-
html2canvas(document.body, {
|
|
8105
|
-
x: window.scrollX,
|
|
8106
|
-
y: window.scrollY,
|
|
8107
|
-
width: window.innerWidth,
|
|
8108
|
-
height: window.innerHeight,
|
|
8109
|
-
}).then(canvas => {
|
|
8110
|
-
const dataUrl = canvas.toDataURL();
|
|
8111
|
-
resolve(dataUrl);
|
|
8112
|
-
})
|
|
8113
|
-
.catch(error => {
|
|
8114
|
-
console.error(error);
|
|
8115
|
-
reject(error);
|
|
8116
|
-
});
|
|
8117
|
-
});
|
|
8118
|
-
});
|
|
8119
|
-
}
|
|
8120
|
-
handleCheckboxChange(event) {
|
|
8121
|
-
this.isPrivacyChecked = event.target.checked;
|
|
8122
|
-
}
|
|
8123
|
-
handleVerification(event) {
|
|
8124
|
-
this.formVerification = event.target.value;
|
|
8125
|
-
}
|
|
8126
|
-
handleRatingChange(newRating) {
|
|
8127
|
-
this.selectedRating = newRating;
|
|
8128
|
-
}
|
|
8129
|
-
render() {
|
|
8130
|
-
return (h("div", { class: 'feedback-modal-wrapper' }, 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.showModal && (h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.showModal ? '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) => {
|
|
8131
|
-
event.preventDefault();
|
|
8132
|
-
this.handleRatingChange(1);
|
|
8133
|
-
} }, 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) => {
|
|
8134
|
-
event.preventDefault();
|
|
8135
|
-
this.handleRatingChange(5);
|
|
8136
|
-
} }, 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) => {
|
|
8137
|
-
event.preventDefault();
|
|
8138
|
-
this.handleRatingChange(rating);
|
|
8139
|
-
} }, 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("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", style: { display: this.whitelabel ? 'none' : 'block' } }, h("div", { class: "feedback-logo" }, "Powered by ", h("a", { target: "_blank", href: "https://pushfeedback.com" }, "PushFeedback.com")))))));
|
|
8140
|
-
}
|
|
8141
|
-
static get style() { return feedbackModalCss; }
|
|
8142
|
-
}, [1, "feedback-modal", {
|
|
8143
|
-
"errorMessage": [1, "error-message"],
|
|
8144
|
-
"errorMessage403": [1, "error-message-4-0-3"],
|
|
8145
|
-
"errorMessage404": [1, "error-message-4-0-4"],
|
|
8146
|
-
"modalTitle": [1, "modal-title"],
|
|
8147
|
-
"modalTitleSuccess": [1, "modal-title-success"],
|
|
8148
|
-
"modalTitleError": [1, "modal-title-error"],
|
|
8149
|
-
"modalPosition": [1, "modal-position"],
|
|
8150
|
-
"sendButtonText": [1, "send-button-text"],
|
|
8151
|
-
"successMessage": [1, "success-message"],
|
|
8152
|
-
"project": [1],
|
|
8153
|
-
"screenshotButtonText": [1, "screenshot-button-text"],
|
|
8154
|
-
"screenshotTopbarText": [1, "screenshot-topbar-text"],
|
|
8155
|
-
"hideEmail": [4, "hide-email"],
|
|
8156
|
-
"emailAddress": [1, "email-address"],
|
|
8157
|
-
"emailPlaceholder": [1, "email-placeholder"],
|
|
8158
|
-
"messagePlaceholder": [1, "message-placeholder"],
|
|
8159
|
-
"hideRating": [4, "hide-rating"],
|
|
8160
|
-
"rating": [2],
|
|
8161
|
-
"ratingMode": [1, "rating-mode"],
|
|
8162
|
-
"ratingPlaceholder": [1, "rating-placeholder"],
|
|
8163
|
-
"ratingStarsPlaceholder": [1, "rating-stars-placeholder"],
|
|
8164
|
-
"showModal": [1540, "show-modal"],
|
|
8165
|
-
"showScreenshotMode": [1540, "show-screenshot-mode"],
|
|
8166
|
-
"showScreenshotTopBar": [1540, "show-screenshot-top-bar"],
|
|
8167
|
-
"hasSelectedElement": [1540, "has-selected-element"],
|
|
8168
|
-
"hideScreenshotButton": [4, "hide-screenshot-button"],
|
|
8169
|
-
"hidePrivacyPolicy": [4, "hide-privacy-policy"],
|
|
8170
|
-
"privacyPolicyText": [1, "privacy-policy-text"],
|
|
8171
|
-
"fetchData": [4, "fetch-data"],
|
|
8172
|
-
"sending": [32],
|
|
8173
|
-
"formMessage": [32],
|
|
8174
|
-
"formEmail": [32],
|
|
8175
|
-
"formSuccess": [32],
|
|
8176
|
-
"formVerification": [32],
|
|
8177
|
-
"formError": [32],
|
|
8178
|
-
"formErrorStatus": [32],
|
|
8179
|
-
"encodedScreenshot": [32],
|
|
8180
|
-
"isPrivacyChecked": [32],
|
|
8181
|
-
"whitelabel": [32],
|
|
8182
|
-
"selectedRating": [32]
|
|
8183
|
-
}]);
|
|
8184
|
-
function defineCustomElement() {
|
|
8185
|
-
if (typeof customElements === "undefined") {
|
|
8186
|
-
return;
|
|
8187
|
-
}
|
|
8188
|
-
const components = ["feedback-modal"];
|
|
8189
|
-
components.forEach(tagName => { switch (tagName) {
|
|
8190
|
-
case "feedback-modal":
|
|
8191
|
-
if (!customElements.get(tagName)) {
|
|
8192
|
-
customElements.define(tagName, FeedbackModal);
|
|
8193
|
-
}
|
|
8194
|
-
break;
|
|
8195
|
-
} });
|
|
7849
|
+
const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7850
|
+
constructor() {
|
|
7851
|
+
super();
|
|
7852
|
+
this.__registerHost();
|
|
7853
|
+
this.__attachShadow();
|
|
7854
|
+
this.onScrollDebounced = () => {
|
|
7855
|
+
clearTimeout(this.scrollTimeout);
|
|
7856
|
+
this.scrollTimeout = setTimeout(() => {
|
|
7857
|
+
document.documentElement.classList.remove('feedback-modal-screenshot-closing');
|
|
7858
|
+
document.documentElement.style.top = "";
|
|
7859
|
+
window.removeEventListener('scroll', this.onScrollDebounced);
|
|
7860
|
+
}, 200);
|
|
7861
|
+
};
|
|
7862
|
+
this.handleSubmit = async (event) => {
|
|
7863
|
+
event.preventDefault();
|
|
7864
|
+
this.resetOverflow();
|
|
7865
|
+
this.showScreenshotMode = false;
|
|
7866
|
+
this.showScreenshotTopBar = false;
|
|
7867
|
+
this.showModal = false;
|
|
7868
|
+
this.sending = true;
|
|
7869
|
+
try {
|
|
7870
|
+
const res = await fetch('https://app.pushfeedback.com/api/feedback/', {
|
|
7871
|
+
method: 'POST',
|
|
7872
|
+
body: JSON.stringify({
|
|
7873
|
+
url: window.location.href,
|
|
7874
|
+
message: this.formMessage,
|
|
7875
|
+
email: this.formEmail,
|
|
7876
|
+
project: this.project,
|
|
7877
|
+
screenshot: this.encodedScreenshot,
|
|
7878
|
+
rating: this.selectedRating,
|
|
7879
|
+
ratingMode: this.ratingMode,
|
|
7880
|
+
verification: this.formVerification,
|
|
7881
|
+
session: localStorage.getItem('pushfeedback_sessionid') || '',
|
|
7882
|
+
}),
|
|
7883
|
+
headers: {
|
|
7884
|
+
'Content-Type': 'application/json'
|
|
7885
|
+
}
|
|
7886
|
+
});
|
|
7887
|
+
if (res.status === 201) {
|
|
7888
|
+
this.formSuccess = true;
|
|
7889
|
+
this.formError = false;
|
|
7890
|
+
}
|
|
7891
|
+
else {
|
|
7892
|
+
this.formSuccess = false;
|
|
7893
|
+
this.formError = true;
|
|
7894
|
+
this.formErrorStatus = res.status;
|
|
7895
|
+
}
|
|
7896
|
+
}
|
|
7897
|
+
catch (error) {
|
|
7898
|
+
console.log(error);
|
|
7899
|
+
this.formSuccess = false;
|
|
7900
|
+
this.formError = true;
|
|
7901
|
+
this.formErrorStatus = 500;
|
|
7902
|
+
}
|
|
7903
|
+
finally {
|
|
7904
|
+
this.sending = false;
|
|
7905
|
+
this.showModal = true;
|
|
7906
|
+
}
|
|
7907
|
+
};
|
|
7908
|
+
this.close = () => {
|
|
7909
|
+
this.sending = false;
|
|
7910
|
+
this.showModal = false;
|
|
7911
|
+
this.showScreenshotMode = false;
|
|
7912
|
+
this.showScreenshotTopBar = false;
|
|
7913
|
+
this.hasSelectedElement = false;
|
|
7914
|
+
this.encodedScreenshot = null;
|
|
7915
|
+
this.formSuccess = false;
|
|
7916
|
+
this.formError = false;
|
|
7917
|
+
this.formErrorStatus = 500;
|
|
7918
|
+
this.formMessage = '';
|
|
7919
|
+
this.formEmail = '';
|
|
7920
|
+
this.resetOverflow();
|
|
7921
|
+
};
|
|
7922
|
+
this.openScreenShot = () => {
|
|
7923
|
+
this.hasSelectedElement = false;
|
|
7924
|
+
this.showModal = false;
|
|
7925
|
+
this.showScreenshotMode = true;
|
|
7926
|
+
this.showScreenshotTopBar = true;
|
|
7927
|
+
this.encodedScreenshot = null;
|
|
7928
|
+
if (window.innerWidth > document.documentElement.clientWidth) {
|
|
7929
|
+
document.documentElement.classList.add('feedback-modal-screenshot-open--scroll');
|
|
7930
|
+
}
|
|
7931
|
+
const scrollY = window.scrollY;
|
|
7932
|
+
document.documentElement.style.top = `-${scrollY}px`;
|
|
7933
|
+
window.scrollTo(0, parseInt(document.documentElement.style.top || '0') * -1);
|
|
7934
|
+
document.documentElement.classList.add('feedback-modal-screenshot-open');
|
|
7935
|
+
};
|
|
7936
|
+
this.closeScreenShot = () => {
|
|
7937
|
+
this.showModal = false;
|
|
7938
|
+
this.showScreenshotMode = false;
|
|
7939
|
+
this.showScreenshotTopBar = false;
|
|
7940
|
+
this.hasSelectedElement = false;
|
|
7941
|
+
this.encodedScreenshot = null;
|
|
7942
|
+
this.resetOverflow();
|
|
7943
|
+
};
|
|
7944
|
+
this.handleMouseOverScreenShot = (event) => {
|
|
7945
|
+
event.preventDefault();
|
|
7946
|
+
if (this.hasSelectedElement)
|
|
7947
|
+
return;
|
|
7948
|
+
const borderOffset = 2;
|
|
7949
|
+
this.screenshotModal.style.display = 'none';
|
|
7950
|
+
const elementUnder = document.elementFromPoint(event.clientX, event.clientY);
|
|
7951
|
+
const rect = elementUnder.getBoundingClientRect();
|
|
7952
|
+
this.screenshotModal.style.display = '';
|
|
7953
|
+
// Get the bounding box of the element selected
|
|
7954
|
+
this.elementSelected.style.position = "absolute";
|
|
7955
|
+
this.elementSelected.style.left = `${rect.left}px`;
|
|
7956
|
+
this.elementSelected.style.top = `${rect.top}px`;
|
|
7957
|
+
this.elementSelected.style.width = `${rect.width}px`;
|
|
7958
|
+
this.elementSelected.style.height = `${rect.height}px`;
|
|
7959
|
+
this.elementSelected.classList.add('feedback-modal-element-hover');
|
|
7960
|
+
// Set the background color of nonselected areas
|
|
7961
|
+
// Top
|
|
7962
|
+
this.topSide.style.position = "absolute";
|
|
7963
|
+
this.topSide.style.left = `${rect.left}px`;
|
|
7964
|
+
this.topSide.style.top = '0px';
|
|
7965
|
+
this.topSide.style.width = `${rect.width + borderOffset}px`;
|
|
7966
|
+
this.topSide.style.height = `${rect.top}px`;
|
|
7967
|
+
this.topSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
|
|
7968
|
+
// Left
|
|
7969
|
+
this.leftSide.style.position = "absolute";
|
|
7970
|
+
this.leftSide.style.left = '0px';
|
|
7971
|
+
this.leftSide.style.top = '0px';
|
|
7972
|
+
this.leftSide.style.width = `${rect.left}px`;
|
|
7973
|
+
this.leftSide.style.height = '100vh';
|
|
7974
|
+
this.leftSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
|
|
7975
|
+
// Bottom
|
|
7976
|
+
this.bottomSide.style.position = "absolute";
|
|
7977
|
+
this.bottomSide.style.left = `${rect.left}px`;
|
|
7978
|
+
this.bottomSide.style.top = `${rect.bottom + borderOffset}px`;
|
|
7979
|
+
this.bottomSide.style.width = `${rect.width + borderOffset}px`;
|
|
7980
|
+
this.bottomSide.style.height = '100vh';
|
|
7981
|
+
this.bottomSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
|
|
7982
|
+
// Right
|
|
7983
|
+
this.rightSide.style.position = "absolute";
|
|
7984
|
+
this.rightSide.style.left = `${rect.right + borderOffset}px`;
|
|
7985
|
+
this.rightSide.style.top = '0px';
|
|
7986
|
+
this.rightSide.style.width = '100%';
|
|
7987
|
+
this.rightSide.style.height = '100vh';
|
|
7988
|
+
this.rightSide.style.backgroundColor = "rgba(0, 0, 0, 0.4)";
|
|
7989
|
+
// Restore the visibility of the screenshot-modal
|
|
7990
|
+
this.screenshotModal.style.backgroundColor = 'transparent';
|
|
7991
|
+
};
|
|
7992
|
+
this.handleMouseClickedSelectedElement = async (event) => {
|
|
7993
|
+
event.preventDefault();
|
|
7994
|
+
if (!this.elementSelected) {
|
|
7995
|
+
return;
|
|
7996
|
+
}
|
|
7997
|
+
this.hasSelectedElement = true;
|
|
7998
|
+
this.elementSelected.classList.add('feedback-modal-element-selected');
|
|
7999
|
+
// Get the top position including the scroll offset
|
|
8000
|
+
const rectTop = this.elementSelected.getBoundingClientRect().top;
|
|
8001
|
+
const topWithScroll = rectTop + window.scrollY;
|
|
8002
|
+
// Move the element with the scroll offset
|
|
8003
|
+
this.elementSelected.style.top = `${topWithScroll}px`;
|
|
8004
|
+
// Clone the selected element and append it to the body
|
|
8005
|
+
const clonedElementSelected = this.elementSelected.cloneNode(true);
|
|
8006
|
+
document.body.appendChild(clonedElementSelected);
|
|
8007
|
+
// Reset the top position of the original element
|
|
8008
|
+
this.elementSelected.style.top = `${rectTop}px`;
|
|
8009
|
+
this.showScreenshotTopBar = false;
|
|
8010
|
+
this.showModal = false;
|
|
8011
|
+
try {
|
|
8012
|
+
const dataUrl = await this.captureScreenshot();
|
|
8013
|
+
console.log('Screenshot captured');
|
|
8014
|
+
this.encodedScreenshot = dataUrl;
|
|
8015
|
+
}
|
|
8016
|
+
catch (error) {
|
|
8017
|
+
console.error('Failed to capture screenshot:', error);
|
|
8018
|
+
this.hasSelectedElement = false;
|
|
8019
|
+
}
|
|
8020
|
+
finally {
|
|
8021
|
+
// Remove the cloned element and show the modal again
|
|
8022
|
+
document.body.removeChild(clonedElementSelected);
|
|
8023
|
+
this.showModal = true;
|
|
8024
|
+
}
|
|
8025
|
+
};
|
|
8026
|
+
this.sending = false;
|
|
8027
|
+
this.formMessage = '';
|
|
8028
|
+
this.formEmail = '';
|
|
8029
|
+
this.formSuccess = false;
|
|
8030
|
+
this.formVerification = '';
|
|
8031
|
+
this.formError = false;
|
|
8032
|
+
this.formErrorStatus = 500;
|
|
8033
|
+
this.encodedScreenshot = undefined;
|
|
8034
|
+
this.isPrivacyChecked = false;
|
|
8035
|
+
this.whitelabel = false;
|
|
8036
|
+
this.selectedRating = 0;
|
|
8037
|
+
this.errorMessage = "Please try again later.";
|
|
8038
|
+
this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
|
|
8039
|
+
this.errorMessage404 = "We could not find the provided project ID in PushFeedback.";
|
|
8040
|
+
this.modalTitle = 'Share your feedback';
|
|
8041
|
+
this.modalTitleSuccess = 'Thanks for your feedback!';
|
|
8042
|
+
this.modalTitleError = "Oops!";
|
|
8043
|
+
this.modalPosition = 'center';
|
|
8044
|
+
this.sendButtonText = 'Send';
|
|
8045
|
+
this.successMessage = "";
|
|
8046
|
+
this.project = '';
|
|
8047
|
+
this.screenshotButtonText = 'Add a screenshot';
|
|
8048
|
+
this.screenshotTopbarText = 'Select an element on this page';
|
|
8049
|
+
this.hideEmail = false;
|
|
8050
|
+
this.emailAddress = '';
|
|
8051
|
+
this.emailPlaceholder = 'Email address (optional)';
|
|
8052
|
+
this.messagePlaceholder = 'Comments';
|
|
8053
|
+
this.hideRating = false;
|
|
8054
|
+
this.rating = undefined;
|
|
8055
|
+
this.ratingMode = 'thumbs';
|
|
8056
|
+
this.ratingPlaceholder = 'Was this page helpful?';
|
|
8057
|
+
this.ratingStarsPlaceholder = 'How would you rate this page?';
|
|
8058
|
+
this.showModal = false;
|
|
8059
|
+
this.showScreenshotMode = false;
|
|
8060
|
+
this.showScreenshotTopBar = false;
|
|
8061
|
+
this.hasSelectedElement = false;
|
|
8062
|
+
this.hideScreenshotButton = false;
|
|
8063
|
+
this.hidePrivacyPolicy = true;
|
|
8064
|
+
this.privacyPolicyText = "I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.";
|
|
8065
|
+
this.fetchData = true;
|
|
8066
|
+
}
|
|
8067
|
+
componentWillLoad() {
|
|
8068
|
+
if (this.fetchData)
|
|
8069
|
+
this.fetchProjectData();
|
|
8070
|
+
this.formEmail = this.emailAddress;
|
|
8071
|
+
if (this.rating) {
|
|
8072
|
+
this.selectedRating = this.rating;
|
|
8073
|
+
}
|
|
8074
|
+
if (this.ratingMode == "thumbs" && this.rating == 0) {
|
|
8075
|
+
this.selectedRating = 5;
|
|
8076
|
+
}
|
|
8077
|
+
}
|
|
8078
|
+
async fetchProjectData() {
|
|
8079
|
+
try {
|
|
8080
|
+
const response = await fetch('https://app.pushfeedback.com/api/projects/' + this.project + '/');
|
|
8081
|
+
const data = await response.json();
|
|
8082
|
+
this.whitelabel = data.whitelabel;
|
|
8083
|
+
}
|
|
8084
|
+
catch (error) {
|
|
8085
|
+
console.log(error);
|
|
8086
|
+
}
|
|
8087
|
+
}
|
|
8088
|
+
resetOverflow() {
|
|
8089
|
+
document.documentElement.classList.remove('feedback-modal-screenshot-open');
|
|
8090
|
+
document.documentElement.classList.remove('feedback-modal-screenshot-open--scroll');
|
|
8091
|
+
document.documentElement.classList.add('feedback-modal-screenshot-closing');
|
|
8092
|
+
window.scrollTo(0, parseInt(document.documentElement.style.top || '0') * -1);
|
|
8093
|
+
window.addEventListener('scroll', this.onScrollDebounced);
|
|
8094
|
+
}
|
|
8095
|
+
handleMessageInput(event) {
|
|
8096
|
+
this.formMessage = event.target.value;
|
|
8097
|
+
}
|
|
8098
|
+
handleEmailInput(event) {
|
|
8099
|
+
this.formEmail = event.target.value;
|
|
8100
|
+
}
|
|
8101
|
+
captureScreenshot() {
|
|
8102
|
+
return new Promise((resolve, reject) => {
|
|
8103
|
+
requestAnimationFrame(() => {
|
|
8104
|
+
html2canvas(document.body, {
|
|
8105
|
+
x: window.scrollX,
|
|
8106
|
+
y: window.scrollY,
|
|
8107
|
+
width: window.innerWidth,
|
|
8108
|
+
height: window.innerHeight,
|
|
8109
|
+
}).then(canvas => {
|
|
8110
|
+
const dataUrl = canvas.toDataURL();
|
|
8111
|
+
resolve(dataUrl);
|
|
8112
|
+
})
|
|
8113
|
+
.catch(error => {
|
|
8114
|
+
console.error(error);
|
|
8115
|
+
reject(error);
|
|
8116
|
+
});
|
|
8117
|
+
});
|
|
8118
|
+
});
|
|
8119
|
+
}
|
|
8120
|
+
handleCheckboxChange(event) {
|
|
8121
|
+
this.isPrivacyChecked = event.target.checked;
|
|
8122
|
+
}
|
|
8123
|
+
handleVerification(event) {
|
|
8124
|
+
this.formVerification = event.target.value;
|
|
8125
|
+
}
|
|
8126
|
+
handleRatingChange(newRating) {
|
|
8127
|
+
this.selectedRating = newRating;
|
|
8128
|
+
}
|
|
8129
|
+
render() {
|
|
8130
|
+
return (h("div", { class: 'feedback-modal-wrapper' }, 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.showModal && (h("div", { class: `feedback-modal-content feedback-modal-content--${this.modalPosition} ${this.showModal ? '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) => {
|
|
8131
|
+
event.preventDefault();
|
|
8132
|
+
this.handleRatingChange(1);
|
|
8133
|
+
} }, 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) => {
|
|
8134
|
+
event.preventDefault();
|
|
8135
|
+
this.handleRatingChange(5);
|
|
8136
|
+
} }, 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) => {
|
|
8137
|
+
event.preventDefault();
|
|
8138
|
+
this.handleRatingChange(rating);
|
|
8139
|
+
} }, 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("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", style: { display: this.whitelabel ? 'none' : 'block' } }, h("div", { class: "feedback-logo" }, "Powered by ", h("a", { target: "_blank", href: "https://pushfeedback.com" }, "PushFeedback.com")))))));
|
|
8140
|
+
}
|
|
8141
|
+
static get style() { return feedbackModalCss; }
|
|
8142
|
+
}, [1, "feedback-modal", {
|
|
8143
|
+
"errorMessage": [1, "error-message"],
|
|
8144
|
+
"errorMessage403": [1, "error-message-4-0-3"],
|
|
8145
|
+
"errorMessage404": [1, "error-message-4-0-4"],
|
|
8146
|
+
"modalTitle": [1, "modal-title"],
|
|
8147
|
+
"modalTitleSuccess": [1, "modal-title-success"],
|
|
8148
|
+
"modalTitleError": [1, "modal-title-error"],
|
|
8149
|
+
"modalPosition": [1, "modal-position"],
|
|
8150
|
+
"sendButtonText": [1, "send-button-text"],
|
|
8151
|
+
"successMessage": [1, "success-message"],
|
|
8152
|
+
"project": [1],
|
|
8153
|
+
"screenshotButtonText": [1, "screenshot-button-text"],
|
|
8154
|
+
"screenshotTopbarText": [1, "screenshot-topbar-text"],
|
|
8155
|
+
"hideEmail": [4, "hide-email"],
|
|
8156
|
+
"emailAddress": [1, "email-address"],
|
|
8157
|
+
"emailPlaceholder": [1, "email-placeholder"],
|
|
8158
|
+
"messagePlaceholder": [1, "message-placeholder"],
|
|
8159
|
+
"hideRating": [4, "hide-rating"],
|
|
8160
|
+
"rating": [2],
|
|
8161
|
+
"ratingMode": [1, "rating-mode"],
|
|
8162
|
+
"ratingPlaceholder": [1, "rating-placeholder"],
|
|
8163
|
+
"ratingStarsPlaceholder": [1, "rating-stars-placeholder"],
|
|
8164
|
+
"showModal": [1540, "show-modal"],
|
|
8165
|
+
"showScreenshotMode": [1540, "show-screenshot-mode"],
|
|
8166
|
+
"showScreenshotTopBar": [1540, "show-screenshot-top-bar"],
|
|
8167
|
+
"hasSelectedElement": [1540, "has-selected-element"],
|
|
8168
|
+
"hideScreenshotButton": [4, "hide-screenshot-button"],
|
|
8169
|
+
"hidePrivacyPolicy": [4, "hide-privacy-policy"],
|
|
8170
|
+
"privacyPolicyText": [1, "privacy-policy-text"],
|
|
8171
|
+
"fetchData": [4, "fetch-data"],
|
|
8172
|
+
"sending": [32],
|
|
8173
|
+
"formMessage": [32],
|
|
8174
|
+
"formEmail": [32],
|
|
8175
|
+
"formSuccess": [32],
|
|
8176
|
+
"formVerification": [32],
|
|
8177
|
+
"formError": [32],
|
|
8178
|
+
"formErrorStatus": [32],
|
|
8179
|
+
"encodedScreenshot": [32],
|
|
8180
|
+
"isPrivacyChecked": [32],
|
|
8181
|
+
"whitelabel": [32],
|
|
8182
|
+
"selectedRating": [32]
|
|
8183
|
+
}]);
|
|
8184
|
+
function defineCustomElement() {
|
|
8185
|
+
if (typeof customElements === "undefined") {
|
|
8186
|
+
return;
|
|
8187
|
+
}
|
|
8188
|
+
const components = ["feedback-modal"];
|
|
8189
|
+
components.forEach(tagName => { switch (tagName) {
|
|
8190
|
+
case "feedback-modal":
|
|
8191
|
+
if (!customElements.get(tagName)) {
|
|
8192
|
+
customElements.define(tagName, FeedbackModal);
|
|
8193
|
+
}
|
|
8194
|
+
break;
|
|
8195
|
+
} });
|
|
8196
8196
|
}
|
|
8197
8197
|
|
|
8198
8198
|
export { FeedbackModal as F, defineCustomElement as d };
|