pb-sxp-ui 1.0.3-alpha.4 → 1.0.4

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 (78) hide show
  1. package/dist/index.cjs +117 -60
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +5 -5
  4. package/dist/index.js +117 -60
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +117 -60
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/Popup/index.js +5 -3
  15. package/es/core/components/SxpPageRender/RenderCard.js +6 -3
  16. package/es/core/components/SxpPageRender/index.js +6 -5
  17. package/es/core/context/EditorContext.js +3 -1
  18. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +2 -2
  19. package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +1 -1
  20. package/es/materials/sxp/template/Appoint/index.d.ts +1 -0
  21. package/es/materials/sxp/template/Appoint/index.js +3 -3
  22. package/es/materials/sxp/template/Appoint/material.js +2 -1
  23. package/es/materials/sxp/template/Commodity/index.d.ts +1 -0
  24. package/es/materials/sxp/template/Commodity/index.js +2 -2
  25. package/es/materials/sxp/template/Commodity/material.js +2 -1
  26. package/es/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
  27. package/es/materials/sxp/template/CommodityDiro/index.js +2 -2
  28. package/es/materials/sxp/template/CommodityDiro/material.js +2 -1
  29. package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
  30. package/es/materials/sxp/template/CommodityDiroNew/index.js +2 -2
  31. package/es/materials/sxp/template/CommodityDiroNew/material.js +4 -3
  32. package/es/materials/sxp/template/Link/material.js +2 -1
  33. package/es/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
  34. package/es/materials/sxp/template/MultiCommodity/index.js +15 -4
  35. package/es/materials/sxp/template/MultiCommodity/material.js +2 -1
  36. package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
  37. package/es/materials/sxp/template/MultiCommodityDiro/index.js +15 -4
  38. package/es/materials/sxp/template/MultiCommodityDiro/material.js +2 -1
  39. package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
  40. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +15 -4
  41. package/es/materials/sxp/template/MultiCommodityDiroNew/material.js +2 -1
  42. package/es/materials/sxp/template/components/EventProvider.d.ts +1 -0
  43. package/es/materials/sxp/template/components/EventProvider.js +15 -3
  44. package/es/materials/sxp/template/components/Scroll.d.ts +1 -0
  45. package/es/materials/sxp/template/components/Scroll.js +2 -2
  46. package/lib/core/components/SxpPageRender/Popup/index.js +5 -3
  47. package/lib/core/components/SxpPageRender/RenderCard.js +6 -3
  48. package/lib/core/components/SxpPageRender/index.js +6 -5
  49. package/lib/core/context/EditorContext.js +3 -1
  50. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +2 -2
  51. package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +1 -1
  52. package/lib/materials/sxp/template/Appoint/index.d.ts +1 -0
  53. package/lib/materials/sxp/template/Appoint/index.js +3 -3
  54. package/lib/materials/sxp/template/Appoint/material.js +2 -1
  55. package/lib/materials/sxp/template/Commodity/index.d.ts +1 -0
  56. package/lib/materials/sxp/template/Commodity/index.js +2 -2
  57. package/lib/materials/sxp/template/Commodity/material.js +2 -1
  58. package/lib/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
  59. package/lib/materials/sxp/template/CommodityDiro/index.js +2 -2
  60. package/lib/materials/sxp/template/CommodityDiro/material.js +2 -1
  61. package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
  62. package/lib/materials/sxp/template/CommodityDiroNew/index.js +2 -2
  63. package/lib/materials/sxp/template/CommodityDiroNew/material.js +4 -3
  64. package/lib/materials/sxp/template/Link/material.js +2 -1
  65. package/lib/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
  66. package/lib/materials/sxp/template/MultiCommodity/index.js +15 -4
  67. package/lib/materials/sxp/template/MultiCommodity/material.js +2 -1
  68. package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
  69. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +15 -4
  70. package/lib/materials/sxp/template/MultiCommodityDiro/material.js +2 -1
  71. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
  72. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +15 -4
  73. package/lib/materials/sxp/template/MultiCommodityDiroNew/material.js +2 -1
  74. package/lib/materials/sxp/template/components/EventProvider.d.ts +1 -0
  75. package/lib/materials/sxp/template/components/EventProvider.js +15 -3
  76. package/lib/materials/sxp/template/components/Scroll.d.ts +1 -0
  77. package/lib/materials/sxp/template/components/Scroll.js +2 -2
  78. package/package.json +1 -1
