@subiz/widget-v4 4.0.77 → 4.0.78

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.
Files changed (85) hide show
  1. package/assets/less/message.less +10 -1
  2. package/compiled_src/chatbox/Buttons.js +3 -3
  3. package/compiled_src/chatbox/Event.js +2 -1
  4. package/compiled_src/chatbox/GenericTemplateAttachments.js +8 -5
  5. package/compiled_src/chatbox/ProductAttachments.js +4 -4
  6. package/dist/0b82fa7e5c3b07b40a44.png +1 -0
  7. package/dist/0f4af006e38ee8b93633.png +1 -0
  8. package/dist/132.js +17 -61
  9. package/dist/178.js +341 -174
  10. package/dist/17f00e48d38.132.js +1 -0
  11. package/dist/17f00e48d38.178.js +1 -0
  12. package/dist/{180d0eaa4dc.213.js → 17f00e48d38.213.js} +0 -0
  13. package/dist/{180efeaa053.335.js → 17f00e48d38.335.js} +1 -1
  14. package/dist/17f00e48d38.362.js +1 -0
  15. package/dist/17f00e48d38.441.js +1 -0
  16. package/dist/{180d0eaa4dc.605.js → 17f00e48d38.605.js} +0 -0
  17. package/dist/17f00e48d38.678.js +1 -0
  18. package/dist/17f00e48d38.782.js +1 -0
  19. package/dist/17f00e48d38.app.js +1 -0
  20. package/dist/{180d0eaa4dc.index.html → 17f00e48d38.index.html} +1 -1
  21. package/dist/{180d0eaa4dc.library.html → 17f00e48d38.library.html} +1 -1
  22. package/dist/17f00e48d38.library.js +1 -0
  23. package/dist/{180d0eaa4dc.preview.html → 17f00e48d38.preview.html} +1 -1
  24. package/dist/17f00e48d38.preview.js +1 -0
  25. package/dist/17f00e48d38.screenshoot.js +1 -0
  26. package/dist/1ea1c6cd21d25176810c.png +1 -0
  27. package/dist/292d42404e1b03398f61.png +1 -0
  28. package/dist/312d376370831b7bea83.png +1 -0
  29. package/dist/313d1bfc1cf776d1aefe.png +1 -0
  30. package/dist/335.js +2 -2
  31. package/dist/362.js +71 -21
  32. package/dist/441.js +54 -136
  33. package/dist/4aa58bb7a66bb44975aa.png +1 -0
  34. package/dist/56ce063bc6c81adb7322.png +1 -0
  35. package/dist/678.js +70 -20
  36. package/dist/6a411166ef5cc79e0714.png +1 -0
  37. package/dist/6faf403782fefacc1649.png +1 -0
  38. package/dist/782.js +118 -21
  39. package/dist/79dca33c68fab79c067f.png +1 -0
  40. package/dist/82da1578fa84f9debaeb.png +1 -0
  41. package/dist/8b8e0f0824743974b282.png +1 -0
  42. package/dist/8d551390d81e39130a3c.png +1 -0
  43. package/dist/9fc61b9479877ebdb6c7.png +1 -0
  44. package/dist/HASH +1 -1
  45. package/dist/a165d31dcb3dc90f1057.png +1 -0
  46. package/dist/a98d4a5698812c4426b3.png +1 -0
  47. package/dist/c41606bf9d1b604e46d5.png +1 -0
  48. package/dist/ce1f7450ce6c1aacd330.png +1 -0
  49. package/dist/cf8c01e88f4770a6e3e5.png +1 -0
  50. package/dist/dfbcfeab1d5622a737e2.png +1 -0
  51. package/dist/e4893ed8c2f7b8329919.png +1 -0
  52. package/dist/ec2ab4eb4ef73d186186.png +1 -0
  53. package/dist/screenshoot.html +1 -1
  54. package/dist/screenshoot.js +83 -133
  55. package/package.json +1 -1
  56. package/src/chatbox/Buttons.js +3 -3
  57. package/src/chatbox/Event.js +1 -1
  58. package/src/chatbox/GenericTemplateAttachments.js +28 -22
  59. package/src/chatbox/ProductAttachments.js +4 -4
  60. package/dist/180d0eaa4dc.132.js +0 -1
  61. package/dist/180d0eaa4dc.178.js +0 -1
  62. package/dist/180d0eaa4dc.335.js +0 -1
  63. package/dist/180d0eaa4dc.362.js +0 -1
  64. package/dist/180d0eaa4dc.441.js +0 -1
  65. package/dist/180d0eaa4dc.678.js +0 -1
  66. package/dist/180d0eaa4dc.782.js +0 -1
  67. package/dist/180d0eaa4dc.app.js +0 -1
  68. package/dist/180d0eaa4dc.library.js +0 -1
  69. package/dist/180d0eaa4dc.preview.js +0 -1
  70. package/dist/180d0eaa4dc.screenshoot.js +0 -1
  71. package/dist/180efeaa053.132.js +0 -1
  72. package/dist/180efeaa053.178.js +0 -1
  73. package/dist/180efeaa053.213.js +0 -1
  74. package/dist/180efeaa053.362.js +0 -1
  75. package/dist/180efeaa053.441.js +0 -1
  76. package/dist/180efeaa053.605.js +0 -1
  77. package/dist/180efeaa053.678.js +0 -1
  78. package/dist/180efeaa053.782.js +0 -1
  79. package/dist/180efeaa053.app.js +0 -1
  80. package/dist/180efeaa053.index.html +0 -22
  81. package/dist/180efeaa053.library.html +0 -22
  82. package/dist/180efeaa053.library.js +0 -1
  83. package/dist/180efeaa053.preview.html +0 -759
  84. package/dist/180efeaa053.preview.js +0 -1
  85. package/dist/180efeaa053.screenshoot.js +0 -1
