@times-components/article 7.17.13-alpha.7 → 7.17.13

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,17 @@
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.13](https://github.com/newsuk/times-components/compare/@times-components/article@7.17.12...@times-components/article@7.17.13) (2024-09-24)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **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))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [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)
7
18
 
8
19
 
package/dist/article.js CHANGED
@@ -69,7 +69,7 @@ const Article = props => {
69
69
  throw new TakeoverBailout("Aborted react render: Takeover page");
70
70
  }
71
71
 
72
- if (article && !article.tiles.length && !content.length) {
72
+ if (article && !article.isPreview && !article.tiles.length && !content.length) {
73
73
  throw new Error("ENOCONTENT");
74
74
  }
75
75
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@times-components/article",
3
- "version": "7.17.13-alpha.7+28371efee5",
3
+ "version": "7.17.13",
4
4
  "description": "The article",
5
5
  "main": "dist/article",
6
6
  "dev": "src/article",
@@ -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/eslint-config-thetimes": "^0.8.18",
37
- "@times-components/jest-configurator-web": "^0.8.2",
38
- "@times-components/provider-test-tools": "^1.30.4",
39
- "@times-components/storybook": "^4.12.34",
40
- "@times-components/tealium-utils": "^0.9.1",
41
- "@times-components/user-state": "^0.5.51",
42
- "@times-components/webpack-configurator": "^2.1.1",
36
+ "@times-components/eslint-config-thetimes": "0.8.18",
37
+ "@times-components/jest-configurator-web": "0.8.2",
38
+ "@times-components/provider-test-tools": "1.30.4",
39
+ "@times-components/storybook": "4.12.34",
40
+ "@times-components/tealium-utils": "0.9.1",
41
+ "@times-components/user-state": "0.5.51",
42
+ "@times-components/webpack-configurator": "2.1.1",
43
43
  "babel-jest": "24.8.0",
44
44
  "babel-loader": "8.0.5",
45
45
  "depcheck": "0.6.9",
@@ -52,17 +52,17 @@
52
52
  "webpack": "4.30.0"
53
53
  },
54
54
  "dependencies": {
55
- "@times-components/ad": "^2.22.23",
56
- "@times-components/article-in-depth": "^3.89.9-alpha.7+28371efee5",
57
- "@times-components/article-magazine-comment": "^3.85.9-alpha.7+28371efee5",
58
- "@times-components/article-magazine-standard": "^3.85.9-alpha.7+28371efee5",
59
- "@times-components/article-main-comment": "^2.88.9-alpha.7+28371efee5",
60
- "@times-components/article-main-standard": "^3.97.9-alpha.7+28371efee5",
61
- "@times-components/context": "^1.24.0",
62
- "@times-components/message-bar": "^0.7.85",
63
- "@times-components/provider": "^1.41.4",
64
- "@times-components/responsive": "^0.27.0",
65
- "@times-components/ts-styleguide": "^1.50.34"
55
+ "@times-components/ad": "2.22.23",
56
+ "@times-components/article-in-depth": "3.89.8",
57
+ "@times-components/article-magazine-comment": "3.85.8",
58
+ "@times-components/article-magazine-standard": "3.85.8",
59
+ "@times-components/article-main-comment": "2.88.8",
60
+ "@times-components/article-main-standard": "3.97.8",
61
+ "@times-components/context": "1.24.0",
62
+ "@times-components/message-bar": "0.7.85",
63
+ "@times-components/provider": "1.41.4",
64
+ "@times-components/responsive": "0.27.0",
65
+ "@times-components/ts-styleguide": "1.50.34"
66
66
  },
67
67
  "resolutions": {
68
68
  "react": "16.9.0",
@@ -75,5 +75,5 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
- "gitHead": "28371efee5245e9c0925ff8a0591749b20d81185"
78
+ "gitHead": "f1317d0af7d86fae712f5060c5f18a21b154f350"
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),O=n(7),y=n(8);function v(){return(v=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 w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}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;let c=(t||{}).content;if("takeoverpage"===i)throw new P("Aborted react render: Takeover page");if(t&&!t.tiles.length&&!c.length)throw new Error("ENOCONTENT");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=h[i]||p.a,l=w(w({},e),{},{article:w(w({},t),{},{template:t&&t.template?t.template:"mainstandard"})});return o.a.createElement(g.a,null,o.a.createElement(y.MessageManager,{delay:3e3,scale:O.scales.medium},o.a.createElement(u,v({},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;let c=(t||{}).content;if("takeoverpage"===i)throw new P("Aborted react render: Takeover page");if(t&&!t.isPreview&&!t.tiles.length&&!c.length)throw new Error("ENOCONTENT");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=h[i]||p.a,l=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(u,y({},l,{onImagePress:s}))))}}]);