@times-components/article-main-comment 2.73.31-alpha.1 → 2.73.31-alpha.11
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 +19 -0
- package/dist/article-header/article-header.js +3 -1
- package/package.json +4 -4
- package/rnw.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.73.32](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.31...@times-components/article-main-comment@2.73.32) (2024-01-02)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **TMRX-1768:** Check a byline exists ([#3703](https://github.com/newsuk/times-components/issues/3703)) ([fad95e9](https://github.com/newsuk/times-components/commit/fad95e992b63f93ed95eadda683c5fcb1b91f53a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [2.73.31](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.30...@times-components/article-main-comment@2.73.31) (2023-12-14)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @times-components/article-main-comment
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [2.73.30](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.29...@times-components/article-main-comment@2.73.30) (2023-12-12)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @times-components/article-main-comment
|
|
@@ -11,6 +11,8 @@ var _tsComponents = require("@times-components/ts-components");
|
|
|
11
11
|
|
|
12
12
|
var _tsNewskit = require("@times-components/ts-newskit");
|
|
13
13
|
|
|
14
|
+
var _articleByline = require("@times-components/article-byline");
|
|
15
|
+
|
|
14
16
|
var _image = _interopRequireDefault(require("@times-components/image"));
|
|
15
17
|
|
|
16
18
|
var _utils = require("@times-components/utils");
|
|
@@ -77,7 +79,7 @@ const ArticleHeader = _ref => {
|
|
|
77
79
|
src: "",
|
|
78
80
|
readyToPlayText: "Listen to article",
|
|
79
81
|
playingText: "Playing",
|
|
80
|
-
narrator: bylines ? bylines[0].byline[0].children[0].attributes.value : "",
|
|
82
|
+
narrator: (0, _articleByline.hasBylineData)(bylines) ? bylines[0].byline[0].children[0].attributes.value : "",
|
|
81
83
|
headline: headline,
|
|
82
84
|
feedback: {
|
|
83
85
|
requestFeedback: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/article-main-comment",
|
|
3
|
-
"version": "2.73.31-alpha.
|
|
3
|
+
"version": "2.73.31-alpha.11+1f0348be0c",
|
|
4
4
|
"description": "Main Comment Article Template",
|
|
5
5
|
"main": "dist/article-main-comment",
|
|
6
6
|
"dev": "src/article-main-comment",
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
"@times-components/ad": "^2.21.44",
|
|
57
57
|
"@times-components/article-byline": "^3.13.15",
|
|
58
58
|
"@times-components/article-label": "^2.16.1",
|
|
59
|
-
"@times-components/article-skeleton": "^1.116.15-alpha.
|
|
59
|
+
"@times-components/article-skeleton": "^1.116.15-alpha.11+1f0348be0c",
|
|
60
60
|
"@times-components/context": "^1.10.37",
|
|
61
61
|
"@times-components/date-publication": "^0.28.1",
|
|
62
62
|
"@times-components/image": "^6.15.14",
|
|
63
63
|
"@times-components/responsive": "^0.17.1",
|
|
64
64
|
"@times-components/ts-components": "^1.81.7",
|
|
65
|
-
"@times-components/ts-newskit": "^1.146.2-alpha.
|
|
65
|
+
"@times-components/ts-newskit": "^1.146.2-alpha.13+1f0348be0c",
|
|
66
66
|
"@times-components/ts-styleguide": "^1.48.1",
|
|
67
67
|
"@times-components/user-state": "^0.5.11",
|
|
68
68
|
"@times-components/utils": "^6.16.21",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "1f0348be0cf038f5d488b8fac5a68d1ee4031492"
|
|
85
85
|
}
|
package/rnw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.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/ts-components/rnw")},function(e,t){e.exports=require("@times-components/ts-newskit/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/image/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/context/rnw")},function(e,t){e.exports=require("@times-components/date-publication/rnw")},function(e,t,r){"use strict";r.r(t);var n=r(2),i=r.n(n),a=r(8),o=r.n(a),s=r(3),l=r(5),c=r(6),p=r(9),d=r.n(p),u=r(10),m=r.n(u),b=r(11),g=r.n(b),f=r(12),y=r.n(f),h=r(0),O=r(1),w=r.n(O);w.a.bool,w.a.string;function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){v(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var C=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){k(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},{articleHeadline:x(x({},Object(h.fontFactory)({font:"headline",fontSize:"headline"})),{},{color:h.colours.functional.brandColour,marginBottom:Object(h.spacing)(2),textAlign:"center"}),articleHeadlineTablet:x({},Object(h.fontFactory)({font:"headline",fontSize:"articleHeadline"})),authorImage:{marginBottom:Object(h.spacing)(5)},container:{alignItems:"center",paddingLeft:Object(h.spacing)(2),paddingRight:Object(h.spacing)(2)},datePublication:x(x({},Object(h.fontFactory)({font:"supporting",fontSize:"cardMeta"})),{},{color:h.colours.functional.secondary,marginTop:Object(h.spacing)(1)}),datePublicationTablet:{marginTop:"auto"},header:{marginBottom:Object(h.spacing)(3),paddingBottom:Object(h.spacing)(4),paddingTop:Object(h.spacing)(7)},label:{marginBottom:Object(h.spacing)(2)},meta:{flexDirection:"row",flexWrap:"wrap"},metaContainer:{alignItems:"center",width:"100%",paddingTop:Object(h.spacing)(2),paddingBottom:Object(h.spacing)(2),borderBottomColor:h.colours.functional.keyline,borderBottomWidth:1,borderTopColor:h.colours.functional.keyline,borderTopWidth:1},metaContainerTablet:{flexDirection:"row",justifyContent:"center"},separator:{borderRightColor:h.colours.functional.keyline,borderRightWidth:1,height:Object(h.spacing)(3),marginLeft:Object(h.spacing)(2),marginRight:Object(h.spacing)(2)},standFirst:x(x({},Object(h.fontFactory)({font:"headlineRegular",fontSize:"smallestHeadline"})),{},{color:h.colours.functional.primary,marginBottom:Object(h.spacing)(3),paddingLeft:Object(h.spacing)(2),paddingRight:Object(h.spacing)(2),textAlign:"center"})});const T=e=>{let t=e.isVideo,r=e.label;if(!t&&!r)return null;const n=t?g.a:m.a;return i.a.createElement(y.a.Consumer,null,e=>{let t=e.theme.sectionColour;return i.a.createElement(s.TcView,{style:C.label},i.a.createElement(n,{color:t||h.colours.section.default,title:r}))})};T.defaultProps={isVideo:!1,label:null};var E=T,S=r(7),q=r(13),_=r.n(q);w.a.arrayOf(w.a.shape({})).isRequired,w.a.string.isRequired,w.a.string.isRequired;var D=r(4),I=r.n(D);const R=I()(s.TcView).withConfig({displayName:"responsive__AuthorImageContainer",componentId:"ba1gpd-0"})(["border-radius:50%;height:100px;overflow:hidden;width:100px;@media (min-width:","px){height:118px;width:118px;}"],h.breakpoints.medium),N=I()(s.TcText).withConfig({displayName:"responsive__DatePublicationContainer",componentId:"ba1gpd-1"})(["",";flex-direction:row;flex-wrap:wrap;margin-top:",";@media (min-width:","px){margin-top:0;}"],e=>e.styles&&e.styles,Object(h.spacing)(3),h.breakpoints.medium),H=I()(s.TcView).withConfig({displayName:"responsive__FlagsContainer",componentId:"ba1gpd-2"})(["padding-top:",";padding-bottom:",";@media (min-width:","px){padding-top:0;}"],Object(h.spacing)(1),Object(h.spacing)(3),h.breakpoints.medium),z=I()(s.TcView).withConfig({displayName:"responsive__HeaderContainer",componentId:"ba1gpd-3"})(["order:2;z-index:1;@media (min-width:","px){width:80.8%;margin:0 auto ",";margin-left:auto;margin-right:auto;}@media (min-width:","px){width:56.2%;}"],h.breakpoints.medium,Object(h.spacing)(2),h.breakpoints.wide),A=I.a.h1.withConfig({displayName:"responsive__HeadlineContainer",componentId:"ba1gpd-4"})(["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,h.breakpoints.medium,h.fontSizes.articleHeadline,Object(h.spacing)(1)),V=(I()(s.TcView).withConfig({displayName:"responsive__LabelContainer",componentId:"ba1gpd-5"})(["@media (min-width:","px){margin-top:0px;}"],h.breakpoints.wide),I()(s.TcView).withConfig({displayName:"responsive__Meta",componentId:"ba1gpd-6"})([""," max-width:100%;justify-content:center;@media (min-width:","px){margin-top:0;}"],e=>e.styles&&e.styles,h.breakpoints.medium)),F=I()(s.TcView).withConfig({displayName:"responsive__MetaContainer",componentId:"ba1gpd-7"})(["align-items:center;justify-content:center;@media (min-width:","px){flex-direction:row;flex-wrap:wrap;}"],h.breakpoints.medium),L=I()(s.TcView).withConfig({displayName:"responsive__Separator",componentId:"ba1gpd-8"})(["display:none;@media (min-width:","px){background-color:",";display:flex;height:",";margin:0 ",";width:1px;}"],h.breakpoints.medium,h.colours.functional.keyline,Object(h.spacing)(3),Object(h.spacing)(2)),M=I.a.h2.withConfig({displayName:"responsive__StandfirstContainer",componentId:"ba1gpd-9"})(["border:0px solid black;box-sizing:border-box;display:inline;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,h.breakpoints.medium,h.fontSizes.infoTitle,Object(h.lineHeight)({font:"bodyRegular",fontSize:"infoTitle"}),Object(h.spacing)(5),h.breakpoints.wide,Object(h.spacing)(4));var B=e=>{let t=e.bylines,r=e.publicationName,a=e.publishedTime;return i.a.createElement(F,null,Object(S.hasBylineData)(t)&&i.a.createElement(n.Fragment,null,i.a.createElement(V,{styles:C.meta},i.a.createElement(S.ArticleBylineWithLinks,{ast:t})),i.a.createElement(L,null)),i.a.createElement(V,{styles:C.meta},i.a.createElement(N,{styles:Object(s.checkStylesForUnits)(C.datePublication)},i.a.createElement(_.a,{date:a,publication:r}))))};const W=e=>{let t=e.standfirst;return t?i.a.createElement(M,{role:"heading","aria-level":"2",styles:Object(s.checkStylesForUnits)(C.standFirst),testID:"standfirst"},t):null};W.defaultProps={standfirst:null};var U=W;w.a.string.isRequired,w.a.arrayOf(w.a.shape({})).isRequired,w.a.arrayOf(w.a.shape({expiryTime:w.a.string,type:w.a.string})),w.a.bool,w.a.string.isRequired,w.a.string,w.a.bool,w.a.string.isRequired,w.a.string.isRequired,w.a.bool,w.a.string,w.a.string;function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach((function(t){J(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function J(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const K=e=>{let t=e.authorImage,r=e.bylines,n=e.flags,a=e.hasVideo,o=e.headline,p=e.label,u=e.publicationName,m=e.showAudioPlayer,b=e.publishedTime,g=e.standfirst,f=e.updatedTime;return i.a.createElement(z,{style:Q(Q({},C.header),C.container)},i.a.createElement(R,{style:C.authorImage},i.a.createElement(d.a,{aspectRatio:1,uri:t,accessibilityLabel:"author-image"})),i.a.createElement(E,{isVideo:a,label:p}),i.a.createElement(A,{role:"heading","aria-level":"1",styles:Object(s.checkStylesForUnits)(C.articleHeadline)},o),i.a.createElement(H,null,i.a.createElement(l.UpdatedTimeProvider,{updatedTime:f},i.a.createElement(l.ArticleFlags,{flags:n}))),i.a.createElement(U,{standfirst:g}),i.a.createElement(B,{bylines:r,publicationName:u,publishedTime:b}),i.a.createElement(c.TCThemeProvider,null,i.a.createElement(c.InArticleAudio,{showAudioPlayer:m,src:"",readyToPlayText:"Listen to article",playingText:"Playing",narrator:r?r[0].byline[0].children[0].attributes.value:"",headline:o,feedback:{requestFeedback:!0,feedbackMessage:"Want to listen to more articles? Give your feedback below or email",thankyouMessage:"Thank you for your feedback. We're always trying to give you the best possible experience – your feedback helps us do this."}})))};K.defaultProps={flags:[],hasVideo:!1,label:null,longRead:!1,standfirst:null,updatedTime:null};var X=K;function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach((function(t){$(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Z(Z({},{analyticsStream:w.a.func.isRequired,article:w.a.shape({}),error:w.a.shape({graphQLErrors:w.a.array,message:w.a.string,networkError:w.a.shape({message:w.a.string})}),isLoading:w.a.bool,onImagePress:w.a.func,receiveChildList:w.a.func.isRequired,zephrDivs:w.a.bool,showAudioPlayer:w.a.bool}),{},{navigationMode:w.a.shape({}).isRequired,storefrontConfig:w.a.string.isRequired});const ee=Z({},{article:null,error:null,isLoading:!1,onImagePress:null,showAudioPlayer:!1});class te extends n.Component{constructor(e){super(e),this.renderHeader=this.renderHeader.bind(this)}renderHeader(){const e=this.props,t=e.article,r=e.showAudioPlayer,n=t.bylines,a=t.expirableFlags,o=t.hasVideo,l=t.headline,c=t.label,p=t.publicationName,d=t.publishedTime,u=t.shortHeadline,m=t.standfirst,b=t.updatedTime,g=n&&n.length>0&&n[0].image&&0!==Object.keys(n[0].image).length&&n[0].image.crop?n[0].image.crop.url:null;return i.a.createElement(X,{authorImage:g,bylines:n,flags:a,hasVideo:o,headline:Object(s.getHeadline)(l,u),label:c,publicationName:p,publishedTime:d,standfirst:m,updatedTime:b,showAudioPlayer:r})}render(){const e=this.props,t=e.article,r=e.analyticsStream,n=e.error,a=e.isLoading,s=e.logoUrl,l=e.navigationMode,c=e.receiveChildList,p=e.commentingConfig,d=e.paidContentClassName,u=e.isPreview,m=e.showAudioPlayer,b=e.swgProductId,g=e.zephrDivs,f=e.storefrontConfig;return n||a?null:i.a.createElement(o.a,{analyticsStream:r,data:t,Header:this.renderHeader,logoUrl:s,receiveChildList:c,navigationMode:l,commentingConfig:p,paidContentClassName:d,isPreview:u,swgProductId:b,zephrDivs:g,showAudioPlayer:m,storefrontConfig:f})}}te.defaultProps=ee;t.default=te}]);
|
|
1
|
+
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.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/article-byline/rnw")},function(e,t){e.exports=require("@times-components/ts-components/rnw")},function(e,t){e.exports=require("@times-components/ts-newskit/rnw")},function(e,t){e.exports=require("@times-components/article-skeleton/rnw")},function(e,t){e.exports=require("@times-components/image/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/context/rnw")},function(e,t){e.exports=require("@times-components/date-publication/rnw")},function(e,t,r){"use strict";r.r(t);var n=r(2),i=r.n(n),a=r(8),o=r.n(a),s=r(3),l=r(6),c=r(7),p=r(5),d=r(9),u=r.n(d),b=r(10),m=r.n(b),g=r(11),f=r.n(g),y=r(12),h=r.n(y),O=r(0),w=r(1),j=r.n(w);j.a.bool,j.a.string;function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){P(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function P(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var T=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){C(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},{articleHeadline:v(v({},Object(O.fontFactory)({font:"headline",fontSize:"headline"})),{},{color:O.colours.functional.brandColour,marginBottom:Object(O.spacing)(2),textAlign:"center"}),articleHeadlineTablet:v({},Object(O.fontFactory)({font:"headline",fontSize:"articleHeadline"})),authorImage:{marginBottom:Object(O.spacing)(5)},container:{alignItems:"center",paddingLeft:Object(O.spacing)(2),paddingRight:Object(O.spacing)(2)},datePublication:v(v({},Object(O.fontFactory)({font:"supporting",fontSize:"cardMeta"})),{},{color:O.colours.functional.secondary,marginTop:Object(O.spacing)(1)}),datePublicationTablet:{marginTop:"auto"},header:{marginBottom:Object(O.spacing)(3),paddingBottom:Object(O.spacing)(4),paddingTop:Object(O.spacing)(7)},label:{marginBottom:Object(O.spacing)(2)},meta:{flexDirection:"row",flexWrap:"wrap"},metaContainer:{alignItems:"center",width:"100%",paddingTop:Object(O.spacing)(2),paddingBottom:Object(O.spacing)(2),borderBottomColor:O.colours.functional.keyline,borderBottomWidth:1,borderTopColor:O.colours.functional.keyline,borderTopWidth:1},metaContainerTablet:{flexDirection:"row",justifyContent:"center"},separator:{borderRightColor:O.colours.functional.keyline,borderRightWidth:1,height:Object(O.spacing)(3),marginLeft:Object(O.spacing)(2),marginRight:Object(O.spacing)(2)},standFirst:v(v({},Object(O.fontFactory)({font:"headlineRegular",fontSize:"smallestHeadline"})),{},{color:O.colours.functional.primary,marginBottom:Object(O.spacing)(3),paddingLeft:Object(O.spacing)(2),paddingRight:Object(O.spacing)(2),textAlign:"center"})});const E=e=>{let t=e.isVideo,r=e.label;if(!t&&!r)return null;const n=t?f.a:m.a;return i.a.createElement(h.a.Consumer,null,e=>{let t=e.theme.sectionColour;return i.a.createElement(s.TcView,{style:T.label},i.a.createElement(n,{color:t||O.colours.section.default,title:r}))})};E.defaultProps={isVideo:!1,label:null};var S=E,q=r(13),_=r.n(q);j.a.arrayOf(j.a.shape({})).isRequired,j.a.string.isRequired,j.a.string.isRequired;var D=r(4),I=r.n(D);const R=I()(s.TcView).withConfig({displayName:"responsive__AuthorImageContainer",componentId:"ba1gpd-0"})(["border-radius:50%;height:100px;overflow:hidden;width:100px;@media (min-width:","px){height:118px;width:118px;}"],O.breakpoints.medium),N=I()(s.TcText).withConfig({displayName:"responsive__DatePublicationContainer",componentId:"ba1gpd-1"})(["",";flex-direction:row;flex-wrap:wrap;margin-top:",";@media (min-width:","px){margin-top:0;}"],e=>e.styles&&e.styles,Object(O.spacing)(3),O.breakpoints.medium),H=I()(s.TcView).withConfig({displayName:"responsive__FlagsContainer",componentId:"ba1gpd-2"})(["padding-top:",";padding-bottom:",";@media (min-width:","px){padding-top:0;}"],Object(O.spacing)(1),Object(O.spacing)(3),O.breakpoints.medium),z=I()(s.TcView).withConfig({displayName:"responsive__HeaderContainer",componentId:"ba1gpd-3"})(["order:2;z-index:1;@media (min-width:","px){width:80.8%;margin:0 auto ",";margin-left:auto;margin-right:auto;}@media (min-width:","px){width:56.2%;}"],O.breakpoints.medium,Object(O.spacing)(2),O.breakpoints.wide),A=I.a.h1.withConfig({displayName:"responsive__HeadlineContainer",componentId:"ba1gpd-4"})(["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,O.breakpoints.medium,O.fontSizes.articleHeadline,Object(O.spacing)(1)),V=(I()(s.TcView).withConfig({displayName:"responsive__LabelContainer",componentId:"ba1gpd-5"})(["@media (min-width:","px){margin-top:0px;}"],O.breakpoints.wide),I()(s.TcView).withConfig({displayName:"responsive__Meta",componentId:"ba1gpd-6"})([""," max-width:100%;justify-content:center;@media (min-width:","px){margin-top:0;}"],e=>e.styles&&e.styles,O.breakpoints.medium)),F=I()(s.TcView).withConfig({displayName:"responsive__MetaContainer",componentId:"ba1gpd-7"})(["align-items:center;justify-content:center;@media (min-width:","px){flex-direction:row;flex-wrap:wrap;}"],O.breakpoints.medium),L=I()(s.TcView).withConfig({displayName:"responsive__Separator",componentId:"ba1gpd-8"})(["display:none;@media (min-width:","px){background-color:",";display:flex;height:",";margin:0 ",";width:1px;}"],O.breakpoints.medium,O.colours.functional.keyline,Object(O.spacing)(3),Object(O.spacing)(2)),B=I.a.h2.withConfig({displayName:"responsive__StandfirstContainer",componentId:"ba1gpd-9"})(["border:0px solid black;box-sizing:border-box;display:inline;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,O.breakpoints.medium,O.fontSizes.infoTitle,Object(O.lineHeight)({font:"bodyRegular",fontSize:"infoTitle"}),Object(O.spacing)(5),O.breakpoints.wide,Object(O.spacing)(4));var M=e=>{let t=e.bylines,r=e.publicationName,a=e.publishedTime;return i.a.createElement(F,null,Object(p.hasBylineData)(t)&&i.a.createElement(n.Fragment,null,i.a.createElement(V,{styles:T.meta},i.a.createElement(p.ArticleBylineWithLinks,{ast:t})),i.a.createElement(L,null)),i.a.createElement(V,{styles:T.meta},i.a.createElement(N,{styles:Object(s.checkStylesForUnits)(T.datePublication)},i.a.createElement(_.a,{date:a,publication:r}))))};const W=e=>{let t=e.standfirst;return t?i.a.createElement(B,{role:"heading","aria-level":"2",styles:Object(s.checkStylesForUnits)(T.standFirst),testID:"standfirst"},t):null};W.defaultProps={standfirst:null};var U=W;j.a.string.isRequired,j.a.arrayOf(j.a.shape({})).isRequired,j.a.arrayOf(j.a.shape({expiryTime:j.a.string,type:j.a.string})),j.a.bool,j.a.string.isRequired,j.a.string,j.a.bool,j.a.string.isRequired,j.a.string.isRequired,j.a.bool,j.a.string,j.a.string;function G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?G(Object(r),!0).forEach((function(t){J(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function J(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const K=e=>{let t=e.authorImage,r=e.bylines,n=e.flags,a=e.hasVideo,o=e.headline,d=e.label,b=e.publicationName,m=e.showAudioPlayer,g=e.publishedTime,f=e.standfirst,y=e.updatedTime;return i.a.createElement(z,{style:Q(Q({},T.header),T.container)},i.a.createElement(R,{style:T.authorImage},i.a.createElement(u.a,{aspectRatio:1,uri:t,accessibilityLabel:"author-image"})),i.a.createElement(S,{isVideo:a,label:d}),i.a.createElement(A,{role:"heading","aria-level":"1",styles:Object(s.checkStylesForUnits)(T.articleHeadline)},o),i.a.createElement(H,null,i.a.createElement(l.UpdatedTimeProvider,{updatedTime:y},i.a.createElement(l.ArticleFlags,{flags:n}))),i.a.createElement(U,{standfirst:f}),i.a.createElement(M,{bylines:r,publicationName:b,publishedTime:g}),i.a.createElement(c.TCThemeProvider,null,i.a.createElement(c.InArticleAudio,{showAudioPlayer:m,src:"",readyToPlayText:"Listen to article",playingText:"Playing",narrator:Object(p.hasBylineData)(r)?r[0].byline[0].children[0].attributes.value:"",headline:o,feedback:{requestFeedback:!0,feedbackMessage:"Want to listen to more articles? Give your feedback below or email",thankyouMessage:"Thank you for your feedback. We're always trying to give you the best possible experience – your feedback helps us do this."}})))};K.defaultProps={flags:[],hasVideo:!1,label:null,longRead:!1,standfirst:null,updatedTime:null};var X=K;function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Y(Object(r),!0).forEach((function(t){$(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Z(Z({},{analyticsStream:j.a.func.isRequired,article:j.a.shape({}),error:j.a.shape({graphQLErrors:j.a.array,message:j.a.string,networkError:j.a.shape({message:j.a.string})}),isLoading:j.a.bool,onImagePress:j.a.func,receiveChildList:j.a.func.isRequired,zephrDivs:j.a.bool,showAudioPlayer:j.a.bool}),{},{navigationMode:j.a.shape({}).isRequired,storefrontConfig:j.a.string.isRequired});const ee=Z({},{article:null,error:null,isLoading:!1,onImagePress:null,showAudioPlayer:!1});class te extends n.Component{constructor(e){super(e),this.renderHeader=this.renderHeader.bind(this)}renderHeader(){const e=this.props,t=e.article,r=e.showAudioPlayer,n=t.bylines,a=t.expirableFlags,o=t.hasVideo,l=t.headline,c=t.label,p=t.publicationName,d=t.publishedTime,u=t.shortHeadline,b=t.standfirst,m=t.updatedTime,g=n&&n.length>0&&n[0].image&&0!==Object.keys(n[0].image).length&&n[0].image.crop?n[0].image.crop.url:null;return i.a.createElement(X,{authorImage:g,bylines:n,flags:a,hasVideo:o,headline:Object(s.getHeadline)(l,u),label:c,publicationName:p,publishedTime:d,standfirst:b,updatedTime:m,showAudioPlayer:r})}render(){const e=this.props,t=e.article,r=e.analyticsStream,n=e.error,a=e.isLoading,s=e.logoUrl,l=e.navigationMode,c=e.receiveChildList,p=e.commentingConfig,d=e.paidContentClassName,u=e.isPreview,b=e.showAudioPlayer,m=e.swgProductId,g=e.zephrDivs,f=e.storefrontConfig;return n||a?null:i.a.createElement(o.a,{analyticsStream:r,data:t,Header:this.renderHeader,logoUrl:s,receiveChildList:c,navigationMode:l,commentingConfig:p,paidContentClassName:d,isPreview:u,swgProductId:m,zephrDivs:g,showAudioPlayer:b,storefrontConfig:f})}}te.defaultProps=ee;t.default=te}]);
|