@subiz/widget-v4 4.1.144 → 4.1.145

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 (30) hide show
  1. package/compiled_src/chatbox/Header.js +18 -1
  2. package/config.js +1 -1
  3. package/dist/196d399136f.app.js +1 -0
  4. package/dist/{196d3465f26.form.html → 196d399136f.form.html} +1 -1
  5. package/dist/196d399136f.form.js +1 -0
  6. package/dist/{196d3465f26.index.html → 196d399136f.index.html} +1 -1
  7. package/dist/{196d3465f26.library.html → 196d399136f.library.html} +1 -1
  8. package/dist/196d399136f.library.js +1 -0
  9. package/dist/{196d3465f26.preview.html → 196d399136f.preview.html} +1 -1
  10. package/dist/196d399136f.preview.js +1 -0
  11. package/dist/196d399136f.webview.js +1 -0
  12. package/dist/HASH +1 -1
  13. package/dist/screenshoot.js +3 -5
  14. package/package.json +3 -3
  15. package/src/chatbox/Header.js +20 -1
  16. package/dist/196d3465f26.app.js +0 -1
  17. package/dist/196d3465f26.form.js +0 -1
  18. package/dist/196d3465f26.library.js +0 -1
  19. package/dist/196d3465f26.preview.js +0 -1
  20. package/dist/196d3465f26.webview.js +0 -1
  21. /package/dist/{196d3465f26.127.js → 196d399136f.127.js} +0 -0
  22. /package/dist/{196d3465f26.132.js → 196d399136f.132.js} +0 -0
  23. /package/dist/{196d3465f26.185.js → 196d399136f.185.js} +0 -0
  24. /package/dist/{196d3465f26.27.js → 196d399136f.27.js} +0 -0
  25. /package/dist/{196d3465f26.278.js → 196d399136f.278.js} +0 -0
  26. /package/dist/{196d3465f26.339.js → 196d399136f.339.js} +0 -0
  27. /package/dist/{196d3465f26.459.js → 196d399136f.459.js} +0 -0
  28. /package/dist/{196d3465f26.490.js → 196d399136f.490.js} +0 -0
  29. /package/dist/{196d3465f26.74.js → 196d399136f.74.js} +0 -0
  30. /package/dist/{196d3465f26.997.js → 196d399136f.997.js} +0 -0
package/dist/HASH CHANGED
@@ -1 +1 @@
1
- 196d3465f26
1
+ 196d399136f
@@ -916,10 +916,10 @@ function Realtime(apiUrls, credential, callAPI, accid, skipautoreconnect) {
916
916
  randomUrl,
917
917
  credential,
918
918
  function (code, body, status) {
919
- if (myconn != conn) return // outdated
919
+ if (conn === undefined || myconn != conn) return // outdated
920
920
  conn = undefined // prevent dupplicate dead fire
921
921
  pubsub.emit('interrupted', code, body, status)
922
- // if (!skipautoreconnect) setTimeout(reconnect, 2000) // reconnect and resubscribe after 2 sec
922
+ if (!skipautoreconnect) setTimeout(reconnect, 2000) // reconnect and resubscribe after 2 sec
923
923
  },
924
924
  function (events) {
925
925
  if (myconn != conn) return
@@ -5003,9 +5003,7 @@ class Store {
5003
5003
  await util/* default */.A.sleep(this.CONNECTION_CHECK_INTERVAL);
5004
5004
  if (!this.realtime) continue;
5005
5005
  if (!this.realtime.getStatus || !this.realtime.reconnect) continue;
5006
- if (this.connectionStatus === 'dead') {
5007
- await this.realtime.reconnect();
5008
- }
5006
+ if (this.connectionStatus === 'dead') {}
5009
5007
  let currentStatus = this.connectionStatus;
5010
5008
  this.connectionStatus = this.realtime.getStatus();
5011
5009
  if (currentStatus !== this.connectionStatus) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subiz/widget-v4",
3
- "version": "4.1.144",
3
+ "version": "4.1.145",
4
4
  "main": "./compiled_src/lib.js",
5
5
  "scripts": {
6
6
  "dev": "npx webpack serve --config webpack.dev.js",
@@ -30,8 +30,8 @@
30
30
  "babel-plugin-syntax-jsx": "^6.18.0",
31
31
  "html-webpack-plugin": "^5.6.3",
32
32
  "prettier": "^3.5.3",
33
- "puppeteer": "^24.8.2",
34
- "webpack": "^5.99.8",
33
+ "puppeteer": "^24.9.0",
34
+ "webpack": "^5.99.9",
35
35
  "webpack-bundle-analyzer": "^4.10.2",
36
36
  "webpack-cli": "^6.0.1",
37
37
  "webpack-dev-server": "^5.2.1"
@@ -23,6 +23,23 @@ export default class Header extends Com {
23
23
  )
24
24
  }
25
25
 
26
+ renderAgentAvatar = () => {
27
+ let accSetting = this.props.plugin.chatbox || {}
28
+ let agids = sb.get(accSetting, 'header.agent_ids') || []
29
+ let agent = sb.get(this.props.store.matchAgent(agids[0]))
30
+ let logoUrl = sb.get(agent, 'avatar_url_128') || sb.get(agent, 'avatar_url')
31
+
32
+ if (!logoUrl) return
33
+ return (
34
+ <img
35
+ width={38}
36
+ height={38}
37
+ class='avatar avatar__account'
38
+ src={this.props.store.replaceFileUrl(logoUrl) || require('../../assets/img/image_default.png')}
39
+ />
40
+ )
41
+ }
42
+
26
43
  render() {
27
44
  let headerMode = 'collapsed'
28
45
 
@@ -66,10 +83,12 @@ export default class Header extends Com {
66
83
  let style = ''
67
84
  if (!classic) $back = this.renderBackButton()
68
85
  else style = 'padding-bottom: 75px !important;'
86
+
87
+ let layout = sb.get(accSetting, 'header.layout')
69
88
  return (
70
89
  <div class={cls} style={style}>
71
90
  {$back}
72
- {this.renderAccountAvatar()}
91
+ {layout === 'agent' ? this.renderAgentAvatar() : this.renderAccountAvatar()}
73
92
  <div class='widget-header--title-container'>
74
93
  <div class='widget-header--title'>{this.getTitle()}</div>
75
94
  <div class='widget-header--description' title={desc}>