@financial-times/cp-content-pipeline-ui 6.4.6 → 6.6.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 +45 -0
- package/lib/client.d.ts +1 -0
- package/lib/client.js +3 -1
- package/lib/client.js.map +1 -1
- package/lib/components/Clip/client/index.d.ts +1 -0
- package/lib/components/Clip/client/index.js +77 -67
- package/lib/components/Clip/client/index.js.map +1 -1
- package/lib/components/Clip/client/progressBar.d.ts +0 -1
- package/lib/components/Clip/client/progressBar.js +10 -8
- package/lib/components/Clip/client/progressBar.js.map +1 -1
- package/lib/components/Clip/template/component.js +1 -1
- package/lib/components/Clip/template/component.js.map +1 -1
- package/lib/components/Clip/test/snapshot.spec.js +2 -0
- package/lib/components/Clip/test/snapshot.spec.js.map +1 -1
- package/lib/components/Flourish/client/index.d.ts +2 -0
- package/lib/components/Flourish/client/index.js +16 -0
- package/lib/components/Flourish/client/index.js.map +1 -0
- package/lib/components/Flourish/index.d.ts +16 -3
- package/lib/components/Flourish/index.js +21 -4
- package/lib/components/Flourish/index.js.map +1 -1
- package/lib/components/Flourish/test/snapshot.spec.d.ts +1 -0
- package/lib/components/Flourish/test/snapshot.spec.js +57 -0
- package/lib/components/Flourish/test/snapshot.spec.js.map +1 -0
- package/lib/components/Layout/index.d.ts +9 -3
- package/lib/components/Layout/index.js +7 -1
- package/lib/components/Layout/index.js.map +1 -1
- package/lib/components/Topper/index.d.ts +1 -2
- package/lib/components/Topper/index.js +6 -0
- package/lib/components/Topper/index.js.map +1 -1
- package/lib/stories/Topper.stories.d.ts +9 -0
- package/lib/stories/Topper.stories.js +23 -0
- package/lib/stories/Topper.stories.js.map +1 -0
- package/lib/stories/content.d.ts +65 -0
- package/lib/stories/content.js +82 -0
- package/lib/stories/content.js.map +1 -0
- package/package.json +6 -5
- package/src/client.ts +1 -0
- package/src/components/Clip/client/index.ts +86 -70
- package/src/components/Clip/client/progressBar.ts +12 -8
- package/src/components/Clip/template/component.tsx +1 -1
- package/src/components/Clip/test/snapshot.spec.tsx +2 -0
- package/src/components/Flourish/client/index.ts +17 -0
- package/src/components/Flourish/client/main.scss +38 -0
- package/src/components/Flourish/index.tsx +55 -6
- package/src/components/Flourish/test/__snapshots__/snapshot.spec.tsx.snap +310 -0
- package/src/components/Flourish/test/snapshot.spec.tsx +115 -0
- package/src/components/Layout/index.tsx +17 -4
- package/src/components/Topper/client/main.scss +5 -0
- package/src/components/Topper/index.tsx +21 -2
- package/src/stories/Topper.stories.tsx +22 -0
- package/src/stories/content.tsx +78 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -9,20 +9,37 @@ const DisclaimerNotice = ({ id }) => (react_1.default.createElement("div", { id:
|
|
|
9
9
|
react_1.default.createElement("div", { className: "o-message__container" },
|
|
10
10
|
react_1.default.createElement("div", { className: "o-message__content" },
|
|
11
11
|
react_1.default.createElement("p", { className: "o-message__content-main" }, "You are seeing a snapshot of an interactive graphic. This is most likely due to being offline or JavaScript being disabled in your browser.")))));
|
|
12
|
-
function Flourish({ id, flourishType, description, layoutWidth, fallbackImage, }) {
|
|
12
|
+
function Flourish({ id, flourishType, description, layoutWidth, fallbackImage, iFrame = false, inArticleBody = true, }) {
|
|
13
13
|
const anchorHref = `#${id}`;
|
|
14
14
|
const fullGrid = layoutWidth === 'full-grid' || layoutWidth === 'grid';
|
|
15
15
|
const figureClassnames = (0, classnames_1.default)({
|
|
16
16
|
'n-content-picture': true,
|
|
17
17
|
'n-content-layout__container': true,
|
|
18
18
|
'n-content-picture--wide': fullGrid,
|
|
19
|
+
flourish__figure: iFrame,
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
+
const iframeAspectRatio = iFrame && fallbackImage?.width && fallbackImage?.height
|
|
22
|
+
? `${fallbackImage.width}/${fallbackImage.height}`
|
|
23
|
+
: '16/9';
|
|
24
|
+
const imageAspectRatio = !inArticleBody && fallbackImage?.width && fallbackImage?.height
|
|
25
|
+
? {
|
|
26
|
+
width: '100%',
|
|
27
|
+
aspectRatio: `${fallbackImage.width}/${fallbackImage.height}`,
|
|
28
|
+
}
|
|
29
|
+
: {};
|
|
30
|
+
if (!id)
|
|
31
|
+
return null;
|
|
32
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)({
|
|
33
|
+
'n-content-layout': inArticleBody,
|
|
34
|
+
flourish: iFrame,
|
|
35
|
+
'flourish--iFrame': iFrame,
|
|
36
|
+
}), "data-layout-width": fullGrid ? 'full-grid' : null, "data-component": "flourish" },
|
|
37
|
+
iFrame && (react_1.default.createElement("iframe", { src: `https://flo.uri.sh/visualisation/${id}/embed?hideTitle=${!inArticleBody}`, style: { width: '100%', aspectRatio: iframeAspectRatio }, className: "flourish__i-frame" })),
|
|
21
38
|
react_1.default.createElement("figure", { className: figureClassnames, "data-original-image-width": fullGrid ? fallbackImage?.width : null, "data-original-image-height": fullGrid ? fallbackImage?.height : null },
|
|
22
39
|
react_1.default.createElement("a", { href: anchorHref },
|
|
23
|
-
react_1.default.createElement("picture", { "data-asset-type":
|
|
40
|
+
react_1.default.createElement("picture", { "data-asset-type": iFrame ? 'flourish-embed' : 'flourish', "data-flourish-id": id, "data-flourish-type": flourishType },
|
|
24
41
|
react_1.default.createElement(DisclaimerNotice, { id: id }),
|
|
25
|
-
react_1.default.createElement("img", { src: fallbackImage?.url, alt: description }))))));
|
|
42
|
+
react_1.default.createElement("img", { src: fallbackImage?.url || '', alt: description, style: imageAspectRatio }))))));
|
|
26
43
|
}
|
|
27
44
|
exports.default = Flourish;
|
|
28
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Flourish/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,4DAAmC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Flourish/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,4DA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ACpB,kBAAkB,EAAE,aAAa;YACjC,QAAQ,EAAE,MAAM;YAChB,kBAAkB,EAAE,MAAM;SAC3B,CAAC,uBACiB,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,oBACjC,UAAU;QAExB,MAAM,IAAI,CACT,0CACE,GAAG,EAAE,oCAAoC,EAAE,oBAAoB,CAAC,aAAa,EAAE,EAC/E,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,EACxD,SAAS,EAAC,mBAAmB,GACrB,CACX;QACD,0CACE,SAAS,EAAE,gBAAgB,+BACA,QAAQ,CAAC,CAAC,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,gCACrC,QAAQ,CAAC,CAAC,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI;YAEnE,qCAAG,IAAI,EAAE,UAAU;gBACjB,8DAGmB,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,UAAU,sBACrC,EAAE,wBACA,YAAY;oBAEhC,8BAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,GAAI;oBAC5B,uCACE,GAAG,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,EAC7B,GAAG,EAAE,WAAW,EAChB,KAAK,EAAE,gBAAgB,GACvB,CACM,CACR,CACG,CACL,CACP,CAAA;AACH,CAAC;AA1ED,2BA0EC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
const react_2 = require("@testing-library/react");
|
|
8
|
+
const __1 = __importDefault(require("../"));
|
|
9
|
+
var acceptedFormat;
|
|
10
|
+
(function (acceptedFormat) {
|
|
11
|
+
acceptedFormat["standard"] = "standard";
|
|
12
|
+
})(acceptedFormat || (acceptedFormat = {}));
|
|
13
|
+
const anImage = {
|
|
14
|
+
id: '123',
|
|
15
|
+
url: 'https://example.com/image.jpg',
|
|
16
|
+
width: 100,
|
|
17
|
+
height: 150,
|
|
18
|
+
format: 'standard',
|
|
19
|
+
sourceSet: [
|
|
20
|
+
{
|
|
21
|
+
url: 'https://example.com/anotherImage.jpg',
|
|
22
|
+
width: 200,
|
|
23
|
+
dpr: 2,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
describe('Flourish component', () => {
|
|
28
|
+
it('renders with a full-grid layout and fallback image', async () => {
|
|
29
|
+
const { container } = (0, react_2.render)(react_1.default.createElement(__1.default, { type: "flourish", id: "123", flourishType: "bar", description: "foo", layoutWidth: "full-grid", fallbackImage: anImage }));
|
|
30
|
+
expect(container).toMatchSnapshot();
|
|
31
|
+
});
|
|
32
|
+
it('renders ignoring layout different from full-grid', async () => {
|
|
33
|
+
const { container } = (0, react_2.render)(react_1.default.createElement(__1.default, { type: "flourish", id: "123", flourishType: "bar", description: "foo", layoutWidth: "whatever", fallbackImage: anImage }));
|
|
34
|
+
expect(container).toMatchSnapshot();
|
|
35
|
+
});
|
|
36
|
+
it('renders with an iframe rather than using the embed script to insert it', async () => {
|
|
37
|
+
const iFrame = true;
|
|
38
|
+
const { container } = (0, react_2.render)(react_1.default.createElement(__1.default, { type: "flourish", id: "123", flourishType: "bar", description: "foo", layoutWidth: "full-grid", fallbackImage: anImage, iFrame: iFrame }));
|
|
39
|
+
expect(container).toMatchSnapshot();
|
|
40
|
+
});
|
|
41
|
+
it('renders without n-content-layout class for charts not in article body', async () => {
|
|
42
|
+
const inArticleBody = false;
|
|
43
|
+
const { container } = (0, react_2.render)(react_1.default.createElement(__1.default, { type: "flourish", id: "123", flourishType: "bar", description: "foo", layoutWidth: "full-grid", fallbackImage: anImage, inArticleBody: inArticleBody }));
|
|
44
|
+
expect(container).toMatchSnapshot();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
it('sets the hideTitle param in the iframe url to true when not in article body', async () => {
|
|
48
|
+
const inArticleBody = false;
|
|
49
|
+
const iFrame = true;
|
|
50
|
+
const { container } = (0, react_2.render)(react_1.default.createElement(__1.default, { type: "flourish", id: "123", flourishType: "bar", description: "foo", layoutWidth: "full-grid", fallbackImage: anImage, iFrame: iFrame, inArticleBody: inArticleBody }));
|
|
51
|
+
expect(container).toMatchSnapshot();
|
|
52
|
+
});
|
|
53
|
+
it('does not set aspect ratios when in article body', async () => {
|
|
54
|
+
const { container } = (0, react_2.render)(react_1.default.createElement(__1.default, { type: "flourish", id: "123", flourishType: "bar", description: "foo", layoutWidth: "full-grid", fallbackImage: anImage }));
|
|
55
|
+
expect(container).toMatchSnapshot();
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=snapshot.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.spec.js","sourceRoot":"","sources":["../../../../src/components/Flourish/test/snapshot.spec.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,kDAA+C;AAC/C,4CAA0B;AAE1B,IAAK,cAEJ;AAFD,WAAK,cAAc;IACjB,uCAAqB,CAAA;AACvB,CAAC,EAFI,cAAc,KAAd,cAAc,QAElB;AAED,MAAM,OAAO,GAAG;IACd,EAAE,EAAE,KAAK;IACT,GAAG,EAAE,+BAA+B;IACpC,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,UAA4B;IACpC,SAAS,EAAE;QACT;YACE,GAAG,EAAE,sCAAsC;YAC3C,KAAK,EAAE,GAAG;YACV,GAAG,EAAE,CAAC;SACP;KACF;CACF,CAAA;AACD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,oDAAoD,EAAE,KAAK,IAA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ImageSet?, ...ContentTree.Paragraph[]];
|
|
9
9
|
}
|
|
10
|
-
interface
|
|
10
|
+
interface BaseLayoutProps {
|
|
11
|
+
layoutWidth: 'inset-left' | 'full-width' | 'full-grid';
|
|
12
|
+
layoutName?: string;
|
|
13
|
+
}
|
|
14
|
+
interface ContentTreeCardLayout extends BaseLayoutProps, ContentTree.Node {
|
|
11
15
|
type: 'layout';
|
|
12
16
|
layoutName: 'auto' | 'card' | 'timeline';
|
|
13
|
-
layoutWidth: 'inset-left' | 'full-width' | 'full-grid';
|
|
14
17
|
children: ContentTreeLayoutSlot[];
|
|
15
18
|
}
|
|
16
|
-
|
|
19
|
+
interface StaticLayout extends BaseLayoutProps {
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export declare function Layout({ children, layoutWidth, layoutName, }: React.PropsWithChildren<ContentTreeCardLayout | StaticLayout>): React.JSX.Element;
|
|
17
23
|
export declare function LayoutContainer({ children }: LayoutContainerProps): React.JSX.Element;
|
|
18
24
|
export declare function LayoutSlot({ children }: React.PropsWithChildren): React.JSX.Element;
|
|
19
25
|
export {};
|
|
@@ -5,7 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.LayoutSlot = exports.LayoutContainer = exports.Layout = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
|
|
8
|
+
/*
|
|
9
|
+
* @description Layout component is used to define the layout for content. It can be used with ContentTree Layout Nodes or as a static layout.
|
|
10
|
+
* @param layoutWidth - The width of the layout within the containing grid.
|
|
11
|
+
* @param layoutName - The name of the layout.
|
|
12
|
+
* @param children - The content to be displayed in the layout.
|
|
13
|
+
*/
|
|
14
|
+
function Layout({ children, layoutWidth, layoutName = 'auto', }) {
|
|
9
15
|
return (react_1.default.createElement("div", { className: "n-content-layout", "data-layout-name": layoutName, "data-layout-width": layoutWidth },
|
|
10
16
|
react_1.default.createElement(LayoutContainer, null, children)));
|
|
11
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":";;;;;;AACA,kDAAwC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":";;;;;;AACA,kDAAwC;AAyBxC;;;;;GAKG;AACH,SAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,WAAW,EACX,UAAU,GAAG,MAAM,GAC2C;IAC9D,OAAO,CACL,uCACE,SAAS,EAAC,kBAAkB,sBACV,UAAU,uBACT,WAAW;QAE9B,8BAAC,eAAe,QAAE,QAAQ,CAAmB,CACzC,CACP,CAAA;AACH,CAAC;AAdD,wBAcC;AAED,SAAgB,eAAe,CAAC,EAAE,QAAQ,EAAwB;IAChE,OAAO,uCAAK,SAAS,EAAC,6BAA6B,IAAE,QAAQ,CAAO,CAAA;AACtE,CAAC;AAFD,0CAEC;AAED,SAAgB,UAAU,CAAC,EAAE,QAAQ,EAA2B;IAC9D,OAAO,uCAAK,SAAS,EAAC,wBAAwB,IAAE,QAAQ,CAAO,CAAA;AACjE,CAAC;AAFD,gCAEC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
2
|
import { FollowButtonSlot } from './FollowButtonSlot';
|
|
3
3
|
import type { ArticleQuery } from '@financial-times/cp-content-pipeline-client';
|
|
4
|
-
type TopperProps = {
|
|
4
|
+
export type TopperProps = {
|
|
5
5
|
content: ArticleQuery['content'];
|
|
6
6
|
slot?: string;
|
|
7
7
|
followButtonSlot?: FollowButtonSlot;
|
|
@@ -9,4 +9,3 @@ type TopperProps = {
|
|
|
9
9
|
readNextSlot?: () => ReactElement;
|
|
10
10
|
};
|
|
11
11
|
export default function Topper({ content, slot, followButtonSlot, showPremiumLabel, readNextSlot, }: TopperProps): React.JSX.Element | null;
|
|
12
|
-
export {};
|
|
@@ -12,6 +12,8 @@ const Picture_1 = __importDefault(require("./Picture"));
|
|
|
12
12
|
const Headshot_1 = __importDefault(require("../Headshot"));
|
|
13
13
|
const Columnist_1 = __importDefault(require("./Columnist"));
|
|
14
14
|
const LiveBlogIndicator_1 = __importDefault(require("./LiveBlogIndicator"));
|
|
15
|
+
const Flourish_1 = __importDefault(require("../Flourish"));
|
|
16
|
+
const Layout_1 = require("../Layout");
|
|
15
17
|
const classnames_1 = __importDefault(require("classnames"));
|
|
16
18
|
function Topper({ content, slot, followButtonSlot, showPremiumLabel = false, readNextSlot, }) {
|
|
17
19
|
const { topper } = content;
|
|
@@ -23,6 +25,7 @@ function Topper({ content, slot, followButtonSlot, showPremiumLabel = false, rea
|
|
|
23
25
|
const isBasic = topper.__typename === 'BasicTopper';
|
|
24
26
|
const isOpinion = topper.__typename === 'OpinionTopper';
|
|
25
27
|
const isPodcast = topper.__typename === 'PodcastTopper';
|
|
28
|
+
const isFlourish = topper.__typename === 'TopperWithFlourish' && !!topper.leadFlourish;
|
|
26
29
|
const isAudio = content.__typename === 'Audio';
|
|
27
30
|
const hasLayout = 'layout' in topper && topper.layout;
|
|
28
31
|
const hasDesign = 'design' in topper && topper.design;
|
|
@@ -67,6 +70,9 @@ function Topper({ content, slot, followButtonSlot, showPremiumLabel = false, rea
|
|
|
67
70
|
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, headshot: hasHeadshot || undefined, hasColumnist: hasColumnist, followButtonVariant: topper.followButtonVariant, FollowButtonSlot: followButtonSlot })),
|
|
68
71
|
react_1.default.createElement(Headline_1.default, { headline: topper.headline, showPremiumLabel: showPremiumLabel && content.accessLevel === 'premium', isLargeHeadline: ('isLargeHeadline' in topper && topper.isLargeHeadline) ??
|
|
69
72
|
undefined }),
|
|
73
|
+
isLiveBlog && isFlourish ? (react_1.default.createElement(Layout_1.Layout, { layoutWidth: "full-grid" },
|
|
74
|
+
react_1.default.createElement(Layout_1.LayoutContainer, null,
|
|
75
|
+
react_1.default.createElement(Flourish_1.default, { id: topper.leadFlourish.id || '', flourishType: topper.leadFlourish.type || '', description: topper.leadFlourish.description || '', fallbackImage: topper.leadFlourish.fallbackImage || '', iFrame: true, inArticleBody: false })))) : (''),
|
|
70
76
|
topper.intro && (react_1.default.createElement(Intro_1.default, { structured: topper.intro.structured, source: topper.intro.source })),
|
|
71
77
|
hasHeadshot && !isAudio && isOpinion && topper.columnist && (react_1.default.createElement("div", { className: "o-topper__headshot" },
|
|
72
78
|
react_1.default.createElement(Headshot_1.default, { headshot: topper.headshot, prefLabel: topper.columnist.prefLabel, className: 'o-topper__headshot-image', altText: headshotAltText }))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Topper/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA2C;AAC3C,wDAA+B;AAC/B,kDAAyB;AACzB,0DAAiC;AACjC,oDAA2B;AAC3B,wDAA+B;AAC/B,2DAAkC;AAClC,4DAAmC;AACnC,4EAAmD;AAEnD,4DAAmC;AAWnC,SAAwB,MAAM,CAAC,EAC7B,OAAO,EACP,IAAI,EACJ,gBAAgB,EAChB,gBAAgB,GAAG,KAAK,EACxB,YAAY,GACA;IACZ,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAA;IAE1B,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,CAAA;KACZ;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,KAAK,gBAAgB,CAAA;IACzD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,KAAK,iBAAiB,CAAA;IAC3D,MAAM,OAAO,GAAG,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AE,IAAI,EACZ,aAAa,EAAE,KAAK,GACpB,CACc,CACX,CACV,CAAC,CAAC,CAAC,CACF,EAAE,CACH;gBACA,MAAM,CAAC,KAAK,IAAI,CACf,8BAAC,eAAK,IACJ,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU,EACnC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,GAC3B,CACH;gBACA,WAAW,IAAI,CAAC,OAAO,IAAI,SAAS,IAAI,MAAM,CAAC,SAAS,IAAI,CAC3D,uCAAK,SAAS,EAAC,oBAAoB;oBACjC,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;gBACA,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;YACL,YAAY,IAAI,CACf,uCAAK,SAAS,EAAC,qBAAqB,IAAE,YAAY,EAAE,CAAO,CAC5D;YACD,uCAAK,SAAS,EAAC,sBAAsB,GAAG;YACvC,QAAQ,IAAI,MAAM,IAAI,8BAAC,iBAAO,IAAC,MAAM,EAAE,MAAM,GAAI,CAC1C,CACN,CACP,CAAA;AACH,CAAC;AArKD,yBAqKC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
exports.Default = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const Topper_1 = __importDefault(require("../components/Topper"));
|
|
9
|
+
const content_1 = require("./content");
|
|
10
|
+
const args = {
|
|
11
|
+
content: content_1.content
|
|
12
|
+
};
|
|
13
|
+
exports.default = {
|
|
14
|
+
title: 'Topper',
|
|
15
|
+
component: Topper_1.default,
|
|
16
|
+
content: {}
|
|
17
|
+
};
|
|
18
|
+
const Default = () => {
|
|
19
|
+
return (react_1.default.createElement("div", { className: "story-container" },
|
|
20
|
+
react_1.default.createElement(Topper_1.default, { ...args })));
|
|
21
|
+
};
|
|
22
|
+
exports.Default = Default;
|
|
23
|
+
//# sourceMappingURL=Topper.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Topper.stories.js","sourceRoot":"","sources":["../../src/stories/Topper.stories.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,kEAA2D;AAC3D,uCAAoC;AAGpC,MAAM,IAAI,GAAgB;IACtB,OAAO,EAAE,iBAA6C;CACzD,CAAA;AAED,kBAAe;IACX,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,gBAAM;IACjB,OAAO,EAAE,EAAE;CACd,CAAA;AAEM,MAAM,OAAO,GAAG,GAAG,EAAE;IACxB,OAAO,CACH,uCAAK,SAAS,EAAC,iBAAiB;QAC5B,8BAAC,gBAAM,OAAK,IAAI,GAAI,CAClB,CACT,CAAA;AACL,CAAC,CAAA;AANY,QAAA,OAAO,WAMnB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export declare const content: {
|
|
2
|
+
__typename: string;
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
publishedDate: string;
|
|
6
|
+
firstPublishedDate: string;
|
|
7
|
+
standfirst: null;
|
|
8
|
+
topper: {
|
|
9
|
+
__typename: string;
|
|
10
|
+
layout: string;
|
|
11
|
+
layoutWidth: string;
|
|
12
|
+
headline: string;
|
|
13
|
+
backgroundColour: string;
|
|
14
|
+
backgroundBox: null;
|
|
15
|
+
textShadow: null;
|
|
16
|
+
followButtonVariant: string;
|
|
17
|
+
intro: {
|
|
18
|
+
source: string;
|
|
19
|
+
structured: {
|
|
20
|
+
tree: {
|
|
21
|
+
type: string;
|
|
22
|
+
version: number;
|
|
23
|
+
children: {
|
|
24
|
+
type: string;
|
|
25
|
+
value: string;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
displayConcept: {
|
|
31
|
+
id: string;
|
|
32
|
+
prefLabel: string;
|
|
33
|
+
types: string[];
|
|
34
|
+
type: string;
|
|
35
|
+
directType: string;
|
|
36
|
+
isPackageBrand: boolean;
|
|
37
|
+
predicate: string;
|
|
38
|
+
url: string;
|
|
39
|
+
relativeUrl: string;
|
|
40
|
+
};
|
|
41
|
+
genreConcept: {
|
|
42
|
+
id: string;
|
|
43
|
+
prefLabel: string;
|
|
44
|
+
types: string[];
|
|
45
|
+
type: string;
|
|
46
|
+
directType: string;
|
|
47
|
+
isPackageBrand: boolean;
|
|
48
|
+
predicate: string;
|
|
49
|
+
url: string;
|
|
50
|
+
relativeUrl: string;
|
|
51
|
+
};
|
|
52
|
+
leadFlourish: {
|
|
53
|
+
type: string;
|
|
54
|
+
id: string;
|
|
55
|
+
description: string;
|
|
56
|
+
fallbackImage: {
|
|
57
|
+
url: string;
|
|
58
|
+
type: string;
|
|
59
|
+
format: string;
|
|
60
|
+
width: number;
|
|
61
|
+
height: number;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.content = void 0;
|
|
4
|
+
exports.content = {
|
|
5
|
+
__typename: 'LiveBlogPackage',
|
|
6
|
+
id: 'f9d0da8a-ac43-4f0d-8af5-d597d1f13bb8',
|
|
7
|
+
title: 'News updates from February 2: US adds 353,000 jobs in January, US hits Iraq and Syria after drone deaths',
|
|
8
|
+
publishedDate: '2024-02-05T12:00:44.399Z',
|
|
9
|
+
firstPublishedDate: '2024-02-05T12:00:44.399Z',
|
|
10
|
+
standfirst: null,
|
|
11
|
+
topper: {
|
|
12
|
+
__typename: 'TopperWithFlourish',
|
|
13
|
+
layout: 'flourish',
|
|
14
|
+
layoutWidth: 'full-width',
|
|
15
|
+
headline: 'News updates from February 2: US adds 353,000 jobs in January, US hits Iraq and Syria after drone deaths',
|
|
16
|
+
backgroundColour: 'paper',
|
|
17
|
+
backgroundBox: null,
|
|
18
|
+
textShadow: null,
|
|
19
|
+
followButtonVariant: 'standard',
|
|
20
|
+
intro: {
|
|
21
|
+
source: 'standfirst',
|
|
22
|
+
structured: {
|
|
23
|
+
tree: {
|
|
24
|
+
type: 'body',
|
|
25
|
+
version: 1,
|
|
26
|
+
children: [
|
|
27
|
+
{
|
|
28
|
+
type: 'text',
|
|
29
|
+
value: 'Media sector scrambles to deal with fallout from phase out of cross-website trackers '
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
displayConcept: {
|
|
36
|
+
id: '84cf4073-a674-4a93-aef9-dcc1832a65cb',
|
|
37
|
+
prefLabel: 'Amazon.com',
|
|
38
|
+
types: [
|
|
39
|
+
'http://www.ft.com/ontology/core/Thing',
|
|
40
|
+
'http://www.ft.com/ontology/concept/Concept',
|
|
41
|
+
'http://www.ft.com/ontology/organisation/Organisation',
|
|
42
|
+
'http://www.ft.com/ontology/company/Company',
|
|
43
|
+
'http://www.ft.com/ontology/company/PublicCompany'
|
|
44
|
+
],
|
|
45
|
+
type: 'ORGANISATION',
|
|
46
|
+
directType: 'http://www.ft.com/ontology/company/PublicCompany',
|
|
47
|
+
isPackageBrand: false,
|
|
48
|
+
predicate: 'http://www.ft.com/ontology/hasDisplayTag',
|
|
49
|
+
url: 'https://www.ft.com/stream/84cf4073-a674-4a93-aef9-dcc1832a65cb',
|
|
50
|
+
relativeUrl: '/stream/84cf4073-a674-4a93-aef9-dcc1832a65cb'
|
|
51
|
+
},
|
|
52
|
+
genreConcept: {
|
|
53
|
+
id: 'a579350c-61ce-4c00-97ca-ddaa2e0cacf6',
|
|
54
|
+
prefLabel: 'News',
|
|
55
|
+
types: [
|
|
56
|
+
'http://www.ft.com/ontology/core/Thing',
|
|
57
|
+
'http://www.ft.com/ontology/concept/Concept',
|
|
58
|
+
'http://www.ft.com/ontology/classification/Classification',
|
|
59
|
+
'http://www.ft.com/ontology/Genre'
|
|
60
|
+
],
|
|
61
|
+
type: 'GENRE',
|
|
62
|
+
directType: 'http://www.ft.com/ontology/Genre',
|
|
63
|
+
isPackageBrand: false,
|
|
64
|
+
predicate: 'http://www.ft.com/ontology/classification/isClassifiedBy',
|
|
65
|
+
url: 'https://www.ft.com/stream/a579350c-61ce-4c00-97ca-ddaa2e0cacf6',
|
|
66
|
+
relativeUrl: '/stream/a579350c-61ce-4c00-97ca-ddaa2e0cacf6'
|
|
67
|
+
},
|
|
68
|
+
leadFlourish: {
|
|
69
|
+
type: 'visualisation',
|
|
70
|
+
id: '15700475',
|
|
71
|
+
description: 'EU Airlines',
|
|
72
|
+
fallbackImage: {
|
|
73
|
+
url: 'https://www.ft.com/__origami/service/image/v2/images/raw/https%3A%2F%2Fpublic.flourish.studio%2Fvisualisation%2F15700475%2Fthumbnail?source=cp-content-pipeline&fit=scale-down&quality=highest&width=1020&dpr=1',
|
|
74
|
+
type: 'visualisation',
|
|
75
|
+
format: 'standard',
|
|
76
|
+
width: 1020,
|
|
77
|
+
height: 892
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/stories/content.tsx"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG;IACnB,UAAU,EAAE,iBAAiB;IAC7B,EAAE,EAAE,sCAAsC;IA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ACV,IAAI,EAAE,eAAe;YACrB,EAAE,EAAE,UAAU;YACd,WAAW,EAAE,aAAa;YAC1B,aAAa,EAAE;gBACb,GAAG,EAAE,iNAAiN;gBACtN,IAAI,EAAE,eAAe;gBACrB,MAAM,EAAE,UAAU;gBAClB,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE,GAAG;aACZ;SACF;KACN;CACJ,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/cp-content-pipeline-ui",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"@babel/preset-react": "^7.22.5",
|
|
18
18
|
"@dotcom-tool-kit/npm": "^3.1.4",
|
|
19
19
|
"@financial-times/content-tree": "github:financial-times/content-tree#14370e3",
|
|
20
|
-
"@financial-times/cp-content-pipeline-client": "^3.7.
|
|
21
|
-
"@financial-times/cp-content-pipeline-schema": "^2.
|
|
22
|
-
"@financial-times/cp-content-pipeline-styles": "^2.4.
|
|
20
|
+
"@financial-times/cp-content-pipeline-client": "^3.7.1",
|
|
21
|
+
"@financial-times/cp-content-pipeline-schema": "^2.10.0",
|
|
22
|
+
"@financial-times/cp-content-pipeline-styles": "^2.4.3",
|
|
23
23
|
"@financial-times/n-scrollytelling-image": "^1.1.0",
|
|
24
24
|
"@financial-times/o-colors": "^6.6.2",
|
|
25
25
|
"@financial-times/o-grid": "^6.1.5",
|
|
@@ -38,10 +38,11 @@
|
|
|
38
38
|
"@storybook/react-webpack5": "^7.0.24",
|
|
39
39
|
"@storybook/testing-library": "^0.2.0",
|
|
40
40
|
"@sucrase/jest-plugin": "^3.0.0",
|
|
41
|
-
"@testing-library/react": "^13.
|
|
41
|
+
"@testing-library/react": "^13.4.0",
|
|
42
42
|
"@testing-library/user-event": "^14.4.3",
|
|
43
43
|
"@types/financial-times__n-scrollytelling-image": "0.0.0",
|
|
44
44
|
"@types/react": "^18.0.15",
|
|
45
|
+
"@types/react-test-renderer": "^18.3.0",
|
|
45
46
|
"eslint-plugin-react": "^7.30.1",
|
|
46
47
|
"jest-environment-jsdom": "^29.6.1",
|
|
47
48
|
"n-ui-foundations": "^9.1.0",
|
package/src/client.ts
CHANGED