pb-sxp-ui 1.2.10 → 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 (108) hide show
  1. package/dist/index.cjs +595 -308
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +62 -2
  4. package/dist/index.js +595 -308
  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 +595 -308
  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 +1 -1
  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/HashTag/settingRender.d.ts +7 -6
  29. package/es/materials/sxp/HashTag/settingRender.js +0 -9
  30. package/es/materials/sxp/cta/AniLink/settingRender.d.ts +0 -5
  31. package/es/materials/sxp/cta/AniLink/settingRender.js +0 -4
  32. package/es/materials/sxp/popup/AppointForm/settingRender.d.ts +5 -8
  33. package/es/materials/sxp/popup/AppointForm/settingRender.js +15 -12
  34. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +10 -1
  35. package/es/materials/sxp/popup/CommodityDetail/index.js +46 -28
  36. package/es/materials/sxp/popup/CommodityDetail/material.js +4 -0
  37. package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +19 -6
  38. package/es/materials/sxp/popup/CommodityDetail/settingRender.js +45 -8
  39. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +10 -1
  40. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +72 -46
  41. package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
  42. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +19 -6
  43. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +45 -8
  44. package/es/materials/sxp/popup/CommodityList/settingRender.js +15 -4
  45. package/es/materials/sxp/popup/Iframe/index.d.ts +16 -0
  46. package/es/materials/sxp/popup/Iframe/index.js +18 -0
  47. package/es/materials/sxp/popup/Iframe/material.d.ts +2 -0
  48. package/es/materials/sxp/popup/Iframe/material.js +21 -0
  49. package/es/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
  50. package/es/materials/sxp/popup/Iframe/settingRender.js +12 -0
  51. package/es/materials/sxp/popup/Prompt/settingRender.js +16 -11
  52. package/es/materials/sxp/popup/index.d.ts +1 -0
  53. package/es/materials/sxp/popup/index.js +1 -0
  54. package/es/materials/sxp/template/Link/index.js +5 -11
  55. package/es/materials/sxp/template/Link/interactionRender.d.ts +8 -0
  56. package/es/materials/sxp/template/Link/interactionRender.js +11 -0
  57. package/es/materials/sxp/template/Link/material.js +3 -1
  58. package/es/materials/sxp/template/Link/settingRender.js +0 -5
  59. package/es/materials/sxp/template/components/EventProvider.d.ts +3 -2
  60. package/es/materials/sxp/template/components/EventProvider.js +3 -3
  61. package/lib/core/components/SxpPageRender/FormatImage.js +1 -1
  62. package/lib/core/components/SxpPageRender/Modal/index.js +33 -20
  63. package/lib/core/components/SxpPageRender/Popup/index.js +2 -2
  64. package/lib/core/components/SxpPageRender/ToggleButton/index.js +3 -0
  65. package/lib/core/components/SxpPageRender/WaterFall/List.js +5 -14
  66. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +5 -14
  67. package/lib/core/components/SxpPageRender/index.d.ts +6 -1
  68. package/lib/core/components/SxpPageRender/index.js +46 -23
  69. package/lib/core/components/SxpPageRender/typing.d.ts +2 -0
  70. package/lib/core/context/SxpDataSourceProvider.d.ts +3 -2
  71. package/lib/core/context/SxpDataSourceProvider.js +27 -30
  72. package/lib/core/hooks/useEventReport.js +9 -8
  73. package/lib/core/utils/tool.d.ts +5 -1
  74. package/lib/core/utils/tool.js +73 -1
  75. package/lib/materials/sxp/HashTag/settingRender.d.ts +7 -6
  76. package/lib/materials/sxp/HashTag/settingRender.js +0 -9
  77. package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +0 -5
  78. package/lib/materials/sxp/cta/AniLink/settingRender.js +0 -4
  79. package/lib/materials/sxp/popup/AppointForm/settingRender.d.ts +5 -8
  80. package/lib/materials/sxp/popup/AppointForm/settingRender.js +15 -12
  81. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +10 -1
  82. package/lib/materials/sxp/popup/CommodityDetail/index.js +46 -28
  83. package/lib/materials/sxp/popup/CommodityDetail/material.js +4 -0
  84. package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +19 -6
  85. package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +45 -8
  86. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +10 -1
  87. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +72 -46
  88. package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
  89. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +19 -6
  90. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +45 -8
  91. package/lib/materials/sxp/popup/CommodityList/settingRender.js +15 -4
  92. package/lib/materials/sxp/popup/Iframe/index.d.ts +16 -0
  93. package/lib/materials/sxp/popup/Iframe/index.js +20 -0
  94. package/lib/materials/sxp/popup/Iframe/material.d.ts +2 -0
  95. package/lib/materials/sxp/popup/Iframe/material.js +25 -0
  96. package/lib/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
  97. package/lib/materials/sxp/popup/Iframe/settingRender.js +14 -0
  98. package/lib/materials/sxp/popup/Prompt/settingRender.js +16 -11
  99. package/lib/materials/sxp/popup/index.d.ts +1 -0
  100. package/lib/materials/sxp/popup/index.js +1 -0
  101. package/lib/materials/sxp/template/Link/index.js +5 -11
  102. package/lib/materials/sxp/template/Link/interactionRender.d.ts +8 -0
  103. package/lib/materials/sxp/template/Link/interactionRender.js +13 -0
  104. package/lib/materials/sxp/template/Link/material.js +3 -1
  105. package/lib/materials/sxp/template/Link/settingRender.js +0 -5
  106. package/lib/materials/sxp/template/components/EventProvider.d.ts +3 -2
  107. package/lib/materials/sxp/template/components/EventProvider.js +3 -3
  108. package/package.json +1 -1
