beem-component 2.0.22 → 2.0.23
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.
|
@@ -356,6 +356,7 @@ var RepliedTextWrapper = _styledComponents.default.div.withConfig({
|
|
|
356
356
|
});
|
|
357
357
|
exports.RepliedTextWrapper = RepliedTextWrapper;
|
|
358
358
|
var QuickReplyRender = function QuickReplyRender(_ref26) {
|
|
359
|
+
var _content$text;
|
|
359
360
|
var content = _ref26.content,
|
|
360
361
|
options = _ref26.options,
|
|
361
362
|
type = _ref26.type,
|
|
@@ -370,7 +371,9 @@ var QuickReplyRender = function QuickReplyRender(_ref26) {
|
|
|
370
371
|
}, (content === null || content === void 0 ? void 0 : content.url) && /*#__PURE__*/_react.default.createElement(BmImageChat, _extends({
|
|
371
372
|
state: state,
|
|
372
373
|
src: content === null || content === void 0 ? void 0 : content.url
|
|
373
|
-
}, rest)), /*#__PURE__*/_react.default.createElement("strong", null, content === null || content === void 0 ? void 0 : content.header),
|
|
374
|
+
}, rest)), /*#__PURE__*/_react.default.createElement("strong", null, content === null || content === void 0 ? void 0 : content.header), content === null || content === void 0 ? void 0 : (_content$text = content.text) === null || _content$text === void 0 ? void 0 : _content$text.split('\n').map(function (line) {
|
|
375
|
+
return /*#__PURE__*/_react.default.createElement("p", null, line, /*#__PURE__*/_react.default.createElement("br", null));
|
|
376
|
+
}), /*#__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) {
|
|
374
377
|
return (
|
|
375
378
|
/*#__PURE__*/
|
|
376
379
|
// eslint-disable-next-line react/jsx-key
|
|
@@ -407,7 +410,9 @@ var ListReplyRender = function ListReplyRender(_ref28) {
|
|
|
407
410
|
type: type,
|
|
408
411
|
state: state,
|
|
409
412
|
isInteractive: isInteractive
|
|
410
|
-
}, /*#__PURE__*/_react.default.createElement("strong", null, title),
|
|
413
|
+
}, /*#__PURE__*/_react.default.createElement("strong", null, title), body.split('\n').map(function (line) {
|
|
414
|
+
return /*#__PURE__*/_react.default.createElement("p", null, line, /*#__PURE__*/_react.default.createElement("br", null));
|
|
415
|
+
}), /*#__PURE__*/_react.default.createElement(IntButton, {
|
|
411
416
|
state: state
|
|
412
417
|
}, /*#__PURE__*/_react.default.createElement(_List.default, null), (_globalButtons$ = globalButtons[0]) === null || _globalButtons$ === void 0 ? void 0 : _globalButtons$.title)));
|
|
413
418
|
};
|
package/package.json
CHANGED
package/src/App.js
CHANGED
|
@@ -106,8 +106,10 @@ const Chat = () => {
|
|
|
106
106
|
metadata: {
|
|
107
107
|
id: '6538d48e-1b17-45e8-8e44-be457d3695c0',
|
|
108
108
|
prev_message:
|
|
109
|
-
'{"dotgoV2":{"type":"product_details","subType":"product_list","catalogId":"3987644271555185","header":{"text":"Our Food Menu"},"body":{"text":"*Terms and Conditions for Delivery* \\n- Though we try our best to deliver your food in time, there might be delays\\n- Prices might differ from the ones on the website \\n- Packing charges will be added on the prices \\n- Minimum delivery order TZS 13,000"},"footer":{"text":"Powered by Beem"},"sections":[{"title":"South Indian","productList":[{"productId":95},{"productId":96},{"productId":97},{"productId":98},{"productId":99},{"productId":100},{"productId":101},{"productId":105}]},{"title":"Soups","productList":[{"productId":102},{"productId":103},{"productId":104}]},{"title":"Paratha","productList":[{"productId":106},{"productId":107},{"productId":108},{"productId":109}]},{"title":"Starters & Chaat","productList":[{"productId":110},{"productId":111}]},{"title":"Extras","productList":[{"productId":112},{"productId":113},{"productId":114}]},{"title":"Thali","productList":[{"productId":115},{"productId":116},{"productId":117},{"productId":118}]}]}}',
|
|
110
|
-
|
|
109
|
+
// '{"dotgoV2":{"type":"product_details","subType":"product_list","catalogId":"3987644271555185","header":{"text":"Our Food Menu"},"body":{"text":"*Terms and Conditions for Delivery* \\n- Though we try our best to deliver your food in time, there might be delays\\n- Prices might differ from the ones on the website \\n- Packing charges will be added on the prices \\n- Minimum delivery order TZS 13,000"},"footer":{"text":"Powered by Beem"},"sections":[{"title":"South Indian","productList":[{"productId":95},{"productId":96},{"productId":97},{"productId":98},{"productId":99},{"productId":100},{"productId":101},{"productId":105}]},{"title":"Soups","productList":[{"productId":102},{"productId":103},{"productId":104}]},{"title":"Paratha","productList":[{"productId":106},{"productId":107},{"productId":108},{"productId":109}]},{"title":"Starters & Chaat","productList":[{"productId":110},{"productId":111}]},{"title":"Extras","productList":[{"productId":112},{"productId":113},{"productId":114}]},{"title":"Thali","productList":[{"productId":115},{"productId":116},{"productId":117},{"productId":118}]}]}}',
|
|
110
|
+
// '{"dotgoV2":{"type":"quick_reply","content":{"type":"text","header":"HELOOOOOOOOOO", "url": "https://i.imgur.com/BZylAb1.jpeg","text":"We value your opinion! Would you be willing to take a short survey to help us improve?","caption":""},"options":[{"type":"text","title":"Give Feedback","postbackText":"bm-feedback|0|181661e8-9209-4665-ad19-680981136ae8"},{"type":"text","title":"No Thank you","postbackText":"dev-defined-postback2"}]}}',
|
|
111
|
+
// '{"dotgoV2":{"type":"quick_reply","content":{"type":"text","header":"","text":"Thank you we have received your order\\n\\n• 1 X 20\\" Zuri Wig Straight Mirna Caramel Brown - USD 505\\n• 1 X 14\\" Zuri Wig Straight Miss Van Platinum Blonde - USD 960\\n• 1 X 18\\" Zuri Wig Straight Miss Van Platinum Blonde - USD 960\\n• 1 X 10\\" Zuri Wig Straight Monroe Platinum Blonde - USD 505\\n\\n\\n*Proceed to payment to complete order process*","caption":""},"options":[{"type":"text","title":"Proceed to payment","postbackText":"option-defined-postback1"},{"type":"text","title":"Main menu","postbackText":"option-defined-postback2"}]}}',
|
|
112
|
+
'{"dotgoV2":{"type":"list","title":"","body":"Hey Abdallah,\\n\\n*Welcome to Zuri House Of Beauty* \\n\\nWe offer a range of styles designed by Black women for Black women. Our platform, brand, and financing solutions promote economic mobility for Black women entrepreneurs. \\n\\nHow can I assist you today?","globalButtons":[{"type":"text","title":"Browse Services"}],"items":[{"title":"Browse Services","subtitle":"","options":[{"type":"text","title":"View Products","description":"","postbackText":"section 1 row 1 postback payload"},{"type":"text","title":"Track Order","description":"Enter order id for status","postbackText":"section 1 row 1 postback payload"},{"type":"text","title":"Support","description":"","postbackText":"section 1 row 1 postback payload"},{"type":"text","title":"Feedback","description":"Give feedback","postbackText":"bm-feedback|0|bf5ff7a3-6425-484e-9b7b-6104ec774bff"},{"type":"text","title":"Ask us anything","description":"","postbackText":"section 1 row 1 postback payload"}]}]}}',
|
|
111
113
|
},
|
|
112
114
|
};
|
|
113
115
|
|
|
@@ -441,7 +441,12 @@ const QuickReplyRender = ({
|
|
|
441
441
|
)}
|
|
442
442
|
|
|
443
443
|
<strong>{content?.header}</strong>
|
|
444
|
-
|
|
444
|
+
{content?.text?.split('\n').map((line) => (
|
|
445
|
+
<p>
|
|
446
|
+
{line}
|
|
447
|
+
<br />
|
|
448
|
+
</p>
|
|
449
|
+
))}
|
|
445
450
|
<small>{content?.caption}</small>
|
|
446
451
|
{options?.map((button) => (
|
|
447
452
|
// eslint-disable-next-line react/jsx-key
|
|
@@ -477,7 +482,12 @@ const ListReplyRender = ({
|
|
|
477
482
|
<>
|
|
478
483
|
<Messages type={type} state={state} isInteractive={isInteractive}>
|
|
479
484
|
<strong>{title}</strong>
|
|
480
|
-
|
|
485
|
+
{body.split('\n').map((line) => (
|
|
486
|
+
<p>
|
|
487
|
+
{line}
|
|
488
|
+
<br />
|
|
489
|
+
</p>
|
|
490
|
+
))}
|
|
481
491
|
<IntButton state={state}>
|
|
482
492
|
<ListIcon />
|
|
483
493
|
{globalButtons[0]?.title}
|