pb-sxp-ui 1.10.0 → 1.10.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/index.cjs +25 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -25
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +25 -25
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageCore/index.js +3 -2
- package/es/core/components/SxpPageRender/index.js +4 -4
- package/es/core/context/EditorContext.d.ts +0 -2
- package/es/core/context/EditorContext.js +3 -9
- package/es/core/context/SxpDataSourceProvider.d.ts +3 -0
- package/es/core/context/SxpDataSourceProvider.js +10 -5
- package/es/materials/sxp/MultiPosts/index.js +4 -5
- package/lib/core/components/SxpPageCore/index.js +3 -2
- package/lib/core/components/SxpPageRender/index.js +4 -4
- package/lib/core/context/EditorContext.d.ts +0 -2
- package/lib/core/context/EditorContext.js +3 -9
- package/lib/core/context/SxpDataSourceProvider.d.ts +3 -0
- package/lib/core/context/SxpDataSourceProvider.js +10 -5
- package/lib/materials/sxp/MultiPosts/index.js +3 -4
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -646,9 +646,8 @@
|
|
646
646
|
DataSourceType[DataSourceType["BFF"] = 5] = "BFF";
|
647
647
|
})(DataSourceType || (DataSourceType = {}));
|
648
648
|
const DEFAULT_TAG = 'FOR U';
|
649
|
-
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 }) => {
|
649
|
+
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, onUpdateChannel }) => {
|
650
650
|
var _a, _b, _c, _d, _e;
|
651
|
-
const { channel } = useEditor();
|
652
651
|
const [rtcList, setRtcList] = React.useState([]);
|
653
652
|
const [tagList, setTagList] = React.useState([]);
|
654
653
|
const [loading, setLoading] = React.useState(false);
|
@@ -674,11 +673,16 @@
|
|
674
673
|
const [pageData, setPageData] = React.useState(data);
|
675
674
|
const [showConsent, setShowConsent] = React.useState(false);
|
676
675
|
const [layoutVariantId, setLayoutVariantId] = React.useState();
|
676
|
+
const [channel, setChannel] = React.useState();
|
677
677
|
const isShowConsent = React.useMemo(() => {
|
678
678
|
var _a, _b, _c, _d;
|
679
679
|
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) &&
|
680
680
|
showConsent);
|
681
681
|
}, [isAgreePolicy, globalConfig, isOpenConsent, isEditor, showConsent]);
|
682
|
+
const updateChannel = React.useCallback((d) => {
|
683
|
+
onUpdateChannel === null || onUpdateChannel === void 0 ? void 0 : onUpdateChannel(d);
|
684
|
+
setChannel(d);
|
685
|
+
}, []);
|
682
686
|
const getFilterRecList = React.useCallback((data) => {
|
683
687
|
var _a;
|
684
688
|
const recList = data === null || data === void 0 ? void 0 : data.recList;
|
@@ -1009,7 +1013,7 @@
|
|
1009
1013
|
h5EnterLink();
|
1010
1014
|
}, [isShowConsent]);
|
1011
1015
|
React.useEffect(() => {
|
1012
|
-
if (isShowConsent)
|
1016
|
+
if (isShowConsent || isPreview)
|
1013
1017
|
return;
|
1014
1018
|
setLoading(true);
|
1015
1019
|
let layId;
|
@@ -1119,7 +1123,9 @@
|
|
1119
1123
|
popupCurTimeRef,
|
1120
1124
|
checkCommodityIndexRef,
|
1121
1125
|
isEditor,
|
1122
|
-
isNoMoreData
|
1126
|
+
isNoMoreData,
|
1127
|
+
updateChannel,
|
1128
|
+
channel
|
1123
1129
|
} }, 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({
|
1124
1130
|
rtcList,
|
1125
1131
|
mutateLike: bffMutateLike,
|
@@ -1249,7 +1255,6 @@
|
|
1249
1255
|
});
|
1250
1256
|
const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enableDataSource = true, utmVal }, ref) => {
|
1251
1257
|
const [currentNode, setCurrentNode] = React.useState(null);
|
1252
|
-
const [channel, setChannel] = React.useState();
|
1253
1258
|
const [_schema, setSchema] = React.useState(schema || {
|
1254
1259
|
pointData: [item],
|
1255
1260
|
dataSource: [],
|
@@ -1270,9 +1275,6 @@
|
|
1270
1275
|
const [undoStack, setUndoStack] = React.useState([[item]]);
|
1271
1276
|
const [redoStack, setRedoStack] = React.useState([]);
|
1272
1277
|
const [popup, setPopup] = React.useState(popupInit);
|
1273
|
-
const channelParams = React.useMemo(() => {
|
1274
|
-
return channel || utmVal;
|
1275
|
-
}, [channel, utmVal]);
|
1276
1278
|
typeof window !== 'undefined' &&
|
1277
1279
|
(window.sxpPopup = (type, aniType) => {
|
1278
1280
|
setPopup(Object.assign(Object.assign(Object.assign({}, popupInit), { id: type }), aniType));
|
@@ -1281,10 +1283,10 @@
|
|
1281
1283
|
(window.getJointUtmLink = (url) => {
|
1282
1284
|
setSlideSkipState();
|
1283
1285
|
if ((url === null || url === void 0 ? void 0 : url.indexOf('?')) !== -1) {
|
1284
|
-
return url + (
|
1286
|
+
return url + (utmVal ? '&' + utmVal : '');
|
1285
1287
|
}
|
1286
1288
|
else {
|
1287
|
-
return url + (
|
1289
|
+
return url + (utmVal ? '?' + utmVal : '');
|
1288
1290
|
}
|
1289
1291
|
});
|
1290
1292
|
// 切换页面类型,清空操作栈
|
@@ -1352,9 +1354,7 @@
|
|
1352
1354
|
setUndoStack,
|
1353
1355
|
getCurPageConf,
|
1354
1356
|
popup,
|
1355
|
-
setPopup
|
1356
|
-
channel,
|
1357
|
-
setChannel
|
1357
|
+
setPopup
|
1358
1358
|
} },
|
1359
1359
|
React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
|
1360
1360
|
});
|
@@ -16812,9 +16812,8 @@ Made in Italy` })));
|
|
16812
16812
|
const MultiPosts$1 = (_a) => {
|
16813
16813
|
var _b, _c;
|
16814
16814
|
var { bgImgUrl, style, recData } = _a, props = __rest(_a, ["bgImgUrl", "style", "recData"]);
|
16815
|
-
const {
|
16816
|
-
const {
|
16817
|
-
const { isActive } = useSwiperSlide();
|
16815
|
+
const { bffEventReport, curTime, updateChannel } = useSxpDataSource();
|
16816
|
+
const { isActive } = useSwiperSlide() || {};
|
16818
16817
|
const initRef = React.useRef(false);
|
16819
16818
|
const viewTime = React.useRef();
|
16820
16819
|
const traceinfo = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.traceInfo) !== null && _c !== void 0 ? _c : '';
|
@@ -16843,7 +16842,7 @@ Made in Italy` })));
|
|
16843
16842
|
});
|
16844
16843
|
if ((v === null || v === void 0 ? void 0 : v.linkType) === 'recommendFlow') {
|
16845
16844
|
endMultiPost('multipostClick');
|
16846
|
-
|
16845
|
+
updateChannel === null || updateChannel === void 0 ? void 0 : updateChannel(value);
|
16847
16846
|
curTime.current = new Date();
|
16848
16847
|
}
|
16849
16848
|
else {
|
@@ -17929,7 +17928,7 @@ Made in Italy` })));
|
|
17929
17928
|
* @Author: binruan@chatlabs.com
|
17930
17929
|
* @Date: 2024-03-20 10:27:31
|
17931
17930
|
* @LastEditors: binruan@chatlabs.com
|
17932
|
-
* @LastEditTime: 2024-11-27
|
17931
|
+
* @LastEditTime: 2024-11-27 17:08:59
|
17933
17932
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
17934
17933
|
*
|
17935
17934
|
*/
|
@@ -17937,7 +17936,7 @@ Made in Italy` })));
|
|
17937
17936
|
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;
|
17938
17937
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
17939
17938
|
const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png');
|
17940
|
-
const { schema
|
17939
|
+
const { schema } = useEditor();
|
17941
17940
|
const { openMultiPosts } = useEditorDataProvider();
|
17942
17941
|
const [activeIndex, setActiveIndex] = React.useState(0);
|
17943
17942
|
const viewImageStartTime = React.useRef(0);
|
@@ -17948,7 +17947,7 @@ Made in Italy` })));
|
|
17948
17947
|
const [isReload, setIsReload] = React.useState(new Date().getTime());
|
17949
17948
|
const skipLinkRef = React.useRef(false);
|
17950
17949
|
const [pageNum, setPageNum] = React.useState(2);
|
17951
|
-
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 } = useSxpDataSource();
|
17950
|
+
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 } = useSxpDataSource();
|
17952
17951
|
const { backMainFeed, productView, jumpToWeb } = useEventReport();
|
17953
17952
|
const isShowFingerTip = React.useMemo(() => {
|
17954
17953
|
return data.length > 0 && !loading && (getFeUserState() || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableSwiperTip));
|
@@ -18442,8 +18441,8 @@ Made in Italy` })));
|
|
18442
18441
|
React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
|
18443
18442
|
top: minusHeight
|
18444
18443
|
} }),
|
18445
|
-
((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && !channel && (React.createElement(NavBack$1, { data: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => history === null || history === void 0 ? void 0 : history.back() })),
|
18446
|
-
((_l = (_k = (_j = (_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === 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.backButton) === null || _l === void 0 ? void 0 : _l.enable) && channel && (React.createElement(NavBack$1, { data: (_q = (_p = (_o = (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.item) === null || _p === void 0 ? void 0 : _p.props) === null || _q === void 0 ? void 0 : _q.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => {
|
18444
|
+
((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && !channel && !openMultiPosts && (React.createElement(NavBack$1, { data: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => history === null || history === void 0 ? void 0 : history.back() })),
|
18445
|
+
((((_l = (_k = (_j = (_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === 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.backButton) === null || _l === void 0 ? void 0 : _l.enable) && channel) || openMultiPosts) && (React.createElement(NavBack$1, { data: (_q = (_p = (_o = (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.item) === null || _p === void 0 ? void 0 : _p.props) === null || _q === void 0 ? void 0 : _q.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => {
|
18447
18446
|
var _a, _b, _c;
|
18448
18447
|
bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
|
18449
18448
|
eventInfo: {
|
@@ -18953,7 +18952,7 @@ Made in Italy` })));
|
|
18953
18952
|
* @Author: binruan@chatlabs.com
|
18954
18953
|
* @Date: 2024-01-15 19:03:09
|
18955
18954
|
* @LastEditors: binruan@chatlabs.com
|
18956
|
-
* @LastEditTime: 2024-
|
18955
|
+
* @LastEditTime: 2024-11-27 16:58:32
|
18957
18956
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageCore\index.tsx
|
18958
18957
|
*
|
18959
18958
|
*/
|
@@ -18977,8 +18976,9 @@ Made in Italy` })));
|
|
18977
18976
|
return searchParams;
|
18978
18977
|
}, []);
|
18979
18978
|
const [_schema, setSchema] = React.useState(data === null || data === void 0 ? void 0 : data.data);
|
18980
|
-
|
18981
|
-
|
18979
|
+
const [channel, setChannel] = React.useState();
|
18980
|
+
return (React.createElement(EditorCore, { resolver: RESOLVER, enableDataSource: false, schema: _schema, utmVal: channel || utmVal },
|
18981
|
+
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 }) => {
|
18982
18982
|
var _a;
|
18983
18983
|
return (React.createElement(React.Fragment, null,
|
18984
18984
|
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 })),
|