@subiz/widget-v4 4.1.100 → 4.1.102

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.
Files changed (30) hide show
  1. package/assets/img/subiz-mono.svg +1 -1
  2. package/assets/less/form.less +44 -31
  3. package/assets/less/widget.less +18 -14
  4. package/assets/less/widget_header.less +1 -1
  5. package/compiled_src/chatbox/PoweredBy.js +2 -2
  6. package/compiled_src/chatbox/Widget.js +27 -19
  7. package/dist/{191a16d5da3.app.js → 191a179639e.app.js} +1 -1
  8. package/dist/{191a16d5da3.index.html → 191a179639e.index.html} +1 -1
  9. package/dist/{191a16d5da3.library.html → 191a179639e.library.html} +1 -1
  10. package/dist/{191a16d5da3.library.js → 191a179639e.library.js} +1 -1
  11. package/dist/{191a16d5da3.preview.html → 191a179639e.preview.html} +1 -1
  12. package/dist/{191a16d5da3.preview.js → 191a179639e.preview.js} +1 -1
  13. package/dist/{191a16d5da3.webview.js → 191a179639e.webview.js} +1 -1
  14. package/dist/HASH +1 -1
  15. package/dist/screenshoot.html +1 -1
  16. package/package.json +3 -3
  17. package/src/chatbox/PoweredBy.js +1 -1
  18. package/src/chatbox/Widget.js +28 -19
  19. package/webpack.prod.js +0 -7
  20. package/webpack.screenshoot.js +0 -1
  21. package/dist/191a16d5da3.screenshoot.js +0 -1
  22. /package/dist/{191a16d5da3.127.js → 191a179639e.127.js} +0 -0
  23. /package/dist/{191a16d5da3.132.js → 191a179639e.132.js} +0 -0
  24. /package/dist/{191a16d5da3.185.js → 191a179639e.185.js} +0 -0
  25. /package/dist/{191a16d5da3.27.js → 191a179639e.27.js} +0 -0
  26. /package/dist/{191a16d5da3.278.js → 191a179639e.278.js} +0 -0
  27. /package/dist/{191a16d5da3.459.js → 191a179639e.459.js} +0 -0
  28. /package/dist/{191a16d5da3.490.js → 191a179639e.490.js} +0 -0
  29. /package/dist/{191a16d5da3.74.js → 191a179639e.74.js} +0 -0
  30. /package/dist/{191a16d5da3.997.js → 191a179639e.997.js} +0 -0
