@subiz/widget-v4 4.1.174 → 4.1.175
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/widget.less +10 -1
- package/chat.js +10 -0
- package/compiled_src/plugin.js +2 -0
- package/compiled_src/store/api.js +30 -2
- package/dist/185.js +10 -10
- package/dist/{198c50be7a7.app.js → 198cd86b62f.app.js} +1 -1
- package/dist/{198c50be7a7.chat.html → 198cd86b62f.chat.html} +1 -1
- package/dist/{198c50be7a7.chat.js → 198cd86b62f.chat.js} +1 -1
- package/dist/{198c50be7a7.form.html → 198cd86b62f.form.html} +1 -1
- package/dist/{198c50be7a7.form.js → 198cd86b62f.form.js} +1 -1
- package/dist/{198c50be7a7.index.html → 198cd86b62f.index.html} +1 -1
- package/dist/{198c50be7a7.library.html → 198cd86b62f.library.html} +1 -1
- package/dist/{198c50be7a7.library.js → 198cd86b62f.library.js} +1 -1
- package/dist/{198c50be7a7.preview.html → 198cd86b62f.preview.html} +1 -1
- package/dist/{198c50be7a7.preview.js → 198cd86b62f.preview.js} +1 -1
- package/dist/{198c50be7a7.webview.js → 198cd86b62f.webview.js} +1 -1
- package/dist/HASH +1 -1
- package/dist/screenshoot.js +14 -13
- package/package.json +1 -1
- package/src/plugin.js +3 -1
- package/src/store/api.js +30 -0
- package/tracking.js +4 -1
- /package/dist/{198c50be7a7.127.js → 198cd86b62f.127.js} +0 -0
- /package/dist/{198c50be7a7.132.js → 198cd86b62f.132.js} +0 -0
- /package/dist/{198c50be7a7.185.js → 198cd86b62f.185.js} +0 -0
- /package/dist/{198c50be7a7.27.js → 198cd86b62f.27.js} +0 -0
- /package/dist/{198c50be7a7.278.js → 198cd86b62f.278.js} +0 -0
- /package/dist/{198c50be7a7.339.js → 198cd86b62f.339.js} +0 -0
- /package/dist/{198c50be7a7.459.js → 198cd86b62f.459.js} +0 -0
- /package/dist/{198c50be7a7.490.js → 198cd86b62f.490.js} +0 -0
- /package/dist/{198c50be7a7.74.js → 198cd86b62f.74.js} +0 -0
- /package/dist/{198c50be7a7.997.js → 198cd86b62f.997.js} +0 -0
package/assets/less/widget.less
CHANGED
|
@@ -292,7 +292,16 @@
|
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
.widget-body.embed-chat {
|
|
295
|
-
|
|
295
|
+
.widget-body--events {
|
|
296
|
+
width: 600px;
|
|
297
|
+
margin: 0 auto;
|
|
298
|
+
max-width: 100%;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.message-input {
|
|
302
|
+
max-width: 600px;
|
|
303
|
+
margin: 20px auto;
|
|
304
|
+
}
|
|
296
305
|
}
|
|
297
306
|
|
|
298
307
|
.widget-body--content {
|
package/chat.js
CHANGED
|
@@ -33,6 +33,16 @@ async function run() {
|
|
|
33
33
|
window.subiz = subiz
|
|
34
34
|
if (botid) {
|
|
35
35
|
await subiz.overrideBotId(botid)
|
|
36
|
+
subiz.overrideChatbox({
|
|
37
|
+
chatbox: {
|
|
38
|
+
offline_form: {
|
|
39
|
+
enabled: false,
|
|
40
|
+
},
|
|
41
|
+
prechat_form: {
|
|
42
|
+
enabled: false,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
})
|
|
36
46
|
}
|
|
37
47
|
subiz._overrideDeviceType('mobile')
|
|
38
48
|
if (window.innerWidth > 760) {
|
package/compiled_src/plugin.js
CHANGED
|
@@ -182,7 +182,9 @@ function Plugin(plugin, store, $container, lib) {
|
|
|
182
182
|
if (tr.type === 'after_pageview') _index.default.trackTimeOnPage(tr.after_pageview_sec, run);
|
|
183
183
|
}
|
|
184
184
|
this.update(plugin);
|
|
185
|
+
if (typeof sbz_info != 'undefined') sbz_info['load_lang'] = _index.default.Date.now();
|
|
185
186
|
common.downloadLanguage(store, _locale).then(() => {
|
|
187
|
+
if (typeof sbz_info != 'undefined') sbz_info['load_lang_done'] = _index.default.Date.now();
|
|
186
188
|
this.t = t;
|
|
187
189
|
this.update(plugin);
|
|
188
190
|
});
|
|
@@ -15,6 +15,34 @@ function jsonifyTextPlain(param, done) {
|
|
|
15
15
|
if (req.content_type === 'text/plain' && req.body !== undefined) req.body = _index.default.stringify(req.body);
|
|
16
16
|
done(true);
|
|
17
17
|
}
|
|
18
|
+
let reqi = 0;
|
|
19
|
+
let trackRequestFn = (param, done) => {
|
|
20
|
+
if (typeof sbz_info == 'undefined') return done(true);
|
|
21
|
+
let req = param.request;
|
|
22
|
+
reqi++;
|
|
23
|
+
req._id = reqi;
|
|
24
|
+
sbz_info['ajax.' + reqi] = {
|
|
25
|
+
created: _index.default.Date.now(),
|
|
26
|
+
method: req.method,
|
|
27
|
+
baseurl: req.baseurl,
|
|
28
|
+
query: req.query
|
|
29
|
+
};
|
|
30
|
+
done(true);
|
|
31
|
+
};
|
|
32
|
+
let trackResponseFn = (param, done) => {
|
|
33
|
+
if (typeof sbz_info == 'undefined') return done(true);
|
|
34
|
+
let req = param.request;
|
|
35
|
+
let reqi = req._id;
|
|
36
|
+
if (!sbz_info['ajax.' + reqi]) sbz_info['ajax.' + reqi] = {
|
|
37
|
+
created: 0
|
|
38
|
+
};
|
|
39
|
+
sbz_info['ajax.' + reqi].out = {
|
|
40
|
+
duration: _index.default.Date.now() - sbz_info['ajax.' + reqi].created,
|
|
41
|
+
code: param.code,
|
|
42
|
+
err: param.err
|
|
43
|
+
};
|
|
44
|
+
done(true);
|
|
45
|
+
};
|
|
18
46
|
class _default {
|
|
19
47
|
constructor(ApiURL, FileURL) {
|
|
20
48
|
_defineProperty(this, "listConversations", _ => this.apireq.addQuery('user_id', this.uid).addQuery('integration_id', `${this.accid}.subizv4.subikon`).get(`/accounts/${this.accid}/conversations`));
|
|
@@ -171,8 +199,8 @@ class _default {
|
|
|
171
199
|
this.refreshLock = new _index.default.Mutex();
|
|
172
200
|
this.FileURL = FileURL;
|
|
173
201
|
this.ApiURL = ApiURL;
|
|
174
|
-
this.api41 = ajax.setBaseUrl('https://api.sbz.vn/4.1').withCredentials(true).setContentType('text/plain').beforeHook(jsonifyTextPlain).setParser('json');
|
|
175
|
-
this.apireq = ajax.setBaseUrl(ApiURL).withCredentials(true).addQuery('v', '6').setContentType('text/plain').beforeHook(jsonifyTextPlain).setParser('json').beforeHook((param, done) => {
|
|
202
|
+
this.api41 = ajax.setBaseUrl('https://api.sbz.vn/4.1').withCredentials(true).setContentType('text/plain').beforeHook(jsonifyTextPlain).afterHook(trackResponseFn).beforeHook(trackRequestFn).setParser('json');
|
|
203
|
+
this.apireq = ajax.setBaseUrl(ApiURL).withCredentials(true).addQuery('v', '6').setContentType('text/plain').beforeHook(jsonifyTextPlain).afterHook(trackResponseFn).setParser('json').beforeHook(trackRequestFn).beforeHook((param, done) => {
|
|
176
204
|
if (this.token_generator) {
|
|
177
205
|
let user_id = this.profile_id;
|
|
178
206
|
this.token_generator().then(token => {
|
package/dist/185.js
CHANGED
|
@@ -854,25 +854,25 @@ class order_Order extends common/* Com */.Mw {
|
|
|
854
854
|
renderDesktopPaymentMethod(order) {
|
|
855
855
|
return null;
|
|
856
856
|
// removed by dead control flow
|
|
857
|
-
|
|
857
|
+
|
|
858
858
|
// removed by dead control flow
|
|
859
|
-
|
|
859
|
+
|
|
860
860
|
// removed by dead control flow
|
|
861
|
-
|
|
861
|
+
|
|
862
862
|
// removed by dead control flow
|
|
863
|
-
|
|
863
|
+
|
|
864
864
|
// removed by dead control flow
|
|
865
|
-
|
|
865
|
+
|
|
866
866
|
// removed by dead control flow
|
|
867
|
-
|
|
867
|
+
|
|
868
868
|
// removed by dead control flow
|
|
869
|
-
|
|
869
|
+
|
|
870
870
|
// removed by dead control flow
|
|
871
|
-
|
|
871
|
+
|
|
872
872
|
// removed by dead control flow
|
|
873
|
-
|
|
873
|
+
|
|
874
874
|
// removed by dead control flow
|
|
875
|
-
|
|
875
|
+
|
|
876
876
|
}
|
|
877
877
|
renderDesktopShipping(order) {
|
|
878
878
|
let editmode = false;
|