pb-sxp-ui 1.0.86 → 1.0.88
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 +113 -166
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +113 -166
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +113 -166
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/Consent/index.js +2 -2
- package/es/core/components/DiyPortalPreview/VideoWidget.js +3 -3
- package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +1 -1
- package/es/core/components/SxpPageRender/FormatImage.js +2 -2
- package/es/core/components/SxpPageRender/LikeButton/index.js +1 -1
- package/es/core/components/SxpPageRender/Navbar.js +1 -1
- package/es/core/components/SxpPageRender/Nudge/index.js +1 -1
- package/es/core/components/SxpPageRender/Tagbar.js +6 -7
- package/es/core/components/SxpPageRender/ToggleButton/index.js +2 -2
- package/es/core/components/SxpPageRender/VideoWidget/index.js +3 -3
- package/es/core/components/SxpPageRender/WaterFall/List.js +2 -2
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +17 -52
- package/es/core/components/SxpPageRender/WaterFall/index.js +2 -4
- package/es/core/components/SxpPageRender/index.js +28 -30
- package/es/core/context/SxpDataSourceProvider.d.ts +4 -0
- package/es/core/context/SxpDataSourceProvider.js +9 -3
- package/es/core/hooks/useEventReport.d.ts +1 -1
- package/es/core/hooks/useEventReport.js +13 -10
- package/es/materials/sxp/popup/AppointForm/index.js +1 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +3 -3
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +4 -4
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -3
- package/es/materials/sxp/popup/Prompt/index.js +2 -2
- package/es/materials/sxp/template/Appoint/index.js +1 -1
- package/lib/core/components/Consent/index.js +2 -2
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +3 -3
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +1 -1
- package/lib/core/components/SxpPageRender/FormatImage.js +2 -2
- package/lib/core/components/SxpPageRender/LikeButton/index.js +1 -1
- package/lib/core/components/SxpPageRender/Navbar.js +1 -1
- package/lib/core/components/SxpPageRender/Nudge/index.js +1 -1
- package/lib/core/components/SxpPageRender/Tagbar.js +7 -8
- package/lib/core/components/SxpPageRender/ToggleButton/index.js +2 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +3 -3
- package/lib/core/components/SxpPageRender/WaterFall/List.js +2 -2
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +17 -52
- package/lib/core/components/SxpPageRender/WaterFall/index.js +2 -4
- package/lib/core/components/SxpPageRender/index.js +28 -30
- package/lib/core/context/SxpDataSourceProvider.d.ts +4 -0
- package/lib/core/context/SxpDataSourceProvider.js +10 -4
- package/lib/core/hooks/useEventReport.d.ts +1 -1
- package/lib/core/hooks/useEventReport.js +13 -10
- package/lib/materials/sxp/popup/AppointForm/index.js +1 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +3 -3
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +4 -4
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -3
- package/lib/materials/sxp/popup/Prompt/index.js +2 -2
- package/lib/materials/sxp/template/Appoint/index.js +1 -1
- package/package.json +1 -1
@@ -10,7 +10,7 @@ import ExpandableText from '../../../../core/components/SxpPageRender/Expandable
|
|
10
10
|
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
11
11
|
import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
12
12
|
const CommodityDetailDiroNew = (_a) => {
|
13
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
13
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
14
14
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
|
15
15
|
const [spread, setSpread] = useState(true);
|
16
16
|
const { sxpParameter } = useSxpDataSource();
|
@@ -138,7 +138,7 @@ Made in Italy` })));
|
|
138
138
|
top: 0,
|
139
139
|
objectFit: 'cover',
|
140
140
|
width: '100%'
|
141
|
-
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
|
141
|
+
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: 'pdp image' }))),
|
142
142
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
143
143
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
144
144
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
@@ -147,7 +147,7 @@ Made in Italy` })));
|
|
147
147
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
148
148
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) }, priceText),
|
149
149
|
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) }, (_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费'))),
|
150
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (
|
150
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_p = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _p !== void 0 ? _p : 'Shop now')),
|
151
151
|
productInfoText({ isPost }))),
|
152
152
|
React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
153
153
|
};
|
@@ -27,8 +27,8 @@ const Prompt = (_a) => {
|
|
27
27
|
};
|
28
28
|
return (React.createElement("div", Object.assign({ className: `pb-prompt ${css(Object.assign({}, style))}` }, props),
|
29
29
|
React.createElement("div", { className: 'pb-prompt-icon' },
|
30
|
-
React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : success })),
|
30
|
+
React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : success, alt: 'success image' })),
|
31
31
|
React.createElement("div", { className: 'pb-prompt-content' }, content),
|
32
|
-
React.createElement("button", { className: 'pb-prompt-btn', style: submitButtonStyle, onClick: handleOk }, btnText)));
|
32
|
+
React.createElement("button", { "aria-label": btnText, className: 'pb-prompt-btn', style: submitButtonStyle, onClick: handleOk }, btnText)));
|
33
33
|
};
|
34
34
|
export default memo(Prompt);
|
@@ -10,7 +10,7 @@ const Appoint = (_a) => {
|
|
10
10
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
11
11
|
return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
|
12
12
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
13
|
-
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, alt: '' })),
|
13
|
+
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, alt: 'cta image' })),
|
14
14
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_e = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _e !== void 0 ? _e : 'Product Name')));
|
15
15
|
};
|
16
16
|
export default memo(Appoint);
|
@@ -56,7 +56,7 @@ const Consent = ({ width = window.innerWidth, height = window.innerHeight, priva
|
|
56
56
|
react_1.default.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
|
57
57
|
react_1.default.createElement("div", { className: 'consent-content' }, privacy_context !== null && privacy_context !== void 0 ? privacy_context : 'This site uses cookies to improve your online experience. By continuing to use the site please agree the policy first.')),
|
58
58
|
react_1.default.createElement("div", { className: 'consent-col' },
|
59
|
-
react_1.default.createElement("button", { className: 'consent-btn', onClick: handleAgree }, "Agree"),
|
60
|
-
react_1.default.createElement("a", { className: 'consent-policy', target: '_blank', href: privacy_policy_url }, privacy_policy_title !== null && privacy_policy_title !== void 0 ? privacy_policy_title : 'More information')))));
|
59
|
+
react_1.default.createElement("button", { "aria-label": 'agree', className: 'consent-btn', onClick: handleAgree }, "Agree"),
|
60
|
+
react_1.default.createElement("a", { className: 'consent-policy', target: '_blank', href: privacy_policy_url ? `https://${privacy_policy_url}` : undefined }, privacy_policy_title !== null && privacy_policy_title !== void 0 ? privacy_policy_title : 'More information')))));
|
61
61
|
};
|
62
62
|
exports.default = (0, react_1.memo)(Consent);
|
@@ -175,7 +175,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
175
175
|
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
176
176
|
return null;
|
177
177
|
}
|
178
|
-
return (react_1.default.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image }));
|
178
|
+
return (react_1.default.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'video poster' }));
|
179
179
|
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
180
180
|
(0, react_1.useEffect)(() => {
|
181
181
|
const handleBeforeUnload = () => {
|
@@ -224,7 +224,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
224
224
|
height,
|
225
225
|
objectFit: 'contain'
|
226
226
|
} }),
|
227
|
-
react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
227
|
+
react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'video pause image' }))),
|
228
228
|
renderPoster)) : (react_1.default.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, onClick: handleClickVideo(), style: {
|
229
229
|
position: 'relative',
|
230
230
|
width,
|
@@ -233,6 +233,6 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
233
233
|
} },
|
234
234
|
react_1.default.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', style: { width: '100%' }, ref: videoRef, crossOrigin: 'anonymous', muted: true, autoPlay: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
|
235
235
|
renderPoster,
|
236
|
-
react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
236
|
+
react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'video pause image' })))));
|
237
237
|
};
|
238
238
|
exports.default = (0, react_1.memo)(VideoWidget);
|
@@ -17,6 +17,6 @@ const FingerSwipeTip = ({ imageUrl, style }) => {
|
|
17
17
|
return show ? 'pb-fadeIn' : 'pb-fadeOut';
|
18
18
|
}, [show]);
|
19
19
|
return (react_1.default.createElement("div", { hidden: !show, className: `pb-finger-wrap ${animationCls}`, style: style },
|
20
|
-
react_1.default.createElement("img", { src: imageUrl || FINGER_SWIPE_ICON })));
|
20
|
+
react_1.default.createElement("img", { src: imageUrl || FINGER_SWIPE_ICON, alt: 'finger swiper' })));
|
21
21
|
};
|
22
22
|
exports.default = FingerSwipeTip;
|
@@ -25,8 +25,8 @@ const FormatImage = (0, react_1.forwardRef)((props, ref) => {
|
|
25
25
|
react_1.default.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
|
26
26
|
react_1.default.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
|
27
27
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
28
|
-
} }))) : (react_1.default.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
|
28
|
+
}, alt: 'image' }))) : (react_1.default.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
|
29
29
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
30
|
-
} }))));
|
30
|
+
}, alt: 'image' }))));
|
31
31
|
});
|
32
32
|
exports.default = (0, react_1.memo)(FormatImage);
|
@@ -54,7 +54,7 @@ const LikeButton = (_a) => {
|
|
54
54
|
}
|
55
55
|
}
|
56
56
|
}), 200);
|
57
|
-
return (react_1.default.createElement("button", Object.assign({}, props, { onClick: handleClick }),
|
57
|
+
return (react_1.default.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
|
58
58
|
react_1.default.createElement("img", { style: { width: '100%', height: '100%', objectFit: 'contain' }, src: state ? activeIcon || likeIcon : unActicveIcon || unlikeIcon, alt: 'icon' })));
|
59
59
|
};
|
60
60
|
exports.default = (0, react_1.memo)(LikeButton);
|
@@ -7,7 +7,7 @@ const Navbar = ({ icon, styles, textStyle, onClose }) => {
|
|
7
7
|
var _a;
|
8
8
|
const { waterFallData, setOpenHashtag } = (0, hooks_1.useSxpDataSource)();
|
9
9
|
return (react_1.default.createElement("div", { className: 'clc-sxp-nav', style: styles },
|
10
|
-
react_1.default.createElement("img", { className: 'clc-sxp-nav-left', src: icon, alt: '', onClick: onClose }),
|
10
|
+
react_1.default.createElement("img", { className: 'clc-sxp-nav-left', src: icon, alt: 'back button', onClick: onClose }),
|
11
11
|
react_1.default.createElement("div", { className: 'clc-sxp-nav-title', style: textStyle }, `#${(_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag) !== null && _a !== void 0 ? _a : '标题'}`)));
|
12
12
|
};
|
13
13
|
exports.default = (0, react_1.memo)(Navbar);
|
@@ -11,7 +11,7 @@ const Nudge = ({ nudge }) => {
|
|
11
11
|
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
12
12
|
borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
|
13
13
|
} },
|
14
|
-
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? react_1.default.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover', flexShrink: 0 } }) : null,
|
14
|
+
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? (react_1.default.createElement("img", { src: nudge.icon, alt: 'nudge icon', style: { height: '100%', objectFit: 'cover', flexShrink: 0 } })) : null,
|
15
15
|
react_1.default.createElement("p", { style: Object.assign(Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle), { textWrap: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', flex: 1, marginBottom: 0 }) }, (_g = nudge === null || nudge === void 0 ? void 0 : nudge.content) !== null && _g !== void 0 ? _g : '')))));
|
16
16
|
};
|
17
17
|
exports.default = Nudge;
|
@@ -5,13 +5,12 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const hooks_1 = require("../../../core/hooks");
|
6
6
|
const event_1 = tslib_1.__importStar(require("../../../core/utils/event"));
|
7
7
|
const useEventReport_1 = require("../../../core/hooks/useEventReport");
|
8
|
-
const
|
8
|
+
const SxpDataSourceProvider_1 = require("../../../core/context/SxpDataSourceProvider");
|
9
9
|
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
10
|
-
const
|
11
|
-
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData, bffEventReport } = (0, hooks_1.useSxpDataSource)();
|
10
|
+
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData, bffEventReport, selectTag, setSelectTag } = (0, hooks_1.useSxpDataSource)();
|
12
11
|
const { backMainFeed } = (0, useEventReport_1.useEventReport)();
|
13
12
|
const realTagList = (0, react_1.useMemo)(() => {
|
14
|
-
return [DEFAULT_TAG, ...tagList];
|
13
|
+
return [SxpDataSourceProvider_1.DEFAULT_TAG, ...tagList];
|
15
14
|
}, [tagList]);
|
16
15
|
const handleSelectTag = (tag) => () => {
|
17
16
|
if (tag === selectTag)
|
@@ -21,15 +20,15 @@ const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
|
21
20
|
eventInfo: {
|
22
21
|
eventSubject: 'clickThemeTagsViewContents',
|
23
22
|
eventDescription: 'click Theme Tags View Contents',
|
24
|
-
themeTags: `[${tag}]`
|
23
|
+
themeTags: `['${tag}']`
|
25
24
|
}
|
26
25
|
});
|
27
26
|
}
|
28
27
|
else {
|
29
|
-
backMainFeed('theme', selectTag);
|
28
|
+
backMainFeed('theme', tag, selectTag);
|
30
29
|
}
|
31
30
|
let themeTag;
|
32
|
-
if (tag !== DEFAULT_TAG) {
|
31
|
+
if (tag !== SxpDataSourceProvider_1.DEFAULT_TAG) {
|
33
32
|
themeTag = tag;
|
34
33
|
}
|
35
34
|
setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
|
@@ -44,7 +43,7 @@ const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
|
44
43
|
}).finally(() => {
|
45
44
|
setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
|
46
45
|
});
|
47
|
-
setSelectTag(tag);
|
46
|
+
setSelectTag === null || setSelectTag === void 0 ? void 0 : setSelectTag(tag);
|
48
47
|
};
|
49
48
|
if (waterFallData || tagList.length <= 0)
|
50
49
|
return null;
|
@@ -10,7 +10,7 @@ const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style
|
|
10
10
|
setIsTure(result);
|
11
11
|
onChange === null || onChange === void 0 ? void 0 : onChange(result);
|
12
12
|
};
|
13
|
-
return (react_1.default.createElement("button", { style: style, className: 'pb-toggle-button', onClick: handleClick },
|
14
|
-
react_1.default.createElement("img", { className: 'pb-toggle-button-icon', src: isTrue ? activeIcon : unactiveIcon })));
|
13
|
+
return (react_1.default.createElement("button", { style: style, "aria-label": 'toggle button', className: 'pb-toggle-button', onClick: handleClick },
|
14
|
+
react_1.default.createElement("img", { className: 'pb-toggle-button-icon', alt: 'toggle image', src: isTrue ? activeIcon : unactiveIcon })));
|
15
15
|
};
|
16
16
|
exports.default = (0, react_1.memo)(ToggleButton);
|
@@ -251,7 +251,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
251
251
|
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
252
252
|
return null;
|
253
253
|
}
|
254
|
-
return (react_1.default.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image }));
|
254
|
+
return (react_1.default.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'placeholder image' }));
|
255
255
|
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
256
256
|
(0, react_1.useEffect)(() => {
|
257
257
|
if (!videoRef)
|
@@ -284,7 +284,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
284
284
|
} },
|
285
285
|
react_1.default.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
|
286
286
|
react_1.default.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
|
287
|
-
react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
287
|
+
react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', alt: 'pause', src: PAUSE_ICON }))),
|
288
288
|
renderPoster)) : (react_1.default.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, style: {
|
289
289
|
position: 'relative',
|
290
290
|
width: '100%',
|
@@ -293,6 +293,6 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
293
293
|
}, onClick: handleClickVideo() },
|
294
294
|
react_1.default.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
|
295
295
|
renderPoster,
|
296
|
-
react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
296
|
+
react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'pause' })))));
|
297
297
|
};
|
298
298
|
exports.default = (0, react_1.memo)(VideoWidget);
|
@@ -116,7 +116,7 @@ const WaterfallFlowItem = (props) => {
|
|
116
116
|
react_1.default.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText }, priceText))));
|
117
117
|
};
|
118
118
|
function WaterfallList(_a) {
|
119
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
119
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
120
120
|
var { reportTagsView, showBanner } = _a, props = tslib_1.__rest(_a, ["reportTagsView", "showBanner"]);
|
121
121
|
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = (0, hooks_1.useSxpDataSource)();
|
122
122
|
const [list, setList] = (0, react_1.useState)();
|
@@ -189,6 +189,6 @@ function WaterfallList(_a) {
|
|
189
189
|
} })),
|
190
190
|
react_1.default.createElement("div", { className: 'list-bottom', hidden: !((_o = data === null || data === void 0 ? void 0 : data.tag) === null || _o === void 0 ? void 0 : _o.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
|
191
191
|
react_1.default.createElement("div", { hidden: !((_p = data === null || data === void 0 ? void 0 : data.tag) === null || _p === void 0 ? void 0 : _p.link), className: 'list-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
|
192
|
-
react_1.default.createElement("button", { className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((
|
192
|
+
react_1.default.createElement("button", { "aria-label": ((_q = data === null || data === void 0 ? void 0 : data.tag) === null || _q === void 0 ? void 0 : _q.linkTitle) || 'Shop the collection', className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_r = data === null || data === void 0 ? void 0 : data.tag) === null || _r === void 0 ? void 0 : _r.linkTitle) || 'Shop the collection'))))));
|
193
193
|
}
|
194
194
|
exports.default = WaterfallList;
|
@@ -73,56 +73,24 @@ const WaterfallFlowItem = (props) => {
|
|
73
73
|
if (imgDom.current === null || src === '') {
|
74
74
|
return;
|
75
75
|
}
|
76
|
-
|
76
|
+
let imgSrc = null;
|
77
77
|
if (showVideo && firstFrameSrc) {
|
78
|
-
|
78
|
+
imgSrc = firstFrameSrc;
|
79
79
|
}
|
80
80
|
else {
|
81
|
-
|
81
|
+
imgSrc = src;
|
82
82
|
}
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
}, [src, showVideo, firstFrameSrc, isImgShow]);
|
92
|
-
(0, react_1.useEffect)(() => {
|
93
|
-
const height = imgInfo.height * (unitWidth / imgInfo.width);
|
94
|
-
if (isLoading) {
|
83
|
+
if (imgSrc)
|
84
|
+
imgDom.current.setSrc(imgSrc);
|
85
|
+
}, [src, showVideo, firstFrameSrc]);
|
86
|
+
const pictRef = (0, react_1.useRef)();
|
87
|
+
const imgLoad = (0, react_1.useCallback)((img) => {
|
88
|
+
setTimeout(() => {
|
89
|
+
var _a;
|
90
|
+
const height = (_a = pictRef === null || pictRef === void 0 ? void 0 : pictRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight;
|
95
91
|
sizeChange(height + 56 + space, index);
|
96
|
-
}
|
97
|
-
}, [
|
98
|
-
const calculateHeightForWidth = (videoWidth, videoHeight, targetWidth) => {
|
99
|
-
const aspectRatio = videoWidth / videoHeight;
|
100
|
-
const targetHeight = targetWidth / aspectRatio;
|
101
|
-
return targetHeight;
|
102
|
-
};
|
103
|
-
(0, react_1.useEffect)(() => {
|
104
|
-
const video = videoDom === null || videoDom === void 0 ? void 0 : videoDom.current;
|
105
|
-
if (video === null || src === '' || !showVideo) {
|
106
|
-
return;
|
107
|
-
}
|
108
|
-
video.src = src;
|
109
|
-
video.currentTime = 1;
|
110
|
-
video.crossOrigin = 'anonymous';
|
111
|
-
video.onloadeddata = () => {
|
112
|
-
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
113
|
-
if (!canvas)
|
114
|
-
return;
|
115
|
-
const ctx = canvas.getContext('2d');
|
116
|
-
const targetWidth = (window === null || window === void 0 ? void 0 : window.innerWidth) / 2;
|
117
|
-
const targetHeight = calculateHeightForWidth(video.videoWidth, video.videoHeight, targetWidth);
|
118
|
-
canvas.height = targetHeight;
|
119
|
-
canvas.width = targetWidth;
|
120
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
121
|
-
setFirstFrameSrc(canvas.toDataURL());
|
122
|
-
video.remove();
|
123
|
-
canvas.remove();
|
124
|
-
};
|
125
|
-
}, [src, showVideo]);
|
92
|
+
}, 0);
|
93
|
+
}, [space, sizeChange, index, unitWidth, pictRef]);
|
126
94
|
const handleClickToDetail = () => {
|
127
95
|
reportTagsView();
|
128
96
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(list);
|
@@ -133,17 +101,14 @@ const WaterfallFlowItem = (props) => {
|
|
133
101
|
}, 0);
|
134
102
|
};
|
135
103
|
return (react_1.default.createElement("div", { ref: ref, style: Object.assign({}, style), className: 'waterFallList-content-listItem', key: index, onClick: handleClickToDetail },
|
136
|
-
react_1.default.createElement("div", { className: 'waterFallList-content-listItem-picture' },
|
137
|
-
|
138
|
-
react_1.default.createElement("video", { ref: videoDom, src: src, crossOrigin: 'anonymous', className: 'waterFallList-content-listItem-picture-img' }),
|
139
|
-
react_1.default.createElement("canvas", { ref: canvasRef }))),
|
140
|
-
react_1.default.createElement(FormatImage_1.default, { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', ref: imgDom })),
|
104
|
+
react_1.default.createElement("div", { className: 'waterFallList-content-listItem-picture', ref: pictRef },
|
105
|
+
react_1.default.createElement(FormatImage_1.default, { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', onLoad: imgLoad, ref: imgDom })),
|
141
106
|
react_1.default.createElement("div", { className: 'waterFallList-content-listItem-info' },
|
142
107
|
react_1.default.createElement("div", { className: `${'waterFallList-content-listItem-info-title'} ${priceText ? 'waterFallList-content-listItem-info-nowrap' : ''}`, style: Object.assign({}, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title) }, title && title),
|
143
108
|
react_1.default.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price }, priceText))));
|
144
109
|
};
|
145
110
|
function WaterfallList(_a) {
|
146
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
111
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
147
112
|
var { reportTagsView, showBanner } = _a, props = tslib_1.__rest(_a, ["reportTagsView", "showBanner"]);
|
148
113
|
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = (0, hooks_1.useSxpDataSource)();
|
149
114
|
const scrollParent = (0, react_1.useRef)(null);
|
@@ -339,6 +304,6 @@ function WaterfallList(_a) {
|
|
339
304
|
} }))),
|
340
305
|
react_1.default.createElement("div", { className: 'waterFallList-bottom', hidden: !((_t = data === null || data === void 0 ? void 0 : data.tag) === null || _t === void 0 ? void 0 : _t.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
|
341
306
|
react_1.default.createElement("div", { ref: buttonRef, hidden: !((_u = data === null || data === void 0 ? void 0 : data.tag) === null || _u === void 0 ? void 0 : _u.link), className: 'waterFallList-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
|
342
|
-
react_1.default.createElement("button", { className: 'waterFallList-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((
|
307
|
+
react_1.default.createElement("button", { "aria-label": ((_v = data === null || data === void 0 ? void 0 : data.tag) === null || _v === void 0 ? void 0 : _v.linkTitle) || 'Shop the collection', className: 'waterFallList-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_w = data === null || data === void 0 ? void 0 : data.tag) === null || _w === void 0 ? void 0 : _w.linkTitle) || 'Shop the collection'))))));
|
343
308
|
}
|
344
309
|
exports.default = WaterfallList;
|
@@ -13,7 +13,7 @@ const hooks_1 = require("../../../../core/hooks");
|
|
13
13
|
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
14
14
|
const WaterFall = (props) => {
|
15
15
|
var _a;
|
16
|
-
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag } = (0, hooks_1.useSxpDataSource)();
|
16
|
+
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag } = (0, hooks_1.useSxpDataSource)();
|
17
17
|
const { backMainFeed } = (0, useEventReport_1.useEventReport)();
|
18
18
|
const ref = (0, react_1.useRef)(null);
|
19
19
|
const modalEleRef = (0, react_1.useRef)(null);
|
@@ -35,9 +35,7 @@ const WaterFall = (props) => {
|
|
35
35
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|
36
36
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
|
37
37
|
}
|
38
|
-
|
39
|
-
backMainFeed('branch', themeTag === null || themeTag === void 0 ? void 0 : themeTag.current, waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag);
|
40
|
-
}
|
38
|
+
backMainFeed('branch', selectTag, undefined, waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag);
|
41
39
|
reportTagsView();
|
42
40
|
setWaterFallData === null || setWaterFallData === void 0 ? void 0 : setWaterFallData(undefined);
|
43
41
|
setIsFromHashtag === null || setIsFromHashtag === void 0 ? void 0 : setIsFromHashtag(false);
|
@@ -34,7 +34,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
34
34
|
const viewTime = (0, react_1.useRef)();
|
35
35
|
const [isLoadMore, setIsLoadMore] = (0, react_1.useState)(false);
|
36
36
|
const [isShowMore, setIsShowMore] = (0, react_1.useState)(false);
|
37
|
-
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink } = (0, hooks_1.useSxpDataSource)();
|
37
|
+
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag } = (0, hooks_1.useSxpDataSource)();
|
38
38
|
const { backMainFeed } = (0, useEventReport_1.useEventReport)();
|
39
39
|
const [videoRef, setVideoRef] = (0, react_1.useState)(null);
|
40
40
|
const playerRef = (0, react_1.useRef)();
|
@@ -42,21 +42,29 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
42
42
|
const isShowFingerTip = (0, react_1.useMemo)(() => {
|
43
43
|
return data.length > 0 && !loading && (0, localStore_1.getFeUserId)();
|
44
44
|
}, [data, loading]);
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
(0, react_1.useEffect)(() => {
|
46
|
+
(0, sessionStore_1.refreshFeSessionId)();
|
47
|
+
}, []);
|
48
|
+
(0, react_1.useEffect)(() => {
|
49
|
+
if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
|
50
|
+
const now = new Date();
|
51
|
+
viewTime.current = now;
|
52
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
53
|
+
eventName: 'PageView'
|
54
|
+
});
|
48
55
|
}
|
56
|
+
}, [data === null || data === void 0 ? void 0 : data.length]);
|
57
|
+
const handleH5EnterLink = (0, react_1.useCallback)(() => {
|
49
58
|
(0, sessionStore_1.refreshFeSessionId)();
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
59
|
+
h5EnterLink === null || h5EnterLink === void 0 ? void 0 : h5EnterLink();
|
60
|
+
if (data.length > 0) {
|
61
|
+
const now = new Date();
|
62
|
+
viewTime.current = now;
|
63
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
64
|
+
eventName: 'PageView'
|
65
|
+
});
|
54
66
|
}
|
55
|
-
|
56
|
-
eventName: 'PageView'
|
57
|
-
});
|
58
|
-
setIsInit(true);
|
59
|
-
}, [data.length, bffFbReport, h5EnterLink, isInit]);
|
67
|
+
}, [data.length, bffFbReport, h5EnterLink]);
|
60
68
|
const firstRef = (0, react_1.useRef)();
|
61
69
|
(0, react_1.useEffect)(() => {
|
62
70
|
var _a, _b, _c, _d;
|
@@ -84,10 +92,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
84
92
|
});
|
85
93
|
}
|
86
94
|
}, [videoRef, licenseUrl, data]);
|
87
|
-
(0, react_1.useEffect)(() => {
|
88
|
-
if (!isInit)
|
89
|
-
handleH5EnterLink();
|
90
|
-
}, [handleH5EnterLink, isInit]);
|
91
95
|
(0, react_1.useEffect)(() => {
|
92
96
|
var _a;
|
93
97
|
const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
|
@@ -108,8 +112,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
108
112
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
109
113
|
const visibleChange = () => {
|
110
114
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
115
|
+
const repCond = !openHashtag && !isShowConsent;
|
111
116
|
if (document.visibilityState === 'hidden') {
|
112
|
-
if (
|
117
|
+
if (repCond) {
|
113
118
|
event_1.default.emit(event_1.SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
|
114
119
|
handleReportViewImageEnd(item);
|
115
120
|
handleReportProductView(item);
|
@@ -149,11 +154,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
149
154
|
}
|
150
155
|
else if (document.visibilityState === 'visible') {
|
151
156
|
handleH5EnterLink();
|
152
|
-
if (
|
157
|
+
if (repCond) {
|
153
158
|
handleViewImageStartEvent(activeIndex);
|
154
159
|
event_1.default.emit(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
160
|
+
backMainFeed('external', selectTag);
|
155
161
|
}
|
156
|
-
backMainFeed('external');
|
157
162
|
}
|
158
163
|
};
|
159
164
|
document.addEventListener('visibilitychange', visibleChange);
|
@@ -170,17 +175,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
170
175
|
tempMap,
|
171
176
|
curTime,
|
172
177
|
backMainFeed,
|
173
|
-
openHashtag
|
178
|
+
openHashtag,
|
179
|
+
isShowConsent,
|
180
|
+
selectTag
|
174
181
|
]);
|
175
|
-
(0, react_1.useEffect)(() => {
|
176
|
-
const initTime = () => {
|
177
|
-
backMainFeed('external');
|
178
|
-
};
|
179
|
-
window.addEventListener('pageshow', initTime);
|
180
|
-
return () => {
|
181
|
-
window.removeEventListener('pageshow', initTime);
|
182
|
-
};
|
183
|
-
}, []);
|
184
182
|
const tagHeight = (0, react_1.useMemo)(() => {
|
185
183
|
let h = 0;
|
186
184
|
if (tagList.length > 0) {
|
@@ -77,6 +77,9 @@ export interface ISxpDataSourceContext {
|
|
77
77
|
curTime?: any;
|
78
78
|
h5EnterLink?: () => void;
|
79
79
|
themeTag?: any;
|
80
|
+
isShowConsent?: boolean;
|
81
|
+
selectTag?: string;
|
82
|
+
setSelectTag?: React.Dispatch<React.SetStateAction<string>>;
|
80
83
|
}
|
81
84
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
82
85
|
export interface SxpDataSourceProviderProps {
|
@@ -115,5 +118,6 @@ export interface SxpDataSourceProviderProps {
|
|
115
118
|
globalConfig?: ISxpPageRenderProps['globalConfig'];
|
116
119
|
isEditor?: boolean;
|
117
120
|
}
|
121
|
+
export declare const DEFAULT_TAG = "FOR U";
|
118
122
|
declare const _default: React.NamedExoticComponent<SxpDataSourceProviderProps>;
|
119
123
|
export default _default;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.SxpDataSourceContext = void 0;
|
3
|
+
exports.DEFAULT_TAG = exports.SxpDataSourceContext = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
6
6
|
const qs_1 = tslib_1.__importDefault(require("qs"));
|
@@ -18,6 +18,7 @@ var DataSourceType;
|
|
18
18
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
19
19
|
})(DataSourceType || (DataSourceType = {}));
|
20
20
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
21
|
+
exports.DEFAULT_TAG = 'FOR U';
|
21
22
|
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false }) => {
|
22
23
|
var _a, _b, _c;
|
23
24
|
const [rtcList, setRtcList] = (0, react_1.useState)([]);
|
@@ -36,6 +37,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
36
37
|
const [videoRef, setVideoRef] = (0, react_1.useState)(null);
|
37
38
|
const themeTag = (0, react_1.useRef)();
|
38
39
|
const curTime = (0, react_1.useRef)();
|
40
|
+
const [selectTag, setSelectTag] = (0, react_1.useState)(exports.DEFAULT_TAG);
|
39
41
|
const isShowConsent = (0, react_1.useMemo)(() => {
|
40
42
|
var _a, _b, _c, _d;
|
41
43
|
return (((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent;
|
@@ -234,8 +236,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
234
236
|
});
|
235
237
|
}, [bffEventReport]);
|
236
238
|
(0, react_1.useEffect)(() => {
|
237
|
-
|
238
|
-
|
239
|
+
if (!isShowConsent)
|
240
|
+
h5EnterLink();
|
241
|
+
}, [isShowConsent]);
|
239
242
|
(0, react_1.useEffect)(() => {
|
240
243
|
if (isShowConsent)
|
241
244
|
return;
|
@@ -314,7 +317,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
314
317
|
setIsAgreePolicy,
|
315
318
|
curTime,
|
316
319
|
h5EnterLink,
|
317
|
-
themeTag
|
320
|
+
themeTag,
|
321
|
+
isShowConsent,
|
322
|
+
selectTag,
|
323
|
+
setSelectTag
|
318
324
|
} }, isShowConsent ? (react_1.default.createElement(Consent_1.default, Object.assign({}, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props))) : (render({
|
319
325
|
rtcList,
|
320
326
|
mutateLike: bffMutateLike,
|
@@ -2,5 +2,5 @@ import { RecItemType } from '../components/SxpPageRender/typing';
|
|
2
2
|
export declare function useEventReport(): {
|
3
3
|
jumpToWeb: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], position?: number) => void;
|
4
4
|
productView: (data?: RecItemType, product?: RecItemType['product'], cta?: RecItemType['cta'], viewTime?: any, position?: number) => void;
|
5
|
-
backMainFeed: (lastFeed
|
5
|
+
backMainFeed: (lastFeed: 'theme' | 'branch' | 'external', selectTag?: string, themeTag?: string, hashTag?: string) => void;
|
6
6
|
};
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useEventReport = void 0;
|
4
4
|
const react_1 = require("react");
|
5
5
|
const useSxpDataSource_1 = require("./useSxpDataSource");
|
6
|
+
const SxpDataSourceProvider_1 = require("../context/SxpDataSourceProvider");
|
6
7
|
function useEventReport() {
|
7
8
|
const { bffEventReport, popupDetailData, waterFallData, isFromHashtag } = (0, useSxpDataSource_1.useSxpDataSource)();
|
8
9
|
const jumpToWeb = (0, react_1.useCallback)((data, product, cta, position) => {
|
@@ -69,16 +70,18 @@ function useEventReport() {
|
|
69
70
|
}
|
70
71
|
});
|
71
72
|
}, [bffEventReport, popupDetailData]);
|
72
|
-
const backMainFeed = (0, react_1.useCallback)((lastFeed, themeTag, hashTag) => {
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
73
|
+
const backMainFeed = (0, react_1.useCallback)((lastFeed, selectTag, themeTag, hashTag) => {
|
74
|
+
if (selectTag && selectTag === SxpDataSourceProvider_1.DEFAULT_TAG) {
|
75
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
76
|
+
eventInfo: {
|
77
|
+
lastFeed,
|
78
|
+
themeTags: themeTag ? `['${themeTag}']` : '',
|
79
|
+
hashTags: hashTag ? `['${hashTag}']` : '',
|
80
|
+
eventSubject: 'backMainFeed',
|
81
|
+
eventDescription: 'back Main Feed'
|
82
|
+
}
|
83
|
+
});
|
84
|
+
}
|
82
85
|
}, [bffEventReport]);
|
83
86
|
return {
|
84
87
|
jumpToWeb,
|
@@ -86,6 +86,6 @@ const AppointForm = (_a) => {
|
|
86
86
|
react_1.default.createElement("div", { className: 'pb-appoint-form-container' },
|
87
87
|
react_1.default.createElement(pro_components_1.BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
|
88
88
|
react_1.default.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
|
89
|
-
react_1.default.createElement("button", { onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? react_1.default.createElement(react_1.default.Fragment, null, "loading...") : submitText))));
|
89
|
+
react_1.default.createElement("button", { "aria-label": submitText, onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? react_1.default.createElement(react_1.default.Fragment, null, "loading...") : submitText))));
|
90
90
|
};
|
91
91
|
exports.default = (0, react_1.memo)(AppointForm);
|