@@ -8,7 +8,7 @@ const hooks_1 = require("../../../core/hooks");
8
8
  const RenderCard = ({ rec, index, tempMap, resolver }) => {
9
9
  const { schema } = (0, hooks_1.useEditor)();
10
10
  const renderComp = (0, react_1.useMemo)(() => {
11
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
11
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
12
12
  if (!(rec === null || rec === void 0 ? void 0 : rec.video))
13
13
  return null;
14
14
  let cta = null;
@@ -31,8 +31,11 @@ const RenderCard = ({ rec, index, tempMap, resolver }) => {
31
31
  return null;
32
32
  }
33
33
  if (value && resolver) {
34
- const Component = (0, withBindDataSource_1.default)(resolver[(_w = value === null || value === void 0 ? void 0 : value.item) === null || _w === void 0 ? void 0 : _w.type]);
35
- return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign({}, (_x = value === null || value === void 0 ? void 0 : value.item) === null || _x === void 0 ? void 0 : _x.style), { zIndex: 50, marginLeft: '20px' }), textStyle: (_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.textStyle, bindDatas: (_0 = (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.bindDatas) !== null && _0 !== void 0 ? _0 : [] }, (_1 = value === null || value === void 0 ? void 0 : value.item) === null || _1 === void 0 ? void 0 : _1.props, { event: ((_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec })));
34
+ const t = resolver[(_w = value === null || value === void 0 ? void 0 : value.item) === null || _w === void 0 ? void 0 : _w.type];
35
+ const Component = (0, withBindDataSource_1.default)(t);
36
+ const defaulSetting = (_x = t === null || t === void 0 ? void 0 : t.extend) === null || _x === void 0 ? void 0 : _x.defaulSetting;
37
+ const isExternalLink = ((_0 = (_z = (_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.event) === null || _z === void 0 ? void 0 : _z.onClick) === null || _0 === void 0 ? void 0 : _0.linkType) === 'externalLink';
38
+ return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_1 = value === null || value === void 0 ? void 0 : value.item) === null || _1 === void 0 ? void 0 : _1.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.textStyle), bindDatas: (_4 = (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.bindDatas) !== null && _4 !== void 0 ? _4 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.props, { event: ((_6 = value === null || value === void 0 ? void 0 : value.item) === null || _6 === void 0 ? void 0 : _6.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink })));
36
39
  }
37
40
  else {
38
41
  return null;
@@ -161,9 +161,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
161
161
  }
162
162
  if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
163
163
  return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, index) => {
164
- var _a, _b, _c, _d, _e, _f;
165
- const Component = (0, withBindDataSource_1.default)(resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type]);
166
- return (react_1.default.createElement(Component, Object.assign({ key: index, textStyle: (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.textStyle, bindDatas: (_d = (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.bindDatas) !== null && _d !== void 0 ? _d : [] }, (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.props, { event: ((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: { height: '100%', overflow: 'auto' } })));
164
+ var _a, _b, _c, _d, _e, _f, _g, _h;
165
+ const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
166
+ const Component = (0, withBindDataSource_1.default)(t);
167
+ const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
168
+ return (react_1.default.createElement(Component, Object.assign({ key: index, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }) })));
167
169
  });
168
170
  }
169
171
  return null;
@@ -177,8 +179,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
177
179
  react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
178
180
  react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
179
181
  react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
180
- react_1.default.createElement("div", { className: 'clc-sxp-bottom-text' },
181
- react_1.default.createElement(ExpandableText_1.default, { isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: descStyle })),
182
+ react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: descStyle }),
182
183
  react_1.default.createElement(Hashtag_1.default, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.url) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
183
184
  }
184
185
  return null;
@@ -78,7 +78,6 @@ const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema,
78
78
  });
79
79
  typeof window !== 'undefined' &&
