pb-sxp-ui 1.2.10 → 1.3.1

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 (100) hide show
  1. package/dist/index.cjs +700 -284
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +62 -2
  4. package/dist/index.js +700 -284
  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 +700 -284
  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 +34 -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 +13 -18
  19. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +12 -17
  20. package/es/core/components/SxpPageRender/index.d.ts +6 -1
  21. package/es/core/components/SxpPageRender/index.js +73 -42
  22. package/es/core/components/SxpPageRender/typing.d.ts +2 -0
  23. package/es/core/context/EditorContext.js +2 -0
  24. package/es/core/context/SxpDataSourceProvider.d.ts +3 -2
  25. package/es/core/context/SxpDataSourceProvider.js +53 -33
  26. package/es/core/hooks/useEventReport.d.ts +1 -1
  27. package/es/core/hooks/useEventReport.js +10 -9
  28. package/es/core/utils/tool.d.ts +5 -1
  29. package/es/core/utils/tool.js +69 -1
  30. package/es/materials/sxp/popup/AppointForm/settingRender.js +15 -0
  31. package/es/materials/sxp/popup/CommodityDetail/index.d.ts +13 -2
  32. package/es/materials/sxp/popup/CommodityDetail/index.js +60 -34
  33. package/es/materials/sxp/popup/CommodityDetail/material.js +4 -0
  34. package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +28 -2
  35. package/es/materials/sxp/popup/CommodityDetail/settingRender.js +52 -0
  36. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +13 -2
  37. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +85 -51
  38. package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
  39. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +28 -2
  40. package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +52 -0
  41. package/es/materials/sxp/popup/CommodityList/settingRender.js +15 -0
  42. package/es/materials/sxp/popup/Iframe/index.d.ts +16 -0
  43. package/es/materials/sxp/popup/Iframe/index.js +18 -0
  44. package/es/materials/sxp/popup/Iframe/material.d.ts +2 -0
  45. package/es/materials/sxp/popup/Iframe/material.js +21 -0
  46. package/es/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
  47. package/es/materials/sxp/popup/Iframe/settingRender.js +12 -0
  48. package/es/materials/sxp/popup/Prompt/settingRender.js +16 -1
  49. package/es/materials/sxp/popup/index.d.ts +1 -0
  50. package/es/materials/sxp/popup/index.js +1 -0
  51. package/es/materials/sxp/template/Link/index.js +5 -11
  52. package/es/materials/sxp/template/Link/interactionRender.d.ts +8 -0
  53. package/es/materials/sxp/template/Link/interactionRender.js +11 -0
  54. package/es/materials/sxp/template/Link/material.js +3 -1
  55. package/es/materials/sxp/template/components/EventProvider.d.ts +3 -2
  56. package/es/materials/sxp/template/components/EventProvider.js +3 -3
  57. package/lib/core/components/SxpPageRender/FormatImage.js +1 -1
  58. package/lib/core/components/SxpPageRender/Modal/index.js +34 -20
  59. package/lib/core/components/SxpPageRender/Popup/index.js +2 -2
  60. package/lib/core/components/SxpPageRender/ToggleButton/index.js +3 -0
  61. package/lib/core/components/SxpPageRender/WaterFall/List.js +13 -18
  62. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +12 -17
  63. package/lib/core/components/SxpPageRender/index.d.ts +6 -1
  64. package/lib/core/components/SxpPageRender/index.js +72 -41
  65. package/lib/core/components/SxpPageRender/typing.d.ts +2 -0
  66. package/lib/core/context/EditorContext.js +2 -0
  67. package/lib/core/context/SxpDataSourceProvider.d.ts +3 -2
  68. package/lib/core/context/SxpDataSourceProvider.js +53 -33
  69. package/lib/core/hooks/useEventReport.d.ts +1 -1
  70. package/lib/core/hooks/useEventReport.js +10 -9
  71. package/lib/core/utils/tool.d.ts +5 -1
  72. package/lib/core/utils/tool.js +73 -1
  73. package/lib/materials/sxp/popup/AppointForm/settingRender.js +15 -0
  74. package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +13 -2
  75. package/lib/materials/sxp/popup/CommodityDetail/index.js +60 -34
  76. package/lib/materials/sxp/popup/CommodityDetail/material.js +4 -0
  77. package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +28 -2
  78. package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +52 -0
  79. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +13 -2
  80. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +85 -51
  81. package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +4 -0
  82. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +28 -2
  83. package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +52 -0
  84. package/lib/materials/sxp/popup/CommodityList/settingRender.js +15 -0
  85. package/lib/materials/sxp/popup/Iframe/index.d.ts +16 -0
  86. package/lib/materials/sxp/popup/Iframe/index.js +20 -0
  87. package/lib/materials/sxp/popup/Iframe/material.d.ts +2 -0
  88. package/lib/materials/sxp/popup/Iframe/material.js +25 -0
  89. package/lib/materials/sxp/popup/Iframe/settingRender.d.ts +9 -0
  90. package/lib/materials/sxp/popup/Iframe/settingRender.js +14 -0
  91. package/lib/materials/sxp/popup/Prompt/settingRender.js +16 -1
  92. package/lib/materials/sxp/popup/index.d.ts +1 -0
  93. package/lib/materials/sxp/popup/index.js +1 -0
  94. package/lib/materials/sxp/template/Link/index.js +5 -11
  95. package/lib/materials/sxp/template/Link/interactionRender.d.ts +8 -0
  96. package/lib/materials/sxp/template/Link/interactionRender.js +13 -0
  97. package/lib/materials/sxp/template/Link/material.js +3 -1
  98. package/lib/materials/sxp/template/components/EventProvider.d.ts +3 -2
  99. package/lib/materials/sxp/template/components/EventProvider.js +3 -3
  100. 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, _9;
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,7 +24,9 @@ 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);
29
+ const ref = (0, react_1.useRef)();
28
30
  const data = isPost ? rec : popupDetailData;
