pb-sxp-ui 1.0.40 → 1.0.42
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/LICENSE +21 -21
- package/README.md +111 -111
- package/dist/index.cjs +560 -156
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +56 -4
- package/dist/index.js +559 -156
- 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 +563 -160
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyPortalPreview/PictureGroup.d.ts +13 -0
- package/es/core/components/DiyPortalPreview/PictureGroup.js +11 -0
- package/es/core/components/DiyPortalPreview/VideoWidget.d.ts +15 -0
- package/es/core/components/DiyPortalPreview/VideoWidget.js +236 -0
- package/es/core/components/DiyPortalPreview/index.d.ts +6 -0
- package/es/core/components/DiyPortalPreview/index.js +127 -0
- package/es/core/components/SxpPageCore/index.js +2 -2
- package/es/core/components/SxpPageRender/Nudge/index.js +6 -5
- package/es/core/components/SxpPageRender/PictureGroup/Picture.js +1 -0
- package/es/core/components/SxpPageRender/Tagbar.d.ts +7 -0
- package/es/core/components/SxpPageRender/Tagbar.js +37 -0
- package/es/core/components/SxpPageRender/VideoWidget/index.js +46 -79
- package/es/core/components/SxpPageRender/WaterFall/index.js +1 -1
- package/es/core/components/SxpPageRender/index.d.ts +2 -0
- package/es/core/components/SxpPageRender/index.js +22 -18
- package/es/core/context/SxpDataSourceProvider.d.ts +3 -0
- package/es/core/context/SxpDataSourceProvider.js +29 -5
- package/es/core/hooks/useEventReport.js +4 -4
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +10 -10
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
- package/lib/core/components/DiyPortalPreview/PictureGroup.d.ts +13 -0
- package/lib/core/components/DiyPortalPreview/PictureGroup.js +14 -0
- package/lib/core/components/DiyPortalPreview/VideoWidget.d.ts +15 -0
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +239 -0
- package/lib/core/components/DiyPortalPreview/index.d.ts +6 -0
- package/lib/core/components/DiyPortalPreview/index.js +130 -0
- package/lib/core/components/SxpPageCore/index.js +2 -2
- package/lib/core/components/SxpPageRender/Nudge/index.js +6 -5
- package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +1 -0
- package/lib/core/components/SxpPageRender/Tagbar.d.ts +7 -0
- package/lib/core/components/SxpPageRender/Tagbar.js +40 -0
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +46 -79
- package/lib/core/components/SxpPageRender/WaterFall/index.js +1 -1
- package/lib/core/components/SxpPageRender/index.d.ts +2 -0
- package/lib/core/components/SxpPageRender/index.js +22 -18
- package/lib/core/context/SxpDataSourceProvider.d.ts +3 -0
- package/lib/core/context/SxpDataSourceProvider.js +29 -5
- package/lib/core/hooks/useEventReport.js +4 -4
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +10 -10
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +10 -10
- package/package.json +115 -114
@@ -14,13 +14,12 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
14
14
|
const { isActive } = useSwiperSlide();
|
15
15
|
const canvasRef = useRef(null);
|
16
16
|
const [firstFrameSrc, setFirstFrameSrc] = useState('');
|
17
|
-
const videoId = `pb-video-${index}`;
|
18
17
|
useEffect(() => {
|
19
18
|
if (!videoRef.current)
|
20
19
|
return;
|
21
|
-
videoRef.current.muted
|
20
|
+
videoRef.current.muted = muted;
|
22
21
|
}, [muted]);
|
23
|
-
const
|
22
|
+
const handleVideoStart = useCallback(() => {
|
24
23
|
var _a;
|
25
24
|
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
26
25
|
}, []);
|
@@ -29,10 +28,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
29
28
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
30
29
|
setIsPauseVideo(false);
|
31
30
|
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
|
34
|
-
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration
|
35
|
-
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime
|
31
|
+
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
32
|
+
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
33
|
+
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
34
|
+
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
36
35
|
const playType = isFirstPlay ? '0' : '1';
|
37
36
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
38
37
|
eventInfo: {
|
@@ -52,15 +51,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
52
51
|
setIsFirstPlay(false);
|
53
52
|
}
|
54
53
|
}, [bffEventReport, data, index, isFirstPlay]);
|
55
|
-
const
|
56
|
-
handLoadeddata();
|
54
|
+
const handleLoadedMetadata = useCallback(() => {
|
57
55
|
setIsLoadFinish(true);
|
58
56
|
}, []);
|
59
57
|
const handleClickVideo = useCallback((type) => () => {
|
60
58
|
var _a, _b, _c, _d, _e;
|
61
59
|
if (!isLoadFinish)
|
62
60
|
return;
|
63
|
-
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused
|
61
|
+
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
64
62
|
switch (type) {
|
65
63
|
case 'start':
|
66
64
|
if (!isPause)
|
@@ -85,13 +83,13 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
85
83
|
break;
|
86
84
|
}
|
87
85
|
}, [isLoadFinish]);
|
88
|
-
const
|
86
|
+
const onPause = useCallback(() => {
|
89
87
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
90
88
|
const item = data[index];
|
91
|
-
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration
|
92
|
-
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime
|
93
|
-
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration
|
94
|
-
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime
|
89
|
+
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
90
|
+
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
91
|
+
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
92
|
+
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
95
93
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
96
94
|
eventInfo: {
|
97
95
|
eventSubject: 'playOverVideo',
|
@@ -123,64 +121,41 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
123
121
|
return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
|
124
122
|
}, [firstFrameSrc, rec]);
|
125
123
|
const handLoadeddata = useCallback(() => {
|
126
|
-
|
127
|
-
const videoDomRef = document.getElementById(`${videoId}_html5_api`);
|
128
|
-
if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
|
124
|
+
if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
|
129
125
|
return;
|
130
|
-
const
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
setFirstFrameSrc(canvas.toDataURL());
|
140
|
-
};
|
141
|
-
setFrameImg();
|
142
|
-
setTimeout(() => {
|
143
|
-
setFrameImg();
|
144
|
-
}, 500);
|
126
|
+
const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
|
127
|
+
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
128
|
+
const ctx = canvas.getContext('2d');
|
129
|
+
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
130
|
+
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
131
|
+
canvas.height = targetHeight;
|
132
|
+
canvas.width = targetWidth;
|
133
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
134
|
+
setFirstFrameSrc(canvas.toDataURL());
|
145
135
|
}, []);
|
146
136
|
useEffect(() => {
|
147
|
-
var _a, _b, _c, _d
|
137
|
+
var _a, _b, _c, _d;
|
138
|
+
if (!videoRef.current)
|
139
|
+
return;
|
148
140
|
setIsPauseVideo(false);
|
149
|
-
|
150
|
-
|
151
|
-
videoRef.current =
|
152
|
-
|
153
|
-
|
154
|
-
src: videoSrc
|
155
|
-
}
|
156
|
-
],
|
157
|
-
licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1325816236_1/v_cube.license',
|
158
|
-
controls: false,
|
159
|
-
autoplay: false,
|
160
|
-
loop: false,
|
161
|
-
muted: true,
|
162
|
-
preload: 'auto',
|
163
|
-
posterImage: false,
|
164
|
-
bigPlayButton: true
|
165
|
-
});
|
166
|
-
videoRef.current.play();
|
167
|
-
videoRef.current.pause();
|
141
|
+
if (!videoRef.current.src) {
|
142
|
+
const videoSrc = rec.video.url;
|
143
|
+
videoRef.current.src = videoSrc;
|
144
|
+
videoRef.current.setAttribute('x5-playsinline', 'true');
|
145
|
+
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
168
146
|
}
|
169
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.
|
170
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.
|
171
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.
|
172
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
173
|
-
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.on('ended', handleEnded);
|
147
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
|
148
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
|
149
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
|
150
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
|
174
151
|
return () => {
|
175
|
-
var _a, _b, _c, _d
|
176
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.
|
177
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.
|
178
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.
|
179
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
180
|
-
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.off('ended', handleEnded);
|
181
|
-
videoRef.current.dispose();
|
152
|
+
var _a, _b, _c, _d;
|
153
|
+
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
154
|
+
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
|
155
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
|
156
|
+
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
|
182
157
|
};
|
183
|
-
}, []);
|
158
|
+
}, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
|
184
159
|
useEffect(() => {
|
185
160
|
var _a;
|
186
161
|
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
|
@@ -263,27 +238,19 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
263
238
|
right: 0
|
264
239
|
} },
|
265
240
|
React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
|
266
|
-
React.createElement("video", { id: `pb-video-${index}`,
|
241
|
+
React.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: {
|
267
242
|
width: '100%',
|
268
243
|
height: '100%',
|
269
|
-
objectFit: 'contain'
|
270
|
-
backgroundColor: 'transparent',
|
271
|
-
pointerEvents: 'none'
|
244
|
+
objectFit: 'contain'
|
272
245
|
} }),
|
273
246
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
274
|
-
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, style: {
|
247
|
+
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
|
275
248
|
position: 'relative',
|
276
249
|
width: '100%',
|
277
250
|
height,
|
278
251
|
overflow: 'hidden'
|
279
|
-
}
|
280
|
-
React.createElement("video", { id: `pb-video-${index}`,
|
281
|
-
backgroundColor: 'transparent',
|
282
|
-
width: '100%',
|
283
|
-
height: '100%',
|
284
|
-
objectFit: 'cover',
|
285
|
-
pointerEvents: 'none'
|
286
|
-
} }),
|
252
|
+
} },
|
253
|
+
React.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 }),
|
287
254
|
renderPoster,
|
288
255
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
289
256
|
};
|
@@ -63,7 +63,7 @@ const WaterFall = (props) => {
|
|
63
63
|
}
|
64
64
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
65
65
|
eventInfo: {
|
66
|
-
|
66
|
+
contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
67
67
|
position: cacheActiveIndex + '',
|
68
68
|
contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
|
69
69
|
traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
|
@@ -9,6 +9,7 @@ export type postConfigType = {
|
|
9
9
|
export interface ISxpPageRenderProps {
|
10
10
|
globalConfig?: {
|
11
11
|
isShowLogo?: boolean;
|
12
|
+
isShowCTA?: boolean;
|
12
13
|
logoUrl?: string;
|
13
14
|
muteIcon?: string;
|
14
15
|
unMuteIcon?: string;
|
@@ -55,6 +56,7 @@ export interface ISxpPageRenderProps {
|
|
55
56
|
containerWidth?: number;
|
56
57
|
tempMap?: Record<string, any>;
|
57
58
|
data?: RecItemType[];
|
59
|
+
tagList?: string[];
|
58
60
|
resolver: any;
|
59
61
|
ctaType?: string;
|
60
62
|
_schema?: any;
|
@@ -21,7 +21,8 @@ import './index.less';
|
|
21
21
|
import { useEventReport } from '../../../core/hooks/useEventReport';
|
22
22
|
import withBindDataSource from '../../../core/hoc/withBindDataSource';
|
23
23
|
import { getFeUserId } from '../../../core/utils/localStore';
|
24
|
-
|
24
|
+
import Tagbar from './Tagbar';
|
25
|
+
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [] }) => {
|
25
26
|
var _a, _b, _c, _d, _e, _f, _g;
|
26
27
|
const { schema } = useEditor();
|
27
28
|
const [activeIndex, setActiveIndex] = useState(0);
|
@@ -120,12 +121,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
120
121
|
sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
|
121
122
|
eventSubject: 'sessionCompleted',
|
122
123
|
eventDescription: 'Session completed',
|
123
|
-
|
124
|
-
|
124
|
+
contentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
|
125
|
+
productId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
|
125
126
|
position: activeIndex + '',
|
126
127
|
fromKName,
|
127
128
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
128
|
-
|
129
|
+
ctatId: (_q = (_p = (_o = item.video) === null || _o === void 0 ? void 0 : _o.bindCta) === null || _p === void 0 ? void 0 : _p.itemId) !== null && _q !== void 0 ? _q : ''
|
129
130
|
}
|
130
131
|
});
|
131
132
|
}
|
@@ -141,8 +142,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
141
142
|
};
|
142
143
|
}, [activeIndex, bffEventReport, curTime, data, handleH5EnterLink, popupDetailData, isFromHashtag, tempMap]);
|
143
144
|
const height = useMemo(() => {
|
144
|
-
|
145
|
-
|
145
|
+
let minusHeight = 0;
|
146
|
+
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
147
|
+
minusHeight += 45;
|
148
|
+
}
|
149
|
+
if (tagList.length > 0) {
|
150
|
+
minusHeight += 45;
|
151
|
+
}
|
152
|
+
return containerHeight - minusHeight;
|
153
|
+
}, [globalConfig, containerHeight, tagList]);
|
146
154
|
const renderLogo = useMemo(() => {
|
147
155
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
148
156
|
return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
|
@@ -190,8 +198,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
190
198
|
((_a = rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
191
199
|
React.createElement("div", { className: 'clc-sxp-bottom' },
|
192
200
|
React.createElement(Nudge, { nudge: nudge }),
|
193
|
-
React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
194
|
-
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })),
|
201
|
+
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
202
|
+
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver }))) : null,
|
195
203
|
React.createElement("div", null,
|
196
204
|
React.createElement(ExpandableText, { 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' }), onChange: onExpandableChange }),
|
197
205
|
React.createElement(Hashtag, { index: activeIndex, 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 })))));
|
@@ -258,8 +266,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
258
266
|
eventInfo: {
|
259
267
|
eventSubject: 'scrollDown',
|
260
268
|
eventDescription: 'User scroll down',
|
261
|
-
|
262
|
-
|
269
|
+
contentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
|
270
|
+
productId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
|
263
271
|
requestId: null
|
264
272
|
}
|
265
273
|
});
|
@@ -270,8 +278,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
270
278
|
eventInfo: {
|
271
279
|
eventSubject: 'scrollUp',
|
272
280
|
eventDescription: 'User scroll up',
|
273
|
-
|
274
|
-
|
281
|
+
contentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
|
282
|
+
productId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
|
275
283
|
requestId: null
|
276
284
|
}
|
277
285
|
});
|
@@ -348,13 +356,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
348
356
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
349
357
|
} })),
|
350
358
|
renderLogo,
|
359
|
+
React.createElement(Tagbar, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
351
360
|
isShowFingerTip ? React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
|
352
|
-
React.createElement(Swiper, { ref: swiperRef,
|
353
|
-
swiperRef.current.swiper.allowTouchMove = false;
|
354
|
-
setTimeout(() => {
|
355
|
-
swiperRef.current.swiper.allowTouchMove = true;
|
356
|
-
}, 500);
|
357
|
-
}, onActiveIndexChange: (swiper) => {
|
361
|
+
React.createElement(Swiper, { ref: swiperRef, onActiveIndexChange: (swiper) => {
|
358
362
|
setActiveIndex(swiper.activeIndex);
|
359
363
|
if (openHashtag)
|
360
364
|
return;
|
@@ -60,12 +60,15 @@ export interface ISxpDataSourceContext {
|
|
60
60
|
hashTagSize?: number;
|
61
61
|
loadingImage?: string;
|
62
62
|
isOpenHashTag?: boolean;
|
63
|
+
tagList: string[];
|
64
|
+
setLoading?: React.Dispatch<React.SetStateAction<boolean>>;
|
63
65
|
}
|
64
66
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
65
67
|
export interface SxpDataSourceProviderProps {
|
66
68
|
dataSources?: DataSource[];
|
67
69
|
render: (data: {
|
68
70
|
rtcList: RecItemType[];
|
71
|
+
tagList: string[];
|
69
72
|
submitForm: (body: {
|
70
73
|
attributes: Array<{
|
71
74
|
name: string;
|
@@ -5,7 +5,8 @@ import { storeAndLoadFeSessionId } from '../utils/sessionStore';
|
|
5
5
|
import { storeAndLoadFeUserId } from '../utils/localStore';
|
6
6
|
import { useIconLink } from '../components/SxpPageRender/useIconLink';
|
7
7
|
export const SxpDataSourceContext = createContext({
|
8
|
-
rtcList: []
|
8
|
+
rtcList: [],
|
9
|
+
tagList: []
|
9
10
|
});
|
10
11
|
var DataSourceType;
|
11
12
|
(function (DataSourceType) {
|
@@ -14,6 +15,7 @@ var DataSourceType;
|
|
14
15
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
15
16
|
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false }) => {
|
16
17
|
const [rtcList, setRtcList] = useState([]);
|
18
|
+
const [tagList, setTagList] = useState([]);
|
17
19
|
const [loading, setLoading] = useState(false);
|
18
20
|
const [curReqInfo, setCurReqInfo] = useState({ rtc: '', requestId: '' });
|
19
21
|
const swiperRef = useRef(null);
|
@@ -126,6 +128,18 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
126
128
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/customform', { method: 'POST', body }));
|
127
129
|
return res === null || res === void 0 ? void 0 : res.success;
|
128
130
|
}), [bffFetch]);
|
131
|
+
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
132
|
+
var _g, _h;
|
133
|
+
if (!utmVal)
|
134
|
+
return;
|
135
|
+
try {
|
136
|
+
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: utmVal } }));
|
137
|
+
setTagList((_h = (_g = result === null || result === void 0 ? void 0 : result.data) === null || _g === void 0 ? void 0 : _g.tags) !== null && _h !== void 0 ? _h : []);
|
138
|
+
}
|
139
|
+
catch (e) {
|
140
|
+
console.log('e', e);
|
141
|
+
}
|
142
|
+
}), [bffFetch, utmVal]);
|
129
143
|
const ctaEvent = useCallback((eventInfo, rec, product, position) => {
|
130
144
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
131
145
|
const cta = product === null || product === void 0 ? void 0 : product.bindCta;
|
@@ -141,11 +155,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
141
155
|
fromKName = 'imagePage';
|
142
156
|
}
|
143
157
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
144
|
-
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '',
|
158
|
+
eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_h = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _h !== void 0 ? _h : '', ctaName: (_j = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _j !== void 0 ? _j : '', contentTags: JSON.stringify(cta === null || cta === void 0 ? void 0 : cta.tags), position: position + '', contentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_m = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _m !== void 0 ? _m : '', fromKName })
|
145
159
|
});
|
146
160
|
}, [bffEventReport, isFromHashtag]);
|
147
161
|
useEffect(() => {
|
148
162
|
setLoading(true);
|
163
|
+
bffGetTagList();
|
149
164
|
getRecommendVideos()
|
150
165
|
.then((data) => {
|
151
166
|
var _a, _b;
|
@@ -161,6 +176,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
161
176
|
if (!isInit.current)
|
162
177
|
return;
|
163
178
|
setLoading(true);
|
179
|
+
bffGetTagList();
|
164
180
|
getRecommendVideos()
|
165
181
|
.then((data) => {
|
166
182
|
var _a, _b;
|
@@ -170,7 +186,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
170
186
|
.finally(() => {
|
171
187
|
setLoading(false);
|
172
188
|
});
|
173
|
-
}, [getRecommendVideos]);
|
189
|
+
}, [getRecommendVideos, bffGetTagList]);
|
174
190
|
const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
|
175
191
|
return (React.createElement(SxpDataSourceContext.Provider, { value: {
|
176
192
|
rtcList,
|
@@ -202,7 +218,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
202
218
|
appDomain,
|
203
219
|
hashTagSize,
|
204
220
|
loadingImage: loadingImage !== null && loadingImage !== void 0 ? loadingImage : defaultLoadingImage,
|
205
|
-
isOpenHashTag
|
206
|
-
|
221
|
+
isOpenHashTag,
|
222
|
+
tagList,
|
223
|
+
setLoading
|
224
|
+
} }, render({
|
225
|
+
rtcList,
|
226
|
+
mutateLike: bffMutateLike,
|
227
|
+
mutateUnlike: bffMutateUnlike,
|
228
|
+
submitForm: bffSubmitForm,
|
229
|
+
tagList
|
230
|
+
})));
|
207
231
|
};
|
208
232
|
export default memo(SxpDataSourceProvider);
|
@@ -32,8 +32,8 @@ export function useEventReport() {
|
|
32
32
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
33
33
|
contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
|
34
34
|
position: position + '',
|
35
|
-
|
36
|
-
|
35
|
+
contentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
|
36
|
+
ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
|
37
37
|
traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
|
38
38
|
}
|
39
39
|
});
|
@@ -57,8 +57,8 @@ export function useEventReport() {
|
|
57
57
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
58
58
|
contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
|
59
59
|
position: position + '',
|
60
|
-
|
61
|
-
|
60
|
+
contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
|
61
|
+
ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
|
62
62
|
traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
|
63
63
|
timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
|
64
64
|
eventSubject: 'productView',
|
package/es/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/es/index.js
CHANGED
@@ -4,6 +4,7 @@ export { core_1 as core };
|
|
4
4
|
import * as materials_1 from './materials';
|
5
5
|
export { materials_1 as materials };
|
6
6
|
export { default as SxpPageRender } from './core/components/SxpPageRender';
|
7
|
+
export { default as DiyPortalPreview } from './core/components/DiyPortalPreview';
|
7
8
|
export { default as Modal } from './core/components/SxpPageRender/Modal';
|
8
9
|
export { default as SxpDataSourceProvider } from './core/context/SxpDataSourceProvider';
|
9
10
|
export { default as SxpPageCore } from './core/components/SxpPageCore';
|
@@ -10,7 +10,7 @@ import Modal from '../../../../core/components/SxpPageRender/Modal';
|
|
10
10
|
import ExpandableText from '../../../../core/components/SxpPageRender/ExpandableText';
|
11
11
|
import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
12
12
|
const CommodityDetail = (_a) => {
|
13
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
13
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
14
14
|
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index"]);
|
15
15
|
const { sxpParameter } = useSxpDataSource();
|
16
16
|
const { popupDetailData, bffEventReport, isPreview, waterFallData } = useSxpDataSource();
|
@@ -51,7 +51,7 @@ const CommodityDetail = (_a) => {
|
|
51
51
|
return '$7,000';
|
52
52
|
}
|
53
53
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
54
|
-
const width = isPreview ? 375 : window.innerWidth;
|
54
|
+
const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
|
55
55
|
const renderContent = ({ isPost }) => {
|
56
56
|
var _a, _b, _c;
|
57
57
|
return (React.createElement("div", null,
|
@@ -59,10 +59,10 @@ const CommodityDetail = (_a) => {
|
|
59
59
|
React.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'),
|
60
60
|
React.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),
|
61
61
|
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
62
|
-
React.createElement(ExpandableText, { 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
|
63
|
-
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
64
|
-
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
65
|
-
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
62
|
+
React.createElement(ExpandableText, { 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
|
63
|
+
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
64
|
+
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
65
|
+
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
66
66
|
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 }))));
|
67
67
|
};
|
68
68
|
const renderBtn = () => {
|
@@ -71,7 +71,7 @@ const CommodityDetail = (_a) => {
|
|
71
71
|
};
|
72
72
|
return (React.createElement("div", { className: 'pb-commondity' },
|
73
73
|
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
74
|
-
product && ((
|
74
|
+
product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
75
75
|
clickable: true,
|
76
76
|
bulletActiveClass: 'swipe-item-active-bullet',
|
77
77
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -79,7 +79,7 @@ const CommodityDetail = (_a) => {
|
|
79
79
|
: 'commondityDetail-swiper-clickable-center'
|
80
80
|
}, loop: true, autoplay: {
|
81
81
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
82
|
-
} }, (
|
82
|
+
} }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
|
83
83
|
return (React.createElement(SwiperSlide, { key: src },
|
84
84
|
React.createElement("div", { style: {
|
85
85
|
overflow: 'hidden',
|
@@ -88,7 +88,7 @@ const CommodityDetail = (_a) => {
|
|
88
88
|
} },
|
89
89
|
React.createElement(FormatImage, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
|
90
90
|
}))),
|
91
|
-
!((
|
91
|
+
!((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
|
92
92
|
position: 'relative',
|
93
93
|
height: 0,
|
94
94
|
width: '100%',
|
@@ -101,7 +101,7 @@ const CommodityDetail = (_a) => {
|
|
101
101
|
top: 0,
|
102
102
|
objectFit: 'cover',
|
103
103
|
width: '100%'
|
104
|
-
}), src: (
|
104
|
+
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
|
105
105
|
React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
106
106
|
renderBtn(),
|
107
107
|
React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) },
|
@@ -10,7 +10,7 @@ import ExpandableText from '../../../../core/components/SxpPageRender/Expandable
|
|
10
10
|
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
11
11
|
import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
12
12
|
const CommodityDetailDiroNew = (_a) => {
|
13
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
13
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
14
14
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
|
15
15
|
const [spread, setSpread] = useState(true);
|
16
16
|
const { sxpParameter } = useSxpDataSource();
|
@@ -58,7 +58,7 @@ const CommodityDetailDiroNew = (_a) => {
|
|
58
58
|
return '£102,300.00';
|
59
59
|
}
|
60
60
|
}, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
|
61
|
-
const width = isPreview ? 375 : window.innerWidth;
|
61
|
+
const width = isPreview ? 375 : (_f = style === null || style === void 0 ? void 0 : style.width) !== null && _f !== void 0 ? _f : window.innerWidth;
|
62
62
|
const handleClickCollapse = () => {
|
63
63
|
setSpread(!spread);
|
64
64
|
};
|
@@ -84,12 +84,12 @@ const CommodityDetailDiroNew = (_a) => {
|
|
84
84
|
const productInfoText = ({ isPost }) => {
|
85
85
|
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
86
86
|
React.createElement(ExpandableText, { 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) ||
|
87
|
-
`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
|
87
|
+
`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
|
88
88
|
Made in Italy` })));
|
89
89
|
};
|
90
90
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
91
91
|
React.createElement("div", Object.assign({ ref: scrollRef, className: css(Object.assign({}, style)) }, props),
|
92
|
-
product && ((
|
92
|
+
product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
93
93
|
clickable: true,
|
94
94
|
bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
|
95
95
|
clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
|
@@ -97,7 +97,7 @@ Made in Italy` })));
|
|
97
97
|
: 'commondityDiroNew-swiper-clickable-center'
|
98
98
|
}, loop: true, autoplay: {
|
99
99
|
delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
|
100
|
-
} }, (
|
100
|
+
} }, (_h = product === null || product === void 0 ? void 0 : product.homePage) === null || _h === void 0 ? void 0 : _h.map((src) => {
|
101
101
|
return (React.createElement(SwiperSlide, { key: src },
|
102
102
|
React.createElement("div", { style: {
|
103
103
|
overflow: 'hidden',
|
@@ -106,7 +106,7 @@ Made in Italy` })));
|
|
106
106
|
} },
|
107
107
|
React.createElement(FormatImage, { style: { height: '100%', width: '100%', objectFit: 'cover', display: 'block' }, src: src }))));
|
108
108
|
}))),
|
109
|
-
!((
|
109
|
+
!((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
|
110
110
|
position: 'relative',
|
111
111
|
height: 0,
|
112
112
|
width: '100%',
|
@@ -119,16 +119,16 @@ Made in Italy` })));
|
|
119
119
|
top: 0,
|
120
120
|
objectFit: 'cover',
|
121
121
|
width: '100%'
|
122
|
-
}), src: (
|
122
|
+
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
|
123
123
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
124
124
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
125
125
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
126
|
-
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (
|
126
|
+
React.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'),
|
127
127
|
React.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')),
|
128
128
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
129
129
|
React.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),
|
130
|
-
React.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 }, (
|
131
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (
|
130
|
+
React.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 : '税费'))),
|
131
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.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')),
|
132
132
|
productInfoText({ isPost }))),
|
133
133
|
React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
134
134
|
};
|