pushfeedback 0.1.55 → 0.1.56
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 +5 -3
- package/dist/collection/components/feedback-button/feedback-button.js +36 -3
- package/dist/components/feedback-button.js +6 -4
- package/dist/esm/feedback-button_2.entry.js +6 -4
- package/dist/pushfeedback/{p-366db9ef.entry.js → p-6f061be2.entry.js} +2 -2
- package/dist/pushfeedback/pushfeedback.esm.js +1 -1
- package/dist/types/components/feedback-button/feedback-button.d.ts +7 -0
- package/dist/types/components.d.ts +6 -0
- package/package.json +1 -1
|
@@ -9,6 +9,8 @@ const feedbackButtonCss = ".feedback-button-content{cursor:pointer;max-width:fit
|
|
|
9
9
|
const FeedbackButton = class {
|
|
10
10
|
constructor(hostRef) {
|
|
11
11
|
index.registerInstance(this, hostRef);
|
|
12
|
+
this.feedbackSent = index.createEvent(this, "feedbackSent", 7);
|
|
13
|
+
this.feedbackError = index.createEvent(this, "feedbackError", 7);
|
|
12
14
|
this.sessionId = "";
|
|
13
15
|
this.customFont = false;
|
|
14
16
|
this.errorMessage = "Please try again later.";
|
|
@@ -144,7 +146,7 @@ const FeedbackButton = class {
|
|
|
144
146
|
});
|
|
145
147
|
if (res.status === 201) {
|
|
146
148
|
const feedback_with_id = Object.assign(Object.assign({}, body), { id: await res.json() });
|
|
147
|
-
this.
|
|
149
|
+
this.feedbackSent.emit({ feedback: feedback_with_id });
|
|
148
150
|
}
|
|
149
151
|
else {
|
|
150
152
|
const errorText = await res.text();
|
|
@@ -152,7 +154,7 @@ const FeedbackButton = class {
|
|
|
152
154
|
status: res.status,
|
|
153
155
|
message: errorText,
|
|
154
156
|
};
|
|
155
|
-
this.
|
|
157
|
+
this.feedbackError.emit({ error: response });
|
|
156
158
|
}
|
|
157
159
|
}
|
|
158
160
|
catch (error) {
|
|
@@ -160,7 +162,7 @@ const FeedbackButton = class {
|
|
|
160
162
|
status: 500,
|
|
161
163
|
message: error,
|
|
162
164
|
};
|
|
163
|
-
this.
|
|
165
|
+
this.feedbackError.emit({ error: response });
|
|
164
166
|
}
|
|
165
167
|
}
|
|
166
168
|
render() {
|
|
@@ -136,7 +136,7 @@ export class FeedbackButton {
|
|
|
136
136
|
});
|
|
137
137
|
if (res.status === 201) {
|
|
138
138
|
const feedback_with_id = Object.assign(Object.assign({}, body), { id: await res.json() });
|
|
139
|
-
this.
|
|
139
|
+
this.feedbackSent.emit({ feedback: feedback_with_id });
|
|
140
140
|
}
|
|
141
141
|
else {
|
|
142
142
|
const errorText = await res.text();
|
|
@@ -144,7 +144,7 @@ export class FeedbackButton {
|
|
|
144
144
|
status: res.status,
|
|
145
145
|
message: errorText,
|
|
146
146
|
};
|
|
147
|
-
this.
|
|
147
|
+
this.feedbackError.emit({ error: response });
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
catch (error) {
|
|
@@ -152,7 +152,7 @@ export class FeedbackButton {
|
|
|
152
152
|
status: 500,
|
|
153
153
|
message: error,
|
|
154
154
|
};
|
|
155
|
-
this.
|
|
155
|
+
this.feedbackError.emit({ error: response });
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
render() {
|
|
@@ -749,5 +749,38 @@ export class FeedbackButton {
|
|
|
749
749
|
}
|
|
750
750
|
};
|
|
751
751
|
}
|
|
752
|
+
static get events() {
|
|
753
|
+
return [{
|
|
754
|
+
"method": "feedbackSent",
|
|
755
|
+
"name": "feedbackSent",
|
|
756
|
+
"bubbles": true,
|
|
757
|
+
"cancelable": true,
|
|
758
|
+
"composed": true,
|
|
759
|
+
"docs": {
|
|
760
|
+
"tags": [],
|
|
761
|
+
"text": ""
|
|
762
|
+
},
|
|
763
|
+
"complexType": {
|
|
764
|
+
"original": "{ feedback: any }",
|
|
765
|
+
"resolved": "{ feedback: any; }",
|
|
766
|
+
"references": {}
|
|
767
|
+
}
|
|
768
|
+
}, {
|
|
769
|
+
"method": "feedbackError",
|
|
770
|
+
"name": "feedbackError",
|
|
771
|
+
"bubbles": true,
|
|
772
|
+
"cancelable": true,
|
|
773
|
+
"composed": true,
|
|
774
|
+
"docs": {
|
|
775
|
+
"tags": [],
|
|
776
|
+
"text": ""
|
|
777
|
+
},
|
|
778
|
+
"complexType": {
|
|
779
|
+
"original": "{ error: any }",
|
|
780
|
+
"resolved": "{ error: any; }",
|
|
781
|
+
"references": {}
|
|
782
|
+
}
|
|
783
|
+
}];
|
|
784
|
+
}
|
|
752
785
|
static get elementRef() { return "el"; }
|
|
753
786
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$2 } from './feedback-modal2.js';
|
|
3
3
|
|
|
4
4
|
const feedbackButtonCss = ".feedback-button-content{cursor:pointer;max-width:fit-content;z-index:var(--feedback-button-z-index);font-family:var(--feedback-font-family)}.feedback-button-content--custom-font{font-family:inherit}.feedback-button-content--light{align-items:center;background-color:var(--feedback-button-light-bg-color);border-radius:var(--feedback-button-border-radius);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;color:var(--feedback-button-light-text-color);display:flex;font-size:var(--feedback-button-text-font-size);font-weight:var(--feedback-button-text-font-weight);padding:8px 15px}.feedback-button-content--dark{align-items:center;background-color:var(--feedback-button-dark-bg-color);border-radius:var(--feedback-button-border-radius);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;color:var(--feedback-button-dark-text-color);display:flex;font-weight:var(--feedback-button-text-font-weight);font-size:var(--feedback-button-text-font-size);padding:8px 15px}.icon-edit{stroke:var(--feedback-button-light-icon-color)}.feedback-button-content--dark .icon-edit{stroke:var(--feedback-button-dark-icon-color)}.feedback-button-content--bottom-right{bottom:10px;position:fixed;right:10px}.feedback-button-content--center-right{position:fixed;transform:rotate(-90deg) translateY(-50%);top:50%}.feedback-button-content--center-right.feedback-button-content--dark,.feedback-button-content--center-right.feedback-button-content--light{border-radius:4px;border-bottom-left-radius:0px;border-bottom-right-radius:0px}.feedback-button-content-icon{height:16px;margin-right:5px;width:16px}.feedback-button-content--center-right .feedback-button-content-icon{rotate:90deg}";
|
|
@@ -8,6 +8,8 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
8
8
|
super();
|
|
9
9
|
this.__registerHost();
|
|
10
10
|
this.__attachShadow();
|
|
11
|
+
this.feedbackSent = createEvent(this, "feedbackSent", 7);
|
|
12
|
+
this.feedbackError = createEvent(this, "feedbackError", 7);
|
|
11
13
|
this.sessionId = "";
|
|
12
14
|
this.customFont = false;
|
|
13
15
|
this.errorMessage = "Please try again later.";
|
|
@@ -143,7 +145,7 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
143
145
|
});
|
|
144
146
|
if (res.status === 201) {
|
|
145
147
|
const feedback_with_id = Object.assign(Object.assign({}, body), { id: await res.json() });
|
|
146
|
-
this.
|
|
148
|
+
this.feedbackSent.emit({ feedback: feedback_with_id });
|
|
147
149
|
}
|
|
148
150
|
else {
|
|
149
151
|
const errorText = await res.text();
|
|
@@ -151,7 +153,7 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
151
153
|
status: res.status,
|
|
152
154
|
message: errorText,
|
|
153
155
|
};
|
|
154
|
-
this.
|
|
156
|
+
this.feedbackError.emit({ error: response });
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
159
|
catch (error) {
|
|
@@ -159,7 +161,7 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
159
161
|
status: 500,
|
|
160
162
|
message: error,
|
|
161
163
|
};
|
|
162
|
-
this.
|
|
164
|
+
this.feedbackError.emit({ error: response });
|
|
163
165
|
}
|
|
164
166
|
}
|
|
165
167
|
render() {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-f65e9124.js';
|
|
2
2
|
|
|
3
3
|
const feedbackButtonCss = ".feedback-button-content{cursor:pointer;max-width:fit-content;z-index:var(--feedback-button-z-index);font-family:var(--feedback-font-family)}.feedback-button-content--custom-font{font-family:inherit}.feedback-button-content--light{align-items:center;background-color:var(--feedback-button-light-bg-color);border-radius:var(--feedback-button-border-radius);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;color:var(--feedback-button-light-text-color);display:flex;font-size:var(--feedback-button-text-font-size);font-weight:var(--feedback-button-text-font-weight);padding:8px 15px}.feedback-button-content--dark{align-items:center;background-color:var(--feedback-button-dark-bg-color);border-radius:var(--feedback-button-border-radius);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;color:var(--feedback-button-dark-text-color);display:flex;font-weight:var(--feedback-button-text-font-weight);font-size:var(--feedback-button-text-font-size);padding:8px 15px}.icon-edit{stroke:var(--feedback-button-light-icon-color)}.feedback-button-content--dark .icon-edit{stroke:var(--feedback-button-dark-icon-color)}.feedback-button-content--bottom-right{bottom:10px;position:fixed;right:10px}.feedback-button-content--center-right{position:fixed;transform:rotate(-90deg) translateY(-50%);top:50%}.feedback-button-content--center-right.feedback-button-content--dark,.feedback-button-content--center-right.feedback-button-content--light{border-radius:4px;border-bottom-left-radius:0px;border-bottom-right-radius:0px}.feedback-button-content-icon{height:16px;margin-right:5px;width:16px}.feedback-button-content--center-right .feedback-button-content-icon{rotate:90deg}";
|
|
4
4
|
|
|
5
5
|
const FeedbackButton = class {
|
|
6
6
|
constructor(hostRef) {
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
|
+
this.feedbackSent = createEvent(this, "feedbackSent", 7);
|
|
9
|
+
this.feedbackError = createEvent(this, "feedbackError", 7);
|
|
8
10
|
this.sessionId = "";
|
|
9
11
|
this.customFont = false;
|
|
10
12
|
this.errorMessage = "Please try again later.";
|
|
@@ -140,7 +142,7 @@ const FeedbackButton = class {
|
|
|
140
142
|
});
|
|
141
143
|
if (res.status === 201) {
|
|
142
144
|
const feedback_with_id = Object.assign(Object.assign({}, body), { id: await res.json() });
|
|
143
|
-
this.
|
|
145
|
+
this.feedbackSent.emit({ feedback: feedback_with_id });
|
|
144
146
|
}
|
|
145
147
|
else {
|
|
146
148
|
const errorText = await res.text();
|
|
@@ -148,7 +150,7 @@ const FeedbackButton = class {
|
|
|
148
150
|
status: res.status,
|
|
149
151
|
message: errorText,
|
|
150
152
|
};
|
|
151
|
-
this.
|
|
153
|
+
this.feedbackError.emit({ error: response });
|
|
152
154
|
}
|
|
153
155
|
}
|
|
154
156
|
catch (error) {
|
|
@@ -156,7 +158,7 @@ const FeedbackButton = class {
|
|
|
156
158
|
status: 500,
|
|
157
159
|
message: error,
|
|
158
160
|
};
|
|
159
|
-
this.
|
|
161
|
+
this.feedbackError.emit({ error: response });
|
|
160
162
|
}
|
|
161
163
|
}
|
|
162
164
|
render() {
|