@times-components/author-profile 6.17.55 → 6.17.56
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 +8 -0
- package/dist/author-profile-head-base.js +3 -11
- package/dist/author-profile-head-jobtitle.js +3 -15
- package/package.json +18 -19
- package/rnw.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [6.17.56](https://github.com/newsuk/times-components/compare/@times-components/author-profile@6.17.55...@times-components/author-profile@6.17.56) (2024-05-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @times-components/author-profile
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [6.17.55](https://github.com/newsuk/times-components/compare/@times-components/author-profile@6.17.54...@times-components/author-profile@6.17.55) (2024-05-24)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @times-components/author-profile
|
|
@@ -15,8 +15,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
15
15
|
|
|
16
16
|
var _tsStyleguide = require("@times-components/ts-styleguide");
|
|
17
17
|
|
|
18
|
-
var _newskit = require("newskit");
|
|
19
|
-
|
|
20
18
|
var _authorProfileHeadLoading = _interopRequireDefault(require("./author-profile-head-loading"));
|
|
21
19
|
|
|
22
20
|
var _authorProfileHeadJobtitle = _interopRequireDefault(require("./author-profile-head-jobtitle"));
|
|
@@ -40,10 +38,7 @@ var AuthorProfileHeadBase = (0, _react.memo)(function (_ref) {
|
|
|
40
38
|
renderBiography = _ref.renderBiography,
|
|
41
39
|
renderImage = _ref.renderImage,
|
|
42
40
|
renderName = _ref.renderName,
|
|
43
|
-
twitter = _ref.twitter
|
|
44
|
-
contractualTitle = _ref.contractualTitle;
|
|
45
|
-
var breakpoint = (0, _newskit.useBreakpointKey)();
|
|
46
|
-
var isLargeDevice = breakpoint === "lg" || breakpoint === "xl";
|
|
41
|
+
twitter = _ref.twitter;
|
|
47
42
|
|
|
48
43
|
if (isLoading) {
|
|
49
44
|
return /*#__PURE__*/_react["default"].createElement(_authorProfileHeadLoading["default"], null);
|
|
@@ -52,9 +47,7 @@ var AuthorProfileHeadBase = (0, _react.memo)(function (_ref) {
|
|
|
52
47
|
var renderJobTitle = function renderJobTitle() {
|
|
53
48
|
if (!jobTitle) return null;
|
|
54
49
|
return /*#__PURE__*/_react["default"].createElement(_authorProfileHeadJobtitle["default"], {
|
|
55
|
-
jobTitle: jobTitle
|
|
56
|
-
contractualTitle: contractualTitle,
|
|
57
|
-
isLargeDevice: isLargeDevice
|
|
50
|
+
jobTitle: jobTitle
|
|
58
51
|
});
|
|
59
52
|
};
|
|
60
53
|
|
|
@@ -84,8 +77,7 @@ AuthorProfileHeadBase.propTypes = {
|
|
|
84
77
|
renderBiography: _propTypes["default"].func.isRequired,
|
|
85
78
|
renderImage: _propTypes["default"].func.isRequired,
|
|
86
79
|
renderName: _propTypes["default"].func.isRequired,
|
|
87
|
-
twitter: _propTypes["default"].string
|
|
88
|
-
contractualTitle: _propTypes["default"].string
|
|
80
|
+
twitter: _propTypes["default"].string
|
|
89
81
|
};
|
|
90
82
|
AuthorProfileHeadBase.defaultProps = {
|
|
91
83
|
isLoading: true,
|
|
@@ -11,8 +11,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _utils = require("@times-components/utils");
|
|
13
13
|
|
|
14
|
-
var _tsNewskit = require("@times-components/ts-newskit");
|
|
15
|
-
|
|
16
14
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
17
15
|
|
|
18
16
|
var _responsive = require("./styles/responsive");
|
|
@@ -20,28 +18,18 @@ var _responsive = require("./styles/responsive");
|
|
|
20
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
19
|
|
|
22
20
|
var AuthorProfileHeadJobTitle = function AuthorProfileHeadJobTitle(_ref) {
|
|
23
|
-
var jobTitle = _ref.jobTitle
|
|
24
|
-
contractualTitle = _ref.contractualTitle,
|
|
25
|
-
isLargeDevice = _ref.isLargeDevice;
|
|
21
|
+
var jobTitle = _ref.jobTitle;
|
|
26
22
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
27
23
|
style: (0, _utils.checkStylesForUnits)(_styles["default"].jobTitleContainer)
|
|
28
24
|
}, /*#__PURE__*/_react["default"].createElement(_responsive.AuthorProfileHeadJobTitleContainer, {
|
|
29
25
|
role: "heading",
|
|
30
26
|
"aria-level": "2",
|
|
31
27
|
style: (0, _utils.checkStylesForUnits)(_styles["default"].jobTitle)
|
|
32
|
-
}, jobTitle.toLowerCase())
|
|
33
|
-
contractualTitle: contractualTitle,
|
|
34
|
-
isLargeDevice: isLargeDevice
|
|
35
|
-
}) : null);
|
|
28
|
+
}, jobTitle.toLowerCase()));
|
|
36
29
|
};
|
|
37
30
|
|
|
38
31
|
AuthorProfileHeadJobTitle.propTypes = {
|
|
39
|
-
jobTitle: _propTypes["default"].string.isRequired
|
|
40
|
-
contractualTitle: _propTypes["default"].string,
|
|
41
|
-
isLargeDevice: _propTypes["default"].bool.isRequired
|
|
42
|
-
};
|
|
43
|
-
AuthorProfileHeadJobTitle.defaultProps = {
|
|
44
|
-
contractualTitle: ""
|
|
32
|
+
jobTitle: _propTypes["default"].string.isRequired
|
|
45
33
|
};
|
|
46
34
|
var _default = AuthorProfileHeadJobTitle;
|
|
47
35
|
exports["default"] = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/author-profile",
|
|
3
|
-
"version": "6.17.
|
|
3
|
+
"version": "6.17.56",
|
|
4
4
|
"description": "Author profile information along with a list of articles they have written ",
|
|
5
5
|
"main": "dist/author-profile",
|
|
6
6
|
"dev": "src/author-profile",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"homepage": "https://github.com/newsuk/times-components#readme",
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@babel/core": "7.4.4",
|
|
36
|
-
"@times-components/ad": "2.22.
|
|
36
|
+
"@times-components/ad": "2.22.10",
|
|
37
37
|
"@times-components/eslint-config-thetimes": "0.8.18",
|
|
38
38
|
"@times-components/jest-configurator-web": "0.8.2",
|
|
39
|
-
"@times-components/jest-serializer": "3.13.
|
|
39
|
+
"@times-components/jest-serializer": "3.13.13",
|
|
40
40
|
"@times-components/provider-queries": "2.21.1",
|
|
41
41
|
"@times-components/provider-test-tools": "1.29.3",
|
|
42
|
-
"@times-components/storybook": "4.12.
|
|
42
|
+
"@times-components/storybook": "4.12.21",
|
|
43
43
|
"@times-components/tealium-utils": "0.9.1",
|
|
44
44
|
"@times-components/test-utils": "2.4.2",
|
|
45
45
|
"@times-components/webpack-configurator": "2.1.1",
|
|
@@ -59,22 +59,21 @@
|
|
|
59
59
|
"webpack": "4.30.0"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@times-components/article-list": "9.17.
|
|
63
|
-
"@times-components/gradient": "3.5.
|
|
64
|
-
"@times-components/icons": "2.21.
|
|
65
|
-
"@times-components/image": "6.17.
|
|
66
|
-
"@times-components/link": "3.17.
|
|
67
|
-
"@times-components/markup": "3.8.
|
|
62
|
+
"@times-components/article-list": "9.17.65",
|
|
63
|
+
"@times-components/gradient": "3.5.48",
|
|
64
|
+
"@times-components/icons": "2.21.27",
|
|
65
|
+
"@times-components/image": "6.17.8",
|
|
66
|
+
"@times-components/link": "3.17.21",
|
|
67
|
+
"@times-components/markup": "3.8.48",
|
|
68
68
|
"@times-components/markup-forest": "1.9.2",
|
|
69
|
-
"@times-components/pagination": "3.13.
|
|
70
|
-
"@times-components/provider": "1.40.
|
|
71
|
-
"@times-components/responsive": "0.21.
|
|
72
|
-
"@times-components/tracking": "2.22.
|
|
73
|
-
"@times-components/ts-newskit": "1.
|
|
74
|
-
"@times-components/ts-styleguide": "1.50.
|
|
75
|
-
"@times-components/utils": "6.20.
|
|
69
|
+
"@times-components/pagination": "3.13.7",
|
|
70
|
+
"@times-components/provider": "1.40.22",
|
|
71
|
+
"@times-components/responsive": "0.21.9",
|
|
72
|
+
"@times-components/tracking": "2.22.21",
|
|
73
|
+
"@times-components/ts-newskit": "1.182.0",
|
|
74
|
+
"@times-components/ts-styleguide": "1.50.21",
|
|
75
|
+
"@times-components/utils": "6.20.6",
|
|
76
76
|
"lodash.get": "4.4.2",
|
|
77
|
-
"newskit": "7.2.0",
|
|
78
77
|
"prop-types": "15.7.2",
|
|
79
78
|
"react-helmet-async": "1.0.2",
|
|
80
79
|
"styled-components": "4.3.2"
|
|
@@ -90,5 +89,5 @@
|
|
|
90
89
|
"publishConfig": {
|
|
91
90
|
"access": "public"
|
|
92
91
|
},
|
|
93
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "a15ae6ee757b637e601a7019656d1596650a6d56"
|
|
94
93
|
}
|
package/rnw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.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 o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));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=20)}([function(e,t){e.exports=require("react")},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("@times-components/utils/rnw")},function(e,t){e.exports=require("@times-components/markup-forest/rnw")},function(e,t){e.exports=require("styled-components")},function(e,t){var r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/,o=/^\./,i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,c=/^\[object .+?Constructor\]$/,l="object"==typeof global&&global&&global.Object===Object&&global,u="object"==typeof self&&self&&self.Object===Object&&self,s=l||u||Function("return this")();var p,f=Array.prototype,d=Function.prototype,b=Object.prototype,g=s["__core-js_shared__"],m=(p=/[^.]+$/.exec(g&&g.keys&&g.keys.IE_PROTO||""))?"Symbol(src)_1."+p:"",h=d.toString,y=b.hasOwnProperty,w=b.toString,O=RegExp("^"+h.call(y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=s.Symbol,v=f.splice,P=A(s,"Map"),_=A(Object,"create"),x=j?j.prototype:void 0,T=x?x.toString:void 0;function k(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function S(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function E(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function L(e,t){for(var r,n,o=e.length;o--;)if((r=e[o][0])===(n=t)||r!=r&&n!=n)return o;return-1}function D(e,t){for(var o,i=0,a=(t=function(e,t){if(R(e))return!1;var o=typeof e;if("number"==o||"symbol"==o||"boolean"==o||null==e||B(e))return!0;return n.test(e)||!r.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:R(o=t)?o:q(o)).length;null!=e&&i<a;)e=e[z(t[i++])];return i&&i==a?e:void 0}function C(e){return!(!F(e)||(t=e,m&&m in t))&&(function(e){var t=F(e)?w.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?O:c).test(function(e){if(null!=e){try{return h.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function I(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function A(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return C(r)?r:void 0}k.prototype.clear=function(){this.__data__=_?_(null):{}},k.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},k.prototype.get=function(e){var t=this.__data__;if(_){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return y.call(t,e)?t[e]:void 0},k.prototype.has=function(e){var t=this.__data__;return _?void 0!==t[e]:y.call(t,e)},k.prototype.set=function(e,t){return this.__data__[e]=_&&void 0===t?"__lodash_hash_undefined__":t,this},S.prototype.clear=function(){this.__data__=[]},S.prototype.delete=function(e){var t=this.__data__,r=L(t,e);return!(r<0)&&(r==t.length-1?t.pop():v.call(t,r,1),!0)},S.prototype.get=function(e){var t=this.__data__,r=L(t,e);return r<0?void 0:t[r][1]},S.prototype.has=function(e){return L(this.__data__,e)>-1},S.prototype.set=function(e,t){var r=this.__data__,n=L(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},E.prototype.clear=function(){this.__data__={hash:new k,map:new(P||S),string:new k}},E.prototype.delete=function(e){return I(this,e).delete(e)},E.prototype.get=function(e){return I(this,e).get(e)},E.prototype.has=function(e){return I(this,e).has(e)},E.prototype.set=function(e,t){return I(this,e).set(e,t),this};var q=N((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(B(e))return T?T.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var r=[];return o.test(e)&&r.push(""),e.replace(i,(function(e,t,n,o){r.push(n?o.replace(a,"$1"):t||e)})),r}));function z(e){if("string"==typeof e||B(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function N(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a),a};return r.cache=new(N.Cache||E),r}N.Cache=E;var R=Array.isArray;function F(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function B(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==w.call(e)}e.exports=function(e,t,r){var n=null==e?void 0:D(e,t);return void 0===n?r:n}},function(e,t){e.exports=require("@times-components/tracking/rnw")},function(e,t){e.exports=require("@times-components/article-list/rnw")},function(e,t){e.exports=require("@times-components/provider/rnw")},function(e,t){e.exports=require("@times-components/pagination/rnw")},function(e,t){e.exports=require("@times-components/responsive/rnw")},function(e,t){e.exports=require("newskit")},function(e,t){e.exports=require("@times-components/gradient/rnw")},function(e,t){e.exports=require("@times-components/ts-newskit/rnw")},function(e,t){e.exports=require("@times-components/icons/rnw")},function(e,t){e.exports=require("@times-components/link/rnw")},function(e,t){e.exports=require("@times-components/markup/rnw")},function(e,t){e.exports=require("@times-components/image/rnw")},function(e,t){e.exports=require("react-helmet-async")},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),i=r(6),a=r.n(i),c=r(8),l=r.n(c),u=r(10),s=r(9),p=r(11),f=r.n(p),d=r(3),b=r(2),g=r.n(b),m=r(4),h=r.n(m);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 w(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){O(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 O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var j=w({},{biography:g.a.arrayOf(m.propTypes),isLoading:g.a.bool,jobTitle:g.a.string,name:g.a.string,twitter:g.a.string,uri:g.a.string,metaDescription:g.a.string,contractualTitle:g.a.string}),v=w({},{biography:[],isLoading:!0,jobTitle:"",name:"",twitter:"",uri:"",metaDescription:"",contractualTitle:""}),P=r(1),_=r(12),x=r(13),T=r.n(x);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 S(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){E(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}function E(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var L={authorHeadContainer:{alignItems:"center",backgroundColor:P.colours.functional.backgroundPrimary,borderBottomColor:P.colours.functional.border,borderBottomWidth:1,flexDirection:"column",paddingBottom:Object(P.spacing)(8),width:"100%"},authorHeadWrapper:{alignItems:"center",backgroundColor:"transparent",width:"100%"},authorPhoto:{borderColor:P.colours.functional.contrast,borderRadius:50,marginLeft:"auto",marginRight:"auto",overflow:"hidden",width:100},biography:S(S({color:P.colours.functional.primary},Object(P.fontFactory)({font:"body",fontSize:"secondary"})),{},{textAlign:"center"}),biographyContainer:{paddingBottom:Object(P.spacing)(6),paddingLeft:Object(P.spacing)(2),paddingRight:Object(P.spacing)(2),width:"100%"},jobTitle:S({color:P.colours.functional.secondary},Object(P.fontFactory)({font:"bodyRegularSmallCaps",fontSize:"meta"})),loadingContainer:{alignItems:"center",backgroundColor:P.colours.functional.backgroundPrimary,borderBottomColor:P.colours.functional.border,borderBottomWidth:1,minHeight:264,width:"100%"},loadingGradient:{flex:1},loadingRoundImage:{borderColor:P.colours.functional.contrast,borderRadius:50,height:100,overflow:"hidden",position:"absolute",top:Object(P.spacing)(6),width:100},name:S({color:P.colours.functional.brandColour},Object(P.fontFactory)({font:"headline",fontSize:"headline"})),twitter:{flexDirection:"row",paddingTop:Object(P.spacing)(2),paddingBottom:Object(P.spacing)(2)},twitterLink:S(S({color:P.colours.functional.action},Object(P.fontFactory)({font:"supporting",fontSize:"tertiaryTwitter"})),{},{paddingLeft:Object(P.spacing)(1),textDecorationLine:"none"})};function D(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){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?D(Object(r),!0).forEach((function(t){I(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function I(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var A=C(C({},L),{},{jobTitle:C(C({},L.jobTitle),{},{WebkitFontSmoothing:"antialiased"}),twitter:C(C({},L.twitter),{},{alignItems:"flex-end",paddingBottom:Object(P.spacing)(2),paddingTop:Object(P.spacing)(3)}),twitterIcon:{alignSelf:"center"},twitterLink:C({},L.twitterLink),jobTitleContainer:{display:"flex",alignItems:"center"}}),q=function(){return o.a.createElement(d.TcView,{style:A.loadingContainer},o.a.createElement(d.TcView,{style:A.loadingRoundImage},o.a.createElement(T.a,{style:A.loadingGradient})))},z=r(14),N=r(5),R=r.n(N),F=R()(d.TcView).withConfig({displayName:"responsive__AuthorHeadWrapper",componentId:"sc-1vsivj7-0"})(["width:100%;padding-top:30px;@media (min-width:","px){padding-top:60px;}"],P.breakpoints.medium),B=R.a.h1.withConfig({displayName:"responsive__AuthorNameWrapper",componentId:"sc-1vsivj7-1"})(["border:0px solid black;box-sizing:border-box;display:inline;margin:0px;margin-bottom:12px;padding:0px;white-space:pre-wrap;overflow-wrap:break-word;color:",";font-family:",";font-size:","px;@media (min-width:","px){font-size:","px;margin-bottom:14px;}"],P.colours.functional.brandColour,P.fontsWithFallback.headline,P.fontSizes.headline,P.breakpoints.medium,P.fontSizes.articleHeadline),H=R()(d.TcView).withConfig({displayName:"responsive__BioContainer",componentId:"sc-1vsivj7-2"})(["width:100%;padding-left:",";padding-right:",";padding-top:6px;@media (min-width:","px){padding-left:0;padding-right:0;max-width:680px;padding-top:16px;}@media (min-width:","px){max-width:760px;}"],Object(P.spacing)(2),Object(P.spacing)(2),P.breakpoints.medium,P.breakpoints.huge),M=R()(d.TcView).withConfig({displayName:"responsive__ImageContainer",componentId:"sc-1vsivj7-3"})(["width:100%;margin-bottom:14px;@media (min-width:","px){margin-bottom:23px;}"],P.breakpoints.medium),W=R.a.h2.withConfig({displayName:"responsive__AuthorProfileHeadJobTitleContainer",componentId:"sc-1vsivj7-4"})(["border:0px solid black;box-sizing:border-box;color:rgb(0,0,0);display:inline;font-size:14px;font-family:sans-serif;margin:0px;padding:0px;white-space:pre-wrap;overflow-wrap:break-word;"]),$=function(e){var t=e.jobTitle,r=e.contractualTitle,n=e.isLargeDevice;return o.a.createElement("div",{style:Object(d.checkStylesForUnits)(A.jobTitleContainer)},o.a.createElement(W,{role:"heading","aria-level":"2",style:Object(d.checkStylesForUnits)(A.jobTitle)},t.toLowerCase()),r?o.a.createElement(z.JobTitle,{contractualTitle:r,isLargeDevice:n}):null)};$.defaultProps={contractualTitle:""};var V=$,U=r(15),G=r(16),J=function(e){var t=e.onTwitterLinkPress,r=e.twitter,n=e.url;return o.a.createElement(d.TcView,{style:A.twitter},o.a.createElement(d.TcView,{style:A.twitterIcon},o.a.createElement(U.IconTwitter,{fillColour:"currentColor",height:12,width:12})),o.a.createElement(G.TextLink,{onPress:function(e){return t(e,{twitter:r,url:n})},style:A.twitterLink,testID:"twitterLink",url:n},"@",r))},K=r(7),Q=Object(n.memo)((function(e){var t=e.isLoading,r=e.jobTitle,n=e.onTwitterLinkPress,i=e.renderBiography,a=e.renderImage,c=e.renderName,l=e.twitter,u=e.contractualTitle,s=Object(_.useBreakpointKey)(),p="lg"===s||"xl"===s;if(t)return o.a.createElement(q,null);return o.a.createElement(P.Animations.FadeIn,{style:{width:"100%"}},o.a.createElement(d.TcView,{style:A.authorHeadWrapper,"data-testid":"author-head"},a(),c(),r?o.a.createElement(V,{jobTitle:r,contractualTitle:u,isLargeDevice:p}):null,function(){if(!l)return null;var e="https://twitter.com/".concat(l);return o.a.createElement(J,{onTwitterLinkPress:n,twitter:l,url:e})}(),i()))}));Q.defaultProps={isLoading:!0,jobTitle:"",onTwitterLinkPress:function(){},twitter:""};var X,Y=(X=Q,Object(K.withTrackEvents)(X,{analyticsEvents:[{actionName:"Pressed",eventName:"onTwitterLinkPress",getAttrs:function(e,t){return{twitterHandle:e.twitter,url:t[1]&&t[1].url}},trackingName:"TwitterLink"}]})),Z=r(17),ee=r.n(Z),te=function(e){var t=e.biography;return o.a.createElement(d.TcText,{style:Object(d.checkStylesForUnits)(A.biography),"data-testid":"author-bio"},h()(t,ee.a))},re=r(18),ne=r.n(re);function oe(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 ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach((function(t){ae(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ae(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ce=ie(ie({},L),{},{jobTitle:ie(ie({},L.jobTitle),{},{WebkitFontSmoothing:"antialiased"}),twitter:ie(ie({},L.twitter),{},{alignItems:"flex-end",paddingBottom:Object(P.spacing)(2),paddingTop:Object(P.spacing)(3)}),twitterIcon:{alignSelf:"center"},twitterLink:ie({},L.twitterLink)}),le=function(e){var t=e.uri;return o.a.createElement(ne.a,{aspectRatio:1,style:ce.authorPhoto,uri:t,accessibilityLabel:"author-image"})};le.defaultProps={uri:""};var ue=le,se=function(e){var t=e.biography,r=e.isLoading,n=e.jobTitle,i=e.name,a=e.twitter,c=e.uri,l=e.contractualTitle,u=e.isLargeDevice;return o.a.createElement(F,{style:A.authorHeadContainer},o.a.createElement(Y,{isLoading:r,jobTitle:n,renderBiography:function(){return t?o.a.createElement(H,{style:A.biographyContainer},o.a.createElement(te,{biography:t})):null},renderImage:function(){return c?o.a.createElement(M,{className:"lcpItem"},o.a.createElement(ue,{uri:c})):null},renderName:function(){return i?o.a.createElement(B,{role:"heading","aria-level":"1","data-testid":"author-name"},i):null},twitter:a,contractualTitle:l,isLargeDevice:u}))};se.defaultProps=v;var pe=se;function fe(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 de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(r),!0).forEach((function(t){be(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function be(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}de(de({},{author:g.a.shape({biography:j.biography,image:j.uri,jobTitle:j.jobTitle,name:j.name,twitter:j.twitter,metaDescription:g.a.string}),error:g.a.object,isLoading:j.isLoading,page:g.a.number,pageSize:g.a.number,refetch:g.a.func.isRequired,slug:g.a.string.isRequired}),{},{onNext:g.a.func.isRequired,onPrev:g.a.func.isRequired});var ge=de({},{author:null,error:null,isLoading:!0,page:1,pageSize:10}),me=r(19);function he(e){var t=e.metaDescription,r=e.description,n=e.name,i="Get up to date information and read all the latest articles from ".concat(n,".");return t?i=t:r&&r.length&&(i=Object(m.renderTreeArrayAsText)(r).substring(0,200)),o.a.createElement(me.Helmet,null,o.a.createElement("title",null,n," | The Times & The Sunday Times"),o.a.createElement("meta",{content:i,name:"description"}))}he.defaultProps={metaDescription:null};var ye=he;function we(e){return function(e){if(Array.isArray(e))return Oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Oe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function je(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 ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?je(Object(r),!0).forEach((function(t){Pe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):je(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _e=function(e){var t=e.author,r=e.error,n=e.isLoading,i=e.onArticlePress,u=e.onNext,p=e.onPrev,b=e.onTwitterLinkPress,g=e.page,m=e.pageSize,h=e.refetch,y=e.slug,w=e.metaDescription;if(r)return o.a.createElement(c.ArticleListPageError,{refetch:h});var O=n?{articles:[],image:"",jobTitle:"",name:"",twitter:"",contractualTitle:""}:t,j=O.articles,v=O.biography,P=O.hasLeadAssets,_=void 0===P||P,x=O.image,T=O.jobTitle,k=O.name,S=O.twitter,E=O.contractualTitle,L=o.a.createElement(pe,{biography:v,isLoading:n,jobTitle:T,name:k,onTwitterLinkPress:b,twitter:S,uri:x,contractualTitle:E}),D=_?s.AuthorArticlesWithImagesProvider:s.AuthorArticlesNoImagesProvider;return o.a.createElement(D,{articleImageRatio:"3:2",debounceTimeMs:250,page:g,pageSize:m,slug:y},(function(e){var t=e.author,r=e.error,n=e.isLoading,c=e.pageSize,s=e.refetch,b=e.fetchMore,m=e.variables.imageRatio,h=void 0===m?"3:2":m;return o.a.createElement(f.a,null,o.a.createElement(ye,{metaDescription:w,description:v,name:k}),o.a.createElement(l.a,{articleListHeader:L,articles:a()(t,"articles.list",[]),articlesLoading:n,count:a()(j,"count",0),emptyStateMessage:"Unfortunately, there are no articles relating to this author",error:r,fetchMore:function(e){return b({updateQuery:function(e,t){var r=t.fetchMoreResult;return r?{author:ve(ve({},e.author),{},{articles:ve(ve({},e.author.articles),{},{list:[].concat(we(e.author.articles.list),we(r.author.articles.list))})})}:e},variables:{skip:e}})},imageRatio:Object(d.ratioTextToFloat)(h),onArticlePress:i,onNext:u,onPrev:p,page:g,pageSize:c,refetch:s,showImages:_}))}))};_e.defaultProps=ge;t.default=Object(u.withPageState)(function(e){return Object(K.withTrackingContext)(e,{getAttrs:function(e){var t=e.author,r=e.page,n=e.pageSize;return{articlesCount:a()(t,"articles.count",0),authorName:t&&t.name,page:r,pageSize:n}},trackingObjectName:"AuthorProfile"})}(_e))}]);
|
|
1
|
+
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.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 o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));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=18)}([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("@times-components/markup-forest/rnw")},function(e,t){e.exports=require("styled-components")},function(e,t){var r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/,o=/^\./,i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,c=/^\[object .+?Constructor\]$/,u="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,s=u||l||Function("return this")();var p,f=Array.prototype,d=Function.prototype,b=Object.prototype,g=s["__core-js_shared__"],m=(p=/[^.]+$/.exec(g&&g.keys&&g.keys.IE_PROTO||""))?"Symbol(src)_1."+p:"",h=d.toString,y=b.hasOwnProperty,w=b.toString,O=RegExp("^"+h.call(y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=s.Symbol,v=f.splice,P=A(s,"Map"),_=A(Object,"create"),x=j?j.prototype:void 0,T=x?x.toString:void 0;function S(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function k(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function E(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function L(e,t){for(var r,n,o=e.length;o--;)if((r=e[o][0])===(n=t)||r!=r&&n!=n)return o;return-1}function D(e,t){for(var o,i=0,a=(t=function(e,t){if(R(e))return!1;var o=typeof e;if("number"==o||"symbol"==o||"boolean"==o||null==e||B(e))return!0;return n.test(e)||!r.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:R(o=t)?o:q(o)).length;null!=e&&i<a;)e=e[z(t[i++])];return i&&i==a?e:void 0}function C(e){return!(!F(e)||(t=e,m&&m in t))&&(function(e){var t=F(e)?w.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?O:c).test(function(e){if(null!=e){try{return h.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t}function I(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function A(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return C(r)?r:void 0}S.prototype.clear=function(){this.__data__=_?_(null):{}},S.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},S.prototype.get=function(e){var t=this.__data__;if(_){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return y.call(t,e)?t[e]:void 0},S.prototype.has=function(e){var t=this.__data__;return _?void 0!==t[e]:y.call(t,e)},S.prototype.set=function(e,t){return this.__data__[e]=_&&void 0===t?"__lodash_hash_undefined__":t,this},k.prototype.clear=function(){this.__data__=[]},k.prototype.delete=function(e){var t=this.__data__,r=L(t,e);return!(r<0)&&(r==t.length-1?t.pop():v.call(t,r,1),!0)},k.prototype.get=function(e){var t=this.__data__,r=L(t,e);return r<0?void 0:t[r][1]},k.prototype.has=function(e){return L(this.__data__,e)>-1},k.prototype.set=function(e,t){var r=this.__data__,n=L(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},E.prototype.clear=function(){this.__data__={hash:new S,map:new(P||k),string:new S}},E.prototype.delete=function(e){return I(this,e).delete(e)},E.prototype.get=function(e){return I(this,e).get(e)},E.prototype.has=function(e){return I(this,e).has(e)},E.prototype.set=function(e,t){return I(this,e).set(e,t),this};var q=N((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(B(e))return T?T.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var r=[];return o.test(e)&&r.push(""),e.replace(i,(function(e,t,n,o){r.push(n?o.replace(a,"$1"):t||e)})),r}));function z(e){if("string"==typeof e||B(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function N(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a),a};return r.cache=new(N.Cache||E),r}N.Cache=E;var R=Array.isArray;function F(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function B(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==w.call(e)}e.exports=function(e,t,r){var n=null==e?void 0:D(e,t);return void 0===n?r:n}},function(e,t){e.exports=require("@times-components/tracking/rnw")},function(e,t){e.exports=require("@times-components/article-list/rnw")},function(e,t){e.exports=require("@times-components/provider/rnw")},function(e,t){e.exports=require("@times-components/pagination/rnw")},function(e,t){e.exports=require("@times-components/responsive/rnw")},function(e,t){e.exports=require("@times-components/gradient/rnw")},function(e,t){e.exports=require("@times-components/icons/rnw")},function(e,t){e.exports=require("@times-components/link/rnw")},function(e,t){e.exports=require("@times-components/markup/rnw")},function(e,t){e.exports=require("@times-components/image/rnw")},function(e,t){e.exports=require("react-helmet-async")},function(e,t,r){"use strict";r.r(t);var n=r(1),o=r.n(n),i=r(6),a=r.n(i),c=r(8),u=r.n(c),l=r(10),s=r(9),p=r(11),f=r.n(p),d=r(3),b=r(2),g=r.n(b),m=r(4),h=r.n(m);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 w(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){O(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 O(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var j=w({},{biography:g.a.arrayOf(m.propTypes),isLoading:g.a.bool,jobTitle:g.a.string,name:g.a.string,twitter:g.a.string,uri:g.a.string,metaDescription:g.a.string,contractualTitle:g.a.string}),v=w({},{biography:[],isLoading:!0,jobTitle:"",name:"",twitter:"",uri:"",metaDescription:"",contractualTitle:""}),P=r(0),_=r(12),x=r.n(_);function T(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 S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach((function(t){k(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}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 E={authorHeadContainer:{alignItems:"center",backgroundColor:P.colours.functional.backgroundPrimary,borderBottomColor:P.colours.functional.border,borderBottomWidth:1,flexDirection:"column",paddingBottom:Object(P.spacing)(8),width:"100%"},authorHeadWrapper:{alignItems:"center",backgroundColor:"transparent",width:"100%"},authorPhoto:{borderColor:P.colours.functional.contrast,borderRadius:50,marginLeft:"auto",marginRight:"auto",overflow:"hidden",width:100},biography:S(S({color:P.colours.functional.primary},Object(P.fontFactory)({font:"body",fontSize:"secondary"})),{},{textAlign:"center"}),biographyContainer:{paddingBottom:Object(P.spacing)(6),paddingLeft:Object(P.spacing)(2),paddingRight:Object(P.spacing)(2),width:"100%"},jobTitle:S({color:P.colours.functional.secondary},Object(P.fontFactory)({font:"bodyRegularSmallCaps",fontSize:"meta"})),loadingContainer:{alignItems:"center",backgroundColor:P.colours.functional.backgroundPrimary,borderBottomColor:P.colours.functional.border,borderBottomWidth:1,minHeight:264,width:"100%"},loadingGradient:{flex:1},loadingRoundImage:{borderColor:P.colours.functional.contrast,borderRadius:50,height:100,overflow:"hidden",position:"absolute",top:Object(P.spacing)(6),width:100},name:S({color:P.colours.functional.brandColour},Object(P.fontFactory)({font:"headline",fontSize:"headline"})),twitter:{flexDirection:"row",paddingTop:Object(P.spacing)(2),paddingBottom:Object(P.spacing)(2)},twitterLink:S(S({color:P.colours.functional.action},Object(P.fontFactory)({font:"supporting",fontSize:"tertiaryTwitter"})),{},{paddingLeft:Object(P.spacing)(1),textDecorationLine:"none"})};function L(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 D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){C(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}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 I=D(D({},E),{},{jobTitle:D(D({},E.jobTitle),{},{WebkitFontSmoothing:"antialiased"}),twitter:D(D({},E.twitter),{},{alignItems:"flex-end",paddingBottom:Object(P.spacing)(2),paddingTop:Object(P.spacing)(3)}),twitterIcon:{alignSelf:"center"},twitterLink:D({},E.twitterLink),jobTitleContainer:{display:"flex",alignItems:"center"}}),A=function(){return o.a.createElement(d.TcView,{style:I.loadingContainer},o.a.createElement(d.TcView,{style:I.loadingRoundImage},o.a.createElement(x.a,{style:I.loadingGradient})))},q=r(5),z=r.n(q),N=z()(d.TcView).withConfig({displayName:"responsive__AuthorHeadWrapper",componentId:"sc-1vsivj7-0"})(["width:100%;padding-top:30px;@media (min-width:","px){padding-top:60px;}"],P.breakpoints.medium),R=z.a.h1.withConfig({displayName:"responsive__AuthorNameWrapper",componentId:"sc-1vsivj7-1"})(["border:0px solid black;box-sizing:border-box;display:inline;margin:0px;margin-bottom:12px;padding:0px;white-space:pre-wrap;overflow-wrap:break-word;color:",";font-family:",";font-size:","px;@media (min-width:","px){font-size:","px;margin-bottom:14px;}"],P.colours.functional.brandColour,P.fontsWithFallback.headline,P.fontSizes.headline,P.breakpoints.medium,P.fontSizes.articleHeadline),F=z()(d.TcView).withConfig({displayName:"responsive__BioContainer",componentId:"sc-1vsivj7-2"})(["width:100%;padding-left:",";padding-right:",";padding-top:6px;@media (min-width:","px){padding-left:0;padding-right:0;max-width:680px;padding-top:16px;}@media (min-width:","px){max-width:760px;}"],Object(P.spacing)(2),Object(P.spacing)(2),P.breakpoints.medium,P.breakpoints.huge),B=z()(d.TcView).withConfig({displayName:"responsive__ImageContainer",componentId:"sc-1vsivj7-3"})(["width:100%;margin-bottom:14px;@media (min-width:","px){margin-bottom:23px;}"],P.breakpoints.medium),H=z.a.h2.withConfig({displayName:"responsive__AuthorProfileHeadJobTitleContainer",componentId:"sc-1vsivj7-4"})(["border:0px solid black;box-sizing:border-box;color:rgb(0,0,0);display:inline;font-size:14px;font-family:sans-serif;margin:0px;padding:0px;white-space:pre-wrap;overflow-wrap:break-word;"]),M=function(e){var t=e.jobTitle;return o.a.createElement("div",{style:Object(d.checkStylesForUnits)(I.jobTitleContainer)},o.a.createElement(H,{role:"heading","aria-level":"2",style:Object(d.checkStylesForUnits)(I.jobTitle)},t.toLowerCase()))},W=r(13),$=r(14),V=function(e){var t=e.onTwitterLinkPress,r=e.twitter,n=e.url;return o.a.createElement(d.TcView,{style:I.twitter},o.a.createElement(d.TcView,{style:I.twitterIcon},o.a.createElement(W.IconTwitter,{fillColour:"currentColor",height:12,width:12})),o.a.createElement($.TextLink,{onPress:function(e){return t(e,{twitter:r,url:n})},style:I.twitterLink,testID:"twitterLink",url:n},"@",r))},U=r(7),G=Object(n.memo)((function(e){var t=e.isLoading,r=e.jobTitle,n=e.onTwitterLinkPress,i=e.renderBiography,a=e.renderImage,c=e.renderName,u=e.twitter;if(t)return o.a.createElement(A,null);return o.a.createElement(P.Animations.FadeIn,{style:{width:"100%"}},o.a.createElement(d.TcView,{style:I.authorHeadWrapper,"data-testid":"author-head"},a(),c(),r?o.a.createElement(M,{jobTitle:r}):null,function(){if(!u)return null;var e="https://twitter.com/".concat(u);return o.a.createElement(V,{onTwitterLinkPress:n,twitter:u,url:e})}(),i()))}));G.defaultProps={isLoading:!0,jobTitle:"",onTwitterLinkPress:function(){},twitter:""};var J,Q=(J=G,Object(U.withTrackEvents)(J,{analyticsEvents:[{actionName:"Pressed",eventName:"onTwitterLinkPress",getAttrs:function(e,t){return{twitterHandle:e.twitter,url:t[1]&&t[1].url}},trackingName:"TwitterLink"}]})),K=r(15),X=r.n(K),Y=function(e){var t=e.biography;return o.a.createElement(d.TcText,{style:Object(d.checkStylesForUnits)(I.biography),"data-testid":"author-bio"},h()(t,X.a))},Z=r(16),ee=r.n(Z);function te(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 re(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?te(Object(r),!0).forEach((function(t){ne(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):te(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ne(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var oe=re(re({},E),{},{jobTitle:re(re({},E.jobTitle),{},{WebkitFontSmoothing:"antialiased"}),twitter:re(re({},E.twitter),{},{alignItems:"flex-end",paddingBottom:Object(P.spacing)(2),paddingTop:Object(P.spacing)(3)}),twitterIcon:{alignSelf:"center"},twitterLink:re({},E.twitterLink)}),ie=function(e){var t=e.uri;return o.a.createElement(ee.a,{aspectRatio:1,style:oe.authorPhoto,uri:t,accessibilityLabel:"author-image"})};ie.defaultProps={uri:""};var ae=ie,ce=function(e){var t=e.biography,r=e.isLoading,n=e.jobTitle,i=e.name,a=e.twitter,c=e.uri,u=e.contractualTitle,l=e.isLargeDevice;return o.a.createElement(N,{style:I.authorHeadContainer},o.a.createElement(Q,{isLoading:r,jobTitle:n,renderBiography:function(){return t?o.a.createElement(F,{style:I.biographyContainer},o.a.createElement(Y,{biography:t})):null},renderImage:function(){return c?o.a.createElement(B,{className:"lcpItem"},o.a.createElement(ae,{uri:c})):null},renderName:function(){return i?o.a.createElement(R,{role:"heading","aria-level":"1","data-testid":"author-name"},i):null},twitter:a,contractualTitle:u,isLargeDevice:l}))};ce.defaultProps=v;var ue=ce;function le(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 se(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?le(Object(r),!0).forEach((function(t){pe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}se(se({},{author:g.a.shape({biography:j.biography,image:j.uri,jobTitle:j.jobTitle,name:j.name,twitter:j.twitter,metaDescription:g.a.string}),error:g.a.object,isLoading:j.isLoading,page:g.a.number,pageSize:g.a.number,refetch:g.a.func.isRequired,slug:g.a.string.isRequired}),{},{onNext:g.a.func.isRequired,onPrev:g.a.func.isRequired});var fe=se({},{author:null,error:null,isLoading:!0,page:1,pageSize:10}),de=r(17);function be(e){var t=e.metaDescription,r=e.description,n=e.name,i="Get up to date information and read all the latest articles from ".concat(n,".");return t?i=t:r&&r.length&&(i=Object(m.renderTreeArrayAsText)(r).substring(0,200)),o.a.createElement(de.Helmet,null,o.a.createElement("title",null,n," | The Times & The Sunday Times"),o.a.createElement("meta",{content:i,name:"description"}))}be.defaultProps={metaDescription:null};var ge=be;function me(e){return function(e){if(Array.isArray(e))return he(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return he(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return he(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ye(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 we(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(r),!0).forEach((function(t){Oe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Oe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var je=function(e){var t=e.author,r=e.error,n=e.isLoading,i=e.onArticlePress,l=e.onNext,p=e.onPrev,b=e.onTwitterLinkPress,g=e.page,m=e.pageSize,h=e.refetch,y=e.slug,w=e.metaDescription;if(r)return o.a.createElement(c.ArticleListPageError,{refetch:h});var O=n?{articles:[],image:"",jobTitle:"",name:"",twitter:"",contractualTitle:""}:t,j=O.articles,v=O.biography,P=O.hasLeadAssets,_=void 0===P||P,x=O.image,T=O.jobTitle,S=O.name,k=O.twitter,E=O.contractualTitle,L=o.a.createElement(ue,{biography:v,isLoading:n,jobTitle:T,name:S,onTwitterLinkPress:b,twitter:k,uri:x,contractualTitle:E}),D=_?s.AuthorArticlesWithImagesProvider:s.AuthorArticlesNoImagesProvider;return o.a.createElement(D,{articleImageRatio:"3:2",debounceTimeMs:250,page:g,pageSize:m,slug:y},(function(e){var t=e.author,r=e.error,n=e.isLoading,c=e.pageSize,s=e.refetch,b=e.fetchMore,m=e.variables.imageRatio,h=void 0===m?"3:2":m;return o.a.createElement(f.a,null,o.a.createElement(ge,{metaDescription:w,description:v,name:S}),o.a.createElement(u.a,{articleListHeader:L,articles:a()(t,"articles.list",[]),articlesLoading:n,count:a()(j,"count",0),emptyStateMessage:"Unfortunately, there are no articles relating to this author",error:r,fetchMore:function(e){return b({updateQuery:function(e,t){var r=t.fetchMoreResult;return r?{author:we(we({},e.author),{},{articles:we(we({},e.author.articles),{},{list:[].concat(me(e.author.articles.list),me(r.author.articles.list))})})}:e},variables:{skip:e}})},imageRatio:Object(d.ratioTextToFloat)(h),onArticlePress:i,onNext:l,onPrev:p,page:g,pageSize:c,refetch:s,showImages:_}))}))};je.defaultProps=fe;t.default=Object(l.withPageState)(function(e){return Object(U.withTrackingContext)(e,{getAttrs:function(e){var t=e.author,r=e.page,n=e.pageSize;return{articlesCount:a()(t,"articles.count",0),authorName:t&&t.name,page:r,pageSize:n}},trackingObjectName:"AuthorProfile"})}(je))}]);
|