@subiz/widget-v4 4.1.161 → 4.1.162
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/compiled_src/chatbox/Event.js +6 -2
- package/compiled_src/chatbox/MessageInput.js +7 -0
- package/compiled_src/lib.js +0 -1
- package/dist/{1989dde475e.app.js → 198a2601817.app.js} +1 -1
- package/dist/{1989dde475e.chat.html → 198a2601817.chat.html} +1 -1
- package/dist/{1989dde475e.chat.js → 198a2601817.chat.js} +1 -1
- package/dist/{1989dde475e.form.html → 198a2601817.form.html} +1 -1
- package/dist/{1989dde475e.form.js → 198a2601817.form.js} +1 -1
- package/dist/{1989dde475e.index.html → 198a2601817.index.html} +1 -1
- package/dist/{1989dde475e.library.html → 198a2601817.library.html} +1 -1
- package/dist/{1989dde475e.library.js → 198a2601817.library.js} +1 -1
- package/dist/{1989dde475e.preview.html → 198a2601817.preview.html} +1 -1
- package/dist/198a2601817.preview.js +1 -0
- package/dist/{1989dde475e.webview.js → 198a2601817.webview.js} +1 -1
- package/dist/HASH +1 -1
- package/dist/screenshoot.js +31 -2
- package/package.json +1 -1
- package/src/chatbox/Event.js +6 -1
- package/src/chatbox/MessageInput.js +10 -0
- package/src/lib.js +1 -1
- package/src/store/store.js +0 -2
- package/dist/1989dde475e.preview.js +0 -1
- /package/dist/{1989dde475e.127.js → 198a2601817.127.js} +0 -0
- /package/dist/{1989dde475e.132.js → 198a2601817.132.js} +0 -0
- /package/dist/{1989dde475e.185.js → 198a2601817.185.js} +0 -0
- /package/dist/{1989dde475e.27.js → 198a2601817.27.js} +0 -0
- /package/dist/{1989dde475e.278.js → 198a2601817.278.js} +0 -0
- /package/dist/{1989dde475e.339.js → 198a2601817.339.js} +0 -0
- /package/dist/{1989dde475e.459.js → 198a2601817.459.js} +0 -0
- /package/dist/{1989dde475e.490.js → 198a2601817.490.js} +0 -0
- /package/dist/{1989dde475e.74.js → 198a2601817.74.js} +0 -0
- /package/dist/{1989dde475e.997.js → 198a2601817.997.js} +0 -0
|
@@ -246,7 +246,7 @@ class Event extends _common.Com {
|
|
|
246
246
|
let ev = this.props.event.ev;
|
|
247
247
|
let attachments = _index.default.get(ev, 'data.message.attachments');
|
|
248
248
|
let hasForm = _index.default.find(attachments, att => att.type === 'form');
|
|
249
|
-
if (ev
|
|
249
|
+
if (isEmptyMessage(_index.default.get(ev, 'data.message'))) return null;
|
|
250
250
|
this.tryLoadOrder(ev);
|
|
251
251
|
let t = new _index.default.Date(ev.created).toLocaleString();
|
|
252
252
|
if (_index.default.get(ev, 'by.type') !== 'user') {
|
|
@@ -515,4 +515,8 @@ class Event extends _common.Com {
|
|
|
515
515
|
return acc.name;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
exports.default = Event;
|
|
518
|
+
exports.default = Event;
|
|
519
|
+
function isEmptyMessage(msg) {
|
|
520
|
+
if (!msg) return true;
|
|
521
|
+
if (!msg.text && !msg.block && !_index.default.size(msg.attachments)) return true;
|
|
522
|
+
}
|
|
@@ -230,6 +230,13 @@ class MessageInput extends _common.Com {
|
|
|
230
230
|
}
|
|
231
231
|
focus() {
|
|
232
232
|
if (this.props.disabled) return;
|
|
233
|
+
const activeElement = document.activeElement;
|
|
234
|
+
let focused = false;
|
|
235
|
+
if (activeElement) {
|
|
236
|
+
if (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA') focused = true;
|
|
237
|
+
if (activeElement.hasAttribute('contenteditable') && activeElement.getAttribute('contenteditable') === 'true') focused = true;
|
|
238
|
+
}
|
|
239
|
+
if (focused) return;
|
|
233
240
|
this.refMessageInput.current && this.refMessageInput.current.focus();
|
|
234
241
|
_index.default.setTimeout(() => {
|
|
235
242
|
this.refMessageInput.current && this.refMessageInput.current.focus();
|
package/compiled_src/lib.js
CHANGED
|
@@ -221,7 +221,6 @@ class Widget {
|
|
|
221
221
|
if (req.welcome_message) {
|
|
222
222
|
return this.store.startLightConvo(req.bot_id, req.welcome_message, req.locale, req.is_testing, req.bot_version);
|
|
223
223
|
}
|
|
224
|
-
console.log(req);
|
|
225
224
|
let members = req.members || [];
|
|
226
225
|
if (req.bot_id) {
|
|
227
226
|
let botid = req.bot_id;
|