@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.
Files changed (137) hide show
  1. package/CHANGELOG.md +15 -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 +4 -2
  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 +88 -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 +4 -2
  130. package/src/components/Video/index.tsx +4 -6
  131. package/src/components/Workarounds.ts +188 -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 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Topper/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAqD;AACrD,wDAA+B;AAC/B,kDAAyB;AACzB,0DAAiC;AACjC,oDAA2B;AAC3B,wDAA+B;AAC/B,2DAAkC;AAClC,4DAAmC;AACnC,4EAAmD;AAEnD,2DAAkC;AAClC,4DAAmC;AAEnC,mFAA0D;AAU1D,MAAM,MAAM,GAA0B,CAAC,EACrC,OAAO,EACP,IAAI,EACJ,gBAAgB,EAChB,gBAAgB,GAAG,KAAK,EACxB,YAAY,GACb,EAAE,EAAE;IACH,M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,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAC3B,CACH;oBACA,WAAW,IAAI,CAAC,OAAO,IAAI,SAAS,IAAI,MAAM,CAAC,SAAS,IAAI,CAC3D,uCAAK,SAAS,EAAC,oBAAoB;wBACjC,8BAAC,kBAAQ,IACP,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,SAAS,EACrC,SAAS,EAAE,0BAA0B,EACrC,OAAO,EAAE,eAAe,GACxB,CACE,CACP;oBACA,SAAS,IAAI,MAAM,CAAC,SAAS,IAAI,CAChC,8BAAC,mBAAS,IACR,aAAa,EAAE,MAAM,CAAC,SAAS,EAC/B,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,EAC/C,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CACG;gBACL,YAAY,IAAI,CACf,uCAAK,SAAS,EAAC,qBAAqB,IAAE,YAAY,EAAE,CAAO,CAC5D;gBACD,uCAAK,SAAS,EAAC,sBAAsB,GAAG;gBACvC,QAAQ,IAAI,MAAM,IAAI,8BAAC,iBAAO,IAAC,MAAM,EAAE,MAAM,GAAI,CAC1C,CACN,CACG,CACZ,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { ContentTree } from '@financial-times/content-tree';
3
- import { TweetFragment } from '@financial-times/cp-content-pipeline-client';
4
- declare const Tweet: React.FC<ContentTree.Tweet & TweetFragment>;
3
+ import { ContentProps } from '../types';
4
+ interface TweetProps extends ContentProps<ContentTree.Tweet> {
5
+ }
6
+ declare const Tweet: React.FC<TweetProps>;
5
7
  export default Tweet;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
