pb-sxp-ui 1.20.29 → 1.20.31

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.
@@ -81,38 +81,48 @@ const baseStyles = {
81
81
  },
82
82
  carouselSection: {
83
83
  width: '100%',
84
- position: 'relative'
84
+ position: 'relative',
85
+ padding: '20px'
85
86
  },
86
87
  carouselImageContainer: {
87
88
  width: '100%',
88
- height: 'auto',
89
+ maxWidth: '100%',
90
+ margin: '0 auto',
89
91
  position: 'relative',
90
- overflow: 'hidden'
92
+ overflow: 'hidden',
93
+ aspectRatio: '9 / 16',
94
+ touchAction: 'pan-y pinch-zoom'
91
95
  },
92
96
  carouselContainer: {
93
97
  display: 'flex',
94
- transition: 'transform 0.5s ease-in-out',
95
- width: '100%'
98
+ transition: 'transform 0.3s ease-out',
99
+ width: '100%',
100
+ height: '100%'
96
101
  },
97
102
  carouselSlide: {
98
103
  minWidth: '100%',
104
+ height: '100%',
99
105
  position: 'relative'
100
106
  },
101
107
  carouselImage: {
102
108
  width: '100%',
103
- height: 'auto',
109
+ height: '100%',
104
110
  display: 'block',
105
- objectFit: 'cover'
111
+ objectFit: 'cover',
112
+ userSelect: 'none',
113
+ WebkitUserDrag: 'none'
106
114
  },
107
115
  carouselVideo: {
108
116
  width: '100%',
109
- height: 'auto',
117
+ height: '100%',
110
118
  display: 'block',
111
- objectFit: 'cover'
119
+ objectFit: 'cover',
120
+ userSelect: 'none',
121
+ WebkitUserDrag: 'none'
112
122
  },
