@times-components/article 7.17.11-alpha.1 → 7.17.11-alpha.14

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,199 @@
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
+ ## [7.17.33](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.32...@times-components/article@7.17.33) (2024-10-28)
7
+
8
+ **Note:** Version bump only for package @times-components/article
9
+
10
+
11
+
12
+
13
+
14
+ ## [7.17.32](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.31...@times-components/article@7.17.32) (2024-10-23)
15
+
16
+ **Note:** Version bump only for package @times-components/article
17
+
18
+
19
+
20
+
21
+
22
+ ## [7.17.31](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.30...@times-components/article@7.17.31) (2024-10-23)
23
+
24
+ **Note:** Version bump only for package @times-components/article
25
+
26
+
27
+
28
+
29
+
30
+ ## [7.17.30](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.29...@times-components/article@7.17.30) (2024-10-23)
31
+
32
+ **Note:** Version bump only for package @times-components/article
33
+
34
+
35
+
36
+
37
+
38
+ ## [7.17.29](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.28...@times-components/article@7.17.29) (2024-10-22)
39
+
40
+ **Note:** Version bump only for package @times-components/article
41
+
42
+
43
+
44
+
45
+
46
+ ## [7.17.28](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.27...@times-components/article@7.17.28) (2024-10-19)
47
+
48
+ **Note:** Version bump only for package @times-components/article
49
+
50
+
51
+
52
+
53
+
54
+ ## [7.17.27](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.26...@times-components/article@7.17.27) (2024-10-18)
55
+
56
+ **Note:** Version bump only for package @times-components/article
57
+
58
+
59
+
60
+
61
+
62
+ ## [7.17.26](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.25...@times-components/article@7.17.26) (2024-10-18)
63
+
64
+ **Note:** Version bump only for package @times-components/article
65
+
66
+
67
+
68
+
69
+
70
+ ## [7.17.25](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.24...@times-components/article@7.17.25) (2024-10-17)
71
+
72
+ **Note:** Version bump only for package @times-components/article
73
+
74
+
75
+
76
+
77
+
78
+ ## [7.17.24](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.23...@times-components/article@7.17.24) (2024-10-15)
79
+
80
+ **Note:** Version bump only for package @times-components/article
81
+
82
+
83
+
84
+
85
+
86
+ ## [7.17.23](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.22...@times-components/article@7.17.23) (2024-10-15)
87
+
88
+ **Note:** Version bump only for package @times-components/article
89
+
90
+
91
+
92
+
93
+
94
+ ## [7.17.22](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.21...@times-components/article@7.17.22) (2024-10-15)
95
+
96
+ **Note:** Version bump only for package @times-components/article
97
+
98
+
99
+
100
+
101
+
102
+ ## [7.17.21](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.20...@times-components/article@7.17.21) (2024-10-14)
103
+
104
+ **Note:** Version bump only for package @times-components/article
105
+
106
+
107
+
108
+
109
+
110
+ ## [7.17.20](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.19...@times-components/article@7.17.20) (2024-10-10)
111
+
112
+ **Note:** Version bump only for package @times-components/article
113
+
114
+
115
+
116
+
117
+
118
+ ## [7.17.19](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.18...@times-components/article@7.17.19) (2024-10-01)
119
+
120
+ **Note:** Version bump only for package @times-components/article
121
+
122
+
123
+
124
+
125
+
126
+ ## [7.17.18](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.17...@times-components/article@7.17.18) (2024-10-01)
127
+
128
+ **Note:** Version bump only for package @times-components/article
129
+
130
+
131
+
132
+
133
+
134
+ ## [7.17.17](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.16...@times-components/article@7.17.17) (2024-10-01)
135
+
136
+ **Note:** Version bump only for package @times-components/article
137
+
138
+
139
+
140
+
141
+
142
+ ## [7.17.16](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.15...@times-components/article@7.17.16) (2024-09-30)
143
+
144
+ **Note:** Version bump only for package @times-components/article
145
+
146
+
147
+
148
+
149
+
150
+ ## [7.17.15](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.14...@times-components/article@7.17.15) (2024-09-25)
151
+
152
+
153
+ ### Bug Fixes
154
+
155
+ * **TMRS-000:** add isPreview to article object ([#3942](https://github.com/newsuk/times-components/issues/3942)) ([e79f0be](https://github.com/newsuk/times-components/commit/e79f0be14e81402c8b3b931ce3ac41e6429792c8))
156
+
157
+
158
+
159
+
160
+
161
+ ## [7.17.14](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.13...@times-components/article@7.17.14) (2024-09-25)
162
+
163
+ **Note:** Version bump only for package @times-components/article
164
+
165
+
166
+
167
+
168
+
169
+ ## [7.17.13](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.12...@times-components/article@7.17.13) (2024-09-24)
170
+
171
+
172
+ ### Bug Fixes
173
+
174
+ * **TMRS-000:** extend logic to ignore preview articles ([#3941](https://github.com/newsuk/times-components/issues/3941)) ([1a89667](https://github.com/newsuk/times-components/commit/1a89667c575e0c80ef60901b7ccc30062a60ae22))
175
+
176
+
177
+
178
+
179
+
180
+ ## [7.17.12](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.11...@times-components/article@7.17.12) (2024-09-16)
181
+
182
+
183
+ ### Bug Fixes
184
+
185
+ * **TMRS-427:** refactor 410 error logic tc ([#3934](https://github.com/newsuk/times-components/issues/3934)) ([d715f97](https://github.com/newsuk/times-components/commit/d715f9716462d76bf92f0c2258c23714d5919196))
186
+
187
+
188
+
189
+
190
+
191
+ ## [7.17.11](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.10...@times-components/article@7.17.11) (2024-09-16)
192
+
193
+ **Note:** Version bump only for package @times-components/article
194
+
195
+
196
+
197
+
198
+
6
199
  ## [7.17.10](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.9...@times-components/article@7.17.10) (2024-09-09)
7
200
 
8
201
  **Note:** Version bump only for package @times-components/article
package/dist/article.js CHANGED
@@ -60,7 +60,8 @@ const Article = props => {
60
60
 
61
61
  const _ref = article || {},
62
62
  leadAsset = _ref.leadAsset,
63
- template = _ref.template;
63
+ template = _ref.template,
64
+ isPreview = _ref.isPreview;
64
65
 
65
66
  let _ref2 = article || {},
66
67
  content = _ref2.content;
@@ -69,6 +70,12 @@ const Article = props => {
69
70
  throw new TakeoverBailout("Aborted react render: Takeover page");
70
71
  }
71
72
 
73
+ if (article && !isPreview) {
74
+ if (!article.tiles.length && !content.length) {
75
+ throw new Error("ENOCONTENT");
76
+ }
77
+ }
78
+
72
79
  let onImagePressArticle = null;
73
80
 
74
81
  if (onImagePress) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@times-components/article",
3
- "version": "7.17.11-alpha.1+99fa43b471",
3
+ "version": "7.17.11-alpha.14+23ab1999c5",
4
4
  "description": "The article",
5
5
  "main": "dist/article",
6
6
  "dev": "src/article",
@@ -35,7 +35,7 @@
35
35
  "@babel/core": "7.4.4",
36
36
  "@times-components/eslint-config-thetimes": "^0.8.18",
37
37
  "@times-components/jest-configurator-web": "^0.8.2",
38
- "@times-components/provider-test-tools": "^1.30.3",
38
+ "@times-components/provider-test-tools": "^1.30.4",
39
39
  "@times-components/storybook": "^4.12.34",
40
40
  "@times-components/tealium-utils": "^0.9.1",
41
41
  "@times-components/user-state": "^0.5.51",
@@ -53,14 +53,14 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@times-components/ad": "^2.22.23",
56
- "@times-components/article-in-depth": "^3.89.7-alpha.1+99fa43b471",
57
- "@times-components/article-magazine-comment": "^3.85.7-alpha.1+99fa43b471",
58
- "@times-components/article-magazine-standard": "^3.85.7-alpha.1+99fa43b471",
59
- "@times-components/article-main-comment": "^2.88.7-alpha.1+99fa43b471",
60
- "@times-components/article-main-standard": "^3.97.7-alpha.1+99fa43b471",
56
+ "@times-components/article-in-depth": "^3.89.7-alpha.14+23ab1999c5",
57
+ "@times-components/article-magazine-comment": "^3.85.7-alpha.14+23ab1999c5",
58
+ "@times-components/article-magazine-standard": "^3.85.7-alpha.14+23ab1999c5",
59
+ "@times-components/article-main-comment": "^2.88.7-alpha.14+23ab1999c5",
60
+ "@times-components/article-main-standard": "^3.97.7-alpha.14+23ab1999c5",
61
61
  "@times-components/context": "^1.24.0",
62
62
  "@times-components/message-bar": "^0.7.85",
63
- "@times-components/provider": "^1.41.3",
63
+ "@times-components/provider": "^1.41.4",
64
64
  "@times-components/responsive": "^0.27.0",
65
65
  "@times-components/ts-styleguide": "^1.50.34"
66
66
  },
@@ -75,5 +75,5 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
- "gitHead": "99fa43b4711ba31c13aef13fa2da1516918c10d7"
78
+ "gitHead": "23ab1999c5d03b97da9ba9974c110f2f97ac4aca"
79
79
  }
package/rnw.js CHANGED
@@ -1 +1 @@
1
- module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));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=9)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("@times-components/article-main-standard/rnw")},function(e,t){e.exports=require("@times-components/article-magazine-comment/rnw")},function(e,t){e.exports=require("@times-components/article-in-depth/rnw")},function(e,t){e.exports=require("@times-components/article-magazine-standard/rnw")},function(e,t){e.exports=require("@times-components/article-main-comment/rnw")},function(e,t){e.exports=require("@times-components/responsive/rnw")},function(e,t){e.exports=require("@times-components/ts-styleguide/rnw")},function(e,t){e.exports=require("@times-components/message-bar/rnw")},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),a=n(2),i=n.n(a),c=n(3),s=n.n(c),u=n(4),l=n.n(u),m=n(1),p=n.n(m),f=n(5),d=n.n(f),b=n(6),g=n.n(b),y=n(7),v=n(8);function O(){return(O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function j(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 x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"templates",(function(){return P})),n.d(t,"TakeoverBailout",(function(){return h}));const P={indepth:s.a,magazinecomment:i.a,magazinestandard:l.a,maincomment:d.a,mainstandard:p.a};class h extends Error{constructor(e){super(e),this.name="TakeoverBailout"}}t.default=e=>{const t=e.article,n=e.onImagePress,r=t||{},a=r.leadAsset,i=r.template;let c=(t||{}).content;if("takeoverpage"===i)throw new h("Aborted react render: Takeover page");let s=null;if(n){c=((e,t)=>{const n=e||[];let r=t?1:0;return n.forEach(e=>{const t=e;"image"!==t.name&&"video"!==t.name||(t.attributes.imageIndex=r,r+=1)}),n})(c,a);const e=((e,t)=>{const n=e||[];let r=0;const o=[];t&&(r+=1,o.push({index:0,name:"leadAsset",value:t}));return n.filter(e=>"image"===e.name||"video"===e.name).forEach(e=>{let t;if("video"===e.name){const n=e.attributes,o=n.caption,a=n.posterImageUrl;t={index:r,name:"inlineVideo",value:{caption:o,posterImageUrl:a}}}else t={index:r,name:"inlineImage",value:e.attributes};r+=1,o.push(t)}),o})(c,a);s=t=>n(t,e)}const u=P[i]||p.a,l=x(x({},e),{},{article:x(x({},t),{},{template:t&&t.template?t.template:"mainstandard"})});return o.a.createElement(g.a,null,o.a.createElement(v.MessageManager,{delay:3e3,scale:y.scales.medium},o.a.createElement(u,O({},l,{onImagePress:s}))))}}]);
1
+ module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));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=9)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("@times-components/article-main-standard/rnw")},function(e,t){e.exports=require("@times-components/article-magazine-comment/rnw")},function(e,t){e.exports=require("@times-components/article-in-depth/rnw")},function(e,t){e.exports=require("@times-components/article-magazine-standard/rnw")},function(e,t){e.exports=require("@times-components/article-main-comment/rnw")},function(e,t){e.exports=require("@times-components/responsive/rnw")},function(e,t){e.exports=require("@times-components/ts-styleguide/rnw")},function(e,t){e.exports=require("@times-components/message-bar/rnw")},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),a=n(2),i=n.n(a),c=n(3),s=n.n(c),u=n(4),l=n.n(u),m=n(1),p=n.n(m),f=n(5),d=n.n(f),b=n(6),g=n.n(b),O=n(7),v=n(8);function y(){return(y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}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}n.d(t,"templates",(function(){return h})),n.d(t,"TakeoverBailout",(function(){return P}));const h={indepth:s.a,magazinecomment:i.a,magazinestandard:l.a,maincomment:d.a,mainstandard:p.a};class P extends Error{constructor(e){super(e),this.name="TakeoverBailout"}}t.default=e=>{const t=e.article,n=e.onImagePress,r=t||{},a=r.leadAsset,i=r.template,c=r.isPreview;let s=(t||{}).content;if("takeoverpage"===i)throw new P("Aborted react render: Takeover page");if(t&&!c&&!t.tiles.length&&!s.length)throw new Error("ENOCONTENT");let u=null;if(n){s=((e,t)=>{const n=e||[];let r=t?1:0;return n.forEach(e=>{const t=e;"image"!==t.name&&"video"!==t.name||(t.attributes.imageIndex=r,r+=1)}),n})(s,a);const e=((e,t)=>{const n=e||[];let r=0;const o=[];t&&(r+=1,o.push({index:0,name:"leadAsset",value:t}));return n.filter(e=>"image"===e.name||"video"===e.name).forEach(e=>{let t;if("video"===e.name){const n=e.attributes,o=n.caption,a=n.posterImageUrl;t={index:r,name:"inlineVideo",value:{caption:o,posterImageUrl:a}}}else t={index:r,name:"inlineImage",value:e.attributes};r+=1,o.push(t)}),o})(s,a);u=t=>n(t,e)}const l=h[i]||p.a,m=j(j({},e),{},{article:j(j({},t),{},{template:t&&t.template?t.template:"mainstandard"})});return o.a.createElement(g.a,null,o.a.createElement(v.MessageManager,{delay:3e3,scale:O.scales.medium},o.a.createElement(l,y({},m,{onImagePress:u}))))}}]);