pb-sxp-ui 1.0.37 → 1.0.39
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 +125 -452
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -6
- package/dist/index.js +125 -451
- 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 +129 -455
- 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 +79 -46
- 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 +79 -46
- 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/pb-ui.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('uuid'), require('pako'), require('react'), require('qs'), require('@emotion/css'), require('@ant-design/pro-components'), require('react-dom'), require('eventemitter3')
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', '@emotion/css', '@ant-design/pro-components', 'react-dom', 'eventemitter3'
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PUI = {}, global.lodash, global.uuid$1, global.pako, global.React, global.qs, global.css, global.proComponents, global.ReactDOM, global.EventEmitter
|
5
|
-
})(this, (function (exports, lodash, uuid$1, pako, React, qs, css, proComponents, ReactDOM, EventEmitter
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('uuid'), require('pako'), require('react'), require('qs'), require('@emotion/css'), require('@ant-design/pro-components'), require('react-dom'), require('eventemitter3')) :
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', '@emotion/css', '@ant-design/pro-components', 'react-dom', 'eventemitter3'], factory) :
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PUI = {}, global.lodash, global.uuid$1, global.pako, global.React, global.qs, global.css, global.proComponents, global.ReactDOM, global.EventEmitter));
|
5
|
+
})(this, (function (exports, lodash, uuid$1, pako, React, qs, css, proComponents, ReactDOM, EventEmitter) { 'use strict';
|
6
6
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
8
8
|
var n = Object.create(null);
|
@@ -569,7 +569,7 @@
|
|
569
569
|
fromKName = 'imagePage';
|
570
570
|
}
|
571
571
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
572
|
-
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 + '',
|
572
|
+
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 })
|
573
573
|
});
|
574
574
|
}, [bffEventReport, isFromHashtag]);
|
575
575
|
React.useEffect(() => {
|
@@ -856,7 +856,7 @@
|
|
856
856
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
857
857
|
});
|
858
858
|
|
859
|
-
var index$
|
859
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
860
860
|
__proto__: null,
|
861
861
|
EditorCore: EditorCore
|
862
862
|
});
|
@@ -8142,8 +8142,8 @@
|
|
8142
8142
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8143
8143
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
8144
8144
|
position: position + '',
|
8145
|
-
|
8146
|
-
|
8145
|
+
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 : '',
|
8146
|
+
relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
8147
8147
|
traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
|
8148
8148
|
}
|
8149
8149
|
});
|
@@ -8167,8 +8167,8 @@
|
|
8167
8167
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
8168
8168
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
8169
8169
|
position: position + '',
|
8170
|
-
|
8171
|
-
|
8170
|
+
relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
8171
|
+
relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
8172
8172
|
traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
|
8173
8173
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
8174
8174
|
eventSubject: 'productView',
|
@@ -8331,7 +8331,7 @@
|
|
8331
8331
|
var FormatImage$1 = React.memo(FormatImage);
|
8332
8332
|
|
8333
8333
|
const CommodityDetail$1 = (_a) => {
|
8334
|
-
var _b, _c, _d, _e, _f, _g, _h, _j
|
8334
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
8335
8335
|
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"]);
|
8336
8336
|
const { sxpParameter } = useSxpDataSource();
|
8337
8337
|
const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
|
@@ -8372,7 +8372,7 @@
|
|
8372
8372
|
return '$7,000';
|
8373
8373
|
}
|
8374
8374
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8375
|
-
const width = isPreview ? 375 :
|
8375
|
+
const width = isPreview ? 375 : window.innerWidth;
|
8376
8376
|
const renderContent = ({ isPost }) => {
|
8377
8377
|
var _a, _b, _c;
|
8378
8378
|
return (React.createElement("div", null,
|
@@ -8392,7 +8392,7 @@
|
|
8392
8392
|
};
|
8393
8393
|
return (React.createElement("div", { className: 'pb-commondity' },
|
8394
8394
|
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
8395
|
-
product && ((
|
8395
|
+
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: {
|
8396
8396
|
clickable: true,
|
8397
8397
|
bulletActiveClass: 'swipe-item-active-bullet',
|
8398
8398
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -8400,7 +8400,7 @@
|
|
8400
8400
|
: 'commondityDetail-swiper-clickable-center'
|
8401
8401
|
}, loop: true, autoplay: {
|
8402
8402
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8403
|
-
} }, (
|
8403
|
+
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
8404
8404
|
return (React.createElement(SwiperSlide, { key: src },
|
8405
8405
|
React.createElement("div", { style: {
|
8406
8406
|
overflow: 'hidden',
|
@@ -8409,7 +8409,7 @@
|
|
8409
8409
|
} },
|
8410
8410
|
React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
|
8411
8411
|
}))),
|
8412
|
-
!((
|
8412
|
+
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
|
8413
8413
|
position: 'relative',
|
8414
8414
|
height: 0,
|
8415
8415
|
width: '100%',
|
@@ -8422,7 +8422,7 @@
|
|
8422
8422
|
top: 0,
|
8423
8423
|
objectFit: 'cover',
|
8424
8424
|
width: '100%'
|
8425
|
-
}), src: (
|
8425
|
+
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8426
8426
|
React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
8427
8427
|
renderBtn(),
|
8428
8428
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
@@ -8782,7 +8782,7 @@
|
|
8782
8782
|
];
|
8783
8783
|
|
8784
8784
|
const CommodityDetailDiroNew$1 = (_a) => {
|
8785
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
8785
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
8786
8786
|
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"]);
|
8787
8787
|
React.useState(true);
|
8788
8788
|
const { sxpParameter } = useSxpDataSource();
|
@@ -8830,7 +8830,7 @@
|
|
8830
8830
|
return '£102,300.00';
|
8831
8831
|
}
|
8832
8832
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
8833
|
-
const width = isPreview ? 375 :
|
8833
|
+
const width = isPreview ? 375 : window.innerWidth;
|
8834
8834
|
const productInfoText = ({ isPost }) => {
|
8835
8835
|
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8836
8836
|
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) ||
|
@@ -8839,7 +8839,7 @@ Made in Italy` })));
|
|
8839
8839
|
};
|
8840
8840
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
8841
8841
|
React.createElement("div", Object.assign({ ref: scrollRef, className: css.css(Object.assign({}, style)) }, props),
|
8842
|
-
product && ((
|
8842
|
+
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: {
|
8843
8843
|
clickable: true,
|
8844
8844
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
8845
8845
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -8847,7 +8847,7 @@ Made in Italy` })));
|
|
8847
8847
|
: 'commondityDiroNew-swiper-clickable-center'
|
8848
8848
|
}, loop: true, autoplay: {
|
8849
8849
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
8850
|
-
} }, (
|
8850
|
+
} }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
|
8851
8851
|
return (React.createElement(SwiperSlide, { key: src },
|
8852
8852
|
React.createElement("div", { style: {
|
8853
8853
|
overflow: 'hidden',
|
@@ -8856,7 +8856,7 @@ Made in Italy` })));
|
|
8856
8856
|
} },
|
8857
8857
|
React.createElement(FormatImage$1, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
|
8858
8858
|
}))),
|
8859
|
-
!((
|
8859
|
+
!((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (React.createElement("div", { className: css.css({
|
8860
8860
|
position: 'relative',
|
8861
8861
|
height: 0,
|
8862
8862
|
width: '100%',
|
@@ -8869,16 +8869,16 @@ Made in Italy` })));
|
|
8869
8869
|
top: 0,
|
8870
8870
|
objectFit: 'cover',
|
8871
8871
|
width: '100%'
|
8872
|
-
}), src: (
|
8872
|
+
}), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
|
8873
8873
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
8874
8874
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
8875
8875
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
8876
|
-
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (
|
8876
|
+
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'),
|
8877
8877
|
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')),
|
8878
8878
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
8879
8879
|
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),
|
8880
|
-
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 }, (
|
8881
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (
|
8880
|
+
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 : '税费'))),
|
8881
|
+
(!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')),
|
8882
8882
|
productInfoText({ isPost }))),
|
8883
8883
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
8884
8884
|
};
|
@@ -11786,7 +11786,7 @@ Made in Italy` })));
|
|
11786
11786
|
}
|
11787
11787
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
11788
11788
|
eventInfo: {
|
11789
|
-
|
11789
|
+
relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
11790
11790
|
position: cacheActiveIndex + '',
|
11791
11791
|
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
11792
11792
|
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
@@ -11919,14 +11919,14 @@ Made in Italy` })));
|
|
11919
11919
|
Prompt: Prompt
|
11920
11920
|
});
|
11921
11921
|
|
11922
|
-
const defaultUnLikeIconPath
|
11923
|
-
const defaultLikeIconPath
|
11922
|
+
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
11923
|
+
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
11924
11924
|
const LikeButton = (_a) => {
|
11925
11925
|
var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
|
11926
11926
|
const { mutateLike, mutateUnlike, bffEventReport } = useSxpDataSource();
|
11927
11927
|
const [state, setState] = React.useState(active);
|
11928
|
-
const likeIcon = useIconLink(defaultLikeIconPath
|
11929
|
-
const unlikeIcon = useIconLink(defaultUnLikeIconPath
|
11928
|
+
const likeIcon = useIconLink(defaultLikeIconPath);
|
11929
|
+
const unlikeIcon = useIconLink(defaultUnLikeIconPath);
|
11930
11930
|
const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
11931
11931
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
11932
11932
|
if (state) {
|
@@ -11982,7 +11982,7 @@ Made in Italy` })));
|
|
11982
11982
|
SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
|
11983
11983
|
})(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
|
11984
11984
|
|
11985
|
-
const VideoWidget
|
11985
|
+
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig }) => {
|
11986
11986
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
11987
11987
|
const videoRef = React.useRef(null);
|
11988
11988
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
@@ -11992,12 +11992,13 @@ Made in Italy` })));
|
|
11992
11992
|
const { isActive } = useSwiperSlide();
|
11993
11993
|
const canvasRef = React.useRef(null);
|
11994
11994
|
const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
|
11995
|
+
const videoId = `pb-video-${index}`;
|
11995
11996
|
React.useEffect(() => {
|
11996
11997
|
if (!videoRef.current)
|
11997
11998
|
return;
|
11998
|
-
videoRef.current.muted
|
11999
|
+
videoRef.current.muted(muted);
|
11999
12000
|
}, [muted]);
|
12000
|
-
const
|
12001
|
+
const handleEnded = React.useCallback(() => {
|
12001
12002
|
var _a;
|
12002
12003
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
12003
12004
|
}, []);
|
@@ -12006,10 +12007,10 @@ Made in Italy` })));
|
|
12006
12007
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
12007
12008
|
setIsPauseVideo(false);
|
12008
12009
|
const item = data[index];
|
12009
|
-
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
12010
|
-
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
12011
|
-
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
12012
|
-
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
12010
|
+
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration())) {
|
12011
|
+
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime()) || 0;
|
12012
|
+
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration()) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
12013
|
+
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime()) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
12013
12014
|
const playType = isFirstPlay ? '0' : '1';
|
12014
12015
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12015
12016
|
eventInfo: {
|
@@ -12029,14 +12030,15 @@ Made in Italy` })));
|
|
12029
12030
|
setIsFirstPlay(false);
|
12030
12031
|
}
|
12031
12032
|
}, [bffEventReport, data, index, isFirstPlay]);
|
12032
|
-
const
|
12033
|
+
const handleCanplay = React.useCallback(() => {
|
12034
|
+
handLoadeddata();
|
12033
12035
|
setIsLoadFinish(true);
|
12034
12036
|
}, []);
|
12035
12037
|
const handleClickVideo = React.useCallback((type) => () => {
|
12036
12038
|
var _a, _b, _c, _d, _e;
|
12037
12039
|
if (!isLoadFinish)
|
12038
12040
|
return;
|
12039
|
-
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
12041
|
+
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused();
|
12040
12042
|
switch (type) {
|
12041
12043
|
case 'start':
|
12042
12044
|
if (!isPause)
|
@@ -12061,13 +12063,13 @@ Made in Italy` })));
|
|
12061
12063
|
break;
|
12062
12064
|
}
|
12063
12065
|
}, [isLoadFinish]);
|
12064
|
-
const
|
12066
|
+
const handlePause = React.useCallback(() => {
|
12065
12067
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
12066
12068
|
const item = data[index];
|
12067
|
-
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
12068
|
-
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
12069
|
-
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
12070
|
-
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
12069
|
+
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration()) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
12070
|
+
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime()) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
12071
|
+
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration()) {
|
12072
|
+
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime()) - videoStartTime.current).toFixed(2);
|
12071
12073
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12072
12074
|
eventInfo: {
|
12073
12075
|
eventSubject: 'playOverVideo',
|
@@ -12099,56 +12101,66 @@ Made in Italy` })));
|
|
12099
12101
|
return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
|
12100
12102
|
}, [firstFrameSrc, rec]);
|
12101
12103
|
const handLoadeddata = React.useCallback(() => {
|
12102
|
-
|
12104
|
+
var _a;
|
12105
|
+
const videoDomRef = document.getElementById(`${videoId}_html5_api`);
|
12106
|
+
if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
|
12103
12107
|
return;
|
12104
|
-
const
|
12105
|
-
|
12106
|
-
|
12107
|
-
|
12108
|
-
|
12109
|
-
|
12110
|
-
|
12111
|
-
|
12112
|
-
|
12108
|
+
const setFrameImg = () => {
|
12109
|
+
const video = videoDomRef;
|
12110
|
+
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
12111
|
+
const ctx = canvas.getContext('2d');
|
12112
|
+
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
12113
|
+
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
12114
|
+
canvas.height = targetHeight;
|
12115
|
+
canvas.width = targetWidth;
|
12116
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
12117
|
+
setFirstFrameSrc(canvas.toDataURL());
|
12118
|
+
};
|
12119
|
+
setFrameImg();
|
12120
|
+
setTimeout(() => {
|
12121
|
+
setFrameImg();
|
12122
|
+
}, 500);
|
12113
12123
|
}, []);
|
12114
12124
|
React.useEffect(() => {
|
12115
|
-
var _a, _b, _c, _d;
|
12116
|
-
if (!videoRef.current)
|
12117
|
-
return;
|
12125
|
+
var _a, _b, _c, _d, _e;
|
12118
12126
|
setIsPauseVideo(false);
|
12119
|
-
|
12120
|
-
|
12121
|
-
|
12122
|
-
|
12123
|
-
|
12124
|
-
|
12125
|
-
|
12126
|
-
|
12127
|
-
|
12128
|
-
|
12129
|
-
|
12130
|
-
|
12131
|
-
|
12132
|
-
|
12133
|
-
|
12134
|
-
|
12135
|
-
|
12136
|
-
|
12137
|
-
videoRef.current.
|
12138
|
-
|
12139
|
-
|
12140
|
-
(
|
12141
|
-
(
|
12142
|
-
|
12143
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
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
|
+
});
|
12144
|
+
videoRef.current.play();
|
12145
|
+
videoRef.current.pause();
|
12146
|
+
}
|
12147
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.on('loadedmetadata', handleCanplay);
|
12148
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.on('canplay', handleCanplay);
|
12149
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.on('playing', handlePlaying);
|
12150
|
+
// videoRef.current?.on('loadeddata', handLoadeddata);
|
12151
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.on('pause', handlePause);
|
12152
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.on('ended', handleEnded);
|
12144
12153
|
return () => {
|
12145
|
-
var _a, _b, _c, _d;
|
12146
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.
|
12147
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.
|
12148
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.
|
12149
|
-
|
12154
|
+
var _a, _b, _c, _d, _e;
|
12155
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.off('loadedmetadata', handleCanplay);
|
12156
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.off('canplay', handleCanplay);
|
12157
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.off('playing', handlePlaying);
|
12158
|
+
// videoRef.current?.off('loadeddata', handLoadeddata);
|
12159
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.off('pause', handlePause);
|
12160
|
+
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.off('ended', handleEnded);
|
12161
|
+
videoRef.current.dispose();
|
12150
12162
|
};
|
12151
|
-
}, [
|
12163
|
+
}, []);
|
12152
12164
|
React.useEffect(() => {
|
12153
12165
|
var _a;
|
12154
12166
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
@@ -12234,23 +12246,31 @@ Made in Italy` })));
|
|
12234
12246
|
right: 0
|
12235
12247
|
} },
|
12236
12248
|
React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
|
12237
|
-
React.createElement("video", { id: `pb-video-${index}`,
|
12249
|
+
React.createElement("video", { id: `pb-video-${index}`, playsInline: true, crossOrigin: 'anonymous', style: {
|
12238
12250
|
width: '100%',
|
12239
12251
|
height: '100%',
|
12240
|
-
objectFit: 'contain'
|
12252
|
+
objectFit: 'contain',
|
12253
|
+
backgroundColor: 'transparent',
|
12254
|
+
pointerEvents: 'none'
|
12241
12255
|
} }),
|
12242
12256
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
12243
|
-
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId,
|
12257
|
+
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, style: {
|
12244
12258
|
position: 'relative',
|
12245
12259
|
width: '100%',
|
12246
12260
|
height,
|
12247
12261
|
overflow: 'hidden'
|
12248
|
-
} },
|
12249
|
-
React.createElement("video", { id: `pb-video-${index}`,
|
12262
|
+
}, onClick: handleClickVideo() },
|
12263
|
+
React.createElement("video", { id: `pb-video-${index}`, playsInline: true, crossOrigin: 'anonymous', style: {
|
12264
|
+
backgroundColor: 'transparent',
|
12265
|
+
width: '100%',
|
12266
|
+
height: '100%',
|
12267
|
+
objectFit: 'cover',
|
12268
|
+
pointerEvents: 'none'
|
12269
|
+
} }),
|
12250
12270
|
renderPoster,
|
12251
12271
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
12252
12272
|
};
|
12253
|
-
var VideoWidget$
|
12273
|
+
var VideoWidget$1 = React.memo(VideoWidget);
|
12254
12274
|
|
12255
12275
|
/*
|
12256
12276
|
* @Author: binruan@chatlabs.com
|
@@ -12349,7 +12369,7 @@ Made in Italy` })));
|
|
12349
12369
|
* @LastEditTime: 2024-04-18 19:56:22
|
12350
12370
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
12351
12371
|
*/
|
12352
|
-
const PictureGroup
|
12372
|
+
const PictureGroup = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
12353
12373
|
var _a;
|
12354
12374
|
const ref = React.useRef();
|
12355
12375
|
const { isActive } = useSwiperSlide();
|
@@ -12378,7 +12398,7 @@ Made in Italy` })));
|
|
12378
12398
|
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
|
12379
12399
|
})));
|
12380
12400
|
};
|
12381
|
-
var PictureGroup$
|
12401
|
+
var PictureGroup$1 = React.memo(PictureGroup);
|
12382
12402
|
|
12383
12403
|
/*
|
12384
12404
|
* @Author: binruan@chatlabs.com
|
@@ -12557,7 +12577,7 @@ Made in Italy` })));
|
|
12557
12577
|
* @Author: binruan@chatlabs.com
|
12558
12578
|
* @Date: 2024-01-15 19:03:09
|
12559
12579
|
* @LastEditors: binruan@chatlabs.com
|
12560
|
-
* @LastEditTime: 2024-04-
|
12580
|
+
* @LastEditTime: 2024-04-18 19:27:03
|
12561
12581
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
12562
12582
|
*
|
12563
12583
|
*/
|
@@ -12639,8 +12659,8 @@ Made in Italy` })));
|
|
12639
12659
|
// sessionDuration: Math.floor(((new Date() as any) - curTime) / 1000) + '',
|
12640
12660
|
// eventSubject: 'sessionCompleted',
|
12641
12661
|
// eventDescription: 'Session completed',
|
12642
|
-
//
|
12643
|
-
//
|
12662
|
+
// relatedContentId: item?.video?.itemId,
|
12663
|
+
// relatedProductId: item?.product?.itemId,
|
12644
12664
|
// position: item?.position
|
12645
12665
|
// }
|
12646
12666
|
// });
|
@@ -12684,12 +12704,12 @@ Made in Italy` })));
|
|
12684
12704
|
sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
|
12685
12705
|
eventSubject: 'sessionCompleted',
|
12686
12706
|
eventDescription: 'Session completed',
|
12687
|
-
|
12688
|
-
|
12707
|
+
relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
|
12708
|
+
relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
|
12689
12709
|
position: activeIndex + '',
|
12690
12710
|
fromKName,
|
12691
12711
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
12692
|
-
|
12712
|
+
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 : ''
|
12693
12713
|
}
|
12694
12714
|
});
|
12695
12715
|
}
|
@@ -12718,10 +12738,10 @@ Made in Italy` })));
|
|
12718
12738
|
const renderContent = React.useCallback((rec, index) => {
|
12719
12739
|
var _a, _b, _c, _d;
|
12720
12740
|
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
12721
|
-
return (React.createElement(VideoWidget$
|
12741
|
+
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 }));
|
12722
12742
|
}
|
12723
12743
|
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
12724
|
-
return (React.createElement(PictureGroup$
|
12744
|
+
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 }));
|
12725
12745
|
}
|
12726
12746
|
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) {
|
12727
12747
|
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
@@ -12823,8 +12843,8 @@ Made in Italy` })));
|
|
12823
12843
|
eventInfo: {
|
12824
12844
|
eventSubject: 'scrollDown',
|
12825
12845
|
eventDescription: 'User scroll down',
|
12826
|
-
|
12827
|
-
|
12846
|
+
relatedContentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
|
12847
|
+
relatedProductId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
12828
12848
|
requestId: null
|
12829
12849
|
}
|
12830
12850
|
});
|
@@ -12836,8 +12856,8 @@ Made in Italy` })));
|
|
12836
12856
|
eventInfo: {
|
12837
12857
|
eventSubject: 'scrollUp',
|
12838
12858
|
eventDescription: 'User scroll up',
|
12839
|
-
|
12840
|
-
|
12859
|
+
relatedContentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
|
12860
|
+
relatedProductId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
12841
12861
|
requestId: null
|
12842
12862
|
}
|
12843
12863
|
});
|
@@ -12960,351 +12980,6 @@ Made in Italy` })));
|
|
12960
12980
|
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))));
|
12961
12981
|
};
|
12962
12982
|
|
12963
|
-
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|
12964
|
-
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) => {
|
12965
|
-
return (React.createElement(SwiperSlide, { key: url },
|
12966
|
-
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
|
12967
|
-
})));
|
12968
|
-
};
|
12969
|
-
var PictureGroup$1 = React.memo(PictureGroup);
|
12970
|
-
|
12971
|
-
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
|
12972
|
-
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
12973
|
-
const videoRef = React.useRef(null);
|
12974
|
-
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
12975
|
-
const videoStartTime = React.useRef(0);
|
12976
|
-
const [isLoadFinish, setIsLoadFinish] = React.useState(false);
|
12977
|
-
const [isFirstPlay, setIsFirstPlay] = React.useState(true);
|
12978
|
-
const canvasRef = React.useRef(null);
|
12979
|
-
const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
|
12980
|
-
React.useEffect(() => {
|
12981
|
-
if (!videoRef.current)
|
12982
|
-
return;
|
12983
|
-
videoRef.current.muted = muted;
|
12984
|
-
}, [muted]);
|
12985
|
-
const handleVideoStart = React.useCallback(() => {
|
12986
|
-
var _a;
|
12987
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
12988
|
-
}, []);
|
12989
|
-
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
12990
|
-
const handlePlaying = React.useCallback(() => {
|
12991
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
12992
|
-
setIsPauseVideo(false);
|
12993
|
-
const item = data[index];
|
12994
|
-
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
12995
|
-
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
12996
|
-
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
12997
|
-
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
12998
|
-
const playType = isFirstPlay ? '0' : '1';
|
12999
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13000
|
-
eventInfo: {
|
13001
|
-
eventSubject: 'playVideo',
|
13002
|
-
eventDescription: 'User played the video',
|
13003
|
-
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13004
|
-
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13005
|
-
playType,
|
13006
|
-
startTime: videoCurrentTime,
|
13007
|
-
videoDuration,
|
13008
|
-
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13009
|
-
position: index + '',
|
13010
|
-
contentFormat: 'video',
|
13011
|
-
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13012
|
-
}
|
13013
|
-
});
|
13014
|
-
setIsFirstPlay(false);
|
13015
|
-
}
|
13016
|
-
}, [bffEventReport, data, index, isFirstPlay]);
|
13017
|
-
const handleLoadedMetadata = React.useCallback(() => {
|
13018
|
-
setIsLoadFinish(true);
|
13019
|
-
}, []);
|
13020
|
-
const handleClickVideo = React.useCallback((type) => () => {
|
13021
|
-
var _a, _b, _c, _d, _e;
|
13022
|
-
if (!isLoadFinish)
|
13023
|
-
return;
|
13024
|
-
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
13025
|
-
switch (type) {
|
13026
|
-
case 'start':
|
13027
|
-
if (!isPause)
|
13028
|
-
return;
|
13029
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
13030
|
-
setIsPauseVideo(false);
|
13031
|
-
break;
|
13032
|
-
case 'pause':
|
13033
|
-
if (isPause)
|
13034
|
-
return;
|
13035
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
13036
|
-
setIsPauseVideo(true);
|
13037
|
-
break;
|
13038
|
-
default:
|
13039
|
-
if (isPause) {
|
13040
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
13041
|
-
}
|
13042
|
-
else {
|
13043
|
-
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
13044
|
-
}
|
13045
|
-
setIsPauseVideo(!isPause);
|
13046
|
-
break;
|
13047
|
-
}
|
13048
|
-
}, [isLoadFinish]);
|
13049
|
-
const onPause = React.useCallback(() => {
|
13050
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
13051
|
-
const item = data[index];
|
13052
|
-
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
13053
|
-
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
13054
|
-
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
13055
|
-
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
13056
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13057
|
-
eventInfo: {
|
13058
|
-
eventSubject: 'playOverVideo',
|
13059
|
-
eventDescription: 'User finished playing the video',
|
13060
|
-
contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
13061
|
-
contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
13062
|
-
endTime: videoCurrentTime,
|
13063
|
-
videoDuration,
|
13064
|
-
playDuration,
|
13065
|
-
contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
13066
|
-
position: index + '',
|
13067
|
-
contentFormat: 'video',
|
13068
|
-
traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
13069
|
-
}
|
13070
|
-
});
|
13071
|
-
}
|
13072
|
-
}, [data, index, bffEventReport]);
|
13073
|
-
const blur = React.useMemo(() => {
|
13074
|
-
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
13075
|
-
}, [videoPostConfig]);
|
13076
|
-
const translateY = React.useMemo(() => {
|
13077
|
-
var _a;
|
13078
|
-
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
|
13079
|
-
? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
|
13080
|
-
: 'translateY(-50%)';
|
13081
|
-
}, [videoPostConfig]);
|
13082
|
-
const blurBgSrc = React.useMemo(() => {
|
13083
|
-
var _a;
|
13084
|
-
return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
|
13085
|
-
}, [firstFrameSrc, rec]);
|
13086
|
-
const handLoadeddata = React.useCallback(() => {
|
13087
|
-
if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
|
13088
|
-
return;
|
13089
|
-
const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
|
13090
|
-
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
13091
|
-
const ctx = canvas.getContext('2d');
|
13092
|
-
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
13093
|
-
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
13094
|
-
canvas.height = targetHeight;
|
13095
|
-
canvas.width = targetWidth;
|
13096
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
13097
|
-
setFirstFrameSrc(canvas.toDataURL());
|
13098
|
-
}, []);
|
13099
|
-
React.useEffect(() => {
|
13100
|
-
var _a, _b, _c, _d;
|
13101
|
-
if (!videoRef.current)
|
13102
|
-
return;
|
13103
|
-
setIsPauseVideo(false);
|
13104
|
-
if (!videoRef.current.src) {
|
13105
|
-
const videoSrc = rec.video.url;
|
13106
|
-
if (videoSrc.includes('.m3u8')) {
|
13107
|
-
if (Hls.isSupported()) {
|
13108
|
-
const hls = new Hls();
|
13109
|
-
hls.loadSource(videoSrc);
|
13110
|
-
hls.attachMedia(videoRef.current);
|
13111
|
-
}
|
13112
|
-
else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
|
13113
|
-
videoRef.current.src = videoSrc;
|
13114
|
-
}
|
13115
|
-
else {
|
13116
|
-
videoRef.current.src = videoSrc;
|
13117
|
-
}
|
13118
|
-
}
|
13119
|
-
else {
|
13120
|
-
videoRef.current.src = videoSrc;
|
13121
|
-
}
|
13122
|
-
videoRef.current.setAttribute('x5-playsinline', 'true');
|
13123
|
-
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
13124
|
-
}
|
13125
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
|
13126
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
|
13127
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
|
13128
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
|
13129
|
-
return () => {
|
13130
|
-
var _a, _b, _c, _d;
|
13131
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
13132
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
|
13133
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
|
13134
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
|
13135
|
-
};
|
13136
|
-
}, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
|
13137
|
-
const renderPoster = React.useMemo(() => {
|
13138
|
-
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
13139
|
-
return null;
|
13140
|
-
}
|
13141
|
-
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 }));
|
13142
|
-
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
13143
|
-
React.useEffect(() => {
|
13144
|
-
const handleBeforeUnload = () => {
|
13145
|
-
var _a, _b;
|
13146
|
-
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) {
|
13147
|
-
handleClickVideo('pause')();
|
13148
|
-
}
|
13149
|
-
};
|
13150
|
-
window.addEventListener('beforeunload', handleBeforeUnload);
|
13151
|
-
return () => {
|
13152
|
-
window.removeEventListener('beforeunload', handleBeforeUnload);
|
13153
|
-
};
|
13154
|
-
}, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
|
13155
|
-
const blurStyle = React.useMemo(() => {
|
13156
|
-
return blur
|
13157
|
-
? {
|
13158
|
-
filter: 'blur(10px)',
|
13159
|
-
transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
|
13160
|
-
}
|
13161
|
-
: {};
|
13162
|
-
}, [blur]);
|
13163
|
-
if (!rec.video) {
|
13164
|
-
return null;
|
13165
|
-
}
|
13166
|
-
return (React.createElement(React.Fragment, null, blur ? (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
13167
|
-
position: 'relative',
|
13168
|
-
width,
|
13169
|
-
height,
|
13170
|
-
overflow: 'hidden'
|
13171
|
-
} },
|
13172
|
-
React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height,
|
13173
|
-
width, objectFit: 'cover' }, blurStyle) }),
|
13174
|
-
React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
|
13175
|
-
React.createElement("div", { style: {
|
13176
|
-
position: 'absolute',
|
13177
|
-
width,
|
13178
|
-
height,
|
13179
|
-
top: '50%',
|
13180
|
-
transform: translateY,
|
13181
|
-
left: 0,
|
13182
|
-
right: 0
|
13183
|
-
} },
|
13184
|
-
React.createElement("div", { style: { position: 'relative', width, height: '100%' } },
|
13185
|
-
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: {
|
13186
|
-
width: '100%',
|
13187
|
-
height,
|
13188
|
-
objectFit: 'contain'
|
13189
|
-
} }),
|
13190
|
-
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
13191
|
-
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
13192
|
-
position: 'relative',
|
13193
|
-
width,
|
13194
|
-
height,
|
13195
|
-
overflow: 'hidden'
|
13196
|
-
} },
|
13197
|
-
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 }),
|
13198
|
-
renderPoster,
|
13199
|
-
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
13200
|
-
};
|
13201
|
-
var VideoWidget$1 = React.memo(VideoWidget);
|
13202
|
-
|
13203
|
-
const RESOLVER$1 = {};
|
13204
|
-
Object.values(_materials_).forEach((v) => {
|
13205
|
-
RESOLVER$1[v.extend.type] = v;
|
13206
|
-
});
|
13207
|
-
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
13208
|
-
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
13209
|
-
const DiyPortalPreview = ({ data, globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain }) => {
|
13210
|
-
const height = React.useMemo(() => {
|
13211
|
-
return (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo) ? containerHeight - 45 : containerHeight;
|
13212
|
-
}, [globalConfig, containerHeight]);
|
13213
|
-
const renderContent = (rec, index) => {
|
13214
|
-
var _a, _b, _c, _d;
|
13215
|
-
if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13216
|
-
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 }));
|
13217
|
-
}
|
13218
|
-
if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13219
|
-
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 }));
|
13220
|
-
}
|
13221
|
-
if (rec.product) {
|
13222
|
-
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) {
|
13223
|
-
return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
|
13224
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
13225
|
-
const t = RESOLVER$1[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
13226
|
-
const Component = withBindDataSource(t);
|
13227
|
-
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
13228
|
-
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) || {},
|
13229
|
-
// schema={schema}
|
13230
|
-
id: value === null || value === void 0 ? void 0 : value.id,
|
13231
|
-
// viewTime={viewTime.current}
|
13232
|
-
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 })));
|
13233
|
-
});
|
13234
|
-
}
|
13235
|
-
}
|
13236
|
-
};
|
13237
|
-
const renderLogo = React.useMemo(() => {
|
13238
|
-
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
13239
|
-
return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
|
13240
|
-
React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
13241
|
-
}
|
13242
|
-
return null;
|
13243
|
-
}, [globalConfig]);
|
13244
|
-
const renderBottom = (rec, index) => {
|
13245
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
13246
|
-
if (rec.video) {
|
13247
|
-
return (React.createElement(React.Fragment, null,
|
13248
|
-
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
13249
|
-
React.createElement("div", { className: 'clc-sxp-bottom' },
|
13250
|
-
React.createElement(Nudge, { nudge: nudge }),
|
13251
|
-
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
13252
|
-
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1 })),
|
13253
|
-
React.createElement("div", null,
|
13254
|
-
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' }) })),
|
13255
|
-
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 }))));
|
13256
|
-
}
|
13257
|
-
return null;
|
13258
|
-
};
|
13259
|
-
const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
|
13260
|
-
const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
|
13261
|
-
const renderLikeButton = (rec, index) => {
|
13262
|
-
var _a, _b, _c, _d;
|
13263
|
-
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
13264
|
-
return;
|
13265
|
-
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
13266
|
-
if (top < 40) {
|
13267
|
-
top += 40;
|
13268
|
-
}
|
13269
|
-
if (rec.video) {
|
13270
|
-
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: {
|
13271
|
-
top,
|
13272
|
-
right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0
|
13273
|
-
} }));
|
13274
|
-
}
|
13275
|
-
return null;
|
13276
|
-
};
|
13277
|
-
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
|
13278
|
-
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
|
13279
|
-
const renderView = (rec, index) => {
|
13280
|
-
var _a, _b, _c, _d;
|
13281
|
-
return (React.createElement("div", { style: { position: 'relative' } },
|
13282
|
-
renderLogo,
|
13283
|
-
React.createElement(ToggleButton$1, { style: {
|
13284
|
-
position: 'absolute',
|
13285
|
-
right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
|
13286
|
-
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',
|
13287
|
-
bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
|
13288
|
-
zIndex: 999
|
13289
|
-
}, 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 }),
|
13290
|
-
renderContent(rec, index),
|
13291
|
-
renderBottom(rec, index),
|
13292
|
-
renderLikeButton(rec, index)));
|
13293
|
-
};
|
13294
|
-
return (React.createElement("div", { style: {
|
13295
|
-
width: '100%',
|
13296
|
-
height: containerHeight,
|
13297
|
-
display: 'flex',
|
13298
|
-
boxSizing: 'border-box',
|
13299
|
-
gap: 16,
|
13300
|
-
pointerEvents: 'none',
|
13301
|
-
userSelect: 'none'
|
13302
|
-
} }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
|
13303
|
-
return renderView(rec, index);
|
13304
|
-
})));
|
13305
|
-
};
|
13306
|
-
var index$1 = React.memo(DiyPortalPreview);
|
13307
|
-
|
13308
12983
|
/*
|
13309
12984
|
* @Author: binruan@chatlabs.com
|
13310
12985
|
* @Date: 2023-10-31 10:56:01
|
@@ -13445,13 +13120,12 @@ Made in Italy` })));
|
|
13445
13120
|
* @FilePath: \pb-sxp-ui\src\index.ts
|
13446
13121
|
*/
|
13447
13122
|
|
13448
|
-
exports.DiyPortalPreview = index$1;
|
13449
13123
|
exports.EditorDataProvider = EditorDataProvider;
|
13450
13124
|
exports.Modal = Modal$1;
|
13451
13125
|
exports.SxpDataSourceProvider = SxpDataSourceProvider$1;
|
13452
13126
|
exports.SxpPageCore = index;
|
13453
13127
|
exports.SxpPageRender = SxpPageRender;
|
13454
|
-
exports.core = index$
|
13128
|
+
exports.core = index$1;
|
13455
13129
|
exports.default = Pagebuilder;
|
13456
13130
|
exports.defaultSetting = defaultSetting;
|
13457
13131
|
exports.materials = _materials_;
|