pb-sxp-ui 1.19.4 → 1.19.6

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/pb-ui.js CHANGED
@@ -677,6 +677,10 @@
677
677
  const [chatlabsId, setChatlabsId] = React.useState();
678
678
  const finalPageData = React.useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
679
679
  const pixelPvStatusRef = React.useRef(false);
680
+ React.useEffect(() => {
681
+ var _a, _b;
682
+ setGlobalConfig((_b = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig);
683
+ }, [data]);
680
684
  const isShowConsent = React.useMemo(() => {
681
685
  var _a, _b, _c, _d;
682
686
  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) &&
@@ -1570,7 +1574,8 @@
1570
1574
  refreshFeSession,
1571
1575
  getAccount,
1572
1576
  accountSonsent,
1573
- isDiyH5
1577
+ isDiyH5,
1578
+ pixelPvStatusRef
1574
1579
  } }, isShowConsent ? (React.createElement(Consent$4, Object.assign({}, (_e = (_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.props))) : (render({
1575
1580
  rtcList,
1576
1581
  mutateLike: bffMutateLike,
@@ -10522,6 +10527,8 @@
10522
10527
  if (!realRef.current || !clampRef.current || !isPost || !text || isShowMore)
10523
10528
  return;
10524
10529
  requestAnimationFrame(() => {
10530
+ if (!realRef.current)
10531
+ return;
10525
10532
  realRef.current.style.position = 'relative';
10526
10533
  const realHeight = realRef.current.getBoundingClientRect().height;
10527
10534
  const clampHeight = clampRef.current.getBoundingClientRect().height;
@@ -18819,7 +18826,7 @@ Made in Italy` })));
18819
18826
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
18820
18827
  *
18821
18828
  */
18822
- const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive, isNineProduct }) => {
18829
+ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType = [], isActive, isNineProduct }) => {
18823
18830
  var _a, _b, _c, _d, _e;
18824
18831
  const { schema } = useEditor();
18825
18832
  if (!(rec === null || rec === void 0 ? void 0 : rec.video))
@@ -18838,10 +18845,10 @@ Made in Italy` })));
18838
18845
  const renderComp = React.useMemo(() => {
18839
18846
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
18840
18847
  // 如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
18841
- if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
18848
+ if ((includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.length) > 0 && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
18842
18849
  return;
18843
18850
  // 默认不渲染category为cta类型的组件,该类型的组件只用于某一处
18844
- if (!includesCtaType && ((_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.category) === 'cta')
18851
+ if ((!includesCtaType || (includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.length) === 0) && ((_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.category) === 'cta')
18845
18852
  return;
18846
18853
  if ((((_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.type) === 'CommodityDiro' && !((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindProduct)) ||
18847
18854
  (((_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.type) === 'Commodity' && !((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct)) ||
@@ -19009,10 +19016,10 @@ Made in Italy` })));
19009
19016
  const [isReload, setIsReload] = React.useState(new Date().getTime());
19010
19017
  const skipLinkRef = React.useRef(false);
19011
19018
  const [pageNum, setPageNum] = React.useState(2);
19012
- const [isShowCookieSetting, setIsShowCookieSetting] = React.useState(false);
19019
+ React.useState(false);
19013
19020
  const videoWidgetRef = React.useRef(null);
19014
19021
  const fbcRef = React.useRef('');
19015
- const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession, isDiyH5 } = useSxpDataSource();
19022
+ const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession, isDiyH5, pixelPvStatusRef } = useSxpDataSource();
19016
19023
  const { backMainFeed, productView, jumpToWeb } = useEventReport();
19017
19024
  const isShowFingerTip = React.useMemo(() => {
19018
19025
  return data.length > 0 && !loading && (getFeUserState() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
@@ -19292,7 +19299,7 @@ Made in Italy` })));
19292
19299
  React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _j !== void 0 ? _j : 40}px` } },
19293
19300
  React.createElement(Nudge, { nudge: nudge }),
19294
19301
  ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) && !isNineProduct ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
19295
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
19302
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, includesCtaType: [] }))) : null,
19296
19303
  React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
19297
19304
  React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
19298
19305
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
@@ -19472,13 +19479,7 @@ Made in Italy` })));
19472
19479
  }
19473
19480
  window.OptanonWrapper = function () {
19474
19481
  const activeGroups = window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups;
19475
- if (activeGroups && (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.length) > 2) {
19476
- setIsShowCookieSetting(true);
19477
- // if (!activeGroups?.includes('4')) {
19478
- // deleteCookie('_fbp', '/', extractRootDomain(window.location.hostname));
19479
- // (window as any)?.fbq('consent', 'revoke');
19480
- // }
19481
- }
19482
+ if (activeGroups && (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.length) > 2) ;
19482
19483
  };
19483
19484
  const handleClick = (event) => {
19484
19485
  var _a, _b;
@@ -19493,6 +19494,7 @@ Made in Italy` })));
19493
19494
  if (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.includes('4')) {
19494
19495
  window === null || window === void 0 ? void 0 : window.loadMetaPixel(false, SXP_CONFIG === null || SXP_CONFIG === void 0 ? void 0 : SXP_CONFIG.meta_conversion_api_pid);
19495
19496
  window === null || window === void 0 ? void 0 : window.fbq('consent', 'grant');
19497
+ pixelPvStatusRef.current = true;
19496
19498
  if (fbcRef.current && !(beForeactiveGroups === null || beForeactiveGroups === void 0 ? void 0 : beForeactiveGroups.includes('4'))) ;
19497
19499
  }
19498
19500
  else {
@@ -19667,7 +19669,7 @@ Made in Italy` })));
19667
19669
  React.createElement(WaterFall$1, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props)),
19668
19670
  React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
19669
19671
  openMultiPosts && (React.createElement(MultiPosts$2, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0 } }))))),
19670
- isShowCookieSetting && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: {
19672
+ (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: {
19671
19673
  position: 'fixed',
19672
19674
  bottom: 0,
19673
19675
  left: 0,