pushfeedback 0.0.3 → 0.0.5
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 +13 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pushfeedback.cjs.js +1 -1
- package/dist/collection/components/feedback-button/feedback-button.css +48 -10
- package/dist/collection/components/feedback-button/feedback-button.js +39 -1
- package/dist/collection/components/feedback-modal/feedback-modal.css +29 -21
- package/dist/collection/components/feedback-modal/feedback-modal.js +8 -4
- package/dist/components/feedback-button.js +7 -3
- package/dist/components/feedback-modal2.js +9 -5
- package/dist/esm/feedback-button_2.entry.js +13 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pushfeedback.js +1 -1
- package/dist/pushfeedback/p-65e5f493.entry.js +1 -0
- package/dist/pushfeedback/pushfeedback.css +1 -1
- package/dist/pushfeedback/pushfeedback.esm.js +1 -1
- package/dist/types/components/feedback-button/feedback-button.d.ts +2 -0
- package/dist/types/components/feedback-modal/feedback-modal.d.ts +1 -0
- package/dist/types/components.d.ts +4 -0
- package/package.json +1 -1
- package/dist/pushfeedback/p-eac9210f.entry.js +0 -1
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-df770657.js');
|
|
6
6
|
|
|
7
|
-
const feedbackButtonCss = ".feedback-button-content{cursor:pointer}.feedback-button-content--light{background-color:var(--feedback-
|
|
7
|
+
const feedbackButtonCss = ".feedback-button-content{cursor:pointer;z-index:300}.feedback-button-content--light{align-items:center;background-color:var(--feedback-white-color);border-radius:20px;box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;box-sizing:border-box;display:flex;font-family:var(--feedback-font-family);color:var(--feedback-primary-color);font-weight:bold;padding:8px 15px;font-size:var(--feedback-text-font-size)}.feedback-button-content--dark{align-items:center;background-color:var(--feedback-primary-color);border-radius:20px;box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;box-sizing:border-box;display:flex;font-family:var(--feedback-font-family);color:var(--feedback-white-color);font-weight:bold;padding:8px 15px;font-size:16px}.feedback-button-content--bottom-right{position:fixed;bottom:10px;right:10px}.feedback-button-content--center-right{position:fixed;bottom:50%;right:-50px;transform:rotate(-90deg)}.feedback-button-content--center-right.feedback-button-content--dark,.feedback-button-content--center-right.feedback-button-content--light{border-radius:4px;border-bottom-right-radius:0px;border-bottom-left-radius:0px}.feedback-button-content-icon{margin-right:5px}";
|
|
8
8
|
|
|
9
9
|
const FeedbackButton = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -21,6 +21,8 @@ const FeedbackButton = class {
|
|
|
21
21
|
this.emailPlaceholder = 'Email address (optional)';
|
|
22
22
|
this.messagePlaceholder = 'How could this page be more helpful?';
|
|
23
23
|
this.buttonStyle = 'default';
|
|
24
|
+
this.buttonPosition = 'default';
|
|
25
|
+
this.hideIcon = false;
|
|
24
26
|
}
|
|
25
27
|
connectedCallback() {
|
|
26
28
|
this.feedbackModal = document.createElement('feedback-modal');
|
|
@@ -49,7 +51,7 @@ const FeedbackButton = class {
|
|
|
49
51
|
this.feedbackModal.showModal = true;
|
|
50
52
|
}
|
|
51
53
|
render() {
|
|
52
|
-
return (index.h(index.Host, null, index.h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle}`, onClick: () => this.showModal() }, index.h("slot", null))));
|
|
54
|
+
return (index.h(index.Host, null, index.h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle} feedback-button-content--${this.buttonPosition}`, onClick: () => this.showModal() }, !this.hideIcon && this.buttonStyle === 'dark' && (index.h("span", { class: "feedback-button-content-icon" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-repeat" }, index.h("polyline", { points: "17 1 21 5 17 9" }), index.h("path", { d: "M3 11V9a4 4 0 0 1 4-4h14" }), index.h("polyline", { points: "7 23 3 19 7 15" }), index.h("path", { d: "M21 13v2a4 4 0 0 1-4 4H3" })))), !this.hideIcon && this.buttonStyle === 'light' && (index.h("span", { class: "feedback-button-content-icon" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#0070F4", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-repeat" }, index.h("polyline", { points: "17 1 21 5 17 9" }), index.h("path", { d: "M3 11V9a4 4 0 0 1 4-4h14" }), index.h("polyline", { points: "7 23 3 19 7 15" }), index.h("path", { d: "M21 13v2a4 4 0 0 1-4 4H3" })))), index.h("slot", null))));
|
|
53
55
|
}
|
|
54
56
|
};
|
|
55
57
|
FeedbackButton.style = feedbackButtonCss;
|
|
@@ -836,13 +838,14 @@ var domToImage = createCommonjsModule(function (module) {
|
|
|
836
838
|
})();
|
|
837
839
|
});
|
|
838
840
|
|
|
839
|
-
const feedbackModalCss = ".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300
|
|
841
|
+
const feedbackModalCss = ".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300;left:50%;top:50%;transform:translate(-50%, -50%)}@media screen and (min-width: 768px){.feedback-modal-content.feedback-modal-content--bottom-right{top:initial;left:initial;transform:initial;bottom:var(--feedback-modal-content-position-bottom);right:var(--feedback-modal-content-position-right)}.feedback-modal-content.feedback-modal-content--bottom-left{top:initial;transform:initial;bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left)}.feedback-modal-content.feedback-modal-content--top-right{top:initial;transform:initial;right:var(--feedback-modal-content-position-right);top:var(--fedback-modal-content-position-top)}.feedback-modal-content.feedback-modal-content--top-left{transform:initial;left:var(--feedback-modal-content-position-left);top:var(--fedback-modal-content-position-top)}}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);font-family:var(--feedback-modal-header-font-family);display:flex;font-size:var(--feedback-header-font-size);justify-content:space-between;margin-bottom:20px}.feedback-modal-text{margin-bottom:20px}.feedback-modal-text textarea{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:100px;padding:10px;resize:none;width:100%}.feedback-modal-email{margin-bottom:20px}.feedback-modal-email input{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:40px;padding:10px;width:100%}.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;justify-content:space-between}.button{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;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.button:hover,.button.active{color:var(--feedback-modal-button-text-color-active);background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active)}.feedback-modal-footer{font-size:12px;margin-top:5px 0;text-align:center}.feedback-modal-footer a{color:#191919;text-decoration:none}.feedback-logo{display:flex;align-items:center;justify-content:center;margin-top:5px}.feedback-logo svg{max-width:12px;margin-right:5px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;margin-left:auto;padding:0;width:24px;height:24px}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);box-shadow:0px 0px 0px 5px var(--feedback-modal-screenshot-element-selected-bg-color) inset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);color:var(--feedback-modal-screenshot-element-selected-text-color);cursor:pointer;display:flex;padding:5px;position:fixed;justify-content:center;width:100%;z-index:200}.feedback-modal-screenshot-header span{padding-left:10px;padding-right:10px}.feedback-modal-screenshot-overlay{background-color:transparent;cursor:unset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-message{font-size:var(--fedback-modal-message-font-size)}.feedback-modal-element-hover{cursor:pointer;background-color:transparent;border:4px dashed var(--feedback-modal-screenshot-element-hover-border-color)}.feedback-modal-element-selected{border:4px solid var(--feedback-modal-screenshot-element-selected-border-color)}";
|
|
840
842
|
|
|
841
843
|
const FeedbackModal = class {
|
|
842
844
|
constructor(hostRef) {
|
|
843
845
|
index.registerInstance(this, hostRef);
|
|
844
846
|
this.handleSubmit = async (event) => {
|
|
845
847
|
event.preventDefault();
|
|
848
|
+
this.resetOverflow();
|
|
846
849
|
this.showScreenshotMode = false;
|
|
847
850
|
this.showModal = false;
|
|
848
851
|
this.sending = true;
|
|
@@ -896,14 +899,14 @@ const FeedbackModal = class {
|
|
|
896
899
|
this.formError = false;
|
|
897
900
|
this.formMessage = '';
|
|
898
901
|
this.formEmail = '';
|
|
902
|
+
this.resetOverflow();
|
|
899
903
|
};
|
|
900
904
|
this.openScreenShot = () => {
|
|
901
905
|
this.hasSelectedElement = false;
|
|
902
906
|
this.showModal = false;
|
|
903
907
|
this.showScreenshotMode = true;
|
|
904
908
|
this.encodedScreenshot = null;
|
|
905
|
-
|
|
906
|
-
page.style.overflow = 'auto';
|
|
909
|
+
this.resetOverflow();
|
|
907
910
|
};
|
|
908
911
|
this.closeScreenShot = () => {
|
|
909
912
|
this.showModal = false;
|
|
@@ -911,8 +914,7 @@ const FeedbackModal = class {
|
|
|
911
914
|
this.hasSelectedElement = false;
|
|
912
915
|
this.encodedScreenshot = null;
|
|
913
916
|
this.overlay.style.display = 'none';
|
|
914
|
-
|
|
915
|
-
page.style.overflow = 'inherit';
|
|
917
|
+
this.resetOverflow();
|
|
916
918
|
};
|
|
917
919
|
this.handleMouseOverScreenShot = (event) => {
|
|
918
920
|
event.preventDefault();
|
|
@@ -1010,6 +1012,10 @@ const FeedbackModal = class {
|
|
|
1010
1012
|
componentWillLoad() {
|
|
1011
1013
|
this.formEmail = this.email;
|
|
1012
1014
|
}
|
|
1015
|
+
resetOverflow() {
|
|
1016
|
+
const page = document.getElementsByTagName('html')[0];
|
|
1017
|
+
page.style.overflow = 'inherit';
|
|
1018
|
+
}
|
|
1013
1019
|
handleMessageInput(event) {
|
|
1014
1020
|
this.formMessage = event.target.value;
|
|
1015
1021
|
}
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"buttonStyle":[1,"button-style"]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
|
|
17
|
+
return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"buttonStyle":[1,"button-style"],"buttonPosition":[1,"button-position"],"hideIcon":[4,"hide-icon"]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"buttonStyle":[1,"button-style"]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
|
|
20
|
+
return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"buttonStyle":[1,"button-style"],"buttonPosition":[1,"button-position"],"hideIcon":[4,"hide-icon"]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -1,18 +1,56 @@
|
|
|
1
1
|
.feedback-button-content {
|
|
2
2
|
cursor: pointer;
|
|
3
|
+
z-index: 300;
|
|
3
4
|
}
|
|
4
5
|
|
|
5
6
|
.feedback-button-content--light{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
border-radius:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: var(--feedback-white-color);
|
|
9
|
+
border-radius: 20px;
|
|
10
|
+
box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
display: flex;
|
|
13
|
+
font-family: var(--feedback-font-family);
|
|
14
|
+
color: var(--feedback-primary-color);
|
|
15
|
+
font-weight: bold;
|
|
16
|
+
padding: 8px 15px;
|
|
17
|
+
font-size: var(--feedback-text-font-size);
|
|
12
18
|
}
|
|
13
19
|
|
|
14
|
-
.feedback-button-content--
|
|
15
|
-
|
|
16
|
-
background-color: var(--feedback-
|
|
17
|
-
border:
|
|
20
|
+
.feedback-button-content--dark{
|
|
21
|
+
align-items: center;
|
|
22
|
+
background-color: var(--feedback-primary-color);
|
|
23
|
+
border-radius: 20px;
|
|
24
|
+
box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
display: flex;
|
|
27
|
+
font-family: var(--feedback-font-family);
|
|
28
|
+
color: var(--feedback-white-color);
|
|
29
|
+
font-weight: bold;
|
|
30
|
+
padding: 8px 15px;
|
|
31
|
+
font-size: 16px;
|
|
18
32
|
}
|
|
33
|
+
|
|
34
|
+
.feedback-button-content--bottom-right{
|
|
35
|
+
position: fixed;
|
|
36
|
+
bottom: 10px;
|
|
37
|
+
right: 10px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.feedback-button-content--center-right{
|
|
41
|
+
position: fixed;
|
|
42
|
+
bottom: 50%;
|
|
43
|
+
right: -50px;
|
|
44
|
+
transform: rotate(-90deg);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.feedback-button-content--center-right.feedback-button-content--dark,
|
|
48
|
+
.feedback-button-content--center-right.feedback-button-content--light {
|
|
49
|
+
border-radius: 4px;
|
|
50
|
+
border-bottom-right-radius: 0px;
|
|
51
|
+
border-bottom-left-radius: 0px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.feedback-button-content-icon{
|
|
55
|
+
margin-right: 5px;
|
|
56
|
+
}
|
|
@@ -13,6 +13,8 @@ export class FeedbackButton {
|
|
|
13
13
|
this.emailPlaceholder = 'Email address (optional)';
|
|
14
14
|
this.messagePlaceholder = 'How could this page be more helpful?';
|
|
15
15
|
this.buttonStyle = 'default';
|
|
16
|
+
this.buttonPosition = 'default';
|
|
17
|
+
this.hideIcon = false;
|
|
16
18
|
}
|
|
17
19
|
connectedCallback() {
|
|
18
20
|
this.feedbackModal = document.createElement('feedback-modal');
|
|
@@ -41,7 +43,7 @@ export class FeedbackButton {
|
|
|
41
43
|
this.feedbackModal.showModal = true;
|
|
42
44
|
}
|
|
43
45
|
render() {
|
|
44
|
-
return (h(Host, null, h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle}`, onClick: () => this.showModal() }, h("slot", null))));
|
|
46
|
+
return (h(Host, null, h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle} feedback-button-content--${this.buttonPosition}`, onClick: () => this.showModal() }, !this.hideIcon && this.buttonStyle === 'dark' && (h("span", { class: "feedback-button-content-icon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-repeat" }, h("polyline", { points: "17 1 21 5 17 9" }), h("path", { d: "M3 11V9a4 4 0 0 1 4-4h14" }), h("polyline", { points: "7 23 3 19 7 15" }), h("path", { d: "M21 13v2a4 4 0 0 1-4 4H3" })))), !this.hideIcon && this.buttonStyle === 'light' && (h("span", { class: "feedback-button-content-icon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#0070F4", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-repeat" }, h("polyline", { points: "17 1 21 5 17 9" }), h("path", { d: "M3 11V9a4 4 0 0 1 4-4h14" }), h("polyline", { points: "7 23 3 19 7 15" }), h("path", { d: "M21 13v2a4 4 0 0 1-4 4H3" })))), h("slot", null))));
|
|
45
47
|
}
|
|
46
48
|
static get is() { return "feedback-button"; }
|
|
47
49
|
static get encapsulation() { return "shadow"; }
|
|
@@ -272,6 +274,42 @@ export class FeedbackButton {
|
|
|
272
274
|
"attribute": "button-style",
|
|
273
275
|
"reflect": false,
|
|
274
276
|
"defaultValue": "'default'"
|
|
277
|
+
},
|
|
278
|
+
"buttonPosition": {
|
|
279
|
+
"type": "string",
|
|
280
|
+
"mutable": false,
|
|
281
|
+
"complexType": {
|
|
282
|
+
"original": "string",
|
|
283
|
+
"resolved": "string",
|
|
284
|
+
"references": {}
|
|
285
|
+
},
|
|
286
|
+
"required": false,
|
|
287
|
+
"optional": false,
|
|
288
|
+
"docs": {
|
|
289
|
+
"tags": [],
|
|
290
|
+
"text": ""
|
|
291
|
+
},
|
|
292
|
+
"attribute": "button-position",
|
|
293
|
+
"reflect": false,
|
|
294
|
+
"defaultValue": "'default'"
|
|
295
|
+
},
|
|
296
|
+
"hideIcon": {
|
|
297
|
+
"type": "boolean",
|
|
298
|
+
"mutable": false,
|
|
299
|
+
"complexType": {
|
|
300
|
+
"original": "boolean",
|
|
301
|
+
"resolved": "boolean",
|
|
302
|
+
"references": {}
|
|
303
|
+
},
|
|
304
|
+
"required": false,
|
|
305
|
+
"optional": false,
|
|
306
|
+
"docs": {
|
|
307
|
+
"tags": [],
|
|
308
|
+
"text": ""
|
|
309
|
+
},
|
|
310
|
+
"attribute": "hide-icon",
|
|
311
|
+
"reflect": false,
|
|
312
|
+
"defaultValue": "false"
|
|
275
313
|
}
|
|
276
314
|
};
|
|
277
315
|
}
|
|
@@ -23,32 +23,40 @@
|
|
|
23
23
|
position: fixed;
|
|
24
24
|
width: 100%;
|
|
25
25
|
z-index: 300;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.feedback-modal-content.feedback-modal-content--center {
|
|
29
26
|
left: 50%;
|
|
30
27
|
top: 50%;
|
|
31
28
|
transform: translate(-50%, -50%);
|
|
32
29
|
}
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.feedback-modal-content.feedback-modal-content--
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
31
|
+
@media screen and (min-width: 768px) {
|
|
32
|
+
|
|
33
|
+
.feedback-modal-content.feedback-modal-content--bottom-right {
|
|
34
|
+
top: initial;
|
|
35
|
+
left: initial;
|
|
36
|
+
transform: initial;
|
|
37
|
+
bottom: var(--feedback-modal-content-position-bottom);
|
|
38
|
+
right: var(--feedback-modal-content-position-right);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.feedback-modal-content.feedback-modal-content--bottom-left {
|
|
42
|
+
top: initial;
|
|
43
|
+
transform: initial;
|
|
44
|
+
bottom: var(--feedback-modal-content-position-bottom);
|
|
45
|
+
left: var(--feedback-modal-content-position-left);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.feedback-modal-content.feedback-modal-content--top-right {
|
|
49
|
+
top: initial;
|
|
50
|
+
transform: initial;
|
|
51
|
+
right: var(--feedback-modal-content-position-right);
|
|
52
|
+
top: var(--fedback-modal-content-position-top);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.feedback-modal-content.feedback-modal-content--top-left {
|
|
56
|
+
transform: initial;
|
|
57
|
+
left: var(--feedback-modal-content-position-left);
|
|
58
|
+
top: var(--fedback-modal-content-position-top);
|
|
59
|
+
}
|
|
52
60
|
}
|
|
53
61
|
|
|
54
62
|
.feedback-modal-header {
|
|
@@ -4,6 +4,7 @@ export class FeedbackModal {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this.handleSubmit = async (event) => {
|
|
6
6
|
event.preventDefault();
|
|
7
|
+
this.resetOverflow();
|
|
7
8
|
this.showScreenshotMode = false;
|
|
8
9
|
this.showModal = false;
|
|
9
10
|
this.sending = true;
|
|
@@ -57,14 +58,14 @@ export class FeedbackModal {
|
|
|
57
58
|
this.formError = false;
|
|
58
59
|
this.formMessage = '';
|
|
59
60
|
this.formEmail = '';
|
|
61
|
+
this.resetOverflow();
|
|
60
62
|
};
|
|
61
63
|
this.openScreenShot = () => {
|
|
62
64
|
this.hasSelectedElement = false;
|
|
63
65
|
this.showModal = false;
|
|
64
66
|
this.showScreenshotMode = true;
|
|
65
67
|
this.encodedScreenshot = null;
|
|
66
|
-
|
|
67
|
-
page.style.overflow = 'auto';
|
|
68
|
+
this.resetOverflow();
|
|
68
69
|
};
|
|
69
70
|
this.closeScreenShot = () => {
|
|
70
71
|
this.showModal = false;
|
|
@@ -72,8 +73,7 @@ export class FeedbackModal {
|
|
|
72
73
|
this.hasSelectedElement = false;
|
|
73
74
|
this.encodedScreenshot = null;
|
|
74
75
|
this.overlay.style.display = 'none';
|
|
75
|
-
|
|
76
|
-
page.style.overflow = 'inherit';
|
|
76
|
+
this.resetOverflow();
|
|
77
77
|
};
|
|
78
78
|
this.handleMouseOverScreenShot = (event) => {
|
|
79
79
|
event.preventDefault();
|
|
@@ -172,6 +172,10 @@ export class FeedbackModal {
|
|
|
172
172
|
componentWillLoad() {
|
|
173
173
|
this.formEmail = this.email;
|
|
174
174
|
}
|
|
175
|
+
resetOverflow() {
|
|
176
|
+
const page = document.getElementsByTagName('html')[0];
|
|
177
|
+
page.style.overflow = 'inherit';
|
|
178
|
+
}
|
|
175
179
|
handleMessageInput(event) {
|
|
176
180
|
this.formMessage = event.target.value;
|
|
177
181
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$2 } from './feedback-modal2.js';
|
|
3
3
|
|
|
4
|
-
const feedbackButtonCss = ".feedback-button-content{cursor:pointer}.feedback-button-content--light{background-color:var(--feedback-
|
|
4
|
+
const feedbackButtonCss = ".feedback-button-content{cursor:pointer;z-index:300}.feedback-button-content--light{align-items:center;background-color:var(--feedback-white-color);border-radius:20px;box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;box-sizing:border-box;display:flex;font-family:var(--feedback-font-family);color:var(--feedback-primary-color);font-weight:bold;padding:8px 15px;font-size:var(--feedback-text-font-size)}.feedback-button-content--dark{align-items:center;background-color:var(--feedback-primary-color);border-radius:20px;box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;box-sizing:border-box;display:flex;font-family:var(--feedback-font-family);color:var(--feedback-white-color);font-weight:bold;padding:8px 15px;font-size:16px}.feedback-button-content--bottom-right{position:fixed;bottom:10px;right:10px}.feedback-button-content--center-right{position:fixed;bottom:50%;right:-50px;transform:rotate(-90deg)}.feedback-button-content--center-right.feedback-button-content--dark,.feedback-button-content--center-right.feedback-button-content--light{border-radius:4px;border-bottom-right-radius:0px;border-bottom-left-radius:0px}.feedback-button-content-icon{margin-right:5px}";
|
|
5
5
|
|
|
6
6
|
const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
@@ -20,6 +20,8 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
20
20
|
this.emailPlaceholder = 'Email address (optional)';
|
|
21
21
|
this.messagePlaceholder = 'How could this page be more helpful?';
|
|
22
22
|
this.buttonStyle = 'default';
|
|
23
|
+
this.buttonPosition = 'default';
|
|
24
|
+
this.hideIcon = false;
|
|
23
25
|
}
|
|
24
26
|
connectedCallback() {
|
|
25
27
|
this.feedbackModal = document.createElement('feedback-modal');
|
|
@@ -48,7 +50,7 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
48
50
|
this.feedbackModal.showModal = true;
|
|
49
51
|
}
|
|
50
52
|
render() {
|
|
51
|
-
return (h(Host, null, h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle}`, onClick: () => this.showModal() }, h("slot", null))));
|
|
53
|
+
return (h(Host, null, h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle} feedback-button-content--${this.buttonPosition}`, onClick: () => this.showModal() }, !this.hideIcon && this.buttonStyle === 'dark' && (h("span", { class: "feedback-button-content-icon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-repeat" }, h("polyline", { points: "17 1 21 5 17 9" }), h("path", { d: "M3 11V9a4 4 0 0 1 4-4h14" }), h("polyline", { points: "7 23 3 19 7 15" }), h("path", { d: "M21 13v2a4 4 0 0 1-4 4H3" })))), !this.hideIcon && this.buttonStyle === 'light' && (h("span", { class: "feedback-button-content-icon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#0070F4", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-repeat" }, h("polyline", { points: "17 1 21 5 17 9" }), h("path", { d: "M3 11V9a4 4 0 0 1 4-4h14" }), h("polyline", { points: "7 23 3 19 7 15" }), h("path", { d: "M21 13v2a4 4 0 0 1-4 4H3" })))), h("slot", null))));
|
|
52
54
|
}
|
|
53
55
|
static get style() { return feedbackButtonCss; }
|
|
54
56
|
}, [1, "feedback-button", {
|
|
@@ -63,7 +65,9 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
63
65
|
"email": [1],
|
|
64
66
|
"emailPlaceholder": [1, "email-placeholder"],
|
|
65
67
|
"messagePlaceholder": [1, "message-placeholder"],
|
|
66
|
-
"buttonStyle": [1, "button-style"]
|
|
68
|
+
"buttonStyle": [1, "button-style"],
|
|
69
|
+
"buttonPosition": [1, "button-position"],
|
|
70
|
+
"hideIcon": [4, "hide-icon"]
|
|
67
71
|
}]);
|
|
68
72
|
function defineCustomElement$1() {
|
|
69
73
|
if (typeof customElements === "undefined") {
|
|
@@ -782,7 +782,7 @@ var domToImage = createCommonjsModule(function (module) {
|
|
|
782
782
|
})();
|
|
783
783
|
});
|
|
784
784
|
|
|
785
|
-
const feedbackModalCss = ".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300
|
|
785
|
+
const feedbackModalCss = ".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300;left:50%;top:50%;transform:translate(-50%, -50%)}@media screen and (min-width: 768px){.feedback-modal-content.feedback-modal-content--bottom-right{top:initial;left:initial;transform:initial;bottom:var(--feedback-modal-content-position-bottom);right:var(--feedback-modal-content-position-right)}.feedback-modal-content.feedback-modal-content--bottom-left{top:initial;transform:initial;bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left)}.feedback-modal-content.feedback-modal-content--top-right{top:initial;transform:initial;right:var(--feedback-modal-content-position-right);top:var(--fedback-modal-content-position-top)}.feedback-modal-content.feedback-modal-content--top-left{transform:initial;left:var(--feedback-modal-content-position-left);top:var(--fedback-modal-content-position-top)}}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);font-family:var(--feedback-modal-header-font-family);display:flex;font-size:var(--feedback-header-font-size);justify-content:space-between;margin-bottom:20px}.feedback-modal-text{margin-bottom:20px}.feedback-modal-text textarea{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:100px;padding:10px;resize:none;width:100%}.feedback-modal-email{margin-bottom:20px}.feedback-modal-email input{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:40px;padding:10px;width:100%}.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;justify-content:space-between}.button{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;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.button:hover,.button.active{color:var(--feedback-modal-button-text-color-active);background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active)}.feedback-modal-footer{font-size:12px;margin-top:5px 0;text-align:center}.feedback-modal-footer a{color:#191919;text-decoration:none}.feedback-logo{display:flex;align-items:center;justify-content:center;margin-top:5px}.feedback-logo svg{max-width:12px;margin-right:5px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;margin-left:auto;padding:0;width:24px;height:24px}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);box-shadow:0px 0px 0px 5px var(--feedback-modal-screenshot-element-selected-bg-color) inset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);color:var(--feedback-modal-screenshot-element-selected-text-color);cursor:pointer;display:flex;padding:5px;position:fixed;justify-content:center;width:100%;z-index:200}.feedback-modal-screenshot-header span{padding-left:10px;padding-right:10px}.feedback-modal-screenshot-overlay{background-color:transparent;cursor:unset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-message{font-size:var(--fedback-modal-message-font-size)}.feedback-modal-element-hover{cursor:pointer;background-color:transparent;border:4px dashed var(--feedback-modal-screenshot-element-hover-border-color)}.feedback-modal-element-selected{border:4px solid var(--feedback-modal-screenshot-element-selected-border-color)}";
|
|
786
786
|
|
|
787
787
|
const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
788
788
|
constructor() {
|
|
@@ -791,6 +791,7 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
791
791
|
this.__attachShadow();
|
|
792
792
|
this.handleSubmit = async (event) => {
|
|
793
793
|
event.preventDefault();
|
|
794
|
+
this.resetOverflow();
|
|
794
795
|
this.showScreenshotMode = false;
|
|
795
796
|
this.showModal = false;
|
|
796
797
|
this.sending = true;
|
|
@@ -844,14 +845,14 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
844
845
|
this.formError = false;
|
|
845
846
|
this.formMessage = '';
|
|
846
847
|
this.formEmail = '';
|
|
848
|
+
this.resetOverflow();
|
|
847
849
|
};
|
|
848
850
|
this.openScreenShot = () => {
|
|
849
851
|
this.hasSelectedElement = false;
|
|
850
852
|
this.showModal = false;
|
|
851
853
|
this.showScreenshotMode = true;
|
|
852
854
|
this.encodedScreenshot = null;
|
|
853
|
-
|
|
854
|
-
page.style.overflow = 'auto';
|
|
855
|
+
this.resetOverflow();
|
|
855
856
|
};
|
|
856
857
|
this.closeScreenShot = () => {
|
|
857
858
|
this.showModal = false;
|
|
@@ -859,8 +860,7 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
859
860
|
this.hasSelectedElement = false;
|
|
860
861
|
this.encodedScreenshot = null;
|
|
861
862
|
this.overlay.style.display = 'none';
|
|
862
|
-
|
|
863
|
-
page.style.overflow = 'inherit';
|
|
863
|
+
this.resetOverflow();
|
|
864
864
|
};
|
|
865
865
|
this.handleMouseOverScreenShot = (event) => {
|
|
866
866
|
event.preventDefault();
|
|
@@ -958,6 +958,10 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
958
958
|
componentWillLoad() {
|
|
959
959
|
this.formEmail = this.email;
|
|
960
960
|
}
|
|
961
|
+
resetOverflow() {
|
|
962
|
+
const page = document.getElementsByTagName('html')[0];
|
|
963
|
+
page.style.overflow = 'inherit';
|
|
964
|
+
}
|
|
961
965
|
handleMessageInput(event) {
|
|
962
966
|
this.formMessage = event.target.value;
|
|
963
967
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-0ae29483.js';
|
|
2
2
|
|
|
3
|
-
const feedbackButtonCss = ".feedback-button-content{cursor:pointer}.feedback-button-content--light{background-color:var(--feedback-
|
|
3
|
+
const feedbackButtonCss = ".feedback-button-content{cursor:pointer;z-index:300}.feedback-button-content--light{align-items:center;background-color:var(--feedback-white-color);border-radius:20px;box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;box-sizing:border-box;display:flex;font-family:var(--feedback-font-family);color:var(--feedback-primary-color);font-weight:bold;padding:8px 15px;font-size:var(--feedback-text-font-size)}.feedback-button-content--dark{align-items:center;background-color:var(--feedback-primary-color);border-radius:20px;box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;box-sizing:border-box;display:flex;font-family:var(--feedback-font-family);color:var(--feedback-white-color);font-weight:bold;padding:8px 15px;font-size:16px}.feedback-button-content--bottom-right{position:fixed;bottom:10px;right:10px}.feedback-button-content--center-right{position:fixed;bottom:50%;right:-50px;transform:rotate(-90deg)}.feedback-button-content--center-right.feedback-button-content--dark,.feedback-button-content--center-right.feedback-button-content--light{border-radius:4px;border-bottom-right-radius:0px;border-bottom-left-radius:0px}.feedback-button-content-icon{margin-right:5px}";
|
|
4
4
|
|
|
5
5
|
const FeedbackButton = class {
|
|
6
6
|
constructor(hostRef) {
|
|
@@ -17,6 +17,8 @@ const FeedbackButton = class {
|
|
|
17
17
|
this.emailPlaceholder = 'Email address (optional)';
|
|
18
18
|
this.messagePlaceholder = 'How could this page be more helpful?';
|
|
19
19
|
this.buttonStyle = 'default';
|
|
20
|
+
this.buttonPosition = 'default';
|
|
21
|
+
this.hideIcon = false;
|
|
20
22
|
}
|
|
21
23
|
connectedCallback() {
|
|
22
24
|
this.feedbackModal = document.createElement('feedback-modal');
|
|
@@ -45,7 +47,7 @@ const FeedbackButton = class {
|
|
|
45
47
|
this.feedbackModal.showModal = true;
|
|
46
48
|
}
|
|
47
49
|
render() {
|
|
48
|
-
return (h(Host, null, h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle}`, onClick: () => this.showModal() }, h("slot", null))));
|
|
50
|
+
return (h(Host, null, h("a", { class: `feedback-button-content feedback-button-content--${this.buttonStyle} feedback-button-content--${this.buttonPosition}`, onClick: () => this.showModal() }, !this.hideIcon && this.buttonStyle === 'dark' && (h("span", { class: "feedback-button-content-icon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-repeat" }, h("polyline", { points: "17 1 21 5 17 9" }), h("path", { d: "M3 11V9a4 4 0 0 1 4-4h14" }), h("polyline", { points: "7 23 3 19 7 15" }), h("path", { d: "M21 13v2a4 4 0 0 1-4 4H3" })))), !this.hideIcon && this.buttonStyle === 'light' && (h("span", { class: "feedback-button-content-icon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "#0070F4", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "feather feather-repeat" }, h("polyline", { points: "17 1 21 5 17 9" }), h("path", { d: "M3 11V9a4 4 0 0 1 4-4h14" }), h("polyline", { points: "7 23 3 19 7 15" }), h("path", { d: "M21 13v2a4 4 0 0 1-4 4H3" })))), h("slot", null))));
|
|
49
51
|
}
|
|
50
52
|
};
|
|
51
53
|
FeedbackButton.style = feedbackButtonCss;
|
|
@@ -832,13 +834,14 @@ var domToImage = createCommonjsModule(function (module) {
|
|
|
832
834
|
})();
|
|
833
835
|
});
|
|
834
836
|
|
|
835
|
-
const feedbackModalCss = ".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300
|
|
837
|
+
const feedbackModalCss = ".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300;left:50%;top:50%;transform:translate(-50%, -50%)}@media screen and (min-width: 768px){.feedback-modal-content.feedback-modal-content--bottom-right{top:initial;left:initial;transform:initial;bottom:var(--feedback-modal-content-position-bottom);right:var(--feedback-modal-content-position-right)}.feedback-modal-content.feedback-modal-content--bottom-left{top:initial;transform:initial;bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left)}.feedback-modal-content.feedback-modal-content--top-right{top:initial;transform:initial;right:var(--feedback-modal-content-position-right);top:var(--fedback-modal-content-position-top)}.feedback-modal-content.feedback-modal-content--top-left{transform:initial;left:var(--feedback-modal-content-position-left);top:var(--fedback-modal-content-position-top)}}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);font-family:var(--feedback-modal-header-font-family);display:flex;font-size:var(--feedback-header-font-size);justify-content:space-between;margin-bottom:20px}.feedback-modal-text{margin-bottom:20px}.feedback-modal-text textarea{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:100px;padding:10px;resize:none;width:100%}.feedback-modal-email{margin-bottom:20px}.feedback-modal-email input{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:40px;padding:10px;width:100%}.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;justify-content:space-between}.button{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;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.button:hover,.button.active{color:var(--feedback-modal-button-text-color-active);background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active)}.feedback-modal-footer{font-size:12px;margin-top:5px 0;text-align:center}.feedback-modal-footer a{color:#191919;text-decoration:none}.feedback-logo{display:flex;align-items:center;justify-content:center;margin-top:5px}.feedback-logo svg{max-width:12px;margin-right:5px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;margin-left:auto;padding:0;width:24px;height:24px}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);box-shadow:0px 0px 0px 5px var(--feedback-modal-screenshot-element-selected-bg-color) inset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);color:var(--feedback-modal-screenshot-element-selected-text-color);cursor:pointer;display:flex;padding:5px;position:fixed;justify-content:center;width:100%;z-index:200}.feedback-modal-screenshot-header span{padding-left:10px;padding-right:10px}.feedback-modal-screenshot-overlay{background-color:transparent;cursor:unset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-message{font-size:var(--fedback-modal-message-font-size)}.feedback-modal-element-hover{cursor:pointer;background-color:transparent;border:4px dashed var(--feedback-modal-screenshot-element-hover-border-color)}.feedback-modal-element-selected{border:4px solid var(--feedback-modal-screenshot-element-selected-border-color)}";
|
|
836
838
|
|
|
837
839
|
const FeedbackModal = class {
|
|
838
840
|
constructor(hostRef) {
|
|
839
841
|
registerInstance(this, hostRef);
|
|
840
842
|
this.handleSubmit = async (event) => {
|
|
841
843
|
event.preventDefault();
|
|
844
|
+
this.resetOverflow();
|
|
842
845
|
this.showScreenshotMode = false;
|
|
843
846
|
this.showModal = false;
|
|
844
847
|
this.sending = true;
|
|
@@ -892,14 +895,14 @@ const FeedbackModal = class {
|
|
|
892
895
|
this.formError = false;
|
|
893
896
|
this.formMessage = '';
|
|
894
897
|
this.formEmail = '';
|
|
898
|
+
this.resetOverflow();
|
|
895
899
|
};
|
|
896
900
|
this.openScreenShot = () => {
|
|
897
901
|
this.hasSelectedElement = false;
|
|
898
902
|
this.showModal = false;
|
|
899
903
|
this.showScreenshotMode = true;
|
|
900
904
|
this.encodedScreenshot = null;
|
|
901
|
-
|
|
902
|
-
page.style.overflow = 'auto';
|
|
905
|
+
this.resetOverflow();
|
|
903
906
|
};
|
|
904
907
|
this.closeScreenShot = () => {
|
|
905
908
|
this.showModal = false;
|
|
@@ -907,8 +910,7 @@ const FeedbackModal = class {
|
|
|
907
910
|
this.hasSelectedElement = false;
|
|
908
911
|
this.encodedScreenshot = null;
|
|
909
912
|
this.overlay.style.display = 'none';
|
|
910
|
-
|
|
911
|
-
page.style.overflow = 'inherit';
|
|
913
|
+
this.resetOverflow();
|
|
912
914
|
};
|
|
913
915
|
this.handleMouseOverScreenShot = (event) => {
|
|
914
916
|
event.preventDefault();
|
|
@@ -1006,6 +1008,10 @@ const FeedbackModal = class {
|
|
|
1006
1008
|
componentWillLoad() {
|
|
1007
1009
|
this.formEmail = this.email;
|
|
1008
1010
|
}
|
|
1011
|
+
resetOverflow() {
|
|
1012
|
+
const page = document.getElementsByTagName('html')[0];
|
|
1013
|
+
page.style.overflow = 'inherit';
|
|
1014
|
+
}
|
|
1009
1015
|
handleMessageInput(event) {
|
|
1010
1016
|
this.formMessage = event.target.value;
|
|
1011
1017
|
}
|
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",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"buttonStyle":[1,"button-style"]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
|
|
14
|
+
return bootstrapLazy([["feedback-button_2",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"buttonStyle":[1,"button-style"],"buttonPosition":[1,"button-position"],"hideIcon":[4,"hide-icon"]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], 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",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"buttonStyle":[1,"button-style"]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
|
|
17
|
+
return bootstrapLazy([["feedback-button_2",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"buttonStyle":[1,"button-style"],"buttonPosition":[1,"button-position"],"hideIcon":[4,"hide-icon"]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
|
|
18
18
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as e,H as o}from"./p-60079923.js";const n=class{constructor(e){t(this,e),this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?",this.buttonStyle="default",this.buttonPosition="default",this.hideIcon=!1}connectedCallback(){this.feedbackModal=document.createElement("feedback-modal"),["modalTitle","successModalTitle","errorModalTitle","modalPosition","sendButtonText","project","screenshotButtonTooltipText","screenshotTopbarText","email","emailPlaceholder","messagePlaceholder"].forEach((t=>{this.feedbackModal[t]=this[t]})),document.body.appendChild(this.feedbackModal)}disconnectedCallback(){document.body.removeChild(this.feedbackModal)}showModal(){this.feedbackModal.showModal=!0}render(){return e(o,null,e("a",{class:`feedback-button-content feedback-button-content--${this.buttonStyle} feedback-button-content--${this.buttonPosition}`,onClick:()=>this.showModal()},!this.hideIcon&&"dark"===this.buttonStyle&&e("span",{class:"feedback-button-content-icon"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-repeat"},e("polyline",{points:"17 1 21 5 17 9"}),e("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),e("polyline",{points:"7 23 3 19 7 15"}),e("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"}))),!this.hideIcon&&"light"===this.buttonStyle&&e("span",{class:"feedback-button-content-icon"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#0070F4","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-repeat"},e("polyline",{points:"17 1 21 5 17 9"}),e("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),e("polyline",{points:"7 23 3 19 7 15"}),e("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"}))),e("slot",null)))}};n.style=".feedback-button-content{cursor:pointer;z-index:300}.feedback-button-content--light{align-items:center;background-color:var(--feedback-white-color);border-radius:20px;box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;box-sizing:border-box;display:flex;font-family:var(--feedback-font-family);color:var(--feedback-primary-color);font-weight:bold;padding:8px 15px;font-size:var(--feedback-text-font-size)}.feedback-button-content--dark{align-items:center;background-color:var(--feedback-primary-color);border-radius:20px;box-shadow:rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;box-sizing:border-box;display:flex;font-family:var(--feedback-font-family);color:var(--feedback-white-color);font-weight:bold;padding:8px 15px;font-size:16px}.feedback-button-content--bottom-right{position:fixed;bottom:10px;right:10px}.feedback-button-content--center-right{position:fixed;bottom:50%;right:-50px;transform:rotate(-90deg)}.feedback-button-content--center-right.feedback-button-content--dark,.feedback-button-content--center-right.feedback-button-content--light{border-radius:4px;border-bottom-right-radius:0px;border-bottom-left-radius:0px}.feedback-button-content-icon{margin-right:5px}";var i,r,a=(i=function(t){!function(){var e=function(){return{escape:function(t){return t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:e,mimeType:function(t){var o,n;return(o="application/font-woff",n="image/jpeg",{woff:o,woff2:o,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:n,jpeg:n,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[e(t).toLowerCase()]||""},dataAsUrl:function(t,e){return"data:"+e+";base64,"+t},isDataUrl:function(t){return-1!==t.search(/^(data:)/)},canvasToBlob:function(t){return t.toBlob?new Promise((function(e){t.toBlob(e)})):function(t){return new Promise((function(e){for(var o=window.atob(t.toDataURL().split(",")[1]),n=o.length,i=new Uint8Array(n),r=0;r<n;r++)i[r]=o.charCodeAt(r);e(new Blob([i],{type:"image/png"}))}))}(t)},resolveUrl:function(t,e){var o=document.implementation.createHTMLDocument(),n=o.createElement("base");o.head.appendChild(n);var i=o.createElement("a");return o.body.appendChild(i),n.href=e,i.href=t,i.href},getAndEncode:function(t){return s.impl.options.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime()),new Promise((function(e){var o,n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){var i=new FileReader;i.onloadend=function(){var t=i.result.split(/,/)[1];e(t)},i.readAsDataURL(n.response)}else o?e(o):r("cannot fetch resource: "+t+", status: "+n.status)},n.ontimeout=function(){o?e(o):r("timeout of 30000ms occured while fetching resource: "+t)},n.responseType="blob",n.timeout=3e4,n.open("GET",t,!0),n.send(),s.impl.options.imagePlaceholder){var i=s.impl.options.imagePlaceholder.split(/,/);i&&i[1]&&(o=i[1])}function r(t){console.error(t),e("")}}))},uid:(t=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+t++}),delay:function(t){return function(e){return new Promise((function(o){setTimeout((function(){o(e)}),t)}))}},asArray:function(t){for(var e=[],o=t.length,n=0;n<o;n++)e.push(t[n]);return e},escapeXhtml:function(t){return t.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(t){return new Promise((function(e,o){var n=new Image;n.onload=function(){e(n)},n.onerror=o,n.src=t}))},width:function(t){var e=o(t,"border-left-width"),n=o(t,"border-right-width");return t.scrollWidth+e+n},height:function(t){var e=o(t,"border-top-width"),n=o(t,"border-bottom-width");return t.scrollHeight+e+n}};var t;function e(t){var e=/\.([^\.\/]*?)$/g.exec(t);return e?e[1]:""}function o(t,e){var o=window.getComputedStyle(t).getPropertyValue(e);return parseFloat(o.replace("px",""))}}(),o=function(){var t=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(t,e,r){return o(t)?Promise.resolve(t).then(n).then((function(o){var n=Promise.resolve(t);return o.forEach((function(t){n=n.then((function(o){return i(o,t,e,r)}))})),n})):Promise.resolve(t)},shouldProcess:o,impl:{readUrls:n,inline:i}};function o(e){return-1!==e.search(t)}function n(o){for(var n,i=[];null!==(n=t.exec(o));)i.push(n[1]);return i.filter((function(t){return!e.isDataUrl(t)}))}function i(t,o,n,i){return Promise.resolve(o).then((function(t){return n?e.resolveUrl(t,n):t})).then(i||e.getAndEncode).then((function(t){return e.dataAsUrl(t,e.mimeType(o))})).then((function(n){return t.replace(function(t){return new RegExp("(url\\(['\"]?)("+e.escape(t)+")(['\"]?\\))","g")}(o),"$1"+n+"$3")}))}}(),n=function(){return{resolveAll:function(){return t().then((function(t){return Promise.all(t.map((function(t){return t.resolve()})))})).then((function(t){return t.join("\n")}))},impl:{readAll:t}};function t(){return Promise.resolve(e.asArray(document.styleSheets)).then((function(t){var o=[];return t.forEach((function(t){try{e.asArray(t.cssRules||[]).forEach(o.push.bind(o))}catch(e){console.log("Error while reading CSS rules from "+t.href,e.toString())}})),o})).then((function(t){return t.filter((function(t){return t.type===CSSRule.FONT_FACE_RULE})).filter((function(t){return o.shouldProcess(t.style.getPropertyValue("src"))}))})).then((function(e){return e.map(t)}));function t(t){return{resolve:function(){return o.inlineAll(t.cssText,(t.parentStyleSheet||{}).href)},src:function(){return t.style.getPropertyValue("src")}}}}}(),i=function(){return{inlineAll:function n(i){return i instanceof Element?function(t){var e=t.style.getPropertyValue("background");return e?o.inlineAll(e).then((function(e){t.style.setProperty("background",e,t.style.getPropertyPriority("background"))})).then((function(){return t})):Promise.resolve(t)}(i).then((function(){return i instanceof HTMLImageElement?t(i).inline():Promise.all(e.asArray(i.childNodes).map((function(t){return n(t)})))})):Promise.resolve(i)},impl:{newImage:t}};function t(t){return{inline:function(o){return e.isDataUrl(t.src)?Promise.resolve():Promise.resolve(t.src).then(o||e.getAndEncode).then((function(o){return e.dataAsUrl(o,e.mimeType(t.src))})).then((function(e){return new Promise((function(o,n){t.onload=o,t.onerror=n,t.src=e}))}))}}}}(),r=void 0,a=!1,s={toSvg:c,toPng:function(t,e){return d(t,e||{}).then((function(t){return t.toDataURL()}))},toJpeg:function(t,e){return d(t,e=e||{}).then((function(t){return t.toDataURL("image/jpeg",e.quality||1)}))},toBlob:function(t,o){return d(t,o||{}).then(e.canvasToBlob)},toPixelData:function(t,o){return d(t,o||{}).then((function(o){return o.getContext("2d").getImageData(0,0,e.width(t),e.height(t)).data}))},impl:{fontFaces:n,images:i,util:e,inliner:o,options:{}}};function c(t,o){return function(t){s.impl.options.imagePlaceholder=void 0===t.imagePlaceholder?r:t.imagePlaceholder,s.impl.options.cacheBust=void 0===t.cacheBust?a:t.cacheBust}(o=o||{}),Promise.resolve(t).then((function(t){return l(t,o.filter,!0)})).then(f).then(u).then((function(t){return o.bgcolor&&(t.style.backgroundColor=o.bgcolor),o.width&&(t.style.width=o.width+"px"),o.height&&(t.style.height=o.height+"px"),o.style&&Object.keys(o.style).forEach((function(e){t.style[e]=o.style[e]})),t})).then((function(n){return function(t,o,n){return Promise.resolve(t).then((function(t){return t.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(t)})).then(e.escapeXhtml).then((function(t){return'<foreignObject x="0" y="0" width="100%" height="100%">'+t+"</foreignObject>"})).then((function(t){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+o+'" height="'+n+'">'+t+"</svg>"})).then((function(t){return"data:image/svg+xml;charset=utf-8,"+t}))}(n,o.width||e.width(t),o.height||e.height(t))}))}function d(t,o){return c(t,o).then(e.makeImage).then(e.delay(100)).then((function(n){var i=function(t){var n=document.createElement("canvas");if(n.width=o.width||e.width(t),n.height=o.height||e.height(t),o.bgcolor){var i=n.getContext("2d");i.fillStyle=o.bgcolor,i.fillRect(0,0,n.width,n.height)}return n}(t);return i.getContext("2d").drawImage(n,0,0),i}))}function l(t,o,n){return n||!o||o(t)?Promise.resolve(t).then((function(t){return t instanceof HTMLCanvasElement?e.makeImage(t.toDataURL()):t.cloneNode(!1)})).then((function(n){return function(t,o,n){var i=t.childNodes;return 0===i.length?Promise.resolve(o):function(t,e,o){var n=Promise.resolve();return e.forEach((function(e){n=n.then((function(){return l(e,o)})).then((function(e){e&&t.appendChild(e)}))})),n}(o,e.asArray(i),n).then((function(){return o}))}(t,n,o)})).then((function(o){return function(t,o){return o instanceof Element?Promise.resolve().then((function(){n=window.getComputedStyle(t),i=o.style,n.cssText?i.cssText=n.cssText:function(t,o){e.asArray(t).forEach((function(e){o.setProperty(e,t.getPropertyValue(e),t.getPropertyPriority(e))}))}(n,i);var n,i})).then((function(){[":before",":after"].forEach((function(n){!function(n){var i=window.getComputedStyle(t,n),r=i.getPropertyValue("content");if(""!==r&&"none"!==r){var a=e.uid();o.className=o.className+" "+a;var s=document.createElement("style");s.appendChild(function(t,o,n){var i="."+t+":"+o,r=n.cssText?a(n):s(n);return document.createTextNode(i+"{"+r+"}");function a(t){var e=t.getPropertyValue("content");return t.cssText+" content: "+e+";"}function s(t){return e.asArray(t).map(o).join("; ")+";";function o(e){return e+": "+t.getPropertyValue(e)+(t.getPropertyPriority(e)?" !important":"")}}}(a,n,i)),o.appendChild(s)}}(n)}))})).then((function(){t instanceof HTMLTextAreaElement&&(o.innerHTML=t.value),t instanceof HTMLInputElement&&o.setAttribute("value",t.value)})).then((function(){o instanceof SVGElement&&(o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o instanceof SVGRectElement&&["width","height"].forEach((function(t){var e=o.getAttribute(t);e&&o.style.setProperty(t,e)})))})).then((function(){return o})):o}(t,o)})):Promise.resolve()}function f(t){return n.resolveAll().then((function(e){var o=document.createElement("style");return t.appendChild(o),o.appendChild(document.createTextNode(e)),t}))}function u(t){return i.inlineAll(t).then((function(){return t}))}t.exports=s}()},i(r={path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),r.exports);const s=class{constructor(e){t(this,e),this.handleSubmit=async t=>{t.preventDefault(),this.resetOverflow(),this.showScreenshotMode=!1,this.showModal=!1,this.sending=!0;let e="";this.encodedScreenshot&&await this.encodedScreenshot.then((t=>{e=t})).catch((t=>{console.log(t)}));try{200===(await fetch("https://app.pushfeedback.com/api/feedback/",{method:"POST",body:JSON.stringify({url:window.location.href,message:this.formMessage,email:this.formEmail,project:this.project,screenshot:e}),headers:{"Content-Type":"application/json"}})).status?(this.formSuccess=!0,this.formError=!1):(this.formSuccess=!1,this.formError=!0)}catch(t){this.formSuccess=!1,this.formError=!0}finally{this.sending=!1,this.showModal=!0}},this.close=()=>{this.sending=!1,this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.formSuccess=!1,this.formError=!1,this.formMessage="",this.formEmail="",this.resetOverflow()},this.openScreenShot=()=>{this.hasSelectedElement=!1,this.showModal=!1,this.showScreenshotMode=!0,this.encodedScreenshot=null,this.resetOverflow()},this.closeScreenShot=()=>{this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.overlay.style.display="none",this.resetOverflow()},this.handleMouseOverScreenShot=t=>{if(t.preventDefault(),this.hasSelectedElement)return;this.overlay.style.display="none",this.screenshotModal.style.display="none";const e=document.elementFromPoint(t.clientX,t.clientY).getBoundingClientRect();this.screenshotModal.style.display="",this.elementSelected.style.position="absolute",this.elementSelected.style.left=`${e.left}px`,this.elementSelected.style.top=`${e.top}px`,this.elementSelected.style.width=`${e.width}px`,this.elementSelected.style.height=`${e.height}px`,this.elementSelected.classList.add("feedback-modal-element-hover"),this.topSide.style.position="absolute",this.topSide.style.left=`${e.left}px`,this.topSide.style.top="0px",this.topSide.style.width=`${e.width+8}px`,this.topSide.style.height=`${e.top}px`,this.topSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.leftSide.style.position="absolute",this.leftSide.style.left="0px",this.leftSide.style.top="0px",this.leftSide.style.width=`${e.left}px`,this.leftSide.style.height="100vh",this.leftSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.bottomSide.style.position="absolute",this.bottomSide.style.left=`${e.left}px`,this.bottomSide.style.top=`${e.bottom+8}px`,this.bottomSide.style.width=`${e.width+8}px`,this.bottomSide.style.height="100vh",this.bottomSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.rightSide.style.position="absolute",this.rightSide.style.left=`${e.right+8}px`,this.rightSide.style.top="0px",this.rightSide.style.width="100%",this.rightSide.style.height="100vh",this.rightSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.screenshotModal.style.backgroundColor="transparent"},this.handleMouseClickedSelectedElement=t=>{t.preventDefault(),this.elementSelected&&this.elementSelected.classList.add("feedback-modal-element-selected");let e=this.elementSelected.getBoundingClientRect().top;this.elementSelected.style.top=`${e+window.pageYOffset}px`;const o=this.elementSelected.cloneNode(!0);document.body.appendChild(o),this.elementSelected.style.top=`${e}px`,this.encodedScreenshot=a.toPng(document.body,{cacheBust:!0}).then((function(t){return document.body.removeChild(o),t})).catch((function(t){return console.error("oops, something went wrong!",t),""})),document.getElementsByTagName("html")[0].style.overflow="hidden",this.hasSelectedElement=!0,this.overlay.style.display="block",this.showModal=!0},this.sending=!1,this.formMessage="",this.formEmail="",this.formSuccess=!1,this.formError=!1,this.encodedScreenshot=void 0,this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?",this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1}componentWillLoad(){this.formEmail=this.email}resetOverflow(){document.getElementsByTagName("html")[0].style.overflow="inherit"}handleMessageInput(t){this.formMessage=t.target.value}handleEmailInput(t){this.formEmail=t.target.value}render(){return e("div",{class:"feedback-modal-wrapper"},this.showScreenshotMode&&e("div",{class:"feedback-modal-screenshot",ref:t=>this.screenshotModal=t,onMouseMove:this.handleMouseOverScreenShot},e("div",{class:"feedback-modal-screenshot-element-selected",ref:t=>this.elementSelected=t,onClick:this.handleMouseClickedSelectedElement}),e("div",{class:"top-side",ref:t=>this.topSide=t}),e("div",{class:"left-side",ref:t=>this.leftSide=t}),e("div",{class:"bottom-side",ref:t=>this.bottomSide=t}),e("div",{class:"right-side",ref:t=>this.rightSide=t}),e("div",{class:"feedback-modal-screenshot-header",onClick:this.closeScreenShot},e("span",null,this.screenshotTopbarText),e("span",{class:"feedback-modal-screenshot-close"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),e("div",{class:"feedback-modal-screenshot-overlay",ref:t=>this.overlay=t})),this.showModal&&e("div",{class:`feedback-modal-content feedback-modal-content--${this.modalPosition}`,ref:t=>this.modalContent=t},e("div",{class:"feedback-modal-header"},this.formSuccess||this.formError?this.formSuccess?e("span",{class:"text-center"},this.successModalTitle):this.formError?e("span",{class:"text-center"},this.errorModalTitle):e("span",null):e("span",null,this.modalTitle),e("button",{class:"feedback-modal-close",onClick:this.close},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#ccc","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),e("div",{class:"feedback-modal-body"},this.formSuccess||this.formError?e("span",null):e("form",{onSubmit:this.handleSubmit},e("div",{class:"feedback-modal-text"},e("textarea",{placeholder:this.messagePlaceholder,value:this.formMessage,onInput:t=>this.handleMessageInput(t),required:!0})),!this.email&&e("div",{class:"feedback-modal-email"},e("input",{type:"email",placeholder:this.emailPlaceholder,onInput:t=>this.handleEmailInput(t),value:this.formEmail})),e("div",{class:"feedback-modal-buttons"},e("button",{type:"button",class:"button"+(this.encodedScreenshot?" active":""),title:this.screenshotButtonTooltipText,onClick:this.openScreenShot,disabled:this.sending},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-camera"},e("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),e("circle",{cx:"12",cy:"13",r:"4"}))),e("button",{class:"button",type:"submit",disabled:this.sending},this.sendButtonText)))),e("div",{class:"feedback-modal-footer"},e("div",{class:"feedback-logo"},e("svg",{class:"w-8 h-8",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},e("defs",null,e("radialGradient",{cx:"21.152%",cy:"86.063%",fx:"21.152%",fy:"86.063%",r:"79.941%",id:"footer-logo"},e("stop",{"stop-color":"#4FD1C5",offset:"0%"}),e("stop",{"stop-color":"#81E6D9",offset:"25.871%"}),e("stop",{"stop-color":"#338CF5",offset:"100%"}))),e("rect",{width:"32",height:"32",rx:"16",fill:"url(#footer-logo)","fill-rule":"nonzero"}))," ",e("a",{href:"https://pushfeedback.com"},"PushFeedback")))))}};s.style=".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300;left:50%;top:50%;transform:translate(-50%, -50%)}@media screen and (min-width: 768px){.feedback-modal-content.feedback-modal-content--bottom-right{top:initial;left:initial;transform:initial;bottom:var(--feedback-modal-content-position-bottom);right:var(--feedback-modal-content-position-right)}.feedback-modal-content.feedback-modal-content--bottom-left{top:initial;transform:initial;bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left)}.feedback-modal-content.feedback-modal-content--top-right{top:initial;transform:initial;right:var(--feedback-modal-content-position-right);top:var(--fedback-modal-content-position-top)}.feedback-modal-content.feedback-modal-content--top-left{transform:initial;left:var(--feedback-modal-content-position-left);top:var(--fedback-modal-content-position-top)}}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);font-family:var(--feedback-modal-header-font-family);display:flex;font-size:var(--feedback-header-font-size);justify-content:space-between;margin-bottom:20px}.feedback-modal-text{margin-bottom:20px}.feedback-modal-text textarea{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:100px;padding:10px;resize:none;width:100%}.feedback-modal-email{margin-bottom:20px}.feedback-modal-email input{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:40px;padding:10px;width:100%}.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;justify-content:space-between}.button{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;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.button:hover,.button.active{color:var(--feedback-modal-button-text-color-active);background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active)}.feedback-modal-footer{font-size:12px;margin-top:5px 0;text-align:center}.feedback-modal-footer a{color:#191919;text-decoration:none}.feedback-logo{display:flex;align-items:center;justify-content:center;margin-top:5px}.feedback-logo svg{max-width:12px;margin-right:5px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;margin-left:auto;padding:0;width:24px;height:24px}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);box-shadow:0px 0px 0px 5px var(--feedback-modal-screenshot-element-selected-bg-color) inset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);color:var(--feedback-modal-screenshot-element-selected-text-color);cursor:pointer;display:flex;padding:5px;position:fixed;justify-content:center;width:100%;z-index:200}.feedback-modal-screenshot-header span{padding-left:10px;padding-right:10px}.feedback-modal-screenshot-overlay{background-color:transparent;cursor:unset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-message{font-size:var(--fedback-modal-message-font-size)}.feedback-modal-element-hover{cursor:pointer;background-color:transparent;border:4px dashed var(--feedback-modal-screenshot-element-hover-border-color)}.feedback-modal-element-selected{border:4px solid var(--feedback-modal-screenshot-element-selected-border-color)}";export{n as feedback_button,s as feedback_modal}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--feedback-primary-color:#0070F4;--feedback-secondary-color:#fbfbfb;--feedback-light-color:#ccc;--feedback-dark-color:#191919;--feedback-text-color:#5f6368;--feedback-white-color:#fff;--feedback-font-family:"Tahoma", "sans-serif";--feedback-heading-font-size:16px;--feedback-text-font-size:14px;--feedback-
|
|
1
|
+
:root{--feedback-primary-color:#0070F4;--feedback-secondary-color:#fbfbfb;--feedback-light-color:#ccc;--feedback-dark-color:#191919;--feedback-text-color:#5f6368;--feedback-white-color:#fff;--feedback-font-family:"Tahoma", "sans-serif";--feedback-heading-font-size:16px;--feedback-text-font-size:14px;--feedback-modal-content-bg-color:var(--feedback-white-color);--feedback-modal-content-border-color:var(--feedback-light-color);--feedback-modal-content-font-family:var(--feedback-font-family);--feedback-modal-content-text-color:var(--feedback-text-color);--feedback-modal-content-border-radius:8px;--feedback-modal-content-position-top:10px;--feedback-modal-content-position-bottom:10px;--feedback-modal-content-position-right:10px;--feedback-modal-content-position-left:10px;--feedback-modal-header-text-color:var(--feedback-dark-color);--feedback-modal-header-font-size:var(--feedback-header-font-size);--feedback-modal-header-font-family:var(--feedback-font-family);--feedback-modal-input-font-size:var(--feedback-text-font-size);--feedback-modal-button-font-size:var(--feedback-text-font-size);--fedback-modal-message-font-size:var(--feedback-text-font-size);--feedback-modal-button-bg-color:var(--feedback-white-color);--feedback-modal-button-bg-color-active:var(--feedback-secondary-color);--feedback-modal-button-text-color:var(--feedback-dark-color);--feedback-modal-button-text-color-active:var(--feedback-primary-color);--feedback-modal-button-border-color:var(--feedback-light-color);--feedback-modal-button-border-color-active:var(--feedback-primary-color);--feedback-modal-button-border-radius:4px;--feedback-modal-input-border-color:var(--feedback-light-color);--feedback-modal-input-border-color-focused:var(--feedback-primary-color);--feedback-modal-input-border-radius:4px;--feedback-modal-close-bg-color:var(--feedback-white-color);--feedback-modal-screenshot-bg-color:rgba(0, 0, 0, 0.3);--feedback-modal-screenshot-element-hover-border-color:var(--feedback-primary-color);--feedback-modal-screenshot-element-selected-bg-color:var(--feedback-primary-color);--feedback-modal-screenshot-element-selected-text-color:var(--feedback-white-color);--feedback-modal-screenshot-element-selected-border-color:var(--feedback-primary-color);--feedback-modal-screenshot-header-bg-color:var(--feedback-primary-color)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as
|
|
1
|
+
import{p as e,b as o}from"./p-60079923.js";export{s as setNonce}from"./p-60079923.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-65e5f493",[[1,"feedback-button",{modalTitle:[1,"modal-title"],successModalTitle:[1,"success-modal-title"],errorModalTitle:[1,"error-modal-title"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],project:[1],screenshotButtonTooltipText:[1,"screenshot-button-tooltip-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],email:[1],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],buttonStyle:[1,"button-style"],buttonPosition:[1,"button-position"],hideIcon:[4,"hide-icon"]}],[1,"feedback-modal",{modalTitle:[1,"modal-title"],successModalTitle:[1,"success-modal-title"],errorModalTitle:[1,"error-modal-title"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],project:[1],screenshotButtonTooltipText:[1,"screenshot-button-tooltip-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],email:[1],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],showModal:[1540,"show-modal"],showScreenshotMode:[1540,"show-screenshot-mode"],hasSelectedElement:[1540,"has-selected-element"],sending:[32],formMessage:[32],formEmail:[32],formSuccess:[32],formError:[32],encodedScreenshot:[32]}]]]],e)));
|
|
@@ -28,6 +28,7 @@ export declare class FeedbackModal {
|
|
|
28
28
|
bottomSide: HTMLElement;
|
|
29
29
|
rightSide: HTMLElement;
|
|
30
30
|
componentWillLoad(): void;
|
|
31
|
+
resetOverflow(): void;
|
|
31
32
|
handleMessageInput(event: Event): void;
|
|
32
33
|
handleEmailInput(event: Event): void;
|
|
33
34
|
handleSubmit: (event: Event) => Promise<void>;
|
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
export namespace Components {
|
|
9
9
|
interface FeedbackButton {
|
|
10
|
+
"buttonPosition": string;
|
|
10
11
|
"buttonStyle": string;
|
|
11
12
|
"email": string;
|
|
12
13
|
"emailPlaceholder": string;
|
|
13
14
|
"errorModalTitle": string;
|
|
15
|
+
"hideIcon": boolean;
|
|
14
16
|
"messagePlaceholder": string;
|
|
15
17
|
"modalPosition": string;
|
|
16
18
|
"modalTitle": string;
|
|
@@ -57,10 +59,12 @@ declare global {
|
|
|
57
59
|
}
|
|
58
60
|
declare namespace LocalJSX {
|
|
59
61
|
interface FeedbackButton {
|
|
62
|
+
"buttonPosition"?: string;
|
|
60
63
|
"buttonStyle"?: string;
|
|
61
64
|
"email"?: string;
|
|
62
65
|
"emailPlaceholder"?: string;
|
|
63
66
|
"errorModalTitle"?: string;
|
|
67
|
+
"hideIcon"?: boolean;
|
|
64
68
|
"messagePlaceholder"?: string;
|
|
65
69
|
"modalPosition"?: string;
|
|
66
70
|
"modalTitle"?: string;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t,H as o}from"./p-60079923.js";const n=class{constructor(t){e(this,t),this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?",this.buttonStyle="default"}connectedCallback(){this.feedbackModal=document.createElement("feedback-modal"),["modalTitle","successModalTitle","errorModalTitle","modalPosition","sendButtonText","project","screenshotButtonTooltipText","screenshotTopbarText","email","emailPlaceholder","messagePlaceholder"].forEach((e=>{this.feedbackModal[e]=this[e]})),document.body.appendChild(this.feedbackModal)}disconnectedCallback(){document.body.removeChild(this.feedbackModal)}showModal(){this.feedbackModal.showModal=!0}render(){return t(o,null,t("a",{class:`feedback-button-content feedback-button-content--${this.buttonStyle}`,onClick:()=>this.showModal()},t("slot",null)))}};n.style=".feedback-button-content{cursor:pointer}.feedback-button-content--light{background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);padding:5px 10px;font-size:var(--feedback-modal-button-font-size)}.feedback-button-content--light:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";var r,i,a=(r=function(e){!function(){var t=function(){return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:t,mimeType:function(e){var o,n;return(o="application/font-woff",n="image/jpeg",{woff:o,woff2:o,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:n,jpeg:n,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[t(e).toLowerCase()]||""},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise((function(t){e.toBlob(t)})):function(e){return new Promise((function(t){for(var o=window.atob(e.toDataURL().split(",")[1]),n=o.length,r=new Uint8Array(n),i=0;i<n;i++)r[i]=o.charCodeAt(i);t(new Blob([r],{type:"image/png"}))}))}(e)},resolveUrl:function(e,t){var o=document.implementation.createHTMLDocument(),n=o.createElement("base");o.head.appendChild(n);var r=o.createElement("a");return o.body.appendChild(r),n.href=t,r.href=e,r.href},getAndEncode:function(e){return s.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime()),new Promise((function(t){var o,n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){var r=new FileReader;r.onloadend=function(){var e=r.result.split(/,/)[1];t(e)},r.readAsDataURL(n.response)}else o?t(o):i("cannot fetch resource: "+e+", status: "+n.status)},n.ontimeout=function(){o?t(o):i("timeout of 30000ms occured while fetching resource: "+e)},n.responseType="blob",n.timeout=3e4,n.open("GET",e,!0),n.send(),s.impl.options.imagePlaceholder){var r=s.impl.options.imagePlaceholder.split(/,/);r&&r[1]&&(o=r[1])}function i(e){console.error(e),t("")}}))},uid:(e=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+e++}),delay:function(e){return function(t){return new Promise((function(o){setTimeout((function(){o(t)}),e)}))}},asArray:function(e){for(var t=[],o=e.length,n=0;n<o;n++)t.push(e[n]);return t},escapeXhtml:function(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return new Promise((function(t,o){var n=new Image;n.onload=function(){t(n)},n.onerror=o,n.src=e}))},width:function(e){var t=o(e,"border-left-width"),n=o(e,"border-right-width");return e.scrollWidth+t+n},height:function(e){var t=o(e,"border-top-width"),n=o(e,"border-bottom-width");return e.scrollHeight+t+n}};var e;function t(e){var t=/\.([^\.\/]*?)$/g.exec(e);return t?t[1]:""}function o(e,t){var o=window.getComputedStyle(e).getPropertyValue(t);return parseFloat(o.replace("px",""))}}(),o=function(){var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,t,i){return o(e)?Promise.resolve(e).then(n).then((function(o){var n=Promise.resolve(e);return o.forEach((function(e){n=n.then((function(o){return r(o,e,t,i)}))})),n})):Promise.resolve(e)},shouldProcess:o,impl:{readUrls:n,inline:r}};function o(t){return-1!==t.search(e)}function n(o){for(var n,r=[];null!==(n=e.exec(o));)r.push(n[1]);return r.filter((function(e){return!t.isDataUrl(e)}))}function r(e,o,n,r){return Promise.resolve(o).then((function(e){return n?t.resolveUrl(e,n):e})).then(r||t.getAndEncode).then((function(e){return t.dataAsUrl(e,t.mimeType(o))})).then((function(n){return e.replace(function(e){return new RegExp("(url\\(['\"]?)("+t.escape(e)+")(['\"]?\\))","g")}(o),"$1"+n+"$3")}))}}(),n=function(){return{resolveAll:function(){return e().then((function(e){return Promise.all(e.map((function(e){return e.resolve()})))})).then((function(e){return e.join("\n")}))},impl:{readAll:e}};function e(){return Promise.resolve(t.asArray(document.styleSheets)).then((function(e){var o=[];return e.forEach((function(e){try{t.asArray(e.cssRules||[]).forEach(o.push.bind(o))}catch(t){console.log("Error while reading CSS rules from "+e.href,t.toString())}})),o})).then((function(e){return e.filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).filter((function(e){return o.shouldProcess(e.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(e){return{resolve:function(){return o.inlineAll(e.cssText,(e.parentStyleSheet||{}).href)},src:function(){return e.style.getPropertyValue("src")}}}}}(),r=function(){return{inlineAll:function n(r){return r instanceof Element?function(e){var t=e.style.getPropertyValue("background");return t?o.inlineAll(t).then((function(t){e.style.setProperty("background",t,e.style.getPropertyPriority("background"))})).then((function(){return e})):Promise.resolve(e)}(r).then((function(){return r instanceof HTMLImageElement?e(r).inline():Promise.all(t.asArray(r.childNodes).map((function(e){return n(e)})))})):Promise.resolve(r)},impl:{newImage:e}};function e(e){return{inline:function(o){return t.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(o||t.getAndEncode).then((function(o){return t.dataAsUrl(o,t.mimeType(e.src))})).then((function(t){return new Promise((function(o,n){e.onload=o,e.onerror=n,e.src=t}))}))}}}}(),i=void 0,a=!1,s={toSvg:c,toPng:function(e,t){return d(e,t||{}).then((function(e){return e.toDataURL()}))},toJpeg:function(e,t){return d(e,t=t||{}).then((function(e){return e.toDataURL("image/jpeg",t.quality||1)}))},toBlob:function(e,o){return d(e,o||{}).then(t.canvasToBlob)},toPixelData:function(e,o){return d(e,o||{}).then((function(o){return o.getContext("2d").getImageData(0,0,t.width(e),t.height(e)).data}))},impl:{fontFaces:n,images:r,util:t,inliner:o,options:{}}};function c(e,o){return function(e){s.impl.options.imagePlaceholder=void 0===e.imagePlaceholder?i:e.imagePlaceholder,s.impl.options.cacheBust=void 0===e.cacheBust?a:e.cacheBust}(o=o||{}),Promise.resolve(e).then((function(e){return l(e,o.filter,!0)})).then(u).then(f).then((function(e){return o.bgcolor&&(e.style.backgroundColor=o.bgcolor),o.width&&(e.style.width=o.width+"px"),o.height&&(e.style.height=o.height+"px"),o.style&&Object.keys(o.style).forEach((function(t){e.style[t]=o.style[t]})),e})).then((function(n){return function(e,o,n){return Promise.resolve(e).then((function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)})).then(t.escapeXhtml).then((function(e){return'<foreignObject x="0" y="0" width="100%" height="100%">'+e+"</foreignObject>"})).then((function(e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+o+'" height="'+n+'">'+e+"</svg>"})).then((function(e){return"data:image/svg+xml;charset=utf-8,"+e}))}(n,o.width||t.width(e),o.height||t.height(e))}))}function d(e,o){return c(e,o).then(t.makeImage).then(t.delay(100)).then((function(n){var r=function(e){var n=document.createElement("canvas");if(n.width=o.width||t.width(e),n.height=o.height||t.height(e),o.bgcolor){var r=n.getContext("2d");r.fillStyle=o.bgcolor,r.fillRect(0,0,n.width,n.height)}return n}(e);return r.getContext("2d").drawImage(n,0,0),r}))}function l(e,o,n){return n||!o||o(e)?Promise.resolve(e).then((function(e){return e instanceof HTMLCanvasElement?t.makeImage(e.toDataURL()):e.cloneNode(!1)})).then((function(n){return function(e,o,n){var r=e.childNodes;return 0===r.length?Promise.resolve(o):function(e,t,o){var n=Promise.resolve();return t.forEach((function(t){n=n.then((function(){return l(t,o)})).then((function(t){t&&e.appendChild(t)}))})),n}(o,t.asArray(r),n).then((function(){return o}))}(e,n,o)})).then((function(o){return function(e,o){return o instanceof Element?Promise.resolve().then((function(){n=window.getComputedStyle(e),r=o.style,n.cssText?r.cssText=n.cssText:function(e,o){t.asArray(e).forEach((function(t){o.setProperty(t,e.getPropertyValue(t),e.getPropertyPriority(t))}))}(n,r);var n,r})).then((function(){[":before",":after"].forEach((function(n){!function(n){var r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(""!==i&&"none"!==i){var a=t.uid();o.className=o.className+" "+a;var s=document.createElement("style");s.appendChild(function(e,o,n){var r="."+e+":"+o,i=n.cssText?a(n):s(n);return document.createTextNode(r+"{"+i+"}");function a(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}function s(e){return t.asArray(e).map(o).join("; ")+";";function o(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")}}}(a,n,r)),o.appendChild(s)}}(n)}))})).then((function(){e instanceof HTMLTextAreaElement&&(o.innerHTML=e.value),e instanceof HTMLInputElement&&o.setAttribute("value",e.value)})).then((function(){o instanceof SVGElement&&(o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o instanceof SVGRectElement&&["width","height"].forEach((function(e){var t=o.getAttribute(e);t&&o.style.setProperty(e,t)})))})).then((function(){return o})):o}(e,o)})):Promise.resolve()}function u(e){return n.resolveAll().then((function(t){var o=document.createElement("style");return e.appendChild(o),o.appendChild(document.createTextNode(t)),e}))}function f(e){return r.inlineAll(e).then((function(){return e}))}e.exports=s}()},r(i={path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),i.exports);const s=class{constructor(t){e(this,t),this.handleSubmit=async e=>{e.preventDefault(),this.showScreenshotMode=!1,this.showModal=!1,this.sending=!0;let t="";this.encodedScreenshot&&await this.encodedScreenshot.then((e=>{t=e})).catch((e=>{console.log(e)}));try{200===(await fetch("https://app.pushfeedback.com/api/feedback/",{method:"POST",body:JSON.stringify({url:window.location.href,message:this.formMessage,email:this.formEmail,project:this.project,screenshot:t}),headers:{"Content-Type":"application/json"}})).status?(this.formSuccess=!0,this.formError=!1):(this.formSuccess=!1,this.formError=!0)}catch(e){this.formSuccess=!1,this.formError=!0}finally{this.sending=!1,this.showModal=!0}},this.close=()=>{this.sending=!1,this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.formSuccess=!1,this.formError=!1,this.formMessage="",this.formEmail=""},this.openScreenShot=()=>{this.hasSelectedElement=!1,this.showModal=!1,this.showScreenshotMode=!0,this.encodedScreenshot=null,document.getElementsByTagName("html")[0].style.overflow="auto"},this.closeScreenShot=()=>{this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.overlay.style.display="none",document.getElementsByTagName("html")[0].style.overflow="inherit"},this.handleMouseOverScreenShot=e=>{if(e.preventDefault(),this.hasSelectedElement)return;this.overlay.style.display="none",this.screenshotModal.style.display="none";const t=document.elementFromPoint(e.clientX,e.clientY).getBoundingClientRect();this.screenshotModal.style.display="",this.elementSelected.style.position="absolute",this.elementSelected.style.left=`${t.left}px`,this.elementSelected.style.top=`${t.top}px`,this.elementSelected.style.width=`${t.width}px`,this.elementSelected.style.height=`${t.height}px`,this.elementSelected.classList.add("feedback-modal-element-hover"),this.topSide.style.position="absolute",this.topSide.style.left=`${t.left}px`,this.topSide.style.top="0px",this.topSide.style.width=`${t.width+8}px`,this.topSide.style.height=`${t.top}px`,this.topSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.leftSide.style.position="absolute",this.leftSide.style.left="0px",this.leftSide.style.top="0px",this.leftSide.style.width=`${t.left}px`,this.leftSide.style.height="100vh",this.leftSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.bottomSide.style.position="absolute",this.bottomSide.style.left=`${t.left}px`,this.bottomSide.style.top=`${t.bottom+8}px`,this.bottomSide.style.width=`${t.width+8}px`,this.bottomSide.style.height="100vh",this.bottomSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.rightSide.style.position="absolute",this.rightSide.style.left=`${t.right+8}px`,this.rightSide.style.top="0px",this.rightSide.style.width="100%",this.rightSide.style.height="100vh",this.rightSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.screenshotModal.style.backgroundColor="transparent"},this.handleMouseClickedSelectedElement=e=>{e.preventDefault(),this.elementSelected&&this.elementSelected.classList.add("feedback-modal-element-selected");let t=this.elementSelected.getBoundingClientRect().top;this.elementSelected.style.top=`${t+window.pageYOffset}px`;const o=this.elementSelected.cloneNode(!0);document.body.appendChild(o),this.elementSelected.style.top=`${t}px`,this.encodedScreenshot=a.toPng(document.body,{cacheBust:!0}).then((function(e){return document.body.removeChild(o),e})).catch((function(e){return console.error("oops, something went wrong!",e),""})),document.getElementsByTagName("html")[0].style.overflow="hidden",this.hasSelectedElement=!0,this.overlay.style.display="block",this.showModal=!0},this.sending=!1,this.formMessage="",this.formEmail="",this.formSuccess=!1,this.formError=!1,this.encodedScreenshot=void 0,this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?",this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1}componentWillLoad(){this.formEmail=this.email}handleMessageInput(e){this.formMessage=e.target.value}handleEmailInput(e){this.formEmail=e.target.value}render(){return t("div",{class:"feedback-modal-wrapper"},this.showScreenshotMode&&t("div",{class:"feedback-modal-screenshot",ref:e=>this.screenshotModal=e,onMouseMove:this.handleMouseOverScreenShot},t("div",{class:"feedback-modal-screenshot-element-selected",ref:e=>this.elementSelected=e,onClick:this.handleMouseClickedSelectedElement}),t("div",{class:"top-side",ref:e=>this.topSide=e}),t("div",{class:"left-side",ref:e=>this.leftSide=e}),t("div",{class:"bottom-side",ref:e=>this.bottomSide=e}),t("div",{class:"right-side",ref:e=>this.rightSide=e}),t("div",{class:"feedback-modal-screenshot-header",onClick:this.closeScreenShot},t("span",null,this.screenshotTopbarText),t("span",{class:"feedback-modal-screenshot-close"},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),t("div",{class:"feedback-modal-screenshot-overlay",ref:e=>this.overlay=e})),this.showModal&&t("div",{class:`feedback-modal-content feedback-modal-content--${this.modalPosition}`,ref:e=>this.modalContent=e},t("div",{class:"feedback-modal-header"},this.formSuccess||this.formError?this.formSuccess?t("span",{class:"text-center"},this.successModalTitle):this.formError?t("span",{class:"text-center"},this.errorModalTitle):t("span",null):t("span",null,this.modalTitle),t("button",{class:"feedback-modal-close",onClick:this.close},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#ccc","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),t("div",{class:"feedback-modal-body"},this.formSuccess||this.formError?t("span",null):t("form",{onSubmit:this.handleSubmit},t("div",{class:"feedback-modal-text"},t("textarea",{placeholder:this.messagePlaceholder,value:this.formMessage,onInput:e=>this.handleMessageInput(e),required:!0})),!this.email&&t("div",{class:"feedback-modal-email"},t("input",{type:"email",placeholder:this.emailPlaceholder,onInput:e=>this.handleEmailInput(e),value:this.formEmail})),t("div",{class:"feedback-modal-buttons"},t("button",{type:"button",class:"button"+(this.encodedScreenshot?" active":""),title:this.screenshotButtonTooltipText,onClick:this.openScreenShot,disabled:this.sending},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-camera"},t("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),t("circle",{cx:"12",cy:"13",r:"4"}))),t("button",{class:"button",type:"submit",disabled:this.sending},this.sendButtonText)))),t("div",{class:"feedback-modal-footer"},t("div",{class:"feedback-logo"},t("svg",{class:"w-8 h-8",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},t("defs",null,t("radialGradient",{cx:"21.152%",cy:"86.063%",fx:"21.152%",fy:"86.063%",r:"79.941%",id:"footer-logo"},t("stop",{"stop-color":"#4FD1C5",offset:"0%"}),t("stop",{"stop-color":"#81E6D9",offset:"25.871%"}),t("stop",{"stop-color":"#338CF5",offset:"100%"}))),t("rect",{width:"32",height:"32",rx:"16",fill:"url(#footer-logo)","fill-rule":"nonzero"}))," ",t("a",{href:"https://pushfeedback.com"},"PushFeedback")))))}};s.style=".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300}.feedback-modal-content.feedback-modal-content--center{left:50%;top:50%;transform:translate(-50%, -50%)}.feedback-modal-content.feedback-modal-content--bottom-right{bottom:var(--feedback-modal-content-position-bottom);right:var(--feedback-modal-content-position-right)}.feedback-modal-content.feedback-modal-content--bottom-left{bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left)}.feedback-modal-content.feedback-modal-content--top-right{right:var(--feedback-modal-content-position-right);top:var(--fedback-modal-content-position-top)}.feedback-modal-content.feedback-modal-content--top-left{left:var(--feedback-modal-content-position-left);top:var(--fedback-modal-content-position-top)}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);font-family:var(--feedback-modal-header-font-family);display:flex;font-size:var(--feedback-header-font-size);justify-content:space-between;margin-bottom:20px}.feedback-modal-text{margin-bottom:20px}.feedback-modal-text textarea{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:100px;padding:10px;resize:none;width:100%}.feedback-modal-email{margin-bottom:20px}.feedback-modal-email input{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:40px;padding:10px;width:100%}.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;justify-content:space-between}.button{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;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.button:hover,.button.active{color:var(--feedback-modal-button-text-color-active);background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active)}.feedback-modal-footer{font-size:12px;margin-top:5px 0;text-align:center}.feedback-modal-footer a{color:#191919;text-decoration:none}.feedback-logo{display:flex;align-items:center;justify-content:center;margin-top:5px}.feedback-logo svg{max-width:12px;margin-right:5px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;margin-left:auto;padding:0;width:24px;height:24px}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);box-shadow:0px 0px 0px 5px var(--feedback-modal-screenshot-element-selected-bg-color) inset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);color:var(--feedback-modal-screenshot-element-selected-text-color);cursor:pointer;display:flex;padding:5px;position:fixed;justify-content:center;width:100%;z-index:200}.feedback-modal-screenshot-header span{padding-left:10px;padding-right:10px}.feedback-modal-screenshot-overlay{background-color:transparent;cursor:unset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-message{font-size:var(--fedback-modal-message-font-size)}.feedback-modal-element-hover{cursor:pointer;background-color:transparent;border:4px dashed var(--feedback-modal-screenshot-element-hover-border-color)}.feedback-modal-element-selected{border:4px solid var(--feedback-modal-screenshot-element-selected-border-color)}";export{n as feedback_button,s as feedback_modal}
|