113
123
  carouselInfoSection: {
114
124
  width: '100%',
115
- padding: '20px',
125
+ padding: '10px 20px',
116
126
  backgroundColor: '#000',
117
127
  color: '#fff',
118
128
  textAlign: 'center'
@@ -311,6 +321,8 @@ const StructurePage = (_a) => {
311
321
  const [loading, setLoading] = useState(true);
312
322
  const [error, setError] = useState(null);
313
323
  const [carouselIndex, setCarouselIndex] = useState(0);
324
+ const [touchStart, setTouchStart] = useState(null);
325
+ const [touchEnd, setTouchEnd] = useState(null);
314
326
  const heroVideoRef = useRef(null);
315
327
  const carouselVideoRefs = useRef([]);
316
328
  const [isHeroVideoPaused, setIsHeroVideoPaused] = useState(false);
@@ -372,7 +384,7 @@ const StructurePage = (_a) => {
372
384
  }
373
385
  const config = multiCTAConfig[configKey];
374
386
  const styleKeys = [
375
- 'fontSize', 'color', 'textAlign', 'fontWeight',
387
+ 'fontSize', 'color', 'textAlign', 'fontWeight', 'fontStyle', 'textDecoration',
376
388
  'backgroundColor', 'padding', 'margin', 'borderRadius',
377
389
  'showBorder', 'borderWidth', 'borderColor',
378
390
  'buttonBackgroundColor', 'buttonTextColor', 'buttonWidth', 'buttonHeight'
@@ -396,8 +408,16 @@ const StructurePage = (_a) => {
396
408
  if (styleConfig.textAlign && typeof styleConfig.textAlign === 'string') {
397
409
  customStyle.textAlign = styleConfig.textAlign;
398
410
  }
399
- if (styleConfig.fontWeight && typeof styleConfig.fontWeight === 'number') {
400
- customStyle.fontWeight = styleConfig.fontWeight;
411
+ if (styleConfig.fontWeight) {
412
+ customStyle.fontWeight = typeof styleConfig.fontWeight === 'number'
413
+ ? styleConfig.fontWeight
414
+ : styleConfig.fontWeight;
415
+ }
416
+ if (styleConfig.fontStyle && typeof styleConfig.fontStyle === 'string') {
417
+ customStyle.fontStyle = styleConfig.fontStyle;
418
+ }
419
+ if (styleConfig.textDecoration && typeof styleConfig.textDecoration === 'string') {
420
+ customStyle.textDecoration = styleConfig.textDecoration;
401
421
  }
402
422
  if (styleConfig.backgroundColor && typeof styleConfig.backgroundColor === 'string') {
403
423
  customStyle.backgroundColor = styleConfig.backgroundColor;
@@ -620,6 +640,34 @@ const StructurePage = (_a) => {
620
640
  setCarouselIndex((prev) => (prev === data.carouselSection.length - 1 ? 0 : prev + 1));
621
641
  }
622
642
  };
643
+ const handleTouchStart = (e) => {
644
+ setTouchEnd(null);
645
+ setTouchStart(e.targetTouches[0].clientX);
646
+ };
647
+ const handleTouchMove = (e) => {
648
+ if (!touchStart)
649
+ return;
650
+ const currentTouch = e.targetTouches[0].clientX;
651
+ setTouchEnd(currentTouch);
652
+ const distance = Math.abs(touchStart - currentTouch);
653
+ if (distance > 10) {
654
+ e.preventDefault();
655
+ }
656
+ };
657
+ const handleTouchEnd = () => {
658
+ if (!touchStart || !touchEnd)
659
+ return;
660
+ const distance = touchStart - touchEnd;
661
+ const minSwipeDistance = 50;
662
+ if (distance > minSwipeDistance) {
663
+ handleCarouselNext();
664
+ }
665
+ else if (distance < -minSwipeDistance) {
666
+ handleCarouselPrev();
667
+ }
668
+ setTouchStart(null);
669
+ setTouchEnd(null);
670
+ };
623
671
  if (loading) {
624
672
  return (React.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.container), { height: containerHeight, width: containerWidth, display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff', fontSize: '16px' }) }, "Loading..."));
625
673
  }
@@ -640,14 +688,14 @@ const StructurePage = (_a) => {
640
688
  isHeroVideoPaused && (React.createElement(FormatImage, { 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,
641
689
  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))))),
642
690
  data.carouselSection && data.carouselSection.length > 0 && (React.createElement("div", { style: mergeStyles(baseStyles.carouselSection, 'carouselSection') },
643
- React.createElement("div", { style: baseStyles.carouselImageContainer },
691
+ React.createElement("div", { style: baseStyles.carouselImageContainer, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd },
644
692
  React.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.carouselContainer), { transform: `translateX(-${carouselIndex * 100}%)` }) }, data.carouselSection.map((item, index) => {
645
693
  var _a;
646
694
  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) },
647
695
  React.createElement("video", { ref: (el) => {
648
696
  carouselVideoRefs.current[index] = el;
649
- }, src: item.url, style: baseStyles.carouselVideo, muted: true, loop: true, playsInline: true, controls: false }),
650
- carouselVideoPausedStates[index] && (React.createElement(FormatImage, { className: 'clc-pb-video-pause', src: videoPlayIcon, alt: 'play' })))) : ((_a = item.imgUrls) === null || _a === void 0 ? void 0 : _a[0]) ? (React.createElement("img", { src: item.imgUrls[0], alt: item.text || 'Carousel', style: baseStyles.carouselImage })) : null));
697
+ }, src: item.url, style: baseStyles.carouselVideo, muted: true, loop: true, playsInline: true, controls: false, draggable: false, onDragStart: (e) => e.preventDefault() }),
698
+ carouselVideoPausedStates[index] && (React.createElement(FormatImage, { className: 'clc-pb-video-pause', src: videoPlayIcon, alt: 'play' })))) : ((_a = item.imgUrls) === null || _a === void 0 ? void 0 : _a[0]) ? (React.createElement("img", { src: item.imgUrls[0], alt: item.text || 'Carousel', style: baseStyles.carouselImage, draggable: false, onDragStart: (e) => e.preventDefault() })) : null));
651
699
  })),
652
700
  React.createElement("button", { style: Object.assign(Object.assign({}, baseStyles.arrowButton), { left: '10px' }), onClick: handleCarouselPrev }, "\u2039"),
653
701
  React.createElement("button", { style: Object.assign(Object.assign({}, baseStyles.arrowButton), { right: '10px' }), onClick: handleCarouselNext }, "\u203A")),
@@ -658,7 +706,8 @@ const StructurePage = (_a) => {
658
706
  React.createElement("div", { style: baseStyles.highlightImageContainer },
659
707
  React.createElement("img", { src: data.highlightRevealSection.landingImageUrl || data.highlightRevealSection.cover, alt: data.highlightRevealSection.title, style: baseStyles.highlightImage })),
660
708
  React.createElement("div", { style: mergeStyles(baseStyles.highlightInfoSection, 'highlightSection') },
661
- React.createElement("div", { style: mergeStyles(baseStyles.highlightTitle, 'highlightSection') }, data.highlightRevealSection.title),
709
+ data.highlightRevealSection.text && (React.createElement("div", { style: { marginBottom: '10px' } },
710
+ React.createElement("div", { style: mergeStyles(baseStyles.highlightTitle, 'highlightSection') }, data.highlightRevealSection.text))),
662
711
  renderCTA('highlightButton', data.highlightRevealSection.bindCta, data.highlightRevealSection, baseStyles.highlightButton)))),
