pb-sxp-ui 1.9.0 → 1.9.1

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 (58) hide show
  1. package/dist/index.cjs +197 -192
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +67 -4
  4. package/dist/index.js +197 -192
  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 +197 -192
  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/ExpandableText.js +1 -1
  15. package/es/core/components/SxpPageRender/Hashtag/index.js +2 -2
  16. package/es/core/components/SxpPageRender/Modal/index.js +44 -6
  17. package/es/core/components/SxpPageRender/index.js +3 -3
  18. package/es/core/hooks/useFocusTrap.d.ts +2 -0
  19. package/es/core/hooks/useFocusTrap.js +37 -0
  20. package/es/index.d.ts +1 -0
  21. package/es/index.js +1 -0
  22. package/es/materials/sxp/popup/CommodityDetail/index.js +4 -2
  23. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
  24. package/es/materials/sxp/popup/CommodityList/index.js +32 -28
  25. package/es/materials/sxp/template/Appoint/index.js +1 -1
  26. package/es/materials/sxp/template/Commodity/index.js +4 -4
  27. package/es/materials/sxp/template/CommodityDiro/index.js +4 -4
  28. package/es/materials/sxp/template/CommodityDiroNew/index.js +4 -4
  29. package/es/materials/sxp/template/Link/index.js +1 -1
  30. package/es/materials/sxp/template/MultiCommodity/index.js +23 -42
  31. package/es/materials/sxp/template/MultiCommodityDiro/index.js +24 -42
  32. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +25 -44
  33. package/es/materials/sxp/template/components/EventProvider.d.ts +2 -0
  34. package/es/materials/sxp/template/components/EventProvider.js +22 -11
  35. package/es/materials/sxp/template/components/Scroll.js +1 -1
  36. package/lib/core/components/SxpPageRender/ExpandableText.js +1 -1
  37. package/lib/core/components/SxpPageRender/Hashtag/index.js +2 -2
  38. package/lib/core/components/SxpPageRender/Modal/index.js +44 -6
  39. package/lib/core/components/SxpPageRender/index.js +3 -3
  40. package/lib/core/hooks/useFocusTrap.d.ts +2 -0
  41. package/lib/core/hooks/useFocusTrap.js +39 -0
  42. package/lib/index.d.ts +1 -0
  43. package/lib/index.js +1 -0
  44. package/lib/materials/sxp/popup/CommodityDetail/index.js +4 -2
  45. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
  46. package/lib/materials/sxp/popup/CommodityList/index.js +32 -28
  47. package/lib/materials/sxp/template/Appoint/index.js +1 -1
  48. package/lib/materials/sxp/template/Commodity/index.js +4 -4
  49. package/lib/materials/sxp/template/CommodityDiro/index.js +4 -4
  50. package/lib/materials/sxp/template/CommodityDiroNew/index.js +4 -4
  51. package/lib/materials/sxp/template/Link/index.js +1 -1
  52. package/lib/materials/sxp/template/MultiCommodity/index.js +22 -41
  53. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +23 -41
  54. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +24 -43
  55. package/lib/materials/sxp/template/components/EventProvider.d.ts +2 -0
  56. package/lib/materials/sxp/template/components/EventProvider.js +21 -10
  57. package/lib/materials/sxp/template/components/Scroll.js +1 -1
  58. package/package.json +1 -1
@@ -50,7 +50,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
50
50
  wordBreak: 'break-word'
51
51
  }, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
52
52
  React.createElement("div", { ref: multiRowCopy, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
53
- text && isPost && isShow && (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
53
+ text && isPost && isShow && (React.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
54
54
  __html: setFontForText(isShowMore ? unfoldText || 'show less' : foldText || 'show more', style)
55
55
  } }))));
56
56
  };
@@ -40,7 +40,7 @@ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle, hashTagRigh
40
40
  marginTop: `${(_a = hashTagStyle === null || hashTagStyle === void 0 ? void 0 : hashTagStyle.marginTop) !== null && _a !== void 0 ? _a : 16}px`,
41
41
  width: hashTagRightMargin
42
42
  } },
