diy-template-components 5.1.4 → 5.11.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.
package/build/index.js CHANGED
@@ -895,7 +895,7 @@ const someMethod1 = (/** @type {import('./types').IconData["svgChildrenConfigs"]
895
895
  }
896
896
  return obj;
897
897
  };
898
- const useStyles$1 = reactJss.createUseStyles({
898
+ const useStyles$2 = reactJss.createUseStyles({
899
899
  '@keyframes slideRight': {
900
900
  to: {
901
901
  backgroundPosition: '1250% 0, 0 0'
@@ -973,7 +973,7 @@ const Icon = ({
973
973
  // this ref is used to cancel the fetch promise success callback in case name prop changed
974
974
  const currentName = React.useRef(name);
975
975
  const [svgState, setSvgState] = React.useState(defaultSvgState);
976
- const styles = useStyles$1({
976
+ const styles = useStyles$2({
977
977
  width,
978
978
  height,
979
979
  color,
@@ -2562,7 +2562,87 @@ function FontSeeder({
2562
2562
  return null;
2563
2563
  }
2564
2564
 
2565
- insertStyle("@charset \"UTF-8\";\n/* Wrapper: no height/min-height – height comes only from section content, not from HOC */\n.sectionBackgroundWrapper {\n position: relative;\n width: 100%;\n overflow: hidden;\n}\n\n/* Section root transparent so background (image/color/gradient/video) shows through */\n.sectionBackgroundWrapper > .sectionBackgroundContent > * {\n background: transparent !important;\n}\n\n/* Video: absolute so it does not affect wrapper height; height follows section */\n.sectionBackgroundVideo {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n z-index: 0;\n pointer-events: none;\n}\n\n/* YouTube embed: cover background, no UI interaction, minimal branding via URL params */\n.sectionBackgroundYoutube {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 100vw;\n min-width: 100%;\n min-height: 100%;\n height: 56.25vw; /* 16:9 */\n min-height: 100vh;\n transform: translate(-50%, -50%);\n border: none;\n z-index: 0;\n pointer-events: none;\n}\n\n@media (min-aspect-ratio: 16/9) {\n .sectionBackgroundYoutube {\n width: 177.78vh;\n height: 100vh;\n min-width: 100%;\n min-height: 100%;\n }\n}\n/* Blur overlay: frosted glass so content stays readable over video/image/gradient */\n.sectionBackgroundBlur {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n pointer-events: none;\n /* backdrop-filter: blur(2px);\n -webkit-backdrop-filter: blur(2px); */\n /* background: rgba(255, 255, 255, 0.08); */\n}\n\n/* Content wrapper: above blur so component items are clear */\n.sectionBackgroundContent {\n position: relative;\n z-index: 2;\n}\n\n/* Background layer: fills wrapper only (absolute), does not affect wrapper height */\n.sectionBackgroundLayer {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 0;\n pointer-events: none;\n}\n\n.sectionBackgroundLayer.sectionBackgroundImage {\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n}");
2565
+ /**
2566
+ * JSS styles for section background wrapper (replaces styles.css).
2567
+ * Used with react-jss createUseStyles.
2568
+ */
2569
+ const sectionBackgroundStyles = () => ({
2570
+ /* Wrapper: no height/min-height – height comes only from section content */
2571
+ sectionBackgroundWrapper: {
2572
+ position: 'relative',
2573
+ width: '100%',
2574
+ overflow: 'hidden',
2575
+ '& > $sectionBackgroundContent > *': {
2576
+ background: 'transparent !important'
2577
+ }
2578
+ },
2579
+ /* Section root transparent so background (image/color/gradient/video) shows through */
2580
+ sectionBackgroundContent: {
2581
+ position: 'relative',
2582
+ zIndex: 2
2583
+ },
2584
+ /* Video: absolute so it does not affect wrapper height; height follows section */
2585
+ sectionBackgroundVideo: {
2586
+ position: 'absolute',
2587
+ top: 0,
2588
+ left: 0,
2589
+ width: '100%',
2590
+ height: '100%',
2591
+ objectFit: 'cover',
2592
+ zIndex: 0,
2593
+ pointerEvents: 'none'
2594
+ },
2595
+ /* YouTube embed: cover background, no UI interaction */
2596
+ sectionBackgroundYoutube: {
2597
+ position: 'absolute',
2598
+ top: '50%',
2599
+ left: '50%',
2600
+ width: '100vw',
2601
+ minWidth: '100%',
2602
+ minHeight: '100vh',
2603
+ height: '56.25vw' /* 16:9 */,
2604
+ transform: 'translate(-50%, -50%)',
2605
+ border: 'none',
2606
+ zIndex: 0,
2607
+ pointerEvents: 'none',
2608
+ '@media (min-aspect-ratio: 16/9)': {
2609
+ width: '177.78vh',
2610
+ height: '100vh',
2611
+ minWidth: '100%',
2612
+ minHeight: '100%'
2613
+ }
2614
+ },
2615
+ /* Blur overlay: frosted glass so content stays readable */
2616
+ sectionBackgroundBlur: {
2617
+ position: 'absolute',
2618
+ top: 0,
2619
+ left: 0,
2620
+ width: '100%',
2621
+ height: '100%',
2622
+ zIndex: 1,
2623
+ pointerEvents: 'none'
2624
+ },
2625
+ /* Background layer: fills wrapper only (absolute), does not affect wrapper height */
2626
+ sectionBackgroundLayer: {
2627
+ position: 'absolute',
2628
+ top: 0,
2629
+ left: 0,
2630
+ width: '100%',
2631
+ height: '100%',
2632
+ zIndex: 0,
2633
+ pointerEvents: 'none'
2634
+ },
2635
+ sectionBackgroundImage: {
2636
+ backgroundSize: 'cover',
2637
+ backgroundPosition: 'center',
2638
+ backgroundRepeat: 'no-repeat'
2639
+ },
2640
+ sectionBackgroundGradient: {
2641
+ /* inherits from sectionBackgroundLayer; gradient value comes from inline style */
2642
+ }
2643
+ });
2644
+
2645
+ const useStyles$1 = reactJss.createUseStyles(sectionBackgroundStyles);
2566
2646
 
2567
2647
  /**
2568
2648
  * Extracts YouTube video ID from various YouTube URL formats.
@@ -2581,6 +2661,13 @@ function getYoutubeVideoId(url) {
2581
2661
  return null;
2582
2662
  }
2583
2663
 
2664
+ /**
2665
+ * Returns YouTube thumbnail URL for a video ID (used when app is in iframe and YouTube iframe won't play).
2666
+ */
2667
+ function getYoutubeThumbnailUrl(videoId) {
2668
+ return `https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`;
2669
+ }
2670
+
2584
2671
  /**
2585
2672
  * Builds YouTube embed URL with params for background video:
2586
2673
  * autoplay, mute, loop (via playlist), no controls, minimal branding, no end-screen suggestions.
@@ -2624,10 +2711,13 @@ function withSectionBackground(WrappedSectionRenderer) {
2624
2711
  sectionIndex,
2625
2712
  ...restProps
2626
2713
  } = props;
2714
+ const {
2715
+ isMobile
2716
+ } = React.useContext(PageContext);
2717
+ const classes = useStyles$1();
2627
2718
 
2628
2719
  // Use props first, then fall back to sectionData so it works for all sections
2629
2720
  const componentBg = componentBgProp ?? {};
2630
- console.log('amit1111', componentBg, isSkipV2Section, sectionData);
2631
2721
 
2632
2722
  // version !== 2: skip background — render section only, no wrapper
2633
2723
 
@@ -2681,7 +2771,7 @@ function withSectionBackground(WrappedSectionRenderer) {
2681
2771
  return {};
2682
2772
  }
2683
2773
  };
2684
- const layerClassName = type === 'image' ? 'sectionBackgroundLayer sectionBackgroundImage' : type === 'gradient' ? 'sectionBackgroundLayer sectionBackgroundGradient' : 'sectionBackgroundLayer';
2774
+ const layerClassName = type === 'image' ? `${classes.sectionBackgroundLayer} ${classes.sectionBackgroundImage}` : type === 'gradient' ? `${classes.sectionBackgroundLayer} ${classes.sectionBackgroundGradient}` : classes.sectionBackgroundLayer;
2685
2775
 
2686
2776
  // Video background: YouTube embed (when isYoutube/isYoutubeVideo) or normal <video> from url
2687
2777
  if (type === 'video') {
@@ -2690,9 +2780,9 @@ function withSectionBackground(WrappedSectionRenderer) {
2690
2780
  if (!videoId) {
2691
2781
  // Fallback to normal video if we can't parse YouTube ID
2692
2782
  return /*#__PURE__*/React__default["default"].createElement("div", {
2693
- className: "sectionBackgroundWrapper"
2783
+ className: classes.sectionBackgroundWrapper
2694
2784
  }, /*#__PURE__*/React__default["default"].createElement("video", {
2695
- className: "sectionBackgroundVideo",
2785
+ className: classes.sectionBackgroundVideo,
2696
2786
  src: value,
2697
2787
  autoPlay: true,
2698
2788
  muted: true,
@@ -2700,10 +2790,33 @@ function withSectionBackground(WrappedSectionRenderer) {
2700
2790
  playsInline: true,
2701
2791
  "aria-hidden": "true"
2702
2792
  }), /*#__PURE__*/React__default["default"].createElement("div", {
2703
- className: "sectionBackgroundBlur",
2793
+ className: classes.sectionBackgroundBlur,
2704
2794
  "aria-hidden": "true"
2705
2795
  }), /*#__PURE__*/React__default["default"].createElement("div", {
2706
- className: "sectionBackgroundContent"
2796
+ className: classes.sectionBackgroundContent
2797
+ }, /*#__PURE__*/React__default["default"].createElement(WrappedSectionRenderer, _extends({
2798
+ sectionData: sectionData,
2799
+ extraProps: extraProps,
2800
+ sectionIndex: sectionIndex
2801
+ }, restProps))));
2802
+ }
2803
+ // When isMobile is true, app is rendered inside an iframe; YouTube iframe often fails in nested iframes.
2804
+ // Use static YouTube thumbnail as background instead of the YouTube player.
2805
+ if (isMobile) {
2806
+ const thumbUrl = getYoutubeThumbnailUrl(videoId);
2807
+ return /*#__PURE__*/React__default["default"].createElement("div", {
2808
+ className: classes.sectionBackgroundWrapper
2809
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
2810
+ className: `${classes.sectionBackgroundLayer} ${classes.sectionBackgroundImage}`,
2811
+ style: {
2812
+ backgroundImage: `url(${thumbUrl})`
2813
+ },
2814
+ "aria-hidden": "true"
2815
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
2816
+ className: classes.sectionBackgroundBlur,
2817
+ "aria-hidden": "true"
2818
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
2819
+ className: classes.sectionBackgroundContent
2707
2820
  }, /*#__PURE__*/React__default["default"].createElement(WrappedSectionRenderer, _extends({
2708
2821
  sectionData: sectionData,
2709
2822
  extraProps: extraProps,
@@ -2712,19 +2825,20 @@ function withSectionBackground(WrappedSectionRenderer) {
2712
2825
  }
2713
2826
  const embedUrl = getYoutubeEmbedUrl(videoId);
2714
2827
  return /*#__PURE__*/React__default["default"].createElement("div", {
2715
- className: "sectionBackgroundWrapper"
2828
+ className: classes.sectionBackgroundWrapper
2716
2829
  }, /*#__PURE__*/React__default["default"].createElement("iframe", {
2717
- className: "sectionBackgroundYoutube",
2830
+ className: classes.sectionBackgroundYoutube,
2718
2831
  src: embedUrl,
2719
2832
  title: "Background video",
2720
- allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope",
2833
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
2721
2834
  allowFullScreen: true,
2835
+ referrerPolicy: "strict-origin-when-cross-origin",
2722
2836
  "aria-hidden": "true"
2723
2837
  }), /*#__PURE__*/React__default["default"].createElement("div", {
2724
- className: "sectionBackgroundBlur",
2838
+ className: classes.sectionBackgroundBlur,
2725
2839
  "aria-hidden": "true"
2726
2840
  }), /*#__PURE__*/React__default["default"].createElement("div", {
2727
- className: "sectionBackgroundContent"
2841
+ className: classes.sectionBackgroundContent
2728
2842
  }, /*#__PURE__*/React__default["default"].createElement(WrappedSectionRenderer, _extends({
2729
2843
  sectionData: sectionData,
2730
2844
  extraProps: extraProps,
@@ -2733,9 +2847,9 @@ function withSectionBackground(WrappedSectionRenderer) {
2733
2847
  }
2734
2848
  // Normal video from URL
2735
2849
  return /*#__PURE__*/React__default["default"].createElement("div", {
2736
- className: "sectionBackgroundWrapper"
2850
+ className: classes.sectionBackgroundWrapper
2737
2851
  }, /*#__PURE__*/React__default["default"].createElement("video", {
2738
- className: "sectionBackgroundVideo",
2852
+ className: classes.sectionBackgroundVideo,
2739
2853
  src: value,
2740
2854
  autoPlay: true,
2741
2855
  muted: true,
@@ -2743,10 +2857,10 @@ function withSectionBackground(WrappedSectionRenderer) {
2743
2857
  playsInline: true,
2744
2858
  "aria-hidden": "true"
2745
2859
  }), /*#__PURE__*/React__default["default"].createElement("div", {
2746
- className: "sectionBackgroundBlur",
2860
+ className: classes.sectionBackgroundBlur,
2747
2861
  "aria-hidden": "true"
2748
2862
  }), /*#__PURE__*/React__default["default"].createElement("div", {
2749
- className: "sectionBackgroundContent"
2863
+ className: classes.sectionBackgroundContent
2750
2864
  }, /*#__PURE__*/React__default["default"].createElement(WrappedSectionRenderer, _extends({
2751
2865
  sectionData: sectionData,
2752
2866
  extraProps: extraProps,
@@ -2756,16 +2870,17 @@ function withSectionBackground(WrappedSectionRenderer) {
2756
2870
 
2757
2871
  // color | image | gradient: background layer behind content so section can be transparent
2758
2872
  return /*#__PURE__*/React__default["default"].createElement("div", {
2759
- className: "sectionBackgroundWrapper"
2873
+ className: classes.sectionBackgroundWrapper,
2874
+ style: isMobile ? getLayerStyle() : {}
2760
2875
  }, /*#__PURE__*/React__default["default"].createElement("div", {
2761
2876
  className: layerClassName,
2762
2877
  style: getLayerStyle(),
2763
2878
  "aria-hidden": "true"
2764
2879
  }), /*#__PURE__*/React__default["default"].createElement("div", {
2765
- className: "sectionBackgroundBlur",
2880
+ className: classes.sectionBackgroundBlur,
2766
2881
  "aria-hidden": "true"
2767
2882
  }), /*#__PURE__*/React__default["default"].createElement("div", {
2768
- className: "sectionBackgroundContent"
2883
+ className: classes.sectionBackgroundContent
2769
2884
  }, /*#__PURE__*/React__default["default"].createElement(WrappedSectionRenderer, _extends({
2770
2885
  sectionData: sectionData,
2771
2886
  extraProps: extraProps,
@@ -5531,8 +5646,9 @@ function VideoPlayer(props) {
5531
5646
  className: classes.iframe + ' ' + classes.hideImg,
5532
5647
  src: imageUrl ? getId(videoUrl) + '?autoplay=1' : getId(videoUrl),
5533
5648
  frameBorder: "0",
5534
- allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
5649
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
5535
5650
  allowFullScreen: true,
5651
+ referrerPolicy: "strict-origin-when-cross-origin",
5536
5652
  onLoad: () => {
5537
5653
  setIsLoaded(true);
5538
5654
  }
@@ -11800,7 +11916,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
11800
11916
  } = {}) => backgroundImage ? `url("${backgroundImage}")` : 'none',
11801
11917
  backgroundColor: ({
11802
11918
  backgroundColor
11803
- } = {}) => backgroundColor || '#f8f8fa',
11919
+ } = {}) => backgroundColor || theme?.colors?.background2,
11804
11920
  backgroundSize: 'cover',
11805
11921
  backgroundPosition: 'center',
11806
11922
  backgroundRepeat: 'no-repeat',
@@ -11821,7 +11937,8 @@ const useCounterSectionStyles = createUseStyles(theme => {
11821
11937
  },
11822
11938
  grid: {
11823
11939
  display: 'grid',
11824
- gridTemplateColumns: 'repeat(4, 1fr)',
11940
+ gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))',
11941
+ // fits 4 columns in desktop
11825
11942
  gap: ({
11826
11943
  isMobile
11827
11944
  } = {}) => isMobile ? '24px' : '32px',
@@ -11840,7 +11957,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
11840
11957
  fontSize: '64px',
11841
11958
  fontWeight: theme.typography?.fontWeight?.bold,
11842
11959
  lineHeight: 1.1,
11843
- color: 'rgba(247, 37, 133, 1)' ,
11960
+ color: theme?.colors?.AccentColor,
11844
11961
  wordBreak: 'break-word'
11845
11962
  },
11846
11963
  description: {
@@ -11848,7 +11965,7 @@ const useCounterSectionStyles = createUseStyles(theme => {
11848
11965
  fontSize: '20px',
11849
11966
  lineHeight: 1.4,
11850
11967
  fontWeight: '700',
11851
- color: 'rgba(51, 51, 51, 1)' ,
11968
+ color: theme?.colors?.font3,
11852
11969
  wordBreak: 'break-word'
11853
11970
  },
11854
11971
  '@media (max-width: 1024px)': {
@@ -11878,6 +11995,83 @@ const useCounterSectionStyles = createUseStyles(theme => {
11878
11995
  };
11879
11996
  });
11880
11997
 
11998
+ const DURATION_MS = 2000;
11999
+ const EASING = t => 1 - Math.pow(1 - t, 3); // easeOutCubic
12000
+
12001
+ function parseCounterValue(value) {
12002
+ if (value == null || value === '') return null;
12003
+ const match = String(value).trim().match(/^([\d.]+)(.*)$/);
12004
+ if (!match) return null;
12005
+ const num = parseFloat(match[1]);
12006
+ if (Number.isNaN(num)) return null;
12007
+ return {
12008
+ end: num,
12009
+ suffix: match[2] || ''
12010
+ };
12011
+ }
12012
+ function AnimatedCounter({
12013
+ value,
12014
+ className,
12015
+ refSetter
12016
+ }) {
12017
+ const elRef = React.useRef(null);
12018
+ const rafIdRef = React.useRef(null);
12019
+ const hasAnimatedRef = React.useRef(false);
12020
+ React.useLayoutEffect(() => {
12021
+ hasAnimatedRef.current = false; // Reset so we can re-animate when value changes (e.g. live edit)
12022
+ const parsed = parseCounterValue(value);
12023
+ if (!parsed || !elRef.current) return;
12024
+ const observer = new IntersectionObserver(entries => {
12025
+ const [entry] = entries;
12026
+ if (!entry.isIntersecting || hasAnimatedRef.current) return;
12027
+ hasAnimatedRef.current = true;
12028
+ const startTime = performance.now();
12029
+ const {
12030
+ end,
12031
+ suffix
12032
+ } = parsed;
12033
+ const tick = now => {
12034
+ const elapsed = now - startTime;
12035
+ const progress = Math.min(elapsed / DURATION_MS, 1);
12036
+ const eased = EASING(progress);
12037
+ const current = eased * end;
12038
+ if (elRef.current) {
12039
+ const displayValue = Number.isInteger(end) ? Math.round(current) : parseFloat(current.toFixed(2));
12040
+ elRef.current.textContent = displayValue + suffix;
12041
+ }
12042
+ if (progress < 1) {
12043
+ rafIdRef.current = requestAnimationFrame(tick);
12044
+ }
12045
+ };
12046
+ rafIdRef.current = requestAnimationFrame(tick);
12047
+ }, {
12048
+ threshold: 0.2
12049
+ });
12050
+ observer.observe(elRef.current);
12051
+ return () => {
12052
+ observer.disconnect();
12053
+ if (rafIdRef.current) cancelAnimationFrame(rafIdRef.current);
12054
+ };
12055
+ }, [value]);
12056
+ const parsed = parseCounterValue(value);
12057
+ const setRef = el => {
12058
+ elRef.current = el;
12059
+ refSetter?.(el);
12060
+ };
12061
+ if (parsed) {
12062
+ return /*#__PURE__*/React__default["default"].createElement("h2", {
12063
+ ref: setRef,
12064
+ className: className
12065
+ }, "0", parsed.suffix);
12066
+ }
12067
+ return /*#__PURE__*/React__default["default"].createElement("h2", {
12068
+ ref: refSetter,
12069
+ className: className,
12070
+ dangerouslySetInnerHTML: {
12071
+ __html: value
12072
+ }
12073
+ });
12074
+ }
11881
12075
  function CounterSection({
11882
12076
  sectionData,
11883
12077
  sectionIndex
@@ -11888,44 +12082,49 @@ function CounterSection({
11888
12082
  },
11889
12083
  isMobile
11890
12084
  } = React.useContext(PageContext);
11891
- console.log('llll', sectionData);
11892
- sectionData.components = sectionData.components;
11893
12085
  const metadata = sectionData.metadata || {};
11894
12086
  const backgroundImage = metadata.backgroundImage || '';
11895
- const backgroundColor = metadata.backgroundColor || '#f8f8fa';
12087
+ const backgroundColor = metadata.backgroundColor;
11896
12088
  const classes = useCounterSectionStyles({
11897
12089
  containerWidth,
11898
12090
  isMobile,
11899
12091
  backgroundImage: backgroundImage || null,
11900
12092
  backgroundColor
11901
12093
  });
11902
- const cardData = sectionData?.components[0];
11903
- const [sectionComponent] = sectionData.components || [];
12094
+ const cardData = sectionData?.components?.[0];
12095
+ const [sectionComponent] = sectionData?.components || [];
11904
12096
  const counterSection = sectionComponent?.counterSection;
11905
- counterSection?.components || [];
12097
+ const counters = counterSection?.components || [];
12098
+ const items = cardData?.contentList?.components || counters;
11906
12099
  if (!cardData) return null;
12100
+ const getValue = item => item?.contentHeading?.metadata?.value ?? item?.value?.metadata?.value;
12101
+ const getDescription = item => item?.contentPara?.metadata?.value ?? item?.description?.metadata?.value;
12102
+ const getValueRefSetter = item => item?.contentHeading?.refSetter ?? item?.value?.refSetter;
12103
+ const getDescRefSetter = item => item?.contentPara?.refSetter ?? item?.description?.refSetter;
11907
12104
  return /*#__PURE__*/React__default["default"].createElement("section", {
11908
12105
  className: classes.section
11909
12106
  }, /*#__PURE__*/React__default["default"].createElement("div", {
11910
12107
  className: classes.container
11911
12108
  }, /*#__PURE__*/React__default["default"].createElement("div", {
11912
12109
  className: classes.grid
11913
- }, cardData?.contentList?.components?.map((item, index) => /*#__PURE__*/React__default["default"].createElement("div", {
11914
- key: item._id || index,
11915
- className: classes.counterItem
11916
- }, item.contentHeading?.metadata?.value != null && item.contentHeading?.metadata?.value !== '' && /*#__PURE__*/React__default["default"].createElement("h2", {
11917
- ref: item.contentHeading?.refSetter,
11918
- className: classes.value,
11919
- dangerouslySetInnerHTML: {
11920
- __html: item.contentHeading.metadata.value
11921
- }
11922
- }), item.contentPara?.metadata?.value != null && item.contentPara?.metadata?.value !== '' && /*#__PURE__*/React__default["default"].createElement("p", {
11923
- ref: item.contentPara?.refSetter,
11924
- className: classes.description,
11925
- dangerouslySetInnerHTML: {
11926
- __html: item.contentPara.metadata.value
11927
- }
11928
- }))))));
12110
+ }, items?.map((item, index) => {
12111
+ const value = getValue(item);
12112
+ const description = getDescription(item);
12113
+ return /*#__PURE__*/React__default["default"].createElement("div", {
12114
+ key: item._id || index,
12115
+ className: classes.counterItem
12116
+ }, value != null && value !== '' && /*#__PURE__*/React__default["default"].createElement(AnimatedCounter, {
12117
+ value: value,
12118
+ className: classes.value,
12119
+ refSetter: getValueRefSetter(item)
12120
+ }), description != null && description !== '' && /*#__PURE__*/React__default["default"].createElement("p", {
12121
+ ref: getDescRefSetter(item),
12122
+ className: classes.description,
12123
+ dangerouslySetInnerHTML: {
12124
+ __html: description
12125
+ }
12126
+ }));
12127
+ }))));
11929
12128
  }
11930
12129
 
11931
12130
  var index$5 = /*#__PURE__*/Object.freeze({
@@ -11942,12 +12141,13 @@ const BREAKPOINTS = {
11942
12141
  /**
11943
12142
  * Get current breakpoint from window width
11944
12143
  */
11945
- const getBreakpoint = width => {
12144
+ const getBreakpoint = (width, isMobile) => {
12145
+ if (isMobile) return 'mobile';
11946
12146
  if (width >= BREAKPOINTS.desktop) return 'desktop';
11947
12147
  if (width >= BREAKPOINTS.tablet) return 'tablet';
11948
12148
  return 'mobile';
11949
12149
  };
11950
- const stickyBarBase = {
12150
+ const getStickyBarBase = theme => ({
11951
12151
  position: 'fixed',
11952
12152
  left: 0,
11953
12153
  right: 0,
@@ -11956,100 +12156,86 @@ const stickyBarBase = {
11956
12156
  display: 'flex',
11957
12157
  alignItems: 'center',
11958
12158
  justifyContent: 'center',
11959
- backgroundColor: '#F8F9FB',
11960
- boxShadow: '0 -2px 8px rgba(0, 0, 0, 0.06)',
11961
- borderTop: '1px solid #E5E7EB'
11962
- };
11963
- const stickyBarResponsive = {
11964
- mobile: {
11965
- ...stickyBarBase,
11966
- padding: '12px 16px',
11967
- gap: '12px',
11968
- flexDirection: 'column',
11969
- alignItems: 'stretch'
11970
- },
11971
- tablet: {
11972
- ...stickyBarBase,
11973
- padding: '14px 24px',
11974
- gap: '16px',
11975
- flexDirection: 'row',
11976
- alignItems: 'center'
11977
- },
11978
- desktop: {
11979
- ...stickyBarBase,
11980
- padding: '16px 32px',
11981
- gap: '24px',
11982
- flexDirection: 'row',
11983
- alignItems: 'center'
11984
- }
12159
+ fontFamily: theme?.typography?.fontFamily,
12160
+ backgroundColor: theme?.colors?.ctaColor || '#FFFFFF',
12161
+ boxShadow: theme?.shadows?.secondary ?? '0 -2px 8px rgba(0, 0, 0, 0.06)',
12162
+ borderTop: `1px solid ${theme?.colors?.border2}`
12163
+ });
12164
+ const getStickyBarResponsive = (theme, bgColor) => {
12165
+ const base = getStickyBarBase(theme);
12166
+ return {
12167
+ mobile: {
12168
+ ...base,
12169
+ padding: '12px 16px',
12170
+ gap: '12px',
12171
+ flexDirection: 'column',
12172
+ alignItems: 'stretch',
12173
+ background: '#FFFFFF',
12174
+ color: theme?.colors?.CtaTextColor || 'white'
12175
+ },
12176
+ tablet: {
12177
+ ...base,
12178
+ padding: '14px 24px',
12179
+ gap: '16px',
12180
+ flexDirection: 'row',
12181
+ alignItems: 'center',
12182
+ background: '#FFFFFF',
12183
+ color: theme?.colors?.CtaTextColor || 'white'
12184
+ },
12185
+ desktop: {
12186
+ ...base,
12187
+ padding: '16px 32px',
12188
+ gap: '24px',
12189
+ flexDirection: 'row',
12190
+ alignItems: 'center',
12191
+ background: '#FFFFFF',
12192
+ color: theme?.colors?.CtaTextColor || 'white'
12193
+ }
12194
+ };
11985
12195
  };
11986
- const getStickyBarStyle = breakpoint => stickyBarResponsive[breakpoint] || stickyBarResponsive.mobile;
11987
- const stickyTextBase = {
11988
- color: '#343A40',
11989
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
12196
+ const getStickyBarStyle = (breakpoint, theme = {}, bgColor) => getStickyBarResponsive(theme)[breakpoint] || getStickyBarResponsive(theme).mobile;
12197
+ const getStickyTextBase = theme => ({
12198
+ color: theme?.colors?.font2,
12199
+ fontFamily: theme?.typography?.fontFamily ?? 'inherit',
11990
12200
  margin: 0
12201
+ });
12202
+ const getStickyTextResponsive = (theme, bgColor) => {
12203
+ const base = getStickyTextBase(theme);
12204
+ return {
12205
+ mobile: {
12206
+ ...base,
12207
+ fontSize: '13px',
12208
+ lineHeight: 1.4,
12209
+ textAlign: 'center',
12210
+ color: '#000000' ,
12211
+ background: '#FFFFFF'
12212
+ },
12213
+ tablet: {
12214
+ ...base,
12215
+ fontSize: '14px',
12216
+ lineHeight: 1.45,
12217
+ textAlign: 'left',
12218
+ color: '#000000' ,
12219
+ background: '#FFFFFF'
12220
+ },
12221
+ desktop: {
12222
+ ...base,
12223
+ fontSize: '15px',
12224
+ lineHeight: 1.5,
12225
+ textAlign: 'left',
12226
+ color: '#000000' ,
12227
+ background: '#FFFFFF'
12228
+ }
12229
+ };
11991
12230
  };
11992
- const stickyTextResponsive = {
11993
- mobile: {
11994
- ...stickyTextBase,
11995
- fontSize: '13px',
11996
- lineHeight: 1.4,
11997
- textAlign: 'center'
11998
- },
11999
- tablet: {
12000
- ...stickyTextBase,
12001
- fontSize: '14px',
12002
- lineHeight: 1.45,
12003
- textAlign: 'left'
12004
- },
12005
- desktop: {
12006
- ...stickyTextBase,
12007
- fontSize: '15px',
12008
- lineHeight: 1.5,
12009
- textAlign: 'left'
12010
- }
12011
- };
12012
- const getStickyTextStyle = breakpoint => stickyTextResponsive[breakpoint] || stickyTextResponsive.mobile;
12013
- const stickyButtonBase = {
12014
- backgroundColor: '#3366FF',
12015
- color: '#FFFFFF',
12016
- border: 'none',
12017
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
12018
- fontWeight: 600,
12019
- textTransform: 'uppercase',
12020
- letterSpacing: '0.02em',
12021
- cursor: 'pointer',
12022
- whiteSpace: 'nowrap',
12023
- flexShrink: 0
12024
- };
12025
- const stickyButtonResponsive = {
12026
- mobile: {
12027
- ...stickyButtonBase,
12028
- padding: '10px 20px',
12029
- fontSize: '12px',
12030
- borderRadius: '6px'
12031
- },
12032
- tablet: {
12033
- ...stickyButtonBase,
12034
- padding: '12px 24px',
12035
- fontSize: '13px',
12036
- borderRadius: '8px'
12037
- },
12038
- desktop: {
12039
- ...stickyButtonBase,
12040
- padding: '14px 28px',
12041
- fontSize: '14px',
12042
- borderRadius: '8px'
12043
- }
12044
- };
12045
- const getStickyButtonStyle = breakpoint => stickyButtonResponsive[breakpoint] || stickyButtonResponsive.mobile;
12231
+ const getStickyTextStyle = (breakpoint, theme = {}) => getStickyTextResponsive(theme)[breakpoint] || getStickyTextResponsive(theme).mobile;
12046
12232
 
12047
12233
  // --- Floating (WhatsApp) type ---
12048
12234
 
12049
- const floatingButtonBase = {
12235
+ const getFloatingButtonBase = theme => ({
12050
12236
  position: 'fixed',
12051
12237
  bottom: 24,
12052
- right: 24,
12238
+ right: 9,
12053
12239
  width: 'fit-content',
12054
12240
  marginLeft: 'auto',
12055
12241
  zIndex: 9999,
@@ -12057,47 +12243,53 @@ const floatingButtonBase = {
12057
12243
  alignItems: 'center',
12058
12244
  gap: '10px',
12059
12245
  padding: '12px 20px',
12060
- backgroundColor: '#FFFFFF',
12061
- border: '1px solid #E5E7EB',
12246
+ backgroundColor: theme?.colors?.ctaColor || '#FFFFFF',
12247
+ border: `1px solid ${theme?.palette?.border?.secondary ?? '#E5E7EB'}`,
12062
12248
  borderRadius: '9999px',
12063
- boxShadow: '0 4px 12px rgba(0, 0, 0, 0.1)',
12249
+ boxShadow: theme?.shadows?.primary ?? '0 4px 12px rgba(0, 0, 0, 0.1)',
12064
12250
  cursor: 'pointer',
12065
12251
  textDecoration: 'none',
12066
- fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
12067
- fontWeight: 700,
12252
+ fontFamily: theme?.typography?.fontFamily ?? 'inherit',
12253
+ fontWeight: theme?.typography?.fontWeight?.bold ?? 700,
12068
12254
  fontSize: '14px',
12069
12255
  textTransform: 'uppercase',
12070
12256
  letterSpacing: '0.02em',
12071
- color: '#000000',
12257
+ color: theme?.colors?.CtaTextColor || 'white',
12072
12258
  transition: 'box-shadow 0.2s ease, transform 0.2s ease'
12259
+ });
12260
+ const getFloatingButtonResponsive = theme => {
12261
+ const base = getFloatingButtonBase(theme);
12262
+ return {
12263
+ mobile: {
12264
+ ...base,
12265
+ bottom: 142,
12266
+ left: 16,
12267
+ padding: '10px 16px',
12268
+ gap: '8px',
12269
+ fontSize: '12px',
12270
+ background: theme?.colors?.ctaColor || '#FFFFFF'
12271
+ },
12272
+ tablet: {
12273
+ ...base,
12274
+ bottom: 20,
12275
+ left: 20,
12276
+ padding: '12px 18px',
12277
+ gap: '10px',
12278
+ fontSize: '13px',
12279
+ background: theme?.colors?.ctaColor || '#FFFFFF'
12280
+ },
12281
+ desktop: {
12282
+ ...base,
12283
+ bottom: 24,
12284
+ left: 24,
12285
+ padding: '12px 20px',
12286
+ gap: '10px',
12287
+ fontSize: '14px',
12288
+ background: theme?.colors?.ctaColor || '#FFFFFF'
12289
+ }
12290
+ };
12073
12291
  };
12074
- const floatingButtonResponsive = {
12075
- mobile: {
12076
- ...floatingButtonBase,
12077
- bottom: 16,
12078
- left: 16,
12079
- padding: '10px 16px',
12080
- gap: '8px',
12081
- fontSize: '12px'
12082
- },
12083
- tablet: {
12084
- ...floatingButtonBase,
12085
- bottom: 20,
12086
- left: 20,
12087
- padding: '12px 18px',
12088
- gap: '10px',
12089
- fontSize: '13px'
12090
- },
12091
- desktop: {
12092
- ...floatingButtonBase,
12093
- bottom: 24,
12094
- left: 24,
12095
- padding: '12px 20px',
12096
- gap: '10px',
12097
- fontSize: '14px'
12098
- }
12099
- };
12100
- const getFloatingButtonStyle = breakpoint => floatingButtonResponsive[breakpoint] || floatingButtonResponsive.mobile;
12292
+ const getFloatingButtonStyle = (breakpoint, theme = {}) => getFloatingButtonResponsive(theme)[breakpoint] || getFloatingButtonResponsive(theme).mobile;
12101
12293
  const whatsAppIconSvgSize = {
12102
12294
  mobile: 24,
12103
12295
  tablet: 26,
@@ -12185,12 +12377,17 @@ function StickyCta({
12185
12377
  whatsAppLabel = 'SUPPORT',
12186
12378
  whatsAppIconColor,
12187
12379
  whatsAppButtonBackgroundColor,
12188
- iconImageUrl
12380
+ iconImageUrl,
12381
+ nodeData,
12382
+ extraProps
12189
12383
  }) {
12190
- console.log('nishu03333', sectionData);
12384
+ const {
12385
+ isMobile
12386
+ } = React.useContext(PageContext);
12191
12387
  const node = sectionData?.components?.[0];
12192
12388
  const contentList = node?.contentList?.components || [];
12193
12389
  const showEditHint = sectionData?.isDefaultEditor ?? false;
12390
+ sectionData?.bgSection?.components?.[0]?.sectionBgData?.metadata?.value;
12194
12391
  const propsFromSection = node ? {
12195
12392
  type: node?.title?.metadata?.value ?? type,
12196
12393
  stickyMessage: contentList[1]?.contentPara?.metadata?.value ?? stickyMessage,
@@ -12213,8 +12410,9 @@ function StickyCta({
12213
12410
  whatsAppButtonBackgroundColor,
12214
12411
  iconImageUrl
12215
12412
  };
12216
- const whatsAppUrl = p?.whatsAppPhoneNumber ? p?.whatsAppPhoneNumber : buildWhatsAppUrl(p?.whatsAppPhoneNumber);
12217
- const [breakpoint, setBreakpoint] = React.useState(() => typeof window !== 'undefined' ? getBreakpoint(window.innerWidth) : 'mobile');
12413
+ const whatsAppUrl = buildWhatsAppUrl(p?.whatsAppPhoneNumber) ?? p?.whatsAppHref ?? '#';
12414
+ const theme = useTheme() || {};
12415
+ const [breakpoint, setBreakpoint] = React.useState(() => typeof window !== 'undefined' ? getBreakpoint(window.innerWidth, isMobile) : 'mobile');
12218
12416
  React.useEffect(() => {
12219
12417
  if (typeof window === 'undefined') return;
12220
12418
  const onResize = () => setBreakpoint(getBreakpoint(window.innerWidth));
@@ -12243,14 +12441,14 @@ function StickyCta({
12243
12441
  }, "Click on edit button to edit this section")) : null;
12244
12442
  if (p.type === 'floating') {
12245
12443
  const buttonStyle = {
12246
- ...getFloatingButtonStyle(breakpoint),
12444
+ ...getFloatingButtonStyle(breakpoint, theme),
12247
12445
  ...(p.whatsAppButtonBackgroundColor != null && {
12248
12446
  backgroundColor: p.whatsAppButtonBackgroundColor
12249
12447
  })
12250
12448
  };
12251
12449
  const iconSize = getWhatsAppIconSize(breakpoint);
12252
12450
  const iconColor = p.whatsAppIconColor ?? DEFAULT_WHATSAPP_ICON_COLOR;
12253
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, editHintBlock, /*#__PURE__*/React__default["default"].createElement("a", {
12451
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isMobile ? null : editHintBlock, /*#__PURE__*/React__default["default"].createElement("a", {
12254
12452
  href: whatsAppUrl,
12255
12453
  target: "_blank",
12256
12454
  rel: "noopener noreferrer",
@@ -12272,28 +12470,29 @@ function StickyCta({
12272
12470
  }), /*#__PURE__*/React__default["default"].createElement("span", null, p.whatsAppLabel)));
12273
12471
  }
12274
12472
 
12275
- // type === 'sticky' – button uses mobile number from props to build URL; click redirects to WhatsApp
12276
- const barStyle = getStickyBarStyle(breakpoint);
12277
- const textStyle = getStickyTextStyle(breakpoint);
12278
- const buttonStyle = getStickyButtonStyle(breakpoint);
12279
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, editHintBlock, /*#__PURE__*/React__default["default"].createElement("div", {
12473
+ // type === 'sticky' – use primary Button (same as other sections) linking to WhatsApp
12474
+ const barStyle = getStickyBarStyle(breakpoint, theme);
12475
+ const textStyle = getStickyTextStyle(breakpoint, theme);
12476
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isMobile ? null : editHintBlock, /*#__PURE__*/React__default["default"].createElement("div", {
12280
12477
  style: barStyle,
12281
- role: "banner"
12478
+ role: "banner",
12479
+ "access-cta-sticky": "DIY"
12282
12480
  }, /*#__PURE__*/React__default["default"].createElement("p", {
12283
12481
  style: textStyle
12284
- }, p.stickyMessage), /*#__PURE__*/React__default["default"].createElement("a", {
12285
- href: whatsAppUrl,
12286
- target: "_blank",
12287
- rel: "noopener noreferrer",
12288
- "access-cta-container": "DIY",
12289
- style: {
12290
- ...buttonStyle,
12291
- textDecoration: 'none',
12292
- display: 'inline-flex',
12293
- alignItems: 'center',
12294
- justifyContent: 'center'
12295
- }
12296
- }, p.stickyButtonText)));
12482
+ }, p.stickyMessage), /*#__PURE__*/React__default["default"].createElement(Button, {
12483
+ data: {
12484
+ isLink: 1,
12485
+ isExternal: 1,
12486
+ link: whatsAppUrl,
12487
+ value: p.stickyButtonText
12488
+ },
12489
+ type: "primary",
12490
+ styling: {
12491
+ background: theme?.colors?.ctaColor
12492
+ },
12493
+ size: breakpoint === 'mobile' ? 'small' : 'medium',
12494
+ "access-cta-container": "DIY"
12495
+ })));
12297
12496
  }
12298
12497
 
12299
12498
  var index$4 = /*#__PURE__*/Object.freeze({
@@ -12638,7 +12837,8 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12638
12837
  return {
12639
12838
  section: {
12640
12839
  width: '100%',
12641
- background: 'linear-gradient(135deg, #6b2d5c 0%, #4a3f6b 40%, #2d5a6b 70%, #3d6b5a 100%)',
12840
+ background: theme?.colors?.background2,
12841
+ color: theme?.colors?.font3,
12642
12842
  minHeight: '100%',
12643
12843
  '&, & *, & *:before, & *:after': {
12644
12844
  fontFamily: theme?.typography?.fontFamily,
@@ -12678,7 +12878,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12678
12878
  lineHeight: 1.25,
12679
12879
  letterSpacing: '3px',
12680
12880
  textTransform: 'uppercase',
12681
- color: theme.palette?.font?.invertedDefault || 'rgba(255,255,255,0.9)',
12682
12881
  wordBreak: 'break-word',
12683
12882
  fontWeight: theme.typography?.fontWeight?.regular
12684
12883
  },
@@ -12687,15 +12886,12 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12687
12886
  fontSize: theme.typography.fontSize.h2,
12688
12887
  lineHeight: 1.1,
12689
12888
  letterSpacing: '-1px',
12690
- fontWeight: theme.typography?.fontWeight?.bold,
12691
- color: theme.palette?.font?.invertedDefault || '#ffffff',
12692
12889
  wordBreak: 'break-word'
12693
12890
  },
12694
12891
  subHeading: {
12695
12892
  margin: 0,
12696
12893
  fontSize: theme.typography.fontSize.body,
12697
12894
  lineHeight: 1.5,
12698
- color: theme.palette?.font?.invertedDefault || 'rgba(255,255,255,0.95)',
12699
12895
  wordBreak: 'break-word',
12700
12896
  maxWidth: '600px'
12701
12897
  },
@@ -12741,7 +12937,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12741
12937
  margin: 0,
12742
12938
  fontSize: theme.typography.fontSize.body,
12743
12939
  fontWeight: theme.typography?.fontWeight?.semiBold,
12744
- color: '#ffffff',
12745
12940
  lineHeight: 1.3
12746
12941
  }
12747
12942
  },
@@ -12756,7 +12951,6 @@ const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12756
12951
  '& p': {
12757
12952
  margin: 0,
12758
12953
  fontSize: theme.typography.fontSize.body,
12759
- color: '#ffffff',
12760
12954
  lineHeight: 1.4
12761
12955
  }
12762
12956
  },