663
712
  data.productGridSection && data.productGridSection.length > 0 && (React.createElement("div", { style: mergeStyles(baseStyles.productGrid, 'productGrid') }, (() => {
664
713
  const gridItems = [null, null, null, null, null, null];
@@ -700,7 +749,10 @@ const StructurePage = (_a) => {
700
749
  });
701
750
  })())),
702
751
  data.footerSection && (React.createElement("div", { style: mergeStyles(baseStyles.footerSection, 'footerSection') },
703
- React.createElement("div", { style: mergeStyles(baseStyles.footerInfoSection, 'footerSection') }, renderCTA('footerButton', data.footerSection.bindCta, data.footerSection, baseStyles.footerButton)),
752
+ React.createElement("div", { style: mergeStyles(baseStyles.footerInfoSection, 'footerSection') },
753
+ data.footerSection.text && (React.createElement("div", { style: { marginBottom: '15px' } },
754
+ React.createElement("div", { style: mergeStyles(baseStyles.footerText, 'footerSection') }, data.footerSection.text))),
755
+ renderCTA('footerButton', data.footerSection.bindCta, data.footerSection, baseStyles.footerButton)),
704
756
  React.createElement("div", { style: baseStyles.footerImageContainer },
705
757
  React.createElement("img", { src: data.footerSection.landingImageUrl || data.footerSection.cover, alt: data.footerSection.title, style: baseStyles.footerImage }))))));
706
758
  };
@@ -83,38 +83,48 @@ const baseStyles = {
83
83
  },
84
84
  carouselSection: {
85
85
  width: '100%',
86
- position: 'relative'
86
+ position: 'relative',
87
+ padding: '20px'
87
88
  },
88
89
  carouselImageContainer: {
89
90
  width: '100%',
90
- height: 'auto',
91
+ maxWidth: '100%',
92
+ margin: '0 auto',
91
93
  position: 'relative',
92
- overflow: 'hidden'
94
+ overflow: 'hidden',
95
+ aspectRatio: '9 / 16',
96
+ touchAction: 'pan-y pinch-zoom'
93
97
  },
94
98
  carouselContainer: {
95
99
  display: 'flex',
96
- transition: 'transform 0.5s ease-in-out',
97
- width: '100%'
100
+ transition: 'transform 0.3s ease-out',
101
+ width: '100%',
102
+ height: '100%'
98
103
  },
99
104
  carouselSlide: {
100
105
  minWidth: '100%',
106
+ height: '100%',
101
107
  position: 'relative'
102
108
  },
103
109
  carouselImage: {
104
110
  width: '100%',
105
- height: 'auto',
111
+ height: '100%',
106
112
  display: 'block',
107
- objectFit: 'cover'
113
+ objectFit: 'cover',
114
+ userSelect: 'none',
115
+ WebkitUserDrag: 'none'
108
116
  },
109
117
  carouselVideo: {
110
118
  width: '100%',
111
- height: 'auto',
119
+ height: '100%',
112
120
  display: 'block',
113
- objectFit: 'cover'
121
+ objectFit: 'cover',
122
+ userSelect: 'none',
123
+ WebkitUserDrag: 'none'
114
124
  },
