@subiz/widget-v4 4.1.124 → 4.1.126
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/avatar.less +7 -3
- package/assets/less/widget_header.less +29 -7
- package/compiled_src/chatbox/ChatButton.js +12 -3
- package/compiled_src/chatbox/Events.js +1 -1
- package/compiled_src/chatbox/Header.js +12 -1
- package/compiled_src/util/common.js +15 -0
- package/dist/127.js +273 -0
- package/dist/132.js +2575 -6434
- package/dist/185.js +1885 -0
- package/dist/1964f21ffc8.127.js +1 -0
- package/dist/1964f21ffc8.132.js +1 -0
- package/dist/1964f21ffc8.185.js +1 -0
- package/dist/1964f21ffc8.27.js +1 -0
- package/dist/1964f21ffc8.278.js +1 -0
- package/dist/1964f21ffc8.459.js +1 -0
- package/dist/1964f21ffc8.490.js +1 -0
- package/dist/1964f21ffc8.74.js +1 -0
- package/dist/1964f21ffc8.997.js +1 -0
- package/dist/1964f21ffc8.app.js +1 -0
- package/dist/{18a02a9c54e.index.html → 1964f21ffc8.index.html} +28 -4
- package/dist/{18a02a9c54e.library.html → 1964f21ffc8.library.html} +28 -4
- package/dist/1964f21ffc8.library.js +1 -0
- package/dist/{18a02a9c54e.preview.html → 1964f21ffc8.preview.html} +1 -1
- package/dist/1964f21ffc8.preview.js +1 -0
- package/dist/1964f21ffc8.webview.js +1 -0
- package/dist/27.js +107 -0
- package/dist/278.js +406 -0
- package/dist/459.js +107 -0
- package/dist/{605.js → 490.js} +82 -82
- package/dist/{335.js → 74.js} +35 -35
- package/dist/{678.js → 997.js} +6 -6
- package/dist/HASH +1 -1
- package/dist/assets/img/{subiz-mono.877e9f5.svg → subiz-mono.8fbc067.svg} +1 -1
- package/dist/malicious-app.js +6 -4
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +9619 -4865
- package/package.json +1 -1
- package/src/chatbox/ChatButton.js +12 -1
- package/src/chatbox/Events.js +1 -1
- package/src/chatbox/Header.js +15 -0
- package/src/util/common.js +16 -0
- package/dist/178.js +0 -406
- package/dist/18a02a9c54e.132.js +0 -1
- package/dist/18a02a9c54e.178.js +0 -1
- package/dist/18a02a9c54e.213.js +0 -1
- package/dist/18a02a9c54e.335.js +0 -1
- package/dist/18a02a9c54e.362.js +0 -1
- package/dist/18a02a9c54e.441.js +0 -1
- package/dist/18a02a9c54e.605.js +0 -1
- package/dist/18a02a9c54e.678.js +0 -1
- package/dist/18a02a9c54e.782.js +0 -1
- package/dist/18a02a9c54e.app.js +0 -1
- package/dist/18a02a9c54e.library.js +0 -1
- package/dist/18a02a9c54e.preview.js +0 -1
- package/dist/18a02a9c54e.screenshoot.js +0 -1
- package/dist/18a02a9c54e.webview.js +0 -1
- package/dist/213.js +0 -2780
- package/dist/362.js +0 -107
- package/dist/441.js +0 -2855
- package/dist/782.js +0 -107
package/package.json
CHANGED
|
@@ -388,7 +388,18 @@ export default class ChatButton extends Com {
|
|
|
388
388
|
defmsg = defmsg || this.props.t('sent_you_a_message')
|
|
389
389
|
var format = sb.get(ev, 'data.message.format')
|
|
390
390
|
let block = sb.get(ev, 'data.message.block')
|
|
391
|
-
if (block || format == 'block')
|
|
391
|
+
if (block || format == 'block') {
|
|
392
|
+
if (sb.isBlockEmpty(block)) {
|
|
393
|
+
let attachments = sb.get(ev, 'data.message.attachments')
|
|
394
|
+
if (sb.size(attachments) > 0) {
|
|
395
|
+
return (
|
|
396
|
+
<div>{`${this.props.t('send')} ${sb.size(attachments)} ${sb.size(attachments) > 1 ? this.props.t('attachments') : this.props.t('attachment')}`}</div>
|
|
397
|
+
)
|
|
398
|
+
}
|
|
399
|
+
return defmsg
|
|
400
|
+
}
|
|
401
|
+
return <Block block={block} />
|
|
402
|
+
}
|
|
392
403
|
|
|
393
404
|
let message = sb.get(ev, 'data.message.text', defmsg)
|
|
394
405
|
if (!message && sb.size(sb.get(ev, 'data.message.attachments')) > 0) message = defmsg
|
package/src/chatbox/Events.js
CHANGED
|
@@ -93,7 +93,7 @@ export default class Events extends Com {
|
|
|
93
93
|
if (this.state.error) return this.renderError()
|
|
94
94
|
let events = sb.map(this.props.store.listEvents(this.props.cid))
|
|
95
95
|
|
|
96
|
-
if (!this.state.loading && sb.size(events) === 0) {
|
|
96
|
+
if (!this.state.loading && sb.size(events) === 0 && !this.props.cid) {
|
|
97
97
|
return (
|
|
98
98
|
<div ref={(ref) => (this.refBody = ref)} class='widget-body--events-container'>
|
|
99
99
|
<div class='widget-body--empty'>
|
package/src/chatbox/Header.js
CHANGED
|
@@ -9,6 +9,20 @@ export default class Header extends Com {
|
|
|
9
9
|
super(props)
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
renderAccountAvatar() {
|
|
13
|
+
let acc = this.props.store.matchAccount() || {}
|
|
14
|
+
if (!acc.logo_url) return null
|
|
15
|
+
return (
|
|
16
|
+
<img
|
|
17
|
+
width={38}
|
|
18
|
+
height={38}
|
|
19
|
+
alt={acc.name}
|
|
20
|
+
class='avatar avatar__account'
|
|
21
|
+
src={this.props.store.replaceFileUrl(acc.logo_url) || require('../../assets/img/image_default.png')}
|
|
22
|
+
/>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
12
26
|
render() {
|
|
13
27
|
let headerMode = 'collapsed'
|
|
14
28
|
|
|
@@ -55,6 +69,7 @@ export default class Header extends Com {
|
|
|
55
69
|
return (
|
|
56
70
|
<div class={cls} style={style}>
|
|
57
71
|
{$back}
|
|
72
|
+
{this.renderAccountAvatar()}
|
|
58
73
|
<div class='widget-header--title-container'>
|
|
59
74
|
<div class='widget-header--title'>{this.getTitle()}</div>
|
|
60
75
|
<div class='widget-header--description' title={desc}>
|
package/src/util/common.js
CHANGED
|
@@ -1411,6 +1411,22 @@ export function blockToText(block) {
|
|
|
1411
1411
|
return _blockToText(block).trim()
|
|
1412
1412
|
}
|
|
1413
1413
|
|
|
1414
|
+
export function isBlockEmpty(block) {
|
|
1415
|
+
return _isBlockEmpty(block)
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
function _isBlockEmpty(block = {}) {
|
|
1419
|
+
if (!size(block.contents)) {
|
|
1420
|
+
if ((block.text || '').trim()) return false
|
|
1421
|
+
return true
|
|
1422
|
+
}
|
|
1423
|
+
let result = true
|
|
1424
|
+
map(block.contents, (content) => {
|
|
1425
|
+
result = result && _isBlockEmpty(content)
|
|
1426
|
+
})
|
|
1427
|
+
return result
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1414
1430
|
function _blockToText(block) {
|
|
1415
1431
|
if (!block || !block.type) return ''
|
|
1416
1432
|
let out = ''
|