80
80
  (window.sxpPopup = (type, aniType) => {
81
- setPopup(type);
82
81
  if (aniType && (aniType === null || aniType === void 0 ? void 0 : aniType.name) !== 'none') {
83
82
  setPopupAni(Object.assign(Object.assign({}, popupAni), aniType));
84
83
  }
@@ -88,6 +87,9 @@ const EditorCore = (0, react_1.forwardRef)(({ children, resolver, isSsr, schema,
88
87
  duration: 0
89
88
  });
90
89
  }
90
+ setTimeout(() => {
91
+ setPopup(type);
92
+ });
91
93
  });
92
94
  typeof window !== 'undefined' &&
93
95
  (window.getJointUtmLink = (url) => {
@@ -122,8 +122,8 @@ Made in Italy` })));
122
122
  }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
123
123
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content' },
124
124
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
125
- react_1.default.createElement("div", null,
126
- react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'Large Dior Toujours Bag'),
125
+ react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
126
+ react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'Large Dior Toujours Bag'),
127
127
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection }, (product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage Calfskin')),
128
128
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
129
129
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price }, priceText),
@@ -23,7 +23,7 @@ const CommodityDetailDiroNew = (0, create_1.createMaterial)(_1.default, {
23
23
  price: {
24
24
  color: '#000',
25
25
  fontWeight: 'bold',
26
- fontSize: 18
26
+ fontSize: 13
27
27
  },
28
28
  title: {
29
29
  color: '#000',
@@ -8,6 +8,7 @@ export interface IAppointProps {
8
8
  recData?: RecItemType;
9
9
  bottom_image?: string;
10
10
  ctaTempStyles?: ICtaTempStylesType;
11
+ isExternalLink?: boolean;
11
12
  }
12
13
  declare const _default: React.NamedExoticComponent<IAppointProps>;
13
14
  export default _default;
@@ -7,12 +7,12 @@ const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProv
7
7
  const hooks_1 = require("../../../../core/hooks");
8
8
  const Appoint = (_a) => {
9
9
  var _b, _c, _d, _e;
10
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
10
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
11
11
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
12
12
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
13
- return (react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
13
+ return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
14
14
  react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
15
- react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%' }), src: (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, alt: '' })),
15
+ react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, alt: '' })),
16
16
  react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_e = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _e !== void 0 ? _e : 'Product Name')));
17
17
  };
18
18
  exports.default = (0, react_1.memo)(Appoint);
@@ -39,7 +39,8 @@ const Appoint = (0, create_1.createMaterial)(_1.default, {
39
39
  width: 236,
40
40
  height: 44,
41
41
  borderRadius: 3,
42
- backgroundColor: 'rgba(0,0,0,.3)'
42
+ backgroundColor: 'rgba(0,0,0,.3)',
43
+ marginBottom: 8
43
44
  }
44
45
  },
45
46
  w: 100,
@@ -8,6 +8,7 @@ export interface ICommodityProps {
8
8
  recData?: RecItemType;
9
9
  bottom_image?: string;
10
10
  ctaTempStyles?: ICtaTempStylesType;
11
+ isExternalLink?: boolean;
11
12
  }
12
13
  declare const _default: React.NamedExoticComponent<ICommodityProps>;
13
14
  export default _default;
@@ -8,11 +8,11 @@ const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less
8
8
  const hooks_1 = require("../../../../core/hooks");
9
9
  const Commodity = (_a) => {
10
10
  var _b, _c, _d, _e, _f, _g, _h;
11
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
11
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
12
12
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
13
13
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
14
14
  const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
15
- return (react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
15
+ return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
16
16
  react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
17
17
  react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
18
18
  react_1.default.createElement("div", { className: (0, css_1.css)({
@@ -45,7 +45,8 @@ const Commodity = (0, create_1.createMaterial)(_1.default, {
45
45
  width: 236,
46
46
  height: 74,
47
47
  borderRadius: 3,
48
- backgroundColor: 'rgba(0,0,0,.3)'
48
+ backgroundColor: 'rgba(0,0,0,.3)',
49
+ marginBottom: 8
49
50
  }
50
51
  },
51
52
  w: 100,
@@ -8,6 +8,7 @@ export interface ICommodityDiroProps {
8
8
  recData?: RecItemType;
9
9
  bottom_image?: string;
10
10
  ctaTempStyles?: ICtaTempStylesType;
11
+ isExternalLink?: boolean;
11
12
  }
12
13
  declare const _default: React.NamedExoticComponent<ICommodityDiroProps>;
13
14
  export default _default;
@@ -8,11 +8,11 @@ const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less
8
8
  const hooks_1 = require("../../../../core/hooks");
9
9
  const CommodityDiro = (_a) => {
10
10
  var _b, _c, _d, _e, _f, _g, _h;
11
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
11
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
12
12
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
13
13
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
14
14
  const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
15
- return (react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
15
+ return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
16
16
  react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
17
17
  react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
18
18
  react_1.default.createElement("div", { className: (0, css_1.css)({
@@ -45,7 +45,8 @@ const CommodityDiro = (0, create_1.createMaterial)(_1.default, {
45
45
  width: 236,
46
46
  height: 74,
47
47
  borderRadius: 3,
48
- backgroundColor: '#fff'
48
+ backgroundColor: '#fff',
49
+ marginBottom: 8
49
50
  }
50
51
  },
51
52
  w: 100,
@@ -8,6 +8,7 @@ export interface ICommodityDiroNewProps {
8
8
  recData?: RecItemType;
9
9
  bottom_image?: string;
10
10
  ctaTempStyles?: ICtaTempStylesType;
11
+ isExternalLink?: boolean;
11
12
  }
12
13
  declare const _default: React.NamedExoticComponent<ICommodityDiroNewProps>;
13
14
  export default _default;
@@ -8,11 +8,11 @@ const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less
8
8
  const hooks_1 = require("../../../../core/hooks");
9
9
  const CommodityDiroNew = (_a) => {
10
10
  var _b, _c, _d, _e, _f, _g, _h;
11
- var { content, style, bgImg, recData, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles"]);
11
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
12
12
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
13
13
  const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
14
14
  const src = (_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.homePage) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
15
- return (react_1.default.createElement(EventProvider_1.default, Object.assign({ rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
15
+ return (react_1.default.createElement(EventProvider_1.default, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: (0, css_1.css)(Object.assign({}, style)), style: { display: 'flex' } }, props),
16
16
  react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
17
17
  react_1.default.createElement("img", { className: (0, css_1.css)({ width: '100%', objectFit: 'cover', height: '100%' }), src: src, hidden: !src, alt: '' })),
18
18
  react_1.default.createElement("div", { className: (0, css_1.css)({
@@ -26,13 +26,13 @@ const CommodityDiroNew = (0, create_1.createMaterial)(_1.default, {
26
26
  marginRight: 16
27
27
  },
28
28
  title: {
29
- fontSize: 12,
29
+ fontSize: 13,
30
30
  color: '#000',
31
31
  textAlign: 'left'
32
32
  },
33
33
  ctaTitle: {
34
34
  textDecoration: 'underline',
35
- fontSize: 12,
35
+ fontSize: 14,
36
36
  fontWeight: 'bold',
37
37
  color: '#000',
38
38
  textAlign: 'left',
@@ -46,7 +46,8 @@ const CommodityDiroNew = (0, create_1.createMaterial)(_1.default, {
46
46
  width: 260,
47
47
  height: 86,
48
48
  padding: 4,
49
- backgroundColor: 'rgba(255,255,255,0.75)'
49
+ backgroundColor: 'rgba(255,255,255,0.75)',
50
+ marginBottom: 8
50
51
  }
51
52
  },
52
53
  w: 100,
@@ -37,7 +37,8 @@ const Link = (0, create_1.createMaterial)(_1.default, {
37
37
  width: 236,
38
38
  height: 74,
39
39
  borderRadius: 3,
40
- backgroundColor: 'rgba(0,0,0,.3)'
40
+ backgroundColor: 'rgba(0,0,0,.3)',
41
+ marginBottom: 8
41
42
  }
42
43
  },
43
44
  w: 100,
@@ -9,6 +9,7 @@ export interface IMultiCommodityProps {
9
9
  onClick?: () => void;
10
10
  bottom_image?: string;
11
11
  ctaTempStyles?: ICtaTempStylesType;
12
+ isExternalLink?: boolean;
12
13
  }
13
14
  declare const _default: React.NamedExoticComponent<IMultiCommodityProps>;
14
15
  export default _default;
@@ -9,24 +9,35 @@ const Img_1 = tslib_1.__importDefault(require("../components/Img"));
9
9
  const Scroll_1 = tslib_1.__importDefault(require("../components/Scroll"));
10
10
  const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
11
11
  const hooks_1 = require("../../../../core/hooks");
12
+ const useEventReport_1 = require("../../../../core/hooks/useEventReport");
12
13
  const MultiCommodity = (_a) => {
13
14
  var _b, _c;
14
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
15
+ var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
15
16
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
16
17
  const { ctaEvent, setPopupDetailData } = (0, hooks_1.useSxpDataSource)();
17
18
  const { popupAni } = (0, hooks_1.useEditor)();
18
19
  const [products, setProducts] = (0, react_1.useState)((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
20
+ const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
19
21
  const handleClick = (0, lodash_1.throttle)((item) => {
22
+ var _a;
20
23
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
21
24
  eventSubject: 'clickCta',
22
25
  eventDescription: 'User clicked the CTA'
23
26
  }, recData, item);
24
27
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
25
- onClick === null || onClick === void 0 ? void 0 : onClick();
28
+ if (isExternalLink) {
29
+ if ((_a = item === null || item === void 0 ? void 0 : item.bindCta) === null || _a === void 0 ? void 0 : _a.link) {
30
+ jumpToWeb(recData, item, item.bindCta);
31
+ window.location.href = item.bindCta.link;
32
+ }
33
+ }
34
+ else {
35
+ onClick === null || onClick === void 0 ? void 0 : onClick();
36
+ }
26
37
  }, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
27
- return (react_1.default.createElement(Scroll_1.default, null, products === null || products === void 0 ? void 0 : products.map((item) => {
38
+ return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
28
39
  var _a, _b, _c, _d, _e, _f;
29
- return (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: (0, css_1.css)(Object.assign({ flexShrink: 0 }, style)), style: { display: 'flex' } }, props, { onClick: () => handleClick(item) }),
40
+ return (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
30
41
  react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
31
42
  react_1.default.createElement(Img_1.default, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
32
43
  react_1.default.createElement("div", { className: (0, css_1.css)({
@@ -45,7 +45,8 @@ const MultiCommodity = (0, create_1.createMaterial)(_1.default, {
45
45
  width: 236,
46
46
  height: 74,
47
47
  borderRadius: 3,
48
- backgroundColor: 'rgba(0,0,0,.3)'
48
+ backgroundColor: 'rgba(0,0,0,.3)',
49
+ marginBottom: 8
49
50
  }
50
51
  },
51
52
  w: 100,
@@ -9,6 +9,7 @@ export interface IMultiCommodityDiroProps {
9
9
  onClick?: () => void;
10
10
  bottom_image?: string;
11
11
  ctaTempStyles?: ICtaTempStylesType;
12
+ isExternalLink?: boolean;
12
13
  }
13
14
  declare const _default: React.NamedExoticComponent<IMultiCommodityDiroProps>;
14
15
  export default _default;
@@ -9,23 +9,34 @@ const Scroll_1 = tslib_1.__importDefault(require("../components/Scroll"));
9
9
  const Img_1 = tslib_1.__importDefault(require("../components/Img"));
10
10
  const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
11
11
  const hooks_1 = require("../../../../core/hooks");
12
+ const useEventReport_1 = require("../../../../core/hooks/useEventReport");
12
13
  const MultiCommodityDiro = (_a) => {
13
14
  var _b, _c;
14
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
15
+ var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
15
16
  const { ctaEvent, setPopupDetailData, sxpParameter } = (0, hooks_1.useSxpDataSource)();
16
17
  const { popupAni } = (0, hooks_1.useEditor)();
18
+ const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
17
19
  const [products, setProducts] = (0, react_1.useState)((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
18
20
  const handleClick = (0, lodash_1.throttle)((item) => {
21
+ var _a;
19
22
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
20
23
  eventSubject: 'clickCta',
21
24
  eventDescription: 'User clicked the CTA'
22
25
  }, recData, item);
23
26
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
24
- onClick === null || onClick === void 0 ? void 0 : onClick();
27
+ if (isExternalLink) {
28
+ if ((_a = item === null || item === void 0 ? void 0 : item.bindCta) === null || _a === void 0 ? void 0 : _a.link) {
29
+ jumpToWeb(recData, item, item.bindCta);
30
+ window.location.href = item.bindCta.link;
31
+ }
32
+ }
33
+ else {
34
+ onClick === null || onClick === void 0 ? void 0 : onClick();
35
+ }
25
36
  }, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
26
- return (react_1.default.createElement(Scroll_1.default, null, products === null || products === void 0 ? void 0 : products.map((item) => {
37
+ return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
27
38
  var _a, _b, _c, _d, _e, _f;
28
- return (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: (0, css_1.css)(Object.assign({ flexShrink: 0 }, style)), style: { display: 'flex' } }, props, { onClick: () => handleClick(item) }),
39
+ return (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
29
40
  react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
30
41
  react_1.default.createElement(Img_1.default, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
31
42
  react_1.default.createElement("div", { className: (0, css_1.css)({
@@ -45,7 +45,8 @@ const MultiCommodityDiro = (0, create_1.createMaterial)(_1.default, {
45
45
  width: 236,
46
46
  height: 74,
47
47
  borderRadius: 3,
48
- backgroundColor: '#fff'
48
+ backgroundColor: '#fff',
49
+ marginBottom: 8
49
50
  }
50
51
  },
51
52
  w: 100,
@@ -9,6 +9,7 @@ export interface IMultiCommodityDiroNewProps {
9
9
  onClick?: () => void;
10
10
  bottom_image?: string;
11
11
  ctaTempStyles?: ICtaTempStylesType;
12
+ isExternalLink?: boolean;
12
13
  }
13
14
  declare const _default: React.NamedExoticComponent<IMultiCommodityDiroNewProps>;
14
15
  export default _default;
@@ -9,23 +9,34 @@ const Scroll_1 = tslib_1.__importDefault(require("../components/Scroll"));
9
9
  const Img_1 = tslib_1.__importDefault(require("../components/Img"));
10
10
  const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
11
11
  const hooks_1 = require("../../../../core/hooks");
12
+ const useEventReport_1 = require("../../../../core/hooks/useEventReport");
12
13
  const MultiCommodityDiroNew = (_a) => {
13
14
  var _b, _c;
14
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles"]);
15
+ var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink"]);
15
16
  const { ctaEvent, setPopupDetailData, sxpParameter } = (0, hooks_1.useSxpDataSource)();
16
17
  const { popupAni } = (0, hooks_1.useEditor)();
18
+ const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
17
19
  const [products, setProducts] = (0, react_1.useState)((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
18
20
  const handleClick = (0, lodash_1.throttle)((item) => {
21
+ var _a;
19
22
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
20
23
  eventSubject: 'clickCta',
21
24
  eventDescription: 'User clicked the CTA'
22
25
  }, recData, item);
23
26
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }) }));
24
- onClick === null || onClick === void 0 ? void 0 : onClick();
27
+ if (isExternalLink) {
28
+ if ((_a = item === null || item === void 0 ? void 0 : item.bindCta) === null || _a === void 0 ? void 0 : _a.link) {
29
+ jumpToWeb(recData, item, item.bindCta);
30
+ window.location.href = item.bindCta.link;
31
+ }
32
+ }
33
+ else {
34
+ onClick === null || onClick === void 0 ? void 0 : onClick();
35
+ }
25
36
  }, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
26
- return (react_1.default.createElement(Scroll_1.default, null, products === null || products === void 0 ? void 0 : products.map((item) => {
37
+ return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
27
38
  var _a, _b, _c, _d, _e, _f;
28
- return (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: (0, css_1.css)(Object.assign({ flexShrink: 0 }, style)), style: { display: 'flex' } }, props, { onClick: () => handleClick(item) }),
39
+ return (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
29
40
  react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
30
41
  react_1.default.createElement(Img_1.default, { src: (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.homePage) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _c !== void 0 ? _c : bottom_image, rec: recData, item: item })),
31
42
  react_1.default.createElement("div", { className: (0, css_1.css)({
@@ -46,7 +46,8 @@ const MultiCommodityDiroNew = (0, create_1.createMaterial)(_1.default, {
46
46
  width: 260,
47
47
  height: 86,
48
48
  padding: 4,
49
- backgroundColor: 'rgba(255,255,255,0.75)'
49
+ backgroundColor: 'rgba(255,255,255,0.75)',
50
+ marginBottom: 8
50
51
  }
51
52
  },
52
53
  w: 100,
@@ -6,6 +6,7 @@ export interface IImgProps {
6
6
  className?: any;
7
7
  onClick?: any;
8
8
  style?: CSSProperties;
9
+ isExternalLink?: boolean;
9
10
  }
10
11
  declare const _default: React.NamedExoticComponent<IImgProps>;
11
12
  export default _default;
@@ -5,12 +5,14 @@ const react_1 = tslib_1.__importStar(require("react"));
5
5
  const lodash_1 = require("lodash");
6
6
  const useOnScreen_1 = tslib_1.__importDefault(require("../../../../core/hooks/useOnScreen"));
7
7
  const hooks_1 = require("../../../../core/hooks");
8
+ const useEventReport_1 = require("../../../../core/hooks/useEventReport");
8
9
  const EventProvider = (_a) => {
9
- var { rec, children, className, onClick, style } = _a, props = tslib_1.__rest(_a, ["rec", "children", "className", "onClick", "style"]);
10
+ var { rec, children, className, onClick, style, isExternalLink = false } = _a, props = tslib_1.__rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink"]);
10
11
  const ref = (0, react_1.useRef)(null);
11
12
  const isOnScreen = (0, useOnScreen_1.default)(ref);
12
13
  const { popupAni } = (0, hooks_1.useEditor)();
13
14
  const { setPopupDetailData, ctaEvent } = (0, hooks_1.useSxpDataSource)();
15
+ const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
14
16
  (0, react_1.useEffect)(() => {
15
17
  var _a, _b;
16
18
  if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
@@ -22,14 +24,24 @@ const EventProvider = (_a) => {
22
24
  }
23
25
  }, [isOnScreen, ref, rec, ctaEvent]);
24
26
  const handleClick = (0, lodash_1.throttle)(() => {
25
- var _a, _b;
27
+ var _a, _b, _c, _d, _e, _f, _g, _h;
26
28
  const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
27
29
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
28
30
  eventSubject: 'clickCta',
29
31
  eventDescription: 'User clicked the CTA'
30
32
  }, rec, item);
31
33
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(rec);
32
- onClick === null || onClick === void 0 ? void 0 : onClick();
34
+ if (isExternalLink) {
35
+ if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindCta) === null || _d === void 0 ? void 0 : _d.link) {
36
+ const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
37
+ const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
38
+ jumpToWeb(rec, product, cta);
39
+ window.location.href = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindCta) === null || _h === void 0 ? void 0 : _h.link;
40
+ }
41
+ }
42
+ else {
43
+ onClick === null || onClick === void 0 ? void 0 : onClick();
44
+ }
33
45
  }, popupAni === null || popupAni === void 0 ? void 0 : popupAni.duration);
34
46
  return (react_1.default.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
35
47
  };
@@ -4,6 +4,7 @@ import 'swiper/css/free-mode';
4
4
  import 'swiper/css/scrollbar';
5
5
  interface IScrollProps {
6
6
  children: any;
7
+ isPadding?: boolean;
7
8
  }
8
9
  declare const _default: React.NamedExoticComponent<IScrollProps>;
9
10
  export default _default;
@@ -7,7 +7,7 @@ require("swiper/css");
7
7
  require("swiper/css/free-mode");
8
8
  require("swiper/css/scrollbar");
9
9
  const modules_1 = require("swiper/modules");
10
- const Scroll = ({ children }) => {
11
- return (react_1.default.createElement(react_2.Swiper, { direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [modules_1.FreeMode, modules_1.Scrollbar, modules_1.Mousewheel], style: { paddingRight: '20px' } }, children));
10
+ const Scroll = ({ children, isPadding = true }) => {
11
+ return (react_1.default.createElement(react_2.Swiper, { direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [modules_1.FreeMode, modules_1.Scrollbar, modules_1.Mousewheel], style: { padding: isPadding ? '0 12px 0 20px' : 0 } }, children));
12
12
  };
13
13
  exports.default = (0, react_1.memo)(Scroll);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.0.3-alpha.4",
3
+ "version": "1.0.4",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",