pb-sxp-ui 1.0.40 → 1.0.41

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 (46) hide show
  1. package/dist/index.cjs +455 -135
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +8 -1
  4. package/dist/index.js +454 -135
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +458 -139
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/DiyPortalPreview/PictureGroup.d.ts +13 -0
  15. package/es/core/components/DiyPortalPreview/PictureGroup.js +11 -0
  16. package/es/core/components/DiyPortalPreview/VideoWidget.d.ts +15 -0
  17. package/es/core/components/DiyPortalPreview/VideoWidget.js +236 -0
  18. package/es/core/components/DiyPortalPreview/index.d.ts +6 -0
  19. package/es/core/components/DiyPortalPreview/index.js +112 -0
  20. package/es/core/components/SxpPageRender/PictureGroup/Picture.js +1 -0
  21. package/es/core/components/SxpPageRender/VideoWidget/index.js +46 -79
  22. package/es/core/components/SxpPageRender/WaterFall/index.js +1 -1
  23. package/es/core/components/SxpPageRender/index.js +8 -13
  24. package/es/core/context/SxpDataSourceProvider.js +1 -1
  25. package/es/core/hooks/useEventReport.js +4 -4
  26. package/es/index.d.ts +1 -0
  27. package/es/index.js +1 -0
  28. package/es/materials/sxp/popup/CommodityDetail/index.js +6 -6
  29. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +9 -9
  30. package/lib/core/components/DiyPortalPreview/PictureGroup.d.ts +13 -0
  31. package/lib/core/components/DiyPortalPreview/PictureGroup.js +14 -0
  32. package/lib/core/components/DiyPortalPreview/VideoWidget.d.ts +15 -0
  33. package/lib/core/components/DiyPortalPreview/VideoWidget.js +239 -0
  34. package/lib/core/components/DiyPortalPreview/index.d.ts +6 -0
  35. package/lib/core/components/DiyPortalPreview/index.js +115 -0
  36. package/lib/core/components/SxpPageRender/PictureGroup/Picture.js +1 -0
  37. package/lib/core/components/SxpPageRender/VideoWidget/index.js +46 -79
  38. package/lib/core/components/SxpPageRender/WaterFall/index.js +1 -1
  39. package/lib/core/components/SxpPageRender/index.js +8 -13
  40. package/lib/core/context/SxpDataSourceProvider.js +1 -1
  41. package/lib/core/hooks/useEventReport.js +4 -4
  42. package/lib/index.d.ts +1 -0
  43. package/lib/index.js +3 -1
  44. package/lib/materials/sxp/popup/CommodityDetail/index.js +6 -6
  45. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +9 -9
  46. package/package.json +2 -1
@@ -0,0 +1,115 @@
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 defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
21
+ const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
22
+ const DiyPortalPreview = ({ data, globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain }) => {
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 likeIcon = (0, useIconLink_1.useIconLink)(defaultLikeIconPath, appDomain);
69
+ const unlikeIcon = (0, useIconLink_1.useIconLink)(defaultUnLikeIconPath, appDomain);
70
+ const renderLikeButton = (rec, index) => {
71
+ var _a, _b, _c, _d;
72
+ if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
73
+ return;
74
+ let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
75
+ if (top < 40) {
76
+ top += 40;
77
+ }
78
+ if (rec.video) {
79
+ return (react_1.default.createElement(LikeButton_1.default, { key: rec.position, activeIcon: (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon) !== null && _b !== void 0 ? _b : likeIcon, unActicveIcon: (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon) !== null && _c !== void 0 ? _c : unlikeIcon, position: index, active: rec.isCollected, recData: rec, className: 'clc-sxp-like-button', style: {
80
+ top,
81
+ right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0
82
+ } }));
83
+ }
84
+ return null;
85
+ };
86
+ const mutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
87
+ const unmutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
88
+ const renderView = (rec, index) => {
89
+ var _a, _b, _c, _d;
90
+ return (react_1.default.createElement("div", { style: { position: 'relative' } },
91
+ renderLogo,
92
+ react_1.default.createElement(ToggleButton_1.default, { style: {
93
+ position: 'absolute',
94
+ right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
95
+ 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',
96
+ bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
97
+ zIndex: 999
98
+ }, 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 }),
99
+ renderContent(rec, index),
100
+ renderBottom(rec, index),
101
+ renderLikeButton(rec, index)));
102
+ };
103
+ return (react_1.default.createElement("div", { style: {
104
+ width: '100%',
105
+ height: containerHeight,
106
+ display: 'flex',
107
+ boxSizing: 'border-box',
108
+ gap: 16,
109
+ pointerEvents: 'none',
110
+ userSelect: 'none'
111
+ } }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
112
+ return renderView(rec, index);
113
+ })));
114
+ };
115
+ exports.default = (0, react_1.memo)(DiyPortalPreview);
@@ -31,6 +31,7 @@ const Picture = (props) => {
31
31
  react_1.default.createElement(FormatImage_1.default, { src: src, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) }),
