@mjhls/mjh-framework 1.0.691 → 1.0.693

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/cjs/index.js CHANGED
@@ -65,7 +65,7 @@ require('react-bootstrap');
65
65
  require('./timeDifferenceCalc.js');
66
66
  var QueueDeckExpanded = require('./QueueDeckExpanded.js');
67
67
  require('./iconBase-68959171.js');
68
- require('./index.esm-876ca9ff.js');
68
+ require('./index.esm-90433435.js');
69
69
  var VideoSeriesListing = require('./VideoSeriesListing.js');
70
70
  var ArticleSeriesListing = require('./ArticleSeriesListing.js');
71
71
  var ArticleCarousel = require('./ArticleCarousel.js');
@@ -83,7 +83,7 @@ require('react-bootstrap/Form');
83
83
  require('./index-5be2866f.js');
84
84
  require('./js.cookie-a511c430.js');
85
85
  var CMEDeck = require('./CMEDeck.js');
86
- var getSerializers = require('./index-44c25825.js');
86
+ var getSerializers = require('./index-59436c13.js');
87
87
  require('./util-f2c1b65b.js');
88
88
  require('./brightcove-react-player-loader.es-156bd4d6.js');
89
89
  require('react-bootstrap/Pagination');
@@ -6,7 +6,7 @@ import './web.dom.iterable-8956f9a5.js';
6
6
  import React__default, { useState } from 'react';
7
7
  import { _ as _slicedToArray } from './slicedToArray-7021e5df.js';
8
8
  import './iconBase-602d52fe.js';
9
- import { a as IoMdArrowDropdown } from './index.esm-85cb09e6.js';
9
+ import { a as IoMdArrowDropdown } from './index.esm-29e48d38.js';
10
10
  import Accordion from 'react-bootstrap/Accordion';
11
11
  import { useAccordionToggle } from 'react-bootstrap/AccordionToggle';
12
12
 
@@ -15,7 +15,7 @@ import React__default from 'react';
15
15
  import { l as lib_3 } from './index-93ec3c59.js';
16
16
  import 'prop-types';
17
17
  import Container from 'react-bootstrap/Container';
18
- import './moment-12415288.js';
18
+ import { m as moment } from './moment-12415288.js';
19
19
  import { withRouter } from 'next/router';
20
20
  import './isSymbol-807e927e.js';
21
21
  import { d as debounce_1 } from './debounce-1a993acf.js';
@@ -28,7 +28,7 @@ import './slicedToArray-7021e5df.js';
28
28
  import './smoothscroll-4b699764.js';
29
29
  import YoutubeGroup from './YoutubeGroup.js';
30
30
  import './iconBase-602d52fe.js';
31
- import { I as IoIosArrowForward } from './index.esm-85cb09e6.js';
31
+ import { I as IoIosArrowForward } from './index.esm-29e48d38.js';
32
32
 
