@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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.690
2
+ # mjh-framework v. 1.0.693
3
3
 
4
4
  > Foundation Framework
5
5
 
@@ -11,7 +11,7 @@ var React = require('react');
11
11
  var React__default = _interopDefault(React);
12
12
  var slicedToArray = require('./slicedToArray-8f385299.js');
13
13
  require('./iconBase-68959171.js');
14
- var index_esm = require('./index.esm-876ca9ff.js');
14
+ var index_esm = require('./index.esm-90433435.js');
15
15
  var Accordion = _interopDefault(require('react-bootstrap/Accordion'));
16
16
  var AccordionToggle = require('react-bootstrap/AccordionToggle');
17
17
 
@@ -20,7 +20,7 @@ var React__default = _interopDefault(React);
20
20
  var index = require('./index-2d0a4911.js');
21
21
  require('prop-types');
22
22
  var Container = _interopDefault(require('react-bootstrap/Container'));
23
- require('./moment-66a6a284.js');
23
+ var moment = require('./moment-66a6a284.js');
24
24
  var Router = require('next/router');
25
25
  var Router__default = _interopDefault(Router);
26
26
  require('./isSymbol-04666465.js');
@@ -34,7 +34,7 @@ require('./slicedToArray-8f385299.js');
34
34
  require('./smoothscroll-95231a70.js');
35
35
  var YoutubeGroup = require('./YoutubeGroup.js');
36
36
  require('./iconBase-68959171.js');
37
- var index_esm = require('./index.esm-876ca9ff.js');
37
+ var index_esm = require('./index.esm-90433435.js');
38
38
 
