pb-sxp-ui 1.20.21 → 1.20.24

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.
@@ -16,6 +16,7 @@ import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
16
16
  const CommodityDetail = (_a) => {
17
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;
18
18
  var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true, enableAddToCart = false, addToCartPopupId = '' } = _a, props = __rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive", "enableAddToCart", "addToCartPopupId"]);
19
+ console.log('[CommodityDetail] 组件已加载 - 版本 v1.20.23', { enableAddToCart, addToCartPopupId, isPost });
19
20
  const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
20
21
  const { jumpToWeb, productView } = useEventReport();
21
22
  const curTimeRef = useRef(null);
@@ -189,9 +190,30 @@ const CommodityDetail = (_a) => {
189
190
  };
190
191
  const renderBtn = () => {
191
192
  var _a, _b;
193
+ const handleBtnClick = (e) => {
194
+ console.log('[CommodityDetail] Shop Now 按钮被点击!!!!', {
195
+ product,
196
+ cta,
197
+ enableAddToCart,
198
+ addToCartPopupId,
199
+ productLink: product === null || product === void 0 ? void 0 : product.link
200
+ });
201
+ handleLink(e);
202
+ };
203
+ console.log('[CommodityDetail] renderBtn 被调用', {
204
+ ctaTitle: cta === null || cta === void 0 ? void 0 : cta.enTitle,
205
+ buttonStyle
206
+ });
192
207
  return (React.createElement(React.Fragment, null,
193
- React.createElement("a", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', role: 'button', tabIndex: 0, onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle },
194
- React.createElement("span", { dangerouslySetInnerHTML: {
208
+ React.createElement("a", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', role: 'button', tabIndex: 0, onClick: handleBtnClick, onMouseDown: (e) => {
209
+ console.log('[CommodityDetail] mousedown 事件触发!!!', e);
210
+ e.stopPropagation();
211
+ }, onPointerDown: (e) => {
212
+ console.log('[CommodityDetail] pointerdown 事件触发!!!', e);
213
+ }, onTouchStart: (e) => {
214
+ console.log('[CommodityDetail] touchstart 事件触发!!!', e);
215
+ }, className: 'pb-commondity-btn', style: Object.assign(Object.assign({}, buttonStyle), { pointerEvents: 'auto', touchAction: 'manipulation' }) },
216
+ React.createElement("span", { style: { pointerEvents: 'none' }, dangerouslySetInnerHTML: {
195
217
  __html: setFontForText((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
196
218
  } }))));
197
219
  };
@@ -240,7 +262,7 @@ const CommodityDetail = (_a) => {
240
262
  }, []);
241
263
  const isAlly = useMemo(() => getScreenReader(), []);
242
264
  return (React.createElement(React.Fragment, null,
243
- React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
265
+ React.createElement("div", Object.assign({ className: css(Object.assign(Object.assign({}, style), { position: 'relative' })) }, props),
244
266
  React.createElement("div", { style: { position: 'relative' }, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
245
267
  product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (React.createElement(Swiper, Object.assign({ height: height, modules: [Pagination, Autoplay, ...(isAlly ? [Navigation, A11y, Mousewheel, Keyboard] : [])], pagination: {
246
268
  clickable: true,
@@ -306,8 +328,8 @@ const CommodityDetail = (_a) => {
306
328
  }, onClick: () => setShow3DModal(true) },
307
329
  React.createElement("img", { src: iframeIcon, alt: '3d', width: '72px' })))),
308
330
  renderCommodityGroup(),
309
- React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
310
- renderBtn(),
331
+ React.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost })),
332
+ renderBtn()),
311
333
  React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) },
312
334
  React.createElement("div", { style: { paddingTop: '34px', paddingBottom: '80px' } }, renderContent({ isPost: false })),
313
335
  renderBtn()),
@@ -18,6 +18,7 @@ const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
18
18
  const CommodityDetail = (_a) => {
19
19
  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;
20
20
  var { content, style, bgImg, onClick, schema, isDefault, bottom_image, tipText, isPost, viewTime, rec, swiper, commodityStyles, buttonStyle, index, commodityGroup, popupBg, iframeIcon, commodityImgRatio, isTel, iframeBgColor, isActive = true, enableAddToCart = false, addToCartPopupId = '' } = _a, props = tslib_1.__rest(_a, ["content", "style", "bgImg", "onClick", "schema", "isDefault", "bottom_image", "tipText", "isPost", "viewTime", "rec", "swiper", "commodityStyles", "buttonStyle", "index", "commodityGroup", "popupBg", "iframeIcon", "commodityImgRatio", "isTel", "iframeBgColor", "isActive", "enableAddToCart", "addToCartPopupId"]);
21
+ console.log('[CommodityDetail] 组件已加载 - 版本 v1.20.23', { enableAddToCart, addToCartPopupId, isPost });
21
22
  const { sxpParameter, popupDetailData, isPreview, bffFbReport, popupCurTimeRef, checkCommodityIndexRef, globalConfig, ctaEvent, setPopupDetailData } = (0, hooks_1.useSxpDataSource)();
22
23
  const { jumpToWeb, productView } = (0, useEventReport_1.useEventReport)();
23
24
  const curTimeRef = (0, react_1.useRef)(null);
@@ -191,9 +192,30 @@ const CommodityDetail = (_a) => {
191
192
  };
192
193
  const renderBtn = () => {
193
194
  var _a, _b;
195
+ const handleBtnClick = (e) => {
196
+ console.log('[CommodityDetail] Shop Now 按钮被点击!!!!', {
197
+ product,
198
+ cta,
199
+ enableAddToCart,
200
+ addToCartPopupId,
201
+ productLink: product === null || product === void 0 ? void 0 : product.link
202
+ });
203
+ handleLink(e);
204
+ };
205
+ console.log('[CommodityDetail] renderBtn 被调用', {
206
+ ctaTitle: cta === null || cta === void 0 ? void 0 : cta.enTitle,
207
+ buttonStyle
208
+ });
194
209
  return (react_1.default.createElement(react_1.default.Fragment, null,
195
- react_1.default.createElement("a", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', role: 'button', tabIndex: 0, onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle },
196
- react_1.default.createElement("span", { dangerouslySetInnerHTML: {
210
+ react_1.default.createElement("a", { "aria-label": (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website', role: 'button', tabIndex: 0, onClick: handleBtnClick, onMouseDown: (e) => {
211
+ console.log('[CommodityDetail] mousedown 事件触发!!!', e);
212
+ e.stopPropagation();
213
+ }, onPointerDown: (e) => {
214
+ console.log('[CommodityDetail] pointerdown 事件触发!!!', e);
215
+ }, onTouchStart: (e) => {
216
+ console.log('[CommodityDetail] touchstart 事件触发!!!', e);
217
+ }, className: 'pb-commondity-btn', style: Object.assign(Object.assign({}, buttonStyle), { pointerEvents: 'auto', touchAction: 'manipulation' }) },
218
+ react_1.default.createElement("span", { style: { pointerEvents: 'none' }, dangerouslySetInnerHTML: {
197
219
  __html: (0, tool_1.setFontForText)((_b = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _b !== void 0 ? _b : 'Purchase on Website', buttonStyle)
198
220
  } }))));
199
221
  };
@@ -242,7 +264,7 @@ const CommodityDetail = (_a) => {
242
264
  }, []);
243
265
  const isAlly = (0, react_1.useMemo)(() => (0, tool_1.getScreenReader)(), []);
244
266
  return (react_1.default.createElement(react_1.default.Fragment, null,
245
- react_1.default.createElement("div", Object.assign({ className: (0, css_1.css)(Object.assign({}, style)) }, props),
267
+ react_1.default.createElement("div", Object.assign({ className: (0, css_1.css)(Object.assign(Object.assign({}, style), { position: 'relative' })) }, props),
246
268
  react_1.default.createElement("div", { style: { position: 'relative' }, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
247
269
  product && ((_w = product === null || product === void 0 ? void 0 : product.homePage) === null || _w === void 0 ? void 0 : _w.length) > 0 && (react_1.default.createElement(react_2.Swiper, Object.assign({ height: height, modules: [modules_1.Pagination, modules_1.Autoplay, ...(isAlly ? [modules_1.Navigation, modules_1.A11y, modules_1.Mousewheel, modules_1.Keyboard] : [])], pagination: {
248
270
  clickable: true,
@@ -308,8 +330,8 @@ const CommodityDetail = (_a) => {
308
330
  }, onClick: () => setShow3DModal(true) },
309
331
  react_1.default.createElement("img", { src: iframeIcon, alt: '3d', width: '72px' })))),
310
332
  renderCommodityGroup(),
311
- react_1.default.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost }))),
312
- renderBtn(),
333
+ react_1.default.createElement("div", { className: 'pb-commondity-content' }, renderContent({ isPost })),
334
+ renderBtn()),
313
335
  react_1.default.createElement(Modal_1.default, { visible: showModal, onClose: () => setShowModal(false) },
314
336
  react_1.default.createElement("div", { style: { paddingTop: '34px', paddingBottom: '80px' } }, renderContent({ isPost: false })),
315
337
  renderBtn()),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.20.21",
3
+ "version": "1.20.24",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",