@subiz/widget-v4 4.0.57 → 4.0.61

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 (45) hide show
  1. package/assets/less/chatbox.less +2 -0
  2. package/compiled_src/chatbox/Header.js +2 -0
  3. package/compiled_src/chatbox/main.js +2 -1
  4. package/compiled_src/lib.js +9 -2
  5. package/compiled_src/popup/popup.js +33 -3
  6. package/compiled_src/store/store.js +7 -5
  7. package/compiled_src/util/common.js +4 -2
  8. package/dist/{17d83c40640.178.js → 17db8166252.178.js} +0 -0
  9. package/dist/17db8166252.213.js +1 -0
  10. package/dist/{17d83c40640.362.js → 17db8166252.362.js} +0 -0
  11. package/dist/{17d83c40640.441.js → 17db8166252.441.js} +0 -0
  12. package/dist/{17d83c40640.605.js → 17db8166252.605.js} +0 -0
  13. package/dist/{17d83c40640.619.js → 17db8166252.619.js} +0 -0
  14. package/dist/{17d83c40640.678.js → 17db8166252.678.js} +0 -0
  15. package/dist/17db8166252.74.js +1 -0
  16. package/dist/{17d83c40640.782.js → 17db8166252.782.js} +0 -0
  17. package/dist/17db8166252.app.js +1 -0
  18. package/dist/{17d83c40640.index.html → 17db8166252.index.html} +2 -1
  19. package/dist/{17d83c40640.library.html → 17db8166252.library.html} +2 -1
  20. package/dist/17db8166252.library.js +1 -0
  21. package/dist/{17d83c40640.preview.html → 17db8166252.preview.html} +1 -1
  22. package/dist/17db8166252.preview.js +1 -0
  23. package/dist/17db8166252.screenshoot.js +1 -0
  24. package/dist/213.js +30 -1
  25. package/dist/74.js +4 -1
  26. package/dist/HASH +1 -1
  27. package/dist/screenshoot.html +1 -1
  28. package/dist/screenshoot.js +20 -9
  29. package/index.html +1 -0
  30. package/order.html +784 -0
  31. package/order.js +0 -0
  32. package/package.json +10 -10
  33. package/src/chatbox/Header.js +42 -34
  34. package/src/chatbox/main.js +2 -2
  35. package/src/lib.js +8 -3
  36. package/src/popup/popup.js +27 -2
  37. package/src/store/store.js +9 -5
  38. package/src/util/common.js +4 -2
  39. package/test.js +1 -0
  40. package/dist/17d83c40640.213.js +0 -1
  41. package/dist/17d83c40640.74.js +0 -1
  42. package/dist/17d83c40640.app.js +0 -1
  43. package/dist/17d83c40640.library.js +0 -1
  44. package/dist/17d83c40640.preview.js +0 -1
  45. package/dist/17d83c40640.screenshoot.js +0 -1
package/dist/74.js CHANGED
@@ -771,6 +771,8 @@ Vui lòng hỏi chúng tôi bất cứ điều gì hoặc chia sẻ phản hồi
771
771
  }
772
772
 
773
773
  renderCloseButton() {
774
+ let accSetting = this.props.plugin.chatbox || {};
775
+ if (accSetting.hide_close_button) return null;
774
776
  return (0,preact_module.h)("div", {
775
777
  class: "widget-header--button widget-header--button-close",
776
778
  "data-tooltip": this.props.t('close'),
@@ -4450,7 +4452,8 @@ class Main extends common/* Com */.M {
4450
4452
  view: this.props.store.matchLastview().view
4451
4453
  }));
4452
4454
  } else {
4453
- this.hideWidget();
4455
+ restoreViewport();
4456
+ if (!this.state.isShowWidget) this.hideWidget();
4454
4457
  }
4455
4458
  }
4456
4459
 
package/dist/HASH CHANGED
@@ -1 +1 @@
1
- 17d83c40640
1
+ 17db8166252
@@ -4,4 +4,4 @@
4
4
  }
