@financial-times/cp-content-pipeline-ui 9.12.1 → 9.13.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 +24 -0
- package/lib/components/ContentLayout/index.d.ts +24 -0
- package/lib/components/ContentLayout/index.js +34 -0
- package/lib/components/ContentLayout/index.js.map +1 -0
- package/lib/components/ContentLayout/test/index.spec.d.ts +1 -0
- package/lib/components/ContentLayout/test/index.spec.js +57 -0
- package/lib/components/ContentLayout/test/index.spec.js.map +1 -0
- package/lib/components/content-tree/Clip/components/index.d.ts +0 -2
- package/lib/components/content-tree/Clip/components/index.js +1 -5
- package/lib/components/content-tree/Clip/components/index.js.map +1 -1
- package/lib/components/content-tree/Clip/template/component.d.ts +1 -1
- package/lib/components/content-tree/Clip/template/component.js +3 -3
- package/lib/components/content-tree/Clip/template/component.js.map +1 -1
- package/lib/components/content-tree/Clip/test/snapshot.spec.js +26 -0
- package/lib/components/content-tree/Clip/test/snapshot.spec.js.map +1 -1
- package/package.json +4 -4
- package/src/components/ContentLayout/index.tsx +91 -0
- package/src/components/ContentLayout/test/__snapshots__/index.spec.tsx.snap +96 -0
- package/src/components/ContentLayout/test/index.spec.tsx +81 -0
- package/src/components/content-tree/Clip/components/index.tsx +0 -2
- package/src/components/content-tree/Clip/template/component.tsx +23 -24
- package/src/components/content-tree/Clip/test/__snapshots__/snapshot.spec.tsx.snap +277 -0
- package/src/components/content-tree/Clip/test/snapshot.spec.tsx +40 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/components/content-tree/Clip/components/Container.d.ts +0 -6
- package/lib/components/content-tree/Clip/components/Container.js +0 -13
- package/lib/components/content-tree/Clip/components/Container.js.map +0 -1
- package/lib/components/content-tree/Clip/components/ContentLayout.d.ts +0 -6
- package/lib/components/content-tree/Clip/components/ContentLayout.js +0 -13
- package/lib/components/content-tree/Clip/components/ContentLayout.js.map +0 -1
- package/src/components/content-tree/Clip/components/Container.tsx +0 -32
- package/src/components/content-tree/Clip/components/ContentLayout.tsx +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -574,6 +574,30 @@
|
|
|
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.13.0](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-ui-v9.12.1...cp-content-pipeline-ui-v9.13.0) (2025-12-11)
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
### Features
|
|
581
|
+
|
|
582
|
+
* anchor links in clips ([f753082](https://github.com/Financial-Times/cp-content-pipeline/commit/f753082b61b1e5aa989cd1db901546eeee71fe83))
|
|
583
|
+
* ci-3111 media queries on clips sources ([856bd45](https://github.com/Financial-Times/cp-content-pipeline/commit/856bd457ba6dc56f292c6a31e0edfe3f29b4a904))
|
|
584
|
+
* content layout ui component as wrapper for body-tree ui components ([becfee2](https://github.com/Financial-Times/cp-content-pipeline/commit/becfee26199bc6fd666c46b5ebb2353bdd7da630))
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
### Bug Fixes
|
|
588
|
+
|
|
589
|
+
* avoid fetching teaser data from RecommendedList resolver ([54bc53f](https://github.com/Financial-Times/cp-content-pipeline/commit/54bc53f9a40446667a9f93b85d710cd6a943157d))
|
|
590
|
+
* ensure headshot only for one columnist ([63b1f54](https://github.com/Financial-Times/cp-content-pipeline/commit/63b1f54008b5019863508cef224e14ab67429695))
|
|
591
|
+
* **ui:** mark Tool Kit plugin as a dev dependency ([53299d4](https://github.com/Financial-Times/cp-content-pipeline/commit/53299d46826aafb1884651441ae98caa63950ef2))
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
### Dependencies
|
|
595
|
+
|
|
596
|
+
* The following workspace dependencies were updated
|
|
597
|
+
* devDependencies
|
|
598
|
+
* @financial-times/cp-content-pipeline-client bumped from ^4.20.1 to ^4.20.2
|
|
599
|
+
* @financial-times/cp-content-pipeline-schema bumped from ^3.20.0 to ^3.21.0
|
|
600
|
+
|
|
577
601
|
## [9.12.1](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-ui-v9.12.0...cp-content-pipeline-ui-v9.12.1) (2025-12-09)
|
|
578
602
|
|
|
579
603
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The available layout widths for the Layout component.
|
|
4
|
+
*
|
|
5
|
+
* Available options:
|
|
6
|
+
* - `in-line` - [Default] 7 columns (700 pixels)
|
|
7
|
+
* - `full-width` - Legacy alias for `in-line`
|
|
8
|
+
* - `mid-grid` - 9 columns (900 pixels)
|
|
9
|
+
* - `full-grid` - 12 columns of the grid (1200 pixels)
|
|
10
|
+
*
|
|
11
|
+
* @todo Existing layouts not currently supported by this component. To be implemented in the future:
|
|
12
|
+
* @todo `inset-left` - 5 columns (up to 500 pixels), medium screens and above: 3 columns (300 pixels), float left
|
|
13
|
+
* @todo `inset-right` - 5 columns (up to 500 pixels), medium screens and above: 3 columns (300 pixels), float right
|
|
14
|
+
* @todo `full-bleed` - Edge to edge of the viewport, no padding
|
|
15
|
+
* @todo The terminology in Spark doesn't align with our terminology. For instance, Editorial uses `full-width` that we map to `full-grid`. We should likely move towards an ubiquitous language prioritising the Editorial one.
|
|
16
|
+
*/
|
|
17
|
+
type LayoutWidth = 'in-line' | 'mid-grid' | 'full-grid';
|
|
18
|
+
interface ContentLayoutProps {
|
|
19
|
+
dataLayout: LayoutWidth;
|
|
20
|
+
dataComponent?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const ContentLayout: React.FC<React.PropsWithChildren<ContentLayoutProps>>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
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.ContentLayout = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
9
|
+
/*
|
|
10
|
+
* @description OverflowingLayout component prevent clashes with ads on the RHR (Righthand-rail) and share bar
|
|
11
|
+
* via the usage of data-layout-width='full-grid'
|
|
12
|
+
* See related code here: https://github.com/Financial-Times/next-article/blob/5766d82de6125ffc99fa6e3bc132311b3434f8f0/client/components/share/main.js#L8
|
|
13
|
+
*/
|
|
14
|
+
const OverflowingLayout = ({ children, }) => (react_1.default.createElement("div", { className: "n-content-layout", "data-layout-width": "full-grid" }, children));
|
|
15
|
+
/*
|
|
16
|
+
* @description ContentLayout component is used to fulfill the legacy usage of n-layout.
|
|
17
|
+
* @param dataLayout - The layout type of the content (e.g., 'full-grid', 'mid-grid', etc.).
|
|
18
|
+
* @param dataComponent - The component type used as data-component attribute for client-side targeting.
|
|
19
|
+
*/
|
|
20
|
+
const ContentLayout = ({ dataLayout = 'in-line', children, dataComponent = '', className = '', }) => {
|
|
21
|
+
const ContainerClassNames = (0, classnames_1.default)('n-content-layout__container', className);
|
|
22
|
+
if (dataLayout === 'full-grid') {
|
|
23
|
+
return (react_1.default.createElement(OverflowingLayout, null,
|
|
24
|
+
react_1.default.createElement("div", { className: ContainerClassNames, "data-component": dataComponent }, children)));
|
|
25
|
+
}
|
|
26
|
+
if (dataLayout === 'mid-grid') {
|
|
27
|
+
return (react_1.default.createElement(OverflowingLayout, null,
|
|
28
|
+
react_1.default.createElement("div", { className: ContainerClassNames, "data-component": dataComponent },
|
|
29
|
+
react_1.default.createElement("div", { "data-o-grid-colspan": "12 S12 M12 L10 XL10", className: "n-content-layout__container--mid-grid" }, children))));
|
|
30
|
+
}
|
|
31
|
+
return (react_1.default.createElement("div", { className: "n-content-layout__container--in-line", "data-component": dataComponent }, children));
|
|
32
|
+
};
|
|
33
|
+
exports.ContentLayout = ContentLayout;
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ContentLayout/index.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,4DAAmC;AAyBnC;;;;GAIG;AACH,MAAM,iBAAiB,GAA4C,CAAC,EAClE,QAAQ,GACT,EAAE,EAAE,CAAC,CACJ,uCAAK,SAAS,EAAC,kBAAkB,uBAAmB,WAAW,IAC5D,QAAQ,CACL,CACP,CAAA;AAED;;;;GAIG;AACI,MAAM,aAAa,GAEtB,CAAC,EACH,UAAU,GAAG,SAAS,EACtB,QAAQ,EACR,aAAa,GAAG,EAAE,EAClB,SAAS,GAAG,EAAE,GACf,EAAE,EAAE;IACH,MAAM,mBAAmB,GAAG,IAAA,oBAAU,EACpC,6BAA6B,EAC7B,SAAS,CACV,CAAA;IAED,IAAI,UAAU,KAAK,WAAW,EAAE,CAAC;QAC/B,OAAO,CACL,8BAAC,iBAAiB;YAChB,uCAAK,SAAS,EAAE,mBAAmB,oBAAkB,aAAa,IAC/D,QAAQ,CACL,CACY,CACrB,CAAA;IACH,CAAC;IAED,IAAI,UAAU,KAAK,UAAU,EAAE,CAAC;QAC9B,OAAO,CACL,8BAAC,iBAAiB;YAChB,uCAAK,SAAS,EAAE,mBAAmB,oBAAkB,aAAa;gBAChE,8DACsB,qBAAqB,EACzC,SAAS,EAAC,uCAAuC,IAEhD,QAAQ,CACL,CACF,CACY,CACrB,CAAA;IACH,CAAC;IAED,OAAO,CACL,uCACE,SAAS,EAAC,sCAAsC,oBAChC,aAAa,IAE5B,QAAQ,CACL,CACP,CAAA;AACH,CAAC,CAAA;AA9CY,QAAA,aAAa,iBA8CzB"}
|
|
@@ -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_test_renderer_1 = __importDefault(require("react-test-renderer"));
|
|
8
|
+
const index_1 = require("../index");
|
|
9
|
+
describe('ContentLayout', () => {
|
|
10
|
+
it('renders full-grid layout with container correctly', () => {
|
|
11
|
+
const tree = react_test_renderer_1.default
|
|
12
|
+
.create(react_1.default.createElement(index_1.ContentLayout, { dataLayout: "full-grid", dataComponent: "clip-set" },
|
|
13
|
+
react_1.default.createElement("div", null, "Test content")))
|
|
14
|
+
.toJSON();
|
|
15
|
+
expect(tree).toMatchSnapshot();
|
|
16
|
+
});
|
|
17
|
+
it('renders mid-grid layout with container correctly', () => {
|
|
18
|
+
const tree = react_test_renderer_1.default
|
|
19
|
+
.create(react_1.default.createElement(index_1.ContentLayout, { dataLayout: "mid-grid", dataComponent: "clip-set" },
|
|
20
|
+
react_1.default.createElement("div", null, "Test content")))
|
|
21
|
+
.toJSON();
|
|
22
|
+
expect(tree).toMatchSnapshot();
|
|
23
|
+
});
|
|
24
|
+
it('renders in-line layout with container correctly', () => {
|
|
25
|
+
const tree = react_test_renderer_1.default
|
|
26
|
+
.create(react_1.default.createElement(index_1.ContentLayout, { dataLayout: "in-line", dataComponent: "clip-set" },
|
|
27
|
+
react_1.default.createElement("div", null, "Test content")))
|
|
28
|
+
.toJSON();
|
|
29
|
+
expect(tree).toMatchSnapshot();
|
|
30
|
+
});
|
|
31
|
+
describe('Edge cases', () => {
|
|
32
|
+
it('handles empty children', () => {
|
|
33
|
+
const tree = react_test_renderer_1.default
|
|
34
|
+
.create(react_1.default.createElement(index_1.ContentLayout, { dataLayout: "full-grid", dataComponent: "clip-set" },
|
|
35
|
+
react_1.default.createElement("div", null)))
|
|
36
|
+
.toJSON();
|
|
37
|
+
expect(tree).toMatchSnapshot();
|
|
38
|
+
});
|
|
39
|
+
it('handles null children', () => {
|
|
40
|
+
const tree = react_test_renderer_1.default
|
|
41
|
+
.create(react_1.default.createElement(index_1.ContentLayout, { dataLayout: "full-grid", dataComponent: "clip-set" },
|
|
42
|
+
react_1.default.createElement("div", null, null)))
|
|
43
|
+
.toJSON();
|
|
44
|
+
expect(tree).toMatchSnapshot();
|
|
45
|
+
});
|
|
46
|
+
it('handles conditional children', () => {
|
|
47
|
+
const showContent = true;
|
|
48
|
+
const tree = react_test_renderer_1.default
|
|
49
|
+
.create(react_1.default.createElement(index_1.ContentLayout, { dataLayout: "full-grid", dataComponent: "clip-set" },
|
|
50
|
+
react_1.default.createElement("div", null, showContent && react_1.default.createElement("div", null, "Conditional content")),
|
|
51
|
+
react_1.default.createElement("div", null, !showContent && react_1.default.createElement("div", null, "Alternative content"))))
|
|
52
|
+
.toJSON();
|
|
53
|
+
expect(tree).toMatchSnapshot();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=index.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../../src/components/ContentLayout/test/index.spec.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,8EAA0C;AAC1C,oCAAwC;AAExC,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,IAAI,GAAG,6BAAQ;aAClB,MAAM,CACL,8BAAC,qBAAa,IAAC,UAAU,EAAC,WAAW,EAAC,aAAa,EAAC,UAAU;YAC5D,0DAAuB,CACT,CACjB;aACA,MAAM,EAAE,CAAA;QAEX,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAA;IAChC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,IAA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AAI,GAAG,6BAAQ;iBAClB,MAAM,CACL,8BAAC,qBAAa,IAAC,UAAU,EAAC,WAAW,EAAC,aAAa,EAAC,UAAU;gBAC5D,2CAAM,WAAW,IAAI,iEAA8B,CAAO;gBAC1D,2CAAM,CAAC,WAAW,IAAI,iEAA8B,CAAO,CAC7C,CACjB;iBACA,MAAM,EAAE,CAAA;YAEX,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAA;QAChC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -3,6 +3,4 @@ export { Caption } from './Caption';
|
|
|
3
3
|
export { VideoInfoBox } from './VideoInfoBox';
|
|
4
4
|
export { ClosedCaptions } from './ClosedCaptions';
|
|
5
5
|
export { VideoDescription } from './VideoDescription';
|
|
6
|
-
export { Container } from './Container';
|
|
7
|
-
export { ContentLayout } from './ContentLayout';
|
|
8
6
|
export { ClipTag } from './ClipTag';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ClipTag = exports.
|
|
3
|
+
exports.ClipTag = exports.VideoDescription = exports.ClosedCaptions = exports.VideoInfoBox = exports.Caption = exports.Credit = void 0;
|
|
4
4
|
var Credit_1 = require("./Credit");
|
|
5
5
|
Object.defineProperty(exports, "Credit", { enumerable: true, get: function () { return Credit_1.Credit; } });
|
|
6
6
|
var Caption_1 = require("./Caption");
|
|
@@ -11,10 +11,6 @@ var ClosedCaptions_1 = require("./ClosedCaptions");
|
|
|
11
11
|
Object.defineProperty(exports, "ClosedCaptions", { enumerable: true, get: function () { return ClosedCaptions_1.ClosedCaptions; } });
|
|
12
12
|
var VideoDescription_1 = require("./VideoDescription");
|
|
13
13
|
Object.defineProperty(exports, "VideoDescription", { enumerable: true, get: function () { return VideoDescription_1.VideoDescription; } });
|
|
14
|
-
var Container_1 = require("./Container");
|
|
15
|
-
Object.defineProperty(exports, "Container", { enumerable: true, get: function () { return Container_1.Container; } });
|
|
16
|
-
var ContentLayout_1 = require("./ContentLayout");
|
|
17
|
-
Object.defineProperty(exports, "ContentLayout", { enumerable: true, get: function () { return ContentLayout_1.ContentLayout; } });
|
|
18
14
|
var ClipTag_1 = require("./ClipTag");
|
|
19
15
|
Object.defineProperty(exports, "ClipTag", { enumerable: true, get: function () { return ClipTag_1.ClipTag; } });
|
|
20
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/content-tree/Clip/components/index.tsx"],"names":[],"mappings":";;;AAAA,mCAAiC;AAAxB,gGAAA,MAAM,OAAA;AACf,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,+CAA6C;AAApC,4GAAA,YAAY,OAAA;AACrB,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AACzB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/content-tree/Clip/components/index.tsx"],"names":[],"mappings":";;;AAAA,mCAAiC;AAAxB,gGAAA,MAAM,OAAA;AACf,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,+CAA6C;AAApC,4GAAA,YAAY,OAAA;AACrB,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AACzB,qCAAmC;AAA1B,kGAAA,OAAO,OAAA"}
|
|
@@ -4,6 +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 ContentLayout_1 = require("../../../ContentLayout");
|
|
7
8
|
const components_1 = require("../components");
|
|
8
9
|
const ClipComponent = ({ content, preset = 'full-player', preload = 'auto', maxClipWidth = 0, }) => {
|
|
9
10
|
let poster = 'poster' in content ? content.poster : '';
|
|
@@ -38,9 +39,8 @@ const ClipComponent = ({ content, preset = 'full-player', preload = 'auto', maxC
|
|
|
38
39
|
if (preset === 'thumbnail') {
|
|
39
40
|
return (react_1.default.createElement(components_1.ClipTag, { id: id, clip: clip, poster: poster, accessibility: accessibility, autoplay: content.autoplay, loop: content.loop, noAudio: noAudio, muted: content.muted, preload: preload, noCaption: true, noDescription: true, noInfoBox: true, systemTitle: systemTitle, maxClipWidth: maxClipWidth }));
|
|
40
41
|
}
|
|
41
|
-
return (react_1.default.createElement(
|
|
42
|
-
react_1.default.createElement(components_1.
|
|
43
|
-
react_1.default.createElement(components_1.ClipTag, { id: id, dataLayout: content.dataLayout, description: content.description ?? '', poster: posterAttribute, autoplay: content.autoplay, noAudio: noAudio, loop: content.loop, muted: content.muted, clip: clip, credits: content.credits ?? '', caption: content.caption ?? '', systemTitle: systemTitle, accessibility: accessibility, preload: preload, dataTrackable: "next-article-cp-clip", maxClipWidth: maxClipWidth, fragmentIdentifier: content.fragmentIdentifier ?? '' }))));
|
|
42
|
+
return (react_1.default.createElement(ContentLayout_1.ContentLayout, { dataLayout: content.dataLayout, dataComponent: "clip-set" },
|
|
43
|
+
react_1.default.createElement(components_1.ClipTag, { id: id, dataLayout: content.dataLayout, description: content.description ?? '', poster: posterAttribute, autoplay: content.autoplay, noAudio: noAudio, loop: content.loop, muted: content.muted, clip: clip, credits: content.credits ?? '', caption: content.caption ?? '', systemTitle: systemTitle, accessibility: accessibility, preload: preload, dataTrackable: "next-article-cp-clip", maxClipWidth: maxClipWidth, fragmentIdentifier: content.fragmentIdentifier ?? '' })));
|
|
44
44
|
};
|
|
45
45
|
exports.default = ClipComponent;
|
|
46
46
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../../src/components/content-tree/Clip/template/component.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../../src/components/content-tree/Clip/template/component.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,0DAAsD;AACtD,8CAAuC;AAgCvC,MAAM,aAAa,GAAwB,CAAC,EAC1C,OAAO,EACP,MAAM,GAAG,aAAa,EACtB,OAAO,GAAG,MAAM,EAChB,YAAY,GAAG,CAAC,GACjB,EAAE,EAAE;IACH,IAAI,MAAM,GAAG,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;IACtD,IAAI,EAAU,CAAA;IACd,6DAA6D;IAC7D,IAAI,IAA+B,CAAA;IACnC,2BAA2B;IAC3B,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACtC,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACvB,EAAE,GAAG,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QACtC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QACtB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,8BAA8B;QAC9B,EAAE,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;QACxC,IAAI,GAAG;YACL,UAAU,EAAE;gBACV;oBACE,SAAS,EAAE,EAAE,IAAI,EAAE;oBACnB,wBAAwB;oBACxB,SAAS,EAAE,WAAW;iBACvB;aACF;SACF,CAAA;IACH,CAAC;IAED,MAAM,eAAe,GACnB,IAAI,EAAE,UAAU,EAAE,MAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAA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BAAsB,EACpC,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,OAAO,CAAC,kBAAkB,IAAI,EAAE,GACpD,CACY,CACjB,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,aAAa,CAAA"}
|
|
@@ -26,6 +26,32 @@ describe('Clip Snapshot', () => {
|
|
|
26
26
|
describe('component rendered on server', () => {
|
|
27
27
|
const url = 'localhost:8080/fakevideo.mpg';
|
|
28
28
|
const poster = 'localhost:8080/fakeposter.jpg';
|
|
29
|
+
describe('ContentLayout integration tests', () => {
|
|
30
|
+
it('in-line render - should not wrap in ContentLayout div', () => {
|
|
31
|
+
const tree = react_test_renderer_1.default
|
|
32
|
+
.create(react_1.default.createElement(index_1.default, { content: { url, dataLayout: 'in-line' } }))
|
|
33
|
+
.toJSON();
|
|
34
|
+
expect(formatString(tree)).toMatchSnapshot();
|
|
35
|
+
});
|
|
36
|
+
it('full-grid default render - should wrap in ContentLayout with proper classes', () => {
|
|
37
|
+
const tree = react_test_renderer_1.default
|
|
38
|
+
.create(react_1.default.createElement(index_1.default, { content: { url, dataLayout: 'full-grid' } }))
|
|
39
|
+
.toJSON();
|
|
40
|
+
expect(formatString(tree)).toMatchSnapshot();
|
|
41
|
+
});
|
|
42
|
+
it('mid-grid default render - should wrap in ContentLayout with nested Container structure', () => {
|
|
43
|
+
const tree = react_test_renderer_1.default
|
|
44
|
+
.create(react_1.default.createElement(index_1.default, { content: { url, dataLayout: 'mid-grid' } }))
|
|
45
|
+
.toJSON();
|
|
46
|
+
expect(formatString(tree)).toMatchSnapshot();
|
|
47
|
+
});
|
|
48
|
+
it('edge case: custom dataLayout value should wrap in ContentLayout', () => {
|
|
49
|
+
const tree = react_test_renderer_1.default
|
|
50
|
+
.create(react_1.default.createElement(index_1.default, { content: { url, dataLayout: 'custom-layout' } }))
|
|
51
|
+
.toJSON();
|
|
52
|
+
expect(formatString(tree)).toMatchSnapshot();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
29
55
|
it('in-line render', () => {
|
|
30
56
|
const tree = react_test_renderer_1.default
|
|
31
57
|
.create(react_1.default.createElement(index_1.default, { content: { url, dataLayout: 'in-line' } }))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.spec.js","sourceRoot":"","sources":["../../../../../src/components/content-tree/Clip/test/snapshot.spec.tsx"],"names":[],"mappings":";;;;;AAAA,6DAA6D;AAC7D,cAAc;AACd,kDAAyB;AACzB,gFAAgF;AAChF,iDAAiD;AACjD,8EAA0C;AAC1C,wDAA+B;AAC/B,+BAAkC;AAClC,IAAI,OAAO,MAAM,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC;IAC9C,MAAM,CAAC,WAAW,GAAG,kBAAW,CAAA;AAClC,CAAC;AACD,8DAA0C;AAE1C,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,EAAE,CAC5B,kBAAQ,CAAC,MAAM,CAAC,IAAI,EAAE;IACpB,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,EAAE,EAAE,oCAAoC;IACpD,QAAQ,EAAE,CAAC,EAAE,mCAAmC;IAChD,OAAO,EAAE,KAAK,EAAE,6BAA6B;IAC7C,iCAAiC;CAClC,CAAC,CAAA;AAEJ,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;QAC5C,MAAM,GAAG,GAAG,8BAA8B,CAAA;QAC1C,MAAM,MAAM,GAAG,+BAA+B,CAAA;QAE9C,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE;YACxB,MAAM,IAAI,GAAG,6BAAQ;iBAClB,MAAM,CACL,8BAAC,eAAU,IAAC,OAAO,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,GAAe,CACnE;iBACA,MAAM,EAAE,CAAA;YACX,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE,CAAA;QAC9C,CAAC,CAAC,CAAA;QACF,EAAE,CA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AG,6BAAQ;iBACzB,MAAM,CAAC,8BAAC,eAAU,OAAK,qBAAqB,GAAI,CAAC;iBACjD,MAAM,EAAE,CAAA;YAEX,MAAM,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QAC5C,CAAC,CAAC,CAAA;QACF,mEAAmE;QACnE,EAAE,CAAC,yEAAyE,EAAE,GAAG,EAAE;YACjF,MAAM,IAAI,GAAG,6BAAQ;iBAClB,MAAM,CACL,8BAAC,eAAU,IACT,OAAO,EAAE;oBACP,GAAG;oBACH,UAAU,EAAE,WAAW;oBACvB,QAAQ,EAAE,IAAI;oBACd,IAAI,EAAE,IAAI;oBACV,WAAW,EAAE,mBAAmB;oBAChC,OAAO,EAAE,cAAc;oBACvB,OAAO,EAAE,UAAU;oBACnB,oBAAoB;oBACpB,MAAM,EACJ,mOAAmO;oBACrO,SAAS,EAAE,aAAa;oBACxB,KAAK,EAAE,IAAI;iBACZ,GACW,CACf;iBACA,MAAM,EAAE,CAAA;YACX,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE,CAAA;QAC9C,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"snapshot.spec.js","sourceRoot":"","sources":["../../../../../src/components/content-tree/Clip/test/snapshot.spec.tsx"],"names":[],"mappings":";;;;;AAAA,6DAA6D;AAC7D,cAAc;AACd,kDAAyB;AACzB,gFAAgF;AAChF,iDAAiD;AACjD,8EAA0C;AAC1C,wDAA+B;AAC/B,+BAAkC;AAClC,IAAI,OAAO,MAAM,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC;IAC9C,MAAM,CAAC,WAAW,GAAG,kBAAW,CAAA;AAClC,CAAC;AACD,8DAA0C;AAE1C,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,EAAE,CAC5B,kBAAQ,CAAC,MAAM,CAAC,IAAI,EAAE;IACpB,MAAM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oBACrO,SAAS,EAAE,aAAa;oBACxB,KAAK,EAAE,IAAI;iBACZ,GACW,CACf;iBACA,MAAM,EAAE,CAAA;YACX,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,EAAE,CAAA;QAC9C,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/cp-content-pipeline-ui",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.13.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@babel/preset-env": "^7.22.5",
|
|
17
17
|
"@babel/preset-react": "^7.22.5",
|
|
18
|
+
"@dotcom-tool-kit/npm": "^5.0.0",
|
|
18
19
|
"@financial-times/content-tree": "github:financial-times/content-tree#3f77ec4",
|
|
19
|
-
"@financial-times/cp-content-pipeline-client": "^4.20.
|
|
20
|
-
"@financial-times/cp-content-pipeline-schema": "^3.
|
|
20
|
+
"@financial-times/cp-content-pipeline-client": "^4.20.2",
|
|
21
|
+
"@financial-times/cp-content-pipeline-schema": "^3.21.0",
|
|
21
22
|
"@financial-times/cp-content-pipeline-styles": "^4.5.0",
|
|
22
23
|
"@financial-times/n-scrollytelling-image": "^1.1.0",
|
|
23
24
|
"@financial-times/o-grid": "^6.1.8",
|
|
@@ -50,7 +51,6 @@
|
|
|
50
51
|
"webpack": "^5.88.1"
|
|
51
52
|
},
|
|
52
53
|
"dependencies": {
|
|
53
|
-
"@dotcom-tool-kit/npm": "^5.0.0",
|
|
54
54
|
"@financial-times/ft-date-format": "^2.1.0",
|
|
55
55
|
"@financial-times/o-expander": "^7.0.1",
|
|
56
56
|
"@financial-times/o-labels": "^7.1.2",
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import classnames from 'classnames'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The available layout widths for the Layout component.
|
|
6
|
+
*
|
|
7
|
+
* Available options:
|
|
8
|
+
* - `in-line` - [Default] 7 columns (700 pixels)
|
|
9
|
+
* - `full-width` - Legacy alias for `in-line`
|
|
10
|
+
* - `mid-grid` - 9 columns (900 pixels)
|
|
11
|
+
* - `full-grid` - 12 columns of the grid (1200 pixels)
|
|
12
|
+
*
|
|
13
|
+
* @todo Existing layouts not currently supported by this component. To be implemented in the future:
|
|
14
|
+
* @todo `inset-left` - 5 columns (up to 500 pixels), medium screens and above: 3 columns (300 pixels), float left
|
|
15
|
+
* @todo `inset-right` - 5 columns (up to 500 pixels), medium screens and above: 3 columns (300 pixels), float right
|
|
16
|
+
* @todo `full-bleed` - Edge to edge of the viewport, no padding
|
|
17
|
+
* @todo The terminology in Spark doesn't align with our terminology. For instance, Editorial uses `full-width` that we map to `full-grid`. We should likely move towards an ubiquitous language prioritising the Editorial one.
|
|
18
|
+
*/
|
|
19
|
+
type LayoutWidth = 'in-line' | 'mid-grid' | 'full-grid'
|
|
20
|
+
|
|
21
|
+
interface ContentLayoutProps {
|
|
22
|
+
dataLayout: LayoutWidth
|
|
23
|
+
dataComponent?: string
|
|
24
|
+
className?: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/*
|
|
28
|
+
* @description OverflowingLayout component prevent clashes with ads on the RHR (Righthand-rail) and share bar
|
|
29
|
+
* via the usage of data-layout-width='full-grid'
|
|
30
|
+
* See related code here: https://github.com/Financial-Times/next-article/blob/5766d82de6125ffc99fa6e3bc132311b3434f8f0/client/components/share/main.js#L8
|
|
31
|
+
*/
|
|
32
|
+
const OverflowingLayout: React.FC<{ children: React.ReactNode }> = ({
|
|
33
|
+
children,
|
|
34
|
+
}) => (
|
|
35
|
+
<div className="n-content-layout" data-layout-width="full-grid">
|
|
36
|
+
{children}
|
|
37
|
+
</div>
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
/*
|
|
41
|
+
* @description ContentLayout component is used to fulfill the legacy usage of n-layout.
|
|
42
|
+
* @param dataLayout - The layout type of the content (e.g., 'full-grid', 'mid-grid', etc.).
|
|
43
|
+
* @param dataComponent - The component type used as data-component attribute for client-side targeting.
|
|
44
|
+
*/
|
|
45
|
+
export const ContentLayout: React.FC<
|
|
46
|
+
React.PropsWithChildren<ContentLayoutProps>
|
|
47
|
+
> = ({
|
|
48
|
+
dataLayout = 'in-line',
|
|
49
|
+
children,
|
|
50
|
+
dataComponent = '',
|
|
51
|
+
className = '',
|
|
52
|
+
}) => {
|
|
53
|
+
const ContainerClassNames = classnames(
|
|
54
|
+
'n-content-layout__container',
|
|
55
|
+
className
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
if (dataLayout === 'full-grid') {
|
|
59
|
+
return (
|
|
60
|
+
<OverflowingLayout>
|
|
61
|
+
<div className={ContainerClassNames} data-component={dataComponent}>
|
|
62
|
+
{children}
|
|
63
|
+
</div>
|
|
64
|
+
</OverflowingLayout>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (dataLayout === 'mid-grid') {
|
|
69
|
+
return (
|
|
70
|
+
<OverflowingLayout>
|
|
71
|
+
<div className={ContainerClassNames} data-component={dataComponent}>
|
|
72
|
+
<div
|
|
73
|
+
data-o-grid-colspan="12 S12 M12 L10 XL10"
|
|
74
|
+
className="n-content-layout__container--mid-grid"
|
|
75
|
+
>
|
|
76
|
+
{children}
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</OverflowingLayout>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<div
|
|
85
|
+
className="n-content-layout__container--in-line"
|
|
86
|
+
data-component={dataComponent}
|
|
87
|
+
>
|
|
88
|
+
{children}
|
|
89
|
+
</div>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`ContentLayout Edge cases handles conditional children 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
className="n-content-layout"
|
|
6
|
+
data-layout-width="full-grid"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
className="n-content-layout__container"
|
|
10
|
+
data-component="clip-set"
|
|
11
|
+
>
|
|
12
|
+
<div>
|
|
13
|
+
<div>
|
|
14
|
+
Conditional content
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<div />
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
exports[`ContentLayout Edge cases handles empty children 1`] = `
|
|
23
|
+
<div
|
|
24
|
+
className="n-content-layout"
|
|
25
|
+
data-layout-width="full-grid"
|
|
26
|
+
>
|
|
27
|
+
<div
|
|
28
|
+
className="n-content-layout__container"
|
|
29
|
+
data-component="clip-set"
|
|
30
|
+
>
|
|
31
|
+
<div />
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
exports[`ContentLayout Edge cases handles null children 1`] = `
|
|
37
|
+
<div
|
|
38
|
+
className="n-content-layout"
|
|
39
|
+
data-layout-width="full-grid"
|
|
40
|
+
>
|
|
41
|
+
<div
|
|
42
|
+
className="n-content-layout__container"
|
|
43
|
+
data-component="clip-set"
|
|
44
|
+
>
|
|
45
|
+
<div />
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
exports[`ContentLayout renders full-grid layout with container correctly 1`] = `
|
|
51
|
+
<div
|
|
52
|
+
className="n-content-layout"
|
|
53
|
+
data-layout-width="full-grid"
|
|
54
|
+
>
|
|
55
|
+
<div
|
|
56
|
+
className="n-content-layout__container"
|
|
57
|
+
data-component="clip-set"
|
|
58
|
+
>
|
|
59
|
+
<div>
|
|
60
|
+
Test content
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
exports[`ContentLayout renders in-line layout with container correctly 1`] = `
|
|
67
|
+
<div
|
|
68
|
+
className="n-content-layout__container--in-line"
|
|
69
|
+
data-component="clip-set"
|
|
70
|
+
>
|
|
71
|
+
<div>
|
|
72
|
+
Test content
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
`;
|
|
76
|
+
|
|
77
|
+
exports[`ContentLayout renders mid-grid layout with container correctly 1`] = `
|
|
78
|
+
<div
|
|
79
|
+
className="n-content-layout"
|
|
80
|
+
data-layout-width="full-grid"
|
|
81
|
+
>
|
|
82
|
+
<div
|
|
83
|
+
className="n-content-layout__container"
|
|
84
|
+
data-component="clip-set"
|
|
85
|
+
>
|
|
86
|
+
<div
|
|
87
|
+
className="n-content-layout__container--mid-grid"
|
|
88
|
+
data-o-grid-colspan="12 S12 M12 L10 XL10"
|
|
89
|
+
>
|
|
90
|
+
<div>
|
|
91
|
+
Test content
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
`;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import renderer from 'react-test-renderer'
|
|
3
|
+
import { ContentLayout } from '../index'
|
|
4
|
+
|
|
5
|
+
describe('ContentLayout', () => {
|
|
6
|
+
it('renders full-grid layout with container correctly', () => {
|
|
7
|
+
const tree = renderer
|
|
8
|
+
.create(
|
|
9
|
+
<ContentLayout dataLayout="full-grid" dataComponent="clip-set">
|
|
10
|
+
<div>Test content</div>
|
|
11
|
+
</ContentLayout>
|
|
12
|
+
)
|
|
13
|
+
.toJSON()
|
|
14
|
+
|
|
15
|
+
expect(tree).toMatchSnapshot()
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
it('renders mid-grid layout with container correctly', () => {
|
|
19
|
+
const tree = renderer
|
|
20
|
+
.create(
|
|
21
|
+
<ContentLayout dataLayout="mid-grid" dataComponent="clip-set">
|
|
22
|
+
<div>Test content</div>
|
|
23
|
+
</ContentLayout>
|
|
24
|
+
)
|
|
25
|
+
.toJSON()
|
|
26
|
+
|
|
27
|
+
expect(tree).toMatchSnapshot()
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it('renders in-line layout with container correctly', () => {
|
|
31
|
+
const tree = renderer
|
|
32
|
+
.create(
|
|
33
|
+
<ContentLayout dataLayout="in-line" dataComponent="clip-set">
|
|
34
|
+
<div>Test content</div>
|
|
35
|
+
</ContentLayout>
|
|
36
|
+
)
|
|
37
|
+
.toJSON()
|
|
38
|
+
|
|
39
|
+
expect(tree).toMatchSnapshot()
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
describe('Edge cases', () => {
|
|
43
|
+
it('handles empty children', () => {
|
|
44
|
+
const tree = renderer
|
|
45
|
+
.create(
|
|
46
|
+
<ContentLayout dataLayout="full-grid" dataComponent="clip-set">
|
|
47
|
+
<div></div>
|
|
48
|
+
</ContentLayout>
|
|
49
|
+
)
|
|
50
|
+
.toJSON()
|
|
51
|
+
|
|
52
|
+
expect(tree).toMatchSnapshot()
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it('handles null children', () => {
|
|
56
|
+
const tree = renderer
|
|
57
|
+
.create(
|
|
58
|
+
<ContentLayout dataLayout="full-grid" dataComponent="clip-set">
|
|
59
|
+
<div>{null}</div>
|
|
60
|
+
</ContentLayout>
|
|
61
|
+
)
|
|
62
|
+
.toJSON()
|
|
63
|
+
|
|
64
|
+
expect(tree).toMatchSnapshot()
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it('handles conditional children', () => {
|
|
68
|
+
const showContent = true
|
|
69
|
+
const tree = renderer
|
|
70
|
+
.create(
|
|
71
|
+
<ContentLayout dataLayout="full-grid" dataComponent="clip-set">
|
|
72
|
+
<div>{showContent && <div>Conditional content</div>}</div>
|
|
73
|
+
<div>{!showContent && <div>Alternative content</div>}</div>
|
|
74
|
+
</ContentLayout>
|
|
75
|
+
)
|
|
76
|
+
.toJSON()
|
|
77
|
+
|
|
78
|
+
expect(tree).toMatchSnapshot()
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
})
|
|
@@ -3,6 +3,4 @@ export { Caption } from './Caption'
|
|
|
3
3
|
export { VideoInfoBox } from './VideoInfoBox'
|
|
4
4
|
export { ClosedCaptions } from './ClosedCaptions'
|
|
5
5
|
export { VideoDescription } from './VideoDescription'
|
|
6
|
-
export { Container } from './Container'
|
|
7
|
-
export { ContentLayout } from './ContentLayout'
|
|
8
6
|
export { ClipTag } from './ClipTag'
|