@financial-times/cp-content-pipeline-ui 6.15.6 → 7.0.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 +15 -0
- package/lib/components/BigNumber/index.d.ts +4 -1
- package/lib/components/BigNumber/index.js +1 -1
- package/lib/components/BigNumber/index.js.map +1 -1
- package/lib/components/Body/index.test.js +12 -1
- package/lib/components/Body/index.test.js.map +1 -1
- package/lib/components/Byline/index.js +2 -2
- package/lib/components/Byline/index.js.map +1 -1
- package/lib/components/Clip/components/ClipTag.d.ts +3 -3
- 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/VideoDescription.d.ts +2 -2
- package/lib/components/Clip/components/VideoDescription.js.map +1 -1
- package/lib/components/Clip/template/component.d.ts +9 -4
- package/lib/components/Clip/template/component.js +19 -14
- package/lib/components/Clip/template/component.js.map +1 -1
- package/lib/components/Clip/test/fixtures.js +114 -77
- package/lib/components/Clip/test/fixtures.js.map +1 -1
- package/lib/components/Clip/test/snapshot.spec.js +110 -61
- package/lib/components/Clip/test/snapshot.spec.js.map +1 -1
- package/lib/components/Flourish/index.d.ts +4 -12
- package/lib/components/Flourish/index.js +1 -1
- package/lib/components/Flourish/index.js.map +1 -1
- package/lib/components/Flourish/test/snapshot.spec.js +48 -6
- package/lib/components/Flourish/test/snapshot.spec.js.map +1 -1
- package/lib/components/Heading/index.d.ts +2 -1
- package/lib/components/Heading/index.js +2 -2
- package/lib/components/Heading/index.js.map +1 -1
- package/lib/components/ImageOverrideWrappers/index.d.ts +4 -0
- package/lib/components/ImageOverrideWrappers/index.js +44 -0
- package/lib/components/ImageOverrideWrappers/index.js.map +1 -0
- package/lib/components/ImageSet/index.d.ts +12 -8
- package/lib/components/ImageSet/index.js +13 -8
- package/lib/components/ImageSet/index.js.map +1 -1
- package/lib/components/Layout/index.d.ts +3 -13
- package/lib/components/Layout/index.js +1 -1
- package/lib/components/Layout/index.js.map +1 -1
- package/lib/components/MainImage/index.js +2 -2
- package/lib/components/MainImage/index.js.map +1 -1
- package/lib/components/Paragraph/index.d.ts +4 -1
- package/lib/components/Paragraph/index.js.map +1 -1
- package/lib/components/Pullquote/index.d.ts +4 -1
- package/lib/components/Pullquote/index.js +7 -6
- package/lib/components/Pullquote/index.js.map +1 -1
- package/lib/components/Recommended/index.d.ts +5 -8
- package/lib/components/Recommended/index.js +1 -6
- package/lib/components/Recommended/index.js.map +1 -1
- package/lib/components/RichText/BasicComponents.d.ts +12 -11
- package/lib/components/RichText/BasicComponents.js +2 -2
- package/lib/components/RichText/BasicComponents.js.map +1 -1
- package/lib/components/RichText/index.d.ts +10 -3
- package/lib/components/RichText/index.js +8 -2
- package/lib/components/RichText/index.js.map +1 -1
- package/lib/components/Scrollytelling/ScrollyImage.d.ts +6 -3
- package/lib/components/Scrollytelling/ScrollyImage.js +2 -2
- package/lib/components/Scrollytelling/ScrollyImage.js.map +1 -1
- package/lib/components/Scrollytelling/index.d.ts +14 -6
- package/lib/components/Scrollytelling/index.js +3 -3
- package/lib/components/Scrollytelling/index.js.map +1 -1
- package/lib/components/Table/TableBody.d.ts +4 -1
- package/lib/components/Table/TableBody.js +1 -1
- package/lib/components/Table/TableBody.js.map +1 -1
- package/lib/components/Table/TableCell.d.ts +4 -4
- package/lib/components/Table/TableCell.js +2 -2
- package/lib/components/Table/TableCell.js.map +1 -1
- package/lib/components/Table/index.d.ts +4 -1
- package/lib/components/Table/index.js +1 -1
- package/lib/components/Table/index.js.map +1 -1
- package/lib/components/Topper/Picture.d.ts +1 -1
- package/lib/components/Topper/Picture.js +6 -3
- package/lib/components/Topper/Picture.js.map +1 -1
- package/lib/components/Topper/index.js +7 -1
- package/lib/components/Topper/index.js.map +1 -1
- package/lib/components/Tweet/index.d.ts +4 -2
- package/lib/components/Tweet/index.js +1 -1
- package/lib/components/Tweet/index.js.map +1 -1
- package/lib/components/Video/index.d.ts +4 -2
- package/lib/components/Video/index.js +1 -1
- package/lib/components/Video/index.js.map +1 -1
- package/lib/components/Workarounds.d.ts +88 -0
- package/lib/components/Workarounds.js +3 -0
- package/lib/components/Workarounds.js.map +1 -0
- package/lib/components/YoutubeVideo/index.d.ts +5 -2
- package/lib/components/YoutubeVideo/index.js +1 -1
- package/lib/components/YoutubeVideo/index.js.map +1 -1
- package/lib/components/types.d.ts +5 -0
- package/lib/components/types.js +3 -0
- package/lib/components/types.js.map +1 -0
- package/lib/context.d.ts +14 -0
- package/lib/context.js +2 -1
- package/lib/context.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/stories/Clip.stories.d.ts +39 -243
- package/lib/stories/Clip.stories.js +320 -307
- package/lib/stories/Clip.stories.js.map +1 -1
- package/package.json +2 -1
- package/src/components/BigNumber/index.tsx +6 -3
- package/src/components/Body/__snapshots__/index.test.tsx.snap +2 -1
- package/src/components/Body/index.test.tsx +12 -1
- package/src/components/Byline/index.tsx +9 -4
- package/src/components/Clip/components/ClipTag.tsx +3 -6
- package/src/components/Clip/components/ClosedCaptions.tsx +2 -2
- package/src/components/Clip/components/VideoDescription.tsx +2 -2
- package/src/components/Clip/template/component.tsx +39 -41
- package/src/components/Clip/test/__snapshots__/snapshot.spec.tsx.snap +4 -8
- package/src/components/Clip/test/fixtures.ts +127 -90
- package/src/components/Clip/test/snapshot.spec.tsx +123 -102
- package/src/components/Flourish/index.tsx +10 -21
- package/src/components/Flourish/test/snapshot.spec.tsx +48 -36
- package/src/components/Heading/index.tsx +6 -5
- package/src/components/ImageOverrideWrappers/index.tsx +34 -0
- package/src/components/ImageSet/index.tsx +75 -55
- package/src/components/Layout/index.tsx +6 -18
- package/src/components/MainImage/index.tsx +10 -8
- package/src/components/Paragraph/index.tsx +4 -1
- package/src/components/Pullquote/index.tsx +15 -8
- package/src/components/Recommended/index.tsx +11 -11
- package/src/components/RichText/BasicComponents.tsx +22 -20
- package/src/components/RichText/index.tsx +35 -12
- package/src/components/Scrollytelling/ScrollyImage.tsx +10 -7
- package/src/components/Scrollytelling/index.tsx +19 -9
- package/src/components/Table/TableBody.tsx +7 -3
- package/src/components/Table/TableCell.tsx +9 -7
- package/src/components/Table/index.tsx +12 -9
- package/src/components/Topper/Picture.tsx +17 -12
- package/src/components/Topper/index.tsx +7 -4
- package/src/components/Tweet/index.tsx +4 -2
- package/src/components/Video/index.tsx +4 -6
- package/src/components/Workarounds.ts +188 -0
- package/src/components/YoutubeVideo/index.tsx +5 -4
- package/src/components/types.ts +6 -0
- package/src/context.ts +22 -1
- package/src/index.ts +4 -1
- package/src/stories/Clip.stories.tsx +357 -341
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -5,108 +5,145 @@ if (typeof global.TextEncoder === 'undefined') {
|
|
|
5
5
|
import Clip from '../template/index'
|
|
6
6
|
|
|
7
7
|
export const inlineVideo = Clip({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
content: {
|
|
9
|
+
type: 'clip',
|
|
10
|
+
id: '',
|
|
11
|
+
dataLayout: 'in-line',
|
|
12
|
+
url: 'https://d1e00ek4ebabms.cloudfront.net/production/84d7e1b0-e8b2-4ffc-a798-306f29dc9d52.png',
|
|
13
|
+
description:
|
|
14
|
+
' Dolor sit amet, consectetur adipiscing elit. Sed sit amet odio quis ante auctor dapibus. Sed dapibus cursus nisi, tincidunt sagittis sapien vehicula vitae.',
|
|
15
|
+
poster:
|
|
16
|
+
'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fd1e00ek4ebabms.cloudfront.net%2Fproduction%2F84d7e1b0-e8b2-4ffc-a798-306f29dc9d52.png?fit=scale-down&source=next&width=700',
|
|
17
|
+
posterAlt: '',
|
|
18
|
+
posterCredits: '',
|
|
19
|
+
caption: 'Aenean lobortis volutpat nunc vitae elementum',
|
|
20
|
+
autoplay: false,
|
|
21
|
+
muted: false,
|
|
22
|
+
loop: false,
|
|
23
|
+
credits: '',
|
|
24
|
+
},
|
|
15
25
|
})
|
|
16
26
|
export const inlineVideoAutoplay = Clip({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
content: {
|
|
28
|
+
type: 'clip',
|
|
29
|
+
id: '',
|
|
30
|
+
dataLayout: 'in-line',
|
|
31
|
+
url: 'https://d1e00ek4ebabms.cloudfront.net/production/84d7e1b0-e8b2-4ffc-a798-306f29dc9d52.png',
|
|
32
|
+
description:
|
|
33
|
+
' Dolor sit amet, consectetur adipiscing elit. Sed sit amet odio quis ante auctor dapibus. Sed dapibus cursus nisi, tincidunt sagittis sapien vehicula vitae.',
|
|
34
|
+
poster:
|
|
35
|
+
'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fd1e00ek4ebabms.cloudfront.net%2Fproduction%2F84d7e1b0-e8b2-4ffc-a798-306f29dc9d52.png?fit=scale-down&source=next&width=700',
|
|
36
|
+
posterAlt: '',
|
|
37
|
+
posterCredits: '',
|
|
38
|
+
caption: 'Aenean lobortis volutpat nunc vitae elementum',
|
|
39
|
+
autoplay: true,
|
|
40
|
+
muted: true,
|
|
41
|
+
loop: true,
|
|
42
|
+
credits: 'Copyright Line',
|
|
43
|
+
accessibility: {
|
|
44
|
+
captions: [
|
|
45
|
+
{
|
|
46
|
+
url: 'https://next-media-api.ft.com/captions/16862228218010.vtt',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
34
50
|
},
|
|
35
51
|
})
|
|
36
52
|
export const inlineVideoNoAudio = Clip({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
content: {
|
|
54
|
+
type: 'clip',
|
|
55
|
+
id: '',
|
|
56
|
+
dataLayout: 'in-line',
|
|
57
|
+
url: 'https://d1e00ek4ebabms.cloudfront.net/production/84d7e1b0-e8b2-4ffc-a798-306f29dc9d52.png',
|
|
58
|
+
description:
|
|
59
|
+
' Dolor sit amet, consectetur adipiscing elit. Sed sit amet odio quis ante auctor dapibus. Sed dapibus cursus nisi, tincidunt sagittis sapien vehicula vitae.',
|
|
60
|
+
poster:
|
|
61
|
+
'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fd1e00ek4ebabms.cloudfront.net%2Fproduction%2F84d7e1b0-e8b2-4ffc-a798-306f29dc9d52.png?fit=scale-down&source=next&width=700',
|
|
62
|
+
posterAlt: '',
|
|
63
|
+
posterCredits: '',
|
|
64
|
+
caption: 'Aenean lobortis volutpat nunc vitae elementum',
|
|
65
|
+
autoplay: true,
|
|
66
|
+
muted: true,
|
|
67
|
+
loop: true,
|
|
68
|
+
credits: 'Copyright Line',
|
|
69
|
+
accessibility: {
|
|
70
|
+
captions: [
|
|
71
|
+
{
|
|
72
|
+
url: 'https://next-media-api.ft.com/captions/16862228218010.vtt',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
noAudio: true,
|
|
55
77
|
},
|
|
56
78
|
})
|
|
57
79
|
|
|
58
80
|
export const teaserClipWithoutExpander = Clip({
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
'https://
|
|
64
|
-
|
|
81
|
+
content: {
|
|
82
|
+
type: 'clip',
|
|
83
|
+
id: '',
|
|
84
|
+
dataLayout: 'in-line',
|
|
85
|
+
url: 'https://d1e00ek4ebabms.cloudfront.net/production/84d7e1b0-e8b2-4ffc-a798-306f29dc9d52.png',
|
|
86
|
+
description: '',
|
|
87
|
+
poster:
|
|
88
|
+
'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fd1e00ek4ebabms.cloudfront.net%2Fproduction%2F84d7e1b0-e8b2-4ffc-a798-306f29dc9d52.png?fit=scale-down&source=next&width=700',
|
|
89
|
+
posterAlt: '',
|
|
90
|
+
posterCredits: '',
|
|
91
|
+
caption: '',
|
|
92
|
+
autoplay: false,
|
|
93
|
+
muted: false,
|
|
94
|
+
loop: false,
|
|
95
|
+
credits: '',
|
|
96
|
+
},
|
|
65
97
|
preset: 'thumbnail',
|
|
66
98
|
})
|
|
67
99
|
|
|
68
100
|
export const teaserClipWithMultipleSources = Clip({
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
'
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
101
|
+
content: {
|
|
102
|
+
type: 'clip',
|
|
103
|
+
id: '',
|
|
104
|
+
url: '',
|
|
105
|
+
dataLayout: 'in-line',
|
|
106
|
+
description:
|
|
107
|
+
' Dolor sit amet, consectetur adipiscing elit. Sed sit amet odio quis ante auctor dapibus. Sed dapibus cursus nisi, tincidunt sagittis sapien vehicula vitae.',
|
|
108
|
+
poster:
|
|
109
|
+
'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fd1e00ek4ebabms.cloudfront.net%2Fproduction%2F84d7e1b0-e8b2-4ffc-a798-306f29dc9d52.png?fit=scale-down&source=next&width=700',
|
|
110
|
+
posterAlt: '',
|
|
111
|
+
posterCredits: '',
|
|
112
|
+
caption: 'Aenean lobortis volutpat nunc vitae elementum',
|
|
113
|
+
autoplay: true,
|
|
114
|
+
muted: true,
|
|
115
|
+
loop: true,
|
|
116
|
+
credits: 'Copyright Line',
|
|
117
|
+
clips: [
|
|
118
|
+
{
|
|
119
|
+
dataSource: [
|
|
120
|
+
{
|
|
121
|
+
binaryUrl:
|
|
122
|
+
'https://spark-clips-staging.s3.eu-west-1.amazonaws.com/raw-media-files/17018837600780',
|
|
123
|
+
mediaType: 'video/mp4',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
binaryUrl:
|
|
127
|
+
'https://ark-clips-staging.s3.eu-west-1.amazonaws.com/raw-media-files/17018837600780',
|
|
128
|
+
mediaType: 'video/mp4',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
binaryUrl:
|
|
132
|
+
'https://k-clips-staging.s3.eu-west-1.amazonaws.com/raw-media-files/17018837600780',
|
|
133
|
+
mediaType: 'video/mp4',
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
dataSource: [
|
|
139
|
+
{
|
|
140
|
+
binaryUrl:
|
|
141
|
+
'https://ark-clips-staging.s3.eu-west-1.amazonaws.com/raw-media-files/17018837600780',
|
|
142
|
+
mediaType: 'video/mp4',
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
78
148
|
preload: 'none',
|
|
79
|
-
credits: 'Copyright Line',
|
|
80
|
-
clips: [
|
|
81
|
-
{
|
|
82
|
-
dataSource: [
|
|
83
|
-
{
|
|
84
|
-
binaryUrl:
|
|
85
|
-
'https://spark-clips-staging.s3.eu-west-1.amazonaws.com/raw-media-files/17018837600780',
|
|
86
|
-
mediaType: 'video/mp4',
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
binaryUrl:
|
|
90
|
-
'https://ark-clips-staging.s3.eu-west-1.amazonaws.com/raw-media-files/17018837600780',
|
|
91
|
-
mediaType: 'video/mp4',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
binaryUrl:
|
|
95
|
-
'https://k-clips-staging.s3.eu-west-1.amazonaws.com/raw-media-files/17018837600780',
|
|
96
|
-
mediaType: 'video/mp4',
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
id: 'inline-1',
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
dataSource: [
|
|
103
|
-
{
|
|
104
|
-
binaryUrl:
|
|
105
|
-
'https://ark-clips-staging.s3.eu-west-1.amazonaws.com/raw-media-files/17018837600780',
|
|
106
|
-
mediaType: 'video/mp4',
|
|
107
|
-
},
|
|
108
|
-
],
|
|
109
|
-
id: 'inline-2',
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
149
|
})
|
|
@@ -27,19 +27,25 @@ describe('Clip Snapshot', () => {
|
|
|
27
27
|
|
|
28
28
|
it('in-line render', () => {
|
|
29
29
|
const tree = renderer
|
|
30
|
-
.create(
|
|
30
|
+
.create(
|
|
31
|
+
<ClipServer content={{ url, dataLayout: 'in-line' }}></ClipServer>
|
|
32
|
+
)
|
|
31
33
|
.toJSON()
|
|
32
34
|
expect(formatString(tree)).toMatchSnapshot()
|
|
33
35
|
})
|
|
34
36
|
it('full-grid default render', () => {
|
|
35
37
|
const tree = renderer
|
|
36
|
-
.create(
|
|
38
|
+
.create(
|
|
39
|
+
<ClipServer content={{ url, dataLayout: 'full-grid' }}></ClipServer>
|
|
40
|
+
)
|
|
37
41
|
.toJSON()
|
|
38
42
|
expect(formatString(tree)).toMatchSnapshot()
|
|
39
43
|
})
|
|
40
44
|
it('mid-grid default render', () => {
|
|
41
45
|
const tree = renderer
|
|
42
|
-
.create(
|
|
46
|
+
.create(
|
|
47
|
+
<ClipServer content={{ url, dataLayout: 'mid-grid' }}></ClipServer>
|
|
48
|
+
)
|
|
43
49
|
.toJSON()
|
|
44
50
|
expect(formatString(tree)).toMatchSnapshot()
|
|
45
51
|
})
|
|
@@ -48,16 +54,18 @@ describe('Clip Snapshot', () => {
|
|
|
48
54
|
const tree = renderer
|
|
49
55
|
.create(
|
|
50
56
|
<ClipServer
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
content={{
|
|
58
|
+
url,
|
|
59
|
+
dataLayout: 'in-line',
|
|
60
|
+
autoplay: true,
|
|
61
|
+
loop: true,
|
|
62
|
+
description: 'Video description',
|
|
63
|
+
caption: 'caption text',
|
|
64
|
+
credits: '@credits',
|
|
65
|
+
poster,
|
|
66
|
+
posterAlt: 'text poster',
|
|
67
|
+
muted: true,
|
|
68
|
+
}}
|
|
61
69
|
></ClipServer>
|
|
62
70
|
)
|
|
63
71
|
.toJSON()
|
|
@@ -67,16 +75,18 @@ describe('Clip Snapshot', () => {
|
|
|
67
75
|
const tree = renderer
|
|
68
76
|
.create(
|
|
69
77
|
<ClipServer
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
content={{
|
|
79
|
+
url,
|
|
80
|
+
dataLayout: 'full-grid',
|
|
81
|
+
autoplay: true,
|
|
82
|
+
loop: true,
|
|
83
|
+
description: 'Video description',
|
|
84
|
+
caption: 'caption text',
|
|
85
|
+
credits: '@credits',
|
|
86
|
+
poster,
|
|
87
|
+
posterAlt: 'text poster',
|
|
88
|
+
muted: true,
|
|
89
|
+
}}
|
|
80
90
|
></ClipServer>
|
|
81
91
|
)
|
|
82
92
|
.toJSON()
|
|
@@ -86,16 +96,18 @@ describe('Clip Snapshot', () => {
|
|
|
86
96
|
const tree = renderer
|
|
87
97
|
.create(
|
|
88
98
|
<ClipServer
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
content={{
|
|
100
|
+
url,
|
|
101
|
+
dataLayout: 'mid-grid',
|
|
102
|
+
autoplay: true,
|
|
103
|
+
loop: true,
|
|
104
|
+
description: 'Video description',
|
|
105
|
+
caption: 'caption text',
|
|
106
|
+
credits: '@credits',
|
|
107
|
+
poster,
|
|
108
|
+
posterAlt: 'text poster',
|
|
109
|
+
muted: true,
|
|
110
|
+
}}
|
|
99
111
|
></ClipServer>
|
|
100
112
|
)
|
|
101
113
|
.toJSON()
|
|
@@ -104,37 +116,39 @@ describe('Clip Snapshot', () => {
|
|
|
104
116
|
|
|
105
117
|
it('renders multiple video sources', () => {
|
|
106
118
|
const videoWithMultipleSources = {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
119
|
+
content: {
|
|
120
|
+
dataLayout: 'in-line',
|
|
121
|
+
id: '84d7e1b0-e8b2-4ffc-a798-306f29dc9d52',
|
|
122
|
+
url: 'https://spark-clips-staging.s3.eu-west-1.amazonaws.com/optimised-media-files/16968704765960/1080x1920.mp4',
|
|
123
|
+
description:
|
|
124
|
+
' Dolor sit amet, consectetur adipiscing elit. Sed sit amet odio quis ante auctor dapibus. Sed dapibus cursus nisi, tincidunt sagittis sapien vehicula vitae.',
|
|
125
|
+
caption: 'Aenean lobortis volutpat nunc vitae elementum',
|
|
126
|
+
clips: [
|
|
127
|
+
{
|
|
128
|
+
dataSource: [
|
|
129
|
+
{
|
|
130
|
+
binaryUrl: 'https://whatever/1080x1920.mp4',
|
|
131
|
+
mediaType: 'video/mp4',
|
|
132
|
+
pixelHeight: 1080,
|
|
133
|
+
pixelWidth: 1920,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
binaryUrl: 'https://whatever/320x240.mp4',
|
|
137
|
+
mediaType: 'video/mp4',
|
|
138
|
+
pixelHeight: 320,
|
|
139
|
+
pixelWidth: 240,
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
binaryUrl: 'https://whatever/640x480.avi',
|
|
143
|
+
mediaType: 'video/avi',
|
|
144
|
+
pixelHeight: 640,
|
|
145
|
+
pixelWidth: 480,
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
poster: 'https://whatever/1080x1920.jpg',
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
},
|
|
138
152
|
}
|
|
139
153
|
const tree = renderer
|
|
140
154
|
.create(<ClipServer {...videoWithMultipleSources}></ClipServer>)
|
|
@@ -144,36 +158,40 @@ describe('Clip Snapshot', () => {
|
|
|
144
158
|
|
|
145
159
|
it('in-line rendered output is the same for CAPI and cp-content-pipeline data', () => {
|
|
146
160
|
const inlineVideo = {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
161
|
+
content: {
|
|
162
|
+
dataLayout: 'in-line',
|
|
163
|
+
url: 'https://spark-clips-staging.s3.eu-west-1.amazonaws.com/optimised-media-files/16968704765960/1080x1920.mp4',
|
|
164
|
+
description:
|
|
165
|
+
' Dolor sit amet, consectetur adipiscing elit. Sed sit amet odio quis ante auctor dapibus. Sed dapibus cursus nisi, tincidunt sagittis sapien vehicula vitae.',
|
|
166
|
+
poster:
|
|
167
|
+
'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fd1e00ek4ebabms.cloudfront.net%2Fproduction%2F84d7e1b0-e8b2-4ffc-a798-306f29dc9d52.png?fit=scale-down&source=next&width=700',
|
|
168
|
+
caption: 'Aenean lobortis volutpat nunc vitae elementum',
|
|
169
|
+
},
|
|
154
170
|
}
|
|
155
171
|
|
|
156
172
|
const inlineVideoCPPipeline = {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
'
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
content: {
|
|
174
|
+
dataLayout: 'in-line',
|
|
175
|
+
id: 'https://spark-clips-staging.s3.eu-west-1.amazonaws.com/optimised-media-files/16968704765960/1080x1920.mp4',
|
|
176
|
+
url: 'https://spark-clips-staging.s3.eu-west-1.amazonaws.com/optimised-media-files/16968704765960/1080x1920.mp4',
|
|
177
|
+
description:
|
|
178
|
+
' Dolor sit amet, consectetur adipiscing elit. Sed sit amet odio quis ante auctor dapibus. Sed dapibus cursus nisi, tincidunt sagittis sapien vehicula vitae.',
|
|
179
|
+
caption: 'Aenean lobortis volutpat nunc vitae elementum',
|
|
180
|
+
clips: [
|
|
181
|
+
{
|
|
182
|
+
dataSource: [
|
|
183
|
+
{
|
|
184
|
+
binaryUrl:
|
|
185
|
+
'https://spark-clips-staging.s3.eu-west-1.amazonaws.com/optimised-media-files/16968704765960/1080x1920.mp4',
|
|
186
|
+
mediaType: 'video/mp4',
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
id: '22a65f5a-ead3-4a25-bf79-c6b080f00547',
|
|
190
|
+
poster:
|
|
191
|
+
'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fd1e00ek4ebabms.cloudfront.net%2Fproduction%2F84d7e1b0-e8b2-4ffc-a798-306f29dc9d52.png?fit=scale-down&source=next&width=700',
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
},
|
|
177
195
|
}
|
|
178
196
|
|
|
179
197
|
const capiContainer = renderer
|
|
@@ -190,17 +208,20 @@ describe('Clip Snapshot', () => {
|
|
|
190
208
|
const tree = renderer
|
|
191
209
|
.create(
|
|
192
210
|
<ClipServer
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
211
|
+
content={{
|
|
212
|
+
url,
|
|
213
|
+
dataLayout: 'full-grid',
|
|
214
|
+
autoplay: true,
|
|
215
|
+
loop: true,
|
|
216
|
+
description: 'Video description',
|
|
217
|
+
caption: 'caption text',
|
|
218
|
+
credits: '@credits',
|
|
219
|
+
// New Origami image
|
|
220
|
+
poster:
|
|
221
|
+
'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fspark-clips-prod.s3.eu-west-1.amazonaws.com%2Fposter-images%2F898c06df-6ffa-4ed6-87a3-48a8edc309ae?source=cp-content-pipeline&fit=scale-down&quality=highest&width=700&dpr=1',
|
|
222
|
+
posterAlt: 'text poster',
|
|
223
|
+
muted: true,
|
|
224
|
+
}}
|
|
204
225
|
></ClipServer>
|
|
205
226
|
)
|
|
206
227
|
.toJSON()
|
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import classnames from 'classnames'
|
|
3
|
+
import { ContentProps } from '../types'
|
|
4
|
+
import { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema'
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
interface disclaimerProps {
|
|
5
7
|
id: string
|
|
6
8
|
}
|
|
7
9
|
|
|
8
|
-
type FlourishProps = {
|
|
9
|
-
id: string
|
|
10
|
-
type?: string
|
|
11
|
-
flourishType?: string
|
|
12
|
-
description?: string
|
|
13
|
-
layoutWidth?: string
|
|
14
|
-
fallbackImage: {
|
|
15
|
-
url?: string | null | undefined
|
|
16
|
-
width?: number | null | undefined
|
|
17
|
-
height?: number | null | undefined
|
|
18
|
-
}
|
|
19
|
-
iFrame?: boolean
|
|
20
|
-
inArticleBody?: boolean
|
|
21
|
-
}
|
|
22
|
-
|
|
23
10
|
const DisclaimerNotice = ({ id }: disclaimerProps) => (
|
|
24
11
|
<div
|
|
25
12
|
id={id}
|
|
@@ -37,12 +24,14 @@ const DisclaimerNotice = ({ id }: disclaimerProps) => (
|
|
|
37
24
|
</div>
|
|
38
25
|
</div>
|
|
39
26
|
)
|
|
27
|
+
|
|
28
|
+
interface FlourishProps extends ContentProps<ContentTreeWorkarounds.Flourish> {
|
|
29
|
+
iFrame?: boolean
|
|
30
|
+
inArticleBody?: boolean
|
|
31
|
+
}
|
|
32
|
+
|
|
40
33
|
const Flourish: React.FC<FlourishProps> = ({
|
|
41
|
-
id,
|
|
42
|
-
flourishType,
|
|
43
|
-
description,
|
|
44
|
-
layoutWidth,
|
|
45
|
-
fallbackImage,
|
|
34
|
+
content: { id, flourishType, description, layoutWidth, fallbackImage },
|
|
46
35
|
iFrame = false,
|
|
47
36
|
inArticleBody = true,
|
|
48
37
|
}) => {
|