@financial-times/cp-content-pipeline-ui 6.15.6 → 7.0.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.
Files changed (137) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/lib/components/BigNumber/index.d.ts +4 -1
  3. package/lib/components/BigNumber/index.js +1 -1
  4. package/lib/components/BigNumber/index.js.map +1 -1
  5. package/lib/components/Body/index.test.js +12 -1
  6. package/lib/components/Body/index.test.js.map +1 -1
  7. package/lib/components/Byline/index.js +2 -2
  8. package/lib/components/Byline/index.js.map +1 -1
  9. package/lib/components/Clip/components/ClipTag.d.ts +3 -3
  10. package/lib/components/Clip/components/ClipTag.js.map +1 -1
  11. package/lib/components/Clip/components/ClosedCaptions.d.ts +2 -2
  12. package/lib/components/Clip/components/VideoDescription.d.ts +2 -2
  13. package/lib/components/Clip/components/VideoDescription.js.map +1 -1
  14. package/lib/components/Clip/template/component.d.ts +9 -4
  15. package/lib/components/Clip/template/component.js +19 -14
  16. package/lib/components/Clip/template/component.js.map +1 -1
  17. package/lib/components/Clip/test/fixtures.js +114 -77
  18. package/lib/components/Clip/test/fixtures.js.map +1 -1
  19. package/lib/components/Clip/test/snapshot.spec.js +110 -61
  20. package/lib/components/Clip/test/snapshot.spec.js.map +1 -1
  21. package/lib/components/Flourish/index.d.ts +4 -12
  22. package/lib/components/Flourish/index.js +1 -1
  23. package/lib/components/Flourish/index.js.map +1 -1
  24. package/lib/components/Flourish/test/snapshot.spec.js +48 -6
  25. package/lib/components/Flourish/test/snapshot.spec.js.map +1 -1
  26. package/lib/components/Heading/index.d.ts +2 -1
  27. package/lib/components/Heading/index.js +2 -2
  28. package/lib/components/Heading/index.js.map +1 -1
  29. package/lib/components/ImageOverrideWrappers/index.d.ts +4 -0
  30. package/lib/components/ImageOverrideWrappers/index.js +44 -0
  31. package/lib/components/ImageOverrideWrappers/index.js.map +1 -0
  32. package/lib/components/ImageSet/index.d.ts +12 -8
  33. package/lib/components/ImageSet/index.js +13 -8
  34. package/lib/components/ImageSet/index.js.map +1 -1
  35. package/lib/components/Layout/index.d.ts +3 -13
  36. package/lib/components/Layout/index.js +1 -1
  37. package/lib/components/Layout/index.js.map +1 -1
  38. package/lib/components/MainImage/index.js +2 -2
  39. package/lib/components/MainImage/index.js.map +1 -1
  40. package/lib/components/Paragraph/index.d.ts +4 -1
  41. package/lib/components/Paragraph/index.js.map +1 -1
  42. package/lib/components/Pullquote/index.d.ts +4 -1
  43. package/lib/components/Pullquote/index.js +7 -6
  44. package/lib/components/Pullquote/index.js.map +1 -1
  45. package/lib/components/Recommended/index.d.ts +5 -8
  46. package/lib/components/Recommended/index.js +1 -6
  47. package/lib/components/Recommended/index.js.map +1 -1
  48. package/lib/components/RichText/BasicComponents.d.ts +12 -11
  49. package/lib/components/RichText/BasicComponents.js +2 -2
  50. package/lib/components/RichText/BasicComponents.js.map +1 -1
  51. package/lib/components/RichText/index.d.ts +10 -3
  52. package/lib/components/RichText/index.js +8 -2
  53. package/lib/components/RichText/index.js.map +1 -1
  54. package/lib/components/Scrollytelling/ScrollyImage.d.ts +6 -3
  55. package/lib/components/Scrollytelling/ScrollyImage.js +2 -2
  56. package/lib/components/Scrollytelling/ScrollyImage.js.map +1 -1
  57. package/lib/components/Scrollytelling/index.d.ts +14 -6
  58. package/lib/components/Scrollytelling/index.js +3 -3
  59. package/lib/components/Scrollytelling/index.js.map +1 -1
  60. package/lib/components/Table/TableBody.d.ts +4 -1
  61. package/lib/components/Table/TableBody.js +1 -1
  62. package/lib/components/Table/TableBody.js.map +1 -1
  63. package/lib/components/Table/TableCell.d.ts +4 -4
  64. package/lib/components/Table/TableCell.js +2 -2
  65. package/lib/components/Table/TableCell.js.map +1 -1
  66. package/lib/components/Table/index.d.ts +4 -1
  67. package/lib/components/Table/index.js +1 -1
  68. package/lib/components/Table/index.js.map +1 -1
  69. package/lib/components/Topper/Picture.d.ts +1 -1
  70. package/lib/components/Topper/Picture.js +6 -3
  71. package/lib/components/Topper/Picture.js.map +1 -1
  72. package/lib/components/Topper/index.js +7 -1
  73. package/lib/components/Topper/index.js.map +1 -1
  74. package/lib/components/Tweet/index.d.ts +5 -3
  75. package/lib/components/Tweet/index.js +1 -1
  76. package/lib/components/Tweet/index.js.map +1 -1
  77. package/lib/components/Video/index.d.ts +4 -2
  78. package/lib/components/Video/index.js +1 -1
  79. package/lib/components/Video/index.js.map +1 -1
  80. package/lib/components/Workarounds.d.ts +89 -0
  81. package/lib/components/Workarounds.js +3 -0
  82. package/lib/components/Workarounds.js.map +1 -0
  83. package/lib/components/YoutubeVideo/index.d.ts +5 -2
  84. package/lib/components/YoutubeVideo/index.js +1 -1
  85. package/lib/components/YoutubeVideo/index.js.map +1 -1
  86. package/lib/components/types.d.ts +5 -0
  87. package/lib/components/types.js +3 -0
  88. package/lib/components/types.js.map +1 -0
  89. package/lib/context.d.ts +14 -0
  90. package/lib/context.js +2 -1
  91. package/lib/context.js.map +1 -1
  92. package/lib/index.d.ts +1 -1
  93. package/lib/index.js +2 -1
  94. package/lib/index.js.map +1 -1
  95. package/lib/stories/Clip.stories.d.ts +39 -243
  96. package/lib/stories/Clip.stories.js +320 -307
  97. package/lib/stories/Clip.stories.js.map +1 -1
  98. package/package.json +2 -1
  99. package/src/components/BigNumber/index.tsx +6 -3
  100. package/src/components/Body/__snapshots__/index.test.tsx.snap +2 -1
  101. package/src/components/Body/index.test.tsx +12 -1
  102. package/src/components/Byline/index.tsx +9 -4
  103. package/src/components/Clip/components/ClipTag.tsx +3 -6
  104. package/src/components/Clip/components/ClosedCaptions.tsx +2 -2
  105. package/src/components/Clip/components/VideoDescription.tsx +2 -2
  106. package/src/components/Clip/template/component.tsx +39 -41
  107. package/src/components/Clip/test/__snapshots__/snapshot.spec.tsx.snap +4 -8
  108. package/src/components/Clip/test/fixtures.ts +127 -90
  109. package/src/components/Clip/test/snapshot.spec.tsx +123 -102
  110. package/src/components/Flourish/index.tsx +10 -21
  111. package/src/components/Flourish/test/snapshot.spec.tsx +48 -36
  112. package/src/components/Heading/index.tsx +6 -5
  113. package/src/components/ImageOverrideWrappers/index.tsx +34 -0
  114. package/src/components/ImageSet/index.tsx +75 -55
  115. package/src/components/Layout/index.tsx +6 -18
  116. package/src/components/MainImage/index.tsx +10 -8
  117. package/src/components/Paragraph/index.tsx +4 -1
  118. package/src/components/Pullquote/index.tsx +15 -8
  119. package/src/components/Recommended/index.tsx +11 -11
  120. package/src/components/RichText/BasicComponents.tsx +22 -20
  121. package/src/components/RichText/index.tsx +35 -12
  122. package/src/components/Scrollytelling/ScrollyImage.tsx +10 -7
  123. package/src/components/Scrollytelling/index.tsx +19 -9
  124. package/src/components/Table/TableBody.tsx +7 -3
  125. package/src/components/Table/TableCell.tsx +9 -7
  126. package/src/components/Table/index.tsx +12 -9
  127. package/src/components/Topper/Picture.tsx +17 -12
  128. package/src/components/Topper/index.tsx +7 -4
  129. package/src/components/Tweet/index.tsx +5 -3
  130. package/src/components/Video/index.tsx +4 -6
  131. package/src/components/Workarounds.ts +190 -0
  132. package/src/components/YoutubeVideo/index.tsx +5 -4
  133. package/src/components/types.ts +6 -0
  134. package/src/context.ts +22 -1
  135. package/src/index.ts +4 -1
  136. package/src/stories/Clip.stories.tsx +357 -341
  137. package/tsconfig.tsbuildinfo +1 -1