39
39
  var ArticleSeriesListing = function (_React$Component) {
40
40
  inherits._inherits(ArticleSeriesListing, _React$Component);
@@ -50,8 +50,29 @@ var ArticleSeriesListing = function (_React$Component) {
50
50
  args[_key] = arguments[_key];
51
51
  }
52
52
 
53
- return _ret = (_temp = (_this = inherits._possibleConstructorReturn(this, (_ref = ArticleSeriesListing.__proto__ || inherits._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 = {
54
- data: _this.dataArr,
53
+ return _ret = (_temp = (_this = inherits._possibleConstructorReturn(this, (_ref = ArticleSeriesListing.__proto__ || inherits._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.moment().utc().format(), _this.dataArr = [_this.data], _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
54
+ data: _this.dataArr.map(function (item) {
55
+ var tempObj = item;
56
+ if (tempObj.body) {
57
+ var filteredBody = tempObj.body.map(function (item) {
58
+ if (item._type === 'articleSeries') {
59
+ var innerObj = item;
60
+ var filteredArticles = innerObj.articles.filter(function (article) {
61
+ if ((article.is_visible === true || !article.hasOwnProperty('is_visible')) && _this.today >= article.published) {
62
+ return article;
63
+ }
64
+ });
65
+ innerObj.body = filteredArticles;
66
+ return innerObj;
67
+ } else {
68
+ return item;
69
+ }
70
+ });
71
+
72
+ tempObj.body = filteredBody;
73
+ }
74
+ return tempObj;
75
+ }),
55
76
  per: _this.params ? _this.params.to : 2,
56
77
  page: _this.props.currentPage || 1,
57
78
  from: _this.params ? _this.params.from : 0,
@@ -44,9 +44,11 @@ var BlockContent = require('./BlockContent-88f69acd.js');
44
44
  require('./smoothscroll-95231a70.js');
45
45
  require('./GroupDeck.js');
46
46
  require('react-bootstrap');
47
+ require('./iconBase-68959171.js');
48
+ require('./index.esm-90433435.js');
47
49
  var Button = _interopDefault(require('react-bootstrap/Button'));
48
50
  var index$3 = require('./index-5be2866f.js');
49
- var getSerializers = require('./index-44c25825.js');
51
+ var getSerializers = require('./index-59436c13.js');
50
52
  require('./util-f2c1b65b.js');
51
53
  require('./brightcove-react-player-loader.es-156bd4d6.js');
52
54
  require('react-bootstrap/Pagination');
@@ -22,7 +22,7 @@ require('./_set-species-f92c67c5.js');
22
22
  var Segment = require('./Segment.js');
23
23
  require('./react-social-icons-f7f48f71.js');
24
24
  require('./iconBase-68959171.js');
25
- var index_esm = require('./index.esm-876ca9ff.js');
25
+ var index_esm = require('./index.esm-90433435.js');
26
26
  require('react-bootstrap/Button');
27
27
  require('react-bootstrap/Form');
28
28
  var Nav = _interopDefault(require('react-bootstrap/Nav'));
@@ -22,7 +22,7 @@ require('./_set-species-f92c67c5.js');
22
22
  var Segment = require('./Segment.js');
23
23
  require('./react-social-icons-f7f48f71.js');
24
24
  require('./iconBase-68959171.js');
25
- var index_esm = require('./index.esm-876ca9ff.js');
25
+ var index_esm = require('./index.esm-90433435.js');
26
26
  require('react-bootstrap/Button');
27
27
  require('react-bootstrap/Form');
28
28
  var Nav = _interopDefault(require('react-bootstrap/Nav'));
@@ -157,6 +157,9 @@ var NavNative = function NavNative(props) {
157
157
  var toggleClass = function toggleClass(selector, type, addOn) {
158
158
  if (type === 'id') {
159
159
  var searchBar = document.getElementById(selector);
160
+ // Aligning search bar below the searchbutton
161
+ var socialComponent = document.getElementById('search-content-desktop').getBoundingClientRect();
162
+ searchBar.style.right = window.innerWidth - socialComponent.left + 'px';
160
163
  if (searchBar && searchBar.classList && searchBar.classList.contains(addOn)) {
161
164
  searchBar.classList.remove(addOn);
162
165
  } else if (searchBar && searchBar.classList) {
@@ -226,7 +229,31 @@ var NavNative = function NavNative(props) {
226
229
  } else if (type === 'desktop') {
227
230
  return React__default.createElement(
228
231
  'div',
229
- { id: 'search-content-desktop' },
232
+ null,
233
+ React__default.createElement(
234
+ 'div',
235
+ { id: 'search-content-desktop' },
236
+ React__default.createElement(
237
+ iconBase.IconContext.Provider,
238
+ { value: { color: socialIconVariant === 'light' ? 'white' : 'black', className: 'search-btn-desktop', size: '50px' } },
239
+ React__default.createElement(index_esm$2.GoSearch, {
240
+ onClick: function onClick() {
241
+ toggleClass('search-bar-desktop', 'id', 'show');
242
+ toggleClass('search-btn-desktop', 'class', 'active-search');
243
+ }
244
+ })
245
+ ),
246
+ website && website.socialLinks && website.socialLinks.length !== 0 && React__default.createElement(
247
+ 'div',
248
+ { id: 'social-tab-desktop', style: { display: 'flex' } },
249
+ website.socialLinks && React__default.createElement(SocialIcons, { socialLinks: website.socialLinks, variant: socialIconVariant })
250
+ ),
251
+ React__default.createElement(
252
+ 'style',
253
+ { jsx: 'true' },
254
+ '\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 '
255
+ )
256
+ ),
230
257
  React__default.createElement(
231
258
  'div',
232
259
  { id: 'search-bar-desktop' },
@@ -246,26 +273,6 @@ var NavNative = function NavNative(props) {
246
273
  'Search'
247
274
  )
248
275
  )
249
- ),
250
- React__default.createElement(
251
- iconBase.IconContext.Provider,
252
- { value: { color: socialIconVariant === 'light' ? 'white' : 'black', className: 'search-btn-desktop', size: '50px' } },
253
- React__default.createElement(index_esm$2.GoSearch, {
254
- onClick: function onClick() {
255
- toggleClass('search-bar-desktop', 'id', 'show');
256
- toggleClass('search-btn-desktop', 'class', 'active-search');
257
- }
258
- })
259
- ),
260
- website && website.socialLinks && website.socialLinks.length !== 0 && React__default.createElement(
261
- 'div',
262
- { id: 'social-tab-desktop', style: { display: 'flex' } },
263
- website.socialLinks && React__default.createElement(SocialIcons, { socialLinks: website.socialLinks, variant: socialIconVariant })
264
- ),
265
- React__default.createElement(
266
- 'style',
267
- { jsx: 'true' },
268
- '\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 '
269
276
  )
270
277
  );
271
278
  }
@@ -54,8 +54,10 @@ require('./GroupDeck.js');
54
54
  require('react-bootstrap');
55
55
  require('./timeDifferenceCalc.js');
56
56
  var QueueDeckExpanded = require('./QueueDeckExpanded.js');
57
+ require('./iconBase-68959171.js');
58
+ require('./index.esm-90433435.js');
57
59
  require('react-bootstrap/Button');
58
- var getSerializers = require('./index-44c25825.js');
60
+ var getSerializers = require('./index-59436c13.js');
59
61
  require('./util-f2c1b65b.js');
60
62
  require('./brightcove-react-player-loader.es-156bd4d6.js');
61
63
  require('react-bootstrap/Pagination');
@@ -33,7 +33,7 @@ require('./get-68c52cb1.js');
33
33
  require('./react-social-icons-f7f48f71.js');
34
34
  require('react-bootstrap');
35
35
  require('./iconBase-68959171.js');
36
- require('./index.esm-876ca9ff.js');
36
+ require('./index.esm-90433435.js');
37
37
  require('react-bootstrap/Button');
38
38
  require('./defineProperty-55548b25.js');
39
39
  require('react-bootstrap/Form');
@@ -12,7 +12,7 @@ var React__default = _interopDefault(React);
12
12
  var main = require('./main-b6c96c8d.js');
13
13
  var slicedToArray = require('./slicedToArray-8f385299.js');
14
14
  require('./iconBase-68959171.js');
15
- var index_esm = require('./index.esm-876ca9ff.js');
15
+ var index_esm = require('./index.esm-90433435.js');
16
16
  var index_esm$3 = require('./index.esm-ff47db6f.js');
17
17
 
18
18
  var Ustream = function Ustream(_ref) {
@@ -20,6 +20,7 @@ var React__default = _interopDefault(React);
20
20
  var index = require('./index-2d0a4911.js');
21
21
  require('prop-types');
22
22
  var Container = _interopDefault(require('react-bootstrap/Container'));
23
+ var moment = require('./moment-66a6a284.js');
23
24
  var Router = require('next/router');
24
25
  var Router__default = _interopDefault(Router);
25
26
  require('./isSymbol-04666465.js');
@@ -33,7 +34,7 @@ require('./slicedToArray-8f385299.js');
33
34
  require('./smoothscroll-95231a70.js');
34
35
  var YoutubeGroup = require('./YoutubeGroup.js');
35
36
  require('./iconBase-68959171.js');
36
- var index_esm = require('./index.esm-876ca9ff.js');
37
+ var index_esm = require('./index.esm-90433435.js');
37
38
 
38
39
  var VideoSeriesListing = function (_React$Component) {
39
40
  inherits._inherits(VideoSeriesListing, _React$Component);
@@ -49,8 +50,29 @@ var VideoSeriesListing = function (_React$Component) {
49
50
  args[_key] = arguments[_key];
50
51
  }
51
52
 
52
- return _ret = (_temp = (_this = inherits._possibleConstructorReturn(this, (_ref = VideoSeriesListing.__proto__ || inherits._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 = {
53
- data: _this.dataArr,
53
+ return _ret = (_temp = (_this = inherits._possibleConstructorReturn(this, (_ref = VideoSeriesListing.__proto__ || inherits._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.moment().utc().format(), _this.dataArr = [_this.data], _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
54
+ data: _this.dataArr.map(function (item) {
55
+ var tempObj = item;
56
+ if (tempObj.body) {
57
+ var filteredBody = tempObj.body.map(function (item) {
58
+ if (item._type === 'articleSeries') {
59
+ var innerObj = item;
60
+ var filteredArticles = innerObj.articles.filter(function (article) {
61
+ if ((article.is_visible === true || !article.hasOwnProperty('is_visible')) && (_this.today >= article.published || !article.hasOwnProperty('published'))) {
62
+ return article;
63
+ }
64
+ });
65
+ innerObj.body = filteredArticles;
66
+ return innerObj;
67
+ } else {
68
+ return item;
69
+ }
70
+ });
71
+
72
+ tempObj.body = filteredBody;
73
+ }
74
+ return tempObj;
75
+ }),
54
76
  per: _this.params ? _this.params.to : 2,
55
77
  page: _this.props.currentPage || 1,
56
78
  from: _this.params ? _this.params.from : 0,
@@ -323,7 +345,16 @@ var VideoSeriesListing = function (_React$Component) {
323
345
  'button',
324
346
  {
325
347
  className: 'btn',
326
- 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' },
348
+ style: {
349
+ margin: '0 auto 2rem',
350
+ display: 'block',
351
+ fontSize: '18px',
352
+ padding: '.5rem 1.5rem',
353
+ boxShadow: '1px 2px 4px 4px rgba(0,0,0,.15)',
354
+ background: 'var(--primary)',
355
+ color: '#fff',
356
+ borderRadius: '5px'
357
+ },
327
358
  onClick: function onClick(e) {
328
359
  e.target.style.display = 'none';
329
360
  _this2.loadMore();
package/dist/cjs/View.js CHANGED
@@ -46,10 +46,11 @@ require('./smoothscroll-95231a70.js');
46
46
  require('./GroupDeck.js');
47
47
  require('react-bootstrap');
48
48
  require('./iconBase-68959171.js');
49
+ require('./index.esm-90433435.js');
49
50
  var Button = _interopDefault(require('react-bootstrap/Button'));
50
51
  var defineProperty$1 = require('./defineProperty-55548b25.js');
51
52
  var Form = _interopDefault(require('react-bootstrap/Form'));
52
- var getSerializers = require('./index-44c25825.js');
53
+ var getSerializers = require('./index-59436c13.js');
53
54
  require('./util-f2c1b65b.js');
54
55
  require('./brightcove-react-player-loader.es-156bd4d6.js');
55
56
  require('react-bootstrap/Pagination');
@@ -40,8 +40,10 @@ require('./BlockContent-88f69acd.js');
40
40
  require('./smoothscroll-95231a70.js');
41
41
  require('./GroupDeck.js');
42
42
  require('react-bootstrap');
43
+ require('./iconBase-68959171.js');
44
+ require('./index.esm-90433435.js');
43
45
  require('react-bootstrap/Button');
44
- var getSerializers = require('./index-44c25825.js');
46
+ var getSerializers = require('./index-59436c13.js');
45
47
  require('./util-f2c1b65b.js');
46
48
  require('./brightcove-react-player-loader.es-156bd4d6.js');
47
49
  require('react-bootstrap/Pagination');
@@ -29,6 +29,7 @@ var BlockContent = require('./BlockContent-88f69acd.js');
29
29
  var smoothscroll = require('./smoothscroll-95231a70.js');
30
30
  var GroupDeck = require('./GroupDeck.js');
31
31
  var reactBootstrap = require('react-bootstrap');
32
+ var index_esm = require('./index.esm-90433435.js');
32
33
  var Button = _interopDefault(require('react-bootstrap/Button'));
33
34
  var util = require('./util-f2c1b65b.js');
34
35
  var brightcoveReactPlayerLoader_es = require('./brightcove-react-player-loader.es-156bd4d6.js');
@@ -8026,6 +8027,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8026
8027
  return null;
8027
8028
  }
8028
8029
  nodes.seriesTitle = !nodes.seriesTitle ? 'Learning Objectives' : nodes.seriesTitle;
8030
+ var today = moment.moment().utc().format();
8029
8031
 
8030
8032
  var authorPrefix = 'authors';
8031
8033
  var builder = index$1.imageUrlBuilder(client);
@@ -8036,28 +8038,38 @@ var ArticleSeries = function ArticleSeries(_ref) {
8036
8038
 
8037
8039
  var refArray = React.useRef([]);
8038
8040
  var adRefArray = React.useRef([]);
8041
+ var articleContainerRef = React.useRef(null);
8042
+ var arrowRef = React.useRef(null);
8039
8043
 
8040
- var _ref2 = main.main_39 ? React.useState(100) : React.useState(-25),
8041
- _ref3 = slicedToArray._slicedToArray(_ref2, 2),
8042
- NavoffsetTop = _ref3[0],
8043
- setNavoffsetTop = _ref3[1];
8044
+ var _useState = React.useState(0),
8045
+ _useState2 = slicedToArray._slicedToArray(_useState, 2),
8046
+ contentWidth = _useState2[0],
8047
+ setContentWidth = _useState2[1];
8048
+
8049
+ var upArrowClicked = false;
8050
+
8051
+ var Articles = nodes.articles.filter(function (article) {
8052
+ if ((article.is_visible === true || !article.hasOwnProperty('is_visible')) && today >= article.published) {
8053
+ return article;
8054
+ }
8055
+ });
8044
8056
 
8045
8057
  var PrevNextCards = function PrevNextCards(show, articleNum) {
8046
8058
  var articles = [];
8047
8059
  if (articleNum >= 0) {
8048
8060
  if (articleNum == 0) {
8049
- articles.push(nodes.articles[1]);
8050
- } else if (articleNum == nodes.articles.length - 1) {
8051
- articles.push(nodes.articles[articleNum - 1]);
8061
+ articles.push(Articles[1]);
8062
+ } else if (articleNum == Articles.length - 1) {
8063
+ articles.push(Articles[articleNum - 1]);
8052
8064
  } else {
8053
- articles.push(nodes.articles[articleNum - 1]);
8054
- articles.push(nodes.articles[articleNum + 1]);
8065
+ articles.push(Articles[articleNum - 1]);
8066
+ articles.push(Articles[articleNum + 1]);
8055
8067
  }
8056
8068
  } else {
8057
- articles = [].concat(toConsumableArray._toConsumableArray(nodes.articles));
8069
+ articles = [].concat(toConsumableArray._toConsumableArray(Articles));
8058
8070
  }
8059
8071
  return articles.map(function (article, index) {
8060
- if (!article) return null;
8072
+ if (!article || !article.is_visible && article.hasOwnProperty('is_visible') || today < article.published) return null;
8061
8073
  var showReading = show ? 'showReading' : '';
8062
8074
  var articleLabel = articles.length == 1 && articleNum != 0 || articles.length > 1 && index == 0 ? 'Previous' : 'Next';
8063
8075
  return React__default.createElement(
@@ -8097,35 +8109,35 @@ var ArticleSeries = function ArticleSeries(_ref) {
8097
8109
  });
8098
8110
  };
8099
8111
 
8100
- var _ref4 = router && router.asPath && router.asPath.split('?')[1] ? React.useState(router.asPath.split('=')[1]) : React.useState(null),
8101
- _ref5 = slicedToArray._slicedToArray(_ref4, 2),
8102
- selectedArticle = _ref5[0],
8103
- setSelectedArticle = _ref5[1];
8104
-
8105
- var _useState = React.useState(false),
8106
- _useState2 = slicedToArray._slicedToArray(_useState, 2),
8107
- firstLoad = _useState2[0],
8108
- setFirstLoad = _useState2[1];
8112
+ var _ref2 = router && router.asPath && router.asPath.split('?')[1] ? React.useState(router.asPath.split('=')[1]) : React.useState(null),
8113
+ _ref3 = slicedToArray._slicedToArray(_ref2, 2),
8114
+ selectedArticle = _ref3[0],
8115
+ setSelectedArticle = _ref3[1];
8109
8116
 
8110
- var _useState3 = React.useState(null),
8117
+ var _useState3 = React.useState(false),
8111
8118
  _useState4 = slicedToArray._slicedToArray(_useState3, 2),
8112
- currentURL = _useState4[0],
8113
- setCurrentURL = _useState4[1];
8119
+ firstLoad = _useState4[0],
8120
+ setFirstLoad = _useState4[1];
8114
8121
 
8115
8122
  var _useState5 = React.useState(null),
8116
8123
  _useState6 = slicedToArray._slicedToArray(_useState5, 2),
8117
- currentTitle = _useState6[0],
8118
- setCurrentTitle = _useState6[1];
8124
+ currentURL = _useState6[0],
8125
+ setCurrentURL = _useState6[1];
8119
8126
 
8120
8127
  var _useState7 = React.useState(null),
8121
8128
  _useState8 = slicedToArray._slicedToArray(_useState7, 2),
8122
- currentSummary = _useState8[0],
8123
- setCurrentSummary = _useState8[1];
8129
+ currentTitle = _useState8[0],
8130
+ setCurrentTitle = _useState8[1];
8124
8131
 
8125
8132
  var _useState9 = React.useState(null),
8126
8133
  _useState10 = slicedToArray._slicedToArray(_useState9, 2),
8127
- currentThumbnail = _useState10[0],
8128
- setCurrentThumbnail = _useState10[1];
8134
+ currentSummary = _useState10[0],
8135
+ setCurrentSummary = _useState10[1];
8136
+
8137
+ var _useState11 = React.useState(null),
8138
+ _useState12 = slicedToArray._slicedToArray(_useState11, 2),
8139
+ currentThumbnail = _useState12[0],
8140
+ setCurrentThumbnail = _useState12[1];
8129
8141
 
8130
8142
  var articleCardClickHandler = function articleCardClickHandler(e) {
8131
8143
  e.preventDefault();
@@ -8133,15 +8145,6 @@ var ArticleSeries = function ArticleSeries(_ref) {
8133
8145
  setSelectedArticle(articleClicked);
8134
8146
  scrollToArticle(articleClicked);
8135
8147
  };
8136
-
8137
- React.useEffect(function () {
8138
- try {
8139
- if (main.main_39) {
8140
- setNavoffsetTop(document.getElementById('navbar-ham').offsetHeight - 15);
8141
- }
8142
- } catch (e) {}
8143
- }, []);
8144
-
8145
8148
  var scrollToArticle = function scrollToArticle(id) {
8146
8149
  var localArticleID = id ? id : selectedArticle;
8147
8150
  var findArticle = function findArticle(ref) {
@@ -8153,8 +8156,12 @@ var ArticleSeries = function ArticleSeries(_ref) {
8153
8156
  var indexOfRef = refArray.current.findIndex(findArticle);
8154
8157
 
8155
8158
  if (indexOfRef >= 0) {
8156
- //refArray.current[indexOfRef].wraperRef.current.scrollIntoView({ behavior: 'smooth' })
8157
- window.scrollTo({ top: refArray.current[indexOfRef].wraperRef.current.offsetTop - NavoffsetTop, behavior: 'smooth' });
8159
+ var newOffsetTop = !firstLoad ? refArray.current[indexOfRef].wraperRef.current.offsetTop : refArray.current[indexOfRef].wraperRef.current.offsetTop + document.getElementsByTagName('header')[0].clientHeight;
8160
+ console.dir(refArray.current[indexOfRef].wraperRef.current);
8161
+ console.log(document.getElementsByTagName('header')[0].clientHeight);
8162
+ console.log(refArray.current[indexOfRef].wraperRef.current.offsetTop);
8163
+ window.scrollTo({ top: newOffsetTop, behavior: 'smooth' });
8164
+ //refArray.current[indexOfRef].wraperRef.current.scrollIntoView({ behavior: 'smooth', block: 'start' })
8158
8165
  }
8159
8166
  setFirstLoad(true);
8160
8167
  };
@@ -8202,13 +8209,24 @@ var ArticleSeries = function ArticleSeries(_ref) {
8202
8209
 
8203
8210
  var scrollDirectionDetect = function scrollDirectionDetect(e) {
8204
8211
  var window = e.currentTarget;
8205
-
8206
8212
  if (preVscroll > window.scrollY) {
8207
8213
  isScrollDown = false;
8208
- } else if (preVscroll < window.scrollY) {
8214
+ if (window.scrollY > articleContainerRef.current.offsetTop) {
8215
+ arrowRef.current.classList.add('showArrow');
8216
+ arrowRef.current.classList.remove('hideArrow');
8217
+ }
8218
+ } else if (preVscroll > window.scrollY) {
8209
8219
  isScrollDown = true;
8210
8220
  }
8211
8221
  preVscroll = window.scrollY;
8222
+ setContentWidth(articleContainerRef.current.offsetWidth);
8223
+ if (preVscroll <= articleContainerRef.current.offsetTop) {
8224
+ arrowRef.current.classList.remove('showArrow');
8225
+ arrowRef.current.classList.add('hideArrow');
8226
+ }
8227
+ if (window.scrollY === 0 && upArrowClicked === true) {
8228
+ upArrowClicked = false;
8229
+ }
8212
8230
  };
8213
8231
 
8214
8232
  React.useEffect(function () {
@@ -8218,7 +8236,8 @@ var ArticleSeries = function ArticleSeries(_ref) {
8218
8236
  };
8219
8237
  });
8220
8238
 
8221
- React.useEffect(function () {
8239
+ React.useLayoutEffect(function () {
8240
+ console.log('useLayoutEffect');
8222
8241
  if (!firstLoad) {
8223
8242
  if (main.main_39) {
8224
8243
  grabLoadedAds();
@@ -8226,10 +8245,9 @@ var ArticleSeries = function ArticleSeries(_ref) {
8226
8245
  scrollToArticle();
8227
8246
  }
8228
8247
  }
8229
- }, []);
8248
+ });
8230
8249
 
8231
8250
  var grabLoadedAds = function grabLoadedAds() {
8232
- console.dir(index.lib_3);
8233
8251
  index.lib_3.getGoogletag().then(function (googletag) {
8234
8252
  var checkIfReady = window.setInterval(function () {
8235
8253
  if (window.googletag && googletag.pubadsReady) {
@@ -8262,9 +8280,26 @@ var ArticleSeries = function ArticleSeries(_ref) {
8262
8280
  }
8263
8281
  };
8264
8282
 
8283
+ var handleArrowClick = function handleArrowClick() {
8284
+ isScrollDown = true;
8285
+ upArrowClicked = true;
8286
+ arrowRef.current.classList.add('hideArrow');
8287
+ arrowRef.current.classList.remove('showArrow');
8288
+ window.scrollTo({ top: 0, behavior: 'smooth' });
8289
+ window.history.pushState({}, '', router.asPath.split('?')[0]);
8290
+ document.title = nodes.seriesTitle;
8291
+ };
8292
+
8265
8293
  return React__default.createElement(
8266
8294
  React__default.Fragment,
8267
8295
  null,
8296
+ React__default.createElement(
8297
+ 'div',
8298
+ { ref: arrowRef, className: 'scrollToTopArrow hideArrow', onClick: function onClick() {
8299
+ return handleArrowClick();
8300
+ } },
8301
+ React__default.createElement(index_esm.IoIosArrowDropupCircle, null)
8302
+ ),
8268
8303
  React__default.createElement('hr', { className: 'article-seperater my-4' }),
8269
8304
  React__default.createElement(
8270
8305
  'div',
@@ -8308,8 +8343,8 @@ var ArticleSeries = function ArticleSeries(_ref) {
8308
8343
  ),
8309
8344
  React__default.createElement(
8310
8345
  'div',
8311
- { className: 'article-container', style: { marginBottom: '2rem' } },
8312
- nodes.articles.map(function (article, index) {
8346
+ { ref: articleContainerRef, className: 'article-container', style: { marginBottom: '2rem' } },
8347
+ Articles.map(function (article, index) {
8313
8348
  return React__default.createElement(
8314
8349
  'div',
8315
8350
  { key: article.title },
@@ -8324,8 +8359,10 @@ var ArticleSeries = function ArticleSeries(_ref) {
8324
8359
  return refArray.current[index] = ele;
8325
8360
  },
8326
8361
  onChange: function onChange(visible) {
8327
- if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
8328
- onChangeArticle(article.param.current, visible, article.title, article.summary, urlFor(article.thumbnail.asset).url());
8362
+ if (!upArrowClicked) {
8363
+ if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
8364
+ onChangeArticle(article.param.current, visible, article.title, article.summary, urlFor(article.thumbnail.asset).url());
8365
+ }
8329
8366
  }
8330
8367
  } },
8331
8368
  React__default.createElement(
@@ -8380,26 +8417,30 @@ var ArticleSeries = function ArticleSeries(_ref) {
8380
8417
  }, client.config())),
8381
8418
  React__default.createElement('hr', { className: 'article-seperater my-4' })
8382
8419
  ),
8383
- React__default.createElement(
8384
- 'div',
8385
- { className: 'objective-prevNext-Wrapper' },
8386
- React__default.createElement(
8387
- 'h5',
8388
- { className: 'objective-title' },
8389
- nodes.seriesTitle
8390
- ),
8420
+ Articles.length > 1 && React__default.createElement(
8421
+ React__default.Fragment,
8422
+ null,
8391
8423
  React__default.createElement(
8392
8424
  'div',
8393
- { className: 'prevNextWrapper' },
8394
- PrevNextCards(true, index)
8395
- )
8396
- ),
8397
- React__default.createElement('hr', { className: 'article-seperater' })
8425
+ { className: 'objective-prevNext-Wrapper' },
8426
+ React__default.createElement(
8427
+ 'h5',
8428
+ { className: 'objective-title' },
8429
+ nodes.seriesTitle
8430
+ ),
8431
+ React__default.createElement(
8432
+ 'div',
8433
+ { className: 'prevNextWrapper' },
8434
+ PrevNextCards(true, index)
8435
+ )
8436
+ ),
8437
+ React__default.createElement('hr', { className: 'article-seperater' })
8438
+ )
8398
8439
  ),
8399
8440
  React__default.createElement(
8400
8441
  'div',
8401
8442
  { className: 'ad-box', style: { textAlign: 'center' } },
8402
- main.main_39 && nodes.articles.length - 1 !== index && Ads.map(function (ad, innerIndex) {
8443
+ main.main_39 && Articles.length - 1 !== index && Ads.map(function (ad, innerIndex) {
8403
8444
  if (innerIndex === 0) {
8404
8445
  return React__default.createElement(
8405
8446
  'div',
@@ -8427,7 +8468,7 @@ var ArticleSeries = function ArticleSeries(_ref) {
8427
8468
  React__default.createElement(
8428
8469
  'style',
8429
8470
  { jsx: 'true' },
8430
- '\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 '
8471
+ '\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 '
8431
8472
  )
8432
8473
  )
8433
8474
  );
@@ -3,6 +3,10 @@
3
3
  var iconBase = require('./iconBase-68959171.js');
4
4
 
5
5
  // THIS FILE IS AUTO GENERATED
6
+ var IoIosArrowDropupCircle = function (props) {
7
+ return iconBase.GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M256 464c114.9 0 208-93.1 208-208S370.9 48 256 48 48 141.1 48 256s93.1 208 208 208zm0-244.5l-81.1 81.9c-7.5 7.5-19.8 7.5-27.3 0s-7.5-19.8 0-27.3l95.7-95.4c7.3-7.3 19.1-7.5 26.6-.6l94.3 94c3.8 3.8 5.7 8.7 5.7 13.7 0 4.9-1.9 9.9-5.6 13.6-7.5 7.5-19.7 7.6-27.3 0l-81-79.9z"}}]})(props);
8
+ };
9
+ IoIosArrowDropupCircle.displayName = "IoIosArrowDropupCircle";
6
10
  var IoIosArrowForward = function (props) {
7
11
  return iconBase.GenIcon({"tag":"svg","attr":{"viewBox":"0 0 512 512"},"child":[{"tag":"path","attr":{"d":"M294.1 256L167 129c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.3 34 0L345 239c9.1 9.1 9.3 23.7.7 33.1L201.1 417c-4.7 4.7-10.9 7-17 7s-12.3-2.3-17-7c-9.4-9.4-9.4-24.6 0-33.9l127-127.1z"}}]})(props);
8
12
  };
@@ -20,6 +24,7 @@ var IoMdLogIn = function (props) {
20
24
  };
21
25
  IoMdLogIn.displayName = "IoMdLogIn";
22
26
 
27
+ exports.IoIosArrowDropupCircle = IoIosArrowDropupCircle;
23
28
  exports.IoIosArrowForward = IoIosArrowForward;
24
29
  exports.IoIosOpen = IoIosOpen;
25
30
  exports.IoMdArrowDropdown = IoMdArrowDropdown;