@subiz/widget-v4 4.1.116 → 4.1.119

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 (62) hide show
  1. package/assets/less/base.less +1 -0
  2. package/assets/less/chatbox.less +2 -0
  3. package/assets/less/message.less +42 -22
  4. package/assets/less/message_input.less +2 -0
  5. package/assets/less/order.less +1 -1
  6. package/assets/less/widget.less +33 -16
  7. package/assets/less/widget_header.less +35 -36
  8. package/compiled_src/chatbox/AgentsAvatar.js +1 -1
  9. package/compiled_src/chatbox/Event.js +70 -15
  10. package/compiled_src/chatbox/Events.js +108 -19
  11. package/compiled_src/chatbox/Header.js +5 -4
  12. package/compiled_src/chatbox/InfoMessage.js +2 -13
  13. package/compiled_src/chatbox/MessageInput.js +25 -9
  14. package/compiled_src/chatbox/TextMessage.js +11 -2
  15. package/compiled_src/chatbox/Widget.js +29 -22
  16. package/compiled_src/chatbox/main.js +3 -0
  17. package/compiled_src/chatbox/time.js +1 -0
  18. package/compiled_src/lib.js +4 -0
  19. package/compiled_src/plugin.js +4 -0
  20. package/compiled_src/util/common.js +89 -0
  21. package/dist/185.js +19 -19
  22. package/dist/19641cfa41e.278.js +1 -0
  23. package/dist/19641cfa41e.app.js +1 -0
  24. package/dist/{195ec5442e3.index.html → 19641cfa41e.index.html} +1 -1
  25. package/dist/{195ec5442e3.library.html → 19641cfa41e.library.html} +1 -1
  26. package/dist/19641cfa41e.library.js +1 -0
  27. package/dist/{195ec5442e3.preview.html → 19641cfa41e.preview.html} +1 -1
  28. package/dist/19641cfa41e.preview.js +1 -0
  29. package/dist/19641cfa41e.webview.js +1 -0
  30. package/dist/278.js +1 -1
  31. package/dist/HASH +1 -1
  32. package/dist/screenshoot.js +562 -185
  33. package/package.json +4 -4
  34. package/src/chatbox/AgentsAvatar.js +1 -1
  35. package/src/chatbox/Event.js +76 -15
  36. package/src/chatbox/Events.js +95 -14
  37. package/src/chatbox/Header.js +3 -2
  38. package/src/chatbox/InfoMessage.js +0 -14
  39. package/src/chatbox/MessageInput.js +23 -7
  40. package/src/chatbox/TextMessage.js +13 -0
  41. package/src/chatbox/Widget.js +22 -19
  42. package/src/chatbox/main.js +4 -0
  43. package/src/chatbox/time.js +12 -8
  44. package/src/lib.js +5 -0
  45. package/src/plugin.js +5 -0
  46. package/src/util/common.js +121 -0
  47. package/up +33 -21
  48. package/compiled_src/chatbox/Typing.js +0 -77
  49. package/dist/195ec5442e3.278.js +0 -1
  50. package/dist/195ec5442e3.app.js +0 -1
  51. package/dist/195ec5442e3.library.js +0 -1
  52. package/dist/195ec5442e3.preview.js +0 -1
  53. package/dist/195ec5442e3.webview.js +0 -1
  54. package/src/chatbox/Typing.js +0 -72
  55. /package/dist/{195ec5442e3.127.js → 19641cfa41e.127.js} +0 -0
  56. /package/dist/{195ec5442e3.132.js → 19641cfa41e.132.js} +0 -0
  57. /package/dist/{195ec5442e3.185.js → 19641cfa41e.185.js} +0 -0
  58. /package/dist/{195ec5442e3.27.js → 19641cfa41e.27.js} +0 -0
  59. /package/dist/{195ec5442e3.459.js → 19641cfa41e.459.js} +0 -0
  60. /package/dist/{195ec5442e3.490.js → 19641cfa41e.490.js} +0 -0
  61. /package/dist/{195ec5442e3.74.js → 19641cfa41e.74.js} +0 -0
  62. /package/dist/{195ec5442e3.997.js → 19641cfa41e.997.js} +0 -0
@@ -1,72 +0,0 @@
1
- import sb from '../util/index.js'
2
- import {Com} from '../common.js'
3
- import {h} from 'preact'
4
-
5
- export default class Typing extends Com {
6
- constructor(props) {
7
- super(props)
8
- }
9
-
10
- componentDidMount() {
11
- this.setState({
12
- isShow: false,
13
- ev: {},
14
- })
15
-
16
- this.props.store.onConvoEvent(this, (ev) => {
17
- if (sb.convoOfEv(ev) !== this.props.cid) return
18
- let user = this.props.store.matchUser()
19
- if (sb.get(ev, 'by.id') === user.id) return
20
- // fixwidget in dashboard show typing of user
21
- if (sb.get(ev, 'by.type') === 'user') return
22
-
23
- let oldby = sb.get(this.state.ev, 'by.id')
24
- if (oldby && sb.get(ev, 'by.id') !== oldby) return
25
-
26
- if (sb.get(ev, 'type') === 'message_sent') {
27
- // stop the typing
28
- if (this.timer) sb.clearTimeout(this.timer)
29
- this.timer = null
30
- this.setState({isShow: false})
31
- return
32
- }
33
-
34
- if (sb.get(ev, 'type') !== 'conversation_typing') return
35
- // dont show typing of agent, some agent dont like this
36
- let ag = this.props.store.matchAgent(sb.get(ev, 'by.id')) || {}
37
- if (ag.type == 'agent' && !sb.get(this.props.plugin, 'chatbox.show_agent_typing')) return
38
- this.setState({ev: ev, isShow: true})
39
- if (this.timer) sb.clearTimeout(this.timer)
40
- this.timer = sb.setTimeout(() => {
41
- if (sb.convoOfEv(ev) !== this.props.cid) return
42
-
43
- this.timer = null
44
- this.setState({isShow: false})
45
- }, 5000)
46
- })
47
- }
48
-
49
- ShowTyping() {
50
- this.setState({isShow: true})
51
- if (this.timer) sb.clearTimeout(this.timer)
52
- this.timer = sb.setTimeout(() => {
53
- this.timer = null
54
- this.setState({isShow: false})
55
- }, 5000)
56
- }
57
-
58
- render() {
59
- let account = this.props.store.matchAccount()
60
- var cls = this.state.isShow ? '' : 'typing--hidden'
61
- let byid = sb.get(this.state.ev, 'by.display_id', sb.get(this.state.ev, 'by.id'))
62
- let agentName = sb.getAgentDisplayName(account, this.props.store.matchAgent(byid))
63
- if (sb.get(this.props.plugin, 'chatbox.hide_agent_profile')) {
64
- agentName = sb.get(account, 'name')
65
- }
66
- return (
67
- <div class={`typing ${cls}`}>
68
- {agentName} {this.props.t('typing')}
69
- </div>
70
- )
71
- }
72
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes