@financial-times/cp-content-pipeline-ui 6.14.1 → 6.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/lib/components/ArticleBody/index.d.ts +2 -1
- package/lib/components/ArticleBody/index.js +2 -2
- package/lib/components/ArticleBody/index.js.map +1 -1
- package/lib/components/ArticleInfo/index.d.ts +3 -3
- package/lib/components/ArticleInfo/index.js +7 -3
- package/lib/components/ArticleInfo/index.js.map +1 -1
- package/lib/components/BackToTopButton/client/index.d.ts +4 -2
- package/lib/components/BackToTopButton/client/index.js +2 -11
- package/lib/components/BackToTopButton/client/index.js.map +1 -1
- package/lib/components/BackToTopButton/client/utils.js +1 -2
- package/lib/components/BackToTopButton/client/utils.js.map +1 -1
- package/lib/components/BigNumber/index.d.ts +2 -1
- package/lib/components/BigNumber/index.js +2 -2
- package/lib/components/BigNumber/index.js.map +1 -1
- package/lib/components/Body/index.d.ts +2 -1
- package/lib/components/Body/index.js +2 -2
- package/lib/components/Body/index.js.map +1 -1
- package/lib/components/Byline/index.d.ts +2 -2
- package/lib/components/Byline/index.js +2 -2
- package/lib/components/Byline/index.js.map +1 -1
- package/lib/components/Clip/client/index.js.map +1 -1
- package/lib/components/Clip/client/progressBar.js.map +1 -1
- package/lib/components/Clip/client/utils.js +4 -5
- package/lib/components/Clip/client/utils.js.map +1 -1
- package/lib/components/Clip/components/Caption.d.ts +1 -1
- package/lib/components/Clip/components/Caption.js.map +1 -1
- package/lib/components/Clip/components/ClipTag.d.ts +1 -1
- package/lib/components/Clip/components/ClipTag.js.map +1 -1
- package/lib/components/Clip/components/ClosedCaptions.d.ts +2 -2
- package/lib/components/Clip/components/ClosedCaptions.js +1 -1
- package/lib/components/Clip/components/ClosedCaptions.js.map +1 -1
- package/lib/components/Clip/components/Container.d.ts +2 -3
- package/lib/components/Clip/components/Container.js +1 -1
- package/lib/components/Clip/components/Container.js.map +1 -1
- package/lib/components/Clip/components/ContentLayout.d.ts +2 -3
- package/lib/components/Clip/components/ContentLayout.js.map +1 -1
- package/lib/components/Clip/components/Credit.d.ts +1 -1
- package/lib/components/Clip/components/Credit.js.map +1 -1
- package/lib/components/Clip/components/VideoDescription.d.ts +1 -1
- package/lib/components/Clip/components/VideoDescription.js.map +1 -1
- package/lib/components/Clip/components/VideoInfoBox.d.ts +1 -1
- package/lib/components/Clip/components/VideoInfoBox.js.map +1 -1
- package/lib/components/Clip/template/component.d.ts +2 -2
- package/lib/components/Clip/template/component.js +2 -2
- package/lib/components/Clip/template/component.js.map +1 -1
- package/lib/components/Clip/template/index.js +1 -1
- package/lib/components/Clip/template/index.js.map +1 -1
- package/lib/components/Clip/test/fixtures.js.map +1 -1
- package/lib/components/Clip/test/index.spec.js.map +1 -1
- package/lib/components/Clip/test/snapshot.spec.js +2 -2
- package/lib/components/Clip/test/snapshot.spec.js.map +1 -1
- package/lib/components/ContentPackageBody/index.d.ts +2 -2
- package/lib/components/ContentPackageBody/index.js +9 -9
- package/lib/components/ContentPackageBody/index.js.map +1 -1
- package/lib/components/Expander/client/index.js.map +1 -1
- package/lib/components/Expander/test/client/index.spec.js.map +1 -1
- package/lib/components/FixedAspectRatio/FixedAspectRatio.d.ts +3 -1622
- package/lib/components/FixedAspectRatio/FixedAspectRatio.js +3 -3
- package/lib/components/FixedAspectRatio/FixedAspectRatio.js.map +1 -1
- package/lib/components/Flourish/client/index.js.map +1 -1
- package/lib/components/Flourish/index.d.ts +2 -2
- package/lib/components/Flourish/index.js +2 -2
- package/lib/components/Flourish/index.js.map +1 -1
- package/lib/components/Heading/index.d.ts +2 -5
- package/lib/components/Heading/index.js +2 -1
- package/lib/components/Heading/index.js.map +1 -1
- package/lib/components/Headshot/index.d.ts +2 -2
- package/lib/components/Headshot/index.js +2 -2
- package/lib/components/Headshot/index.js.map +1 -1
- package/lib/components/ImageSet/index.d.ts +8 -6
- package/lib/components/ImageSet/index.js +11 -11
- package/lib/components/ImageSet/index.js.map +1 -1
- package/lib/components/Layout/index.d.ts +4 -10
- package/lib/components/Layout/index.js +7 -7
- package/lib/components/Layout/index.js.map +1 -1
- package/lib/components/LiveBlogBody/index.d.ts +2 -2
- package/lib/components/LiveBlogBody/index.js +2 -2
- package/lib/components/LiveBlogBody/index.js.map +1 -1
- package/lib/components/LiveBlogPost/ShareButtons.d.ts +4 -3
- package/lib/components/LiveBlogPost/ShareButtons.js +2 -1
- package/lib/components/LiveBlogPost/ShareButtons.js.map +1 -1
- package/lib/components/LiveBlogPost/Timestamp.d.ts +2 -2
- package/lib/components/LiveBlogPost/Timestamp.js +2 -1
- package/lib/components/LiveBlogPost/Timestamp.js.map +1 -1
- package/lib/components/LiveBlogPost/index.d.ts +1 -1
- package/lib/components/LiveBlogPost/index.js +1 -1
- package/lib/components/LiveBlogPost/index.js.map +1 -1
- package/lib/components/LiveBlogPost/svgIcons.d.ts +3 -3
- package/lib/components/LiveBlogPost/svgIcons.js +6 -6
- package/lib/components/LiveBlogPost/svgIcons.js.map +1 -1
- package/lib/components/LiveBlogWrapper/dispatchEvent.js.map +1 -1
- package/lib/components/LiveBlogWrapper/index.js.map +1 -1
- package/lib/components/LiveBlogWrapper/normalisePost.js.map +1 -1
- package/lib/components/LiveBlogWrapper/post-tracker.js +2 -2
- package/lib/components/LiveBlogWrapper/post-tracker.js.map +1 -1
- package/lib/components/MainImage/index.d.ts +2 -2
- package/lib/components/MainImage/index.js +2 -2
- package/lib/components/MainImage/index.js.map +1 -1
- package/lib/components/Paragraph/index.d.ts +2 -1
- package/lib/components/Paragraph/index.js +3 -3
- package/lib/components/Paragraph/index.js.map +1 -1
- package/lib/components/PodcastBody/index.d.ts +4 -2
- package/lib/components/PodcastBody/index.js +2 -2
- package/lib/components/PodcastBody/index.js.map +1 -1
- package/lib/components/Pullquote/index.d.ts +2 -2
- package/lib/components/Pullquote/index.js +2 -1
- package/lib/components/Pullquote/index.js.map +1 -1
- package/lib/components/Recommended/index.d.ts +2 -1
- package/lib/components/Recommended/index.js +2 -2
- package/lib/components/Recommended/index.js.map +1 -1
- package/lib/components/RichText/BasicComponents.d.ts +13 -13
- package/lib/components/RichText/BasicComponents.js +2 -2
- package/lib/components/RichText/BasicComponents.js.map +1 -1
- package/lib/components/RichText/index.d.ts +2 -2
- package/lib/components/RichText/index.js +2 -2
- package/lib/components/RichText/index.js.map +1 -1
- package/lib/components/Scrollytelling/ScrollyImage.d.ts +1 -1
- package/lib/components/Scrollytelling/ScrollyImage.js +2 -2
- package/lib/components/Scrollytelling/ScrollyImage.js.map +1 -1
- package/lib/components/Scrollytelling/index.d.ts +5 -5
- package/lib/components/Scrollytelling/index.js +1 -1
- package/lib/components/Scrollytelling/index.js.map +1 -1
- package/lib/components/Table/TableBody.d.ts +2 -1
- package/lib/components/Table/TableBody.js +2 -2
- package/lib/components/Table/TableBody.js.map +1 -1
- package/lib/components/Table/TableCell.d.ts +4 -2
- package/lib/components/Table/TableCell.js.map +1 -1
- package/lib/components/Table/index.d.ts +2 -1
- package/lib/components/Table/index.js +2 -2
- package/lib/components/Table/index.js.map +1 -1
- package/lib/components/Topper/Columnist.d.ts +2 -2
- package/lib/components/Topper/Columnist.js +2 -2
- package/lib/components/Topper/Columnist.js.map +1 -1
- package/lib/components/Topper/FollowButtonSlot.d.ts +0 -1
- package/lib/components/Topper/Headline.d.ts +2 -2
- package/lib/components/Topper/Headline.js +2 -2
- package/lib/components/Topper/Headline.js.map +1 -1
- package/lib/components/Topper/Intro.d.ts +2 -1
- package/lib/components/Topper/Intro.js +2 -2
- package/lib/components/Topper/Intro.js.map +1 -1
- package/lib/components/Topper/LiveBlogIndicator.d.ts +2 -2
- package/lib/components/Topper/LiveBlogIndicator.js +2 -2
- package/lib/components/Topper/LiveBlogIndicator.js.map +1 -1
- package/lib/components/Topper/Picture.d.ts +2 -2
- package/lib/components/Topper/Picture.js +2 -2
- package/lib/components/Topper/Picture.js.map +1 -1
- package/lib/components/Topper/Tags.d.ts +2 -2
- package/lib/components/Topper/Tags.js +7 -7
- package/lib/components/Topper/Tags.js.map +1 -1
- package/lib/components/Topper/Wrapper.d.ts +3 -4
- package/lib/components/Topper/Wrapper.js +2 -2
- package/lib/components/Topper/Wrapper.js.map +1 -1
- package/lib/components/Topper/client/tracking.js.map +1 -1
- package/lib/components/Topper/index.d.ts +2 -1
- package/lib/components/Topper/index.js +2 -2
- package/lib/components/Topper/index.js.map +1 -1
- package/lib/components/Tweet/index.d.ts +2 -1
- package/lib/components/Tweet/index.js +2 -2
- package/lib/components/Tweet/index.js.map +1 -1
- package/lib/components/Video/index.d.ts +2 -1
- package/lib/components/Video/index.js +2 -2
- package/lib/components/Video/index.js.map +1 -1
- package/lib/components/YoutubeVideo/index.d.ts +2 -1
- package/lib/components/YoutubeVideo/index.js +2 -2
- package/lib/components/YoutubeVideo/index.js.map +1 -1
- package/lib/context.d.ts +0 -1
- package/lib/extensions/scrollIntoView.js +1 -1
- package/lib/extensions/scrollIntoView.js.map +1 -1
- package/lib/stories/BackToTop.stories.d.ts +5 -2
- package/lib/stories/BackToTop.stories.js.map +1 -1
- package/lib/stories/Clip.stories.d.ts +1 -2
- package/lib/stories/Clip.stories.js +1 -1
- package/lib/stories/Clip.stories.js.map +1 -1
- package/lib/stories/Expander.stories.d.ts +37 -25
- package/lib/stories/Expander.stories.js +207 -36
- package/lib/stories/Expander.stories.js.map +1 -1
- package/lib/stories/LiveBlogPost.stories.d.ts +1 -1
- package/lib/stories/LiveBlogPost.stories.js +6 -6
- package/lib/stories/LiveBlogPost.stories.js.map +1 -1
- package/lib/stories/Topper.stories.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/ArticleBody/index.tsx +3 -4
- package/src/components/ArticleInfo/index.tsx +20 -8
- package/src/components/BackToTopButton/client/index.tsx +11 -6
- package/src/components/BigNumber/index.tsx +6 -9
- package/src/components/Body/index.tsx +4 -2
- package/src/components/Byline/index.tsx +3 -4
- package/src/components/Clip/components/Caption.tsx +1 -1
- package/src/components/Clip/components/ClipTag.tsx +2 -2
- package/src/components/Clip/components/ClosedCaptions.tsx +4 -2
- package/src/components/Clip/components/Container.tsx +5 -3
- package/src/components/Clip/components/ContentLayout.tsx +4 -3
- package/src/components/Clip/components/Credit.tsx +1 -1
- package/src/components/Clip/components/VideoDescription.tsx +2 -2
- package/src/components/Clip/components/VideoInfoBox.tsx +1 -1
- package/src/components/Clip/template/component.tsx +4 -2
- package/src/components/ContentPackageBody/index.tsx +9 -7
- package/src/components/Expander/client/main.scss +27 -17
- package/src/components/FixedAspectRatio/FixedAspectRatio.tsx +6 -5
- package/src/components/Flourish/index.tsx +4 -2
- package/src/components/Heading/index.tsx +5 -2
- package/src/components/Headshot/index.tsx +4 -2
- package/src/components/ImageSet/index.tsx +25 -21
- package/src/components/Layout/index.tsx +8 -15
- package/src/components/LiveBlogBody/index.tsx +4 -2
- package/src/components/LiveBlogPost/ShareButtons.tsx +10 -5
- package/src/components/LiveBlogPost/Timestamp.tsx +6 -1
- package/src/components/LiveBlogPost/index.tsx +6 -4
- package/src/components/LiveBlogPost/svgIcons.tsx +3 -3
- package/src/components/MainImage/index.tsx +3 -1
- package/src/components/Paragraph/index.tsx +5 -3
- package/src/components/PodcastBody/index.tsx +9 -2
- package/src/components/Pullquote/index.tsx +5 -3
- package/src/components/Recommended/index.tsx +5 -2
- package/src/components/RichText/BasicComponents.tsx +35 -30
- package/src/components/RichText/index.tsx +12 -8
- package/src/components/Scrollytelling/ScrollyImage.tsx +4 -4
- package/src/components/Scrollytelling/index.tsx +10 -10
- package/src/components/Table/TableBody.tsx +5 -3
- package/src/components/Table/TableCell.tsx +3 -3
- package/src/components/Table/index.tsx +6 -2
- package/src/components/Topper/Columnist.tsx +4 -2
- package/src/components/Topper/Headline.tsx +4 -2
- package/src/components/Topper/Intro.tsx +3 -1
- package/src/components/Topper/LiveBlogIndicator.tsx +4 -2
- package/src/components/Topper/Picture.tsx +8 -6
- package/src/components/Topper/Tags.tsx +6 -4
- package/src/components/Topper/Wrapper.tsx +5 -4
- package/src/components/Topper/index.tsx +4 -2
- package/src/components/Tweet/index.tsx +3 -1
- package/src/components/Video/index.tsx +4 -2
- package/src/components/YoutubeVideo/index.tsx +4 -2
- package/src/stories/Clip.stories.tsx +2 -6
- package/src/stories/Expander.stories.tsx +231 -51
- package/src/stories/article-page.scss +21 -1
- package/src/stories/tsconfig.json +7 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -2,54 +2,59 @@ import React from 'react'
|
|
|
2
2
|
import type { ContentTree } from '@financial-times/content-tree'
|
|
3
3
|
import type { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema'
|
|
4
4
|
|
|
5
|
-
export const List
|
|
6
|
-
props
|
|
5
|
+
export const List: React.FC<React.PropsWithChildren<ContentTree.List>> = (
|
|
6
|
+
props
|
|
7
|
+
) => (props.ordered ? <ol>{props.children}</ol> : <ul>{props.children}</ul>)
|
|
7
8
|
|
|
8
|
-
export const ListItem
|
|
9
|
-
|
|
10
|
-
) => <li>{props.children}</li>
|
|
9
|
+
export const ListItem: React.FC<
|
|
10
|
+
React.PropsWithChildren<ContentTree.ListItem>
|
|
11
|
+
> = (props) => <li>{props.children}</li>
|
|
11
12
|
|
|
12
|
-
export const Link
|
|
13
|
+
export const Link: React.FC<React.PropsWithChildren<ContentTree.Link>> = (
|
|
14
|
+
props
|
|
15
|
+
) => (
|
|
13
16
|
<a href={props.url} title={props.title}>
|
|
14
17
|
{props.children}
|
|
15
18
|
</a>
|
|
16
19
|
)
|
|
17
20
|
|
|
18
|
-
export const Blockquote
|
|
19
|
-
|
|
20
|
-
) => {
|
|
21
|
+
export const Blockquote: React.FC<
|
|
22
|
+
React.PropsWithChildren<ContentTree.Blockquote>
|
|
23
|
+
> = (props) => {
|
|
21
24
|
return (
|
|
22
25
|
<blockquote className="n-content-blockquote">{props.children}</blockquote>
|
|
23
26
|
)
|
|
24
27
|
}
|
|
25
28
|
|
|
26
|
-
export const Cite
|
|
29
|
+
export const Cite: React.FC<React.PropsWithChildren<ContentTree.Phrasing>> = (
|
|
30
|
+
props
|
|
31
|
+
) => {
|
|
27
32
|
return <cite>{props.children}</cite>
|
|
28
33
|
}
|
|
29
34
|
|
|
30
|
-
export const LineBreak = () => <br />
|
|
35
|
+
export const LineBreak: React.FC = () => <br />
|
|
31
36
|
|
|
32
|
-
export const HorizontalRule = () => <hr />
|
|
37
|
+
export const HorizontalRule: React.FC = () => <hr />
|
|
33
38
|
|
|
34
|
-
export const Emphasis
|
|
35
|
-
|
|
36
|
-
) => <em>{props.children}</em>
|
|
39
|
+
export const Emphasis: React.FC<
|
|
40
|
+
React.PropsWithChildren<ContentTree.Emphasis>
|
|
41
|
+
> = (props) => <em>{props.children}</em>
|
|
37
42
|
|
|
38
|
-
export const Strong
|
|
39
|
-
|
|
40
|
-
)
|
|
43
|
+
export const Strong: React.FC<React.PropsWithChildren<ContentTree.Strong>> = (
|
|
44
|
+
props
|
|
45
|
+
) => <strong>{props.children}</strong>
|
|
41
46
|
|
|
42
|
-
export const Strikethrough
|
|
43
|
-
|
|
44
|
-
) => <s>{props.children}</s>
|
|
47
|
+
export const Strikethrough: React.FC<
|
|
48
|
+
React.PropsWithChildren<ContentTree.Strikethrough>
|
|
49
|
+
> = (props) => <s>{props.children}</s>
|
|
45
50
|
|
|
46
|
-
export const TableRow
|
|
47
|
-
|
|
48
|
-
) => <tr>{props.children}</tr>
|
|
51
|
+
export const TableRow: React.FC<
|
|
52
|
+
React.PropsWithChildren<ContentTreeWorkarounds.TableRow>
|
|
53
|
+
> = (props) => <tr>{props.children}</tr>
|
|
49
54
|
|
|
50
|
-
export const TableFooter
|
|
51
|
-
|
|
52
|
-
) => (
|
|
55
|
+
export const TableFooter: React.FC<
|
|
56
|
+
React.PropsWithChildren<ContentTreeWorkarounds.TableFooter>
|
|
57
|
+
> = (props) => (
|
|
53
58
|
<tfoot>
|
|
54
59
|
<tr>
|
|
55
60
|
<td colSpan={1000} className="o-table-footnote">
|
|
@@ -59,9 +64,9 @@ export const TableFooter = (
|
|
|
59
64
|
</tfoot>
|
|
60
65
|
)
|
|
61
66
|
|
|
62
|
-
export const TableCaption
|
|
63
|
-
|
|
64
|
-
) => (
|
|
67
|
+
export const TableCaption: React.FC<
|
|
68
|
+
React.PropsWithChildren<ContentTreeWorkarounds.TableCaption>
|
|
69
|
+
> = (props) => (
|
|
65
70
|
<caption className="n-content-body__caption n-content-body__caption--auto">
|
|
66
71
|
{props.children}
|
|
67
72
|
</caption>
|
|
@@ -123,16 +123,18 @@ function isParentNode(
|
|
|
123
123
|
return 'children' in node
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
node,
|
|
128
|
-
components,
|
|
129
|
-
references,
|
|
130
|
-
parentIndex,
|
|
131
|
-
}: {
|
|
126
|
+
type RichTextChildProps = {
|
|
132
127
|
node: ContentTreeWorkarounds.AnyNode
|
|
133
128
|
components: RichTextComponentMapRecord
|
|
134
129
|
references: StructuredContentFragment['references']
|
|
135
130
|
parentIndex: number
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const RichTextChild: React.FC<RichTextChildProps> = ({
|
|
134
|
+
node,
|
|
135
|
+
components,
|
|
136
|
+
references,
|
|
137
|
+
parentIndex,
|
|
136
138
|
}) => {
|
|
137
139
|
if (node.type === 'text') {
|
|
138
140
|
return <>{node.value}</>
|
|
@@ -175,10 +177,10 @@ const RichTextChild = ({
|
|
|
175
177
|
return null
|
|
176
178
|
}
|
|
177
179
|
|
|
178
|
-
|
|
180
|
+
const RichText: React.FC<RichTextProps> = ({
|
|
179
181
|
structuredContent,
|
|
180
182
|
components,
|
|
181
|
-
}
|
|
183
|
+
}) => {
|
|
182
184
|
if (!structuredContent) {
|
|
183
185
|
return null
|
|
184
186
|
}
|
|
@@ -205,3 +207,5 @@ export default function RichText({
|
|
|
205
207
|
</>
|
|
206
208
|
)
|
|
207
209
|
}
|
|
210
|
+
|
|
211
|
+
export default RichText
|
|
@@ -25,9 +25,9 @@ const scrollyGetBreakpoints: BreakpointGetter = (image) => {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
export const ScrollyImage: React.FC<
|
|
29
|
+
ContentTree.ScrollyImage & ScrollyImageFragment
|
|
30
|
+
> = ({ picture }) => {
|
|
31
31
|
const scrollyId = useContext(ScrollyIDContext)
|
|
32
32
|
|
|
33
33
|
if (!picture?.images) {
|
|
@@ -61,4 +61,4 @@ export function ScrollyImage({
|
|
|
61
61
|
)}
|
|
62
62
|
</figure>
|
|
63
63
|
)
|
|
64
|
-
}
|
|
64
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { createContext, useContext } from 'react'
|
|
2
2
|
import type { ContentTree } from '@financial-times/content-tree'
|
|
3
3
|
import classnames from 'classnames'
|
|
4
4
|
import type scrollytelling from '@financial-times/n-scrollytelling-image/server'
|
|
@@ -6,8 +6,8 @@ import { ParagraphContext } from '../Paragraph'
|
|
|
6
6
|
|
|
7
7
|
export const ScrollyIDContext = createContext<string | null>(null)
|
|
8
8
|
|
|
9
|
-
export const ScrollyBlock: FC<
|
|
10
|
-
PropsWithChildren<Omit<ContentTree.ScrollyBlock, 'children'>> & {
|
|
9
|
+
export const ScrollyBlock: React.FC<
|
|
10
|
+
React.PropsWithChildren<Omit<ContentTree.ScrollyBlock, 'children'>> & {
|
|
11
11
|
parentIndex: number
|
|
12
12
|
}
|
|
13
13
|
> = ({ children, theme, parentIndex }) => (
|
|
@@ -42,8 +42,8 @@ type ScrollySectionOptions = Pick<
|
|
|
42
42
|
const ScrollySectionOptionsContext =
|
|
43
43
|
createContext<ScrollySectionOptions | null>(null)
|
|
44
44
|
|
|
45
|
-
export const ScrollySection: FC<
|
|
46
|
-
PropsWithChildren<ContentTree.ScrollySection>
|
|
45
|
+
export const ScrollySection: React.FC<
|
|
46
|
+
React.PropsWithChildren<ContentTree.ScrollySection>
|
|
47
47
|
> = ({ children, display, noBox, position, transition }) => (
|
|
48
48
|
<ScrollySectionOptionsContext.Provider
|
|
49
49
|
value={{ display, noBox, position, transition }}
|
|
@@ -55,9 +55,9 @@ export const ScrollySection: FC<
|
|
|
55
55
|
type ScrollytellingDisplaySuffix =
|
|
56
56
|
scrollytelling.ScrollytellingOptionsMap['display'][keyof scrollytelling.ScrollytellingOptionsMap['display']]
|
|
57
57
|
|
|
58
|
-
export const ScrollyCopy: FC<
|
|
59
|
-
|
|
60
|
-
}) => {
|
|
58
|
+
export const ScrollyCopy: React.FC<
|
|
59
|
+
React.PropsWithChildren<ContentTree.ScrollyCopy>
|
|
60
|
+
> = ({ children }) => {
|
|
61
61
|
const { display, noBox, position, transition } = useContext(
|
|
62
62
|
ScrollySectionOptionsContext
|
|
63
63
|
) ?? {
|
|
@@ -100,8 +100,8 @@ export const ScrollyCopy: FC<PropsWithChildren<ContentTree.ScrollyCopy>> = ({
|
|
|
100
100
|
)
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
export const ScrollyHeading: FC<
|
|
104
|
-
PropsWithChildren<ContentTree.ScrollyHeading>
|
|
103
|
+
export const ScrollyHeading: React.FC<
|
|
104
|
+
React.PropsWithChildren<ContentTree.ScrollyHeading>
|
|
105
105
|
> = ({ children, level }) => {
|
|
106
106
|
const classNames = classnames(
|
|
107
107
|
'n-scrollytelling__overlay-text',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
const TableBody: React.FC<
|
|
5
|
+
React.PropsWithChildren<ContentTreeWorkarounds.TableBody>
|
|
6
|
+
> = ({ children }) => {
|
|
7
7
|
const [headerRow, ...bodyRows] = React.Children.toArray(children)
|
|
8
8
|
|
|
9
9
|
return (
|
|
@@ -13,3 +13,5 @@ export default function TableBody({
|
|
|
13
13
|
</>
|
|
14
14
|
)
|
|
15
15
|
}
|
|
16
|
+
|
|
17
|
+
export default TableBody
|
|
@@ -3,11 +3,11 @@ import type { ContentTreeWorkarounds } from '@financial-times/cp-content-pipelin
|
|
|
3
3
|
import { ColumnSettingsContext } from '.'
|
|
4
4
|
import classNames from 'classnames'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
type TableCellProps =
|
|
7
|
+
React.PropsWithChildren<ContentTreeWorkarounds.TableCell> & {
|
|
8
8
|
parentIndex: number
|
|
9
9
|
}
|
|
10
|
-
) => {
|
|
10
|
+
export const TableCell: React.FC<TableCellProps> = (props) => {
|
|
11
11
|
const allColumnSettings = useContext(ColumnSettingsContext)
|
|
12
12
|
const columnSettings: ContentTreeWorkarounds.TableColumnSettings =
|
|
13
13
|
allColumnSettings[props.parentIndex] ?? {
|
|
@@ -6,7 +6,9 @@ export const ColumnSettingsContext = createContext<
|
|
|
6
6
|
ContentTreeWorkarounds.TableColumnSettings[]
|
|
7
7
|
>([])
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const Table: React.FC<
|
|
10
|
+
React.PropsWithChildren<ContentTreeWorkarounds.Table>
|
|
11
|
+
> = ({
|
|
10
12
|
children,
|
|
11
13
|
compact,
|
|
12
14
|
layoutWidth,
|
|
@@ -14,7 +16,7 @@ export default function Table({
|
|
|
14
16
|
responsiveStyle,
|
|
15
17
|
columnSettings,
|
|
16
18
|
collapseAfterHowManyRows,
|
|
17
|
-
}
|
|
19
|
+
}) => {
|
|
18
20
|
return (
|
|
19
21
|
<ColumnSettingsContext.Provider value={columnSettings}>
|
|
20
22
|
<div
|
|
@@ -53,3 +55,5 @@ export default function Table({
|
|
|
53
55
|
</ColumnSettingsContext.Provider>
|
|
54
56
|
)
|
|
55
57
|
}
|
|
58
|
+
|
|
59
|
+
export default Table
|
|
@@ -13,11 +13,11 @@ type ColumnistProps = {
|
|
|
13
13
|
followButtonSlot?: FollowButtonSlot
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
const Columnist: React.FC<ColumnistProps> = ({
|
|
17
17
|
authorConcept,
|
|
18
18
|
followButtonVariant,
|
|
19
19
|
followButtonSlot,
|
|
20
|
-
}
|
|
20
|
+
}) => {
|
|
21
21
|
return (
|
|
22
22
|
<div className="o-topper__columnist">
|
|
23
23
|
<a
|
|
@@ -36,3 +36,5 @@ export default function Columnist({
|
|
|
36
36
|
</div>
|
|
37
37
|
)
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
export default Columnist
|
|
@@ -7,11 +7,11 @@ type HeadlineProps = {
|
|
|
7
7
|
isLargeHeadline?: boolean
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const Headline: React.FC<HeadlineProps> = ({
|
|
11
11
|
headline,
|
|
12
12
|
showPremiumLabel = false,
|
|
13
13
|
isLargeHeadline = false,
|
|
14
|
-
}
|
|
14
|
+
}) => {
|
|
15
15
|
if (!headline) {
|
|
16
16
|
return <></>
|
|
17
17
|
}
|
|
@@ -32,3 +32,5 @@ export default function Headline({
|
|
|
32
32
|
</h1>
|
|
33
33
|
)
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
export default Headline
|
|
@@ -3,7 +3,7 @@ import RichText from '../RichText'
|
|
|
3
3
|
import type { IntroFragment } from '@financial-times/cp-content-pipeline-client'
|
|
4
4
|
import classNames from 'classnames'
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const Intro: React.FC<IntroFragment> = ({ structured, source }) => {
|
|
7
7
|
return (
|
|
8
8
|
<div
|
|
9
9
|
className={classNames(`o-topper__${source}`, {
|
|
@@ -14,3 +14,5 @@ export default function Intro({ structured, source }: IntroFragment) {
|
|
|
14
14
|
</div>
|
|
15
15
|
)
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
export default Intro
|
|
@@ -13,10 +13,10 @@ type LiveBlogIndicatorProps = {
|
|
|
13
13
|
realtime?: boolean
|
|
14
14
|
lastUpdatedDateTime: string
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
const LiveBlogIndicator: React.FC<LiveBlogIndicatorProps> = ({
|
|
17
17
|
realtime,
|
|
18
18
|
lastUpdatedDateTime,
|
|
19
|
-
}
|
|
19
|
+
}) => {
|
|
20
20
|
const liveBlogStatus = realtime ? 'live' : 'closed'
|
|
21
21
|
const indicatorStatusClasses = classnames(
|
|
22
22
|
'o-labels-indicator',
|
|
@@ -52,3 +52,5 @@ export default function LiveBlogIndicator({
|
|
|
52
52
|
</div>
|
|
53
53
|
)
|
|
54
54
|
}
|
|
55
|
+
|
|
56
|
+
export default LiveBlogIndicator
|
|
@@ -4,11 +4,6 @@ import type { TopperFragment } from '@financial-times/cp-content-pipeline-client
|
|
|
4
4
|
|
|
5
5
|
import { AliasedBreakpoints, BreakpointGetter, Sources } from '../ImageSet'
|
|
6
6
|
|
|
7
|
-
type PictureProps = {
|
|
8
|
-
topper: TopperFragment
|
|
9
|
-
alt?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
7
|
const topperGetBreakpointsMap: Partial<
|
|
13
8
|
Record<TopperFragment['__typename'], BreakpointGetter>
|
|
14
9
|
> = {
|
|
@@ -69,7 +64,12 @@ const topperGetBreakpointsMap: Partial<
|
|
|
69
64
|
},
|
|
70
65
|
}
|
|
71
66
|
|
|
72
|
-
|
|
67
|
+
type PictureProps = {
|
|
68
|
+
topper: TopperFragment
|
|
69
|
+
alt?: string
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const Picture: React.FC<PictureProps> = ({ topper, alt = '' }) => {
|
|
73
73
|
if (!('images' in topper) || !topper.fallbackImage) {
|
|
74
74
|
return null
|
|
75
75
|
}
|
|
@@ -105,3 +105,5 @@ export default function Picture({ topper, alt = '' }: PictureProps) {
|
|
|
105
105
|
</figure>
|
|
106
106
|
)
|
|
107
107
|
}
|
|
108
|
+
|
|
109
|
+
export default Picture
|
|
@@ -18,7 +18,7 @@ type TagsProps = {
|
|
|
18
18
|
headshot?: string
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
const Tags: React.FC<TagsProps> = ({
|
|
22
22
|
__typename,
|
|
23
23
|
isPackage,
|
|
24
24
|
displayConcept,
|
|
@@ -28,7 +28,7 @@ export default function Tags({
|
|
|
28
28
|
followButtonVariant,
|
|
29
29
|
headshot,
|
|
30
30
|
FollowButtonSlot,
|
|
31
|
-
}
|
|
31
|
+
}) => {
|
|
32
32
|
const isOpinion = __typename === 'OpinionTopper'
|
|
33
33
|
const concept = getConcept(displayConcept, genreConcept)
|
|
34
34
|
const baseFollowButtonCondition = FollowButtonSlot && concept?.id
|
|
@@ -87,7 +87,7 @@ function getConcept(
|
|
|
87
87
|
return null
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
const BrandConcept: React.FC<ConceptFragment> = (concept) => {
|
|
91
91
|
return (
|
|
92
92
|
<a
|
|
93
93
|
href={concept.relativeUrl ?? undefined}
|
|
@@ -100,7 +100,7 @@ function BrandConcept(concept: ConceptFragment) {
|
|
|
100
100
|
)
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
const ConceptLabel: React.FC<ConceptFragment> = (concept) => {
|
|
104
104
|
return (
|
|
105
105
|
<a
|
|
106
106
|
href={concept.relativeUrl}
|
|
@@ -113,3 +113,5 @@ function ConceptLabel(concept: ConceptFragment) {
|
|
|
113
113
|
</a>
|
|
114
114
|
)
|
|
115
115
|
}
|
|
116
|
+
|
|
117
|
+
export default Tags
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import classnames from 'classnames'
|
|
3
3
|
|
|
4
4
|
type WrapperProps = {
|
|
5
|
-
children: ReactNode
|
|
6
5
|
isPackage?: boolean
|
|
7
6
|
isBasic?: boolean
|
|
8
7
|
modifiers: string[]
|
|
9
8
|
backgroundColor?: string
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
const Wrapper: React.FC<React.PropsWithChildren<WrapperProps>> = ({
|
|
13
12
|
children,
|
|
14
13
|
isBasic,
|
|
15
14
|
modifiers = [],
|
|
16
15
|
backgroundColor,
|
|
17
|
-
}
|
|
16
|
+
}) => {
|
|
18
17
|
const modifierClasses = modifiers.map((modifier) => `o-topper--${modifier}`)
|
|
19
18
|
const modifierClassesString = modifierClasses.toString().replace(/,/g, ' ')
|
|
20
19
|
|
|
@@ -28,3 +27,5 @@ export default function Wrapper({
|
|
|
28
27
|
|
|
29
28
|
return <div className={wrapperClassnames}>{children}</div>
|
|
30
29
|
}
|
|
30
|
+
|
|
31
|
+
export default Wrapper
|
|
@@ -21,13 +21,13 @@ export type TopperProps = {
|
|
|
21
21
|
readNextSlot?: () => ReactElement
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const Topper: React.FC<TopperProps> = ({
|
|
25
25
|
content,
|
|
26
26
|
slot,
|
|
27
27
|
followButtonSlot,
|
|
28
28
|
showPremiumLabel = false,
|
|
29
29
|
readNextSlot,
|
|
30
|
-
}
|
|
30
|
+
}) => {
|
|
31
31
|
const { topper } = content
|
|
32
32
|
|
|
33
33
|
if (!topper) {
|
|
@@ -191,3 +191,5 @@ export default function Topper({
|
|
|
191
191
|
</Fragment>
|
|
192
192
|
)
|
|
193
193
|
}
|
|
194
|
+
|
|
195
|
+
export default Topper
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import type { ContentTree } from '@financial-times/content-tree'
|
|
3
3
|
import { TweetFragment } from '@financial-times/cp-content-pipeline-client'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const Tweet: React.FC<ContentTree.Tweet & TweetFragment> = (tweet) => {
|
|
6
6
|
if (tweet.html) {
|
|
7
7
|
return (
|
|
8
8
|
<div
|
|
@@ -19,3 +19,5 @@ export default function Tweet(tweet: ContentTree.Tweet & TweetFragment) {
|
|
|
19
19
|
}
|
|
20
20
|
return null
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
export default Tweet
|
|
@@ -2,11 +2,11 @@ import React from 'react'
|
|
|
2
2
|
import { VideoFragment } from '@financial-times/cp-content-pipeline-client'
|
|
3
3
|
import { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const Video: React.FC<VideoFragment & ContentTreeWorkarounds.Video> = ({
|
|
6
6
|
id,
|
|
7
7
|
embedded,
|
|
8
8
|
title,
|
|
9
|
-
}
|
|
9
|
+
}) => {
|
|
10
10
|
return (
|
|
11
11
|
<div
|
|
12
12
|
className="n-content-video n-content-video--internal"
|
|
@@ -29,3 +29,5 @@ export default function Video({
|
|
|
29
29
|
</div>
|
|
30
30
|
)
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
export default Video
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const YoutubeVideo: React.FC<ContentTreeWorkarounds.YoutubeVideo> = ({
|
|
5
5
|
url,
|
|
6
|
-
}
|
|
6
|
+
}) => {
|
|
7
7
|
try {
|
|
8
8
|
const parsed = new URL(url)
|
|
9
9
|
const id = parsed.searchParams.get('v')
|
|
@@ -32,3 +32,5 @@ export default function YoutubeVideo({
|
|
|
32
32
|
return null
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
export default YoutubeVideo
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
1
2
|
import ClipServer from '../components/Clip'
|
|
2
3
|
import ClipClient from '../components/Clip/client'
|
|
3
|
-
import React, { useEffect, ReactNode } from 'react'
|
|
4
4
|
import oTracking from '@financial-times/o-tracking/main'
|
|
5
5
|
import './Clip.stories.scss'
|
|
6
6
|
import { ClipProps } from '../components/Clip/template/component'
|
|
@@ -18,11 +18,7 @@ export default {
|
|
|
18
18
|
},
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
children: ReactNode
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const ArticleWrapper: React.FC<ArticleWrapperProps> = ({ children }) => {
|
|
21
|
+
const ArticleWrapper: React.FC<React.PropsWithChildren> = ({ children }) => {
|
|
26
22
|
return (
|
|
27
23
|
<article
|
|
28
24
|
id="site-content"
|