pb-sxp-ui 1.0.83 → 1.0.85
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 +22 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +92 -93
- package/dist/index.js +22 -18
- 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 +22 -18
- 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.d.ts +0 -1
- package/es/core/components/Consent/index.js +0 -1
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.js +21 -17
- package/lib/core/components/Consent/index.d.ts +0 -1
- package/lib/core/components/Consent/index.js +0 -1
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.js +21 -17
- package/package.json +1 -1
package/dist/index.css
CHANGED
@@ -1,96 +1,3 @@
|
|
1
|
-
.consent-bg {
|
2
|
-
position: absolute;
|
3
|
-
left: 0;
|
4
|
-
right: 0;
|
5
|
-
top: 0;
|
6
|
-
bottom: 0;
|
7
|
-
z-index: 999;
|
8
|
-
background-color: rgba(0, 0, 0, 0.3);
|
9
|
-
}
|
10
|
-
.consent {
|
11
|
-
margin: 50% auto;
|
12
|
-
display: -webkit-box;
|
13
|
-
display: -webkit-flex;
|
14
|
-
display: -ms-flexbox;
|
15
|
-
display: flex;
|
16
|
-
-webkit-box-orient: vertical;
|
17
|
-
-webkit-box-direction: normal;
|
18
|
-
-webkit-flex-direction: column;
|
19
|
-
-ms-flex-direction: column;
|
20
|
-
flex-direction: column;
|
21
|
-
-webkit-box-align: center;
|
22
|
-
-webkit-align-items: center;
|
23
|
-
-ms-flex-align: center;
|
24
|
-
align-items: center;
|
25
|
-
-webkit-box-pack: justify;
|
26
|
-
-webkit-justify-content: space-between;
|
27
|
-
-ms-flex-pack: justify;
|
28
|
-
justify-content: space-between;
|
29
|
-
overflow: hidden;
|
30
|
-
background-color: #fff;
|
31
|
-
border-radius: 4px;
|
32
|
-
padding: 10px;
|
33
|
-
width: 60%;
|
34
|
-
border: 1px solid #D1D1D1;
|
35
|
-
}
|
36
|
-
.consent-col {
|
37
|
-
width: 100%;
|
38
|
-
display: -webkit-box;
|
39
|
-
display: -webkit-flex;
|
40
|
-
display: -ms-flexbox;
|
41
|
-
display: flex;
|
42
|
-
-webkit-box-pack: center;
|
43
|
-
-webkit-justify-content: center;
|
44
|
-
-ms-flex-pack: center;
|
45
|
-
justify-content: center;
|
46
|
-
-webkit-box-align: center;
|
47
|
-
-webkit-align-items: center;
|
48
|
-
-ms-flex-align: center;
|
49
|
-
align-items: center;
|
50
|
-
-webkit-box-orient: vertical;
|
51
|
-
-webkit-box-direction: normal;
|
52
|
-
-webkit-flex-direction: column;
|
53
|
-
-ms-flex-direction: column;
|
54
|
-
flex-direction: column;
|
55
|
-
}
|
56
|
-
.consent-title {
|
57
|
-
font-size: 12px;
|
58
|
-
white-space: nowrap;
|
59
|
-
overflow: hidden;
|
60
|
-
text-overflow: ellipsis;
|
61
|
-
text-align: center;
|
62
|
-
color: #3D3D3D;
|
63
|
-
margin-bottom: 5px;
|
64
|
-
}
|
65
|
-
.consent-content {
|
66
|
-
font-size: 10px;
|
67
|
-
line-height: 15px;
|
68
|
-
color: #3E3E3C;
|
69
|
-
margin-bottom: 10px;
|
70
|
-
}
|
71
|
-
.consent-btn {
|
72
|
-
background-color: #000;
|
73
|
-
color: #fff;
|
74
|
-
outline: none;
|
75
|
-
border: none;
|
76
|
-
width: 100%;
|
77
|
-
height: 27px;
|
78
|
-
line-height: 27px;
|
79
|
-
margin-bottom: 6px;
|
80
|
-
cursor: pointer;
|
81
|
-
background: #494949;
|
82
|
-
font-size: 12px;
|
83
|
-
}
|
84
|
-
.consent-policy {
|
85
|
-
color: #000;
|
86
|
-
text-decoration: underline;
|
87
|
-
font-size: 12px;
|
88
|
-
color: #3E3E3C;
|
89
|
-
}
|
90
|
-
.consent-policy:hover {
|
91
|
-
color: #000;
|
92
|
-
}
|
93
|
-
|
94
1
|
@media screen and (max-width: 575px) {
|
95
2
|
:global .ant-form .ant-form-item .ant-form-item-control,
|
96
3
|
:global .ant-form .ant-form-item .ant-form-item-label {
|
@@ -2031,3 +1938,95 @@ button.swiper-pagination-bullet {
|
|
2031
1938
|
-webkit-animation: popIn linear forwards;
|
2032
1939
|
animation: popIn linear forwards;
|
2033
1940
|
}
|
1941
|
+
.consent-bg {
|
1942
|
+
position: absolute;
|
1943
|
+
left: 0;
|
1944
|
+
right: 0;
|
1945
|
+
top: 0;
|
1946
|
+
bottom: 0;
|
1947
|
+
z-index: 999;
|
1948
|
+
background-color: rgba(0, 0, 0, 0.3);
|
1949
|
+
}
|
1950
|
+
.consent {
|
1951
|
+
margin: 50% auto;
|
1952
|
+
display: -webkit-box;
|
1953
|
+
display: -webkit-flex;
|
1954
|
+
display: -ms-flexbox;
|
1955
|
+
display: flex;
|
1956
|
+
-webkit-box-orient: vertical;
|
1957
|
+
-webkit-box-direction: normal;
|
1958
|
+
-webkit-flex-direction: column;
|
1959
|
+
-ms-flex-direction: column;
|
1960
|
+
flex-direction: column;
|
1961
|
+
-webkit-box-align: center;
|
1962
|
+
-webkit-align-items: center;
|
1963
|
+
-ms-flex-align: center;
|
1964
|
+
align-items: center;
|
1965
|
+
-webkit-box-pack: justify;
|
1966
|
+
-webkit-justify-content: space-between;
|
1967
|
+
-ms-flex-pack: justify;
|
1968
|
+
justify-content: space-between;
|
1969
|
+
overflow: hidden;
|
1970
|
+
background-color: #fff;
|
1971
|
+
border-radius: 4px;
|
1972
|
+
padding: 10px;
|
1973
|
+
width: 60%;
|
1974
|
+
border: 1px solid #D1D1D1;
|
1975
|
+
}
|
1976
|
+
.consent-col {
|
1977
|
+
width: 100%;
|
1978
|
+
display: -webkit-box;
|
1979
|
+
display: -webkit-flex;
|
1980
|
+
display: -ms-flexbox;
|
1981
|
+
display: flex;
|
1982
|
+
-webkit-box-pack: center;
|
1983
|
+
-webkit-justify-content: center;
|
1984
|
+
-ms-flex-pack: center;
|
1985
|
+
justify-content: center;
|
1986
|
+
-webkit-box-align: center;
|
1987
|
+
-webkit-align-items: center;
|
1988
|
+
-ms-flex-align: center;
|
1989
|
+
align-items: center;
|
1990
|
+
-webkit-box-orient: vertical;
|
1991
|
+
-webkit-box-direction: normal;
|
1992
|
+
-webkit-flex-direction: column;
|
1993
|
+
-ms-flex-direction: column;
|
1994
|
+
flex-direction: column;
|
1995
|
+
}
|
1996
|
+
.consent-title {
|
1997
|
+
font-size: 12px;
|
1998
|
+
white-space: nowrap;
|
1999
|
+
overflow: hidden;
|
2000
|
+
text-overflow: ellipsis;
|
2001
|
+
text-align: center;
|
2002
|
+
color: #3D3D3D;
|
2003
|
+
margin-bottom: 5px;
|
2004
|
+
}
|
2005
|
+
.consent-content {
|
2006
|
+
font-size: 10px;
|
2007
|
+
line-height: 15px;
|
2008
|
+
color: #3E3E3C;
|
2009
|
+
margin-bottom: 10px;
|
2010
|
+
}
|
2011
|
+
.consent-btn {
|
2012
|
+
background-color: #000;
|
2013
|
+
color: #fff;
|
2014
|
+
outline: none;
|
2015
|
+
border: none;
|
2016
|
+
width: 100%;
|
2017
|
+
height: 27px;
|
2018
|
+
line-height: 27px;
|
2019
|
+
margin-bottom: 6px;
|
2020
|
+
cursor: pointer;
|
2021
|
+
background: #494949;
|
2022
|
+
font-size: 12px;
|
2023
|
+
}
|
2024
|
+
.consent-policy {
|
2025
|
+
color: #000;
|
2026
|
+
text-decoration: underline;
|
2027
|
+
font-size: 12px;
|
2028
|
+
color: #3E3E3C;
|
2029
|
+
}
|
2030
|
+
.consent-policy:hover {
|
2031
|
+
color: #000;
|
2032
|
+
}
|
package/dist/index.js
CHANGED
@@ -419,7 +419,7 @@ var SXP_EVENT_TYPE;
|
|
419
419
|
* @Author: binruan@chatlabs.com
|
420
420
|
* @Date: 2024-06-13 15:16:53
|
421
421
|
* @LastEditors: binruan@chatlabs.com
|
422
|
-
* @LastEditTime: 2024-06-
|
422
|
+
* @LastEditTime: 2024-06-17 14:25:01
|
423
423
|
* @FilePath: \pb-sxp-ui\src\core\components\Consent\index.tsx
|
424
424
|
*
|
425
425
|
*/
|
@@ -488,8 +488,8 @@ var DataSourceType;
|
|
488
488
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
489
489
|
})(DataSourceType || (DataSourceType = {}));
|
490
490
|
const UTM_KEYS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_id', 'utm_content', 'cl_source'];
|
491
|
-
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 }) => {
|
492
|
-
var _a, _b, _c
|
491
|
+
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
493
|
const [rtcList, setRtcList] = useState([]);
|
494
494
|
const [tagList, setTagList] = useState([]);
|
495
495
|
const [loading, setLoading] = useState(false);
|
@@ -507,6 +507,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
507
507
|
const [videoRef, setVideoRef] = useState(null);
|
508
508
|
const themeTag = useRef();
|
509
509
|
const curTime = useRef();
|
510
|
+
const isShowConsent = useMemo(() => {
|
511
|
+
var _a, _b, _c, _d;
|
512
|
+
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;
|
513
|
+
}, [isAgreePolicy, globalConfig, isOpenConsent, isEditor]);
|
510
514
|
useEffect(() => {
|
511
515
|
const handleChangeThemeTag = (tag) => {
|
512
516
|
themeTag.current = tag;
|
@@ -551,10 +555,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
551
555
|
}, [bffDataSource]);
|
552
556
|
// 获取推荐视频数据
|
553
557
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
554
|
-
var
|
558
|
+
var _d, _e, _f, _g, _h;
|
555
559
|
query = {
|
556
|
-
maxSize: (
|
557
|
-
defaultSize: (
|
560
|
+
maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize,
|
561
|
+
defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize,
|
558
562
|
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
559
563
|
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
560
564
|
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
@@ -562,10 +566,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
562
566
|
themeTag: query === null || query === void 0 ? void 0 : query.themeTag
|
563
567
|
};
|
564
568
|
if (utmVal) {
|
565
|
-
const val = (
|
569
|
+
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
566
570
|
const key = val.split('=')[0];
|
567
571
|
return UTM_KEYS.includes(key);
|
568
|
-
})) === null ||
|
572
|
+
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
569
573
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
570
574
|
}
|
571
575
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
@@ -577,7 +581,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
577
581
|
return result === null || result === void 0 ? void 0 : result.data;
|
578
582
|
}), [bffFetch, utmVal, maxSize, defaultSize]);
|
579
583
|
const loadVideos = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
580
|
-
var
|
584
|
+
var _j, _k;
|
581
585
|
if (rtcList.length <= 0) {
|
582
586
|
return;
|
583
587
|
}
|
@@ -587,8 +591,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
587
591
|
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
588
592
|
themeTag: themeTag.current
|
589
593
|
});
|
590
|
-
setRtcList(rtcList.concat((
|
591
|
-
setCacheRtcList(cacheRtcList.concat((
|
594
|
+
setRtcList(rtcList.concat((_j = data === null || data === void 0 ? void 0 : data.recList) !== null && _j !== void 0 ? _j : []));
|
595
|
+
setCacheRtcList(cacheRtcList.concat((_k = data === null || data === void 0 ? void 0 : data.recList) !== null && _k !== void 0 ? _k : []));
|
592
596
|
}), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
|
593
597
|
const bffEventReport = useCallback(({ userInfo, eventInfo }) => {
|
594
598
|
// 关闭 BFF 事件上报
|
@@ -652,16 +656,16 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
652
656
|
}), [bffFetch]);
|
653
657
|
// 获取 Tag
|
654
658
|
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
655
|
-
var
|
659
|
+
var _l, _m, _o, _p, _q;
|
656
660
|
if (!utmVal || !isShowTag)
|
657
661
|
return;
|
658
662
|
try {
|
659
|
-
const val = (
|
663
|
+
const val = (_o = (_m = (_l = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _l === void 0 ? void 0 : _l.filter((val) => {
|
660
664
|
const key = val.split('=')[0];
|
661
665
|
return UTM_KEYS.includes(key);
|
662
|
-
})) === null ||
|
666
|
+
})) === null || _m === void 0 ? void 0 : _m.join('&')) !== null && _o !== void 0 ? _o : '';
|
663
667
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
664
|
-
setTagList((
|
668
|
+
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 : []);
|
665
669
|
}
|
666
670
|
catch (e) {
|
667
671
|
console.log('e', e);
|
@@ -715,7 +719,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
715
719
|
h5EnterLink();
|
716
720
|
}, []);
|
717
721
|
useEffect(() => {
|
718
|
-
if (
|
722
|
+
if (isShowConsent)
|
719
723
|
return;
|
720
724
|
setLoading(true);
|
721
725
|
bffGetTagList();
|
@@ -735,7 +739,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
735
739
|
setLoading(false);
|
736
740
|
isInit.current = true;
|
737
741
|
});
|
738
|
-
}, [
|
742
|
+
}, [isShowConsent]);
|
739
743
|
useEffect(() => {
|
740
744
|
if (!isInit.current)
|
741
745
|
return;
|
@@ -793,7 +797,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
793
797
|
curTime,
|
794
798
|
h5EnterLink,
|
795
799
|
themeTag
|
796
|
-
} },
|
800
|
+
} }, 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({
|
797
801
|
rtcList,
|
798
802
|
mutateLike: bffMutateLike,
|
799
803
|
mutateUnlike: bffMutateUnlike,
|