pb-sxp-ui 1.0.100 → 1.0.102
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 +188 -139
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +10 -3
- package/dist/index.js +189 -139
- 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 +188 -139
- 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/ExpandableText.js +3 -1
- package/es/core/components/SxpPageRender/Nudge/index.d.ts +2 -0
- package/es/core/components/SxpPageRender/Nudge/index.js +5 -2
- package/es/core/components/SxpPageRender/Tagbar.d.ts +1 -0
- package/es/core/components/SxpPageRender/Tagbar.js +2 -2
- package/es/core/components/SxpPageRender/VideoWidget/VideoPlayer.d.ts +1 -0
- package/es/core/components/SxpPageRender/VideoWidget/VideoPlayer.js +22 -0
- package/es/core/components/SxpPageRender/VideoWidget/index.d.ts +0 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +93 -85
- package/es/core/components/SxpPageRender/index.js +10 -27
- package/es/materials/sxp/popup/AppointForm/settingRender.js +2 -2
- package/es/materials/sxp/popup/CommodityDetail/index.js +4 -3
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +4 -3
- package/es/materials/sxp/popup/Prompt/index.d.ts +1 -0
- package/es/materials/sxp/popup/Prompt/index.js +4 -2
- package/es/materials/sxp/popup/Prompt/settingRender.d.ts +12 -0
- package/es/materials/sxp/popup/Prompt/settingRender.js +33 -4
- package/lib/core/components/SxpPageRender/ExpandableText.js +3 -1
- package/lib/core/components/SxpPageRender/Nudge/index.d.ts +2 -0
- package/lib/core/components/SxpPageRender/Nudge/index.js +5 -2
- package/lib/core/components/SxpPageRender/Tagbar.d.ts +1 -0
- package/lib/core/components/SxpPageRender/Tagbar.js +2 -2
- package/lib/core/components/SxpPageRender/VideoWidget/VideoPlayer.d.ts +1 -0
- package/lib/core/components/SxpPageRender/VideoWidget/VideoPlayer.js +26 -0
- package/lib/core/components/SxpPageRender/VideoWidget/index.d.ts +0 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +93 -85
- package/lib/core/components/SxpPageRender/index.js +10 -27
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +2 -2
- package/lib/materials/sxp/popup/CommodityDetail/index.js +4 -3
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +4 -3
- package/lib/materials/sxp/popup/Prompt/index.d.ts +1 -0
- package/lib/materials/sxp/popup/Prompt/index.js +4 -2
- package/lib/materials/sxp/popup/Prompt/settingRender.d.ts +12 -0
- package/lib/materials/sxp/popup/Prompt/settingRender.js +33 -4
- package/package.json +1 -1
@@ -48,6 +48,8 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
48
48
|
wordBreak: 'break-word'
|
49
49
|
}, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
|
50
50
|
React.createElement("div", { ref: multiRowCopy, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
|
51
|
-
text && isPost && isShow && (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick
|
51
|
+
text && isPost && isShow && (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
|
52
|
+
__html: setFontForText(isShowMore ? unfoldText || 'show less' : foldText || 'show more', style)
|
53
|
+
} }))));
|
52
54
|
};
|
53
55
|
export default memo(ExpandableText);
|
@@ -1,6 +1,7 @@
|
|
1
|
+
import { setFontForText } from '../../../../core/utils/tool';
|
1
2
|
import React from 'react';
|
2
3
|
const Nudge = ({ nudge }) => {
|
3
|
-
var _a, _b, _c, _d, _e, _f
|
4
|
+
var _a, _b, _c, _d, _e, _f;
|
4
5
|
return (React.createElement(React.Fragment, null, (nudge === null || nudge === void 0 ? void 0 : nudge.isOpen) && (React.createElement("div", { className: 'clc-sxp-bottom-nudge', style: {
|
5
6
|
marginBottom: (_a = nudge === null || nudge === void 0 ? void 0 : nudge.marginBottom) !== null && _a !== void 0 ? _a : 5,
|
6
7
|
width: (_c = (_b = nudge === null || nudge === void 0 ? void 0 : nudge.size) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : 212,
|
@@ -9,6 +10,8 @@ const Nudge = ({ nudge }) => {
|
|
9
10
|
borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
|
10
11
|
} },
|
11
12
|
(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,
|
12
|
-
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 })
|
13
|
+
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 }), dangerouslySetInnerHTML: {
|
14
|
+
__html: setFontForText(nudge === null || nudge === void 0 ? void 0 : nudge.content, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle)
|
15
|
+
} })))));
|
13
16
|
};
|
14
17
|
export default Nudge;
|
@@ -3,7 +3,7 @@ import { useSxpDataSource } from '../../../core/hooks';
|
|
3
3
|
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../core/utils/event';
|
4
4
|
import { useEventReport } from '../../../core/hooks/useEventReport';
|
5
5
|
import { DEFAULT_TAG } from '../../../core/context/SxpDataSourceProvider';
|
6
|
-
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
6
|
+
const Tagbar = ({ tagList = [], setActiveIndex, style }) => {
|
7
7
|
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData, bffEventReport, selectTag, setSelectTag } = useSxpDataSource();
|
8
8
|
const { backMainFeed } = useEventReport();
|
9
9
|
const realTagList = useMemo(() => {
|
@@ -44,7 +44,7 @@ const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
|
44
44
|
};
|
45
45
|
if (waterFallData || tagList.length <= 0)
|
46
46
|
return null;
|
47
|
-
return (React.createElement("div", { className: 'clc-sxp-tagbar' },
|
47
|
+
return (React.createElement("div", { className: 'clc-sxp-tagbar', style: style },
|
48
48
|
React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
49
49
|
return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
|
50
50
|
}))));
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const mountVideoPlayerAtNode: ((domNode: any) => Element | null | undefined) | undefined;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import ReactDOM from 'react-dom';
|
3
|
+
export const mountVideoPlayerAtNode = (() => {
|
4
|
+
if (typeof document === 'undefined')
|
5
|
+
return;
|
6
|
+
const playerContainer = document.createElement('div');
|
7
|
+
const dom = ReactDOM.render(React.createElement("video", { id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', preload: 'auto', controls: false, muted: true, style: {
|
8
|
+
backgroundColor: 'transparent',
|
9
|
+
width: '100%',
|
10
|
+
height: '100%',
|
11
|
+
objectFit: 'cover',
|
12
|
+
pointerEvents: 'none'
|
13
|
+
} }), playerContainer);
|
14
|
+
return (domNode) => {
|
15
|
+
if (!domNode)
|
16
|
+
return;
|
17
|
+
domNode.innerHTML = '';
|
18
|
+
domNode.appendChild(dom);
|
19
|
+
const videoPlayerWrapperNode = document.querySelector(`#player-container-id`);
|
20
|
+
return videoPlayerWrapperNode;
|
21
|
+
};
|
22
|
+
})();
|
@@ -5,7 +5,8 @@ import FormatImage from '../FormatImage';
|
|
5
5
|
import { useSxpDataSource } from '../../../../core/hooks';
|
6
6
|
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
|
7
7
|
import loading_gif from './loading.gif';
|
8
|
-
|
8
|
+
import { mountVideoPlayerAtNode } from './VideoPlayer';
|
9
|
+
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon }) => {
|
9
10
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
10
11
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = useSxpDataSource();
|
11
12
|
const videoStartTime = useRef(0);
|
@@ -15,6 +16,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
15
16
|
const canvasRef = useRef(null);
|
16
17
|
const [firstFrameSrc, setFirstFrameSrc] = useState('');
|
17
18
|
const [waiting, setWaiting] = useState(false);
|
19
|
+
const videoRef = useRef();
|
18
20
|
const videoId = `pb-cache-video-${index}`;
|
19
21
|
const videoEleRef = useRef(null);
|
20
22
|
const blur = useMemo(() => {
|
@@ -45,56 +47,57 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
45
47
|
return isBgColor && (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgColor) ? { backgroundColor: videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.bgColor } : {};
|
46
48
|
}, [videoPostConfig, isBgColor]);
|
47
49
|
useEffect(() => {
|
48
|
-
if (!videoRef)
|
50
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
49
51
|
return;
|
50
|
-
videoRef.muted = muted;
|
51
|
-
}, [muted, videoRef]);
|
52
|
+
videoRef.current.muted = muted;
|
53
|
+
}, [muted, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
52
54
|
const handlePlay = useCallback(() => {
|
53
|
-
|
55
|
+
var _a;
|
56
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
54
57
|
return;
|
55
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
56
|
-
}, [videoRef]);
|
58
|
+
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
59
|
+
}, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
57
60
|
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
58
61
|
const handlePlaying = useCallback(() => {
|
59
|
-
if (!videoRef)
|
62
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
60
63
|
return;
|
61
64
|
setWaiting(false);
|
62
65
|
setIsLoadFinish(true);
|
63
66
|
}, []);
|
64
67
|
const handleStartPlay = useCallback(() => {
|
65
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
66
|
-
if (!videoRef)
|
68
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
69
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
67
70
|
return;
|
68
71
|
setIsPauseVideo(false);
|
69
72
|
const item = data[index];
|
70
|
-
if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration)) {
|
71
|
-
videoStartTime.current = (videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) || 0;
|
72
|
-
const videoDuration = ((
|
73
|
-
const videoCurrentTime = ((
|
73
|
+
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
74
|
+
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
75
|
+
const videoDuration = ((_d = (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
76
|
+
const videoCurrentTime = ((_f = (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
74
77
|
const playType = isFirstPlay ? '0' : '1';
|
75
78
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
76
79
|
eventInfo: {
|
77
80
|
eventSubject: 'playVideo',
|
78
81
|
eventDescription: 'User played the video',
|
79
|
-
contentId: (
|
80
|
-
contentName: (
|
82
|
+
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
83
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
81
84
|
playType,
|
82
85
|
startTime: videoCurrentTime,
|
83
86
|
videoDuration,
|
84
|
-
contentTags: JSON.stringify((
|
87
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
85
88
|
position: index + '',
|
86
89
|
contentFormat: 'video',
|
87
|
-
traceInfo: (
|
90
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
88
91
|
}
|
89
92
|
});
|
90
93
|
setIsFirstPlay(false);
|
91
94
|
}
|
92
|
-
}, [bffEventReport, data, index, isFirstPlay, videoRef]);
|
95
|
+
}, [bffEventReport, data, index, isFirstPlay, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
93
96
|
const handLoadeddata = useCallback(() => {
|
94
97
|
var _a;
|
95
|
-
if (!videoRef || firstFrameSrc || !blur)
|
98
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
|
96
99
|
return;
|
97
|
-
videoRef.style.objectFit = 'contain';
|
100
|
+
videoRef.current.style.objectFit = 'contain';
|
98
101
|
if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !canvasRef.current || isBgColor)
|
99
102
|
return;
|
100
103
|
const setFrameImg = () => {
|
@@ -104,155 +107,160 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
104
107
|
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
105
108
|
canvas.height = targetHeight;
|
106
109
|
canvas.width = targetWidth;
|
107
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(videoRef, 0, 0, canvas.width, canvas.height);
|
110
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(videoRef.current, 0, 0, canvas.width, canvas.height);
|
108
111
|
setFirstFrameSrc(canvas.toDataURL());
|
109
112
|
};
|
110
113
|
setFrameImg();
|
111
114
|
setTimeout(() => {
|
112
115
|
setFrameImg();
|
113
116
|
}, 500);
|
114
|
-
}, [videoRef, isBgColor, rec, firstFrameSrc, blur]);
|
117
|
+
}, [videoRef.current, isBgColor, rec, firstFrameSrc, blur]);
|
115
118
|
const handleLoadedmetadata = useCallback(() => {
|
116
|
-
if (!videoRef)
|
119
|
+
if (!videoRef.current)
|
117
120
|
return;
|
118
121
|
handleStartPlay();
|
119
122
|
handLoadeddata();
|
120
|
-
}, [videoRef, handLoadeddata, handleStartPlay]);
|
123
|
+
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
121
124
|
const handleClickVideo = useCallback((type) => () => {
|
122
|
-
|
125
|
+
var _a, _b, _c, _d, _e;
|
126
|
+
if (!videoRef.current)
|
123
127
|
return;
|
124
128
|
if (!isLoadFinish)
|
125
129
|
return;
|
126
|
-
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused;
|
130
|
+
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
127
131
|
switch (type) {
|
128
132
|
case 'start':
|
129
133
|
if (!isPause)
|
130
134
|
return;
|
131
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
135
|
+
(_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
132
136
|
setIsPauseVideo(false);
|
133
137
|
break;
|
134
138
|
case 'pause':
|
135
139
|
if (isPause)
|
136
140
|
return;
|
137
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
|
141
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
138
142
|
setIsPauseVideo(true);
|
139
143
|
break;
|
140
144
|
default:
|
141
145
|
if (isPause) {
|
142
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
146
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
143
147
|
}
|
144
148
|
else {
|
145
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
|
149
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
146
150
|
}
|
147
151
|
setIsPauseVideo(!isPause);
|
148
152
|
break;
|
149
153
|
}
|
150
|
-
}, [isLoadFinish, videoRef]);
|
154
|
+
}, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
151
155
|
const handlePause = useCallback(() => {
|
152
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
153
|
-
if (!videoRef)
|
156
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
157
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
154
158
|
return;
|
155
159
|
if (activeIndex !== index)
|
156
160
|
return;
|
157
161
|
const item = data[index];
|
158
|
-
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) !== null &&
|
159
|
-
const videoCurrentTime = ((
|
160
|
-
if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) {
|
161
|
-
const playDuration = ((videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) - videoStartTime.current).toFixed(2);
|
162
|
+
const videoDuration = ((_b = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
163
|
+
const videoCurrentTime = ((_d = (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
164
|
+
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
165
|
+
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
162
166
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
163
167
|
eventInfo: {
|
164
168
|
eventSubject: 'playOverVideo',
|
165
169
|
eventDescription: 'User finished playing the video',
|
166
|
-
contentId: (
|
167
|
-
contentName: (
|
170
|
+
contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
171
|
+
contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
|
168
172
|
endTime: videoCurrentTime,
|
169
173
|
videoDuration,
|
170
174
|
playDuration,
|
171
|
-
contentTags: JSON.stringify((
|
175
|
+
contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
|
172
176
|
position: index + '',
|
173
177
|
contentFormat: 'video',
|
174
|
-
traceInfo: (
|
178
|
+
traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
|
175
179
|
}
|
176
180
|
});
|
177
181
|
}
|
178
|
-
}, [data, index, bffEventReport, videoRef, activeIndex]);
|
182
|
+
}, [data, index, bffEventReport, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current, activeIndex]);
|
179
183
|
const handleWaiting = useCallback(() => {
|
180
184
|
setWaiting(true);
|
181
185
|
}, []);
|
182
186
|
useEffect(() => {
|
183
|
-
|
187
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
188
|
+
if (!isActive)
|
184
189
|
return;
|
185
190
|
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
|
186
191
|
if (!videoSrc)
|
187
192
|
return;
|
193
|
+
const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
|
194
|
+
if (!videoPlayerWrapperNode)
|
195
|
+
return;
|
196
|
+
videoRef.current = mountVideoPlayerAtNode === null || mountVideoPlayerAtNode === void 0 ? void 0 : mountVideoPlayerAtNode(videoPlayerWrapperNode);
|
197
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
198
|
+
return;
|
188
199
|
const Hls = window === null || window === void 0 ? void 0 : window.Hls;
|
189
200
|
let hls = null;
|
190
201
|
if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
|
191
202
|
hls = new Hls();
|
192
203
|
hls.loadSource(videoSrc);
|
193
|
-
hls.attachMedia(videoRef);
|
204
|
+
hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
194
205
|
hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
195
|
-
|
206
|
+
var _a;
|
207
|
+
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
196
208
|
});
|
197
209
|
}
|
198
210
|
else {
|
199
|
-
videoRef.src = videoSrc;
|
211
|
+
videoRef.current.src = videoSrc;
|
200
212
|
}
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
videoRef.
|
208
|
-
videoRef.
|
209
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('
|
210
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('
|
211
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('play', handleStartPlay);
|
212
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('playing', handlePlaying);
|
213
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('pause', handlePause);
|
214
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('ended', handlePlay);
|
215
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('canplay', handlePlay);
|
216
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('waiting', handleWaiting);
|
213
|
+
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.setAttribute('x5-playsinline', 'true');
|
214
|
+
(_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.setAttribute('webkit-playsinline', 'true');
|
215
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('loadedmetadata', handleLoadedmetadata);
|
216
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
|
217
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
|
218
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
|
219
|
+
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
|
220
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handlePlay);
|
221
|
+
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
222
|
+
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
217
223
|
return () => {
|
224
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
218
225
|
if (hls)
|
219
226
|
hls === null || hls === void 0 ? void 0 : hls.destroy();
|
220
227
|
setIsLoadFinish(false);
|
221
|
-
|
222
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('
|
223
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('
|
224
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('
|
225
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('
|
226
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('
|
227
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('
|
228
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('
|
229
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('waiting', handleWaiting);
|
228
|
+
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedmetadata);
|
229
|
+
(_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadeddata', handLoadeddata);
|
230
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('play', handleStartPlay);
|
231
|
+
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('playing', handlePlaying);
|
232
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('pause', handlePause);
|
233
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('ended', handlePlay);
|
234
|
+
(_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('canplay', handlePlay);
|
235
|
+
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('waiting', handleWaiting);
|
230
236
|
};
|
231
|
-
}, [isActive, videoId, rec
|
237
|
+
}, [isActive, videoId, rec]);
|
232
238
|
useEffect(() => {
|
233
|
-
|
239
|
+
var _a, _b;
|
240
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
234
241
|
return;
|
235
242
|
if (isActive) {
|
236
243
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
237
244
|
eventName: 'ViewContent'
|
238
245
|
});
|
239
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
246
|
+
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
240
247
|
}
|
241
248
|
else {
|
242
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
|
249
|
+
(_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.pause();
|
243
250
|
}
|
244
|
-
}, [isActive, isLoadFinish, videoRef]);
|
251
|
+
}, [isActive, isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
245
252
|
useEffect(() => {
|
246
|
-
|
253
|
+
var _a, _b, _c;
|
254
|
+
if (!isActive || !(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
247
255
|
return;
|
248
|
-
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused;
|
256
|
+
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
249
257
|
if (!isPause && openHashtag) {
|
250
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
|
258
|
+
(_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.pause();
|
251
259
|
}
|
252
260
|
else if (!openHashtag) {
|
253
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.play();
|
261
|
+
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.play();
|
254
262
|
}
|
255
|
-
}, [openHashtag, isActive, videoRef]);
|
263
|
+
}, [openHashtag, isActive, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
|
256
264
|
useEffect(() => {
|
257
265
|
if (!isActive)
|
258
266
|
return;
|
@@ -299,11 +307,11 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
299
307
|
}, src: loading_gif, alt: 'placeholder image' }));
|
300
308
|
}, [waiting, isLoadFinish]);
|
301
309
|
useEffect(() => {
|
302
|
-
if (!videoRef)
|
310
|
+
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
303
311
|
return;
|
304
312
|
const handleBeforeUnload = () => {
|
305
313
|
var _a;
|
306
|
-
if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) && videoRef && !isPauseVideo) {
|
314
|
+
if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) && !isPauseVideo) {
|
307
315
|
handleClickVideo('pause')();
|
308
316
|
}
|
309
317
|
};
|
@@ -311,7 +319,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
311
319
|
return () => {
|
312
320
|
window.removeEventListener('beforeunload', handleBeforeUnload);
|
313
321
|
};
|
314
|
-
}, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
|
322
|
+
}, [activeIndex, index, rec, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current, handleClickVideo, isPauseVideo]);
|
315
323
|
if (!(rec === null || rec === void 0 ? void 0 : rec.video)) {
|
316
324
|
return null;
|
317
325
|
}
|
@@ -26,14 +26,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
26
26
|
const { schema } = useEditor();
|
27
27
|
const [activeIndex, setActiveIndex] = useState(0);
|
28
28
|
const viewImageStartTime = useRef(0);
|
29
|
-
const [isInit, setIsInit] = useState(false);
|
30
29
|
const [isMuted, setIsMuted] = useState(true);
|
31
30
|
const viewTime = useRef();
|
32
31
|
const [isLoadMore, setIsLoadMore] = useState(false);
|
33
32
|
const [isShowMore, setIsShowMore] = useState(false);
|
34
33
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag } = useSxpDataSource();
|
35
34
|
const { backMainFeed } = useEventReport();
|
36
|
-
const videoRef = useRef();
|
37
35
|
const { productView } = useEventReport();
|
38
36
|
const isShowFingerTip = useMemo(() => {
|
39
37
|
return data.length > 0 && !loading && getFeUserId();
|
@@ -61,16 +59,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
61
59
|
});
|
62
60
|
}
|
63
61
|
}, [data.length, bffFbReport, h5EnterLink]);
|
64
|
-
const firstRef = useRef();
|
65
|
-
useEffect(() => {
|
66
|
-
var _a, _b, _c, _d;
|
67
|
-
if (!firstRef.current && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
|
68
|
-
firstRef.current = true;
|
69
|
-
if ((_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url) {
|
70
|
-
videoRef.current.src = (_d = (_c = data === null || data === void 0 ? void 0 : data[0]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.url;
|
71
|
-
}
|
72
|
-
}
|
73
|
-
}, [videoRef, data]);
|
74
62
|
useEffect(() => {
|
75
63
|
var _a;
|
76
64
|
const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
|
@@ -168,11 +156,14 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
168
156
|
}
|
169
157
|
return h;
|
170
158
|
}, [tagList, waterFallData]);
|
171
|
-
const
|
159
|
+
const minusHeight = useMemo(() => {
|
172
160
|
let minusHeight = 0;
|
173
161
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
174
162
|
minusHeight += 45;
|
175
163
|
}
|
164
|
+
return minusHeight;
|
165
|
+
}, []);
|
166
|
+
const height = useMemo(() => {
|
176
167
|
return containerHeight - minusHeight - tagHeight;
|
177
168
|
}, [globalConfig, containerHeight, tagHeight]);
|
178
169
|
const renderLogo = useMemo(() => {
|
@@ -185,7 +176,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
185
176
|
const renderContent = useCallback((rec, index) => {
|
186
177
|
var _a, _b, _c, _d;
|
187
178
|
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
188
|
-
return (React.createElement(VideoWidget, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost,
|
179
|
+
return (React.createElement(VideoWidget, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon }));
|
189
180
|
}
|
190
181
|
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
191
182
|
return (React.createElement(PictureGroup, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
@@ -211,8 +202,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
211
202
|
viewTime,
|
212
203
|
tipText,
|
213
204
|
resolver,
|
214
|
-
schema
|
215
|
-
videoRef.current
|
205
|
+
schema
|
216
206
|
]);
|
217
207
|
const onExpandableChange = useCallback((v) => {
|
218
208
|
setIsShowMore(v);
|
@@ -405,7 +395,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
405
395
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
406
396
|
} })),
|
407
397
|
renderLogo,
|
408
|
-
React.createElement(Tagbar, { tagList: tagList, setActiveIndex: setActiveIndex
|
398
|
+
React.createElement(Tagbar, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
|
399
|
+
top: minusHeight
|
400
|
+
} }),
|
409
401
|
isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 + ((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _a !== void 0 ? _a : 0)}%` } })) : null,
|
410
402
|
React.createElement(Swiper, { style: {
|
411
403
|
marginTop: tagHeight
|
@@ -438,15 +430,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
438
430
|
[(_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _f !== void 0 ? _f : 'bottom']: (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _g !== void 0 ? _g : 23
|
439
431
|
}, defaultValue: isMuted, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon, onChange: setIsMuted }),
|
440
432
|
renderView),
|
441
|
-
React.createElement(WaterFall, Object.assign({}, (_k = (_j = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.item) === null || _k === void 0 ? void 0 : _k.props))
|
442
|
-
React.createElement("div", { style: { position: 'absolute', zIndex: -100 } },
|
443
|
-
React.createElement("video", { ref: videoRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', preload: 'auto', controls: false, muted: true, style: {
|
444
|
-
backgroundColor: 'transparent',
|
445
|
-
width: '100%',
|
446
|
-
height: '100%',
|
447
|
-
objectFit: 'cover',
|
448
|
-
pointerEvents: 'none'
|
449
|
-
} }),
|
450
|
-
React.createElement("div", { id: 'player-container-id-copy' }))));
|
433
|
+
React.createElement(WaterFall, Object.assign({}, (_k = (_j = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.item) === null || _k === void 0 ? void 0 : _k.props))));
|
451
434
|
};
|
452
435
|
export default SxpPageRender;
|
@@ -18,12 +18,12 @@ export default [
|
|
18
18
|
child: [
|
19
19
|
{
|
20
20
|
type: 'Select',
|
21
|
-
name: ['
|
21
|
+
name: ['textStyle', 'fontFamily-cn'],
|
22
22
|
bottomText: '中文字体'
|
23
23
|
},
|
24
24
|
{
|
25
25
|
type: 'Select',
|
26
|
-
name: ['
|
26
|
+
name: ['textStyle', 'fontFamily-en'],
|
27
27
|
bottomText: '英文/其他字体'
|
28
28
|
}
|
29
29
|
]
|
@@ -81,9 +81,10 @@ const CommodityDetail = (_a) => {
|
|
81
81
|
};
|
82
82
|
const renderBtn = () => {
|
83
83
|
var _a, _b;
|
84
|
-
return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle,
|
85
|
-
|
86
|
-
|
84
|
+
return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle },
|
85
|
+
React.createElement("span", { dangerouslySetInnerHTML: {
|
86
|
+
__html: setFontForText((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
|
87
|
+
} })))));
|
87
88
|
};
|
88
89
|
const getStyle = useCallback((style) => {
|
89
90
|
if (style === null || style === void 0 ? void 0 : style.lineClamp) {
|
@@ -156,9 +156,10 @@ Made in Italy` })));
|
|
156
156
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
|
157
157
|
__html: setFontForText((_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
|
158
158
|
} }))),
|
159
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle,
|
160
|
-
|
161
|
-
|
159
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
|
160
|
+
React.createElement("span", { dangerouslySetInnerHTML: {
|
161
|
+
__html: setFontForText((_p = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _p !== void 0 ? _p : 'Shop now', buttonStyle)
|
162
|
+
} }))),
|
162
163
|
productInfoText({ isPost }))),
|
163
164
|
React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
164
165
|
};
|