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

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,7 +23,6 @@ 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');
27
26
  var useSWR = _interopDefault(require('swr'));
28
27
  var Local = _interopDefault(require('passport-local'));
29
28
  var mysql = _interopDefault(require('mysql'));
@@ -1211,12 +1210,213 @@ var SignupForm$1 = function SignupForm(props) {
1211
1210
  );
1212
1211
  };
1213
1212
 
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
+
1214
1414
  var TOKEN_NAME = 'token';
1215
1415
  var MAX_AGE = 60 * 60 * 8; // 8 hours
1216
1416
 
1217
1417
  function setTokenCookie(res, token, eKey) {
1218
1418
  var cookies_serailized = [];
1219
- cookies_serailized.push(index$5.serialize_1(TOKEN_NAME, token, {
1419
+ cookies_serailized.push(serialize_1(TOKEN_NAME, token, {
1220
1420
  //maxAge: MAX_AGE, // we want login cookie to expire when browser
1221
1421
  //expires: new Date(Date.now() + MAX_AGE * 1000),
1222
1422
  //httpOnly: true,
@@ -1225,7 +1425,7 @@ function setTokenCookie(res, token, eKey) {
1225
1425
  //sameSite: 'lax',
1226
1426
  }));
1227
1427
 
1228
- cookies_serailized.push(index$5.serialize_1('eKey', eKey, {
1428
+ cookies_serailized.push(serialize_1('eKey', eKey, {
1229
1429
  //maxAge: MAX_AGE, // we want login cookie to expire when browser
1230
1430
  //expires: new Date(Date.now() + MAX_AGE * 1000),
1231
1431
  //httpOnly: true,
@@ -1239,12 +1439,12 @@ function setTokenCookie(res, token, eKey) {
1239
1439
 
1240
1440
  function removeTokenCookie(res) {
1241
1441
  var cookies_serailized = [];
1242
- cookies_serailized.push(index$5.serialize_1(TOKEN_NAME, '', {
1442
+ cookies_serailized.push(serialize_1(TOKEN_NAME, '', {
1243
1443
  maxAge: -1,
1244
1444
  expires: new Date(Date.now() - MAX_AGE * 1000),
1245
1445
  path: '/'
1246
1446
  }));
1247
- cookies_serailized.push(index$5.serialize_1('eKey', '', {
1447
+ cookies_serailized.push(serialize_1('eKey', '', {
1248
1448
  maxAge: -1,
1249
1449
  expires: new Date(Date.now() - MAX_AGE * 1000),
1250
1450
  path: '/'
@@ -1259,7 +1459,7 @@ function parseCookies(req) {
1259
1459
 
1260
1460
  // For pages we do need to parse the cookies.
1261
1461
  var cookie = req.headers ? req.headers.cookie : null;
1262
- return index$5.parse_1(cookie || '');
1462
+ return parse_1(cookie || '');
1263
1463
  }
1264
1464
 
1265
1465
  function getTokenCookie(req) {
@@ -181,7 +181,8 @@ var HamMagazine = function HamMagazine(props) {
181
181
  }
182
182
  setIsSticky(true);
183
183
  navLinks.style.margin = 'auto';
184
- } else if (window && topNavRef && topNavRef.current && window.pageYOffset + topNavRef.current.clientHeight < navOffsetTop) {
184
+ } else {
185
+ console.log('setIsSticky:::::::::', navRef.current.style, topNavRef.current.style);
185
186
  if (navRef.current && navRef.current.style) {
186
187
  topNavRef.current.style.paddingBottom = '0';
187
188
  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('./index-bd6c9f56.js');
68
- var getRelatedArticle = require('./getRelatedArticle.js');
67
+ require('nookies');
69
68
  var getQuery = require('./getQuery.js');
69
+ var getRelatedArticle = require('./getRelatedArticle.js');
70
70
  var getTargeting = require('./getTargeting-fee8c429.js');
71
71
  var getKeywords = require('./getKeywords.js');
72
72
  var urlFor = require('./urlFor.js');