pb-sxp-ui 1.15.15-alpha.1 → 1.15.16-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +135 -824
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +134 -822
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +6 -6
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +135 -824
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +6 -6
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageCore/index.d.ts +0 -1
- package/es/core/components/SxpPageCore/index.js +7 -7
- package/es/core/components/SxpPageRender/ExpandableText.js +2 -10
- package/es/core/components/SxpPageRender/RenderCard.js +4 -4
- package/es/core/context/EditorContext.js +1 -1
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -1
- package/es/core/context/SxpDataSourceProvider.js +47 -28
- package/es/index.d.ts +0 -1
- package/es/index.js +0 -1
- package/es/materials/sxp/template/MultiCommodity/index.js +1 -1
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +1 -2
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +1 -2
- package/es/materials/sxp/template/components/EventProvider.js +2 -2
- package/lib/core/components/SxpPageCore/index.d.ts +0 -1
- package/lib/core/components/SxpPageCore/index.js +7 -7
- package/lib/core/components/SxpPageRender/ExpandableText.js +2 -10
- package/lib/core/components/SxpPageRender/RenderCard.js +4 -4
- package/lib/core/context/EditorContext.js +1 -1
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -1
- package/lib/core/context/SxpDataSourceProvider.js +47 -28
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -3
- package/lib/materials/sxp/template/MultiCommodity/index.js +1 -1
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +1 -2
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +1 -2
- package/lib/materials/sxp/template/components/EventProvider.js +2 -2
- package/package.json +1 -1
- package/es/core/components/DiyStoryPreview/PictureGroup.d.ts +0 -16
- package/es/core/components/DiyStoryPreview/PictureGroup.js +0 -34
- package/es/core/components/DiyStoryPreview/VideoWidget.d.ts +0 -27
- package/es/core/components/DiyStoryPreview/VideoWidget.js +0 -239
- package/es/core/components/DiyStoryPreview/index.d.ts +0 -51
- package/es/core/components/DiyStoryPreview/index.js +0 -411
- package/lib/core/components/DiyStoryPreview/PictureGroup.d.ts +0 -16
- package/lib/core/components/DiyStoryPreview/PictureGroup.js +0 -37
- package/lib/core/components/DiyStoryPreview/VideoWidget.d.ts +0 -27
- package/lib/core/components/DiyStoryPreview/VideoWidget.js +0 -242
- package/lib/core/components/DiyStoryPreview/index.d.ts +0 -51
- package/lib/core/components/DiyStoryPreview/index.js +0 -414
@@ -1,414 +0,0 @@
|
|
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 react_2 = require("swiper/react");
|
6
|
-
const lodash_1 = require("lodash");
|
7
|
-
const RenderCard_1 = tslib_1.__importDefault(require("../SxpPageRender/RenderCard"));
|
8
|
-
const ExpandableText_1 = tslib_1.__importDefault(require("../SxpPageRender/ExpandableText"));
|
9
|
-
const LikeButton_1 = tslib_1.__importDefault(require("../SxpPageRender/LikeButton"));
|
10
|
-
const useIconLink_1 = require("../SxpPageRender/useIconLink");
|
11
|
-
const ToggleButton_1 = tslib_1.__importDefault(require("../SxpPageRender/ToggleButton"));
|
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
|
-
require("../SxpPageRender/index.less");
|
16
|
-
const recData = {
|
17
|
-
position: 0,
|
18
|
-
isCollected: false,
|
19
|
-
product: null,
|
20
|
-
video: {
|
21
|
-
appId: null,
|
22
|
-
itemId: 'VIDEOSsRgI1695278974368',
|
23
|
-
title: '8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片',
|
24
|
-
enTitle: null,
|
25
|
-
icon: null,
|
26
|
-
cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20231017/fsJFWmW1dGyW7XmDspbJPTn5esL3U1697538777398.png',
|
27
|
-
link: null,
|
28
|
-
linkTitle: null,
|
29
|
-
linkType: null,
|
30
|
-
menuCategoryId: null,
|
31
|
-
remark: null,
|
32
|
-
tags: [
|
33
|
-
'Gift-Giving',
|
34
|
-
'Daily Wear',
|
35
|
-
'Business Formal',
|
36
|
-
'Sports/Casual',
|
37
|
-
'Anniversary Gifts',
|
38
|
-
'Wedding/Engagement',
|
39
|
-
'Formal Dinner/Party'
|
40
|
-
],
|
41
|
-
traceInfo: ':VIDEO:VIDEOSsRgI1695278974368:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
|
42
|
-
value: 385,
|
43
|
-
weight: null,
|
44
|
-
bindCta: null,
|
45
|
-
bindProduct: null,
|
46
|
-
bindProducts: [
|
47
|
-
{
|
48
|
-
appId: 'wx448578f8851f3dce',
|
49
|
-
itemId: 'test02178888',
|
50
|
-
title: 'christian dior小包包 新CDN',
|
51
|
-
enTitle: null,
|
52
|
-
icon: null,
|
53
|
-
cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs2jqiurjftpoaba67iiwr9jt5sc31726213277754.avif',
|
54
|
-
link: '/pages/details/index?spu_id=1702262707659534338',
|
55
|
-
linkTitle: '',
|
56
|
-
linkType: 'MP',
|
57
|
-
menuCategoryId: null,
|
58
|
-
remark: null,
|
59
|
-
tags: [],
|
60
|
-
traceInfo: ':PRODUCT:test02178888:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
|
61
|
-
value: null,
|
62
|
-
weight: null,
|
63
|
-
bindCta: {
|
64
|
-
appId: 'wx448578f8851f3dce',
|
65
|
-
itemId: 'CTA3KofE1716186622249',
|
66
|
-
title: 'SHOP NOW 立即购买',
|
67
|
-
enTitle: 'BUY NOW立即购买,选择你所喜爱的;',
|
68
|
-
icon: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240520/fssfxbmiwghixmgblz9uriwennd2r1716186615574.avif',
|
69
|
-
cover: null,
|
70
|
-
link: '/pages/details/index?spu_id=1702262707659534338',
|
71
|
-
linkTitle: '',
|
72
|
-
linkType: 'MP',
|
73
|
-
menuCategoryId: '64b60b202caf0e1c1ce1e17d',
|
74
|
-
remark: null,
|
75
|
-
tags: [
|
76
|
-
"Woman's Perfumes",
|
77
|
-
'Plates & Bowls',
|
78
|
-
'Glasses',
|
79
|
-
'Multicolor',
|
80
|
-
'Carafes',
|
81
|
-
'Tea & Coffee',
|
82
|
-
'Green',
|
83
|
-
'Grey',
|
84
|
-
'Cutlery'
|
85
|
-
],
|
86
|
-
traceInfo: ':CTA:CTA3KofE1716186622249:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
|
87
|
-
value: null,
|
88
|
-
weight: null
|
89
|
-
},
|
90
|
-
collection: 'Ricco',
|
91
|
-
currency: 'INR-₹',
|
92
|
-
homePage: [
|
93
|
-
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs2jqiurjftpoaba67iiwr9jt5sc31726213277754.avif',
|
94
|
-
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fsr9ttuzuljs85smqi6lsidovnyoy1726213285994.avif',
|
95
|
-
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fsknmfhx2lxukxews05guwwxr8rju1726213281108.avif',
|
96
|
-
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs0acnua4f1clamdpwdsrh0v5dgc61726213289247.avif'
|
97
|
-
],
|
98
|
-
info: 'test',
|
99
|
-
price: 53200,
|
100
|
-
shippingInfo: null,
|
101
|
-
taxInfo: null
|
102
|
-
},
|
103
|
-
{
|
104
|
-
appId: null,
|
105
|
-
itemId: '113J631A0684_C520',
|
106
|
-
title: 'Sweatshirt à capuche Dior Oblique, coupe relax',
|
107
|
-
enTitle: null,
|
108
|
-
icon: null,
|
109
|
-
cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fsaf0xq8vx8gkkl30y1h1swpinmbt1731661943891.avif',
|
110
|
-
link: 'https://www.dior.com/fr_fr/fashion/products/113J631A0684_C520',
|
111
|
-
linkTitle: null,
|
112
|
-
linkType: 'WEB',
|
113
|
-
menuCategoryId: null,
|
114
|
-
remark: null,
|
115
|
-
tags: [],
|
116
|
-
traceInfo: ':PRODUCT:113J631A0684_C520:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
|
117
|
-
value: null,
|
118
|
-
weight: null,
|
119
|
-
bindCta: {
|
120
|
-
appId: null,
|
121
|
-
itemId: 'CTAAfaKf1730796437032',
|
122
|
-
title: 'test',
|
123
|
-
enTitle: 'test',
|
124
|
-
icon: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241105/fsjblxoud2tmehpiqqomh0oktwqrd1730796431496.avif',
|
125
|
-
cover: null,
|
126
|
-
link: null,
|
127
|
-
linkTitle: null,
|
128
|
-
linkType: null,
|
129
|
-
menuCategoryId: '64b60b202caf0e1c1ce1e17d',
|
130
|
-
remark: '',
|
131
|
-
tags: [],
|
132
|
-
traceInfo: ':CTA:CTAAfaKf1730796437032:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
|
133
|
-
value: null,
|
134
|
-
weight: null
|
135
|
-
},
|
136
|
-
collection: 'Jacquard de coton éponge bleu',
|
137
|
-
currency: 'EUR-€',
|
138
|
-
homePage: [
|
139
|
-
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fsaf0xq8vx8gkkl30y1h1swpinmbt1731661943891.avif',
|
140
|
-
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fszxkdcjfjql2oiy90ffbal5tsfd81731661964913.avif',
|
141
|
-
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fs1jhd9jwxvfqmrbjwy5abfzb0fde1731661994996.avif'
|
142
|
-
],
|
143
|
-
info: "Le sweatshirt à capuche bleu met à l'honneur l'emblématique motif dior oblique. Confectionné en jacquard de coton éponge bleu, il présente une coupe relax très confortable. Doté de poches latérales fendues, ce sweatshirt à capuche s'associera à tous vos jeans ou pantalons de survêtement pour un look décontracté.. Sweatshirt à capuche dior oblique, coupe relax Jacquard de coton éponge bleu",
|
144
|
-
price: 1800,
|
145
|
-
shippingInfo: null,
|
146
|
-
taxInfo: null
|
147
|
-
},
|
148
|
-
{
|
149
|
-
appId: null,
|
150
|
-
itemId: 'S5573CRIW_M928',
|
151
|
-
title: 'Mini Dior Book Tote',
|
152
|
-
enTitle: null,
|
153
|
-
icon: null,
|
154
|
-
cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsvewk9etrawxrzznmvvewgt1bctu1739415576729.avif',
|
155
|
-
link: 'https://www.dior.com/en_gb/fashion/products/S5573CRIW_M928',
|
156
|
-
linkTitle: null,
|
157
|
-
linkType: 'WEB',
|
158
|
-
menuCategoryId: null,
|
159
|
-
remark: null,
|
160
|
-
tags: ['ダイヤモンド'],
|
161
|
-
traceInfo: ':PRODUCT:S5573CRIW_M928:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
|
162
|
-
value: null,
|
163
|
-
weight: null,
|
164
|
-
bindCta: null,
|
165
|
-
collection: null,
|
166
|
-
currency: 'GBP-£',
|
167
|
-
homePage: [
|
168
|
-
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsvewk9etrawxrzznmvvewgt1bctu1739415576729.avif',
|
169
|
-
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsngtlvhid7xwt5if0viw7vqanm831739415582147.avif',
|
170
|
-
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fs4hotdvyzjtnqb9vszlynuzplddc1739415586910.avif',
|
171
|
-
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fswffx9kwexf3z3vcnxisut1qxtez1739415591629.avif',
|
172
|
-
'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsbfsi7tttx1hnzldoiw7eoea7fvh1739415597388.avif'
|
173
|
-
],
|
174
|
-
info: "The Dior Book Tote is a House classic and original design by Maria Grazia Chiuri, Creative Director of Christian Dior. The style is fully embroidered with the House's hallmark blue Dior Oblique motif and showcases the Christian Dior Paris signature. Exemplifying House savoir-faire, the miniature style features an adjustable and removable strap that allows it to be carried by hand, worn over the shoulder or crossbody.",
|
175
|
-
price: 1950,
|
176
|
-
shippingInfo: null,
|
177
|
-
taxInfo: null
|
178
|
-
}
|
179
|
-
],
|
180
|
-
url: null,
|
181
|
-
blockCta: 1,
|
182
|
-
blockProduct: 1,
|
183
|
-
hashTags: [
|
184
|
-
'Sports/Casual',
|
185
|
-
'Formal Dinner/Party',
|
186
|
-
'Business Formal',
|
187
|
-
'Wedding/Engagement',
|
188
|
-
'Gift-Giving',
|
189
|
-
'Daily Wear',
|
190
|
-
'Anniversary Gifts'
|
191
|
-
]
|
192
|
-
}
|
193
|
-
};
|
194
|
-
const RESOLVER = {};
|
195
|
-
Object.values(_materials_).forEach((v) => {
|
196
|
-
RESOLVER[v.extend.type] = v;
|
197
|
-
});
|
198
|
-
const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
|
199
|
-
const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
|
200
|
-
const DiyStoryPreview = (0, react_1.forwardRef)(({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [], scenes, onActiveChange, activeIndex, loopPlay = false, pointerEvents = 'none', onUpdateTimeLine, disabledListener, onPlay, onPause }, ref) => {
|
201
|
-
const videoWidgetRef = (0, react_1.useRef)(null);
|
202
|
-
const swiperRef = (0, react_1.useRef)(null);
|
203
|
-
const [curIndex, setCurIndex] = (0, react_1.useState)(0);
|
204
|
-
const height = (0, react_1.useMemo)(() => {
|
205
|
-
let minusHeight = 0;
|
206
|
-
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
207
|
-
minusHeight += 45;
|
208
|
-
}
|
209
|
-
if (tagList.length > 0) {
|
210
|
-
minusHeight += 45;
|
211
|
-
}
|
212
|
-
return containerHeight - minusHeight;
|
213
|
-
}, [globalConfig, containerHeight, tagList]);
|
214
|
-
(0, react_1.useImperativeHandle)(ref, () => {
|
215
|
-
return {
|
216
|
-
play() {
|
217
|
-
var _a;
|
218
|
-
(_a = videoWidgetRef === null || videoWidgetRef === void 0 ? void 0 : videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
219
|
-
},
|
220
|
-
pause() {
|
221
|
-
var _a;
|
222
|
-
(_a = videoWidgetRef === null || videoWidgetRef === void 0 ? void 0 : videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.pause();
|
223
|
-
},
|
224
|
-
slideTo(n) {
|
225
|
-
var _a, _b;
|
226
|
-
if (!(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current))
|
227
|
-
return;
|
228
|
-
(_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideTo(n);
|
229
|
-
},
|
230
|
-
isPlaying() {
|
231
|
-
var _a, _b;
|
232
|
-
return (_b = (_a = videoWidgetRef === null || videoWidgetRef === void 0 ? void 0 : videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.isPlaying()) !== null && _b !== void 0 ? _b : false;
|
233
|
-
}
|
234
|
-
};
|
235
|
-
});
|
236
|
-
const isVideoUrl = (url) => {
|
237
|
-
if (url && url !== '' && typeof url === 'string') {
|
238
|
-
const imageExtensions = ['.mp4', '.m3u8'];
|
239
|
-
const lowerCaseUrl = url === null || url === void 0 ? void 0 : url.toLowerCase();
|
240
|
-
return imageExtensions.some((ext) => lowerCaseUrl === null || lowerCaseUrl === void 0 ? void 0 : lowerCaseUrl.endsWith(ext));
|
241
|
-
}
|
242
|
-
else {
|
243
|
-
return false;
|
244
|
-
}
|
245
|
-
};
|
246
|
-
const renderContent = (rec, index) => {
|
247
|
-
const isVideo = isVideoUrl(rec === null || rec === void 0 ? void 0 : rec.mediaUrl);
|
248
|
-
if (isVideo) {
|
249
|
-
return (react_1.default.createElement(VideoWidget_1.default, Object.assign({ key: index }, (curIndex === index && { ref: videoWidgetRef }), { rec: rec, index: index, muted: true, width: containerWidth, data: scenes !== null && scenes !== void 0 ? scenes : [], height: containerHeight, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon, swiperRef: swiperRef, loopPlay: loopPlay, onUpdateTimeLine: onUpdateTimeLine, onPlay: onPlay, onPause: onPause })));
|
250
|
-
}
|
251
|
-
else {
|
252
|
-
return (react_1.default.createElement(PictureGroup_1.default, { key: rec.itemId, imgUrls: [rec === null || rec === void 0 ? void 0 : rec.mediaUrl], width: containerWidth, height: containerHeight, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, data: scenes !== null && scenes !== void 0 ? scenes : [], swiperRef: swiperRef }));
|
253
|
-
}
|
254
|
-
};
|
255
|
-
const renderLogo = (0, react_1.useMemo)(() => {
|
256
|
-
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
257
|
-
return (react_1.default.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
|
258
|
-
react_1.default.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
|
259
|
-
}
|
260
|
-
return null;
|
261
|
-
}, [globalConfig]);
|
262
|
-
const renderBottom = (rec, index) => {
|
263
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
264
|
-
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
265
|
-
let cta = null;
|
266
|
-
if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
|
267
|
-
cta = '多商品CTA';
|
268
|
-
}
|
269
|
-
else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
|
270
|
-
cta = '商品CTA';
|
271
|
-
}
|
272
|
-
else {
|
273
|
-
cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
|
274
|
-
}
|
275
|
-
const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
|
276
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
277
|
-
((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.title) && (react_1.default.createElement("div", { style: {
|
278
|
-
background: 'repeating-linear-gradient(0deg, rgba(26, 26, 25, 0.7), hsla(0, 0%, 100%, 0))',
|
279
|
-
height: '130px',
|
280
|
-
position: 'absolute',
|
281
|
-
bottom: 0,
|
282
|
-
width: '100%',
|
283
|
-
willChange: 'transform',
|
284
|
-
zIndex: 2,
|
285
|
-
pointerEvents
|
286
|
-
} })),
|
287
|
-
react_1.default.createElement("div", { style: {
|
288
|
-
marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px`,
|
289
|
-
zIndex: 999,
|
290
|
-
position: 'absolute',
|
291
|
-
bottom: 0,
|
292
|
-
left: 0,
|
293
|
-
right: 0,
|
294
|
-
paddingTop: '20px'
|
295
|
-
} },
|
296
|
-
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (react_1.default.createElement("div", { style: {} },
|
297
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, isActive: index === activeIndex, value: value }))) : null,
|
298
|
-
react_1.default.createElement("div", null,
|
299
|
-
react_1.default.createElement(ExpandableText_1.default, { isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_j = (_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '', 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', padding: '0 20px', fontSize: '12px' }) }),
|
300
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }))),
|
301
|
-
react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
|
302
|
-
}
|
303
|
-
return null;
|
304
|
-
};
|
305
|
-
const likeIcon = (0, useIconLink_1.useIconLink)(defaultLikeIconPath, appDomain);
|
306
|
-
const unlikeIcon = (0, useIconLink_1.useIconLink)(defaultUnLikeIconPath, appDomain);
|
307
|
-
const renderLikeButton = (rec, index) => {
|
308
|
-
var _a, _b, _c, _d;
|
309
|
-
if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
|
310
|
-
return;
|
311
|
-
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
|
312
|
-
if (top < 40) {
|
313
|
-
top += 40;
|
314
|
-
}
|
315
|
-
if (rec === null || rec === void 0 ? void 0 : rec.video) {
|
316
|
-
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, style: {
|
317
|
-
top,
|
318
|
-
right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0,
|
319
|
-
position: 'absolute',
|
320
|
-
zIndex: 999,
|
321
|
-
backgroundColor: 'transparent',
|
322
|
-
width: '50px',
|
323
|
-
height: '50px',
|
324
|
-
outline: 'none',
|
325
|
-
border: 'none',
|
326
|
-
boxSizing: 'content-box',
|
327
|
-
padding: 0,
|
328
|
-
transform: 'translate3d(0px, 0px, 0px)'
|
329
|
-
} }));
|
330
|
-
}
|
331
|
-
return null;
|
332
|
-
};
|
333
|
-
const mutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
|
334
|
-
const unmutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
|
335
|
-
const renderToggleButton = (visible) => {
|
336
|
-
var _a, _b, _c, _d;
|
337
|
-
if (!visible)
|
338
|
-
return;
|
339
|
-
let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _a !== void 0 ? _a : 23;
|
340
|
-
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) === 'top') {
|
341
|
-
top += 45;
|
342
|
-
}
|
343
|
-
return (((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === true) && (react_1.default.createElement(ToggleButton_1.default, { style: {
|
344
|
-
position: 'absolute',
|
345
|
-
visibility: 'visible',
|
346
|
-
zIndex: 999,
|
347
|
-
transform: 'translate3d(0px,0px,0px)',
|
348
|
-
[(_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _b !== void 0 ? _b : 'right']: (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _c !== void 0 ? _c : 0,
|
349
|
-
[(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _d !== void 0 ? _d : 'bottom']: top,
|
350
|
-
backgroundColor: 'transparent',
|
351
|
-
width: '50px',
|
352
|
-
height: '50px',
|
353
|
-
outline: 'none',
|
354
|
-
border: 'none',
|
355
|
-
boxSizing: 'content-box',
|
356
|
-
padding: 0
|
357
|
-
}, 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 })));
|
358
|
-
};
|
359
|
-
const renderView = (item, index) => {
|
360
|
-
var _a, _b, _c, _d;
|
361
|
-
const rec = (0, lodash_1.cloneDeep)(recData);
|
362
|
-
rec.video.bindProducts = item === null || item === void 0 ? void 0 : item.bindProducts;
|
363
|
-
rec.video.title = (item === null || item === void 0 ? void 0 : item.title) || '';
|
364
|
-
return (react_1.default.createElement("div", { style: { position: 'relative' } },
|
365
|
-
react_1.default.createElement(react_2.SwiperSlide, { key: index, virtualIndex: index, style: { overflow: 'hidden', position: 'relative' } },
|
366
|
-
renderBottom(rec, index),
|
367
|
-
renderLikeButton(rec, index),
|
368
|
-
renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
|
369
|
-
react_1.default.createElement(ToggleButton_1.default, { style: {
|
370
|
-
position: 'absolute',
|
371
|
-
right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
|
372
|
-
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',
|
373
|
-
bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
|
374
|
-
zIndex: 999
|
375
|
-
}, 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 }),
|
376
|
-
renderContent(item, index))));
|
377
|
-
};
|
378
|
-
(0, react_1.useEffect)(() => {
|
379
|
-
var _a, _b;
|
380
|
-
if (!(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current))
|
381
|
-
return;
|
382
|
-
(_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideTo(activeIndex);
|
383
|
-
}, [activeIndex]);
|
384
|
-
const handleSessionExpire = (0, react_1.useCallback)((0, lodash_1.debounce)(() => {
|
385
|
-
var _a;
|
386
|
-
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
387
|
-
}, 1000), []);
|
388
|
-
(0, react_1.useEffect)(() => {
|
389
|
-
if (disabledListener)
|
390
|
-
return;
|
391
|
-
const events = ['touchstart', 'touchcancel'];
|
392
|
-
events.forEach((event) => {
|
393
|
-
window.addEventListener(event, handleSessionExpire);
|
394
|
-
});
|
395
|
-
return () => {
|
396
|
-
events.forEach((event) => {
|
397
|
-
window.removeEventListener(event, handleSessionExpire);
|
398
|
-
});
|
399
|
-
};
|
400
|
-
}, [handleSessionExpire, disabledListener]);
|
401
|
-
return (react_1.default.createElement("div", { id: 'sxp-render', style: { height: containerHeight, position: 'relative', pointerEvents } },
|
402
|
-
react_1.default.createElement(react_2.Swiper, { ref: swiperRef, allowTouchMove: pointerEvents !== 'none', onSlideChange: () => {
|
403
|
-
swiperRef.current.swiper.allowTouchMove = false;
|
404
|
-
setTimeout(() => {
|
405
|
-
swiperRef.current.swiper.allowTouchMove = true;
|
406
|
-
}, 500);
|
407
|
-
}, onActiveIndexChange: (swiper) => {
|
408
|
-
setCurIndex(swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex);
|
409
|
-
onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(swiper.activeIndex);
|
410
|
-
}, direction: 'vertical', style: { overflow: 'hidden', height: containerHeight }, height: containerHeight }, scenes === null || scenes === void 0 ? void 0 : scenes.map((rec, index) => {
|
411
|
-
return renderView(rec, index);
|
412
|
-
}))));
|
413
|
-
});
|
414
|
-
exports.default = (0, react_1.memo)(DiyStoryPreview);
|