pb-sxp-ui 1.0.42 → 1.0.43
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/LICENSE +21 -21
- package/README.md +111 -111
- package/dist/index.cjs +237 -600
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -54
- package/dist/index.js +237 -599
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +241 -603
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageCore/index.js +2 -2
- package/es/core/components/SxpPageRender/Nudge/index.js +5 -6
- package/es/core/components/SxpPageRender/VideoWidget/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/VideoWidget/index.js +119 -88
- package/es/core/components/SxpPageRender/WaterFall/index.js +1 -1
- package/es/core/components/SxpPageRender/index.d.ts +0 -2
- package/es/core/components/SxpPageRender/index.js +63 -25
- package/es/core/context/SxpDataSourceProvider.d.ts +2 -3
- package/es/core/context/SxpDataSourceProvider.js +7 -28
- package/es/core/hooks/useEventReport.js +4 -4
- package/es/index.d.ts +0 -1
- package/es/index.js +0 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +10 -10
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
- package/lib/core/components/SxpPageCore/index.js +2 -2
- package/lib/core/components/SxpPageRender/Nudge/index.js +5 -6
- package/lib/core/components/SxpPageRender/VideoWidget/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +119 -88
- package/lib/core/components/SxpPageRender/WaterFall/index.js +1 -1
- package/lib/core/components/SxpPageRender/index.d.ts +0 -2
- package/lib/core/components/SxpPageRender/index.js +63 -25
- package/lib/core/context/SxpDataSourceProvider.d.ts +2 -3
- package/lib/core/context/SxpDataSourceProvider.js +7 -28
- package/lib/core/hooks/useEventReport.js +4 -4
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -3
- package/lib/materials/sxp/popup/CommodityDetail/index.js +10 -10
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
- package/package.json +114 -115
- package/es/core/components/DiyPortalPreview/PictureGroup.d.ts +0 -13
- package/es/core/components/DiyPortalPreview/PictureGroup.js +0 -11
- package/es/core/components/DiyPortalPreview/VideoWidget.d.ts +0 -15
- package/es/core/components/DiyPortalPreview/VideoWidget.js +0 -236
- package/es/core/components/DiyPortalPreview/index.d.ts +0 -6
- package/es/core/components/DiyPortalPreview/index.js +0 -127
- package/es/core/components/SxpPageRender/Tagbar.d.ts +0 -7
- package/es/core/components/SxpPageRender/Tagbar.js +0 -37
- package/lib/core/components/DiyPortalPreview/PictureGroup.d.ts +0 -13
- package/lib/core/components/DiyPortalPreview/PictureGroup.js +0 -14
- package/lib/core/components/DiyPortalPreview/VideoWidget.d.ts +0 -15
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +0 -239
- package/lib/core/components/DiyPortalPreview/index.d.ts +0 -6
- package/lib/core/components/DiyPortalPreview/index.js +0 -130
- package/lib/core/components/SxpPageRender/Tagbar.d.ts +0 -7
- package/lib/core/components/SxpPageRender/Tagbar.js +0 -40
package/dist/index.cjs
CHANGED
@@ -11,7 +11,6 @@ var css = require('@emotion/css');
|
|
11
11
|
var proComponents = require('@ant-design/pro-components');
|
12
12
|
var ReactDOM = require('react-dom');
|
13
13
|
var EventEmitter = require('eventemitter3');
|
14
|
-
var Hls = require('hls.js');
|
15
14
|
|
16
15
|
function _interopNamespaceDefault(e) {
|
17
16
|
var n = Object.create(null);
|
@@ -431,8 +430,7 @@ function useIconLink(path, domain) {
|
|
431
430
|
}
|
432
431
|
|
433
432
|
const SxpDataSourceContext = React.createContext({
|
434
|
-
rtcList: []
|
435
|
-
tagList: []
|
433
|
+
rtcList: []
|
436
434
|
});
|
437
435
|
var DataSourceType;
|
438
436
|
(function (DataSourceType) {
|
@@ -441,7 +439,6 @@ var DataSourceType;
|
|
441
439
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
442
440
|
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
|
443
441
|
const [rtcList, setRtcList] = React.useState([]);
|
444
|
-
const [tagList, setTagList] = React.useState([]);
|
445
442
|
const [loading, setLoading] = React.useState(false);
|
446
443
|
const [curReqInfo, setCurReqInfo] = React.useState({ rtc: '', requestId: '' });
|
447
444
|
const swiperRef = React.useRef(null);
|
@@ -453,6 +450,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
453
450
|
const [cacheRtcList, setCacheRtcList] = React.useState([]);
|
454
451
|
const [cacheActiveIndex, setCacheActiveIndex] = React.useState(0);
|
455
452
|
const [isFromHashtag, setIsFromHashtag] = React.useState(false);
|
453
|
+
const [videoRef, setVideoRef] = React.useState(null);
|
456
454
|
React.useEffect(() => {
|
457
455
|
setOpenHashtag(isOpenHashTag);
|
458
456
|
}, [isOpenHashTag]);
|
@@ -565,19 +563,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
565
563
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
|
566
564
|
return res === null || res === void 0 ? void 0 : res.success;
|
567
565
|
}), [bffFetch]);
|
568
|
-
// 获取 Tag
|
569
|
-
const bffGetTagList = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
570
|
-
var _g, _h;
|
571
|
-
if (!utmVal)
|
572
|
-
return;
|
573
|
-
try {
|
574
|
-
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: utmVal } }));
|
575
|
-
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 : []);
|
576
|
-
}
|
577
|
-
catch (e) {
|
578
|
-
console.log('e', e);
|
579
|
-
}
|
580
|
-
}), [bffFetch, utmVal]);
|
581
566
|
const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
|
582
567
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
583
568
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
@@ -593,12 +578,11 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
593
578
|
fromKName = 'imagePage';
|
594
579
|
}
|
595
580
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
596
|
-
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 + '',
|
581
|
+
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 + '', relatedContentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', relatedProductId: 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 })
|
597
582
|
});
|
598
583
|
}, [bffEventReport, isFromHashtag]);
|
599
584
|
React.useEffect(() => {
|
600
585
|
setLoading(true);
|
601
|
-
bffGetTagList();
|
602
586
|
getRecommendVideos()
|
603
587
|
.then((data) => {
|
604
588
|
var _a, _b;
|
@@ -614,7 +598,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
614
598
|
if (!isInit.current)
|
615
599
|
return;
|
616
600
|
setLoading(true);
|
617
|
-
bffGetTagList();
|
618
601
|
getRecommendVideos()
|
619
602
|
.then((data) => {
|
620
603
|
var _a, _b;
|
@@ -624,7 +607,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
624
607
|
.finally(() => {
|
625
608
|
setLoading(false);
|
626
609
|
});
|
627
|
-
}, [getRecommendVideos
|
610
|
+
}, [getRecommendVideos]);
|
628
611
|
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
629
612
|
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
630
613
|
rtcList,
|
@@ -657,15 +640,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
657
640
|
hashTagSize,
|
658
641
|
loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage,
|
659
642
|
isOpenHashTag,
|
660
|
-
|
661
|
-
|
662
|
-
} }, render({
|
663
|
-
rtcList,
|
664
|
-
mutateLike: bffMutateLike,
|
665
|
-
mutateUnlike: bffMutateUnlike,
|
666
|
-
submitForm: bffSubmitForm,
|
667
|
-
tagList
|
668
|
-
})));
|
643
|
+
videoRef,
|
644
|
+
setVideoRef
|
645
|
+
} }, render({ rtcList, mutateLike: bffMutateLike, mutateUnlike: bffMutateUnlike, submitForm: bffSubmitForm })));
|
669
646
|
};
|
670
647
|
var SxpDataSourceProvider$1 = React.memo(SxpDataSourceProvider);
|
671
648
|
|
@@ -890,7 +867,7 @@ const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enable
|
|
890
867
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
891
868
|
});
|
892
869
|
|
893
|
-
var index$
|
870
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
894
871
|
__proto__: null,
|
895
872
|
EditorCore: EditorCore
|
896
873
|
});
|
@@ -8176,8 +8153,8 @@ function useEventReport() {
|
|
8176
8153
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8177
8154
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
8178
8155
|
position: position + '',
|
8179
|
-
|
8180
|
-
|
8156
|
+
relatedContentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
|
8157
|
+
relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
8181
8158
|
traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
|
8182
8159
|
}
|
8183
8160
|
});
|
@@ -8201,8 +8178,8 @@ function useEventReport() {
|
|
8201
8178
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8202
8179
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
8203
8180
|
position: position + '',
|
8204
|
-
|
8205
|
-
|
8181
|
+
relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
8182
|
+
relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
8206
8183
|
traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
|
8207
8184
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
8208
8185
|
eventSubject: 'productView',
|
@@ -8365,7 +8342,7 @@ const FormatImage = React.forwardRef((props, ref) => {
|
|
8365
8342
|
var FormatImage$1 = React.memo(FormatImage);
|
8366
8343
|
|
8367
8344
|
const CommodityDetail$1 = (_a) => {
|
8368
|
-
var _b, _c, _d, _e, _f, _g, _h, _j
|
8345
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
8369
8346
|
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"]);
|
8370
8347
|
const { sxpParameter } = useSxpDataSource();
|
8371
8348
|
const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
|
@@ -8406,7 +8383,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8406
8383
|
return '$7,000';
|
8407
8384
|
}
|
8408
8385
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8409
|
-
const width = isPreview ? 375 :
|
8386
|
+
const width = isPreview ? 375 : window.innerWidth;
|
8410
8387
|
const renderContent = ({ isPost }) => {
|
8411
8388
|
var _a, _b, _c;
|
8412
8389
|
return (React.createElement("div", null,
|
@@ -8414,10 +8391,10 @@ const CommodityDetail$1 = (_a) => {
|
|
8414
8391
|
React.createElement("div", { className: 'pb-commondity-content-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.title) }, (_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium'),
|
8415
8392
|
React.createElement("div", { className: 'pb-commondity-content-price', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price) }, priceText),
|
8416
8393
|
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8417
|
-
React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
8418
|
-
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8419
|
-
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8420
|
-
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
8394
|
+
React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
8395
|
+
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8396
|
+
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8397
|
+
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
8421
8398
|
18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info }))));
|
8422
8399
|
};
|
8423
8400
|
const renderBtn = () => {
|
@@ -8426,7 +8403,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8426
8403
|
};
|
8427
8404
|
return (React.createElement("div", { className: 'pb-commondity' },
|
8428
8405
|
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
8429
|
-
product && ((
|
8406
|
+
product && ((_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
8430
8407
|
clickable: true,
|
8431
8408
|
bulletActiveClass: 'swipe-item-active-bullet',
|
8432
8409
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -8434,7 +8411,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8434
8411
|
: 'commondityDetail-swiper-clickable-center'
|
8435
8412
|
}, loop: true, autoplay: {
|
8436
8413
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8437
|
-
} }, (
|
8414
|
+
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
8438
8415
|
return (React.createElement(SwiperSlide, { key: src },
|
8439
8416
|
React.createElement("div", { style: {
|
8440
8417
|
overflow: 'hidden',
|
@@ -8443,7 +8420,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8443
8420
|
} },
|
8444
8421
|
React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
|
8445
8422
|
}))),
|
8446
|
-
!((
|
8423
|
+
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
|
8447
8424
|
position: 'relative',
|
8448
8425
|
height: 0,
|
8449
8426
|
width: '100%',
|
@@ -8456,7 +8433,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8456
8433
|
top: 0,
|
8457
8434
|
objectFit: 'cover',
|
8458
8435
|
width: '100%'
|
8459
|
-
}), src: (
|
8436
|
+
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8460
8437
|
React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
8461
8438
|
renderBtn(),
|
8462
8439
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
@@ -8816,7 +8793,7 @@ var settingRender$2 = [
|
|
8816
8793
|
];
|
8817
8794
|
|
8818
8795
|
const CommodityDetailDiroNew$1 = (_a) => {
|
8819
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
8796
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
8820
8797
|
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"]);
|
8821
8798
|
React.useState(true);
|
8822
8799
|
const { sxpParameter } = useSxpDataSource();
|
@@ -8864,16 +8841,16 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
8864
8841
|
return '£102,300.00';
|
8865
8842
|
}
|
8866
8843
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8867
|
-
const width = isPreview ? 375 :
|
8844
|
+
const width = isPreview ? 375 : window.innerWidth;
|
8868
8845
|
const productInfoText = ({ isPost }) => {
|
8869
8846
|
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8870
8847
|
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) ||
|
8871
|
-
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
8848
|
+
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
8872
8849
|
Made in Italy` })));
|
8873
8850
|
};
|
8874
8851
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
8875
8852
|
React.createElement("div", Object.assign({ ref: scrollRef, className: css.css(Object.assign({}, style)) }, props),
|
8876
|
-
product && ((
|
8853
|
+
product && ((_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
8877
8854
|
clickable: true,
|
8878
8855
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
8879
8856
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -8881,7 +8858,7 @@ Made in Italy` })));
|
|
8881
8858
|
: 'commondityDiroNew-swiper-clickable-center'
|
8882
8859
|
}, loop: true, autoplay: {
|
8883
8860
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8884
|
-
} }, (
|
8861
|
+
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
8885
8862
|
return (React.createElement(SwiperSlide, { key: src },
|
8886
8863
|
React.createElement("div", { style: {
|
8887
8864
|
overflow: 'hidden',
|
@@ -8890,7 +8867,7 @@ Made in Italy` })));
|
|
8890
8867
|
} },
|
8891
8868
|
React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
|
8892
8869
|
}))),
|
8893
|
-
!((
|
8870
|
+
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
|
8894
8871
|
position: 'relative',
|
8895
8872
|
height: 0,
|
8896
8873
|
width: '100%',
|
@@ -8903,16 +8880,16 @@ Made in Italy` })));
|
|
8903
8880
|
top: 0,
|
8904
8881
|
objectFit: 'cover',
|
8905
8882
|
width: '100%'
|
8906
|
-
}), src: (
|
8883
|
+
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8907
8884
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
8908
8885
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
8909
8886
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
8910
|
-
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (
|
8887
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'Large Dior Toujours Bag'),
|
8911
8888
|
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')),
|
8912
8889
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
8913
8890
|
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),
|
8914
|
-
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 }, (
|
8915
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (
|
8891
|
+
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 }, (_l = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _l !== void 0 ? _l : '税费'))),
|
8892
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_m = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _m !== void 0 ? _m : 'Shop now')),
|
8916
8893
|
productInfoText({ isPost }))),
|
8917
8894
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
8918
8895
|
};
|
@@ -11820,7 +11797,7 @@ const WaterFall = (props) => {
|
|
11820
11797
|
}
|
11821
11798
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
11822
11799
|
eventInfo: {
|
11823
|
-
|
11800
|
+
relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
11824
11801
|
position: cacheActiveIndex + '',
|
11825
11802
|
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
11826
11803
|
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
@@ -11953,14 +11930,14 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
11953
11930
|
Prompt: Prompt
|
11954
11931
|
});
|
11955
11932
|
|
11956
|
-
const defaultUnLikeIconPath
|
11957
|
-
const defaultLikeIconPath
|
11933
|
+
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
11934
|
+
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
11958
11935
|
const LikeButton = (_a) => {
|
11959
11936
|
var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
|
11960
11937
|
const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
|
11961
11938
|
const [state, setState] = React.useState(active);
|
11962
|
-
const likeIcon = useIconLink(defaultLikeIconPath
|
11963
|
-
const unlikeIcon = useIconLink(defaultUnLikeIconPath
|
11939
|
+
const likeIcon = useIconLink(defaultLikeIconPath);
|
11940
|
+
const unlikeIcon = useIconLink(defaultUnLikeIconPath);
|
11964
11941
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
11965
11942
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
11966
11943
|
if (state) {
|
@@ -12016,9 +11993,8 @@ var SXP_EVENT_TYPE;
|
|
12016
11993
|
SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
|
12017
11994
|
})(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
|
12018
11995
|
|
12019
|
-
const VideoWidget
|
11996
|
+
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
|
12020
11997
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
12021
|
-
const videoRef = React.useRef(null);
|
12022
11998
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
12023
11999
|
const videoStartTime = React.useRef(0);
|
12024
12000
|
const [isLoadFinish, setIsLoadFinish] = React.useState(false);
|
@@ -12026,99 +12002,118 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12026
12002
|
const { isActive } = useSwiperSlide();
|
12027
12003
|
const canvasRef = React.useRef(null);
|
12028
12004
|
const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
|
12005
|
+
const videoId = `pb-cache-video-${index}`;
|
12006
|
+
const videoEleRef = React.useRef(null);
|
12029
12007
|
React.useEffect(() => {
|
12030
|
-
if (!videoRef
|
12008
|
+
if (!videoRef)
|
12031
12009
|
return;
|
12032
|
-
videoRef
|
12033
|
-
}, [muted]);
|
12034
|
-
const
|
12035
|
-
|
12036
|
-
|
12037
|
-
|
12010
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.muted(muted);
|
12011
|
+
}, [muted, videoRef]);
|
12012
|
+
const handleEnded = React.useCallback(() => {
|
12013
|
+
if (!videoRef)
|
12014
|
+
return;
|
12015
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
12016
|
+
}, [videoRef]);
|
12038
12017
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
12039
12018
|
const handlePlaying = React.useCallback(() => {
|
12040
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
12019
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
12020
|
+
if (!videoRef)
|
12021
|
+
return;
|
12041
12022
|
setIsPauseVideo(false);
|
12042
12023
|
const item = data[index];
|
12043
|
-
if (item && (
|
12044
|
-
videoStartTime.current = (
|
12045
|
-
const videoDuration = ((
|
12046
|
-
const videoCurrentTime = ((
|
12024
|
+
if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration())) {
|
12025
|
+
videoStartTime.current = (videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) || 0;
|
12026
|
+
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration()) !== null && _a !== void 0 ? _a : 0).toFixed(2);
|
12027
|
+
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
12047
12028
|
const playType = isFirstPlay ? '0' : '1';
|
12048
12029
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12049
12030
|
eventInfo: {
|
12050
12031
|
eventSubject: 'playVideo',
|
12051
12032
|
eventDescription: 'User played the video',
|
12052
|
-
contentId: (
|
12053
|
-
contentName: (
|
12033
|
+
contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
12034
|
+
contentName: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
|
12054
12035
|
playType,
|
12055
12036
|
startTime: videoCurrentTime,
|
12056
12037
|
videoDuration,
|
12057
|
-
contentTags: JSON.stringify((
|
12038
|
+
contentTags: JSON.stringify((_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
|
12058
12039
|
position: index + '',
|
12059
12040
|
contentFormat: 'video',
|
12060
|
-
traceInfo: (
|
12041
|
+
traceInfo: (_j = item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
|
12061
12042
|
}
|
12062
12043
|
});
|
12063
12044
|
setIsFirstPlay(false);
|
12064
12045
|
}
|
12065
|
-
}, [bffEventReport, data, index, isFirstPlay]);
|
12066
|
-
const
|
12046
|
+
}, [bffEventReport, data, index, isFirstPlay, videoRef]);
|
12047
|
+
const handleLoadedmetadata = React.useCallback(() => {
|
12048
|
+
if (!videoRef)
|
12049
|
+
return;
|
12050
|
+
if (activeIndex !== index) {
|
12051
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
12052
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
|
12053
|
+
}
|
12054
|
+
setIsLoadFinish(true);
|
12055
|
+
}, [activeIndex, index, videoRef]);
|
12056
|
+
const handleCanplay = React.useCallback(() => {
|
12067
12057
|
setIsLoadFinish(true);
|
12068
12058
|
}, []);
|
12069
12059
|
const handleClickVideo = React.useCallback((type) => () => {
|
12070
|
-
|
12060
|
+
if (!videoRef)
|
12061
|
+
return;
|
12071
12062
|
if (!isLoadFinish)
|
12072
12063
|
return;
|
12073
|
-
const isPause =
|
12064
|
+
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused();
|
12074
12065
|
switch (type) {
|
12075
12066
|
case 'start':
|
12076
12067
|
if (!isPause)
|
12077
12068
|
return;
|
12078
|
-
|
12069
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
12079
12070
|
setIsPauseVideo(false);
|
12080
12071
|
break;
|
12081
12072
|
case 'pause':
|
12082
12073
|
if (isPause)
|
12083
12074
|
return;
|
12084
|
-
|
12075
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
|
12085
12076
|
setIsPauseVideo(true);
|
12086
12077
|
break;
|
12087
12078
|
default:
|
12088
12079
|
if (isPause) {
|
12089
|
-
|
12080
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
12090
12081
|
}
|
12091
12082
|
else {
|
12092
|
-
|
12083
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
|
12093
12084
|
}
|
12094
12085
|
setIsPauseVideo(!isPause);
|
12095
12086
|
break;
|
12096
12087
|
}
|
12097
|
-
}, [isLoadFinish]);
|
12098
|
-
const
|
12099
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
12088
|
+
}, [isLoadFinish, videoRef]);
|
12089
|
+
const handlePause = React.useCallback(() => {
|
12090
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
12091
|
+
if (!videoRef)
|
12092
|
+
return;
|
12093
|
+
if (activeIndex !== index)
|
12094
|
+
return;
|
12100
12095
|
const item = data[index];
|
12101
|
-
const videoDuration = ((
|
12102
|
-
const videoCurrentTime = ((
|
12103
|
-
if (
|
12104
|
-
const playDuration = ((
|
12096
|
+
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration()) !== null && _a !== void 0 ? _a : 0).toFixed(2);
|
12097
|
+
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
12098
|
+
if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration()) {
|
12099
|
+
const playDuration = ((videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime()) - videoStartTime.current).toFixed(2);
|
12105
12100
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12106
12101
|
eventInfo: {
|
12107
12102
|
eventSubject: 'playOverVideo',
|
12108
12103
|
eventDescription: 'User finished playing the video',
|
12109
|
-
contentId: (
|
12110
|
-
contentName: (
|
12104
|
+
contentId: (_d = (_c = item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
12105
|
+
contentName: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : '',
|
12111
12106
|
endTime: videoCurrentTime,
|
12112
12107
|
videoDuration,
|
12113
12108
|
playDuration,
|
12114
|
-
contentTags: JSON.stringify((
|
12109
|
+
contentTags: JSON.stringify((_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []),
|
12115
12110
|
position: index + '',
|
12116
12111
|
contentFormat: 'video',
|
12117
|
-
traceInfo: (
|
12112
|
+
traceInfo: (_j = item.video) === null || _j === void 0 ? void 0 : _j.traceInfo
|
12118
12113
|
}
|
12119
12114
|
});
|
12120
12115
|
}
|
12121
|
-
}, [data, index, bffEventReport]);
|
12116
|
+
}, [data, index, bffEventReport, videoRef]);
|
12122
12117
|
const blur = React.useMemo(() => {
|
12123
12118
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
12124
12119
|
}, [videoPostConfig]);
|
@@ -12133,82 +12128,82 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12133
12128
|
return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
|
12134
12129
|
}, [firstFrameSrc, rec]);
|
12135
12130
|
const handLoadeddata = React.useCallback(() => {
|
12136
|
-
|
12131
|
+
var _a;
|
12132
|
+
if (!videoRef)
|
12137
12133
|
return;
|
12138
|
-
const
|
12139
|
-
|
12140
|
-
|
12141
|
-
const
|
12142
|
-
|
12143
|
-
|
12144
|
-
|
12145
|
-
|
12146
|
-
|
12147
|
-
|
12134
|
+
const videoDomRef = document.getElementById(`${videoId}_html5_api`);
|
12135
|
+
if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
|
12136
|
+
return;
|
12137
|
+
const setFrameImg = () => {
|
12138
|
+
const video = videoDomRef;
|
12139
|
+
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
12140
|
+
const ctx = canvas.getContext('2d');
|
12141
|
+
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
12142
|
+
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
12143
|
+
canvas.height = targetHeight;
|
12144
|
+
canvas.width = targetWidth;
|
12145
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
12146
|
+
setFirstFrameSrc(canvas.toDataURL());
|
12147
|
+
};
|
12148
|
+
setFrameImg();
|
12149
|
+
setTimeout(() => {
|
12150
|
+
setFrameImg();
|
12151
|
+
}, 500);
|
12152
|
+
}, [videoRef]);
|
12148
12153
|
React.useEffect(() => {
|
12149
|
-
|
12150
|
-
|
12154
|
+
if (!isActive || !videoRef)
|
12155
|
+
return;
|
12156
|
+
const videoSrc = rec.video.url;
|
12157
|
+
if (!videoSrc)
|
12151
12158
|
return;
|
12152
12159
|
setIsPauseVideo(false);
|
12153
|
-
|
12154
|
-
|
12155
|
-
|
12156
|
-
|
12157
|
-
|
12158
|
-
|
12159
|
-
|
12160
|
-
|
12161
|
-
|
12162
|
-
|
12163
|
-
|
12164
|
-
|
12165
|
-
|
12166
|
-
// videoRef.current.src = videoSrc;
|
12167
|
-
// }
|
12168
|
-
// } else {
|
12169
|
-
videoRef.current.src = videoSrc;
|
12170
|
-
// }
|
12171
|
-
videoRef.current.setAttribute('x5-playsinline', 'true');
|
12172
|
-
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
12173
|
-
}
|
12174
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
|
12175
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
|
12176
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
|
12177
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
|
12160
|
+
const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
|
12161
|
+
const dom = document.querySelector('#player-container-id');
|
12162
|
+
const dom2 = document.querySelector('#player-container-id-copy');
|
12163
|
+
if (!dom && !dom2)
|
12164
|
+
return;
|
12165
|
+
videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
|
12166
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.src(videoSrc);
|
12167
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadedmetadata', handleLoadedmetadata);
|
12168
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('loadeddata', handLoadeddata);
|
12169
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('canplay', handleCanplay);
|
12170
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('playing', handlePlaying);
|
12171
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('pause', handlePause);
|
12172
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.on('ended', handleEnded);
|
12178
12173
|
return () => {
|
12179
|
-
|
12180
|
-
|
12181
|
-
|
12182
|
-
|
12183
|
-
|
12174
|
+
dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
|
12175
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('loadedmetadata', handleLoadedmetadata);
|
12176
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('loadeddata', handLoadeddata);
|
12177
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('canplay', handleCanplay);
|
12178
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('playing', handlePlaying);
|
12179
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('pause', handlePause);
|
12180
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('ended', handleEnded);
|
12184
12181
|
};
|
12185
|
-
}, [
|
12182
|
+
}, [isActive, videoId, rec, videoRef]);
|
12186
12183
|
React.useEffect(() => {
|
12187
|
-
|
12188
|
-
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
12184
|
+
if (!videoRef || !isLoadFinish)
|
12189
12185
|
return;
|
12190
12186
|
if (isActive) {
|
12191
|
-
videoRef.
|
12187
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
12192
12188
|
}
|
12193
12189
|
else {
|
12194
|
-
|
12190
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
|
12195
12191
|
}
|
12196
|
-
}, [isActive, isLoadFinish]);
|
12192
|
+
}, [isActive, isLoadFinish, videoRef]);
|
12197
12193
|
/*
|
12198
12194
|
打开/关闭hashtag暂停/播放视频
|
12199
12195
|
*/
|
12200
12196
|
React.useEffect(() => {
|
12201
|
-
|
12202
|
-
if (!isActive || !(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
12197
|
+
if (!isActive || !videoRef)
|
12203
12198
|
return;
|
12204
|
-
const isPause =
|
12199
|
+
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused();
|
12205
12200
|
if (!isPause && openHashtag) {
|
12206
|
-
|
12201
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
|
12207
12202
|
}
|
12208
12203
|
else if (!openHashtag) {
|
12209
|
-
|
12204
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
12210
12205
|
}
|
12211
|
-
}, [openHashtag, isActive]);
|
12206
|
+
}, [openHashtag, isActive, videoRef]);
|
12212
12207
|
React.useEffect(() => {
|
12213
12208
|
if (!isActive)
|
12214
12209
|
return;
|
@@ -12228,9 +12223,11 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12228
12223
|
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 }));
|
12229
12224
|
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
12230
12225
|
React.useEffect(() => {
|
12226
|
+
if (!videoRef)
|
12227
|
+
return;
|
12231
12228
|
const handleBeforeUnload = () => {
|
12232
|
-
var _a
|
12233
|
-
if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) &&
|
12229
|
+
var _a;
|
12230
|
+
if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) && videoRef && !isPauseVideo) {
|
12234
12231
|
handleClickVideo('pause')();
|
12235
12232
|
}
|
12236
12233
|
};
|
@@ -12268,23 +12265,19 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12268
12265
|
right: 0
|
12269
12266
|
} },
|
12270
12267
|
React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
|
12271
|
-
React.createElement("
|
12272
|
-
width: '100%',
|
12273
|
-
height: '100%',
|
12274
|
-
objectFit: 'contain'
|
12275
|
-
} }),
|
12268
|
+
React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
|
12276
12269
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
12277
|
-
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId,
|
12270
|
+
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, style: {
|
12278
12271
|
position: 'relative',
|
12279
12272
|
width: '100%',
|
12280
12273
|
height,
|
12281
12274
|
overflow: 'hidden'
|
12282
|
-
} },
|
12283
|
-
React.createElement("
|
12275
|
+
}, onClick: handleClickVideo() },
|
12276
|
+
React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
|
12284
12277
|
renderPoster,
|
12285
12278
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
12286
12279
|
};
|
12287
|
-
var VideoWidget$
|
12280
|
+
var VideoWidget$1 = React.memo(VideoWidget);
|
12288
12281
|
|
12289
12282
|
/*
|
12290
12283
|
* @Author: binruan@chatlabs.com
|
@@ -12384,7 +12377,7 @@ const Picture = (props) => {
|
|
12384
12377
|
* @LastEditTime: 2024-04-18 19:56:22
|
12385
12378
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
12386
12379
|
*/
|
12387
|
-
const PictureGroup
|
12380
|
+
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
12388
12381
|
var _a;
|
12389
12382
|
const ref = React.useRef();
|
12390
12383
|
const { isActive } = useSwiperSlide();
|
@@ -12413,7 +12406,7 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageE
|
|
12413
12406
|
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
|
12414
12407
|
})));
|
12415
12408
|
};
|
12416
|
-
var PictureGroup$
|
12409
|
+
var PictureGroup$1 = React.memo(PictureGroup);
|
12417
12410
|
|
12418
12411
|
/*
|
12419
12412
|
* @Author: binruan@chatlabs.com
|
@@ -12577,63 +12570,26 @@ var RenderCard$1 = React.memo(RenderCard);
|
|
12577
12570
|
*
|
12578
12571
|
*/
|
12579
12572
|
const Nudge = ({ nudge }) => {
|
12580
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
12581
12573
|
return (React.createElement(React.Fragment, null, (nudge === null || nudge === void 0 ? void 0 : nudge.isOpen) && (React.createElement("div", { className: 'clc-sxp-bottom-nudge', style: {
|
12582
|
-
marginBottom:
|
12583
|
-
width:
|
12584
|
-
height:
|
12574
|
+
marginBottom: nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom,
|
12575
|
+
width: nudge === null || nudge === void 0 ? void 0 : nudge.size.width,
|
12576
|
+
height: nudge === null || nudge === void 0 ? void 0 : nudge.size.height,
|
12585
12577
|
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
12586
|
-
borderRadius:
|
12578
|
+
borderRadius: nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius
|
12587
12579
|
} },
|
12588
12580
|
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover' } }) : null,
|
12589
|
-
React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) },
|
12581
|
+
React.createElement("p", { style: Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle) }, nudge === null || nudge === void 0 ? void 0 : nudge.content)))));
|
12590
12582
|
};
|
12591
12583
|
|
12592
|
-
const DEFAULT_TAG = 'FOR U';
|
12593
|
-
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
12594
|
-
const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
|
12595
|
-
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
|
12596
|
-
const realTagList = React.useMemo(() => {
|
12597
|
-
return [DEFAULT_TAG, ...tagList];
|
12598
|
-
}, [tagList]);
|
12599
|
-
const handleSelectTag = (tag) => () => {
|
12600
|
-
if (tag === selectTag)
|
12601
|
-
return;
|
12602
|
-
let hashTag;
|
12603
|
-
if (tag !== DEFAULT_TAG) {
|
12604
|
-
hashTag = tag;
|
12605
|
-
}
|
12606
|
-
setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
|
12607
|
-
getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ hashTag }).then((res) => {
|
12608
|
-
var _a, _b, _c, _d;
|
12609
|
-
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
|
12610
|
-
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
|
12611
|
-
setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
|
12612
|
-
setCacheActiveIndex === null || setCacheActiveIndex === void 0 ? void 0 : setCacheActiveIndex(0);
|
12613
|
-
(_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);
|
12614
|
-
}).finally(() => {
|
12615
|
-
setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
|
12616
|
-
});
|
12617
|
-
setSelectTag(tag);
|
12618
|
-
};
|
12619
|
-
if (tagList.length <= 0)
|
12620
|
-
return null;
|
12621
|
-
return (React.createElement("div", { className: 'clc-sxp-tagbar', style: { height: 45 } },
|
12622
|
-
React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
12623
|
-
return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
|
12624
|
-
}))));
|
12625
|
-
};
|
12626
|
-
var Tagbar$1 = React.memo(Tagbar);
|
12627
|
-
|
12628
12584
|
/*
|
12629
12585
|
* @Author: binruan@chatlabs.com
|
12630
12586
|
* @Date: 2024-01-15 19:03:09
|
12631
12587
|
* @LastEditors: binruan@chatlabs.com
|
12632
|
-
* @LastEditTime: 2024-04-
|
12588
|
+
* @LastEditTime: 2024-04-29 15:48:42
|
12633
12589
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12634
12590
|
*
|
12635
12591
|
*/
|
12636
|
-
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle
|
12592
|
+
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle }) => {
|
12637
12593
|
var _a, _b, _c, _d, _e, _f, _g;
|
12638
12594
|
const { schema } = useEditor();
|
12639
12595
|
const [activeIndex, setActiveIndex] = React.useState(0);
|
@@ -12645,6 +12601,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12645
12601
|
const [isLoadMore, setIsLoadMore] = React.useState(false);
|
12646
12602
|
const [isShowMore, setIsShowMore] = React.useState(false);
|
12647
12603
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData } = useSxpDataSource();
|
12604
|
+
const [videoRef, setVideoRef] = React.useState(null);
|
12605
|
+
const playerRef = React.useRef();
|
12648
12606
|
const { productView } = useEventReport();
|
12649
12607
|
const isShowFingerTip = React.useMemo(() => {
|
12650
12608
|
return data.length > 0 && !loading && getFeUserId();
|
@@ -12682,6 +12640,25 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12682
12640
|
viewTime.current = new Date();
|
12683
12641
|
refreshFeSessionId();
|
12684
12642
|
};
|
12643
|
+
const firstRef = React.useRef();
|
12644
|
+
React.useEffect(() => {
|
12645
|
+
if (!firstRef.current && !videoRef) {
|
12646
|
+
firstRef.current = true;
|
12647
|
+
const player = TCPlayer('player-container-id', {
|
12648
|
+
licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1325816236_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
|
12649
|
+
controls: false,
|
12650
|
+
autoplay: false,
|
12651
|
+
loop: false,
|
12652
|
+
muted: true,
|
12653
|
+
preload: 'auto',
|
12654
|
+
posterImage: false,
|
12655
|
+
bigPlayButton: true
|
12656
|
+
});
|
12657
|
+
player === null || player === void 0 ? void 0 : player.ready(() => {
|
12658
|
+
setVideoRef(player);
|
12659
|
+
});
|
12660
|
+
}
|
12661
|
+
}, [videoRef]);
|
12685
12662
|
React.useEffect(() => {
|
12686
12663
|
if (!isInit)
|
12687
12664
|
handleH5EnterLink();
|
@@ -12711,8 +12688,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12711
12688
|
// sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
|
12712
12689
|
// eventSubject: 'sessionCompleted',
|
12713
12690
|
// eventDescription: 'Session completed',
|
12714
|
-
//
|
12715
|
-
//
|
12691
|
+
// relatedContentId: item?.video?.itemId,
|
12692
|
+
// relatedProductId: item?.product?.itemId,
|
12716
12693
|
// position: item?.position
|
12717
12694
|
// }
|
12718
12695
|
// });
|
@@ -12756,12 +12733,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12756
12733
|
sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
|
12757
12734
|
eventSubject: 'sessionCompleted',
|
12758
12735
|
eventDescription: 'Session completed',
|
12759
|
-
|
12760
|
-
|
12736
|
+
relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
|
12737
|
+
relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
|
12761
12738
|
position: activeIndex + '',
|
12762
12739
|
fromKName,
|
12763
12740
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
12764
|
-
|
12741
|
+
relatedCtatId: (_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 : ''
|
12765
12742
|
}
|
12766
12743
|
});
|
12767
12744
|
}
|
@@ -12778,15 +12755,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12778
12755
|
};
|
12779
12756
|
}, [activeIndex, bffEventReport, curTime, data, handleH5EnterLink, popupDetailData, isFromHashtag, tempMap]);
|
12780
12757
|
const height = React.useMemo(() => {
|
12781
|
-
|
12782
|
-
|
12783
|
-
minusHeight += 45;
|
12784
|
-
}
|
12785
|
-
if (tagList.length > 0) {
|
12786
|
-
minusHeight += 45;
|
12787
|
-
}
|
12788
|
-
return containerHeight - minusHeight;
|
12789
|
-
}, [globalConfig, containerHeight, tagList]);
|
12758
|
+
return (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo) ? containerHeight - 45 : containerHeight;
|
12759
|
+
}, [globalConfig, containerHeight]);
|
12790
12760
|
const renderLogo = React.useMemo(() => {
|
12791
12761
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
12792
12762
|
return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
|
@@ -12797,10 +12767,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12797
12767
|
const renderContent = React.useCallback((rec, index) => {
|
12798
12768
|
var _a, _b, _c, _d;
|
12799
12769
|
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
12800
|
-
return (React.createElement(VideoWidget$
|
12770
|
+
return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef }));
|
12801
12771
|
}
|
12802
12772
|
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
12803
|
-
return (React.createElement(PictureGroup$
|
12773
|
+
return (React.createElement(PictureGroup$1, { 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 }));
|
12804
12774
|
}
|
12805
12775
|
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) {
|
12806
12776
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
@@ -12812,7 +12782,19 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12812
12782
|
});
|
12813
12783
|
}
|
12814
12784
|
return null;
|
12815
|
-
}, [
|
12785
|
+
}, [
|
12786
|
+
containerWidth,
|
12787
|
+
data,
|
12788
|
+
height,
|
12789
|
+
isMuted,
|
12790
|
+
activeIndex,
|
12791
|
+
globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost,
|
12792
|
+
viewTime,
|
12793
|
+
tipText,
|
12794
|
+
resolver,
|
12795
|
+
schema,
|
12796
|
+
videoRef
|
12797
|
+
]);
|
12816
12798
|
const onExpandableChange = React.useCallback((v) => {
|
12817
12799
|
setIsShowMore(v);
|
12818
12800
|
}, []);
|
@@ -12834,8 +12816,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12834
12816
|
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
12835
12817
|
React.createElement("div", { className: 'clc-sxp-bottom' },
|
12836
12818
|
React.createElement(Nudge, { nudge: nudge }),
|
12837
|
-
|
12838
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))
|
12819
|
+
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
12820
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
12839
12821
|
React.createElement("div", null,
|
12840
12822
|
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 }),
|
12841
12823
|
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 })))));
|
@@ -12902,8 +12884,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12902
12884
|
eventInfo: {
|
12903
12885
|
eventSubject: 'scrollDown',
|
12904
12886
|
eventDescription: 'User scroll down',
|
12905
|
-
|
12906
|
-
|
12887
|
+
relatedContentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
|
12888
|
+
relatedProductId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
12907
12889
|
requestId: null
|
12908
12890
|
}
|
12909
12891
|
});
|
@@ -12915,8 +12897,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12915
12897
|
eventInfo: {
|
12916
12898
|
eventSubject: 'scrollUp',
|
12917
12899
|
eventDescription: 'User scroll up',
|
12918
|
-
|
12919
|
-
|
12900
|
+
relatedContentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
|
12901
|
+
relatedProductId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
12920
12902
|
requestId: null
|
12921
12903
|
}
|
12922
12904
|
});
|
@@ -12996,9 +12978,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12996
12978
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
12997
12979
|
} })),
|
12998
12980
|
renderLogo,
|
12999
|
-
React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
13000
12981
|
isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
|
13001
|
-
React.createElement(Swiper, { ref: swiperRef,
|
12982
|
+
React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
|
12983
|
+
swiperRef.current.swiper.allowTouchMove = false;
|
12984
|
+
setTimeout(() => {
|
12985
|
+
swiperRef.current.swiper.allowTouchMove = true;
|
12986
|
+
}, 500);
|
12987
|
+
}, onActiveIndexChange: (swiper) => {
|
13002
12988
|
setActiveIndex(swiper.activeIndex);
|
13003
12989
|
if (openHashtag)
|
13004
12990
|
return;
|
@@ -13015,6 +13001,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13015
13001
|
}
|
13016
13002
|
}
|
13017
13003
|
},
|
13004
|
+
// style={{
|
13005
|
+
// pointerEvents: canSwiper ? 'auto' : 'none'
|
13006
|
+
// }}
|
13018
13007
|
// onReachEnd={() => {
|
13019
13008
|
// // 由hashtaglist跳转过来时不执行下面的方法
|
13020
13009
|
// if (waterFallData) return;
|
@@ -13037,367 +13026,17 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13037
13026
|
zIndex: 999
|
13038
13027
|
}, defaultValue: isMuted, 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, onChange: setIsMuted }),
|
13039
13028
|
renderView),
|
13040
|
-
React.createElement(WaterFall$1, Object.assign({}, (_g = (_f = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.item) === null || _g === void 0 ? void 0 : _g.props))
|
13041
|
-
}
|
13042
|
-
|
13043
|
-
|
13044
|
-
|
13045
|
-
|
13046
|
-
|
13047
|
-
|
13048
|
-
}
|
13049
|
-
|
13050
|
-
|
13051
|
-
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
|
13052
|
-
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
13053
|
-
const videoRef = React.useRef(null);
|
13054
|
-
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
13055
|
-
const videoStartTime = React.useRef(0);
|
13056
|
-
const [isLoadFinish, setIsLoadFinish] = React.useState(false);
|
13057
|
-
const [isFirstPlay, setIsFirstPlay] = React.useState(true);
|
13058
|
-
const canvasRef = React.useRef(null);
|
13059
|
-
const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
|
13060
|
-
React.useEffect(() => {
|
13061
|
-
if (!videoRef.current)
|
13062
|
-
return;
|
13063
|
-
videoRef.current.muted = muted;
|
13064
|
-
}, [muted]);
|
13065
|
-
const handleVideoStart = React.useCallback(() => {
|
13066
|
-
var _a;
|
13067
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
13068
|
-
}, []);
|
13069
|
-
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
13070
|
-
const handlePlaying = React.useCallback(() => {
|
13071
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
13072
|
-
setIsPauseVideo(false);
|
13073
|
-
const item = data[index];
|
13074
|
-
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
13075
|
-
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
13076
|
-
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
13077
|
-
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
13078
|
-
const playType = isFirstPlay ? '0' : '1';
|
13079
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13080
|
-
eventInfo: {
|
13081
|
-
eventSubject: 'playVideo',
|
13082
|
-
eventDescription: 'User played the video',
|
13083
|
-
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13084
|
-
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13085
|
-
playType,
|
13086
|
-
startTime: videoCurrentTime,
|
13087
|
-
videoDuration,
|
13088
|
-
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13089
|
-
position: index + '',
|
13090
|
-
contentFormat: 'video',
|
13091
|
-
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13092
|
-
}
|
13093
|
-
});
|
13094
|
-
setIsFirstPlay(false);
|
13095
|
-
}
|
13096
|
-
}, [bffEventReport, data, index, isFirstPlay]);
|
13097
|
-
const handleLoadedMetadata = React.useCallback(() => {
|
13098
|
-
setIsLoadFinish(true);
|
13099
|
-
}, []);
|
13100
|
-
const handleClickVideo = React.useCallback((type) => () => {
|
13101
|
-
var _a, _b, _c, _d, _e;
|
13102
|
-
if (!isLoadFinish)
|
13103
|
-
return;
|
13104
|
-
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
13105
|
-
switch (type) {
|
13106
|
-
case 'start':
|
13107
|
-
if (!isPause)
|
13108
|
-
return;
|
13109
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
13110
|
-
setIsPauseVideo(false);
|
13111
|
-
break;
|
13112
|
-
case 'pause':
|
13113
|
-
if (isPause)
|
13114
|
-
return;
|
13115
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
13116
|
-
setIsPauseVideo(true);
|
13117
|
-
break;
|
13118
|
-
default:
|
13119
|
-
if (isPause) {
|
13120
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
13121
|
-
}
|
13122
|
-
else {
|
13123
|
-
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
13124
|
-
}
|
13125
|
-
setIsPauseVideo(!isPause);
|
13126
|
-
break;
|
13127
|
-
}
|
13128
|
-
}, [isLoadFinish]);
|
13129
|
-
const onPause = React.useCallback(() => {
|
13130
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
13131
|
-
const item = data[index];
|
13132
|
-
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
13133
|
-
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
13134
|
-
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
13135
|
-
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
13136
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13137
|
-
eventInfo: {
|
13138
|
-
eventSubject: 'playOverVideo',
|
13139
|
-
eventDescription: 'User finished playing the video',
|
13140
|
-
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13141
|
-
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13142
|
-
endTime: videoCurrentTime,
|
13143
|
-
videoDuration,
|
13144
|
-
playDuration,
|
13145
|
-
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13146
|
-
position: index + '',
|
13147
|
-
contentFormat: 'video',
|
13148
|
-
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13149
|
-
}
|
13150
|
-
});
|
13151
|
-
}
|
13152
|
-
}, [data, index, bffEventReport]);
|
13153
|
-
const blur = React.useMemo(() => {
|
13154
|
-
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
13155
|
-
}, [videoPostConfig]);
|
13156
|
-
const translateY = React.useMemo(() => {
|
13157
|
-
var _a;
|
13158
|
-
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
|
13159
|
-
? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
|
13160
|
-
: 'translateY(-50%)';
|
13161
|
-
}, [videoPostConfig]);
|
13162
|
-
const blurBgSrc = React.useMemo(() => {
|
13163
|
-
var _a;
|
13164
|
-
return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
|
13165
|
-
}, [firstFrameSrc, rec]);
|
13166
|
-
const handLoadeddata = React.useCallback(() => {
|
13167
|
-
if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
|
13168
|
-
return;
|
13169
|
-
const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
|
13170
|
-
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
13171
|
-
const ctx = canvas.getContext('2d');
|
13172
|
-
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
13173
|
-
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
13174
|
-
canvas.height = targetHeight;
|
13175
|
-
canvas.width = targetWidth;
|
13176
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
13177
|
-
setFirstFrameSrc(canvas.toDataURL());
|
13178
|
-
}, []);
|
13179
|
-
React.useEffect(() => {
|
13180
|
-
var _a, _b, _c, _d;
|
13181
|
-
if (!videoRef.current)
|
13182
|
-
return;
|
13183
|
-
setIsPauseVideo(false);
|
13184
|
-
if (!videoRef.current.src) {
|
13185
|
-
const videoSrc = rec.video.url;
|
13186
|
-
if (videoSrc.includes('.m3u8')) {
|
13187
|
-
if (Hls.isSupported()) {
|
13188
|
-
const hls = new Hls();
|
13189
|
-
hls.loadSource(videoSrc);
|
13190
|
-
hls.attachMedia(videoRef.current);
|
13191
|
-
}
|
13192
|
-
else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
|
13193
|
-
videoRef.current.src = videoSrc;
|
13194
|
-
}
|
13195
|
-
else {
|
13196
|
-
videoRef.current.src = videoSrc;
|
13197
|
-
}
|
13198
|
-
}
|
13199
|
-
else {
|
13200
|
-
videoRef.current.src = videoSrc;
|
13201
|
-
}
|
13202
|
-
videoRef.current.setAttribute('x5-playsinline', 'true');
|
13203
|
-
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
13204
|
-
}
|
13205
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
|
13206
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
|
13207
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
|
13208
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
|
13209
|
-
return () => {
|
13210
|
-
var _a, _b, _c, _d;
|
13211
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
13212
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
|
13213
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
|
13214
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
|
13215
|
-
};
|
13216
|
-
}, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
|
13217
|
-
const renderPoster = React.useMemo(() => {
|
13218
|
-
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
13219
|
-
return null;
|
13220
|
-
}
|
13221
|
-
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 }));
|
13222
|
-
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
13223
|
-
React.useEffect(() => {
|
13224
|
-
const handleBeforeUnload = () => {
|
13225
|
-
var _a, _b;
|
13226
|
-
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) {
|
13227
|
-
handleClickVideo('pause')();
|
13228
|
-
}
|
13229
|
-
};
|
13230
|
-
window.addEventListener('beforeunload', handleBeforeUnload);
|
13231
|
-
return () => {
|
13232
|
-
window.removeEventListener('beforeunload', handleBeforeUnload);
|
13233
|
-
};
|
13234
|
-
}, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
|
13235
|
-
const blurStyle = React.useMemo(() => {
|
13236
|
-
return blur
|
13237
|
-
? {
|
13238
|
-
filter: 'blur(10px)',
|
13239
|
-
transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
|
13240
|
-
}
|
13241
|
-
: {};
|
13242
|
-
}, [blur]);
|
13243
|
-
if (!rec.video) {
|
13244
|
-
return null;
|
13245
|
-
}
|
13246
|
-
return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
13247
|
-
position: 'relative',
|
13248
|
-
width,
|
13249
|
-
height,
|
13250
|
-
overflow: 'hidden'
|
13251
|
-
} },
|
13252
|
-
React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height,
|
13253
|
-
width, objectFit: 'cover' }, blurStyle) }),
|
13254
|
-
React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
|
13255
|
-
React.createElement("div", { style: {
|
13256
|
-
position: 'absolute',
|
13257
|
-
width,
|
13258
|
-
height,
|
13259
|
-
top: '50%',
|
13260
|
-
transform: translateY,
|
13261
|
-
left: 0,
|
13262
|
-
right: 0
|
13263
|
-
} },
|
13264
|
-
React.createElement("div", { style: { position: 'relative', width, height: '100%' } },
|
13265
|
-
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: {
|
13266
|
-
width: '100%',
|
13267
|
-
height,
|
13268
|
-
objectFit: 'contain'
|
13269
|
-
} }),
|
13270
|
-
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
13271
|
-
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
13272
|
-
position: 'relative',
|
13273
|
-
width,
|
13274
|
-
height,
|
13275
|
-
overflow: 'hidden'
|
13276
|
-
} },
|
13277
|
-
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 }),
|
13278
|
-
renderPoster,
|
13279
|
-
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
13280
|
-
};
|
13281
|
-
var VideoWidget$1 = React.memo(VideoWidget);
|
13282
|
-
|
13283
|
-
const RESOLVER$1 = {};
|
13284
|
-
Object.values(_materials_).forEach((v) => {
|
13285
|
-
RESOLVER$1[v.extend.type] = v;
|
13286
|
-
});
|
13287
|
-
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
13288
|
-
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
13289
|
-
const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [] }) => {
|
13290
|
-
const height = React.useMemo(() => {
|
13291
|
-
let minusHeight = 0;
|
13292
|
-
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
13293
|
-
minusHeight += 45;
|
13294
|
-
}
|
13295
|
-
if (tagList.length > 0) {
|
13296
|
-
minusHeight += 45;
|
13297
|
-
}
|
13298
|
-
return containerHeight - minusHeight;
|
13299
|
-
}, [globalConfig, containerHeight, tagList]);
|
13300
|
-
const renderContent = (rec, index) => {
|
13301
|
-
var _a, _b, _c, _d;
|
13302
|
-
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13303
|
-
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 }));
|
13304
|
-
}
|
13305
|
-
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13306
|
-
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 }));
|
13307
|
-
}
|
13308
|
-
if (rec.product) {
|
13309
|
-
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) {
|
13310
|
-
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
13311
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
13312
|
-
const t = RESOLVER$1[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
13313
|
-
const Component = withBindDataSource(t);
|
13314
|
-
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
13315
|
-
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) || {},
|
13316
|
-
// schema={schema}
|
13317
|
-
id: value === null || value === void 0 ? void 0 : value.id,
|
13318
|
-
// viewTime={viewTime.current}
|
13319
|
-
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 })));
|
13320
|
-
});
|
13321
|
-
}
|
13322
|
-
}
|
13323
|
-
};
|
13324
|
-
const renderLogo = React.useMemo(() => {
|
13325
|
-
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
13326
|
-
return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
|
13327
|
-
React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
13328
|
-
}
|
13329
|
-
return null;
|
13330
|
-
}, [globalConfig]);
|
13331
|
-
const CTA = (rec, index) => {
|
13332
|
-
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
|
13333
|
-
return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
13334
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1 })));
|
13335
|
-
}
|
13336
|
-
return null;
|
13337
|
-
};
|
13338
|
-
const renderBottom = (rec, index) => {
|
13339
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
13340
|
-
if (rec.video) {
|
13341
|
-
return (React.createElement(React.Fragment, null,
|
13342
|
-
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
13343
|
-
React.createElement("div", { className: 'clc-sxp-bottom' },
|
13344
|
-
React.createElement(Nudge, { nudge: nudge }),
|
13345
|
-
CTA(rec, index),
|
13346
|
-
React.createElement("div", null,
|
13347
|
-
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' }) })),
|
13348
|
-
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 }))));
|
13349
|
-
}
|
13350
|
-
return null;
|
13351
|
-
};
|
13352
|
-
const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
|
13353
|
-
const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
|
13354
|
-
const renderLikeButton = (rec, index) => {
|
13355
|
-
var _a, _b, _c, _d;
|
13356
|
-
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
13357
|
-
return;
|
13358
|
-
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
13359
|
-
if (top < 40) {
|
13360
|
-
top += 40;
|
13361
|
-
}
|
13362
|
-
if (rec.video) {
|
13363
|
-
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: {
|
13364
|
-
top,
|
13365
|
-
right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0
|
13366
|
-
} }));
|
13367
|
-
}
|
13368
|
-
return null;
|
13369
|
-
};
|
13370
|
-
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
|
13371
|
-
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
|
13372
|
-
const renderView = (rec, index) => {
|
13373
|
-
var _a, _b, _c, _d;
|
13374
|
-
return (React.createElement("div", { style: { position: 'relative', border: '1px solid #e1e1e1' } },
|
13375
|
-
renderLogo,
|
13376
|
-
React.createElement(Tagbar$1, { tagList: tagList }),
|
13377
|
-
React.createElement(ToggleButton$1, { style: {
|
13378
|
-
position: 'absolute',
|
13379
|
-
right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
|
13380
|
-
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',
|
13381
|
-
bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
|
13382
|
-
zIndex: 999
|
13383
|
-
}, 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 }),
|
13384
|
-
renderContent(rec, index),
|
13385
|
-
renderBottom(rec, index),
|
13386
|
-
renderLikeButton(rec, index)));
|
13387
|
-
};
|
13388
|
-
return (React.createElement("div", { style: {
|
13389
|
-
width: '100%',
|
13390
|
-
height: containerHeight,
|
13391
|
-
display: 'flex',
|
13392
|
-
boxSizing: 'border-box',
|
13393
|
-
gap: 16,
|
13394
|
-
pointerEvents: 'none',
|
13395
|
-
userSelect: 'none'
|
13396
|
-
} }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
|
13397
|
-
return renderView(rec, index);
|
13398
|
-
})));
|
13029
|
+
React.createElement(WaterFall$1, Object.assign({}, (_g = (_f = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.item) === null || _g === void 0 ? void 0 : _g.props)),
|
13030
|
+
React.createElement("div", { style: { position: 'absolute', zIndex: -100 } },
|
13031
|
+
React.createElement("video", { ref: playerRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', style: {
|
13032
|
+
backgroundColor: 'transparent',
|
13033
|
+
width: '100%',
|
13034
|
+
height: '100%',
|
13035
|
+
objectFit: 'cover',
|
13036
|
+
pointerEvents: 'none'
|
13037
|
+
} }),
|
13038
|
+
React.createElement("div", { id: 'player-container-id-copy' }))));
|
13399
13039
|
};
|
13400
|
-
var index$1 = React.memo(DiyPortalPreview);
|
13401
13040
|
|
13402
13041
|
/*
|
13403
13042
|
* @Author: binruan@chatlabs.com
|
@@ -13492,10 +13131,10 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
|
|
13492
13131
|
return searchParams;
|
13493
13132
|
}, []);
|
13494
13133
|
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
|
13495
|
-
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
|
13134
|
+
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 }) => {
|
13496
13135
|
var _a;
|
13497
13136
|
return (React.createElement(React.Fragment, null,
|
13498
|
-
React.createElement(SxpPageRender, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, {
|
13137
|
+
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 })),
|
13499
13138
|
React.createElement(Popup, null)));
|
13500
13139
|
} })));
|
13501
13140
|
};
|
@@ -13539,15 +13178,13 @@ function useEditorDataProvider() {
|
|
13539
13178
|
* @FilePath: \pb-sxp-ui\src\index.ts
|
13540
13179
|
*/
|
13541
13180
|
|
13542
|
-
exports.DiyPortalPreview = index$1;
|
13543
13181
|
exports.EditorDataProvider = EditorDataProvider;
|
13544
13182
|
exports.Modal = Modal$1;
|
13545
13183
|
exports.SxpDataSourceProvider = SxpDataSourceProvider$1;
|
13546
13184
|
exports.SxpPageCore = index;
|
13547
13185
|
exports.SxpPageRender = SxpPageRender;
|
13548
|
-
exports.core = index$
|
13186
|
+
exports.core = index$1;
|
13549
13187
|
exports.default = Pagebuilder;
|
13550
13188
|
exports.defaultSetting = defaultSetting;
|
13551
13189
|
exports.materials = _materials_;
|
13552
13190
|
exports.useEditorDataProvider = useEditorDataProvider;
|
13553
|
-
//# sourceMappingURL=index.cjs.map
|