@financial-times/cp-content-pipeline-ui 12.9.2 → 12.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/lib/components/LiveBlogPost/index.js +4 -1
- package/lib/components/LiveBlogPost/index.js.map +1 -1
- package/lib/components/content-tree/Recommended/index.js +4 -7
- package/lib/components/content-tree/Recommended/index.js.map +1 -1
- package/lib/components/content-tree/RecommendedLivePost/index.d.ts +7 -0
- package/lib/components/content-tree/RecommendedLivePost/index.js +17 -0
- package/lib/components/content-tree/RecommendedLivePost/index.js.map +1 -0
- package/lib/components/content-tree/Workarounds.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/LiveBlogPost/index.tsx +7 -1
- package/src/components/content-tree/Recommended/index.tsx +8 -15
- package/src/components/content-tree/RecommendedLivePost/index.tsx +34 -0
- package/src/components/content-tree/Workarounds.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -574,6 +574,21 @@
|
|
|
574
574
|
* @financial-times/cp-content-pipeline-client bumped from ^3.7.2 to ^3.7.3
|
|
575
575
|
* @financial-times/cp-content-pipeline-schema bumped from ^2.10.1 to ^2.10.2
|
|
576
576
|
|
|
577
|
+
## [12.10.0](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-ui-v12.9.2...cp-content-pipeline-ui-v12.10.0) (2026-07-06)
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
### Features
|
|
581
|
+
|
|
582
|
+
* use component override for Recommended Live Blog variant ([3468171](https://github.com/Financial-Times/cp-content-pipeline/commit/3468171560652ea2c61d62042ba7f323f5e107c0))
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
### Dependencies
|
|
586
|
+
|
|
587
|
+
* The following workspace dependencies were updated
|
|
588
|
+
* devDependencies
|
|
589
|
+
* @financial-times/cp-content-pipeline-client bumped from ^6.5.1 to ^6.6.0
|
|
590
|
+
* @financial-times/cp-content-pipeline-schema bumped from ^5.7.0 to ^5.8.0
|
|
591
|
+
|
|
577
592
|
## [12.9.2](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-ui-v12.9.1...cp-content-pipeline-ui-v12.9.2) (2026-07-02)
|
|
578
593
|
|
|
579
594
|
|
|
@@ -13,6 +13,7 @@ const Expander_1 = __importDefault(require("../Expander"));
|
|
|
13
13
|
const classnames_1 = __importDefault(require("classnames"));
|
|
14
14
|
const Headshot_1 = __importDefault(require("../Headshot"));
|
|
15
15
|
const Byline_1 = __importDefault(require("../Byline"));
|
|
16
|
+
const RecommendedLivePost_1 = __importDefault(require("../content-tree/RecommendedLivePost"));
|
|
16
17
|
const TruncatedPost = ({ id, children, }) => {
|
|
17
18
|
return (react_1.default.createElement("div", { "data-trackable": "truncated-post", "data-trackable-context-post": id, "data-trackable-category": "live-blog", className: "x-live-blog-post__body n-content-body article--body o3-type-body-content-base" },
|
|
18
19
|
react_1.default.createElement(Expander_1.default, { expandLabel: "Expand post", collapseLabel: "Collapse post", onlyMobile: true, id: `truncated-${id}` }, children)));
|
|
@@ -43,7 +44,9 @@ publishedDate, articleUrl, showShareButtons = false, showShareLinkButton = false
|
|
|
43
44
|
if (body && 'structured' in body) {
|
|
44
45
|
// Content comes from cp-content-pipeline-api
|
|
45
46
|
postBody = (react_1.default.createElement(TruncatedPost, { id: id },
|
|
46
|
-
react_1.default.createElement(RichText_1.default, { structuredContent: body.structured
|
|
47
|
+
react_1.default.createElement(RichText_1.default, { structuredContent: body.structured, components: {
|
|
48
|
+
recommended: RecommendedLivePost_1.default,
|
|
49
|
+
} })));
|
|
47
50
|
}
|
|
48
51
|
else {
|
|
49
52
|
// Content comes from next-es or wordpress
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LiveBlogPost/index.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,kEAAyC;AACzC,wEAA+C;AAC/C,4DAAmC;AACnC,2DAAkC;AAClC,2DAAkC;AAClC,4DAAmC;AACnC,2DAAkC;AAClC,uDAA8B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LiveBlogPost/index.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,kEAAyC;AACzC,wEAA+C;AAC/C,4DAAmC;AACnC,2DAAkC;AAClC,2DAAkC;AAClC,4DAAmC;AACnC,2DAAkC;AAClC,uDAA8B;AAC9B,8FAAqE;AAWrE,MAAM,aAAa,GAAsD,CAAC,EACxE,EAAE,EACF,QAAQ,GACT,EAAE,EAAE;IACH,OAAO,CACL,yDACiB,gBAAgB,iCACF,EAAE,6BACP,WAAW,EACnC,SAAS,EAAC,+EAA+E;QAEzF,8BAAC,kBAAQ,IACP,WAAW,EAAC,aAAa,EACzB,aAAa,EAAC,eAAe,EAC7B,UAAU,EAAE,IAAI,EAChB,EAAE,EAAE,aAAa,EAAE,EAAE,IAEpB,QAAQ,CACA,CACP,CACP,CAAA;AACH,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC7B,MAAM,MAAM,GAAG,2BAA2B,CAAA;IAC1C,MAAM,SAAS,GAAG;QAChB,GAAG;QACH,YAAY;QACZ,IAAI;QACJ,oBAAoB;QACpB,sCAAsC;QACtC,2BAA2B;QAC3B,uBAAuB;QACvB,IAAI;QACJ,kBAAkB;QAClB,+BAA+B;KAChC,CAAA;IACD,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC/D,CAAC,CAAA;AAoBD,MAAM,YAAY,GAAgC,CAAC,EACjD,EAAE,EACF,MAAM,EAAE,4CAA4C;AACpD,KAAK,EACL,OAAO,EAAE,4CAA4C;AACrD,QAAQ,EAAE,eAAe;AACzB,IAAI,EAAE,sBAAsB;AAC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,EAAE,UAAU,GAAI,CAClE,CACG;QAEL,KAAK,IAAI,CACR,sCAAI,SAAS,EAAC,4CAA4C,IAAE,KAAK,CAAM,CACxE;QACA,QAAQ;QACT,uCAAK,SAAS,EAAC,4BAA4B,IACxC,gBAAgB,IAAI,CACnB,8BAAC,sBAAY,IACX,MAAM,EAAE,EAAE,IAAI,MAAM,EACpB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,GACZ,CACH,CACG;QACL,EAAS,CACF,CACX,CAAA;AACH,CAAC,CAAA;AAEQ,oCAAY"}
|
|
@@ -6,16 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
//HACK: worked around missing Teaser type by declaring a module x-teaser.d.ts
|
|
8
8
|
const x_teaser_1 = require("@financial-times/x-teaser");
|
|
9
|
-
const
|
|
10
|
-
const Recommended = ({ content: { heading, teaser, isInLiveBlog }, }) => {
|
|
9
|
+
const Recommended = ({ content: { heading, teaser }, }) => {
|
|
11
10
|
if (!teaser) {
|
|
12
11
|
return null;
|
|
13
12
|
}
|
|
14
|
-
return (react_1.default.createElement("aside", { "aria-labelledby": "aside-label", className:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
!isInLiveBlog && (react_1.default.createElement("p", { className: "n-content-recommended__title o3-type-body-highlight" }, heading)),
|
|
18
|
-
react_1.default.createElement(x_teaser_1.Teaser, { modifiers: isInLiveBlog ? ['post'] : ['stacked'], ...x_teaser_1.presets.SmallHeavy, ...teaser })));
|
|
13
|
+
return (react_1.default.createElement("aside", { "aria-labelledby": "aside-label", className: 'n-content-recommended--single-story n-content-recommended--inset', "data-component": "recommended" },
|
|
14
|
+
react_1.default.createElement("p", { className: "n-content-recommended__title o3-type-body-highlight" }, heading),
|
|
15
|
+
react_1.default.createElement(x_teaser_1.Teaser, { modifiers: ['stacked'], ...x_teaser_1.presets.SmallHeavy, ...teaser })));
|
|
19
16
|
};
|
|
20
17
|
exports.default = Recommended;
|
|
21
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/content-tree/Recommended/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,6EAA6E;AAC7E,wDAA2D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/content-tree/Recommended/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,6EAA6E;AAC7E,wDAA2D;AAW3D,MAAM,WAAW,GAA+B,CAAC,EAC/C,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAC7B,EAAE,EAAE;IACH,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,CACL,4DACkB,aAAa,EAC7B,SAAS,EACP,kEAAkE,oBAErD,aAAa;QAE5B,qCAAG,SAAS,EAAC,qDAAqD,IAC/D,OAAO,CACN;QACJ,8BAAC,iBAAM,IAAC,SAAS,EAAE,CAAC,SAAS,CAAC,KAAM,kBAAO,CAAC,UAAU,KAAM,MAAM,GAAI,CAChE,CACT,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ContentProps } from '../../types';
|
|
3
|
+
import type * as ComponentWorkarounds from '../Workarounds';
|
|
4
|
+
interface RecommendedProps extends ContentProps<ComponentWorkarounds.Recommended> {
|
|
5
|
+
}
|
|
6
|
+
declare const RecommendedLivePost: React.FC<RecommendedProps>;
|
|
7
|
+
export default RecommendedLivePost;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
//HACK: worked around missing Teaser type by declaring a module x-teaser.d.ts
|
|
8
|
+
const x_teaser_1 = require("@financial-times/x-teaser");
|
|
9
|
+
const RecommendedLivePost = ({ content: { teaser }, }) => {
|
|
10
|
+
if (!teaser) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return (react_1.default.createElement("aside", { "aria-labelledby": "aside-label", className: 'n-content-recommended--single-story', "data-component": "recommended" },
|
|
14
|
+
react_1.default.createElement(x_teaser_1.Teaser, { modifiers: ['post'], ...x_teaser_1.presets.SmallHeavy, ...teaser })));
|
|
15
|
+
};
|
|
16
|
+
exports.default = RecommendedLivePost;
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/content-tree/RecommendedLivePost/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,6EAA6E;AAC7E,wDAA2D;AAY3D,MAAM,mBAAmB,GAA+B,CAAC,EACvD,OAAO,EAAE,EAAE,MAAM,EAAE,GACpB,EAAE,EAAE;IACH,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,CACL,4DACkB,aAAa,EAC7B,SAAS,EAAE,qCAAqC,oBACjC,aAAa;QAE5B,8BAAC,iBAAM,IAAC,SAAS,EAAE,CAAC,MAAM,CAAC,KAAM,kBAAO,CAAC,UAAU,KAAM,MAAM,GAAI,CAC7D,CACT,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,mBAAmB,CAAA"}
|
|
@@ -30,7 +30,7 @@ type ReadonlyArray<T> = T extends Array<infer Item> ? readonly Item[] : T;
|
|
|
30
30
|
export type TeaserConcept = PartialToMaybe<ReadonlyArrays<SetOptional<ContentTree.TeaserConcept, 'apiUrl' | 'directType' | 'predicate' | 'prefLabel' | 'type' | 'types'>>>;
|
|
31
31
|
export type Image = PartialToMaybe<ReadonlyArrays<LiteralToPrimitiveDeep<SetOptional<ContentTree.Image, 'width' | 'height' | 'sourceSet'>>>>;
|
|
32
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<
|
|
33
|
+
export type Recommended = PartialToMaybe<ContentTree.transit.Recommended & {
|
|
34
34
|
teaser?: Teaser;
|
|
35
35
|
}>;
|
|
36
36
|
export type RecommendedList = PartialToMaybe<ReadonlyArrays<Omit<ContentTree.RecommendedList, 'children'> & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/cp-content-pipeline-ui",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.10.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"@babel/preset-react": "^7.22.5",
|
|
18
18
|
"@dotcom-tool-kit/npm": "^5.0.1",
|
|
19
19
|
"@financial-times/content-tree": "^0.17.0",
|
|
20
|
-
"@financial-times/cp-content-pipeline-client": "^6.
|
|
21
|
-
"@financial-times/cp-content-pipeline-schema": "^5.
|
|
20
|
+
"@financial-times/cp-content-pipeline-client": "^6.6.0",
|
|
21
|
+
"@financial-times/cp-content-pipeline-schema": "^5.8.0",
|
|
22
22
|
"@financial-times/cp-content-pipeline-styles": "^4.8.2",
|
|
23
23
|
"@financial-times/n-scrollytelling-image": "^1.1.0",
|
|
24
24
|
"@financial-times/o-grid": "^6.1.8",
|
|
@@ -7,6 +7,7 @@ import Expander from '../Expander'
|
|
|
7
7
|
import classnames from 'classnames'
|
|
8
8
|
import Headshot from '../Headshot'
|
|
9
9
|
import Byline from '../Byline'
|
|
10
|
+
import RecommendedLivePost from '../content-tree/RecommendedLivePost'
|
|
10
11
|
import { StructuredTreeFragment } from '@financial-times/cp-content-pipeline-client'
|
|
11
12
|
|
|
12
13
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
@@ -98,7 +99,12 @@ const LiveBlogPost: React.FC<LiveBlogPostProps> = ({
|
|
|
98
99
|
// Content comes from cp-content-pipeline-api
|
|
99
100
|
postBody = (
|
|
100
101
|
<TruncatedPost id={id}>
|
|
101
|
-
<RichText
|
|
102
|
+
<RichText
|
|
103
|
+
structuredContent={body.structured}
|
|
104
|
+
components={{
|
|
105
|
+
recommended: RecommendedLivePost,
|
|
106
|
+
}}
|
|
107
|
+
/>
|
|
102
108
|
</TruncatedPost>
|
|
103
109
|
)
|
|
104
110
|
} else {
|
|
@@ -2,7 +2,6 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
//HACK: worked around missing Teaser type by declaring a module x-teaser.d.ts
|
|
4
4
|
import { presets, Teaser } from '@financial-times/x-teaser'
|
|
5
|
-
import classnames from 'classnames'
|
|
6
5
|
import { ContentProps } from '../../types'
|
|
7
6
|
import type * as ComponentWorkarounds from '../Workarounds'
|
|
8
7
|
|
|
@@ -14,7 +13,7 @@ interface RecommendedProps
|
|
|
14
13
|
extends ContentProps<ComponentWorkarounds.Recommended> {}
|
|
15
14
|
|
|
16
15
|
const Recommended: React.FC<RecommendedProps> = ({
|
|
17
|
-
content: { heading, teaser
|
|
16
|
+
content: { heading, teaser },
|
|
18
17
|
}) => {
|
|
19
18
|
if (!teaser) {
|
|
20
19
|
return null
|
|
@@ -23,21 +22,15 @@ const Recommended: React.FC<RecommendedProps> = ({
|
|
|
23
22
|
return (
|
|
24
23
|
<aside
|
|
25
24
|
aria-labelledby="aside-label"
|
|
26
|
-
className={
|
|
27
|
-
'n-content-recommended--inset'
|
|
28
|
-
}
|
|
25
|
+
className={
|
|
26
|
+
'n-content-recommended--single-story n-content-recommended--inset'
|
|
27
|
+
}
|
|
29
28
|
data-component="recommended"
|
|
30
29
|
>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
)}
|
|
36
|
-
<Teaser
|
|
37
|
-
modifiers={isInLiveBlog ? ['post'] : ['stacked']}
|
|
38
|
-
{...presets.SmallHeavy}
|
|
39
|
-
{...teaser}
|
|
40
|
-
/>
|
|
30
|
+
<p className="n-content-recommended__title o3-type-body-highlight">
|
|
31
|
+
{heading}
|
|
32
|
+
</p>
|
|
33
|
+
<Teaser modifiers={['stacked']} {...presets.SmallHeavy} {...teaser} />
|
|
41
34
|
</aside>
|
|
42
35
|
)
|
|
43
36
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
//HACK: worked around missing Teaser type by declaring a module x-teaser.d.ts
|
|
4
|
+
import { presets, Teaser } from '@financial-times/x-teaser'
|
|
5
|
+
import { ContentProps } from '../../types'
|
|
6
|
+
import type * as ComponentWorkarounds from '../Workarounds'
|
|
7
|
+
|
|
8
|
+
// Renders an "inset" variant Recommended teaser component
|
|
9
|
+
// to be used in Live Blogs
|
|
10
|
+
// `<Teaser>` is imported from x-dash
|
|
11
|
+
// https://github.com/Financial-Times/x-dash/tree/main/components/x-teaser)
|
|
12
|
+
|
|
13
|
+
interface RecommendedProps
|
|
14
|
+
extends ContentProps<ComponentWorkarounds.Recommended> {}
|
|
15
|
+
|
|
16
|
+
const RecommendedLivePost: React.FC<RecommendedProps> = ({
|
|
17
|
+
content: { teaser },
|
|
18
|
+
}) => {
|
|
19
|
+
if (!teaser) {
|
|
20
|
+
return null
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<aside
|
|
25
|
+
aria-labelledby="aside-label"
|
|
26
|
+
className={'n-content-recommended--single-story'}
|
|
27
|
+
data-component="recommended"
|
|
28
|
+
>
|
|
29
|
+
<Teaser modifiers={['post']} {...presets.SmallHeavy} {...teaser} />
|
|
30
|
+
</aside>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default RecommendedLivePost
|