@@ -479,6 +479,7 @@ a.message_error {
479
479
  font-weight: 500;
480
480
  font-size: 16px;
481
481
  line-height: 20px;
482
+ white-space: normal;
482
483
  }
483
484
 
484
485
  .generic-attachment--element-subtitle {
@@ -688,13 +689,21 @@ a.product_attachment__title {
688
689
  font-weight: 500;
689
690
  .color(@black);
690
691
 
691
- word-break: break-all;
692
+ word-break: break-word;
693
+ margin-bottom: 5px;
692
694
  }
693
695
 
694
696
  .product_attachment__subtitle {
697
+ white-space: pre-wrap;
698
+ display: -webkit-box;
699
+ -webkit-line-clamp: 3;
700
+ -webkit-box-orient: vertical;
701
+ overflow: hidden;
695
702
  padding: 5px 10px;
696
703
  .color(#aaa);
697
704
  padding-top: 0;
705
+ padding-bottom: 0;
706
+ margin-bottom: 5px;
698
707
  }
699
708
 
700
709
  .product_attachment__btn_external_link {
@@ -28,7 +28,7 @@ class Buttons extends _common.Com {
28
28
  href: 'tel:' + button.phone_number,
29
29
  key: index,
30
30
  title: button.title
31
- }, button.title);
31
+ }, this.props.t.i18n(button.i18n_title) || button.title);
32
32
  }
33
33
 
34
34
  if (button.type === 'url_button') {
@@ -38,7 +38,7 @@ class Buttons extends _common.Com {
38
38
  target: "_blank",
39
39
  key: index,
40
40
  title: button.title
41
- }, button.title || button.url);
41
+ }, this.props.t.i18n(button.i18n_title) || button.title || button.url);
42
42
  }
43
43
 
44
44
  if (button.type === 'postback_button') {
@@ -46,7 +46,7 @@ class Buttons extends _common.Com {
46
46
  class: "url-button-attachment",
47
47
  href: "javascript:;",
48
48
  onClick: _ => this.props.onSelect(button)
49
- }, button.title);
49
+ }, this.props.t.i18n(button.i18n_title) || button.title);
50
50
  }
51
51
 
52
52
  if (button.type === 'widget_ask_desktop_notify_button') return null;
