@subiz/widget-v4 4.0.99 → 4.1.1

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 (75) hide show
  1. package/compiled_src/call/call.js +3 -3
  2. package/compiled_src/chatbox/AgentsAvatar.js +0 -3
  3. package/compiled_src/chatbox/ButtonAttachments.js +0 -1
  4. package/compiled_src/chatbox/ChatButton.js +0 -5
  5. package/compiled_src/chatbox/DropdownSelect.js +4 -5
  6. package/compiled_src/chatbox/Event.js +0 -2
  7. package/compiled_src/chatbox/Events.js +1 -9
  8. package/compiled_src/chatbox/FormAttachment.js +0 -1
  9. package/compiled_src/chatbox/GenericTemplateAttachments.js +0 -3
  10. package/compiled_src/chatbox/Header.js +5 -2
  11. package/compiled_src/chatbox/InfoMessage.js +0 -1
  12. package/compiled_src/chatbox/MessageInput.js +3 -3
  13. package/compiled_src/chatbox/Order.js +3 -1
  14. package/compiled_src/chatbox/OrderAttachments.js +0 -1
  15. package/compiled_src/chatbox/QuickReplies.js +0 -1
  16. package/compiled_src/chatbox/Rating.js +3 -1
  17. package/compiled_src/chatbox/TextMessage.js +0 -2
  18. package/compiled_src/chatbox/Typing.js +0 -1
  19. package/compiled_src/chatbox/Widget.js +4 -18
  20. package/compiled_src/chatbox/main.js +0 -1
  21. package/compiled_src/chatbox/releaseAnimation.js +0 -1
  22. package/compiled_src/contact/contact.js +3 -7
  23. package/compiled_src/lib.js +7 -18
  24. package/compiled_src/notif/notif.js +3 -3
  25. package/compiled_src/order/address_picker.js +4 -6
  26. package/compiled_src/order/index.js +0 -2
  27. package/compiled_src/order/order.js +4 -7
  28. package/compiled_src/plugin.js +0 -9
  29. package/compiled_src/popup/countdown.js +3 -5
  30. package/compiled_src/popup/popup.js +3 -8
  31. package/compiled_src/popup/tick.core.commonjs.js +16 -158
  32. package/compiled_src/popup/tick.view.flip.commonjs.js +0 -25
  33. package/compiled_src/store/api.js +3 -9
  34. package/compiled_src/store/api_fake.js +3 -3
  35. package/compiled_src/store/store.js +5 -48
  36. package/compiled_src/util/campaign.js +0 -5
  37. package/compiled_src/util/common.js +0 -27
  38. package/compiled_src/util/extractor.js +0 -1
  39. package/compiled_src/util/gate.test.js +0 -1
  40. package/compiled_src/util/index.js +0 -1
  41. package/compiled_src/util/op.js +0 -1
  42. package/compiled_src/util/order.js +0 -4
  43. package/dist/132.js +26 -89
  44. package/dist/184d8eee275.132.js +1 -0
  45. package/dist/184d8eee275.178.js +1 -0
  46. package/dist/184d8eee275.213.js +1 -0
  47. package/dist/184d8eee275.335.js +1 -0
  48. package/dist/184d8eee275.362.js +1 -0
  49. package/dist/184d8eee275.441.js +1 -0
  50. package/dist/184d8eee275.605.js +1 -0
  51. package/dist/184d8eee275.678.js +1 -0
  52. package/dist/184d8eee275.782.js +1 -0
  53. package/dist/184d8eee275.app.js +1 -0
  54. package/dist/184d8eee275.index.html +26 -0
  55. package/dist/184d8eee275.library.html +26 -0
  56. package/dist/184d8eee275.library.js +1 -0
  57. package/dist/184d8eee275.preview.html +759 -0
  58. package/dist/184d8eee275.preview.js +1 -0
  59. package/dist/184d8eee275.screenshoot.js +1 -0
  60. package/dist/213.js +22 -198
  61. package/dist/335.js +3 -7
  62. package/dist/605.js +3 -3
  63. package/dist/HASH +1 -1
  64. package/dist/assets/img/award1a.1a58e10.png +0 -0
  65. package/dist/assets/img/award3a.3b74423.png +0 -0
  66. package/dist/assets/img/award4a.ed6ccd4.png +0 -0
  67. package/dist/assets/img/award5.39eb7ae.png +0 -0
  68. package/dist/assets/img/examplte_logo.f86535f.svg +1 -0
  69. package/dist/assets/img/main-service1.d536cc2.png +0 -0
  70. package/dist/assets/img/main-service2.9b99549.png +0 -0
  71. package/dist/screenshoot.html +1 -1
  72. package/dist/screenshoot.js +14 -130
  73. package/package.json +4 -4
  74. package/src/chatbox/Header.js +9 -3
  75. package/src/lib.js +5 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subiz/widget-v4",
