pb-sxp-ui 1.10.6 → 1.10.7
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 +53 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +53 -69
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +53 -69
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +1 -2
- package/es/core/components/SxpPageRender/FormatImage.js +7 -9
- package/es/core/components/SxpPageRender/LikeButton/index.js +1 -2
- package/es/core/components/SxpPageRender/Modal/index.js +1 -2
- package/es/core/components/SxpPageRender/NavBack.js +1 -2
- package/es/core/components/SxpPageRender/Nudge/index.js +2 -2
- package/es/core/components/SxpPageRender/ToggleButton/index.js +1 -2
- package/es/core/components/SxpPageRender/VideoWidget/index.js +1 -3
- package/es/core/components/SxpPageRender/index.js +9 -8
- package/es/core/context/EditorDataProvider.d.ts +3 -2
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.js +18 -3
- package/es/core/utils/tool.d.ts +1 -2
- package/es/core/utils/tool.js +1 -14
- package/es/materials/sxp/MultiPosts/index.js +7 -10
- package/es/materials/sxp/cta/AniLinkPopup/index.js +2 -2
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +1 -2
- package/lib/core/components/SxpPageRender/FormatImage.js +7 -9
- package/lib/core/components/SxpPageRender/LikeButton/index.js +1 -2
- package/lib/core/components/SxpPageRender/Modal/index.js +1 -2
- package/lib/core/components/SxpPageRender/NavBack.js +1 -2
- package/lib/core/components/SxpPageRender/Nudge/index.js +1 -1
- package/lib/core/components/SxpPageRender/ToggleButton/index.js +1 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +1 -3
- package/lib/core/components/SxpPageRender/index.js +9 -8
- package/lib/core/context/EditorDataProvider.d.ts +3 -2
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.js +18 -3
- package/lib/core/utils/tool.d.ts +1 -2
- package/lib/core/utils/tool.js +1 -15
- package/lib/materials/sxp/MultiPosts/index.js +7 -10
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -309,19 +309,6 @@ function getScreenReader() {
|
|
309
309
|
/JAWS/i.test(userAgent) ||
|
310
310
|
/ChromeVox/i.test(userAgent));
|
311
311
|
}
|
312
|
-
const getSpliceQueryUrl = (url) => {
|
313
|
-
if (!url)
|
314
|
-
return '';
|
315
|
-
if ((url === null || url === void 0 ? void 0 : url.indexOf('http')) === -1)
|
316
|
-
return url;
|
317
|
-
let query = 'x-im-piez=on';
|
318
|
-
if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
|
319
|
-
return url + ('&' + query );
|
320
|
-
}
|
321
|
-
else {
|
322
|
-
return url + ('?' + query );
|
323
|
-
}
|
324
|
-
};
|
325
312
|
|
326
313
|
function unzip(b64Data) {
|
327
314
|
const strData = atob(b64Data);
|
@@ -663,6 +650,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
663
650
|
const [videoRef, setVideoRef] = useState(null);
|
664
651
|
const themeTag = useRef();
|
665
652
|
const curTime = useRef();
|
653
|
+
const multiPostTimeRef = useRef();
|
666
654
|
const [selectTag, setSelectTag] = useState(DEFAULT_TAG);
|
667
655
|
const checkCommodityIndexRef = useRef(-1);
|
668
656
|
const popupCurTimeRef = useRef(null);
|
@@ -1039,7 +1027,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1039
1027
|
let pbType;
|
1040
1028
|
getRecommendVideos()
|
1041
1029
|
.then((data) => {
|
1042
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l
|
1030
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
1043
1031
|
if (data) {
|
1044
1032
|
const list = getFilterRecList(data);
|
1045
1033
|
let curData;
|
@@ -1082,14 +1070,27 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1082
1070
|
setCacheRtcList(list);
|
1083
1071
|
bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
|
1084
1072
|
if (channel) {
|
1073
|
+
const item = list === null || list === void 0 ? void 0 : list[0];
|
1074
|
+
const traceInfo = ((_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.traceInfo) || ((_l = item === null || item === void 0 ? void 0 : item.product) === null || _l === void 0 ? void 0 : _l.traceInfo) || '';
|
1085
1075
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1086
1076
|
eventInfo: {
|
1087
1077
|
eventSubject: 'multiPostClick',
|
1088
1078
|
eventDescription: 'multiPostClick',
|
1089
|
-
traceInfo
|
1079
|
+
traceInfo,
|
1090
1080
|
branchfeed: channel
|
1091
1081
|
}
|
1092
1082
|
});
|
1083
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1084
|
+
eventInfo: {
|
1085
|
+
eventSubject: 'endMultiPost',
|
1086
|
+
eventDescription: 'endMultiPost',
|
1087
|
+
contentFormat: 'image',
|
1088
|
+
position: '0',
|
1089
|
+
traceInfo,
|
1090
|
+
nextStep: 'multipostClick',
|
1091
|
+
timeOnSite: Math.floor((new Date() - (multiPostTimeRef === null || multiPostTimeRef === void 0 ? void 0 : multiPostTimeRef.current)) / 1000) + ''
|
1092
|
+
}
|
1093
|
+
});
|
1093
1094
|
}
|
1094
1095
|
}
|
1095
1096
|
})
|
@@ -1173,7 +1174,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1173
1174
|
updateChannel,
|
1174
1175
|
channel,
|
1175
1176
|
eventTimeList,
|
1176
|
-
setEventTimeList
|
1177
|
+
setEventTimeList,
|
1178
|
+
multiPostTimeRef
|
1177
1179
|
} }, isShowConsent ? (React.createElement(Consent$4, Object.assign({}, (_e = (_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.props))) : (render({
|
1178
1180
|
rtcList,
|
1179
1181
|
mutateLike: bffMutateLike,
|
@@ -9778,7 +9780,7 @@ SwiperSlide.displayName = 'SwiperSlide';
|
|
9778
9780
|
* @Author: binruan@chatlabs.com
|
9779
9781
|
* @Date: 2023-11-02 18:34:34
|
9780
9782
|
* @LastEditors: binruan@chatlabs.com
|
9781
|
-
* @LastEditTime: 2024-
|
9783
|
+
* @LastEditTime: 2024-11-20 18:37:10
|
9782
9784
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
9783
9785
|
*
|
9784
9786
|
*/
|
@@ -9962,7 +9964,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
9962
9964
|
}
|
9963
9965
|
})), child()),
|
9964
9966
|
React.createElement("button", { className: 'modal-icon-wrapper', role: 'button', "aria-label": 'close button', onClick: onClose, style: { top: scrollTop } },
|
9965
|
-
React.createElement("img", { src:
|
9967
|
+
React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon$1, alt: 'close button', className: 'modal-icon' }))))))), modalEleRef.current);
|
9966
9968
|
};
|
9967
9969
|
var Modal$1 = memo(Modal);
|
9968
9970
|
|
@@ -10035,20 +10037,19 @@ var ExpandableText$1 = memo(ExpandableText);
|
|
10035
10037
|
|
10036
10038
|
const FormatImage = forwardRef((props, ref) => {
|
10037
10039
|
const { src, onLoad, style, className, loading, alt = 'image' } = props;
|
10038
|
-
const
|
10039
|
-
const [imgSrc, setImgSrc] = useState(querySrc);
|
10040
|
+
const [imgSrc, setImgSrc] = useState(src);
|
10040
10041
|
const imgRef = useRef(null);
|
10041
10042
|
const [visible, setVisible] = useState(false);
|
10042
10043
|
useImperativeHandle(ref, () => ({
|
10043
10044
|
setSrc: (v) => {
|
10044
10045
|
if (v)
|
10045
|
-
setImgSrc(
|
10046
|
+
setImgSrc(v);
|
10046
10047
|
}
|
10047
10048
|
}));
|
10048
10049
|
useEffect(() => {
|
10049
|
-
if (
|
10050
|
-
setImgSrc(
|
10051
|
-
}, [
|
10050
|
+
if (src)
|
10051
|
+
setImgSrc(src);
|
10052
|
+
}, [src]);
|
10052
10053
|
useEffect(() => {
|
10053
10054
|
const onShow = () => {
|
10054
10055
|
if (src && !visible && imgRef.current) {
|
@@ -10065,8 +10066,8 @@ const FormatImage = forwardRef((props, ref) => {
|
|
10065
10066
|
!visible && !imgSrc && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
|
10066
10067
|
(imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
|
10067
10068
|
React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
|
10068
|
-
React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}
|
10069
|
-
React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}
|
10069
|
+
React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
|
10070
|
+
React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
|
10070
10071
|
React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
|
10071
10072
|
setVisible(true);
|
10072
10073
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
@@ -16301,7 +16302,7 @@ const AniLinkPopup$1 = (_a) => {
|
|
16301
16302
|
paddingLeft: '6px'
|
16302
16303
|
} }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${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(aniTimStyle)}`, onClick: handleTo }),
|
16303
16304
|
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 } },
|
16304
|
-
React.createElement("img", { src:
|
16305
|
+
React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
|
16305
16306
|
React.createElement(Img$1, { src: src, rec: recData, item: (_x = (_v = (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u[0]) !== null && _v !== void 0 ? _v : (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.bindProduct) !== null && _x !== void 0 ? _x : 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 }),
|
16306
16307
|
(!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: {
|
16307
16308
|
__html: setFontForText((_y = product === null || product === void 0 ? void 0 : product.title) !== null && _y !== void 0 ? _y : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title)
|
@@ -16612,7 +16613,7 @@ var settingRender$1 = [
|
|
16612
16613
|
* @Author: binruan@chatlabs.com
|
16613
16614
|
* @Date: 2023-12-26 10:38:53
|
16614
16615
|
* @LastEditors: binruan@chatlabs.com
|
16615
|
-
* @LastEditTime: 2024-
|
16616
|
+
* @LastEditTime: 2024-10-29 18:04:27
|
16616
16617
|
* @FilePath: \pb-sxp-ui\src\core\context\EditorDataProvider.tsx
|
16617
16618
|
*
|
16618
16619
|
*/
|
@@ -16867,11 +16868,10 @@ var settingRender = [
|
|
16867
16868
|
const MultiPosts$1 = (_a) => {
|
16868
16869
|
var _b, _c;
|
16869
16870
|
var { bgImgUrl, style, recData } = _a, props = __rest(_a, ["bgImgUrl", "style", "recData"]);
|
16870
|
-
const { bffEventReport, curTime, updateChannel } = useSxpDataSource();
|
16871
|
+
const { bffEventReport, curTime, updateChannel, multiPostTimeRef } = useSxpDataSource();
|
16871
16872
|
const { isActive } = useSwiperSlide() || {};
|
16872
16873
|
const initRef = useRef(false);
|
16873
|
-
const
|
16874
|
-
const traceInfo = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.traceInfo) !== null && _c !== void 0 ? _c : '';
|
16874
|
+
const traceInfo = ((_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.traceInfo) || ((_c = recData === null || recData === void 0 ? void 0 : recData.product) === null || _c === void 0 ? void 0 : _c.traceInfo) || '';
|
16875
16875
|
const getPropsVal = useCallback((index, str) => {
|
16876
16876
|
try {
|
16877
16877
|
return new Function('props', 'str', `if (str) {
|
@@ -16888,7 +16888,6 @@ const MultiPosts$1 = (_a) => {
|
|
16888
16888
|
if (!value)
|
16889
16889
|
return;
|
16890
16890
|
if ((v === null || v === void 0 ? void 0 : v.linkType) === 'recommendFlow') {
|
16891
|
-
endMultiPost('multipostClick');
|
16892
16891
|
updateChannel === null || updateChannel === void 0 ? void 0 : updateChannel(value);
|
16893
16892
|
curTime.current = new Date();
|
16894
16893
|
}
|
@@ -16897,12 +16896,12 @@ const MultiPosts$1 = (_a) => {
|
|
16897
16896
|
}
|
16898
16897
|
}, [props]);
|
16899
16898
|
const startMultiPost = useCallback(() => {
|
16900
|
-
|
16899
|
+
multiPostTimeRef.current = new Date();
|
16901
16900
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
16902
16901
|
eventInfo: {
|
16903
16902
|
eventSubject: 'startMultiPost',
|
16904
16903
|
eventDescription: 'startMultiPost',
|
16905
|
-
contentFormat: '
|
16904
|
+
contentFormat: 'image',
|
16906
16905
|
position: '0',
|
16907
16906
|
traceInfo
|
16908
16907
|
}
|
@@ -16914,11 +16913,11 @@ const MultiPosts$1 = (_a) => {
|
|
16914
16913
|
eventInfo: {
|
16915
16914
|
eventSubject: 'endMultiPost',
|
16916
16915
|
eventDescription: 'endMultiPost',
|
16917
|
-
contentFormat: '
|
16916
|
+
contentFormat: 'image',
|
16918
16917
|
position: '0',
|
16919
16918
|
traceInfo,
|
16920
16919
|
nextStep: nextStep || 'others',
|
16921
|
-
timeOnSite: Math.floor((new Date() - (
|
16920
|
+
timeOnSite: Math.floor((new Date() - (multiPostTimeRef === null || multiPostTimeRef === void 0 ? void 0 : multiPostTimeRef.current)) / 1000) + ''
|
16922
16921
|
}
|
16923
16922
|
});
|
16924
16923
|
}, []);
|
@@ -16945,7 +16944,7 @@ const MultiPosts$1 = (_a) => {
|
|
16945
16944
|
}, [isActive]);
|
16946
16945
|
return (React.createElement("div", { className: 'multiposts', style: Object.assign(Object.assign({}, style), getBgStyle(bgImgUrl)) }, Array.from({ length: 4 }, (_, index) => {
|
16947
16946
|
return (React.createElement("button", { hidden: !getPropsVal(index, 'Url'), className: 'multiposts-btn', role: 'button', "aria-label": `multiposts-${index + 1}`, onClick: () => handleClick(index) },
|
16948
|
-
React.createElement("img", { className: 'multiposts-btn-img', src:
|
16947
|
+
React.createElement("img", { className: 'multiposts-btn-img', src: getPropsVal(index, 'Url'), alt: `multiposts-img-${index + 1}` })));
|
16949
16948
|
})));
|
16950
16949
|
};
|
16951
16950
|
var MultiPosts$2 = memo(MultiPosts$1);
|
@@ -17132,7 +17131,7 @@ const LikeButton = (_a) => {
|
|
17132
17131
|
}
|
17133
17132
|
}), 200);
|
17134
17133
|
return (React.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
|
17135
|
-
React.createElement("img", { style: { width: '100%', height: '100%', objectFit: 'contain' }, src:
|
17134
|
+
React.createElement("img", { style: { width: '100%', height: '100%', objectFit: 'contain' }, src: state ? activeIcon || likeIcon : unActicveIcon || unlikeIcon, alt: 'icon' })));
|
17136
17135
|
};
|
17137
17136
|
var LikeButton$1 = memo(LikeButton);
|
17138
17137
|
|
@@ -17346,10 +17345,9 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
17346
17345
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
17347
17346
|
if (!isActive)
|
17348
17347
|
return;
|
17349
|
-
|
17348
|
+
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
|
17350
17349
|
if (!videoSrc)
|
17351
17350
|
return;
|
17352
|
-
videoSrc = getSpliceQueryUrl(videoSrc);
|
17353
17351
|
const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
|
17354
17352
|
if (!videoPlayerWrapperNode)
|
17355
17353
|
return;
|
@@ -17533,7 +17531,7 @@ const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style
|
|
17533
17531
|
setIsTure(defaultValue);
|
17534
17532
|
}, [defaultValue]);
|
17535
17533
|
return (React.createElement("button", { style: style, "aria-label": 'toggle button', className: 'pb-toggle-button', onClick: handleClick },
|
17536
|
-
React.createElement("img", { className: 'pb-toggle-button-icon', alt: 'toggle image', src:
|
17534
|
+
React.createElement("img", { className: 'pb-toggle-button-icon', alt: 'toggle image', src: isTrue ? activeIcon : unactiveIcon })));
|
17537
17535
|
};
|
17538
17536
|
var ToggleButton$1 = memo(ToggleButton);
|
17539
17537
|
|
@@ -17541,7 +17539,7 @@ var ToggleButton$1 = memo(ToggleButton);
|
|
17541
17539
|
* @Author: binruan@chatlabs.com
|
17542
17540
|
* @Date: 2024-01-15 19:03:09
|
17543
17541
|
* @LastEditors: binruan@chatlabs.com
|
17544
|
-
* @LastEditTime: 2024-
|
17542
|
+
* @LastEditTime: 2024-07-11 18:19:29
|
17545
17543
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FingerSwipeTip\index.tsx
|
17546
17544
|
*
|
17547
17545
|
*/
|
@@ -17558,7 +17556,7 @@ const FingerSwipeTip = ({ imageUrl, style, duration = 2000 }) => {
|
|
17558
17556
|
return show ? 'pb-fadeIn' : 'pb-fadeOut';
|
17559
17557
|
}, [show]);
|
17560
17558
|
return (React.createElement("div", { hidden: !show, className: `pb-finger-wrap ${animationCls}`, style: Object.assign(Object.assign({}, style), { animationDuration: `${duration / 1000}s` }) },
|
17561
|
-
React.createElement("img", { src:
|
17559
|
+
React.createElement("img", { src: imageUrl || FINGER_SWIPE_ICON, alt: 'finger swiper' })));
|
17562
17560
|
};
|
17563
17561
|
|
17564
17562
|
/*
|
@@ -17865,7 +17863,7 @@ var RenderCard$1 = memo(RenderCard);
|
|
17865
17863
|
* @Author: binruan@chatlabs.com
|
17866
17864
|
* @Date: 2024-03-26 10:07:41
|
17867
17865
|
* @LastEditors: binruan@chatlabs.com
|
17868
|
-
* @LastEditTime: 2024-
|
17866
|
+
* @LastEditTime: 2024-07-03 10:07:29
|
17869
17867
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Nudge\index.tsx
|
17870
17868
|
*
|
17871
17869
|
*/
|
@@ -17878,7 +17876,7 @@ const Nudge = ({ nudge }) => {
|
|
17878
17876
|
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
17879
17877
|
borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
|
17880
17878
|
} },
|
17881
|
-
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? (React.createElement("img", { src:
|
17879
|
+
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? (React.createElement("img", { src: nudge.icon, alt: 'nudge icon', style: { height: '100%', objectFit: 'cover', flexShrink: 0 } })) : null,
|
17882
17880
|
React.createElement("p", { style: Object.assign(Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle), { textWrap: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', flex: 1, marginBottom: 0, marginTop: 0 }), dangerouslySetInnerHTML: {
|
17883
17881
|
__html: setFontForText(nudge === null || nudge === void 0 ? void 0 : nudge.content, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle)
|
17884
17882
|
} })))));
|
@@ -17971,26 +17969,10 @@ const NavBack = ({ data, minusHeight, tagHeight, onClick }) => {
|
|
17971
17969
|
padding: 0,
|
17972
17970
|
background: 'transparent'
|
17973
17971
|
}, role: 'button', "aria-label": 'back button', onClick: onClick },
|
17974
|
-
React.createElement("img", { src:
|
17972
|
+
React.createElement("img", { src: (data === null || data === void 0 ? void 0 : data.icon) || img, alt: 'back button', width: 100, style: { objectFit: 'cover' } })));
|
17975
17973
|
};
|
17976
17974
|
var NavBack$1 = memo(NavBack);
|
17977
17975
|
|
17978
|
-
/*
|
17979
|
-
* @Author: binruan@chatlabs.com
|
17980
|
-
* @Date: 2024-03-20 10:27:31
|
17981
|
-
* @LastEditors: binruan@chatlabs.com
|
17982
|
-
* @LastEditTime: 2024-12-04 16:13:02
|
17983
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
17984
|
-
*
|
17985
|
-
*/
|
17986
|
-
/*
|
17987
|
-
* @Author: binruan@chatlabs.com
|
17988
|
-
* @Date: 2024-03-20 10:27:31
|
17989
|
-
* @LastEditors: binruan@chatlabs.com
|
17990
|
-
* @LastEditTime: 2024-12-03 15:27:20
|
17991
|
-
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
17992
|
-
*
|
17993
|
-
*/
|
17994
17976
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], licenseUrl }) => {
|
17995
17977
|
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;
|
17996
17978
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
@@ -18079,7 +18061,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18079
18061
|
else if (item === null || item === void 0 ? void 0 : item.product) {
|
18080
18062
|
fromKName = 'productPage';
|
18081
18063
|
}
|
18082
|
-
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.playbook) !== 'organic menu' || activeIndex !== 0) {
|
18064
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.playbook) !== 'organic menu' || activeIndex !== 0 || channel) {
|
18083
18065
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18084
18066
|
eventInfo: {
|
18085
18067
|
sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
|
@@ -18125,7 +18107,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18125
18107
|
backMainFeed,
|
18126
18108
|
openHashtag,
|
18127
18109
|
isShowConsent,
|
18128
|
-
selectTag
|
18110
|
+
selectTag,
|
18111
|
+
channel
|
18129
18112
|
]);
|
18130
18113
|
const tagHeight = useMemo(() => {
|
18131
18114
|
let h = 0;
|
@@ -18178,7 +18161,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18178
18161
|
new Function(link)();
|
18179
18162
|
}
|
18180
18163
|
})),
|
18181
|
-
React.createElement("img", { src:
|
18164
|
+
React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
18182
18165
|
}
|
18183
18166
|
return null;
|
18184
18167
|
}, [globalConfig, activeIndex, visList]);
|
@@ -18468,7 +18451,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18468
18451
|
const renderView = useMemo(() => {
|
18469
18452
|
if (loading) {
|
18470
18453
|
return (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
18471
|
-
React.createElement("img", { width: 64, height: 64, src:
|
18454
|
+
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } })));
|
18472
18455
|
}
|
18473
18456
|
return visList === null || visList === void 0 ? void 0 : visList.map((rec, index) => {
|
18474
18457
|
return (React.createElement(SwiperSlide, { key: index, virtualIndex: index, style: { overflow: 'hidden' } }, rec && (React.createElement(React.Fragment, null, (rec === null || rec === void 0 ? void 0 : rec.loading) ? (React.createElement("div", { style: {
|
@@ -18478,7 +18461,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18478
18461
|
justifyContent: 'center',
|
18479
18462
|
alignItems: 'center'
|
18480
18463
|
} },
|
18481
|
-
React.createElement("img", { width: 64, height: 64, src:
|
18464
|
+
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement(React.Fragment, null,
|
18482
18465
|
renderBottom(rec, index),
|
18483
18466
|
renderLikeButton(rec, index, !(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
|
18484
18467
|
renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
|
@@ -18511,12 +18494,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
18511
18494
|
((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && !channel && !openMultiPosts && !waterFallData && (React.createElement(NavBack$1, { data: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => history === null || history === void 0 ? void 0 : history.back() })),
|
18512
18495
|
((((_l = (_k = (_j = (_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.item) === null || _j === void 0 ? void 0 : _j.props) === null || _k === void 0 ? void 0 : _k.backButton) === null || _l === void 0 ? void 0 : _l.enable) && channel) || openMultiPosts) &&
|
18513
18496
|
!waterFallData && (React.createElement(NavBack$1, { data: (_q = (_p = (_o = (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.item) === null || _p === void 0 ? void 0 : _p.props) === null || _q === void 0 ? void 0 : _q.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => {
|
18514
|
-
var _a, _b
|
18497
|
+
var _a, _b;
|
18498
|
+
const item = visList === null || visList === void 0 ? void 0 : visList[activeIndex];
|
18515
18499
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18516
18500
|
eventInfo: {
|
18517
18501
|
eventSubject: 'backMultiPostClick',
|
18518
18502
|
eventDescription: 'backMultiPostClick',
|
18519
|
-
traceInfo: (
|
18503
|
+
traceInfo: ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.traceInfo) || ((_b = item === null || item === void 0 ? void 0 : item.product) === null || _b === void 0 ? void 0 : _b.traceInfo) || ''
|
18520
18504
|
}
|
18521
18505
|
});
|
18522
18506
|
location === null || location === void 0 ? void 0 : location.reload();
|