pb-sxp-ui 1.0.88 → 1.0.89

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 (43) hide show
  1. package/dist/index.cjs +151 -211
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +151 -211
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +4 -3
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +4 -3
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +154 -214
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +4 -3
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/SxpPageRender/FormatImage.js +2 -7
  14. package/es/core/components/SxpPageRender/VideoWidget/index.js +39 -31
  15. package/es/core/components/SxpPageRender/index.js +20 -35
  16. package/es/materials/sxp/popup/AppointForm/index.js +1 -3
  17. package/es/materials/sxp/template/Appoint/index.js +7 -6
  18. package/es/materials/sxp/template/Commodity/index.js +7 -14
  19. package/es/materials/sxp/template/CommodityDiro/index.js +7 -14
  20. package/es/materials/sxp/template/CommodityDiroNew/index.js +7 -14
  21. package/es/materials/sxp/template/Link/index.js +5 -5
  22. package/es/materials/sxp/template/MultiCommodity/index.js +3 -6
  23. package/es/materials/sxp/template/MultiCommodityDiro/index.js +3 -6
  24. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +3 -6
  25. package/es/materials/sxp/template/components/EventProvider.js +1 -13
  26. package/es/materials/sxp/template/components/Img.d.ts +5 -3
  27. package/es/materials/sxp/template/components/Img.js +4 -3
  28. package/lib/core/components/SxpPageRender/FormatImage.js +2 -7
  29. package/lib/core/components/SxpPageRender/VideoWidget/index.js +39 -31
  30. package/lib/core/components/SxpPageRender/index.js +20 -35
  31. package/lib/materials/sxp/popup/AppointForm/index.js +1 -3
  32. package/lib/materials/sxp/template/Appoint/index.js +7 -6
  33. package/lib/materials/sxp/template/Commodity/index.js +7 -14
  34. package/lib/materials/sxp/template/CommodityDiro/index.js +7 -14
  35. package/lib/materials/sxp/template/CommodityDiroNew/index.js +7 -14
  36. package/lib/materials/sxp/template/Link/index.js +5 -5
  37. package/lib/materials/sxp/template/MultiCommodity/index.js +3 -6
  38. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +3 -6
  39. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +3 -6
  40. package/lib/materials/sxp/template/components/EventProvider.js +0 -12
  41. package/lib/materials/sxp/template/components/Img.d.ts +5 -3
  42. package/lib/materials/sxp/template/components/Img.js +4 -3
  43. package/package.json +2 -4
@@ -35,11 +35,8 @@ const MultiCommodityDiroNew = (_a) => {
35
35
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
36
36
  return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
37
37
  var _a, _b, _c, _d, _e, _f, _g;
38
- return (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
39
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
40
- react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, style: {
41
- objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
42
- } })),
38
+ return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ key: item === null || item === void 0 ? void 0 : item.itemId, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
39
+ react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
43
40
  react_1.default.createElement("div", { className: (0, css_1.css)({
44
41
  color: '#fff',
45
42
  display: 'flex',
@@ -50,7 +47,7 @@ const MultiCommodityDiroNew = (_a) => {
50
47
  lineHeight: '20px'
51
48
  }) },
52
49
  react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
53
- react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop now'))));
50
+ react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop now'))))));
54
51
  })));
55
52
  };
56
53
  exports.default = (0, react_1.memo)(MultiCommodityDiroNew);
@@ -3,26 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  const lodash_1 = require("lodash");
6
- const useOnScreen_1 = tslib_1.__importDefault(require("../../../../core/hooks/useOnScreen"));
7
6
  const hooks_1 = require("../../../../core/hooks");
8
7
  const useEventReport_1 = require("../../../../core/hooks/useEventReport");
