@financial-times/cp-content-pipeline-ui 9.22.2 → 9.23.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 +12 -0
- package/lib/components/Topper/Tags.d.ts +0 -1
- package/lib/components/Topper/Tags.js +3 -5
- package/lib/components/Topper/Tags.js.map +1 -1
- package/lib/components/Topper/index.js +4 -14
- package/lib/components/Topper/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Topper/Tags.tsx +2 -7
- package/src/components/Topper/index.tsx +3 -17
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -574,6 +574,18 @@
|
|
|
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
|
+
## [9.23.0](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-ui-v9.22.2...cp-content-pipeline-ui-v9.23.0) (2026-02-11)
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
### Features
|
|
581
|
+
|
|
582
|
+
* ci-3329 simplify topper templates for opinion ([213e10a](https://github.com/Financial-Times/cp-content-pipeline/commit/213e10a8f64d88accb0e7bc39c38d8ba93280486))
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
### Bug Fixes
|
|
586
|
+
|
|
587
|
+
* ci-3329 simplify logic for follow button ([cb64bf2](https://github.com/Financial-Times/cp-content-pipeline/commit/cb64bf2370da314033d3980bfd5728227d97d127))
|
|
588
|
+
|
|
577
589
|
## [9.22.2](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-ui-v9.22.1...cp-content-pipeline-ui-v9.22.2) (2026-02-09)
|
|
578
590
|
|
|
579
591
|
|
|
@@ -4,13 +4,11 @@ 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 Tags = ({ __typename, isPackage, displayConcept, genreConcept, brandConcept, hasColumnists, followButtonVariant,
|
|
7
|
+
const Tags = ({ __typename, isPackage, displayConcept, genreConcept, brandConcept, hasColumnists, followButtonVariant, FollowButtonSlot, }) => {
|
|
8
8
|
const isOpinion = __typename === 'OpinionTopper';
|
|
9
9
|
const concept = getConcept(displayConcept, genreConcept);
|
|
10
|
-
//
|
|
11
|
-
const
|
|
12
|
-
const additionalFollowButtonCondition = (isOpinion && !headshot && !hasColumnists) || !isOpinion;
|
|
13
|
-
const followButtonCondition = baseFollowButtonCondition && additionalFollowButtonCondition;
|
|
10
|
+
// only show the follow button if there is a slot, a concept id and it does not have columnists in the topper
|
|
11
|
+
const followButtonCondition = FollowButtonSlot && concept?.id && !hasColumnists;
|
|
14
12
|
return (react_1.default.createElement("div", { className: "o-topper__tags" }, isPackage && brandConcept?.id ? (react_1.default.createElement(ConceptLabel, { ...brandConcept })) : (!isPackage && (react_1.default.createElement("div", { className: "topper__primary-theme" },
|
|
15
13
|
isOpinion && (react_1.default.createElement("span", { className: "o-topper__opinion-genre", "aria-label": "opinion article" }, `Opinion `)),
|
|
16
14
|
brandConcept && react_1.default.createElement(BrandConcept, { ...brandConcept }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tags.js","sourceRoot":"","sources":["../../../src/components/Topper/Tags.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;
|
|
1
|
+
{"version":3,"file":"Tags.js","sourceRoot":"","sources":["../../../src/components/Topper/Tags.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAmBzB,MAAM,IAAI,GAAwB,CAAC,EACjC,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GACjB,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,UAAU,K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AAC,SAAS,SAAS;QAEpD,OAAO,CAAC,SAAS;kBAChB,CACL,CAAA;AACH,CAAC,CAAA;AAED,MAAM,YAAY,GAA8B,CAAC,OAAO,EAAE,EAAE;IAC1D,OAAO,CACL,qCACE,IAAI,EAAE,OAAO,CAAC,WAAW,EACzB,SAAS,EAAC,6DAA6D,oBACxD,eAAe,gBAClB,sBAAsB,OAAO,CAAC,SAAS,EAAE,qBACpC,OAAO,CAAC,EAAE,IAE1B,OAAO,CAAC,SAAS,CAChB,CACL,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,IAAI,CAAA"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// TODO ci-3315: when API updates have gone out for >24hr we can simplify this
|
|
3
|
-
// will be able to remove isOpinion and reduce logic for headshot, which will be null for all except opinion with 1 author
|
|
4
|
-
// oneColumnist etc. won't be necessary any more
|
|
5
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
3
|
if (k2 === undefined) k2 = k;
|
|
7
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -68,13 +65,6 @@ const Topper = ({ content, slot, followButtonSlot, showPremiumLabel = false, rea
|
|
|
68
65
|
const hasColumnists = 'columnists' in topper &&
|
|
69
66
|
!!topper.columnists &&
|
|
70
67
|
topper.columnists.length > 0;
|
|
71
|
-
const legacyHasColumnist = 'columnist' in topper && topper.columnist && !hasColumnists; // @deprecated Replaced with usage of `columinists`
|
|
72
|
-
const hasOneColumnist = (hasColumnists && topper.columnists.length === 1) || legacyHasColumnist;
|
|
73
|
-
const oneColumnist = hasOneColumnist
|
|
74
|
-
? hasColumnists
|
|
75
|
-
? topper.columnists[0]
|
|
76
|
-
: topper.columnist
|
|
77
|
-
: null;
|
|
78
68
|
const sponsorName = 'clientName' in content && content.clientName;
|
|
79
69
|
const disclaimerType = isArticle ? content.disclaimerType : undefined;
|
|
80
70
|
const modifiers = [];
|
|
@@ -115,7 +105,7 @@ const Topper = ({ content, slot, followButtonSlot, showPremiumLabel = false, rea
|
|
|
115
105
|
'o-topper__content--background-box': topper.backgroundBox,
|
|
116
106
|
}), id: "o-topper" },
|
|
117
107
|
isLiveBlog ? (react_1.default.createElement("div", { className: "o-topper__tags" },
|
|
118
|
-
react_1.default.createElement(LiveBlogIndicator_1.default, { realtime: content.realtime ?? undefined, lastUpdatedDateTime: getMostRecentPostPublishedDate() }))) : (react_1.default.createElement(Tags_1.default, { __typename: topper.__typename, isPackage: isPackage, displayConcept: topper.displayConcept ?? undefined, brandConcept: ('brandConcept' in topper && topper.brandConcept) || undefined, genreConcept: ('genreConcept' in topper && topper.genreConcept) || undefined,
|
|
108
|
+
react_1.default.createElement(LiveBlogIndicator_1.default, { realtime: content.realtime ?? undefined, lastUpdatedDateTime: getMostRecentPostPublishedDate() }))) : (react_1.default.createElement(Tags_1.default, { __typename: topper.__typename, isPackage: isPackage, displayConcept: topper.displayConcept ?? undefined, brandConcept: ('brandConcept' in topper && topper.brandConcept) || undefined, genreConcept: ('genreConcept' in topper && topper.genreConcept) || undefined, hasColumnists: hasColumnists, followButtonVariant: topper.followButtonVariant, FollowButtonSlot: followButtonSlot })),
|
|
119
109
|
react_1.default.createElement(Headline_1.default, { headline: topper.headline, showPremiumLabel: showPremiumLabel && content.accessLevel === 'premium', isLargeHeadline: ('isLargeHeadline' in topper && topper.isLargeHeadline) ??
|
|
120
110
|
undefined }),
|
|
121
111
|
topper.intro && (react_1.default.createElement(Intro_1.default, { structured: topper.intro.structured, source: topper.intro.source })),
|
|
@@ -126,13 +116,13 @@ const Topper = ({ content, slot, followButtonSlot, showPremiumLabel = false, rea
|
|
|
126
116
|
description: topper.leadFlourish.description ?? '',
|
|
127
117
|
fallbackImage: topper.leadFlourish.fallbackImage ?? undefined,
|
|
128
118
|
}, iFrame: true, inArticleBody: false })) : (''),
|
|
129
|
-
hasHeadshot &&
|
|
130
|
-
react_1.default.createElement(Headshot_1.default, { headshot: topper.headshot, prefLabel:
|
|
119
|
+
hasHeadshot && hasColumnists && (react_1.default.createElement("div", { className: "o-topper__headshot" },
|
|
120
|
+
react_1.default.createElement(Headshot_1.default, { headshot: topper.headshot, prefLabel: topper.columnists?.[0]?.prefLabel ?? '', className: 'o-topper__headshot-image' }))),
|
|
131
121
|
hasCoverImage && (
|
|
132
122
|
// TODO: Move to its own styles
|
|
133
123
|
react_1.default.createElement("div", { className: "o-topper__headshot" },
|
|
134
124
|
react_1.default.createElement("img", { className: 'o-topper__headshot-image', src: topper.coverImage, role: "presentation", alt: "" }))),
|
|
135
|
-
|
|
125
|
+
hasColumnists && (react_1.default.createElement(Columnists_1.default, { authorConcepts: [...topper.columnists], followButtonVariant: topper.followButtonVariant, followButtonSlot: followButtonSlot }))),
|
|
136
126
|
readNextSlot && (react_1.default.createElement("div", { className: "o-topper__read-next" }, readNextSlot())),
|
|
137
127
|
react_1.default.createElement("div", { className: "o-topper__background" }),
|
|
138
128
|
'images' in topper && !mainImageTopper && (react_1.default.createElement(Picture_1.default, { topper: topper }))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Topper/index.tsx"],"names":[],"mappings":"
|
|
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,8DAAqC;AACrC,4EAAmD;AAEnD,wEAA+C;AAC/C,4DAAmC;AAKnC,mFAA0D;AAU1D,MAAM,mBAAmB,GAGrB;IACF,oBAAoB,EAAE,CAAC,WAAW,EAAE,EAAE,CACpC,gCAAgC,WAAW,6EAA6E;IAC1H,yBAAyB,EAAE,CAAC,WAAW,EAAE,EAAE,CACzC,6CAA6C,WAAW,EAAE;IAC5D,kBAA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,EAAE,IAAI,EACZ,aAAa,EAAE,KAAK,GACpB,CACH,CAAC,CAAC,CAAC,CACF,EAAE,CACH;oBACA,WAAW,IAAI,aAAa,IAAI,CAC/B,uCAAK,SAAS,EAAC,oBAAoB;wBACjC,8BAAC,kBAAQ,IACP,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,SAAS,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,IAAI,EAAE,EAClD,SAAS,EAAE,0BAA0B,GACrC,CACE,CACP;oBACA,aAAa,IAAI;oBAChB,+BAA+B;oBAC/B,uCAAK,SAAS,EAAC,oBAAoB;wBACjC,uCACE,SAAS,EAAE,0BAA0B,EACrC,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,EAAC,cAAc,EACnB,GAAG,EAAC,EAAE,GACN,CACE,CACP;oBACA,aAAa,IAAI,CAChB,8BAAC,oBAAU,IACT,cAAc,EAAE,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,EACtC,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,CAAC,eAAe,IAAI,CACzC,8BAAC,iBAAO,IAAC,MAAM,EAAE,MAAM,GAAI,CAC5B,CACO,CACN,CACG,CACZ,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
package/package.json
CHANGED
|
@@ -15,7 +15,6 @@ type TagsProps = {
|
|
|
15
15
|
hasColumnists?: boolean
|
|
16
16
|
followButtonVariant?: TopperFragment['followButtonVariant']
|
|
17
17
|
FollowButtonSlot?: FollowButtonSlot
|
|
18
|
-
headshot?: string
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
const Tags: React.FC<TagsProps> = ({
|
|
@@ -26,17 +25,13 @@ const Tags: React.FC<TagsProps> = ({
|
|
|
26
25
|
brandConcept,
|
|
27
26
|
hasColumnists,
|
|
28
27
|
followButtonVariant,
|
|
29
|
-
headshot,
|
|
30
28
|
FollowButtonSlot,
|
|
31
29
|
}) => {
|
|
32
30
|
const isOpinion = __typename === 'OpinionTopper'
|
|
33
31
|
const concept = getConcept(displayConcept, genreConcept)
|
|
34
|
-
//
|
|
35
|
-
const baseFollowButtonCondition = FollowButtonSlot && concept?.id
|
|
36
|
-
const additionalFollowButtonCondition =
|
|
37
|
-
(isOpinion && !headshot && !hasColumnists) || !isOpinion
|
|
32
|
+
// only show the follow button if there is a slot, a concept id and it does not have columnists in the topper
|
|
38
33
|
const followButtonCondition =
|
|
39
|
-
|
|
34
|
+
FollowButtonSlot && concept?.id && !hasColumnists
|
|
40
35
|
|
|
41
36
|
return (
|
|
42
37
|
<div className="o-topper__tags">
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// TODO ci-3315: when API updates have gone out for >24hr we can simplify this
|
|
2
|
-
// will be able to remove isOpinion and reduce logic for headshot, which will be null for all except opinion with 1 author
|
|
3
|
-
// oneColumnist etc. won't be necessary any more
|
|
4
|
-
|
|
5
1
|
import React, { Fragment, ReactElement } from 'react'
|
|
6
2
|
import Wrapper from './Wrapper'
|
|
7
3
|
import Tags from './Tags'
|
|
@@ -74,15 +70,6 @@ const Topper: React.FC<TopperProps> = ({
|
|
|
74
70
|
'columnists' in topper &&
|
|
75
71
|
!!topper.columnists &&
|
|
76
72
|
topper.columnists.length > 0
|
|
77
|
-
const legacyHasColumnist =
|
|
78
|
-
'columnist' in topper && topper.columnist && !hasColumnists // @deprecated Replaced with usage of `columinists`
|
|
79
|
-
const hasOneColumnist =
|
|
80
|
-
(hasColumnists && topper.columnists.length === 1) || legacyHasColumnist
|
|
81
|
-
const oneColumnist = hasOneColumnist
|
|
82
|
-
? hasColumnists
|
|
83
|
-
? topper.columnists[0]
|
|
84
|
-
: topper.columnist
|
|
85
|
-
: null
|
|
86
73
|
const sponsorName = 'clientName' in content && content.clientName
|
|
87
74
|
const disclaimerType = isArticle ? content.disclaimerType : undefined
|
|
88
75
|
|
|
@@ -171,7 +158,6 @@ const Topper: React.FC<TopperProps> = ({
|
|
|
171
158
|
genreConcept={
|
|
172
159
|
('genreConcept' in topper && topper.genreConcept) || undefined
|
|
173
160
|
}
|
|
174
|
-
headshot={hasHeadshot || undefined}
|
|
175
161
|
hasColumnists={hasColumnists}
|
|
176
162
|
followButtonVariant={topper.followButtonVariant}
|
|
177
163
|
FollowButtonSlot={followButtonSlot}
|
|
@@ -208,11 +194,11 @@ const Topper: React.FC<TopperProps> = ({
|
|
|
208
194
|
) : (
|
|
209
195
|
''
|
|
210
196
|
)}
|
|
211
|
-
{hasHeadshot &&
|
|
197
|
+
{hasHeadshot && hasColumnists && (
|
|
212
198
|
<div className="o-topper__headshot">
|
|
213
199
|
<Headshot
|
|
214
200
|
headshot={topper.headshot}
|
|
215
|
-
prefLabel={
|
|
201
|
+
prefLabel={topper.columnists?.[0]?.prefLabel ?? ''}
|
|
216
202
|
className={'o-topper__headshot-image'}
|
|
217
203
|
/>
|
|
218
204
|
</div>
|
|
@@ -228,7 +214,7 @@ const Topper: React.FC<TopperProps> = ({
|
|
|
228
214
|
/>
|
|
229
215
|
</div>
|
|
230
216
|
)}
|
|
231
|
-
{
|
|
217
|
+
{hasColumnists && (
|
|
232
218
|
<Columnists
|
|
233
219
|
authorConcepts={[...topper.columnists]}
|
|
234
220
|
followButtonVariant={topper.followButtonVariant}
|