pb-sxp-ui 1.0.36 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +106 -447
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -6
- package/dist/index.js +106 -446
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +110 -450
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +63 -58
- package/es/core/components/SxpPageRender/WaterFall/index.js +1 -1
- package/es/core/components/SxpPageRender/index.js +7 -7
- package/es/core/context/SxpDataSourceProvider.js +1 -1
- 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 +6 -6
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +9 -9
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +63 -58
- package/lib/core/components/SxpPageRender/WaterFall/index.js +1 -1
- package/lib/core/components/SxpPageRender/index.js +7 -7
- package/lib/core/context/SxpDataSourceProvider.js +1 -1
- 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 +6 -6
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +9 -9
- package/package.json +1 -2
- 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 -112
- 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 -115
package/dist/index.cjs
CHANGED
@@ -10,7 +10,6 @@ var qs = require('qs');
|
|
10
10
|
var css = require('@emotion/css');
|
11
11
|
var proComponents = require('@ant-design/pro-components');
|
12
12
|
var ReactDOM = require('react-dom');
|
13
|
-
var Hls = require('hls.js');
|
14
13
|
var EventEmitter = require('eventemitter3');
|
15
14
|
|
16
15
|
function _interopNamespaceDefault(e) {
|
@@ -578,7 +577,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
578
577
|
fromKName = 'imagePage';
|
579
578
|
}
|
580
579
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
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 + '',
|
580
|
+
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 })
|
582
581
|
});
|
583
582
|
}, [bffEventReport, isFromHashtag]);
|
584
583
|
React.useEffect(() => {
|
@@ -865,7 +864,7 @@ const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enable
|
|
865
864
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
866
865
|
});
|
867
866
|
|
868
|
-
var index$
|
867
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
869
868
|
__proto__: null,
|
870
869
|
EditorCore: EditorCore
|
871
870
|
});
|
@@ -8151,8 +8150,8 @@ function useEventReport() {
|
|
8151
8150
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8152
8151
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
8153
8152
|
position: position + '',
|
8154
|
-
|
8155
|
-
|
8153
|
+
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 : '',
|
8154
|
+
relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
8156
8155
|
traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
|
8157
8156
|
}
|
8158
8157
|
});
|
@@ -8176,8 +8175,8 @@ function useEventReport() {
|
|
8176
8175
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8177
8176
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
8178
8177
|
position: position + '',
|
8179
|
-
|
8180
|
-
|
8178
|
+
relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
8179
|
+
relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
8181
8180
|
traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
|
8182
8181
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
8183
8182
|
eventSubject: 'productView',
|
@@ -8340,7 +8339,7 @@ const FormatImage = React.forwardRef((props, ref) => {
|
|
8340
8339
|
var FormatImage$1 = React.memo(FormatImage);
|
8341
8340
|
|
8342
8341
|
const CommodityDetail$1 = (_a) => {
|
8343
|
-
var _b, _c, _d, _e, _f, _g, _h, _j
|
8342
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
8344
8343
|
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"]);
|
8345
8344
|
const { sxpParameter } = useSxpDataSource();
|
8346
8345
|
const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
|
@@ -8381,7 +8380,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8381
8380
|
return '$7,000';
|
8382
8381
|
}
|
8383
8382
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8384
|
-
const width = isPreview ? 375 :
|
8383
|
+
const width = isPreview ? 375 : window.innerWidth;
|
8385
8384
|
const renderContent = ({ isPost }) => {
|
8386
8385
|
var _a, _b, _c;
|
8387
8386
|
return (React.createElement("div", null,
|
@@ -8401,7 +8400,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8401
8400
|
};
|
8402
8401
|
return (React.createElement("div", { className: 'pb-commondity' },
|
8403
8402
|
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
8404
|
-
product && ((
|
8403
|
+
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: {
|
8405
8404
|
clickable: true,
|
8406
8405
|
bulletActiveClass: 'swipe-item-active-bullet',
|
8407
8406
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -8409,7 +8408,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8409
8408
|
: 'commondityDetail-swiper-clickable-center'
|
8410
8409
|
}, loop: true, autoplay: {
|
8411
8410
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8412
|
-
} }, (
|
8411
|
+
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
8413
8412
|
return (React.createElement(SwiperSlide, { key: src },
|
8414
8413
|
React.createElement("div", { style: {
|
8415
8414
|
overflow: 'hidden',
|
@@ -8418,7 +8417,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8418
8417
|
} },
|
8419
8418
|
React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
|
8420
8419
|
}))),
|
8421
|
-
!((
|
8420
|
+
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
|
8422
8421
|
position: 'relative',
|
8423
8422
|
height: 0,
|
8424
8423
|
width: '100%',
|
@@ -8431,7 +8430,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8431
8430
|
top: 0,
|
8432
8431
|
objectFit: 'cover',
|
8433
8432
|
width: '100%'
|
8434
|
-
}), src: (
|
8433
|
+
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8435
8434
|
React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
8436
8435
|
renderBtn(),
|
8437
8436
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
@@ -8791,7 +8790,7 @@ var settingRender$2 = [
|
|
8791
8790
|
];
|
8792
8791
|
|
8793
8792
|
const CommodityDetailDiroNew$1 = (_a) => {
|
8794
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
8793
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
8795
8794
|
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"]);
|
8796
8795
|
React.useState(true);
|
8797
8796
|
const { sxpParameter } = useSxpDataSource();
|
@@ -8839,7 +8838,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
8839
8838
|
return '£102,300.00';
|
8840
8839
|
}
|
8841
8840
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8842
|
-
const width = isPreview ? 375 :
|
8841
|
+
const width = isPreview ? 375 : window.innerWidth;
|
8843
8842
|
const productInfoText = ({ isPost }) => {
|
8844
8843
|
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8845
8844
|
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) ||
|
@@ -8848,7 +8847,7 @@ Made in Italy` })));
|
|
8848
8847
|
};
|
8849
8848
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
8850
8849
|
React.createElement("div", Object.assign({ ref: scrollRef, className: css.css(Object.assign({}, style)) }, props),
|
8851
|
-
product && ((
|
8850
|
+
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: {
|
8852
8851
|
clickable: true,
|
8853
8852
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
8854
8853
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -8856,7 +8855,7 @@ Made in Italy` })));
|
|
8856
8855
|
: 'commondityDiroNew-swiper-clickable-center'
|
8857
8856
|
}, loop: true, autoplay: {
|
8858
8857
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8859
|
-
} }, (
|
8858
|
+
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
8860
8859
|
return (React.createElement(SwiperSlide, { key: src },
|
8861
8860
|
React.createElement("div", { style: {
|
8862
8861
|
overflow: 'hidden',
|
@@ -8865,7 +8864,7 @@ Made in Italy` })));
|
|
8865
8864
|
} },
|
8866
8865
|
React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
|
8867
8866
|
}))),
|
8868
|
-
!((
|
8867
|
+
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
|
8869
8868
|
position: 'relative',
|
8870
8869
|
height: 0,
|
8871
8870
|
width: '100%',
|
@@ -8878,16 +8877,16 @@ Made in Italy` })));
|
|
8878
8877
|
top: 0,
|
8879
8878
|
objectFit: 'cover',
|
8880
8879
|
width: '100%'
|
8881
|
-
}), src: (
|
8880
|
+
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8882
8881
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
8883
8882
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
8884
8883
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
8885
|
-
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (
|
8884
|
+
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'),
|
8886
8885
|
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')),
|
8887
8886
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
8888
8887
|
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),
|
8889
|
-
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 }, (
|
8890
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (
|
8888
|
+
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 : '税费'))),
|
8889
|
+
(!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')),
|
8891
8890
|
productInfoText({ isPost }))),
|
8892
8891
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
8893
8892
|
};
|
@@ -11795,7 +11794,7 @@ const WaterFall = (props) => {
|
|
11795
11794
|
}
|
11796
11795
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
11797
11796
|
eventInfo: {
|
11798
|
-
|
11797
|
+
relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
11799
11798
|
position: cacheActiveIndex + '',
|
11800
11799
|
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
11801
11800
|
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
@@ -11928,14 +11927,14 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
11928
11927
|
Prompt: Prompt
|
11929
11928
|
});
|
11930
11929
|
|
11931
|
-
const defaultUnLikeIconPath
|
11932
|
-
const defaultLikeIconPath
|
11930
|
+
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
11931
|
+
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
11933
11932
|
const LikeButton = (_a) => {
|
11934
11933
|
var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
|
11935
11934
|
const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
|
11936
11935
|
const [state, setState] = React.useState(active);
|
11937
|
-
const likeIcon = useIconLink(defaultLikeIconPath
|
11938
|
-
const unlikeIcon = useIconLink(defaultUnLikeIconPath
|
11936
|
+
const likeIcon = useIconLink(defaultLikeIconPath);
|
11937
|
+
const unlikeIcon = useIconLink(defaultUnLikeIconPath);
|
11939
11938
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
11940
11939
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
11941
11940
|
if (state) {
|
@@ -11991,7 +11990,7 @@ var SXP_EVENT_TYPE;
|
|
11991
11990
|
SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
|
11992
11991
|
})(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
|
11993
11992
|
|
11994
|
-
const VideoWidget
|
11993
|
+
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig }) => {
|
11995
11994
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
11996
11995
|
const videoRef = React.useRef(null);
|
11997
11996
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
@@ -12001,12 +12000,13 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12001
12000
|
const { isActive } = useSwiperSlide();
|
12002
12001
|
const canvasRef = React.useRef(null);
|
12003
12002
|
const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
|
12003
|
+
const videoId = `pb-video-${index}`;
|
12004
12004
|
React.useEffect(() => {
|
12005
12005
|
if (!videoRef.current)
|
12006
12006
|
return;
|
12007
|
-
videoRef.current.muted
|
12007
|
+
videoRef.current.muted(muted);
|
12008
12008
|
}, [muted]);
|
12009
|
-
const
|
12009
|
+
const handleEnded = React.useCallback(() => {
|
12010
12010
|
var _a;
|
12011
12011
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
12012
12012
|
}, []);
|
@@ -12015,10 +12015,10 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12015
12015
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
12016
12016
|
setIsPauseVideo(false);
|
12017
12017
|
const item = data[index];
|
12018
|
-
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
12019
|
-
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
12020
|
-
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
12021
|
-
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
12018
|
+
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration())) {
|
12019
|
+
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime()) || 0;
|
12020
|
+
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration()) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
12021
|
+
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime()) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
12022
12022
|
const playType = isFirstPlay ? '0' : '1';
|
12023
12023
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12024
12024
|
eventInfo: {
|
@@ -12038,14 +12038,14 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12038
12038
|
setIsFirstPlay(false);
|
12039
12039
|
}
|
12040
12040
|
}, [bffEventReport, data, index, isFirstPlay]);
|
12041
|
-
const
|
12041
|
+
const handleCanplay = React.useCallback(() => {
|
12042
12042
|
setIsLoadFinish(true);
|
12043
12043
|
}, []);
|
12044
12044
|
const handleClickVideo = React.useCallback((type) => () => {
|
12045
12045
|
var _a, _b, _c, _d, _e;
|
12046
12046
|
if (!isLoadFinish)
|
12047
12047
|
return;
|
12048
|
-
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
12048
|
+
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused();
|
12049
12049
|
switch (type) {
|
12050
12050
|
case 'start':
|
12051
12051
|
if (!isPause)
|
@@ -12070,13 +12070,13 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12070
12070
|
break;
|
12071
12071
|
}
|
12072
12072
|
}, [isLoadFinish]);
|
12073
|
-
const
|
12073
|
+
const handlePause = React.useCallback(() => {
|
12074
12074
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
12075
12075
|
const item = data[index];
|
12076
|
-
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
12077
|
-
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
12078
|
-
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
12079
|
-
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
12076
|
+
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration()) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
12077
|
+
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime()) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
12078
|
+
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration()) {
|
12079
|
+
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime()) - videoStartTime.current).toFixed(2);
|
12080
12080
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12081
12081
|
eventInfo: {
|
12082
12082
|
eventSubject: 'playOverVideo',
|
@@ -12108,9 +12108,10 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12108
12108
|
return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
|
12109
12109
|
}, [firstFrameSrc, rec]);
|
12110
12110
|
const handLoadeddata = React.useCallback(() => {
|
12111
|
-
|
12111
|
+
const videoDomRef = document.getElementById(`${videoId}_html5_api`);
|
12112
|
+
if (!canvasRef || !videoDomRef || !canvasRef.current)
|
12112
12113
|
return;
|
12113
|
-
const video =
|
12114
|
+
const video = videoDomRef;
|
12114
12115
|
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
12115
12116
|
const ctx = canvas.getContext('2d');
|
12116
12117
|
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
@@ -12121,47 +12122,43 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12121
12122
|
setFirstFrameSrc(canvas.toDataURL());
|
12122
12123
|
}, []);
|
12123
12124
|
React.useEffect(() => {
|
12124
|
-
var _a, _b, _c, _d;
|
12125
|
-
if (!videoRef.current)
|
12126
|
-
return;
|
12125
|
+
var _a, _b, _c, _d, _e, _f;
|
12127
12126
|
setIsPauseVideo(false);
|
12128
|
-
|
12129
|
-
|
12130
|
-
|
12131
|
-
|
12132
|
-
|
12133
|
-
|
12134
|
-
|
12135
|
-
|
12136
|
-
|
12137
|
-
|
12138
|
-
|
12139
|
-
|
12140
|
-
|
12141
|
-
|
12142
|
-
|
12143
|
-
|
12144
|
-
|
12145
|
-
}
|
12146
|
-
}
|
12147
|
-
else {
|
12148
|
-
videoRef.current.src = videoSrc;
|
12149
|
-
}
|
12150
|
-
videoRef.current.setAttribute('x5-playsinline', 'true');
|
12151
|
-
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
12127
|
+
const videoSrc = rec.video.url;
|
12128
|
+
if (videoSrc && typeof TCPlayer === 'function') {
|
12129
|
+
videoRef.current = TCPlayer(videoId, {
|
12130
|
+
sources: [
|
12131
|
+
{
|
12132
|
+
src: videoSrc // 播放地址
|
12133
|
+
}
|
12134
|
+
],
|
12135
|
+
licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1325816236_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
|
12136
|
+
controls: false,
|
12137
|
+
autoplay: false,
|
12138
|
+
loop: false,
|
12139
|
+
muted: true,
|
12140
|
+
preload: 'auto',
|
12141
|
+
posterImage: false,
|
12142
|
+
bigPlayButton: true
|
12143
|
+
});
|
12152
12144
|
}
|
12153
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.
|
12154
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.
|
12155
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.
|
12156
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
12145
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.on('loadedmetadata', handleCanplay);
|
12146
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.on('canplay', handleCanplay);
|
12147
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.on('playing', handlePlaying);
|
12148
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.on('loadeddata', handLoadeddata);
|
12149
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.on('pause', handlePause);
|
12150
|
+
(_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.on('ended', handleEnded);
|
12157
12151
|
return () => {
|
12158
|
-
var _a, _b, _c, _d;
|
12159
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.
|
12160
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.
|
12161
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.
|
12162
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
12152
|
+
var _a, _b, _c, _d, _e, _f;
|
12153
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.off('loadedmetadata', handleCanplay);
|
12154
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.off('canplay', handleCanplay);
|
12155
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.off('playing', handlePlaying);
|
12156
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.off('loadeddata', handLoadeddata);
|
12157
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.off('pause', handlePause);
|
12158
|
+
(_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.off('ended', handleEnded);
|
12159
|
+
videoRef.current.dispose();
|
12163
12160
|
};
|
12164
|
-
}, [
|
12161
|
+
}, []);
|
12165
12162
|
React.useEffect(() => {
|
12166
12163
|
var _a;
|
12167
12164
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
@@ -12247,23 +12244,31 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12247
12244
|
right: 0
|
12248
12245
|
} },
|
12249
12246
|
React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
|
12250
|
-
React.createElement("video", { id: `pb-video-${index}`,
|
12247
|
+
React.createElement("video", { id: `pb-video-${index}`, playsInline: true, crossOrigin: 'anonymous', style: {
|
12251
12248
|
width: '100%',
|
12252
12249
|
height: '100%',
|
12253
|
-
objectFit: 'contain'
|
12250
|
+
objectFit: 'contain',
|
12251
|
+
backgroundColor: 'transparent',
|
12252
|
+
pointerEvents: 'none'
|
12254
12253
|
} }),
|
12255
12254
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
12256
|
-
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId,
|
12255
|
+
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, style: {
|
12257
12256
|
position: 'relative',
|
12258
12257
|
width: '100%',
|
12259
12258
|
height,
|
12260
12259
|
overflow: 'hidden'
|
12261
|
-
} },
|
12262
|
-
React.createElement("video", { id: `pb-video-${index}`,
|
12260
|
+
}, onClick: handleClickVideo() },
|
12261
|
+
React.createElement("video", { id: `pb-video-${index}`, playsInline: true, crossOrigin: 'anonymous', style: {
|
12262
|
+
backgroundColor: 'transparent',
|
12263
|
+
width: '100%',
|
12264
|
+
height: '100%',
|
12265
|
+
objectFit: 'cover',
|
12266
|
+
pointerEvents: 'none'
|
12267
|
+
} }),
|
12263
12268
|
renderPoster,
|
12264
12269
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
12265
12270
|
};
|
12266
|
-
var VideoWidget$
|
12271
|
+
var VideoWidget$1 = React.memo(VideoWidget);
|
12267
12272
|
|
12268
12273
|
/*
|
12269
12274
|
* @Author: binruan@chatlabs.com
|
@@ -12362,7 +12367,7 @@ const Picture = (props) => {
|
|
12362
12367
|
* @LastEditTime: 2024-04-18 19:56:22
|
12363
12368
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
12364
12369
|
*/
|
12365
|
-
const PictureGroup
|
12370
|
+
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
12366
12371
|
var _a;
|
12367
12372
|
const ref = React.useRef();
|
12368
12373
|
const { isActive } = useSwiperSlide();
|
@@ -12391,7 +12396,7 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageE
|
|
12391
12396
|
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
|
12392
12397
|
})));
|
12393
12398
|
};
|
12394
|
-
var PictureGroup$
|
12399
|
+
var PictureGroup$1 = React.memo(PictureGroup);
|
12395
12400
|
|
12396
12401
|
/*
|
12397
12402
|
* @Author: binruan@chatlabs.com
|
@@ -12570,7 +12575,7 @@ const Nudge = ({ nudge }) => {
|
|
12570
12575
|
* @Author: binruan@chatlabs.com
|
12571
12576
|
* @Date: 2024-01-15 19:03:09
|
12572
12577
|
* @LastEditors: binruan@chatlabs.com
|
12573
|
-
* @LastEditTime: 2024-04-
|
12578
|
+
* @LastEditTime: 2024-04-18 19:27:03
|
12574
12579
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12575
12580
|
*
|
12576
12581
|
*/
|
@@ -12652,8 +12657,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12652
12657
|
// sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
|
12653
12658
|
// eventSubject: 'sessionCompleted',
|
12654
12659
|
// eventDescription: 'Session completed',
|
12655
|
-
//
|
12656
|
-
//
|
12660
|
+
// relatedContentId: item?.video?.itemId,
|
12661
|
+
// relatedProductId: item?.product?.itemId,
|
12657
12662
|
// position: item?.position
|
12658
12663
|
// }
|
12659
12664
|
// });
|
@@ -12697,12 +12702,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12697
12702
|
sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
|
12698
12703
|
eventSubject: 'sessionCompleted',
|
12699
12704
|
eventDescription: 'Session completed',
|
12700
|
-
|
12701
|
-
|
12705
|
+
relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
|
12706
|
+
relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
|
12702
12707
|
position: activeIndex + '',
|
12703
12708
|
fromKName,
|
12704
12709
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
12705
|
-
|
12710
|
+
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 : ''
|
12706
12711
|
}
|
12707
12712
|
});
|
12708
12713
|
}
|
@@ -12731,10 +12736,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12731
12736
|
const renderContent = React.useCallback((rec, index) => {
|
12732
12737
|
var _a, _b, _c, _d;
|
12733
12738
|
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
12734
|
-
return (React.createElement(VideoWidget$
|
12739
|
+
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 }));
|
12735
12740
|
}
|
12736
12741
|
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
12737
|
-
return (React.createElement(PictureGroup$
|
12742
|
+
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 }));
|
12738
12743
|
}
|
12739
12744
|
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) {
|
12740
12745
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
@@ -12836,8 +12841,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12836
12841
|
eventInfo: {
|
12837
12842
|
eventSubject: 'scrollDown',
|
12838
12843
|
eventDescription: 'User scroll down',
|
12839
|
-
|
12840
|
-
|
12844
|
+
relatedContentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
|
12845
|
+
relatedProductId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
12841
12846
|
requestId: null
|
12842
12847
|
}
|
12843
12848
|
});
|
@@ -12849,8 +12854,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12849
12854
|
eventInfo: {
|
12850
12855
|
eventSubject: 'scrollUp',
|
12851
12856
|
eventDescription: 'User scroll up',
|
12852
|
-
|
12853
|
-
|
12857
|
+
relatedContentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
|
12858
|
+
relatedProductId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
12854
12859
|
requestId: null
|
12855
12860
|
}
|
12856
12861
|
});
|
@@ -12973,351 +12978,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
12973
12978
|
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))));
|
12974
12979
|
};
|
12975
12980
|
|
12976
|
-
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|
12977
|
-
return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: { clickable: true, bulletActiveClass: 'swipe-item-active-bullet' }, height: height, style: { width }, loop: true, autoplay: false }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
|
12978
|
-
return (React.createElement(SwiperSlide, { key: url },
|
12979
|
-
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
|
12980
|
-
})));
|
12981
|
-
};
|
12982
|
-
var PictureGroup$1 = React.memo(PictureGroup);
|
12983
|
-
|
12984
|
-
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
|
12985
|
-
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
12986
|
-
const videoRef = React.useRef(null);
|
12987
|
-
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
12988
|
-
const videoStartTime = React.useRef(0);
|
12989
|
-
const [isLoadFinish, setIsLoadFinish] = React.useState(false);
|
12990
|
-
const [isFirstPlay, setIsFirstPlay] = React.useState(true);
|
12991
|
-
const canvasRef = React.useRef(null);
|
12992
|
-
const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
|
12993
|
-
React.useEffect(() => {
|
12994
|
-
if (!videoRef.current)
|
12995
|
-
return;
|
12996
|
-
videoRef.current.muted = muted;
|
12997
|
-
}, [muted]);
|
12998
|
-
const handleVideoStart = React.useCallback(() => {
|
12999
|
-
var _a;
|
13000
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
13001
|
-
}, []);
|
13002
|
-
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
13003
|
-
const handlePlaying = React.useCallback(() => {
|
13004
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
13005
|
-
setIsPauseVideo(false);
|
13006
|
-
const item = data[index];
|
13007
|
-
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
13008
|
-
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
13009
|
-
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
13010
|
-
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
13011
|
-
const playType = isFirstPlay ? '0' : '1';
|
13012
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13013
|
-
eventInfo: {
|
13014
|
-
eventSubject: 'playVideo',
|
13015
|
-
eventDescription: 'User played the video',
|
13016
|
-
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13017
|
-
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13018
|
-
playType,
|
13019
|
-
startTime: videoCurrentTime,
|
13020
|
-
videoDuration,
|
13021
|
-
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13022
|
-
position: index + '',
|
13023
|
-
contentFormat: 'video',
|
13024
|
-
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13025
|
-
}
|
13026
|
-
});
|
13027
|
-
setIsFirstPlay(false);
|
13028
|
-
}
|
13029
|
-
}, [bffEventReport, data, index, isFirstPlay]);
|
13030
|
-
const handleLoadedMetadata = React.useCallback(() => {
|
13031
|
-
setIsLoadFinish(true);
|
13032
|
-
}, []);
|
13033
|
-
const handleClickVideo = React.useCallback((type) => () => {
|
13034
|
-
var _a, _b, _c, _d, _e;
|
13035
|
-
if (!isLoadFinish)
|
13036
|
-
return;
|
13037
|
-
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
13038
|
-
switch (type) {
|
13039
|
-
case 'start':
|
13040
|
-
if (!isPause)
|
13041
|
-
return;
|
13042
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
13043
|
-
setIsPauseVideo(false);
|
13044
|
-
break;
|
13045
|
-
case 'pause':
|
13046
|
-
if (isPause)
|
13047
|
-
return;
|
13048
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
13049
|
-
setIsPauseVideo(true);
|
13050
|
-
break;
|
13051
|
-
default:
|
13052
|
-
if (isPause) {
|
13053
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
13054
|
-
}
|
13055
|
-
else {
|
13056
|
-
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
13057
|
-
}
|
13058
|
-
setIsPauseVideo(!isPause);
|
13059
|
-
break;
|
13060
|
-
}
|
13061
|
-
}, [isLoadFinish]);
|
13062
|
-
const onPause = React.useCallback(() => {
|
13063
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
13064
|
-
const item = data[index];
|
13065
|
-
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
13066
|
-
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
13067
|
-
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
13068
|
-
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
13069
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13070
|
-
eventInfo: {
|
13071
|
-
eventSubject: 'playOverVideo',
|
13072
|
-
eventDescription: 'User finished playing the video',
|
13073
|
-
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13074
|
-
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13075
|
-
endTime: videoCurrentTime,
|
13076
|
-
videoDuration,
|
13077
|
-
playDuration,
|
13078
|
-
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13079
|
-
position: index + '',
|
13080
|
-
contentFormat: 'video',
|
13081
|
-
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13082
|
-
}
|
13083
|
-
});
|
13084
|
-
}
|
13085
|
-
}, [data, index, bffEventReport]);
|
13086
|
-
const blur = React.useMemo(() => {
|
13087
|
-
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
13088
|
-
}, [videoPostConfig]);
|
13089
|
-
const translateY = React.useMemo(() => {
|
13090
|
-
var _a;
|
13091
|
-
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
|
13092
|
-
? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
|
13093
|
-
: 'translateY(-50%)';
|
13094
|
-
}, [videoPostConfig]);
|
13095
|
-
const blurBgSrc = React.useMemo(() => {
|
13096
|
-
var _a;
|
13097
|
-
return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
|
13098
|
-
}, [firstFrameSrc, rec]);
|
13099
|
-
const handLoadeddata = React.useCallback(() => {
|
13100
|
-
if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
|
13101
|
-
return;
|
13102
|
-
const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
|
13103
|
-
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
13104
|
-
const ctx = canvas.getContext('2d');
|
13105
|
-
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
13106
|
-
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
13107
|
-
canvas.height = targetHeight;
|
13108
|
-
canvas.width = targetWidth;
|
13109
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
13110
|
-
setFirstFrameSrc(canvas.toDataURL());
|
13111
|
-
}, []);
|
13112
|
-
React.useEffect(() => {
|
13113
|
-
var _a, _b, _c, _d;
|
13114
|
-
if (!videoRef.current)
|
13115
|
-
return;
|
13116
|
-
setIsPauseVideo(false);
|
13117
|
-
if (!videoRef.current.src) {
|
13118
|
-
const videoSrc = rec.video.url;
|
13119
|
-
if (videoSrc.includes('.m3u8')) {
|
13120
|
-
if (Hls.isSupported()) {
|
13121
|
-
const hls = new Hls();
|
13122
|
-
hls.loadSource(videoSrc);
|
13123
|
-
hls.attachMedia(videoRef.current);
|
13124
|
-
}
|
13125
|
-
else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
|
13126
|
-
videoRef.current.src = videoSrc;
|
13127
|
-
}
|
13128
|
-
else {
|
13129
|
-
videoRef.current.src = videoSrc;
|
13130
|
-
}
|
13131
|
-
}
|
13132
|
-
else {
|
13133
|
-
videoRef.current.src = videoSrc;
|
13134
|
-
}
|
13135
|
-
videoRef.current.setAttribute('x5-playsinline', 'true');
|
13136
|
-
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
13137
|
-
}
|
13138
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
|
13139
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
|
13140
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
|
13141
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
|
13142
|
-
return () => {
|
13143
|
-
var _a, _b, _c, _d;
|
13144
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
13145
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
|
13146
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
|
13147
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
|
13148
|
-
};
|
13149
|
-
}, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
|
13150
|
-
const renderPoster = React.useMemo(() => {
|
13151
|
-
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
13152
|
-
return null;
|
13153
|
-
}
|
13154
|
-
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 }));
|
13155
|
-
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
13156
|
-
React.useEffect(() => {
|
13157
|
-
const handleBeforeUnload = () => {
|
13158
|
-
var _a, _b;
|
13159
|
-
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) {
|
13160
|
-
handleClickVideo('pause')();
|
13161
|
-
}
|
13162
|
-
};
|
13163
|
-
window.addEventListener('beforeunload', handleBeforeUnload);
|
13164
|
-
return () => {
|
13165
|
-
window.removeEventListener('beforeunload', handleBeforeUnload);
|
13166
|
-
};
|
13167
|
-
}, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
|
13168
|
-
const blurStyle = React.useMemo(() => {
|
13169
|
-
return blur
|
13170
|
-
? {
|
13171
|
-
filter: 'blur(10px)',
|
13172
|
-
transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
|
13173
|
-
}
|
13174
|
-
: {};
|
13175
|
-
}, [blur]);
|
13176
|
-
if (!rec.video) {
|
13177
|
-
return null;
|
13178
|
-
}
|
13179
|
-
return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
13180
|
-
position: 'relative',
|
13181
|
-
width,
|
13182
|
-
height,
|
13183
|
-
overflow: 'hidden'
|
13184
|
-
} },
|
13185
|
-
React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height,
|
13186
|
-
width, objectFit: 'cover' }, blurStyle) }),
|
13187
|
-
React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
|
13188
|
-
React.createElement("div", { style: {
|
13189
|
-
position: 'absolute',
|
13190
|
-
width,
|
13191
|
-
height,
|
13192
|
-
top: '50%',
|
13193
|
-
transform: translateY,
|
13194
|
-
left: 0,
|
13195
|
-
right: 0
|
13196
|
-
} },
|
13197
|
-
React.createElement("div", { style: { position: 'relative', width, height: '100%' } },
|
13198
|
-
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: {
|
13199
|
-
width: '100%',
|
13200
|
-
height,
|
13201
|
-
objectFit: 'contain'
|
13202
|
-
} }),
|
13203
|
-
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
13204
|
-
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
13205
|
-
position: 'relative',
|
13206
|
-
width,
|
13207
|
-
height,
|
13208
|
-
overflow: 'hidden'
|
13209
|
-
} },
|
13210
|
-
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 }),
|
13211
|
-
renderPoster,
|
13212
|
-
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
13213
|
-
};
|
13214
|
-
var VideoWidget$1 = React.memo(VideoWidget);
|
13215
|
-
|
13216
|
-
const RESOLVER$1 = {};
|
13217
|
-
Object.values(_materials_).forEach((v) => {
|
13218
|
-
RESOLVER$1[v.extend.type] = v;
|
13219
|
-
});
|
13220
|
-
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
13221
|
-
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
13222
|
-
const DiyPortalPreview = ({ data, globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain }) => {
|
13223
|
-
const height = React.useMemo(() => {
|
13224
|
-
return (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo) ? containerHeight - 45 : containerHeight;
|
13225
|
-
}, [globalConfig, containerHeight]);
|
13226
|
-
const renderContent = (rec, index) => {
|
13227
|
-
var _a, _b, _c, _d;
|
13228
|
-
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13229
|
-
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 }));
|
13230
|
-
}
|
13231
|
-
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13232
|
-
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 }));
|
13233
|
-
}
|
13234
|
-
if (rec.product) {
|
13235
|
-
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) {
|
13236
|
-
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
13237
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
13238
|
-
const t = RESOLVER$1[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
13239
|
-
const Component = withBindDataSource(t);
|
13240
|
-
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
13241
|
-
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) || {},
|
13242
|
-
// schema={schema}
|
13243
|
-
id: value === null || value === void 0 ? void 0 : value.id,
|
13244
|
-
// viewTime={viewTime.current}
|
13245
|
-
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 })));
|
13246
|
-
});
|
13247
|
-
}
|
13248
|
-
}
|
13249
|
-
};
|
13250
|
-
const renderLogo = React.useMemo(() => {
|
13251
|
-
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
13252
|
-
return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
|
13253
|
-
React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
13254
|
-
}
|
13255
|
-
return null;
|
13256
|
-
}, [globalConfig]);
|
13257
|
-
const renderBottom = (rec, index) => {
|
13258
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
13259
|
-
if (rec.video) {
|
13260
|
-
return (React.createElement(React.Fragment, null,
|
13261
|
-
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
13262
|
-
React.createElement("div", { className: 'clc-sxp-bottom' },
|
13263
|
-
React.createElement(Nudge, { nudge: nudge }),
|
13264
|
-
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
13265
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1 })),
|
13266
|
-
React.createElement("div", null,
|
13267
|
-
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' }) })),
|
13268
|
-
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 }))));
|
13269
|
-
}
|
13270
|
-
return null;
|
13271
|
-
};
|
13272
|
-
const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
|
13273
|
-
const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
|
13274
|
-
const renderLikeButton = (rec, index) => {
|
13275
|
-
var _a, _b, _c, _d;
|
13276
|
-
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
13277
|
-
return;
|
13278
|
-
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
13279
|
-
if (top < 40) {
|
13280
|
-
top += 40;
|
13281
|
-
}
|
13282
|
-
if (rec.video) {
|
13283
|
-
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: {
|
13284
|
-
top,
|
13285
|
-
right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0
|
13286
|
-
} }));
|
13287
|
-
}
|
13288
|
-
return null;
|
13289
|
-
};
|
13290
|
-
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
|
13291
|
-
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
|
13292
|
-
const renderView = (rec, index) => {
|
13293
|
-
var _a, _b, _c, _d;
|
13294
|
-
return (React.createElement("div", { style: { position: 'relative' } },
|
13295
|
-
renderLogo,
|
13296
|
-
React.createElement(ToggleButton$1, { style: {
|
13297
|
-
position: 'absolute',
|
13298
|
-
right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
|
13299
|
-
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',
|
13300
|
-
bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
|
13301
|
-
zIndex: 999
|
13302
|
-
}, 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 }),
|
13303
|
-
renderContent(rec, index),
|
13304
|
-
renderBottom(rec, index),
|
13305
|
-
renderLikeButton(rec, index)));
|
13306
|
-
};
|
13307
|
-
return (React.createElement("div", { style: {
|
13308
|
-
width: '100%',
|
13309
|
-
height: containerHeight,
|
13310
|
-
display: 'flex',
|
13311
|
-
boxSizing: 'border-box',
|
13312
|
-
gap: 16,
|
13313
|
-
pointerEvents: 'none',
|
13314
|
-
userSelect: 'none'
|
13315
|
-
} }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
|
13316
|
-
return renderView(rec, index);
|
13317
|
-
})));
|
13318
|
-
};
|
13319
|
-
var index$1 = React.memo(DiyPortalPreview);
|
13320
|
-
|
13321
12981
|
/*
|
13322
12982
|
* @Author: binruan@chatlabs.com
|
13323
12983
|
* @Date: 2023-10-31 10:56:01
|
@@ -13458,13 +13118,12 @@ function useEditorDataProvider() {
|
|
13458
13118
|
* @FilePath: \pb-sxp-ui\src\index.ts
|
13459
13119
|
*/
|
13460
13120
|
|
13461
|
-
exports.DiyPortalPreview = index$1;
|
13462
13121
|
exports.EditorDataProvider = EditorDataProvider;
|
13463
13122
|
exports.Modal = Modal$1;
|
13464
13123
|
exports.SxpDataSourceProvider = SxpDataSourceProvider$1;
|
13465
13124
|
exports.SxpPageCore = index;
|
13466
13125
|
exports.SxpPageRender = SxpPageRender;
|
13467
|
-
exports.core = index$
|
13126
|
+
exports.core = index$1;
|
13468
13127
|
exports.default = Pagebuilder;
|
13469
13128
|
exports.defaultSetting = defaultSetting;
|
13470
13129
|
exports.materials = _materials_;
|