@treely/strapi-slices 7.11.0 → 7.12.0

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.
@@ -5,5 +5,6 @@ interface PageMetadata {
5
5
  shareImage?: Image;
6
6
  metaTitleSuffix?: string;
7
7
  favicon?: string;
8
+ schemaMarkupTypes?: string[];
8
9
  }
9
10
  export default PageMetadata;
@@ -4,6 +4,7 @@ import StrapiMedia from './StrapiMedia';
4
4
  interface StrapiMetadata {
5
5
  title: string;
6
6
  description: string;
7
+ schemaMarkupTypes?: string[];
7
8
  shareImage?: {
8
9
  id: number;
9
10
  alt: string;
@@ -707,8 +707,9 @@ var SLICES_WITH_CUSTOMER_STORIES = ['sections.customer-stories'];
707
707
  var SLICES_WITH_PROJECTS = ['sections.projects-grid', 'sections.projects-map', 'sections.project-facts', 'sections.text-with-card'];
708
708
 
709
709
  var mergeGlobalAndStrapiBlogPostData = function mergeGlobalAndStrapiBlogPostData(context, global, post, blog, projects) {
710
- var _post$attributes$meta, _post$attributes$meta2, _post$attributes$meta3, _global$attributes$me, _post$attributes, _post$attributes$meta4, _post$attributes$meta5, _post$attributes$meta6, _post$attributes$meta7, _ref, _post$attributes$meta8, _post$attributes$meta9, _global$attributes$me2;
710
+ var _post$attributes$meta, _post$attributes$meta2, _post$attributes$meta3, _global$attributes$me, _ref, _post$attributes$meta4, _post$attributes$meta5, _global$attributes$me2, _post$attributes, _post$attributes$meta6, _post$attributes$meta7, _post$attributes$meta8, _post$attributes$meta9, _ref2, _post$attributes$meta10, _post$attributes$meta11, _global$attributes$me3;
711
711
  var metaShareImageUrl = (_post$attributes$meta = post.attributes.metadata) != null && _post$attributes$meta.shareImage ? strapiMediaUrl((_post$attributes$meta2 = (_post$attributes$meta3 = post.attributes.metadata) == null ? void 0 : _post$attributes$meta3.shareImage.media) != null ? _post$attributes$meta2 : (_global$attributes$me = global.attributes.metadata.shareImage) == null ? void 0 : _global$attributes$me.media, 'large') : DEFAULT_SHARE_IMAGE;
712
+ var schemaMarkupTypes = (_ref = (_post$attributes$meta4 = (_post$attributes$meta5 = post.attributes.metadata) == null ? void 0 : _post$attributes$meta5.schemaMarkupTypes) != null ? _post$attributes$meta4 : (_global$attributes$me2 = global.attributes.metadata) == null ? void 0 : _global$attributes$me2.schemaMarkupTypes) != null ? _ref : [];
712
713
  var returnBlog = post.attributes.slices.some(function (slice) {
713
714
  return SLICES_WITH_BLOG_POSTS.includes(slice.__component);
714
715
  });
@@ -731,14 +732,15 @@ var mergeGlobalAndStrapiBlogPostData = function mergeGlobalAndStrapiBlogPostData
731
732
  headerButtons: global.attributes.navbar.buttons || [],
732
733
  footerLinks: global.attributes.footer.links || [],
733
734
  metadata: {
734
- title: (_post$attributes$meta4 = (_post$attributes$meta5 = post.attributes.metadata) == null ? void 0 : _post$attributes$meta5.title) != null ? _post$attributes$meta4 : global.attributes.metadata.title,
735
- description: (_post$attributes$meta6 = (_post$attributes$meta7 = post.attributes.metadata) == null ? void 0 : _post$attributes$meta7.description) != null ? _post$attributes$meta6 : global.attributes.metadata.description,
735
+ title: (_post$attributes$meta6 = (_post$attributes$meta7 = post.attributes.metadata) == null ? void 0 : _post$attributes$meta7.title) != null ? _post$attributes$meta6 : global.attributes.metadata.title,
736
+ description: (_post$attributes$meta8 = (_post$attributes$meta9 = post.attributes.metadata) == null ? void 0 : _post$attributes$meta9.description) != null ? _post$attributes$meta8 : global.attributes.metadata.description,
736
737
  shareImage: {
737
738
  url: metaShareImageUrl,
738
- alt: (_ref = (_post$attributes$meta8 = (_post$attributes$meta9 = post.attributes.metadata) == null || (_post$attributes$meta9 = _post$attributes$meta9.shareImage) == null ? void 0 : _post$attributes$meta9.alt) != null ? _post$attributes$meta8 : (_global$attributes$me2 = global.attributes.metadata.shareImage) == null ? void 0 : _global$attributes$me2.alt) != null ? _ref : DEFAULT_SHARE_ALT
739
+ alt: (_ref2 = (_post$attributes$meta10 = (_post$attributes$meta11 = post.attributes.metadata) == null || (_post$attributes$meta11 = _post$attributes$meta11.shareImage) == null ? void 0 : _post$attributes$meta11.alt) != null ? _post$attributes$meta10 : (_global$attributes$me3 = global.attributes.metadata.shareImage) == null ? void 0 : _global$attributes$me3.alt) != null ? _ref2 : DEFAULT_SHARE_ALT
739
740
  },
740
741
  metaTitleSuffix: global.attributes.metaTitleSuffix,
741
- favicon: strapiMediaUrl(global.attributes.favicon, 'thumbnail')
742
+ favicon: strapiMediaUrl(global.attributes.favicon, 'thumbnail'),
743
+ schemaMarkupTypes: schemaMarkupTypes
742
744
  },
743
745
  slices: post == null ? void 0 : post.attributes.slices,
744
746
  blogPosts: returnBlog ? blog : [],
@@ -751,8 +753,9 @@ var mergeGlobalAndStrapiBlogPostData = function mergeGlobalAndStrapiBlogPostData
751
753
  };
752
754
 
753
755
  var mergeGlobalAndStrapiCustomerStoryData = function mergeGlobalAndStrapiCustomerStoryData(context, global, customerStory, customerStories) {
754
- var _customerStory$attrib, _customerStory$attrib2, _customerStory$attrib3, _global$attributes$me, _customerStory$attrib4, _customerStory$attrib5, _customerStory$attrib6, _customerStory$attrib7, _customerStory$attrib8, _ref, _customerStory$attrib9, _customerStory$attrib10, _global$attributes$me2;
756
+ var _customerStory$attrib, _customerStory$attrib2, _customerStory$attrib3, _global$attributes$me, _ref, _customerStory$attrib4, _customerStory$attrib5, _global$attributes$me2, _customerStory$attrib6, _customerStory$attrib7, _customerStory$attrib8, _customerStory$attrib9, _customerStory$attrib10, _ref2, _customerStory$attrib11, _customerStory$attrib12, _global$attributes$me3;
755
757
  var metaShareImageUrl = (_customerStory$attrib = customerStory.attributes.metadata) != null && _customerStory$attrib.shareImage ? strapiMediaUrl((_customerStory$attrib2 = (_customerStory$attrib3 = customerStory.attributes.metadata) == null ? void 0 : _customerStory$attrib3.shareImage.media) != null ? _customerStory$attrib2 : (_global$attributes$me = global.attributes.metadata.shareImage) == null ? void 0 : _global$attributes$me.media, 'large') : DEFAULT_SHARE_IMAGE;
758
+ var schemaMarkupTypes = (_ref = (_customerStory$attrib4 = (_customerStory$attrib5 = customerStory.attributes.metadata) == null ? void 0 : _customerStory$attrib5.schemaMarkupTypes) != null ? _customerStory$attrib4 : (_global$attributes$me2 = global.attributes.metadata) == null ? void 0 : _global$attributes$me2.schemaMarkupTypes) != null ? _ref : [];
756
759
  var returnCustomerStories = customerStory.attributes.slices.some(function (slice) {
757
760
  return SLICES_WITH_CUSTOMER_STORIES.includes(slice.__component);
758
761
  });
@@ -760,7 +763,7 @@ var mergeGlobalAndStrapiCustomerStoryData = function mergeGlobalAndStrapiCustome
760
763
  // Portfolio Projects
761
764
  projects: [],
762
765
  attributes: _extends({}, customerStory == null ? void 0 : customerStory.attributes, {
763
- metadata: (customerStory == null || (_customerStory$attrib4 = customerStory.attributes) == null ? void 0 : _customerStory$attrib4.metadata) || global.attributes.metadata
766
+ metadata: (customerStory == null || (_customerStory$attrib6 = customerStory.attributes) == null ? void 0 : _customerStory$attrib6.metadata) || global.attributes.metadata
764
767
  }),
765
768
  // PageProps
766
769
  headerType: {
@@ -771,14 +774,15 @@ var mergeGlobalAndStrapiCustomerStoryData = function mergeGlobalAndStrapiCustome
771
774
  headerButtons: global.attributes.navbar.buttons || [],
772
775
  footerLinks: global.attributes.footer.links || [],
773
776
  metadata: {
774
- title: (_customerStory$attrib5 = (_customerStory$attrib6 = customerStory.attributes.metadata) == null ? void 0 : _customerStory$attrib6.title) != null ? _customerStory$attrib5 : global.attributes.metadata.title,
775
- description: (_customerStory$attrib7 = (_customerStory$attrib8 = customerStory.attributes.metadata) == null ? void 0 : _customerStory$attrib8.description) != null ? _customerStory$attrib7 : global.attributes.metadata.description,
777
+ title: (_customerStory$attrib7 = (_customerStory$attrib8 = customerStory.attributes.metadata) == null ? void 0 : _customerStory$attrib8.title) != null ? _customerStory$attrib7 : global.attributes.metadata.title,
778
+ description: (_customerStory$attrib9 = (_customerStory$attrib10 = customerStory.attributes.metadata) == null ? void 0 : _customerStory$attrib10.description) != null ? _customerStory$attrib9 : global.attributes.metadata.description,
776
779
  shareImage: {
777
780
  url: metaShareImageUrl,
778
- alt: (_ref = (_customerStory$attrib9 = (_customerStory$attrib10 = customerStory.attributes.metadata) == null || (_customerStory$attrib10 = _customerStory$attrib10.shareImage) == null ? void 0 : _customerStory$attrib10.alt) != null ? _customerStory$attrib9 : (_global$attributes$me2 = global.attributes.metadata.shareImage) == null ? void 0 : _global$attributes$me2.alt) != null ? _ref : DEFAULT_SHARE_ALT
781
+ alt: (_ref2 = (_customerStory$attrib11 = (_customerStory$attrib12 = customerStory.attributes.metadata) == null || (_customerStory$attrib12 = _customerStory$attrib12.shareImage) == null ? void 0 : _customerStory$attrib12.alt) != null ? _customerStory$attrib11 : (_global$attributes$me3 = global.attributes.metadata.shareImage) == null ? void 0 : _global$attributes$me3.alt) != null ? _ref2 : DEFAULT_SHARE_ALT
779
782
  },
780
783
  metaTitleSuffix: global.attributes.metaTitleSuffix,
781
- favicon: strapiMediaUrl(global.attributes.favicon, 'thumbnail')
784
+ favicon: strapiMediaUrl(global.attributes.favicon, 'thumbnail'),
785
+ schemaMarkupTypes: schemaMarkupTypes
782
786
  },
783
787
  slices: customerStory == null ? void 0 : customerStory.attributes.slices,
784
788
  customerStories: returnCustomerStories ? customerStories : [],
@@ -791,8 +795,9 @@ var mergeGlobalAndStrapiCustomerStoryData = function mergeGlobalAndStrapiCustome
791
795
  };
792
796
 
793
797
  var mergeGlobalAndStrapiPageData = function mergeGlobalAndStrapiPageData(context, global, page, blogPosts, customerStories, projects) {
794
- var _page$attributes$meta, _page$attributes$meta2, _page$attributes$meta3, _global$attributes$me, _page$attributes$meta4, _page$attributes, _page$attributes$slic, _page$attributes$slic2, _page$attributes$meta5, _page$attributes$meta6, _page$attributes$meta7, _page$attributes$meta8, _ref, _page$attributes$meta9, _page$attributes$meta10, _global$attributes$me2;
798
+ var _page$attributes$meta, _page$attributes$meta2, _page$attributes$meta3, _global$attributes$me, _ref, _page$attributes$meta4, _page$attributes$meta5, _global$attributes$me2, _page$attributes$meta6, _page$attributes, _page$attributes$slic, _page$attributes$slic2, _page$attributes$meta7, _page$attributes$meta8, _page$attributes$meta9, _page$attributes$meta10, _ref2, _page$attributes$meta11, _page$attributes$meta12, _global$attributes$me3;
795
799
  var metaShareImageUrl = (_page$attributes$meta = page.attributes.metadata) != null && _page$attributes$meta.shareImage ? strapiMediaUrl((_page$attributes$meta2 = (_page$attributes$meta3 = page.attributes.metadata) == null ? void 0 : _page$attributes$meta3.shareImage.media) != null ? _page$attributes$meta2 : (_global$attributes$me = global.attributes.metadata.shareImage) == null ? void 0 : _global$attributes$me.media, 'large') : DEFAULT_SHARE_IMAGE;
800
+ var schemaMarkupTypes = (_ref = (_page$attributes$meta4 = (_page$attributes$meta5 = page.attributes.metadata) == null ? void 0 : _page$attributes$meta5.schemaMarkupTypes) != null ? _page$attributes$meta4 : (_global$attributes$me2 = global.attributes.metadata) == null ? void 0 : _global$attributes$me2.schemaMarkupTypes) != null ? _ref : [];
796
801
  var returnBlogPosts = page.attributes.slices.some(function (slice) {
797
802
  return SLICES_WITH_BLOG_POSTS.includes(slice.__component);
798
803
  });
@@ -807,7 +812,7 @@ var mergeGlobalAndStrapiPageData = function mergeGlobalAndStrapiPageData(context
807
812
  projects: returnProjects ? projects : [],
808
813
  // StrapiPage
809
814
  attributes: _extends({}, page == null ? void 0 : page.attributes, {
810
- metadata: (_page$attributes$meta4 = page == null || (_page$attributes = page.attributes) == null ? void 0 : _page$attributes.metadata) != null ? _page$attributes$meta4 : global.attributes.metadata
815
+ metadata: (_page$attributes$meta6 = page == null || (_page$attributes = page.attributes) == null ? void 0 : _page$attributes.metadata) != null ? _page$attributes$meta6 : global.attributes.metadata
811
816
  }),
812
817
  // PageProps
813
818
  headerType: {
@@ -818,14 +823,15 @@ var mergeGlobalAndStrapiPageData = function mergeGlobalAndStrapiPageData(context
818
823
  headerButtons: global.attributes.navbar.buttons || [],
819
824
  footerLinks: global.attributes.footer.links || [],
820
825
  metadata: {
821
- title: (_page$attributes$meta5 = (_page$attributes$meta6 = page.attributes.metadata) == null ? void 0 : _page$attributes$meta6.title) != null ? _page$attributes$meta5 : global.attributes.metadata.title,
822
- description: (_page$attributes$meta7 = (_page$attributes$meta8 = page.attributes.metadata) == null ? void 0 : _page$attributes$meta8.description) != null ? _page$attributes$meta7 : global.attributes.metadata.description,
826
+ title: (_page$attributes$meta7 = (_page$attributes$meta8 = page.attributes.metadata) == null ? void 0 : _page$attributes$meta8.title) != null ? _page$attributes$meta7 : global.attributes.metadata.title,
827
+ description: (_page$attributes$meta9 = (_page$attributes$meta10 = page.attributes.metadata) == null ? void 0 : _page$attributes$meta10.description) != null ? _page$attributes$meta9 : global.attributes.metadata.description,
823
828
  shareImage: {
824
829
  url: metaShareImageUrl,
825
- alt: (_ref = (_page$attributes$meta9 = (_page$attributes$meta10 = page.attributes.metadata) == null || (_page$attributes$meta10 = _page$attributes$meta10.shareImage) == null ? void 0 : _page$attributes$meta10.alt) != null ? _page$attributes$meta9 : (_global$attributes$me2 = global.attributes.metadata.shareImage) == null ? void 0 : _global$attributes$me2.alt) != null ? _ref : DEFAULT_SHARE_ALT
830
+ alt: (_ref2 = (_page$attributes$meta11 = (_page$attributes$meta12 = page.attributes.metadata) == null || (_page$attributes$meta12 = _page$attributes$meta12.shareImage) == null ? void 0 : _page$attributes$meta12.alt) != null ? _page$attributes$meta11 : (_global$attributes$me3 = global.attributes.metadata.shareImage) == null ? void 0 : _global$attributes$me3.alt) != null ? _ref2 : DEFAULT_SHARE_ALT
826
831
  },
827
832
  metaTitleSuffix: global.attributes.metaTitleSuffix,
828
- favicon: strapiMediaUrl(global.attributes.favicon, 'thumbnail')
833
+ favicon: strapiMediaUrl(global.attributes.favicon, 'thumbnail'),
834
+ schemaMarkupTypes: schemaMarkupTypes
829
835
  },
830
836
  slices: page == null ? void 0 : page.attributes.slices,
831
837
  blogPosts: returnBlogPosts ? blogPosts : [],
@@ -838,8 +844,9 @@ var mergeGlobalAndStrapiPageData = function mergeGlobalAndStrapiPageData(context
838
844
  };
839
845
 
840
846
  var mergeGlobalAndStrapiProject = function mergeGlobalAndStrapiProject(context, global, project, blogPosts, projects) {
841
- var _project$attributes$m, _project$attributes$m2, _project$attributes$m3, _global$attributes$me, _project$attributes, _project$attributes$s, _project$attributes$s2, _project$attributes$m4, _project$attributes$m5, _project$attributes$m6, _project$attributes$m7, _ref, _project$attributes$m8, _project$attributes$m9, _global$attributes$me2;
847
+ var _project$attributes$m, _project$attributes$m2, _project$attributes$m3, _global$attributes$me, _ref, _project$attributes$m4, _project$attributes$m5, _global$attributes$me2, _project$attributes, _project$attributes$s, _project$attributes$s2, _project$attributes$m6, _project$attributes$m7, _project$attributes$m8, _project$attributes$m9, _ref2, _project$attributes$m10, _project$attributes$m11, _global$attributes$me3;
842
848
  var metaShareImageUrl = (_project$attributes$m = project.attributes.metadata) != null && _project$attributes$m.shareImage ? strapiMediaUrl((_project$attributes$m2 = (_project$attributes$m3 = project.attributes.metadata) == null ? void 0 : _project$attributes$m3.shareImage.media) != null ? _project$attributes$m2 : (_global$attributes$me = global.attributes.metadata.shareImage) == null ? void 0 : _global$attributes$me.media, 'large') : DEFAULT_SHARE_IMAGE;
849
+ var schemaMarkupTypes = (_ref = (_project$attributes$m4 = (_project$attributes$m5 = project.attributes.metadata) == null ? void 0 : _project$attributes$m5.schemaMarkupTypes) != null ? _project$attributes$m4 : (_global$attributes$me2 = global.attributes.metadata) == null ? void 0 : _global$attributes$me2.schemaMarkupTypes) != null ? _ref : [];
843
850
  var returnBlogPosts = project.attributes.slices.some(function (slice) {
844
851
  return SLICES_WITH_BLOG_POSTS.includes(slice.__component);
845
852
  });
@@ -862,14 +869,15 @@ var mergeGlobalAndStrapiProject = function mergeGlobalAndStrapiProject(context,
862
869
  headerButtons: global.attributes.navbar.buttons || [],
863
870
  footerLinks: global.attributes.footer.links || [],
864
871
  metadata: {
865
- title: (_project$attributes$m4 = (_project$attributes$m5 = project.attributes.metadata) == null ? void 0 : _project$attributes$m5.title) != null ? _project$attributes$m4 : global.attributes.metadata.title,
866
- description: (_project$attributes$m6 = (_project$attributes$m7 = project.attributes.metadata) == null ? void 0 : _project$attributes$m7.description) != null ? _project$attributes$m6 : global.attributes.metadata.description,
872
+ title: (_project$attributes$m6 = (_project$attributes$m7 = project.attributes.metadata) == null ? void 0 : _project$attributes$m7.title) != null ? _project$attributes$m6 : global.attributes.metadata.title,
873
+ description: (_project$attributes$m8 = (_project$attributes$m9 = project.attributes.metadata) == null ? void 0 : _project$attributes$m9.description) != null ? _project$attributes$m8 : global.attributes.metadata.description,
867
874
  shareImage: {
868
875
  url: metaShareImageUrl,
869
- alt: (_ref = (_project$attributes$m8 = (_project$attributes$m9 = project.attributes.metadata) == null || (_project$attributes$m9 = _project$attributes$m9.shareImage) == null ? void 0 : _project$attributes$m9.alt) != null ? _project$attributes$m8 : (_global$attributes$me2 = global.attributes.metadata.shareImage) == null ? void 0 : _global$attributes$me2.alt) != null ? _ref : DEFAULT_SHARE_ALT
876
+ alt: (_ref2 = (_project$attributes$m10 = (_project$attributes$m11 = project.attributes.metadata) == null || (_project$attributes$m11 = _project$attributes$m11.shareImage) == null ? void 0 : _project$attributes$m11.alt) != null ? _project$attributes$m10 : (_global$attributes$me3 = global.attributes.metadata.shareImage) == null ? void 0 : _global$attributes$me3.alt) != null ? _ref2 : DEFAULT_SHARE_ALT
870
877
  },
871
878
  metaTitleSuffix: global.attributes.metaTitleSuffix,
872
- favicon: strapiMediaUrl(global.attributes.favicon, 'thumbnail')
879
+ favicon: strapiMediaUrl(global.attributes.favicon, 'thumbnail'),
880
+ schemaMarkupTypes: schemaMarkupTypes
873
881
  },
874
882
  slices: project.attributes.slices,
875
883
  blogPosts: returnBlogPosts ? blogPosts : [],