@subiz/widget-v4 4.1.75 → 4.1.77
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.
|
@@ -65,7 +65,7 @@ textarea[disabled=disabled] {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.message-input--send-button {
|
|
68
|
-
.inline-svg-code(~'<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24"
|
|
68
|
+
.inline-svg-code(~'<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24" stroke-width="1.5" stroke="@{esc-primary-color-esc}" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4.698 4.034l16.302 7.966l-16.302 7.966a.503 .503 0 0 1 -.546 -.124a.555 .555 0 0 1 -.12 -.568l2.468 -7.274l-2.468 -7.274a.555 .555 0 0 1 .12 -.568a.503 .503 0 0 1 .546 -.124z" fill="@{esc-primary-color-esc}"/><path d="M6.5 12h14.5" /></svg>');
|
|
69
69
|
background-image: @-inline-svg-url;
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -11,7 +11,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
11
11
|
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); }
|
|
12
12
|
const ajax = require('@subiz/ajax/src/ajax.js');
|
|
13
13
|
ajax.env.XMLHttpRequest = window.XMLHttpRequest;
|
|
14
|
-
const findAnswer = challenge => challenge.answer;
|
|
15
14
|
function jsonifyTextPlain(param, done) {
|
|
16
15
|
let req = param.request;
|
|
17
16
|
if (req.content_type === 'text/plain' && req.body !== undefined) req.body = _index.default.stringify(req.body);
|
|
@@ -58,7 +57,6 @@ class _default {
|
|
|
58
57
|
_defineProperty(this, "sendLostFocus", data => OK200);
|
|
59
58
|
_defineProperty(this, "sendContentView", data => OK200);
|
|
60
59
|
_defineProperty(this, "uploadToS3", async file => OK200);
|
|
61
|
-
_defineProperty(this, "getChallenge", accid => OK200);
|
|
62
60
|
_defineProperty(this, "time", _ => Promise.resolve({
|
|
63
61
|
code: 200,
|
|
64
62
|
body: new _index.default.Date().toISOString()
|
|
@@ -125,14 +123,6 @@ function makeFakeConvo(accid, convoid, userid, agentid) {
|
|
|
125
123
|
}],
|
|
126
124
|
ended: 1610454875505,
|
|
127
125
|
state: 'ended',
|
|
128
|
-
integration: {
|
|
129
|
-
account_id: accid,
|
|
130
|
-
connector_id: 'subikon',
|
|
131
|
-
name: 'Subiz Widget',
|
|
132
|
-
connector_type: 'subiz',
|
|
133
|
-
state: 'activated',
|
|
134
|
-
id: inteid
|
|
135
|
-
},
|
|
136
126
|
actived: 1610453070259,
|
|
137
127
|
last_message_sent: {
|
|
138
128
|
id: 'evqyiykaoizbwnkaecwphttwk',
|
|
@@ -166,6 +156,27 @@ function makeFakeConvo(accid, convoid, userid, agentid) {
|
|
|
166
156
|
}
|
|
167
157
|
function makeFakeMessages(accid, convoid, userid, agentid) {
|
|
168
158
|
let inteid = accid + '.subizv4.subikon';
|
|
159
|
+
let usermember = {
|
|
160
|
+
type: 'user',
|
|
161
|
+
id: userid,
|
|
162
|
+
last_page_view_url: 'https://subiz.com.vn/',
|
|
163
|
+
conversation_id: convoid,
|
|
164
|
+
membership: 'active',
|
|
165
|
+
invited_by: {
|
|
166
|
+
id: userid,
|
|
167
|
+
type: 'user'
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
let agentmember = {
|
|
171
|
+
type: 'agent',
|
|
172
|
+
conversation_id: convoid,
|
|
173
|
+
id: agentid,
|
|
174
|
+
membership: 'active',
|
|
175
|
+
invited_by: {
|
|
176
|
+
id: userid,
|
|
177
|
+
type: 'user'
|
|
178
|
+
}
|
|
179
|
+
};
|
|
169
180
|
return [{
|
|
170
181
|
id: 'evqyiyjmxrjsylftvnrghrfmq',
|
|
171
182
|
account_id: accid,
|
|
@@ -179,16 +190,7 @@ function makeFakeMessages(accid, convoid, userid, agentid) {
|
|
|
179
190
|
conversation: {
|
|
180
191
|
id: convoid,
|
|
181
192
|
account_id: accid,
|
|
182
|
-
members: [
|
|
183
|
-
type: 'user',
|
|
184
|
-
id: userid,
|
|
185
|
-
last_page_view_url: 'https://subiz.com.vn/',
|
|
186
|
-
membership: 'observer',
|
|
187
|
-
invited_by: {
|
|
188
|
-
id: userid,
|
|
189
|
-
type: 'user'
|
|
190
|
-
}
|
|
191
|
-
}],
|
|
193
|
+
members: [usermember],
|
|
192
194
|
state: 'pending'
|
|
193
195
|
}
|
|
194
196
|
}
|
|
@@ -205,16 +207,7 @@ function makeFakeMessages(accid, convoid, userid, agentid) {
|
|
|
205
207
|
conversation: {
|
|
206
208
|
id: convoid,
|
|
207
209
|
account_id: accid,
|
|
208
|
-
members: [
|
|
209
|
-
type: 'agent',
|
|
210
|
-
id: agentid,
|
|
211
|
-
conversation_id: convoid,
|
|
212
|
-
membership: 'observer',
|
|
213
|
-
invited_by: {
|
|
214
|
-
id: userid,
|
|
215
|
-
type: 'user'
|
|
216
|
-
}
|
|
217
|
-
}],
|
|
210
|
+
members: [agentmember],
|
|
218
211
|
state: 'pending',
|
|
219
212
|
source: 'https://subiz.com.vn/vi/'
|
|
220
213
|
}
|
|
@@ -247,16 +240,7 @@ function makeFakeMessages(accid, convoid, userid, agentid) {
|
|
|
247
240
|
data: {
|
|
248
241
|
conversation: {
|
|
249
242
|
id: convoid,
|
|
250
|
-
members: [
|
|
251
|
-
type: 'user',
|
|
252
|
-
id: userid,
|
|
253
|
-
last_page_view_url: 'https://subiz.com.vn/',
|
|
254
|
-
membership: 'active',
|
|
255
|
-
invited_by: {
|
|
256
|
-
id: userid,
|
|
257
|
-
type: 'user'
|
|
258
|
-
}
|
|
259
|
-
}]
|
|
243
|
+
members: [usermember]
|
|
260
244
|
}
|
|
261
245
|
}
|
|
262
246
|
}, {
|
|
@@ -295,16 +279,7 @@ function makeFakeMessages(accid, convoid, userid, agentid) {
|
|
|
295
279
|
data: {
|
|
296
280
|
conversation: {
|
|
297
281
|
id: convoid,
|
|
298
|
-
members: [
|
|
299
|
-
type: 'agent',
|
|
300
|
-
id: agentid,
|
|
301
|
-
conversation_id: convoid,
|
|
302
|
-
membership: 'active',
|
|
303
|
-
invited_by: {
|
|
304
|
-
id: userid,
|
|
305
|
-
type: 'user'
|
|
306
|
-
}
|
|
307
|
-
}]
|
|
282
|
+
members: [agentmember]
|
|
308
283
|
}
|
|
309
284
|
}
|
|
310
285
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@subiz/widget-v4",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.77",
|
|
4
4
|
"main": "./compiled_src/lib.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "npx webpack serve --config webpack.dev.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@subiz/storage": "0.0.8",
|
|
15
15
|
"@subiz/wsclient": "^4.0.24",
|
|
16
16
|
"cookie_js": "1.4.2",
|
|
17
|
-
"core-js": "^3.37.
|
|
17
|
+
"core-js": "^3.37.1",
|
|
18
18
|
"css-loader": "5.2.7",
|
|
19
19
|
"file-loader": "^6.2.0",
|
|
20
20
|
"less": "^4.2.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"babel-loader": "^9.1.3",
|
|
31
31
|
"babel-plugin-syntax-jsx": "^6.18.0",
|
|
32
32
|
"html-webpack-plugin": "^5.6.0",
|
|
33
|
-
"puppeteer": "^22.
|
|
33
|
+
"puppeteer": "^22.9.0",
|
|
34
34
|
"webpack": "^5.91.0",
|
|
35
35
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
36
36
|
"webpack-cli": "^5.1.4",
|
package/src/store/api_fake.js
CHANGED
|
@@ -3,8 +3,6 @@ import sb from '../util/index.js'
|
|
|
3
3
|
const ajax = require('@subiz/ajax/src/ajax.js')
|
|
4
4
|
ajax.env.XMLHttpRequest = window.XMLHttpRequest
|
|
5
5
|
|
|
6
|
-
const findAnswer = (challenge) => challenge.answer
|
|
7
|
-
|
|
8
6
|
function jsonifyTextPlain(param, done) {
|
|
9
7
|
let req = param.request
|
|
10
8
|
if (req.content_type === 'text/plain' && req.body !== undefined) req.body = sb.stringify(req.body)
|
|
@@ -31,12 +29,7 @@ export default class {
|
|
|
31
29
|
return {
|
|
32
30
|
account_id: this.accid,
|
|
33
31
|
id: 'usqzgtgfake',
|
|
34
|
-
attributes: [
|
|
35
|
-
{
|
|
36
|
-
key: 'fullname',
|
|
37
|
-
text: 'Kiều Thanh',
|
|
38
|
-
},
|
|
39
|
-
],
|
|
32
|
+
attributes: [{key: 'fullname', text: 'Kiều Thanh'}],
|
|
40
33
|
}
|
|
41
34
|
}
|
|
42
35
|
|
|
@@ -75,7 +68,6 @@ export default class {
|
|
|
75
68
|
sendContentView = (data) => OK200
|
|
76
69
|
|
|
77
70
|
uploadToS3 = async (file) => OK200
|
|
78
|
-
getChallenge = (accid) => OK200
|
|
79
71
|
|
|
80
72
|
time = (_) => Promise.resolve({code: 200, body: new sb.Date().toISOString()})
|
|
81
73
|
updateUser = (data) => OK200
|
|
@@ -124,14 +116,6 @@ function makeFakeConvo(accid, convoid, userid, agentid) {
|
|
|
124
116
|
],
|
|
125
117
|
ended: 1610454875505,
|
|
126
118
|
state: 'ended',
|
|
127
|
-
integration: {
|
|
128
|
-
account_id: accid,
|
|
129
|
-
connector_id: 'subikon',
|
|
130
|
-
name: 'Subiz Widget',
|
|
131
|
-
connector_type: 'subiz',
|
|
132
|
-
state: 'activated',
|
|
133
|
-
id: inteid,
|
|
134
|
-
},
|
|
135
119
|
actived: 1610453070259,
|
|
136
120
|
last_message_sent: {
|
|
137
121
|
id: 'evqyiykaoizbwnkaecwphttwk',
|
|
@@ -158,6 +142,22 @@ function makeFakeConvo(accid, convoid, userid, agentid) {
|
|
|
158
142
|
|
|
159
143
|
function makeFakeMessages(accid, convoid, userid, agentid) {
|
|
160
144
|
let inteid = accid + '.subizv4.subikon'
|
|
145
|
+
let usermember = {
|
|
146
|
+
type: 'user',
|
|
147
|
+
id: userid,
|
|
148
|
+
last_page_view_url: 'https://subiz.com.vn/',
|
|
149
|
+
conversation_id: convoid,
|
|
150
|
+
membership: 'active',
|
|
151
|
+
invited_by: {id: userid, type: 'user'},
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
let agentmember = {
|
|
155
|
+
type: 'agent',
|
|
156
|
+
conversation_id: convoid,
|
|
157
|
+
id: agentid,
|
|
158
|
+
membership: 'active',
|
|
159
|
+
invited_by: {id: userid, type: 'user'},
|
|
160
|
+
}
|
|
161
161
|
return [
|
|
162
162
|
{
|
|
163
163
|
id: 'evqyiyjmxrjsylftvnrghrfmq',
|
|
@@ -169,15 +169,7 @@ function makeFakeMessages(accid, convoid, userid, agentid) {
|
|
|
169
169
|
conversation: {
|
|
170
170
|
id: convoid,
|
|
171
171
|
account_id: accid,
|
|
172
|
-
members: [
|
|
173
|
-
{
|
|
174
|
-
type: 'user',
|
|
175
|
-
id: userid,
|
|
176
|
-
last_page_view_url: 'https://subiz.com.vn/',
|
|
177
|
-
membership: 'observer',
|
|
178
|
-
invited_by: {id: userid, type: 'user'},
|
|
179
|
-
},
|
|
180
|
-
],
|
|
172
|
+
members: [usermember],
|
|
181
173
|
state: 'pending',
|
|
182
174
|
},
|
|
183
175
|
},
|
|
@@ -192,15 +184,7 @@ function makeFakeMessages(accid, convoid, userid, agentid) {
|
|
|
192
184
|
conversation: {
|
|
193
185
|
id: convoid,
|
|
194
186
|
account_id: accid,
|
|
195
|
-
members: [
|
|
196
|
-
{
|
|
197
|
-
type: 'agent',
|
|
198
|
-
id: agentid,
|
|
199
|
-
conversation_id: convoid,
|
|
200
|
-
membership: 'observer',
|
|
201
|
-
invited_by: {id: userid, type: 'user'},
|
|
202
|
-
},
|
|
203
|
-
],
|
|
187
|
+
members: [agentmember],
|
|
204
188
|
state: 'pending',
|
|
205
189
|
source: 'https://subiz.com.vn/vi/',
|
|
206
190
|
},
|
|
@@ -214,7 +198,6 @@ function makeFakeMessages(accid, convoid, userid, agentid) {
|
|
|
214
198
|
by: {id: userid, type: 'user'},
|
|
215
199
|
data: {conversation: {id: convoid, account_id: accid, state: 'active'}},
|
|
216
200
|
},
|
|
217
|
-
|
|
218
201
|
{
|
|
219
202
|
id: 'evqyiyjmzaozvqgbkljbwywdl',
|
|
220
203
|
account_id: accid,
|
|
@@ -222,18 +205,7 @@ function makeFakeMessages(accid, convoid, userid, agentid) {
|
|
|
222
205
|
type: 'conversation_joined',
|
|
223
206
|
by: {id: userid, type: 'user'},
|
|
224
207
|
data: {
|
|
225
|
-
conversation: {
|
|
226
|
-
id: convoid,
|
|
227
|
-
members: [
|
|
228
|
-
{
|
|
229
|
-
type: 'user',
|
|
230
|
-
id: userid,
|
|
231
|
-
last_page_view_url: 'https://subiz.com.vn/',
|
|
232
|
-
membership: 'active',
|
|
233
|
-
invited_by: {id: userid, type: 'user'},
|
|
234
|
-
},
|
|
235
|
-
],
|
|
236
|
-
},
|
|
208
|
+
conversation: {id: convoid, members: [usermember]},
|
|
237
209
|
},
|
|
238
210
|
},
|
|
239
211
|
{
|
|
@@ -259,20 +231,7 @@ function makeFakeMessages(accid, convoid, userid, agentid) {
|
|
|
259
231
|
created: 1616213237491,
|
|
260
232
|
type: 'conversation_joined',
|
|
261
233
|
by: {id: userid, type: 'user'},
|
|
262
|
-
data: {
|
|
263
|
-
conversation: {
|
|
264
|
-
id: convoid,
|
|
265
|
-
members: [
|
|
266
|
-
{
|
|
267
|
-
type: 'agent',
|
|
268
|
-
id: agentid,
|
|
269
|
-
conversation_id: convoid,
|
|
270
|
-
membership: 'active',
|
|
271
|
-
invited_by: {id: userid, type: 'user'},
|
|
272
|
-
},
|
|
273
|
-
],
|
|
274
|
-
},
|
|
275
|
-
},
|
|
234
|
+
data: {conversation: {id: convoid, members: [agentmember]}},
|
|
276
235
|
},
|
|
277
236
|
{
|
|
278
237
|
id: 'evqyiyjrhtroknjyakrlrwhgr',
|