pb-sxp-ui 1.7.0 → 1.7.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 +44 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.js +44 -43
- 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 +44 -43
- 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/components/SxpPageRender/Modal/index.js +6 -3
- package/es/core/components/SxpPageRender/WaterFall/index.js +4 -6
- package/es/core/components/SxpPageRender/index.js +7 -10
- package/es/core/context/SxpDataSourceProvider.js +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +8 -8
- package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +15 -13
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +15 -13
- package/lib/core/components/SxpPageRender/Modal/index.js +5 -2
- package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -6
- package/lib/core/components/SxpPageRender/index.js +7 -10
- package/lib/core/context/SxpDataSourceProvider.js +1 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +8 -8
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +15 -13
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +15 -13
- package/package.json +1 -1
package/dist/pb-ui.js
CHANGED
@@ -857,6 +857,7 @@
|
|
857
857
|
}
|
858
858
|
}
|
859
859
|
catch (error) {
|
860
|
+
delete obj[key];
|
860
861
|
console.error('An error occurred:', error === null || error === void 0 ? void 0 : error.message);
|
861
862
|
}
|
862
863
|
});
|
@@ -8968,7 +8969,7 @@
|
|
8968
8969
|
* @Author: binruan@chatlabs.com
|
8969
8970
|
* @Date: 2023-11-02 18:34:34
|
8970
8971
|
* @LastEditors: binruan@chatlabs.com
|
8971
|
-
* @LastEditTime: 2024-10-
|
8972
|
+
* @LastEditTime: 2024-10-23 16:44:34
|
8972
8973
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8973
8974
|
*
|
8974
8975
|
*/
|
@@ -8985,7 +8986,7 @@
|
|
8985
8986
|
const [isShow, setIsShow] = React.useState(false);
|
8986
8987
|
const modalEleRef = React.useRef(null);
|
8987
8988
|
const { globalConfig, popupDetailData } = useSxpDataSource();
|
8988
|
-
const { schema: _schema } = useEditor();
|
8989
|
+
const { schema: _schema, popup: _popup } = useEditor();
|
8989
8990
|
const [scrollTop, setScrollTop] = React.useState(15);
|
8990
8991
|
React.useEffect(() => {
|
8991
8992
|
const parentNode = document.getElementById('sxp-render');
|
@@ -9023,6 +9024,9 @@
|
|
9023
9024
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9024
9025
|
}
|
9025
9026
|
}, [isOpen, popup]);
|
9027
|
+
const child = React.useCallback(() => {
|
9028
|
+
return children;
|
9029
|
+
}, [_popup]);
|
9026
9030
|
if (!modalEleRef.current)
|
9027
9031
|
return null;
|
9028
9032
|
const handleClose = lodash.debounce(() => {
|
@@ -9108,7 +9112,7 @@
|
|
9108
9112
|
var _a;
|
9109
9113
|
setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
|
9110
9114
|
}
|
9111
|
-
})),
|
9115
|
+
})), child())))))), modalEleRef.current);
|
9112
9116
|
};
|
9113
9117
|
var Modal$1 = React.memo(Modal);
|
9114
9118
|
|
@@ -9366,7 +9370,7 @@
|
|
9366
9370
|
|
9367
9371
|
const CommodityDetail$1 = (_a) => {
|
9368
9372
|
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;
|
9369
|
-
var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor } = _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"]);
|
9373
|
+
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 } = _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"]);
|
9370
9374
|
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
9371
9375
|
const { jumpToWeb, productView } = useEventReport();
|
9372
9376
|
const curTimeRef = React.useRef(null);
|
@@ -9396,17 +9400,17 @@
|
|
9396
9400
|
}
|
9397
9401
|
};
|
9398
9402
|
React.useEffect(() => {
|
9399
|
-
if (!
|
9400
|
-
|
9401
|
-
|
9402
|
-
|
9403
|
-
|
9404
|
-
}
|
9403
|
+
if (!isActive)
|
9404
|
+
return;
|
9405
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
9406
|
+
eventName: 'ProductView',
|
9407
|
+
product
|
9408
|
+
});
|
9405
9409
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
9406
9410
|
eventName: 'PageView',
|
9407
9411
|
product
|
9408
9412
|
});
|
9409
|
-
}, [
|
9413
|
+
}, [isActive, bffFbReport]);
|
9410
9414
|
React.useEffect(() => {
|
9411
9415
|
const initTime = () => {
|
9412
9416
|
curTimeRef.current = new Date();
|
@@ -10248,7 +10252,7 @@
|
|
10248
10252
|
|
10249
10253
|
const CommodityDetailDiroNew$1 = (_a) => {
|
10250
10254
|
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, _1, _2, _3, _4;
|
10251
|
-
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor"]);
|
10255
|
+
var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive"]);
|
10252
10256
|
React.useState(true);
|
10253
10257
|
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
10254
10258
|
const { jumpToWeb, productView } = useEventReport();
|
@@ -10282,19 +10286,21 @@
|
|
10282
10286
|
}
|
10283
10287
|
};
|
10284
10288
|
React.useEffect(() => {
|
10285
|
-
if (!
|
10286
|
-
|
10287
|
-
|
10288
|
-
|
10289
|
-
|
10290
|
-
|
10291
|
-
|
10292
|
-
|
10293
|
-
|
10294
|
-
}
|
10295
|
-
}, [
|
10289
|
+
if (!isActive)
|
10290
|
+
return;
|
10291
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
10292
|
+
eventName: 'ProductView',
|
10293
|
+
product
|
10294
|
+
});
|
10295
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
10296
|
+
eventName: 'PageView',
|
10297
|
+
product
|
10298
|
+
});
|
10299
|
+
}, [isActive, bffFbReport]);
|
10296
10300
|
React.useEffect(() => {
|
10297
10301
|
const initTime = () => {
|
10302
|
+
if (!isActive)
|
10303
|
+
return;
|
10298
10304
|
curTimeRef.current = new Date();
|
10299
10305
|
};
|
10300
10306
|
initTime();
|
@@ -10302,7 +10308,7 @@
|
|
10302
10308
|
return () => {
|
10303
10309
|
window.removeEventListener('pageshow', initTime);
|
10304
10310
|
};
|
10305
|
-
}, []);
|
10311
|
+
}, [isActive]);
|
10306
10312
|
const priceText = getPriceText({
|
10307
10313
|
product,
|
10308
10314
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
@@ -14466,7 +14472,7 @@ Made in Italy` })));
|
|
14466
14472
|
* @Author: binruan@chatlabs.com
|
14467
14473
|
* @Date: 2024-01-10 10:58:24
|
14468
14474
|
* @LastEditors: binruan@chatlabs.com
|
14469
|
-
* @LastEditTime: 2024-10-
|
14475
|
+
* @LastEditTime: 2024-10-23 16:58:01
|
14470
14476
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
14471
14477
|
*
|
14472
14478
|
*/
|
@@ -14477,11 +14483,6 @@ Made in Italy` })));
|
|
14477
14483
|
React.useRef(null);
|
14478
14484
|
const modalEleRef = React.useRef(null);
|
14479
14485
|
const [viewTime, setViewTime] = React.useState();
|
14480
|
-
React.useEffect(() => {
|
14481
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
14482
|
-
eventName: 'PageView'
|
14483
|
-
});
|
14484
|
-
}, []);
|
14485
14486
|
React.useEffect(() => {
|
14486
14487
|
const parentNode = document.getElementById('sxp-render');
|
14487
14488
|
const node = document.getElementById('water-fall');
|
@@ -14554,8 +14555,11 @@ Made in Italy` })));
|
|
14554
14555
|
React.useEffect(() => {
|
14555
14556
|
if (openHashtag) {
|
14556
14557
|
setViewTime(new Date());
|
14558
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
14559
|
+
eventName: 'PageView'
|
14560
|
+
});
|
14557
14561
|
}
|
14558
|
-
}, [openHashtag]);
|
14562
|
+
}, [openHashtag, bffFbReport]);
|
14559
14563
|
React.useEffect(() => {
|
14560
14564
|
const initTime = () => {
|
14561
14565
|
setViewTime(new Date());
|
@@ -16380,7 +16384,7 @@ Made in Italy` })));
|
|
16380
16384
|
* @Author: binruan@chatlabs.com
|
16381
16385
|
* @Date: 2024-01-15 19:03:09
|
16382
16386
|
* @LastEditors: binruan@chatlabs.com
|
16383
|
-
* @LastEditTime: 2024-10-
|
16387
|
+
* @LastEditTime: 2024-10-23 18:06:34
|
16384
16388
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16385
16389
|
*
|
16386
16390
|
*/
|
@@ -16588,7 +16592,7 @@ Made in Italy` })));
|
|
16588
16592
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
16589
16593
|
const Component = withBindDataSource(t);
|
16590
16594
|
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
16591
|
-
return (React.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index })));
|
16595
|
+
return (React.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, viewTime: viewTime.current, rec: rec, isPost: true, tipText: tipText, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.style), { height: '100%', overflow: 'auto' }), index: index, isActive: activeIndex === index })));
|
16592
16596
|
});
|
16593
16597
|
}
|
16594
16598
|
return null;
|
@@ -16724,7 +16728,7 @@ Made in Italy` })));
|
|
16724
16728
|
}
|
16725
16729
|
};
|
16726
16730
|
const handleScrollEvent = (swiper) => {
|
16727
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
16731
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
16728
16732
|
const item = data[swiper.previousIndex];
|
16729
16733
|
if (!item)
|
16730
16734
|
return;
|
@@ -16768,13 +16772,6 @@ Made in Italy` })));
|
|
16768
16772
|
}
|
16769
16773
|
// 商品浏览事件
|
16770
16774
|
handleReportProductView(item);
|
16771
|
-
const curItem = data[swiper.activeIndex];
|
16772
|
-
if (!((_r = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _r === void 0 ? void 0 : _r.url) && !((_s = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _s === void 0 ? void 0 : _s.imgUrls) && (curItem === null || curItem === void 0 ? void 0 : curItem.product)) {
|
16773
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16774
|
-
eventName: 'ProductView',
|
16775
|
-
product: (_t = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _t === void 0 ? void 0 : _t.bindProduct
|
16776
|
-
});
|
16777
|
-
}
|
16778
16775
|
viewTime.current = new Date();
|
16779
16776
|
};
|
16780
16777
|
const handleReportProductView = (item) => {
|
@@ -16793,7 +16790,7 @@ Made in Italy` })));
|
|
16793
16790
|
}
|
16794
16791
|
}, [openHashtag, data, activeIndex]);
|
16795
16792
|
const handleViewImageStartEvent = (activeIndex) => {
|
16796
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
16793
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
16797
16794
|
const item = data[activeIndex];
|
16798
16795
|
// 如果是图片集则上报事件
|
16799
16796
|
if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
|
@@ -16816,6 +16813,10 @@ Made in Italy` })));
|
|
16816
16813
|
eventName: 'ViewContent',
|
16817
16814
|
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
16818
16815
|
});
|
16816
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16817
|
+
eventName: 'PageView',
|
16818
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
16819
|
+
});
|
16819
16820
|
}
|
16820
16821
|
};
|
16821
16822
|
const renderToggleButton = React.useCallback((visible) => {
|
@@ -17288,7 +17289,7 @@ Made in Italy` })));
|
|
17288
17289
|
* @Author: binruan@chatlabs.com
|
17289
17290
|
* @Date: 2023-10-31 10:56:01
|
17290
17291
|
* @LastEditors: binruan@chatlabs.com
|
17291
|
-
* @LastEditTime: 2024-
|
17292
|
+
* @LastEditTime: 2024-10-23 15:07:29
|
17292
17293
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
17293
17294
|
*
|
17294
17295
|
*/
|