@@ -197,7 +197,8 @@ class Event extends _common.Com {
197
197
  }), (0, _preact.h)(_GenericTemplateAttachments.default, {
198
198
  store: this.props.store,
199
199
  ev: ev,
200
- onSelect: e => this.choosePostbackBtn(e)
200
+ onSelect: e => this.choosePostbackBtn(e),
201
+ t: this.props.t
201
202
  }), (0, _preact.h)(_ProductAttachments.default, {
202
203
  t: this.props.t,
203
204
  onPostback: e => this.choosePostbackBtn(e),
@@ -50,12 +50,14 @@ class GenericTemplateAttachments extends _common.Com {
50
50
 
51
51
  var $generics = _index.default.map(generics, (gen, index) => {
52
52
  var $eles = _index.default.map(gen.elements, ele => {
53
- let $title = ele.title ? (0, _preact.h)("div", {
53
+ let title = this.props.t.i18n(ele.i18n_title) || ele.title;
54
+ let subtitle = this.props.t.i18n(ele.i18n_subtitle) || ele.subtitle;
55
+ let $title = title ? (0, _preact.h)("div", {
54
56
  class: "generic-attachment--element-title"
55
- }, ele.title) : null;
56
- let $subtitle = ele.subtitle ? (0, _preact.h)("div", {
57
+ }, title) : null;
58
+ let $subtitle = subtitle ? (0, _preact.h)("div", {
57
59
  class: "generic-attachment--element-subtitle"
58
- }, ele.subtitle) : null;
60
+ }, subtitle) : null;
59
61
  return (0, _preact.h)("div", {
60
62
  class: "generic-attachment--element swiper-slide"
61
63
  }, (0, _preact.h)("div", null, (0, _preact.h)("img", {
@@ -64,7 +66,8 @@ class GenericTemplateAttachments extends _common.Com {
64
66
  src: this.props.store.replaceFileUrl(ele.image_url)
65
67
  })), $title, $subtitle, (0, _preact.h)(_Buttons.default, {
66
68
  buttons: ele.buttons,
67
- onSelect: button => this.props.onSelect(button)
69
+ onSelect: button => this.props.onSelect(button),
70
+ t: this.props.t
68
71
  }));
69
72
  });
70
73
 
@@ -40,7 +40,7 @@ class ProductAttachments extends _common.Com {
40
40
  src: require('../../assets/img/external-link.svg'),
41
41
  class: "product_attachment__btn_external_link"
42
42
  })));
43
- console.log("P", product);
43
+ console.log('P', product);
44
44
 
45
45
  if (_index.default.size(product.buttons) > 0) {
46
46
  $detailbtns = $detailbtns.concat(_index.default.map(product.buttons, (button, index) => {
@@ -50,7 +50,7 @@ class ProductAttachments extends _common.Com {
50
50
  href: 'tel:' + button.phone_number,
51
51
  key: index,
52
52
  title: button.title
53
- }, button.title);
53
+ }, this.props.t.i18n(button.i18n_title) || button.title);
54
54
  }
55
55
 
56
56
  if (button.type === 'url_button') {
@@ -60,7 +60,7 @@ class ProductAttachments extends _common.Com {
60
60
  target: "_blank",
61
61
  key: index,
62
62
  title: button.title
63
- }, button.title || this.props.t('detail'), ' ', (0, _preact.h)("img", {
63
+ }, this.props.t.i18n(button.i18n_title) || button.title || this.props.t('detail'), ' ', (0, _preact.h)("img", {
64
64
  src: require('../../assets/img/external-link.svg'),
65
65
  class: "product_attachment__btn_external_link"
66
66
  }));
@@ -71,7 +71,7 @@ class ProductAttachments extends _common.Com {
71
71
  class: "product_attachment__btn",
72
72
  href: "javascript:;",
73
73
  onClick: _ => this.props.onPostback(button)
74
- }, button.title);
74
+ }, this.props.t.i18n(button.i18n_title) || button.title);
75
75
  }
76
76
  }));
77
77
  }
