pb-sxp-ui 1.8.8 → 1.9.0

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 CHANGED
@@ -425,7 +425,7 @@ const Pagebuilder = {
425
425
  const tenantId = builder.getTenantId();
426
426
  const appId = builder.getAppId();
427
427
  const apiUrl = builder.getApiUrl();
428
- return fetch(`${apiUrl}/storefront/v1/page/build?id=` + id, {
428
+ return fetch(`${apiUrl}/storefront/v1/page?id=` + id, {
429
429
  method: 'get',
430
430
  headers: {
431
431
  'x-tenant-id': tenantId || '',
@@ -437,8 +437,9 @@ const Pagebuilder = {
437
437
  if (!result.success) {
438
438
  return undefined;
439
439
  }
440
- const dataList = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.map((item) => (Object.assign(Object.assign({}, item), { data: unzip(item === null || item === void 0 ? void 0 : item.data) })));
441
- return dataList;
440
+ const decodeData = unzip((_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.data);
441
+ result.data.data = decodeData;
442
+ return result.data;
442
443
  }));
443
444
  }),
444
445
  getSxpRecommendVideoData: (dataId) => __awaiter(void 0, void 0, void 0, function* () {
@@ -642,8 +643,8 @@ var DataSourceType;
642
643
  DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
643
644
  })(DataSourceType || (DataSourceType = {}));
644
645
  const DEFAULT_TAG = 'FOR U';
645
- const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isOpenConsent = false, isEditor = false, utmParameter, channelQueryList, data, dataList, onUpdateSchema }) => {
646
- var _a, _b, _c, _d;
646
+ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isShowTag = true, isOpenConsent = false, globalConfig, isEditor = false, utmParameter, channelQueryList }) => {
647
+ var _a, _b, _c;
647
648
  const [rtcList, setRtcList] = React.useState([]);
648
649
  const [tagList, setTagList] = React.useState([]);
649
650
  const [loading, setLoading] = React.useState(false);
@@ -665,19 +666,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
665
666
  const checkCommodityIndexRef = React.useRef(-1);
666
667
  const popupCurTimeRef = React.useRef(null);
667
668
  const [isNoMoreData, setIsNoMoreData] = React.useState(false);
668
- const [globalConfig, setGlobalConfig] = React.useState((_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.globalConfig);
669
- const [pageData, setPageData] = React.useState(data);
670
- const [showConsent, setShowConsent] = React.useState(false);
671
- const [layoutVariantId, setLayoutVariantId] = React.useState();
672
- const isShowTag = React.useMemo(() => {
673
- var _a, _b, _c;
674
- return !!((_c = (_b = (_a = pageData === null || pageData === void 0 ? void 0 : pageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig) === null || _c === void 0 ? void 0 : _c.isShowTag);
675
- }, [pageData]);
676
669
  const isShowConsent = React.useMemo(() => {
677
670
  var _a, _b, _c, _d;
678
- 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) &&
679
- showConsent);
680
- }, [isAgreePolicy, globalConfig, isOpenConsent, isEditor, showConsent]);
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;
672
+ }, [isAgreePolicy, globalConfig, isOpenConsent, isEditor]);
681
673
  const getFilterRecList = React.useCallback((data) => {
682
674
  var _a;
683
675
  const recList = data === null || data === void 0 ? void 0 : data.recList;
@@ -739,14 +731,14 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
739
731
  }, [bffDataSource]);
740
732
  // 获取推荐视频数据
741
733
  const getRecommendVideos = React.useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
