pushfeedback 0.1.40 → 0.1.42

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.
@@ -2,13 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-a717311c.js');
5
+ const index = require('./index-b596cc3a.js');
6
6
 
7
7
  const feedbackButtonCss = ".feedback-button-content{cursor:pointer;max-width:fit-content;z-index:var(--feedback-button-z-index)}.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-family:var(--feedback-font-family);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-family:var(--feedback-font-family);font-weight:var(--feedback-button-text-font-weight);font-size:var(--feedback-button-text-font-size);padding:8px 15px}.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
8
 
9
9
  const FeedbackButton = class {
10
10
  constructor(hostRef) {
11
11
  index.registerInstance(this, hostRef);
12
+ this.sessionId = "";
12
13
  this.customFont = false;
13
14
  this.errorMessage = "Please try again later.";
14
15
  this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
@@ -42,6 +43,7 @@ const FeedbackButton = class {
42
43
  connectedCallback() {
43
44
  this.feedbackModal = document.createElement('feedback-modal');
44
45
  const props = [
46
+ 'sessionId',
45
47
  'customFont',
46
48
  'errorMessage',
47
49
  'errorMessage403',
@@ -7986,6 +7988,7 @@ const FeedbackModal = class {
7986
7988
  rating: this.selectedRating,
7987
7989
  ratingMode: this.ratingMode,
7988
7990
  verification: this.formVerification,
7991
+ session: this.session,
7989
7992
  }),
7990
7993
  headers: {
7991
7994
  'Content-Type': 'application/json'
@@ -8141,6 +8144,8 @@ const FeedbackModal = class {
8141
8144
  this.isPrivacyChecked = false;
8142
8145
  this.whitelabel = false;
8143
8146
  this.selectedRating = 0;
8147
+ this.session = '';
8148
+ this.sessionId = "";
8144
8149
  this.errorMessage = "Please try again later.";
8145
8150
  this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
8146
8151
  this.errorMessage404 = "We could not find the provided project ID in PushFeedback.";
@@ -8175,6 +8180,13 @@ const FeedbackModal = class {
8175
8180
  if (this.fetchData)
8176
8181
  this.fetchProjectData();
8177
8182
  this.formEmail = this.emailAddress;
8183
+ if (!this.sessionId) {
8184
+ this.session = this.generateRandomSessionId();
8185
+ }
8186
+ else {
8187
+ this.session = this.sessionId;
8188
+ }
8189
+ console.log(this.session);
8178
8190
  if (this.rating) {
8179
8191
  this.selectedRating = this.rating;
8180
8192
  }
@@ -8192,6 +8204,9 @@ const FeedbackModal = class {
8192
8204
  console.log(error);
8193
8205
  }
8194
8206
  }
8207
+ generateRandomSessionId(length = 16) {
8208
+ return Math.random().toString(36).substr(2, length);
8209
+ }
8195
8210
  resetOverflow() {
8196
8211
  document.documentElement.classList.remove('feedback-modal-screenshot-open');
8197
8212
  document.documentElement.classList.remove('feedback-modal-screenshot-open--scroll');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-a717311c.js');
5
+ const index = require('./index-b596cc3a.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
@@ -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",{"customFont":[4,"custom-font"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"buttonStyle":[1,"button-style"],"buttonPosition":[1,"button-position"],"hideIcon":[4,"hide-icon"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"]}],[1,"feedback-modal",{"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"hasSelectedElement":[1540,"has-selected-element"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formVerification":[32],"formError":[32],"formErrorStatus":[32],"encodedScreenshot":[32],"isPrivacyChecked":[32],"whitelabel":[32],"selectedRating":[32]}]]]], options);
17
+ return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"sessionId":[1,"session-id"],"customFont":[4,"custom-font"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"buttonStyle":[1,"button-style"],"buttonPosition":[1,"button-position"],"hideIcon":[4,"hide-icon"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"]}],[1,"feedback-modal",{"sessionId":[1,"session-id"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"hasSelectedElement":[1540,"has-selected-element"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formVerification":[32],"formError":[32],"formErrorStatus":[32],"encodedScreenshot":[32],"isPrivacyChecked":[32],"whitelabel":[32],"selectedRating":[32],"session":[32]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-a717311c.js');
5
+ const index = require('./index-b596cc3a.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
@@ -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",{"customFont":[4,"custom-font"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"buttonStyle":[1,"button-style"],"buttonPosition":[1,"button-position"],"hideIcon":[4,"hide-icon"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"]}],[1,"feedback-modal",{"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"hasSelectedElement":[1540,"has-selected-element"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formVerification":[32],"formError":[32],"formErrorStatus":[32],"encodedScreenshot":[32],"isPrivacyChecked":[32],"whitelabel":[32],"selectedRating":[32]}]]]], options);
20
+ return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"sessionId":[1,"session-id"],"customFont":[4,"custom-font"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"buttonStyle":[1,"button-style"],"buttonPosition":[1,"button-position"],"hideIcon":[4,"hide-icon"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"]}],[1,"feedback-modal",{"sessionId":[1,"session-id"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"hasSelectedElement":[1540,"has-selected-element"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formVerification":[32],"formError":[32],"formErrorStatus":[32],"encodedScreenshot":[32],"isPrivacyChecked":[32],"whitelabel":[32],"selectedRating":[32],"session":[32]}]]]], options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;
@@ -1,6 +1,7 @@
1
1
  import { Host, h } from '@stencil/core';
