pb-sxp-ui 1.15.21 → 1.15.22-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.
Files changed (46) hide show
  1. package/dist/index.cjs +7705 -7259
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +46 -46
  4. package/dist/index.js +7705 -7260
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +6 -6
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +6 -6
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +7705 -7259
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +6 -6
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/Pagebuilder/type.d.ts +10 -5
  15. package/es/core/components/DiyStoryPreview/PictureGroup.d.ts +16 -0
  16. package/es/core/components/DiyStoryPreview/PictureGroup.js +34 -0
  17. package/es/core/components/DiyStoryPreview/VideoWidget.d.ts +27 -0
  18. package/es/core/components/DiyStoryPreview/VideoWidget.js +197 -0
  19. package/es/core/components/DiyStoryPreview/index.d.ts +32 -0
  20. package/es/core/components/DiyStoryPreview/index.js +410 -0
  21. package/es/core/components/SxpPageCore/index.js +6 -4
  22. package/es/core/components/SxpPageRender/index.d.ts +0 -1
  23. package/es/core/components/SxpPageRender/typing.d.ts +19 -0
  24. package/es/core/context/SxpDataSourceProvider.d.ts +2 -1
  25. package/es/core/context/SxpDataSourceProvider.js +48 -97
  26. package/es/index.d.ts +1 -0
  27. package/es/index.js +1 -0
  28. package/es/materials/sxp/popup/CommodityDetail/index.js +2 -2
  29. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
  30. package/lib/core/Pagebuilder/type.d.ts +10 -5
  31. package/lib/core/components/DiyStoryPreview/PictureGroup.d.ts +16 -0
  32. package/lib/core/components/DiyStoryPreview/PictureGroup.js +37 -0
  33. package/lib/core/components/DiyStoryPreview/VideoWidget.d.ts +27 -0
  34. package/lib/core/components/DiyStoryPreview/VideoWidget.js +200 -0
  35. package/lib/core/components/DiyStoryPreview/index.d.ts +32 -0
  36. package/lib/core/components/DiyStoryPreview/index.js +413 -0
  37. package/lib/core/components/SxpPageCore/index.js +6 -4
  38. package/lib/core/components/SxpPageRender/index.d.ts +0 -1
  39. package/lib/core/components/SxpPageRender/typing.d.ts +19 -0
  40. package/lib/core/context/SxpDataSourceProvider.d.ts +2 -1
  41. package/lib/core/context/SxpDataSourceProvider.js +48 -97
  42. package/lib/index.d.ts +1 -0
  43. package/lib/index.js +3 -1
  44. package/lib/materials/sxp/popup/CommodityDetail/index.js +2 -2
  45. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
  46. package/package.json +1 -1
