diy-template-components 0.2.49 → 0.2.53

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
@@ -2,15 +2,15 @@
2
2
 
3
3
 
4
4
 
5
- function ___$insertStyle(css) {
6
- if (!css || !window) {
7
- return;
8
- }
9
- const style = document.createElement('style');
10
- style.setAttribute('type', 'text/css');
11
- style.innerHTML = css;
12
- document.head.appendChild(style);
13
- return css;
5
+ function ___$insertStyle(css) {
6
+ if (!css || typeof window === 'undefined') {
7
+ return;
8
+ }
9
+ const style = document.createElement('style');
10
+ style.setAttribute('type', 'text/css');
11
+ style.innerHTML = css;
12
+ document.head.appendChild(style);
13
+ return css;
14
14
  }
15
15
 
16
16
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1156,7 +1156,7 @@ const NextImageRenderer = ({
1156
1156
  refSetter,
1157
1157
  className
1158
1158
  } = props;
1159
- if (isCustomWebsite) {
1159
+ if (isCustomWebsite && typeof Image !== undefined) {
1160
1160
  const classes = nextImageRendererStyles();
1161
1161
  const imageLoader = ({
1162
1162
  src,
@@ -1171,8 +1171,9 @@ const NextImageRenderer = ({
1171
1171
  return `${process.env.NEXT_PUBLIC_ENV_ASSET_PREFIX}/_next/image?url=${src}&q=${quality || 75}&w=${dynamicWidth}`;
1172
1172
  };
1173
1173
  const NextImage = require('next/image').default;
1174
+ console.log('next image succes');
1174
1175
  return /*#__PURE__*/React__default["default"].createElement(NextImage, _extends({
1175
- priority: sectionIndex === 0 ? true : false,
1176
+ priority: sectionIndex === '0' ? true : false,
1176
1177
  loader: imageLoader,
1177
1178
  src: src,
1178
1179
  layout: 'fill',
@@ -1182,6 +1183,7 @@ const NextImageRenderer = ({
1182
1183
  alt: "image"
1183
1184
  }));
1184
1185
  } else {
1186
+ console.log('next image failed image tag');
1185
1187
  return /*#__PURE__*/React__default["default"].createElement("img", {
1186
1188
  ref: refSetter,
1187
1189
  className: className,
@@ -1583,7 +1585,12 @@ const useSectionStyles$9 = createUseStyles(theme => ({
1583
1585
  width: '15%',
1584
1586
  height: 'auto',
1585
1587
  position: 'relative',
1586
- paddingBottom: ' 6%',
1588
+ paddingBottom: ({
1589
+ isCustomWebsite
1590
+ }) => isCustomWebsite ? ' 6%' : '0%',
1591
+ paddingTop: ({
1592
+ isCustomWebsite
1593
+ }) => isCustomWebsite ? ' 0%' : '1%',
1587
1594
  '& p': {
1588
1595
  margin: '0',
1589
1596
  paddingRight: '8px',
@@ -1658,7 +1665,9 @@ const useSectionStyles$9 = createUseStyles(theme => ({
1658
1665
  poweredDiv: {
1659
1666
  // marginTop: '15px'
1660
1667
  width: '28%',
1661
- paddingBottom: '9%'
1668
+ paddingBottom: ({
1669
+ isCustomWebsite
1670
+ }) => isCustomWebsite ? "8%" : '0%'
1662
1671
  },
1663
1672
  socialMediaCta: {
1664
1673
  margin: '0 8px 16px 8px'
@@ -2227,7 +2236,9 @@ const useSectionStyles$8 = createUseStyles(theme => ({
2227
2236
  },
2228
2237
  imageContainer: {
2229
2238
  height: 'undefined',
2230
- paddingBottom: '80%'
2239
+ paddingBottom: ({
2240
+ isCustomWebsite
2241
+ }) => isCustomWebsite ? "100%" : "unset"
2231
2242
  }
2232
2243
  }
2233
2244
  }));
@@ -2453,13 +2464,16 @@ function Section$4({
2453
2464
  nodeData,
2454
2465
  sectionIndex
2455
2466
  }) {
2456
- const classes = useSectionStyles$8();
2457
2467
  const {
2458
2468
  layout: {
2459
2469
  containerWidth
2460
2470
  },
2461
- isMobile
2471
+ isMobile,
2472
+ isCustomWebsite
2462
2473
  } = React.useContext(PageContext);
2474
+ const classes = useSectionStyles$8({
2475
+ isCustomWebsite
2476
+ });
2463
2477
  return /*#__PURE__*/React__default["default"].createElement("div", {
2464
2478
  className: classes.centerData
2465
2479
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -2810,7 +2824,7 @@ const useSectionStyles$6 = createUseStyles(theme => ({
2810
2824
  width: '100%',
2811
2825
  // maxWidth: ({ containerWidth } = {}) => containerWidth,
2812
2826
  position: 'absolute',
2813
- zIndex: '99'
2827
+ zIndex: '9'
2814
2828
  },
2815
2829
  absoluteButtons: {
2816
2830
  display: 'flex',
@@ -2838,14 +2852,16 @@ const useSectionStyles$6 = createUseStyles(theme => ({
2838
2852
  centerBgImageContainer: {
2839
2853
  width: '100%',
2840
2854
  position: 'relative',
2841
- paddingBottom: '35rem',
2842
- backgroundImage: 'linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%)',
2855
+ // paddingBottom: '35rem',
2856
+ paddingBottom: ({
2857
+ isCustomWebsite
2858
+ }) => isCustomWebsite ? '45%' : "unset",
2843
2859
  backgroundSize: 'cover',
2844
2860
  backgroundPosition: 'center center'
2845
2861
  },
2846
2862
  centerBgImage: {
2847
2863
  objectFit: 'cover',
2848
- backgroundImage: 'linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%)',
2864
+ width: "100%",
2849
2865
  backgroundSize: 'cover',
2850
2866
  backgroundPosition: 'center center'
2851
2867
  },
@@ -2902,28 +2918,36 @@ const useSectionStyles$6 = createUseStyles(theme => ({
2902
2918
  margin: '16px 0'
2903
2919
  },
2904
2920
  centerBgImageContainer: {
2905
- width: '100%',
2921
+ width: ({
2922
+ isCustomWebsite
2923
+ }) => isCustomWebsite ? "100%" : 'unset',
2906
2924
  position: 'relative',
2907
2925
  height: '34rem',
2908
- paddingBottom: '100%'
2926
+ paddingBottom: '0'
2927
+ },
2928
+ centerBgImage: {
2929
+ objectFit: "cover",
2930
+ width: "100%",
2931
+ height: "inherit"
2909
2932
  }
2910
2933
  }
2911
2934
  }));
2912
2935
 
2913
2936
  const Section$3 = ({
2914
2937
  nodeData,
2915
- isCustomWebsite,
2916
2938
  sectionIndex
2917
2939
  }) => {
2918
2940
  const {
2919
2941
  layout: {
2920
2942
  containerWidth
2921
2943
  },
2922
- isMobile
2944
+ isMobile,
2945
+ isCustomWebsite
2923
2946
  } = React.useContext(PageContext);
2924
2947
  const classes = useSectionStyles$6({
2925
2948
  imageUrl: nodeData.image.metadata.value,
2926
- containerWidth
2949
+ containerWidth,
2950
+ isCustomWebsite
2927
2951
  });
2928
2952
  return /*#__PURE__*/React__default["default"].createElement("section", {
2929
2953
  className: classes.bannerCarouselCenterSection
@@ -2971,7 +2995,9 @@ function BannerCarouselCenter({
2971
2995
  isCustomWebsite,
2972
2996
  sectionIndex
2973
2997
  }) {
2974
- const classes = useSectionStyles$6();
2998
+ const classes = useSectionStyles$6({
2999
+ isCustomWebsite
3000
+ });
2975
3001
  const [{
2976
3002
  bannerCarousel
2977
3003
  }] = sectionData.components;
@@ -2984,7 +3010,6 @@ function BannerCarouselCenter({
2984
3010
  className: classes.bannerCarouselCenterSection
2985
3011
  }, /*#__PURE__*/React__default["default"].createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React__default["default"].createElement(Section$3, {
2986
3012
  nodeData: node,
2987
- isCustomWebsite: isCustomWebsite,
2988
3013
  key: idx /* or some other unique property */,
2989
3014
  sectionIndex: sectionIndex
2990
3015
  }))));
@@ -3087,14 +3112,13 @@ const useSectionStyles$5 = createUseStyles(theme => {
3087
3112
  width: '100%',
3088
3113
  padding: '0'
3089
3114
  },
3090
- // imageContainer: {
3091
-
3092
- // '& img': {
3093
- // height: "520px",
3094
- // objectFit: "cover"
3095
- // }
3096
-
3097
- // },
3115
+ imageContainer: {
3116
+ height: 'unset !important',
3117
+ '& img': {
3118
+ height: 'unset !important',
3119
+ objectFit: "cover"
3120
+ }
3121
+ },
3098
3122
  imageContainerDiv: {
3099
3123
  width: '100%'
3100
3124
  },
@@ -3103,7 +3127,7 @@ const useSectionStyles$5 = createUseStyles(theme => {
3103
3127
  },
3104
3128
  sideBannerImage: {
3105
3129
  width: '100%',
3106
- height: 'initial'
3130
+ height: 'unset !important'
3107
3131
  },
3108
3132
  textContainer: {
3109
3133
  padding: '20px 20px',
@@ -3978,10 +4002,10 @@ const useVideoStyles$1 = createUseStyles(theme => {
3978
4002
  isLoaded
3979
4003
  } = {}) => isLoaded ? 'block' : 'none'
3980
4004
  },
3981
- // icon: {
3982
- // zIndex: '999'
3983
- // },
3984
-
4005
+ icon: {
4006
+ zIndex: '999',
4007
+ position: "absolute"
4008
+ },
3985
4009
  imgContainer: {
3986
4010
  position: 'absolute',
3987
4011
  width: '100%',
@@ -3989,6 +4013,7 @@ const useVideoStyles$1 = createUseStyles(theme => {
3989
4013
  borderRadius: theme.shape.borderRadius.small,
3990
4014
  // backgroundImage: ({ imageUrl } = {}) =>
3991
4015
  // `linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%), url("${imageUrl}")`,
4016
+ background: "linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%)",
3992
4017
  backgroundSize: 'cover',
3993
4018
  display: 'flex',
3994
4019
  justifyContent: 'center',
@@ -3997,6 +4022,12 @@ const useVideoStyles$1 = createUseStyles(theme => {
3997
4022
  cursor: 'pointer'
3998
4023
  }
3999
4024
  },
4025
+ videoPlayerImage: {
4026
+ height: '100%',
4027
+ width: '100%',
4028
+ objectFit: 'cover',
4029
+ objectPosition: 'top'
4030
+ },
4000
4031
  '@media (max-width: 767px)': {
4001
4032
  iframe: {
4002
4033
  borderRadius: '8px 8px 0 0'
@@ -4033,7 +4064,8 @@ function VideoPlayer(props) {
4033
4064
  className: classes.imgContainer
4034
4065
  }, /*#__PURE__*/React__default["default"].createElement(NextImageRenderer, {
4035
4066
  src: imageUrl,
4036
- sectionIndex: props?.sectionIndex
4067
+ sectionIndex: props?.sectionIndex,
4068
+ className: classes.videoPlayerImage
4037
4069
  }), isEnabled ? /*#__PURE__*/React__default["default"].createElement(Loader, null) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, props.onlyThumbnail ? null : /*#__PURE__*/React__default["default"].createElement(Icon, {
4038
4070
  name: "Video Play",
4039
4071
  color: theme.palette.font.invertedDefault,