pb-sxp-ui 1.2.9 → 1.3.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 (96) hide show
  1. package/dist/index.cjs +611 -260
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +62 -2
  4. package/dist/index.js +611 -260
  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 +611 -260
  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/FormatImage.js +19 -17
  15. package/es/core/components/SxpPageRender/Modal/index.js +33 -20
  16. package/es/core/components/SxpPageRender/Popup/index.js +2 -2
  17. package/es/core/components/SxpPageRender/ToggleButton/index.js +4 -1
  18. package/es/core/components/SxpPageRender/WaterFall/List.js +5 -14
  19. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +5 -14
  20. package/es/core/components/SxpPageRender/index.d.ts +6 -1
  21. package/es/core/components/SxpPageRender/index.js +46 -23
  22. package/es/core/components/SxpPageRender/typing.d.ts +2 -0
  23. package/es/core/context/SxpDataSourceProvider.d.ts +3 -2
  24. package/es/core/context/SxpDataSourceProvider.js +27 -30
  25. package/es/core/hooks/useEventReport.js +9 -8
  26. package/es/core/utils/tool.d.ts +5 -1
  27. package/es/core/utils/tool.js +69 -1
  28. package/es/materials/sxp/popup/AppointForm/settingRender.js +15 -0
  29. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +10 -1
  30. package/es/materials/sxp/popup/CommodityDetail/index.js +46 -28
  31. package/es/materials/sxp/popup/CommodityDetail/material.js +4 -0
  32. package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +21 -2
  33. package/es/materials/sxp/popup/CommodityDetail/settingRender.js +46 -0
  34. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +10 -1
  35. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +72 -46
  36. package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
  37. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +21 -2
  38. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +46 -0
  39. package/es/materials/sxp/popup/CommodityList/settingRender.js +15 -0
  40. package/es/materials/sxp/popup/Iframe/index.d.ts +16 -0
  41. package/es/materials/sxp/popup/Iframe/index.js +18 -0
  42. package/es/materials/sxp/popup/Iframe/material.d.ts +2 -0
  43. package/es/materials/sxp/popup/Iframe/material.js +21 -0
  44. package/es/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
  45. package/es/materials/sxp/popup/Iframe/settingRender.js +12 -0
  46. package/es/materials/sxp/popup/Prompt/settingRender.js +16 -1
  47. package/es/materials/sxp/popup/index.d.ts +1 -0
  48. package/es/materials/sxp/popup/index.js +1 -0
  49. package/es/materials/sxp/template/Link/index.js +5 -11
  50. package/es/materials/sxp/template/Link/interactionRender.d.ts +8 -0
  51. package/es/materials/sxp/template/Link/interactionRender.js +11 -0
  52. package/es/materials/sxp/template/Link/material.js +3 -1
  53. package/es/materials/sxp/template/components/EventProvider.d.ts +3 -2
  54. package/es/materials/sxp/template/components/EventProvider.js +3 -3
  55. package/lib/core/components/SxpPageRender/FormatImage.js +19 -17
  56. package/lib/core/components/SxpPageRender/Modal/index.js +33 -20
  57. package/lib/core/components/SxpPageRender/Popup/index.js +2 -2
  58. package/lib/core/components/SxpPageRender/ToggleButton/index.js +3 -0
  59. package/lib/core/components/SxpPageRender/WaterFall/List.js +5 -14
  60. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +5 -14
  61. package/lib/core/components/SxpPageRender/index.d.ts +6 -1
  62. package/lib/core/components/SxpPageRender/index.js +46 -23
  63. package/lib/core/components/SxpPageRender/typing.d.ts +2 -0
  64. package/lib/core/context/SxpDataSourceProvider.d.ts +3 -2
  65. package/lib/core/context/SxpDataSourceProvider.js +27 -30
  66. package/lib/core/hooks/useEventReport.js +9 -8
  67. package/lib/core/utils/tool.d.ts +5 -1
  68. package/lib/core/utils/tool.js +73 -1
  69. package/lib/materials/sxp/popup/AppointForm/settingRender.js +15 -0
  70. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +10 -1
  71. package/lib/materials/sxp/popup/CommodityDetail/index.js +46 -28
  72. package/lib/materials/sxp/popup/CommodityDetail/material.js +4 -0
  73. package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +21 -2
  74. package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +46 -0
  75. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +10 -1
  76. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +72 -46
  77. package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
  78. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +21 -2
  79. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +46 -0
  80. package/lib/materials/sxp/popup/CommodityList/settingRender.js +15 -0
  81. package/lib/materials/sxp/popup/Iframe/index.d.ts +16 -0
  82. package/lib/materials/sxp/popup/Iframe/index.js +20 -0
  83. package/lib/materials/sxp/popup/Iframe/material.d.ts +2 -0
  84. package/lib/materials/sxp/popup/Iframe/material.js +25 -0
  85. package/lib/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
  86. package/lib/materials/sxp/popup/Iframe/settingRender.js +14 -0
  87. package/lib/materials/sxp/popup/Prompt/settingRender.js +16 -1
  88. package/lib/materials/sxp/popup/index.d.ts +1 -0
  89. package/lib/materials/sxp/popup/index.js +1 -0
  90. package/lib/materials/sxp/template/Link/index.js +5 -11
  91. package/lib/materials/sxp/template/Link/interactionRender.d.ts +8 -0
  92. package/lib/materials/sxp/template/Link/interactionRender.js +13 -0
  93. package/lib/materials/sxp/template/Link/material.js +3 -1
  94. package/lib/materials/sxp/template/components/EventProvider.d.ts +3 -2
  95. package/lib/materials/sxp/template/components/EventProvider.js +3 -3
  96. package/package.json +1 -1
