@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.
- package/assets/less/base.less +1 -0
- package/assets/less/chatbox.less +2 -0
- package/assets/less/message.less +42 -22
- package/assets/less/message_input.less +2 -0
- package/assets/less/order.less +1 -1
- package/assets/less/widget.less +33 -16
- package/assets/less/widget_header.less +35 -36
- package/compiled_src/chatbox/AgentsAvatar.js +1 -1
- package/compiled_src/chatbox/Event.js +70 -15
- package/compiled_src/chatbox/Events.js +108 -19
- package/compiled_src/chatbox/Header.js +5 -4
- package/compiled_src/chatbox/InfoMessage.js +2 -13
- package/compiled_src/chatbox/MessageInput.js +25 -9
- package/compiled_src/chatbox/TextMessage.js +11 -2
- package/compiled_src/chatbox/Widget.js +29 -22
- package/compiled_src/chatbox/main.js +3 -0
- package/compiled_src/chatbox/time.js +1 -0
- package/compiled_src/lib.js +4 -0
- package/compiled_src/plugin.js +4 -0
- package/compiled_src/util/common.js +89 -0
- package/dist/185.js +19 -19
- package/dist/19641cfa41e.278.js +1 -0
- package/dist/19641cfa41e.app.js +1 -0
- package/dist/{195ec5442e3.index.html → 19641cfa41e.index.html} +1 -1
- package/dist/{195ec5442e3.library.html → 19641cfa41e.library.html} +1 -1
- package/dist/19641cfa41e.library.js +1 -0
- package/dist/{195ec5442e3.preview.html → 19641cfa41e.preview.html} +1 -1
- package/dist/19641cfa41e.preview.js +1 -0
- package/dist/19641cfa41e.webview.js +1 -0
- package/dist/278.js +1 -1
- package/dist/HASH +1 -1
- package/dist/screenshoot.js +562 -185
- package/package.json +4 -4
- package/src/chatbox/AgentsAvatar.js +1 -1
- package/src/chatbox/Event.js +76 -15
- package/src/chatbox/Events.js +95 -14
- package/src/chatbox/Header.js +3 -2
- package/src/chatbox/InfoMessage.js +0 -14
- package/src/chatbox/MessageInput.js +23 -7
- package/src/chatbox/TextMessage.js +13 -0
- package/src/chatbox/Widget.js +22 -19
- package/src/chatbox/main.js +4 -0
- package/src/chatbox/time.js +12 -8
- package/src/lib.js +5 -0
- package/src/plugin.js +5 -0
- package/src/util/common.js +121 -0
- package/up +33 -21
- package/compiled_src/chatbox/Typing.js +0 -77
- package/dist/195ec5442e3.278.js +0 -1
- package/dist/195ec5442e3.app.js +0 -1
- package/dist/195ec5442e3.library.js +0 -1
- package/dist/195ec5442e3.preview.js +0 -1
- package/dist/195ec5442e3.webview.js +0 -1
- package/src/chatbox/Typing.js +0 -72
- /package/dist/{195ec5442e3.127.js → 19641cfa41e.127.js} +0 -0
- /package/dist/{195ec5442e3.132.js → 19641cfa41e.132.js} +0 -0
- /package/dist/{195ec5442e3.185.js → 19641cfa41e.185.js} +0 -0
- /package/dist/{195ec5442e3.27.js → 19641cfa41e.27.js} +0 -0
- /package/dist/{195ec5442e3.459.js → 19641cfa41e.459.js} +0 -0
- /package/dist/{195ec5442e3.490.js → 19641cfa41e.490.js} +0 -0
- /package/dist/{195ec5442e3.74.js → 19641cfa41e.74.js} +0 -0
- /package/dist/{195ec5442e3.997.js → 19641cfa41e.997.js} +0 -0
package/src/chatbox/Typing.js
DELETED
|
@@ -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
|