@subiz/widget-v4 4.1.41 → 4.1.42
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/compiled_src/call/css.js +1 -2
- package/compiled_src/chatbox/css.js +1 -2
- package/compiled_src/common.js +1 -2
- package/compiled_src/contact/contact.js +2 -3
- package/compiled_src/contact/css.js +1 -2
- package/compiled_src/lib.js +1 -2
- package/compiled_src/notif/css.js +1 -2
- package/compiled_src/popup/css.js +1 -2
- package/compiled_src/popup/tick.core.commonjs.js +1 -2
- package/compiled_src/store/api.js +2 -1
- package/compiled_src/store/store.js +2 -4
- package/compiled_src/util/common.js +10 -20
- package/compiled_src/util/index.js +1 -2
- package/package.json +8 -8
- package/src/store/api.js +3 -1
- package/src/store/store.js +2 -6
package/compiled_src/call/css.js
CHANGED
|
@@ -4,5 +4,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _default = require('css-loader!less-loader!../../assets/less/notif.less');
|
|
8
|
-
exports.default = _default;
|
|
7
|
+
var _default = exports.default = require('css-loader!less-loader!../../assets/less/notif.less');
|
|
@@ -4,5 +4,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _default = require('css-loader!less-loader!../../assets/less/chatbox.less');
|
|
8
|
-
exports.default = _default;
|
|
7
|
+
var _default = exports.default = require('css-loader!less-loader!../../assets/less/chatbox.less');
|
package/compiled_src/common.js
CHANGED
|
@@ -65,8 +65,7 @@ const getLocale = (plugin, loc) => {
|
|
|
65
65
|
return plugin.locale || 'en-US';
|
|
66
66
|
};
|
|
67
67
|
exports.getLocale = getLocale;
|
|
68
|
-
let langMessages = {};
|
|
69
|
-
exports.langMessages = langMessages;
|
|
68
|
+
let langMessages = exports.langMessages = {};
|
|
70
69
|
let downloadLock = false;
|
|
71
70
|
function downloadLanguage(store, locale, force) {
|
|
72
71
|
if (downloadLock) return new Promise(resolve => _index.default.setTimeout(() => downloadLanguage(store, locale, force).then(resolve), 100));
|
|
@@ -356,10 +356,9 @@ function replaceCssVariable(css, setting) {
|
|
|
356
356
|
}
|
|
357
357
|
return ret.join('');
|
|
358
358
|
}
|
|
359
|
-
const DEFVAL = {
|
|
359
|
+
const DEFVAL = exports.DEFVAL = {
|
|
360
360
|
font_size: '16px',
|
|
361
361
|
font_family: 'roboto',
|
|
362
362
|
text_color: '#333',
|
|
363
363
|
primary_color: '#333'
|
|
364
|
-
};
|
|
365
|
-
exports.DEFVAL = DEFVAL;
|
|
364
|
+
};
|
|
@@ -4,5 +4,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _default = require('css-loader!less-loader!../../assets/less/contact.less');
|
|
8
|
-
exports.default = _default;
|
|
7
|
+
var _default = exports.default = require('css-loader!less-loader!../../assets/less/contact.less');
|
package/compiled_src/lib.js
CHANGED
|
@@ -4,5 +4,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _default = require('css-loader!less-loader!../../assets/less/notif.less');
|
|
8
|
-
exports.default = _default;
|
|
7
|
+
var _default = exports.default = require('css-loader!less-loader!../../assets/less/notif.less');
|
|
@@ -4,5 +4,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _default = require('css-loader!less-loader!../../assets/less/popup.less');
|
|
8
|
-
exports.default = _default;
|
|
7
|
+
var _default = exports.default = require('css-loader!less-loader!../../assets/less/popup.less');
|
|
@@ -145,8 +145,9 @@ class _default {
|
|
|
145
145
|
let outuser;
|
|
146
146
|
for (let i = 0; true; i++) {
|
|
147
147
|
outuser = await ajax.setBaseUrl(this.ApiURL).withCredentials(true).addQuery('v', '6').addQuery('x-user-ref', this.ref).setParser('json').get(`/accounts/${this.accid}/users/${this.ref}`);
|
|
148
|
+
if (outuser.error && _index.default.get(outuser, 'body.code', '').indexOf('locked_account') != -1) break;
|
|
148
149
|
if (!_index.default.get(outuser, 'body.id')) {
|
|
149
|
-
let sleeptime = Math.min(2000 + i *
|
|
150
|
+
let sleeptime = Math.min(2000 + i * 400, 60000);
|
|
150
151
|
await _index.default.sleep(sleeptime);
|
|
151
152
|
continue;
|
|
152
153
|
}
|
|
@@ -360,9 +360,7 @@ class Store {
|
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
if (this.cookie.get('__sbref', userRef) != userRef)
|
|
364
|
-
cleanMyLocalStorage();
|
|
365
|
-
}
|
|
363
|
+
if (this.cookie.get('__sbref', userRef) != userRef) cleanMyLocalStorage();
|
|
366
364
|
this.api.setAuth({
|
|
367
365
|
accid: accid
|
|
368
366
|
});
|
|
@@ -372,7 +370,7 @@ class Store {
|
|
|
372
370
|
mask: mask,
|
|
373
371
|
ref: userRef
|
|
374
372
|
});
|
|
375
|
-
if (user.error) return;
|
|
373
|
+
if (user.error) return console.error(user);
|
|
376
374
|
if (this.realtime) this.realtime.stop();
|
|
377
375
|
if (this.fake) this.realtime = new _realtime_fake.default();else this.realtime = new Realtime(this.RealtimeURL, {
|
|
378
376
|
account_id: accid,
|
|
@@ -75,23 +75,15 @@ function parseJSON(str) {
|
|
|
75
75
|
var f = document.createElement('iframe');
|
|
76
76
|
f.style.display = 'none';
|
|
77
77
|
document.documentElement.appendChild(f);
|
|
78
|
-
var stringify = f.contentWindow.JSON.stringify;
|
|
79
|
-
exports.stringify = stringify;
|
|
78
|
+
var stringify = exports.stringify = f.contentWindow.JSON.stringify;
|
|
80
79
|
var parse = f.contentWindow.JSON.parse;
|
|
81
|
-
var Date = f.contentWindow.Date;
|
|
82
|
-
exports.
|
|
83
|
-
var
|
|
84
|
-
exports.
|
|
85
|
-
var
|
|
86
|
-
exports.
|
|
87
|
-
var
|
|
88
|
-
exports.setInterval = setInterval;
|
|
89
|
-
var clearInterval = f.contentWindow.clearInterval.bind(f.contentWindow);
|
|
90
|
-
exports.clearInterval = clearInterval;
|
|
91
|
-
var clearTimeout = f.contentWindow.clearTimeout.bind(f.contentWindow);
|
|
92
|
-
exports.clearTimeout = clearTimeout;
|
|
93
|
-
var XMLHttpRequest = f.contentWindow.XMLHttpRequest;
|
|
94
|
-
exports.XMLHttpRequest = XMLHttpRequest;
|
|
80
|
+
var Date = exports.Date = f.contentWindow.Date;
|
|
81
|
+
var requestAnimationFrame = exports.requestAnimationFrame = f.contentWindow.requestAnimationFrame;
|
|
82
|
+
var setTimeout = exports.setTimeout = f.contentWindow.setTimeout.bind(f.contentWindow);
|
|
83
|
+
var setInterval = exports.setInterval = f.contentWindow.setInterval.bind(f.contentWindow);
|
|
84
|
+
var clearInterval = exports.clearInterval = f.contentWindow.clearInterval.bind(f.contentWindow);
|
|
85
|
+
var clearTimeout = exports.clearTimeout = f.contentWindow.clearTimeout.bind(f.contentWindow);
|
|
86
|
+
var XMLHttpRequest = exports.XMLHttpRequest = f.contentWindow.XMLHttpRequest;
|
|
95
87
|
function convoOfEv(ev) {
|
|
96
88
|
if (!ev) return '';
|
|
97
89
|
switch (ev.type) {
|
|
@@ -552,9 +544,8 @@ function setCss(id, $css, css) {
|
|
|
552
544
|
$css.appendChild(document.createTextNode(css));
|
|
553
545
|
}
|
|
554
546
|
}
|
|
555
|
-
const DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL = 'https://vcdn.subiz-cdn.com/file/bubble_11.svg?v=5';
|
|
556
|
-
exports.
|
|
557
|
-
const DEFVAL = {
|
|
547
|
+
const DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL = exports.DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL = 'https://vcdn.subiz-cdn.com/file/bubble_11.svg?v=5';
|
|
548
|
+
const DEFVAL = exports.DEFVAL = {
|
|
558
549
|
primary_color: '#0265FF',
|
|
559
550
|
secondary_color: '#555555',
|
|
560
551
|
background: 'linear-gradient(280.16deg, #0053d3 22.03%, #0265ff 78.2%)',
|
|
@@ -581,7 +572,6 @@ const DEFVAL = {
|
|
|
581
572
|
widget_position: 'fixed',
|
|
582
573
|
z_index: 2000000000
|
|
583
574
|
};
|
|
584
|
-
exports.DEFVAL = DEFVAL;
|
|
585
575
|
function js2css(js, onlyprops, variables) {
|
|
586
576
|
var newjs = {};
|
|
587
577
|
for (var prop in js) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@subiz/widget-v4",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.42",
|
|
4
4
|
"main": "./compiled_src/lib.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "npx webpack serve --config webpack.dev.js",
|
|
@@ -14,25 +14,25 @@
|
|
|
14
14
|
"@subiz/storage": "0.0.8",
|
|
15
15
|
"@subiz/wsclient": "^4.0.16",
|
|
16
16
|
"cookie_js": "1.4.2",
|
|
17
|
-
"core-js": "^3.
|
|
17
|
+
"core-js": "^3.33.0",
|
|
18
18
|
"css-loader": "5.2.7",
|
|
19
19
|
"file-loader": "^6.2.0",
|
|
20
20
|
"less": "^4.2.0",
|
|
21
21
|
"less-loader": "^11.1.3",
|
|
22
|
-
"marked": "^9.0.
|
|
23
|
-
"preact": "^10.
|
|
22
|
+
"marked": "^9.0.3",
|
|
23
|
+
"preact": "^10.18.1"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@babel/cli": "^7.
|
|
27
|
-
"@babel/core": "^7.
|
|
26
|
+
"@babel/cli": "^7.23.0",
|
|
27
|
+
"@babel/core": "^7.23.0",
|
|
28
28
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
29
29
|
"@babel/plugin-transform-react-jsx": "^7.22.15",
|
|
30
|
-
"@babel/preset-env": "^7.22.
|
|
30
|
+
"@babel/preset-env": "^7.22.20",
|
|
31
31
|
"babel-loader": "^9.1.3",
|
|
32
32
|
"babel-plugin-syntax-jsx": "^6.18.0",
|
|
33
33
|
"html-webpack-plugin": "^5.5.3",
|
|
34
34
|
"prettier": "^3.0.3",
|
|
35
|
-
"puppeteer": "^21.
|
|
35
|
+
"puppeteer": "^21.3.6",
|
|
36
36
|
"webpack": "^5.88.2",
|
|
37
37
|
"webpack-bundle-analyzer": "^4.9.1",
|
|
38
38
|
"webpack-cli": "^5.1.4",
|
package/src/store/api.js
CHANGED
|
@@ -63,8 +63,10 @@ export default class {
|
|
|
63
63
|
.addQuery('x-user-ref', this.ref)
|
|
64
64
|
.setParser('json')
|
|
65
65
|
.get(`/accounts/${this.accid}/users/${this.ref}`)
|
|
66
|
+
if (outuser.error && sb.get(outuser, 'body.code', '').indexOf('locked_account') != -1) break
|
|
67
|
+
|
|
66
68
|
if (!sb.get(outuser, 'body.id')) {
|
|
67
|
-
let sleeptime = Math.min(2000 + i *
|
|
69
|
+
let sleeptime = Math.min(2000 + i * 400, 60000)
|
|
68
70
|
await sb.sleep(sleeptime)
|
|
69
71
|
continue
|
|
70
72
|
}
|
package/src/store/store.js
CHANGED
|
@@ -418,16 +418,12 @@ export default class Store {
|
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
|
|
421
|
-
if (this.cookie.get('__sbref', userRef) != userRef)
|
|
422
|
-
cleanMyLocalStorage()
|
|
423
|
-
}
|
|
424
|
-
|
|
421
|
+
if (this.cookie.get('__sbref', userRef) != userRef) cleanMyLocalStorage()
|
|
425
422
|
this.api.setAuth({accid: accid})
|
|
426
423
|
// set cookie forever
|
|
427
424
|
if (userRef) this.cookie.set('__sbref', userRef)
|
|
428
|
-
|
|
429
425
|
let user = await this.api.setAuth({accid: accid, mask: mask, ref: userRef})
|
|
430
|
-
if (user.error) return
|
|
426
|
+
if (user.error) return console.error(user)
|
|
431
427
|
|
|
432
428
|
if (this.realtime) this.realtime.stop()
|
|
433
429
|
if (this.fake) this.realtime = new RealtimeFake()
|