diy-template-components 0.2.43 → 0.2.44

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.es.js CHANGED
@@ -142,14 +142,19 @@ const useSectionStyles$a = createUseStyles(theme => ({
142
142
  position: 'relative',
143
143
  maxHeight: '55px',
144
144
  alignItems: 'center',
145
- width: '24%'
145
+ width: '30%'
146
146
  },
147
147
  imageDivImageMobile: {},
148
+ imageDivImageNext: {
149
+ objectFit: ({
150
+ isCustomWebsite
151
+ } = {}) => isCustomWebsite ? 'contain' : ''
152
+ },
148
153
  imageAnchorMobile: {
149
154
  pointerEvents: 'auto',
150
155
  cursor: 'default',
151
156
  width: '100%',
152
- maxWidth: '60px',
157
+ maxWidth: '85px',
153
158
  cursor: 'default',
154
159
  height: '46px',
155
160
  position: 'relative'
@@ -221,6 +226,9 @@ const useSectionStyles$a = createUseStyles(theme => ({
221
226
  mobileHeader: {
222
227
  height: '80px'
223
228
  },
229
+ sideDrawerImg: {
230
+ width: '15%'
231
+ },
224
232
  menuItem: {
225
233
  padding: '0'
226
234
  },
@@ -1100,6 +1108,24 @@ function OptionList({
1100
1108
  }) : null));
1101
1109
  }
1102
1110
 
1111
+ const nextImageRendererStyles = createUseStyles(() => ({
1112
+ '@media (max-width: 640px)': {
1113
+ imageContainer: {
1114
+ maxWidth: '100%'
1115
+ }
1116
+ },
1117
+ '@media (min-width: 641px) and (max-width: 1280px)': {
1118
+ imageContainer: {
1119
+ maxWidth: '75%'
1120
+ }
1121
+ },
1122
+ '@media (min-width: 1281px)': {
1123
+ imageContainer: {
1124
+ maxWidth: '50%'
1125
+ }
1126
+ }
1127
+ }));
1128
+
1103
1129
  const NextImageRenderer = ({
1104
1130
  src,
1105
1131
  sectionIndex,
@@ -1107,31 +1133,48 @@ const NextImageRenderer = ({
1107
1133
  }) => {
1108
1134
  const {
1109
1135
  isCustomWebsite,
1110
- pageData
1136
+ pageData,
1137
+ isMobile
1111
1138
  } = useContext(PageContext);
1112
- console.log('contexttest___', sectionIndex);
1113
- const imageLoader = ({
1114
- src,
1115
- quality,
1116
- width
1117
- }) => {
1118
- return `${process.env.NEXT_PUBLIC_ENV_ASSET_PREFIX}/_next/image?url=${src}&q=${quality || 75}&w=${640}`;
1119
- };
1120
- let {
1121
- refSetter,
1122
- className
1123
- } = props;
1124
- if (isCustomWebsite) {
1125
- const NextImage = require('next/image').default;
1126
- return /*#__PURE__*/React.createElement(NextImage, _extends({
1127
- priority: sectionIndex == '0' ? true : false,
1128
- loader: imageLoader,
1129
- src: src,
1130
- layout: 'fill',
1131
- ref: refSetter,
1132
- className: className
1133
- }, props));
1134
- } else {
1139
+ try {
1140
+ let {
1141
+ refSetter,
1142
+ className
1143
+ } = props;
1144
+ if (isCustomWebsite && typeof Image !== 'undefined') {
1145
+ const classes = nextImageRendererStyles();
1146
+ const imageLoader = ({
1147
+ src,
1148
+ quality,
1149
+ width
1150
+ }) => {
1151
+ const breakpoints = {
1152
+ mobile: 640,
1153
+ desktop: 1200
1154
+ };
1155
+ const dynamicWidth = isMobile ? breakpoints.mobile : breakpoints?.desktop;
1156
+ return `${process.env.NEXT_PUBLIC_ENV_ASSET_PREFIX}/_next/image?url=${src}&q=${quality || 75}&w=${dynamicWidth}`;
1157
+ };
1158
+ const NextImage = require('next/image').default;
1159
+ return /*#__PURE__*/React.createElement(NextImage, _extends({
1160
+ priority: sectionIndex == '0' ? true : false,
1161
+ loader: imageLoader,
1162
+ src: src,
1163
+ layout: 'fill',
1164
+ ref: refSetter,
1165
+ className: `${classes?.imageContainer} ${className}`
1166
+ }, props, {
1167
+ alt: "image"
1168
+ }));
1169
+ } else {
1170
+ return /*#__PURE__*/React.createElement("img", {
1171
+ ref: refSetter,
1172
+ className: className,
1173
+ src: src
1174
+ });
1175
+ }
1176
+ } catch (err) {
1177
+ console.log('next image failed', err);
1135
1178
  return /*#__PURE__*/React.createElement("img", {
1136
1179
  ref: refSetter,
1137
1180
  className: className,
@@ -1149,12 +1192,16 @@ function DesktopHeader({
1149
1192
  const {
1150
1193
  isFixed = true
1151
1194
  } = header;
1195
+ const {
1196
+ isCustomWebsite
1197
+ } = useContext(PageContext);
1152
1198
  const logoUrl = useLinkBuilder({
1153
1199
  isLink: true,
1154
1200
  link: '/'
1155
1201
  });
1156
1202
  const classes = useSectionStyles$a({
1157
- isFixed
1203
+ isFixed,
1204
+ isCustomWebsite
1158
1205
  });
1159
1206
  const optionDataFn = () => {
1160
1207
  let optionsArr = navData;
@@ -1220,6 +1267,9 @@ function MobileHeader({
1220
1267
  isTutorWebsite,
1221
1268
  isLandingPage = false
1222
1269
  }) {
1270
+ const {
1271
+ isCustomWebsite
1272
+ } = useContext(PageContext);
1223
1273
  const {
1224
1274
  isFixed = true
1225
1275
  } = header;
@@ -1229,7 +1279,8 @@ function MobileHeader({
1229
1279
  });
1230
1280
  const theme = useTheme();
1231
1281
  const classes = useSectionStyles$a({
1232
- isFixed
1282
+ isFixed,
1283
+ isCustomWebsite
1233
1284
  });
1234
1285
  const [sideMenu, openSideMenu] = useState(false);
1235
1286
  const navEl = useRef(null);
@@ -1540,6 +1591,11 @@ const useSectionStyles$9 = createUseStyles(theme => ({
1540
1591
  poweredDivImg: {
1541
1592
  width: '100px !important'
1542
1593
  },
1594
+ footerLogoImage: {
1595
+ objectFit: ({
1596
+ isCustomWebsite
1597
+ }) => isCustomWebsite ? 'contain' : ''
1598
+ },
1543
1599
  '@media screen and (max-width: 767px)': {
1544
1600
  section: {
1545
1601
  padding: '45px 30px',
@@ -1609,8 +1665,12 @@ function Footer({
1609
1665
  data
1610
1666
  }) {
1611
1667
  const theme = useTheme();
1612
- const classes = useSectionStyles$9();
1613
- console.log(data, 'this is data');
1668
+ const {
1669
+ isCustomWebsite
1670
+ } = useContext(PageContext);
1671
+ const classes = useSectionStyles$9({
1672
+ isCustomWebsite
1673
+ });
1614
1674
  return /*#__PURE__*/React.createElement("footer", {
1615
1675
  className: data.metadata.isCpBranding ? `${classes.section}` : `${classes.section} ${classes.sectionNoBranding}`
1616
1676
  }, /*#__PURE__*/React.createElement("div", {
@@ -1621,7 +1681,8 @@ function Footer({
1621
1681
  className: classes.upperContainerItem1Img
1622
1682
  }, /*#__PURE__*/React.createElement(NextImageRenderer, {
1623
1683
  src: data?.logo?.metadata?.url,
1624
- ref: data?.logo?.refSetter
1684
+ ref: data?.logo?.refSetter,
1685
+ className: classes.footerLogoImage
1625
1686
  }))), /*#__PURE__*/React.createElement("div", {
1626
1687
  className: classes.upperContainerItem2
1627
1688
  }, data?.address?.metadata.value && data?.address?.metadata.value !== '<br>' ? /*#__PURE__*/React.createElement("p", {
@@ -1673,7 +1734,8 @@ function Footer({
1673
1734
  className: classes.socialMediaCta,
1674
1735
  onClick: () => {
1675
1736
  window.open(data?.facebookLink?.metadata?.value, '_blank');
1676
- }
1737
+ },
1738
+ "aria-label": "Name"
1677
1739
  }, /*#__PURE__*/React.createElement(Icon, {
1678
1740
  name: 'Facebook Solid',
1679
1741
  color: theme.palette.background.default,
@@ -1684,7 +1746,8 @@ function Footer({
1684
1746
  className: classes.socialMediaCta,
1685
1747
  onClick: () => {
1686
1748
  window.open(data?.twitterLink?.metadata?.value, '_blank');
1687
- }
1749
+ },
1750
+ "aria-label": "Name"
1688
1751
  }, /*#__PURE__*/React.createElement(Icon, {
1689
1752
  name: 'Twitter Solid',
1690
1753
  color: theme.palette.background.default,
@@ -1695,7 +1758,8 @@ function Footer({
1695
1758
  className: classes.socialMediaCta,
1696
1759
  onClick: () => {
1697
1760
  window.open(data?.instagramLink?.metadata?.value, '_blank');
1698
- }
1761
+ },
1762
+ "aria-label": "Name"
1699
1763
  }, /*#__PURE__*/React.createElement(Icon, {
1700
1764
  name: 'Instagram',
1701
1765
  color: theme.palette.background.default,
@@ -1706,7 +1770,8 @@ function Footer({
1706
1770
  className: classes.socialMediaCta,
1707
1771
  onClick: () => {
1708
1772
  window.open(data?.telegramLink?.metadata?.value, '_blank');
1709
- }
1773
+ },
1774
+ "aria-label": "Name"
1710
1775
  }, /*#__PURE__*/React.createElement(Icon, {
1711
1776
  name: 'Telegram',
1712
1777
  color: theme.palette.background.default,
@@ -1717,7 +1782,8 @@ function Footer({
1717
1782
  className: classes.socialMediaCta,
1718
1783
  onClick: () => {
1719
1784
  window.open(data?.youtubeLink?.metadata?.value, '_blank');
1720
- }
1785
+ },
1786
+ "aria-label": "Name"
1721
1787
  }, /*#__PURE__*/React.createElement(Icon, {
1722
1788
  name: 'YouTube',
1723
1789
  color: theme.palette.background.default,
@@ -1922,7 +1988,6 @@ const MemoisedSection$1 = /*#__PURE__*/memo(({
1922
1988
  extraProps,
1923
1989
  sectionIndex
1924
1990
  }) => {
1925
- console.log('sectionIndex MEMO', sectionIndex);
1926
1991
  const SectionComp = getCompToRender$1(sectionData.type);
1927
1992
  return /*#__PURE__*/React.createElement(SectionComp, {
1928
1993
  sectionData: sectionData,
@@ -2010,7 +2075,6 @@ function PageRenderer$1({
2010
2075
  _id
2011
2076
  }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id]);
2012
2077
  const Wrapper = SectionWrapper || Fragment;
2013
- // console.log("CONTEXT______", context)
2014
2078
  return /*#__PURE__*/React.createElement(ThemeProvider, {
2015
2079
  theme: theme
2016
2080
  }, /*#__PURE__*/React.createElement(PageContext.Provider, {
@@ -2077,6 +2141,7 @@ const useSectionStyles$8 = createUseStyles(theme => ({
2077
2141
  },
2078
2142
  contentContainer: {
2079
2143
  position: 'relative',
2144
+ width: '100%',
2080
2145
  zIndex: '1',
2081
2146
  display: 'grid',
2082
2147
  gridTemplateColumns: 'repeat(2,minmax(0, 1fr))',
@@ -2385,7 +2450,6 @@ function Section$4({
2385
2450
  },
2386
2451
  isMobile
2387
2452
  } = useContext(PageContext);
2388
- console.log('nodedata_____', nodeData?.metadata?.order);
2389
2453
  return /*#__PURE__*/React.createElement("div", {
2390
2454
  className: classes.centerData
2391
2455
  }, /*#__PURE__*/React.createElement("div", {
@@ -2747,9 +2811,13 @@ const useSectionStyles$6 = createUseStyles(theme => ({
2747
2811
  width: '100%'
2748
2812
  },
2749
2813
  contentContainer: {
2750
- padding: '100px 0',
2814
+ // padding: '100px 0',
2815
+ // height: '100%',
2816
+ // display: 'flex',
2817
+ // alignItems: 'center'
2751
2818
  height: '100%',
2752
2819
  display: 'flex',
2820
+ /* padding: 100px 0; */
2753
2821
  alignItems: 'center'
2754
2822
  // backgroundImage: ({ imageUrl } = {}) =>
2755
2823
  // `linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%), url("${imageUrl}")`,
@@ -2775,7 +2843,7 @@ const useSectionStyles$6 = createUseStyles(theme => ({
2775
2843
  height: '100%'
2776
2844
  },
2777
2845
  textContainer: {
2778
- padding: '0 18%',
2846
+ padding: '100px 0',
2779
2847
  margin: '0 auto',
2780
2848
  width: '80%'
2781
2849
  },
@@ -2846,7 +2914,6 @@ const Section$3 = ({
2846
2914
  imageUrl: nodeData.image.metadata.value,
2847
2915
  containerWidth
2848
2916
  });
2849
- console.log('isCustomWebsite______', isCustomWebsite);
2850
2917
  return /*#__PURE__*/React.createElement("section", {
2851
2918
  className: classes.bannerCarouselCenterSection
2852
2919
  }, /*#__PURE__*/React.createElement("div", {
@@ -2893,7 +2960,6 @@ function BannerCarouselCenter({
2893
2960
  isCustomWebsite,
2894
2961
  sectionIndex
2895
2962
  }) {
2896
- console.log('isCustomWebsite______', isCustomWebsite);
2897
2963
  const classes = useSectionStyles$6();
2898
2964
  const [{
2899
2965
  bannerCarousel
@@ -2953,7 +3019,13 @@ const useSectionStyles$5 = createUseStyles(theme => {
2953
3019
  position: 'relative',
2954
3020
  width: '100%',
2955
3021
  // height: "650px"
2956
- paddingBottom: '82%'
3022
+ paddingBottom: ({
3023
+ isCustomWebsite
3024
+ }) => isCustomWebsite ? '85%' : '',
3025
+ '& img': {
3026
+ height: '520px',
3027
+ objectFit: 'cover'
3028
+ }
2957
3029
  },
2958
3030
  imageBorder: {
2959
3031
  border: `2px solid ${theme?.palette?.primary?.light}`,
@@ -3004,6 +3076,14 @@ const useSectionStyles$5 = createUseStyles(theme => {
3004
3076
  width: '100%',
3005
3077
  padding: '0'
3006
3078
  },
3079
+ // imageContainer: {
3080
+
3081
+ // '& img': {
3082
+ // height: "520px",
3083
+ // objectFit: "cover"
3084
+ // }
3085
+
3086
+ // },
3007
3087
  imageContainerDiv: {
3008
3088
  width: '100%'
3009
3089
  },
@@ -3032,14 +3112,16 @@ function Section$2({
3032
3112
  nodeData,
3033
3113
  sectionIndex
3034
3114
  }) {
3035
- const classes = useSectionStyles$5();
3036
3115
  const {
3037
3116
  layout: {
3038
3117
  containerWidth
3039
3118
  },
3040
- isMobile
3119
+ isMobile,
3120
+ isCustomWebsite
3041
3121
  } = useContext(PageContext);
3042
- console.log('nodedata_____SDF', sectionIndex);
3122
+ const classes = useSectionStyles$5({
3123
+ isCustomWebsite
3124
+ });
3043
3125
  return /*#__PURE__*/React.createElement("div", {
3044
3126
  className: classes.centerData
3045
3127
  }, /*#__PURE__*/React.createElement("div", {
@@ -3079,13 +3161,15 @@ function Section$2({
3079
3161
  ref: nodeData?.cta?.refSetter,
3080
3162
  data: nodeData.cta.metadata,
3081
3163
  type: nodeData?.cta?.metadata?.type,
3082
- size: isMobile ? 'small' : 'medium'
3164
+ size: isMobile ? 'small' : 'medium',
3165
+ name: "button"
3083
3166
  })));
3084
3167
  }
3085
3168
  function BannerCarouselLeft({
3086
3169
  sectionData,
3087
3170
  isCustomWebsite,
3088
- sectionIndex
3171
+ sectionIndex,
3172
+ isMobile
3089
3173
  }) {
3090
3174
  const {
3091
3175
  layout: {
@@ -3265,7 +3349,6 @@ async function postApiCall(baseURLs, data) {
3265
3349
  return res.data;
3266
3350
  }
3267
3351
  } catch (err) {
3268
- console.log(err);
3269
3352
  return;
3270
3353
  }
3271
3354
  }
@@ -3288,7 +3371,6 @@ async function postApiCallForm(baseURLs, data, extraProps) {
3288
3371
  return res.data;
3289
3372
  });
3290
3373
  } catch (err) {
3291
- console.log(err);
3292
3374
  return;
3293
3375
  }
3294
3376
  }
@@ -3704,7 +3786,6 @@ function Section$1({
3704
3786
  centerMode: true,
3705
3787
  centerPadding: isMobile ? '10px 0 0' : '80px 0 0'
3706
3788
  };
3707
- console.log('nodedata_____', nodeData?.metadata?.order);
3708
3789
  const carouselContent = carouselList.map((el, idx) =>
3709
3790
  /*#__PURE__*/
3710
3791
  // kept an extra element as slick mutates this element and gives it 100% width
@@ -6512,7 +6593,6 @@ function Contact({
6512
6593
  } = useContext(PageContext);
6513
6594
  let [btnDisabled, setBtnDisabled] = useState(false);
6514
6595
  const [nodeData] = sectionData.components;
6515
- console.log('nodedata_____', nodeData?.metadata?.order);
6516
6596
  const classes = useSectionStyles({
6517
6597
  containerWidth
6518
6598
  });
@@ -6694,7 +6774,8 @@ function Contact({
6694
6774
  onClick: () => handleSubmit(),
6695
6775
  type: nodeData?.cta?.metadata?.type,
6696
6776
  size: isMobile ? 'small' : 'medium',
6697
- disabled: btnDisabled
6777
+ disabled: btnDisabled,
6778
+ name: "button"
6698
6779
  }))))));
6699
6780
  }
6700
6781
 
@@ -6996,7 +7077,6 @@ const SingleVideoSlide$1 = props => {
6996
7077
  price,
6997
7078
  discount
6998
7079
  }) => {
6999
- console.log('discountxx', props.data.price, props.data.discount);
7000
7080
  return (discount / price * 100).toFixed(2);
7001
7081
  };
7002
7082
  const classes = useWebinarPromotionPage();
@@ -7433,15 +7513,6 @@ const SingleVideoSlide = props => {
7433
7513
  isMobile,
7434
7514
  isEdit
7435
7515
  } = useContext(PageContext);
7436
- console.log(isEdit, 'isEdit');
7437
- useEffect(() => {
7438
- // remaining days epoch
7439
- // current date epoch
7440
- // subtract remaining days from current day epoch
7441
- // moment the result - and see if there are days
7442
- // days is present show days
7443
- // else start reverse timer
7444
- }, []);
7445
7516
  const renderer = ({
7446
7517
  days,
7447
7518
  hours,
@@ -7616,6 +7687,7 @@ const SingleVideoSlide = props => {
7616
7687
  type: 'primary',
7617
7688
  size: 'medium',
7618
7689
  target: null,
7690
+ name: "button",
7619
7691
  rel: null
7620
7692
  // styling={isMobile ? { margin: '0 40px' } : {}}
7621
7693
  })))), showCourseInstallmentData && InstalmentData && /*#__PURE__*/React.createElement("div", {
@@ -7650,7 +7722,6 @@ function CoursePromotionPage({
7650
7722
  const classes = useCoursePromotionPage({
7651
7723
  containerWidth
7652
7724
  });
7653
- console.log(sectionData, 'sectionData');
7654
7725
  return /*#__PURE__*/React.createElement("div", {
7655
7726
  className: classes.courseSuperContainer
7656
7727
  }, /*#__PURE__*/React.createElement("div", {
@@ -8100,9 +8171,7 @@ function Tiles({
8100
8171
  isEdit
8101
8172
  } = useContext(PageContext);
8102
8173
  const nodeData = sectionData.components;
8103
- console.log(nodeData);
8104
8174
  const tilesList = nodeData[0]?.tilesList.components;
8105
- console.log('nodedata_____', nodeData?.metadata?.order);
8106
8175
  const handleClick = value => {
8107
8176
  if (!isEdit && value) {
8108
8177
  if (value.indexOf('http://') == 0 || value.indexOf('https://') == 0) {
@@ -8577,7 +8646,6 @@ function EmailDripMarket({
8577
8646
  sectionData,
8578
8647
  extraProps = {}
8579
8648
  }) {
8580
- console.log('extrapropstemplate', extraProps);
8581
8649
  const isInitialMount = useRef(true);
8582
8650
  const convertToHtml = sectionData => {
8583
8651
  const html = ReactDOMServer.renderToStaticMarkup( /*#__PURE__*/React.createElement(Section, {
@@ -8651,8 +8719,6 @@ const MemoisedSection = /*#__PURE__*/memo(({
8651
8719
  isCustomWebsite,
8652
8720
  sectionIndex
8653
8721
  }) => {
8654
- // console.log("isCustomWebsite______", isCustomWebsite)
8655
- console.log('templatesectiondata', sectionData);
8656
8722
  const SectionComp = getCompToRender(sectionData.type);
8657
8723
  return /*#__PURE__*/React.createElement(SectionComp, {
8658
8724
  sectionData: sectionData,
@@ -8667,7 +8733,6 @@ function SectionRenderer({
8667
8733
  isCustomWebsite,
8668
8734
  sectionIndex
8669
8735
  }) {
8670
- // console.log("isCustomWebsite______", isCustomWebsite)
8671
8736
  return /*#__PURE__*/React.createElement(MemoisedSection, {
8672
8737
  sectionData: sectionData,
8673
8738
  extraProps: extraProps,