diy-template-components 4.0.5 → 4.0.7

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