29
31
  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];
30
32
  let cta = isPost
@@ -64,17 +66,21 @@ const CommodityDetailDiroNew = (_a) => {
64
66
  };
65
67
  }, []);
66
68
  const priceText = (0, react_1.useMemo)(() => {
67
- var _a, _b, _c, _d, _e;
69
+ var _a, _b, _c, _d, _e, _f, _g;
70
+ const isToLocStr = ((_a = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice) === undefined || ((_b = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _b === void 0 ? void 0 : _b.enableFormattedPrice);
68
71
  if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
69
- 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', {
70
- minimumFractionDigits: 0
71
- })) !== null && _e !== void 0 ? _e : ''}`;
72
+ return `${(_e = (_d = (_c = product === null || product === void 0 ? void 0 : product.currency) === null || _c === void 0 ? void 0 : _c.split('-')[1]) === null || _d === void 0 ? void 0 : _d.toUpperCase()) !== null && _e !== void 0 ? _e : ''}${isToLocStr
73
+ ? (_g = (_f = product === null || product === void 0 ? void 0 : product.price) === null || _f === void 0 ? void 0 : _f.toLocaleString('zh', {
74
+ minimumFractionDigits: 0
75
+ })) !== null && _g !== void 0 ? _g : ''
76
+ : product === null || product === void 0 ? void 0 : product.price}`;
72
77
  }
73
78
  else {
74
79
  return '£102,300.00';
75
80
  }
76
- }, [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;
81
+ }, [product === null || product === void 0 ? void 0 : product.price, product === null || product === void 0 ? void 0 : product.currency, (_t = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _t === void 0 ? void 0 : _t.enableFormattedPrice]);
82
+ const width = (isPreview ? 375 : (_u = style === null || style === void 0 ? void 0 : style.width) !== null && _u !== void 0 ? _u : window.innerWidth) - ((_v = popupBg === null || popupBg === void 0 ? void 0 : popupBg.horizontalMargin) !== null && _v !== void 0 ? _v : 0) * 2;
83
+ const height = commodityImgRatio ? width * (commodityImgRatio.h / commodityImgRatio.w) : width;
78
84
  const handleClickCollapse = () => {
79
85
  setSpread(!spread);
80
86
  };
@@ -94,6 +100,10 @@ Made in Italy` })));
94
100
  popupCurTimeRef.current = new Date();