5
5
  body {
6
6
  background: #ddd;
7
- }</style></head><body><script defer="defer" src="https://vcdn.subiz-cdn.com/widget-v4/public/17d83c40640.screenshoot.js"></script></body></html>
7
+ }</style></head><body><script defer="defer" src="https://vcdn.subiz-cdn.com/widget-v4/public/17db8166252.screenshoot.js"></script></body></html>
@@ -2281,7 +2281,7 @@ function getDayName(dayOfWeek) {
2281
2281
  return days[dayOfWeek];
2282
2282
  }
2283
2283
  let loadedFonts = {};
2284
- function preloadWebfonts(fonts) {
2284
+ function preloadWebfonts(fonts, done) {
2285
2285
  for (var i = 0; i < fonts.length; i++) {
2286
2286
  let font = fonts[i];
2287
2287
  if (!font) continue;
@@ -2294,7 +2294,9 @@ function preloadWebfonts(fonts) {
2294
2294
  node.innerHTML = '@!-/#Chào mỪng1';
2295
2295
  node.style.position = 'absolute';
2296
2296
  node.style.display = 'block';
2297
- node.style.fontSize = '1px';
2297
+ node.style.opacity = '0.1';
2298
+ node.style.color = 'transparent';
2299
+ node.style.fontSize = '20px';
2298
2300
  node.style.height = '0px';
2299
2301
  node.style.width = '0px';
2300
2302
  node.style.fontWeight = weight;
@@ -4325,18 +4327,19 @@ class Store {
4325
4327
  if (!this.isInsync('account')) this.reconnect();
4326
4328
  }
4327
4329
 
4328
- async init(accid) {
4330
+ async init(accid, mask) {
4329
4331
  this.readyGate.close();
4330
4332
  accid = (accid || '').trim();
4331
4333
  this.api.setAuth({
4332
4334
  accid: accid
4333
4335
  });
4334
4336
  this.g_sync = {};
4335
- let mask = '';
4336
4337
 
4337
- try {
4338
- mask = this.cookie.get('__sbmask', '');
4339
- } catch (e) {}
4338
+ if (!mask) {
4339
+ try {
4340
+ mask = this.cookie.get('__sbmask', '');
4341
+ } catch (e) {}
4342
+ }
4340
4343
 
4341
4344
  let localstorageMask = this.kv.match('mask');
4342
4345
  if (!mask && localstorageMask) mask = localstorageMask;
@@ -4379,6 +4382,7 @@ class Store {
4379
4382
  await this.reconnect();
4380
4383
  this.readyGate.open();
4381
4384
  this.reconnectWs(accid, userId);
4385
+ return mask;
4382
4386
  }
4383
4387
 
4384
4388
  seenLoop() {
@@ -5551,8 +5555,13 @@ class Widget {
5551
5555
  xhttp.send();
5552
5556
  }
5553
5557
 
5554
- async setAccount(id, $container) {
5555
- await this.store.init(id);
5558
+ async waitReady(cb) {
5559
+ await this.store.readyGate.entry();
5560
+ cb();
5561
+ }
5562
+
5563
+ async setAccount(id, $container, mask, cb) {
5564
+ let outmask = await this.store.init(id, mask);
5556
5565
  if (!$container) $container = document.body;
5557
5566
  this.pluginMgr = new PluginMgr(this, $container);
5558
5567
  let clean = setInterval(() => {
@@ -5561,6 +5570,8 @@ class Widget {
5561
5570
  clearInterval(clean);
5562
5571
  }, 1000);
5563
5572
  this.domGate.open();
5573
+ cb && cb(outmask);
5574
+ return outmask;
5564
5575
  }
5565
5576
 
5566
5577
  _setAccount(id, $con) {
package/index.html CHANGED
@@ -33,6 +33,7 @@
33
33
  window.subiz.q = []
34
34
  // set account it in the very first call
35
35
  window.subiz('setAccount', accid)
36
+ window.subiz('expandWidget')
36
37
  </script>
37
38
  </body>
38
39
  </html>