@financial-times/cp-content-pipeline-ui 6.7.0 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/lib/components/Clip/client/progressBar.js +2 -10
- package/lib/components/Clip/client/progressBar.js.map +1 -1
- package/lib/components/Clip/components/Container.js +2 -2
- package/lib/components/Clip/components/Container.js.map +1 -1
- package/lib/components/Clip/template/index.js +1 -0
- package/lib/components/Clip/template/index.js.map +1 -1
- package/lib/components/ImageSet/index.js +1 -1
- package/lib/components/ImageSet/index.js.map +1 -1
- package/lib/components/LiveBlogPost/index.js +21 -9
- package/lib/components/LiveBlogPost/index.js.map +1 -1
- package/lib/components/LiveBlogWrapper/index.js +1 -1
- package/lib/components/LiveBlogWrapper/index.js.map +1 -1
- package/lib/components/PartnerContentHeader/index.d.ts +5 -0
- package/lib/components/PartnerContentHeader/index.js +14 -0
- package/lib/components/PartnerContentHeader/index.js.map +1 -0
- package/lib/components/Recommended/index.js +1 -1
- package/lib/components/Recommended/index.js.map +1 -1
- package/lib/components/RichText/index.d.ts +1 -1
- package/lib/components/Table/index.js +1 -1
- package/lib/components/Table/index.js.map +1 -1
- package/lib/components/Topper/index.js +51 -24
- package/lib/components/Topper/index.js.map +1 -1
- package/lib/components/Video/index.js +1 -1
- package/lib/components/Video/index.js.map +1 -1
- package/lib/components/YoutubeVideo/index.js +1 -1
- package/lib/components/YoutubeVideo/index.js.map +1 -1
- package/lib/stories/Clip.stories.d.ts +1 -2
- package/lib/stories/Clip.stories.js +5 -5
- package/lib/stories/Clip.stories.js.map +1 -1
- package/package.json +5 -2
- package/src/components/Clip/client/main.scss +2 -2
- package/src/components/Clip/client/progressBar.scss +8 -14
- package/src/components/Clip/client/progressBar.ts +2 -8
- package/src/components/Clip/components/Container.tsx +3 -10
- package/src/components/Clip/template/index.ts +1 -0
- package/src/components/Clip/test/__snapshots__/snapshot.spec.tsx.snap +8 -8
- package/src/components/ImageSet/index.tsx +0 -1
- package/src/components/LiveBlogPost/index.tsx +42 -29
- package/src/components/LiveBlogWrapper/index.tsx +0 -1
- package/src/components/PartnerContentHeader/index.tsx +15 -0
- package/src/components/Recommended/index.tsx +0 -1
- package/src/components/Table/index.tsx +0 -1
- package/src/components/Topper/index.tsx +97 -91
- package/src/components/Video/index.tsx +1 -4
- package/src/components/YoutubeVideo/index.tsx +1 -4
- package/src/stories/Clip.stories.tsx +2 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/components/Expander/client/index.d.ts +0 -49
- package/lib/components/Expander/client/index.js +0 -124
- package/lib/components/Expander/client/index.js.map +0 -1
- package/lib/components/Expander/index.d.ts +0 -15
- package/lib/components/Expander/index.js +0 -27
- package/lib/components/Expander/index.js.map +0 -1
- package/lib/components/Expander/test/client/index.spec.d.ts +0 -1
- package/lib/components/Expander/test/client/index.spec.js +0 -103
- package/lib/components/Expander/test/client/index.spec.js.map +0 -1
- package/lib/components/Expander/test/index.spec.d.ts +0 -1
- package/lib/components/Expander/test/index.spec.js +0 -57
- package/lib/components/Expander/test/index.spec.js.map +0 -1
- package/lib/components/Expander/test/snapshot.spec.d.ts +0 -1
- package/lib/components/Expander/test/snapshot.spec.js +0 -63
- package/lib/components/Expander/test/snapshot.spec.js.map +0 -1
- package/lib/components/LiveBlogPost/client/index.d.ts +0 -5
- package/lib/components/LiveBlogPost/client/index.js +0 -12
- package/lib/components/LiveBlogPost/client/index.js.map +0 -1
- package/lib/stories/Expander.stories.d.ts +0 -54
- package/lib/stories/Expander.stories.js +0 -142
- package/lib/stories/Expander.stories.js.map +0 -1
- package/src/components/Expander/client/index.ts +0 -197
- package/src/components/Expander/client/main.scss +0 -162
- package/src/components/Expander/index.tsx +0 -74
- package/src/components/Expander/test/__snapshots__/snapshot.spec.tsx.snap +0 -225
- package/src/components/Expander/test/client/index.spec.tsx +0 -129
- package/src/components/Expander/test/index.spec.tsx +0 -77
- package/src/components/Expander/test/snapshot.spec.tsx +0 -73
- package/src/components/LiveBlogPost/client/index.ts +0 -9
- package/src/stories/Expander.stories.scss +0 -3
- package/src/stories/Expander.stories.tsx +0 -159
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactElement } from 'react'
|
|
1
|
+
import React, { Fragment, ReactElement } from 'react'
|
|
2
2
|
import Wrapper from './Wrapper'
|
|
3
3
|
import Tags from './Tags'
|
|
4
4
|
import Headline from './Headline'
|
|
@@ -12,6 +12,7 @@ import Flourish from '../Flourish'
|
|
|
12
12
|
import { Layout, LayoutContainer } from '../Layout'
|
|
13
13
|
import classnames from 'classnames'
|
|
14
14
|
import type { ArticleQuery } from '@financial-times/cp-content-pipeline-client'
|
|
15
|
+
import PartnerContentHeader from '../PartnerContentHeader'
|
|
15
16
|
|
|
16
17
|
export type TopperProps = {
|
|
17
18
|
content: ArticleQuery['content']
|
|
@@ -42,6 +43,7 @@ export default function Topper({
|
|
|
42
43
|
const isFlourish =
|
|
43
44
|
topper.__typename === 'TopperWithFlourish' && !!topper.leadFlourish
|
|
44
45
|
const isAudio = content.__typename === 'Audio'
|
|
46
|
+
const isPartnerContent = topper.__typename === 'PartnerContentTopper'
|
|
45
47
|
const hasLayout = 'layout' in topper && topper.layout
|
|
46
48
|
const hasDesign = 'design' in topper && topper.design
|
|
47
49
|
const hasHeadshot = 'headshot' in topper && topper.headshot
|
|
@@ -86,104 +88,108 @@ export default function Topper({
|
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
return (
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
isBasic={isBasic}
|
|
98
|
-
modifiers={modifiers}
|
|
91
|
+
<Fragment>
|
|
92
|
+
{/** TODO: make the name dynamic when upstream is ready */}
|
|
93
|
+
{isPartnerContent && <PartnerContentHeader name="Demo Partner" />}
|
|
94
|
+
<div
|
|
95
|
+
className={classnames({
|
|
96
|
+
'article-topper': true,
|
|
97
|
+
'pinned-post__topper--no-image': isLiveBlog,
|
|
98
|
+
})}
|
|
99
99
|
>
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
})}
|
|
105
|
-
id="o-topper"
|
|
100
|
+
<Wrapper
|
|
101
|
+
backgroundColor={topper.backgroundColour ?? undefined}
|
|
102
|
+
isBasic={isBasic}
|
|
103
|
+
modifiers={modifiers}
|
|
106
104
|
>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
<div
|
|
106
|
+
className={classnames('o-topper__content', {
|
|
107
|
+
'o-topper__content--text-shadow': topper.textShadow,
|
|
108
|
+
'o-topper__content--background-box': topper.backgroundBox,
|
|
109
|
+
})}
|
|
110
|
+
id="o-topper"
|
|
111
|
+
>
|
|
112
|
+
{isLiveBlog ? (
|
|
113
|
+
<div className="o-topper__tags">
|
|
114
|
+
<LiveBlogIndicator
|
|
115
|
+
realtime={content.realtime ?? undefined}
|
|
116
|
+
lastUpdatedDateTime={getMostRecentPostPublishedDate()}
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
) : (
|
|
120
|
+
<Tags
|
|
121
|
+
__typename={topper.__typename}
|
|
122
|
+
isPackage={isPackage}
|
|
123
|
+
displayConcept={topper.displayConcept ?? undefined}
|
|
124
|
+
brandConcept={
|
|
125
|
+
('brandConcept' in topper && topper.brandConcept) || undefined
|
|
126
|
+
}
|
|
127
|
+
genreConcept={
|
|
128
|
+
('genreConcept' in topper && topper.genreConcept) || undefined
|
|
129
|
+
}
|
|
130
|
+
headshot={hasHeadshot || undefined}
|
|
131
|
+
hasColumnist={hasColumnist}
|
|
132
|
+
followButtonVariant={topper.followButtonVariant}
|
|
133
|
+
FollowButtonSlot={followButtonSlot}
|
|
112
134
|
/>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
displayConcept={topper.displayConcept ?? undefined}
|
|
119
|
-
brandConcept={
|
|
120
|
-
('brandConcept' in topper && topper.brandConcept) || undefined
|
|
135
|
+
)}
|
|
136
|
+
<Headline
|
|
137
|
+
headline={topper.headline}
|
|
138
|
+
showPremiumLabel={
|
|
139
|
+
showPremiumLabel && content.accessLevel === 'premium'
|
|
121
140
|
}
|
|
122
|
-
|
|
123
|
-
('
|
|
141
|
+
isLargeHeadline={
|
|
142
|
+
('isLargeHeadline' in topper && topper.isLargeHeadline) ??
|
|
143
|
+
undefined
|
|
124
144
|
}
|
|
125
|
-
headshot={hasHeadshot || undefined}
|
|
126
|
-
hasColumnist={hasColumnist}
|
|
127
|
-
followButtonVariant={topper.followButtonVariant}
|
|
128
|
-
FollowButtonSlot={followButtonSlot}
|
|
129
145
|
/>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
{isLiveBlog && isFlourish ? (
|
|
147
|
+
<Layout layoutWidth="full-grid">
|
|
148
|
+
<LayoutContainer>
|
|
149
|
+
<Flourish
|
|
150
|
+
id={topper.leadFlourish.id || ''}
|
|
151
|
+
flourishType={topper.leadFlourish.type || ''}
|
|
152
|
+
description={topper.leadFlourish.description || ''}
|
|
153
|
+
fallbackImage={topper.leadFlourish.fallbackImage || ''}
|
|
154
|
+
iFrame={true}
|
|
155
|
+
inArticleBody={false}
|
|
156
|
+
/>
|
|
157
|
+
</LayoutContainer>
|
|
158
|
+
</Layout>
|
|
159
|
+
) : (
|
|
160
|
+
''
|
|
161
|
+
)}
|
|
162
|
+
{topper.intro && (
|
|
163
|
+
<Intro
|
|
164
|
+
structured={topper.intro.structured}
|
|
165
|
+
source={topper.intro.source}
|
|
166
|
+
/>
|
|
167
|
+
)}
|
|
168
|
+
{hasHeadshot && !isAudio && isOpinion && topper.columnist && (
|
|
169
|
+
<div className="o-topper__headshot">
|
|
170
|
+
<Headshot
|
|
171
|
+
headshot={topper.headshot}
|
|
172
|
+
prefLabel={topper.columnist.prefLabel}
|
|
173
|
+
className={'o-topper__headshot-image'}
|
|
174
|
+
altText={headshotAltText}
|
|
151
175
|
/>
|
|
152
|
-
</
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
structured={topper.intro.structured}
|
|
160
|
-
source={topper.intro.source}
|
|
161
|
-
/>
|
|
162
|
-
)}
|
|
163
|
-
{hasHeadshot && !isAudio && isOpinion && topper.columnist && (
|
|
164
|
-
<div className="o-topper__headshot">
|
|
165
|
-
<Headshot
|
|
166
|
-
headshot={topper.headshot}
|
|
167
|
-
prefLabel={topper.columnist.prefLabel}
|
|
168
|
-
className={'o-topper__headshot-image'}
|
|
169
|
-
altText={headshotAltText}
|
|
176
|
+
</div>
|
|
177
|
+
)}
|
|
178
|
+
{isOpinion && topper.columnist && (
|
|
179
|
+
<Columnist
|
|
180
|
+
authorConcept={topper.columnist}
|
|
181
|
+
followButtonVariant={topper.followButtonVariant}
|
|
182
|
+
followButtonSlot={followButtonSlot}
|
|
170
183
|
/>
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
{
|
|
174
|
-
<
|
|
175
|
-
authorConcept={topper.columnist}
|
|
176
|
-
followButtonVariant={topper.followButtonVariant}
|
|
177
|
-
followButtonSlot={followButtonSlot}
|
|
178
|
-
/>
|
|
184
|
+
)}
|
|
185
|
+
</div>
|
|
186
|
+
{readNextSlot && (
|
|
187
|
+
<div className="o-topper__read-next">{readNextSlot()}</div>
|
|
179
188
|
)}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
{'images' in topper && <Picture topper={topper} />}
|
|
186
|
-
</Wrapper>
|
|
187
|
-
</div>
|
|
189
|
+
<div className="o-topper__background" />
|
|
190
|
+
{'images' in topper && <Picture topper={topper} />}
|
|
191
|
+
</Wrapper>
|
|
192
|
+
</div>
|
|
193
|
+
</Fragment>
|
|
188
194
|
)
|
|
189
195
|
}
|
|
@@ -8,10 +8,7 @@ export default function Video({
|
|
|
8
8
|
title,
|
|
9
9
|
}: VideoFragment & ContentTreeWorkarounds.Video) {
|
|
10
10
|
return (
|
|
11
|
-
<div
|
|
12
|
-
className="n-content-video n-content-video--internal"
|
|
13
|
-
data-component="video"
|
|
14
|
-
>
|
|
11
|
+
<div className="n-content-video n-content-video--internal">
|
|
15
12
|
<div
|
|
16
13
|
className="n-content-video__placeholder"
|
|
17
14
|
data-o-component="o-video"
|
|
@@ -13,10 +13,7 @@ export default function YoutubeVideo({
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
|
-
<div
|
|
17
|
-
className="n-content-video n-content-video--youtube"
|
|
18
|
-
data-component="youtube-video"
|
|
19
|
-
>
|
|
16
|
+
<div className="n-content-video n-content-video--youtube">
|
|
20
17
|
<div className="n-content-video__placeholder">
|
|
21
18
|
<iframe
|
|
22
19
|
className="n-content-video__embedded"
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import ClipServer from '../components/Clip'
|
|
2
|
-
import ClipClient from '../components/Clip/client'
|
|
3
1
|
import React, { useEffect, ReactNode } from 'react'
|
|
4
2
|
import oTracking from '@financial-times/o-tracking/main'
|
|
5
3
|
import './Clip.stories.scss'
|
|
6
|
-
import
|
|
4
|
+
import ClipClient from '../components/Clip/client'
|
|
5
|
+
import ClipServer, { ClipProps } from '../components/Clip/template/component'
|
|
7
6
|
|
|
8
7
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
|
|
9
8
|
export default {
|