@times-components/key-facts 2.11.32 → 2.11.34

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,22 @@
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.11.34](https://github.com/newsuk/times-components/compare/@times-components/key-facts@2.11.33...@times-components/key-facts@2.11.34) (2023-01-31)
7
+
8
+ **Note:** Version bump only for package @times-components/key-facts
9
+
10
+
11
+
12
+
13
+
14
+ ## [2.11.33](https://github.com/newsuk/times-components/compare/@times-components/key-facts@2.11.32...@times-components/key-facts@2.11.33) (2023-01-27)
15
+
16
+ **Note:** Version bump only for package @times-components/key-facts
17
+
18
+
19
+
20
+
21
+
6
22
  ## [2.11.32](https://github.com/newsuk/times-components/compare/@times-components/key-facts@2.11.31...@times-components/key-facts@2.11.32) (2023-01-26)
7
23
 
8
24
  **Note:** Version bump only for package @times-components/key-facts
@@ -26,8 +26,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
26
26
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
27
27
 
28
28
  const getTitle = data => {
29
- if (data.children.length === 1) return data.children[0].attributes.value;
30
- const linkText = data.children.map(child => child.attributes.value);
29
+ if (data.children.length === 1 && data.children[0].attributes) {
30
+ return data.children[0].attributes.value;
31
+ }
32
+
33
+ const linkText = data.children.map(child => child.attributes ? child.attributes.value : child.attributes);
31
34
  const title = linkText.join(" ");
32
35
  return title.length > 0 ? title : " ";
33
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@times-components/key-facts",
3
- "version": "2.11.32",
3
+ "version": "2.11.34",
4
4
  "description": "Bulleted list of text data",
5
5
  "main": "dist/key-facts",
6
6
  "dev": "src/key-facts",
@@ -36,8 +36,8 @@
36
36
  "@babel/core": "7.4.4",
37
37
  "@times-components/eslint-config-thetimes": "0.8.18",
38
38
  "@times-components/jest-configurator-web": "0.8.0",
39
- "@times-components/jest-serializer": "3.5.3",
40
- "@times-components/storybook": "4.5.8",
39
+ "@times-components/jest-serializer": "3.5.4",
40
+ "@times-components/storybook": "4.5.9",
41
41
  "@times-components/tealium-utils": "0.8.1",
42
42
  "@times-components/webpack-configurator": "2.1.0",
43
43
  "babel-jest": "24.8.0",
@@ -53,12 +53,12 @@
53
53
  "webpack": "4.30.0"
54
54
  },
55
55
  "dependencies": {
56
- "@times-components/markup": "3.7.10",
56
+ "@times-components/markup": "3.7.12",
57
57
  "@times-components/markup-forest": "1.9.0",
58
- "@times-components/responsive": "0.14.8",
59
- "@times-components/ts-components": "1.63.3",
60
- "@times-components/ts-styleguide": "1.38.2",
61
- "@times-components/utils": "6.15.9",
58
+ "@times-components/responsive": "0.14.10",
59
+ "@times-components/ts-components": "1.63.5",
60
+ "@times-components/ts-styleguide": "1.38.4",
61
+ "@times-components/utils": "6.15.11",
62
62
  "prop-types": "15.7.2",
63
63
  "styled-components": "4.3.2"
64
64
  },
@@ -73,5 +73,5 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "118ecc9359a1c9d9f72519b2985b8f59f4f5cd5e"
76
+ "gitHead": "ec737e75af249f914d53d110c7d1a05cc70a7d6f"
77
77
  }
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=8)}([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("styled-components")},function(e,t){e.exports=require("@times-components/utils/rnw")},function(e,t){e.exports=require("@times-components/ts-components/rnw")},function(e,t){e.exports=require("@times-components/markup-forest/rnw")},function(e,t){e.exports=require("@times-components/markup/rnw")},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),i=n(5),a=n(6),c=n(7),l=n.n(c),s=n(4),u=n(2),p=n.n(u),d=(p.a.number.isRequired,p.a.object.isRequired,p.a.func.isRequired,n(3)),f=n.n(d),m=n(0);const b=f.a.a.withConfig({displayName:"styles__KeyFactTextLink",componentId:"sc-1shod7b-0"})(["color:inherit;cursor:pointer;text-decoration:underline;&:hover{color:",";}&:active{color:",";}"],m.colours.functional.brandColour,m.colours.functional.brandColour),y=f.a.div.withConfig({displayName:"styles__BulletContainer",componentId:"sc-1shod7b-1"})(["display:flex;flex-direction:row;margin-bottom:",";padding-left:",";width:100%;:last-of-type{margin-bottom:0px;}"],Object(m.spacing)(4),Object(m.spacing)(1)),g=f.a.div.withConfig({displayName:"styles__Bullet",componentId:"sc-1shod7b-2"})(["height:6px;width:6px;margin-top:2px;background-color:#9f0000;"]),h=f.a.h2.withConfig({displayName:"styles__KeyFactsTitle",componentId:"sc-1shod7b-3"})(["font-family:",";font-size:","px;font-weight:400;margin:0px 0px 20px 0px;color:",";"],m.fonts.headline,m.fontSizes.keyFactsTitle,m.colours.functional.brandColour),x=f.a.span.withConfig({displayName:"styles__Text",componentId:"sc-1shod7b-4"})(["color:",";font-family:",";font-size:","px;margin-top:-8px;padding-left:",";width:95%;line-height:28px;"],m.colours.functional.primary,m.fonts.bodyRegular,m.fontSizes.infoSubText,Object(m.spacing)(3)),v=f.a.div.withConfig({displayName:"styles__KeyFactsContainer",componentId:"sc-1shod7b-5"})(["margin:0 auto 20px auto;padding:16px 20px;background-color:",";border-top:2px solid #9f0000;@media (min-width:","px){width:80.8%;}@media (min-width:","px){width:56.2%;}"],m.colours.functional.backgroundPrimary,m.breakpoints.medium,m.breakpoints.wide);function _(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 O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(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}var j=e=>{let t=e.listIndex,n=e.keyFactItem,r=e.fireAnalyticsEvent,i=e.articleFlag;return o.a.createElement(y,{key:"key-facts-".concat(t)},o.a.createElement(g,null),o.a.createElement(x,null,n.children.map((e,n)=>Object(a.renderTree)(e,O(O({},l.a),{},{link(t,n,a){const c=n.href,l=(e=>{if(1===e.children.length)return e.children[0].attributes.value;const t=e.children.map(e=>e.attributes.value).join(" ");return t.length>0?t:" "})(e);return o.a.createElement(b,{key:t,onClick:e=>{Object(s.handleOnClickScrollTo)(e,c),((e,t,n)=>{e&&e({action:"Clicked",attrs:{event_navigation_name:"in-article component clicked : key moments",event_navigation_browsing_method:"click",article_parent_name:t,article_flag:n}})})(r,l,i)},href:Object(s.handleHrefScrollTo)(c)},a)}}),"key-facts-".concat(t,"-").concat(n)))))};p.a.object.isRequired,p.a.string,p.a.string,p.a.string;t.default=e=>{let t=e.ast,n=e.section,r=e.headline,a=e.isLiveOrBreaking;const c=t.children,l=t.attributes.title,s=c[0].children,u=a?a.toLowerCase():"no flag";return o.a.createElement(i.TrackingContextProvider,{context:{object:"KeyMoments",attrs:{component_type:"in-article component: key moments: interactive",event_navigation_action:"navigation",component_name:l,section_details:"section : ".concat(n),article_name:r,article_flag:u}},scrolledEvent:{action:"Scrolled",attrs:{event_navigation_name:"in-article component displayed : key moments",event_navigation_browsing_method:"scroll"}}},e=>{let t=e.fireAnalyticsEvent,n=e.intersectObserverRef;return o.a.createElement(v,{ref:n},l&&o.a.createElement(h,null,l),s.map((e,n)=>o.a.createElement(j,{listIndex:n,keyFactItem:e,fireAnalyticsEvent:t,articleFlag:u})))})}}]);
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=8)}([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("styled-components")},function(e,t){e.exports=require("@times-components/utils/rnw")},function(e,t){e.exports=require("@times-components/ts-components/rnw")},function(e,t){e.exports=require("@times-components/markup-forest/rnw")},function(e,t){e.exports=require("@times-components/markup/rnw")},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),i=n(5),a=n(6),c=n(7),l=n.n(c),s=n(4),u=n(2),p=n.n(u),d=(p.a.number.isRequired,p.a.object.isRequired,p.a.func.isRequired,n(3)),f=n.n(d),m=n(0);const b=f.a.a.withConfig({displayName:"styles__KeyFactTextLink",componentId:"sc-1shod7b-0"})(["color:inherit;cursor:pointer;text-decoration:underline;&:hover{color:",";}&:active{color:",";}"],m.colours.functional.brandColour,m.colours.functional.brandColour),y=f.a.div.withConfig({displayName:"styles__BulletContainer",componentId:"sc-1shod7b-1"})(["display:flex;flex-direction:row;margin-bottom:",";padding-left:",";width:100%;:last-of-type{margin-bottom:0px;}"],Object(m.spacing)(4),Object(m.spacing)(1)),g=f.a.div.withConfig({displayName:"styles__Bullet",componentId:"sc-1shod7b-2"})(["height:6px;width:6px;margin-top:2px;background-color:#9f0000;"]),h=f.a.h2.withConfig({displayName:"styles__KeyFactsTitle",componentId:"sc-1shod7b-3"})(["font-family:",";font-size:","px;font-weight:400;margin:0px 0px 20px 0px;color:",";"],m.fonts.headline,m.fontSizes.keyFactsTitle,m.colours.functional.brandColour),x=f.a.span.withConfig({displayName:"styles__Text",componentId:"sc-1shod7b-4"})(["color:",";font-family:",";font-size:","px;margin-top:-8px;padding-left:",";width:95%;line-height:28px;"],m.colours.functional.primary,m.fonts.bodyRegular,m.fontSizes.infoSubText,Object(m.spacing)(3)),v=f.a.div.withConfig({displayName:"styles__KeyFactsContainer",componentId:"sc-1shod7b-5"})(["margin:0 auto 20px auto;padding:16px 20px;background-color:",";border-top:2px solid #9f0000;@media (min-width:","px){width:80.8%;}@media (min-width:","px){width:56.2%;}"],m.colours.functional.backgroundPrimary,m.breakpoints.medium,m.breakpoints.wide);function _(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 O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(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}var j=e=>{let t=e.listIndex,n=e.keyFactItem,r=e.fireAnalyticsEvent,i=e.articleFlag;return o.a.createElement(y,{key:"key-facts-".concat(t)},o.a.createElement(g,null),o.a.createElement(x,null,n.children.map((e,n)=>Object(a.renderTree)(e,O(O({},l.a),{},{link(t,n,a){const c=n.href,l=(e=>{if(1===e.children.length&&e.children[0].attributes)return e.children[0].attributes.value;const t=e.children.map(e=>e.attributes?e.attributes.value:e.attributes).join(" ");return t.length>0?t:" "})(e);return o.a.createElement(b,{key:t,onClick:e=>{Object(s.handleOnClickScrollTo)(e,c),((e,t,n)=>{e&&e({action:"Clicked",attrs:{event_navigation_name:"in-article component clicked : key moments",event_navigation_browsing_method:"click",article_parent_name:t,article_flag:n}})})(r,l,i)},href:Object(s.handleHrefScrollTo)(c)},a)}}),"key-facts-".concat(t,"-").concat(n)))))};p.a.object.isRequired,p.a.string,p.a.string,p.a.string;t.default=e=>{let t=e.ast,n=e.section,r=e.headline,a=e.isLiveOrBreaking;const c=t.children,l=t.attributes.title,s=c[0].children,u=a?a.toLowerCase():"no flag";return o.a.createElement(i.TrackingContextProvider,{context:{object:"KeyMoments",attrs:{component_type:"in-article component: key moments: interactive",event_navigation_action:"navigation",component_name:l,section_details:"section : ".concat(n),article_name:r,article_flag:u}},scrolledEvent:{action:"Scrolled",attrs:{event_navigation_name:"in-article component displayed : key moments",event_navigation_browsing_method:"scroll"}}},e=>{let t=e.fireAnalyticsEvent,n=e.intersectObserverRef;return o.a.createElement(v,{ref:n},l&&o.a.createElement(h,null,l),s.map((e,n)=>o.a.createElement(j,{listIndex:n,keyFactItem:e,fireAnalyticsEvent:t,articleFlag:u})))})}}]);