@@ -14,8 +14,8 @@ const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/componen
14
14
  const tool_1 = require("../../../../core/utils/tool");
15
15
  const CommodityGroup_1 = tslib_1.__importDefault(require("../../template/components/CommodityGroup"));
16
16
  const CommodityDetailDiroNew = (_a) => {
17
- 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;
18
- var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup"]);
17
+ 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;
18
+ var { style, isDefault, rec, viewTime, isPost, bottom_image, tipText, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "tipText", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio"]);
19
19
  const [spread, setSpread] = (0, react_1.useState)(true);
20
20
  const { sxpParameter, popupCurTimeRef, popupDetailData, isPreview, bffFbReport, checkCommodityIndexRef } = (0, hooks_1.useSxpDataSource)();
21
21
  const { jumpToWeb, productView } = (0, useEventReport_1.useEventReport)();
@@ -24,6 +24,7 @@ const CommodityDetailDiroNew = (_a) => {
24
24
  const [isTop, setIsTop] = (0, react_1.useState)(true);
25
25
  const [showModal, setShowModal] = (0, react_1.useState)(false);
26
26
  const curTimeRef = (0, react_1.useRef)(null);
27
+ const [show3DModal, setShow3DModal] = (0, react_1.useState)(false);
27
28
  const [checkCommodityIndex, setCheckCommodityIndex] = (0, react_1.useState)((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
28
29
  const data = isPost ? rec : popupDetailData;
29
30
  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];
@@ -74,7 +75,8 @@ const CommodityDetailDiroNew = (_a) => {
74
75
  return '£102,300.00';
75
76
  }
76
77
  }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency]);
77
- const width = isPreview ? 375 : (_t = style === null || style === void 0 ? void 0 : style.width) !== null && _t !== void 0 ? _t : window.innerWidth;
78
+ 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;
79
+ const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
78
80
  const handleClickCollapse = () => {
79
81
  setSpread(!spread);
80
82
  };
@@ -101,52 +103,69 @@ Made in Italy` })));
101
103
  return;
102
104
  return (react_1.default.createElement(CommodityGroup_1.default, { 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 }));
103
105
  }, [checkCommodityIndex]);
106
+ const getDotsAlign = (0, react_1.useMemo)(() => {
107
+ const dotsAlignClass = {
108
+ left: 'commondityDetail-swiper-clickable-left',
109
+ center: 'commondityDetail-swiper-clickable-center',
110
+ right: 'commondityDetail-swiper-clickable-right'
111
+ };
112
+ return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
113
+ }, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
114
+ 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);
104
115
  return (react_1.default.createElement("div", { className: 'pb-commondityDiroNew' },
105
116
  react_1.default.createElement("div", Object.assign({ className: (0, css_1.css)(Object.assign(Object.assign({}, style), { transform: 'translate3d(0px, 0px, 0px)' })) }, props),
106
- product && ((_u = product === null || product === void 0 ? void 0 : product.homePage) === null || _u === void 0 ? void 0 : _u.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: width, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
107
- clickable: true,
108
- bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
109
- clickableClass: (swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign) === 'left'
110
- ? 'commondityDiroNew-swiper-clickable-left'
111
- : 'commondityDiroNew-swiper-clickable-center'
112
- }, loop: true, autoplay: {
113
- delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
114
- } }, (_v = product === null || product === void 0 ? void 0 : product.homePage) === null || _v === void 0 ? void 0 : _v.map((src) => {
115
- var _a;
116
- return (react_1.default.createElement(react_2.SwiperSlide, { key: src },
117
- react_1.default.createElement("div", { style: {
118
- overflow: 'hidden',
119
- width,
120
- height: width
121
- } },
122
- react_1.default.createElement(FormatImage_1.default, { style: {
123
- height: '100%',
124
- width: '100%',
125
- objectFit: 'cover',
126
- display: 'block',
127
- objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
128
- }, 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 }))));
129
- }))),
130
- !((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
131
- position: 'relative',
132
- height: 0,
133
- width: '100%',
134
- paddingBottom: '100%',
135
- overflow: 'hidden'
136
- }) },
137
- react_1.default.createElement("img", { className: (0, css_1.css)({
138
- position: 'absolute',
139
- left: 0,
140
- top: 0,
141
- objectFit: 'cover',
142
- width: '100%'
143
- }), src: (_x = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _x !== void 0 ? _x : bottom_image, alt: 'pdp image' }))),
117
+ react_1.default.createElement("div", { style: { position: 'relative' } },
118
+ product && ((_1 = product === null || product === void 0 ? void 0 : product.homePage) === null || _1 === void 0 ? void 0 : _1.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: height, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
119
+ clickable: true,
120
+ bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
121
+ clickableClass: getDotsAlign
122
+ }, loop: true, autoplay: {
123
+ delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
124
+ } }, (_2 = product === null || product === void 0 ? void 0 : product.homePage) === null || _2 === void 0 ? void 0 : _2.map((src) => {
125
+ var _a;
126
+ return (react_1.default.createElement(react_2.SwiperSlide, { key: src },
127
+ react_1.default.createElement("div", { style: {
128
+ overflow: 'hidden',
129
+ width,
130
+ height
131
+ } },
132
+ react_1.default.createElement(FormatImage_1.default, { style: {
133
+ height: '100%',
134
+ width: '100%',
135
+ objectFit: 'cover',
136
+ display: 'block',
137
+ objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
138
+ }, 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 }))));
139
+ }))),
140
+ !((_3 = product === null || product === void 0 ? void 0 : product.homePage) === null || _3 === void 0 ? void 0 : _3.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
141
+ height,
142
+ width
143
+ }) },
144
+ react_1.default.createElement("img", { className: (0, css_1.css)({
145
+ objectFit: 'cover',
146
+ width: '100%',
147
+ height: '100%'
148
+ }), src: (_4 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _4 !== void 0 ? _4 : bottom_image, alt: 'pdp image' }))),
149
+ (iframeUrl && iframeIcon) ||
150
+ (!product && iframeIcon && (react_1.default.createElement("div", { style: {
151
+ padding: '5px 10px',
152
+ display: 'flex',
153
+ alignItems: 'center',
154
+ position: 'absolute',
155
+ right: '10px',
156
+ bottom: '10px',
157
+ zIndex: 1,
158
+ background: '#fff',
159
+ borderRadius: '3px'
160
+ }, onClick: () => setShow3DModal(true) },
161
+ react_1.default.createElement("img", { src: iframeIcon, alt: '3d', width: '20px', height: '20px', style: { marginRight: '5px' } }),
162
+ react_1.default.createElement("span", { style: { fontSize: '12px' } }, "Try in 3D"))))),
144
163
  renderCommodityGroup(),
145
164
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content' },
146
165
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
147
166
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
148
167
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), dangerouslySetInnerHTML: {
149
- __html: (0, tool_1.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)
168
+ __html: (0, tool_1.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)
150
169
  } }),
151
170
  react_1.default.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: {
152
171
  __html: (0, tool_1.setFontForText)((product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection)
@@ -156,13 +175,20 @@ Made in Italy` })));
156
175
  __html: (0, tool_1.setFontForText)(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
157
176
  } }),
