@financial-times/cp-content-pipeline-ui 6.14.1 → 6.15.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.
Files changed (238) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/lib/components/ArticleBody/index.d.ts +2 -1
  3. package/lib/components/ArticleBody/index.js +2 -2
  4. package/lib/components/ArticleBody/index.js.map +1 -1
  5. package/lib/components/ArticleInfo/index.d.ts +3 -3
  6. package/lib/components/ArticleInfo/index.js +2 -2
  7. package/lib/components/ArticleInfo/index.js.map +1 -1
  8. package/lib/components/BackToTopButton/client/index.d.ts +4 -2
  9. package/lib/components/BackToTopButton/client/index.js +2 -11
  10. package/lib/components/BackToTopButton/client/index.js.map +1 -1
  11. package/lib/components/BackToTopButton/client/utils.js +1 -2
  12. package/lib/components/BackToTopButton/client/utils.js.map +1 -1
  13. package/lib/components/BigNumber/index.d.ts +2 -1
  14. package/lib/components/BigNumber/index.js +2 -2
  15. package/lib/components/BigNumber/index.js.map +1 -1
  16. package/lib/components/Body/index.d.ts +2 -1
  17. package/lib/components/Body/index.js +2 -2
  18. package/lib/components/Body/index.js.map +1 -1
  19. package/lib/components/Byline/index.d.ts +2 -2
  20. package/lib/components/Byline/index.js +2 -2
  21. package/lib/components/Byline/index.js.map +1 -1
  22. package/lib/components/Clip/client/index.js.map +1 -1
  23. package/lib/components/Clip/client/progressBar.js.map +1 -1
  24. package/lib/components/Clip/client/utils.js +4 -5
  25. package/lib/components/Clip/client/utils.js.map +1 -1
  26. package/lib/components/Clip/components/Caption.d.ts +1 -1
  27. package/lib/components/Clip/components/Caption.js.map +1 -1
  28. package/lib/components/Clip/components/ClipTag.d.ts +1 -1
  29. package/lib/components/Clip/components/ClipTag.js.map +1 -1
  30. package/lib/components/Clip/components/ClosedCaptions.d.ts +2 -2
  31. package/lib/components/Clip/components/ClosedCaptions.js +1 -1
  32. package/lib/components/Clip/components/ClosedCaptions.js.map +1 -1
  33. package/lib/components/Clip/components/Container.d.ts +2 -3
  34. package/lib/components/Clip/components/Container.js +1 -1
  35. package/lib/components/Clip/components/Container.js.map +1 -1
  36. package/lib/components/Clip/components/ContentLayout.d.ts +2 -3
  37. package/lib/components/Clip/components/ContentLayout.js.map +1 -1
  38. package/lib/components/Clip/components/Credit.d.ts +1 -1
  39. package/lib/components/Clip/components/Credit.js.map +1 -1
  40. package/lib/components/Clip/components/VideoDescription.d.ts +1 -1
  41. package/lib/components/Clip/components/VideoDescription.js.map +1 -1
  42. package/lib/components/Clip/components/VideoInfoBox.d.ts +1 -1
  43. package/lib/components/Clip/components/VideoInfoBox.js.map +1 -1
  44. package/lib/components/Clip/template/component.d.ts +2 -2
  45. package/lib/components/Clip/template/component.js +2 -2
  46. package/lib/components/Clip/template/component.js.map +1 -1
  47. package/lib/components/Clip/template/index.js +1 -1
  48. package/lib/components/Clip/template/index.js.map +1 -1
  49. package/lib/components/Clip/test/fixtures.js.map +1 -1
  50. package/lib/components/Clip/test/index.spec.js.map +1 -1
  51. package/lib/components/Clip/test/snapshot.spec.js +2 -2
  52. package/lib/components/Clip/test/snapshot.spec.js.map +1 -1
  53. package/lib/components/ContentPackageBody/index.d.ts +2 -2
  54. package/lib/components/ContentPackageBody/index.js +9 -9
  55. package/lib/components/ContentPackageBody/index.js.map +1 -1
  56. package/lib/components/Expander/client/index.js.map +1 -1
  57. package/lib/components/Expander/test/client/index.spec.js.map +1 -1
  58. package/lib/components/FixedAspectRatio/FixedAspectRatio.d.ts +3 -1622
  59. package/lib/components/FixedAspectRatio/FixedAspectRatio.js +3 -3
  60. package/lib/components/FixedAspectRatio/FixedAspectRatio.js.map +1 -1
  61. package/lib/components/Flourish/client/index.js.map +1 -1
  62. package/lib/components/Flourish/index.d.ts +2 -2
  63. package/lib/components/Flourish/index.js +2 -2
  64. package/lib/components/Flourish/index.js.map +1 -1
  65. package/lib/components/Heading/index.d.ts +2 -5
  66. package/lib/components/Heading/index.js +2 -1
  67. package/lib/components/Heading/index.js.map +1 -1
  68. package/lib/components/Headshot/index.d.ts +2 -2
  69. package/lib/components/Headshot/index.js +2 -2
  70. package/lib/components/Headshot/index.js.map +1 -1
  71. package/lib/components/ImageSet/index.d.ts +8 -6
  72. package/lib/components/ImageSet/index.js +11 -11
  73. package/lib/components/ImageSet/index.js.map +1 -1
  74. package/lib/components/Layout/index.d.ts +4 -10
  75. package/lib/components/Layout/index.js +7 -7
  76. package/lib/components/Layout/index.js.map +1 -1
  77. package/lib/components/LiveBlogBody/index.d.ts +2 -2
  78. package/lib/components/LiveBlogBody/index.js +2 -2
  79. package/lib/components/LiveBlogBody/index.js.map +1 -1
  80. package/lib/components/LiveBlogPost/ShareButtons.d.ts +4 -3
  81. package/lib/components/LiveBlogPost/ShareButtons.js +2 -1
  82. package/lib/components/LiveBlogPost/ShareButtons.js.map +1 -1
  83. package/lib/components/LiveBlogPost/Timestamp.d.ts +2 -2
  84. package/lib/components/LiveBlogPost/Timestamp.js +2 -1
  85. package/lib/components/LiveBlogPost/Timestamp.js.map +1 -1
  86. package/lib/components/LiveBlogPost/index.d.ts +1 -1
  87. package/lib/components/LiveBlogPost/index.js +1 -1
  88. package/lib/components/LiveBlogPost/index.js.map +1 -1
  89. package/lib/components/LiveBlogPost/svgIcons.d.ts +3 -3
  90. package/lib/components/LiveBlogPost/svgIcons.js +6 -6
  91. package/lib/components/LiveBlogPost/svgIcons.js.map +1 -1
  92. package/lib/components/LiveBlogWrapper/dispatchEvent.js.map +1 -1
  93. package/lib/components/LiveBlogWrapper/index.js.map +1 -1
  94. package/lib/components/LiveBlogWrapper/normalisePost.js.map +1 -1
  95. package/lib/components/LiveBlogWrapper/post-tracker.js +2 -2
  96. package/lib/components/LiveBlogWrapper/post-tracker.js.map +1 -1
  97. package/lib/components/MainImage/index.d.ts +2 -2
  98. package/lib/components/MainImage/index.js +2 -2
  99. package/lib/components/MainImage/index.js.map +1 -1
  100. package/lib/components/Paragraph/index.d.ts +2 -1
  101. package/lib/components/Paragraph/index.js +3 -3
  102. package/lib/components/Paragraph/index.js.map +1 -1
  103. package/lib/components/PodcastBody/index.d.ts +4 -2
  104. package/lib/components/PodcastBody/index.js +2 -2
  105. package/lib/components/PodcastBody/index.js.map +1 -1
  106. package/lib/components/Pullquote/index.d.ts +2 -2
  107. package/lib/components/Pullquote/index.js +2 -1
  108. package/lib/components/Pullquote/index.js.map +1 -1
  109. package/lib/components/Recommended/index.d.ts +2 -1
  110. package/lib/components/Recommended/index.js +2 -2
  111. package/lib/components/Recommended/index.js.map +1 -1
  112. package/lib/components/RichText/BasicComponents.d.ts +13 -13
  113. package/lib/components/RichText/BasicComponents.js +2 -2
  114. package/lib/components/RichText/BasicComponents.js.map +1 -1
  115. package/lib/components/RichText/index.d.ts +2 -2
  116. package/lib/components/RichText/index.js +2 -2
  117. package/lib/components/RichText/index.js.map +1 -1
  118. package/lib/components/Scrollytelling/ScrollyImage.d.ts +1 -1
  119. package/lib/components/Scrollytelling/ScrollyImage.js +2 -2
  120. package/lib/components/Scrollytelling/ScrollyImage.js.map +1 -1
  121. package/lib/components/Scrollytelling/index.d.ts +5 -5
  122. package/lib/components/Scrollytelling/index.js +1 -1
  123. package/lib/components/Scrollytelling/index.js.map +1 -1
  124. package/lib/components/Table/TableBody.d.ts +2 -1
  125. package/lib/components/Table/TableBody.js +2 -2
  126. package/lib/components/Table/TableBody.js.map +1 -1
  127. package/lib/components/Table/TableCell.d.ts +4 -2
  128. package/lib/components/Table/TableCell.js.map +1 -1
  129. package/lib/components/Table/index.d.ts +2 -1
  130. package/lib/components/Table/index.js +2 -2
  131. package/lib/components/Table/index.js.map +1 -1
  132. package/lib/components/Topper/Columnist.d.ts +2 -2
  133. package/lib/components/Topper/Columnist.js +2 -2
  134. package/lib/components/Topper/Columnist.js.map +1 -1
  135. package/lib/components/Topper/FollowButtonSlot.d.ts +0 -1
  136. package/lib/components/Topper/Headline.d.ts +2 -2
  137. package/lib/components/Topper/Headline.js +2 -2
  138. package/lib/components/Topper/Headline.js.map +1 -1
  139. package/lib/components/Topper/Intro.d.ts +2 -1
  140. package/lib/components/Topper/Intro.js +2 -2
  141. package/lib/components/Topper/Intro.js.map +1 -1
  142. package/lib/components/Topper/LiveBlogIndicator.d.ts +2 -2
  143. package/lib/components/Topper/LiveBlogIndicator.js +2 -2
  144. package/lib/components/Topper/LiveBlogIndicator.js.map +1 -1
  145. package/lib/components/Topper/Picture.d.ts +2 -2
  146. package/lib/components/Topper/Picture.js +2 -2
  147. package/lib/components/Topper/Picture.js.map +1 -1
  148. package/lib/components/Topper/Tags.d.ts +2 -2
  149. package/lib/components/Topper/Tags.js +7 -7
  150. package/lib/components/Topper/Tags.js.map +1 -1
  151. package/lib/components/Topper/Wrapper.d.ts +3 -4
  152. package/lib/components/Topper/Wrapper.js +2 -2
  153. package/lib/components/Topper/Wrapper.js.map +1 -1
  154. package/lib/components/Topper/client/tracking.js.map +1 -1
  155. package/lib/components/Topper/index.d.ts +2 -1
  156. package/lib/components/Topper/index.js +2 -2
  157. package/lib/components/Topper/index.js.map +1 -1
  158. package/lib/components/Tweet/index.d.ts +2 -1
  159. package/lib/components/Tweet/index.js +2 -2
  160. package/lib/components/Tweet/index.js.map +1 -1
  161. package/lib/components/Video/index.d.ts +2 -1
  162. package/lib/components/Video/index.js +2 -2
  163. package/lib/components/Video/index.js.map +1 -1
  164. package/lib/components/YoutubeVideo/index.d.ts +2 -1
  165. package/lib/components/YoutubeVideo/index.js +2 -2
  166. package/lib/components/YoutubeVideo/index.js.map +1 -1
  167. package/lib/context.d.ts +0 -1
  168. package/lib/extensions/scrollIntoView.js +1 -1
  169. package/lib/extensions/scrollIntoView.js.map +1 -1
  170. package/lib/stories/BackToTop.stories.d.ts +5 -2
  171. package/lib/stories/BackToTop.stories.js.map +1 -1
  172. package/lib/stories/Clip.stories.d.ts +1 -2
  173. package/lib/stories/Clip.stories.js +1 -1
  174. package/lib/stories/Clip.stories.js.map +1 -1
  175. package/lib/stories/Expander.stories.d.ts +37 -25
  176. package/lib/stories/Expander.stories.js +207 -36
  177. package/lib/stories/Expander.stories.js.map +1 -1
  178. package/lib/stories/LiveBlogPost.stories.d.ts +1 -1
  179. package/lib/stories/LiveBlogPost.stories.js +6 -6
  180. package/lib/stories/LiveBlogPost.stories.js.map +1 -1
  181. package/lib/stories/Topper.stories.d.ts +2 -2
  182. package/package.json +1 -1
  183. package/src/components/ArticleBody/index.tsx +3 -4
  184. package/src/components/ArticleInfo/index.tsx +5 -3
  185. package/src/components/BackToTopButton/client/index.tsx +11 -6
  186. package/src/components/BigNumber/index.tsx +6 -9
  187. package/src/components/Body/index.tsx +4 -2
  188. package/src/components/Byline/index.tsx +3 -4
  189. package/src/components/Clip/components/Caption.tsx +1 -1
  190. package/src/components/Clip/components/ClipTag.tsx +2 -2
  191. package/src/components/Clip/components/ClosedCaptions.tsx +4 -2
  192. package/src/components/Clip/components/Container.tsx +5 -3
  193. package/src/components/Clip/components/ContentLayout.tsx +4 -3
  194. package/src/components/Clip/components/Credit.tsx +1 -1
  195. package/src/components/Clip/components/VideoDescription.tsx +2 -2
  196. package/src/components/Clip/components/VideoInfoBox.tsx +1 -1
  197. package/src/components/Clip/template/component.tsx +4 -2
  198. package/src/components/ContentPackageBody/index.tsx +9 -7
  199. package/src/components/Expander/client/main.scss +27 -17
  200. package/src/components/FixedAspectRatio/FixedAspectRatio.tsx +6 -5
  201. package/src/components/Flourish/index.tsx +4 -2
  202. package/src/components/Heading/index.tsx +5 -2
  203. package/src/components/Headshot/index.tsx +4 -2
  204. package/src/components/ImageSet/index.tsx +25 -21
  205. package/src/components/Layout/index.tsx +8 -15
  206. package/src/components/LiveBlogBody/index.tsx +4 -2
  207. package/src/components/LiveBlogPost/ShareButtons.tsx +10 -5
  208. package/src/components/LiveBlogPost/Timestamp.tsx +6 -1
  209. package/src/components/LiveBlogPost/index.tsx +6 -4
  210. package/src/components/LiveBlogPost/svgIcons.tsx +3 -3
  211. package/src/components/MainImage/index.tsx +3 -1
  212. package/src/components/Paragraph/index.tsx +5 -3
  213. package/src/components/PodcastBody/index.tsx +9 -2
  214. package/src/components/Pullquote/index.tsx +5 -3
  215. package/src/components/Recommended/index.tsx +5 -2
  216. package/src/components/RichText/BasicComponents.tsx +35 -30
  217. package/src/components/RichText/index.tsx +12 -8
  218. package/src/components/Scrollytelling/ScrollyImage.tsx +4 -4
  219. package/src/components/Scrollytelling/index.tsx +10 -10
  220. package/src/components/Table/TableBody.tsx +5 -3
  221. package/src/components/Table/TableCell.tsx +3 -3
  222. package/src/components/Table/index.tsx +6 -2
  223. package/src/components/Topper/Columnist.tsx +4 -2
  224. package/src/components/Topper/Headline.tsx +4 -2
  225. package/src/components/Topper/Intro.tsx +3 -1
  226. package/src/components/Topper/LiveBlogIndicator.tsx +4 -2
  227. package/src/components/Topper/Picture.tsx +8 -6
  228. package/src/components/Topper/Tags.tsx +6 -4
  229. package/src/components/Topper/Wrapper.tsx +5 -4
  230. package/src/components/Topper/index.tsx +4 -2
  231. package/src/components/Tweet/index.tsx +3 -1
  232. package/src/components/Video/index.tsx +4 -2
  233. package/src/components/YoutubeVideo/index.tsx +4 -2
  234. package/src/stories/Clip.stories.tsx +2 -6
  235. package/src/stories/Expander.stories.tsx +231 -51
  236. package/src/stories/article-page.scss +21 -1
  237. package/src/stories/tsconfig.json +7 -0
  238. package/tsconfig.tsbuildinfo +1 -1
