pb-sxp-ui 1.0.88 → 1.0.89
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 +151 -211
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +151 -211
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +154 -214
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/FormatImage.js +2 -7
- package/es/core/components/SxpPageRender/VideoWidget/index.js +39 -31
- package/es/core/components/SxpPageRender/index.js +20 -35
- package/es/materials/sxp/popup/AppointForm/index.js +1 -3
- package/es/materials/sxp/template/Appoint/index.js +7 -6
- package/es/materials/sxp/template/Commodity/index.js +7 -14
- package/es/materials/sxp/template/CommodityDiro/index.js +7 -14
- package/es/materials/sxp/template/CommodityDiroNew/index.js +7 -14
- package/es/materials/sxp/template/Link/index.js +5 -5
- package/es/materials/sxp/template/MultiCommodity/index.js +3 -6
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +3 -6
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +3 -6
- package/es/materials/sxp/template/components/EventProvider.js +1 -13
- package/es/materials/sxp/template/components/Img.d.ts +5 -3
- package/es/materials/sxp/template/components/Img.js +4 -3
- package/lib/core/components/SxpPageRender/FormatImage.js +2 -7
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +39 -31
- package/lib/core/components/SxpPageRender/index.js +20 -35
- package/lib/materials/sxp/popup/AppointForm/index.js +1 -3
- package/lib/materials/sxp/template/Appoint/index.js +7 -6
- package/lib/materials/sxp/template/Commodity/index.js +7 -14
- package/lib/materials/sxp/template/CommodityDiro/index.js +7 -14
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +7 -14
- package/lib/materials/sxp/template/Link/index.js +5 -5
- package/lib/materials/sxp/template/MultiCommodity/index.js +3 -6
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +3 -6
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +3 -6
- package/lib/materials/sxp/template/components/EventProvider.js +0 -12
- package/lib/materials/sxp/template/components/Img.d.ts +5 -3
- package/lib/materials/sxp/template/components/Img.js +4 -3
- package/package.json +2 -4
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('eventemitter3'), require('@emotion/css'), require('
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', 'eventemitter3', '@emotion/css', '
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PUI = {}, global.lodash, global.uuid$1, global.pako, global.React, global.qs, global.EventEmitter, global.css, global.
|
5
|
-
})(this, (function (exports, lodash, uuid$1, pako, React, qs, EventEmitter, css,
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('uuid'), require('pako'), require('react'), require('qs'), require('eventemitter3'), require('@emotion/css'), require('react-dom'), require('hls.js')) :
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', 'eventemitter3', '@emotion/css', 'react-dom', 'hls.js'], factory) :
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PUI = {}, global.lodash, global.uuid$1, global.pako, global.React, global.qs, global.EventEmitter, global.css, global.ReactDOM, global.Hls));
|
5
|
+
})(this, (function (exports, lodash, uuid$1, pako, React, qs, EventEmitter, css, ReactDOM, Hls) { 'use strict';
|
6
6
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
8
8
|
var n = Object.create(null);
|
@@ -1350,7 +1350,7 @@
|
|
1350
1350
|
key: '4'
|
1351
1351
|
}
|
1352
1352
|
], []);
|
1353
|
-
|
1353
|
+
React.useMemo(() => {
|
1354
1354
|
if (layoutType === undefined) {
|
1355
1355
|
const list = lodash.cloneDeep(columns) || defaultColumns;
|
1356
1356
|
return list === null || list === void 0 ? void 0 : list.map((obj) => (Object.assign(Object.assign({}, obj), { title: undefined, fieldProps: { placeholder: obj === null || obj === void 0 ? void 0 : obj.title } })));
|
@@ -1393,8 +1393,7 @@
|
|
1393
1393
|
return (React.createElement("div", { className: 'pb-appoint-form' },
|
1394
1394
|
React.createElement("div", { className: `pb-appoint-form-title ${css.css(Object.assign({}, textStyle))}` }, title),
|
1395
1395
|
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
1396
|
-
React.createElement("div", { className: 'pb-appoint-form-container' },
|
1397
|
-
React.createElement(proComponents.BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
|
1396
|
+
React.createElement("div", { className: 'pb-appoint-form-container' })),
|
1398
1397
|
React.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
|
1399
1398
|
React.createElement("button", { "aria-label": submitText, onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? React.createElement(React.Fragment, null, "loading...") : submitText))));
|
1400
1399
|
};
|
@@ -8588,26 +8587,21 @@
|
|
8588
8587
|
* @Author: binruan@chatlabs.com
|
8589
8588
|
* @Date: 2024-03-20 10:27:31
|
8590
8589
|
* @LastEditors: binruan@chatlabs.com
|
8591
|
-
* @LastEditTime: 2024-06-
|
8590
|
+
* @LastEditTime: 2024-06-20 18:56:52
|
8592
8591
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
|
8593
8592
|
*
|
8594
8593
|
*/
|
8595
8594
|
const FormatImage = React.forwardRef((props, ref) => {
|
8596
8595
|
const { src, onLoad, style, className, loading } = props;
|
8597
8596
|
const [imgSrc, setImgSrc] = React.useState();
|
8598
|
-
const { swiperRef } = useSxpDataSource();
|
8599
8597
|
React.useImperativeHandle(ref, () => ({
|
8600
8598
|
setSrc: (v) => {
|
8601
8599
|
setImgSrc(v);
|
8602
8600
|
}
|
8603
8601
|
}));
|
8604
8602
|
React.useEffect(() => {
|
8605
|
-
|
8606
|
-
|
8607
|
-
const index = (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.activeIndex;
|
8608
|
-
if (index === 0 || index > 0)
|
8609
|
-
setImgSrc(src);
|
8610
|
-
}, [src, swiperRef]);
|
8603
|
+
setImgSrc(src);
|
8604
|
+
}, [src]);
|
8611
8605
|
React.useRef(null);
|
8612
8606
|
// useEffect(() => {
|
8613
8607
|
// let observer: any = null;
|
@@ -9619,6 +9613,38 @@ Made in Italy` })));
|
|
9619
9613
|
}
|
9620
9614
|
];
|
9621
9615
|
|
9616
|
+
const EventProvider = (_a) => {
|
9617
|
+
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
9618
|
+
const ref = React.useRef(null);
|
9619
|
+
const { popup } = useEditor();
|
9620
|
+
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
9621
|
+
const { jumpToWeb } = useEventReport();
|
9622
|
+
const handleClick = lodash.throttle(() => {
|
9623
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
9624
|
+
const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
|
9625
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9626
|
+
eventSubject: 'clickCta',
|
9627
|
+
eventDescription: 'User clicked the CTA'
|
9628
|
+
}, rec, item, index);
|
9629
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
9630
|
+
if (isExternalLink) {
|
9631
|
+
if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) {
|
9632
|
+
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
9633
|
+
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
9634
|
+
jumpToWeb(rec, product, cta, index);
|
9635
|
+
window.location.href = window.getJointUtmLink((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link);
|
9636
|
+
}
|
9637
|
+
}
|
9638
|
+
else {
|
9639
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9640
|
+
}
|
9641
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9642
|
+
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
9643
|
+
};
|
9644
|
+
var EventProvider$1 = React.memo(EventProvider);
|
9645
|
+
|
9646
|
+
var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
9647
|
+
|
9622
9648
|
/*
|
9623
9649
|
* @Author: binruan@chatlabs.com
|
9624
9650
|
* @Date: 2023-04-12 09:58:58
|
@@ -9646,64 +9672,40 @@ Made in Italy` })));
|
|
9646
9672
|
return isOnScreen;
|
9647
9673
|
}
|
9648
9674
|
|
9649
|
-
|
9650
|
-
|
9675
|
+
/*
|
9676
|
+
* @Author: binruan@chatlabs.com
|
9677
|
+
* @Date: 2024-01-16 14:50:13
|
9678
|
+
* @LastEditors: binruan@chatlabs.com
|
9679
|
+
* @LastEditTime: 2024-06-21 11:59:25
|
9680
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
9681
|
+
*
|
9682
|
+
*/
|
9683
|
+
const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
9651
9684
|
const ref = React.useRef(null);
|
9652
9685
|
const isOnScreen = useOnScreen(ref);
|
9653
|
-
const {
|
9654
|
-
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
9655
|
-
const { jumpToWeb } = useEventReport();
|
9686
|
+
const { ctaEvent } = useSxpDataSource();
|
9656
9687
|
React.useEffect(() => {
|
9657
|
-
|
9658
|
-
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
9659
|
-
const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
|
9688
|
+
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
9660
9689
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9661
9690
|
eventSubject: 'ctaExposure',
|
9662
9691
|
eventDescription: 'The cta was shown to the user'
|
9663
9692
|
}, rec, item, index);
|
9664
9693
|
}
|
9665
|
-
}, [isOnScreen, ref, rec, ctaEvent, index]);
|
9666
|
-
|
9667
|
-
|
9668
|
-
|
9669
|
-
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9670
|
-
eventSubject: 'clickCta',
|
9671
|
-
eventDescription: 'User clicked the CTA'
|
9672
|
-
}, rec, item, index);
|
9673
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
9674
|
-
if (isExternalLink) {
|
9675
|
-
if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) {
|
9676
|
-
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
9677
|
-
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
9678
|
-
jumpToWeb(rec, product, cta, index);
|
9679
|
-
window.location.href = window.getJointUtmLink((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link);
|
9680
|
-
}
|
9681
|
-
}
|
9682
|
-
else {
|
9683
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9684
|
-
}
|
9685
|
-
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9686
|
-
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
9694
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
9695
|
+
return (React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, imgStyle)) },
|
9696
|
+
React.createElement("div", { ref: ref, hidden: !src, className: css.css({ width: '100%', height: '100%' }) },
|
9697
|
+
React.createElement(FormatImage$1, { className: css.css(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block', objectPosition: `50% ${translateY ? -translateY + 50 : 50}%` }, style)), src: `${src}?imrquality/rquality/40` }))));
|
9687
9698
|
};
|
9688
|
-
var
|
9689
|
-
|
9690
|
-
var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
9699
|
+
var Img$1 = React.memo(Img);
|
9691
9700
|
|
9692
9701
|
const Commodity$1 = (_a) => {
|
9693
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
9694
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
9702
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
9703
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index"]);
|
9695
9704
|
const { sxpParameter } = useSxpDataSource();
|
9696
9705
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9697
9706
|
const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
|
9698
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9699
|
-
React.createElement(
|
9700
|
-
React.createElement(FormatImage$1, { className: css.css({
|
9701
|
-
width: '100%',
|
9702
|
-
objectFit: 'cover',
|
9703
|
-
height: '100%',
|
9704
|
-
display: 'block',
|
9705
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
9706
|
-
}), src: src })),
|
9707
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
9708
|
+
React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
9707
9709
|
React.createElement("div", { className: css.css({
|
9708
9710
|
color: '#fff',
|
9709
9711
|
display: 'flex',
|
@@ -9712,8 +9714,8 @@ Made in Italy` })));
|
|
9712
9714
|
width: '100%',
|
9713
9715
|
overflow: 'hidden'
|
9714
9716
|
}) },
|
9715
|
-
React.createElement("div", { className: styles$6['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9716
|
-
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9717
|
+
React.createElement("div", { className: styles$6['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name'),
|
9718
|
+
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now'))));
|
9717
9719
|
};
|
9718
9720
|
var CommodityComponent = React.memo(Commodity$1);
|
9719
9721
|
|
@@ -9786,14 +9788,14 @@ Made in Italy` })));
|
|
9786
9788
|
];
|
9787
9789
|
|
9788
9790
|
const Appoint$1 = (_a) => {
|
9789
|
-
var _b, _c, _d, _e;
|
9790
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9791
|
+
var _b, _c, _d, _e, _f, _g;
|
9792
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
9791
9793
|
const { sxpParameter } = useSxpDataSource();
|
9792
9794
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
9793
|
-
|
9794
|
-
|
9795
|
-
|
9796
|
-
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9795
|
+
const src = (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image;
|
9796
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' }, index: index }, props),
|
9797
|
+
React.createElement(Img$1, { src: src, rec: recData, item: (_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) !== null && _f !== void 0 ? _f : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
9798
|
+
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _g !== void 0 ? _g : 'Product Name')));
|
9797
9799
|
};
|
9798
9800
|
var AppointComponent = React.memo(Appoint$1);
|
9799
9801
|
|
@@ -9850,7 +9852,7 @@ Made in Italy` })));
|
|
9850
9852
|
var styles$5 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__nkBlU"};
|
9851
9853
|
|
9852
9854
|
const Link$1 = (_a) => {
|
9853
|
-
var _b, _c, _d, _e, _f;
|
9855
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
9854
9856
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index"]);
|
9855
9857
|
const { sxpParameter, bffEventReport } = useSxpDataSource();
|
9856
9858
|
const { jumpToWeb } = useEventReport();
|
@@ -9862,16 +9864,16 @@ Made in Italy` })));
|
|
9862
9864
|
window.location.href = window.getJointUtmLink(cta.link);
|
9863
9865
|
}
|
9864
9866
|
};
|
9867
|
+
const src = (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
9865
9868
|
return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
|
9866
|
-
React.createElement(
|
9867
|
-
React.createElement(FormatImage$1, { className: css.css({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image })),
|
9869
|
+
React.createElement(Img$1, { src: src, rec: recData, item: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.bindProduct) !== null && _g !== void 0 ? _g : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
9868
9870
|
React.createElement("div", { className: css.css({
|
9869
9871
|
display: 'flex',
|
9870
9872
|
alignItems: 'center',
|
9871
9873
|
width: '100%',
|
9872
9874
|
overflow: 'hidden'
|
9873
9875
|
}) },
|
9874
|
-
React.createElement("div", { className: styles$5['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle }, (
|
9876
|
+
React.createElement("div", { className: styles$5['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle }, (_h = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _h !== void 0 ? _h : 'Product Name'))));
|
9875
9877
|
};
|
9876
9878
|
var LinkComponent = React.memo(Link$1);
|
9877
9879
|
|
@@ -9939,20 +9941,13 @@ Made in Italy` })));
|
|
9939
9941
|
var styles$4 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__yyHVb"};
|
9940
9942
|
|
9941
9943
|
const CommodityDiro$1 = (_a) => {
|
9942
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
9943
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
9944
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
9945
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index"]);
|
9944
9946
|
const { sxpParameter } = useSxpDataSource();
|
9945
9947
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9946
9948
|
const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
|
9947
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9948
|
-
React.createElement(
|
9949
|
-
React.createElement(FormatImage$1, { className: css.css({
|
9950
|
-
width: '100%',
|
9951
|
-
objectFit: 'cover',
|
9952
|
-
height: '100%',
|
9953
|
-
display: 'block',
|
9954
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
9955
|
-
}), src: src })),
|
9949
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
9950
|
+
React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
9956
9951
|
React.createElement("div", { className: css.css({
|
9957
9952
|
color: '#fff',
|
9958
9953
|
display: 'flex',
|
@@ -9961,8 +9956,8 @@ Made in Italy` })));
|
|
9961
9956
|
width: '100%',
|
9962
9957
|
overflow: 'hidden'
|
9963
9958
|
}) },
|
9964
|
-
React.createElement("div", { className: styles$4['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9965
|
-
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9959
|
+
React.createElement("div", { className: styles$4['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name'),
|
9960
|
+
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now'))));
|
9966
9961
|
};
|
9967
9962
|
var CommodityDiroComponent = React.memo(CommodityDiro$1);
|
9968
9963
|
|
@@ -10037,20 +10032,13 @@ Made in Italy` })));
|
|
10037
10032
|
var styles$3 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__I-yCC"};
|
10038
10033
|
|
10039
10034
|
const CommodityDiroNew$1 = (_a) => {
|
10040
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
10041
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
10035
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
10036
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index"]);
|
10042
10037
|
const { sxpParameter } = useSxpDataSource();
|
10043
10038
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
10044
10039
|
const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
|
10045
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
10046
|
-
React.createElement(
|
10047
|
-
React.createElement(FormatImage$1, { className: css.css({
|
10048
|
-
width: '100%',
|
10049
|
-
objectFit: 'cover',
|
10050
|
-
height: '100%',
|
10051
|
-
display: 'block',
|
10052
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
10053
|
-
}), src: src })),
|
10040
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
10041
|
+
React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
10054
10042
|
React.createElement("div", { className: css.css({
|
10055
10043
|
color: '#fff',
|
10056
10044
|
display: 'flex',
|
@@ -10059,8 +10047,8 @@ Made in Italy` })));
|
|
10059
10047
|
width: '100%',
|
10060
10048
|
overflow: 'hidden'
|
10061
10049
|
}) },
|
10062
|
-
React.createElement("div", { className: styles$3['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
10063
|
-
React.createElement("div", { className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
10050
|
+
React.createElement("div", { className: styles$3['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name'),
|
10051
|
+
React.createElement("div", { className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop now'))));
|
10064
10052
|
};
|
10065
10053
|
var CommodityDiroNewComponent = React.memo(CommodityDiroNew$1);
|
10066
10054
|
|
@@ -10138,31 +10126,6 @@ Made in Italy` })));
|
|
10138
10126
|
};
|
10139
10127
|
var Scroll$1 = React.memo(Scroll);
|
10140
10128
|
|
10141
|
-
/*
|
10142
|
-
* @Author: binruan@chatlabs.com
|
10143
|
-
* @Date: 2024-01-16 14:50:13
|
10144
|
-
* @LastEditors: binruan@chatlabs.com
|
10145
|
-
* @LastEditTime: 2024-05-21 16:34:13
|
10146
|
-
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
10147
|
-
*
|
10148
|
-
*/
|
10149
|
-
const Img = ({ src, rec, item, index, style }) => {
|
10150
|
-
const ref = React.useRef(null);
|
10151
|
-
const isOnScreen = useOnScreen(ref);
|
10152
|
-
const { ctaEvent } = useSxpDataSource();
|
10153
|
-
React.useEffect(() => {
|
10154
|
-
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
10155
|
-
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10156
|
-
eventSubject: 'ctaExposure',
|
10157
|
-
eventDescription: 'The cta was shown to the user'
|
10158
|
-
}, rec, item, index);
|
10159
|
-
}
|
10160
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
10161
|
-
return (React.createElement("div", { ref: ref, hidden: !src, className: css.css({ width: '100%', height: '100%' }) },
|
10162
|
-
React.createElement(FormatImage$1, { className: css.css(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }, style)), src: src })));
|
10163
|
-
};
|
10164
|
-
var Img$1 = React.memo(Img);
|
10165
|
-
|
10166
10129
|
var styles$2 = {"two-line-ellipsis":"index-module_two-line-ellipsis__SFQwJ"};
|
10167
10130
|
|
10168
10131
|
const MultiCommodityDiro$1 = (_a) => {
|
@@ -10190,11 +10153,8 @@ Made in Italy` })));
|
|
10190
10153
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10191
10154
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10192
10155
|
var _a, _b, _c, _d, _e, _f, _g;
|
10193
|
-
return (React.createElement(
|
10194
|
-
React.createElement(
|
10195
|
-
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, style: {
|
10196
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
10197
|
-
} })),
|
10156
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: item === null || item === void 0 ? void 0 : item.itemId, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10157
|
+
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
10198
10158
|
React.createElement("div", { className: css.css({
|
10199
10159
|
color: '#000',
|
10200
10160
|
display: 'flex',
|
@@ -10204,7 +10164,7 @@ Made in Italy` })));
|
|
10204
10164
|
overflow: 'hidden'
|
10205
10165
|
}) },
|
10206
10166
|
React.createElement("div", { className: styles$2['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
|
10207
|
-
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))));
|
10167
|
+
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))))));
|
10208
10168
|
})));
|
10209
10169
|
};
|
10210
10170
|
var MultiCommodityDiroComponent = React.memo(MultiCommodityDiro$1);
|
@@ -10305,11 +10265,8 @@ Made in Italy` })));
|
|
10305
10265
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10306
10266
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10307
10267
|
var _a, _b, _c, _d, _e, _f, _g;
|
10308
|
-
return (React.createElement(
|
10309
|
-
React.createElement(
|
10310
|
-
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, style: {
|
10311
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
10312
|
-
} })),
|
10268
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: item.itemId, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10269
|
+
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
10313
10270
|
React.createElement("div", { className: css.css({
|
10314
10271
|
color: '#fff',
|
10315
10272
|
display: 'flex',
|
@@ -10319,7 +10276,7 @@ Made in Italy` })));
|
|
10319
10276
|
overflow: 'hidden'
|
10320
10277
|
}) },
|
10321
10278
|
React.createElement("div", { className: styles$1['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
|
10322
|
-
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))));
|
10279
|
+
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))))));
|
10323
10280
|
})));
|
10324
10281
|
};
|
10325
10282
|
var MultiCommodityComponent = React.memo(MultiCommodity$1);
|
@@ -10419,11 +10376,8 @@ Made in Italy` })));
|
|
10419
10376
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10420
10377
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10421
10378
|
var _a, _b, _c, _d, _e, _f, _g;
|
10422
|
-
return (React.createElement(
|
10423
|
-
React.createElement(
|
10424
|
-
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, style: {
|
10425
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
10426
|
-
} })),
|
10379
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: item === null || item === void 0 ? void 0 : item.itemId, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10380
|
+
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
10427
10381
|
React.createElement("div", { className: css.css({
|
10428
10382
|
color: '#fff',
|
10429
10383
|
display: 'flex',
|
@@ -10434,7 +10388,7 @@ Made in Italy` })));
|
|
10434
10388
|
lineHeight: '20px'
|
10435
10389
|
}) },
|
10436
10390
|
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
|
10437
|
-
React.createElement("div", { className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop now'))));
|
10391
|
+
React.createElement("div", { className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop now'))))));
|
10438
10392
|
})));
|
10439
10393
|
};
|
10440
10394
|
var MultiCommodityDiroNewComponent = React.memo(MultiCommodityDiroNew$1);
|
@@ -12941,7 +12895,7 @@ Made in Italy` })));
|
|
12941
12895
|
React.useEffect(() => {
|
12942
12896
|
if (!videoRef)
|
12943
12897
|
return;
|
12944
|
-
videoRef
|
12898
|
+
videoRef.muted = muted;
|
12945
12899
|
}, [muted, videoRef]);
|
12946
12900
|
const handleEnded = React.useCallback(() => {
|
12947
12901
|
if (!videoRef)
|
@@ -12956,10 +12910,10 @@ Made in Italy` })));
|
|
12956
12910
|
setIsLoadFinish(true);
|
12957
12911
|
setIsPauseVideo(false);
|
12958
12912
|
const item = data[index];
|
12959
|
-
if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
12960
|
-
videoStartTime.current = (videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
12961
|
-
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
12962
|
-
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
12913
|
+
if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration)) {
|
12914
|
+
videoStartTime.current = (videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) || 0;
|
12915
|
+
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) !== null && _a !== void 0 ? _a : 0).toFixed(2);
|
12916
|
+
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
12963
12917
|
const playType = isFirstPlay ? '0' : '1';
|
12964
12918
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12965
12919
|
eventInfo: {
|
@@ -12983,21 +12937,17 @@ Made in Italy` })));
|
|
12983
12937
|
var _a;
|
12984
12938
|
if (!videoRef || firstFrameSrc || !blur)
|
12985
12939
|
return;
|
12986
|
-
|
12987
|
-
if (!videoDomRef)
|
12988
|
-
return;
|
12989
|
-
videoDomRef.style.objectFit = 'contain';
|
12940
|
+
videoRef.style.objectFit = 'contain';
|
12990
12941
|
if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !canvasRef.current || isBgColor)
|
12991
12942
|
return;
|
12992
12943
|
const setFrameImg = () => {
|
12993
|
-
const video = videoDomRef;
|
12994
12944
|
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
12995
12945
|
const ctx = canvas.getContext('2d');
|
12996
12946
|
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
12997
12947
|
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
12998
12948
|
canvas.height = targetHeight;
|
12999
12949
|
canvas.width = targetWidth;
|
13000
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(
|
12950
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(videoRef, 0, 0, canvas.width, canvas.height);
|
13001
12951
|
setFirstFrameSrc(canvas.toDataURL());
|
13002
12952
|
};
|
13003
12953
|
setFrameImg();
|
@@ -13009,21 +12959,13 @@ Made in Italy` })));
|
|
13009
12959
|
if (!videoRef)
|
13010
12960
|
return;
|
13011
12961
|
handLoadeddata();
|
13012
|
-
// if (activeIndex !== index) {
|
13013
|
-
// videoRef?.play();
|
13014
|
-
// videoRef?.pause();
|
13015
|
-
// }
|
13016
|
-
// setIsLoadFinish(true);
|
13017
12962
|
}, [videoRef, handLoadeddata]);
|
13018
|
-
React.useCallback(() => {
|
13019
|
-
setIsLoadFinish(true);
|
13020
|
-
}, []);
|
13021
12963
|
const handleClickVideo = React.useCallback((type) => () => {
|
13022
12964
|
if (!videoRef)
|
13023
12965
|
return;
|
13024
12966
|
if (!isLoadFinish)
|
13025
12967
|
return;
|
13026
|
-
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused
|
12968
|
+
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused;
|
13027
12969
|
switch (type) {
|
13028
12970
|
case 'start':
|
13029
12971
|
if (!isPause)
|
@@ -13055,10 +12997,10 @@ Made in Italy` })));
|
|
13055
12997
|
if (activeIndex !== index)
|
13056
12998
|
return;
|
13057
12999
|
const item = data[index];
|
13058
|
-
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
13059
|
-
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
13060
|
-
if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
13061
|
-
const playDuration = ((videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
13000
|
+
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) !== null && _a !== void 0 ? _a : 0).toFixed(2);
|
13001
|
+
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
13002
|
+
if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) {
|
13003
|
+
const playDuration = ((videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) - videoStartTime.current).toFixed(2);
|
13062
13004
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13063
13005
|
eventInfo: {
|
13064
13006
|
eventSubject: 'playOverVideo',
|
@@ -13082,7 +13024,19 @@ Made in Italy` })));
|
|
13082
13024
|
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
|
13083
13025
|
if (!videoSrc)
|
13084
13026
|
return;
|
13085
|
-
|
13027
|
+
if (videoSrc.includes('.m3u8')) {
|
13028
|
+
if (Hls.isSupported()) {
|
13029
|
+
const hls = new Hls();
|
13030
|
+
hls.loadSource(videoSrc);
|
13031
|
+
hls.attachMedia(videoRef.current);
|
13032
|
+
}
|
13033
|
+
else {
|
13034
|
+
videoRef.src = videoSrc;
|
13035
|
+
}
|
13036
|
+
}
|
13037
|
+
else {
|
13038
|
+
videoRef.src = videoSrc;
|
13039
|
+
}
|
13086
13040
|
setIsPauseVideo(false);
|
13087
13041
|
const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
|
13088
13042
|
const dom = document.querySelector('#player-container-id');
|
@@ -13090,20 +13044,20 @@ Made in Italy` })));
|
|
13090
13044
|
if (!dom && !dom2)
|
13091
13045
|
return;
|
13092
13046
|
videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
|
13093
|
-
videoRef
|
13094
|
-
videoRef
|
13095
|
-
|
13096
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13097
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13098
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13047
|
+
videoRef.setAttribute('x5-playsinline', 'true');
|
13048
|
+
videoRef.setAttribute('webkit-playsinline', 'true');
|
13049
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadedmetadata', handleLoadedmetadata);
|
13050
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadeddata', handLoadeddata);
|
13051
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('playing', handlePlaying);
|
13052
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('pause', handlePause);
|
13053
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('ended', handleEnded);
|
13099
13054
|
return () => {
|
13100
13055
|
dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
|
13101
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13102
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13103
|
-
|
13104
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13105
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13106
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('ended', handleEnded);
|
13056
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadedmetadata', handleLoadedmetadata);
|
13057
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadeddata', handLoadeddata);
|
13058
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('playing', handlePlaying);
|
13059
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('pause', handlePause);
|
13060
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('ended', handleEnded);
|
13107
13061
|
};
|
13108
13062
|
}, [isActive, videoId, rec, videoRef]);
|
13109
13063
|
React.useEffect(() => {
|
@@ -13125,7 +13079,7 @@ Made in Italy` })));
|
|
13125
13079
|
React.useEffect(() => {
|
13126
13080
|
if (!isActive || !videoRef)
|
13127
13081
|
return;
|
13128
|
-
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused
|
13082
|
+
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused;
|
13129
13083
|
if (!isPause && openHashtag) {
|
13130
13084
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
|
13131
13085
|
}
|
@@ -13568,7 +13522,7 @@ Made in Italy` })));
|
|
13568
13522
|
* @Author: binruan@chatlabs.com
|
13569
13523
|
* @Date: 2024-01-15 19:03:09
|
13570
13524
|
* @LastEditors: binruan@chatlabs.com
|
13571
|
-
* @LastEditTime: 2024-06-
|
13525
|
+
* @LastEditTime: 2024-06-21 08:56:05
|
13572
13526
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
13573
13527
|
*
|
13574
13528
|
*/
|
@@ -13584,8 +13538,7 @@ Made in Italy` })));
|
|
13584
13538
|
const [isShowMore, setIsShowMore] = React.useState(false);
|
13585
13539
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag } = useSxpDataSource();
|
13586
13540
|
const { backMainFeed } = useEventReport();
|
13587
|
-
const
|
13588
|
-
const playerRef = React.useRef();
|
13541
|
+
const videoRef = React.useRef();
|
13589
13542
|
const { productView } = useEventReport();
|
13590
13543
|
const isShowFingerTip = React.useMemo(() => {
|
13591
13544
|
return data.length > 0 && !loading && getFeUserId();
|
@@ -13616,30 +13569,13 @@ Made in Italy` })));
|
|
13616
13569
|
const firstRef = React.useRef();
|
13617
13570
|
React.useEffect(() => {
|
13618
13571
|
var _a, _b, _c, _d;
|
13619
|
-
if (!firstRef.current &&
|
13572
|
+
if (!firstRef.current && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
|
13620
13573
|
firstRef.current = true;
|
13621
|
-
|
13622
|
-
|
13623
|
-
|
13624
|
-
loop: false,
|
13625
|
-
autoplay: true,
|
13626
|
-
muted: true,
|
13627
|
-
preload: 'auto',
|
13628
|
-
posterImage: false,
|
13629
|
-
bigPlayButton: true,
|
13630
|
-
sources: ((_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url)
|
13631
|
-
? [
|
13632
|
-
{
|
13633
|
-
src: (_d = (_c = data === null || data === void 0 ? void 0 : data[0]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.url
|
13634
|
-
}
|
13635
|
-
]
|
13636
|
-
: []
|
13637
|
-
});
|
13638
|
-
player === null || player === void 0 ? void 0 : player.ready(() => {
|
13639
|
-
setVideoRef(player);
|
13640
|
-
});
|
13574
|
+
if ((_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url) {
|
13575
|
+
videoRef.current.src = (_d = (_c = data === null || data === void 0 ? void 0 : data[0]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.url;
|
13576
|
+
}
|
13641
13577
|
}
|
13642
|
-
}, [videoRef,
|
13578
|
+
}, [videoRef, data]);
|
13643
13579
|
React.useEffect(() => {
|
13644
13580
|
var _a;
|
13645
13581
|
const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
|
@@ -13757,7 +13693,7 @@ Made in Italy` })));
|
|
13757
13693
|
const renderContent = React.useCallback((rec, index) => {
|
13758
13694
|
var _a, _b, _c, _d;
|
13759
13695
|
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13760
|
-
return (React.createElement(VideoWidget$3, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef }));
|
13696
|
+
return (React.createElement(VideoWidget$3, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef.current }));
|
13761
13697
|
}
|
13762
13698
|
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13763
13699
|
return (React.createElement(PictureGroup$3, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
@@ -13783,7 +13719,7 @@ Made in Italy` })));
|
|
13783
13719
|
tipText,
|
13784
13720
|
resolver,
|
13785
13721
|
schema,
|
13786
|
-
videoRef
|
13722
|
+
videoRef.current
|
13787
13723
|
]);
|
13788
13724
|
const onExpandableChange = React.useCallback((v) => {
|
13789
13725
|
setIsShowMore(v);
|
@@ -13941,14 +13877,17 @@ Made in Italy` })));
|
|
13941
13877
|
}
|
13942
13878
|
};
|
13943
13879
|
const visList = React.useMemo(() => {
|
13944
|
-
|
13945
|
-
|
13946
|
-
|
13947
|
-
|
13948
|
-
|
13949
|
-
|
13950
|
-
|
13951
|
-
|
13880
|
+
var _a;
|
13881
|
+
const list = activeIndex === 0
|
13882
|
+
? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
|
13883
|
+
: data === null || data === void 0 ? void 0 : data.map((item, index) => {
|
13884
|
+
if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
|
13885
|
+
return item;
|
13886
|
+
}
|
13887
|
+
else {
|
13888
|
+
return null;
|
13889
|
+
}
|
13890
|
+
});
|
13952
13891
|
return !waterFallData ? list.concat([{ loading: true }]) : list;
|
13953
13892
|
}, [data, activeIndex, waterFallData]);
|
13954
13893
|
const renderView = React.useMemo(() => {
|
@@ -14013,7 +13952,7 @@ Made in Italy` })));
|
|
14013
13952
|
renderView),
|
14014
13953
|
React.createElement(WaterFall$1, Object.assign({}, (_k = (_j = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.item) === null || _k === void 0 ? void 0 : _k.props)),
|
14015
13954
|
React.createElement("div", { style: { position: 'absolute', zIndex: -100 } },
|
14016
|
-
React.createElement("video", { ref:
|
13955
|
+
React.createElement("video", { ref: videoRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', preload: 'auto', controls: false, muted: true, style: {
|
14017
13956
|
backgroundColor: 'transparent',
|
14018
13957
|
width: '100%',
|
14019
13958
|
height: '100%',
|
@@ -14550,3 +14489,4 @@ Made in Italy` })));
|
|
14550
14489
|
Object.defineProperty(exports, '__esModule', { value: true });
|
14551
14490
|
|
14552
14491
|
}));
|
14492
|
+
//# sourceMappingURL=pb-ui.js.map
|