@times-components/ts-slices 1.4.2 → 1.4.5
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 +27 -0
- package/dist/components/slices/RelatedArticle1/RelatedArticle1.d.ts +2 -2
- package/dist/components/slices/RelatedArticle1/RelatedArticle1.js +5 -10
- package/dist/components/slices/RelatedArticle1/styles.js +8 -1
- package/dist/components/slices/RelatedArticle2/RelatedArticle2.d.ts +10 -0
- package/dist/components/slices/RelatedArticle2/RelatedArticle2.js +15 -0
- package/dist/components/slices/RelatedArticle2/__tests__/RelatedArticle2.test.d.ts +1 -0
- package/dist/components/slices/RelatedArticle2/__tests__/RelatedArticle2.test.js +20 -0
- package/dist/components/slices/RelatedArticle2/styles.d.ts +7 -0
- package/dist/components/slices/RelatedArticle2/styles.js +36 -0
- package/dist/components/slices/RelatedArticle3/RelatedArticle3.d.ts +10 -0
- package/dist/components/slices/RelatedArticle3/RelatedArticle3.js +16 -0
- package/dist/components/slices/RelatedArticle3/__tests__/RelatedArticle3.test.d.ts +1 -0
- package/dist/components/slices/RelatedArticle3/__tests__/RelatedArticle3.test.js +20 -0
- package/dist/components/slices/RelatedArticle3/styles.d.ts +4 -0
- package/dist/components/slices/RelatedArticle3/styles.js +33 -0
- package/dist/components/slices/Slice.stories.js +11 -1
- package/dist/fixtures/getSlice.js +20 -5
- package/dist/utils/getSlice.js +7 -1
- package/package.json +4 -4
- package/rnw.js +1 -1
- package/src/components/slices/RelatedArticle1/RelatedArticle1.tsx +4 -9
- package/src/components/slices/RelatedArticle1/__tests__/__snapshots__/RelatedArticle1.test.tsx.snap +1 -1
- package/src/components/slices/RelatedArticle1/styles.ts +7 -0
- package/src/components/slices/RelatedArticle2/RelatedArticle2.tsx +37 -0
- package/src/components/slices/RelatedArticle2/__tests__/RelatedArticle2.test.tsx +29 -0
- package/src/components/slices/RelatedArticle2/__tests__/__snapshots__/RelatedArticle2.test.tsx.snap +24 -0
- package/src/components/slices/RelatedArticle2/styles.ts +42 -0
- package/src/components/slices/RelatedArticle3/RelatedArticle3.tsx +38 -0
- package/src/components/slices/RelatedArticle3/__tests__/RelatedArticle3.test.tsx +29 -0
- package/src/components/slices/RelatedArticle3/__tests__/__snapshots__/RelatedArticle3.test.tsx.snap +31 -0
- package/src/components/slices/RelatedArticle3/styles.ts +35 -0
- package/src/components/slices/Slice.stories.tsx +14 -0
- package/src/fixtures/getSlice.ts +19 -4
- package/src/utils/getSlice.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
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.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
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **TDP-2268:** Double tracking bug - replace slice ([#3059](https://github.com/newsuk/times-components/issues/3059)) ([70783ce](https://github.com/newsuk/times-components/commit/70783ced2727227d0b41ce772307f9e9bc27fa15))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.4.4](https://github.com/newsuk/times-components/compare/@times-components/ts-slices@1.4.3...@times-components/ts-slices@1.4.4) (2022-07-19)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @times-components/ts-slices
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [1.4.3](https://github.com/newsuk/times-components/compare/@times-components/ts-slices@1.4.2...@times-components/ts-slices@1.4.3) (2022-07-18)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @times-components/ts-slices
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [1.4.2](https://github.com/newsuk/times-components/compare/@times-components/ts-slices@1.4.1...@times-components/ts-slices@1.4.2) (2022-07-14)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @times-components/ts-slices
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { SliceData } from '../../../types/slice';
|
|
3
3
|
import { SliceStyle } from '../../../types/styles';
|
|
4
4
|
import { ClickHandlerType } from '../../../types/event';
|
|
5
|
-
declare const
|
|
5
|
+
declare const RelatedArticle1: React.FC<{
|
|
6
6
|
slice: SliceData;
|
|
7
7
|
styles?: SliceStyle;
|
|
8
8
|
clickHandler?: ClickHandlerType;
|
|
9
9
|
}>;
|
|
10
|
-
export default
|
|
10
|
+
export default RelatedArticle1;
|
|
@@ -3,16 +3,11 @@ import get from 'lodash.get';
|
|
|
3
3
|
import { setDisplaySchema } from '../../../utils/getArticleStyles';
|
|
4
4
|
import { Article } from '../../article/Article/Article';
|
|
5
5
|
import { SliceContainer, SlotContainer } from './styles';
|
|
6
|
-
const
|
|
6
|
+
const RelatedArticle1 = React.memo(({ slice, styles, clickHandler }) => (React.createElement(SliceContainer, { styles: styles },
|
|
7
7
|
React.createElement(SlotContainer, { styles: styles },
|
|
8
8
|
React.createElement(Article, { article: get(slice, 'children[0].article'), displaySchema: setDisplaySchema({
|
|
9
|
-
sm: {
|
|
10
|
-
|
|
11
|
-
headlineFontSize: 28
|
|
12
|
-
},
|
|
13
|
-
md: { isSideBySide: true },
|
|
14
|
-
lg: { headlineFontSize: 32 },
|
|
15
|
-
xlg: { headlineFontSize: 36 }
|
|
9
|
+
sm: { imageRatio: '16:9', headlineFontSize: 22 },
|
|
10
|
+
md: { isSideBySide: true }
|
|
16
11
|
}), clickHandler: clickHandler })))));
|
|
17
|
-
export default
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
12
|
+
export default RelatedArticle1;
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaW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ZUFBZSxlQUFlLENBQUMifQ==
|
|
@@ -4,6 +4,13 @@ import { SliceContainer as SliceContainerBase, SlotContainer as SlotContainerBas
|
|
|
4
4
|
export const SliceContainer = styled(SliceContainerBase) `
|
|
5
5
|
@media (min-width: ${breakpoints.medium}px) {
|
|
6
6
|
flex-wrap: nowrap;
|
|
7
|
+
width: 80.8%;
|
|
8
|
+
max-width: none;
|
|
9
|
+
padding: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media (min-width: ${breakpoints.wide}px) {
|
|
13
|
+
width: 56.2%;
|
|
7
14
|
}
|
|
8
15
|
`;
|
|
9
16
|
export const SlotContainer = styled(SlotContainerBase) `
|
|
@@ -13,4 +20,4 @@ export const SlotContainer = styled(SlotContainerBase) `
|
|
|
13
20
|
padding-bottom: 24px;
|
|
14
21
|
}
|
|
15
22
|
`;
|
|
16
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3R5bGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvc2xpY2VzL1JlbGF0ZWRBcnRpY2xlMS9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxNQUFNLE1BQU0sbUJBQW1CLENBQUM7QUFDdkMsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRTlELE9BQU8sRUFDTCxjQUFjLElBQUksa0JBQWtCLEVBQ3BDLGFBQWEsSUFBSSxpQkFBaUIsRUFDbkMsTUFBTSxrQkFBa0IsQ0FBQztBQUUxQixNQUFNLENBQUMsTUFBTSxjQUFjLEdBQUcsTUFBTSxDQUFDLGtCQUFrQixDQUFDLENBQUE7dUJBQ2pDLFdBQVcsQ0FBQyxNQUFNOzs7Ozs7O3VCQU9sQixXQUFXLENBQUMsSUFBSTs7O0NBR3RDLENBQUM7QUFFRixNQUFNLENBQUMsTUFBTSxhQUFhLEdBQUcsTUFBTSxDQUFDLGlCQUFpQixDQUFDLENBQUE7dUJBQy9CLFdBQVcsQ0FBQyxNQUFNOzs7OztDQUt4QyxDQUFDIn0=
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SliceData } from '../../../types/slice';
|
|
3
|
+
import { SliceStyle } from '../../../types/styles';
|
|
4
|
+
import { ClickHandlerType } from '../../../types/event';
|
|
5
|
+
declare const RelatedArticle2: React.FC<{
|
|
6
|
+
slice: SliceData;
|
|
7
|
+
styles?: SliceStyle;
|
|
8
|
+
clickHandler?: ClickHandlerType;
|
|
9
|
+
}>;
|
|
10
|
+
export default RelatedArticle2;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { setDisplaySchema } from '../../../utils/getArticleStyles';
|
|
3
|
+
import { Article } from '../../article/Article/Article';
|
|
4
|
+
import { SliceContainer, SlotContainer } from './styles';
|
|
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(Article, { article: slot.article, displaySchema: setDisplaySchema({
|
|
7
|
+
sm: {
|
|
8
|
+
isImageHidden: true,
|
|
9
|
+
imageRatio: '16:9',
|
|
10
|
+
headlineFontSize: 22
|
|
11
|
+
},
|
|
12
|
+
md: { isImageHidden: false }
|
|
13
|
+
}), clickHandler: clickHandler })))))));
|
|
14
|
+
export default RelatedArticle2;
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVsYXRlZEFydGljbGUyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvc2xpY2VzL1Jl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WUsQ0FBQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { getSlice } from '../../../../fixtures/getSlice';
|
|
4
|
+
import RelatedArticle2 from '../RelatedArticle2';
|
|
5
|
+
jest.mock('../../../article/Article/Article', () => ({
|
|
6
|
+
Article: () => React.createElement("div", null, "Article")
|
|
7
|
+
}));
|
|
8
|
+
describe('<RelatedArticle2 />', () => {
|
|
9
|
+
afterAll(() => {
|
|
10
|
+
jest.clearAllMocks();
|
|
11
|
+
});
|
|
12
|
+
it('should render an RELATED_ARTICLE_2 slice correctly', () => {
|
|
13
|
+
const slice = getSlice('RELATED_ARTICLE_2');
|
|
14
|
+
const { asFragment, getAllByText } = render(React.createElement(RelatedArticle2, { slice: slice }));
|
|
15
|
+
const article = getAllByText('Article');
|
|
16
|
+
expect(article.length).toBe(2);
|
|
17
|
+
expect(asFragment()).toMatchSnapshot();
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVsYXRlZEFydGljbGUyLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvY29tcG9uZW50cy9zbGljZXMvUmVsYXRlZEFydGljbGUyL19fdGVzdHNfXy9SZWxhdGVkQXJ0aWNsZTIudGVzdC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE1BQU0sT0FBTyxDQUFDO0FBQzFCLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVoRCxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFekQsT0FBTyxlQUFlLE1BQU0sb0JBQW9CLENBQUM7QUFFakQsSUFBSSxDQUFDLElBQUksQ0FBQyxrQ0FBa0MsRUFBRSxHQUFHLEVBQUUsQ0FBQyxDQUFDO0lBQ25ELE9BQU8sRUFBRSxHQUFHLEVBQUUsQ0FBQywyQ0FBa0I7Q0FDbEMsQ0FBQyxDQUFDLENBQUM7QUFFSixRQUFRLENBQUMscUJBQXFCLEVBQUUsR0FBRyxFQUFFO0lBQ25DLFFBQVEsQ0FBQyxHQUFHLEVBQUU7UUFDWixJQUFJLENBQUMsYUFBYSxFQUFFLENBQUM7SUFDdkIsQ0FBQyxDQUFDLENBQUM7SUFFSCxFQUFFLENBQUMsb0RBQW9ELEVBQUUsR0FBRyxFQUFFO1FBQzVELE1BQU0sS0FBSyxHQUFHLFFBQVEsQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDO1FBRTVDLE1BQU0sRUFBRSxVQUFVLEVBQUUsWUFBWSxFQUFFLEdBQUcsTUFBTSxDQUN6QyxvQkFBQyxlQUFlLElBQUMsS0FBSyxFQUFFLEtBQUssR0FBSSxDQUNsQyxDQUFDO1FBRUYsTUFBTSxPQUFPLEdBQUcsWUFBWSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBQ3hDLE1BQU0sQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBRS9CLE1BQU0sQ0FBQyxVQUFVLEVBQUUsQ0FBQyxDQUFDLGVBQWUsRUFBRSxDQUFDO0lBQ3pDLENBQUMsQ0FBQyxDQUFDO0FBQ0wsQ0FBQyxDQUFDLENBQUMifQ==
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const SliceContainer: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
styles?: import("../../../types/styles").SliceStyle | undefined;
|
|
3
|
+
}, never>;
|
|
4
|
+
export declare const SlotContainer: import("styled-components").StyledComponent<"div", any, {
|
|
5
|
+
styles?: import("../../../types/styles").SliceStyle | undefined;
|
|
6
|
+
collapse?: boolean | undefined;
|
|
7
|
+
}, never>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { breakpoints } from '@times-components/ts-styleguide';
|
|
3
|
+
import { calculateSlotWidth } from '../../../utils/getArticleStyles';
|
|
4
|
+
import { SliceContainer as SliceContainerBase, SlotContainer as SlotContainerBase } from '../shared-styles';
|
|
5
|
+
export const SliceContainer = styled(SliceContainerBase) `
|
|
6
|
+
@media (min-width: ${breakpoints.medium}px) {
|
|
7
|
+
width: 80.8%;
|
|
8
|
+
max-width: none;
|
|
9
|
+
padding: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media (min-width: ${breakpoints.wide}px) {
|
|
13
|
+
width: 56.2%;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
export const SlotContainer = styled(SlotContainerBase) `
|
|
17
|
+
@media (min-width: ${breakpoints.medium}px) {
|
|
18
|
+
width: ${calculateSlotWidth(50, 2)};
|
|
19
|
+
margin-bottom: 24px;
|
|
20
|
+
padding-bottom: 24px;
|
|
21
|
+
|
|
22
|
+
&:first-of-type {
|
|
23
|
+
padding-right: 12px;
|
|
24
|
+
|
|
25
|
+
:before {
|
|
26
|
+
display: block;
|
|
27
|
+
bottom: 24px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:last-of-type {
|
|
32
|
+
padding-left: 12px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3R5bGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvc2xpY2VzL1JlbGF0ZWRBcnRpY2xlMi9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxNQUFNLE1BQU0sbUJBQW1CLENBQUM7QUFDdkMsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRTlELE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRXJFLE9BQU8sRUFDTCxjQUFjLElBQUksa0JBQWtCLEVBQ3BDLGFBQWEsSUFBSSxpQkFBaUIsRUFDbkMsTUFBTSxrQkFBa0IsQ0FBQztBQUUxQixNQUFNLENBQUMsTUFBTSxjQUFjLEdBQUcsTUFBTSxDQUFDLGtCQUFrQixDQUFDLENBQUE7dUJBQ2pDLFdBQVcsQ0FBQyxNQUFNOzs7Ozs7dUJBTWxCLFdBQVcsQ0FBQyxJQUFJOzs7Q0FHdEMsQ0FBQztBQUVGLE1BQU0sQ0FBQyxNQUFNLGFBQWEsR0FBRyxNQUFNLENBQUMsaUJBQWlCLENBQUMsQ0FBQTt1QkFDL0IsV0FBVyxDQUFDLE1BQU07YUFDNUIsa0JBQWtCLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQzs7Ozs7Ozs7Ozs7Ozs7Ozs7Q0FpQnJDLENBQUMifQ==
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SliceData } from '../../../types/slice';
|
|
3
|
+
import { SliceStyle } from '../../../types/styles';
|
|
4
|
+
import { ClickHandlerType } from '../../../types/event';
|
|
5
|
+
declare const RelatedArticle3: React.FC<{
|
|
6
|
+
slice: SliceData;
|
|
7
|
+
styles?: SliceStyle;
|
|
8
|
+
clickHandler?: ClickHandlerType;
|
|
9
|
+
}>;
|
|
10
|
+
export default RelatedArticle3;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { setDisplaySchema } from '../../../utils/getArticleStyles';
|
|
3
|
+
import { Article } from '../../article/Article/Article';
|
|
4
|
+
import { SliceContainer } from '../shared-styles';
|
|
5
|
+
import { SlotContainer } from './styles';
|
|
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(Article, { article: slot.article, displaySchema: setDisplaySchema({
|
|
8
|
+
sm: {
|
|
9
|
+
isImageHidden: true,
|
|
10
|
+
imageRatio: '16:9',
|
|
11
|
+
headlineFontSize: 22
|
|
12
|
+
},
|
|
13
|
+
md: { isImageHidden: false }
|
|
14
|
+
}), clickHandler: clickHandler })))))));
|
|
15
|
+
export default RelatedArticle3;
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVsYXRlZEFydGljbGUzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvc2xpY2VzL1JlbGF0ZWRBcnRpY2xlMy9SZWxhdGVkQXJ0aWNsZTMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxNQUFNLE9BQU8sQ0FBQztBQUsxQixPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUVuRSxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFeEQsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQ2xELE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFFekMsTUFBTSxlQUFlLEdBSWhCLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsWUFBWSxFQUFFLEVBQUUsRUFBRSxDQUFDLENBQ25ELG9CQUFDLGNBQWMsSUFBQyxNQUFNLEVBQUUsTUFBTSxJQUMzQixLQUFLLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQWUsRUFBRSxDQUFTLEVBQUUsRUFBRSxDQUFDLENBQ2xELG9CQUFDLGFBQWEsSUFBQyxHQUFHLEVBQUUsQ0FBQyxFQUFFLE1BQU0sRUFBRSxNQUFNO0lBQ25DLG9CQUFDLE9BQU8sSUFDTixPQUFPLEVBQUUsSUFBSSxDQUFDLE9BQU8sRUFDckIsYUFBYSxFQUFFLGdCQUFnQixDQUFDO1lBQzlCLEVBQUUsRUFBRTtnQkFDRixhQUFhLEVBQUUsSUFBSTtnQkFDbkIsVUFBVSxFQUFFLE1BQU07Z0JBQ2xCLGdCQUFnQixFQUFFLEVBQUU7YUFDckI7WUFDRCxFQUFFLEVBQUUsRUFBRSxhQUFhLEVBQUUsS0FBSyxFQUFFO1NBQzdCLENBQUMsRUFDRixZQUFZLEVBQUUsWUFBWSxHQUMxQixDQUNZLENBQ2pCLENBQUMsQ0FDYSxDQUNsQixDQUFDLENBQUM7QUFFSCxlQUFlLGVBQWUsQ0FBQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { getSlice } from '../../../../fixtures/getSlice';
|
|
4
|
+
import RelatedArticle3 from '../RelatedArticle3';
|
|
5
|
+
jest.mock('../../../article/Article/Article', () => ({
|
|
6
|
+
Article: () => React.createElement("div", null, "Article")
|
|
7
|
+
}));
|
|
8
|
+
describe('<RelatedArticle3 />', () => {
|
|
9
|
+
afterAll(() => {
|
|
10
|
+
jest.clearAllMocks();
|
|
11
|
+
});
|
|
12
|
+
it('should render an RELATED_ARTICLE_3 slice correctly', () => {
|
|
13
|
+
const slice = getSlice('RELATED_ARTICLE_3');
|
|
14
|
+
const { asFragment, getAllByText } = render(React.createElement(RelatedArticle3, { slice: slice }));
|
|
15
|
+
const article = getAllByText('Article');
|
|
16
|
+
expect(article.length).toBe(3);
|
|
17
|
+
exp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QUssR0FBSSxDQUNsQyxDQUFDO1FBRUYsTUFBTSxPQUFPLEdBQUcsWUFBWSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBQ3hDLE1BQU0sQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBRS9CLE1BQU0sQ0FBQyxVQUFVLEVBQUUsQ0FBQyxDQUFDLGVBQWUsRUFBRSxDQUFDO0lBQ3pDLENBQUMsQ0FBQyxDQUFDO0FBQ0wsQ0FBQyxDQUFDLENBQUMifQ==
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { breakpoints } from '@times-components/ts-styleguide';
|
|
3
|
+
import { calculateSlotWidth } from '../../../utils/getArticleStyles';
|
|
4
|
+
import { SlotContainer as SlotContainerBase } from '../shared-styles';
|
|
5
|
+
export const SlotContainer = styled(SlotContainerBase) `
|
|
6
|
+
@media (min-width: ${breakpoints.medium}px) {
|
|
7
|
+
width: ${calculateSlotWidth(33.33, 3)};
|
|
8
|
+
margin-bottom: 24px;
|
|
9
|
+
padding: 0 12px 24px 12px;
|
|
10
|
+
|
|
11
|
+
:before {
|
|
12
|
+
display: block;
|
|
13
|
+
bottom: 24px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:after {
|
|
17
|
+
display: block;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:first-of-type {
|
|
21
|
+
padding-left: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:last-of-type {
|
|
25
|
+
padding-right: 0;
|
|
26
|
+
|
|
27
|
+
&:before {
|
|
28
|
+
display: none;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3R5bGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvc2xpY2VzL1JlbGF0ZWRBcnRpY2xlMy9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxNQUFNLE1BQU0sbUJBQW1CLENBQUM7QUFDdkMsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRTlELE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRXJFLE9BQU8sRUFBRSxhQUFhLElBQUksaUJBQWlCLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUV0RSxNQUFNLENBQUMsTUFBTSxhQUFhLEdBQUcsTUFBTSxDQUFDLGlCQUFpQixDQUFDLENBQUE7dUJBQy9CLFdBQVcsQ0FBQyxNQUFNO2FBQzVCLGtCQUFrQixDQUFDLEtBQUssRUFBRSxDQUFDLENBQUM7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Q0F5QnhDLENBQUMifQ==
|
|
@@ -86,10 +86,20 @@ const showcase = {
|
|
|
86
86
|
component: () => (React.createElement(Slice, { slice: getSlice('RELATED_ARTICLE_1'), clickHandler: onClick })),
|
|
87
87
|
name: 'RELATED_ARTICLE_1',
|
|
88
88
|
type: 'story'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
component: () => (React.createElement(Slice, { slice: getSlice('RELATED_ARTICLE_2'), clickHandler: onClick })),
|
|
92
|
+
name: 'RELATED_ARTICLE_2',
|
|
93
|
+
type: 'story'
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
component: () => (React.createElement(Slice, { slice: getSlice('RELATED_ARTICLE_3'), clickHandler: onClick })),
|
|
97
|
+
name: 'RELATED_ARTICLE_3',
|
|
98
|
+
type: 'story'
|
|
89
99
|
}
|
|
90
100
|
],
|
|
91
101
|
name: 'Typescript Slices/Slices'
|
|
92
102
|
};
|
|
93
103
|
// @ts-ignore
|
|
94
104
|
showcaseConverter(module, showcase);
|
|
95
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
105
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2xpY2Uuc3Rvcmllcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL3NsaWNlcy9TbGljZS5zdG9yaWVzLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssTUFBTSxPQUFPLENBQUM7QUFDMUIsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFFaEUsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLCtDQUErQyxDQUFDO0FBQy9FLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUVuRCxPQUFPLEVBQUUsS0FBSyxFQUFFLE1BQU0sU0FBUyxDQUFDO0FBRWhDLE1BQU0sT0FBTyxHQUFHLENBQUMsS0FBdUIsRUFBRSxFQUFFO0lBQzFDLEtBQUssQ0FBQyxjQUFjLEVBQUUsQ0FBQztBQUN6QixDQUFDLENBQUM7QUFFRixNQUFNLFFBQVEsR0FBRztJQUNmLFFBQVEsRUFBRTtRQUNSO1lBQ0UsU0FBUyxFQUFFLENBQUMsT0FBOEIsRUFBRSxFQUFFLENBQUMsQ0FDN0Msb0JBQUMsY0FBYyxRQUFFLE9BQU8sRUFBRSxDQUFrQixDQUM3QztZQUNELElBQUksRUFBRSxXQUFXO1NBQ2xCO1FBQ0Q7WUFDRSxTQUFTLEVBQUUsR0FBRyxFQUFFLENBQUMsQ0FDZixvQkFBQyxLQUFLLElBQUMsS0FBSyxFQUFFLFFBQVEsQ0FBQyxRQUFRLENBQUMsRUFBRSxZQUFZLEVBQUUsT0FBTyxHQUFJLENBQzVEO1lBQ0QsSU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UI7WUFDekIsSUFBSSxFQUFFLE9BQU87U0FDZDtRQUNEO1lBQ0UsU0FBUyxFQUFFLEdBQUcsRUFBRSxDQUFDLENBQ2Ysb0JBQUMsS0FBSyxJQUFDLEtBQUssRUFBRSxRQUFRLENBQUMsbUJBQW1CLENBQUMsRUFBRSxZQUFZLEVBQUUsT0FBTyxHQUFJLENBQ3ZFO1lBQ0QsSUFBSSxFQUFFLG1CQUFtQjtZQUN6QixJQUFJLEVBQUUsT0FBTztTQUNkO1FBQ0Q7WUFDRSxTQUFTLEVBQUUsR0FBRyxFQUFFLENBQUMsQ0FDZixvQkFBQyxLQUFLLElBQUMsS0FBSyxFQUFFLFFBQVEsQ0FBQyxtQkFBbUIsQ0FBQyxFQUFFLFlBQVksRUFBRSxPQUFPLEdBQUksQ0FDdkU7WUFDRCxJQUFJLEVBQUUsbUJBQW1CO1lBQ3pCLElBQUksRUFBRSxPQUFPO1NBQ2Q7S0FDRjtJQUNELElBQUksRUFBRSwwQkFBMEI7Q0FDakMsQ0FBQztBQUVGLGFBQWE7QUFDYixpQkFBaUIsQ0FBQyxNQUFNLEVBQUUsUUFBUSxDQUFDLENBQUMifQ==
|
|
@@ -4,10 +4,6 @@ const slices = [
|
|
|
4
4
|
name: 'LEAD_1',
|
|
5
5
|
children: [{ article: getArticleWithSummary() }]
|
|
6
6
|
},
|
|
7
|
-
{
|
|
8
|
-
name: 'RELATED_ARTICLE_1',
|
|
9
|
-
children: [{ article: getArticleWithSummary() }]
|
|
10
|
-
},
|
|
11
7
|
{
|
|
12
8
|
name: 'LEAD_1_AND_1',
|
|
13
9
|
children: [{ article: getArticle() }, { article: getArticleWithSummary() }]
|
|
@@ -119,10 +115,29 @@ const slices = [
|
|
|
119
115
|
{ article: getArticle() },
|
|
120
116
|
{ article: getArticle() }
|
|
121
117
|
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'RELATED_ARTICLE_1',
|
|
121
|
+
children: [{ article: getArticleWithSummary() }]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'RELATED_ARTICLE_2',
|
|
125
|
+
children: [
|
|
126
|
+
{ article: getArticleWithSummary() },
|
|
127
|
+
{ article: getArticleWithSummary() }
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'RELATED_ARTICLE_3',
|
|
132
|
+
children: [
|
|
133
|
+
{ article: getArticleWithSummary() },
|
|
134
|
+
{ article: getArticleWithSummary() },
|
|
135
|
+
{ article: getArticleWithSummary() }
|
|
136
|
+
]
|
|
122
137
|
}
|
|
123
138
|
];
|
|
124
139
|
export const getSlice = (name) => {
|
|
125
140
|
const slice = slices.find((s) => s.name === name);
|
|
126
141
|
return slice ? slice : { name: 'UNDEFINED', children: [] };
|
|
127
142
|
};
|
|
128
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
143
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0U2xpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZml4dHVyZXMvZ2V0U2xpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUNMLFVBQVUsRUFDVixxQkFBcUIsRUFDckIsaUJBQWlCLEVBQ2xCLE1BQU0sY0FBYyxDQUFDO0FBRXRCLE1BQU0sTUFBTSxHQUFnQjtJQUMxQjtRQUNFLElBQUksRUFBRSxRQUFRO1FBQ2QsUUFBUSxFQUFFLENBQUMsRUFBRSxPQUFPLEVBQUUscUJBQXFCLEVBQUUsRUFBRSxDQUFDO0tBQ2pEO0lBQ0Q7UUFDRSxJQUFJLEVBQUUsY0FBYztRQUNwQixRQUFRLEVBQUUsQ0FBQyxFQUFFLE9BQU8sRUFBRSxVQUFVLEVBQUUsRUFBRSxFQUFFLEVBQUUsT0FBTyxFQUFFLHFCQUFxQixFQUFFLEVBQUUsQ0FBQztLQUM1RTtJQUN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VyxFQUFFLFFBQVEsRUFBRSxFQUFFLEVBQUUsQ0FBQztBQUM3RCxDQUFDLENBQUMifQ==
|
package/dist/utils/getSlice.js
CHANGED
|
@@ -11,6 +11,8 @@ import Secondary4 from '../components/slices/Secondary4/Secondary4';
|
|
|
11
11
|
import Secondary4Odd from '../components/slices/Secondary4Odd/Secondary4Odd';
|
|
12
12
|
import Secondary10 from '../components/slices/Secondary10/Secondary10';
|
|
13
13
|
import RelatedArticle1 from '../components/slices/RelatedArticle1/RelatedArticle1';
|
|
14
|
+
import RelatedArticle2 from '../components/slices/RelatedArticle2/RelatedArticle2';
|
|
15
|
+
import RelatedArticle3 from '../components/slices/RelatedArticle3/RelatedArticle3';
|
|
14
16
|
export const getSliceComponent = (name) => {
|
|
15
17
|
switch (name) {
|
|
16
18
|
case 'LEAD_1':
|
|
@@ -46,8 +48,12 @@ export const getSliceComponent = (name) => {
|
|
|
46
48
|
return Secondary10;
|
|
47
49
|
case 'RELATED_ARTICLE_1':
|
|
48
50
|
return RelatedArticle1;
|
|
51
|
+
case 'RELATED_ARTICLE_2':
|
|
52
|
+
return RelatedArticle2;
|
|
53
|
+
case 'RELATED_ARTICLE_3':
|
|
54
|
+
return RelatedArticle3;
|
|
49
55
|
default:
|
|
50
56
|
return () => null;
|
|
51
57
|
}
|
|
52
58
|
};
|
|
53
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
59
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0U2xpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvZ2V0U2xpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBTUEsT0FBTyxLQUFLLE1BQU0sa0NBQWtDLENBQUM7QUFDckQsT0FBTyxTQUFTLE1BQU0sMENBQTBDLENBQUM7QUFDakUsT0FBTyxTQUFTLE1BQU0sMENBQTBDLENBQUM7QUFDakUsT0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ssQ0FBQztRQUNmLEtBQUssbUJBQW1CO1lBQ3RCLE9BQU8sY0FBYyxDQUFDO1FBQ3hCLEtBQUssbUJBQW1CO1lBQ3RCLE9BQU8sY0FBYyxDQUFDO1FBQ3hCLEtBQUssMEJBQTBCO1lBQzdCLE9BQU8sbUJBQW1CLENBQUM7UUFDN0IsS0FBSyxhQUFhO1lBQ2hCLE9BQU8sVUFBVSxDQUFDO1FBQ3BCLEtBQUssYUFBYTtZQUNoQixPQUFPLFVBQVUsQ0FBQztRQUNwQixLQUFLLGlCQUFpQixDQUFDO1FBQ3ZCLEtBQUssMkJBQTJCO1lBQzlCLE9BQU8sYUFBYSxDQUFDO1FBQ3ZCLEtBQUssY0FBYztZQUNqQixPQUFPLFdBQVcsQ0FBQztRQUNyQixLQUFLLG1CQUFtQjtZQUN0QixPQUFPLGVBQWUsQ0FBQztRQUN6QixLQUFLLG1CQUFtQjtZQUN0QixPQUFPLGVBQWUsQ0FBQztRQUN6QixLQUFLLG1CQUFtQjtZQUN0QixPQUFPLGVBQWUsQ0FBQztRQUV6QjtZQUNFLE9BQU8sR0FBRyxFQUFFLENBQUMsSUFBSSxDQUFDO0tBQ3JCO0FBQ0gsQ0FBQyxDQUFDIn0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/ts-slices",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"description": "Reuseable Typescript React Components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"dev": "dist/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"node": ">=8.9"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@times-components/ts-styleguide": "1.36.
|
|
53
|
+
"@times-components/ts-styleguide": "1.36.8",
|
|
54
54
|
"date-fns": "2.28.0",
|
|
55
55
|
"lodash.get": "4.4.2",
|
|
56
56
|
"react": "16.9.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@testing-library/react": "^12.1.2",
|
|
61
|
-
"@times-components/storybook": "4.
|
|
61
|
+
"@times-components/storybook": "4.4.0",
|
|
62
62
|
"@types/jest": "24.9.1",
|
|
63
63
|
"@types/lodash.get": "4.4.6",
|
|
64
64
|
"@types/lodash.shuffle": "4.2.6",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"@testing-library/jest-dom/extend-expect"
|
|
89
89
|
]
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "bad464d744008a7e4cd59a540b35f8828788ebd0"
|
|
92
92
|
}
|
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,r=/^\[object .+?Constructor\]$/,d="object"==typeof global&&global&&global.Object===Object&&global,s="object"==typeof self&&self&&self.Object===Object&&self,m=d||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:"",u=h.toString,x=g.hasOwnProperty,b=g.toString,w=RegExp("^"+u.call(x).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_=m.Symbol,S=p.splice,k=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 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 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 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(L(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||P(e))return!0;return a.test(e)||!i.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:L(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:r).test(function(e){if(null!=e){try{return u.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 x.call(t,e)?t[e]:void 0},z.prototype.has=function(e){var t=this.__data__;return E?void 0!==t[e]:x.call(t,e)},z.prototype.set=function(e,t){return this.__data__[e]=E&&void 0===t?"__lodash_hash_undefined__":t,this},F.prototype.clear=function(){this.__data__=[]},F.prototype.delete=function(e){var t=this.__data__,i=N(t,e);return!(i<0)&&(i==t.length-1?t.pop():S.call(t,i,1),!0)},F.prototype.get=function(e){var t=this.__data__,i=N(t,e);return i<0?void 0:t[i][1]},F.prototype.has=function(e){return N(this.__data__,e)>-1},F.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},I.prototype.clear=function(){this.__data__={hash:new z,map:new(k||F),string:new z}},I.prototype.delete=function(e){return O(this,e).delete(e)},I.prototype.get=function(e){return O(this,e).get(e)},I.prototype.has=function(e){return O(this,e).has(e)},I.prototype.set=function(e,t){return O(this,e).set(e,t),this};var A=B((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(P(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||P(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function B(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(B.Cache||I),i}B.Cache=I;var L=Array.isArray;function $(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]"==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 r=["sm","md","lg","xlg"],d=e=>{if(e){let t={};return r.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 u=i(2),x=i.n(u);const b=x.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=x.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(),[r,d]=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=()=>d(i.src),i.src=f(e,t)}}),{rootMargin:"60px"});return l.current&&t.observe(l.current),()=>t.disconnect()}e&&l.current&&d(f(e,l.current.offsetWidth))},[e,l]),n.a.createElement(b,{visible:!!r,isRoundal:i},o?n.a.createElement(w,{src:r,ref:l,role:"img","aria-label":t}):n.a.createElement("img",{src:r,alt:t,ref:l}))};var S=i(1);const k=(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=x.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})=>k("sm",e),S.breakpoints.medium,({schema:e})=>k("md",e),S.breakpoints.wide,({schema:e})=>k("lg",e),S.breakpoints.huge,({schema:e})=>k("xlg",e)),v=x.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),S.breakpoints.medium,({schema:e})=>E("md",e),S.breakpoints.wide,({schema:e})=>E("lg",e),S.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")}))})))},F=(e,t)=>l()(l()(t,e),"headlineFontSize",10),I=(e,t)=>m(e,t)?"sm"===e||"md"===e?"90%":"80%":"100%",N=(e,t)=>m(e,t)?"center":"left",H=x.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})=>I("sm",e),S.breakpoints.medium,({schema:e})=>I("md",e),S.breakpoints.wide,({schema:e})=>I("lg",e),S.breakpoints.huge,({schema:e})=>I("xlg",e),S.colours.functional.brandColour,({schema:e})=>F("sm",e),({schema:e})=>F("sm",e),S.fonts.headline,({schema:e})=>N("sm",e),S.breakpoints.medium,({schema:e})=>F("md",e),({schema:e})=>F("md",e),({schema:e})=>N("md",e),S.breakpoints.wide,({schema:e})=>F("lg",e),({schema:e})=>F("lg",e),({schema:e})=>N("lg",e),S.breakpoints.huge,({schema:e})=>F("xlg",e),({schema:e})=>F("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",B=(e,t)=>m(e,t)&&!s(e,t)?"16px 0 24px 0":0,L=(e,t)=>l()(l()(t,e),"backgroundColor","transparent"),$=x.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})=>L("sm",e),S.breakpoints.medium,({schema:e})=>O("md",e),({schema:e})=>L("md",e),S.breakpoints.wide,({schema:e})=>O("lg",e),({schema:e})=>L("lg",e),S.breakpoints.huge,({schema:e})=>O("xlg",e),({schema:e})=>L("xlg",e)),P=x.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})=>B("sm",e),({schema:e})=>A("sm",e),S.breakpoints.medium,({schema:e})=>j("md",e),({schema:e})=>A("md",e),({schema:e})=>D("md",e),({schema:e})=>D("md",e),({schema:e})=>B("md",e),({schema:e})=>A("md",e),S.breakpoints.wide,({schema:e})=>j("lg",e),({schema:e})=>A("lg",e),({schema:e})=>D("lg",e),({schema:e})=>D("lg",e),({schema:e})=>B("lg",e),({schema:e})=>A("lg",e),S.breakpoints.huge,({schema:e})=>j("xlg",e),({schema:e})=>A("xlg",e),({schema:e})=>D("xlg",e),({schema:e})=>D("xlg",e),({schema:e})=>B("xlg",e),({schema:e})=>A("xlg",e)),T=x.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;"],S.colours.functional.secondary,S.fonts.supporting),q=(e,t)=>m(e,t)?"sm"===e||"md"===e?"90%":"80%":"100%",M=(e,t)=>m(e,t)?"center":"left",W=x.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),S.colours.functional.secondary,({schema:e})=>M("sm",e),S.fonts.body,S.breakpoints.medium,({schema:e})=>q("md",e),({schema:e})=>M("md",e),S.breakpoints.wide,({schema:e})=>q("lg",e),({schema:e})=>M("lg",e),S.breakpoints.huge,({schema:e})=>q("xlg",e),({schema:e})=>M("xlg",e)),Y=x.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;"],S.colours.functional.secondary,S.fonts.supporting),U=x.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;}}"],S.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(P,{schema:t},n.a.createElement(z,{article:e,displaySchema:t,clickHandler:i})),n.a.createElement(P,{schema:t},e.label&&n.a.createElement(T,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=x.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",S.breakpoints.small,S.breakpoints.medium,({styles:e})=>e&&e.removePadding?0:"0 20px",S.breakpoints.wide,S.breakpoints.huge),J=x.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=x()(G).withConfig({displayName:"styles__SliceContainer",componentId:"sc-614vlg-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],S.breakpoints.medium),Q=x()(J).withConfig({displayName:"styles__SlotContainer",componentId:"sc-614vlg-1"})(["@media (min-width:","px){margin-bottom:24px;padding-right:0;padding-bottom:24px;}"],S.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:d({sm:{imageRatio:"3:2",isCentered:!0,headlineFontSize:28,backgroundColor:"#f0f0f0"},md:{isSideBySide:!0},lg:{headlineFontSize:32},xlg:{headlineFontSize:36}}),clickHandler:i}))));const Z=x()(G).withConfig({displayName:"styles__SliceContainer",componentId:"sc-1r0nv22-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],S.breakpoints.medium),ee=x()(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;}}"],S.breakpoints.medium),te=x()(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;}"],S.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:d({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:d({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=x()($).withConfig({displayName:"styles__ArticleContainer",componentId:"sc-2eizyd-0"})(["align-items:center;"]),oe=x.a.div.withConfig({displayName:"styles__ImageContainer",componentId:"sc-2eizyd-1"})(["max-width:120px;margin:0 auto;@media (min-width:","px){max-width:140px;}"],S.breakpoints.huge),le=x.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;}"],S.colours.functional.secondary,S.fonts.headlineRegular,S.breakpoints.huge),re=({article:e,displaySchema:t,clickHandler:i})=>e?n.a.createElement(ne,{schema:t},n.a.createElement(P,{schema:t},n.a.createElement(oe,null,n.a.createElement(z,{article:e,displaySchema:t,clickHandler:i}))),n.a.createElement(P,{schema:t},e.label&&n.a.createElement(T,null,e.label),e.byline&&n.a.createElement(le,null,e.byline),n.a.createElement(R,{article:e,displaySchema:t,clickHandler:i}))):null,de=x()(G).withConfig({displayName:"styles__SliceContainer",componentId:"fss0bs-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],S.breakpoints.medium),se=x()(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;}}"],S.breakpoints.medium),me=x()(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;}"],S.breakpoints.medium,c(33.33,3));var ce=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(de,{styles:t},n.a.createElement(se,{styles:t},n.a.createElement(V,{article:l()(e,"children[0].article"),displaySchema:d({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:d({sm:{imageRatio:"3:2",headlineFontSize:22},lg:{headlineFontSize:24},xlg:{headlineFontSize:28}}),clickHandler:i})),ae(l()(e,"children[2].article"))?n.a.createElement(re,{article:e.children[2].article,displaySchema:d({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:d({sm:{isSideBySide:!0,imageRatio:"3:2",headlineFontSize:18},md:{headlineFontSize:16},xlg:{headlineFontSize:18}}),clickHandler:i}))));const pe=x()(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;}}"],S.breakpoints.medium,c(50,2)),he=x.a.div.withConfig({displayName:"styles__SideBySideColumn",componentId:"rqwi1t-1"})(["display:flex;flex-wrap:wrap;justify-content:space-between;"]),ge=x()(J).withConfig({displayName:"styles__SlotContainerLead",componentId:"rqwi1t-2"})(["@media (min-width:","px){width:",";margin-bottom:24px;padding-bottom:24px;padding-left:12px;}"],S.breakpoints.medium,c(50,2)),ye=x()(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:d({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:d({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:d({sm:{imageRatio:"3:2",headlineFontSize:22},md:{headlineFontSize:24},xlg:{headlineFontSize:28}}),clickHandler:i}))));const ue=x()(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;}}"],S.breakpoints.medium,c(50,2));var xe=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(G,{styles:t},e.children.map((e,a)=>n.a.createElement(ue,{key:a,styles:t},n.a.createElement(V,{article:e.article,displaySchema:d({sm:{imageRatio:"3:2",headlineFontSize:22},md:{imageRatio:"16:9",headlineFontSize:24},xlg:{headlineFontSize:28}}),clickHandler:i})))));const be=x()(G).withConfig({displayName:"styles__SliceContainer",componentId:"xnsfmb-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],S.breakpoints.wide),we=x()(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;}}"],S.breakpoints.medium,c(50,2),S.breakpoints.wide),_e=x()(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;}}"],S.breakpoints.medium,S.breakpoints.wide,c(33.33,3)),Se=x()(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;}}}"],S.breakpoints.medium,c(50,2),S.breakpoints.wide);var ke=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:d({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 r=l()(e,`children[${o+2}].article`);return n.a.createElement(Se,{key:o,styles:t},ae(r)?n.a.createElement(re,{article:r,displaySchema:d({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:r,displaySchema:d({sm:{isSideBySide:!0,imageRatio:"3:2",headlineFontSize:18},md:{headlineFontSize:16},xlg:{headlineFontSize:18}}),clickHandler:i}))}))));const Ee=x()(G).withConfig({displayName:"styles__SliceContainer",componentId:"sc-7y5fg-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],S.breakpoints.wide),Ce=x()(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;}}"],S.breakpoints.medium,c(50,2),S.breakpoints.wide),ve=x()(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;}}"],S.breakpoints.medium,S.breakpoints.wide,c(33.33,3)),ze=x()(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;}}}"],S.breakpoints.medium,c(50,2),S.breakpoints.wide);var Fe=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:d({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:d({sm:{isImageHidden:!0,imageRatio:"3:2",headlineFontSize:18},lg:{isSideBySide:!0,isImageHidden:!1,headlineFontSize:16},xlg:{headlineFontSize:18}}),clickHandler:i}))))));const Ie=x()(G).withConfig({displayName:"styles__SliceContainer",componentId:"sc-11upv3n-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],S.breakpoints.wide),Ne=x()(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;}}"],S.breakpoints.medium,c(50,2),S.breakpoints.wide),He=x()(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;}}"],S.breakpoints.medium,S.breakpoints.wide,c(33.33,3)),Re=x()(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;}}}"],S.breakpoints.medium,c(50,2),S.breakpoints.wide);var Oe=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(Ie,{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:d({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:d({sm:{isImageHidden:!0,headlineFontSize:18},lg:{headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i}))))));const je=x()(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;}}}"],S.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:d({sm:{imageRatio:"3:2",headlineFontSize:22},md:{headlineFontSize:18},lg:{headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i})))));const De=x()(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),S.breakpoints.medium,c(25,4));var Be=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:d({sm:{imageRatio:"3:2",headlineFontSize:18},lg:{headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i})))));const Le=x()(G).withConfig({displayName:"styles__SliceContainer",componentId:"c5tu9p-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],S.breakpoints.wide),$e=x()(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;}}"],S.breakpoints.medium,c(50,2),S.breakpoints.wide,c(33.33,3)),Pe=x()(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;}}}"],S.breakpoints.medium,c(50,2),S.breakpoints.wide);var Te=n.a.memo(({slice:e,styles:t,clickHandler:i})=>n.a.createElement(Le,{styles:t},[...Array(2)].fill(null).map((a,o)=>{const r=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:r,displaySchema:d({sm:{imageRatio:"3:2",headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i})),n.a.createElement(Pe,{styles:t},ae(s)?n.a.createElement(re,{article:s,displaySchema:d({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:d({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=x()(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),S.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:d({sm:{imageRatio:"3:2",headlineFontSize:18,isCentered:!0},lg:{headlineFontSize:22},xlg:{headlineFontSize:24}}),clickHandler:i})))));const We=x()(G).withConfig({displayName:"styles__SliceContainer",componentId:"b33h2c-0"})(["@media (min-width:","px){flex-wrap:nowrap;}"],S.breakpoints.medium),Ye=x()(J).withConfig({displayName:"styles__SlotContainer",componentId:"b33h2c-1"})(["@media (min-width:","px){margin-bottom:24px;padding-right:0;padding-bottom:24px;}"],S.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:d({sm:{imageRatio:"3:2",headlineFontSize:28},md:{isSideBySide:!0},lg:{headlineFontSize:32},xlg:{headlineFontSize:36}}),clickHandler:i}))));const Ve=({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 xe;case"SECONDARY_2_AND_2":return ke;case"SECONDARY_2_AND_3":return Fe;case"SECONDARY_2_AND_3_NO_PIC":return Oe;case"SECONDARY_3":return Ae;case"SECONDARY_4":return Be;case"SECONDARY_4_ODD":case"SECONDARY_4_ODD_COLUMNIST":return Te;case"SECONDARY_10":return Me;case"RELATED_ARTICLE_1":return Ue;default:return()=>null}})(e.name);return n.a.createElement(a,{slice:e,styles:t,clickHandler:i})};i.d(t,"Slice",(function(){return Ve}))}]);
|
|
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}))}]);
|
|
@@ -10,7 +10,7 @@ import { Article } from '../../article/Article/Article';
|
|
|
10
10
|
|
|
11
11
|
import { SliceContainer, SlotContainer } from './styles';
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const RelatedArticle1: React.FC<{
|
|
14
14
|
slice: SliceData;
|
|
15
15
|
styles?: SliceStyle;
|
|
16
16
|
clickHandler?: ClickHandlerType;
|
|
@@ -20,13 +20,8 @@ const Lead1: React.FC<{
|
|
|
20
20
|
<Article
|
|
21
21
|
article={get(slice, 'children[0].article')}
|
|
22
22
|
displaySchema={setDisplaySchema({
|
|
23
|
-
sm: {
|
|
24
|
-
|
|
25
|
-
headlineFontSize: 28
|
|
26
|
-
},
|
|
27
|
-
md: { isSideBySide: true },
|
|
28
|
-
lg: { headlineFontSize: 32 },
|
|
29
|
-
xlg: { headlineFontSize: 36 }
|
|
23
|
+
sm: { imageRatio: '16:9', headlineFontSize: 22 },
|
|
24
|
+
md: { isSideBySide: true }
|
|
30
25
|
})}
|
|
31
26
|
clickHandler={clickHandler}
|
|
32
27
|
/>
|
|
@@ -34,4 +29,4 @@ const Lead1: React.FC<{
|
|
|
34
29
|
</SliceContainer>
|
|
35
30
|
));
|
|
36
31
|
|
|
37
|
-
export default
|
|
32
|
+
export default RelatedArticle1;
|
|
@@ -9,6 +9,13 @@ import {
|
|
|
9
9
|
export const SliceContainer = styled(SliceContainerBase)`
|
|
10
10
|
@media (min-width: ${breakpoints.medium}px) {
|
|
11
11
|
flex-wrap: nowrap;
|
|
12
|
+
width: 80.8%;
|
|
13
|
+
max-width: none;
|
|
14
|
+
padding: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@media (min-width: ${breakpoints.wide}px) {
|
|
18
|
+
width: 56.2%;
|
|
12
19
|
}
|
|
13
20
|
`;
|
|
14
21
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { SliceData, SliceSlot } from '../../../types/slice';
|
|
4
|
+
import { SliceStyle } from '../../../types/styles';
|
|
5
|
+
import { ClickHandlerType } from '../../../types/event';
|
|
6
|
+
import { setDisplaySchema } from '../../../utils/getArticleStyles';
|
|
7
|
+
|
|
8
|
+
import { Article } from '../../article/Article/Article';
|
|
9
|
+
|
|
10
|
+
import { SliceContainer, SlotContainer } from './styles';
|
|
11
|
+
|
|
12
|
+
const RelatedArticle2: React.FC<{
|
|
13
|
+
slice: SliceData;
|
|
14
|
+
styles?: SliceStyle;
|
|
15
|
+
clickHandler?: ClickHandlerType;
|
|
16
|
+
}> = React.memo(({ slice, styles, clickHandler }) => (
|
|
17
|
+
<SliceContainer styles={styles}>
|
|
18
|
+
{slice.children.map((slot: SliceSlot, i: number) => (
|
|
19
|
+
<SlotContainer key={i} styles={styles}>
|
|
20
|
+
<Article
|
|
21
|
+
article={slot.article}
|
|
22
|
+
displaySchema={setDisplaySchema({
|
|
23
|
+
sm: {
|
|
24
|
+
isImageHidden: true,
|
|
25
|
+
imageRatio: '16:9',
|
|
26
|
+
headlineFontSize: 22
|
|
27
|
+
},
|
|
28
|
+
md: { isImageHidden: false }
|
|
29
|
+
})}
|
|
30
|
+
clickHandler={clickHandler}
|
|
31
|
+
/>
|
|
32
|
+
</SlotContainer>
|
|
33
|
+
))}
|
|
34
|
+
</SliceContainer>
|
|
35
|
+
));
|
|
36
|
+
|
|
37
|
+
export default RelatedArticle2;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
|
|
4
|
+
import { getSlice } from '../../../../fixtures/getSlice';
|
|
5
|
+
|
|
6
|
+
import RelatedArticle2 from '../RelatedArticle2';
|
|
7
|
+
|
|
8
|
+
jest.mock('../../../article/Article/Article', () => ({
|
|
9
|
+
Article: () => <div>Article</div>
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
describe('<RelatedArticle2 />', () => {
|
|
13
|
+
afterAll(() => {
|
|
14
|
+
jest.clearAllMocks();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should render an RELATED_ARTICLE_2 slice correctly', () => {
|
|
18
|
+
const slice = getSlice('RELATED_ARTICLE_2');
|
|
19
|
+
|
|
20
|
+
const { asFragment, getAllByText } = render(
|
|
21
|
+
<RelatedArticle2 slice={slice} />
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const article = getAllByText('Article');
|
|
25
|
+
expect(article.length).toBe(2);
|
|
26
|
+
|
|
27
|
+
expect(asFragment()).toMatchSnapshot();
|
|
28
|
+
});
|
|
29
|
+
});
|
package/src/components/slices/RelatedArticle2/__tests__/__snapshots__/RelatedArticle2.test.tsx.snap
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<RelatedArticle2 /> should render an RELATED_ARTICLE_2 slice correctly 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="sc-bdVaJa sc-htpNat TayYz"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="sc-bwzfXH sc-bxivhb ccFQOx"
|
|
10
|
+
>
|
|
11
|
+
<div>
|
|
12
|
+
Article
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div
|
|
16
|
+
class="sc-bwzfXH sc-bxivhb ccFQOx"
|
|
17
|
+
>
|
|
18
|
+
<div>
|
|
19
|
+
Article
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</DocumentFragment>
|
|
24
|
+
`;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { breakpoints } from '@times-components/ts-styleguide';
|
|
3
|
+
|
|
4
|
+
import { calculateSlotWidth } from '../../../utils/getArticleStyles';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
SliceContainer as SliceContainerBase,
|
|
8
|
+
SlotContainer as SlotContainerBase
|
|
9
|
+
} from '../shared-styles';
|
|
10
|
+
|
|
11
|
+
export const SliceContainer = styled(SliceContainerBase)`
|
|
12
|
+
@media (min-width: ${breakpoints.medium}px) {
|
|
13
|
+
width: 80.8%;
|
|
14
|
+
max-width: none;
|
|
15
|
+
padding: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@media (min-width: ${breakpoints.wide}px) {
|
|
19
|
+
width: 56.2%;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
export const SlotContainer = styled(SlotContainerBase)`
|
|
24
|
+
@media (min-width: ${breakpoints.medium}px) {
|
|
25
|
+
width: ${calculateSlotWidth(50, 2)};
|
|
26
|
+
margin-bottom: 24px;
|
|
27
|
+
padding-bottom: 24px;
|
|
28
|
+
|
|
29
|
+
&:first-of-type {
|
|
30
|
+
padding-right: 12px;
|
|
31
|
+
|
|
32
|
+
:before {
|
|
33
|
+
display: block;
|
|
34
|
+
bottom: 24px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&:last-of-type {
|
|
39
|
+
padding-left: 12px;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { SliceData, SliceSlot } from '../../../types/slice';
|
|
4
|
+
import { SliceStyle } from '../../../types/styles';
|
|
5
|
+
import { ClickHandlerType } from '../../../types/event';
|
|
6
|
+
import { setDisplaySchema } from '../../../utils/getArticleStyles';
|
|
7
|
+
|
|
8
|
+
import { Article } from '../../article/Article/Article';
|
|
9
|
+
|
|
10
|
+
import { SliceContainer } from '../shared-styles';
|
|
11
|
+
import { SlotContainer } from './styles';
|
|
12
|
+
|
|
13
|
+
const RelatedArticle3: React.FC<{
|
|
14
|
+
slice: SliceData;
|
|
15
|
+
styles?: SliceStyle;
|
|
16
|
+
clickHandler?: ClickHandlerType;
|
|
17
|
+
}> = React.memo(({ slice, styles, clickHandler }) => (
|
|
18
|
+
<SliceContainer styles={styles}>
|
|
19
|
+
{slice.children.map((slot: SliceSlot, i: number) => (
|
|
20
|
+
<SlotContainer key={i} styles={styles}>
|
|
21
|
+
<Article
|
|
22
|
+
article={slot.article}
|
|
23
|
+
displaySchema={setDisplaySchema({
|
|
24
|
+
sm: {
|
|
25
|
+
isImageHidden: true,
|
|
26
|
+
imageRatio: '16:9',
|
|
27
|
+
headlineFontSize: 22
|
|
28
|
+
},
|
|
29
|
+
md: { isImageHidden: false }
|
|
30
|
+
})}
|
|
31
|
+
clickHandler={clickHandler}
|
|
32
|
+
/>
|
|
33
|
+
</SlotContainer>
|
|
34
|
+
))}
|
|
35
|
+
</SliceContainer>
|
|
36
|
+
));
|
|
37
|
+
|
|
38
|
+
export default RelatedArticle3;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
|
|
4
|
+
import { getSlice } from '../../../../fixtures/getSlice';
|
|
5
|
+
|
|
6
|
+
import RelatedArticle3 from '../RelatedArticle3';
|
|
7
|
+
|
|
8
|
+
jest.mock('../../../article/Article/Article', () => ({
|
|
9
|
+
Article: () => <div>Article</div>
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
describe('<RelatedArticle3 />', () => {
|
|
13
|
+
afterAll(() => {
|
|
14
|
+
jest.clearAllMocks();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should render an RELATED_ARTICLE_3 slice correctly', () => {
|
|
18
|
+
const slice = getSlice('RELATED_ARTICLE_3');
|
|
19
|
+
|
|
20
|
+
const { asFragment, getAllByText } = render(
|
|
21
|
+
<RelatedArticle3 slice={slice} />
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const article = getAllByText('Article');
|
|
25
|
+
expect(article.length).toBe(3);
|
|
26
|
+
|
|
27
|
+
expect(asFragment()).toMatchSnapshot();
|
|
28
|
+
});
|
|
29
|
+
});
|
package/src/components/slices/RelatedArticle3/__tests__/__snapshots__/RelatedArticle3.test.tsx.snap
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<RelatedArticle3 /> should render an RELATED_ARTICLE_3 slice correctly 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="sc-bdVaJa gMdRRW"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="sc-bwzfXH sc-htpNat kmrygX"
|
|
10
|
+
>
|
|
11
|
+
<div>
|
|
12
|
+
Article
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div
|
|
16
|
+
class="sc-bwzfXH sc-htpNat kmrygX"
|
|
17
|
+
>
|
|
18
|
+
<div>
|
|
19
|
+
Article
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<div
|
|
23
|
+
class="sc-bwzfXH sc-htpNat kmrygX"
|
|
24
|
+
>
|
|
25
|
+
<div>
|
|
26
|
+
Article
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</DocumentFragment>
|
|
31
|
+
`;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import { breakpoints } from '@times-components/ts-styleguide';
|
|
3
|
+
|
|
4
|
+
import { calculateSlotWidth } from '../../../utils/getArticleStyles';
|
|
5
|
+
|
|
6
|
+
import { SlotContainer as SlotContainerBase } from '../shared-styles';
|
|
7
|
+
|
|
8
|
+
export const SlotContainer = styled(SlotContainerBase)`
|
|
9
|
+
@media (min-width: ${breakpoints.medium}px) {
|
|
10
|
+
width: ${calculateSlotWidth(33.33, 3)};
|
|
11
|
+
margin-bottom: 24px;
|
|
12
|
+
padding: 0 12px 24px 12px;
|
|
13
|
+
|
|
14
|
+
:before {
|
|
15
|
+
display: block;
|
|
16
|
+
bottom: 24px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:after {
|
|
20
|
+
display: block;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:first-of-type {
|
|
24
|
+
padding-left: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&:last-of-type {
|
|
28
|
+
padding-right: 0;
|
|
29
|
+
|
|
30
|
+
&:before {
|
|
31
|
+
display: none;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
@@ -134,6 +134,20 @@ const showcase = {
|
|
|
134
134
|
),
|
|
135
135
|
name: 'RELATED_ARTICLE_1',
|
|
136
136
|
type: 'story'
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
component: () => (
|
|
140
|
+
<Slice slice={getSlice('RELATED_ARTICLE_2')} clickHandler={onClick} />
|
|
141
|
+
),
|
|
142
|
+
name: 'RELATED_ARTICLE_2',
|
|
143
|
+
type: 'story'
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
component: () => (
|
|
147
|
+
<Slice slice={getSlice('RELATED_ARTICLE_3')} clickHandler={onClick} />
|
|
148
|
+
),
|
|
149
|
+
name: 'RELATED_ARTICLE_3',
|
|
150
|
+
type: 'story'
|
|
137
151
|
}
|
|
138
152
|
],
|
|
139
153
|
name: 'Typescript Slices/Slices'
|
package/src/fixtures/getSlice.ts
CHANGED
|
@@ -11,10 +11,6 @@ const slices: SliceData[] = [
|
|
|
11
11
|
name: 'LEAD_1',
|
|
12
12
|
children: [{ article: getArticleWithSummary() }]
|
|
13
13
|
},
|
|
14
|
-
{
|
|
15
|
-
name: 'RELATED_ARTICLE_1',
|
|
16
|
-
children: [{ article: getArticleWithSummary() }]
|
|
17
|
-
},
|
|
18
14
|
{
|
|
19
15
|
name: 'LEAD_1_AND_1',
|
|
20
16
|
children: [{ article: getArticle() }, { article: getArticleWithSummary() }]
|
|
@@ -126,6 +122,25 @@ const slices: SliceData[] = [
|
|
|
126
122
|
{ article: getArticle() },
|
|
127
123
|
{ article: getArticle() }
|
|
128
124
|
]
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'RELATED_ARTICLE_1',
|
|
128
|
+
children: [{ article: getArticleWithSummary() }]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'RELATED_ARTICLE_2',
|
|
132
|
+
children: [
|
|
133
|
+
{ article: getArticleWithSummary() },
|
|
134
|
+
{ article: getArticleWithSummary() }
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: 'RELATED_ARTICLE_3',
|
|
139
|
+
children: [
|
|
140
|
+
{ article: getArticleWithSummary() },
|
|
141
|
+
{ article: getArticleWithSummary() },
|
|
142
|
+
{ article: getArticleWithSummary() }
|
|
143
|
+
]
|
|
129
144
|
}
|
|
130
145
|
];
|
|
131
146
|
|
package/src/utils/getSlice.ts
CHANGED
|
@@ -17,6 +17,8 @@ import Secondary4 from '../components/slices/Secondary4/Secondary4';
|
|
|
17
17
|
import Secondary4Odd from '../components/slices/Secondary4Odd/Secondary4Odd';
|
|
18
18
|
import Secondary10 from '../components/slices/Secondary10/Secondary10';
|
|
19
19
|
import RelatedArticle1 from '../components/slices/RelatedArticle1/RelatedArticle1';
|
|
20
|
+
import RelatedArticle2 from '../components/slices/RelatedArticle2/RelatedArticle2';
|
|
21
|
+
import RelatedArticle3 from '../components/slices/RelatedArticle3/RelatedArticle3';
|
|
20
22
|
|
|
21
23
|
export const getSliceComponent = (
|
|
22
24
|
name: string
|
|
@@ -59,6 +61,10 @@ export const getSliceComponent = (
|
|
|
59
61
|
return Secondary10;
|
|
60
62
|
case 'RELATED_ARTICLE_1':
|
|
61
63
|
return RelatedArticle1;
|
|
64
|
+
case 'RELATED_ARTICLE_2':
|
|
65
|
+
return RelatedArticle2;
|
|
66
|
+
case 'RELATED_ARTICLE_3':
|
|
67
|
+
return RelatedArticle3;
|
|
62
68
|
|
|
63
69
|
default:
|
|
64
70
|
return () => null;
|