@@ -1,67 +1,241 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
2
  import { ExpanderServer, ExpanderProps } from '../components/Expander'
2
3
  import { ExpanderClient } from '../components/Expander/client'
3
4
  import React, { useEffect } from 'react'
4
5
  import oTracking from '@financial-times/o-tracking/main'
5
6
  import './Expander.stories.scss'
6
7
  import ClipClient from '../components/Clip/client'
7
- import './Clip.stories.scss'
8
8
  import RichText from '../components/RichText'
9
9
  import { ContentTree } from '@financial-times/content-tree'
10
- import { ClipSet } from '@financial-times/cp-content-pipeline-schema/src/resolvers/content-tree/Workarounds'
11
10
 
12
- const structuredContent: ContentTree.Body = {
13
- type: 'body',
14
- version: 1,
15
- children: [
16
- {
17
- type: 'paragraph',
18
- children: [
19
- {
20
- type: 'text',
21
- value:
22
- 'Mike Johnson has survived an attempt to oust him as speaker of the House of Representatives by Marjorie Taylor Greene, a hardline Republican congresswoman from Georgia. ',
11
+ type ArgsType = ExpanderProps & { structuredContent: any; classNames?: string }
12
+
13
+ const structuredContent = {
14
+ tree: {
15
+ type: 'body',
16
+ version: 1,
17
+ children: [
18
+ {
19
+ type: 'image-set',
20
+ id: 'http://api.ft.com/content/57b3150f-434e-4463-a863-3311d53bf5c2',
21
+ data: {
22
+ referenceIndex: 0,
23
23
  },
24
- ],
25
- } as ContentTree.Paragraph,
24
+ } as ContentTree.ImageSet,
25
+ {
26
+ type: 'paragraph',
27
+ children: [
28
+ {
29
+ type: 'text',
30
+ value:
31
+ 'Mike Johnson has survived an attempt to oust him as speaker of the House of Representatives by Marjorie Taylor Greene, a hardline Republican congresswoman from Georgia. ',
32
+ },
33
+ ],
34
+ } as ContentTree.Paragraph,
35
+ {
36
+ type: 'paragraph',
37
+ children: [
38
+ {
39
+ type: 'text',
40
+ value:
41
+ 'In a vote on Wednesday night, the lower chamber of Congress rejected Greene’s bid with overwhelming support from Democrats as well as Republicans. ',
42
+ },
43
+ ],
44
+ } as ContentTree.Paragraph,
45
+ ,
46
+ {
47
+ type: 'paragraph',
48
+ children: [
49
+ {
50
+ type: 'text',
51
+ value:
52
+ 'The vote all but ensures that Johnson will remain in his post until after the November election, and will put a lid on a debate over his political future that has lasted for weeks among Republicans in Congress.  ',
53
+ },
54
+ ],
55
+ } as ContentTree.Paragraph,
56
+ {
57
+ id: 'http://api.ft.com/content/02e03dda-165c-40ec-89e3-c2ba502fe9b0',
58
+ type: 'recommended',
59
+ heading: 'Recommended',
60
+ teaserTitleOverride:
61
+ 'Hargreaves Lansdown backs £5.4bn private equity takeover ',
62
+ data: {
63
+ referenceIndex: 1,
64
+ },
65
+ },
66
+ ] as ContentTree.Body['children'],
67
+ },
68
+ references: [
26
69
  {
27
- type: 'paragraph',
28
- children: [
29
- {
30
- type: 'text',
31
- value:
32
- 'In a vote on Wednesday night, the lower chamber of Congress rejected Greene’s bid with overwhelming support from Democrats as well as Republicans. ',
70
+ type: 'image-set',
71
+ picture: {
72
+ __typename: 'PictureStandard',
73
+ alt: 'A Waitrose shop in London ',
74
+ caption:
75
+ 'Staff at the Waitrose on King William street in London, which is taking cash only payments, said that disruption caused by the IT outage was ‘everywhere’',
76
+ credit: '© Ian Smith/FT',
77
+ imageType: 'image',
78
+ layoutWidth: 'standard',
79
+ fallbackImage: {
80
+ __typename: 'ImageStandardInline',
81
+ height: 1368,
82
+ width: 1600,
83
+ caption:
84
+ 'Staff at the Waitrose on King William street in London, which is taking cash only payments, said that disruption caused by the IT outage was ‘everywhere’',
85
+ credit: '© Ian Smith/FT',
86
+ format: 'standard-inline',
87
+ url: 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fd1e00ek4ebabms.cloudfront.net%2Fproduction%2F5a89fdc8-323b-4cf2-a317-794074a1adae.png?source=next-article&fit=scale-down&quality=highest&width=700&dpr=1',
88
+ id: '5a89fdc8-323b-4cf2-a317-794074a1adae',
33
89
  },
34
- ],
35
- } as ContentTree.Paragraph,
36
- ,
90
+ images: [
91
+ {
92
+ __typename: 'ImageStandardInline',
93
+ height: 1368,
94
+ width: 1600,
95
+ caption:
96
+ 'Staff at the Waitrose on King William street in London, which is taking cash only payments, said that disruption caused by the IT outage was ‘everywhere’',
97
+ credit: '© Ian Smith/FT',
98
+ format: 'standard-inline',
99
+ url: 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fd1e00ek4ebabms.cloudfront.net%2Fproduction%2F5a89fdc8-323b-4cf2-a317-794074a1adae.png?source=next-article&fit=scale-down&quality=highest&width=700&dpr=1',
100
+ id: '5a89fdc8-323b-4cf2-a317-794074a1adae',
101
+ sourceSet: [
102
+ {
103
+ dpr: 1,
104
+ width: 700,
105
+ url: 'https://www.ft.com/__origami/service/image/v2/images/raw/ftcms%3A5a89fdc8-323b-4cf2-a317-794074a1adae?source=next-article&fit=scale-down&quality=highest&width=700&dpr=1',
106
+ },
107
+ {
108
+ dpr: 2,
109
+ width: 700,
110
+ url: 'https://www.ft.com/__origami/service/image/v2/images/raw/ftcms%3A5a89fdc8-323b-4cf2-a317-794074a1adae?source=next-article&fit=scale-down&quality=highest&width=700&dpr=2',
111
+ },
112
+ ],
113
+ },
114
+ ],
115
+ },
116
+ },
37
117
  {
38
- type: 'paragraph',
39
- children: [
40
- {
41
- type: 'text',
42
- value:
43
- 'The vote all but ensures that Johnson will remain in his post until after the November election, and will put a lid on a debate over his political future that has lasted for weeks among Republicans in Congress.  ',
118
+ type: 'recommended',
119
+ isInLiveBlog: true,
120
+ teaser: {
121
+ title: 'Hargreaves Lansdown backs £5.4bn private equity takeover ',
122
+ id: '02e03dda-165c-40ec-89e3-c2ba502fe9b0',
123
+ url: 'https://www.ft.com/content/02e03dda-165c-40ec-89e3-c2ba502fe9b0',
124
+ relativeUrl: '/content/02e03dda-165c-40ec-89e3-c2ba502fe9b0',
125
+ type: 'article',
126
+ publishedDate: '2024-06-18T15:25:49.739Z',
127
+ firstPublishedDate: '2024-06-18T13:49:35.049Z',
128
+ metaPrefixText: null,
129
+ metaSuffixText: null,
130
+ metaLink: {
131
+ id: '4d1b8529-f8a3-4740-97e6-4a6f68214092',
132
+ url: 'https://www.ft.com/stream/4d1b8529-f8a3-4740-97e6-4a6f68214092',
133
+ relativeUrl: '/stream/4d1b8529-f8a3-4740-97e6-4a6f68214092',
134
+ prefLabel: 'Hargreaves Lansdown PLC',
135
+ },
136
+ metaAltLink: null,
137
+ image: {
138
+ url: 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fd1e00ek4ebabms.cloudfront.net%2Fproduction%2F409586da-1e01-42d8-b4e6-cd99b82923b3.jpg?source=next-article&fit=scale-down&quality=highest&width=700&dpr=1',
139
+ width: 2266,
140
+ height: 1275,
141
+ altText: 'Hargreaves Lansdown logo',
44
142
  },
45
- ],
46
- } as ContentTree.Paragraph,
143
+ indicators: {
144
+ accessLevel: 'subscribed',
145
+ isOpinion: false,
146
+ isColumn: false,
147
+ isPodcast: false,
148
+ isEditorsChoice: false,
149
+ isExclusive: false,
150
+ isScoop: false,
151
+ },
152
+ },
153
+ },
154
+ ],
155
+ }
156
+
157
+ const structuredContentNoMoreElements = {
158
+ tree: {
159
+ type: 'body',
160
+ version: 1,
161
+ children: [
162
+ {
163
+ type: 'image-set',
164
+ id: 'http://api.ft.com/content/57b3150f-434e-4463-a863-3311d53bf5c2',
165
+ data: {
166
+ referenceIndex: 0,
167
+ },
168
+ } as ContentTree.ImageSet,
169
+ {
170
+ type: 'paragraph',
171
+ children: [
172
+ {
173
+ type: 'text',
174
+ value:
175
+ 'Mike Johnson has survived an attempt to oust him as speaker of the House of Representatives by Marjorie Taylor Greene, a hardline Republican congresswoman from Georgia. ',
176
+ },
177
+ ],
178
+ } as ContentTree.Paragraph,
179
+ ],
180
+ },
181
+ references: [
47
182
  {
48
- type: 'clip-set',
49
- id: 'http://api.ft.com/content/23a00095-d9fc-4cac-ad7c-477e61e3c159',
50
- autoplay: false,
51
- loop: false,
52
- muted: false,
53
- dataLayout: 'in-line',
54
- data: {
55
- referenceIndex: 3,
183
+ type: 'image-set',
184
+ picture: {
185
+ __typename: 'PictureStandard',
186
+ alt: 'A Waitrose shop in London ',
187
+ caption:
188
+ 'Staff at the Waitrose on King William street in London, which is taking cash only payments, said that disruption caused by the IT outage was ‘everywhere’',
189
+ credit: '© Ian Smith/FT',
190
+ imageType: 'image',
191
+ layoutWidth: 'standard',
192
+ fallbackImage: {
193
+ __typename: 'ImageStandardInline',
194
+ height: 1368,
195
+ width: 1600,
196
+ caption:
197
+ 'Staff at the Waitrose on King William street in London, which is taking cash only payments, said that disruption caused by the IT outage was ‘everywhere’',
198
+ credit: '© Ian Smith/FT',
199
+ format: 'standard-inline',
200
+ url: 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fd1e00ek4ebabms.cloudfront.net%2Fproduction%2F5a89fdc8-323b-4cf2-a317-794074a1adae.png?source=next-article&fit=scale-down&quality=highest&width=700&dpr=1',
201
+ id: '5a89fdc8-323b-4cf2-a317-794074a1adae',
202
+ },
203
+ images: [
204
+ {
205
+ __typename: 'ImageStandardInline',
206
+ height: 1368,
207
+ width: 1600,
208
+ caption:
209
+ 'Staff at the Waitrose on King William street in London, which is taking cash only payments, said that disruption caused by the IT outage was ‘everywhere’',
210
+ credit: '© Ian Smith/FT',
211
+ format: 'standard-inline',
212
+ url: 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fd1e00ek4ebabms.cloudfront.net%2Fproduction%2F5a89fdc8-323b-4cf2-a317-794074a1adae.png?source=next-article&fit=scale-down&quality=highest&width=700&dpr=1',
213
+ id: '5a89fdc8-323b-4cf2-a317-794074a1adae',
214
+ sourceSet: [
215
+ {
216
+ dpr: 1,
217
+ width: 700,
218
+ url: 'https://www.ft.com/__origami/service/image/v2/images/raw/ftcms%3A5a89fdc8-323b-4cf2-a317-794074a1adae?source=next-article&fit=scale-down&quality=highest&width=700&dpr=1',
219
+ },
220
+ {
221
+ dpr: 2,
222
+ width: 700,
223
+ url: 'https://www.ft.com/__origami/service/image/v2/images/raw/ftcms%3A5a89fdc8-323b-4cf2-a317-794074a1adae?source=next-article&fit=scale-down&quality=highest&width=700&dpr=2',
224
+ },
225
+ ],
226
+ },
227
+ ],
56
228
  },
57
- } as ClipSet,
58
- ] as ContentTree.Body['children'],
229
+ },
230
+ ],
59
231
  }
60
- const storyArgs: ExpanderProps = {
232
+
233
+ const storyArgs: ArgsType = {
61
234
  expandLabel: 'Open',
62
235
  collapseLabel: 'Close',
63
236
  onlyMobile: false,
64
237
  id: '111232323-12123-2323',
238
+ structuredContent: structuredContent,
65
239
  }
66
240
 
67
241
  export default {
@@ -70,9 +244,7 @@ export default {
70
244
  tags: ['autodocs'],
71
245
  }
72
246
 
73
- const LiveBLogWrapper: React.FC<ExpanderProps & { classNames?: string }> = (
74
- args
75
- ) => {
247
+ const LiveBLogWrapper: React.FC<ArgsType> = (args) => {
76
248
  const { classNames } = args
77
249
 
78
250
  return (
@@ -102,7 +274,8 @@ const LiveBLogWrapper: React.FC<ExpanderProps & { classNames?: string }> = (
102
274
  )
103
275
  }
104
276
 
105
- const LiveBlogPostWrapper = (args: ExpanderProps) => {
277
+ const LiveBlogPostWrapper = (args: ArgsType) => {
278
+ const { structuredContent, ...expanderProps } = args
106
279
  useEffect(() => {
107
280
  oTracking.init({
108
281
  context: { product: 'next' },
@@ -123,8 +296,8 @@ const LiveBlogPostWrapper = (args: ExpanderProps) => {
123
296
  data-trackable-context-post="1234"
124
297
  data-component="example-boundary"
125
298
  >
126
- <ExpanderServer {...args} id={`${args.id}_expander`}>
127
- <RichText structuredContent={{ tree: structuredContent }} />
299
+ <ExpanderServer {...expanderProps} id={`${args.id}_expander`}>
300
+ <RichText structuredContent={structuredContent} />
128
301
  </ExpanderServer>
129
302
  </div>
130
303
  </div>
@@ -132,13 +305,13 @@ const LiveBlogPostWrapper = (args: ExpanderProps) => {
132
305
  )
133
306
  }
134
307
 
135
- export const OnlyServer = (args: ExpanderProps) => {
308
+ export const OnlyServer = (args: ArgsType) => {
136
309
  return <LiveBLogWrapper {...args} />
137
310
  }
138
311
 
139
312
  OnlyServer.args = { ...storyArgs }
140
313
 
141
- export const WithClient = (args: ExpanderProps) => {
314
+ export const WithClient = (args: ArgsType) => {
142
315
  useEffect(() => {
143
316
  const clips = ClipClient.init(null, {})
144
317
  const expanders = ExpanderClient.init()
@@ -157,3 +330,10 @@ OnlyMobileWithClient.args = { ...storyArgs, onlyMobile: true }
157
330
 
158
331
  export const OnlyMobileServer = OnlyServer
159
332
  OnlyMobileServer.args = { ...storyArgs, onlyMobile: true }
333
+
334
+ export const NoMoreElements = (args: any) => {
335
+ return WithClient({
336
+ ...args,
337
+ structuredContent: structuredContentNoMoreElements,
338
+ })
339
+ }
@@ -18,6 +18,7 @@ $o-typography-load-fonts: false;
18
18
  @import '@financial-times/o-icons/main';
19
19
  @import "@financial-times/o-colors/main";
20
20
  @import "@financial-times/o-spacing/main";
21
+ @import "@financial-times/o-teaser/main";
21
22
  // HACK: n-content-body _should not_ include n-ui-foundations
22
23
  $n-ui-foundations-is-silent: true;
23
24
  @import '@financial-times/cp-content-pipeline-styles/main';
@@ -321,4 +322,23 @@ $desktop-breakpoint: 980px;
321
322
  display: none;
322
323
  }
323
324
 
324
- @include oIcons($opts: ('icons': ('warning-alt')));
325
+ @include oIcons($opts: ('icons': ('warning-alt')));
326
+ @include oTeaser(
327
+ $opts: (
328
+ 'elements': (
329
+ 'default',
330
+ 'images',
331
+ 'timestamp',
332
+ 'syndication',
333
+ 'promoted'
334
+ ),
335
+ 'themes': (
336
+ 'standard',
337
+ 'small',
338
+ 'audio',
339
+ 'large',
340
+ 'hero',
341
+ 'package'
342
+ )
343
+ )
344
+ );
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "noImplicitAny": false
5
+ }
6
+ }
7
+