@fullsession.io/fs-feedback-widget 1.7.6 → 1.9.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.7.6",
3
+ "version": "1.9.0",
4
4
  "scripts": {
5
5
  "build": "rollup -c",
6
6
  "dev": "rollup -c -w",
package/src/App.svelte CHANGED
@@ -157,13 +157,20 @@
157
157
  reaction: Number(reactionType),
158
158
  type: widgetType,
159
159
  };
160
- } else {
160
+ } else if (widgetType === 1) {
161
161
  widgetResponse = {
162
162
  id: widgetId,
163
163
  email: email,
164
164
  questionAnswer: questionAnswer,
165
165
  type: widgetType,
166
166
  };
167
+ } else if (widgetType === 2) {
168
+ widgetResponse = {
169
+ id: widgetId,
170
+ email: email,
171
+ reaction: Number(reactionType),
172
+ type: widgetType,
173
+ };
167
174
  }
168
175
 
169
176
  let event = new CustomEvent("fbEvent", {
@@ -225,8 +232,8 @@
225
232
  </script>
226
233
 
227
234
  <fsContainer
228
- class={!buttonVisible && widgetDisplayMode == 1 ? "modal" : "side"}
229
- style="position: 10px"
235
+ class={!buttonVisible && widgetDisplayMode == 1 ? "fs-feedback-modal" : "fs-side"}
236
+ style="position: fixed; top: 0; right: 0; bottom: 0; left: 0;"
230
237
  dir="ltr"
231
238
  >
232
239
  {#if buttonVisible}
@@ -242,9 +249,10 @@
242
249
  <div
243
250
  class="fsCont"
244
251
  class:fsContModal={widgetDisplayMode === 1}
252
+ class:fsContNps={widgetType === 2}
245
253
  in:transition={transitionInParams}
246
254
  >
247
- <div class="fsCloseCont" on:click={closeWidget}>
255
+ <div class="fsCloseCont" class:fsNpsCloseCont={widgetType === 2} on:click={closeWidget}>
248
256
  <p id="fsCloseIcon">X</p>
249
257
  </div>
250
258
  <ReactionPage
@@ -259,7 +267,7 @@
259
267
  <div class="fsCloseCont" on:click={closeThanksMessage}>
260
268
  <p id="fsCloseIcon">X</p>
261
269
  </div>
262
- <div class="thanks-txt">
270
+ <div class="fs-thanks-txt">
263
271
  {widgetThanksMsg}
264
272
  </div>
265
273
  </div>
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { icons_1, icons_2, icons_3, icons_4 } from "./reactionSvgs/icons.js";
2
+ import { icons_1, icons_2, icons_3 } from "./reactionSvgs/icons.js";
3
3
  export let name;
4
4
  export let focusable = false;
5
5
  export let emotIconType;
@@ -1,4 +1,6 @@
1
- .side {
1
+ @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100..900&display=swap');
2
+
3
+ .fs-side {
2
4
  width: 100%;
3
5
  display: flex;
4
6
  flex-direction: var(--wgPositionVertical);
@@ -12,23 +14,21 @@
12
14
  align-items: var(--wgPositionHorizintal);
13
15
  padding: 0;
14
16
  z-index: 100000;
15
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
17
+ font-family: 'Montserrat', sans-serif;
16
18
  }
17
19
 
18
- .modal {
20
+ .fs-feedback-modal {
19
21
  display: flex !important;
20
22
  justify-content: center;
21
23
  align-items: center;
22
24
  width: 100%;
23
25
  height: 100%;
24
- position: var(--positionState);
25
26
  background-color: rgba(0, 0, 0, 0.5);
26
27
  z-index: 100000;
27
- pointer-events: none;
28
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
28
+ font-family: 'Montserrat', sans-serif;
29
29
  }
30
30
 
31
- .thanks-txt {
31
+ .fs-thanks-txt {
32
32
  width: 61%;
33
33
  padding: 20px 0;
34
34
  text-align: center;
@@ -38,7 +38,6 @@
38
38
  }
39
39
 
40
40
  fsContainerApp {
41
- width: 776px;
42
41
  height: 415px;
43
42
  display: flex;
44
43
  flex-direction: var(--wgPositionVertical);
@@ -51,14 +50,14 @@ fsContainerApp {
51
50
  align-items: var(--wgPositionHorizintal);
52
51
  padding: 0;
53
52
  z-index: 100000;
54
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
53
+ font-family: 'Montserrat', sans-serif;
55
54
  }
56
55
 
57
56
  .fsWidget {
58
57
  pointer-events: auto;
59
58
  background-color: var(--widgetColor);
60
59
  width: 34px;
61
- height: 112px;
60
+ height: 120px;
62
61
  border-top-left-radius: var(--widgetLeftSideBorder);
63
62
  border-bottom-left-radius: var(--widgetLeftSideBorder);
64
63
  border-top-right-radius: var(--widgetRightSideBorder);
@@ -111,11 +110,15 @@ fsContainerApp {
111
110
  margin: 0;
112
111
  }
113
112
 
113
+ .fsContNps {
114
+ padding: 20px;
115
+ width: 400px !important;
116
+ }
117
+
114
118
  .fsThanksMessageCont {
115
119
  display: flex;
116
120
  flex-direction: column;
117
121
  pointer-events: auto;
118
- width: 320px;
119
122
  height: auto;
120
123
  background-color: rgb(255, 255, 255);
121
124
  margin-right: var(--widgetMarginRight);
@@ -147,6 +150,10 @@ fsContainerApp {
147
150
  cursor: pointer;
148
151
  }
149
152
 
153
+ .fsNpsCloseCont {
154
+ margin: -35px 0 0 auto !important;
155
+ }
156
+
150
157
 
151
158
 
152
159
 
@@ -156,6 +156,13 @@
156
156
  }
157
157
  };
158
158
 
159
+ const openEmailStep = (state, rating) => {
160
+ widgetComponent = state;
161
+ reactionType = String(rating);
162
+
163
+ closeHandlerBeforeFinishing(email, comment, reactionType);
164
+ };
165
+
159
166
  const questionHandler = (state, question) => {
160
167
  let input = document.querySelector(".fsAnswerTextArea");
161
168
 
@@ -198,7 +205,7 @@
198
205
  <Icons bind:name={changingReactionNames[0]} bind:emotIconType={widgetEmotIconType} />
199
206
  </div>
200
207
 
201
- <p class="fsReactionText" class:icons3-text-2={widgetEmotIconType === "2"}>Hate</p>
208
+ <p class="fsReactionText" class:fs-icons3-text-2={widgetEmotIconType === "2"}>Hate</p>
202
209
  </div>
203
210
 
204
211
  <div
@@ -209,7 +216,7 @@
209
216
  <Icons bind:name={changingReactionNames[1]} bind:emotIconType={widgetEmotIconType} />
210
217
  </div>
211
218
 
212
- <p class="fsReactionText" class:icons3-text={widgetEmotIconType === "2"}>Dislike</p>
219
+ <p class="fsReactionText" class:fs-icons3-text={widgetEmotIconType === "2"}>Dislike</p>
213
220
  </div>
214
221
  <div
215
222
  class="fsIconTextCont"
@@ -225,13 +232,13 @@
225
232
  <div class="fsReactionIcon">
226
233
  <Icons bind:name={changingReactionNames[3]} bind:emotIconType={widgetEmotIconType} />
227
234
  </div>
228
- <p class="fsReactionText" class:icons3-text={widgetEmotIconType === "2"}>Like</p>
235
+ <p class="fsReactionText" class:fs-icons3-text={widgetEmotIconType === "2"}>Like</p>
229
236
  </div>
230
237
  <div class="fsIconTextCont" on:click={() => openComment(2, 5, "love")}>
231
238
  <div class="fsReactionIcon">
232
239
  <Icons bind:name={changingReactionNames[4]} bind:emotIconType={widgetEmotIconType} />
233
240
  </div>
234
- <p class="fsReactionText" class:icons3-text-2={widgetEmotIconType === "2"}>Love</p>
241
+ <p class="fsReactionText" class:fs-icons3-text-2={widgetEmotIconType === "2"}>Love</p>
235
242
  </div>
236
243
  </div>
237
244
  </div>
@@ -259,6 +266,21 @@
259
266
  {/if}
260
267
  </div>
261
268
  </div>
269
+ {:else if wgType === 2}
270
+ <div class="fsNpsContainer">
271
+ <div class="fsNpsNumbers">
272
+ {#each {length: 11} as _, i}
273
+ <div class={i > 8 ? "fsNpsNumber fsHighNps" : i > 6 ? "fsNpsNumber fsMediumNps" : "fsNpsNumber fsLowNps"}
274
+ on:click={() => openEmailStep(3, i)}>
275
+ <span>{i}</span>
276
+ </div>
277
+ {/each}
278
+ </div>
279
+ <div class="fsNpsFooter">
280
+ <div class="fsNpsText">not likely at all</div>
281
+ <div class="fsNpsText">extremely likely </div>
282
+ </div>
283
+ </div>
262
284
  {/if}
263
285
  {:else if widgetComponent === 2 && wgType !== 1}
264
286
  <div class="fsCommentContainer">
@@ -272,7 +294,7 @@
272
294
  {/if}
273
295
  </div>
274
296
 
275
- <p class="fsReactionText" id="fsHateDiv" class:icons3-text-2={widgetEmotIconType === "2"}>Hate</p>
297
+ <p class="fsReactionText" id="fsHateDiv" class:fs-icons3-text-2={widgetEmotIconType === "2"}>Hate</p>
276
298
  </div>
277
299
 
278
300
  <div class="fsIconTextCont" on:click={() => openComment(2, 2, "dislike")}>
@@ -284,7 +306,7 @@
284
306
  {/if}
285
307
  </div>
286
308
 
287
- <p class="fsReactionText" id="fsDislikeDiv" class:icons3-text={widgetEmotIconType === "2"}>Dislike</p>
309
+ <p class="fsReactionText" id="fsDislikeDiv" class:fs-icons3-text={widgetEmotIconType === "2"}>Dislike</p>
288
310
  </div>
289
311
  <div class="fsIconTextCont" on:click={() => openComment(2, 3, "neutral")}>
290
312
  <div class="fsReactionIcon">
@@ -305,7 +327,7 @@
305
327
  <Icons bind:name={changingReactionNames[3]} bind:emotIconType={widgetEmotIconType} />
306
328
  {/if}
307
329
  </div>
308
- <p class="fsReactionText" id="fsLikeDiv" class:icons3-text={widgetEmotIconType === "2"}>Like</p>
330
+ <p class="fsReactionText" id="fsLikeDiv" class:fs-icons3-text={widgetEmotIconType === "2"}>Like</p>
309
331
  </div>
310
332
  <div class="fsIconTextCont">
311
333
  <div class="fsReactionIcon" on:click={() => openComment(2, 5, "love")}>
@@ -315,7 +337,7 @@
315
337
  <Icons bind:name={changingReactionNames[4]} bind:emotIconType={widgetEmotIconType} />
316
338
  {/if}
317
339
  </div>
318
- <p class="fsReactionText" id="fsLoveDiv" class:icons3-text-2={widgetEmotIconType === "2"}>Love</p>
340
+ <p class="fsReactionText" id="fsLoveDiv" class:fs-icons3-text-2={widgetEmotIconType === "2"}>Love</p>
319
341
  </div>
320
342
  </div>
321
343
 
@@ -1,9 +1,11 @@
1
+ @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100..900&display=swap');
2
+
1
3
  .fsReactionsContainer {
2
4
  pointer-events: auto;
3
5
  display: flex;
4
6
  flex-direction: column;
5
7
  height: fit-content;
6
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
8
+ font-family: 'Montserrat', sans-serif;
7
9
  }
8
10
 
9
11
  .fsIcons {
@@ -15,12 +17,17 @@
15
17
  }
16
18
 
17
19
  #fsTxt {
18
- align-self: center;
19
- font-size: 17px;
20
- display: block;
20
+ color: #1513A0;
21
+ text-align: center;
22
+ font-family: 'Montserrat', sans-serif;
23
+ font-size: 14px;
24
+ font-weight: 500;
25
+ line-height: 15px;
21
26
  text-align: center;
22
- width: 61%;
27
+ align-self: center;
23
28
  overflow: hidden;
29
+ width: 80% !important;
30
+ margin-top: 5px;
24
31
  }
25
32
 
26
33
  .fsIconTextCont {
@@ -29,28 +36,28 @@
29
36
  flex-direction: column;
30
37
  align-items: center;
31
38
  height: 22px;
32
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
39
+ font-family: 'Montserrat', sans-serif;
33
40
  }
34
41
 
35
42
  .fsReactionText {
36
43
  font-size: 12px;
37
44
  display: none;
38
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
45
+ font-family: 'Montserrat', sans-serif;
39
46
  margin-top: 0px;
40
47
  }
41
48
 
42
- .icons3-text {
49
+ .fs-icons3-text {
43
50
  padding-left: 5px;
44
51
  }
45
52
 
46
- .icons3-text-2 {
53
+ .fs-icons3-text-2 {
47
54
  padding-left: 3px;
48
55
  }
49
56
 
50
57
  .fsIconTextCont:hover {
51
58
  pointer-events: auto;
52
59
  cursor: pointer;
53
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
60
+ font-family: 'Montserrat', sans-serif;
54
61
  }
55
62
 
56
63
  .fsReactionIcon:hover+.fsReactionText {
@@ -64,7 +71,7 @@
64
71
  display: flex;
65
72
  flex-direction: column;
66
73
  pointer-events: auto;
67
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
74
+ font-family: 'Montserrat', sans-serif;
68
75
  height: auto;
69
76
  padding-bottom: 10px;
70
77
  }
@@ -75,7 +82,7 @@
75
82
  height: 140px;
76
83
  background-color: #eaeaeb;
77
84
  margin-top: 17%;
78
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
85
+ font-family: 'Montserrat', sans-serif;
79
86
  }
80
87
 
81
88
  .fsTextAreaCont-qa-view {
@@ -84,11 +91,7 @@
84
91
  height: 140px;
85
92
  background-color: #eaeaeb;
86
93
  margin-top: 10px;
87
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
88
- }
89
-
90
- .txt-type-view {
91
- margin-top: 10px;
94
+ font-family: 'Montserrat', sans-serif;
92
95
  }
93
96
 
94
97
  .fsTextArea, .fsAnswerTextArea {
@@ -100,7 +103,7 @@
100
103
  outline: none;
101
104
  margin-top: 4%;
102
105
  resize: none;
103
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
106
+ font-family: 'Montserrat', sans-serif;
104
107
  }
105
108
 
106
109
  .fsTextarea:focus {
@@ -113,7 +116,7 @@
113
116
  font-size: 12px;
114
117
  text-align: center;
115
118
  margin-top: 6px;
116
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
119
+ font-family: 'Montserrat', sans-serif;
117
120
 
118
121
  }
119
122
 
@@ -128,7 +131,7 @@
128
131
  margin-right: 11px;
129
132
  cursor: pointer;
130
133
  border: 0px;
131
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
134
+ font-family: 'Montserrat', sans-serif;
132
135
 
133
136
  }
134
137
 
@@ -143,7 +146,7 @@
143
146
  margin-right: 11px;
144
147
  cursor: not-allowed;
145
148
  border: 0px;
146
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
149
+ font-family: 'Montserrat', sans-serif;
147
150
 
148
151
  }
149
152
 
@@ -153,7 +156,7 @@
153
156
  font-size: 12px;
154
157
  text-align: center;
155
158
  margin-top: 6px;
156
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
159
+ font-family: 'Montserrat', sans-serif;
157
160
 
158
161
  }
159
162
 
@@ -161,7 +164,7 @@
161
164
  pointer-events: auto;
162
165
  display: flex;
163
166
  justify-content: flex-end;
164
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
167
+ font-family: 'Montserrat', sans-serif;
165
168
 
166
169
  }
167
170
 
@@ -171,7 +174,7 @@
171
174
  flex-direction: row;
172
175
  justify-content: space-evenly;
173
176
  margin-top: 6%;
174
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
177
+ font-family: 'Montserrat', sans-serif;
175
178
  }
176
179
 
177
180
  .fsPointerDiv {
@@ -209,7 +212,7 @@
209
212
  display: flex;
210
213
  flex-direction: column;
211
214
  height: fit-content;
212
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
215
+ font-family: 'Montserrat', sans-serif;
213
216
  }
214
217
 
215
218
  #fsEmailInputCont {
@@ -222,7 +225,7 @@
222
225
  /* align-items: center; */
223
226
  justify-content: center;
224
227
  margin-top: 10%;
225
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
228
+ font-family: 'Montserrat', sans-serif;
226
229
  }
227
230
 
228
231
  #fsEmailTextArea {
@@ -231,7 +234,7 @@
231
234
  border: 0px;
232
235
  background-color: #eaeaeb;
233
236
  outline: none;
234
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
237
+ font-family: 'Montserrat', sans-serif;
235
238
  }
236
239
 
237
240
  #fsEmailText {
@@ -243,7 +246,7 @@
243
246
  padding-top: 20px;
244
247
  line-height: 1.29;
245
248
  font-size: 17px;
246
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
249
+ font-family: 'Montserrat', sans-serif;
247
250
  }
248
251
 
249
252
  .fsEmailFooter {
@@ -251,7 +254,7 @@
251
254
  display: flex;
252
255
  justify-content: flex-end;
253
256
  flex-direction: row;
254
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
257
+ font-family: 'Montserrat', sans-serif;
255
258
 
256
259
  }
257
260
 
@@ -262,13 +265,69 @@
262
265
  margin-top: 6%;
263
266
  margin-right: 4%;
264
267
  letter-spacing: normal;
265
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
268
+ font-family: 'Montserrat', sans-serif;
266
269
 
267
270
 
268
271
  }