115
125
  carouselInfoSection: {
116
126
  width: '100%',
117
- padding: '20px',
127
+ padding: '10px 20px',
118
128
  backgroundColor: '#000',
119
129
  color: '#fff',
120
130
  textAlign: 'center'
@@ -313,6 +323,8 @@ const StructurePage = (_a) => {
313
323
  const [loading, setLoading] = (0, react_1.useState)(true);
314
324
  const [error, setError] = (0, react_1.useState)(null);
315
325
  const [carouselIndex, setCarouselIndex] = (0, react_1.useState)(0);
326
+ const [touchStart, setTouchStart] = (0, react_1.useState)(null);
327
+ const [touchEnd, setTouchEnd] = (0, react_1.useState)(null);
316
328
  const heroVideoRef = (0, react_1.useRef)(null);
317
329
  const carouselVideoRefs = (0, react_1.useRef)([]);
318
330
  const [isHeroVideoPaused, setIsHeroVideoPaused] = (0, react_1.useState)(false);
@@ -374,7 +386,7 @@ const StructurePage = (_a) => {
374
386
  }
375
387
  const config = multiCTAConfig[configKey];
376
388
  const styleKeys = [
377
- 'fontSize', 'color', 'textAlign', 'fontWeight',
389
+ 'fontSize', 'color', 'textAlign', 'fontWeight', 'fontStyle', 'textDecoration',
378
390
  'backgroundColor', 'padding', 'margin', 'borderRadius',
379
391
  'showBorder', 'borderWidth', 'borderColor',
380
392
  'buttonBackgroundColor', 'buttonTextColor', 'buttonWidth', 'buttonHeight'
@@ -398,8 +410,16 @@ const StructurePage = (_a) => {
398
410
  if (styleConfig.textAlign && typeof styleConfig.textAlign === 'string') {
399
411
  customStyle.textAlign = styleConfig.textAlign;
400
412
  }
401
- if (styleConfig.fontWeight && typeof styleConfig.fontWeight === 'number') {
402
- customStyle.fontWeight = styleConfig.fontWeight;
413
+ if (styleConfig.fontWeight) {
414
+ customStyle.fontWeight = typeof styleConfig.fontWeight === 'number'
415
+ ? styleConfig.fontWeight
416
+ : styleConfig.fontWeight;
417
+ }
418
+ if (styleConfig.fontStyle && typeof styleConfig.fontStyle === 'string') {
419
+ customStyle.fontStyle = styleConfig.fontStyle;
420
+ }
421
+ if (styleConfig.textDecoration && typeof styleConfig.textDecoration === 'string') {
422
+ customStyle.textDecoration = styleConfig.textDecoration;
403
423
  }
404
424
  if (styleConfig.backgroundColor && typeof styleConfig.backgroundColor === 'string') {
405
425
  customStyle.backgroundColor = styleConfig.backgroundColor;
@@ -622,6 +642,34 @@ const StructurePage = (_a) => {
622
642
  setCarouselIndex((prev) => (prev === data.carouselSection.length - 1 ? 0 : prev + 1));
623
643
  }
624
644
  };
645
+ const handleTouchStart = (e) => {
646
+ setTouchEnd(null);
647
+ setTouchStart(e.targetTouches[0].clientX);
648
+ };
649
+ const handleTouchMove = (e) => {
650
+ if (!touchStart)
651
+ return;
652
+ const currentTouch = e.targetTouches[0].clientX;
653
+ setTouchEnd(currentTouch);
654
+ const distance = Math.abs(touchStart - currentTouch);
655
+ if (distance > 10) {
656
+ e.preventDefault();
657
+ }
658
+ };
659
+ const handleTouchEnd = () => {
660
+ if (!touchStart || !touchEnd)
661
+ return;
662
+ const distance = touchStart - touchEnd;
663
+ const minSwipeDistance = 50;
664
+ if (distance > minSwipeDistance) {
665
+ handleCarouselNext();
666
+ }
667
+ else if (distance < -minSwipeDistance) {
668
+ handleCarouselPrev();
669
+ }
670
+ setTouchStart(null);
671
+ setTouchEnd(null);
672
+ };
625
673
  if (loading) {
626
674
  return (react_1.default.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.container), { height: containerHeight, width: containerWidth, display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff', fontSize: '16px' }) }, "Loading..."));
627
675
  }
@@ -642,14 +690,14 @@ const StructurePage = (_a) => {
642
690
  isHeroVideoPaused && (react_1.default.createElement(FormatImage_1.default, { className: 'clc-pb-video-pause', src: videoPlayIcon, alt: 'play' })))) : ((_e = data.heroSection.imgUrls) === null || _e === void 0 ? void 0 : _e[0]) ? (react_1.default.createElement("img", { src: data.heroSection.imgUrls[0], alt: 'Hero', style: baseStyles.heroImage })) : null,
643
691
  react_1.default.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))))),