32
32
  blur && (react_1.default.createElement(FormatImage_1.default, { src: src, style: {
33
33
  width: '100%',
34
+ height: '100%',
34
35
  objectFit: 'contain',
35
36
  position: 'absolute',
36
37
  top: '50%',
@@ -17,13 +17,12 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
17
17
  const { isActive } = (0, react_2.useSwiperSlide)();
18
18
  const canvasRef = (0, react_1.useRef)(null);
19
19
  const [firstFrameSrc, setFirstFrameSrc] = (0, react_1.useState)('');
20
- const videoId = `pb-video-${index}`;
21
20
  (0, react_1.useEffect)(() => {
22
21
  if (!videoRef.current)
23
22
  return;
24
- videoRef.current.muted(muted);
23
+ videoRef.current.muted = muted;
25
24
  }, [muted]);
26
- const handleEnded = (0, react_1.useCallback)(() => {
25
+ const handleVideoStart = (0, react_1.useCallback)(() => {
27
26
  var _a;
28
27
  (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
29
28
  }, []);
@@ -32,10 +31,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
32
31
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
33
32
  setIsPauseVideo(false);
34
33
  const item = data[index];
35
- if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration())) {
36
- videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime()) || 0;
37
- const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration()) !== null && _d !== void 0 ? _d : 0).toFixed(2);
38
- const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime()) !== null && _f !== void 0 ? _f : 0).toFixed(2);
34
+ if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
35
+ videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
36
+ const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
37
+ const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
39
38
  const playType = isFirstPlay ? '0' : '1';
40
39
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
41
40
  eventInfo: {
@@ -55,15 +54,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
55
54
  setIsFirstPlay(false);
56
55
  }
57
56
  }, [bffEventReport, data, index, isFirstPlay]);
58
- const handleCanplay = (0, react_1.useCallback)(() => {
59
- handLoadeddata();
57
+ const handleLoadedMetadata = (0, react_1.useCallback)(() => {
60
58
  setIsLoadFinish(true);
61
59
  }, []);
62
60
  const handleClickVideo = (0, react_1.useCallback)((type) => () => {
63
61
  var _a, _b, _c, _d, _e;
64
62
  if (!isLoadFinish)
65
63
  return;
66
- const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused();
64
+ const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
67
65
  switch (type) {
68
66
  case 'start':
69
67
  if (!isPause)
@@ -88,13 +86,13 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
88
86
  break;
89
87
  }
90
88
  }, [isLoadFinish]);
91
- const handlePause = (0, react_1.useCallback)(() => {
89
+ const onPause = (0, react_1.useCallback)(() => {
92
90
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
93
91
  const item = data[index];
94
- const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration()) !== null && _b !== void 0 ? _b : 0).toFixed(2);
95
- const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime()) !== null && _d !== void 0 ? _d : 0).toFixed(2);
96
- if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration()) {
97
- const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime()) - videoStartTime.current).toFixed(2);
92
+ const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
93
+ const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
94
+ if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
95
+ const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
98
96
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
99
97
  eventInfo: {
100
98
  eventSubject: 'playOverVideo',
@@ -126,64 +124,41 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
126
124
  return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
127
125
  }, [firstFrameSrc, rec]);
