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.cjs
CHANGED
@@ -9,8 +9,8 @@ var React = require('react');
|
|
9
9
|
var qs = require('qs');
|
10
10
|
var EventEmitter = require('eventemitter3');
|
11
11
|
var css = require('@emotion/css');
|
12
|
-
var proComponents = require('@ant-design/pro-components');
|
13
12
|
var ReactDOM = require('react-dom');
|
13
|
+
var Hls = require('hls.js');
|
14
14
|
|
15
15
|
function _interopNamespaceDefault(e) {
|
16
16
|
var n = Object.create(null);
|
@@ -438,6 +438,70 @@ var SXP_EVENT_TYPE;
|
|
438
438
|
SXP_EVENT_TYPE["CHANGE_THEME_TAG"] = "changeThemeTag";
|
439
439
|
})(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
|
440
440
|
|
441
|
+
/*
|
442
|
+
* @Author: binruan@chatlabs.com
|
443
|
+
* @Date: 2024-06-13 15:16:53
|
444
|
+
* @LastEditors: binruan@chatlabs.com
|
445
|
+
* @LastEditTime: 2024-06-19 14:13:50
|
446
|
+
* @FilePath: \pb-sxp-ui\src\core\components\Consent\index.tsx
|
447
|
+
*
|
448
|
+
*/
|
449
|
+
const Consent$2 = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
|
450
|
+
const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
|
451
|
+
const channelObj = React.useMemo(() => {
|
452
|
+
const queryString = location.search.slice(1);
|
453
|
+
const params = qs.parse(queryString.replace(/\+/g, '%2B'));
|
454
|
+
for (const key in params) {
|
455
|
+
params[key] = params[key].replace(/%2B/g, '+');
|
456
|
+
}
|
457
|
+
return params;
|
458
|
+
}, []);
|
459
|
+
const getUtmValue = (key) => { var _a; return (_a = channelObj[key]) !== null && _a !== void 0 ? _a : null; };
|
460
|
+
React.useEffect(() => {
|
461
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
462
|
+
eventInfo: {
|
463
|
+
eventSubject: 'privacyEnter',
|
464
|
+
eventDescription: 'User enter privacy page',
|
465
|
+
utmSource: getUtmValue('utm_source'),
|
466
|
+
utmMedium: getUtmValue('utm_medium'),
|
467
|
+
utmCampaign: getUtmValue('utm_campaign'),
|
468
|
+
utmId: getUtmValue('utm_id'),
|
469
|
+
utmContent: getUtmValue('utm_content'),
|
470
|
+
clSource: getUtmValue('cl_source'),
|
471
|
+
enterTime: `${Date.now()}`,
|
472
|
+
enterUrl: window.location.href,
|
473
|
+
rtc: null,
|
474
|
+
requestId: null,
|
475
|
+
sessionID: null
|
476
|
+
}
|
477
|
+
});
|
478
|
+
}, []);
|
479
|
+
const handleAgree = () => {
|
480
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
481
|
+
eventInfo: {
|
482
|
+
eventSubject: 'userConsent',
|
483
|
+
eventDescription: '用户授权【操作结果】',
|
484
|
+
consentResult: '0',
|
485
|
+
consentTags: '["系统运营"]',
|
486
|
+
rtc: null,
|
487
|
+
requestId: null,
|
488
|
+
sessionID: null
|
489
|
+
}
|
490
|
+
});
|
491
|
+
setIsAgreePolicy === null || setIsAgreePolicy === void 0 ? void 0 : setIsAgreePolicy(true);
|
492
|
+
window.localStorage.setItem(AGREE_POLICY, 'yes');
|
493
|
+
};
|
494
|
+
return (React.createElement("div", { className: 'consent-bg' },
|
495
|
+
React.createElement("div", { className: 'consent' },
|
496
|
+
React.createElement("div", { className: 'consent-col' },
|
497
|
+
React.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
|
498
|
+
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.')),
|
499
|
+
React.createElement("div", { className: 'consent-col' },
|
500
|
+
React.createElement("button", { "aria-label": 'agree', className: 'consent-btn', onClick: handleAgree }, "Agree"),
|
501
|
+
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')))));
|
502
|
+
};
|
503
|
+
var Consent$3 = React.memo(Consent$2);
|
504
|
+
|
441
505
|
const SxpDataSourceContext = React.createContext({
|
442
506
|
rtcList: [],
|
443
507
|
tagList: []
|
@@ -449,6 +513,7 @@ var DataSourceType;
|
|
449
513
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
450
514
|
const DEFAULT_TAG = 'FOR U';
|
451
515
|
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 }) => {
|
516
|
+
var _a, _b, _c;
|
452
517
|
const [rtcList, setRtcList] = React.useState([]);
|
453
518
|
const [tagList, setTagList] = React.useState([]);
|
454
519
|
const [loading, setLoading] = React.useState(false);
|
@@ -515,10 +580,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
515
580
|
}, [bffDataSource]);
|
516
581
|
// 获取推荐视频数据
|
517
582
|
const getRecommendVideos = React.useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
518
|
-
var
|
583
|
+
var _d, _e, _f, _g, _h;
|
519
584
|
query = {
|
520
|
-
maxSize: (
|
521
|
-
defaultSize: (
|
585
|
+
maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
|
586
|
+
defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
|
522
587
|
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
523
588
|
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
524
589
|
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
@@ -526,10 +591,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
526
591
|
themeTag: query === null || query === void 0 ? void 0 : query.themeTag
|
527
592
|
};
|
528
593
|
if (utmVal) {
|
529
|
-
const val = (
|
594
|
+
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
530
595
|
const key = val.split('=')[0];
|
531
596
|
return UTM_KEYS.includes(key);
|
532
|
-
})) === null ||
|
597
|
+
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
533
598
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
534
599
|
}
|
535
600
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
@@ -541,7 +606,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
541
606
|
return result === null || result === void 0 ? void 0 : result.data;
|
542
607
|
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
543
608
|
const loadVideos = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
544
|
-
var
|
609
|
+
var _j, _k;
|
545
610
|
if (rtcList.length <= 0) {
|
546
611
|
return;
|
547
612
|
}
|
@@ -551,8 +616,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
551
616
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
552
617
|
themeTag: themeTag.current
|
553
618
|
});
|
554
|
-
setRtcList(rtcList.concat((
|
555
|
-
setCacheRtcList(cacheRtcList.concat((
|
619
|
+
setRtcList(rtcList.concat((_j = data === null || data === void 0 ? void 0 : data.recList) !== null && _j !== void 0 ? _j : []));
|
620
|
+
setCacheRtcList(cacheRtcList.concat((_k = data === null || data === void 0 ? void 0 : data.recList) !== null && _k !== void 0 ? _k : []));
|
556
621
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
557
622
|
const bffEventReport = React.useCallback(({ userInfo, eventInfo }) => {
|
558
623
|
// 关闭 BFF 事件上报
|
@@ -616,16 +681,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
616
681
|
}), [bffFetch]);
|
617
682
|
// 获取 Tag
|
618
683
|
const bffGetTagList = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
619
|
-
var
|
684
|
+
var _l, _m, _o, _p, _q;
|
620
685
|
if (!utmVal || !isShowTag)
|
621
686
|
return;
|
622
687
|
try {
|
623
|
-
const val = (
|
688
|
+
const val = (_o = (_m = (_l = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _l === void 0 ? void 0 : _l.filter((val) => {
|
624
689
|
const key = val.split('=')[0];
|
625
690
|
return UTM_KEYS.includes(key);
|
626
|
-
})) === null ||
|
691
|
+
})) === null || _m === void 0 ? void 0 : _m.join('&')) !== null && _o !== void 0 ? _o : '';
|
627
692
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
628
|
-
setTagList((
|
693
|
+
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 : []);
|
629
694
|
}
|
630
695
|
catch (e) {
|
631
696
|
console.log('e', e);
|
@@ -676,8 +741,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
676
741
|
});
|
677
742
|
}, [bffEventReport]);
|
678
743
|
React.useEffect(() => {
|
679
|
-
|
680
|
-
|
744
|
+
if (!isShowConsent)
|
745
|
+
h5EnterLink();
|
746
|
+
}, [isShowConsent]);
|
681
747
|
React.useEffect(() => {
|
682
748
|
if (isShowConsent)
|
683
749
|
return;
|
@@ -760,13 +826,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
760
826
|
isShowConsent,
|
761
827
|
selectTag,
|
762
828
|
setSelectTag
|
763
|
-
} }, render({
|
829
|
+
} }, 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({
|
764
830
|
rtcList,
|
765
831
|
mutateLike: bffMutateLike,
|
766
832
|
mutateUnlike: bffMutateUnlike,
|
767
833
|
submitForm: bffSubmitForm,
|
768
834
|
tagList
|
769
|
-
})));
|
835
|
+
}))));
|
770
836
|
};
|
771
837
|
var SxpDataSourceProvider$1 = React.memo(SxpDataSourceProvider);
|
772
838
|
|
@@ -1292,7 +1358,7 @@ const AppointForm$1 = (_a) => {
|
|
1292
1358
|
key: '4'
|
1293
1359
|
}
|
1294
1360
|
], []);
|
1295
|
-
|
1361
|
+
React.useMemo(() => {
|
1296
1362
|
if (layoutType === undefined) {
|
1297
1363
|
const list = lodash.cloneDeep(columns) || defaultColumns;
|
1298
1364
|
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 } })));
|
@@ -1335,8 +1401,7 @@ const AppointForm$1 = (_a) => {
|
|
1335
1401
|
return (React.createElement("div", { className: 'pb-appoint-form' },
|
1336
1402
|
React.createElement("div", { className: `pb-appoint-form-title ${css.css(Object.assign({}, textStyle))}` }, title),
|
1337
1403
|
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
1338
|
-
React.createElement("div", { className: 'pb-appoint-form-container' },
|
1339
|
-
React.createElement(proComponents.BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
|
1404
|
+
React.createElement("div", { className: 'pb-appoint-form-container' })),
|
1340
1405
|
React.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
|
1341
1406
|
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))));
|
1342
1407
|
};
|
@@ -8530,26 +8595,21 @@ var ExpandableText$1 = React.memo(ExpandableText);
|
|
8530
8595
|
* @Author: binruan@chatlabs.com
|
8531
8596
|
* @Date: 2024-03-20 10:27:31
|
8532
8597
|
* @LastEditors: binruan@chatlabs.com
|
8533
|
-
* @LastEditTime: 2024-06-
|
8598
|
+
* @LastEditTime: 2024-06-20 18:56:52
|
8534
8599
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
|
8535
8600
|
*
|
8536
8601
|
*/
|
8537
8602
|
const FormatImage = React.forwardRef((props, ref) => {
|
8538
8603
|
const { src, onLoad, style, className, loading } = props;
|
8539
8604
|
const [imgSrc, setImgSrc] = React.useState();
|
8540
|
-
const { swiperRef } = useSxpDataSource();
|
8541
8605
|
React.useImperativeHandle(ref, () => ({
|
8542
8606
|
setSrc: (v) => {
|
8543
8607
|
setImgSrc(v);
|
8544
8608
|
}
|
8545
8609
|
}));
|
8546
8610
|
React.useEffect(() => {
|
8547
|
-
|
8548
|
-
|
8549
|
-
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;
|
8550
|
-
if (index === 0 || index > 0)
|
8551
|
-
setImgSrc(src);
|
8552
|
-
}, [src, swiperRef]);
|
8611
|
+
setImgSrc(src);
|
8612
|
+
}, [src]);
|
8553
8613
|
React.useRef(null);
|
8554
8614
|
// useEffect(() => {
|
8555
8615
|
// let observer: any = null;
|
@@ -9561,6 +9621,38 @@ var interactionRender$6 = [
|
|
9561
9621
|
}
|
9562
9622
|
];
|
9563
9623
|
|
9624
|
+
const EventProvider = (_a) => {
|
9625
|
+
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
9626
|
+
const ref = React.useRef(null);
|
9627
|
+
const { popup } = useEditor();
|
9628
|
+
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
9629
|
+
const { jumpToWeb } = useEventReport();
|
9630
|
+
const handleClick = lodash.throttle(() => {
|
9631
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
9632
|
+
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;
|
9633
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9634
|
+
eventSubject: 'clickCta',
|
9635
|
+
eventDescription: 'User clicked the CTA'
|
9636
|
+
}, rec, item, index);
|
9637
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
9638
|
+
if (isExternalLink) {
|
9639
|
+
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) {
|
9640
|
+
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
9641
|
+
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
9642
|
+
jumpToWeb(rec, product, cta, index);
|
9643
|
+
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);
|
9644
|
+
}
|
9645
|
+
}
|
9646
|
+
else {
|
9647
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9648
|
+
}
|
9649
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9650
|
+
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
9651
|
+
};
|
9652
|
+
var EventProvider$1 = React.memo(EventProvider);
|
9653
|
+
|
9654
|
+
var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
9655
|
+
|
9564
9656
|
/*
|
9565
9657
|
* @Author: binruan@chatlabs.com
|
9566
9658
|
* @Date: 2023-04-12 09:58:58
|
@@ -9588,64 +9680,40 @@ function useOnScreen(ref) {
|
|
9588
9680
|
return isOnScreen;
|
9589
9681
|
}
|
9590
9682
|
|
9591
|
-
|
9592
|
-
|
9683
|
+
/*
|
9684
|
+
* @Author: binruan@chatlabs.com
|
9685
|
+
* @Date: 2024-01-16 14:50:13
|
9686
|
+
* @LastEditors: binruan@chatlabs.com
|
9687
|
+
* @LastEditTime: 2024-06-21 11:59:25
|
9688
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
9689
|
+
*
|
9690
|
+
*/
|
9691
|
+
const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
9593
9692
|
const ref = React.useRef(null);
|
9594
9693
|
const isOnScreen = useOnScreen(ref);
|
9595
|
-
const {
|
9596
|
-
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
9597
|
-
const { jumpToWeb } = useEventReport();
|
9694
|
+
const { ctaEvent } = useSxpDataSource();
|
9598
9695
|
React.useEffect(() => {
|
9599
|
-
|
9600
|
-
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
9601
|
-
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;
|
9696
|
+
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
9602
9697
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9603
9698
|
eventSubject: 'ctaExposure',
|
9604
9699
|
eventDescription: 'The cta was shown to the user'
|
9605
9700
|
}, rec, item, index);
|
9606
9701
|
}
|
9607
|
-
}, [isOnScreen, ref, rec, ctaEvent, index]);
|
9608
|
-
|
9609
|
-
|
9610
|
-
|
9611
|
-
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9612
|
-
eventSubject: 'clickCta',
|
9613
|
-
eventDescription: 'User clicked the CTA'
|
9614
|
-
}, rec, item, index);
|
9615
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
9616
|
-
if (isExternalLink) {
|
9617
|
-
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) {
|
9618
|
-
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
9619
|
-
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
9620
|
-
jumpToWeb(rec, product, cta, index);
|
9621
|
-
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);
|
9622
|
-
}
|
9623
|
-
}
|
9624
|
-
else {
|
9625
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9626
|
-
}
|
9627
|
-
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9628
|
-
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
9702
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
9703
|
+
return (React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, imgStyle)) },
|
9704
|
+
React.createElement("div", { ref: ref, hidden: !src, className: css.css({ width: '100%', height: '100%' }) },
|
9705
|
+
React.createElement(FormatImage$1, { className: css.css(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block', objectPosition: `50% ${translateY ? -translateY + 50 : 50}%` }, style)), src: `${src}?imrquality/rquality/40` }))));
|
9629
9706
|
};
|
9630
|
-
var
|
9631
|
-
|
9632
|
-
var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
9707
|
+
var Img$1 = React.memo(Img);
|
9633
9708
|
|
9634
9709
|
const Commodity$1 = (_a) => {
|
9635
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
9636
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
9710
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
9711
|
+
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"]);
|
9637
9712
|
const { sxpParameter } = useSxpDataSource();
|
9638
9713
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9639
9714
|
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;
|
9640
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9641
|
-
React.createElement(
|
9642
|
-
React.createElement(FormatImage$1, { className: css.css({
|
9643
|
-
width: '100%',
|
9644
|
-
objectFit: 'cover',
|
9645
|
-
height: '100%',
|
9646
|
-
display: 'block',
|
9647
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
9648
|
-
}), src: src })),
|
9715
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
9716
|
+
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 }),
|
9649
9717
|
React.createElement("div", { className: css.css({
|
9650
9718
|
color: '#fff',
|
9651
9719
|
display: 'flex',
|
@@ -9654,8 +9722,8 @@ const Commodity$1 = (_a) => {
|
|
9654
9722
|
width: '100%',
|
9655
9723
|
overflow: 'hidden'
|
9656
9724
|
}) },
|
9657
|
-
React.createElement("div", { className: styles$6['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9658
|
-
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9725
|
+
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'),
|
9726
|
+
React.createElement("div", { className: css.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'))));
|
9659
9727
|
};
|
9660
9728
|
var CommodityComponent = React.memo(Commodity$1);
|
9661
9729
|
|
@@ -9728,14 +9796,14 @@ var interactionRender$5 = [
|
|
9728
9796
|
];
|
9729
9797
|
|
9730
9798
|
const Appoint$1 = (_a) => {
|
9731
|
-
var _b, _c, _d, _e;
|
9732
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9799
|
+
var _b, _c, _d, _e, _f, _g;
|
9800
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
9733
9801
|
const { sxpParameter } = useSxpDataSource();
|
9734
9802
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
9735
|
-
|
9736
|
-
|
9737
|
-
|
9738
|
-
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9803
|
+
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;
|
9804
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' }, index: index }, props),
|
9805
|
+
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 }),
|
9806
|
+
React.createElement("div", { className: css.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')));
|
9739
9807
|
};
|
9740
9808
|
var AppointComponent = React.memo(Appoint$1);
|
9741
9809
|
|
@@ -9792,7 +9860,7 @@ const Appoint = createMaterial(AppointComponent, {
|
|
9792
9860
|
var styles$5 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__nkBlU"};
|
9793
9861
|
|
9794
9862
|
const Link$1 = (_a) => {
|
9795
|
-
var _b, _c, _d, _e, _f;
|
9863
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
9796
9864
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index"]);
|
9797
9865
|
const { sxpParameter, bffEventReport } = useSxpDataSource();
|
9798
9866
|
const { jumpToWeb } = useEventReport();
|
@@ -9804,16 +9872,16 @@ const Link$1 = (_a) => {
|
|
9804
9872
|
window.location.href = window.getJointUtmLink(cta.link);
|
9805
9873
|
}
|
9806
9874
|
};
|
9875
|
+
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;
|
9807
9876
|
return (React.createElement(EventProvider$1, Object.assign({ index: index, rec: recData, className: css.css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
|
9808
|
-
React.createElement(
|
9809
|
-
React.createElement(FormatImage$1, { className: css.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 })),
|
9877
|
+
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 }),
|
9810
9878
|
React.createElement("div", { className: css.css({
|
9811
9879
|
display: 'flex',
|
9812
9880
|
alignItems: 'center',
|
9813
9881
|
width: '100%',
|
9814
9882
|
overflow: 'hidden'
|
9815
9883
|
}) },
|
9816
|
-
React.createElement("div", { className: styles$5['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle }, (
|
9884
|
+
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'))));
|
9817
9885
|
};
|
9818
9886
|
var LinkComponent = React.memo(Link$1);
|
9819
9887
|
|
@@ -9881,20 +9949,13 @@ var interactionRender$4 = [
|
|
9881
9949
|
var styles$4 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__yyHVb"};
|
9882
9950
|
|
9883
9951
|
const CommodityDiro$1 = (_a) => {
|
9884
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
9885
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
9952
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
9953
|
+
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"]);
|
9886
9954
|
const { sxpParameter } = useSxpDataSource();
|
9887
9955
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9888
9956
|
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;
|
9889
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9890
|
-
React.createElement(
|
9891
|
-
React.createElement(FormatImage$1, { className: css.css({
|
9892
|
-
width: '100%',
|
9893
|
-
objectFit: 'cover',
|
9894
|
-
height: '100%',
|
9895
|
-
display: 'block',
|
9896
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
9897
|
-
}), src: src })),
|
9957
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
9958
|
+
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 }),
|
9898
9959
|
React.createElement("div", { className: css.css({
|
9899
9960
|
color: '#fff',
|
9900
9961
|
display: 'flex',
|
@@ -9903,8 +9964,8 @@ const CommodityDiro$1 = (_a) => {
|
|
9903
9964
|
width: '100%',
|
9904
9965
|
overflow: 'hidden'
|
9905
9966
|
}) },
|
9906
|
-
React.createElement("div", { className: styles$4['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9907
|
-
React.createElement("div", { className: css.css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9967
|
+
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'),
|
9968
|
+
React.createElement("div", { className: css.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'))));
|
9908
9969
|
};
|
9909
9970
|
var CommodityDiroComponent = React.memo(CommodityDiro$1);
|
9910
9971
|
|
@@ -9979,20 +10040,13 @@ var interactionRender$3 = [
|
|
9979
10040
|
var styles$3 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__I-yCC"};
|
9980
10041
|
|
9981
10042
|
const CommodityDiroNew$1 = (_a) => {
|
9982
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
9983
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
10043
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
10044
|
+
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"]);
|
9984
10045
|
const { sxpParameter } = useSxpDataSource();
|
9985
10046
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9986
10047
|
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;
|
9987
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9988
|
-
React.createElement(
|
9989
|
-
React.createElement(FormatImage$1, { className: css.css({
|
9990
|
-
width: '100%',
|
9991
|
-
objectFit: 'cover',
|
9992
|
-
height: '100%',
|
9993
|
-
display: 'block',
|
9994
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
9995
|
-
}), src: src })),
|
10048
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
10049
|
+
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 }),
|
9996
10050
|
React.createElement("div", { className: css.css({
|
9997
10051
|
color: '#fff',
|
9998
10052
|
display: 'flex',
|
@@ -10001,8 +10055,8 @@ const CommodityDiroNew$1 = (_a) => {
|
|
10001
10055
|
width: '100%',
|
10002
10056
|
overflow: 'hidden'
|
10003
10057
|
}) },
|
10004
|
-
React.createElement("div", { className: styles$3['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
10005
|
-
React.createElement("div", { className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
10058
|
+
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'),
|
10059
|
+
React.createElement("div", { className: css.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'))));
|
10006
10060
|
};
|
10007
10061
|
var CommodityDiroNewComponent = React.memo(CommodityDiroNew$1);
|
10008
10062
|
|
@@ -10080,31 +10134,6 @@ const Scroll = ({ children, isPadding = true }) => {
|
|
10080
10134
|
};
|
10081
10135
|
var Scroll$1 = React.memo(Scroll);
|
10082
10136
|
|
10083
|
-
/*
|
10084
|
-
* @Author: binruan@chatlabs.com
|
10085
|
-
* @Date: 2024-01-16 14:50:13
|
10086
|
-
* @LastEditors: binruan@chatlabs.com
|
10087
|
-
* @LastEditTime: 2024-05-21 16:34:13
|
10088
|
-
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
10089
|
-
*
|
10090
|
-
*/
|
10091
|
-
const Img = ({ src, rec, item, index, style }) => {
|
10092
|
-
const ref = React.useRef(null);
|
10093
|
-
const isOnScreen = useOnScreen(ref);
|
10094
|
-
const { ctaEvent } = useSxpDataSource();
|
10095
|
-
React.useEffect(() => {
|
10096
|
-
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
10097
|
-
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10098
|
-
eventSubject: 'ctaExposure',
|
10099
|
-
eventDescription: 'The cta was shown to the user'
|
10100
|
-
}, rec, item, index);
|
10101
|
-
}
|
10102
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
10103
|
-
return (React.createElement("div", { ref: ref, hidden: !src, className: css.css({ width: '100%', height: '100%' }) },
|
10104
|
-
React.createElement(FormatImage$1, { className: css.css(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }, style)), src: src })));
|
10105
|
-
};
|
10106
|
-
var Img$1 = React.memo(Img);
|
10107
|
-
|
10108
10137
|
var styles$2 = {"two-line-ellipsis":"index-module_two-line-ellipsis__SFQwJ"};
|
10109
10138
|
|
10110
10139
|
const MultiCommodityDiro$1 = (_a) => {
|
@@ -10132,11 +10161,8 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
10132
10161
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10133
10162
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10134
10163
|
var _a, _b, _c, _d, _e, _f, _g;
|
10135
|
-
return (React.createElement(
|
10136
|
-
React.createElement(
|
10137
|
-
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: {
|
10138
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
10139
|
-
} })),
|
10164
|
+
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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10165
|
+
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 }),
|
10140
10166
|
React.createElement("div", { className: css.css({
|
10141
10167
|
color: '#000',
|
10142
10168
|
display: 'flex',
|
@@ -10146,7 +10172,7 @@ const MultiCommodityDiro$1 = (_a) => {
|
|
10146
10172
|
overflow: 'hidden'
|
10147
10173
|
}) },
|
10148
10174
|
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'),
|
10149
|
-
React.createElement("div", { className: css.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'))));
|
10175
|
+
React.createElement("div", { className: css.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'))))));
|
10150
10176
|
})));
|
10151
10177
|
};
|
10152
10178
|
var MultiCommodityDiroComponent = React.memo(MultiCommodityDiro$1);
|
@@ -10247,11 +10273,8 @@ const MultiCommodity$1 = (_a) => {
|
|
10247
10273
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10248
10274
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10249
10275
|
var _a, _b, _c, _d, _e, _f, _g;
|
10250
|
-
return (React.createElement(
|
10251
|
-
React.createElement(
|
10252
|
-
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: {
|
10253
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
10254
|
-
} })),
|
10276
|
+
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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10277
|
+
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 }),
|
10255
10278
|
React.createElement("div", { className: css.css({
|
10256
10279
|
color: '#fff',
|
10257
10280
|
display: 'flex',
|
@@ -10261,7 +10284,7 @@ const MultiCommodity$1 = (_a) => {
|
|
10261
10284
|
overflow: 'hidden'
|
10262
10285
|
}) },
|
10263
10286
|
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'),
|
10264
|
-
React.createElement("div", { className: css.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'))));
|
10287
|
+
React.createElement("div", { className: css.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'))))));
|
10265
10288
|
})));
|
10266
10289
|
};
|
10267
10290
|
var MultiCommodityComponent = React.memo(MultiCommodity$1);
|
@@ -10361,11 +10384,8 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
10361
10384
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10362
10385
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10363
10386
|
var _a, _b, _c, _d, _e, _f, _g;
|
10364
|
-
return (React.createElement(
|
10365
|
-
React.createElement(
|
10366
|
-
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: {
|
10367
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
10368
|
-
} })),
|
10387
|
+
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.css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
10388
|
+
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 }),
|
10369
10389
|
React.createElement("div", { className: css.css({
|
10370
10390
|
color: '#fff',
|
10371
10391
|
display: 'flex',
|
@@ -10376,7 +10396,7 @@ const MultiCommodityDiroNew$1 = (_a) => {
|
|
10376
10396
|
lineHeight: '20px'
|
10377
10397
|
}) },
|
10378
10398
|
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'),
|
10379
|
-
React.createElement("div", { className: css.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'))));
|
10399
|
+
React.createElement("div", { className: css.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'))))));
|
10380
10400
|
})));
|
10381
10401
|
};
|
10382
10402
|
var MultiCommodityDiroNewComponent = React.memo(MultiCommodityDiroNew$1);
|
@@ -12729,10 +12749,10 @@ var settingRender = [
|
|
12729
12749
|
}
|
12730
12750
|
];
|
12731
12751
|
|
12732
|
-
const Consent$
|
12733
|
-
return React.createElement(Consent$
|
12752
|
+
const Consent$1 = (props) => {
|
12753
|
+
return React.createElement(Consent$1, Object.assign({}, props));
|
12734
12754
|
};
|
12735
|
-
var ConsentComponent = React.memo(Consent$
|
12755
|
+
var ConsentComponent = React.memo(Consent$1);
|
12736
12756
|
|
12737
12757
|
/*
|
12738
12758
|
* @Author: binruan@chatlabs.com
|
@@ -12742,7 +12762,7 @@ var ConsentComponent = React.memo(Consent$3);
|
|
12742
12762
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\Consent\material.tsx
|
12743
12763
|
*
|
12744
12764
|
*/
|
12745
|
-
const Consent
|
12765
|
+
const Consent = createMaterial(ConsentComponent, {
|
12746
12766
|
displayName: 'Consent',
|
12747
12767
|
icon: '',
|
12748
12768
|
category: 'base',
|
@@ -12777,7 +12797,7 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
12777
12797
|
CommodityDetailDiroNew: CommodityDetailDiroNew,
|
12778
12798
|
CommodityDiro: CommodityDiro,
|
12779
12799
|
CommodityDiroNew: CommodityDiroNew,
|
12780
|
-
Consent: Consent
|
12800
|
+
Consent: Consent,
|
12781
12801
|
HashTag: HashTag,
|
12782
12802
|
Link: Link,
|
12783
12803
|
MultiCommodity: MultiCommodity,
|
@@ -12883,7 +12903,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12883
12903
|
React.useEffect(() => {
|
12884
12904
|
if (!videoRef)
|
12885
12905
|
return;
|
12886
|
-
videoRef
|
12906
|
+
videoRef.muted = muted;
|
12887
12907
|
}, [muted, videoRef]);
|
12888
12908
|
const handleEnded = React.useCallback(() => {
|
12889
12909
|
if (!videoRef)
|
@@ -12898,10 +12918,10 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12898
12918
|
setIsLoadFinish(true);
|
12899
12919
|
setIsPauseVideo(false);
|
12900
12920
|
const item = data[index];
|
12901
|
-
if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
12902
|
-
videoStartTime.current = (videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
12903
|
-
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
12904
|
-
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
12921
|
+
if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration)) {
|
12922
|
+
videoStartTime.current = (videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) || 0;
|
12923
|
+
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) !== null && _a !== void 0 ? _a : 0).toFixed(2);
|
12924
|
+
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
12905
12925
|
const playType = isFirstPlay ? '0' : '1';
|
12906
12926
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12907
12927
|
eventInfo: {
|
@@ -12925,21 +12945,17 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12925
12945
|
var _a;
|
12926
12946
|
if (!videoRef || firstFrameSrc || !blur)
|
12927
12947
|
return;
|
12928
|
-
|
12929
|
-
if (!videoDomRef)
|
12930
|
-
return;
|
12931
|
-
videoDomRef.style.objectFit = 'contain';
|
12948
|
+
videoRef.style.objectFit = 'contain';
|
12932
12949
|
if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !canvasRef.current || isBgColor)
|
12933
12950
|
return;
|
12934
12951
|
const setFrameImg = () => {
|
12935
|
-
const video = videoDomRef;
|
12936
12952
|
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
12937
12953
|
const ctx = canvas.getContext('2d');
|
12938
12954
|
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
12939
12955
|
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
12940
12956
|
canvas.height = targetHeight;
|
12941
12957
|
canvas.width = targetWidth;
|
12942
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(
|
12958
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(videoRef, 0, 0, canvas.width, canvas.height);
|
12943
12959
|
setFirstFrameSrc(canvas.toDataURL());
|
12944
12960
|
};
|
12945
12961
|
setFrameImg();
|
@@ -12951,21 +12967,13 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12951
12967
|
if (!videoRef)
|
12952
12968
|
return;
|
12953
12969
|
handLoadeddata();
|
12954
|
-
// if (activeIndex !== index) {
|
12955
|
-
// videoRef?.play();
|
12956
|
-
// videoRef?.pause();
|
12957
|
-
// }
|
12958
|
-
// setIsLoadFinish(true);
|
12959
12970
|
}, [videoRef, handLoadeddata]);
|
12960
|
-
React.useCallback(() => {
|
12961
|
-
setIsLoadFinish(true);
|
12962
|
-
}, []);
|
12963
12971
|
const handleClickVideo = React.useCallback((type) => () => {
|
12964
12972
|
if (!videoRef)
|
12965
12973
|
return;
|
12966
12974
|
if (!isLoadFinish)
|
12967
12975
|
return;
|
12968
|
-
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused
|
12976
|
+
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused;
|
12969
12977
|
switch (type) {
|
12970
12978
|
case 'start':
|
12971
12979
|
if (!isPause)
|
@@ -12997,10 +13005,10 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
12997
13005
|
if (activeIndex !== index)
|
12998
13006
|
return;
|
12999
13007
|
const item = data[index];
|
13000
|
-
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
13001
|
-
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
13002
|
-
if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
13003
|
-
const playDuration = ((videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
13008
|
+
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) !== null && _a !== void 0 ? _a : 0).toFixed(2);
|
13009
|
+
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
13010
|
+
if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) {
|
13011
|
+
const playDuration = ((videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) - videoStartTime.current).toFixed(2);
|
13004
13012
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13005
13013
|
eventInfo: {
|
13006
13014
|
eventSubject: 'playOverVideo',
|
@@ -13024,7 +13032,19 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
13024
13032
|
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
|
13025
13033
|
if (!videoSrc)
|
13026
13034
|
return;
|
13027
|
-
|
13035
|
+
if (videoSrc.includes('.m3u8')) {
|
13036
|
+
if (Hls.isSupported()) {
|
13037
|
+
const hls = new Hls();
|
13038
|
+
hls.loadSource(videoSrc);
|
13039
|
+
hls.attachMedia(videoRef.current);
|
13040
|
+
}
|
13041
|
+
else {
|
13042
|
+
videoRef.src = videoSrc;
|
13043
|
+
}
|
13044
|
+
}
|
13045
|
+
else {
|
13046
|
+
videoRef.src = videoSrc;
|
13047
|
+
}
|
13028
13048
|
setIsPauseVideo(false);
|
13029
13049
|
const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
|
13030
13050
|
const dom = document.querySelector('#player-container-id');
|
@@ -13032,20 +13052,20 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
13032
13052
|
if (!dom && !dom2)
|
13033
13053
|
return;
|
13034
13054
|
videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
|
13035
|
-
videoRef
|
13036
|
-
videoRef
|
13037
|
-
|
13038
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13039
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13040
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13055
|
+
videoRef.setAttribute('x5-playsinline', 'true');
|
13056
|
+
videoRef.setAttribute('webkit-playsinline', 'true');
|
13057
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadedmetadata', handleLoadedmetadata);
|
13058
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadeddata', handLoadeddata);
|
13059
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('playing', handlePlaying);
|
13060
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('pause', handlePause);
|
13061
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('ended', handleEnded);
|
13041
13062
|
return () => {
|
13042
13063
|
dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
|
13043
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13044
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13045
|
-
|
13046
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13047
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13048
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.off('ended', handleEnded);
|
13064
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadedmetadata', handleLoadedmetadata);
|
13065
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadeddata', handLoadeddata);
|
13066
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('playing', handlePlaying);
|
13067
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('pause', handlePause);
|
13068
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('ended', handleEnded);
|
13049
13069
|
};
|
13050
13070
|
}, [isActive, videoId, rec, videoRef]);
|
13051
13071
|
React.useEffect(() => {
|
@@ -13067,7 +13087,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
13067
13087
|
React.useEffect(() => {
|
13068
13088
|
if (!isActive || !videoRef)
|
13069
13089
|
return;
|
13070
|
-
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused
|
13090
|
+
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused;
|
13071
13091
|
if (!isPause && openHashtag) {
|
13072
13092
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
|
13073
13093
|
}
|
@@ -13506,142 +13526,64 @@ const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
|
13506
13526
|
};
|
13507
13527
|
var Tagbar$1 = React.memo(Tagbar);
|
13508
13528
|
|
13509
|
-
/*
|
13510
|
-
* @Author: binruan@chatlabs.com
|
13511
|
-
* @Date: 2024-06-13 15:16:53
|
13512
|
-
* @LastEditors: binruan@chatlabs.com
|
13513
|
-
* @LastEditTime: 2024-06-19 14:13:50
|
13514
|
-
* @FilePath: \pb-sxp-ui\src\core\components\Consent\index.tsx
|
13515
|
-
*
|
13516
|
-
*/
|
13517
|
-
const Consent = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
|
13518
|
-
const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
|
13519
|
-
const channelObj = React.useMemo(() => {
|
13520
|
-
const queryString = location.search.slice(1);
|
13521
|
-
const params = qs.parse(queryString.replace(/\+/g, '%2B'));
|
13522
|
-
for (const key in params) {
|
13523
|
-
params[key] = params[key].replace(/%2B/g, '+');
|
13524
|
-
}
|
13525
|
-
return params;
|
13526
|
-
}, []);
|
13527
|
-
const getUtmValue = (key) => { var _a; return (_a = channelObj[key]) !== null && _a !== void 0 ? _a : null; };
|
13528
|
-
React.useEffect(() => {
|
13529
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13530
|
-
eventInfo: {
|
13531
|
-
eventSubject: 'privacyEnter',
|
13532
|
-
eventDescription: 'User enter privacy page',
|
13533
|
-
utmSource: getUtmValue('utm_source'),
|
13534
|
-
utmMedium: getUtmValue('utm_medium'),
|
13535
|
-
utmCampaign: getUtmValue('utm_campaign'),
|
13536
|
-
utmId: getUtmValue('utm_id'),
|
13537
|
-
utmContent: getUtmValue('utm_content'),
|
13538
|
-
clSource: getUtmValue('cl_source'),
|
13539
|
-
enterTime: `${Date.now()}`,
|
13540
|
-
enterUrl: window.location.href,
|
13541
|
-
rtc: null,
|
13542
|
-
requestId: null,
|
13543
|
-
sessionID: null
|
13544
|
-
}
|
13545
|
-
});
|
13546
|
-
}, []);
|
13547
|
-
const handleAgree = () => {
|
13548
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13549
|
-
eventInfo: {
|
13550
|
-
eventSubject: 'userConsent',
|
13551
|
-
eventDescription: '用户授权【操作结果】',
|
13552
|
-
consentResult: '0',
|
13553
|
-
consentTags: '["系统运营"]',
|
13554
|
-
rtc: null,
|
13555
|
-
requestId: null,
|
13556
|
-
sessionID: null
|
13557
|
-
}
|
13558
|
-
});
|
13559
|
-
setIsAgreePolicy === null || setIsAgreePolicy === void 0 ? void 0 : setIsAgreePolicy(true);
|
13560
|
-
window.localStorage.setItem(AGREE_POLICY, 'yes');
|
13561
|
-
};
|
13562
|
-
return (React.createElement("div", { className: 'consent-bg' },
|
13563
|
-
React.createElement("div", { className: 'consent' },
|
13564
|
-
React.createElement("div", { className: 'consent-col' },
|
13565
|
-
React.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
|
13566
|
-
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.')),
|
13567
|
-
React.createElement("div", { className: 'consent-col' },
|
13568
|
-
React.createElement("button", { "aria-label": 'agree', className: 'consent-btn', onClick: handleAgree }, "Agree"),
|
13569
|
-
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')))));
|
13570
|
-
};
|
13571
|
-
var Consent$1 = React.memo(Consent);
|
13572
|
-
|
13573
13529
|
/*
|
13574
13530
|
* @Author: binruan@chatlabs.com
|
13575
13531
|
* @Date: 2024-01-15 19:03:09
|
13576
13532
|
* @LastEditors: binruan@chatlabs.com
|
13577
|
-
* @LastEditTime: 2024-06-
|
13533
|
+
* @LastEditTime: 2024-06-21 08:56:05
|
13578
13534
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
13579
13535
|
*
|
13580
13536
|
*/
|
13581
13537
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
|
13582
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
13538
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
13583
13539
|
const { schema } = useEditor();
|
13584
13540
|
const [activeIndex, setActiveIndex] = React.useState(0);
|
13585
13541
|
const viewImageStartTime = React.useRef(0);
|
13586
|
-
|
13542
|
+
React.useState(false);
|
13587
13543
|
const [isMuted, setIsMuted] = React.useState(true);
|
13588
13544
|
const viewTime = React.useRef();
|
13589
13545
|
const [isLoadMore, setIsLoadMore] = React.useState(false);
|
13590
13546
|
const [isShowMore, setIsShowMore] = React.useState(false);
|
13591
13547
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag } = useSxpDataSource();
|
13592
13548
|
const { backMainFeed } = useEventReport();
|
13593
|
-
const
|
13594
|
-
const playerRef = React.useRef();
|
13549
|
+
const videoRef = React.useRef();
|
13595
13550
|
const { productView } = useEventReport();
|
13596
13551
|
const isShowFingerTip = React.useMemo(() => {
|
13597
13552
|
return data.length > 0 && !loading && getFeUserId();
|
13598
13553
|
}, [data, loading]);
|
13599
|
-
|
13600
|
-
|
13601
|
-
|
13554
|
+
React.useEffect(() => {
|
13555
|
+
refreshFeSessionId();
|
13556
|
+
}, []);
|
13557
|
+
React.useEffect(() => {
|
13558
|
+
if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
|
13559
|
+
const now = new Date();
|
13560
|
+
viewTime.current = now;
|
13561
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
13562
|
+
eventName: 'PageView'
|
13563
|
+
});
|
13602
13564
|
}
|
13565
|
+
}, [data === null || data === void 0 ? void 0 : data.length]);
|
13566
|
+
const handleH5EnterLink = React.useCallback(() => {
|
13603
13567
|
refreshFeSessionId();
|
13604
|
-
|
13605
|
-
|
13606
|
-
|
13607
|
-
|
13568
|
+
h5EnterLink === null || h5EnterLink === void 0 ? void 0 : h5EnterLink();
|
13569
|
+
if (data.length > 0) {
|
13570
|
+
const now = new Date();
|
13571
|
+
viewTime.current = now;
|
13572
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
13573
|
+
eventName: 'PageView'
|
13574
|
+
});
|
13608
13575
|
}
|
13609
|
-
|
13610
|
-
eventName: 'PageView'
|
13611
|
-
});
|
13612
|
-
setIsInit(true);
|
13613
|
-
}, [data.length, bffFbReport, h5EnterLink, isInit]);
|
13576
|
+
}, [data.length, bffFbReport, h5EnterLink]);
|
13614
13577
|
const firstRef = React.useRef();
|
13615
13578
|
React.useEffect(() => {
|
13616
13579
|
var _a, _b, _c, _d;
|
13617
|
-
if (!firstRef.current &&
|
13580
|
+
if (!firstRef.current && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
|
13618
13581
|
firstRef.current = true;
|
13619
|
-
|
13620
|
-
|
13621
|
-
|
13622
|
-
loop: false,
|
13623
|
-
autoplay: true,
|
13624
|
-
muted: true,
|
13625
|
-
preload: 'auto',
|
13626
|
-
posterImage: false,
|
13627
|
-
bigPlayButton: true,
|
13628
|
-
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)
|
13629
|
-
? [
|
13630
|
-
{
|
13631
|
-
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
|
13632
|
-
}
|
13633
|
-
]
|
13634
|
-
: []
|
13635
|
-
});
|
13636
|
-
player === null || player === void 0 ? void 0 : player.ready(() => {
|
13637
|
-
setVideoRef(player);
|
13638
|
-
});
|
13582
|
+
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) {
|
13583
|
+
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;
|
13584
|
+
}
|
13639
13585
|
}
|
13640
|
-
}, [videoRef,
|
13641
|
-
React.useEffect(() => {
|
13642
|
-
if (!isInit)
|
13643
|
-
handleH5EnterLink();
|
13644
|
-
}, [handleH5EnterLink, isInit]);
|
13586
|
+
}, [videoRef, data]);
|
13645
13587
|
React.useEffect(() => {
|
13646
13588
|
var _a;
|
13647
13589
|
const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
|
@@ -13759,7 +13701,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13759
13701
|
const renderContent = React.useCallback((rec, index) => {
|
13760
13702
|
var _a, _b, _c, _d;
|
13761
13703
|
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13762
|
-
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 }));
|
13704
|
+
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 }));
|
13763
13705
|
}
|
13764
13706
|
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13765
13707
|
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 }));
|
@@ -13785,7 +13727,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13785
13727
|
tipText,
|
13786
13728
|
resolver,
|
13787
13729
|
schema,
|
13788
|
-
videoRef
|
13730
|
+
videoRef.current
|
13789
13731
|
]);
|
13790
13732
|
const onExpandableChange = React.useCallback((v) => {
|
13791
13733
|
setIsShowMore(v);
|
@@ -13943,14 +13885,17 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13943
13885
|
}
|
13944
13886
|
};
|
13945
13887
|
const visList = React.useMemo(() => {
|
13946
|
-
|
13947
|
-
|
13948
|
-
|
13949
|
-
|
13950
|
-
|
13951
|
-
|
13952
|
-
|
13953
|
-
|
13888
|
+
var _a;
|
13889
|
+
const list = activeIndex === 0
|
13890
|
+
? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
|
13891
|
+
: data === null || data === void 0 ? void 0 : data.map((item, index) => {
|
13892
|
+
if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
|
13893
|
+
return item;
|
13894
|
+
}
|
13895
|
+
else {
|
13896
|
+
return null;
|
13897
|
+
}
|
13898
|
+
});
|
13954
13899
|
return !waterFallData ? list.concat([{ loading: true }]) : list;
|
13955
13900
|
}, [data, activeIndex, waterFallData]);
|
13956
13901
|
const renderView = React.useMemo(() => {
|
@@ -13975,48 +13920,47 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13975
13920
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
13976
13921
|
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
13977
13922
|
return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
|
13978
|
-
|
13979
|
-
|
13980
|
-
|
13981
|
-
|
13982
|
-
|
13983
|
-
|
13984
|
-
|
13985
|
-
|
13986
|
-
|
13987
|
-
|
13988
|
-
|
13989
|
-
|
13990
|
-
|
13991
|
-
|
13992
|
-
|
13993
|
-
|
13994
|
-
|
13995
|
-
|
13996
|
-
|
13997
|
-
|
13998
|
-
|
13999
|
-
|
14000
|
-
if (
|
14001
|
-
|
14002
|
-
|
14003
|
-
|
14004
|
-
|
14005
|
-
});
|
14006
|
-
}
|
13923
|
+
waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, onClose: () => {
|
13924
|
+
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
13925
|
+
} })),
|
13926
|
+
renderLogo,
|
13927
|
+
React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
13928
|
+
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,
|
13929
|
+
React.createElement(Swiper, { style: {
|
13930
|
+
marginTop: tagHeight
|
13931
|
+
}, ref: swiperRef, onSlideChange: () => {
|
13932
|
+
swiperRef.current.swiper.allowTouchMove = false;
|
13933
|
+
setTimeout(() => {
|
13934
|
+
swiperRef.current.swiper.allowTouchMove = true;
|
13935
|
+
}, 500);
|
13936
|
+
}, onActiveIndexChange: (swiper) => {
|
13937
|
+
setActiveIndex(swiper.activeIndex);
|
13938
|
+
if (openHashtag)
|
13939
|
+
return;
|
13940
|
+
// 处理上滑下滑事件
|
13941
|
+
handleScrollEvent(swiper);
|
13942
|
+
if (waterFallData)
|
13943
|
+
return;
|
13944
|
+
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 2 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
13945
|
+
if (!isLoadMore) {
|
13946
|
+
setIsLoadMore(true);
|
13947
|
+
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(Math.ceil(activeIndex / 10) + 1).then(() => {
|
13948
|
+
setIsLoadMore(false);
|
13949
|
+
});
|
14007
13950
|
}
|
14008
|
-
}
|
14009
|
-
|
14010
|
-
|
14011
|
-
|
14012
|
-
|
14013
|
-
|
14014
|
-
|
14015
|
-
|
14016
|
-
|
14017
|
-
|
13951
|
+
}
|
13952
|
+
}, direction: 'vertical', height: height },
|
13953
|
+
React.createElement(ToggleButton$1, { style: {
|
13954
|
+
position: 'fixed',
|
13955
|
+
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',
|
13956
|
+
zIndex: 999,
|
13957
|
+
[(_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,
|
13958
|
+
[(_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
|
13959
|
+
}, 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 }),
|
13960
|
+
renderView),
|
13961
|
+
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)),
|
14018
13962
|
React.createElement("div", { style: { position: 'absolute', zIndex: -100 } },
|
14019
|
-
React.createElement("video", { ref:
|
13963
|
+
React.createElement("video", { ref: videoRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', preload: 'auto', controls: false, muted: true, style: {
|
14020
13964
|
backgroundColor: 'transparent',
|
14021
13965
|
width: '100%',
|
14022
13966
|
height: '100%',
|