- const Tweet = (tweet) => {
7
+ const Tweet = ({ content: tweet }) => {
8
8
  if (tweet.html) {
9
9
  return (react_1.default.createElement("div", { className: "n-content-tweet", dangerouslySetInnerHTML: { __html: tweet.html } }));
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Tweet/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAIzB,MAAM,KAAK,GAAgD,CAAC,KAAK,EAAE,EAAE;IACnE,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,OAAO,CACL,uCACE,SAAS,EAAC,iBAAiB,EAC3B,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,GAC/C,CACH,CAAA;IACH,CAAC;SAAM,IAAI,KAAK,CAAC,EAAE,EAAE,CAAC;QACpB,OAAO,CACL;YACE,qCAAG,IAAI,EAAE,KAAK,CAAC,EAAE,IAAG,KAAK,CAAC,EAAE,CAAK,CAC/B,CACL,CAAA;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,kBAAe,KAAK,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Tweet/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAMzB,MAAM,KAAK,GAAyB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;IACzD,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,OAAO,CACL,uCACE,SAAS,EAAC,iBAAiB,EAC3B,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,GAC/C,CACH,CAAA;IACH,CAAC;SAAM,IAAI,KAAK,CAAC,EAAE,EAAE,CAAC;QACpB,OAAO,CACL;YACE,qCAAG,IAAI,EAAE,KAAK,CAAC,EAAE,IAAG,KAAK,CAAC,EAAE,CAAK,CAC/B,CACL,CAAA;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,kBAAe,KAAK,CAAA"}
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
- import { VideoFragment } from '@financial-times/cp-content-pipeline-client';
2
+ import { ContentProps } from '../types';
3
3
  import { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema';
4
- declare const Video: React.FC<VideoFragment & ContentTreeWorkarounds.Video>;
4
+ interface VideoProps extends ContentProps<ContentTreeWorkarounds.Video> {
5
+ }
6
+ declare const Video: React.FC<VideoProps>;
5
7
  export default Video;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
- const Video = ({ id, embedded, title, }) => {
7
+ const Video = ({ content: { id, embedded, title } }) => {
8
8
  return (react_1.default.createElement("div", { className: "n-content-video n-content-video--internal", "data-component": "video" },
9
9
  react_1.default.createElement("div", { className: "n-content-video__placeholder", "data-o-component": "o-video", "data-o-video-id": id },
10
10
  react_1.default.createElement("a", { href: `https://www.ft.com/content/${id}`, "data-embedded": embedded, "data-asset-type": "video", "data-trackable": "link" },
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Video/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAIzB,MAAM,KAAK,GAA2D,CAAC,EACrE,EAAE,EACF,QAAQ,EACR,KAAK,GACN,EAAE,EAAE;IACH,OAAO,CACL,uCACE,SAAS,EAAC,2CAA2C,oBACtC,OAAO;QAEtB,uCACE,SAAS,EAAC,8BAA8B,sBACvB,SAAS,qBACT,EAAE;YAEnB,qCACE,IAAI,EAAE,8BAA8B,EAAE,EAAE,mBACzB,QAAQ,qBACP,OAAO,oBACR,MAAM;gBAErB,4CAAO,KAAK,CAAC,CAAC,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAQ,CAC1D,CACA,CACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,KAAK,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Video/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAMzB,MAAM,KAAK,GAAyB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;IAC3E,OAAO,CACL,uCACE,SAAS,EAAC,2CAA2C,oBACtC,OAAO;QAEtB,uCACE,SAAS,EAAC,8BAA8B,sBACvB,SAAS,qBACT,EAAE;YAEnB,qCACE,IAAI,EAAE,8BAA8B,EAAE,EAAE,mBACzB,QAAQ,qBACP,OAAO,oBACR,MAAM;gBAErB,4CAAO,KAAK,CAAC,CAAC,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAQ,CAC1D,CACA,CACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,KAAK,CAAA"}
@@ -0,0 +1,88 @@
1
+ import type { ContentTree } from '@financial-times/content-tree';
2
+ import { ConceptFragment, TranscriptFragment } from '@financial-times/cp-content-pipeline-client';
3
+ import type { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema';
4
+ import type { LiteralToPrimitiveDeep, SetFieldType, SetOptional, Simplify } from 'type-fest';
5
+ /**
6
+ * Helper type to extend partial/undefined fields to also be null. Optional
7
+ * fields in the Content Tree are represented by a partial field, but are
8
+ * represented by null (abstracted by the Maybe type) in the content pipeline.
9
+ */
10
+ type PartialToMaybe<T> = Simplify<{
11
+ [K in keyof T]: Extract<T[K], undefined> extends never ? T[K] : T[K] | null;
12
+ }>;
13
+ /**
14
+ * Helper type to apply PartialToMaybe mapper type to each object field
15
+ * recursively.
16
+ */
17
+ type PartialToMaybeDeep<T> = T extends object ? PartialToMaybe<{
18
+ [K in keyof T]: PartialToMaybeDeep<T[K]>;
19
+ }> : T;
20
+ /**
21
+ * Helper type to convert arrays to readonly arrays. Content Tree arrays are
22
+ * mutable but the arrays we return from our API are expected to be readonly. We
23
+ * should explore which assumption is correct and match that in the other
24
+ * declaration file.
25
+ */
26
+ type ReadonlyArrays<T> = {
27
+ [K in keyof T]: ReadonlyArray<T[K]>;
28
+ };
29
+ type ReadonlyArray<T> = T extends Array<infer Item> ? readonly Item[] : T;
30
+ export type TeaserConcept = PartialToMaybe<ReadonlyArrays<SetOptional<ContentTree.TeaserConcept, 'apiUrl' | 'directType' | 'predicate' | 'prefLabel' | 'type' | 'types'>>>;
31
+ export type Image = PartialToMaybe<ReadonlyArrays<LiteralToPrimitiveDeep<SetOptional<ContentTree.Image, 'width' | 'height' | 'sourceSet'>>>>;
32
+ export type Teaser = PartialToMaybeDeep<LiteralToPrimitiveDeep<SetOptional<SetFieldType<SetFieldType<ContentTree.Teaser, 'metaLink' | 'metaAltLink', TeaserConcept>, 'image', Omit<Image, 'id' | 'format'>>, 'type' | 'metaLink' | 'metaAltLink' | 'indicators' | 'image'>>>;
33
+ export type Recommended = PartialToMaybe<ContentTreeWorkarounds.Recommended & {
34
+ teaser?: Teaser;
35
+ }>;
36
+ export type ImageSetPicture = PartialToMaybe<ReadonlyArrays<SetOptional<SetFieldType<SetFieldType<ContentTree.ImageSetPicture, 'fallbackImage', Image>, 'images', Image[]>, 'caption' | 'credit'>>>;
37
+ export type ImageSet = PartialToMaybe<SetOptional<SetFieldType<ContentTree.ImageSet | ContentTree.LayoutImage, 'picture', ImageSetPicture>, 'picture'>>;
38
+ export type ScrollyImage = PartialToMaybe<SetOptional<SetFieldType<ContentTree.ScrollyImage, 'picture', ImageSetPicture>, 'picture'>>;
39
+ type ClipFormat = 'standard-inline' | 'mobile';
40
+ interface ClipSource {
41
+ audioCodec?: string;
42
+ binaryUrl: string;
43
+ duration?: number;
44
+ mediaType: string;
45
+ pixelHeight?: number;
46
+ pixelWidth?: number;
47
+ videoCodec?: string;
48
+ }
49
+ export type Clip = PartialToMaybeDeep<ReadonlyArrays<{
50
+ format?: ClipFormat;
51
+ dataSource: ClipSource[];
52
+ poster?: string;
53
+ }>>;
54
+ interface ClipCaption {
55
+ mediaType?: string;
56
+ url?: string;
57
+ }
58
+ type ClipTranscript = TranscriptFragment;
59
+ export type ClipAccessibility = PartialToMaybeDeep<ReadonlyArrays<{
60
+ captions?: ClipCaption[];
61
+ transcript?: ClipTranscript;
62
+ }>>;
63
+ interface ClipSetReferences {
64
+ id: string;
65
+ type: string;
66
+ accessibility?: ClipAccessibility;
67
+ noAudio?: boolean;
68
+ caption?: string;
69
+ credits?: string;
70
+ description?: string;
71
+ displayTitle?: string;
72
+ contentWarning?: string[];
73
+ source?: string;
74
+ subtitle?: string;
75
+ publishedDate?: string;
76
+ clips?: Clip[];
77
+ }
78
+ export type ClipSet = PartialToMaybeDeep<ReadonlyArrays<(ContentTreeWorkarounds.OldClip | ContentTreeWorkarounds.ClipSet) & ClipSetReferences>>;
79
+ export type RawImage = ContentTreeWorkarounds.RawImage & {
80
+ image: Image;
81
+ };
82
+ export type MainImageRaw = ContentTreeWorkarounds.MainImageRaw & {
83
+ image: Image;
84
+ };
85
+ export type Author = PartialToMaybe<ContentTreeWorkarounds.Author & {
86
+ concept?: ConceptFragment;
87
+ }>;
88
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Workarounds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Workarounds.js","sourceRoot":"","sources":["../../src/components/Workarounds.ts"],"names":[],"mappings":""}
@@ -1,4 +1,7 @@
1
1
  import React from 'react';
2
- import { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema';
3
- declare const YoutubeVideo: React.FC<ContentTreeWorkarounds.YoutubeVideo>;
2
+ import { ContentTree } from '@financial-times/content-tree';
3
+ import { ContentProps } from '../types';
4
+ interface YoutubeVideoProps extends ContentProps<ContentTree.YoutubeVideo> {
5
+ }
6
+ declare const YoutubeVideo: React.FC<YoutubeVideoProps>;
4
7
  export default YoutubeVideo;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
- const YoutubeVideo = ({ url, }) => {
7
+ const YoutubeVideo = ({ content: { url } }) => {
8
8
  try {
9
9
  const parsed = new URL(url);
10
10
  const id = parsed.searchParams.get('v');
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/YoutubeVideo/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAGzB,MAAM,YAAY,GAAkD,CAAC,EACnE,GAAG,GACJ,EAAE,EAAE;IACH,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;QAC3B,MAAM,EAAE,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAEvC,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,CACL,uCACE,SAAS,EAAC,0CAA0C,oBACrC,eAAe;YAE9B,uCAAK,SAAS,EAAC,8BAA8B;gBAC3C,0CACE,SAAS,EAAC,2BAA2B,EACrC,WAAW,EAAE,CAAC,EACd,eAAe,QACf,KAAK,EAAC,yEAAyE,EAC/E,GAAG,EAAE,iCAAiC,EAAE,QAAQ,GAChD,CACE,CACF,CACP,CAAA;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC,CAAA;AAED,kBAAe,YAAY,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/YoutubeVideo/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAMzB,MAAM,YAAY,GAAgC,CAAC,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE;IACzE,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAA;QAC3B,MAAM,EAAE,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAEvC,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,CACL,uCACE,SAAS,EAAC,0CAA0C,oBACrC,eAAe;YAE9B,uCAAK,SAAS,EAAC,8BAA8B;gBAC3C,0CACE,SAAS,EAAC,2BAA2B,EACrC,WAAW,EAAE,CAAC,EACd,eAAe,QACf,KAAK,EAAC,yEAAyE,EAC/E,GAAG,EAAE,iCAAiC,EAAE,QAAQ,GAChD,CACE,CACF,CACP,CAAA;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC,CAAA;AAED,kBAAe,YAAY,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { ContentTree } from '@financial-times/content-tree';
2
+ export interface ContentProps<T extends ContentTree.Node> {
3
+ content: T;
4
+ parentIndex?: number;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":""}
package/lib/context.d.ts CHANGED
@@ -1,4 +1,18 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import type { FallbackImageProps, ImageSetProps } from './components/ImageSet';
3
+ import type { PictureProps } from './components/Topper/Picture';
4
+ export type PresentationOverrideTypes = {
5
+ FallbackImage: React.FC<PropsWithChildren<FallbackImageProps>>;
6
+ ImageSet: React.FC<PropsWithChildren<ImageSetProps>>;
7
+ Picture: React.FC<PropsWithChildren<PictureProps>>;
8
+ };
1
9
  export interface PresentationFlags {
2
10
  reduceFullBleedImages?: boolean;
3
11
  }
4
12
  export declare const PresentationFlagsContext: import("react").Context<PresentationFlags>;
13
+ export interface PresentationOverrides {
14
+ FallbackImage?: PresentationOverrideTypes['FallbackImage'];
15
+ ImageSet?: PresentationOverrideTypes['ImageSet'];
16
+ Picture?: PresentationOverrideTypes['Picture'];
17
+ }
18
+ export declare const PresentationOverridesContext: import("react").Context<PresentationOverrides>;
package/lib/context.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PresentationFlagsContext = void 0;
3
+ exports.PresentationOverridesContext = exports.PresentationFlagsContext = void 0;
4
4
  const react_1 = require("react");
5
5
  exports.PresentationFlagsContext = (0, react_1.createContext)({});
6
+ exports.PresentationOverridesContext = (0, react_1.createContext)({});
6
7
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;AAAA,iCAAqC;AAUxB,QAAA,wBAAwB,GAAG,IAAA,qBAAa,EAAoB,EAAE,CAAC,CAAA"}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;AAAA,iCAAwD;AAmB3C,QAAA,wBAAwB,GAAG,IAAA,qBAAa,EAAoB,EAAE,CAAC,CAAA;AAW/D,QAAA,4BAA4B,GACvC,IAAA,qBAAa,EAAwB,EAAE,CAAC,CAAA"}
package/lib/index.d.ts CHANGED
@@ -23,4 +23,4 @@ export { default as Tweet } from './components/Tweet';
23
23
  export { default as Video } from './components/Video';
24
24
  export { default as YoutubeVideo } from './components/YoutubeVideo';
25
25
  export { List, ListItem, Link, Blockquote, LineBreak, HorizontalRule, Emphasis, Strong, Strikethrough, Cite, } from './components/RichText/BasicComponents';
26
- export { PresentationFlagsContext } from './context';
26
+ export { PresentationFlagsContext, PresentationOverridesContext, } from './context';
package/lib/index.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PresentationFlagsContext = exports.Cite = exports.Strikethrough = exports.Strong = exports.Emphasis = exports.HorizontalRule = exports.LineBreak = exports.Blockquote = exports.Link = exports.ListItem = exports.List = exports.YoutubeVideo = exports.Video = exports.Tweet = exports.Topper = exports.Table = exports.ScrollyBlock = exports.RichText = exports.Recommended = exports.Pullquote = exports.PodcastBody = exports.Paragraph = exports.MainImage = exports.LiveBlogWrapper = exports.LiveBlogBody = exports.LayoutSlot = exports.LayoutContainer = exports.Layout = exports.Clip = exports.ImageSet = exports.Heading = exports.Flourish = exports.Byline = exports.Body = exports.BigNumber = exports.ArticleInfo = exports.ArticleBody = void 0;
6
+ exports.PresentationOverridesContext = exports.PresentationFlagsContext = exports.Cite = exports.Strikethrough = exports.Strong = exports.Emphasis = exports.HorizontalRule = exports.LineBreak = exports.Blockquote = exports.Link = exports.ListItem = exports.List = exports.YoutubeVideo = exports.Video = exports.Tweet = exports.Topper = exports.Table = exports.ScrollyBlock = exports.RichText = exports.Recommended = exports.Pullquote = exports.PodcastBody = exports.Paragraph = exports.MainImage = exports.LiveBlogWrapper = exports.LiveBlogBody = exports.LayoutSlot = exports.LayoutContainer = exports.Layout = exports.Clip = exports.ImageSet = exports.Heading = exports.Flourish = exports.Byline = exports.Body = exports.BigNumber = exports.ArticleInfo = exports.ArticleBody = void 0;
7
7
  var ArticleBody_1 = require("./components/ArticleBody");
8
8
  Object.defineProperty(exports, "ArticleBody", { enumerable: true, get: function () { return __importDefault(ArticleBody_1).default; } });
9
9
  var ArticleInfo_1 = require("./components/ArticleInfo");
@@ -67,4 +67,5 @@ Object.defineProperty(exports, "Strikethrough", { enumerable: true, get: functio
67
67
  Object.defineProperty(exports, "Cite", { enumerable: true, get: function () { return BasicComponents_1.Cite; } });
68
68
  var context_1 = require("./context");
69
69
  Object.defineProperty(exports, "PresentationFlagsContext", { enumerable: true, get: function () { return context_1.PresentationFlagsContext; } });
70
+ Object.defineProperty(exports, "PresentationOverridesContext", { enumerable: true, get: function () { return context_1.PresentationOverridesContext; } });
70
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AAO,OAAU;AAC1B,4CAAqD;AAA5C,+GAAA,OAAO,OAAS;AACzB,4CAAqD;AAA5C,+GAAA,OAAO,OAAS;AACzB,0DAAmE;AAA1D,6HAAA,OAAO,OAAgB;AAChC,yEAW8C;AAV5C,uGAAA,IAAI,OAAA;AACJ,2GAAA,QAAQ,OAAA;AACR,uGAAA,IAAI,OAAA;AACJ,6GAAA,UAAU,OAAA;AACV,4GAAA,SAAS,OAAA;AACT,iHAAA,cAAc,OAAA;AACd,2GAAA,QAAQ,OAAA;AACR,yGAAA,MAAM,OAAA;AACN,gHAAA,aAAa,OAAA;AACb,uGAAA,IAAI,OAAA;AAEN,qCAGkB;AAFhB,mHAAA,wBAAwB,OAAA;AACxB,uHAAA,4BAA4B,OAAA"}
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
+ import type { StoryObj } from '@storybook/react';
3
+ import ClipServer from '../components/Clip';
2
4
  import './Clip.stories.scss';
3
5
  import { ClipProps } from '../components/Clip/template/component';
4
6
  declare const _default: {
@@ -6,259 +8,53 @@ declare const _default: {
6
8
  component: React.FC<ClipProps>;
7
9
  tags: string[];
8
10
  argTypes: {
9
- dataLayout: {
10
- options: string[];
11
- control: {
12
- type: string;
13
- };
14
- };
15
- };
16
- };
17
- export default _default;
18
- export declare const Inline: {
19
- (args: ClipProps): React.JSX.Element;
20
- args: {
21
- type: string;
22
- autoplay: boolean;
23
- loop: boolean;
24
- muted: boolean;
25
- dataLayout: string;
26
- id: string;
27
- noAudio: null;
28
- caption: string;
29
- credits: string;
30
- description: string;
31
- displayTitle: null;
32
- contentWarning: never[];
33
- source: null;
34
- subtitle: null;
35
- publishedDate: string;
36
- clips: {
37
- __typename: string;
38
- format: string;
39
- dataSource: ({
40
- audioCodec: string;
41
- binaryUrl: string;
42
- duration: number;
43
- mediaType: string;
44
- pixelHeight: number;
45
- pixelWidth: number;
46
- videoCodec: string;
47
- } | {
48
- audioCodec: string;
49
- binaryUrl: string;
50
- duration: number;
51
- mediaType: string;
52
- pixelHeight: null;
53
- pixelWidth: null;
54
- videoCodec: null;
55
- })[];
56
- poster: string;
57
- }[];
58
- accessibility: {
59
- captions: {
60
- url: string;
61
- mediaType: string;
62
- }[];
63
- transcript: {
64
- source: string;
65
- structured: {
66
- tree: {
67
- type: string;
68
- version: number;
69
- children: {
70
- type: string;
71
- children: {
72
- type: string;
73
- value: string;
74
- }[];
75
- }[];
76
- };
11
+ content: {
12
+ dataLayout: {
13
+ options: string[];
14
+ control: {
15
+ type: string;
77
16
  };
78
17
  };
79
18
  };
80
19
  };
81
20
  };
82
- export declare const InlineSquare: {
83
- (args: ClipProps): React.JSX.Element;
84
- args: {
85
- autoplay: boolean;
86
- loop: boolean;
87
- muted: boolean;
88
- dataLayout: string;
89
- id: string;
90
- noAudio: null;
91
- caption: null;
92
- credits: string;
93
- description: string;
94
- displayTitle: null;
95
- contentWarning: never[];
96
- source: null;
97
- subtitle: null;
98
- publishedDate: string;
99
- clips: {
100
- __typename: string;
101
- format: string;
102
- dataSource: {
103
- audioCodec: string;
104
- binaryUrl: string;
105
- duration: number;
106
- mediaType: string;
107
- pixelHeight: number;
108
- pixelWidth: number;
109
- videoCodec: string;
110
- }[];
111
- poster: string;
112
- }[];
113
- accessibility: {
114
- captions: never[];
115
- transcript: null;
116
- };
117
- };
118
- };
119
- export declare const InlineLandscape: {
120
- (args: ClipProps): React.JSX.Element;
121
- args: {
122
- url: string;
123
- credits: string;
124
- caption: string;
125
- poster: string;
126
- alt: string;
127
- dataLayout: string;
128
- description: string;
129
- noAudio: boolean;
130
- accessibility: {
131
- captions: {
132
- url: string;
133
- }[];
134
- };
135
- clips: {
136
- __typename: string;
137
- format: string;
138
- dataSource: ({
139
- audioCodec: string;
140
- binaryUrl: string;
141
- duration: number;
142
- mediaType: string;
143
- pixelHeight: number;
144
- pixelWidth: number;
145
- videoCodec: string;
146
- } | {
147
- audioCodec: string;
148
- binaryUrl: string;
149
- duration: number;
150
- mediaType: string;
151
- pixelHeight: null;
152
- pixelWidth: null;
153
- videoCodec: null;
154
- })[];
155
- poster: string;
156
- }[];
157
- };
158
- };
159
- export declare const InlineAutoplay: {
160
- (args: ClipProps): React.JSX.Element;
161
- args: {
162
- type: string;
163
- autoplay: boolean;
164
- loop: boolean;
165
- muted: boolean;
166
- dataLayout: string;
167
- id: string;
168
- noAudio: null;
169
- caption: string;
170
- credits: string;
171
- description: string;
172
- displayTitle: null;
173
- contentWarning: never[];
174
- source: null;
175
- subtitle: null;
176
- publishedDate: string;
177
- clips: {
178
- __typename: string;
179
- format: string;
180
- dataSource: ({
181
- audioCodec: string;
182
- binaryUrl: string;
183
- duration: number;
184
- mediaType: string;
185
- pixelHeight: number;
186
- pixelWidth: number;
187
- videoCodec: string;
188
- } | {
189
- audioCodec: string;
190
- binaryUrl: string;
191
- duration: number;
192
- mediaType: string;
193
- pixelHeight: null;
194
- pixelWidth: null;
195
- videoCodec: null;
196
- })[];
197
- poster: string;
198
- }[];
199
- accessibility: {
200
- captions: never[];
201
- transcript: null;
202
- };
203
- };
204
- };
205
- export declare const NoDataSource: {
206
- (args: ClipProps): React.JSX.Element;
207
- args: {
208
- type: string;
209
- autoplay: boolean;
210
- loop: boolean;
211
- muted: boolean;
212
- dataLayout: string;
213
- id: string;
214
- noAudio: null;
215
- caption: string;
216
- credits: string;
217
- description: string;
218
- displayTitle: null;
219
- contentWarning: never[];
220
- source: null;
221
- subtitle: null;
222
- publishedDate: string;
223
- clips: {
224
- __typename: string;
225
- format: string;
226
- poster: string;
227
- }[];
228
- accessibility: {
229
- captions: never[];
230
- transcript: null;
231
- };
232
- };
233
- };
21
+ export default _default;
22
+ type Story = StoryObj<typeof ClipServer>;
23
+ export declare const Inline: Story;
24
+ export declare const InlineSquare: Story;
25
+ export declare const InlineLandscape: Story;
26
+ export declare const InlineAutoplay: Story;
27
+ export declare const NoDataSource: Story;
234
28
  export declare const ThumbnailClip: {
235
29
  (args: ClipProps): React.JSX.Element;
236
30
  args: {
237
- accessibility: {
238
- captions: never[];
239
- transcript: null;
240
- };
241
- autoplay: boolean;
242
- clips: {
243
- dataSource: {
244
- audioCodec: string;
245
- binaryUrl: string;
246
- duration: number;
247
- mediaType: string;
248
- pixelHeight: number;
249
- pixelWidth: number;
250
- videoCodec: string;
31
+ content: {
32
+ accessibility: {
33
+ captions: never[];
34
+ transcript: null;
35
+ };
36
+ autoplay: boolean;
37
+ clips: {
38
+ dataSource: {
39
+ audioCodec: string;
40
+ binaryUrl: string;
41
+ duration: number;
42
+ mediaType: string;
43
+ pixelHeight: number;
44
+ pixelWidth: number;
45
+ videoCodec: string;
46
+ }[];
47
+ id: string;
48
+ poster: string;
251
49
  }[];
50
+ dataLayout: string;
252
51
  id: string;
52
+ loop: boolean;
53
+ muted: boolean;
54
+ noAudio: null;
253
55
  poster: string;
254
- }[];
255
- dataLayout: string;
256
- id: string;
257
- loop: boolean;
258
- muted: boolean;
259
- noAudio: null;
260
- poster: string;
261
- publishedDate: string;
262
- type: string;
56
+ publishedDate: string;
57
+ type: string;
58
+ };
263
59
  };
264
60
  };