pb-sxp-ui 1.12.0 → 1.12.2

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
@@ -1021,7 +1021,7 @@
1021
1021
  });
1022
1022
  }, [bffEventReport, isFromHashtag]);
1023
1023
  const h5EnterLink = React.useCallback(() => {
1024
- var _a, _b, _c, _d, _e;
1024
+ var _a, _b;
1025
1025
  const queryString = location.search.slice(1);
1026
1026
  const params = qs.parse(queryString.replace(/\+/g, '%2B'));
1027
1027
  for (const key in params) {
@@ -1029,10 +1029,7 @@
1029
1029
  }
1030
1030
  const getVal = (key) => { var _a; return (_a = params[key]) !== null && _a !== void 0 ? _a : ''; };
1031
1031
  const time = new Date();
1032
- const defaultGlobalConfig = (_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;
1033
- if (!((_c = defaultGlobalConfig === null || defaultGlobalConfig === void 0 ? void 0 : defaultGlobalConfig.session) === null || _c === void 0 ? void 0 : _c.enable) || !(curTime === null || curTime === void 0 ? void 0 : curTime.current)) {
1034
- curTime.current = time;
1035
- }
1032
+ curTime.current = time;
1036
1033
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1037
1034
  eventInfo: {
1038
1035
  eventSubject: 'h5LinkEnterFeed',
@@ -1044,12 +1041,12 @@
1044
1041
  utmContent: getVal('utm_content'),
1045
1042
  enterTime: Math.floor(time / 1000) + '',
1046
1043
  requestId: null,
1047
- enterUrl: (_e = (_d = window === null || window === void 0 ? void 0 : window.location) === null || _d === void 0 ? void 0 : _d.href) !== null && _e !== void 0 ? _e : '',
1044
+ enterUrl: (_b = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href) !== null && _b !== void 0 ? _b : '',
1048
1045
  clSource: getVal('cl_source')
1049
1046
  },
1050
1047
  reportLayId: false
1051
1048
  });
1052
- }, [bffEventReport, data, curTime]);
1049
+ }, [bffEventReport]);
1053
1050
  React.useEffect(() => {
1054
1051
  if (!isShowConsent)
1055
1052
  h5EnterLink();
@@ -17982,11 +17979,11 @@ Made in Italy` })));
17982
17979
  * @Author: binruan@chatlabs.com
17983
17980
  * @Date: 2024-03-20 10:27:31
17984
17981
  * @LastEditors: binruan@chatlabs.com
17985
- * @LastEditTime: 2024-12-17 15:46:14
17982
+ * @LastEditTime: 2024-12-18 10:24:20
17986
17983
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
17987
17984
  *
17988
17985
  */
17989
- const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], licenseUrl }) => {
17986
+ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], defaultData }) => {
17990
17987
  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;
17991
17988
  const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
17992
17989
  const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
@@ -18016,12 +18013,17 @@ Made in Italy` })));
18016
18013
  }
18017
18014
  }, [data === null || data === void 0 ? void 0 : data.length]);
18018
18015
  const handleH5EnterLink = React.useCallback(() => {
18016
+ var _a, _b, _c;
18017
+ const defaultGlobalConfig = (_b = (_a = defaultData === null || defaultData === void 0 ? void 0 : defaultData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig;
18018
+ if (!((_c = defaultGlobalConfig === null || defaultGlobalConfig === void 0 ? void 0 : defaultGlobalConfig.session) === null || _c === void 0 ? void 0 : _c.enable)) {
18019
+ refreshFeSessionId();
18020
+ }
18019
18021
  h5EnterLink === null || h5EnterLink === void 0 ? void 0 : h5EnterLink();
18020
18022
  if (data.length > 0) {
18021
18023
  const now = new Date();
18022
18024
  viewTime.current = now;
18023
18025
  }
18024
- }, [data.length, h5EnterLink]);
18026
+ }, [data.length, h5EnterLink, defaultData]);
18025
18027
  React.useEffect(() => {
18026
18028
  var _a;
18027
18029
  if (!ctaType || (ctaType === null || ctaType === void 0 ? void 0 : ctaType.length) < 1)
@@ -18091,7 +18093,7 @@ Made in Italy` })));
18091
18093
  handleReportProductView(item);
18092
18094
  }
18093
18095
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.playbook) !== 'organic menu' || activeIndex !== 0 || channel) {
18094
- const isExpire = refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(true, handleSessionCompleted);
18096
+ const isExpire = refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
18095
18097
  if (!isExpire)
18096
18098
  handleSessionCompleted();
18097
18099
  }
@@ -19067,7 +19069,7 @@ Made in Italy` })));
19067
19069
  React.createElement(SxpDataSourceProvider$1, { utmVal: utmVal, dataSources: data === null || data === void 0 ? void 0 : data.data_sources, sxpParameter: data === null || data === void 0 ? void 0 : data.sxp_parameter, maxSize: (_b = (_a = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _a === void 0 ? void 0 : _a.personalized_recommend) !== null && _b !== void 0 ? _b : maxSize, defaultSize: (_d = (_c = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _c === void 0 ? void 0 : _c.default_recommend) !== null && _d !== void 0 ? _d : defaultSize, hashTagSize: (_f = (_e = data === null || data === void 0 ? void 0 : data.sxp_parameter) === null || _e === void 0 ? void 0 : _e.hash_tag_size) !== null && _f !== void 0 ? _f : hashTagSize, loadingImage: loadingImage, appDomain: appDomain, enabledMetaConversionApi: enabledMetaConversionApi, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, data: data, dataList: dataList, onUpdateSchema: (d) => setSchema(d), onUpdateChannel: (d) => setChannel(d), render: ({ rtcList, tagList, pageData }) => {
19068
19070
  var _a;
19069
19071
  return (React.createElement(React.Fragment, null,
19070
- React.createElement(SxpPageRender, Object.assign({}, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER })),
19072
+ React.createElement(SxpPageRender, Object.assign({ defaultData: data }, (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER })),
19071
19073
  React.createElement(Popup, null)));
19072
19074
  } })));
19073
19075
  };