@times-components/card 6.9.6 → 6.10.0
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 +11 -0
- package/dist/card-content.js +7 -4
- package/dist/card-prop-types.js +2 -0
- package/package.json +7 -7
- package/rnw.js +1 -1
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
|
+
# [6.10.0](https://github.com/newsuk/times-components/compare/@times-components/card@6.9.6...@times-components/card@6.10.0) (2022-10-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **TDP-2618:** updated topic page to use the lcpItem class for the f… ([#3170](https://github.com/newsuk/times-components/issues/3170)) ([69eace6](https://github.com/newsuk/times-components/commit/69eace62da80cb58d9d3ee30b1f7dcb725fa3a5d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [6.9.6](https://github.com/newsuk/times-components/compare/@times-components/card@6.9.5...@times-components/card@6.9.6) (2022-10-19)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @times-components/card
|
package/dist/card-content.js
CHANGED
|
@@ -72,8 +72,9 @@ var CardContent = /*#__PURE__*/function (_Component) {
|
|
|
72
72
|
lowResQuality = _this$props.lowResQuality,
|
|
73
73
|
lowResSize = _this$props.lowResSize,
|
|
74
74
|
highResSize = _this$props.highResSize,
|
|
75
|
-
isLoading = _this$props.isLoading
|
|
76
|
-
|
|
75
|
+
isLoading = _this$props.isLoading,
|
|
76
|
+
index = _this$props.index;
|
|
77
|
+
return imageUri !== nextProps.imageUri || lowResQuality !== nextProps.lowResQuality || lowResSize !== nextProps.lowResSize || highResSize !== nextProps.highResSize || isLoading !== nextProps.isLoading || index !== nextProps.index;
|
|
77
78
|
}
|
|
78
79
|
}, {
|
|
79
80
|
key: "render",
|
|
@@ -93,7 +94,8 @@ var CardContent = /*#__PURE__*/function (_Component) {
|
|
|
93
94
|
lowResQuality = _this$props2.lowResQuality,
|
|
94
95
|
lowResSize = _this$props2.lowResSize,
|
|
95
96
|
relatedArticle = _this$props2.relatedArticle,
|
|
96
|
-
showImage = _this$props2.showImage
|
|
97
|
+
showImage = _this$props2.showImage,
|
|
98
|
+
isLcpItem = _this$props2.isLcpItem;
|
|
97
99
|
var TcCardContainer = (0, _styledComponents["default"])(_utils.TcView).withConfig({
|
|
98
100
|
displayName: "card-content__TcCardContainer",
|
|
99
101
|
componentId: "sc-1w0wvq8-0"
|
|
@@ -114,7 +116,8 @@ var CardContent = /*#__PURE__*/function (_Component) {
|
|
|
114
116
|
highResSize: highResSize,
|
|
115
117
|
lowResQuality: lowResQuality,
|
|
116
118
|
lowResSize: lowResSize,
|
|
117
|
-
uri: imageUri
|
|
119
|
+
uri: imageUri,
|
|
120
|
+
isLcpItem: isLcpItem
|
|
118
121
|
}));
|
|
119
122
|
};
|
|
120
123
|
|
package/dist/card-prop-types.js
CHANGED
|
@@ -25,6 +25,7 @@ var cardPropTypes = _objectSpread(_objectSpread({}, _cardSharedPropTypes.sharedP
|
|
|
25
25
|
imageStyle: _propTypes["default"].object,
|
|
26
26
|
imageUri: _propTypes["default"].string,
|
|
27
27
|
isLoading: _propTypes["default"].bool,
|
|
28
|
+
isLcpItem: _propTypes["default"].bool,
|
|
28
29
|
lowResQuality: _propTypes["default"].number,
|
|
29
30
|
lowResSize: _propTypes["default"].number
|
|
30
31
|
});
|
|
@@ -39,6 +40,7 @@ var cardDefaultProps = _objectSpread(_objectSpread({}, _cardSharedPropTypes.shar
|
|
|
39
40
|
imageStyle: {},
|
|
40
41
|
imageUri: null,
|
|
41
42
|
isLoading: false,
|
|
43
|
+
isLcpItem: false,
|
|
42
44
|
lowResQuality: null,
|
|
43
45
|
lowResSize: null
|
|
44
46
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/card",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.10.0",
|
|
4
4
|
"main": "dist/card",
|
|
5
5
|
"dev": "src/card",
|
|
6
6
|
"scripts": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"@babel/core": "7.4.4",
|
|
34
34
|
"@times-components/eslint-config-thetimes": "0.8.18",
|
|
35
35
|
"@times-components/jest-configurator-web": "0.8.0",
|
|
36
|
-
"@times-components/jest-serializer": "3.
|
|
37
|
-
"@times-components/storybook": "4.5.
|
|
36
|
+
"@times-components/jest-serializer": "3.5.0",
|
|
37
|
+
"@times-components/storybook": "4.5.5",
|
|
38
38
|
"@times-components/test-utils": "2.4.0",
|
|
39
39
|
"@times-components/webpack-configurator": "2.1.0",
|
|
40
40
|
"babel-jest": "24.8.0",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"webpack": "4.30.0"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@times-components/gradient": "3.4.
|
|
56
|
-
"@times-components/image": "6.
|
|
55
|
+
"@times-components/gradient": "3.4.5",
|
|
56
|
+
"@times-components/image": "6.14.0",
|
|
57
57
|
"@times-components/responsive": "0.14.3",
|
|
58
58
|
"@times-components/ts-styleguide": "1.37.4",
|
|
59
|
-
"@times-components/utils": "6.15.
|
|
59
|
+
"@times-components/utils": "6.15.4",
|
|
60
60
|
"prop-types": "15.7.2",
|
|
61
61
|
"styled-components": "4.3.2"
|
|
62
62
|
},
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "e8f59a4137fd15d9f9c092097eae91b52aae5c8d"
|
|
75
75
|
}
|
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=7)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("@times-components/ts-styleguide/rnw")},function(e,t){e.exports=require("@times-components/utils/rnw")},function(e,t){e.exports=require("@times-components/gradient/rnw")},function(e,t){e.exports=require("styled-components")},function(e,t){e.exports=require("@times-components/image/rnw")},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),i=n(2),a=n(1),c=n.n(a);function l(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}s(s({},{contentContainerClass:c.a.string,imageContainerClass:c.a.string,imageRatio:c.a.number,isReversed:c.a.bool,showImage:c.a.bool}),{},{children:c.a.node,fadeImageIn:c.a.bool,highResSize:c.a.number,imageAccessibilityLabel:c.a.string,imageStyle:c.a.object,imageUri:c.a.string,isLoading:c.a.bool,lowResQuality:c.a.number,lowResSize:c.a.number});var f=s(s({},{contentContainerClass:"",imageContainerClass:"",imageRatio:1.5,isReversed:!1,showImage:!1}),{},{children:null,fadeImageIn:!1,highResSize:null,imageRatio:1,imageStyle:{},imageUri:null,isLoading:!1,lowResQuality:null,lowResSize:null}),p=n(3),m=n(5),b=n.n(m),y=n(6),g=n.n(y),d=n(4),O=n.n(d),h={cardContainer:{alignItems:"flex-start",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end"},cardContainerTablet:{alignItems:"flex-start",flexDirection:"row",flexWrap:"wrap"},contentContainer:{flex:1,marginBottom:0,minWidth:"100%"},contentContainerTablet:{flex:1,marginBottom:0},headerContainer:{height:24,marginBottom:Object(i.spacing)(2),maxWidth:300},imageContainer:{flex:1,marginBottom:Object(i.spacing)(2),minWidth:"100%"},imageContainerTablet:{flex:1,maxWidth:320},lastBar:{marginBottom:0,maxWidth:240},loadingContentContainer:{minHeight:84},reversedCardContainer:{height:"auto"},reversedContentContainer:{marginBottom:Object(i.spacing)(2)},reversedImageContainer:{marginBottom:0},textContainer:{height:10,marginBottom:Object(i.spacing)(2)}};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){v(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 v(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(){return o.a.createElement(r.Fragment,null,o.a.createElement(O.a,{degrees:264,style:h.headerContainer}),o.a.createElement(O.a,{degrees:267,style:h.textContainer}),o.a.createElement(O.a,{degrees:267,style:h.textContainer}),o.a.createElement(O.a,{degrees:267,style:w(w({},h.textContainer),h.lastBar)}))};function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function
|
|
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=7)}([function(e,t){e.exports=require("react")},function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("@times-components/ts-styleguide/rnw")},function(e,t){e.exports=require("@times-components/utils/rnw")},function(e,t){e.exports=require("@times-components/gradient/rnw")},function(e,t){e.exports=require("styled-components")},function(e,t){e.exports=require("@times-components/image/rnw")},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),i=n(2),a=n(1),c=n.n(a);function l(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}s(s({},{contentContainerClass:c.a.string,imageContainerClass:c.a.string,imageRatio:c.a.number,isReversed:c.a.bool,showImage:c.a.bool}),{},{children:c.a.node,fadeImageIn:c.a.bool,highResSize:c.a.number,imageAccessibilityLabel:c.a.string,imageStyle:c.a.object,imageUri:c.a.string,isLoading:c.a.bool,isLcpItem:c.a.bool,lowResQuality:c.a.number,lowResSize:c.a.number});var f=s(s({},{contentContainerClass:"",imageContainerClass:"",imageRatio:1.5,isReversed:!1,showImage:!1}),{},{children:null,fadeImageIn:!1,highResSize:null,imageRatio:1,imageStyle:{},imageUri:null,isLoading:!1,isLcpItem:!1,lowResQuality:null,lowResSize:null}),p=n(3),m=n(5),b=n.n(m),y=n(6),g=n.n(y),d=n(4),O=n.n(d),h={cardContainer:{alignItems:"flex-start",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end"},cardContainerTablet:{alignItems:"flex-start",flexDirection:"row",flexWrap:"wrap"},contentContainer:{flex:1,marginBottom:0,minWidth:"100%"},contentContainerTablet:{flex:1,marginBottom:0},headerContainer:{height:24,marginBottom:Object(i.spacing)(2),maxWidth:300},imageContainer:{flex:1,marginBottom:Object(i.spacing)(2),minWidth:"100%"},imageContainerTablet:{flex:1,maxWidth:320},lastBar:{marginBottom:0,maxWidth:240},loadingContentContainer:{minHeight:84},reversedCardContainer:{height:"auto"},reversedContentContainer:{marginBottom:Object(i.spacing)(2)},reversedImageContainer:{marginBottom:0},textContainer:{height:10,marginBottom:Object(i.spacing)(2)}};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){v(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 v(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(){return o.a.createElement(r.Fragment,null,o.a.createElement(O.a,{degrees:264,style:h.headerContainer}),o.a.createElement(O.a,{degrees:267,style:h.textContainer}),o.a.createElement(O.a,{degrees:267,style:h.textContainer}),o.a.createElement(O.a,{degrees:267,style:w(w({},h.textContainer),h.lastBar)}))};function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}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 S(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){R(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 R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=z(e);if(t){var o=z(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return L(this,n)}}function L(e,t){return!t||"object"!==P(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var B=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}(a,e);var t,n,r,i=D(a);function a(){return E(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"shouldComponentUpdate",value:function(e){var t=this.props,n=t.imageUri,r=t.lowResQuality,o=t.lowResSize,i=t.highResSize,a=t.isLoading,c=t.index;return n!==e.imageUri||r!==e.lowResQuality||o!==e.lowResSize||i!==e.highResSize||a!==e.isLoading||c!==e.index}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.contentContainerClass,r=e.fadeImageIn,i=e.highResSize,a=e.imageAccessibilityLabel,c=e.imageContainerClass,l=e.imageRatio,s=e.imageStyle,u=e.imageUri,f=e.isLoading,m=e.isReversed,y=e.lowResQuality,d=e.lowResSize,O=e.relatedArticle,j=e.showImage,w=e.isLcpItem,v=b()(p.TcView).withConfig({displayName:"card-content__TcCardContainer",componentId:"sc-1w0wvq8-0"})(["",";"],(function(e){return e.styles&&e.styles})),P=function(){if(!j)return null;var e=O?h.imageContainer:h.imageContainerTablet;return o.a.createElement(p.TcView,{className:c,style:Object(p.checkStylesForUnits)(S(S(S({},e),s),m?h.reversedImageContainer:""))},o.a.createElement(g.a,{accessibilityLabel:a,aspectRatio:l,fadeImageIn:r,highResSize:i,lowResQuality:y,lowResSize:d,uri:u,isLcpItem:w}))},x=O?S(S({},h.cardContainer),{},{display:"block"}):h.cardContainer;return o.a.createElement(p.TcView,{style:Object(p.checkStylesForUnits)(S(S({},x),m?h.reversedCardContainer:""))},m?null:P(),o.a.createElement(v,{className:n,styles:Object(p.checkStylesForUnits)(S(S(S({},h.contentContainer),m?h.reversedContentContainer:""),f?h.loadingContentContainer:""))},f?o.a.createElement(C,null):t),m?P():null)}}])&&I(t.prototype,n),r&&I(t,r),a}(r.Component);B.defaultProps=f;var T=B,k=function(e){return e.isLoading?o.a.createElement(i.Animations.FadeIn,null,o.a.createElement(T,e)):o.a.createElement(T,e)};k.defaultProps=f;t.default=k}]);
|