43
- React.createElement(Scroll, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item), tag: 'button', "aria-label": item },
44
- React.createElement("div", { dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
43
+ React.createElement(Scroll, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item), tag: 'li', role: 'listitem' },
44
+ React.createElement("button", { className: 'clc-sxp-bottom-hashtag-item-button', "aria-label": item, "aria-describedby": item, dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
45
45
  };
46
46
  export default memo(Hashtag);
@@ -9,6 +9,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
9
9
  const fTouchRef = useRef(null);
10
10
  const touchMoveRef = useRef(null);
11
11
  const ref = useRef(null);
12
+ const modalRef = useRef(null);
12
13
  const MODAL_DEF_TRANS = fullHeight * 0.2;
13
14
  const MODAL_DEF_CON_H = isFullScreen ? fullHeight : fullHeight * 0.8;
14
15
  const [modalTrans, setModalTrans] = useState(MODAL_DEF_TRANS);
@@ -56,6 +57,43 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
56
57
  const child = useCallback(() => {
57
58
  return children;
58
59
  }, [_popup, openState, globalConfig]);
60
+ useEffect(() => {
61
+ const trapFocus = (element) => {
62
+ var focusableEls = element === null || element === void 0 ? void 0 : element.querySelectorAll('a, a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])');
63
+ var firstFocusableEl = focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls[0];
64
+ var lastFocusableEl = focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls[(focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls.length) - 1];
65
+ var KEYCODE_TAB = 9;
66
+ element.addEventListener('keydown', function (e) {
67
+ if (e.key === 'Escape' || e.key === 'Esc') {
68
+ handleClose();
69
+ e.preventDefault();
70
+ }
71
+ var isTabPressed = e.key === 'Tab' || e.keyCode === KEYCODE_TAB;
72
+ if (!isTabPressed) {
73
+ return;
74
+ }
75
+ if (e.shiftKey) {
76
+ if ((document === null || document === void 0 ? void 0 : document.activeElement) === firstFocusableEl) {
77
+ lastFocusableEl === null || lastFocusableEl === void 0 ? void 0 : lastFocusableEl.focus();
78
+ e.preventDefault();
79
+ }
80
+ }
81
+ else {
82
+ if ((document === null || document === void 0 ? void 0 : document.activeElement) === lastFocusableEl) {
83
+ firstFocusableEl === null || firstFocusableEl === void 0 ? void 0 : firstFocusableEl.focus();
84
+ e.preventDefault();
85
+ }
86
+ }
87
+ });
88
+ firstFocusableEl === null || firstFocusableEl === void 0 ? void 0 : firstFocusableEl.focus();
89
+ };
90
+ if (modalRef === null || modalRef === void 0 ? void 0 : modalRef.current)
91
+ trapFocus(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current);
92
+ return () => {
93
+ var _a;
94
+ (_a = modalRef === null || modalRef === void 0 ? void 0 : modalRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('keydown', trapFocus);
95
+ };
96
+ }, [modalRef, isShow, _popup]);
59
97
  if (!modalEleRef.current)
60
98
  return null;
61
99
  const handleClose = debounce(() => {
@@ -117,7 +155,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
117
155
  width: `calc(100% - ${((_r = (_q = (_p = (_o = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _o === void 0 ? void 0 : _o.props) === null || _p === void 0 ? void 0 : _p.popupBg) === null || _q === void 0 ? void 0 : _q.horizontalMargin) !== null && _r !== void 0 ? _r : 0) * 2}px)`,
118
156
  height: '100%'
119
157
  } },
120
- React.createElement("div", Object.assign({ className: `modal-container ${isOpen ? 'modal-popIn' : 'modal-popOut'}`, role: 'dialog', "aria-label": (_s = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _s === void 0 ? void 0 : _s.displayName, "aria-modal": true, style: Object.assign(Object.assign({ padding, animationDuration: ((_t = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _t !== void 0 ? _t : 0) / 1000 + 's' }, (isScrollFullScreen && {
158
+ React.createElement("div", Object.assign({ ref: modalRef, className: `modal-container ${isOpen ? 'modal-popIn' : 'modal-popOut'}`, role: 'dialog', "aria-label": (_s = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _s === void 0 ? void 0 : _s.displayName, "aria-modal": true, "aria-labelledby": 'modal-content', style: Object.assign(Object.assign({ padding, animationDuration: ((_t = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _t !== void 0 ? _t : 0) / 1000 + 's' }, (isScrollFullScreen && {
121
159
  transform: `translateY(${modalTrans}px)`
122
160
  })), { overflow: 'hidden', borderRadius: `${(_x = (_w = (_v = (_u = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _u === void 0 ? void 0 : _u.props) === null || _v === void 0 ? void 0 : _v.popupBg) === null || _w === void 0 ? void 0 : _w.borderRadius) !== null && _x !== void 0 ? _x : 0}px`, zIndex: 9 }), onClick: (e) => {
123
161
  e.stopPropagation();
@@ -127,17 +165,17 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
127
165
  onTouchStart: handleTouchStart,
128
166
  onTouchEnd: handleTouchEnd
129
167
  })),
130
- React.createElement("button", { className: 'modal-icon-wrapper', role: 'button', "aria-label": 'close button', onClick: onClose, style: { top: scrollTop } },
131
- React.createElement("img", { src: (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _y !== void 0 ? _y : closeIcon, alt: 'close button', className: 'modal-icon' })),
132
- React.createElement("div", Object.assign({ ref: ref, style: {
168
+ React.createElement("div", Object.assign({ id: 'modal-content', ref: ref, style: {
133
169
  height: isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H,
134
170
  overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden',
135
171
  zIndex: 1
136
- } }, (((_0 = (_z = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _z === void 0 ? void 0 : _z.props) === null || _0 === void 0 ? void 0 : _0.enableFixedCloseButton) && {
172
+ } }, (((_z = (_y = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _y === void 0 ? void 0 : _y.props) === null || _z === void 0 ? void 0 : _z.enableFixedCloseButton) && {
137
173
  onScroll: (e) => {
138
174
  var _a;
139
175
  setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
140
176
  }
141
- })), child())))))), modalEleRef.current);
177
+ })), child()),
178
+ React.createElement("button", { className: 'modal-icon-wrapper', role: 'button', "aria-label": 'close button', onClick: onClose, style: { top: scrollTop } },
179
+ React.createElement("img", { src: (_0 = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _0 !== void 0 ? _0 : closeIcon, alt: 'close button', className: 'modal-icon' }))))))), modalEleRef.current);
142
180
  };
143
181
  export default memo(Modal);
@@ -493,9 +493,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
493
493
  alignItems: 'center'
494
494
  } },
495
495
  React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
496
+ renderBottom(rec, index),
496
497
  renderLikeButton(rec, index, !(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
497
498
  renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
498
- renderBottom(rec, index),
499
499
  renderContent(rec, index)))))));