128
126
  const handLoadeddata = (0, react_1.useCallback)(() => {
129
- var _a;
130
- const videoDomRef = document.getElementById(`${videoId}_html5_api`);
131
- if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !videoDomRef || !canvasRef.current)
127
+ if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
132
128
  return;
133
- const setFrameImg = () => {
134
- const video = videoDomRef;
135
- const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
136
- const ctx = canvas.getContext('2d');
137
- const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
138
- const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
139
- canvas.height = targetHeight;
140
- canvas.width = targetWidth;
141
- ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
142
- setFirstFrameSrc(canvas.toDataURL());
143
- };
144
- setFrameImg();
145
- setTimeout(() => {
146
- setFrameImg();
147
- }, 500);
129
+ const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
130
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
131
+ const ctx = canvas.getContext('2d');
132
+ const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
133
+ const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
134
+ canvas.height = targetHeight;
135
+ canvas.width = targetWidth;
136
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
137
+ setFirstFrameSrc(canvas.toDataURL());
148
138
  }, []);
149
139
  (0, react_1.useEffect)(() => {
150
- var _a, _b, _c, _d, _e;
140
+ var _a, _b, _c, _d;
141
+ if (!videoRef.current)
142
+ return;
151
143
  setIsPauseVideo(false);
152
- const videoSrc = rec.video.url;
153
- if (videoSrc && typeof TCPlayer === 'function') {
154
- videoRef.current = TCPlayer(videoId, {
155
- sources: [
156
- {
157
- src: videoSrc
158
- }
159
- ],
160
- licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1325816236_1/v_cube.license',
161
- controls: false,
162
- autoplay: false,
163
- loop: false,
164
- muted: true,
165
- preload: 'auto',
166
- posterImage: false,
167
- bigPlayButton: true
168
- });
169
- videoRef.current.play();
170
- videoRef.current.pause();
144
+ if (!videoRef.current.src) {
145
+ const videoSrc = rec.video.url;
146
+ videoRef.current.src = videoSrc;
147
+ videoRef.current.setAttribute('x5-playsinline', 'true');
148
+ videoRef.current.setAttribute('webkit-playsinline', 'true');
171
149
  }
172
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.on('loadedmetadata', handleCanplay);
173
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.on('canplay', handleCanplay);
174
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.on('playing', handlePlaying);
175
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.on('pause', handlePause);
176
- (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.on('ended', handleEnded);
150
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
151
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
152
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
153
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
177
154
  return () => {
178
- var _a, _b, _c, _d, _e;
179
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.off('loadedmetadata', handleCanplay);
180
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.off('canplay', handleCanplay);
181
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.off('playing', handlePlaying);
182
- (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.off('pause', handlePause);
183
- (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.off('ended', handleEnded);
184
- videoRef.current.dispose();
155
+ var _a, _b, _c, _d;
156
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
157
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
158
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
159
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
185
160
  };
186
- }, []);
161
+ }, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
187
162
  (0, react_1.useEffect)(() => {
188
163
  var _a;
189
164
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || !isLoadFinish)
@@ -266,27 +241,19 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
266
241
  right: 0
267
242
  } },
268
243
  react_1.default.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
269
- react_1.default.createElement("video", { id: `pb-video-${index}`, playsInline: true, crossOrigin: 'anonymous', style: {
244
+ 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: {
270
245
  width: '100%',
271
246
  height: '100%',
272
- objectFit: 'contain',
273
- backgroundColor: 'transparent',
274
- pointerEvents: 'none'
247
+ objectFit: 'contain'
275
248
  } }),
276
249
  react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
277
- renderPoster)) : (react_1.default.createElement("div", { className: 'video-container', key: rec.video.itemId, style: {
250
+ renderPoster)) : (react_1.default.createElement("div", { className: 'video-container', key: rec.video.itemId, onClick: handleClickVideo(), style: {
278
251
  position: 'relative',
279
252
  width: '100%',
280
253
  height,
281
254
  overflow: 'hidden'
282
- }, onClick: handleClickVideo() },
283
- react_1.default.createElement("video", { id: `pb-video-${index}`, playsInline: true, crossOrigin: 'anonymous', style: {
284
- backgroundColor: 'transparent',
285
- width: '100%',
286
- height: '100%',
287
- objectFit: 'cover',
288
- pointerEvents: 'none'
289
- } }),
255
+ } },
256
+ 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 }),
290
257
  renderPoster,
291
258
  react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
292
259
  };
