pb-sxp-ui 1.0.61 → 1.0.62
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 +32 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -16
- 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 +35 -19
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/Tagbar.js +4 -2
- package/es/core/components/SxpPageRender/index.js +4 -1
- package/es/core/context/SxpDataSourceProvider.js +15 -2
- package/es/core/utils/event.d.ts +2 -1
- package/es/core/utils/event.js +1 -0
- package/es/materials/sxp/template/components/EventProvider.js +2 -3
- package/lib/core/components/SxpPageRender/Tagbar.js +4 -2
- package/lib/core/components/SxpPageRender/index.js +4 -1
- package/lib/core/context/SxpDataSourceProvider.js +15 -2
- package/lib/core/utils/event.d.ts +2 -1
- package/lib/core/utils/event.js +1 -0
- package/lib/materials/sxp/template/components/EventProvider.js +2 -3
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('uuid'), require('pako'), require('react'), require('qs'), require('@emotion/css'), require('@ant-design/pro-components'), require('react-dom'), require('
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', '@emotion/css', '@ant-design/pro-components', 'react-dom', '
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PUI = {}, global.lodash, global.uuid$1, global.pako, global.React, global.qs, global.
|
5
|
-
})(this, (function (exports, lodash, uuid$1, pako, React, qs, css, proComponents, ReactDOM,
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('uuid'), require('pako'), require('react'), require('qs'), require('eventemitter3'), require('@emotion/css'), require('@ant-design/pro-components'), require('react-dom'), require('hls.js')) :
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'lodash', 'uuid', 'pako', 'react', 'qs', 'eventemitter3', '@emotion/css', '@ant-design/pro-components', 'react-dom', 'hls.js'], factory) :
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.PUI = {}, global.lodash, global.uuid$1, global.pako, global.React, global.qs, global.EventEmitter, global.css, global.proComponents, global.ReactDOM, global.Hls));
|
5
|
+
})(this, (function (exports, lodash, uuid$1, pako, React, qs, EventEmitter, css, proComponents, ReactDOM, Hls) { 'use strict';
|
6
6
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
8
8
|
var n = Object.create(null);
|
@@ -421,6 +421,14 @@
|
|
421
421
|
}, [appDomain, path, domain]);
|
422
422
|
}
|
423
423
|
|
424
|
+
const SXP_EVENT_BUS = new EventEmitter();
|
425
|
+
var SXP_EVENT_TYPE;
|
426
|
+
(function (SXP_EVENT_TYPE) {
|
427
|
+
SXP_EVENT_TYPE["PAGE_DID_SHOW"] = "pageDidShow";
|
428
|
+
SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
|
429
|
+
SXP_EVENT_TYPE["CHANGE_THEME_TAG"] = "changeThemeTag";
|
430
|
+
})(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
|
431
|
+
|
424
432
|
const SxpDataSourceContext = React.createContext({
|
425
433
|
rtcList: [],
|
426
434
|
tagList: []
|
@@ -445,6 +453,16 @@
|
|
445
453
|
const [cacheActiveIndex, setCacheActiveIndex] = React.useState(0);
|
446
454
|
const [isFromHashtag, setIsFromHashtag] = React.useState(false);
|
447
455
|
const [videoRef, setVideoRef] = React.useState(null);
|
456
|
+
const themeTag = React.useRef();
|
457
|
+
React.useEffect(() => {
|
458
|
+
const handleChangeThemeTag = (tag) => {
|
459
|
+
themeTag.current = tag;
|
460
|
+
};
|
461
|
+
SXP_EVENT_BUS.on(SXP_EVENT_TYPE.CHANGE_THEME_TAG, handleChangeThemeTag);
|
462
|
+
return () => {
|
463
|
+
SXP_EVENT_BUS.off(SXP_EVENT_TYPE.CHANGE_THEME_TAG, handleChangeThemeTag);
|
464
|
+
};
|
465
|
+
}, []);
|
448
466
|
React.useEffect(() => {
|
449
467
|
setOpenHashtag(isOpenHashTag);
|
450
468
|
}, [isOpenHashTag]);
|
@@ -487,7 +505,8 @@
|
|
487
505
|
'itemFilter.itemId': query === null || query === void 0 ? void 0 : query['itemFilter.itemId'],
|
488
506
|
'itemFilter.itemType': query === null || query === void 0 ? void 0 : query['itemFilter.itemType'],
|
489
507
|
hashTag: query === null || query === void 0 ? void 0 : query.hashTag,
|
490
|
-
traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo
|
508
|
+
traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo,
|
509
|
+
themeTag: query === null || query === void 0 ? void 0 : query.themeTag
|
491
510
|
};
|
492
511
|
if (utmVal) {
|
493
512
|
const val = (_e = (_d = (_c = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _c === void 0 ? void 0 : _c.filter((val) => {
|
@@ -512,7 +531,8 @@
|
|
512
531
|
const data = yield getRecommendVideos({
|
513
532
|
hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
|
514
533
|
'itemFilter.itemId': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemId,
|
515
|
-
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType
|
534
|
+
'itemFilter.itemType': waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.itemType,
|
535
|
+
themeTag: themeTag.current
|
516
536
|
});
|
517
537
|
setRtcList(rtcList.concat((_f = data === null || data === void 0 ? void 0 : data.recList) !== null && _f !== void 0 ? _f : []));
|
518
538
|
setCacheRtcList(cacheRtcList.concat((_g = data === null || data === void 0 ? void 0 : data.recList) !== null && _g !== void 0 ? _g : []));
|
@@ -9316,7 +9336,7 @@ Made in Italy` })));
|
|
9316
9336
|
}
|
9317
9337
|
}, [isOnScreen, ref, rec, ctaEvent, index]);
|
9318
9338
|
const handleClick = lodash.throttle(() => {
|
9319
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
9339
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
9320
9340
|
const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
|
9321
9341
|
ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
|
9322
9342
|
eventSubject: 'clickCta',
|
@@ -9328,8 +9348,7 @@ Made in Italy` })));
|
|
9328
9348
|
const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
|
9329
9349
|
const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
|
9330
9350
|
jumpToWeb(rec, product, cta, index);
|
9331
|
-
window.location.href = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link;
|
9332
|
-
window.location.href = window.getJointUtmLink((_k = (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProduct) === null || _k === void 0 ? void 0 : _k.link);
|
9351
|
+
window.location.href = window.getJointUtmLink((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link);
|
9333
9352
|
}
|
9334
9353
|
}
|
9335
9354
|
else {
|
@@ -12100,13 +12119,6 @@ Made in Italy` })));
|
|
12100
12119
|
};
|
12101
12120
|
var LikeButton$1 = React.memo(LikeButton);
|
12102
12121
|
|
12103
|
-
const SXP_EVENT_BUS = new EventEmitter();
|
12104
|
-
var SXP_EVENT_TYPE;
|
12105
|
-
(function (SXP_EVENT_TYPE) {
|
12106
|
-
SXP_EVENT_TYPE["PAGE_DID_SHOW"] = "pageDidShow";
|
12107
|
-
SXP_EVENT_TYPE["PAGE_DID_HIDE"] = "pageDidHide";
|
12108
|
-
})(SXP_EVENT_TYPE || (SXP_EVENT_TYPE = {}));
|
12109
|
-
|
12110
12122
|
const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
|
12111
12123
|
const [isPauseVideo, setIsPauseVideo] = React.useState(false);
|
12112
12124
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = useSxpDataSource();
|
@@ -12714,7 +12726,7 @@ Made in Italy` })));
|
|
12714
12726
|
const DEFAULT_TAG = 'FOR U';
|
12715
12727
|
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
12716
12728
|
const [selectTag, setSelectTag] = React.useState(DEFAULT_TAG);
|
12717
|
-
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef } = useSxpDataSource();
|
12729
|
+
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData } = useSxpDataSource();
|
12718
12730
|
const realTagList = React.useMemo(() => {
|
12719
12731
|
return [DEFAULT_TAG, ...tagList];
|
12720
12732
|
}, [tagList]);
|
@@ -12728,6 +12740,7 @@ Made in Italy` })));
|
|
12728
12740
|
setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
|
12729
12741
|
getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({ themeTag }).then((res) => {
|
12730
12742
|
var _a, _b, _c, _d;
|
12743
|
+
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.CHANGE_THEME_TAG, themeTag);
|
12731
12744
|
setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []);
|
12732
12745
|
setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList((_b = res === null || res === void 0 ? void 0 : res.recList) !== null && _b !== void 0 ? _b : []);
|
12733
12746
|
setActiveIndex === null || setActiveIndex === void 0 ? void 0 : setActiveIndex(0);
|
@@ -12738,7 +12751,7 @@ Made in Italy` })));
|
|
12738
12751
|
});
|
12739
12752
|
setSelectTag(tag);
|
12740
12753
|
};
|
12741
|
-
if (tagList.length <= 0)
|
12754
|
+
if (waterFallData || tagList.length <= 0)
|
12742
12755
|
return null;
|
12743
12756
|
return (React.createElement("div", { className: 'clc-sxp-tagbar' },
|
12744
12757
|
React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
@@ -12930,9 +12943,12 @@ Made in Italy` })));
|
|
12930
12943
|
}
|
12931
12944
|
if (tagList.length > 0) {
|
12932
12945
|
minusHeight += 45;
|
12946
|
+
if (waterFallData) {
|
12947
|
+
minusHeight -= 45;
|
12948
|
+
}
|
12933
12949
|
}
|
12934
12950
|
return containerHeight - minusHeight;
|
12935
|
-
}, [globalConfig, containerHeight, tagList]);
|
12951
|
+
}, [globalConfig, containerHeight, tagList, waterFallData]);
|
12936
12952
|
const renderLogo = React.useMemo(() => {
|
12937
12953
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
12938
12954
|
return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
|