742
- var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
743
- query = Object.assign(Object.assign(Object.assign({ maxSize: (_e = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _e !== void 0 ? _e : maxSize, defaultSize: (_f = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _f !== void 0 ? _f : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag }, ((query === null || query === void 0 ? void 0 : query.contentFilter) && { contentFilter: `[${query === null || query === void 0 ? void 0 : query.contentFilter}]` })), ((query === null || query === void 0 ? void 0 : query.productFilter) && { productFilter: `[${query === null || query === void 0 ? void 0 : query.productFilter}]` })), { pageNum: query === null || query === void 0 ? void 0 : query.pageNum });
734
+ var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
735
+ query = Object.assign(Object.assign(Object.assign({ maxSize: (_d = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _d !== void 0 ? _d : maxSize, defaultSize: (_e = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _e !== void 0 ? _e : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag }, ((query === null || query === void 0 ? void 0 : query.contentFilter) && { contentFilter: `[${query === null || query === void 0 ? void 0 : query.contentFilter}]` })), ((query === null || query === void 0 ? void 0 : query.productFilter) && { productFilter: `[${query === null || query === void 0 ? void 0 : query.productFilter}]` })), { pageNum: query === null || query === void 0 ? void 0 : query.pageNum });
744
736
  if (utmVal) {
745
- const val = (_j = (_h = (_g = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _g === void 0 ? void 0 : _g.filter((val) => {
737
+ const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
746
738
  var _a, _b;
747
739
  const key = val.split('=')[0];
748
740
  return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
749
- })) === null || _h === void 0 ? void 0 : _h.join('&')) !== null && _j !== void 0 ? _j : '';
741
+ })) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
750
742
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
751
743
  }
752
744
  if (isEditor) {
@@ -759,17 +751,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
759
751
  let list = [];
760
752
  let result = null;
761
753
  const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
762
- var _u, _v, _w, _x, _y, _z;
754
+ var _t, _u, _v, _w, _x, _y;
763
755
  query.pageNum = pageNum;
764
756
  result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
765
757
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
766
758
  return undefined;
767
759
  }
768
760
  setLoading(false);
769
- list = list.concat((_x = (_w = (_v = (_u = result === null || result === void 0 ? void 0 : result.data) === null || _u === void 0 ? void 0 : _u.recList) === null || _v === void 0 ? void 0 : _v.filter) === null || _w === void 0 ? void 0 : _w.call(_v, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _x !== void 0 ? _x : []);
761
+ list = list.concat((_w = (_v = (_u = (_t = result === null || result === void 0 ? void 0 : result.data) === null || _t === void 0 ? void 0 : _t.recList) === null || _u === void 0 ? void 0 : _u.filter) === null || _v === void 0 ? void 0 : _v.call(_u, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _w !== void 0 ? _w : []);
770
762
  setRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
771
763
  setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
772
- const isNotNullList = (_z = (_y = result === null || result === void 0 ? void 0 : result.data) === null || _y === void 0 ? void 0 : _y.recList) === null || _z === void 0 ? void 0 : _z.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
764
+ const isNotNullList = (_y = (_x = result === null || result === void 0 ? void 0 : result.data) === null || _x === void 0 ? void 0 : _x.recList) === null || _y === void 0 ? void 0 : _y.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
773
765
  if (isNotNullList) {
774
766
  pageNum = pageNum + 1;
775
767
  yield recurveRecList(query);
@@ -777,11 +769,11 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
777
769
  });
778
770
  yield recurveRecList(query);
779
771
  if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
780
- setCurReqInfo({ rtc: (_k = result === null || result === void 0 ? void 0 : result.data) === null || _k === void 0 ? void 0 : _k.rtc, requestId: (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.requestId });
772
+ setCurReqInfo({ rtc: (_j = result === null || result === void 0 ? void 0 : result.data) === null || _j === void 0 ? void 0 : _j.rtc, requestId: (_k = result === null || result === void 0 ? void 0 : result.data) === null || _k === void 0 ? void 0 : _k.requestId });
781
773
  return Object.assign(Object.assign({}, result.data), { recList: list });
782
774
  }
783
775
  if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
784
- query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_m = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _m !== void 0 ? _m : 1 });
776
+ query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_l = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _l !== void 0 ? _l : 1 });
785
777
  }
786
778
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
787
779
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
@@ -791,8 +783,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
791
783
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
792
784
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
793
785
  let list = [];
794
- list = list.concat((_r = (_q = (_p = (_o = result === null || result === void 0 ? void 0 : result.data) === null || _o === void 0 ? void 0 : _o.recList) === null || _p === void 0 ? void 0 : _p.filter) === null || _q === void 0 ? void 0 : _q.call(_p, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _r !== void 0 ? _r : []);
795
- const isNotNullList = (_t = (_s = result === null || result === void 0 ? void 0 : result.data) === null || _s === void 0 ? void 0 : _s.recList) === null || _t === void 0 ? void 0 : _t.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
786
+ list = list.concat((_q = (_p = (_o = (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.recList) === null || _o === void 0 ? void 0 : _o.filter) === null || _p === void 0 ? void 0 : _p.call(_o, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _q !== void 0 ? _q : []);
787
+ const isNotNullList = (_s = (_r = result === null || result === void 0 ? void 0 : result.data) === null || _r === void 0 ? void 0 : _r.recList) === null || _s === void 0 ? void 0 : _s.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
796
788
  if (!isNotNullList) {
797
789
  setIsNoMoreData(true);
798
790
  }
@@ -801,12 +793,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
801
793
  return result === null || result === void 0 ? void 0 : result.data;
802
794
  }), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList]);
803
795
  const loadVideos = React.useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
804
- var _0, _1, _2, _3;
796
+ var _z, _0, _1, _2;
805
797
  if (rtcList.length <= 0) {
806
798
  return;
807
799
  }
808
800
  const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
809
- const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_0 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _0 === void 0 ? void 0 : _0.itemId) && { productFilter: (_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _1 === void 0 ? void 0 : _1.itemId })), (((_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _2 === void 0 ? void 0 : _2.itemId) && { contentFilter: (_3 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _3 === void 0 ? void 0 : _3.itemId })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
801
+ const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_z = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _z === void 0 ? void 0 : _z.itemId) && { productFilter: (_0 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _0 === void 0 ? void 0 : _0.itemId })), (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _1 === void 0 ? void 0 : _1.itemId) && { contentFilter: (_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _2 === void 0 ? void 0 : _2.itemId })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
810
802
  setRtcList(rtcList.concat(getFilterRecList(data)));
