pb-sxp-ui 1.20.29 → 1.20.30

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.
package/dist/index.cjs CHANGED
@@ -19408,7 +19408,8 @@ const baseStyles = {
19408
19408
  // Carousel Section
19409
19409
  carouselSection: {
19410
19410
  width: '100%',
19411
- position: 'relative'
19411
+ position: 'relative',
19412
+ padding: '20px 16px'
19412
19413
  },
19413
19414
  carouselImageContainer: {
19414
19415
  width: '100%',
@@ -19439,7 +19440,7 @@ const baseStyles = {
19439
19440
  },
19440
19441
  carouselInfoSection: {
19441
19442
  width: '100%',
19442
- padding: '20px',
19443
+ padding: '10px 20px',
19443
19444
  backgroundColor: '#000',
19444
19445
  color: '#fff',
19445
19446
  textAlign: 'center'
@@ -19635,7 +19636,7 @@ const baseStyles = {
19635
19636
  }
19636
19637
  };
19637
19638
  const StructurePage = (_a) => {
19638
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
19639
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
19639
19640
  var { containerStyle, containerHeight = 664, containerWidth = 375, className = '', apiUrl = 'https://bff-be-dev.chatlabs.net/api/v1/recommend/list', requestBody, editorMode = false, multiCTAConfig: propMultiCTAConfig, videoPlayIcon: propVideoPlayIcon, isCmsMode = false, storyId, customHeaders } = _a, rest = __rest(_a, ["containerStyle", "containerHeight", "containerWidth", "className", "apiUrl", "requestBody", "editorMode", "multiCTAConfig", "videoPlayIcon", "isCmsMode", "storyId", "customHeaders"]);
19640
19641
  const [data, setData] = React.useState(null);
19641
19642
  const [loading, setLoading] = React.useState(true);
@@ -19720,7 +19721,7 @@ const StructurePage = (_a) => {
19720
19721
  const config = multiCTAConfig[configKey];
19721
19722
  // 定义允许的样式属性列表
19722
19723
  const styleKeys = [
19723
- 'fontSize', 'color', 'textAlign', 'fontWeight',
19724
+ 'fontSize', 'color', 'textAlign', 'fontWeight', 'fontStyle', 'textDecoration',
19724
19725
  'backgroundColor', 'padding', 'margin', 'borderRadius',
19725
19726
  'showBorder', 'borderWidth', 'borderColor',
19726
19727
  'buttonBackgroundColor', 'buttonTextColor', 'buttonWidth', 'buttonHeight'
@@ -19747,8 +19748,16 @@ const StructurePage = (_a) => {
19747
19748
  if (styleConfig.textAlign && typeof styleConfig.textAlign === 'string') {
19748
19749
  customStyle.textAlign = styleConfig.textAlign;
19749
19750
  }
19750
- if (styleConfig.fontWeight && typeof styleConfig.fontWeight === 'number') {
19751
- customStyle.fontWeight = styleConfig.fontWeight;
19751
+ if (styleConfig.fontWeight) {
19752
+ customStyle.fontWeight = typeof styleConfig.fontWeight === 'number'
19753
+ ? styleConfig.fontWeight
19754
+ : styleConfig.fontWeight;
19755
+ }
19756
+ if (styleConfig.fontStyle && typeof styleConfig.fontStyle === 'string') {
19757
+ customStyle.fontStyle = styleConfig.fontStyle;
19758
+ }
19759
+ if (styleConfig.textDecoration && typeof styleConfig.textDecoration === 'string') {
19760
+ customStyle.textDecoration = styleConfig.textDecoration;
19752
19761
  }
19753
19762
  if (styleConfig.backgroundColor && typeof styleConfig.backgroundColor === 'string') {
19754
19763
  customStyle.backgroundColor = styleConfig.backgroundColor;
@@ -20027,8 +20036,8 @@ const StructurePage = (_a) => {
20027
20036
  React.createElement("video", { ref: heroVideoRef, src: data.heroSection.url, style: baseStyles.heroVideo, autoPlay: true, muted: true, loop: true, playsInline: true, controls: false }),
20028
20037
  isHeroVideoPaused && (React.createElement(FormatImage$1, { className: 'clc-pb-video-pause', src: videoPlayIcon, alt: 'play' })))) : ((_e = data.heroSection.imgUrls) === null || _e === void 0 ? void 0 : _e[0]) ? (React.createElement("img", { src: data.heroSection.imgUrls[0], alt: 'Hero', style: baseStyles.heroImage })) : null,
20029
20038
  React.createElement("div", { style: baseStyles.heroOverlay }, renderCTA('heroButton', (_g = (_f = data.heroSection.bindProducts) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.bindCta, (_h = data.heroSection.bindProducts) === null || _h === void 0 ? void 0 : _h[0], baseStyles.heroButton))))),
20030
- data.carouselSection && data.carouselSection.length > 0 && (React.createElement("div", { style: mergeStyles(baseStyles.carouselSection, 'carouselSection') },
20031
- React.createElement("div", { style: baseStyles.carouselImageContainer },
20039
+ data.carouselSection && data.carouselSection.length > 0 && (React.createElement("div", { style: Object.assign(Object.assign({}, mergeStyles(baseStyles.carouselSection, 'carouselSection')), (((_j = multiCTAConfig === null || multiCTAConfig === void 0 ? void 0 : multiCTAConfig.carouselContainerStyle) === null || _j === void 0 ? void 0 : _j.padding) && { padding: multiCTAConfig.carouselContainerStyle.padding })) },
20040
+ React.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.carouselImageContainer), (((_k = multiCTAConfig === null || multiCTAConfig === void 0 ? void 0 : multiCTAConfig.carouselContainerStyle) === null || _k === void 0 ? void 0 : _k.aspectRatio) && { aspectRatio: multiCTAConfig.carouselContainerStyle.aspectRatio })) },
20032
20041
  React.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.carouselContainer), { transform: `translateX(-${carouselIndex * 100}%)` }) }, data.carouselSection.map((item, index) => {
20033
20042
  var _a;
20034
20043
  return (React.createElement("div", { key: item.itemId, style: baseStyles.carouselSlide }, item.url ? (React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' }, onClick: () => handleCarouselVideoClick(index) },
@@ -20040,13 +20049,14 @@ const StructurePage = (_a) => {
20040
20049
  React.createElement("button", { style: Object.assign(Object.assign({}, baseStyles.arrowButton), { left: '10px' }), onClick: handleCarouselPrev }, "\u2039"),
20041
20050
  React.createElement("button", { style: Object.assign(Object.assign({}, baseStyles.arrowButton), { right: '10px' }), onClick: handleCarouselNext }, "\u203A")),
20042
20051
  React.createElement("div", { style: mergeStyles(baseStyles.carouselInfoSection, 'carouselSection') },
20043
- ((_j = data.carouselSection[carouselIndex]) === null || _j === void 0 ? void 0 : _j.text) && (React.createElement("div", { style: mergeStyles(baseStyles.carouselText, 'carouselSection') }, (_k = data.carouselSection[carouselIndex]) === null || _k === void 0 ? void 0 : _k.text)),
20044
- renderCTA('carouselButton', (_o = (_m = (_l = data.carouselSection[carouselIndex]) === null || _l === void 0 ? void 0 : _l.bindProducts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.bindCta, (_q = (_p = data.carouselSection[carouselIndex]) === null || _p === void 0 ? void 0 : _p.bindProducts) === null || _q === void 0 ? void 0 : _q[0], baseStyles.carouselButton)))),
20052
+ ((_l = data.carouselSection[carouselIndex]) === null || _l === void 0 ? void 0 : _l.text) && (React.createElement("div", { style: mergeStyles(baseStyles.carouselText, 'carouselSection') }, (_m = data.carouselSection[carouselIndex]) === null || _m === void 0 ? void 0 : _m.text)),
20053
+ renderCTA('carouselButton', (_q = (_p = (_o = data.carouselSection[carouselIndex]) === null || _o === void 0 ? void 0 : _o.bindProducts) === null || _p === void 0 ? void 0 : _p[0]) === null || _q === void 0 ? void 0 : _q.bindCta, (_s = (_r = data.carouselSection[carouselIndex]) === null || _r === void 0 ? void 0 : _r.bindProducts) === null || _s === void 0 ? void 0 : _s[0], baseStyles.carouselButton)))),
20045
20054
  data.highlightRevealSection && (React.createElement("div", { style: mergeStyles(baseStyles.highlightSection, 'highlightSection') },
20046
20055
  React.createElement("div", { style: baseStyles.highlightImageContainer },
20047
20056
  React.createElement("img", { src: data.highlightRevealSection.landingImageUrl || data.highlightRevealSection.cover, alt: data.highlightRevealSection.title, style: baseStyles.highlightImage })),
20048
20057
  React.createElement("div", { style: mergeStyles(baseStyles.highlightInfoSection, 'highlightSection') },
20049
- React.createElement("div", { style: mergeStyles(baseStyles.highlightTitle, 'highlightSection') }, data.highlightRevealSection.title),
20058
+ data.highlightRevealSection.text && (React.createElement("div", { style: { marginBottom: '10px' } },
20059
+ React.createElement("div", { style: mergeStyles(baseStyles.highlightTitle, 'highlightSection') }, data.highlightRevealSection.text))),
20050
20060
  renderCTA('highlightButton', data.highlightRevealSection.bindCta, data.highlightRevealSection, baseStyles.highlightButton)))),
20051
20061
  data.productGridSection && data.productGridSection.length > 0 && (React.createElement("div", { style: mergeStyles(baseStyles.productGrid, 'productGrid') }, (() => {
20052
20062
  // 创建一个6格的网格 (3行 x 2列),根据position放置产品
@@ -20096,7 +20106,10 @@ const StructurePage = (_a) => {
20096
20106
  });
20097
20107
  })())),
20098
20108
  data.footerSection && (React.createElement("div", { style: mergeStyles(baseStyles.footerSection, 'footerSection') },
20099
- React.createElement("div", { style: mergeStyles(baseStyles.footerInfoSection, 'footerSection') }, renderCTA('footerButton', data.footerSection.bindCta, data.footerSection, baseStyles.footerButton)),
20109
+ React.createElement("div", { style: mergeStyles(baseStyles.footerInfoSection, 'footerSection') },
20110
+ data.footerSection.text && (React.createElement("div", { style: { marginBottom: '15px' } },
20111
+ React.createElement("div", { style: mergeStyles(baseStyles.footerText, 'footerSection') }, data.footerSection.text))),
20112
+ renderCTA('footerButton', data.footerSection.bindCta, data.footerSection, baseStyles.footerButton)),
20100
20113
  React.createElement("div", { style: baseStyles.footerImageContainer },
20101
20114
  React.createElement("img", { src: data.footerSection.landingImageUrl || data.footerSection.cover, alt: data.footerSection.title, style: baseStyles.footerImage }))))));
20102
20115
  };