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.
Files changed (34) hide show
  1. package/dist/index.cjs +44 -43
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +1 -0
  4. package/dist/index.js +44 -43
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +44 -43
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/Modal/index.js +6 -3
  15. package/es/core/components/SxpPageRender/WaterFall/index.js +4 -6
  16. package/es/core/components/SxpPageRender/index.js +7 -10
  17. package/es/core/context/SxpDataSourceProvider.js +1 -0
  18. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
  19. package/es/materials/sxp/popup/CommodityDetail/index.js +8 -8
  20. package/es/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
  21. package/es/materials/sxp/popup/CommodityDetailDiro/index.js +15 -13
  22. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
  23. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +15 -13
  24. package/lib/core/components/SxpPageRender/Modal/index.js +5 -2
  25. package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -6
  26. package/lib/core/components/SxpPageRender/index.js +7 -10
  27. package/lib/core/context/SxpDataSourceProvider.js +1 -0
  28. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
  29. package/lib/materials/sxp/popup/CommodityDetail/index.js +8 -8
  30. package/lib/materials/sxp/popup/CommodityDetailDiro/index.d.ts +1 -0
  31. package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +15 -13
  32. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
  33. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +15 -13
  34. package/package.json +1 -1
package/dist/index.css CHANGED
@@ -574,6 +574,7 @@
574
574
  width: -webkit-fill-available;
575
575
  padding: 0;
576
576
  border: none;
577
+ display: block;
577
578
  }
578
579
  .commondityDiroNew-swiper-clickable-left {
579
580
  padding-left: 17px !important ;
package/dist/index.js CHANGED
@@ -842,6 +842,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
842
842
  }
843
843
  }
844
844
  catch (error) {
845
+ delete obj[key];
845
846
  console.error('An error occurred:', error === null || error === void 0 ? void 0 : error.message);
846
847
  }
847
848
  });
@@ -8953,7 +8954,7 @@ SwiperSlide.displayName = 'SwiperSlide';
8953
8954
  * @Author: binruan@chatlabs.com
8954
8955
  * @Date: 2023-11-02 18:34:34
8955
8956
  * @LastEditors: binruan@chatlabs.com
8956
- * @LastEditTime: 2024-10-11 18:18:41
8957
+ * @LastEditTime: 2024-10-23 16:44:34
8957
8958
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Modal\index.tsx
8958
8959
  *
8959
8960
  */
@@ -8970,7 +8971,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
8970
8971
  const [isShow, setIsShow] = useState(false);
8971
8972
  const modalEleRef = useRef(null);
8972
8973
  const { globalConfig, popupDetailData } = useSxpDataSource();
8973
- const { schema: _schema } = useEditor();
8974
+ const { schema: _schema, popup: _popup } = useEditor();
8974
8975
  const [scrollTop, setScrollTop] = useState(15);
8975
8976
  useEffect(() => {
8976
8977
  const parentNode = document.getElementById('sxp-render');
@@ -9008,6 +9009,9 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
9008
9009
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
9009
9010
  }
9010
9011
  }, [isOpen, popup]);
9012
+ const child = useCallback(() => {
9013
+ return children;
9014
+ }, [_popup]);
9011
9015
  if (!modalEleRef.current)
9012
9016
  return null;
9013
9017
  const handleClose = debounce(() => {
@@ -9093,7 +9097,7 @@ const Modal = ({ visible, onClose, children, modalStyle, padding, popup, schema,
9093
9097
  var _a;
9094
9098
  setScrollTop(15 - ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop));
9095
9099
  }
9096
- })), children)))))), modalEleRef.current);
9100
+ })), child())))))), modalEleRef.current);
9097
9101
  };
9098
9102
  var Modal$1 = memo(Modal);
9099
9103
 
@@ -9351,7 +9355,7 @@ const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef
9351
9355
 
9352
9356
  const CommodityDetail$1 = (_a) => {
9353
9357
  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;
9354
- 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"]);
9358
+ 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"]);
9355
9359
  const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
9356
9360
  const { jumpToWeb, productView } = useEventReport();
9357
9361
  const curTimeRef = useRef(null);
@@ -9381,17 +9385,17 @@ const CommodityDetail$1 = (_a) => {
9381
9385
  }
9382
9386
  };
9383
9387
  useEffect(() => {
9384
- if (!isPost) {
9385
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
9386
- eventName: 'ProductView',
9387
- product
9388
- });
9389
- }
9388
+ if (!isActive)
9389
+ return;
9390
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
9391
+ eventName: 'ProductView',
9392
+ product
9393
+ });
9390
9394
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
9391
9395
  eventName: 'PageView',
9392
9396
  product
9393
9397
  });