3
- "version": "4.0.99",
3
+ "version": "4.1.1",
4
4
  "main": "./compiled_src/lib.js",
5
5
  "scripts": {
6
6
  "dev": "npx webpack serve --config webpack.dev.js",
@@ -19,7 +19,7 @@
19
19
  "file-loader": "^6.2.0",
20
20
  "less": "^4.1.3",
21
21
  "less-loader": "^11.1.0",
22
- "marked": "^4.2.3",
22
+ "marked": "^4.2.4",
23
23
  "preact": "^10.11.3"
24
24
  },
25
25
  "devDependencies": {
@@ -31,10 +31,10 @@
31
31
  "babel-loader": "^9.1.0",
32
32
  "babel-plugin-syntax-jsx": "^6.18.0",
33
33
  "html-webpack-plugin": "^5.5.0",
34
- "puppeteer": "^19.3.0",
34
+ "puppeteer": "^19.4.0",
35
35
  "webpack": "^5.75.0",
36
36
  "webpack-bundle-analyzer": "^4.7.0",
37
- "webpack-cli": "^5.0.0",
37
+ "webpack-cli": "^5.0.1",
38
38
  "webpack-dev-server": "^4.11.1"
39
39
  }
40
40
  }
@@ -187,7 +187,8 @@ Vui lòng hỏi chúng tôi bất cứ điều gì hoặc chia sẻ phản hồi
187
187
  return (
188
188
  <div
189
189
  class={`widget-header--wrap-button-back ${unreadcount ? 'widget-header--has-convo-unred' : ''}`}
190
- onClick={(e) => this.onBackClick(e)}>
190
+ onClick={(e) => this.onBackClick(e)}
191
+ >
191
192
  <div class='widget-header--button-back' data-tooltip={this.props.t('menu_back')}></div>
192
193
  {$unreadcount}
193
194
  </div>
@@ -202,7 +203,8 @@ Vui lòng hỏi chúng tôi bất cứ điều gì hoặc chia sẻ phản hồi
202
203
  class='widget-header--button widget-header--button-close'
203
204
  data-tooltip={this.props.t('close')}
204
205
  data-tooltip-position='bottom'
205
- onClick={(e) => this.onCloseClick(e)}>
206
+ onClick={(e) => this.onCloseClick(e)}
207
+ >
206
208
  <span class='widget-header--button-close-icon'></span>
207
209
  </div>
208
210
  )
@@ -227,4 +229,8 @@ Vui lòng hỏi chúng tôi bất cứ điều gì hoặc chia sẻ phản hồi
227
229
  }
228
230
  }
229
231
 
230
- let getJoinedNameMember = (agents) => sb.map(agents, (agent) => agent.name).join(', ')
232
+ let getJoinedNameMember = (agents) => {
233
+ agents = sb.filter(agents, (agent) => sb.trim(agent.fullname))
234
+ if (!agents.length) return null
235
+ return sb.map(agents, (agent) => agent.fullname).join(', ')
236
+ }
package/src/lib.js CHANGED
@@ -20,18 +20,6 @@ class Widget {
20
20
  this.store.onConvoEvent({_isMounted: true}, (ev) => sb.map(this.subs, (sub) => sub(ev)))
21
21
  }
22
22
 
23
- setLang(obj) {
24
- var xhttp = new XMLHttpRequest()
25
- xhttp.open('GET', 'https://api.sbz.vn/4.0/oldlang', true)
26
- xhttp.send()
27
- }
28
-
29
- toggleLangDebugMode() {
30
- var xhttp = new XMLHttpRequest()
31
- xhttp.open('GET', 'https://api.sbz.vn/4.0/oldlangdebug', true)
32
- xhttp.send()
33
- }
34
-
35
23
  async waitReady(cb) {
36
24
  await this.store.readyGate.entry()
37
25
  cb()
@@ -146,10 +134,7 @@ class Widget {
146
134
  version = () => '4.5'
147
135
 
148
136
  setSetting = (setting) => this.store.setSetting({account_setting: setting})
149
- getSetting = (_) => ({account_setting: sb.cloneDeep(this.store.matchAccountSetting())})
150
-
151
137
  getUser = () => sb.parseJSON(sb.stringify(this.store.matchUser()))
152
-
153
138
  setViewingProduct = (p) => this.store.linkProduct(p)
154
139
  getViewingProduct = () => this.store.getLinkedProduct()
155
140
 
@@ -160,6 +145,11 @@ class Widget {
160
145
  return this.pluginMgr.setCurrentChatboxLocale(locale)
161
146
  }
162
147
 
148
+ async setLanguage(locale) {
149
+ await this.domGate.entry()
150
+ return this.pluginMgr.setCurrentChatboxLocale(locale)
151
+ }
152
+
163
153
  async setPluginLocale(id, locale) {
164
154
  await this.domGate.entry()
165
155
  return this.pluginMgr.setPluginLocale(id, locale)