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.cjs
CHANGED
@@ -10,7 +10,6 @@ var qs = require('qs');
|
|
10
10
|
var EventEmitter = require('eventemitter3');
|
11
11
|
var css = require('@emotion/css');
|
12
12
|
var ReactDOM = require('react-dom');
|
13
|
-
var Hls = require('hls.js');
|
14
13
|
|
15
14
|
function _interopNamespaceDefault(e) {
|
16
15
|
var n = Object.create(null);
|
@@ -446,7 +445,7 @@ var DataSourceType;
|
|
446
445
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
447
446
|
})(DataSourceType || (DataSourceType = {}));
|
448
447
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
449
|
-
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false }) => {
|
448
|
+
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, isShowTag = true }) => {
|
450
449
|
const [rtcList, setRtcList] = React.useState([]);
|
451
450
|
const [tagList, setTagList] = React.useState([]);
|
452
451
|
const [loading, setLoading] = React.useState(false);
|
@@ -579,9 +578,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
579
578
|
if (!enableReportEvent || !enabledMetaConversionApi) {
|
580
579
|
return;
|
581
580
|
}
|
581
|
+
const fakeUserId = storeAndLoadFeUserId();
|
582
582
|
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/fb/events', {
|
583
583
|
method: 'POST',
|
584
|
-
body: {
|
584
|
+
body: {
|
585
|
+
eventName,
|
586
|
+
actionSource,
|
587
|
+
eventSourceUrl,
|
588
|
+
userData: {
|
589
|
+
externalId: fakeUserId
|
590
|
+
}
|
591
|
+
},
|
585
592
|
type: 'beacon'
|
586
593
|
});
|
587
594
|
}, [bffFetch, enableReportEvent, enabledMetaConversionApi]);
|
@@ -600,7 +607,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
600
607
|
// 获取 Tag
|
601
608
|
const bffGetTagList = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
602
609
|
var _h, _j, _k, _l, _m;
|
603
|
-
if (!utmVal)
|
610
|
+
if (!utmVal || !isShowTag)
|
604
611
|
return;
|
605
612
|
try {
|
606
613
|
const val = (_k = (_j = (_h = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _h === void 0 ? void 0 : _h.filter((val) => {
|
@@ -613,7 +620,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
613
620
|
catch (e) {
|
614
621
|
console.log('e', e);
|
615
622
|
}
|
616
|
-
}), [bffFetch, utmVal]);
|
623
|
+
}), [bffFetch, utmVal, isShowTag]);
|
617
624
|
const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
|
618
625
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
619
626
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
@@ -950,11 +957,11 @@ var interactionRender$8 = [
|
|
950
957
|
* @Author: binruan@chatlabs.com
|
951
958
|
* @Date: 2024-04-28 14:42:22
|
952
959
|
* @LastEditors: binruan@chatlabs.com
|
953
|
-
* @LastEditTime: 2024-05-17
|
960
|
+
* @LastEditTime: 2024-05-23 17:01:21
|
954
961
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\defaultSetting.ts
|
955
962
|
*
|
956
963
|
*/
|
957
|
-
const fontOptions = [{ label: '
|
964
|
+
const fontOptions = [{ label: 'defalut', value: 'appFont' }];
|
958
965
|
const sxpFonts = typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.localStorage.getItem('sxp_font_links'));
|
959
966
|
const data = sxpFonts && sxpFonts !== '' ? JSON.parse(sxpFonts) : [];
|
960
967
|
var defaultSetting = {
|
@@ -8439,7 +8446,7 @@ var ExpandableText$1 = React.memo(ExpandableText);
|
|
8439
8446
|
* @Author: binruan@chatlabs.com
|
8440
8447
|
* @Date: 2024-03-20 10:27:31
|
8441
8448
|
* @LastEditors: binruan@chatlabs.com
|
8442
|
-
* @LastEditTime: 2024-
|
8449
|
+
* @LastEditTime: 2024-05-20 15:53:04
|
8443
8450
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
|
8444
8451
|
*
|
8445
8452
|
*/
|
@@ -8454,6 +8461,30 @@ const FormatImage = React.forwardRef((props, ref) => {
|
|
8454
8461
|
React.useEffect(() => {
|
8455
8462
|
setImgSrc(src);
|
8456
8463
|
}, [src]);
|
8464
|
+
React.useRef(null);
|
8465
|
+
// useEffect(() => {
|
8466
|
+
// let observer: any = null;
|
8467
|
+
// const { current } = imgRef;
|
8468
|
+
// if (current) {
|
8469
|
+
// observer = new IntersectionObserver(
|
8470
|
+
// (entries) => {
|
8471
|
+
// entries.forEach((entry) => {
|
8472
|
+
// if (entry.isIntersecting) {
|
8473
|
+
// setImgSrc(src);
|
8474
|
+
// observer.unobserve(current);
|
8475
|
+
// }
|
8476
|
+
// });
|
8477
|
+
// },
|
8478
|
+
// { threshold: 0.1 } // 触发阈值,可根据需要调整
|
8479
|
+
// );
|
8480
|
+
// observer.observe(current);
|
8481
|
+
// }
|
8482
|
+
// return () => {
|
8483
|
+
// if (observer && current) {
|
8484
|
+
// observer.unobserve(current);
|
8485
|
+
// }
|
8486
|
+
// };
|
8487
|
+
// }, [src]);
|
8457
8488
|
return (React.createElement(React.Fragment, null, (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
|
8458
8489
|
React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
|
8459
8490
|
React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
|
@@ -9500,11 +9531,11 @@ var EventProvider$1 = React.memo(EventProvider);
|
|
9500
9531
|
var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
9501
9532
|
|
9502
9533
|
const Commodity$1 = (_a) => {
|
9503
|
-
var _b, _c, _d, _e, _f, _g, _h;
|
9534
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
9504
9535
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
9505
9536
|
const { sxpParameter } = useSxpDataSource();
|
9506
9537
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9507
|
-
const src = (
|
9538
|
+
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;
|
9508
9539
|
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9509
9540
|
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9510
9541
|
React.createElement(FormatImage$1, { className: css.css({
|
@@ -9522,8 +9553,8 @@ const Commodity$1 = (_a) => {
|
|
9522
9553
|
width: '100%',
|
9523
9554
|
overflow: 'hidden'
|
9524
9555
|
}) },
|
9525
|
-
React.createElement("div", { className: styles$6['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9526
|
-
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9556
|
+
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'),
|
9557
|
+
React.createElement("div", { className: css.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'))));
|
9527
9558
|
};
|
9528
9559
|
var CommodityComponent = React.memo(Commodity$1);
|
9529
9560
|
|
@@ -9749,11 +9780,11 @@ var interactionRender$4 = [
|
|
9749
9780
|
var styles$4 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__yyHVb"};
|
9750
9781
|
|
9751
9782
|
const CommodityDiro$1 = (_a) => {
|
9752
|
-
var _b, _c, _d, _e, _f, _g, _h;
|
9783
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
9753
9784
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
9754
9785
|
const { sxpParameter } = useSxpDataSource();
|
9755
9786
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9756
|
-
const src = (
|
9787
|
+
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;
|
9757
9788
|
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9758
9789
|
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9759
9790
|
React.createElement(FormatImage$1, { className: css.css({
|
@@ -9771,8 +9802,8 @@ const CommodityDiro$1 = (_a) => {
|
|
9771
9802
|
width: '100%',
|
9772
9803
|
overflow: 'hidden'
|
9773
9804
|
}) },
|
9774
|
-
React.createElement("div", { className: styles$4['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9775
|
-
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9805
|
+
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'),
|
9806
|
+
React.createElement("div", { className: css.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'))));
|
9776
9807
|
};
|
9777
9808
|
var CommodityDiroComponent = React.memo(CommodityDiro$1);
|
9778
9809
|
|
@@ -9847,11 +9878,11 @@ var interactionRender$3 = [
|
|
9847
9878
|
var styles$3 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__I-yCC"};
|
9848
9879
|
|
9849
9880
|
const CommodityDiroNew$1 = (_a) => {
|
9850
|
-
var _b, _c, _d, _e, _f, _g, _h;
|
9881
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
9851
9882
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
9852
9883
|
const { sxpParameter } = useSxpDataSource();
|
9853
9884
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9854
|
-
const src = (
|
9885
|
+
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;
|
9855
9886
|
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9856
9887
|
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9857
9888
|
React.createElement(FormatImage$1, { className: css.css({
|
@@ -9869,8 +9900,8 @@ const CommodityDiroNew$1 = (_a) => {
|
|
9869
9900
|
width: '100%',
|
9870
9901
|
overflow: 'hidden'
|
9871
9902
|
}) },
|
9872
|
-
React.createElement("div", { className: styles$3['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9873
|
-
React.createElement("div", { className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9903
|
+
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'),
|
9904
|
+
React.createElement("div", { className: css.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'))));
|
9874
9905
|
};
|
9875
9906
|
var CommodityDiroNewComponent = React.memo(CommodityDiroNew$1);
|
9876
9907
|
|
@@ -9999,10 +10030,10 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
9999
10030
|
}
|
10000
10031
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10001
10032
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10002
|
-
var _a, _b, _c, _d, _e, _f;
|
10033
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
10003
10034
|
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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10004
10035
|
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
10005
|
-
React.createElement(Img$1, { src: (
|
10036
|
+
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: {
|
10006
10037
|
transform: `translateY(${translateY}%)`
|
10007
10038
|
} })),
|
10008
10039
|
React.createElement("div", { className: css.css({
|
@@ -10013,8 +10044,8 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
10013
10044
|
width: '100%',
|
10014
10045
|
overflow: 'hidden'
|
10015
10046
|
}) },
|
10016
|
-
React.createElement("div", { className: styles$2['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
10017
|
-
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
10047
|
+
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'),
|
10048
|
+
React.createElement("div", { className: css.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'))));
|
10018
10049
|
})));
|
10019
10050
|
};
|
10020
10051
|
var MultiCommodityDiroComponent = React.memo(MultiCommodityDiro$1);
|
@@ -10114,10 +10145,10 @@ const MultiCommodity$1 = (_a) => {
|
|
10114
10145
|
}
|
10115
10146
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10116
10147
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10117
|
-
var _a, _b, _c, _d, _e, _f;
|
10148
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
10118
10149
|
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10119
10150
|
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
10120
|
-
React.createElement(Img$1, { src: (
|
10151
|
+
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: {
|
10121
10152
|
transform: `translateY(${translateY}%)`
|
10122
10153
|
} })),
|
10123
10154
|
React.createElement("div", { className: css.css({
|
@@ -10128,8 +10159,8 @@ const MultiCommodity$1 = (_a) => {
|
|
10128
10159
|
width: '100%',
|
10129
10160
|
overflow: 'hidden'
|
10130
10161
|
}) },
|
10131
|
-
React.createElement("div", { className: styles$1['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
10132
|
-
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
10162
|
+
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'),
|
10163
|
+
React.createElement("div", { className: css.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'))));
|
10133
10164
|
})));
|
10134
10165
|
};
|
10135
10166
|
var MultiCommodityComponent = React.memo(MultiCommodity$1);
|
@@ -10228,10 +10259,10 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
10228
10259
|
}
|
10229
10260
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10230
10261
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10231
|
-
var _a, _b, _c, _d, _e, _f;
|
10262
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
10232
10263
|
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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10233
10264
|
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
10234
|
-
React.createElement(Img$1, { src: (
|
10265
|
+
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: {
|
10235
10266
|
transform: `translateY(${translateY}%)`
|
10236
10267
|
} })),
|
10237
10268
|
React.createElement("div", { className: css.css({
|
@@ -10243,8 +10274,8 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
10243
10274
|
overflow: 'hidden',
|
10244
10275
|
lineHeight: '20px'
|
10245
10276
|
}) },
|
10246
|
-
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
10247
|
-
React.createElement("div", { className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
10277
|
+
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'),
|
10278
|
+
React.createElement("div", { className: css.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'))));
|
10248
10279
|
})));
|
10249
10280
|
};
|
10250
10281
|
var MultiCommodityDiroNewComponent = React.memo(MultiCommodityDiroNew$1);
|
@@ -10311,7 +10342,7 @@ var _a, _b;
|
|
10311
10342
|
* @Author: binruan@chatlabs.com
|
10312
10343
|
* @Date: 2024-04-07 14:07:12
|
10313
10344
|
* @LastEditors: binruan@chatlabs.com
|
10314
|
-
* @LastEditTime: 2024-
|
10345
|
+
* @LastEditTime: 2024-05-23 11:03:15
|
10315
10346
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\HashTag\settingRender.tsx
|
10316
10347
|
*
|
10317
10348
|
*/
|
@@ -10319,11 +10350,11 @@ var settingRender = [
|
|
10319
10350
|
{
|
10320
10351
|
title: '卡片样式',
|
10321
10352
|
child: [
|
10322
|
-
{
|
10323
|
-
|
10324
|
-
|
10325
|
-
|
10326
|
-
},
|
10353
|
+
// {
|
10354
|
+
// type: 'Number',
|
10355
|
+
// label: '文本行数',
|
10356
|
+
// name: ['props', 'lineClamp']
|
10357
|
+
// },
|
10327
10358
|
{
|
10328
10359
|
type: 'Number',
|
10329
10360
|
label: '上下边距',
|
@@ -11807,19 +11838,15 @@ const WaterfallFlowItem = (props) => {
|
|
11807
11838
|
const canvasRef = React.useRef(null);
|
11808
11839
|
const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
|
11809
11840
|
const src = React.useMemo(() => {
|
11810
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
11841
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
11811
11842
|
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) {
|
11812
11843
|
return (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
|
11813
11844
|
}
|
11814
|
-
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.
|
11815
|
-
|
11816
|
-
return (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.url;
|
11845
|
+
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) {
|
11846
|
+
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];
|
11817
11847
|
}
|
11818
|
-
else if ((
|
11819
|
-
return (
|
11820
|
-
}
|
11821
|
-
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) {
|
11822
|
-
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];
|
11848
|
+
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) {
|
11849
|
+
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];
|
11823
11850
|
}
|
11824
11851
|
else {
|
11825
11852
|
return (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) || '';
|
@@ -12238,17 +12265,17 @@ const LikeButton = (_a) => {
|
|
12238
12265
|
if (state) {
|
12239
12266
|
// 先设置状态
|
12240
12267
|
setState(false);
|
12241
|
-
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;
|
12268
|
+
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;
|
12242
12269
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12243
12270
|
eventInfo: {
|
12244
12271
|
eventSubject: 'favoriteContentCanceled',
|
12245
12272
|
eventDescription: 'This content was unfavorite by the user',
|
12246
|
-
contentId: (_f = (_e = recData.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
|
12247
|
-
contentName: (_h = (_g = recData.video) === null || _g === void 0 ? void 0 : _g.title) !== null && _h !== void 0 ? _h : '',
|
12248
|
-
contentTags: JSON.stringify((_k = (_j = recData.video) === null || _j === void 0 ? void 0 : _j.tags) !== null && _k !== void 0 ? _k : []),
|
12273
|
+
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 : '',
|
12274
|
+
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 : '',
|
12275
|
+
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 : []),
|
12249
12276
|
position: position + '',
|
12250
|
-
contentFormat: ((_l = recData.video) === null || _l === void 0 ? void 0 : _l.url) ? 'video' : 'image',
|
12251
|
-
traceInfo: (_m = recData.video) === null || _m === void 0 ? void 0 : _m.traceInfo
|
12277
|
+
contentFormat: ((_l = recData === null || recData === void 0 ? void 0 : recData.video) === null || _l === void 0 ? void 0 : _l.url) ? 'video' : 'image',
|
12278
|
+
traceInfo: (_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.traceInfo
|
12252
12279
|
}
|
12253
12280
|
});
|
12254
12281
|
// 如果接口调用失败,则回滚状态
|
@@ -12263,12 +12290,12 @@ const LikeButton = (_a) => {
|
|
12263
12290
|
eventInfo: {
|
12264
12291
|
eventSubject: 'favoriteContent',
|
12265
12292
|
eventDescription: 'This content was favorite by the user',
|
12266
|
-
contentId: (_q = (_p = recData.video) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : '',
|
12267
|
-
contentName: (_s = (_r = recData.video) === null || _r === void 0 ? void 0 : _r.title) !== null && _s !== void 0 ? _s : '',
|
12268
|
-
contentTags: JSON.stringify((_u = (_t = recData.video) === null || _t === void 0 ? void 0 : _t.tags) !== null && _u !== void 0 ? _u : []),
|
12293
|
+
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 : '',
|
12294
|
+
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 : '',
|
12295
|
+
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 : []),
|
12269
12296
|
position: position + '',
|
12270
|
-
contentFormat: ((_v = recData.video) === null || _v === void 0 ? void 0 : _v.url) ? 'video' : 'image',
|
12271
|
-
traceInfo: (_w = recData.video) === null || _w === void 0 ? void 0 : _w.traceInfo
|
12297
|
+
contentFormat: ((_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.url) ? 'video' : 'image',
|
12298
|
+
traceInfo: (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.traceInfo
|
12272
12299
|
}
|
12273
12300
|
});
|
12274
12301
|
if (!result) {
|
@@ -12346,15 +12373,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12346
12373
|
eventInfo: {
|
12347
12374
|
eventSubject: 'playVideo',
|
12348
12375
|
eventDescription: 'User played the video',
|
12349
|
-
contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
12350
|
-
contentName: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
|
12376
|
+
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 : '',
|
12377
|
+
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 : '',
|
12351
12378
|
playType,
|
12352
12379
|
startTime: videoCurrentTime,
|
12353
12380
|
videoDuration,
|
12354
|
-
contentTags: JSON.stringify((_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
|
12381
|
+
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 : []),
|
12355
12382
|
position: index + '',
|
12356
12383
|
contentFormat: 'video',
|
12357
|
-
traceInfo: (_j = item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
|
12384
|
+
traceInfo: (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
|
12358
12385
|
}
|
12359
12386
|
});
|
12360
12387
|
setIsFirstPlay(false);
|
@@ -12444,15 +12471,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12444
12471
|
eventInfo: {
|
12445
12472
|
eventSubject: 'playOverVideo',
|
12446
12473
|
eventDescription: 'User finished playing the video',
|
12447
|
-
contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
12448
|
-
contentName: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
|
12474
|
+
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 : '',
|
12475
|
+
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 : '',
|
12449
12476
|
endTime: videoCurrentTime,
|
12450
12477
|
videoDuration,
|
12451
12478
|
playDuration,
|
12452
|
-
contentTags: JSON.stringify((_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
|
12479
|
+
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 : []),
|
12453
12480
|
position: index + '',
|
12454
12481
|
contentFormat: 'video',
|
12455
|
-
traceInfo: (_j = item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
|
12482
|
+
traceInfo: (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
|
12456
12483
|
}
|
12457
12484
|
});
|
12458
12485
|
}
|
@@ -12460,9 +12487,10 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12460
12487
|
React.useEffect(() => {
|
12461
12488
|
if (!isActive || !videoRef)
|
12462
12489
|
return;
|
12463
|
-
const videoSrc = rec.video.url;
|
12490
|
+
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
|
12464
12491
|
if (!videoSrc)
|
12465
12492
|
return;
|
12493
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
|
12466
12494
|
setIsPauseVideo(false);
|
12467
12495
|
const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
|
12468
12496
|
const dom = document.querySelector('#player-container-id');
|
@@ -12470,7 +12498,6 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12470
12498
|
if (!dom && !dom2)
|
12471
12499
|
return;
|
12472
12500
|
videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
|
12473
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
|
12474
12501
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadedmetadata', handleLoadedmetadata);
|
12475
12502
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadeddata', handLoadeddata);
|
12476
12503
|
// videoRef?.on('canplay', handleCanplay);
|
@@ -12551,10 +12578,10 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12551
12578
|
window.removeEventListener('beforeunload', handleBeforeUnload);
|
12552
12579
|
};
|
12553
12580
|
}, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
|
12554
|
-
if (!rec.video) {
|
12581
|
+
if (!(rec === null || rec === void 0 ? void 0 : rec.video)) {
|
12555
12582
|
return null;
|
12556
12583
|
}
|
12557
|
-
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) },
|
12584
|
+
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) },
|
12558
12585
|
!isBgColor && (React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) })),
|
12559
12586
|
React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
|
12560
12587
|
React.createElement("div", { style: {
|
@@ -12569,7 +12596,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12569
12596
|
React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
|
12570
12597
|
React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
|
12571
12598
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
12572
|
-
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, style: {
|
12599
|
+
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, style: {
|
12573
12600
|
position: 'relative',
|
12574
12601
|
width: '100%',
|
12575
12602
|
height,
|
@@ -12868,7 +12895,7 @@ var RenderCard$1 = React.memo(RenderCard);
|
|
12868
12895
|
* @Author: binruan@chatlabs.com
|
12869
12896
|
* @Date: 2024-03-26 10:07:41
|
12870
12897
|
* @LastEditors: binruan@chatlabs.com
|
12871
|
-
* @LastEditTime: 2024-
|
12898
|
+
* @LastEditTime: 2024-05-23 14:31:12
|
12872
12899
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Nudge\index.tsx
|
12873
12900
|
*
|
12874
12901
|
*/
|
@@ -12881,8 +12908,8 @@ const Nudge = ({ nudge }) => {
|
|
12881
12908
|
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
12882
12909
|
borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
|
12883
12910
|
} },
|
12884
|
-
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
|
12885
|
-
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 : '')))));
|
12911
|
+
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover', flexShrink: 0 } }) : null,
|
12912
|
+
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 : '')))));
|
12886
12913
|
};
|
12887
12914
|
|
12888
12915
|
const DEFAULT_TAG = 'FOR U';
|
@@ -12926,7 +12953,7 @@ var Tagbar$1 = React.memo(Tagbar);
|
|
12926
12953
|
* @Author: binruan@chatlabs.com
|
12927
12954
|
* @Date: 2024-01-15 19:03:09
|
12928
12955
|
* @LastEditors: binruan@chatlabs.com
|
12929
|
-
* @LastEditTime: 2024-05-
|
12956
|
+
* @LastEditTime: 2024-05-24 16:32:06
|
12930
12957
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12931
12958
|
*
|
12932
12959
|
*/
|
@@ -12986,23 +13013,29 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12986
13013
|
};
|
12987
13014
|
const firstRef = React.useRef();
|
12988
13015
|
React.useEffect(() => {
|
12989
|
-
|
13016
|
+
var _a, _b, _c;
|
13017
|
+
if (!firstRef.current && !videoRef && (playerRef === null || playerRef === void 0 ? void 0 : playerRef.current) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
|
12990
13018
|
firstRef.current = true;
|
12991
13019
|
const player = TCPlayer('player-container-id', {
|
12992
13020
|
licenseUrl, // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
|
12993
13021
|
controls: false,
|
12994
|
-
autoplay: false,
|
12995
13022
|
loop: false,
|
13023
|
+
autoplay: true,
|
12996
13024
|
muted: true,
|
12997
13025
|
preload: 'auto',
|
12998
13026
|
posterImage: false,
|
12999
|
-
bigPlayButton: true
|
13027
|
+
bigPlayButton: true,
|
13028
|
+
sources: [
|
13029
|
+
{
|
13030
|
+
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 : ''
|
13031
|
+
}
|
13032
|
+
]
|
13000
13033
|
});
|
13001
13034
|
player === null || player === void 0 ? void 0 : player.ready(() => {
|
13002
13035
|
setVideoRef(player);
|
13003
13036
|
});
|
13004
13037
|
}
|
13005
|
-
}, [videoRef, licenseUrl]);
|
13038
|
+
}, [videoRef, licenseUrl, data]);
|
13006
13039
|
React.useEffect(() => {
|
13007
13040
|
if (!isInit)
|
13008
13041
|
handleH5EnterLink();
|
@@ -13057,7 +13090,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13057
13090
|
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))) {
|
13058
13091
|
fromKName = 'pdpPage';
|
13059
13092
|
}
|
13060
|
-
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') {
|
13093
|
+
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') {
|
13061
13094
|
fromKName = 'formPage';
|
13062
13095
|
}
|
13063
13096
|
else if (isFromHashtag) {
|
@@ -13082,7 +13115,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13082
13115
|
position: activeIndex + '',
|
13083
13116
|
fromKName,
|
13084
13117
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
13085
|
-
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 : ''
|
13118
|
+
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 : ''
|
13086
13119
|
}
|
13087
13120
|
});
|
13088
13121
|
}
|
@@ -13120,11 +13153,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13120
13153
|
}, [globalConfig]);
|
13121
13154
|
const renderContent = React.useCallback((rec, index) => {
|
13122
13155
|
var _a, _b, _c, _d;
|
13123
|
-
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13156
|
+
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13124
13157
|
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 }));
|
13125
13158
|
}
|
13126
|
-
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13127
|
-
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 }));
|
13159
|
+
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13160
|
+
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 }));
|
13128
13161
|
}
|
13129
13162
|
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) {
|
13130
13163
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
@@ -13165,16 +13198,16 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13165
13198
|
}, [isShowMore]);
|
13166
13199
|
const renderBottom = React.useCallback((rec, index) => {
|
13167
13200
|
var _a, _b, _c, _d, _e, _f, _g;
|
13168
|
-
if (rec.video) {
|
13201
|
+
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
13169
13202
|
return (React.createElement(React.Fragment, null,
|
13170
|
-
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
13203
|
+
((_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' }),
|
13171
13204
|
React.createElement("div", { className: 'clc-sxp-bottom' },
|
13172
13205
|
React.createElement(Nudge, { nudge: nudge }),
|
13173
13206
|
(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' },
|
13174
13207
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
|
13175
13208
|
React.createElement("div", null,
|
13176
|
-
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 }),
|
13177
|
-
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 })))));
|
13209
|
+
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 }),
|
13210
|
+
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 })))));
|
13178
13211
|
}
|
13179
13212
|
return null;
|
13180
13213
|
}, [
|
@@ -13198,7 +13231,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13198
13231
|
if (waterFallData && top < 40) {
|
13199
13232
|
top += 40;
|
13200
13233
|
}
|
13201
|
-
if (rec.video) {
|
13234
|
+
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
13202
13235
|
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: {
|
13203
13236
|
[(_b = globalConfig.likeIconXPosit) !== null && _b !== void 0 ? _b : 'right']: (_c = globalConfig.likeIconX) !== null && _c !== void 0 ? _c : 0,
|
13204
13237
|
[(_d = globalConfig.likeIconYPosit) !== null && _d !== void 0 ? _d : 'bottom']: top
|
@@ -13208,27 +13241,27 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13208
13241
|
}, [globalConfig, waterFallData]);
|
13209
13242
|
const handleReportViewImageEnd = (item) => {
|
13210
13243
|
var _a, _b, _c, _d, _e, _f;
|
13211
|
-
if (!((_a = item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
|
13244
|
+
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)) {
|
13212
13245
|
const endTime = Date.now();
|
13213
13246
|
const duration = (endTime - viewImageStartTime.current) / 1000;
|
13214
13247
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13215
13248
|
eventInfo: {
|
13216
13249
|
eventSubject: 'viewImageCarouselEnd',
|
13217
13250
|
eventDescription: 'User end view the image carousel',
|
13218
|
-
contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
13219
|
-
contentName: (_e = item.video.title) !== null && _e !== void 0 ? _e : '',
|
13251
|
+
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 : '',
|
13252
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
13220
13253
|
imageEndTime: `${endTime}`,
|
13221
13254
|
playDuration: `${duration}`,
|
13222
|
-
contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
|
13255
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
13223
13256
|
position: activeIndex + '',
|
13224
13257
|
contentFormat: 'image',
|
13225
|
-
traceInfo: item.video.traceInfo
|
13258
|
+
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
13226
13259
|
}
|
13227
13260
|
});
|
13228
13261
|
}
|
13229
13262
|
};
|
13230
13263
|
const handleScrollEvent = (swiper) => {
|
13231
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
13264
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
13232
13265
|
viewTime.current = new Date();
|
13233
13266
|
const item = data[swiper.previousIndex];
|
13234
13267
|
if (!item)
|
@@ -13238,8 +13271,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13238
13271
|
eventInfo: {
|
13239
13272
|
eventSubject: 'scrollDown',
|
13240
13273
|
eventDescription: 'User scroll down',
|
13241
|
-
contentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
|
13242
|
-
productId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
13274
|
+
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 : '',
|
13275
|
+
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 : '',
|
13243
13276
|
requestId: null
|
13244
13277
|
}
|
13245
13278
|
});
|
@@ -13251,7 +13284,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13251
13284
|
eventInfo: {
|
13252
13285
|
eventSubject: 'scrollUp',
|
13253
13286
|
eventDescription: 'User scroll up',
|
13254
|
-
contentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
|
13287
|
+
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 : '',
|
13255
13288
|
productId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13256
13289
|
requestId: null
|
13257
13290
|
}
|
@@ -13261,14 +13294,17 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13261
13294
|
}
|
13262
13295
|
// 商品浏览事件
|
13263
13296
|
handleReportProductView(item);
|
13297
|
+
const curItem = data[swiper.activeIndex];
|
13298
|
+
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)) {
|
13299
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
13300
|
+
eventName: 'ProductView'
|
13301
|
+
});
|
13302
|
+
}
|
13264
13303
|
};
|
13265
13304
|
const handleReportProductView = (item) => {
|
13266
13305
|
var _a, _b, _c;
|
13267
13306
|
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)) {
|
13268
13307
|
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);
|
13269
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
13270
|
-
eventName: 'ProductView'
|
13271
|
-
});
|
13272
13308
|
}
|
13273
13309
|
};
|
13274
13310
|
React.useEffect(() => {
|
@@ -13287,13 +13323,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13287
13323
|
eventInfo: {
|
13288
13324
|
eventSubject: 'viewImageCarouselStart',
|
13289
13325
|
eventDescription: 'User start view the image carousel',
|
13290
|
-
contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
13291
|
-
contentName: (_e = item.video.title) !== null && _e !== void 0 ? _e : '',
|
13326
|
+
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 : '',
|
13327
|
+
contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
|
13292
13328
|
imageStartTime: `${startTime}`,
|
13293
|
-
contentTags: JSON.stringify((_f = item.video.tags) !== null && _f !== void 0 ? _f : []),
|
13329
|
+
contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
|
13294
13330
|
position: activeIndex + '',
|
13295
13331
|
contentFormat: 'image',
|
13296
|
-
traceInfo: item.video.traceInfo
|
13332
|
+
traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
|
13297
13333
|
}
|
13298
13334
|
});
|
13299
13335
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
@@ -13439,15 +13475,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
13439
13475
|
eventInfo: {
|
13440
13476
|
eventSubject: 'playVideo',
|
13441
13477
|
eventDescription: 'User played the video',
|
13442
|
-
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13443
|
-
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13478
|
+
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 : '',
|
13479
|
+
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 : '',
|
13444
13480
|
playType,
|
13445
13481
|
startTime: videoCurrentTime,
|
13446
13482
|
videoDuration,
|
13447
|
-
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13483
|
+
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 : []),
|
13448
13484
|
position: index + '',
|
13449
13485
|
contentFormat: 'video',
|
13450
|
-
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13486
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13451
13487
|
}
|
13452
13488
|
});
|
13453
13489
|
setIsFirstPlay(false);
|
@@ -13496,15 +13532,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
13496
13532
|
eventInfo: {
|
13497
13533
|
eventSubject: 'playOverVideo',
|
13498
13534
|
eventDescription: 'User finished playing the video',
|
13499
|
-
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13500
|
-
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13535
|
+
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 : '',
|
13536
|
+
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 : '',
|
13501
13537
|
endTime: videoCurrentTime,
|
13502
13538
|
videoDuration,
|
13503
13539
|
playDuration,
|
13504
|
-
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13540
|
+
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 : []),
|
13505
13541
|
position: index + '',
|
13506
13542
|
contentFormat: 'video',
|
13507
|
-
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13543
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13508
13544
|
}
|
13509
13545
|
});
|
13510
13546
|
}
|
@@ -13541,10 +13577,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
13541
13577
|
return;
|
13542
13578
|
setIsPauseVideo(false);
|
13543
13579
|
if (!videoRef.current.src) {
|
13544
|
-
const videoSrc = rec.video.url;
|
13580
|
+
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
|
13545
13581
|
if (videoSrc.includes('.m3u8')) {
|
13546
|
-
if (Hls.isSupported()) {
|
13547
|
-
const hls = new Hls();
|
13582
|
+
if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.Hls.isSupported())) {
|
13583
|
+
const hls = new window.Hls();
|
13548
13584
|
hls.loadSource(videoSrc);
|
13549
13585
|
hls.attachMedia(videoRef.current);
|
13550
13586
|
}
|
@@ -13572,7 +13608,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
13572
13608
|
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
|
13573
13609
|
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
|
13574
13610
|
};
|
13575
|
-
}, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
|
13611
|
+
}, [handleLoadedMetadata, handlePlaying, rec === null || rec === void 0 ? void 0 : rec.video, handLoadeddata]);
|
13576
13612
|
const renderPoster = React.useMemo(() => {
|
13577
13613
|
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
13578
13614
|
return null;
|
@@ -13599,10 +13635,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
13599
13635
|
}
|
13600
13636
|
: {};
|
13601
13637
|
}, [blur]);
|
13602
|
-
if (!rec.video) {
|
13638
|
+
if (!(rec === null || rec === void 0 ? void 0 : rec.video)) {
|
13603
13639
|
return null;
|
13604
13640
|
}
|
13605
|
-
return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
13641
|
+
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: {
|
13606
13642
|
position: 'relative',
|
13607
13643
|
width,
|
13608
13644
|
height,
|
@@ -13627,7 +13663,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
13627
13663
|
objectFit: 'contain'
|
13628
13664
|
} }),
|
13629
13665
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
13630
|
-
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
13666
|
+
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, onClick: handleClickVideo(), style: {
|
13631
13667
|
position: 'relative',
|
13632
13668
|
width,
|
13633
13669
|
height,
|
@@ -13658,11 +13694,11 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
13658
13694
|
}, [globalConfig, containerHeight, tagList]);
|
13659
13695
|
const renderContent = (rec, index) => {
|
13660
13696
|
var _a, _b, _c, _d;
|
13661
|
-
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13697
|
+
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13662
13698
|
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 }));
|
13663
13699
|
}
|
13664
|
-
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13665
|
-
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 }));
|
13700
|
+
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13701
|
+
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 }));
|
13666
13702
|
}
|
13667
13703
|
if (rec.product) {
|
13668
13704
|
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) {
|
@@ -13696,15 +13732,15 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
13696
13732
|
};
|
13697
13733
|
const renderBottom = (rec, index) => {
|
13698
13734
|
var _a, _b, _c, _d, _e, _f, _g;
|
13699
|
-
if (rec.video) {
|
13735
|
+
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
13700
13736
|
return (React.createElement(React.Fragment, null,
|
13701
|
-
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
13737
|
+
((_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' }),
|
13702
13738
|
React.createElement("div", { className: 'clc-sxp-bottom' },
|
13703
13739
|
React.createElement(Nudge, { nudge: nudge }),
|
13704
13740
|
CTA(rec, index),
|
13705
13741
|
React.createElement("div", null,
|
13706
|
-
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' }) })),
|
13707
|
-
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 }))));
|
13742
|
+
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' }) })),
|
13743
|
+
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 }))));
|
13708
13744
|
}
|
13709
13745
|
return null;
|
13710
13746
|
};
|
@@ -13718,7 +13754,7 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
13718
13754
|
if (top < 40) {
|
13719
13755
|
top += 40;
|
13720
13756
|
}
|
13721
|
-
if (rec.video) {
|
13757
|
+
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
13722
13758
|
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: {
|
13723
13759
|
top,
|
13724
13760
|
right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0
|
@@ -13830,7 +13866,7 @@ const Popup = () => {
|
|
13830
13866
|
* @Author: binruan@chatlabs.com
|
13831
13867
|
* @Date: 2024-01-15 19:03:09
|
13832
13868
|
* @LastEditors: binruan@chatlabs.com
|
13833
|
-
* @LastEditTime: 2024-05-
|
13869
|
+
* @LastEditTime: 2024-05-17 18:41:05
|
13834
13870
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
|
13835
13871
|
*
|
13836
13872
|
*/
|
@@ -13847,14 +13883,14 @@ Object.values(_materials_).forEach((v) => {
|
|
13847
13883
|
RESOLVER[v.extend.type] = v;
|
13848
13884
|
});
|
13849
13885
|
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl, enabledMetaConversionApi }) => {
|
13850
|
-
var _a, _b, _c, _d, _e, _f;
|
13886
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
13851
13887
|
const utmVal = React.useMemo(() => {
|
13852
13888
|
var _a;
|
13853
13889
|
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('?', '') : '';
|
13854
13890
|
return searchParams;
|
13855
13891
|
}, []);
|
13856
13892
|
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
|
13857
|
-
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 }) => {
|
13893
|
+
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 }) => {
|
13858
13894
|
var _a;
|
13859
13895
|
return (React.createElement(React.Fragment, null,
|
13860
13896
|
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 })),
|