95
101
  setCheckCommodityIndex(index);
96
102
  checkCommodityIndexRef.current = index;
103
+ if (ref === null || ref === void 0 ? void 0 : ref.current) {
104
+ ref.current.swiper.slideTo(0);
105
+ ref.current.swiper.autoplay.start();
106
+ }
97
107
  }, []);
98
108
  const renderCommodityGroup = (0, react_1.useCallback)(() => {
99
109
  var _a, _b, _c;
@@ -101,52 +111,69 @@ Made in Italy` })));
101
111
  return;
102
112
  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
113
  }, [checkCommodityIndex]);
114
+ const getDotsAlign = (0, react_1.useMemo)(() => {
115
+ const dotsAlignClass = {
116
+ left: 'commondityDetail-swiper-clickable-left',
117
+ center: 'commondityDetail-swiper-clickable-center',
118
+ right: 'commondityDetail-swiper-clickable-right'
119
+ };
120
+ return dotsAlignClass === null || dotsAlignClass === void 0 ? void 0 : dotsAlignClass[swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign];
121
+ }, [swiper === null || swiper === void 0 ? void 0 : swiper.dotsAlign]);
122
+ const iframeUrl = ((_x = (_w = data === null || data === void 0 ? void 0 : data.video) === null || _w === void 0 ? void 0 : _w.bindProduct) === null || _x === void 0 ? void 0 : _x.remark) || ((_0 = (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.bindProducts) === null || _z === void 0 ? void 0 : _z[0]) === null || _0 === void 0 ? void 0 : _0.remark) || ((_1 = data === null || data === void 0 ? void 0 : data.product) === null || _1 === void 0 ? void 0 : _1.remark);
104
123
  return (react_1.default.createElement("div", { className: 'pb-commondityDiroNew' },
105
124
  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' }))),
125
+ react_1.default.createElement("div", { style: { position: 'relative' } },
126
+ product && ((_2 = product === null || product === void 0 ? void 0 : product.homePage) === null || _2 === void 0 ? void 0 : _2.length) > 0 && (react_1.default.createElement(react_2.Swiper, { height: height, modules: [modules_1.Pagination, modules_1.Autoplay], pagination: {
127
+ clickable: true,
128
+ bulletActiveClass: 'commondityDiroNew-swipe-item-active-bullet',
129
+ clickableClass: getDotsAlign
130
+ }, loop: true, autoplay: {
131
+ delay: (swiper === null || swiper === void 0 ? void 0 : swiper.delay) * 1000
132
+ }, ref: ref }, (_3 = product === null || product === void 0 ? void 0 : product.homePage) === null || _3 === void 0 ? void 0 : _3.map((src) => {
133
+ var _a;
134
+ return (react_1.default.createElement(react_2.SwiperSlide, { key: src },
135
+ react_1.default.createElement("div", { style: {
136
+ overflow: 'hidden',
137
+ width,
138
+ height
139
+ } },
140
+ react_1.default.createElement(FormatImage_1.default, { style: {
141
+ height: '100%',
142
+ width: '100%',
143
+ objectFit: 'cover',
144
+ display: 'block',
145
+ objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? (swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
146
+ }, 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 }))));
147
+ }))),
148
+ !((_4 = product === null || product === void 0 ? void 0 : product.homePage) === null || _4 === void 0 ? void 0 : _4.length) && (react_1.default.createElement("div", { className: (0, css_1.css)({
149
+ height,
150
+ width
151
+ }) },
152
+ react_1.default.createElement("img", { className: (0, css_1.css)({
153
+ objectFit: 'cover',
154
+ width: '100%',
155
+ height: '100%'
156
+ }), src: (_5 = sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _5 !== void 0 ? _5 : bottom_image, alt: 'pdp image' }))),
157
+ (iframeUrl && iframeIcon) ||
158
+ (!product && iframeIcon && (react_1.default.createElement("div", { style: {
159
+ padding: '5px 10px',
160
+ display: 'flex',
161
+ alignItems: 'center',
162
+ position: 'absolute',
163
+ right: '10px',
164
+ bottom: '10px',
165
+ zIndex: 1,
166
+ background: '#fff',
167
+ borderRadius: '3px'
168
+ }, onClick: () => setShow3DModal(true) },
169
+ react_1.default.createElement("img", { src: iframeIcon, alt: '3d', width: '20px', height: '20px', style: { marginRight: '5px' } }),
170
+ react_1.default.createElement("span", { style: { fontSize: '12px' } }, "Try in 3D"))))),
144
171
  renderCommodityGroup(),
145
172
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content' },
146
173
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
147
174
  react_1.default.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
148
175
  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)
176
+ __html: (0, tool_1.setFontForText)((_6 = product === null || product === void 0 ? void 0 : product.title) !== null && _6 !== void 0 ? _6 : 'Large Dior Toujours BagLarge', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title)
150
177
  } }),
151
178
  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
179
  __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 +183,20 @@ Made in Italy` })));
