pb-sxp-ui 1.5.5 → 1.6.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.
- package/dist/index.cjs +121 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +17 -1
- package/dist/index.js +121 -71
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +121 -71
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/PictureGroup.js +5 -1
- package/es/core/components/SxpPageRender/Hashtag/index.js +1 -1
- package/es/core/components/SxpPageRender/Modal/index.js +6 -6
- package/es/core/components/SxpPageRender/Navbar.js +2 -1
- package/es/core/components/SxpPageRender/PictureGroup/index.js +2 -1
- package/es/core/components/SxpPageRender/RenderCard.d.ts +3 -3
- package/es/core/components/SxpPageRender/RenderCard.js +27 -17
- package/es/core/components/SxpPageRender/Tagbar.js +2 -2
- package/es/core/components/SxpPageRender/WaterFall/index.js +5 -1
- package/es/core/components/SxpPageRender/index.d.ts +8 -0
- package/es/core/components/SxpPageRender/index.js +47 -19
- package/es/core/context/SxpDataSourceProvider.js +4 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +2 -1
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +5 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +2 -1
- package/es/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -2
- package/es/materials/sxp/template/components/Img.d.ts +1 -0
- package/es/materials/sxp/template/components/Img.js +6 -4
- package/lib/core/components/DiyPortalPreview/PictureGroup.js +5 -1
- package/lib/core/components/SxpPageRender/Hashtag/index.js +1 -1
- package/lib/core/components/SxpPageRender/Modal/index.js +6 -6
- package/lib/core/components/SxpPageRender/Navbar.js +2 -1
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +2 -1
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +3 -3
- package/lib/core/components/SxpPageRender/RenderCard.js +26 -16
- package/lib/core/components/SxpPageRender/Tagbar.js +2 -2
- package/lib/core/components/SxpPageRender/WaterFall/index.js +5 -1
- package/lib/core/components/SxpPageRender/index.d.ts +8 -0
- package/lib/core/components/SxpPageRender/index.js +47 -19
- package/lib/core/context/SxpDataSourceProvider.js +4 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +2 -1
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +5 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +2 -1
- package/lib/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -2
- package/lib/materials/sxp/template/components/Img.d.ts +1 -0
- package/lib/materials/sxp/template/components/Img.js +5 -3
- package/package.json +1 -1
@@ -1,20 +1,22 @@
|
|
1
1
|
import { css } from '@emotion/css';
|
2
|
-
import React, { memo, useEffect, useMemo, useRef } from 'react';
|
2
|
+
import React, { memo, useEffect, useMemo, useRef, useState } from 'react';
|
3
3
|
import useOnScreen from '../../../../core/hooks/useOnScreen';
|
4
4
|
import { useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
6
|
-
const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventReport = true }) => {
|
6
|
+
const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventReport = true, isActive }) => {
|
7
7
|
const ref = useRef(null);
|
8
8
|
const isOnScreen = useOnScreen(ref);
|
9
9
|
const { ctaEvent } = useSxpDataSource();
|
10
|
+
const [visible, setVisible] = useState(false);
|
10
11
|
useEffect(() => {
|
11
|
-
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current) && enableEventReport) {
|
12
|
+
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current) && enableEventReport && !visible) {
|
13
|
+
setVisible(true);
|
12
14
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
13
15
|
eventSubject: 'ctaExposure',
|
14
16
|
eventDescription: 'The cta was shown to the user'
|
15
17
|
}, rec, item, index);
|
16
18
|
}
|
17
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport]);
|
19
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport, visible]);
|
18
20
|
const imgSrc = useMemo(() => {
|
19
21
|
return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/20`;
|
20
22
|
}, [src]);
|
@@ -6,7 +6,11 @@ const modules_1 = require("swiper/modules");
|
|
6
6
|
const react_2 = require("swiper/react");
|
7
7
|
const Picture_1 = tslib_1.__importDefault(require("../SxpPageRender/PictureGroup/Picture"));
|
8
8
|
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|
9
|
-
return (react_1.default.createElement(react_2.Swiper, { defaultValue: 0, direction: 'horizontal', modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
|
9
|
+
return (react_1.default.createElement(react_2.Swiper, { defaultValue: 0, direction: 'horizontal', modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
|
10
|
+
clickable: true,
|
11
|
+
bulletActiveClass: 'swipe-item-active-bullet',
|
12
|
+
bulletElement: 'button'
|
13
|
+
}, height: height, style: { width }, loop: true, autoplay: false }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
|
10
14
|
return (react_1.default.createElement(react_2.SwiperSlide, { key: url },
|
11
15
|
react_1.default.createElement(Picture_1.default, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
|
12
16
|
})));
|
@@ -40,7 +40,7 @@ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle }) => {
|
|
40
40
|
return (react_1.default.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer', color: '#fff' }, onClick: () => setIsShowMore(!isShowMore) }, isShowMore ? 'show less' : 'show more'));
|
41
41
|
}, [isShowMore, tags]);
|
42
42
|
return (react_1.default.createElement("div", { className: 'clc-sxp-bottom-hashtag', style: { marginTop: `${(_a = hashTagStyle === null || hashTagStyle === void 0 ? void 0 : hashTagStyle.marginTop) !== null && _a !== void 0 ? _a : 16}px` } },
|
43
|
-
react_1.default.createElement(Scroll_1.default, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (react_1.default.createElement(react_2.SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item) },
|
43
|
+
react_1.default.createElement(Scroll_1.default, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (react_1.default.createElement(react_2.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
44
|
react_1.default.createElement("div", { dangerouslySetInnerHTML: { __html: (0, tool_1.setFontForText)(`#${item}`, hashTagStyle) } })))))));
|
45
45
|
};
|
46
46
|
exports.default = (0, react_1.memo)(Hashtag);
|
@@ -7,7 +7,7 @@ const ReactDOM = tslib_1.__importStar(require("react-dom"));
|
|
7
7
|
const hooks_1 = require("../../../../core/hooks");
|
8
8
|
const closeIcon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
9
9
|
const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false }) => {
|
10
|
-
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;
|
10
|
+
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;
|
11
11
|
const touchRef = (0, react_1.useRef)(null);
|
12
12
|
const fTouchRef = (0, react_1.useRef)(null);
|
13
13
|
const touchMoveRef = (0, react_1.useRef)(null);
|
@@ -117,9 +117,9 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
117
117
|
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
118
|
height: '100%'
|
119
119
|
} },
|
120
|
-
react_1.default.createElement("div", Object.assign({ className: `modal-container ${isOpen ? 'modal-popIn' : 'modal-popOut'}`, style: Object.assign(Object.assign({ padding, animationDuration: ((
|
120
|
+
react_1.default.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 && {
|
121
121
|
transform: `translateY(${modalTrans}px)`
|
122
|
-
})), { overflow: 'hidden', borderRadius: `${(
|
122
|
+
})), { 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
123
|
e.stopPropagation();
|
124
124
|
e.preventDefault();
|
125
125
|
} }, (isScrollFullScreen && {
|
@@ -127,13 +127,13 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
127
127
|
onTouchStart: handleTouchStart,
|
128
128
|
onTouchEnd: handleTouchEnd
|
129
129
|
})),
|
130
|
-
react_1.default.createElement("
|
131
|
-
react_1.default.createElement("img", { src: (
|
130
|
+
react_1.default.createElement("button", { className: 'modal-icon-wrapper', role: 'button', "aria-label": 'close button', onClick: onClose, style: { top: scrollTop } },
|
131
|
+
react_1.default.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
132
|
react_1.default.createElement("div", Object.assign({ ref: ref, style: {
|
133
133
|
height: isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H,
|
134
134
|
overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden',
|
135
135
|
zIndex: 1
|
136
|
-
} }, (((
|
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) && {
|
137
137
|
onScroll: (e) => {
|
138
138
|
var _a;
|
139
139
|
setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
|
@@ -8,7 +8,8 @@ const Navbar = ({ icon, styles, textStyle, onClose }) => {
|
|
8
8
|
var _a;
|
9
9
|
const { waterFallData, setOpenHashtag } = (0, hooks_1.useSxpDataSource)();
|
10
10
|
return (react_1.default.createElement("div", { className: 'clc-sxp-nav', style: styles },
|
11
|
-
react_1.default.createElement("
|
11
|
+
react_1.default.createElement("button", { className: 'clc-sxp-nav-left', role: 'button', "aria-label": 'back button', onClick: onClose },
|
12
|
+
react_1.default.createElement("img", { src: icon, alt: 'back button' })),
|
12
13
|
react_1.default.createElement("div", { className: 'clc-sxp-nav-title', style: Object.assign(Object.assign({}, textStyle), { paddingLeft: (textStyle === null || textStyle === void 0 ? void 0 : textStyle.textAlign) === 'left' ? '35px' : 0 }), dangerouslySetInnerHTML: {
|
13
14
|
__html: (0, tool_1.setFontForText)(`#${(_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag) !== null && _a !== void 0 ? _a : '标题'}`, textStyle)
|
14
15
|
} })));
|
@@ -34,7 +34,8 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd
|
|
34
34
|
}, [isLoad]);
|
35
35
|
return (react_1.default.createElement(react_2.Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
|
36
36
|
clickable: true,
|
37
|
-
bulletActiveClass: 'swipe-item-active-bullet'
|
37
|
+
bulletActiveClass: 'swipe-item-active-bullet',
|
38
|
+
bulletElement: 'button'
|
38
39
|
}, className: (0, css_1.css)(Object.assign(Object.assign({ '.swiper-pagination': {
|
39
40
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
40
41
|
fontSize: '14px'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import React from 'react';
|
2
2
|
import './index.less';
|
3
3
|
import { RecItemType } from './typing';
|
4
4
|
interface IRenderCardProps {
|
@@ -9,5 +9,5 @@ interface IRenderCardProps {
|
|
9
9
|
includesCtaType?: string[];
|
10
10
|
isActive?: boolean;
|
11
11
|
}
|
12
|
-
declare const
|
13
|
-
export default
|
12
|
+
declare const _default: React.NamedExoticComponent<IRenderCardProps>;
|
13
|
+
export default _default;
|
@@ -21,33 +21,43 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }
|
|
21
21
|
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
22
22
|
}
|
23
23
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
24
|
-
const renderComp = (0, react_1.
|
25
|
-
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;
|
24
|
+
const renderComp = (0, react_1.useMemo)(() => {
|
25
|
+
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, _7, _8;
|
26
26
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
27
27
|
return null;
|
28
|
-
|
28
|
+
let cta = null;
|
29
|
+
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
30
|
+
cta = '多商品CTA';
|
31
|
+
}
|
32
|
+
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
33
|
+
cta = '商品CTA';
|
34
|
+
}
|
35
|
+
else {
|
36
|
+
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
37
|
+
}
|
38
|
+
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type)))
|
29
39
|
return;
|
30
|
-
if (!includesCtaType && ((
|
40
|
+
if (!includesCtaType && ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.category) === 'cta')
|
31
41
|
return;
|
32
|
-
if ((((
|
33
|
-
(((
|
34
|
-
(((
|
35
|
-
(((
|
36
|
-
(((
|
37
|
-
(((
|
42
|
+
if ((((_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.type) === 'CommodityDiro' && !((_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProduct)) ||
|
43
|
+
(((_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.type) === 'Commodity' && !((_l = rec === null || rec === void 0 ? void 0 : rec.video) === null || _l === void 0 ? void 0 : _l.bindProduct)) ||
|
44
|
+
(((_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.type) === 'CommodityDiroNew' && !((_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindProduct)) ||
|
45
|
+
(((_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.type) === 'MultiCommodity' && !((_r = (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.bindProducts) === null || _r === void 0 ? void 0 : _r.length)) ||
|
46
|
+
(((_s = value === null || value === void 0 ? void 0 : value.item) === null || _s === void 0 ? void 0 : _s.type) === 'MultiCommodityDiro' && !((_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u.length)) ||
|
47
|
+
(((_v = value === null || value === void 0 ? void 0 : value.item) === null || _v === void 0 ? void 0 : _v.type) === 'MultiCommodityDiroNew' && !((_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindProducts) === null || _x === void 0 ? void 0 : _x.length))) {
|
38
48
|
return null;
|
39
49
|
}
|
40
50
|
if (value && resolver) {
|
41
|
-
const t = resolver[(
|
51
|
+
const t = resolver[(_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.type];
|
42
52
|
const Component = (0, withBindDataSource_1.default)(t);
|
43
|
-
const defaulSetting = (
|
44
|
-
const isExternalLink = ((
|
45
|
-
return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (
|
53
|
+
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
54
|
+
const isExternalLink = ((_2 = (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.event) === null || _1 === void 0 ? void 0 : _1.onClick) === null || _2 === void 0 ? void 0 : _2.linkType) === 'externalLink';
|
55
|
+
return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_4 = value === null || value === void 0 ? void 0 : value.item) === null || _4 === void 0 ? void 0 : _4.textStyle), bindDatas: (_6 = (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.bindDatas) !== null && _6 !== void 0 ? _6 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_7 = value === null || value === void 0 ? void 0 : value.item) === null || _7 === void 0 ? void 0 : _7.props, { event: ((_8 = value === null || value === void 0 ? void 0 : value.item) === null || _8 === void 0 ? void 0 : _8.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, index: index, isActive: isActive })));
|
46
56
|
}
|
47
57
|
else {
|
48
58
|
return null;
|
49
59
|
}
|
50
60
|
}, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id, isActive]);
|
51
|
-
return react_1.default.createElement(react_1.default.Fragment, null, renderComp
|
61
|
+
return react_1.default.createElement(react_1.default.Fragment, null, renderComp);
|
52
62
|
};
|
53
|
-
exports.default = RenderCard;
|
63
|
+
exports.default = (0, react_1.memo)(RenderCard);
|
@@ -48,8 +48,8 @@ const Tagbar = ({ tagList = [], setActiveIndex, style }) => {
|
|
48
48
|
if (waterFallData || tagList.length <= 0)
|
49
49
|
return null;
|
50
50
|
return (react_1.default.createElement("div", { className: 'clc-sxp-tagbar', style: style },
|
51
|
-
react_1.default.createElement("
|
52
|
-
return (react_1.default.createElement("
|
51
|
+
react_1.default.createElement("div", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
52
|
+
return (react_1.default.createElement("button", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, "aria-label": tag, onClick: handleSelectTag(tag) }, tag));
|
53
53
|
}))));
|
54
54
|
};
|
55
55
|
exports.default = (0, react_1.memo)(Tagbar);
|
@@ -50,14 +50,17 @@ const WaterFall = (props) => {
|
|
50
50
|
if (!rec)
|
51
51
|
return;
|
52
52
|
let fromKName = '';
|
53
|
+
let contentFormat = null;
|
53
54
|
if (isFromHashtag) {
|
54
55
|
fromKName = 'hashTagPage';
|
55
56
|
}
|
56
57
|
else if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
57
58
|
fromKName = 'videoPage';
|
59
|
+
contentFormat = 'video';
|
58
60
|
}
|
59
61
|
else if ((_c = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) === null || _c === void 0 ? void 0 : _c.length) {
|
60
62
|
fromKName = 'imagePage';
|
63
|
+
contentFormat = 'image';
|
61
64
|
}
|
62
65
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
63
66
|
eventInfo: {
|
@@ -70,7 +73,8 @@ const WaterFall = (props) => {
|
|
70
73
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
71
74
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
72
75
|
eventSubject: 'clickTagsViewContents',
|
73
|
-
eventDescription: 'User click tags view contents'
|
76
|
+
eventDescription: 'User click tags view contents',
|
77
|
+
contentFormat
|
74
78
|
}
|
75
79
|
});
|
76
80
|
}, [recData, bffEventReport, viewTime, isFromHashtag, cacheActiveIndex]);
|
@@ -57,6 +57,14 @@ export interface ISxpPageRenderProps {
|
|
57
57
|
currencyPosition?: string;
|
58
58
|
showTwoDecimalPoint?: boolean;
|
59
59
|
};
|
60
|
+
backButton?: {
|
61
|
+
enable: boolean;
|
62
|
+
icon: string;
|
63
|
+
xPosit: string;
|
64
|
+
x: number;
|
65
|
+
yPosit: string;
|
66
|
+
y: number;
|
67
|
+
};
|
60
68
|
};
|
61
69
|
descStyle?: CSSProperties;
|
62
70
|
tipText?: {
|
@@ -26,7 +26,7 @@ const Tagbar_1 = tslib_1.__importDefault(require("./Tagbar"));
|
|
26
26
|
const localStore_1 = require("../../../core/utils/localStore");
|
27
27
|
const lodash_1 = require("lodash");
|
28
28
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
|
29
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
29
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
30
30
|
const mutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
31
31
|
const unmutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
32
32
|
const { schema } = (0, hooks_1.useEditor)();
|
@@ -269,10 +269,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
269
269
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
270
270
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
271
271
|
((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && react_1.default.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
272
|
-
react_1.default.createElement("div", { className: 'clc-sxp-bottom', style: {
|
272
|
+
react_1.default.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _b !== void 0 ? _b : 40}px` } },
|
273
273
|
react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
|
274
274
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
275
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
|
275
|
+
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
|
276
276
|
react_1.default.createElement("div", null,
|
277
277
|
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: (_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
278
278
|
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'] }),
|
@@ -332,7 +332,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
332
332
|
}
|
333
333
|
};
|
334
334
|
const handleSlideSkip = (item, position) => {
|
335
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
335
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
336
336
|
if (isPreview || waterFallData)
|
337
337
|
return;
|
338
338
|
const t = new Date() - curTime.current;
|
@@ -340,18 +340,26 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
340
340
|
const link = ((_d = (_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.link) || ((_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.link) || ((_g = item === null || item === void 0 ? void 0 : item.product) === null || _g === void 0 ? void 0 : _g.link);
|
341
341
|
const product = (item === null || item === void 0 ? void 0 : item.product) || ((_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct) || ((_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]);
|
342
342
|
if (link) {
|
343
|
+
let contentFormat = null;
|
344
|
+
if ((_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.url) {
|
345
|
+
contentFormat = 'video';
|
346
|
+
}
|
347
|
+
else if ((_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.imgUrls) === null || _o === void 0 ? void 0 : _o.length) {
|
348
|
+
contentFormat = 'image';
|
349
|
+
}
|
343
350
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
344
351
|
eventInfo: {
|
345
352
|
eventSubject: 'swipeToWeb',
|
346
353
|
eventDescription: 'User swiped to web',
|
347
|
-
productId: (
|
348
|
-
productName: (
|
354
|
+
productId: (_p = product === null || product === void 0 ? void 0 : product.itemId) !== null && _p !== void 0 ? _p : '',
|
355
|
+
productName: (_q = product === null || product === void 0 ? void 0 : product.title) !== null && _q !== void 0 ? _q : '',
|
349
356
|
price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0',
|
350
|
-
productCollection: (
|
357
|
+
productCollection: (_r = product === null || product === void 0 ? void 0 : product.collection) !== null && _r !== void 0 ? _r : '',
|
351
358
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
352
359
|
position: position + '',
|
353
|
-
contentId: (
|
354
|
-
traceInfo: (
|
360
|
+
contentId: (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.itemId) !== null && _t !== void 0 ? _t : '',
|
361
|
+
traceInfo: (_x = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : (_w = item === null || item === void 0 ? void 0 : item.product) === null || _w === void 0 ? void 0 : _w.traceInfo) !== null && _x !== void 0 ? _x : '',
|
362
|
+
contentFormat
|
355
363
|
}
|
356
364
|
});
|
357
365
|
skipLinkRef.current = true;
|
@@ -360,19 +368,28 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
360
368
|
}
|
361
369
|
};
|
362
370
|
const handleScrollEvent = (swiper) => {
|
363
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
371
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
364
372
|
const item = data[swiper.previousIndex];
|
365
373
|
if (!item)
|
366
374
|
return;
|
375
|
+
let fromKName = '';
|
376
|
+
let contentFormat = null;
|
377
|
+
if ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) {
|
378
|
+
contentFormat = 'video';
|
379
|
+
}
|
380
|
+
else if ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls) === null || _c === void 0 ? void 0 : _c.length) {
|
381
|
+
contentFormat = 'image';
|
382
|
+
}
|
367
383
|
if (swiper.previousIndex - swiper.activeIndex < 0) {
|
368
384
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
369
385
|
eventInfo: {
|
370
386
|
eventSubject: 'scrollDown',
|
371
387
|
eventDescription: 'User scroll down',
|
372
|
-
contentId: (
|
373
|
-
productId: (
|
388
|
+
contentId: (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.itemId) !== null && _e !== void 0 ? _e : '',
|
389
|
+
productId: (_g = (_f = item === null || item === void 0 ? void 0 : item.product) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
374
390
|
requestId: null,
|
375
|
-
traceInfo: (
|
391
|
+
traceInfo: (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.traceInfo) !== null && _j !== void 0 ? _j : '',
|
392
|
+
contentFormat
|
376
393
|
}
|
377
394
|
});
|
378
395
|
handleReportViewImageEnd(item);
|
@@ -383,17 +400,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
383
400
|
eventInfo: {
|
384
401
|
eventSubject: 'scrollUp',
|
385
402
|
eventDescription: 'User scroll up',
|
386
|
-
contentId: (
|
387
|
-
productId: (
|
403
|
+
contentId: (_l = (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '',
|
404
|
+
productId: (_o = (_m = item.product) === null || _m === void 0 ? void 0 : _m.itemId) !== null && _o !== void 0 ? _o : '',
|
388
405
|
requestId: null,
|
389
|
-
traceInfo: (
|
406
|
+
traceInfo: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : '',
|
407
|
+
contentFormat
|
390
408
|
}
|
391
409
|
});
|
392
410
|
handleReportViewImageEnd(item);
|
393
411
|
}
|
394
412
|
handleReportProductView(item);
|
395
413
|
const curItem = data[swiper.activeIndex];
|
396
|
-
if (!((
|
414
|
+
if (!((_r = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _r === void 0 ? void 0 : _r.url) && !((_s = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _s === void 0 ? void 0 : _s.imgUrls) && (curItem === null || curItem === void 0 ? void 0 : curItem.product)) {
|
397
415
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
398
416
|
eventName: 'ProductView'
|
399
417
|
});
|
@@ -495,7 +513,17 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
495
513
|
react_1.default.createElement(Tagbar_1.default, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
|
496
514
|
top: minusHeight
|
497
515
|
} }),
|
498
|
-
|
516
|
+
((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && (react_1.default.createElement("button", { style: {
|
517
|
+
position: 'absolute',
|
518
|
+
[(_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _g === void 0 ? void 0 : _g.xPosit) !== null && _h !== void 0 ? _h : 'left']: (_k = (_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _j === void 0 ? void 0 : _j.x) !== null && _k !== void 0 ? _k : 0,
|
519
|
+
[(_m = (_l = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _l === void 0 ? void 0 : _l.yPosit) !== null && _m !== void 0 ? _m : 'top']: (_p = (_o = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _o === void 0 ? void 0 : _o.y) !== null && _p !== void 0 ? _p : 0,
|
520
|
+
zIndex: 8,
|
521
|
+
border: 'none',
|
522
|
+
padding: 0,
|
523
|
+
background: 'transparent'
|
524
|
+
}, role: 'button', "aria-label": 'back button', onClick: () => history === null || history === void 0 ? void 0 : history.back() },
|
525
|
+
react_1.default.createElement("img", { src: (_r = (_q = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _q === void 0 ? void 0 : _q.icon) !== null && _r !== void 0 ? _r : left_png_1.default, alt: 'back button', width: 50, style: { objectFit: 'cover' } }))),
|
526
|
+
isShowFingerTip ? (react_1.default.createElement(FingerSwipeTip_1.default, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _s !== void 0 ? _s : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
|
499
527
|
react_1.default.createElement(react_2.Swiper, { style: {
|
500
528
|
marginTop: tagHeight
|
501
529
|
}, ref: swiperRef, onSlideChange: () => {
|
@@ -526,6 +554,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
526
554
|
renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
527
555
|
renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
|
528
556
|
renderView),
|
529
|
-
react_1.default.createElement(WaterFall_1.default, Object.assign({}, (
|
557
|
+
react_1.default.createElement(WaterFall_1.default, Object.assign({}, (_v = (_u = (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _t === void 0 ? void 0 : _t[0]) === null || _u === void 0 ? void 0 : _u.item) === null || _v === void 0 ? void 0 : _v.props))));
|
530
558
|
};
|
531
559
|
exports.default = SxpPageRender;
|
@@ -246,18 +246,21 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
246
246
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
247
247
|
const isProd = ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) || (((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
|
248
248
|
let fromKName = '';
|
249
|
+
let contentFormat = null;
|
249
250
|
if (isFromHashtag) {
|
250
251
|
fromKName = 'hashTagPage';
|
251
252
|
}
|
252
253
|
else if ((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.url) {
|
253
254
|
fromKName = 'videoPage';
|
255
|
+
contentFormat = 'video';
|
254
256
|
}
|
255
257
|
else if ((_g = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.imgUrls) === null || _g === void 0 ? void 0 : _g.length) {
|
256
258
|
fromKName = 'imagePage';
|
259
|
+
contentFormat = 'image';
|
257
260
|
}
|
258
261
|
const contentTags = (_p = (_m = (_h = product === null || product === void 0 ? void 0 : product.tags) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : (_q = rec === null || rec === void 0 ? void 0 : rec.product) === null || _q === void 0 ? void 0 : _q.tags;
|
259
262
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
260
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '' })
|
263
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '', contentFormat })
|
261
264
|
});
|
262
265
|
}, [bffEventReport, isFromHashtag]);
|
263
266
|
const h5EnterLink = (0, react_1.useCallback)(() => {
|
@@ -134,7 +134,8 @@ const CommodityDetail = (_a) => {
|
|
134
134
|
product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: height, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
|
135
135
|
clickable: true,
|
136
136
|
bulletActiveClass: 'swipe-item-active-bullet',
|
137
|
-
clickableClass: getDotsAlign
|
137
|
+
clickableClass: getDotsAlign,
|
138
|
+
bulletElement: 'button'
|
138
139
|
}, loop: true, autoplay: {
|
139
140
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
140
141
|
}, ref: ref, className: (0, css_1.css)(Object.assign(Object.assign({ '.swiper-pagination': { bottom: (_x = swiper === null || swiper === void 0 ? void 0 : swiper.dotsMarginBottom) !== null && _x !== void 0 ? _x : 0, fontSize: '14px' } }, ((swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor) && {
|
@@ -127,7 +127,11 @@ const CommodityDetailDiro = (_a) => {
|
|
127
127
|
e.stopPropagation();
|
128
128
|
handleTouchMove(e);
|
129
129
|
} }),
|
130
|
-
product && ((_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: width, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
|
130
|
+
product && ((_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: width, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
|
131
|
+
clickable: true,
|
132
|
+
bulletActiveClass: 'swipe-item-active-bullet',
|
133
|
+
bulletElement: 'button'
|
134
|
+
}, loop: true, autoplay: {
|
131
135
|
delay: 3000
|
132
136
|
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
133
137
|
return (react_1.default.createElement(react_2.SwiperSlide, { key: src },
|
@@ -118,7 +118,8 @@ Made in Italy` })));
|
|
118
118
|
product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: height, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
|
119
119
|
clickable: true,
|
120
120
|
bulletActiveClass: 'swipe-item-active-bullet',
|
121
|
-
clickableClass: getDotsAlign
|
121
|
+
clickableClass: getDotsAlign,
|
122
|
+
bulletElement: 'button'
|
122
123
|
}, loop: true, autoplay: {
|
123
124
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
124
125
|
}, ref: ref, className: (0, css_1.css)(Object.assign(Object.assign({ '.swiper-pagination': {
|
@@ -13,7 +13,7 @@ const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
|
13
13
|
const tool_1 = require("../../../../core/utils/tool");
|
14
14
|
const MultiCommodity = (_a) => {
|
15
15
|
var _b, _c;
|
16
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0 } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY"]);
|
16
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0, isActive } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY", "isActive"]);
|
17
17
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
18
18
|
const { ctaEvent, setPopupDetailData } = (0, hooks_1.useSxpDataSource)();
|
19
19
|
const { popup } = (0, hooks_1.useEditor)();
|
@@ -38,7 +38,7 @@ const MultiCommodity = (_a) => {
|
|
38
38
|
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
39
39
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
40
40
|
return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ key: index, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
41
|
-
react_1.default.createElement(Img_1.default, { 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 }),
|
41
|
+
react_1.default.createElement(Img_1.default, { 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 }),
|
42
42
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
43
43
|
color: '#fff',
|
44
44
|
display: 'flex',
|
@@ -13,7 +13,7 @@ const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
|
13
13
|
const tool_1 = require("../../../../core/utils/tool");
|
14
14
|
const MultiCommodityDiro = (_a) => {
|
15
15
|
var _b, _c;
|
16
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0 } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY"]);
|
16
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0, isActive } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY", "isActive"]);
|
17
17
|
const { ctaEvent, setPopupDetailData, sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
18
18
|
const { popup } = (0, hooks_1.useEditor)();
|
19
19
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
@@ -37,7 +37,7 @@ const MultiCommodityDiro = (_a) => {
|
|
37
37
|
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
38
38
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
39
39
|
return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ key: index, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
40
|
-
react_1.default.createElement(Img_1.default, { 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 }),
|
40
|
+
react_1.default.createElement(Img_1.default, { 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 }),
|
41
41
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
42
42
|
color: '#000',
|
43
43
|
display: 'flex',
|
@@ -13,7 +13,7 @@ const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
|
13
13
|
const tool_1 = require("../../../../core/utils/tool");
|
14
14
|
const MultiCommodityDiroNew = (_a) => {
|
15
15
|
var _b, _c;
|
16
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0 } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY"]);
|
16
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0, isActive } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY", "isActive"]);
|
17
17
|
const { ctaEvent, setPopupDetailData, sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
18
18
|
const { popup } = (0, hooks_1.useEditor)();
|
19
19
|
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
@@ -38,7 +38,7 @@ const MultiCommodityDiroNew = (_a) => {
|
|
38
38
|
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
39
39
|
var _a, _b, _c, _d, _e, _f, _g;
|
40
40
|
return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ key: index, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
41
|
-
react_1.default.createElement(Img_1.default, { 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 }),
|
41
|
+
react_1.default.createElement(Img_1.default, { 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 }),
|
42
42
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
43
43
|
color: '#fff',
|
44
44
|
display: 'flex',
|