pb-sxp-ui 1.1.2 → 1.2.0

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 (166) hide show
  1. package/dist/index.cjs +2260 -861
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +356 -175
  4. package/dist/index.js +2260 -861
  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 +2260 -861
  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/Pagebuilder/type.d.ts +1 -0
  15. package/es/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +0 -1
  16. package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +3 -3
  17. package/es/core/components/SxpPageRender/Hashtag/index.js +1 -3
  18. package/es/core/components/SxpPageRender/Modal/index.d.ts +3 -0
  19. package/es/core/components/SxpPageRender/Modal/index.js +70 -6
  20. package/es/core/components/SxpPageRender/Navbar.js +1 -1
  21. package/es/core/components/SxpPageRender/Popup/index.js +1 -1
  22. package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
  23. package/es/core/components/SxpPageRender/RenderCard.js +16 -12
  24. package/es/core/components/SxpPageRender/VideoWidget/index.js +10 -13
  25. package/es/core/components/SxpPageRender/WaterFall/List.js +1 -1
  26. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +1 -1
  27. package/es/core/components/SxpPageRender/index.d.ts +3 -3
  28. package/es/core/components/SxpPageRender/index.js +51 -17
  29. package/es/core/components/SxpPageRender/typing.d.ts +1 -0
  30. package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
  31. package/es/core/context/SxpDataSourceProvider.js +6 -3
  32. package/es/core/utils/localStore.d.ts +3 -0
  33. package/es/core/utils/localStore.js +8 -0
  34. package/es/materials/sxp/HashTag/material.js +1 -2
  35. package/es/materials/sxp/cta/AniLink/index.d.ts +14 -0
  36. package/es/materials/sxp/cta/AniLink/index.js +58 -0
  37. package/es/materials/sxp/cta/AniLink/interactionRender.d.ts +42 -0
  38. package/es/materials/sxp/cta/AniLink/interactionRender.js +50 -0
  39. package/es/materials/sxp/cta/AniLink/material.d.ts +2 -0
  40. package/es/materials/sxp/cta/AniLink/material.js +38 -0
  41. package/es/materials/sxp/cta/AniLink/settingRender.d.ts +73 -0
  42. package/es/materials/sxp/cta/AniLink/settingRender.js +103 -0
  43. package/es/materials/sxp/cta/AniLinkPopup/index.d.ts +17 -0
  44. package/es/materials/sxp/cta/AniLinkPopup/index.js +65 -0
  45. package/es/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +42 -0
  46. package/es/materials/sxp/cta/AniLinkPopup/interactionRender.js +50 -0
  47. package/es/materials/sxp/cta/AniLinkPopup/material.d.ts +2 -0
  48. package/es/materials/sxp/cta/AniLinkPopup/material.js +52 -0
  49. package/es/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +176 -0
  50. package/es/materials/sxp/cta/AniLinkPopup/settingRender.js +249 -0
  51. package/es/materials/sxp/cta/index.d.ts +2 -0
  52. package/es/materials/sxp/cta/index.js +2 -0
  53. package/es/materials/sxp/index.d.ts +1 -0
  54. package/es/materials/sxp/index.js +1 -0
  55. package/es/materials/sxp/popup/AppointForm/Form.js +1 -1
  56. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +5 -0
  57. package/es/materials/sxp/popup/CommodityDetail/index.js +43 -26
  58. package/es/materials/sxp/popup/CommodityDetail/interactionRender.d.ts +9 -0
  59. package/es/materials/sxp/popup/CommodityDetail/interactionRender.js +12 -0
  60. package/es/materials/sxp/popup/CommodityDetail/material.js +3 -1
  61. package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +37 -0
  62. package/es/materials/sxp/popup/CommodityDetail/settingRender.js +41 -0
  63. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +5 -0
  64. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +11 -25
  65. package/es/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.d.ts +9 -0
  66. package/es/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.js +12 -0
  67. package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +3 -1
  68. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +37 -0
  69. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +41 -0
  70. package/es/materials/sxp/popup/CommodityList/index.d.ts +28 -0
  71. package/es/materials/sxp/popup/CommodityList/index.js +56 -0
  72. package/es/materials/sxp/popup/CommodityList/interactionRender.d.ts +8 -0
  73. package/es/materials/sxp/popup/CommodityList/interactionRender.js +11 -0
  74. package/es/materials/sxp/popup/CommodityList/material.d.ts +2 -0
  75. package/es/materials/sxp/popup/CommodityList/material.js +51 -0
  76. package/es/materials/sxp/popup/CommodityList/settingRender.d.ts +151 -0
  77. package/es/materials/sxp/popup/CommodityList/settingRender.js +207 -0
  78. package/es/materials/sxp/popup/index.d.ts +1 -0
  79. package/es/materials/sxp/popup/index.js +1 -0
  80. package/es/materials/sxp/template/Link/index.js +2 -2
  81. package/es/materials/sxp/template/MultiCommodity/index.js +2 -2
  82. package/es/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
  83. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -4
  84. package/es/materials/sxp/template/components/CommodityGroup.d.ts +14 -0
  85. package/es/materials/sxp/template/components/CommodityGroup.js +31 -0
  86. package/es/materials/sxp/template/components/Img.js +1 -1
  87. package/es/materials/sxp/template/components/Scroll.d.ts +2 -1
  88. package/es/materials/sxp/template/components/Scroll.js +10 -3
  89. package/es/materials/sxp/template/components/settingRender.js +0 -5
  90. package/lib/core/Pagebuilder/type.d.ts +1 -0
  91. package/lib/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +0 -1
  92. package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +3 -3
  93. package/lib/core/components/SxpPageRender/Hashtag/index.js +1 -3
  94. package/lib/core/components/SxpPageRender/Modal/index.d.ts +3 -0
  95. package/lib/core/components/SxpPageRender/Modal/index.js +70 -6
  96. package/lib/core/components/SxpPageRender/Navbar.js +1 -1
  97. package/lib/core/components/SxpPageRender/Popup/index.js +1 -1
  98. package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
  99. package/lib/core/components/SxpPageRender/RenderCard.js +16 -12
  100. package/lib/core/components/SxpPageRender/VideoWidget/index.js +10 -13
  101. package/lib/core/components/SxpPageRender/WaterFall/List.js +1 -1
  102. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +1 -1
  103. package/lib/core/components/SxpPageRender/index.d.ts +3 -3
  104. package/lib/core/components/SxpPageRender/index.js +50 -16
  105. package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
  106. package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
  107. package/lib/core/context/SxpDataSourceProvider.js +6 -3
  108. package/lib/core/utils/localStore.d.ts +3 -0
  109. package/lib/core/utils/localStore.js +11 -1
  110. package/lib/materials/sxp/HashTag/material.js +1 -2
  111. package/lib/materials/sxp/cta/AniLink/index.d.ts +14 -0
  112. package/lib/materials/sxp/cta/AniLink/index.js +60 -0
  113. package/lib/materials/sxp/cta/AniLink/interactionRender.d.ts +42 -0
  114. package/lib/materials/sxp/cta/AniLink/interactionRender.js +52 -0
  115. package/lib/materials/sxp/cta/AniLink/material.d.ts +2 -0
  116. package/lib/materials/sxp/cta/AniLink/material.js +42 -0
  117. package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +73 -0
  118. package/lib/materials/sxp/cta/AniLink/settingRender.js +105 -0
  119. package/lib/materials/sxp/cta/AniLinkPopup/index.d.ts +17 -0
  120. package/lib/materials/sxp/cta/AniLinkPopup/index.js +67 -0
  121. package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +42 -0
  122. package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.js +52 -0
  123. package/lib/materials/sxp/cta/AniLinkPopup/material.d.ts +2 -0
  124. package/lib/materials/sxp/cta/AniLinkPopup/material.js +56 -0
  125. package/lib/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +176 -0
  126. package/lib/materials/sxp/cta/AniLinkPopup/settingRender.js +251 -0
  127. package/lib/materials/sxp/cta/index.d.ts +2 -0
  128. package/lib/materials/sxp/cta/index.js +5 -0
  129. package/lib/materials/sxp/index.d.ts +1 -0
  130. package/lib/materials/sxp/index.js +1 -0
  131. package/lib/materials/sxp/popup/AppointForm/Form.js +1 -1
  132. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +5 -0
  133. package/lib/materials/sxp/popup/CommodityDetail/index.js +43 -26
  134. package/lib/materials/sxp/popup/CommodityDetail/interactionRender.d.ts +9 -0
  135. package/lib/materials/sxp/popup/CommodityDetail/interactionRender.js +14 -0
  136. package/lib/materials/sxp/popup/CommodityDetail/material.js +3 -1
  137. package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +37 -0
  138. package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +41 -0
  139. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +5 -0
  140. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +11 -25
  141. package/lib/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.d.ts +9 -0
  142. package/lib/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.js +14 -0
  143. package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +3 -1
  144. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +37 -0
  145. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +41 -0
  146. package/lib/materials/sxp/popup/CommodityList/index.d.ts +28 -0
  147. package/lib/materials/sxp/popup/CommodityList/index.js +58 -0
  148. package/lib/materials/sxp/popup/CommodityList/interactionRender.d.ts +8 -0
  149. package/lib/materials/sxp/popup/CommodityList/interactionRender.js +13 -0
  150. package/lib/materials/sxp/popup/CommodityList/material.d.ts +2 -0
  151. package/lib/materials/sxp/popup/CommodityList/material.js +55 -0
  152. package/lib/materials/sxp/popup/CommodityList/settingRender.d.ts +151 -0
  153. package/lib/materials/sxp/popup/CommodityList/settingRender.js +209 -0
  154. package/lib/materials/sxp/popup/index.d.ts +1 -0
  155. package/lib/materials/sxp/popup/index.js +1 -0
  156. package/lib/materials/sxp/template/Link/index.js +2 -2
  157. package/lib/materials/sxp/template/MultiCommodity/index.js +2 -2
  158. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
  159. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -4
  160. package/lib/materials/sxp/template/components/CommodityGroup.d.ts +14 -0
  161. package/lib/materials/sxp/template/components/CommodityGroup.js +34 -0
  162. package/lib/materials/sxp/template/components/Img.js +1 -1
  163. package/lib/materials/sxp/template/components/Scroll.d.ts +2 -1
  164. package/lib/materials/sxp/template/components/Scroll.js +9 -2
  165. package/lib/materials/sxp/template/components/settingRender.js +0 -5
  166. package/package.json +1 -1