@@ -12,8 +12,8 @@ import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
12
12
  import { setFontForText } from '../../../../core/utils/tool';
13
13
  import CommodityGroup from '../../template/components/CommodityGroup';
14
14
  const CommodityDetailDiroNew = (_a) => {
15
- 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;
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"]);
15
+ 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, _5, _6, _7, _8;
16
+ var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio } = _a, props = __rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio"]);
17
17
  const [spread, setSpread] = useState(true);
18
18
  const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef } = useSxpDataSource();
19
19
  const { jumpToWeb, productView } = useEventReport();
@@ -22,6 +22,7 @@ const CommodityDetailDiroNew = (_a) => {
22
22
  const [isTop, setIsTop] = useState(true);
23
23
  const [showModal, setShowModal] = useState(false);
24
24
  const curTimeRef = useRef(null);
25
+ const [show3DModal, setShow3DModal] = useState(false);
25
26
  const [checkCommodityIndex, setCheckCommodityIndex] = useState((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
26
27
  const data = isPost ? rec : popupDetailData;
27
28
  let product = isPost ? data === null || data === void 0 ? void 0 : data.product : (_d = (_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct) !== null && _d !== void 0 ? _d : (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProducts) === null || _f === void 0 ? void 0 : _f[0];
@@ -72,7 +73,8 @@ const CommodityDetailDiroNew = (_a) => {
72
73
  return '£102,300.00';
73
74
  }
74
75
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
75
- const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
76
+ const width = (isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth) - ((_u = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _u !== void 0 ? _u : 0) * 2;
77
+ const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
76
78
  const handleClickCollapse = () => {
77
79
  setSpread(!spread);
78
80
  };
@@ -99,52 +101,69 @@ Made in Italy` })));
99
101
  return;
100
102
  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' }, onCLick: handleClick, popupDetailData: popupDetailData, check: checkCommodityIndex }));
101
103
  }, [checkCommodityIndex]);
104
+ const getDotsAlign = useMemo(() => {
105
+ const dotsAlignClass = {
106
+ left: 'commondityDetail-swiper-clickable-left',
107
+ center: 'commondityDetail-swiper-clickable-center',
108
+ right: 'commondityDetail-swiper-clickable-right'
109
+ };
110
+ return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
111
+ }, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
112
+ const iframeUrl = ((_w = (_v = data === null || data === void 0 ? void 0 : data.video) === null || _v === void 0 ? void 0 : _v.bindProduct) === null || _w === void 0 ? void 0 : _w.remark) || ((_z = (_y = (_x = data === null || data === void 0 ? void 0 : data.video) === null || _x === void 0 ? void 0 : _x.bindProducts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.remark) || ((_0 = data === null || data === void 0 ? void 0 : data.product) === null || _0 === void 0 ? void 0 : _0.remark);
102
113
  return (React.createElement("div", { className: 'pb-commondityDiroNew' },
103
114
  React.createElement("div", Object.assign({ className: css(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
104
- product && ((_u = product === null || product === void 0 ? void 0 : product.homePage) === null || _u === void 0 ? void 0 : _u.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
105
- clickable: true,
106
- bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
107
- clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
108
- ? 'commondityDiroNew-swiper-clickable-left'
109
- : 'commondityDiroNew-swiper-clickable-center'
110
- }, loop: true, autoplay: {
111
- delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
112
- } }, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
113
- var _a;
114
- return (React.createElement(SwiperSlide, { key: src },
115
- React.createElement("div", { style: {
116
- overflow: 'hidden',
117
- width,
118
- height: width
119
- } },
120
- React.createElement(FormatImage, { style: {
121
- height: '100%',
122
- width: '100%',
123
- objectFit: 'cover',
124
- display: 'block',
125
- objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
126
- }, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
127
- }))),
128
- !((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (React.createElement("div", { className: css({
129
- position: 'relative',
130
- height: 0,
131
- width: '100%',
132
- paddingBottom: '100%',
133
- overflow: 'hidden'
134
- }) },
135
- React.createElement("img", { className: css({
136
- position: 'absolute',
137
- left: 0,
138
- top: 0,
139
- objectFit: 'cover',
140
- width: '100%'
141
- }), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
115
+ React.createElement("div", { style: { position: 'relative' } },
116
+ product && ((_1 = product === null || product === void 0 ? void 0 : product.homePage) === null || _1 === void 0 ? void 0 : _1.length) > 0 && (React.createElement(Swiper, { height: height, modules: [Pagination, Autoplay], pagination: {
117
+ clickable: true,
118
+ bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
119
+ clickableClass: getDotsAlign
120
+ }, loop: true, autoplay: {
121
+ delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
122
+ } }, (_2 = product === null || product === void 0 ? void 0 : product.homePage) === null || _2 === void 0 ? void 0 : _2.map((src) => {
123
+ var _a;
124
+ return (React.createElement(SwiperSlide, { key: src },
125
+ React.createElement("div", { style: {
126
+ overflow: 'hidden',
127
+ width,
128
+ height
129
+ } },
130
+ React.createElement(FormatImage, { style: {
131
+ height: '100%',
132
+ width: '100%',
133
+ objectFit: 'cover',
134
+ display: 'block',
135
+ objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
136
+ }, src: (_a = src !== null && src !== void 0 ? src : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _a !== void 0 ? _a : bottom_image }))));
137
+ }))),
138
+ !((_3 = product === null || product === void 0 ? void 0 : product.homePage) === null || _3 === void 0 ? void 0 : _3.length) && (React.createElement("div", { className: css({
139
+ height,
140
+ width
141
+ }) },
142
+ React.createElement("img", { className: css({
143
+ objectFit: 'cover',
144
+ width: '100%',
145
+ height: '100%'
146
+ }), src: (_4 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _4 !== void 0 ? _4 : bottom_image, alt: 'pdp image' }))),
147
+ (iframeUrl && iframeIcon) ||
148
+ (!product && iframeIcon && (React.createElement("div", { style: {
149
+ padding: '5px 10px',
150
+ display: 'flex',
151
+ alignItems: 'center',
152
+ position: 'absolute',
153
+ right: '10px',
154
+ bottom: '10px',
155
+ zIndex: 1,
156
+ background: '#fff',
157
+ borderRadius: '3px'
158
+ }, onClick: () => setShow3DModal(true) },
159
+ React.createElement("img", { src: iframeIcon, alt: '3d', width: '20px', height: '20px', style: { marginRight: '5px' } }),
160
+ React.createElement("span", { style: { fontSize: '12px' } }, "Try in 3D"))))),
142
161
  renderCommodityGroup(),
143
162
  React.createElement("div", { className: 'pb-commondityDiroNew-content' },
144
163
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
145
164
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
146
165
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
147
- __html: setFontForText((_y = product === null || product === void 0 ? void 0 : product.title) !== null && _y !== void 0 ? _y : 'Large Dior Toujours BagLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
166
+ __html: setFontForText((_5 = product === null || product === void 0 ? void 0 : product.title) !== null && _5 !== void 0 ? _5 : 'Large Dior Toujours BagLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
148
167
  } }),
149
168
  React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), dangerouslySetInnerHTML: {
150
169
  __html: setFontForText((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
@@ -154,13 +173,20 @@ Made in Italy` })));
154
173
  __html: setFontForText(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
155
174
  } }),
