@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/dist/index.js
CHANGED
|
@@ -13455,342 +13455,11 @@ var NavFooter = function NavFooter(props) {
|
|
|
13455
13455
|
);
|
|
13456
13456
|
};
|
|
13457
13457
|
|
|
13458
|
-
/*!
|
|
13459
|
-
* cookie
|
|
13460
|
-
* Copyright(c) 2012-2014 Roman Shtylman
|
|
13461
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
13462
|
-
* MIT Licensed
|
|
13463
|
-
*/
|
|
13464
|
-
|
|
13465
|
-
/**
|
|
13466
|
-
* Module exports.
|
|
13467
|
-
* @public
|
|
13468
|
-
*/
|
|
13469
|
-
|
|
13470
|
-
var parse_1 = parse;
|
|
13471
|
-
var serialize_1 = serialize;
|
|
13472
|
-
|
|
13473
|
-
/**
|
|
13474
|
-
* Module variables.
|
|
13475
|
-
* @private
|
|
13476
|
-
*/
|
|
13477
|
-
|
|
13478
|
-
var decode = decodeURIComponent;
|
|
13479
|
-
var encode = encodeURIComponent;
|
|
13480
|
-
var pairSplitRegExp = /; */;
|
|
13481
|
-
|
|
13482
|
-
/**
|
|
13483
|
-
* RegExp to match field-content in RFC 7230 sec 3.2
|
|
13484
|
-
*
|
|
13485
|
-
* field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
|
|
13486
|
-
* field-vchar = VCHAR / obs-text
|
|
13487
|
-
* obs-text = %x80-FF
|
|
13488
|
-
*/
|
|
13489
|
-
|
|
13490
|
-
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
13491
|
-
|
|
13492
|
-
/**
|
|
13493
|
-
* Parse a cookie header.
|
|
13494
|
-
*
|
|
13495
|
-
* Parse the given cookie header string into an object
|
|
13496
|
-
* The object has the various cookies as keys(names) => values
|
|
13497
|
-
*
|
|
13498
|
-
* @param {string} str
|
|
13499
|
-
* @param {object} [options]
|
|
13500
|
-
* @return {object}
|
|
13501
|
-
* @public
|
|
13502
|
-
*/
|
|
13503
|
-
|
|
13504
|
-
function parse(str, options) {
|
|
13505
|
-
if (typeof str !== 'string') {
|
|
13506
|
-
throw new TypeError('argument str must be a string');
|
|
13507
|
-
}
|
|
13508
|
-
|
|
13509
|
-
var obj = {};
|
|
13510
|
-
var opt = options || {};
|
|
13511
|
-
var pairs = str.split(pairSplitRegExp);
|
|
13512
|
-
var dec = opt.decode || decode;
|
|
13513
|
-
|
|
13514
|
-
for (var i = 0; i < pairs.length; i++) {
|
|
13515
|
-
var pair = pairs[i];
|
|
13516
|
-
var eq_idx = pair.indexOf('=');
|
|
13517
|
-
|
|
13518
|
-
// skip things that don't look like key=value
|
|
13519
|
-
if (eq_idx < 0) {
|
|
13520
|
-
continue;
|
|
13521
|
-
}
|
|
13522
|
-
|
|
13523
|
-
var key = pair.substr(0, eq_idx).trim();
|
|
13524
|
-
var val = pair.substr(++eq_idx, pair.length).trim();
|
|
13525
|
-
|
|
13526
|
-
// quoted values
|
|
13527
|
-
if ('"' == val[0]) {
|
|
13528
|
-
val = val.slice(1, -1);
|
|
13529
|
-
}
|
|
13530
|
-
|
|
13531
|
-
// only assign once
|
|
13532
|
-
if (undefined == obj[key]) {
|
|
13533
|
-
obj[key] = tryDecode(val, dec);
|
|
13534
|
-
}
|
|
13535
|
-
}
|
|
13536
|
-
|
|
13537
|
-
return obj;
|
|
13538
|
-
}
|
|
13539
|
-
|
|
13540
|
-
/**
|
|
13541
|
-
* Serialize data into a cookie header.
|
|
13542
|
-
*
|
|
13543
|
-
* Serialize the a name value pair into a cookie string suitable for
|
|
13544
|
-
* http headers. An optional options object specified cookie parameters.
|
|
13545
|
-
*
|
|
13546
|
-
* serialize('foo', 'bar', { httpOnly: true })
|
|
13547
|
-
* => "foo=bar; httpOnly"
|
|
13548
|
-
*
|
|
13549
|
-
* @param {string} name
|
|
13550
|
-
* @param {string} val
|
|
13551
|
-
* @param {object} [options]
|
|
13552
|
-
* @return {string}
|
|
13553
|
-
* @public
|
|
13554
|
-
*/
|
|
13555
|
-
|
|
13556
|
-
function serialize(name, val, options) {
|
|
13557
|
-
var opt = options || {};
|
|
13558
|
-
var enc = opt.encode || encode;
|
|
13559
|
-
|
|
13560
|
-
if (typeof enc !== 'function') {
|
|
13561
|
-
throw new TypeError('option encode is invalid');
|
|
13562
|
-
}
|
|
13563
|
-
|
|
13564
|
-
if (!fieldContentRegExp.test(name)) {
|
|
13565
|
-
throw new TypeError('argument name is invalid');
|
|
13566
|
-
}
|
|
13567
|
-
|
|
13568
|
-
var value = enc(val);
|
|
13569
|
-
|
|
13570
|
-
if (value && !fieldContentRegExp.test(value)) {
|
|
13571
|
-
throw new TypeError('argument val is invalid');
|
|
13572
|
-
}
|
|
13573
|
-
|
|
13574
|
-
var str = name + '=' + value;
|
|
13575
|
-
|
|
13576
|
-
if (null != opt.maxAge) {
|
|
13577
|
-
var maxAge = opt.maxAge - 0;
|
|
13578
|
-
if (isNaN(maxAge)) throw new Error('maxAge should be a Number');
|
|
13579
|
-
str += '; Max-Age=' + Math.floor(maxAge);
|
|
13580
|
-
}
|
|
13581
|
-
|
|
13582
|
-
if (opt.domain) {
|
|
13583
|
-
if (!fieldContentRegExp.test(opt.domain)) {
|
|
13584
|
-
throw new TypeError('option domain is invalid');
|
|
13585
|
-
}
|
|
13586
|
-
|
|
13587
|
-
str += '; Domain=' + opt.domain;
|
|
13588
|
-
}
|
|
13589
|
-
|
|
13590
|
-
if (opt.path) {
|
|
13591
|
-
if (!fieldContentRegExp.test(opt.path)) {
|
|
13592
|
-
throw new TypeError('option path is invalid');
|
|
13593
|
-
}
|
|
13594
|
-
|
|
13595
|
-
str += '; Path=' + opt.path;
|
|
13596
|
-
}
|
|
13597
|
-
|
|
13598
|
-
if (opt.expires) {
|
|
13599
|
-
if (typeof opt.expires.toUTCString !== 'function') {
|
|
13600
|
-
throw new TypeError('option expires is invalid');
|
|
13601
|
-
}
|
|
13602
|
-
|
|
13603
|
-
str += '; Expires=' + opt.expires.toUTCString();
|
|
13604
|
-
}
|
|
13605
|
-
|
|
13606
|
-
if (opt.httpOnly) {
|
|
13607
|
-
str += '; HttpOnly';
|
|
13608
|
-
}
|
|
13609
|
-
|
|
13610
|
-
if (opt.secure) {
|
|
13611
|
-
str += '; Secure';
|
|
13612
|
-
}
|
|
13613
|
-
|
|
13614
|
-
if (opt.sameSite) {
|
|
13615
|
-
var sameSite = typeof opt.sameSite === 'string'
|
|
13616
|
-
? opt.sameSite.toLowerCase() : opt.sameSite;
|
|
13617
|
-
|
|
13618
|
-
switch (sameSite) {
|
|
13619
|
-
case true:
|
|
13620
|
-
str += '; SameSite=Strict';
|
|
13621
|
-
break;
|
|
13622
|
-
case 'lax':
|
|
13623
|
-
str += '; SameSite=Lax';
|
|
13624
|
-
break;
|
|
13625
|
-
case 'strict':
|
|
13626
|
-
str += '; SameSite=Strict';
|
|
13627
|
-
break;
|
|
13628
|
-
case 'none':
|
|
13629
|
-
str += '; SameSite=None';
|
|
13630
|
-
break;
|
|
13631
|
-
default:
|
|
13632
|
-
throw new TypeError('option sameSite is invalid');
|
|
13633
|
-
}
|
|
13634
|
-
}
|
|
13635
|
-
|
|
13636
|
-
return str;
|
|
13637
|
-
}
|
|
13638
|
-
|
|
13639
|
-
/**
|
|
13640
|
-
* Try decoding a string using a decoding function.
|
|
13641
|
-
*
|
|
13642
|
-
* @param {string} str
|
|
13643
|
-
* @param {function} decode
|
|
13644
|
-
* @private
|
|
13645
|
-
*/
|
|
13646
|
-
|
|
13647
|
-
function tryDecode(str, decode) {
|
|
13648
|
-
try {
|
|
13649
|
-
return decode(str);
|
|
13650
|
-
} catch (e) {
|
|
13651
|
-
return str;
|
|
13652
|
-
}
|
|
13653
|
-
}
|
|
13654
|
-
|
|
13655
|
-
function hasDocumentCookie() {
|
|
13656
|
-
// Can we get/set cookies on document.cookie?
|
|
13657
|
-
return typeof document === 'object' && typeof document.cookie === 'string';
|
|
13658
|
-
}
|
|
13659
|
-
function parseCookies(cookies, options) {
|
|
13660
|
-
if (typeof cookies === 'string') {
|
|
13661
|
-
return parse_1(cookies, options);
|
|
13662
|
-
}
|
|
13663
|
-
else if (typeof cookies === 'object' && cookies !== null) {
|
|
13664
|
-
return cookies;
|
|
13665
|
-
}
|
|
13666
|
-
else {
|
|
13667
|
-
return {};
|
|
13668
|
-
}
|
|
13669
|
-
}
|
|
13670
|
-
function isParsingCookie(value, doNotParse) {
|
|
13671
|
-
if (typeof doNotParse === 'undefined') {
|
|
13672
|
-
// We guess if the cookie start with { or [, it has been serialized
|
|
13673
|
-
doNotParse =
|
|
13674
|
-
!value || (value[0] !== '{' && value[0] !== '[' && value[0] !== '"');
|
|
13675
|
-
}
|
|
13676
|
-
return !doNotParse;
|
|
13677
|
-
}
|
|
13678
|
-
function readCookie(value, options) {
|
|
13679
|
-
if (options === void 0) { options = {}; }
|
|
13680
|
-
var cleanValue = cleanupCookieValue(value);
|
|
13681
|
-
if (isParsingCookie(cleanValue, options.doNotParse)) {
|
|
13682
|
-
try {
|
|
13683
|
-
return JSON.parse(cleanValue);
|
|
13684
|
-
}
|
|
13685
|
-
catch (e) {
|
|
13686
|
-
// At least we tried
|
|
13687
|
-
}
|
|
13688
|
-
}
|
|
13689
|
-
// Ignore clean value if we failed the deserialization
|
|
13690
|
-
// It is not relevant anymore to trim those values
|
|
13691
|
-
return value;
|
|
13692
|
-
}
|
|
13693
|
-
function cleanupCookieValue(value) {
|
|
13694
|
-
// express prepend j: before serializing a cookie
|
|
13695
|
-
if (value && value[0] === 'j' && value[1] === ':') {
|
|
13696
|
-
return value.substr(2);
|
|
13697
|
-
}
|
|
13698
|
-
return value;
|
|
13699
|
-
}
|
|
13700
|
-
|
|
13701
|
-
// We can't please Rollup and TypeScript at the same time
|
|
13702
|
-
// Only way to make both of them work
|
|
13703
|
-
var objectAssign = require('object-assign');
|
|
13704
|
-
var Cookies = /** @class */ (function () {
|
|
13705
|
-
function Cookies(cookies, options) {
|
|
13706
|
-
var _this = this;
|
|
13707
|
-
this.changeListeners = [];
|
|
13708
|
-
this.HAS_DOCUMENT_COOKIE = false;
|
|
13709
|
-
this.cookies = parseCookies(cookies, options);
|
|
13710
|
-
new Promise(function () {
|
|
13711
|
-
_this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();
|
|
13712
|
-
}).catch(function () { });
|
|
13713
|
-
}
|
|
13714
|
-
Cookies.prototype._updateBrowserValues = function (parseOptions) {
|
|
13715
|
-
if (!this.HAS_DOCUMENT_COOKIE) {
|
|
13716
|
-
return;
|
|
13717
|
-
}
|
|
13718
|
-
this.cookies = parse_1(document.cookie, parseOptions);
|
|
13719
|
-
};
|
|
13720
|
-
Cookies.prototype._emitChange = function (params) {
|
|
13721
|
-
for (var i = 0; i < this.changeListeners.length; ++i) {
|
|
13722
|
-
this.changeListeners[i](params);
|
|
13723
|
-
}
|
|
13724
|
-
};
|
|
13725
|
-
Cookies.prototype.get = function (name, options, parseOptions) {
|
|
13726
|
-
if (options === void 0) { options = {}; }
|
|
13727
|
-
this._updateBrowserValues(parseOptions);
|
|
13728
|
-
return readCookie(this.cookies[name], options);
|
|
13729
|
-
};
|
|
13730
|
-
Cookies.prototype.getAll = function (options, parseOptions) {
|
|
13731
|
-
if (options === void 0) { options = {}; }
|
|
13732
|
-
this._updateBrowserValues(parseOptions);
|
|
13733
|
-
var result = {};
|
|
13734
|
-
for (var name_1 in this.cookies) {
|
|
13735
|
-
result[name_1] = readCookie(this.cookies[name_1], options);
|
|
13736
|
-
}
|
|
13737
|
-
return result;
|
|
13738
|
-
};
|
|
13739
|
-
Cookies.prototype.set = function (name, value, options) {
|
|
13740
|
-
var _a;
|
|
13741
|
-
if (typeof value === 'object') {
|
|
13742
|
-
value = JSON.stringify(value);
|
|
13743
|
-
}
|
|
13744
|
-
this.cookies = objectAssign({}, this.cookies, (_a = {}, _a[name] = value, _a));
|
|
13745
|
-
if (this.HAS_DOCUMENT_COOKIE) {
|
|
13746
|
-
document.cookie = serialize_1(name, value, options);
|
|
13747
|
-
}
|
|
13748
|
-
this._emitChange({ name: name, value: value, options: options });
|
|
13749
|
-
};
|
|
13750
|
-
Cookies.prototype.remove = function (name, options) {
|
|
13751
|
-
var finalOptions = (options = objectAssign({}, options, {
|
|
13752
|
-
expires: new Date(1970, 1, 1, 0, 0, 1),
|
|
13753
|
-
maxAge: 0
|
|
13754
|
-
}));
|
|
13755
|
-
this.cookies = objectAssign({}, this.cookies);
|
|
13756
|
-
delete this.cookies[name];
|
|
13757
|
-
if (this.HAS_DOCUMENT_COOKIE) {
|
|
13758
|
-
document.cookie = serialize_1(name, '', finalOptions);
|
|
13759
|
-
}
|
|
13760
|
-
this._emitChange({ name: name, value: undefined, options: options });
|
|
13761
|
-
};
|
|
13762
|
-
Cookies.prototype.addChangeListener = function (callback) {
|
|
13763
|
-
this.changeListeners.push(callback);
|
|
13764
|
-
};
|
|
13765
|
-
Cookies.prototype.removeChangeListener = function (callback) {
|
|
13766
|
-
var idx = this.changeListeners.indexOf(callback);
|
|
13767
|
-
if (idx >= 0) {
|
|
13768
|
-
this.changeListeners.splice(idx, 1);
|
|
13769
|
-
}
|
|
13770
|
-
};
|
|
13771
|
-
return Cookies;
|
|
13772
|
-
}());
|
|
13773
|
-
|
|
13774
|
-
var Cookies$1 = Cookies;
|
|
13775
|
-
// we seem to sometimes get the ES6 version despite requesting cjs here, not sure why
|
|
13776
|
-
// this isn't the ideal fix, but it'll do for now
|
|
13777
|
-
Cookies$1 = Cookies$1.default || Cookies$1;
|
|
13778
|
-
|
|
13779
|
-
function nextCookies(ctx, options) {
|
|
13780
|
-
// Note: Next.js Static export sets ctx.req to a fake request with no headers
|
|
13781
|
-
var header = ctx.req && ctx.req.headers && ctx.req.headers.cookie;
|
|
13782
|
-
var uc = new Cookies$1(header);
|
|
13783
|
-
return uc.getAll(options);
|
|
13784
|
-
}
|
|
13785
|
-
|
|
13786
|
-
var nextCookies_1 = nextCookies;
|
|
13787
|
-
|
|
13788
13458
|
var NavMagazine = function NavMagazine(props) {
|
|
13789
13459
|
/*
|
|
13790
13460
|
Example Nav with acceptable props
|
|
13791
13461
|
<MagazineNav
|
|
13792
13462
|
showLogin
|
|
13793
|
-
loginState={true}
|
|
13794
13463
|
logo={props.settings.logo}
|
|
13795
13464
|
dataObject={props.cache.mainNavCache}
|
|
13796
13465
|
website={website}
|
|
@@ -13805,7 +13474,7 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13805
13474
|
website = props.website,
|
|
13806
13475
|
_props$showLogin = props.showLogin,
|
|
13807
13476
|
showLogin = _props$showLogin === undefined ? false : _props$showLogin,
|
|
13808
|
-
|
|
13477
|
+
_props$userData = props.userData;
|
|
13809
13478
|
|
|
13810
13479
|
var navRef = React.useRef(null);
|
|
13811
13480
|
|
|
@@ -13819,13 +13488,6 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13819
13488
|
screenWidth = _useState4[0],
|
|
13820
13489
|
setScreenWidth = _useState4[1];
|
|
13821
13490
|
|
|
13822
|
-
var initialLoginState = allCookies.loggedIn;
|
|
13823
|
-
|
|
13824
|
-
var _useState5 = React.useState(initialLoginState),
|
|
13825
|
-
_useState6 = slicedToArray(_useState5, 2),
|
|
13826
|
-
loginState = _useState6[0],
|
|
13827
|
-
setLoginState = _useState6[1];
|
|
13828
|
-
|
|
13829
13491
|
React.useEffect(function () {
|
|
13830
13492
|
document.addEventListener('scroll', trackScrolling);
|
|
13831
13493
|
return function () {
|
|
@@ -13838,50 +13500,6 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13838
13500
|
setScreenWidth(parseInt(window.innerWidth));
|
|
13839
13501
|
}, []);
|
|
13840
13502
|
|
|
13841
|
-
React.useLayoutEffect(function () {
|
|
13842
|
-
if (typeof GCN !== 'undefined') {
|
|
13843
|
-
GCN.on('init').then(function (data) {
|
|
13844
|
-
console.log('GCN init...');
|
|
13845
|
-
setLoginState(data.loggedin);
|
|
13846
|
-
if (data.loggedIn) {
|
|
13847
|
-
console.log(' - logged in status');
|
|
13848
|
-
document.cookie = 'loggedIn=' + data.loggedIn + '; path=/';
|
|
13849
|
-
} else {
|
|
13850
|
-
console.log(' - logged out status');
|
|
13851
|
-
document.cookie = 'loggedIn=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT';
|
|
13852
|
-
}
|
|
13853
|
-
});
|
|
13854
|
-
|
|
13855
|
-
GCN.on('login').then(function (data) {
|
|
13856
|
-
setLoginState(data.loggedin);
|
|
13857
|
-
console.log('GCN login...');
|
|
13858
|
-
document.cookie = 'loggedIn=' + data.loggedIn + '; path=/';
|
|
13859
|
-
});
|
|
13860
|
-
|
|
13861
|
-
GCN.on('logout').then(function (data) {
|
|
13862
|
-
setLoginState(data.loggedin);
|
|
13863
|
-
console.log('GCN logout...');
|
|
13864
|
-
document.cookie = 'loggedIn=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT';
|
|
13865
|
-
});
|
|
13866
|
-
} else {
|
|
13867
|
-
console.error('GCN not defined for GCN events');
|
|
13868
|
-
}
|
|
13869
|
-
}, []);
|
|
13870
|
-
|
|
13871
|
-
React.useEffect(function () {
|
|
13872
|
-
toggleLogin();
|
|
13873
|
-
}, [loginState]);
|
|
13874
|
-
|
|
13875
|
-
var toggleLogin = function toggleLogin() {
|
|
13876
|
-
if (loginState) {
|
|
13877
|
-
document.getElementsByClassName('logged-in').style.display = '';
|
|
13878
|
-
document.getElementsByClassName('logged-out').style.display = 'none';
|
|
13879
|
-
} else {
|
|
13880
|
-
document.getElementsByClassName('logged-in').style.display = 'none';
|
|
13881
|
-
document.getElementsByClassName('logged-out').style.display = '';
|
|
13882
|
-
}
|
|
13883
|
-
};
|
|
13884
|
-
|
|
13885
13503
|
var trackScrolling = function trackScrolling() {
|
|
13886
13504
|
var offsetTop = navRef.current.getBoundingClientRect().top;
|
|
13887
13505
|
|
|
@@ -13894,13 +13512,7 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13894
13512
|
|
|
13895
13513
|
var handleLogin = function handleLogin(e) {
|
|
13896
13514
|
if (typeof GCN !== 'undefined' && GCN && GCN.onecount) {
|
|
13897
|
-
GCN.onecount.login()
|
|
13898
|
-
console.log('login result: ', result);
|
|
13899
|
-
setLoginState(GCN.onecount.isLoggedIn());
|
|
13900
|
-
}).catch(function (error) {
|
|
13901
|
-
console.log('login error:', error);
|
|
13902
|
-
setLoginState(GCN.onecount.isLoggedIn());
|
|
13903
|
-
});
|
|
13515
|
+
GCN.onecount.login();
|
|
13904
13516
|
} else {
|
|
13905
13517
|
console.error('GCN not defined');
|
|
13906
13518
|
}
|
|
@@ -13908,13 +13520,7 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13908
13520
|
|
|
13909
13521
|
var handleLogout = function handleLogout(e) {
|
|
13910
13522
|
if (typeof GCN !== 'undefined' && GCN && GCN.onecount) {
|
|
13911
|
-
GCN.onecount.logout()
|
|
13912
|
-
console.log('logout result:', result);
|
|
13913
|
-
setLoginState(GCN.onecount.isLoggedIn());
|
|
13914
|
-
}).catch(function (error) {
|
|
13915
|
-
console.log('logout error:', error);
|
|
13916
|
-
setLoginState(GCN.onecount.isLoggedIn());
|
|
13917
|
-
});
|
|
13523
|
+
GCN.onecount.logout();
|
|
13918
13524
|
} else {
|
|
13919
13525
|
console.error('GCN not defined');
|
|
13920
13526
|
}
|
|
@@ -13934,7 +13540,7 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13934
13540
|
{ id: 'navbar-top', className: 'justify-content-center navbar-top', style: { margin: '0 auto' } },
|
|
13935
13541
|
showLogin && React__default.createElement(
|
|
13936
13542
|
Nav.Item,
|
|
13937
|
-
{ id: 'nav-mobile-register', className: '
|
|
13543
|
+
{ id: 'nav-mobile-register', className: 'hide-on-login', style: { display: 'none' } },
|
|
13938
13544
|
React__default.createElement(
|
|
13939
13545
|
'div',
|
|
13940
13546
|
{ className: 'px-2 py-2', onClick: function onClick(e) {
|
|
@@ -13959,7 +13565,7 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13959
13565
|
),
|
|
13960
13566
|
showLogin && React__default.createElement(
|
|
13961
13567
|
Nav.Item,
|
|
13962
|
-
{ id: 'nav-mobile-login', className: '
|
|
13568
|
+
{ id: 'nav-mobile-login', className: 'hide-on-login', style: { display: 'none' } },
|
|
13963
13569
|
React__default.createElement(
|
|
13964
13570
|
'div',
|
|
13965
13571
|
{ className: 'px-2 py-2 ', onClick: function onClick(e) {
|
|
@@ -13971,10 +13577,10 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13971
13577
|
),
|
|
13972
13578
|
showLogin && React__default.createElement(
|
|
13973
13579
|
React__default.Fragment,
|
|
13974
|
-
|
|
13580
|
+
null,
|
|
13975
13581
|
React__default.createElement(
|
|
13976
13582
|
Nav.Item,
|
|
13977
|
-
{ id: 'nav-mobile-logout' },
|
|
13583
|
+
{ id: 'nav-mobile-logout', className: 'hide-on-logout', style: { display: 'none' } },
|
|
13978
13584
|
React__default.createElement(
|
|
13979
13585
|
'div',
|
|
13980
13586
|
{ className: 'pl-2 pr-3 py-2 text-right', onClick: function onClick(e) {
|
|
@@ -13991,10 +13597,10 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
13991
13597
|
{ style: { position: 'absolute', right: '15px' }, className: 'justify-content-end rightHeader' },
|
|
13992
13598
|
showLogin && React__default.createElement(
|
|
13993
13599
|
React__default.Fragment,
|
|
13994
|
-
|
|
13600
|
+
null,
|
|
13995
13601
|
React__default.createElement(
|
|
13996
13602
|
Nav.Item,
|
|
13997
|
-
|
|
13603
|
+
{ className: 'hide-on-login', style: { display: 'none' } },
|
|
13998
13604
|
React__default.createElement(
|
|
13999
13605
|
'div',
|
|
14000
13606
|
{ className: 'px-2 py-2 mr-2', id: 'nav-register', onClick: function onClick(e) {
|
|
@@ -14006,7 +13612,7 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
14006
13612
|
),
|
|
14007
13613
|
React__default.createElement(
|
|
14008
13614
|
Nav.Item,
|
|
14009
|
-
|
|
13615
|
+
{ className: 'hide-on-login', style: { display: 'none' } },
|
|
14010
13616
|
React__default.createElement(
|
|
14011
13617
|
'div',
|
|
14012
13618
|
{ className: 'px-2 py-2', id: 'nav-login', onClick: function onClick(e) {
|
|
@@ -14019,10 +13625,10 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
14019
13625
|
),
|
|
14020
13626
|
showLogin && React__default.createElement(
|
|
14021
13627
|
React__default.Fragment,
|
|
14022
|
-
|
|
13628
|
+
null,
|
|
14023
13629
|
React__default.createElement(
|
|
14024
13630
|
Nav.Item,
|
|
14025
|
-
|
|
13631
|
+
{ className: 'hide-on-logout', style: { display: 'none' } },
|
|
14026
13632
|
React__default.createElement(
|
|
14027
13633
|
'div',
|
|
14028
13634
|
{ className: 'px-2 py-2', id: 'nav-logout', onClick: function onClick(e) {
|
|
@@ -14161,12 +13767,6 @@ var NavMagazine = function NavMagazine(props) {
|
|
|
14161
13767
|
);
|
|
14162
13768
|
};
|
|
14163
13769
|
|
|
14164
|
-
NavMagazine.getInitialProps = function (ctx) {
|
|
14165
|
-
return {
|
|
14166
|
-
allCookies: nextCookies_1(ctx)
|
|
14167
|
-
};
|
|
14168
|
-
};
|
|
14169
|
-
|
|
14170
13770
|
var NavNative = function NavNative(props) {
|
|
14171
13771
|
var logo = props.logo,
|
|
14172
13772
|
dataObject = props.dataObject,
|
|
@@ -15140,7 +14740,7 @@ var ms = function(val, options) {
|
|
|
15140
14740
|
options = options || {};
|
|
15141
14741
|
var type = typeof val;
|
|
15142
14742
|
if (type === 'string' && val.length > 0) {
|
|
15143
|
-
return parse
|
|
14743
|
+
return parse(val);
|
|
15144
14744
|
} else if (type === 'number' && isNaN(val) === false) {
|
|
15145
14745
|
return options.long ? fmtLong(val) : fmtShort(val);
|
|
15146
14746
|
}
|
|
@@ -15158,7 +14758,7 @@ var ms = function(val, options) {
|
|
|
15158
14758
|
* @api private
|
|
15159
14759
|
*/
|
|
15160
14760
|
|
|
15161
|
-
function parse
|
|
14761
|
+
function parse(str) {
|
|
15162
14762
|
str = String(str);
|
|
15163
14763
|
if (str.length > 100) {
|
|
15164
14764
|
return;
|
|
@@ -17573,7 +17173,7 @@ function shouldUseNative() {
|
|
|
17573
17173
|
}
|
|
17574
17174
|
}
|
|
17575
17175
|
|
|
17576
|
-
var objectAssign
|
|
17176
|
+
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
17577
17177
|
var from;
|
|
17578
17178
|
var to = toObject(target);
|
|
17579
17179
|
var symbols;
|
|
@@ -17648,7 +17248,7 @@ var buildUrl = function buildUrl(props) {
|
|
|
17648
17248
|
throw new Error('Invalid image reference in block, no `_ref` found on `asset`');
|
|
17649
17249
|
}
|
|
17650
17250
|
|
|
17651
|
-
return node(objectAssign
|
|
17251
|
+
return node(objectAssign({
|
|
17652
17252
|
projectId: projectId,
|
|
17653
17253
|
dataset: dataset
|
|
17654
17254
|
}, options.imageOptions || {})).image(node$$1).toString();
|
|
@@ -17788,7 +17388,7 @@ var serializers = function (h, serializerOpts) {
|
|
|
17788
17388
|
};
|
|
17789
17389
|
}
|
|
17790
17390
|
|
|
17791
|
-
var serializedNode = objectAssign
|
|
17391
|
+
var serializedNode = objectAssign({}, span, children);
|
|
17792
17392
|
return h(serializers.span, {
|
|
17793
17393
|
key: span._key || "span-".concat(index),
|
|
17794
17394
|
node: serializedNode,
|
|
@@ -18026,7 +17626,7 @@ function nestLists(blocks) {
|
|
|
18026
17626
|
// will mutate the input, and we don't want to blindly clone the entire tree.
|
|
18027
17627
|
// Clone the last child while adding our new list as the last child of it
|
|
18028
17628
|
var lastListItem = lastChild(currentList);
|
|
18029
|
-
var newLastChild = objectAssign
|
|
17629
|
+
var newLastChild = objectAssign({}, lastListItem, {
|
|
18030
17630
|
children: lastListItem.children.concat(newList)
|
|
18031
17631
|
}); // Swap the last child
|
|
18032
17632
|
|
|
@@ -18128,7 +17728,7 @@ var generateKeys = function (blocks) {
|
|
|
18128
17728
|
return block;
|
|
18129
17729
|
}
|
|
18130
17730
|
|
|
18131
|
-
return objectAssign
|
|
17731
|
+
return objectAssign({
|
|
18132
17732
|
_key: getStaticKey(block)
|
|
18133
17733
|
}, block);
|
|
18134
17734
|
});
|
|
@@ -18172,7 +17772,7 @@ var mergeSerializers = function mergeSerializers(defaultSerializers, userSeriali
|
|
|
18172
17772
|
if (type === 'function') {
|
|
18173
17773
|
acc[key] = isDefined(userSerializers[key]) ? userSerializers[key] : defaultSerializers[key];
|
|
18174
17774
|
} else if (type === 'object') {
|
|
18175
|
-
acc[key] = objectAssign
|
|
17775
|
+
acc[key] = objectAssign({}, defaultSerializers[key], userSerializers[key]);
|
|
18176
17776
|
} else {
|
|
18177
17777
|
acc[key] = typeof userSerializers[key] === 'undefined' ? defaultSerializers[key] : userSerializers[key];
|
|
18178
17778
|
}
|
|
@@ -18195,7 +17795,7 @@ var defaults$1 = {
|
|
|
18195
17795
|
};
|
|
18196
17796
|
|
|
18197
17797
|
function blocksToNodes(h, properties, defaultSerializers, serializeSpan) {
|
|
18198
|
-
var props = objectAssign
|
|
17798
|
+
var props = objectAssign({}, defaults$1, properties);
|
|
18199
17799
|
var rawBlocks = Array.isArray(props.blocks) ? props.blocks : [props.blocks];
|
|
18200
17800
|
var keyedBlocks = generateKeys(rawBlocks);
|
|
18201
17801
|
var blocks = nestLists_1(keyedBlocks, props.listNestMode);
|
|
@@ -18679,7 +18279,7 @@ function removeEventListener(type, listener) {
|
|
|
18679
18279
|
}
|
|
18680
18280
|
}
|
|
18681
18281
|
|
|
18682
|
-
var serialize
|
|
18282
|
+
var serialize = serializeNode;
|
|
18683
18283
|
|
|
18684
18284
|
var voidElements = ["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];
|
|
18685
18285
|
|
|
@@ -18981,7 +18581,7 @@ DOMElement.prototype.focus = function _Element_focus() {
|
|
|
18981
18581
|
};
|
|
18982
18582
|
|
|
18983
18583
|
DOMElement.prototype.toString = function _Element_toString() {
|
|
18984
|
-
return serialize
|
|
18584
|
+
return serialize(this)
|
|
18985
18585
|
};
|
|
18986
18586
|
|
|
18987
18587
|
DOMElement.prototype.getElementsByClassName = function _Element_getElementsByClassName(classNames) {
|