@mjhls/mjh-framework 1.0.120 → 1.0.121
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 +24 -424
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +23 -423
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
package/README.md
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React__default, { Component, useState, useEffect, useRef,
|
|
1
|
+
import React__default, { Component, useState, useEffect, useRef, createContext, createElement } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import reactDom from 'react-dom';
|
|
4
4
|
import Container from 'react-bootstrap/Container';
|
|
@@ -13448,342 +13448,11 @@ var NavFooter = function NavFooter(props) {
|
|
|
13448
13448
|
);
|
|
13449
13449
|
};
|
|
13450
13450
|
|
|
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
13451
|
var NavMagazine = function NavMagazine(props) {
|
|
13782
13452
|
/*
|
|
13783
13453
|
Example Nav with acceptable props
|
|
13784
13454
|
<MagazineNav
|
|
13785
13455
|
showLogin
|
|
13786
|
-
loginState={true}
|
|
13787
13456
|
logo={props.settings.logo}
|
|
13788
13457
|
dataObject={props.cache.mainNavCache}
|
|
13789
13458
|
website={website}
|
|
@@ -13798,7 +13467,7 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13798
13467
|
website = props.website,
|
|
13799
13468
|
_props$showLogin = props.showLogin,
|
|
13800
13469
|
showLogin = _props$showLogin === undefined ? false : _props$showLogin,
|
|
13801
|
-
|
|
13470
|
+
_props$userData = props.userData;
|
|
13802
13471
|
|
|
13803
13472
|
var navRef = useRef(null);
|
|
13804
13473
|
|
|
@@ -13812,13 +13481,6 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13812
13481
|
screenWidth = _useState4[0],
|
|
13813
13482
|
setScreenWidth = _useState4[1];
|
|
13814
13483
|
|
|
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
13484
|
useEffect(function () {
|
|
13823
13485
|
document.addEventListener('scroll', trackScrolling);
|
|
13824
13486
|
return function () {
|
|
@@ -13831,50 +13493,6 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13831
13493
|
setScreenWidth(parseInt(window.innerWidth));
|
|
13832
13494
|
}, []);
|
|
13833
13495
|
|
|
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
13496
|
var trackScrolling = function trackScrolling() {
|
|
13879
13497
|
var offsetTop = navRef.current.getBoundingClientRect().top;
|
|
13880
13498
|
|
|
@@ -13887,13 +13505,7 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13887
13505
|
|
|
13888
13506
|
var handleLogin = function handleLogin(e) {
|
|
13889
13507
|
if (typeof GCN !== 'undefined' && GCN && GCN.onecount) {
|
|
13890
|
-
GCN.onecount.login()
|
|
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
|
-
});
|
|
13508
|
+
GCN.onecount.login();
|
|
13897
13509
|
} else {
|
|
13898
13510
|
console.error('GCN not defined');
|
|
13899
13511
|
}
|
|
@@ -13901,13 +13513,7 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13901
13513
|
|
|
13902
13514
|
var handleLogout = function handleLogout(e) {
|
|
13903
13515
|
if (typeof GCN !== 'undefined' && GCN && GCN.onecount) {
|
|
13904
|
-
GCN.onecount.logout()
|
|
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
|
-
});
|
|
13516
|
+
GCN.onecount.logout();
|
|
13911
13517
|
} else {
|
|
13912
13518
|
console.error('GCN not defined');
|
|
13913
13519
|
}
|
|
@@ -13927,7 +13533,7 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13927
13533
|
{ id: 'navbar-top', className: 'justify-content-center navbar-top', style: { margin: '0 auto' } },
|
|
13928
13534
|
showLogin && React__default.createElement(
|
|
13929
13535
|
Nav.Item,
|
|
13930
|
-
{ id: 'nav-mobile-register', className: '
|
|
13536
|
+
{ id: 'nav-mobile-register', className: 'hide-on-login', style: { display: 'none' } },
|
|
13931
13537
|
React__default.createElement(
|
|
13932
13538
|
'div',
|
|
13933
13539
|
{ className: 'px-2 py-2', onClick: function onClick(e) {
|
|
@@ -13952,7 +13558,7 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13952
13558
|
),
|
|
13953
13559
|
showLogin && React__default.createElement(
|
|
13954
13560
|
Nav.Item,
|
|
13955
|
-
{ id: 'nav-mobile-login', className: '
|
|
13561
|
+
{ id: 'nav-mobile-login', className: 'hide-on-login', style: { display: 'none' } },
|
|
13956
13562
|
React__default.createElement(
|
|
13957
13563
|
'div',
|
|
13958
13564
|
{ className: 'px-2 py-2 ', onClick: function onClick(e) {
|
|
@@ -13964,10 +13570,10 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13964
13570
|
),
|
|
13965
13571
|
showLogin && React__default.createElement(
|
|
13966
13572
|
React__default.Fragment,
|
|
13967
|
-
|
|
13573
|
+
null,
|
|
13968
13574
|
React__default.createElement(
|
|
13969
13575
|
Nav.Item,
|
|
13970
|
-
{ id: 'nav-mobile-logout' },
|
|
13576
|
+
{ id: 'nav-mobile-logout', className: 'hide-on-logout', style: { display: 'none' } },
|
|
13971
13577
|
React__default.createElement(
|
|
13972
13578
|
'div',
|
|
13973
13579
|
{ className: 'pl-2 pr-3 py-2 text-right', onClick: function onClick(e) {
|
|
@@ -13984,10 +13590,10 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13984
13590
|
{ style: { position: 'absolute', right: '15px' }, className: 'justify-content-end rightHeader' },
|
|
13985
13591
|
showLogin && React__default.createElement(
|
|
13986
13592
|
React__default.Fragment,
|
|
13987
|
-
|
|
13593
|
+
null,
|
|
13988
13594
|
React__default.createElement(
|
|
13989
13595
|
Nav.Item,
|
|
13990
|
-
|
|
13596
|
+
{ className: 'hide-on-login', style: { display: 'none' } },
|
|
13991
13597
|
React__default.createElement(
|
|
13992
13598
|
'div',
|
|
13993
13599
|
{ className: 'px-2 py-2 mr-2', id: 'nav-register', onClick: function onClick(e) {
|
|
@@ -13999,7 +13605,7 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13999
13605
|
),
|
|
14000
13606
|
React__default.createElement(
|
|
14001
13607
|
Nav.Item,
|
|
14002
|
-
|
|
13608
|
+
{ className: 'hide-on-login', style: { display: 'none' } },
|
|
14003
13609
|
React__default.createElement(
|
|
14004
13610
|
'div',
|
|
14005
13611
|
{ className: 'px-2 py-2', id: 'nav-login', onClick: function onClick(e) {
|
|
@@ -14012,10 +13618,10 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
14012
13618
|
),
|
|
14013
13619
|
showLogin && React__default.createElement(
|
|
14014
13620
|
React__default.Fragment,
|
|
14015
|
-
|
|
13621
|
+
null,
|
|
14016
13622
|
React__default.createElement(
|
|
14017
13623
|
Nav.Item,
|
|
14018
|
-
|
|
13624
|
+
{ className: 'hide-on-logout', style: { display: 'none' } },
|
|
14019
13625
|
React__default.createElement(
|
|
14020
13626
|
'div',
|
|
14021
13627
|
{ className: 'px-2 py-2', id: 'nav-logout', onClick: function onClick(e) {
|
|
@@ -14154,12 +13760,6 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
14154
13760
|
);
|
|
14155
13761
|
};
|
|
14156
13762
|
|
|
14157
|
-
NavMagazine.getInitialProps = function (ctx) {
|
|
14158
|
-
return {
|
|
14159
|
-
allCookies: nextCookies_1(ctx)
|
|
14160
|
-
};
|
|
14161
|
-
};
|
|
14162
|
-
|
|
14163
13763
|
var NavNative = function NavNative(props) {
|
|
14164
13764
|
var logo = props.logo,
|
|
14165
13765
|
dataObject = props.dataObject,
|
|
@@ -15133,7 +14733,7 @@ var ms = function(val, options) {
|
|
|
15133
14733
|
options = options || {};
|
|
15134
14734
|
var type = typeof val;
|
|
15135
14735
|
if (type === 'string' && val.length > 0) {
|
|
15136
|
-
return parse
|
|
14736
|
+
return parse(val);
|
|
15137
14737
|
} else if (type === 'number' && isNaN(val) === false) {
|
|
15138
14738
|
return options.long ? fmtLong(val) : fmtShort(val);
|
|
15139
14739
|
}
|
|
@@ -15151,7 +14751,7 @@ var ms = function(val, options) {
|
|
|
15151
14751
|
* @api private
|
|
15152
14752
|
*/
|
|
15153
14753
|
|
|
15154
|
-
function parse
|
|
14754
|
+
function parse(str) {
|
|
15155
14755
|
str = String(str);
|
|
15156
14756
|
if (str.length > 100) {
|
|
15157
14757
|
return;
|
|
@@ -17566,7 +17166,7 @@ function shouldUseNative() {
|
|
|
17566
17166
|
}
|
|
17567
17167
|
}
|
|
17568
17168
|
|
|
17569
|
-
var objectAssign
|
|
17169
|
+
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
17570
17170
|
var from;
|
|
17571
17171
|
var to = toObject(target);
|
|
17572
17172
|
var symbols;
|
|
@@ -17641,7 +17241,7 @@ var buildUrl = function buildUrl(props) {
|
|
|
17641
17241
|
throw new Error('Invalid image reference in block, no `_ref` found on `asset`');
|
|
17642
17242
|
}
|
|
17643
17243
|
|
|
17644
|
-
return node(objectAssign
|
|
17244
|
+
return node(objectAssign({
|
|
17645
17245
|
projectId: projectId,
|
|
17646
17246
|
dataset: dataset
|
|
17647
17247
|
}, options.imageOptions || {})).image(node$$1).toString();
|
|
@@ -17781,7 +17381,7 @@ var serializers = function (h, serializerOpts) {
|
|
|
17781
17381
|
};
|
|
17782
17382
|
}
|
|
17783
17383
|
|
|
17784
|
-
var serializedNode = objectAssign
|
|
17384
|
+
var serializedNode = objectAssign({}, span, children);
|
|
17785
17385
|
return h(serializers.span, {
|
|
17786
17386
|
key: span._key || "span-".concat(index),
|
|
17787
17387
|
node: serializedNode,
|
|
@@ -18019,7 +17619,7 @@ function nestLists(blocks) {
|
|
|
18019
17619
|
// will mutate the input, and we don't want to blindly clone the entire tree.
|
|
18020
17620
|
// Clone the last child while adding our new list as the last child of it
|
|
18021
17621
|
var lastListItem = lastChild(currentList);
|
|
18022
|
-
var newLastChild = objectAssign
|
|
17622
|
+
var newLastChild = objectAssign({}, lastListItem, {
|
|
18023
17623
|
children: lastListItem.children.concat(newList)
|
|
18024
17624
|
}); // Swap the last child
|
|
18025
17625
|
|
|
@@ -18121,7 +17721,7 @@ var generateKeys = function (blocks) {
|
|
|
18121
17721
|
return block;
|
|
18122
17722
|
}
|
|
18123
17723
|
|
|
18124
|
-
return objectAssign
|
|
17724
|
+
return objectAssign({
|
|
18125
17725
|
_key: getStaticKey(block)
|
|
18126
17726
|
}, block);
|
|
18127
17727
|
});
|
|
@@ -18165,7 +17765,7 @@ var mergeSerializers = function mergeSerializers(defaultSerializers, userSeriali
|
|
|
18165
17765
|
if (type === 'function') {
|
|
18166
17766
|
acc[key] = isDefined(userSerializers[key]) ? userSerializers[key] : defaultSerializers[key];
|
|
18167
17767
|
} else if (type === 'object') {
|
|
18168
|
-
acc[key] = objectAssign
|
|
17768
|
+
acc[key] = objectAssign({}, defaultSerializers[key], userSerializers[key]);
|
|
18169
17769
|
} else {
|
|
18170
17770
|
acc[key] = typeof userSerializers[key] === 'undefined' ? defaultSerializers[key] : userSerializers[key];
|
|
18171
17771
|
}
|
|
@@ -18188,7 +17788,7 @@ var defaults$1 = {
|
|
|
18188
17788
|
};
|
|
18189
17789
|
|
|
18190
17790
|
function blocksToNodes(h, properties, defaultSerializers, serializeSpan) {
|
|
18191
|
-
var props = objectAssign
|
|
17791
|
+
var props = objectAssign({}, defaults$1, properties);
|
|
18192
17792
|
var rawBlocks = Array.isArray(props.blocks) ? props.blocks : [props.blocks];
|
|
18193
17793
|
var keyedBlocks = generateKeys(rawBlocks);
|
|
18194
17794
|
var blocks = nestLists_1(keyedBlocks, props.listNestMode);
|
|
@@ -18672,7 +18272,7 @@ function removeEventListener(type, listener) {
|
|
|
18672
18272
|
}
|
|
18673
18273
|
}
|
|
18674
18274
|
|
|
18675
|
-
var serialize
|
|
18275
|
+
var serialize = serializeNode;
|
|
18676
18276
|
|
|
18677
18277
|
var voidElements = ["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];
|
|
18678
18278
|
|
|
@@ -18974,7 +18574,7 @@ DOMElement.prototype.focus = function _Element_focus() {
|
|
|
18974
18574
|
};
|
|
18975
18575
|
|
|
18976
18576
|
DOMElement.prototype.toString = function _Element_toString() {
|
|
18977
|
-
return serialize
|
|
18577
|
+
return serialize(this)
|
|
18978
18578
|
};
|
|
18979
18579
|
|
|
18980
18580
|
DOMElement.prototype.getElementsByClassName = function _Element_getElementsByClassName(classNames) {
|