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.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
  },
@@ -2861,7 +2929,6 @@ const Section$3 = ({
2861
2929
  imageUrl: nodeData.image.metadata.value,
2862
2930
  containerWidth
2863
2931
  });
2864
- console.log('isCustomWebsite______', isCustomWebsite);
2865
2932
  return /*#__PURE__*/React__default["default"].createElement("section", {
2866
2933
  className: classes.bannerCarouselCenterSection
2867
2934
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -2908,7 +2975,6 @@ function BannerCarouselCenter({
2908
2975
  isCustomWebsite,
2909
2976
  sectionIndex
2910
2977
  }) {
2911
- console.log('isCustomWebsite______', isCustomWebsite);
2912
2978
  const classes = useSectionStyles$6();
2913
2979
  const [{
2914
2980
  bannerCarousel
@@ -2968,7 +3034,13 @@ const useSectionStyles$5 = createUseStyles(theme => {
2968
3034
  position: 'relative',
2969
3035
  width: '100%',
2970
3036
  // height: "650px"
2971
- paddingBottom: '82%'
3037
+ paddingBottom: ({
3038
+ isCustomWebsite
3039
+ }) => isCustomWebsite ? '85%' : '',
3040
+ '& img': {
3041
+ height: '520px',
3042
+ objectFit: 'cover'
3043
+ }
2972
3044
  },
2973
3045
  imageBorder: {
2974
3046
  border: `2px solid ${theme?.palette?.primary?.light}`,
@@ -3019,6 +3091,14 @@ const useSectionStyles$5 = createUseStyles(theme => {
3019
3091
  width: '100%',
3020
3092
  padding: '0'
3021
3093
  },
3094
+ // imageContainer: {
3095
+
3096
+ // '& img': {
3097
+ // height: "520px",
3098
+ // objectFit: "cover"
3099
+ // }
3100
+
3101
+ // },
3022
3102
  imageContainerDiv: {
3023
3103
  width: '100%'
3024
3104
  },
@@ -3047,14 +3127,16 @@ function Section$2({
3047
3127
  nodeData,
3048
3128
  sectionIndex
3049
3129
  }) {
3050
- const classes = useSectionStyles$5();
3051
3130
  const {
3052
3131
  layout: {
3053
3132
  containerWidth
3054
3133
  },
3055
- isMobile
3134
+ isMobile,
3135
+ isCustomWebsite
3056
3136
  } = React.useContext(PageContext);
3057
- console.log('nodedata_____SDF', sectionIndex);
3137
+ const classes = useSectionStyles$5({
3138
+ isCustomWebsite
3139
+ });
3058
3140
  return /*#__PURE__*/React__default["default"].createElement("div", {
3059
3141
  className: classes.centerData
3060
3142
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -3094,13 +3176,15 @@ function Section$2({
3094
3176
  ref: nodeData?.cta?.refSetter,
3095
3177
  data: nodeData.cta.metadata,
3096
3178
  type: nodeData?.cta?.metadata?.type,
3097
- size: isMobile ? 'small' : 'medium'
3179
+ size: isMobile ? 'small' : 'medium',
3180
+ name: "button"
3098
3181
  })));
3099
3182
  }
3100
3183
  function BannerCarouselLeft({
3101
3184
  sectionData,
3102
3185
  isCustomWebsite,
3103
- sectionIndex
3186
+ sectionIndex,
3187
+ isMobile
3104
3188
  }) {
3105
3189
  const {
3106
3190
  layout: {
@@ -3280,7 +3364,6 @@ async function postApiCall(baseURLs, data) {
3280
3364
  return res.data;
3281
3365
  }
3282
3366
  } catch (err) {
3283
- console.log(err);
3284
3367
  return;
3285
3368
  }
3286
3369
  }
@@ -3303,7 +3386,6 @@ async function postApiCallForm(baseURLs, data, extraProps) {
3303
3386
  return res.data;
3304
3387
  });
3305
3388
  } catch (err) {
3306
- console.log(err);
3307
3389
  return;
3308
3390
  }
3309
3391
  }
@@ -3719,7 +3801,6 @@ function Section$1({
3719
3801
  centerMode: true,
3720
3802
  centerPadding: isMobile ? '10px 0 0' : '80px 0 0'
3721
3803
  };
3722
- console.log('nodedata_____', nodeData?.metadata?.order);
3723
3804
  const carouselContent = carouselList.map((el, idx) =>
3724
3805
  /*#__PURE__*/
3725
3806
  // kept an extra element as slick mutates this element and gives it 100% width
@@ -6527,7 +6608,6 @@ function Contact({
6527
6608
  } = React.useContext(PageContext);
6528
6609
  let [btnDisabled, setBtnDisabled] = React.useState(false);
6529
6610
  const [nodeData] = sectionData.components;
6530
- console.log('nodedata_____', nodeData?.metadata?.order);
6531
6611
  const classes = useSectionStyles({
6532
6612
  containerWidth
6533
6613
  });
@@ -6709,7 +6789,8 @@ function Contact({
6709
6789
  onClick: () => handleSubmit(),
6710
6790
  type: nodeData?.cta?.metadata?.type,
6711
6791
  size: isMobile ? 'small' : 'medium',
6712
- disabled: btnDisabled
6792
+ disabled: btnDisabled,
6793
+ name: "button"
6713
6794
  }))))));
6714
6795
  }
6715
6796
 
@@ -7011,7 +7092,6 @@ const SingleVideoSlide$1 = props => {
7011
7092
  price,
7012
7093
  discount
7013
7094
  }) => {
7014
- console.log('discountxx', props.data.price, props.data.discount);
7015
7095
  return (discount / price * 100).toFixed(2);
7016
7096
  };
7017
7097
  const classes = useWebinarPromotionPage();
@@ -7448,15 +7528,6 @@ const SingleVideoSlide = props => {
7448
7528
  isMobile,
7449
7529
  isEdit
7450
7530
  } = 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
7531
  const renderer = ({
7461
7532
  days,
7462
7533
  hours,
@@ -7631,6 +7702,7 @@ const SingleVideoSlide = props => {
7631
7702
  type: 'primary',
7632
7703
  size: 'medium',
7633
7704
  target: null,
7705
+ name: "button",
7634
7706
  rel: null
7635
7707
  // styling={isMobile ? { margin: '0 40px' } : {}}
7636
7708
  })))), showCourseInstallmentData && InstalmentData && /*#__PURE__*/React__default["default"].createElement("div", {
@@ -7665,7 +7737,6 @@ function CoursePromotionPage({
7665
7737
  const classes = useCoursePromotionPage({
7666
7738
  containerWidth
7667
7739
  });
7668
- console.log(sectionData, 'sectionData');
7669
7740
  return /*#__PURE__*/React__default["default"].createElement("div", {
7670
7741
  className: classes.courseSuperContainer
7671
7742
  }, /*#__PURE__*/React__default["default"].createElement("div", {
@@ -8115,9 +8186,7 @@ function Tiles({
8115
8186
  isEdit
8116
8187
  } = React.useContext(PageContext);
8117
8188
  const nodeData = sectionData.components;
8118
- console.log(nodeData);
8119
8189
  const tilesList = nodeData[0]?.tilesList.components;
8120
- console.log('nodedata_____', nodeData?.metadata?.order);
8121
8190
  const handleClick = value => {
8122
8191
  if (!isEdit && value) {
8123
8192
  if (value.indexOf('http://') == 0 || value.indexOf('https://') == 0) {
@@ -8592,7 +8661,6 @@ function EmailDripMarket({
8592
8661
  sectionData,
8593
8662
  extraProps = {}
8594
8663
  }) {
8595
- console.log('extrapropstemplate', extraProps);
8596
8664
  const isInitialMount = React.useRef(true);
8597
8665
  const convertToHtml = sectionData => {
8598
8666
  const html = ReactDOMServer__default["default"].renderToStaticMarkup( /*#__PURE__*/React__default["default"].createElement(Section, {
@@ -8666,8 +8734,6 @@ const MemoisedSection = /*#__PURE__*/React.memo(({
8666
8734
  isCustomWebsite,
8667
8735
  sectionIndex
8668
8736
  }) => {
8669
- // console.log("isCustomWebsite______", isCustomWebsite)
8670
- console.log('templatesectiondata', sectionData);
8671
8737
  const SectionComp = getCompToRender(sectionData.type);
8672
8738
  return /*#__PURE__*/React__default["default"].createElement(SectionComp, {
8673
8739
  sectionData: sectionData,
@@ -8682,7 +8748,6 @@ function SectionRenderer({
8682
8748
  isCustomWebsite,
8683
8749
  sectionIndex
8684
8750
  }) {
8685
- // console.log("isCustomWebsite______", isCustomWebsite)
8686
8751
  return /*#__PURE__*/React__default["default"].createElement(MemoisedSection, {
8687
8752
  sectionData: sectionData,
8688
8753
  extraProps: extraProps,