pb-sxp-ui 1.0.60 → 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/LICENSE +21 -21
- package/README.md +111 -111
- package/dist/index.cjs +40 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -24
- 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 +43 -27
- 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 +7 -5
- package/es/core/components/SxpPageRender/index.js +4 -1
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
- 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/popup/CommodityDetail/index.js +4 -4
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
- package/es/materials/sxp/template/components/EventProvider.js +2 -3
- package/lib/core/components/SxpPageRender/Tagbar.js +7 -5
- package/lib/core/components/SxpPageRender/index.js +4 -1
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
- 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/popup/CommodityDetail/index.js +4 -4
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
- package/lib/materials/sxp/template/components/EventProvider.js +2 -3
- package/package.json +115 -115
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 : []));
|
@@ -8443,10 +8463,10 @@
|
|
8443
8463
|
React.createElement("div", { className: 'pb-commondity-content-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.title) }, (_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium'),
|
8444
8464
|
React.createElement("div", { className: 'pb-commondity-content-price', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price) }, priceText),
|
8445
8465
|
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8446
|
-
React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
8447
|
-
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8448
|
-
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8449
|
-
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
8466
|
+
React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
8467
|
+
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
8468
|
+
collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
|
8469
|
+
necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
|
8450
8470
|
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 }))));
|
8451
8471
|
};
|
8452
8472
|
const renderBtn = () => {
|
@@ -8916,7 +8936,7 @@
|
|
8916
8936
|
const productInfoText = ({ isPost }) => {
|
8917
8937
|
return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
8918
8938
|
React.createElement(ExpandableText$1, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
|
8919
|
-
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
8939
|
+
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
8920
8940
|
Made in Italy` })));
|
8921
8941
|
};
|
8922
8942
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
@@ -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,20 +12726,21 @@ 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]);
|
12721
12733
|
const handleSelectTag = (tag) => () => {
|
12722
12734
|
if (tag === selectTag)
|
12723
12735
|
return;
|
12724
|
-
let
|
12736
|
+
let themeTag;
|
12725
12737
|
if (tag !== DEFAULT_TAG) {
|
12726
|
-
|
12738
|
+
themeTag = tag;
|
12727
12739
|
}
|
12728
12740
|
setLoading === null || setLoading === void 0 ? void 0 : setLoading(true);
|
12729
|
-
getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
|
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 } },
|