diy-template-components 0.3.5 → 0.3.6

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,12 +1,12 @@
1
- function ___$insertStyle(css) {
2
- if (!css || !window) {
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;
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
10
  }
11
11
 
12
12
  import React, { createContext, useContext, forwardRef, useRef, useEffect, useState, useMemo, useLayoutEffect, Suspense, memo, lazy, Fragment } from 'react';
@@ -98,7 +98,7 @@ const useSectionStyles$a = createUseStyles(theme => ({
98
98
  cursor: 'default',
99
99
  position: 'relative',
100
100
  height: '55px',
101
- width: 'inherit'
101
+ width: '100%'
102
102
  },
103
103
  optionsContainer: {
104
104
  display: 'flex',
@@ -148,7 +148,10 @@ const useSectionStyles$a = createUseStyles(theme => ({
148
148
  imageDivImageNext: {
149
149
  objectFit: ({
150
150
  isCustomWebsite
151
- } = {}) => isCustomWebsite ? 'contain' : ''
151
+ } = {}) => isCustomWebsite ? 'contain' : '',
152
+ objectPosition: ({
153
+ isCustomWebsite
154
+ } = {}) => isCustomWebsite ? 'left' : ''
152
155
  },
153
156
  imageAnchorMobile: {
154
157
  pointerEvents: 'auto',
@@ -2257,12 +2260,12 @@ const useSectionStyles$8 = createUseStyles(theme => ({
2257
2260
  imageContainer: {
2258
2261
  width: '50%',
2259
2262
  position: 'relative',
2260
- height: '90%',
2261
2263
  paddingBottom: ({
2262
2264
  isCustomWebsite
2263
2265
  }) => isCustomWebsite ? '35%' : '',
2264
2266
  '& img': {
2265
- // objectFit: 'cover'
2267
+ height: '520px',
2268
+ objectFit: 'cover'
2266
2269
  }
2267
2270
  },
2268
2271
  subTitleHeading: {
@@ -2289,7 +2292,7 @@ const useSectionStyles$8 = createUseStyles(theme => ({
2289
2292
  sideBannerImage: {
2290
2293
  width: '100%',
2291
2294
  height: 'calc(100% - 100px)',
2292
- // objectFit: 'cover',
2295
+ objectFit: 'cover',
2293
2296
  objectPosition: '50% 50%'
2294
2297
  },
2295
2298
  absoluteButtonsBannerRight: {
@@ -4382,8 +4385,6 @@ function VideoTestimonial({
4382
4385
  layout: {
4383
4386
  containerWidth
4384
4387
  },
4385
- countryCode,
4386
- currencySymbol,
4387
4388
  isMobile
4388
4389
  } = useContext(PageContext);
4389
4390
  const classes = useVideoTestimonialStyles({
@@ -4415,9 +4416,7 @@ function VideoTestimonial({
4415
4416
  })), /*#__PURE__*/React.createElement(Wrapper, null, videoData.videoCarousel.components.map((data, index) => /*#__PURE__*/React.createElement(SingleVideoSlide$2, {
4416
4417
  data: data,
4417
4418
  key: index,
4418
- sectionIndex: sectionIndex,
4419
- countryCode: countryCode,
4420
- currencySymbol: currencySymbol
4419
+ sectionIndex: sectionIndex
4421
4420
  }))))));
4422
4421
  }
4423
4422
 
@@ -7326,9 +7325,7 @@ const SingleVideoSlide$1 = props => {
7326
7325
  const {
7327
7326
  data,
7328
7327
  webinarCtaClick,
7329
- conversions = 0,
7330
- countryCode,
7331
- currencySymbol
7328
+ conversions = 0
7332
7329
  } = props;
7333
7330
  const renderer = ({
7334
7331
  days,
@@ -7338,14 +7335,11 @@ const SingleVideoSlide$1 = props => {
7338
7335
  completed
7339
7336
  }) => {
7340
7337
  if (days === 0 && hours < 24) {
7341
- if (countryCode === 'KR') {
7342
- return /*#__PURE__*/React.createElement("span", null, hours, " \uC2DC\uAC04 ", minutes, " \uBD84 ", seconds, "\uCD08");
7343
- }
7344
7338
  return /*#__PURE__*/React.createElement("span", null, hours, "h ", minutes, "m ", seconds, "s");
7345
7339
  } else {
7346
7340
  let given = moment(props.data.offerPriceEndDate);
7347
7341
  let current = moment().startOf('day');
7348
- return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), ' ', countryCode === 'KR' ? '날' : 'day(s)');
7342
+ return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
7349
7343
  }
7350
7344
  };
7351
7345
  const checkIfOfferIsValid = () => moment().diff(moment(props.data.offerPriceEndDate)) < 0;
@@ -7377,44 +7371,6 @@ const SingleVideoSlide$1 = props => {
7377
7371
  return (discount / price * 100).toFixed(2);
7378
7372
  };
7379
7373
  const classes = useWebinarPromotionPage();
7380
- const effectivePrice = formatCurrency(countryCode, data?.effectivePrice, currencySymbol);
7381
- const renderHurryUpBannerText = () => {
7382
- let count = data.offerPriceValidFor - conversions;
7383
- if (countryCode === 'KR') {
7384
- if (count > 1) {
7385
- return `서두르세요! 현재 신청 가능 인원은 ${count}명 입니다.`;
7386
- } else {
7387
- return `서두르세요! ${count}명까지만 신청 가능이 가능합니다.`;
7388
- }
7389
- } else {
7390
- return `Hurry up! Offer left for ${count} ${count > 1 ? 'users now' : 'user only'}`;
7391
- }
7392
- };
7393
- const limitedPeriodOfferText = countryCode === 'KR' ? '기간 한정 딜이므로 서두르세요!' : 'Hurry up! Offer for limited period only';
7394
- const renderOfferEndsInText = () => {
7395
- if (countryCode === 'KR') {
7396
- return /*#__PURE__*/React.createElement("p", {
7397
- className: classes.offerText
7398
- }, /*#__PURE__*/React.createElement("span", {
7399
- className: classes.courseDetailTime
7400
- }, /*#__PURE__*/React.createElement(Countdown, {
7401
- renderer: renderer,
7402
- date: data.offerPriceEndDate
7403
- })), ' ', "\uD6C4\xA0\uC2E0\uCCAD\xA0\uB9C8\uAC10\xA0\uC608\uC815");
7404
- } else {
7405
- return /*#__PURE__*/React.createElement("p", {
7406
- className: classes.offerText
7407
- }, "Offer Ends in", ' ', /*#__PURE__*/React.createElement("span", {
7408
- className: classes.courseDetailTime
7409
- }, /*#__PURE__*/React.createElement(Countdown, {
7410
- renderer: renderer,
7411
- date: data.offerPriceEndDate
7412
- })));
7413
- }
7414
- };
7415
- const finalPrice = formatCurrency(countryCode, data?.price, currencySymbol);
7416
- const buyNowText = countryCode === 'KR' ? '이 강좌를 수강하세요.' : 'BUY NOW';
7417
- const registerNowText = countryCode === 'KR' ? '지금 신청하기' : 'REGISTER NOW';
7418
7374
  return /*#__PURE__*/React.createElement("div", {
7419
7375
  className: classes.videoCarouselContainer
7420
7376
  }, /*#__PURE__*/React.createElement("div", {
@@ -7427,11 +7383,11 @@ const SingleVideoSlide$1 = props => {
7427
7383
  className: classes.bannerContainer
7428
7384
  }, /*#__PURE__*/React.createElement("div", {
7429
7385
  className: classes.bannerContainerText
7430
- }, renderHurryUpBannerText())) : checkIfOfferIsValid() && data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : /*#__PURE__*/React.createElement("div", {
7386
+ }, "Hurry up! Offer left for", ' ', data.offerPriceValidFor - conversions, ' ', data.offerPriceValidFor - conversions > 1 ? 'users now' : 'user only')) : checkIfOfferIsValid() && data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : /*#__PURE__*/React.createElement("div", {
7431
7387
  className: classes.bannerContainer
7432
7388
  }, /*#__PURE__*/React.createElement("div", {
7433
7389
  className: classes.bannerContainerText
7434
- }, limitedPeriodOfferText))), /*#__PURE__*/React.createElement("h3", {
7390
+ }, "Hurry up! Offer for limited period only"))), /*#__PURE__*/React.createElement("h3", {
7435
7391
  ref: data?.videoTextHeading?.refSetter,
7436
7392
  className: classes.videoDetailsHeading,
7437
7393
  dangerouslySetInnerHTML: {
@@ -7471,7 +7427,14 @@ const SingleVideoSlide$1 = props => {
7471
7427
  }
7472
7428
  }))), /*#__PURE__*/React.createElement("div", {
7473
7429
  className: classes.courseViewContainer
7474
- }, data.isPaid !== 0 && checkIfOfferIsValid() && (data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : true) && renderOfferEndsInText(), /*#__PURE__*/React.createElement("div", {
7430
+ }, data.isPaid !== 0 && checkIfOfferIsValid() && (data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : true) && /*#__PURE__*/React.createElement("p", {
7431
+ className: classes.offerText
7432
+ }, "Offer Ends in", ' ', /*#__PURE__*/React.createElement("span", {
7433
+ className: classes.courseDetailTime
7434
+ }, /*#__PURE__*/React.createElement(Countdown, {
7435
+ renderer: renderer,
7436
+ date: data.offerPriceEndDate
7437
+ }))), /*#__PURE__*/React.createElement("div", {
7475
7438
  ref: data?.videoFrame?.refSetter,
7476
7439
  className: classes.iframeContainer
7477
7440
  }, /*#__PURE__*/React.createElement(VideoPlayer, {
@@ -7488,13 +7451,13 @@ const SingleVideoSlide$1 = props => {
7488
7451
  className: classes.priceContainer
7489
7452
  }, /*#__PURE__*/React.createElement("div", {
7490
7453
  className: classes.offerPrice
7491
- }, effectivePrice), checkForShowDiscount() && (data.offerPriceEndDate ? checkIfOfferIsValid() : true) && /*#__PURE__*/React.createElement("p", {
7454
+ }, "\u20B9", data?.effectivePrice), checkForShowDiscount() && (data.offerPriceEndDate ? checkIfOfferIsValid() : true) && /*#__PURE__*/React.createElement("p", {
7492
7455
  style: {
7493
7456
  fontSize: '20px'
7494
7457
  }
7495
7458
  }, /*#__PURE__*/React.createElement("span", {
7496
7459
  className: classes.originalPrice
7497
- }, finalPrice), ' ', /*#__PURE__*/React.createElement("span", {
7460
+ }, "\u20B9", data?.price), ' ', /*#__PURE__*/React.createElement("span", {
7498
7461
  className: classes.offerDiscount
7499
7462
  }, `${data && discount(data)}%`))) : null, /*#__PURE__*/React.createElement("div", {
7500
7463
  className: classes.webinarButtonContainer
@@ -7506,7 +7469,7 @@ const SingleVideoSlide$1 = props => {
7506
7469
  data: {
7507
7470
  // link: 'headerData?.loginCtaLink',
7508
7471
  // isLink: 1,
7509
- value: data.isPaid ? buyNowText : registerNowText
7472
+ value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
7510
7473
  // isExternal: 1
7511
7474
  },
7512
7475
 
@@ -7524,12 +7487,10 @@ function CoursePromotionPage$1({
7524
7487
  sectionIndex
7525
7488
  }) {
7526
7489
  const {
7490
+ isMobile,
7527
7491
  layout: {
7528
7492
  containerWidth
7529
- },
7530
- countryCode,
7531
- currencySymbol,
7532
- isMobile
7493
+ }
7533
7494
  } = useContext(PageContext);
7534
7495
  const classes = useWebinarPromotionPage({
7535
7496
  containerWidth,
@@ -7545,9 +7506,7 @@ function CoursePromotionPage$1({
7545
7506
  data: sectionData.components[0].metadata,
7546
7507
  webinarCtaClick: extraProps.webinarCtaClick,
7547
7508
  conversions: extraProps.conversions,
7548
- sectionIndex: sectionIndex,
7549
- countryCode: countryCode,
7550
- currencySymbol: currencySymbol
7509
+ sectionIndex: sectionIndex
7551
7510
  }))));
7552
7511
  }
7553
7512
 
@@ -7867,23 +7826,18 @@ const SingleVideoSlide = props => {
7867
7826
  completed
7868
7827
  }) => {
7869
7828
  if (days === 0 && hours < 24) {
7870
- if (countryCode === 'KR') {
7871
- return /*#__PURE__*/React.createElement("span", null, hours, " \uC2DC\uAC04 ", minutes, " \uBD84 ", seconds, "\uCD08");
7872
- }
7873
7829
  return /*#__PURE__*/React.createElement("span", null, hours, "h ", minutes, "m ", seconds, "s");
7874
7830
  } else {
7875
7831
  let given = moment(props.data.endDate);
7876
7832
  let current = moment().startOf('day');
7877
- return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), ' ', countryCode === 'KR' ? '날' : 'day(s)');
7833
+ return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
7878
7834
  }
7879
7835
  };
7880
7836
  const {
7881
7837
  data,
7882
7838
  courseBuyNow,
7883
7839
  conversions = 20,
7884
- showCourseInstallment,
7885
- countryCode,
7886
- currencySymbol
7840
+ showCourseInstallment
7887
7841
  } = props;
7888
7842
  const showCourseInstallmentData = data?.courseOverviewData;
7889
7843
  const InstalmentData = isEdit ? data?.courseOverviewData?.installments?.formData?.installments[0].installmentAmount : data?.courseOverviewData?.installments?.formData?.installmentInfo?.installments[0].installmentPrice;
@@ -7916,34 +7870,6 @@ const SingleVideoSlide = props => {
7916
7870
  }) => {
7917
7871
  return (discount / price * 100).toFixed(2);
7918
7872
  };
7919
- const renderHurryUpBannerText = () => {
7920
- return countryCode === 'KR' ? `서두르세요! 현재 신청 가능 인원은 ${data.offerPriceValidFor - conversions}명 입니다.` : `Hurry up! Offer left for ${data.offerPriceValidFor - conversions} users now`;
7921
- };
7922
- const limitedPeriodOfferText = countryCode === 'KR' ? `기간 한정 딜이므로 서두르세요!` : 'Hurry up! Offer for limited period only';
7923
- const renderOfferEndsInText = () => {
7924
- if (countryCode === 'KR') {
7925
- return /*#__PURE__*/React.createElement("p", {
7926
- className: classes.offerText
7927
- }, /*#__PURE__*/React.createElement("span", {
7928
- className: classes.courseDetailTime
7929
- }, /*#__PURE__*/React.createElement(Countdown, {
7930
- renderer: renderer,
7931
- date: data.endDate
7932
- })), ' ', "\uD6C4\xA0\uC2E0\uCCAD\xA0\uB9C8\uAC10\xA0\uC608\uC815");
7933
- } else {
7934
- return /*#__PURE__*/React.createElement("p", {
7935
- className: classes.offerText
7936
- }, "Offer Ends in", ' ', /*#__PURE__*/React.createElement("span", {
7937
- className: classes.courseDetailTime
7938
- }, /*#__PURE__*/React.createElement(Countdown, {
7939
- renderer: renderer,
7940
- date: data.endDate
7941
- })));
7942
- }
7943
- };
7944
- const effectivePrice = formatCurrency(countryCode, data?.effectivePrice, currencySymbol);
7945
- const finalPrice = formatCurrency(countryCode, data?.price, currencySymbol);
7946
- const buyNowText = countryCode === 'KR' ? '이 강좌를 수강하세요.' : 'BUY NOW';
7947
7873
  return /*#__PURE__*/React.createElement("div", {
7948
7874
  className: classes.videoCarouselContainer
7949
7875
  }, /*#__PURE__*/React.createElement("div", {
@@ -7956,11 +7882,11 @@ const SingleVideoSlide = props => {
7956
7882
  className: classes.bannerContainer
7957
7883
  }, /*#__PURE__*/React.createElement("div", {
7958
7884
  className: classes.bannerContainerText
7959
- }, renderHurryUpBannerText())) : checkIfOfferIsValid() && /*#__PURE__*/React.createElement("div", {
7885
+ }, "Hurry up! Offer left for", ' ', data.offerPriceValidFor - conversions, " users now")) : checkIfOfferIsValid() && /*#__PURE__*/React.createElement("div", {
7960
7886
  className: classes.bannerContainer
7961
7887
  }, /*#__PURE__*/React.createElement("div", {
7962
7888
  className: classes.bannerContainerText
7963
- }, limitedPeriodOfferText))), /*#__PURE__*/React.createElement("div", {
7889
+ }, "Hurry up! Offer for limited period only"))), /*#__PURE__*/React.createElement("div", {
7964
7890
  className: classes.emblemContainer
7965
7891
  }, data?.courseOverviewData?.courseTagList.length && data?.courseOverviewData?.courseTagList?.map(data => {
7966
7892
  return /*#__PURE__*/React.createElement("div", {
@@ -8025,7 +7951,14 @@ const SingleVideoSlide = props => {
8025
7951
  }
8026
7952
  }, /*#__PURE__*/React.createElement("div", {
8027
7953
  className: classes.courseViewContainer
8028
- }, checkIfOfferIsValid() && (data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : true) && renderOfferEndsInText(), /*#__PURE__*/React.createElement("div", {
7954
+ }, checkIfOfferIsValid() && (data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : true) && /*#__PURE__*/React.createElement("p", {
7955
+ className: classes.offerText
7956
+ }, "Offer Ends in", ' ', /*#__PURE__*/React.createElement("span", {
7957
+ className: classes.courseDetailTime
7958
+ }, /*#__PURE__*/React.createElement(Countdown, {
7959
+ renderer: renderer,
7960
+ date: data.endDate
7961
+ }))), /*#__PURE__*/React.createElement("div", {
8029
7962
  ref: data?.videoFrame?.refSetter,
8030
7963
  className: classes.iframeContainer
8031
7964
  }, /*#__PURE__*/React.createElement(VideoPlayer, {
@@ -8039,14 +7972,14 @@ const SingleVideoSlide = props => {
8039
7972
  className: classes.priceContainer
8040
7973
  }, /*#__PURE__*/React.createElement("div", {
8041
7974
  className: classes.offerPrice
8042
- }, effectivePrice), checkForShowDiscount() && (data.endDate ? checkIfOfferIsValid() : true) && /*#__PURE__*/React.createElement("p", {
7975
+ }, "\u20B9 ", data.effectivePrice), checkForShowDiscount() && (data.endDate ? checkIfOfferIsValid() : true) && /*#__PURE__*/React.createElement("p", {
8043
7976
  style: {
8044
7977
  // fontSize: '20px',
8045
7978
  marginTop: '0px'
8046
7979
  }
8047
7980
  }, /*#__PURE__*/React.createElement("span", {
8048
7981
  className: classes.originalPrice
8049
- }, finalPrice), ' ', /*#__PURE__*/React.createElement("span", {
7982
+ }, "\u20B9 ", data.price), ' ', /*#__PURE__*/React.createElement("span", {
8050
7983
  className: classes.offerDiscount
8051
7984
  }, `${data && discount(data)}%`))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
8052
7985
  style: {
@@ -8055,7 +7988,7 @@ const SingleVideoSlide = props => {
8055
7988
  data: {
8056
7989
  // link: 'headerData?.loginCtaLink',
8057
7990
  // isLink: 1,
8058
- value: buyNowText
7991
+ value: 'BUY NOW'
8059
7992
  // isExternal: 1
8060
7993
  },
8061
7994
 
@@ -8091,12 +8024,10 @@ function CoursePromotionPage({
8091
8024
  sectionIndex
8092
8025
  }) {
8093
8026
  const {
8027
+ isMobile,
8094
8028
  layout: {
8095
8029
  containerWidth
8096
- },
8097
- countryCode,
8098
- currencySymbol,
8099
- isMobile
8030
+ }
8100
8031
  } = useContext(PageContext);
8101
8032
  const classes = useCoursePromotionPage({
8102
8033
  containerWidth,
@@ -8113,9 +8044,7 @@ function CoursePromotionPage({
8113
8044
  courseBuyNow: extraProps.courseBuyNow,
8114
8045
  showCourseInstallment: extraProps.showCourseInstallment,
8115
8046
  conversions: extraProps.conversions,
8116
- sectionIndex: sectionIndex,
8117
- countryCode: countryCode,
8118
- currencySymbol: currencySymbol
8047
+ sectionIndex: sectionIndex
8119
8048
  }))));
8120
8049
  }
8121
8050