@@ -0,0 +1 @@
1
+ module.exports = __webpack_public_path__ + "assets/img/emoji/messenger/sub_58.824_78.431.f910f2a.png";
@@ -0,0 +1 @@
1
+ module.exports = __webpack_public_path__ + "assets/img/emoji/messenger/sub_60.784_29.412.e36d284.png";
package/dist/132.js CHANGED
@@ -161,9 +161,8 @@ class ChatButton extends common/* Com */.up {
161
161
  let accountSetting = this.props.plugin.chatbox;
162
162
  if (new util/* default.Date */.Z.Date().getTime() - this.props.store.matchClosePreviewAt() < Ms30Mins) return;
163
163
  let greeting = util/* default.get */.Z.get(accountSetting, 'greeting', {});
164
- let text = this.props.t.i18n(util/* default.get */.Z.get(greeting, 'greeting', {})) || greeting.message;
165
164
 
166
- if (!text || !greeting.enabled) {
165
+ if (!greeting.message || !greeting.enabled) {
167
166
  this.setState({
168
167
  previewEvent: {}
169
168
  });
@@ -2032,53 +2031,17 @@ class ProductAttachments extends common/* Com */.up {
2032
2031
  let acc = this.props.store.matchAccount();
2033
2032
  let $products = util/* default.map */.Z.map(products, (att, index) => {
2034
2033
  let product = att.product;
2035
- let $detailbtns = [];
2034
+ let $detailbtn = null;
2036
2035
  let url = product.url || product.mobile_url;
2037
2036
  if (this.props.store.isMobile()) url = product.mobile_url || product.url;
2038
- if (url && util/* default.size */.Z.size(product.buttons) == 0) $detailbtns.push((0,preact_module.h)("a", {
2037
+ if (url) $detailbtn = (0,preact_module.h)("a", {
2039
2038
  class: "product_attachment__btn",
2040
2039
  href: url,
2041
2040
  target: "_blank"
2042
2041
  }, this.props.t('detail'), (0,preact_module.h)("img", {
2043
2042
  src: __webpack_require__(8453),
2044
2043
  class: "product_attachment__btn_external_link"
2045
- })));
2046
- console.log("P", product);
2047
-
2048
- if (util/* default.size */.Z.size(product.buttons) > 0) {
2049
- $detailbtns = $detailbtns.concat(util/* default.map */.Z.map(product.buttons, (button, index) => {
2050
- if (button.type === 'call_button') {
2051
- return (0,preact_module.h)("a", {
2052
- class: "product_attachment__btn",
2053
- href: 'tel:' + button.phone_number,
2054
- key: index,
2055
- title: button.title
2056
- }, button.title);
2057
- }
2058
-
2059
- if (button.type === 'url_button') {
2060
- return (0,preact_module.h)("a", {
2061
- class: "product_attachment__btn",
2062
- href: button.url,
2063
- target: "_blank",
2064
- key: index,
2065
- title: button.title
2066
- }, button.title || this.props.t('detail'), ' ', (0,preact_module.h)("img", {
2067
- src: __webpack_require__(8453),
2068
- class: "product_attachment__btn_external_link"
2069
- }));
2070
- }
2071
-
2072
- if (button.type === 'postback_button') {
2073
- return (0,preact_module.h)("a", {
2074
- class: "product_attachment__btn",
2075
- href: "javascript:;",
2076
- onClick: _ => this.props.onPostback(button)
2077
- }, button.title);
2078
- }
2079
- }));
2080
- }
2081
-
2044
+ }));
2082
2045
  let $title = (0,preact_module.h)("a", {
2083
2046
  href: url,
2084
2047
  class: "product_attachment__title",
@@ -2107,7 +2070,7 @@ class ProductAttachments extends common/* Com */.up {
2107
2070
  src: this.props.store.replaceFileUrl(product.image)
2108
2071
  }))), $title, $subtitle, $price, (0,preact_module.h)("div", {
2109
2072
  class: "product_attachment__btns"
2110
- }, $detailbtns));
2073
+ }, $detailbtn));
2111
2074
  });
2112
2075
  return $products;
2113
2076
  }
@@ -2733,7 +2696,6 @@ class Event extends common/* Com */.up {
2733
2696
  onSelect: e => this.choosePostbackBtn(e)
2734
2697
  }), (0,preact_module.h)(ProductAttachments, {
2735
2698
  t: this.props.t,
2736
- onPostback: e => this.choosePostbackBtn(e),
2737
2699
  store: this.props.store,
2738
2700
  ev: ev
2739
2701
  }), (0,preact_module.h)(OrderAttachments_ProductAttachments, {
@@ -3187,8 +3149,6 @@ class Typing extends common/* Com */.up {
3187
3149
  return;
3188
3150
  }
3189
3151
 
3190
- let ag = this.props.store.matchAgent(ev.by.id);
3191
- if (ag.type == 'agent') return;
3192
3152
  if (util/* default.get */.Z.get(ev, 'type') !== 'conversation_typing') return;
3193
3153
  this.setState({
3194
3154
  ev: ev,
@@ -3201,7 +3161,7 @@ class Typing extends common/* Com */.up {
3201
3161
  this.setState({
3202
3162
  isShow: false
3203
3163
  });
3204
- }, 5000);
3164
+ }, 10000);
3205
3165
  });
3206
3166
  }
3207
3167
 