@@ -1,3 +1,3 @@
1
1
  <svg width="21" height="15" viewBox="0 0 21 15" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M20.2176 15C18.4857 15 16.7537 15 15.0379 15C13.0955 15 11.1693 15 9.22689 15C8.35282 15 7.49492 14.8374 6.65322 14.6259C5.87626 14.4308 5.11549 14.1543 4.38709 13.7802C3.62632 13.3898 2.93029 12.9182 2.29901 12.3489C1.60298 11.7309 1.03645 11.0153 0.631786 10.2021C0.227119 9.38886 0.0166929 8.51059 0.000506273 7.58354C-0.0156804 6.29867 0.356612 5.14391 1.06882 4.103C1.73248 3.09463 2.62274 2.31395 3.6425 1.67964C4.67845 1.02908 5.81151 0.606207 6.99314 0.329716C7.6406 0.183339 8.28807 0.0857536 8.96791 0.0369611C9.37257 0.020697 9.77724 -0.0118315 10.1819 0.00443267C11.0236 0.0206968 11.8653 0.118282 12.6908 0.313452C13.6782 0.541151 14.6332 0.882698 15.5397 1.35436C16.2519 1.7447 16.9156 2.2001 17.5306 2.75308C18.2752 3.43617 18.8579 4.23312 19.2626 5.16018C19.4892 5.68063 19.6349 6.23361 19.7158 6.81912C19.8453 7.86003 19.6997 8.83588 19.3112 9.79547C19.0684 10.3972 18.7285 10.934 18.3238 11.4381C18.1943 11.6008 18.0648 11.7472 17.9353 11.8773C17.8706 11.9423 17.8544 11.9911 17.8867 12.0887C18.1457 12.9019 18.5504 13.6338 19.1817 14.2193C19.4245 14.447 19.6997 14.6585 20.0072 14.8048C20.0881 14.8374 20.1691 14.9024 20.25 14.9349C20.2338 14.9675 20.2338 14.9837 20.2176 15ZM12.8365 8.70576C13.2736 8.70576 13.7268 8.6895 14.1638 8.70576C14.3581 8.70576 14.3904 8.64071 14.3904 8.4618C14.3742 7.81124 14.3742 7.16067 14.3904 6.49384C14.3904 6.31493 14.3419 6.26614 14.1638 6.26614C13.2736 6.2824 12.3995 6.26614 11.5092 6.2824C11.2988 6.2824 11.2664 6.21735 11.2664 6.02218C11.2826 5.14391 11.2664 4.28191 11.2664 3.40364C11.2664 3.241 11.234 3.19221 11.056 3.19221C10.3761 3.20847 9.68012 3.20847 9.00028 3.19221C8.82223 3.19221 8.78986 3.25727 8.78986 3.40364C8.78986 4.28191 8.78986 5.16018 8.78986 6.03844C8.78986 6.21735 8.74129 6.26614 8.56324 6.26614C7.68916 6.24988 6.83127 6.26614 5.95719 6.24988C5.74677 6.24988 5.71439 6.31493 5.71439 6.5101C5.73058 7.16067 5.73058 7.79497 5.71439 8.44554C5.71439 8.62444 5.76295 8.6895 5.94101 8.6895C6.7989 8.67324 7.65679 8.6895 8.51468 8.67324C8.72511 8.67324 8.77367 8.73829 8.77367 8.93346C8.75748 9.81173 8.77367 10.6737 8.75748 11.552C8.75748 11.6984 8.78986 11.7472 8.95172 11.7472C9.63156 11.7309 10.3276 11.7309 11.0074 11.7472C11.1855 11.7472 11.2179 11.6821 11.2179 11.5195C11.2017 10.6412 11.2179 9.76294 11.2179 8.88467C11.2179 8.72203 11.2502 8.67324 11.4283 8.67324C11.9463 8.72203 12.3995 8.70576 12.8365 8.70576Z" fill="#ccc"/>
