pb-sxp-ui 1.15.22-alpha.1 → 1.15.22-alpha.3
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 +78 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +76 -30
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +78 -32
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/DiyStoryPreview/index.js +0 -178
- package/es/core/components/SxpPageCore/index.js +2 -3
- package/es/core/components/SxpPageRender/VideoWidget/index.d.ts +6 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +57 -15
- package/es/core/components/SxpPageRender/index.js +9 -6
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.js +2 -1
- package/lib/core/components/DiyStoryPreview/index.js +0 -178
- package/lib/core/components/SxpPageCore/index.js +2 -3
- package/lib/core/components/SxpPageRender/VideoWidget/index.d.ts +6 -1
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +56 -14
- package/lib/core/components/SxpPageRender/index.js +9 -6
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.js +2 -1
- package/package.json +1 -1
@@ -13,184 +13,6 @@ const PictureGroup_1 = tslib_1.__importDefault(require("./PictureGroup"));
|
|
13
13
|
const VideoWidget_1 = tslib_1.__importDefault(require("./VideoWidget"));
|
14
14
|
const _materials_ = tslib_1.__importStar(require("../../../materials"));
|
15
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
16
|
const RESOLVER = {};
|
195
17
|
Object.values(_materials_).forEach((v) => {
|
196
18
|
RESOLVER[v.extend.type] = v;
|
@@ -4,7 +4,6 @@ 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"));
|
8
7
|
const _materials_ = tslib_1.__importStar(require("../../../materials"));
|
9
8
|
const core_1 = require("../../../core");
|
10
9
|
const SxpDataSourceProvider_1 = tslib_1.__importDefault(require("../../../core/context/SxpDataSourceProvider"));
|
@@ -24,9 +23,9 @@ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, l
|
|
24
23
|
const [channel, setChannel] = (0, react_1.useState)();
|
25
24
|
return (react_1.default.createElement(core_1.EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: channel || utmVal },
|
26
25
|
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
|
26
|
+
var _a;
|
28
27
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
29
|
-
|
28
|
+
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 })),
|
30
29
|
react_1.default.createElement(Popup_1.default, null)));
|
31
30
|
} })));
|
32
31
|
};
|
@@ -10,6 +10,11 @@ interface IVideoWidgetProps {
|
|
10
10
|
activeIndex?: number;
|
11
11
|
videoPostConfig?: postConfigType;
|
12
12
|
videoPlayIcon?: string;
|
13
|
+
loopPlay: any;
|
14
|
+
swiperRef?: any;
|
13
15
|
}
|
14
|
-
|
16
|
+
export interface IVideoWidgetRef {
|
17
|
+
setLoopPlay: (v: boolean) => void;
|
18
|
+
}
|
19
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<IVideoWidgetProps & React.RefAttributes<IVideoWidgetRef>>>;
|
15
20
|
export default _default;
|
@@ -5,13 +5,13 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
5
5
|
const react_2 = require("swiper/react");
|
6
6
|
const useIconLink_1 = require("../useIconLink");
|
7
7
|
const FormatImage_1 = tslib_1.__importDefault(require("../FormatImage"));
|
8
|
-
const hooks_1 = require("../../../../core/hooks");
|
9
|
-
const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
|
10
8
|
const loading_gif_1 = tslib_1.__importDefault(require("./loading.gif"));
|
11
9
|
const VideoPlayer_1 = require("./VideoPlayer");
|
12
|
-
const
|
10
|
+
const hooks_1 = require("../../../../core/hooks");
|
11
|
+
const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
|
12
|
+
const VideoWidget = (0, react_1.forwardRef)(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
|
13
13
|
const [isPauseVideo, setIsPauseVideo] = (0, react_1.useState)(false);
|
14
|
-
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = (0, hooks_1.useSxpDataSource)();
|
14
|
+
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = (0, hooks_1.useSxpDataSource)();
|
15
15
|
const videoStartTime = (0, react_1.useRef)(0);
|
16
16
|
const [isLoadFinish, setIsLoadFinish] = (0, react_1.useState)(false);
|
17
17
|
const { isActive } = (0, react_2.useSwiperSlide)();
|
@@ -25,6 +25,18 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
25
25
|
const initTimeRef = (0, react_1.useRef)();
|
26
26
|
const loadedTimeRef = (0, react_1.useRef)();
|
27
27
|
const isFirstPlayRef = (0, react_1.useRef)(true);
|
28
|
+
const loopPlayRef = (0, react_1.useRef)(loopPlay);
|
29
|
+
const scene = rec.video.scene;
|
30
|
+
(0, react_1.useImperativeHandle)(ref, () => {
|
31
|
+
return {
|
32
|
+
setLoopPlay(v) {
|
33
|
+
loopPlayRef.current = v;
|
34
|
+
}
|
35
|
+
};
|
36
|
+
});
|
37
|
+
(0, react_1.useEffect)(() => {
|
38
|
+
loopPlayRef.current = loopPlay;
|
39
|
+
}, [loopPlay]);
|
28
40
|
const blur = (0, react_1.useMemo)(() => {
|
29
41
|
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
30
42
|
}, [videoPostConfig]);
|
@@ -112,12 +124,15 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
112
124
|
const handleLoadedmetadata = (0, react_1.useCallback)(() => {
|
113
125
|
if (!videoRef.current)
|
114
126
|
return;
|
127
|
+
if (isDiyH5) {
|
128
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
129
|
+
}
|
115
130
|
loadedTimeRef.current = new Date();
|
116
131
|
handleStartPlay();
|
117
132
|
handLoadeddata();
|
118
133
|
}, [videoRef.current, handLoadeddata, handleStartPlay]);
|
119
134
|
const handleClickVideo = (0, react_1.useCallback)((type) => () => {
|
120
|
-
var _a, _b, _c, _d, _e;
|
135
|
+
var _a, _b, _c, _d, _e, _f;
|
121
136
|
if (!videoRef.current)
|
122
137
|
return;
|
123
138
|
if (!isLoadFinish)
|
@@ -138,10 +153,13 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
138
153
|
break;
|
139
154
|
default:
|
140
155
|
if (isPause) {
|
141
|
-
(_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.
|
156
|
+
if (isDiyH5 && Math.round((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.currentTime) >= (scene === null || scene === void 0 ? void 0 : scene.endTime)) {
|
157
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
158
|
+
}
|
159
|
+
(_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
|
142
160
|
}
|
143
161
|
else {
|
144
|
-
(
|
162
|
+
(_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
|
145
163
|
}
|
146
164
|
setIsPauseVideo(!isPause);
|
147
165
|
break;
|
@@ -153,6 +171,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
153
171
|
return;
|
154
172
|
if (activeIndex !== index)
|
155
173
|
return;
|
174
|
+
setIsPauseVideo(true);
|
156
175
|
const item = data[index];
|
157
176
|
const videoDuration = ((_b = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
158
177
|
const videoCurrentTime = ((_d = (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
@@ -178,8 +197,27 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
178
197
|
const handleWaiting = (0, react_1.useCallback)(() => {
|
179
198
|
setWaiting(true);
|
180
199
|
}, []);
|
200
|
+
const handleTimeUpload = () => {
|
201
|
+
if (!videoRef.current || !isDiyH5)
|
202
|
+
return;
|
203
|
+
setTimeout(() => {
|
204
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
205
|
+
if (Math.round((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) >= ((_b = scene === null || scene === void 0 ? void 0 : scene.endTime) !== null && _b !== void 0 ? _b : 0)) {
|
206
|
+
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
207
|
+
if (!loopPlayRef.current)
|
208
|
+
return;
|
209
|
+
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
210
|
+
(_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(0);
|
211
|
+
}
|
212
|
+
else {
|
213
|
+
const i = (_g = (_f = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _f === void 0 ? void 0 : _f.swiper) === null || _g === void 0 ? void 0 : _g.activeIndex;
|
214
|
+
(_j = (_h = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _h === void 0 ? void 0 : _h.swiper) === null || _j === void 0 ? void 0 : _j.slideTo(i + 1);
|
215
|
+
}
|
216
|
+
}
|
217
|
+
});
|
218
|
+
};
|
181
219
|
(0, react_1.useEffect)(() => {
|
182
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
220
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
183
221
|
if (!isActive)
|
184
222
|
return;
|
185
223
|
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
|
@@ -200,6 +238,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
200
238
|
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
201
239
|
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
202
240
|
var _a;
|
241
|
+
videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
|
203
242
|
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
204
243
|
});
|
205
244
|
}
|
@@ -216,8 +255,9 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
216
255
|
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handlePlay);
|
217
256
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
|
218
257
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
|
258
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
|
219
259
|
return () => {
|
220
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
260
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
221
261
|
const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
222
262
|
if (!isPause)
|
223
263
|
handlePause();
|
@@ -232,6 +272,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
232
272
|
(_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
|
233
273
|
(_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
|
234
274
|
(_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
|
275
|
+
(_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
|
235
276
|
};
|
236
277
|
}, [isActive]);
|
237
278
|
(0, react_1.useEffect)(() => {
|
@@ -280,7 +321,8 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
280
321
|
};
|
281
322
|
}, [handleClickVideo, isActive]);
|
282
323
|
const renderPoster = (0, react_1.useMemo)(() => {
|
283
|
-
|
324
|
+
var _a, _b;
|
325
|
+
if ((!((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) && !(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image)) || isLoadFinish) {
|
284
326
|
return null;
|
285
327
|
}
|
286
328
|
return (react_1.default.createElement("img", { style: {
|
@@ -290,8 +332,8 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
290
332
|
width: '100%',
|
291
333
|
height: '100%',
|
292
334
|
objectFit: 'cover'
|
293
|
-
}, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'placeholder image' }));
|
294
|
-
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
335
|
+
}, src: ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover) || (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image), alt: 'placeholder image' }));
|
336
|
+
}, [rec, isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
295
337
|
const renderLoading = (0, react_1.useMemo)(() => {
|
296
338
|
if (!waiting || !isLoadFinish)
|
297
339
|
return;
|
@@ -349,6 +391,6 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
349
391
|
react_1.default.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
|
350
392
|
renderPoster,
|
351
393
|
renderLoading,
|
352
|
-
isPauseVideo && react_1.default.createElement(FormatImage_1.default, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })))));
|
353
|
-
};
|
394
|
+
isPauseVideo && (react_1.default.createElement(FormatImage_1.default, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' }))))));
|
395
|
+
});
|
354
396
|
exports.default = (0, react_1.memo)(VideoWidget);
|
@@ -44,7 +44,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
44
44
|
const [isReload, setIsReload] = (0, react_1.useState)(new Date().getTime());
|
45
45
|
const skipLinkRef = (0, react_1.useRef)(false);
|
46
46
|
const [pageNum, setPageNum] = (0, react_1.useState)(2);
|
47
|
-
const
|
47
|
+
const videoWidgetRef = (0, react_1.useRef)(null);
|
48
|
+
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession, isDiyH5 } = (0, hooks_1.useSxpDataSource)();
|
48
49
|
const { backMainFeed, productView, jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
49
50
|
const isShowFingerTip = (0, react_1.useMemo)(() => {
|
50
51
|
return data.length > 0 && !loading && ((0, localStore_1.getFeUserState)() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
|
@@ -179,6 +180,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
179
180
|
refreshFeSession
|
180
181
|
]);
|
181
182
|
const handleSessionExpire = (0, react_1.useCallback)((0, lodash_1.debounce)(() => {
|
183
|
+
var _a;
|
184
|
+
(_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
|
182
185
|
refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
|
183
186
|
}, 1000), [handleSessionCompleted, refreshFeSession]);
|
184
187
|
(0, react_1.useEffect)(() => {
|
@@ -214,7 +217,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
214
217
|
}, [minusHeight, containerHeight, tagHeight]);
|
215
218
|
const visList = (0, react_1.useMemo)(() => {
|
216
219
|
var _a;
|
217
|
-
const list = activeIndex === 0 && !waterFallData && !isEditor
|
220
|
+
const list = activeIndex === 0 && !waterFallData && !isEditor && !isDiyH5
|
218
221
|
? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
|
219
222
|
: data === null || data === void 0 ? void 0 : data.map((item, index) => {
|
220
223
|
if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
|
@@ -226,8 +229,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
226
229
|
});
|
227
230
|
if (!(list === null || list === void 0 ? void 0 : list.length))
|
228
231
|
return [];
|
229
|
-
return !waterFallData && !isNoMoreData ? list.concat([{ loading: true }]) : list;
|
230
|
-
}, [data, activeIndex, waterFallData, isEditor, isNoMoreData]);
|
232
|
+
return !waterFallData && !isNoMoreData && !isDiyH5 ? list.concat([{ loading: true }]) : list;
|
233
|
+
}, [data, activeIndex, waterFallData, isEditor, isNoMoreData, isDiyH5]);
|
231
234
|
const renderLogo = (0, react_1.useMemo)(() => {
|
232
235
|
var _a, _b, _c, _d;
|
233
236
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
@@ -253,7 +256,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
253
256
|
return (react_1.default.createElement(MultiPosts_1.default, Object.assign({ recData: data === null || data === void 0 ? void 0 : data[1] }, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props, (_f = (_e = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.item) === null || _f === void 0 ? void 0 : _f.event)));
|
254
257
|
}
|
255
258
|
if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
|
256
|
-
return (react_1.default.createElement(VideoWidget_1.default, { key: isReload, rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon }));
|
259
|
+
return (react_1.default.createElement(VideoWidget_1.default, Object.assign({ key: isReload }, (activeIndex === index && { ref: videoWidgetRef }), { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon, loopPlay: true, swiperRef: swiperRef })));
|
257
260
|
}
|
258
261
|
if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
|
259
262
|
return (react_1.default.createElement(PictureGroup_1.default, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
@@ -597,7 +600,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
597
600
|
if (openHashtag)
|
598
601
|
return;
|
599
602
|
handleScrollEvent(swiper);
|
600
|
-
if (waterFallData || isEditor)
|
603
|
+
if (waterFallData || isEditor || isDiyH5)
|
601
604
|
return;
|
602
605
|
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
603
606
|
if (!isLoadMore) {
|
@@ -92,6 +92,7 @@ export interface ISxpDataSourceContext {
|
|
92
92
|
refreshFeSession?: (enableReSid?: boolean, event?: (fk: string) => void) => void;
|
93
93
|
getAccount?: () => Promise<any>;
|
94
94
|
accountSonsent?: (v: boolean) => Promise<boolean>;
|
95
|
+
isDiyH5?: boolean;
|
95
96
|
}
|
96
97
|
export declare const SxpDataSourceContext: React.Context<ISxpDataSourceContext>;
|
97
98
|
export interface SxpDataSourceProviderProps {
|
@@ -628,7 +628,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
628
628
|
multiPostTimeRef,
|
629
629
|
refreshFeSession,
|
630
630
|
getAccount,
|
631
|
-
accountSonsent
|
631
|
+
accountSonsent,
|
632
|
+
isDiyH5
|
632
633
|
} }, isShowConsent ? (react_1.default.createElement(Consent_1.default, Object.assign({}, (_e = (_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.props))) : (render({
|
633
634
|
rtcList,
|
634
635
|
mutateLike: bffMutateLike,
|