33
33
  var ArticleSeriesListing = function (_React$Component) {
34
34
  _inherits(ArticleSeriesListing, _React$Component);
@@ -44,8 +44,29 @@ var ArticleSeriesListing = function (_React$Component) {
44
44
  args[_key] = arguments[_key];
45
45
  }
46
46
 
47
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ArticleSeriesListing.__proto__ || _Object$getPrototypeOf(ArticleSeriesListing)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.autoScroll = _this.props.autoScroll ? _this.props.autoScroll : false, _this.dataArr = [_this.data], _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
48
- data: _this.dataArr,
47
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ArticleSeriesListing.__proto__ || _Object$getPrototypeOf(ArticleSeriesListing)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.autoScroll = _this.props.autoScroll ? _this.props.autoScroll : false, _this.today = moment().utc().format(), _this.dataArr = [_this.data], _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
48
+ data: _this.dataArr.map(function (item) {
49
+ var tempObj = item;
50
+ if (tempObj.body) {
51
+ var filteredBody = tempObj.body.map(function (item) {
52
+ if (item._type === 'articleSeries') {
53
+ var innerObj = item;
54
+ var filteredArticles = innerObj.articles.filter(function (article) {
55
+ if ((article.is_visible === true || !article.hasOwnProperty('is_visible')) && _this.today >= article.published) {
56
+ return article;
57
+ }
58
+ });
59
+ innerObj.body = filteredArticles;
60
+ return innerObj;
61
+ } else {
62
+ return item;
63
+ }
64
+ });
65
+
66
+ tempObj.body = filteredBody;
67
+ }
68
+ return tempObj;
69
+ }),
49
70
  per: _this.params ? _this.params.to : 2,
50
71
  page: _this.props.currentPage || 1,
51
72
  from: _this.params ? _this.params.from : 0,
@@ -38,9 +38,11 @@ import { B as BlockContent } from './BlockContent-a614acdf.js';
38
38
  import './smoothscroll-4b699764.js';
39
39
  import './GroupDeck.js';
40
40
  import 'react-bootstrap';
41
+ import './iconBase-602d52fe.js';
42
+ import './index.esm-29e48d38.js';
41
43
  import Button from 'react-bootstrap/Button';
42
44
  import { m as momentTimezone } from './index-d2f90501.js';
43
- import { g as getSerializers } from './index-8a757d91.js';
45
+ import { g as getSerializers } from './index-a2e78632.js';
44
46
  import './util-7700fc59.js';
45
47
  import './brightcove-react-player-loader.es-83f53e4e.js';
46
48
  import 'react-bootstrap/Pagination';
@@ -15,7 +15,7 @@ import './_set-species-cede29f8.js';
15
15
  import Segment from './Segment.js';
16
16
  import './react-social-icons-a7d5c5c7.js';
17
17
  import './iconBase-602d52fe.js';
18
- import { b as IoMdLogIn } from './index.esm-85cb09e6.js';
18
+ import { b as IoMdLogIn } from './index.esm-29e48d38.js';
19
19
  import 'react-bootstrap/Button';
20
20
  import 'react-bootstrap/Form';
21
21
  import Nav from 'react-bootstrap/Nav';
@@ -15,7 +15,7 @@ import './_set-species-cede29f8.js';
15
15
  import Segment from './Segment.js';
16
16
  import './react-social-icons-a7d5c5c7.js';
17
17
  import './iconBase-602d52fe.js';
18
- import { b as IoMdLogIn } from './index.esm-85cb09e6.js';
18
+ import { b as IoMdLogIn } from './index.esm-29e48d38.js';
19
19
  import 'react-bootstrap/Button';
20
20
  import 'react-bootstrap/Form';
21
21
  import Nav from 'react-bootstrap/Nav';
@@ -150,6 +150,9 @@ var NavNative = function NavNative(props) {
150
150
  var toggleClass = function toggleClass(selector, type, addOn) {
151
151
  if (type === 'id') {
152
152
  var searchBar = document.getElementById(selector);
153
+ // Aligning search bar below the searchbutton
154
+ var socialComponent = document.getElementById('search-content-desktop').getBoundingClientRect();
155
+ searchBar.style.right = window.innerWidth - socialComponent.left + 'px';
153
156
  if (searchBar && searchBar.classList && searchBar.classList.contains(addOn)) {
154
157
  searchBar.classList.remove(addOn);
155
158
  } else if (searchBar && searchBar.classList) {
@@ -219,7 +222,31 @@ var NavNative = function NavNative(props) {
219
222
  } else if (type === 'desktop') {
220
223
  return React__default.createElement(
221
224
  'div',
222
- { id: 'search-content-desktop' },
225
+ null,
226
+ React__default.createElement(
227
+ 'div',
228
+ { id: 'search-content-desktop' },
229
+ React__default.createElement(
230
+ IconContext.Provider,
231
+ { value: { color: socialIconVariant === 'light' ? 'white' : 'black', className: 'search-btn-desktop', size: '50px' } },
232
+ React__default.createElement(GoSearch, {
233
+ onClick: function onClick() {
234
+ toggleClass('search-bar-desktop', 'id', 'show');
235
+ toggleClass('search-btn-desktop', 'class', 'active-search');
236
+ }
237
+ })
238
+ ),
239
+ website && website.socialLinks && website.socialLinks.length !== 0 && React__default.createElement(
240
+ 'div',
241
+ { id: 'social-tab-desktop', style: { display: 'flex' } },
242
+ website.socialLinks && React__default.createElement(SocialIcons, { socialLinks: website.socialLinks, variant: socialIconVariant })
243
+ ),
244
+ React__default.createElement(
245
+ 'style',
246
+ { jsx: 'true' },
247
+ '\n #social-tab-desktops {\n position: relative;\n display: flex;\n left: 0px;\n }\n #social-tab-desktops svg {\n height: 25px !important;\n width: 25px !important;\n }\n @media screen and (max-width: 1191px) {\n #search-content-desktop {\n display: none !important;\n }\n }\n @media screen and (min-width: 1199px) {\n .mobile-nav {\n width: 100% !important;\n }\n }\n #search-content-desktop {\n display: flex;\n padding-top: 2px;\n height: 35px;\n position: relative;\n }\n .search-btn-desktop {\n padding: 5px;\n height: 35px;\n width: 35px;\n margin: -3px 0px 0px 0px;\n cursor: pointer;\n }\n #search-bar-desktop {\n display: none;\n background-color: var(--primary);\n position: fixed;\n width: 400px;\n border-radius: 5px;\n height: 48px;\n top: 105px;\n }\n #search-bar-desktop .form-inline {\n padding: 5px;\n }\n #search-bar-desktop .form-inline .form-control {\n width: 78%;\n border-radius: 5px;\n }\n #search-bar-desktop .form-inline .btn {\n width: 20%;\n border-radius: 5px;\n padding: 7px;\n margin-left: 5px;\n }\n .show {\n display: block !important;\n }\n .active-search {\n border-radius: 5px;\n border: 1px solid var(--secondary);\n margin-right: 1px !important;\n }\n #basic-navbar-nav {\n margin-right: 20%;\n }\n '
248
+ )
249
+ ),
223
250
  React__default.createElement(
224
251
  'div',
225
252
  { id: 'search-bar-desktop' },
@@ -239,26 +266,6 @@ var NavNative = function NavNative(props) {
239
266
  'Search'
240
267
  )
241
268
  )
242
- ),
243
- React__default.createElement(
244
- IconContext.Provider,
245
- { value: { color: socialIconVariant === 'light' ? 'white' : 'black', className: 'search-btn-desktop', size: '50px' } },
246
- React__default.createElement(GoSearch, {
247
- onClick: function onClick() {
248
- toggleClass('search-bar-desktop', 'id', 'show');
249
- toggleClass('search-btn-desktop', 'class', 'active-search');
250
- }
251
- })
252
- ),
253
- website && website.socialLinks && website.socialLinks.length !== 0 && React__default.createElement(
254
- 'div',
255
- { id: 'social-tab-desktop', style: { display: 'flex' } },
256
- website.socialLinks && React__default.createElement(SocialIcons, { socialLinks: website.socialLinks, variant: socialIconVariant })
257
- ),
258
- React__default.createElement(
259
- 'style',
260
- { jsx: 'true' },
261
- '\n #social-tab-desktops {\n position: relative;\n display: flex;\n left: 0px;\n }\n #social-tab-desktops svg {\n height: 25px !important;\n width: 25px !important;\n }\n @media screen and (max-width: 1191px) {\n #search-content-desktop {\n display: none !important;\n }\n }\n @media screen and (min-width: 1199px) {\n .mobile-nav {\n width: 100% !important;\n }\n }\n #search-content-desktop {\n display: flex;\n padding-top: 2px;\n height: 35px;\n position: fixed;\n right: 5%;\n top: 12px;\n }\n #search-content-desktop .search-btn-desktop {\n padding: 5px;\n height: 35px;\n width: 35px;\n margin: -3px 0px 0px 0px;\n cursor: pointer;\n }\n #search-content-desktop #search-bar-desktop {\n display: none;\n background-color: var(--primary);\n position: relative;\n width: 400px;\n border-radius: 5px;\n height: 48px;\n top: 50px;\n }\n #search-content-desktop #search-bar-desktop .form-inline {\n padding: 5px;\n }\n #search-content-desktop #search-bar-desktop .form-inline .form-control {\n width: 78%;\n border-radius: 5px;\n }\n #search-content-desktop #search-bar-desktop .form-inline .btn {\n width: 20%;\n border-radius: 5px;\n padding: 7px;\n margin-left: 5px;\n }\n .show {\n display: block !important;\n }\n .active-search {\n border-radius: 5px;\n border: 1px solid var(--secondary);\n margin-right: 1px !important;\n }\n #basic-navbar-nav {\n margin-right: 20%;\n }\n '
262
269
  )
263
270
  );
264
271
  }
@@ -48,8 +48,10 @@ import './GroupDeck.js';
48
48
  import 'react-bootstrap';
49
49
  import './timeDifferenceCalc.js';
50
50
  import QueueDeckExpanded from './QueueDeckExpanded.js';
51
+ import './iconBase-602d52fe.js';
52
+ import './index.esm-29e48d38.js';
51
53
  import 'react-bootstrap/Button';
52
- import { g as getSerializers } from './index-8a757d91.js';
54
+ import { g as getSerializers } from './index-a2e78632.js';
53
55
  import './util-7700fc59.js';
54
56
  import './brightcove-react-player-loader.es-83f53e4e.js';
55
57
  import 'react-bootstrap/Pagination';
@@ -27,7 +27,7 @@ import './get-5ee14cda.js';
27
27
  import './react-social-icons-a7d5c5c7.js';
28
28
  import 'react-bootstrap';
29
29
  import './iconBase-602d52fe.js';
30
- import './index.esm-85cb09e6.js';
30
+ import './index.esm-29e48d38.js';
31
31
  import 'react-bootstrap/Button';
32
32
  import './defineProperty-b798470d.js';
33
33
  import 'react-bootstrap/Form';
@@ -7,7 +7,7 @@ import React__default, { useState, useRef, useEffect } from 'react';
7
7
  import { m as main_39 } from './main-0465b2a0.js';
8
8
  import { _ as _slicedToArray } from './slicedToArray-7021e5df.js';
9
9
  import './iconBase-602d52fe.js';
10
- import { c as IoIosOpen } from './index.esm-85cb09e6.js';
10
+ import { c as IoIosOpen } from './index.esm-29e48d38.js';
11
11
  import { F as FaRegWindowClose } from './index.esm-cf08bf18.js';
12
12
 
13
13
  var Ustream = function Ustream(_ref) {
@@ -15,6 +15,7 @@ import React__default from 'react';
15
15
  import { l as lib_3 } from './index-93ec3c59.js';
16
16
  import 'prop-types';
17
17
  import Container from 'react-bootstrap/Container';
18
+ import { m as moment } from './moment-12415288.js';
18
19
  import { withRouter } from 'next/router';
19
20
  import './isSymbol-807e927e.js';
20
21
  import { d as debounce_1 } from './debounce-1a993acf.js';
@@ -27,7 +28,7 @@ import './slicedToArray-7021e5df.js';
27
28
  import './smoothscroll-4b699764.js';
28
29
  import YoutubeGroup from './YoutubeGroup.js';
29
30
  import './iconBase-602d52fe.js';
30
- import { I as IoIosArrowForward } from './index.esm-85cb09e6.js';
31
+ import { I as IoIosArrowForward } from './index.esm-29e48d38.js';
31
32
 
32
33
  var VideoSeriesListing = function (_React$Component) {
33
34
  _inherits(VideoSeriesListing, _React$Component);
@@ -43,8 +44,29 @@ var VideoSeriesListing = function (_React$Component) {
43
44
  args[_key] = arguments[_key];
44
45
  }
45
46
 
46
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = VideoSeriesListing.__proto__ || _Object$getPrototypeOf(VideoSeriesListing)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.dataArr = [_this.data], _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
47
- data: _this.dataArr,
47
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = VideoSeriesListing.__proto__ || _Object$getPrototypeOf(VideoSeriesListing)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.today = moment().utc().format(), _this.dataArr = [_this.data], _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
48
+ data: _this.dataArr.map(function (item) {
49
+ var tempObj = item;
50
+ if (tempObj.body) {
51
+ var filteredBody = tempObj.body.map(function (item) {
52
+ if (item._type === 'articleSeries') {
53
+ var innerObj = item;
54
+ var filteredArticles = innerObj.articles.filter(function (article) {
55
+ if ((article.is_visible === true || !article.hasOwnProperty('is_visible')) && (_this.today >= article.published || !article.hasOwnProperty('published'))) {
56
+ return article;
57
+ }
58
+ });
59
+ innerObj.body = filteredArticles;
60
+ return innerObj;
61
+ } else {
62
+ return item;
63
+ }
64
+ });
65
+
66
+ tempObj.body = filteredBody;
67
+ }
68
+ return tempObj;
69
+ }),
48
70
  per: _this.params ? _this.params.to : 2,
49
71
  page: _this.props.currentPage || 1,
50
72
  from: _this.params ? _this.params.from : 0,
@@ -317,7 +339,16 @@ var VideoSeriesListing = function (_React$Component) {
317
339
  'button',
318
340
  {
319
341
  className: 'btn',
320
- style: { margin: '0 auto 2rem', display: 'block', fontSize: '18px', padding: '.5rem 1.5rem', boxShadow: '1px 2px 4px 4px rgba(0,0,0,.15)', background: 'var(--primary)', color: '#fff', borderRadius: '5px' },
342
+ style: {
343
+ margin: '0 auto 2rem',
344
+ display: 'block',
345
+ fontSize: '18px',
346
+ padding: '.5rem 1.5rem',
347
+ boxShadow: '1px 2px 4px 4px rgba(0,0,0,.15)',
348
+ background: 'var(--primary)',
349
+ color: '#fff',
350
+ borderRadius: '5px'
351
+ },
321
352
  onClick: function onClick(e) {
322
353
  e.target.style.display = 'none';
323
354
  _this2.loadMore();
package/dist/esm/View.js CHANGED
@@ -40,10 +40,11 @@ import './smoothscroll-4b699764.js';
40
40
  import './GroupDeck.js';
41
41
  import 'react-bootstrap';
42
42
  import './iconBase-602d52fe.js';
43
+ import './index.esm-29e48d38.js';
43
44
  import Button from 'react-bootstrap/Button';
44
45
  import { _ as _defineProperty } from './defineProperty-b798470d.js';
45
46
  import Form from 'react-bootstrap/Form';
46
- import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-8a757d91.js';
47
+ import { I as InscreenSensor, r as renderAuthor, g as getSerializers } from './index-a2e78632.js';
47
48
  import './util-7700fc59.js';
48
49
  import './brightcove-react-player-loader.es-83f53e4e.js';
49
50
  import 'react-bootstrap/Pagination';
@@ -38,8 +38,10 @@ import './BlockContent-a614acdf.js';
38
38
  import './smoothscroll-4b699764.js';
39
39
  import './GroupDeck.js';
40
40
  import 'react-bootstrap';
41
+ import './iconBase-602d52fe.js';
42
+ import './index.esm-29e48d38.js';
41
43
  import 'react-bootstrap/Button';
42
- export { g as default } from './index-8a757d91.js';
44
+ export { g as default } from './index-a2e78632.js';
43
45
  import './util-7700fc59.js';
44
46
  import './brightcove-react-player-loader.es-83f53e4e.js';
45
47
  import 'react-bootstrap/Pagination';
@@ -3,7 +3,7 @@ import { a as _Array$from, _ as _toConsumableArray } from './toConsumableArray-7
3
3
  import { _ as _extends } from './extends-cc5da797.js';
4
4
  import { _ as _inherits$1, a as _classCallCheck$1, b as _possibleConstructorReturn$1, c as _Object$getPrototypeOf, d as _createClass$1 } from './inherits-7ee3e0c1.js';
5
5
  import { _ as _typeof$1 } from './typeof-08f2c380.js';
6
- import React__default, { useState, useEffect, useRef, useCallback } from 'react';
6
+ import React__default, { useState, useEffect, useRef, useLayoutEffect, useCallback } from 'react';
7
7
  import { l as lib_3 } from './index-93ec3c59.js';
8
8
  import PropTypes from 'prop-types';
9
9
  import Row from 'react-bootstrap/Row';
@@ -22,6 +22,7 @@ import { B as BlockContent } from './BlockContent-a614acdf.js';
22
22
  import { g as getYoutubeId } from './smoothscroll-4b699764.js';
23
23
  import GroupDeck from './GroupDeck.js';
24
24
  import { Carousel, Table, Figure as Figure$1, Button, ProgressBar, Card, Row as Row$1, Col as Col$1 } from 'react-bootstrap';
25
+ import { d as IoIosArrowDropupCircle } from './index.esm-29e48d38.js';
25
26
  import Button$1 from 'react-bootstrap/Button';
26
27
  import { u as util } from './util-7700fc59.js';
27
28
  import { R as ReactPlayerLoader } from './brightcove-react-player-loader.es-83f53e4e.js';
@@ -8019,6 +8020,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8019
8020
  return null;
8020
8021
  }
8021
8022
  nodes.seriesTitle = !nodes.seriesTitle ? 'Learning Objectives' : nodes.seriesTitle;
8023
+ var today = moment().utc().format();
8022
8024
 
8023
8025
  var authorPrefix = 'authors';
8024
8026
  var builder = imageUrlBuilder(client);
@@ -8029,28 +8031,38 @@ var ArticleSeries = function ArticleSeries(_ref) {
8029
8031
 
8030
8032
  var refArray = useRef([]);
8031
8033
  var adRefArray = useRef([]);
8034
+ var articleContainerRef = useRef(null);
8035
+ var arrowRef = useRef(null);
8032
8036
 
8033
- var _ref2 = main_39 ? useState(100) : useState(-25),
8034
- _ref3 = _slicedToArray(_ref2, 2),
8035
- NavoffsetTop = _ref3[0],
8036
- setNavoffsetTop = _ref3[1];
8037
+ var _useState = useState(0),
8038
+ _useState2 = _slicedToArray(_useState, 2),
8039
+ contentWidth = _useState2[0],
8040
+ setContentWidth = _useState2[1];
8041
+
8042
+ var upArrowClicked = false;
8043
+
8044
+ var Articles = nodes.articles.filter(function (article) {
8045
+ if ((article.is_visible === true || !article.hasOwnProperty('is_visible')) && today >= article.published) {
8046
+ return article;
8047
+ }
8048
+ });
8037
8049
 
8038
8050
  var PrevNextCards = function PrevNextCards(show, articleNum) {
8039
8051
  var articles = [];
8040
8052
  if (articleNum >= 0) {
8041
8053
  if (articleNum == 0) {
8042
- articles.push(nodes.articles[1]);
8043
- } else if (articleNum == nodes.articles.length - 1) {
8044
- articles.push(nodes.articles[articleNum - 1]);
8054
+ articles.push(Articles[1]);
8055
+ } else if (articleNum == Articles.length - 1) {
8056
+ articles.push(Articles[articleNum - 1]);
8045
8057
  } else {
8046
- articles.push(nodes.articles[articleNum - 1]);
8047
- articles.push(nodes.articles[articleNum + 1]);
8058
+ articles.push(Articles[articleNum - 1]);
8059
+ articles.push(Articles[articleNum + 1]);
8048
8060
  }
8049
8061
  } else {
8050
- articles = [].concat(_toConsumableArray(nodes.articles));
8062
+ articles = [].concat(_toConsumableArray(Articles));
8051
8063
  }
8052
8064
  return articles.map(function (article, index) {
8053
- if (!article) return null;
8065
+ if (!article || !article.is_visible && article.hasOwnProperty('is_visible') || today < article.published) return null;
8054
8066
  var showReading = show ? 'showReading' : '';
8055
8067
  var articleLabel = articles.length == 1 && articleNum != 0 || articles.length > 1 && index == 0 ? 'Previous' : 'Next';
8056
8068
  return React__default.createElement(
@@ -8090,35 +8102,35 @@ var ArticleSeries = function ArticleSeries(_ref) {
8090
8102
  });
8091
8103
  };
8092
8104
 
8093
- var _ref4 = router && router.asPath && router.asPath.split('?')[1] ? useState(router.asPath.split('=')[1]) : useState(null),
8094
- _ref5 = _slicedToArray(_ref4, 2),
8095
- selectedArticle = _ref5[0],
8096
- setSelectedArticle = _ref5[1];
8097
-
8098
- var _useState = useState(false),
8099
- _useState2 = _slicedToArray(_useState, 2),
8100
- firstLoad = _useState2[0],
8101
- setFirstLoad = _useState2[1];
8105
+ var _ref2 = router && router.asPath && router.asPath.split('?')[1] ? useState(router.asPath.split('=')[1]) : useState(null),
8106
+ _ref3 = _slicedToArray(_ref2, 2),
8107
+ selectedArticle = _ref3[0],
8108
+ setSelectedArticle = _ref3[1];
8102
8109
 
8103
- var _useState3 = useState(null),
8110
+ var _useState3 = useState(false),
8104
8111
  _useState4 = _slicedToArray(_useState3, 2),
8105
- currentURL = _useState4[0],
8106
- setCurrentURL = _useState4[1];
8112
+ firstLoad = _useState4[0],
8113
+ setFirstLoad = _useState4[1];
8107
8114
 
8108
8115
  var _useState5 = useState(null),
8109
8116
  _useState6 = _slicedToArray(_useState5, 2),
8110
- currentTitle = _useState6[0],
8111
- setCurrentTitle = _useState6[1];
8117
+ currentURL = _useState6[0],
8118
+ setCurrentURL = _useState6[1];
8112
8119
 
8113
8120
  var _useState7 = useState(null),
8114
8121
  _useState8 = _slicedToArray(_useState7, 2),
8115
- currentSummary = _useState8[0],
8116
- setCurrentSummary = _useState8[1];
8122
+ currentTitle = _useState8[0],
8123
+ setCurrentTitle = _useState8[1];
8117
8124
 
8118
8125
  var _useState9 = useState(null),
8119
8126
  _useState10 = _slicedToArray(_useState9, 2),
8120
- currentThumbnail = _useState10[0],
8121
- setCurrentThumbnail = _useState10[1];
8127
+ currentSummary = _useState10[0],
8128
+ setCurrentSummary = _useState10[1];
8129
+
8130
+ var _useState11 = useState(null),
8131
+ _useState12 = _slicedToArray(_useState11, 2),
8132
+ currentThumbnail = _useState12[0],
8133
+ setCurrentThumbnail = _useState12[1];
8122
8134
 
8123
8135
  var articleCardClickHandler = function articleCardClickHandler(e) {
8124
8136
  e.preventDefault();
@@ -8126,15 +8138,6 @@ var ArticleSeries = function ArticleSeries(_ref) {
8126
8138
  setSelectedArticle(articleClicked);
8127
8139
  scrollToArticle(articleClicked);
8128
8140
  };
8129
-
8130
- useEffect(function () {
8131
- try {
8132
- if (main_39) {
8133
- setNavoffsetTop(document.getElementById('navbar-ham').offsetHeight - 15);
8134
- }
8135
- } catch (e) {}
8136
- }, []);
8137
-
8138
8141
  var scrollToArticle = function scrollToArticle(id) {
8139
8142
  var localArticleID = id ? id : selectedArticle;
8140
8143
  var findArticle = function findArticle(ref) {
@@ -8146,8 +8149,12 @@ var ArticleSeries = function ArticleSeries(_ref) {
8146
8149
  var indexOfRef = refArray.current.findIndex(findArticle);
8147
8150
 
8148
8151
  if (indexOfRef >= 0) {
8149
- //refArray.current[indexOfRef].wraperRef.current.scrollIntoView({ behavior: 'smooth' })
8150
- window.scrollTo({ top: refArray.current[indexOfRef].wraperRef.current.offsetTop - NavoffsetTop, behavior: 'smooth' });
8152
+ var newOffsetTop = !firstLoad ? refArray.current[indexOfRef].wraperRef.current.offsetTop : refArray.current[indexOfRef].wraperRef.current.offsetTop + document.getElementsByTagName('header')[0].clientHeight;
8153
+ console.dir(refArray.current[indexOfRef].wraperRef.current);
8154
+ console.log(document.getElementsByTagName('header')[0].clientHeight);
8155
+ console.log(refArray.current[indexOfRef].wraperRef.current.offsetTop);
8156
+ window.scrollTo({ top: newOffsetTop, behavior: 'smooth' });
8157
+ //refArray.current[indexOfRef].wraperRef.current.scrollIntoView({ behavior: 'smooth', block: 'start' })
8151
8158
  }
8152
8159
  setFirstLoad(true);
8153
8160
  };
@@ -8195,13 +8202,24 @@ var ArticleSeries = function ArticleSeries(_ref) {
8195
8202
 
8196
8203
  var scrollDirectionDetect = function scrollDirectionDetect(e) {
8197
8204
  var window = e.currentTarget;
8198
-
8199
8205
  if (preVscroll > window.scrollY) {
8200
8206
  isScrollDown = false;
8201
- } else if (preVscroll < window.scrollY) {
8207
+ if (window.scrollY > articleContainerRef.current.offsetTop) {
8208
+ arrowRef.current.classList.add('showArrow');
8209
+ arrowRef.current.classList.remove('hideArrow');
8210
+ }
8211
+ } else if (preVscroll > window.scrollY) {
8202
8212
  isScrollDown = true;
8203
8213
  }
8204
8214
  preVscroll = window.scrollY;
8215
+ setContentWidth(articleContainerRef.current.offsetWidth);
8216
+ if (preVscroll <= articleContainerRef.current.offsetTop) {
8217
+ arrowRef.current.classList.remove('showArrow');
8218
+ arrowRef.current.classList.add('hideArrow');
8219
+ }
8220
+ if (window.scrollY === 0 && upArrowClicked === true) {
8221
+ upArrowClicked = false;
8222
+ }
8205
8223
  };
8206
8224
 
8207
8225
  useEffect(function () {
@@ -8211,7 +8229,8 @@ var ArticleSeries = function ArticleSeries(_ref) {
8211
8229
  };
8212
8230
  });
8213
8231
 
8214
- useEffect(function () {
8232
+ useLayoutEffect(function () {
8233
+ console.log('useLayoutEffect');
8215
8234
  if (!firstLoad) {
8216
8235
  if (main_39) {
8217
8236
  grabLoadedAds();
@@ -8219,10 +8238,9 @@ var ArticleSeries = function ArticleSeries(_ref) {
8219
8238
  scrollToArticle();
8220
8239
  }
8221
8240
  }
8222
- }, []);
8241
+ });
8223
8242
 
8224
8243
  var grabLoadedAds = function grabLoadedAds() {
8225
- console.dir(lib_3);
8226
8244
  lib_3.getGoogletag().then(function (googletag) {
8227
8245
  var checkIfReady = window.setInterval(function () {
8228
8246
  if (window.googletag && googletag.pubadsReady) {
@@ -8255,9 +8273,26 @@ var ArticleSeries = function ArticleSeries(_ref) {
8255
8273
  }
8256
8274
  };
8257
8275
 
8276
+ var handleArrowClick = function handleArrowClick() {
8277
+ isScrollDown = true;
8278
+ upArrowClicked = true;
8279
+ arrowRef.current.classList.add('hideArrow');
8280
+ arrowRef.current.classList.remove('showArrow');
8281
+ window.scrollTo({ top: 0, behavior: 'smooth' });
8282
+ window.history.pushState({}, '', router.asPath.split('?')[0]);
8283
+ document.title = nodes.seriesTitle;
8284
+ };
8285
+
8258
8286
  return React__default.createElement(
8259
8287
  React__default.Fragment,
8260
8288
  null,
8289
+ React__default.createElement(
8290
+ 'div',
8291
+ { ref: arrowRef, className: 'scrollToTopArrow hideArrow', onClick: function onClick() {
8292
+ return handleArrowClick();
8293
+ } },
8294
+ React__default.createElement(IoIosArrowDropupCircle, null)
8295
+ ),
8261
8296
  React__default.createElement('hr', { className: 'article-seperater my-4' }),
8262
8297
  React__default.createElement(
8263
8298
  'div',
@@ -8301,8 +8336,8 @@ var ArticleSeries = function ArticleSeries(_ref) {
8301
8336
  ),
8302
8337
  React__default.createElement(
8303
8338
  'div',
8304
- { className: 'article-container', style: { marginBottom: '2rem' } },
8305
- nodes.articles.map(function (article, index) {
8339
+ { ref: articleContainerRef, className: 'article-container', style: { marginBottom: '2rem' } },
8340
+ Articles.map(function (article, index) {
8306
8341
  return React__default.createElement(
8307
8342
  'div',
8308
8343
  { key: article.title },
@@ -8317,8 +8352,10 @@ var ArticleSeries = function ArticleSeries(_ref) {
8317
8352
  return refArray.current[index] = ele;
8318
8353
  },
8319
8354
  onChange: function onChange(visible) {
8320
- if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
8321
- onChangeArticle(article.param.current, visible, article.title, article.summary, urlFor(article.thumbnail.asset).url());
8355
+ if (!upArrowClicked) {
8356
+ if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
8357
+ onChangeArticle(article.param.current, visible, article.title, article.summary, urlFor(article.thumbnail.asset).url());
8358
+ }
8322
8359
  }
8323
8360
  } },
8324
8361
  React__default.createElement(
@@ -8373,26 +8410,30 @@ var ArticleSeries = function ArticleSeries(_ref) {
8373
8410
  }, client.config())),
8374
8411
  React__default.createElement('hr', { className: 'article-seperater my-4' })
8375
8412
  ),
8376
- React__default.createElement(
8377
- 'div',
8378
- { className: 'objective-prevNext-Wrapper' },
8379
- React__default.createElement(
8380
- 'h5',
8381
- { className: 'objective-title' },
8382
- nodes.seriesTitle
8383
- ),
8413
+ Articles.length > 1 && React__default.createElement(
8414
+ React__default.Fragment,
8415
+ null,
8384
8416
  React__default.createElement(
8385
8417
  'div',
8386
- { className: 'prevNextWrapper' },
8387
- PrevNextCards(true, index)
8388
- )
8389
- ),
8390
- React__default.createElement('hr', { className: 'article-seperater' })
8418
+ { className: 'objective-prevNext-Wrapper' },
8419
+ React__default.createElement(
8420
+ 'h5',
8421
+ { className: 'objective-title' },
8422
+ nodes.seriesTitle
8423
+ ),
8424
+ React__default.createElement(
8425
+ 'div',
8426
+ { className: 'prevNextWrapper' },
8427
+ PrevNextCards(true, index)
8428
+ )
8429
+ ),
8430
+ React__default.createElement('hr', { className: 'article-seperater' })
8431
+ )
8391
8432
  ),
8392
8433
  React__default.createElement(
8393
8434
  'div',
8394
8435
  { className: 'ad-box', style: { textAlign: 'center' } },
8395
- main_39 && nodes.articles.length - 1 !== index && Ads.map(function (ad, innerIndex) {
8436
+ main_39 && Articles.length - 1 !== index && Ads.map(function (ad, innerIndex) {
8396
8437
  if (innerIndex === 0) {
8397
8438
  return React__default.createElement(
8398
8439
  'div',
@@ -8420,7 +8461,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8420
8461
  React__default.createElement(
8421
8462
  'style',
8422
8463
  { jsx: 'true' },
8423
- '\n .block-content > div p {\n padding: 0;\n }\n\n h2.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.prevNext-title {\n padding: 0;\n font-size: 1rem;\n font-weight: 500;\n }\n .article-wrapper {\n border: 1px solid #252525;\n border-radius: 5px;\n padding: 1rem 1rem 0 1rem;\n margin-bottom: 1rem;\n }\n .prevNext-reading {\n margin-top: -10px;\n width: 75%;\n text-align: center;\n background: white;\n border: 1px solid #252525;\n align-self: center;\n display: none;\n }\n .showReading {\n display: block;\n }\n .author-details-wrapper a {\n color: #252525;\n }\n .objective-prevNext-Wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n .objective-title {\n padding: 0 !important;\n }\n .prevNext-thumbnail {\n display: flex;\n flex-direction: column;\n min-width: 225px;\n max-width: 225px;\n overflow: hidden;\n align-items: center;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-thumbnail img {\n height: 125px;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-summary {\n text-align: center;\n }\n .prevNext-publishDate {\n font-size: 0.75rem;\n margin-top: 0.5rem;\n }\n .prevNext-title {\n padding: 0 !important;\n line-height: 1 !important;\n font-weight: 500;\n }\n .prevNextWrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-evenly;\n flex-wrap: wrap;\n }\n .prevNextWrapper a {\n display: flex;\n flex-direction: column;\n color: #252525;\n align-items: center;\n }\n .prevNextCards {\n max-width: 250px;\n margin-bottom: 1rem;\n }\n @media only screen and (max-width: 568px) {\n .prevNextWrapper {\n flex-direction: column;\n align-items: center;\n }\n .prevNextCards {\n margin-bottom: 2rem;\n }\n }\n @media only screen and (max-width: 568px) {\n }\n '
8464
+ '\n .scrollToTopArrow {\n position: fixed;\n top: 150px;\n display: flex;\n justify-content: center;\n width: ' + contentWidth + 'px;\n opacity: 0;\n z-index: 99999999999;\n cursor: pointer;\n }\n .showArrow {\n opacity: 1;\n }\n .hideArrow {\n opacity: 0;\n }\n .scrollToTopArrow > svg {\n min-height: 50px;\n min-width: 50px;\n max-height: 50px;\n max-width: 50px;\n }\n .block-content > div p {\n padding: 0;\n }\n\n h2.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.article-title {\n padding: 0;\n font-weight: 500;\n }\n h4.prevNext-title {\n padding: 0;\n font-size: 1rem;\n font-weight: 500;\n }\n .article-wrapper {\n border: 1px solid #252525;\n border-radius: 5px;\n padding: 1rem 1rem 0 1rem;\n margin-bottom: 1rem;\n }\n .prevNext-reading {\n margin-top: -10px;\n width: 75%;\n text-align: center;\n background: white;\n border: 1px solid #252525;\n align-self: center;\n display: none;\n }\n .showReading {\n display: block;\n }\n .author-details-wrapper a {\n color: #252525;\n }\n .objective-prevNext-Wrapper {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n .objective-title {\n padding: 0 !important;\n }\n .prevNext-thumbnail {\n display: flex;\n flex-direction: column;\n min-width: 225px;\n max-width: 225px;\n overflow: hidden;\n align-items: center;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-thumbnail img {\n height: 125px;\n object-fit: contain;\n border-radius: 15px;\n }\n .prevNext-summary {\n text-align: center;\n }\n .prevNext-publishDate {\n font-size: 0.75rem;\n margin-top: 0.5rem;\n }\n .prevNext-title {\n padding: 0 !important;\n line-height: 1 !important;\n font-weight: 500;\n }\n .prevNextWrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-evenly;\n flex-wrap: wrap;\n }\n .prevNextWrapper a {\n display: flex;\n flex-direction: column;\n color: #252525;\n align-items: center;\n }\n .prevNextCards {\n max-width: 250px;\n margin-bottom: 1rem;\n }\n @media only screen and (max-width: 568px) {\n .prevNextWrapper {\n flex-direction: column;\n align-items: center;\n }\n .prevNextCards {\n margin-bottom: 2rem;\n }\n }\n @media only screen and (max-width: 568px) {\n }\n '
8424
8465
  )
8425
8466
  )
8426
8467
  );