@treely/strapi-slices 5.4.0 → 5.5.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 (51) hide show
  1. package/dist/slices/BlogCards/BlogCards.stories.d.ts +5 -0
  2. package/dist/slices/Comparison/Comparison.stories.d.ts +6 -0
  3. package/dist/slices/Cta/Cta.stories.d.ts +9 -0
  4. package/dist/slices/CtaOnly/CtaOnly.stories.d.ts +3 -0
  5. package/dist/slices/CustomerStories/CustomerStories.stories.d.ts +6 -0
  6. package/dist/slices/Facts/Facts.stories.d.ts +7 -0
  7. package/dist/slices/FullWidthHighlightQuote/FullWidthHighlightQuote.stories.d.ts +4 -0
  8. package/dist/slices/FullWidthImage/FullWidthImage.stories.d.ts +5 -0
  9. package/dist/slices/FullWidthImageSlider/FullWidthImageSlider.stories.d.ts +3 -0
  10. package/dist/slices/Glossary/Glossary.stories.d.ts +3 -0
  11. package/dist/slices/Hero/Hero.stories.d.ts +9 -0
  12. package/dist/slices/IconGrid/IconGrid.stories.d.ts +5 -0
  13. package/dist/slices/ImageGrid/ImageGrid.stories.d.ts +5 -0
  14. package/dist/slices/ImageTextSequence/ImageTextSequence.stories.d.ts +7 -0
  15. package/dist/slices/LeftTextRightCard/LeftTextRightCard.stories.d.ts +8 -0
  16. package/dist/slices/LinkCardsGrid/LinkCardsGrid.stories.d.ts +5 -0
  17. package/dist/slices/LogoGridWithText/LogoGridWithText.stories.d.ts +6 -0
  18. package/dist/slices/MapHero/MapHero.stories.d.ts +8 -0
  19. package/dist/slices/ProjectFacts/ProjectFacts.stories.d.ts +8 -0
  20. package/dist/slices/ProjectsGrid/ProjectsGrid.stories.d.ts +3 -0
  21. package/dist/slices/ProjectsMap/ProjectsMap.stories.d.ts +6 -0
  22. package/dist/slices/QAndA/QAndA.stories.d.ts +7 -0
  23. package/dist/slices/QuoteCards/QuoteCards.stories.d.ts +8 -0
  24. package/dist/slices/RichTextSection/RichTextSection.stories.d.ts +3 -0
  25. package/dist/slices/ShopCheckout/ShopCheckout.stories.d.ts +7 -0
  26. package/dist/slices/SideBySideImages/SideBySideImages.stories.d.ts +3 -0
  27. package/dist/slices/SmallHero/SmallHero.stories.d.ts +11 -0
  28. package/dist/slices/Steps/Steps.stories.d.ts +7 -0
  29. package/dist/slices/TextCardGrid/TextCardGrid.stories.d.ts +8 -0
  30. package/dist/slices/TextCarousel/TextCarousel.stories.d.ts +6 -0
  31. package/dist/slices/TextWithCard/TextWithCard.stories.d.ts +10 -0
  32. package/dist/slices/TextWithTextCards/TextWithTextCards.stories.d.ts +7 -0
  33. package/dist/slices/Timeline/Timeline.stories.d.ts +9 -0
  34. package/dist/slices/Video/Video.stories.d.ts +3 -0
  35. package/dist/strapi-slices.cjs.development.js +16 -8
  36. package/dist/strapi-slices.cjs.development.js.map +1 -1
  37. package/dist/strapi-slices.cjs.production.min.js +1 -1
  38. package/dist/strapi-slices.cjs.production.min.js.map +1 -1
  39. package/dist/strapi-slices.esm.js +16 -8
  40. package/dist/strapi-slices.esm.js.map +1 -1
  41. package/package.json +6 -1
  42. package/src/components/portfolio/SmallCheckout/SmallCheckout.test.tsx +2 -2
  43. package/src/components/portfolio/SmallCheckout/SmallCheckout.tsx +14 -5
  44. package/src/slices/BlogCards/BlogCards.stories.tsx +16 -11
  45. package/src/slices/ImageTextSequence/ImageTextSequence.stories.tsx +8 -1
  46. package/src/slices/ProjectsMap/ProjectsMap.stories.tsx +5 -5
  47. package/src/slices/ShopCheckout/ShopCheckout.test.tsx +2 -2
  48. package/src/slices/ShopCheckout/ShopCheckout.tsx +10 -6
  49. package/src/slices/Steps/Steps.tsx +1 -0
  50. package/src/slices/TextWithCard/TextWithCard.stories.tsx +3 -2
  51. package/src/slices/Timeline/Timeline.stories.tsx +6 -2