@@ -37,6 +37,47 @@ export default [
37
37
  }
38
38
  ]
39
39
  },
40
+ {
41
+ title: '多商品切换器',
42
+ child: [
43
+ {
44
+ type: 'Switch',
45
+ name: ['props', 'commodityGroup', 'open'],
46
+ label: '快速切换开关'
47
+ },
48
+ {
49
+ type: 'Group',
50
+ child: [
51
+ {
52
+ label: '居中垂直偏移',
53
+ type: 'Number',
54
+ name: ['props', 'commodityGroup', 'translateY'],
55
+ min: -1000,
56
+ addonAfter: '%',
57
+ initialValue: 0
58
+ }
59
+ ]
60
+ },
61
+ {
62
+ type: 'Group',
63
+ child: [
64
+ {
65
+ label: '上边距',
66
+ name: ['props', 'commodityGroup', 'style', 'marginTop'],
67
+ type: 'Number',
68
+ addonAfter: 'px',
69
+ initialValue: 20
70
+ },
71
+ {
72
+ label: '下边距',
73
+ name: ['props', 'commodityGroup', 'style', 'marginBottom'],
74
+ type: 'Number',
75
+ addonAfter: 'px'
76
+ }
77
+ ]
78
+ }
79
+ ]
80
+ },
40
81
  {
41
82
  title: '商品文本',
42
83
  child: [
@@ -31,6 +31,11 @@ export interface ICommodityDetailDiroNewProps {
31
31
  };
32
32
  buttonStyle?: CSSProperties;
33
33
  index?: number;
34
+ commodityGroup?: {
35
+ open?: boolean;
36
+ translateY?: number;
37
+ style?: CSSProperties;
38
+ };
34
39
  }
35
40
  declare const _default: React.NamedExoticComponent<ICommodityDetailDiroNewProps>;
36
41
  export default _default;
@@ -10,16 +10,14 @@ import ExpandableText from '../../../../core/components/SxpPageRender/Expandable
10
10
  import { useEventReport } from '../../../../core/hooks/useEventReport';
11
11
  import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
12
12
  import { setFontForText } from '../../../../core/utils/tool';
13
+ import CommodityGroup from '../../template/components/CommodityGroup';
13
14
  const CommodityDetailDiroNew = (_a) => {
14
15
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
15
- var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index"]);
16
+ var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
16
17
  const [spread, setSpread] = useState(true);
17
18
  const { sxpParameter } = useSxpDataSource();
18
19
  const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
19
20
  const { jumpToWeb, productView } = useEventReport();
20
- const scrollRef = useRef(null);
21
- const touchRef = useRef(null);
22
- const touchMoveRef = useRef(null);
23
21
  const [stopSlide, setStopSlide] = useState(false);
24
22
  const [isBottom, setIsBottom] = useState(false);
25
23
  const [isTop, setIsTop] = useState(true);
@@ -70,25 +68,6 @@ const CommodityDetailDiroNew = (_a) => {
70
68
  const handleClickCollapse = () => {
71
69
  setSpread(!spread);
72
70
  };
73
- const handleTouchStart = (event) => {
74
- event.stopPropagation();
75
- touchRef.current = event.touches[0].clientY;
76
- touchMoveRef.current = true;
77
- };
78
- const handleTouchMove = (event) => {
79
- var _a, _b, _c, _d;
80
- if (touchMoveRef.current) {
81
- touchMoveRef.current = false;
82
- const currentY = event.touches[0].clientY;
83
- const diff = touchRef.current - currentY;
84
- if (diff > 0 && (isBottom || !stopSlide)) {
85
- (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.slideNext();
86
- }
87
- else if (diff < 0 && (isTop || !stopSlide)) {
88
- (_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slidePrev();
89
- }
90
- }
91
- };
92
71
  const productInfoText = ({ isPost }) => {
93
72
  return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
94
73
  React.createElement(ExpandableText, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
@@ -101,8 +80,14 @@ Made in Italy` })));
101
80
  }
102
81
  return style;
103
82
  }, []);
83
+ const renderCommodityGroup = useCallback(() => {
84
+ var _a, _b, _c;
85
+ if (isPost)
86
+ return;
87
+ return (React.createElement(CommodityGroup, { products: (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts, data: commodityGroup, defImg: (_c = (_b = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _b !== void 0 ? _b : bottom_image) !== null && _c !== void 0 ? _c : '', style: { padding: '0 19px' } }));
88
+ }, []);
104
89
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
105
- React.createElement("div", Object.assign({ ref: scrollRef, className: css(Object.assign({}, style)) }, props),
90
+ React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
106
91
  product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
107
92
  clickable: true,
108
93
  bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
@@ -123,7 +108,7 @@ Made in Italy` })));
123
108
  width: '100%',
124
109
  objectFit: 'cover',
125
110
  display: 'block',
126
- objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
111
+ objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? -(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
127
112
  }, src: src }))));