@@ -66,7 +66,7 @@ const WaterFall = (props) => {
66
66
  }
67
67
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
68
68
  eventInfo: {
69
- relatedContentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
69
+ contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
70
70
  position: cacheActiveIndex + '',
71
71
  contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
72
72
  traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
@@ -123,12 +123,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
123
123
  sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
124
124
  eventSubject: 'sessionCompleted',
125
125
  eventDescription: 'Session completed',
126
- relatedContentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
127
- relatedProductId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
126
+ contentId: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.itemId,
127
+ productId: (_m = item === null || item === void 0 ? void 0 : item.product) === null || _m === void 0 ? void 0 : _m.itemId,
128
128
  position: activeIndex + '',
129
129
  fromKName,
130
130
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
131
- relatedCtatId: (_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 : ''
131
+ 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 : ''
132
132
  }
133
133
  });
134
134
  }
@@ -261,8 +261,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
261
261
  eventInfo: {
262
262
  eventSubject: 'scrollDown',
263
263
  eventDescription: 'User scroll down',
264
- relatedContentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
265
- relatedProductId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
264
+ contentId: (_b = (_a = item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '',
265
+ productId: (_d = (_c = item.product) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
266
266
  requestId: null
267
267
  }
268
268
  });
@@ -273,8 +273,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
273
273
  eventInfo: {
274
274
  eventSubject: 'scrollUp',
275
275
  eventDescription: 'User scroll up',
276
- relatedContentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
277
- relatedProductId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
276
+ contentId: (_f = (_e = item.video) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : '',
277
+ productId: (_h = (_g = item.product) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
278
278
  requestId: null
279
279
  }
280
280
  });
@@ -352,12 +352,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
352
352
  } })),
353
353
  renderLogo,
354
354
  isShowFingerTip ? react_1.default.createElement(FingerSwipeTip_1.default, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon }) : null,
355
- react_1.default.createElement(react_2.Swiper, { ref: swiperRef, onSlideChange: () => {
356
- swiperRef.current.swiper.allowTouchMove = false;
357
- setTimeout(() => {
358
- swiperRef.current.swiper.allowTouchMove = true;
359
- }, 500);
360
- }, onActiveIndexChange: (swiper) => {
355
+ react_1.default.createElement(react_2.Swiper, { ref: swiperRef, onActiveIndexChange: (swiper) => {
361
356
  setActiveIndex(swiper.activeIndex);
362
357
  if (openHashtag)
363
358
  return;
@@ -144,7 +144,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
144
144
  fromKName = 'imagePage';
145
145
  }
146
146
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
147
- 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 + '', relatedContentId: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.itemId) !== null && _l !== void 0 ? _l : '', relatedProductId: 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 })
147
+ 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 })
148
148
  });
149
149
  }, [bffEventReport, isFromHashtag]);
150
150
  (0, react_1.useEffect)(() => {
@@ -35,8 +35,8 @@ function useEventReport() {
35
35
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
36
36
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
37
37
  position: position + '',
38
- relatedContentId: (_m = (_l = data === null || data === void 0 ? void 0 : data.video) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '',
39
- relatedCtatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
38
+ 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 : '',
39
+ ctatId: (_o = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _o !== void 0 ? _o : '',
40
40
  traceInfo: (_p = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _p !== void 0 ? _p : ''
41
41
  }
42
42
  });
@@ -60,8 +60,8 @@ function useEventReport() {
60
60
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
61
61
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
62
62
  position: position + '',
63
- relatedContentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
64
- relatedCtatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
63
+ contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
64
+ ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
65
65
  traceInfo: product === null || product === void 0 ? void 0 : product.traceInfo,
66
66
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
67
67
  eventSubject: 'productView',
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,
@@ -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
  };
@@ -91,7 +91,7 @@ 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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.0.40",
3
+ "version": "1.0.41",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -42,6 +42,7 @@
42
42
  "antd": "^5.15.3",
43
43
  "eslint": "^8.48.0",
44
44
  "eventemitter3": "^5.0.1",
45
+ "hls.js": "^1.5.8",
45
46
  "less": "^4.2.0",
46
47
  "lodash": "^4.17.21",
47
48
  "pako": "^2.1.0",