2
+ <path d="M20.2176 15C18.4857 15 16.7537 15 15.0379 15C13.0955 15 11.1693 15 9.22689 15C8.35282 15 7.49492 14.8374 6.65322 14.6259C5.87626 14.4308 5.11549 14.1543 4.38709 13.7802C3.62632 13.3898 2.93029 12.9182 2.29901 12.3489C1.60298 11.7309 1.03645 11.0153 0.631786 10.2021C0.227119 9.38886 0.0166929 8.51059 0.000506273 7.58354C-0.0156804 6.29867 0.356612 5.14391 1.06882 4.103C1.73248 3.09463 2.62274 2.31395 3.6425 1.67964C4.67845 1.02908 5.81151 0.606207 6.99314 0.329716C7.6406 0.183339 8.28807 0.0857536 8.96791 0.0369611C9.37257 0.020697 9.77724 -0.0118315 10.1819 0.00443267C11.0236 0.0206968 11.8653 0.118282 12.6908 0.313452C13.6782 0.541151 14.6332 0.882698 15.5397 1.35436C16.2519 1.7447 16.9156 2.2001 17.5306 2.75308C18.2752 3.43617 18.8579 4.23312 19.2626 5.16018C19.4892 5.68063 19.6349 6.23361 19.7158 6.81912C19.8453 7.86003 19.6997 8.83588 19.3112 9.79547C19.0684 10.3972 18.7285 10.934 18.3238 11.4381C18.1943 11.6008 18.0648 11.7472 17.9353 11.8773C17.8706 11.9423 17.8544 11.9911 17.8867 12.0887C18.1457 12.9019 18.5504 13.6338 19.1817 14.2193C19.4245 14.447 19.6997 14.6585 20.0072 14.8048C20.0881 14.8374 20.1691 14.9024 20.25 14.9349C20.2338 14.9675 20.2338 14.9837 20.2176 15ZM12.8365 8.70576C13.2736 8.70576 13.7268 8.6895 14.1638 8.70576C14.3581 8.70576 14.3904 8.64071 14.3904 8.4618C14.3742 7.81124 14.3742 7.16067 14.3904 6.49384C14.3904 6.31493 14.3419 6.26614 14.1638 6.26614C13.2736 6.2824 12.3995 6.26614 11.5092 6.2824C11.2988 6.2824 11.2664 6.21735 11.2664 6.02218C11.2826 5.14391 11.2664 4.28191 11.2664 3.40364C11.2664 3.241 11.234 3.19221 11.056 3.19221C10.3761 3.20847 9.68012 3.20847 9.00028 3.19221C8.82223 3.19221 8.78986 3.25727 8.78986 3.40364C8.78986 4.28191 8.78986 5.16018 8.78986 6.03844C8.78986 6.21735 8.74129 6.26614 8.56324 6.26614C7.68916 6.24988 6.83127 6.26614 5.95719 6.24988C5.74677 6.24988 5.71439 6.31493 5.71439 6.5101C5.73058 7.16067 5.73058 7.79497 5.71439 8.44554C5.71439 8.62444 5.76295 8.6895 5.94101 8.6895C6.7989 8.67324 7.65679 8.6895 8.51468 8.67324C8.72511 8.67324 8.77367 8.73829 8.77367 8.93346C8.75748 9.81173 8.77367 10.6737 8.75748 11.552C8.75748 11.6984 8.78986 11.7472 8.95172 11.7472C9.63156 11.7309 10.3276 11.7309 11.0074 11.7472C11.1855 11.7472 11.2179 11.6821 11.2179 11.5195C11.2017 10.6412 11.2179 9.76294 11.2179 8.88467C11.2179 8.72203 11.2502 8.67324 11.4283 8.67324C11.9463 8.72203 12.3995 8.70576 12.8365 8.70576Z" fill="#aaa"/>
3
3
  </svg>
