pb-sxp-ui 1.16.11 → 1.16.13
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 +21 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -10
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +21 -10
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/PictureGroup/index.js +3 -5
- package/es/core/components/SxpPageRender/VideoWidget/index.js +2 -4
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.js +2 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +7 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +7 -1
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +3 -5
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +2 -4
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.js +2 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +7 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +7 -1
- package/package.json +1 -1
@@ -10,7 +10,7 @@ import { getScreenReader } from '../../../../core/utils/tool';
|
|
10
10
|
const PictureGroup = forwardRef(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
|
11
11
|
var _a, _b;
|
12
12
|
const { isActive } = useSwiperSlide();
|
13
|
-
const {
|
13
|
+
const { firstRtcList, openHashtag, isDiyH5 } = useSxpDataSource();
|
14
14
|
const [isLoad, setIsLoad] = useState(false);
|
15
15
|
const [imgInfo, setImgInfo] = useState();
|
16
16
|
const [swiperActiveIndex, setSwiperActiveIndex] = useState(0);
|
@@ -32,9 +32,7 @@ const PictureGroup = forwardRef(({ imgUrls, data, height, rec, index, onViewImag
|
|
32
32
|
var _a, _b, _c, _d;
|
33
33
|
if (!loopPlayRef.current)
|
34
34
|
return;
|
35
|
-
if (index
|
36
|
-
}
|
37
|
-
else {
|
35
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
38
36
|
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
37
|
(_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
38
|
}
|
@@ -44,7 +42,7 @@ const PictureGroup = forwardRef(({ imgUrls, data, height, rec, index, onViewImag
|
|
44
42
|
if (timerId)
|
45
43
|
clearTimeout(timerId);
|
46
44
|
};
|
47
|
-
}, [isLoad, isActive, isDiyH5, index, swiperRef]);
|
45
|
+
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
48
46
|
useEffect(() => {
|
49
47
|
if (isLoad && isActive) {
|
50
48
|
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
|
@@ -10,7 +10,7 @@ import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
|
|
10
10
|
const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
|
11
11
|
var _a, _b;
|
12
12
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
13
|
-
const { bffEventReport, sxpParameter,
|
13
|
+
const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
|
14
14
|
const videoStartTime = useRef(0);
|
15
15
|
const [isLoadFinish, setIsLoadFinish] = useState(false);
|
16
16
|
const { isActive } = useSwiperSlide();
|
@@ -84,9 +84,7 @@ const VideoWidget = forwardRef(({ rec, index, height, data, muted, activeIndex,
|
|
84
84
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
85
85
|
if (!loopPlayRef.current)
|
86
86
|
return;
|
87
|
-
if (index
|
88
|
-
}
|
89
|
-
else {
|
87
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
90
88
|
const i = (_c = (_b = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _b === void 0 ? void 0 : _b.swiper) === null || _c === void 0 ? void 0 : _c.activeIndex;
|
91
89
|
(_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(i + 1);
|
92
90
|
}
|
@@ -93,6 +93,7 @@ export interface ISxpDataSourceContext {
|
|
93
93
|
getAccount?: () => Promise<any>;
|
94
94
|
accountSonsent?: (v: boolean) => Promise<boolean>;
|
95
95
|
isDiyH5?: boolean;
|
96
|
+
firstRtcList?: RecItemType[];
|
96
97
|
}
|
97
98
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
98
99
|
export interface SxpDataSourceProviderProps {
|
@@ -680,7 +680,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
680
680
|
refreshFeSession,
|
681
681
|
getAccount,
|
682
682
|
accountSonsent,
|
683
|
-
isDiyH5
|
683
|
+
isDiyH5,
|
684
|
+
firstRtcList
|
684
685
|
} }, isShowConsent ? (React.createElement(Consent, Object.assign({}, (_e = (_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.props))) : (render({
|
685
686
|
rtcList,
|
686
687
|
mutateLike: bffMutateLike,
|
@@ -15,7 +15,7 @@ import { getPriceText } from '../../../../core/utils/materials';
|
|
15
15
|
const CommodityDetail = (_a) => {
|
16
16
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
17
17
|
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
|
18
|
-
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
18
|
+
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig, ctaEvent } = useSxpDataSource();
|
19
19
|
const { jumpToWeb, productView } = useEventReport();
|
20
20
|
const curTimeRef = useRef(null);
|
21
21
|
const [showModal, setShowModal] = useState(false);
|
@@ -41,6 +41,12 @@ const CommodityDetail = (_a) => {
|
|
41
41
|
if (!isPost) {
|
42
42
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
43
43
|
}
|
44
|
+
else {
|
45
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
46
|
+
eventSubject: 'clickCta',
|
47
|
+
eventDescription: 'User clicked the CTA'
|
48
|
+
}, data, product, position);
|
49
|
+
}
|
44
50
|
window.location.href = window.getJointUtmLink(product.link);
|
45
51
|
}
|
46
52
|
};
|
@@ -16,7 +16,7 @@ const CommodityDetailDiroNew = (_a) => {
|
|
16
16
|
var _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;
|
17
17
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
|
18
18
|
const [spread, setSpread] = useState(true);
|
19
|
-
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
19
|
+
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig, ctaEvent } = useSxpDataSource();
|
20
20
|
const { jumpToWeb, productView } = useEventReport();
|
21
21
|
const [stopSlide, setStopSlide] = useState(false);
|
22
22
|
const [isBottom, setIsBottom] = useState(false);
|
@@ -45,6 +45,12 @@ const CommodityDetailDiroNew = (_a) => {
|
|
45
45
|
if (!isPost) {
|
46
46
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
47
47
|
}
|
48
|
+
else {
|
49
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
50
|
+
eventSubject: 'clickCta',
|
51
|
+
eventDescription: 'User clicked the CTA'
|
52
|
+
}, data, product, position);
|
53
|
+
}
|
48
54
|
window.location.href = window.getJointUtmLink(product.link);
|
49
55
|
}
|
50
56
|
};
|
@@ -12,7 +12,7 @@ const tool_1 = require("../../../../core/utils/tool");
|
|
12
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);
|
@@ -34,9 +34,7 @@ const PictureGroup = (0, react_1.forwardRef)(({ imgUrls, data, height, rec, inde
|
|
34
34
|
var _a, _b, _c, _d;
|
35
35
|
if (!loopPlayRef.current)
|
36
36
|
return;
|
37
|
-
if (index
|
38
|
-
}
|
39
|
-
else {
|
37
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
40
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;
|
41
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);
|
42
40
|
}
|
@@ -46,7 +44,7 @@ const PictureGroup = (0, react_1.forwardRef)(({ imgUrls, data, height, rec, inde
|
|
46
44
|
if (timerId)
|
47
45
|
clearTimeout(timerId);
|
48
46
|
};
|
49
|
-
}, [isLoad, isActive, isDiyH5, index, swiperRef]);
|
47
|
+
}, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
|
50
48
|
(0, react_1.useEffect)(() => {
|
51
49
|
if (isLoad && isActive) {
|
52
50
|
(imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
|
@@ -12,7 +12,7 @@ const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
|
|
12
12
|
const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
|
13
13
|
var _a, _b;
|
14
14
|
const [isPauseVideo, setIsPauseVideo] = (0, react_1.useState)(false);
|
15
|
-
const { bffEventReport, sxpParameter,
|
15
|
+
const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = (0, hooks_1.useSxpDataSource)();
|
16
16
|
const videoStartTime = (0, react_1.useRef)(0);
|
17
17
|
const [isLoadFinish, setIsLoadFinish] = (0, react_1.useState)(false);
|
18
18
|
const { isActive } = (0, react_2.useSwiperSlide)();
|
@@ -86,9 +86,7 @@ const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted,
|
|
86
86
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
87
87
|
if (!loopPlayRef.current)
|
88
88
|
return;
|
89
|
-
if (index
|
90
|
-
}
|
91
|
-
else {
|
89
|
+
if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
|
92
90
|
const i = (_c = (_b = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _b === void 0 ? void 0 : _b.swiper) === null || _c === void 0 ? void 0 : _c.activeIndex;
|
93
91
|
(_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(i + 1);
|
94
92
|
}
|
@@ -93,6 +93,7 @@ export interface ISxpDataSourceContext {
|
|
93
93
|
getAccount?: () => Promise<any>;
|
94
94
|
accountSonsent?: (v: boolean) => Promise<boolean>;
|
95
95
|
isDiyH5?: boolean;
|
96
|
+
firstRtcList?: RecItemType[];
|
96
97
|
}
|
97
98
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
98
99
|
export interface SxpDataSourceProviderProps {
|
@@ -683,7 +683,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
683
683
|
refreshFeSession,
|
684
684
|
getAccount,
|
685
685
|
accountSonsent,
|
686
|
-
isDiyH5
|
686
|
+
isDiyH5,
|
687
|
+
firstRtcList
|
687
688
|
} }, isShowConsent ? (react_1.default.createElement(Consent_1.default, Object.assign({}, (_e = (_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.props))) : (render({
|
688
689
|
rtcList,
|
689
690
|
mutateLike: bffMutateLike,
|
@@ -17,7 +17,7 @@ const materials_1 = require("../../../../core/utils/materials");
|
|
17
17
|
const CommodityDetail = (_a) => {
|
18
18
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
19
19
|
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
|
20
|
-
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = (0, hooks_1.useSxpDataSource)();
|
20
|
+
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig, ctaEvent } = (0, hooks_1.useSxpDataSource)();
|
21
21
|
const { jumpToWeb, productView } = (0, useEventReport_1.useEventReport)();
|
22
22
|
const curTimeRef = (0, react_1.useRef)(null);
|
23
23
|
const [showModal, setShowModal] = (0, react_1.useState)(false);
|
@@ -43,6 +43,12 @@ const CommodityDetail = (_a) => {
|
|
43
43
|
if (!isPost) {
|
44
44
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
45
45
|
}
|
46
|
+
else {
|
47
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
48
|
+
eventSubject: 'clickCta',
|
49
|
+
eventDescription: 'User clicked the CTA'
|
50
|
+
}, data, product, position);
|
51
|
+
}
|
46
52
|
window.location.href = window.getJointUtmLink(product.link);
|
47
53
|
}
|
48
54
|
};
|
@@ -18,7 +18,7 @@ const CommodityDetailDiroNew = (_a) => {
|
|
18
18
|
var _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;
|
19
19
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
|
20
20
|
const [spread, setSpread] = (0, react_1.useState)(true);
|
21
|
-
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = (0, hooks_1.useSxpDataSource)();
|
21
|
+
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig, ctaEvent } = (0, hooks_1.useSxpDataSource)();
|
22
22
|
const { jumpToWeb, productView } = (0, useEventReport_1.useEventReport)();
|
23
23
|
const [stopSlide, setStopSlide] = (0, react_1.useState)(false);
|
24
24
|
const [isBottom, setIsBottom] = (0, react_1.useState)(false);
|
@@ -47,6 +47,12 @@ const CommodityDetailDiroNew = (_a) => {
|
|
47
47
|
if (!isPost) {
|
48
48
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
49
49
|
}
|
50
|
+
else {
|
51
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
52
|
+
eventSubject: 'clickCta',
|
53
|
+
eventDescription: 'User clicked the CTA'
|
54
|
+
}, data, product, position);
|
55
|
+
}
|
50
56
|
window.location.href = window.getJointUtmLink(product.link);
|
51
57
|
}
|
52
58
|
};
|