pb-sxp-ui 1.0.32 → 1.0.34

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.
Files changed (36) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +111 -111
  3. package/dist/index.cjs +372 -28
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.css +0 -1
  6. package/dist/index.js +371 -28
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.min.cjs +3 -3
  9. package/dist/index.min.cjs.map +1 -1
  10. package/dist/index.min.js +3 -3
  11. package/dist/index.min.js.map +1 -1
  12. package/dist/pb-ui.js +372 -28
  13. package/dist/pb-ui.js.map +1 -1
  14. package/dist/pb-ui.min.js +3 -3
  15. package/dist/pb-ui.min.js.map +1 -1
  16. package/es/core/components/DiyPortalPreview/PictureGroup.d.ts +13 -0
  17. package/es/core/components/DiyPortalPreview/PictureGroup.js +11 -0
  18. package/es/core/components/DiyPortalPreview/VideoWidget.d.ts +15 -0
  19. package/es/core/components/DiyPortalPreview/VideoWidget.js +236 -0
  20. package/es/core/components/DiyPortalPreview/index.d.ts +4 -0
  21. package/es/core/components/DiyPortalPreview/index.js +110 -0
  22. package/es/index.d.ts +1 -0
  23. package/es/index.js +1 -0
  24. package/es/materials/sxp/popup/CommodityDetail/index.js +10 -10
  25. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
  26. package/lib/core/components/DiyPortalPreview/PictureGroup.d.ts +13 -0
  27. package/lib/core/components/DiyPortalPreview/PictureGroup.js +14 -0
  28. package/lib/core/components/DiyPortalPreview/VideoWidget.d.ts +15 -0
  29. package/lib/core/components/DiyPortalPreview/VideoWidget.js +239 -0
  30. package/lib/core/components/DiyPortalPreview/index.d.ts +4 -0
  31. package/lib/core/components/DiyPortalPreview/index.js +113 -0
  32. package/lib/index.d.ts +1 -0
  33. package/lib/index.js +3 -1
  34. package/lib/materials/sxp/popup/CommodityDetail/index.js +10 -10
  35. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
  36. package/package.json +115 -115
