pb-sxp-ui 1.0.86 → 1.0.87
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 +208 -265
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +209 -266
- 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 +208 -265
- 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/Consent/index.js +2 -2
- package/es/core/components/DiyPortalPreview/VideoWidget.js +3 -3
- package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +1 -1
- package/es/core/components/SxpPageRender/FormatImage.js +2 -2
- package/es/core/components/SxpPageRender/LikeButton/index.js +1 -1
- package/es/core/components/SxpPageRender/Navbar.js +1 -1
- package/es/core/components/SxpPageRender/Nudge/index.js +1 -1
- package/es/core/components/SxpPageRender/Tagbar.js +6 -7
- package/es/core/components/SxpPageRender/ToggleButton/index.js +2 -2
- package/es/core/components/SxpPageRender/VideoWidget/index.js +3 -3
- package/es/core/components/SxpPageRender/WaterFall/List.js +2 -2
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +17 -52
- package/es/core/components/SxpPageRender/WaterFall/index.js +2 -4
- package/es/core/components/SxpPageRender/index.js +48 -52
- package/es/core/context/SxpDataSourceProvider.d.ts +4 -0
- package/es/core/context/SxpDataSourceProvider.js +20 -17
- package/es/core/hooks/useEventReport.d.ts +1 -1
- package/es/core/hooks/useEventReport.js +13 -10
- package/es/materials/sxp/popup/AppointForm/index.js +1 -1
- package/es/materials/sxp/popup/CommodityDetail/index.js +3 -3
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +4 -4
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -3
- package/es/materials/sxp/popup/Prompt/index.js +2 -2
- package/es/materials/sxp/template/Appoint/index.js +1 -1
- package/lib/core/components/Consent/index.js +2 -2
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +3 -3
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +1 -1
- package/lib/core/components/SxpPageRender/FormatImage.js +2 -2
- package/lib/core/components/SxpPageRender/LikeButton/index.js +1 -1
- package/lib/core/components/SxpPageRender/Navbar.js +1 -1
- package/lib/core/components/SxpPageRender/Nudge/index.js +1 -1
- package/lib/core/components/SxpPageRender/Tagbar.js +7 -8
- package/lib/core/components/SxpPageRender/ToggleButton/index.js +2 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +3 -3
- package/lib/core/components/SxpPageRender/WaterFall/List.js +2 -2
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +17 -52
- package/lib/core/components/SxpPageRender/WaterFall/index.js +2 -4
- package/lib/core/components/SxpPageRender/index.js +48 -52
- package/lib/core/context/SxpDataSourceProvider.d.ts +4 -0
- package/lib/core/context/SxpDataSourceProvider.js +21 -18
- package/lib/core/hooks/useEventReport.d.ts +1 -1
- package/lib/core/hooks/useEventReport.js +13 -10
- package/lib/materials/sxp/popup/AppointForm/index.js +1 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.js +3 -3
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +4 -4
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +3 -3
- package/lib/materials/sxp/popup/Prompt/index.js +2 -2
- package/lib/materials/sxp/template/Appoint/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { isEmpty, isEqual, cloneDeep, debounce, throttle, get } from 'lodash';
|
2
2
|
import { v4 } from 'uuid';
|
3
3
|
import pako from 'pako';
|
4
|
-
import React, { useContext, useMemo,
|
4
|
+
import React, { useContext, useMemo, createContext, memo, useState, useRef, useEffect, useCallback, forwardRef, useImperativeHandle, useLayoutEffect } from 'react';
|
5
5
|
import qs from 'qs';
|
6
6
|
import EventEmitter from 'eventemitter3';
|
7
7
|
import { css } from '@emotion/css';
|
@@ -415,70 +415,6 @@ var SXP_EVENT_TYPE;
|
|
415
415
|
SXP_EVENT_TYPE["CHANGE_THEME_TAG"] = "changeThemeTag";
|
416
416
|
})(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
|
417
417
|
|
418
|
-
/*
|
419
|
-
* @Author: binruan@chatlabs.com
|
420
|
-
* @Date: 2024-06-13 15:16:53
|
421
|
-
* @LastEditors: binruan@chatlabs.com
|
422
|
-
* @LastEditTime: 2024-06-18 16:06:16
|
423
|
-
* @FilePath: \pb-sxp-ui\src\core\components\Consent\index.tsx
|
424
|
-
*
|
425
|
-
*/
|
426
|
-
const Consent$2 = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
|
427
|
-
const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
|
428
|
-
const channelObj = useMemo(() => {
|
429
|
-
const queryString = location.search.slice(1);
|
430
|
-
const params = qs.parse(queryString.replace(/\+/g, '%2B'));
|
431
|
-
for (const key in params) {
|
432
|
-
params[key] = params[key].replace(/%2B/g, '+');
|
433
|
-
}
|
434
|
-
return params;
|
435
|
-
}, []);
|
436
|
-
const getUtmValue = (key) => { var _a; return (_a = channelObj[key]) !== null && _a !== void 0 ? _a : null; };
|
437
|
-
useEffect(() => {
|
438
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
439
|
-
eventInfo: {
|
440
|
-
eventSubject: 'privacyEnter',
|
441
|
-
eventDescription: 'User enter privacy page',
|
442
|
-
utmSource: getUtmValue('utm_source'),
|
443
|
-
utmMedium: getUtmValue('utm_medium'),
|
444
|
-
utmCampaign: getUtmValue('utm_campaign'),
|
445
|
-
utmId: getUtmValue('utm_id'),
|
446
|
-
utmContent: getUtmValue('utm_content'),
|
447
|
-
clSource: getUtmValue('cl_source'),
|
448
|
-
enterTime: `${Date.now()}`,
|
449
|
-
enterUrl: window.location.href,
|
450
|
-
rtc: null,
|
451
|
-
requestId: null,
|
452
|
-
sessionID: null
|
453
|
-
}
|
454
|
-
});
|
455
|
-
}, []);
|
456
|
-
const handleAgree = () => {
|
457
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
458
|
-
eventInfo: {
|
459
|
-
eventSubject: 'userConsent',
|
460
|
-
eventDescription: '用户授权【操作结果】',
|
461
|
-
consentResult: '0',
|
462
|
-
consentTags: '["系统运营"]',
|
463
|
-
rtc: null,
|
464
|
-
requestId: null,
|
465
|
-
sessionID: null
|
466
|
-
}
|
467
|
-
});
|
468
|
-
setIsAgreePolicy === null || setIsAgreePolicy === void 0 ? void 0 : setIsAgreePolicy(true);
|
469
|
-
window.localStorage.setItem(AGREE_POLICY, 'yes');
|
470
|
-
};
|
471
|
-
return (React.createElement("div", { className: 'consent-bg' },
|
472
|
-
React.createElement("div", { className: 'consent' },
|
473
|
-
React.createElement("div", { className: 'consent-col' },
|
474
|
-
React.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
|
475
|
-
React.createElement("div", { className: 'consent-content' }, privacy_context !== null && privacy_context !== void 0 ? privacy_context : 'This site uses cookies to improve your online experience. By continuing to use the site please agree the policy first.')),
|
476
|
-
React.createElement("div", { className: 'consent-col' },
|
477
|
-
React.createElement("button", { className: 'consent-btn', onClick: handleAgree }, "Agree"),
|
478
|
-
React.createElement("a", { className: 'consent-policy', target: '_blank', href: privacy_policy_url }, privacy_policy_title !== null && privacy_policy_title !== void 0 ? privacy_policy_title : 'More information')))));
|
479
|
-
};
|
480
|
-
var Consent$3 = memo(Consent$2);
|
481
|
-
|
482
418
|
const SxpDataSourceContext = createContext({
|
483
419
|
rtcList: [],
|
484
420
|
tagList: []
|
@@ -488,8 +424,8 @@ var DataSourceType;
|
|
488
424
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
489
425
|
})(DataSourceType || (DataSourceType = {}));
|
490
426
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
427
|
+
const DEFAULT_TAG = 'FOR U';
|
491
428
|
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 }) => {
|
492
|
-
var _a, _b, _c;
|
493
429
|
const [rtcList, setRtcList] = useState([]);
|
494
430
|
const [tagList, setTagList] = useState([]);
|
495
431
|
const [loading, setLoading] = useState(false);
|
@@ -507,6 +443,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
507
443
|
const [videoRef, setVideoRef] = useState(null);
|
508
444
|
const themeTag = useRef();
|
509
445
|
const curTime = useRef();
|
446
|
+
const [selectTag, setSelectTag] = useState(DEFAULT_TAG);
|
510
447
|
const isShowConsent = useMemo(() => {
|
511
448
|
var _a, _b, _c, _d;
|
512
449
|
return (((_d = (_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) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent;
|
@@ -555,10 +492,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
555
492
|
}, [bffDataSource]);
|
556
493
|
// 获取推荐视频数据
|
557
494
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
558
|
-
var
|
495
|
+
var _a, _b, _c, _d, _e;
|
559
496
|
query = {
|
560
|
-
maxSize: (
|
561
|
-
defaultSize: (
|
497
|
+
maxSize: (_a = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _a !== void 0 ? _a : maxSize,
|
498
|
+
defaultSize: (_b = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _b !== void 0 ? _b : defaultSize,
|
562
499
|
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
563
500
|
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
564
501
|
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
@@ -566,10 +503,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
566
503
|
themeTag: query === null || query === void 0 ? void 0 : query.themeTag
|
567
504
|
};
|
568
505
|
if (utmVal) {
|
569
|
-
const val = (
|
506
|
+
const val = (_e = (_d = (_c = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _c === void 0 ? void 0 : _c.filter((val) => {
|
570
507
|
const key = val.split('=')[0];
|
571
508
|
return UTM_KEYS.includes(key);
|
572
|
-
})) === null ||
|
509
|
+
})) === null || _d === void 0 ? void 0 : _d.join('&')) !== null && _e !== void 0 ? _e : '';
|
573
510
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
574
511
|
}
|
575
512
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
@@ -581,7 +518,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
581
518
|
return result === null || result === void 0 ? void 0 : result.data;
|
582
519
|
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
583
520
|
const loadVideos = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
584
|
-
var
|
521
|
+
var _f, _g;
|
585
522
|
if (rtcList.length <= 0) {
|
586
523
|
return;
|
587
524
|
}
|
@@ -591,8 +528,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
591
528
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
592
529
|
themeTag: themeTag.current
|
593
530
|
});
|
594
|
-
setRtcList(rtcList.concat((
|
595
|
-
setCacheRtcList(cacheRtcList.concat((
|
531
|
+
setRtcList(rtcList.concat((_f = data === null || data === void 0 ? void 0 : data.recList) !== null && _f !== void 0 ? _f : []));
|
532
|
+
setCacheRtcList(cacheRtcList.concat((_g = data === null || data === void 0 ? void 0 : data.recList) !== null && _g !== void 0 ? _g : []));
|
596
533
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
597
534
|
const bffEventReport = useCallback(({ userInfo, eventInfo }) => {
|
598
535
|
// 关闭 BFF 事件上报
|
@@ -656,16 +593,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
656
593
|
}), [bffFetch]);
|
657
594
|
// 获取 Tag
|
658
595
|
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
659
|
-
var
|
596
|
+
var _h, _j, _k, _l, _m;
|
660
597
|
if (!utmVal || !isShowTag)
|
661
598
|
return;
|
662
599
|
try {
|
663
|
-
const val = (
|
600
|
+
const val = (_k = (_j = (_h = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _h === void 0 ? void 0 : _h.filter((val) => {
|
664
601
|
const key = val.split('=')[0];
|
665
602
|
return UTM_KEYS.includes(key);
|
666
|
-
})) === null ||
|
603
|
+
})) === null || _j === void 0 ? void 0 : _j.join('&')) !== null && _k !== void 0 ? _k : '';
|
667
604
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
668
|
-
setTagList((
|
605
|
+
setTagList((_m = (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []);
|
669
606
|
}
|
670
607
|
catch (e) {
|
671
608
|
console.log('e', e);
|
@@ -796,14 +733,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
796
733
|
setIsAgreePolicy,
|
797
734
|
curTime,
|
798
735
|
h5EnterLink,
|
799
|
-
themeTag
|
800
|
-
|
736
|
+
themeTag,
|
737
|
+
isShowConsent,
|
738
|
+
selectTag,
|
739
|
+
setSelectTag
|
740
|
+
} }, render({
|
801
741
|
rtcList,
|
802
742
|
mutateLike: bffMutateLike,
|
803
743
|
mutateUnlike: bffMutateUnlike,
|
804
744
|
submitForm: bffSubmitForm,
|
805
745
|
tagList
|
806
|
-
})))
|
746
|
+
})));
|
807
747
|
};
|
808
748
|
var SxpDataSourceProvider$1 = memo(SxpDataSourceProvider);
|
809
749
|
|
@@ -1207,7 +1147,7 @@ var settingRender$6 = [
|
|
1207
1147
|
* @Author: binruan@chatlabs.com
|
1208
1148
|
* @Date: 2024-03-12 10:59:06
|
1209
1149
|
* @LastEditors: binruan@chatlabs.com
|
1210
|
-
* @LastEditTime: 2024-06-
|
1150
|
+
* @LastEditTime: 2024-06-20 13:39:07
|
1211
1151
|
* @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
|
1212
1152
|
*
|
1213
1153
|
*/
|
@@ -1277,16 +1217,18 @@ function useEventReport() {
|
|
1277
1217
|
}
|
1278
1218
|
});
|
1279
1219
|
}, [bffEventReport, popupDetailData]);
|
1280
|
-
const backMainFeed = useCallback((lastFeed, themeTag, hashTag) => {
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1220
|
+
const backMainFeed = useCallback((lastFeed, selectTag, themeTag, hashTag) => {
|
1221
|
+
if (selectTag && selectTag === DEFAULT_TAG) {
|
1222
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
1223
|
+
eventInfo: {
|
1224
|
+
lastFeed,
|
1225
|
+
themeTags: themeTag ? `['${themeTag}']` : '',
|
1226
|
+
hashTags: hashTag ? `['${hashTag}']` : '',
|
1227
|
+
eventSubject: 'backMainFeed',
|
1228
|
+
eventDescription: 'back Main Feed'
|
1229
|
+
}
|
1230
|
+
});
|
1231
|
+
}
|
1290
1232
|
}, [bffEventReport]);
|
1291
1233
|
return {
|
1292
1234
|
jumpToWeb,
|
@@ -1373,7 +1315,7 @@ const AppointForm$1 = (_a) => {
|
|
1373
1315
|
React.createElement("div", { className: 'pb-appoint-form-container' },
|
1374
1316
|
React.createElement(BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
|
1375
1317
|
React.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
|
1376
|
-
React.createElement("button", { onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? React.createElement(React.Fragment, null, "loading...") : submitText))));
|
1318
|
+
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))));
|
1377
1319
|
};
|
1378
1320
|
var AppointFormComponent = memo(AppointForm$1);
|
1379
1321
|
|
@@ -8565,7 +8507,7 @@ var ExpandableText$1 = memo(ExpandableText);
|
|
8565
8507
|
* @Author: binruan@chatlabs.com
|
8566
8508
|
* @Date: 2024-03-20 10:27:31
|
8567
8509
|
* @LastEditors: binruan@chatlabs.com
|
8568
|
-
* @LastEditTime: 2024-
|
8510
|
+
* @LastEditTime: 2024-06-19 16:25:46
|
8569
8511
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\FormatImage.tsx
|
8570
8512
|
*
|
8571
8513
|
*/
|
@@ -8615,9 +8557,9 @@ const FormatImage = forwardRef((props, ref) => {
|
|
8615
8557
|
React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
|
8616
8558
|
React.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
|
8617
8559
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
8618
|
-
} }))) : (React.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
|
8560
|
+
}, alt: 'image' }))) : (React.createElement("img", { className: className, src: imgSrc, style: style, loading: loading, onLoad: (e) => {
|
8619
8561
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
|
8620
|
-
} }))));
|
8562
|
+
}, alt: 'image' }))));
|
8621
8563
|
});
|
8622
8564
|
var FormatImage$1 = memo(FormatImage);
|
8623
8565
|
|
@@ -8685,8 +8627,8 @@ const CommodityDetail$1 = (_a) => {
|
|
8685
8627
|
18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info }))));
|
8686
8628
|
};
|
8687
8629
|
const renderBtn = () => {
|
8688
|
-
var _a;
|
8689
|
-
return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle }, (
|
8630
|
+
var _a, _b;
|
8631
|
+
return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle }, (_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website'))));
|
8690
8632
|
};
|
8691
8633
|
const getStyle = useCallback((style) => {
|
8692
8634
|
if (style === null || style === void 0 ? void 0 : style.lineClamp) {
|
@@ -8732,7 +8674,7 @@ const CommodityDetail$1 = (_a) => {
|
|
8732
8674
|
top: 0,
|
8733
8675
|
objectFit: 'cover',
|
8734
8676
|
width: '100%'
|
8735
|
-
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
|
8677
|
+
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: 'pdp image' }))),
|
8736
8678
|
React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
|
8737
8679
|
renderBtn(),
|
8738
8680
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) },
|
@@ -8936,9 +8878,9 @@ const Prompt$1 = (_a) => {
|
|
8936
8878
|
};
|
8937
8879
|
return (React.createElement("div", Object.assign({ className: `pb-prompt ${css(Object.assign({}, style))}` }, props),
|
8938
8880
|
React.createElement("div", { className: 'pb-prompt-icon' },
|
8939
|
-
React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : img$2 })),
|
8881
|
+
React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : img$2, alt: 'success image' })),
|
8940
8882
|
React.createElement("div", { className: 'pb-prompt-content' }, content),
|
8941
|
-
React.createElement("button", { className: 'pb-prompt-btn', style: submitButtonStyle, onClick: handleOk }, btnText)));
|
8883
|
+
React.createElement("button", { "aria-label": btnText, className: 'pb-prompt-btn', style: submitButtonStyle, onClick: handleOk }, btnText)));
|
8942
8884
|
};
|
8943
8885
|
var PromptComponent = memo(Prompt$1);
|
8944
8886
|
|
@@ -9162,7 +9104,7 @@ var settingRender$3 = [
|
|
9162
9104
|
];
|
9163
9105
|
|
9164
9106
|
const CommodityDetailDiroNew$1 = (_a) => {
|
9165
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
9107
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
9166
9108
|
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
|
9167
9109
|
useState(true);
|
9168
9110
|
const { sxpParameter } = useSxpDataSource();
|
@@ -9268,7 +9210,7 @@ Made in Italy` })));
|
|
9268
9210
|
top: 0,
|
9269
9211
|
objectFit: 'cover',
|
9270
9212
|
width: '100%'
|
9271
|
-
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: '' }))),
|
9213
|
+
}), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: 'pdp image' }))),
|
9272
9214
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
9273
9215
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
9274
9216
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
@@ -9277,7 +9219,7 @@ Made in Italy` })));
|
|
9277
9219
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
9278
9220
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) }, priceText),
|
9279
9221
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo) }, (_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费'))),
|
9280
|
-
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (
|
9222
|
+
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_p = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _p !== void 0 ? _p : 'Shop now')),
|
9281
9223
|
productInfoText({ isPost }))),
|
9282
9224
|
React.createElement(Modal$1, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
9283
9225
|
};
|
@@ -9769,7 +9711,7 @@ const Appoint$1 = (_a) => {
|
|
9769
9711
|
const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
|
9770
9712
|
return (React.createElement(EventProvider$1, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props),
|
9771
9713
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
9772
|
-
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), 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, alt: '' })),
|
9714
|
+
React.createElement("img", { className: css({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), 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, alt: 'cta image' })),
|
9773
9715
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', textOverflow: 'ellipsis' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_e = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _e !== void 0 ? _e : 'Product Name')));
|
9774
9716
|
};
|
9775
9717
|
var AppointComponent = memo(Appoint$1);
|
@@ -10687,7 +10629,7 @@ const Navbar = ({ icon, styles, textStyle, onClose }) => {
|
|
10687
10629
|
var _a;
|
10688
10630
|
const { waterFallData, setOpenHashtag } = useSxpDataSource();
|
10689
10631
|
return (React.createElement("div", { className: 'clc-sxp-nav', style: styles },
|
10690
|
-
React.createElement("img", { className: 'clc-sxp-nav-left', src: icon, alt: '', onClick: onClose }),
|
10632
|
+
React.createElement("img", { className: 'clc-sxp-nav-left', src: icon, alt: 'back button', onClick: onClose }),
|
10691
10633
|
React.createElement("div", { className: 'clc-sxp-nav-title', style: textStyle }, `#${(_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag) !== null && _a !== void 0 ? _a : '标题'}`)));
|
10692
10634
|
};
|
10693
10635
|
var Navbar$1 = memo(Navbar);
|
@@ -11979,15 +11921,15 @@ const WaterfallFlowItem$1 = (props) => {
|
|
11979
11921
|
const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
|
11980
11922
|
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
|
11981
11923
|
const [showVideo, setShowVideo] = useState(false);
|
11982
|
-
|
11983
|
-
|
11924
|
+
useState(false);
|
11925
|
+
useState({
|
11984
11926
|
height: 1,
|
11985
11927
|
width: 1
|
11986
11928
|
});
|
11987
11929
|
const imgDom = useRef(null);
|
11988
11930
|
const ref = useRef(null);
|
11989
|
-
|
11990
|
-
|
11931
|
+
useRef(null);
|
11932
|
+
useRef(null);
|
11991
11933
|
const [firstFrameSrc, setFirstFrameSrc] = useState('');
|
11992
11934
|
const src = useMemo(() => {
|
11993
11935
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
@@ -12017,7 +11959,7 @@ const WaterfallFlowItem$1 = (props) => {
|
|
12017
11959
|
return y;
|
12018
11960
|
}, [style]);
|
12019
11961
|
/** 是否加载图片 */
|
12020
|
-
|
11962
|
+
useMemo(() => {
|
12021
11963
|
if (top === undefined) {
|
12022
11964
|
return false;
|
12023
11965
|
}
|
@@ -12043,58 +11985,25 @@ const WaterfallFlowItem$1 = (props) => {
|
|
12043
11985
|
if (imgDom.current === null || src === '') {
|
12044
11986
|
return;
|
12045
11987
|
}
|
12046
|
-
|
11988
|
+
let imgSrc = null;
|
12047
11989
|
if (showVideo && firstFrameSrc) {
|
12048
|
-
|
11990
|
+
imgSrc = firstFrameSrc;
|
12049
11991
|
}
|
12050
11992
|
else {
|
12051
|
-
|
11993
|
+
imgSrc = src;
|
12052
11994
|
}
|
12053
|
-
|
12054
|
-
|
12055
|
-
|
12056
|
-
|
12057
|
-
|
12058
|
-
|
12059
|
-
|
12060
|
-
|
12061
|
-
}, [src, showVideo, firstFrameSrc, isImgShow]);
|
12062
|
-
useEffect(() => {
|
12063
|
-
// 通过宽度比例获取图片高度
|
12064
|
-
const height = imgInfo.height * (unitWidth / imgInfo.width);
|
12065
|
-
if (isLoading) {
|
11995
|
+
if (imgSrc)
|
11996
|
+
imgDom.current.setSrc(imgSrc);
|
11997
|
+
}, [src, showVideo, firstFrameSrc]);
|
11998
|
+
const pictRef = useRef();
|
11999
|
+
const imgLoad = useCallback((img) => {
|
12000
|
+
setTimeout(() => {
|
12001
|
+
var _a;
|
12002
|
+
const height = (_a = pictRef === null || pictRef === void 0 ? void 0 : pictRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight;
|
12066
12003
|
// 加56是因为下方文字部分高度为56,可以自己设置
|
12067
12004
|
sizeChange(height + 56 + space, index);
|
12068
|
-
}
|
12069
|
-
}, [
|
12070
|
-
const calculateHeightForWidth = (videoWidth, videoHeight, targetWidth) => {
|
12071
|
-
const aspectRatio = videoWidth / videoHeight;
|
12072
|
-
const targetHeight = targetWidth / aspectRatio;
|
12073
|
-
return targetHeight;
|
12074
|
-
};
|
12075
|
-
useEffect(() => {
|
12076
|
-
const video = videoDom === null || videoDom === void 0 ? void 0 : videoDom.current;
|
12077
|
-
if (video === null || src === '' || !showVideo) {
|
12078
|
-
return;
|
12079
|
-
}
|
12080
|
-
video.src = src;
|
12081
|
-
video.currentTime = 1;
|
12082
|
-
video.crossOrigin = 'anonymous';
|
12083
|
-
video.onloadeddata = () => {
|
12084
|
-
const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
|
12085
|
-
if (!canvas)
|
12086
|
-
return;
|
12087
|
-
const ctx = canvas.getContext('2d');
|
12088
|
-
const targetWidth = (window === null || window === void 0 ? void 0 : window.innerWidth) / 2;
|
12089
|
-
const targetHeight = calculateHeightForWidth(video.videoWidth, video.videoHeight, targetWidth);
|
12090
|
-
canvas.height = targetHeight;
|
12091
|
-
canvas.width = targetWidth;
|
12092
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
12093
|
-
setFirstFrameSrc(canvas.toDataURL());
|
12094
|
-
video.remove();
|
12095
|
-
canvas.remove();
|
12096
|
-
};
|
12097
|
-
}, [src, showVideo]);
|
12005
|
+
}, 0);
|
12006
|
+
}, [space, sizeChange, index, unitWidth, pictRef]);
|
12098
12007
|
const handleClickToDetail = () => {
|
12099
12008
|
reportTagsView();
|
12100
12009
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(list);
|
@@ -12105,17 +12014,14 @@ const WaterfallFlowItem$1 = (props) => {
|
|
12105
12014
|
}, 0);
|
12106
12015
|
};
|
12107
12016
|
return (React.createElement("div", { ref: ref, style: Object.assign({}, style), className: 'waterFallList-content-listItem', key: index, onClick: handleClickToDetail },
|
12108
|
-
React.createElement("div", { className: 'waterFallList-content-listItem-picture' },
|
12109
|
-
|
12110
|
-
React.createElement("video", { ref: videoDom, src: src, crossOrigin: 'anonymous', className: 'waterFallList-content-listItem-picture-img' }),
|
12111
|
-
React.createElement("canvas", { ref: canvasRef }))),
|
12112
|
-
React.createElement(FormatImage$1, { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', ref: imgDom })),
|
12017
|
+
React.createElement("div", { className: 'waterFallList-content-listItem-picture', ref: pictRef },
|
12018
|
+
React.createElement(FormatImage$1, { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', onLoad: imgLoad, ref: imgDom })),
|
12113
12019
|
React.createElement("div", { className: 'waterFallList-content-listItem-info' },
|
12114
12020
|
React.createElement("div", { className: `${'waterFallList-content-listItem-info-title'} ${priceText ? 'waterFallList-content-listItem-info-nowrap' : ''}`, style: Object.assign({}, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title) }, title && title),
|
12115
12021
|
React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price }, priceText))));
|
12116
12022
|
};
|
12117
12023
|
function WaterfallList$1(_a) {
|
12118
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
12024
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
12119
12025
|
var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
|
12120
12026
|
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
|
12121
12027
|
/** 滚动的父元素 */
|
@@ -12167,7 +12073,6 @@ function WaterfallList$1(_a) {
|
|
12167
12073
|
for (let i = 0; i < (list === null || list === void 0 ? void 0 : list.length); i++) {
|
12168
12074
|
// 原本应对应的行数
|
12169
12075
|
const currentRow = Math.floor(i / rowsNum);
|
12170
|
-
//
|
12171
12076
|
const remainder = (i % rowsNum) + 1;
|
12172
12077
|
// 最低item下标
|
12173
12078
|
let minHeightInd = 0;
|
@@ -12344,7 +12249,7 @@ function WaterfallList$1(_a) {
|
|
12344
12249
|
} }))),
|
12345
12250
|
React.createElement("div", { className: 'waterFallList-bottom', hidden: !((_t = data === null || data === void 0 ? void 0 : data.tag) === null || _t === void 0 ? void 0 : _t.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
|
12346
12251
|
React.createElement("div", { ref: buttonRef, hidden: !((_u = data === null || data === void 0 ? void 0 : data.tag) === null || _u === void 0 ? void 0 : _u.link), className: 'waterFallList-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
|
12347
|
-
React.createElement("button", { className: 'waterFallList-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((
|
12252
|
+
React.createElement("button", { "aria-label": ((_v = data === null || data === void 0 ? void 0 : data.tag) === null || _v === void 0 ? void 0 : _v.linkTitle) || 'Shop the collection', className: 'waterFallList-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_w = data === null || data === void 0 ? void 0 : data.tag) === null || _w === void 0 ? void 0 : _w.linkTitle) || 'Shop the collection'))))));
|
12348
12253
|
}
|
12349
12254
|
|
12350
12255
|
var img$1 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAaZJREFUeF7t2jFKBEEQRuG3mSJeQTARURDMTL2EqXfwAnoKD6FHMDEzNVIw2tzQC2gFggyDrExX1V92T7wz9PumFnqbXdH5teq8nwEwJqBzgfEVKDYAW8Ae8NZq3ZUm4Aa4AnaBR+C8BUIVAIu/ngSfAs9LESoAWLgB/LzWwP7SeLtfHWAu3tZ9Adz/dwD3eOUJCIlXBQiLVwQIjVcDCI9XAkiJVwFIi1cASI3PBpjb3jbd5GyyUcraCUrEZ02ATHwGgFR8NIBcfCSAZHwUgGx8BIB0vDeAfLwnQIl4L4Ay8R4ApeJbA2wD78DOZA/e7ABzk739Xz/T8rfAIfA6WYCd3BqA7NUSwCKfgLNKCK0BjoC7rzP74yoIrQGsuxSCB0ApBC+AMgieACUQvAHkESIApBGiAGQRIgEkEaIB5BAyAKQQsgBkEDIBJBCyAdIRFABSEVQA0hCUAFIQ1ADCERQBQhFUAcIQlAFCENQBfkOwg9eXpeftFQDmEOzv8ifARy8A3wiXwAHwANwujbf7q0xAi9bZZwwAN9oiDx4TUORFuS2z+wn4BAiAaEHnKChjAAAAAElFTkSuQmCC";
|
@@ -12473,7 +12378,7 @@ const WaterfallFlowItem = (props) => {
|
|
12473
12378
|
React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText }, priceText))));
|
12474
12379
|
};
|
12475
12380
|
function WaterfallList(_a) {
|
12476
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
12381
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
12477
12382
|
var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
|
12478
12383
|
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
|
12479
12384
|
const [list, setList] = useState();
|
@@ -12562,20 +12467,20 @@ function WaterfallList(_a) {
|
|
12562
12467
|
} })),
|
12563
12468
|
React.createElement("div", { className: 'list-bottom', hidden: !((_o = data === null || data === void 0 ? void 0 : data.tag) === null || _o === void 0 ? void 0 : _o.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
|
12564
12469
|
React.createElement("div", { hidden: !((_p = data === null || data === void 0 ? void 0 : data.tag) === null || _p === void 0 ? void 0 : _p.link), className: 'list-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
|
12565
|
-
React.createElement("button", { className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((
|
12470
|
+
React.createElement("button", { "aria-label": ((_q = data === null || data === void 0 ? void 0 : data.tag) === null || _q === void 0 ? void 0 : _q.linkTitle) || 'Shop the collection', className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink }, ((_r = data === null || data === void 0 ? void 0 : data.tag) === null || _r === void 0 ? void 0 : _r.linkTitle) || 'Shop the collection'))))));
|
12566
12471
|
}
|
12567
12472
|
|
12568
12473
|
/*
|
12569
12474
|
* @Author: binruan@chatlabs.com
|
12570
12475
|
* @Date: 2024-01-10 10:58:24
|
12571
12476
|
* @LastEditors: binruan@chatlabs.com
|
12572
|
-
* @LastEditTime: 2024-06-12
|
12477
|
+
* @LastEditTime: 2024-06-20 12:45:26
|
12573
12478
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
12574
12479
|
*
|
12575
12480
|
*/
|
12576
12481
|
const WaterFall = (props) => {
|
12577
12482
|
var _a;
|
12578
|
-
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag } = useSxpDataSource();
|
12483
|
+
const { waterFallData, setOpenHashtag, openHashtag, swiperRef, setWaterFallData, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, setCacheRtcList, setIsFromHashtag, isFromHashtag, bffEventReport, themeTag, selectTag } = useSxpDataSource();
|
12579
12484
|
const { backMainFeed } = useEventReport();
|
12580
12485
|
useRef(null);
|
12581
12486
|
const modalEleRef = useRef(null);
|
@@ -12597,9 +12502,7 @@ const WaterFall = (props) => {
|
|
12597
12502
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|
12598
12503
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
|
12599
12504
|
}
|
12600
|
-
|
12601
|
-
backMainFeed('branch', themeTag === null || themeTag === void 0 ? void 0 : themeTag.current, waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag);
|
12602
|
-
}
|
12505
|
+
backMainFeed('branch', selectTag, undefined, waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag);
|
12603
12506
|
reportTagsView();
|
12604
12507
|
setWaterFallData === null || setWaterFallData === void 0 ? void 0 : setWaterFallData(undefined);
|
12605
12508
|
setIsFromHashtag === null || setIsFromHashtag === void 0 ? void 0 : setIsFromHashtag(false);
|
@@ -12803,10 +12706,10 @@ var settingRender = [
|
|
12803
12706
|
}
|
12804
12707
|
];
|
12805
12708
|
|
12806
|
-
const Consent$
|
12807
|
-
return React.createElement(Consent$
|
12709
|
+
const Consent$3 = (props) => {
|
12710
|
+
return React.createElement(Consent$3, Object.assign({}, props));
|
12808
12711
|
};
|
12809
|
-
var ConsentComponent = memo(Consent$
|
12712
|
+
var ConsentComponent = memo(Consent$3);
|
12810
12713
|
|
12811
12714
|
/*
|
12812
12715
|
* @Author: binruan@chatlabs.com
|
@@ -12816,7 +12719,7 @@ var ConsentComponent = memo(Consent$1);
|
|
12816
12719
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\Consent\material.tsx
|
12817
12720
|
*
|
12818
12721
|
*/
|
12819
|
-
const Consent = createMaterial(ConsentComponent, {
|
12722
|
+
const Consent$2 = createMaterial(ConsentComponent, {
|
12820
12723
|
displayName: 'Consent',
|
12821
12724
|
icon: '',
|
12822
12725
|
category: 'base',
|
@@ -12851,7 +12754,7 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
12851
12754
|
CommodityDetailDiroNew: CommodityDetailDiroNew,
|
12852
12755
|
CommodityDiro: CommodityDiro,
|
12853
12756
|
CommodityDiroNew: CommodityDiroNew,
|
12854
|
-
Consent: Consent,
|
12757
|
+
Consent: Consent$2,
|
12855
12758
|
HashTag: HashTag,
|
12856
12759
|
Link: Link,
|
12857
12760
|
MultiCommodity: MultiCommodity,
|
@@ -12911,7 +12814,7 @@ const LikeButton = (_a) => {
|
|
12911
12814
|
}
|
12912
12815
|
}
|
12913
12816
|
}), 200);
|
12914
|
-
return (React.createElement("button", Object.assign({}, props, { onClick: handleClick }),
|
12817
|
+
return (React.createElement("button", Object.assign({}, props, { "aria-label": 'like', onClick: handleClick }),
|
12915
12818
|
React.createElement("img", { style: { width: '100%', height: '100%', objectFit: 'contain' }, src: state ? activeIcon || likeIcon : unActicveIcon || unlikeIcon, alt: 'icon' })));
|
12916
12819
|
};
|
12917
12820
|
var LikeButton$1 = memo(LikeButton);
|
@@ -13170,7 +13073,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
13170
13073
|
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
13171
13074
|
return null;
|
13172
13075
|
}
|
13173
|
-
return (React.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image }));
|
13076
|
+
return (React.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'placeholder image' }));
|
13174
13077
|
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
13175
13078
|
useEffect(() => {
|
13176
13079
|
if (!videoRef)
|
@@ -13203,7 +13106,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
13203
13106
|
} },
|
13204
13107
|
React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
|
13205
13108
|
React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
|
13206
|
-
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
13109
|
+
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', alt: 'pause', src: PAUSE_ICON }))),
|
13207
13110
|
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, style: {
|
13208
13111
|
position: 'relative',
|
13209
13112
|
width: '100%',
|
@@ -13212,7 +13115,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
|
|
13212
13115
|
}, onClick: handleClickVideo() },
|
13213
13116
|
React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
|
13214
13117
|
renderPoster,
|
13215
|
-
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
13118
|
+
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'pause' })))));
|
13216
13119
|
};
|
13217
13120
|
var VideoWidget$3 = memo(VideoWidget$2);
|
13218
13121
|
|
@@ -13232,8 +13135,8 @@ const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style
|
|
13232
13135
|
setIsTure(result);
|
13233
13136
|
onChange === null || onChange === void 0 ? void 0 : onChange(result);
|
13234
13137
|
};
|
13235
|
-
return (React.createElement("button", { style: style, className: 'pb-toggle-button', onClick: handleClick },
|
13236
|
-
React.createElement("img", { className: 'pb-toggle-button-icon', src: isTrue ? activeIcon : unactiveIcon })));
|
13138
|
+
return (React.createElement("button", { style: style, "aria-label": 'toggle button', className: 'pb-toggle-button', onClick: handleClick },
|
13139
|
+
React.createElement("img", { className: 'pb-toggle-button-icon', alt: 'toggle image', src: isTrue ? activeIcon : unactiveIcon })));
|
13237
13140
|
};
|
13238
13141
|
var ToggleButton$1 = memo(ToggleButton);
|
13239
13142
|
|
@@ -13258,7 +13161,7 @@ const FingerSwipeTip = ({ imageUrl, style }) => {
|
|
13258
13161
|
return show ? 'pb-fadeIn' : 'pb-fadeOut';
|
13259
13162
|
}, [show]);
|
13260
13163
|
return (React.createElement("div", { hidden: !show, className: `pb-finger-wrap ${animationCls}`, style: style },
|
13261
|
-
React.createElement("img", { src: imageUrl || FINGER_SWIPE_ICON })));
|
13164
|
+
React.createElement("img", { src: imageUrl || FINGER_SWIPE_ICON, alt: 'finger swiper' })));
|
13262
13165
|
};
|
13263
13166
|
|
13264
13167
|
/*
|
@@ -13520,7 +13423,7 @@ const Nudge = ({ nudge }) => {
|
|
13520
13423
|
backgroundColor: nudge === null || nudge === void 0 ? void 0 : nudge.backgroundColor,
|
13521
13424
|
borderRadius: (_f = nudge === null || nudge === void 0 ? void 0 : nudge.borderRadius) !== null && _f !== void 0 ? _f : 4
|
13522
13425
|
} },
|
13523
|
-
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? React.createElement("img", { src: nudge.icon, style: { height: '100%', objectFit: 'cover', flexShrink: 0 } }) : null,
|
13426
|
+
(nudge === null || nudge === void 0 ? void 0 : nudge.icon) ? (React.createElement("img", { src: nudge.icon, alt: 'nudge icon', style: { height: '100%', objectFit: 'cover', flexShrink: 0 } })) : null,
|
13524
13427
|
React.createElement("p", { style: Object.assign(Object.assign({}, nudge === null || nudge === void 0 ? void 0 : nudge.textStyle), { textWrap: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap', flex: 1, marginBottom: 0 }) }, (_g = nudge === null || nudge === void 0 ? void 0 : nudge.content) !== null && _g !== void 0 ? _g : '')))));
|
13525
13428
|
};
|
13526
13429
|
|
@@ -13528,14 +13431,12 @@ const Nudge = ({ nudge }) => {
|
|
13528
13431
|
* @Author: binruan@chatlabs.com
|
13529
13432
|
* @Date: 2024-04-29 16:32:21
|
13530
13433
|
* @LastEditors: binruan@chatlabs.com
|
13531
|
-
* @LastEditTime: 2024-06-
|
13434
|
+
* @LastEditTime: 2024-06-20 10:53:08
|
13532
13435
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Tagbar.tsx
|
13533
13436
|
*
|
13534
13437
|
*/
|
13535
|
-
const DEFAULT_TAG = 'FOR U';
|
13536
13438
|
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
13537
|
-
const
|
13538
|
-
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData, bffEventReport } = useSxpDataSource();
|
13439
|
+
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData, bffEventReport, selectTag, setSelectTag } = useSxpDataSource();
|
13539
13440
|
const { backMainFeed } = useEventReport();
|
13540
13441
|
const realTagList = useMemo(() => {
|
13541
13442
|
return [DEFAULT_TAG, ...tagList];
|
@@ -13548,12 +13449,12 @@ const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
|
13548
13449
|
eventInfo: {
|
13549
13450
|
eventSubject: 'clickThemeTagsViewContents',
|
13550
13451
|
eventDescription: 'click Theme Tags View Contents',
|
13551
|
-
themeTags: `[${tag}]`
|
13452
|
+
themeTags: `['${tag}']`
|
13552
13453
|
}
|
13553
13454
|
});
|
13554
13455
|
}
|
13555
13456
|
else {
|
13556
|
-
backMainFeed('theme', selectTag);
|
13457
|
+
backMainFeed('theme', tag, selectTag);
|
13557
13458
|
}
|
13558
13459
|
let themeTag;
|
13559
13460
|
if (tag !== DEFAULT_TAG) {
|
@@ -13571,7 +13472,7 @@ const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
|
13571
13472
|
}).finally(() => {
|
13572
13473
|
setLoading === null || setLoading === void 0 ? void 0 : setLoading(false);
|
13573
13474
|
});
|
13574
|
-
setSelectTag(tag);
|
13475
|
+
setSelectTag === null || setSelectTag === void 0 ? void 0 : setSelectTag(tag);
|
13575
13476
|
};
|
13576
13477
|
if (waterFallData || tagList.length <= 0)
|
13577
13478
|
return null;
|
@@ -13582,16 +13483,80 @@ const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
|
13582
13483
|
};
|
13583
13484
|
var Tagbar$1 = memo(Tagbar);
|
13584
13485
|
|
13486
|
+
/*
|
13487
|
+
* @Author: binruan@chatlabs.com
|
13488
|
+
* @Date: 2024-06-13 15:16:53
|
13489
|
+
* @LastEditors: binruan@chatlabs.com
|
13490
|
+
* @LastEditTime: 2024-06-19 14:13:50
|
13491
|
+
* @FilePath: \pb-sxp-ui\src\core\components\Consent\index.tsx
|
13492
|
+
*
|
13493
|
+
*/
|
13494
|
+
const Consent = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
|
13495
|
+
const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
|
13496
|
+
const channelObj = useMemo(() => {
|
13497
|
+
const queryString = location.search.slice(1);
|
13498
|
+
const params = qs.parse(queryString.replace(/\+/g, '%2B'));
|
13499
|
+
for (const key in params) {
|
13500
|
+
params[key] = params[key].replace(/%2B/g, '+');
|
13501
|
+
}
|
13502
|
+
return params;
|
13503
|
+
}, []);
|
13504
|
+
const getUtmValue = (key) => { var _a; return (_a = channelObj[key]) !== null && _a !== void 0 ? _a : null; };
|
13505
|
+
useEffect(() => {
|
13506
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13507
|
+
eventInfo: {
|
13508
|
+
eventSubject: 'privacyEnter',
|
13509
|
+
eventDescription: 'User enter privacy page',
|
13510
|
+
utmSource: getUtmValue('utm_source'),
|
13511
|
+
utmMedium: getUtmValue('utm_medium'),
|
13512
|
+
utmCampaign: getUtmValue('utm_campaign'),
|
13513
|
+
utmId: getUtmValue('utm_id'),
|
13514
|
+
utmContent: getUtmValue('utm_content'),
|
13515
|
+
clSource: getUtmValue('cl_source'),
|
13516
|
+
enterTime: `${Date.now()}`,
|
13517
|
+
enterUrl: window.location.href,
|
13518
|
+
rtc: null,
|
13519
|
+
requestId: null,
|
13520
|
+
sessionID: null
|
13521
|
+
}
|
13522
|
+
});
|
13523
|
+
}, []);
|
13524
|
+
const handleAgree = () => {
|
13525
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13526
|
+
eventInfo: {
|
13527
|
+
eventSubject: 'userConsent',
|
13528
|
+
eventDescription: '用户授权【操作结果】',
|
13529
|
+
consentResult: '0',
|
13530
|
+
consentTags: '["系统运营"]',
|
13531
|
+
rtc: null,
|
13532
|
+
requestId: null,
|
13533
|
+
sessionID: null
|
13534
|
+
}
|
13535
|
+
});
|
13536
|
+
setIsAgreePolicy === null || setIsAgreePolicy === void 0 ? void 0 : setIsAgreePolicy(true);
|
13537
|
+
window.localStorage.setItem(AGREE_POLICY, 'yes');
|
13538
|
+
};
|
13539
|
+
return (React.createElement("div", { className: 'consent-bg' },
|
13540
|
+
React.createElement("div", { className: 'consent' },
|
13541
|
+
React.createElement("div", { className: 'consent-col' },
|
13542
|
+
React.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
|
13543
|
+
React.createElement("div", { className: 'consent-content' }, privacy_context !== null && privacy_context !== void 0 ? privacy_context : 'This site uses cookies to improve your online experience. By continuing to use the site please agree the policy first.')),
|
13544
|
+
React.createElement("div", { className: 'consent-col' },
|
13545
|
+
React.createElement("button", { "aria-label": 'agree', className: 'consent-btn', onClick: handleAgree }, "Agree"),
|
13546
|
+
React.createElement("a", { className: 'consent-policy', target: '_blank', href: privacy_policy_url ? `https://${privacy_policy_url}` : undefined }, privacy_policy_title !== null && privacy_policy_title !== void 0 ? privacy_policy_title : 'More information')))));
|
13547
|
+
};
|
13548
|
+
var Consent$1 = memo(Consent);
|
13549
|
+
|
13585
13550
|
/*
|
13586
13551
|
* @Author: binruan@chatlabs.com
|
13587
13552
|
* @Date: 2024-01-15 19:03:09
|
13588
13553
|
* @LastEditors: binruan@chatlabs.com
|
13589
|
-
* @LastEditTime: 2024-06-
|
13554
|
+
* @LastEditTime: 2024-06-20 10:37:06
|
13590
13555
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
13591
13556
|
*
|
13592
13557
|
*/
|
13593
13558
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
|
13594
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
13559
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
13595
13560
|
const { schema } = useEditor();
|
13596
13561
|
const [activeIndex, setActiveIndex] = useState(0);
|
13597
13562
|
const viewImageStartTime = useRef(0);
|
@@ -13600,7 +13565,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13600
13565
|
const viewTime = useRef();
|
13601
13566
|
const [isLoadMore, setIsLoadMore] = useState(false);
|
13602
13567
|
const [isShowMore, setIsShowMore] = useState(false);
|
13603
|
-
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink } = useSxpDataSource();
|
13568
|
+
const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag } = useSxpDataSource();
|
13604
13569
|
const { backMainFeed } = useEventReport();
|
13605
13570
|
const [videoRef, setVideoRef] = useState(null);
|
13606
13571
|
const playerRef = useRef();
|
@@ -13674,10 +13639,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13674
13639
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
13675
13640
|
const visibleChange = () => {
|
13676
13641
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
13642
|
+
const repCond = !openHashtag && !isShowConsent;
|
13677
13643
|
if (document.visibilityState === 'hidden') {
|
13678
13644
|
// 当用户导航到新页面、切换标签页、关闭标签页、最小化或关闭浏览器、刷新原页面(即离开原页面时),或者在移动设备上从浏览器切换到不同的应用程序时
|
13679
13645
|
// 移动端h5直接杀掉浏览器或宿主app时不会触发,pc端直接杀掉标签页时能触发
|
13680
|
-
if (
|
13646
|
+
if (repCond) {
|
13681
13647
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
|
13682
13648
|
handleReportViewImageEnd(item);
|
13683
13649
|
handleReportProductView(item);
|
@@ -13718,11 +13684,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13718
13684
|
else if (document.visibilityState === 'visible') {
|
13719
13685
|
// 页面可见时触发,注意页面初始化时不会触发
|
13720
13686
|
handleH5EnterLink();
|
13721
|
-
if (
|
13687
|
+
if (repCond) {
|
13722
13688
|
handleViewImageStartEvent(activeIndex);
|
13723
13689
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_SHOW, item);
|
13690
|
+
backMainFeed('external', selectTag);
|
13724
13691
|
}
|
13725
|
-
backMainFeed('external');
|
13726
13692
|
}
|
13727
13693
|
};
|
13728
13694
|
document.addEventListener('visibilitychange', visibleChange);
|
@@ -13739,17 +13705,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13739
13705
|
tempMap,
|
13740
13706
|
curTime,
|
13741
13707
|
backMainFeed,
|
13742
|
-
openHashtag
|
13708
|
+
openHashtag,
|
13709
|
+
isShowConsent,
|
13710
|
+
selectTag
|
13743
13711
|
]);
|
13744
|
-
useEffect(() => {
|
13745
|
-
const initTime = () => {
|
13746
|
-
backMainFeed('external');
|
13747
|
-
};
|
13748
|
-
window.addEventListener('pageshow', initTime);
|
13749
|
-
return () => {
|
13750
|
-
window.removeEventListener('pageshow', initTime);
|
13751
|
-
};
|
13752
|
-
}, []);
|
13753
13712
|
const tagHeight = useMemo(() => {
|
13754
13713
|
let h = 0;
|
13755
13714
|
if (tagList.length > 0) {
|
@@ -13993,62 +13952,46 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13993
13952
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
13994
13953
|
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
13995
13954
|
return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
|
13996
|
-
|
13997
|
-
|
13998
|
-
|
13999
|
-
|
14000
|
-
|
14001
|
-
|
14002
|
-
|
14003
|
-
|
14004
|
-
|
14005
|
-
swiperRef
|
14006
|
-
|
14007
|
-
|
14008
|
-
|
14009
|
-
|
14010
|
-
|
14011
|
-
|
14012
|
-
|
14013
|
-
|
14014
|
-
|
14015
|
-
|
14016
|
-
|
14017
|
-
|
14018
|
-
if (
|
14019
|
-
|
14020
|
-
|
14021
|
-
|
14022
|
-
|
13955
|
+
isShowConsent ? (React.createElement(Consent$1, 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))) : (React.createElement(React.Fragment, null,
|
13956
|
+
waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, onClose: () => {
|
13957
|
+
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
13958
|
+
} })),
|
13959
|
+
renderLogo,
|
13960
|
+
React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
13961
|
+
isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 + ((_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _d !== void 0 ? _d : 0)}%` } })) : null,
|
13962
|
+
React.createElement(Swiper, { style: {
|
13963
|
+
marginTop: tagHeight
|
13964
|
+
}, ref: swiperRef, onSlideChange: () => {
|
13965
|
+
swiperRef.current.swiper.allowTouchMove = false;
|
13966
|
+
setTimeout(() => {
|
13967
|
+
swiperRef.current.swiper.allowTouchMove = true;
|
13968
|
+
}, 500);
|
13969
|
+
}, onActiveIndexChange: (swiper) => {
|
13970
|
+
setActiveIndex(swiper.activeIndex);
|
13971
|
+
if (openHashtag)
|
13972
|
+
return;
|
13973
|
+
// 处理上滑下滑事件
|
13974
|
+
handleScrollEvent(swiper);
|
13975
|
+
if (waterFallData)
|
13976
|
+
return;
|
13977
|
+
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 2 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
13978
|
+
if (!isLoadMore) {
|
13979
|
+
setIsLoadMore(true);
|
13980
|
+
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(Math.ceil(activeIndex / 10) + 1).then(() => {
|
13981
|
+
setIsLoadMore(false);
|
13982
|
+
});
|
13983
|
+
}
|
14023
13984
|
}
|
14024
|
-
}
|
14025
|
-
|
14026
|
-
|
14027
|
-
|
14028
|
-
|
14029
|
-
|
14030
|
-
|
14031
|
-
|
14032
|
-
|
14033
|
-
|
14034
|
-
// setIsLoadMore(true);
|
14035
|
-
// loadVideos?.(Math.ceil(activeIndex / 10) + 1).then(() => {
|
14036
|
-
// setIsLoadMore(false);
|
14037
|
-
// });
|
14038
|
-
// }
|
14039
|
-
// }}
|
14040
|
-
// modules={[Virtual]}
|
14041
|
-
// virtual={{ enabled: true, cache: true }}
|
14042
|
-
direction: 'vertical', height: height },
|
14043
|
-
React.createElement(ToggleButton$1, { style: {
|
14044
|
-
position: 'fixed',
|
14045
|
-
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',
|
14046
|
-
zIndex: 999,
|
14047
|
-
[(_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,
|
14048
|
-
[(_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
|
14049
|
-
}, 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 }),
|
14050
|
-
renderView),
|
14051
|
-
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)),
|
13985
|
+
}, direction: 'vertical', height: height },
|
13986
|
+
React.createElement(ToggleButton$1, { style: {
|
13987
|
+
position: 'fixed',
|
13988
|
+
visibility: ((_f = (_e = data === null || data === void 0 ? void 0 : data[activeIndex]) === null || _e === void 0 ? void 0 : _e.video) === null || _f === void 0 ? void 0 : _f.url) ? 'visible' : 'hidden',
|
13989
|
+
zIndex: 999,
|
13990
|
+
[(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _g !== void 0 ? _g : 'right']: (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _h !== void 0 ? _h : 0,
|
13991
|
+
[(_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _j !== void 0 ? _j : 'bottom']: (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _k !== void 0 ? _k : 23
|
13992
|
+
}, 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 }),
|
13993
|
+
renderView))),
|
13994
|
+
React.createElement(WaterFall$1, Object.assign({}, (_o = (_m = (_l = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _l === void 0 ? void 0 : _l[0]) === null || _m === void 0 ? void 0 : _m.item) === null || _o === void 0 ? void 0 : _o.props)),
|
14052
13995
|
React.createElement("div", { style: { position: 'absolute', zIndex: -100 } },
|
14053
13996
|
React.createElement("video", { ref: playerRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', style: {
|
14054
13997
|
backgroundColor: 'transparent',
|
@@ -14238,7 +14181,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
14238
14181
|
if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
|
14239
14182
|
return null;
|
14240
14183
|
}
|
14241
|
-
return (React.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image }));
|
14184
|
+
return (React.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'video poster' }));
|
14242
14185
|
}, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
|
14243
14186
|
useEffect(() => {
|
14244
14187
|
const handleBeforeUnload = () => {
|
@@ -14287,7 +14230,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
14287
14230
|
height,
|
14288
14231
|
objectFit: 'contain'
|
14289
14232
|
} }),
|
14290
|
-
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|
14233
|
+
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'video pause image' }))),
|
14291
14234
|
renderPoster)) : (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, onClick: handleClickVideo(), style: {
|
14292
14235
|
position: 'relative',
|
14293
14236
|
width,
|
@@ -14296,7 +14239,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
14296
14239
|
} },
|
14297
14240
|
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', style: { width: '100%' }, ref: videoRef, crossOrigin: 'anonymous', muted: true, autoPlay: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
|
14298
14241
|
renderPoster,
|
14299
|
-
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
14242
|
+
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'video pause image' })))));
|
14300
14243
|
};
|
14301
14244
|
var VideoWidget$1 = memo(VideoWidget);
|
14302
14245
|
|