@subiz/widget-v4 4.1.119 → 4.1.121
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/widget.less +3 -2
- package/compiled_src/chatbox/Event.js +24 -5
- package/compiled_src/chatbox/Events.js +22 -24
- package/compiled_src/chatbox/TextMessage.js +1 -0
- package/compiled_src/chatbox/Widget.js +6 -2
- package/dist/{19641cfa41e.278.js → 19642b47dfe.278.js} +1 -1
- package/dist/{19641cfa41e.app.js → 19642b47dfe.app.js} +1 -1
- package/dist/{19641cfa41e.index.html → 19642b47dfe.index.html} +1 -1
- package/dist/{19641cfa41e.library.html → 19642b47dfe.library.html} +1 -1
- package/dist/{19641cfa41e.library.js → 19642b47dfe.library.js} +1 -1
- package/dist/{19641cfa41e.preview.html → 19642b47dfe.preview.html} +1 -1
- package/dist/{19641cfa41e.preview.js → 19642b47dfe.preview.js} +1 -1
- package/dist/{19641cfa41e.webview.js → 19642b47dfe.webview.js} +1 -1
- package/dist/278.js +1 -1
- package/dist/HASH +1 -1
- package/dist/screenshoot.js +52 -31
- package/package.json +1 -1
- package/src/chatbox/Event.js +18 -5
- package/src/chatbox/Events.js +12 -15
- package/src/chatbox/TextMessage.js +1 -0
- package/src/chatbox/Widget.js +3 -2
- /package/dist/{19641cfa41e.127.js → 19642b47dfe.127.js} +0 -0
- /package/dist/{19641cfa41e.132.js → 19642b47dfe.132.js} +0 -0
- /package/dist/{19641cfa41e.185.js → 19642b47dfe.185.js} +0 -0
- /package/dist/{19641cfa41e.27.js → 19642b47dfe.27.js} +0 -0
- /package/dist/{19641cfa41e.459.js → 19642b47dfe.459.js} +0 -0
- /package/dist/{19641cfa41e.490.js → 19642b47dfe.490.js} +0 -0
- /package/dist/{19641cfa41e.74.js → 19642b47dfe.74.js} +0 -0
- /package/dist/{19641cfa41e.997.js → 19642b47dfe.997.js} +0 -0
package/dist/screenshoot.js
CHANGED
|
@@ -8287,7 +8287,22 @@ class Event extends common/* Com */.Mw {
|
|
|
8287
8287
|
});
|
|
8288
8288
|
}
|
|
8289
8289
|
renderTyping() {
|
|
8290
|
-
|
|
8290
|
+
if (!this.props.event.is_show) {
|
|
8291
|
+
return (0,preact_module.h)("div", {
|
|
8292
|
+
key: 'container',
|
|
8293
|
+
class: "convo-event agent-message",
|
|
8294
|
+
style: "opacity: 0 !important"
|
|
8295
|
+
}, (0,preact_module.h)("div", {
|
|
8296
|
+
class: "agent-convo-event-wrapper"
|
|
8297
|
+
}, (0,preact_module.h)("div", {
|
|
8298
|
+
class: "agent-convo-event-inner"
|
|
8299
|
+
}, (0,preact_module.h)("div", {
|
|
8300
|
+
class: "message-agent message-text--agent",
|
|
8301
|
+
style: "opacity: 0.6 !important"
|
|
8302
|
+
}, (0,preact_module.h)("div", {
|
|
8303
|
+
style: "height: 20px !important; width: 35px !important"
|
|
8304
|
+
})))));
|
|
8305
|
+
}
|
|
8291
8306
|
var html = `
|
|
8292
8307
|
<html>
|
|
8293
8308
|
<head>
|
|
@@ -8336,14 +8351,15 @@ class Event extends common/* Com */.Mw {
|
|
|
8336
8351
|
`;
|
|
8337
8352
|
let src = 'data:text/html,' + encodeURIComponent(html);
|
|
8338
8353
|
return (0,preact_module.h)("div", {
|
|
8339
|
-
|
|
8354
|
+
key: 'container',
|
|
8355
|
+
class: "convo-event agent-message",
|
|
8356
|
+
style: "opacity: 0.6 !important"
|
|
8340
8357
|
}, (0,preact_module.h)("div", {
|
|
8341
8358
|
class: "agent-convo-event-wrapper"
|
|
8342
8359
|
}, (0,preact_module.h)("div", {
|
|
8343
|
-
class:
|
|
8360
|
+
class: "agent-convo-event-inner"
|
|
8344
8361
|
}, (0,preact_module.h)("div", {
|
|
8345
|
-
class: "message-agent message-text--agent"
|
|
8346
|
-
style: "opacity: 0.6 !important"
|
|
8362
|
+
class: "message-agent message-text--agent"
|
|
8347
8363
|
}, (0,preact_module.h)("iframe", {
|
|
8348
8364
|
src: src,
|
|
8349
8365
|
style: "width: 35px !important; height: 20px !important; display: block !important; overflow: hidden !important; padding: 0 !important "
|
|
@@ -8430,6 +8446,9 @@ class Event extends common/* Com */.Mw {
|
|
|
8430
8446
|
});
|
|
8431
8447
|
}
|
|
8432
8448
|
let $sender = null;
|
|
8449
|
+
if (this.props.event.mode === 'lead') $sender = (0,preact_module.h)("div", {
|
|
8450
|
+
class: "pt-2"
|
|
8451
|
+
});
|
|
8433
8452
|
let $error = null;
|
|
8434
8453
|
if (ev._error && ev.type === 'message_sent') {
|
|
8435
8454
|
let msg = this.props.t('error_send_message');
|
|
@@ -8717,33 +8736,31 @@ class Events extends common/* Com */.Mw {
|
|
|
8717
8736
|
events = util/* default */.A.map(events, ev => ({
|
|
8718
8737
|
ev: ev
|
|
8719
8738
|
}));
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8739
|
+
let ev = this.state.typing_event || {
|
|
8740
|
+
id: 'evzz' + util/* default */.A.Date.now(),
|
|
8741
|
+
created: util/* default */.A.Date.now(),
|
|
8742
|
+
by: {
|
|
8743
|
+
type: 'agent'
|
|
8744
|
+
}
|
|
8745
|
+
};
|
|
8746
|
+
let fakeev = {
|
|
8747
|
+
is_typing: true,
|
|
8748
|
+
is_show: this.state.isShowTyping,
|
|
8749
|
+
id: ev.id,
|
|
8750
|
+
ev: {
|
|
8730
8751
|
id: ev.id,
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
text: '...',
|
|
8739
|
-
conversation_id: this.props.cid
|
|
8740
|
-
}
|
|
8752
|
+
created: ev.created,
|
|
8753
|
+
by: ev.by,
|
|
8754
|
+
type: 'message_sent',
|
|
8755
|
+
data: {
|
|
8756
|
+
message: {
|
|
8757
|
+
text: '...',
|
|
8758
|
+
conversation_id: this.props.cid
|
|
8741
8759
|
}
|
|
8742
8760
|
}
|
|
8743
|
-
}
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
}
|
|
8761
|
+
}
|
|
8762
|
+
};
|
|
8763
|
+
events.push(fakeev);
|
|
8747
8764
|
processEvents(convo, events);
|
|
8748
8765
|
let $events = util/* default */.A.map(events, ev => {
|
|
8749
8766
|
let isLast = ev.ev.id === util/* default */.A.get(convo, 'last_message_sent.id');
|
|
@@ -9873,7 +9890,9 @@ class Widget extends common/* Com */.Mw {
|
|
|
9873
9890
|
class: "flex-grow-1"
|
|
9874
9891
|
}, (0,preact_module.h)("div", {
|
|
9875
9892
|
class: "form mt-3 pl-3 pr-3 pt-3 pb-3 d-flex flex-column"
|
|
9876
|
-
}, (0,preact_module.h)("div", null, title), this.renderFields(form, formName))), (0,preact_module.h)(
|
|
9893
|
+
}, (0,preact_module.h)("div", null, title), this.renderFields(form, formName))), (0,preact_module.h)("div", {
|
|
9894
|
+
class: "mt-2"
|
|
9895
|
+
}), (0,preact_module.h)(PoweredBy, {
|
|
9877
9896
|
store: this.props.store,
|
|
9878
9897
|
t: this.props.t
|
|
9879
9898
|
})), (0,preact_module.h)("div", {
|
|
@@ -9945,7 +9964,9 @@ class Widget extends common/* Com */.Mw {
|
|
|
9945
9964
|
alt: "send button",
|
|
9946
9965
|
width: "26",
|
|
9947
9966
|
height: "26"
|
|
9948
|
-
})), (0,preact_module.h)(
|
|
9967
|
+
})), (0,preact_module.h)("div", {
|
|
9968
|
+
class: "mt-2"
|
|
9969
|
+
}), (0,preact_module.h)(PoweredBy, {
|
|
9949
9970
|
store: this.props.store
|
|
9950
9971
|
})));
|
|
9951
9972
|
}
|
package/package.json
CHANGED
package/src/chatbox/Event.js
CHANGED
|
@@ -153,7 +153,20 @@ export default class Event extends Com {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
renderTyping() {
|
|
156
|
-
|
|
156
|
+
if (!this.props.event.is_show) {
|
|
157
|
+
return (
|
|
158
|
+
<div key={'container'} class='convo-event agent-message' style='opacity: 0 !important'>
|
|
159
|
+
<div class='agent-convo-event-wrapper'>
|
|
160
|
+
<div class='agent-convo-event-inner'>
|
|
161
|
+
<div class='message-agent message-text--agent' style='opacity: 0.6 !important'>
|
|
162
|
+
<div style='height: 20px !important; width: 35px !important'></div>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
)
|
|
168
|
+
}
|
|
169
|
+
|
|
157
170
|
var html = `
|
|
158
171
|
<html>
|
|
159
172
|
<head>
|
|
@@ -202,10 +215,10 @@ export default class Event extends Com {
|
|
|
202
215
|
`
|
|
203
216
|
let src = 'data:text/html,' + encodeURIComponent(html)
|
|
204
217
|
return (
|
|
205
|
-
<div class='convo-event agent-message'>
|
|
218
|
+
<div key={'container'} class='convo-event agent-message' style='opacity: 0.6 !important'>
|
|
206
219
|
<div class='agent-convo-event-wrapper'>
|
|
207
|
-
<div class=
|
|
208
|
-
<div class='message-agent message-text--agent'
|
|
220
|
+
<div class='agent-convo-event-inner'>
|
|
221
|
+
<div class='message-agent message-text--agent'>
|
|
209
222
|
<iframe
|
|
210
223
|
src={src}
|
|
211
224
|
style='width: 35px !important; height: 20px !important; display: block !important; overflow: hidden !important; padding: 0 !important '
|
|
@@ -286,7 +299,7 @@ export default class Event extends Com {
|
|
|
286
299
|
}
|
|
287
300
|
|
|
288
301
|
let $sender = null
|
|
289
|
-
|
|
302
|
+
if (this.props.event.mode === 'lead') $sender = <div class='pt-3'></div>
|
|
290
303
|
|
|
291
304
|
let $error = null
|
|
292
305
|
if (ev._error && ev.type === 'message_sent') {
|
package/src/chatbox/Events.js
CHANGED
|
@@ -111,23 +111,20 @@ export default class Events extends Com {
|
|
|
111
111
|
events = sb.map(events, (ev) => ({ev: ev}))
|
|
112
112
|
|
|
113
113
|
// console.log('-----------', this.state.isShowTyping, this.state.typing_event)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
let ev = this.state.typing_event || {id: 'evzz' + sb.Date.now(), created: sb.Date.now(), by: {type: 'agent'}}
|
|
115
|
+
let fakeev = {
|
|
116
|
+
is_typing: true,
|
|
117
|
+
is_show: this.state.isShowTyping,
|
|
118
|
+
id: ev.id,
|
|
119
|
+
ev: {
|
|
118
120
|
id: ev.id,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
data: {message: {text: '...', conversation_id: this.props.cid}},
|
|
125
|
-
},
|
|
126
|
-
}
|
|
127
|
-
console.log('FA', fakeev)
|
|
128
|
-
events.push(fakeev)
|
|
121
|
+
created: ev.created,
|
|
122
|
+
by: ev.by,
|
|
123
|
+
type: 'message_sent',
|
|
124
|
+
data: {message: {text: '...', conversation_id: this.props.cid}},
|
|
125
|
+
},
|
|
129
126
|
}
|
|
130
|
-
|
|
127
|
+
events.push(fakeev)
|
|
131
128
|
processEvents(convo, events)
|
|
132
129
|
|
|
133
130
|
let $events = sb.map(events, (ev) => {
|
package/src/chatbox/Widget.js
CHANGED
|
@@ -624,8 +624,8 @@ export default class Widget extends Com {
|
|
|
624
624
|
<div>{title}</div>
|
|
625
625
|
{this.renderFields(form, formName)}
|
|
626
626
|
</div>
|
|
627
|
-
|
|
628
|
-
|
|
627
|
+
</div>
|
|
628
|
+
<div class="mt-2"></div>
|
|
629
629
|
<PoweredBy store={this.props.store} t={this.props.t} />
|
|
630
630
|
</div>
|
|
631
631
|
|
|
@@ -698,6 +698,7 @@ export default class Widget extends Com {
|
|
|
698
698
|
<span>{this.props.t('start_conversation')}</span>
|
|
699
699
|
<img src={send} alt='send button' width='26' height='26' />
|
|
700
700
|
</button>
|
|
701
|
+
<div class="mt-2"></div>
|
|
701
702
|
<PoweredBy store={this.props.store} />
|
|
702
703
|
</div>
|
|
703
704
|
</div>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|