@times-components/article-main-comment 2.73.11-alpha.6 → 2.73.11-alpha.62

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 CHANGED
@@ -3,6 +3,268 @@
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.43](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.42...@times-components/article-main-comment@2.73.43) (2024-01-10)
7
+
8
+ **Note:** Version bump only for package @times-components/article-main-comment
9
+
10
+
11
+
12
+
13
+
14
+ ## [2.73.42](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.41...@times-components/article-main-comment@2.73.42) (2024-01-10)
15
+
16
+ **Note:** Version bump only for package @times-components/article-main-comment
17
+
18
+
19
+
20
+
21
+
22
+ ## [2.73.41](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.40...@times-components/article-main-comment@2.73.41) (2024-01-09)
23
+
24
+ **Note:** Version bump only for package @times-components/article-main-comment
25
+
26
+
27
+
28
+
29
+
30
+ ## [2.73.40](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.39...@times-components/article-main-comment@2.73.40) (2024-01-09)
31
+
32
+ **Note:** Version bump only for package @times-components/article-main-comment
33
+
34
+
35
+
36
+
37
+
38
+ ## [2.73.39](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.38...@times-components/article-main-comment@2.73.39) (2024-01-08)
39
+
40
+ **Note:** Version bump only for package @times-components/article-main-comment
41
+
42
+
43
+
44
+
45
+
46
+ ## [2.73.38](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.37...@times-components/article-main-comment@2.73.38) (2024-01-08)
47
+
48
+ **Note:** Version bump only for package @times-components/article-main-comment
49
+
50
+
51
+
52
+
53
+
54
+ ## [2.73.37](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.36...@times-components/article-main-comment@2.73.37) (2024-01-08)
55
+
56
+ **Note:** Version bump only for package @times-components/article-main-comment
57
+
58
+
59
+
60
+
61
+
62
+ ## [2.73.36](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.35...@times-components/article-main-comment@2.73.36) (2024-01-08)
63
+
64
+ **Note:** Version bump only for package @times-components/article-main-comment
65
+
66
+
67
+
68
+
69
+
70
+ ## [2.73.35](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.34...@times-components/article-main-comment@2.73.35) (2024-01-08)
71
+
72
+ **Note:** Version bump only for package @times-components/article-main-comment
73
+
74
+
75
+
76
+
77
+
78
+ ## [2.73.34](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.33...@times-components/article-main-comment@2.73.34) (2024-01-08)
79
+
80
+
81
+ ### Bug Fixes
82
+
83
+ * **TMRX-1782:** Remove inArticleAudio integration for now until ready to productionise ([#3704](https://github.com/newsuk/times-components/issues/3704)) ([139c9bd](https://github.com/newsuk/times-components/commit/139c9bd8f032a4eda60004fb457b0b6cc698598e))
84
+
85
+
86
+
87
+
88
+
89
+ ## [2.73.33](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.32...@times-components/article-main-comment@2.73.33) (2024-01-08)
90
+
91
+ **Note:** Version bump only for package @times-components/article-main-comment
92
+
93
+
94
+
95
+
96
+
97
+ ## [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)
98
+
99
+
100
+ ### Bug Fixes
101
+
102
+ * **TMRX-1768:** Check a byline exists ([#3703](https://github.com/newsuk/times-components/issues/3703)) ([fad95e9](https://github.com/newsuk/times-components/commit/fad95e992b63f93ed95eadda683c5fcb1b91f53a))
103
+
104
+
105
+
106
+
107
+
108
+ ## [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)
109
+
110
+ **Note:** Version bump only for package @times-components/article-main-comment
111
+
112
+
113
+
114
+
115
+
116
+ ## [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)
117
+
118
+ **Note:** Version bump only for package @times-components/article-main-comment
119
+
120
+
121
+
122
+
123
+
124
+ ## [2.73.29](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.28...@times-components/article-main-comment@2.73.29) (2023-12-08)
125
+
126
+ **Note:** Version bump only for package @times-components/article-main-comment
127
+
128
+
129
+
130
+
131
+
132
+ ## [2.73.28](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.27...@times-components/article-main-comment@2.73.28) (2023-12-07)
133
+
134
+ **Note:** Version bump only for package @times-components/article-main-comment
135
+
136
+
137
+
138
+
139
+
140
+ ## [2.73.27](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.26...@times-components/article-main-comment@2.73.27) (2023-12-07)
141
+
142
+ **Note:** Version bump only for package @times-components/article-main-comment
143
+
144
+
145
+
146
+
147
+
148
+ ## [2.73.26](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.25...@times-components/article-main-comment@2.73.26) (2023-12-07)
149
+
150
+ **Note:** Version bump only for package @times-components/article-main-comment
151
+
152
+
153
+
154
+
155
+
156
+ ## [2.73.25](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.24...@times-components/article-main-comment@2.73.25) (2023-12-06)
157
+
158
+ **Note:** Version bump only for package @times-components/article-main-comment
159
+
160
+
161
+
162
+
163
+
164
+ ## [2.73.24](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.23...@times-components/article-main-comment@2.73.24) (2023-12-05)
165
+
166
+ **Note:** Version bump only for package @times-components/article-main-comment
167
+
168
+
169
+
170
+
171
+
172
+ ## [2.73.23](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.22...@times-components/article-main-comment@2.73.23) (2023-12-04)
173
+
174
+ **Note:** Version bump only for package @times-components/article-main-comment
175
+
176
+
177
+
178
+
179
+
180
+ ## [2.73.22](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.21...@times-components/article-main-comment@2.73.22) (2023-12-04)
181
+
182
+ **Note:** Version bump only for package @times-components/article-main-comment
183
+
184
+
185
+
186
+
187
+
188
+ ## [2.73.21](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.20...@times-components/article-main-comment@2.73.21) (2023-12-01)
189
+
190
+ **Note:** Version bump only for package @times-components/article-main-comment
191
+
192
+
193
+
194
+
195
+
196
+ ## [2.73.20](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.19...@times-components/article-main-comment@2.73.20) (2023-11-30)
197
+
198
+ **Note:** Version bump only for package @times-components/article-main-comment
199
+
200
+
201
+
202
+
203
+
204
+ ## [2.73.19](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.18...@times-components/article-main-comment@2.73.19) (2023-11-29)
205
+
206
+ **Note:** Version bump only for package @times-components/article-main-comment
207
+
208
+
209
+
210
+
211
+
212
+ ## [2.73.18](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.17...@times-components/article-main-comment@2.73.18) (2023-11-29)
213
+
214
+ **Note:** Version bump only for package @times-components/article-main-comment
215
+
216
+
217
+
218
+
219
+
220
+ ## [2.73.17](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.16...@times-components/article-main-comment@2.73.17) (2023-11-28)
221
+
222
+ **Note:** Version bump only for package @times-components/article-main-comment
223
+
224
+
225
+
226
+
227
+
228
+ ## [2.73.16](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.15...@times-components/article-main-comment@2.73.16) (2023-11-27)
229
+
230
+ **Note:** Version bump only for package @times-components/article-main-comment
231
+
232
+
233
+
234
+
235
+
236
+ ## [2.73.15](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.14...@times-components/article-main-comment@2.73.15) (2023-11-27)
237
+
238
+ **Note:** Version bump only for package @times-components/article-main-comment
239
+
240
+
241
+
242
+
243
+
244
+ ## [2.73.14](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.13...@times-components/article-main-comment@2.73.14) (2023-11-27)
245
+
246
+ **Note:** Version bump only for package @times-components/article-main-comment
247
+
248
+
249
+
250
+
251
+
252
+ ## [2.73.13](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.12...@times-components/article-main-comment@2.73.13) (2023-11-27)
253
+
254
+ **Note:** Version bump only for package @times-components/article-main-comment
255
+
256
+
257
+
258
+
259
+
260
+ ## [2.73.12](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.11...@times-components/article-main-comment@2.73.12) (2023-11-24)
261
+
262
+ **Note:** Version bump only for package @times-components/article-main-comment
263
+
264
+
265
+
266
+
267
+
6
268
  ## [2.73.11](https://github.com/newsuk/times-components/compare/@times-components/article-main-comment@2.73.10...@times-components/article-main-comment@2.73.11) (2023-11-23)
7
269
 
8
270
  **Note:** Version bump only for package @times-components/article-main-comment
@@ -22,7 +22,6 @@ const articleHeaderPropTypes = {
22
22
  longRead: _propTypes.default.bool,
23
23
  publicationName: _propTypes.default.string.isRequired,
24
24
  publishedTime: _propTypes.default.string.isRequired,
25
- showAudioPlayer: _propTypes.default.bool,
26
25
  standfirst: _propTypes.default.string,
27
26
  updatedTime: _propTypes.default.string
28
27
  };
@@ -9,8 +9,6 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _tsComponents = require("@times-components/ts-components");
11
11
 
12
- var _tsNewskit = require("@times-components/ts-newskit");
13
-
14
12
  var _image = _interopRequireDefault(require("@times-components/image"));
15
13
 
16
14
  var _utils = require("@times-components/utils");
@@ -43,7 +41,6 @@ const ArticleHeader = _ref => {
43
41
  headline = _ref.headline,
44
42
  label = _ref.label,
45
43
  publicationName = _ref.publicationName,
46
- showAudioPlayer = _ref.showAudioPlayer,
47
44
  publishedTime = _ref.publishedTime,
48
45
  standfirst = _ref.standfirst,
49
46
  updatedTime = _ref.updatedTime;
@@ -72,19 +69,7 @@ const ArticleHeader = _ref => {
72
69
  bylines: bylines,
73
70
  publicationName: publicationName,
74
71
  publishedTime: publishedTime
75
- }), /*#__PURE__*/_react.default.createElement(_tsNewskit.TCThemeProvider, null, /*#__PURE__*/_react.default.createElement(_tsNewskit.InArticleAudio, {
76
- showAudioPlayer: showAudioPlayer,
77
- src: "",
78
- readyToPlayText: "Listen to article",
79
- playingText: "Playing",
80
- narrator: bylines ? bylines[0].byline[0].children[0].attributes.value : "",
81
- headline: headline,
82
- feedback: {
83
- requestFeedback: true,
84
- feedbackMessage: "Want to listen to more articles? Give your feedback below or email",
85
- thankyouMessage: "Thank you for your feedback. We're always trying to give you the best possible experience – your feedback helps us do this."
86
- }
87
- })));
72
+ }));
88
73
  };
