diy-template-components 2.0.109 → 2.0.111

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
@@ -1,14 +1,3 @@
1
- function ___$insertStyle(css) {
2
- if (!css || typeof window === 'undefined') {
3
- return;
4
- }
5
- const style = document.createElement('style');
6
- style.setAttribute('type', 'text/css');
7
- style.innerHTML = css;
8
- document.head.appendChild(style);
9
- return css;
10
- }
11
-
12
1
  import React, { createContext, useContext, forwardRef, useRef, useEffect, useState, useMemo, useLayoutEffect, Suspense, memo, lazy, Fragment } from 'react';
13
2
  import Slider from 'react-slick';
14
3
  import axios from 'axios';
@@ -19,18 +8,13 @@ import ReactDOMServer from 'react-dom/server';
19
8
  import { createTheming, createUseStyles as createUseStyles$1, useTheme as useTheme$1 } from 'react-jss';
20
9
 
21
10
  function _extends() {
22
- _extends = Object.assign ? Object.assign.bind() : function (target) {
23
- for (var i = 1; i < arguments.length; i++) {
24
- var source = arguments[i];
25
- for (var key in source) {
26
- if (Object.prototype.hasOwnProperty.call(source, key)) {
27
- target[key] = source[key];
28
- }
29
- }
11
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
12
+ for (var e = 1; e < arguments.length; e++) {
13
+ var t = arguments[e];
14
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
30
15
  }
31
- return target;
32
- };
33
- return _extends.apply(this, arguments);
16
+ return n;
17
+ }, _extends.apply(null, arguments);
34
18
  }
35
19
 
36
20
  const PageContext = /*#__PURE__*/createContext({});
@@ -867,7 +851,7 @@ const icons = {
867
851
  GroupProfile: getConfiguredIcon2(groupProfile, false, true)
868
852
  };
869
853
 
870
- const someMethod1 = ( /** @type {import('./types').IconData["svgChildrenConfigs"]} */svgChildrenConfigs, color, hoverColor) => {
854
+ const someMethod1 = (/** @type {import('./types').IconData["svgChildrenConfigs"]} */svgChildrenConfigs, color, hoverColor) => {
871
855
  /** @type {{ [k:string]:React.CSSProperties; }} */
872
856
  const obj = {};
873
857
  for (const svgChildConfig of svgChildrenConfigs) {
@@ -956,7 +940,7 @@ const Icon = ({
956
940
  }, []);
957
941
  /** */
958
942
 
959
- const rootRef = useRef( /** @type {HTMLElement} */null);
943
+ const rootRef = useRef(/** @type {HTMLElement} */null);
960
944
  // this ref is used to cancel the fetch promise success callback in case name prop changed
961
945
  const currentName = useRef(name);
962
946
  const [svgState, setSvgState] = useState(defaultSvgState);
@@ -6597,7 +6581,6 @@ const useCourseStyles = createUseStyles(theme => {
6597
6581
  });
6598
6582
 
6599
6583
  async function getCourseList(baseURLs, hashToken) {
6600
- console.log('hash', baseURLs, hashToken);
6601
6584
  if (!hashToken) {
6602
6585
  throw 'Missing hash token';
6603
6586
  }
@@ -6612,7 +6595,6 @@ async function getCourseList(baseURLs, hashToken) {
6612
6595
  requiredFilters: '[10]'
6613
6596
  }
6614
6597
  });
6615
- console.log('res', res);
6616
6598
  if (res) {
6617
6599
  return res.data;
6618
6600
  }
@@ -6757,20 +6739,16 @@ function courses({
6757
6739
  const [nodeData] = sectionData?.components;
6758
6740
  const [utmParams, setUtmParams] = useState('');
6759
6741
  const handleApiCall = () => {
6760
- console.log('base', baseURLs);
6761
6742
  if (baseURLs) {
6762
6743
  getCourseList(baseURLs, hashToken).then(response => {
6763
- console.log('response', response);
6764
6744
  const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
6765
6745
  const coursesData = response?.data?.coursesData;
6766
6746
  if (coursesData && coursesData.length) {
6767
6747
  setCardList(response?.data?.coursesData);
6768
6748
  setShowShimmer(false);
6769
6749
  } else {
6770
- console.log('edit');
6771
6750
  // For Edit Page: If no data found, show placeholders. If placeholder doesn't come from backend, show shimmer.
6772
6751
  if (isEdit) {
6773
- console.log('edit1', placeholders);
6774
6752
  if (placeholders && placeholders.length) {
6775
6753
  setShowShimmer(false);
6776
6754
  setFallbackImages(placeholders);
@@ -6780,7 +6758,6 @@ function courses({
6780
6758
  else setErrored(true);
6781
6759
  }
6782
6760
  }).catch(err => {
6783
- console.log('err', err);
6784
6761
  const errMsg = err?.response?.data?.data?.message;
6785
6762
  if (errMsg === 'NOT_FOUND') {
6786
6763
  if (nodeData?.cardCarousel?.metadata?.placeholders?.length && isEdit) {
@@ -6795,10 +6772,8 @@ function courses({
6795
6772
  };
6796
6773
  useEffect(() => {
6797
6774
  const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
6798
- console.log('placeholders test', placeholders, isMasterTemplate);
6799
- debugger;
6800
6775
  // For Master template Preview: Show placeholder images. If placeholder doesn't come from backend, show shimmer.
6801
- if (isMasterTemplate && false) {
6776
+ if (isMasterTemplate) {
6802
6777
  if (placeholders && placeholders.length) {
6803
6778
  setShowShimmer(false);
6804
6779
  setFallbackImages(placeholders);
@@ -9539,15 +9514,15 @@ const useTilesStyles = createUseStyles(theme => {
9539
9514
  lineHeight: '46px',
9540
9515
  color: '#7D8592',
9541
9516
  marginBottom: theme.spacing.margin.tiny,
9542
- textAlign: 'center'
9517
+ textAlign: 'center',
9518
+ '@media screen and (max-width: 767px)': {
9519
+ lineHeight: '16px'
9520
+ }
9543
9521
  },
9544
9522
  '@media screen and (max-width: 767px)': {
9545
9523
  tileDiv: {
9546
9524
  width: '100%'
9547
9525
  },
9548
- headerTitle: {
9549
- lineHeight: '0px'
9550
- },
9551
9526
  row: {
9552
9527
  marginTop: '24px',
9553
9528
  display: 'grid',
@@ -10058,7 +10033,7 @@ function EmailDripMarket({
10058
10033
  }
10059
10034
  };
10060
10035
  const convertToHtml = sectionData => {
10061
- const html = ReactDOMServer.renderToStaticMarkup( /*#__PURE__*/React.createElement(Section, {
10036
+ const html = ReactDOMServer.renderToStaticMarkup(/*#__PURE__*/React.createElement(Section, {
10062
10037
  nodeData: sectionData,
10063
10038
  renderHTML: true,
10064
10039
  isProceed: extraProps.isProceed,