pb-sxp-ui 1.5.5 → 1.6.1
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 +121 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +17 -1
- package/dist/index.js +121 -71
- 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 +121 -71
- 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/DiyPortalPreview/PictureGroup.js +5 -1
- package/es/core/components/SxpPageRender/Hashtag/index.js +1 -1
- package/es/core/components/SxpPageRender/Modal/index.js +6 -6
- package/es/core/components/SxpPageRender/Navbar.js +2 -1
- package/es/core/components/SxpPageRender/PictureGroup/index.js +2 -1
- package/es/core/components/SxpPageRender/RenderCard.d.ts +3 -3
- package/es/core/components/SxpPageRender/RenderCard.js +27 -17
- package/es/core/components/SxpPageRender/Tagbar.js +2 -2
- package/es/core/components/SxpPageRender/WaterFall/index.js +5 -1
- package/es/core/components/SxpPageRender/index.d.ts +8 -0
- package/es/core/components/SxpPageRender/index.js +47 -19
- package/es/core/context/SxpDataSourceProvider.js +4 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +2 -1
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +5 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +2 -1
- package/es/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -2
- package/es/materials/sxp/template/components/Img.d.ts +1 -0
- package/es/materials/sxp/template/components/Img.js +6 -4
- package/lib/core/components/DiyPortalPreview/PictureGroup.js +5 -1
- package/lib/core/components/SxpPageRender/Hashtag/index.js +1 -1
- package/lib/core/components/SxpPageRender/Modal/index.js +6 -6
- package/lib/core/components/SxpPageRender/Navbar.js +2 -1
- package/lib/core/components/SxpPageRender/PictureGroup/index.js +2 -1
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +3 -3
- package/lib/core/components/SxpPageRender/RenderCard.js +26 -16
- package/lib/core/components/SxpPageRender/Tagbar.js +2 -2
- package/lib/core/components/SxpPageRender/WaterFall/index.js +5 -1
- package/lib/core/components/SxpPageRender/index.d.ts +8 -0
- package/lib/core/components/SxpPageRender/index.js +47 -19
- package/lib/core/context/SxpDataSourceProvider.js +4 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +2 -1
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +5 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +2 -1
- package/lib/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -2
- package/lib/materials/sxp/template/components/Img.d.ts +1 -0
- package/lib/materials/sxp/template/components/Img.js +5 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -874,18 +874,21 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
874
874
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
875
875
|
const isProd = ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) || (((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
|
876
876
|
let fromKName = '';
|
877
|
+
let contentFormat = null;
|
877
878
|
if (isFromHashtag) {
|
878
879
|
fromKName = 'hashTagPage';
|
879
880
|
}
|
880
881
|
else if ((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.url) {
|
881
882
|
fromKName = 'videoPage';
|
883
|
+
contentFormat = 'video';
|
882
884
|
}
|
883
885
|
else if ((_g = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.imgUrls) === null || _g === void 0 ? void 0 : _g.length) {
|
884
886
|
fromKName = 'imagePage';
|
887
|
+
contentFormat = 'image';
|
885
888
|
}
|
886
889
|
const contentTags = (_p = (_m = (_h = product === null || product === void 0 ? void 0 : product.tags) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : (_q = rec === null || rec === void 0 ? void 0 : rec.product) === null || _q === void 0 ? void 0 : _q.tags;
|
887
890
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
888
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '' })
|
891
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '', contentFormat })
|
889
892
|
});
|
890
893
|
}, [bffEventReport, isFromHashtag]);
|
891
894
|
const h5EnterLink = React.useCallback(() => {
|
@@ -8931,13 +8934,13 @@ SwiperSlide.displayName = 'SwiperSlide';
|
|
8931
8934
|
* @Author: binruan@chatlabs.com
|
8932
8935
|
* @Date: 2023-11-02 18:34:34
|
8933
8936
|
* @LastEditors: binruan@chatlabs.com
|
8934
|
-
* @LastEditTime: 2024-
|
8937
|
+
* @LastEditTime: 2024-10-11 18:18:41
|
8935
8938
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8936
8939
|
*
|
8937
8940
|
*/
|
8938
8941
|
const closeIcon$1 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAjhJREFUWEfFlztOw0AQhmeWiJ4CCmpQ5DiRQsIJyAWg5A0lR0AIChDiCJS8ER0cADgBeRSxt4CCDgkaKiq8i+zYeWx2413HEWmiJJv9v535Z2aN8M8vFPT9z3zETD0aAUChUJjwvPFHAJhBhB3Hqd6OAsK2yyucwykAvP38eJX398Z3AJDLlVYR8ToU9Rhj25TWr9KEsKy5dULIGQCMtfZly45TvwsAstm56UwG6wA4FUFwzrdctxZBDcWSy5XWEPG8I84/GcMipdWPtgcsaz5PCHtKG0IuTiqUvjT9U/WYMG2IOPE+AP+LtCB0xKUAAyA2Xbd2o2OG0NQXvTnvhL17D7EPtH9TRCIWwkRcGYGIQgYBABuqPuHXOQBc6pw80lBGwBQiiXhsBHQhkoprA6iM6acjhDQKu5YJZW6XeOI3XJdpvfsdTu52VfXEekD8owQiXGIubpSCbhDbLu8DwKEAd+A41SOdPpE4BS0viFOtvV2iKWqUgn5x/tmS70xR01GuDSCKc86/OCcLgTyyZ0ScDGNhFAktAJV4NFJ9YyaFiAWIE+9uVkkgBgLoig8DMWAa9ro9ynkUdlW5maZDCmB6clmz0k1HH4Cs1Ezbq2p2yEpUuBOKTSZZex00RUWIrltxuuK6EOGDSbGIOPZicpMx6fny650377qNRgBgWeVFQuA+6UjVgREhGIMlSqsPUQqIbZdOOIdZQmCv2axRnU1N1+TzJYsxOEaEV8ep7frPZ7Gd0FTEdP0ft0/kMNdg0eoAAAAASUVORK5CYII=';
|
8939
8942
|
const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema, fullHeight = window.innerHeight, isFullScreen = false }) => {
|
8940
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
8943
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
8941
8944
|
const touchRef = React.useRef(null);
|
8942
8945
|
const fTouchRef = React.useRef(null);
|
8943
8946
|
const touchMoveRef = React.useRef(null);
|
@@ -9050,9 +9053,9 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
9050
9053
|
width: `calc(100% - ${((_r = (_q = (_p = (_o = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _o === void 0 ? void 0 : _o.props) === null || _p === void 0 ? void 0 : _p.popupBg) === null || _q === void 0 ? void 0 : _q.horizontalMargin) !== null && _r !== void 0 ? _r : 0) * 2}px)`,
|
9051
9054
|
height: '100%'
|
9052
9055
|
} },
|
9053
|
-
React.createElement("div", Object.assign({ className: `modal-container ${isOpen ? 'modal-popIn' : 'modal-popOut'}`, style: Object.assign(Object.assign({ padding, animationDuration: ((
|
9056
|
+
React.createElement("div", Object.assign({ className: `modal-container ${isOpen ? 'modal-popIn' : 'modal-popOut'}`, role: 'dialog', "aria-label": (_s = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _s === void 0 ? void 0 : _s.displayName, "aria-modal": true, style: Object.assign(Object.assign({ padding, animationDuration: ((_t = popup === null || popup === void 0 ? void 0 : popup.duration) !== null && _t !== void 0 ? _t : 0) / 1000 + 's' }, (isScrollFullScreen && {
|
9054
9057
|
transform: `translateY(${modalTrans}px)`
|
9055
|
-
})), { overflow: 'hidden', borderRadius: `${(
|
9058
|
+
})), { overflow: 'hidden', borderRadius: `${(_x = (_w = (_v = (_u = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _u === void 0 ? void 0 : _u.props) === null || _v === void 0 ? void 0 : _v.popupBg) === null || _w === void 0 ? void 0 : _w.borderRadius) !== null && _x !== void 0 ? _x : 0}px`, zIndex: 9 }), onClick: (e) => {
|
9056
9059
|
e.stopPropagation();
|
9057
9060
|
e.preventDefault();
|
9058
9061
|
} }, (isScrollFullScreen && {
|
@@ -9060,13 +9063,13 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
9060
9063
|
onTouchStart: handleTouchStart,
|
9061
9064
|
onTouchEnd: handleTouchEnd
|
9062
9065
|
})),
|
9063
|
-
React.createElement("
|
9064
|
-
React.createElement("img", { src: (
|
9066
|
+
React.createElement("button", { className: 'modal-icon-wrapper', role: 'button', "aria-label": 'close button', onClick: onClose, style: { top: scrollTop } },
|
9067
|
+
React.createElement("img", { src: (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _y !== void 0 ? _y : closeIcon$1, alt: 'close button', className: 'modal-icon' })),
|
9065
9068
|
React.createElement("div", Object.assign({ ref: ref, style: {
|
9066
9069
|
height: isScrollFullScreen ? fullHeight : MODAL_DEF_CON_H,
|
9067
9070
|
overflow: (isScrollFullScreen && modalTrans <= 0) || !isScrollFullScreen ? 'auto' : 'hidden',
|
9068
9071
|
zIndex: 1
|
9069
|
-
} }, (((
|
9072
|
+
} }, (((_0 = (_z = getPopupById === null || getPopupById === void 0 ? void 0 : getPopupById.item) === null || _z === void 0 ? void 0 : _z.props) === null || _0 === void 0 ? void 0 : _0.enableFixedCloseButton) && {
|
9070
9073
|
onScroll: (e) => {
|
9071
9074
|
var _a;
|
9072
9075
|
setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
|
@@ -9445,7 +9448,8 @@ const CommodityDetail$1 = (_a) => {
|
|
9445
9448
|
product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
|
9446
9449
|
clickable: true,
|
9447
9450
|
bulletActiveClass: 'swipe-item-active-bullet',
|
9448
|
-
clickableClass: getDotsAlign
|
9451
|
+
clickableClass: getDotsAlign,
|
9452
|
+
bulletElement: 'button'
|
9449
9453
|
}, loop: true, autoplay: {
|
9450
9454
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
9451
9455
|
}, ref: ref, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': { bottom: (_x = swiper === null || swiper === void 0 ? void 0 : swiper.dotsMarginBottom) !== null && _x !== void 0 ? _x : 0, fontSize: '14px' } }, ((swiper === null || swiper === void 0 ? void 0 : swiper.dotsBgColor) && {
|
@@ -10352,7 +10356,8 @@ Made in Italy` })));
|
|
10352
10356
|
product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
|
10353
10357
|
clickable: true,
|
10354
10358
|
bulletActiveClass: 'swipe-item-active-bullet',
|
10355
|
-
clickableClass: getDotsAlign
|
10359
|
+
clickableClass: getDotsAlign,
|
10360
|
+
bulletElement: 'button'
|
10356
10361
|
}, loop: true, autoplay: {
|
10357
10362
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
10358
10363
|
}, ref: ref, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
|
@@ -10833,22 +10838,24 @@ function useOnScreen(ref) {
|
|
10833
10838
|
* @Author: binruan@chatlabs.com
|
10834
10839
|
* @Date: 2024-01-16 14:50:13
|
10835
10840
|
* @LastEditors: binruan@chatlabs.com
|
10836
|
-
* @LastEditTime: 2024-
|
10841
|
+
* @LastEditTime: 2024-10-12 18:04:36
|
10837
10842
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
10838
10843
|
*
|
10839
10844
|
*/
|
10840
|
-
const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventReport = true }) => {
|
10845
|
+
const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventReport = true, isActive }) => {
|
10841
10846
|
const ref = React.useRef(null);
|
10842
10847
|
const isOnScreen = useOnScreen(ref);
|
10843
10848
|
const { ctaEvent } = useSxpDataSource();
|
10849
|
+
const [visible, setVisible] = React.useState(false);
|
10844
10850
|
React.useEffect(() => {
|
10845
|
-
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current) && enableEventReport) {
|
10851
|
+
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current) && enableEventReport && !visible) {
|
10852
|
+
setVisible(true);
|
10846
10853
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10847
10854
|
eventSubject: 'ctaExposure',
|
10848
10855
|
eventDescription: 'The cta was shown to the user'
|
10849
10856
|
}, rec, item, index);
|
10850
10857
|
}
|
10851
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport]);
|
10858
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport, visible]);
|
10852
10859
|
React.useMemo(() => {
|
10853
10860
|
return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/20`;
|
10854
10861
|
}, [src]);
|
@@ -11958,7 +11965,7 @@ var styles$4 = {"two-line-ellipsis":"index-module_two-line-ellipsis__SFQwJ"};
|
|
11958
11965
|
|
11959
11966
|
const MultiCommodityDiro$1 = (_a) => {
|
11960
11967
|
var _b, _c;
|
11961
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY"]);
|
11968
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY", "isActive"]);
|
11962
11969
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
11963
11970
|
const { popup } = useEditor();
|
11964
11971
|
const { jumpToWeb } = useEventReport();
|
@@ -11982,7 +11989,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
11982
11989
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
11983
11990
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
11984
11991
|
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
11985
|
-
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 }),
|
11992
|
+
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, isActive: isActive }),
|
11986
11993
|
React.createElement("div", { className: css.css({
|
11987
11994
|
color: '#000',
|
11988
11995
|
display: 'flex',
|
@@ -12074,7 +12081,7 @@ var styles$3 = {"two-line-ellipsis":"index-module_two-line-ellipsis__mdzn0"};
|
|
12074
12081
|
|
12075
12082
|
const MultiCommodity$1 = (_a) => {
|
12076
12083
|
var _b, _c;
|
12077
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY"]);
|
12084
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY", "isActive"]);
|
12078
12085
|
const { sxpParameter } = useSxpDataSource();
|
12079
12086
|
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
12080
12087
|
const { popup } = useEditor();
|
@@ -12099,7 +12106,7 @@ const MultiCommodity$1 = (_a) => {
|
|
12099
12106
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
12100
12107
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
12101
12108
|
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
12102
|
-
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 }),
|
12109
|
+
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, isActive: isActive }),
|
12103
12110
|
React.createElement("div", { className: css.css({
|
12104
12111
|
color: '#fff',
|
12105
12112
|
display: 'flex',
|
@@ -12199,7 +12206,7 @@ var styles$2 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__fselR"};
|
|
12199
12206
|
|
12200
12207
|
const MultiCommodityDiroNew$1 = (_a) => {
|
12201
12208
|
var _b, _c;
|
12202
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY"]);
|
12209
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY", "isActive"]);
|
12203
12210
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
12204
12211
|
const { popup } = useEditor();
|
12205
12212
|
const { jumpToWeb } = useEventReport();
|
@@ -12224,7 +12231,7 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
12224
12231
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
12225
12232
|
var _a, _b, _c, _d, _e, _f, _g;
|
12226
12233
|
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: index, className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
|
12227
|
-
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 }),
|
12234
|
+
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, isActive: isActive }),
|
12228
12235
|
React.createElement("div", { className: css.css({
|
12229
12236
|
color: '#fff',
|
12230
12237
|
display: 'flex',
|
@@ -12542,7 +12549,7 @@ var settingRender$3 = [
|
|
12542
12549
|
* @Author: binruan@chatlabs.com
|
12543
12550
|
* @Date: 2023-12-26 16:11:34
|
12544
12551
|
* @LastEditors: binruan@chatlabs.com
|
12545
|
-
* @LastEditTime: 2024-
|
12552
|
+
* @LastEditTime: 2024-10-11 18:22:21
|
12546
12553
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Navbar.tsx
|
12547
12554
|
*
|
12548
12555
|
*/
|
@@ -12550,7 +12557,8 @@ const Navbar = ({ icon, styles, textStyle, onClose }) => {
|
|
12550
12557
|
var _a;
|
12551
12558
|
const { waterFallData, setOpenHashtag } = useSxpDataSource();
|
12552
12559
|
return (React.createElement("div", { className: 'clc-sxp-nav', style: styles },
|
12553
|
-
React.createElement("
|
12560
|
+
React.createElement("button", { className: 'clc-sxp-nav-left', role: 'button', "aria-label": 'back button', onClick: onClose },
|
12561
|
+
React.createElement("img", { src: icon, alt: 'back button' })),
|
12554
12562
|
React.createElement("div", { className: 'clc-sxp-nav-title', style: Object.assign(Object.assign({}, textStyle), { paddingLeft: (textStyle === null || textStyle === void 0 ? void 0 : textStyle.textAlign) === 'left' ? '35px' : 0 }), dangerouslySetInnerHTML: {
|
12555
12563
|
__html: setFontForText(`#${(_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag) !== null && _a !== void 0 ? _a : '标题'}`, textStyle)
|
12556
12564
|
} })));
|
@@ -14407,7 +14415,7 @@ function WaterfallList(_a) {
|
|
14407
14415
|
* @Author: binruan@chatlabs.com
|
14408
14416
|
* @Date: 2024-01-10 10:58:24
|
14409
14417
|
* @LastEditors: binruan@chatlabs.com
|
14410
|
-
* @LastEditTime: 2024-
|
14418
|
+
* @LastEditTime: 2024-10-11 13:43:22
|
14411
14419
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
14412
14420
|
*
|
14413
14421
|
*/
|
@@ -14459,14 +14467,17 @@ const WaterFall = (props) => {
|
|
14459
14467
|
if (!rec)
|
14460
14468
|
return;
|
14461
14469
|
let fromKName = '';
|
14470
|
+
let contentFormat = null;
|
14462
14471
|
if (isFromHashtag) {
|
14463
14472
|
fromKName = 'hashTagPage';
|
14464
14473
|
}
|
14465
14474
|
else if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
14466
14475
|
fromKName = 'videoPage';
|
14476
|
+
contentFormat = 'video';
|
14467
14477
|
}
|
14468
14478
|
else if ((_c = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) === null || _c === void 0 ? void 0 : _c.length) {
|
14469
14479
|
fromKName = 'imagePage';
|
14480
|
+
contentFormat = 'image';
|
14470
14481
|
}
|
14471
14482
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
14472
14483
|
eventInfo: {
|
@@ -14479,7 +14490,8 @@ const WaterFall = (props) => {
|
|
14479
14490
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
14480
14491
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
14481
14492
|
eventSubject: 'clickTagsViewContents',
|
14482
|
-
eventDescription: 'User click tags view contents'
|
14493
|
+
eventDescription: 'User click tags view contents',
|
14494
|
+
contentFormat
|
14483
14495
|
}
|
14484
14496
|
});
|
14485
14497
|
}, [recData, bffEventReport, viewTime, isFromHashtag, cacheActiveIndex]);
|
@@ -15997,7 +16009,7 @@ const Picture = (props) => {
|
|
15997
16009
|
* @Author: lewinlu@chatlabs.com
|
15998
16010
|
* @Date: 2024-01-03 14:39:09
|
15999
16011
|
* @LastEditors: binruan@chatlabs.com
|
16000
|
-
* @LastEditTime: 2024-
|
16012
|
+
* @LastEditTime: 2024-10-10 17:53:30
|
16001
16013
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\index.tsx
|
16002
16014
|
*/
|
16003
16015
|
const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageEnd, onViewImageStartEvent, imgUrlsPostConfig }) => {
|
@@ -16030,7 +16042,8 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onReportViewImageE
|
|
16030
16042
|
// }
|
16031
16043
|
return (React.createElement(Swiper, { ref: ref, defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
16032
16044
|
clickable: true,
|
16033
|
-
bulletActiveClass: 'swipe-item-active-bullet'
|
16045
|
+
bulletActiveClass: 'swipe-item-active-bullet',
|
16046
|
+
bulletElement: 'button'
|
16034
16047
|
}, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
|
16035
16048
|
bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
|
16036
16049
|
fontSize: '14px'
|
@@ -16055,7 +16068,7 @@ var PictureGroup$3 = React.memo(PictureGroup$2);
|
|
16055
16068
|
* @Author: binruan@chatlabs.com
|
16056
16069
|
* @Date: 2024-01-15 19:03:09
|
16057
16070
|
* @LastEditors: binruan@chatlabs.com
|
16058
|
-
* @LastEditTime: 2024-
|
16071
|
+
* @LastEditTime: 2024-10-11 18:37:55
|
16059
16072
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Hashtag\index.tsx
|
16060
16073
|
*
|
16061
16074
|
*/
|
@@ -16093,7 +16106,7 @@ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle }) => {
|
|
16093
16106
|
return (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer', color: '#fff' }, onClick: () => setIsShowMore(!isShowMore) }, isShowMore ? 'show less' : 'show more'));
|
16094
16107
|
}, [isShowMore, tags]);
|
16095
16108
|
return (React.createElement("div", { className: 'clc-sxp-bottom-hashtag', style: { marginTop: `${(_a = hashTagStyle === null || hashTagStyle === void 0 ? void 0 : hashTagStyle.marginTop) !== null && _a !== void 0 ? _a : 16}px` } },
|
16096
|
-
React.createElement(Scroll$1, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item) },
|
16109
|
+
React.createElement(Scroll$1, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item), tag: 'button', "aria-label": item },
|
16097
16110
|
React.createElement("div", { dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
|
16098
16111
|
};
|
16099
16112
|
var Hashtag$1 = React.memo(Hashtag);
|
@@ -16162,7 +16175,7 @@ function withBindDataSource(Component) {
|
|
16162
16175
|
* @Author: binruan@chatlabs.com
|
16163
16176
|
* @Date: 2023-12-26 16:11:34
|
16164
16177
|
* @LastEditors: binruan@chatlabs.com
|
16165
|
-
* @LastEditTime: 2024-
|
16178
|
+
* @LastEditTime: 2024-10-12 16:22:10
|
16166
16179
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
|
16167
16180
|
*
|
16168
16181
|
*/
|
@@ -16182,38 +16195,44 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive }
|
|
16182
16195
|
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
16183
16196
|
}
|
16184
16197
|
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
16185
|
-
const renderComp = React.
|
16186
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
16198
|
+
const renderComp = React.useMemo(() => {
|
16199
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
|
16187
16200
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video))
|
16188
16201
|
return null;
|
16202
|
+
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) ;
|
16203
|
+
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) ;
|
16204
|
+
else {
|
16205
|
+
(_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
16206
|
+
}
|
16189
16207
|
//如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
|
16190
|
-
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((
|
16208
|
+
if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.type)))
|
16191
16209
|
return;
|
16192
16210
|
//默认不渲染category为cta类型的组件,该类型的组件只用于某一处
|
16193
|
-
if (!includesCtaType && ((
|
16211
|
+
if (!includesCtaType && ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.category) === 'cta')
|
16194
16212
|
return;
|
16195
|
-
if ((((
|
16196
|
-
(((
|
16197
|
-
(((
|
16198
|
-
(((
|
16199
|
-
(((
|
16200
|
-
(((
|
16213
|
+
if ((((_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.type) === 'CommodityDiro' && !((_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProduct)) ||
|
16214
|
+
(((_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.type) === 'Commodity' && !((_l = rec === null || rec === void 0 ? void 0 : rec.video) === null || _l === void 0 ? void 0 : _l.bindProduct)) ||
|
16215
|
+
(((_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.type) === 'CommodityDiroNew' && !((_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.bindProduct)) ||
|
16216
|
+
(((_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.type) === 'MultiCommodity' && !((_r = (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.bindProducts) === null || _r === void 0 ? void 0 : _r.length)) ||
|
16217
|
+
(((_s = value === null || value === void 0 ? void 0 : value.item) === null || _s === void 0 ? void 0 : _s.type) === 'MultiCommodityDiro' && !((_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u.length)) ||
|
16218
|
+
(((_v = value === null || value === void 0 ? void 0 : value.item) === null || _v === void 0 ? void 0 : _v.type) === 'MultiCommodityDiroNew' && !((_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindProducts) === null || _x === void 0 ? void 0 : _x.length))) {
|
16201
16219
|
//
|
16202
16220
|
return null;
|
16203
16221
|
}
|
16204
16222
|
if (value && resolver) {
|
16205
|
-
const t = resolver[(
|
16223
|
+
const t = resolver[(_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.type];
|
16206
16224
|
const Component = withBindDataSource(t);
|
16207
|
-
const defaulSetting = (
|
16208
|
-
const isExternalLink = ((
|
16209
|
-
return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (
|
16225
|
+
const defaulSetting = (_z = t === null || t === void 0 ? void 0 : t.extend) === null || _z === void 0 ? void 0 : _z.defaulSetting;
|
16226
|
+
const isExternalLink = ((_2 = (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.event) === null || _1 === void 0 ? void 0 : _1.onClick) === null || _2 === void 0 ? void 0 : _2.linkType) === 'externalLink';
|
16227
|
+
return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_4 = value === null || value === void 0 ? void 0 : value.item) === null || _4 === void 0 ? void 0 : _4.textStyle), bindDatas: (_6 = (_5 = value === null || value === void 0 ? void 0 : value.item) === null || _5 === void 0 ? void 0 : _5.bindDatas) !== null && _6 !== void 0 ? _6 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_7 = value === null || value === void 0 ? void 0 : value.item) === null || _7 === void 0 ? void 0 : _7.props, { event: ((_8 = value === null || value === void 0 ? void 0 : value.item) === null || _8 === void 0 ? void 0 : _8.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
|
16210
16228
|
}
|
16211
16229
|
else {
|
16212
16230
|
return null;
|
16213
16231
|
}
|
16214
16232
|
}, [rec, resolver, tempMap, schema, value === null || value === void 0 ? void 0 : value.id, isActive]);
|
16215
|
-
return React.createElement(React.Fragment, null, renderComp
|
16233
|
+
return React.createElement(React.Fragment, null, renderComp);
|
16216
16234
|
};
|
16235
|
+
var RenderCard$1 = React.memo(RenderCard);
|
16217
16236
|
|
16218
16237
|
/*
|
16219
16238
|
* @Author: binruan@chatlabs.com
|
@@ -16242,7 +16261,7 @@ const Nudge = ({ nudge }) => {
|
|
16242
16261
|
* @Author: binruan@chatlabs.com
|
16243
16262
|
* @Date: 2024-04-29 16:32:21
|
16244
16263
|
* @LastEditors: binruan@chatlabs.com
|
16245
|
-
* @LastEditTime: 2024-
|
16264
|
+
* @LastEditTime: 2024-10-11 18:59:43
|
16246
16265
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Tagbar.tsx
|
16247
16266
|
*
|
16248
16267
|
*/
|
@@ -16288,8 +16307,8 @@ const Tagbar = ({ tagList = [], setActiveIndex, style }) => {
|
|
16288
16307
|
if (waterFallData || tagList.length <= 0)
|
16289
16308
|
return null;
|
16290
16309
|
return (React.createElement("div", { className: 'clc-sxp-tagbar', style: style },
|
16291
|
-
React.createElement("
|
16292
|
-
return (React.createElement("
|
16310
|
+
React.createElement("div", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
16311
|
+
return (React.createElement("button", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, "aria-label": tag, onClick: handleSelectTag(tag) }, tag));
|
16293
16312
|
}))));
|
16294
16313
|
};
|
16295
16314
|
var Tagbar$1 = React.memo(Tagbar);
|
@@ -16298,12 +16317,12 @@ var Tagbar$1 = React.memo(Tagbar);
|
|
16298
16317
|
* @Author: binruan@chatlabs.com
|
16299
16318
|
* @Date: 2024-01-15 19:03:09
|
16300
16319
|
* @LastEditors: binruan@chatlabs.com
|
16301
|
-
* @LastEditTime: 2024-
|
16320
|
+
* @LastEditTime: 2024-10-12 15:27:17
|
16302
16321
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16303
16322
|
*
|
16304
16323
|
*/
|
16305
16324
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
|
16306
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
16325
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
16307
16326
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
16308
16327
|
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
16309
16328
|
const { schema } = useEditor();
|
@@ -16549,15 +16568,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16549
16568
|
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
16550
16569
|
return (React.createElement(React.Fragment, null,
|
16551
16570
|
((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
16552
|
-
React.createElement("div", { className: 'clc-sxp-bottom', style: {
|
16571
|
+
React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _b !== void 0 ? _b : 40}px` } },
|
16553
16572
|
React.createElement(Nudge, { nudge: nudge }),
|
16554
16573
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
16555
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
|
16574
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
|
16556
16575
|
React.createElement("div", null,
|
16557
16576
|
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: (_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
16558
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'] }),
|
16577
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'] }),
|
16559
16578
|
React.createElement(Hashtag$1, { index: activeIndex, tags: (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.hashTags) !== null && _f !== void 0 ? _f : [], itemId: (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId, itemType: ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))),
|
16560
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
16579
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
16561
16580
|
}
|
16562
16581
|
return null;
|
16563
16582
|
}, [
|
@@ -16612,7 +16631,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16612
16631
|
}
|
16613
16632
|
};
|
16614
16633
|
const handleSlideSkip = (item, position) => {
|
16615
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
16634
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
16616
16635
|
if (isPreview || waterFallData)
|
16617
16636
|
return;
|
16618
16637
|
const t = new Date() - curTime.current;
|
@@ -16620,18 +16639,26 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16620
16639
|
const link = ((_d = (_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.link) || ((_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.link) || ((_g = item === null || item === void 0 ? void 0 : item.product) === null || _g === void 0 ? void 0 : _g.link);
|
16621
16640
|
const product = (item === null || item === void 0 ? void 0 : item.product) || ((_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct) || ((_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]);
|
16622
16641
|
if (link) {
|
16642
|
+
let contentFormat = null;
|
16643
|
+
if ((_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.url) {
|
16644
|
+
contentFormat = 'video';
|
16645
|
+
}
|
16646
|
+
else if ((_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.imgUrls) === null || _o === void 0 ? void 0 : _o.length) {
|
16647
|
+
contentFormat = 'image';
|
16648
|
+
}
|
16623
16649
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
16624
16650
|
eventInfo: {
|
16625
16651
|
eventSubject: 'swipeToWeb',
|
16626
16652
|
eventDescription: 'User swiped to web',
|
16627
|
-
productId: (
|
16628
|
-
productName: (
|
16653
|
+
productId: (_p = product === null || product === void 0 ? void 0 : product.itemId) !== null && _p !== void 0 ? _p : '',
|
16654
|
+
productName: (_q = product === null || product === void 0 ? void 0 : product.title) !== null && _q !== void 0 ? _q : '',
|
16629
16655
|
price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0',
|
16630
|
-
productCollection: (
|
16656
|
+
productCollection: (_r = product === null || product === void 0 ? void 0 : product.collection) !== null && _r !== void 0 ? _r : '',
|
16631
16657
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
16632
16658
|
position: position + '',
|
16633
|
-
contentId: (
|
16634
|
-
traceInfo: (
|
16659
|
+
contentId: (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.itemId) !== null && _t !== void 0 ? _t : '',
|
16660
|
+
traceInfo: (_x = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : (_w = item === null || item === void 0 ? void 0 : item.product) === null || _w === void 0 ? void 0 : _w.traceInfo) !== null && _x !== void 0 ? _x : '',
|
16661
|
+
contentFormat
|
16635
16662
|
}
|
16636
16663
|
});
|
16637
16664
|
skipLinkRef.current = true;
|
@@ -16640,19 +16667,27 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16640
16667
|
}
|
16641
16668
|
};
|
16642
16669
|
const handleScrollEvent = (swiper) => {
|
16643
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
16670
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
16644
16671
|
const item = data[swiper.previousIndex];
|
16645
16672
|
if (!item)
|
16646
16673
|
return;
|
16674
|
+
let contentFormat = null;
|
16675
|
+
if ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) {
|
16676
|
+
contentFormat = 'video';
|
16677
|
+
}
|
16678
|
+
else if ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls) === null || _c === void 0 ? void 0 : _c.length) {
|
16679
|
+
contentFormat = 'image';
|
16680
|
+
}
|
16647
16681
|
if (swiper.previousIndex - swiper.activeIndex < 0) {
|
16648
16682
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
16649
16683
|
eventInfo: {
|
16650
16684
|
eventSubject: 'scrollDown',
|
16651
16685
|
eventDescription: 'User scroll down',
|
16652
|
-
contentId: (
|
16653
|
-
productId: (
|
16686
|
+
contentId: (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.itemId) !== null && _e !== void 0 ? _e : '',
|
16687
|
+
productId: (_g = (_f = item === null || item === void 0 ? void 0 : item.product) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
|
16654
16688
|
requestId: null,
|
16655
|
-
traceInfo: (
|
16689
|
+
traceInfo: (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.traceInfo) !== null && _j !== void 0 ? _j : '',
|
16690
|
+
contentFormat
|
16656
16691
|
}
|
16657
16692
|
});
|
16658
16693
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -16664,10 +16699,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16664
16699
|
eventInfo: {
|
16665
16700
|
eventSubject: 'scrollUp',
|
16666
16701
|
eventDescription: 'User scroll up',
|
16667
|
-
contentId: (
|
16668
|
-
productId: (
|
16702
|
+
contentId: (_l = (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '',
|
16703
|
+
productId: (_o = (_m = item.product) === null || _m === void 0 ? void 0 : _m.itemId) !== null && _o !== void 0 ? _o : '',
|
16669
16704
|
requestId: null,
|
16670
|
-
traceInfo: (
|
16705
|
+
traceInfo: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : '',
|
16706
|
+
contentFormat
|
16671
16707
|
}
|
16672
16708
|
});
|
16673
16709
|
// 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
|
@@ -16676,7 +16712,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16676
16712
|
// 商品浏览事件
|
16677
16713
|
handleReportProductView(item);
|
16678
16714
|
const curItem = data[swiper.activeIndex];
|
16679
|
-
if (!((
|
16715
|
+
if (!((_r = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _r === void 0 ? void 0 : _r.url) && !((_s = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _s === void 0 ? void 0 : _s.imgUrls) && (curItem === null || curItem === void 0 ? void 0 : curItem.product)) {
|
16680
16716
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16681
16717
|
eventName: 'ProductView'
|
16682
16718
|
});
|
@@ -16779,7 +16815,17 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16779
16815
|
React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
|
16780
16816
|
top: minusHeight
|
16781
16817
|
} }),
|
16782
|
-
|
16818
|
+
((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && (React.createElement("button", { style: {
|
16819
|
+
position: 'absolute',
|
16820
|
+
[(_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _g === void 0 ? void 0 : _g.xPosit) !== null && _h !== void 0 ? _h : 'left']: (_k = (_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _j === void 0 ? void 0 : _j.x) !== null && _k !== void 0 ? _k : 0,
|
16821
|
+
[(_m = (_l = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _l === void 0 ? void 0 : _l.yPosit) !== null && _m !== void 0 ? _m : 'top']: (_p = (_o = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _o === void 0 ? void 0 : _o.y) !== null && _p !== void 0 ? _p : 0,
|
16822
|
+
zIndex: 8,
|
16823
|
+
border: 'none',
|
16824
|
+
padding: 0,
|
16825
|
+
background: 'transparent'
|
16826
|
+
}, role: 'button', "aria-label": 'back button', onClick: () => history === null || history === void 0 ? void 0 : history.back() },
|
16827
|
+
React.createElement("img", { src: (_r = (_q = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _q === void 0 ? void 0 : _q.icon) !== null && _r !== void 0 ? _r : img, alt: 'back button', width: 50, style: { objectFit: 'cover' } }))),
|
16828
|
+
isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _s !== void 0 ? _s : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
|
16783
16829
|
React.createElement(Swiper, { style: {
|
16784
16830
|
marginTop: tagHeight
|
16785
16831
|
}, ref: swiperRef, onSlideChange: () => {
|
@@ -16811,11 +16857,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16811
16857
|
renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
16812
16858
|
renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
|
16813
16859
|
renderView),
|
16814
|
-
React.createElement(WaterFall$1, Object.assign({}, (
|
16860
|
+
React.createElement(WaterFall$1, Object.assign({}, (_v = (_u = (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _t === void 0 ? void 0 : _t[0]) === null || _u === void 0 ? void 0 : _u.item) === null || _v === void 0 ? void 0 : _v.props))));
|
16815
16861
|
};
|
16816
16862
|
|
16817
16863
|
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|
16818
|
-
return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
16864
|
+
return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
16865
|
+
clickable: true,
|
16866
|
+
bulletActiveClass: 'swipe-item-active-bullet',
|
16867
|
+
bulletElement: 'button'
|
16868
|
+
}, height: height, style: { width }, loop: true, autoplay: false }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
|
16819
16869
|
return (React.createElement(SwiperSlide, { key: url },
|
16820
16870
|
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
|
16821
16871
|
})));
|
@@ -17105,7 +17155,7 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
|
|
17105
17155
|
const CTA = (rec, index) => {
|
17106
17156
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
|
17107
17157
|
return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
17108
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1 })));
|
17158
|
+
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1 })));
|
17109
17159
|
}
|
17110
17160
|
return null;
|
17111
17161
|
};
|