269
272
 
270
273
  #fsSkipText:hover {
271
274
  color: #666666;
272
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
275
+ font-family: 'Montserrat', sans-serif;
276
+
277
+ }
278
+
279
+ .fsNpsContainer {
280
+ margin-top: 20px;
281
+ display: flex;
282
+ flex-direction: column;
283
+ gap: 10px;
284
+ }
285
+
286
+ .fsNpsNumbers {
287
+ display: flex;
288
+ justify-content: space-between;
289
+ }
290
+
291
+ .fsHighNps {
292
+ background: #50C099;
293
+ }
294
+
295
+ .fsLowNps {
296
+ background: #F9837C;
297
+ }
298
+
299
+ .fsMediumNps {
300
+ background: #FFC565;
301
+ }
302
+
303
+ .fsNpsNumber {
304
+ display: flex;
305
+ align-items: center;
306
+ justify-content: center;
307
+ color: #FFF;
308
+ font-family: 'Montserrat', sans-serif;
309
+ font-size: 11px;
310
+ font-weight: 600;
311
+ padding: 5px 10px;
312
+ border-radius: 3px;
313
+ border: 0.36px solid #CBD4E6;
314
+ cursor: pointer;
315
+ transition: 0.4s ease;
316
+ }
317
+
318
+ .fsNpsNumber:hover {
319
+ opacity: 0.6;
320
+ }
321
+
322
+ .fsNpsFooter {
323
+ display: flex;
324
+ justify-content: space-between;
325
+ padding: 0 9px;
326
+ }
273
327
 
328
+ .fsNpsText {
329
+ color: var(--dark-grey, #6D6D6D);
330
+ font-family: 'Montserrat', sans-serif;
331
+ font-size: 10px;
332
+ font-weight: 500;
274
333
  }