@fullsession.io/fs-feedback-widget 1.14.0 → 1.16.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullsession.io/fs-feedback-widget",
3
- "version": "1.14.0",
3
+ "version": "1.16.0",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "dev": "rollup -c -w",
package/src/App.svelte CHANGED
@@ -220,6 +220,14 @@
220
220
  setTimeout(function () {
221
221
  buttonVisible = !buttonVisible;
222
222
  }, 350);
223
+
224
+ let doneEvent = new CustomEvent("fbEventDone", {
225
+ bubbles: false,
226
+ detail: {
227
+ id: widgetId,
228
+ },
229
+ });
230
+ window.dispatchEvent(doneEvent);
223
231
  };
224
232
 
225
233
  const openWidget = () => {
@@ -59,6 +59,8 @@
59
59
  let buttonState = false;
60
60
  let emailError = "";
61
61
  let checkTextAreaInterval;
62
+ let commentCharCount = 0;
63
+ let questionCharCount = 0;
62
64
 
63
65
  export let closeHandler = (
64
66
  email,
@@ -78,6 +80,7 @@
78
80
  }
79
81
  comment = "";
80
82
  comment = input.value;
83
+ commentCharCount = input.value.length;
81
84
  };
82
85
 
83
86
  // Ultra-fast email handler - just updates value, no validation during typing
@@ -184,12 +187,14 @@
184
187
  }
185
188
  questionAnswer = "";
186
189
  questionAnswer = input.value;
190
+ questionCharCount = input.value.length;
187
191
  };
188
192
 
189
193
  const openEmailCont = (state) => {
190
194
  clearInterval(checkTextAreaInterval);
191
195
  document.querySelector(".fsTextArea").value = "";
192
196
  buttonState = false;
197
+ commentCharCount = 0;
193
198
  if (widgetEmailComponentActivation) {
194
199
  widgetComponent = state;
195
200
  } else {
@@ -201,6 +206,7 @@
201
206
  clearInterval(checkTextAreaInterval);
202
207
  document.querySelector(".fsAnswerTextArea").value = "";
203
208
  buttonState = false;
209
+ questionCharCount = 0;
204
210
  if (widgetEmailComponentActivation) {
205
211
  widgetComponent = state;
206
212
  } else {
@@ -269,8 +275,10 @@
269
275
  <textarea
270
276
  class="fsAnswerTextArea"
271
277
  placeholder="Answer Here..."
278
+ maxlength="300"
272
279
  on:keyup={() => questionHandler()}
273
280
  />
281
+ <div class="fsCharCounter">{questionCharCount}/300</div>
274
282
  </div>
275
283
  <div class="fsFooter">
276
284
  {#if buttonState == false}
@@ -367,8 +375,10 @@
367
375
  <textarea
368
376
  class="fsTextArea"
369
377
  placeholder={widgetPlaceholder}
378
+ maxlength="300"
370
379
  on:keyup={() => commentHandler()}
371
380
  />
381
+ <div class="fsCharCounter">{commentCharCount}/300</div>
372
382
  </div>
373
383
 
374
384
  <div class="fsFooter">
@@ -392,8 +402,10 @@
392
402
  <textarea
393
403
  class="fsTextArea"
394
404
  placeholder="Answer Here..."
405
+ maxlength="300"
395
406
  on:keyup={() => commentHandler()}
396
407
  />
408
+ <div class="fsCharCounter">{commentCharCount}/300</div>
397
409
  </div>
398
410
 
399
411
  <div class="fsFooter">
@@ -17,7 +17,6 @@
17
17
  padding-bottom: 45px;
18
18
  padding-left: 5px;
19
19
  padding-right: 5px;
20
- flex-wrap: wrap;
21
20
  }
22
21
 
23
22
  #fsTxt {
@@ -114,6 +113,7 @@
114
113
  margin-top: 25px;
115
114
  font-family: "Montserrat", sans-serif;
116
115
  box-sizing: border-box;
116
+ position: relative;
117
117
  }
118
118
 
119
119
  .fsTextAreaCont-qa-view {
@@ -124,6 +124,18 @@
124
124
  margin-top: 10px;
125
125
  font-family: "Montserrat", sans-serif;
126
126
  box-sizing: border-box;
127
+ position: relative;
128
+ }
129
+
130
+ .fsCharCounter {
131
+ position: absolute;
132
+ bottom: 8px;
133
+ right: 20px;
134
+ font-family: "Montserrat", sans-serif;
135
+ font-size: 11px;
136
+ color: #6d6d6d;
137
+ pointer-events: none;
138
+ user-select: none;
127
139
  }
128
140
 
129
141
  .fsTextArea,
@@ -205,7 +217,6 @@
205
217
  padding-left: 5px;
206
218
  padding-right: 5px;
207
219
  font-family: "Montserrat", sans-serif;
208
- flex-wrap: wrap;
209
220
  }
210
221
 
211
222
  .fsPointerDiv {
@@ -341,8 +352,6 @@
341
352
  .fsNpsNumbers {
342
353
  display: flex;
343
354
  justify-content: space-between;
344
- flex-wrap: wrap;
345
- gap: 2px;
346
355
  }
347
356
 
348
357
  .fsHighNps {
@@ -365,7 +374,6 @@
365
374
  font-family: "Montserrat", sans-serif;
366
375
  font-size: 13px;
367
376
  font-weight: 600;
368
- padding: 5px 10px;
369
377
  border-radius: 3px;
370
378
  border: 0.36px solid #cbd4e6;
371
379
  cursor: pointer;
@@ -478,10 +486,6 @@
478
486
  font-size: 12px;
479
487
  }
480
488
 
481
- .fsNpsNumber {
482
- padding: 4px 8px;
483
- }
484
-
485
489
  .fsNpsText {
486
490
  font-size: 9px;
487
491
  }
@@ -594,10 +598,6 @@
594
598
  margin-top: 5%;
595
599
  }
596
600
 
597
- .fsNpsNumber {
598
- padding: 3px 6px;
599
- }
600
-
601
601
  .fsNpsText {
602
602
  font-size: 8px;
603
603
  }