@mjhls/mjh-framework 1.0.720-navigation-scroll-fix-v3 → 1.0.720-navigation-scroll-fix-v4

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/cjs/Auth.js CHANGED
@@ -23,6 +23,7 @@ var asyncToGenerator = require('./asyncToGenerator-533d476a.js');
23
23
  require('./_set-species-f92c67c5.js');
24
24
  var reactBootstrap = require('react-bootstrap');
25
25
  var util = require('./util-f2c1b65b.js');
26
+ var index$5 = require('./index-bd6c9f56.js');
26
27
  var useSWR = _interopDefault(require('swr'));
27
28
  var Local = _interopDefault(require('passport-local'));
28
29
  var mysql = _interopDefault(require('mysql'));
@@ -1210,213 +1211,12 @@ var SignupForm$1 = function SignupForm(props) {
1210
1211
  );
1211
1212
  };
1212
1213
 
1213
- /*!
1214
- * cookie
1215
- * Copyright(c) 2012-2014 Roman Shtylman
1216
- * Copyright(c) 2015 Douglas Christopher Wilson
1217
- * MIT Licensed
1218
- */
1219
-
1220
- /**
1221
- * Module exports.
1222
- * @public
1223
- */
1224
-
1225
- var parse_1 = parse;
1226
- var serialize_1 = serialize;
1227
-
1228
- /**
1229
- * Module variables.
1230
- * @private
1231
- */
1232
-
1233
- var decode = decodeURIComponent;
1234
- var encode = encodeURIComponent;
1235
- var pairSplitRegExp = /; */;
1236
-
1237
- /**
1238
- * RegExp to match field-content in RFC 7230 sec 3.2
1239
- *
1240
- * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
1241
- * field-vchar = VCHAR / obs-text
1242
- * obs-text = %x80-FF
1243
- */
1244
-
1245
- var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
1246
-
1247
- /**
1248
- * Parse a cookie header.
1249
- *
1250
- * Parse the given cookie header string into an object
1251
- * The object has the various cookies as keys(names) => values
1252
- *
1253
- * @param {string} str
1254
- * @param {object} [options]
1255
- * @return {object}
1256
- * @public
1257
- */
1258
-
1259
- function parse(str, options) {
1260
- if (typeof str !== 'string') {
1261
- throw new TypeError('argument str must be a string');
1262
- }
1263
-
1264
- var obj = {};
1265
- var opt = options || {};
1266
- var pairs = str.split(pairSplitRegExp);
1267
- var dec = opt.decode || decode;
1268
-
1269
- for (var i = 0; i < pairs.length; i++) {
1270
- var pair = pairs[i];
1271
- var eq_idx = pair.indexOf('=');
1272
-
1273
- // skip things that don't look like key=value
1274
- if (eq_idx < 0) {
1275
- continue;
1276
- }
1277
-
1278
- var key = pair.substr(0, eq_idx).trim();
1279
- var val = pair.substr(++eq_idx, pair.length).trim();
1280
-
1281
- // quoted values
1282
- if ('"' == val[0]) {
1283
- val = val.slice(1, -1);
1284
- }
1285
-
1286
- // only assign once
1287
- if (undefined == obj[key]) {
1288
- obj[key] = tryDecode(val, dec);
1289
- }
1290
- }
1291
-
1292
- return obj;
1293
- }
1294
-
1295
- /**
1296
- * Serialize data into a cookie header.
1297
- *
1298
- * Serialize the a name value pair into a cookie string suitable for
1299
- * http headers. An optional options object specified cookie parameters.
1300
- *
1301
- * serialize('foo', 'bar', { httpOnly: true })
1302
- * => "foo=bar; httpOnly"
1303
- *
1304
- * @param {string} name
1305
- * @param {string} val
1306
- * @param {object} [options]
1307
- * @return {string}
1308
- * @public
1309
- */
1310
-
1311
- function serialize(name, val, options) {
1312
- var opt = options || {};
1313
- var enc = opt.encode || encode;
1314
-
1315
- if (typeof enc !== 'function') {
1316
- throw new TypeError('option encode is invalid');
1317
- }
1318
-
1319
- if (!fieldContentRegExp.test(name)) {
1320
- throw new TypeError('argument name is invalid');
1321
- }
1322
-
1323
- var value = enc(val);
1324
-
1325
- if (value && !fieldContentRegExp.test(value)) {
1326
- throw new TypeError('argument val is invalid');
1327
- }
1328
-
1329
- var str = name + '=' + value;
1330
-
1331
- if (null != opt.maxAge) {
1332
- var maxAge = opt.maxAge - 0;
1333
-
1334
- if (isNaN(maxAge) || !isFinite(maxAge)) {
1335
- throw new TypeError('option maxAge is invalid')
1336
- }
1337
-
1338
- str += '; Max-Age=' + Math.floor(maxAge);
1339
- }
1340
-
1341
- if (opt.domain) {
1342
- if (!fieldContentRegExp.test(opt.domain)) {
1343
- throw new TypeError('option domain is invalid');
1344
- }
1345
-
1346
- str += '; Domain=' + opt.domain;
1347
- }
1348
-
1349
- if (opt.path) {
1350
- if (!fieldContentRegExp.test(opt.path)) {
1351
- throw new TypeError('option path is invalid');
1352
- }
1353
-
1354
- str += '; Path=' + opt.path;
1355
- }
1356
-
1357
- if (opt.expires) {
1358
- if (typeof opt.expires.toUTCString !== 'function') {
1359
- throw new TypeError('option expires is invalid');
1360
- }
1361
-
1362
- str += '; Expires=' + opt.expires.toUTCString();
1363
- }
1364
-
1365
- if (opt.httpOnly) {
1366
- str += '; HttpOnly';
1367
- }
1368
-
1369
- if (opt.secure) {
1370
- str += '; Secure';
1371
- }
1372
-
1373
- if (opt.sameSite) {
1374
- var sameSite = typeof opt.sameSite === 'string'
1375
- ? opt.sameSite.toLowerCase() : opt.sameSite;
1376
-
1377
- switch (sameSite) {
1378
- case true:
1379
- str += '; SameSite=Strict';
1380
- break;
1381
- case 'lax':
1382
- str += '; SameSite=Lax';
1383
- break;
1384
- case 'strict':
1385
- str += '; SameSite=Strict';
1386
- break;
1387
- case 'none':
1388
- str += '; SameSite=None';
1389
- break;
1390
- default:
1391
- throw new TypeError('option sameSite is invalid');
1392
- }
1393
- }
1394
-
1395
- return str;
1396
- }
1397
-
1398
- /**
1399
- * Try decoding a string using a decoding function.
1400
- *
1401
- * @param {string} str
1402
- * @param {function} decode
1403
- * @private
1404
- */
1405
-
1406
- function tryDecode(str, decode) {
1407
- try {
1408
- return decode(str);
1409
- } catch (e) {
1410
- return str;
1411
- }
1412
- }
1413
-
1414
1214
  var TOKEN_NAME = 'token';
