pb-sxp-ui 1.17.0 → 1.18.0
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 +396 -324
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +7 -15
- package/dist/index.js +396 -324
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +6 -6
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +396 -324
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +6 -6
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +10 -8
- package/es/core/components/DiyPortalPreview/index.js +3 -5
- package/es/core/components/DiyStoryPreview/index.js +18 -7
- package/es/core/components/SxpPageRender/ExpandableText.js +2 -2
- package/es/core/components/SxpPageRender/LikeButton/index.js +18 -16
- package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -0
- package/es/core/components/SxpPageRender/PictureGroup/index.js +39 -13
- package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/es/core/components/SxpPageRender/RenderCard.js +2 -14
- package/es/core/components/SxpPageRender/VideoWidget/index.js +32 -45
- package/es/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/es/core/components/SxpPageRender/index.js +57 -41
- package/es/core/context/SxpDataSourceProvider.d.ts +5 -12
- package/es/core/context/SxpDataSourceProvider.js +62 -35
- package/es/core/hooks/useEventReport.js +6 -5
- package/es/materials/sxp/consentPopup/Display/index.js +1 -1
- package/es/materials/sxp/cta/AniLinkPopup/material.js +3 -2
- package/es/materials/sxp/popup/CommodityDetail/material.js +2 -1
- package/es/materials/sxp/popup/CommodityList/index.js +5 -4
- package/es/materials/sxp/popup/CommodityList/material.js +1 -1
- package/es/materials/sxp/popup/CommodityList/settingRender.js +1 -1
- package/es/materials/sxp/template/Appoint/material.js +2 -1
- package/es/materials/sxp/template/Commodity/material.js +3 -2
- package/es/materials/sxp/template/CommodityDiro/material.js +3 -2
- package/es/materials/sxp/template/CommodityDiroNew/material.js +4 -2
- package/es/materials/sxp/template/Link/material.js +4 -2
- package/es/materials/sxp/template/MultiCommodity/index.js +1 -1
- package/es/materials/sxp/template/MultiCommodity/material.js +2 -1
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +1 -1
- package/es/materials/sxp/template/MultiCommodityDiro/material.js +3 -2
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +1 -1
- package/es/materials/sxp/template/MultiCommodityDiroNew/material.js +4 -2
- package/es/materials/sxp/template/NineCommodity/material.js +3 -2
- package/es/materials/sxp/template/components/CommodityGroup.js +1 -1
- package/es/materials/sxp/template/components/settingRender.js +1 -1
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +10 -8
- package/lib/core/components/DiyPortalPreview/index.js +3 -5
- package/lib/core/components/DiyStoryPreview/index.js +18 -7
- package/lib/core/components/SxpPageRender/ExpandableText.js +2 -2
- package/lib/core/components/SxpPageRender/LikeButton/index.js +18 -16
- package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -0
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +38 -12
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/lib/core/components/SxpPageRender/RenderCard.js +2 -14
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +32 -45
- package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -3
- package/lib/core/components/SxpPageRender/index.js +57 -41
- package/lib/core/context/SxpDataSourceProvider.d.ts +5 -12
- package/lib/core/context/SxpDataSourceProvider.js +62 -35
- package/lib/core/hooks/useEventReport.js +6 -5
- package/lib/materials/sxp/consentPopup/Display/index.js +1 -1
- package/lib/materials/sxp/cta/AniLinkPopup/material.js +2 -1
- package/lib/materials/sxp/popup/CommodityDetail/material.js +2 -1
- package/lib/materials/sxp/popup/CommodityList/index.js +5 -4
- package/lib/materials/sxp/popup/CommodityList/material.js +1 -1
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +1 -1
- package/lib/materials/sxp/template/Appoint/material.js +2 -1
- package/lib/materials/sxp/template/Commodity/material.js +3 -2
- package/lib/materials/sxp/template/CommodityDiro/material.js +3 -2
- package/lib/materials/sxp/template/CommodityDiroNew/material.js +4 -2
- package/lib/materials/sxp/template/Link/material.js +4 -2
- package/lib/materials/sxp/template/MultiCommodity/index.js +1 -1
- package/lib/materials/sxp/template/MultiCommodity/material.js +2 -1
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +1 -1
- package/lib/materials/sxp/template/MultiCommodityDiro/material.js +3 -2
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +1 -1
- package/lib/materials/sxp/template/MultiCommodityDiroNew/material.js +4 -2
- package/lib/materials/sxp/template/NineCommodity/material.js +3 -2
- package/lib/materials/sxp/template/components/CommodityGroup.js +1 -1
- package/lib/materials/sxp/template/components/settingRender.js +1 -1
- package/package.json +1 -1
@@ -19,11 +19,12 @@ const MultiCommodityDiro = createMaterial(MultiCommodityDiroComponent, {
|
|
19
19
|
borderRadius: 3,
|
20
20
|
width: 60,
|
21
21
|
height: 60,
|
22
|
-
|
22
|
+
marginRight: 8
|
23
23
|
},
|
24
24
|
title: {
|
25
25
|
fontSize: 12,
|
26
|
-
color: '#000'
|
26
|
+
color: '#000',
|
27
|
+
textAlign: 'left'
|
27
28
|
},
|
28
29
|
ctaTitle: {
|
29
30
|
fontSize: 10,
|
@@ -15,7 +15,7 @@ const MultiCommodityDiroNew = (_a) => {
|
|
15
15
|
const [products] = useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
16
16
|
return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
17
17
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
18
|
-
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0,
|
18
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
19
19
|
React.createElement(EventProvider, Object.assign({ rec: recData, multItem: item, multiCheckIndex: itemIndex, index: index }, props),
|
20
20
|
React.createElement(Img, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
|
21
21
|
React.createElement("div", { className: css({
|
@@ -19,17 +19,19 @@ const MultiCommodityDiroNew = createMaterial(MultiCommodityDiroNewComponent, {
|
|
19
19
|
borderRadius: 8,
|
20
20
|
width: 78,
|
21
21
|
height: 78,
|
22
|
-
|
22
|
+
marginRight: 16
|
23
23
|
},
|
24
24
|
title: {
|
25
25
|
fontSize: 12,
|
26
|
-
color: '#000'
|
26
|
+
color: '#000',
|
27
|
+
textAlign: 'left'
|
27
28
|
},
|
28
29
|
ctaTitle: {
|
29
30
|
textDecoration: 'underline',
|
30
31
|
fontSize: 12,
|
31
32
|
fontWeight: 'bold',
|
32
33
|
color: '#000',
|
34
|
+
textAlign: 'left',
|
33
35
|
width: 150,
|
34
36
|
height: 20
|
35
37
|
}
|
@@ -19,11 +19,12 @@ const NineCommodity = createMaterial(NineCommodityComponent, {
|
|
19
19
|
borderRadius: 3,
|
20
20
|
width: 60,
|
21
21
|
height: 60,
|
22
|
-
|
22
|
+
marginRight: 8
|
23
23
|
},
|
24
24
|
title: {
|
25
25
|
fontSize: 12,
|
26
|
-
color: '#fff'
|
26
|
+
color: '#fff',
|
27
|
+
textAlign: 'left'
|
27
28
|
},
|
28
29
|
ctaTitle: {
|
29
30
|
fontSize: 10,
|
@@ -21,7 +21,7 @@ const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailDat
|
|
21
21
|
return (React.createElement(React.Fragment, null, (item === null || item === void 0 ? void 0 : item.bindCta) ? (React.createElement(SwiperSlide, { className: css({
|
22
22
|
width: '50px',
|
23
23
|
height: '50px',
|
24
|
-
|
24
|
+
marginRight: '10px'
|
25
25
|
}), onClick: () => {
|
26
26
|
handleClick(item, index);
|
27
27
|
}, key: index },
|
@@ -25,7 +25,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
25
25
|
}, []);
|
26
26
|
const PAUSE_ICON = (0, useIconLink_1.useIconLink)('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
27
27
|
const handlePlaying = (0, react_1.useCallback)(() => {
|
28
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
29
29
|
setIsPauseVideo(false);
|
30
30
|
const item = data[index];
|
31
31
|
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
@@ -38,14 +38,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
38
38
|
eventSubject: 'playVideo',
|
39
39
|
eventDescription: 'User played the video',
|
40
40
|
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
41
|
-
|
41
|
+
sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
|
42
|
+
contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
|
42
43
|
playType,
|
43
44
|
startTime: videoCurrentTime,
|
44
45
|
videoDuration,
|
45
|
-
contentTags: JSON.stringify((
|
46
|
+
contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
|
46
47
|
position: index + '',
|
47
48
|
contentFormat: 'video',
|
48
|
-
traceInfo: (
|
49
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
49
50
|
}
|
50
51
|
});
|
51
52
|
setIsFirstPlay(false);
|
@@ -84,7 +85,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
84
85
|
}
|
85
86
|
}, [isLoadFinish]);
|
86
87
|
const onPause = (0, react_1.useCallback)(() => {
|
87
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
88
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
88
89
|
const item = data[index];
|
89
90
|
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
90
91
|
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -95,14 +96,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
95
96
|
eventSubject: 'playOverVideo',
|
96
97
|
eventDescription: 'User finished playing the video',
|
97
98
|
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
98
|
-
|
99
|
+
sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
|
100
|
+
contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
|
99
101
|
endTime: videoCurrentTime,
|
100
102
|
videoDuration,
|
101
103
|
playDuration,
|
102
|
-
contentTags: JSON.stringify((
|
104
|
+
contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
|
103
105
|
position: index + '',
|
104
106
|
contentFormat: 'video',
|
105
|
-
traceInfo: (
|
107
|
+
traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
106
108
|
}
|
107
109
|
});
|
108
110
|
}
|
@@ -62,7 +62,7 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
62
62
|
const CTA = (rec, index) => {
|
63
63
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
|
64
64
|
return (react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
|
65
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER
|
65
|
+
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER })));
|
66
66
|
}
|
67
67
|
return null;
|
68
68
|
};
|
@@ -75,10 +75,8 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
75
75
|
react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
|
76
76
|
CTA(rec, index),
|
77
77
|
react_1.default.createElement("div", null,
|
78
|
-
react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', 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' }) }),
|
79
|
-
|
80
|
-
react_1.default.createElement(Hashtag_1.default, { index: index, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })),
|
81
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLinkPopup'], isActive: true })));
|
78
|
+
react_1.default.createElement(ExpandableText_1.default, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', 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' }) })),
|
79
|
+
react_1.default.createElement(Hashtag_1.default, { index: index, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
|
82
80
|
}
|
83
81
|
return null;
|
84
82
|
};
|
@@ -84,10 +84,21 @@ const DiyStoryPreview = (0, react_1.forwardRef)(({ data = [], globalConfig, tipT
|
|
84
84
|
return null;
|
85
85
|
}, [globalConfig]);
|
86
86
|
const renderBottom = (rec, index) => {
|
87
|
-
var _a, _b, _c, _d;
|
87
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
88
88
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
89
|
+
let cta = null;
|
90
|
+
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) {
|
91
|
+
cta = '多商品CTA';
|
92
|
+
}
|
93
|
+
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
94
|
+
cta = '商品CTA';
|
95
|
+
}
|
96
|
+
else {
|
97
|
+
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;
|
98
|
+
}
|
99
|
+
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
89
100
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
90
|
-
((
|
101
|
+
((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.title) && (react_1.default.createElement("div", { style: {
|
91
102
|
background: 'repeating-linear-gradient(0deg, rgba(26, 26, 25, 0.7), hsla(0, 0%, 100%, 0))',
|
92
103
|
height: '130px',
|
93
104
|
position: 'absolute',
|
@@ -98,7 +109,7 @@ const DiyStoryPreview = (0, react_1.forwardRef)(({ data = [], globalConfig, tipT
|
|
98
109
|
pointerEvents
|
99
110
|
} })),
|
100
111
|
react_1.default.createElement("div", { style: {
|
101
|
-
marginBottom: `${(
|
112
|
+
marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px`,
|
102
113
|
zIndex: 999,
|
103
114
|
position: 'absolute',
|
104
115
|
bottom: 0,
|
@@ -107,11 +118,11 @@ const DiyStoryPreview = (0, react_1.forwardRef)(({ data = [], globalConfig, tipT
|
|
107
118
|
paddingTop: '20px'
|
108
119
|
} },
|
109
120
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (react_1.default.createElement("div", { style: {} },
|
110
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, isActive: index === activeIndex }))) : null,
|
121
|
+
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, isActive: index === activeIndex, value: value }))) : null,
|
111
122
|
react_1.default.createElement("div", null,
|
112
|
-
react_1.default.createElement(ExpandableText_1.default, { isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (
|
113
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLink'], isActive: index === activeIndex }))),
|
114
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
123
|
+
react_1.default.createElement(ExpandableText_1.default, { isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_j = (_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '', 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', padding: '0 20px', fontSize: '12px' }) }),
|
124
|
+
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }))),
|
125
|
+
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
115
126
|
}
|
116
127
|
return null;
|
117
128
|
};
|
@@ -47,7 +47,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
47
47
|
display: '-webkit-box',
|
48
48
|
WebkitBoxOrient: 'vertical'
|
49
49
|
})), { wordBreak: 'break-word', textRendering: 'geometricPrecision', fontKerning: 'none', textSizeAdjust: '100%', boxSizing: 'border-box', contain: 'content' }), dangerouslySetInnerHTML: { __html: (0, tool_1.setFontForText)(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), textStyle) } }),
|
50
|
-
react_1.default.createElement("div", { ref: realRef, style: {
|
50
|
+
isPost && (react_1.default.createElement("div", { ref: realRef, style: {
|
51
51
|
wordBreak: 'break-word',
|
52
52
|
textRendering: 'geometricPrecision',
|
53
53
|
fontKerning: 'none',
|
@@ -58,7 +58,7 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
58
58
|
opacity: 0,
|
59
59
|
clipPath: 'inset(100%)',
|
60
60
|
transform: 'translateX(-9999px)'
|
61
|
-
}, dangerouslySetInnerHTML: { __html: (0, tool_1.setFontForText)(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), textStyle) } }),
|
61
|
+
}, dangerouslySetInnerHTML: { __html: (0, tool_1.setFontForText)(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), textStyle) } })),
|
62
62
|
text && isPost && isShow && (react_1.default.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
|
63
63
|
__html: (0, tool_1.setFontForText)(isShowMore ? unfoldText || 'show less' : foldText || 'show more', textStyle)
|
64
64
|
} }))));
|
@@ -15,60 +15,62 @@ const LikeButton = (_a) => {
|
|
15
15
|
const likeIcon = (0, useIconLink_1.useIconLink)(defaultLikeIconPath);
|
16
16
|
const unlikeIcon = (0, useIconLink_1.useIconLink)(defaultUnLikeIconPath);
|
17
17
|
const handleClick = (0, lodash_1.debounce)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
18
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
18
|
+
var _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;
|
19
19
|
if (state) {
|
20
20
|
setState(false);
|
21
|
-
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({
|
21
|
+
const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ itemId: (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '' })))) !== null && _e !== void 0 ? _e : false;
|
22
22
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
23
23
|
eventInfo: {
|
24
24
|
eventSubject: 'favoriteContentCanceled',
|
25
25
|
eventDescription: 'This content was unfavorite by the user',
|
26
26
|
contentId: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
27
|
-
|
28
|
-
|
27
|
+
sceneId: (_k = (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.scene) === null || _j === void 0 ? void 0 : _j.sceneId) !== null && _k !== void 0 ? _k : '',
|
28
|
+
contentName: (_m = (_l = recData === null || recData === void 0 ? void 0 : recData.video) === null || _l === void 0 ? void 0 : _l.title) !== null && _m !== void 0 ? _m : '',
|
29
|
+
contentTags: JSON.stringify((_p = (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : []),
|
29
30
|
position: position + '',
|
30
|
-
contentFormat: ((
|
31
|
-
traceInfo: (
|
31
|
+
contentFormat: ((_q = recData === null || recData === void 0 ? void 0 : recData.video) === null || _q === void 0 ? void 0 : _q.url) ? 'video' : 'image',
|
32
|
+
traceInfo: (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.traceInfo
|
32
33
|
}
|
33
34
|
});
|
34
35
|
if (!result) {
|
35
36
|
setState(true);
|
36
37
|
}
|
37
38
|
else {
|
38
|
-
const nRtcList = (
|
39
|
+
const nRtcList = (_s = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
39
40
|
if (index === position) {
|
40
41
|
item.isCollected = false;
|
41
42
|
}
|
42
43
|
return item;
|
43
|
-
})) !== null &&
|
44
|
+
})) !== null && _s !== void 0 ? _s : [];
|
44
45
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
45
46
|
}
|
46
47
|
}
|
47
48
|
else {
|
48
49
|
setState(true);
|
49
|
-
const result = (
|
50
|
+
const result = (_v = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData), itemId: (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '' })))) !== null && _v !== void 0 ? _v : false;
|
50
51
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
51
52
|
eventInfo: {
|
52
53
|
eventSubject: 'favoriteContent',
|
53
54
|
eventDescription: 'This content was favorite by the user',
|
54
|
-
contentId: (
|
55
|
-
|
56
|
-
|
55
|
+
contentId: (_x = (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
|
56
|
+
sceneId: (_0 = (_z = (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.scene) === null || _z === void 0 ? void 0 : _z.sceneId) !== null && _0 !== void 0 ? _0 : '',
|
57
|
+
contentName: (_2 = (_1 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _1 === void 0 ? void 0 : _1.title) !== null && _2 !== void 0 ? _2 : '',
|
58
|
+
contentTags: JSON.stringify((_4 = (_3 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _3 === void 0 ? void 0 : _3.tags) !== null && _4 !== void 0 ? _4 : []),
|
57
59
|
position: position + '',
|
58
|
-
contentFormat: ((
|
59
|
-
traceInfo: (
|
60
|
+
contentFormat: ((_5 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _5 === void 0 ? void 0 : _5.url) ? 'video' : 'image',
|
61
|
+
traceInfo: (_6 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _6 === void 0 ? void 0 : _6.traceInfo
|
60
62
|
}
|
61
63
|
});
|
62
64
|
if (!result) {
|
63
65
|
setState(false);
|
64
66
|
}
|
65
67
|
else {
|
66
|
-
const nRtcList = (
|
68
|
+
const nRtcList = (_7 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
|
67
69
|
if (index === position) {
|
68
70
|
item.isCollected = true;
|
69
71
|
}
|
70
72
|
return item;
|
71
|
-
})) !== null &&
|
73
|
+
})) !== null && _7 !== void 0 ? _7 : [];
|
72
74
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
|
73
75
|
}
|
74
76
|
}
|
@@ -12,6 +12,11 @@ interface IPictureGroupProps {
|
|
12
12
|
loadTime: string;
|
13
13
|
}, enableCapi?: boolean) => void;
|
14
14
|
imgUrlsPostConfig?: postConfigType;
|
15
|
+
data: RecItemType[];
|
16
|
+
swiperRef?: any;
|
17
|
+
}
|
18
|
+
export interface IPictureGroupRef {
|
19
|
+
setLoopPlay: (v: boolean) => void;
|
15
20
|
}
|
16
21
|
declare const _default: React.NamedExoticComponent<IPictureGroupProps>;
|
17
22
|
export default _default;
|
@@ -4,24 +4,50 @@ const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
5
5
|
const modules_1 = require("swiper/modules");
|
6
6
|
const react_2 = require("swiper/react");
|
7
|
+
const css_1 = require("@emotion/css");
|
7
8
|
const Picture_1 = tslib_1.__importDefault(require("./Picture"));
|
8
9
|
const hooks_1 = require("../../../../core/hooks");
|
9
|
-
const css_1 = require("@emotion/css");
|
10
10
|
const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
|
11
11
|
const tool_1 = require("../../../../core/utils/tool");
|
12
|
-
const PictureGroup = ({ imgUrls,
|
12
|
+
const PictureGroup = (0, react_1.forwardRef)(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
|
13
13
|
var _a, _b;
|
14
14
|
const { isActive } = (0, react_2.useSwiperSlide)();
|
15
|
-
const {
|
15
|
+
const { firstRtcList, openHashtag, isDiyH5 } = (0, hooks_1.useSxpDataSource)();
|
16
16
|
const [isLoad, setIsLoad] = (0, react_1.useState)(false);
|
17
17
|
const [imgInfo, setImgInfo] = (0, react_1.useState)();
|
18
18
|
const [swiperActiveIndex, setSwiperActiveIndex] = (0, react_1.useState)(0);
|
19
|
-
const
|
19
|
+
const imgsSwiperRef = (0, react_1.useRef)();
|
20
20
|
const isFirstPlayRef = (0, react_1.useRef)(true);
|
21
|
+
const loopPlayRef = (0, react_1.useRef)(true);
|
21
22
|
const initTime = new Date();
|
23
|
+
(0, react_1.useImperativeHandle)(ref, () => {
|
24
|
+
return {
|
25
|
+
setLoopPlay(v) {
|
26
|
+
loopPlayRef.current = v;
|
27
|
+
}
|
28
|
+
};
|
29
|
+
});
|
30
|
+
(0, react_1.useEffect)(() => {
|
31
|
+
let timerId;
|
32
|
+
if (isLoad && isActive && isDiyH5) {
|
33
|
+
timerId = setTimeout(() => {
|
34
|
+
var _a, _b, _c, _d;
|
35
|
+
if (!loopPlayRef.current)
|
36
|
+
return;
|
37
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
38
|
+
const i = (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.activeIndex;
|
39
|
+
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(i + 1);
|
40
|
+
}
|
41
|
+
}, 3000);
|
42
|
+
}
|
43
|
+
return () => {
|
44
|
+
if (timerId)
|
45
|
+
clearTimeout(timerId);
|
46
|
+
};
|
47
|
+
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
22
48
|
(0, react_1.useEffect)(() => {
|
23
49
|
if (isLoad && isActive) {
|
24
|
-
(
|
50
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
|
25
51
|
if (openHashtag) {
|
26
52
|
onViewImageEndEvent(rec);
|
27
53
|
}
|
@@ -31,7 +57,7 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onViewImageEndEvent,
|
|
31
57
|
}
|
32
58
|
}
|
33
59
|
else {
|
34
|
-
(
|
60
|
+
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.stop();
|
35
61
|
}
|
36
62
|
}, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
|
37
63
|
const showFirstImageFn = (0, react_1.useCallback)((e) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
@@ -55,13 +81,13 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onViewImageEndEvent,
|
|
55
81
|
};
|
56
82
|
}, [isActive, imgInfo]);
|
57
83
|
const handleMouseEnter = (0, react_1.useCallback)(() => {
|
58
|
-
if (
|
59
|
-
|
84
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
85
|
+
imgsSwiperRef.current.swiper.autoplay.stop();
|
60
86
|
}
|
61
87
|
}, []);
|
62
88
|
const handleMouseLeave = (0, react_1.useCallback)(() => {
|
63
|
-
if (
|
64
|
-
|
89
|
+
if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
|
90
|
+
imgsSwiperRef.current.swiper.autoplay.start();
|
65
91
|
}
|
66
92
|
}, []);
|
67
93
|
const handleSlideChange = (0, react_1.useCallback)((swiper) => {
|
@@ -82,7 +108,7 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onViewImageEndEvent,
|
|
82
108
|
enabled: true
|
83
109
|
}
|
84
110
|
}
|
85
|
-
: {}), { loop: true, ref:
|
111
|
+
: {}), { loop: true, ref: imgsSwiperRef, onSlideChange: handleSlideChange, className: (0, css_1.css)(Object.assign(Object.assign({ '.swiper-pagination': {
|
86
112
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
87
113
|
fontSize: '14px'
|
88
114
|
} }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
|
@@ -99,5 +125,5 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onViewImageEndEvent,
|
|
99
125
|
return (react_1.default.createElement(react_2.SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
|
100
126
|
react_1.default.createElement(Picture_1.default, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
|
101
127
|
}))));
|
102
|
-
};
|
128
|
+
});
|
103
129
|
exports.default = (0, react_1.memo)(PictureGroup);
|
@@ -6,22 +6,10 @@ require("./index.less");
|
|
6
6
|
const lodash_1 = require("lodash");
|
7
7
|
const withBindDataSource_1 = tslib_1.__importDefault(require("../../../core/hoc/withBindDataSource"));
|
8
8
|
const hooks_1 = require("../../../core/hooks");
|
9
|
-
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive, isNineProduct }) => {
|
10
|
-
var _a, _b, _c, _d, _e;
|
9
|
+
const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive, value, isNineProduct }) => {
|
11
10
|
const { schema } = (0, hooks_1.useEditor)();
|
12
11
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
13
12
|
return null;
|
14
|
-
let cta = null;
|
15
|
-
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) {
|
16
|
-
cta = '多商品CTA';
|
17
|
-
}
|
18
|
-
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
19
|
-
cta = '商品CTA';
|
20
|
-
}
|
21
|
-
else {
|
22
|
-
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;
|
23
|
-
}
|
24
|
-
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
25
13
|
const renderComp = (0, react_1.useMemo)(() => {
|
26
14
|
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;
|
27
15
|
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
|
@@ -46,7 +34,7 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive,
|
|
46
34
|
const sbf = style.backdropFilter;
|
47
35
|
style.backdropFilter = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
|
48
36
|
}
|
49
|
-
return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50,
|
37
|
+
return (react_1.default.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), 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), (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.textStyle), bindDatas: (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.bindDatas) !== null && _1 !== void 0 ? _1 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.props, { event: ((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.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 })));
|
50
38
|
}
|
51
39
|
else {
|
52
40
|
return null;
|