@financial-times/cp-content-pipeline-ui 1.4.2-beta.1 → 1.4.2
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/.babelrc.json +0 -1
- package/CHANGELOG.md +19 -0
- package/README.md +1 -0
- package/jest.config.js +1 -18
- package/lib/components/Clip/index.d.ts +1 -1
- package/lib/components/Clip/index.js +2 -5
- package/lib/components/Clip/index.js.map +1 -1
- package/lib/components/Recommended/index.d.ts +1 -1
- package/lib/components/Recommended/index.js +3 -0
- package/lib/components/Recommended/index.js.map +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -3
- package/lib/index.js.map +1 -1
- package/package.json +5 -8
- package/src/components/Clip/clip.d.ts +16 -0
- package/src/components/Clip/index.tsx +1 -1
- package/src/components/Recommended/index.tsx +4 -0
- package/src/index.ts +0 -1
- package/src/stories/Clip.stories.js +43 -0
- package/src/stories/Clip.stories.scss +1 -311
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/client.d.ts +0 -1
- package/lib/client.js +0 -9
- package/lib/client.js.map +0 -1
- package/lib/components/Clip/client/index.d.ts +0 -117
- package/lib/components/Clip/client/index.js +0 -856
- package/lib/components/Clip/client/index.js.map +0 -1
- package/lib/components/Clip/client/progressBar.d.ts +0 -46
- package/lib/components/Clip/client/progressBar.js +0 -205
- package/lib/components/Clip/client/progressBar.js.map +0 -1
- package/lib/components/Clip/client/utils.d.ts +0 -5
- package/lib/components/Clip/client/utils.js +0 -89
- package/lib/components/Clip/client/utils.js.map +0 -1
- package/lib/components/Clip/template/component.d.ts +0 -16
- package/lib/components/Clip/template/component.js +0 -74
- package/lib/components/Clip/template/component.js.map +0 -1
- package/lib/components/Clip/template/index.d.ts +0 -3
- package/lib/components/Clip/template/index.js +0 -17
- package/lib/components/Clip/template/index.js.map +0 -1
- package/lib/components/Clip/test/fixtures.d.ts +0 -2
- package/lib/components/Clip/test/fixtures.js +0 -29
- package/lib/components/Clip/test/fixtures.js.map +0 -1
- package/lib/components/Clip/test/index.spec.d.ts +0 -1
- package/lib/components/Clip/test/index.spec.js +0 -793
- package/lib/components/Clip/test/index.spec.js.map +0 -1
- package/lib/components/Clip/test/progressBar.spec.d.ts +0 -1
- package/lib/components/Clip/test/progressBar.spec.js +0 -176
- package/lib/components/Clip/test/progressBar.spec.js.map +0 -1
- package/lib/components/Clip/test/snapshot.spec.d.ts +0 -1
- package/lib/components/Clip/test/snapshot.spec.js +0 -65
- package/lib/components/Clip/test/snapshot.spec.js.map +0 -1
- package/lib/stories/Clip.stories.d.ts +0 -58
- package/lib/stories/Clip.stories.js +0 -124
- package/lib/stories/Clip.stories.js.map +0 -1
- package/src/client.ts +0 -1
- package/src/components/Clip/client/index.ts +0 -1000
- package/src/components/Clip/client/main.scss +0 -353
- package/src/components/Clip/client/progressBar.scss +0 -89
- package/src/components/Clip/client/progressBar.ts +0 -239
- package/src/components/Clip/client/utils.ts +0 -93
- package/src/components/Clip/template/component.tsx +0 -191
- package/src/components/Clip/template/index.ts +0 -13
- package/src/components/Clip/test/__snapshots__/snapshot.spec.tsx.snap +0 -403
- package/src/components/Clip/test/fixtures.ts +0 -27
- package/src/components/Clip/test/index.spec.ts +0 -905
- package/src/components/Clip/test/progressBar.spec.ts +0 -168
- package/src/components/Clip/test/snapshot.spec.tsx +0 -103
- package/src/stories/Clip.stories.tsx +0 -241
- package/src/types/o-types.d.ts +0 -2
package/.babelrc.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -328,6 +328,25 @@
|
|
|
328
328
|
* @financial-times/cp-content-pipeline-client bumped from ^1.3.5 to ^1.3.6
|
|
329
329
|
* @financial-times/cp-content-pipeline-schema bumped from ^1.3.2 to ^1.3.3
|
|
330
330
|
|
|
331
|
+
### Dependencies
|
|
332
|
+
|
|
333
|
+
* The following workspace dependencies were updated
|
|
334
|
+
* devDependencies
|
|
335
|
+
* @financial-times/cp-content-pipeline-client bumped from ^1.3.6 to ^1.3.7
|
|
336
|
+
* @financial-times/cp-content-pipeline-schema bumped from ^1.3.3 to ^1.3.4
|
|
337
|
+
|
|
338
|
+
## [1.4.2](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-ui-v1.3.6...cp-content-pipeline-ui-v1.4.2) (2023-09-18)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
### Features
|
|
342
|
+
|
|
343
|
+
* don't render recommended if it has no teaser ([7365c88](https://github.com/Financial-Times/cp-content-pipeline/commit/7365c8851c5412074c613087aa338e72e3b55524))
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
### Miscellaneous Chores
|
|
347
|
+
|
|
348
|
+
* trigger release ([dcd9e55](https://github.com/Financial-Times/cp-content-pipeline/commit/dcd9e557137de11573c32fe9ca2870e21be14ac4))
|
|
349
|
+
|
|
331
350
|
## [1.3.5](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-ui-v1.3.4...cp-content-pipeline-ui-v1.3.5) (2023-09-14)
|
|
332
351
|
|
|
333
352
|
|
package/README.md
CHANGED
package/jest.config.js
CHANGED
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
const base = require('../../jest.config.base.js')
|
|
2
|
+
|
|
2
3
|
module.exports = {
|
|
3
4
|
...base,
|
|
4
5
|
testEnvironment: 'jsdom',
|
|
5
|
-
transformIgnorePatterns: [
|
|
6
|
-
// Need to transform all node from the FT
|
|
7
|
-
"/node_modules/(?!@financial-times)"
|
|
8
|
-
],
|
|
9
|
-
transform: {
|
|
10
|
-
...base.transform,
|
|
11
|
-
'.(js)': '@sucrase/jest-plugin'
|
|
12
|
-
},
|
|
13
|
-
moduleNameMapper: {
|
|
14
|
-
...base.moduleNameMapper,
|
|
15
|
-
'^@financial-times/o-expander$':
|
|
16
|
-
'<rootDir>/../../node_modules/@financial-times/o-expander/main.js',
|
|
17
|
-
'^@financial-times/o-viewport$':
|
|
18
|
-
'<rootDir>/../../node_modules/@financial-times/o-viewport/main.js',
|
|
19
|
-
}
|
|
20
|
-
,
|
|
21
|
-
maxWorkers: '50%', // Adjust the number based on your CircleCI resources
|
|
22
|
-
|
|
23
6
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import ClipComponent from '
|
|
1
|
+
import { ClipComponent } from '@financial-times/n-clip/server/index.cjs';
|
|
2
2
|
export default ClipComponent;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
exports.default =
|
|
3
|
+
const index_cjs_1 = require("@financial-times/n-clip/server/index.cjs");
|
|
4
|
+
exports.default = index_cjs_1.ClipComponent;
|
|
8
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Clip/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Clip/index.tsx"],"names":[],"mappings":";;AAAA,wEAAwE;AAExE,kBAAe,yBAAa,CAAA"}
|
|
@@ -6,4 +6,4 @@ import type { RecommendedFragment } from '@financial-times/cp-content-pipeline-c
|
|
|
6
6
|
* `<Teaser>` is imported from x-dash
|
|
7
7
|
* https://github.com/Financial-Times/x-dash/tree/main/components/x-teaser)
|
|
8
8
|
*/
|
|
9
|
-
export default function Recommended({ heading, teaser, }: ContentTree.Recommended & RecommendedFragment): React.JSX.Element;
|
|
9
|
+
export default function Recommended({ heading, teaser, }: ContentTree.Recommended & RecommendedFragment): React.JSX.Element | null;
|
|
@@ -12,6 +12,9 @@ const Teaser_cjs_1 = require("@financial-times/x-teaser/dist/Teaser.cjs");
|
|
|
12
12
|
* https://github.com/Financial-Times/x-dash/tree/main/components/x-teaser)
|
|
13
13
|
*/
|
|
14
14
|
function Recommended({ heading, teaser, }) {
|
|
15
|
+
if (!teaser) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
15
18
|
return (react_1.default.createElement("aside", { "aria-labelledby": "aside-label", className: "n-content-recommended--single-story" },
|
|
16
19
|
react_1.default.createElement("p", { className: "n-content-recommended__title" }, heading),
|
|
17
20
|
react_1.default.createElement(Teaser_cjs_1.Teaser, { modifiers: ['stacked'], ...Teaser_cjs_1.presets.SmallHeavy, ...teaser })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Recommended/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,6EAA6E;AAC7E,0EAA2E;AAI3E;;;;GAIG;AACH,SAAwB,WAAW,CAAC,EAClC,OAAO,EACP,MAAM,GACwC;IAC9C,OAAO,CACL,4DACkB,aAAa,EAC7B,SAAS,EAAC,qCAAqC;QAE/C,qCAAG,SAAS,EAAC,8BAA8B,IAAE,OAAO,CAAK;QACzD,8BAAC,mBAAM,IAAC,SAAS,EAAE,CAAC,SAAS,CAAC,KAAM,oBAAO,CAAC,UAAU,KAAM,MAAM,GAAI,CAChE,CACT,CAAA;AACH,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Recommended/index.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,6EAA6E;AAC7E,0EAA2E;AAI3E;;;;GAIG;AACH,SAAwB,WAAW,CAAC,EAClC,OAAO,EACP,MAAM,GACwC;IAC9C,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,CACL,4DACkB,aAAa,EAC7B,SAAS,EAAC,qCAAqC;QAE/C,qCAAG,SAAS,EAAC,8BAA8B,IAAE,OAAO,CAAK;QACzD,8BAAC,mBAAM,IAAC,SAAS,EAAE,CAAC,SAAS,CAAC,KAAM,oBAAO,CAAC,UAAU,KAAM,MAAM,GAAI,CAChE,CACT,CAAA;AACH,CAAC;AAjBD,8BAiBC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -16,4 +16,3 @@ export { default as Heading } from './components/Heading';
|
|
|
16
16
|
export { default as Table } from './components/Table';
|
|
17
17
|
export { default as Paragraph } from './components/Paragraph';
|
|
18
18
|
export { List, ListItem, Link, Blockquote, LineBreak, HorizontalRule, Emphasis, Strong, Strikethrough, } from './components/RichText/BasicComponents';
|
|
19
|
-
export { default as Clip } from './components/Clip/template/component';
|
package/lib/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.Strikethrough = exports.Strong = exports.Emphasis = exports.HorizontalRule = exports.LineBreak = exports.Blockquote = exports.Link = exports.ListItem = exports.List = exports.Paragraph = exports.Table = exports.Heading = exports.Tweet = exports.Pullquote = exports.Flourish = exports.RichText = exports.Recommended = exports.LayoutSlot = exports.LayoutContainer = exports.Layout = exports.ImageSet = exports.MainImage = exports.Byline = exports.ArticleInfo = exports.Topper = exports.LiveBlogBody = exports.ArticleBody = exports.Body = void 0;
|
|
7
7
|
var Body_1 = require("./components/Body");
|
|
8
8
|
Object.defineProperty(exports, "Body", { enumerable: true, get: function () { return __importDefault(Body_1).default; } });
|
|
9
9
|
var ArticleBody_1 = require("./components/ArticleBody");
|
|
@@ -50,6 +50,4 @@ Object.defineProperty(exports, "HorizontalRule", { enumerable: true, get: functi
|
|
|
50
50
|
Object.defineProperty(exports, "Emphasis", { enumerable: true, get: function () { return BasicComponents_1.Emphasis; } });
|
|
51
51
|
Object.defineProperty(exports, "Strong", { enumerable: true, get: function () { return BasicComponents_1.Strong; } });
|
|
52
52
|
Object.defineProperty(exports, "Strikethrough", { enumerable: true, get: function () { return BasicComponents_1.Strikethrough; } });
|
|
53
|
-
var component_1 = require("./components/Clip/template/component");
|
|
54
|
-
Object.defineProperty(exports, "Clip", { enumerable: true, get: function () { return __importDefault(component_1).default; } });
|
|
55
53
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAmD;AAA1C,6GAAA,OAAO,OAAQ;AACxB,wDAAiE;AAAxD,2HAAA,OAAO,OAAe;AAC/B,0DAAmE;AAA1D,6HAAA,OAAO,OAAgB;AAChC,8CAAuD;AAA9C,iHAAA,OAAO,OAAU;AAC1B,wDAAiE;AAAxD,2HAAA,OAAO,OAAe;AAC/B,8CAAuD;AAA9C,iHAAA,OAAO,OAAU;AAC1B,oDAA6D;AAApD,uHAAA,OAAO,OAAa;AAC7B,kDAA2D;AAAlD,qHAAA,OAAO,OAAY;AAC5B,8CAAyE;AAAhE,gGAAA,MAAM,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,oGAAA,UAAU,OAAA;AAC5C,wDAAiE;AAAxD,2HAAA,OAAO,OAAe;AAC/B,kDAA2D;AAAlD,qHAAA,OAAO,OAAY;AAC5B,kDAA2D;AAAlD,qHAAA,OAAO,OAAY;AAC5B,sDAAmE;AAA1D,mHAAA,OAAO,OAAa;AAC7B,4CAAqD;AAA5C,+GAAA,OAAO,OAAS;AACzB,gDAAyD;AAAhD,mHAAA,OAAO,OAAW;AAC3B,4CAAqD;AAA5C,+GAAA,OAAO,OAAS;AACzB,oDAA6D;AAApD,uHAAA,OAAO,OAAa;AAC7B,yEAU8C;AAT5C,uGAAA,IAAI,OAAA;AACJ,2GAAA,QAAQ,OAAA;AACR,uGAAA,IAAI,OAAA;AACJ,6GAAA,UAAU,OAAA;AACV,4GAAA,SAAS,OAAA;AACT,iHAAA,cAAc,OAAA;AACd,2GAAA,QAAQ,OAAA;AACR,yGAAA,MAAM,OAAA;AACN,gHAAA,aAAa,OAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,0CAAmD;AAA1C,6GAAA,OAAO,OAAQ;AACxB,wDAAiE;AAAxD,2HAAA,OAAO,OAAe;AAC/B,0DAAmE;AAA1D,6HAAA,OAAO,OAAgB;AAChC,8CAAuD;AAA9C,iHAAA,OAAO,OAAU;AAC1B,wDAAiE;AAAxD,2HAAA,OAAO,OAAe;AAC/B,8CAAuD;AAA9C,iHAAA,OAAO,OAAU;AAC1B,oDAA6D;AAApD,uHAAA,OAAO,OAAa;AAC7B,kDAA2D;AAAlD,qHAAA,OAAO,OAAY;AAC5B,8CAAyE;AAAhE,gGAAA,MAAM,OAAA;AAAE,yGAAA,eAAe,OAAA;AAAE,oGAAA,UAAU,OAAA;AAC5C,wDAAiE;AAAxD,2HAAA,OAAO,OAAe;AAC/B,kDAA2D;AAAlD,qHAAA,OAAO,OAAY;AAC5B,kDAA2D;AAAlD,qHAAA,OAAO,OAAY;AAC5B,sDAAmE;AAA1D,mHAAA,OAAO,OAAa;AAC7B,4CAAqD;AAA5C,+GAAA,OAAO,OAAS;AACzB,gDAAyD;AAAhD,mHAAA,OAAO,OAAW;AAC3B,4CAAqD;AAA5C,+GAAA,OAAO,OAAS;AACzB,oDAA6D;AAApD,uHAAA,OAAO,OAAa;AAC7B,yEAU8C;AAT5C,uGAAA,IAAI,OAAA;AACJ,2GAAA,QAAQ,OAAA;AACR,uGAAA,IAAI,OAAA;AACJ,6GAAA,UAAU,OAAA;AACV,4GAAA,SAAS,OAAA;AACT,iHAAA,cAAc,OAAA;AACd,2GAAA,QAAQ,OAAA;AACR,yGAAA,MAAM,OAAA;AACN,gHAAA,aAAa,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@financial-times/cp-content-pipeline-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
"@babel/preset-react": "^7.22.5",
|
|
18
18
|
"@dotcom-tool-kit/npm": "^3.1.0",
|
|
19
19
|
"@financial-times/content-tree": "github:financial-times/content-tree#14370e3",
|
|
20
|
-
"@financial-times/cp-content-pipeline-client": "^1.3.
|
|
21
|
-
"@financial-times/cp-content-pipeline-schema": "^1.3.
|
|
20
|
+
"@financial-times/cp-content-pipeline-client": "^1.3.7",
|
|
21
|
+
"@financial-times/cp-content-pipeline-schema": "^1.3.4",
|
|
22
22
|
"@financial-times/n-scrollytelling-image": "^1.1.0",
|
|
23
23
|
"@financial-times/o-colors": "^6.6.2",
|
|
24
24
|
"@financial-times/o-expander": "^6.2.6",
|
|
25
25
|
"@financial-times/o-grid": "^6.1.5",
|
|
26
|
-
"@financial-times/o-icons": "^7.
|
|
26
|
+
"@financial-times/o-icons": "^7.6.0",
|
|
27
27
|
"@financial-times/o-spacing": "^3.2.3",
|
|
28
28
|
"@financial-times/o-tracking": "^4.5.0",
|
|
29
29
|
"@financial-times/o-typography": "^7.4.1",
|
|
@@ -35,18 +35,15 @@
|
|
|
35
35
|
"@storybook/react": "^7.0.24",
|
|
36
36
|
"@storybook/react-webpack5": "^7.0.24",
|
|
37
37
|
"@storybook/testing-library": "^0.2.0",
|
|
38
|
-
"@sucrase/jest-plugin": "^3.0.0",
|
|
39
38
|
"@testing-library/react": "^13.3.0",
|
|
40
|
-
"@testing-library/user-event": "^14.4.3",
|
|
41
39
|
"@types/financial-times__n-scrollytelling-image": "0.0.0",
|
|
42
40
|
"@types/react": "^18.0.15",
|
|
43
41
|
"eslint-plugin-react": "^7.30.1",
|
|
44
|
-
"jest-environment-jsdom": "^29.6.1",
|
|
45
42
|
"n-content-body": "^14.4.0",
|
|
46
43
|
"prop-types": "^15.8.1",
|
|
44
|
+
"jest-environment-jsdom": "^29.6.1",
|
|
47
45
|
"react": "^18.2.0",
|
|
48
46
|
"react-dom": "^18.2.0",
|
|
49
|
-
"react-test-renderer": "^18.2.0",
|
|
50
47
|
"sass": "^1.63.6",
|
|
51
48
|
"storybook": "^7.0.24",
|
|
52
49
|
"webpack": "^5.88.1"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare module '@financial-times/n-clip/server/index.cjs' {
|
|
2
|
+
export interface Props {
|
|
3
|
+
url: string
|
|
4
|
+
autoplay: boolean
|
|
5
|
+
loop: boolean
|
|
6
|
+
credits: string
|
|
7
|
+
poster: string
|
|
8
|
+
posterAlt: string
|
|
9
|
+
posterCredits: string
|
|
10
|
+
dataLayout: string
|
|
11
|
+
description: string
|
|
12
|
+
muted: boolean
|
|
13
|
+
caption: string
|
|
14
|
+
}
|
|
15
|
+
export function ClipComponent(props: Props): JSX.Element
|
|
16
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import ClipServer from '../components/Clip'
|
|
2
|
+
import ClipClient from '@financial-times/n-clip'
|
|
3
|
+
import React, { useEffect } from 'react'
|
|
4
|
+
import oTracking from '@financial-times/o-tracking/main'
|
|
5
|
+
import './Clip.stories.scss'
|
|
6
|
+
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Clip',
|
|
9
|
+
component: ClipServer,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: {
|
|
12
|
+
dataLayout: {
|
|
13
|
+
options: ['in-line', 'full-grid', 'mid-grid'],
|
|
14
|
+
control: { type: 'radio' },
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
export const Inline = (args) => {
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
oTracking.init({
|
|
21
|
+
context: { product: 'next' },
|
|
22
|
+
test: true,
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
ClipClient.init()
|
|
26
|
+
return () => {
|
|
27
|
+
ClipClient.unload()
|
|
28
|
+
}
|
|
29
|
+
}, [])
|
|
30
|
+
return <div className='n-content-body'><ClipServer {...args} /></div>
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
34
|
+
Inline.args = {
|
|
35
|
+
url: 'https://next-media-api.ft.com/renditions/16777586039370/1280x720.mp4',
|
|
36
|
+
credits: 'FT',
|
|
37
|
+
poster:
|
|
38
|
+
'https://d1e00ek4ebabms.cloudfront.net/staging/52d850f7-99e0-44c4-b069-cd6d1284565f.jpg',
|
|
39
|
+
alt: 'Civilians hug Ukrainian soldiers in Balakliya town square',
|
|
40
|
+
dataLayout: 'in-line',
|
|
41
|
+
description:
|
|
42
|
+
"A lightning assault by Ukrainian forces in the first half of September decimated Russia's defences in north-eastern Ukraine.",
|
|
43
|
+
}
|
|
@@ -1,309 +1,3 @@
|
|
|
1
|
-
// Load fonts for demos that we rely on being in the consuming apps
|
|
2
|
-
@import '@financial-times/o-fonts/main';
|
|
3
|
-
@include oFonts($opts: ('recommended': true));
|
|
4
|
-
|
|
5
|
-
body {
|
|
6
|
-
overflow-x: hidden;
|
|
7
|
-
background-color: #fff1e5;
|
|
8
|
-
color: #33302e;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
body,
|
|
12
|
-
figure {
|
|
13
|
-
padding: 0 !important;
|
|
14
|
-
margin: 0 !important;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
$o-brand: 'core';
|
|
18
|
-
$o-typography-load-fonts: false;
|
|
19
|
-
@import "@financial-times/o-typography/main";
|
|
20
|
-
@import '@financial-times/o-normalise/main';
|
|
21
|
-
@import '@financial-times/o-grid/main';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@include oNormalise((
|
|
25
|
-
'body': (
|
|
26
|
-
'font-smoothing'
|
|
27
|
-
),
|
|
28
|
-
));
|
|
29
|
-
|
|
30
|
-
.article__media {
|
|
31
|
-
margin-bottom: 20px;
|
|
32
|
-
|
|
33
|
-
audio,
|
|
34
|
-
video {
|
|
35
|
-
width: 100%;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.n-content-body > .n-content-blockquote,
|
|
40
|
-
.n-content-body > p {
|
|
41
|
-
@include oTypographySans(
|
|
42
|
-
$scale: (
|
|
43
|
-
default: 1,
|
|
44
|
-
XL: 2
|
|
45
|
-
),
|
|
46
|
-
$line-height: 1.6,
|
|
47
|
-
$include-font-family: false
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
//Give a background to responsive graphics so they appear above sticky elements
|
|
52
|
-
.n-content-picture {
|
|
53
|
-
background-color: oColorsByUsecase(page, background);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
//Full bleed elements - amend the positioning to match grid
|
|
57
|
-
.n-content-layout[data-layout-width='full-grid'] {
|
|
58
|
-
@include oGridRespondTo(L) {
|
|
59
|
-
left: calc(50% + 120px);
|
|
60
|
-
z-index: 2; // keep above share button & ads
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Full bleed elements on centered template
|
|
65
|
-
.article-grid--centered {
|
|
66
|
-
.n-content-layout[data-layout-width='full-grid'] {
|
|
67
|
-
@include oGridRespondTo(L) {
|
|
68
|
-
left: 50%;
|
|
69
|
-
z-index: 2; // keep above share button & ads
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// Contains grid container setup, and positioning of elements within the grid.
|
|
76
|
-
|
|
77
|
-
//This file is included in multiple places, so don't include actual CSS
|
|
78
|
-
|
|
79
|
-
@mixin articleGrid() {
|
|
80
|
-
@include oGridContainer();
|
|
81
|
-
max-width: 100%;
|
|
82
|
-
display: flex;
|
|
83
|
-
flex-direction: column;
|
|
84
|
-
|
|
85
|
-
@include oGridRespondTo(L) {
|
|
86
|
-
display: grid;
|
|
87
|
-
grid-template-columns: 40px 40px minmax(500px, 700px) minmax(20px, 1fr) 300px;
|
|
88
|
-
|
|
89
|
-
grid-template-areas: 'lhr . image . rhr-top'
|
|
90
|
-
'lhr . content . rhr-top'
|
|
91
|
-
'lhr . content . rhr-bottom'
|
|
92
|
-
'. . tools . rhr-bottom'
|
|
93
|
-
'more-articles more-articles more-articles more-articles more-articles'
|
|
94
|
-
'. . onward . onward-rhr'
|
|
95
|
-
'. . second-onward . onward-rhr'
|
|
96
|
-
'. . promoted-content . .'
|
|
97
|
-
'. . comments . comments-rhr';
|
|
98
|
-
width: 100%;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@include oGridRespondTo(XL) {
|
|
102
|
-
grid-template-columns: 40px 80px minmax(600px, 700px) minmax(20px, 1fr) 300px;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
@mixin articleGridCentered() {
|
|
107
|
-
@include oGridRespondTo(L) {
|
|
108
|
-
grid-template-columns: 40px 1fr minmax(500px, 700px) 1fr 40px;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
@include oGridRespondTo(XL) {
|
|
112
|
-
grid-template-columns: 1fr 40px minmax(500px, 700px) 40px 1fr;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@mixin liveBlogArticleGrid() {
|
|
117
|
-
@include oGridRespondTo(L) {
|
|
118
|
-
grid-template-areas: 'lhr . content . rhr-top'
|
|
119
|
-
'lhr . content . rhr-bottom'
|
|
120
|
-
'. . comments . comments-rhr';
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
.article-content {
|
|
126
|
-
display: grid;
|
|
127
|
-
grid-template-columns: 100%;
|
|
128
|
-
grid-template-areas: 'topper'
|
|
129
|
-
'article-body';
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.article-grid {
|
|
133
|
-
grid-area: article-body;
|
|
134
|
-
|
|
135
|
-
@include articleGrid();
|
|
136
|
-
margin: 20px auto;
|
|
137
|
-
|
|
138
|
-
.main-image {
|
|
139
|
-
grid-area: image;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.share-nav {
|
|
143
|
-
grid-area: lhr;
|
|
144
|
-
z-index: 7;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.article__content {
|
|
148
|
-
margin-bottom: oSpacingByName('s6');
|
|
149
|
-
grid-area: content;
|
|
150
|
-
max-width: 700px;
|
|
151
|
-
width: 100%;
|
|
152
|
-
position: relative; //so scroll depth tracking works
|
|
153
|
-
@supports (display: grid) {
|
|
154
|
-
max-width: auto;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.article__content-body {
|
|
159
|
-
@include oNormaliseClearfix();
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.article__right {
|
|
163
|
-
grid-area: rhr-top;
|
|
164
|
-
margin: 0 auto;
|
|
165
|
-
width: 100%;
|
|
166
|
-
display: flex;
|
|
167
|
-
flex-direction: column;
|
|
168
|
-
|
|
169
|
-
// Create a stacking context to prevent ad content from setting a z-index that overlays our content
|
|
170
|
-
position: relative;
|
|
171
|
-
z-index: 1;
|
|
172
|
-
|
|
173
|
-
> .sidebar-advert {
|
|
174
|
-
margin-bottom: oSpacingByName('s6');
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
> .sidebar-advert.o-ads-sticky {
|
|
178
|
-
// HACK: @supports (position: sticky) is misreported by MSEdge
|
|
179
|
-
// @supports (-webkit-appearance:none) allows us to target the browsers
|
|
180
|
-
// that do support it more accurately
|
|
181
|
-
// Further details:
|
|
182
|
-
// <https://github.com/Financial-Times/next-article/pull/3466>
|
|
183
|
-
@supports (-webkit-appearance: none) {
|
|
184
|
-
position: sticky;
|
|
185
|
-
top: 80px;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
@include oGridRespondTo($until: L) {
|
|
190
|
-
display: none;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.article__right--live {
|
|
195
|
-
display: flex; // always show it, on mobile as well
|
|
196
|
-
.live-latest,
|
|
197
|
-
.live-milestones {
|
|
198
|
-
order: -1; // move this above the ad
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.article__right--live-splash {
|
|
203
|
-
order: -1; // on mobile, move this column above the content (visually only)
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.article-tools {
|
|
207
|
-
margin-bottom: oSpacingByName('s8');
|
|
208
|
-
padding: oSpacingByName('s6') 0 oSpacingByName('s6') 0;
|
|
209
|
-
grid-area: tools;
|
|
210
|
-
border-bottom: 1px solid #ccc1b7;
|
|
211
|
-
border-top: 1px solid #ccc1b7;
|
|
212
|
-
|
|
213
|
-
@include oGridRespondTo($from: M) {
|
|
214
|
-
display: flex;
|
|
215
|
-
justify-content: space-between;
|
|
216
|
-
align-items: center;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.promoted-content__container {
|
|
221
|
-
grid-area: promoted-content;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.bottom-advert {
|
|
225
|
-
@include oGridRespondTo($until: L) {
|
|
226
|
-
display: none;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.show-in-large-and-above {
|
|
231
|
-
@include oGridRespondTo($until: L) {
|
|
232
|
-
display: none;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.ad-rhr-bottom {
|
|
237
|
-
display: flex;
|
|
238
|
-
flex: 1;
|
|
239
|
-
align-items: flex-end;
|
|
240
|
-
padding-bottom: 60px;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
@mixin tintedBackgroundBefore() {
|
|
244
|
-
position: relative;
|
|
245
|
-
&:before {
|
|
246
|
-
content: '';
|
|
247
|
-
position: absolute;
|
|
248
|
-
background: oColorsByName('black-5');
|
|
249
|
-
width: 100vw;
|
|
250
|
-
margin-left: -50vw;
|
|
251
|
-
left: 50%;
|
|
252
|
-
height: 100%;
|
|
253
|
-
z-index: -1;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.article__right-bottom {
|
|
258
|
-
grid-area: rhr-bottom;
|
|
259
|
-
align-self: start;
|
|
260
|
-
z-index: 1; // grid & flex items both support `z-index` directly
|
|
261
|
-
|
|
262
|
-
display: flex;
|
|
263
|
-
flex-direction: column;
|
|
264
|
-
|
|
265
|
-
padding: 0 10px;
|
|
266
|
-
|
|
267
|
-
@include oGridRespondTo($until: L) {
|
|
268
|
-
@include tintedBackgroundBefore();
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.article-grid--centered & {
|
|
272
|
-
@include oGridRespondTo(L) {
|
|
273
|
-
@include tintedBackgroundBefore();
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// Increased specificity to fix IE11 issue where generated CSS was targetting incorrect elements
|
|
279
|
-
&.article-grid--centered,
|
|
280
|
-
&.article-grid--full-width-graphics {
|
|
281
|
-
> .article__right-bottom {
|
|
282
|
-
grid-area: second-onward;
|
|
283
|
-
padding: 0;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
.article-grid--centered {
|
|
289
|
-
@include articleGridCentered();
|
|
290
|
-
.article__right,
|
|
291
|
-
.bottom-advert,
|
|
292
|
-
.onward-myft {
|
|
293
|
-
display: none;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.hidden {
|
|
298
|
-
display: none !important;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.article-grid--live-blog {
|
|
302
|
-
@include liveBlogArticleGrid();
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
1
|
$system-code: "n-clip-demo";
|
|
308
2
|
@import "@financial-times/o-colors/main";
|
|
309
3
|
@import "@financial-times/o-grid/main";
|
|
@@ -315,7 +9,7 @@ $system-code: "n-clip-demo";
|
|
|
315
9
|
// HACK: n-content-body _should not_ include n-ui-foundations
|
|
316
10
|
$n-ui-foundations-is-silent: true;
|
|
317
11
|
@import 'n-content-body/main';
|
|
318
|
-
@import "
|
|
12
|
+
@import "@financial-times/n-clip/client/main";
|
|
319
13
|
|
|
320
14
|
$desktop-breakpoint: 980px;
|
|
321
15
|
|
|
@@ -347,8 +41,4 @@ $desktop-breakpoint: 980px;
|
|
|
347
41
|
// Adding this only for local development given the image will only be available for the mobile App
|
|
348
42
|
// It will be cache via https://github.com/Financial-Times/ft-app/blob/main/tools/webpack/client/webpack.config.common.js#L218
|
|
349
43
|
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPjxzdHlsZT4qe2ZpbGw6I0ZGRkZGRiFpbXBvcnRhbnQ7fTwvc3R5bGU+PHBhdGggZD0iTTY5Ny40IDc1OS4ybDYxLjgtNjEuOEw1NzMuOCA1MTJsMTg1LjQtMTg1LjQtNjEuOC02MS44TDUxMiA0NTAuMiAzMjYuNiAyNjQuOGwtNjEuOCA2MS44TDQ1MC4yIDUxMiAyNjQuOCA2OTcuNGw2MS44IDYxLjhMNTEyIDU3My44eiIvPjwvc3ZnPg==") !important;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.o-clip .video-meta-info .o-expander__toggle[aria-expanded=true]:after {
|
|
353
|
-
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPjxzdHlsZT4qe2ZpbGw6IzAwMDAwMCFpbXBvcnRhbnQ7fTwvc3R5bGU+PHBhdGggZD0iTTY5Ny40IDc1OS4ybDYxLjgtNjEuOEw1NzMuOCA1MTJsMTg1LjQtMTg1LjQtNjEuOC02MS44TDUxMiA0NTAuMiAzMjYuNiAyNjQuOGwtNjEuOCA2MS44TDQ1MC4yIDUxMiAyNjQuOCA2OTcuNGw2MS44IDYxLjhMNTEyIDU3My44eiIvPjwvc3ZnPg==") !important;
|
|
354
44
|
}
|