2
2
  export class FeedbackButton {
3
3
  constructor() {
4
+ this.sessionId = "";
4
5
  this.customFont = false;
5
6
  this.errorMessage = "Please try again later.";
6
7
  this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
@@ -34,6 +35,7 @@ export class FeedbackButton {
34
35
  connectedCallback() {
35
36
  this.feedbackModal = document.createElement('feedback-modal');
36
37
  const props = [
38
+ 'sessionId',
37
39
  'customFont',
38
40
  'errorMessage',
39
41
  'errorMessage403',
@@ -112,6 +114,24 @@ export class FeedbackButton {
112
114
  }
113
115
  static get properties() {
114
116
  return {
117
+ "sessionId": {
118
+ "type": "string",
119
+ "mutable": false,
120
+ "complexType": {
121
+ "original": "string",
122
+ "resolved": "string",
123
+ "references": {}
124
+ },
125
+ "required": false,
126
+ "optional": false,
127
+ "docs": {
128
+ "tags": [],
129
+ "text": ""
130
+ },
131
+ "attribute": "session-id",
132
+ "reflect": false,
133
+ "defaultValue": "\"\""
134
+ },
115
135
  "customFont": {
116
136
  "type": "boolean",
117
137
  "mutable": false,
@@ -29,6 +29,7 @@ export class FeedbackModal {
29
29
  rating: this.selectedRating,
30
30
  ratingMode: this.ratingMode,
31
31
  verification: this.formVerification,
32
+ session: this.session,
32
33
  }),
33
34
  headers: {
34
35
  'Content-Type': 'application/json'
@@ -185,6 +186,8 @@ export class FeedbackModal {
185
186
  this.isPrivacyChecked = false;
186
187
  this.whitelabel = false;
187
188
  this.selectedRating = 0;
189
+ this.session = '';
190
+ this.sessionId = "";
188
191
  this.errorMessage = "Please try again later.";
189
192
  this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
190
193
  this.errorMessage404 = "We could not find the provided project ID in PushFeedback.";
@@ -219,6 +222,13 @@ export class FeedbackModal {
219
222
  if (this.fetchData)
220
223
  this.fetchProjectData();
221
224
  this.formEmail = this.emailAddress;
225
+ if (!this.sessionId) {
226
+ this.session = this.generateRandomSessionId();
227
+ }
228
+ else {
229
+ this.session = this.sessionId;
230
+ }
231
+ console.log(this.session);
222
232
  if (this.rating) {
223
233
  this.selectedRating = this.rating;
224
234
  }
@@ -236,6 +246,9 @@ export class FeedbackModal {
236
246
  console.log(error);
237
247
  }
238
248
  }
249
+ generateRandomSessionId(length = 16) {
250
+ return Math.random().toString(36).substr(2, length);
251
+ }
239
252
  resetOverflow() {
240
253
  document.documentElement.classList.remove('feedback-modal-screenshot-open');
241
254
  document.documentElement.classList.remove('feedback-modal-screenshot-open--scroll');
@@ -303,6 +316,24 @@ export class FeedbackModal {
303
316
  }
304
317
  static get properties() {
305
318
  return {
319
+ "sessionId": {
320
+ "type": "string",
321
+ "mutable": false,
322
+ "complexType": {
323
+ "original": "string",
324
+ "resolved": "string",
325
+ "references": {}
326
+ },
327
+ "required": false,
328
+ "optional": false,
329
+ "docs": {
330
+ "tags": [],
331
+ "text": ""
332
+ },
333
+ "attribute": "session-id",
334
+ "reflect": false,
335
+ "defaultValue": "\"\""
336
+ },
306
337
  "errorMessage": {
307
338
  "type": "string",
308
339
  "mutable": false,
@@ -838,7 +869,8 @@ export class FeedbackModal {
838
869
  "encodedScreenshot": {},
839
870
  "isPrivacyChecked": {},
840
871
  "whitelabel": {},
841
- "selectedRating": {}
872
+ "selectedRating": {},
873
+ "session": {}
842
874
  };
843
875
  }
844
876
  }
@@ -8,6 +8,7 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
8
8
  super();
9
9
  this.__registerHost();
10
10
  this.__attachShadow();
11
+ this.sessionId = "";
11
12
  this.customFont = false;
12
13
  this.errorMessage = "Please try again later.";
13
14
  this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
@@ -41,6 +42,7 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
41
42
  connectedCallback() {
42
43
  this.feedbackModal = document.createElement('feedback-modal');
43
44
  const props = [
45
+ 'sessionId',
44
46
  'customFont',
45
47
  'errorMessage',
46
48
  'errorMessage403',
@@ -108,6 +110,7 @@ const FeedbackButton$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
108
110
  get el() { return this; }
109
111
  static get style() { return feedbackButtonCss; }
110
112
  }, [1, "feedback-button", {
113
+ "sessionId": [1, "session-id"],
111
114
  "customFont": [4, "custom-font"],
112
115
  "errorMessage": [1, "error-message"],
113
116
  "errorMessage403": [1, "error-message-4-0-3"],
@@ -7878,6 +7878,7 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
7878
7878
  rating: this.selectedRating,
7879
7879
  ratingMode: this.ratingMode,
7880
7880
  verification: this.formVerification,
7881
+ session: this.session,
7881
7882
  }),
7882
7883
  headers: {
7883
7884
  'Content-Type': 'application/json'
@@ -8033,6 +8034,8 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
8033
8034
  this.isPrivacyChecked = false;
8034
8035
  this.whitelabel = false;
8035
8036
  this.selectedRating = 0;
8037
+ this.session = '';
8038
+ this.sessionId = "";
8036
8039
  this.errorMessage = "Please try again later.";
8037
8040
  this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
8038
8041
  this.errorMessage404 = "We could not find the provided project ID in PushFeedback.";
@@ -8067,6 +8070,13 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
8067
8070
  if (this.fetchData)
8068
8071
  this.fetchProjectData();
8069
8072
  this.formEmail = this.emailAddress;
8073
+ if (!this.sessionId) {
8074
+ this.session = this.generateRandomSessionId();
8075
+ }
8076
+ else {
8077
+ this.session = this.sessionId;
8078
+ }
8079
+ console.log(this.session);
8070
8080
  if (this.rating) {
8071
8081
  this.selectedRating = this.rating;
8072
8082
  }
@@ -8084,6 +8094,9 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
8084
8094
  console.log(error);
8085
8095
  }
8086
8096
  }
8097
+ generateRandomSessionId(length = 16) {
8098
+ return Math.random().toString(36).substr(2, length);
8099
+ }
8087
8100
  resetOverflow() {
8088
8101
  document.documentElement.classList.remove('feedback-modal-screenshot-open');
8089
8102
  document.documentElement.classList.remove('feedback-modal-screenshot-open--scroll');
@@ -8139,6 +8152,7 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
8139
8152
  }
8140
8153
  static get style() { return feedbackModalCss; }
8141
8154
  }, [1, "feedback-modal", {
8155
+ "sessionId": [1, "session-id"],
8142
8156
  "errorMessage": [1, "error-message"],
8143
8157
  "errorMessage403": [1, "error-message-4-0-3"],
8144
8158
  "errorMessage404": [1, "error-message-4-0-4"],
@@ -8178,7 +8192,8 @@ const FeedbackModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
8178
8192
  "encodedScreenshot": [32],
8179
8193
  "isPrivacyChecked": [32],
8180
8194
  "whitelabel": [32],
8181
- "selectedRating": [32]
8195
+ "selectedRating": [32],
8196
+ "session": [32]
8182
8197
  }]);
8183
8198
  function defineCustomElement() {
8184
8199
  if (typeof customElements === "undefined") {
@@ -1,10 +1,11 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-37061d71.js';
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-deb00b84.js';
2
2
 
3
3
  const feedbackButtonCss = ".feedback-button-content{cursor:pointer;max-width:fit-content;z-index:var(--feedback-button-z-index)}.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-family:var(--feedback-font-family);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-family:var(--feedback-font-family);font-weight:var(--feedback-button-text-font-weight);font-size:var(--feedback-button-text-font-size);padding:8px 15px}.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.sessionId = "";
8
9
  this.customFont = false;
9
10
  this.errorMessage = "Please try again later.";
10
11
  this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
@@ -38,6 +39,7 @@ const FeedbackButton = class {
38
39
  connectedCallback() {
39
40
  this.feedbackModal = document.createElement('feedback-modal');
40
41
  const props = [
42
+ 'sessionId',
41
43
  'customFont',
42
44
  'errorMessage',
43
45
  'errorMessage403',
@@ -7982,6 +7984,7 @@ const FeedbackModal = class {
7982
7984
  rating: this.selectedRating,
7983
7985
  ratingMode: this.ratingMode,
7984
7986
  verification: this.formVerification,
7987
+ session: this.session,
7985
7988
  }),
7986
7989
  headers: {
7987
7990
  'Content-Type': 'application/json'
@@ -8137,6 +8140,8 @@ const FeedbackModal = class {
8137
8140
  this.isPrivacyChecked = false;
8138
8141
  this.whitelabel = false;
8139
8142
  this.selectedRating = 0;
8143
+ this.session = '';
8144
+ this.sessionId = "";
8140
8145
  this.errorMessage = "Please try again later.";
8141
8146
  this.errorMessage403 = "The request URL does not match the one defined in PushFeedback for this project.";
8142
8147
  this.errorMessage404 = "We could not find the provided project ID in PushFeedback.";
@@ -8171,6 +8176,13 @@ const FeedbackModal = class {
8171
8176
  if (this.fetchData)
8172
8177
  this.fetchProjectData();
8173
8178
  this.formEmail = this.emailAddress;
8179
+ if (!this.sessionId) {
8180
+ this.session = this.generateRandomSessionId();
8181
+ }
8182
+ else {
8183
+ this.session = this.sessionId;
8184
+ }
8185
+ console.log(this.session);
8174
8186
  if (this.rating) {
8175
8187
  this.selectedRating = this.rating;
8176
8188
  }
@@ -8188,6 +8200,9 @@ const FeedbackModal = class {
8188
8200
  console.log(error);
8189
8201
  }
8190
8202
  }
8203
+ generateRandomSessionId(length = 16) {
8204
+ return Math.random().toString(36).substr(2, length);
8205
+ }
8191
8206
  resetOverflow() {
8192
8207
  document.documentElement.classList.remove('feedback-modal-screenshot-open');
8193
8208
  document.documentElement.classList.remove('feedback-modal-screenshot-open--scroll');
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-37061d71.js';
2
- export { s as setNonce } from './index-37061d71.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-deb00b84.js';
2
+ export { s as setNonce } from './index-deb00b84.js';
3
3
 
4
4
  /*
5
5
  Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
@@ -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",{"customFont":[4,"custom-font"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"buttonStyle":[1,"button-style"],"buttonPosition":[1,"button-position"],"hideIcon":[4,"hide-icon"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"]}],[1,"feedback-modal",{"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"hasSelectedElement":[1540,"has-selected-element"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formVerification":[32],"formError":[32],"formErrorStatus":[32],"encodedScreenshot":[32],"isPrivacyChecked":[32],"whitelabel":[32],"selectedRating":[32]}]]]], options);
14
+ return bootstrapLazy([["feedback-button_2",[[1,"feedback-button",{"sessionId":[1,"session-id"],"customFont":[4,"custom-font"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"buttonStyle":[1,"button-style"],"buttonPosition":[1,"button-position"],"hideIcon":[4,"hide-icon"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"]}],[1,"feedback-modal",{"sessionId":[1,"session-id"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"hasSelectedElement":[1540,"has-selected-element"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formVerification":[32],"formError":[32],"formErrorStatus":[32],"encodedScreenshot":[32],"isPrivacyChecked":[32],"whitelabel":[32],"selectedRating":[32],"session":[32]}]]]], options);
15
15
  });
16
16
  };
17
17
 
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-37061d71.js';
2
- export { s as setNonce } from './index-37061d71.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-deb00b84.js';
2
+ export { s as setNonce } from './index-deb00b84.js';
3
3
 
4
4
  /*
5
5
  Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
@@ -14,5 +14,5 @@ const patchBrowser = () => {
14
14
  };
15
15
 
16
16
  patchBrowser().then(options => {
17
- return bootstrapLazy([["feedback-button_2",[[1,"feedback-button",{"customFont":[4,"custom-font"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"buttonStyle":[1,"button-style"],"buttonPosition":[1,"button-position"],"hideIcon":[4,"hide-icon"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"]}],[1,"feedback-modal",{"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"hasSelectedElement":[1540,"has-selected-element"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formVerification":[32],"formError":[32],"formErrorStatus":[32],"encodedScreenshot":[32],"isPrivacyChecked":[32],"whitelabel":[32],"selectedRating":[32]}]]]], options);
17
+ return bootstrapLazy([["feedback-button_2",[[1,"feedback-button",{"sessionId":[1,"session-id"],"customFont":[4,"custom-font"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"buttonStyle":[1,"button-style"],"buttonPosition":[1,"button-position"],"hideIcon":[4,"hide-icon"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"]}],[1,"feedback-modal",{"sessionId":[1,"session-id"],"errorMessage":[1,"error-message"],"errorMessage403":[1,"error-message-4-0-3"],"errorMessage404":[1,"error-message-4-0-4"],"modalTitle":[1,"modal-title"],"modalTitleSuccess":[1,"modal-title-success"],"modalTitleError":[1,"modal-title-error"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"successMessage":[1,"success-message"],"project":[1],"screenshotButtonText":[1,"screenshot-button-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"hideEmail":[4,"hide-email"],"emailAddress":[1,"email-address"],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"hideRating":[4,"hide-rating"],"rating":[2],"ratingMode":[1,"rating-mode"],"ratingPlaceholder":[1,"rating-placeholder"],"ratingStarsPlaceholder":[1,"rating-stars-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"showScreenshotTopBar":[1540,"show-screenshot-top-bar"],"hasSelectedElement":[1540,"has-selected-element"],"hideScreenshotButton":[4,"hide-screenshot-button"],"hidePrivacyPolicy":[4,"hide-privacy-policy"],"privacyPolicyText":[1,"privacy-policy-text"],"fetchData":[4,"fetch-data"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formVerification":[32],"formError":[32],"formErrorStatus":[32],"encodedScreenshot":[32],"isPrivacyChecked":[32],"whitelabel":[32],"selectedRating":[32],"session":[32]}]]]], options);
18
18
  });