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/index.cjs
CHANGED
@@ -864,6 +864,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
864
864
|
}
|
865
865
|
}
|
866
866
|
catch (error) {
|
867
|
+
delete obj[key];
|
867
868
|
console.error('An error occurred:', error === null || error === void 0 ? void 0 : error.message);
|
868
869
|
}
|
869
870
|
});
|
@@ -8975,7 +8976,7 @@ SwiperSlide.displayName = 'SwiperSlide';
|
|
8975
8976
|
* @Author: binruan@chatlabs.com
|
8976
8977
|
* @Date: 2023-11-02 18:34:34
|
8977
8978
|
* @LastEditors: binruan@chatlabs.com
|
8978
|
-
* @LastEditTime: 2024-10-
|
8979
|
+
* @LastEditTime: 2024-10-23 16:44:34
|
8979
8980
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
|
8980
8981
|
*
|
8981
8982
|
*/
|
@@ -8992,7 +8993,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
8992
8993
|
const [isShow, setIsShow] = React.useState(false);
|
8993
8994
|
const modalEleRef = React.useRef(null);
|
8994
8995
|
const { globalConfig, popupDetailData } = useSxpDataSource();
|
8995
|
-
const { schema: _schema } = useEditor();
|
8996
|
+
const { schema: _schema, popup: _popup } = useEditor();
|
8996
8997
|
const [scrollTop, setScrollTop] = React.useState(15);
|
8997
8998
|
React.useEffect(() => {
|
8998
8999
|
const parentNode = document.getElementById('sxp-render');
|
@@ -9030,6 +9031,9 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
9030
9031
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
9031
9032
|
}
|
9032
9033
|
}, [isOpen, popup]);
|
9034
|
+
const child = React.useCallback(() => {
|
9035
|
+
return children;
|
9036
|
+
}, [_popup]);
|
9033
9037
|
if (!modalEleRef.current)
|
9034
9038
|
return null;
|
9035
9039
|
const handleClose = lodash.debounce(() => {
|
@@ -9115,7 +9119,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
|
|
9115
9119
|
var _a;
|
9116
9120
|
setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
|
9117
9121
|
}
|
9118
|
-
})),
|
9122
|
+
})), child())))))), modalEleRef.current);
|
9119
9123
|
};
|
9120
9124
|
var Modal$1 = React.memo(Modal);
|
9121
9125
|
|
@@ -9373,7 +9377,7 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
|
|
9373
9377
|
|
9374
9378
|
const CommodityDetail$1 = (_a) => {
|
9375
9379
|
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;
|
9376
|
-
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"]);
|
9380
|
+
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"]);
|
9377
9381
|
const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
9378
9382
|
const { jumpToWeb, productView } = useEventReport();
|
9379
9383
|
const curTimeRef = React.useRef(null);
|
@@ -9403,17 +9407,17 @@ const CommodityDetail$1 = (_a) => {
|
|
9403
9407
|
}
|
9404
9408
|
};
|
9405
9409
|
React.useEffect(() => {
|
9406
|
-
if (!
|
9407
|
-
|
9408
|
-
|
9409
|
-
|
9410
|
-
|
9411
|
-
}
|
9410
|
+
if (!isActive)
|
9411
|
+
return;
|
9412
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
9413
|
+
eventName: 'ProductView',
|
9414
|
+
product
|
9415
|
+
});
|
9412
9416
|
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
9413
9417
|
eventName: 'PageView',
|
9414
9418
|
product
|
9415
9419
|
});
|
9416
|
-
}, [
|
9420
|
+
}, [isActive, bffFbReport]);
|
9417
9421
|
React.useEffect(() => {
|
9418
9422
|
const initTime = () => {
|
9419
9423
|
curTimeRef.current = new Date();
|
@@ -10255,7 +10259,7 @@ var settingRender$7 = [
|
|
10255
10259
|
|
10256
10260
|
const CommodityDetailDiroNew$1 = (_a) => {
|
10257
10261
|
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;
|
10258
|
-
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"]);
|
10262
|
+
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"]);
|
10259
10263
|
React.useState(true);
|
10260
10264
|
const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
|
10261
10265
|
const { jumpToWeb, productView } = useEventReport();
|
@@ -10289,19 +10293,21 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
10289
10293
|
}
|
10290
10294
|
};
|
10291
10295
|
React.useEffect(() => {
|
10292
|
-
if (!
|
10293
|
-
|
10294
|
-
|
10295
|
-
|
10296
|
-
|
10297
|
-
|
10298
|
-
|
10299
|
-
|
10300
|
-
|
10301
|
-
}
|
10302
|
-
}, [
|
10296
|
+
if (!isActive)
|
10297
|
+
return;
|
10298
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
10299
|
+
eventName: 'ProductView',
|
10300
|
+
product
|
10301
|
+
});
|
10302
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
10303
|
+
eventName: 'PageView',
|
10304
|
+
product
|
10305
|
+
});
|
10306
|
+
}, [isActive, bffFbReport]);
|
10303
10307
|
React.useEffect(() => {
|
10304
10308
|
const initTime = () => {
|
10309
|
+
if (!isActive)
|
10310
|
+
return;
|
10305
10311
|
curTimeRef.current = new Date();
|
10306
10312
|
};
|
10307
10313
|
initTime();
|
@@ -10309,7 +10315,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
|
|
10309
10315
|
return () => {
|
10310
10316
|
window.removeEventListener('pageshow', initTime);
|
10311
10317
|
};
|
10312
|
-
}, []);
|
10318
|
+
}, [isActive]);
|
10313
10319
|
const priceText = getPriceText({
|
10314
10320
|
product,
|
10315
10321
|
enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
|
@@ -14473,7 +14479,7 @@ function WaterfallList(_a) {
|
|
14473
14479
|
* @Author: binruan@chatlabs.com
|
14474
14480
|
* @Date: 2024-01-10 10:58:24
|
14475
14481
|
* @LastEditors: binruan@chatlabs.com
|
14476
|
-
* @LastEditTime: 2024-10-
|
14482
|
+
* @LastEditTime: 2024-10-23 16:58:01
|
14477
14483
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
|
14478
14484
|
*
|
14479
14485
|
*/
|
@@ -14484,11 +14490,6 @@ const WaterFall = (props) => {
|
|
14484
14490
|
React.useRef(null);
|
14485
14491
|
const modalEleRef = React.useRef(null);
|
14486
14492
|
const [viewTime, setViewTime] = React.useState();
|
14487
|
-
React.useEffect(() => {
|
14488
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
14489
|
-
eventName: 'PageView'
|
14490
|
-
});
|
14491
|
-
}, []);
|
14492
14493
|
React.useEffect(() => {
|
14493
14494
|
const parentNode = document.getElementById('sxp-render');
|
14494
14495
|
const node = document.getElementById('water-fall');
|
@@ -14561,8 +14562,11 @@ const WaterFall = (props) => {
|
|
14561
14562
|
React.useEffect(() => {
|
14562
14563
|
if (openHashtag) {
|
14563
14564
|
setViewTime(new Date());
|
14565
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
14566
|
+
eventName: 'PageView'
|
14567
|
+
});
|
14564
14568
|
}
|
14565
|
-
}, [openHashtag]);
|
14569
|
+
}, [openHashtag, bffFbReport]);
|
14566
14570
|
React.useEffect(() => {
|
14567
14571
|
const initTime = () => {
|
14568
14572
|
setViewTime(new Date());
|
@@ -16387,7 +16391,7 @@ var Tagbar$1 = React.memo(Tagbar);
|
|
16387
16391
|
* @Author: binruan@chatlabs.com
|
16388
16392
|
* @Date: 2024-01-15 19:03:09
|
16389
16393
|
* @LastEditors: binruan@chatlabs.com
|
16390
|
-
* @LastEditTime: 2024-10-
|
16394
|
+
* @LastEditTime: 2024-10-23 18:06:34
|
16391
16395
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
|
16392
16396
|
*
|
16393
16397
|
*/
|
@@ -16595,7 +16599,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16595
16599
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
16596
16600
|
const Component = withBindDataSource(t);
|
16597
16601
|
const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
|
16598
|
-
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 })));
|
16602
|
+
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 })));
|
16599
16603
|
});
|
16600
16604
|
}
|
16601
16605
|
return null;
|
@@ -16731,7 +16735,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16731
16735
|
}
|
16732
16736
|
};
|
16733
16737
|
const handleScrollEvent = (swiper) => {
|
16734
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q
|
16738
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
16735
16739
|
const item = data[swiper.previousIndex];
|
16736
16740
|
if (!item)
|
16737
16741
|
return;
|
@@ -16775,13 +16779,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16775
16779
|
}
|
16776
16780
|
// 商品浏览事件
|
16777
16781
|
handleReportProductView(item);
|
16778
|
-
const curItem = data[swiper.activeIndex];
|
16779
|
-
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)) {
|
16780
|
-
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16781
|
-
eventName: 'ProductView',
|
16782
|
-
product: (_t = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _t === void 0 ? void 0 : _t.bindProduct
|
16783
|
-
});
|
16784
|
-
}
|
16785
16782
|
viewTime.current = new Date();
|
16786
16783
|
};
|
16787
16784
|
const handleReportProductView = (item) => {
|
@@ -16800,7 +16797,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16800
16797
|
}
|
16801
16798
|
}, [openHashtag, data, activeIndex]);
|
16802
16799
|
const handleViewImageStartEvent = (activeIndex) => {
|
16803
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
16800
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
16804
16801
|
const item = data[activeIndex];
|
16805
16802
|
// 如果是图片集则上报事件
|
16806
16803
|
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)) {
|
@@ -16823,6 +16820,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
16823
16820
|
eventName: 'ViewContent',
|
16824
16821
|
product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
|
16825
16822
|
});
|
16823
|
+
bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
|
16824
|
+
eventName: 'PageView',
|
16825
|
+
product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
|
16826
|
+
});
|
16826
16827
|
}
|
16827
16828
|
};
|
16828
16829
|
const renderToggleButton = React.useCallback((visible) => {
|
@@ -17295,7 +17296,7 @@ var index$1 = React.memo(DiyPortalPreview);
|
|
17295
17296
|
* @Author: binruan@chatlabs.com
|
17296
17297
|
* @Date: 2023-10-31 10:56:01
|
17297
17298
|
* @LastEditors: binruan@chatlabs.com
|
17298
|
-
* @LastEditTime: 2024-
|
17299
|
+
* @LastEditTime: 2024-10-23 15:07:29
|
17299
17300
|
* @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
|
17300
17301
|
*
|
17301
17302
|
*/
|