@@ -0,0 +1,239 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const react_1 = tslib_1.__importStar(require("react"));
5
+ const hls_js_1 = tslib_1.__importDefault(require("hls.js"));
6
+ const useIconLink_1 = require("../SxpPageRender/useIconLink");
7
+ const FormatImage_1 = tslib_1.__importDefault(require("../SxpPageRender/FormatImage"));
8
+ const hooks_1 = require("../../../core/hooks");
9
+ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
10
+ const [isPauseVideo, setIsPauseVideo] = (0, react_1.useState)(false);
11
+ const videoRef = (0, react_1.useRef)(null);
12
+ const { bffEventReport, sxpParameter, waterFallData, openHashtag } = (0, hooks_1.useSxpDataSource)();
13
+ const videoStartTime = (0, react_1.useRef)(0);
14
+ const [isLoadFinish, setIsLoadFinish] = (0, react_1.useState)(false);
15
+ const [isFirstPlay, setIsFirstPlay] = (0, react_1.useState)(true);
16
+ const canvasRef = (0, react_1.useRef)(null);
17
+ const [firstFrameSrc, setFirstFrameSrc] = (0, react_1.useState)('');
18
+ (0, react_1.useEffect)(() => {
19
+ if (!videoRef.current)
20
+ return;
21
+ videoRef.current.muted = muted;
22
+ }, [muted]);
23
+ const handleVideoStart = (0, react_1.useCallback)(() => {
24
+ var _a;
25
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
26
+ }, []);
27
+ const PAUSE_ICON = (0, useIconLink_1.useIconLink)('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
28
+ const handlePlaying = (0, react_1.useCallback)(() => {
29
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
30
+ setIsPauseVideo(false);
31
+ const item = data[index];
32
+ if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
33
+ videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
34
+ const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
35
+ const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
36
+ const playType = isFirstPlay ? '0' : '1';
37
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
38
+ eventInfo: {
39
+ eventSubject: 'playVideo',
40
+ eventDescription: 'User played the video',
41
+ contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
42
+ contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
43
+ playType,
44
+ startTime: videoCurrentTime,
45
+ videoDuration,
46
+ contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
47
+ position: index + '',
48
+ contentFormat: 'video',
49
+ traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
50
+ }
51
+ });
52
+ setIsFirstPlay(false);
53
+ }
54
+ }, [bffEventReport, data, index, isFirstPlay]);
55
+ const handleLoadedMetadata = (0, react_1.useCallback)(() => {
56
+ setIsLoadFinish(true);
57
+ }, []);
58
+ const handleClickVideo = (0, react_1.useCallback)((type) => () => {
59
+ var _a, _b, _c, _d, _e;
60
+ if (!isLoadFinish)
61
+ return;
62
+ const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
63
+ switch (type) {
64
+ case 'start':
65
+ if (!isPause)
66
+ return;
67
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
68
+ setIsPauseVideo(false);
69
+ break;
70
+ case 'pause':
71
+ if (isPause)
72
+ return;
73
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
74
+ setIsPauseVideo(true);
75
+ break;
76
+ default:
77
+ if (isPause) {
78
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
79
+ }
80
+ else {
81
+ (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
82
+ }
83
+ setIsPauseVideo(!isPause);
84
+ break;
85
+ }
86
+ }, [isLoadFinish]);
87
+ const onPause = (0, react_1.useCallback)(() => {
88
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
89
+ const item = data[index];
90
+ const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
91
+ const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
92
+ if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
93
+ const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
94
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
95
+ eventInfo: {
96
+ eventSubject: 'playOverVideo',
97
+ eventDescription: 'User finished playing the video',
98
+ contentId: (_h = (_g = item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
99
+ contentName: (_k = (_j = item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
100
+ endTime: videoCurrentTime,
101
+ videoDuration,
102
+ playDuration,
103
+ contentTags: JSON.stringify((_m = (_l = item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
104
+ position: index + '',
105
+ contentFormat: 'video',
106
+ traceInfo: (_o = item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
107
+ }
108
+ });
109
+ }
110
+ }, [data, index, bffEventReport]);
111
+ const blur = (0, react_1.useMemo)(() => {
112
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
113
+ }, [videoPostConfig]);
114
+ const translateY = (0, react_1.useMemo)(() => {
115
+ var _a;
116
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
117
+ ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
118
+ : 'translateY(-50%)';
119
+ }, [videoPostConfig]);
120
+ const blurBgSrc = (0, react_1.useMemo)(() => {
121
+ var _a;
122
+ return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
123
+ }, [firstFrameSrc, rec]);
124
+ const handLoadeddata = (0, react_1.useCallback)(() => {
125
+ if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
126
+ return;
127
+ const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
128
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
129
+ const ctx = canvas.getContext('2d');
130
+ const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
131
+ const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
132
+ canvas.height = targetHeight;
133
+ canvas.width = targetWidth;
134
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
135
+ setFirstFrameSrc(canvas.toDataURL());
136
+ }, []);
137
+ (0, react_1.useEffect)(() => {
138
+ var _a, _b, _c, _d;
139
+ if (!videoRef.current)
140
+ return;
141
+ setIsPauseVideo(false);
142
+ if (!videoRef.current.src) {
143
+ const videoSrc = rec.video.url;
144
+ if (videoSrc.includes('.m3u8')) {
145
+ if (hls_js_1.default.isSupported()) {
146
+ const hls = new hls_js_1.default();
147
+ hls.loadSource(videoSrc);
148
+ hls.attachMedia(videoRef.current);
149
+ }
150
+ else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
151
+ videoRef.current.src = videoSrc;
152
+ }
153
+ else {
154
+ videoRef.current.src = videoSrc;
155
+ }
156
+ }
157
+ else {
158
+ videoRef.current.src = videoSrc;
159
+ }
160
+ videoRef.current.setAttribute('x5-playsinline', 'true');
161
+ videoRef.current.setAttribute('webkit-playsinline', 'true');
162
+ }
163
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
164
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
165
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
166
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
167
+ return () => {
168
+ var _a, _b, _c, _d;
169
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
170
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
171
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
172
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
173
+ };
174
+ }, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
175
+ const renderPoster = (0, react_1.useMemo)(() => {
176
+ if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
177
+ return null;
178
+ }
179
+ return (react_1.default.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image }));
180
+ }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
181
+ (0, react_1.useEffect)(() => {
182
+ const handleBeforeUnload = () => {
183
+ var _a, _b;
184
+ if (activeIndex === index && ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.src) && !isPauseVideo) {
185
+ handleClickVideo('pause')();
186
+ }
187
+ };
188
+ window.addEventListener('beforeunload', handleBeforeUnload);
189
+ return () => {
190
+ window.removeEventListener('beforeunload', handleBeforeUnload);
191
+ };
192
+ }, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
193
+ const blurStyle = (0, react_1.useMemo)(() => {
194
+ return blur
195
+ ? {
196
+ filter: 'blur(10px)',
197
+ transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
198
+ }
199
+ : {};
200
+ }, [blur]);
201
+ if (!rec.video) {
202
+ return null;
203
+ }
204
+ return (react_1.default.createElement(react_1.default.Fragment, null, blur ? (react_1.default.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
205
+ position: 'relative',
206
+ width,
207
+ height,
208
+ overflow: 'hidden'
209
+ } },
210
+ react_1.default.createElement(FormatImage_1.default, { src: blurBgSrc, style: Object.assign({ height,
211
+ width, objectFit: 'cover' }, blurStyle) }),
212
+ react_1.default.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
213
+ react_1.default.createElement("div", { style: {
214
+ position: 'absolute',
215
+ width,
216
+ height,
217
+ top: '50%',
218
+ transform: translateY,
219
+ left: 0,
220
+ right: 0
221
+ } },
222
+ react_1.default.createElement("div", { style: { position: 'relative', width, height: '100%' } },
223
+ react_1.default.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
224
+ width: '100%',
225
+ height,
226
+ objectFit: 'contain'
227
+ } }),
228
+ react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
229
+ renderPoster)) : (react_1.default.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
230
+ position: 'relative',
231
+ width,
232
+ height,
233
+ overflow: 'hidden'
234
+ } },
235
+ react_1.default.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
236
+ renderPoster,
237
+ react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
238
+ };
239
+ exports.default = (0, react_1.memo)(VideoWidget);
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ISxpPageRenderProps } from '../SxpPageRender';
3
+ declare const _default: React.NamedExoticComponent<ISxpPageRenderProps>;
4
+ export default _default;
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const react_1 = tslib_1.__importStar(require("react"));
5
+ const Nudge_1 = tslib_1.__importDefault(require("../SxpPageRender/Nudge"));
6
+ const RenderCard_1 = tslib_1.__importDefault(require("../SxpPageRender/RenderCard"));
7
+ const ExpandableText_1 = tslib_1.__importDefault(require("../SxpPageRender/ExpandableText"));
8
+ const Hashtag_1 = tslib_1.__importDefault(require("../SxpPageRender/Hashtag"));
9
+ const LikeButton_1 = tslib_1.__importDefault(require("../SxpPageRender/LikeButton"));
10
+ const ToggleButton_1 = tslib_1.__importDefault(require("../SxpPageRender/ToggleButton"));
11
+ const useIconLink_1 = require("../SxpPageRender/useIconLink");
12
+ const PictureGroup_1 = tslib_1.__importDefault(require("./PictureGroup"));
13
+ const VideoWidget_1 = tslib_1.__importDefault(require("./VideoWidget"));
14
+ const _materials_ = tslib_1.__importStar(require("../../../materials"));
15
+ const withBindDataSource_1 = tslib_1.__importDefault(require("../../../core/hoc/withBindDataSource"));
16
+ const RESOLVER = {};
17
+ Object.values(_materials_).forEach((v) => {
18
+ RESOLVER[v.extend.type] = v;
19
+ });
20
+ const DiyPortalPreview = ({ data, globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle }) => {
21
+ const containerWidth = 375;
22
+ const containerHeight = 664;
23
+ const height = (0, react_1.useMemo)(() => {
24
+ return (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo) ? containerHeight - 45 : containerHeight;
25
+ }, [globalConfig, containerHeight]);
26
+ const renderContent = (rec, index) => {
27
+ var _a, _b, _c, _d;
28
+ if ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.url) {
29
+ return (react_1.default.createElement(VideoWidget_1.default, { rec: rec, index: index, muted: true, width: containerWidth, data: data !== null && data !== void 0 ? data : [], height: height, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost }));
30
+ }
31
+ if ((_b = rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
32
+ return (react_1.default.createElement(PictureGroup_1.default, { key: rec.video.itemId, imgUrls: rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
33
+ }
34
+ if (rec.product) {
35
+ if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
36
+ return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
37
+ var _a, _b, _c, _d, _e, _f, _g, _h;
38
+ const t = RESOLVER[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
39
+ const Component = (0, withBindDataSource_1.default)(t);
40
+ const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
41
+ return (react_1.default.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, id: value === null || value === void 0 ? void 0 : value.id, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { width: containerWidth, height, overflow: 'auto' }), index: index })));
42
+ });
43
+ }
44
+ }
45
+ };
46
+ const renderLogo = (0, react_1.useMemo)(() => {
47
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
48
+ return (react_1.default.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
49
+ react_1.default.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
50
+ }
51
+ return null;
52
+ }, [globalConfig]);
53
+ const renderBottom = (rec, index) => {
54
+ var _a, _b, _c, _d, _e, _f, _g;
55
+ if (rec.video) {
56
+ return (react_1.default.createElement(react_1.default.Fragment, null,
57
+ ((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && react_1.default.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
58
+ react_1.default.createElement("div", { className: 'clc-sxp-bottom' },
59
+ react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
60
+ react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
61
+ react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER })),
62
+ react_1.default.createElement("div", null,
63
+ react_1.default.createElement(ExpandableText_1.default, { 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: (_c = (_b = rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', 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' }) })),
64
+ react_1.default.createElement(Hashtag_1.default, { index: index, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
65
+ }
66
+ return null;
67
+ };
68
+ const renderLikeButton = (rec, index) => {
69
+ var _a, _b;
70
+ if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
71
+ return;
72
+ let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
73
+ if (top < 40) {
74
+ top += 40;
75
+ }
76
+ if (rec.video) {
77
+ return (react_1.default.createElement(LikeButton_1.default, { key: rec.position, activeIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon, unActicveIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon, position: index, active: rec.isCollected, recData: rec, className: 'clc-sxp-like-button', style: {
78
+ top,
79
+ right: (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _b !== void 0 ? _b : 0
80
+ } }));
81
+ }
82
+ return null;
83
+ };
84
+ const mutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
85
+ const unmutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
86
+ const renderView = (rec, index) => {
87
+ var _a, _b, _c, _d;
88
+ return (react_1.default.createElement("div", { style: { position: 'relative' } },
89
+ renderLogo,
90
+ react_1.default.createElement(ToggleButton_1.default, { style: {
91
+ position: 'absolute',
92
+ right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
93
+ visibility: ((_c = (_b = data === null || data === void 0 ? void 0 : data[index]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
94
+ bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
95
+ zIndex: 999
96
+ }, defaultValue: true, 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 }),
97
+ renderContent(rec, index),
98
+ renderBottom(rec, index),
99
+ renderLikeButton(rec, index)));
100
+ };
101
+ return (react_1.default.createElement("div", { style: {
102
+ width: '100%',
103
+ height: containerHeight,
104
+ display: 'flex',
105
+ boxSizing: 'border-box',
106
+ gap: 16,
107
+ pointerEvents: 'none',
108
+ userSelect: 'none'
109
+ } }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
110
+ return renderView(rec, index);
111
+ })));
112
+ };
113
+ exports.default = (0, react_1.memo)(DiyPortalPreview);
package/lib/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import { Pagebuilder } from './core/Pagebuilder';
2
2
  export * as core from './core';
3
3
  export * as materials from './materials';
4
4
  export { default as SxpPageRender } from './core/components/SxpPageRender';
5
+ export { default as DiyPortalPreview } from './core/components/DiyPortalPreview';
5
6
  export { default as Modal } from './core/components/SxpPageRender/Modal';
6
7
  export { default as SxpDataSourceProvider } from './core/context/SxpDataSourceProvider';
7
8
  export { default as SxpPageCore } from './core/components/SxpPageCore';
package/lib/index.js CHANGED
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultSetting = exports.useEditorDataProvider = exports.EditorDataProvider = exports.SxpPageCore = exports.SxpDataSourceProvider = exports.Modal = exports.SxpPageRender = exports.materials = exports.core = void 0;
3
+ exports.defaultSetting = exports.useEditorDataProvider = exports.EditorDataProvider = exports.SxpPageCore = exports.SxpDataSourceProvider = exports.Modal = exports.DiyPortalPreview = exports.SxpPageRender = exports.materials = exports.core = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const Pagebuilder_1 = require("./core/Pagebuilder");
6
6
  exports.core = tslib_1.__importStar(require("./core"));
7
7
  exports.materials = tslib_1.__importStar(require("./materials"));
8
8
  var SxpPageRender_1 = require("./core/components/SxpPageRender");
9
9
  Object.defineProperty(exports, "SxpPageRender", { enumerable: true, get: function () { return tslib_1.__importDefault(SxpPageRender_1).default; } });
10
+ var DiyPortalPreview_1 = require("./core/components/DiyPortalPreview");
11
+ Object.defineProperty(exports, "DiyPortalPreview", { enumerable: true, get: function () { return tslib_1.__importDefault(DiyPortalPreview_1).default; } });
10
12
  var Modal_1 = require("./core/components/SxpPageRender/Modal");
11
13
  Object.defineProperty(exports, "Modal", { enumerable: true, get: function () { return tslib_1.__importDefault(Modal_1).default; } });
12
14
  var SxpDataSourceProvider_1 = require("./core/context/SxpDataSourceProvider");
@@ -12,7 +12,7 @@ const Modal_1 = tslib_1.__importDefault(require("../../../../core/components/Sxp
12
12
  const ExpandableText_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/ExpandableText"));
13
13
  const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
14
14
  const CommodityDetail = (_a) => {
15
- var _b, _c, _d, _e, _f, _g, _h, _j;
15
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k;
16
16
  var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index"]);
17
17
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
18
18
  const { popupDetailData, bffEventReport, isPreview, waterFallData } = (0, hooks_1.useSxpDataSource)();
@@ -53,7 +53,7 @@ const CommodityDetail = (_a) => {
53
53
  return '$7,000';
54
54
  }
55
55
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
56
- const width = isPreview ? 375 : window.innerWidth;
56
+ const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
57
57
  const renderContent = ({ isPost }) => {
58
58
  var _a, _b, _c;
59
59
  return (react_1.default.createElement("div", null,
@@ -61,10 +61,10 @@ const CommodityDetail = (_a) => {
61
61
  react_1.default.createElement("div", { className: 'pb-commondity-content-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.title) }, (_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium'),
62
62
  react_1.default.createElement("div", { className: 'pb-commondity-content-price', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price) }, priceText),
63
63
  react_1.default.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
64
- react_1.default.createElement(ExpandableText_1.default, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
65
- bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
66
- collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
67
- necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
64
+ react_1.default.createElement(ExpandableText_1.default, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
65
+ bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
66
+ collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
67
+ necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
68
68
  18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info }))));
69
69
  };
70
70
  const renderBtn = () => {
@@ -73,7 +73,7 @@ const CommodityDetail = (_a) => {
73
73
  };
74
74
  return (react_1.default.createElement("div", { className: 'pb-commondity' },
75
75
  react_1.default.createElement("div", Object.assign({ className: (0, css_1.css)(Object.assign({}, style)) }, props),
76
- product && ((_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: width, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
76
+ product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: width, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
77
77
  clickable: true,
78
78
  bulletActiveClass: 'swipe-item-active-bullet',
79
79
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -81,7 +81,7 @@ const CommodityDetail = (_a) => {
81
81
  : 'commondityDetail-swiper-clickable-center'
82
82
  }, loop: true, autoplay: {
83
83
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
84
- } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
84
+ } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
85
85
  return (react_1.default.createElement(react_2.SwiperSlide, { key: src },
86
86
  react_1.default.createElement("div", { style: {
87
87
  overflow: 'hidden',
@@ -90,7 +90,7 @@ const CommodityDetail = (_a) => {
90
90
  } },
91
91
  react_1.default.createElement(FormatImage_1.default, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
92
92
  }))),
93
- !((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
93
+ !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
94
94
  position: 'relative',
95
95
  height: 0,
96
96
  width: '100%',
@@ -103,7 +103,7 @@ const CommodityDetail = (_a) => {
103
103
  top: 0,
104
104
  objectFit: 'cover',
105
105
  width: '100%'
106
- }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
106
+ }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
107
107
  react_1.default.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
108
108
  renderBtn(),
109
109
  react_1.default.createElement(Modal_1.default, { visible: showModal, onClose: () => setShowModal(false) },
@@ -12,7 +12,7 @@ const ExpandableText_1 = tslib_1.__importDefault(require("../../../../core/compo
12
12
  const useEventReport_1 = require("../../../../core/hooks/useEventReport");
13
13
  const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
14
14
  const CommodityDetailDiroNew = (_a) => {
15
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
15
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
16
16
  var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
17
17
  const [spread, setSpread] = (0, react_1.useState)(true);
18
18
  const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
@@ -60,7 +60,7 @@ const CommodityDetailDiroNew = (_a) => {
60
60
  return '£102,300.00';
61
61
  }
62
62
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
63
- const width = isPreview ? 375 : window.innerWidth;
63
+ const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
64
64
  const handleClickCollapse = () => {
65
65
  setSpread(!spread);
66
66
  };
@@ -86,12 +86,12 @@ const CommodityDetailDiroNew = (_a) => {
86
86
  const productInfoText = ({ isPost }) => {
87
87
  return (react_1.default.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
88
88
  react_1.default.createElement(ExpandableText_1.default, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
89
- `Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
89
+ `Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
90
90
  Made in Italy` })));
91
91
  };
92
92
  return (react_1.default.createElement("div", { className: 'pb-commondityDiroNew' },
93
93
  react_1.default.createElement("div", Object.assign({ ref: scrollRef, className: (0, css_1.css)(Object.assign({}, style)) }, props),
94
- product && ((_f = product === null || product === void 0 ? void 0 : product.homePage) === null || _f === void 0 ? void 0 : _f.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: width, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
94
+ product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: width, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
95
95
  clickable: true,
96
96
  bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
97
97
  clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
@@ -99,7 +99,7 @@ Made in Italy` })));
99
99
  : 'commondityDiroNew-swiper-clickable-center'
100
100
  }, loop: true, autoplay: {
101
101
  delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
102
- } }, (_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.map((src) => {
102
+ } }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
103
103
  return (react_1.default.createElement(react_2.SwiperSlide, { key: src },
104
104
  react_1.default.createElement("div", { style: {
105
105
  overflow: 'hidden',
@@ -108,7 +108,7 @@ Made in Italy` })));
108
108
  } },
109
109
  react_1.default.createElement(FormatImage_1.default, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
110
110
  }))),
111
- !((_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
111
+ !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
112
112
  position: 'relative',
113
113
  height: 0,
114
114
  width: '100%',
@@ -121,16 +121,16 @@ Made in Italy` })));
121
121
  top: 0,
122
122
  objectFit: 'cover',
123
123
  width: '100%'
124
- }), src: (_j = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _j !== void 0 ? _j : bottom_image, alt: '' }))),
124
+ }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
125
125
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content' },
126
126
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
127
127
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
128
- react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_k = product === null || product === void 0 ? void 0 : product.title) !== null && _k !== void 0 ? _k : 'Large Dior Toujours Bag'),
128
+ react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_l = product === null || product === void 0 ? void 0 : product.title) !== null && _l !== void 0 ? _l : 'Large Dior Toujours Bag'),
129
129
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection }, (product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage Calfskin')),
130
130
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
131
131
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price }, priceText),
132
- react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo }, (_l = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _l !== void 0 ? _l : '税费'))),
133
- (!product || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_m = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _m !== void 0 ? _m : 'Shop now')),
132
+ react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo }, (_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费'))),
133
+ (!product || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now')),
134
134
  productInfoText({ isPost }))),
135
135
  react_1.default.createElement(Modal_1.default, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
136
136
  };