pb-sxp-ui 1.15.13-alpha.4 → 1.15.14
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 +129 -774
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +128 -772
- 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 +129 -774
- 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 +41 -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 +41 -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 -19
- package/es/core/components/DiyStoryPreview/VideoWidget.js +0 -198
- package/es/core/components/DiyStoryPreview/index.d.ts +0 -31
- package/es/core/components/DiyStoryPreview/index.js +0 -389
- 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 -19
- package/lib/core/components/DiyStoryPreview/VideoWidget.js +0 -201
- package/lib/core/components/DiyStoryPreview/index.d.ts +0 -31
- package/lib/core/components/DiyStoryPreview/index.js +0 -392
@@ -117,8 +117,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
117
117
|
}
|
118
118
|
if (options.type === 'beacon' && navigator.sendBeacon) {
|
119
119
|
return navigator.sendBeacon(`${url}/api/${path}`, new Blob([
|
120
|
-
JSON.stringify(
|
121
|
-
|
120
|
+
JSON.stringify({
|
121
|
+
body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
|
122
|
+
})
|
123
|
+
], {
|
124
|
+
type: 'application/json;charset=UTF-8'
|
125
|
+
}));
|
122
126
|
}
|
123
127
|
return window
|
124
128
|
.fetch(`${url}/api/${path}`, {
|
@@ -147,16 +151,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
147
151
|
.catch((err) => Promise.reject(err));
|
148
152
|
}, [bffDataSource]);
|
149
153
|
const getRecommendVideos = (0, react_1.useCallback)((query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
150
|
-
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
151
|
-
query = Object.assign({ maxSize:
|
154
|
+
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
155
|
+
query = Object.assign({ maxSize: (_f = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _f !== void 0 ? _f : maxSize, defaultSize: (_g = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _g !== void 0 ? _g : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag, pageNum: query === null || query === void 0 ? void 0 : query.pageNum, contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter, productFilter: query === null || query === void 0 ? void 0 : query.productFilter }, (chatlabsId && { chatlabsId }));
|
152
156
|
if (channel) {
|
153
157
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
|
154
158
|
}
|
155
159
|
else if (utmVal) {
|
156
|
-
const val = (
|
160
|
+
const val = (_k = (_j = (_h = (0, tool_1.splitUrlParams)(utmVal)) === null || _h === void 0 ? void 0 : _h.filter((val) => {
|
161
|
+
var _a, _b;
|
157
162
|
const key = val.split('=')[0];
|
158
|
-
return key;
|
159
|
-
})) === null ||
|
163
|
+
return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
164
|
+
})) === null || _j === void 0 ? void 0 : _j.join('&')) !== null && _k !== void 0 ? _k : '';
|
160
165
|
if (val)
|
161
166
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
162
167
|
}
|
@@ -170,19 +175,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
170
175
|
let list = [];
|
171
176
|
let result = null;
|
172
177
|
const recurveRecList = (query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
173
|
-
var
|
178
|
+
var _v, _w, _x, _y, _z, _0;
|
174
179
|
query.pageNum = pageNum;
|
175
180
|
result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
|
176
181
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
177
182
|
return undefined;
|
178
183
|
}
|
179
184
|
setLoading(false);
|
180
|
-
list = list.concat((
|
185
|
+
list = list.concat((_y = (_x = (_w = (_v = result === null || result === void 0 ? void 0 : result.data) === null || _v === void 0 ? void 0 : _v.recList) === null || _w === void 0 ? void 0 : _w.filter) === null || _x === void 0 ? void 0 : _x.call(_w, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _y !== void 0 ? _y : []);
|
181
186
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
182
187
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
183
188
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
184
189
|
}
|
185
|
-
const isNotNullList = (
|
190
|
+
const isNotNullList = (_0 = (_z = result === null || result === void 0 ? void 0 : result.data) === null || _z === void 0 ? void 0 : _z.recList) === null || _0 === void 0 ? void 0 : _0.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
186
191
|
if (isNotNullList) {
|
187
192
|
pageNum = pageNum + 1;
|
188
193
|
yield recurveRecList(query);
|
@@ -190,13 +195,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
190
195
|
});
|
191
196
|
yield recurveRecList(query);
|
192
197
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
193
|
-
setCurReqInfo({ rtc: (
|
198
|
+
setCurReqInfo({ rtc: (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.rtc, requestId: (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.requestId });
|
194
199
|
return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
|
195
200
|
}
|
196
201
|
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
197
|
-
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (
|
202
|
+
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_o = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _o !== void 0 ? _o : 1 });
|
198
203
|
}
|
199
|
-
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('
|
204
|
+
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', { method: 'POST', body: query }));
|
200
205
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
201
206
|
return undefined;
|
202
207
|
}
|
@@ -204,8 +209,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
204
209
|
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
205
210
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
|
206
211
|
let list = [];
|
207
|
-
list = list.concat((
|
208
|
-
const isNotNullList = (
|
212
|
+
list = list.concat((_s = (_r = (_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.recList) === null || _q === void 0 ? void 0 : _q.filter) === null || _r === void 0 ? void 0 : _r.call(_q, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _s !== void 0 ? _s : []);
|
213
|
+
const isNotNullList = (_u = (_t = result === null || result === void 0 ? void 0 : result.data) === null || _t === void 0 ? void 0 : _t.recList) === null || _u === void 0 ? void 0 : _u.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
209
214
|
if (!isNotNullList) {
|
210
215
|
setIsNoMoreData(true);
|
211
216
|
}
|
@@ -214,12 +219,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
214
219
|
return result === null || result === void 0 ? void 0 : result.data;
|
215
220
|
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
|
216
221
|
const loadVideos = (0, react_1.useCallback)((pageNum) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
217
|
-
var
|
222
|
+
var _1, _2, _3, _4;
|
218
223
|
if (rtcList.length <= 0) {
|
219
224
|
return;
|
220
225
|
}
|
221
226
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
222
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((
|
227
|
+
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _1 === void 0 ? void 0 : _1.itemId) && { productFilter: [(_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _2 === void 0 ? void 0 : _2.itemId] })), (((_3 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _3 === void 0 ? void 0 : _3.itemId) && { contentFilter: [(_4 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _4 === void 0 ? void 0 : _4.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
|
223
228
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
224
229
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
225
230
|
return data;
|
@@ -271,7 +276,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
271
276
|
console.log('userInfo:', userInfo);
|
272
277
|
console.log('eventInfo:', ef);
|
273
278
|
console.log('========= 结束 =========');
|
274
|
-
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/
|
279
|
+
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/cld/${(_b = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _b === void 0 ? void 0 : _b['x-app-id']}/${eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.eventSubject}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
|
275
280
|
method: 'POST',
|
276
281
|
body: { userInfo: realUserInfo, eventInfo: realEventInfo },
|
277
282
|
type: 'beacon'
|
@@ -287,7 +292,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
287
292
|
bffDataSource
|
288
293
|
]);
|
289
294
|
const bffFbReport = (0, react_1.useCallback)(({ eventName, product }) => {
|
290
|
-
var _a, _b, _c, _d, _e, _f;
|
295
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
291
296
|
if (!enableReportEvent ||
|
292
297
|
!enabledMetaConversionApi ||
|
293
298
|
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
|
@@ -351,7 +356,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
351
356
|
}
|
352
357
|
};
|
353
358
|
getEventParams(jsonParams);
|
354
|
-
|
359
|
+
const params = {};
|
360
|
+
const queryString = location.search.slice(1);
|
361
|
+
(_f = (0, tool_1.splitUrlParams)(queryString)) === null || _f === void 0 ? void 0 : _f.map((val) => {
|
362
|
+
const key = val.split('=')[0];
|
363
|
+
const value = val.split('=')[1];
|
364
|
+
params[key] = value;
|
365
|
+
});
|
366
|
+
const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
|
367
|
+
return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_g = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _g === void 0 ? void 0 : _g['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
|
355
368
|
method: 'POST',
|
356
369
|
body: jsonParams,
|
357
370
|
type: 'beacon'
|
@@ -378,18 +391,18 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
378
391
|
return res === null || res === void 0 ? void 0 : res.success;
|
379
392
|
}), [bffFetch]);
|
380
393
|
const bffGetTagList = (0, react_1.useCallback)((data) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
381
|
-
var
|
382
|
-
const isShowTag = !!((
|
394
|
+
var _5, _6, _7, _8, _9, _10, _11, _12;
|
395
|
+
const isShowTag = !!((_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.data) === null || _5 === void 0 ? void 0 : _5.sxpPageConf) === null || _6 === void 0 ? void 0 : _6.globalConfig) === null || _7 === void 0 ? void 0 : _7.isShowTag);
|
383
396
|
if (!utmVal || !isShowTag)
|
384
397
|
return;
|
385
398
|
try {
|
386
|
-
const val = (
|
399
|
+
const val = (_10 = (_9 = (_8 = (0, tool_1.splitUrlParams)(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
|
387
400
|
var _a, _b;
|
388
401
|
const key = val.split('=')[0];
|
389
402
|
return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
|
390
|
-
})) === null ||
|
403
|
+
})) === null || _9 === void 0 ? void 0 : _9.join('&')) !== null && _10 !== void 0 ? _10 : '';
|
391
404
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
392
|
-
setTagList((
|
405
|
+
setTagList((_12 = (_11 = result === null || result === void 0 ? void 0 : result.data) === null || _11 === void 0 ? void 0 : _11.tags) !== null && _12 !== void 0 ? _12 : []);
|
393
406
|
}
|
394
407
|
catch (e) {
|
395
408
|
console.log('e', e);
|
@@ -449,10 +462,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
449
462
|
});
|
450
463
|
}, [bffEventReport]);
|
451
464
|
const getAccount = (0, react_1.useCallback)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
452
|
-
var
|
465
|
+
var _13, _14;
|
453
466
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
|
454
|
-
setChatlabsId((
|
455
|
-
return ((
|
467
|
+
setChatlabsId((_13 = res === null || res === void 0 ? void 0 : res.data) === null || _13 === void 0 ? void 0 : _13.chatLabsId);
|
468
|
+
return ((_14 = res === null || res === void 0 ? void 0 : res.data) === null || _14 === void 0 ? void 0 : _14.consentResult) === 'true';
|
456
469
|
}), [bffFetch]);
|
457
470
|
const accountSonsent = (0, react_1.useCallback)((consentResult) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
458
471
|
const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
|
package/lib/index.d.ts
CHANGED
@@ -4,7 +4,6 @@ export * as core from './core';
|
|
4
4
|
export * as materials from './materials';
|
5
5
|
export { default as SxpPageRender } from './core/components/SxpPageRender';
|
6
6
|
export { default as DiyPortalPreview } from './core/components/DiyPortalPreview';
|
7
|
-
export { default as DiyStoryPreview } from './core/components/DiyStoryPreview';
|
8
7
|
export { default as Modal } from './core/components/SxpPageRender/Modal';
|
9
8
|
export { default as SxpDataSourceProvider } from './core/context/SxpDataSourceProvider';
|
10
9
|
export { default as SxpPageCore } from './core/components/SxpPageCore';
|
package/lib/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.useEditorDataProvider = exports.EditorDataProvider = exports.SxpPageCore = exports.SxpDataSourceProvider = exports.Modal = exports.
|
3
|
+
exports.useEditorDataProvider = exports.EditorDataProvider = exports.SxpPageCore = exports.SxpDataSourceProvider = exports.Modal = exports.DiyPortalPreview = exports.SxpPageRender = exports.materials = exports.core = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const Pagebuilder_1 = require("./core/Pagebuilder");
|
6
6
|
require("./index.css");
|
@@ -10,8 +10,6 @@ var SxpPageRender_1 = require("./core/components/SxpPageRender");
|
|
10
10
|
Object.defineProperty(exports, "SxpPageRender", { enumerable: true, get: function () { return tslib_1.__importDefault(SxpPageRender_1).default; } });
|
11
11
|
var DiyPortalPreview_1 = require("./core/components/DiyPortalPreview");
|
12
12
|
Object.defineProperty(exports, "DiyPortalPreview", { enumerable: true, get: function () { return tslib_1.__importDefault(DiyPortalPreview_1).default; } });
|
13
|
-
var DiyStoryPreview_1 = require("./core/components/DiyStoryPreview");
|
14
|
-
Object.defineProperty(exports, "DiyStoryPreview", { enumerable: true, get: function () { return tslib_1.__importDefault(DiyStoryPreview_1).default; } });
|
15
13
|
var Modal_1 = require("./core/components/SxpPageRender/Modal");
|
16
14
|
Object.defineProperty(exports, "Modal", { enumerable: true, get: function () { return tslib_1.__importDefault(Modal_1).default; } });
|
17
15
|
var SxpDataSourceProvider_1 = require("./core/context/SxpDataSourceProvider");
|
@@ -6,10 +6,10 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_2 = require("swiper/react");
|
7
7
|
const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
8
8
|
const Scroll_1 = tslib_1.__importDefault(require("../components/Scroll"));
|
9
|
-
const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
|
10
9
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
11
10
|
const hooks_1 = require("../../../../core/hooks");
|
12
11
|
const tool_1 = require("../../../../core/utils/tool");
|
12
|
+
const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
|
13
13
|
const MultiCommodity = (_a) => {
|
14
14
|
var _b, _c;
|
15
15
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive", "index"]);
|
@@ -6,16 +6,15 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_2 = require("swiper/react");
|
7
7
|
const Scroll_1 = tslib_1.__importDefault(require("../components/Scroll"));
|
8
8
|
const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
9
|
-
const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
|
10
9
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
11
10
|
const hooks_1 = require("../../../../core/hooks");
|
12
11
|
const tool_1 = require("../../../../core/utils/tool");
|
12
|
+
const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
|
13
13
|
const MultiCommodityDiro = (_a) => {
|
14
14
|
var _b, _c;
|
15
15
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive", "index"]);
|
16
16
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
17
17
|
const [products] = (0, react_1.useState)((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
18
|
-
console.log(recData, '222');
|
19
18
|
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
20
19
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
21
20
|
return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement(react_2.SwiperSlide, { key: itemIndex, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
@@ -6,16 +6,15 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_2 = require("swiper/react");
|
7
7
|
const Scroll_1 = tslib_1.__importDefault(require("../components/Scroll"));
|
8
8
|
const Img_1 = tslib_1.__importDefault(require("../components/Img"));
|
9
|
-
const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
|
10
9
|
const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
|
11
10
|
const hooks_1 = require("../../../../core/hooks");
|
12
11
|
const tool_1 = require("../../../../core/utils/tool");
|
12
|
+
const EventProvider_1 = tslib_1.__importDefault(require("../components/EventProvider"));
|
13
13
|
const MultiCommodityDiroNew = (_a) => {
|
14
14
|
var _b, _c;
|
15
15
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive, index } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive", "index"]);
|
16
16
|
const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
|
17
17
|
const [products] = (0, react_1.useState)((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
|
18
|
-
console.log(recData, '333');
|
19
18
|
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
|
20
19
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
21
20
|
return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement(react_2.SwiperSlide, { key: itemIndex, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
|
@@ -15,7 +15,7 @@ const EventProvider = (_a) => {
|
|
15
15
|
const handleClick = (0, lodash_1.throttle)((e) => {
|
16
16
|
var _a, _b, _c, _d, _e, _f;
|
17
17
|
e.preventDefault();
|
18
|
-
const item = multItem
|
18
|
+
const item = multItem ? multItem : (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
|
19
19
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
20
20
|
eventSubject: 'clickCta',
|
21
21
|
eventDescription: 'User clicked the CTA'
|
@@ -42,6 +42,6 @@ const EventProvider = (_a) => {
|
|
42
42
|
setElement(null);
|
43
43
|
}
|
44
44
|
}, [element, popup]);
|
45
|
-
return (react_1.default.createElement("button", { ref: ref, className: className, style: Object.assign({
|
45
|
+
return (react_1.default.createElement("button", { ref: ref, className: className, style: Object.assign({ display: 'flex', alignItems: 'normal' }, style), onClick: handleClick, role: 'button', "aria-label": 'CTA', tabIndex: 0 }, children));
|
46
46
|
};
|
47
47
|
exports.default = (0, react_1.memo)(EventProvider);
|
package/package.json
CHANGED
@@ -1,16 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { postConfigType } from '../SxpPageRender';
|
3
|
-
import { IScene, ScenesType } from '.';
|
4
|
-
interface IPictureGroupProps {
|
5
|
-
imgUrls?: string[];
|
6
|
-
width: number;
|
7
|
-
height: number;
|
8
|
-
rec: IScene;
|
9
|
-
index: number;
|
10
|
-
imgUrlsPostConfig?: postConfigType;
|
11
|
-
swiperRef?: any;
|
12
|
-
data?: ScenesType;
|
13
|
-
loopPlay?: boolean;
|
14
|
-
}
|
15
|
-
declare const _default: React.NamedExoticComponent<IPictureGroupProps>;
|
16
|
-
export default _default;
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import React, { memo, useEffect, useState } from 'react';
|
2
|
-
import { Autoplay, Pagination } from 'swiper/modules';
|
3
|
-
import { Swiper, SwiperSlide, useSwiperSlide } from 'swiper/react';
|
4
|
-
import Picture from '../SxpPageRender/PictureGroup/Picture';
|
5
|
-
const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index, swiperRef, data = [], loopPlay }) => {
|
6
|
-
const { isActive } = useSwiperSlide();
|
7
|
-
const [isload, setIsLoad] = useState(false);
|
8
|
-
useEffect(() => {
|
9
|
-
if (isActive && isload && loopPlay) {
|
10
|
-
setTimeout(() => {
|
11
|
-
var _a, _b, _c, _d;
|
12
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
13
|
-
(_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(0);
|
14
|
-
}
|
15
|
-
else {
|
16
|
-
const i = (_c = (_b = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _b === void 0 ? void 0 : _b.swiper) === null || _c === void 0 ? void 0 : _c.activeIndex;
|
17
|
-
(_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper.slideTo(i + 1);
|
18
|
-
}
|
19
|
-
}, 3000);
|
20
|
-
}
|
21
|
-
}, [isActive, isload, data, index, swiperRef, loopPlay]);
|
22
|
-
const loadFinishImage = () => {
|
23
|
-
setIsLoad(true);
|
24
|
-
};
|
25
|
-
return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
|
26
|
-
clickable: true,
|
27
|
-
bulletActiveClass: 'swipe-item-active-bullet',
|
28
|
-
bulletElement: 'button'
|
29
|
-
}, height: height, style: { width }, loop: true, autoplay: false }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
|
30
|
-
return (React.createElement(SwiperSlide, { key: url },
|
31
|
-
React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: loadFinishImage })));
|
32
|
-
})));
|
33
|
-
};
|
34
|
-
export default memo(PictureGroup);
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { postConfigType } from '../SxpPageRender';
|
3
|
-
import { IScene, ScenesType } from '.';
|
4
|
-
interface IVideoWidgetProps {
|
5
|
-
rec: IScene;
|
6
|
-
index: number;
|
7
|
-
height: number;
|
8
|
-
width: number;
|
9
|
-
data: ScenesType;
|
10
|
-
muted: boolean;
|
11
|
-
activeIndex?: number;
|
12
|
-
videoPostConfig?: postConfigType;
|
13
|
-
swiperRef?: any;
|
14
|
-
loopPlay?: boolean;
|
15
|
-
videoPlayIcon?: string;
|
16
|
-
isPlay?: boolean;
|
17
|
-
}
|
18
|
-
declare const _default: React.NamedExoticComponent<IVideoWidgetProps>;
|
19
|
-
export default _default;
|
@@ -1,198 +0,0 @@
|
|
1
|
-
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
2
|
-
import { useSwiperSlide } from 'swiper/react';
|
3
|
-
import { useIconLink } from '../SxpPageRender/useIconLink';
|
4
|
-
import { mountVideoPlayerAtNode } from '../SxpPageRender/VideoWidget/VideoPlayer';
|
5
|
-
import FormatImage from '../SxpPageRender/FormatImage';
|
6
|
-
import { useSxpDataSource } from '../../../core/hooks';
|
7
|
-
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, loopPlay, videoPlayIcon, isPlay }) => {
|
8
|
-
const { isActive } = useSwiperSlide();
|
9
|
-
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
10
|
-
const videoRef = useRef(null);
|
11
|
-
const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
|
12
|
-
const videoStartTime = useRef(0);
|
13
|
-
const [isLoadFinish, setIsLoadFinish] = useState(false);
|
14
|
-
const [isFirstPlay, setIsFirstPlay] = useState(true);
|
15
|
-
const canvasRef = useRef(null);
|
16
|
-
const [firstFrameSrc, setFirstFrameSrc] = useState('');
|
17
|
-
const videoId = `pb-cache-video-${index}`;
|
18
|
-
const hlsRef = useRef(null);
|
19
|
-
useEffect(() => {
|
20
|
-
if (!videoRef.current)
|
21
|
-
return;
|
22
|
-
videoRef.current.muted = muted;
|
23
|
-
}, [muted]);
|
24
|
-
const handleVideoStart = useCallback(() => {
|
25
|
-
var _a;
|
26
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
27
|
-
}, []);
|
28
|
-
const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
|
29
|
-
const handlePlaying = useCallback(() => {
|
30
|
-
var _a, _b, _c, _d, _e, _f;
|
31
|
-
setIsPauseVideo(false);
|
32
|
-
const item = data[index];
|
33
|
-
if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
|
34
|
-
videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
|
35
|
-
const videoDuration = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
36
|
-
const videoCurrentTime = ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
|
37
|
-
const playType = isFirstPlay ? '0' : '1';
|
38
|
-
setIsFirstPlay(false);
|
39
|
-
}
|
40
|
-
}, [bffEventReport, data, index, isFirstPlay]);
|
41
|
-
const handleLoadedMetadata = useCallback(() => {
|
42
|
-
var _a;
|
43
|
-
videoRef.current.currentTime = rec === null || rec === void 0 ? void 0 : rec.startTime;
|
44
|
-
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
45
|
-
setIsLoadFinish(true);
|
46
|
-
}, []);
|
47
|
-
const handleClickVideo = useCallback((type) => () => {
|
48
|
-
var _a, _b, _c, _d, _e;
|
49
|
-
if (!isLoadFinish)
|
50
|
-
return;
|
51
|
-
const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
|
52
|
-
switch (type) {
|
53
|
-
case 'start':
|
54
|
-
if (!isPause)
|
55
|
-
return;
|
56
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
|
57
|
-
setIsPauseVideo(false);
|
58
|
-
break;
|
59
|
-
case 'pause':
|
60
|
-
if (isPause)
|
61
|
-
return;
|
62
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
63
|
-
setIsPauseVideo(true);
|
64
|
-
break;
|
65
|
-
default:
|
66
|
-
if (isPause) {
|
67
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
|
68
|
-
}
|
69
|
-
else {
|
70
|
-
(_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
|
71
|
-
}
|
72
|
-
setIsPauseVideo(!isPause);
|
73
|
-
break;
|
74
|
-
}
|
75
|
-
}, [isLoadFinish]);
|
76
|
-
const onPause = useCallback(() => {
|
77
|
-
var _a, _b, _c, _d, _e, _f;
|
78
|
-
const item = data[index];
|
79
|
-
const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
80
|
-
const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
|
81
|
-
if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
|
82
|
-
const playDuration = (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
|
83
|
-
}
|
84
|
-
}, [data, index, bffEventReport]);
|
85
|
-
const blur = useMemo(() => {
|
86
|
-
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
|
87
|
-
}, [videoPostConfig]);
|
88
|
-
const translateY = useMemo(() => {
|
89
|
-
var _a;
|
90
|
-
return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
|
91
|
-
? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
|
92
|
-
: 'translateY(-50%)';
|
93
|
-
}, [videoPostConfig]);
|
94
|
-
const handLoadeddata = useCallback(() => {
|
95
|
-
if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
|
96
|
-
return;
|
97
|
-
const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
|
98
|
-
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
99
|
-
const ctx = canvas.getContext('2d');
|
100
|
-
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
101
|
-
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
102
|
-
canvas.height = targetHeight;
|
103
|
-
canvas.width = targetWidth;
|
104
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
105
|
-
setFirstFrameSrc(canvas.toDataURL());
|
106
|
-
}, []);
|
107
|
-
const handleTimeUpload = useCallback(() => {
|
108
|
-
var _a, _b, _c;
|
109
|
-
if (!videoRef.current)
|
110
|
-
return;
|
111
|
-
if (((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) >= ((_b = rec === null || rec === void 0 ? void 0 : rec.endTime) !== null && _b !== void 0 ? _b : 0)) {
|
112
|
-
(_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
|
113
|
-
}
|
114
|
-
}, []);
|
115
|
-
const handlePause = () => {
|
116
|
-
var _a, _b, _c, _d, _e, _f;
|
117
|
-
if (!videoRef.current || !isActive)
|
118
|
-
return;
|
119
|
-
if (!loopPlay)
|
120
|
-
return;
|
121
|
-
if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
|
122
|
-
(_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(0);
|
123
|
-
}
|
124
|
-
else {
|
125
|
-
const i = (_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.activeIndex;
|
126
|
-
(_f = (_e = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _e === void 0 ? void 0 : _e.swiper) === null || _f === void 0 ? void 0 : _f.slideTo(i + 1);
|
127
|
-
}
|
128
|
-
};
|
129
|
-
useEffect(() => {
|
130
|
-
var _a, _b, _c;
|
131
|
-
if (!isActive)
|
132
|
-
return;
|
133
|
-
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.mediaUrl;
|
134
|
-
if (!videoSrc)
|
135
|
-
return;
|
136
|
-
setIsPauseVideo(false);
|
137
|
-
const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
|
138
|
-
if (!videoPlayerWrapperNode)
|
139
|
-
return;
|
140
|
-
videoRef.current = mountVideoPlayerAtNode === null || mountVideoPlayerAtNode === void 0 ? void 0 : mountVideoPlayerAtNode(videoPlayerWrapperNode);
|
141
|
-
if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
|
142
|
-
return;
|
143
|
-
const Hls = window === null || window === void 0 ? void 0 : window.Hls;
|
144
|
-
let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
|
145
|
-
if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
|
146
|
-
hls = new Hls();
|
147
|
-
hls === null || hls === void 0 ? void 0 : hls.loadSource(videoSrc);
|
148
|
-
hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
|
149
|
-
hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
150
|
-
var _a;
|
151
|
-
videoRef.current.currentTime = rec === null || rec === void 0 ? void 0 : rec.startTime;
|
152
|
-
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
153
|
-
});
|
154
|
-
}
|
155
|
-
else {
|
156
|
-
videoRef.current.src = videoSrc;
|
157
|
-
}
|
158
|
-
(_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
|
159
|
-
(_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('pause', handlePause);
|
160
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('timeupdate', handleTimeUpload);
|
161
|
-
return () => {
|
162
|
-
var _a, _b, _c, _d;
|
163
|
-
if (hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current)
|
164
|
-
(_a = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
165
|
-
setIsLoadFinish(false);
|
166
|
-
(_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadedmetadata', handleLoadedMetadata);
|
167
|
-
(_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('pause', handlePause);
|
168
|
-
(_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('timeupdate', handleTimeUpload);
|
169
|
-
};
|
170
|
-
}, [handleLoadedMetadata, handlePlaying, rec, handLoadeddata, isActive, loopPlay]);
|
171
|
-
const renderPoster = useMemo(() => {
|
172
|
-
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
173
|
-
return null;
|
174
|
-
}
|
175
|
-
return (React.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'video poster' }));
|
176
|
-
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
177
|
-
const blurStyle = useMemo(() => {
|
178
|
-
return blur
|
179
|
-
? {
|
180
|
-
filter: 'blur(10px)',
|
181
|
-
transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
|
182
|
-
}
|
183
|
-
: {};
|
184
|
-
}, [blur]);
|
185
|
-
if (!(rec === null || rec === void 0 ? void 0 : rec.mediaUrl)) {
|
186
|
-
return null;
|
187
|
-
}
|
188
|
-
return (React.createElement("div", { className: 'video-container', key: rec.itemId, style: {
|
189
|
-
position: 'relative',
|
190
|
-
width: '100%',
|
191
|
-
height,
|
192
|
-
overflow: 'hidden'
|
193
|
-
} },
|
194
|
-
React.createElement("div", { className: 'n-full-screen', id: videoId, style: { width: '100%', height: '100%' } }),
|
195
|
-
renderPoster,
|
196
|
-
isPauseVideo && React.createElement(FormatImage, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })));
|
197
|
-
};
|
198
|
-
export default memo(VideoWidget);
|
@@ -1,31 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { ISxpPageRenderProps } from '../SxpPageRender';
|
3
|
-
import '../SxpPageRender/index.less';
|
4
|
-
export interface IScene {
|
5
|
-
blueprintStep: number;
|
6
|
-
endTime: number;
|
7
|
-
itemId: string;
|
8
|
-
mediaFileNo: string;
|
9
|
-
mediaUrl: string;
|
10
|
-
position: number;
|
11
|
-
postId: string;
|
12
|
-
sceneId: string;
|
13
|
-
sceneInfo: string;
|
14
|
-
sceneTag: string;
|
15
|
-
startTime: number;
|
16
|
-
traceInfo: string;
|
17
|
-
bindProducts?: any[];
|
18
|
-
title?: string;
|
19
|
-
}
|
20
|
-
export type ScenesType = IScene[];
|
21
|
-
export type DiyStoryPreviewType = ISxpPageRenderProps & {
|
22
|
-
appDomain?: string;
|
23
|
-
scenes?: ScenesType;
|
24
|
-
activeIndex?: number;
|
25
|
-
onActiveChange?: (v: number) => void;
|
26
|
-
loopPlay?: boolean;
|
27
|
-
pointerEvents?: any;
|
28
|
-
isPlay?: boolean;
|
29
|
-
};
|
30
|
-
declare const _default: React.NamedExoticComponent<DiyStoryPreviewType>;
|
31
|
-
export default _default;
|