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/index.js CHANGED
@@ -662,6 +662,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
662
662
  const [chatlabsId, setChatlabsId] = useState();
663
663
  const finalPageData = useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
664
664
  const pixelPvStatusRef = useRef(false);
665
+ useEffect(() => {
666
+ var _a, _b;
667
+ 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);
668
+ }, [data]);
665
669
  const isShowConsent = useMemo(() => {
666
670
  var _a, _b, _c, _d;
667
671
  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) &&
@@ -1555,7 +1559,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1555
1559
  refreshFeSession,
1556
1560
  getAccount,
1557
1561
  accountSonsent,
1558
- isDiyH5
1562
+ isDiyH5,
1563
+ pixelPvStatusRef
1559
1564
  } }, 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({
1560
1565
  rtcList,
1561
1566
  mutateLike: bffMutateLike,
@@ -10507,6 +10512,8 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
10507
10512
  if (!realRef.current || !clampRef.current || !isPost || !text || isShowMore)
10508
10513
  return;
10509
10514
  requestAnimationFrame(() => {
10515
+ if (!realRef.current)
10516
+ return;
10510
10517
  realRef.current.style.position = 'relative';
10511
10518
  const realHeight = realRef.current.getBoundingClientRect().height;
10512
10519
  const clampHeight = clampRef.current.getBoundingClientRect().height;
@@ -18804,7 +18811,7 @@ function withBindDataSource(Component) {
18804
18811
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
18805
18812
  *
18806
18813
  */
18807
- const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive, isNineProduct }) => {
18814
+ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType = [], isActive, isNineProduct }) => {
18808
18815
  var _a, _b, _c, _d, _e;
18809
18816
  const { schema } = useEditor();
18810
18817
  if (!(rec === null || rec === void 0 ? void 0 : rec.video))
@@ -18823,10 +18830,10 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive,
18823
18830
  const renderComp = useMemo(() => {
18824
18831
  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;
18825
18832
  // 如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
18826
- 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)))
18833
+ 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)))
18827
18834
  return;
18828
18835
  // 默认不渲染category为cta类型的组件,该类型的组件只用于某一处
18829
- if (!includesCtaType && ((_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.category) === 'cta')
18836
+ 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')
18830
18837
  return;
18831
18838
  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)) ||
18832
18839
  (((_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)) ||
@@ -18994,10 +19001,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
18994
19001
  const [isReload, setIsReload] = useState(new Date().getTime());
18995
19002
  const skipLinkRef = useRef(false);
18996
19003
  const [pageNum, setPageNum] = useState(2);
18997
- const [isShowCookieSetting, setIsShowCookieSetting] = useState(false);
19004
+ useState(false);
18998
19005
  const videoWidgetRef = useRef(null);
18999
19006
  const fbcRef = useRef('');
19000
- 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();
19007
+ 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();
19001
19008
  const { backMainFeed, productView, jumpToWeb } = useEventReport();
19002
19009
  const isShowFingerTip = useMemo(() => {
19003
19010
  return data.length > 0 && !loading && (getFeUserState() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
@@ -19277,7 +19284,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19277
19284
  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` } },
19278
19285
  React.createElement(Nudge, { nudge: nudge }),
19279
19286
  ((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' },
19280
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
19287
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, includesCtaType: [] }))) : null,
19281
19288
  React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
19282
19289
  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 }),
19283
19290
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
@@ -19457,13 +19464,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19457
19464
  }
19458
19465
  window.OptanonWrapper = function () {
19459
19466
  const activeGroups = window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups;
19460
- if (activeGroups && (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.length) > 2) {
19461
- setIsShowCookieSetting(true);
19462
- // if (!activeGroups?.includes('4')) {
19463
- // deleteCookie('_fbp', '/', extractRootDomain(window.location.hostname));
19464
- // (window as any)?.fbq('consent', 'revoke');
19465
- // }
19466
- }
19467
+ if (activeGroups && (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.length) > 2) ;
19467
19468
  };
19468
19469
  const handleClick = (event) => {
19469
19470
  var _a, _b;
@@ -19478,6 +19479,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19478
19479
  if (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.includes('4')) {
19479
19480
  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);
19480
19481
  window === null || window === void 0 ? void 0 : window.fbq('consent', 'grant');
19482
+ pixelPvStatusRef.current = true;
19481
19483
  if (fbcRef.current && !(beForeactiveGroups === null || beForeactiveGroups === void 0 ? void 0 : beForeactiveGroups.includes('4'))) ;
19482
19484
  }
19483
19485
  else {
@@ -19652,7 +19654,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19652
19654
  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)),
19653
19655
  React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
19654
19656
  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 } }))))),
19655
- isShowCookieSetting && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: {
19657
+ (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: {
19656
19658
  position: 'fixed',
19657
19659
  bottom: 0,
19658
19660
  left: 0,