1415
1215
  var MAX_AGE = 60 * 60 * 8; // 8 hours
1416
1216
 
1417
1217
  function setTokenCookie(res, token, eKey) {
1418
1218
  var cookies_serailized = [];
1419
- cookies_serailized.push(serialize_1(TOKEN_NAME, token, {
1219
+ cookies_serailized.push(index$5.serialize_1(TOKEN_NAME, token, {
1420
1220
  //maxAge: MAX_AGE, // we want login cookie to expire when browser
1421
1221
  //expires: new Date(Date.now() + MAX_AGE * 1000),
1422
1222
  //httpOnly: true,
@@ -1425,7 +1225,7 @@ function setTokenCookie(res, token, eKey) {
1425
1225
  //sameSite: 'lax',
1426
1226
  }));
1427
1227
 
1428
- cookies_serailized.push(serialize_1('eKey', eKey, {
1228
+ cookies_serailized.push(index$5.serialize_1('eKey', eKey, {
1429
1229
  //maxAge: MAX_AGE, // we want login cookie to expire when browser
1430
1230
  //expires: new Date(Date.now() + MAX_AGE * 1000),
1431
1231
  //httpOnly: true,
@@ -1439,12 +1239,12 @@ function setTokenCookie(res, token, eKey) {
1439
1239
 
1440
1240
  function removeTokenCookie(res) {
1441
1241
  var cookies_serailized = [];
1442
- cookies_serailized.push(serialize_1(TOKEN_NAME, '', {
1242
+ cookies_serailized.push(index$5.serialize_1(TOKEN_NAME, '', {
1443
1243
  maxAge: -1,
1444
1244
  expires: new Date(Date.now() - MAX_AGE * 1000),
1445
1245
  path: '/'
1446
1246
  }));
1447
- cookies_serailized.push(serialize_1('eKey', '', {
1247
+ cookies_serailized.push(index$5.serialize_1('eKey', '', {
1448
1248
  maxAge: -1,
1449
1249
  expires: new Date(Date.now() - MAX_AGE * 1000),
1450
1250
  path: '/'
@@ -1459,7 +1259,7 @@ function parseCookies(req) {
1459
1259
 
1460
1260
  // For pages we do need to parse the cookies.
1461
1261
  var cookie = req.headers ? req.headers.cookie : null;
1462
- return parse_1(cookie || '');
1262
+ return index$5.parse_1(cookie || '');
1463
1263
  }
1464
1264
 
1465
1265
  function getTokenCookie(req) {
@@ -174,7 +174,7 @@ var HamMagazine = function HamMagazine(props) {
174
174
  }
175
175
  var stickyNav = window.addEventListener('scroll', function () {
176
176
  // Taking into consideration the height of the top navbar while setting the navigation fixed
177
- if (window && topNavRef && topNavRef.current && window.pageYOffset + topNavRef.current.clientHeight > navOffsetTop) {
177
+ if (window && topNavRef && topNavRef.current && window.pageYOffset !== 0 && window.pageYOffset + topNavRef.current.clientHeight > navOffsetTop) {
178
178
  if (navRef.current && navRef.current.style) {
179
179
  navRef.current.style.position = 'fixed';
180
180
  if (mastNav && mastNav.offsetHeight) navRef.current.style.top = mastNav.offsetHeight;
@@ -182,7 +182,6 @@ var HamMagazine = function HamMagazine(props) {
182
182
  setIsSticky(true);
183
183
  navLinks.style.margin = 'auto';
184
184
  } else {
185
- console.log('setIsSticky:::::::::', navRef.current.style, topNavRef.current.style);
186
185
  if (navRef.current && navRef.current.style) {
187
186
  topNavRef.current.style.paddingBottom = '0';
188
187
  navRef.current.style.position = 'relative';
package/dist/cjs/View.js CHANGED
@@ -64,9 +64,9 @@ var keys = require('./keys-a586b7a0.js');
64
64
  require('react-bootstrap/Dropdown');
65
65
  var index_esm$3 = require('./index.esm-ff47db6f.js');
66
66
  var getSeriesDetail = require('./getSeriesDetail.js');
67
- require('nookies');
68
- var getQuery = require('./getQuery.js');
67
+ require('./index-bd6c9f56.js');
69
68
  var getRelatedArticle = require('./getRelatedArticle.js');
69
+ var getQuery = require('./getQuery.js');
70
70
  var getTargeting = require('./getTargeting-fee8c429.js');
71
71
  var getKeywords = require('./getKeywords.js');
72
72
  var urlFor = require('./urlFor.js');