128
113
  }))),
129
114
  !((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
@@ -140,6 +125,7 @@ Made in Italy` })));
140
125
  objectFit: 'cover',
141
126
  width: '100%'
142
127
  }), src: (_k = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _k !== void 0 ? _k : bottom_image, alt: 'pdp image' }))),
128
+ renderCommodityGroup(),
143
129
  React.createElement("div", { className: 'pb-commondityDiroNew-content' },
144
130
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
145
131
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
@@ -0,0 +1,9 @@
1
+ declare const _default: {
2
+ title: string;
3
+ child: {
4
+ type: string;
5
+ label: string;
6
+ name: string[];
7
+ }[];
8
+ }[];
9
+ export default _default;
@@ -0,0 +1,12 @@
1
+ export default [
2
+ {
3
+ title: '滑动事件',
4
+ child: [
5
+ {
6
+ type: 'Switch',
7
+ label: '滑动铺满全屏',
8
+ name: ['isScrollFullScreen']
9
+ }
10
+ ]
11
+ }
12
+ ];
@@ -1,13 +1,15 @@
1
1
  import settingRender from './settingRender';
2
2
  import CommodityDetailDiroNewComponent from '.';
3
3
  import { createMaterial } from '../../../../core/create';
4
+ import interactionRender from './interactionRender';
4
5
  const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
5
6
  displayName: '商品详情',
6
7
  icon: '',
7
8
  category: 'popup',
8
9
  type: 'CommodityDetailDiroNew',
9
10
  related: {
10
- settingRender
11
+ settingRender,
12
+ interactionRender
11
13
  },
12
14
  defaulSetting: {
13
15
  props: {
@@ -32,6 +32,43 @@ declare const _default: ({
32
32
  name?: undefined;
33
33
  addonAfter?: undefined;
34
34
  })[];
35
+ } | {
36
+ title: string;
37
+ child: ({
38
+ type: string;
39
+ name: string[];
40
+ label: string;
41
+ child?: undefined;
42
+ } | {
43
+ type: string;
44
+ child: {
45
+ label: string;
46
+ type: string;
47
+ name: string[];
48
+ min: number;
49
+ addonAfter: string;
50
+ initialValue: number;
51
+ }[];
52
+ name?: undefined;
53
+ label?: undefined;
54
+ } | {
55
+ type: string;
56
+ child: ({
57
+ label: string;
58
+ name: string[];
59
+ type: string;
60
+ addonAfter: string;
61
+ initialValue: number;
62
+ } | {
63
+ label: string;
64
+ name: string[];
65
+ type: string;
66
+ addonAfter: string;
67
+ initialValue?: undefined;
68
+ })[];
69
+ name?: undefined;
70
+ label?: undefined;
71
+ })[];
35
72
  } | {
36
73
  title: string;
37
74
  child: {
@@ -37,6 +37,47 @@ export default [
37
37
  }
38
38
  ]
39
39
  },
40
+ {
41
+ title: '多商品切换器',
42
+ child: [
43
+ {
44
+ type: 'Switch',
45
+ name: ['props', 'commodityGroup', 'open'],
46
+ label: '快速切换开关'
47
+ },
48
+ {
49
+ type: 'Group',
50
+ child: [
51
+ {
52
+ label: '居中垂直偏移',
53
+ type: 'Number',
54
+ name: ['props', 'commodityGroup', 'translateY'],
55
+ min: -1000,
56
+ addonAfter: '%',
57
+ initialValue: 0
58
+ }
59
+ ]
60
+ },
61
+ {
62
+ type: 'Group',
63
+ child: [
64
+ {
65
+ label: '上边距',
66
+ name: ['props', 'commodityGroup', 'style', 'marginTop'],
67
+ type: 'Number',
68
+ addonAfter: 'px',
69
+ initialValue: 20
70
+ },
71
+ {
72
+ label: '下边距',
73
+ name: ['props', 'commodityGroup', 'style', 'marginBottom'],
74
+ type: 'Number',
75
+ addonAfter: 'px'
76
+ }
77
+ ]
78
+ }
79
+ ]
80
+ },
40
81
  {
41
82
  title: '商品文本',
42
83
  child: [
@@ -0,0 +1,28 @@
1
+ import React, { CSSProperties } from 'react';
2
+ import { IEditorContext } from '../../../../core/context/EditorContext';
3
+ import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
4
+ import './index.less';
5
+ export interface ICommodityListProps {
6
+ content?: string;
7
+ style?: Record<string, any>;
8
+ bgImg?: Record<string, any> | string;
9
+ onClick?: () => void;
10
+ schema?: IEditorContext['schema'];
11
+ isDefault?: boolean;
12
+ rec?: RecItemType;
13
+ viewTime?: any;
14
+ isPost?: boolean;
15
+ bottom_image?: string;
16
+ commodityStyles?: {
17
+ title: CSSProperties;
18
+ collection: CSSProperties;
19
+ price: CSSProperties;
20
+ };
21
+ buttonStyle?: CSSProperties;
22
+ index?: number;
23
+ translateY?: number;
24
+ commodityPicture?: CSSProperties;
25
+ isExternalLink?: boolean;
26
+ }
27
+ declare const _default: React.NamedExoticComponent<ICommodityListProps>;
28
+ export default _default;
@@ -0,0 +1,56 @@
1
+ import { __rest } from "tslib";
2
+ import { css } from '@emotion/css';
3
+ import React, { memo, useCallback, useRef } from 'react';
4
+ import { useSxpDataSource } from '../../../../core/hooks';
5
+ import './index.less';
6
+ import { setFontForText } from '../../../../core/utils/tool';
7
+ import Img from '../../template/components/Img';
8
+ import EventProvider from '../../template/components/EventProvider';
9
+ const CommodityList = (_a) => {
10
+ var _b, _c;
11
+ var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, index, translateY = 0, commodityPicture, isExternalLink } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "index", "translateY", "commodityPicture", "isExternalLink"]);
12
+ const { sxpParameter } = useSxpDataSource();
13
+ const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = useSxpDataSource();
14
+ const curTimeRef = useRef(null);
15
+ const recData = isPost ? rec : popupDetailData;
16
+ const product = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [null, null, null, null];
17
+ const priceText = useCallback((product) => {
18
+ var _a, _b, _c, _d, _e;
19
+ if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
20
+ return `${(_c = (_b = (_a = product === null || product === void 0 ? void 0 : product.currency) === null || _a === void 0 ? void 0 : _a.split('-')[1]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== null && _c !== void 0 ? _c : ''}${(_e = (_d = product === null || product === void 0 ? void 0 : product.price) === null || _d === void 0 ? void 0 : _d.toLocaleString('zh', {
21
+ minimumFractionDigits: 0
22
+ })) !== null && _e !== void 0 ? _e : ''}`;
23
+ }
24
+ else {
25
+ return '$7,000';
26
+ }
27
+ }, []);
28
+ return (React.createElement("div", { className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
29
+ var _a, _b, _c, _d, _e, _f, _g, _h;
30
+ return (React.createElement(EventProvider, Object.assign({ key: index, isExternalLink: isExternalLink, rec: recData, index: index }, props, { className: css({
31
+ display: 'flex'
32
+ }) }),
33
+ React.createElement(Img, { 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: commodityPicture }),
34
+ React.createElement("div", null,
35
+ React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.title), dangerouslySetInnerHTML: {
36
+ __html: setFontForText((_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Pendant in Yellow Gold with Diamonds, Medium', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
37
+ } }),
38
+ React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection, hidden: !!item && (!(item === null || item === void 0 ? void 0 : item.collection) || (item === null || item === void 0 ? void 0 : item.collection) === ''), dangerouslySetInnerHTML: {
39
+ __html: setFontForText((_f = item === null || item === void 0 ? void 0 : item.collection) !== null && _f !== void 0 ? _f : 'Tiffany Lock', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
40
+ } }),
41
+ React.createElement("div", { className: css({
42
+ display: 'flex',
43
+ alignItems: 'flex-end',
44
+ justifyContent: 'space-between',
45
+ width: '100%',
46
+ overflow: 'hidden'
47
+ }) },
48
+ React.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
49
+ __html: setFontForText(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
50
+ } }),
51
+ React.createElement("div", { style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
52
+ __html: setFontForText((_h = (_g = item === null || item === void 0 ? void 0 : item.bindCta) === null || _g === void 0 ? void 0 : _g.enTitle) !== null && _h !== void 0 ? _h : 'Shop Now', buttonStyle)
53
+ } })))));
54
+ })));
55
+ };
56
+ export default memo(CommodityList);
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ title: string;
3
+ child: {
4
+ type: string;
5
+ name: string;
6
+ }[];
7
+ }[];
8
+ export default _default;
@@ -0,0 +1,11 @@
1
+ export default [
2
+ {
3
+ title: '点击事件',
4
+ child: [
5
+ {
6
+ type: 'link',
7
+ name: 'onClick'
8
+ }
9
+ ]
10
+ }
11
+ ];
@@ -0,0 +1,2 @@
1
+ declare const CommodityList: import("../../../../core/create").MaterialComponet<import(".").ICommodityListProps>;
2
+ export { CommodityList };
@@ -0,0 +1,51 @@
1
+ import settingRender from './settingRender';
2
+ import CommodityListComponent from '.';
3
+ import { createMaterial } from '../../../../core/create';
4
+ import interactionRender from './interactionRender';
5
+ const CommodityList = createMaterial(CommodityListComponent, {
6
+ displayName: '商品列表',
7
+ icon: '',
8
+ category: 'popup',
9
+ type: 'CommodityList',
10
+ related: {
11
+ settingRender,
12
+ interactionRender
13
+ },
14
+ defaulSetting: {
15
+ props: {
16
+ commodityPicture: {
17
+ width: 100,
18
+ height: 100,
19
+ marginRight: 10
20
+ },
21
+ commodityStyles: {
22
+ price: {
23
+ color: '#000',
24
+ fontWeight: 'bold',
25
+ fontSize: 14
26
+ },
27
+ title: {
28
+ color: '#000',
29
+ fontSize: 14
30
+ },
31
+ collection: {
32
+ color: '#757575',
33
+ fontSize: 12
34
+ }
35
+ },
36
+ buttonStyle: {
37
+ backgroundColor: '#000',
38
+ fontSize: 12,
39
+ height: 30,
40
+ textAlign: 'center',
41
+ color: '#fff',
42
+ lineHeight: 2.5
43
+ }
44
+ },
45
+ style: {}
46
+ },
47
+ w: 100,
48
+ h: 40,
49
+ sort: 1
50
+ });
51
+ export { CommodityList };
@@ -0,0 +1,151 @@
1
+ declare const _default: ({
2
+ title: string;
3
+ child: ({
4
+ type: string;
5
+ label: string;
6
+ child: {
7
+ type: string;
8
+ name: string[];
9
+ addonAfter: string;
10
+ }[];
11
+ addonAfter?: undefined;
12
+ name?: undefined;
13
+ min?: undefined;
14
+ initialValue?: undefined;
15
+ } | {
16
+ type: string;
17
+ label: string;
18
+ child: ({
19
+ type: string;
20
+ name: string[];
21
+ max: number;
22
+ addonAfter?: undefined;
23
+ } | {
24
+ type: string;
25
+ name: string[];
26
+ addonAfter: string;
27
+ max: number;
28
+ })[];
29
+ addonAfter?: undefined;
30
+ name?: undefined;
31
+ min?: undefined;
32
+ initialValue?: undefined;
33
+ } | {
34
+ type: string;
35
+ label: string;
36
+ addonAfter: string;
37
+ name: string[];
38
+ child?: undefined;
39
+ min?: undefined;
40
+ initialValue?: undefined;
41
+ } | {
42
+ label: string;
43
+ type: string;
44
+ name: string[];
45
+ min: number;
46
+ addonAfter: string;
47
+ initialValue: number;
48
+ child?: undefined;
49
+ })[];
50
+ } | {
51
+ title: string;
52
+ child: {
53
+ name: string[];
54
+ type: string;
55
+ child: ({
56
+ label: string;
57
+ type: string;
58
+ options: {
59
+ label: string;
60
+ value: string;
61
+ }[];
62
+ name: string[];
63
+ initialValue: string;
64
+ child?: undefined;
65
+ } | {
66
+ type: string;
67
+ label: string;
68
+ child: {
69
+ type: string;
70
+ name: string[];
71
+ bottomText: string;
72
+ }[];
73
+ options?: undefined;
74
+ name?: undefined;
75
+ initialValue?: undefined;
76
+ } | {
77
+ type: string;
78
+ label: string;
79
+ child: ({
80
+ type: string;
81
+ name: string[];
82
+ addonAfter?: undefined;
83
+ } | {
84
+ type: string;
85
+ addonAfter: string;
86
+ name: string[];
87
+ })[];
88
+ options?: undefined;
89
+ name?: undefined;
90
+ initialValue?: undefined;
91
+ } | {
92
+ label: string;
93
+ type: string;
94
+ options?: undefined;
95
+ name?: undefined;
96
+ initialValue?: undefined;
97
+ child?: undefined;
98
+ })[];
99
+ }[];
100
+ } | {
101
+ title: string;
102
+ child: ({
103
+ type: string;
104
+ label: string;
105
+ name: string[];
106
+ child?: undefined;
107
+ } | {
108
+ type: string;
109
+ label: string;
110
+ child: ({
111
+ type: string;
112
+ name: string[];
113
+ max: number;
114
+ addonAfter?: undefined;
115
+ } | {
116
+ type: string;
117
+ name: string[];
118
+ addonAfter: string;
119
+ max: number;
120
+ })[];
121
+ name?: undefined;
122
+ } | {
123
+ type: string;
124
+ name: string[];
125
+ label?: undefined;
126
+ child?: undefined;
127
+ } | {
128
+ type: string;
129
+ label: string;
130
+ child: {
131
+ type: string;
132
+ name: string[];
133
+ bottomText: string;
134
+ }[];
135
+ name?: undefined;
136
+ } | {
137
+ type: string;
138
+ label: string;
139
+ child: ({
140
+ type: string;
141
+ name: string[];
142
+ addonAfter?: undefined;
143
+ } | {
144
+ type: string;
145
+ addonAfter: string;
146
+ name: string[];
147
+ })[];
148
+ name?: undefined;
149
+ })[];
150
+ })[];
151
+ export default _default;