158
177
  react_1.default.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: {
159
- __html: (0, tool_1.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)
178
+ __html: (0, tool_1.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)
160
179
  } }))),
161
- (!product || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.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 },
180
+ (!product || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.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 },
162
181
  react_1.default.createElement("span", { dangerouslySetInnerHTML: {
163
- __html: (0, tool_1.setFontForText)((_1 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _1 !== void 0 ? _1 : 'Shop now', buttonStyle)
182
+ __html: (0, tool_1.setFontForText)((_8 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _8 !== void 0 ? _8 : 'Shop now', buttonStyle)
164
183
  } }))),
165
184
  productInfoText({ isPost }))),
166
- react_1.default.createElement(Modal_1.default, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
185
+ react_1.default.createElement(Modal_1.default, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false })),
186
+ react_1.default.createElement(Modal_1.default, { visible: show3DModal, padding: 0, isFullScreen: true, onClose: () => setShow3DModal(false) },
187
+ react_1.default.createElement("iframe", { src: iframeUrl, style: {
188
+ width: '100%',
189
+ height: 'calc(100% - 50px)',
190
+ marginTop: '40px',
191
+ border: 'none'
192
+ } }))));
167
193
  };
168
194
  exports.default = (0, react_1.memo)(CommodityDetailDiroNew);
