@mjhls/mjh-framework 1.0.214 → 1.0.216
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/README.md +1 -1
- package/dist/cjs/VideoSeriesListing.js +11 -4
- package/dist/cjs/index.js +519 -27
- package/dist/esm/VideoSeriesListing.js +11 -4
- package/dist/esm/index.js +522 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -178,9 +178,12 @@ var VideoSeriesListing = function (_React$Component) {
|
|
|
178
178
|
'div',
|
|
179
179
|
null,
|
|
180
180
|
seriesData && seriesData.map(function (docSeries, index) {
|
|
181
|
-
docSeries.body[0].videos
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
if (docSeries.body.length > 0 && docSeries.body[0].videos) {
|
|
182
|
+
docSeries.body[0].videos.map(function (singleVideo, indexInner) {
|
|
183
|
+
singleVideo.link = '/view/' + docSeries.url.current + '?seriesVid=' + (indexInner + 1);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
184
187
|
return React__default.createElement(
|
|
185
188
|
'div',
|
|
186
189
|
{ key: index, counter: itemCounter++ },
|
|
@@ -198,7 +201,11 @@ var VideoSeriesListing = function (_React$Component) {
|
|
|
198
201
|
)
|
|
199
202
|
)
|
|
200
203
|
),
|
|
201
|
-
React__default.createElement(YoutubeGroup.YoutubeGroup, _babelHelpers._extends({ key: index, dataset: docSeries.body[0].videos }, _this.props))
|
|
204
|
+
docSeries.body.length > 0 && docSeries.body[0].videos ? React__default.createElement(YoutubeGroup.YoutubeGroup, _babelHelpers._extends({ key: index, dataset: docSeries.body[0].videos }, _this.props)) : React__default.createElement(
|
|
205
|
+
'p',
|
|
206
|
+
null,
|
|
207
|
+
'No Video Found.'
|
|
208
|
+
)
|
|
202
209
|
);
|
|
203
210
|
})
|
|
204
211
|
);
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,7 +14,7 @@ require('react-bootstrap/Row');
|
|
|
14
14
|
require('react-bootstrap/Col');
|
|
15
15
|
require('react-bootstrap/Card');
|
|
16
16
|
var visibilitySensor = require('./visibility-sensor-bea3105d.js');
|
|
17
|
-
require('next/link');
|
|
17
|
+
var Link = _interopDefault(require('next/link'));
|
|
18
18
|
var Router = require('next/router');
|
|
19
19
|
var Router__default = _interopDefault(Router);
|
|
20
20
|
require('./debounce-a963b136.js');
|
|
@@ -10403,16 +10403,11 @@ var Leads = function Leads(_ref) {
|
|
|
10403
10403
|
);
|
|
10404
10404
|
};
|
|
10405
10405
|
|
|
10406
|
-
var urlFor$2 = function urlFor(source,
|
|
10406
|
+
var urlFor$2 = function urlFor(source, client) {
|
|
10407
|
+
var builder = index$1.imageUrlBuilder(client);
|
|
10407
10408
|
return builder.image(source);
|
|
10408
10409
|
};
|
|
10409
10410
|
|
|
10410
|
-
var onChangeSlide$1 = function onChangeSlide(selectedIndex, router) {
|
|
10411
|
-
var pageNumber = selectedIndex + 1;
|
|
10412
|
-
var href = '/view/' + router.query.url + '/?page=' + pageNumber;
|
|
10413
|
-
Router__default.push(router.pathname, pageNumber > 1 ? href : '/view/' + router.query.url, { shallow: true });
|
|
10414
|
-
};
|
|
10415
|
-
|
|
10416
10411
|
var Slideshow$1 = function Slideshow(_ref) {
|
|
10417
10412
|
var slides = _ref.node.slides,
|
|
10418
10413
|
client = _ref.client,
|
|
@@ -10420,37 +10415,40 @@ var Slideshow$1 = function Slideshow(_ref) {
|
|
|
10420
10415
|
getSerializers = _ref.getSerializers;
|
|
10421
10416
|
|
|
10422
10417
|
var router = Router.useRouter();
|
|
10418
|
+
var pageNumber = router && router.asPath && router.asPath.split('?page=')[1];
|
|
10423
10419
|
|
|
10424
|
-
var _useState = React.useState(0),
|
|
10420
|
+
var _useState = React.useState(!pageNumber || isNaN(pageNumber) || pageNumber > slides.length ? 0 : pageNumber - 1),
|
|
10425
10421
|
_useState2 = _babelHelpers.slicedToArray(_useState, 2),
|
|
10426
10422
|
carouselIndex = _useState2[0],
|
|
10427
10423
|
setCarouselIndex = _useState2[1];
|
|
10428
10424
|
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
}
|
|
10439
|
-
}, [router]);
|
|
10425
|
+
// useEffect(() => {
|
|
10426
|
+
// let itemArr = router.asPath.split('?page=')
|
|
10427
|
+
// let pageNumber = parseInt(itemArr[1])
|
|
10428
|
+
// if (!pageNumber || isNaN(pageNumber) || pageNumber > slides.length) {
|
|
10429
|
+
// setCarouselIndex(0)
|
|
10430
|
+
// } else {
|
|
10431
|
+
// setCarouselIndex(parseInt(itemArr[1]) - 1)
|
|
10432
|
+
// }
|
|
10433
|
+
// }, [router])
|
|
10440
10434
|
|
|
10441
10435
|
React.useEffect(function () {
|
|
10442
10436
|
index.lib_3.refresh();
|
|
10443
|
-
if (pageview) pageview(router.asPath)
|
|
10437
|
+
// if (pageview) pageview(router.asPath)
|
|
10444
10438
|
}, [router]);
|
|
10445
10439
|
|
|
10440
|
+
var onChangeSlide = function onChangeSlide(selectedIndex) {
|
|
10441
|
+
var pageNumber = selectedIndex + 1;
|
|
10442
|
+
var href = '/view/' + router.query.url + '/?page=' + pageNumber;
|
|
10443
|
+
router.push(router.pathname, pageNumber > 1 ? href : '/view/' + router.query.url, { shallow: true });
|
|
10444
|
+
};
|
|
10445
|
+
|
|
10446
10446
|
return React__default.createElement(
|
|
10447
10447
|
'div',
|
|
10448
10448
|
{ className: 'mt-3 mb-3' },
|
|
10449
10449
|
React__default.createElement(
|
|
10450
10450
|
reactBootstrap.Carousel,
|
|
10451
|
-
{ activeIndex: carouselIndex, onSelect:
|
|
10452
|
-
return onChangeSlide$1(selectedIndex, router);
|
|
10453
|
-
} },
|
|
10451
|
+
{ activeIndex: carouselIndex, onSelect: onChangeSlide },
|
|
10454
10452
|
slides && slides.map(function (slide) {
|
|
10455
10453
|
if (slide.slideshowImage && slide.slideshowImage.asset) {
|
|
10456
10454
|
return React__default.createElement(
|
|
@@ -10459,7 +10457,7 @@ var Slideshow$1 = function Slideshow(_ref) {
|
|
|
10459
10457
|
React__default.createElement(
|
|
10460
10458
|
'a',
|
|
10461
10459
|
{ href: slide.slideshowImage.link && slide.slideshowImage.link, target: slide.slideshowImage.blank ? '_blank' : '_self' },
|
|
10462
|
-
React__default.createElement('img', { src: urlFor$2(slide.slideshowImage,
|
|
10460
|
+
React__default.createElement('img', { src: urlFor$2(slide.slideshowImage, client).url(), alt: slide.slideshowImage.alt || 'slideshow image', style: { width: '100%' } })
|
|
10463
10461
|
),
|
|
10464
10462
|
React__default.createElement(
|
|
10465
10463
|
'div',
|
|
@@ -11618,7 +11616,7 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
|
|
|
11618
11616
|
),
|
|
11619
11617
|
React__default.createElement(
|
|
11620
11618
|
'p',
|
|
11621
|
-
|
|
11619
|
+
{ className: 'top-article-summary' },
|
|
11622
11620
|
entities.clean_html_1(topArticle.summary)
|
|
11623
11621
|
)
|
|
11624
11622
|
)
|
|
@@ -11763,7 +11761,7 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
|
|
|
11763
11761
|
React__default.createElement(
|
|
11764
11762
|
'style',
|
|
11765
11763
|
{ jsx: 'true' },
|
|
11766
|
-
'\n .article-hero-container {\n margin: 0 -0.8rem;\n }\n @media screen and (min-width: 1400px) {\n .article-hero-container {\n display: flex;\n flex-direction: row;\n }\n }\n .top-article {\n // width: 50%;\n margin: 0 1rem;\n height: 100%;\n display: block;\n }\n .top-article figure {\n width: 100%;\n height: 60%;\n }\n .top-article figure img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n .top-article--body h1 {\n font-size: 1.4rem;\n color: black !important;\n font-weight: bold;\n }\n // .sub-articles-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n .sub-article {\n margin: 0 1rem 1rem;\n display: flex;\n flex-direction: row;\n }\n .sub-article figure {\n width: 125px;\n }\n .sub-article figure img {\n width: 125px;\n height: auto;\n object-fit: cover;\n }\n .sub-article--body {\n padding-left: 1rem;\n font-size: 0.9rem;\n }\n .sub-article--body h2 {\n font-size: 1rem;\n font-weight: bold;\n }\n @media screen and (max-width: 1368px) {\n .article-hero-container {\n flex-direction: column;\n }\n .top-article {\n // width: unset;\n flex: 1 1 auto;\n }\n .sub-articles-container {\n width: 100%;\n margin-top: 1rem;\n min-width: 280px;\n }\n }\n @media screen and (max-width: 1399px) and (min-width: 992px) {\n .top-article {\n // width: 50%;\n flex: 1 1 auto;\n margin-bottom: 1rem;\n }\n .middle-group {\n display: none;\n }\n .middle-single {\n display: block !important;\n margin-top: 0 !important;\n }\n .top-article figure img {\n max-height: 180px !important;\n }\n }\n // @media only screen and (min-width) {\n // .sub-outer-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n // }\n .middle-single {\n display: none;\n }\n .top-outer {\n display: flex;\n }\n '
|
|
11764
|
+
'\n .article-hero-container {\n margin: 0 -0.8rem;\n }\n @media screen and (min-width: 1400px) {\n .article-hero-container {\n display: flex;\n flex-direction: row;\n }\n }\n .top-article {\n // width: 50%;\n margin: 0 1rem;\n height: 100%;\n display: block;\n }\n .top-article figure {\n width: 100%;\n height: 60%;\n }\n .top-article figure img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n .top-article--body h1 {\n font-size: 1.4rem;\n color: black !important;\n font-weight: bold;\n }\n // .sub-articles-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n .sub-article {\n margin: 0 1rem 1rem;\n display: flex;\n flex-direction: row;\n }\n .sub-article figure {\n width: 125px;\n }\n .sub-article figure img {\n width: 125px;\n height: auto;\n object-fit: cover;\n }\n .sub-article--body {\n padding-left: 1rem;\n font-size: 0.9rem;\n }\n .sub-article--body h2 {\n font-size: 1rem;\n font-weight: bold;\n }\n @media screen and (max-width: 1368px) {\n .article-hero-container {\n flex-direction: column;\n }\n .top-article {\n // width: unset;\n flex: 1 1 auto;\n }\n .sub-articles-container {\n width: 100%;\n margin-top: 1rem;\n min-width: 280px;\n }\n }\n @media screen and (max-width: 1399px) and (min-width: 992px) {\n .top-article {\n // width: 50%;\n flex: 1 1 auto;\n margin-bottom: 1rem;\n }\n .middle-group {\n display: none;\n }\n .middle-single {\n display: block !important;\n margin-top: 0 !important;\n }\n .top-article figure img {\n max-height: 180px !important;\n }\n .top-article-summary {\n display: none;\n }\n }\n // @media only screen and (min-width) {\n // .sub-outer-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n // }\n .middle-single {\n display: none;\n }\n .top-outer {\n display: flex;\n }\n '
|
|
11767
11765
|
)
|
|
11768
11766
|
);
|
|
11769
11767
|
};
|
|
@@ -12107,6 +12105,499 @@ var ConferenceArticleCard = function ConferenceArticleCard(props) {
|
|
|
12107
12105
|
);
|
|
12108
12106
|
};
|
|
12109
12107
|
|
|
12108
|
+
var InscreenSensor = function (_React$Component) {
|
|
12109
|
+
_babelHelpers.inherits(InscreenSensor, _React$Component);
|
|
12110
|
+
|
|
12111
|
+
function InscreenSensor(props) {
|
|
12112
|
+
_babelHelpers.classCallCheck(this, InscreenSensor);
|
|
12113
|
+
|
|
12114
|
+
var _this = _babelHelpers.possibleConstructorReturn(this, (InscreenSensor.__proto__ || Object.getPrototypeOf(InscreenSensor)).call(this, props));
|
|
12115
|
+
|
|
12116
|
+
_this.scrollHandler = function () {
|
|
12117
|
+
// this.checkInside()
|
|
12118
|
+
|
|
12119
|
+
var visible = _this.checkInside();
|
|
12120
|
+
if (visible != _this.visible) {
|
|
12121
|
+
_this.visible = visible;
|
|
12122
|
+
_this.props.onChange(visible);
|
|
12123
|
+
}
|
|
12124
|
+
};
|
|
12125
|
+
|
|
12126
|
+
_this.checkInside = function () {
|
|
12127
|
+
var rect = _this.wraperRef.current.getBoundingClientRect();
|
|
12128
|
+
var _this$props$offSetTop = _this.props.offSetTop,
|
|
12129
|
+
offSetTop = _this$props$offSetTop === undefined ? 0 : _this$props$offSetTop;
|
|
12130
|
+
var top = rect.top,
|
|
12131
|
+
height = rect.height;
|
|
12132
|
+
|
|
12133
|
+
var bottom = top + height;
|
|
12134
|
+
var viewHeight = window.innerHeight;
|
|
12135
|
+
if (bottom < offSetTop) {
|
|
12136
|
+
return false;
|
|
12137
|
+
} else if (top > offSetTop && bottom <= viewHeight) {
|
|
12138
|
+
return true;
|
|
12139
|
+
} else if (top > offSetTop && top <= viewHeight && bottom > viewHeight) {
|
|
12140
|
+
return 'top';
|
|
12141
|
+
} else if (bottom <= viewHeight) {
|
|
12142
|
+
return 'bottom';
|
|
12143
|
+
} else {
|
|
12144
|
+
return false;
|
|
12145
|
+
}
|
|
12146
|
+
};
|
|
12147
|
+
|
|
12148
|
+
_this.wraperRef = React__default.createRef();
|
|
12149
|
+
_this.visible = false;
|
|
12150
|
+
return _this;
|
|
12151
|
+
}
|
|
12152
|
+
|
|
12153
|
+
_babelHelpers.createClass(InscreenSensor, [{
|
|
12154
|
+
key: 'componentDidMount',
|
|
12155
|
+
value: function componentDidMount() {
|
|
12156
|
+
this.visible = this.checkInside();
|
|
12157
|
+
this.props.onChange(this.visible);
|
|
12158
|
+
window.addEventListener('scroll', this.scrollHandler);
|
|
12159
|
+
}
|
|
12160
|
+
}, {
|
|
12161
|
+
key: 'componentWillUnmount',
|
|
12162
|
+
value: function componentWillUnmount() {
|
|
12163
|
+
window.removeEventListener('scroll', this.scrollHandler);
|
|
12164
|
+
}
|
|
12165
|
+
}, {
|
|
12166
|
+
key: 'render',
|
|
12167
|
+
value: function render() {
|
|
12168
|
+
var _props = this.props,
|
|
12169
|
+
_props$className = _props.className,
|
|
12170
|
+
className = _props$className === undefined ? '' : _props$className,
|
|
12171
|
+
_props$style = _props.style,
|
|
12172
|
+
style = _props$style === undefined ? {} : _props$style;
|
|
12173
|
+
|
|
12174
|
+
return React__default.createElement(
|
|
12175
|
+
'div',
|
|
12176
|
+
{ ref: this.wraperRef, className: className, style: style },
|
|
12177
|
+
this.props.children
|
|
12178
|
+
);
|
|
12179
|
+
}
|
|
12180
|
+
}]);
|
|
12181
|
+
return InscreenSensor;
|
|
12182
|
+
}(React__default.Component);
|
|
12183
|
+
|
|
12184
|
+
var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
12185
|
+
if (authorName && authorURL) return React__default.createElement(
|
|
12186
|
+
Link,
|
|
12187
|
+
{ href: '/authors/' + authorURL.current, key: index },
|
|
12188
|
+
React__default.createElement(
|
|
12189
|
+
'a',
|
|
12190
|
+
null,
|
|
12191
|
+
authorName,
|
|
12192
|
+
length !== index + 1 && React__default.createElement('br', null)
|
|
12193
|
+
)
|
|
12194
|
+
);else if (authorName) {
|
|
12195
|
+
return React__default.createElement(
|
|
12196
|
+
'span',
|
|
12197
|
+
{ key: index },
|
|
12198
|
+
authorName,
|
|
12199
|
+
length !== index + 1 && React__default.createElement('br', null)
|
|
12200
|
+
);
|
|
12201
|
+
}
|
|
12202
|
+
};
|
|
12203
|
+
|
|
12204
|
+
var Article = function Article(props) {
|
|
12205
|
+
var client = props.client,
|
|
12206
|
+
pageview = props.pageview,
|
|
12207
|
+
videoAccountIDs = props.videoAccountIDs,
|
|
12208
|
+
_props$article = props.article,
|
|
12209
|
+
title = _props$article.title,
|
|
12210
|
+
passwordLock = _props$article.passwordLock,
|
|
12211
|
+
authorDetails = _props$article.authorDetails,
|
|
12212
|
+
published = _props$article.published,
|
|
12213
|
+
articleBody = _props$article.body,
|
|
12214
|
+
summary = _props$article.summary,
|
|
12215
|
+
thumbnail = _props$article.thumbnail,
|
|
12216
|
+
_props$article$url = _props$article.url;
|
|
12217
|
+
_props$article$url = _props$article$url === undefined ? {
|
|
12218
|
+
current: ''
|
|
12219
|
+
} : _props$article$url;
|
|
12220
|
+
var url = _props$article$url.current,
|
|
12221
|
+
changeUrl = props.changeUrl,
|
|
12222
|
+
isCutomPage = props.isCutomPage,
|
|
12223
|
+
shareOptions = props.shareOptions,
|
|
12224
|
+
renderIsiContent = props.renderIsiContent,
|
|
12225
|
+
urlFor = props.urlFor;
|
|
12226
|
+
var shareVia = shareOptions.shareVia,
|
|
12227
|
+
shareSubject = shareOptions.shareSubject,
|
|
12228
|
+
twitterSiteName = shareOptions.twitterSiteName,
|
|
12229
|
+
shareImageDefault = shareOptions.shareImageDefault;
|
|
12230
|
+
|
|
12231
|
+
var shareUrl = shareOptions.shareBaseUrl + props.url;
|
|
12232
|
+
var shareTitle = title;
|
|
12233
|
+
var shareSummary = summary;
|
|
12234
|
+
var shareImage = thumbnail && thumbnail.asset ? urlFor(thumbnail.asset).url() : shareImageDefault;
|
|
12235
|
+
|
|
12236
|
+
var siteName = props.website.title;
|
|
12237
|
+
return React__default.createElement(
|
|
12238
|
+
InscreenSensor,
|
|
12239
|
+
{
|
|
12240
|
+
offSetTop: 45,
|
|
12241
|
+
onChange: function onChange(visible) {
|
|
12242
|
+
if (visible !== false) {
|
|
12243
|
+
changeUrl(url, visible);
|
|
12244
|
+
}
|
|
12245
|
+
} },
|
|
12246
|
+
React__default.createElement(
|
|
12247
|
+
'div',
|
|
12248
|
+
null,
|
|
12249
|
+
React__default.createElement(
|
|
12250
|
+
Head,
|
|
12251
|
+
null,
|
|
12252
|
+
passwordLock && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' })
|
|
12253
|
+
),
|
|
12254
|
+
React__default.createElement(
|
|
12255
|
+
'h1',
|
|
12256
|
+
{ className: 'page-title' },
|
|
12257
|
+
title
|
|
12258
|
+
),
|
|
12259
|
+
React__default.createElement(
|
|
12260
|
+
'div',
|
|
12261
|
+
{ className: 'video-detail', style: { marginBottom: isCutomPage(props.article) ? '150px' : 0 } },
|
|
12262
|
+
React__default.createElement(
|
|
12263
|
+
'div',
|
|
12264
|
+
null,
|
|
12265
|
+
visibilitySensor.moment(published).format('LL')
|
|
12266
|
+
),
|
|
12267
|
+
React__default.createElement(
|
|
12268
|
+
'div',
|
|
12269
|
+
{ className: 'mb-3' },
|
|
12270
|
+
authorDetails && authorDetails.map(function (authorDetail, index) {
|
|
12271
|
+
return React__default.createElement(
|
|
12272
|
+
'div',
|
|
12273
|
+
{ key: index },
|
|
12274
|
+
renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length)
|
|
12275
|
+
);
|
|
12276
|
+
})
|
|
12277
|
+
),
|
|
12278
|
+
React__default.createElement(
|
|
12279
|
+
'p',
|
|
12280
|
+
null,
|
|
12281
|
+
React__default.createElement(SocialShare$1, {
|
|
12282
|
+
shareUrl: shareUrl,
|
|
12283
|
+
shareTitle: shareTitle,
|
|
12284
|
+
shareVia: shareVia,
|
|
12285
|
+
shareSummary: shareSummary,
|
|
12286
|
+
shareSubject: shareSubject,
|
|
12287
|
+
shareImage: shareImage,
|
|
12288
|
+
size: 32,
|
|
12289
|
+
siteName: siteName,
|
|
12290
|
+
twitterSiteName: twitterSiteName
|
|
12291
|
+
})
|
|
12292
|
+
),
|
|
12293
|
+
React__default.createElement(
|
|
12294
|
+
'p',
|
|
12295
|
+
null,
|
|
12296
|
+
React__default.createElement(
|
|
12297
|
+
'em',
|
|
12298
|
+
null,
|
|
12299
|
+
summary
|
|
12300
|
+
),
|
|
12301
|
+
React__default.createElement('br', null),
|
|
12302
|
+
React__default.createElement('br', null)
|
|
12303
|
+
),
|
|
12304
|
+
React__default.createElement(
|
|
12305
|
+
'div',
|
|
12306
|
+
{ className: 'block-content' },
|
|
12307
|
+
React__default.createElement(TaxonomyCard.BlockContent, _babelHelpers._extends({
|
|
12308
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true),
|
|
12309
|
+
blocks: articleBody,
|
|
12310
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
12311
|
+
}, client.config()))
|
|
12312
|
+
)
|
|
12313
|
+
),
|
|
12314
|
+
renderIsiContent(props.article)
|
|
12315
|
+
)
|
|
12316
|
+
);
|
|
12317
|
+
};
|
|
12318
|
+
|
|
12319
|
+
var ArticleQueue = function (_React$Component) {
|
|
12320
|
+
_babelHelpers.inherits(ArticleQueue, _React$Component);
|
|
12321
|
+
|
|
12322
|
+
function ArticleQueue(props) {
|
|
12323
|
+
_babelHelpers.classCallCheck(this, ArticleQueue);
|
|
12324
|
+
|
|
12325
|
+
var _this = _babelHelpers.possibleConstructorReturn(this, (ArticleQueue.__proto__ || Object.getPrototypeOf(ArticleQueue)).call(this, props));
|
|
12326
|
+
|
|
12327
|
+
_initialiseProps.call(_this);
|
|
12328
|
+
|
|
12329
|
+
var _this$props$article$s = _this.props.article.seo;
|
|
12330
|
+
_this$props$article$s = _this$props$article$s === undefined ? {
|
|
12331
|
+
meta_description: null
|
|
12332
|
+
} : _this$props$article$s;
|
|
12333
|
+
var description = _this$props$article$s.meta_description;
|
|
12334
|
+
|
|
12335
|
+
var targeting = _this.getTargeting(_this.props.article);
|
|
12336
|
+
_this.state = {
|
|
12337
|
+
config: {
|
|
12338
|
+
navComponent: _this.props.website.navigation,
|
|
12339
|
+
navItems: _this.props.mainNavCache,
|
|
12340
|
+
columns: '3',
|
|
12341
|
+
leftItems: _this.props.subNavCache,
|
|
12342
|
+
rightItems: _this.props.Ads.getRightItems(targeting),
|
|
12343
|
+
horizontalAD: _this.props.Ads.getHorizontal(targeting),
|
|
12344
|
+
isLiveSite: _this.props.isLiveSite
|
|
12345
|
+
},
|
|
12346
|
+
title: _this.props.article.title,
|
|
12347
|
+
summary: description ? description : _this.props.article.summary,
|
|
12348
|
+
queueData: [_this.props.article],
|
|
12349
|
+
relatedArticles: [],
|
|
12350
|
+
keywords: []
|
|
12351
|
+
}, _this.preVscroll = 0;
|
|
12352
|
+
_this.isScrollDown = true;
|
|
12353
|
+
|
|
12354
|
+
return _this;
|
|
12355
|
+
}
|
|
12356
|
+
|
|
12357
|
+
_babelHelpers.createClass(ArticleQueue, [{
|
|
12358
|
+
key: 'componentDidMount',
|
|
12359
|
+
value: function componentDidMount() {
|
|
12360
|
+
window.addEventListener('scroll', this.scrollDirectionDetect);
|
|
12361
|
+
}
|
|
12362
|
+
}, {
|
|
12363
|
+
key: 'componentDidUpdate',
|
|
12364
|
+
value: function componentDidUpdate(prevProps) {
|
|
12365
|
+
if (prevProps.relatedArticles != this.props.relatedArticles) {
|
|
12366
|
+
var relatedArticles = this.props.relatedArticles;
|
|
12367
|
+
|
|
12368
|
+
var queueData = [].concat(_babelHelpers.toConsumableArray(this.state.queueData));
|
|
12369
|
+
if (prevProps.relatedArticles.length == 0) {
|
|
12370
|
+
queueData.push(relatedArticles.shift());
|
|
12371
|
+
this.setState({ queueData: queueData });
|
|
12372
|
+
}
|
|
12373
|
+
this.setState({ relatedArticles: relatedArticles });
|
|
12374
|
+
}
|
|
12375
|
+
}
|
|
12376
|
+
}, {
|
|
12377
|
+
key: 'componentWillUnmount',
|
|
12378
|
+
value: function componentWillUnmount() {
|
|
12379
|
+
window.removeEventListener('scroll', this.scrollDirectionDetect);
|
|
12380
|
+
}
|
|
12381
|
+
}, {
|
|
12382
|
+
key: 'render',
|
|
12383
|
+
value: function render() {
|
|
12384
|
+
var _this2 = this;
|
|
12385
|
+
|
|
12386
|
+
var _state = this.state,
|
|
12387
|
+
config = _state.config,
|
|
12388
|
+
_state$keywords = _state.keywords,
|
|
12389
|
+
keywords = _state$keywords === undefined ? [] : _state$keywords,
|
|
12390
|
+
queueData = _state.queueData,
|
|
12391
|
+
title = _state.title,
|
|
12392
|
+
summary = _state.summary;
|
|
12393
|
+
var _props = this.props,
|
|
12394
|
+
website = _props.website,
|
|
12395
|
+
shareOptions = _props.shareOptions;
|
|
12396
|
+
|
|
12397
|
+
|
|
12398
|
+
return React__default.createElement(
|
|
12399
|
+
TemplateNormal.TemplateNormal,
|
|
12400
|
+
{ config: config, website: website, keywords: keywords, description: summary, title: title, showRightAd: true },
|
|
12401
|
+
React__default.createElement(
|
|
12402
|
+
visibilitySensor.InfiniteScroll,
|
|
12403
|
+
{ dataLength: queueData.length, next: this.loadmore, scrollThreshold: '200px', hasMore: true },
|
|
12404
|
+
queueData.map(function (article, index) {
|
|
12405
|
+
return React__default.createElement(Article, _babelHelpers._extends({
|
|
12406
|
+
key: index,
|
|
12407
|
+
urlFor: _this2.urlFor,
|
|
12408
|
+
isCutomPage: _this2.isCutomPage,
|
|
12409
|
+
renderIsiContent: _this2.renderIsiContent
|
|
12410
|
+
}, _this2.props, {
|
|
12411
|
+
shareOptions: shareOptions,
|
|
12412
|
+
changeUrl: _this2.changeUrl,
|
|
12413
|
+
article: article
|
|
12414
|
+
}));
|
|
12415
|
+
})
|
|
12416
|
+
)
|
|
12417
|
+
);
|
|
12418
|
+
}
|
|
12419
|
+
}]);
|
|
12420
|
+
return ArticleQueue;
|
|
12421
|
+
}(React__default.Component);
|
|
12422
|
+
|
|
12423
|
+
var _initialiseProps = function _initialiseProps() {
|
|
12424
|
+
var _this3 = this;
|
|
12425
|
+
|
|
12426
|
+
this.scrollDirectionDetect = function (e) {
|
|
12427
|
+
var window = e.currentTarget;
|
|
12428
|
+
var isScrollDown = _this3.isScrollDown;
|
|
12429
|
+
|
|
12430
|
+
|
|
12431
|
+
if (_this3.preVscroll > window.scrollY) {
|
|
12432
|
+
if (!isScrollDown) {
|
|
12433
|
+
_this3.isScrollDown = true;
|
|
12434
|
+
}
|
|
12435
|
+
} else if (_this3.preVscroll < window.scrollY) {
|
|
12436
|
+
if (isScrollDown) {
|
|
12437
|
+
_this3.isScrollDown = false;
|
|
12438
|
+
}
|
|
12439
|
+
}
|
|
12440
|
+
_this3.preVscroll = window.scrollY;
|
|
12441
|
+
};
|
|
12442
|
+
|
|
12443
|
+
this.loadmore = function () {
|
|
12444
|
+
var queueData = [].concat(_babelHelpers.toConsumableArray(_this3.state.queueData));
|
|
12445
|
+
var relatedArticles = [].concat(_babelHelpers.toConsumableArray(_this3.state.relatedArticles));
|
|
12446
|
+
if (relatedArticles.length > 0) {
|
|
12447
|
+
queueData.push(relatedArticles.shift());
|
|
12448
|
+
_this3.setState({ queueData: queueData, relatedArticles: relatedArticles });
|
|
12449
|
+
}
|
|
12450
|
+
};
|
|
12451
|
+
|
|
12452
|
+
this.isCutomPage = function (article) {
|
|
12453
|
+
var url = article.url.current;
|
|
12454
|
+
var _props2 = _this3.props,
|
|
12455
|
+
regionalPages = _props2.regionalPages,
|
|
12456
|
+
nationalPage = _props2.nationalPage;
|
|
12457
|
+
|
|
12458
|
+
return regionalPages.includes(url) || nationalPage === url;
|
|
12459
|
+
};
|
|
12460
|
+
|
|
12461
|
+
this.urlFor = function (source) {
|
|
12462
|
+
return index$1.imageUrlBuilder(_this3.props.client).image(source);
|
|
12463
|
+
};
|
|
12464
|
+
|
|
12465
|
+
this.getTargeting = function (article) {
|
|
12466
|
+
var _article$internalTag = article.internalTag,
|
|
12467
|
+
internalTag = _article$internalTag === undefined ? [] : _article$internalTag,
|
|
12468
|
+
_article$userDefinedT = article.userDefinedTag,
|
|
12469
|
+
userDefinedTag = _article$userDefinedT === undefined ? [] : _article$userDefinedT,
|
|
12470
|
+
_article$SponsorshipT = article.SponsorshipTag,
|
|
12471
|
+
SponsorshipTag = _article$SponsorshipT === undefined ? [] : _article$SponsorshipT,
|
|
12472
|
+
_article$seoTag = article.seoTag,
|
|
12473
|
+
seoTag = _article$seoTag === undefined ? [] : _article$seoTag,
|
|
12474
|
+
_article$url = article.url;
|
|
12475
|
+
_article$url = _article$url === undefined ? {
|
|
12476
|
+
current: ''
|
|
12477
|
+
} : _article$url;
|
|
12478
|
+
var url = _article$url.current,
|
|
12479
|
+
_article$documentGrou = article.documentGroup;
|
|
12480
|
+
_article$documentGrou = _article$documentGrou === undefined ? {
|
|
12481
|
+
path: ''
|
|
12482
|
+
} : _article$documentGrou;
|
|
12483
|
+
var document_group = _article$documentGrou.path,
|
|
12484
|
+
content_placement = article.content_placement;
|
|
12485
|
+
|
|
12486
|
+
var context = url;
|
|
12487
|
+
var localHistory = _this3.props.historyCookie ? JSON.parse(_this3.props.historyCookie) : [];
|
|
12488
|
+
if (!context && localHistory) {
|
|
12489
|
+
context = localHistory[localHistory.length - 1];
|
|
12490
|
+
}
|
|
12491
|
+
context = context && context.split('?')[0];
|
|
12492
|
+
context = context && context.split('&')[0];
|
|
12493
|
+
var content_placement_urls = [];
|
|
12494
|
+
if (content_placement) {
|
|
12495
|
+
if (content_placement.some(function (item) {
|
|
12496
|
+
return context === item.path;
|
|
12497
|
+
})) {
|
|
12498
|
+
content_placement_urls = [context];
|
|
12499
|
+
} else if (content_placement.some(function (item) {
|
|
12500
|
+
return context === '/' + item.path;
|
|
12501
|
+
})) {
|
|
12502
|
+
content_placement_urls = [context.slice(1)];
|
|
12503
|
+
} else {
|
|
12504
|
+
content_placement_urls = content_placement.map(function (item) {
|
|
12505
|
+
return item.path;
|
|
12506
|
+
});
|
|
12507
|
+
}
|
|
12508
|
+
}
|
|
12509
|
+
if (document_group.length > 0) {
|
|
12510
|
+
content_placement_urls = [];
|
|
12511
|
+
}
|
|
12512
|
+
var keywords = [].concat(_babelHelpers.toConsumableArray(internalTag), _babelHelpers.toConsumableArray(userDefinedTag), _babelHelpers.toConsumableArray(SponsorshipTag), _babelHelpers.toConsumableArray(seoTag));
|
|
12513
|
+
var targeting = {
|
|
12514
|
+
tags: keywords,
|
|
12515
|
+
document_group: [document_group],
|
|
12516
|
+
document_url: [url],
|
|
12517
|
+
content_placement: content_placement_urls
|
|
12518
|
+
};
|
|
12519
|
+
return targeting;
|
|
12520
|
+
};
|
|
12521
|
+
|
|
12522
|
+
this.checkSponseredArticle = function (article) {
|
|
12523
|
+
var _article$taxonomyMapp = article.taxonomyMapping,
|
|
12524
|
+
taxonomyMapping = _article$taxonomyMapp === undefined ? [] : _article$taxonomyMapp;
|
|
12525
|
+
|
|
12526
|
+
if (_this3.props.checkSponsered) {
|
|
12527
|
+
|
|
12528
|
+
return taxonomyMapping.some(function (item) {
|
|
12529
|
+
return item._ref === 'ict_taxonomy_735_sponsoredresources';
|
|
12530
|
+
});
|
|
12531
|
+
} else {
|
|
12532
|
+
return false;
|
|
12533
|
+
}
|
|
12534
|
+
};
|
|
12535
|
+
|
|
12536
|
+
this.renderIsiContent = function (article) {
|
|
12537
|
+
var url = article.url.current;
|
|
12538
|
+
var _props3 = _this3.props,
|
|
12539
|
+
ISIContent = _props3.iSIContent,
|
|
12540
|
+
regionalPages = _props3.regionalPages,
|
|
12541
|
+
nationalPage = _props3.nationalPage;
|
|
12542
|
+
|
|
12543
|
+
if (regionalPages.includes(url)) {
|
|
12544
|
+
return React__default.createElement(ISIContent, null);
|
|
12545
|
+
} else if (nationalPage === url) {
|
|
12546
|
+
return React__default.createElement(ISIContent, { national: true });
|
|
12547
|
+
}
|
|
12548
|
+
return null;
|
|
12549
|
+
};
|
|
12550
|
+
|
|
12551
|
+
this.refreshAdd = function (path) {
|
|
12552
|
+
var article = _this3.state.queueData.find(function (item) {
|
|
12553
|
+
return item.url.current == path;
|
|
12554
|
+
});
|
|
12555
|
+
var title = article.title,
|
|
12556
|
+
summary = article.summary,
|
|
12557
|
+
_article$seo = article.seo;
|
|
12558
|
+
_article$seo = _article$seo === undefined ? {
|
|
12559
|
+
meta_description: null
|
|
12560
|
+
} : _article$seo;
|
|
12561
|
+
var description = _article$seo.meta_description;
|
|
12562
|
+
|
|
12563
|
+
var config = _babelHelpers._extends({}, _this3.state.config);
|
|
12564
|
+
var targeting = _this3.getTargeting(article);
|
|
12565
|
+
var rightItems = [];
|
|
12566
|
+
|
|
12567
|
+
if (_this3.checkSponseredArticle(article)) {
|
|
12568
|
+
rightItems = [];
|
|
12569
|
+
} else {
|
|
12570
|
+
rightItems = _this3.props.Ads.getRightItems(targeting);
|
|
12571
|
+
}
|
|
12572
|
+
var horizontalAD = _this3.props.Ads.getHorizontal(targeting);
|
|
12573
|
+
config.rightItems = rightItems;
|
|
12574
|
+
config.horizontalAD = horizontalAD;
|
|
12575
|
+
_this3.setState({ config: config, title: title, summary: description ? description : summary }, function () {
|
|
12576
|
+
index.lib_3.refresh();
|
|
12577
|
+
});
|
|
12578
|
+
};
|
|
12579
|
+
|
|
12580
|
+
this.changeUrl = function (path, visibility) {
|
|
12581
|
+
var isScrollDown = _this3.isScrollDown;
|
|
12582
|
+
|
|
12583
|
+
if (!isScrollDown) {
|
|
12584
|
+
if (visibility == 'top') {
|
|
12585
|
+
window.history.pushState({ page: path }, path, '/view/' + path);
|
|
12586
|
+
_this3.setState({ keywords: [1] });
|
|
12587
|
+
_this3.refreshAdd(path);
|
|
12588
|
+
// Router.push('/view/[url]', `/view/${path}`, {shallow:true})
|
|
12589
|
+
}
|
|
12590
|
+
} else {
|
|
12591
|
+
if (visibility == 'bottom') {
|
|
12592
|
+
window.history.pushState({ page: path }, path, '/view/' + path);
|
|
12593
|
+
_this3.setState({ keywords: [1] });
|
|
12594
|
+
_this3.refreshAdd(path);
|
|
12595
|
+
// Router.push('/view/[url]', `/view/${path}`, {shallow:true})
|
|
12596
|
+
}
|
|
12597
|
+
}
|
|
12598
|
+
};
|
|
12599
|
+
};
|
|
12600
|
+
|
|
12110
12601
|
exports.DeckContent = DeckContent;
|
|
12111
12602
|
exports.AD = GridContent.AD;
|
|
12112
12603
|
exports.GridContent = GridContent.GridContent;
|
|
@@ -12145,6 +12636,7 @@ exports.AccordionPanel = AccordionPanel;
|
|
|
12145
12636
|
exports.AdSlotsProvider = AdSlotsProvider;
|
|
12146
12637
|
exports.AlphabeticList = AlphabeticList;
|
|
12147
12638
|
exports.ArticleDetailDropdown = ArticleDetailDropdown;
|
|
12639
|
+
exports.ArticleQueue = ArticleQueue;
|
|
12148
12640
|
exports.Breadcrumbs = Breadcrumbs$1;
|
|
12149
12641
|
exports.ConferenceArticleCard = ConferenceArticleCard;
|
|
12150
12642
|
exports.Feature = Feature;
|
|
@@ -172,9 +172,12 @@ var VideoSeriesListing = function (_React$Component) {
|
|
|
172
172
|
'div',
|
|
173
173
|
null,
|
|
174
174
|
seriesData && seriesData.map(function (docSeries, index) {
|
|
175
|
-
docSeries.body[0].videos
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
if (docSeries.body.length > 0 && docSeries.body[0].videos) {
|
|
176
|
+
docSeries.body[0].videos.map(function (singleVideo, indexInner) {
|
|
177
|
+
singleVideo.link = '/view/' + docSeries.url.current + '?seriesVid=' + (indexInner + 1);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
178
181
|
return React__default.createElement(
|
|
179
182
|
'div',
|
|
180
183
|
{ key: index, counter: itemCounter++ },
|
|
@@ -192,7 +195,11 @@ var VideoSeriesListing = function (_React$Component) {
|
|
|
192
195
|
)
|
|
193
196
|
)
|
|
194
197
|
),
|
|
195
|
-
React__default.createElement(YoutubeGroup, _extends({ key: index, dataset: docSeries.body[0].videos }, _this.props))
|
|
198
|
+
docSeries.body.length > 0 && docSeries.body[0].videos ? React__default.createElement(YoutubeGroup, _extends({ key: index, dataset: docSeries.body[0].videos }, _this.props)) : React__default.createElement(
|
|
199
|
+
'p',
|
|
200
|
+
null,
|
|
201
|
+
'No Video Found.'
|
|
202
|
+
)
|
|
196
203
|
);
|
|
197
204
|
})
|
|
198
205
|
);
|
package/dist/esm/index.js
CHANGED
|
@@ -6,8 +6,8 @@ import 'react-bootstrap/Container';
|
|
|
6
6
|
import 'react-bootstrap/Row';
|
|
7
7
|
import 'react-bootstrap/Col';
|
|
8
8
|
import 'react-bootstrap/Card';
|
|
9
|
-
import { m as moment } from './visibility-sensor-675d3fa1.js';
|
|
10
|
-
import 'next/link';
|
|
9
|
+
import { m as moment, I as InfiniteScroll } from './visibility-sensor-675d3fa1.js';
|
|
10
|
+
import Link from 'next/link';
|
|
11
11
|
import Router, { useRouter } from 'next/router';
|
|
12
12
|
import './debounce-dc0c02e5.js';
|
|
13
13
|
import 'react-dom';
|
|
@@ -15,7 +15,7 @@ import { i as imageUrlBuilder } from './index-ca4ff5cb.js';
|
|
|
15
15
|
import './index-3c1ee9ab.js';
|
|
16
16
|
import { m as main_35, a as main_36 } from './main-dea495b7.js';
|
|
17
17
|
import { h as html_decode_1, c as clean_html_1 } from './entities-e85d3a4a.js';
|
|
18
|
-
import { s as slicedToArray, _ as _extends$2, t as toConsumableArray } from './_babelHelpers-67c05996.js';
|
|
18
|
+
import { s as slicedToArray, _ as _extends$2, t as toConsumableArray, i as inherits$2, c as createClass, a as classCallCheck, p as possibleConstructorReturn } from './_babelHelpers-67c05996.js';
|
|
19
19
|
export { default as DeckContent } from './DeckContent.js';
|
|
20
20
|
import './get-b074314b.js';
|
|
21
21
|
import { A as AD } from './GridContent-214acb61.js';
|
|
@@ -39,7 +39,7 @@ export { default as PublicationDeck } from './PublicationDeck.js';
|
|
|
39
39
|
export { default as IssueDeck } from './IssueDeck.js';
|
|
40
40
|
import 'react-bootstrap/Badge';
|
|
41
41
|
export { default as IssueContentDeck } from './IssueContentDeck.js';
|
|
42
|
-
import { D as DFPAdSlot, M as MdPictureAsPdf } from './Normal-be430fa9.js';
|
|
42
|
+
import { D as DFPAdSlot, M as MdPictureAsPdf, T as TemplateNormal } from './Normal-be430fa9.js';
|
|
43
43
|
export { A as AD728x90, D as AdSlot, C as Column1, a as Column2, b as Column3, f as HamMagazine, H as Header, L as LeftNav, e as NavDvm, c as NavMagazine, N as NavNative, d as NavNormal, P as PageFilter, S as Search, g as SideFooter, T as TemplateNormal } from './Normal-be430fa9.js';
|
|
44
44
|
import 'react-bootstrap/ListGroup';
|
|
45
45
|
import Head from 'next/head';
|
|
@@ -10401,16 +10401,11 @@ var Leads = function Leads(_ref) {
|
|
|
10401
10401
|
);
|
|
10402
10402
|
};
|
|
10403
10403
|
|
|
10404
|
-
var urlFor$2 = function urlFor(source,
|
|
10404
|
+
var urlFor$2 = function urlFor(source, client) {
|
|
10405
|
+
var builder = imageUrlBuilder(client);
|
|
10405
10406
|
return builder.image(source);
|
|
10406
10407
|
};
|
|
10407
10408
|
|
|
10408
|
-
var onChangeSlide$1 = function onChangeSlide(selectedIndex, router) {
|
|
10409
|
-
var pageNumber = selectedIndex + 1;
|
|
10410
|
-
var href = '/view/' + router.query.url + '/?page=' + pageNumber;
|
|
10411
|
-
Router.push(router.pathname, pageNumber > 1 ? href : '/view/' + router.query.url, { shallow: true });
|
|
10412
|
-
};
|
|
10413
|
-
|
|
10414
10409
|
var Slideshow$1 = function Slideshow(_ref) {
|
|
10415
10410
|
var slides = _ref.node.slides,
|
|
10416
10411
|
client = _ref.client,
|
|
@@ -10418,37 +10413,40 @@ var Slideshow$1 = function Slideshow(_ref) {
|
|
|
10418
10413
|
getSerializers = _ref.getSerializers;
|
|
10419
10414
|
|
|
10420
10415
|
var router = useRouter();
|
|
10416
|
+
var pageNumber = router && router.asPath && router.asPath.split('?page=')[1];
|
|
10421
10417
|
|
|
10422
|
-
var _useState = useState(0),
|
|
10418
|
+
var _useState = useState(!pageNumber || isNaN(pageNumber) || pageNumber > slides.length ? 0 : pageNumber - 1),
|
|
10423
10419
|
_useState2 = slicedToArray(_useState, 2),
|
|
10424
10420
|
carouselIndex = _useState2[0],
|
|
10425
10421
|
setCarouselIndex = _useState2[1];
|
|
10426
10422
|
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
}
|
|
10437
|
-
}, [router]);
|
|
10423
|
+
// useEffect(() => {
|
|
10424
|
+
// let itemArr = router.asPath.split('?page=')
|
|
10425
|
+
// let pageNumber = parseInt(itemArr[1])
|
|
10426
|
+
// if (!pageNumber || isNaN(pageNumber) || pageNumber > slides.length) {
|
|
10427
|
+
// setCarouselIndex(0)
|
|
10428
|
+
// } else {
|
|
10429
|
+
// setCarouselIndex(parseInt(itemArr[1]) - 1)
|
|
10430
|
+
// }
|
|
10431
|
+
// }, [router])
|
|
10438
10432
|
|
|
10439
10433
|
useEffect(function () {
|
|
10440
10434
|
lib_3.refresh();
|
|
10441
|
-
if (pageview) pageview(router.asPath)
|
|
10435
|
+
// if (pageview) pageview(router.asPath)
|
|
10442
10436
|
}, [router]);
|
|
10443
10437
|
|
|
10438
|
+
var onChangeSlide = function onChangeSlide(selectedIndex) {
|
|
10439
|
+
var pageNumber = selectedIndex + 1;
|
|
10440
|
+
var href = '/view/' + router.query.url + '/?page=' + pageNumber;
|
|
10441
|
+
router.push(router.pathname, pageNumber > 1 ? href : '/view/' + router.query.url, { shallow: true });
|
|
10442
|
+
};
|
|
10443
|
+
|
|
10444
10444
|
return React__default.createElement(
|
|
10445
10445
|
'div',
|
|
10446
10446
|
{ className: 'mt-3 mb-3' },
|
|
10447
10447
|
React__default.createElement(
|
|
10448
10448
|
Carousel,
|
|
10449
|
-
{ activeIndex: carouselIndex, onSelect:
|
|
10450
|
-
return onChangeSlide$1(selectedIndex, router);
|
|
10451
|
-
} },
|
|
10449
|
+
{ activeIndex: carouselIndex, onSelect: onChangeSlide },
|
|
10452
10450
|
slides && slides.map(function (slide) {
|
|
10453
10451
|
if (slide.slideshowImage && slide.slideshowImage.asset) {
|
|
10454
10452
|
return React__default.createElement(
|
|
@@ -10457,7 +10455,7 @@ var Slideshow$1 = function Slideshow(_ref) {
|
|
|
10457
10455
|
React__default.createElement(
|
|
10458
10456
|
'a',
|
|
10459
10457
|
{ href: slide.slideshowImage.link && slide.slideshowImage.link, target: slide.slideshowImage.blank ? '_blank' : '_self' },
|
|
10460
|
-
React__default.createElement('img', { src: urlFor$2(slide.slideshowImage,
|
|
10458
|
+
React__default.createElement('img', { src: urlFor$2(slide.slideshowImage, client).url(), alt: slide.slideshowImage.alt || 'slideshow image', style: { width: '100%' } })
|
|
10461
10459
|
),
|
|
10462
10460
|
React__default.createElement(
|
|
10463
10461
|
'div',
|
|
@@ -11616,7 +11614,7 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
|
|
|
11616
11614
|
),
|
|
11617
11615
|
React__default.createElement(
|
|
11618
11616
|
'p',
|
|
11619
|
-
|
|
11617
|
+
{ className: 'top-article-summary' },
|
|
11620
11618
|
clean_html_1(topArticle.summary)
|
|
11621
11619
|
)
|
|
11622
11620
|
)
|
|
@@ -11761,7 +11759,7 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
|
|
|
11761
11759
|
React__default.createElement(
|
|
11762
11760
|
'style',
|
|
11763
11761
|
{ jsx: 'true' },
|
|
11764
|
-
'\n .article-hero-container {\n margin: 0 -0.8rem;\n }\n @media screen and (min-width: 1400px) {\n .article-hero-container {\n display: flex;\n flex-direction: row;\n }\n }\n .top-article {\n // width: 50%;\n margin: 0 1rem;\n height: 100%;\n display: block;\n }\n .top-article figure {\n width: 100%;\n height: 60%;\n }\n .top-article figure img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n .top-article--body h1 {\n font-size: 1.4rem;\n color: black !important;\n font-weight: bold;\n }\n // .sub-articles-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n .sub-article {\n margin: 0 1rem 1rem;\n display: flex;\n flex-direction: row;\n }\n .sub-article figure {\n width: 125px;\n }\n .sub-article figure img {\n width: 125px;\n height: auto;\n object-fit: cover;\n }\n .sub-article--body {\n padding-left: 1rem;\n font-size: 0.9rem;\n }\n .sub-article--body h2 {\n font-size: 1rem;\n font-weight: bold;\n }\n @media screen and (max-width: 1368px) {\n .article-hero-container {\n flex-direction: column;\n }\n .top-article {\n // width: unset;\n flex: 1 1 auto;\n }\n .sub-articles-container {\n width: 100%;\n margin-top: 1rem;\n min-width: 280px;\n }\n }\n @media screen and (max-width: 1399px) and (min-width: 992px) {\n .top-article {\n // width: 50%;\n flex: 1 1 auto;\n margin-bottom: 1rem;\n }\n .middle-group {\n display: none;\n }\n .middle-single {\n display: block !important;\n margin-top: 0 !important;\n }\n .top-article figure img {\n max-height: 180px !important;\n }\n }\n // @media only screen and (min-width) {\n // .sub-outer-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n // }\n .middle-single {\n display: none;\n }\n .top-outer {\n display: flex;\n }\n '
|
|
11762
|
+
'\n .article-hero-container {\n margin: 0 -0.8rem;\n }\n @media screen and (min-width: 1400px) {\n .article-hero-container {\n display: flex;\n flex-direction: row;\n }\n }\n .top-article {\n // width: 50%;\n margin: 0 1rem;\n height: 100%;\n display: block;\n }\n .top-article figure {\n width: 100%;\n height: 60%;\n }\n .top-article figure img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n .top-article--body h1 {\n font-size: 1.4rem;\n color: black !important;\n font-weight: bold;\n }\n // .sub-articles-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n .sub-article {\n margin: 0 1rem 1rem;\n display: flex;\n flex-direction: row;\n }\n .sub-article figure {\n width: 125px;\n }\n .sub-article figure img {\n width: 125px;\n height: auto;\n object-fit: cover;\n }\n .sub-article--body {\n padding-left: 1rem;\n font-size: 0.9rem;\n }\n .sub-article--body h2 {\n font-size: 1rem;\n font-weight: bold;\n }\n @media screen and (max-width: 1368px) {\n .article-hero-container {\n flex-direction: column;\n }\n .top-article {\n // width: unset;\n flex: 1 1 auto;\n }\n .sub-articles-container {\n width: 100%;\n margin-top: 1rem;\n min-width: 280px;\n }\n }\n @media screen and (max-width: 1399px) and (min-width: 992px) {\n .top-article {\n // width: 50%;\n flex: 1 1 auto;\n margin-bottom: 1rem;\n }\n .middle-group {\n display: none;\n }\n .middle-single {\n display: block !important;\n margin-top: 0 !important;\n }\n .top-article figure img {\n max-height: 180px !important;\n }\n .top-article-summary {\n display: none;\n }\n }\n // @media only screen and (min-width) {\n // .sub-outer-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n // }\n .middle-single {\n display: none;\n }\n .top-outer {\n display: flex;\n }\n '
|
|
11765
11763
|
)
|
|
11766
11764
|
);
|
|
11767
11765
|
};
|
|
@@ -12105,4 +12103,497 @@ var ConferenceArticleCard = function ConferenceArticleCard(props) {
|
|
|
12105
12103
|
);
|
|
12106
12104
|
};
|
|
12107
12105
|
|
|
12108
|
-
|
|
12106
|
+
var InscreenSensor = function (_React$Component) {
|
|
12107
|
+
inherits$2(InscreenSensor, _React$Component);
|
|
12108
|
+
|
|
12109
|
+
function InscreenSensor(props) {
|
|
12110
|
+
classCallCheck(this, InscreenSensor);
|
|
12111
|
+
|
|
12112
|
+
var _this = possibleConstructorReturn(this, (InscreenSensor.__proto__ || Object.getPrototypeOf(InscreenSensor)).call(this, props));
|
|
12113
|
+
|
|
12114
|
+
_this.scrollHandler = function () {
|
|
12115
|
+
// this.checkInside()
|
|
12116
|
+
|
|
12117
|
+
var visible = _this.checkInside();
|
|
12118
|
+
if (visible != _this.visible) {
|
|
12119
|
+
_this.visible = visible;
|
|
12120
|
+
_this.props.onChange(visible);
|
|
12121
|
+
}
|
|
12122
|
+
};
|
|
12123
|
+
|
|
12124
|
+
_this.checkInside = function () {
|
|
12125
|
+
var rect = _this.wraperRef.current.getBoundingClientRect();
|
|
12126
|
+
var _this$props$offSetTop = _this.props.offSetTop,
|
|
12127
|
+
offSetTop = _this$props$offSetTop === undefined ? 0 : _this$props$offSetTop;
|
|
12128
|
+
var top = rect.top,
|
|
12129
|
+
height = rect.height;
|
|
12130
|
+
|
|
12131
|
+
var bottom = top + height;
|
|
12132
|
+
var viewHeight = window.innerHeight;
|
|
12133
|
+
if (bottom < offSetTop) {
|
|
12134
|
+
return false;
|
|
12135
|
+
} else if (top > offSetTop && bottom <= viewHeight) {
|
|
12136
|
+
return true;
|
|
12137
|
+
} else if (top > offSetTop && top <= viewHeight && bottom > viewHeight) {
|
|
12138
|
+
return 'top';
|
|
12139
|
+
} else if (bottom <= viewHeight) {
|
|
12140
|
+
return 'bottom';
|
|
12141
|
+
} else {
|
|
12142
|
+
return false;
|
|
12143
|
+
}
|
|
12144
|
+
};
|
|
12145
|
+
|
|
12146
|
+
_this.wraperRef = React__default.createRef();
|
|
12147
|
+
_this.visible = false;
|
|
12148
|
+
return _this;
|
|
12149
|
+
}
|
|
12150
|
+
|
|
12151
|
+
createClass(InscreenSensor, [{
|
|
12152
|
+
key: 'componentDidMount',
|
|
12153
|
+
value: function componentDidMount() {
|
|
12154
|
+
this.visible = this.checkInside();
|
|
12155
|
+
this.props.onChange(this.visible);
|
|
12156
|
+
window.addEventListener('scroll', this.scrollHandler);
|
|
12157
|
+
}
|
|
12158
|
+
}, {
|
|
12159
|
+
key: 'componentWillUnmount',
|
|
12160
|
+
value: function componentWillUnmount() {
|
|
12161
|
+
window.removeEventListener('scroll', this.scrollHandler);
|
|
12162
|
+
}
|
|
12163
|
+
}, {
|
|
12164
|
+
key: 'render',
|
|
12165
|
+
value: function render() {
|
|
12166
|
+
var _props = this.props,
|
|
12167
|
+
_props$className = _props.className,
|
|
12168
|
+
className = _props$className === undefined ? '' : _props$className,
|
|
12169
|
+
_props$style = _props.style,
|
|
12170
|
+
style = _props$style === undefined ? {} : _props$style;
|
|
12171
|
+
|
|
12172
|
+
return React__default.createElement(
|
|
12173
|
+
'div',
|
|
12174
|
+
{ ref: this.wraperRef, className: className, style: style },
|
|
12175
|
+
this.props.children
|
|
12176
|
+
);
|
|
12177
|
+
}
|
|
12178
|
+
}]);
|
|
12179
|
+
return InscreenSensor;
|
|
12180
|
+
}(React__default.Component);
|
|
12181
|
+
|
|
12182
|
+
var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
12183
|
+
if (authorName && authorURL) return React__default.createElement(
|
|
12184
|
+
Link,
|
|
12185
|
+
{ href: '/authors/' + authorURL.current, key: index },
|
|
12186
|
+
React__default.createElement(
|
|
12187
|
+
'a',
|
|
12188
|
+
null,
|
|
12189
|
+
authorName,
|
|
12190
|
+
length !== index + 1 && React__default.createElement('br', null)
|
|
12191
|
+
)
|
|
12192
|
+
);else if (authorName) {
|
|
12193
|
+
return React__default.createElement(
|
|
12194
|
+
'span',
|
|
12195
|
+
{ key: index },
|
|
12196
|
+
authorName,
|
|
12197
|
+
length !== index + 1 && React__default.createElement('br', null)
|
|
12198
|
+
);
|
|
12199
|
+
}
|
|
12200
|
+
};
|
|
12201
|
+
|
|
12202
|
+
var Article = function Article(props) {
|
|
12203
|
+
var client = props.client,
|
|
12204
|
+
pageview = props.pageview,
|
|
12205
|
+
videoAccountIDs = props.videoAccountIDs,
|
|
12206
|
+
_props$article = props.article,
|
|
12207
|
+
title = _props$article.title,
|
|
12208
|
+
passwordLock = _props$article.passwordLock,
|
|
12209
|
+
authorDetails = _props$article.authorDetails,
|
|
12210
|
+
published = _props$article.published,
|
|
12211
|
+
articleBody = _props$article.body,
|
|
12212
|
+
summary = _props$article.summary,
|
|
12213
|
+
thumbnail = _props$article.thumbnail,
|
|
12214
|
+
_props$article$url = _props$article.url;
|
|
12215
|
+
_props$article$url = _props$article$url === undefined ? {
|
|
12216
|
+
current: ''
|
|
12217
|
+
} : _props$article$url;
|
|
12218
|
+
var url = _props$article$url.current,
|
|
12219
|
+
changeUrl = props.changeUrl,
|
|
12220
|
+
isCutomPage = props.isCutomPage,
|
|
12221
|
+
shareOptions = props.shareOptions,
|
|
12222
|
+
renderIsiContent = props.renderIsiContent,
|
|
12223
|
+
urlFor = props.urlFor;
|
|
12224
|
+
var shareVia = shareOptions.shareVia,
|
|
12225
|
+
shareSubject = shareOptions.shareSubject,
|
|
12226
|
+
twitterSiteName = shareOptions.twitterSiteName,
|
|
12227
|
+
shareImageDefault = shareOptions.shareImageDefault;
|
|
12228
|
+
|
|
12229
|
+
var shareUrl = shareOptions.shareBaseUrl + props.url;
|
|
12230
|
+
var shareTitle = title;
|
|
12231
|
+
var shareSummary = summary;
|
|
12232
|
+
var shareImage = thumbnail && thumbnail.asset ? urlFor(thumbnail.asset).url() : shareImageDefault;
|
|
12233
|
+
|
|
12234
|
+
var siteName = props.website.title;
|
|
12235
|
+
return React__default.createElement(
|
|
12236
|
+
InscreenSensor,
|
|
12237
|
+
{
|
|
12238
|
+
offSetTop: 45,
|
|
12239
|
+
onChange: function onChange(visible) {
|
|
12240
|
+
if (visible !== false) {
|
|
12241
|
+
changeUrl(url, visible);
|
|
12242
|
+
}
|
|
12243
|
+
} },
|
|
12244
|
+
React__default.createElement(
|
|
12245
|
+
'div',
|
|
12246
|
+
null,
|
|
12247
|
+
React__default.createElement(
|
|
12248
|
+
Head,
|
|
12249
|
+
null,
|
|
12250
|
+
passwordLock && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' })
|
|
12251
|
+
),
|
|
12252
|
+
React__default.createElement(
|
|
12253
|
+
'h1',
|
|
12254
|
+
{ className: 'page-title' },
|
|
12255
|
+
title
|
|
12256
|
+
),
|
|
12257
|
+
React__default.createElement(
|
|
12258
|
+
'div',
|
|
12259
|
+
{ className: 'video-detail', style: { marginBottom: isCutomPage(props.article) ? '150px' : 0 } },
|
|
12260
|
+
React__default.createElement(
|
|
12261
|
+
'div',
|
|
12262
|
+
null,
|
|
12263
|
+
moment(published).format('LL')
|
|
12264
|
+
),
|
|
12265
|
+
React__default.createElement(
|
|
12266
|
+
'div',
|
|
12267
|
+
{ className: 'mb-3' },
|
|
12268
|
+
authorDetails && authorDetails.map(function (authorDetail, index) {
|
|
12269
|
+
return React__default.createElement(
|
|
12270
|
+
'div',
|
|
12271
|
+
{ key: index },
|
|
12272
|
+
renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length)
|
|
12273
|
+
);
|
|
12274
|
+
})
|
|
12275
|
+
),
|
|
12276
|
+
React__default.createElement(
|
|
12277
|
+
'p',
|
|
12278
|
+
null,
|
|
12279
|
+
React__default.createElement(SocialShare$1, {
|
|
12280
|
+
shareUrl: shareUrl,
|
|
12281
|
+
shareTitle: shareTitle,
|
|
12282
|
+
shareVia: shareVia,
|
|
12283
|
+
shareSummary: shareSummary,
|
|
12284
|
+
shareSubject: shareSubject,
|
|
12285
|
+
shareImage: shareImage,
|
|
12286
|
+
size: 32,
|
|
12287
|
+
siteName: siteName,
|
|
12288
|
+
twitterSiteName: twitterSiteName
|
|
12289
|
+
})
|
|
12290
|
+
),
|
|
12291
|
+
React__default.createElement(
|
|
12292
|
+
'p',
|
|
12293
|
+
null,
|
|
12294
|
+
React__default.createElement(
|
|
12295
|
+
'em',
|
|
12296
|
+
null,
|
|
12297
|
+
summary
|
|
12298
|
+
),
|
|
12299
|
+
React__default.createElement('br', null),
|
|
12300
|
+
React__default.createElement('br', null)
|
|
12301
|
+
),
|
|
12302
|
+
React__default.createElement(
|
|
12303
|
+
'div',
|
|
12304
|
+
{ className: 'block-content' },
|
|
12305
|
+
React__default.createElement(BlockContent, _extends$2({
|
|
12306
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true),
|
|
12307
|
+
blocks: articleBody,
|
|
12308
|
+
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
12309
|
+
}, client.config()))
|
|
12310
|
+
)
|
|
12311
|
+
),
|
|
12312
|
+
renderIsiContent(props.article)
|
|
12313
|
+
)
|
|
12314
|
+
);
|
|
12315
|
+
};
|
|
12316
|
+
|
|
12317
|
+
var ArticleQueue = function (_React$Component) {
|
|
12318
|
+
inherits$2(ArticleQueue, _React$Component);
|
|
12319
|
+
|
|
12320
|
+
function ArticleQueue(props) {
|
|
12321
|
+
classCallCheck(this, ArticleQueue);
|
|
12322
|
+
|
|
12323
|
+
var _this = possibleConstructorReturn(this, (ArticleQueue.__proto__ || Object.getPrototypeOf(ArticleQueue)).call(this, props));
|
|
12324
|
+
|
|
12325
|
+
_initialiseProps.call(_this);
|
|
12326
|
+
|
|
12327
|
+
var _this$props$article$s = _this.props.article.seo;
|
|
12328
|
+
_this$props$article$s = _this$props$article$s === undefined ? {
|
|
12329
|
+
meta_description: null
|
|
12330
|
+
} : _this$props$article$s;
|
|
12331
|
+
var description = _this$props$article$s.meta_description;
|
|
12332
|
+
|
|
12333
|
+
var targeting = _this.getTargeting(_this.props.article);
|
|
12334
|
+
_this.state = {
|
|
12335
|
+
config: {
|
|
12336
|
+
navComponent: _this.props.website.navigation,
|
|
12337
|
+
navItems: _this.props.mainNavCache,
|
|
12338
|
+
columns: '3',
|
|
12339
|
+
leftItems: _this.props.subNavCache,
|
|
12340
|
+
rightItems: _this.props.Ads.getRightItems(targeting),
|
|
12341
|
+
horizontalAD: _this.props.Ads.getHorizontal(targeting),
|
|
12342
|
+
isLiveSite: _this.props.isLiveSite
|
|
12343
|
+
},
|
|
12344
|
+
title: _this.props.article.title,
|
|
12345
|
+
summary: description ? description : _this.props.article.summary,
|
|
12346
|
+
queueData: [_this.props.article],
|
|
12347
|
+
relatedArticles: [],
|
|
12348
|
+
keywords: []
|
|
12349
|
+
}, _this.preVscroll = 0;
|
|
12350
|
+
_this.isScrollDown = true;
|
|
12351
|
+
|
|
12352
|
+
return _this;
|
|
12353
|
+
}
|
|
12354
|
+
|
|
12355
|
+
createClass(ArticleQueue, [{
|
|
12356
|
+
key: 'componentDidMount',
|
|
12357
|
+
value: function componentDidMount() {
|
|
12358
|
+
window.addEventListener('scroll', this.scrollDirectionDetect);
|
|
12359
|
+
}
|
|
12360
|
+
}, {
|
|
12361
|
+
key: 'componentDidUpdate',
|
|
12362
|
+
value: function componentDidUpdate(prevProps) {
|
|
12363
|
+
if (prevProps.relatedArticles != this.props.relatedArticles) {
|
|
12364
|
+
var relatedArticles = this.props.relatedArticles;
|
|
12365
|
+
|
|
12366
|
+
var queueData = [].concat(toConsumableArray(this.state.queueData));
|
|
12367
|
+
if (prevProps.relatedArticles.length == 0) {
|
|
12368
|
+
queueData.push(relatedArticles.shift());
|
|
12369
|
+
this.setState({ queueData: queueData });
|
|
12370
|
+
}
|
|
12371
|
+
this.setState({ relatedArticles: relatedArticles });
|
|
12372
|
+
}
|
|
12373
|
+
}
|
|
12374
|
+
}, {
|
|
12375
|
+
key: 'componentWillUnmount',
|
|
12376
|
+
value: function componentWillUnmount() {
|
|
12377
|
+
window.removeEventListener('scroll', this.scrollDirectionDetect);
|
|
12378
|
+
}
|
|
12379
|
+
}, {
|
|
12380
|
+
key: 'render',
|
|
12381
|
+
value: function render() {
|
|
12382
|
+
var _this2 = this;
|
|
12383
|
+
|
|
12384
|
+
var _state = this.state,
|
|
12385
|
+
config = _state.config,
|
|
12386
|
+
_state$keywords = _state.keywords,
|
|
12387
|
+
keywords = _state$keywords === undefined ? [] : _state$keywords,
|
|
12388
|
+
queueData = _state.queueData,
|
|
12389
|
+
title = _state.title,
|
|
12390
|
+
summary = _state.summary;
|
|
12391
|
+
var _props = this.props,
|
|
12392
|
+
website = _props.website,
|
|
12393
|
+
shareOptions = _props.shareOptions;
|
|
12394
|
+
|
|
12395
|
+
|
|
12396
|
+
return React__default.createElement(
|
|
12397
|
+
TemplateNormal,
|
|
12398
|
+
{ config: config, website: website, keywords: keywords, description: summary, title: title, showRightAd: true },
|
|
12399
|
+
React__default.createElement(
|
|
12400
|
+
InfiniteScroll,
|
|
12401
|
+
{ dataLength: queueData.length, next: this.loadmore, scrollThreshold: '200px', hasMore: true },
|
|
12402
|
+
queueData.map(function (article, index) {
|
|
12403
|
+
return React__default.createElement(Article, _extends$2({
|
|
12404
|
+
key: index,
|
|
12405
|
+
urlFor: _this2.urlFor,
|
|
12406
|
+
isCutomPage: _this2.isCutomPage,
|
|
12407
|
+
renderIsiContent: _this2.renderIsiContent
|
|
12408
|
+
}, _this2.props, {
|
|
12409
|
+
shareOptions: shareOptions,
|
|
12410
|
+
changeUrl: _this2.changeUrl,
|
|
12411
|
+
article: article
|
|
12412
|
+
}));
|
|
12413
|
+
})
|
|
12414
|
+
)
|
|
12415
|
+
);
|
|
12416
|
+
}
|
|
12417
|
+
}]);
|
|
12418
|
+
return ArticleQueue;
|
|
12419
|
+
}(React__default.Component);
|
|
12420
|
+
|
|
12421
|
+
var _initialiseProps = function _initialiseProps() {
|
|
12422
|
+
var _this3 = this;
|
|
12423
|
+
|
|
12424
|
+
this.scrollDirectionDetect = function (e) {
|
|
12425
|
+
var window = e.currentTarget;
|
|
12426
|
+
var isScrollDown = _this3.isScrollDown;
|
|
12427
|
+
|
|
12428
|
+
|
|
12429
|
+
if (_this3.preVscroll > window.scrollY) {
|
|
12430
|
+
if (!isScrollDown) {
|
|
12431
|
+
_this3.isScrollDown = true;
|
|
12432
|
+
}
|
|
12433
|
+
} else if (_this3.preVscroll < window.scrollY) {
|
|
12434
|
+
if (isScrollDown) {
|
|
12435
|
+
_this3.isScrollDown = false;
|
|
12436
|
+
}
|
|
12437
|
+
}
|
|
12438
|
+
_this3.preVscroll = window.scrollY;
|
|
12439
|
+
};
|
|
12440
|
+
|
|
12441
|
+
this.loadmore = function () {
|
|
12442
|
+
var queueData = [].concat(toConsumableArray(_this3.state.queueData));
|
|
12443
|
+
var relatedArticles = [].concat(toConsumableArray(_this3.state.relatedArticles));
|
|
12444
|
+
if (relatedArticles.length > 0) {
|
|
12445
|
+
queueData.push(relatedArticles.shift());
|
|
12446
|
+
_this3.setState({ queueData: queueData, relatedArticles: relatedArticles });
|
|
12447
|
+
}
|
|
12448
|
+
};
|
|
12449
|
+
|
|
12450
|
+
this.isCutomPage = function (article) {
|
|
12451
|
+
var url = article.url.current;
|
|
12452
|
+
var _props2 = _this3.props,
|
|
12453
|
+
regionalPages = _props2.regionalPages,
|
|
12454
|
+
nationalPage = _props2.nationalPage;
|
|
12455
|
+
|
|
12456
|
+
return regionalPages.includes(url) || nationalPage === url;
|
|
12457
|
+
};
|
|
12458
|
+
|
|
12459
|
+
this.urlFor = function (source) {
|
|
12460
|
+
return imageUrlBuilder(_this3.props.client).image(source);
|
|
12461
|
+
};
|
|
12462
|
+
|
|
12463
|
+
this.getTargeting = function (article) {
|
|
12464
|
+
var _article$internalTag = article.internalTag,
|
|
12465
|
+
internalTag = _article$internalTag === undefined ? [] : _article$internalTag,
|
|
12466
|
+
_article$userDefinedT = article.userDefinedTag,
|
|
12467
|
+
userDefinedTag = _article$userDefinedT === undefined ? [] : _article$userDefinedT,
|
|
12468
|
+
_article$SponsorshipT = article.SponsorshipTag,
|
|
12469
|
+
SponsorshipTag = _article$SponsorshipT === undefined ? [] : _article$SponsorshipT,
|
|
12470
|
+
_article$seoTag = article.seoTag,
|
|
12471
|
+
seoTag = _article$seoTag === undefined ? [] : _article$seoTag,
|
|
12472
|
+
_article$url = article.url;
|
|
12473
|
+
_article$url = _article$url === undefined ? {
|
|
12474
|
+
current: ''
|
|
12475
|
+
} : _article$url;
|
|
12476
|
+
var url = _article$url.current,
|
|
12477
|
+
_article$documentGrou = article.documentGroup;
|
|
12478
|
+
_article$documentGrou = _article$documentGrou === undefined ? {
|
|
12479
|
+
path: ''
|
|
12480
|
+
} : _article$documentGrou;
|
|
12481
|
+
var document_group = _article$documentGrou.path,
|
|
12482
|
+
content_placement = article.content_placement;
|
|
12483
|
+
|
|
12484
|
+
var context = url;
|
|
12485
|
+
var localHistory = _this3.props.historyCookie ? JSON.parse(_this3.props.historyCookie) : [];
|
|
12486
|
+
if (!context && localHistory) {
|
|
12487
|
+
context = localHistory[localHistory.length - 1];
|
|
12488
|
+
}
|
|
12489
|
+
context = context && context.split('?')[0];
|
|
12490
|
+
context = context && context.split('&')[0];
|
|
12491
|
+
var content_placement_urls = [];
|
|
12492
|
+
if (content_placement) {
|
|
12493
|
+
if (content_placement.some(function (item) {
|
|
12494
|
+
return context === item.path;
|
|
12495
|
+
})) {
|
|
12496
|
+
content_placement_urls = [context];
|
|
12497
|
+
} else if (content_placement.some(function (item) {
|
|
12498
|
+
return context === '/' + item.path;
|
|
12499
|
+
})) {
|
|
12500
|
+
content_placement_urls = [context.slice(1)];
|
|
12501
|
+
} else {
|
|
12502
|
+
content_placement_urls = content_placement.map(function (item) {
|
|
12503
|
+
return item.path;
|
|
12504
|
+
});
|
|
12505
|
+
}
|
|
12506
|
+
}
|
|
12507
|
+
if (document_group.length > 0) {
|
|
12508
|
+
content_placement_urls = [];
|
|
12509
|
+
}
|
|
12510
|
+
var keywords = [].concat(toConsumableArray(internalTag), toConsumableArray(userDefinedTag), toConsumableArray(SponsorshipTag), toConsumableArray(seoTag));
|
|
12511
|
+
var targeting = {
|
|
12512
|
+
tags: keywords,
|
|
12513
|
+
document_group: [document_group],
|
|
12514
|
+
document_url: [url],
|
|
12515
|
+
content_placement: content_placement_urls
|
|
12516
|
+
};
|
|
12517
|
+
return targeting;
|
|
12518
|
+
};
|
|
12519
|
+
|
|
12520
|
+
this.checkSponseredArticle = function (article) {
|
|
12521
|
+
var _article$taxonomyMapp = article.taxonomyMapping,
|
|
12522
|
+
taxonomyMapping = _article$taxonomyMapp === undefined ? [] : _article$taxonomyMapp;
|
|
12523
|
+
|
|
12524
|
+
if (_this3.props.checkSponsered) {
|
|
12525
|
+
|
|
12526
|
+
return taxonomyMapping.some(function (item) {
|
|
12527
|
+
return item._ref === 'ict_taxonomy_735_sponsoredresources';
|
|
12528
|
+
});
|
|
12529
|
+
} else {
|
|
12530
|
+
return false;
|
|
12531
|
+
}
|
|
12532
|
+
};
|
|
12533
|
+
|
|
12534
|
+
this.renderIsiContent = function (article) {
|
|
12535
|
+
var url = article.url.current;
|
|
12536
|
+
var _props3 = _this3.props,
|
|
12537
|
+
ISIContent = _props3.iSIContent,
|
|
12538
|
+
regionalPages = _props3.regionalPages,
|
|
12539
|
+
nationalPage = _props3.nationalPage;
|
|
12540
|
+
|
|
12541
|
+
if (regionalPages.includes(url)) {
|
|
12542
|
+
return React__default.createElement(ISIContent, null);
|
|
12543
|
+
} else if (nationalPage === url) {
|
|
12544
|
+
return React__default.createElement(ISIContent, { national: true });
|
|
12545
|
+
}
|
|
12546
|
+
return null;
|
|
12547
|
+
};
|
|
12548
|
+
|
|
12549
|
+
this.refreshAdd = function (path) {
|
|
12550
|
+
var article = _this3.state.queueData.find(function (item) {
|
|
12551
|
+
return item.url.current == path;
|
|
12552
|
+
});
|
|
12553
|
+
var title = article.title,
|
|
12554
|
+
summary = article.summary,
|
|
12555
|
+
_article$seo = article.seo;
|
|
12556
|
+
_article$seo = _article$seo === undefined ? {
|
|
12557
|
+
meta_description: null
|
|
12558
|
+
} : _article$seo;
|
|
12559
|
+
var description = _article$seo.meta_description;
|
|
12560
|
+
|
|
12561
|
+
var config = _extends$2({}, _this3.state.config);
|
|
12562
|
+
var targeting = _this3.getTargeting(article);
|
|
12563
|
+
var rightItems = [];
|
|
12564
|
+
|
|
12565
|
+
if (_this3.checkSponseredArticle(article)) {
|
|
12566
|
+
rightItems = [];
|
|
12567
|
+
} else {
|
|
12568
|
+
rightItems = _this3.props.Ads.getRightItems(targeting);
|
|
12569
|
+
}
|
|
12570
|
+
var horizontalAD = _this3.props.Ads.getHorizontal(targeting);
|
|
12571
|
+
config.rightItems = rightItems;
|
|
12572
|
+
config.horizontalAD = horizontalAD;
|
|
12573
|
+
_this3.setState({ config: config, title: title, summary: description ? description : summary }, function () {
|
|
12574
|
+
lib_3.refresh();
|
|
12575
|
+
});
|
|
12576
|
+
};
|
|
12577
|
+
|
|
12578
|
+
this.changeUrl = function (path, visibility) {
|
|
12579
|
+
var isScrollDown = _this3.isScrollDown;
|
|
12580
|
+
|
|
12581
|
+
if (!isScrollDown) {
|
|
12582
|
+
if (visibility == 'top') {
|
|
12583
|
+
window.history.pushState({ page: path }, path, '/view/' + path);
|
|
12584
|
+
_this3.setState({ keywords: [1] });
|
|
12585
|
+
_this3.refreshAdd(path);
|
|
12586
|
+
// Router.push('/view/[url]', `/view/${path}`, {shallow:true})
|
|
12587
|
+
}
|
|
12588
|
+
} else {
|
|
12589
|
+
if (visibility == 'bottom') {
|
|
12590
|
+
window.history.pushState({ page: path }, path, '/view/' + path);
|
|
12591
|
+
_this3.setState({ keywords: [1] });
|
|
12592
|
+
_this3.refreshAdd(path);
|
|
12593
|
+
// Router.push('/view/[url]', `/view/${path}`, {shallow:true})
|
|
12594
|
+
}
|
|
12595
|
+
}
|
|
12596
|
+
};
|
|
12597
|
+
};
|
|
12598
|
+
|
|
12599
|
+
export { AD300x250, AD300x250x600, ADFooter, AccordionPanel, AdSlotsProvider, AlphabeticList, ArticleDetailDropdown, ArticleQueue, Breadcrumbs$1 as Breadcrumbs, ConferenceArticleCard, Feature, fbsHero as ForbesHero, Hero, HorizontalHero, OncliveHero, OncliveLargeHero, PdfDownload, RelatedContent, RelatedTopicsDropdown, SetCookie, SocialShare$1 as SocialShare, VerticalHero, YahooHero, getSerializers };
|