pb-sxp-ui 1.0.43 → 1.0.44
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 +490 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +48 -4
- package/dist/index.js +489 -58
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +493 -62
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/PictureGroup.d.ts +13 -0
- package/es/core/components/DiyPortalPreview/PictureGroup.js +11 -0
- package/es/core/components/DiyPortalPreview/VideoWidget.d.ts +15 -0
- package/es/core/components/DiyPortalPreview/VideoWidget.js +236 -0
- package/es/core/components/DiyPortalPreview/index.d.ts +6 -0
- package/es/core/components/DiyPortalPreview/index.js +127 -0
- package/es/core/components/SxpPageCore/index.js +2 -2
- package/es/core/components/SxpPageRender/Nudge/index.js +6 -5
- package/es/core/components/SxpPageRender/Tagbar.d.ts +7 -0
- package/es/core/components/SxpPageRender/Tagbar.js +37 -0
- package/es/core/components/SxpPageRender/WaterFall/index.js +1 -1
- package/es/core/components/SxpPageRender/index.d.ts +2 -0
- package/es/core/components/SxpPageRender/index.js +21 -12
- package/es/core/context/SxpDataSourceProvider.d.ts +3 -0
- package/es/core/context/SxpDataSourceProvider.js +28 -4
- package/es/core/hooks/useEventReport.js +4 -4
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +6 -6
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +9 -9
- package/lib/core/components/DiyPortalPreview/PictureGroup.d.ts +13 -0
- package/lib/core/components/DiyPortalPreview/PictureGroup.js +14 -0
- package/lib/core/components/DiyPortalPreview/VideoWidget.d.ts +15 -0
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +239 -0
- package/lib/core/components/DiyPortalPreview/index.d.ts +6 -0
- package/lib/core/components/DiyPortalPreview/index.js +130 -0
- package/lib/core/components/SxpPageCore/index.js +2 -2
- package/lib/core/components/SxpPageRender/Nudge/index.js +6 -5
- package/lib/core/components/SxpPageRender/Tagbar.d.ts +7 -0
- package/lib/core/components/SxpPageRender/Tagbar.js +40 -0
- package/lib/core/components/SxpPageRender/WaterFall/index.js +1 -1
- package/lib/core/components/SxpPageRender/index.d.ts +2 -0
- package/lib/core/components/SxpPageRender/index.js +21 -12
- package/lib/core/context/SxpDataSourceProvider.d.ts +3 -0
- package/lib/core/context/SxpDataSourceProvider.js +28 -4
- package/lib/core/hooks/useEventReport.js +4 -4
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +6 -6
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +9 -9
- package/package.json +2 -1
package/dist/index.js
CHANGED
@@ -7,6 +7,7 @@ import { css } from '@emotion/css';
|
|
7
7
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
8
8
|
import * as ReactDOM from 'react-dom';
|
9
9
|
import EventEmitter from 'eventemitter3';
|
10
|
+
import Hls from 'hls.js';
|
10
11
|
|
11
12
|
/******************************************************************************
|
12
13
|
Copyright (c) Microsoft Corporation.
|
@@ -407,7 +408,8 @@ function useIconLink(path, domain) {
|
|
407
408
|
}
|
408
409
|
|
409
410
|
const SxpDataSourceContext = createContext({
|
410
|
-
rtcList: []
|
411
|
+
rtcList: [],
|
412
|
+
tagList: []
|
411
413
|
});
|
412
414
|
var DataSourceType;
|
413
415
|
(function (DataSourceType) {
|
@@ -416,6 +418,7 @@ var DataSourceType;
|
|
416
418
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
417
419
|
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
|
418
420
|
const [rtcList, setRtcList] = useState([]);
|
421
|
+
const [tagList, setTagList] = useState([]);
|
419
422
|
const [loading, setLoading] = useState(false);
|
420
423
|
const [curReqInfo, setCurReqInfo] = useState({ rtc: '', requestId: '' });
|
421
424
|
const swiperRef = useRef(null);
|
@@ -540,6 +543,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
540
543
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
|
541
544
|
return res === null || res === void 0 ? void 0 : res.success;
|
542
545
|
}), [bffFetch]);
|
546
|
+
// 获取 Tag
|
547
|
+
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
548
|
+
var _g, _h;
|
549
|
+
if (!utmVal)
|
550
|
+
return;
|
551
|
+
try {
|
552
|
+
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: utmVal } }));
|
553
|
+
setTagList((_h = (_g = result === null || result === void 0 ? void 0 : result.data) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []);
|
554
|
+
}
|
555
|
+
catch (e) {
|
556
|
+
console.log('e', e);
|
557
|
+
}
|
558
|
+
}), [bffFetch, utmVal]);
|
543
559
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
544
560
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
545
561
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
@@ -555,11 +571,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
555
571
|
fromKName = 'imagePage';
|
556
572
|
}
|
557
573
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
558
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '',
|
574
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
|
559
575
|
});
|
560
576
|
}, [bffEventReport, isFromHashtag]);
|
561
577
|
useEffect(() => {
|
562
578
|
setLoading(true);
|
579
|
+
bffGetTagList();
|
563
580
|
getRecommendVideos()
|
564
581
|
.then((data) => {
|
565
582
|
var _a, _b;
|
@@ -575,6 +592,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
575
592
|
if (!isInit.current)
|
576
593
|
return;
|
577
594
|
setLoading(true);
|
595
|
+
bffGetTagList();
|
578
596
|
getRecommendVideos()
|
579
597
|
.then((data) => {
|
580
598
|
var _a, _b;
|
@@ -584,7 +602,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
584
602
|
.finally(() => {
|
585
603
|
setLoading(false);
|
586
604
|
});
|
587
|
-
}, [getRecommendVideos]);
|
605
|
+
}, [getRecommendVideos, bffGetTagList]);
|
588
606
|
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
589
607
|
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
590
608
|
rtcList,
|
@@ -617,9 +635,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
617
635
|
hashTagSize,
|
618
636
|
loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage,
|
619
637
|
isOpenHashTag,
|
638
|
+
tagList,
|
639
|
+
setLoading,
|
620
640
|
videoRef,
|
621
641
|
setVideoRef
|
622
|
-
} }, render({
|
642
|
+
} }, render({
|
643
|
+
rtcList,
|
644
|
+
mutateLike: bffMutateLike,
|
645
|
+
mutateUnlike: bffMutateUnlike,
|
646
|
+
submitForm: bffSubmitForm,
|
647
|
+
tagList
|
648
|
+
})));
|
623
649
|
};
|
624
650
|
var SxpDataSourceProvider$1 = memo(SxpDataSourceProvider);
|
625
651
|
|
@@ -844,7 +870,7 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
|
|
844
870
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
845
871
|
});
|
846
872
|
|
847
|
-
var index$
|
873
|
+
var index$2 = /*#__PURE__*/Object.freeze({
|
848
874
|
__proto__: null,
|
849
875
|
EditorCore: EditorCore
|
850
876
|
});
|
@@ -8130,8 +8156,8 @@ function useEventReport() {
|
|
8130
8156
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8131
8157
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
8132
8158
|
position: position + '',
|
8133
|
-
|
8134
|
-
|
8159
|
+
contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
|
8160
|
+
ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
8135
8161
|
traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
|
8136
8162
|
}
|
8137
8163
|
});
|
@@ -8155,8 +8181,8 @@ function useEventReport() {
|
|
8155
8181
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8156
8182
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
8157
8183
|
position: position + '',
|
8158
|
-
|
8159
|
-
|
8184
|
+
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
8185
|
+
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
8160
8186
|
traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
|
8161
8187
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
8162
8188
|
eventSubject: 'productView',
|
@@ -8319,7 +8345,7 @@ const FormatImage = forwardRef((props, ref) => {
|
|
8319
8345
|
var FormatImage$1 = memo(FormatImage);
|
8320
8346
|
|
8321
8347
|
const CommodityDetail$1 = (_a) => {
|
8322
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
8348
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
8323
8349
|
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index"]);
|
8324
8350
|
const { sxpParameter } = useSxpDataSource();
|
8325
8351
|
const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
|
@@ -8360,7 +8386,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8360
8386
|
return '$7,000';
|
8361
8387
|
}
|
8362
8388
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8363
|
-
const width = isPreview ? 375 : window.innerWidth;
|
8389
|
+
const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
|
8364
8390
|
const renderContent = ({ isPost }) => {
|
8365
8391
|
var _a, _b, _c;
|
8366
8392
|
return (React.createElement("div", null,
|
@@ -8380,7 +8406,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8380
8406
|
};
|
8381
8407
|
return (React.createElement("div", { className: 'pb-commondity' },
|
8382
8408
|
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
8383
|
-
product && ((
|
8409
|
+
product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
8384
8410
|
clickable: true,
|
8385
8411
|
bulletActiveClass: 'swipe-item-active-bullet',
|
8386
8412
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -8388,7 +8414,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8388
8414
|
: 'commondityDetail-swiper-clickable-center'
|
8389
8415
|
}, loop: true, autoplay: {
|
8390
8416
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8391
|
-
} }, (
|
8417
|
+
} }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
|
8392
8418
|
return (React.createElement(SwiperSlide, { key: src },
|
8393
8419
|
React.createElement("div", { style: {
|
8394
8420
|
overflow: 'hidden',
|
@@ -8397,7 +8423,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8397
8423
|
} },
|
8398
8424
|
React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
|
8399
8425
|
}))),
|
8400
|
-
!((
|
8426
|
+
!((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
|
8401
8427
|
position: 'relative',
|
8402
8428
|
height: 0,
|
8403
8429
|
width: '100%',
|
@@ -8410,7 +8436,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8410
8436
|
top: 0,
|
8411
8437
|
objectFit: 'cover',
|
8412
8438
|
width: '100%'
|
8413
|
-
}), src: (
|
8439
|
+
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
|
8414
8440
|
React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
8415
8441
|
renderBtn(),
|
8416
8442
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
@@ -8770,7 +8796,7 @@ var settingRender$2 = [
|
|
8770
8796
|
];
|
8771
8797
|
|
8772
8798
|
const CommodityDetailDiroNew$1 = (_a) => {
|
8773
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
8799
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
8774
8800
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
|
8775
8801
|
useState(true);
|
8776
8802
|
const { sxpParameter } = useSxpDataSource();
|
@@ -8818,7 +8844,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
8818
8844
|
return '£102,300.00';
|
8819
8845
|
}
|
8820
8846
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8821
|
-
const width = isPreview ? 375 : window.innerWidth;
|
8847
|
+
const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
|
8822
8848
|
const productInfoText = ({ isPost }) => {
|
8823
8849
|
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8824
8850
|
React.createElement(ExpandableText$1, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
|
@@ -8827,7 +8853,7 @@ Made in Italy` })));
|
|
8827
8853
|
};
|
8828
8854
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
8829
8855
|
React.createElement("div", Object.assign({ ref: scrollRef, className: css(Object.assign({}, style)) }, props),
|
8830
|
-
product && ((
|
8856
|
+
product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
8831
8857
|
clickable: true,
|
8832
8858
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
8833
8859
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -8835,7 +8861,7 @@ Made in Italy` })));
|
|
8835
8861
|
: 'commondityDiroNew-swiper-clickable-center'
|
8836
8862
|
}, loop: true, autoplay: {
|
8837
8863
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8838
|
-
} }, (
|
8864
|
+
} }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
|
8839
8865
|
return (React.createElement(SwiperSlide, { key: src },
|
8840
8866
|
React.createElement("div", { style: {
|
8841
8867
|
overflow: 'hidden',
|
@@ -8844,7 +8870,7 @@ Made in Italy` })));
|
|
8844
8870
|
} },
|
8845
8871
|
React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
|
8846
8872
|
}))),
|
8847
|
-
!((
|
8873
|
+
!((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
|
8848
8874
|
position: 'relative',
|
8849
8875
|
height: 0,
|
8850
8876
|
width: '100%',
|
@@ -8857,16 +8883,16 @@ Made in Italy` })));
|
|
8857
8883
|
top: 0,
|
8858
8884
|
objectFit: 'cover',
|
8859
8885
|
width: '100%'
|
8860
|
-
}), src: (
|
8886
|
+
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
|
8861
8887
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
8862
8888
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
8863
8889
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
8864
|
-
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (
|
8890
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_l = product === null || product === void 0 ? void 0 : product.title) !== null && _l !== void 0 ? _l : 'Large Dior Toujours Bag'),
|
8865
8891
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection }, (product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage Calfskin')),
|
8866
8892
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
8867
8893
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price }, priceText),
|
8868
|
-
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo }, (
|
8869
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (
|
8894
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo }, (_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费'))),
|
8895
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now')),
|
8870
8896
|
productInfoText({ isPost }))),
|
8871
8897
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
8872
8898
|
};
|
@@ -11774,7 +11800,7 @@ const WaterFall = (props) => {
|
|
11774
11800
|
}
|
11775
11801
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
11776
11802
|
eventInfo: {
|
11777
|
-
|
11803
|
+
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
11778
11804
|
position: cacheActiveIndex + '',
|
11779
11805
|
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
11780
11806
|
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
@@ -11907,14 +11933,14 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
11907
11933
|
Prompt: Prompt
|
11908
11934
|
});
|
11909
11935
|
|
11910
|
-
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
11911
|
-
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
11936
|
+
const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
11937
|
+
const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
11912
11938
|
const LikeButton = (_a) => {
|
11913
11939
|
var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
|
11914
11940
|
const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
|
11915
11941
|
const [state, setState] = useState(active);
|
11916
|
-
const likeIcon = useIconLink(defaultLikeIconPath);
|
11917
|
-
const unlikeIcon = useIconLink(defaultUnLikeIconPath);
|
11942
|
+
const likeIcon = useIconLink(defaultLikeIconPath$1);
|
11943
|
+
const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
|
11918
11944
|
const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
11919
11945
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
11920
11946
|
if (state) {
|
@@ -11970,7 +11996,7 @@ var SXP_EVENT_TYPE;
|
|
11970
11996
|
SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
|
11971
11997
|
})(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
|
11972
11998
|
|
11973
|
-
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
|
11999
|
+
const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
|
11974
12000
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
11975
12001
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
11976
12002
|
const videoStartTime = useRef(0);
|
@@ -12254,7 +12280,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
12254
12280
|
renderPoster,
|
12255
12281
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
12256
12282
|
};
|
12257
|
-
var VideoWidget$
|
12283
|
+
var VideoWidget$3 = memo(VideoWidget$2);
|
12258
12284
|
|
12259
12285
|
/*
|
12260
12286
|
* @Author: binruan@chatlabs.com
|
@@ -12354,7 +12380,7 @@ const Picture = (props) => {
|
|
12354
12380
|
* @LastEditTime: 2024-04-18 19:56:22
|
12355
12381
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
12356
12382
|
*/
|
12357
|
-
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
12383
|
+
const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
12358
12384
|
var _a;
|
12359
12385
|
const ref = useRef();
|
12360
12386
|
const { isActive } = useSwiperSlide();
|
@@ -12383,7 +12409,7 @@ const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd
|
|
12383
12409
|
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
|
12384
12410
|
})));
|
12385
12411
|
};
|
12386
|
-
var PictureGroup$
|
12412
|
+
var PictureGroup$3 = memo(PictureGroup$2);
|
12387
12413
|
|
12388
12414
|
/*
|
12389
12415
|
* @Author: binruan@chatlabs.com
|
@@ -12547,26 +12573,63 @@ var RenderCard$1 = memo(RenderCard);
|
|
12547
12573
|
*
|
12548
12574
|
*/
|
12549
12575
|
const Nudge = ({ nudge }) => {
|
12576
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
12550
12577
|
return (React.createElement(React.Fragment, null, (nudge === null || nudge === void 0 ? void 0 : nudge.isOpen) && (React.createElement("div", { className: 'clc-sxp-bottom-nudge', style: {
|
12551
|
-
marginBottom: nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom,
|
12552
|
-
width: nudge === null || nudge === void 0 ? void 0 : nudge.size.width,
|
12553
|
-
height: nudge === null || nudge === void 0 ? void 0 : nudge.size.height,
|
12578
|
+
marginBottom: (_a = nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom) !== null && _a !== void 0 ? _a : 5,
|
12579
|
+
width: (_c = (_b = nudge === null || nudge === void 0 ? void 0 : nudge.size) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : 212,
|
12580
|
+
height: (_e = (_d = nudge === null || nudge === void 0 ? void 0 : nudge.size) === null || _d === void 0 ? void 0 : _d.height) !== null && _e !== void 0 ? _e : 38,
|
12554
12581
|
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
12555
|
-
borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
|
12582
|
+
borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
|
12556
12583
|
} },
|
12557
12584
|
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
|
12558
|
-
React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)))));
|
12585
|
+
React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, (_g = nudge === null || nudge === void 0 ? void 0 : nudge.content) !== null && _g !== void 0 ? _g : '')))));
|
12559
12586
|
};
|
12560
12587
|
|
12588
|
+
const DEFAULT_TAG = 'FOR U';
|
12589
|
+
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
12590
|
+
const [selectTag, setSelectTag] = useState(DEFAULT_TAG);
|
12591
|
+
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
|
12592
|
+
const realTagList = useMemo(() => {
|
12593
|
+
return [DEFAULT_TAG, ...tagList];
|
12594
|
+
}, [tagList]);
|
12595
|
+
const handleSelectTag = (tag) => () => {
|
12596
|
+
if (tag === selectTag)
|
12597
|
+
return;
|
12598
|
+
let hashTag;
|
12599
|
+
if (tag !== DEFAULT_TAG) {
|
12600
|
+
hashTag = tag;
|
12601
|
+
}
|
12602
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
|
12603
|
+
getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
|
12604
|
+
var _a, _b, _c, _d;
|
12605
|
+
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
|
12606
|
+
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
|
12607
|
+
setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
|
12608
|
+
setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
|
12609
|
+
(_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(0);
|
12610
|
+
}).finally(() => {
|
12611
|
+
setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
|
12612
|
+
});
|
12613
|
+
setSelectTag(tag);
|
12614
|
+
};
|
12615
|
+
if (tagList.length <= 0)
|
12616
|
+
return null;
|
12617
|
+
return (React.createElement("div", { className: 'clc-sxp-tagbar', style: { height: 45 } },
|
12618
|
+
React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
12619
|
+
return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
|
12620
|
+
}))));
|
12621
|
+
};
|
12622
|
+
var Tagbar$1 = memo(Tagbar);
|
12623
|
+
|
12561
12624
|
/*
|
12562
12625
|
* @Author: binruan@chatlabs.com
|
12563
12626
|
* @Date: 2024-01-15 19:03:09
|
12564
12627
|
* @LastEditors: binruan@chatlabs.com
|
12565
|
-
* @LastEditTime: 2024-04-29
|
12628
|
+
* @LastEditTime: 2024-04-29 16:33:53
|
12566
12629
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12567
12630
|
*
|
12568
12631
|
*/
|
12569
|
-
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle }) => {
|
12632
|
+
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [] }) => {
|
12570
12633
|
var _a, _b, _c, _d, _e, _f, _g;
|
12571
12634
|
const { schema } = useEditor();
|
12572
12635
|
const [activeIndex, setActiveIndex] = useState(0);
|
@@ -12665,8 +12728,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12665
12728
|
// sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
|
12666
12729
|
// eventSubject: 'sessionCompleted',
|
12667
12730
|
// eventDescription: 'Session completed',
|
12668
|
-
//
|
12669
|
-
//
|
12731
|
+
// contentId: item?.video?.itemId,
|
12732
|
+
// productId: item?.product?.itemId,
|
12670
12733
|
// position: item?.position
|
12671
12734
|
// }
|
12672
12735
|
// });
|
@@ -12710,12 +12773,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12710
12773
|
sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
|
12711
12774
|
eventSubject: 'sessionCompleted',
|
12712
12775
|
eventDescription: 'Session completed',
|
12713
|
-
|
12714
|
-
|
12776
|
+
contentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
|
12777
|
+
productId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
|
12715
12778
|
position: activeIndex + '',
|
12716
12779
|
fromKName,
|
12717
12780
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
12718
|
-
|
12781
|
+
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 : ''
|
12719
12782
|
}
|
12720
12783
|
});
|
12721
12784
|
}
|
@@ -12732,8 +12795,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12732
12795
|
};
|
12733
12796
|
}, [activeIndex, bffEventReport, curTime, data, handleH5EnterLink, popupDetailData, isFromHashtag, tempMap]);
|
12734
12797
|
const height = useMemo(() => {
|
12735
|
-
|
12736
|
-
|
12798
|
+
let minusHeight = 0;
|
12799
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
12800
|
+
minusHeight += 45;
|
12801
|
+
}
|
12802
|
+
if (tagList.length > 0) {
|
12803
|
+
minusHeight += 45;
|
12804
|
+
}
|
12805
|
+
return containerHeight - minusHeight;
|
12806
|
+
}, [globalConfig, containerHeight, tagList]);
|
12737
12807
|
const renderLogo = useMemo(() => {
|
12738
12808
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
12739
12809
|
return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
|
@@ -12744,10 +12814,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12744
12814
|
const renderContent = useCallback((rec, index) => {
|
12745
12815
|
var _a, _b, _c, _d;
|
12746
12816
|
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
12747
|
-
return (React.createElement(VideoWidget$
|
12817
|
+
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 }));
|
12748
12818
|
}
|
12749
12819
|
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
12750
|
-
return (React.createElement(PictureGroup$
|
12820
|
+
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 }));
|
12751
12821
|
}
|
12752
12822
|
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) {
|
12753
12823
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
@@ -12793,8 +12863,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12793
12863
|
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
12794
12864
|
React.createElement("div", { className: 'clc-sxp-bottom' },
|
12795
12865
|
React.createElement(Nudge, { nudge: nudge }),
|
12796
|
-
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
12797
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
12866
|
+
(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' },
|
12867
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
|
12798
12868
|
React.createElement("div", null,
|
12799
12869
|
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 }),
|
12800
12870
|
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 })))));
|
@@ -12861,8 +12931,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12861
12931
|
eventInfo: {
|
12862
12932
|
eventSubject: 'scrollDown',
|
12863
12933
|
eventDescription: 'User scroll down',
|
12864
|
-
|
12865
|
-
|
12934
|
+
contentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
|
12935
|
+
productId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
12866
12936
|
requestId: null
|
12867
12937
|
}
|
12868
12938
|
});
|
@@ -12874,8 +12944,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12874
12944
|
eventInfo: {
|
12875
12945
|
eventSubject: 'scrollUp',
|
12876
12946
|
eventDescription: 'User scroll up',
|
12877
|
-
|
12878
|
-
|
12947
|
+
contentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
|
12948
|
+
productId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
12879
12949
|
requestId: null
|
12880
12950
|
}
|
12881
12951
|
});
|
@@ -12955,6 +13025,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12955
13025
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
12956
13026
|
} })),
|
12957
13027
|
renderLogo,
|
13028
|
+
React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
12958
13029
|
isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
|
12959
13030
|
React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
|
12960
13031
|
swiperRef.current.swiper.allowTouchMove = false;
|
@@ -13015,6 +13086,365 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13015
13086
|
React.createElement("div", { id: 'player-container-id-copy' }))));
|
13016
13087
|
};
|
13017
13088
|
|
13089
|
+
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|
13090
|
+
return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, height: height, style: { width }, loop: true, autoplay: false }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
|
13091
|
+
return (React.createElement(SwiperSlide, { key: url },
|
13092
|
+
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
|
13093
|
+
})));
|
13094
|
+
};
|
13095
|
+
var PictureGroup$1 = memo(PictureGroup);
|
13096
|
+
|
13097
|
+
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
|
13098
|
+
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
13099
|
+
const videoRef = useRef(null);
|
13100
|
+
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
13101
|
+
const videoStartTime = useRef(0);
|
13102
|
+
const [isLoadFinish, setIsLoadFinish] = useState(false);
|
13103
|
+
const [isFirstPlay, setIsFirstPlay] = useState(true);
|
13104
|
+
const canvasRef = useRef(null);
|
13105
|
+
const [firstFrameSrc, setFirstFrameSrc] = useState('');
|
13106
|
+
useEffect(() => {
|
13107
|
+
if (!videoRef.current)
|
13108
|
+
return;
|
13109
|
+
videoRef.current.muted = muted;
|
13110
|
+
}, [muted]);
|
13111
|
+
const handleVideoStart = useCallback(() => {
|
13112
|
+
var _a;
|
13113
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
13114
|
+
}, []);
|
13115
|
+
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
13116
|
+
const handlePlaying = useCallback(() => {
|
13117
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
13118
|
+
setIsPauseVideo(false);
|
13119
|
+
const item = data[index];
|
13120
|
+
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
13121
|
+
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
13122
|
+
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
13123
|
+
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
13124
|
+
const playType = isFirstPlay ? '0' : '1';
|
13125
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13126
|
+
eventInfo: {
|
13127
|
+
eventSubject: 'playVideo',
|
13128
|
+
eventDescription: 'User played the video',
|
13129
|
+
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13130
|
+
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13131
|
+
playType,
|
13132
|
+
startTime: videoCurrentTime,
|
13133
|
+
videoDuration,
|
13134
|
+
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13135
|
+
position: index + '',
|
13136
|
+
contentFormat: 'video',
|
13137
|
+
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13138
|
+
}
|
13139
|
+
});
|
13140
|
+
setIsFirstPlay(false);
|
13141
|
+
}
|
13142
|
+
}, [bffEventReport, data, index, isFirstPlay]);
|
13143
|
+
const handleLoadedMetadata = useCallback(() => {
|
13144
|
+
setIsLoadFinish(true);
|
13145
|
+
}, []);
|
13146
|
+
const handleClickVideo = useCallback((type) => () => {
|
13147
|
+
var _a, _b, _c, _d, _e;
|
13148
|
+
if (!isLoadFinish)
|
13149
|
+
return;
|
13150
|
+
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
13151
|
+
switch (type) {
|
13152
|
+
case 'start':
|
13153
|
+
if (!isPause)
|
13154
|
+
return;
|
13155
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
13156
|
+
setIsPauseVideo(false);
|
13157
|
+
break;
|
13158
|
+
case 'pause':
|
13159
|
+
if (isPause)
|
13160
|
+
return;
|
13161
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
13162
|
+
setIsPauseVideo(true);
|
13163
|
+
break;
|
13164
|
+
default:
|
13165
|
+
if (isPause) {
|
13166
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
13167
|
+
}
|
13168
|
+
else {
|
13169
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
13170
|
+
}
|
13171
|
+
setIsPauseVideo(!isPause);
|
13172
|
+
break;
|
13173
|
+
}
|
13174
|
+
}, [isLoadFinish]);
|
13175
|
+
const onPause = useCallback(() => {
|
13176
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
13177
|
+
const item = data[index];
|
13178
|
+
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
13179
|
+
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
13180
|
+
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
13181
|
+
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
13182
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13183
|
+
eventInfo: {
|
13184
|
+
eventSubject: 'playOverVideo',
|
13185
|
+
eventDescription: 'User finished playing the video',
|
13186
|
+
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13187
|
+
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13188
|
+
endTime: videoCurrentTime,
|
13189
|
+
videoDuration,
|
13190
|
+
playDuration,
|
13191
|
+
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13192
|
+
position: index + '',
|
13193
|
+
contentFormat: 'video',
|
13194
|
+
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13195
|
+
}
|
13196
|
+
});
|
13197
|
+
}
|
13198
|
+
}, [data, index, bffEventReport]);
|
13199
|
+
const blur = useMemo(() => {
|
13200
|
+
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
13201
|
+
}, [videoPostConfig]);
|
13202
|
+
const translateY = useMemo(() => {
|
13203
|
+
var _a;
|
13204
|
+
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
|
13205
|
+
? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
|
13206
|
+
: 'translateY(-50%)';
|
13207
|
+
}, [videoPostConfig]);
|
13208
|
+
const blurBgSrc = useMemo(() => {
|
13209
|
+
var _a;
|
13210
|
+
return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
|
13211
|
+
}, [firstFrameSrc, rec]);
|
13212
|
+
const handLoadeddata = useCallback(() => {
|
13213
|
+
if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
|
13214
|
+
return;
|
13215
|
+
const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
|
13216
|
+
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
13217
|
+
const ctx = canvas.getContext('2d');
|
13218
|
+
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
13219
|
+
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
13220
|
+
canvas.height = targetHeight;
|
13221
|
+
canvas.width = targetWidth;
|
13222
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
13223
|
+
setFirstFrameSrc(canvas.toDataURL());
|
13224
|
+
}, []);
|
13225
|
+
useEffect(() => {
|
13226
|
+
var _a, _b, _c, _d;
|
13227
|
+
if (!videoRef.current)
|
13228
|
+
return;
|
13229
|
+
setIsPauseVideo(false);
|
13230
|
+
if (!videoRef.current.src) {
|
13231
|
+
const videoSrc = rec.video.url;
|
13232
|
+
if (videoSrc.includes('.m3u8')) {
|
13233
|
+
if (Hls.isSupported()) {
|
13234
|
+
const hls = new Hls();
|
13235
|
+
hls.loadSource(videoSrc);
|
13236
|
+
hls.attachMedia(videoRef.current);
|
13237
|
+
}
|
13238
|
+
else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
|
13239
|
+
videoRef.current.src = videoSrc;
|
13240
|
+
}
|
13241
|
+
else {
|
13242
|
+
videoRef.current.src = videoSrc;
|
13243
|
+
}
|
13244
|
+
}
|
13245
|
+
else {
|
13246
|
+
videoRef.current.src = videoSrc;
|
13247
|
+
}
|
13248
|
+
videoRef.current.setAttribute('x5-playsinline', 'true');
|
13249
|
+
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
13250
|
+
}
|
13251
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
|
13252
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
|
13253
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
|
13254
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
|
13255
|
+
return () => {
|
13256
|
+
var _a, _b, _c, _d;
|
13257
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
13258
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
|
13259
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
|
13260
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
|
13261
|
+
};
|
13262
|
+
}, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
|
13263
|
+
const renderPoster = useMemo(() => {
|
13264
|
+
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
13265
|
+
return null;
|
13266
|
+
}
|
13267
|
+
return (React.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image }));
|
13268
|
+
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
13269
|
+
useEffect(() => {
|
13270
|
+
const handleBeforeUnload = () => {
|
13271
|
+
var _a, _b;
|
13272
|
+
if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.src) && !isPauseVideo) {
|
13273
|
+
handleClickVideo('pause')();
|
13274
|
+
}
|
13275
|
+
};
|
13276
|
+
window.addEventListener('beforeunload', handleBeforeUnload);
|
13277
|
+
return () => {
|
13278
|
+
window.removeEventListener('beforeunload', handleBeforeUnload);
|
13279
|
+
};
|
13280
|
+
}, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
|
13281
|
+
const blurStyle = useMemo(() => {
|
13282
|
+
return blur
|
13283
|
+
? {
|
13284
|
+
filter: 'blur(10px)',
|
13285
|
+
transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
|
13286
|
+
}
|
13287
|
+
: {};
|
13288
|
+
}, [blur]);
|
13289
|
+
if (!rec.video) {
|
13290
|
+
return null;
|
13291
|
+
}
|
13292
|
+
return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
13293
|
+
position: 'relative',
|
13294
|
+
width,
|
13295
|
+
height,
|
13296
|
+
overflow: 'hidden'
|
13297
|
+
} },
|
13298
|
+
React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height,
|
13299
|
+
width, objectFit: 'cover' }, blurStyle) }),
|
13300
|
+
React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
|
13301
|
+
React.createElement("div", { style: {
|
13302
|
+
position: 'absolute',
|
13303
|
+
width,
|
13304
|
+
height,
|
13305
|
+
top: '50%',
|
13306
|
+
transform: translateY,
|
13307
|
+
left: 0,
|
13308
|
+
right: 0
|
13309
|
+
} },
|
13310
|
+
React.createElement("div", { style: { position: 'relative', width, height: '100%' } },
|
13311
|
+
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
|
13312
|
+
width: '100%',
|
13313
|
+
height,
|
13314
|
+
objectFit: 'contain'
|
13315
|
+
} }),
|
13316
|
+
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
13317
|
+
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
13318
|
+
position: 'relative',
|
13319
|
+
width,
|
13320
|
+
height,
|
13321
|
+
overflow: 'hidden'
|
13322
|
+
} },
|
13323
|
+
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
|
13324
|
+
renderPoster,
|
13325
|
+
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
13326
|
+
};
|
13327
|
+
var VideoWidget$1 = memo(VideoWidget);
|
13328
|
+
|
13329
|
+
const RESOLVER$1 = {};
|
13330
|
+
Object.values(_materials_).forEach((v) => {
|
13331
|
+
RESOLVER$1[v.extend.type] = v;
|
13332
|
+
});
|
13333
|
+
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
13334
|
+
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
13335
|
+
const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [] }) => {
|
13336
|
+
const height = useMemo(() => {
|
13337
|
+
let minusHeight = 0;
|
13338
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
13339
|
+
minusHeight += 45;
|
13340
|
+
}
|
13341
|
+
if (tagList.length > 0) {
|
13342
|
+
minusHeight += 45;
|
13343
|
+
}
|
13344
|
+
return containerHeight - minusHeight;
|
13345
|
+
}, [globalConfig, containerHeight, tagList]);
|
13346
|
+
const renderContent = (rec, index) => {
|
13347
|
+
var _a, _b, _c, _d;
|
13348
|
+
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13349
|
+
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 }));
|
13350
|
+
}
|
13351
|
+
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13352
|
+
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 }));
|
13353
|
+
}
|
13354
|
+
if (rec.product) {
|
13355
|
+
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) {
|
13356
|
+
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
13357
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
13358
|
+
const t = RESOLVER$1[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
13359
|
+
const Component = withBindDataSource(t);
|
13360
|
+
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
13361
|
+
return (React.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {},
|
13362
|
+
// schema={schema}
|
13363
|
+
id: value === null || value === void 0 ? void 0 : value.id,
|
13364
|
+
// viewTime={viewTime.current}
|
13365
|
+
rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { width: containerWidth, height, overflow: 'auto' }), index: index })));
|
13366
|
+
});
|
13367
|
+
}
|
13368
|
+
}
|
13369
|
+
};
|
13370
|
+
const renderLogo = useMemo(() => {
|
13371
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
13372
|
+
return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
|
13373
|
+
React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
13374
|
+
}
|
13375
|
+
return null;
|
13376
|
+
}, [globalConfig]);
|
13377
|
+
const CTA = (rec, index) => {
|
13378
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
|
13379
|
+
return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
13380
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1 })));
|
13381
|
+
}
|
13382
|
+
return null;
|
13383
|
+
};
|
13384
|
+
const renderBottom = (rec, index) => {
|
13385
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
13386
|
+
if (rec.video) {
|
13387
|
+
return (React.createElement(React.Fragment, null,
|
13388
|
+
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
13389
|
+
React.createElement("div", { className: 'clc-sxp-bottom' },
|
13390
|
+
React.createElement(Nudge, { nudge: nudge }),
|
13391
|
+
CTA(rec, index),
|
13392
|
+
React.createElement("div", null,
|
13393
|
+
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' }) })),
|
13394
|
+
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 }))));
|
13395
|
+
}
|
13396
|
+
return null;
|
13397
|
+
};
|
13398
|
+
const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
|
13399
|
+
const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
|
13400
|
+
const renderLikeButton = (rec, index) => {
|
13401
|
+
var _a, _b, _c, _d;
|
13402
|
+
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
13403
|
+
return;
|
13404
|
+
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
13405
|
+
if (top < 40) {
|
13406
|
+
top += 40;
|
13407
|
+
}
|
13408
|
+
if (rec.video) {
|
13409
|
+
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: {
|
13410
|
+
top,
|
13411
|
+
right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0
|
13412
|
+
} }));
|
13413
|
+
}
|
13414
|
+
return null;
|
13415
|
+
};
|
13416
|
+
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
|
13417
|
+
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
|
13418
|
+
const renderView = (rec, index) => {
|
13419
|
+
var _a, _b, _c, _d;
|
13420
|
+
return (React.createElement("div", { style: { position: 'relative', border: '1px solid #e1e1e1' } },
|
13421
|
+
renderLogo,
|
13422
|
+
React.createElement(Tagbar$1, { tagList: tagList }),
|
13423
|
+
React.createElement(ToggleButton$1, { style: {
|
13424
|
+
position: 'absolute',
|
13425
|
+
right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
|
13426
|
+
visibility: ((_c = (_b = data === null || data === void 0 ? void 0 : data[index]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
|
13427
|
+
bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
|
13428
|
+
zIndex: 999
|
13429
|
+
}, defaultValue: true, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon }),
|
13430
|
+
renderContent(rec, index),
|
13431
|
+
renderBottom(rec, index),
|
13432
|
+
renderLikeButton(rec, index)));
|
13433
|
+
};
|
13434
|
+
return (React.createElement("div", { style: {
|
13435
|
+
width: '100%',
|
13436
|
+
height: containerHeight,
|
13437
|
+
display: 'flex',
|
13438
|
+
boxSizing: 'border-box',
|
13439
|
+
gap: 16,
|
13440
|
+
pointerEvents: 'none',
|
13441
|
+
userSelect: 'none'
|
13442
|
+
} }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
|
13443
|
+
return renderView(rec, index);
|
13444
|
+
})));
|
13445
|
+
};
|
13446
|
+
var index$1 = memo(DiyPortalPreview);
|
13447
|
+
|
13018
13448
|
/*
|
13019
13449
|
* @Author: binruan@chatlabs.com
|
13020
13450
|
* @Date: 2023-10-31 10:56:01
|
@@ -13108,10 +13538,10 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
|
|
13108
13538
|
return searchParams;
|
13109
13539
|
}, []);
|
13110
13540
|
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
|
13111
|
-
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, render: ({ rtcList }) => {
|
13541
|
+
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, render: ({ rtcList, tagList }) => {
|
13112
13542
|
var _a;
|
13113
13543
|
return (React.createElement(React.Fragment, null,
|
13114
|
-
React.createElement(SxpPageRender, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { data: rtcList, resolver: RESOLVER })),
|
13544
|
+
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 })),
|
13115
13545
|
React.createElement(Popup, null)));
|
13116
13546
|
} })));
|
13117
13547
|
};
|
@@ -13155,4 +13585,5 @@ function useEditorDataProvider() {
|
|
13155
13585
|
* @FilePath: \pb-sxp-ui\src\index.ts
|
13156
13586
|
*/
|
13157
13587
|
|
13158
|
-
export { EditorDataProvider, Modal$1 as Modal, SxpDataSourceProvider$1 as SxpDataSourceProvider, index as SxpPageCore, SxpPageRender, index$
|
13588
|
+
export { index$1 as DiyPortalPreview, EditorDataProvider, Modal$1 as Modal, SxpDataSourceProvider$1 as SxpDataSourceProvider, index as SxpPageCore, SxpPageRender, index$2 as core, Pagebuilder as default, defaultSetting, _materials_ as materials, useEditorDataProvider };
|
13589
|
+
//# sourceMappingURL=index.js.map
|