diy-template-components 4.0.5 → 4.0.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
@@ -12634,205 +12634,6 @@ var index$2 = /*#__PURE__*/Object.freeze({
12634
12634
  'default': TimerAndCall
12635
12635
  });
12636
12636
 
12637
- const TYPE_TO_COMPONENT_MAP = {
12638
- BANNER_CAROUSEL_RIGHT: BannerCarouselRight,
12639
- GRID_CARD: List,
12640
- BANNER_CAROUSEL_CENTER: BannerCarouselCenter,
12641
- BANNER_CAROUSEL_CENTER_V2: BannerCarouselCenterv2,
12642
- BANNER_CAROUSEL_LEFT: BannerCarouselLeft,
12643
- FORM_SUBSCRIBE: SubscribeToNewsletter,
12644
- TEXT_TESTIMONIAL: Testimonials,
12645
- VIDEO_TESTIMONIAL: VideoTestimonial,
12646
- VIDEO: Video,
12647
- INFO: Info,
12648
- TEXT: TextSection,
12649
- IMAGE_GALLERY: PhotoGallery,
12650
- FAQ_LISTING: FAQListing,
12651
- TEXT_GRID: TextGrid,
12652
- COURSE_CAROUSEL: courses,
12653
- TEAM_CARD: TeamCard,
12654
- CONTACT: FormEnquiry,
12655
- FORM_ENQUIRY: Contact,
12656
- WEBINAR_LANDING_PAGE: CoursePromotionPage$1,
12657
- COURSE_LANDING_PAGE: CoursePromotionPage,
12658
- FORM_LANDING_PAGE: FormPage,
12659
- TILES_SECTION: Tiles,
12660
- EMAIL_DRIP_MARKET: EmailDripMarket,
12661
- ABOUT_INSTITUTE,
12662
- COUNTER_SECTION: CounterSection,
12663
- STICKY_CTA: StickyCta,
12664
- CUSTOM_HTML_SECTION: CustomHtmlRender,
12665
- TIMER_AND_CALL: TimerAndCall
12666
- };
12667
- const getCompToRender = type => TYPE_TO_COMPONENT_MAP[type] || (() => null);
12668
- const MemoisedSection = /*#__PURE__*/memo(({
12669
- sectionData,
12670
- extraProps,
12671
- isCustomWebsite,
12672
- sectionIndex
12673
- }) => {
12674
- console.log('extraProps in section data', extraProps);
12675
- const SectionComp = getCompToRender(sectionData.type);
12676
- return /*#__PURE__*/React.createElement(SectionComp, {
12677
- sectionData: sectionData,
12678
- extraProps: extraProps,
12679
- isCustomWebsite: isCustomWebsite,
12680
- sectionIndex: sectionIndex
12681
- });
12682
- });
12683
- const SectionWithBackground = withSectionBackground(MemoisedSection);
12684
- function SectionRenderer({
12685
- sectionData,
12686
- extraProps,
12687
- isCustomWebsite,
12688
- sectionIndex
12689
- }) {
12690
- let sectionBg = {};
12691
- if (sectionData?.isV2Section) {
12692
- sectionBg = sectionData?.bgSection?.components?.[0]?.sectionBgData || {};
12693
- }
12694
- return /*#__PURE__*/React.createElement(SectionWithBackground, {
12695
- sectionData: sectionData,
12696
- extraProps: extraProps,
12697
- isCustomWebsite: isCustomWebsite,
12698
- sectionIndex: sectionIndex,
12699
- isSkipV2Section: sectionData?.isV2Section,
12700
- componentBg: sectionBg || {}
12701
- });
12702
- }
12703
-
12704
- function PageRenderer({
12705
- pageData: {
12706
- metadata: {
12707
- theme: {
12708
- color = defaultTheme.color,
12709
- font = defaultTheme.font,
12710
- roundness = defaultTheme.roundness
12711
- } = defaultTheme,
12712
- layout = defaultLayout
12713
- } = defaultMetadata,
12714
- sections,
12715
- header,
12716
- footer,
12717
- validations = {},
12718
- _id,
12719
- isLandingPage = false,
12720
- isCustomWebsite = false
12721
- },
12722
- isMobile = false,
12723
- isLandingPages = false,
12724
- baseURLs = {},
12725
- hashToken,
12726
- SectionWrapper,
12727
- isMasterTemplate,
12728
- basePath,
12729
- countryCode,
12730
- currencySymbol,
12731
- isPreview,
12732
- isEdit,
12733
- sectionPlaceholder,
12734
- templateId,
12735
- isTutorWebsite = false,
12736
- extraProps,
12737
- hideLogin
12738
- }) {
12739
- const navList = header?.navs;
12740
- const context = useMemo(() => ({
12741
- isMobile,
12742
- isLandingPages,
12743
- layout,
12744
- baseURLs,
12745
- hashToken,
12746
- isMasterTemplate,
12747
- basePath,
12748
- isPreview,
12749
- isEdit,
12750
- templateId,
12751
- navList,
12752
- validations,
12753
- isTutorWebsite,
12754
- extraProps,
12755
- hideLogin,
12756
- isCustomWebsite,
12757
- _id,
12758
- countryCode,
12759
- currencySymbol
12760
- }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id, countryCode, currencySymbol]);
12761
- const theme = useMemo(() => generateTheme(color, font, context.isMobile, roundness), [color, font, context.isMobile, roundness]);
12762
- const Wrapper = SectionWrapper || Fragment;
12763
- return /*#__PURE__*/React.createElement(ThemeProvider, {
12764
- theme: theme
12765
- }, /*#__PURE__*/React.createElement(PageContext.Provider, {
12766
- value: context
12767
- }, /*#__PURE__*/React.createElement(FontSeeder, {
12768
- fontFamily: font
12769
- }), !!header && /*#__PURE__*/React.createElement(Wrapper, !!SectionWrapper && {
12770
- sectionData: header,
12771
- isHeader: true
12772
- }, /*#__PURE__*/React.createElement(Header, {
12773
- data: header,
12774
- isLandingPage: isLandingPage,
12775
- extraProps: extraProps
12776
- })), sections?.length ? sections?.map((sectionData, sectionIndex) => /*#__PURE__*/React.createElement(Wrapper, _extends({}, !!SectionWrapper && {
12777
- sectionData,
12778
- sectionIndex
12779
- }, {
12780
- key: sectionData.type + (sectionData._id || sectionIndex)
12781
- }), /*#__PURE__*/React.createElement(SectionRenderer, {
12782
- sectionData: sectionData,
12783
- extraProps: extraProps,
12784
- isCustomWebsite: isCustomWebsite,
12785
- sectionIndex: sectionIndex
12786
- }))) : sectionPlaceholder, !!footer && /*#__PURE__*/React.createElement(Wrapper, !!SectionWrapper && {
12787
- sectionData: footer,
12788
- isFooter: true
12789
- }, /*#__PURE__*/React.createElement(Footer, {
12790
- data: footer
12791
- }))));
12792
- }
12793
-
12794
- const componentParser = compObj => {
12795
- if (compObj.type === 'componentCollection') {
12796
- const component = {
12797
- _id: compObj._id,
12798
- metadata: compObj.metadata || {}
12799
- };
12800
- compObj.components.forEach(comp => {
12801
- component[comp.name] = componentParser(comp);
12802
- });
12803
- return component;
12804
- }
12805
- if (Array.isArray(compObj.components)) {
12806
- compObj.components = compObj.components.map(componentParser);
12807
- }
12808
- return compObj;
12809
- };
12810
- const inverseComponentParser = compObj => {
12811
- if (!compObj.type) {
12812
- const {
12813
- metadata,
12814
- _id,
12815
- ...existingComponent
12816
- } = compObj;
12817
- const newComponent = {
12818
- type: 'componentCollection',
12819
- name: '',
12820
- elementType: '',
12821
- label: '',
12822
- metadata: metadata || {},
12823
- components: [],
12824
- _id
12825
- };
12826
- newComponent.components = Object.values(existingComponent).map(inverseComponentParser);
12827
- return newComponent;
12828
- } else {
12829
- if (compObj.components) {
12830
- compObj.components = compObj.components.map(inverseComponentParser);
12831
- }
12832
- return compObj;
12833
- }
12834
- };
12835
-
12836
12637
  const useVideoWorkshopPromotionStyles = createUseStyles(theme => {
12837
12638
  return {
12838
12639
  section: {
@@ -13072,6 +12873,206 @@ var index$1 = /*#__PURE__*/Object.freeze({
13072
12873
  'default': VideoWorkshopPromotion
13073
12874
  });
13074
12875
 
12876
+ const TYPE_TO_COMPONENT_MAP = {
12877
+ BANNER_CAROUSEL_RIGHT: BannerCarouselRight,
12878
+ GRID_CARD: List,
12879
+ BANNER_CAROUSEL_CENTER: BannerCarouselCenter,
12880
+ BANNER_CAROUSEL_CENTER_V2: BannerCarouselCenterv2,
12881
+ BANNER_CAROUSEL_LEFT: BannerCarouselLeft,
12882
+ FORM_SUBSCRIBE: SubscribeToNewsletter,
12883
+ TEXT_TESTIMONIAL: Testimonials,
12884
+ VIDEO_TESTIMONIAL: VideoTestimonial,
12885
+ VIDEO: Video,
12886
+ INFO: Info,
12887
+ TEXT: TextSection,
12888
+ IMAGE_GALLERY: PhotoGallery,
12889
+ FAQ_LISTING: FAQListing,
12890
+ TEXT_GRID: TextGrid,
12891
+ COURSE_CAROUSEL: courses,
12892
+ TEAM_CARD: TeamCard,
12893
+ CONTACT: FormEnquiry,
12894
+ FORM_ENQUIRY: Contact,
12895
+ WEBINAR_LANDING_PAGE: CoursePromotionPage$1,
12896
+ COURSE_LANDING_PAGE: CoursePromotionPage,
12897
+ FORM_LANDING_PAGE: FormPage,
12898
+ TILES_SECTION: Tiles,
12899
+ EMAIL_DRIP_MARKET: EmailDripMarket,
12900
+ ABOUT_INSTITUTE,
12901
+ COUNTER_SECTION: CounterSection,
12902
+ STICKY_CTA: StickyCta,
12903
+ CUSTOM_HTML_SECTION: CustomHtmlRender,
12904
+ TIMER_AND_CALL: TimerAndCall,
12905
+ VIDEO_WORKSHOP_PROMOTION: VideoWorkshopPromotion
12906
+ };
12907
+ const getCompToRender = type => TYPE_TO_COMPONENT_MAP[type] || (() => null);
12908
+ const MemoisedSection = /*#__PURE__*/memo(({
12909
+ sectionData,
12910
+ extraProps,
12911
+ isCustomWebsite,
12912
+ sectionIndex
12913
+ }) => {
12914
+ console.log('extraProps in section data', extraProps);
12915
+ const SectionComp = getCompToRender(sectionData.type);
12916
+ return /*#__PURE__*/React.createElement(SectionComp, {
12917
+ sectionData: sectionData,
12918
+ extraProps: extraProps,
12919
+ isCustomWebsite: isCustomWebsite,
12920
+ sectionIndex: sectionIndex
12921
+ });
12922
+ });
12923
+ const SectionWithBackground = withSectionBackground(MemoisedSection);
12924
+ function SectionRenderer({
12925
+ sectionData,
12926
+ extraProps,
12927
+ isCustomWebsite,
12928
+ sectionIndex
12929
+ }) {
12930
+ let sectionBg = {};
12931
+ if (sectionData?.isV2Section) {
12932
+ sectionBg = sectionData?.bgSection?.components?.[0]?.sectionBgData || {};
12933
+ }
12934
+ return /*#__PURE__*/React.createElement(SectionWithBackground, {
12935
+ sectionData: sectionData,
12936
+ extraProps: extraProps,
12937
+ isCustomWebsite: isCustomWebsite,
12938
+ sectionIndex: sectionIndex,
12939
+ isSkipV2Section: sectionData?.isV2Section,
12940
+ componentBg: sectionBg || {}
12941
+ });
12942
+ }
12943
+
12944
+ function PageRenderer({
12945
+ pageData: {
12946
+ metadata: {
12947
+ theme: {
12948
+ color = defaultTheme.color,
12949
+ font = defaultTheme.font,
12950
+ roundness = defaultTheme.roundness
12951
+ } = defaultTheme,
12952
+ layout = defaultLayout
12953
+ } = defaultMetadata,
12954
+ sections,
12955
+ header,
12956
+ footer,
12957
+ validations = {},
12958
+ _id,
12959
+ isLandingPage = false,
12960
+ isCustomWebsite = false
12961
+ },
12962
+ isMobile = false,
12963
+ isLandingPages = false,
12964
+ baseURLs = {},
12965
+ hashToken,
12966
+ SectionWrapper,
12967
+ isMasterTemplate,
12968
+ basePath,
12969
+ countryCode,
12970
+ currencySymbol,
12971
+ isPreview,
12972
+ isEdit,
12973
+ sectionPlaceholder,
12974
+ templateId,
12975
+ isTutorWebsite = false,
12976
+ extraProps,
12977
+ hideLogin
12978
+ }) {
12979
+ const navList = header?.navs;
12980
+ const context = useMemo(() => ({
12981
+ isMobile,
12982
+ isLandingPages,
12983
+ layout,
12984
+ baseURLs,
12985
+ hashToken,
12986
+ isMasterTemplate,
12987
+ basePath,
12988
+ isPreview,
12989
+ isEdit,
12990
+ templateId,
12991
+ navList,
12992
+ validations,
12993
+ isTutorWebsite,
12994
+ extraProps,
12995
+ hideLogin,
12996
+ isCustomWebsite,
12997
+ _id,
12998
+ countryCode,
12999
+ currencySymbol
13000
+ }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id, countryCode, currencySymbol]);
13001
+ const theme = useMemo(() => generateTheme(color, font, context.isMobile, roundness), [color, font, context.isMobile, roundness]);
13002
+ const Wrapper = SectionWrapper || Fragment;
13003
+ return /*#__PURE__*/React.createElement(ThemeProvider, {
13004
+ theme: theme
13005
+ }, /*#__PURE__*/React.createElement(PageContext.Provider, {
13006
+ value: context
13007
+ }, /*#__PURE__*/React.createElement(FontSeeder, {
13008
+ fontFamily: font
13009
+ }), !!header && /*#__PURE__*/React.createElement(Wrapper, !!SectionWrapper && {
13010
+ sectionData: header,
13011
+ isHeader: true
13012
+ }, /*#__PURE__*/React.createElement(Header, {
13013
+ data: header,
13014
+ isLandingPage: isLandingPage,
13015
+ extraProps: extraProps
13016
+ })), sections?.length ? sections?.map((sectionData, sectionIndex) => /*#__PURE__*/React.createElement(Wrapper, _extends({}, !!SectionWrapper && {
13017
+ sectionData,
13018
+ sectionIndex
13019
+ }, {
13020
+ key: sectionData.type + (sectionData._id || sectionIndex)
13021
+ }), /*#__PURE__*/React.createElement(SectionRenderer, {
13022
+ sectionData: sectionData,
13023
+ extraProps: extraProps,
13024
+ isCustomWebsite: isCustomWebsite,
13025
+ sectionIndex: sectionIndex
13026
+ }))) : sectionPlaceholder, !!footer && /*#__PURE__*/React.createElement(Wrapper, !!SectionWrapper && {
13027
+ sectionData: footer,
13028
+ isFooter: true
13029
+ }, /*#__PURE__*/React.createElement(Footer, {
13030
+ data: footer
13031
+ }))));
13032
+ }
13033
+
13034
+ const componentParser = compObj => {
13035
+ if (compObj.type === 'componentCollection') {
13036
+ const component = {
13037
+ _id: compObj._id,
13038
+ metadata: compObj.metadata || {}
13039
+ };
13040
+ compObj.components.forEach(comp => {
13041
+ component[comp.name] = componentParser(comp);
13042
+ });
13043
+ return component;
13044
+ }
13045
+ if (Array.isArray(compObj.components)) {
13046
+ compObj.components = compObj.components.map(componentParser);
13047
+ }
13048
+ return compObj;
13049
+ };
13050
+ const inverseComponentParser = compObj => {
13051
+ if (!compObj.type) {
13052
+ const {
13053
+ metadata,
13054
+ _id,
13055
+ ...existingComponent
13056
+ } = compObj;
13057
+ const newComponent = {
13058
+ type: 'componentCollection',
13059
+ name: '',
13060
+ elementType: '',
13061
+ label: '',
13062
+ metadata: metadata || {},
13063
+ components: [],
13064
+ _id
13065
+ };
13066
+ newComponent.components = Object.values(existingComponent).map(inverseComponentParser);
13067
+ return newComponent;
13068
+ } else {
13069
+ if (compObj.components) {
13070
+ compObj.components = compObj.components.map(inverseComponentParser);
13071
+ }
13072
+ return compObj;
13073
+ }
13074
+ };
13075
+
13075
13076
  const useCoursePromotionPage = createUseStyles(theme => {
13076
13077
  console.log(theme, 'themere');
13077
13078
  return {