@times-components/ts-slices 1.4.5 → 1.6.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.
- package/CHANGELOG.md +30 -0
- package/README.md +1 -1
- package/babel.config.js +2 -3
- package/dist/components/article/ArticleStandard/ArticleStandard.d.ts +9 -0
- package/dist/components/article/ArticleStandard/ArticleStandard.js +21 -0
- package/dist/components/article/ArticleStandard/__tests__/ArticleStandard.test.d.ts +1 -0
- package/dist/components/article/ArticleStandard/__tests__/ArticleStandard.test.js +32 -0
- package/dist/components/article/ArticleStandard/styles.d.ts +2 -0
- package/dist/components/article/ArticleStandard/styles.js +17 -0
- package/dist/components/slices/RelatedArticle1/RelatedArticle1.js +3 -3
- package/dist/components/slices/RelatedArticle1/__tests__/RelatedArticle1.test.js +4 -4
- package/dist/components/slices/RelatedArticle2/RelatedArticle2.js +3 -3
- package/dist/components/slices/RelatedArticle2/__tests__/RelatedArticle2.test.js +4 -4
- package/dist/components/slices/RelatedArticle3/RelatedArticle3.js +3 -3
- package/dist/components/slices/RelatedArticle3/__tests__/RelatedArticle3.test.js +4 -4
- package/dist/utils/getDate.d.ts +1 -0
- package/dist/utils/getDate.js +29 -0
- package/jest.config.js +4 -2
- package/package.json +6 -8
- package/rnw.js +1 -1
- package/src/components/article/ArticleStandard/ArticleStandard.tsx +46 -0
- package/src/components/article/ArticleStandard/__tests__/ArticleStandard.test.tsx +41 -0
- package/src/components/article/ArticleStandard/__tests__/__snapshots__/ArticleStandard.test.tsx.snap +39 -0
- package/src/components/article/ArticleStandard/styles.ts +18 -0
- package/src/components/slices/RelatedArticle1/RelatedArticle1.tsx +2 -2
- package/src/components/slices/RelatedArticle1/__tests__/RelatedArticle1.test.tsx +3 -3
- package/src/components/slices/RelatedArticle1/__tests__/__snapshots__/RelatedArticle1.test.tsx.snap +1 -1
- package/src/components/slices/RelatedArticle2/RelatedArticle2.tsx +2 -2
- package/src/components/slices/RelatedArticle2/__tests__/RelatedArticle2.test.tsx +3 -3
- package/src/components/slices/RelatedArticle2/__tests__/__snapshots__/RelatedArticle2.test.tsx.snap +2 -2
- package/src/components/slices/RelatedArticle3/RelatedArticle3.tsx +2 -2
- package/src/components/slices/RelatedArticle3/__tests__/RelatedArticle3.test.tsx +3 -3
- package/src/components/slices/RelatedArticle3/__tests__/__snapshots__/RelatedArticle3.test.tsx.snap +3 -3
- package/src/utils/getDate.ts +39 -0
- package/tsconfig.json +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.6.0](https://github.com/newsuk/times-components/compare/@times-components/ts-slices@1.5.1...@times-components/ts-slices@1.6.0) (2022-08-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **TDP-1712:** remove react-native foreverrrrr ([#3064](https://github.com/newsuk/times-components/issues/3064)) ([2a20cb5](https://github.com/newsuk/times-components/commit/2a20cb5abc10a4e7ca2d62487967f8fcf4eccb62)), closes [#3037](https://github.com/newsuk/times-components/issues/3037) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3050](https://github.com/newsuk/times-components/issues/3050) [#3056](https://github.com/newsuk/times-components/issues/3056) [#3057](https://github.com/newsuk/times-components/issues/3057) [#3066](https://github.com/newsuk/times-components/issues/3066) [#3065](https://github.com/newsuk/times-components/issues/3065) [#3037](https://github.com/newsuk/times-components/issues/3037) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3045](https://github.com/newsuk/times-components/issues/3045) [#3056](https://github.com/newsuk/times-components/issues/3056) [#3066](https://github.com/newsuk/times-components/issues/3066) [#3069](https://github.com/newsuk/times-components/issues/3069) [#3068](https://github.com/newsuk/times-components/issues/3068) [#3070](https://github.com/newsuk/times-components/issues/3070) [#3072](https://github.com/newsuk/times-components/issues/3072) [#3073](https://github.com/newsuk/times-components/issues/3073) [#3071](https://github.com/newsuk/times-components/issues/3071) [#3074](https://github.com/newsuk/times-components/issues/3074) [#3076](https://github.com/newsuk/times-components/issues/3076) [#3079](https://github.com/newsuk/times-components/issues/3079) [#3078](https://github.com/newsuk/times-components/issues/3078) [#3083](https://github.com/newsuk/times-components/issues/3083) [#3087](https://github.com/newsuk/times-components/issues/3087) [#3091](https://github.com/newsuk/times-components/issues/3091) [#3096](https://github.com/newsuk/times-components/issues/3096) [#3102](https://github.com/newsuk/times-components/issues/3102) [#3105](https://github.com/newsuk/times-components/issues/3105) [#3108](https://github.com/newsuk/times-components/issues/3108) [#3111](https://github.com/newsuk/times-components/issues/3111) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3113](https://github.com/newsuk/times-components/issues/3113) [#3114](https://github.com/newsuk/times-components/issues/3114) [#3120](https://github.com/newsuk/times-components/issues/3120) [#3119](https://github.com/newsuk/times-components/issues/3119) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3126](https://github.com/newsuk/times-components/issues/3126) [#3112](https://github.com/newsuk/times-components/issues/3112) [#3126](https://github.com/newsuk/times-components/issues/3126) [#3127](https://github.com/newsuk/times-components/issues/3127) [#3116](https://github.com/newsuk/times-components/issues/3116) [#3128](https://github.com/newsuk/times-components/issues/3128) [#3132](https://github.com/newsuk/times-components/issues/3132) [#3133](https://github.com/newsuk/times-components/issues/3133)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.5.1](https://github.com/newsuk/times-components/compare/@times-components/ts-slices@1.5.0...@times-components/ts-slices@1.5.1) (2022-08-05)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @times-components/ts-slices
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [1.5.0](https://github.com/newsuk/times-components/compare/@times-components/ts-slices@1.4.5...@times-components/ts-slices@1.5.0) (2022-07-28)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* **TDP-2202:** update recommended slice layout ([#3062](https://github.com/newsuk/times-components/issues/3062)) ([7431919](https://github.com/newsuk/times-components/commit/7431919a36fc0758ce91c9a530edabdbec3cf040))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
## [1.4.5](https://github.com/newsuk/times-components/compare/@times-components/ts-slices@1.4.4...@times-components/ts-slices@1.4.5) (2022-07-27)
|
|
7
37
|
|
|
8
38
|
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ All the build steps have been updated to handle all the build steps:
|
|
|
9
9
|
|
|
10
10
|
1. `yarn transpile` will build javascript into the `/dist` directory
|
|
11
11
|
1. `yarn lint` will perform `tslint` and `prettier` tasks
|
|
12
|
-
1. `yarn bundle` will generate the `rnw.js` (react-
|
|
12
|
+
1. `yarn bundle` will generate the `rnw.js` (react-web) bundle
|
|
13
13
|
|
|
14
14
|
## Storybook
|
|
15
15
|
|
package/babel.config.js
CHANGED
|
@@ -2,9 +2,8 @@ module.exports = api => {
|
|
|
2
2
|
api.cache(true);
|
|
3
3
|
return {
|
|
4
4
|
plugins: [
|
|
5
|
-
'babel-plugin-styled-components'
|
|
6
|
-
'@babel/plugin-transform-react-display-name'
|
|
5
|
+
'babel-plugin-styled-components'
|
|
7
6
|
],
|
|
8
|
-
presets: ['@babel/preset-react']
|
|
7
|
+
presets: ["@babel/preset-env", '@babel/preset-react']
|
|
9
8
|
};
|
|
10
9
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SliceArticle } from '../../../types/slice';
|
|
3
|
+
import { ClickHandlerType } from '../../../types/event';
|
|
4
|
+
import { DisplaySchema } from '../../../types/styles';
|
|
5
|
+
export declare const ArticleStandard: React.FC<{
|
|
6
|
+
article?: SliceArticle;
|
|
7
|
+
displaySchema?: DisplaySchema;
|
|
8
|
+
clickHandler?: ClickHandlerType;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getDate } from '../../../utils/getDate';
|
|
3
|
+
import { Image } from '../../elements/Image/Image';
|
|
4
|
+
import { Headline } from '../../elements/Headline/Headline';
|
|
5
|
+
import { ArticleContainer, SideBySideColumn, Label } from '../shared-styles';
|
|
6
|
+
import { DateTime, Byline } from './styles';
|
|
7
|
+
export const ArticleStandard = ({ article, displaySchema, clickHandler }) => {
|
|
8
|
+
if (!article) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const date = getDate(article.datePublished);
|
|
12
|
+
return (React.createElement(ArticleContainer, { schema: displaySchema },
|
|
13
|
+
React.createElement(SideBySideColumn, { schema: displaySchema },
|
|
14
|
+
React.createElement(Image, { article: article, displaySchema: displaySchema, clickHandler: clickHandler })),
|
|
15
|
+
React.createElement(SideBySideColumn, { schema: displaySchema },
|
|
16
|
+
article.label && React.createElement(Label, null, article.label),
|
|
17
|
+
React.createElement(Headline, { article: article, displaySchema: displaySchema, clickHandler: clickHandler }),
|
|
18
|
+
date && React.createElement(DateTime, null, date),
|
|
19
|
+
article.byline && React.createElement(Byline, null, article.byline))));
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXJ0aWNsZVN0YW5kYXJkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvYXJ0aWNsZS9BcnRpY2xlU3RhbmRhcmQvQXJ0aWNsZVN0YW5kYXJkLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssTUFBTSxPQUFPLENBQUM7QUFLMUIsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRWpELE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUNuRCxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFFNUQsT0FBTyxFQUFFLGdCQUFnQixFQUFFLGdCQUFnQixFQUFFLEtBQUssRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQzdFLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxFQUFFLE1BQU0sVUFBVSxDQUFDO0FBRTVDLE1BQU0sQ0FBQyxNQUFNLGVBQWUsR0FJdkIsQ0FBQyxFQUFFLE9BQU8sRUFBRSxhQUFhLEVBQUUsWUFBWSxFQUFFLEVBQUUsRUFBRTtJQUNoRCxJQUFJLENBQUMsT0FBTyxFQUFFO1FBQ1osT0FBTyxJQUFJLENBQUM7S0FDYjtJQUVELE1BQU0sSUFBSSxHQUFHLE9BQU8sQ0FBQyxPQUFPLENBQUMsYUFBYSxDQUFDLENBQUM7SUFFNUMsT0FBTyxDQUNMLG9CQUFDLGdCQUFnQixJQUFDLE1BQU0sRUFBRSxhQUFhO1FBQ3JDLG9CQUFDLGdCQUFnQixJQUFDLE1BQU0sRUFBRSxhQUFhO1lBQ3JDLG9CQUFDLEtBQUssSUFDSixPQUFPLEVBQUUsT0FBTyxFQUNoQixhQUFhLEVBQUUsYUFBYSxFQUM1QixZQUFZLEVBQUUsWUFBWSxHQUMxQixDQUNlO1FBQ25CLG9CQUFDLGdCQUFnQixJQUFDLE1BQU0sRUFBRSxhQUFhO1lBQ3BDLE9BQU8sQ0FBQyxLQUFLLElBQUksb0JBQUMsS0FBSyxRQUFFLE9BQU8sQ0FBQyxLQUFLLENBQVM7WUFDaEQsb0JBQUMsUUFBUSxJQUNQLE9BQU8sRUFBRSxPQUFPLEVBQ2hCLGFBQWEsRUFBRSxhQUFhLEVBQzVCLFlBQVksRUFBRSxZQUFZLEdBQzFCO1lBQ0QsSUFBSSxJQUFJLG9CQUFDLFFBQVEsUUFBRSxJQUFJLENBQVk7WUFDbkMsT0FBTyxDQUFDLE1BQU0sSUFBSSxvQkFBQyxNQUFNLFFBQUUsT0FBTyxDQUFDLE1BQU0sQ0FBVSxDQUNuQyxDQUNGLENBQ3BCLENBQUM7QUFDSixDQUFDLENBQUMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { ArticleStandard } from '../ArticleStandard';
|
|
4
|
+
jest.mock('../../../elements/Image/Image', () => ({
|
|
5
|
+
Image: () => React.createElement("div", null, "Image")
|
|
6
|
+
}));
|
|
7
|
+
jest.mock('../../../elements/Headline/Headline', () => ({
|
|
8
|
+
Headline: () => React.createElement("div", null, "Headline")
|
|
9
|
+
}));
|
|
10
|
+
describe('<ArticleStandard />', () => {
|
|
11
|
+
afterAll(() => {
|
|
12
|
+
jest.clearAllMocks();
|
|
13
|
+
});
|
|
14
|
+
it('should render an article correctly', () => {
|
|
15
|
+
const article = {
|
|
16
|
+
images: { crops: [] },
|
|
17
|
+
label: 'Some text label',
|
|
18
|
+
byline: 'Some author',
|
|
19
|
+
headline: '',
|
|
20
|
+
datePublished: '2020-08-20T12:00:00.000Z',
|
|
21
|
+
url: ''
|
|
22
|
+
};
|
|
23
|
+
const { asFragment, getByText } = render(React.createElement(ArticleStandard, { article: article }));
|
|
24
|
+
getByText('Image');
|
|
25
|
+
getByText(article.label);
|
|
26
|
+
getByText('Headline');
|
|
27
|
+
getByText('August 20 2020, 1.00pm');
|
|
28
|
+
getByText('Some author');
|
|
29
|
+
expect(asFragment()).toMatchSnapshot();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQXJ0aWNsZVN0YW5kYXJkLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy9hcnRpY2xlL0FydGljbGVTdGFuZGFyZC9fX3Rlc3RzX18vQXJ0aWNsZVN0YW5kYXJkLnRlc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxNQUFNLE9BQU8sQ0FBQztBQUMxQixPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFFaEQsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRXJELElBQUksQ0FBQyxJQUFJLENBQUMsK0JBQStCLEVBQUUsR0FBRyxFQUFFLENBQUMsQ0FBQztJQUNoRCxLQUFLLEVBQUUsR0FBRyxFQUFFLENBQUMseUNBQWdCO0NBQzlCLENBQUMsQ0FBQyxDQUFDO0FBRUosSUFBSSxDQUFDLElBQUksQ0FBQyxxQ0FBcUMsRUFBRSxHQUFHLEVBQUUsQ0FBQyxDQUFDO0lBQ3RELFFBQVEsRUFBRSxHQUFHLEVBQUUsQ0FBQyw0Q0FBbUI7Q0FDcEMsQ0FBQyxDQUFDLENBQUM7QUFFSixRQUFRLENBQUMscUJBQXFCLEVBQUUsR0FBRyxFQUFFO0lBQ25DLFFBQVEsQ0FBQyxHQUFHLEVBQUU7UUFDWixJQUFJLENBQUMsYUFBYSxFQUFFLENBQUM7SUFDdkIsQ0FBQyxDQUFDLENBQUM7SUFFSCxFQUFFLENBQUMsb0NBQW9DLEVBQUUsR0FBRyxFQUFFO1FBQzVDLE1BQU0sT0FBTyxHQUFHO1lBQ2QsTUFBTSxFQUFFLEVBQUUsS0FBSyxFQUFFLEVBQUUsRUFBRTtZQUNyQixLQUFLLEVBQUUsaUJBQWlCO1lBQ3hCLE1BQU0sRUFBRSxhQUFhO1lBQ3JCLFFBQVEsRUFBRSxFQUFFO1lBQ1osYUFBYSxFQUFFLDBCQUEwQjtZQUN6QyxHQUFHLEVBQUUsRUFBRTtTQUNSLENBQUM7UUFFRixNQUFNLEVBQUUsVUFBVSxFQUFFLFNBQVMsRUFBRSxHQUFHLE1BQU0sQ0FDdEMsb0JBQUMsZUFBZSxJQUFDLE9BQU8sRUFBRSxPQUFPLEdBQUksQ0FDdEMsQ0FBQztRQUVGLFNBQVMsQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUNuQixTQUFTLENBQUMsT0FBTyxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQ3pCLFNBQVMsQ0FBQyxVQUFVLENBQUMsQ0FBQztRQUN0QixTQUFTLENBQUMsd0JBQXdCLENBQUMsQ0FBQztRQUNwQyxTQUFTLENBQUMsYUFBYSxDQUFDLENBQUM7UUFFekIsTUFBTSxDQUFDLFVBQVUsRUFBRSxDQUFDLENBQUMsZUFBZSxFQUFFLENBQUM7SUFDekMsQ0FBQyxDQUFDLENBQUM7QUFDTCxDQUFDLENBQUMsQ0FBQyJ9
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { colours, fonts } from '@times-components/ts-styleguide';
|
|
3
|
+
export const DateTime = styled.p `
|
|
4
|
+
margin: 8px 0 0 0;
|
|
5
|
+
color: ${colours.functional.secondary};
|
|
6
|
+
font-size: 13px;
|
|
7
|
+
line-height: 16px;
|
|
8
|
+
font-family: ${fonts.supporting};
|
|
9
|
+
`;
|
|
10
|
+
export const Byline = styled.p `
|
|
11
|
+
margin: 8px 0 0 0;
|
|
12
|
+
color: ${colours.functional.brandColour};
|
|
13
|
+
font-size: 13px;
|
|
14
|
+
line-height: 16px;
|
|
15
|
+
font-family: ${fonts.supporting};
|
|
16
|
+
`;
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3R5bGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvYXJ0aWNsZS9BcnRpY2xlU3RhbmRhcmQvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sTUFBTSxNQUFNLG1CQUFtQixDQUFDO0FBQ3ZDLE9BQU8sRUFBRSxPQUFPLEVBQUUsS0FBSyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFakUsTUFBTSxDQUFDLE1BQU0sUUFBUSxHQUFHLE1BQU0sQ0FBQyxDQUFDLENBQUE7O1dBRXJCLE9BQU8sQ0FBQyxVQUFVLENBQUMsU0FBUzs7O2lCQUd0QixLQUFLLENBQUMsVUFBVTtDQUNoQyxDQUFDO0FBRUYsTUFBTSxDQUFDLE1BQU0sTUFBTSxHQUFHLE1BQU0sQ0FBQyxDQUFDLENBQUE7O1dBRW5CLE9BQU8sQ0FBQyxVQUFVLENBQUMsV0FBVzs7O2lCQUd4QixLQUFLLENBQUMsVUFBVTtDQUNoQyxDQUFDIn0=
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import get from 'lodash.get';
|
|
3
3
|
import { setDisplaySchema } from '../../../utils/getArticleStyles';
|
|
4
|
-
import {
|
|
4
|
+
import { ArticleStandard } from '../../article/ArticleStandard/ArticleStandard';
|
|
5
5
|
import { SliceContainer, SlotContainer } from './styles';
|
|
6
6
|
const RelatedArticle1 = React.memo(({ slice, styles, clickHandler }) => (React.createElement(SliceContainer, { styles: styles },
|
|
7
7
|
React.createElement(SlotContainer, { styles: styles },
|
|
8
|
-
React.createElement(
|
|
8
|
+
React.createElement(ArticleStandard, { article: get(slice, 'children[0].article'), displaySchema: setDisplaySchema({
|
|
9
9
|
sm: { imageRatio: '16:9', headlineFontSize: 22 },
|
|
10
10
|
md: { isSideBySide: true }
|
|
11
11
|
}), clickHandler: clickHandler })))));
|
|
12
12
|
export default RelatedArticle1;
|
|
13
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVsYXRlZEFydGljbGUxLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvc2xpY2VzL1JlbGF0ZWRBcnRpY2xlMS9SZWxhdGVkQXJ0aWNsZTEudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxNQUFNLE9BQU8sQ0FBQztBQUMxQixPQUFPLEdBQUcsTUFBTSxZQUFZLENBQUM7QUFLN0IsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFbkUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLCtDQUErQyxDQUFDO0FBRWhGLE9BQU8sRUFBRSxjQUFjLEVBQUUsYUFBYSxFQUFFLE1BQU0sVUFBVSxDQUFDO0FBRXpELE1BQU0sZUFBZSxHQUloQixLQUFLLENBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxFQUFFLEVBQUUsQ0FBQyxDQUNuRCxvQkFBQyxjQUFjLElBQUMsTUFBTSxFQUFFLE1BQU07SUFDNUIsb0JBQUMsYUFBYSxJQUFDLE1BQU0sRUFBRSxNQUFNO1FBQzNCLG9CQUFDLGVBQWUsSUFDZCxPQUFPLEVBQUUsR0FBRyxDQUFDLEtBQUssRUFBRSxxQkFBcUIsQ0FBQyxFQUMxQyxhQUFhLEVBQUUsZ0JBQWdCLENBQUM7Z0JBQzlCLEVBQUUsRUFBRSxFQUFFLFVBQVUsRUFBRSxNQUFNLEVBQUUsZ0JBQWdCLEVBQUUsRUFBRSxFQUFFO2dCQUNoRCxFQUFFLEVBQUUsRUFBRSxZQUFZLEVBQUUsSUFBSSxFQUFFO2FBQzNCLENBQUMsRUFDRixZQUFZLEVBQUUsWUFBWSxHQUMxQixDQUNZLENBQ0QsQ0FDbEIsQ0FBQyxDQUFDO0FBRUgsZUFBZSxlQUFlLENBQUMifQ==
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import { getSlice } from '../../../../fixtures/getSlice';
|
|
4
4
|
import RelatedArticle1 from '../RelatedArticle1';
|
|
5
|
-
jest.mock('../../../article/
|
|
6
|
-
|
|
5
|
+
jest.mock('../../../article/ArticleStandard/ArticleStandard', () => ({
|
|
6
|
+
ArticleStandard: () => React.createElement("div", null, "ArticleStandard")
|
|
7
7
|
}));
|
|
8
8
|
describe('<RelatedArticle1 />', () => {
|
|
9
9
|
afterAll(() => {
|
|
@@ -12,9 +12,9 @@ describe('<RelatedArticle1 />', () => {
|
|
|
12
12
|
it('should render an RELATED_ARTICLE_1 slice correctly', () => {
|
|
13
13
|
const slice = getSlice('RELATED_ARTICLE_1');
|
|
14
14
|
const { asFragment, getAllByText } = render(React.createElement(RelatedArticle1, { slice: slice }));
|
|
15
|
-
const article = getAllByText('
|
|
15
|
+
const article = getAllByText('ArticleStandard');
|
|
16
16
|
expect(article.length).toBe(1);
|
|
17
17
|
expect(asFragment()).toMatchSnapshot();
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVsYXRlZEFydGljbGUxLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy9zbGljZXMvUmVsYXRlZEFydGljbGUxL19fdGVzdHNfXy9SZWxhdGVkQXJ0aWNsZTEudGVzdC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE1BQU0sT0FBTyxDQUFDO0FBQzFCLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVoRCxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFekQsT0FBTyxlQUFlLE1BQU0sb0JBQW9CLENBQUM7QUFFakQsSUFBSSxDQUFDLElBQUksQ0FBQyxrREFBa0QsRUFBRSxHQUFHLEVBQUUsQ0FBQyxDQUFDO0lBQ25FLGVBQWUsRUFBRSxHQUFHLEVBQUUsQ0FBQyxtREFBMEI7Q0FDbEQsQ0FBQyxDQUFDLENBQUM7QUFFSixRQUFRLENBQUMscUJBQXFCLEVBQUUsR0FBRyxFQUFFO0lBQ25DLFFBQVEsQ0FBQyxHQUFHLEVBQUU7UUFDWixJQUFJLENBQUMsYUFBYSxFQUFFLENBQUM7SUFDdkIsQ0FBQyxDQUFDLENBQUM7SUFFSCxFQUFFLENBQUMsb0RBQW9ELEVBQUUsR0FBRyxFQUFFO1FBQzVELE1BQU0sS0FBSyxHQUFHLFFBQVEsQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDO1FBRTVDLE1BQU0sRUFBRSxVQUFVLEVBQUUsWUFBWSxFQUFFLEdBQUcsTUFBTSxDQUN6QyxvQkFBQyxlQUFlLElBQUMsS0FBSyxFQUFFLEtBQUssR0FBSSxDQUNsQyxDQUFDO1FBRUYsTUFBTSxPQUFPLEdBQUcsWUFBWSxDQUFDLGlCQUFpQixDQUFDLENBQUM7UUFDaEQsTUFBTSxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFFL0IsTUFBTSxDQUFDLFVBQVUsRUFBRSxDQUFDLENBQUMsZUFBZSxFQUFFLENBQUM7SUFDekMsQ0FBQyxDQUFDLENBQUM7QUFDTCxDQUFDLENBQUMsQ0FBQyJ9
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { setDisplaySchema } from '../../../utils/getArticleStyles';
|
|
3
|
-
import {
|
|
3
|
+
import { ArticleStandard } from '../../article/ArticleStandard/ArticleStandard';
|
|
4
4
|
import { SliceContainer, SlotContainer } from './styles';
|
|
5
5
|
const RelatedArticle2 = React.memo(({ slice, styles, clickHandler }) => (React.createElement(SliceContainer, { styles: styles }, slice.children.map((slot, i) => (React.createElement(SlotContainer, { key: i, styles: styles },
|
|
6
|
-
React.createElement(
|
|
6
|
+
React.createElement(ArticleStandard, { article: slot.article, displaySchema: setDisplaySchema({
|
|
7
7
|
sm: {
|
|
8
8
|
isImageHidden: true,
|
|
9
9
|
imageRatio: '16:9',
|
|
@@ -12,4 +12,4 @@ const RelatedArticle2 = React.memo(({ slice, styles, clickHandler }) => (React.c
|
|
|
12
12
|
md: { isImageHidden: false }
|
|
13
13
|
}), clickHandler: clickHandler })))))));
|
|
14
14
|
export default RelatedArticle2;
|
|
15
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVsYXRlZEFydGljbGUyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvc2xpY2VzL1JlbGF0ZWRBcnRpY2xlMi9SZWxhdGVkQXJ0aWNsZTIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxNQUFNLE9BQU8sQ0FBQztBQUsxQixPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUVuRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sK0NBQStDLENBQUM7QUFFaEYsT0FBTyxFQUFFLGNBQWMsRUFBRSxhQUFhLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFFekQsTUFBTSxlQUFlLEdBSWhCLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsWUFBWSxFQUFFLEVBQUUsRUFBRSxDQUFDLENBQ25ELG9CQUFDLGNBQWMsSUFBQyxNQUFNLEVBQUUsTUFBTSxJQUMzQixLQUFLLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQWUsRUFBRSxDQUFTLEVBQUUsRUFBRSxDQUFDLENBQ2xELG9CQUFDLGFBQWEsSUFBQyxHQUFHLEVBQUUsQ0FBQyxFQUFFLE1BQU0sRUFBRSxNQUFNO0lBQ25DLG9CQUFDLGVBQWUsSUFDZCxPQUFPLEVBQUUsSUFBSSxDQUFDLE9BQU8sRUFDckIsYUFBYSxFQUFFLGdCQUFnQixDQUFDO1lBQzlCLEVBQUUsRUFBRTtnQkFDRixhQUFhLEVBQUUsSUFBSTtnQkFDbkIsVUFBVSxFQUFFLE1BQU07Z0JBQ2xCLGdCQUFnQixFQUFFLEVBQUU7YUFDckI7WUFDRCxFQUFFLEVBQUUsRUFBRSxhQUFhLEVBQUUsS0FBSyxFQUFFO1NBQzdCLENBQUMsRUFDRixZQUFZLEVBQUUsWUFBWSxHQUMxQixDQUNZLENBQ2pCLENBQUMsQ0FDYSxDQUNsQixDQUFDLENBQUM7QUFFSCxlQUFlLGVBQWUsQ0FBQyJ9
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import { getSlice } from '../../../../fixtures/getSlice';
|
|
4
4
|
import RelatedArticle2 from '../RelatedArticle2';
|
|
5
|
-
jest.mock('../../../article/
|
|
6
|
-
|
|
5
|
+
jest.mock('../../../article/ArticleStandard/ArticleStandard', () => ({
|
|
6
|
+
ArticleStandard: () => React.createElement("div", null, "ArticleStandard")
|
|
7
7
|
}));
|
|
8
8
|
describe('<RelatedArticle2 />', () => {
|
|
9
9
|
afterAll(() => {
|
|
@@ -12,9 +12,9 @@ describe('<RelatedArticle2 />', () => {
|
|
|
12
12
|
it('should render an RELATED_ARTICLE_2 slice correctly', () => {
|
|
13
13
|
const slice = getSlice('RELATED_ARTICLE_2');
|
|
14
14
|
const { asFragment, getAllByText } = render(React.createElement(RelatedArticle2, { slice: slice }));
|
|
15
|
-
const article = getAllByText('
|
|
15
|
+
const article = getAllByText('ArticleStandard');
|
|
16
16
|
expect(article.length).toBe(2);
|
|
17
17
|
expect(asFragment()).toMatchSnapshot();
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVsYXRlZEFydGljbGUyLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy9zbGljZXMvUmVsYXRlZEFydGljbGUyL19fdGVzdHNfXy9SZWxhdGVkQXJ0aWNsZTIudGVzdC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE1BQU0sT0FBTyxDQUFDO0FBQzFCLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVoRCxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFekQsT0FBTyxlQUFlLE1BQU0sb0JBQW9CLENBQUM7QUFFakQsSUFBSSxDQUFDLElBQUksQ0FBQyxrREFBa0QsRUFBRSxHQUFHLEVBQUUsQ0FBQyxDQUFDO0lBQ25FLGVBQWUsRUFBRSxHQUFHLEVBQUUsQ0FBQyxtREFBMEI7Q0FDbEQsQ0FBQyxDQUFDLENBQUM7QUFFSixRQUFRLENBQUMscUJBQXFCLEVBQUUsR0FBRyxFQUFFO0lBQ25DLFFBQVEsQ0FBQyxHQUFHLEVBQUU7UUFDWixJQUFJLENBQUMsYUFBYSxFQUFFLENBQUM7SUFDdkIsQ0FBQyxDQUFDLENBQUM7SUFFSCxFQUFFLENBQUMsb0RBQW9ELEVBQUUsR0FBRyxFQUFFO1FBQzVELE1BQU0sS0FBSyxHQUFHLFFBQVEsQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDO1FBRTVDLE1BQU0sRUFBRSxVQUFVLEVBQUUsWUFBWSxFQUFFLEdBQUcsTUFBTSxDQUN6QyxvQkFBQyxlQUFlLElBQUMsS0FBSyxFQUFFLEtBQUssR0FBSSxDQUNsQyxDQUFDO1FBRUYsTUFBTSxPQUFPLEdBQUcsWUFBWSxDQUFDLGlCQUFpQixDQUFDLENBQUM7UUFDaEQsTUFBTSxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFFL0IsTUFBTSxDQUFDLFVBQVUsRUFBRSxDQUFDLENBQUMsZUFBZSxFQUFFLENBQUM7SUFDekMsQ0FBQyxDQUFDLENBQUM7QUFDTCxDQUFDLENBQUMsQ0FBQyJ9
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { setDisplaySchema } from '../../../utils/getArticleStyles';
|
|
3
|
-
import {
|
|
3
|
+
import { ArticleStandard } from '../../article/ArticleStandard/ArticleStandard';
|
|
4
4
|
import { SliceContainer } from '../shared-styles';
|
|
5
5
|
import { SlotContainer } from './styles';
|
|
6
6
|
const RelatedArticle3 = React.memo(({ slice, styles, clickHandler }) => (React.createElement(SliceContainer, { styles: styles }, slice.children.map((slot, i) => (React.createElement(SlotContainer, { key: i, styles: styles },
|
|
7
|
-
React.createElement(
|
|
7
|
+
React.createElement(ArticleStandard, { article: slot.article, displaySchema: setDisplaySchema({
|
|
8
8
|
sm: {
|
|
9
9
|
isImageHidden: true,
|
|
10
10
|
imageRatio: '16:9',
|
|
@@ -13,4 +13,4 @@ const RelatedArticle3 = React.memo(({ slice, styles, clickHandler }) => (React.c
|
|
|
13
13
|
md: { isImageHidden: false }
|
|
14
14
|
}), clickHandler: clickHandler })))))));
|
|
15
15
|
export default RelatedArticle3;
|
|
16
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVsYXRlZEFydGljbGUzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvc2xpY2VzL1JlbGF0ZWRBcnRpY2xlMy9SZWxhdGVkQXJ0aWNsZTMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxNQUFNLE9BQU8sQ0FBQztBQUsxQixPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUVuRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sK0NBQStDLENBQUM7QUFFaEYsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQ2xELE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFFekMsTUFBTSxlQUFlLEdBSWhCLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsWUFBWSxFQUFFLEVBQUUsRUFBRSxDQUFDLENBQ25ELG9CQUFDLGNBQWMsSUFBQyxNQUFNLEVBQUUsTUFBTSxJQUMzQixLQUFLLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQWUsRUFBRSxDQUFTLEVBQUUsRUFBRSxDQUFDLENBQ2xELG9CQUFDLGFBQWEsSUFBQyxHQUFHLEVBQUUsQ0FBQyxFQUFFLE1BQU0sRUFBRSxNQUFNO0lBQ25DLG9CQUFDLGVBQWUsSUFDZCxPQUFPLEVBQUUsSUFBSSxDQUFDLE9BQU8sRUFDckIsYUFBYSxFQUFFLGdCQUFnQixDQUFDO1lBQzlCLEVBQUUsRUFBRTtnQkFDRixhQUFhLEVBQUUsSUFBSTtnQkFDbkIsVUFBVSxFQUFFLE1BQU07Z0JBQ2xCLGdCQUFnQixFQUFFLEVBQUU7YUFDckI7WUFDRCxFQUFFLEVBQUUsRUFBRSxhQUFhLEVBQUUsS0FBSyxFQUFFO1NBQzdCLENBQUMsRUFDRixZQUFZLEVBQUUsWUFBWSxHQUMxQixDQUNZLENBQ2pCLENBQUMsQ0FDYSxDQUNsQixDQUFDLENBQUM7QUFFSCxlQUFlLGVBQWUsQ0FBQyJ9
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import { getSlice } from '../../../../fixtures/getSlice';
|
|
4
4
|
import RelatedArticle3 from '../RelatedArticle3';
|
|
5
|
-
jest.mock('../../../article/
|
|
6
|
-
|
|
5
|
+
jest.mock('../../../article/ArticleStandard/ArticleStandard', () => ({
|
|
6
|
+
ArticleStandard: () => React.createElement("div", null, "ArticleStandard")
|
|
7
7
|
}));
|
|
8
8
|
describe('<RelatedArticle3 />', () => {
|
|
9
9
|
afterAll(() => {
|
|
@@ -12,9 +12,9 @@ describe('<RelatedArticle3 />', () => {
|
|
|
12
12
|
it('should render an RELATED_ARTICLE_3 slice correctly', () => {
|
|
13
13
|
const slice = getSlice('RELATED_ARTICLE_3');
|
|
14
14
|
const { asFragment, getAllByText } = render(React.createElement(RelatedArticle3, { slice: slice }));
|
|
15
|
-
const article = getAllByText('
|
|
15
|
+
const article = getAllByText('ArticleStandard');
|
|
16
16
|
expect(article.length).toBe(3);
|
|
17
17
|
expect(asFragment()).toMatchSnapshot();
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVsYXRlZEFydGljbGUzLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy9zbGljZXMvUmVsYXRlZEFydGljbGUzL19fdGVzdHNfXy9SZWxhdGVkQXJ0aWNsZTMudGVzdC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE1BQU0sT0FBTyxDQUFDO0FBQzFCLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVoRCxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFekQsT0FBTyxlQUFlLE1BQU0sb0JBQW9CLENBQUM7QUFFakQsSUFBSSxDQUFDLElBQUksQ0FBQyxrREFBa0QsRUFBRSxHQUFHLEVBQUUsQ0FBQyxDQUFDO0lBQ25FLGVBQWUsRUFBRSxHQUFHLEVBQUUsQ0FBQyxtREFBMEI7Q0FDbEQsQ0FBQyxDQUFDLENBQUM7QUFFSixRQUFRLENBQUMscUJBQXFCLEVBQUUsR0FBRyxFQUFFO0lBQ25DLFFBQVEsQ0FBQyxHQUFHLEVBQUU7UUFDWixJQUFJLENBQUMsYUFBYSxFQUFFLENBQUM7SUFDdkIsQ0FBQyxDQUFDLENBQUM7SUFFSCxFQUFFLENBQUMsb0RBQW9ELEVBQUUsR0FBRyxFQUFFO1FBQzVELE1BQU0sS0FBSyxHQUFHLFFBQVEsQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDO1FBRTVDLE1BQU0sRUFBRSxVQUFVLEVBQUUsWUFBWSxFQUFFLEdBQUcsTUFBTSxDQUN6QyxvQkFBQyxlQUFlLElBQUMsS0FBSyxFQUFFLEtBQUssR0FBSSxDQUNsQyxDQUFDO1FBRUYsTUFBTSxPQUFPLEdBQUcsWUFBWSxDQUFDLGlCQUFpQixDQUFDLENBQUM7UUFDaEQsTUFBTSxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFFL0IsTUFBTSxDQUFDLFVBQVUsRUFBRSxDQUFDLENBQUMsZUFBZSxFQUFFLENBQUM7SUFDekMsQ0FBQyxDQUFDLENBQUM7QUFDTCxDQUFDLENBQUMsQ0FBQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getDate: (iso?: string | undefined) => string | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { format, addMinutes } from 'date-fns';
|
|
2
|
+
const lastSunday = (month, year) => {
|
|
3
|
+
const lastDayOfMonth = new Date(Date.UTC(year, month + 1, 0));
|
|
4
|
+
const day = lastDayOfMonth.getDay();
|
|
5
|
+
const dateOfSunday = lastDayOfMonth.getDate() - day;
|
|
6
|
+
const sunday = new Date(Date.UTC(year, month, dateOfSunday));
|
|
7
|
+
sunday.setHours(1);
|
|
8
|
+
return sunday;
|
|
9
|
+
};
|
|
10
|
+
const isBST = (date) => {
|
|
11
|
+
const startOfBST = lastSunday(2, date.getFullYear());
|
|
12
|
+
const endOfBST = lastSunday(9, date.getFullYear());
|
|
13
|
+
const isAfterStartOfBST = date.getTime() >= startOfBST.getTime();
|
|
14
|
+
const isBeforeEndOfBST = date.getTime() < endOfBST.getTime();
|
|
15
|
+
return isAfterStartOfBST && isBeforeEndOfBST;
|
|
16
|
+
};
|
|
17
|
+
const getUTCTime = (date) => {
|
|
18
|
+
const localDate = new Date(date);
|
|
19
|
+
return new Date(localDate.getUTCFullYear(), localDate.getUTCMonth(), localDate.getUTCDate(), localDate.getUTCHours(), localDate.getUTCMinutes());
|
|
20
|
+
};
|
|
21
|
+
export const getDate = (iso) => {
|
|
22
|
+
if (iso) {
|
|
23
|
+
const utc = getUTCTime(iso);
|
|
24
|
+
const date = addMinutes(utc, isBST(utc) ? 60 : 0);
|
|
25
|
+
return format(date, 'MMMM dd yyyy, h.mmaaa');
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0RGF0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9nZXREYXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLE1BQU0sVUFBVSxDQUFDO0FBRTlDLE1BQU0sVUFBVSxHQUFHLENBQUMsS0FBYSxFQUFFLElBQVksRUFBRSxFQUFFO0lBQ2pELE1BQU0sY0FBYyxHQUFHLElBQUksSUFBSSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsSUFBSSxFQUFFLEtBQUssR0FBRyxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUM5RCxNQUFNLEdBQUcsR0FBRyxjQUFjLENBQUMsTUFBTSxFQUFFLENBQUM7SUFDcEMsTUFBTSxZQUFZLEdBQUcsY0FBYyxDQUFDLE9BQU8sRUFBRSxHQUFHLEdBQUcsQ0FBQztJQUNwRCxNQUFNLE1BQU0sR0FBRyxJQUFJLElBQUksQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLElBQUksRUFBRSxLQUFLLEVBQUUsWUFBWSxDQUFDLENBQUMsQ0FBQztJQUM3RCxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ25CLE9BQU8sTUFBTSxDQUFDO0FBQ2hCLENBQUMsQ0FBQztBQUVGLE1BQU0sS0FBSyxHQUFHLENBQUMsSUFBVSxFQUFFLEVBQUU7SUFDM0IsTUFBTSxVQUFVLEdBQUcsVUFBVSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUMsV0FBVyxFQUFFLENBQUMsQ0FBQztJQUNyRCxNQUFNLFFBQVEsR0FBRyxVQUFVLENBQUMsQ0FBQyxFQUFFLElBQUksQ0FBQyxXQUFXLEVBQUUsQ0FBQyxDQUFDO0lBQ25ELE1BQU0saUJBQWlCLEdBQUcsSUFBSSxDQUFDLE9BQU8sRUFBRSxJQUFJLFVBQVUsQ0FBQyxPQUFPLEVBQUUsQ0FBQztJQUNqRSxNQUFNLGdCQUFnQixHQUFHLElBQUksQ0FBQyxPQUFPLEVBQUUsR0FBRyxRQUFRLENBQUMsT0FBTyxFQUFFLENBQUM7SUFDN0QsT0FBTyxpQkFBaUIsSUFBSSxnQkFBZ0IsQ0FBQztBQUMvQyxDQUFDLENBQUM7QUFFRixNQUFNLFVBQVUsR0FBRyxDQUFDLElBQVksRUFBRSxFQUFFO0lBQ2xDLE1BQU0sU0FBUyxHQUFHLElBQUksSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0lBQ2pDLE9BQU8sSUFBSSxJQUFJLENBQ2IsU0FBUyxDQUFDLGNBQWMsRUFBRSxFQUMxQixTQUFTLENBQUMsV0FBVyxFQUFFLEVBQ3ZCLFNBQVMsQ0FBQyxVQUFVLEVBQUUsRUFDdEIsU0FBUyxDQUFDLFdBQVcsRUFBRSxFQUN2QixTQUFTLENBQUMsYUFBYSxFQUFFLENBQzFCLENBQUM7QUFDSixDQUFDLENBQUM7QUFFRixNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsQ0FBQyxHQUFZLEVBQUUsRUFBRTtJQUN0QyxJQUFJLEdBQUcsRUFBRTtRQUNQLE1BQU0sR0FBRyxHQUFHLFVBQVUsQ0FBQyxHQUFHLENBQUMsQ0FBQztRQUM1QixNQUFNLElBQUksR0FBRyxVQUFVLENBQUMsR0FBRyxFQUFFLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUNsRCxPQUFPLE1BQU0sQ0FBQyxJQUFJLEVBQUUsdUJBQXVCLENBQUMsQ0FBQztLQUM5QztJQUVELE9BQU8sSUFBSSxDQUFDO0FBQ2QsQ0FBQyxDQUFDIn0=
|
package/jest.config.js
CHANGED
|
@@ -8,7 +8,6 @@ const buildConfig = dir => {
|
|
|
8
8
|
const name = packageName.replace('@times-components/', '');
|
|
9
9
|
return {
|
|
10
10
|
rootDir: path.join(dir, '../..'),
|
|
11
|
-
preset: 'react-native-web',
|
|
12
11
|
moduleFileExtensions: ['js', 'ts', 'tsx', 'node', 'json'],
|
|
13
12
|
transformIgnorePatterns: [],
|
|
14
13
|
testEnvironment: 'jsdom',
|
|
@@ -18,9 +17,12 @@ const buildConfig = dir => {
|
|
|
18
17
|
`**/packages/${name}/**/__tests__/*.test.ts`
|
|
19
18
|
],
|
|
20
19
|
transform: {
|
|
21
|
-
'.+\\.js$': '
|
|
20
|
+
'.+\\.js$': 'babel-jest',
|
|
22
21
|
'.+\\.tsx?$': 'ts-jest'
|
|
23
22
|
},
|
|
23
|
+
transformIgnorePatterns: [
|
|
24
|
+
"node_modules/(?!(@times-components|@storybook/react)/)"
|
|
25
|
+
],
|
|
24
26
|
globals: {
|
|
25
27
|
'ts-jest': {
|
|
26
28
|
tsConfig: './tsconfig.jest.json'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/ts-slices",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Reuseable Typescript React Components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"dev": "dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"lint": "tslint --project . && prettier \"src/**/*.{ts,tsx}\" --list-different",
|
|
29
29
|
"depcheck": "depcheck --ignores='@babel/*,babel-*,depcheck,eslint,tslint*,typescript,jest,prettier,webpack*,@types/*' --ignore-bin-package=false --skip-missing",
|
|
30
30
|
"test": "jest",
|
|
31
|
-
"test:lint": "
|
|
31
|
+
"test:lint": "lint",
|
|
32
32
|
"test:unit": "jest --coverage",
|
|
33
33
|
"watch:tests": "run-s clean build:module && run-p \"build:module -- -w\" \"test:unit -- --watch\"",
|
|
34
34
|
"doc": "run-s doc:html && open-cli build/docs/index.html",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"node": ">=8.9"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@times-components/ts-styleguide": "1.
|
|
53
|
+
"@times-components/ts-styleguide": "1.37.0",
|
|
54
54
|
"date-fns": "2.28.0",
|
|
55
55
|
"lodash.get": "4.4.2",
|
|
56
56
|
"react": "16.9.0",
|
|
@@ -58,13 +58,11 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@testing-library/react": "^12.1.2",
|
|
61
|
-
"@times-components/storybook": "4.
|
|
62
|
-
"@types/jest": "24.9.1",
|
|
61
|
+
"@times-components/storybook": "4.5.0",
|
|
63
62
|
"@types/lodash.get": "4.4.6",
|
|
64
63
|
"@types/lodash.shuffle": "4.2.6",
|
|
65
64
|
"@types/mockdate": "2.0.0",
|
|
66
|
-
"@types/
|
|
67
|
-
"@types/react-dom": "17.0.3",
|
|
65
|
+
"@types/react-dom": "16.9.8",
|
|
68
66
|
"@types/styled-components": "5.1.9",
|
|
69
67
|
"jest": "24.8.0",
|
|
70
68
|
"lodash.shuffle": "4.2.0",
|
|
@@ -88,5 +86,5 @@
|
|
|
88
86
|
"@testing-library/jest-dom/extend-expect"
|
|
89
87
|
]
|
|
90
88
|
},
|
|
91
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "fe2f12b7448a88662c53f840772282cd97756c5c"
|
|
92
90
|
}
|
package/rnw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports=function(e){var t={};function i(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,a){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(a,n,function(t){return e[t]}.bind(null,n));return a},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=5)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("@times-components/ts-styleguide/rnw")},function(e,t){e.exports=require("styled-components")},function(e,t){var i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/,n=/^\./,o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,r="object"==typeof global&&global&&global.Object===Object&&global,s="object"==typeof self&&self&&self.Object===Object&&self,m=r||s||Function("return this")();var c,p=Array.prototype,h=Function.prototype,g=Object.prototype,y=m["__core-js_shared__"],f=(c=/[^.]+$/.exec(y&&y.keys&&y.keys.IE_PROTO||""))?"Symbol(src)_1."+c:"",x=h.toString,u=g.hasOwnProperty,b=g.toString,w=RegExp("^"+x.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_=m.Symbol,k=p.splice,S=j(m,"Map"),E=j(Object,"create"),C=_?_.prototype:void 0,v=C?C.toString:void 0;function z(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var a=e[t];this.set(a[0],a[1])}}function I(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var a=e[t];this.set(a[0],a[1])}}function F(e){var t=-1,i=e?e.length:0;for(this.clear();++t<i;){var a=e[t];this.set(a[0],a[1])}}function N(e,t){for(var i,a,n=e.length;n--;)if((i=e[n][0])===(a=t)||i!=i&&a!=a)return n;return-1}function H(e,t){for(var n,o=0,l=(t=function(e,t){if(B(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||T(e))return!0;return a.test(e)||!i.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:B(n=t)?n:A(n)).length;null!=e&&o<l;)e=e[D(t[o++])];return o&&o==l?e:void 0}function R(e){return!(!$(e)||(t=e,f&&f in t))&&(function(e){var t=$(e)?b.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?w:d).test(function(e){if(null!=e){try{return x.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function O(e,t){var i,a,n=e.__data__;return("string"==(a=typeof(i=t))||"number"==a||"symbol"==a||"boolean"==a?"__proto__"!==i:null===i)?n["string"==typeof t?"string":"hash"]:n.map}function j(e,t){var i=function(e,t){return null==e?void 0:e[t]}(e,t);return R(i)?i:void 0}z.prototype.clear=function(){this.__data__=E?E(null):{}},z.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},z.prototype.get=function(e){var t=this.__data__;if(E){var i=t[e];return"__lodash_hash_undefined__"===i?void 0:i}return u.call(t,e)?t[e]:void 0},z.prototype.has=function(e){var t=this.__data__;return E?void 0!==t[e]:u.call(t,e)},z.prototype.set=function(e,t){return this.__data__[e]=E&&void 0===t?"__lodash_hash_undefined__":t,this},I.prototype.clear=function(){this.__data__=[]},I.prototype.delete=function(e){var t=this.__data__,i=N(t,e);return!(i<0)&&(i==t.length-1?t.pop():k.call(t,i,1),!0)},I.prototype.get=function(e){var t=this.__data__,i=N(t,e);return i<0?void 0:t[i][1]},I.prototype.has=function(e){return N(this.__data__,e)>-1},I.prototype.set=function(e,t){var i=this.__data__,a=N(i,e);return a<0?i.push([e,t]):i[a][1]=t,this},F.prototype.clear=function(){this.__data__={hash:new z,map:new(S||I),string:new z}},F.prototype.delete=function(e){return O(this,e).delete(e)},F.prototype.get=function(e){return O(this,e).get(e)},F.prototype.has=function(e){return O(this,e).has(e)},F.prototype.set=function(e,t){return O(this,e).set(e,t),this};var A=L((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(T(e))return v?v.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var i=[];return n.test(e)&&i.push(""),e.replace(o,(function(e,t,a,n){i.push(a?n.replace(l,"$1"):t||e)})),i}));function D(e){if("string"==typeof e||T(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function L(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var a=arguments,n=t?t.apply(this,a):a[0],o=i.cache;if(o.has(n))return o.get(n);var l=e.apply(this,a);return i.cache=o.set(n,l),l};return i.cache=new(L.Cache||F),i}L.Cache=F;var B=Array.isArray;function $(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function T(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==b.call(e)}e.exports=function(e,t,i){var a=null==e?void 0:H(e,t);return void 0===a?i:a}},function(e,t){e.exports=require("date-fns")},function(e,t,i){"use strict";i.r(t);var a=i(0),n=i.n(a),o=i(3),l=i.n(o);const d=["sm","md","lg","xlg"],r=e=>{if(e){let t={};return d.reduce((i,a)=>{const n={...t,...l()(e,a)};return t=n,{...i,[a]:n}},{})}},s=(e,t)=>!0===l()(l()(t,e),"isSideBySide"),m=(e,t)=>!0===l()(l()(t,e),"isCentered"),c=(e,t)=>`calc(${e}% - ${(e=>12*(2*e-2)/e)(t)}px)`;var p=i(4);const h=e=>l()(e,"images.alt",l()(e,"headline")),g=[760,660,560,480,380,320,270,230,180,120,80],y=(e,t)=>{var i;const a=(i=t,g.reduce((e,t)=>i<=t?t:e,g[0]))*window.devicePixelRatio,n=new URL(e),o=new URLSearchParams(n.search.slice(1));o.set("resize",a.toString());return`${"https://www.uat-thetimes.co.uk"===n.origin?"https://www.thetimes.co.uk":n.origin}${n.pathname}?${o.toString()}`},f=(e,t)=>e.includes("thetimes.co.uk/imageserver")?y(e,t):e;var x=i(2),u=i.n(x);const b=u.a.div.withConfig({displayName:"styles__LazyContainer",componentId:"qsbah5-0"})(["position:absolute;width:100%;height:100%;background-color:",";border-radius:",";transition:0.5s;div,img{width:100%;height:100%;border-radius:",";opacity:",";transition:opacity 0.5s;}"],({visible:e})=>e?"transparent":"#f0f0f0",({isRoundal:e})=>e?"50%":0,({isRoundal:e})=>e?"50%":0,({visible:e})=>e?1:0),w=u.a.div.withConfig({displayName:"styles__BackgroundImage",componentId:"qsbah5-1"})(["background:",";background-size:cover;"],({src:e})=>e?`url(${e}) no-repeat center center`:"none"),_=({url:e,alt:t,isRoundal:i,isBackground:o})=>{const l=n.a.createRef(),[d,r]=Object(a.useState)();return Object(a.useEffect)(()=>{if("IntersectionObserver"in window){const t=new IntersectionObserver(i=>i.forEach(i=>{if(i.isIntersecting&&(t.disconnect(),e&&l.current)){const t=l.current.offsetWidth,i=new Image;i.onload=()=>r(i.src),i.src=f(e,t)}}),{rootMargin:"60px"});return l.current&&t.observe(l.current),()=>t.disconnect()}e&&l.current&&r(f(e,l.current.offsetWidth))},[e,l]),n.a.createElement(b,{visible:!!d,isRoundal:i},o?n.a.createElement(w,{src:d,ref:l,role:"img","aria-label":t}):n.a.createElement("img",{src:d,alt:t,ref:l}))};var k=i(1);const S=(e,t)=>s(e,t)||((e,t)=>!0===l()(l()(t,e),"isImageHidden"))(e,t)?0:"12px",E=(e,t)=>t&&t.includes(e)?"block":"none",C=u.a.div.withConfig({displayName:"styles__ImageContainer",componentId:"sc-8lglkt-0"})(["margin-bottom:",";@media (min-width:","px){margin-bottom:",";}@media (min-width:","px){margin-bottom:",";}@media (min-width:","px){margin-bottom:",";}"],({schema:e})=>S("sm",e),k.breakpoints.medium,({schema:e})=>S("md",e),k.breakpoints.wide,({schema:e})=>S("lg",e),k.breakpoints.huge,({schema:e})=>S("xlg",e)),v=u.a.div.withConfig({displayName:"styles__ImageRatio",componentId:"sc-8lglkt-1"})(["position:relative;display:",";overflow:hidden;&:after{content:'';display:block;padding-bottom:",";}@media (min-width:","px){display:",";}@media (min-width:","px){display:",";}@media (min-width:","px){display:",";}"],({schema:e})=>E("sm",e),({ratio:e})=>(e=>{switch(e){case"16:9":return"56.25%";case"3:2":return"66.66%";case"1:1":return"100%";default:return 0}})(e),k.breakpoints.medium,({schema:e})=>E("md",e),k.breakpoints.wide,({schema:e})=>E("lg",e),k.breakpoints.huge,({schema:e})=>E("xlg",e)),z=({article:e,displaySchema:t,clickHandler:i})=>{const a=(e=>{if(!e)return{};let t;return Object.entries(e).reduce((e,[i,a])=>{const n=l()(a,"imageRatio",t);return t=n,n&&!l()(a,"isImageHidden")?{...e,[n]:[...l()(e,n,[]),i]}:e},{})})(t);return n.a.createElement(C,{schema:t},n.a.createElement("a",{onClick:t=>{e&&i&&i(t,e)},href:e.url},Object.entries(a).map(([t,i],a)=>{const o=((e,t)=>t.images.crops.find(t=>"*"===t.ratio||t.ratio===e))(t,e);return n.a.createElement(v,{key:a,ratio:t,schema:i},n.a.createElement(_,{url:l()(o,"url"),alt:h(e),isRoundal:"1:1"===t,isBackground:"*"===l()(o,"ratio")}))})))},I=(e,t)=>l()(l()(t,e),"headlineFontSize",10),F=(e,t)=>m(e,t)?"sm"===e||"md"===e?"90%":"80%":"100%",N=(e,t)=>m(e,t)?"center":"left",H=u.a.div.withConfig({displayName:"styles__HeadlineContainer",componentId:"k0mgwi-0"})(["width:",";margin:0 auto;@media (min-width:","px){width:",";}@media (min-width:","px){width:",";}@media (min-width:","px){width:",";}a{text-decoration:none;h3{margin:0;color:",";font-size:","px;line-height:","px;font-family:",";font-weight:normal;text-align:",";@media (min-width:","px){font-size:","px;line-height:","px;text-align:",";}@media (min-width:","px){font-size:","px;line-height:","px;text-align:",";}@media (min-width:","px){font-size:","px;line-height:","px;text-align:",";}}&:hover{h3{color:#006699;}}}"],({schema:e})=>F("sm",e),k.breakpoints.medium,({schema:e})=>F("md",e),k.breakpoints.wide,({schema:e})=>F("lg",e),k.breakpoints.huge,({schema:e})=>F("xlg",e),k.colours.functional.brandColour,({schema:e})=>I("sm",e),({schema:e})=>I("sm",e),k.fonts.headline,({schema:e})=>N("sm",e),k.breakpoints.medium,({schema:e})=>I("md",e),({schema:e})=>I("md",e),({schema:e})=>N("md",e),k.breakpoints.wide,({schema:e})=>I("lg",e),({schema:e})=>I("lg",e),({schema:e})=>N("lg",e),k.breakpoints.huge,({schema:e})=>I("xlg",e),({schema:e})=>I("xlg",e),({schema:e})=>N("xlg",e)),R=({article:e,displaySchema:t,clickHandler:i})=>{if(!e.headline)return null;return n.a.createElement(H,{schema:t},n.a.createElement("a",{onClick:t=>{e&&i&&i(t,e)},href:e.url},n.a.createElement("h3",null,e.headline)))},O=(e,t)=>s(e,t)?"row":"column",j=(e,t)=>s(e,t)?l()(l()(t,e),"sideBySideWidth","50%"):"100%",A=(e,t)=>s(e,t)?l()(l()(t,e),"sideBySidePadding",8)+"px":0,D=(e,t)=>m(e,t)?"center":"flex-start",L=(e,t)=>m(e,t)&&!s(e,t)?"16px 0 24px 0":0,B=(e,t)=>l()(l()(t,e),"backgroundColor","transparent"),$=u.a.article.withConfig({displayName:"shared-styles__ArticleContainer",componentId:"sc-1kek94e-0"})(["display:flex;flex-direction:",";background-color:",";@media (min-width:","px){flex-direction:",";background-color:",";}@media (min-width:","px){flex-direction:",";background-color:",";}@media (min-width:","px){flex-direction:",";background-color:",";}"],({schema:e})=>O("sm",e),({schema:e})=>B("sm",e),k.breakpoints.medium,({schema:e})=>O("md",e),({schema:e})=>B("md",e),k.breakpoints.wide,({schema:e})=>O("lg",e),({schema:e})=>B("lg",e),k.breakpoints.huge,({schema:e})=>O("xlg",e),({schema:e})=>B("xlg",e)),T=u.a.div.withConfig({displayName:"shared-styles__SideBySideColumn",componentId:"sc-1kek94e-1"})(["width:100%;&:first-of-type{flex-shrink:0;width:",";padding-right:",";}&:last-of-type{display:flex;flex-direction:column;justify-content:",";align-items:",";margin:",";padding-left:",";}@media (min-width:","px){&:first-of-type{width:",";padding-right:",";}&:last-of-type{justify-content:",";align-items:",";margin:",";padding-left:",";}}@media (min-width:","px){&:first-of-type{width:",";padding-right:",";}&:last-of-type{justify-content:",";align-items:",";margin:",";padding-left:",";}}@media (min-width:","px){&:first-of-type{width:",";padding-right:",";}&:last-of-type{justify-content:",";align-items:",";margin:",";padding-left:",";}}"],({schema:e})=>j("sm",e),({schema:e})=>A("sm",e),({schema:e})=>D("sm",e),({schema:e})=>D("sm",e),({schema:e})=>L("sm",e),({schema:e})=>A("sm",e),k.breakpoints.medium,({schema:e})=>j("md",e),({schema:e})=>A("md",e),({schema:e})=>D("md",e),({schema:e})=>D("md",e),({schema:e})=>L("md",e),({schema:e})=>A("md",e),k.breakpoints.wide,({schema:e})=>j("lg",e),({schema:e})=>A("lg",e),({schema:e})=>D("lg",e),({schema:e})=>D("lg",e),({schema:e})=>L("lg",e),({schema:e})=>A("lg",e),k.breakpoints.huge,({schema:e})=>j("xlg",e),({schema:e})=>A("xlg",e),({schema:e})=>D("xlg",e),({schema:e})=>D("xlg",e),({schema:e})=>L("xlg",e),({schema:e})=>A("xlg",e)),P=u.a.p.withConfig({displayName:"shared-styles__Label",componentId:"sc-1kek94e-2"})(["margin:0 0 4px 0;color:",";font-size:12px;line-height:16px;letter-spacing:1px;font-family:",";text-transform:uppercase;"],k.colours.functional.secondary,k.fonts.supporting),q=(e,t)=>m(e,t)?"sm"===e||"md"===e?"90%":"80%":"100%",M=(e,t)=>m(e,t)?"center":"left",W=u.a.p.withConfig({displayName:"styles__Strapline",componentId:"p3h2iu-0"})(["width:",";margin:4px auto 0 auto;color:",";font-size:14px;line-height:20px;text-align:",";font-family:",";@media (min-width:","px){width:",";text-align:",";}@media (min-width:","px){width:",";text-align:",";}@media (min-width:","px){width:",";text-align:",";}"],({schema:e})=>q("sm",e),k.colours.functional.secondary,({schema:e})=>M("sm",e),k.fonts.body,k.breakpoints.medium,({schema:e})=>q("md",e),({schema:e})=>M("md",e),k.breakpoints.wide,({schema:e})=>q("lg",e),({schema:e})=>M("lg",e),k.breakpoints.huge,({schema:e})=>q("xlg",e),({schema:e})=>M("xlg",e)),Y=u.a.p.withConfig({displayName:"styles__TimeSince",componentId:"p3h2iu-1"})(["margin:8px 0 0 0;color:",";font-size:12px;line-height:16px;letter-spacing:1px;font-family:",";text-transform:uppercase;"],k.colours.functional.secondary,k.fonts.supporting),U=u.a.div.withConfig({displayName:"styles__Link",componentId:"p3h2iu-2"})(["margin-top:8px;a{color:#006699;font-size:13px;line-height:13px;letter-spacing:0px;font-family:",";font-weight:500;text-decoration:none;&:after{display:inline-block;content:'\\E003';font-size:10px;font-family:iconfont;padding:0 0 1px 6px;vertical-align:middle;}}"],k.fonts.supporting),V=({article:e,displaySchema:t,clickHandler:i})=>{if(!e)return null;const a=e.standfirst||e.summary,o=(e=>{const t=Object(p.parseISO)(l()(e,"datePublished","")),i=Object(p.parseISO)(l()(e,"dateUpdated","")),a=Object(p.max)([t,i].filter(e=>Object(p.isValid)(e))),n=Object(p.differenceInCalendarDays)(new Date,a);return!Object(p.isValid)(a)||n>=7?null:Object(p.formatDistanceToNowStrict)(a,{roundingMethod:"floor"})+" ago"})(e);return n.a.createElement($,{schema:t},n.a.createElement(T,{schema:t},n.a.createElement(z,{article:e,displaySchema:t,clickHandler:i})),n.a.createElement(T,{schema:t},e.label&&n.a.createElement(P,null,e.label),n.a.createElement(R,{article:e,displaySchema:t,clickHandler:i}),a&&n.a.createElement(W,{schema:t},a),o&&n.a.createElement(Y,null,o),e.cta&&n.a.createElement(U,null,n.a.createElement("a",{href:e.url},e.cta))))},G=u.a.div.withConfig({displayName:"shared-styles__SliceContainer",componentId:"ismxwo-0"})(["display:flex;flex-wrap:wrap;justify-content:space-between;margin:0 auto;padding:",";@media (min-width:","px){max-width:520px;}@media (min-width:","px){max-width:860px;padding:",";}@media (min-width:","px){max-width:1024px;}@media (min-width:","px){max-width:1180px;}"],({styles:e})=>e&&e.removePadding?0:"0 16px",k.breakpoints.small,k.breakpoints.medium,({styles:e})=>e&&e.removePadding?0:"0 20px",k.breakpoints.wide,k.breakpoints.huge),J=u.a.div.withConfig({displayName:"shared-styles__SlotContainer",componentId:"ismxwo-1"})(["position:relative;width:100%;margin-bottom:",";padding-bottom:",";box-sizing:content-box;:before{content:'';display:none;position:absolute;top:0;right:0;bottom:0;width:1px;background-color:",";}:after{content:'';display:",";position:absolute;right:0;bottom:0;left:0;height:1px;background-color:",";}"],({collapse:e})=>e?0:"12px",({collapse:e})=>e?0:"12px",({styles:e})=>e&&e.lineColor?e.lineColor:"#dbdbdb",({collapse:e})=>e?"none":"block",({styles:e})=>e&&e.lineColor?e.lineColor:"#dbdbdb"),K=u()(G).withConfig({displayName:"styles__SliceContainer",componentId:"sc-614vlg-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],k.breakpoints.medium),Q=u()(J).withConfig({displayName:"styles__SlotContainer",componentId:"sc-614vlg-1"})(["@media (min-width:","px){margin-bottom:24px;padding-right:0;padding-bottom:24px;}"],k.breakpoints.medium);var X=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(K,{styles:t},n.a.createElement(Q,{styles:t},n.a.createElement(V,{article:l()(e,"children[0].article"),displaySchema:r({sm:{imageRatio:"3:2",isCentered:!0,headlineFontSize:28,backgroundColor:"#f0f0f0"},md:{isSideBySide:!0},lg:{headlineFontSize:32},xlg:{headlineFontSize:36}}),clickHandler:i}))));const Z=u()(G).withConfig({displayName:"styles__SliceContainer",componentId:"sc-1r0nv22-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],k.breakpoints.medium),ee=u()(J).withConfig({displayName:"styles__SlotContainerLead",componentId:"sc-1r0nv22-1"})(["@media (min-width:","px){margin-bottom:24px;padding-right:12px;padding-bottom:24px;:before{display:block;bottom:24px;}}"],k.breakpoints.medium),te=u()(J).withConfig({displayName:"styles__SlotContainer",componentId:"sc-1r0nv22-2"})(["@media (min-width:","px){flex-shrink:0;width:",";margin-bottom:24px;padding-bottom:24px;padding-left:12px;}"],k.breakpoints.medium,c(33.33,3));var ie=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(Z,{styles:t},n.a.createElement(ee,{styles:t},n.a.createElement(V,{article:l()(e,"children[0].article"),displaySchema:r({sm:{imageRatio:"3:2",headlineFontSize:28},md:{imageRatio:"16:9"},lg:{headlineFontSize:32},xlg:{headlineFontSize:36}}),clickHandler:i})),n.a.createElement(te,{styles:t},n.a.createElement(V,{article:l()(e,"children[1].article"),displaySchema:r({sm:{imageRatio:"3:2",headlineFontSize:22},lg:{headlineFontSize:24},xlg:{headlineFontSize:28}}),clickHandler:i}))));const ae=e=>e&&("maincomment"===e.template||"magazinecomment"===e.template||"externalcomment"===e.template),ne=u()($).withConfig({displayName:"styles__ArticleContainer",componentId:"sc-2eizyd-0"})(["align-items:center;"]),oe=u.a.div.withConfig({displayName:"styles__ImageContainer",componentId:"sc-2eizyd-1"})(["max-width:120px;margin:0 auto;@media (min-width:","px){max-width:140px;}"],k.breakpoints.huge),le=u.a.p.withConfig({displayName:"styles__Byline",componentId:"sc-2eizyd-2"})(["margin:0 0 4px 0;color:",";font-size:22px;line-height:22px;font-family:",";@media (min-width:","px){font-size:24px;line-height:24px;}"],k.colours.functional.secondary,k.fonts.headlineRegular,k.breakpoints.huge),de=({article:e,displaySchema:t,clickHandler:i})=>e?n.a.createElement(ne,{schema:t},n.a.createElement(T,{schema:t},n.a.createElement(oe,null,n.a.createElement(z,{article:e,displaySchema:t,clickHandler:i}))),n.a.createElement(T,{schema:t},e.label&&n.a.createElement(P,null,e.label),e.byline&&n.a.createElement(le,null,e.byline),n.a.createElement(R,{article:e,displaySchema:t,clickHandler:i}))):null,re=u()(G).withConfig({displayName:"styles__SliceContainer",componentId:"fss0bs-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],k.breakpoints.medium),se=u()(J).withConfig({displayName:"styles__SlotContainerLead",componentId:"fss0bs-1"})(["@media (min-width:","px){margin-bottom:24px;padding-right:12px;padding-bottom:24px;:before{display:block;bottom:24px;}}"],k.breakpoints.medium),me=u()(J).withConfig({displayName:"styles__StackedColumn",componentId:"fss0bs-2"})(["@media (min-width:","px){flex-shrink:0;width:",";margin-bottom:24px;padding-bottom:24px;padding-left:12px;}"],k.breakpoints.medium,c(33.33,3));var ce=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(re,{styles:t},n.a.createElement(se,{styles:t},n.a.createElement(V,{article:l()(e,"children[0].article"),displaySchema:r({sm:{imageRatio:"3:2",headlineFontSize:28},md:{imageRatio:"16:9"},lg:{headlineFontSize:32},xlg:{headlineFontSize:36}}),clickHandler:i})),n.a.createElement(me,{styles:t},n.a.createElement(J,{styles:t},n.a.createElement(V,{article:l()(e,"children[1].article"),displaySchema:r({sm:{imageRatio:"3:2",headlineFontSize:22},lg:{headlineFontSize:24},xlg:{headlineFontSize:28}}),clickHandler:i})),ae(l()(e,"children[2].article"))?n.a.createElement(de,{article:e.children[2].article,displaySchema:r({sm:{isSideBySide:!0,sideBySideWidth:"35%",imageRatio:"1:1",headlineFontSize:18},md:{headlineFontSize:16},lg:{sideBySideWidth:"50%"},xlg:{headlineFontSize:18}}),clickHandler:i}):n.a.createElement(V,{article:l()(e,"children[2].article"),displaySchema:r({sm:{isSideBySide:!0,imageRatio:"3:2",headlineFontSize:18},md:{headlineFontSize:16},xlg:{headlineFontSize:18}}),clickHandler:i}))));const pe=u()(J).withConfig({displayName:"styles__StackedColumn",componentId:"rqwi1t-0"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding-right:12px;padding-bottom:24px;:before{display:block;bottom:24px;}}"],k.breakpoints.medium,c(50,2)),he=u.a.div.withConfig({displayName:"styles__SideBySideColumn",componentId:"rqwi1t-1"})(["display:flex;flex-wrap:wrap;justify-content:space-between;"]),ge=u()(J).withConfig({displayName:"styles__SlotContainerLead",componentId:"rqwi1t-2"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding-bottom:24px;padding-left:12px;}"],k.breakpoints.medium,c(50,2)),ye=u()(J).withConfig({displayName:"styles__SlotContainer",componentId:"rqwi1t-3"})(["width:",";&:first-of-type{padding-right:12px;:before{display:block;bottom:12px;}}&:last-of-type{padding-left:12px;}"],c(50,2));var fe=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(G,{styles:t},n.a.createElement(pe,{styles:t},n.a.createElement(he,null,[...Array(2)].fill(null).map((a,o)=>n.a.createElement(ye,{key:o,styles:t},n.a.createElement(V,{article:l()(e,`children[${o}].article`),displaySchema:r({sm:{imageRatio:"3:2",headlineFontSize:18},md:{imageRatio:"16:9"},lg:{headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i})))),n.a.createElement(V,{article:l()(e,"children[2].article"),displaySchema:r({sm:{isSideBySide:!0,sideBySidePadding:12,imageRatio:"3:2",headlineFontSize:18},md:{imageRatio:"16:9",headlineFontSize:22},lg:{headlineFontSize:24}}),clickHandler:i})),n.a.createElement(ge,{styles:t},n.a.createElement(V,{article:l()(e,"children[3].article"),displaySchema:r({sm:{imageRatio:"3:2",headlineFontSize:22},md:{headlineFontSize:24},xlg:{headlineFontSize:28}}),clickHandler:i}))));const xe=u()(J).withConfig({displayName:"styles__SlotContainer",componentId:"z7ncw3-0"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding-bottom:24px;&:first-of-type{padding-right:12px;:before{display:block;bottom:24px;}}&:last-of-type{padding-left:12px;}}"],k.breakpoints.medium,c(50,2));var ue=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(G,{styles:t},e.children.map((e,a)=>n.a.createElement(xe,{key:a,styles:t},n.a.createElement(V,{article:e.article,displaySchema:r({sm:{imageRatio:"3:2",headlineFontSize:22},md:{imageRatio:"16:9",headlineFontSize:24},xlg:{headlineFontSize:28}}),clickHandler:i})))));const be=u()(G).withConfig({displayName:"styles__SliceContainer",componentId:"xnsfmb-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],k.breakpoints.wide),we=u()(J).withConfig({displayName:"styles__SlotContainerLead",componentId:"xnsfmb-1"})(["@media (min-width:","px){width:",";&:first-of-type{padding-right:12px;:before{display:block;bottom:12px;}}&:nth-of-type(2){padding-left:12px;}}@media (min-width:","px){margin-bottom:24px;padding-bottom:24px;:before{display:block;bottom:24px !important;}&:nth-of-type(2){padding-right:12px;}}"],k.breakpoints.medium,c(50,2),k.breakpoints.wide),_e=u()(J).withConfig({displayName:"styles__StackedColumn",componentId:"xnsfmb-2"})(["margin-bottom:0;padding-bottom:0;:after{display:none;}@media (min-width:","px){display:flex;justify-content:space-between;}@media (min-width:","px){display:block;flex-shrink:0;width:",";margin-bottom:24px;padding-bottom:24px;padding-left:12px;:after{display:block;}}"],k.breakpoints.medium,k.breakpoints.wide,c(33.33,3)),ke=u()(J).withConfig({displayName:"styles__SlotContainer",componentId:"xnsfmb-3"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding-bottom:24px;&:first-of-type{padding-right:12px;:before{display:block;bottom:24px;}}&:last-of-type{padding-left:12px;}}@media (min-width:","px){width:100%;margin-bottom:12px;padding-bottom:12px;&:first-of-type{padding-right:0;:before{display:none;}}&:last-of-type{margin-bottom:0;padding:0;:after{display:none;}}}"],k.breakpoints.medium,c(50,2),k.breakpoints.wide);var Se=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(be,{styles:t},[...Array(2)].fill(null).map((a,o)=>n.a.createElement(we,{key:o,styles:t},n.a.createElement(V,{article:l()(e,`children[${o}].article`),displaySchema:r({sm:{imageRatio:"3:2",headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i}))),n.a.createElement(_e,{styles:t},[...Array(2)].fill(null).map((a,o)=>{const d=l()(e,`children[${o+2}].article`);return n.a.createElement(ke,{key:o,styles:t},ae(d)?n.a.createElement(de,{article:d,displaySchema:r({sm:{isSideBySide:!0,sideBySideWidth:"35%",imageRatio:"1:1",headlineFontSize:18},md:{sideBySideWidth:"50%",headlineFontSize:16},xlg:{headlineFontSize:18}}),clickHandler:i}):n.a.createElement(V,{article:d,displaySchema:r({sm:{isSideBySide:!0,imageRatio:"3:2",headlineFontSize:18},md:{headlineFontSize:16},xlg:{headlineFontSize:18}}),clickHandler:i}))}))));const Ee=u()(G).withConfig({displayName:"styles__SliceContainer",componentId:"sc-7y5fg-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],k.breakpoints.wide),Ce=u()(J).withConfig({displayName:"styles__SlotContainerLead",componentId:"sc-7y5fg-1"})(["@media (min-width:","px){width:",";&:first-of-type{padding-right:12px;:before{display:block;bottom:12px;}}&:nth-of-type(2){padding-left:12px;}}@media (min-width:","px){margin-bottom:24px;padding-bottom:24px;:before{display:block;bottom:24px !important;}&:nth-of-type(2){padding-right:12px;}}"],k.breakpoints.medium,c(50,2),k.breakpoints.wide),ve=u()(J).withConfig({displayName:"styles__StackedColumn",componentId:"sc-7y5fg-2"})(["margin-bottom:0;padding-bottom:0;:after{display:none;}@media (min-width:","px){display:flex;justify-content:space-between;}@media (min-width:","px){display:block;flex-shrink:0;width:",";margin-bottom:24px;padding-bottom:24px;padding-left:12px;:after{display:block;}}"],k.breakpoints.medium,k.breakpoints.wide,c(33.33,3)),ze=u()(J).withConfig({displayName:"styles__SlotContainer",componentId:"sc-7y5fg-3"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding:0 12px 24px 12px;:before{display:block;bottom:24px;}&:first-of-type{padding-left:0;}&:last-of-type{padding-right:0;:before{display:none;}}}@media (min-width:","px){width:100%;margin-bottom:12px;padding:0 0 12px 0;:before{display:none;}&:last-of-type{margin-bottom:0;padding-bottom:0;:after{display:none;}}}"],k.breakpoints.medium,c(50,2),k.breakpoints.wide);var Ie=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(Ee,{styles:t},[...Array(2)].fill(null).map((a,o)=>n.a.createElement(Ce,{key:o,styles:t},n.a.createElement(V,{article:l()(e,`children[${o}].article`),displaySchema:r({sm:{imageRatio:"3:2",headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i}))),n.a.createElement(ve,{styles:t},[...Array(3)].fill(null).map((a,o)=>n.a.createElement(ze,{key:o,styles:t},n.a.createElement(V,{article:l()(e,`children[${o+2}].article`),displaySchema:r({sm:{isImageHidden:!0,imageRatio:"3:2",headlineFontSize:18},lg:{isSideBySide:!0,isImageHidden:!1,headlineFontSize:16},xlg:{headlineFontSize:18}}),clickHandler:i}))))));const Fe=u()(G).withConfig({displayName:"styles__SliceContainer",componentId:"sc-11upv3n-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],k.breakpoints.wide),Ne=u()(J).withConfig({displayName:"styles__SlotContainerLead",componentId:"sc-11upv3n-1"})(["@media (min-width:","px){width:",";&:first-of-type{padding-right:12px;:before{display:block;bottom:12px;}}&:nth-of-type(2){padding-left:12px;}}@media (min-width:","px){margin-bottom:24px;padding-bottom:24px;:before{display:block;bottom:24px !important;}&:nth-of-type(2){padding-right:12px;}}"],k.breakpoints.medium,c(50,2),k.breakpoints.wide),He=u()(J).withConfig({displayName:"styles__StackedColumn",componentId:"sc-11upv3n-2"})(["margin-bottom:0;padding-bottom:0;:after{display:none;}@media (min-width:","px){display:flex;justify-content:space-between;}@media (min-width:","px){display:block;flex-shrink:0;width:",";margin-bottom:24px;padding-bottom:24px;padding-left:12px;:after{display:block;}}"],k.breakpoints.medium,k.breakpoints.wide,c(33.33,3)),Re=u()(J).withConfig({displayName:"styles__SlotContainer",componentId:"sc-11upv3n-3"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding:0 12px 24px 12px;:before{display:block;bottom:24px;}&:first-of-type{padding-left:0;}&:last-of-type{padding-right:0;:before{display:none;}}}@media (min-width:","px){width:100%;margin-bottom:12px;padding:0 0 12px 0;:before{display:none;}&:last-of-type{margin-bottom:0;padding-bottom:0;:after{display:none;}}}"],k.breakpoints.medium,c(50,2),k.breakpoints.wide);var Oe=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(Fe,{styles:t},[...Array(2)].fill(null).map((a,o)=>n.a.createElement(Ne,{key:o,styles:t},n.a.createElement(V,{article:l()(e,`children[${o}].article`),displaySchema:r({sm:{imageRatio:"3:2",headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i}))),n.a.createElement(He,{styles:t},[...Array(3)].fill(null).map((a,o)=>n.a.createElement(Re,{key:o,styles:t},n.a.createElement(V,{article:l()(e,`children[${o+2}].article`),displaySchema:r({sm:{isImageHidden:!0,headlineFontSize:18},lg:{headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i}))))));const je=u()(J).withConfig({displayName:"styles__SlotContainer",componentId:"bazswq-0"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding:0 12px 24px 12px;:before{display:block;bottom:24px;}:after{display:block;}&:first-of-type{padding-left:0;}&:last-of-type{padding-right:0;&:before{display:none;}}}"],k.breakpoints.medium,c(33.33,3));var Ae=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(G,{styles:t},e.children.map((e,a)=>n.a.createElement(je,{key:a,styles:t,collapse:!e.article},n.a.createElement(V,{article:e.article,displaySchema:r({sm:{imageRatio:"3:2",headlineFontSize:22},md:{headlineFontSize:18},lg:{headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i})))));const De=u()(J).withConfig({displayName:"styles__SlotContainer",componentId:"sc-1gqjewy-0"})(["width:",";&:nth-of-type(odd){padding-right:12px;:before{display:block;bottom:12px;}}&:nth-of-type(even){padding-left:12px;}@media (min-width:","px){width:",";margin-bottom:24px;padding:0 12px 24px 12px;:before{display:block;bottom:24px !important;}&:first-of-type{padding-left:0;}&:last-of-type{padding-right:0;&:before{display:none;}}}"],c(50,2),k.breakpoints.medium,c(25,4));var Le=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(G,{styles:t},e.children.map((e,a)=>n.a.createElement(De,{key:a,styles:t},n.a.createElement(V,{article:e.article,displaySchema:r({sm:{imageRatio:"3:2",headlineFontSize:18},lg:{headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i})))));const Be=u()(G).withConfig({displayName:"styles__SliceContainer",componentId:"c5tu9p-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],k.breakpoints.wide),$e=u()(J).withConfig({displayName:"styles__SlotContainerLarge",componentId:"c5tu9p-1"})(["order:1;@media (min-width:","px){width:",";&:first-of-type{padding-right:12px;:before{display:block;bottom:12px;}}&:nth-of-type(3){padding-left:12px;}}@media (min-width:","px){flex-shrink:0;width:",";margin-bottom:24px;padding-bottom:24px;:before{display:block;bottom:24px !important;}&:nth-of-type(3){padding-right:12px;}}"],k.breakpoints.medium,c(50,2),k.breakpoints.wide,c(33.33,3)),Te=u()(J).withConfig({displayName:"styles__SlotContainerSmall",componentId:"c5tu9p-2"})(["order:2;@media (min-width:","px){width:",";margin-bottom:24px;padding-bottom:24px;&:nth-of-type(2){padding-right:12px;:before{display:block;bottom:24px;}}&:last-of-type{padding-left:12px;}}@media (min-width:","px){order:1;&:nth-of-type(2){padding-left:12px;:before{bottom:24px;}}}"],k.breakpoints.medium,c(50,2),k.breakpoints.wide);var Pe=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(Be,{styles:t},[...Array(2)].fill(null).map((a,o)=>{const d=l()(e,`children[${2*o}].article`),s=l()(e,`children[${2*o+1}].article`);return n.a.createElement(n.a.Fragment,{key:o},n.a.createElement($e,{styles:t},n.a.createElement(V,{article:d,displaySchema:r({sm:{imageRatio:"3:2",headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i})),n.a.createElement(Te,{styles:t},ae(s)?n.a.createElement(de,{article:s,displaySchema:r({sm:{isSideBySide:!0,sideBySideWidth:"35%",imageRatio:"1:1",headlineFontSize:18},md:{sideBySideWidth:"50%",headlineFontSize:16},lg:{isSideBySide:!1},xlg:{headlineFontSize:18}}),clickHandler:i}):n.a.createElement(V,{article:s,displaySchema:r({sm:{isImageHidden:!0,imageRatio:"3:2",headlineFontSize:18},md:{isImageHidden:!1,isSideBySide:!0,headlineFontSize:16},lg:{isSideBySide:!1},xlg:{headlineFontSize:18}}),clickHandler:i})))})));const qe=u()(J).withConfig({displayName:"styles__SlotContainer",componentId:"sc-189xcog-0"})(["width:",";&:nth-of-type(odd){padding-right:12px;:before{display:block;bottom:12px;}}&:nth-of-type(even){padding-left:12px;}@media (min-width:","px){width:",";margin-bottom:24px;padding:0 12px 24px 12px;:before{display:block;bottom:24px !important;}&:nth-of-type(5n + 1){padding-left:0;}&:nth-of-type(5n){padding-right:0;&:before{display:none;}}}"],c(50,2),k.breakpoints.medium,c(20,5));var Me=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(G,{styles:t},e.children.map((e,a)=>n.a.createElement(qe,{key:a,styles:t},n.a.createElement(V,{article:l()(e,"article"),displaySchema:r({sm:{imageRatio:"3:2",headlineFontSize:18,isCentered:!0},lg:{headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i})))));const We=u()(G).withConfig({displayName:"styles__SliceContainer",componentId:"b33h2c-0"})(["@media (min-width:","px){flex-wrap:nowrap;width:80.8%;max-width:none;padding:0;}@media (min-width:","px){width:56.2%;}"],k.breakpoints.medium,k.breakpoints.wide),Ye=u()(J).withConfig({displayName:"styles__SlotContainer",componentId:"b33h2c-1"})(["@media (min-width:","px){margin-bottom:24px;padding-right:0;padding-bottom:24px;}"],k.breakpoints.medium);var Ue=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(We,{styles:t},n.a.createElement(Ye,{styles:t},n.a.createElement(V,{article:l()(e,"children[0].article"),displaySchema:r({sm:{imageRatio:"16:9",headlineFontSize:22},md:{isSideBySide:!0}}),clickHandler:i}))));const Ve=u()(G).withConfig({displayName:"styles__SliceContainer",componentId:"v1jynn-0"})(["@media (min-width:","px){width:80.8%;max-width:none;padding:0;}@media (min-width:","px){width:56.2%;}"],k.breakpoints.medium,k.breakpoints.wide),Ge=u()(J).withConfig({displayName:"styles__SlotContainer",componentId:"v1jynn-1"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding-bottom:24px;&:first-of-type{padding-right:12px;:before{display:block;bottom:24px;}}&:last-of-type{padding-left:12px;}}"],k.breakpoints.medium,c(50,2));var Je=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(Ve,{styles:t},e.children.map((e,a)=>n.a.createElement(Ge,{key:a,styles:t},n.a.createElement(V,{article:e.article,displaySchema:r({sm:{isImageHidden:!0,imageRatio:"16:9",headlineFontSize:22},md:{isImageHidden:!1}}),clickHandler:i})))));const Ke=u()(J).withConfig({displayName:"styles__SlotContainer",componentId:"yjxerl-0"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding:0 12px 24px 12px;:before{display:block;bottom:24px;}:after{display:block;}&:first-of-type{padding-left:0;}&:last-of-type{padding-right:0;&:before{display:none;}}}"],k.breakpoints.medium,c(33.33,3));var Qe=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(G,{styles:t},e.children.map((e,a)=>n.a.createElement(Ke,{key:a,styles:t},n.a.createElement(V,{article:e.article,displaySchema:r({sm:{isImageHidden:!0,imageRatio:"16:9",headlineFontSize:22},md:{isImageHidden:!1}}),clickHandler:i})))));const Xe=({slice:e,styles:t,clickHandler:i})=>{const a=(e=>{switch(e){case"LEAD_1":case"LEAD_1_COMPONENT":case"INTERACTIVE_FULL_WIDTH":return X;case"LEAD_1_AND_1":case"LEAD_1_AND_1_COMPONENT":return ie;case"LEAD_1_AND_2":case"LEAD_1_AND_2_COLUMNIST":return ce;case"LEAD_1_AND_3_REVERSED":return fe;case"LEAD_2":case"LEAD_2_COMPONENT":case"INTERACTIVE_HALF_WIDTH":return ue;case"SECONDARY_2_AND_2":return Se;case"SECONDARY_2_AND_3":return Ie;case"SECONDARY_2_AND_3_NO_PIC":return Oe;case"SECONDARY_3":return Ae;case"SECONDARY_4":return Le;case"SECONDARY_4_ODD":case"SECONDARY_4_ODD_COLUMNIST":return Pe;case"SECONDARY_10":return Me;case"RELATED_ARTICLE_1":return Ue;case"RELATED_ARTICLE_2":return Je;case"RELATED_ARTICLE_3":return Qe;default:return()=>null}})(e.name);return n.a.createElement(a,{slice:e,styles:t,clickHandler:i})};i.d(t,"Slice",(function(){return Xe}))}]);
|
|
1
|
+
module.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("@times-components/ts-styleguide/rnw")},function(e,t){e.exports=require("styled-components")},function(e,t){var n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/,r=/^\./,a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,l=/^\[object .+?Constructor\]$/,c="object"==typeof global&&global&&global.Object===Object&&global,d="object"==typeof self&&self&&self.Object===Object&&self,s=c||d||Function("return this")();var m,p=Array.prototype,u=Function.prototype,f=Object.prototype,h=s["__core-js_shared__"],y=(m=/[^.]+$/.exec(h&&h.keys&&h.keys.IE_PROTO||""))?"Symbol(src)_1."+m:"",g=u.toString,b=f.hasOwnProperty,x=f.toString,w=RegExp("^"+g.call(b).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),S=s.Symbol,v=p.splice,_=H(s,"Map"),k=H(Object,"create"),E=S?S.prototype:void 0,C=E?E.toString:void 0;function I(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function A(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function z(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function O(e,t){for(var n,i,r=e.length;r--;)if((n=e[r][0])===(i=t)||n!=n&&i!=i)return r;return-1}function j(e,t){for(var r,a=0,o=(t=function(e,t){if(L(e))return!1;var r=typeof e;if("number"==r||"symbol"==r||"boolean"==r||null==e||P(e))return!0;return i.test(e)||!n.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:L(r=t)?r:R(r)).length;null!=e&&a<o;)e=e[D(t[a++])];return a&&a==o?e:void 0}function F(e){return!(!B(e)||(t=e,y&&y in t))&&(function(e){var t=B(e)?x.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?w:l).test(function(e){if(null!=e){try{return g.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function N(e,t){var n,i,r=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function H(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return F(n)?n:void 0}I.prototype.clear=function(){this.__data__=k?k(null):{}},I.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},I.prototype.get=function(e){var t=this.__data__;if(k){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return b.call(t,e)?t[e]:void 0},I.prototype.has=function(e){var t=this.__data__;return k?void 0!==t[e]:b.call(t,e)},I.prototype.set=function(e,t){return this.__data__[e]=k&&void 0===t?"__lodash_hash_undefined__":t,this},A.prototype.clear=function(){this.__data__=[]},A.prototype.delete=function(e){var t=this.__data__,n=O(t,e);return!(n<0)&&(n==t.length-1?t.pop():v.call(t,n,1),!0)},A.prototype.get=function(e){var t=this.__data__,n=O(t,e);return n<0?void 0:t[n][1]},A.prototype.has=function(e){return O(this.__data__,e)>-1},A.prototype.set=function(e,t){var n=this.__data__,i=O(n,e);return i<0?n.push([e,t]):n[i][1]=t,this},z.prototype.clear=function(){this.__data__={hash:new I,map:new(_||A),string:new I}},z.prototype.delete=function(e){return N(this,e).delete(e)},z.prototype.get=function(e){return N(this,e).get(e)},z.prototype.has=function(e){return N(this,e).has(e)},z.prototype.set=function(e,t){return N(this,e).set(e,t),this};var R=T((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(P(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return r.test(e)&&n.push(""),e.replace(a,(function(e,t,i,r){n.push(i?r.replace(o,"$1"):t||e)})),n}));function D(e){if("string"==typeof e||P(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function T(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],a=n.cache;if(a.has(r))return a.get(r);var o=e.apply(this,i);return n.cache=a.set(r,o),o};return n.cache=new(T.Cache||z),n}T.Cache=z;var L=Array.isArray;function B(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function P(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==x.call(e)}e.exports=function(e,t,n){var i=null==e?void 0:j(e,t);return void 0===i?n:i}},function(e,t){e.exports=require("date-fns")},function(e,t,n){"use strict";n.r(t);var i=n(0),r=n.n(i),a=n(3),o=n.n(a);function l(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var i,r,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(a.push(i.value),!t||a.length!==t);o=!0);}catch(e){l=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw r}}return a}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var f=["sm","md","lg","xlg"],h=function(e){if(e){var t={};return f.reduce((function(n,i){var r=p(p({},t),o()(e,i));return t=r,p(p({},n),{},u({},i,r))}),{})}},y=function(e,t){return!0===o()(o()(t,e),"isSideBySide")},g=function(e,t){return!0===o()(o()(t,e),"isCentered")},b=function(e,t){return"calc(".concat(e,"% - ").concat(function(e){return 12*(2*e-2)/e}(t),"px)")},x=n(4),w=function(e){return o()(e,"images.alt",o()(e,"headline"))},S=[760,660,560,480,380,320,270,230,180,120,80],v=function(e,t){var n,i=(n=t,S.reduce((function(e,t){return n<=t?t:e}),S[0]))*window.devicePixelRatio,r=new URL(e),a=new URLSearchParams(r.search.slice(1));a.set("resize",i.toString());var o="https://www.uat-thetimes.co.uk"===r.origin?"https://www.thetimes.co.uk":r.origin;return"".concat(o).concat(r.pathname,"?").concat(a.toString())},_=function(e,t){return e.includes("thetimes.co.uk/imageserver")?v(e,t):e},k=n(2),E=n.n(k),C=E.a.div.withConfig({displayName:"styles__LazyContainer",componentId:"qsbah5-0"})(["position:absolute;width:100%;height:100%;background-color:",";border-radius:",";transition:0.5s;div,img{width:100%;height:100%;border-radius:",";opacity:",";transition:opacity 0.5s;}"],(function(e){return e.visible?"transparent":"#f0f0f0"}),(function(e){return e.isRoundal?"50%":0}),(function(e){return e.isRoundal?"50%":0}),(function(e){return e.visible?1:0})),I=E.a.div.withConfig({displayName:"styles__BackgroundImage",componentId:"qsbah5-1"})(["background:",";background-size:cover;"],(function(e){var t=e.src;return t?"url(".concat(t,") no-repeat center center"):"none"}));function A(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var i,r,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(a.push(i.value),!t||a.length!==t);o=!0);}catch(e){l=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw r}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var O=function(e){var t=e.url,n=e.alt,a=e.isRoundal,o=e.isBackground,l=r.a.createRef(),c=A(Object(i.useState)(),2),d=c[0],s=c[1];return Object(i.useEffect)((function(){if("IntersectionObserver"in window){var e=new IntersectionObserver((function(n){return n.forEach((function(n){if(n.isIntersecting&&(e.disconnect(),t&&l.current)){var i=l.current.offsetWidth,r=new Image;r.onload=function(){return s(r.src)},r.src=_(t,i)}}))}),{rootMargin:"60px"});return l.current&&e.observe(l.current),function(){return e.disconnect()}}t&&l.current&&s(_(t,l.current.offsetWidth))}),[t,l]),r.a.createElement(C,{visible:!!d,isRoundal:a},o?r.a.createElement(I,{src:d,ref:l,role:"img","aria-label":n}):r.a.createElement("img",{src:d,alt:n,ref:l}))},j=n(1),F=function(e,t){return y(e,t)||function(e,t){return!0===o()(o()(t,e),"isImageHidden")}(e,t)?0:"12px"},N=function(e,t){return t&&t.includes(e)?"block":"none"},H=E.a.div.withConfig({displayName:"styles__ImageContainer",componentId:"sc-8lglkt-0"})(["margin-bottom:",";@media (min-width:","px){margin-bottom:",";}@media (min-width:","px){margin-bottom:",";}@media (min-width:","px){margin-bottom:",";}"],(function(e){var t=e.schema;return F("sm",t)}),j.breakpoints.medium,(function(e){var t=e.schema;return F("md",t)}),j.breakpoints.wide,(function(e){var t=e.schema;return F("lg",t)}),j.breakpoints.huge,(function(e){var t=e.schema;return F("xlg",t)})),R=E.a.div.withConfig({displayName:"styles__ImageRatio",componentId:"sc-8lglkt-1"})(["position:relative;display:",";overflow:hidden;&:after{content:'';display:block;padding-bottom:",";}@media (min-width:","px){display:",";}@media (min-width:","px){display:",";}@media (min-width:","px){display:",";}"],(function(e){var t=e.schema;return N("sm",t)}),(function(e){return function(e){switch(e){case"16:9":return"56.25%";case"3:2":return"66.66%";case"1:1":return"100%";default:return 0}}(e.ratio)}),j.breakpoints.medium,(function(e){var t=e.schema;return N("md",t)}),j.breakpoints.wide,(function(e){var t=e.schema;return N("lg",t)}),j.breakpoints.huge,(function(e){var t=e.schema;return N("xlg",t)}));function D(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var i,r,a=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(a.push(i.value),!t||a.length!==t);o=!0);}catch(e){l=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(l)throw r}}return a}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return T(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return T(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var L=function(e){var t,n,i=e.article,a=e.displaySchema,d=e.clickHandler,s=(t=a)?Object.entries(t).reduce((function(e,t){var i=c(t,2),r=i[0],a=i[1],d=o()(a,"imageRatio",n);return n=d,d&&!o()(a,"isImageHidden")?p(p({},e),{},u({},d,[].concat(l(o()(e,d,[])),[r]))):e}),{}):{};return r.a.createElement(H,{schema:a},r.a.createElement("a",{onClick:function(e){i&&d&&d(e,i)},href:i.url},Object.entries(s).map((function(e,t){var n=D(e,2),a=n[0],l=n[1],c=function(e,t){return t.images.crops.find((function(t){return"*"===t.ratio||t.ratio===e}))}(a,i);return r.a.createElement(R,{key:t,ratio:a,schema:l},r.a.createElement(O,{url:o()(c,"url"),alt:w(i),isRoundal:"1:1"===a,isBackground:"*"===o()(c,"ratio")}))}))))},B=function(e,t){return o()(o()(t,e),"headlineFontSize",10)},P=function(e,t){return g(e,t)?"sm"===e||"md"===e?"90%":"80%":"100%"},M=function(e,t){return g(e,t)?"center":"left"},U=E.a.div.withConfig({displayName:"styles__HeadlineContainer",componentId:"k0mgwi-0"})(["width:",";margin:0 auto;@media (min-width:","px){width:",";}@media (min-width:","px){width:",";}@media (min-width:","px){width:",";}a{text-decoration:none;h3{margin:0;color:",";font-size:","px;line-height:","px;font-family:",";font-weight:normal;text-align:",";@media (min-width:","px){font-size:","px;line-height:","px;text-align:",";}@media (min-width:","px){font-size:","px;line-height:","px;text-align:",";}@media (min-width:","px){font-size:","px;line-height:","px;text-align:",";}}&:hover{h3{color:#006699;}}}"],(function(e){var t=e.schema;return P("sm",t)}),j.breakpoints.medium,(function(e){var t=e.schema;return P("md",t)}),j.breakpoints.wide,(function(e){var t=e.schema;return P("lg",t)}),j.breakpoints.huge,(function(e){var t=e.schema;return P("xlg",t)}),j.colours.functional.brandColour,(function(e){var t=e.schema;return B("sm",t)}),(function(e){var t=e.schema;return B("sm",t)}),j.fonts.headline,(function(e){var t=e.schema;return M("sm",t)}),j.breakpoints.medium,(function(e){var t=e.schema;return B("md",t)}),(function(e){var t=e.schema;return B("md",t)}),(function(e){var t=e.schema;return M("md",t)}),j.breakpoints.wide,(function(e){var t=e.schema;return B("lg",t)}),(function(e){var t=e.schema;return B("lg",t)}),(function(e){var t=e.schema;return M("lg",t)}),j.breakpoints.huge,(function(e){var t=e.schema;return B("xlg",t)}),(function(e){var t=e.schema;return B("xlg",t)}),(function(e){var t=e.schema;return M("xlg",t)})),$=function(e){var t=e.article,n=e.displaySchema,i=e.clickHandler;if(!t.headline)return null;return r.a.createElement(U,{schema:n},r.a.createElement("a",{onClick:function(e){t&&i&&i(e,t)},href:t.url},r.a.createElement("h3",null,t.headline)))},q=function(e,t){return y(e,t)?"row":"column"},W=function(e,t){return y(e,t)?o()(o()(t,e),"sideBySideWidth","50%"):"100%"},Y=function(e,t){return y(e,t)?"".concat(o()(o()(t,e),"sideBySidePadding",8),"px"):0},V=function(e,t){return g(e,t)?"center":"flex-start"},G=function(e,t){return g(e,t)&&!y(e,t)?"16px 0 24px 0":0},J=function(e,t){return o()(o()(t,e),"backgroundColor","transparent")},K=E.a.article.withConfig({displayName:"shared-styles__ArticleContainer",componentId:"sc-1kek94e-0"})(["display:flex;flex-direction:",";background-color:",";@media (min-width:","px){flex-direction:",";background-color:",";}@media (min-width:","px){flex-direction:",";background-color:",";}@media (min-width:","px){flex-direction:",";background-color:",";}"],(function(e){var t=e.schema;return q("sm",t)}),(function(e){var t=e.schema;return J("sm",t)}),j.breakpoints.medium,(function(e){var t=e.schema;return q("md",t)}),(function(e){var t=e.schema;return J("md",t)}),j.breakpoints.wide,(function(e){var t=e.schema;return q("lg",t)}),(function(e){var t=e.schema;return J("lg",t)}),j.breakpoints.huge,(function(e){var t=e.schema;return q("xlg",t)}),(function(e){var t=e.schema;return J("xlg",t)})),Q=E.a.div.withConfig({displayName:"shared-styles__SideBySideColumn",componentId:"sc-1kek94e-1"})(["width:100%;&:first-of-type{flex-shrink:0;width:",";padding-right:",";}&:last-of-type{display:flex;flex-direction:column;justify-content:",";align-items:",";margin:",";padding-left:",";}@media (min-width:","px){&:first-of-type{width:",";padding-right:",";}&:last-of-type{justify-content:",";align-items:",";margin:",";padding-left:",";}}@media (min-width:","px){&:first-of-type{width:",";padding-right:",";}&:last-of-type{justify-content:",";align-items:",";margin:",";padding-left:",";}}@media (min-width:","px){&:first-of-type{width:",";padding-right:",";}&:last-of-type{justify-content:",";align-items:",";margin:",";padding-left:",";}}"],(function(e){var t=e.schema;return W("sm",t)}),(function(e){var t=e.schema;return Y("sm",t)}),(function(e){var t=e.schema;return V("sm",t)}),(function(e){var t=e.schema;return V("sm",t)}),(function(e){var t=e.schema;return G("sm",t)}),(function(e){var t=e.schema;return Y("sm",t)}),j.breakpoints.medium,(function(e){var t=e.schema;return W("md",t)}),(function(e){var t=e.schema;return Y("md",t)}),(function(e){var t=e.schema;return V("md",t)}),(function(e){var t=e.schema;return V("md",t)}),(function(e){var t=e.schema;return G("md",t)}),(function(e){var t=e.schema;return Y("md",t)}),j.breakpoints.wide,(function(e){var t=e.schema;return W("lg",t)}),(function(e){var t=e.schema;return Y("lg",t)}),(function(e){var t=e.schema;return V("lg",t)}),(function(e){var t=e.schema;return V("lg",t)}),(function(e){var t=e.schema;return G("lg",t)}),(function(e){var t=e.schema;return Y("lg",t)}),j.breakpoints.huge,(function(e){var t=e.schema;return W("xlg",t)}),(function(e){var t=e.schema;return Y("xlg",t)}),(function(e){var t=e.schema;return V("xlg",t)}),(function(e){var t=e.schema;return V("xlg",t)}),(function(e){var t=e.schema;return G("xlg",t)}),(function(e){var t=e.schema;return Y("xlg",t)})),X=E.a.p.withConfig({displayName:"shared-styles__Label",componentId:"sc-1kek94e-2"})(["margin:0 0 4px 0;color:",";font-size:12px;line-height:16px;letter-spacing:1px;font-family:",";text-transform:uppercase;"],j.colours.functional.secondary,j.fonts.supporting),Z=function(e,t){return g(e,t)?"sm"===e||"md"===e?"90%":"80%":"100%"},ee=function(e,t){return g(e,t)?"center":"left"},te=E.a.p.withConfig({displayName:"styles__Strapline",componentId:"p3h2iu-0"})(["width:",";margin:4px auto 0 auto;color:",";font-size:14px;line-height:20px;text-align:",";font-family:",";@media (min-width:","px){width:",";text-align:",";}@media (min-width:","px){width:",";text-align:",";}@media (min-width:","px){width:",";text-align:",";}"],(function(e){var t=e.schema;return Z("sm",t)}),j.colours.functional.secondary,(function(e){var t=e.schema;return ee("sm",t)}),j.fonts.body,j.breakpoints.medium,(function(e){var t=e.schema;return Z("md",t)}),(function(e){var t=e.schema;return ee("md",t)}),j.breakpoints.wide,(function(e){var t=e.schema;return Z("lg",t)}),(function(e){var t=e.schema;return ee("lg",t)}),j.breakpoints.huge,(function(e){var t=e.schema;return Z("xlg",t)}),(function(e){var t=e.schema;return ee("xlg",t)})),ne=E.a.p.withConfig({displayName:"styles__TimeSince",componentId:"p3h2iu-1"})(["margin:8px 0 0 0;color:",";font-size:12px;line-height:16px;letter-spacing:1px;font-family:",";text-transform:uppercase;"],j.colours.functional.secondary,j.fonts.supporting),ie=E.a.div.withConfig({displayName:"styles__Link",componentId:"p3h2iu-2"})(["margin-top:8px;a{color:#006699;font-size:13px;line-height:13px;letter-spacing:0px;font-family:",";font-weight:500;text-decoration:none;&:after{display:inline-block;content:'\\E003';font-size:10px;font-family:iconfont;padding:0 0 1px 6px;vertical-align:middle;}}"],j.fonts.supporting),re=function(e){var t=e.article,n=e.displaySchema,i=e.clickHandler;if(!t)return null;var a=t.standfirst||t.summary,l=function(e){var t=Object(x.parseISO)(o()(e,"datePublished","")),n=Object(x.parseISO)(o()(e,"dateUpdated","")),i=Object(x.max)([t,n].filter((function(e){return Object(x.isValid)(e)}))),r=Object(x.differenceInCalendarDays)(new Date,i);return!Object(x.isValid)(i)||r>=7?null:"".concat(Object(x.formatDistanceToNowStrict)(i,{roundingMethod:"floor"})," ago")}(t);return r.a.createElement(K,{schema:n},r.a.createElement(Q,{schema:n},r.a.createElement(L,{article:t,displaySchema:n,clickHandler:i})),r.a.createElement(Q,{schema:n},t.label&&r.a.createElement(X,null,t.label),r.a.createElement($,{article:t,displaySchema:n,clickHandler:i}),a&&r.a.createElement(te,{schema:n},a),l&&r.a.createElement(ne,null,l),t.cta&&r.a.createElement(ie,null,r.a.createElement("a",{href:t.url},t.cta))))},ae=E.a.div.withConfig({displayName:"shared-styles__SliceContainer",componentId:"ismxwo-0"})(["display:flex;flex-wrap:wrap;justify-content:space-between;margin:0 auto;padding:",";@media (min-width:","px){max-width:520px;}@media (min-width:","px){max-width:860px;padding:",";}@media (min-width:","px){max-width:1024px;}@media (min-width:","px){max-width:1180px;}"],(function(e){var t=e.styles;return t&&t.removePadding?0:"0 16px"}),j.breakpoints.small,j.breakpoints.medium,(function(e){var t=e.styles;return t&&t.removePadding?0:"0 20px"}),j.breakpoints.wide,j.breakpoints.huge),oe=E.a.div.withConfig({displayName:"shared-styles__SlotContainer",componentId:"ismxwo-1"})(["position:relative;width:100%;margin-bottom:",";padding-bottom:",";box-sizing:content-box;:before{content:'';display:none;position:absolute;top:0;right:0;bottom:0;width:1px;background-color:",";}:after{content:'';display:",";position:absolute;right:0;bottom:0;left:0;height:1px;background-color:",";}"],(function(e){return e.collapse?0:"12px"}),(function(e){return e.collapse?0:"12px"}),(function(e){var t=e.styles;return t&&t.lineColor?t.lineColor:"#dbdbdb"}),(function(e){return e.collapse?"none":"block"}),(function(e){var t=e.styles;return t&&t.lineColor?t.lineColor:"#dbdbdb"})),le=E()(ae).withConfig({displayName:"styles__SliceContainer",componentId:"sc-614vlg-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],j.breakpoints.medium),ce=E()(oe).withConfig({displayName:"styles__SlotContainer",componentId:"sc-614vlg-1"})(["@media (min-width:","px){margin-bottom:24px;padding-right:0;padding-bottom:24px;}"],j.breakpoints.medium),de=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(le,{styles:n},r.a.createElement(ce,{styles:n},r.a.createElement(re,{article:o()(t,"children[0].article"),displaySchema:h({sm:{imageRatio:"3:2",isCentered:!0,headlineFontSize:28,backgroundColor:"#f0f0f0"},md:{isSideBySide:!0},lg:{headlineFontSize:32},xlg:{headlineFontSize:36}}),clickHandler:i})))})),se=E()(ae).withConfig({displayName:"styles__SliceContainer",componentId:"sc-1r0nv22-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],j.breakpoints.medium),me=E()(oe).withConfig({displayName:"styles__SlotContainerLead",componentId:"sc-1r0nv22-1"})(["@media (min-width:","px){margin-bottom:24px;padding-right:12px;padding-bottom:24px;:before{display:block;bottom:24px;}}"],j.breakpoints.medium),pe=E()(oe).withConfig({displayName:"styles__SlotContainer",componentId:"sc-1r0nv22-2"})(["@media (min-width:","px){flex-shrink:0;width:",";margin-bottom:24px;padding-bottom:24px;padding-left:12px;}"],j.breakpoints.medium,b(33.33,3)),ue=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(se,{styles:n},r.a.createElement(me,{styles:n},r.a.createElement(re,{article:o()(t,"children[0].article"),displaySchema:h({sm:{imageRatio:"3:2",headlineFontSize:28},md:{imageRatio:"16:9"},lg:{headlineFontSize:32},xlg:{headlineFontSize:36}}),clickHandler:i})),r.a.createElement(pe,{styles:n},r.a.createElement(re,{article:o()(t,"children[1].article"),displaySchema:h({sm:{imageRatio:"3:2",headlineFontSize:22},lg:{headlineFontSize:24},xlg:{headlineFontSize:28}}),clickHandler:i})))})),fe=function(e){return e&&("maincomment"===e.template||"magazinecomment"===e.template||"externalcomment"===e.template)},he=E()(K).withConfig({displayName:"styles__ArticleContainer",componentId:"sc-2eizyd-0"})(["align-items:center;"]),ye=E.a.div.withConfig({displayName:"styles__ImageContainer",componentId:"sc-2eizyd-1"})(["max-width:120px;margin:0 auto;@media (min-width:","px){max-width:140px;}"],j.breakpoints.huge),ge=E.a.p.withConfig({displayName:"styles__Byline",componentId:"sc-2eizyd-2"})(["margin:0 0 4px 0;color:",";font-size:22px;line-height:22px;font-family:",";@media (min-width:","px){font-size:24px;line-height:24px;}"],j.colours.functional.secondary,j.fonts.headlineRegular,j.breakpoints.huge),be=function(e){var t=e.article,n=e.displaySchema,i=e.clickHandler;return t?r.a.createElement(he,{schema:n},r.a.createElement(Q,{schema:n},r.a.createElement(ye,null,r.a.createElement(L,{article:t,displaySchema:n,clickHandler:i}))),r.a.createElement(Q,{schema:n},t.label&&r.a.createElement(X,null,t.label),t.byline&&r.a.createElement(ge,null,t.byline),r.a.createElement($,{article:t,displaySchema:n,clickHandler:i}))):null},xe=E()(ae).withConfig({displayName:"styles__SliceContainer",componentId:"fss0bs-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],j.breakpoints.medium),we=E()(oe).withConfig({displayName:"styles__SlotContainerLead",componentId:"fss0bs-1"})(["@media (min-width:","px){margin-bottom:24px;padding-right:12px;padding-bottom:24px;:before{display:block;bottom:24px;}}"],j.breakpoints.medium),Se=E()(oe).withConfig({displayName:"styles__StackedColumn",componentId:"fss0bs-2"})(["@media (min-width:","px){flex-shrink:0;width:",";margin-bottom:24px;padding-bottom:24px;padding-left:12px;}"],j.breakpoints.medium,b(33.33,3)),ve=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(xe,{styles:n},r.a.createElement(we,{styles:n},r.a.createElement(re,{article:o()(t,"children[0].article"),displaySchema:h({sm:{imageRatio:"3:2",headlineFontSize:28},md:{imageRatio:"16:9"},lg:{headlineFontSize:32},xlg:{headlineFontSize:36}}),clickHandler:i})),r.a.createElement(Se,{styles:n},r.a.createElement(oe,{styles:n},r.a.createElement(re,{article:o()(t,"children[1].article"),displaySchema:h({sm:{imageRatio:"3:2",headlineFontSize:22},lg:{headlineFontSize:24},xlg:{headlineFontSize:28}}),clickHandler:i})),fe(o()(t,"children[2].article"))?r.a.createElement(be,{article:t.children[2].article,displaySchema:h({sm:{isSideBySide:!0,sideBySideWidth:"35%",imageRatio:"1:1",headlineFontSize:18},md:{headlineFontSize:16},lg:{sideBySideWidth:"50%"},xlg:{headlineFontSize:18}}),clickHandler:i}):r.a.createElement(re,{article:o()(t,"children[2].article"),displaySchema:h({sm:{isSideBySide:!0,imageRatio:"3:2",headlineFontSize:18},md:{headlineFontSize:16},xlg:{headlineFontSize:18}}),clickHandler:i})))})),_e=E()(oe).withConfig({displayName:"styles__StackedColumn",componentId:"rqwi1t-0"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding-right:12px;padding-bottom:24px;:before{display:block;bottom:24px;}}"],j.breakpoints.medium,b(50,2)),ke=E.a.div.withConfig({displayName:"styles__SideBySideColumn",componentId:"rqwi1t-1"})(["display:flex;flex-wrap:wrap;justify-content:space-between;"]),Ee=E()(oe).withConfig({displayName:"styles__SlotContainerLead",componentId:"rqwi1t-2"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding-bottom:24px;padding-left:12px;}"],j.breakpoints.medium,b(50,2)),Ce=E()(oe).withConfig({displayName:"styles__SlotContainer",componentId:"rqwi1t-3"})(["width:",";&:first-of-type{padding-right:12px;:before{display:block;bottom:12px;}}&:last-of-type{padding-left:12px;}"],b(50,2));function Ie(e){return function(e){if(Array.isArray(e))return Ae(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ae(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var ze=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(ae,{styles:n},r.a.createElement(_e,{styles:n},r.a.createElement(ke,null,Ie(Array(2)).fill(null).map((function(e,a){return r.a.createElement(Ce,{key:a,styles:n},r.a.createElement(re,{article:o()(t,"children[".concat(a,"].article")),displaySchema:h({sm:{imageRatio:"3:2",headlineFontSize:18},md:{imageRatio:"16:9"},lg:{headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i}))}))),r.a.createElement(re,{article:o()(t,"children[2].article"),displaySchema:h({sm:{isSideBySide:!0,sideBySidePadding:12,imageRatio:"3:2",headlineFontSize:18},md:{imageRatio:"16:9",headlineFontSize:22},lg:{headlineFontSize:24}}),clickHandler:i})),r.a.createElement(Ee,{styles:n},r.a.createElement(re,{article:o()(t,"children[3].article"),displaySchema:h({sm:{imageRatio:"3:2",headlineFontSize:22},md:{headlineFontSize:24},xlg:{headlineFontSize:28}}),clickHandler:i})))})),Oe=E()(oe).withConfig({displayName:"styles__SlotContainer",componentId:"z7ncw3-0"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding-bottom:24px;&:first-of-type{padding-right:12px;:before{display:block;bottom:24px;}}&:last-of-type{padding-left:12px;}}"],j.breakpoints.medium,b(50,2)),je=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(ae,{styles:n},t.children.map((function(e,t){return r.a.createElement(Oe,{key:t,styles:n},r.a.createElement(re,{article:e.article,displaySchema:h({sm:{imageRatio:"3:2",headlineFontSize:22},md:{imageRatio:"16:9",headlineFontSize:24},xlg:{headlineFontSize:28}}),clickHandler:i}))})))})),Fe=E()(ae).withConfig({displayName:"styles__SliceContainer",componentId:"xnsfmb-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],j.breakpoints.wide),Ne=E()(oe).withConfig({displayName:"styles__SlotContainerLead",componentId:"xnsfmb-1"})(["@media (min-width:","px){width:",";&:first-of-type{padding-right:12px;:before{display:block;bottom:12px;}}&:nth-of-type(2){padding-left:12px;}}@media (min-width:","px){margin-bottom:24px;padding-bottom:24px;:before{display:block;bottom:24px !important;}&:nth-of-type(2){padding-right:12px;}}"],j.breakpoints.medium,b(50,2),j.breakpoints.wide),He=E()(oe).withConfig({displayName:"styles__StackedColumn",componentId:"xnsfmb-2"})(["margin-bottom:0;padding-bottom:0;:after{display:none;}@media (min-width:","px){display:flex;justify-content:space-between;}@media (min-width:","px){display:block;flex-shrink:0;width:",";margin-bottom:24px;padding-bottom:24px;padding-left:12px;:after{display:block;}}"],j.breakpoints.medium,j.breakpoints.wide,b(33.33,3)),Re=E()(oe).withConfig({displayName:"styles__SlotContainer",componentId:"xnsfmb-3"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding-bottom:24px;&:first-of-type{padding-right:12px;:before{display:block;bottom:24px;}}&:last-of-type{padding-left:12px;}}@media (min-width:","px){width:100%;margin-bottom:12px;padding-bottom:12px;&:first-of-type{padding-right:0;:before{display:none;}}&:last-of-type{margin-bottom:0;padding:0;:after{display:none;}}}"],j.breakpoints.medium,b(50,2),j.breakpoints.wide);function De(e){return function(e){if(Array.isArray(e))return Te(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Te(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var Le=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(Fe,{styles:n},De(Array(2)).fill(null).map((function(e,a){return r.a.createElement(Ne,{key:a,styles:n},r.a.createElement(re,{article:o()(t,"children[".concat(a,"].article")),displaySchema:h({sm:{imageRatio:"3:2",headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i}))})),r.a.createElement(He,{styles:n},De(Array(2)).fill(null).map((function(e,a){var l=o()(t,"children[".concat(a+2,"].article"));return r.a.createElement(Re,{key:a,styles:n},fe(l)?r.a.createElement(be,{article:l,displaySchema:h({sm:{isSideBySide:!0,sideBySideWidth:"35%",imageRatio:"1:1",headlineFontSize:18},md:{sideBySideWidth:"50%",headlineFontSize:16},xlg:{headlineFontSize:18}}),clickHandler:i}):r.a.createElement(re,{article:l,displaySchema:h({sm:{isSideBySide:!0,imageRatio:"3:2",headlineFontSize:18},md:{headlineFontSize:16},xlg:{headlineFontSize:18}}),clickHandler:i}))}))))})),Be=E()(ae).withConfig({displayName:"styles__SliceContainer",componentId:"sc-7y5fg-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],j.breakpoints.wide),Pe=E()(oe).withConfig({displayName:"styles__SlotContainerLead",componentId:"sc-7y5fg-1"})(["@media (min-width:","px){width:",";&:first-of-type{padding-right:12px;:before{display:block;bottom:12px;}}&:nth-of-type(2){padding-left:12px;}}@media (min-width:","px){margin-bottom:24px;padding-bottom:24px;:before{display:block;bottom:24px !important;}&:nth-of-type(2){padding-right:12px;}}"],j.breakpoints.medium,b(50,2),j.breakpoints.wide),Me=E()(oe).withConfig({displayName:"styles__StackedColumn",componentId:"sc-7y5fg-2"})(["margin-bottom:0;padding-bottom:0;:after{display:none;}@media (min-width:","px){display:flex;justify-content:space-between;}@media (min-width:","px){display:block;flex-shrink:0;width:",";margin-bottom:24px;padding-bottom:24px;padding-left:12px;:after{display:block;}}"],j.breakpoints.medium,j.breakpoints.wide,b(33.33,3)),Ue=E()(oe).withConfig({displayName:"styles__SlotContainer",componentId:"sc-7y5fg-3"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding:0 12px 24px 12px;:before{display:block;bottom:24px;}&:first-of-type{padding-left:0;}&:last-of-type{padding-right:0;:before{display:none;}}}@media (min-width:","px){width:100%;margin-bottom:12px;padding:0 0 12px 0;:before{display:none;}&:last-of-type{margin-bottom:0;padding-bottom:0;:after{display:none;}}}"],j.breakpoints.medium,b(50,2),j.breakpoints.wide);function $e(e){return function(e){if(Array.isArray(e))return qe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return qe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var We=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(Be,{styles:n},$e(Array(2)).fill(null).map((function(e,a){return r.a.createElement(Pe,{key:a,styles:n},r.a.createElement(re,{article:o()(t,"children[".concat(a,"].article")),displaySchema:h({sm:{imageRatio:"3:2",headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i}))})),r.a.createElement(Me,{styles:n},$e(Array(3)).fill(null).map((function(e,a){return r.a.createElement(Ue,{key:a,styles:n},r.a.createElement(re,{article:o()(t,"children[".concat(a+2,"].article")),displaySchema:h({sm:{isImageHidden:!0,imageRatio:"3:2",headlineFontSize:18},lg:{isSideBySide:!0,isImageHidden:!1,headlineFontSize:16},xlg:{headlineFontSize:18}}),clickHandler:i}))}))))})),Ye=E()(ae).withConfig({displayName:"styles__SliceContainer",componentId:"sc-11upv3n-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],j.breakpoints.wide),Ve=E()(oe).withConfig({displayName:"styles__SlotContainerLead",componentId:"sc-11upv3n-1"})(["@media (min-width:","px){width:",";&:first-of-type{padding-right:12px;:before{display:block;bottom:12px;}}&:nth-of-type(2){padding-left:12px;}}@media (min-width:","px){margin-bottom:24px;padding-bottom:24px;:before{display:block;bottom:24px !important;}&:nth-of-type(2){padding-right:12px;}}"],j.breakpoints.medium,b(50,2),j.breakpoints.wide),Ge=E()(oe).withConfig({displayName:"styles__StackedColumn",componentId:"sc-11upv3n-2"})(["margin-bottom:0;padding-bottom:0;:after{display:none;}@media (min-width:","px){display:flex;justify-content:space-between;}@media (min-width:","px){display:block;flex-shrink:0;width:",";margin-bottom:24px;padding-bottom:24px;padding-left:12px;:after{display:block;}}"],j.breakpoints.medium,j.breakpoints.wide,b(33.33,3)),Je=E()(oe).withConfig({displayName:"styles__SlotContainer",componentId:"sc-11upv3n-3"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding:0 12px 24px 12px;:before{display:block;bottom:24px;}&:first-of-type{padding-left:0;}&:last-of-type{padding-right:0;:before{display:none;}}}@media (min-width:","px){width:100%;margin-bottom:12px;padding:0 0 12px 0;:before{display:none;}&:last-of-type{margin-bottom:0;padding-bottom:0;:after{display:none;}}}"],j.breakpoints.medium,b(50,2),j.breakpoints.wide);function Ke(e){return function(e){if(Array.isArray(e))return Qe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Qe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var Xe=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(Ye,{styles:n},Ke(Array(2)).fill(null).map((function(e,a){return r.a.createElement(Ve,{key:a,styles:n},r.a.createElement(re,{article:o()(t,"children[".concat(a,"].article")),displaySchema:h({sm:{imageRatio:"3:2",headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i}))})),r.a.createElement(Ge,{styles:n},Ke(Array(3)).fill(null).map((function(e,a){return r.a.createElement(Je,{key:a,styles:n},r.a.createElement(re,{article:o()(t,"children[".concat(a+2,"].article")),displaySchema:h({sm:{isImageHidden:!0,headlineFontSize:18},lg:{headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i}))}))))})),Ze=E()(oe).withConfig({displayName:"styles__SlotContainer",componentId:"bazswq-0"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding:0 12px 24px 12px;:before{display:block;bottom:24px;}:after{display:block;}&:first-of-type{padding-left:0;}&:last-of-type{padding-right:0;&:before{display:none;}}}"],j.breakpoints.medium,b(33.33,3)),et=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(ae,{styles:n},t.children.map((function(e,t){return r.a.createElement(Ze,{key:t,styles:n,collapse:!e.article},r.a.createElement(re,{article:e.article,displaySchema:h({sm:{imageRatio:"3:2",headlineFontSize:22},md:{headlineFontSize:18},lg:{headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i}))})))})),tt=E()(oe).withConfig({displayName:"styles__SlotContainer",componentId:"sc-1gqjewy-0"})(["width:",";&:nth-of-type(odd){padding-right:12px;:before{display:block;bottom:12px;}}&:nth-of-type(even){padding-left:12px;}@media (min-width:","px){width:",";margin-bottom:24px;padding:0 12px 24px 12px;:before{display:block;bottom:24px !important;}&:first-of-type{padding-left:0;}&:last-of-type{padding-right:0;&:before{display:none;}}}"],b(50,2),j.breakpoints.medium,b(25,4)),nt=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(ae,{styles:n},t.children.map((function(e,t){return r.a.createElement(tt,{key:t,styles:n},r.a.createElement(re,{article:e.article,displaySchema:h({sm:{imageRatio:"3:2",headlineFontSize:18},lg:{headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i}))})))})),it=E()(ae).withConfig({displayName:"styles__SliceContainer",componentId:"c5tu9p-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],j.breakpoints.wide),rt=E()(oe).withConfig({displayName:"styles__SlotContainerLarge",componentId:"c5tu9p-1"})(["order:1;@media (min-width:","px){width:",";&:first-of-type{padding-right:12px;:before{display:block;bottom:12px;}}&:nth-of-type(3){padding-left:12px;}}@media (min-width:","px){flex-shrink:0;width:",";margin-bottom:24px;padding-bottom:24px;:before{display:block;bottom:24px !important;}&:nth-of-type(3){padding-right:12px;}}"],j.breakpoints.medium,b(50,2),j.breakpoints.wide,b(33.33,3)),at=E()(oe).withConfig({displayName:"styles__SlotContainerSmall",componentId:"c5tu9p-2"})(["order:2;@media (min-width:","px){width:",";margin-bottom:24px;padding-bottom:24px;&:nth-of-type(2){padding-right:12px;:before{display:block;bottom:24px;}}&:last-of-type{padding-left:12px;}}@media (min-width:","px){order:1;&:nth-of-type(2){padding-left:12px;:before{bottom:24px;}}}"],j.breakpoints.medium,b(50,2),j.breakpoints.wide);function ot(e){return function(e){if(Array.isArray(e))return lt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return lt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lt(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var ct=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(it,{styles:n},ot(Array(2)).fill(null).map((function(e,a){var l=o()(t,"children[".concat(2*a,"].article")),c=o()(t,"children[".concat(2*a+1,"].article"));return r.a.createElement(r.a.Fragment,{key:a},r.a.createElement(rt,{styles:n},r.a.createElement(re,{article:l,displaySchema:h({sm:{imageRatio:"3:2",headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i})),r.a.createElement(at,{styles:n},fe(c)?r.a.createElement(be,{article:c,displaySchema:h({sm:{isSideBySide:!0,sideBySideWidth:"35%",imageRatio:"1:1",headlineFontSize:18},md:{sideBySideWidth:"50%",headlineFontSize:16},lg:{isSideBySide:!1},xlg:{headlineFontSize:18}}),clickHandler:i}):r.a.createElement(re,{article:c,displaySchema:h({sm:{isImageHidden:!0,imageRatio:"3:2",headlineFontSize:18},md:{isImageHidden:!1,isSideBySide:!0,headlineFontSize:16},lg:{isSideBySide:!1},xlg:{headlineFontSize:18}}),clickHandler:i})))})))})),dt=E()(oe).withConfig({displayName:"styles__SlotContainer",componentId:"sc-189xcog-0"})(["width:",";&:nth-of-type(odd){padding-right:12px;:before{display:block;bottom:12px;}}&:nth-of-type(even){padding-left:12px;}@media (min-width:","px){width:",";margin-bottom:24px;padding:0 12px 24px 12px;:before{display:block;bottom:24px !important;}&:nth-of-type(5n + 1){padding-left:0;}&:nth-of-type(5n){padding-right:0;&:before{display:none;}}}"],b(50,2),j.breakpoints.medium,b(20,5)),st=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(ae,{styles:n},t.children.map((function(e,t){return r.a.createElement(dt,{key:t,styles:n},r.a.createElement(re,{article:o()(e,"article"),displaySchema:h({sm:{imageRatio:"3:2",headlineFontSize:18,isCentered:!0},lg:{headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i}))})))})),mt=function(e,t){var n=new Date(Date.UTC(t,e+1,0)),i=n.getDay(),r=n.getDate()-i,a=new Date(Date.UTC(t,e,r));return a.setHours(1),a},pt=function(e){if(e){var t=function(e){var t=new Date(e);return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes())}(e),n=Object(x.addMinutes)(t,function(e){var t=mt(2,e.getFullYear()),n=mt(9,e.getFullYear()),i=e.getTime()>=t.getTime(),r=e.getTime()<n.getTime();return i&&r}(t)?60:0);return Object(x.format)(n,"MMMM dd yyyy, h.mmaaa")}return null},ut=E.a.p.withConfig({displayName:"styles__DateTime",componentId:"sc-1p1alcs-0"})(["margin:8px 0 0 0;color:",";font-size:13px;line-height:16px;font-family:",";"],j.colours.functional.secondary,j.fonts.supporting),ft=E.a.p.withConfig({displayName:"styles__Byline",componentId:"sc-1p1alcs-1"})(["margin:8px 0 0 0;color:",";font-size:13px;line-height:16px;font-family:",";"],j.colours.functional.brandColour,j.fonts.supporting),ht=function(e){var t=e.article,n=e.displaySchema,i=e.clickHandler;if(!t)return null;var a=pt(t.datePublished);return r.a.createElement(K,{schema:n},r.a.createElement(Q,{schema:n},r.a.createElement(L,{article:t,displaySchema:n,clickHandler:i})),r.a.createElement(Q,{schema:n},t.label&&r.a.createElement(X,null,t.label),r.a.createElement($,{article:t,displaySchema:n,clickHandler:i}),a&&r.a.createElement(ut,null,a),t.byline&&r.a.createElement(ft,null,t.byline)))},yt=E()(ae).withConfig({displayName:"styles__SliceContainer",componentId:"b33h2c-0"})(["@media (min-width:","px){flex-wrap:nowrap;width:80.8%;max-width:none;padding:0;}@media (min-width:","px){width:56.2%;}"],j.breakpoints.medium,j.breakpoints.wide),gt=E()(oe).withConfig({displayName:"styles__SlotContainer",componentId:"b33h2c-1"})(["@media (min-width:","px){margin-bottom:24px;padding-right:0;padding-bottom:24px;}"],j.breakpoints.medium),bt=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(yt,{styles:n},r.a.createElement(gt,{styles:n},r.a.createElement(ht,{article:o()(t,"children[0].article"),displaySchema:h({sm:{imageRatio:"16:9",headlineFontSize:22},md:{isSideBySide:!0}}),clickHandler:i})))})),xt=E()(ae).withConfig({displayName:"styles__SliceContainer",componentId:"v1jynn-0"})(["@media (min-width:","px){width:80.8%;max-width:none;padding:0;}@media (min-width:","px){width:56.2%;}"],j.breakpoints.medium,j.breakpoints.wide),wt=E()(oe).withConfig({displayName:"styles__SlotContainer",componentId:"v1jynn-1"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding-bottom:24px;&:first-of-type{padding-right:12px;:before{display:block;bottom:24px;}}&:last-of-type{padding-left:12px;}}"],j.breakpoints.medium,b(50,2)),St=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(xt,{styles:n},t.children.map((function(e,t){return r.a.createElement(wt,{key:t,styles:n},r.a.createElement(ht,{article:e.article,displaySchema:h({sm:{isImageHidden:!0,imageRatio:"16:9",headlineFontSize:22},md:{isImageHidden:!1}}),clickHandler:i}))})))})),vt=E()(oe).withConfig({displayName:"styles__SlotContainer",componentId:"yjxerl-0"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding:0 12px 24px 12px;:before{display:block;bottom:24px;}:after{display:block;}&:first-of-type{padding-left:0;}&:last-of-type{padding-right:0;&:before{display:none;}}}"],j.breakpoints.medium,b(33.33,3)),_t=r.a.memo((function(e){var t=e.slice,n=e.styles,i=e.clickHandler;return r.a.createElement(ae,{styles:n},t.children.map((function(e,t){return r.a.createElement(vt,{key:t,styles:n},r.a.createElement(ht,{article:e.article,displaySchema:h({sm:{isImageHidden:!0,imageRatio:"16:9",headlineFontSize:22},md:{isImageHidden:!1}}),clickHandler:i}))})))})),kt=function(e){var t=e.slice,n=e.styles,i=e.clickHandler,a=function(e){switch(e){case"LEAD_1":case"LEAD_1_COMPONENT":case"INTERACTIVE_FULL_WIDTH":return de;case"LEAD_1_AND_1":case"LEAD_1_AND_1_COMPONENT":return ue;case"LEAD_1_AND_2":case"LEAD_1_AND_2_COLUMNIST":return ve;case"LEAD_1_AND_3_REVERSED":return ze;case"LEAD_2":case"LEAD_2_COMPONENT":case"INTERACTIVE_HALF_WIDTH":return je;case"SECONDARY_2_AND_2":return Le;case"SECONDARY_2_AND_3":return We;case"SECONDARY_2_AND_3_NO_PIC":return Xe;case"SECONDARY_3":return et;case"SECONDARY_4":return nt;case"SECONDARY_4_ODD":case"SECONDARY_4_ODD_COLUMNIST":return ct;case"SECONDARY_10":return st;case"RELATED_ARTICLE_1":return bt;case"RELATED_ARTICLE_2":return St;case"RELATED_ARTICLE_3":return _t;default:return function(){return null}}}(t.name);return r.a.createElement(a,{slice:t,styles:n,clickHandler:i})};n.d(t,"Slice",(function(){return kt}))}]);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { SliceArticle } from '../../../types/slice';
|
|
4
|
+
import { ClickHandlerType } from '../../../types/event';
|
|
5
|
+
import { DisplaySchema } from '../../../types/styles';
|
|
6
|
+
import { getDate } from '../../../utils/getDate';
|
|
7
|
+
|
|
8
|
+
import { Image } from '../../elements/Image/Image';
|
|
9
|
+
import { Headline } from '../../elements/Headline/Headline';
|
|
10
|
+
|
|
11
|
+
import { ArticleContainer, SideBySideColumn, Label } from '../shared-styles';
|
|
12
|
+
import { DateTime, Byline } from './styles';
|
|
13
|
+
|
|
14
|
+
export const ArticleStandard: React.FC<{
|
|
15
|
+
article?: SliceArticle;
|
|
16
|
+
displaySchema?: DisplaySchema;
|
|
17
|
+
clickHandler?: ClickHandlerType;
|
|
18
|
+
}> = ({ article, displaySchema, clickHandler }) => {
|
|
19
|
+
if (!article) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const date = getDate(article.datePublished);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<ArticleContainer schema={displaySchema}>
|
|
27
|
+
<SideBySideColumn schema={displaySchema}>
|
|
28
|
+
<Image
|
|
29
|
+
article={article}
|
|
30
|
+
displaySchema={displaySchema}
|
|
31
|
+
clickHandler={clickHandler}
|
|
32
|
+
/>
|
|
33
|
+
</SideBySideColumn>
|
|
34
|
+
<SideBySideColumn schema={displaySchema}>
|
|
35
|
+
{article.label && <Label>{article.label}</Label>}
|
|
36
|
+
<Headline
|
|
37
|
+
article={article}
|
|
38
|
+
displaySchema={displaySchema}
|
|
39
|
+
clickHandler={clickHandler}
|
|
40
|
+
/>
|
|
41
|
+
{date && <DateTime>{date}</DateTime>}
|
|
42
|
+
{article.byline && <Byline>{article.byline}</Byline>}
|
|
43
|
+
</SideBySideColumn>
|
|
44
|
+
</ArticleContainer>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
|
|
4
|
+
import { ArticleStandard } from '../ArticleStandard';
|
|
5
|
+
|
|
6
|
+
jest.mock('../../../elements/Image/Image', () => ({
|
|
7
|
+
Image: () => <div>Image</div>
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
jest.mock('../../../elements/Headline/Headline', () => ({
|
|
11
|
+
Headline: () => <div>Headline</div>
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
describe('<ArticleStandard />', () => {
|
|
15
|
+
afterAll(() => {
|
|
16
|
+
jest.clearAllMocks();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should render an article correctly', () => {
|
|
20
|
+
const article = {
|
|
21
|
+
images: { crops: [] },
|
|
22
|
+
label: 'Some text label',
|
|
23
|
+
byline: 'Some author',
|
|
24
|
+
headline: '',
|
|
25
|
+
datePublished: '2020-08-20T12:00:00.000Z',
|
|
26
|
+
url: ''
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const { asFragment, getByText } = render(
|
|
30
|
+
<ArticleStandard article={article} />
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
getByText('Image');
|
|
34
|
+
getByText(article.label);
|
|
35
|
+
getByText('Headline');
|
|
36
|
+
getByText('August 20 2020, 1.00pm');
|
|
37
|
+
getByText('Some author');
|
|
38
|
+
|
|
39
|
+
expect(asFragment()).toMatchSnapshot();
|
|
40
|
+
});
|
|
41
|
+
});
|
package/src/components/article/ArticleStandard/__tests__/__snapshots__/ArticleStandard.test.tsx.snap
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<ArticleStandard /> should render an article correctly 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<article
|
|
6
|
+
class="sc-bdVaJa febYmB"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="sc-bwzfXH iKKeUw"
|
|
10
|
+
>
|
|
11
|
+
<div>
|
|
12
|
+
Image
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div
|
|
16
|
+
class="sc-bwzfXH iKKeUw"
|
|
17
|
+
>
|
|
18
|
+
<p
|
|
19
|
+
class="sc-htpNat dtQRdf"
|
|
20
|
+
>
|
|
21
|
+
Some text label
|
|
22
|
+
</p>
|
|
23
|
+
<div>
|
|
24
|
+
Headline
|
|
25
|
+
</div>
|
|
26
|
+
<p
|
|
27
|
+
class="sc-bxivhb jpOhka"
|
|
28
|
+
>
|
|
29
|
+
August 20 2020, 1.00pm
|
|
30
|
+
</p>
|
|
31
|
+
<p
|
|
32
|
+
class="sc-ifAKCX bbXdqc"
|
|
33
|
+
>
|
|
34
|
+
Some author
|
|
35
|
+
</p>
|
|
36
|
+
</div>
|
|
37
|
+
</article>
|
|
38
|
+
</DocumentFragment>
|
|
39
|
+
`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { colours, fonts } from '@times-components/ts-styleguide';
|
|
3
|
+
|
|
4
|
+
export const DateTime = styled.p`
|
|
5
|
+
margin: 8px 0 0 0;
|
|
6
|
+
color: ${colours.functional.secondary};
|
|
7
|
+
font-size: 13px;
|
|
8
|
+
line-height: 16px;
|
|
9
|
+
font-family: ${fonts.supporting};
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
export const Byline = styled.p`
|
|
13
|
+
margin: 8px 0 0 0;
|
|
14
|
+
color: ${colours.functional.brandColour};
|
|
15
|
+
font-size: 13px;
|
|
16
|
+
line-height: 16px;
|
|
17
|
+
font-family: ${fonts.supporting};
|
|
18
|
+
`;
|
|
@@ -6,7 +6,7 @@ import { SliceStyle } from '../../../types/styles';
|
|
|
6
6
|
import { ClickHandlerType } from '../../../types/event';
|
|
7
7
|
import { setDisplaySchema } from '../../../utils/getArticleStyles';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { ArticleStandard } from '../../article/ArticleStandard/ArticleStandard';
|
|
10
10
|
|
|
11
11
|
import { SliceContainer, SlotContainer } from './styles';
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ const RelatedArticle1: React.FC<{
|
|
|
17
17
|
}> = React.memo(({ slice, styles, clickHandler }) => (
|
|
18
18
|
<SliceContainer styles={styles}>
|
|
19
19
|
<SlotContainer styles={styles}>
|
|
20
|
-
<
|
|
20
|
+
<ArticleStandard
|
|
21
21
|
article={get(slice, 'children[0].article')}
|
|
22
22
|
displaySchema={setDisplaySchema({
|
|
23
23
|
sm: { imageRatio: '16:9', headlineFontSize: 22 },
|
|
@@ -5,8 +5,8 @@ import { getSlice } from '../../../../fixtures/getSlice';
|
|
|
5
5
|
|
|
6
6
|
import RelatedArticle1 from '../RelatedArticle1';
|
|
7
7
|
|
|
8
|
-
jest.mock('../../../article/
|
|
9
|
-
|
|
8
|
+
jest.mock('../../../article/ArticleStandard/ArticleStandard', () => ({
|
|
9
|
+
ArticleStandard: () => <div>ArticleStandard</div>
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
12
|
describe('<RelatedArticle1 />', () => {
|
|
@@ -21,7 +21,7 @@ describe('<RelatedArticle1 />', () => {
|
|
|
21
21
|
<RelatedArticle1 slice={slice} />
|
|
22
22
|
);
|
|
23
23
|
|
|
24
|
-
const article = getAllByText('
|
|
24
|
+
const article = getAllByText('ArticleStandard');
|
|
25
25
|
expect(article.length).toBe(1);
|
|
26
26
|
|
|
27
27
|
expect(asFragment()).toMatchSnapshot();
|
|
@@ -5,7 +5,7 @@ import { SliceStyle } from '../../../types/styles';
|
|
|
5
5
|
import { ClickHandlerType } from '../../../types/event';
|
|
6
6
|
import { setDisplaySchema } from '../../../utils/getArticleStyles';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { ArticleStandard } from '../../article/ArticleStandard/ArticleStandard';
|
|
9
9
|
|
|
10
10
|
import { SliceContainer, SlotContainer } from './styles';
|
|
11
11
|
|
|
@@ -17,7 +17,7 @@ const RelatedArticle2: React.FC<{
|
|
|
17
17
|
<SliceContainer styles={styles}>
|
|
18
18
|
{slice.children.map((slot: SliceSlot, i: number) => (
|
|
19
19
|
<SlotContainer key={i} styles={styles}>
|
|
20
|
-
<
|
|
20
|
+
<ArticleStandard
|
|
21
21
|
article={slot.article}
|
|
22
22
|
displaySchema={setDisplaySchema({
|
|
23
23
|
sm: {
|
|
@@ -5,8 +5,8 @@ import { getSlice } from '../../../../fixtures/getSlice';
|
|
|
5
5
|
|
|
6
6
|
import RelatedArticle2 from '../RelatedArticle2';
|
|
7
7
|
|
|
8
|
-
jest.mock('../../../article/
|
|
9
|
-
|
|
8
|
+
jest.mock('../../../article/ArticleStandard/ArticleStandard', () => ({
|
|
9
|
+
ArticleStandard: () => <div>ArticleStandard</div>
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
12
|
describe('<RelatedArticle2 />', () => {
|
|
@@ -21,7 +21,7 @@ describe('<RelatedArticle2 />', () => {
|
|
|
21
21
|
<RelatedArticle2 slice={slice} />
|
|
22
22
|
);
|
|
23
23
|
|
|
24
|
-
const article = getAllByText('
|
|
24
|
+
const article = getAllByText('ArticleStandard');
|
|
25
25
|
expect(article.length).toBe(2);
|
|
26
26
|
|
|
27
27
|
expect(asFragment()).toMatchSnapshot();
|
package/src/components/slices/RelatedArticle2/__tests__/__snapshots__/RelatedArticle2.test.tsx.snap
CHANGED
|
@@ -9,14 +9,14 @@ exports[`<RelatedArticle2 /> should render an RELATED_ARTICLE_2 slice correctly
|
|
|
9
9
|
class="sc-bwzfXH sc-bxivhb ccFQOx"
|
|
10
10
|
>
|
|
11
11
|
<div>
|
|
12
|
-
|
|
12
|
+
ArticleStandard
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
15
|
<div
|
|
16
16
|
class="sc-bwzfXH sc-bxivhb ccFQOx"
|
|
17
17
|
>
|
|
18
18
|
<div>
|
|
19
|
-
|
|
19
|
+
ArticleStandard
|
|
20
20
|
</div>
|
|
21
21
|
</div>
|
|
22
22
|
</div>
|
|
@@ -5,7 +5,7 @@ import { SliceStyle } from '../../../types/styles';
|
|
|
5
5
|
import { ClickHandlerType } from '../../../types/event';
|
|
6
6
|
import { setDisplaySchema } from '../../../utils/getArticleStyles';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { ArticleStandard } from '../../article/ArticleStandard/ArticleStandard';
|
|
9
9
|
|
|
10
10
|
import { SliceContainer } from '../shared-styles';
|
|
11
11
|
import { SlotContainer } from './styles';
|
|
@@ -18,7 +18,7 @@ const RelatedArticle3: React.FC<{
|
|
|
18
18
|
<SliceContainer styles={styles}>
|
|
19
19
|
{slice.children.map((slot: SliceSlot, i: number) => (
|
|
20
20
|
<SlotContainer key={i} styles={styles}>
|
|
21
|
-
<
|
|
21
|
+
<ArticleStandard
|
|
22
22
|
article={slot.article}
|
|
23
23
|
displaySchema={setDisplaySchema({
|
|
24
24
|
sm: {
|
|
@@ -5,8 +5,8 @@ import { getSlice } from '../../../../fixtures/getSlice';
|
|
|
5
5
|
|
|
6
6
|
import RelatedArticle3 from '../RelatedArticle3';
|
|
7
7
|
|
|
8
|
-
jest.mock('../../../article/
|
|
9
|
-
|
|
8
|
+
jest.mock('../../../article/ArticleStandard/ArticleStandard', () => ({
|
|
9
|
+
ArticleStandard: () => <div>ArticleStandard</div>
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
12
|
describe('<RelatedArticle3 />', () => {
|
|
@@ -21,7 +21,7 @@ describe('<RelatedArticle3 />', () => {
|
|
|
21
21
|
<RelatedArticle3 slice={slice} />
|
|
22
22
|
);
|
|
23
23
|
|
|
24
|
-
const article = getAllByText('
|
|
24
|
+
const article = getAllByText('ArticleStandard');
|
|
25
25
|
expect(article.length).toBe(3);
|
|
26
26
|
|
|
27
27
|
expect(asFragment()).toMatchSnapshot();
|
package/src/components/slices/RelatedArticle3/__tests__/__snapshots__/RelatedArticle3.test.tsx.snap
CHANGED
|
@@ -9,21 +9,21 @@ exports[`<RelatedArticle3 /> should render an RELATED_ARTICLE_3 slice correctly
|
|
|
9
9
|
class="sc-bwzfXH sc-htpNat kmrygX"
|
|
10
10
|
>
|
|
11
11
|
<div>
|
|
12
|
-
|
|
12
|
+
ArticleStandard
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
15
|
<div
|
|
16
16
|
class="sc-bwzfXH sc-htpNat kmrygX"
|
|
17
17
|
>
|
|
18
18
|
<div>
|
|
19
|
-
|
|
19
|
+
ArticleStandard
|
|
20
20
|
</div>
|
|
21
21
|
</div>
|
|
22
22
|
<div
|
|
23
23
|
class="sc-bwzfXH sc-htpNat kmrygX"
|
|
24
24
|
>
|
|
25
25
|
<div>
|
|
26
|
-
|
|
26
|
+
ArticleStandard
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { format, addMinutes } from 'date-fns';
|
|
2
|
+
|
|
3
|
+
const lastSunday = (month: number, year: number) => {
|
|
4
|
+
const lastDayOfMonth = new Date(Date.UTC(year, month + 1, 0));
|
|
5
|
+
const day = lastDayOfMonth.getDay();
|
|
6
|
+
const dateOfSunday = lastDayOfMonth.getDate() - day;
|
|
7
|
+
const sunday = new Date(Date.UTC(year, month, dateOfSunday));
|
|
8
|
+
sunday.setHours(1);
|
|
9
|
+
return sunday;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const isBST = (date: Date) => {
|
|
13
|
+
const startOfBST = lastSunday(2, date.getFullYear());
|
|
14
|
+
const endOfBST = lastSunday(9, date.getFullYear());
|
|
15
|
+
const isAfterStartOfBST = date.getTime() >= startOfBST.getTime();
|
|
16
|
+
const isBeforeEndOfBST = date.getTime() < endOfBST.getTime();
|
|
17
|
+
return isAfterStartOfBST && isBeforeEndOfBST;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const getUTCTime = (date: string) => {
|
|
21
|
+
const localDate = new Date(date);
|
|
22
|
+
return new Date(
|
|
23
|
+
localDate.getUTCFullYear(),
|
|
24
|
+
localDate.getUTCMonth(),
|
|
25
|
+
localDate.getUTCDate(),
|
|
26
|
+
localDate.getUTCHours(),
|
|
27
|
+
localDate.getUTCMinutes()
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const getDate = (iso?: string) => {
|
|
32
|
+
if (iso) {
|
|
33
|
+
const utc = getUTCTime(iso);
|
|
34
|
+
const date = addMinutes(utc, isBST(utc) ? 60 : 0);
|
|
35
|
+
return format(date, 'MMMM dd yyyy, h.mmaaa');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return null;
|
|
39
|
+
};
|
package/tsconfig.json
CHANGED
|
@@ -32,10 +32,6 @@
|
|
|
32
32
|
"listFiles": false /* Print names of files part of the compilation. */,
|
|
33
33
|
"pretty": true /* Stylize errors and messages using color and context. */,
|
|
34
34
|
|
|
35
|
-
/* Experimental Options */
|
|
36
|
-
// "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */,
|
|
37
|
-
// "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */,
|
|
38
|
-
|
|
39
35
|
"lib": ["es6", "dom", "es2017"],
|
|
40
36
|
"types": ["jest"],
|
|
41
37
|
"typeRoots": ["node_modules/@types", "src/types", "../../node_modules/@types"]
|