@subiz/widget-v4 4.1.160 → 4.1.161

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 (48) hide show
  1. package/compiled_src/lib.js +20 -1
  2. package/dist/{1989dc3ac95.app.js → 1989dde475e.app.js} +1 -1
  3. package/dist/{1989dc3a5f1.chat.html → 1989dde475e.chat.html} +1 -1
  4. package/dist/{1989dc3ac95.chat.js → 1989dde475e.chat.js} +1 -1
  5. package/dist/{1989dc3a5f1.form.html → 1989dde475e.form.html} +1 -1
  6. package/dist/{1989dc3ac95.form.js → 1989dde475e.form.js} +1 -1
  7. package/dist/{1989dc3a5f1.index.html → 1989dde475e.index.html} +1 -1
  8. package/dist/{1989dc3a5f1.library.html → 1989dde475e.library.html} +1 -1
  9. package/dist/{1989dc3a5f1.library.js → 1989dde475e.library.js} +1 -1
  10. package/dist/{1989dc3a5f1.preview.html → 1989dde475e.preview.html} +1 -1
  11. package/dist/{1989dc3a5f1.preview.js → 1989dde475e.preview.js} +1 -1
  12. package/dist/{1989dc3a5f1.webview.js → 1989dde475e.webview.js} +1 -1
  13. package/dist/HASH +1 -1
  14. package/package.json +2 -2
  15. package/src/lib.js +16 -2
  16. package/src/store/store.js +2 -0
  17. package/dist/1989dc3a5f1.app.js +0 -1
  18. package/dist/1989dc3a5f1.chat.js +0 -1
  19. package/dist/1989dc3a5f1.form.js +0 -1
  20. package/dist/1989dc3ac95.127.js +0 -1
  21. package/dist/1989dc3ac95.132.js +0 -1
  22. package/dist/1989dc3ac95.185.js +0 -1
  23. package/dist/1989dc3ac95.27.js +0 -1
  24. package/dist/1989dc3ac95.278.js +0 -1
  25. package/dist/1989dc3ac95.339.js +0 -1
  26. package/dist/1989dc3ac95.459.js +0 -1
  27. package/dist/1989dc3ac95.490.js +0 -1
  28. package/dist/1989dc3ac95.74.js +0 -1
  29. package/dist/1989dc3ac95.997.js +0 -1
  30. package/dist/1989dc3ac95.chat.html +0 -1
  31. package/dist/1989dc3ac95.form.html +0 -1
  32. package/dist/1989dc3ac95.index.html +0 -71
  33. package/dist/1989dc3ac95.library.html +0 -71
  34. package/dist/1989dc3ac95.library.js +0 -1
  35. package/dist/1989dc3ac95.preview.html +0 -759
  36. package/dist/1989dc3ac95.preview.js +0 -1
  37. package/dist/1989dc3ac95.webview.js +0 -1
  38. package/malicious-app.js.hash.js +0 -17
  39. /package/dist/{1989dc3a5f1.127.js → 1989dde475e.127.js} +0 -0
  40. /package/dist/{1989dc3a5f1.132.js → 1989dde475e.132.js} +0 -0
  41. /package/dist/{1989dc3a5f1.185.js → 1989dde475e.185.js} +0 -0
  42. /package/dist/{1989dc3a5f1.27.js → 1989dde475e.27.js} +0 -0
  43. /package/dist/{1989dc3a5f1.278.js → 1989dde475e.278.js} +0 -0
  44. /package/dist/{1989dc3a5f1.339.js → 1989dde475e.339.js} +0 -0
  45. /package/dist/{1989dc3a5f1.459.js → 1989dde475e.459.js} +0 -0
  46. /package/dist/{1989dc3a5f1.490.js → 1989dde475e.490.js} +0 -0
  47. /package/dist/{1989dc3a5f1.74.js → 1989dde475e.74.js} +0 -0
  48. /package/dist/{1989dc3a5f1.997.js → 1989dde475e.997.js} +0 -0
package/dist/HASH CHANGED
@@ -1 +1 @@
1
- 1989dc3ac95
1
+ 1989dde475e
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subiz/widget-v4",
3
- "version": "4.1.160",
3
+ "version": "4.1.161",
4
4
  "main": "./compiled_src/lib.js",
5
5
  "scripts": {
6
6
  "dev": "npx webpack serve --config webpack.dev.js",
@@ -30,7 +30,7 @@
30
30
  "babel-plugin-syntax-jsx": "^6.18.0",
31
31
  "html-webpack-plugin": "^5.6.3",
32
32
  "puppeteer": "^24.16.1",
33
- "webpack": "^5.101.0",
33
+ "webpack": "^5.101.1",
34
34
  "webpack-bundle-analyzer": "^4.10.2",
35
35
  "webpack-cli": "^6.0.1",
36
36
  "webpack-dev-server": "^5.2.2"
package/src/lib.js CHANGED
@@ -219,8 +219,22 @@ class Widget {
219
219
  }
220
220
 
221
221
  startConvo(req) {
222
- if (!req.is_light) return this.store.startConvo(req)
223
- else return this.store.startLightConvo(req.bot_id, req.welcome_message, req.locale, req.is_testing, req.bot_version)
222
+ req = sb.cloneDeep(req) || {}
223
+ if (req.welcome_message) {
224
+ return this.store.startLightConvo(req.bot_id, req.welcome_message, req.locale, req.is_testing, req.bot_version)
225
+ }
226
+ console.log(req)
227
+ let members = req.members || []
228
+ if (req.bot_id) {
229
+ let botid = req.bot_id
230
+ delete req.bot_id
231
+ if (!sb.find(members, (m) => b.id == botid)) {
232
+ members.push({type: 'bot', id: botid, bot_version: req.bot_version})
233
+ }
234
+ }
235
+ req.members = members
236
+ req.initial_by = this.store.matchUser().id
237
+ return this.store.startConvo(req)
224
238
  }
225
239
 
226
240
  async showGreeting() {
@@ -1067,6 +1067,8 @@ export default class Store {
1067
1067
  let {body: convo, error} = await this.api.start(req)
1068
1068
  this.convoGate.open()
1069
1069
 
1070
+
1071
+
1070
1072
  if (error) return {error}
1071
1073
  this._setConvo(convo)
1072
1074
  return {convo}