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/pb-ui.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('uuid'), require('pako'), require('react'), require('qs'), require('eventemitter3'), require('@emotion/css'), require('
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', 'eventemitter3', '@emotion/css', '
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PUI = {}, global.lodash, global.uuid$1, global.pako, global.React, global.qs, global.EventEmitter, global.css, global.
|
5
|
-
})(this, (function (exports, lodash, uuid$1, pako, React, qs, EventEmitter, css,
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('uuid'), require('pako'), require('react'), require('qs'), require('eventemitter3'), require('@emotion/css'), require('react-dom'), require('hls.js')) :
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', 'eventemitter3', '@emotion/css', 'react-dom', 'hls.js'], factory) :
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PUI = {}, global.lodash, global.uuid$1, global.pako, global.React, global.qs, global.EventEmitter, global.css, global.ReactDOM, global.Hls));
|
5
|
+
})(this, (function (exports, lodash, uuid$1, pako, React, qs, EventEmitter, css, ReactDOM, Hls) { 'use strict';
|
6
6
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
8
8
|
var n = Object.create(null);
|
@@ -430,6 +430,70 @@
|
|
430
430
|
SXP_EVENT_TYPE["CHANGE_THEME_TAG"] = "changeThemeTag";
|
431
431
|
})(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
|
432
432
|
|
433
|
+
/*
|
434
|
+
* @Author: binruan@chatlabs.com
|
435
|
+
* @Date: 2024-06-13 15:16:53
|
436
|
+
* @LastEditors: binruan@chatlabs.com
|
437
|
+
* @LastEditTime: 2024-06-19 14:13:50
|
438
|
+
* @FilePath: \pb-sxp-ui\src\core\components\Consent\index.tsx
|
439
|
+
*
|
440
|
+
*/
|
441
|
+
const Consent$2 = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
|
442
|
+
const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
|
443
|
+
const channelObj = React.useMemo(() => {
|
444
|
+
const queryString = location.search.slice(1);
|
445
|
+
const params = qs.parse(queryString.replace(/\+/g, '%2B'));
|
446
|
+
for (const key in params) {
|
447
|
+
params[key] = params[key].replace(/%2B/g, '+');
|
448
|
+
}
|
449
|
+
return params;
|
450
|
+
}, []);
|
451
|
+
const getUtmValue = (key) => { var _a; return (_a = channelObj[key]) !== null && _a !== void 0 ? _a : null; };
|
452
|
+
React.useEffect(() => {
|
453
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
454
|
+
eventInfo: {
|
455
|
+
eventSubject: 'privacyEnter',
|
456
|
+
eventDescription: 'User enter privacy page',
|
457
|
+
utmSource: getUtmValue('utm_source'),
|
458
|
+
utmMedium: getUtmValue('utm_medium'),
|
459
|
+
utmCampaign: getUtmValue('utm_campaign'),
|
460
|
+
utmId: getUtmValue('utm_id'),
|
461
|
+
utmContent: getUtmValue('utm_content'),
|
462
|
+
clSource: getUtmValue('cl_source'),
|
463
|
+
enterTime: `${Date.now()}`,
|
464
|
+
enterUrl: window.location.href,
|
465
|
+
rtc: null,
|
466
|
+
requestId: null,
|
467
|
+
sessionID: null
|
468
|
+
}
|
469
|
+
});
|
470
|
+
}, []);
|
471
|
+
const handleAgree = () => {
|
472
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
473
|
+
eventInfo: {
|
474
|
+
eventSubject: 'userConsent',
|
475
|
+
eventDescription: '用户授权【操作结果】',
|
476
|
+
consentResult: '0',
|
477
|
+
consentTags: '["系统运营"]',
|
478
|
+
rtc: null,
|
479
|
+
requestId: null,
|
480
|
+
sessionID: null
|
481
|
+
}
|
482
|
+
});
|
483
|
+
setIsAgreePolicy === null || setIsAgreePolicy === void 0 ? void 0 : setIsAgreePolicy(true);
|
484
|
+
window.localStorage.setItem(AGREE_POLICY, 'yes');
|
485
|
+
};
|
486
|
+
return (React.createElement("div", { className: 'consent-bg' },
|
487
|
+
React.createElement("div", { className: 'consent' },
|
488
|
+
React.createElement("div", { className: 'consent-col' },
|
489
|
+
React.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
|
490
|
+
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.')),
|
491
|
+
React.createElement("div", { className: 'consent-col' },
|
492
|
+
React.createElement("button", { "aria-label": 'agree', className: 'consent-btn', onClick: handleAgree }, "Agree"),
|
493
|
+
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')))));
|
494
|
+
};
|
495
|
+
var Consent$3 = React.memo(Consent$2);
|
496
|
+
|
433
497
|
const SxpDataSourceContext = React.createContext({
|
434
498
|
rtcList: [],
|
435
499
|
tagList: []
|
@@ -441,6 +505,7 @@
|
|
441
505
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
442
506
|
const DEFAULT_TAG = 'FOR U';
|
443
507
|
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 }) => {
|
508
|
+
var _a, _b, _c;
|
444
509
|
const [rtcList, setRtcList] = React.useState([]);
|
445
510
|
const [tagList, setTagList] = React.useState([]);
|
446
511
|
const [loading, setLoading] = React.useState(false);
|
@@ -507,10 +572,10 @@
|
|
507
572
|
}, [bffDataSource]);
|
508
573
|
// 获取推荐视频数据
|
509
574
|
const getRecommendVideos = React.useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
510
|
-
var
|
575
|
+
var _d, _e, _f, _g, _h;
|
511
576
|
query = {
|
512
|
-
maxSize: (
|
513
|
-
defaultSize: (
|
577
|
+
maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
|
578
|
+
defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
|
514
579
|
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
515
580
|
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
516
581
|
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
@@ -518,10 +583,10 @@
|
|
518
583
|
themeTag: query === null || query === void 0 ? void 0 : query.themeTag
|
519
584
|
};
|
520
585
|
if (utmVal) {
|
521
|
-
const val = (
|
586
|
+
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
522
587
|
const key = val.split('=')[0];
|
523
588
|
return UTM_KEYS.includes(key);
|
524
|
-
})) === null ||
|
589
|
+
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
525
590
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
526
591
|
}
|
527
592
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
@@ -533,7 +598,7 @@
|
|
533
598
|
return result === null || result === void 0 ? void 0 : result.data;
|
534
599
|
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
535
600
|
const loadVideos = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
536
|
-
var
|
601
|
+
var _j, _k;
|
537
602
|
if (rtcList.length <= 0) {
|
538
603
|
return;
|
539
604
|
}
|
@@ -543,8 +608,8 @@
|
|
543
608
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
544
609
|
themeTag: themeTag.current
|
545
610
|
});
|
546
|
-
setRtcList(rtcList.concat((
|
547
|
-
setCacheRtcList(cacheRtcList.concat((
|
611
|
+
setRtcList(rtcList.concat((_j = data === null || data === void 0 ? void 0 : data.recList) !== null && _j !== void 0 ? _j : []));
|
612
|
+
setCacheRtcList(cacheRtcList.concat((_k = data === null || data === void 0 ? void 0 : data.recList) !== null && _k !== void 0 ? _k : []));
|
548
613
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
549
614
|
const bffEventReport = React.useCallback(({ userInfo, eventInfo }) => {
|
550
615
|
// 关闭 BFF 事件上报
|
@@ -608,16 +673,16 @@
|
|
608
673
|
}), [bffFetch]);
|
609
674
|
// 获取 Tag
|
610
675
|
const bffGetTagList = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
611
|
-
var
|
676
|
+
var _l, _m, _o, _p, _q;
|
612
677
|
if (!utmVal || !isShowTag)
|
613
678
|
return;
|
614
679
|
try {
|
615
|
-
const val = (
|
680
|
+
const val = (_o = (_m = (_l = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _l === void 0 ? void 0 : _l.filter((val) => {
|
616
681
|
const key = val.split('=')[0];
|
617
682
|
return UTM_KEYS.includes(key);
|
618
|
-
})) === null ||
|
683
|
+
})) === null || _m === void 0 ? void 0 : _m.join('&')) !== null && _o !== void 0 ? _o : '';
|
619
684
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
620
|
-
setTagList((
|
685
|
+
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 : []);
|
621
686
|
}
|
622
687
|
catch (e) {
|
623
688
|
console.log('e', e);
|
@@ -668,8 +733,9 @@
|
|
668
733
|
});
|
669
734
|
}, [bffEventReport]);
|
670
735
|
React.useEffect(() => {
|
671
|
-
|
672
|
-
|
736
|
+
if (!isShowConsent)
|
737
|
+
h5EnterLink();
|
738
|
+
}, [isShowConsent]);
|
673
739
|
React.useEffect(() => {
|
674
740
|
if (isShowConsent)
|
675
741
|
return;
|
@@ -752,13 +818,13 @@
|
|
752
818
|
isShowConsent,
|
753
819
|
selectTag,
|
754
820
|
setSelectTag
|
755
|
-
} }, render({
|
821
|
+
} }, 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({
|
756
822
|
rtcList,
|
757
823
|
mutateLike: bffMutateLike,
|
758
824
|
mutateUnlike: bffMutateUnlike,
|
759
825
|
submitForm: bffSubmitForm,
|
760
826
|
tagList
|
761
|
-
})));
|
827
|
+
}))));
|
762
828
|
};
|
763
829
|
var SxpDataSourceProvider$1 = React.memo(SxpDataSourceProvider);
|
764
830
|
|
@@ -1284,7 +1350,7 @@
|
|
1284
1350
|
key: '4'
|
1285
1351
|
}
|
1286
1352
|
], []);
|
1287
|
-
|
1353
|
+
React.useMemo(() => {
|
1288
1354
|
if (layoutType === undefined) {
|
1289
1355
|
const list = lodash.cloneDeep(columns) || defaultColumns;
|
1290
1356
|
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 } })));
|
@@ -1327,8 +1393,7 @@
|
|
1327
1393
|
return (React.createElement("div", { className: 'pb-appoint-form' },
|
1328
1394
|
React.createElement("div", { className: `pb-appoint-form-title ${css.css(Object.assign({}, textStyle))}` }, title),
|
1329
1395
|
React.createElement("div", Object.assign({ className: css.css(Object.assign({}, style)) }, props),
|
1330
|
-
React.createElement("div", { className: 'pb-appoint-form-container' },
|
1331
|
-
React.createElement(proComponents.BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
|
1396
|
+
React.createElement("div", { className: 'pb-appoint-form-container' })),
|
1332
1397
|
React.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
|
1333
1398
|
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))));
|
1334
1399
|
};
|
@@ -8522,26 +8587,21 @@
|
|
8522
8587
|
* @Author: binruan@chatlabs.com
|
8523
8588
|
* @Date: 2024-03-20 10:27:31
|
8524
8589
|
* @LastEditors: binruan@chatlabs.com
|
8525
|
-
* @LastEditTime: 2024-06-
|
8590
|
+
* @LastEditTime: 2024-06-20 18:56:52
|
8526
8591
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
|
8527
8592
|
*
|
8528
8593
|
*/
|
8529
8594
|
const FormatImage = React.forwardRef((props, ref) => {
|
8530
8595
|
const { src, onLoad, style, className, loading } = props;
|
8531
8596
|
const [imgSrc, setImgSrc] = React.useState();
|
8532
|
-
const { swiperRef } = useSxpDataSource();
|
8533
8597
|
React.useImperativeHandle(ref, () => ({
|
8534
8598
|
setSrc: (v) => {
|
8535
8599
|
setImgSrc(v);
|
8536
8600
|
}
|
8537
8601
|
}));
|
8538
8602
|
React.useEffect(() => {
|
8539
|
-
|
8540
|
-
|
8541
|
-
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;
|
8542
|
-
if (index === 0 || index > 0)
|
8543
|
-
setImgSrc(src);
|
8544
|
-
}, [src, swiperRef]);
|
8603
|
+
setImgSrc(src);
|
8604
|
+
}, [src]);
|
8545
8605
|
React.useRef(null);
|
8546
8606
|
// useEffect(() => {
|
8547
8607
|
// let observer: any = null;
|
@@ -9553,6 +9613,38 @@ Made in Italy` })));
|
|
9553
9613
|
}
|
9554
9614
|
];
|
9555
9615
|
|
9616
|
+
const EventProvider = (_a) => {
|
9617
|
+
var { rec, children, className, onClick, style, isExternalLink = false, index } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
|
9618
|
+
const ref = React.useRef(null);
|
9619
|
+
const { popup } = useEditor();
|
9620
|
+
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
9621
|
+
const { jumpToWeb } = useEventReport();
|
9622
|
+
const handleClick = lodash.throttle(() => {
|
9623
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
9624
|
+
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;
|
9625
|
+
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9626
|
+
eventSubject: 'clickCta',
|
9627
|
+
eventDescription: 'User clicked the CTA'
|
9628
|
+
}, rec, item, index);
|
9629
|
+
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
9630
|
+
if (isExternalLink) {
|
9631
|
+
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) {
|
9632
|
+
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
9633
|
+
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
9634
|
+
jumpToWeb(rec, product, cta, index);
|
9635
|
+
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);
|
9636
|
+
}
|
9637
|
+
}
|
9638
|
+
else {
|
9639
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9640
|
+
}
|
9641
|
+
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9642
|
+
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
9643
|
+
};
|
9644
|
+
var EventProvider$1 = React.memo(EventProvider);
|
9645
|
+
|
9646
|
+
var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
9647
|
+
|
9556
9648
|
/*
|
9557
9649
|
* @Author: binruan@chatlabs.com
|
9558
9650
|
* @Date: 2023-04-12 09:58:58
|
@@ -9580,64 +9672,40 @@ Made in Italy` })));
|
|
9580
9672
|
return isOnScreen;
|
9581
9673
|
}
|
9582
9674
|
|
9583
|
-
|
9584
|
-
|
9675
|
+
/*
|
9676
|
+
* @Author: binruan@chatlabs.com
|
9677
|
+
* @Date: 2024-01-16 14:50:13
|
9678
|
+
* @LastEditors: binruan@chatlabs.com
|
9679
|
+
* @LastEditTime: 2024-06-21 11:59:25
|
9680
|
+
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
9681
|
+
*
|
9682
|
+
*/
|
9683
|
+
const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
9585
9684
|
const ref = React.useRef(null);
|
9586
9685
|
const isOnScreen = useOnScreen(ref);
|
9587
|
-
const {
|
9588
|
-
const { setPopupDetailData, ctaEvent } = useSxpDataSource();
|
9589
|
-
const { jumpToWeb } = useEventReport();
|
9686
|
+
const { ctaEvent } = useSxpDataSource();
|
9590
9687
|
React.useEffect(() => {
|
9591
|
-
|
9592
|
-
if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
9593
|
-
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;
|
9688
|
+
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
9594
9689
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9595
9690
|
eventSubject: 'ctaExposure',
|
9596
9691
|
eventDescription: 'The cta was shown to the user'
|
9597
9692
|
}, rec, item, index);
|
9598
9693
|
}
|
9599
|
-
}, [isOnScreen, ref, rec, ctaEvent, index]);
|
9600
|
-
|
9601
|
-
|
9602
|
-
|
9603
|
-
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9604
|
-
eventSubject: 'clickCta',
|
9605
|
-
eventDescription: 'User clicked the CTA'
|
9606
|
-
}, rec, item, index);
|
9607
|
-
setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
|
9608
|
-
if (isExternalLink) {
|
9609
|
-
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) {
|
9610
|
-
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
9611
|
-
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
9612
|
-
jumpToWeb(rec, product, cta, index);
|
9613
|
-
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);
|
9614
|
-
}
|
9615
|
-
}
|
9616
|
-
else {
|
9617
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
9618
|
-
}
|
9619
|
-
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9620
|
-
return (React.createElement("div", { ref: ref, className: className, style: style, onClick: handleClick }, children));
|
9694
|
+
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
9695
|
+
return (React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, imgStyle)) },
|
9696
|
+
React.createElement("div", { ref: ref, hidden: !src, className: css.css({ width: '100%', height: '100%' }) },
|
9697
|
+
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` }))));
|
9621
9698
|
};
|
9622
|
-
var
|
9623
|
-
|
9624
|
-
var styles$6 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__3bKKx"};
|
9699
|
+
var Img$1 = React.memo(Img);
|
9625
9700
|
|
9626
9701
|
const Commodity$1 = (_a) => {
|
9627
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
9628
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
9702
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
9703
|
+
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"]);
|
9629
9704
|
const { sxpParameter } = useSxpDataSource();
|
9630
9705
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9631
9706
|
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;
|
9632
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9633
|
-
React.createElement(
|
9634
|
-
React.createElement(FormatImage$1, { className: css.css({
|
9635
|
-
width: '100%',
|
9636
|
-
objectFit: 'cover',
|
9637
|
-
height: '100%',
|
9638
|
-
display: 'block',
|
9639
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
9640
|
-
}), src: src })),
|
9707
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
9708
|
+
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 }),
|
9641
9709
|
React.createElement("div", { className: css.css({
|
9642
9710
|
color: '#fff',
|
9643
9711
|
display: 'flex',
|
@@ -9646,8 +9714,8 @@ Made in Italy` })));
|
|
9646
9714
|
width: '100%',
|
9647
9715
|
overflow: 'hidden'
|
9648
9716
|
}) },
|
9649
|
-
React.createElement("div", { className: styles$6['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9650
|
-
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)) }, (
|
9717
|
+
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'),
|
9718
|
+
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'))));
|
9651
9719
|
};
|
9652
9720
|
var CommodityComponent = React.memo(Commodity$1);
|
9653
9721
|
|
@@ -9720,14 +9788,14 @@ Made in Italy` })));
|
|
9720
9788
|
];
|
9721
9789
|
|
9722
9790
|
const Appoint$1 = (_a) => {
|
9723
|
-
var _b, _c, _d, _e;
|
9724
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9791
|
+
var _b, _c, _d, _e, _f, _g;
|
9792
|
+
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
9725
9793
|
const { sxpParameter } = useSxpDataSource();
|
9726
9794
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
9727
|
-
|
9728
|
-
|
9729
|
-
|
9730
|
-
React.createElement("div", { className: css.css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
9795
|
+
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;
|
9796
|
+
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),
|
9797
|
+
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 }),
|
9798
|
+
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')));
|
9731
9799
|
};
|
9732
9800
|
var AppointComponent = React.memo(Appoint$1);
|
9733
9801
|
|
@@ -9784,7 +9852,7 @@ Made in Italy` })));
|
|
9784
9852
|
var styles$5 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__nkBlU"};
|
9785
9853
|
|
9786
9854
|
const Link$1 = (_a) => {
|
9787
|
-
var _b, _c, _d, _e, _f;
|
9855
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
9788
9856
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index"]);
|
9789
9857
|
const { sxpParameter, bffEventReport } = useSxpDataSource();
|
9790
9858
|
const { jumpToWeb } = useEventReport();
|
@@ -9796,16 +9864,16 @@ Made in Italy` })));
|
|
9796
9864
|
window.location.href = window.getJointUtmLink(cta.link);
|
9797
9865
|
}
|
9798
9866
|
};
|
9867
|
+
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;
|
9799
9868
|
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 }),
|
9800
|
-
React.createElement(
|
9801
|
-
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 })),
|
9869
|
+
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 }),
|
9802
9870
|
React.createElement("div", { className: css.css({
|
9803
9871
|
display: 'flex',
|
9804
9872
|
alignItems: 'center',
|
9805
9873
|
width: '100%',
|
9806
9874
|
overflow: 'hidden'
|
9807
9875
|
}) },
|
9808
|
-
React.createElement("div", { className: styles$5['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle }, (
|
9876
|
+
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'))));
|
9809
9877
|
};
|
9810
9878
|
var LinkComponent = React.memo(Link$1);
|
9811
9879
|
|
@@ -9873,20 +9941,13 @@ Made in Italy` })));
|
|
9873
9941
|
var styles$4 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__yyHVb"};
|
9874
9942
|
|
9875
9943
|
const CommodityDiro$1 = (_a) => {
|
9876
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
9877
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
9944
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
9945
|
+
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"]);
|
9878
9946
|
const { sxpParameter } = useSxpDataSource();
|
9879
9947
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9880
9948
|
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;
|
9881
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9882
|
-
React.createElement(
|
9883
|
-
React.createElement(FormatImage$1, { className: css.css({
|
9884
|
-
width: '100%',
|
9885
|
-
objectFit: 'cover',
|
9886
|
-
height: '100%',
|
9887
|
-
display: 'block',
|
9888
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
9889
|
-
}), src: src })),
|
9949
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
9950
|
+
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 }),
|
9890
9951
|
React.createElement("div", { className: css.css({
|
9891
9952
|
color: '#fff',
|
9892
9953
|
display: 'flex',
|
@@ -9895,8 +9956,8 @@ Made in Italy` })));
|
|
9895
9956
|
width: '100%',
|
9896
9957
|
overflow: 'hidden'
|
9897
9958
|
}) },
|
9898
|
-
React.createElement("div", { className: styles$4['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9899
|
-
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)) }, (
|
9959
|
+
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'),
|
9960
|
+
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'))));
|
9900
9961
|
};
|
9901
9962
|
var CommodityDiroComponent = React.memo(CommodityDiro$1);
|
9902
9963
|
|
@@ -9971,20 +10032,13 @@ Made in Italy` })));
|
|
9971
10032
|
var styles$3 = {"tow-line-ellipsis":"index-module_tow-line-ellipsis__I-yCC"};
|
9972
10033
|
|
9973
10034
|
const CommodityDiroNew$1 = (_a) => {
|
9974
|
-
var _b, _c, _d, _e, _f, _g, _h, _j;
|
9975
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
10035
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
10036
|
+
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"]);
|
9976
10037
|
const { sxpParameter } = useSxpDataSource();
|
9977
10038
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
9978
10039
|
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;
|
9979
|
-
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
9980
|
-
React.createElement(
|
9981
|
-
React.createElement(FormatImage$1, { className: css.css({
|
9982
|
-
width: '100%',
|
9983
|
-
objectFit: 'cover',
|
9984
|
-
height: '100%',
|
9985
|
-
display: 'block',
|
9986
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
9987
|
-
}), src: src })),
|
10040
|
+
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css.css(Object.assign({}, style)), style: { display: 'flex' }, index: index }, props),
|
10041
|
+
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 }),
|
9988
10042
|
React.createElement("div", { className: css.css({
|
9989
10043
|
color: '#fff',
|
9990
10044
|
display: 'flex',
|
@@ -9993,8 +10047,8 @@ Made in Italy` })));
|
|
9993
10047
|
width: '100%',
|
9994
10048
|
overflow: 'hidden'
|
9995
10049
|
}) },
|
9996
|
-
React.createElement("div", { className: styles$3['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
9997
|
-
React.createElement("div", { className: css.css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
10050
|
+
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'),
|
10051
|
+
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'))));
|
9998
10052
|
};
|
9999
10053
|
var CommodityDiroNewComponent = React.memo(CommodityDiroNew$1);
|
10000
10054
|
|
@@ -10072,31 +10126,6 @@ Made in Italy` })));
|
|
10072
10126
|
};
|
10073
10127
|
var Scroll$1 = React.memo(Scroll);
|
10074
10128
|
|
10075
|
-
/*
|
10076
|
-
* @Author: binruan@chatlabs.com
|
10077
|
-
* @Date: 2024-01-16 14:50:13
|
10078
|
-
* @LastEditors: binruan@chatlabs.com
|
10079
|
-
* @LastEditTime: 2024-05-21 16:34:13
|
10080
|
-
* @FilePath: \pb-sxp-ui\src\materials\sxp\template\components\Img.tsx
|
10081
|
-
*
|
10082
|
-
*/
|
10083
|
-
const Img = ({ src, rec, item, index, style }) => {
|
10084
|
-
const ref = React.useRef(null);
|
10085
|
-
const isOnScreen = useOnScreen(ref);
|
10086
|
-
const { ctaEvent } = useSxpDataSource();
|
10087
|
-
React.useEffect(() => {
|
10088
|
-
if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
10089
|
-
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
10090
|
-
eventSubject: 'ctaExposure',
|
10091
|
-
eventDescription: 'The cta was shown to the user'
|
10092
|
-
}, rec, item, index);
|
10093
|
-
}
|
10094
|
-
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
10095
|
-
return (React.createElement("div", { ref: ref, hidden: !src, className: css.css({ width: '100%', height: '100%' }) },
|
10096
|
-
React.createElement(FormatImage$1, { className: css.css(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }, style)), src: src })));
|
10097
|
-
};
|
10098
|
-
var Img$1 = React.memo(Img);
|
10099
|
-
|
10100
10129
|
var styles$2 = {"two-line-ellipsis":"index-module_two-line-ellipsis__SFQwJ"};
|
10101
10130
|
|
10102
10131
|
const MultiCommodityDiro$1 = (_a) => {
|
@@ -10124,11 +10153,8 @@ Made in Italy` })));
|
|
10124
10153
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10125
10154
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10126
10155
|
var _a, _b, _c, _d, _e, _f, _g;
|
10127
|
-
return (React.createElement(
|
10128
|
-
React.createElement(
|
10129
|
-
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: {
|
10130
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
10131
|
-
} })),
|
10156
|
+
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) }),
|
10157
|
+
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 }),
|
10132
10158
|
React.createElement("div", { className: css.css({
|
10133
10159
|
color: '#000',
|
10134
10160
|
display: 'flex',
|
@@ -10138,7 +10164,7 @@ Made in Italy` })));
|
|
10138
10164
|
overflow: 'hidden'
|
10139
10165
|
}) },
|
10140
10166
|
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'),
|
10141
|
-
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'))));
|
10167
|
+
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'))))));
|
10142
10168
|
})));
|
10143
10169
|
};
|
10144
10170
|
var MultiCommodityDiroComponent = React.memo(MultiCommodityDiro$1);
|
@@ -10239,11 +10265,8 @@ Made in Italy` })));
|
|
10239
10265
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10240
10266
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10241
10267
|
var _a, _b, _c, _d, _e, _f, _g;
|
10242
|
-
return (React.createElement(
|
10243
|
-
React.createElement(
|
10244
|
-
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: {
|
10245
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
10246
|
-
} })),
|
10268
|
+
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) }),
|
10269
|
+
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 }),
|
10247
10270
|
React.createElement("div", { className: css.css({
|
10248
10271
|
color: '#fff',
|
10249
10272
|
display: 'flex',
|
@@ -10253,7 +10276,7 @@ Made in Italy` })));
|
|
10253
10276
|
overflow: 'hidden'
|
10254
10277
|
}) },
|
10255
10278
|
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'),
|
10256
|
-
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'))));
|
10279
|
+
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'))))));
|
10257
10280
|
})));
|
10258
10281
|
};
|
10259
10282
|
var MultiCommodityComponent = React.memo(MultiCommodity$1);
|
@@ -10353,11 +10376,8 @@ Made in Italy` })));
|
|
10353
10376
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
10354
10377
|
return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
10355
10378
|
var _a, _b, _c, _d, _e, _f, _g;
|
10356
|
-
return (React.createElement(
|
10357
|
-
React.createElement(
|
10358
|
-
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: {
|
10359
|
-
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
10360
|
-
} })),
|
10379
|
+
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) }),
|
10380
|
+
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 }),
|
10361
10381
|
React.createElement("div", { className: css.css({
|
10362
10382
|
color: '#fff',
|
10363
10383
|
display: 'flex',
|
@@ -10368,7 +10388,7 @@ Made in Italy` })));
|
|
10368
10388
|
lineHeight: '20px'
|
10369
10389
|
}) },
|
10370
10390
|
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'),
|
10371
|
-
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'))));
|
10391
|
+
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'))))));
|
10372
10392
|
})));
|
10373
10393
|
};
|
10374
10394
|
var MultiCommodityDiroNewComponent = React.memo(MultiCommodityDiroNew$1);
|
@@ -12721,10 +12741,10 @@ Made in Italy` })));
|
|
12721
12741
|
}
|
12722
12742
|
];
|
12723
12743
|
|
12724
|
-
const Consent$
|
12725
|
-
return React.createElement(Consent$
|
12744
|
+
const Consent$1 = (props) => {
|
12745
|
+
return React.createElement(Consent$1, Object.assign({}, props));
|
12726
12746
|
};
|
12727
|
-
var ConsentComponent = React.memo(Consent$
|
12747
|
+
var ConsentComponent = React.memo(Consent$1);
|
12728
12748
|
|
12729
12749
|
/*
|
12730
12750
|
* @Author: binruan@chatlabs.com
|
@@ -12734,7 +12754,7 @@ Made in Italy` })));
|
|
12734
12754
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\Consent\material.tsx
|
12735
12755
|
*
|
12736
12756
|
*/
|
12737
|
-
const Consent
|
12757
|
+
const Consent = createMaterial(ConsentComponent, {
|
12738
12758
|
displayName: 'Consent',
|
12739
12759
|
icon: '',
|
12740
12760
|
category: 'base',
|
@@ -12769,7 +12789,7 @@ Made in Italy` })));
|
|
12769
12789
|
CommodityDetailDiroNew: CommodityDetailDiroNew,
|
12770
12790
|
CommodityDiro: CommodityDiro,
|
12771
12791
|
CommodityDiroNew: CommodityDiroNew,
|
12772
|
-
Consent: Consent
|
12792
|
+
Consent: Consent,
|
12773
12793
|
HashTag: HashTag,
|
12774
12794
|
Link: Link,
|
12775
12795
|
MultiCommodity: MultiCommodity,
|
@@ -12875,7 +12895,7 @@ Made in Italy` })));
|
|
12875
12895
|
React.useEffect(() => {
|
12876
12896
|
if (!videoRef)
|
12877
12897
|
return;
|
12878
|
-
videoRef
|
12898
|
+
videoRef.muted = muted;
|
12879
12899
|
}, [muted, videoRef]);
|
12880
12900
|
const handleEnded = React.useCallback(() => {
|
12881
12901
|
if (!videoRef)
|
@@ -12890,10 +12910,10 @@ Made in Italy` })));
|
|
12890
12910
|
setIsLoadFinish(true);
|
12891
12911
|
setIsPauseVideo(false);
|
12892
12912
|
const item = data[index];
|
12893
|
-
if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
12894
|
-
videoStartTime.current = (videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
12895
|
-
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
12896
|
-
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
12913
|
+
if (item && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration)) {
|
12914
|
+
videoStartTime.current = (videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) || 0;
|
12915
|
+
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) !== null && _a !== void 0 ? _a : 0).toFixed(2);
|
12916
|
+
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
12897
12917
|
const playType = isFirstPlay ? '0' : '1';
|
12898
12918
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12899
12919
|
eventInfo: {
|
@@ -12917,21 +12937,17 @@ Made in Italy` })));
|
|
12917
12937
|
var _a;
|
12918
12938
|
if (!videoRef || firstFrameSrc || !blur)
|
12919
12939
|
return;
|
12920
|
-
|
12921
|
-
if (!videoDomRef)
|
12922
|
-
return;
|
12923
|
-
videoDomRef.style.objectFit = 'contain';
|
12940
|
+
videoRef.style.objectFit = 'contain';
|
12924
12941
|
if (((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || !canvasRef || !canvasRef.current || isBgColor)
|
12925
12942
|
return;
|
12926
12943
|
const setFrameImg = () => {
|
12927
|
-
const video = videoDomRef;
|
12928
12944
|
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
12929
12945
|
const ctx = canvas.getContext('2d');
|
12930
12946
|
const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
|
12931
12947
|
const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
|
12932
12948
|
canvas.height = targetHeight;
|
12933
12949
|
canvas.width = targetWidth;
|
12934
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(
|
12950
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(videoRef, 0, 0, canvas.width, canvas.height);
|
12935
12951
|
setFirstFrameSrc(canvas.toDataURL());
|
12936
12952
|
};
|
12937
12953
|
setFrameImg();
|
@@ -12943,21 +12959,13 @@ Made in Italy` })));
|
|
12943
12959
|
if (!videoRef)
|
12944
12960
|
return;
|
12945
12961
|
handLoadeddata();
|
12946
|
-
// if (activeIndex !== index) {
|
12947
|
-
// videoRef?.play();
|
12948
|
-
// videoRef?.pause();
|
12949
|
-
// }
|
12950
|
-
// setIsLoadFinish(true);
|
12951
12962
|
}, [videoRef, handLoadeddata]);
|
12952
|
-
React.useCallback(() => {
|
12953
|
-
setIsLoadFinish(true);
|
12954
|
-
}, []);
|
12955
12963
|
const handleClickVideo = React.useCallback((type) => () => {
|
12956
12964
|
if (!videoRef)
|
12957
12965
|
return;
|
12958
12966
|
if (!isLoadFinish)
|
12959
12967
|
return;
|
12960
|
-
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused
|
12968
|
+
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused;
|
12961
12969
|
switch (type) {
|
12962
12970
|
case 'start':
|
12963
12971
|
if (!isPause)
|
@@ -12989,10 +12997,10 @@ Made in Italy` })));
|
|
12989
12997
|
if (activeIndex !== index)
|
12990
12998
|
return;
|
12991
12999
|
const item = data[index];
|
12992
|
-
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
12993
|
-
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
12994
|
-
if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration
|
12995
|
-
const playDuration = ((videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime
|
13000
|
+
const videoDuration = ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) !== null && _a !== void 0 ? _a : 0).toFixed(2);
|
13001
|
+
const videoCurrentTime = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) !== null && _b !== void 0 ? _b : 0).toFixed(2);
|
13002
|
+
if (videoRef === null || videoRef === void 0 ? void 0 : videoRef.duration) {
|
13003
|
+
const playDuration = ((videoRef === null || videoRef === void 0 ? void 0 : videoRef.currentTime) - videoStartTime.current).toFixed(2);
|
12996
13004
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
12997
13005
|
eventInfo: {
|
12998
13006
|
eventSubject: 'playOverVideo',
|
@@ -13016,7 +13024,19 @@ Made in Italy` })));
|
|
13016
13024
|
const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
|
13017
13025
|
if (!videoSrc)
|
13018
13026
|
return;
|
13019
|
-
|
13027
|
+
if (videoSrc.includes('.m3u8')) {
|
13028
|
+
if (Hls.isSupported()) {
|
13029
|
+
const hls = new Hls();
|
13030
|
+
hls.loadSource(videoSrc);
|
13031
|
+
hls.attachMedia(videoRef.current);
|
13032
|
+
}
|
13033
|
+
else {
|
13034
|
+
videoRef.src = videoSrc;
|
13035
|
+
}
|
13036
|
+
}
|
13037
|
+
else {
|
13038
|
+
videoRef.src = videoSrc;
|
13039
|
+
}
|
13020
13040
|
setIsPauseVideo(false);
|
13021
13041
|
const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
|
13022
13042
|
const dom = document.querySelector('#player-container-id');
|
@@ -13024,20 +13044,20 @@ Made in Italy` })));
|
|
13024
13044
|
if (!dom && !dom2)
|
13025
13045
|
return;
|
13026
13046
|
videoPlayerWrapperNode === null || videoPlayerWrapperNode === void 0 ? void 0 : videoPlayerWrapperNode.appendChild(dom || dom2);
|
13027
|
-
videoRef
|
13028
|
-
videoRef
|
13029
|
-
|
13030
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13031
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13032
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13047
|
+
videoRef.setAttribute('x5-playsinline', 'true');
|
13048
|
+
videoRef.setAttribute('webkit-playsinline', 'true');
|
13049
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadedmetadata', handleLoadedmetadata);
|
13050
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('loadeddata', handLoadeddata);
|
13051
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('playing', handlePlaying);
|
13052
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('pause', handlePause);
|
13053
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.addEventListener('ended', handleEnded);
|
13033
13054
|
return () => {
|
13034
13055
|
dom2 === null || dom2 === void 0 ? void 0 : dom2.appendChild(dom);
|
13035
|
-
videoRef === null || videoRef === void 0 ? void 0 : videoRef.
|
13036
|
-
videoRef === null || videoRef === void 0 ? void 0 : 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.off('ended', handleEnded);
|
13056
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadedmetadata', handleLoadedmetadata);
|
13057
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('loadeddata', handLoadeddata);
|
13058
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('playing', handlePlaying);
|
13059
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('pause', handlePause);
|
13060
|
+
videoRef === null || videoRef === void 0 ? void 0 : videoRef.removeEventListener('ended', handleEnded);
|
13041
13061
|
};
|
13042
13062
|
}, [isActive, videoId, rec, videoRef]);
|
13043
13063
|
React.useEffect(() => {
|
@@ -13059,7 +13079,7 @@ Made in Italy` })));
|
|
13059
13079
|
React.useEffect(() => {
|
13060
13080
|
if (!isActive || !videoRef)
|
13061
13081
|
return;
|
13062
|
-
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused
|
13082
|
+
const isPause = videoRef === null || videoRef === void 0 ? void 0 : videoRef.paused;
|
13063
13083
|
if (!isPause && openHashtag) {
|
13064
13084
|
videoRef === null || videoRef === void 0 ? void 0 : videoRef.pause();
|
13065
13085
|
}
|
@@ -13498,142 +13518,64 @@ Made in Italy` })));
|
|
13498
13518
|
};
|
13499
13519
|
var Tagbar$1 = React.memo(Tagbar);
|
13500
13520
|
|
13501
|
-
/*
|
13502
|
-
* @Author: binruan@chatlabs.com
|
13503
|
-
* @Date: 2024-06-13 15:16:53
|
13504
|
-
* @LastEditors: binruan@chatlabs.com
|
13505
|
-
* @LastEditTime: 2024-06-19 14:13:50
|
13506
|
-
* @FilePath: \pb-sxp-ui\src\core\components\Consent\index.tsx
|
13507
|
-
*
|
13508
|
-
*/
|
13509
|
-
const Consent = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
|
13510
|
-
const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
|
13511
|
-
const channelObj = React.useMemo(() => {
|
13512
|
-
const queryString = location.search.slice(1);
|
13513
|
-
const params = qs.parse(queryString.replace(/\+/g, '%2B'));
|
13514
|
-
for (const key in params) {
|
13515
|
-
params[key] = params[key].replace(/%2B/g, '+');
|
13516
|
-
}
|
13517
|
-
return params;
|
13518
|
-
}, []);
|
13519
|
-
const getUtmValue = (key) => { var _a; return (_a = channelObj[key]) !== null && _a !== void 0 ? _a : null; };
|
13520
|
-
React.useEffect(() => {
|
13521
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13522
|
-
eventInfo: {
|
13523
|
-
eventSubject: 'privacyEnter',
|
13524
|
-
eventDescription: 'User enter privacy page',
|
13525
|
-
utmSource: getUtmValue('utm_source'),
|
13526
|
-
utmMedium: getUtmValue('utm_medium'),
|
13527
|
-
utmCampaign: getUtmValue('utm_campaign'),
|
13528
|
-
utmId: getUtmValue('utm_id'),
|
13529
|
-
utmContent: getUtmValue('utm_content'),
|
13530
|
-
clSource: getUtmValue('cl_source'),
|
13531
|
-
enterTime: `${Date.now()}`,
|
13532
|
-
enterUrl: window.location.href,
|
13533
|
-
rtc: null,
|
13534
|
-
requestId: null,
|
13535
|
-
sessionID: null
|
13536
|
-
}
|
13537
|
-
});
|
13538
|
-
}, []);
|
13539
|
-
const handleAgree = () => {
|
13540
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13541
|
-
eventInfo: {
|
13542
|
-
eventSubject: 'userConsent',
|
13543
|
-
eventDescription: '用户授权【操作结果】',
|
13544
|
-
consentResult: '0',
|
13545
|
-
consentTags: '["系统运营"]',
|
13546
|
-
rtc: null,
|
13547
|
-
requestId: null,
|
13548
|
-
sessionID: null
|
13549
|
-
}
|
13550
|
-
});
|
13551
|
-
setIsAgreePolicy === null || setIsAgreePolicy === void 0 ? void 0 : setIsAgreePolicy(true);
|
13552
|
-
window.localStorage.setItem(AGREE_POLICY, 'yes');
|
13553
|
-
};
|
13554
|
-
return (React.createElement("div", { className: 'consent-bg' },
|
13555
|
-
React.createElement("div", { className: 'consent' },
|
13556
|
-
React.createElement("div", { className: 'consent-col' },
|
13557
|
-
React.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
|
13558
|
-
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.')),
|
13559
|
-
React.createElement("div", { className: 'consent-col' },
|
13560
|
-
React.createElement("button", { "aria-label": 'agree', className: 'consent-btn', onClick: handleAgree }, "Agree"),
|
13561
|
-
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')))));
|
13562
|
-
};
|
13563
|
-
var Consent$1 = React.memo(Consent);
|
13564
|
-
|
13565
13521
|
/*
|
13566
13522
|
* @Author: binruan@chatlabs.com
|
13567
13523
|
* @Date: 2024-01-15 19:03:09
|
13568
13524
|
* @LastEditors: binruan@chatlabs.com
|
13569
|
-
* @LastEditTime: 2024-06-
|
13525
|
+
* @LastEditTime: 2024-06-21 08:56:05
|
13570
13526
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
13571
13527
|
*
|
13572
13528
|
*/
|
13573
13529
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
|
13574
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
13530
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
13575
13531
|
const { schema } = useEditor();
|
13576
13532
|
const [activeIndex, setActiveIndex] = React.useState(0);
|
13577
13533
|
const viewImageStartTime = React.useRef(0);
|
13578
|
-
|
13534
|
+
React.useState(false);
|
13579
13535
|
const [isMuted, setIsMuted] = React.useState(true);
|
13580
13536
|
const viewTime = React.useRef();
|
13581
13537
|
const [isLoadMore, setIsLoadMore] = React.useState(false);
|
13582
13538
|
const [isShowMore, setIsShowMore] = React.useState(false);
|
13583
13539
|
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag } = useSxpDataSource();
|
13584
13540
|
const { backMainFeed } = useEventReport();
|
13585
|
-
const
|
13586
|
-
const playerRef = React.useRef();
|
13541
|
+
const videoRef = React.useRef();
|
13587
13542
|
const { productView } = useEventReport();
|
13588
13543
|
const isShowFingerTip = React.useMemo(() => {
|
13589
13544
|
return data.length > 0 && !loading && getFeUserId();
|
13590
13545
|
}, [data, loading]);
|
13591
|
-
|
13592
|
-
|
13593
|
-
|
13546
|
+
React.useEffect(() => {
|
13547
|
+
refreshFeSessionId();
|
13548
|
+
}, []);
|
13549
|
+
React.useEffect(() => {
|
13550
|
+
if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
|
13551
|
+
const now = new Date();
|
13552
|
+
viewTime.current = now;
|
13553
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
13554
|
+
eventName: 'PageView'
|
13555
|
+
});
|
13594
13556
|
}
|
13557
|
+
}, [data === null || data === void 0 ? void 0 : data.length]);
|
13558
|
+
const handleH5EnterLink = React.useCallback(() => {
|
13595
13559
|
refreshFeSessionId();
|
13596
|
-
|
13597
|
-
|
13598
|
-
|
13599
|
-
|
13560
|
+
h5EnterLink === null || h5EnterLink === void 0 ? void 0 : h5EnterLink();
|
13561
|
+
if (data.length > 0) {
|
13562
|
+
const now = new Date();
|
13563
|
+
viewTime.current = now;
|
13564
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
13565
|
+
eventName: 'PageView'
|
13566
|
+
});
|
13600
13567
|
}
|
13601
|
-
|
13602
|
-
eventName: 'PageView'
|
13603
|
-
});
|
13604
|
-
setIsInit(true);
|
13605
|
-
}, [data.length, bffFbReport, h5EnterLink, isInit]);
|
13568
|
+
}, [data.length, bffFbReport, h5EnterLink]);
|
13606
13569
|
const firstRef = React.useRef();
|
13607
13570
|
React.useEffect(() => {
|
13608
13571
|
var _a, _b, _c, _d;
|
13609
|
-
if (!firstRef.current &&
|
13572
|
+
if (!firstRef.current && (videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) && (data === null || data === void 0 ? void 0 : data.length) > 0) {
|
13610
13573
|
firstRef.current = true;
|
13611
|
-
|
13612
|
-
|
13613
|
-
|
13614
|
-
loop: false,
|
13615
|
-
autoplay: true,
|
13616
|
-
muted: true,
|
13617
|
-
preload: 'auto',
|
13618
|
-
posterImage: false,
|
13619
|
-
bigPlayButton: true,
|
13620
|
-
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)
|
13621
|
-
? [
|
13622
|
-
{
|
13623
|
-
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
|
13624
|
-
}
|
13625
|
-
]
|
13626
|
-
: []
|
13627
|
-
});
|
13628
|
-
player === null || player === void 0 ? void 0 : player.ready(() => {
|
13629
|
-
setVideoRef(player);
|
13630
|
-
});
|
13574
|
+
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) {
|
13575
|
+
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;
|
13576
|
+
}
|
13631
13577
|
}
|
13632
|
-
}, [videoRef,
|
13633
|
-
React.useEffect(() => {
|
13634
|
-
if (!isInit)
|
13635
|
-
handleH5EnterLink();
|
13636
|
-
}, [handleH5EnterLink, isInit]);
|
13578
|
+
}, [videoRef, data]);
|
13637
13579
|
React.useEffect(() => {
|
13638
13580
|
var _a;
|
13639
13581
|
const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
|
@@ -13751,7 +13693,7 @@ Made in Italy` })));
|
|
13751
13693
|
const renderContent = React.useCallback((rec, index) => {
|
13752
13694
|
var _a, _b, _c, _d;
|
13753
13695
|
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
13754
|
-
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 }));
|
13696
|
+
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 }));
|
13755
13697
|
}
|
13756
13698
|
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
13757
13699
|
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 }));
|
@@ -13777,7 +13719,7 @@ Made in Italy` })));
|
|
13777
13719
|
tipText,
|
13778
13720
|
resolver,
|
13779
13721
|
schema,
|
13780
|
-
videoRef
|
13722
|
+
videoRef.current
|
13781
13723
|
]);
|
13782
13724
|
const onExpandableChange = React.useCallback((v) => {
|
13783
13725
|
setIsShowMore(v);
|
@@ -13935,14 +13877,17 @@ Made in Italy` })));
|
|
13935
13877
|
}
|
13936
13878
|
};
|
13937
13879
|
const visList = React.useMemo(() => {
|
13938
|
-
|
13939
|
-
|
13940
|
-
|
13941
|
-
|
13942
|
-
|
13943
|
-
|
13944
|
-
|
13945
|
-
|
13880
|
+
var _a;
|
13881
|
+
const list = activeIndex === 0
|
13882
|
+
? [(_a = data === null || data === void 0 ? void 0 : data[0]) !== null && _a !== void 0 ? _a : null]
|
13883
|
+
: data === null || data === void 0 ? void 0 : data.map((item, index) => {
|
13884
|
+
if (activeIndex === index || index - 1 === activeIndex || index + 1 === activeIndex) {
|
13885
|
+
return item;
|
13886
|
+
}
|
13887
|
+
else {
|
13888
|
+
return null;
|
13889
|
+
}
|
13890
|
+
});
|
13946
13891
|
return !waterFallData ? list.concat([{ loading: true }]) : list;
|
13947
13892
|
}, [data, activeIndex, waterFallData]);
|
13948
13893
|
const renderView = React.useMemo(() => {
|
@@ -13967,48 +13912,47 @@ Made in Italy` })));
|
|
13967
13912
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
13968
13913
|
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
13969
13914
|
return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
|
13970
|
-
|
13971
|
-
|
13972
|
-
|
13973
|
-
|
13974
|
-
|
13975
|
-
|
13976
|
-
|
13977
|
-
|
13978
|
-
|
13979
|
-
|
13980
|
-
|
13981
|
-
|
13982
|
-
|
13983
|
-
|
13984
|
-
|
13985
|
-
|
13986
|
-
|
13987
|
-
|
13988
|
-
|
13989
|
-
|
13990
|
-
|
13991
|
-
|
13992
|
-
if (
|
13993
|
-
|
13994
|
-
|
13995
|
-
|
13996
|
-
|
13997
|
-
});
|
13998
|
-
}
|
13915
|
+
waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, onClose: () => {
|
13916
|
+
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
13917
|
+
} })),
|
13918
|
+
renderLogo,
|
13919
|
+
React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
13920
|
+
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,
|
13921
|
+
React.createElement(Swiper, { style: {
|
13922
|
+
marginTop: tagHeight
|
13923
|
+
}, ref: swiperRef, onSlideChange: () => {
|
13924
|
+
swiperRef.current.swiper.allowTouchMove = false;
|
13925
|
+
setTimeout(() => {
|
13926
|
+
swiperRef.current.swiper.allowTouchMove = true;
|
13927
|
+
}, 500);
|
13928
|
+
}, onActiveIndexChange: (swiper) => {
|
13929
|
+
setActiveIndex(swiper.activeIndex);
|
13930
|
+
if (openHashtag)
|
13931
|
+
return;
|
13932
|
+
// 处理上滑下滑事件
|
13933
|
+
handleScrollEvent(swiper);
|
13934
|
+
if (waterFallData)
|
13935
|
+
return;
|
13936
|
+
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 2 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
13937
|
+
if (!isLoadMore) {
|
13938
|
+
setIsLoadMore(true);
|
13939
|
+
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(Math.ceil(activeIndex / 10) + 1).then(() => {
|
13940
|
+
setIsLoadMore(false);
|
13941
|
+
});
|
13999
13942
|
}
|
14000
|
-
}
|
14001
|
-
|
14002
|
-
|
14003
|
-
|
14004
|
-
|
14005
|
-
|
14006
|
-
|
14007
|
-
|
14008
|
-
|
14009
|
-
|
13943
|
+
}
|
13944
|
+
}, direction: 'vertical', height: height },
|
13945
|
+
React.createElement(ToggleButton$1, { style: {
|
13946
|
+
position: 'fixed',
|
13947
|
+
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',
|
13948
|
+
zIndex: 999,
|
13949
|
+
[(_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,
|
13950
|
+
[(_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
|
13951
|
+
}, 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 }),
|
13952
|
+
renderView),
|
13953
|
+
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)),
|
14010
13954
|
React.createElement("div", { style: { position: 'absolute', zIndex: -100 } },
|
14011
|
-
React.createElement("video", { ref:
|
13955
|
+
React.createElement("video", { ref: videoRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', preload: 'auto', controls: false, muted: true, style: {
|
14012
13956
|
backgroundColor: 'transparent',
|
14013
13957
|
width: '100%',
|
14014
13958
|
height: '100%',
|