@treely/strapi-slices 2.1.0 → 2.2.1

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.
Files changed (56) hide show
  1. package/dist/components/SEOTags/SEOTags.d.ts +14 -0
  2. package/dist/components/SEOTags/index.d.ts +1 -0
  3. package/dist/components/portfolio/SmallCheckout/SmallCheckout.d.ts +1 -1
  4. package/dist/constants/metadata.d.ts +2 -0
  5. package/dist/constants/sectionsConfig.d.ts +5 -0
  6. package/dist/index.d.ts +16 -1
  7. package/dist/models/HeaderType.d.ts +5 -0
  8. package/dist/models/Image.d.ts +5 -0
  9. package/dist/models/PageMetadata.d.ts +9 -0
  10. package/dist/models/PageProps.d.ts +21 -0
  11. package/dist/models/strapi/StrapiBlogPostProps.d.ts +6 -0
  12. package/dist/models/strapi/StrapiCustomerStoryProps.d.ts +6 -0
  13. package/dist/models/strapi/StrapiPageProps.d.ts +6 -0
  14. package/dist/models/strapi/StrapiProjectProps.d.ts +6 -0
  15. package/dist/slices/FullWidthImageSlider/styles.d.ts +1 -0
  16. package/dist/slices/TextCarousel/styles.d.ts +1 -0
  17. package/dist/strapi-slices.cjs.development.js +232 -11
  18. package/dist/strapi-slices.cjs.development.js.map +1 -1
  19. package/dist/strapi-slices.cjs.production.min.js +1 -1
  20. package/dist/strapi-slices.cjs.production.min.js.map +1 -1
  21. package/dist/strapi-slices.esm.js +224 -11
  22. package/dist/strapi-slices.esm.js.map +1 -1
  23. package/dist/test/mocks/getStaticPropsContext.d.ts +3 -0
  24. package/dist/utils/mergeGlobalAndStrapiBlogPostData.d.ts +5 -0
  25. package/dist/utils/mergeGlobalAndStrapiBlogPostData.test.d.ts +1 -0
  26. package/dist/utils/mergeGlobalAndStrapiCustomerStoryData.d.ts +4 -0
  27. package/dist/utils/mergeGlobalAndStrapiCustomerStoryData.test.d.ts +1 -0
  28. package/dist/utils/mergeGlobalAndStrapiPageData.d.ts +5 -0
  29. package/dist/utils/mergeGlobalAndStrapiPageData.test.d.ts +1 -0
  30. package/dist/utils/mergeGlobalAndStrapiProjectData.d.ts +5 -0
  31. package/dist/utils/mergeGlobalAndStrapiProjectData.test.d.ts +1 -0
  32. package/package.json +1 -2
  33. package/src/components/SEOTags/SEOTags.tsx +53 -0
  34. package/src/components/SEOTags/index.ts +1 -0
  35. package/src/components/portfolio/SmallCheckout/SmallCheckout.tsx +14 -15
  36. package/src/constants/metadata.ts +3 -0
  37. package/src/constants/sectionsConfig.ts +20 -0
  38. package/src/index.tsx +45 -0
  39. package/src/models/HeaderType.ts +6 -0
  40. package/src/models/Image.ts +6 -0
  41. package/src/models/PageMetadata.ts +11 -0
  42. package/src/models/PageProps.ts +32 -0
  43. package/src/models/strapi/StrapiBlogPostProps.ts +7 -0
  44. package/src/models/strapi/StrapiCustomerStoryProps.ts +9 -0
  45. package/src/models/strapi/StrapiPageProps.ts +7 -0
  46. package/src/models/strapi/StrapiProjectProps.ts +7 -0
  47. package/src/slices/ProjectFacts/ProjectFacts.stories.tsx +53 -0
  48. package/src/test/mocks/getStaticPropsContext.ts +9 -0
  49. package/src/utils/mergeGlobalAndStrapiBlogPostData.test.ts +154 -0
  50. package/src/utils/mergeGlobalAndStrapiBlogPostData.ts +68 -0
  51. package/src/utils/mergeGlobalAndStrapiCustomerStoryData.test.ts +149 -0
  52. package/src/utils/mergeGlobalAndStrapiCustomerStoryData.ts +68 -0
  53. package/src/utils/mergeGlobalAndStrapiPageData.test.ts +254 -0
  54. package/src/utils/mergeGlobalAndStrapiPageData.ts +81 -0
  55. package/src/utils/mergeGlobalAndStrapiProjectData.test.ts +243 -0
  56. package/src/utils/mergeGlobalAndStrapiProjectData.ts +79 -0
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface SEOTagsProps {
3
+ title: string;
4
+ description: string;
5
+ shareImage?: {
6
+ url: string;
7
+ alt: string;
8
+ };
9
+ metaTitleSuffix?: string;
10
+ favicon?: string;
11
+ domain?: string;
12
+ }
13
+ export declare const SEOTags: React.FC<SEOTagsProps>;
14
+ export {};
@@ -0,0 +1 @@
1
+ export { SEOTags } from './SEOTags';
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import StrapiLink from '../../../models/strapi/StrapiLink';
2
+ import { StrapiLink } from '../../..';
3
3
  export interface SmallCheckoutProps {
4
4
  batchId: string;
5
5
  pricePerKg: number;
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_SHARE_IMAGE = "https://cdn.tree.ly/assets/v3/app/share-image-generic.webp";
2
+ export declare const DEFAULT_SHARE_ALT = "Share Image";
@@ -0,0 +1,5 @@
1
+ export declare const EXTENDABLE_HEADER_SECTIONS: string[];
2
+ export declare const DARK_THEME_HEADER_SECTIONS: string[];
3
+ export declare const SECTIONS_WITH_BLOG_POSTS: string[];
4
+ export declare const SECTIONS_WITH_CUSTOMER_STORIES: string[];
5
+ export declare const SECTIONS_WITH_PROJECTS: string[];
package/dist/index.d.ts CHANGED
@@ -5,10 +5,12 @@ import StrapiAuthor from './models/strapi/StrapiAuthor';
5
5
  import StrapiAvatarWithName from './models/strapi/StrapiAvatarWithName';
6
6
  import StrapiBanner from './models/strapi/StrapiBanner';
7
7
  import StrapiBlogPost from './models/strapi/StrapiBlogPost';
8
+ import StrapiBlogPostProps from './models/strapi/StrapiBlogPostProps';
8
9
  import StrapiButtonWithVariant from './models/strapi/StrapiButtonWithVariant';
9
10
  import StrapiCategory from './models/strapi/StrapiCategory';
10
11
  import StrapiContactArea from './models/strapi/StrapiContactArea';
11
12
  import StrapiCustomerStory from './models/strapi/StrapiCustomerStory';
13
+ import StrapiCustomerStoryProps from './models/strapi/StrapiCustomerStoryProps';
12
14
  import StrapiDefaultHeader from './models/strapi/StrapiDefaultHeader';
13
15
  import StrapiGlobal from './models/strapi/StrapiGlobal';
14
16
  import StrapiGlossaryItem from './models/strapi/StrapiGlossaryItem';
@@ -25,13 +27,26 @@ import StrapiMedia from './models/strapi/StrapiMedia';
25
27
  import StrapiMetadata from './models/strapi/StrapiMetadata';
26
28
  import StrapiNavMenu from './models/strapi/StrapiNavMenu';
27
29
  import StrapiPage from './models/strapi/StrapiPage';
30
+ import StrapiPageProps from './models/strapi/StrapiPageProps';
28
31
  import StrapiPortfolio from './models/strapi/StrapiPortfolio';
29
32
  import StrapiPortfolioCard from './models/strapi/StrapiPortfolioCard';
30
33
  import StrapiProject from './models/strapi/StrapiProject';
34
+ import StrapiProjectProps from './models/strapi/StrapiProjectProps';
31
35
  import StrapiProjectCard from './models/strapi/StrapiProjectCard';
32
36
  import StrapiQuoteCard from './models/strapi/StrapiQuoteCard';
33
37
  import StrapiShapesCard from './models/strapi/StrapiShapesCard';
34
38
  import StrapiTextCardWithIcons from './models/strapi/StrapiTextCardWithIcons';
35
39
  import StrapiTopBanner from './models/strapi/StrapiTopBanner';
40
+ import HeaderType from './models/HeaderType';
41
+ import Image from './models/Image';
42
+ import PageMetadata from './models/PageMetadata';
43
+ import PageProps from './models/PageProps';
44
+ import mergeGlobalAndStrapiBlogPostData from './utils/mergeGlobalAndStrapiBlogPostData';
45
+ import mergeGlobalAndStrapiCustomerStoryData from './utils/mergeGlobalAndStrapiCustomerStoryData';
46
+ import mergeGlobalAndStrapiPageData from './utils/mergeGlobalAndStrapiPageData';
47
+ import mergeGlobalAndStrapiProjectData from './utils/mergeGlobalAndStrapiProjectData';
48
+ import { SECTIONS_WITH_BLOG_POSTS, SECTIONS_WITH_CUSTOMER_STORIES, SECTIONS_WITH_PROJECTS } from './constants/sectionsConfig';
49
+ export * from './components/SEOTags';
36
50
  export * from './components/SliceRenderer';
37
- export type { IStrapi, IStrapiData, IStrapiResponse, StrapiAuthor, StrapiAvatarWithName, StrapiBanner, StrapiBlogPost, StrapiButtonWithVariant, StrapiCategory, StrapiContactArea, StrapiCustomerStory, StrapiDefaultHeader, StrapiGlobal, StrapiGlossaryItem, StrapiHeroCard, StrapiImage, StrapiImageFormat, StrapiImageWithLink, StrapiLink, StrapiLinkList, StrapiLinkPage, StrapiLinkWithIcon, StrapiLocalization, StrapiMedia, StrapiMetadata, StrapiNavMenu, StrapiPage, StrapiPortfolio, StrapiPortfolioCard, StrapiProject, StrapiProjectCard, StrapiQuoteCard, StrapiShapesCard, StrapiTextCardWithIcons, StrapiTopBanner, };
51
+ export { mergeGlobalAndStrapiBlogPostData, mergeGlobalAndStrapiCustomerStoryData, mergeGlobalAndStrapiPageData, mergeGlobalAndStrapiProjectData, SECTIONS_WITH_BLOG_POSTS, SECTIONS_WITH_CUSTOMER_STORIES, SECTIONS_WITH_PROJECTS, };
52
+ export type { IStrapi, IStrapiData, IStrapiResponse, StrapiAuthor, StrapiAvatarWithName, StrapiBanner, StrapiBlogPost, StrapiBlogPostProps, StrapiButtonWithVariant, StrapiCategory, StrapiContactArea, StrapiCustomerStory, StrapiCustomerStoryProps, StrapiDefaultHeader, StrapiGlobal, StrapiGlossaryItem, StrapiHeroCard, StrapiImage, StrapiImageFormat, StrapiImageWithLink, StrapiLink, StrapiLinkList, StrapiLinkPage, StrapiLinkWithIcon, StrapiLocalization, StrapiMedia, StrapiMetadata, StrapiNavMenu, StrapiPage, StrapiPageProps, StrapiPortfolio, StrapiPortfolioCard, StrapiProject, StrapiProjectProps, StrapiProjectCard, StrapiQuoteCard, StrapiShapesCard, StrapiTextCardWithIcons, StrapiTopBanner, HeaderType, Image, PageMetadata, PageProps, };
@@ -0,0 +1,5 @@
1
+ interface HeaderType {
2
+ extendable: boolean;
3
+ theme: 'dark' | 'light';
4
+ }
5
+ export default HeaderType;
@@ -0,0 +1,5 @@
1
+ interface Image {
2
+ url: string;
3
+ alt: string;
4
+ }
5
+ export default Image;
@@ -0,0 +1,9 @@
1
+ import Image from './Image';
2
+ interface PageMetadata {
3
+ title: string;
4
+ description: string;
5
+ shareImage?: Image;
6
+ metaTitleSuffix?: string;
7
+ favicon?: string;
8
+ }
9
+ export default PageMetadata;
@@ -0,0 +1,21 @@
1
+ import { IStrapiData, StrapiBanner, StrapiBlogPost, StrapiCustomerStory, StrapiLink, StrapiLinkList, StrapiNavMenu, StrapiTopBanner } from '..';
2
+ import { ReactNode } from 'react';
3
+ import PortfolioProject from './PortfolioProject';
4
+ import PageMetadata from './PageMetadata';
5
+ import HeaderType from './HeaderType';
6
+ interface PageProps {
7
+ headerType?: HeaderType;
8
+ headerNavMenus?: StrapiNavMenu[];
9
+ headerButtons?: StrapiLink[];
10
+ footerLinks?: StrapiLinkList[];
11
+ hideFooter?: boolean;
12
+ children?: ReactNode;
13
+ metadata: PageMetadata;
14
+ slices: any[];
15
+ blogPosts: IStrapiData<StrapiBlogPost>[];
16
+ projects: PortfolioProject[];
17
+ banner?: StrapiBanner;
18
+ topBanner?: StrapiTopBanner;
19
+ customerStories: IStrapiData<StrapiCustomerStory>[];
20
+ }
21
+ export default PageProps;
@@ -0,0 +1,6 @@
1
+ import PageProps from '../PageProps';
2
+ import IStrapiData from './IStrapiData';
3
+ import StrapiBlogPost from './StrapiBlogPost';
4
+ interface StrapiBlogPostProps extends PageProps, IStrapiData<StrapiBlogPost> {
5
+ }
6
+ export default StrapiBlogPostProps;
@@ -0,0 +1,6 @@
1
+ import PageProps from '../PageProps';
2
+ import IStrapiData from './IStrapiData';
3
+ import StrapiCustomerStory from './StrapiCustomerStory';
4
+ interface StrapiCustomerStoryProps extends PageProps, IStrapiData<StrapiCustomerStory> {
5
+ }
6
+ export default StrapiCustomerStoryProps;
@@ -0,0 +1,6 @@
1
+ import PageProps from '../PageProps';
2
+ import IStrapiData from './IStrapiData';
3
+ import StrapiPage from './StrapiPage';
4
+ interface StrapiPageProps extends PageProps, IStrapiData<StrapiPage> {
5
+ }
6
+ export default StrapiPageProps;
@@ -0,0 +1,6 @@
1
+ import PageProps from '../PageProps';
2
+ import IStrapiData from './IStrapiData';
3
+ import StrapiProject from './StrapiProject';
4
+ interface StrapiProjectProps extends PageProps, IStrapiData<StrapiProject> {
5
+ }
6
+ export default StrapiProjectProps;
@@ -61,6 +61,7 @@ export declare const SliderInnerContainer: import("@emotion/styled").StyledCompo
61
61
  unselectable?: "on" | "off" | undefined;
62
62
  inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
63
63
  is?: string | undefined;
64
+ tw?: string | undefined;
64
65
  "aria-activedescendant"?: string | undefined;
65
66
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
66
67
  "aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
@@ -55,6 +55,7 @@ export declare const CarouselInnerContainer: import("@emotion/styled").StyledCom
55
55
  unselectable?: "on" | "off" | undefined;
56
56
  inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
57
57
  is?: string | undefined;
58
+ tw?: string | undefined;
58
59
  "aria-activedescendant"?: string | undefined;
59
60
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
60
61
  "aria-autocomplete"?: "list" | "none" | "inline" | "both" | undefined;
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
+ var Head = require('next/head');
6
7
  var boemly = require('boemly');
7
8
  var Image = require('next/image');
8
9
  var reactUse = require('react-use');
9
10
  var react = require('@phosphor-icons/react');
10
- var Head = require('next/head');
11
11
  var Link = require('next/link');
12
12
  var adblockDetectReact = require('adblock-detect-react');
13
13
  var router = require('next/router');
@@ -22,8 +22,8 @@ var formik = require('formik');
22
22
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
23
23
 
24
24
  var React__default = /*#__PURE__*/_interopDefault(React);
25
- var Image__default = /*#__PURE__*/_interopDefault(Image);
26
25
  var Head__default = /*#__PURE__*/_interopDefault(Head);
26
+ var Image__default = /*#__PURE__*/_interopDefault(Image);
27
27
  var Link__default = /*#__PURE__*/_interopDefault(Link);
28
28
  var styled__default = /*#__PURE__*/_interopDefault(styled);
29
29
  var mapboxgl__default = /*#__PURE__*/_interopDefault(mapboxgl);
@@ -411,6 +411,219 @@ var strapiMediaUrl = function strapiMediaUrl(media, preferredSize) {
411
411
  return "" + ((STRAPI_URI.includes('127.0.0.1') || STRAPI_URI.includes('localhost')) && !process.env.STORYBOOK ? STRAPI_URI : '') + url;
412
412
  };
413
413
 
414
+ var DEFAULT_SHARE_IMAGE = 'https://cdn.tree.ly/assets/v3/app/share-image-generic.webp';
415
+ var DEFAULT_SHARE_ALT = 'Share Image';
416
+
417
+ var mergeGlobalAndStrapiBlogPostData = function mergeGlobalAndStrapiBlogPostData(context, global, post, blog, projects) {
418
+ 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;
419
+ 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;
420
+ return _extends({}, post, {
421
+ // Portfolio Projects
422
+ projects: projects,
423
+ // StrapiBlogPost
424
+ attributes: _extends({}, post == null ? void 0 : post.attributes, {
425
+ metadata: (post == null || (_post$attributes = post.attributes) == null ? void 0 : _post$attributes.metadata) || global.attributes.metadata
426
+ }),
427
+ // PageProps
428
+ headerType: {
429
+ extendable: true,
430
+ theme: 'light'
431
+ },
432
+ headerNavMenus: global.attributes.navbar.navMenus || [],
433
+ headerButtons: global.attributes.navbar.buttons || [],
434
+ footerLinks: global.attributes.footer.links || [],
435
+ metadata: {
436
+ 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,
437
+ 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,
438
+ shareImage: {
439
+ url: metaShareImageUrl,
440
+ 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
441
+ },
442
+ metaTitleSuffix: global.attributes.metaTitleSuffix,
443
+ favicon: strapiMediaUrl(global.attributes.favicon, 'thumbnail')
444
+ },
445
+ slices: post == null ? void 0 : post.attributes.slices,
446
+ blogPosts: blog,
447
+ banner: global.attributes.banner,
448
+ topBanner: (post == null ? void 0 : post.attributes.topBanner) || global.attributes.topBanner,
449
+ customerStories: []
450
+ });
451
+ };
452
+
453
+ var mergeGlobalAndStrapiCustomerStoryData = function mergeGlobalAndStrapiCustomerStoryData(context, global, customerStory, customerStories) {
454
+ 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;
455
+ 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;
456
+ return _extends({}, customerStory, {
457
+ // Portfolio Projects
458
+ projects: [],
459
+ attributes: _extends({}, customerStory == null ? void 0 : customerStory.attributes, {
460
+ metadata: (customerStory == null || (_customerStory$attrib4 = customerStory.attributes) == null ? void 0 : _customerStory$attrib4.metadata) || global.attributes.metadata
461
+ }),
462
+ // PageProps
463
+ headerType: {
464
+ extendable: true,
465
+ theme: 'light'
466
+ },
467
+ headerNavMenus: global.attributes.navbar.navMenus || [],
468
+ headerButtons: global.attributes.navbar.buttons || [],
469
+ footerLinks: global.attributes.footer.links || [],
470
+ metadata: {
471
+ title: (_customerStory$attrib5 = (_customerStory$attrib6 = customerStory.attributes.metadata) == null ? void 0 : _customerStory$attrib6.title) != null ? _customerStory$attrib5 : global.attributes.metadata.title,
472
+ description: (_customerStory$attrib7 = (_customerStory$attrib8 = customerStory.attributes.metadata) == null ? void 0 : _customerStory$attrib8.description) != null ? _customerStory$attrib7 : global.attributes.metadata.description,
473
+ shareImage: {
474
+ url: metaShareImageUrl,
475
+ 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
476
+ },
477
+ metaTitleSuffix: global.attributes.metaTitleSuffix,
478
+ favicon: strapiMediaUrl(global.attributes.favicon, 'thumbnail')
479
+ },
480
+ slices: customerStory == null ? void 0 : customerStory.attributes.slices,
481
+ customerStories: customerStories,
482
+ banner: global.attributes.banner,
483
+ topBanner: (customerStory == null ? void 0 : customerStory.attributes.topBanner) || global.attributes.topBanner,
484
+ blogPosts: []
485
+ });
486
+ };
487
+
488
+ var EXTENDABLE_HEADER_SECTIONS = ['sections.hero', 'sections.map-hero', 'sections.full-width-image', 'sections.small-hero', 'sections.small-hero-light'];
489
+ var DARK_THEME_HEADER_SECTIONS = ['sections.hero', 'sections.small-hero'];
490
+ var SECTIONS_WITH_BLOG_POSTS = ['sections.blog', 'sections.blog-cards'];
491
+ var SECTIONS_WITH_CUSTOMER_STORIES = ['sections.customer-stories'];
492
+ var SECTIONS_WITH_PROJECTS = ['sections.projects-map', 'sections.project-facts'];
493
+
494
+ var mergeGlobalAndStrapiPageData = function mergeGlobalAndStrapiPageData(context, global, page, blogPosts, customerStories, projects) {
495
+ 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;
496
+ 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;
497
+ return _extends({}, page, {
498
+ // Portfolio Projects
499
+ projects: projects,
500
+ // StrapiPage
501
+ attributes: _extends({}, page == null ? void 0 : page.attributes, {
502
+ metadata: (_page$attributes$meta4 = page == null || (_page$attributes = page.attributes) == null ? void 0 : _page$attributes.metadata) != null ? _page$attributes$meta4 : global.attributes.metadata
503
+ }),
504
+ // PageProps
505
+ headerType: {
506
+ extendable: EXTENDABLE_HEADER_SECTIONS.includes((_page$attributes$slic = page.attributes.slices[0]) == null ? void 0 : _page$attributes$slic.__component),
507
+ theme: DARK_THEME_HEADER_SECTIONS.includes((_page$attributes$slic2 = page.attributes.slices[0]) == null ? void 0 : _page$attributes$slic2.__component) ? 'dark' : 'light'
508
+ },
509
+ headerNavMenus: global.attributes.navbar.navMenus || [],
510
+ headerButtons: global.attributes.navbar.buttons || [],
511
+ footerLinks: global.attributes.footer.links || [],
512
+ metadata: {
513
+ 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,
514
+ 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,
515
+ shareImage: {
516
+ url: metaShareImageUrl,
517
+ 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
518
+ },
519
+ metaTitleSuffix: global.attributes.metaTitleSuffix,
520
+ favicon: strapiMediaUrl(global.attributes.favicon, 'thumbnail')
521
+ },
522
+ slices: page == null ? void 0 : page.attributes.slices,
523
+ blogPosts: blogPosts,
524
+ banner: global.attributes.banner,
525
+ topBanner: (page == null ? void 0 : page.attributes.topBanner) || global.attributes.topBanner,
526
+ customerStories: customerStories
527
+ });
528
+ };
529
+
530
+ var mergeGlobalAndStrapiProject = function mergeGlobalAndStrapiProject(context, global, project, blogPosts, projects) {
531
+ 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;
532
+ 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;
533
+ return _extends({}, project, {
534
+ // Portfolio Projects
535
+ projects: projects,
536
+ // StrapiProject
537
+ attributes: _extends({}, project.attributes, {
538
+ metadata: (project == null || (_project$attributes = project.attributes) == null ? void 0 : _project$attributes.metadata) || global.attributes.metadata
539
+ }),
540
+ headerType: {
541
+ extendable: EXTENDABLE_HEADER_SECTIONS.includes((_project$attributes$s = project.attributes.slices[0]) == null ? void 0 : _project$attributes$s.__component),
542
+ theme: DARK_THEME_HEADER_SECTIONS.includes((_project$attributes$s2 = project.attributes.slices[0]) == null ? void 0 : _project$attributes$s2.__component) ? 'dark' : 'light'
543
+ },
544
+ // PageProps
545
+ headerNavMenus: global.attributes.navbar.navMenus || [],
546
+ headerButtons: global.attributes.navbar.buttons || [],
547
+ footerLinks: global.attributes.footer.links || [],
548
+ metadata: {
549
+ 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,
550
+ 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,
551
+ shareImage: {
552
+ url: metaShareImageUrl,
553
+ 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
554
+ },
555
+ metaTitleSuffix: global.attributes.metaTitleSuffix,
556
+ favicon: strapiMediaUrl(global.attributes.favicon, 'thumbnail')
557
+ },
558
+ slices: project.attributes.slices,
559
+ blogPosts: blogPosts,
560
+ banner: global.attributes.banner,
561
+ topBanner: (project == null ? void 0 : project.attributes.topBanner) || global.attributes.topBanner,
562
+ customerStories: []
563
+ });
564
+ };
565
+
566
+ var SEOTags = function SEOTags(_ref) {
567
+ var _shareImage$url, _shareImage$alt;
568
+ var title = _ref.title,
569
+ description = _ref.description,
570
+ shareImage = _ref.shareImage,
571
+ _ref$metaTitleSuffix = _ref.metaTitleSuffix,
572
+ metaTitleSuffix = _ref$metaTitleSuffix === void 0 ? 'Tree.ly' : _ref$metaTitleSuffix,
573
+ _ref$favicon = _ref.favicon,
574
+ favicon = _ref$favicon === void 0 ? 'https://cdn.tree.ly/favicon.ico' : _ref$favicon,
575
+ _ref$domain = _ref.domain,
576
+ domain = _ref$domain === void 0 ? 'tree.ly' : _ref$domain;
577
+ var shareImageUrl = (_shareImage$url = shareImage == null ? void 0 : shareImage.url) != null ? _shareImage$url : DEFAULT_SHARE_IMAGE;
578
+ var shareImageAlt = (_shareImage$alt = shareImage == null ? void 0 : shareImage.alt) != null ? _shareImage$alt : DEFAULT_SHARE_ALT;
579
+ return React__default.default.createElement(Head__default.default, null, React__default.default.createElement("title", null, title + " - " + metaTitleSuffix), React__default.default.createElement("meta", {
580
+ name: "description",
581
+ content: description
582
+ }), React__default.default.createElement("link", {
583
+ rel: "icon",
584
+ href: favicon
585
+ }), React__default.default.createElement("meta", {
586
+ property: "og:url",
587
+ content: "https://" + domain
588
+ }), React__default.default.createElement("meta", {
589
+ property: "og:type",
590
+ content: "website"
591
+ }), React__default.default.createElement("meta", {
592
+ property: "og:title",
593
+ content: title
594
+ }), React__default.default.createElement("meta", {
595
+ property: "og:description",
596
+ content: description
597
+ }), React__default.default.createElement("meta", {
598
+ property: "og:image",
599
+ content: shareImageUrl
600
+ }), React__default.default.createElement("meta", {
601
+ property: "og:image:alt",
602
+ content: shareImageAlt
603
+ }), React__default.default.createElement("meta", {
604
+ name: "twitter:card",
605
+ content: "summary_large_image"
606
+ }), React__default.default.createElement("meta", {
607
+ property: "twitter:domain",
608
+ content: domain
609
+ }), React__default.default.createElement("meta", {
610
+ property: "twitter:url",
611
+ content: "https://" + domain
612
+ }), React__default.default.createElement("meta", {
613
+ name: "twitter:title",
614
+ content: title
615
+ }), React__default.default.createElement("meta", {
616
+ name: "twitter:description",
617
+ content: description
618
+ }), React__default.default.createElement("meta", {
619
+ name: "twitter:image",
620
+ content: shareImageUrl
621
+ }), React__default.default.createElement("meta", {
622
+ name: "twitter:image:alt",
623
+ content: shareImageAlt
624
+ }));
625
+ };
626
+
414
627
  var ZoomableImage = function ZoomableImage(_ref) {
415
628
  var image = _ref.image,
416
629
  _ref$zoom = _ref.zoom,
@@ -3727,7 +3940,7 @@ var SmallCheckout = function SmallCheckout(_ref) {
3727
3940
  while (1) switch (_context.prev = _context.next) {
3728
3941
  case 0:
3729
3942
  contributionValueCurrency = _ref2.contributionValueCurrency;
3730
- push(FPM_API_URI + "/v1/webhooks/shop/checkout?batchId=" + batchId + "&quantity=" + Math.floor(contributionValueCurrency / pricePerKg));
3943
+ return _context.abrupt("return", push(FPM_API_URI + "/v1/webhooks/shop/checkout?batchId=" + batchId + "&quantity=" + Math.floor(contributionValueCurrency / pricePerKg)));
3731
3944
  case 2:
3732
3945
  case "end":
3733
3946
  return _context.stop();
@@ -3789,12 +4002,12 @@ var SmallCheckout = function SmallCheckout(_ref) {
3789
4002
  return React__default.default.createElement(boemly.BoemlyFormControl, {
3790
4003
  id: "contributionValueCurrency",
3791
4004
  size: "md",
3792
- inputType: "NumberInput",
3793
- numberInputProps: {
4005
+ inputProps: {
4006
+ type: 'number',
3794
4007
  value: field.value,
3795
- onChange: function onChange(valueString) {
4008
+ onChange: function onChange(e) {
3796
4009
  // valueAsNumber might be NaN
3797
- var value = parseInt(valueString || '0', 10);
4010
+ var value = e.target.valueAsNumber || 0;
3798
4011
  setValues({
3799
4012
  contributionValueCurrency: value,
3800
4013
  contributionValueKgs: value / pricePerKg / 1000
@@ -3821,11 +4034,11 @@ var SmallCheckout = function SmallCheckout(_ref) {
3821
4034
  return React__default.default.createElement(boemly.BoemlyFormControl, {
3822
4035
  id: "contributionValueKgs",
3823
4036
  size: "md",
3824
- inputType: "NumberInput",
3825
- numberInputProps: {
4037
+ inputProps: {
4038
+ type: 'number',
3826
4039
  value: field.value,
3827
- onChange: function onChange(valueString) {
3828
- var value = parseInt(valueString || '0', 10);
4040
+ onChange: function onChange(e) {
4041
+ var value = e.target.valueAsNumber || 0;
3829
4042
  setValues({
3830
4043
  contributionValueCurrency: value * pricePerKg * 1000,
3831
4044
  contributionValueKgs: value
@@ -4649,5 +4862,13 @@ var SliceRenderer = function SliceRenderer(_ref) {
4649
4862
  }));
4650
4863
  };
4651
4864
 
4865
+ exports.SECTIONS_WITH_BLOG_POSTS = SECTIONS_WITH_BLOG_POSTS;
4866
+ exports.SECTIONS_WITH_CUSTOMER_STORIES = SECTIONS_WITH_CUSTOMER_STORIES;
4867
+ exports.SECTIONS_WITH_PROJECTS = SECTIONS_WITH_PROJECTS;
4868
+ exports.SEOTags = SEOTags;
4652
4869
  exports.SliceRenderer = SliceRenderer;
4870
+ exports.mergeGlobalAndStrapiBlogPostData = mergeGlobalAndStrapiBlogPostData;
4871
+ exports.mergeGlobalAndStrapiCustomerStoryData = mergeGlobalAndStrapiCustomerStoryData;
4872
+ exports.mergeGlobalAndStrapiPageData = mergeGlobalAndStrapiPageData;
4873
+ exports.mergeGlobalAndStrapiProjectData = mergeGlobalAndStrapiProject;
4653
4874
  //# sourceMappingURL=strapi-slices.cjs.development.js.map