156
175
  React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo), dangerouslySetInnerHTML: {
157
- __html: setFontForText((_z = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _z !== void 0 ? _z : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
176
+ __html: setFontForText((_6 = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _6 !== void 0 ? _6 : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
158
177
  } }))),
159
- (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_0 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _0 !== void 0 ? _0 : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
178
+ (!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { "aria-label": (_7 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _7 !== void 0 ? _7 : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
160
179
  React.createElement("span", { dangerouslySetInnerHTML: {
161
- __html: setFontForText((_1 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _1 !== void 0 ? _1 : 'Shop now', buttonStyle)
180
+ __html: setFontForText((_8 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _8 !== void 0 ? _8 : 'Shop now', buttonStyle)
162
181
  } }))),
163
182
  productInfoText({ isPost }))),
164
- React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
183
+ React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false })),
184
+ React.createElement(Modal, { visible: show3DModal, padding: 0, isFullScreen: true, onClose: () => setShow3DModal(false) },
185
+ React.createElement("iframe", { src: iframeUrl, style: {
186
+ width: '100%',
187
+ height: 'calc(100% - 50px)',
188
+ marginTop: '40px',
189
+ border: 'none'
190
+ } }))));
165
191
  };
166
192
  export default memo(CommodityDetailDiroNew);
