@treely/strapi-slices 1.0.2 → 1.1.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.
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { ReactNode } from 'react';
2
2
  import StrapiBlogPost from '../../models/strapi/StrapiBlogPost';
3
3
  import IStrapiData from '../../models/strapi/IStrapiData';
4
4
  import PortfolioProject from '../../models/PortfolioProject';
@@ -10,5 +10,9 @@ export interface SliceRendererProps {
10
10
  projects: PortfolioProject[];
11
11
  customerStories: IStrapiData<StrapiCustomerStory>[];
12
12
  locale?: Locale;
13
+ additionalSlices?: {
14
+ id: string;
15
+ component: ReactNode;
16
+ }[];
13
17
  }
14
- export declare const SliceRenderer: ({ slices, blogPosts, projects, customerStories, locale, }: SliceRendererProps) => JSX.Element;
18
+ export declare const SliceRenderer: ({ slices, blogPosts, projects, customerStories, locale, additionalSlices, }: SliceRendererProps) => JSX.Element;
@@ -2297,6 +2297,13 @@ var rootMessagesEn = /*#__PURE__*/_extends({}, creditsAvailableBadgeMessagesEn,
2297
2297
  var _templateObject$3;
2298
2298
  var GLOBAL_STYLE = /*#__PURE__*/react$1.css(_templateObject$3 || (_templateObject$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n // GintoNord\n @font-face {\n font-family: 'GintoNord';\n src: url('", "/assets/v3/fonts/ABCGintoNord-Bold.woff2')\n format('woff2');\n font-style: normal;\n font-weight: 700;\n font-display: block;\n }\n // Inter\n @font-face {\n font-family: 'Inter';\n src: url('", "/assets/v3/fonts/Inter-Regular.woff2') format('woff2');\n font-style: normal;\n font-weight: 400;\n font-display: block;\n }\n @font-face {\n font-family: 'Inter';\n src: url('", "/assets/v3/fonts/Inter-Medium.woff2') format('woff2');\n font-style: normal;\n font-weight: 500;\n font-display: block;\n }\n @font-face {\n font-family: 'Inter';\n src: url('", "/assets/v3/fonts/Inter-SemiBold.woff2') format('woff2');\n font-style: normal;\n font-weight: 600;\n font-display: block;\n }\n @font-face {\n font-family: 'Inter';\n src: url('", "/assets/v3/fonts/Inter-Bold.woff2') format('woff2');\n font-style: normal;\n font-weight: 700;\n font-display: block;\n }\n // SpaceMono\n @font-face {\n font-family: 'SpaceMono';\n src: url('", "/assets/v3/fonts/SpaceMono-Bold.woff2') format('woff2');\n font-style: normal;\n font-weight: 700;\n font-display: block;\n }\n\n :root {\n --default-hero-height: calc(100vh - var(--boemly-space-24));\n }\n\n a {\n text-decoration: none;\n }\n"])), CDN_URI, CDN_URI, CDN_URI, CDN_URI, CDN_URI, CDN_URI);
2299
2299
 
2300
+ var FONT_CUSTOMIZATIONS = {
2301
+ body: 'Inter',
2302
+ heading: 'Inter',
2303
+ display: 'GintoNord',
2304
+ mono: 'SpaceMono'
2305
+ };
2306
+
2300
2307
  var cache = /*#__PURE__*/reactIntl.createIntlCache();
2301
2308
  var intlFactory = function intlFactory(locale) {
2302
2309
  return reactIntl.createIntl({
@@ -2311,7 +2318,9 @@ var IntlContext = /*#__PURE__*/React.createContext( /*#__PURE__*/intlFactory('en
2311
2318
  var ContextProvider = function ContextProvider(_ref) {
2312
2319
  var children = _ref.children,
2313
2320
  locale = _ref.locale;
2314
- return React__default.default.createElement(boemly.BoemlyThemeProvider, null, React__default.default.createElement(react$1.Global, {
2321
+ return React__default.default.createElement(boemly.BoemlyThemeProvider, {
2322
+ fonts: FONT_CUSTOMIZATIONS
2323
+ }, React__default.default.createElement(react$1.Global, {
2315
2324
  styles: {
2316
2325
  GLOBAL_STYLE: GLOBAL_STYLE
2317
2326
  }
@@ -2464,13 +2473,6 @@ var mergeBoundingBoxes = function mergeBoundingBoxes(boundingBoxes) {
2464
2473
  return [minLeft, minBottom, maxRight, maxTop];
2465
2474
  };
2466
2475
 
2467
- var FONT_CUSTOMIZATIONS = {
2468
- body: 'Inter',
2469
- heading: 'Inter',
2470
- display: 'GintoNord',
2471
- mono: 'SpaceMono'
2472
- };
2473
-
2474
2476
  var messages = {
2475
2477
  en: rootMessagesEn,
2476
2478
  de: rootMessagesDe
@@ -4436,7 +4438,9 @@ var SliceRenderer = function SliceRenderer(_ref) {
4436
4438
  projects = _ref.projects,
4437
4439
  customerStories = _ref.customerStories,
4438
4440
  _ref$locale = _ref.locale,
4439
- locale = _ref$locale === void 0 ? 'en' : _ref$locale;
4441
+ locale = _ref$locale === void 0 ? 'en' : _ref$locale,
4442
+ _ref$additionalSlices = _ref.additionalSlices,
4443
+ additionalSlices = _ref$additionalSlices === void 0 ? [] : _ref$additionalSlices;
4440
4444
  return React__default.default.createElement(ContextProvider, {
4441
4445
  locale: locale
4442
4446
  }, slices.map(function (slice) {
@@ -4632,6 +4636,14 @@ var SliceRenderer = function SliceRenderer(_ref) {
4632
4636
  slice: slice
4633
4637
  });
4634
4638
  default:
4639
+ var additionalSlice = additionalSlices.find(function (additionalSlice) {
4640
+ return additionalSlice.id === slice.__component;
4641
+ });
4642
+ if (additionalSlice) {
4643
+ return React__default.default.createElement("div", {
4644
+ key: slice.__component + "-" + slice.id
4645
+ }, additionalSlice.component);
4646
+ }
4635
4647
  return React__default.default.createElement("div", {
4636
4648
  key: slice.__component + "-" + slice.id
4637
4649
  }, "Slice component not supported");