@financial-times/cp-content-pipeline-ui 6.15.6 → 7.0.1
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 +22 -0
- package/lib/components/BigNumber/index.d.ts +4 -1
- package/lib/components/BigNumber/index.js +1 -1
- package/lib/components/BigNumber/index.js.map +1 -1
- package/lib/components/Body/index.test.js +12 -1
- package/lib/components/Body/index.test.js.map +1 -1
- package/lib/components/Byline/index.js +2 -2
- package/lib/components/Byline/index.js.map +1 -1
- package/lib/components/Clip/components/ClipTag.d.ts +3 -3
- package/lib/components/Clip/components/ClipTag.js.map +1 -1
- package/lib/components/Clip/components/ClosedCaptions.d.ts +2 -2
- package/lib/components/Clip/components/VideoDescription.d.ts +2 -2
- package/lib/components/Clip/components/VideoDescription.js.map +1 -1
- package/lib/components/Clip/template/component.d.ts +9 -4
- package/lib/components/Clip/template/component.js +19 -14
- package/lib/components/Clip/template/component.js.map +1 -1
- package/lib/components/Clip/test/fixtures.js +114 -77
- package/lib/components/Clip/test/fixtures.js.map +1 -1
- package/lib/components/Clip/test/snapshot.spec.js +110 -61
- package/lib/components/Clip/test/snapshot.spec.js.map +1 -1
- package/lib/components/Flourish/index.d.ts +4 -12
- package/lib/components/Flourish/index.js +1 -1
- package/lib/components/Flourish/index.js.map +1 -1
- package/lib/components/Flourish/test/snapshot.spec.js +48 -6
- package/lib/components/Flourish/test/snapshot.spec.js.map +1 -1
- package/lib/components/Heading/index.d.ts +2 -1
- package/lib/components/Heading/index.js +2 -2
- package/lib/components/Heading/index.js.map +1 -1
- package/lib/components/ImageOverrideWrappers/index.d.ts +4 -0
- package/lib/components/ImageOverrideWrappers/index.js +44 -0
- package/lib/components/ImageOverrideWrappers/index.js.map +1 -0
- package/lib/components/ImageSet/index.d.ts +12 -8
- package/lib/components/ImageSet/index.js +13 -8
- package/lib/components/ImageSet/index.js.map +1 -1
- package/lib/components/Layout/index.d.ts +3 -13
- package/lib/components/Layout/index.js +1 -1
- package/lib/components/Layout/index.js.map +1 -1
- package/lib/components/MainImage/index.js +2 -2
- package/lib/components/MainImage/index.js.map +1 -1
- package/lib/components/Paragraph/index.d.ts +4 -1
- package/lib/components/Paragraph/index.js.map +1 -1
- package/lib/components/Pullquote/index.d.ts +4 -1
- package/lib/components/Pullquote/index.js +7 -6
- package/lib/components/Pullquote/index.js.map +1 -1
- package/lib/components/Recommended/index.d.ts +5 -8
- package/lib/components/Recommended/index.js +1 -6
- package/lib/components/Recommended/index.js.map +1 -1
- package/lib/components/RichText/BasicComponents.d.ts +12 -11
- package/lib/components/RichText/BasicComponents.js +2 -2
- package/lib/components/RichText/BasicComponents.js.map +1 -1
- package/lib/components/RichText/index.d.ts +10 -3
- package/lib/components/RichText/index.js +8 -2
- package/lib/components/RichText/index.js.map +1 -1
- package/lib/components/Scrollytelling/ScrollyImage.d.ts +6 -3
- package/lib/components/Scrollytelling/ScrollyImage.js +2 -2
- package/lib/components/Scrollytelling/ScrollyImage.js.map +1 -1
- package/lib/components/Scrollytelling/index.d.ts +14 -6
- package/lib/components/Scrollytelling/index.js +3 -3
- package/lib/components/Scrollytelling/index.js.map +1 -1
- package/lib/components/Table/TableBody.d.ts +4 -1
- package/lib/components/Table/TableBody.js +1 -1
- package/lib/components/Table/TableBody.js.map +1 -1
- package/lib/components/Table/TableCell.d.ts +4 -4
- package/lib/components/Table/TableCell.js +2 -2
- package/lib/components/Table/TableCell.js.map +1 -1
- package/lib/components/Table/index.d.ts +4 -1
- package/lib/components/Table/index.js +1 -1
- package/lib/components/Table/index.js.map +1 -1
- package/lib/components/Topper/Picture.d.ts +1 -1
- package/lib/components/Topper/Picture.js +6 -3
- package/lib/components/Topper/Picture.js.map +1 -1
- package/lib/components/Topper/index.js +7 -1
- package/lib/components/Topper/index.js.map +1 -1
- package/lib/components/Tweet/index.d.ts +5 -3
- package/lib/components/Tweet/index.js +1 -1
- package/lib/components/Tweet/index.js.map +1 -1
- package/lib/components/Video/index.d.ts +4 -2
- package/lib/components/Video/index.js +1 -1
- package/lib/components/Video/index.js.map +1 -1
- package/lib/components/Workarounds.d.ts +89 -0
- package/lib/components/Workarounds.js +3 -0
- package/lib/components/Workarounds.js.map +1 -0
- package/lib/components/YoutubeVideo/index.d.ts +5 -2
- package/lib/components/YoutubeVideo/index.js +1 -1
- package/lib/components/YoutubeVideo/index.js.map +1 -1
- package/lib/components/types.d.ts +5 -0
- package/lib/components/types.js +3 -0
- package/lib/components/types.js.map +1 -0
- package/lib/context.d.ts +14 -0
- package/lib/context.js +2 -1
- package/lib/context.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/stories/Clip.stories.d.ts +39 -243
- package/lib/stories/Clip.stories.js +320 -307
- package/lib/stories/Clip.stories.js.map +1 -1
- package/package.json +2 -1
- package/src/components/BigNumber/index.tsx +6 -3
- package/src/components/Body/__snapshots__/index.test.tsx.snap +2 -1
- package/src/components/Body/index.test.tsx +12 -1
- package/src/components/Byline/index.tsx +9 -4
- package/src/components/Clip/components/ClipTag.tsx +3 -6
- package/src/components/Clip/components/ClosedCaptions.tsx +2 -2
- package/src/components/Clip/components/VideoDescription.tsx +2 -2
- package/src/components/Clip/template/component.tsx +39 -41
- package/src/components/Clip/test/__snapshots__/snapshot.spec.tsx.snap +4 -8
- package/src/components/Clip/test/fixtures.ts +127 -90
- package/src/components/Clip/test/snapshot.spec.tsx +123 -102
- package/src/components/Flourish/index.tsx +10 -21
- package/src/components/Flourish/test/snapshot.spec.tsx +48 -36
- package/src/components/Heading/index.tsx +6 -5
- package/src/components/ImageOverrideWrappers/index.tsx +34 -0
- package/src/components/ImageSet/index.tsx +75 -55
- package/src/components/Layout/index.tsx +6 -18
- package/src/components/MainImage/index.tsx +10 -8
- package/src/components/Paragraph/index.tsx +4 -1
- package/src/components/Pullquote/index.tsx +15 -8
- package/src/components/Recommended/index.tsx +11 -11
- package/src/components/RichText/BasicComponents.tsx +22 -20
- package/src/components/RichText/index.tsx +35 -12
- package/src/components/Scrollytelling/ScrollyImage.tsx +10 -7
- package/src/components/Scrollytelling/index.tsx +19 -9
- package/src/components/Table/TableBody.tsx +7 -3
- package/src/components/Table/TableCell.tsx +9 -7
- package/src/components/Table/index.tsx +12 -9
- package/src/components/Topper/Picture.tsx +17 -12
- package/src/components/Topper/index.tsx +7 -4
- package/src/components/Tweet/index.tsx +5 -3
- package/src/components/Video/index.tsx +4 -6
- package/src/components/Workarounds.ts +190 -0
- package/src/components/YoutubeVideo/index.tsx +5 -4
- package/src/components/types.ts +6 -0
- package/src/context.ts +22 -1
- package/src/index.ts +4 -1
- package/src/stories/Clip.stories.tsx +357 -341
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import { ContentTree } from '@financial-times/content-tree';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
children: [ContentTree.ImageSet?, ...ContentTree.Paragraph[]];
|
|
3
|
+
import { ContentProps } from '../types';
|
|
4
|
+
interface LayoutProps extends ContentProps<ContentTree.transit.Layout> {
|
|
6
5
|
}
|
|
7
|
-
|
|
8
|
-
layoutWidth: 'inset-left' | 'full-width' | 'full-grid' | 'in-line';
|
|
9
|
-
layoutName?: string;
|
|
10
|
-
}
|
|
11
|
-
interface ContentTreeCardLayout extends BaseLayoutProps, ContentTree.Node {
|
|
12
|
-
type: 'layout';
|
|
13
|
-
layoutName: 'auto' | 'card' | 'timeline';
|
|
14
|
-
children: ContentTreeLayoutSlot[];
|
|
15
|
-
}
|
|
16
|
-
export declare const Layout: React.FC<React.PropsWithChildren<ContentTreeCardLayout | BaseLayoutProps>>;
|
|
6
|
+
export declare const Layout: React.FC<React.PropsWithChildren<LayoutProps>>;
|
|
17
7
|
export declare const LayoutContainer: React.FC<React.PropsWithChildren>;
|
|
18
8
|
export declare const LayoutSlot: React.FC<React.PropsWithChildren>;
|
|
19
9
|
export {};
|
|
@@ -11,7 +11,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
11
11
|
* @param layoutName - The name of the layout.
|
|
12
12
|
* @param children - The content to be displayed in the layout.
|
|
13
13
|
*/
|
|
14
|
-
const Layout = ({
|
|
14
|
+
const Layout = ({ content: { layoutWidth, layoutName = 'auto' }, children, }) => {
|
|
15
15
|
return (react_1.default.createElement("div", { className: "n-content-layout", "data-layout-name": layoutName, "data-layout-width": layoutWidth },
|
|
16
16
|
react_1.default.createElement(exports.LayoutContainer, null, children)));
|
|
17
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":";;;;;;AACA,kDAAyB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":";;;;;;AACA,kDAAyB;AAKzB;;;;;GAKG;AACI,MAAM,MAAM,GAAmD,CAAC,EACrE,OAAO,EAAE,EAAE,WAAW,EAAE,UAAU,GAAG,MAAM,EAAE,EAC7C,QAAQ,GACT,EAAE,EAAE;IACH,OAAO,CACL,uCACE,SAAS,EAAC,kBAAkB,sBACV,UAAU,uBACT,WAAW;QAE9B,8BAAC,uBAAe,QAAE,QAAQ,CAAmB,CACzC,CACP,CAAA;AACH,CAAC,CAAA;AAbY,QAAA,MAAM,UAalB;AAEM,MAAM,eAAe,GAAsC,CAAC,EACjE,QAAQ,GACT,EAAE,EAAE;IACH,OAAO,uCAAK,SAAS,EAAC,6BAA6B,IAAE,QAAQ,CAAO,CAAA;AACtE,CAAC,CAAA;AAJY,QAAA,eAAe,mBAI3B;AAEM,MAAM,UAAU,GAAsC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC5E,OAAO,uCAAK,SAAS,EAAC,wBAAwB,IAAE,QAAQ,CAAO,CAAA;AACjE,CAAC,CAAA;AAFY,QAAA,UAAU,cAEtB"}
|
|
@@ -37,11 +37,11 @@ const MainImage = ({ content }) => {
|
|
|
37
37
|
*/
|
|
38
38
|
const mainImage = references?.find((ref) => ref.type === 'main-image');
|
|
39
39
|
if (mainImage) {
|
|
40
|
-
return react_1.default.createElement(index_1.default, { isMainImage: true,
|
|
40
|
+
return react_1.default.createElement(index_1.default, { isMainImage: true, content: mainImage });
|
|
41
41
|
}
|
|
42
42
|
const mainImageRaw = references?.find((ref) => ref.type === 'main-image-raw');
|
|
43
43
|
if (mainImageRaw) {
|
|
44
|
-
return react_1.default.createElement(index_1.FallbackImage, { isMainImage: true,
|
|
44
|
+
return react_1.default.createElement(index_1.FallbackImage, { isMainImage: true, content: mainImageRaw });
|
|
45
45
|
}
|
|
46
46
|
return null;
|
|
47
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MainImage/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAyB;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/MainImage/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAyB;AAKzB,2DAA2D;AAO3D,MAAM,SAAS,GAA6B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IAC1D,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,UAAU,CAAA;IAEtD;;;;MAIE;IAEF,MAAM,SAAS,GAAG,UAAU,EAAE,IAAI,CAChC,CAAC,GAAG,EAAmD,EAAE,CACvD,GAAG,CAAC,IAAI,KAAK,YAAY,CAC5B,CAAA;IAED,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,8BAAC,eAAQ,IAAC,WAAW,QAAC,OAAO,EAAE,SAAS,GAAI,CAAA;IACrD,CAAC;IAED,MAAM,YAAY,GAAG,UAAU,EAAE,IAAI,CACnC,CAAC,GAAG,EAA4C,EAAE,CAChD,GAAG,CAAC,IAAI,KAAK,gBAAgB,CAChC,CAAA;IAED,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,8BAAC,qBAAa,IAAC,WAAW,QAAC,OAAO,EAAE,YAAY,GAAI,CAAA;IAC7D,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,kBAAe,SAAS,CAAA"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { ContentTree } from '@financial-times/content-tree';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { ContentProps } from '../types';
|
|
3
4
|
export declare const ParagraphContext: React.Context<{
|
|
4
5
|
className: string;
|
|
5
6
|
} | null>;
|
|
6
|
-
|
|
7
|
+
interface ParagraphProps extends ContentProps<ContentTree.Paragraph> {
|
|
8
|
+
}
|
|
9
|
+
declare const Paragraph: React.FC<React.PropsWithChildren<ParagraphProps>>;
|
|
7
10
|
export default Paragraph;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Paragraph/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAwD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Paragraph/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAwD;AAG3C,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAC3C,IAAI,CACL,CAAA;AAID,MAAM,SAAS,GAAsD,CACnE,KAAK,EACL,EAAE;IACF,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,kBAAU,EAAC,wBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA;IAE9E,OAAO,qCAAS,SAAS,IAAK,KAAK,CAAC,QAAQ,CAAK,CAAA;AACnD,CAAC,CAAA;AAED,kBAAe,SAAS,CAAA"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema';
|
|
3
|
-
|
|
3
|
+
import { ContentProps } from '../types';
|
|
4
|
+
interface PullquoteProps extends ContentProps<ContentTreeWorkarounds.Pullquote> {
|
|
5
|
+
}
|
|
6
|
+
declare const Pullquote: React.FC<React.PropsWithChildren<PullquoteProps>>;
|
|
4
7
|
export default Pullquote;
|
|
@@ -5,15 +5,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const classnames_1 = __importDefault(require("classnames"));
|
|
8
|
-
const Pullquote = (
|
|
8
|
+
const Pullquote = ({ content: { text, source }, children, }) => {
|
|
9
|
+
const hasChildren = react_1.default.Children.count(children) > 0;
|
|
9
10
|
return (react_1.default.createElement("blockquote", { className: (0, classnames_1.default)('n-content-pullquote', {
|
|
10
|
-
'n-content-pullquote--with-image':
|
|
11
|
-
'n-content-pullquote--no-image': !
|
|
11
|
+
'n-content-pullquote--with-image': hasChildren,
|
|
12
|
+
'n-content-pullquote--no-image': !hasChildren,
|
|
12
13
|
}), "aria-hidden": "true" },
|
|
13
14
|
react_1.default.createElement("div", { className: "n-content-pullquote__content" },
|
|
14
|
-
react_1.default.createElement("p", null,
|
|
15
|
-
react_1.default.createElement("footer", { className: "n-content-pullquote__footer" },
|
|
16
|
-
|
|
15
|
+
react_1.default.createElement("p", null, text),
|
|
16
|
+
react_1.default.createElement("footer", { className: "n-content-pullquote__footer" }, source)),
|
|
17
|
+
children));
|
|
17
18
|
};
|
|
18
19
|
exports.default = Pullquote;
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Pullquote/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,4DAAmC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Pullquote/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,4DAAmC;AAMnC,MAAM,SAAS,GAAsD,CAAC,EACpE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EACzB,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,WAAW,GAAG,eAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IAEtD,OAAO,CACL,8CACE,SAAS,EAAE,IAAA,oBAAU,EAAC,qBAAqB,EAAE;YAC3C,iCAAiC,EAAE,WAAW;YAC9C,+BAA+B,EAAE,CAAC,WAAW;SAC9C,CAAC,iBACU,MAAM;QAElB,uCAAK,SAAS,EAAC,8BAA8B;YAC3C,yCAAI,IAAI,CAAK;YACb,0CAAQ,SAAS,EAAC,6BAA6B,IAAE,MAAM,CAAU,CAC7D;QAEL,QAAQ,CACE,CACd,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,SAAS,CAAA"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* https://github.com/Financial-Times/x-dash/tree/main/components/x-teaser)
|
|
8
|
-
*/
|
|
9
|
-
declare const Recommended: React.FC<ContentTree.Recommended & RecommendedFragment>;
|
|
2
|
+
import { ContentProps } from '../types';
|
|
3
|
+
import type * as ComponentWorkarounds from '../Workarounds';
|
|
4
|
+
interface RecommendedProps extends ContentProps<ComponentWorkarounds.Recommended> {
|
|
5
|
+
}
|
|
6
|
+
declare const Recommended: React.FC<RecommendedProps>;
|
|
10
7
|
export default Recommended;
|
|
@@ -7,12 +7,7 @@ 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 Teaser_cjs_1 = require("@financial-times/x-teaser/dist/Teaser.cjs");
|
|
9
9
|
const classnames_1 = __importDefault(require("classnames"));
|
|
10
|
-
|
|
11
|
-
* Renders a Recommended teaser component
|
|
12
|
-
* `<Teaser>` is imported from x-dash
|
|
13
|
-
* https://github.com/Financial-Times/x-dash/tree/main/components/x-teaser)
|
|
14
|
-
*/
|
|
15
|
-
const Recommended = ({ heading, teaser, isInLiveBlog, }) => {
|
|
10
|
+
const Recommended = ({ content: { heading, teaser, isInLiveBlog }, }) => {
|
|
16
11
|
if (!teaser) {
|
|
17
12
|
return null;
|
|
18
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Recommended/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,6EAA6E;AAC7E,0EAA2E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Recommended/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,6EAA6E;AAC7E,0EAA2E;AAC3E,4DAAmC;AAWnC,MAAM,WAAW,GAA+B,CAAC,EAC/C,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,GAC3C,EAAE,EAAE;IACH,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,CACL,4DACkB,aAAa,EAC7B,SAAS,EAAE,IAAA,oBAAU,EAAC,qCAAqC,EAAE;YAC3D,8BAA8B,EAAE,CAAC,YAAY;SAC9C,CAAC,oBACa,aAAa;QAE3B,CAAC,YAAY,IAAI,CAChB,qCAAG,SAAS,EAAC,8BAA8B,IAAE,OAAO,CAAK,CAC1D;QACD,8BAAC,mBAAM,IACL,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAC5C,oBAAO,CAAC,UAAU,KAClB,MAAM,GACV,CACI,CACT,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ContentTree } from '@financial-times/content-tree';
|
|
3
3
|
import type { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema';
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
4
|
+
import { ContentProps } from '../types';
|
|
5
|
+
export declare const List: React.FC<React.PropsWithChildren<ContentProps<ContentTree.List>>>;
|
|
6
|
+
export declare const ListItem: React.FC<React.PropsWithChildren<ContentProps<ContentTree.ListItem>>>;
|
|
7
|
+
export declare const Link: React.FC<React.PropsWithChildren<ContentProps<ContentTree.Link>>>;
|
|
8
|
+
export declare const Blockquote: React.FC<React.PropsWithChildren<ContentProps<ContentTree.Blockquote>>>;
|
|
9
|
+
export declare const Cite: React.FC<React.PropsWithChildren<ContentProps<ContentTreeWorkarounds.Cite>>>;
|
|
9
10
|
export declare const LineBreak: React.FC;
|
|
10
11
|
export declare const HorizontalRule: React.FC;
|
|
11
|
-
export declare const Emphasis: React.FC<React.PropsWithChildren<ContentTree.Emphasis
|
|
12
|
-
export declare const Strong: React.FC<React.PropsWithChildren<ContentTree.Strong
|
|
13
|
-
export declare const Strikethrough: React.FC<React.PropsWithChildren<ContentTree.Strikethrough
|
|
14
|
-
export declare const TableRow: React.FC<React.PropsWithChildren<ContentTreeWorkarounds.TableRow
|
|
15
|
-
export declare const TableFooter: React.FC<React.PropsWithChildren<ContentTreeWorkarounds.TableFooter
|
|
16
|
-
export declare const TableCaption: React.FC<React.PropsWithChildren<ContentTreeWorkarounds.TableCaption
|
|
12
|
+
export declare const Emphasis: React.FC<React.PropsWithChildren<ContentProps<ContentTree.Emphasis>>>;
|
|
13
|
+
export declare const Strong: React.FC<React.PropsWithChildren<ContentProps<ContentTree.Strong>>>;
|
|
14
|
+
export declare const Strikethrough: React.FC<React.PropsWithChildren<ContentProps<ContentTree.Strikethrough>>>;
|
|
15
|
+
export declare const TableRow: React.FC<React.PropsWithChildren<ContentProps<ContentTreeWorkarounds.TableRow>>>;
|
|
16
|
+
export declare const TableFooter: React.FC<React.PropsWithChildren<ContentProps<ContentTreeWorkarounds.TableFooter>>>;
|
|
17
|
+
export declare const TableCaption: React.FC<React.PropsWithChildren<ContentProps<ContentTreeWorkarounds.TableCaption>>>;
|
|
@@ -5,11 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.TableCaption = exports.TableFooter = exports.TableRow = exports.Strikethrough = exports.Strong = exports.Emphasis = exports.HorizontalRule = exports.LineBreak = exports.Cite = exports.Blockquote = exports.Link = exports.ListItem = exports.List = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const List = (props) =>
|
|
8
|
+
const List = (props) => props.content.ordered ? react_1.default.createElement("ol", null, props.children) : react_1.default.createElement("ul", null, props.children);
|
|
9
9
|
exports.List = List;
|
|
10
10
|
const ListItem = (props) => react_1.default.createElement("li", null, props.children);
|
|
11
11
|
exports.ListItem = ListItem;
|
|
12
|
-
const Link = (props) => (react_1.default.createElement("a", { href: props.url, title: props.title }, props.children));
|
|
12
|
+
const Link = (props) => (react_1.default.createElement("a", { href: props.content.url, title: props.content.title }, props.children));
|
|
13
13
|
exports.Link = Link;
|
|
14
14
|
const Blockquote = (props) => {
|
|
15
15
|
return (react_1.default.createElement("blockquote", { className: "n-content-blockquote" }, props.children));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasicComponents.js","sourceRoot":"","sources":["../../../src/components/RichText/BasicComponents.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;
|
|
1
|
+
{"version":3,"file":"BasicComponents.js","sourceRoot":"","sources":["../../../src/components/RichText/BasicComponents.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAKlB,MAAM,IAAI,GAEb,CAAC,KAAK,EAA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nC,QAAA,MAAM,UAE6B;AAEzC,MAAM,aAAa,GAEtB,CAAC,KAAK,EAAE,EAAE,CAAC,yCAAI,KAAK,CAAC,QAAQ,CAAK,CAAA;AAFzB,QAAA,aAAa,iBAEY;AAE/B,MAAM,QAAQ,GAEjB,CAAC,KAAK,EAAE,EAAE,CAAC,0CAAK,KAAK,CAAC,QAAQ,CAAM,CAAA;AAF3B,QAAA,QAAQ,YAEmB;AAEjC,MAAM,WAAW,GAEpB,CAAC,KAAK,EAAE,EAAE,CAAC,CACb;IACE;QACE,sCAAI,OAAO,EAAE,IAAI,EAAE,SAAS,EAAC,kBAAkB,IAC5C,KAAK,CAAC,QAAQ,CACZ,CACF,CACC,CACT,CAAA;AAVY,QAAA,WAAW,eAUvB;AAEM,MAAM,YAAY,GAErB,CAAC,KAAK,EAAE,EAAE,CAAC,CACb,2CAAS,SAAS,EAAC,uDAAuD,IACvE,KAAK,CAAC,QAAQ,CACP,CACX,CAAA;AANY,QAAA,YAAY,gBAMxB"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import React, { JSXElementConstructor } from 'react';
|
|
2
|
-
import type { StructuredContentFragment } from '@financial-times/cp-content-pipeline-client';
|
|
2
|
+
import type { StructuredContentFragment, ReferenceMapping } from '@financial-times/cp-content-pipeline-client';
|
|
3
3
|
import { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { mapNodeToReference } from '@financial-times/cp-content-pipeline-schema/lib/resolvers/content-tree/references';
|
|
5
|
+
import { ContentProps } from '../types';
|
|
6
|
+
type mapComponentToReference<T extends ContentTreeWorkarounds.AnyNode['type']> = T extends keyof typeof mapNodeToReference ? (typeof mapNodeToReference)[T] extends keyof ReferenceMapping ? ReferenceMapping[(typeof mapNodeToReference)[T]] : never : Record<string, never>;
|
|
7
|
+
export type RichTextComponentMapRecord = {
|
|
8
|
+
[T in ContentTreeWorkarounds.AnyNode | {
|
|
9
|
+
type: 'fallback';
|
|
10
|
+
} as T['type']]?: JSXElementConstructor<React.PropsWithChildren<T['type'] extends 'fallback' ? unknown : ContentProps<T & mapComponentToReference<Exclude<T['type'], 'fallback'>>>>>;
|
|
11
|
+
};
|
|
12
|
+
export declare const ComponentsContext: React.Context<RichTextComponentMapRecord | undefined>;
|
|
6
13
|
type WithOptionalProperty<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
7
14
|
export type RichTextProps = {
|
|
8
15
|
structuredContent: WithOptionalProperty<StructuredContentFragment, 'references'>;
|
|
@@ -110,10 +110,16 @@ const RichTextChild = ({ node, components, references, parentIndex, }) => {
|
|
|
110
110
|
.filter(Boolean)
|
|
111
111
|
: [];
|
|
112
112
|
const reference = typeof node.data?.referenceIndex === 'number'
|
|
113
|
-
? references[node.data?.referenceIndex]
|
|
113
|
+
? references[node.data?.referenceIndex] ?? {}
|
|
114
114
|
: {};
|
|
115
115
|
return (react_1.default.createElement(context_1.default.Provider, { value: RichText },
|
|
116
|
-
react_1.default.createElement(Component
|
|
116
|
+
react_1.default.createElement(Component
|
|
117
|
+
// HACK:20240808:IM TypeScript fails to unify the content types here
|
|
118
|
+
// and I'm not sure why :(
|
|
119
|
+
, {
|
|
120
|
+
// HACK:20240808:IM TypeScript fails to unify the content types here
|
|
121
|
+
// and I'm not sure why :(
|
|
122
|
+
content: { ...node, ...reference }, key: parentIndex, parentIndex: parentIndex }, children)));
|
|
117
123
|
}
|
|
118
124
|
return null;
|
|
119
125
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/RichText/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAKc;AACd,iEAAwC;AACxC,wDAAqD;AACrD,sCAA8C;AAC9C,6DAAoC;AACpC,qDAA4B;AAC5B,2DAAkC;AAClC,yDAAgC;AAChC,6DAAoC;AACpC,qDAA4B;AAC5B,qDAA4B;AAC5B,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CAAA"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { ContentTree } from '@financial-times/content-tree';
|
|
2
|
-
import { ScrollyImageFragment } from '@financial-times/cp-content-pipeline-client';
|
|
3
1
|
import React from 'react';
|
|
4
|
-
|
|
2
|
+
import { ContentProps } from '../types';
|
|
3
|
+
import type * as ComponentWorkarounds from '../Workarounds';
|
|
4
|
+
interface ScrollyImageProps extends ContentProps<ComponentWorkarounds.ScrollyImage> {
|
|
5
|
+
}
|
|
6
|
+
export declare const ScrollyImage: React.FC<ScrollyImageProps>;
|
|
7
|
+
export {};
|
|
@@ -47,7 +47,7 @@ const scrollyGetBreakpoints = (image) => {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
const ScrollyImage = ({ picture }) => {
|
|
50
|
+
const ScrollyImage = ({ content: { picture }, }) => {
|
|
51
51
|
const scrollyId = (0, react_1.useContext)(_1.ScrollyIDContext);
|
|
52
52
|
if (!picture?.images) {
|
|
53
53
|
throw new Error(`ScrollyImage has no images. Check that they are present in the query`);
|
|
@@ -55,7 +55,7 @@ const ScrollyImage = ({ picture }) => {
|
|
|
55
55
|
return (react_1.default.createElement("figure", { className: "n-scrollytelling__figure n-content-image--full", "data-scrollytelling-slide": scrollyId },
|
|
56
56
|
react_1.default.createElement("picture", null,
|
|
57
57
|
react_1.default.createElement(ImageSet_1.Sources, { images: picture.images, getBreakpoints: scrollyGetBreakpoints }),
|
|
58
|
-
react_1.default.createElement(ImageSet_1.FallbackImage, { image: picture.fallbackImage, imageType: picture.imageType, className: "n-scrollytelling__image", inSourceSet: true })),
|
|
58
|
+
react_1.default.createElement(ImageSet_1.FallbackImage, { content: { image: picture.fallbackImage }, imageType: picture.imageType, className: "n-scrollytelling__image", inSourceSet: true })),
|
|
59
59
|
(picture.caption || picture.credit) && (react_1.default.createElement("figcaption", { className: "n-scrollytelling__caption n-scrollytelling__caption--has-caption" },
|
|
60
60
|
picture.caption ? picture.caption + ' ' : '',
|
|
61
61
|
picture.credit))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollyImage.js","sourceRoot":"","sources":["../../../src/components/Scrollytelling/ScrollyImage.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ScrollyImage.js","sourceRoot":"","sources":["../../../src/components/Scrollytelling/ScrollyImage.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AACzC,0CAAsE;AACtE,wBAAoC;AAIpC,MAAM,qBAAqB,GAAqB,CAAC,KAAK,EAAE,EAAE;IACxD,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO;gBACL,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,EAAE;gBAC9C,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,WAAW,EAAE;gBAC9C,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE;gBAC/C,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE;gBAChD,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE;aAClD,CAAA;QACH,KAAK,QAAQ;YACX,OAAO;gBACL,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE;gBAC7C,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE;gBAC7C,CAAC,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE;gBAC7C,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE;gBAC/C,GAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE;aACjD,CAAA;IACL,CAAC;AACH,CAAC,CAAA;AAKM,MAAM,YAAY,GAAgC,CAAC,EACxD,OAAO,EAAE,EAAE,OAAO,EAAE,GACrB,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,IAAA,kBAAU,EAAC,mBAAgB,CAAC,CAAA;IAE9C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACb,sEAAsE,CACvE,CAAA;IACH,CAAC;IAED,OAAO,CACL,0CACE,SAAS,EAAC,gDAAgD,+BAC/B,SAAS;QAEpC;YACE,8BAAC,kBAAO,IACN,MAAM,EAAE,OAAO,CAAC,MAAM,EACtB,cAAc,EAAE,qBAAqB,GACrC;YACF,8BAAC,wBAAa,IACZ,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,aAAa,EAAE,EACzC,SAAS,EAAE,OAAO,CAAC,SAAS,EAC5B,SAAS,EAAC,yBAAyB,EACnC,WAAW,EAAE,IAAI,GACjB,CACM;QACT,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,CACtC,8CAAY,SAAS,EAAC,kEAAkE;YACrF,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE;YAC5C,OAAO,CAAC,MAAM,CACJ,CACd,CACM,CACV,CAAA;AACH,CAAC,CAAA;AApCY,QAAA,YAAY,gBAoCxB"}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ContentTree } from '@financial-times/content-tree';
|
|
3
|
+
import { ContentProps } from '../types';
|
|
3
4
|
export declare const ScrollyIDContext: React.Context<string | null>;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export declare const
|
|
5
|
+
interface ScrollyBlockProps extends ContentProps<ContentTree.transit.ScrollyBlock> {
|
|
6
|
+
}
|
|
7
|
+
export declare const ScrollyBlock: React.FC<React.PropsWithChildren<ScrollyBlockProps>>;
|
|
8
|
+
interface ScrollySectionProps extends ContentProps<ContentTree.transit.ScrollySection> {
|
|
9
|
+
}
|
|
10
|
+
export declare const ScrollySection: React.FC<React.PropsWithChildren<ScrollySectionProps>>;
|
|
11
|
+
interface ScrollyCopyProps extends ContentProps<ContentTree.ScrollyCopy> {
|
|
12
|
+
}
|
|
13
|
+
export declare const ScrollyCopy: React.FC<React.PropsWithChildren<ScrollyCopyProps>>;
|
|
14
|
+
interface ScrollyHeadingProps extends ContentProps<ContentTree.ScrollyHeading> {
|
|
15
|
+
}
|
|
16
|
+
export declare const ScrollyHeading: React.FC<React.PropsWithChildren<ScrollyHeadingProps>>;
|
|
17
|
+
export {};
|
|
@@ -31,12 +31,12 @@ const react_1 = __importStar(require("react"));
|
|
|
31
31
|
const classnames_1 = __importDefault(require("classnames"));
|
|
32
32
|
const Paragraph_1 = require("../Paragraph");
|
|
33
33
|
exports.ScrollyIDContext = (0, react_1.createContext)(null);
|
|
34
|
-
const ScrollyBlock = ({
|
|
34
|
+
const ScrollyBlock = ({ content: { theme }, children, parentIndex }) => (react_1.default.createElement("div", { className: "n-content-layout n-content-layout--scrollytelling", "data-layout-name": "auto" },
|
|
35
35
|
react_1.default.createElement("div", { className: (0, classnames_1.default)('n-scrollytelling', `n-scrollytelling--theme-${theme}`), "data-component": "scrollytelling-image", "data-scrollytelling-theme": theme },
|
|
36
36
|
react_1.default.createElement("div", { className: "n-scrollytelling__viewport" }, react_1.default.Children.map(children, (child, index) => (react_1.default.createElement(exports.ScrollyIDContext.Provider, { value: `${parentIndex}-${index}` }, child)))))));
|
|
37
37
|
exports.ScrollyBlock = ScrollyBlock;
|
|
38
38
|
const ScrollySectionOptionsContext = (0, react_1.createContext)(null);
|
|
39
|
-
const ScrollySection = ({
|
|
39
|
+
const ScrollySection = ({ content: { display, noBox, position, transition }, children }) => (react_1.default.createElement(ScrollySectionOptionsContext.Provider, { value: { display, noBox, position, transition } },
|
|
40
40
|
react_1.default.createElement(react_1.default.Fragment, null, children)));
|
|
41
41
|
exports.ScrollySection = ScrollySection;
|
|
42
42
|
const ScrollyCopy = ({ children }) => {
|
|
@@ -59,7 +59,7 @@ const ScrollyCopy = ({ children }) => {
|
|
|
59
59
|
react_1.default.createElement(react_1.default.Fragment, null, children)))));
|
|
60
60
|
};
|
|
61
61
|
exports.ScrollyCopy = ScrollyCopy;
|
|
62
|
-
const ScrollyHeading = ({
|
|
62
|
+
const ScrollyHeading = ({ content: { level }, children }) => {
|
|
63
63
|
const classNames = (0, classnames_1.default)('n-scrollytelling__overlay-text', `n-scrollytelling__overlay-text--text-style-${level}`);
|
|
64
64
|
switch (level) {
|
|
65
65
|
case 'chapter':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Scrollytelling/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwD;AAExD,4DAAmC;AAEnC,4CAA+C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Scrollytelling/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwD;AAExD,4DAAmC;AAEnC,4CAA+C;AAGlC,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAAgB,IAAI,CAAC,CAAA;AAK3D,MAAM,YAAY,GAErB,CAAC,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CACrD,uCACE,SAAS,EAAC,mDAAmD,sBAC5C,MAAM;IAEvB,uCACE,SAAS,EAAE,IAAA,oBAAU,EACnB,kBAAkB,EAClB,2BAA2B,KAAK,EAAE,CACnC,oBACc,sBAAsB,+BACV,KAAK;QAEhC,uCAAK,SAAS,EAAC,4BAA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EAC5D,OAAO;YACT,CAAC,yCAAyC,UAAU,EAAE,CAAC,EAAE,UAAU;SACpE,CACF,oCAC+B,SAAS;QAEzC,uCACE,SAAS,EAAE,IAAA,oBAAU,EAAC,oCAAoC,EAAE;gBAC1D,iDAAiD,EAAE,KAAK;gBACxD,CAAC,uCAAuC,aAAa,EAAE,CAAC,EAAE,OAAO;aAClE,CAAC;YAEF,8BAAC,4BAAgB,CAAC,QAAQ,IACxB,KAAK,EAAE,EAAE,SAAS,EAAE,gCAAgC,EAAE;gBAEtD,8DAAG,QAAQ,CAAI,CACW,CACxB,CACF,CACP,CAAA;AACH,CAAC,CAAA;AA3CY,QAAA,WAAW,eA2CvB;AAKM,MAAM,cAAc,GAEvB,CAAC,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;IACvC,MAAM,UAAU,GAAG,IAAA,oBAAU,EAC3B,gCAAgC,EAChC,8CAA8C,KAAK,EAAE,CACtD,CAAA;IAED,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,SAAS;YACZ,OAAO,sCAAI,SAAS,EAAE,UAAU;;gBAAI,QAAQ;oBAAO,CAAA;QACrD,KAAK,SAAS;YACZ,OAAO,sCAAI,SAAS,EAAE,UAAU;;gBAAI,QAAQ;oBAAO,CAAA;QACrD,KAAK,YAAY;YACf,OAAO,sCAAI,SAAS,EAAE,UAAU;;gBAAI,QAAQ;oBAAO,CAAA;IACvD,CAAC;AACH,CAAC,CAAA;AAhBY,QAAA,cAAc,kBAgB1B"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
3
|
+
import { ContentProps } from '../types';
|
|
4
|
+
interface TableBodyProps extends ContentProps<ContentTreeWorkarounds.TableBody> {
|
|
5
|
+
}
|
|
6
|
+
declare const TableBody: React.FC<React.PropsWithChildren<TableBodyProps>>;
|
|
4
7
|
export default TableBody;
|
|
@@ -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 TableBody = ({ children }) => {
|
|
7
|
+
const TableBody = ({ children, }) => {
|
|
8
8
|
const [headerRow, ...bodyRows] = react_1.default.Children.toArray(children);
|
|
9
9
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
10
10
|
react_1.default.createElement("thead", null, headerRow),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableBody.js","sourceRoot":"","sources":["../../../src/components/Table/TableBody.tsx"],"names":[],"mappings":";;;;;AACA,kDAAyB;
|
|
1
|
+
{"version":3,"file":"TableBody.js","sourceRoot":"","sources":["../../../src/components/Table/TableBody.tsx"],"names":[],"mappings":";;;;;AACA,kDAAyB;AAMzB,MAAM,SAAS,GAAsD,CAAC,EACpE,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,CAAC,SAAS,EAAE,GAAG,QAAQ,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IAEjE,OAAO,CACL;QACE,6CAAQ,SAAS,CAAS;QAC1B,6CAAQ,QAAQ,CAAS,CACxB,CACJ,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,SAAS,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export declare const TableCell: React.FC<TableCellProps
|
|
3
|
+
import { ContentProps } from '../types';
|
|
4
|
+
interface TableCellProps extends ContentProps<ContentTreeWorkarounds.TableCell> {
|
|
5
|
+
}
|
|
6
|
+
export declare const TableCell: React.FC<React.PropsWithChildren<TableCellProps>>;
|
|
7
7
|
export {};
|
|
@@ -32,11 +32,11 @@ const _1 = require(".");
|
|
|
32
32
|
const classnames_1 = __importDefault(require("classnames"));
|
|
33
33
|
const TableCell = (props) => {
|
|
34
34
|
const allColumnSettings = (0, react_1.useContext)(_1.ColumnSettingsContext);
|
|
35
|
-
const columnSettings = allColumnSettings[props.parentIndex] ?? {
|
|
35
|
+
const columnSettings = (props.parentIndex ? allColumnSettings[props.parentIndex] : undefined) ?? {
|
|
36
36
|
hideOnMobile: false,
|
|
37
37
|
sortable: false,
|
|
38
38
|
};
|
|
39
|
-
return props.heading ? (react_1.default.createElement("th", { className: (0, classnames_1.default)({
|
|
39
|
+
return props.content.heading ? (react_1.default.createElement("th", { className: (0, classnames_1.default)({
|
|
40
40
|
'n-content-body__table-cell--hide-mobile': columnSettings.hideOnMobile,
|
|
41
41
|
}), "data-o-table-data-type": columnSettings.sortType, "data-o-table-heading-disable-sort": !columnSettings.sortable || undefined, scope: "col", role: "columnheader" }, props.children)) : (react_1.default.createElement("td", { className: (0, classnames_1.default)({
|
|
42
42
|
'o-table__cell--numeric': columnSettings.sortType === 'number',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../src/components/Table/TableCell.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AAEzC,wBAAyC;AACzC,4DAAmC;AAM5B,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../../src/components/Table/TableCell.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AAEzC,wBAAyC;AACzC,4DAAmC;AAM5B,MAAM,SAAS,GAAsD,CAC1E,KAAK,EACL,EAAE;IACF,MAAM,iBAAiB,GAAG,IAAA,kBAAU,EAAC,wBAAqB,CAAC,CAAA;IAC3D,MAAM,cAAc,GAClB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI;QACxE,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,KAAK;KAChB,CAAA;IAEH,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAC7B,sCACE,SAAS,EAAE,IAAA,oBAAU,EAAC;YACpB,yCAAyC,EAAE,cAAc,CAAC,YAAY;SACvE,CAAC,4BACsB,cAAc,CAAC,QAAQ,uCACZ,CAAC,cAAc,CAAC,QAAQ,IAAI,SAAS,EACxE,KAAK,EAAC,KAAK,EACX,IAAI,EAAC,cAAc,IAElB,KAAK,CAAC,QAAQ,CACZ,CACN,CAAC,CAAC,CAAC,CACF,sCACE,SAAS,EAAE,IAAA,oBAAU,EAAC;YACpB,wBAAwB,EAAE,cAAc,CAAC,QAAQ,KAAK,QAAQ;YAC9D,yCAAyC,EAAE,cAAc,CAAC,YAAY;SACvE,CAAC,IAED,KAAK,CAAC,QAAQ,CACZ,CACN,CAAA;AACH,CAAC,CAAA;AAhCY,QAAA,SAAS,aAgCrB"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { ContentProps } from '../types';
|
|
3
4
|
export declare const ColumnSettingsContext: React.Context<ContentTreeWorkarounds.TableColumnSettings[]>;
|
|
4
|
-
|
|
5
|
+
interface TableProps extends ContentProps<ContentTreeWorkarounds.Table> {
|
|
6
|
+
}
|
|
7
|
+
declare const Table: React.FC<React.PropsWithChildren<TableProps>>;
|
|
5
8
|
export default Table;
|
|
@@ -30,7 +30,7 @@ exports.ColumnSettingsContext = void 0;
|
|
|
30
30
|
const react_1 = __importStar(require("react"));
|
|
31
31
|
const classnames_1 = __importDefault(require("classnames"));
|
|
32
32
|
exports.ColumnSettingsContext = (0, react_1.createContext)([]);
|
|
33
|
-
const Table = ({ children, compact, layoutWidth, stripes, responsiveStyle, columnSettings, collapseAfterHowManyRows, }) => {
|
|
33
|
+
const Table = ({ children, content: { compact, layoutWidth, stripes, responsiveStyle, columnSettings, collapseAfterHowManyRows, }, }) => {
|
|
34
34
|
return (react_1.default.createElement(exports.ColumnSettingsContext.Provider, { value: columnSettings },
|
|
35
35
|
react_1.default.createElement("div", { className: (0, classnames_1.default)('o-table-container n-content-layout', {
|
|
36
36
|
'o-table-container--contracted': Boolean(collapseAfterHowManyRows),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Table/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAA4C;AAC5C,4DAAmC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Table/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAA4C;AAC5C,4DAAmC;AAGtB,QAAA,qBAAqB,GAAG,IAAA,qBAAa,EAEhD,EAAE,CAAC,CAAA;AAIL,MAAM,KAAK,GAAkD,CAAC,EAC5D,QAAQ,EACR,OAAO,EAAE,EACP,OAAO,EACP,WAAW,EACX,OAAO,EACP,eAAe,EACf,cAAc,EACd,wBAAwB,GACzB,GACF,EAAE,EAAE;IACH,OAAO,CACL,8BAAC,6BAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,cAAc;QACnD,uCACE,SAAS,EAAE,IAAA,oBAAU,EAAC,oCAAoC,EAAE;gBAC1D,+BAA+B,EAAE,OAAO,CAAC,wBAAwB,CAAC;aACnE,CAAC,uBACiB,WAAW,oBACf,OAAO;YAEtB,uCACE,SAAS,EAAE,IAAA,oBAAU,EAAC,yBAAyB,EAAE;oBAC/C,6BAA6B,EAAE,WAAW,KAAK,MAAM;iBACtD,CAAC;gBAEF,uCAAK,SAAS,EAAC,wBAAwB;oBACrC,yCACE,SAAS,EAAE,IAAA,oBAAU,EACnB,SAAS,EACT,uBAAuB,eAAe,EAAE,EACxC;4BACE,kBAAkB,EAAE,OAAO;4BAC3B,sBAAsB,EAAE,OAAO;4BAC/B,2BAA2B,EAAE,CAAC,OAAO;yBACtC,CACF,sBACgB,SAAS,6BACD,eAAe,oCACR,wBAAwB,2BACjC,MAAM,CAAC,CAAC,wBAAwB,CAAC,IAEvD,QAAQ,CACH,CACJ,CACF,CACF,CACyB,CAClC,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,KAAK,CAAA"}
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const ImageSet_1 = require("../ImageSet");
|
|
8
|
+
const ImageOverrideWrappers_1 = require("../ImageOverrideWrappers");
|
|
8
9
|
const topperGetBreakpointsMap = {
|
|
9
10
|
SplitTextTopper(image) {
|
|
10
11
|
switch (image.format) {
|
|
@@ -59,14 +60,16 @@ const topperGetBreakpointsMap = {
|
|
|
59
60
|
}
|
|
60
61
|
},
|
|
61
62
|
};
|
|
62
|
-
const Picture = (
|
|
63
|
+
const Picture = (props) => {
|
|
64
|
+
const { topper, alt = '' } = props;
|
|
63
65
|
if (!('images' in topper) || !topper.fallbackImage) {
|
|
64
66
|
return null;
|
|
65
67
|
}
|
|
66
68
|
return (react_1.default.createElement("figure", { className: "o-topper__visual" },
|
|
67
69
|
react_1.default.createElement("picture", { className: "o-topper__picture", key: "responsive-images" },
|
|
68
|
-
react_1.default.createElement(
|
|
69
|
-
|
|
70
|
+
react_1.default.createElement(ImageOverrideWrappers_1.PictureOverrideWrapper, { ...props },
|
|
71
|
+
react_1.default.createElement(ImageSet_1.Sources, { images: topper.images, getBreakpoints: topperGetBreakpointsMap[topper.__typename] }),
|
|
72
|
+
react_1.default.createElement("img", { alt: alt, className: "o-topper__image", src: topper.fallbackImage.sourceSet[0]?.url, key: "fallback-image" }))),
|
|
70
73
|
topper.fallbackImage.caption ||
|
|
71
74
|
topper.__typename === 'DeepPortraitTopper' ||
|
|
72
75
|
topper.__typename === 'DeepLandscapeTopper' ? (react_1.default.createElement("figcaption", { className: "o-topper__image-caption" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Picture.js","sourceRoot":"","sources":["../../../src/components/Topper/Picture.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAIzB,0CAA2E;
|
|
1
|
+
{"version":3,"file":"Picture.js","sourceRoot":"","sources":["../../../src/components/Topper/Picture.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAIzB,0CAA2E;AAC3E,oEAAiE;AAGjE,MAAM,uBAAuB,GAEzB;IACF,eAAe,CAAC,KAAK;QACnB,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;YACrB,KAAK,QAAQ;gBACX,OAAO,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;YAC/D,KAAK,UAAU;gBACb,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAA;YACzC,KAAK,MAAM;gBACT,OAAO;oBACL,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;oBAC1C,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;iBAC3B,CAAA;QACL,CAAC;IACH,CAAC;IAED,eAAe,CAAC,KAAK;QACnB,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;YACrB,KAAK,QAAQ;gBACX,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAA;YAC1B,KAAK,UAAU;gBACb,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;YAC1C,KAAK,MAAM;gBACT,OAAO;oBACL,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CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;QACnD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,CACL,0CAAQ,SAAS,EAAC,kBAAkB;QAClC,2CAAS,SAAS,EAAC,mBAAmB,EAAC,GAAG,EAAC,mBAAmB;YAC5D,8BAAC,8CAAsB,OAAK,KAAK;gBAC/B,8BAAC,kBAAO,IACN,MAAM,EAAE,MAAM,CAAC,MAAsC,EACrD,cAAc,EAAE,uBAAuB,CAAC,MAAM,CAAC,UAAU,CAAC,GAC1D;gBAEF,uCACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAC,iBAAiB,EAC3B,GAAG,EAAE,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAC3C,GAAG,EAAC,gBAAgB,GACpB,CACqB,CACjB;QACT,MAAM,CAAC,aAAa,CAAC,OAAO;YAC7B,MAAM,CAAC,UAAU,KAAK,oBAAoB;YAC1C,MAAM,CAAC,UAAU,KAAK,qBAAqB,CAAC,CAAC,CAAC,CAC5C,8CAAY,SAAS,EAAC,yBAAyB;YAC5C,MAAM,CAAC,aAAa,CAAC,OAAO;;YAAG,MAAM,CAAC,aAAa,CAAC,MAAM,CAChD,CACd,CAAC,CAAC,CAAC,CACF,MAAM,CAAC,aAAa,CAAC,MAAM,IAAI,CAC7B,8CAAY,SAAS,EAAE,wBAAwB,IAC5C,MAAM,CAAC,aAAa,CAAC,MAAM,CACjB,CACd,CACF,CACM,CACV,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,OAAO,CAAA"}
|
|
@@ -99,7 +99,13 @@ const Topper = ({ content, slot, followButtonSlot, showPremiumLabel = false, rea
|
|
|
99
99
|
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 })),
|
|
100
100
|
react_1.default.createElement(Headline_1.default, { headline: topper.headline, showPremiumLabel: showPremiumLabel && content.accessLevel === 'premium', isLargeHeadline: ('isLargeHeadline' in topper && topper.isLargeHeadline) ??
|
|
101
101
|
undefined }),
|
|
102
|
-
isLiveBlog && isFlourish ? (react_1.default.createElement(Flourish_1.default, {
|
|
102
|
+
isLiveBlog && isFlourish ? (react_1.default.createElement(Flourish_1.default, { content: {
|
|
103
|
+
type: 'flourish',
|
|
104
|
+
id: topper.leadFlourish.id ?? '',
|
|
105
|
+
flourishType: topper.leadFlourish.type ?? '',
|
|
106
|
+
description: topper.leadFlourish.description ?? '',
|
|
107
|
+
fallbackImage: topper.leadFlourish.fallbackImage,
|
|
108
|
+
}, iFrame: true, inArticleBody: false })) : (''),
|
|
103
109
|
topper.intro && (react_1.default.createElement(Intro_1.default, { structured: topper.intro.structured, source: topper.intro.source })),
|
|
104
110
|
hasHeadshot && !isAudio && isOpinion && topper.columnist && (react_1.default.createElement("div", { className: "o-topper__headshot" },
|
|
105
111
|
react_1.default.createElement(Headshot_1.default, { headshot: topper.headshot, prefLabel: topper.columnist.prefLabel, className: 'o-topper__headshot-image', altText: headshotAltText }))),
|