644
692
  data.carouselSection && data.carouselSection.length > 0 && (react_1.default.createElement("div", { style: mergeStyles(baseStyles.carouselSection, 'carouselSection') },
645
- react_1.default.createElement("div", { style: baseStyles.carouselImageContainer },
693
+ react_1.default.createElement("div", { style: baseStyles.carouselImageContainer, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd },
646
694
  react_1.default.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.carouselContainer), { transform: `translateX(-${carouselIndex * 100}%)` }) }, data.carouselSection.map((item, index) => {
647
695
  var _a;
648
696
  return (react_1.default.createElement("div", { key: item.itemId, style: baseStyles.carouselSlide }, item.url ? (react_1.default.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' }, onClick: () => handleCarouselVideoClick(index) },
649
697
  react_1.default.createElement("video", { ref: (el) => {
650
698
  carouselVideoRefs.current[index] = el;
651
- }, src: item.url, style: baseStyles.carouselVideo, muted: true, loop: true, playsInline: true, controls: false }),
652
- carouselVideoPausedStates[index] && (react_1.default.createElement(FormatImage_1.default, { className: 'clc-pb-video-pause', src: videoPlayIcon, alt: 'play' })))) : ((_a = item.imgUrls) === null || _a === void 0 ? void 0 : _a[0]) ? (react_1.default.createElement("img", { src: item.imgUrls[0], alt: item.text || 'Carousel', style: baseStyles.carouselImage })) : null));
699
+ }, src: item.url, style: baseStyles.carouselVideo, muted: true, loop: true, playsInline: true, controls: false, draggable: false, onDragStart: (e) => e.preventDefault() }),
700
+ carouselVideoPausedStates[index] && (react_1.default.createElement(FormatImage_1.default, { className: 'clc-pb-video-pause', src: videoPlayIcon, alt: 'play' })))) : ((_a = item.imgUrls) === null || _a === void 0 ? void 0 : _a[0]) ? (react_1.default.createElement("img", { src: item.imgUrls[0], alt: item.text || 'Carousel', style: baseStyles.carouselImage, draggable: false, onDragStart: (e) => e.preventDefault() })) : null));
653
701
  })),
654
702
  react_1.default.createElement("button", { style: Object.assign(Object.assign({}, baseStyles.arrowButton), { left: '10px' }), onClick: handleCarouselPrev }, "\u2039"),
655
703
  react_1.default.createElement("button", { style: Object.assign(Object.assign({}, baseStyles.arrowButton), { right: '10px' }), onClick: handleCarouselNext }, "\u203A")),
@@ -660,7 +708,8 @@ const StructurePage = (_a) => {
660
708
  react_1.default.createElement("div", { style: baseStyles.highlightImageContainer },
661
709
  react_1.default.createElement("img", { src: data.highlightRevealSection.landingImageUrl || data.highlightRevealSection.cover, alt: data.highlightRevealSection.title, style: baseStyles.highlightImage })),
662
710
  react_1.default.createElement("div", { style: mergeStyles(baseStyles.highlightInfoSection, 'highlightSection') },
663
- react_1.default.createElement("div", { style: mergeStyles(baseStyles.highlightTitle, 'highlightSection') }, data.highlightRevealSection.title),
711
+ data.highlightRevealSection.text && (react_1.default.createElement("div", { style: { marginBottom: '10px' } },
712
+ react_1.default.createElement("div", { style: mergeStyles(baseStyles.highlightTitle, 'highlightSection') }, data.highlightRevealSection.text))),
664
713
  renderCTA('highlightButton', data.highlightRevealSection.bindCta, data.highlightRevealSection, baseStyles.highlightButton)))),
665
714
  data.productGridSection && data.productGridSection.length > 0 && (react_1.default.createElement("div", { style: mergeStyles(baseStyles.productGrid, 'productGrid') }, (() => {
666
715
  const gridItems = [null, null, null, null, null, null];
@@ -702,7 +751,10 @@ const StructurePage = (_a) => {
702
751
  });
703
752
  })())),
704
753
  data.footerSection && (react_1.default.createElement("div", { style: mergeStyles(baseStyles.footerSection, 'footerSection') },
705
- react_1.default.createElement("div", { style: mergeStyles(baseStyles.footerInfoSection, 'footerSection') }, renderCTA('footerButton', data.footerSection.bindCta, data.footerSection, baseStyles.footerButton)),
754
+ react_1.default.createElement("div", { style: mergeStyles(baseStyles.footerInfoSection, 'footerSection') },
755
+ data.footerSection.text && (react_1.default.createElement("div", { style: { marginBottom: '15px' } },
756
+ react_1.default.createElement("div", { style: mergeStyles(baseStyles.footerText, 'footerSection') }, data.footerSection.text))),
757
+ renderCTA('footerButton', data.footerSection.bindCta, data.footerSection, baseStyles.footerButton)),
706
758
  react_1.default.createElement("div", { style: baseStyles.footerImageContainer },
707
759
  react_1.default.createElement("img", { src: data.footerSection.landingImageUrl || data.footerSection.cover, alt: data.footerSection.title, style: baseStyles.footerImage }))))));
708
760
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.20.29",
3
+ "version": "1.20.31",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",