811
803
  setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
812
804
  return data;
@@ -824,7 +816,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
824
816
  };
825
817
  }
826
818
  const sessionID = storeAndLoadFeSessionId();
827
- const ef = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo), (getDevice$1() && { sxpDevice: getDevice$1() })), (getSystem() && { sxpSystem: getSystem() })), (getBrowserInfo() && { sxpBrowser: getBrowserInfo() })), (layoutVariantId && { layoutVariantId }));
819
+ const ef = Object.assign(Object.assign(Object.assign(Object.assign({ sessionID, rtc: curReqInfo.rtc, requestId: curReqInfo.requestId }, eventInfo), (getDevice$1() && { sxpDevice: getDevice$1() })), (getSystem() && { sxpSystem: getSystem() })), (getBrowserInfo() && { sxpBrowser: getBrowserInfo() }));
828
820
  const realUserInfo = Object.entries(userInfo).map(([k, v]) => ({ name: k, value: v }));
829
821
  const realEventInfo = Object.entries(ef)
830
822
  .map(([k, v]) => v && { name: k, value: v })
@@ -838,7 +830,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
838
830
  body: { userInfo: realUserInfo, eventInfo: realEventInfo },
839
831
  type: 'beacon'
840
832
  });
841
- }, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview, layoutVariantId]);
833
+ }, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
842
834
  const bffFbReport = React.useCallback(({ eventName, product }) => {
843
835
  var _a, _b, _c, _d, _e;
844
836
  if (!enableReportEvent ||
@@ -924,17 +916,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
924
916
  }), [bffFetch]);
925
917
  // 获取 Tag
926
918
  const bffGetTagList = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
927
- var _4, _5, _6, _7, _8;
919
+ var _3, _4, _5, _6, _7;
928
920
  if (!utmVal || !isShowTag)
929
921
  return;