@@ -0,0 +1,413 @@
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 = [], 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
+ var _a, _b;
248
+ const scene = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.scene;
249
+ const isVideo = isVideoUrl(scene === null || scene === void 0 ? void 0 : scene.mediaUrl);
250
+ if (isVideo) {
251
+ 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: data, 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 })));
252
+ }
253
+ else {
254
+ return (react_1.default.createElement(PictureGroup_1.default, { key: index, imgUrls: [(_b = scene === null || scene === void 0 ? void 0 : scene.mediaUrl) !== null && _b !== void 0 ? _b : ''], width: containerWidth, height: containerHeight, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, data: data, swiperRef: swiperRef }));
255
+ }
256
+ };
257
+ const renderLogo = (0, react_1.useMemo)(() => {
258
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
259
+ return (react_1.default.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
260
+ react_1.default.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
261
+ }
262
+ return null;
263
+ }, [globalConfig]);
264
+ const renderBottom = (rec, index) => {
265
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
266
+ if (rec === null || rec === void 0 ? void 0 : rec.video) {
267
+ let cta = null;
268
+ 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) {
269
+ cta = '多商品CTA';
270
+ }
271
+ else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
272
+ cta = '商品CTA';
273
+ }
274
+ else {
275
+ 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;
276
+ }
277
+ const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
278
+ return (react_1.default.createElement(react_1.default.Fragment, null,
279
+ ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.title) && (react_1.default.createElement("div", { style: {
280
+ background: 'repeating-linear-gradient(0deg, rgba(26, 26, 25, 0.7), hsla(0, 0%, 100%, 0))',
281
+ height: '130px',
282
+ position: 'absolute',
283
+ bottom: 0,
284
+ width: '100%',
285
+ willChange: 'transform',
286
+ zIndex: 2,
287
+ pointerEvents
288
+ } })),
289
+ react_1.default.createElement("div", { style: {
290
+ marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px`,
291
+ zIndex: 999,
292
+ position: 'absolute',
293
+ bottom: 0,
294
+ left: 0,
295
+ right: 0,
296
+ paddingTop: '20px'
297
+ } },
298
+ (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: {} },
299
+ react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, isActive: index === activeIndex, value: value }))) : null,
300
+ react_1.default.createElement("div", null,
301
+ 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' }) }),
302
+ react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }))),
303
+ react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
304
+ }
305
+ return null;
306
+ };
307
+ const likeIcon = (0, useIconLink_1.useIconLink)(defaultLikeIconPath, appDomain);
308
+ const unlikeIcon = (0, useIconLink_1.useIconLink)(defaultUnLikeIconPath, appDomain);
309
+ const renderLikeButton = (rec, index) => {
310
+ var _a, _b, _c, _d;
311
+ if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
312
+ return null;
313
+ let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
314
+ if (top < 40) {
315
+ top += 40;
316
+ }
317
+ if (rec === null || rec === void 0 ? void 0 : rec.video) {
318
+ 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: {
319
+ top,
320
+ right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0,
321
+ position: 'absolute',
322
+ zIndex: 999,
323
+ backgroundColor: 'transparent',
324
+ width: '50px',
325
+ height: '50px',
326
+ outline: 'none',
327
+ border: 'none',
328
+ boxSizing: 'content-box',
329
+ padding: 0,
330
+ transform: 'translate3d(0px, 0px, 0px)'
331
+ } }));
332
+ }
333
+ return null;
334
+ };
335
+ const mutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
336
+ const unmutedIcon = (0, useIconLink_1.useIconLink)('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
337
+ const renderToggleButton = (visible) => {
338
+ var _a, _b, _c, _d;
339
+ if (!visible)
340
+ return null;
341
+ let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _a !== void 0 ? _a : 23;
342
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) === 'top') {
343
+ top += 45;
344
+ }
345
+ 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: {
346
+ position: 'absolute',
347
+ visibility: 'visible',
348
+ zIndex: 999,
349
+ transform: 'translate3d(0px,0px,0px)',
350
+ [(_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,
351
+ [(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _d !== void 0 ? _d : 'bottom']: top,
352
+ backgroundColor: 'transparent',
353
+ width: '50px',
354
+ height: '50px',
355
+ outline: 'none',
356
+ border: 'none',
357
+ boxSizing: 'content-box',
358
+ padding: 0
359
+ }, 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 })) : null;
360
+ };
361
+ const renderView = (item, index) => {
362
+ var _a, _b, _c, _d;
363
+ return (react_1.default.createElement("div", { style: { position: 'relative' } },
364
+ react_1.default.createElement(react_2.SwiperSlide, { key: index, virtualIndex: index, style: { overflow: 'hidden', position: 'relative' } },
365
+ renderBottom(item, index),
366
+ renderLikeButton(item, index),
367
+ renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
368
+ react_1.default.createElement(ToggleButton_1.default, { style: {
369
+ position: 'absolute',
370
+ right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
371
+ 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',
372
+ bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
373
+ zIndex: 999
374
+ }, 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 }),
375
+ renderContent(item, index))));
376
+ };
377
+ (0, react_1.useEffect)(() => {
378
+ var _a, _b;
379
+ if (!(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current))
380
+ return;
381
+ (_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);
382
+ }, [activeIndex]);
383
+ const handleSessionExpire = (0, react_1.useCallback)((0, lodash_1.debounce)(() => {
384
+ var _a;
385
+ (_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
386
+ }, 1000), []);
387
+ (0, react_1.useEffect)(() => {
388
+ if (disabledListener)
389
+ return;
390
+ const events = ['touchstart', 'touchcancel'];
391
+ events.forEach((event) => {
392
+ window.addEventListener(event, handleSessionExpire);
393
+ });
394
+ return () => {
395
+ events.forEach((event) => {
396
+ window.removeEventListener(event, handleSessionExpire);
397
+ });
398
+ };
399
+ }, [handleSessionExpire, disabledListener]);
400
+ return (react_1.default.createElement("div", { id: 'sxp-render', style: { height: containerHeight, position: 'relative', pointerEvents } },
401
+ react_1.default.createElement(react_2.Swiper, { ref: swiperRef, allowTouchMove: pointerEvents !== 'none', onSlideChange: () => {
402
+ swiperRef.current.swiper.allowTouchMove = false;
403
+ setTimeout(() => {
404
+ swiperRef.current.swiper.allowTouchMove = true;
405
+ }, 500);
406
+ }, onActiveIndexChange: (swiper) => {
407
+ setCurIndex(swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex);
408
+ onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(swiper.activeIndex);
409
+ }, direction: 'vertical', style: { overflow: 'hidden', height: containerHeight }, height: containerHeight }, data === null || data === void 0 ? void 0 : data.map((rec, index) => {
410
+ return renderView(rec, index);
411
+ }))));
412
+ });
413
+ exports.default = (0, react_1.memo)(DiyStoryPreview);
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  const SxpPageRender_1 = tslib_1.__importDefault(require("../SxpPageRender"));
6
6
  const Popup_1 = tslib_1.__importDefault(require("../SxpPageRender/Popup"));
7
+ const DiyStoryPreview_1 = tslib_1.__importDefault(require("../DiyStoryPreview"));
7
8
  const _materials_ = tslib_1.__importStar(require("../../../materials"));
8
9
  const core_1 = require("../../../core");
9
10
  const SxpDataSourceProvider_1 = tslib_1.__importDefault(require("../../../core/context/SxpDataSourceProvider"));
@@ -12,7 +13,8 @@ Object.values(_materials_).forEach((v) => {
12
13
  RESOLVER[v.extend.type] = v;
13
14
  });
14
15
  const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, enabledMetaConversionApi, dataList }) => {
15
- var _a, _b, _c, _d, _e, _f;
16
+ var _a, _b, _c, _d, _e, _f, _g;
17
+ const isDiyH5 = ((_a = data === null || data === void 0 ? void 0 : data.page_type) === null || _a === void 0 ? void 0 : _a.path_type) === 5;
16
18
  const utmVal = (0, react_1.useMemo)(() => {
17
19
  var _a;
18
20
  const searchParams = (location === null || location === void 0 ? void 0 : location.search) ? (_a = location === null || location === void 0 ? void 0 : location.search) === null || _a === void 0 ? void 0 : _a.replace('?', '') : '';
@@ -21,10 +23,10 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
21
23
  const [_schema, setSchema] = (0, react_1.useState)(data === null || data === void 0 ? void 0 : data.data);
22
24
  const [channel, setChannel] = (0, react_1.useState)();
23
25
  return (react_1.default.createElement(core_1.EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: channel || utmVal },
24
- react_1.default.createElement(SxpDataSourceProvider_1.default, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, data: data, dataList: dataList, onUpdateSchema: (d) => setSchema(d), onUpdateChannel: (d) => setChannel(d), render: ({ rtcList, tagList, pageData }) => {
25
- var _a;
26
+ react_1.default.createElement(SxpDataSourceProvider_1.default, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_c = (_b = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _b === void 0 ? void 0 : _b.personalized_recommend) !== null && _c !== void 0 ? _c : maxSize, defaultSize: (_e = (_d = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _d === void 0 ? void 0 : _d.default_recommend) !== null && _e !== void 0 ? _e : defaultSize, hashTagSize: (_g = (_f = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _f === void 0 ? void 0 : _f.hash_tag_size) !== null && _g !== void 0 ? _g : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, data: data, dataList: dataList, isDiyH5: isDiyH5, onUpdateSchema: (d) => setSchema(d), onUpdateChannel: (d) => setChannel(d), render: ({ rtcList, tagList, pageData }) => {
27
+ var _a, _b;
26
28
  return (react_1.default.createElement(react_1.default.Fragment, null,
27
- react_1.default.createElement(SxpPageRender_1.default, Object.assign({ defaultData: data }, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER })),
29
+ isDiyH5 ? (react_1.default.createElement(DiyStoryPreview_1.default, Object.assign({ defaultData: data }, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER, containerHeight: window === null || window === void 0 ? void 0 : window.innerHeight, pointerEvents: 'all', loopPlay: true }))) : (react_1.default.createElement(SxpPageRender_1.default, Object.assign({ defaultData: data }, (_b = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _b === void 0 ? void 0 : _b.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER }))),
28
30
  react_1.default.createElement(Popup_1.default, null)));
29
31
  } })));
30
32
  };
@@ -67,7 +67,6 @@ export interface ISxpPageRenderProps {
67
67
  y: number;
68
68
  };
69
69
  converApi?: any;
70
- pixel?: any;
71
70
  consentPopup?: any;
72
71
  multiPosts?: any;
73
72
  playbook?: 'paid media' | 'organic menu';
@@ -47,6 +47,24 @@ export type ProductInfoType = {
47
47
  cover?: string;
48
48
  remark?: string;
49
49
  };
50
+ export interface IScene {
51
+ blueprintStep: number;
52
+ endTime: number;
53
+ itemId: string;
54
+ mediaFileNo: string;
55
+ mediaUrl: string;
56
+ position: number;
57
+ postId: string;
58
+ sceneId: string;
59
+ sceneInfo: string;
60
+ sceneTag: string;
61
+ startTime: number;
62
+ traceInfo: string;
63
+ cover: string;
64
+ bindProducts?: any[];
65
+ title?: string;
66
+ }
67
+ export type ScenesType = IScene[];
50
68
  export type VideoInfoType = {
51
69
  bindCtaId: string;
52
70
  bindProductId: string;
@@ -65,6 +83,7 @@ export type VideoInfoType = {
65
83
  bindProduct: ProductInfoType;
66
84
  bindCta: CTAInfoType;
67
85
  hashTags: string[];
86
+ scene: IScene;
68
87
  };
69
88
  export type RecommendVideoResultType = {
70
89
  recList: Array<RecItemType>;
@@ -72,7 +72,7 @@ export interface ISxpDataSourceContext {
72
72
  bffFbReport?: (body: {
73
73
  eventName: 'PageView' | 'ProductView' | 'ViewContent';
74
74
  product?: any;
75
- }) => void;
75
+ }) => Promise<any> | undefined | boolean;
76
76
  curTime?: any;
77
77
  h5EnterLink?: () => void;
78
78
  themeTag?: any;
@@ -133,6 +133,7 @@ export interface SxpDataSourceProviderProps {
133
133
  channelQueryList?: any[];
134
134
  data?: PageData;
135
135
  dataList?: PageData[];
136
+ isDiyH5?: boolean;
136
137
  onUpdateSchema?: (d: PageData['data']) => void;
137
138
  onUpdateChannel?: (d: string) => void;
138
139
  }