9
8
  const EventProvider = (_a) => {
10
9
  var { rec, children, className, onClick, style, isExternalLink = false, index } = _a, props = tslib_1.__rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
11
10
  const ref = (0, react_1.useRef)(null);
12
- const isOnScreen = (0, useOnScreen_1.default)(ref);
13
11
  const { popup } = (0, hooks_1.useEditor)();
14
12
  const { setPopupDetailData, ctaEvent } = (0, hooks_1.useSxpDataSource)();
15
13
  const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
16
- (0, react_1.useEffect)(() => {
17
- var _a, _b;
18
- if (isOnScreen && (ref === null || ref === void 0 ? void 0 : ref.current)) {
19
- const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
20
- ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
21
- eventSubject: 'ctaExposure',
22
- eventDescription: 'The cta was shown to the user'
23
- }, rec, item, index);
24
- }
25
- }, [isOnScreen, ref, rec, ctaEvent, index]);
26
14
  const handleClick = (0, lodash_1.throttle)(() => {
27
15
  var _a, _b, _c, _d, _e, _f, _g, _h;
28
16
  const item = (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
@@ -1,11 +1,13 @@
1
1
  import React, { CSSProperties } from 'react';
2
- import { ProductInfoType, RecItemType } from '../../../../core/components/SxpPageRender/typing';
2
+ import { ProductInfoType, RecItemType, VideoInfoType } from '../../../../core/components/SxpPageRender/typing';
3
3
  export interface IImgProps {
4
- src: string;
4
+ src?: string;
5
5
  rec?: RecItemType;
6
- item?: ProductInfoType;
6
+ item?: ProductInfoType | VideoInfoType | null;
7
7
  index?: number;
8
8
  style?: CSSProperties;
9
+ translateY?: number;
10
+ imgStyle?: CSSProperties;
9
11
  }
10
12
  declare const _default: React.NamedExoticComponent<IImgProps>;
11
13
  export default _default;
@@ -6,7 +6,7 @@ const react_1 = tslib_1.__importStar(require("react"));
6
6
  const useOnScreen_1 = tslib_1.__importDefault(require("../../../../core/hooks/useOnScreen"));
7
7
  const hooks_1 = require("../../../../core/hooks");
8
8
  const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
9
- const Img = ({ src, rec, item, index, style }) => {
9
+ const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
10
10
  const ref = (0, react_1.useRef)(null);
11
11
  const isOnScreen = (0, useOnScreen_1.default)(ref);
12
12
  const { ctaEvent } = (0, hooks_1.useSxpDataSource)();
@@ -18,7 +18,8 @@ const Img = ({ src, rec, item, index, style }) => {
18
18
  }, rec, item, index);
19
19
  }
20
20
  }, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
21
- return (react_1.default.createElement("div", { ref: ref, hidden: !src, className: (0, css_1.css)({ width: '100%', height: '100%' }) },
22
- react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }, style)), src: src })));
21
+ return (react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, imgStyle)) },
22
+ react_1.default.createElement("div", { ref: ref, hidden: !src, className: (0, css_1.css)({ width: '100%', height: '100%' }) },
23
+ react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block', objectPosition: `50% ${translateY ? -translateY + 50 : 50}%` }, style)), src: `${src}?imrquality/rquality/40` }))));
23
24
  };
24
25
  exports.default = (0, react_1.memo)(Img);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.0.88",
3
+ "version": "1.0.89",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -27,7 +27,6 @@
27
27
  "README.md"
28
28
  ],
29
29
  "keywords": [
30
- "antd",
31
30
  "react",
32
31
  "react-component",
33
32
  "ui",
@@ -37,11 +36,10 @@
37
36
  "author": "frontend@chatlabs.cn",
38
37
  "license": "MIT",
39
38
  "dependencies": {
40
- "@ant-design/pro-components": "^2.6.35",
41
39
  "@emotion/css": "^11.11.2",
42
- "antd": "^5.15.3",
43
40
  "eslint": "^8.48.0",
44
41
  "eventemitter3": "^5.0.1",
42
+ "hls.js": "^1.5.11",
45
43
  "less": "^4.2.0",
46
44
  "lodash": "^4.17.21",
47
45
  "pako": "^2.1.0",