diy-template-components 0.2.43 → 0.2.45

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
@@ -157,14 +157,19 @@ const useSectionStyles$a = createUseStyles(theme => ({
157
157
  position: 'relative',
158
158
  maxHeight: '55px',
159
159
  alignItems: 'center',
160
- width: '24%'
160
+ width: '30%'
161
161
  },
162
162
  imageDivImageMobile: {},
163
+ imageDivImageNext: {
164
+ objectFit: ({
165
+ isCustomWebsite
166
+ } = {}) => isCustomWebsite ? 'contain' : ''
167
+ },
163
168
  imageAnchorMobile: {
164
169
  pointerEvents: 'auto',
165
170
  cursor: 'default',
166
171
  width: '100%',
167
- maxWidth: '60px',
172
+ maxWidth: '85px',
168
173
  cursor: 'default',
169
174
  height: '46px',
170
175
  position: 'relative'
@@ -236,6 +241,9 @@ const useSectionStyles$a = createUseStyles(theme => ({
236
241
  mobileHeader: {
237
242
  height: '80px'
238
243
  },
244
+ sideDrawerImg: {
245
+ width: '15%'
246
+ },
239
247
  menuItem: {
240
248
  padding: '0'
241
249
  },
@@ -1115,6 +1123,24 @@ function OptionList({
1115
1123
  }) : null));
1116
1124
  }
1117
1125
 
1126
+ const nextImageRendererStyles = createUseStyles(() => ({
1127
+ '@media (max-width: 640px)': {
1128
+ imageContainer: {
1129
+ maxWidth: '100%'
1130
+ }
1131
+ },
1132
+ '@media (min-width: 641px) and (max-width: 1280px)': {
1133
+ imageContainer: {
1134
+ maxWidth: '75%'
1135
+ }
1136
+ },
1137
+ '@media (min-width: 1281px)': {
1138
+ imageContainer: {
1139
+ maxWidth: '50%'
1140
+ }
1141
+ }
1142
+ }));
1143
+
1118
1144
  const NextImageRenderer = ({
1119
1145
  src,
1120
1146
  sectionIndex,
@@ -1122,31 +1148,48 @@ const NextImageRenderer = ({
1122
1148
  }) => {
1123
1149
  const {
1124
1150
  isCustomWebsite,
1125
- pageData
1151
+ pageData,
1152
+ isMobile
1126
1153
  } = React.useContext(PageContext);
1127
- console.log('contexttest___', sectionIndex);
1128
- const imageLoader = ({
1129
- src,
1130
- quality,
1131
- width
1132
- }) => {
1133
- return `${process.env.NEXT_PUBLIC_ENV_ASSET_PREFIX}/_next/image?url=${src}&q=${quality || 75}&w=${640}`;
1134
- };
1135
- let {
1136
- refSetter,
1137
- className
1138
- } = props;
1139
- if (isCustomWebsite) {
1140
- const NextImage = require('next/image').default;
1141
- return /*#__PURE__*/React__default["default"].createElement(NextImage, _extends({
1142
- priority: sectionIndex == '0' ? true : false,
1143
- loader: imageLoader,
1144
- src: src,
1145
- layout: 'fill',
1146
- ref: refSetter,
1147
- className: className
1148
- }, props));
1149
- } else {
1154
+ try {
1155
+ let {
1156
+ refSetter,
1157
+ className
1158
+ } = props;
1159
+ if (isCustomWebsite && typeof Image !== 'undefined') {
1160
+ const classes = nextImageRendererStyles();
1161
+ const imageLoader = ({
1162
+ src,
1163
+ quality,
1164
+ width
1165
+ }) => {
1166
+ const breakpoints = {
1167
+ mobile: 640,
1168
+ desktop: 1200
1169
+ };
1170
+ const dynamicWidth = isMobile ? breakpoints.mobile : breakpoints?.desktop;
1171
+ return `${process.env.NEXT_PUBLIC_ENV_ASSET_PREFIX}/_next/image?url=${src}&q=${quality || 75}&w=${dynamicWidth}`;
1172
+ };
1173
+ const NextImage = require('next/image').default;
1174
+ return /*#__PURE__*/React__default["default"].createElement(NextImage, _extends({
1175
+ priority: sectionIndex == '0' ? true : false,
1176
+ loader: imageLoader,
1177
+ src: src,
1178
+ layout: 'fill',
1179
+ ref: refSetter,
1180
+ className: `${classes?.imageContainer} ${className}`
1181
+ }, props, {
1182
+ alt: "image"
1183
+ }));
1184
+ } else {
1185
+ return /*#__PURE__*/React__default["default"].createElement("img", {
1186
+ ref: refSetter,
1187
+ className: className,
1188
+ src: src
1189
+ });
1190
+ }
1191
+ } catch (err) {
1192
+ console.log('next image failed', err);
1150
1193
  return /*#__PURE__*/React__default["default"].createElement("img", {
1151
1194
  ref: refSetter,
1152
1195
  className: className,
@@ -1164,12 +1207,16 @@ function DesktopHeader({
1164
1207
  const {
1165
1208
  isFixed = true
1166
1209
  } = header;
1210
+ const {
1211
+ isCustomWebsite
1212
+ } = React.useContext(PageContext);
1167
1213
  const logoUrl = useLinkBuilder({
1168
1214
  isLink: true,
1169
1215
  link: '/'
1170
1216
  });
1171
1217
  const classes = useSectionStyles$a({
1172
- isFixed
1218
+ isFixed,
1219
+ isCustomWebsite
1173
1220
  });
1174
1221
  const optionDataFn = () => {
1175
1222
  let optionsArr = navData;
@@ -1235,6 +1282,9 @@ function MobileHeader({
1235
1282
  isTutorWebsite,
1236
1283
  isLandingPage = false
1237
1284
  }) {
1285
+ const {
1286
+ isCustomWebsite
1287
+ } = React.useContext(PageContext);
1238
1288
  const {
1239
1289
  isFixed = true
1240
1290
  } = header;
@@ -1244,7 +1294,8 @@ function MobileHeader({
1244
1294
  });
1245
1295
  const theme = useTheme();
1246
1296
  const classes = useSectionStyles$a({
1247
- isFixed
1297
+ isFixed,
1298
+ isCustomWebsite
1248
1299
  });
1249
1300
  const [sideMenu, openSideMenu] = React.useState(false);
1250
1301
  const navEl = React.useRef(null);
@@ -1555,6 +1606,11 @@ const useSectionStyles$9 = createUseStyles(theme => ({
1555
1606
  poweredDivImg: {
1556
1607
  width: '100px !important'
1557
1608
  },
1609
+ footerLogoImage: {
1610
+ objectFit: ({
1611
+ isCustomWebsite
1612
+ }) => isCustomWebsite ? 'contain' : ''
1613
+ },
1558
1614
  '@media screen and (max-width: 767px)': {
1559
1615
  section: {
1560
1616
  padding: '45px 30px',
@@ -1624,8 +1680,12 @@ function Footer({
1624
1680
  data
1625
1681
  }) {
1626
1682
  const theme = useTheme();
1627
- const classes = useSectionStyles$9();
1628
- console.log(data, 'this is data');
1683
+ const {
1684
+ isCustomWebsite
1685
+ } = React.useContext(PageContext);
1686
+ const classes = useSectionStyles$9({
1687
+ isCustomWebsite
1688
+ });
1629
1689
  return /*#__PURE__*/React__default["default"].createElement("footer", {
1630
1690
  className: data.metadata.isCpBranding ? `${classes.section}` : `${classes.section} ${classes.sectionNoBranding}`
1631
1691
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -1636,7 +1696,8 @@ function Footer({
1636
1696
  className: classes.upperContainerItem1Img
1637
1697
  }, /*#__PURE__*/React__default["default"].createElement(NextImageRenderer, {
1638
1698
  src: data?.logo?.metadata?.url,
1639
- ref: data?.logo?.refSetter
1699
+ ref: data?.logo?.refSetter,
1700
+ className: classes.footerLogoImage
1640
1701
  }))), /*#__PURE__*/React__default["default"].createElement("div", {
1641
1702
  className: classes.upperContainerItem2
1642
1703
  }, data?.address?.metadata.value && data?.address?.metadata.value !== '<br>' ? /*#__PURE__*/React__default["default"].createElement("p", {
@@ -1688,7 +1749,8 @@ function Footer({
1688
1749
  className: classes.socialMediaCta,
1689
1750
  onClick: () => {
1690
1751
  window.open(data?.facebookLink?.metadata?.value, '_blank');
1691
- }
1752
+ },
1753
+ "aria-label": "Name"
1692
1754
  }, /*#__PURE__*/React__default["default"].createElement(Icon, {
1693
1755
  name: 'Facebook Solid',
1694
1756
  color: theme.palette.background.default,
@@ -1699,7 +1761,8 @@ function Footer({
1699
1761
  className: classes.socialMediaCta,
1700
1762
  onClick: () => {
1701
1763
  window.open(data?.twitterLink?.metadata?.value, '_blank');
1702
- }
1764
+ },
1765
+ "aria-label": "Name"
1703
1766
  }, /*#__PURE__*/React__default["default"].createElement(Icon, {
1704
1767
  name: 'Twitter Solid',
1705
1768
  color: theme.palette.background.default,
@@ -1710,7 +1773,8 @@ function Footer({
1710
1773
  className: classes.socialMediaCta,
1711
1774
  onClick: () => {
1712
1775
  window.open(data?.instagramLink?.metadata?.value, '_blank');
1713
- }
1776
+ },
1777
+ "aria-label": "Name"
1714
1778
  }, /*#__PURE__*/React__default["default"].createElement(Icon, {
1715
1779
  name: 'Instagram',
1716
1780
  color: theme.palette.background.default,
@@ -1721,7 +1785,8 @@ function Footer({
1721
1785
  className: classes.socialMediaCta,
1722
1786
  onClick: () => {
1723
1787
  window.open(data?.telegramLink?.metadata?.value, '_blank');
1724
- }
1788
+ },
1789
+ "aria-label": "Name"
1725
1790
  }, /*#__PURE__*/React__default["default"].createElement(Icon, {
1726
1791
  name: 'Telegram',
1727
1792
  color: theme.palette.background.default,
@@ -1732,7 +1797,8 @@ function Footer({
1732
1797
  className: classes.socialMediaCta,
1733
1798
  onClick: () => {
1734
1799
  window.open(data?.youtubeLink?.metadata?.value, '_blank');
1735
- }
1800
+ },
1801
+ "aria-label": "Name"
1736
1802
  }, /*#__PURE__*/React__default["default"].createElement(Icon, {
1737
1803
  name: 'YouTube',
1738
1804
  color: theme.palette.background.default,
@@ -1937,7 +2003,6 @@ const MemoisedSection$1 = /*#__PURE__*/React.memo(({
1937
2003
  extraProps,
1938
2004
  sectionIndex
1939
2005
  }) => {
1940
- console.log('sectionIndex MEMO', sectionIndex);
1941
2006
  const SectionComp = getCompToRender$1(sectionData.type);
1942
2007
  return /*#__PURE__*/React__default["default"].createElement(SectionComp, {
1943
2008
  sectionData: sectionData,
@@ -2025,7 +2090,6 @@ function PageRenderer$1({
2025
2090
  _id
2026
2091
  }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id]);
2027
2092
  const Wrapper = SectionWrapper || React.Fragment;
2028
- // console.log("CONTEXT______", context)
2029
2093
  return /*#__PURE__*/React__default["default"].createElement(ThemeProvider, {
2030
2094
  theme: theme
2031
2095
  }, /*#__PURE__*/React__default["default"].createElement(PageContext.Provider, {
@@ -2092,6 +2156,7 @@ const useSectionStyles$8 = createUseStyles(theme => ({
2092
2156
  },
2093
2157
  contentContainer: {
2094
2158
  position: 'relative',
2159
+ width: '100%',
2095
2160
  zIndex: '1',
2096
2161
  display: 'grid',
2097
2162
  gridTemplateColumns: 'repeat(2,minmax(0, 1fr))',
@@ -2400,7 +2465,6 @@ function Section$4({
2400
2465
  },
2401
2466
  isMobile
2402
2467
  } = React.useContext(PageContext);
2403
- console.log('nodedata_____', nodeData?.metadata?.order);
2404
2468
  return /*#__PURE__*/React__default["default"].createElement("div", {
2405
2469
  className: classes.centerData
2406
2470
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -2762,9 +2826,13 @@ const useSectionStyles$6 = createUseStyles(theme => ({
2762
2826
  width: '100%'
2763
2827
  },
2764
2828
  contentContainer: {
2765
- padding: '100px 0',
2829
+ // padding: '100px 0',
2830
+ // height: '100%',
2831
+ // display: 'flex',
2832
+ // alignItems: 'center'
2766
2833
  height: '100%',
2767
2834
  display: 'flex',
2835
+ /* padding: 100px 0; */
2768
2836
  alignItems: 'center'
2769
2837
  // backgroundImage: ({ imageUrl } = {}) =>
2770
2838
  // `linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%), url("${imageUrl}")`,
@@ -2790,7 +2858,7 @@ const useSectionStyles$6 = createUseStyles(theme => ({
2790
2858
  height: '100%'
2791
2859
  },
2792
2860
  textContainer: {
2793
- padding: '0 18%',
2861
+ padding: '100px 0',
2794
2862
  margin: '0 auto',
2795
2863
  width: '80%'
2796
2864
  },
@@ -2829,7 +2897,8 @@ const useSectionStyles$6 = createUseStyles(theme => ({
2829
2897
  padding: '0px'
2830
2898
  },
2831
2899
  textContainer: {
2832
- padding: '20px'
2900
+ padding: '0px 20px',
2901
+ height: '100%'
2833
2902
  },
2834
2903
  heading: {
2835
2904
  fontSize: '40px'
@@ -2861,7 +2930,6 @@ const Section$3 = ({
2861
2930
  imageUrl: nodeData.image.metadata.value,
2862
2931
  containerWidth
2863
2932
  });
2864
- console.log('isCustomWebsite______', isCustomWebsite);
2865
2933
  return /*#__PURE__*/React__default["default"].createElement("section", {
2866
2934
  className: classes.bannerCarouselCenterSection
2867
2935
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -2908,7 +2976,6 @@ function BannerCarouselCenter({
2908
2976
  isCustomWebsite,
2909
2977
  sectionIndex
2910
2978
  }) {
2911
- console.log('isCustomWebsite______', isCustomWebsite);
2912
2979
  const classes = useSectionStyles$6();
2913
2980
  const [{
2914
2981
  bannerCarousel
@@ -2968,7 +3035,13 @@ const useSectionStyles$5 = createUseStyles(theme => {
2968
3035
  position: 'relative',
2969
3036
  width: '100%',
2970
3037
  // height: "650px"
2971
- paddingBottom: '82%'
3038
+ paddingBottom: ({
3039
+ isCustomWebsite
3040
+ }) => isCustomWebsite ? '85%' : '',
3041
+ '& img': {
3042
+ height: '520px',
3043
+ objectFit: 'cover'
3044
+ }
2972
3045
  },
2973
3046
  imageBorder: {
2974
3047
  border: `2px solid ${theme?.palette?.primary?.light}`,
@@ -3019,6 +3092,14 @@ const useSectionStyles$5 = createUseStyles(theme => {
3019
3092
  width: '100%',
3020
3093
  padding: '0'
3021
3094
  },
3095
+ // imageContainer: {
3096
+
3097
+ // '& img': {
3098
+ // height: "520px",
3099
+ // objectFit: "cover"
3100
+ // }
3101
+
3102
+ // },
3022
3103
  imageContainerDiv: {
3023
3104
  width: '100%'
3024
3105
  },
@@ -3047,14 +3128,16 @@ function Section$2({
3047
3128
  nodeData,
3048
3129
  sectionIndex
3049
3130
  }) {
3050
- const classes = useSectionStyles$5();
3051
3131
  const {
3052
3132
  layout: {
3053
3133
  containerWidth
3054
3134
  },
3055
- isMobile
3135
+ isMobile,
3136
+ isCustomWebsite
3056
3137
  } = React.useContext(PageContext);
3057
- console.log('nodedata_____SDF', sectionIndex);
3138
+ const classes = useSectionStyles$5({
3139
+ isCustomWebsite
3140
+ });
3058
3141
  return /*#__PURE__*/React__default["default"].createElement("div", {
3059
3142
  className: classes.centerData
3060
3143
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -3094,13 +3177,15 @@ function Section$2({
3094
3177
  ref: nodeData?.cta?.refSetter,
3095
3178
  data: nodeData.cta.metadata,
3096
3179
  type: nodeData?.cta?.metadata?.type,
3097
- size: isMobile ? 'small' : 'medium'
3180
+ size: isMobile ? 'small' : 'medium',
3181
+ name: "button"
3098
3182
  })));
3099
3183
  }
3100
3184
  function BannerCarouselLeft({
3101
3185
  sectionData,
3102
3186
  isCustomWebsite,
3103
- sectionIndex
3187
+ sectionIndex,
3188
+ isMobile
3104
3189
  }) {
3105
3190
  const {
3106
3191
  layout: {
@@ -3280,7 +3365,6 @@ async function postApiCall(baseURLs, data) {
3280
3365
  return res.data;
3281
3366
  }
3282
3367
  } catch (err) {
3283
- console.log(err);
3284
3368
  return;
3285
3369
  }
3286
3370
  }
@@ -3303,7 +3387,6 @@ async function postApiCallForm(baseURLs, data, extraProps) {
3303
3387
  return res.data;
3304
3388
  });
3305
3389
  } catch (err) {
3306
- console.log(err);
3307
3390
  return;
3308
3391
  }
3309
3392
  }
@@ -3719,7 +3802,6 @@ function Section$1({
3719
3802
  centerMode: true,
3720
3803
  centerPadding: isMobile ? '10px 0 0' : '80px 0 0'
3721
3804
  };
3722
- console.log('nodedata_____', nodeData?.metadata?.order);
3723
3805
  const carouselContent = carouselList.map((el, idx) =>
3724
3806
  /*#__PURE__*/
3725
3807
  // kept an extra element as slick mutates this element and gives it 100% width
@@ -6527,7 +6609,6 @@ function Contact({
6527
6609
  } = React.useContext(PageContext);
6528
6610
  let [btnDisabled, setBtnDisabled] = React.useState(false);
6529
6611
  const [nodeData] = sectionData.components;
6530
- console.log('nodedata_____', nodeData?.metadata?.order);
6531
6612
  const classes = useSectionStyles({
6532
6613
  containerWidth
6533
6614
  });
@@ -6709,7 +6790,8 @@ function Contact({
6709
6790
  onClick: () => handleSubmit(),
6710
6791
  type: nodeData?.cta?.metadata?.type,
6711
6792
  size: isMobile ? 'small' : 'medium',
6712
- disabled: btnDisabled
6793
+ disabled: btnDisabled,
6794
+ name: "button"
6713
6795
  }))))));
6714
6796
  }
6715
6797
 
@@ -7011,7 +7093,6 @@ const SingleVideoSlide$1 = props => {
7011
7093
  price,
7012
7094
  discount
7013
7095
  }) => {
7014
- console.log('discountxx', props.data.price, props.data.discount);
7015
7096
  return (discount / price * 100).toFixed(2);
7016
7097
  };
7017
7098
  const classes = useWebinarPromotionPage();
@@ -7448,15 +7529,6 @@ const SingleVideoSlide = props => {
7448
7529
  isMobile,
7449
7530
  isEdit
7450
7531
  } = React.useContext(PageContext);
7451
- console.log(isEdit, 'isEdit');
7452
- React.useEffect(() => {
7453
- // remaining days epoch
7454
- // current date epoch
7455
- // subtract remaining days from current day epoch
7456
- // moment the result - and see if there are days
7457
- // days is present show days
7458
- // else start reverse timer
7459
- }, []);
7460
7532
  const renderer = ({
7461
7533
  days,
7462
7534
  hours,
@@ -7631,6 +7703,7 @@ const SingleVideoSlide = props => {
7631
7703
  type: 'primary',
7632
7704
  size: 'medium',
7633
7705
  target: null,
7706
+ name: "button",
7634
7707
  rel: null
7635
7708
  // styling={isMobile ? { margin: '0 40px' } : {}}
7636
7709
  })))), showCourseInstallmentData && InstalmentData && /*#__PURE__*/React__default["default"].createElement("div", {
@@ -7665,7 +7738,6 @@ function CoursePromotionPage({
7665
7738
  const classes = useCoursePromotionPage({
7666
7739
  containerWidth
7667
7740
  });
7668
- console.log(sectionData, 'sectionData');
7669
7741
  return /*#__PURE__*/React__default["default"].createElement("div", {
7670
7742
  className: classes.courseSuperContainer
7671
7743
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -8115,9 +8187,7 @@ function Tiles({
8115
8187
  isEdit
8116
8188
  } = React.useContext(PageContext);
8117
8189
  const nodeData = sectionData.components;
8118
- console.log(nodeData);
8119
8190
  const tilesList = nodeData[0]?.tilesList.components;
8120
- console.log('nodedata_____', nodeData?.metadata?.order);
8121
8191
  const handleClick = value => {
8122
8192
  if (!isEdit && value) {
8123
8193
  if (value.indexOf('http://') == 0 || value.indexOf('https://') == 0) {
@@ -8592,7 +8662,6 @@ function EmailDripMarket({
8592
8662
  sectionData,
8593
8663
  extraProps = {}
8594
8664
  }) {
8595
- console.log('extrapropstemplate', extraProps);
8596
8665
  const isInitialMount = React.useRef(true);
8597
8666
  const convertToHtml = sectionData => {
8598
8667
  const html = ReactDOMServer__default["default"].renderToStaticMarkup( /*#__PURE__*/React__default["default"].createElement(Section, {
@@ -8666,8 +8735,6 @@ const MemoisedSection = /*#__PURE__*/React.memo(({
8666
8735
  isCustomWebsite,
8667
8736
  sectionIndex
8668
8737
  }) => {
8669
- // console.log("isCustomWebsite______", isCustomWebsite)
8670
- console.log('templatesectiondata', sectionData);
8671
8738
  const SectionComp = getCompToRender(sectionData.type);
8672
8739
  return /*#__PURE__*/React__default["default"].createElement(SectionComp, {
8673
8740
  sectionData: sectionData,
@@ -8682,7 +8749,6 @@ function SectionRenderer({
8682
8749
  isCustomWebsite,
8683
8750
  sectionIndex
8684
8751
  }) {
8685
- // console.log("isCustomWebsite______", isCustomWebsite)
8686
8752
  return /*#__PURE__*/React__default["default"].createElement(MemoisedSection, {
8687
8753
  sectionData: sectionData,
8688
8754
  extraProps: extraProps,