@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/assets/less/widget.less
CHANGED
|
@@ -248,7 +248,9 @@
|
|
|
248
248
|
|
|
249
249
|
.btn--start-convo {
|
|
250
250
|
border-radius: 7px;
|
|
251
|
-
display:
|
|
251
|
+
display: flex;
|
|
252
|
+
align-items: center;
|
|
253
|
+
justify-content: center;
|
|
252
254
|
padding-left: 32px;
|
|
253
255
|
padding-right: 32px;
|
|
254
256
|
height: 40px;
|
|
@@ -306,7 +308,6 @@
|
|
|
306
308
|
}
|
|
307
309
|
|
|
308
310
|
.poweredby {
|
|
309
|
-
margin-top: @spacer3;
|
|
310
311
|
margin-bottom: @spacer2;
|
|
311
312
|
text-align: center;
|
|
312
313
|
|
|
@@ -155,7 +155,22 @@ class Event extends _common.Com {
|
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
renderTyping() {
|
|
158
|
-
|
|
158
|
+
if (!this.props.event.is_show) {
|
|
159
|
+
return (0, _preact.h)("div", {
|
|
160
|
+
key: 'container',
|
|
161
|
+
class: "convo-event agent-message",
|
|
162
|
+
style: "opacity: 0 !important"
|
|
163
|
+
}, (0, _preact.h)("div", {
|
|
164
|
+
class: "agent-convo-event-wrapper"
|
|
165
|
+
}, (0, _preact.h)("div", {
|
|
166
|
+
class: "agent-convo-event-inner"
|
|
167
|
+
}, (0, _preact.h)("div", {
|
|
168
|
+
class: "message-agent message-text--agent",
|
|
169
|
+
style: "opacity: 0.6 !important"
|
|
170
|
+
}, (0, _preact.h)("div", {
|
|
171
|
+
style: "height: 20px !important; width: 35px !important"
|
|
172
|
+
})))));
|
|
173
|
+
}
|
|
159
174
|
var html = `
|
|
160
175
|
<html>
|
|
161
176
|
<head>
|
|
@@ -204,14 +219,15 @@ class Event extends _common.Com {
|
|
|
204
219
|
`;
|
|
205
220
|
let src = 'data:text/html,' + encodeURIComponent(html);
|
|
206
221
|
return (0, _preact.h)("div", {
|
|
207
|
-
|
|
222
|
+
key: 'container',
|
|
223
|
+
class: "convo-event agent-message",
|
|
224
|
+
style: "opacity: 0.6 !important"
|
|
208
225
|
}, (0, _preact.h)("div", {
|
|
209
226
|
class: "agent-convo-event-wrapper"
|
|
210
227
|
}, (0, _preact.h)("div", {
|
|
211
|
-
class:
|
|
228
|
+
class: "agent-convo-event-inner"
|
|
212
229
|
}, (0, _preact.h)("div", {
|
|
213
|
-
class: "message-agent message-text--agent"
|
|
214
|
-
style: "opacity: 0.6 !important"
|
|
230
|
+
class: "message-agent message-text--agent"
|
|
215
231
|
}, (0, _preact.h)("iframe", {
|
|
216
232
|
src: src,
|
|
217
233
|
style: "width: 35px !important; height: 20px !important; display: block !important; overflow: hidden !important; padding: 0 !important "
|
|
@@ -298,6 +314,9 @@ class Event extends _common.Com {
|
|
|
298
314
|
});
|
|
299
315
|
}
|
|
300
316
|
let $sender = null;
|
|
317
|
+
if (this.props.event.mode === 'lead') $sender = (0, _preact.h)("div", {
|
|
318
|
+
class: "pt-3"
|
|
319
|
+
});
|
|
301
320
|
let $error = null;
|
|
302
321
|
if (ev._error && ev.type === 'message_sent') {
|
|
303
322
|
let msg = this.props.t('error_send_message');
|
|
@@ -106,33 +106,31 @@ class Events extends _common.Com {
|
|
|
106
106
|
events = _index.default.map(events, ev => ({
|
|
107
107
|
ev: ev
|
|
108
108
|
}));
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
let ev = this.state.typing_event || {
|
|
110
|
+
id: 'evzz' + _index.default.Date.now(),
|
|
111
|
+
created: _index.default.Date.now(),
|
|
112
|
+
by: {
|
|
113
|
+
type: 'agent'
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
let fakeev = {
|
|
117
|
+
is_typing: true,
|
|
118
|
+
is_show: this.state.isShowTyping,
|
|
119
|
+
id: ev.id,
|
|
120
|
+
ev: {
|
|
119
121
|
id: ev.id,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
text: '...',
|
|
128
|
-
conversation_id: this.props.cid
|
|
129
|
-
}
|
|
122
|
+
created: ev.created,
|
|
123
|
+
by: ev.by,
|
|
124
|
+
type: 'message_sent',
|
|
125
|
+
data: {
|
|
126
|
+
message: {
|
|
127
|
+
text: '...',
|
|
128
|
+
conversation_id: this.props.cid
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
events.push(fakeev);
|
|
136
134
|
processEvents(convo, events);
|
|
137
135
|
let $events = _index.default.map(events, ev => {
|
|
138
136
|
let isLast = ev.ev.id === _index.default.get(convo, 'last_message_sent.id');
|
|
@@ -13,6 +13,7 @@ var _time = _interopRequireDefault(require("./time.js"));
|
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
14
|
class TextMessage extends _common.Com {
|
|
15
15
|
renderTime() {
|
|
16
|
+
return null;
|
|
16
17
|
if (!this.props.showTime && !this.props.isLast && !this.props.isFirst) return null;
|
|
17
18
|
return (0, _preact.h)("div", null, (0, _preact.h)(_time.default, {
|
|
18
19
|
class: "inline-time",
|
|
@@ -652,7 +652,9 @@ class Widget extends _common.Com {
|
|
|
652
652
|
class: "flex-grow-1"
|
|
653
653
|
}, (0, _preact.h)("div", {
|
|
654
654
|
class: "form mt-3 pl-3 pr-3 pt-3 pb-3 d-flex flex-column"
|
|
655
|
-
}, (0, _preact.h)("div", null, title), this.renderFields(form, formName))), (0, _preact.h)(
|
|
655
|
+
}, (0, _preact.h)("div", null, title), this.renderFields(form, formName))), (0, _preact.h)("div", {
|
|
656
|
+
class: "mt-2"
|
|
657
|
+
}), (0, _preact.h)(_PoweredBy.default, {
|
|
656
658
|
store: this.props.store,
|
|
657
659
|
t: this.props.t
|
|
658
660
|
})), (0, _preact.h)("div", {
|
|
@@ -724,7 +726,9 @@ class Widget extends _common.Com {
|
|
|
724
726
|
alt: "send button",
|
|
725
727
|
width: "26",
|
|
726
728
|
height: "26"
|
|
727
|
-
})), (0, _preact.h)(
|
|
729
|
+
})), (0, _preact.h)("div", {
|
|
730
|
+
class: "mt-2"
|
|
731
|
+
}), (0, _preact.h)(_PoweredBy.default, {
|
|
728
732
|
store: this.props.store
|
|
729
733
|
})));
|
|
730
734
|
}
|