89
74
 
90
75
  ArticleHeader.propTypes = _articleHeaderPropTypes.articleHeaderPropTypes;
@@ -11,16 +11,10 @@ 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 _articleHeader = _interopRequireDefault(require("./article-header/article-header"));
19
15
 
20
16
  var _articlePropTypes = require("./article-prop-types/article-prop-types");
21
17
 
22
- var _responsive = require("./styles/responsive");
23
-
24
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
19
 
26
20
  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); }
@@ -31,68 +25,10 @@ class ArticlePage extends _react.Component {
31
25
  constructor(props) {
32
26
  super(props);
33
27
  this.renderHeader = this.renderHeader.bind(this);
34
- this.state = {
35
- initialPosition: 0
36
- };
37
- this.sidebarRef = _react.default.createRef();
38
- this.handleScroll = this.handleScroll.bind(this);
39
- }
40
-
41
- componentDidMount() {
42
- window.addEventListener("scroll", this.handleScroll);
43
- const sidebarNode = this.sidebarRef.current;
44
-
45
- if (sidebarNode) {
46
- const rect = sidebarNode.getBoundingClientRect();
47
- this.setState({
48
- initialPosition: rect.top
49
- });
50
- }
51
- }
52
-
53
- componentWillUnmount() {
54
- window.removeEventListener("scroll", this.handleScroll);
55
- }
56
-
57
- handleScroll() {
58
- const sidebarNode = this.sidebarRef.current;
59
-
60
- if (sidebarNode) {
61
- const rect = sidebarNode.getBoundingClientRect();
62
- const adElement = document.querySelector(".responsive__InlineAdWrapper-sc-4v1r4q-17");
63
- const relatedArticlesElement = document.getElementById("related-articles");
64
- let isAdIntersecting = false;
65
- let isRelatedArticlesIntersecting = false;
66
-
67
- if (adElement) {
68
- const adRect = adElement.getBoundingClientRect();
69
- isAdIntersecting = adRect.top <= rect.bottom && adRect.bottom >= rect.top;
70
- }
71
-
72
- if (relatedArticlesElement) {
73
- const relatedArticlesRect = relatedArticlesElement.getBoundingClientRect();
74
- isRelatedArticlesIntersecting = relatedArticlesRect.top <= window.innerHeight && relatedArticlesRect.bottom >= 0;
75
- }
76
-
77
- const initialPosition = this.state.initialPosition;
78
-
79
- if (isAdIntersecting || isRelatedArticlesIntersecting) {
80
- sidebarNode.style.transition = "opacity 0.5s ease";
81
- sidebarNode.style.opacity = "0";
82
- } else {
83
- const isScrolled = rect.top <= 0 && window.scrollY > initialPosition;
84
- sidebarNode.style.transition = "opacity 0.5s ease";
85
- sidebarNode.style.opacity = "1";
86
- sidebarNode.style.position = isScrolled ? "fixed" : "absolute";
87
- sidebarNode.style.top = isScrolled ? "0" : "100%";
88
- }
89
- }
90
28
  }
91
29
 
92
30
  renderHeader() {
93
- const _this$props = this.props,
94
- article = _this$props.article,
95
- showAudioPlayer = _this$props.showAudioPlayer;
31
+ const article = this.props.article;
96
32
  const bylines = article.bylines,
97
33
  expirableFlags = article.expirableFlags,
98
34
  hasVideo = article.hasVideo,
@@ -104,7 +40,7 @@ class ArticlePage extends _react.Component {
104
40
  standfirst = article.standfirst,
105
41
  updatedTime = article.updatedTime;
106
42
  const authorImage = bylines && bylines.length > 0 && bylines[0].image && Object.keys(bylines[0].image).length !== 0 && bylines[0].image.crop ? bylines[0].image.crop.url : null;
107
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_articleHeader.default, {
43
+ return /*#__PURE__*/_react.default.createElement(_articleHeader.default, {
108
44
  authorImage: authorImage,
109
45
  bylines: bylines,
110
46
  flags: expirableFlags,
@@ -114,47 +50,25 @@ class ArticlePage extends _react.Component {
114
50
  publicationName: publicationName,
115
51
  publishedTime: publishedTime,
116
52
  standfirst: standfirst,
117
- updatedTime: updatedTime,
118
- showAudioPlayer: showAudioPlayer
119
- }), /*#__PURE__*/_react.default.createElement(_newskit.NewsKitProvider, {
120
- theme: _tsNewskit.PuzzlesWebLightTheme
121
- }, /*#__PURE__*/_react.default.createElement(_responsive.PuzzlesSidebar, {
122
- ref: this.sidebarRef
123
- }, /*#__PURE__*/_react.default.createElement(_tsNewskit.ArticleSidebar, {
124
- pageLink: "https://www.thetimes.co.uk/puzzles",
125
- sectionTitle: "Puzzles",
126
- data: [{
127
- title: "Crossword",
128
- url: "https://www.thetimes.co.uk/puzzles/crossword",
129
- imgUrl: "https://www.thetimes.co.uk/imageserver/image/%2Fpuzzles%2Ficons%2F33b27655-dcc9-421f-906f-b2b10dd26865.png?crop=1250%2C833%2C0%2C0&resize=500"
130
- }, {
131
- title: "Polygon",
132
- url: "https://www.thetimes.co.uk/puzzles/word-puzzles",
133
- imgUrl: "https://www.thetimes.co.uk/imageserver/image/%2Fpuzzles%2Ficons%2F33b27655-dcc9-421f-906f-b2b10dd26865.png?crop=1250%2C833%2C0%2C0&resize=500"
134
- }, {
135
- title: "Sudoku",
136
- url: "https://www.thetimes.co.uk/puzzles/sudoku",
137
- imgUrl: "https://www.thetimes.co.uk/imageserver/image/%2Fpuzzles%2Ficons%2F33b27655-dcc9-421f-906f-b2b10dd26865.png?crop=1250%2C833%2C0%2C0&resize=500"
138
- }]
139
- }))));
53
+ updatedTime: updatedTime
54
+ });
140
55
  }
141
56
 
142
57
  render() {
143
- const _this$props2 = this.props,
144
- article = _this$props2.article,
145
- analyticsStream = _this$props2.analyticsStream,
146
- error = _this$props2.error,
147
- isLoading = _this$props2.isLoading,
148
- logoUrl = _this$props2.logoUrl,
149
- navigationMode = _this$props2.navigationMode,
150
- receiveChildList = _this$props2.receiveChildList,
151
- commentingConfig = _this$props2.commentingConfig,
152
- paidContentClassName = _this$props2.paidContentClassName,
153
- isPreview = _this$props2.isPreview,
154
- showAudioPlayer = _this$props2.showAudioPlayer,
155
- swgProductId = _this$props2.swgProductId,
156
- zephrDivs = _this$props2.zephrDivs,
157
- storefrontConfig = _this$props2.storefrontConfig;
58
+ const _this$props = this.props,
59
+ article = _this$props.article,
60
+ analyticsStream = _this$props.analyticsStream,
61
+ error = _this$props.error,
62
+ isLoading = _this$props.isLoading,
63
+ logoUrl = _this$props.logoUrl,
64
+ navigationMode = _this$props.navigationMode,
65
+ receiveChildList = _this$props.receiveChildList,
66
+ commentingConfig = _this$props.commentingConfig,
67
+ paidContentClassName = _this$props.paidContentClassName,
68
+ isPreview = _this$props.isPreview,
69
+ swgProductId = _this$props.swgProductId,
70
+ zephrDivs = _this$props.zephrDivs,
71
+ storefrontConfig = _this$props.storefrontConfig;
158
72
 
159
73
  if (error || isLoading) {
160
74
  return null;
@@ -172,7 +86,6 @@ class ArticlePage extends _react.Component {
172
86
  isPreview: isPreview,
173
87
  swgProductId: swgProductId,
174
88
  zephrDivs: zephrDivs,
175
- showAudioPlayer: showAudioPlayer,
176
89
  storefrontConfig: storefrontConfig
177
90
  });
178
91
  }
@@ -22,15 +22,13 @@ const articlePagePropTypes = {
22
22
  isLoading: _propTypes.default.bool,
23
23
  onImagePress: _propTypes.default.func,
24
24
  receiveChildList: _propTypes.default.func.isRequired,
25
- zephrDivs: _propTypes.default.bool,
26
- showAudioPlayer: _propTypes.default.bool
25
+ zephrDivs: _propTypes.default.bool
27
26
  };
28
27
  exports.articlePagePropTypes = articlePagePropTypes;
29
28
  const articlePageDefaultProps = {
30
29
  article: null,
31
30
  error: null,
32
31
  isLoading: false,
33
- onImagePress: null,
34
- showAudioPlayer: false
32
+ onImagePress: null
35
33
  };
36
34
  exports.articlePageDefaultProps = articlePageDefaultProps;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.PuzzlesSidebar = exports.StandfirstContainer = exports.Separator = exports.MetaContainer = exports.Meta = exports.LabelContainer = exports.HeadlineContainer = exports.HeaderContainer = exports.FlagsContainer = exports.DatePublicationContainer = exports.AuthorImageContainer = void 0;
6
+ exports.StandfirstContainer = exports.Separator = exports.MetaContainer = exports.Meta = exports.LabelContainer = exports.HeadlineContainer = exports.HeaderContainer = exports.FlagsContainer = exports.DatePublicationContainer = exports.AuthorImageContainer = void 0;
7
7
 
8
8
  var _utils = require("@times-components/utils");
9
9
 
@@ -69,11 +69,4 @@ const StandfirstContainer = _styledComponents.default.h2.withConfig({
69
69
  fontSize: "infoTitle"
70
70
  }), (0, _tsStyleguide.spacing)(5), _tsStyleguide.breakpoints.wide, (0, _tsStyleguide.spacing)(4));
