pb-sxp-ui 1.20.22 → 1.20.25
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 +30 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -7
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +6 -6
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +30 -7
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +6 -6
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/context/SxpDataSourceProvider.js +12 -4
- package/es/materials/sxp/popup/CommodityDetail/index.js +15 -3
- package/lib/core/context/SxpDataSourceProvider.js +12 -4
- package/lib/materials/sxp/popup/CommodityDetail/index.js +15 -3
- package/package.json +1 -1
|
@@ -461,7 +461,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
461
461
|
return undefined;
|
|
462
462
|
}
|
|
463
463
|
setLoading(false);
|
|
464
|
-
list = list.concat((_1 = (_0 = (_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.filter) === null || _0 === void 0 ? void 0 : _0.call(_z, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _1 !== void 0 ? _1 : []);
|
|
464
|
+
list = list.concat((_1 = (_0 = (_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.filter) === null || _0 === void 0 ? void 0 : _0.call(_z, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta))) !== null && _1 !== void 0 ? _1 : []);
|
|
465
465
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
|
466
466
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
467
467
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
@@ -469,7 +469,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
469
469
|
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
const isNotNullList = (_3 = (_2 = result === null || result === void 0 ? void 0 : result.data) === null || _2 === void 0 ? void 0 : _2.recList) === null || _3 === void 0 ? void 0 : _3.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
|
472
|
+
const isNotNullList = (_3 = (_2 = result === null || result === void 0 ? void 0 : result.data) === null || _2 === void 0 ? void 0 : _2.recList) === null || _3 === void 0 ? void 0 : _3.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta));
|
|
473
473
|
if (isNotNullList) {
|
|
474
474
|
pageNum = pageNum + 1;
|
|
475
475
|
yield recurveRecList(query);
|
|
@@ -495,13 +495,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
495
495
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag))
|
|
496
496
|
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
|
497
497
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
|
|
498
|
-
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));
|
|
498
|
+
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) || (item === null || item === void 0 ? void 0 : item.multiCta));
|
|
499
499
|
if (!isNotNullList) {
|
|
500
500
|
setIsNoMoreData(true);
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
503
|
let list = [];
|
|
504
|
-
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 : []);
|
|
504
|
+
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) || (item === null || item === void 0 ? void 0 : item.multiCta))) !== null && _x !== void 0 ? _x : []);
|
|
505
505
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
|
506
506
|
}), [
|
|
507
507
|
bffFetch,
|
|
@@ -895,11 +895,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
895
895
|
onUpdateSchema === null || onUpdateSchema === void 0 ? void 0 : onUpdateSchema(curData === null || curData === void 0 ? void 0 : curData.data);
|
|
896
896
|
if ((_j = (_h = (_g = (_f = gldata === null || gldata === void 0 ? void 0 : gldata.consent) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.item) === null || _h === void 0 ? void 0 : _h.props) === null || _j === void 0 ? void 0 : _j.privacy_necessity)
|
|
897
897
|
setShowConsent(true);
|
|
898
|
+
else
|
|
899
|
+
setShowConsent(true);
|
|
898
900
|
}
|
|
899
901
|
else {
|
|
902
|
+
console.warn(`[SxpDataSourceProvider] Layout variant ${id} not found in dataList (count: ${(dataList === null || dataList === void 0 ? void 0 : dataList.length) || 0}), using default page config`);
|
|
903
|
+
gldata = globalConfig;
|
|
900
904
|
setShowConsent(true);
|
|
901
905
|
}
|
|
902
906
|
}
|
|
907
|
+
else {
|
|
908
|
+
gldata = globalConfig;
|
|
909
|
+
setShowConsent(true);
|
|
910
|
+
}
|
|
903
911
|
}
|
|
904
912
|
else {
|
|
905
913
|
setShowConsent(true);
|
|
@@ -16,6 +16,7 @@ import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
|
|
|
16
16
|
const CommodityDetail = (_a) => {
|
|
17
17
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
18
18
|
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true, enableAddToCart = false, addToCartPopupId = '' } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive", "enableAddToCart", "addToCartPopupId"]);
|
|
19
|
+
console.log('[CommodityDetail] 组件已加载 - 版本 v1.20.23', { enableAddToCart, addToCartPopupId, isPost });
|
|
19
20
|
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
|
|
20
21
|
const { jumpToWeb, productView } = useEventReport();
|
|
21
22
|
const curTimeRef = useRef(null);
|
|
@@ -190,7 +191,7 @@ const CommodityDetail = (_a) => {
|
|
|
190
191
|
const renderBtn = () => {
|
|
191
192
|
var _a, _b;
|
|
192
193
|
const handleBtnClick = (e) => {
|
|
193
|
-
console.log('[CommodityDetail] Shop Now
|
|
194
|
+
console.log('[CommodityDetail] Shop Now 按钮被点击!!!!', {
|
|
194
195
|
product,
|
|
195
196
|
cta,
|
|
196
197
|
enableAddToCart,
|
|
@@ -199,9 +200,20 @@ const CommodityDetail = (_a) => {
|
|
|
199
200
|
});
|
|
200
201
|
handleLink(e);
|
|
201
202
|
};
|
|
203
|
+
console.log('[CommodityDetail] renderBtn 被调用', {
|
|
204
|
+
ctaTitle: cta === null || cta === void 0 ? void 0 : cta.enTitle,
|
|
205
|
+
buttonStyle
|
|
206
|
+
});
|
|
202
207
|
return (React.createElement(React.Fragment, null,
|
|
203
|
-
React.createElement("a", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', role: 'button', tabIndex: 0, onClick: handleBtnClick, onMouseDown: (e) =>
|
|
204
|
-
|
|
208
|
+
React.createElement("a", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', role: 'button', tabIndex: 0, onClick: handleBtnClick, onMouseDown: (e) => {
|
|
209
|
+
console.log('[CommodityDetail] mousedown 事件触发!!!', e);
|
|
210
|
+
e.stopPropagation();
|
|
211
|
+
}, onPointerDown: (e) => {
|
|
212
|
+
console.log('[CommodityDetail] pointerdown 事件触发!!!', e);
|
|
213
|
+
}, onTouchStart: (e) => {
|
|
214
|
+
console.log('[CommodityDetail] touchstart 事件触发!!!', e);
|
|
215
|
+
}, className: 'pb-commondity-btn', style: Object.assign(Object.assign({}, buttonStyle), { pointerEvents: 'auto', touchAction: 'manipulation' }) },
|
|
216
|
+
React.createElement("span", { style: { pointerEvents: 'none' }, dangerouslySetInnerHTML: {
|
|
205
217
|
__html: setFontForText((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
|
|
206
218
|
} }))));
|
|
207
219
|
};
|
|
@@ -464,7 +464,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
464
464
|
return undefined;
|
|
465
465
|
}
|
|
466
466
|
setLoading(false);
|
|
467
|
-
list = list.concat((_1 = (_0 = (_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.filter) === null || _0 === void 0 ? void 0 : _0.call(_z, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _1 !== void 0 ? _1 : []);
|
|
467
|
+
list = list.concat((_1 = (_0 = (_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.filter) === null || _0 === void 0 ? void 0 : _0.call(_z, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta))) !== null && _1 !== void 0 ? _1 : []);
|
|
468
468
|
if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
|
|
469
469
|
setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
470
470
|
setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
@@ -472,7 +472,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
472
472
|
setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
const isNotNullList = (_3 = (_2 = result === null || result === void 0 ? void 0 : result.data) === null || _2 === void 0 ? void 0 : _2.recList) === null || _3 === void 0 ? void 0 : _3.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
|
|
475
|
+
const isNotNullList = (_3 = (_2 = result === null || result === void 0 ? void 0 : result.data) === null || _2 === void 0 ? void 0 : _2.recList) === null || _3 === void 0 ? void 0 : _3.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video) || (item === null || item === void 0 ? void 0 : item.multiCta));
|
|
476
476
|
if (isNotNullList) {
|
|
477
477
|
pageNum = pageNum + 1;
|
|
478
478
|
yield recurveRecList(query);
|
|
@@ -498,13 +498,13 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
498
498
|
if (!(query === null || query === void 0 ? void 0 : query.hashTag))
|
|
499
499
|
setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
|
|
500
500
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
|
|
501
|
-
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));
|
|
501
|
+
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) || (item === null || item === void 0 ? void 0 : item.multiCta));
|
|
502
502
|
if (!isNotNullList) {
|
|
503
503
|
setIsNoMoreData(true);
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
let list = [];
|
|
507
|
-
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 : []);
|
|
507
|
+
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) || (item === null || item === void 0 ? void 0 : item.multiCta))) !== null && _x !== void 0 ? _x : []);
|
|
508
508
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
|
509
509
|
}), [
|
|
510
510
|
bffFetch,
|
|
@@ -898,11 +898,19 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
|
898
898
|
onUpdateSchema === null || onUpdateSchema === void 0 ? void 0 : onUpdateSchema(curData === null || curData === void 0 ? void 0 : curData.data);
|
|
899
899
|
if ((_j = (_h = (_g = (_f = gldata === null || gldata === void 0 ? void 0 : gldata.consent) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.item) === null || _h === void 0 ? void 0 : _h.props) === null || _j === void 0 ? void 0 : _j.privacy_necessity)
|
|
900
900
|
setShowConsent(true);
|
|
901
|
+
else
|
|
902
|
+
setShowConsent(true);
|
|
901
903
|
}
|
|
902
904
|
else {
|
|
905
|
+
console.warn(`[SxpDataSourceProvider] Layout variant ${id} not found in dataList (count: ${(dataList === null || dataList === void 0 ? void 0 : dataList.length) || 0}), using default page config`);
|
|
906
|
+
gldata = globalConfig;
|
|
903
907
|
setShowConsent(true);
|
|
904
908
|
}
|
|
905
909
|
}
|
|
910
|
+
else {
|
|
911
|
+
gldata = globalConfig;
|
|
912
|
+
setShowConsent(true);
|
|
913
|
+
}
|
|
906
914
|
}
|
|
907
915
|
else {
|
|
908
916
|
setShowConsent(true);
|
|
@@ -18,6 +18,7 @@ const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
|
|
|
18
18
|
const CommodityDetail = (_a) => {
|
|
19
19
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
20
20
|
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true, enableAddToCart = false, addToCartPopupId = '' } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive", "enableAddToCart", "addToCartPopupId"]);
|
|
21
|
+
console.log('[CommodityDetail] 组件已加载 - 版本 v1.20.23', { enableAddToCart, addToCartPopupId, isPost });
|
|
21
22
|
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig, ctaEvent, setPopupDetailData } = (0, hooks_1.useSxpDataSource)();
|
|
22
23
|
const { jumpToWeb, productView } = (0, useEventReport_1.useEventReport)();
|
|
23
24
|
const curTimeRef = (0, react_1.useRef)(null);
|
|
@@ -192,7 +193,7 @@ const CommodityDetail = (_a) => {
|
|
|
192
193
|
const renderBtn = () => {
|
|
193
194
|
var _a, _b;
|
|
194
195
|
const handleBtnClick = (e) => {
|
|
195
|
-
console.log('[CommodityDetail] Shop Now
|
|
196
|
+
console.log('[CommodityDetail] Shop Now 按钮被点击!!!!', {
|
|
196
197
|
product,
|
|
197
198
|
cta,
|
|
198
199
|
enableAddToCart,
|
|
@@ -201,9 +202,20 @@ const CommodityDetail = (_a) => {
|
|
|
201
202
|
});
|
|
202
203
|
handleLink(e);
|
|
203
204
|
};
|
|
205
|
+
console.log('[CommodityDetail] renderBtn 被调用', {
|
|
206
|
+
ctaTitle: cta === null || cta === void 0 ? void 0 : cta.enTitle,
|
|
207
|
+
buttonStyle
|
|
208
|
+
});
|
|
204
209
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
205
|
-
react_1.default.createElement("a", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', role: 'button', tabIndex: 0, onClick: handleBtnClick, onMouseDown: (e) =>
|
|
206
|
-
|
|
210
|
+
react_1.default.createElement("a", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', role: 'button', tabIndex: 0, onClick: handleBtnClick, onMouseDown: (e) => {
|
|
211
|
+
console.log('[CommodityDetail] mousedown 事件触发!!!', e);
|
|
212
|
+
e.stopPropagation();
|
|
213
|
+
}, onPointerDown: (e) => {
|
|
214
|
+
console.log('[CommodityDetail] pointerdown 事件触发!!!', e);
|
|
215
|
+
}, onTouchStart: (e) => {
|
|
216
|
+
console.log('[CommodityDetail] touchstart 事件触发!!!', e);
|
|
217
|
+
}, className: 'pb-commondity-btn', style: Object.assign(Object.assign({}, buttonStyle), { pointerEvents: 'auto', touchAction: 'manipulation' }) },
|
|
218
|
+
react_1.default.createElement("span", { style: { pointerEvents: 'none' }, dangerouslySetInnerHTML: {
|
|
207
219
|
__html: (0, tool_1.setFontForText)((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
|
|
208
220
|
} }))));
|
|
209
221
|
};
|