pb-sxp-ui 1.0.87 → 1.0.89
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 +297 -353
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +298 -354
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +300 -356
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/FormatImage.js +2 -7
- package/es/core/components/SxpPageRender/VideoWidget/index.js +39 -31
- package/es/core/components/SxpPageRender/index.js +78 -91
- package/es/core/context/SxpDataSourceProvider.js +19 -16
- package/es/materials/sxp/popup/AppointForm/index.js +1 -3
- package/es/materials/sxp/template/Appoint/index.js +7 -6
- package/es/materials/sxp/template/Commodity/index.js +7 -14
- package/es/materials/sxp/template/CommodityDiro/index.js +7 -14
- package/es/materials/sxp/template/CommodityDiroNew/index.js +7 -14
- package/es/materials/sxp/template/Link/index.js +5 -5
- package/es/materials/sxp/template/MultiCommodity/index.js +3 -6
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +3 -6
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +3 -6
- package/es/materials/sxp/template/components/EventProvider.js +1 -13
- package/es/materials/sxp/template/components/Img.d.ts +5 -3
- package/es/materials/sxp/template/components/Img.js +4 -3
- package/lib/core/components/SxpPageRender/FormatImage.js +2 -7
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +39 -31
- package/lib/core/components/SxpPageRender/index.js +78 -91
- package/lib/core/context/SxpDataSourceProvider.js +19 -16
- package/lib/materials/sxp/popup/AppointForm/index.js +1 -3
- package/lib/materials/sxp/template/Appoint/index.js +7 -6
- package/lib/materials/sxp/template/Commodity/index.js +7 -14
- package/lib/materials/sxp/template/CommodityDiro/index.js +7 -14
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +7 -14
- package/lib/materials/sxp/template/Link/index.js +5 -5
- package/lib/materials/sxp/template/MultiCommodity/index.js +3 -6
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +3 -6
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +3 -6
- package/lib/materials/sxp/template/components/EventProvider.js +0 -12
- package/lib/materials/sxp/template/components/Img.d.ts +5 -3
- package/lib/materials/sxp/template/components/Img.js +4 -3
- package/package.json +2 -4
package/dist/index.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
import { isEmpty, isEqual, cloneDeep, debounce, throttle, get } from 'lodash';
|
2
2
|
import { v4 } from 'uuid';
|
3
3
|
import pako from 'pako';
|
4
|
-
import React, { useContext, useMemo,
|
4
|
+
import React, { useContext, useMemo, memo, useEffect, createContext, useState, useRef, useCallback, forwardRef, useImperativeHandle, useLayoutEffect } from 'react';
|
5
5
|
import qs from 'qs';
|
6
6
|
import EventEmitter from 'eventemitter3';
|
7
7
|
import { css } from '@emotion/css';
|
8
|
-
import { BetaSchemaForm } from '@ant-design/pro-components';
|
9
8
|
import * as ReactDOM from 'react-dom';
|
9
|
+
import Hls from 'hls.js';
|
10
10
|
|
11
11
|
/******************************************************************************
|
12
12
|
Copyright (c) Microsoft Corporation.
|
@@ -415,6 +415,70 @@ var SXP_EVENT_TYPE;
|
|
415
415
|
SXP_EVENT_TYPE["CHANGE_THEME_TAG"] = "changeThemeTag";
|
416
416
|
})(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
|
417
417
|
|
418
|
+
/*
|
419
|
+
* @Author: binruan@chatlabs.com
|
420
|
+
* @Date: 2024-06-13 15:16:53
|
421
|
+
* @LastEditors: binruan@chatlabs.com
|
422
|
+
* @LastEditTime: 2024-06-19 14:13:50
|
423
|
+
* @FilePath: \pb-sxp-ui\src\core\components\Consent\index.tsx
|
424
|
+
*
|
425
|
+
*/
|
426
|
+
const Consent$2 = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
|
427
|
+
const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
|
428
|
+
const channelObj = useMemo(() => {
|
429
|
+
const queryString = location.search.slice(1);
|
430
|
+
const params = qs.parse(queryString.replace(/\+/g, '%2B'));
|
431
|
+
for (const key in params) {
|
432
|
+
params[key] = params[key].replace(/%2B/g, '+');
|
433
|
+
}
|
434
|
+
return params;
|
435
|
+
}, []);
|
436
|
+
const getUtmValue = (key) => { var _a; return (_a = channelObj[key]) !== null && _a !== void 0 ? _a : null; };
|
437
|
+
useEffect(() => {
|
438
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
439
|
+
eventInfo: {
|
440
|
+
eventSubject: 'privacyEnter',
|
441
|
+
eventDescription: 'User enter privacy page',
|
442
|
+
utmSource: getUtmValue('utm_source'),
|
443
|
+
utmMedium: getUtmValue('utm_medium'),
|
444
|
+
utmCampaign: getUtmValue('utm_campaign'),
|
445
|
+
utmId: getUtmValue('utm_id'),
|
446
|
+
utmContent: getUtmValue('utm_content'),
|
447
|
+
clSource: getUtmValue('cl_source'),
|
448
|
+
enterTime: `${Date.now()}`,
|
449
|
+
enterUrl: window.location.href,
|
450
|
+
rtc: null,
|
451
|
+
requestId: null,
|
452
|
+
sessionID: null
|
453
|
+
}
|
454
|
+
});
|
455
|
+
}, []);
|
456
|
+
const handleAgree = () => {
|
457
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
458
|
+
eventInfo: {
|
459
|
+
eventSubject: 'userConsent',
|
460
|
+
eventDescription: '用户授权【操作结果】',
|
461
|
+
consentResult: '0',
|
462
|
+
consentTags: '["系统运营"]',
|
463
|
+
rtc: null,
|
464
|
+
requestId: null,
|
465
|
+
sessionID: null
|
466
|
+
}
|
467
|
+
});
|
468
|
+
setIsAgreePolicy === null || setIsAgreePolicy === void 0 ? void 0 : setIsAgreePolicy(true);
|
469
|
+
window.localStorage.setItem(AGREE_POLICY, 'yes');
|
470
|
+
};
|
471
|
+
return (React.createElement("div", { className: 'consent-bg' },
|
472
|
+
React.createElement("div", { className: 'consent' },
|
473
|
+
React.createElement("div", { className: 'consent-col' },
|
474
|
+
React.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
|
475
|
+
React.createElement("div", { className: 'consent-content' }, privacy_context !== null && privacy_context !== void 0 ? privacy_context : 'This site uses cookies to improve your online experience. By continuing to use the site please agree the policy first.')),
|
476
|
+
React.createElement("div", { className: 'consent-col' },
|
477
|
+
React.createElement("button", { "aria-label": 'agree', className: 'consent-btn', onClick: handleAgree }, "Agree"),
|
478
|
+
React.createElement("a", { className: 'consent-policy', target: '_blank', href: privacy_policy_url ? `https://${privacy_policy_url}` : undefined }, privacy_policy_title !== null && privacy_policy_title !== void 0 ? privacy_policy_title : 'More information')))));
|
479
|
+
};
|
480
|
+
var Consent$3 = memo(Consent$2);
|
481
|
+
|
418
482
|
const SxpDataSourceContext = createContext({
|
419
483
|
rtcList: [],
|
420
484
|
tagList: []
|
@@ -426,6 +490,7 @@ var DataSourceType;
|
|
426
490
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
427
491
|
const DEFAULT_TAG = 'FOR U';
|
428
492
|
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false }) => {
|
493
|
+
var _a, _b, _c;
|
429
494
|
const [rtcList, setRtcList] = useState([]);
|
430
495
|
const [tagList, setTagList] = useState([]);
|
431
496
|
const [loading, setLoading] = useState(false);
|
@@ -492,10 +557,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
492
557
|
}, [bffDataSource]);
|
493
558
|
// 获取推荐视频数据
|
494
559
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
495
|
-
var
|
560
|
+
var _d, _e, _f, _g, _h;
|
496
561
|
query = {
|
497
|
-
maxSize: (
|
498
|
-
defaultSize: (
|
562
|
+
maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
|
563
|
+
defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
|
499
564
|
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
500
565
|
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
501
566
|
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
@@ -503,10 +568,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
503
568
|
themeTag: query === null || query === void 0 ? void 0 : query.themeTag
|
504
569
|
};
|
505
570
|
if (utmVal) {
|
506
|
-
const val = (
|
571
|
+
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
507
572
|
const key = val.split('=')[0];
|
508
573
|
return UTM_KEYS.includes(key);
|
509
|
-
})) === null ||
|
574
|
+
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
510
575
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
511
576
|
}
|
512
577
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
@@ -518,7 +583,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
518
583
|
return result === null || result === void 0 ? void 0 : result.data;
|
519
584
|
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
520
585
|
const loadVideos = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
521
|
-
var
|
586
|
+
var _j, _k;
|
522
587
|
if (rtcList.length <= 0) {
|
523
588
|
return;
|
524
589
|
}
|
@@ -528,8 +593,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
528
593
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
529
594
|
themeTag: themeTag.current
|
530
595
|
});
|
531
|
-
setRtcList(rtcList.concat((
|
532
|
-
setCacheRtcList(cacheRtcList.concat((
|
596
|
+
setRtcList(rtcList.concat((_j = data === null || data === void 0 ? void 0 : data.recList) !== null && _j !== void 0 ? _j : []));
|
597
|
+
setCacheRtcList(cacheRtcList.concat((_k = data === null || data === void 0 ? void 0 : data.recList) !== null && _k !== void 0 ? _k : []));
|
533
598
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
534
599
|
const bffEventReport = useCallback(({ userInfo, eventInfo }) => {
|
535
600
|
// 关闭 BFF 事件上报
|
@@ -593,16 +658,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
593
658
|
}), [bffFetch]);
|
594
659
|
// 获取 Tag
|
595
660
|
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
596
|
-
var
|
661
|
+
var _l, _m, _o, _p, _q;
|
597
662
|
if (!utmVal || !isShowTag)
|
598
663
|
return;
|
599
664
|
try {
|
600
|
-
const val = (
|
665
|
+
const val = (_o = (_m = (_l = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _l === void 0 ? void 0 : _l.filter((val) => {
|
601
666
|
const key = val.split('=')[0];
|
602
667
|
return UTM_KEYS.includes(key);
|
603
|
-
})) === null ||
|
668
|
+
})) === null || _m === void 0 ? void 0 : _m.join('&')) !== null && _o !== void 0 ? _o : '';
|
604
669
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
605
|
-
setTagList((
|
670
|
+
setTagList((_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []);
|
606
671
|
}
|
607
672
|
catch (e) {
|
608
673
|
console.log('e', e);
|
@@ -653,8 +718,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
653
718
|
});
|
654
719
|
}, [bffEventReport]);
|
655
720
|
useEffect(() => {
|
656
|
-
|
657
|
-
|
721
|
+
if (!isShowConsent)
|
722
|
+
h5EnterLink();
|
723
|
+
}, [isShowConsent]);
|
658
724
|
useEffect(() => {
|
659
725
|
if (isShowConsent)
|
660
726
|
return;
|
@@ -737,13 +803,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
737
803
|
isShowConsent,
|
738
804
|
selectTag,
|
739
805
|
setSelectTag
|
740
|
-
} }, render({
|
806
|
+
} }, isShowConsent ? (React.createElement(Consent$3, Object.assign({}, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props))) : (render({
|
741
807
|
rtcList,
|
742
808
|
mutateLike: bffMutateLike,
|
743
809
|
mutateUnlike: bffMutateUnlike,
|
744
810
|
submitForm: bffSubmitForm,
|
745
811
|
tagList
|
746
|
-
})));
|
812
|
+
}))));
|
747
813
|
};
|
748
814
|
var SxpDataSourceProvider$1 = memo(SxpDataSourceProvider);
|
749
815
|
|
@@ -1269,7 +1335,7 @@ const AppointForm$1 = (_a) => {
|
|
1269
1335
|
key: '4'
|
1270
1336
|
}
|
1271
1337
|
], []);
|
1272
|
-
|
1338
|
+
useMemo(() => {
|
1273
1339
|
if (layoutType === undefined) {
|
1274
1340
|
const list = cloneDeep(columns) || defaultColumns;
|
1275
1341
|
return list === null || list === void 0 ? void 0 : list.map((obj) => (Object.assign(Object.assign({}, obj), { title: undefined, fieldProps: { placeholder: obj === null || obj === void 0 ? void 0 : obj.title } })));
|
@@ -1312,8 +1378,7 @@ const AppointForm$1 = (_a) => {
|
|
1312
1378
|
return (React.createElement("div", { className: 'pb-appoint-form' },
|
1313
1379
|
React.createElement("div", { className: `pb-appoint-form-title ${css(Object.assign({}, textStyle))}` }, title),
|
1314
1380
|
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
1315
|
-
React.createElement("div", { className: 'pb-appoint-form-container' },
|
1316
|
-
React.createElement(BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
|
1381
|
+
React.createElement("div", { className: 'pb-appoint-form-container' })),
|
1317
1382
|
React.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
|
1318
1383
|
React.createElement("button", { "aria-label": submitText, onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? React.createElement(React.Fragment, null, "loading...") : submitText))));
|
1319
1384
|
};
|
@@ -8507,26 +8572,21 @@ var ExpandableText$1 = memo(ExpandableText);
|
|
8507
8572
|
* @Author: binruan@chatlabs.com
|
8508
8573
|
* @Date: 2024-03-20 10:27:31
|
8509
8574
|
* @LastEditors: binruan@chatlabs.com
|
8510
|
-
* @LastEditTime: 2024-06-
|
8575
|
+
* @LastEditTime: 2024-06-20 18:56:52
|
8511
8576
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
|
8512
8577
|
*
|
8513
8578
|
*/
|
8514
8579
|
const FormatImage = forwardRef((props, ref) => {
|
8515
8580
|
const { src, onLoad, style, className, loading } = props;
|
8516
8581
|
const [imgSrc, setImgSrc] = useState();
|
8517
|
-
const { swiperRef } = useSxpDataSource();
|
8518
8582
|
useImperativeHandle(ref, () => ({
|
8519
8583
|
setSrc: (v) => {
|
8520
8584
|
setImgSrc(v);
|
8521
8585
|
}
|
8522
8586
|
}));
|
8523
8587
|
useEffect(() => {
|
8524
|
-
|
8525
|
-
|
8526
|
-
const index = (_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.activeIndex;
|
8527
|
-
if (index === 0 || index > 0)
|
8528
|
-
setImgSrc(src);
|
8529
|
-
}, [src, swiperRef]);
|
8588
|
+
setImgSrc(src);
|
8589
|
+
}, [src]);
|
8530
8590
|
useRef(null);
|
8531
8591
|
// useEffect(() => {
|
8532
8592
|
// let observer: any = null;
|
@@ -9538,6 +9598,38 @@ var interactionRender$6 = [
|
|
9538
9598
|
}
|
9539
9599
|
];
|
9540
9600
|
|
9601
|
+
const EventProvider = (_a) => {
|
9602
|
+
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
9603
|
+
const ref = useRef(null);
|
9604
|
+
const { popup } = useEditor();
|
9605
|
+
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
9606
|
+
const { jumpToWeb } = useEventReport();
|
9607
|
+
const handleClick = throttle(() => {
|
9608
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
9609
|
+
const item = (_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;
|
9610
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9611
|
+
eventSubject: 'clickCta',
|
9612
|
+
eventDescription: 'User clicked the CTA'
|
9613
|
+
}, rec, item, index);
|
9614
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
9615
|
+
if (isExternalLink) {
|
9616
|
+
if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) {
|
9617
|
+
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
9618
|
+
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
9619
|
+
jumpToWeb(rec, product, cta, index);
|
9620
|
+
window.location.href = window.getJointUtmLink((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link);
|
9621
|
+
}
|
9622
|
+
}
|
9623
|
+
else {
|
9624
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9625
|
+
}
|
9626
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9627
|
+
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
9628
|
+
};
|
9629
|
+
var EventProvider$1 = memo(EventProvider);
|
9630
|
+
|
9631
|
+
var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
9632
|
+
|
9541
9633
|
/*
|
9542
9634
|
* @Author: binruan@chatlabs.com
|
9543
9635
|
* @Date: 2023-04-12 09:58:58
|
@@ -9565,64 +9657,40 @@ function useOnScreen(ref) {
|
|
9565
9657
|
return isOnScreen;
|
9566
9658
|
}
|
9567
9659
|
|
9568
|
-
|
9569
|
-
|
9660
|
+
/*
|
9661
|
+
* @Author: binruan@chatlabs.com
|
9662
|
+
* @Date: 2024-01-16 14:50:13
|
9663
|
+
* @LastEditors: binruan@chatlabs.com
|
9664
|
+
* @LastEditTime: 2024-06-21 11:59:25
|
9665
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
9666
|
+
*
|
9667
|
+
*/
|
9668
|
+
const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
9570
9669
|
const ref = useRef(null);
|
9571
9670
|
const isOnScreen = useOnScreen(ref);
|
9572
|
-
const {
|
9573
|
-
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
9574
|
-
const { jumpToWeb } = useEventReport();
|
9671
|
+
const { ctaEvent } = useSxpDataSource();
|
9575
9672
|
useEffect(() => {
|
9576
|
-
|
9577
|
-
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
9578
|
-
const item = (_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;
|
9673
|
+
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
9579
9674
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9580
9675
|
eventSubject: 'ctaExposure',
|
9581
9676
|
eventDescription: 'The cta was shown to the user'
|
9582
9677
|
}, rec, item, index);
|
9583
9678
|
}
|
9584
|
-
}, [isOnScreen, ref, rec, ctaEvent, index]);
|
9585
|
-
|
9586
|
-
|
9587
|
-
|
9588
|
-
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9589
|
-
eventSubject: 'clickCta',
|
9590
|
-
eventDescription: 'User clicked the CTA'
|
9591
|
-
}, rec, item, index);
|
9592
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
9593
|
-
if (isExternalLink) {
|
9594
|
-
if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) {
|
9595
|
-
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
9596
|
-
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
9597
|
-
jumpToWeb(rec, product, cta, index);
|
9598
|
-
window.location.href = window.getJointUtmLink((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link);
|
9599
|
-
}
|
9600
|
-
}
|
9601
|
-
else {
|
9602
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9603
|
-
}
|
9604
|
-
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9605
|
-
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
9679
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
9680
|
+
return (React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, imgStyle)) },
|
9681
|
+
React.createElement("div", { ref: ref, hidden: !src, className: css({ width: '100%', height: '100%' }) },
|
9682
|
+
React.createElement(FormatImage$1, { className: css(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block', objectPosition: `50% ${translateY ? -translateY + 50 : 50}%` }, style)), src: `${src}?imrquality/rquality/40` }))));
|
9606
9683
|
};
|
9607
|
-
var
|
9608
|
-
|
9609
|
-
var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
9684
|
+
var Img$1 = memo(Img);
|
9610
9685
|
|
9611
9686
|
const Commodity$1 = (_a) => {
|
9612
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
9613
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
9687
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
9688
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index"]);
|
9614
9689
|
const { sxpParameter } = useSxpDataSource();
|
9615
9690
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9616
9691
|
const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
|
9617
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9618
|
-
React.createElement(
|
9619
|
-
React.createElement(FormatImage$1, { className: css({
|
9620
|
-
width: '100%',
|
9621
|
-
objectFit: 'cover',
|
9622
|
-
height: '100%',
|
9623
|
-
display: 'block',
|
9624
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
9625
|
-
}), src: src })),
|
9692
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
9693
|
+
React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
9626
9694
|
React.createElement("div", { className: css({
|
9627
9695
|
color: '#fff',
|
9628
9696
|
display: 'flex',
|
@@ -9631,8 +9699,8 @@ const Commodity$1 = (_a) => {
|
|
9631
9699
|
width: '100%',
|
9632
9700
|
overflow: 'hidden'
|
9633
9701
|
}) },
|
9634
|
-
React.createElement("div", { className: styles$6['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9635
|
-
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9702
|
+
React.createElement("div", { className: styles$6['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name'),
|
9703
|
+
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now'))));
|
9636
9704
|
};
|
9637
9705
|
var CommodityComponent = memo(Commodity$1);
|
9638
9706
|
|
@@ -9705,14 +9773,14 @@ var interactionRender$5 = [
|
|
9705
9773
|
];
|
9706
9774
|
|
9707
9775
|
const Appoint$1 = (_a) => {
|
9708
|
-
var _b, _c, _d, _e;
|
9709
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9776
|
+
var _b, _c, _d, _e, _f, _g;
|
9777
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
9710
9778
|
const { sxpParameter } = useSxpDataSource();
|
9711
9779
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
9712
|
-
|
9713
|
-
|
9714
|
-
|
9715
|
-
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9780
|
+
const src = (_d = (_c = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image;
|
9781
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' }, index: index }, props),
|
9782
|
+
React.createElement(Img$1, { src: src, rec: recData, item: (_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) !== null && _f !== void 0 ? _f : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
9783
|
+
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _g !== void 0 ? _g : 'Product Name')));
|
9716
9784
|
};
|
9717
9785
|
var AppointComponent = memo(Appoint$1);
|
9718
9786
|
|
@@ -9769,7 +9837,7 @@ const Appoint = createMaterial(AppointComponent, {
|
|
9769
9837
|
var styles$5 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__nkBlU"};
|
9770
9838
|
|
9771
9839
|
const Link$1 = (_a) => {
|
9772
|
-
var _b, _c, _d, _e, _f;
|
9840
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
9773
9841
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index"]);
|
9774
9842
|
const { sxpParameter, bffEventReport } = useSxpDataSource();
|
9775
9843
|
const { jumpToWeb } = useEventReport();
|
@@ -9781,16 +9849,16 @@ const Link$1 = (_a) => {
|
|
9781
9849
|
window.location.href = window.getJointUtmLink(cta.link);
|
9782
9850
|
}
|
9783
9851
|
};
|
9852
|
+
const src = (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
|
9784
9853
|
return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
|
9785
|
-
React.createElement(
|
9786
|
-
React.createElement(FormatImage$1, { className: css({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image })),
|
9854
|
+
React.createElement(Img$1, { src: src, rec: recData, item: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.bindProduct) !== null && _g !== void 0 ? _g : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
9787
9855
|
React.createElement("div", { className: css({
|
9788
9856
|
display: 'flex',
|
9789
9857
|
alignItems: 'center',
|
9790
9858
|
width: '100%',
|
9791
9859
|
overflow: 'hidden'
|
9792
9860
|
}) },
|
9793
|
-
React.createElement("div", { className: styles$5['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle }, (
|
9861
|
+
React.createElement("div", { className: styles$5['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle }, (_h = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _h !== void 0 ? _h : 'Product Name'))));
|
9794
9862
|
};
|
9795
9863
|
var LinkComponent = memo(Link$1);
|
9796
9864
|
|
@@ -9858,20 +9926,13 @@ var interactionRender$4 = [
|
|
9858
9926
|
var styles$4 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__yyHVb"};
|
9859
9927
|
|
9860
9928
|
const CommodityDiro$1 = (_a) => {
|
9861
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
9862
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
9929
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
9930
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index"]);
|
9863
9931
|
const { sxpParameter } = useSxpDataSource();
|
9864
9932
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9865
9933
|
const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
|
9866
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9867
|
-
React.createElement(
|
9868
|
-
React.createElement(FormatImage$1, { className: css({
|
9869
|
-
width: '100%',
|
9870
|
-
objectFit: 'cover',
|
9871
|
-
height: '100%',
|
9872
|
-
display: 'block',
|
9873
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
9874
|
-
}), src: src })),
|
9934
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
9935
|
+
React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
9875
9936
|
React.createElement("div", { className: css({
|
9876
9937
|
color: '#fff',
|
9877
9938
|
display: 'flex',
|
@@ -9880,8 +9941,8 @@ const CommodityDiro$1 = (_a) => {
|
|
9880
9941
|
width: '100%',
|
9881
9942
|
overflow: 'hidden'
|
9882
9943
|
}) },
|
9883
|
-
React.createElement("div", { className: styles$4['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9884
|
-
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9944
|
+
React.createElement("div", { className: styles$4['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name'),
|
9945
|
+
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now'))));
|
9885
9946
|
};
|
9886
9947
|
var CommodityDiroComponent = memo(CommodityDiro$1);
|
9887
9948
|
|
@@ -9956,20 +10017,13 @@ var interactionRender$3 = [
|
|
9956
10017
|
var styles$3 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__I-yCC"};
|
9957
10018
|
|
9958
10019
|
const CommodityDiroNew$1 = (_a) => {
|
9959
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
9960
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
10020
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
10021
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY", "index"]);
|
9961
10022
|
const { sxpParameter } = useSxpDataSource();
|
9962
10023
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9963
10024
|
const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
|
9964
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9965
|
-
React.createElement(
|
9966
|
-
React.createElement(FormatImage$1, { className: css({
|
9967
|
-
width: '100%',
|
9968
|
-
objectFit: 'cover',
|
9969
|
-
height: '100%',
|
9970
|
-
display: 'block',
|
9971
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
9972
|
-
}), src: src })),
|
10025
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
10026
|
+
React.createElement(Img$1, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
9973
10027
|
React.createElement("div", { className: css({
|
9974
10028
|
color: '#fff',
|
9975
10029
|
display: 'flex',
|
@@ -9978,8 +10032,8 @@ const CommodityDiroNew$1 = (_a) => {
|
|
9978
10032
|
width: '100%',
|
9979
10033
|
overflow: 'hidden'
|
9980
10034
|
}) },
|
9981
|
-
React.createElement("div", { className: styles$3['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9982
|
-
React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
10035
|
+
React.createElement("div", { className: styles$3['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_j = product === null || product === void 0 ? void 0 : product.title) !== null && _j !== void 0 ? _j : 'Product Name'),
|
10036
|
+
React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_l = (_k = product === null || product === void 0 ? void 0 : product.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop now'))));
|
9983
10037
|
};
|
9984
10038
|
var CommodityDiroNewComponent = memo(CommodityDiroNew$1);
|
9985
10039
|
|
@@ -10057,31 +10111,6 @@ const Scroll = ({ children, isPadding = true }) => {
|
|
10057
10111
|
};
|
10058
10112
|
var Scroll$1 = memo(Scroll);
|
10059
10113
|
|
10060
|
-
/*
|
10061
|
-
* @Author: binruan@chatlabs.com
|
10062
|
-
* @Date: 2024-01-16 14:50:13
|
10063
|
-
* @LastEditors: binruan@chatlabs.com
|
10064
|
-
* @LastEditTime: 2024-05-21 16:34:13
|
10065
|
-
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
10066
|
-
*
|
10067
|
-
*/
|
10068
|
-
const Img = ({ src, rec, item, index, style }) => {
|
10069
|
-
const ref = useRef(null);
|
10070
|
-
const isOnScreen = useOnScreen(ref);
|
10071
|
-
const { ctaEvent } = useSxpDataSource();
|
10072
|
-
useEffect(() => {
|
10073
|
-
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
10074
|
-
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10075
|
-
eventSubject: 'ctaExposure',
|
10076
|
-
eventDescription: 'The cta was shown to the user'
|
10077
|
-
}, rec, item, index);
|
10078
|
-
}
|
10079
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
10080
|
-
return (React.createElement("div", { ref: ref, hidden: !src, className: css({ width: '100%', height: '100%' }) },
|
10081
|
-
React.createElement(FormatImage$1, { className: css(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }, style)), src: src })));
|
10082
|
-
};
|
10083
|
-
var Img$1 = memo(Img);
|
10084
|
-
|
10085
10114
|
var styles$2 = {"two-line-ellipsis":"index-module_two-line-ellipsis__SFQwJ"};
|
10086
10115
|
|
10087
10116
|
const MultiCommodityDiro$1 = (_a) => {
|
@@ -10109,11 +10138,8 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
10109
10138
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10110
10139
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10111
10140
|
var _a, _b, _c, _d, _e, _f, _g;
|
10112
|
-
return (React.createElement(
|
10113
|
-
React.createElement(
|
10114
|
-
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, style: {
|
10115
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
10116
|
-
} })),
|
10141
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: item === null || item === void 0 ? void 0 : item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10142
|
+
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
10117
10143
|
React.createElement("div", { className: css({
|
10118
10144
|
color: '#000',
|
10119
10145
|
display: 'flex',
|
@@ -10123,7 +10149,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
10123
10149
|
overflow: 'hidden'
|
10124
10150
|
}) },
|
10125
10151
|
React.createElement("div", { className: styles$2['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
|
10126
|
-
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))));
|
10152
|
+
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))))));
|
10127
10153
|
})));
|
10128
10154
|
};
|
10129
10155
|
var MultiCommodityDiroComponent = memo(MultiCommodityDiro$1);
|
@@ -10224,11 +10250,8 @@ const MultiCommodity$1 = (_a) => {
|
|
10224
10250
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10225
10251
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10226
10252
|
var _a, _b, _c, _d, _e, _f, _g;
|
10227
|
-
return (React.createElement(
|
10228
|
-
React.createElement(
|
10229
|
-
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, style: {
|
10230
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
10231
|
-
} })),
|
10253
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10254
|
+
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
10232
10255
|
React.createElement("div", { className: css({
|
10233
10256
|
color: '#fff',
|
10234
10257
|
display: 'flex',
|
@@ -10238,7 +10261,7 @@ const MultiCommodity$1 = (_a) => {
|
|
10238
10261
|
overflow: 'hidden'
|
10239
10262
|
}) },
|
10240
10263
|
React.createElement("div", { className: styles$1['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
|
10241
|
-
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))));
|
10264
|
+
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))))));
|
10242
10265
|
})));
|
10243
10266
|
};
|
10244
10267
|
var MultiCommodityComponent = memo(MultiCommodity$1);
|
@@ -10338,11 +10361,8 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
10338
10361
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10339
10362
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10340
10363
|
var _a, _b, _c, _d, _e, _f, _g;
|
10341
|
-
return (React.createElement(
|
10342
|
-
React.createElement(
|
10343
|
-
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, style: {
|
10344
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
10345
|
-
} })),
|
10364
|
+
return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, Object.assign({ key: item === null || item === void 0 ? void 0 : item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10365
|
+
React.createElement(Img$1, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
|
10346
10366
|
React.createElement("div", { className: css({
|
10347
10367
|
color: '#fff',
|
10348
10368
|
display: 'flex',
|
@@ -10353,7 +10373,7 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
10353
10373
|
lineHeight: '20px'
|
10354
10374
|
}) },
|
10355
10375
|
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
|
10356
|
-
React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop now'))));
|
10376
|
+
React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop now'))))));
|
10357
10377
|
})));
|
10358
10378
|
};
|
10359
10379
|
var MultiCommodityDiroNewComponent = memo(MultiCommodityDiroNew$1);
|
@@ -12706,10 +12726,10 @@ var settingRender = [
|
|
12706
12726
|
}
|
12707
12727
|
];
|
12708
12728
|
|
12709
|
-
const Consent$
|
12710
|
-
return React.createElement(Consent$
|
12729
|
+
const Consent$1 = (props) => {
|
12730
|
+
return React.createElement(Consent$1, Object.assign({}, props));
|
12711
12731
|
};
|
12712
|
-
var ConsentComponent = memo(Consent$
|
12732
|
+
var ConsentComponent = memo(Consent$1);
|
12713
12733
|
|
12714
12734
|
/*
|
12715
12735
|
* @Author: binruan@chatlabs.com
|
@@ -12719,7 +12739,7 @@ var ConsentComponent = memo(Consent$3);
|
|
12719
12739
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\Consent\material.tsx
|
12720
12740
|
*
|
12721
12741
|
*/
|
12722
|
-
const Consent
|
12742
|
+
const Consent = createMaterial(ConsentComponent, {
|
12723
12743
|
displayName: 'Consent',
|
12724
12744
|
icon: '',
|
12725
12745
|
category: 'base',
|
@@ -12754,7 +12774,7 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
12754
12774
|
CommodityDetailDiroNew: CommodityDetailDiroNew,
|
12755
12775
|
CommodityDiro: CommodityDiro,
|
12756
12776
|
CommodityDiroNew: CommodityDiroNew,
|
12757
|
-
Consent: Consent
|
12777
|
+
Consent: Consent,
|
12758
12778
|
HashTag: HashTag,
|
12759
12779
|
Link: Link,
|
12760
12780
|
MultiCommodity: MultiCommodity,
|
@@ -12860,7 +12880,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12860
12880
|
useEffect(() => {
|
12861
12881
|
if (!videoRef)
|
12862
12882
|
return;
|
12863
|
-
videoRef
|
12883
|
+
videoRef.muted = muted;
|
12864
12884
|
}, [muted, videoRef]);
|
12865
12885
|
const handleEnded = useCallback(() => {
|
12866
12886
|
if (!videoRef)
|
@@ -12875,10 +12895,10 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12875
12895
|
setIsLoadFinish(true);
|
12876
12896
|
setIsPauseVideo(false);
|
12877
12897
|
const item = data[index];
|
12878
|
-
if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
12879
|
-
videoStartTime.current = (videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
12880
|
-
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
12881
|
-
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
12898
|
+
if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration)) {
|
12899
|
+
videoStartTime.current = (videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) || 0;
|
12900
|
+
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) !== null && _a !== void 0 ? _a : 0).toFixed(2);
|
12901
|
+
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
12882
12902
|
const playType = isFirstPlay ? '0' : '1';
|
12883
12903
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12884
12904
|
eventInfo: {
|
@@ -12902,21 +12922,17 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12902
12922
|
var _a;
|
12903
12923
|
if (!videoRef || firstFrameSrc || !blur)
|
12904
12924
|
return;
|
12905
|
-
|
12906
|
-
if (!videoDomRef)
|
12907
|
-
return;
|
12908
|
-
videoDomRef.style.objectFit = 'contain';
|
12925
|
+
videoRef.style.objectFit = 'contain';
|
12909
12926
|
if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !canvasRef.current || isBgColor)
|
12910
12927
|
return;
|
12911
12928
|
const setFrameImg = () => {
|
12912
|
-
const video = videoDomRef;
|
12913
12929
|
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
12914
12930
|
const ctx = canvas.getContext('2d');
|
12915
12931
|
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
12916
12932
|
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
12917
12933
|
canvas.height = targetHeight;
|
12918
12934
|
canvas.width = targetWidth;
|
12919
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(
|
12935
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(videoRef, 0, 0, canvas.width, canvas.height);
|
12920
12936
|
setFirstFrameSrc(canvas.toDataURL());
|
12921
12937
|
};
|
12922
12938
|
setFrameImg();
|
@@ -12928,21 +12944,13 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12928
12944
|
if (!videoRef)
|
12929
12945
|
return;
|
12930
12946
|
handLoadeddata();
|
12931
|
-
// if (activeIndex !== index) {
|
12932
|
-
// videoRef?.play();
|
12933
|
-
// videoRef?.pause();
|
12934
|
-
// }
|
12935
|
-
// setIsLoadFinish(true);
|
12936
12947
|
}, [videoRef, handLoadeddata]);
|
12937
|
-
useCallback(() => {
|
12938
|
-
setIsLoadFinish(true);
|
12939
|
-
}, []);
|
12940
12948
|
const handleClickVideo = useCallback((type) => () => {
|
12941
12949
|
if (!videoRef)
|
12942
12950
|
return;
|
12943
12951
|
if (!isLoadFinish)
|
12944
12952
|
return;
|
12945
|
-
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused
|
12953
|
+
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused;
|
12946
12954
|
switch (type) {
|
12947
12955
|
case 'start':
|
12948
12956
|
if (!isPause)
|
@@ -12974,10 +12982,10 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12974
12982
|
if (activeIndex !== index)
|
12975
12983
|
return;
|
12976
12984
|
const item = data[index];
|
12977
|
-
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
12978
|
-
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
12979
|
-
if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
12980
|
-
const playDuration = ((videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
12985
|
+
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) !== null && _a !== void 0 ? _a : 0).toFixed(2);
|
12986
|
+
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
12987
|
+
if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) {
|
12988
|
+
const playDuration = ((videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) - videoStartTime.current).toFixed(2);
|
12981
12989
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12982
12990
|
eventInfo: {
|
12983
12991
|
eventSubject: 'playOverVideo',
|
@@ -13001,7 +13009,19 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
13001
13009
|
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
|
13002
13010
|
if (!videoSrc)
|
13003
13011
|
return;
|
13004
|
-
|
13012
|
+
if (videoSrc.includes('.m3u8')) {
|
13013
|
+
if (Hls.isSupported()) {
|
13014
|
+
const hls = new Hls();
|
13015
|
+
hls.loadSource(videoSrc);
|
13016
|
+
hls.attachMedia(videoRef.current);
|
13017
|
+
}
|
13018
|
+
else {
|
13019
|
+
videoRef.src = videoSrc;
|
13020
|
+
}
|
13021
|
+
}
|
13022
|
+
else {
|
13023
|
+
videoRef.src = videoSrc;
|
13024
|
+
}
|
13005
13025
|
setIsPauseVideo(false);
|
13006
13026
|
const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
|
13007
13027
|
const dom = document.querySelector('#player-container-id');
|
@@ -13009,20 +13029,20 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
13009
13029
|
if (!dom && !dom2)
|
13010
13030
|
return;
|
13011
13031
|
videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
|
13012
|
-
videoRef
|
13013
|
-
videoRef
|
13014
|
-
|
13015
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13016
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13017
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13032
|
+
videoRef.setAttribute('x5-playsinline', 'true');
|
13033
|
+
videoRef.setAttribute('webkit-playsinline', 'true');
|
13034
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadedmetadata', handleLoadedmetadata);
|
13035
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadeddata', handLoadeddata);
|
13036
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('playing', handlePlaying);
|
13037
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('pause', handlePause);
|
13038
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('ended', handleEnded);
|
13018
13039
|
return () => {
|
13019
13040
|
dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
|
13020
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13021
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13022
|
-
|
13023
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13024
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13025
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('ended', handleEnded);
|
13041
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadedmetadata', handleLoadedmetadata);
|
13042
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadeddata', handLoadeddata);
|
13043
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('playing', handlePlaying);
|
13044
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('pause', handlePause);
|
13045
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('ended', handleEnded);
|
13026
13046
|
};
|
13027
13047
|
}, [isActive, videoId, rec, videoRef]);
|
13028
13048
|
useEffect(() => {
|
@@ -13044,7 +13064,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
13044
13064
|
useEffect(() => {
|
13045
13065
|
if (!isActive || !videoRef)
|
13046
13066
|
return;
|
13047
|
-
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused
|
13067
|
+
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused;
|
13048
13068
|
if (!isPause && openHashtag) {
|
13049
13069
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
|
13050
13070
|
}
|
@@ -13483,142 +13503,64 @@ const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
|
13483
13503
|
};
|
13484
13504
|
var Tagbar$1 = memo(Tagbar);
|
13485
13505
|
|
13486
|
-
/*
|
13487
|
-
* @Author: binruan@chatlabs.com
|
13488
|
-
* @Date: 2024-06-13 15:16:53
|
13489
|
-
* @LastEditors: binruan@chatlabs.com
|
13490
|
-
* @LastEditTime: 2024-06-19 14:13:50
|
13491
|
-
* @FilePath: \pb-sxp-ui\src\core\components\Consent\index.tsx
|
13492
|
-
*
|
13493
|
-
*/
|
13494
|
-
const Consent = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
|
13495
|
-
const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
|
13496
|
-
const channelObj = useMemo(() => {
|
13497
|
-
const queryString = location.search.slice(1);
|
13498
|
-
const params = qs.parse(queryString.replace(/\+/g, '%2B'));
|
13499
|
-
for (const key in params) {
|
13500
|
-
params[key] = params[key].replace(/%2B/g, '+');
|
13501
|
-
}
|
13502
|
-
return params;
|
13503
|
-
}, []);
|
13504
|
-
const getUtmValue = (key) => { var _a; return (_a = channelObj[key]) !== null && _a !== void 0 ? _a : null; };
|
13505
|
-
useEffect(() => {
|
13506
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13507
|
-
eventInfo: {
|
13508
|
-
eventSubject: 'privacyEnter',
|
13509
|
-
eventDescription: 'User enter privacy page',
|
13510
|
-
utmSource: getUtmValue('utm_source'),
|
13511
|
-
utmMedium: getUtmValue('utm_medium'),
|
13512
|
-
utmCampaign: getUtmValue('utm_campaign'),
|
13513
|
-
utmId: getUtmValue('utm_id'),
|
13514
|
-
utmContent: getUtmValue('utm_content'),
|
13515
|
-
clSource: getUtmValue('cl_source'),
|
13516
|
-
enterTime: `${Date.now()}`,
|
13517
|
-
enterUrl: window.location.href,
|
13518
|
-
rtc: null,
|
13519
|
-
requestId: null,
|
13520
|
-
sessionID: null
|
13521
|
-
}
|
13522
|
-
});
|
13523
|
-
}, []);
|
13524
|
-
const handleAgree = () => {
|
13525
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13526
|
-
eventInfo: {
|
13527
|
-
eventSubject: 'userConsent',
|
13528
|
-
eventDescription: '用户授权【操作结果】',
|
13529
|
-
consentResult: '0',
|
13530
|
-
consentTags: '["系统运营"]',
|
13531
|
-
rtc: null,
|
13532
|
-
requestId: null,
|
13533
|
-
sessionID: null
|
13534
|
-
}
|
13535
|
-
});
|
13536
|
-
setIsAgreePolicy === null || setIsAgreePolicy === void 0 ? void 0 : setIsAgreePolicy(true);
|
13537
|
-
window.localStorage.setItem(AGREE_POLICY, 'yes');
|
13538
|
-
};
|
13539
|
-
return (React.createElement("div", { className: 'consent-bg' },
|
13540
|
-
React.createElement("div", { className: 'consent' },
|
13541
|
-
React.createElement("div", { className: 'consent-col' },
|
13542
|
-
React.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
|
13543
|
-
React.createElement("div", { className: 'consent-content' }, privacy_context !== null && privacy_context !== void 0 ? privacy_context : 'This site uses cookies to improve your online experience. By continuing to use the site please agree the policy first.')),
|
13544
|
-
React.createElement("div", { className: 'consent-col' },
|
13545
|
-
React.createElement("button", { "aria-label": 'agree', className: 'consent-btn', onClick: handleAgree }, "Agree"),
|
13546
|
-
React.createElement("a", { className: 'consent-policy', target: '_blank', href: privacy_policy_url ? `https://${privacy_policy_url}` : undefined }, privacy_policy_title !== null && privacy_policy_title !== void 0 ? privacy_policy_title : 'More information')))));
|
13547
|
-
};
|
13548
|
-
var Consent$1 = memo(Consent);
|
13549
|
-
|
13550
13506
|
/*
|
13551
13507
|
* @Author: binruan@chatlabs.com
|
13552
13508
|
* @Date: 2024-01-15 19:03:09
|
13553
13509
|
* @LastEditors: binruan@chatlabs.com
|
13554
|
-
* @LastEditTime: 2024-06-
|
13510
|
+
* @LastEditTime: 2024-06-21 08:56:05
|
13555
13511
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
13556
13512
|
*
|
13557
13513
|
*/
|
13558
13514
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
|
13559
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
13515
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
13560
13516
|
const { schema } = useEditor();
|
13561
13517
|
const [activeIndex, setActiveIndex] = useState(0);
|
13562
13518
|
const viewImageStartTime = useRef(0);
|
13563
|
-
|
13519
|
+
useState(false);
|
13564
13520
|
const [isMuted, setIsMuted] = useState(true);
|
13565
13521
|
const viewTime = useRef();
|
13566
13522
|
const [isLoadMore, setIsLoadMore] = useState(false);
|
13567
13523
|
const [isShowMore, setIsShowMore] = useState(false);
|
13568
13524
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag } = useSxpDataSource();
|
13569
13525
|
const { backMainFeed } = useEventReport();
|
13570
|
-
const
|
13571
|
-
const playerRef = useRef();
|
13526
|
+
const videoRef = useRef();
|
13572
13527
|
const { productView } = useEventReport();
|
13573
13528
|
const isShowFingerTip = useMemo(() => {
|
13574
13529
|
return data.length > 0 && !loading && getFeUserId();
|
13575
13530
|
}, [data, loading]);
|
13576
|
-
|
13577
|
-
|
13578
|
-
|
13531
|
+
useEffect(() => {
|
13532
|
+
refreshFeSessionId();
|
13533
|
+
}, []);
|
13534
|
+
useEffect(() => {
|
13535
|
+
if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
|
13536
|
+
const now = new Date();
|
13537
|
+
viewTime.current = now;
|
13538
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
13539
|
+
eventName: 'PageView'
|
13540
|
+
});
|
13579
13541
|
}
|
13542
|
+
}, [data === null || data === void 0 ? void 0 : data.length]);
|
13543
|
+
const handleH5EnterLink = useCallback(() => {
|
13580
13544
|
refreshFeSessionId();
|
13581
|
-
|
13582
|
-
|
13583
|
-
|
13584
|
-
|
13545
|
+
h5EnterLink === null || h5EnterLink === void 0 ? void 0 : h5EnterLink();
|
13546
|
+
if (data.length > 0) {
|
13547
|
+
const now = new Date();
|
13548
|
+
viewTime.current = now;
|
13549
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
13550
|
+
eventName: 'PageView'
|
13551
|
+
});
|
13585
13552
|
}
|
13586
|
-
|
13587
|
-
eventName: 'PageView'
|
13588
|
-
});
|
13589
|
-
setIsInit(true);
|
13590
|
-
}, [data.length, bffFbReport, h5EnterLink, isInit]);
|
13553
|
+
}, [data.length, bffFbReport, h5EnterLink]);
|
13591
13554
|
const firstRef = useRef();
|
13592
13555
|
useEffect(() => {
|
13593
13556
|
var _a, _b, _c, _d;
|
13594
|
-
if (!firstRef.current &&
|
13557
|
+
if (!firstRef.current && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
|
13595
13558
|
firstRef.current = true;
|
13596
|
-
|
13597
|
-
|
13598
|
-
|
13599
|
-
loop: false,
|
13600
|
-
autoplay: true,
|
13601
|
-
muted: true,
|
13602
|
-
preload: 'auto',
|
13603
|
-
posterImage: false,
|
13604
|
-
bigPlayButton: true,
|
13605
|
-
sources: ((_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url)
|
13606
|
-
? [
|
13607
|
-
{
|
13608
|
-
src: (_d = (_c = data === null || data === void 0 ? void 0 : data[0]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.url
|
13609
|
-
}
|
13610
|
-
]
|
13611
|
-
: []
|
13612
|
-
});
|
13613
|
-
player === null || player === void 0 ? void 0 : player.ready(() => {
|
13614
|
-
setVideoRef(player);
|
13615
|
-
});
|
13559
|
+
if ((_b = (_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.url) {
|
13560
|
+
videoRef.current.src = (_d = (_c = data === null || data === void 0 ? void 0 : data[0]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.url;
|
13561
|
+
}
|
13616
13562
|
}
|
13617
|
-
}, [videoRef,
|
13618
|
-
useEffect(() => {
|
13619
|
-
if (!isInit)
|
13620
|
-
handleH5EnterLink();
|
13621
|
-
}, [handleH5EnterLink, isInit]);
|
13563
|
+
}, [videoRef, data]);
|
13622
13564
|
useEffect(() => {
|
13623
13565
|
var _a;
|
13624
13566
|
const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
|
@@ -13736,7 +13678,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13736
13678
|
const renderContent = useCallback((rec, index) => {
|
13737
13679
|
var _a, _b, _c, _d;
|
13738
13680
|
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13739
|
-
return (React.createElement(VideoWidget$3, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef }));
|
13681
|
+
return (React.createElement(VideoWidget$3, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef.current }));
|
13740
13682
|
}
|
13741
13683
|
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13742
13684
|
return (React.createElement(PictureGroup$3, { 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, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
@@ -13762,7 +13704,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13762
13704
|
tipText,
|
13763
13705
|
resolver,
|
13764
13706
|
schema,
|
13765
|
-
videoRef
|
13707
|
+
videoRef.current
|
13766
13708
|
]);
|
13767
13709
|
const onExpandableChange = useCallback((v) => {
|
13768
13710
|
setIsShowMore(v);
|
@@ -13920,14 +13862,17 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13920
13862
|
}
|
13921
13863
|
};
|
13922
13864
|
const visList = useMemo(() => {
|
13923
|
-
|
13924
|
-
|
13925
|
-
|
13926
|
-
|
13927
|
-
|
13928
|
-
|
13929
|
-
|
13930
|
-
|
13865
|
+
var _a;
|
13866
|
+
const list = activeIndex === 0
|
13867
|
+
? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
|
13868
|
+
: data === null || data === void 0 ? void 0 : data.map((item, index) => {
|
13869
|
+
if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
|
13870
|
+
return item;
|
13871
|
+
}
|
13872
|
+
else {
|
13873
|
+
return null;
|
13874
|
+
}
|
13875
|
+
});
|
13931
13876
|
return !waterFallData ? list.concat([{ loading: true }]) : list;
|
13932
13877
|
}, [data, activeIndex, waterFallData]);
|
13933
13878
|
const renderView = useMemo(() => {
|
@@ -13952,48 +13897,47 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13952
13897
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
13953
13898
|
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
13954
13899
|
return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
|
13955
|
-
|
13956
|
-
|
13957
|
-
|
13958
|
-
|
13959
|
-
|
13960
|
-
|
13961
|
-
|
13962
|
-
|
13963
|
-
|
13964
|
-
|
13965
|
-
|
13966
|
-
|
13967
|
-
|
13968
|
-
|
13969
|
-
|
13970
|
-
|
13971
|
-
|
13972
|
-
|
13973
|
-
|
13974
|
-
|
13975
|
-
|
13976
|
-
|
13977
|
-
if (
|
13978
|
-
|
13979
|
-
|
13980
|
-
|
13981
|
-
|
13982
|
-
});
|
13983
|
-
}
|
13900
|
+
waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, onClose: () => {
|
13901
|
+
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
13902
|
+
} })),
|
13903
|
+
renderLogo,
|
13904
|
+
React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
13905
|
+
isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 + ((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _a !== void 0 ? _a : 0)}%` } })) : null,
|
13906
|
+
React.createElement(Swiper, { style: {
|
13907
|
+
marginTop: tagHeight
|
13908
|
+
}, ref: swiperRef, onSlideChange: () => {
|
13909
|
+
swiperRef.current.swiper.allowTouchMove = false;
|
13910
|
+
setTimeout(() => {
|
13911
|
+
swiperRef.current.swiper.allowTouchMove = true;
|
13912
|
+
}, 500);
|
13913
|
+
}, onActiveIndexChange: (swiper) => {
|
13914
|
+
setActiveIndex(swiper.activeIndex);
|
13915
|
+
if (openHashtag)
|
13916
|
+
return;
|
13917
|
+
// 处理上滑下滑事件
|
13918
|
+
handleScrollEvent(swiper);
|
13919
|
+
if (waterFallData)
|
13920
|
+
return;
|
13921
|
+
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 2 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
13922
|
+
if (!isLoadMore) {
|
13923
|
+
setIsLoadMore(true);
|
13924
|
+
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(Math.ceil(activeIndex / 10) + 1).then(() => {
|
13925
|
+
setIsLoadMore(false);
|
13926
|
+
});
|
13984
13927
|
}
|
13985
|
-
}
|
13986
|
-
|
13987
|
-
|
13988
|
-
|
13989
|
-
|
13990
|
-
|
13991
|
-
|
13992
|
-
|
13993
|
-
|
13994
|
-
|
13928
|
+
}
|
13929
|
+
}, direction: 'vertical', height: height },
|
13930
|
+
React.createElement(ToggleButton$1, { style: {
|
13931
|
+
position: 'fixed',
|
13932
|
+
visibility: ((_c = (_b = data === null || data === void 0 ? void 0 : data[activeIndex]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
|
13933
|
+
zIndex: 999,
|
13934
|
+
[(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _d !== void 0 ? _d : 'right']: (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _e !== void 0 ? _e : 0,
|
13935
|
+
[(_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _f !== void 0 ? _f : 'bottom']: (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _g !== void 0 ? _g : 23
|
13936
|
+
}, defaultValue: isMuted, 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, onChange: setIsMuted }),
|
13937
|
+
renderView),
|
13938
|
+
React.createElement(WaterFall$1, Object.assign({}, (_k = (_j = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.item) === null || _k === void 0 ? void 0 : _k.props)),
|
13995
13939
|
React.createElement("div", { style: { position: 'absolute', zIndex: -100 } },
|
13996
|
-
React.createElement("video", { ref:
|
13940
|
+
React.createElement("video", { ref: videoRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', preload: 'auto', controls: false, muted: true, style: {
|
13997
13941
|
backgroundColor: 'transparent',
|
13998
13942
|
width: '100%',
|
13999
13943
|
height: '100%',
|