71
71
 
72
- exports.StandfirstContainer = StandfirstContainer;
73
-
74
- const PuzzlesSidebar = _styledComponents.default.div.withConfig({
75
- displayName: "responsive__PuzzlesSidebar",
76
- componentId: "ba1gpd-10"
77
- })(["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));
78
-
79
- exports.PuzzlesSidebar = PuzzlesSidebar;
72
+ exports.StandfirstContainer = StandfirstContainer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@times-components/article-main-comment",
3
- "version": "2.73.11-alpha.6+764b1239f0",
3
+ "version": "2.73.11-alpha.62+1e40dee5b8",
4
4
  "description": "Main Comment Article Template",
5
5
  "main": "dist/article-main-comment",
6
6
  "dev": "src/article-main-comment",
@@ -53,21 +53,19 @@
53
53
  "webpack": "4.30.0"
54
54
  },
55
55
  "dependencies": {
56
- "@times-components/ad": "^2.21.43",
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.115.11",
59
+ "@times-components/article-skeleton": "^1.115.11-alpha.62+1e40dee5b8",
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.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": "764b1239f092f459439b0e0487f954df881d1577"
83
+ "gitHead": "1e40dee5b85738dabba5d67a2ae4396aaff289c3"
86
84
  }
package/rnw.js CHANGED
@@ -1 +1 @@
1
- module.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=15)}([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-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/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,i){"use strict";i.r(t);var n=i(2),r=i.n(n),o=i(8),a=i.n(o),s=i(3),l=i(5),c=i(9),p=i(6),d=i(10),u=i.n(d),m=i(11),b=i.n(m),g=i(12),f=i.n(g),h=i(13),y=i.n(h),w=i(0),O=i(1),j=i.n(O);j.a.bool,j.a.string;function v(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function x(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?v(Object(i),!0).forEach((function(t){P(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function P(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function k(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function C(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var E=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?k(Object(i),!0).forEach((function(t){C(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):k(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},{articleHeadline:x(x({},Object(w.fontFactory)({font:"headline",fontSize:"headline"})),{},{color:w.colours.functional.brandColour,marginBottom:Object(w.spacing)(2),textAlign:"center"}),articleHeadlineTablet:x({},Object(w.fontFactory)({font:"headline",fontSize:"articleHeadline"})),authorImage:{marginBottom:Object(w.spacing)(5)},container:{alignItems:"center",paddingLeft:Object(w.spacing)(2),paddingRight:Object(w.spacing)(2)},datePublication:x(x({},Object(w.fontFactory)({font:"supporting",fontSize:"cardMeta"})),{},{color:w.colours.functional.secondary,marginTop:Object(w.spacing)(1)}),datePublicationTablet:{marginTop:"auto"},header:{marginBottom:Object(w.spacing)(3),paddingBottom:Object(w.spacing)(4),paddingTop:Object(w.spacing)(7)},label:{marginBottom:Object(w.spacing)(2)},meta:{flexDirection:"row",flexWrap:"wrap"},metaContainer:{alignItems:"center",width:"100%",paddingTop:Object(w.spacing)(2),paddingBottom:Object(w.spacing)(2),borderBottomColor:w.colours.functional.keyline,borderBottomWidth:1,borderTopColor:w.colours.functional.keyline,borderTopWidth:1},metaContainerTablet:{flexDirection:"row",justifyContent:"center"},separator:{borderRightColor:w.colours.functional.keyline,borderRightWidth:1,height:Object(w.spacing)(3),marginLeft:Object(w.spacing)(2),marginRight:Object(w.spacing)(2)},standFirst:x(x({},Object(w.fontFactory)({font:"headlineRegular",fontSize:"smallestHeadline"})),{},{color:w.colours.functional.primary,marginBottom:Object(w.spacing)(3),paddingLeft:Object(w.spacing)(2),paddingRight:Object(w.spacing)(2),textAlign:"center"})});const T=e=>{let t=e.isVideo,i=e.label;if(!t&&!i)return null;const n=t?f.a:b.a;return r.a.createElement(y.a.Consumer,null,e=>{let t=e.theme.sectionColour;return r.a.createElement(s.TcView,{style:E.label},r.a.createElement(n,{color:t||w.colours.section.default,title:i}))})};T.defaultProps={isVideo:!1,label:null};var z=T,S=i(7),q=i(14),R=i.n(q);j.a.arrayOf(j.a.shape({})).isRequired,j.a.string.isRequired,j.a.string.isRequired;var _=i(4),I=i.n(_);const D=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;}"],w.breakpoints.medium),F=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(w.spacing)(3),w.breakpoints.medium),N=I()(s.TcView).withConfig({displayName:"responsive__FlagsContainer",componentId:"ba1gpd-2"})(["padding-top:",";padding-bottom:",";@media (min-width:","px){padding-top:0;}"],Object(w.spacing)(1),Object(w.spacing)(3),w.breakpoints.medium),L=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%;}"],w.breakpoints.medium,Object(w.spacing)(2),w.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,w.breakpoints.medium,w.fontSizes.articleHeadline,Object(w.spacing)(1)),H=(I()(s.TcView).withConfig({displayName:"responsive__LabelContainer",componentId:"ba1gpd-5"})(["@media (min-width:","px){margin-top:0px;}"],w.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,w.breakpoints.medium)),B=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;}"],w.breakpoints.medium),V=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;}"],w.breakpoints.medium,w.colours.functional.keyline,Object(w.spacing)(3),Object(w.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,w.breakpoints.medium,w.fontSizes.infoTitle,Object(w.lineHeight)({font:"bodyRegular",fontSize:"infoTitle"}),Object(w.spacing)(5),w.breakpoints.wide,Object(w.spacing)(4)),U=I.a.div.withConfig({displayName:"responsive__PuzzlesSidebar",componentId:"ba1gpd-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(w.spacing)(4),w.breakpoints.wide,Object(w.spacing)(8),w.breakpoints.huge,Object(w.spacing)(15));var W=e=>{let t=e.bylines,i=e.publicationName,o=e.publishedTime;return r.a.createElement(B,null,Object(S.hasBylineData)(t)&&r.a.createElement(n.Fragment,null,r.a.createElement(H,{styles:E.meta},r.a.createElement(S.ArticleBylineWithLinks,{ast:t})),r.a.createElement(V,null)),r.a.createElement(H,{styles:E.meta},r.a.createElement(F,{styles:Object(s.checkStylesForUnits)(E.datePublication)},r.a.createElement(R.a,{date:o,publication:i}))))};const G=e=>{let t=e.standfirst;return t?r.a.createElement(M,{role:"heading","aria-level":"2",styles:Object(s.checkStylesForUnits)(E.standFirst),testID:"standfirst"},t):null};G.defaultProps={standfirst:null};var K=G;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 Q(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Y(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(i),!0).forEach((function(t){J(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Q(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function J(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const X=e=>{let t=e.authorImage,i=e.bylines,n=e.flags,o=e.hasVideo,a=e.headline,c=e.label,d=e.publicationName,m=e.showAudioPlayer,b=e.publishedTime,g=e.standfirst,f=e.updatedTime;return r.a.createElement(L,{style:Y(Y({},E.header),E.container)},r.a.createElement(D,{style:E.authorImage},r.a.createElement(u.a,{aspectRatio:1,uri:t,accessibilityLabel:"author-image"})),r.a.createElement(z,{isVideo:o,label:c}),r.a.createElement(A,{role:"heading","aria-level":"1",styles:Object(s.checkStylesForUnits)(E.articleHeadline)},a),r.a.createElement(N,null,r.a.createElement(p.UpdatedTimeProvider,{updatedTime:f},r.a.createElement(p.ArticleFlags,{flags:n}))),r.a.createElement(K,{standfirst:g}),r.a.createElement(W,{bylines:i,publicationName:d,publishedTime:b}),r.a.createElement(l.TCThemeProvider,null,r.a.createElement(l.InArticleAudio,{showAudioPlayer:m,src:"",readyToPlayText:"Listen to article",playingText:"Playing",narrator:i?i[0].byline[0].children[0].attributes.value:"",headline:a,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."}})))};X.defaultProps={flags:[],hasVideo:!1,label:null,longRead:!1,standfirst:null,updatedTime:null};var Z=X;function $(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function ee(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?$(Object(i),!0).forEach((function(t){te(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function te(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}ee(ee({},{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 ie=ee({},{article:null,error:null,isLoading:!1,onImagePress:null,showAudioPlayer:!1});class ne extends n.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(),i=document.querySelector(".responsive__InlineAdWrapper-sc-4v1r4q-17"),n=document.getElementById("related-articles");let r=!1,o=!1;if(i){const e=i.getBoundingClientRect();r=e.top<=t.bottom&&e.bottom>=t.top}if(n){const e=n.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 i=t.top<=0&&window.scrollY>a;e.style.transition="opacity 0.5s ease",e.style.opacity="1",e.style.position=i?"fixed":"absolute",e.style.top=i?"0":"100%"}}}renderHeader(){const e=this.props,t=e.article,i=e.showAudioPlayer,n=t.bylines,o=t.expirableFlags,a=t.hasVideo,p=t.headline,d=t.label,u=t.publicationName,m=t.publishedTime,b=t.shortHeadline,g=t.standfirst,f=t.updatedTime,h=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 r.a.createElement(r.a.Fragment,null,r.a.createElement(Z,{authorImage:h,bylines:n,flags:o,hasVideo:a,headline:Object(s.getHeadline)(p,b),label:d,publicationName:u,publishedTime:m,standfirst:g,updatedTime:f,showAudioPlayer:i}),r.a.createElement(c.NewsKitProvider,{theme:l.PuzzlesWebLightTheme},r.a.createElement(U,{ref:this.sidebarRef},r.a.createElement(l.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"}]}))))}render(){const e=this.props,t=e.article,i=e.analyticsStream,n=e.error,o=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||o?null:r.a.createElement(a.a,{analyticsStream:i,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})}}ne.defaultProps=ie;t.default=ne}]);
1
+ module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},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=13)}([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/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,n){"use strict";n.r(t);var r=n(2),i=n.n(r),a=n(7),o=n.n(a),s=n(3),c=n(5),l=n(8),p=n.n(l),d=n(9),u=n.n(d),m=n(10),b=n.n(m),g=n(11),f=n.n(g),h=n(0),y=n(1),O=n.n(y);O.a.bool,O.a.string;function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(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){x(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 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 v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}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 C=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},{articleHeadline:j(j({},Object(h.fontFactory)({font:"headline",fontSize:"headline"})),{},{color:h.colours.functional.brandColour,marginBottom:Object(h.spacing)(2),textAlign:"center"}),articleHeadlineTablet:j({},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:j(j({},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:j(j({},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,n=e.label;if(!t&&!n)return null;const r=t?b.a:u.a;return i.a.createElement(f.a.Consumer,null,e=>{let t=e.theme.sectionColour;return i.a.createElement(s.TcView,{style:C.label},i.a.createElement(r,{color:t||h.colours.section.default,title:n}))})};T.defaultProps={isVideo:!1,label:null};var E=T,k=n(6),S=n(12),_=n.n(S);O.a.arrayOf(O.a.shape({})).isRequired,O.a.string.isRequired,O.a.string.isRequired;var q=n(4),D=n.n(q);const I=D()(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),R=D()(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),N=D()(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),H=D()(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),z=D.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=(D()(s.TcView).withConfig({displayName:"responsive__LabelContainer",componentId:"ba1gpd-5"})(["@media (min-width:","px){margin-top:0px;}"],h.breakpoints.wide),D()(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=D()(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=D()(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)),B=D.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 M=e=>{let t=e.bylines,n=e.publicationName,a=e.publishedTime;return i.a.createElement(F,null,Object(k.hasBylineData)(t)&&i.a.createElement(r.Fragment,null,i.a.createElement(V,{styles:C.meta},i.a.createElement(k.ArticleBylineWithLinks,{ast:t})),i.a.createElement(L,null)),i.a.createElement(V,{styles:C.meta},i.a.createElement(R,{styles:Object(s.checkStylesForUnits)(C.datePublication)},i.a.createElement(_.a,{date:a,publication:n}))))};const U=e=>{let t=e.standfirst;return t?i.a.createElement(B,{role:"heading","aria-level":"2",styles:Object(s.checkStylesForUnits)(C.standFirst),testID:"standfirst"},t):null};U.defaultProps={standfirst:null};var A=U;O.a.string.isRequired,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 W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}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=>{let t=e.authorImage,n=e.bylines,r=e.flags,a=e.hasVideo,o=e.headline,l=e.label,d=e.publicationName,u=e.publishedTime,m=e.standfirst,b=e.updatedTime;return i.a.createElement(H,{style:Q(Q({},C.header),C.container)},i.a.createElement(I,{style:C.authorImage},i.a.createElement(p.a,{aspectRatio:1,uri:t,accessibilityLabel:"author-image"})),i.a.createElement(E,{isVideo:a,label:l}),i.a.createElement(z,{role:"heading","aria-level":"1",styles:Object(s.checkStylesForUnits)(C.articleHeadline)},o),i.a.createElement(N,null,i.a.createElement(c.UpdatedTimeProvider,{updatedTime:b},i.a.createElement(c.ArticleFlags,{flags:r}))),i.a.createElement(A,{standfirst:m}),i.a.createElement(M,{bylines:n,publicationName:d,publishedTime:u}))};J.defaultProps={flags:[],hasVideo:!1,label:null,longRead:!1,standfirst:null,updatedTime:null};var K=J;function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y(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){Z(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}function Z(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Y(Y({},{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,zephrDivs:O.a.bool}),{},{navigationMode:O.a.shape({}).isRequired,storefrontConfig:O.a.string.isRequired});const $=Y({},{article:null,error:null,isLoading:!1,onImagePress:null});class ee extends r.Component{constructor(e){super(e),this.renderHeader=this.renderHeader.bind(this)}renderHeader(){const e=this.props.article,t=e.bylines,n=e.expirableFlags,r=e.hasVideo,a=e.headline,o=e.label,c=e.publicationName,l=e.publishedTime,p=e.shortHeadline,d=e.standfirst,u=e.updatedTime,m=t&&t.length>0&&t[0].image&&0!==Object.keys(t[0].image).length&&t[0].image.crop?t[0].image.crop.url:null;return i.a.createElement(K,{authorImage:m,bylines:t,flags:n,hasVideo:r,headline:Object(s.getHeadline)(a,p),label:o,publicationName:c,publishedTime:l,standfirst:d,updatedTime:u})}render(){const e=this.props,t=e.article,n=e.analyticsStream,r=e.error,a=e.isLoading,s=e.logoUrl,c=e.navigationMode,l=e.receiveChildList,p=e.commentingConfig,d=e.paidContentClassName,u=e.isPreview,m=e.swgProductId,b=e.zephrDivs,g=e.storefrontConfig;return r||a?null:i.a.createElement(o.a,{analyticsStream:n,data:t,Header:this.renderHeader,logoUrl:s,receiveChildList:l,navigationMode:c,commentingConfig:p,paidContentClassName:d,isPreview:u,swgProductId:m,zephrDivs:b,storefrontConfig:g})}}ee.defaultProps=$;t.default=ee}]);