9394
- }, [isPost, bffFbReport]);
9398
+ }, [isActive, bffFbReport]);
9395
9399
  useEffect(() => {
9396
9400
  const initTime = () => {
9397
9401
  curTimeRef.current = new Date();
@@ -10233,7 +10237,7 @@ var settingRender$7 = [
10233
10237
 
10234
10238
  const CommodityDetailDiroNew$1 = (_a) => {
10235
10239
  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;
10236
- 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"]);
10240
+ 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"]);
10237
10241
  useState(true);
10238
10242
  const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef, globalConfig } = useSxpDataSource();
10239
10243
  const { jumpToWeb, productView } = useEventReport();
@@ -10267,19 +10271,21 @@ const CommodityDetailDiroNew$1 = (_a) => {
10267
10271
  }
10268
10272
  };
10269
10273
  useEffect(() => {
10270
- if (!isPost) {
10271
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10272
- eventName: 'ProductView',
10273
- product
10274
- });
10275
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10276
- eventName: 'PageView',
10277
- product
10278
- });
10279
- }
10280
- }, [isPost, bffFbReport]);
10274
+ if (!isActive)
10275
+ return;
10276
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10277
+ eventName: 'ProductView',
10278
+ product
10279
+ });
10280
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10281
+ eventName: 'PageView',
10282
+ product
10283
+ });
10284
+ }, [isActive, bffFbReport]);
10281
10285
  useEffect(() => {
10282
10286
  const initTime = () => {
10287
+ if (!isActive)
10288
+ return;
10283
10289
  curTimeRef.current = new Date();
10284
10290
  };
10285
10291
  initTime();
@@ -10287,7 +10293,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
10287
10293
  return () => {
10288
10294
  window.removeEventListener('pageshow', initTime);
10289
10295
  };
10290
- }, []);
10296
+ }, [isActive]);
10291
10297
  const priceText = getPriceText({
10292
10298
  product,
10293
10299
  enableFormattedPrice: (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice,
@@ -14451,7 +14457,7 @@ function WaterfallList(_a) {
14451
14457
  * @Author: binruan@chatlabs.com
14452
14458
  * @Date: 2024-01-10 10:58:24
14453
14459
  * @LastEditors: binruan@chatlabs.com
14454
- * @LastEditTime: 2024-10-18 18:59:47
14460
+ * @LastEditTime: 2024-10-23 16:58:01
14455
14461
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
14456
14462
  *
14457
14463
  */
@@ -14462,11 +14468,6 @@ const WaterFall = (props) => {
14462
14468
  useRef(null);
14463
14469
  const modalEleRef = useRef(null);
14464
14470
  const [viewTime, setViewTime] = useState();
14465
- useEffect(() => {
14466
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
14467
- eventName: 'PageView'
14468
- });
14469
- }, []);
14470
14471
  useEffect(() => {
14471
14472
  const parentNode = document.getElementById('sxp-render');
14472
14473
  const node = document.getElementById('water-fall');
@@ -14539,8 +14540,11 @@ const WaterFall = (props) => {
14539
14540
  useEffect(() => {
14540
14541
  if (openHashtag) {
14541
14542
  setViewTime(new Date());
14543
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
14544
+ eventName: 'PageView'
14545
+ });
14542
14546
  }
14543
- }, [openHashtag]);
14547
+ }, [openHashtag, bffFbReport]);
14544
14548
  useEffect(() => {
14545
14549
  const initTime = () => {
14546
14550
  setViewTime(new Date());
@@ -16365,7 +16369,7 @@ var Tagbar$1 = memo(Tagbar);
16365
16369
  * @Author: binruan@chatlabs.com
16366
16370
  * @Date: 2024-01-15 19:03:09
16367
16371
  * @LastEditors: binruan@chatlabs.com
16368
- * @LastEditTime: 2024-10-18 18:54:40
16372
+ * @LastEditTime: 2024-10-23 18:06:34
16369
16373
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
16370
16374
  *
16371
16375
  */
@@ -16573,7 +16577,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16573
16577
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
16574
16578
  const Component = withBindDataSource(t);
16575
16579
  const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
16576
- 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 })));
16580
+ 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 })));
16577
16581
  });
16578
16582
  }
16579
16583
  return null;
@@ -16709,7 +16713,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16709
16713
  }
16710
16714
  };
16711
16715
  const handleScrollEvent = (swiper) => {
16712
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
16716
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
16713
16717
  const item = data[swiper.previousIndex];
16714
16718
  if (!item)
16715
16719
  return;
@@ -16753,13 +16757,6 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16753
16757
  }
16754
16758
  // 商品浏览事件
16755
16759
  handleReportProductView(item);
16756
- const curItem = data[swiper.activeIndex];
16757
- 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)) {
16758
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16759
- eventName: 'ProductView',
16760
- product: (_t = curItem === null || curItem === void 0 ? void 0 : curItem.video) === null || _t === void 0 ? void 0 : _t.bindProduct
16761
- });
16762
- }
16763
16760
  viewTime.current = new Date();
16764
16761
  };
16765
16762
  const handleReportProductView = (item) => {
@@ -16778,7 +16775,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16778
16775
  }
16779
16776
  }, [openHashtag, data, activeIndex]);
16780
16777
  const handleViewImageStartEvent = (activeIndex) => {
16781
- var _a, _b, _c, _d, _e, _f, _g;
16778
+ var _a, _b, _c, _d, _e, _f, _g, _h;
16782
16779
  const item = data[activeIndex];
16783
16780
  // 如果是图片集则上报事件
16784
16781
  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)) {
@@ -16801,6 +16798,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
16801
16798
  eventName: 'ViewContent',
16802
16799
  product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
16803
16800
  });
16801
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16802
+ eventName: 'PageView',
16803
+ product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
16804
+ });
16804
16805
  }
16805
16806
  };
16806
16807
  const renderToggleButton = useCallback((visible) => {
@@ -17273,7 +17274,7 @@ var index$1 = memo(DiyPortalPreview);
17273
17274
  * @Author: binruan@chatlabs.com
17274
17275
  * @Date: 2023-10-31 10:56:01
17275
17276
  * @LastEditors: binruan@chatlabs.com
17276
- * @LastEditTime: 2024-08-23 10:28:15
17277
+ * @LastEditTime: 2024-10-23 15:07:29
17277
17278
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\Popup\index.tsx
17278
17279
  *
17279
17280
  */