@times-components/article-extras 0.30.1 → 0.30.2-alpha.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/dist/article-extras.js +9 -10
- package/dist/styles/index.js +36 -1
- package/package.json +20 -20
- package/rnw.js +1 -1
package/dist/article-extras.js
CHANGED
|
@@ -88,16 +88,15 @@ const ArticleExtras = _ref => {
|
|
|
88
88
|
articleId: articleId,
|
|
89
89
|
articleHeadline: articleHeadline,
|
|
90
90
|
articleSection: section
|
|
91
|
-
})), /*#__PURE__*/_react.default.createElement(_styles.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}), /*#__PURE__*/_react.default.createElement(_styles.
|
|
98
|
-
id: "advert-inarticle-native-
|
|
99
|
-
|
|
100
|
-
})));
|
|
91
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.PromotedContentContainer, null, /*#__PURE__*/_react.default.createElement(_styles.PromotedContentTitle, null, "PROMOTED CONTENT"), /*#__PURE__*/_react.default.createElement(_styles.PromotedContentGrid, null, /*#__PURE__*/_react.default.createElement(_styles.PromotedContentAd, {
|
|
92
|
+
id: "advert-inarticle-native-1"
|
|
93
|
+
}), /*#__PURE__*/_react.default.createElement(_styles.PromotedContentAd, {
|
|
94
|
+
id: "advert-inarticle-native-2"
|
|
95
|
+
}), /*#__PURE__*/_react.default.createElement(_styles.PromotedContentSectionDivider, null), /*#__PURE__*/_react.default.createElement(_styles.PromotedContentAd, {
|
|
96
|
+
id: "advert-inarticle-native-3"
|
|
97
|
+
}), /*#__PURE__*/_react.default.createElement(_styles.PromotedContentAd, {
|
|
98
|
+
id: "advert-inarticle-native-4"
|
|
99
|
+
}))));
|
|
101
100
|
|
|
102
101
|
return /*#__PURE__*/_react.default.createElement(_userState.default, {
|
|
103
102
|
state: _userState.default.showArticleExtras,
|
package/dist/styles/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.Ad = exports.NativeAdTitle = exports.NativeAd = void 0;
|
|
6
|
+
exports.default = exports.PromotedContentSectionDivider = exports.PromotedContentAd = exports.PromotedContentGrid = exports.PromotedContentTitle = exports.PromotedContentContainer = exports.Ad = exports.NativeAdTitle = exports.NativeAd = void 0;
|
|
7
7
|
|
|
8
8
|
var _tsStyleguide = require("@times-components/ts-styleguide");
|
|
9
9
|
|
|
@@ -76,5 +76,40 @@ const styles = {
|
|
|
76
76
|
width: "100%"
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
+
|
|
80
|
+
const PromotedContentContainer = _styledComponents.default.div.withConfig({
|
|
81
|
+
displayName: "styles__PromotedContentContainer",
|
|
82
|
+
componentId: "sc-1ul3b7n-3"
|
|
83
|
+
})(["border-top:2px solid #1d1d1b;background-color:#f5f5f5;padding:20px 20px 24px 20px;margin-block-start:20px;&:not(:last-child){margin-block-end:32px;}@media (min-width:", "px){padding:16px;margin-block-start:28px;margin-block-end:32px;margin-inline:20px;}"], _tsStyleguide.breakpoints.wide);
|
|
84
|
+
|
|
85
|
+
exports.PromotedContentContainer = PromotedContentContainer;
|
|
86
|
+
|
|
87
|
+
const PromotedContentTitle = _styledComponents.default.span.withConfig({
|
|
88
|
+
displayName: "styles__PromotedContentTitle",
|
|
89
|
+
componentId: "sc-1ul3b7n-4"
|
|
90
|
+
})(["display:block;font-family:\"Roboto\";font-weight:500;font-size:12px;line-height:16px;color:#3b3b3b;margin-block:16px;"]);
|
|
91
|
+
|
|
92
|
+
exports.PromotedContentTitle = PromotedContentTitle;
|
|
93
|
+
|
|
94
|
+
const PromotedContentGrid = _styledComponents.default.div.withConfig({
|
|
95
|
+
displayName: "styles__PromotedContentGrid",
|
|
96
|
+
componentId: "sc-1ul3b7n-5"
|
|
97
|
+
})(["display:grid;grid-template-columns:repeat(2,1fr);gap:16px 32px;@media (min-width:", "px){grid-template-columns:repeat(4,1fr);}"], _tsStyleguide.breakpoints.wide);
|
|
98
|
+
|
|
99
|
+
exports.PromotedContentGrid = PromotedContentGrid;
|
|
100
|
+
|
|
101
|
+
const PromotedContentAd = _styledComponents.default.div.withConfig({
|
|
102
|
+
displayName: "styles__PromotedContentAd",
|
|
103
|
+
componentId: "sc-1ul3b7n-6"
|
|
104
|
+
})(["position:relative;min-height:150px;&:nth-child(1)::after,&:nth-child(4)::after{position:absolute;content:\"\";top:0;right:-16px;width:1px;height:100%;background-color:#c2c2c2;}@media (min-width:", "px){&:not(:last-child)::after{position:absolute;content:\"\";top:0;right:-16px;width:1px;height:100%;background-color:#c2c2c2;}}"], _tsStyleguide.breakpoints.wide);
|
|
105
|
+
|
|
106
|
+
exports.PromotedContentAd = PromotedContentAd;
|
|
107
|
+
|
|
108
|
+
const PromotedContentSectionDivider = _styledComponents.default.div.withConfig({
|
|
109
|
+
displayName: "styles__PromotedContentSectionDivider",
|
|
110
|
+
componentId: "sc-1ul3b7n-7"
|
|
111
|
+
})(["border-top:1px solid #e4e4e4;grid-column:1 / 3;@media (min-width:", "px){display:none;}"], _tsStyleguide.breakpoints.wide);
|
|
112
|
+
|
|
113
|
+
exports.PromotedContentSectionDivider = PromotedContentSectionDivider;
|
|
79
114
|
var _default = styles;
|
|
80
115
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-components/article-extras",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.2-alpha.0+2e1cb64680",
|
|
4
4
|
"description": "Extra information components at the bottom of the articles, such as topics, related articles and comments ",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"dev": "src/index",
|
|
@@ -33,12 +33,12 @@
|
|
|
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/jest-serializer": "3.13.20",
|
|
39
|
-
"@times-components/storybook": "4.12.34",
|
|
40
|
-
"@times-components/test-utils": "2.4.2",
|
|
41
|
-
"@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/jest-serializer": "^3.13.20",
|
|
39
|
+
"@times-components/storybook": "^4.12.34",
|
|
40
|
+
"@times-components/test-utils": "^2.4.2",
|
|
41
|
+
"@times-components/webpack-configurator": "^2.1.1",
|
|
42
42
|
"babel-jest": "24.8.0",
|
|
43
43
|
"eslint": "5.9.0",
|
|
44
44
|
"jest": "24.8.0",
|
|
@@ -49,18 +49,18 @@
|
|
|
49
49
|
"webpack": "4.30.0"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@times-components/article-comments": "0.44.1",
|
|
53
|
-
"@times-components/article-topics": "4.11.55",
|
|
54
|
-
"@times-components/button": "2.10.61",
|
|
55
|
-
"@times-components/context": "1.24.0",
|
|
56
|
-
"@times-components/message-bar": "0.7.85",
|
|
57
|
-
"@times-components/related-articles": "6.17.79",
|
|
58
|
-
"@times-components/save-and-share-bar": "0.22.3",
|
|
59
|
-
"@times-components/ts-components": "1.100.1",
|
|
60
|
-
"@times-components/ts-newskit": "1.189.0",
|
|
61
|
-
"@times-components/ts-styleguide": "1.50.34",
|
|
62
|
-
"@times-components/user-state": "0.5.51",
|
|
63
|
-
"@times-components/utils": "6.26.0",
|
|
52
|
+
"@times-components/article-comments": "^0.44.1",
|
|
53
|
+
"@times-components/article-topics": "^4.11.55",
|
|
54
|
+
"@times-components/button": "^2.10.61",
|
|
55
|
+
"@times-components/context": "^1.24.0",
|
|
56
|
+
"@times-components/message-bar": "^0.7.85",
|
|
57
|
+
"@times-components/related-articles": "^6.17.79",
|
|
58
|
+
"@times-components/save-and-share-bar": "^0.22.3",
|
|
59
|
+
"@times-components/ts-components": "^1.100.1",
|
|
60
|
+
"@times-components/ts-newskit": "^1.189.0",
|
|
61
|
+
"@times-components/ts-styleguide": "^1.50.34",
|
|
62
|
+
"@times-components/user-state": "^0.5.51",
|
|
63
|
+
"@times-components/utils": "^6.26.0",
|
|
64
64
|
"prop-types": "15.7.2",
|
|
65
65
|
"styled-components": "4.3.2"
|
|
66
66
|
},
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "2e1cb64680f52ef16eec2a1cbeaa51f3fc38fb15"
|
|
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
|
|
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("react")},function(e,t){e.exports=require("styled-components")},function(e,t){e.exports=require("@times-components/user-state/rnw")},function(e,t){e.exports=require("prop-types")},function(e,t){e.exports=require("@times-components/article-comments/rnw")},function(e,t){e.exports=require("@times-components/related-articles/rnw")},function(e,t){e.exports=require("@times-components/message-bar/rnw")},function(e,t){e.exports=require("@times-components/save-and-share-bar/rnw")},function(e,t){e.exports=require("@times-components/ts-components/rnw")},function(e,t){e.exports=require("@times-components/ts-newskit/rnw")},function(e,t){e.exports=require("@times-components/article-topics/rnw")},function(e,t){e.exports=require("@times-components/utils/rnw")},function(e,t,n){"use strict";n.r(t);var r=n(1),i=n.n(r),o=(n(4),n(3)),a=n.n(o),l=n(5),c=n.n(l),s=n(6),d=n.n(s),p=n(7),m=n(8),u=n.n(m),b=n(9),f=n(10),g=n(11),h=n.n(g),y=n(12),w=n(2),x=n.n(w),v=n(0),O=x()(y.TcView).withConfig({displayName:"responsive",componentId:"rerzrc-0"})(["padding-left:",";padding-right:",";@media (min-width:","px){width:80.8%;margin:0 auto;padding-left:0;padding-right:0;}@media (min-width:","px){width:56.2%;}"],Object(v.spacing)(2),Object(v.spacing)(2),v.breakpoints.medium,v.breakpoints.wide);function E(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,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?E(Object(n),!0).forEach((function(t){j(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},{topicsContainer:{borderTopColor:v.colours.functional.keyline,borderTopWidth:1},topicsContainerTablet:{alignSelf:"center",width:v.tabletWidth},topicsMetaContainer:{justifyContent:"flex-start"}});const k=e=>{let t=e.topics;return t&&t.length>0?i.a.createElement(O,null,i.a.createElement("nav",{"data-cy":"topic-tags"},i.a.createElement(h.a,{style:C.topicsContainer,topics:t}))):null};k.defaultProps={topics:null};var P=k;const S=x.a.div.withConfig({displayName:"responsive__ShareAndSaveContainer",componentId:"hqs3q1-0"})(["border-top-color:",";border-top-style:solid;border-top-width:1px;width:56.2%;margin:0 auto;@media (max-width:","px){display:none;}",";"],v.colours.functional.keyline,v.breakpoints.huge,e=>e.showBottomBorder&&"border-bottom-color: ".concat(v.colours.functional.keyline,";\n border-bottom-style: solid;\n border-bottom-width: 1px;")),_=x.a.div.withConfig({displayName:"responsive__BreadcrumbContainer",componentId:"hqs3q1-1"})(["display:flex;justify-content:center;margin:0 auto;padding-bottom:8px;",";@media (min-width:","px){width:80.8%;}@media (min-width:","px){width:56.2%;}"],e=>e.$border?"\n border-bottom-color: ".concat(v.colours.functional.keyline,";\n border-bottom-style: solid;\n border-bottom-width: 1px;\n "):"",v.breakpoints.medium,v.breakpoints.wide);function q(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 N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?q(Object(n),!0).forEach((function(t){I(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}x.a.div.withConfig({displayName:"styles__NativeAd",componentId:"sc-1ul3b7n-0"})(["clear:both;display:flex;flex-wrap:wrap;margin:0 auto 30px;width:80.8%;min-height:210px;@media (min-width:768px){min-height:120px;}@media (min-width:","px){width:56.2%;}&.hidden{visibility:hidden;}"],v.breakpoints.wide),x.a.h2.withConfig({displayName:"styles__NativeAdTitle",componentId:"sc-1ul3b7n-1"})(["border-bottom:1px solid #dbdbdb;color:#333;flex:1 1 100%;font:normal ","px / 17px ",";margin-bottom:10px;padding:5px 0;text-transform:uppercase;"],v.fontSizes.teaser,v.fontsWithFallback.bodyRegular),x.a.div.withConfig({displayName:"styles__Ad",componentId:"sc-1ul3b7n-2"})(["flex:1 1 50%;@media (max-width:767px){flex:1 1 46%;&:first-of-type{margin-right:1.5%;}&:last-child{margin-left:1.5%;}}"]),N(N({},Object(v.fontFactory)({font:"supporting",fontSize:"tertiary"})),{},{color:v.colours.functional.secondary,maxWidth:330,textAlign:"center"}),Object(v.spacing)(0),Object(v.spacing)(5),v.colours.functional.keyline,Object(v.spacing)(10),N(N({color:v.colours.functional.primary},Object(v.fontFactory)({font:"headline",fontSize:"commentsHeadline"})),{},{maxWidth:315,paddingBottom:Object(v.spacing)(2),paddingTop:Object(v.spacing)(6),textAlign:"center"}),v.tabletWidth;const A=x.a.div.withConfig({displayName:"styles__PromotedContentContainer",componentId:"sc-1ul3b7n-3"})(["border-top:2px solid #1d1d1b;background-color:#f5f5f5;padding:20px 20px 24px 20px;margin-block-start:20px;&:not(:last-child){margin-block-end:32px;}@media (min-width:","px){padding:16px;margin-block-start:28px;margin-block-end:32px;margin-inline:20px;}"],v.breakpoints.wide),T=x.a.span.withConfig({displayName:"styles__PromotedContentTitle",componentId:"sc-1ul3b7n-4"})(['display:block;font-family:"Roboto";font-weight:500;font-size:12px;line-height:16px;color:#3b3b3b;margin-block:16px;']),B=x.a.div.withConfig({displayName:"styles__PromotedContentGrid",componentId:"sc-1ul3b7n-5"})(["display:grid;grid-template-columns:repeat(2,1fr);gap:16px 32px;@media (min-width:","px){grid-template-columns:repeat(4,1fr);}"],v.breakpoints.wide),D=x.a.div.withConfig({displayName:"styles__PromotedContentAd",componentId:"sc-1ul3b7n-6"})(['position:relative;min-height:150px;&:nth-child(1)::after,&:nth-child(4)::after{position:absolute;content:"";top:0;right:-16px;width:1px;height:100%;background-color:#c2c2c2;}@media (min-width:','px){&:not(:last-child)::after{position:absolute;content:"";top:0;right:-16px;width:1px;height:100%;background-color:#c2c2c2;}}'],v.breakpoints.wide),M=x.a.div.withConfig({displayName:"styles__PromotedContentSectionDivider",componentId:"sc-1ul3b7n-7"})(["border-top:1px solid #e4e4e4;grid-column:1 / 3;@media (min-width:","px){display:none;}"],v.breakpoints.wide);const F={clear:"both"},W=e=>{let t=e.analyticsStream,n=e.articleId,r=e.commentsEnabled,o=e.registerNode,l=e.savingEnabled,s=e.sharingEnabled,m=e.articleUrl,g=e.section,h=e.articleHeadline,y=e.relatedArticleSlice,w=e.relatedArticlesVisible,x=e.commentingConfig,v=e.topics,O=e.isSharingSavingEnabled,E=e.isCommentEnabled,j=e.storefrontConfig,C=e.breadcrumbs,k=e.domainSpecificUrl,q=e.isEntitlementFeatureEnabled;const N=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{showBorder:!1},t=e.showBorder;return C&&C.length>0?i.a.createElement(_,{$border:t},i.a.createElement(f.Breadcrumb,{data:C})):null},I=(e,r)=>i.a.createElement(i.a.Fragment,null,i.a.createElement("div",{id:"related-articles",ref:e=>o(e)},r&&N({showBorder:!1}),i.a.createElement(d.a,{analyticsStream:t,isVisible:w,slice:y}),e&&i.a.createElement(b.RecommendedFetch,{articleId:n,articleHeadline:h,articleSection:g})),i.a.createElement(A,null,i.a.createElement(T,null,"PROMOTED CONTENT"),i.a.createElement(B,null,i.a.createElement(D,{id:"advert-inarticle-native-1"}),i.a.createElement(D,{id:"advert-inarticle-native-2"}),i.a.createElement(M,null),i.a.createElement(D,{id:"advert-inarticle-native-3"}),i.a.createElement(D,{id:"advert-inarticle-native-4"}))));return i.a.createElement(a.a,{state:a.a.showArticleExtras,fallback:I(!1,!0)},i.a.createElement("div",{style:F}),N({showBorder:v&&v.length>0}),i.a.createElement(P,{topics:v}),O&&i.a.createElement(a.a,{state:a.a.showSaveAndShareBar},i.a.createElement(p.MessageContext.Consumer,null,e=>{let t=e.showMessage;return i.a.createElement(S,{showBottomBorder:!y},i.a.createElement(u.a,{articleId:n,articleHeadline:h,articleUrl:m,onCopyLink:()=>t("Article link copied"),onSaveToMyArticles:()=>{},onShareOnEmail:()=>{},savingEnabled:l,sharingEnabled:s}))})),I(!0,!1),i.a.createElement(c.a,{articleId:n,isEnabled:r,commentingConfig:x,isCommentEnabled:E,storefrontConfig:j,domainSpecificUrl:k,isEntitlementFeatureEnabled:q}))};W.defaultProps={relatedArticleSlice:null,topics:null,isSharingSavingEnabled:!0,isCommentEnabled:!0,breadcrumbs:[]};var z=W;t.default=z}]);
|