@@ -1809,6 +1809,7 @@ var Steps = function Steps(_ref) {
1809
1809
  text: slice.card.text,
1810
1810
  shapes: slice.card.shapes && ((_slice$card$shapes = slice.card.shapes) == null ? void 0 : _slice$card$shapes.map(function (shape) {
1811
1811
  return React.createElement(Image, {
1812
+ key: shape.id,
1812
1813
  src: strapiMediaUrl(shape.img, 'small'),
1813
1814
  alt: shape.alt,
1814
1815
  fill: true,
@@ -3817,11 +3818,13 @@ var ShopCheckout = function ShopCheckout(_ref) {
3817
3818
  }, [locale]);
3818
3819
  var onSubmit = function onSubmit(_ref2) {
3819
3820
  var contributionValue = _ref2.contributionValue;
3820
- var url = new URL(FPM_API_URI + "/v1/webhooks/shop/checkout");
3821
- url.searchParams.append('batchId', slice.batchId);
3822
- url.searchParams.append('quantity', Math.floor(contributionValue / slice.pricePerKg).toString());
3823
- if (slice.couponId) url.searchParams.append('couponId', slice.couponId);
3824
- push(url.toString());
3821
+ var checkoutURL = new URL(FPM_API_URI + "/v1/webhooks/shop/checkout");
3822
+ var currentURL = new URL(window.location.href);
3823
+ checkoutURL.searchParams.append('batchId', slice.batchId);
3824
+ checkoutURL.searchParams.append('quantity', Math.floor(contributionValue / slice.pricePerKg).toString());
3825
+ checkoutURL.searchParams.append('cancelPath', currentURL.pathname);
3826
+ if (slice.couponId) checkoutURL.searchParams.append('couponId', slice.couponId);
3827
+ push(checkoutURL.toString());
3825
3828
  };
3826
3829
  return React.createElement(DefaultSectionContainer, {
3827
3830
  backgroundColor: primary50,
@@ -4189,13 +4192,18 @@ var SmallCheckout = function SmallCheckout(_ref) {
4189
4192
  }, [locale]);
4190
4193
  var onSubmit = /*#__PURE__*/function () {
4191
4194
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
4192
- var contributionValueCurrency;
4195
+ var contributionValueCurrency, checkoutURL, currentURL;
4193
4196
  return _regeneratorRuntime().wrap(function _callee$(_context) {
4194
4197
  while (1) switch (_context.prev = _context.next) {
4195
4198
  case 0:
4196
4199
  contributionValueCurrency = _ref2.contributionValueCurrency;
4197
- return _context.abrupt("return", push(FPM_API_URI + "/v1/webhooks/shop/checkout?batchId=" + batchId + "&quantity=" + Math.floor(contributionValueCurrency / pricePerKg)));
4198
- case 2:
4200
+ checkoutURL = new URL(FPM_API_URI + "/v1/webhooks/shop/checkout");
4201
+ currentURL = new URL(window.location.href);
4202
+ checkoutURL.searchParams.append('batchId', batchId);
4203
+ checkoutURL.searchParams.append('quantity', Math.floor(contributionValueCurrency / pricePerKg).toString());
4204
+ checkoutURL.searchParams.append('cancelPath', currentURL.pathname);
4205
+ push(checkoutURL.toString());
4206
+ case 7:
4199
4207
  case "end":
4200
4208
  return _context.stop();
4201
4209
  }