@@ -1,4 +1,6 @@
1
1
  import React, { useEffect } from 'react'
2
+ import type { Meta, StoryObj } from '@storybook/react'
3
+
2
4
  import ClipServer from '../components/Clip'
3
5
  import ClipClient from '../components/Clip/client'
4
6
  import oTracking from '@financial-times/o-tracking/main'
@@ -11,12 +13,16 @@ export default {
11
13
  component: ClipServer,
12
14
  tags: ['autodocs'],
13
15
  argTypes: {
14
- dataLayout: {
15
- options: ['in-line', 'full-grid', 'mid-grid'],
16
- control: { type: 'radio' },
16
+ content: {
17
+ dataLayout: {
18
+ options: ['in-line', 'full-grid', 'mid-grid'],
19
+ control: { type: 'radio' },
20
+ },
17
21
  },
18
22
  },
19
- }
23
+ } satisfies Meta<typeof ClipServer>
24
+
25
+ type Story = StoryObj<typeof ClipServer>
20
26
 
21
27
  const ArticleWrapper: React.FC<React.PropsWithChildren> = ({ children }) => {
22
28
  return (
@@ -185,7 +191,7 @@ const ClipStory = (args: ClipProps) => {
185
191
  )
186
192
  }
187
193
 
188
- export const Inline = (args: ClipProps) => {
194
+ export const Inline: Story = (args: ClipProps) => {
189
195
  return <ClipStory {...args} />
190
196
  }
191
197
 
@@ -249,350 +255,358 @@ const ThumbnailClipStory = (args: ClipProps) => {
249
255
 
250
256
  // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
251
257
  Inline.args = {
252
- type: 'clip-set',
253
- autoplay: false,
254
- loop: false,
255
- muted: false,
256
- dataLayout: 'in-line',
257
- id: '16cd2e1c-5299-4f4c-be67-1620fd0bc396',
258
- noAudio: null,
259
- caption:
260
- 'Former US president Donald Trump speaks on airport tarmac after being booked at Fulton County jail',
261
- credits: 'Reuters',
262
- description:
263
- 'Former US president Donald Trump speaks on airport tarmac after being booked at Fulton County jail',
264
- displayTitle: null,
265
- contentWarning: [],
266
- source: null,
267
- subtitle: null,
268
- publishedDate: '2023-10-30T10:54:19.210Z',
269
- clips: [
270
- {
271
- __typename: 'Clip',
272
- format: 'standard-inline',
273
- dataSource: [
274
- {
275
- audioCodec: 'aac',
276
- binaryUrl:
277
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984330352240/640x640.mp4',
278
- duration: 26250,
279
- mediaType: 'video/mp4',
280
- pixelHeight: 640,
281
- pixelWidth: 640,
282
- videoCodec: 'h264',
283
- },
284
- {
285
- audioCodec: 'aac',
286
- binaryUrl:
287
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984330352240/1280x1280.mp4',
288
- duration: 26250,
289
- mediaType: 'video/mp4',
290
- pixelHeight: 1080,
291
- pixelWidth: 1080,
292
- videoCodec: 'h264',
293
- },
294
- {
295
- audioCodec: 'aac',
296
- binaryUrl:
297
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984330352240/1920x1920.mp4',
298
- duration: 26250,
299
- mediaType: 'video/mp4',
300
- pixelHeight: 1080,
301
- pixelWidth: 1080,
302
- videoCodec: 'h264',
303
- },
304
- {
305
- audioCodec: 'mp3',
306
- binaryUrl:
307
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984330352240/0x0.mp3',
308
- duration: 26280,
309
- mediaType: 'audio/mpeg',
310
- pixelHeight: null,
311
- pixelWidth: null,
312
- videoCodec: null,
313
- },
314
- ],
315
- poster:
316
- 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fspark-clips-prod.s3.eu-west-1.amazonaws.com%2Fposter-images%2F440be423-1483-4243-8cd7-22ef8d003e70?source=cp-content-pipeline&fit=scale-down&quality=highest&width=700&dpr=1',
317
- },
318
- ],
319
- accessibility: {
320
- captions: [
258
+ content: {
259
+ type: 'clip-set',
260
+ autoplay: false,
261
+ loop: false,
262
+ muted: false,
263
+ dataLayout: 'in-line',
264
+ id: '16cd2e1c-5299-4f4c-be67-1620fd0bc396',
265
+ noAudio: null,
266
+ caption:
267
+ 'Former US president Donald Trump speaks on airport tarmac after being booked at Fulton County jail',
268
+ credits: 'Reuters',
269
+ description:
270
+ 'Former US president Donald Trump speaks on airport tarmac after being booked at Fulton County jail',
271
+ displayTitle: null,
272
+ contentWarning: [],
273
+ source: null,
274
+ subtitle: null,
275
+ publishedDate: '2023-10-30T10:54:19.210Z',
276
+ clips: [
321
277
  {
322
- url: 'https://next-media-api.ft.com/clips/captions/32069811',
323
- mediaType: 'text/vtt',
278
+ format: 'standard-inline',
279
+ dataSource: [
280
+ {
281
+ audioCodec: 'aac',
282
+ binaryUrl:
283
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984330352240/640x640.mp4',
284
+ duration: 26250,
285
+ mediaType: 'video/mp4',
286
+ pixelHeight: 640,
287
+ pixelWidth: 640,
288
+ videoCodec: 'h264',
289
+ },
290
+ {
291
+ audioCodec: 'aac',
292
+ binaryUrl:
293
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984330352240/1280x1280.mp4',
294
+ duration: 26250,
295
+ mediaType: 'video/mp4',
296
+ pixelHeight: 1080,
297
+ pixelWidth: 1080,
298
+ videoCodec: 'h264',
299
+ },
300
+ {
301
+ audioCodec: 'aac',
302
+ binaryUrl:
303
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984330352240/1920x1920.mp4',
304
+ duration: 26250,
305
+ mediaType: 'video/mp4',
306
+ pixelHeight: 1080,
307
+ pixelWidth: 1080,
308
+ videoCodec: 'h264',
309
+ },
310
+ {
311
+ audioCodec: 'mp3',
312
+ binaryUrl:
313
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984330352240/0x0.mp3',
314
+ duration: 26280,
315
+ mediaType: 'audio/mpeg',
316
+ pixelHeight: null,
317
+ pixelWidth: null,
318
+ videoCodec: null,
319
+ },
320
+ ],
321
+ poster:
322
+ 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fspark-clips-prod.s3.eu-west-1.amazonaws.com%2Fposter-images%2F440be423-1483-4243-8cd7-22ef8d003e70?source=cp-content-pipeline&fit=scale-down&quality=highest&width=700&dpr=1',
324
323
  },
325
324
  ],
326
- transcript: {
327
- source: 'transcript',
328
- structured: {
329
- tree: {
330
- type: 'body',
331
- version: 1,
332
- children: [
333
- {
334
- type: 'paragraph',
335
- children: [
336
- {
337
- type: 'text',
338
- value:
339
- "What has taken place here is a travesty of justice. We did nothing wrong. I did nothing wrong, and everybody knows it. I've never had such support, and that goes with the other ones, too. ",
340
- },
341
- ],
342
- },
343
- {
344
- type: 'paragraph',
345
- children: [
346
- {
347
- type: 'text',
348
- value:
349
- "What they're doing is election interference. They're trying to interfere with an election. There's never been anything like it in our country before. ",
350
- },
351
- ],
352
- },
353
- {
354
- type: 'paragraph',
355
- children: [
356
- {
357
- type: 'text',
358
- value:
359
- "This is their way of campaigning. And this is one instance, but you have three other instances. It's election interference. ",
360
- },
361
- ],
362
- },
363
- ],
325
+ accessibility: {
326
+ captions: [
327
+ {
328
+ url: 'https://next-media-api.ft.com/clips/captions/32069811',
329
+ mediaType: 'text/vtt',
330
+ },
331
+ ],
332
+ transcript: {
333
+ source: 'transcript',
334
+ structured: {
335
+ tree: {
336
+ type: 'body',
337
+ version: 1,
338
+ children: [
339
+ {
340
+ type: 'paragraph',
341
+ children: [
342
+ {
343
+ type: 'text',
344
+ value:
345
+ "What has taken place here is a travesty of justice. We did nothing wrong. I did nothing wrong, and everybody knows it. I've never had such support, and that goes with the other ones, too. ",
346
+ },
347
+ ],
348
+ },
349
+ {
350
+ type: 'paragraph',
351
+ children: [
352
+ {
353
+ type: 'text',
354
+ value:
355
+ "What they're doing is election interference. They're trying to interfere with an election. There's never been anything like it in our country before. ",
356
+ },
357
+ ],
358
+ },
359
+ {
360
+ type: 'paragraph',
361
+ children: [
362
+ {
363
+ type: 'text',
364
+ value:
365
+ "This is their way of campaigning. And this is one instance, but you have three other instances. It's election interference. ",
366
+ },
367
+ ],
368
+ },
369
+ ],
370
+ },
364
371
  },
365
372
  },
366
373
  },
367
374
  },
368
375
  }
369
376
 
370
- export const InlineSquare = (args: ClipProps) => {
377
+ export const InlineSquare: Story = (args: ClipProps) => {
371
378
  return <ClipStory {...args} />
372
379
  }
373
380
  InlineSquare.args = {
374
- autoplay: true,
375
- loop: true,
376
- muted: true,
377
- dataLayout: 'in-line',
378
- id: '44e42a16-4cb5-4cf0-b5c2-518f6366d21a',
379
- noAudio: null,
380
- caption: null,
381
- credits: 'FT',
382
- description: 'Open-air cooking over fire',
383
- displayTitle: null,
384
- contentWarning: [],
385
- source: null,
386
- subtitle: null,
387
- publishedDate: '2024-01-03T17:26:32.057Z',
388
- clips: [
389
- {
390
- __typename: 'Clip',
391
- format: 'standard-inline',
392
- dataSource: [
393
- {
394
- audioCodec: 'aac',
395
- binaryUrl:
396
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/17043027476580/1920x1920.mp4',
397
- duration: 10975,
398
- mediaType: 'video/mp4',
399
- pixelHeight: 1080,
400
- pixelWidth: 1080,
401
- videoCodec: 'h264',
402
- },
403
- ],
404
- poster:
405
- 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fspark-clips-prod.s3.eu-west-1.amazonaws.com%2Fposter-images%2F78a110c8-24ff-4ca7-95e2-097ec6a22428?source=cp-content-pipeline&fit=scale-down&quality=highest&width=700&dpr=1',
381
+ content: {
382
+ type: 'clip-set',
383
+ autoplay: true,
384
+ loop: true,
385
+ muted: true,
386
+ dataLayout: 'in-line',
387
+ id: '44e42a16-4cb5-4cf0-b5c2-518f6366d21a',
388
+ noAudio: null,
389
+ caption: null,
390
+ credits: 'FT',
391
+ description: 'Open-air cooking over fire',
392
+ displayTitle: null,
393
+ contentWarning: [],
394
+ source: null,
395
+ subtitle: null,
396
+ publishedDate: '2024-01-03T17:26:32.057Z',
397
+ clips: [
398
+ {
399
+ format: 'standard-inline',
400
+ dataSource: [
401
+ {
402
+ audioCodec: 'aac',
403
+ binaryUrl:
404
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/17043027476580/1920x1920.mp4',
405
+ duration: 10975,
406
+ mediaType: 'video/mp4',
407
+ pixelHeight: 1080,
408
+ pixelWidth: 1080,
409
+ videoCodec: 'h264',
410
+ },
411
+ ],
412
+ poster:
413
+ 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fspark-clips-prod.s3.eu-west-1.amazonaws.com%2Fposter-images%2F78a110c8-24ff-4ca7-95e2-097ec6a22428?source=cp-content-pipeline&fit=scale-down&quality=highest&width=700&dpr=1',
414
+ },
415
+ ],
416
+ accessibility: {
417
+ captions: [],
418
+ transcript: null,
406
419
  },
407
- ],
408
- accessibility: {
409
- captions: [],
410
- transcript: null,
411
420
  },
412
421
  }
413
422
 
414
- export const InlineLandscape = (args: ClipProps) => {
423
+ export const InlineLandscape: Story = (args: ClipProps) => {
415
424
  return <ClipStory {...args} />
416
425
  }
417
426
  InlineLandscape.args = {
418
- url: 'https://storytelling-clips.s3.amazonaws.com/World/Sikh%20leader-clip_Trudeau.mp4',
419
- credits: 'FT',
420
- caption: 'Luxaviation chief Patrick Hansen',
421
- poster:
422
- 'https://d1e00ek4ebabms.cloudfront.net/production/9d3a16ee-ffe8-4e96-b58d-d163fdb1b6d2.jpg',
423
- alt: 'Civilians hug Ukrainian soldiers in Balakliya town square',
424
- dataLayout: 'in-line',
425
- description:
426
- 'Luxaviation chief Patrick Hansen speaks at the FT’s Business of Luxury summit in Monaco',
427
- noAudio: false,
428
- accessibility: {
429
- captions: [
430
- {
431
- url: 'https://next-media-api.ft.com/captions/16862228218010.vtt',
432
- },
433
- ],
434
- },
435
- clips: [
436
- {
437
- __typename: 'Clip',
438
- format: 'standard-inline',
439
- dataSource: [
440
- {
441
- audioCodec: 'aac',
442
- binaryUrl:
443
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984336376570/640x360.mp4',
444
- duration: 29514,
445
- mediaType: 'video/mp4',
446
- pixelHeight: 360,
447
- pixelWidth: 640,
448
- videoCodec: 'h264',
449
- },
450
- {
451
- audioCodec: 'aac',
452
- binaryUrl:
453
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984336376570/1280x720.mp4',
454
- duration: 29514,
455
- mediaType: 'video/mp4',
456
- pixelHeight: 720,
457
- pixelWidth: 1280,
458
- videoCodec: 'h264',
459
- },
460
- {
461
- audioCodec: 'aac',
462
- binaryUrl:
463
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984336376570/1920x1080.mp4',
464
- duration: 29514,
465
- mediaType: 'video/mp4',
466
- pixelHeight: 1080,
467
- pixelWidth: 1920,
468
- videoCodec: 'h264',
469
- },
427
+ content: {
428
+ type: 'clip-set',
429
+ id: '',
430
+ autoplay: false,
431
+ loop: false,
432
+ muted: false,
433
+ credits: 'FT',
434
+ caption: 'Luxaviation chief Patrick Hansen',
435
+ dataLayout: 'in-line',
436
+ description:
437
+ 'Luxaviation chief Patrick Hansen speaks at the FT’s Business of Luxury summit in Monaco',
438
+ noAudio: false,
439
+ accessibility: {
440
+ captions: [
470
441
  {
471
- audioCodec: 'mp3',
472
- binaryUrl:
473
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984336376570/0x0.mp3',
474
- duration: 29544,
475
- mediaType: 'audio/mpeg',
476
- pixelHeight: null,
477
- pixelWidth: null,
478
- videoCodec: null,
442
+ url: 'https://next-media-api.ft.com/captions/16862228218010.vtt',
479
443
  },
480
444
  ],
481
- poster:
482
- 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fspark-clips-prod.s3.eu-west-1.amazonaws.com%2Fposter-images%2F3fbe0b92-8018-4686-8387-eea9fab7e392?source=cp-content-pipeline&fit=scale-down&quality=highest&width=700&dpr=1',
483
445
  },
484
- ],
446
+ clips: [
447
+ {
448
+ format: 'standard-inline',
449
+ dataSource: [
450
+ {
451
+ audioCodec: 'aac',
452
+ binaryUrl:
453
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984336376570/640x360.mp4',
454
+ duration: 29514,
455
+ mediaType: 'video/mp4',
456
+ pixelHeight: 360,
457
+ pixelWidth: 640,
458
+ videoCodec: 'h264',
459
+ },
460
+ {
461
+ audioCodec: 'aac',
462
+ binaryUrl:
463
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984336376570/1280x720.mp4',
464
+ duration: 29514,
465
+ mediaType: 'video/mp4',
466
+ pixelHeight: 720,
467
+ pixelWidth: 1280,
468
+ videoCodec: 'h264',
469
+ },
470
+ {
471
+ audioCodec: 'aac',
472
+ binaryUrl:
473
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984336376570/1920x1080.mp4',
474
+ duration: 29514,
475
+ mediaType: 'video/mp4',
476
+ pixelHeight: 1080,
477
+ pixelWidth: 1920,
478
+ videoCodec: 'h264',
479
+ },
480
+ {
481
+ audioCodec: 'mp3',
482
+ binaryUrl:
483
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984336376570/0x0.mp3',
484
+ duration: 29544,
485
+ mediaType: 'audio/mpeg',
486
+ pixelHeight: null,
487
+ pixelWidth: null,
488
+ videoCodec: null,
489
+ },
490
+ ],
491
+ poster:
492
+ 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fspark-clips-prod.s3.eu-west-1.amazonaws.com%2Fposter-images%2F3fbe0b92-8018-4686-8387-eea9fab7e392?source=cp-content-pipeline&fit=scale-down&quality=highest&width=700&dpr=1',
493
+ },
494
+ ],
495
+ },
485
496
  }
486
497
 
487
- export const InlineAutoplay = (args: ClipProps) => {
498
+ export const InlineAutoplay: Story = (args: ClipProps) => {
488
499
  return <ClipStory {...args} />
489
500
  }
490
501
 
491
502
  // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
492
503
  InlineAutoplay.args = {
493
- type: 'clip-set',
494
- autoplay: true,
495
- loop: true,
496
- muted: true,
497
- dataLayout: 'in-line',
498
- id: '362347ce-f304-47ec-8078-cae042a2f490',
499
- noAudio: null,
500
- caption: "'Trace Pong' leaves a line behind the path of the ball",
501
- credits: 'Courtesy of the artist',
502
- description: "'Trace Pong' leaves a line behind the path of the ball",
503
- displayTitle: null,
504
- contentWarning: [],
505
- source: null,
506
- subtitle: null,
507
- publishedDate: '2023-10-30T10:51:59.822Z',
508
- clips: [
509
- {
510
- __typename: 'Clip',
511
- format: 'standard-inline',
512
- dataSource: [
513
- {
514
- audioCodec: 'aac',
515
- binaryUrl:
516
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984305828900/640x360.mp4',
517
- duration: 24052,
518
- mediaType: 'video/mp4',
519
- pixelHeight: 360,
520
- pixelWidth: 640,
521
- videoCodec: 'h264',
522
- },
523
- {
524
- audioCodec: 'aac',
525
- binaryUrl:
526
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984305828900/1280x720.mp4',
527
- duration: 24052,
528
- mediaType: 'video/mp4',
529
- pixelHeight: 720,
530
- pixelWidth: 1280,
531
- videoCodec: 'h264',
532
- },
533
- {
534
- audioCodec: 'aac',
535
- binaryUrl:
536
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984305828900/1920x1080.mp4',
537
- duration: 24052,
538
- mediaType: 'video/mp4',
539
- pixelHeight: 1080,
540
- pixelWidth: 1920,
541
- videoCodec: 'h264',
542
- },
543
- {
544
- audioCodec: 'mp3',
545
- binaryUrl:
546
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984305828900/0x0.mp3',
547
- duration: 24072,
548
- mediaType: 'audio/mpeg',
549
- pixelHeight: null,
550
- pixelWidth: null,
551
- videoCodec: null,
552
- },
553
- ],
554
- poster:
555
- 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fspark-clips-prod.s3.eu-west-1.amazonaws.com%2Fposter-images%2Ff5ca5815-b40d-4dac-80b6-b8e764817685?source=cp-content-pipeline&fit=scale-down&quality=highest&width=700&dpr=1',
504
+ content: {
505
+ type: 'clip-set',
506
+ autoplay: true,
507
+ loop: true,
508
+ muted: true,
509
+ dataLayout: 'in-line',
510
+ id: '362347ce-f304-47ec-8078-cae042a2f490',
511
+ noAudio: null,
512
+ caption: "'Trace Pong' leaves a line behind the path of the ball",
513
+ credits: 'Courtesy of the artist',
514
+ description: "'Trace Pong' leaves a line behind the path of the ball",
515
+ displayTitle: null,
516
+ contentWarning: [],
517
+ source: null,
518
+ subtitle: null,
519
+ publishedDate: '2023-10-30T10:51:59.822Z',
520
+ clips: [
521
+ {
522
+ format: 'standard-inline',
523
+ dataSource: [
524
+ {
525
+ audioCodec: 'aac',
526
+ binaryUrl:
527
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984305828900/640x360.mp4',
528
+ duration: 24052,
529
+ mediaType: 'video/mp4',
530
+ pixelHeight: 360,
531
+ pixelWidth: 640,
532
+ videoCodec: 'h264',
533
+ },
534
+ {
535
+ audioCodec: 'aac',
536
+ binaryUrl:
537
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984305828900/1280x720.mp4',
538
+ duration: 24052,
539
+ mediaType: 'video/mp4',
540
+ pixelHeight: 720,
541
+ pixelWidth: 1280,
542
+ videoCodec: 'h264',
543
+ },
544
+ {
545
+ audioCodec: 'aac',
546
+ binaryUrl:
547
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984305828900/1920x1080.mp4',
548
+ duration: 24052,
549
+ mediaType: 'video/mp4',
550
+ pixelHeight: 1080,
551
+ pixelWidth: 1920,
552
+ videoCodec: 'h264',
553
+ },
554
+ {
555
+ audioCodec: 'mp3',
556
+ binaryUrl:
557
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/optimised-media-files/16984305828900/0x0.mp3',
558
+ duration: 24072,
559
+ mediaType: 'audio/mpeg',
560
+ pixelHeight: null,
561
+ pixelWidth: null,
562
+ videoCodec: null,
563
+ },
564
+ ],
565
+ poster:
566
+ 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fspark-clips-prod.s3.eu-west-1.amazonaws.com%2Fposter-images%2Ff5ca5815-b40d-4dac-80b6-b8e764817685?source=cp-content-pipeline&fit=scale-down&quality=highest&width=700&dpr=1',
567
+ },
568
+ ],
569
+ accessibility: {
570
+ captions: [],
571
+ transcript: null,
556
572
  },
557
- ],
558
- accessibility: {
559
- captions: [],
560
- transcript: null,
561
573
  },
562
574
  }
563
575
 
564
- export const NoDataSource = (args: ClipProps) => {
576
+ export const NoDataSource: Story = (args: ClipProps) => {
565
577
  return <ClipStory {...args} />
566
578
  }
567
579
 
568
580
  // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
569
581
  NoDataSource.args = {
570
- type: 'clip-set',
571
- autoplay: true,
572
- loop: true,
573
- muted: true,
574
- dataLayout: 'in-line',
575
- id: '362347ce-f304-47ec-8078-cae042a2f490',
576
- noAudio: null,
577
- caption: "'Trace Pong' leaves a line behind the path of the ball",
578
- credits: 'Courtesy of the artist',
579
- description: "'Trace Pong' leaves a line behind the path of the ball",
580
- displayTitle: null,
581
- contentWarning: [],
582
- source: null,
583
- subtitle: null,
584
- publishedDate: '2023-10-30T10:51:59.822Z',
585
- clips: [
586
- {
587
- __typename: 'Clip',
588
- format: 'standard-inline',
589
- poster:
590
- 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fspark-clips-prod.s3.eu-west-1.amazonaws.com%2Fposter-images%2Ff5ca5815-b40d-4dac-80b6-b8e764817685?source=cp-content-pipeline&fit=scale-down&quality=highest&width=700&dpr=1',
582
+ content: {
583
+ type: 'clip-set',
584
+ autoplay: true,
585
+ loop: true,
586
+ muted: true,
587
+ dataLayout: 'in-line',
588
+ id: '362347ce-f304-47ec-8078-cae042a2f490',
589
+ noAudio: null,
590
+ caption: "'Trace Pong' leaves a line behind the path of the ball",
591
+ credits: 'Courtesy of the artist',
592
+ description: "'Trace Pong' leaves a line behind the path of the ball",
593
+ displayTitle: null,
594
+ contentWarning: [],
595
+ source: null,
596
+ subtitle: null,
597
+ publishedDate: '2023-10-30T10:51:59.822Z',
598
+ clips: [
599
+ {
600
+ format: 'standard-inline',
601
+ dataSource: [],
602
+ poster:
603
+ 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fspark-clips-prod.s3.eu-west-1.amazonaws.com%2Fposter-images%2Ff5ca5815-b40d-4dac-80b6-b8e764817685?source=cp-content-pipeline&fit=scale-down&quality=highest&width=700&dpr=1',
604
+ },
605
+ ],
606
+ accessibility: {
607
+ captions: [],
608
+ transcript: null,
591
609
  },
592
- ],
593
- accessibility: {
594
- captions: [],
595
- transcript: null,
596
610
  },
597
611
  }
598
612
 
@@ -602,37 +616,39 @@ export const ThumbnailClip = (args: ClipProps) => {
602
616
 
603
617
  // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
604
618
  ThumbnailClip.args = {
605
- accessibility: {
606
- captions: [],
607
- transcript: null,
608
- },
609
- autoplay: true,
610
- clips: [
611
- {
612
- dataSource: [
613
- {
614
- audioCodec: 'aac',
615
- binaryUrl:
616
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/raw-media-files/17144958736710',
617
- duration: 161012,
618
- mediaType: 'video/mp4',
619
- pixelHeight: 1080,
620
- pixelWidth: 1920,
621
- videoCodec: 'h264',
622
- },
623
- ],
624
- id: 'inline-1',
625
- poster:
626
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/poster-images/e37aa9c0-69bd-4bd0-8874-c90f0a265894',
619
+ content: {
620
+ accessibility: {
621
+ captions: [],
622
+ transcript: null,
627
623
  },
628
- ],
629
- dataLayout: '',
630
- id: '362347ce-f304-47ec-8078-cae042a2f490',
631
- loop: true,
632
- muted: true,
633
- noAudio: null,
634
- poster:
635
- 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/poster-images/e37aa9c0-69bd-4bd0-8874-c90f0a265894',
636
- publishedDate: '2023-10-30T10:51:59.822Z',
637
- type: 'clip-set',
624
+ autoplay: true,
625
+ clips: [
626
+ {
627
+ dataSource: [
628
+ {
629
+ audioCodec: 'aac',
630
+ binaryUrl:
631
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/raw-media-files/17144958736710',
632
+ duration: 161012,
633
+ mediaType: 'video/mp4',
634
+ pixelHeight: 1080,
635
+ pixelWidth: 1920,
636
+ videoCodec: 'h264',
637
+ },
638
+ ],
639
+ id: 'inline-1',
640
+ poster:
641
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/poster-images/e37aa9c0-69bd-4bd0-8874-c90f0a265894',
642
+ },
643
+ ],
644
+ dataLayout: '',
645
+ id: '362347ce-f304-47ec-8078-cae042a2f490',
646
+ loop: true,
647
+ muted: true,
648
+ noAudio: null,
649
+ poster:
650
+ 'https://spark-clips-prod.s3.eu-west-1.amazonaws.com/poster-images/e37aa9c0-69bd-4bd0-8874-c90f0a265894',
651
+ publishedDate: '2023-10-30T10:51:59.822Z',
652
+ type: 'clip-set',
653
+ },
638
654
  }