@@ -1,4 +1,5 @@
1
- .form-label { // todo: remove this
1
+ .form-label {
2
+ // todo: remove this
2
3
  margin-top: 15px;
3
4
  }
4
5
 
@@ -19,7 +20,7 @@ textarea.form-control {
19
20
  }
20
21
 
21
22
  input.form-control[disabled] {
22
- background: #F9F9F9;
23
+ background: #f9f9f9;
23
24
  }
24
25
  .form-control--container {
25
26
  .form-control--check {
@@ -39,27 +40,39 @@ input.form-control[disabled] {
39
40
  .color(@red);
40
41
  }
41
42
 
42
- input[type='text'].form-control.input--error, input[type='number'].form-control.input--error,input[type='date'].form-control.input--error,
43
- textarea.form-control.input--error, select.form-control.input--error{
43
+ input[type='text'].form-control.input--error,
44
+ input[type='number'].form-control.input--error,
45
+ input[type='date'].form-control.input--error,
46
+ textarea.form-control.input--error,
47
+ select.form-control.input--error {
44
48
  border: 1px solid red;
45
49
  }
46
50
 
47
- input[type='text'].form-control, input[type='number'].form-control,input[type='date'].form-control,
48
- textarea.form-control, select.form-control {
51
+ input[type='text'].form-control,
52
+ input[type='number'].form-control,
53
+ input[type='date'].form-control,
54
+ textarea.form-control,
55
+ select.form-control {
49
56
  width: 100%;
50
57
 
51
58
  border: 1px solid #d8d8d8;
52
59
  border-radius: 5px;
53
60
 
54
61
  padding: 8px;
62
+ &:hover {
63
+ border: 1px solid #888;
64
+ }
55
65
  }
56
66
 
57
67
  // Fix select display not fully text on Safari iOs
58
68
  select.form-control {
59
- padding: 1px 8px;
69
+ padding: 1px 8px;
60
70
  }
61
- input[type='text'].form-control:focus, input[type='number'].form-control:focus,input[type='date'].form-control:focus,
62
- textarea.form-control:focus, select.form-control:focus {
71
+ input[type='text'].form-control:focus,
72
+ input[type='number'].form-control:focus,
73
+ input[type='date'].form-control:focus,
74
+ textarea.form-control:focus,
75
+ select.form-control:focus {
63
76
  border: 1px solid @primary-color;
64
77
  }
65
78
 
@@ -89,12 +102,12 @@ textarea.form-control:focus, select.form-control:focus {
89
102
  height: 25px;
90
103
  }
91
104
 
92
- input[type=radio]{
105
+ input[type='radio'] {
93
106
  position: absolute;
94
107
  visibility: hidden;
95
108
  }
96
109
 
97
- .radio--label{
110
+ .radio--label {
98
111
  padding-left: 22px;
99
112
  display: block;
100
113
  position: relative;
@@ -102,7 +115,7 @@ textarea.form-control:focus, select.form-control:focus {
102
115
  cursor: pointer;
103
116
  }
104
117
 
105
- .radio--check{
118
+ .radio--check {
106
119
  display: block;
107
120
  position: absolute;
108
121
  border: 1px solid #aaa;
@@ -112,8 +125,8 @@ textarea.form-control:focus, select.form-control:focus {
112
125
  top: 0px;
113
126
  left: 0px;
114
127
  z-index: 5;
115
- transition: border .15s linear;
116
- -webkit-transition: border .15s linear;
128
+ transition: border 0.15s linear;
129
+ -webkit-transition: border 0.15s linear;
117
130
  }
118
131
 
119
132
  .radio--check:hover {
@@ -134,11 +147,11 @@ textarea.form-control:focus, select.form-control:focus {
134
147
  -webkit-transition: background 0.15s linear;
135
148
  }
136
149
 
137
- input[type=radio]:checked ~ .radio--check {
150
+ input[type='radio']:checked ~ .radio--check {
138
151
  border: 1px solid @primary-color;
139
152
  }
140
153
 
141
- input[type=radio]:checked ~ .radio--check::before {
154
+ input[type='radio']:checked ~ .radio--check::before {
142
155
  background: @primary-color;
143
156
  }
144
157
  }
@@ -153,7 +166,7 @@ textarea.form-control:focus, select.form-control:focus {
153
166
  height: 25px;
154
167
  }
155
168
 
156
- input[type=checkbox] {
169
+ input[type='checkbox'] {
157
170
  position: absolute;
158
171
  visibility: hidden;
159
172
  }
@@ -176,8 +189,8 @@ textarea.form-control:focus, select.form-control:focus {
176
189
  top: 0px;
177
190
  left: 0px;
178
191
  z-index: 5;
179
- transition: border .15s linear;
180
- -webkit-transition: border .15s linear;
192
+ transition: border 0.15s linear;
193
+ -webkit-transition: border 0.15s linear;
181
194
  }
182
195
 
183
196
  .checkbox--check:hover {
@@ -192,14 +205,14 @@ textarea.form-control:focus, select.form-control:focus {
192
205
  width: 100%;
193
206
  margin: auto;
194
207
  transition: background 0.15s linear;
195
- -webkit-transition: background .15s linear;
208
+ -webkit-transition: background 0.15s linear;
196
209
  }
197
210
 
198
- input[type=checkbox]:checked ~ .checkbox--check {
211
+ input[type='checkbox']:checked ~ .checkbox--check {
199
212
  border: 1px solid @primary-color;
200
213
  }
201
214
 
202
- input[type=checkbox]:checked ~ .checkbox--check::before {
215
+ input[type='checkbox']:checked ~ .checkbox--check::before {
203
216
  background: @primary-color;
204
217
  }
205
218
  }
@@ -207,7 +220,7 @@ textarea.form-control:focus, select.form-control:focus {
207
220
 
208
221
  .form {
209
222
  .select .form-control {
210
- padding-right: 20px ;
223
+ padding-right: 20px;
211
224
  }
212
225
  select {
213
226
  /*background: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00LjQxMDU4IDYuOTExMDdDNC43MzYwMiA2LjU4NTYzIDUuMjYzNjYgNi41ODU2MyA1LjU4OTA5IDYuOTExMDdMOS45OTk4NCAxMS4zMjE4TDE0LjQxMDYgNi45MTEwN0MxNC43MzYgNi41ODU2MyAxNS4yNjM3IDYuNTg1NjMgMTUuNTg5MSA2LjkxMTA3QzE1LjkxNDUgNy4yMzY1MSAxNS45MTQ1IDcuNzY0MTQgMTUuNTg5MSA4LjA4OTU4TDEwLjU4OTEgMTMuMDg5NkMxMC4yNjM3IDEzLjQxNSA5LjczNjAyIDEzLjQxNSA5LjQxMDU4IDEzLjA4OTZMNC40MTA1OCA4LjA4OTU4QzQuMDg1MTQgNy43NjQxNCA0LjA4NTE0IDcuMjM2NTEgNC40MTA1OCA2LjkxMTA3WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+") no-repeat right;*/
@@ -235,7 +248,7 @@ textarea.form-control:focus, select.form-control:focus {
235
248
  cursor: pointer;
236
249
  background: #e0e0e0;
237
250
  }
238
- input[type="checkbox"] {
251
+ input[type='checkbox'] {
239
252
  background-color: initial;
240
253
  cursor: default;
241
254
  -webkit-appearance: checkbox;
@@ -245,7 +258,7 @@ input[type="checkbox"] {
245
258
  border: initial;
246
259
  }
247
260
 
248
- input[type="radio"] {
261
+ input[type='radio'] {
249
262
  background-color: initial;
250
263
  cursor: default;
251
264
  -webkit-appearance: radio;
@@ -292,7 +305,7 @@ select {
292
305
  select {
293
306
  position: relative;
294
307
  display: inline-block;
295
- border: 2px #CCCC solid;
308
+ border: 2px #cccc solid;
296
309
  border-radius: 5px;
297
310
  height: 36px;
298
311
  line-height: 34px;
@@ -333,8 +346,8 @@ select {
333
346
  justify-items: center;
334
347
  font-size: 12px;
335
348
  margin-left: 5px;
336
- opacity: .5;
337
- content: "\2715";
349
+ opacity: 0.5;
350
+ content: '\2715';
338
351
  }
339
352
 
340
353
  .custom-select--wrap-options {
@@ -344,8 +357,8 @@ select {
344
357
  left: 0;
345
358
  top: 100%;
346
359
  border: 1px solid #dadce0;
347
- -webkit-box-shadow: 0 4px 16px rgba(0,0,0,.1);
348
- box-shadow: 0 4px 16px rgba(0,0,0,.1);
360
+ -webkit-box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
361
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
349
362
  border-radius: 5px;
350
363
  width: 100%;
351
364
  background: #fff;
@@ -384,6 +397,6 @@ select {
384
397
  }
385
398
 
386
399
  .custom-select--icon-dropdown path {
387
- d: path("M 7 9.5 L 12 14.5 L 17 9.5 H 7 Z");
400
+ d: path('M 7 9.5 L 12 14.5 L 17 9.5 H 7 Z');
388
401
  fill: black;
389
402
  }
@@ -9,7 +9,7 @@
9
9
 
10
10
  padding-left: @spacer3;
11
11
  padding-right: @spacer3;
12
- padding-bottom: @spacer3;
12
+ // padding-bottom: @spacer3;
13
13
  }
14
14
 
15
15
  .convo-list--list {
@@ -183,7 +183,9 @@
183
183
  .widget-container.widget-container--hide {
184
184
  top: -100vh;
185
185
  opacity: 0;
186
- transition: opacity 0.15s cubic-bezier(1, 0.5, 0.8, 1), bottom 0.15s cubic-bezier(1, 0.5, 0.8, 1);
186
+ transition:
187
+ opacity 0.15s cubic-bezier(1, 0.5, 0.8, 1),
188
+ bottom 0.15s cubic-bezier(1, 0.5, 0.8, 1);
187
189
  }
188
190
  }
189
191
 
@@ -236,7 +238,9 @@
236
238
  .widget-container.widget-container--hide {
237
239
  opacity: 0;
238
240
  visibility: hidden;
239
- transition: opacity 0.1s cubic-bezier(1, 0.5, 0.8, 1), visibility 0.1s cubic-bezier(1, 0.5, 0.8, 1);
241
+ transition:
242
+ opacity 0.1s cubic-bezier(1, 0.5, 0.8, 1),
243
+ visibility 0.1s cubic-bezier(1, 0.5, 0.8, 1);
240
244
  }
241
245
 
242
246
  .btn--start-convo {
@@ -299,23 +303,23 @@
299
303
 
300
304
  & .poweredby--text {
301
305
  text-decoration: none;
302
- padding-left: 12px;
303
- padding-right: 12px;
304
- padding-top: 5px;
305
- padding-bottom: 5px;
306
- border-radius: 20px;
307
- font-size: 12px;
306
+ font-size: 13px;
308
307
  .color(#7c7c7c);
309
308
  vertical-align: baseline;
309
+ .poweredby--subiz-logo {
310
+ opacity: 0.7;
311
+ margin-top: -1px;
312
+ height: 12px;
313
+ }
314
+
310
315
  &:hover {
311
316
  .color(#333);
317
+ .poweredby--subiz-logo {
318
+ opacity: 1;
319
+ }
312
320
  }
313
321
 
314
- .poweredby--subiz-logo {
315
- opacity: 1;
316
- margin-top: -3px;
317
- height: 10px;
318
- }
322
+
319
323
  }
320
324
  }
321
325
 
@@ -45,7 +45,7 @@
45
45
  .widget-header--description {
46
46
  font-size: 15px;
47
47
  white-space: pre-wrap;
48
- opacity: 0.7;
48
+ opacity: 0.8;
49
49
  flex: 1;
50
50
  .color(@text-color);
51
51
  margin-top: 2.5px;
@@ -18,8 +18,8 @@ function PoweredBy(props) {
18
18
  target: "_blank",
19
19
  title: "Subiz"
20
20
  }, (0, _preact.h)("img", {
21
- width: "14",
22
- height: "10",
21
+ width: "17",
22
+ height: "12",
23
23
  class: "poweredby--subiz-logo",
24
24
  src: logo,
25
25
  alt: "powerred by subiz"
@@ -36,13 +36,6 @@ class Widget extends _common.Com {
36
36
  _defineProperty(this, "msgInput", (0, _preact.createRef)());
37
37
  _defineProperty(this, "formMounted", form => {
38
38
  let formData = this.fillForm(form);
39
- formData['question'] = {
40
- key: 'question',
41
- is_required: true,
42
- label: this.props.t.i18n(_index.default.get(form, `i18n_question_label`, {})) || form.question_label,
43
- type: 'text',
44
- value: this.state.quickReplyMessage.text
45
- };
46
39
  this.setState({
47
40
  formData
48
41
  });
@@ -272,7 +265,7 @@ class Widget extends _common.Com {
272
265
  key: 'lead_source',
273
266
  text: 'widget'
274
267
  });
275
- let firstmsg = _index.default.get(data, 'question.value');
268
+ let firstmsg = _index.default.get(data, 'question.value', this.props.t('get_started'));
276
269
  let groupid = _index.default.get(data, 'group.value', '');
277
270
  this._creating = (this._creating || 0) + 1;
278
271
  let _creating = this._creating;
@@ -365,6 +358,11 @@ class Widget extends _common.Com {
365
358
  formData
366
359
  });
367
360
  }
361
+ onKeywordField(e, form, formName, key) {
362
+ if (e.code == 'Enter') {
363
+ this.submitPrechatForm(form, formName);
364
+ }
365
+ }
368
366
  onInputChange(key, val) {
369
367
  this.wasFormInputed = true;
370
368
  let formData = _index.default.cloneDeep(this.state.formData);
@@ -488,7 +486,7 @@ class Widget extends _common.Com {
488
486
  value: item.value
489
487
  }, this.props.t.i18n(item.i18n_label) || item.label || item.value)));
490
488
  }
491
- renderFields() {
489
+ renderFields(form, formName) {
492
490
  if (_index.default.size(this.state.formData) === 0) return null;
493
491
  let $fields = _index.default.map(this.state.formData, (field, key) => {
494
492
  if (this.state.quickReplyMessage.text && key === 'question') return null;
@@ -520,6 +518,7 @@ class Widget extends _common.Com {
520
518
  value: field.value || '',
521
519
  onInput: e => this.onInputChange(key, e.target.value),
522
520
  onChange: e => this.onInputChange(key, e.target.value),
521
+ onKeyDown: e => this.onKeywordField(e, form, formName, key),
523
522
  ref: ref => {
524
523
  this['form_' + encode(key)] = ref;
525
524
  },
@@ -631,7 +630,7 @@ class Widget extends _common.Com {
631
630
  class: "flex-grow-1"
632
631
  }, (0, _preact.h)("div", {
633
632
  class: "form mt-3 pl-3 pr-3 pt-3 pb-3 d-flex flex-column"
634
- }, (0, _preact.h)("div", null, title), this.renderFields())), (0, _preact.h)(_PoweredBy.default, {
633
+ }, (0, _preact.h)("div", null, title), this.renderFields(form, formName))), (0, _preact.h)(_PoweredBy.default, {
635
634
  store: this.props.store,
636
635
  t: this.props.t
637
636
  })), (0, _preact.h)("div", {
@@ -746,9 +745,7 @@ class Widget extends _common.Com {
746
745
  }
747
746
  fillQuickReplyToQuestion(message) {
748
747
  let formData = this.state.formData;
749
- if (formData) {
750
- _index.default.set(formData, 'question.value', message.text);
751
- }
748
+ if (formData) _index.default.set(formData, 'question.value', message.text || this.props.t('get_started'));
752
749
  this.setState({
753
750
  formData,
754
751
  quickReplyMessage: message
@@ -995,12 +992,14 @@ class Widget extends _common.Com {
995
992
  }))
996
993
  };
997
994
  }
998
- data['question'] = {
999
- key: 'question',
1000
- is_required: true,
1001
- label: this.props.t.i18n(_index.default.get(form, `i18n_question_label`, {})) || form.question_label,
1002
- type: 'text'
1003
- };
995
+ if (form.question_required) {
996
+ data['question'] = {
997
+ key: 'question',
998
+ is_required: true,
999
+ label: this.props.t.i18n(_index.default.get(form, `i18n_question_label`, {})) || form.question_label,
1000
+ type: 'text'
1001
+ };
1002
+ }
1004
1003
  if (this.isFormChanged(this.state.formData, data)) {
1005
1004
  this.setState({
1006
1005
  formData: data
@@ -1055,6 +1054,15 @@ class Widget extends _common.Com {
1055
1054
  }))
1056
1055
  };
1057
1056
  }
1057
+ if (form.question_required) {
1058
+ formData['question'] = {
1059
+ key: 'question',
1060
+ is_required: true,
1061
+ label: this.props.t.i18n(_index.default.get(form, `i18n_question_label`, {})) || form.question_label,
1062
+ type: 'text',
1063
+ value: this.state.quickReplyMessage.text
1064
+ };
1065
+ }
1058
1066
  return data;
1059
1067
  }
1060
1068
  }