156
183
  __html: (0, tool_1.setFontForText)(priceText, commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
157
184
  } }),
158
185
  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)
186
+ __html: (0, tool_1.setFontForText)((_7 = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _7 !== void 0 ? _7 : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
160
187
  } }))),
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 },
188
+ (!product || (product === null || product === void 0 ? void 0 : product.link)) && (react_1.default.createElement("button", { "aria-label": (_8 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _8 !== void 0 ? _8 : 'Shop now', onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle },
162
189
  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)
190
+ __html: (0, tool_1.setFontForText)((_9 = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _9 !== void 0 ? _9 : 'Shop now', buttonStyle)
164
191
  } }))),
165
192
  productInfoText({ isPost }))),
166
- react_1.default.createElement(Modal_1.default, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
193
+ react_1.default.createElement(Modal_1.default, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false })),
194
+ react_1.default.createElement(Modal_1.default, { visible: show3DModal, padding: 0, isFullScreen: true, onClose: () => setShow3DModal(false) },
195
+ react_1.default.createElement("iframe", { src: iframeUrl, style: {
196
+ width: '100%',
197
+ height: 'calc(100% - 50px)',
198
+ marginTop: '40px',
199
+ border: 'none'
200
+ } }))));
167
201
  };
168
202
  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: {
@@ -124,6 +135,13 @@ declare const _default: ({
124
135
  options?: undefined;
125
136
  initialValue?: undefined;
126
137
  child?: undefined;
138
+ } | {
139
+ label: string;
140
+ type: string;
141
+ name: string[];
142
+ initialValue: boolean;
143
+ options?: undefined;
144
+ child?: undefined;
127
145
  })[];
128
146
  }[];
129
147
  } | {
@@ -189,5 +207,13 @@ declare const _default: ({
189
207
  initialValue?: undefined;
190
208
  child?: undefined;
191
209
  })[];
210
+ } | {
211
+ title: string;
212
+ child: {
213
+ label: string;
214
+ type: string;
215
+ name: string[];
216
+ text: string;
217
+ }[];
192
218
  })[];
193
219
  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']
@@ -162,6 +197,12 @@ exports.default = [
162
197
  {
163
198
  label: '间距',
164
199
  type: 'TextSpace'
200
+ },
201
+ {
202
+ label: '价格千分符展示',
203
+ type: 'Switch',
204
+ name: ['enableFormattedPrice'],
205
+ initialValue: true
165
206
  }
166
207
  ]
167
208
  }
@@ -254,5 +295,16 @@ exports.default = [
254
295
  name: ['props', 'buttonStyle']
255
296
  }
256
297
  ]
298
+ },
299
+ {
300
+ title: 'Iframe商品弹窗',
301
+ child: [
302
+ {
303
+ label: '弹窗按钮',
304
+ type: 'Upload',
305
+ name: ['props', 'iframeIcon'],
306
+ text: '建议尺寸:106 * 41'
307
+ }
308
+ ]
257
309
  }
258
310
  ];
@@ -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: [
@@ -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',
@@ -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: {
@@ -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;