@treely/strapi-slices 4.4.0 → 4.4.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.
@@ -12,8 +12,8 @@ interface StrapiBlogPost {
12
12
  slug: string;
13
13
  teaser: string | null;
14
14
  img: StrapiImage;
15
- author?: IStrapi<IStrapiData<StrapiAuthor>>;
16
- category?: IStrapi<IStrapiData<StrapiCategory>>;
15
+ author: IStrapi<IStrapiData<StrapiAuthor> | null>;
16
+ category: IStrapi<IStrapiData<StrapiCategory> | null>;
17
17
  locale: Locale;
18
18
  createdAt: string;
19
19
  updatedAt: string;
@@ -1,13 +1,10 @@
1
1
  import StrapiImage from './StrapiImage';
2
+ import StrapiLink from './StrapiLink';
2
3
  interface StrapiHeroCard {
3
4
  id: number;
4
5
  title: string;
5
6
  subTitle: string;
6
- button?: {
7
- id: number;
8
- url: string;
9
- text: string;
10
- };
7
+ button?: StrapiLink;
11
8
  image?: StrapiImage;
12
9
  }
13
10
  export default StrapiHeroCard;
@@ -4,7 +4,7 @@ import StrapiLinkPage from './StrapiLinkPage';
4
4
  interface StrapiLink {
5
5
  id: number;
6
6
  text: string;
7
- page?: IStrapi<IStrapiData<StrapiLinkPage>>;
7
+ page?: IStrapi<IStrapiData<StrapiLinkPage> | null>;
8
8
  url?: string;
9
9
  intercomLauncher?: boolean;
10
10
  }
@@ -19,7 +19,7 @@ interface StrapiProject {
19
19
  thumbnail: StrapiImage | null;
20
20
  slices: any[];
21
21
  localizations: StrapiLocalization[];
22
- portfolio: IStrapi<IStrapiData<StrapiPortfolio>>;
22
+ portfolio: IStrapi<IStrapiData<StrapiPortfolio> | null>;
23
23
  topBanner?: StrapiTopBanner;
24
24
  }
25
25
  export default StrapiProject;
@@ -11,7 +11,7 @@ export interface BlogCardsProps {
11
11
  subTitle: string;
12
12
  button?: StrapiLink;
13
13
  variant: 'white' | 'gray';
14
- blogPostCategory?: IStrapi<IStrapiData<StrapiCategory>>;
14
+ blogPostCategory: IStrapi<IStrapiData<StrapiCategory> | null>;
15
15
  };
16
16
  blogPosts: IStrapiData<StrapiBlogPost>[];
17
17
  }