930
922
  try {
931
- const val = (_6 = (_5 = (_4 = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _4 === void 0 ? void 0 : _4.filter((val) => {
923
+ const val = (_5 = (_4 = (_3 = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _3 === void 0 ? void 0 : _3.filter((val) => {
932
924
  var _a, _b;
933
925
  const key = val.split('=')[0];
934
926
  return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
935
- })) === null || _5 === void 0 ? void 0 : _5.join('&')) !== null && _6 !== void 0 ? _6 : '';
927
+ })) === null || _4 === void 0 ? void 0 : _4.join('&')) !== null && _5 !== void 0 ? _5 : '';
936
928
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
937
- setTagList((_8 = (_7 = result === null || result === void 0 ? void 0 : result.data) === null || _7 === void 0 ? void 0 : _7.tags) !== null && _8 !== void 0 ? _8 : []);
929
+ setTagList((_7 = (_6 = result === null || result === void 0 ? void 0 : result.data) === null || _6 === void 0 ? void 0 : _6.tags) !== null && _7 !== void 0 ? _7 : []);
938
930
  }
939
931
  catch (e) {
940
932
  console.log('e', e);
@@ -999,25 +991,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
999
991
  bffGetTagList();
1000
992
  getRecommendVideos()
1001
993
  .then((data) => {
1002
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1003
994
  if (data) {
1004
995
  setRtcList(getFilterRecList(data));
1005
996
  setCacheRtcList(getFilterRecList(data));
1006
- if (data === null || data === void 0 ? void 0 : data.layoutVariantId) {
1007
- const id = (_b = (_a = data === null || data === void 0 ? void 0 : data.layoutVariantId) === null || _a === void 0 ? void 0 : _a.split('-')) === null || _b === void 0 ? void 0 : _b[1];
1008
- if (id) {
1009
- setLayoutVariantId(id);
1010
- const curData = dataList === null || dataList === void 0 ? void 0 : dataList.find((item) => (item === null || item === void 0 ? void 0 : item.id) === id);
1011
- if (curData) {
1012
- setPageData(curData);
1013
- document.title = (_c = curData === null || curData === void 0 ? void 0 : curData.name) !== null && _c !== void 0 ? _c : 'home';
1014
- setGlobalConfig((_d = curData === null || curData === void 0 ? void 0 : curData.data) === null || _d === void 0 ? void 0 : _d.globalConfig);
1015
- onUpdateSchema === null || onUpdateSchema === void 0 ? void 0 : onUpdateSchema(curData === null || curData === void 0 ? void 0 : curData.data);
1016
- if ((_k = (_j = (_h = (_g = (_f = (_e = curData === null || curData === void 0 ? void 0 : curData.data) === null || _e === void 0 ? void 0 : _e.globalConfig) === null || _f === void 0 ? void 0 : _f.consent) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.item) === null || _j === void 0 ? void 0 : _j.props) === null || _k === void 0 ? void 0 : _k.privacy_necessity)
1017
- setShowConsent(true);
1018
- }
1019
- }
1020
- }
1021
997
  }
1022
998
  })
1023
999
  .finally(() => {
@@ -1102,13 +1078,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1102
1078
  checkCommodityIndexRef,
1103
1079
  isEditor,
1104
1080
  isNoMoreData
1105
- } }, isShowConsent ? (React.createElement(Consent$4, Object.assign({}, (_d = (_c = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.item) === null || _d === void 0 ? void 0 : _d.props))) : (render({
1081
+ } }, isShowConsent ? (React.createElement(Consent$4, Object.assign({}, (_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))) : (render({
1106
1082
  rtcList,
1107
1083
  mutateLike: bffMutateLike,
1108
1084
  mutateUnlike: bffMutateUnlike,
1109
1085
  submitForm: bffSubmitForm,
1110
- tagList,
1111
- pageData
1086
+ tagList
1112
1087
  }))));
1113
1088
  };
1114
1089
  var SxpDataSourceProvider$1 = React.memo(SxpDataSourceProvider);
@@ -16833,6 +16808,14 @@ var ConsentPopup = React.memo(Consent);
16833
16808
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
16834
16809
  *
16835
16810
  */
16811
+ /*
16812
+ * @Author: binruan@chatlabs.com
16813
+ * @Date: 2024-01-15 19:03:09
16814
+ * @LastEditors: binruan@chatlabs.com
16815
+ * @LastEditTime: 2024-11-04 14:55:23
16816
+ * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
16817
+ *
16818
+ */
16836
16819
  const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], licenseUrl }) => {
16837
16820
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
16838
16821
  const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
@@ -17847,7 +17830,7 @@ const Popup = () => {
17847
17830
  * @Author: binruan@chatlabs.com
17848
17831
  * @Date: 2024-01-15 19:03:09
17849
17832
  * @LastEditors: binruan@chatlabs.com
17850
- * @LastEditTime: 2024-09-30 14:37:13
17833
+ * @LastEditTime: 2024-07-24 16:35:44
17851
17834
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
17852
17835
  *
17853
17836
  */
@@ -17863,19 +17846,18 @@ const RESOLVER = {};
17863
17846
  Object.values(_materials_).forEach((v) => {
17864
17847
  RESOLVER[v.extend.type] = v;
17865
17848
  });
17866
- const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, enabledMetaConversionApi, dataList }) => {
17867
- var _a, _b, _c, _d, _e, _f;
17849
+ const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl, enabledMetaConversionApi }) => {
17850
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
17868
17851
  const utmVal = React.useMemo(() => {
17869
17852
  var _a;
17870
17853
  const searchParams = (location === null || location === void 0 ? void 0 : location.search) ? (_a = location === null || location === void 0 ? void 0 : location.search) === null || _a === void 0 ? void 0 : _a.replace('?', '') : '';
17871
17854
  return searchParams;
17872
17855
  }, []);
17873
- const [_schema, setSchema] = React.useState(data === null || data === void 0 ? void 0 : data.data);
17874
- return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: utmVal },
17875
- 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), render: ({ rtcList, tagList, pageData }) => {
17856
+ return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
17857
+ 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, isShowTag: (_j = (_h = (_g = data === null || data === void 0 ? void 0 : data.data) === null || _g === void 0 ? void 0 : _g.sxpPageConf) === null || _h === void 0 ? void 0 : _h.globalConfig) === null || _j === void 0 ? void 0 : _j.isShowTag, globalConfig: (_l = (_k = data === null || data === void 0 ? void 0 : data.data) === null || _k === void 0 ? void 0 : _k.sxpPageConf) === null || _l === void 0 ? void 0 : _l.globalConfig, utmParameter: data === null || data === void 0 ? void 0 : data.utm_parameter, render: ({ rtcList, tagList }) => {
17876
17858
  var _a;
17877
17859
  return (React.createElement(React.Fragment, null,
17878
- 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 })),
17860
+ React.createElement(SxpPageRender, Object.assign({}, (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf, { tagList: tagList, data: rtcList, resolver: RESOLVER, licenseUrl: licenseUrl })),
17879
17861
  React.createElement(Popup, null)));
17880
17862
  } })));
17881
17863
  };