@@ -56,6 +56,10 @@ const CommodityDetailDiroNew = (0, create_1.createMaterial)(_1.default, {
56
56
  borderRadius: 25,
57
57
  marginTop: 16,
58
58
  marginBottom: 16
59
+ },
60
+ commodityImgRatio: {
61
+ w: 1,
62
+ h: 1
59
63
  }
60
64
  },
61
65
  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: {
@@ -182,12 +193,14 @@ declare const _default: ({
182
193
  })[];
183
194
  name?: undefined;
184
195
  initialValue?: undefined;
185
- } | {
196
+ })[];
197
+ } | {
198
+ title: string;
199
+ child: {
186
200
  label: string;
187
201
  type: string;
188
202
  name: string[];
189
- initialValue?: undefined;
190
- child?: undefined;
191
- })[];
203
+ text: string;
204
+ }[];
192
205
  })[];
193
206
  export default _default;
@@ -1,9 +1,40 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = [
4
+ {
5
+ title: '弹窗背景',
6
+ child: [
7
+ {
8
+ type: 'Number',
9
+ label: '左右边距',
10
+ name: ['props', 'popupBg', 'horizontalMargin']
11
+ },
12
+ {
13
+ type: 'Number',
14
+ label: '下边距',
15
+ name: ['props', 'popupBg', 'bottomMargin']
16
+ }
17
+ ]
18
+ },
4
19
  {
5
20
  title: '商品图片',
6
21
  child: [
22
+ {
23
+ type: 'Group',
24
+ label: '宽高比',
25
+ child: [
26
+ {
27
+ type: 'Number',
28
+ name: ['props', 'commodityImgRatio', 'w'],
29
+ addonAfter: 'w'
30
+ },
31
+ {
32
+ type: 'Number',
33
+ name: ['props', 'commodityImgRatio', 'h'],
34
+ addonAfter: 'h'
35
+ }
36
+ ]
37
+ },
7
38
  {
8
39
  type: 'Radius',
9
40
  label: '轮播指示器',
@@ -15,6 +46,10 @@ exports.default = [
15
46
  {
16
47
  label: '居中',
17
48
  value: 'center'
49
+ },
50
+ {
51
+ label: '居右',
52
+ value: 'right'
18
53
  }
19
54
  ],
20
55
  name: ['props', 'swiper', 'dotsAlign']
@@ -158,10 +193,6 @@ exports.default = [
158
193
  label: '默认行数',
159
194
  type: 'Number',
160
195
  name: ['lineClamp']
161
- },
162
- {
163
- label: '间距',
164
- type: 'TextSpace'
165
196
  }
166
197
  ]
167
198
  }
@@ -247,11 +278,17 @@ exports.default = [
247
278
  {
248
279
  type: 'TextAlign',
249
280
  name: ['props', 'buttonStyle']
250
- },
281
+ }
282
+ ]
283
+ },
284
+ {
285
+ title: 'Iframe商品弹窗',
286
+ child: [
251
287
  {
252
- label: '间距',
253
- type: 'TextSpace',
254
- name: ['props', 'buttonStyle']
288
+ label: '弹窗按钮',
289
+ type: 'Upload',
290
+ name: ['props', 'iframeIcon'],
291
+ text: '建议尺寸:106 * 41'
255
292
  }
256
293
  ]
257
294
  }
