beem-component 2.0.17 → 2.0.19
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.
|
@@ -12,6 +12,8 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
12
12
|
var _reactAvatar = _interopRequireDefault(require("react-avatar"));
|
|
13
13
|
var _List = _interopRequireDefault(require("@mui/icons-material/List"));
|
|
14
14
|
var _ShoppingCartOutlined = _interopRequireDefault(require("@mui/icons-material/ShoppingCartOutlined"));
|
|
15
|
+
var _lodash = require("lodash");
|
|
16
|
+
var _reactPdf = require("react-pdf");
|
|
15
17
|
var _avatars = _interopRequireDefault(require("../../Avatars/avatars"));
|
|
16
18
|
var _iconStyles = require("../../iconStyles");
|
|
17
19
|
var _sessionDetails = require("./sessionDetails");
|
|
@@ -25,6 +27,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
25
27
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
26
28
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
27
29
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
30
|
+
_reactPdf.pdfjs.GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(_reactPdf.pdfjs.version, "/pdf.worker.js");
|
|
28
31
|
var BmChat = _styledComponents.default.div.withConfig({
|
|
29
32
|
displayName: "chatBody__BmChat"
|
|
30
33
|
})(["display:flex;flex-direction:column;height:100%;", ""], '' /* border: 0.071rem solid ${BmGrey400}; */);
|
|
@@ -53,13 +56,14 @@ var Messages = _styledComponents.default.div.withConfig({
|
|
|
53
56
|
})(["display:flex;flex-direction:", ";align-items:", ";padding:1rem 0.5rem;background:", ";color:", ";border-radius:", ";border-left:", ";border:", ";word-break:break-word;margin:0rem;"], function (_ref2) {
|
|
54
57
|
var type = _ref2.type,
|
|
55
58
|
isInteractive = _ref2.isInteractive;
|
|
56
|
-
if (type === 'interactive' || isInteractive) {
|
|
59
|
+
if (type === 'interactive' || type === 'order' || isInteractive) {
|
|
57
60
|
return 'column';
|
|
58
61
|
}
|
|
59
62
|
return 'row';
|
|
60
63
|
}, function (_ref3) {
|
|
61
|
-
var type = _ref3.type
|
|
62
|
-
|
|
64
|
+
var type = _ref3.type,
|
|
65
|
+
isInteractive = _ref3.isInteractive;
|
|
66
|
+
if (type === 'interactive' || type === 'order' || isInteractive) {
|
|
63
67
|
return ' start';
|
|
64
68
|
}
|
|
65
69
|
return 'center';
|
|
@@ -128,19 +132,46 @@ var IntButton = _styledComponents.default.button.withConfig({
|
|
|
128
132
|
}
|
|
129
133
|
return "".concat(_colors.BmPrimaryWhite);
|
|
130
134
|
});
|
|
135
|
+
var OrderBody = _styledComponents.default.button.withConfig({
|
|
136
|
+
displayName: "chatBody__OrderBody"
|
|
137
|
+
})(["padding:1rem;margin:0.1rem;display:flex;flex-direction:column;align-items:start;justify-content:center;width:100%;background-color:rgba(217,217,217,0.3);border:none;color:", ";border-radius:0.3rem;> *{color:", ";}"], function (_ref10) {
|
|
138
|
+
var state = _ref10.state;
|
|
139
|
+
if (state) {
|
|
140
|
+
if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
|
|
141
|
+
if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
|
|
142
|
+
}
|
|
143
|
+
return "".concat(_colors.BmPrimaryWhite);
|
|
144
|
+
}, function (_ref11) {
|
|
145
|
+
var state = _ref11.state;
|
|
146
|
+
if (state) {
|
|
147
|
+
if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
|
|
148
|
+
if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
|
|
149
|
+
}
|
|
150
|
+
return "".concat(_colors.BmPrimaryWhite);
|
|
151
|
+
});
|
|
152
|
+
var CartContent = _styledComponents.default.div.withConfig({
|
|
153
|
+
displayName: "chatBody__CartContent"
|
|
154
|
+
})(["margin-bottom:0.5rem;display:flex;flex-direction:row;align-items:center;justify-content:center;color:", ";"], function (_ref12) {
|
|
155
|
+
var state = _ref12.state;
|
|
156
|
+
if (state) {
|
|
157
|
+
if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
|
|
158
|
+
if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
|
|
159
|
+
}
|
|
160
|
+
return "".concat(_colors.BmPrimaryWhite);
|
|
161
|
+
});
|
|
131
162
|
var MessagesSubDetails = _styledComponents.default.div.withConfig({
|
|
132
163
|
displayName: "chatBody__MessagesSubDetails"
|
|
133
|
-
})(["display:flex;flex-direction:row;align-items:center;> *:not(:last-child){margin-right:0.5rem;}margin-left:", ";margin-top:0.5rem;"], function (
|
|
134
|
-
var state =
|
|
164
|
+
})(["display:flex;flex-direction:row;align-items:center;> *:not(:last-child){margin-right:0.5rem;}margin-left:", ";margin-top:0.5rem;"], function (_ref13) {
|
|
165
|
+
var state = _ref13.state;
|
|
135
166
|
if (state) {
|
|
136
167
|
if (state === 'inbound') return '0px';
|
|
137
168
|
if (state === 'outbound') return 'auto';
|
|
138
169
|
}
|
|
139
170
|
return "".concat(_colors.BmPrimaryWhite);
|
|
140
171
|
});
|
|
141
|
-
var handleState = function handleState(
|
|
142
|
-
var session =
|
|
143
|
-
agentName =
|
|
172
|
+
var handleState = function handleState(_ref14) {
|
|
173
|
+
var session = _ref14.session,
|
|
174
|
+
agentName = _ref14.agentName;
|
|
144
175
|
if (session === 'bot') {
|
|
145
176
|
return /*#__PURE__*/_react.default.createElement(_avatars.default, {
|
|
146
177
|
size: "small",
|
|
@@ -171,23 +202,23 @@ var handleState = function handleState(_ref11) {
|
|
|
171
202
|
// Start of File Attachment
|
|
172
203
|
var FileAttachmentWrapper = _styledComponents.default.div.withConfig({
|
|
173
204
|
displayName: "chatBody__FileAttachmentWrapper"
|
|
174
|
-
})(["display:flex;cursor:pointer;flex-direction:row;align-items:center;padding:1rem;background:", ";color:", ";border-radius:", ";border:", ";> *{&:last-child{margin-left:auto;}:not(:last-child){margin-right:0.5rem;}}&&& > *{align-items:center;color:", ";}", " ", ""], function (
|
|
175
|
-
var state =
|
|
205
|
+
})(["display:flex;cursor:pointer;flex-direction:row;align-items:center;padding:1rem;background:", ";color:", ";border-radius:", ";border:", ";> *{&:last-child{margin-left:auto;}:not(:last-child){margin-right:0.5rem;}}&&& > *{align-items:center;color:", ";}", " ", ""], function (_ref15) {
|
|
206
|
+
var state = _ref15.state;
|
|
176
207
|
if (state) {
|
|
177
208
|
if (state === 'inbound') return "#F9FAFB";
|
|
178
209
|
if (state === 'outbound') return "".concat(_colors.BmPrimaryBlue);
|
|
179
210
|
}
|
|
180
211
|
return "".concat(_colors.BmPrimaryWhite);
|
|
181
|
-
}, function (
|
|
182
|
-
var state =
|
|
212
|
+
}, function (_ref16) {
|
|
213
|
+
var state = _ref16.state;
|
|
183
214
|
if (state) {
|
|
184
215
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
|
|
185
216
|
if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
|
|
186
217
|
}
|
|
187
218
|
return "".concat(_colors.BmPrimaryWhite);
|
|
188
|
-
}, function (
|
|
189
|
-
var state =
|
|
190
|
-
src =
|
|
219
|
+
}, function (_ref17) {
|
|
220
|
+
var state = _ref17.state,
|
|
221
|
+
src = _ref17.src;
|
|
191
222
|
if (state) {
|
|
192
223
|
if (state === 'inbound') {
|
|
193
224
|
if (src) {
|
|
@@ -203,14 +234,14 @@ var FileAttachmentWrapper = _styledComponents.default.div.withConfig({
|
|
|
203
234
|
}
|
|
204
235
|
}
|
|
205
236
|
return "".concat(_colors.BmPrimaryWhite);
|
|
206
|
-
}, function (
|
|
207
|
-
var state =
|
|
237
|
+
}, function (_ref18) {
|
|
238
|
+
var state = _ref18.state;
|
|
208
239
|
if (state) {
|
|
209
240
|
if (state === 'inbound') return "0.071rem solid ".concat(_colors.BmGrey200, ";");
|
|
210
241
|
}
|
|
211
242
|
return '';
|
|
212
|
-
}, function (
|
|
213
|
-
var state =
|
|
243
|
+
}, function (_ref19) {
|
|
244
|
+
var state = _ref19.state;
|
|
214
245
|
if (state) {
|
|
215
246
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryBlue);
|
|
216
247
|
if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
|
|
@@ -218,14 +249,14 @@ var FileAttachmentWrapper = _styledComponents.default.div.withConfig({
|
|
|
218
249
|
return "".concat(_colors.BmPrimaryWhite);
|
|
219
250
|
}, '' /* max-width: 100%; */, '' /* max-height: 100%; */);
|
|
220
251
|
|
|
221
|
-
var BmFileAttachment = function BmFileAttachment(
|
|
222
|
-
var state =
|
|
223
|
-
file =
|
|
224
|
-
src =
|
|
225
|
-
fileName =
|
|
226
|
-
onDownload =
|
|
227
|
-
link =
|
|
228
|
-
rest = _objectWithoutProperties(
|
|
252
|
+
var BmFileAttachment = function BmFileAttachment(_ref20) {
|
|
253
|
+
var state = _ref20.state,
|
|
254
|
+
file = _ref20.file,
|
|
255
|
+
src = _ref20.src,
|
|
256
|
+
fileName = _ref20.fileName,
|
|
257
|
+
onDownload = _ref20.onDownload,
|
|
258
|
+
link = _ref20.link,
|
|
259
|
+
rest = _objectWithoutProperties(_ref20, _excluded);
|
|
229
260
|
return /*#__PURE__*/_react.default.createElement(FileAttachmentWrapper, _extends({
|
|
230
261
|
state: state,
|
|
231
262
|
src: src
|
|
@@ -244,8 +275,8 @@ var BmFileAttachment = function BmFileAttachment(_ref17) {
|
|
|
244
275
|
// Start of Component for Images
|
|
245
276
|
var BmImageWrapper = _styledComponents.default.div.withConfig({
|
|
246
277
|
displayName: "chatBody__BmImageWrapper"
|
|
247
|
-
})(["display:flex;flex-direction:column;color:", ";"], function (
|
|
248
|
-
var state =
|
|
278
|
+
})(["display:flex;flex-direction:column;color:", ";"], function (_ref21) {
|
|
279
|
+
var state = _ref21.state;
|
|
249
280
|
if (state) {
|
|
250
281
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
|
|
251
282
|
if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
|
|
@@ -255,8 +286,8 @@ var BmImageWrapper = _styledComponents.default.div.withConfig({
|
|
|
255
286
|
exports.BmImageWrapper = BmImageWrapper;
|
|
256
287
|
var BmImage = _styledComponents.default.img.withConfig({
|
|
257
288
|
displayName: "chatBody__BmImage"
|
|
258
|
-
})(["", " width:100%;object-fit:cover;flex-grow:1;border-radius:", ";"], '' /* Fix width */, function (
|
|
259
|
-
var state =
|
|
289
|
+
})(["", " width:100%;object-fit:cover;flex-grow:1;border-radius:", ";"], '' /* Fix width */, function (_ref22) {
|
|
290
|
+
var state = _ref22.state;
|
|
260
291
|
if (state) {
|
|
261
292
|
if (state === 'inbound') return '.5714rem .5714rem 0rem 0rem';
|
|
262
293
|
if (state === 'outbound') return '.5714rem .5714rem 0rem 0rem';
|
|
@@ -264,11 +295,11 @@ var BmImage = _styledComponents.default.img.withConfig({
|
|
|
264
295
|
return "".concat(_colors.BmPrimaryWhite);
|
|
265
296
|
});
|
|
266
297
|
exports.BmImage = BmImage;
|
|
267
|
-
var BmImageChat = function BmImageChat(
|
|
268
|
-
var state =
|
|
269
|
-
src =
|
|
270
|
-
fileName =
|
|
271
|
-
rest = _objectWithoutProperties(
|
|
298
|
+
var BmImageChat = function BmImageChat(_ref23) {
|
|
299
|
+
var state = _ref23.state,
|
|
300
|
+
src = _ref23.src,
|
|
301
|
+
fileName = _ref23.fileName,
|
|
302
|
+
rest = _objectWithoutProperties(_ref23, _excluded2);
|
|
272
303
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(BmImageWrapper, _extends({
|
|
273
304
|
state: state
|
|
274
305
|
}, rest), /*#__PURE__*/_react.default.createElement(BmImage, {
|
|
@@ -291,15 +322,15 @@ var MessageState = _styledComponents.default.div.withConfig({
|
|
|
291
322
|
exports.MessageState = MessageState;
|
|
292
323
|
var RepliedTextWrapper = _styledComponents.default.div.withConfig({
|
|
293
324
|
displayName: "chatBody__RepliedTextWrapper"
|
|
294
|
-
})(["display:flex;flex-direction:column;justify-content:center;padding:1.14286rem 1.14286rem 1.14286rem 0.35714rem;gap:1rem;border-radius:0.25rem 0.25rem 0.25rem 0.25rem;border:1px solid ", ";background:", ";color:", ";"], _colors.BmGrey200, function (
|
|
295
|
-
var state =
|
|
325
|
+
})(["display:flex;flex-direction:column;justify-content:center;padding:1.14286rem 1.14286rem 1.14286rem 0.35714rem;gap:1rem;border-radius:0.25rem 0.25rem 0.25rem 0.25rem;border:1px solid ", ";background:", ";color:", ";"], _colors.BmGrey200, function (_ref24) {
|
|
326
|
+
var state = _ref24.state;
|
|
296
327
|
if (state) {
|
|
297
328
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryWhite);
|
|
298
329
|
if (state === 'outbound') return "".concat(_colors.BmPrimaryBlue);
|
|
299
330
|
}
|
|
300
331
|
return "".concat(_colors.BmPrimaryWhite);
|
|
301
|
-
}, function (
|
|
302
|
-
var state =
|
|
332
|
+
}, function (_ref25) {
|
|
333
|
+
var state = _ref25.state;
|
|
303
334
|
if (state) {
|
|
304
335
|
if (state === 'inbound') return "".concat(_colors.BmPrimaryBlack);
|
|
305
336
|
if (state === 'outbound') return "".concat(_colors.BmPrimaryWhite);
|
|
@@ -307,24 +338,98 @@ var RepliedTextWrapper = _styledComponents.default.div.withConfig({
|
|
|
307
338
|
return "".concat(_colors.BmPrimaryWhite);
|
|
308
339
|
});
|
|
309
340
|
exports.RepliedTextWrapper = RepliedTextWrapper;
|
|
310
|
-
|
|
311
|
-
var
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
341
|
+
var QuickReplyRender = function QuickReplyRender(_ref26) {
|
|
342
|
+
var content = _ref26.content,
|
|
343
|
+
options = _ref26.options,
|
|
344
|
+
type = _ref26.type,
|
|
345
|
+
state = _ref26.state,
|
|
346
|
+
rest = _ref26.rest,
|
|
347
|
+
isInteractive = _ref26.isInteractive;
|
|
348
|
+
return /*#__PURE__*/_react.default.createElement(Messages, {
|
|
349
|
+
type: type,
|
|
350
|
+
state: state,
|
|
351
|
+
isInteractive: isInteractive,
|
|
352
|
+
isImg: true
|
|
353
|
+
}, (content === null || content === void 0 ? void 0 : content.url) && /*#__PURE__*/_react.default.createElement(BmImageChat, _extends({
|
|
354
|
+
state: state,
|
|
355
|
+
src: content === null || content === void 0 ? void 0 : content.url
|
|
356
|
+
}, rest)), /*#__PURE__*/_react.default.createElement("strong", null, content === null || content === void 0 ? void 0 : content.header), /*#__PURE__*/_react.default.createElement("p", null, content === null || content === void 0 ? void 0 : content.text), /*#__PURE__*/_react.default.createElement("small", null, content === null || content === void 0 ? void 0 : content.caption), options === null || options === void 0 ? void 0 : options.map(function (button) {
|
|
357
|
+
return (
|
|
358
|
+
/*#__PURE__*/
|
|
359
|
+
// eslint-disable-next-line react/jsx-key
|
|
360
|
+
_react.default.createElement(IntButton, {
|
|
361
|
+
state: state
|
|
362
|
+
}, button === null || button === void 0 ? void 0 : button.title)
|
|
363
|
+
);
|
|
364
|
+
}));
|
|
365
|
+
};
|
|
366
|
+
var ProductDetailRender = function ProductDetailRender(_ref27) {
|
|
367
|
+
var type = _ref27.type,
|
|
368
|
+
state = _ref27.state,
|
|
369
|
+
header = _ref27.header,
|
|
370
|
+
body = _ref27.body,
|
|
371
|
+
isInteractive = _ref27.isInteractive;
|
|
372
|
+
console.log(type, state, header, body);
|
|
373
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Messages, {
|
|
374
|
+
type: type,
|
|
375
|
+
state: state,
|
|
376
|
+
isInteractive: isInteractive
|
|
377
|
+
}, /*#__PURE__*/_react.default.createElement("strong", null, header === null || header === void 0 ? void 0 : header.text), /*#__PURE__*/_react.default.createElement("p", null, body === null || body === void 0 ? void 0 : body.text), /*#__PURE__*/_react.default.createElement(IntButton, {
|
|
378
|
+
state: state
|
|
379
|
+
}, /*#__PURE__*/_react.default.createElement(_ShoppingCartOutlined.default, null), "Catalog")));
|
|
380
|
+
};
|
|
381
|
+
var ListReplyRender = function ListReplyRender(_ref28) {
|
|
382
|
+
var _globalButtons$;
|
|
383
|
+
var title = _ref28.title,
|
|
384
|
+
body = _ref28.body,
|
|
385
|
+
globalButtons = _ref28.globalButtons,
|
|
386
|
+
isInteractive = _ref28.isInteractive,
|
|
387
|
+
type = _ref28.type,
|
|
388
|
+
state = _ref28.state;
|
|
389
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Messages, {
|
|
390
|
+
type: type,
|
|
391
|
+
state: state,
|
|
392
|
+
isInteractive: isInteractive
|
|
393
|
+
}, /*#__PURE__*/_react.default.createElement("strong", null, title), /*#__PURE__*/_react.default.createElement("p", null, body), /*#__PURE__*/_react.default.createElement(IntButton, {
|
|
394
|
+
state: state
|
|
395
|
+
}, /*#__PURE__*/_react.default.createElement(_List.default, null), (_globalButtons$ = globalButtons[0]) === null || _globalButtons$ === void 0 ? void 0 : _globalButtons$.title)));
|
|
396
|
+
};
|
|
397
|
+
var OrderRender = function OrderRender(_ref29) {
|
|
398
|
+
var count = _ref29.count,
|
|
399
|
+
amount = _ref29.amount,
|
|
400
|
+
type = _ref29.type,
|
|
401
|
+
state = _ref29.state;
|
|
402
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Messages, {
|
|
403
|
+
type: type,
|
|
404
|
+
state: state
|
|
405
|
+
}, /*#__PURE__*/_react.default.createElement(OrderBody, {
|
|
406
|
+
state: state
|
|
407
|
+
}, /*#__PURE__*/_react.default.createElement(CartContent, {
|
|
408
|
+
state: state
|
|
409
|
+
}, /*#__PURE__*/_react.default.createElement(_ShoppingCartOutlined.default, {
|
|
410
|
+
fontSize: "small"
|
|
411
|
+
}), /*#__PURE__*/_react.default.createElement("h5", null, /*#__PURE__*/_react.default.createElement("strong", null, count, " items"))), /*#__PURE__*/_react.default.createElement("div", null, amount, " (estimated total)")), /*#__PURE__*/_react.default.createElement(IntButton, {
|
|
412
|
+
state: state
|
|
413
|
+
}, "view sent cart")));
|
|
414
|
+
};
|
|
415
|
+
BmChat.Details = function (_ref30) {
|
|
416
|
+
var children = _ref30.children,
|
|
417
|
+
state = _ref30.state,
|
|
418
|
+
displayTime = _ref30.displayTime,
|
|
419
|
+
status = _ref30.status,
|
|
420
|
+
session = _ref30.session,
|
|
421
|
+
src = _ref30.src,
|
|
422
|
+
file = _ref30.file,
|
|
423
|
+
fileName = _ref30.fileName,
|
|
424
|
+
sessionDetails = _ref30.sessionDetails,
|
|
425
|
+
sessionTimeline = _ref30.sessionTimeline,
|
|
426
|
+
feedPostComments = _ref30.feedPostComments,
|
|
427
|
+
agentName = _ref30.agentName,
|
|
428
|
+
metadata = _ref30.metadata,
|
|
429
|
+
isInteractive = _ref30.isInteractive,
|
|
430
|
+
type = _ref30.type,
|
|
431
|
+
rest = _objectWithoutProperties(_ref30, _excluded3);
|
|
432
|
+
console.log(src);
|
|
328
433
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Details, _extends({
|
|
329
434
|
state: state
|
|
330
435
|
}, rest), /*#__PURE__*/_react.default.createElement(MessageState, null, state === 'inbound' && session && handleState({
|
|
@@ -333,63 +438,57 @@ BmChat.Details = function (_ref23) {
|
|
|
333
438
|
agentName: agentName
|
|
334
439
|
})), /*#__PURE__*/_react.default.createElement(MessageDetails, {
|
|
335
440
|
feedPostComments: feedPostComments
|
|
336
|
-
}, src && /*#__PURE__*/_react.default.createElement(BmImageChat, _extends({
|
|
441
|
+
}, src && !(0, _lodash.isUndefined)(src) && /*#__PURE__*/_react.default.createElement(BmImageChat, _extends({
|
|
337
442
|
state: state,
|
|
338
443
|
src: src,
|
|
339
444
|
fileName: fileName
|
|
340
445
|
}, rest)), children && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, metadata ? /*#__PURE__*/_react.default.createElement(RepliedTextWrapper, {
|
|
341
446
|
state: state
|
|
342
|
-
}, metadata.type === 'quick_reply' ? /*#__PURE__*/_react.default.createElement(
|
|
343
|
-
isInteractive:
|
|
447
|
+
}, metadata.type === 'quick_reply' ? /*#__PURE__*/_react.default.createElement(QuickReplyRender, _extends({
|
|
448
|
+
isInteractive: true,
|
|
449
|
+
rest: rest
|
|
450
|
+
}, metadata, {
|
|
344
451
|
type: type,
|
|
345
|
-
state: state
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
_react.default.createElement(IntButton, {
|
|
355
|
-
state: state
|
|
356
|
-
}, button === null || button === void 0 ? void 0 : button.title)
|
|
357
|
-
);
|
|
358
|
-
})) : metadata.type === 'quick_reply' ? /*#__PURE__*/_react.default.createElement(Messages, {
|
|
359
|
-
isInteractive: isInteractive,
|
|
452
|
+
state: state
|
|
453
|
+
})) : metadata.type === 'list' ? /*#__PURE__*/_react.default.createElement(ListReplyRender, _extends({
|
|
454
|
+
isInteractive: true
|
|
455
|
+
}, metadata, {
|
|
456
|
+
type: type,
|
|
457
|
+
state: state
|
|
458
|
+
})) : metadata.type === 'product_details' ? /*#__PURE__*/_react.default.createElement(ProductDetailRender, _extends({
|
|
459
|
+
isInteractive: true
|
|
460
|
+
}, metadata, {
|
|
360
461
|
type: type,
|
|
361
462
|
state: state
|
|
362
|
-
}
|
|
463
|
+
})) : metadata.type === 'order' ? /*#__PURE__*/_react.default.createElement(OrderRender, _extends({}, metadata, {
|
|
464
|
+
type: type,
|
|
363
465
|
state: state
|
|
364
|
-
}
|
|
466
|
+
})) : /*#__PURE__*/_react.default.createElement(Messages, {
|
|
365
467
|
metadata: metadata,
|
|
366
468
|
state: state
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
isImg: true
|
|
371
|
-
}, (children === null || children === void 0 ? void 0 : (_children$content = children.content) === null || _children$content === void 0 ? void 0 : _children$content.url) && /*#__PURE__*/_react.default.createElement(BmImageChat, _extends({
|
|
372
|
-
state: state,
|
|
373
|
-
src: children === null || children === void 0 ? void 0 : (_children$content2 = children.content) === null || _children$content2 === void 0 ? void 0 : _children$content2.url
|
|
374
|
-
}, rest)), /*#__PURE__*/_react.default.createElement("strong", null, children === null || children === void 0 ? void 0 : (_children$content3 = children.content) === null || _children$content3 === void 0 ? void 0 : _children$content3.header), /*#__PURE__*/_react.default.createElement("p", null, children === null || children === void 0 ? void 0 : (_children$content4 = children.content) === null || _children$content4 === void 0 ? void 0 : _children$content4.text), /*#__PURE__*/_react.default.createElement("small", null, children === null || children === void 0 ? void 0 : (_children$content5 = children.content) === null || _children$content5 === void 0 ? void 0 : _children$content5.caption), children === null || children === void 0 ? void 0 : (_children$options = children.options) === null || _children$options === void 0 ? void 0 : _children$options.map(function (button) {
|
|
375
|
-
return (
|
|
376
|
-
/*#__PURE__*/
|
|
377
|
-
// eslint-disable-next-line react/jsx-key
|
|
378
|
-
_react.default.createElement(IntButton, {
|
|
379
|
-
state: state
|
|
380
|
-
}, button === null || button === void 0 ? void 0 : button.title)
|
|
381
|
-
);
|
|
382
|
-
})) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children.type === 'product_details' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Messages, {
|
|
469
|
+
}), children) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, type && (type === 'interactive' || type === 'order') ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children.type === 'quick_reply' && /*#__PURE__*/_react.default.createElement(QuickReplyRender, _extends({
|
|
470
|
+
rest: rest
|
|
471
|
+
}, children, {
|
|
383
472
|
type: type,
|
|
384
473
|
state: state
|
|
385
|
-
},
|
|
474
|
+
})), children.type === 'list' && /*#__PURE__*/_react.default.createElement(ListReplyRender, _extends({}, children, {
|
|
475
|
+
type: type,
|
|
386
476
|
state: state
|
|
387
|
-
},
|
|
477
|
+
})), children.type === 'product_details' && /*#__PURE__*/_react.default.createElement(ProductDetailRender, _extends({}, children, {
|
|
388
478
|
type: type,
|
|
389
479
|
state: state
|
|
390
|
-
},
|
|
480
|
+
})), children.type === 'order' && /*#__PURE__*/_react.default.createElement(OrderRender, _extends({}, children, {
|
|
481
|
+
type: type,
|
|
391
482
|
state: state
|
|
392
|
-
}
|
|
483
|
+
}))) : type === 'pdf' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactPdf.Document, {
|
|
484
|
+
file: {
|
|
485
|
+
url: "".concat(file)
|
|
486
|
+
}
|
|
487
|
+
}, /*#__PURE__*/_react.default.createElement(_reactPdf.Page, {
|
|
488
|
+
pageNumber: 1,
|
|
489
|
+
height: "250",
|
|
490
|
+
width: "200"
|
|
491
|
+
}))) : /*#__PURE__*/_react.default.createElement(Messages, {
|
|
393
492
|
state: state
|
|
394
493
|
}, children))), file && /*#__PURE__*/_react.default.createElement(BmFileAttachment, _extends({
|
|
395
494
|
file: file,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beem-component",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.19",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/components/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"@material-ui/icons": "^4.11.2",
|
|
49
49
|
"@mui/icons-material": "^5.2.1",
|
|
50
50
|
"@mui/material": "^5.2.3",
|
|
51
|
+
"bootstrap": "^5.3.3",
|
|
51
52
|
"js-file-download": "^0.4.12",
|
|
52
53
|
"lodash": "^4.17.21",
|
|
53
54
|
"node-sass": "^6.0.1",
|