@@ -4101,7 +4061,6 @@ class order_Order extends common/* Com */.up {
4101
4061
  loading: true,
4102
4062
  order: {},
4103
4063
  err: {},
4104
- shipping_address: 'new',
4105
4064
  selectedProvince: null,
4106
4065
  selectedDistrict: null,
4107
4066
  selectedWard: null,
@@ -4394,17 +4353,16 @@ class order_Order extends common/* Com */.up {
4394
4353
 
4395
4354
  order_defineProperty(this, "onCancel", () => {
4396
4355
  if (this.props.onResponse) this.props.onResponse('rejected');
4356
+ this.close();
4357
+ });
4397
4358
 
4359
+ order_defineProperty(this, "close", () => {
4398
4360
  if (this.props.cid && !this.state.order.user_confirmation) {
4399
4361
  let order = util/* default.cloneDeep */.Z.cloneDeep(this.state.order);
4400
4362
  order.user_confirmation = 'rejected';
4401
4363
  this.props.store.updateOrder(order);
4402
4364
  }
4403
4365
 
4404
- this.close();
4405
- });
4406
-
4407
- order_defineProperty(this, "close", () => {
4408
4366
  if (this.props.onClose) this.props.onClose();
4409
4367
  });
4410
4368
 
@@ -4474,7 +4432,7 @@ class order_Order extends common/* Com */.up {
4474
4432
  return null;
4475
4433
  let editmode = false;
4476
4434
 
4477
- if (!order.status || order.status == 'open') {
4435
+ if (!order.status || order.status == 'new') {
4478
4436
  editmode = !order.user_confirmation;
4479
4437
  }
4480
4438
 
@@ -4565,7 +4523,7 @@ class order_Order extends common/* Com */.up {
4565
4523
  renderDesktopShipping(order) {
4566
4524
  let editmode = false;
4567
4525
 
4568
- if (!order.status || order.status == 'open') {
4526
+ if (!order.status || order.status == 'new') {
4569
4527
  editmode = !order.user_confirmation;
4570
4528
  }
4571
4529
 
@@ -4866,7 +4824,7 @@ class order_Order extends common/* Com */.up {
4866
4824
  }, (0,preact_module.h)("div", null, "Ph\xED v\u1EADn chuy\u1EC3n"), (0,preact_module.h)("div", null, util/* default.get */.Z.get(order, 'shipping.fee', 0), " d"));
4867
4825
  let editmode = false;
4868
4826
 
4869
- if (!order.status || order.status == 'open') {
4827
+ if (!order.status || order.status == 'new') {
4870
4828
  editmode = !order.user_confirmation;
4871
4829
  }
4872
4830
 
@@ -4902,7 +4860,7 @@ class order_Order extends common/* Com */.up {
4902
4860
  }
4903
4861
 
4904
4862
  renderStatusBadge(order) {
4905
- let status = order.status || 'open';
4863
+ let status = order.status || 'new';
4906
4864
  return (0,preact_module.h)("div", {
4907
4865
  style: "float: right !important;",
4908
4866
  class: 'order_status order_status__' + status
@@ -4910,7 +4868,7 @@ class order_Order extends common/* Com */.up {
4910
4868
  }
4911
4869
 
4912
4870
  renderShippingInfo(order) {
4913
- if (order.status != 'open' || order.user_confirmation) {}
4871
+ if (order.status != 'new' || order.user_confirmation) {}
4914
4872
 
4915
4873
  let shipping_provider = util/* default.get */.Z.get(order, 'shipping.shipping_provider');
4916
4874
  if (!shipping_provider) return null;
@@ -5010,7 +4968,7 @@ class order_Order extends common/* Com */.up {
5010
4968
  let $products = null;
5011
4969
  let editmode = false;
5012
4970
 
5013
- if (!order.status || order.status == 'open') {
4971
+ if (!order.status || order.status == 'new') {
5014
4972
  editmode = !order.user_confirmation;
5015
4973
  }
5016
4974
 
@@ -5114,7 +5072,7 @@ class order_Order extends common/* Com */.up {
5114
5072
  onClick: this.onCancel
5115
5073
  }, this.props.t('cancel_order'));
5116
5074
 
5117
- if (order.user_confirmation || order.status != 'open') {
5075
+ if (order.user_confirmation || order.status != 'new') {
5118
5076
  $status = null;
5119
5077
  if (this.props.cid) $close = (0,preact_module.h)("div", {
5120
5078
  class: "order_btn order__btn__light mt-3",
@@ -5146,7 +5104,7 @@ class order_Order extends common/* Com */.up {
5146
5104
  let $actions = null;
5147
5105
  let editmode = false;
5148
5106
 
5149
- if (!order.status || order.status == 'open') {
5107
+ if (!order.status || order.status == 'new') {
5150
5108
  editmode = !order.user_confirmation;
5151
5109
  }
5152
5110
 
@@ -6605,13 +6563,11 @@ class Main extends common/* Com */.up {
6605
6563
  }
6606
6564
 
6607
6565
  function restoreViewport() {
6608
- if (document.body && document.body.classList) document.body.classList.remove('sbz_no_scroll');
6609
6566
  let metatag = document.getElementById('subiz-meta-viewport');
6610
6567
  if (metatag) metatag.remove();
6611
6568
  }
6612
6569
 
6613
6570
  function modifyViewport() {
6614
- if (document.body && document.body.classList) document.body.classList.add('sbz_no_scroll');
6615
6571
  let metatag = document.createElement('meta');
6616
6572
  metatag.httpEquiv = 'X-UA-Compatible';
6617
6573
  metatag.name = 'viewport';