@mjhls/mjh-framework 1.0.93 → 1.0.95

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/index.js CHANGED
@@ -14,7 +14,8 @@ var Col = _interopDefault(require('react-bootstrap/Col'));
14
14
  var Card = _interopDefault(require('react-bootstrap/Card'));
15
15
  var moment = _interopDefault(require('moment'));
16
16
  var Link = _interopDefault(require('next/link'));
17
- var router = require('next/router');
17
+ var Router = require('next/router');
18
+ var Router__default = _interopDefault(Router);
18
19
  var Media = _interopDefault(require('react-bootstrap/Media'));
19
20
  var reactBootstrap = require('react-bootstrap');
20
21
  var ListGroup = _interopDefault(require('react-bootstrap/ListGroup'));
@@ -29,6 +30,7 @@ var Nav = _interopDefault(require('react-bootstrap/Nav'));
29
30
  var Navbar = _interopDefault(require('react-bootstrap/Navbar'));
30
31
  var NavDropdown = _interopDefault(require('react-bootstrap/NavDropdown'));
31
32
  var Carousel = _interopDefault(require('react-bootstrap/Carousel'));
33
+ var Breadcrumb = _interopDefault(require('react-bootstrap/Breadcrumb'));
32
34
 
33
35
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
34
36
 
@@ -3896,19 +3898,19 @@ var DeckContent = function (_React$Component) {
3896
3898
  var _this$props = _this.props,
3897
3899
  seoPaginate = _this$props.seoPaginate,
3898
3900
  pageview = _this$props.pageview,
3899
- router$$1 = _this$props.router;
3901
+ router = _this$props.router;
3900
3902
  var currentPage = _this.state.currentPage;
3901
3903
 
3902
3904
  if (seoPaginate) {
3903
- var path = router$$1.asPath;
3905
+ var path = router.asPath;
3904
3906
  var qrIndex = path.indexOf('?');
3905
- var pathname = router$$1.pathname;
3907
+ var pathname = router.pathname;
3906
3908
  var queryString = '';
3907
3909
 
3908
3910
  if (qrIndex > 0) {
3909
3911
  path = path.substring(1, qrIndex);
3910
3912
 
3911
- var partialQS = router$$1.asPath.substring(qrIndex + 1);
3913
+ var partialQS = router.asPath.substring(qrIndex + 1);
3912
3914
  var partialQSArr = partialQS.split('&');
3913
3915
 
3914
3916
  // exclude page=xxx from query string
@@ -3954,7 +3956,7 @@ var DeckContent = function (_React$Component) {
3954
3956
 
3955
3957
  pageview(newPath);
3956
3958
 
3957
- router$$1.push(pathname, newPath, {
3959
+ router.push(pathname, newPath, {
3958
3960
  shallow: true
3959
3961
  });
3960
3962
  });
@@ -3979,8 +3981,7 @@ var DeckContent = function (_React$Component) {
3979
3981
  }
3980
3982
 
3981
3983
  var pageNumber = row.pageNumber || _this.state.page;
3982
- var contentCategoryName = row.contentCategory ? row.contentCategory.name : 'Articles';
3983
-
3984
+ var contentCategoryName = row.contentCategory && row.contentCategory.name && _this.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
3984
3985
  return React__default.createElement(
3985
3986
  VisibilitySensor,
3986
3987
  {
@@ -4151,7 +4152,7 @@ var DeckContent = function (_React$Component) {
4151
4152
  return DeckContent;
4152
4153
  }(React__default.Component);
4153
4154
 
4154
- var ContentCard = router.withRouter(DeckContent);
4155
+ var ContentCard = Router.withRouter(DeckContent);
4155
4156
 
4156
4157
  /**
4157
4158
  * Checks if `value` is classified as an `Array` object.
@@ -5157,66 +5158,62 @@ var GridContent = function (_React$Component) {
5157
5158
  return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = GridContent.__proto__ || Object.getPrototypeOf(GridContent)).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.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
5158
5159
  data: _this.data,
5159
5160
  per: _this.params ? _this.params.to : 2,
5160
- page: 1,
5161
+ page: _this.props.currentPage || 1,
5161
5162
  from: _this.params ? _this.params.from : 0,
5162
5163
  to: _this.params ? _this.params.to : 2,
5163
5164
  total_pages: null,
5164
5165
  scrolling: true,
5165
- query: _this.query
5166
- }, _this.loadMore = function () {
5167
- setTimeout(function () {
5168
- _this.setState(function (state, props) {
5169
- return {
5170
- page: state.page + 1,
5171
- from: state.from + state.per,
5172
- to: state.to + state.per
5173
- };
5174
- }, _this.loadData);
5175
- }, 10);
5176
- }, _this.loadData = function () {
5166
+ query: _this.query,
5167
+ currentPage: _this.props.currentPage || 1
5168
+ }, _this.loadMore = debounce_1(function () {
5169
+ _this.setState(function (state) {
5170
+ var page = state.page,
5171
+ from = state.from,
5172
+ per = state.per,
5173
+ to = state.to;
5174
+
5175
+ return {
5176
+ page: page + 1,
5177
+ from: from + per,
5178
+ to: to + per
5179
+ };
5180
+ }, _this.loadData);
5181
+ }, 0), _this.loadData = function () {
5177
5182
  var _this$state = _this.state,
5178
5183
  from = _this$state.from,
5179
5184
  to = _this$state.to,
5180
5185
  data = _this$state.data,
5181
- query = _this$state.query;
5186
+ query = _this$state.query,
5187
+ page = _this$state.page;
5182
5188
  var client = _this.props.client;
5183
5189
 
5184
5190
 
5185
5191
  var params = _extends({}, _this.params, { from: from, to: to
5186
5192
  // const queryUpdated = query.replace('$from', params.from).replace('$to', params.to)
5187
-
5188
- });if (_this.pointer && _this.pointerArray) {
5189
- var pointer = _this.pointer;
5190
- client.fetch(query, params).then(function (dataArr) {
5191
- _this.setState(function (state, props) {
5192
- if (dataArr[_this.pointerArray][pointer].length > 0) {
5193
- return {
5194
- data: [].concat(toConsumableArray(data), toConsumableArray(dataArr[_this.pointerArray][pointer])),
5195
- scrolling: true
5196
- };
5197
- } else {
5198
- return {
5199
- scrolling: false
5200
- };
5201
- }
5193
+ });client.fetch(query, params).then(function (dataArr) {
5194
+ if (_this.pointer && _this.pointerArray) {
5195
+ var pointer = _this.pointer;
5196
+ dataArr = dataArr[_this.pointerArray][pointer];
5197
+ }
5198
+ dataArr = dataArr.map(function (item) {
5199
+ return _extends({}, item, {
5200
+ pageNumber: page
5202
5201
  });
5203
5202
  });
5204
- } else {
5205
- client.fetch(query, params).then(function (dataArr) {
5206
- _this.setState(function (state, props) {
5207
- if (dataArr.length > 0) {
5208
- return {
5209
- data: [].concat(toConsumableArray(data), toConsumableArray(dataArr)),
5210
- scrolling: true
5211
- };
5212
- } else {
5213
- return {
5214
- scrolling: false
5215
- };
5216
- }
5217
- });
5203
+
5204
+ _this.setState(function () {
5205
+ if (dataArr.length > 0) {
5206
+ return {
5207
+ data: [].concat(toConsumableArray(data), toConsumableArray(dataArr)),
5208
+ scrolling: true
5209
+ };
5210
+ } else {
5211
+ return {
5212
+ scrolling: false
5213
+ };
5214
+ }
5218
5215
  });
5219
- }
5216
+ });
5220
5217
  }, _this.urlFor = function (source) {
5221
5218
  var client = _this.props.client;
5222
5219
 
@@ -5232,19 +5229,19 @@ var GridContent = function (_React$Component) {
5232
5229
  var _this$props = _this.props,
5233
5230
  seoPaginate = _this$props.seoPaginate,
5234
5231
  pageview = _this$props.pageview,
5235
- router$$1 = _this$props.router;
5232
+ router = _this$props.router;
5236
5233
  var currentPage = _this.state.currentPage;
5237
5234
 
5238
5235
  if (seoPaginate) {
5239
- var path = router$$1.asPath;
5236
+ var path = router.asPath;
5240
5237
  var qrIndex = path.indexOf('?');
5241
- var pathname = router$$1.pathname;
5238
+ var pathname = router.pathname;
5242
5239
  var queryString = '';
5243
5240
 
5244
5241
  if (qrIndex > 0) {
5245
5242
  path = path.substring(1, qrIndex);
5246
5243
 
5247
- var partialQS = router$$1.asPath.substring(qrIndex + 1);
5244
+ var partialQS = router.asPath.substring(qrIndex + 1);
5248
5245
  var partialQSArr = partialQS.split('&');
5249
5246
 
5250
5247
  // exclude page=xxx from query string
@@ -5279,13 +5276,30 @@ var GridContent = function (_React$Component) {
5279
5276
 
5280
5277
  pageview(newPath);
5281
5278
 
5282
- router$$1.push(pathname, newPath, {
5279
+ router.push(pathname, newPath, {
5283
5280
  shallow: true
5284
5281
  });
5285
5282
  });
5286
5283
  }
5287
5284
  }
5288
5285
  }
5286
+ }, _this.renderManualPagination = function () {
5287
+ var currentPage = _this.state.currentPage;
5288
+
5289
+ return React__default.createElement(
5290
+ 'div',
5291
+ { className: 'd-flex justify-content-between' },
5292
+ currentPage && currentPage > 1 && React__default.createElement(
5293
+ 'a',
5294
+ { href: '?page=' + (currentPage - 1) },
5295
+ '<< Previous'
5296
+ ),
5297
+ React__default.createElement(
5298
+ 'a',
5299
+ { href: '?page=' + (currentPage + 1) },
5300
+ 'Next >>'
5301
+ )
5302
+ );
5289
5303
  }, _temp), possibleConstructorReturn(_this, _ret);
5290
5304
  }
5291
5305
 
@@ -5336,7 +5350,7 @@ var GridContent = function (_React$Component) {
5336
5350
  ),
5337
5351
  _this2.props.showPublished && row.published && React__default.createElement(
5338
5352
  Card.Subtitle,
5339
- null,
5353
+ { style: { marginTop: 0 } },
5340
5354
  moment(row.published).format('MMMM DD, YYYY')
5341
5355
  ),
5342
5356
  React__default.createElement(
@@ -5359,7 +5373,7 @@ var GridContent = function (_React$Component) {
5359
5373
  { className: 'grid-container' },
5360
5374
  this.state.data && this.state.data.map(function (row, index$$1) {
5361
5375
  var pageNumber = row.pageNumber || _this2.state.page;
5362
- var contentCategoryName = row.contentCategory ? row.contentCategory.name : 'Articles';
5376
+ var contentCategoryName = row.contentCategory && row.contentCategory.name && _this2.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
5363
5377
  return React__default.createElement(
5364
5378
  VisibilitySensor,
5365
5379
  {
@@ -5396,6 +5410,11 @@ var GridContent = function (_React$Component) {
5396
5410
  null,
5397
5411
  row.title
5398
5412
  ),
5413
+ _this2.props.showPublished && row.published && React__default.createElement(
5414
+ Card.Subtitle,
5415
+ { style: { marginTop: 0 } },
5416
+ moment(row.published).format('MMMM DD, YYYY')
5417
+ ),
5399
5418
  React__default.createElement(
5400
5419
  Card.Text,
5401
5420
  { className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
@@ -5461,6 +5480,11 @@ var GridContent = function (_React$Component) {
5461
5480
  'End of data'
5462
5481
  )
5463
5482
  )
5483
+ ),
5484
+ React__default.createElement(
5485
+ 'noscript',
5486
+ null,
5487
+ this.renderManualPagination()
5464
5488
  )
5465
5489
  )
5466
5490
  );
@@ -5469,7 +5493,7 @@ var GridContent = function (_React$Component) {
5469
5493
  return GridContent;
5470
5494
  }(React__default.Component);
5471
5495
 
5472
- var GridContent$1 = router.withRouter(GridContent);
5496
+ var GridContent$1 = Router.withRouter(GridContent);
5473
5497
 
5474
5498
  var DeckQueue = function (_React$Component) {
5475
5499
  inherits(DeckQueue, _React$Component);
@@ -5485,74 +5509,151 @@ var DeckQueue = function (_React$Component) {
5485
5509
  args[_key] = arguments[_key];
5486
5510
  }
5487
5511
 
5488
- return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = DeckQueue.__proto__ || Object.getPrototypeOf(DeckQueue)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.state = {
5512
+ return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = DeckQueue.__proto__ || Object.getPrototypeOf(DeckQueue)).call.apply(_ref, [this].concat(args))), _this), _this.page = _this.props.page, _this.data = _this.props.dataRecord, _this.query = _this.props.query, _this.params = _this.props.params, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
5489
5513
  data: _this.data,
5490
5514
  per: _this.params ? _this.params.to : 2,
5491
- page: 1,
5515
+ page: _this.props.currentPage || 1,
5492
5516
  from: _this.params ? _this.params.from : 0,
5493
5517
  to: _this.params ? _this.params.to : 2,
5494
5518
  total_pages: null,
5495
5519
  scrolling: true,
5496
- query: _this.query
5497
- }, _this.loadMore = function () {
5498
- setTimeout(function () {
5499
- _this.setState(function (state, props) {
5500
- return {
5501
- page: state.page + 1,
5502
- from: state.from + state.per,
5503
- to: state.to + state.per
5504
- };
5505
- }, _this.loadData);
5506
- }, 10);
5507
- }, _this.loadData = function () {
5520
+ query: _this.query,
5521
+ currentPage: _this.props.currentPage || 1
5522
+ }, _this.loadMore = debounce_1(function () {
5523
+ _this.setState(function (state) {
5524
+ var page = state.page,
5525
+ from = state.from,
5526
+ per = state.per,
5527
+ to = state.to;
5528
+
5529
+ return {
5530
+ page: page + 1,
5531
+ from: from + per,
5532
+ to: to + per
5533
+ };
5534
+ }, _this.loadData);
5535
+ }, 0), _this.loadData = function () {
5508
5536
  var _this$state = _this.state,
5509
5537
  from = _this$state.from,
5510
5538
  to = _this$state.to,
5511
5539
  data = _this$state.data,
5512
- query = _this$state.query;
5540
+ query = _this$state.query,
5541
+ page = _this$state.page;
5513
5542
  var client = _this.props.client;
5514
5543
 
5515
5544
 
5516
5545
  var params = _extends({}, _this.params, { from: from, to: to
5517
5546
  // const queryUpdated = query.replace('$from', params.from).replace('$to', params.to)
5518
-
5519
- });if (_this.pointer && _this.pointerArray) {
5520
- var pointer = _this.pointer;
5521
- client.fetch(query, params).then(function (dataArr) {
5522
- _this.setState(function (state, props) {
5523
- if (dataArr[_this.pointerArray][pointer].length > 0) {
5524
- return {
5525
- data: [].concat(toConsumableArray(data), toConsumableArray(dataArr[_this.pointerArray][pointer])),
5526
- scrolling: true
5527
- };
5528
- } else {
5529
- return {
5530
- scrolling: false
5531
- };
5532
- }
5547
+ });client.fetch(query, params).then(function (dataArr) {
5548
+ if (_this.pointer && _this.pointerArray) {
5549
+ var pointer = _this.pointer;
5550
+ dataArr = dataArr[_this.pointerArray][pointer];
5551
+ }
5552
+ dataArr = dataArr.map(function (item) {
5553
+ return _extends({}, item, {
5554
+ pageNumber: page
5533
5555
  });
5534
5556
  });
5535
- } else {
5536
- client.fetch(query, params).then(function (dataArr) {
5537
- _this.setState(function (state, props) {
5538
- if (dataArr.length > 0) {
5539
- return {
5540
- data: [].concat(toConsumableArray(data), toConsumableArray(dataArr)),
5541
- scrolling: true
5542
- };
5543
- } else {
5544
- return {
5545
- scrolling: false
5546
- };
5547
- }
5548
- });
5557
+
5558
+ _this.setState(function () {
5559
+ if (dataArr.length > 0) {
5560
+ return {
5561
+ data: [].concat(toConsumableArray(data), toConsumableArray(dataArr)),
5562
+ scrolling: true
5563
+ };
5564
+ } else {
5565
+ return {
5566
+ scrolling: false
5567
+ };
5568
+ }
5549
5569
  });
5550
- }
5570
+ });
5551
5571
  }, _this.urlFor = function (source) {
5552
5572
  var client = _this.props.client;
5553
5573
 
5554
5574
  var builder = imageUrlBuilder(client);
5555
5575
  return builder.image(source);
5576
+ }, _this.renderCardImage = function (row, page) {
5577
+ if (row.thumbnail) {
5578
+ return _this.urlFor(row.thumbnail).url();
5579
+ } else {
5580
+ return _this.defaultImage;
5581
+ }
5582
+ }, _this.changePageNumber = function (pageNumber) {
5583
+ var _this$props = _this.props,
5584
+ seoPaginate = _this$props.seoPaginate,
5585
+ pageview = _this$props.pageview,
5586
+ router = _this$props.router;
5587
+ var currentPage = _this.state.currentPage;
5588
+
5589
+ if (seoPaginate) {
5590
+ var path = router.asPath;
5591
+ var qrIndex = path.indexOf('?');
5592
+ var pathname = router.pathname;
5593
+ var queryString = '';
5594
+
5595
+ if (qrIndex > 0) {
5596
+ path = path.substring(1, qrIndex);
5597
+
5598
+ var partialQS = router.asPath.substring(qrIndex + 1);
5599
+ var partialQSArr = partialQS.split('&');
5600
+
5601
+ // exclude page=xxx from query string
5602
+ partialQSArr.map(function (item) {
5603
+ var itemArr = item.split('=');
5604
+ var key = itemArr[0];
5605
+ var val = itemArr[1];
5606
+
5607
+ if (key !== 'page') {
5608
+ queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
5609
+ }
5610
+ });
5611
+ }
5612
+
5613
+ if (queryString.length > 0) {
5614
+ path += '?' + queryString;
5615
+ }
5616
+
5617
+ pageNumber = parseInt(pageNumber);
5618
+
5619
+ if (currentPage !== pageNumber) {
5620
+ lib_3.refresh();
5621
+ if (pageview) {
5622
+ _this.setState({
5623
+ currentPage: pageNumber
5624
+ }, function () {
5625
+ if (path[0] !== '/') {
5626
+ path = '/' + path;
5627
+ }
5628
+
5629
+ var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
5630
+
5631
+ pageview(newPath);
5632
+
5633
+ router.push(pathname, newPath, {
5634
+ shallow: true
5635
+ });
5636
+ });
5637
+ }
5638
+ }
5639
+ }
5640
+ }, _this.renderManualPagination = function () {
5641
+ var currentPage = _this.state.currentPage;
5642
+
5643
+ return React__default.createElement(
5644
+ 'div',
5645
+ { className: 'd-flex justify-content-between' },
5646
+ currentPage && currentPage > 1 && React__default.createElement(
5647
+ 'a',
5648
+ { href: '?page=' + (currentPage - 1) },
5649
+ '<< Previous'
5650
+ ),
5651
+ React__default.createElement(
5652
+ 'a',
5653
+ { href: '?page=' + (currentPage + 1) },
5654
+ 'Next >>'
5655
+ )
5656
+ );
5556
5657
  }, _temp), possibleConstructorReturn(_this, _ret);
5557
5658
  }
5558
5659
 
@@ -5567,64 +5668,73 @@ var DeckQueue = function (_React$Component) {
5567
5668
  return React__default.createElement(
5568
5669
  Row,
5569
5670
  null,
5570
- this.state.data && this.state.data.map(function (row, index) {
5671
+ this.state.data && this.state.data.map(function (row, index$$1) {
5672
+ var pageNumber = row.pageNumber || _this2.state.page;
5571
5673
  // const thumbnailURL = get(row, 'thumbnail.asset.url', this.props.defaultImage)
5572
5674
  var thumbnailURL = row.thumbnail ? _this2.urlFor(row.thumbnail).url() : _this2.props.defaultImage;
5573
5675
  return React__default.createElement(
5574
- Col,
5575
- { key: index, md: 12, lg: lgVar, style: { display: 'flex', flex: '1 0 auto' } },
5676
+ VisibilitySensor,
5677
+ {
5678
+ key: index$$1,
5679
+ onChange: function onChange(isVisible) {
5680
+ isVisible && _this2.changePageNumber(pageNumber);
5681
+ } },
5576
5682
  React__default.createElement(
5577
- Card,
5578
- { className: 'queue-card', style: { borderTop: '1px solid #EEE' } },
5683
+ Col,
5684
+ { md: 12, lg: lgVar, style: { display: 'flex', flex: '1 0 auto' } },
5579
5685
  React__default.createElement(
5580
- Row,
5581
- { style: { flexDirection: mode } },
5582
- React__default.createElement(
5583
- Col,
5584
- { md: 12, lg: 4 },
5585
- React__default.createElement(
5586
- Link,
5587
- { href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
5588
- React__default.createElement(Card.Img, { variant: 'top', src: thumbnailURL })
5589
- )
5590
- ),
5686
+ Card,
5687
+ { className: 'queue-card', style: { borderTop: '1px solid #EEE' } },
5591
5688
  React__default.createElement(
5592
- Col,
5593
- null,
5689
+ Row,
5690
+ { style: { flexDirection: mode } },
5594
5691
  React__default.createElement(
5595
- Card.Body,
5596
- { style: { padding: '20px' } },
5597
- row.title && React__default.createElement(
5692
+ Col,
5693
+ { md: 12, lg: 4 },
5694
+ React__default.createElement(
5598
5695
  Link,
5599
5696
  { href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
5600
- React__default.createElement(
5601
- Card.Title,
5602
- null,
5603
- row.title
5604
- )
5605
- ),
5606
- _this2.props.showPublished && row.published && React__default.createElement(
5607
- Card.Subtitle,
5608
- null,
5609
- moment(row.published).format('MMMM DD, YYYY')
5610
- ),
5611
- _this2.props.showRecent && row.recent && row.recent.title && React__default.createElement(
5612
- Card.Subtitle,
5613
- null,
5614
- 'Recent : ',
5615
- React__default.createElement(
5697
+ React__default.createElement(Card.Img, { variant: 'top', src: thumbnailURL })
5698
+ )
5699
+ ),
5700
+ React__default.createElement(
5701
+ Col,
5702
+ null,
5703
+ React__default.createElement(
5704
+ Card.Body,
5705
+ { style: { padding: '20px' } },
5706
+ row.title && React__default.createElement(
5616
5707
  Link,
5617
- { href: 'view/' + row.recent.url.current },
5618
- row.recent.title
5619
- )
5620
- ),
5621
- row.summary && React__default.createElement(
5622
- Link,
5623
- { href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
5624
- React__default.createElement(
5625
- Card.Text,
5708
+ { href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
5709
+ React__default.createElement(
5710
+ Card.Title,
5711
+ null,
5712
+ row.title
5713
+ )
5714
+ ),
5715
+ _this2.props.showPublished && row.published && React__default.createElement(
5716
+ Card.Subtitle,
5626
5717
  null,
5627
- row.summary
5718
+ moment(row.published).format('MMMM DD, YYYY')
5719
+ ),
5720
+ _this2.props.showRecent && row.recent && row.recent.title && React__default.createElement(
5721
+ Card.Subtitle,
5722
+ null,
5723
+ 'Recent : ',
5724
+ React__default.createElement(
5725
+ Link,
5726
+ { href: 'view/' + row.recent.url.current },
5727
+ row.recent.title
5728
+ )
5729
+ ),
5730
+ row.summary && React__default.createElement(
5731
+ Link,
5732
+ { href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
5733
+ React__default.createElement(
5734
+ Card.Text,
5735
+ null,
5736
+ row.summary
5737
+ )
5628
5738
  )
5629
5739
  )
5630
5740
  )
@@ -5686,6 +5796,11 @@ var DeckQueue = function (_React$Component) {
5686
5796
  'End of data'
5687
5797
  )
5688
5798
  )
5799
+ ),
5800
+ React__default.createElement(
5801
+ 'noscript',
5802
+ null,
5803
+ this.renderManualPagination()
5689
5804
  )
5690
5805
  )
5691
5806
  );
@@ -5694,6 +5809,8 @@ var DeckQueue = function (_React$Component) {
5694
5809
  return DeckQueue;
5695
5810
  }(React__default.Component);
5696
5811
 
5812
+ var Queue = Router.withRouter(DeckQueue);
5813
+
5697
5814
  var ThumbnailCard = function ThumbnailCard(_ref) {
5698
5815
  var size = _ref.size,
5699
5816
  mediaData = _ref.mediaData,
@@ -6236,17 +6353,17 @@ var loadData = function loadData(values, query, client, params, setData, setScro
6236
6353
  });
6237
6354
  };
6238
6355
 
6239
- var changePageNumber = function changePageNumber(pageNumber, seoPaginate, pageview, router$$1, currentPage, setCurrentPage) {
6356
+ var changePageNumber = function changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage) {
6240
6357
  if (seoPaginate) {
6241
- var path = router$$1.asPath;
6358
+ var path = router.asPath;
6242
6359
  var qrIndex = path.indexOf('?');
6243
- var pathname = router$$1.pathname;
6360
+ var pathname = router.pathname;
6244
6361
  var queryString = '';
6245
6362
 
6246
6363
  if (qrIndex > 0) {
6247
6364
  path = path.substring(1, qrIndex);
6248
6365
 
6249
- var partialQS = router$$1.asPath.substring(qrIndex + 1);
6366
+ var partialQS = router.asPath.substring(qrIndex + 1);
6250
6367
  var partialQSArr = partialQS.split('&');
6251
6368
 
6252
6369
  // exclude page=xxx from query string
@@ -6276,7 +6393,7 @@ var changePageNumber = function changePageNumber(pageNumber, seoPaginate, pagevi
6276
6393
  }
6277
6394
  var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
6278
6395
  pageview(newPath);
6279
- router$$1.push(pathname, newPath, {
6396
+ router.push(pathname, newPath, {
6280
6397
  shallow: true
6281
6398
  });
6282
6399
  }
@@ -6306,7 +6423,7 @@ var renderAuthor = function renderAuthor(authorName, authorURL, index$$1, length
6306
6423
  }
6307
6424
  };
6308
6425
 
6309
- var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router$$1, currentPage, setCurrentPage, showPublished, defaultImage) {
6426
+ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage) {
6310
6427
  return React__default.createElement(
6311
6428
  'div',
6312
6429
  null,
@@ -6318,7 +6435,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
6318
6435
  {
6319
6436
  key: article._id ? article._id : index$$1,
6320
6437
  onChange: function onChange(isVisible) {
6321
- isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router$$1, currentPage, setCurrentPage);
6438
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
6322
6439
  } },
6323
6440
  React__default.createElement(
6324
6441
  React__default.Fragment,
@@ -6406,7 +6523,7 @@ var usePrevious = function usePrevious(value) {
6406
6523
  };
6407
6524
 
6408
6525
  var QueueDeckExpanded = function QueueDeckExpanded(props) {
6409
- var router$$1 = router.useRouter();
6526
+ var router = Router.useRouter();
6410
6527
  var initialData = props.dataRecord,
6411
6528
  client = props.client,
6412
6529
  params = props.params,
@@ -6476,7 +6593,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
6476
6593
  React__default.createElement(
6477
6594
  reactBootstrap.Container,
6478
6595
  null,
6479
- cardLoader(data, builder, mapping, values, seoPaginate, pageview, router$$1, currentPage, setCurrentPage, showPublished, defaultImage)
6596
+ cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage)
6480
6597
  )
6481
6598
  ),
6482
6599
  React__default.createElement(
@@ -6490,7 +6607,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
6490
6607
  React__default.createElement(
6491
6608
  reactBootstrap.Container,
6492
6609
  null,
6493
- cardLoader(data, builder, mapping, values, seoPaginate, pageview, router$$1, currentPage, setCurrentPage, showPublished, defaultImage)
6610
+ cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage)
6494
6611
  ),
6495
6612
  React__default.createElement(
6496
6613
  'div',
@@ -7021,19 +7138,32 @@ var Search = function Search(_ref) {
7021
7138
  _ref$btnText = _ref.btnText,
7022
7139
  btnText = _ref$btnText === undefined ? 'Search' : _ref$btnText;
7023
7140
 
7024
- var router$$1 = router.useRouter();
7141
+ var router = Router.useRouter();
7025
7142
 
7026
7143
  var _useState = React.useState(''),
7027
7144
  _useState2 = slicedToArray(_useState, 2),
7028
7145
  searchKey = _useState2[0],
7029
7146
  setSearchKey = _useState2[1];
7030
7147
 
7031
- var handleSearch = function handleSearch(value) {
7032
- router$$1.push({
7033
- pathname: '/search',
7034
- query: { searchTerm: value }
7148
+ var _useState3 = React.useState(false),
7149
+ _useState4 = slicedToArray(_useState3, 2),
7150
+ activesearch = _useState4[0],
7151
+ setActivesearch = _useState4[1];
7152
+
7153
+ React.useEffect(function () {
7154
+ if (activesearch) {
7155
+ router.push({
7156
+ pathname: '/search',
7157
+ query: { searchTerm: searchKey }
7158
+ });
7159
+ }
7160
+ }, [activesearch]);
7161
+
7162
+ React.useEffect(function () {
7163
+ Router__default.events.on('routeChangeComplete', function () {
7164
+ return setActivesearch(false);
7035
7165
  });
7036
- };
7166
+ });
7037
7167
 
7038
7168
  return React__default.createElement(
7039
7169
  Form,
@@ -7041,16 +7171,17 @@ var Search = function Search(_ref) {
7041
7171
  inline: true,
7042
7172
  onSubmit: function onSubmit(e) {
7043
7173
  e.preventDefault();
7044
- handleSearch(searchKey);
7174
+ setActivesearch(true);
7045
7175
  } },
7176
+ activesearch && React__default.createElement(reactBootstrap.Spinner, { className: 'active-loader mr-3', animation: 'border', variant: 'light' }),
7046
7177
  React__default.createElement(FormControl, { type: 'text', placeholder: placeholder, className: 'mr-sm-2', value: searchKey, onChange: function onChange(e) {
7047
7178
  return setSearchKey(e.target.value);
7048
7179
  } }),
7049
7180
  React__default.createElement(
7050
7181
  Button,
7051
7182
  { variant: 'secondary', onClick: function onClick() {
7052
- return handleSearch(searchKey);
7053
- } },
7183
+ return setActivesearch(true);
7184
+ }, disabled: activesearch },
7054
7185
  btnText
7055
7186
  )
7056
7187
  );
@@ -7179,6 +7310,11 @@ var NavMagazine = function NavMagazine(props) {
7179
7310
  React__default.createElement(Search, null)
7180
7311
  )
7181
7312
  )
7313
+ ),
7314
+ React__default.createElement(
7315
+ 'style',
7316
+ { jsx: true },
7317
+ '\n @media screen and (max-width: 991px) {\n .dropdown-menu {\n max-height: 315px;\n overflow: auto;\n }\n ::-webkit-scrollbar {\n width: 10px;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(214, 214, 214, 0.8);\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n }\n }\n '
7182
7318
  )
7183
7319
  );
7184
7320
  };
@@ -7250,6 +7386,11 @@ var NavNative = function NavNative(props) {
7250
7386
  React__default.createElement(Search, null)
7251
7387
  )
7252
7388
  )
7389
+ ),
7390
+ React__default.createElement(
7391
+ 'style',
7392
+ { jsx: true },
7393
+ '\n @media screen and (max-width: 991px) {\n .dropdown-menu {\n max-height: 315px;\n overflow: auto;\n }\n ::-webkit-scrollbar {\n width: 10px;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(214, 214, 214, 0.8);\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n }\n }\n '
7253
7394
  )
7254
7395
  );
7255
7396
  };
@@ -7323,6 +7464,11 @@ var NavNormal = function NavNormal(props) {
7323
7464
  ),
7324
7465
  React__default.createElement(Search, null)
7325
7466
  )
7467
+ ),
7468
+ React__default.createElement(
7469
+ 'style',
7470
+ { jsx: true },
7471
+ '\n @media screen and (max-width: 991px) {\n .dropdown-menu {\n max-height: 315px;\n overflow: auto;\n }\n ::-webkit-scrollbar {\n width: 10px;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(214, 214, 214, 0.8);\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n }\n }\n '
7326
7472
  )
7327
7473
  );
7328
7474
  };
@@ -7428,7 +7574,7 @@ var NavDvm = function NavDvm(props) {
7428
7574
  React__default.createElement(
7429
7575
  'style',
7430
7576
  { jsx: 'true' },
7431
- '\n .mobile-logo{\n display: none;\n position: absolute;\n left: 50%;\n top: 0;\n height: 40px;\n transform: translateX(-50%);\n }\n .mobile-logo img{\n height: 100%;\n }\n @media screen and (max-width: 1199px){\n .mobile-logo{\n display: block;\n }\n .top-nav{\n display: none;\n }\n }\n '
7577
+ '\n .mobile-logo{\n display: none;\n position: absolute;\n left: 50%;\n top: 0;\n height: 40px;\n transform: translateX(-50%);\n }\n .mobile-logo img{\n height: 100%;\n }\n @media screen and (max-width: 1199px){\n .mobile-logo{\n display: block;\n }\n .top-nav{\n display: none;\n }\n }\n @media screen and (max-width: 991px) {\n .dropdown-menu {\n max-height: 315px;\n overflow: auto;\n }\n ::-webkit-scrollbar {\n width: 10px;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background-color: rgba(214, 214, 214, 0.8);\n box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n -webkit-box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);\n }\n }\n \n '
7432
7578
  )
7433
7579
  );
7434
7580
  };
@@ -8502,7 +8648,7 @@ var urlFor$1 = function urlFor(source, builder) {
8502
8648
  var onChangeSlide = function onChangeSlide(selectedIndex, pageview, setCarouselIndex, asPath) {
8503
8649
  setCarouselIndex(selectedIndex);
8504
8650
  lib_3.refresh();
8505
- pageview(asPath);
8651
+ if (pageview) pageview(asPath);
8506
8652
  };
8507
8653
 
8508
8654
  var Slideshow = function Slideshow(_ref) {
@@ -8510,7 +8656,7 @@ var Slideshow = function Slideshow(_ref) {
8510
8656
  client = _ref.client,
8511
8657
  pageview = _ref.pageview;
8512
8658
 
8513
- var router$$1 = router.useRouter();
8659
+ var router = Router.useRouter();
8514
8660
 
8515
8661
  var _useState = React.useState(0),
8516
8662
  _useState2 = slicedToArray(_useState, 2),
@@ -8521,17 +8667,22 @@ var Slideshow = function Slideshow(_ref) {
8521
8667
 
8522
8668
  return React__default.createElement(
8523
8669
  'div',
8524
- { style: { marginTop: '1em', marginBottom: '1em' } },
8670
+ { className: 'mt-3 mb-3' },
8525
8671
  React__default.createElement(
8526
8672
  reactBootstrap.Carousel,
8527
8673
  { activeIndex: carouselIndex, onSelect: function onSelect(selectedIndex, e) {
8528
- return onChangeSlide(selectedIndex, pageview, setCarouselIndex, router$$1.asPath);
8674
+ return onChangeSlide(selectedIndex, pageview, setCarouselIndex, router.asPath);
8529
8675
  } },
8530
8676
  slides && slides.map(function (slide) {
8531
8677
  return React__default.createElement(
8532
8678
  reactBootstrap.Carousel.Item,
8533
8679
  { key: slide._key },
8534
- React__default.createElement('img', { src: urlFor$1(slide.asset, builder).url(), style: { width: '100%' } })
8680
+ React__default.createElement('img', { src: slide.asset && urlFor$1(slide.asset, builder).url(), alt: slide.alt && slide.alt, style: { width: '100%' } }),
8681
+ slide.caption && React__default.createElement(
8682
+ 'p',
8683
+ { className: 'p-2' },
8684
+ slide.caption
8685
+ )
8535
8686
  );
8536
8687
  })
8537
8688
  )
@@ -12079,7 +12230,7 @@ var Sidebar = function Sidebar(_ref) {
12079
12230
 
12080
12231
  return React__default.createElement(
12081
12232
  'article',
12082
- { className: 'sidebar', style: { background: '#eee', marginRight: '10%', marginLeft: '1rem', width: '40%', padding: '1rem 0 0' } },
12233
+ { className: 'sidebar', style: { background: '#eee' } },
12083
12234
  React__default.createElement(
12084
12235
  'div',
12085
12236
  null,
@@ -12089,6 +12240,11 @@ var Sidebar = function Sidebar(_ref) {
12089
12240
  caption
12090
12241
  ),
12091
12242
  React__default.createElement(BlockContent, { blocks: content })
12243
+ ),
12244
+ React__default.createElement(
12245
+ 'style',
12246
+ { jsx: true },
12247
+ '\n .sidebar {\n width: 40%;\n padding: 1rem 0 0;\n margin-left: 1rem;\n margin-right: 10%;\n }\n @media screen and (max-width: 991px) {\n .sidebar {\n width: unset;\n padding: 1.25rem;\n margin-left: 1rem;\n margin-right: 1rem;\n }\n }\n '
12092
12248
  )
12093
12249
  );
12094
12250
  };
@@ -12192,7 +12348,7 @@ var Audio = function Audio(_ref) {
12192
12348
  { className: 'd-block text-center mb-3' },
12193
12349
  React__default.createElement(
12194
12350
  'audio',
12195
- { controls: true },
12351
+ { controls: true, controlsList: 'nodownload' },
12196
12352
  React__default.createElement('source', { src: node.uploadAudio ? node.uploadAudio.asset.url : node.audioFilePth, type: 'audio/ogg' }),
12197
12353
  React__default.createElement('source', { src: node.uploadAudio ? node.uploadAudio.asset.url : node.audioFilePth, type: 'audio/mpeg' }),
12198
12354
  'Your browser does not support the audio element.'
@@ -12209,7 +12365,7 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
12209
12365
  var nodes = _ref.nodes,
12210
12366
  client = _ref.client;
12211
12367
 
12212
- var router$$1 = router.useRouter();
12368
+ var router = Router.useRouter();
12213
12369
  //state
12214
12370
 
12215
12371
  var _useState = React.useState(''),
@@ -12229,8 +12385,8 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
12229
12385
  //variables
12230
12386
 
12231
12387
 
12232
- var get2 = router$$1.asPath.split('/')[1];
12233
- var get3 = router$$1.asPath.split('/')[2].split('?')[0];
12388
+ var get2 = router.asPath.split('/')[1];
12389
+ var get3 = router.asPath.split('/')[2].split('?')[0];
12234
12390
 
12235
12391
  // Once component mounts, set the variables
12236
12392
  React.useEffect(function () {
@@ -12519,9 +12675,53 @@ var Feature = function Feature(props) {
12519
12675
  );
12520
12676
  };
12521
12677
 
12678
+ var Breadcrumbs = function Breadcrumbs() {
12679
+ // To be used on landing pages eg. /news/[url]
12680
+ var _useState = React.useState(''),
12681
+ _useState2 = slicedToArray(_useState, 2),
12682
+ parentPath = _useState2[0],
12683
+ setParentPath = _useState2[1];
12684
+
12685
+ var _useState3 = React.useState(''),
12686
+ _useState4 = slicedToArray(_useState3, 2),
12687
+ currentPath = _useState4[0],
12688
+ setCurrentPath = _useState4[1];
12689
+
12690
+ React.useEffect(function () {
12691
+ var parsedUrl = window.location.href.split('/');
12692
+ setCurrentPath(parsedUrl[parsedUrl.length - 1]);
12693
+ setParentPath(parsedUrl[parsedUrl.length - 2]);
12694
+ });
12695
+
12696
+ return React__default.createElement(
12697
+ Breadcrumb,
12698
+ null,
12699
+ React__default.createElement(
12700
+ Breadcrumb.Item,
12701
+ { href: '/' },
12702
+ 'home'
12703
+ ),
12704
+ React__default.createElement(
12705
+ Breadcrumb.Item,
12706
+ { href: '/' + parentPath },
12707
+ parentPath
12708
+ ),
12709
+ React__default.createElement(
12710
+ Breadcrumb.Item,
12711
+ { active: true },
12712
+ currentPath
12713
+ ),
12714
+ React__default.createElement(
12715
+ 'style',
12716
+ { jsx: true },
12717
+ '\n ol.breadcrumb {\n background: transparent;\n padding-left: 0.25rem;\n }\n '
12718
+ )
12719
+ );
12720
+ };
12721
+
12522
12722
  exports.DeckContent = ContentCard;
12523
12723
  exports.GridContent = GridContent$1;
12524
- exports.DeckQueue = DeckQueue;
12724
+ exports.DeckQueue = Queue;
12525
12725
  exports.ThumbnailCard = ThumbnailCard;
12526
12726
  exports.TaxonomyCard = TaxonomyCard;
12527
12727
  exports.GroupDeck = GroupDeck;
@@ -12545,4 +12745,5 @@ exports.AD728x90 = AD728x90;
12545
12745
  exports.getSerializers = getSerializers$1;
12546
12746
  exports.Search = Search;
12547
12747
  exports.Feature = Feature;
12748
+ exports.Breadcrumbs = Breadcrumbs;
12548
12749
  //# sourceMappingURL=index.js.map