@@ -1,6 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = [
4
+ {
5
+ title: '弹窗背景',
6
+ child: [
7
+ {
8
+ type: 'Number',
9
+ label: '左右边距',
10
+ name: ['props', 'popupBg', 'horizontalMargin']
11
+ },
12
+ {
13
+ type: 'Number',
14
+ label: '下边距',
15
+ name: ['props', 'popupBg', 'bottomMargin']
16
+ }
17
+ ]
18
+ },
4
19
  {
5
20
  title: '商品图片',
6
21
  child: [
@@ -118,10 +133,6 @@ exports.default = [
118
133
  {
119
134
  label: '标题对齐',
120
135
  type: 'TextAlign'
121
- },
122
- {
123
- label: '间距',
124
- type: 'TextSpace'
125
136
  }
126
137
  ]
127
138
  }
@@ -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,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const css_1 = require("@emotion/css");
5
+ const react_1 = tslib_1.__importStar(require("react"));
6
+ require("./index.less");
7
+ const hooks_1 = require("../../../../core/hooks");
8
+ const Iframe = (_a) => {
9
+ var _b, _c;
10
+ var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle, contentStyle } = _a, props = tslib_1.__rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle", "contentStyle"]);
11
+ const { popupDetailData } = (0, hooks_1.useSxpDataSource)();
12
+ 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;
13
+ return (react_1.default.createElement("div", Object.assign({ className: `${(0, css_1.css)(Object.assign({}, style))}` }, props), iframeUrl && (react_1.default.createElement("iframe", { src: iframeUrl, style: {
14
+ width: '100%',
15
+ height: 'calc(100% - 50px)',
16
+ marginTop: '40px',
17
+ border: 'none'
18
+ } }))));
19
+ };
20
+ exports.default = (0, react_1.memo)(Iframe);
@@ -0,0 +1,2 @@
1
+ declare const Iframe: import("../../../../core/create").MaterialComponet<import(".").IIframeProps>;
2
+ export { Iframe };
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Iframe = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const settingRender_1 = tslib_1.__importDefault(require("./settingRender"));
6
+ const _1 = tslib_1.__importDefault(require("."));
7
+ const create_1 = require("../../../../core/create");
8
+ const Iframe = (0, create_1.createMaterial)(_1.default, {
9
+ displayName: 'Iframe弹窗',
10
+ icon: '',
11
+ category: 'popup',
12
+ type: 'Iframe',
13
+ related: {
14
+ settingRender: settingRender_1.default,
15
+ bindableProps: []
16
+ },
17
+ defaulSetting: {
18
+ props: {},
19
+ style: {}
20
+ },
21
+ w: 100,
22
+ h: 40,
23
+ sort: 3
24
+ });
25
+ exports.Iframe = 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,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = [
4
+ {
5
+ title: '背景样式',
6
+ child: [
7
+ {
8
+ type: 'Color',
9
+ label: '背景色',
10
+ name: ['style', 'backgroundColor']
11
+ }
12
+ ]
13
+ }
14
+ ];
@@ -2,7 +2,22 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = [
4
4
  {
5
- title: '',
5
+ title: '弹窗背景',
6
+ child: [
7
+ {
8
+ type: 'Number',
9
+ label: '左右边距',
10
+ name: ['props', 'popupBg', 'horizontalMargin']
11
+ },
12
+ {
13
+ type: 'Number',
14
+ label: '下边距',
15
+ name: ['props', 'popupBg', 'bottomMargin']
16
+ }
17
+ ]
18
+ },
19
+ {
20
+ title: '内容',
6
21
  child: [
7
22
  {
8
23
  type: 'Media',
@@ -48,11 +63,6 @@ exports.default = [
48
63
  }
49
64
  ]
50
65
  },
51
- {
52
- label: '内容字体间距',
53
- type: 'TextSpace',
54
- name: ['props', 'contentStyle']
55
- },
56
66
  {
57
67
  type: 'Group',
58
68
  label: '提交按钮字体',
@@ -86,11 +96,6 @@ exports.default = [
86
96
  }
87
97
  ]
88
98
  },
89
- {
90
- label: '提交按钮间距',
91
- type: 'TextSpace',
92
- name: ['props', 'submitButtonStyle']
93
- },
94
99
  {
95
100
  type: 'TextStyle',
96
101
  name: ['props', 'submitButtonStyle']
@@ -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';
@@ -6,3 +6,4 @@ tslib_1.__exportStar(require("./CommodityDetail/material"), exports);
6
6
  tslib_1.__exportStar(require("./Prompt/material"), exports);
7
7
  tslib_1.__exportStar(require("./CommodityDetailDiroNew/material"), exports);
8
8
  tslib_1.__exportStar(require("./CommodityList/material"), exports);
9
+ tslib_1.__exportStar(require("./Iframe/material"), exports);
@@ -10,21 +10,15 @@ const Img_1 = tslib_1.__importDefault(require("../components/Img"));
10
10
  const tool_1 = require("../../../../core/utils/tool");
11
11
  const index_module_less_1 = tslib_1.__importDefault(require("./index.module.less"));
12
12
  const Link = (_a) => {
13
- var _b, _c, _d, _e, _f, _g, _h, _j;
13
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k;
14
14
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, index, customTitle } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "index", "customTitle"]);
15
15
  const { sxpParameter, bffEventReport } = (0, hooks_1.useSxpDataSource)();
16
16
  const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
17
17
  const cta = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindCta;
18
18
  const product = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct;
19
- const handleTo = () => {
20
- if (cta === null || cta === void 0 ? void 0 : cta.link) {
21
- jumpToWeb(recData, product, cta, index);
22
- window.location.href = window.getJointUtmLink(cta.link);
23
- }
24
- };
25
19
  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;
26
- return (react_1.default.createElement(EventProvider_1.default, Object.assign({ index: index, rec: recData, className: (0, css_1.css)(Object.assign({ alignItems: 'center' }, style)), style: { display: 'flex' } }, props, { onClick: handleTo }),
27
- react_1.default.createElement(Img_1.default, { 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 }),
20
+ return (react_1.default.createElement(EventProvider_1.default, Object.assign({ index: index, rec: recData, className: (0, css_1.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 : '' }),
21
+ react_1.default.createElement(Img_1.default, { 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 }),
28
22
  react_1.default.createElement("div", { className: (0, css_1.css)({
29
23
  display: 'flex',
30
24
  alignItems: 'center',
@@ -33,9 +27,9 @@ const Link = (_a) => {
33
27
  }) },
34
28
  react_1.default.createElement("div", null,
35
29
  react_1.default.createElement("div", { className: index_module_less_1.default['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle, dangerouslySetInnerHTML: {
36
- __html: (0, tool_1.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)
30
+ __html: (0, tool_1.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)
37
31
  } }),
38
- (customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) && (react_1.default.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: index_module_less_1.default['one-line-ellipsis'], dangerouslySetInnerHTML: {
32
+ (customTitle === null || customTitle === void 0 ? void 0 : customTitle.display) && (react_1.default.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: index_module_less_1.default['one-line-ellipsis'], dangerouslySetInnerHTML: {
39
33
  __html: (0, tool_1.setFontForText)(customTitle === null || customTitle === void 0 ? void 0 : customTitle.text, customTitle === null || customTitle === void 0 ? void 0 : customTitle.style)
40
34
  } }))))));
41
35
  };
@@ -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,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = [
4
+ {
5
+ title: '点击事件',
6
+ child: [
7
+ {
8
+ type: 'link',
9
+ name: 'onClick'
10
+ }
11
+ ]
12
+ }
13
+ ];
@@ -7,6 +7,7 @@ const settingRender_1 = tslib_1.__importDefault(require("../components/settingRe
7
7
  const settingRender_2 = tslib_1.__importDefault(require("./settingRender"));
8
8
  const _1 = tslib_1.__importDefault(require("."));
9
9
  const create_1 = require("../../../../core/create");
10
+ const interactionRender_1 = tslib_1.__importDefault(require("./interactionRender"));
10
11
  const Link = (0, create_1.createMaterial)(_1.default, {
11
12
  displayName: '跳转指引',
12
13
  icon: '',
@@ -14,7 +15,8 @@ const Link = (0, create_1.createMaterial)(_1.default, {
14
15
  type: 'Link',
15
16
  related: {
16
17
  settingRender: (_a = settingRender_1.default === null || settingRender_1.default === void 0 ? void 0 : settingRender_1.default.filter((i) => i.type !== 'commodityTitle')) === null || _a === void 0 ? void 0 : _a.concat(settingRender_2.default),
17
- bindableProps: []
18
+ bindableProps: [],
19
+ interactionRender: interactionRender_1.default
18
20
  },
19
21
  defaulSetting: {
20
22
  props: {
@@ -93,11 +93,6 @@ exports.default = [
93
93
  type: 'TextAlign',
94
94
  name: ['props', 'customTitle', 'style']
95
95
  },
96
- {
97
- label: '间距',
98
- type: 'TextSpace',
99
- name: ['props', 'customTitle', 'style']
100
- },
101
96
  {
102
97
  label: '上边距',
103
98
  type: 'Number',
@@ -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;