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 +43 -61
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +43 -61
- 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 -61
- 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/Pagebuilder/index.js +4 -3
- package/es/core/components/SxpPageCore/index.d.ts +1 -1
- package/es/core/components/SxpPageCore/index.js +6 -7
- package/es/core/components/SxpPageRender/typing.d.ts +0 -1
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -4
- package/es/core/context/SxpDataSourceProvider.js +25 -51
- package/lib/core/Pagebuilder/index.js +4 -3
- package/lib/core/components/SxpPageCore/index.d.ts +1 -1
- package/lib/core/components/SxpPageCore/index.js +5 -6
- package/lib/core/components/SxpPageRender/typing.d.ts +0 -1
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -4
- package/lib/core/context/SxpDataSourceProvider.js +25 -51
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -403,7 +403,7 @@ const Pagebuilder = {
|
|
403
403
|
const tenantId = builder.getTenantId();
|
404
404
|
const appId = builder.getAppId();
|
405
405
|
const apiUrl = builder.getApiUrl();
|
406
|
-
return fetch(`${apiUrl}/storefront/v1/page
|
406
|
+
return fetch(`${apiUrl}/storefront/v1/page?id=` + id, {
|
407
407
|
method: 'get',
|
408
408
|
headers: {
|
409
409
|
'x-tenant-id': tenantId || '',
|
@@ -415,8 +415,9 @@ const Pagebuilder = {
|
|
415
415
|
if (!result.success) {
|
416
416
|
return undefined;
|
417
417
|
}
|
418
|
-
const
|
419
|
-
|
418
|
+
const decodeData = unzip((_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.data);
|
419
|
+
result.data.data = decodeData;
|
420
|
+
return result.data;
|
420
421
|
}));
|
421
422
|
}),
|
422
423
|
getSxpRecommendVideoData: (dataId) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -620,8 +621,8 @@ var DataSourceType;
|
|
620
621
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
621
622
|
})(DataSourceType || (DataSourceType = {}));
|
622
623
|
const DEFAULT_TAG = 'FOR U';
|
623
|
-
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
|
624
|
-
var _a, _b, _c
|
624
|
+
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 }) => {
|
625
|
+
var _a, _b, _c;
|
625
626
|
const [rtcList, setRtcList] = useState([]);
|
626
627
|
const [tagList, setTagList] = useState([]);
|
627
628
|
const [loading, setLoading] = useState(false);
|
@@ -643,19 +644,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
643
644
|
const checkCommodityIndexRef = useRef(-1);
|
644
645
|
const popupCurTimeRef = useRef(null);
|
645
646
|
const [isNoMoreData, setIsNoMoreData] = useState(false);
|
646
|
-
const [globalConfig, setGlobalConfig] = useState((_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.globalConfig);
|
647
|
-
const [pageData, setPageData] = useState(data);
|
648
|
-
const [showConsent, setShowConsent] = useState(false);
|
649
|
-
const [layoutVariantId, setLayoutVariantId] = useState();
|
650
|
-
const isShowTag = useMemo(() => {
|
651
|
-
var _a, _b, _c;
|
652
|
-
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);
|
653
|
-
}, [pageData]);
|
654
647
|
const isShowConsent = useMemo(() => {
|
655
648
|
var _a, _b, _c, _d;
|
656
|
-
return (((
|
657
|
-
|
658
|
-
}, [isAgreePolicy, globalConfig, isOpenConsent, isEditor, showConsent]);
|
649
|
+
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;
|
650
|
+
}, [isAgreePolicy, globalConfig, isOpenConsent, isEditor]);
|
659
651
|
const getFilterRecList = useCallback((data) => {
|
660
652
|
var _a;
|
661
653
|
const recList = data === null || data === void 0 ? void 0 : data.recList;
|
@@ -717,14 +709,14 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
717
709
|
}, [bffDataSource]);
|
718
710
|
// 获取推荐视频数据
|
719
711
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
720
|
-
var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s
|
721
|
-
query = Object.assign(Object.assign(Object.assign({ maxSize: (
|
712
|
+
var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
713
|
+
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 });
|
722
714
|
if (utmVal) {
|
723
|
-
const val = (
|
715
|
+
const val = (_h = (_g = (_f = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _f === void 0 ? void 0 : _f.filter((val) => {
|
724
716
|
var _a, _b;
|
725
717
|
const key = val.split('=')[0];
|
726
718
|
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);
|
727
|
-
})) === null ||
|
719
|
+
})) === null || _g === void 0 ? void 0 : _g.join('&')) !== null && _h !== void 0 ? _h : '';
|
728
720
|
query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
|
729
721
|
}
|
730
722
|
if (isEditor) {
|
@@ -737,17 +729,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
737
729
|
let list = [];
|
738
730
|
let result = null;
|
739
731
|
const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
|
740
|
-
var _u, _v, _w, _x, _y
|
732
|
+
var _t, _u, _v, _w, _x, _y;
|
741
733
|
query.pageNum = pageNum;
|
742
734
|
result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/recommend/list', { method: 'GET', query }));
|
743
735
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
744
736
|
return undefined;
|
745
737
|
}
|
746
738
|
setLoading(false);
|
747
|
-
list = list.concat((
|
739
|
+
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 : []);
|
748
740
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
|
749
741
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result.data), { recList: list })));
|
750
|
-
const isNotNullList = (
|
742
|
+
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));
|
751
743
|
if (isNotNullList) {
|
752
744
|
pageNum = pageNum + 1;
|
753
745
|
yield recurveRecList(query);
|
@@ -755,11 +747,11 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
755
747
|
});
|
756
748
|
yield recurveRecList(query);
|
757
749
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
|
758
|
-
setCurReqInfo({ rtc: (
|
750
|
+
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 });
|
759
751
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
760
752
|
}
|
761
753
|
if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
|
762
|
-
query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (
|
754
|
+
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 });
|
763
755
|
}
|
764
756
|
const 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)) {
|
@@ -769,8 +761,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
769
761
|
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
770
762
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
|
771
763
|
let list = [];
|
772
|
-
list = list.concat((
|
773
|
-
const isNotNullList = (
|
764
|
+
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 : []);
|
765
|
+
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));
|
774
766
|
if (!isNotNullList) {
|
775
767
|
setIsNoMoreData(true);
|
776
768
|
}
|
@@ -779,12 +771,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
779
771
|
return result === null || result === void 0 ? void 0 : result.data;
|
780
772
|
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList]);
|
781
773
|
const loadVideos = useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
|
782
|
-
var _0, _1, _2
|
774
|
+
var _z, _0, _1, _2;
|
783
775
|
if (rtcList.length <= 0) {
|
784
776
|
return;
|
785
777
|
}
|
786
778
|
const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
|
787
|
-
const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((
|
779
|
+
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 })));
|
788
780
|
setRtcList(rtcList.concat(getFilterRecList(data)));
|
789
781
|
setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
|
790
782
|
return data;
|
@@ -802,7 +794,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
802
794
|
};
|
803
795
|
}
|
804
796
|
const sessionID = storeAndLoadFeSessionId();
|
805
|
-
const ef = Object.assign(Object.assign(Object.assign(Object.assign(
|
797
|
+
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() }));
|
806
798
|
const realUserInfo = Object.entries(userInfo).map(([k, v]) => ({ name: k, value: v }));
|
807
799
|
const realEventInfo = Object.entries(ef)
|
808
800
|
.map(([k, v]) => v && { name: k, value: v })
|
@@ -816,7 +808,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
816
808
|
body: { userInfo: realUserInfo, eventInfo: realEventInfo },
|
817
809
|
type: 'beacon'
|
818
810
|
});
|
819
|
-
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview
|
811
|
+
}, [bffFetch, curReqInfo, enableReportEvent, globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview]);
|
820
812
|
const bffFbReport = useCallback(({ eventName, product }) => {
|
821
813
|
var _a, _b, _c, _d, _e;
|
822
814
|
if (!enableReportEvent ||
|
@@ -902,17 +894,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
902
894
|
}), [bffFetch]);
|
903
895
|
// 获取 Tag
|
904
896
|
const bffGetTagList = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
905
|
-
var _4, _5, _6, _7
|
897
|
+
var _3, _4, _5, _6, _7;
|
906
898
|
if (!utmVal || !isShowTag)
|
907
899
|
return;
|
908
900
|
try {
|
909
|
-
const val = (
|
901
|
+
const val = (_5 = (_4 = (_3 = utmVal === null || utmVal === void 0 ? void 0 : utmVal.split('&')) === null || _3 === void 0 ? void 0 : _3.filter((val) => {
|
910
902
|
var _a, _b;
|
911
903
|
const key = val.split('=')[0];
|
912
904
|
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);
|
913
|
-
})) === null ||
|
905
|
+
})) === null || _4 === void 0 ? void 0 : _4.join('&')) !== null && _5 !== void 0 ? _5 : '';
|
914
906
|
const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
|
915
|
-
setTagList((
|
907
|
+
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 : []);
|
916
908
|
}
|
917
909
|
catch (e) {
|
918
910
|
console.log('e', e);
|
@@ -977,25 +969,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
977
969
|
bffGetTagList();
|
978
970
|
getRecommendVideos()
|
979
971
|
.then((data) => {
|
980
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
981
972
|
if (data) {
|
982
973
|
setRtcList(getFilterRecList(data));
|
983
974
|
setCacheRtcList(getFilterRecList(data));
|
984
|
-
if (data === null || data === void 0 ? void 0 : data.layoutVariantId) {
|
985
|
-
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];
|
986
|
-
if (id) {
|
987
|
-
setLayoutVariantId(id);
|
988
|
-
const curData = dataList === null || dataList === void 0 ? void 0 : dataList.find((item) => (item === null || item === void 0 ? void 0 : item.id) === id);
|
989
|
-
if (curData) {
|
990
|
-
setPageData(curData);
|
991
|
-
document.title = (_c = curData === null || curData === void 0 ? void 0 : curData.name) !== null && _c !== void 0 ? _c : 'home';
|
992
|
-
setGlobalConfig((_d = curData === null || curData === void 0 ? void 0 : curData.data) === null || _d === void 0 ? void 0 : _d.globalConfig);
|
993
|
-
onUpdateSchema === null || onUpdateSchema === void 0 ? void 0 : onUpdateSchema(curData === null || curData === void 0 ? void 0 : curData.data);
|
994
|
-
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)
|
995
|
-
setShowConsent(true);
|
996
|
-
}
|
997
|
-
}
|
998
|
-
}
|
999
975
|
}
|
1000
976
|
})
|
1001
977
|
.finally(() => {
|
@@ -1080,13 +1056,12 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
1080
1056
|
checkCommodityIndexRef,
|
1081
1057
|
isEditor,
|
1082
1058
|
isNoMoreData
|
1083
|
-
} }, isShowConsent ? (React.createElement(Consent$4, Object.assign({}, (
|
1059
|
+
} }, 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({
|
1084
1060
|
rtcList,
|
1085
1061
|
mutateLike: bffMutateLike,
|
1086
1062
|
mutateUnlike: bffMutateUnlike,
|
1087
1063
|
submitForm: bffSubmitForm,
|
1088
|
-
tagList
|
1089
|
-
pageData
|
1064
|
+
tagList
|
1090
1065
|
}))));
|
1091
1066
|
};
|
1092
1067
|
var SxpDataSourceProvider$1 = memo(SxpDataSourceProvider);
|
@@ -16811,6 +16786,14 @@ var ConsentPopup = memo(Consent);
|
|
16811
16786
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16812
16787
|
*
|
16813
16788
|
*/
|
16789
|
+
/*
|
16790
|
+
* @Author: binruan@chatlabs.com
|
16791
|
+
* @Date: 2024-01-15 19:03:09
|
16792
|
+
* @LastEditors: binruan@chatlabs.com
|
16793
|
+
* @LastEditTime: 2024-11-04 14:55:23
|
16794
|
+
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16795
|
+
*
|
16796
|
+
*/
|
16814
16797
|
const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], licenseUrl }) => {
|
16815
16798
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
16816
16799
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
@@ -17825,7 +17808,7 @@ const Popup = () => {
|
|
17825
17808
|
* @Author: binruan@chatlabs.com
|
17826
17809
|
* @Date: 2024-01-15 19:03:09
|
17827
17810
|
* @LastEditors: binruan@chatlabs.com
|
17828
|
-
* @LastEditTime: 2024-
|
17811
|
+
* @LastEditTime: 2024-07-24 16:35:44
|
17829
17812
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
|
17830
17813
|
*
|
17831
17814
|
*/
|
@@ -17841,19 +17824,18 @@ const RESOLVER = {};
|
|
17841
17824
|
Object.values(_materials_).forEach((v) => {
|
17842
17825
|
RESOLVER[v.extend.type] = v;
|
17843
17826
|
});
|
17844
|
-
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain,
|
17845
|
-
var _a, _b, _c, _d, _e, _f;
|
17827
|
+
const SxpPageCore = ({ data, maxSize = 10, defaultSize = 10, hashTagSize = 20, loadingImage, appDomain, licenseUrl, enabledMetaConversionApi }) => {
|
17828
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
17846
17829
|
const utmVal = useMemo(() => {
|
17847
17830
|
var _a;
|
17848
17831
|
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('?', '') : '';
|
17849
17832
|
return searchParams;
|
17850
17833
|
}, []);
|
17851
|
-
|
17852
|
-
|
17853
|
-
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 }) => {
|
17834
|
+
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: data === null || data === void 0 ? void 0 : data.data, utmVal: utmVal },
|
17835
|
+
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 }) => {
|
17854
17836
|
var _a;
|
17855
17837
|
return (React.createElement(React.Fragment, null,
|
17856
|
-
React.createElement(SxpPageRender, Object.assign({}, (_a =
|
17838
|
+
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 })),
|
17857
17839
|
React.createElement(Popup, null)));
|
17858
17840
|
} })));
|
17859
17841
|
};
|