500
500
  });
501
501
  }, [
@@ -561,9 +561,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
561
561
  }
562
562
  }
563
563
  }, direction: 'vertical', height: height },
564
+ renderView,
564
565
  renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
565
- renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
566
- renderView),
566
+ renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
567
567
  React.createElement(WaterFall, Object.assign({}, (_w = (_v = (_u = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.item) === null || _w === void 0 ? void 0 : _w.props)),
568
568
  React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig })));
569
569
  };
@@ -0,0 +1,2 @@
1
+ declare const useFocusTrap: (elementRef: any) => void;
2
+ export default useFocusTrap;
@@ -0,0 +1,37 @@
1
+ import { useEffect } from 'react';
2
+ const useFocusTrap = (elementRef) => {
3
+ useEffect(() => {
4
+ const trapFocus = (element) => {
5
+ var focusableEls = element === null || element === void 0 ? void 0 : element.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])');
6
+ var firstFocusableEl = focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls[0];
7
+ var lastFocusableEl = focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls[(focusableEls === null || focusableEls === void 0 ? void 0 : focusableEls.length) - 1];
8
+ var KEYCODE_TAB = 9;
9
+ element.addEventListener('keydown', function (e) {
10
+ var isTabPressed = e.key === 'Tab' || e.keyCode === KEYCODE_TAB;
11
+ if (!isTabPressed) {
12
+ return;
13
+ }
14
+ if (e.shiftKey) {
15
+ if ((document === null || document === void 0 ? void 0 : document.activeElement) === firstFocusableEl) {
16
+ lastFocusableEl === null || lastFocusableEl === void 0 ? void 0 : lastFocusableEl.focus();
17
+ e.preventDefault();
18
+ }
19
+ }
20
+ else {
21
+ if ((document === null || document === void 0 ? void 0 : document.activeElement) === lastFocusableEl) {
22
+ firstFocusableEl === null || firstFocusableEl === void 0 ? void 0 : firstFocusableEl.focus();
23
+ e.preventDefault();
24
+ }
25
+ }
26
+ });
27
+ firstFocusableEl === null || firstFocusableEl === void 0 ? void 0 : firstFocusableEl.focus();
28
+ };
29
+ if (elementRef === null || elementRef === void 0 ? void 0 : elementRef.current)
30
+ trapFocus(elementRef === null || elementRef === void 0 ? void 0 : elementRef.current);
31
+ return () => {
32
+ var _a;
33
+ (_a = elementRef === null || elementRef === void 0 ? void 0 : elementRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('keydown', trapFocus);
34
+ };
35
+ }, [elementRef]);
36
+ };
37
+ export default useFocusTrap;
package/es/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Pagebuilder } from './core/Pagebuilder';
2
+ import './index.css';
2
3
  export * as core from './core';
