pb-sxp-ui 1.0.87 → 1.0.88
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 +148 -144
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +149 -145
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +148 -144
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/index.js +58 -56
- package/es/core/context/SxpDataSourceProvider.js +19 -16
- package/lib/core/components/SxpPageRender/index.js +58 -56
- package/lib/core/context/SxpDataSourceProvider.js +19 -16
- 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, memo, useEffect, createContext, useState, useRef, useCallback, forwardRef, useImperativeHandle, useLayoutEffect } from 'react';
|
5
5
|
import qs from 'qs';
|
6
6
|
import EventEmitter from 'eventemitter3';
|
7
7
|
import { css } from '@emotion/css';
|
@@ -415,6 +415,70 @@ var SXP_EVENT_TYPE;
|
|
415
415
|
SXP_EVENT_TYPE["CHANGE_THEME_TAG"] = "changeThemeTag";
|
416
416
|
})(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
|
417
417
|
|
418
|
+
/*
|
419
|
+
* @Author: binruan@chatlabs.com
|
420
|
+
* @Date: 2024-06-13 15:16:53
|
421
|
+
* @LastEditors: binruan@chatlabs.com
|
422
|
+
* @LastEditTime: 2024-06-19 14:13:50
|
423
|
+
* @FilePath: \pb-sxp-ui\src\core\components\Consent\index.tsx
|
424
|
+
*
|
425
|
+
*/
|
426
|
+
const Consent$2 = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
|
427
|
+
const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
|
428
|
+
const channelObj = useMemo(() => {
|
429
|
+
const queryString = location.search.slice(1);
|
430
|
+
const params = qs.parse(queryString.replace(/\+/g, '%2B'));
|
431
|
+
for (const key in params) {
|
432
|
+
params[key] = params[key].replace(/%2B/g, '+');
|
433
|
+
}
|
434
|
+
return params;
|
435
|
+
}, []);
|
436
|
+
const getUtmValue = (key) => { var _a; return (_a = channelObj[key]) !== null && _a !== void 0 ? _a : null; };
|
437
|
+
useEffect(() => {
|
438
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
439
|
+
eventInfo: {
|
440
|
+
eventSubject: 'privacyEnter',
|
441
|
+
eventDescription: 'User enter privacy page',
|
442
|
+
utmSource: getUtmValue('utm_source'),
|
443
|
+
utmMedium: getUtmValue('utm_medium'),
|
444
|
+
utmCampaign: getUtmValue('utm_campaign'),
|
445
|
+
utmId: getUtmValue('utm_id'),
|
446
|
+
utmContent: getUtmValue('utm_content'),
|
447
|
+
clSource: getUtmValue('cl_source'),
|
448
|
+
enterTime: `${Date.now()}`,
|
449
|
+
enterUrl: window.location.href,
|
450
|
+
rtc: null,
|
451
|
+
requestId: null,
|
452
|
+
sessionID: null
|
453
|
+
}
|
454
|
+
});
|
455
|
+
}, []);
|
456
|
+
const handleAgree = () => {
|
457
|
+
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
458
|
+
eventInfo: {
|
459
|
+
eventSubject: 'userConsent',
|
460
|
+
eventDescription: '用户授权【操作结果】',
|
461
|
+
consentResult: '0',
|
462
|
+
consentTags: '["系统运营"]',
|
463
|
+
rtc: null,
|
464
|
+
requestId: null,
|
465
|
+
sessionID: null
|
466
|
+
}
|
467
|
+
});
|
468
|
+
setIsAgreePolicy === null || setIsAgreePolicy === void 0 ? void 0 : setIsAgreePolicy(true);
|
469
|
+
window.localStorage.setItem(AGREE_POLICY, 'yes');
|
470
|
+
};
|
471
|
+
return (React.createElement("div", { className: 'consent-bg' },
|
472
|
+
React.createElement("div", { className: 'consent' },
|
473
|
+
React.createElement("div", { className: 'consent-col' },
|
474
|
+
React.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
|
475
|
+
React.createElement("div", { className: 'consent-content' }, privacy_context !== null && privacy_context !== void 0 ? privacy_context : 'This site uses cookies to improve your online experience. By continuing to use the site please agree the policy first.')),
|
476
|
+
React.createElement("div", { className: 'consent-col' },
|
477
|
+
React.createElement("button", { "aria-label": 'agree', className: 'consent-btn', onClick: handleAgree }, "Agree"),
|
478
|
+
React.createElement("a", { className: 'consent-policy', target: '_blank', href: privacy_policy_url ? `https://${privacy_policy_url}` : undefined }, privacy_policy_title !== null && privacy_policy_title !== void 0 ? privacy_policy_title : 'More information')))));
|
479
|
+
};
|
480
|
+
var Consent$3 = memo(Consent$2);
|
481
|
+
|
418
482
|
const SxpDataSourceContext = createContext({
|
419
483
|
rtcList: [],
|
420
484
|
tagList: []
|
@@ -426,6 +490,7 @@ var DataSourceType;
|
|
426
490
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
427
491
|
const DEFAULT_TAG = 'FOR U';
|
428
492
|
const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false }) => {
|
493
|
+
var _a, _b, _c;
|
429
494
|
const [rtcList, setRtcList] = useState([]);
|
430
495
|
const [tagList, setTagList] = useState([]);
|
431
496
|
const [loading, setLoading] = useState(false);
|
@@ -492,10 +557,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
492
557
|
}, [bffDataSource]);
|
493
558
|
// 获取推荐视频数据
|
494
559
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
495
|
-
var
|
560
|
+
var _d, _e, _f, _g, _h;
|
496
561
|
query = {
|
497
|
-
maxSize: (
|
498
|
-
defaultSize: (
|
562
|
+
maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
|
563
|
+
defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
|
499
564
|
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
500
565
|
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
501
566
|
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
@@ -503,10 +568,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
503
568
|
themeTag: query === null || query === void 0 ? void 0 : query.themeTag
|
504
569
|
};
|
505
570
|
if (utmVal) {
|
506
|
-
const val = (
|
571
|
+
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
507
572
|
const key = val.split('=')[0];
|
508
573
|
return UTM_KEYS.includes(key);
|
509
|
-
})) === null ||
|
574
|
+
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
510
575
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
511
576
|
}
|
512
577
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
@@ -518,7 +583,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
518
583
|
return result === null || result === void 0 ? void 0 : result.data;
|
519
584
|
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
520
585
|
const loadVideos = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
521
|
-
var
|
586
|
+
var _j, _k;
|
522
587
|
if (rtcList.length <= 0) {
|
523
588
|
return;
|
524
589
|
}
|
@@ -528,8 +593,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
528
593
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
529
594
|
themeTag: themeTag.current
|
530
595
|
});
|
531
|
-
setRtcList(rtcList.concat((
|
532
|
-
setCacheRtcList(cacheRtcList.concat((
|
596
|
+
setRtcList(rtcList.concat((_j = data === null || data === void 0 ? void 0 : data.recList) !== null && _j !== void 0 ? _j : []));
|
597
|
+
setCacheRtcList(cacheRtcList.concat((_k = data === null || data === void 0 ? void 0 : data.recList) !== null && _k !== void 0 ? _k : []));
|
533
598
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
534
599
|
const bffEventReport = useCallback(({ userInfo, eventInfo }) => {
|
535
600
|
// 关闭 BFF 事件上报
|
@@ -593,16 +658,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
593
658
|
}), [bffFetch]);
|
594
659
|
// 获取 Tag
|
595
660
|
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
596
|
-
var
|
661
|
+
var _l, _m, _o, _p, _q;
|
597
662
|
if (!utmVal || !isShowTag)
|
598
663
|
return;
|
599
664
|
try {
|
600
|
-
const val = (
|
665
|
+
const val = (_o = (_m = (_l = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _l === void 0 ? void 0 : _l.filter((val) => {
|
601
666
|
const key = val.split('=')[0];
|
602
667
|
return UTM_KEYS.includes(key);
|
603
|
-
})) === null ||
|
668
|
+
})) === null || _m === void 0 ? void 0 : _m.join('&')) !== null && _o !== void 0 ? _o : '';
|
604
669
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
605
|
-
setTagList((
|
670
|
+
setTagList((_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []);
|
606
671
|
}
|
607
672
|
catch (e) {
|
608
673
|
console.log('e', e);
|
@@ -653,8 +718,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
653
718
|
});
|
654
719
|
}, [bffEventReport]);
|
655
720
|
useEffect(() => {
|
656
|
-
|
657
|
-
|
721
|
+
if (!isShowConsent)
|
722
|
+
h5EnterLink();
|
723
|
+
}, [isShowConsent]);
|
658
724
|
useEffect(() => {
|
659
725
|
if (isShowConsent)
|
660
726
|
return;
|
@@ -737,13 +803,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
737
803
|
isShowConsent,
|
738
804
|
selectTag,
|
739
805
|
setSelectTag
|
740
|
-
} }, render({
|
806
|
+
} }, isShowConsent ? (React.createElement(Consent$3, Object.assign({}, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props))) : (render({
|
741
807
|
rtcList,
|
742
808
|
mutateLike: bffMutateLike,
|
743
809
|
mutateUnlike: bffMutateUnlike,
|
744
810
|
submitForm: bffSubmitForm,
|
745
811
|
tagList
|
746
|
-
})));
|
812
|
+
}))));
|
747
813
|
};
|
748
814
|
var SxpDataSourceProvider$1 = memo(SxpDataSourceProvider);
|
749
815
|
|
@@ -12706,10 +12772,10 @@ var settingRender = [
|
|
12706
12772
|
}
|
12707
12773
|
];
|
12708
12774
|
|
12709
|
-
const Consent$
|
12710
|
-
return React.createElement(Consent$
|
12775
|
+
const Consent$1 = (props) => {
|
12776
|
+
return React.createElement(Consent$1, Object.assign({}, props));
|
12711
12777
|
};
|
12712
|
-
var ConsentComponent = memo(Consent$
|
12778
|
+
var ConsentComponent = memo(Consent$1);
|
12713
12779
|
|
12714
12780
|
/*
|
12715
12781
|
* @Author: binruan@chatlabs.com
|
@@ -12719,7 +12785,7 @@ var ConsentComponent = memo(Consent$3);
|
|
12719
12785
|
* @FilePath: \pb-sxp-ui\src\materials\sxp\Consent\material.tsx
|
12720
12786
|
*
|
12721
12787
|
*/
|
12722
|
-
const Consent
|
12788
|
+
const Consent = createMaterial(ConsentComponent, {
|
12723
12789
|
displayName: 'Consent',
|
12724
12790
|
icon: '',
|
12725
12791
|
category: 'base',
|
@@ -12754,7 +12820,7 @@ var _materials_ = /*#__PURE__*/Object.freeze({
|
|
12754
12820
|
CommodityDetailDiroNew: CommodityDetailDiroNew,
|
12755
12821
|
CommodityDiro: CommodityDiro,
|
12756
12822
|
CommodityDiroNew: CommodityDiroNew,
|
12757
|
-
Consent: Consent
|
12823
|
+
Consent: Consent,
|
12758
12824
|
HashTag: HashTag,
|
12759
12825
|
Link: Link,
|
12760
12826
|
MultiCommodity: MultiCommodity,
|
@@ -13483,84 +13549,20 @@ const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
|
13483
13549
|
};
|
13484
13550
|
var Tagbar$1 = memo(Tagbar);
|
13485
13551
|
|
13486
|
-
/*
|
13487
|
-
* @Author: binruan@chatlabs.com
|
13488
|
-
* @Date: 2024-06-13 15:16:53
|
13489
|
-
* @LastEditors: binruan@chatlabs.com
|
13490
|
-
* @LastEditTime: 2024-06-19 14:13:50
|
13491
|
-
* @FilePath: \pb-sxp-ui\src\core\components\Consent\index.tsx
|
13492
|
-
*
|
13493
|
-
*/
|
13494
|
-
const Consent = ({ width = window.innerWidth, height = window.innerHeight, privacy_title, privacy_context, privacy_policy_url, privacy_policy_title }) => {
|
13495
|
-
const { setIsAgreePolicy, bffEventReport } = useSxpDataSource();
|
13496
|
-
const channelObj = useMemo(() => {
|
13497
|
-
const queryString = location.search.slice(1);
|
13498
|
-
const params = qs.parse(queryString.replace(/\+/g, '%2B'));
|
13499
|
-
for (const key in params) {
|
13500
|
-
params[key] = params[key].replace(/%2B/g, '+');
|
13501
|
-
}
|
13502
|
-
return params;
|
13503
|
-
}, []);
|
13504
|
-
const getUtmValue = (key) => { var _a; return (_a = channelObj[key]) !== null && _a !== void 0 ? _a : null; };
|
13505
|
-
useEffect(() => {
|
13506
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13507
|
-
eventInfo: {
|
13508
|
-
eventSubject: 'privacyEnter',
|
13509
|
-
eventDescription: 'User enter privacy page',
|
13510
|
-
utmSource: getUtmValue('utm_source'),
|
13511
|
-
utmMedium: getUtmValue('utm_medium'),
|
13512
|
-
utmCampaign: getUtmValue('utm_campaign'),
|
13513
|
-
utmId: getUtmValue('utm_id'),
|
13514
|
-
utmContent: getUtmValue('utm_content'),
|
13515
|
-
clSource: getUtmValue('cl_source'),
|
13516
|
-
enterTime: `${Date.now()}`,
|
13517
|
-
enterUrl: window.location.href,
|
13518
|
-
rtc: null,
|
13519
|
-
requestId: null,
|
13520
|
-
sessionID: null
|
13521
|
-
}
|
13522
|
-
});
|
13523
|
-
}, []);
|
13524
|
-
const handleAgree = () => {
|
13525
|
-
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
13526
|
-
eventInfo: {
|
13527
|
-
eventSubject: 'userConsent',
|
13528
|
-
eventDescription: '用户授权【操作结果】',
|
13529
|
-
consentResult: '0',
|
13530
|
-
consentTags: '["系统运营"]',
|
13531
|
-
rtc: null,
|
13532
|
-
requestId: null,
|
13533
|
-
sessionID: null
|
13534
|
-
}
|
13535
|
-
});
|
13536
|
-
setIsAgreePolicy === null || setIsAgreePolicy === void 0 ? void 0 : setIsAgreePolicy(true);
|
13537
|
-
window.localStorage.setItem(AGREE_POLICY, 'yes');
|
13538
|
-
};
|
13539
|
-
return (React.createElement("div", { className: 'consent-bg' },
|
13540
|
-
React.createElement("div", { className: 'consent' },
|
13541
|
-
React.createElement("div", { className: 'consent-col' },
|
13542
|
-
React.createElement("div", { className: 'consent-title' }, privacy_title !== null && privacy_title !== void 0 ? privacy_title : 'Privacy Policy'),
|
13543
|
-
React.createElement("div", { className: 'consent-content' }, privacy_context !== null && privacy_context !== void 0 ? privacy_context : 'This site uses cookies to improve your online experience. By continuing to use the site please agree the policy first.')),
|
13544
|
-
React.createElement("div", { className: 'consent-col' },
|
13545
|
-
React.createElement("button", { "aria-label": 'agree', className: 'consent-btn', onClick: handleAgree }, "Agree"),
|
13546
|
-
React.createElement("a", { className: 'consent-policy', target: '_blank', href: privacy_policy_url ? `https://${privacy_policy_url}` : undefined }, privacy_policy_title !== null && privacy_policy_title !== void 0 ? privacy_policy_title : 'More information')))));
|
13547
|
-
};
|
13548
|
-
var Consent$1 = memo(Consent);
|
13549
|
-
|
13550
13552
|
/*
|
13551
13553
|
* @Author: binruan@chatlabs.com
|
13552
13554
|
* @Date: 2024-01-15 19:03:09
|
13553
13555
|
* @LastEditors: binruan@chatlabs.com
|
13554
|
-
* @LastEditTime: 2024-06-20
|
13556
|
+
* @LastEditTime: 2024-06-20 15:54:53
|
13555
13557
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
13556
13558
|
*
|
13557
13559
|
*/
|
13558
13560
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, tagList = [], licenseUrl }) => {
|
13559
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
13561
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
13560
13562
|
const { schema } = useEditor();
|
13561
13563
|
const [activeIndex, setActiveIndex] = useState(0);
|
13562
13564
|
const viewImageStartTime = useRef(0);
|
13563
|
-
|
13565
|
+
useState(false);
|
13564
13566
|
const [isMuted, setIsMuted] = useState(true);
|
13565
13567
|
const viewTime = useRef();
|
13566
13568
|
const [isLoadMore, setIsLoadMore] = useState(false);
|
@@ -13573,21 +13575,29 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13573
13575
|
const isShowFingerTip = useMemo(() => {
|
13574
13576
|
return data.length > 0 && !loading && getFeUserId();
|
13575
13577
|
}, [data, loading]);
|
13576
|
-
|
13577
|
-
|
13578
|
-
|
13578
|
+
useEffect(() => {
|
13579
|
+
refreshFeSessionId();
|
13580
|
+
}, []);
|
13581
|
+
useEffect(() => {
|
13582
|
+
if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
|
13583
|
+
const now = new Date();
|
13584
|
+
viewTime.current = now;
|
13585
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
13586
|
+
eventName: 'PageView'
|
13587
|
+
});
|
13579
13588
|
}
|
13589
|
+
}, [data === null || data === void 0 ? void 0 : data.length]);
|
13590
|
+
const handleH5EnterLink = useCallback(() => {
|
13580
13591
|
refreshFeSessionId();
|
13581
|
-
|
13582
|
-
|
13583
|
-
|
13584
|
-
|
13592
|
+
h5EnterLink === null || h5EnterLink === void 0 ? void 0 : h5EnterLink();
|
13593
|
+
if (data.length > 0) {
|
13594
|
+
const now = new Date();
|
13595
|
+
viewTime.current = now;
|
13596
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
13597
|
+
eventName: 'PageView'
|
13598
|
+
});
|
13585
13599
|
}
|
13586
|
-
|
13587
|
-
eventName: 'PageView'
|
13588
|
-
});
|
13589
|
-
setIsInit(true);
|
13590
|
-
}, [data.length, bffFbReport, h5EnterLink, isInit]);
|
13600
|
+
}, [data.length, bffFbReport, h5EnterLink]);
|
13591
13601
|
const firstRef = useRef();
|
13592
13602
|
useEffect(() => {
|
13593
13603
|
var _a, _b, _c, _d;
|
@@ -13615,10 +13625,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13615
13625
|
});
|
13616
13626
|
}
|
13617
13627
|
}, [videoRef, licenseUrl, data]);
|
13618
|
-
useEffect(() => {
|
13619
|
-
if (!isInit)
|
13620
|
-
handleH5EnterLink();
|
13621
|
-
}, [handleH5EnterLink, isInit]);
|
13622
13628
|
useEffect(() => {
|
13623
13629
|
var _a;
|
13624
13630
|
const index = (data === null || data === void 0 ? void 0 : data.findIndex((item) => {
|
@@ -13952,46 +13958,45 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
13952
13958
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
13953
13959
|
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
13954
13960
|
return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
|
13955
|
-
|
13956
|
-
|
13957
|
-
|
13958
|
-
|
13959
|
-
|
13960
|
-
|
13961
|
-
|
13962
|
-
|
13963
|
-
|
13964
|
-
|
13965
|
-
|
13966
|
-
|
13967
|
-
|
13968
|
-
|
13969
|
-
|
13970
|
-
|
13971
|
-
|
13972
|
-
|
13973
|
-
|
13974
|
-
|
13975
|
-
|
13976
|
-
|
13977
|
-
if (
|
13978
|
-
|
13979
|
-
|
13980
|
-
|
13981
|
-
|
13982
|
-
});
|
13983
|
-
}
|
13961
|
+
waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff' }, onClose: () => {
|
13962
|
+
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
13963
|
+
} })),
|
13964
|
+
renderLogo,
|
13965
|
+
React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
13966
|
+
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,
|
13967
|
+
React.createElement(Swiper, { style: {
|
13968
|
+
marginTop: tagHeight
|
13969
|
+
}, ref: swiperRef, onSlideChange: () => {
|
13970
|
+
swiperRef.current.swiper.allowTouchMove = false;
|
13971
|
+
setTimeout(() => {
|
13972
|
+
swiperRef.current.swiper.allowTouchMove = true;
|
13973
|
+
}, 500);
|
13974
|
+
}, onActiveIndexChange: (swiper) => {
|
13975
|
+
setActiveIndex(swiper.activeIndex);
|
13976
|
+
if (openHashtag)
|
13977
|
+
return;
|
13978
|
+
// 处理上滑下滑事件
|
13979
|
+
handleScrollEvent(swiper);
|
13980
|
+
if (waterFallData)
|
13981
|
+
return;
|
13982
|
+
if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 2 >= (data === null || data === void 0 ? void 0 : data.length)) {
|
13983
|
+
if (!isLoadMore) {
|
13984
|
+
setIsLoadMore(true);
|
13985
|
+
loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(Math.ceil(activeIndex / 10) + 1).then(() => {
|
13986
|
+
setIsLoadMore(false);
|
13987
|
+
});
|
13984
13988
|
}
|
13985
|
-
}
|
13986
|
-
|
13987
|
-
|
13988
|
-
|
13989
|
-
|
13990
|
-
|
13991
|
-
|
13992
|
-
|
13993
|
-
|
13994
|
-
|
13989
|
+
}
|
13990
|
+
}, direction: 'vertical', height: height },
|
13991
|
+
React.createElement(ToggleButton$1, { style: {
|
13992
|
+
position: 'fixed',
|
13993
|
+
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',
|
13994
|
+
zIndex: 999,
|
13995
|
+
[(_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,
|
13996
|
+
[(_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
|
13997
|
+
}, 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 }),
|
13998
|
+
renderView),
|
13999
|
+
React.createElement(WaterFall$1, Object.assign({}, (_k = (_j = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.item) === null || _k === void 0 ? void 0 : _k.props)),
|
13995
14000
|
React.createElement("div", { style: { position: 'absolute', zIndex: -100 } },
|
13996
14001
|
React.createElement("video", { ref: playerRef, id: 'player-container-id', playsInline: true, crossOrigin: 'anonymous', style: {
|
13997
14002
|
backgroundColor: 'transparent',
|
@@ -14516,4 +14521,3 @@ function useEditorDataProvider() {
|
|
14516
14521
|
*/
|
14517
14522
|
|
14518
14523
|
export { index$1 as DiyPortalPreview, EditorDataProvider, Modal$1 as Modal, SxpDataSourceProvider$1 as SxpDataSourceProvider, index as SxpPageCore, SxpPageRender, index$2 as core, Pagebuilder as default, defaultSetting, _materials_ as materials, useEditorDataProvider };
|
14519
|
-
//# sourceMappingURL=index.js.map
|