pb-sxp-ui 1.6.1 → 1.6.3
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 +27 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -26
- 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 +27 -26
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/index.js +9 -8
- package/es/materials/sxp/cta/AniLink/index.d.ts +1 -0
- package/es/materials/sxp/cta/AniLink/index.js +3 -3
- package/es/materials/sxp/cta/AniLinkPopup/index.js +1 -1
- package/es/materials/sxp/template/Appoint/index.d.ts +1 -0
- package/es/materials/sxp/template/Appoint/index.js +2 -2
- package/es/materials/sxp/template/Commodity/index.d.ts +1 -0
- package/es/materials/sxp/template/Commodity/index.js +2 -2
- package/es/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
- package/es/materials/sxp/template/CommodityDiro/index.js +2 -2
- package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/template/CommodityDiroNew/index.js +2 -2
- package/es/materials/sxp/template/Link/index.d.ts +1 -0
- package/es/materials/sxp/template/Link/index.js +2 -2
- package/es/materials/sxp/template/components/Img.js +2 -2
- package/lib/core/components/SxpPageRender/index.js +9 -8
- package/lib/materials/sxp/cta/AniLink/index.d.ts +1 -0
- package/lib/materials/sxp/cta/AniLink/index.js +3 -3
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +1 -1
- package/lib/materials/sxp/template/Appoint/index.d.ts +1 -0
- package/lib/materials/sxp/template/Appoint/index.js +2 -2
- package/lib/materials/sxp/template/Commodity/index.d.ts +1 -0
- package/lib/materials/sxp/template/Commodity/index.js +2 -2
- package/lib/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
- package/lib/materials/sxp/template/CommodityDiro/index.js +2 -2
- package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +2 -2
- package/lib/materials/sxp/template/Link/index.d.ts +1 -0
- package/lib/materials/sxp/template/Link/index.js +2 -2
- package/lib/materials/sxp/template/components/Img.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -10838,7 +10838,7 @@ function useOnScreen(ref) {
|
|
10838
10838
|
* @Author: binruan@chatlabs.com
|
10839
10839
|
* @Date: 2024-01-16 14:50:13
|
10840
10840
|
* @LastEditors: binruan@chatlabs.com
|
10841
|
-
* @LastEditTime: 2024-10-12 18:
|
10841
|
+
* @LastEditTime: 2024-10-12 18:31:19
|
10842
10842
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
10843
10843
|
*
|
10844
10844
|
*/
|
@@ -10848,14 +10848,14 @@ const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventRe
|
|
10848
10848
|
const { ctaEvent } = useSxpDataSource();
|
10849
10849
|
const [visible, setVisible] = React.useState(false);
|
10850
10850
|
React.useEffect(() => {
|
10851
|
-
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current) && enableEventReport && !visible) {
|
10851
|
+
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current) && enableEventReport && !visible && isActive) {
|
10852
10852
|
setVisible(true);
|
10853
10853
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10854
10854
|
eventSubject: 'ctaExposure',
|
10855
10855
|
eventDescription: 'The cta was shown to the user'
|
10856
10856
|
}, rec, item, index);
|
10857
10857
|
}
|
10858
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport, visible]);
|
10858
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport, visible, isActive]);
|
10859
10859
|
React.useMemo(() => {
|
10860
10860
|
return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/20`;
|
10861
10861
|
}, [src]);
|
@@ -11379,12 +11379,12 @@ var styles$8 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
|
11379
11379
|
|
11380
11380
|
const Commodity$1 = (_a) => {
|
11381
11381
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
11382
|
-
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"]);
|
11382
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index", "isActive"]);
|
11383
11383
|
const { sxpParameter } = useSxpDataSource();
|
11384
11384
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
11385
11385
|
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;
|
11386
11386
|
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
11387
|
-
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 }),
|
11387
|
+
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, isActive: isActive }),
|
11388
11388
|
React.createElement("div", { className: css.css({
|
11389
11389
|
color: '#fff',
|
11390
11390
|
display: 'flex',
|
@@ -11473,12 +11473,12 @@ var interactionRender$8 = [
|
|
11473
11473
|
|
11474
11474
|
const Appoint$1 = (_a) => {
|
11475
11475
|
var _b, _c, _d, _e, _f, _g;
|
11476
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
11476
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, index, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "isActive"]);
|
11477
11477
|
const { sxpParameter } = useSxpDataSource();
|
11478
11478
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
11479
11479
|
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;
|
11480
11480
|
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),
|
11481
|
-
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 }),
|
11481
|
+
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, isActive: isActive }),
|
11482
11482
|
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)), dangerouslySetInnerHTML: {
|
11483
11483
|
__html: setFontForText((_g = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _g !== void 0 ? _g : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
|
11484
11484
|
} })));
|
@@ -11655,14 +11655,14 @@ var styles$7 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__nkBlU","one
|
|
11655
11655
|
|
11656
11656
|
const Link$1 = (_a) => {
|
11657
11657
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
11658
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index, customTitle } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index", "customTitle"]);
|
11658
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index, customTitle, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index", "customTitle", "isActive"]);
|
11659
11659
|
const { sxpParameter, bffEventReport } = useSxpDataSource();
|
11660
11660
|
useEventReport();
|
11661
11661
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
11662
11662
|
(_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
|
11663
11663
|
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;
|
11664
11664
|
return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { jumpLink: (_f = cta === null || cta === void 0 ? void 0 : cta.link) !== null && _f !== void 0 ? _f : '' }),
|
11665
|
-
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, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
11665
|
+
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, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
|
11666
11666
|
React.createElement("div", { className: css.css({
|
11667
11667
|
display: 'flex',
|
11668
11668
|
alignItems: 'center',
|
@@ -11772,12 +11772,12 @@ var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__yyHVb"};
|
|
11772
11772
|
|
11773
11773
|
const CommodityDiro$1 = (_a) => {
|
11774
11774
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
11775
|
-
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"]);
|
11775
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index", "isActive"]);
|
11776
11776
|
const { sxpParameter } = useSxpDataSource();
|
11777
11777
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
11778
11778
|
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;
|
11779
11779
|
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
11780
|
-
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 }),
|
11780
|
+
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, isActive: isActive }),
|
11781
11781
|
React.createElement("div", { className: css.css({
|
11782
11782
|
color: '#fff',
|
11783
11783
|
display: 'flex',
|
@@ -11868,12 +11868,12 @@ var styles$5 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__I-yCC"};
|
|
11868
11868
|
|
11869
11869
|
const CommodityDiroNew$1 = (_a) => {
|
11870
11870
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
11871
|
-
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"]);
|
11871
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index, isActive } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index", "isActive"]);
|
11872
11872
|
const { sxpParameter } = useSxpDataSource();
|
11873
11873
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
11874
11874
|
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;
|
11875
11875
|
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
11876
|
-
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 }),
|
11876
|
+
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, isActive: isActive }),
|
11877
11877
|
React.createElement("div", { className: css.css({
|
11878
11878
|
color: '#fff',
|
11879
11879
|
display: 'flex',
|
@@ -14801,7 +14801,7 @@ var styles$1 = {"animated-button":"index-module_animated-button__lqTbg","gradien
|
|
14801
14801
|
|
14802
14802
|
const AniLink$1 = (_a) => {
|
14803
14803
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
14804
|
-
var { style, recData, ctaTempStyles, index, event, onClick, isExternalLink = false } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "onClick", "isExternalLink"]);
|
14804
|
+
var { style, recData, ctaTempStyles, index, event, onClick, isExternalLink = false, isActive } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "onClick", "isExternalLink", "isActive"]);
|
14805
14805
|
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
14806
14806
|
const { jumpToWeb } = useEventReport();
|
14807
14807
|
const [visible, setVisible] = React.useState(false);
|
@@ -14845,13 +14845,13 @@ const AniLink$1 = (_a) => {
|
|
14845
14845
|
}, [event === null || event === void 0 ? void 0 : event.animation]);
|
14846
14846
|
React.useEffect(() => {
|
14847
14847
|
var _a, _b, _c;
|
14848
|
-
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
14848
|
+
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current) && isActive) {
|
14849
14849
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
14850
14850
|
eventSubject: 'ctaExposure',
|
14851
14851
|
eventDescription: 'The cta was shown to the user'
|
14852
14852
|
}, recData, ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video), index);
|
14853
14853
|
}
|
14854
|
-
}, [isOnScreen]);
|
14854
|
+
}, [isOnScreen, isActive]);
|
14855
14855
|
React.useEffect(() => {
|
14856
14856
|
if (isOnScreen) {
|
14857
14857
|
setVisible(true);
|
@@ -15300,7 +15300,7 @@ const AniLinkPopup$1 = (_a) => {
|
|
15300
15300
|
} }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${css.css(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${styles['aniLinkPopup']} ${aniNamStyle} ${css.css(aniTimStyle)}`, onClick: handleTo }),
|
15301
15301
|
React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style['padding']) !== null && _s !== void 0 ? _s : 0 } },
|
15302
15302
|
React.createElement("img", { src: (_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) !== null && _t !== void 0 ? _t : closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
|
15303
|
-
React.createElement(Img$1, { src: src, rec: recData, item: (_y = (_w = (_v = (_u = recData === null || recData === void 0 ? void 0 : recData.video) === null || _u === void 0 ? void 0 : _u.bindProducts) === null || _v === void 0 ? void 0 : _v[0]) !== null && _w !== void 0 ? _w : (_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.bindProduct) !== null && _y !== void 0 ? _y : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
15303
|
+
React.createElement(Img$1, { src: src, rec: recData, item: (_y = (_w = (_v = (_u = recData === null || recData === void 0 ? void 0 : recData.video) === null || _u === void 0 ? void 0 : _u.bindProducts) === null || _v === void 0 ? void 0 : _v[0]) !== null && _w !== void 0 ? _w : (_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.bindProduct) !== null && _y !== void 0 ? _y : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
|
15304
15304
|
(!recData || (product === null || product === void 0 ? void 0 : product.title)) && (React.createElement("div", { className: styles['one-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
|
15305
15305
|
__html: setFontForText((_z = product === null || product === void 0 ? void 0 : product.title) !== null && _z !== void 0 ? _z : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
|
15306
15306
|
} })),
|
@@ -16317,12 +16317,12 @@ var Tagbar$1 = React.memo(Tagbar);
|
|
16317
16317
|
* @Author: binruan@chatlabs.com
|
16318
16318
|
* @Date: 2024-01-15 19:03:09
|
16319
16319
|
* @LastEditors: binruan@chatlabs.com
|
16320
|
-
* @LastEditTime: 2024-10-
|
16320
|
+
* @LastEditTime: 2024-10-15 14:37:11
|
16321
16321
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16322
16322
|
*
|
16323
16323
|
*/
|
16324
16324
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
|
16325
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
16325
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
16326
16326
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
16327
16327
|
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
16328
16328
|
const { schema } = useEditor();
|
@@ -16478,10 +16478,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16478
16478
|
minusHeight += 56;
|
16479
16479
|
}
|
16480
16480
|
return minusHeight;
|
16481
|
-
}, []);
|
16481
|
+
}, [globalConfig]);
|
16482
16482
|
const height = React.useMemo(() => {
|
16483
16483
|
return containerHeight - minusHeight - tagHeight;
|
16484
|
-
}, [
|
16484
|
+
}, [minusHeight, containerHeight, tagHeight]);
|
16485
16485
|
const visList = React.useMemo(() => {
|
16486
16486
|
var _a;
|
16487
16487
|
const list = activeIndex === 0 && !waterFallData && !isEditor
|
@@ -16574,7 +16574,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16574
16574
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
|
16575
16575
|
React.createElement("div", null,
|
16576
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 }),
|
16577
|
-
React.createElement(RenderCard$1, { 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'], isActive: index === activeIndex }),
|
16578
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 }))),
|
16579
16579
|
React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
|
16580
16580
|
}
|
@@ -16818,14 +16818,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16818
16818
|
((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && (React.createElement("button", { style: {
|
16819
16819
|
position: 'absolute',
|
16820
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']: (
|
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']: (((_o = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _o === void 0 ? void 0 : _o.yPosit) == 'top' ? minusHeight + tagHeight : 0) +
|
16822
|
+
((_q = (_p = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _p === void 0 ? void 0 : _p.y) !== null && _q !== void 0 ? _q : 0),
|
16822
16823
|
zIndex: 8,
|
16823
16824
|
border: 'none',
|
16824
16825
|
padding: 0,
|
16825
16826
|
background: 'transparent'
|
16826
16827
|
}, role: 'button', "aria-label": 'back button', onClick: () => history === null || history === void 0 ? void 0 : history.back() },
|
16827
|
-
React.createElement("img", { src: (
|
16828
|
-
isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((
|
16828
|
+
React.createElement("img", { src: (_s = (_r = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _r === void 0 ? void 0 : _r.icon) !== null && _s !== void 0 ? _s : img, alt: 'back button', width: 50, style: { objectFit: 'cover' } }))),
|
16829
|
+
isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_t = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _t !== void 0 ? _t : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
|
16829
16830
|
React.createElement(Swiper, { style: {
|
16830
16831
|
marginTop: tagHeight
|
16831
16832
|
}, ref: swiperRef, onSlideChange: () => {
|
@@ -16857,7 +16858,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16857
16858
|
renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
16858
16859
|
renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
|
16859
16860
|
renderView),
|
16860
|
-
React.createElement(WaterFall$1, Object.assign({}, (
|
16861
|
+
React.createElement(WaterFall$1, Object.assign({}, (_w = (_v = (_u = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.item) === null || _w === void 0 ? void 0 : _w.props))));
|
16861
16862
|
};
|
16862
16863
|
|
16863
16864
|
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
|