@subiz/widget-v4 4.1.121 → 4.1.123
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/assets/less/avatar.less +0 -29
- package/assets/less/chatbox.less +7 -10
- package/assets/less/form.less +26 -9
- package/assets/less/message.less +14 -7
- package/assets/less/message_input.less +2 -3
- package/assets/less/widget.less +5 -11
- package/assets/less/widget_header.less +22 -18
- package/compiled_src/chatbox/AgentsAvatar.js +2 -2
- package/compiled_src/chatbox/Event.js +15 -11
- package/compiled_src/chatbox/Events.js +5 -2
- package/compiled_src/chatbox/Header.js +2 -7
- package/compiled_src/chatbox/TextMessage.js +6 -2
- package/compiled_src/chatbox/Widget.js +54 -43
- package/compiled_src/lib.js +0 -5
- package/compiled_src/store/api.js +5 -1
- package/compiled_src/store/store.js +2 -3
- package/compiled_src/util/common.js +2 -2
- package/dist/1964db39388.278.js +1 -0
- package/dist/1964db39388.app.js +1 -0
- package/dist/{19642b47dfe.index.html → 1964db39388.index.html} +1 -1
- package/dist/{19642b47dfe.library.html → 1964db39388.library.html} +1 -1
- package/dist/1964db39388.library.js +1 -0
- package/dist/{19642b47dfe.preview.html → 1964db39388.preview.html} +1 -1
- package/dist/1964db39388.preview.js +1 -0
- package/dist/1964db39388.webview.js +1 -0
- package/dist/278.js +1 -1
- package/dist/HASH +1 -1
- package/dist/screenshoot.js +102 -86
- package/package.json +2 -2
- package/src/chatbox/AgentsAvatar.js +3 -2
- package/src/chatbox/Event.js +5 -3
- package/src/chatbox/Events.js +5 -2
- package/src/chatbox/Header.js +2 -3
- package/src/chatbox/TextMessage.js +6 -2
- package/src/chatbox/Widget.js +53 -45
- package/src/lib.js +2 -0
- package/src/store/api.js +5 -1
- package/src/store/store.js +5 -4
- package/src/util/common.js +2 -2
- package/up +3 -6
- package/dist/19642b47dfe.278.js +0 -1
- package/dist/19642b47dfe.app.js +0 -1
- package/dist/19642b47dfe.library.js +0 -1
- package/dist/19642b47dfe.preview.js +0 -1
- package/dist/19642b47dfe.webview.js +0 -1
- /package/dist/{19642b47dfe.127.js → 1964db39388.127.js} +0 -0
- /package/dist/{19642b47dfe.132.js → 1964db39388.132.js} +0 -0
- /package/dist/{19642b47dfe.185.js → 1964db39388.185.js} +0 -0
- /package/dist/{19642b47dfe.27.js → 1964db39388.27.js} +0 -0
- /package/dist/{19642b47dfe.459.js → 1964db39388.459.js} +0 -0
- /package/dist/{19642b47dfe.490.js → 1964db39388.490.js} +0 -0
- /package/dist/{19642b47dfe.74.js → 1964db39388.74.js} +0 -0
- /package/dist/{19642b47dfe.997.js → 1964db39388.997.js} +0 -0
package/assets/less/avatar.less
CHANGED
|
@@ -24,18 +24,6 @@
|
|
|
24
24
|
border-radius: 35px;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.group-avatar--member {
|
|
28
|
-
align-self: center;
|
|
29
|
-
width: 65px;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.group-avatar--member .avatar {
|
|
33
|
-
position: relative;
|
|
34
|
-
width: 35px;
|
|
35
|
-
height: 35px;
|
|
36
|
-
border-radius: 35px;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
27
|
.group-avatar--primary .group-avatar--agent-middle {
|
|
40
28
|
width: 50px;
|
|
41
29
|
height: 50px;
|
|
@@ -70,20 +58,3 @@
|
|
|
70
58
|
z-index: 1;
|
|
71
59
|
margin-left: -15px;
|
|
72
60
|
}
|
|
73
|
-
|
|
74
|
-
.group-avatar--member .group-avatar--agent-left {
|
|
75
|
-
border: 2px solid @white;
|
|
76
|
-
z-index: 3;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.group-avatar--member .group-avatar--agent-middle {
|
|
80
|
-
border: 2px solid @white;
|
|
81
|
-
z-index: 2;
|
|
82
|
-
margin-left: -20px;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.group-avatar--member .group-avatar--agent-right {
|
|
86
|
-
border: 2px solid @white;
|
|
87
|
-
z-index: 1;
|
|
88
|
-
margin-left: -20px;
|
|
89
|
-
}
|
package/assets/less/chatbox.less
CHANGED
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
@widget-position: '@widget_position';
|
|
32
32
|
|
|
33
33
|
@spacer: 15px;
|
|
34
|
-
@spacer1: @spacer * 0.
|
|
35
|
-
@spacer2: @spacer *
|
|
36
|
-
@spacer3: @spacer; // 15px;
|
|
37
|
-
@spacer4: @spacer *
|
|
34
|
+
@spacer1: @spacer * 0.5; // 3.75px
|
|
35
|
+
@spacer2: @spacer * 1; // 7.5px
|
|
36
|
+
@spacer3: @spacer * 1.5; // 15px;
|
|
37
|
+
@spacer4: @spacer * 2; // 22.5px
|
|
38
38
|
|
|
39
|
-
@font-family-sans-serif:
|
|
40
|
-
|
|
39
|
+
@font-family-sans-serif: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif,
|
|
40
|
+
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
|
41
41
|
|
|
42
42
|
@font-size-base: 16px; // Assumes the browser default, typically `16px`
|
|
43
43
|
|
|
@@ -155,7 +155,6 @@ body div#sbz92 {
|
|
|
155
155
|
.ml-1 {
|
|
156
156
|
margin-left: @spacer1;
|
|
157
157
|
}
|
|
158
|
-
|
|
159
158
|
.pl-2 {
|
|
160
159
|
padding-left: @spacer2;
|
|
161
160
|
}
|
|
@@ -168,7 +167,6 @@ body div#sbz92 {
|
|
|
168
167
|
.mt-1 {
|
|
169
168
|
margin-top: @spacer1;
|
|
170
169
|
}
|
|
171
|
-
|
|
172
170
|
.mt-2 {
|
|
173
171
|
margin-top: @spacer2;
|
|
174
172
|
}
|
|
@@ -178,7 +176,6 @@ body div#sbz92 {
|
|
|
178
176
|
.mr-2 {
|
|
179
177
|
margin-right: @spacer2;
|
|
180
178
|
}
|
|
181
|
-
|
|
182
179
|
.pt-3 {
|
|
183
180
|
padding-top: @spacer3;
|
|
184
181
|
}
|
|
@@ -245,7 +242,7 @@ body div#sbz92 {
|
|
|
245
242
|
justify-content: center;
|
|
246
243
|
display: flex;
|
|
247
244
|
flex-direction: column;
|
|
248
|
-
background: white
|
|
245
|
+
background: white;
|
|
249
246
|
}
|
|
250
247
|
|
|
251
248
|
@import 'avatar.less';
|
package/assets/less/form.less
CHANGED
|
@@ -38,6 +38,8 @@ input.form-control[disabled] {
|
|
|
38
38
|
|
|
39
39
|
.form-control--valid-input--error {
|
|
40
40
|
.color(@red);
|
|
41
|
+
font-size: 14px;
|
|
42
|
+
padding-top: 5px;
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
input[type='text'].form-control.input--error,
|
|
@@ -45,7 +47,8 @@ input[type='number'].form-control.input--error,
|
|
|
45
47
|
input[type='date'].form-control.input--error,
|
|
46
48
|
textarea.form-control.input--error,
|
|
47
49
|
select.form-control.input--error {
|
|
48
|
-
border: 1px solid red;
|
|
50
|
+
border: 1px solid @red;
|
|
51
|
+
background: #dd41500f;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
input[type='text'].form-control,
|
|
@@ -55,12 +58,16 @@ textarea.form-control,
|
|
|
55
58
|
select.form-control {
|
|
56
59
|
width: 100%;
|
|
57
60
|
|
|
58
|
-
border: 1px solid
|
|
59
|
-
border-radius:
|
|
60
|
-
|
|
61
|
-
padding:
|
|
61
|
+
border: 1px solid @gray-400;
|
|
62
|
+
border-radius: 8px;
|
|
63
|
+
transition: all 100ms ease;
|
|
64
|
+
padding: 10px 12px;
|
|
62
65
|
&:hover {
|
|
63
|
-
border: 1px solid
|
|
66
|
+
border: 1px solid @gray-600;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.input--error:hover {
|
|
70
|
+
border: 1px solid @red;
|
|
64
71
|
}
|
|
65
72
|
}
|
|
66
73
|
|
|
@@ -76,11 +83,21 @@ select.form-control:focus {
|
|
|
76
83
|
border: 1px solid @primary-color;
|
|
77
84
|
}
|
|
78
85
|
|
|
86
|
+
input[type='text'].form-control.input--error:focus,
|
|
87
|
+
input[type='number'].form-control.input--error:focus,
|
|
88
|
+
input[type='date'].form-control.input--error:focus,
|
|
89
|
+
textarea.form-control.input--error:focus,
|
|
90
|
+
select.form-control.input--error:focus {
|
|
91
|
+
border: 1px solid @red;
|
|
92
|
+
}
|
|
93
|
+
|
|
79
94
|
.label {
|
|
80
95
|
display: block;
|
|
81
|
-
|
|
82
|
-
margin-top:
|
|
83
|
-
|
|
96
|
+
padding-bottom: 6px;
|
|
97
|
+
margin-top: 8px;
|
|
98
|
+
.color(@gray-600);
|
|
99
|
+
font-size: 14px;
|
|
100
|
+
font-weight: 500;
|
|
84
101
|
}
|
|
85
102
|
|
|
86
103
|
.form--btn-submit {
|
package/assets/less/message.less
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: column;
|
|
6
6
|
flex: 1;
|
|
7
|
-
padding-left:
|
|
8
|
-
padding-right:
|
|
7
|
+
padding-left: @spacer3;
|
|
8
|
+
padding-right: @spacer3;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.widget-body--events {
|
|
@@ -99,6 +99,7 @@
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
.message-text--user {
|
|
102
|
+
line-height: 1.5;
|
|
102
103
|
margin: 5px 0 0;
|
|
103
104
|
display: inline-block;
|
|
104
105
|
font-weight: 500;
|
|
@@ -110,7 +111,12 @@
|
|
|
110
111
|
//padding: 12px;
|
|
111
112
|
}
|
|
112
113
|
|
|
114
|
+
.message-text--user.message-user--error {
|
|
115
|
+
background-color: @red;
|
|
116
|
+
}
|
|
117
|
+
|
|
113
118
|
.message-text--agent {
|
|
119
|
+
line-height: 1.5;
|
|
114
120
|
white-space: pre-wrap;
|
|
115
121
|
display: inline-block;
|
|
116
122
|
background: @primary-color-faded;
|
|
@@ -176,11 +182,14 @@
|
|
|
176
182
|
|
|
177
183
|
a.message_error {
|
|
178
184
|
.color(@red);
|
|
185
|
+
opacity: 0.8;
|
|
179
186
|
display: block;
|
|
180
187
|
text-align: end;
|
|
181
188
|
font-size: 13px;
|
|
189
|
+
margin-top: 5px;
|
|
182
190
|
margin-bottom: 10px;
|
|
183
191
|
&:hover {
|
|
192
|
+
opacity: 1;
|
|
184
193
|
.color(@red);
|
|
185
194
|
}
|
|
186
195
|
}
|
|
@@ -246,7 +255,6 @@ a.message_error {
|
|
|
246
255
|
width: 25px;
|
|
247
256
|
height: 25px;
|
|
248
257
|
margin-right: 10px;
|
|
249
|
-
border: 1px solid @gray-300;
|
|
250
258
|
}
|
|
251
259
|
|
|
252
260
|
.message-sender-name {
|
|
@@ -401,7 +409,7 @@ a.message_error {
|
|
|
401
409
|
.agent-message {
|
|
402
410
|
.url-button-attachment {
|
|
403
411
|
text-decoration: none;
|
|
404
|
-
padding: 10px;
|
|
412
|
+
padding: 10px 18px;
|
|
405
413
|
display: block;
|
|
406
414
|
text-align: center;
|
|
407
415
|
.color(@black);
|
|
@@ -415,6 +423,7 @@ a.message_error {
|
|
|
415
423
|
.color(@primary-color);
|
|
416
424
|
border-color: @primary-color;
|
|
417
425
|
}
|
|
426
|
+
white-space: nowrap;
|
|
418
427
|
}
|
|
419
428
|
}
|
|
420
429
|
|
|
@@ -434,12 +443,9 @@ a.message_error {
|
|
|
434
443
|
user-select: none;
|
|
435
444
|
overflow: hidden;
|
|
436
445
|
white-space: nowrap;
|
|
437
|
-
text-overflow: ellipsis;
|
|
438
446
|
width: fit-content;
|
|
439
|
-
overflow: hidden;
|
|
440
447
|
font-weight: 500;
|
|
441
448
|
max-width: 100%;
|
|
442
|
-
overflow: hidden;
|
|
443
449
|
text-overflow: ellipsis;
|
|
444
450
|
border: 1px solid @black;
|
|
445
451
|
&:hover {
|
|
@@ -447,6 +453,7 @@ a.message_error {
|
|
|
447
453
|
.color(@text-color);
|
|
448
454
|
border-color: @primary-color;
|
|
449
455
|
}
|
|
456
|
+
transition: all 100ms ease;
|
|
450
457
|
}
|
|
451
458
|
|
|
452
459
|
.generic-attachment-container {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
border-top: 1px solid #e3e3e3;
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: row;
|
|
6
|
-
padding:
|
|
6
|
+
padding: @spacer2 @spacer3;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.message-input--disabled {
|
|
@@ -83,8 +83,7 @@ textarea[disabled=disabled] {
|
|
|
83
83
|
|
|
84
84
|
.message-input--preform {
|
|
85
85
|
justify-content: center;
|
|
86
|
-
padding
|
|
87
|
-
padding-bottom: 10px;
|
|
86
|
+
padding: @spacer2 @spacer3;
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
.btn--preform {
|
package/assets/less/widget.less
CHANGED
|
@@ -19,12 +19,11 @@
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.convo-list--title {
|
|
22
|
-
font-
|
|
23
|
-
line-height: 20px;
|
|
22
|
+
font-weight: 500;
|
|
24
23
|
.color(@black);
|
|
25
24
|
background: @white;
|
|
26
25
|
border-bottom: 1px solid #f0f0f0;
|
|
27
|
-
padding: @
|
|
26
|
+
padding: @spacer2;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
.convo-list--container {
|
|
@@ -44,8 +43,6 @@
|
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
.convo-list--convo-last-info {
|
|
47
|
-
font-size: 15px;
|
|
48
|
-
line-height: 20px;
|
|
49
46
|
overflow: hidden;
|
|
50
47
|
white-space: nowrap;
|
|
51
48
|
justify-content: center;
|
|
@@ -88,19 +85,15 @@
|
|
|
88
85
|
text-overflow: ellipsis;
|
|
89
86
|
white-space: nowrap;
|
|
90
87
|
overflow: hidden;
|
|
91
|
-
font-weight: 500;
|
|
92
88
|
flex: 1;
|
|
93
|
-
margin-right:
|
|
89
|
+
margin-right: 16px;
|
|
94
90
|
cursor: pointer;
|
|
95
91
|
}
|
|
96
92
|
|
|
97
93
|
.convo-list--item {
|
|
98
94
|
cursor: pointer;
|
|
99
95
|
border-bottom: 1px solid @primary-color-faded;
|
|
100
|
-
padding
|
|
101
|
-
padding-right: 10px;
|
|
102
|
-
padding-bottom: 15px;
|
|
103
|
-
padding-top: 15px;
|
|
96
|
+
padding: @spacer2;
|
|
104
97
|
display: flex;
|
|
105
98
|
flex-direction: row;
|
|
106
99
|
transition: background 0.15s ease;
|
|
@@ -248,6 +241,7 @@
|
|
|
248
241
|
|
|
249
242
|
.btn--start-convo {
|
|
250
243
|
border-radius: 7px;
|
|
244
|
+
flex-shrink: 0;
|
|
251
245
|
display: flex;
|
|
252
246
|
align-items: center;
|
|
253
247
|
justify-content: center;
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
.widget-header {
|
|
2
2
|
z-index: -1;
|
|
3
3
|
position: relative;
|
|
4
|
-
|
|
4
|
+
transition: height 0.2s;
|
|
5
5
|
border-radius: 15px 15px 0px 0px;
|
|
6
6
|
background: @background;
|
|
7
7
|
.color(@text-color);
|
|
8
8
|
width: 100%;
|
|
9
9
|
|
|
10
10
|
.widget-header--total-unread-convo {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
font-size: 13px;
|
|
12
|
+
font-weight: 500;
|
|
13
13
|
background: #ef000d;
|
|
14
|
-
font-weight: 400;
|
|
15
14
|
display: flex;
|
|
16
|
-
border-radius:
|
|
15
|
+
border-radius: 50%;
|
|
17
16
|
justify-content: center;
|
|
17
|
+
align-items: center;
|
|
18
18
|
width: 20px;
|
|
19
19
|
height: 20px;
|
|
20
|
+
position: absolute;
|
|
20
21
|
cursor: pointer;
|
|
21
|
-
|
|
22
|
-
top:
|
|
22
|
+
right: -8px;
|
|
23
|
+
top: -4px;
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
|
|
30
31
|
.widget-header--inner.widget-header--inner--collapsed {
|
|
31
32
|
height: auto;
|
|
32
|
-
padding:
|
|
33
|
+
padding: @spacer2 @spacer3;
|
|
33
34
|
position: relative;
|
|
34
35
|
|
|
35
36
|
.widget-header--title {
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
|
|
59
60
|
.widget-header--inner.widget-header--inner--expanded {
|
|
60
61
|
height: 224px;
|
|
61
|
-
padding:
|
|
62
|
+
padding: @spacer2 @spacer3;
|
|
62
63
|
|
|
63
64
|
.widget-header--top-wrapper {
|
|
64
65
|
display: flex;
|
|
@@ -122,19 +123,23 @@
|
|
|
122
123
|
flex: 1;
|
|
123
124
|
display: flex;
|
|
124
125
|
flex-direction: column;
|
|
125
|
-
margin-left: 10px;
|
|
126
126
|
z-index: 1;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
.widget-header--button-close {
|
|
130
130
|
display: flex;
|
|
131
|
+
border-radius: 6px;
|
|
131
132
|
justify-self: flex-end;
|
|
132
133
|
align-items: center;
|
|
133
134
|
align-self: flex-start;
|
|
134
|
-
|
|
135
|
-
transition:
|
|
135
|
+
opacity: 0.6;
|
|
136
|
+
transition:
|
|
137
|
+
opacity 0.15s ease,
|
|
138
|
+
scale 0.15s ease,
|
|
139
|
+
filter 0.15s ease;
|
|
136
140
|
filter: brightness(0.95);
|
|
137
141
|
&:hover {
|
|
142
|
+
opacity: 1;
|
|
138
143
|
filter: brightness(1.1);
|
|
139
144
|
scale: 1.1;
|
|
140
145
|
}
|
|
@@ -146,7 +151,6 @@
|
|
|
146
151
|
background-size: contain;
|
|
147
152
|
background-repeat: no-repeat;
|
|
148
153
|
background-position: center;
|
|
149
|
-
|
|
150
154
|
width: 24px;
|
|
151
155
|
height: 24px;
|
|
152
156
|
display: block;
|
|
@@ -166,7 +170,9 @@
|
|
|
166
170
|
|
|
167
171
|
cursor: pointer;
|
|
168
172
|
scale: 1;
|
|
169
|
-
transition:
|
|
173
|
+
transition:
|
|
174
|
+
scale 0.15s ease,
|
|
175
|
+
filter 0.15s ease;
|
|
170
176
|
filter: brightness(0.95);
|
|
171
177
|
&:hover {
|
|
172
178
|
filter: brightness(1.1);
|
|
@@ -174,12 +180,10 @@
|
|
|
174
180
|
}
|
|
175
181
|
}
|
|
176
182
|
|
|
177
|
-
.widget-header--has-convo-unred .widget-header--button-back {
|
|
178
|
-
width: 20px;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
183
|
.widget-header--wrap-button-back {
|
|
182
184
|
display: flex;
|
|
185
|
+
position: relative;
|
|
186
|
+
margin-right: @spacer1;
|
|
183
187
|
}
|
|
184
188
|
|
|
185
189
|
.fade-enter-active,
|
|
@@ -30,7 +30,7 @@ function AgentsAvatar(props) {
|
|
|
30
30
|
}
|
|
31
31
|
let agentM = props.store.matchAgent('*');
|
|
32
32
|
var agents = _index.default.map(props.agent_ids, id => agentM[id]);
|
|
33
|
-
if (props.agent_ids
|
|
33
|
+
if (props.agent_ids !== undefined && _index.default.size(props.agent_ids) == 0) {
|
|
34
34
|
var agids = _index.default.get(accountSetting, 'header.agent_ids', []);
|
|
35
35
|
agids = _index.default.filter(agids, id => !!agentM[id]);
|
|
36
36
|
if (agids.length !== 0) {
|
|
@@ -40,7 +40,7 @@ function AgentsAvatar(props) {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
agents = _index.default.filter(agents, ag => !!ag);
|
|
43
|
-
if (
|
|
43
|
+
if (_index.default.size(agents) === 0) {
|
|
44
44
|
return (0, _preact.h)("div", {
|
|
45
45
|
class: `group-avatar group-avatar--${mode}`
|
|
46
46
|
}, (0, _preact.h)("div", {
|
|
@@ -21,6 +21,9 @@ var _time = _interopRequireDefault(require("./time.js"));
|
|
|
21
21
|
var _common = require("../common.js");
|
|
22
22
|
var _preact = require("preact");
|
|
23
23
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
25
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
26
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
25
28
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
29
|
let OrderAttachments = false;
|
|
@@ -28,6 +31,13 @@ const LoadOrderAttachments = () => Promise.resolve().then(() => _interopRequireW
|
|
|
28
31
|
class Event extends _common.Com {
|
|
29
32
|
constructor(props) {
|
|
30
33
|
super(props);
|
|
34
|
+
_defineProperty(this, "resendMessage", () => {
|
|
35
|
+
let cid = _index.default.convoOfEv(this.props.event.ev);
|
|
36
|
+
const message = _index.default.get(this.props.event, 'ev.data.message');
|
|
37
|
+
this.props.store.sendConvoEvent(cid, 'message_sent', {
|
|
38
|
+
message
|
|
39
|
+
});
|
|
40
|
+
});
|
|
31
41
|
this.props.store.onConvoEvent(this, ev => this.onEvent(ev));
|
|
32
42
|
this.refForm = (0, _preact.createRef)();
|
|
33
43
|
this.state = {
|
|
@@ -318,18 +328,19 @@ class Event extends _common.Com {
|
|
|
318
328
|
class: "pt-3"
|
|
319
329
|
});
|
|
320
330
|
let $error = null;
|
|
331
|
+
if (ev._error) $dot = null;
|
|
321
332
|
if (ev._error && ev.type === 'message_sent') {
|
|
322
333
|
let msg = this.props.t('error_send_message');
|
|
323
334
|
if (ev._error_message) msg = this.props.t(ev._error_message);
|
|
324
335
|
$error = (0, _preact.h)("a", {
|
|
325
336
|
class: "message_error",
|
|
326
337
|
src: "javascript:;",
|
|
327
|
-
onClick:
|
|
338
|
+
onClick: this.resendMessage
|
|
328
339
|
}, (0, _preact.h)("div", {
|
|
329
|
-
class: "message_error__text"
|
|
330
|
-
}, msg), (0, _preact.h)("div", {
|
|
331
340
|
class: "message_error__icon"
|
|
332
|
-
}))
|
|
341
|
+
}), "\xA0", (0, _preact.h)("div", {
|
|
342
|
+
class: "message_error__text"
|
|
343
|
+
}, msg));
|
|
333
344
|
}
|
|
334
345
|
return (0, _preact.h)("div", {
|
|
335
346
|
class: "convo-event user-message"
|
|
@@ -480,13 +491,6 @@ class Event extends _common.Com {
|
|
|
480
491
|
state
|
|
481
492
|
}));
|
|
482
493
|
}
|
|
483
|
-
resendMessage() {
|
|
484
|
-
let cid = _index.default.convoOfEv(this.props.event.ev);
|
|
485
|
-
const message = _index.default.get(this.props.event, 'ev.data.message');
|
|
486
|
-
this.props.store.sendConvoEvent(cid, 'message_sent', {
|
|
487
|
-
message
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
494
|
getSenderName(ev) {
|
|
491
495
|
let bytype = _index.default.get(ev, 'by.type');
|
|
492
496
|
let byid = _index.default.get(ev, 'by.display_id', _index.default.get(ev, 'by.id'));
|
|
@@ -301,7 +301,7 @@ function processEvents(convo, events) {
|
|
|
301
301
|
}
|
|
302
302
|
if (visibleEvent(curEvent.ev)) {
|
|
303
303
|
let elapsedSec = _index.default.unixSec(curEvent.ev.created) - _index.default.unixSec(lastEvent.ev.created);
|
|
304
|
-
if (elapsedSec >
|
|
304
|
+
if (elapsedSec > 300) curEvent.show_time = true;
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
if (lastAgentEvent) lastAgentEvent.show_time = true;
|
|
@@ -326,7 +326,10 @@ function processEvents(convo, events) {
|
|
|
326
326
|
}
|
|
327
327
|
function visibleEvent(ev) {
|
|
328
328
|
let type = _index.default.get(ev, 'type');
|
|
329
|
-
|
|
329
|
+
if (type === 'message_sent') return true;
|
|
330
|
+
if (type === 'conversation_state_updated') {
|
|
331
|
+
return _index.default.get(ev, 'data.conversation.state') == 'ended';
|
|
332
|
+
}
|
|
330
333
|
}
|
|
331
334
|
function isSummited(form) {
|
|
332
335
|
let fields = _index.default.get(form, 'fields') || [];
|
|
@@ -50,12 +50,6 @@ class Header extends _common.Com {
|
|
|
50
50
|
class: cls,
|
|
51
51
|
style: style
|
|
52
52
|
}, $back, (0, _preact.h)("div", {
|
|
53
|
-
class: "mr-2"
|
|
54
|
-
}), (0, _preact.h)(_AgentsAvatar.default, {
|
|
55
|
-
plugin: this.props.plugin,
|
|
56
|
-
store: this.props.store,
|
|
57
|
-
mode: "secondary"
|
|
58
|
-
}), (0, _preact.h)("div", {
|
|
59
53
|
class: "widget-header--title-container"
|
|
60
54
|
}, (0, _preact.h)("div", {
|
|
61
55
|
class: "widget-header--title"
|
|
@@ -147,7 +141,8 @@ Vui lòng hỏi chúng tôi bất cứ điều gì hoặc chia sẻ phản hồi
|
|
|
147
141
|
}, (0, _preact.h)(_AgentsAvatar.default, {
|
|
148
142
|
plugin: this.props.plugin,
|
|
149
143
|
store: this.props.store,
|
|
150
|
-
mode: "primary"
|
|
144
|
+
mode: "primary",
|
|
145
|
+
agent_ids: []
|
|
151
146
|
})), (0, _preact.h)("div", {
|
|
152
147
|
class: "widget-header--title-container"
|
|
153
148
|
}, (0, _preact.h)("div", {
|
|
@@ -63,8 +63,10 @@ class TextMessage extends _common.Com {
|
|
|
63
63
|
class: "message-agent message-text--agent",
|
|
64
64
|
title: t
|
|
65
65
|
}, tags, this.renderTime());
|
|
66
|
+
let msgcls = 'message-user message-text--user';
|
|
67
|
+
if (this.props.ev._error) msgcls += ' message-user--error';
|
|
66
68
|
return (0, _preact.h)("div", {
|
|
67
|
-
class:
|
|
69
|
+
class: msgcls,
|
|
68
70
|
title: t
|
|
69
71
|
}, tags);
|
|
70
72
|
}
|
|
@@ -82,8 +84,10 @@ class TextMessage extends _common.Com {
|
|
|
82
84
|
onLink: this.props.onLink
|
|
83
85
|
}), this.renderTime());
|
|
84
86
|
}
|
|
87
|
+
let msgcls = 'message-user message-text--user';
|
|
88
|
+
if (this.props.ev._error) msgcls += ' message-user--error';
|
|
85
89
|
return (0, _preact.h)("div", {
|
|
86
|
-
class:
|
|
90
|
+
class: msgcls,
|
|
87
91
|
title: t
|
|
88
92
|
}, (0, _preact.h)(_block.default, {
|
|
89
93
|
block: block,
|