@mjhls/mjh-framework 1.0.91 → 1.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.es.js +110 -53
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +109 -52
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React__default, { Component, useState, useEffect, useRef,
|
|
1
|
+
import React__default, { Component, useState, useEffect, useRef, createElement, createContext } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import reactDom from 'react-dom';
|
|
4
4
|
import Container from 'react-bootstrap/Container';
|
|
5
5
|
import Row from 'react-bootstrap/Row';
|
|
6
6
|
import Col from 'react-bootstrap/Col';
|
|
7
7
|
import Card from 'react-bootstrap/Card';
|
|
8
|
+
import moment from 'moment';
|
|
8
9
|
import Link from 'next/link';
|
|
9
10
|
import { withRouter, useRouter } from 'next/router';
|
|
10
11
|
import Media from 'react-bootstrap/Media';
|
|
11
12
|
import { Media as Media$1, Container as Container$1, Figure, Carousel, Table } from 'react-bootstrap';
|
|
12
|
-
import moment from 'moment';
|
|
13
13
|
import ListGroup from 'react-bootstrap/ListGroup';
|
|
14
14
|
import Head from 'next/head';
|
|
15
15
|
import Accordion from 'react-bootstrap/Accordion';
|
|
@@ -4010,6 +4010,11 @@ var DeckContent = function (_React$Component) {
|
|
|
4010
4010
|
null,
|
|
4011
4011
|
row.title
|
|
4012
4012
|
),
|
|
4013
|
+
_this.props.showPublished && row.published && React__default.createElement(
|
|
4014
|
+
Card.Subtitle,
|
|
4015
|
+
null,
|
|
4016
|
+
moment(row.published).format('MMMM DD, YYYY')
|
|
4017
|
+
),
|
|
4013
4018
|
React__default.createElement(
|
|
4014
4019
|
Card.Text,
|
|
4015
4020
|
null,
|
|
@@ -5142,7 +5147,7 @@ var GridContent = function (_React$Component) {
|
|
|
5142
5147
|
args[_key] = arguments[_key];
|
|
5143
5148
|
}
|
|
5144
5149
|
|
|
5145
|
-
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.state = {
|
|
5150
|
+
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 = {
|
|
5146
5151
|
data: _this.data,
|
|
5147
5152
|
per: _this.params ? _this.params.to : 2,
|
|
5148
5153
|
page: 1,
|
|
@@ -5254,7 +5259,7 @@ var GridContent = function (_React$Component) {
|
|
|
5254
5259
|
pageNumber = parseInt(pageNumber);
|
|
5255
5260
|
|
|
5256
5261
|
if (currentPage !== pageNumber) {
|
|
5257
|
-
|
|
5262
|
+
lib_3.refresh();
|
|
5258
5263
|
if (pageview) {
|
|
5259
5264
|
_this.setState({
|
|
5260
5265
|
currentPage: pageNumber
|
|
@@ -5288,12 +5293,12 @@ var GridContent = function (_React$Component) {
|
|
|
5288
5293
|
return React__default.createElement(
|
|
5289
5294
|
Row,
|
|
5290
5295
|
null,
|
|
5291
|
-
this.state.data && this.state.data.map(function (row, index) {
|
|
5296
|
+
this.state.data && this.state.data.map(function (row, index$$1) {
|
|
5292
5297
|
// const thumbnailURL = get(row, 'thumbnail.asset.url', this.props.defaultImage)
|
|
5293
5298
|
var thumbnailURL = row.thumbnail ? _this2.urlFor(row.thumbnail).url() : _this2.props.defaultImage;
|
|
5294
5299
|
return React__default.createElement(
|
|
5295
5300
|
Col,
|
|
5296
|
-
{ key: index, md: 12, lg: lgVar, style: { display: 'flex', flex: '1 0 auto' } },
|
|
5301
|
+
{ key: index$$1, md: 12, lg: lgVar, style: { display: 'flex', flex: '1 0 auto' } },
|
|
5297
5302
|
React__default.createElement(
|
|
5298
5303
|
Link,
|
|
5299
5304
|
{ href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
|
|
@@ -5322,6 +5327,11 @@ var GridContent = function (_React$Component) {
|
|
|
5322
5327
|
null,
|
|
5323
5328
|
row.title
|
|
5324
5329
|
),
|
|
5330
|
+
_this2.props.showPublished && row.published && React__default.createElement(
|
|
5331
|
+
Card.Subtitle,
|
|
5332
|
+
null,
|
|
5333
|
+
moment(row.published).format('MMMM DD, YYYY')
|
|
5334
|
+
),
|
|
5325
5335
|
React__default.createElement(
|
|
5326
5336
|
Card.Text,
|
|
5327
5337
|
null,
|
|
@@ -5340,7 +5350,7 @@ var GridContent = function (_React$Component) {
|
|
|
5340
5350
|
return React__default.createElement(
|
|
5341
5351
|
'div',
|
|
5342
5352
|
{ className: 'grid-container' },
|
|
5343
|
-
this.state.data && this.state.data.map(function (row, index) {
|
|
5353
|
+
this.state.data && this.state.data.map(function (row, index$$1) {
|
|
5344
5354
|
var pageNumber = row.pageNumber || _this2.state.page;
|
|
5345
5355
|
var contentCategoryName = row.contentCategory ? row.contentCategory.name : 'Articles';
|
|
5346
5356
|
return React__default.createElement(
|
|
@@ -5355,13 +5365,13 @@ var GridContent = function (_React$Component) {
|
|
|
5355
5365
|
{ counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
|
|
5356
5366
|
React__default.createElement(
|
|
5357
5367
|
Card,
|
|
5358
|
-
{ className: 'content-card', style: { flexDirection: index === 0 || index % 4 === 0 ? 'top' : 'row' } },
|
|
5368
|
+
{ className: 'content-card', style: { flexDirection: index$$1 === 0 || index$$1 % 4 === 0 ? 'top' : 'row' } },
|
|
5359
5369
|
React__default.createElement(
|
|
5360
5370
|
Link,
|
|
5361
5371
|
{ href: _this2.mapping[contentCategoryName] + '/[url]', as: _this2.mapping[contentCategoryName] + '/' + row.url.current },
|
|
5362
5372
|
React__default.createElement(
|
|
5363
5373
|
'a',
|
|
5364
|
-
{ className: index === 0 || index % 4 === 0 ? '' : 'card-image' },
|
|
5374
|
+
{ className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-image' },
|
|
5365
5375
|
React__default.createElement(Card.Img, { variant: 'top', src: _this2.renderCardImage(row, page), alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : '' })
|
|
5366
5376
|
)
|
|
5367
5377
|
),
|
|
@@ -5381,7 +5391,7 @@ var GridContent = function (_React$Component) {
|
|
|
5381
5391
|
),
|
|
5382
5392
|
React__default.createElement(
|
|
5383
5393
|
Card.Text,
|
|
5384
|
-
{ className: index === 0 || index % 4 === 0 ? '' : 'card-subtext' },
|
|
5394
|
+
{ className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
|
|
5385
5395
|
row.summary
|
|
5386
5396
|
)
|
|
5387
5397
|
)
|
|
@@ -5452,6 +5462,8 @@ var GridContent = function (_React$Component) {
|
|
|
5452
5462
|
return GridContent;
|
|
5453
5463
|
}(React__default.Component);
|
|
5454
5464
|
|
|
5465
|
+
var GridContent$1 = withRouter(GridContent);
|
|
5466
|
+
|
|
5455
5467
|
var DeckQueue = function (_React$Component) {
|
|
5456
5468
|
inherits(DeckQueue, _React$Component);
|
|
5457
5469
|
|
|
@@ -5555,38 +5567,57 @@ var DeckQueue = function (_React$Component) {
|
|
|
5555
5567
|
Col,
|
|
5556
5568
|
{ key: index, md: 12, lg: lgVar, style: { display: 'flex', flex: '1 0 auto' } },
|
|
5557
5569
|
React__default.createElement(
|
|
5558
|
-
|
|
5559
|
-
{
|
|
5570
|
+
Card,
|
|
5571
|
+
{ className: 'queue-card', style: { borderTop: '1px solid #EEE' } },
|
|
5560
5572
|
React__default.createElement(
|
|
5561
|
-
|
|
5562
|
-
|
|
5573
|
+
Row,
|
|
5574
|
+
{ style: { flexDirection: mode } },
|
|
5563
5575
|
React__default.createElement(
|
|
5564
|
-
|
|
5565
|
-
{
|
|
5576
|
+
Col,
|
|
5577
|
+
{ md: 12, lg: 4 },
|
|
5566
5578
|
React__default.createElement(
|
|
5567
|
-
|
|
5568
|
-
{
|
|
5569
|
-
React__default.createElement(
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5579
|
+
Link,
|
|
5580
|
+
{ href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
|
|
5581
|
+
React__default.createElement(Card.Img, { variant: 'top', src: thumbnailURL })
|
|
5582
|
+
)
|
|
5583
|
+
),
|
|
5584
|
+
React__default.createElement(
|
|
5585
|
+
Col,
|
|
5586
|
+
null,
|
|
5587
|
+
React__default.createElement(
|
|
5588
|
+
Card.Body,
|
|
5589
|
+
{ style: { padding: '20px' } },
|
|
5590
|
+
row.title && React__default.createElement(
|
|
5591
|
+
Link,
|
|
5592
|
+
{ href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
|
|
5593
|
+
React__default.createElement(
|
|
5594
|
+
Card.Title,
|
|
5595
|
+
null,
|
|
5596
|
+
row.title
|
|
5597
|
+
)
|
|
5573
5598
|
),
|
|
5574
|
-
React__default.createElement(
|
|
5575
|
-
|
|
5599
|
+
_this2.props.showPublished && row.published && React__default.createElement(
|
|
5600
|
+
Card.Subtitle,
|
|
5576
5601
|
null,
|
|
5602
|
+
moment(row.published).format('MMMM DD, YYYY')
|
|
5603
|
+
),
|
|
5604
|
+
_this2.props.showRecent && row.recent && row.recent.title && React__default.createElement(
|
|
5605
|
+
Card.Subtitle,
|
|
5606
|
+
null,
|
|
5607
|
+
'Recent : ',
|
|
5577
5608
|
React__default.createElement(
|
|
5578
|
-
|
|
5579
|
-
{
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5609
|
+
Link,
|
|
5610
|
+
{ href: 'view/' + row.recent.url.current },
|
|
5611
|
+
row.recent.title
|
|
5612
|
+
)
|
|
5613
|
+
),
|
|
5614
|
+
row.summary && React__default.createElement(
|
|
5615
|
+
Link,
|
|
5616
|
+
{ href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
|
|
5617
|
+
React__default.createElement(
|
|
5618
|
+
Card.Text,
|
|
5619
|
+
null,
|
|
5620
|
+
row.summary
|
|
5590
5621
|
)
|
|
5591
5622
|
)
|
|
5592
5623
|
)
|
|
@@ -6159,8 +6190,6 @@ var YoutubeGroup = function YoutubeGroup(props) {
|
|
|
6159
6190
|
);
|
|
6160
6191
|
};
|
|
6161
6192
|
|
|
6162
|
-
var _this = undefined;
|
|
6163
|
-
|
|
6164
6193
|
var urlFor = function urlFor(builder, source) {
|
|
6165
6194
|
return builder.image(source);
|
|
6166
6195
|
};
|
|
@@ -6181,8 +6210,7 @@ var loadData = function loadData(values, query, client, params, setData, setScro
|
|
|
6181
6210
|
|
|
6182
6211
|
client.fetch(query, params).then(function (dataArr) {
|
|
6183
6212
|
if (pointer && pointerArray) {
|
|
6184
|
-
|
|
6185
|
-
dataArr = dataArr[pointerArray][_pointer];
|
|
6213
|
+
dataArr = dataArr[pointerArray][pointer];
|
|
6186
6214
|
}
|
|
6187
6215
|
dataArr = dataArr.map(function (item) {
|
|
6188
6216
|
return _extends({}, item, {
|
|
@@ -6241,7 +6269,6 @@ var changePageNumber = function changePageNumber(pageNumber, seoPaginate, pagevi
|
|
|
6241
6269
|
}
|
|
6242
6270
|
var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
|
|
6243
6271
|
pageview(newPath);
|
|
6244
|
-
|
|
6245
6272
|
router.push(pathname, newPath, {
|
|
6246
6273
|
shallow: true
|
|
6247
6274
|
});
|
|
@@ -6272,8 +6299,7 @@ var renderAuthor = function renderAuthor(authorName, authorURL, index$$1, length
|
|
|
6272
6299
|
}
|
|
6273
6300
|
};
|
|
6274
6301
|
|
|
6275
|
-
var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage) {
|
|
6276
|
-
|
|
6302
|
+
var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage) {
|
|
6277
6303
|
return React__default.createElement(
|
|
6278
6304
|
'div',
|
|
6279
6305
|
null,
|
|
@@ -6299,7 +6325,11 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
|
|
|
6299
6325
|
React__default.createElement(
|
|
6300
6326
|
'a',
|
|
6301
6327
|
null,
|
|
6302
|
-
|
|
6328
|
+
article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', {
|
|
6329
|
+
className: 'mr-3',
|
|
6330
|
+
src: urlFor(builder, article.thumbnail).width(200).height(130).url(),
|
|
6331
|
+
alt: article.title
|
|
6332
|
+
}) : React__default.createElement('img', { src: defaultImage, className: 'mr-3', width: '200', height: '130' })
|
|
6303
6333
|
)
|
|
6304
6334
|
),
|
|
6305
6335
|
React__default.createElement(
|
|
@@ -6318,8 +6348,8 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
|
|
|
6318
6348
|
)
|
|
6319
6349
|
)
|
|
6320
6350
|
),
|
|
6321
|
-
article.published && React__default.createElement(
|
|
6322
|
-
'
|
|
6351
|
+
showPublished && article.published && React__default.createElement(
|
|
6352
|
+
'h6',
|
|
6323
6353
|
{ className: 'card-text', style: { color: 'var(--gray)', marginBottom: '.25rem' } },
|
|
6324
6354
|
moment(article.published).format('MMMM DD, YYYY')
|
|
6325
6355
|
),
|
|
@@ -6369,7 +6399,6 @@ var usePrevious = function usePrevious(value) {
|
|
|
6369
6399
|
};
|
|
6370
6400
|
|
|
6371
6401
|
var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
6372
|
-
|
|
6373
6402
|
var router = useRouter();
|
|
6374
6403
|
var initialData = props.dataRecord,
|
|
6375
6404
|
client = props.client,
|
|
@@ -6380,8 +6409,10 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
|
6380
6409
|
pointerArray = props.pointerArray,
|
|
6381
6410
|
mapping = props.mapping,
|
|
6382
6411
|
seoPaginate = props.seoPaginate,
|
|
6383
|
-
pageview = props.pageview
|
|
6384
|
-
|
|
6412
|
+
pageview = props.pageview,
|
|
6413
|
+
defaultImage = props.defaultImage;
|
|
6414
|
+
var initialCurrentPage = props.currentPage,
|
|
6415
|
+
showPublished = props.showPublished;
|
|
6385
6416
|
|
|
6386
6417
|
var builder = imageUrlBuilder(client);
|
|
6387
6418
|
|
|
@@ -6438,7 +6469,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
|
6438
6469
|
React__default.createElement(
|
|
6439
6470
|
Container$1,
|
|
6440
6471
|
null,
|
|
6441
|
-
cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage)
|
|
6472
|
+
cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage)
|
|
6442
6473
|
)
|
|
6443
6474
|
),
|
|
6444
6475
|
React__default.createElement(
|
|
@@ -6452,7 +6483,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
|
|
|
6452
6483
|
React__default.createElement(
|
|
6453
6484
|
Container$1,
|
|
6454
6485
|
null,
|
|
6455
|
-
cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage)
|
|
6486
|
+
cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage)
|
|
6456
6487
|
),
|
|
6457
6488
|
React__default.createElement(
|
|
6458
6489
|
'div',
|
|
@@ -7103,7 +7134,7 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
7103
7134
|
Nav,
|
|
7104
7135
|
{ className: 'mr-auto' },
|
|
7105
7136
|
dataObject && dataObject.map(function (row, index) {
|
|
7106
|
-
if (row.subQuery.length >
|
|
7137
|
+
if (row.subQuery && row.subQuery.length > 0) {
|
|
7107
7138
|
return React__default.createElement(
|
|
7108
7139
|
NavDropdown,
|
|
7109
7140
|
{ key: index, title: row.name, id: 'basic-nav-dropdown' },
|
|
@@ -12146,6 +12177,27 @@ var IFrame = function IFrame(_ref) {
|
|
|
12146
12177
|
);
|
|
12147
12178
|
};
|
|
12148
12179
|
|
|
12180
|
+
var Audio = function Audio(_ref) {
|
|
12181
|
+
var node = _ref.node;
|
|
12182
|
+
|
|
12183
|
+
return React__default.createElement(
|
|
12184
|
+
'div',
|
|
12185
|
+
{ className: 'd-block text-center mb-3' },
|
|
12186
|
+
React__default.createElement(
|
|
12187
|
+
'audio',
|
|
12188
|
+
{ controls: true },
|
|
12189
|
+
React__default.createElement('source', { src: node.uploadAudio ? node.uploadAudio.asset.url : node.audioFilePth, type: 'audio/ogg' }),
|
|
12190
|
+
React__default.createElement('source', { src: node.uploadAudio ? node.uploadAudio.asset.url : node.audioFilePth, type: 'audio/mpeg' }),
|
|
12191
|
+
'Your browser does not support the audio element.'
|
|
12192
|
+
),
|
|
12193
|
+
node.caption && React__default.createElement(
|
|
12194
|
+
'p',
|
|
12195
|
+
null,
|
|
12196
|
+
node.caption
|
|
12197
|
+
)
|
|
12198
|
+
);
|
|
12199
|
+
};
|
|
12200
|
+
|
|
12149
12201
|
var YouTubeGallery = function YouTubeGallery(_ref) {
|
|
12150
12202
|
var nodes = _ref.nodes,
|
|
12151
12203
|
client = _ref.client;
|
|
@@ -12369,6 +12421,11 @@ var getSerializers$1 = function getSerializers(client, pageview) {
|
|
|
12369
12421
|
var node = _ref8.node;
|
|
12370
12422
|
|
|
12371
12423
|
return React__default.createElement(IFrame, { url: node.url });
|
|
12424
|
+
},
|
|
12425
|
+
audio: function audio(_ref9) {
|
|
12426
|
+
var node = _ref9.node;
|
|
12427
|
+
|
|
12428
|
+
return React__default.createElement(Audio, { node: node });
|
|
12372
12429
|
}
|
|
12373
12430
|
},
|
|
12374
12431
|
marks: {
|
|
@@ -12455,5 +12512,5 @@ var Feature = function Feature(props) {
|
|
|
12455
12512
|
);
|
|
12456
12513
|
};
|
|
12457
12514
|
|
|
12458
|
-
export { ContentCard as DeckContent, GridContent, DeckQueue, ThumbnailCard, TaxonomyCard, GroupDeck, YoutubeGroup, QueueDeckExpanded, Column1, Column2, Column3, Header, LeftNav, AccordionPanel, SocialShare, NavMagazine, NavNative, NavNormal, NavDvm, TemplateNormal, AD300x250, AD300x250x600, AD728x90, getSerializers$1 as getSerializers, Search, Feature };
|
|
12515
|
+
export { ContentCard as DeckContent, GridContent$1 as GridContent, DeckQueue, ThumbnailCard, TaxonomyCard, GroupDeck, YoutubeGroup, QueueDeckExpanded, Column1, Column2, Column3, Header, LeftNav, AccordionPanel, SocialShare, NavMagazine, NavNative, NavNormal, NavDvm, TemplateNormal, AD300x250, AD300x250x600, AD728x90, getSerializers$1 as getSerializers, Search, Feature };
|
|
12459
12516
|
//# sourceMappingURL=index.es.js.map
|