@@ -2693,7 +2693,7 @@ var Blog = function Blog(_ref) {
2693
2693
  })), React__default.default.createElement(boemly.Box, {
2694
2694
  px: "2",
2695
2695
  py: "8"
2696
- }, blogPost.attributes.category && React__default.default.createElement(boemly.Text, {
2696
+ }, blogPost.attributes.category.data && React__default.default.createElement(boemly.Text, {
2697
2697
  size: "smMonoUppercase",
2698
2698
  color: "primary.800",
2699
2699
  mb: "2"
@@ -2706,7 +2706,7 @@ var Blog = function Blog(_ref) {
2706
2706
  height: "4"
2707
2707
  }), React__default.default.createElement(boemly.DatePersonPair, {
2708
2708
  date: formatDate(blogPost.attributes.createdAt),
2709
- person: blogPost.attributes.author ? {
2709
+ person: blogPost.attributes.author.data ? {
2710
2710
  name: blogPost.attributes.author.data.attributes.name,
2711
2711
  image: React__default.default.createElement(Image__default.default, {
2712
2712
  src: strapiMediaUrl(blogPost.attributes.author.data.attributes.img.img, 'thumbnail'),
@@ -3245,7 +3245,8 @@ var STATES = {
3245
3245
  paddingTitle: '0',
3246
3246
  justifyContent: 'space-between',
3247
3247
  buttonJustifyContent: 'start',
3248
- textMarginLeft: ['0', null, null, null, '14']
3248
+ textMarginLeft: ['0', null, null, null, '14'],
3249
+ textMarginRight: '0'
3249
3250
  },
3250
3251
  centerWithoutImage: {
3251
3252
  textAlign: 'center',
@@ -3253,7 +3254,8 @@ var STATES = {
3253
3254
  paddingTitle: '20',
3254
3255
  justifyContent: 'center',
3255
3256
  buttonJustifyContent: 'center',
3256
- textMarginLeft: '0'
3257
+ textMarginLeft: '0',
3258
+ textMarginRight: '0'
3257
3259
  },
3258
3260
  centerWithImage: {
3259
3261
  textAlign: 'center',
@@ -3261,7 +3263,8 @@ var STATES = {
3261
3263
  paddingTitle: '20',
3262
3264
  justifyContent: 'center',
3263
3265
  buttonJustifyContent: 'center',
3264
- textMarginLeft: '0'
3266
+ textMarginLeft: '0',
3267
+ textMarginRight: '0'
3265
3268
  },
3266
3269
  right: {
3267
3270
  textAlign: 'left',
@@ -3269,7 +3272,8 @@ var STATES = {
3269
3272
  paddingTitle: '0',
3270
3273
  justifyContent: 'start',
3271
3274
  buttonJustifyContent: 'start',
3272
- textMarginLeft: '0'
3275
+ textMarginLeft: '0',
3276
+ textMarginRight: ['0', null, null, null, '10']
3273
3277
  }
3274
3278
  };
3275
3279
  var VARIANTS$3 = {
@@ -3457,6 +3461,7 @@ var Cta = function Cta(_ref) {
3457
3461
  })) : React__default.default.createElement(React__default.default.Fragment, null), React__default.default.createElement(boemly.Box, {
3458
3462
  zIndex: "base",
3459
3463
  marginLeft: STATES[ctaCardType].textMarginLeft,
3464
+ marginRight: STATES[ctaCardType].textMarginRight,
3460
3465
  maxWidth: "3xl"
3461
3466
  }, React__default.default.createElement(boemly.Spacer, {
3462
3467
  height: ['0', null, null, null, '20']
@@ -3911,7 +3916,7 @@ var BlogCards = function BlogCards(_ref) {
3911
3916
  var _slice$blogPostCatego;
3912
3917
  return (_slice$blogPostCatego = slice.blogPostCategory) != null && (_slice$blogPostCatego = _slice$blogPostCatego.data) != null && _slice$blogPostCatego.attributes.name ? sortedBlogPosts.filter(function (blogPost) {
3913
3918
  var _blogPost$attributes$, _slice$blogPostCatego2;
3914
- return ((_blogPost$attributes$ = blogPost.attributes.category) == null ? void 0 : _blogPost$attributes$.data.attributes.name) === ((_slice$blogPostCatego2 = slice.blogPostCategory) == null || (_slice$blogPostCatego2 = _slice$blogPostCatego2.data) == null ? void 0 : _slice$blogPostCatego2.attributes.name);
3919
+ return ((_blogPost$attributes$ = blogPost.attributes.category.data) == null ? void 0 : _blogPost$attributes$.attributes.name) === ((_slice$blogPostCatego2 = slice.blogPostCategory) == null || (_slice$blogPostCatego2 = _slice$blogPostCatego2.data) == null ? void 0 : _slice$blogPostCatego2.attributes.name);
3915
3920
  }).slice(0, 3) : sortedBlogPosts.slice(0, 3);
3916
3921
  }, [sortedBlogPosts, slice]);
3917
3922
  return React__default.default.createElement(boemly.DefaultSectionContainer, {
@@ -3952,6 +3957,7 @@ var BlogCards = function BlogCards(_ref) {
3952
3957
  spacingY: 24,
3953
3958
  flexShrink: "0"
3954
3959
  }, blogPostsToDisplay.map(function (blogPost) {
3960
+ var _blogPost$attributes$2;
3955
3961
  return React__default.default.createElement(BlogItemContainer, {
3956
3962
  as: Link__default.default,
3957
3963
  href: "/blog/" + blogPost.attributes.slug,
@@ -3971,7 +3977,7 @@ var BlogCards = function BlogCards(_ref) {
3971
3977
  size: "smMonoUppercase",
3972
3978
  color: "primary.800",
3973
3979
  mb: "2"
3974
- }, blogPost.attributes.category.data.attributes.name), React__default.default.createElement(boemly.Heading, {
3980
+ }, (_blogPost$attributes$2 = blogPost.attributes.category.data) == null ? void 0 : _blogPost$attributes$2.attributes.name), React__default.default.createElement(boemly.Heading, {
3975
3981
  size: "lg"
3976
3982
  }, blogPost.attributes.title), blogPost.attributes.teaser && React__default.default.createElement(boemly.Text, {
3977
3983
  size: "mdRegularNormal",
@@ -3980,7 +3986,7 @@ var BlogCards = function BlogCards(_ref) {
3980
3986
  height: "4"
3981
3987
  }), React__default.default.createElement(boemly.DatePersonPair, {
3982
3988
  date: formatDate(blogPost.attributes.createdAt),
3983
- person: blogPost.attributes.author ? {
3989
+ person: blogPost.attributes.author.data ? {
3984
3990
  name: blogPost.attributes.author.data.attributes.name,
3985
3991
  image: React__default.default.createElement(Image__default.default, {
3986
3992
  src: strapiMediaUrl(blogPost.attributes.author.data.attributes.img.img, 'thumbnail'),
@@ -4195,11 +4201,9 @@ var SmallCheckout = function SmallCheckout(_ref) {
4195
4201
  textAlign: "center",
4196
4202
  mb: "3"
4197
4203
  }, subtitle), button && React__default.default.createElement(StrapiLinkButton, {
4198
- link: {
4199
- id: 1,
4200
- intercomLauncher: true,
4201
- text: button.text
4202
- },
4204
+ link: _extends({
4205
+ intercomLauncher: true
4206
+ }, button),
4203
4207
  variant: "outline"
4204
4208
  })));
4205
4209
  };