@@ -52,6 +52,10 @@ const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
52
52
  borderRadius: 25,
53
53
  marginTop: 16,
54
54
  marginBottom: 16
55
+ },
56
+ commodityImgRatio: {
57
+ w: 1,
58
+ h: 1
55
59
  }
56
60
  },
57
61
  style: {}
@@ -1,6 +1,17 @@
1
1
  declare const _default: ({
2
2
  title: string;
3
3
  child: ({
4
+ type: string;
5
+ label: string;
6
+ child: {
7
+ type: string;
8
+ name: string[];
9
+ addonAfter: string;
10
+ }[];
11
+ options?: undefined;
12
+ name?: undefined;
13
+ addonAfter?: undefined;
14
+ } | {
4
15
  type: string;
5
16
  label: string;
6
17
  options: {
@@ -8,15 +19,15 @@ declare const _default: ({
8
19
  value: string;
9
20
  }[];
10
21
  name: string[];
11
- addonAfter?: undefined;
12
22
  child?: undefined;
23
+ addonAfter?: undefined;
13
24
  } | {
14
25
  type: string;
15
26
  name: string[];
16
27
  addonAfter: string;
17
28
  label?: undefined;
18
- options?: undefined;
19
29
  child?: undefined;
30
+ options?: undefined;
20
31
  } | {
21
32
  type: string;
22
33
  child: {
@@ -183,5 +194,13 @@ declare const _default: ({
183
194
  name?: undefined;
184
195
  initialValue?: undefined;
185
196
  })[];
197
+ } | {
198
+ title: string;
199
+ child: {
200
+ label: string;
201
+ type: string;
202
+ name: string[];
203
+ text: string;
204
+ }[];
186
205
  })[];
187
206
  export default _default;
@@ -1,7 +1,38 @@
1
1
  export default [
2
+ {
3
+ title: '弹窗背景',
4
+ child: [
5
+ {
6
+ type: 'Number',
7
+ label: '左右边距',
8
+ name: ['props', 'popupBg', 'horizontalMargin']
9
+ },
10
+ {
11
+ type: 'Number',
12
+ label: '下边距',
13
+ name: ['props', 'popupBg', 'bottomMargin']
14
+ }
15
+ ]
16
+ },
2
17
  {
3
18
  title: '商品图片',
4
19
  child: [
20
+ {
21
+ type: 'Group',
22
+ label: '宽高比',
23
+ child: [
24
+ {
25
+ type: 'Number',
26
+ name: ['props', 'commodityImgRatio', 'w'],
27
+ addonAfter: 'w'
28
+ },
29
+ {
30
+ type: 'Number',
31
+ name: ['props', 'commodityImgRatio', 'h'],
32
+ addonAfter: 'h'
33
+ }
34
+ ]
35
+ },
5
36
  {
6
37
  type: 'Radius',
7
38
  label: '轮播指示器',
@@ -13,6 +44,10 @@ export default [
13
44
  {
14
45
  label: '居中',
15
46
  value: 'center'
47
+ },
48
+ {
49
+ label: '居右',
50
+ value: 'right'
16
51
  }
17
52
  ],
18
53
  name: ['props', 'swiper', 'dotsAlign']
@@ -243,5 +278,16 @@ export default [
243
278
  name: ['props', 'buttonStyle']
244
279
  }
245
280
  ]
281
+ },
282
+ {
283
+ title: 'Iframe商品弹窗',
284
+ child: [
285
+ {
286
+ label: '弹窗按钮',
287
+ type: 'Upload',
288
+ name: ['props', 'iframeIcon'],
289
+ text: '建议尺寸:106 * 41'
290
+ }
291
+ ]
246
292
  }
247
293
  ];
@@ -1,4 +1,19 @@
1
1
  export default [
2
+ {
3
+ title: '弹窗背景',
4
+ child: [
5
+ {
6
+ type: 'Number',
7
+ label: '左右边距',
8
+ name: ['props', 'popupBg', 'horizontalMargin']
9
+ },
10
+ {
11
+ type: 'Number',
12
+ label: '下边距',
13
+ name: ['props', 'popupBg', 'bottomMargin']
14
+ }
15
+ ]
16
+ },
2
17
  {
3
18
  title: '商品图片',
4
19
  child: [
@@ -0,0 +1,16 @@
1
+ import React, { CSSProperties } from 'react';
2
+ import './index.less';
3
+ export interface IIframeProps {
4
+ content?: string;
5
+ btnText?: string;
6
+ style?: Record<string, any>;
7
+ icon?: Record<string, any> | string;
8
+ isExternalLink?: boolean;
9
+ isPopup?: boolean;
10
+ onClose?: () => void;
11
+ onClick?: () => void;
12
+ submitButtonStyle?: CSSProperties;
13
+ contentStyle?: CSSProperties;
14
+ }
15
+ declare const _default: React.NamedExoticComponent<IIframeProps>;
16
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { __rest } from "tslib";
2
+ import { css } from '@emotion/css';
3
+ import React, { memo } from 'react';
4
+ import './index.less';
5
+ import { useSxpDataSource } from '../../../../core/hooks';
6
+ const Iframe = (_a) => {
7
+ var _b, _c;
8
+ var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle, contentStyle } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle"]);
9
+ const { popupDetailData } = useSxpDataSource();
10
+ const iframeUrl = (_c = (_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.video) === null || _b === void 0 ? void 0 : _b.bindCta) === null || _c === void 0 ? void 0 : _c.remark;
11
+ return (React.createElement("div", Object.assign({ className: `${css(Object.assign({}, style))}` }, props), iframeUrl && (React.createElement("iframe", { src: iframeUrl, style: {
12
+ width: '100%',
13
+ height: 'calc(100% - 50px)',
14
+ marginTop: '40px',
15
+ border: 'none'
16
+ } }))));
17
+ };
18
+ export default memo(Iframe);
@@ -0,0 +1,2 @@
1
+ declare const Iframe: import("../../../../core/create").MaterialComponet<import(".").IIframeProps>;
2
+ export { Iframe };
@@ -0,0 +1,21 @@
1
+ import settingRender from './settingRender';
2
+ import IframeComponent from '.';
3
+ import { createMaterial } from '../../../../core/create';
4
+ const Iframe = createMaterial(IframeComponent, {
5
+ displayName: 'Iframe弹窗',
6
+ icon: '',
7
+ category: 'popup',
8
+ type: 'Iframe',
9
+ related: {
10
+ settingRender,
11
+ bindableProps: []
12
+ },
13
+ defaulSetting: {
14
+ props: {},
15
+ style: {}
16
+ },
17
+ w: 100,
18
+ h: 40,
19
+ sort: 3
20
+ });
21
+ export { Iframe };
@@ -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: 'Color',
7
+ label: '背景色',
8
+ name: ['style', 'backgroundColor']
9
+ }
10
+ ]
11
+ }
12
+ ];
@@ -1,6 +1,21 @@
1
1
  export default [
2
2
  {
3
- title: '',
3
+ title: '弹窗背景',
4
+ child: [
5
+ {
6
+ type: 'Number',
7
+ label: '左右边距',
8
+ name: ['props', 'popupBg', 'horizontalMargin']
9
+ },
10
+ {
11
+ type: 'Number',
12
+ label: '下边距',
13
+ name: ['props', 'popupBg', 'bottomMargin']
14
+ }
15
+ ]
16
+ },
17
+ {
18
+ title: '内容',
4
19
  child: [
5
20
  {
6
21
  type: 'Media',
@@ -3,3 +3,4 @@ export * from './CommodityDetail/material';
3
3
  export * from './Prompt/material';
4
4
  export * from './CommodityDetailDiroNew/material';
5
5
  export * from './CommodityList/material';
6
+ export * from './Iframe/material';
@@ -3,3 +3,4 @@ export * from './CommodityDetail/material';
3
3
  export * from './Prompt/material';
4
4
  export * from './CommodityDetailDiroNew/material';
5
5
  export * from './CommodityList/material';
6
+ export * from './Iframe/material';
@@ -8,21 +8,15 @@ import Img from '../components/Img';
8
8
  import { setFontForText } from '../../../../core/utils/tool';
9
9
  import styles from './index.module.less';
10
10
  const Link = (_a) => {
11
- var _b, _c, _d, _e, _f, _g, _h, _j;
11
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k;
12
12
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index, customTitle } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index", "customTitle"]);
13
13
  const { sxpParameter, bffEventReport } = useSxpDataSource();
14
14
  const { jumpToWeb } = useEventReport();
15
15
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
16
16
  const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
17
- const handleTo = () => {
18
- if (cta === null || cta === void 0 ? void 0 : cta.link) {
19
- jumpToWeb(recData, product, cta, index);
20
- window.location.href = window.getJointUtmLink(cta.link);
21
- }
22
- };
23
17
  const src = (_e = (_d = cta === null || cta === void 0 ? void 0 : cta.icon) !== null && _d !== void 0 ? _d : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _e !== void 0 ? _e : bottom_image;
24
- return (React.createElement(EventProvider, Object.assign({ index: index, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
25
- React.createElement(Img, { src: src, rec: recData, item: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.bindProduct) !== null && _g !== void 0 ? _g : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
18
+ return (React.createElement(EventProvider, Object.assign({ index: index, rec: recData, className: css(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { jumpLink: (_f = cta === null || cta === void 0 ? void 0 : cta.link) !== null && _f !== void 0 ? _f : '' }),
19
+ React.createElement(Img, { src: src, rec: recData, item: (_h = (_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindProduct) !== null && _h !== void 0 ? _h : recData === null || recData === void 0 ? void 0 : recData.video, index: index, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
26
20
  React.createElement("div", { className: css({
27
21
  display: 'flex',
28
22
  alignItems: 'center',
@@ -31,9 +25,9 @@ const Link = (_a) => {
31
25
  }) },
32
26
  React.createElement("div", null,
33
27
  React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle, dangerouslySetInnerHTML: {
34
- __html: setFontForText((_h = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _h !== void 0 ? _h : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
28
+ __html: setFontForText((_j = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _j !== void 0 ? _j : 'Product Name', ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)
35
29
  } }),
36
- (customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) && (React.createElement("div", { style: Object.assign(Object.assign({}, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style), { lineHeight: ((_j = customTitle === null || customTitle === void 0 ? void 0 : customTitle.style) === null || _j === void 0 ? void 0 : _j.height) + 'px' }), className: styles['one-line-ellipsis'], dangerouslySetInnerHTML: {
30
+ (customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) && (React.createElement("div", { style: Object.assign(Object.assign({}, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style), { lineHeight: ((_k = customTitle === null || customTitle === void 0 ? void 0 : customTitle.style) === null || _k === void 0 ? void 0 : _k.height) + 'px' }), className: styles['one-line-ellipsis'], dangerouslySetInnerHTML: {
37
31
  __html: setFontForText(customTitle === null || customTitle === void 0 ? void 0 : customTitle.text, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style)
38
32
  } }))))));
39
33
  };
@@ -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
+ ];
@@ -3,6 +3,7 @@ import settingRender from '../components/settingRender';
3
3
  import linkSettingRender from './settingRender';
4
4
  import LinkComponent from '.';
5
5
  import { createMaterial } from '../../../../core/create';
6
+ import interactionRender from './interactionRender';
6
7
  const Link = createMaterial(LinkComponent, {
7
8
  displayName: '跳转指引',
8
9
  icon: '',
@@ -10,7 +11,8 @@ const Link = createMaterial(LinkComponent, {
10
11
  type: 'Link',
11
12
  related: {
12
13
  settingRender: (_a = settingRender === null || settingRender === void 0 ? void 0 : settingRender.filter((i) => i.type !== 'commodityTitle')) === null || _a === void 0 ? void 0 : _a.concat(linkSettingRender),
13
- bindableProps: []
14
+ bindableProps: [],
15
+ interactionRender
14
16
  },
15
17
  defaulSetting: {
16
18
  props: {
@@ -1,6 +1,6 @@
1
1
  import React, { CSSProperties } from 'react';
2
2
  import { RecItemType } from '../../../../core/components/SxpPageRender/typing';
3
- export interface IImgProps {
3
+ export interface IEventProviderProps {
4
4
  rec?: RecItemType;
5
5
  children: any;
6
6
  className?: any;
@@ -8,6 +8,7 @@ export interface IImgProps {
8
8
  style?: CSSProperties;
9
9
  isExternalLink?: boolean;
10
10
  index?: number;
11
+ jumpLink?: string;
11
12
  }
12
- declare const _default: React.NamedExoticComponent<IImgProps>;
13
+ declare const _default: React.NamedExoticComponent<IEventProviderProps>;
13
14
  export default _default;
@@ -4,7 +4,7 @@ import { throttle } from 'lodash';
4
4
  import { useEditor, useSxpDataSource } from '../../../../core/hooks';
5
5
  import { useEventReport } from '../../../../core/hooks/useEventReport';
6
6
  const EventProvider = (_a) => {
7
- var { rec, children, className, onClick, style, isExternalLink = false, index } = _a, props = __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index"]);
7
+ var { rec, children, className, onClick, style, isExternalLink = false, index, jumpLink } = _a, props = __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index", "jumpLink"]);
8
8
  const ref = useRef(null);
9
9
  const { popup } = useEditor();
10
10
  const { setPopupDetailData, ctaEvent } = useSxpDataSource();
@@ -18,11 +18,11 @@ const EventProvider = (_a) => {
18
18
  }, rec, item, index);
19
19
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, rec), { index }));
20
20
  if (isExternalLink) {
21
- if ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) {
21
+ if (jumpLink || ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link)) {
22
22
  const cta = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta;
23
23
  const product = (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct;
24
24
  jumpToWeb(rec, product, cta, index);
25
- window.location.href = window.getJointUtmLink((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link);
25
+ window.location.href = window.getJointUtmLink(jumpLink || ((_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindProduct) === null || _h === void 0 ? void 0 : _h.link) || '');
26
26
  }
27
27
  }
28
28
  else {
@@ -7,18 +7,20 @@ const FormatImage = (0, react_1.forwardRef)((props, ref) => {
7
7
  const { src, onLoad, style, className, loading, alt = 'image' } = props;
8
8
  const [imgSrc, setImgSrc] = (0, react_1.useState)();
9
9
  const imgRef = (0, react_1.useRef)(null);
10
+ const [visible, setVisible] = (0, react_1.useState)(false);
10
11
  (0, react_1.useImperativeHandle)(ref, () => ({
11
12
  setSrc: (v) => {
12
- setImgSrc(v);
13
+ if (v)
14
+ setImgSrc(v);
13
15
  }
14
16
  }));
15
17
  (0, react_1.useEffect)(() => {
16
- setImgSrc(src);
18
+ if (src)
19
+ setImgSrc(src);
17
20
  }, [src]);
18
21
  (0, react_1.useEffect)(() => {
19
22
  const onShow = () => {
20
- var _a, _b;
21
- if (src && ((_b = (_a = imgRef === null || imgRef === void 0 ? void 0 : imgRef.current) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.display) === 'none') {
23
+ if (src && !visible && imgRef.current) {
22
24
  imgRef.current.src = '';
23
25
  imgRef.current.src = src;
24
26
  }
@@ -27,19 +29,19 @@ const FormatImage = (0, react_1.forwardRef)((props, ref) => {
27
29
  return () => {
28
30
  event_1.default.off(event_1.SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
29
31
  };
30
- }, [src]);
31
- return (react_1.default.createElement(react_1.default.Fragment, null, (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (react_1.default.createElement("picture", null,
32
- react_1.default.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
33
- react_1.default.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
34
- react_1.default.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
35
- react_1.default.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign(Object.assign({}, style), { display: 'none' }), loading: loading, onLoad: (e) => {
36
- if (imgRef.current)
37
- imgRef.current.style.display = 'block';
32
+ }, [src, visible]);
33
+ return (react_1.default.createElement(react_1.default.Fragment, null,
34
+ !visible && react_1.default.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
35
+ (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (react_1.default.createElement("picture", null,
36
+ react_1.default.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
37
+ react_1.default.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
38
+ react_1.default.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
39
+ react_1.default.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
40
+ setVisible(true);
41
+ onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
42
+ }, alt: alt }))) : (react_1.default.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
43
+ setVisible(true);
38
44
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
39
- }, alt: alt }))) : (react_1.default.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign(Object.assign({}, style), { display: 'none' }), loading: loading, onLoad: (e) => {
40
- if (imgRef.current)
41
- imgRef.current.style.display = 'block';
42
- onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
43
- }, alt: alt }))));
45
+ }, alt: alt }))));
44
46
  });
45
47
  exports.default = (0, react_1.memo)(FormatImage);