@times-components/article-magazine-standard 3.74.11-alpha.6 → 3.74.12-alpha.4
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/dist/article-magazine-standard.js +1 -83
- package/dist/styles/responsive.js +2 -9
- package/package.json +3 -5
- package/rnw.js +1 -1
|
@@ -11,10 +11,6 @@ var _articleSkeleton = _interopRequireDefault(require("@times-components/article
|
|
|
11
11
|
|
|
12
12
|
var _utils = require("@times-components/utils");
|
|
13
13
|
|
|
14
|
-
var _tsNewskit = require("@times-components/ts-newskit");
|
|
15
|
-
|
|
16
|
-
var _newskit = require("newskit");
|
|
17
|
-
|
|
18
14
|
var _caption = require("@times-components/caption");
|
|
19
15
|
|
|
20
16
|
var _articleHeader = _interopRequireDefault(require("./article-header/article-header"));
|
|
@@ -25,8 +21,6 @@ var _newStyles = _interopRequireDefault(require("./newStyles"));
|
|
|
25
21
|
|
|
26
22
|
var _responsive = require("./newStyles/responsive");
|
|
27
23
|
|
|
28
|
-
var _responsive2 = require("./styles/responsive");
|
|
29
|
-
|
|
30
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
25
|
|
|
32
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -39,62 +33,6 @@ class ArticlePage extends _react.Component {
|
|
|
39
33
|
constructor(props) {
|
|
40
34
|
super(props);
|
|
41
35
|
this.renderHeader = this.renderHeader.bind(this);
|
|
42
|
-
this.state = {
|
|
43
|
-
initialPosition: 0
|
|
44
|
-
};
|
|
45
|
-
this.sidebarRef = _react.default.createRef();
|
|
46
|
-
this.handleScroll = this.handleScroll.bind(this);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
componentDidMount() {
|
|
50
|
-
window.addEventListener("scroll", this.handleScroll);
|
|
51
|
-
const sidebarNode = this.sidebarRef.current;
|
|
52
|
-
|
|
53
|
-
if (sidebarNode) {
|
|
54
|
-
const rect = sidebarNode.getBoundingClientRect();
|
|
55
|
-
this.setState({
|
|
56
|
-
initialPosition: rect.top
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
componentWillUnmount() {
|
|
62
|
-
window.removeEventListener("scroll", this.handleScroll);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
handleScroll() {
|
|
66
|
-
const sidebarNode = this.sidebarRef.current;
|
|
67
|
-
|
|
68
|
-
if (sidebarNode) {
|
|
69
|
-
const rect = sidebarNode.getBoundingClientRect();
|
|
70
|
-
const adElement = document.querySelector(".responsive__InlineAdWrapper-sc-4v1r4q-17");
|
|
71
|
-
const relatedArticlesElement = document.getElementById("related-articles");
|
|
72
|
-
let isAdIntersecting = false;
|
|
73
|
-
let isRelatedArticlesIntersecting = false;
|
|
74
|
-
|
|
75
|
-
if (adElement) {
|
|
76
|
-
const adRect = adElement.getBoundingClientRect();
|
|
77
|
-
isAdIntersecting = adRect.top <= rect.bottom && adRect.bottom >= rect.top;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (relatedArticlesElement) {
|
|
81
|
-
const relatedArticlesRect = relatedArticlesElement.getBoundingClientRect();
|
|
82
|
-
isRelatedArticlesIntersecting = relatedArticlesRect.top <= window.innerHeight && relatedArticlesRect.bottom >= 0;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const initialPosition = this.state.initialPosition;
|
|
86
|
-
|
|
87
|
-
if (isAdIntersecting || isRelatedArticlesIntersecting) {
|
|
88
|
-
sidebarNode.style.transition = "opacity 0.5s ease";
|
|
89
|
-
sidebarNode.style.opacity = "0";
|
|
90
|
-
} else {
|
|
91
|
-
const isScrolled = rect.top <= 0 && window.scrollY > initialPosition;
|
|
92
|
-
sidebarNode.style.transition = "opacity 0.5s ease";
|
|
93
|
-
sidebarNode.style.opacity = "1";
|
|
94
|
-
sidebarNode.style.position = isScrolled ? "fixed" : "absolute";
|
|
95
|
-
sidebarNode.style.top = isScrolled ? "0" : "100%";
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
36
|
}
|
|
99
37
|
|
|
100
38
|
renderHeader() {
|
|
@@ -119,27 +57,7 @@ class ArticlePage extends _react.Component {
|
|
|
119
57
|
publishedTime: publishedTime,
|
|
120
58
|
standfirst: standfirst,
|
|
121
59
|
updatedTime: updatedTime
|
|
122
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
123
|
-
theme: _tsNewskit.PuzzlesWebLightTheme
|
|
124
|
-
}, /*#__PURE__*/_react.default.createElement(_responsive2.PuzzlesSidebar, {
|
|
125
|
-
ref: this.sidebarRef
|
|
126
|
-
}, /*#__PURE__*/_react.default.createElement(_tsNewskit.ArticleSidebar, {
|
|
127
|
-
pageLink: "https://www.thetimes.co.uk/puzzles",
|
|
128
|
-
sectionTitle: "Puzzles",
|
|
129
|
-
data: [{
|
|
130
|
-
title: "Crossword",
|
|
131
|
-
url: "https://www.thetimes.co.uk/puzzles/crossword",
|
|
132
|
-
imgUrl: "https://www.thetimes.co.uk/imageserver/image/%2Fpuzzles%2Ficons%2F33b27655-dcc9-421f-906f-b2b10dd26865.png?crop=1250%2C833%2C0%2C0&resize=500"
|
|
133
|
-
}, {
|
|
134
|
-
title: "Polygon",
|
|
135
|
-
url: "https://www.thetimes.co.uk/puzzles/word-puzzles",
|
|
136
|
-
imgUrl: "https://www.thetimes.co.uk/imageserver/image/%2Fpuzzles%2Ficons%2F33b27655-dcc9-421f-906f-b2b10dd26865.png?crop=1250%2C833%2C0%2C0&resize=500"
|
|
137
|
-
}, {
|
|
138
|
-
title: "Sudoku",
|
|
139
|
-
url: "https://www.thetimes.co.uk/puzzles/sudoku",
|
|
140
|
-
imgUrl: "https://www.thetimes.co.uk/imageserver/image/%2Fpuzzles%2Ficons%2F33b27655-dcc9-421f-906f-b2b10dd26865.png?crop=1250%2C833%2C0%2C0&resize=500"
|
|
141
|
-
}]
|
|
142
|
-
}))), /*#__PURE__*/_react.default.createElement(_responsive.LeadAsset, _extends({}, (0, _utils.getLeadAsset)(article), {
|
|
60
|
+
}), /*#__PURE__*/_react.default.createElement(_responsive.LeadAsset, _extends({}, (0, _utils.getLeadAsset)(article), {
|
|
143
61
|
getImageCrop: _utils.getStandardTemplateCrop,
|
|
144
62
|
renderCaption: _ref => {
|
|
145
63
|
let caption = _ref.caption;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.LeadAsset = exports.StandfirstContainer = exports.Separator = exports.MetaContainer = exports.Meta = exports.LabelContainer = exports.HeadlineContainer = exports.HeaderContainer = exports.FlagsContainer = exports.DatePublicationContainer = void 0;
|
|
7
7
|
|
|
8
8
|
var _utils = require("@times-components/utils");
|
|
9
9
|
|
|
@@ -71,11 +71,4 @@ const LeadAsset = (0, _styledComponents.default)(_articleLeadAsset.default).with
|
|
|
71
71
|
displayName: "responsive__LeadAsset",
|
|
72
72
|
componentId: "iv7rgu-9"
|
|
73
73
|
})(["order:2;@media (min-width:", "px){margin-bottom:", ";}@media (min-width:", "px){width:56.2%;margin-left:auto;margin-right:auto;}"], _tsStyleguide.breakpoints.medium, (0, _tsStyleguide.spacing)(6), _tsStyleguide.breakpoints.wide);
|
|
74
|
-
exports.LeadAsset = LeadAsset;
|
|
75
|
-
|
|
76
|
-
const PuzzlesSidebar = _styledComponents.default.div.withConfig({
|
|
77
|
-
displayName: "responsive__PuzzlesSidebar",
|
|
78
|
-
componentId: "iv7rgu-10"
|
|
79
|
-
})(["padding-left:", ";position:absolute;right:0;z-index:1;top:100%;display:none;@media (min-width:", "px){display:block;width:19.8333%;padding-right:", ";}@media (min-width:", "px){display:block;width:17.8333%;padding-right:", ";}"], (0, _tsStyleguide.spacing)(4), _tsStyleguide.breakpoints.wide, (0, _tsStyleguide.spacing)(8), _tsStyleguide.breakpoints.huge, (0, _tsStyleguide.spacing)(15));
|
|
80
|
-
|
|
81
|
-
exports.PuzzlesSidebar = PuzzlesSidebar;
|
|
74
|
+
exports.LeadAsset = LeadAsset;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/article-magazine-standard",
|
|
3
|
-
"version": "3.74.
|
|
3
|
+
"version": "3.74.12-alpha.4+bbfced9672",
|
|
4
4
|
"description": "Magazine Standard Article Template",
|
|
5
5
|
"main": "dist/article-magazine-standard",
|
|
6
6
|
"dev": "src/article-magazine-standard",
|
|
@@ -57,17 +57,15 @@
|
|
|
57
57
|
"@times-components/article-byline": "^3.13.15",
|
|
58
58
|
"@times-components/article-label": "^2.16.1",
|
|
59
59
|
"@times-components/article-lead-asset": "^1.17.4",
|
|
60
|
-
"@times-components/article-skeleton": "^1.115.
|
|
60
|
+
"@times-components/article-skeleton": "^1.115.12-alpha.4+bbfced9672",
|
|
61
61
|
"@times-components/caption": "^3.8.15",
|
|
62
62
|
"@times-components/context": "^1.10.37",
|
|
63
63
|
"@times-components/date-publication": "^0.28.1",
|
|
64
64
|
"@times-components/ts-components": "^1.81.7",
|
|
65
|
-
"@times-components/ts-newskit": "^1.139.2",
|
|
66
65
|
"@times-components/ts-styleguide": "^1.48.1",
|
|
67
66
|
"@times-components/user-state": "^0.5.11",
|
|
68
67
|
"@times-components/utils": "^6.16.21",
|
|
69
68
|
"@times-components/video-label": "^2.11.22",
|
|
70
|
-
"newskit": "7.2.0",
|
|
71
69
|
"prop-types": "15.7.2",
|
|
72
70
|
"styled-components": "4.3.2"
|
|
73
71
|
},
|
|
@@ -82,5 +80,5 @@
|
|
|
82
80
|
"publishConfig": {
|
|
83
81
|
"access": "public"
|
|
84
82
|
},
|
|
85
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "bbfced96729d4b34f0d1fb51a3bddb8ce7e8a10b"
|
|
86
84
|
}
|
package/rnw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=16)}([function(e,t){e.exports=require("@times-components/ts-styleguide/rnw")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("@times-components/utils/rnw")},function(e,t){e.exports=require("styled-components")},function(e,t){e.exports=require("@times-components/context/rnw")},function(e,t){e.exports=require("@times-components/article-lead-asset/rnw")},function(e,t){e.exports=require("@times-components/ts-newskit/rnw")},function(e,t){e.exports=require("@times-components/ts-components/rnw")},function(e,t){e.exports=require("@times-components/article-byline/rnw")},function(e,t){e.exports=require("@times-components/article-skeleton/rnw")},function(e,t){e.exports=require("newskit")},function(e,t){e.exports=require("@times-components/caption/rnw")},function(e,t){e.exports=require("@times-components/article-label/rnw")},function(e,t){e.exports=require("@times-components/video-label/rnw")},function(e,t){e.exports=require("@times-components/date-publication/rnw")},function(e,t,n){"use strict";n.r(t);var i=n(1),r=n.n(i),o=n(10),a=n.n(o),s=n(3),c=n(7),l=n(11),p=n(12),d=n(5),m=n.n(d),u=n(8),g=n(0),b=n(13),f=n.n(b),h=n(14),w=n.n(h),y=n(2),O=n.n(y);O.a.bool,O.a.string;function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var k=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},{articleHeadline:v(v({},Object(g.fontFactory)({font:"headline",fontSize:"headline"})),{},{color:g.colours.functional.brandColour,marginBottom:Object(g.spacing)(2),textAlign:"center"}),container:{alignItems:"center",marginBottom:Object(g.spacing)(5),paddingLeft:Object(g.spacing)(2),paddingRight:Object(g.spacing)(2),paddingTop:Object(g.spacing)(7)},datePublication:v(v({},Object(g.fontFactory)({font:"supporting",fontSize:"cardMeta"})),{},{color:g.colours.functional.secondary,marginTop:Object(g.spacing)(3)}),datePublicationTablet:{marginTop:"auto"},label:{marginBottom:Object(g.spacing)(2)},leadAssetContainer:{marginBottom:Object(g.spacing)(4)},leadAssetContainerTablet:{paddingLeft:Object(g.spacing)(2),paddingRight:Object(g.spacing)(2)},meta:{flexDirection:"row",flexWrap:"wrap"},metaContainer:{alignItems:"center"},metaContainerTablet:{flexDirection:"row",justifyContent:"center"},metaTablet:{paddingTop:Object(g.spacing)(1)},separator:{borderRightColor:g.colours.functional.keyline,borderRightWidth:1,height:Object(g.spacing)(3),marginLeft:Object(g.spacing)(2),marginRight:Object(g.spacing)(2)},standFirst:v(v({},Object(g.fontFactory)({font:"headlineRegular",fontSize:"smallestHeadline"})),{},{color:g.colours.functional.primary,marginBottom:Object(g.spacing)(3),paddingLeft:Object(g.spacing)(2),paddingRight:Object(g.spacing)(2),textAlign:"center"})});const T=e=>{let t=e.isVideo,n=e.label;if(!t&&!n)return null;const i=t?w.a:f.a;return r.a.createElement(m.a.Consumer,null,e=>{let t=e.theme.sectionColour;return r.a.createElement(s.TcView,{style:k.label},r.a.createElement(i,{color:t||g.colours.section.default,title:n}))})};T.defaultProps={isVideo:!1,label:null};var S=T,_=n(9),E=n(15),z=n.n(E);O.a.arrayOf(O.a.shape({})).isRequired,O.a.string.isRequired,O.a.string.isRequired;var R=n(4),D=n.n(R),I=n(6),F=n.n(I);const q=D()(s.TcText).withConfig({displayName:"responsive__DatePublicationContainer",componentId:"iv7rgu-0"})(["",";flex-direction:row;flex-wrap:wrap;margin-top:",";@media (min-width:","px){margin-top:0;}"],e=>e.styles&&e.styles,Object(g.spacing)(3),g.breakpoints.medium),N=D()(s.TcView).withConfig({displayName:"responsive__FlagsContainer",componentId:"iv7rgu-1"})(["padding-top:",";padding-bottom:",";@media (min-width:","px){padding-top:0;}"],Object(g.spacing)(1),Object(g.spacing)(3),g.breakpoints.medium),L=D()(s.TcView).withConfig({displayName:"responsive__HeaderContainer",componentId:"iv7rgu-2"})(["order:2;@media (min-width:","px){width:80.8%;margin-top:0;margin-left:auto;margin-right:auto;margin-bottom:",";}@media (min-width:","px){width:56.2%;}"],g.breakpoints.medium,Object(g.spacing)(6),g.breakpoints.wide),H=D.a.h1.withConfig({displayName:"responsive__HeadlineContainer",componentId:"iv7rgu-3"})(["border:0px solid black;box-sizing:border-box;display:inline;font-family:sans-serif;margin:0px;padding:0px;white-space:pre-wrap;overflow-wrap:break-word;font-weight:400;"," @media (min-width:","px){font-size:","px;line-height:50px;margin-bottom:",";}"],e=>e.styles&&e.styles,g.breakpoints.medium,g.fontSizes.articleHeadline,Object(g.spacing)(1)),V=(D()(s.TcView).withConfig({displayName:"responsive__LabelContainer",componentId:"iv7rgu-4"})(["@media (min-width:","px){margin-top:0px;}"],g.breakpoints.wide),D()(s.TcView).withConfig({displayName:"responsive__Meta",componentId:"iv7rgu-5"})(["max-width:100%;justify-content:center;@media (min-width:","px){margin-top:0;}"],g.breakpoints.medium)),B=D()(s.TcView).withConfig({displayName:"responsive__MetaContainer",componentId:"iv7rgu-6"})(["align-items:center;justify-content:center;@media (min-width:","px){flex-direction:row;flex-wrap:wrap;}"],g.breakpoints.medium),A=D()(s.TcView).withConfig({displayName:"responsive__Separator",componentId:"iv7rgu-7"})(["display:none;@media (min-width:","px){background-color:",";display:flex;height:",";margin:0 ",";width:1px;}"],g.breakpoints.medium,g.colours.functional.keyline,Object(g.spacing)(3),Object(g.spacing)(2)),M=D.a.h2.withConfig({displayName:"responsive__StandfirstContainer",componentId:"iv7rgu-8"})(["border:0px solid black;box-sizing:border-box;display:inline;font-family:sans-serif;margin:0px;padding:0px;white-space:pre-wrap;overflow-wrap:break-word;font-weight:400;"," @media (min-width:","px){font-size:","px;line-height:","px;margin-bottom:",";}@media (min-width:","px){margin-bottom:",";}"],e=>e.styles&&e.styles,g.breakpoints.medium,g.fontSizes.infoTitle,Object(g.lineHeight)({font:"bodyRegular",fontSize:"infoTitle"}),Object(g.spacing)(5),g.breakpoints.wide,Object(g.spacing)(4)),U=(D()(F.a).withConfig({displayName:"responsive__LeadAsset",componentId:"iv7rgu-9"})(["order:2;@media (min-width:","px){margin-bottom:",";}@media (min-width:","px){width:56.2%;margin-left:auto;margin-right:auto;}"],g.breakpoints.medium,Object(g.spacing)(6),g.breakpoints.wide),D.a.div.withConfig({displayName:"responsive__PuzzlesSidebar",componentId:"iv7rgu-10"})(["padding-left:",";position:absolute;right:0;z-index:1;top:100%;display:none;@media (min-width:","px){display:block;width:19.8333%;padding-right:",";}@media (min-width:","px){display:block;width:17.8333%;padding-right:",";}"],Object(g.spacing)(4),g.breakpoints.wide,Object(g.spacing)(8),g.breakpoints.huge,Object(g.spacing)(15)));var W=e=>{let t=e.bylines,n=e.publicationName,o=e.publishedTime;return r.a.createElement(B,null,Object(_.hasBylineData)(t)&&r.a.createElement(i.Fragment,null,r.a.createElement(V,{style:k.meta},r.a.createElement(m.a.Consumer,null,e=>{let n=e.theme.sectionColour;return r.a.createElement(_.ArticleBylineWithLinks,{ast:t,color:n||g.colours.section.default})})),r.a.createElement(A,null)),r.a.createElement(V,{style:k.meta},r.a.createElement(q,{styles:Object(s.checkStylesForUnits)(k.datePublication)},r.a.createElement(z.a,{date:o,publication:n}))))};const K=e=>{let t=e.standfirst;return t?r.a.createElement(M,{role:"heading","aria-level":"2",styles:Object(s.checkStylesForUnits)(k.standFirst),testID:"standfirst"},t):null};K.defaultProps={standfirst:null};var Q=K;O.a.arrayOf(O.a.shape({})).isRequired,O.a.arrayOf(O.a.shape({expiryTime:O.a.string,type:O.a.string})),O.a.bool,O.a.string.isRequired,O.a.string,O.a.bool,O.a.string.isRequired,O.a.string.isRequired,O.a.string,O.a.string;function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function G(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach((function(t){J(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const X=(e,t)=>Object(s.checkStylesForUnits)(G(G({},k.articleHeadline),{},{fontFamily:e?g.fontsWithFallback[e]:null,textTransform:t||null})),Z=e=>{let t=e.bylines,n=e.flags,i=e.hasVideo,o=e.headline,a=e.label,s=e.publicationName,c=e.publishedTime,l=e.standfirst,p=e.updatedTime;return r.a.createElement(m.a.Consumer,null,e=>{let d=e.theme,m=d.headlineFont,g=d.headlineCase;return r.a.createElement(L,{style:k.container},r.a.createElement(S,{isVideo:i,label:a}),r.a.createElement(H,{role:"heading","aria-level":"1",styles:X(m,g)},o),r.a.createElement(N,null,r.a.createElement(u.UpdatedTimeProvider,{updatedTime:p},r.a.createElement(u.ArticleFlags,{flags:n}))),r.a.createElement(Q,{standfirst:l}),r.a.createElement(W,{bylines:t,publicationName:s,publishedTime:c}))})};Z.defaultProps={flags:[],hasVideo:!1,label:null,longRead:!1,standfirst:null,updatedTime:null};var $=Z;function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(n),!0).forEach((function(t){ne(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ee(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}te(te({},{analyticsStream:O.a.func.isRequired,article:O.a.shape({}),error:O.a.shape({graphQLErrors:O.a.array,message:O.a.string,networkError:O.a.shape({message:O.a.string})}),isLoading:O.a.bool,onImagePress:O.a.func,receiveChildList:O.a.func.isRequired}),{},{navigationMode:O.a.shape({}).isRequired,storefrontConfig:O.a.string.isRequired});const ie=te({},{article:null,error:null,isLoading:!1,onImagePress:null});function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){ae(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function se(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var le=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?se(Object(n),!0).forEach((function(t){ce(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},{articleHeadline:oe(oe({},Object(g.fontFactory)({font:"headline",fontSize:"headline"})),{},{color:g.colours.functional.brandColour,marginBottom:Object(g.spacing)(2),textAlign:"center"}),container:{alignItems:"center",marginBottom:Object(g.spacing)(5),paddingLeft:Object(g.spacing)(2),paddingRight:Object(g.spacing)(2),paddingTop:Object(g.spacing)(7)},datePublication:oe(oe({},Object(g.fontFactory)({font:"supporting",fontSize:"cardMeta"})),{},{color:g.colours.functional.secondary,marginTop:Object(g.spacing)(3)}),datePublicationTablet:{marginTop:"auto"},label:{marginBottom:Object(g.spacing)(2)},leadAssetContainer:{marginBottom:Object(g.spacing)(4)},leadAssetContainerTablet:{paddingLeft:Object(g.spacing)(2),paddingRight:Object(g.spacing)(2)},meta:{flexDirection:"row",flexWrap:"wrap"},metaContainer:{alignItems:"center"},metaContainerTablet:{flexDirection:"row",justifyContent:"center"},metaTablet:{paddingTop:Object(g.spacing)(1)},separator:{borderRightColor:g.colours.functional.keyline,borderRightWidth:1,height:Object(g.spacing)(3),marginLeft:Object(g.spacing)(2),marginRight:Object(g.spacing)(2)},standFirst:oe(oe({},Object(g.fontFactory)({font:"headlineRegular",fontSize:"smallestHeadline"})),{},{color:g.colours.functional.primary,marginBottom:Object(g.spacing)(3),paddingLeft:Object(g.spacing)(2),paddingRight:Object(g.spacing)(2),textAlign:"center"})});D()(s.TcText).withConfig({displayName:"responsive__DatePublicationContainer",componentId:"bpd0t9-0"})(["flex-direction:row;flex-wrap:wrap;margin-top:",";@media (min-width:","px){margin-top:0;}"],Object(g.spacing)(3),g.breakpoints.medium),D()(s.TcView).withConfig({displayName:"responsive__FlagsContainer",componentId:"bpd0t9-1"})(["padding-top:",";padding-bottom:",";@media (min-width:","px){padding-top:0;}"],Object(g.spacing)(1),Object(g.spacing)(3),g.breakpoints.medium),D()(s.TcView).withConfig({displayName:"responsive__HeaderContainer",componentId:"bpd0t9-2"})(["order:2;@media (min-width:","px){width:80.8%;margin-top:0;margin-left:auto;margin-right:auto;margin-bottom:",";}@media (min-width:","px){width:56.2%;}"],g.breakpoints.medium,Object(g.spacing)(6),g.breakpoints.wide),D()(s.TcText).withConfig({displayName:"responsive__HeadlineContainer",componentId:"bpd0t9-3"})(["font-weight:400;@media (min-width:","px){font-size:","px;line-height:50px;margin-bottom:",";}"],g.breakpoints.medium,g.fontSizes.articleHeadline,Object(g.spacing)(1)),D()(s.TcView).withConfig({displayName:"responsive__LabelContainer",componentId:"bpd0t9-4"})(["@media (min-width:","px){margin-top:0px;}"],g.breakpoints.wide),D()(s.TcView).withConfig({displayName:"responsive__Meta",componentId:"bpd0t9-5"})(["max-width:100%;justify-content:center;@media (min-width:","px){margin-top:0;}"],g.breakpoints.medium),D()(s.TcView).withConfig({displayName:"responsive__MetaContainer",componentId:"bpd0t9-6"})(["align-items:center;justify-content:center;@media (min-width:","px){flex-direction:row;flex-wrap:wrap;}"],g.breakpoints.medium),D()(s.TcView).withConfig({displayName:"responsive__Separator",componentId:"bpd0t9-7"})(["display:none;@media (min-width:","px){background-color:",";display:flex;height:",";margin:0 ",";width:1px;}"],g.breakpoints.medium,g.colours.functional.keyline,Object(g.spacing)(3),Object(g.spacing)(2)),D()(s.TcText).withConfig({displayName:"responsive__StandfirstContainer",componentId:"bpd0t9-8"})(["font-weight:400;@media (min-width:","px){font-size:","px;line-height:","px;margin-bottom:",";}@media (min-width:","px){margin-bottom:",";}"],g.breakpoints.medium,g.fontSizes.infoTitle,Object(g.lineHeight)({font:"bodyRegular",fontSize:"infoTitle"}),Object(g.spacing)(5),g.breakpoints.wide,Object(g.spacing)(4));const pe=D()(F.a).withConfig({displayName:"responsive__LeadAsset",componentId:"bpd0t9-9"})(["order:2;@media (min-width:","px){margin-bottom:",";}@media (min-width:","px){width:56.2%;margin-left:auto;margin-right:auto;}"],g.breakpoints.medium,Object(g.spacing)(6),g.breakpoints.wide);function de(){return(de=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}class me extends i.Component{constructor(e){super(e),this.renderHeader=this.renderHeader.bind(this),this.state={initialPosition:0},this.sidebarRef=r.a.createRef(),this.handleScroll=this.handleScroll.bind(this)}componentDidMount(){window.addEventListener("scroll",this.handleScroll);const e=this.sidebarRef.current;if(e){const t=e.getBoundingClientRect();this.setState({initialPosition:t.top})}}componentWillUnmount(){window.removeEventListener("scroll",this.handleScroll)}handleScroll(){const e=this.sidebarRef.current;if(e){const t=e.getBoundingClientRect(),n=document.querySelector(".responsive__InlineAdWrapper-sc-4v1r4q-17"),i=document.getElementById("related-articles");let r=!1,o=!1;if(n){const e=n.getBoundingClientRect();r=e.top<=t.bottom&&e.bottom>=t.top}if(i){const e=i.getBoundingClientRect();o=e.top<=window.innerHeight&&e.bottom>=0}const a=this.state.initialPosition;if(r||o)e.style.transition="opacity 0.5s ease",e.style.opacity="0";else{const n=t.top<=0&&window.scrollY>a;e.style.transition="opacity 0.5s ease",e.style.opacity="1",e.style.position=n?"fixed":"absolute",e.style.top=n?"0":"100%"}}}renderHeader(){const e=this.props.article,t=e.bylines,n=e.expirableFlags,o=e.hasVideo,a=e.headline,d=e.label,m=e.publicationName,u=e.publishedTime,g=e.shortHeadline,b=e.standfirst,f=e.updatedTime;return r.a.createElement(i.Fragment,null,r.a.createElement($,{bylines:t,flags:n,hasVideo:o,headline:Object(s.getHeadline)(a,g),label:d,publicationName:m,publishedTime:u,standfirst:b,updatedTime:f}),r.a.createElement(l.NewsKitProvider,{theme:c.PuzzlesWebLightTheme},r.a.createElement(U,{ref:this.sidebarRef},r.a.createElement(c.ArticleSidebar,{pageLink:"https://www.thetimes.co.uk/puzzles",sectionTitle:"Puzzles",data:[{title:"Crossword",url:"https://www.thetimes.co.uk/puzzles/crossword",imgUrl:"https://www.thetimes.co.uk/imageserver/image/%2Fpuzzles%2Ficons%2F33b27655-dcc9-421f-906f-b2b10dd26865.png?crop=1250%2C833%2C0%2C0&resize=500"},{title:"Polygon",url:"https://www.thetimes.co.uk/puzzles/word-puzzles",imgUrl:"https://www.thetimes.co.uk/imageserver/image/%2Fpuzzles%2Ficons%2F33b27655-dcc9-421f-906f-b2b10dd26865.png?crop=1250%2C833%2C0%2C0&resize=500"},{title:"Sudoku",url:"https://www.thetimes.co.uk/puzzles/sudoku",imgUrl:"https://www.thetimes.co.uk/imageserver/image/%2Fpuzzles%2Ficons%2F33b27655-dcc9-421f-906f-b2b10dd26865.png?crop=1250%2C833%2C0%2C0&resize=500"}]}))),r.a.createElement(pe,de({},Object(s.getLeadAsset)(e),{getImageCrop:s.getStandardTemplateCrop,renderCaption:e=>{let t=e.caption;return r.a.createElement(p.CentredCaption,t)},style:le.leadAssetContainer})))}render(){const e=this.props,t=e.article,n=e.analyticsStream,i=e.error,o=e.isLoading,s=e.logoUrl,c=e.navigationMode,l=e.receiveChildList,p=e.commentingConfig,d=e.paidContentClassName,m=e.isPreview,u=e.swgProductId,g=e.storefrontConfig;return i||o?null:r.a.createElement(a.a,{analyticsStream:n,data:t,Header:this.renderHeader,logoUrl:s,receiveChildList:l,navigationMode:c,commentingConfig:p,paidContentClassName:d,isPreview:m,swgProductId:u,storefrontConfig:g})}}me.defaultProps=ie;t.default=me}]);
|
|
1
|
+
module.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(e,t){e.exports=require("@times-components/ts-styleguide/rnw")},function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("@times-components/utils/rnw")},function(e,t){e.exports=require("styled-components")},function(e,t){e.exports=require("@times-components/context/rnw")},function(e,t){e.exports=require("@times-components/article-lead-asset/rnw")},function(e,t){e.exports=require("@times-components/ts-components/rnw")},function(e,t){e.exports=require("@times-components/article-byline/rnw")},function(e,t){e.exports=require("@times-components/article-skeleton/rnw")},function(e,t){e.exports=require("@times-components/caption/rnw")},function(e,t){e.exports=require("@times-components/article-label/rnw")},function(e,t){e.exports=require("@times-components/video-label/rnw")},function(e,t){e.exports=require("@times-components/date-publication/rnw")},function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),a=n(9),o=n.n(a),c=n(3),s=n(10),l=n(5),p=n.n(l),d=n(7),m=n(0),u=n(11),g=n.n(u),b=n(12),f=n.n(b),O=n(1),h=n.n(O);h.a.bool,h.a.string;function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){j(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var P=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},{articleHeadline:w(w({},Object(m.fontFactory)({font:"headline",fontSize:"headline"})),{},{color:m.colours.functional.brandColour,marginBottom:Object(m.spacing)(2),textAlign:"center"}),container:{alignItems:"center",marginBottom:Object(m.spacing)(5),paddingLeft:Object(m.spacing)(2),paddingRight:Object(m.spacing)(2),paddingTop:Object(m.spacing)(7)},datePublication:w(w({},Object(m.fontFactory)({font:"supporting",fontSize:"cardMeta"})),{},{color:m.colours.functional.secondary,marginTop:Object(m.spacing)(3)}),datePublicationTablet:{marginTop:"auto"},label:{marginBottom:Object(m.spacing)(2)},leadAssetContainer:{marginBottom:Object(m.spacing)(4)},leadAssetContainerTablet:{paddingLeft:Object(m.spacing)(2),paddingRight:Object(m.spacing)(2)},meta:{flexDirection:"row",flexWrap:"wrap"},metaContainer:{alignItems:"center"},metaContainerTablet:{flexDirection:"row",justifyContent:"center"},metaTablet:{paddingTop:Object(m.spacing)(1)},separator:{borderRightColor:m.colours.functional.keyline,borderRightWidth:1,height:Object(m.spacing)(3),marginLeft:Object(m.spacing)(2),marginRight:Object(m.spacing)(2)},standFirst:w(w({},Object(m.fontFactory)({font:"headlineRegular",fontSize:"smallestHeadline"})),{},{color:m.colours.functional.primary,marginBottom:Object(m.spacing)(3),paddingLeft:Object(m.spacing)(2),paddingRight:Object(m.spacing)(2),textAlign:"center"})});const C=e=>{let t=e.isVideo,n=e.label;if(!t&&!n)return null;const i=t?f.a:g.a;return r.a.createElement(p.a.Consumer,null,e=>{let t=e.theme.sectionColour;return r.a.createElement(c.TcView,{style:P.label},r.a.createElement(i,{color:t||m.colours.section.default,title:n}))})};C.defaultProps={isVideo:!1,label:null};var T=C,k=n(8),_=n(13),E=n.n(_);h.a.arrayOf(h.a.shape({})).isRequired,h.a.string.isRequired,h.a.string.isRequired;var S=n(4),D=n.n(S),I=n(6),R=n.n(I);const N=D()(c.TcText).withConfig({displayName:"responsive__DatePublicationContainer",componentId:"iv7rgu-0"})(["",";flex-direction:row;flex-wrap:wrap;margin-top:",";@media (min-width:","px){margin-top:0;}"],e=>e.styles&&e.styles,Object(m.spacing)(3),m.breakpoints.medium),q=D()(c.TcView).withConfig({displayName:"responsive__FlagsContainer",componentId:"iv7rgu-1"})(["padding-top:",";padding-bottom:",";@media (min-width:","px){padding-top:0;}"],Object(m.spacing)(1),Object(m.spacing)(3),m.breakpoints.medium),F=D()(c.TcView).withConfig({displayName:"responsive__HeaderContainer",componentId:"iv7rgu-2"})(["order:2;@media (min-width:","px){width:80.8%;margin-top:0;margin-left:auto;margin-right:auto;margin-bottom:",";}@media (min-width:","px){width:56.2%;}"],m.breakpoints.medium,Object(m.spacing)(6),m.breakpoints.wide),L=D.a.h1.withConfig({displayName:"responsive__HeadlineContainer",componentId:"iv7rgu-3"})(["border:0px solid black;box-sizing:border-box;display:inline;font-family:sans-serif;margin:0px;padding:0px;white-space:pre-wrap;overflow-wrap:break-word;font-weight:400;"," @media (min-width:","px){font-size:","px;line-height:50px;margin-bottom:",";}"],e=>e.styles&&e.styles,m.breakpoints.medium,m.fontSizes.articleHeadline,Object(m.spacing)(1)),H=(D()(c.TcView).withConfig({displayName:"responsive__LabelContainer",componentId:"iv7rgu-4"})(["@media (min-width:","px){margin-top:0px;}"],m.breakpoints.wide),D()(c.TcView).withConfig({displayName:"responsive__Meta",componentId:"iv7rgu-5"})(["max-width:100%;justify-content:center;@media (min-width:","px){margin-top:0;}"],m.breakpoints.medium)),V=D()(c.TcView).withConfig({displayName:"responsive__MetaContainer",componentId:"iv7rgu-6"})(["align-items:center;justify-content:center;@media (min-width:","px){flex-direction:row;flex-wrap:wrap;}"],m.breakpoints.medium),z=D()(c.TcView).withConfig({displayName:"responsive__Separator",componentId:"iv7rgu-7"})(["display:none;@media (min-width:","px){background-color:",";display:flex;height:",";margin:0 ",";width:1px;}"],m.breakpoints.medium,m.colours.functional.keyline,Object(m.spacing)(3),Object(m.spacing)(2)),A=D.a.h2.withConfig({displayName:"responsive__StandfirstContainer",componentId:"iv7rgu-8"})(["border:0px solid black;box-sizing:border-box;display:inline;font-family:sans-serif;margin:0px;padding:0px;white-space:pre-wrap;overflow-wrap:break-word;font-weight:400;"," @media (min-width:","px){font-size:","px;line-height:","px;margin-bottom:",";}@media (min-width:","px){margin-bottom:",";}"],e=>e.styles&&e.styles,m.breakpoints.medium,m.fontSizes.infoTitle,Object(m.lineHeight)({font:"bodyRegular",fontSize:"infoTitle"}),Object(m.spacing)(5),m.breakpoints.wide,Object(m.spacing)(4));D()(R.a).withConfig({displayName:"responsive__LeadAsset",componentId:"iv7rgu-9"})(["order:2;@media (min-width:","px){margin-bottom:",";}@media (min-width:","px){width:56.2%;margin-left:auto;margin-right:auto;}"],m.breakpoints.medium,Object(m.spacing)(6),m.breakpoints.wide);var M=e=>{let t=e.bylines,n=e.publicationName,a=e.publishedTime;return r.a.createElement(V,null,Object(k.hasBylineData)(t)&&r.a.createElement(i.Fragment,null,r.a.createElement(H,{style:P.meta},r.a.createElement(p.a.Consumer,null,e=>{let n=e.theme.sectionColour;return r.a.createElement(k.ArticleBylineWithLinks,{ast:t,color:n||m.colours.section.default})})),r.a.createElement(z,null)),r.a.createElement(H,{style:P.meta},r.a.createElement(N,{styles:Object(c.checkStylesForUnits)(P.datePublication)},r.a.createElement(E.a,{date:a,publication:n}))))};const B=e=>{let t=e.standfirst;return t?r.a.createElement(A,{role:"heading","aria-level":"2",styles:Object(c.checkStylesForUnits)(P.standFirst),testID:"standfirst"},t):null};B.defaultProps={standfirst:null};var U=B;h.a.arrayOf(h.a.shape({})).isRequired,h.a.arrayOf(h.a.shape({expiryTime:h.a.string,type:h.a.string})),h.a.bool,h.a.string.isRequired,h.a.string,h.a.bool,h.a.string.isRequired,h.a.string.isRequired,h.a.string,h.a.string;function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){G(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function G(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const J=(e,t)=>Object(c.checkStylesForUnits)(Q(Q({},P.articleHeadline),{},{fontFamily:e?m.fontsWithFallback[e]:null,textTransform:t||null})),K=e=>{let t=e.bylines,n=e.flags,i=e.hasVideo,a=e.headline,o=e.label,c=e.publicationName,s=e.publishedTime,l=e.standfirst,m=e.updatedTime;return r.a.createElement(p.a.Consumer,null,e=>{let p=e.theme,u=p.headlineFont,g=p.headlineCase;return r.a.createElement(F,{style:P.container},r.a.createElement(T,{isVideo:i,label:o}),r.a.createElement(L,{role:"heading","aria-level":"1",styles:J(u,g)},a),r.a.createElement(q,null,r.a.createElement(d.UpdatedTimeProvider,{updatedTime:m},r.a.createElement(d.ArticleFlags,{flags:n}))),r.a.createElement(U,{standfirst:l}),r.a.createElement(M,{bylines:t,publicationName:c,publishedTime:s}))})};K.defaultProps={flags:[],hasVideo:!1,label:null,longRead:!1,standfirst:null,updatedTime:null};var X=K;function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(n),!0).forEach((function(t){$(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function $(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Z(Z({},{analyticsStream:h.a.func.isRequired,article:h.a.shape({}),error:h.a.shape({graphQLErrors:h.a.array,message:h.a.string,networkError:h.a.shape({message:h.a.string})}),isLoading:h.a.bool,onImagePress:h.a.func,receiveChildList:h.a.func.isRequired}),{},{navigationMode:h.a.shape({}).isRequired,storefrontConfig:h.a.string.isRequired});const ee=Z({},{article:null,error:null,isLoading:!1,onImagePress:null});function te(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ne(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach((function(t){ie(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var oe=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){ae(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},{articleHeadline:ne(ne({},Object(m.fontFactory)({font:"headline",fontSize:"headline"})),{},{color:m.colours.functional.brandColour,marginBottom:Object(m.spacing)(2),textAlign:"center"}),container:{alignItems:"center",marginBottom:Object(m.spacing)(5),paddingLeft:Object(m.spacing)(2),paddingRight:Object(m.spacing)(2),paddingTop:Object(m.spacing)(7)},datePublication:ne(ne({},Object(m.fontFactory)({font:"supporting",fontSize:"cardMeta"})),{},{color:m.colours.functional.secondary,marginTop:Object(m.spacing)(3)}),datePublicationTablet:{marginTop:"auto"},label:{marginBottom:Object(m.spacing)(2)},leadAssetContainer:{marginBottom:Object(m.spacing)(4)},leadAssetContainerTablet:{paddingLeft:Object(m.spacing)(2),paddingRight:Object(m.spacing)(2)},meta:{flexDirection:"row",flexWrap:"wrap"},metaContainer:{alignItems:"center"},metaContainerTablet:{flexDirection:"row",justifyContent:"center"},metaTablet:{paddingTop:Object(m.spacing)(1)},separator:{borderRightColor:m.colours.functional.keyline,borderRightWidth:1,height:Object(m.spacing)(3),marginLeft:Object(m.spacing)(2),marginRight:Object(m.spacing)(2)},standFirst:ne(ne({},Object(m.fontFactory)({font:"headlineRegular",fontSize:"smallestHeadline"})),{},{color:m.colours.functional.primary,marginBottom:Object(m.spacing)(3),paddingLeft:Object(m.spacing)(2),paddingRight:Object(m.spacing)(2),textAlign:"center"})});D()(c.TcText).withConfig({displayName:"responsive__DatePublicationContainer",componentId:"bpd0t9-0"})(["flex-direction:row;flex-wrap:wrap;margin-top:",";@media (min-width:","px){margin-top:0;}"],Object(m.spacing)(3),m.breakpoints.medium),D()(c.TcView).withConfig({displayName:"responsive__FlagsContainer",componentId:"bpd0t9-1"})(["padding-top:",";padding-bottom:",";@media (min-width:","px){padding-top:0;}"],Object(m.spacing)(1),Object(m.spacing)(3),m.breakpoints.medium),D()(c.TcView).withConfig({displayName:"responsive__HeaderContainer",componentId:"bpd0t9-2"})(["order:2;@media (min-width:","px){width:80.8%;margin-top:0;margin-left:auto;margin-right:auto;margin-bottom:",";}@media (min-width:","px){width:56.2%;}"],m.breakpoints.medium,Object(m.spacing)(6),m.breakpoints.wide),D()(c.TcText).withConfig({displayName:"responsive__HeadlineContainer",componentId:"bpd0t9-3"})(["font-weight:400;@media (min-width:","px){font-size:","px;line-height:50px;margin-bottom:",";}"],m.breakpoints.medium,m.fontSizes.articleHeadline,Object(m.spacing)(1)),D()(c.TcView).withConfig({displayName:"responsive__LabelContainer",componentId:"bpd0t9-4"})(["@media (min-width:","px){margin-top:0px;}"],m.breakpoints.wide),D()(c.TcView).withConfig({displayName:"responsive__Meta",componentId:"bpd0t9-5"})(["max-width:100%;justify-content:center;@media (min-width:","px){margin-top:0;}"],m.breakpoints.medium),D()(c.TcView).withConfig({displayName:"responsive__MetaContainer",componentId:"bpd0t9-6"})(["align-items:center;justify-content:center;@media (min-width:","px){flex-direction:row;flex-wrap:wrap;}"],m.breakpoints.medium),D()(c.TcView).withConfig({displayName:"responsive__Separator",componentId:"bpd0t9-7"})(["display:none;@media (min-width:","px){background-color:",";display:flex;height:",";margin:0 ",";width:1px;}"],m.breakpoints.medium,m.colours.functional.keyline,Object(m.spacing)(3),Object(m.spacing)(2)),D()(c.TcText).withConfig({displayName:"responsive__StandfirstContainer",componentId:"bpd0t9-8"})(["font-weight:400;@media (min-width:","px){font-size:","px;line-height:","px;margin-bottom:",";}@media (min-width:","px){margin-bottom:",";}"],m.breakpoints.medium,m.fontSizes.infoTitle,Object(m.lineHeight)({font:"bodyRegular",fontSize:"infoTitle"}),Object(m.spacing)(5),m.breakpoints.wide,Object(m.spacing)(4));const ce=D()(R.a).withConfig({displayName:"responsive__LeadAsset",componentId:"bpd0t9-9"})(["order:2;@media (min-width:","px){margin-bottom:",";}@media (min-width:","px){width:56.2%;margin-left:auto;margin-right:auto;}"],m.breakpoints.medium,Object(m.spacing)(6),m.breakpoints.wide);function se(){return(se=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}class le extends i.Component{constructor(e){super(e),this.renderHeader=this.renderHeader.bind(this)}renderHeader(){const e=this.props.article,t=e.bylines,n=e.expirableFlags,a=e.hasVideo,o=e.headline,l=e.label,p=e.publicationName,d=e.publishedTime,m=e.shortHeadline,u=e.standfirst,g=e.updatedTime;return r.a.createElement(i.Fragment,null,r.a.createElement(X,{bylines:t,flags:n,hasVideo:a,headline:Object(c.getHeadline)(o,m),label:l,publicationName:p,publishedTime:d,standfirst:u,updatedTime:g}),r.a.createElement(ce,se({},Object(c.getLeadAsset)(e),{getImageCrop:c.getStandardTemplateCrop,renderCaption:e=>{let t=e.caption;return r.a.createElement(s.CentredCaption,t)},style:oe.leadAssetContainer})))}render(){const e=this.props,t=e.article,n=e.analyticsStream,i=e.error,a=e.isLoading,c=e.logoUrl,s=e.navigationMode,l=e.receiveChildList,p=e.commentingConfig,d=e.paidContentClassName,m=e.isPreview,u=e.swgProductId,g=e.storefrontConfig;return i||a?null:r.a.createElement(o.a,{analyticsStream:n,data:t,Header:this.renderHeader,logoUrl:c,receiveChildList:l,navigationMode:s,commentingConfig:p,paidContentClassName:d,isPreview:m,swgProductId:u,storefrontConfig:g})}}le.defaultProps=ee;t.default=le}]);
|