pb-sxp-ui 1.0.70 → 1.0.72
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 +167 -131
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +167 -131
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +171 -134
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/VideoWidget.js +15 -16
- package/es/core/components/DiyPortalPreview/index.js +8 -8
- package/es/core/components/SxpPageCore/index.js +2 -2
- package/es/core/components/SxpPageRender/FormatImage.js +2 -1
- package/es/core/components/SxpPageRender/LikeButton/index.js +11 -11
- package/es/core/components/SxpPageRender/Nudge/index.js +2 -2
- package/es/core/components/SxpPageRender/VideoWidget/index.js +13 -13
- package/es/core/components/SxpPageRender/WaterFall/List.js +5 -9
- package/es/core/components/SxpPageRender/index.js +39 -30
- package/es/core/components/SxpPageRender/typing.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.js +12 -4
- package/es/materials/sxp/HashTag/settingRender.d.ts +2 -7
- package/es/materials/sxp/HashTag/settingRender.js +0 -5
- package/es/materials/sxp/defaultSetting.js +1 -1
- package/es/materials/sxp/template/Commodity/index.js +4 -4
- package/es/materials/sxp/template/CommodityDiro/index.js +4 -4
- package/es/materials/sxp/template/CommodityDiroNew/index.js +4 -4
- package/es/materials/sxp/template/MultiCommodity/index.js +4 -4
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +4 -4
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +4 -4
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +15 -16
- package/lib/core/components/DiyPortalPreview/index.js +8 -8
- package/lib/core/components/SxpPageCore/index.js +2 -2
- package/lib/core/components/SxpPageRender/FormatImage.js +1 -0
- package/lib/core/components/SxpPageRender/LikeButton/index.js +11 -11
- package/lib/core/components/SxpPageRender/Nudge/index.js +2 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +13 -13
- package/lib/core/components/SxpPageRender/WaterFall/List.js +5 -9
- package/lib/core/components/SxpPageRender/index.js +39 -30
- package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.js +12 -4
- package/lib/materials/sxp/HashTag/settingRender.d.ts +2 -7
- package/lib/materials/sxp/HashTag/settingRender.js +0 -5
- package/lib/materials/sxp/defaultSetting.js +1 -1
- package/lib/materials/sxp/template/Commodity/index.js +4 -4
- package/lib/materials/sxp/template/CommodityDiro/index.js +4 -4
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +4 -4
- package/lib/materials/sxp/template/MultiCommodity/index.js +4 -4
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +4 -4
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +4 -4
- package/package.json +1 -2
package/dist/index.js
CHANGED
@@ -6,7 +6,6 @@ import qs from 'qs';
|
|
6
6
|
import EventEmitter from 'eventemitter3';
|
7
7
|
import { css } from '@emotion/css';
|
8
8
|
import * as ReactDOM from 'react-dom';
|
9
|
-
import Hls from 'hls.js';
|
10
9
|
|
11
10
|
/******************************************************************************
|
12
11
|
Copyright (c) Microsoft Corporation.
|
@@ -423,7 +422,7 @@ var DataSourceType;
|
|
423
422
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
424
423
|
})(DataSourceType || (DataSourceType = {}));
|
425
424
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
426
|
-
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false }) => {
|
425
|
+
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, isShowTag = true }) => {
|
427
426
|
const [rtcList, setRtcList] = useState([]);
|
428
427
|
const [tagList, setTagList] = useState([]);
|
429
428
|
const [loading, setLoading] = useState(false);
|
@@ -556,9 +555,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
556
555
|
if (!enableReportEvent || !enabledMetaConversionApi) {
|
557
556
|
return;
|
558
557
|
}
|
558
|
+
const fakeUserId = storeAndLoadFeUserId();
|
559
559
|
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
|
560
560
|
method: 'POST',
|
561
|
-
body: {
|
561
|
+
body: {
|
562
|
+
eventName,
|
563
|
+
actionSource,
|
564
|
+
eventSourceUrl,
|
565
|
+
userData: {
|
566
|
+
externalId: fakeUserId
|
567
|
+
}
|
568
|
+
},
|
562
569
|
type: 'beacon'
|
563
570
|
});
|
564
571
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi]);
|
@@ -577,7 +584,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
577
584
|
// 获取 Tag
|
578
585
|
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
579
586
|
var _h, _j, _k, _l, _m;
|
580
|
-
if (!utmVal)
|
587
|
+
if (!utmVal || !isShowTag)
|
581
588
|
return;
|
582
589
|
try {
|
583
590
|
const val = (_k = (_j = (_h = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _h === void 0 ? void 0 : _h.filter((val) => {
|
@@ -590,7 +597,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
590
597
|
catch (e) {
|
591
598
|
console.log('e', e);
|
592
599
|
}
|
593
|
-
}), [bffFetch, utmVal]);
|
600
|
+
}), [bffFetch, utmVal, isShowTag]);
|
594
601
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
595
602
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
596
603
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
@@ -927,11 +934,11 @@ var interactionRender$8 = [
|
|
927
934
|
* @Author: binruan@chatlabs.com
|
928
935
|
* @Date: 2024-04-28 14:42:22
|
929
936
|
* @LastEditors: binruan@chatlabs.com
|
930
|
-
* @LastEditTime: 2024-05-17
|
937
|
+
* @LastEditTime: 2024-05-23 17:01:21
|
931
938
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\defaultSetting.ts
|
932
939
|
*
|
933
940
|
*/
|
934
|
-
const fontOptions = [{ label: '
|
941
|
+
const fontOptions = [{ label: 'defalut', value: 'appFont' }];
|
935
942
|
const sxpFonts = typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.localStorage.getItem('sxp_font_links'));
|
936
943
|
const data = sxpFonts && sxpFonts !== '' ? JSON.parse(sxpFonts) : [];
|
937
944
|
var defaultSetting = {
|
@@ -8416,7 +8423,7 @@ var ExpandableText$1 = memo(ExpandableText);
|
|
8416
8423
|
* @Author: binruan@chatlabs.com
|
8417
8424
|
* @Date: 2024-03-20 10:27:31
|
8418
8425
|
* @LastEditors: binruan@chatlabs.com
|
8419
|
-
* @LastEditTime: 2024-
|
8426
|
+
* @LastEditTime: 2024-05-20 15:53:04
|
8420
8427
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
|
8421
8428
|
*
|
8422
8429
|
*/
|
@@ -8431,6 +8438,30 @@ const FormatImage = forwardRef((props, ref) => {
|
|
8431
8438
|
useEffect(() => {
|
8432
8439
|
setImgSrc(src);
|
8433
8440
|
}, [src]);
|
8441
|
+
useRef(null);
|
8442
|
+
// useEffect(() => {
|
8443
|
+
// let observer: any = null;
|
8444
|
+
// const { current } = imgRef;
|
8445
|
+
// if (current) {
|
8446
|
+
// observer = new IntersectionObserver(
|
8447
|
+
// (entries) => {
|
8448
|
+
// entries.forEach((entry) => {
|
8449
|
+
// if (entry.isIntersecting) {
|
8450
|
+
// setImgSrc(src);
|
8451
|
+
// observer.unobserve(current);
|
8452
|
+
// }
|
8453
|
+
// });
|
8454
|
+
// },
|
8455
|
+
// { threshold: 0.1 } // 触发阈值,可根据需要调整
|
8456
|
+
// );
|
8457
|
+
// observer.observe(current);
|
8458
|
+
// }
|
8459
|
+
// return () => {
|
8460
|
+
// if (observer && current) {
|
8461
|
+
// observer.unobserve(current);
|
8462
|
+
// }
|
8463
|
+
// };
|
8464
|
+
// }, [src]);
|
8434
8465
|
return (React.createElement(React.Fragment, null, (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
|
8435
8466
|
React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
|
8436
8467
|
React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
|
@@ -9477,11 +9508,11 @@ var EventProvider$1 = memo(EventProvider);
|
|
9477
9508
|
var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
9478
9509
|
|
9479
9510
|
const Commodity$1 = (_a) => {
|
9480
|
-
var _b, _c, _d, _e, _f, _g, _h;
|
9511
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
9481
9512
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
9482
9513
|
const { sxpParameter } = useSxpDataSource();
|
9483
9514
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9484
|
-
const src = (
|
9515
|
+
const src = (_g = (_f = (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.product) === null || _c === void 0 ? void 0 : _c.cover) !== null && _d !== void 0 ? _d : (_e = product === null || product === void 0 ? void 0 : product.homePage) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _g !== void 0 ? _g : bottom_image;
|
9485
9516
|
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9486
9517
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9487
9518
|
React.createElement(FormatImage$1, { className: css({
|
@@ -9499,8 +9530,8 @@ const Commodity$1 = (_a) => {
|
|
9499
9530
|
width: '100%',
|
9500
9531
|
overflow: 'hidden'
|
9501
9532
|
}) },
|
9502
|
-
React.createElement("div", { className: styles$6['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9503
|
-
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9533
|
+
React.createElement("div", { className: styles$6['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_h = product === null || product === void 0 ? void 0 : product.title) !== null && _h !== void 0 ? _h : 'Product Name'),
|
9534
|
+
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_k = (_j = product === null || product === void 0 ? void 0 : product.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop Now'))));
|
9504
9535
|
};
|
9505
9536
|
var CommodityComponent = memo(Commodity$1);
|
9506
9537
|
|
@@ -9726,11 +9757,11 @@ var interactionRender$4 = [
|
|
9726
9757
|
var styles$4 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__yyHVb"};
|
9727
9758
|
|
9728
9759
|
const CommodityDiro$1 = (_a) => {
|
9729
|
-
var _b, _c, _d, _e, _f, _g, _h;
|
9760
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
9730
9761
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
9731
9762
|
const { sxpParameter } = useSxpDataSource();
|
9732
9763
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9733
|
-
const src = (
|
9764
|
+
const src = (_g = (_f = (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.product) === null || _c === void 0 ? void 0 : _c.cover) !== null && _d !== void 0 ? _d : (_e = product === null || product === void 0 ? void 0 : product.homePage) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _g !== void 0 ? _g : bottom_image;
|
9734
9765
|
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9735
9766
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9736
9767
|
React.createElement(FormatImage$1, { className: css({
|
@@ -9748,8 +9779,8 @@ const CommodityDiro$1 = (_a) => {
|
|
9748
9779
|
width: '100%',
|
9749
9780
|
overflow: 'hidden'
|
9750
9781
|
}) },
|
9751
|
-
React.createElement("div", { className: styles$4['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9752
|
-
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9782
|
+
React.createElement("div", { className: styles$4['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_h = product === null || product === void 0 ? void 0 : product.title) !== null && _h !== void 0 ? _h : 'Product Name'),
|
9783
|
+
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_k = (_j = product === null || product === void 0 ? void 0 : product.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop Now'))));
|
9753
9784
|
};
|
9754
9785
|
var CommodityDiroComponent = memo(CommodityDiro$1);
|
9755
9786
|
|
@@ -9824,11 +9855,11 @@ var interactionRender$3 = [
|
|
9824
9855
|
var styles$3 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__I-yCC"};
|
9825
9856
|
|
9826
9857
|
const CommodityDiroNew$1 = (_a) => {
|
9827
|
-
var _b, _c, _d, _e, _f, _g, _h;
|
9858
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
9828
9859
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
9829
9860
|
const { sxpParameter } = useSxpDataSource();
|
9830
9861
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9831
|
-
const src = (
|
9862
|
+
const src = (_g = (_f = (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.product) === null || _c === void 0 ? void 0 : _c.cover) !== null && _d !== void 0 ? _d : (_e = product === null || product === void 0 ? void 0 : product.homePage) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _g !== void 0 ? _g : bottom_image;
|
9832
9863
|
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9833
9864
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9834
9865
|
React.createElement(FormatImage$1, { className: css({
|
@@ -9846,8 +9877,8 @@ const CommodityDiroNew$1 = (_a) => {
|
|
9846
9877
|
width: '100%',
|
9847
9878
|
overflow: 'hidden'
|
9848
9879
|
}) },
|
9849
|
-
React.createElement("div", { className: styles$3['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9850
|
-
React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9880
|
+
React.createElement("div", { className: styles$3['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_h = product === null || product === void 0 ? void 0 : product.title) !== null && _h !== void 0 ? _h : 'Product Name'),
|
9881
|
+
React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_k = (_j = product === null || product === void 0 ? void 0 : product.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop now'))));
|
9851
9882
|
};
|
9852
9883
|
var CommodityDiroNewComponent = memo(CommodityDiroNew$1);
|
9853
9884
|
|
@@ -9976,10 +10007,10 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9976
10007
|
}
|
9977
10008
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9978
10009
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
9979
|
-
var _a, _b, _c, _d, _e, _f;
|
10010
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
9980
10011
|
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
9981
10012
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9982
|
-
React.createElement(Img$1, { src: (
|
10013
|
+
React.createElement(Img$1, { 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, style: {
|
9983
10014
|
transform: `translateY(${translateY}%)`
|
9984
10015
|
} })),
|
9985
10016
|
React.createElement("div", { className: css({
|
@@ -9990,8 +10021,8 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9990
10021
|
width: '100%',
|
9991
10022
|
overflow: 'hidden'
|
9992
10023
|
}) },
|
9993
|
-
React.createElement("div", { className: styles$2['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9994
|
-
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
10024
|
+
React.createElement("div", { className: styles$2['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
|
10025
|
+
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))));
|
9995
10026
|
})));
|
9996
10027
|
};
|
9997
10028
|
var MultiCommodityDiroComponent = memo(MultiCommodityDiro$1);
|
@@ -10091,10 +10122,10 @@ const MultiCommodity$1 = (_a) => {
|
|
10091
10122
|
}
|
10092
10123
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10093
10124
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10094
|
-
var _a, _b, _c, _d, _e, _f;
|
10125
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
10095
10126
|
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10096
10127
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
10097
|
-
React.createElement(Img$1, { src: (
|
10128
|
+
React.createElement(Img$1, { 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, style: {
|
10098
10129
|
transform: `translateY(${translateY}%)`
|
10099
10130
|
} })),
|
10100
10131
|
React.createElement("div", { className: css({
|
@@ -10105,8 +10136,8 @@ const MultiCommodity$1 = (_a) => {
|
|
10105
10136
|
width: '100%',
|
10106
10137
|
overflow: 'hidden'
|
10107
10138
|
}) },
|
10108
|
-
React.createElement("div", { className: styles$1['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
10109
|
-
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
10139
|
+
React.createElement("div", { className: styles$1['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
|
10140
|
+
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))));
|
10110
10141
|
})));
|
10111
10142
|
};
|
10112
10143
|
var MultiCommodityComponent = memo(MultiCommodity$1);
|
@@ -10205,10 +10236,10 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
10205
10236
|
}
|
10206
10237
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10207
10238
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10208
|
-
var _a, _b, _c, _d, _e, _f;
|
10239
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
10209
10240
|
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10210
10241
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
10211
|
-
React.createElement(Img$1, { src: (
|
10242
|
+
React.createElement(Img$1, { 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, style: {
|
10212
10243
|
transform: `translateY(${translateY}%)`
|
10213
10244
|
} })),
|
10214
10245
|
React.createElement("div", { className: css({
|
@@ -10220,8 +10251,8 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
10220
10251
|
overflow: 'hidden',
|
10221
10252
|
lineHeight: '20px'
|
10222
10253
|
}) },
|
10223
|
-
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
10224
|
-
React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
10254
|
+
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
|
10255
|
+
React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop now'))));
|
10225
10256
|
})));
|
10226
10257
|
};
|
10227
10258
|
var MultiCommodityDiroNewComponent = memo(MultiCommodityDiroNew$1);
|
@@ -10288,7 +10319,7 @@ var _a, _b;
|
|
10288
10319
|
* @Author: binruan@chatlabs.com
|
10289
10320
|
* @Date: 2024-04-07 14:07:12
|
10290
10321
|
* @LastEditors: binruan@chatlabs.com
|
10291
|
-
* @LastEditTime: 2024-
|
10322
|
+
* @LastEditTime: 2024-05-23 11:03:15
|
10292
10323
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\HashTag\settingRender.tsx
|
10293
10324
|
*
|
10294
10325
|
*/
|
@@ -10296,11 +10327,11 @@ var settingRender = [
|
|
10296
10327
|
{
|
10297
10328
|
title: '卡片样式',
|
10298
10329
|
child: [
|
10299
|
-
{
|
10300
|
-
|
10301
|
-
|
10302
|
-
|
10303
|
-
},
|
10330
|
+
// {
|
10331
|
+
// type: 'Number',
|
10332
|
+
// label: '文本行数',
|
10333
|
+
// name: ['props', 'lineClamp']
|
10334
|
+
// },
|
10304
10335
|
{
|
10305
10336
|
type: 'Number',
|
10306
10337
|
label: '上下边距',
|
@@ -11784,19 +11815,15 @@ const WaterfallFlowItem = (props) => {
|
|
11784
11815
|
const canvasRef = useRef(null);
|
11785
11816
|
const [firstFrameSrc, setFirstFrameSrc] = useState('');
|
11786
11817
|
const src = useMemo(() => {
|
11787
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
11818
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
11788
11819
|
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) {
|
11789
11820
|
return (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
|
11790
11821
|
}
|
11791
|
-
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.
|
11792
|
-
|
11793
|
-
return (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.url;
|
11822
|
+
else if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.imgUrls) === null || _d === void 0 ? void 0 : _d.length) {
|
11823
|
+
return (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.imgUrls) === null || _f === void 0 ? void 0 : _f[0];
|
11794
11824
|
}
|
11795
|
-
else if ((
|
11796
|
-
return (
|
11797
|
-
}
|
11798
|
-
else if ((_k = (_j = rec === null || rec === void 0 ? void 0 : rec.product) === null || _j === void 0 ? void 0 : _j.homePage) === null || _k === void 0 ? void 0 : _k.length) {
|
11799
|
-
return (_m = (_l = rec === null || rec === void 0 ? void 0 : rec.product) === null || _l === void 0 ? void 0 : _l.homePage) === null || _m === void 0 ? void 0 : _m[0];
|
11825
|
+
else if ((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.product) === null || _g === void 0 ? void 0 : _g.homePage) === null || _h === void 0 ? void 0 : _h.length) {
|
11826
|
+
return (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.product) === null || _j === void 0 ? void 0 : _j.homePage) === null || _k === void 0 ? void 0 : _k[0];
|
11800
11827
|
}
|
11801
11828
|
else {
|
11802
11829
|
return (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) || '';
|
@@ -12215,17 +12242,17 @@ const LikeButton = (_a) => {
|
|
12215
12242
|
if (state) {
|
12216
12243
|
// 先设置状态
|
12217
12244
|
setState(false);
|
12218
|
-
const result = (_d = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ videoItemId: (_c = (_b = recData.video) === null || _b === void 0 ? void 0 : _b.itemId) !== null && _c !== void 0 ? _c : '' })))) !== null && _d !== void 0 ? _d : false;
|
12245
|
+
const result = (_d = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ videoItemId: (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.itemId) !== null && _c !== void 0 ? _c : '' })))) !== null && _d !== void 0 ? _d : false;
|
12219
12246
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12220
12247
|
eventInfo: {
|
12221
12248
|
eventSubject: 'favoriteContentCanceled',
|
12222
12249
|
eventDescription: 'This content was unfavorite by the user',
|
12223
|
-
contentId: (_f = (_e = recData.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
|
12224
|
-
contentName: (_h = (_g = recData.video) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : '',
|
12225
|
-
contentTags: JSON.stringify((_k = (_j = recData.video) === null || _j === void 0 ? void 0 : _j.tags) !== null && _k !== void 0 ? _k : []),
|
12250
|
+
contentId: (_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
|
12251
|
+
contentName: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : '',
|
12252
|
+
contentTags: JSON.stringify((_k = (_j = recData === null || recData === void 0 ? void 0 : recData.video) === null || _j === void 0 ? void 0 : _j.tags) !== null && _k !== void 0 ? _k : []),
|
12226
12253
|
position: position + '',
|
12227
|
-
contentFormat: ((_l = recData.video) === null || _l === void 0 ? void 0 : _l.url) ? 'video' : 'image',
|
12228
|
-
traceInfo: (_m = recData.video) === null || _m === void 0 ? void 0 : _m.traceInfo
|
12254
|
+
contentFormat: ((_l = recData === null || recData === void 0 ? void 0 : recData.video) === null || _l === void 0 ? void 0 : _l.url) ? 'video' : 'image',
|
12255
|
+
traceInfo: (_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.traceInfo
|
12229
12256
|
}
|
12230
12257
|
});
|
12231
12258
|
// 如果接口调用失败,则回滚状态
|
@@ -12240,12 +12267,12 @@ const LikeButton = (_a) => {
|
|
12240
12267
|
eventInfo: {
|
12241
12268
|
eventSubject: 'favoriteContent',
|
12242
12269
|
eventDescription: 'This content was favorite by the user',
|
12243
|
-
contentId: (_q = (_p = recData.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
|
12244
|
-
contentName: (_s = (_r = recData.video) === null || _r === void 0 ? void 0 : _r.title) !== null && _s !== void 0 ? _s : '',
|
12245
|
-
contentTags: JSON.stringify((_u = (_t = recData.video) === null || _t === void 0 ? void 0 : _t.tags) !== null && _u !== void 0 ? _u : []),
|
12270
|
+
contentId: (_q = (_p = recData === null || recData === void 0 ? void 0 : recData.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
|
12271
|
+
contentName: (_s = (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.title) !== null && _s !== void 0 ? _s : '',
|
12272
|
+
contentTags: JSON.stringify((_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.tags) !== null && _u !== void 0 ? _u : []),
|
12246
12273
|
position: position + '',
|
12247
|
-
contentFormat: ((_v = recData.video) === null || _v === void 0 ? void 0 : _v.url) ? 'video' : 'image',
|
12248
|
-
traceInfo: (_w = recData.video) === null || _w === void 0 ? void 0 : _w.traceInfo
|
12274
|
+
contentFormat: ((_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.url) ? 'video' : 'image',
|
12275
|
+
traceInfo: (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.traceInfo
|
12249
12276
|
}
|
12250
12277
|
});
|
12251
12278
|
if (!result) {
|
@@ -12323,15 +12350,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12323
12350
|
eventInfo: {
|
12324
12351
|
eventSubject: 'playVideo',
|
12325
12352
|
eventDescription: 'User played the video',
|
12326
|
-
contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
12327
|
-
contentName: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
|
12353
|
+
contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
12354
|
+
contentName: (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
|
12328
12355
|
playType,
|
12329
12356
|
startTime: videoCurrentTime,
|
12330
12357
|
videoDuration,
|
12331
|
-
contentTags: JSON.stringify((_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
|
12358
|
+
contentTags: JSON.stringify((_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
|
12332
12359
|
position: index + '',
|
12333
12360
|
contentFormat: 'video',
|
12334
|
-
traceInfo: (_j = item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
|
12361
|
+
traceInfo: (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
|
12335
12362
|
}
|
12336
12363
|
});
|
12337
12364
|
setIsFirstPlay(false);
|
@@ -12421,15 +12448,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12421
12448
|
eventInfo: {
|
12422
12449
|
eventSubject: 'playOverVideo',
|
12423
12450
|
eventDescription: 'User finished playing the video',
|
12424
|
-
contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
12425
|
-
contentName: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
|
12451
|
+
contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
12452
|
+
contentName: (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
|
12426
12453
|
endTime: videoCurrentTime,
|
12427
12454
|
videoDuration,
|
12428
12455
|
playDuration,
|
12429
|
-
contentTags: JSON.stringify((_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
|
12456
|
+
contentTags: JSON.stringify((_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
|
12430
12457
|
position: index + '',
|
12431
12458
|
contentFormat: 'video',
|
12432
|
-
traceInfo: (_j = item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
|
12459
|
+
traceInfo: (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
|
12433
12460
|
}
|
12434
12461
|
});
|
12435
12462
|
}
|
@@ -12437,9 +12464,10 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12437
12464
|
useEffect(() => {
|
12438
12465
|
if (!isActive || !videoRef)
|
12439
12466
|
return;
|
12440
|
-
const videoSrc = rec.video.url;
|
12467
|
+
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
|
12441
12468
|
if (!videoSrc)
|
12442
12469
|
return;
|
12470
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
|
12443
12471
|
setIsPauseVideo(false);
|
12444
12472
|
const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
|
12445
12473
|
const dom = document.querySelector('#player-container-id');
|
@@ -12447,7 +12475,6 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12447
12475
|
if (!dom && !dom2)
|
12448
12476
|
return;
|
12449
12477
|
videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
|
12450
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
|
12451
12478
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadedmetadata', handleLoadedmetadata);
|
12452
12479
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadeddata', handLoadeddata);
|
12453
12480
|
// videoRef?.on('canplay', handleCanplay);
|
@@ -12528,10 +12555,10 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12528
12555
|
window.removeEventListener('beforeunload', handleBeforeUnload);
|
12529
12556
|
};
|
12530
12557
|
}, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
|
12531
|
-
if (!rec.video) {
|
12558
|
+
if (!(rec === null || rec === void 0 ? void 0 : rec.video)) {
|
12532
12559
|
return null;
|
12533
12560
|
}
|
12534
|
-
return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: Object.assign({ position: 'relative', width: '100%', height, overflow: 'hidden' }, bgStyle) },
|
12561
|
+
return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, onClick: handleClickVideo(), style: Object.assign({ position: 'relative', width: '100%', height, overflow: 'hidden' }, bgStyle) },
|
12535
12562
|
!isBgColor && (React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) })),
|
12536
12563
|
React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
|
12537
12564
|
React.createElement("div", { style: {
|
@@ -12546,7 +12573,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12546
12573
|
React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
|
12547
12574
|
React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
|
12548
12575
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
12549
|
-
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, style: {
|
12576
|
+
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, style: {
|
12550
12577
|
position: 'relative',
|
12551
12578
|
width: '100%',
|
12552
12579
|
height,
|
@@ -12845,7 +12872,7 @@ var RenderCard$1 = memo(RenderCard);
|
|
12845
12872
|
* @Author: binruan@chatlabs.com
|
12846
12873
|
* @Date: 2024-03-26 10:07:41
|
12847
12874
|
* @LastEditors: binruan@chatlabs.com
|
12848
|
-
* @LastEditTime: 2024-
|
12875
|
+
* @LastEditTime: 2024-05-23 14:31:12
|
12849
12876
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Nudge\index.tsx
|
12850
12877
|
*
|
12851
12878
|
*/
|
@@ -12858,8 +12885,8 @@ const Nudge = ({ nudge }) => {
|
|
12858
12885
|
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
12859
12886
|
borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
|
12860
12887
|
} },
|
12861
|
-
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
|
12862
|
-
React.createElement("p", { style: Object.assign(Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle), { textWrap: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }) }, (_g = nudge === null || nudge === void 0 ? void 0 : nudge.content) !== null && _g !== void 0 ? _g : '')))));
|
12888
|
+
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover', flexShrink: 0 } }) : null,
|
12889
|
+
React.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 : '')))));
|
12863
12890
|
};
|
12864
12891
|
|
12865
12892
|
const DEFAULT_TAG = 'FOR U';
|
@@ -12903,7 +12930,7 @@ var Tagbar$1 = memo(Tagbar);
|
|
12903
12930
|
* @Author: binruan@chatlabs.com
|
12904
12931
|
* @Date: 2024-01-15 19:03:09
|
12905
12932
|
* @LastEditors: binruan@chatlabs.com
|
12906
|
-
* @LastEditTime: 2024-05-
|
12933
|
+
* @LastEditTime: 2024-05-24 16:32:06
|
12907
12934
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12908
12935
|
*
|
12909
12936
|
*/
|
@@ -12963,23 +12990,29 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12963
12990
|
};
|
12964
12991
|
const firstRef = useRef();
|
12965
12992
|
useEffect(() => {
|
12966
|
-
|
12993
|
+
var _a, _b, _c;
|
12994
|
+
if (!firstRef.current && !videoRef && (playerRef === null || playerRef === void 0 ? void 0 : playerRef.current) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
|
12967
12995
|
firstRef.current = true;
|
12968
12996
|
const player = TCPlayer('player-container-id', {
|
12969
12997
|
licenseUrl, // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
|
12970
12998
|
controls: false,
|
12971
|
-
autoplay: false,
|
12972
12999
|
loop: false,
|
13000
|
+
autoplay: true,
|
12973
13001
|
muted: true,
|
12974
13002
|
preload: 'auto',
|
12975
13003
|
posterImage: false,
|
12976
|
-
bigPlayButton: true
|
13004
|
+
bigPlayButton: true,
|
13005
|
+
sources: [
|
13006
|
+
{
|
13007
|
+
src: (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url) !== null && _c !== void 0 ? _c : ''
|
13008
|
+
}
|
13009
|
+
]
|
12977
13010
|
});
|
12978
13011
|
player === null || player === void 0 ? void 0 : player.ready(() => {
|
12979
13012
|
setVideoRef(player);
|
12980
13013
|
});
|
12981
13014
|
}
|
12982
|
-
}, [videoRef, licenseUrl]);
|
13015
|
+
}, [videoRef, licenseUrl, data]);
|
12983
13016
|
useEffect(() => {
|
12984
13017
|
if (!isInit)
|
12985
13018
|
handleH5EnterLink();
|
@@ -13034,7 +13067,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13034
13067
|
if (popupDetailData && (((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
13035
13068
|
fromKName = 'pdpPage';
|
13036
13069
|
}
|
13037
|
-
else if (popupDetailData && (tempMap === null || tempMap === void 0 ? void 0 : tempMap[(_f = (_e = (_d = item.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : ''].item.type) === 'Appoint') {
|
13070
|
+
else if (popupDetailData && (tempMap === null || tempMap === void 0 ? void 0 : tempMap[(_f = (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : ''].item.type) === 'Appoint') {
|
13038
13071
|
fromKName = 'formPage';
|
13039
13072
|
}
|
13040
13073
|
else if (isFromHashtag) {
|
@@ -13059,7 +13092,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13059
13092
|
position: activeIndex + '',
|
13060
13093
|
fromKName,
|
13061
13094
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
13062
|
-
ctatId: (_q = (_p = (_o = item.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : ''
|
13095
|
+
ctatId: (_q = (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : ''
|
13063
13096
|
}
|
13064
13097
|
});
|
13065
13098
|
}
|
@@ -13097,11 +13130,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13097
13130
|
}, [globalConfig]);
|
13098
13131
|
const renderContent = useCallback((rec, index) => {
|
13099
13132
|
var _a, _b, _c, _d;
|
13100
|
-
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13133
|
+
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13101
13134
|
return (React.createElement(VideoWidget$3, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef }));
|
13102
13135
|
}
|
13103
|
-
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13104
|
-
return (React.createElement(PictureGroup$3, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
13136
|
+
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13137
|
+
return (React.createElement(PictureGroup$3, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
13105
13138
|
}
|
13106
13139
|
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
13107
13140
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
@@ -13142,16 +13175,16 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13142
13175
|
}, [isShowMore]);
|
13143
13176
|
const renderBottom = useCallback((rec, index) => {
|
13144
13177
|
var _a, _b, _c, _d, _e, _f, _g;
|
13145
|
-
if (rec.video) {
|
13178
|
+
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
13146
13179
|
return (React.createElement(React.Fragment, null,
|
13147
|
-
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
13180
|
+
((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
13148
13181
|
React.createElement("div", { className: 'clc-sxp-bottom' },
|
13149
13182
|
React.createElement(Nudge, { nudge: nudge }),
|
13150
13183
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
13151
13184
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
|
13152
13185
|
React.createElement("div", null,
|
13153
|
-
React.createElement(ExpandableText$1, { 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.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' }), onChange: onExpandableChange }),
|
13154
|
-
React.createElement(Hashtag$1, { index: activeIndex, 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.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })))));
|
13186
|
+
React.createElement(ExpandableText$1, { 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' }), onChange: onExpandableChange }),
|
13187
|
+
React.createElement(Hashtag$1, { index: activeIndex, 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 })))));
|
13155
13188
|
}
|
13156
13189
|
return null;
|
13157
13190
|
}, [
|
@@ -13175,7 +13208,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13175
13208
|
if (waterFallData && top < 40) {
|
13176
13209
|
top += 40;
|
13177
13210
|
}
|
13178
|
-
if (rec.video) {
|
13211
|
+
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
13179
13212
|
return (React.createElement(LikeButton$1, { key: rec.position, activeIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon, unActicveIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon, active: rec.isCollected, recData: rec, className: 'clc-sxp-like-button', style: {
|
13180
13213
|
[(_b = globalConfig.likeIconXPosit) !== null && _b !== void 0 ? _b : 'right']: (_c = globalConfig.likeIconX) !== null && _c !== void 0 ? _c : 0,
|
13181
13214
|
[(_d = globalConfig.likeIconYPosit) !== null && _d !== void 0 ? _d : 'bottom']: top
|
@@ -13185,27 +13218,27 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13185
13218
|
}, [globalConfig, waterFallData]);
|
13186
13219
|
const handleReportViewImageEnd = (item) => {
|
13187
13220
|
var _a, _b, _c, _d, _e, _f;
|
13188
|
-
if (!((_a = item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
|
13221
|
+
if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
|
13189
13222
|
const endTime = Date.now();
|
13190
13223
|
const duration = (endTime - viewImageStartTime.current) / 1000;
|
13191
13224
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13192
13225
|
eventInfo: {
|
13193
13226
|
eventSubject: 'viewImageCarouselEnd',
|
13194
13227
|
eventDescription: 'User end view the image carousel',
|
13195
|
-
contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
13196
|
-
contentName: (_e = item.video.title) !== null && _e !== void 0 ? _e : '',
|
13228
|
+
contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
13229
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
13197
13230
|
imageEndTime: `${endTime}`,
|
13198
13231
|
playDuration: `${duration}`,
|
13199
|
-
contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
|
13232
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
13200
13233
|
position: activeIndex + '',
|
13201
13234
|
contentFormat: 'image',
|
13202
|
-
traceInfo: item.video.traceInfo
|
13235
|
+
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
13203
13236
|
}
|
13204
13237
|
});
|
13205
13238
|
}
|
13206
13239
|
};
|
13207
13240
|
const handleScrollEvent = (swiper) => {
|
13208
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
13241
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
13209
13242
|
viewTime.current = new Date();
|
13210
13243
|
const item = data[swiper.previousIndex];
|
13211
13244
|
if (!item)
|
@@ -13215,8 +13248,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13215
13248
|
eventInfo: {
|
13216
13249
|
eventSubject: 'scrollDown',
|
13217
13250
|
eventDescription: 'User scroll down',
|
13218
|
-
contentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
|
13219
|
-
productId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
13251
|
+
contentId: (_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
|
13252
|
+
productId: (_d = (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
13220
13253
|
requestId: null
|
13221
13254
|
}
|
13222
13255
|
});
|
@@ -13228,7 +13261,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13228
13261
|
eventInfo: {
|
13229
13262
|
eventSubject: 'scrollUp',
|
13230
13263
|
eventDescription: 'User scroll up',
|
13231
|
-
contentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
|
13264
|
+
contentId: (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
|
13232
13265
|
productId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13233
13266
|
requestId: null
|
13234
13267
|
}
|
@@ -13238,14 +13271,17 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13238
13271
|
}
|
13239
13272
|
// 商品浏览事件
|
13240
13273
|
handleReportProductView(item);
|
13274
|
+
const curItem = data[swiper.activeIndex];
|
13275
|
+
if (!((_j = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _j === void 0 ? void 0 : _j.url) && !((_k = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _k === void 0 ? void 0 : _k.imgUrls) && (curItem === null || curItem === void 0 ? void 0 : curItem.product)) {
|
13276
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
13277
|
+
eventName: 'ProductView'
|
13278
|
+
});
|
13279
|
+
}
|
13241
13280
|
};
|
13242
13281
|
const handleReportProductView = (item) => {
|
13243
13282
|
var _a, _b, _c;
|
13244
13283
|
if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && !((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls) && (item === null || item === void 0 ? void 0 : item.product)) {
|
13245
13284
|
productView(item, item.product, (_c = item === null || item === void 0 ? void 0 : item.product) === null || _c === void 0 ? void 0 : _c.bindCta, viewTime.current, activeIndex);
|
13246
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
13247
|
-
eventName: 'ProductView'
|
13248
|
-
});
|
13249
13285
|
}
|
13250
13286
|
};
|
13251
13287
|
useEffect(() => {
|
@@ -13264,13 +13300,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13264
13300
|
eventInfo: {
|
13265
13301
|
eventSubject: 'viewImageCarouselStart',
|
13266
13302
|
eventDescription: 'User start view the image carousel',
|
13267
|
-
contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
13268
|
-
contentName: (_e = item.video.title) !== null && _e !== void 0 ? _e : '',
|
13303
|
+
contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
13304
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
13269
13305
|
imageStartTime: `${startTime}`,
|
13270
|
-
contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
|
13306
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
13271
13307
|
position: activeIndex + '',
|
13272
13308
|
contentFormat: 'image',
|
13273
|
-
traceInfo: item.video.traceInfo
|
13309
|
+
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
13274
13310
|
}
|
13275
13311
|
});
|
13276
13312
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
@@ -13416,15 +13452,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
13416
13452
|
eventInfo: {
|
13417
13453
|
eventSubject: 'playVideo',
|
13418
13454
|
eventDescription: 'User played the video',
|
13419
|
-
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13420
|
-
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13455
|
+
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 : '',
|
13456
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13421
13457
|
playType,
|
13422
13458
|
startTime: videoCurrentTime,
|
13423
13459
|
videoDuration,
|
13424
|
-
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13460
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13425
13461
|
position: index + '',
|
13426
13462
|
contentFormat: 'video',
|
13427
|
-
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13463
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13428
13464
|
}
|
13429
13465
|
});
|
13430
13466
|
setIsFirstPlay(false);
|
@@ -13473,15 +13509,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
13473
13509
|
eventInfo: {
|
13474
13510
|
eventSubject: 'playOverVideo',
|
13475
13511
|
eventDescription: 'User finished playing the video',
|
13476
|
-
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13477
|
-
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13512
|
+
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 : '',
|
13513
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13478
13514
|
endTime: videoCurrentTime,
|
13479
13515
|
videoDuration,
|
13480
13516
|
playDuration,
|
13481
|
-
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13517
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13482
13518
|
position: index + '',
|
13483
13519
|
contentFormat: 'video',
|
13484
|
-
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13520
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13485
13521
|
}
|
13486
13522
|
});
|
13487
13523
|
}
|
@@ -13518,10 +13554,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
13518
13554
|
return;
|
13519
13555
|
setIsPauseVideo(false);
|
13520
13556
|
if (!videoRef.current.src) {
|
13521
|
-
const videoSrc = rec.video.url;
|
13557
|
+
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
|
13522
13558
|
if (videoSrc.includes('.m3u8')) {
|
13523
|
-
if (Hls.isSupported()) {
|
13524
|
-
const hls = new Hls();
|
13559
|
+
if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.Hls.isSupported())) {
|
13560
|
+
const hls = new window.Hls();
|
13525
13561
|
hls.loadSource(videoSrc);
|
13526
13562
|
hls.attachMedia(videoRef.current);
|
13527
13563
|
}
|
@@ -13549,7 +13585,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
13549
13585
|
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
|
13550
13586
|
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
|
13551
13587
|
};
|
13552
|
-
}, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
|
13588
|
+
}, [handleLoadedMetadata, handlePlaying, rec === null || rec === void 0 ? void 0 : rec.video, handLoadeddata]);
|
13553
13589
|
const renderPoster = useMemo(() => {
|
13554
13590
|
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
13555
13591
|
return null;
|
@@ -13576,10 +13612,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
13576
13612
|
}
|
13577
13613
|
: {};
|
13578
13614
|
}, [blur]);
|
13579
|
-
if (!rec.video) {
|
13615
|
+
if (!(rec === null || rec === void 0 ? void 0 : rec.video)) {
|
13580
13616
|
return null;
|
13581
13617
|
}
|
13582
|
-
return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
13618
|
+
return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, onClick: handleClickVideo(), style: {
|
13583
13619
|
position: 'relative',
|
13584
13620
|
width,
|
13585
13621
|
height,
|
@@ -13604,7 +13640,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
13604
13640
|
objectFit: 'contain'
|
13605
13641
|
} }),
|
13606
13642
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
13607
|
-
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
13643
|
+
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, onClick: handleClickVideo(), style: {
|
13608
13644
|
position: 'relative',
|
13609
13645
|
width,
|
13610
13646
|
height,
|
@@ -13635,11 +13671,11 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
13635
13671
|
}, [globalConfig, containerHeight, tagList]);
|
13636
13672
|
const renderContent = (rec, index) => {
|
13637
13673
|
var _a, _b, _c, _d;
|
13638
|
-
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13674
|
+
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13639
13675
|
return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: true, width: containerWidth, data: data !== null && data !== void 0 ? data : [], height: height, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost }));
|
13640
13676
|
}
|
13641
|
-
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13642
|
-
return (React.createElement(PictureGroup$1, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
13677
|
+
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13678
|
+
return (React.createElement(PictureGroup$1, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
13643
13679
|
}
|
13644
13680
|
if (rec.product) {
|
13645
13681
|
if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
@@ -13673,15 +13709,15 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
13673
13709
|
};
|
13674
13710
|
const renderBottom = (rec, index) => {
|
13675
13711
|
var _a, _b, _c, _d, _e, _f, _g;
|
13676
|
-
if (rec.video) {
|
13712
|
+
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
13677
13713
|
return (React.createElement(React.Fragment, null,
|
13678
|
-
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
13714
|
+
((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
13679
13715
|
React.createElement("div", { className: 'clc-sxp-bottom' },
|
13680
13716
|
React.createElement(Nudge, { nudge: nudge }),
|
13681
13717
|
CTA(rec, index),
|
13682
13718
|
React.createElement("div", null,
|
13683
|
-
React.createElement(ExpandableText$1, { 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.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' }) })),
|
13684
|
-
React.createElement(Hashtag$1, { 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.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
|
13719
|
+
React.createElement(ExpandableText$1, { 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' }) })),
|
13720
|
+
React.createElement(Hashtag$1, { 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 }))));
|
13685
13721
|
}
|
13686
13722
|
return null;
|
13687
13723
|
};
|
@@ -13695,7 +13731,7 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
13695
13731
|
if (top < 40) {
|
13696
13732
|
top += 40;
|
13697
13733
|
}
|
13698
|
-
if (rec.video) {
|
13734
|
+
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
13699
13735
|
return (React.createElement(LikeButton$1, { key: rec.position, activeIcon: (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon) !== null && _b !== void 0 ? _b : likeIcon, unActicveIcon: (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon) !== null && _c !== void 0 ? _c : unlikeIcon, position: index, active: rec.isCollected, recData: rec, className: 'clc-sxp-like-button', style: {
|
13700
13736
|
top,
|
13701
13737
|
right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0
|
@@ -13807,7 +13843,7 @@ const Popup = () => {
|
|
13807
13843
|
* @Author: binruan@chatlabs.com
|
13808
13844
|
* @Date: 2024-01-15 19:03:09
|
13809
13845
|
* @LastEditors: binruan@chatlabs.com
|
13810
|
-
* @LastEditTime: 2024-05-
|
13846
|
+
* @LastEditTime: 2024-05-17 18:41:05
|
13811
13847
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
|
13812
13848
|
*
|
13813
13849
|
*/
|
@@ -13824,14 +13860,14 @@ Object.values(_materials_).forEach((v) => {
|
|
13824
13860
|
RESOLVER[v.extend.type] = v;
|
13825
13861
|
});
|
13826
13862
|
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl, enabledMetaConversionApi }) => {
|
13827
|
-
var _a, _b, _c, _d, _e, _f;
|
13863
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
13828
13864
|
const utmVal = useMemo(() => {
|
13829
13865
|
var _a;
|
13830
13866
|
const searchParams = (location === null || location === void 0 ? void 0 : location.search) ? (_a = location === null || location === void 0 ? void 0 : location.search) === null || _a === void 0 ? void 0 : _a.replace('?', '') : '';
|
13831
13867
|
return searchParams;
|
13832
13868
|
}, []);
|
13833
13869
|
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
|
13834
|
-
React.createElement(SxpDataSourceProvider$1, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, render: ({ rtcList, tagList }) => {
|
13870
|
+
React.createElement(SxpDataSourceProvider$1, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, isShowTag: (_j = (_h = (_g = data === null || data === void 0 ? void 0 : data.data) === null || _g === void 0 ? void 0 : _g.sxpPageConf) === null || _h === void 0 ? void 0 : _h.globalConfig) === null || _j === void 0 ? void 0 : _j.isShowTag, render: ({ rtcList, tagList }) => {
|
13835
13871
|
var _a;
|
13836
13872
|
return (React.createElement(React.Fragment, null,
|
13837
13873
|
React.createElement(SxpPageRender, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER, licenseUrl: licenseUrl })),
|