3
4
  export * as materials from './materials';
4
5
  export { default as SxpPageRender } from './core/components/SxpPageRender';
package/es/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Pagebuilder } from './core/Pagebuilder';
2
+ import './index.css';
2
3
  import * as core_1 from './core';
3
4
  export { core_1 as core };
4
5
  import * as materials_1 from './materials';
@@ -97,7 +97,7 @@ const CommodityDetail = (_a) => {
97
97
  };
98
98
  const renderBtn = () => {
99
99
  var _a, _b;
100
- return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle },
100
+ return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("a", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', role: 'button', tabIndex: 0, onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle },
101
101
  React.createElement("span", { dangerouslySetInnerHTML: {
102
102
  __html: setFontForText((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
103
103
  } })))));
@@ -135,7 +135,9 @@ const CommodityDetail = (_a) => {
135
135
  return (React.createElement(React.Fragment, null,
136
136
  React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
137
137
  React.createElement("div", { style: { position: 'relative' } },
138
- product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
138
+ product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (React.createElement(Swiper, { a11y: {
139
+ enabled: true
140
+ }, height: height, modules: [Pagination, Autoplay], pagination: {
139
141
  clickable: true,
140
142
  bulletActiveClass: 'swipe-item-active-bullet',
141
143
  clickableClass: getDotsAlign,
@@ -194,7 +194,7 @@ Made in Italy` })));
194
194
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
195
195
  __html: setFontForText((_2 = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _2 !== void 0 ? _2 : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
196
196
  } }))),
197
- (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_3 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _3 !== void 0 ? _3 : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
197
+ (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("a", { "aria-label": (_3 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _3 !== void 0 ? _3 : 'Shop now', role: 'button', tabIndex: 0, onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
198
198
  React.createElement("span", { dangerouslySetInnerHTML: {
199
199
  __html: setFontForText((_4 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _4 !== void 0 ? _4 : 'Shop now', buttonStyle)
200
200
  } }))),
@@ -47,39 +47,43 @@ const CommodityList = (_a) => {
47
47
  eventName: 'PageView'
48
48
  });
49
49
  }, []);
50
- return (React.createElement("div", { className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
50
+ return (React.createElement("ul", { role: 'list', className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
51
51
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
52
- return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("div", Object.assign({ key: index }, props, { className: css({
53
- display: 'flex'
54
- }), onClick: () => handleClick(item, index) }),
55
- React.createElement(Img, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture, enableEventReport: false }),
56
- React.createElement("div", { style: {
57
- width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px)`,
52
+ return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement("li", { role: 'listitem', key: index, onClick: () => handleClick(item, index) },
53
+ React.createElement("button", Object.assign({ role: 'button', "aria-label": item === null || item === void 0 ? void 0 : item.title, tabIndex: 0, className: css({
58
54
  display: 'flex',
59
- flexDirection: 'column',
60
- justifyContent: 'space-between'
61
- } },
62
- React.createElement("div", null,
63
- React.createElement("div", { className: 'one-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.title), dangerouslySetInnerHTML: {
64
- __html: setFontForText((_g = item === null || item === void 0 ? void 0 : item.title) !== null && _g !== void 0 ? _g : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
65
- } }),
66
- React.createElement("div", { className: 'two-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection, hidden: !!item && (!(item === null || item === void 0 ? void 0 : item.collection) || (item === null || item === void 0 ? void 0 : item.collection) === ''), dangerouslySetInnerHTML: {
67
- __html: setFontForText((_h = item === null || item === void 0 ? void 0 : item.collection) !== null && _h !== void 0 ? _h : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
68
- } })),
69
- React.createElement("div", { className: css({
55
+ alignItems: 'normal',
56
+ width: '100%',
57
+ textAlign: 'left'
58
+ }) }, props),
59
+ React.createElement(Img, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture, enableEventReport: false }),
60
+ React.createElement("div", { style: {
61
+ width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px)`,
70
62
  display: 'flex',
71
- alignItems: 'flex-end',
72
- justifyContent: 'space-between',
73
- width: '100%',
74
- overflow: 'hidden'
75
- }) },
63
+ flexDirection: 'column',
64
+ justifyContent: 'space-between'
65
+ } },
76
66
  React.createElement("div", null,
77
- React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
78
- __html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
67
+ React.createElement("div", { className: 'one-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.title), dangerouslySetInnerHTML: {
68
+ __html: setFontForText((_g = item === null || item === void 0 ? void 0 : item.title) !== null && _g !== void 0 ? _g : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
69
+ } }),
70
+ React.createElement("div", { className: 'two-line-ellipsis', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection, hidden: !!item && (!(item === null || item === void 0 ? void 0 : item.collection) || (item === null || item === void 0 ? void 0 : item.collection) === ''), dangerouslySetInnerHTML: {
71
+ __html: setFontForText((_h = item === null || item === void 0 ? void 0 : item.collection) !== null && _h !== void 0 ? _h : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
79
72
  } })),
80
- React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
81
- __html: setFontForText((_l = (_k = item === null || item === void 0 ? void 0 : item.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', buttonStyle)
82
- } })))))));
73
+ React.createElement("div", { className: css({
74
+ display: 'flex',
75
+ alignItems: 'flex-end',
76
+ justifyContent: 'space-between',
77
+ width: '100%',
78
+ overflow: 'hidden'
79
+ }) },
80
+ React.createElement("div", null,
81
+ React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
82
+ __html: (_j = priceText(item)) !== null && _j !== void 0 ? _j : ''
83
+ } })),
84
+ React.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
85
+ __html: setFontForText((_l = (_k = item === null || item === void 0 ? void 0 : item.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', buttonStyle)
86
+ } }))))))));
83
87
  })));
84
88
  };
85
89
  export default memo(CommodityList);
@@ -11,7 +11,7 @@ const Appoint = (_a) => {
11
11
  const { sxpParameter } = useSxpDataSource();
12
12
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
13
13
  const 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;
14
- return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' }, index: index }, props),
14
+ return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: Object.assign({ alignItems: 'center' }, style), index: index }, props),
15
15
  React.createElement(Img, { src: src, rec: recData, item: (_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) !== null && _f !== void 0 ? _f : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
16
16
  React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
17
17
  __html: setFontForText((_g = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _g !== void 0 ? _g : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
@@ -7,12 +7,12 @@ import { useSxpDataSource } from '../../../../core/hooks';
7
7
  import Img from '../components/Img';
8
8
  import { setFontForText } from '../../../../core/utils/tool';
9
9
  const Commodity = (_a) => {
10
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
10
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
11
11
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index", "isActive"]);
12
12
  const { sxpParameter } = 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 = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
15
- return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
15
+ return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: style, index: index }, props),
16
16
  React.createElement(Img, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
17
17
  React.createElement("div", { className: css({
18
18
  color: '#fff',
@@ -25,8 +25,8 @@ const Commodity = (_a) => {
25
25
  React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
26
26
  __html: setFontForText((_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
27
27
  } }),
28
- React.createElement("div", { className: css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', lineHeight: ((_k = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _k === void 0 ? void 0 : _k.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
29
- __html: setFontForText((_m = (_l = product === null || product === void 0 ? void 0 : product.bindCta) === null || _l === void 0 ? void 0 : _l.enTitle) !== null && _m !== void 0 ? _m : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
28
+ React.createElement("button", { "aria-label": (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', className: css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', lineHeight: ((_m = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _m === void 0 ? void 0 : _m.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
29
+ __html: setFontForText((_p = (_o = product === null || product === void 0 ? void 0 : product.bindCta) === null || _o === void 0 ? void 0 : _o.enTitle) !== null && _p !== void 0 ? _p : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
30
30
  } }))));
31
31
  };
32
32
  export default memo(Commodity);
@@ -7,12 +7,12 @@ import { useSxpDataSource } from '../../../../core/hooks';
7
7
  import Img from '../components/Img';
8
8
  import { setFontForText } from '../../../../core/utils/tool';
9
9
  const CommodityDiro = (_a) => {
10
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
10
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
11
11
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index", "isActive"]);
12
12
  const { sxpParameter } = 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 = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
15
- return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
15
+ return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: style, index: index }, props),
16
16
  React.createElement(Img, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
17
17
  React.createElement("div", { className: css({
18
18
  color: '#fff',
@@ -25,8 +25,8 @@ const CommodityDiro = (_a) => {
25
25
  React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
26
26
  __html: setFontForText((_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
27
27
  } }),
28
- React.createElement("div", { className: css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap', lineHeight: ((_k = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _k === void 0 ? void 0 : _k.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
29
- __html: setFontForText((_m = (_l = product === null || product === void 0 ? void 0 : product.bindCta) === null || _l === void 0 ? void 0 : _l.enTitle) !== null && _m !== void 0 ? _m : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
28
+ React.createElement("button", { "aria-label": (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', className: css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap', lineHeight: ((_m = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _m === void 0 ? void 0 : _m.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
29
+ __html: setFontForText((_p = (_o = product === null || product === void 0 ? void 0 : product.bindCta) === null || _o === void 0 ? void 0 : _o.enTitle) !== null && _p !== void 0 ? _p : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
30
30
  } }))));
31
31
  };
32
32
  export default memo(CommodityDiro);
@@ -7,12 +7,12 @@ import { useSxpDataSource } from '../../../../core/hooks';
7
7
  import Img from '../components/Img';
8
8
  import { setFontForText } from '../../../../core/utils/tool';
9
9
  const CommodityDiroNew = (_a) => {
10
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
10
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
11
11
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index", "isActive"]);
12
12
  const { sxpParameter } = 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 = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
15
- return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
15
+ return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, style: style, index: index }, props),
16
16
  React.createElement(Img, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
17
17
  React.createElement("div", { className: css({
18
18
  color: '#fff',
@@ -25,8 +25,8 @@ const CommodityDiroNew = (_a) => {
25
25
  React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
26
26
  __html: setFontForText((_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
27
27
  } }),
28
- React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
29
- __html: setFontForText((_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
28
+ React.createElement("button", { "aria-label": (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
29
+ __html: setFontForText((_o = (_m = product === null || product === void 0 ? void 0 : product.bindCta) === null || _m === void 0 ? void 0 : _m.enTitle) !== null && _o !== void 0 ? _o : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
30
30
  } }))));
31
31
  };
32
32
  export default memo(CommodityDiroNew);
@@ -15,7 +15,7 @@ const Link = (_a) => {
15
15
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
16
16
  const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
17
17
  const src = (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
18
- return (React.createElement(EventProvider, Object.assign({ index: index, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { jumpLink: (_f = cta === null || cta === void 0 ? void 0 : cta.link) !== null && _f !== void 0 ? _f : '' }),
18
+ return (React.createElement(EventProvider, Object.assign({ index: index, rec: recData, style: Object.assign({ alignItems: 'center' }, style) }, props, { jumpLink: (_f = cta === null || cta === void 0 ? void 0 : cta.link) !== null && _f !== void 0 ? _f : '' }),
19
19
  React.createElement(Img, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
20
20
  React.createElement("div", { className: css({
21
21
  display: 'flex',
@@ -2,55 +2,36 @@ import { __rest } from "tslib";
2
2
  import { css } from '@emotion/css';
3
3
  import React, { memo, useState } from 'react';
4
4
  import { SwiperSlide } from 'swiper/react';
5
- import { throttle } from 'lodash';
6
5
  import Img from '../components/Img';
7
6
  import Scroll from '../components/Scroll';
8
7
  import styles from './index.module.less';
9
- import { useEditor, useSxpDataSource } from '../../../../core/hooks';
10
- import { useEventReport } from '../../../../core/hooks/useEventReport';
8
+ import { useSxpDataSource } from '../../../../core/hooks';
11
9
  import { setFontForText } from '../../../../core/utils/tool';
10
+ import EventProvider from '../components/EventProvider';
12
11
  const MultiCommodity = (_a) => {
13
12
  var _b, _c;
14
- var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY", "isActive"]);
13
+ var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive"]);
15
14
  const { sxpParameter } = useSxpDataSource();
16
- const { ctaEvent, setPopupDetailData } = useSxpDataSource();
17
- const { popup } = useEditor();
18
- const [products, setProducts] = 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]);
19
- const { jumpToWeb } = useEventReport();
20
- const handleClick = throttle((item, multiCheckIndex) => {
21
- ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
22
- eventSubject: 'clickCta',
23
- eventDescription: 'User clicked the CTA'
24
- }, recData, item, index);
25
- 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 }), index, multiCheckIndex }));
26
- if (isExternalLink) {
27
- if (item === null || item === void 0 ? void 0 : item.link) {
28
- jumpToWeb(recData, item, item.bindCta, index);
29
- window.location.href = window.getJointUtmLink(item.link);
30
- }
31
- }
32
- else {
33
- onClick === null || onClick === void 0 ? void 0 : onClick();
34
- }
35
- }, popup === null || popup === void 0 ? void 0 : popup.duration);
36
- return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
37
- var _a, _b, _c, _d, _e, _f, _g, _h;
38
- return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
39
- React.createElement(Img, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
40
- React.createElement("div", { className: css({
41
- color: '#fff',
42
- display: 'flex',
43
- flexDirection: 'column',
44
- justifyContent: 'space-between',
45
- width: '100%',
46
- overflow: 'hidden'
47
- }) },
48
- React.createElement("div", { className: styles['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
49
- __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
50
- } }),
51
- React.createElement("div", { className: css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', lineHeight: ((_f = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _f === void 0 ? void 0 : _f.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
52
- __html: setFontForText((_h = (_g = item === null || item === void 0 ? void 0 : item.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
53
- } }))))));
15
+ const [products] = 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]);
16
+ return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
17
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
18
+ return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
19
+ React.createElement(EventProvider, Object.assign({ rec: recData, multiCheckIndex: itemIndex }, props),
20
+ React.createElement(Img, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: itemIndex, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
21
+ React.createElement("div", { className: css({
22
+ color: '#fff',
23
+ display: 'flex',
24
+ flexDirection: 'column',
25
+ justifyContent: 'space-between',
26
+ width: '100%',
27
+ overflow: 'hidden'
28
+ }) },
29
+ React.createElement("div", { className: styles['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
30
+ __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
31
+ } }),
32
+ React.createElement("button", { "aria-label": (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now', className: css(Object.assign({ padding: '0 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', lineHeight: ((_h = ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle) === null || _h === void 0 ? void 0 : _h.height) + 'px' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
33
+ __html: setFontForText((_k = (_j = item === null || item === void 0 ? void 0 : item.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop Now', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
34
+ } })))))));
54
35
  })));
55
36
  };
56
37
  export default memo(MultiCommodity);