@fullsession.io/fs-feedback-widget 1.0.1 → 1.0.2
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/README.md +109 -109
- package/dist/bundle.css +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/lib/index.js +1 -1
- package/package.json +31 -31
- package/src/App.svelte +234 -223
- package/src/Icons/mainIcon.svelte +25 -25
- package/src/Icons/reactionIcons.svelte +134 -134
- package/src/main.js +45 -45
- package/src/widgetPages/reactionPage.svelte +466 -466
package/src/App.svelte
CHANGED
|
@@ -1,223 +1,234 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import MainIcon from "./Icons/mainIcon.svelte";
|
|
3
|
-
import ReactionPage from "./widgetPages/reactionPage.svelte"
|
|
4
|
-
export let feedback;
|
|
5
|
-
import { fly } from "svelte/transition";
|
|
6
|
-
|
|
7
|
-
$:widgetColor = feedback.wgAccentColor;
|
|
8
|
-
$:document.documentElement.style.setProperty('--widgetColor', widgetColor);
|
|
9
|
-
let widgetTextColor="";
|
|
10
|
-
let iconColor = "";
|
|
11
|
-
if(feedback.wgAlternateColor === 1){
|
|
12
|
-
widgetTextColor = "white";
|
|
13
|
-
iconColor = "white"
|
|
14
|
-
} else{
|
|
15
|
-
widgetTextColor = "black";
|
|
16
|
-
iconColor ="black"
|
|
17
|
-
}
|
|
18
|
-
$:document.documentElement.style.setProperty('--widgetTextColor', widgetTextColor);
|
|
19
|
-
|
|
20
|
-
let wgPositionHorizintal="";
|
|
21
|
-
let wgPositionVertical = "";
|
|
22
|
-
let widgetLeftSideBorder=0;
|
|
23
|
-
let widgetRightSideBorder=0;
|
|
24
|
-
let widgetMarginRight = 0;
|
|
25
|
-
let widgetMarginLeft = 0;
|
|
26
|
-
let visible = false;
|
|
27
|
-
let buttonVisible = true;
|
|
28
|
-
let thanksMessageVisible = false;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
{
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
width:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
1
|
+
<script>
|
|
2
|
+
import MainIcon from "./Icons/mainIcon.svelte";
|
|
3
|
+
import ReactionPage from "./widgetPages/reactionPage.svelte"
|
|
4
|
+
export let feedback;
|
|
5
|
+
import { fly } from "svelte/transition";
|
|
6
|
+
|
|
7
|
+
$:widgetColor = feedback.wgAccentColor;
|
|
8
|
+
$:document.documentElement.style.setProperty('--widgetColor', widgetColor);
|
|
9
|
+
let widgetTextColor="";
|
|
10
|
+
let iconColor = "";
|
|
11
|
+
if(feedback.wgAlternateColor === 1){
|
|
12
|
+
widgetTextColor = "white";
|
|
13
|
+
iconColor = "white"
|
|
14
|
+
} else{
|
|
15
|
+
widgetTextColor = "black";
|
|
16
|
+
iconColor ="black"
|
|
17
|
+
}
|
|
18
|
+
$:document.documentElement.style.setProperty('--widgetTextColor', widgetTextColor);
|
|
19
|
+
|
|
20
|
+
let wgPositionHorizintal="";
|
|
21
|
+
let wgPositionVertical = "";
|
|
22
|
+
let widgetLeftSideBorder=0;
|
|
23
|
+
let widgetRightSideBorder=0;
|
|
24
|
+
let widgetMarginRight = 0;
|
|
25
|
+
let widgetMarginLeft = 0;
|
|
26
|
+
let visible = false;
|
|
27
|
+
let buttonVisible = true;
|
|
28
|
+
let thanksMessageVisible = false;
|
|
29
|
+
let inTransitionX = 0;
|
|
30
|
+
let outTransitionX = 0;
|
|
31
|
+
|
|
32
|
+
if(feedback.wgPosition == 0){
|
|
33
|
+
wgPositionHorizintal = "center"
|
|
34
|
+
wgPositionVertical = "row-reverse"
|
|
35
|
+
widgetLeftSideBorder =5;
|
|
36
|
+
widgetRightSideBorder=0;
|
|
37
|
+
widgetMarginRight = 30;
|
|
38
|
+
widgetMarginLeft = 0;
|
|
39
|
+
inTransitionX = -100;
|
|
40
|
+
outTransitionX = 20;
|
|
41
|
+
}
|
|
42
|
+
if(feedback.wgPosition == 1){
|
|
43
|
+
wgPositionHorizintal = "center"
|
|
44
|
+
wgPositionVertical = "row"
|
|
45
|
+
widgetLeftSideBorder =0;
|
|
46
|
+
widgetRightSideBorder=5;
|
|
47
|
+
widgetMarginRight = 0;
|
|
48
|
+
widgetMarginLeft = 30;
|
|
49
|
+
inTransitionX = 100;
|
|
50
|
+
outTransitionX = -20;
|
|
51
|
+
}
|
|
52
|
+
if(feedback.wgPosition == 2){
|
|
53
|
+
wgPositionHorizintal = "flex-end"
|
|
54
|
+
wgPositionVertical = "row-reverse"
|
|
55
|
+
widgetLeftSideBorder =5;
|
|
56
|
+
widgetMarginRight = 30
|
|
57
|
+
widgetMarginLeft = 0;
|
|
58
|
+
inTransitionX = -100;
|
|
59
|
+
outTransitionX = 20;
|
|
60
|
+
}
|
|
61
|
+
if(feedback.wgPosition == 3){
|
|
62
|
+
wgPositionHorizintal = "flex-end"
|
|
63
|
+
wgPositionVertical = "row"
|
|
64
|
+
widgetLeftSideBorder =0;
|
|
65
|
+
widgetRightSideBorder=5;
|
|
66
|
+
widgetMarginRight = 0;
|
|
67
|
+
widgetMarginLeft = 30;
|
|
68
|
+
inTransitionX = 100;
|
|
69
|
+
outTransitionX = -20;
|
|
70
|
+
}
|
|
71
|
+
$: document.documentElement.style.setProperty('--wgPositionHorizintal', wgPositionHorizintal)
|
|
72
|
+
$: document.documentElement.style.setProperty('--wgPositionVertical', wgPositionVertical)
|
|
73
|
+
$: document.documentElement.style.setProperty('--widgetLeftSideBorder', widgetLeftSideBorder + 'px')
|
|
74
|
+
$: document.documentElement.style.setProperty('--widgetRightSideBorder', widgetRightSideBorder + 'px')
|
|
75
|
+
$: document.documentElement.style.setProperty('--widgetMarginRight', widgetMarginRight + 'px')
|
|
76
|
+
$: document.documentElement.style.setProperty('--widgetMarginLeft', widgetMarginLeft + 'px')
|
|
77
|
+
|
|
78
|
+
const closeOne = () => (openThanksMessage());
|
|
79
|
+
|
|
80
|
+
const openThanksMessage = () => {
|
|
81
|
+
visible = !visible;
|
|
82
|
+
thanksMessageVisible = !thanksMessageVisible;
|
|
83
|
+
|
|
84
|
+
}
|
|
85
|
+
const closeThanksMessage = () => {
|
|
86
|
+
thanksMessageVisible = !thanksMessageVisible;
|
|
87
|
+
setTimeout(function(){
|
|
88
|
+
buttonVisible = !buttonVisible;
|
|
89
|
+
},350);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const openWidget = () => {
|
|
93
|
+
visible = !visible;
|
|
94
|
+
buttonVisible = !buttonVisible;
|
|
95
|
+
};
|
|
96
|
+
const closeWidget = () => {
|
|
97
|
+
visible = !visible;
|
|
98
|
+
setTimeout(function(){
|
|
99
|
+
buttonVisible = !buttonVisible;
|
|
100
|
+
},350);
|
|
101
|
+
};
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<body>
|
|
105
|
+
|
|
106
|
+
{#if buttonVisible}
|
|
107
|
+
<div class="widget" on:click={openWidget}>
|
|
108
|
+
<div id="feedbackTxt">Feedback</div>
|
|
109
|
+
<div id="mainIcon">
|
|
110
|
+
<MainIcon bind:fill={iconColor}/>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
{/if}
|
|
114
|
+
|
|
115
|
+
{#if visible}
|
|
116
|
+
<div
|
|
117
|
+
|
|
118
|
+
class="cont"
|
|
119
|
+
in:fly="{{ x: inTransitionX, duration: 500 }}"
|
|
120
|
+
>
|
|
121
|
+
<div class="closeCont" on:click={closeWidget}>
|
|
122
|
+
<p id="closeIcon">X</p>
|
|
123
|
+
</div>
|
|
124
|
+
<ReactionPage closeHandler={closeOne} bind:feedbackData={feedback}/>
|
|
125
|
+
|
|
126
|
+
</div>
|
|
127
|
+
{/if}
|
|
128
|
+
{#if thanksMessageVisible}
|
|
129
|
+
<div class ="thanksMessageCont" out:fly="{{ x: outTransitionX, duration: 300 }}">
|
|
130
|
+
<div class="closeCont" on:click={closeThanksMessage}>
|
|
131
|
+
<p id="closeIcon">X</p>
|
|
132
|
+
</div>
|
|
133
|
+
<div style=" width: 61%;
|
|
134
|
+
text-align: center;
|
|
135
|
+
margin-top: 7%;
|
|
136
|
+
margin-left: 20%;">{feedback.wgThanksMsg}</div>
|
|
137
|
+
</div>
|
|
138
|
+
{/if}
|
|
139
|
+
</body>
|
|
140
|
+
|
|
141
|
+
<style>
|
|
142
|
+
body{
|
|
143
|
+
width: 100%;
|
|
144
|
+
display: flex;
|
|
145
|
+
flex-direction: var(--wgPositionVertical);
|
|
146
|
+
position: absolute;
|
|
147
|
+
top: 0; right: 0; bottom: 0; left: 0;
|
|
148
|
+
background-color: #ebeef9;
|
|
149
|
+
height: 100%;
|
|
150
|
+
align-items: var(--wgPositionHorizintal);
|
|
151
|
+
padding: 0;
|
|
152
|
+
}
|
|
153
|
+
.widget {
|
|
154
|
+
background-color: var(--widgetColor);
|
|
155
|
+
width: 34px;
|
|
156
|
+
height: 112px;
|
|
157
|
+
border-top-left-radius:var(--widgetLeftSideBorder) ;
|
|
158
|
+
border-bottom-left-radius: var(--widgetLeftSideBorder);
|
|
159
|
+
border-top-right-radius: var(--widgetRightSideBorder) ;
|
|
160
|
+
border-bottom-right-radius: var(--widgetRightSideBorder);
|
|
161
|
+
box-shadow: 0.2px 0.2px 0.2px rgb(133, 130, 130);
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
align-items: center;
|
|
165
|
+
justify-content: space-evenly;
|
|
166
|
+
cursor: pointer;
|
|
167
|
+
margin-top: 5px;
|
|
168
|
+
}
|
|
169
|
+
#mainIcon {
|
|
170
|
+
width: 60%;
|
|
171
|
+
margin-left: 4%;
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
}
|
|
174
|
+
#feedbackTxt {
|
|
175
|
+
color: var(--widgetTextColor);
|
|
176
|
+
font-size: 13px;
|
|
177
|
+
writing-mode: vertical-lr;
|
|
178
|
+
transform: rotate(180deg);
|
|
179
|
+
cursor: pointer;
|
|
180
|
+
}
|
|
181
|
+
.widget:hover {
|
|
182
|
+
width: 35px;
|
|
183
|
+
-webkit-box-shadow: 0px 0px 35px 2px rgba(0, 0, 0, 0.24);
|
|
184
|
+
box-shadow: 0px 0px 35px 2px rgba(0, 0, 0, 0.24);
|
|
185
|
+
}
|
|
186
|
+
.cont {
|
|
187
|
+
width: 320px;
|
|
188
|
+
height: fit-content;
|
|
189
|
+
background-color: rgb(255, 255, 255);
|
|
190
|
+
margin-right: var(--widgetMarginRight);
|
|
191
|
+
margin-left: var(--widgetMarginLeft);
|
|
192
|
+
-webkit-box-shadow: rgba(0, 0, 0, 0.35) 0px 6px 100px 0px;
|
|
193
|
+
box-shadow: rgba(0, 0, 0, 0.35) 0px 6px 100px 0px;
|
|
194
|
+
}
|
|
195
|
+
.thanksMessageCont{
|
|
196
|
+
width: 320px;
|
|
197
|
+
height: 104px;
|
|
198
|
+
background-color: rgb(255, 255, 255);
|
|
199
|
+
margin-right: var(--widgetMarginRight);
|
|
200
|
+
margin-left: var(--widgetMarginLeft);
|
|
201
|
+
-webkit-box-shadow: rgba(0, 0, 0, 0.35) 0px 6px 100px 0px;
|
|
202
|
+
box-shadow: rgba(0, 0, 0, 0.35) 0px 6px 100px 0px;
|
|
203
|
+
}
|
|
204
|
+
#closeIcon{
|
|
205
|
+
font-size: 16px;
|
|
206
|
+
color: #ffff;
|
|
207
|
+
font-weight: 600;
|
|
208
|
+
font-family: system-ui;
|
|
209
|
+
cursor: pointer;
|
|
210
|
+
|
|
211
|
+
}
|
|
212
|
+
.closeCont{
|
|
213
|
+
background-color: #4d5167;
|
|
214
|
+
width: 27px;
|
|
215
|
+
height: 27px;
|
|
216
|
+
border-radius: 50%;
|
|
217
|
+
display: flex;
|
|
218
|
+
justify-content: center;
|
|
219
|
+
align-items: center;
|
|
220
|
+
margin-top: -15px;
|
|
221
|
+
margin-left: 85%;
|
|
222
|
+
cursor: pointer;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
@media (min-width: 640px) {
|
|
230
|
+
body {
|
|
231
|
+
max-width: none;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
</style>
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export let fill = "";
|
|
3
|
-
</script>
|
|
4
|
-
<svg
|
|
5
|
-
fill={fill}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
version="1.1"
|
|
9
|
-
id="Layer_1"
|
|
10
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
-
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
12
|
-
x="0px"
|
|
13
|
-
y="0px"
|
|
14
|
-
viewBox="0 0 458 458"
|
|
15
|
-
style="enable-background:new 0 0 458 458;"
|
|
16
|
-
xml:space="preserve"
|
|
17
|
-
><g
|
|
18
|
-
><g
|
|
19
|
-
><path
|
|
20
|
-
d="M428,41.534H30c-16.569,0-30,13.431-30,30v252c0,16.568,13.432,30,30,30h132.1l43.942,52.243 c5.7,6.777,14.103,10.69,22.959,10.69c8.856,0,17.258-3.912,22.959-10.69l43.942-52.243H428c16.568,0,30-13.432,30-30v-252 C458,54.965,444.568,41.534,428,41.534z M323.916,281.534H82.854c-8.284,0-15-6.716-15-15s6.716-15,15-15h241.062 c8.284,0,15,6.716,15,15S332.2,281.534,323.916,281.534z M67.854,198.755c0-8.284,6.716-15,15-15h185.103c8.284,0,15,6.716,15,15 s-6.716,15-15,15H82.854C74.57,213.755,67.854,207.039,67.854,198.755z M375.146,145.974H82.854c-8.284,0-15-6.716-15-15 s6.716-15,15-15h292.291c8.284,0,15,6.716,15,15C390.146,139.258,383.43,145.974,375.146,145.974z"
|
|
21
|
-
/></g
|
|
22
|
-
></g
|
|
23
|
-
><g /><g /><g /><g /><g /><g /><g /><g /><g /><g /><g /><g /><g /><g /><g
|
|
24
|
-
/></svg
|
|
25
|
-
>
|
|
1
|
+
<script>
|
|
2
|
+
export let fill = "";
|
|
3
|
+
</script>
|
|
4
|
+
<svg
|
|
5
|
+
fill={fill}
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
version="1.1"
|
|
9
|
+
id="Layer_1"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
12
|
+
x="0px"
|
|
13
|
+
y="0px"
|
|
14
|
+
viewBox="0 0 458 458"
|
|
15
|
+
style="enable-background:new 0 0 458 458;"
|
|
16
|
+
xml:space="preserve"
|
|
17
|
+
><g
|
|
18
|
+
><g
|
|
19
|
+
><path
|
|
20
|
+
d="M428,41.534H30c-16.569,0-30,13.431-30,30v252c0,16.568,13.432,30,30,30h132.1l43.942,52.243 c5.7,6.777,14.103,10.69,22.959,10.69c8.856,0,17.258-3.912,22.959-10.69l43.942-52.243H428c16.568,0,30-13.432,30-30v-252 C458,54.965,444.568,41.534,428,41.534z M323.916,281.534H82.854c-8.284,0-15-6.716-15-15s6.716-15,15-15h241.062 c8.284,0,15,6.716,15,15S332.2,281.534,323.916,281.534z M67.854,198.755c0-8.284,6.716-15,15-15h185.103c8.284,0,15,6.716,15,15 s-6.716,15-15,15H82.854C74.57,213.755,67.854,207.039,67.854,198.755z M375.146,145.974H82.854c-8.284,0-15-6.716-15-15 s6.716-15,15-15h292.291c8.284,0,15,6.716,15,15C390.146,139.258,383.43,145.974,375.146,145.974z"
|
|
21
|
+
/></g
|
|
22
|
+
></g
|
|
23
|
+
><g /><g /><g /><g /><g /><g /><g /><g /><g /><g /><g /><g /><g /><g /><g
|
|
24
|
+
/></svg
|
|
25
|
+
>
|