@mjhls/mjh-framework 1.0.120 → 1.0.122

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.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import React__default, { Component, useState, useEffect, useRef, useLayoutEffect, createElement, createContext } from 'react';
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';
@@ -21,6 +21,7 @@ import FormControl from 'react-bootstrap/FormControl';
21
21
  import Nav from 'react-bootstrap/Nav';
22
22
  import Navbar from 'react-bootstrap/Navbar';
23
23
  import NavDropdown from 'react-bootstrap/NavDropdown';
24
+ import ReactPlayer from 'react-player';
24
25
  import Pagination from 'react-bootstrap/Pagination';
25
26
  import Carousel$1 from 'react-bootstrap/Carousel';
26
27
  import Breadcrumb from 'react-bootstrap/Breadcrumb';
@@ -9506,7 +9507,7 @@ var DeckContent = function (_React$Component) {
9506
9507
  React__default.createElement(
9507
9508
  Card,
9508
9509
  { className: 'content-card', style: { flexDirection: mode } },
9509
- React__default.createElement(
9510
+ (row.thumbnail && row.thumbnail.asset || _this.props.defaultImage) && React__default.createElement(
9510
9511
  Link,
9511
9512
  { href: _this.mapping[contentCategoryName] + '/[url]', as: _this.mapping[contentCategoryName] + '/' + row.url.current },
9512
9513
  React__default.createElement(
@@ -10982,7 +10983,7 @@ var GridContent = function (_React$Component) {
10982
10983
  React__default.createElement(
10983
10984
  Card,
10984
10985
  { className: 'content-card', style: { flexDirection: index$$1 === 0 || index$$1 % 4 === 0 ? 'top' : 'row' } },
10985
- React__default.createElement(
10986
+ (row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
10986
10987
  Link,
10987
10988
  { href: _this2.mapping[contentCategoryName] + '/[url]', as: _this2.mapping[contentCategoryName] + '/' + row.url.current },
10988
10989
  React__default.createElement(
@@ -11304,7 +11305,7 @@ var DeckQueue = function (_React$Component) {
11304
11305
  React__default.createElement(
11305
11306
  Row,
11306
11307
  { style: { flexDirection: mode } },
11307
- React__default.createElement(
11308
+ (row.thumbnail && row.thumbnail.asset || _this2.props.defaultImage) && React__default.createElement(
11308
11309
  Col,
11309
11310
  { md: 12, lg: 4 },
11310
11311
  React__default.createElement(
@@ -12078,6 +12079,105 @@ var renderAuthor = function renderAuthor(authorDetail, index$$1, length) {
12078
12079
  } else return null;
12079
12080
  };
12080
12081
 
12082
+ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems) {
12083
+ var numberOfItemsBeforeAd = 6;
12084
+ return React__default.createElement(
12085
+ 'div',
12086
+ null,
12087
+ data && data.map(function (article, index$$1) {
12088
+ var pageNumber = article.pageNumber || values.page;
12089
+ var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
12090
+ return React__default.createElement(
12091
+ React__default.Fragment,
12092
+ { key: article._id ? article._id : index$$1 },
12093
+ React__default.createElement(
12094
+ VisibilitySensor,
12095
+ {
12096
+ key: article._id ? article._id : index$$1,
12097
+ onChange: function onChange(isVisible) {
12098
+ isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
12099
+ } },
12100
+ React__default.createElement(
12101
+ React__default.Fragment,
12102
+ null,
12103
+ React__default.createElement(
12104
+ Media$1,
12105
+ { key: article._id ? article._id : index$$1, style: { marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
12106
+ (article.thumbnail && article.thumbnail.asset || defaultImage) && React__default.createElement(
12107
+ Link,
12108
+ { href: mapping[contentCategoryName] + '/[url]', as: mapping[contentCategoryName] + '/' + article.url.current },
12109
+ React__default.createElement(
12110
+ 'a',
12111
+ { className: 'img-wrapper' },
12112
+ article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3 img-fluid', src: renderCardImage(article, builder, imageHeight, imageWidth), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
12113
+ )
12114
+ ),
12115
+ React__default.createElement(
12116
+ Media$1.Body,
12117
+ null,
12118
+ React__default.createElement(
12119
+ Link,
12120
+ { href: mapping[contentCategoryName] + '/[url]', as: mapping[contentCategoryName] + '/' + article.url.current },
12121
+ React__default.createElement(
12122
+ 'a',
12123
+ null,
12124
+ article.title && React__default.createElement(
12125
+ 'h4',
12126
+ { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
12127
+ article.title
12128
+ )
12129
+ )
12130
+ ),
12131
+ showPublished && article.published && React__default.createElement(
12132
+ 'p',
12133
+ { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
12134
+ moment(article.published).format('MMMM DD, YYYY')
12135
+ ),
12136
+ showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index$$1) {
12137
+ return renderAuthor(authorDetail, index$$1, article.authorMapping.length);
12138
+ }),
12139
+ showCategory && article.contentCategory && React__default.createElement(
12140
+ 'p',
12141
+ {
12142
+ style: {
12143
+ background: 'var(--highlight)',
12144
+ color: 'var(--highlight-accent)',
12145
+ marginBottom: '.25rem',
12146
+ display: 'inline-block',
12147
+ padding: '0 .25rem',
12148
+ fontSize: '.8rem'
12149
+ } },
12150
+ article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
12151
+ ),
12152
+ article.summary && React__default.createElement(
12153
+ 'p',
12154
+ { className: 'pt-2 card-text' },
12155
+ article.summary
12156
+ )
12157
+ )
12158
+ )
12159
+ )
12160
+ ),
12161
+ main_36 && rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index$$1, numberOfItemsBeforeAd, rightItems)
12162
+ );
12163
+ }),
12164
+ React__default.createElement(
12165
+ 'style',
12166
+ { jsx: true },
12167
+ '\n .img-wrapper img {\n max-height: 200px;\n width: 100%;\n object-fit: cover;\n }\n @media only screen and (min-width: 768px) {\n .img-wrapper {\n width: 42%;\n }\n .img-wrapper > img {\n padding-right: 1em;\n }\n }\n @media only screen and (max-width: 767px) {\n .img-wrapper {\n width: 100%;\n }\n .img-wrapper img {\n padding-bottom: 1em;\n }\n .media {\n flex-direction: column;\n }\n }\n '
12168
+ )
12169
+ );
12170
+ };
12171
+
12172
+ var renderMobileAd = function renderMobileAd(index$$1, numberOfItemsBeforeAd, rightItems) {
12173
+ var i = ((index$$1 + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
12174
+ return React__default.createElement(
12175
+ 'div',
12176
+ null,
12177
+ rightItems[i].component
12178
+ );
12179
+ };
12180
+
12081
12181
  var renderManualPagination = function renderManualPagination(currentPage) {
12082
12182
  return React__default.createElement(
12083
12183
  'div',
@@ -12119,7 +12219,8 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
12119
12219
  showAuthor = props.showAuthor,
12120
12220
  showCategory = props.showCategory,
12121
12221
  imageHeight = props.imageHeight,
12122
- imageWidth = props.imageWidth;
12222
+ imageWidth = props.imageWidth,
12223
+ rightItems = props.rightItems;
12123
12224
  var initialCurrentPage = props.currentPage,
12124
12225
  showPublished = props.showPublished;
12125
12226
 
@@ -12163,102 +12264,6 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
12163
12264
  }
12164
12265
  }, [values, prevValues, query, client, params, setData, setScrolling, pointer, pointerArray]);
12165
12266
 
12166
- var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth) {
12167
- var numberOfItemsBeforeAd = 6;
12168
- return React__default.createElement(
12169
- 'div',
12170
- null,
12171
- data && data.map(function (article, index$$1) {
12172
- var pageNumber = article.pageNumber || values.page;
12173
- var contentCategoryName = article.contentCategory ? article.contentCategory.name : 'Articles';
12174
- return React__default.createElement(
12175
- React__default.Fragment,
12176
- { key: article._id ? article._id : index$$1 },
12177
- React__default.createElement(
12178
- VisibilitySensor,
12179
- {
12180
- key: article._id ? article._id : index$$1,
12181
- onChange: function onChange(isVisible) {
12182
- isVisible && changePageNumber(pageNumber, seoPaginate, pageview, router, currentPage, setCurrentPage);
12183
- } },
12184
- React__default.createElement(
12185
- React__default.Fragment,
12186
- null,
12187
- React__default.createElement(
12188
- Media$1,
12189
- { key: article._id ? article._id : index$$1, style: { marginBottom: '1.25rem', paddingBottom: '1.25rem', borderBottom: '1px solid #ddd' } },
12190
- React__default.createElement(
12191
- Link,
12192
- { href: mapping[contentCategoryName] + '/[url]', as: mapping[contentCategoryName] + '/' + article.url.current },
12193
- React__default.createElement(
12194
- 'a',
12195
- null,
12196
- article.thumbnail && article.thumbnail.asset ? React__default.createElement('img', { className: 'mr-3', src: renderCardImage(article, builder, imageHeight, imageWidth), alt: article.title }) : article.thumbnail ? React__default.createElement('img', { src: article.thumbnail, className: 'mr-3', alt: article.title }) : React__default.createElement('img', { src: defaultImage, src2: article.thumbnail, className: 'mr-3', width: '240', height: '135', alt: article.title })
12197
- )
12198
- ),
12199
- React__default.createElement(
12200
- Media$1.Body,
12201
- null,
12202
- React__default.createElement(
12203
- Link,
12204
- { href: mapping[contentCategoryName] + '/[url]', as: mapping[contentCategoryName] + '/' + article.url.current },
12205
- React__default.createElement(
12206
- 'a',
12207
- null,
12208
- article.title && React__default.createElement(
12209
- 'h4',
12210
- { className: 'card-title', style: { fontWeight: '500', color: 'var(--gray-dark)', marginBottom: '.5rem' } },
12211
- article.title
12212
- )
12213
- )
12214
- ),
12215
- showPublished && article.published && React__default.createElement(
12216
- 'p',
12217
- { className: 'card-text', style: { color: 'var(--dark)', marginBottom: '.25rem' } },
12218
- moment(article.published).format('MMMM DD, YYYY')
12219
- ),
12220
- showAuthor && article.authorMapping && article.authorMapping.length > 0 && article.authorMapping.map(function (authorDetail, index$$1) {
12221
- return renderAuthor(authorDetail, index$$1, article.authorMapping.length);
12222
- }),
12223
- showCategory && article.contentCategory && React__default.createElement(
12224
- 'p',
12225
- {
12226
- style: {
12227
- background: 'var(--highlight)',
12228
- color: 'var(--highlight-accent)',
12229
- marginBottom: '.25rem',
12230
- display: 'inline-block',
12231
- padding: '0 .25rem',
12232
- fontSize: '.8rem'
12233
- } },
12234
- article.contentCategory.name.slice(0, article.contentCategory.name.length - 1)
12235
- ),
12236
- article.summary && React__default.createElement(
12237
- 'p',
12238
- { className: 'pt-2 card-text' },
12239
- article.summary
12240
- )
12241
- )
12242
- )
12243
- )
12244
- ),
12245
- main_36 && props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && renderMobileAd(index$$1, numberOfItemsBeforeAd)
12246
- );
12247
- })
12248
- );
12249
- };
12250
-
12251
- var renderMobileAd = function renderMobileAd(index$$1, numberOfItemsBeforeAd) {
12252
- var rightItems = props.rightItems;
12253
-
12254
- var i = ((index$$1 + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
12255
- return React__default.createElement(
12256
- 'div',
12257
- null,
12258
- rightItems[i].component
12259
- );
12260
- };
12261
-
12262
12267
  return React__default.createElement(
12263
12268
  'div',
12264
12269
  null,
@@ -12273,7 +12278,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
12273
12278
  React__default.createElement(
12274
12279
  Container$1,
12275
12280
  null,
12276
- cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth)
12281
+ cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, imageHeight, imageWidth, rightItems)
12277
12282
  )
12278
12283
  ),
12279
12284
  React__default.createElement(
@@ -12287,7 +12292,7 @@ var QueueDeckExpanded = function QueueDeckExpanded(props) {
12287
12292
  React__default.createElement(
12288
12293
  Container$1,
12289
12294
  null,
12290
- cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory)
12295
+ cardLoader(data, builder, mapping, values, seoPaginate, pageview, router, currentPage, setCurrentPage, showPublished, defaultImage, showAuthor, showCategory, rightItems)
12291
12296
  ),
12292
12297
  React__default.createElement(
12293
12298
  'div',
@@ -13448,342 +13453,11 @@ var NavFooter = function NavFooter(props) {
13448
13453
  );
13449
13454
  };
13450
13455
 
13451
- /*!
13452
- * cookie
13453
- * Copyright(c) 2012-2014 Roman Shtylman
13454
- * Copyright(c) 2015 Douglas Christopher Wilson
13455
- * MIT Licensed
13456
- */
13457
-
13458
- /**
13459
- * Module exports.
13460
- * @public
13461
- */
13462
-
13463
- var parse_1 = parse;
13464
- var serialize_1 = serialize;
13465
-
13466
- /**
13467
- * Module variables.
13468
- * @private
13469
- */
13470
-
13471
- var decode = decodeURIComponent;
13472
- var encode = encodeURIComponent;
13473
- var pairSplitRegExp = /; */;
13474
-
13475
- /**
13476
- * RegExp to match field-content in RFC 7230 sec 3.2
13477
- *
13478
- * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
13479
- * field-vchar = VCHAR / obs-text
13480
- * obs-text = %x80-FF
13481
- */
13482
-
13483
- var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
13484
-
13485
- /**
13486
- * Parse a cookie header.
13487
- *
13488
- * Parse the given cookie header string into an object
13489
- * The object has the various cookies as keys(names) => values
13490
- *
13491
- * @param {string} str
13492
- * @param {object} [options]
13493
- * @return {object}
13494
- * @public
13495
- */
13496
-
13497
- function parse(str, options) {
13498
- if (typeof str !== 'string') {
13499
- throw new TypeError('argument str must be a string');
13500
- }
13501
-
13502
- var obj = {};
13503
- var opt = options || {};
13504
- var pairs = str.split(pairSplitRegExp);
13505
- var dec = opt.decode || decode;
13506
-
13507
- for (var i = 0; i < pairs.length; i++) {
13508
- var pair = pairs[i];
13509
- var eq_idx = pair.indexOf('=');
13510
-
13511
- // skip things that don't look like key=value
13512
- if (eq_idx < 0) {
13513
- continue;
13514
- }
13515
-
13516
- var key = pair.substr(0, eq_idx).trim();
13517
- var val = pair.substr(++eq_idx, pair.length).trim();
13518
-
13519
- // quoted values
13520
- if ('"' == val[0]) {
13521
- val = val.slice(1, -1);
13522
- }
13523
-
13524
- // only assign once
13525
- if (undefined == obj[key]) {
13526
- obj[key] = tryDecode(val, dec);
13527
- }
13528
- }
13529
-
13530
- return obj;
13531
- }
13532
-
13533
- /**
13534
- * Serialize data into a cookie header.
13535
- *
13536
- * Serialize the a name value pair into a cookie string suitable for
13537
- * http headers. An optional options object specified cookie parameters.
13538
- *
13539
- * serialize('foo', 'bar', { httpOnly: true })
13540
- * => "foo=bar; httpOnly"
13541
- *
13542
- * @param {string} name
13543
- * @param {string} val
13544
- * @param {object} [options]
13545
- * @return {string}
13546
- * @public
13547
- */
13548
-
13549
- function serialize(name, val, options) {
13550
- var opt = options || {};
13551
- var enc = opt.encode || encode;
13552
-
13553
- if (typeof enc !== 'function') {
13554
- throw new TypeError('option encode is invalid');
13555
- }
13556
-
13557
- if (!fieldContentRegExp.test(name)) {
13558
- throw new TypeError('argument name is invalid');
13559
- }
13560
-
13561
- var value = enc(val);
13562
-
13563
- if (value && !fieldContentRegExp.test(value)) {
13564
- throw new TypeError('argument val is invalid');
13565
- }
13566
-
13567
- var str = name + '=' + value;
13568
-
13569
- if (null != opt.maxAge) {
13570
- var maxAge = opt.maxAge - 0;
13571
- if (isNaN(maxAge)) throw new Error('maxAge should be a Number');
13572
- str += '; Max-Age=' + Math.floor(maxAge);
13573
- }
13574
-
13575
- if (opt.domain) {
13576
- if (!fieldContentRegExp.test(opt.domain)) {
13577
- throw new TypeError('option domain is invalid');
13578
- }
13579
-
13580
- str += '; Domain=' + opt.domain;
13581
- }
13582
-
13583
- if (opt.path) {
13584
- if (!fieldContentRegExp.test(opt.path)) {
13585
- throw new TypeError('option path is invalid');
13586
- }
13587
-
13588
- str += '; Path=' + opt.path;
13589
- }
13590
-
13591
- if (opt.expires) {
13592
- if (typeof opt.expires.toUTCString !== 'function') {
13593
- throw new TypeError('option expires is invalid');
13594
- }
13595
-
13596
- str += '; Expires=' + opt.expires.toUTCString();
13597
- }
13598
-
13599
- if (opt.httpOnly) {
13600
- str += '; HttpOnly';
13601
- }
13602
-
13603
- if (opt.secure) {
13604
- str += '; Secure';
13605
- }
13606
-
13607
- if (opt.sameSite) {
13608
- var sameSite = typeof opt.sameSite === 'string'
13609
- ? opt.sameSite.toLowerCase() : opt.sameSite;
13610
-
13611
- switch (sameSite) {
13612
- case true:
13613
- str += '; SameSite=Strict';
13614
- break;
13615
- case 'lax':
13616
- str += '; SameSite=Lax';
13617
- break;
13618
- case 'strict':
13619
- str += '; SameSite=Strict';
13620
- break;
13621
- case 'none':
13622
- str += '; SameSite=None';
13623
- break;
13624
- default:
13625
- throw new TypeError('option sameSite is invalid');
13626
- }
13627
- }
13628
-
13629
- return str;
13630
- }
13631
-
13632
- /**
13633
- * Try decoding a string using a decoding function.
13634
- *
13635
- * @param {string} str
13636
- * @param {function} decode
13637
- * @private
13638
- */
13639
-
13640
- function tryDecode(str, decode) {
13641
- try {
13642
- return decode(str);
13643
- } catch (e) {
13644
- return str;
13645
- }
13646
- }
13647
-
13648
- function hasDocumentCookie() {
13649
- // Can we get/set cookies on document.cookie?
13650
- return typeof document === 'object' && typeof document.cookie === 'string';
13651
- }
13652
- function parseCookies(cookies, options) {
13653
- if (typeof cookies === 'string') {
13654
- return parse_1(cookies, options);
13655
- }
13656
- else if (typeof cookies === 'object' && cookies !== null) {
13657
- return cookies;
13658
- }
13659
- else {
13660
- return {};
13661
- }
13662
- }
13663
- function isParsingCookie(value, doNotParse) {
13664
- if (typeof doNotParse === 'undefined') {
13665
- // We guess if the cookie start with { or [, it has been serialized
13666
- doNotParse =
13667
- !value || (value[0] !== '{' && value[0] !== '[' && value[0] !== '"');
13668
- }
13669
- return !doNotParse;
13670
- }
13671
- function readCookie(value, options) {
13672
- if (options === void 0) { options = {}; }
13673
- var cleanValue = cleanupCookieValue(value);
13674
- if (isParsingCookie(cleanValue, options.doNotParse)) {
13675
- try {
13676
- return JSON.parse(cleanValue);
13677
- }
13678
- catch (e) {
13679
- // At least we tried
13680
- }
13681
- }
13682
- // Ignore clean value if we failed the deserialization
13683
- // It is not relevant anymore to trim those values
13684
- return value;
13685
- }
13686
- function cleanupCookieValue(value) {
13687
- // express prepend j: before serializing a cookie
13688
- if (value && value[0] === 'j' && value[1] === ':') {
13689
- return value.substr(2);
13690
- }
13691
- return value;
13692
- }
13693
-
13694
- // We can't please Rollup and TypeScript at the same time
13695
- // Only way to make both of them work
13696
- var objectAssign = require('object-assign');
13697
- var Cookies = /** @class */ (function () {
13698
- function Cookies(cookies, options) {
13699
- var _this = this;
13700
- this.changeListeners = [];
13701
- this.HAS_DOCUMENT_COOKIE = false;
13702
- this.cookies = parseCookies(cookies, options);
13703
- new Promise(function () {
13704
- _this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();
13705
- }).catch(function () { });
13706
- }
13707
- Cookies.prototype._updateBrowserValues = function (parseOptions) {
13708
- if (!this.HAS_DOCUMENT_COOKIE) {
13709
- return;
13710
- }
13711
- this.cookies = parse_1(document.cookie, parseOptions);
13712
- };
13713
- Cookies.prototype._emitChange = function (params) {
13714
- for (var i = 0; i < this.changeListeners.length; ++i) {
13715
- this.changeListeners[i](params);
13716
- }
13717
- };
13718
- Cookies.prototype.get = function (name, options, parseOptions) {
13719
- if (options === void 0) { options = {}; }
13720
- this._updateBrowserValues(parseOptions);
13721
- return readCookie(this.cookies[name], options);
13722
- };
13723
- Cookies.prototype.getAll = function (options, parseOptions) {
13724
- if (options === void 0) { options = {}; }
13725
- this._updateBrowserValues(parseOptions);
13726
- var result = {};
13727
- for (var name_1 in this.cookies) {
13728
- result[name_1] = readCookie(this.cookies[name_1], options);
13729
- }
13730
- return result;
13731
- };
13732
- Cookies.prototype.set = function (name, value, options) {
13733
- var _a;
13734
- if (typeof value === 'object') {
13735
- value = JSON.stringify(value);
13736
- }
13737
- this.cookies = objectAssign({}, this.cookies, (_a = {}, _a[name] = value, _a));
13738
- if (this.HAS_DOCUMENT_COOKIE) {
13739
- document.cookie = serialize_1(name, value, options);
13740
- }
13741
- this._emitChange({ name: name, value: value, options: options });
13742
- };
13743
- Cookies.prototype.remove = function (name, options) {
13744
- var finalOptions = (options = objectAssign({}, options, {
13745
- expires: new Date(1970, 1, 1, 0, 0, 1),
13746
- maxAge: 0
13747
- }));
13748
- this.cookies = objectAssign({}, this.cookies);
13749
- delete this.cookies[name];
13750
- if (this.HAS_DOCUMENT_COOKIE) {
13751
- document.cookie = serialize_1(name, '', finalOptions);
13752
- }
13753
- this._emitChange({ name: name, value: undefined, options: options });
13754
- };
13755
- Cookies.prototype.addChangeListener = function (callback) {
13756
- this.changeListeners.push(callback);
13757
- };
13758
- Cookies.prototype.removeChangeListener = function (callback) {
13759
- var idx = this.changeListeners.indexOf(callback);
13760
- if (idx >= 0) {
13761
- this.changeListeners.splice(idx, 1);
13762
- }
13763
- };
13764
- return Cookies;
13765
- }());
13766
-
13767
- var Cookies$1 = Cookies;
13768
- // we seem to sometimes get the ES6 version despite requesting cjs here, not sure why
13769
- // this isn't the ideal fix, but it'll do for now
13770
- Cookies$1 = Cookies$1.default || Cookies$1;
13771
-
13772
- function nextCookies(ctx, options) {
13773
- // Note: Next.js Static export sets ctx.req to a fake request with no headers
13774
- var header = ctx.req && ctx.req.headers && ctx.req.headers.cookie;
13775
- var uc = new Cookies$1(header);
13776
- return uc.getAll(options);
13777
- }
13778
-
13779
- var nextCookies_1 = nextCookies;
13780
-
13781
13456
  var NavMagazine = function NavMagazine(props) {
13782
13457
  /*
13783
13458
  Example Nav with acceptable props
13784
13459
  <MagazineNav
13785
13460
  showLogin
13786
- loginState={true}
13787
13461
  logo={props.settings.logo}
13788
13462
  dataObject={props.cache.mainNavCache}
13789
13463
  website={website}
@@ -13798,7 +13472,7 @@ var NavMagazine = function NavMagazine(props) {
13798
13472
  website = props.website,
13799
13473
  _props$showLogin = props.showLogin,
13800
13474
  showLogin = _props$showLogin === undefined ? false : _props$showLogin,
13801
- allCookies = props.allCookies;
13475
+ _props$userData = props.userData;
13802
13476
 
13803
13477
  var navRef = useRef(null);
13804
13478
 
@@ -13812,13 +13486,6 @@ var NavMagazine = function NavMagazine(props) {
13812
13486
  screenWidth = _useState4[0],
13813
13487
  setScreenWidth = _useState4[1];
13814
13488
 
13815
- var initialLoginState = allCookies.loggedIn;
13816
-
13817
- var _useState5 = useState(initialLoginState),
13818
- _useState6 = slicedToArray(_useState5, 2),
13819
- loginState = _useState6[0],
13820
- setLoginState = _useState6[1];
13821
-
13822
13489
  useEffect(function () {
13823
13490
  document.addEventListener('scroll', trackScrolling);
13824
13491
  return function () {
@@ -13831,50 +13498,6 @@ var NavMagazine = function NavMagazine(props) {
13831
13498
  setScreenWidth(parseInt(window.innerWidth));
13832
13499
  }, []);
13833
13500
 
13834
- useLayoutEffect(function () {
13835
- if (typeof GCN !== 'undefined') {
13836
- GCN.on('init').then(function (data) {
13837
- console.log('GCN init...');
13838
- setLoginState(data.loggedin);
13839
- if (data.loggedIn) {
13840
- console.log(' - logged in status');
13841
- document.cookie = 'loggedIn=' + data.loggedIn + '; path=/';
13842
- } else {
13843
- console.log(' - logged out status');
13844
- document.cookie = 'loggedIn=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT';
13845
- }
13846
- });
13847
-
13848
- GCN.on('login').then(function (data) {
13849
- setLoginState(data.loggedin);
13850
- console.log('GCN login...');
13851
- document.cookie = 'loggedIn=' + data.loggedIn + '; path=/';
13852
- });
13853
-
13854
- GCN.on('logout').then(function (data) {
13855
- setLoginState(data.loggedin);
13856
- console.log('GCN logout...');
13857
- document.cookie = 'loggedIn=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT';
13858
- });
13859
- } else {
13860
- console.error('GCN not defined for GCN events');
13861
- }
13862
- }, []);
13863
-
13864
- useEffect(function () {
13865
- toggleLogin();
13866
- }, [loginState]);
13867
-
13868
- var toggleLogin = function toggleLogin() {
13869
- if (loginState) {
13870
- document.getElementsByClassName('logged-in').style.display = '';
13871
- document.getElementsByClassName('logged-out').style.display = 'none';
13872
- } else {
13873
- document.getElementsByClassName('logged-in').style.display = 'none';
13874
- document.getElementsByClassName('logged-out').style.display = '';
13875
- }
13876
- };
13877
-
13878
13501
  var trackScrolling = function trackScrolling() {
13879
13502
  var offsetTop = navRef.current.getBoundingClientRect().top;
13880
13503
 
@@ -13887,13 +13510,7 @@ var NavMagazine = function NavMagazine(props) {
13887
13510
 
13888
13511
  var handleLogin = function handleLogin(e) {
13889
13512
  if (typeof GCN !== 'undefined' && GCN && GCN.onecount) {
13890
- GCN.onecount.login().then(function (result) {
13891
- console.log('login result: ', result);
13892
- setLoginState(GCN.onecount.isLoggedIn());
13893
- }).catch(function (error) {
13894
- console.log('login error:', error);
13895
- setLoginState(GCN.onecount.isLoggedIn());
13896
- });
13513
+ GCN.onecount.login();
13897
13514
  } else {
13898
13515
  console.error('GCN not defined');
13899
13516
  }
@@ -13901,13 +13518,7 @@ var NavMagazine = function NavMagazine(props) {
13901
13518
 
13902
13519
  var handleLogout = function handleLogout(e) {
13903
13520
  if (typeof GCN !== 'undefined' && GCN && GCN.onecount) {
13904
- GCN.onecount.logout().then(function (result) {
13905
- console.log('logout result:', result);
13906
- setLoginState(GCN.onecount.isLoggedIn());
13907
- }).catch(function (error) {
13908
- console.log('logout error:', error);
13909
- setLoginState(GCN.onecount.isLoggedIn());
13910
- });
13521
+ GCN.onecount.logout();
13911
13522
  } else {
13912
13523
  console.error('GCN not defined');
13913
13524
  }
@@ -13927,7 +13538,7 @@ var NavMagazine = function NavMagazine(props) {
13927
13538
  { id: 'navbar-top', className: 'justify-content-center navbar-top', style: { margin: '0 auto' } },
13928
13539
  showLogin && React__default.createElement(
13929
13540
  Nav.Item,
13930
- { id: 'nav-mobile-register', className: 'logged-out', style: { display: loginState ? 'none' : '' } },
13541
+ { id: 'nav-mobile-register', className: 'hide-on-login', style: { display: 'none' } },
13931
13542
  React__default.createElement(
13932
13543
  'div',
13933
13544
  { className: 'px-2 py-2', onClick: function onClick(e) {
@@ -13952,7 +13563,7 @@ var NavMagazine = function NavMagazine(props) {
13952
13563
  ),
13953
13564
  showLogin && React__default.createElement(
13954
13565
  Nav.Item,
13955
- { id: 'nav-mobile-login', className: 'logged-out', style: { display: loginState ? 'none' : '' } },
13566
+ { id: 'nav-mobile-login', className: 'hide-on-login', style: { display: 'none' } },
13956
13567
  React__default.createElement(
13957
13568
  'div',
13958
13569
  { className: 'px-2 py-2 ', onClick: function onClick(e) {
@@ -13964,10 +13575,10 @@ var NavMagazine = function NavMagazine(props) {
13964
13575
  ),
13965
13576
  showLogin && React__default.createElement(
13966
13577
  React__default.Fragment,
13967
- { className: 'logged-in', style: { display: !loginState ? 'none' : '' } },
13578
+ null,
13968
13579
  React__default.createElement(
13969
13580
  Nav.Item,
13970
- { id: 'nav-mobile-logout' },
13581
+ { id: 'nav-mobile-logout', className: 'hide-on-logout', style: { display: 'none' } },
13971
13582
  React__default.createElement(
13972
13583
  'div',
13973
13584
  { className: 'pl-2 pr-3 py-2 text-right', onClick: function onClick(e) {
@@ -13984,10 +13595,10 @@ var NavMagazine = function NavMagazine(props) {
13984
13595
  { style: { position: 'absolute', right: '15px' }, className: 'justify-content-end rightHeader' },
13985
13596
  showLogin && React__default.createElement(
13986
13597
  React__default.Fragment,
13987
- { className: 'logged-out', style: { display: loginState ? 'none' : '' } },
13598
+ null,
13988
13599
  React__default.createElement(
13989
13600
  Nav.Item,
13990
- null,
13601
+ { className: 'hide-on-login', style: { display: 'none' } },
13991
13602
  React__default.createElement(
13992
13603
  'div',
13993
13604
  { className: 'px-2 py-2 mr-2', id: 'nav-register', onClick: function onClick(e) {
@@ -13999,7 +13610,7 @@ var NavMagazine = function NavMagazine(props) {
13999
13610
  ),
14000
13611
  React__default.createElement(
14001
13612
  Nav.Item,
14002
- null,
13613
+ { className: 'hide-on-login', style: { display: 'none' } },
14003
13614
  React__default.createElement(
14004
13615
  'div',
14005
13616
  { className: 'px-2 py-2', id: 'nav-login', onClick: function onClick(e) {
@@ -14012,10 +13623,10 @@ var NavMagazine = function NavMagazine(props) {
14012
13623
  ),
14013
13624
  showLogin && React__default.createElement(
14014
13625
  React__default.Fragment,
14015
- { className: 'logged-in', style: { display: !loginState ? 'none' : '' } },
13626
+ null,
14016
13627
  React__default.createElement(
14017
13628
  Nav.Item,
14018
- null,
13629
+ { className: 'hide-on-logout', style: { display: 'none' } },
14019
13630
  React__default.createElement(
14020
13631
  'div',
14021
13632
  { className: 'px-2 py-2', id: 'nav-logout', onClick: function onClick(e) {
@@ -14154,12 +13765,6 @@ var NavMagazine = function NavMagazine(props) {
14154
13765
  );
14155
13766
  };
14156
13767
 
14157
- NavMagazine.getInitialProps = function (ctx) {
14158
- return {
14159
- allCookies: nextCookies_1(ctx)
14160
- };
14161
- };
14162
-
14163
13768
  var NavNative = function NavNative(props) {
14164
13769
  var logo = props.logo,
14165
13770
  dataObject = props.dataObject,
@@ -15133,7 +14738,7 @@ var ms = function(val, options) {
15133
14738
  options = options || {};
15134
14739
  var type = typeof val;
15135
14740
  if (type === 'string' && val.length > 0) {
15136
- return parse$1(val);
14741
+ return parse(val);
15137
14742
  } else if (type === 'number' && isNaN(val) === false) {
15138
14743
  return options.long ? fmtLong(val) : fmtShort(val);
15139
14744
  }
@@ -15151,7 +14756,7 @@ var ms = function(val, options) {
15151
14756
  * @api private
15152
14757
  */
15153
14758
 
15154
- function parse$1(str) {
14759
+ function parse(str) {
15155
14760
  str = String(str);
15156
14761
  if (str.length > 100) {
15157
14762
  return;
@@ -17566,7 +17171,7 @@ function shouldUseNative() {
17566
17171
  }
17567
17172
  }
17568
17173
 
17569
- var objectAssign$1 = shouldUseNative() ? Object.assign : function (target, source) {
17174
+ var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
17570
17175
  var from;
17571
17176
  var to = toObject(target);
17572
17177
  var symbols;
@@ -17641,7 +17246,7 @@ var buildUrl = function buildUrl(props) {
17641
17246
  throw new Error('Invalid image reference in block, no `_ref` found on `asset`');
17642
17247
  }
17643
17248
 
17644
- return node(objectAssign$1({
17249
+ return node(objectAssign({
17645
17250
  projectId: projectId,
17646
17251
  dataset: dataset
17647
17252
  }, options.imageOptions || {})).image(node$$1).toString();
@@ -17781,7 +17386,7 @@ var serializers = function (h, serializerOpts) {
17781
17386
  };
17782
17387
  }
17783
17388
 
17784
- var serializedNode = objectAssign$1({}, span, children);
17389
+ var serializedNode = objectAssign({}, span, children);
17785
17390
  return h(serializers.span, {
17786
17391
  key: span._key || "span-".concat(index),
17787
17392
  node: serializedNode,
@@ -18019,7 +17624,7 @@ function nestLists(blocks) {
18019
17624
  // will mutate the input, and we don't want to blindly clone the entire tree.
18020
17625
  // Clone the last child while adding our new list as the last child of it
18021
17626
  var lastListItem = lastChild(currentList);
18022
- var newLastChild = objectAssign$1({}, lastListItem, {
17627
+ var newLastChild = objectAssign({}, lastListItem, {
18023
17628
  children: lastListItem.children.concat(newList)
18024
17629
  }); // Swap the last child
18025
17630
 
@@ -18121,7 +17726,7 @@ var generateKeys = function (blocks) {
18121
17726
  return block;
18122
17727
  }
18123
17728
 
18124
- return objectAssign$1({
17729
+ return objectAssign({
18125
17730
  _key: getStaticKey(block)
18126
17731
  }, block);
18127
17732
  });
@@ -18165,7 +17770,7 @@ var mergeSerializers = function mergeSerializers(defaultSerializers, userSeriali
18165
17770
  if (type === 'function') {
18166
17771
  acc[key] = isDefined(userSerializers[key]) ? userSerializers[key] : defaultSerializers[key];
18167
17772
  } else if (type === 'object') {
18168
- acc[key] = objectAssign$1({}, defaultSerializers[key], userSerializers[key]);
17773
+ acc[key] = objectAssign({}, defaultSerializers[key], userSerializers[key]);
18169
17774
  } else {
18170
17775
  acc[key] = typeof userSerializers[key] === 'undefined' ? defaultSerializers[key] : userSerializers[key];
18171
17776
  }
@@ -18188,7 +17793,7 @@ var defaults$1 = {
18188
17793
  };
18189
17794
 
18190
17795
  function blocksToNodes(h, properties, defaultSerializers, serializeSpan) {
18191
- var props = objectAssign$1({}, defaults$1, properties);
17796
+ var props = objectAssign({}, defaults$1, properties);
18192
17797
  var rawBlocks = Array.isArray(props.blocks) ? props.blocks : [props.blocks];
18193
17798
  var keyedBlocks = generateKeys(rawBlocks);
18194
17799
  var blocks = nestLists_1(keyedBlocks, props.listNestMode);
@@ -18672,7 +18277,7 @@ function removeEventListener(type, listener) {
18672
18277
  }
18673
18278
  }
18674
18279
 
18675
- var serialize$1 = serializeNode;
18280
+ var serialize = serializeNode;
18676
18281
 
18677
18282
  var voidElements = ["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];
18678
18283
 
@@ -18974,7 +18579,7 @@ DOMElement.prototype.focus = function _Element_focus() {
18974
18579
  };
18975
18580
 
18976
18581
  DOMElement.prototype.toString = function _Element_toString() {
18977
- return serialize$1(this)
18582
+ return serialize(this)
18978
18583
  };
18979
18584
 
18980
18585
  DOMElement.prototype.getElementsByClassName = function _Element_getElementsByClassName(classNames) {
@@ -20766,22 +20371,31 @@ var Video = function Video(_ref) {
20766
20371
  var Audio = function Audio(_ref) {
20767
20372
  var node = _ref.node;
20768
20373
 
20769
- return React__default.createElement(
20770
- 'div',
20771
- { className: 'd-block text-center mb-3' },
20772
- React__default.createElement(
20773
- 'audio',
20774
- { controls: true, controlsList: 'nodownload' },
20775
- React__default.createElement('source', { src: node.uploadAudio ? node.uploadAudio.asset.url : node.audioFilePth, type: 'audio/ogg' }),
20776
- React__default.createElement('source', { src: node.uploadAudio ? node.uploadAudio.asset.url : node.audioFilePth, type: 'audio/mpeg' }),
20777
- 'Your browser does not support the audio element.'
20778
- ),
20779
- node.caption && React__default.createElement(
20780
- 'p',
20781
- null,
20782
- node.caption
20783
- )
20784
- );
20374
+ if (node.uploadAudio) {
20375
+ return React__default.createElement(
20376
+ 'div',
20377
+ { className: 'audio d-block text-center mb-3' },
20378
+ React__default.createElement(
20379
+ 'audio',
20380
+ { controls: true, controlsList: 'nodownload', className: 'audio' },
20381
+ React__default.createElement('source', { src: node.uploadAudio.asset.url, type: 'audio/ogg' }),
20382
+ React__default.createElement('source', { src: node.uploadAudio.asset.url, type: 'audio/mpeg' }),
20383
+ 'Your browser does not support the audio element.'
20384
+ )
20385
+ );
20386
+ } else if (node.audioFilePth) {
20387
+ var hostname = new URL(node.audioFilePth).hostname;
20388
+ if (hostname === 'embeds.audioboom.com') {
20389
+ return React__default.createElement('iframe', { src: node.audioFilePth, width: '100%', height: '300', className: 'audio', style: { border: 'none' } });
20390
+ }
20391
+ return React__default.createElement(
20392
+ 'div',
20393
+ { className: 'audio' },
20394
+ React__default.createElement(ReactPlayer, { url: node.audioFilePth, controls: true, width: '100%', height: '100%' })
20395
+ );
20396
+ }
20397
+
20398
+ return null;
20785
20399
  };
20786
20400
 
20787
20401
  var YouTubeGallery = function YouTubeGallery(_ref) {