@mjhls/mjh-framework 1.0.730 → 1.0.731

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 CHANGED
@@ -1,4 +1,4 @@
1
- # mjh-framework v. 1.0.730
1
+ # mjh-framework v. 1.0.731
2
2
 
3
3
  [![NPM](https://img.shields.io/npm/v/mjh-framework.svg)](https://www.npmjs.com/package/mjh-framework) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
4
4
 
@@ -0,0 +1,111 @@
1
+ 'use strict';
2
+
3
+ var asyncToGenerator = require('./asyncToGenerator-2edcb6ad.js');
4
+ var slicedToArray = require('./slicedToArray-db24842a.js');
5
+ var _extends = require('./extends-1e24fc8d.js');
6
+ var React = require('react');
7
+ var QueueDeckExpanded = require('./QueueDeckExpanded.js');
8
+ require('./_commonjsHelpers-06173234.js');
9
+ require('./es6.string.iterator-20d42c53.js');
10
+ require('./_to-object-821a2927.js');
11
+ require('./web.dom.iterable-4480325a.js');
12
+ require('./_library-dd23b178.js');
13
+ require('./core.get-iterator-method-b4615fd3.js');
14
+ require('./_set-species-a8cfdb84.js');
15
+ require('./_iter-detect-2613ffa1.js');
16
+ require('./_object-pie-68c5bcbc.js');
17
+ require('./toConsumableArray-cf0865fc.js');
18
+ require('react-bootstrap');
19
+ require('./index-d48b231c.js');
20
+ require('./index.es-f3e47207.js');
21
+ require('./moment-aca40de1.js');
22
+ require('./visibility-sensor-8b54af99.js');
23
+ require('react-dom');
24
+ require('./index-0e4427c8.js');
25
+ require('prop-types');
26
+ require('next/router');
27
+ require('./index-80f57cff.js');
28
+ require('./main-dc082238.js');
29
+ require('./entities-3f9d0f2f.js');
30
+ require('./ADInfeed-5fe7fd9d.js');
31
+ require('react-bootstrap/Card');
32
+ require('./AdSlot.js');
33
+ require('./debounce-eb287781.js');
34
+ require('./isSymbol-04666465.js');
35
+ require('./Beam.js');
36
+ require('./stringify-01cf47f7.js');
37
+ require('./Segment.js');
38
+ require('./AuthorComponent-5fa89df5.js');
39
+ require('./lodash-4ef21f0f.js');
40
+ require('./ADlgInfeed-a62d2f9b.js');
41
+ require('./getContentCategory-f38a4c00.js');
42
+ require('./timeDifferenceCalc.js');
43
+
44
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
45
+
46
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
47
+
48
+ var _this = undefined;
49
+
50
+ var PubSection = function PubSection(props) {
51
+ var pubSection = props.pubSection;
52
+
53
+ return React__default['default'].createElement(
54
+ 'div',
55
+ { id: 'pubSection' },
56
+ pubSection.publication && pubSection.publication.name && React__default['default'].createElement(
57
+ 'h2',
58
+ null,
59
+ pubSection.publication.name
60
+ ),
61
+ React__default['default'].createElement(QueueDeckExpanded, _extends._extends({ dataRecord: pubSection.articles }, props))
62
+ );
63
+ };
64
+
65
+ PubSection.getInitialProps = function () {
66
+ var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(ctx, client) {
67
+ var _ctx$query, publication, issue, section, res, params, query, _ref2, _ref3, pubSection;
68
+
69
+ return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
70
+ while (1) {
71
+ switch (_context.prev = _context.next) {
72
+ case 0:
73
+ _ctx$query = ctx.query, publication = _ctx$query.publication, issue = _ctx$query.issue, section = _ctx$query.section, res = ctx.res;
74
+ params = {
75
+ publication: publication,
76
+ section: section
77
+ };
78
+ query = '*[_type == \'publicationSection\'\n && defined(parent)\n && parent->identifier == $publication\n && identifier == $section] {\n ...,\n parent->,\n \'articles\': *[_type == \'article\'\n \t&& !(_id in path("drafts.**")) \n\t\t && defined(title) \n\t\t && defined(url) \n\t\t && is_visible \n\t\t && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock != true\n && references(^._id)] {\n ...,\n contentCategory->,\n authorMapping[]->,\n },\n \'publication\': *[_type == \'publication\'\n && identifier.current == $publication] [0]\n }';
79
+ _context.next = 5;
80
+ return client.fetch(query, params);
81
+
82
+ case 5:
83
+ _ref2 = _context.sent;
84
+ _ref3 = slicedToArray._slicedToArray(_ref2, 1);
85
+ pubSection = _ref3[0];
86
+
87
+ if (pubSection) {
88
+ _context.next = 11;
89
+ break;
90
+ }
91
+
92
+ res.statusCode = 404;
93
+ return _context.abrupt('return', { show404: true });
94
+
95
+ case 11:
96
+ return _context.abrupt('return', { publication: publication, issue: issue, section: section, pubSection: pubSection });
97
+
98
+ case 12:
99
+ case 'end':
100
+ return _context.stop();
101
+ }
102
+ }
103
+ }, _callee, _this);
104
+ }));
105
+
106
+ return function (_x, _x2) {
107
+ return _ref.apply(this, arguments);
108
+ };
109
+ }();
110
+
111
+ module.exports = PubSection;
@@ -0,0 +1,90 @@
1
+ 'use strict';
2
+
3
+ var asyncToGenerator = require('./asyncToGenerator-2edcb6ad.js');
4
+ var slicedToArray = require('./slicedToArray-db24842a.js');
5
+ var React = require('react');
6
+ require('./_commonjsHelpers-06173234.js');
7
+ require('./es6.string.iterator-20d42c53.js');
8
+ require('./_to-object-821a2927.js');
9
+ require('./web.dom.iterable-4480325a.js');
10
+ require('./_library-dd23b178.js');
11
+ require('./core.get-iterator-method-b4615fd3.js');
12
+ require('./_set-species-a8cfdb84.js');
13
+ require('./_iter-detect-2613ffa1.js');
14
+
15
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
+
17
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
18
+
19
+ var _this = undefined;
20
+
21
+ var PubToc = function PubToc(props) {
22
+ var toc = props.toc;
23
+
24
+ return React__default['default'].createElement(
25
+ 'div',
26
+ { id: 'pubToc' },
27
+ React__default['default'].createElement(
28
+ 'ul',
29
+ null,
30
+ toc && toc.parentSection && Array.isArray(toc.parentSection.sections) && toc.parentSection.sections.map(function (s) {
31
+ return React__default['default'].createElement(
32
+ 'li',
33
+ { key: s.identifier },
34
+ React__default['default'].createElement(
35
+ 'a',
36
+ { href: s.identifier },
37
+ s.name
38
+ )
39
+ );
40
+ })
41
+ )
42
+ );
43
+ };
44
+
45
+ PubToc.getInitialProps = function () {
46
+ var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(ctx, client) {
47
+ var _ctx$query, publication, issue, res, params, query, _ref2, _ref3, toc;
48
+
49
+ return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
50
+ while (1) {
51
+ switch (_context.prev = _context.next) {
52
+ case 0:
53
+ _ctx$query = ctx.query, publication = _ctx$query.publication, issue = _ctx$query.issue, res = ctx.res;
54
+ params = {
55
+ publication: publication
56
+ };
57
+ query = '*[_type == \'publication\'\n && identifier.current == $publication] {\n ...,\n \'parentSection\': *[_type == \'publicationSection\'\n && name == ^.name\n && !defined(parent)] [0] {\n ...,\n \'sections\': *[_type == \'publicationSection\'\n && references(^._id)]\n }\n }';
58
+ _context.next = 5;
59
+ return client.fetch(query, params);
60
+
61
+ case 5:
62
+ _ref2 = _context.sent;
63
+ _ref3 = slicedToArray._slicedToArray(_ref2, 1);
64
+ toc = _ref3[0];
65
+
66
+ if (!(!toc || !toc.parentSection)) {
67
+ _context.next = 11;
68
+ break;
69
+ }
70
+
71
+ res.statusCode = 404;
72
+ return _context.abrupt('return', { show404: true });
73
+
74
+ case 11:
75
+ return _context.abrupt('return', { publication: publication, issue: issue, toc: toc });
76
+
77
+ case 12:
78
+ case 'end':
79
+ return _context.stop();
80
+ }
81
+ }
82
+ }, _callee, _this);
83
+ }));
84
+
85
+ return function (_x, _x2) {
86
+ return _ref.apply(this, arguments);
87
+ };
88
+ }();
89
+
90
+ module.exports = PubToc;
package/dist/cjs/index.js CHANGED
@@ -66,6 +66,8 @@ var RelatedContent = require('./RelatedContent.js');
66
66
  var SocialIcons = require('./SocialIcons.js');
67
67
  var ArticleCarousel = require('./ArticleCarousel.js');
68
68
  var TaxonomyDescription = require('./TaxonomyDescription.js');
69
+ var PubToc = require('./PubToc.js');
70
+ var PubSection = require('./PubSection.js');
69
71
  var ForbesHero = require('./ForbesHero.js');
70
72
  var HorizontalHero = require('./HorizontalHero.js');
71
73
  var OncliveHero = require('./OncliveHero.js');
@@ -251,6 +253,8 @@ exports.RelatedContent = RelatedContent;
251
253
  exports.SocialIcons = SocialIcons;
252
254
  exports.ArticleCarousel = ArticleCarousel;
253
255
  exports.TaxonomyDescription = TaxonomyDescription;
256
+ exports.PubToc = PubToc;
257
+ exports.PubSection = PubSection;
254
258
  exports.ForbesHero = ForbesHero;
255
259
  exports.HorizontalHero = HorizontalHero;
256
260
  exports.OncliveHero = OncliveHero;
@@ -0,0 +1,105 @@
1
+ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-2bd4099a.js';
2
+ import { _ as _slicedToArray } from './slicedToArray-cdeaee08.js';
3
+ import { _ as _extends } from './extends-31d65aba.js';
4
+ import React from 'react';
5
+ import QueueDeckExpanded from './QueueDeckExpanded.js';
6
+ import './_commonjsHelpers-0c4b6f40.js';
7
+ import './es6.string.iterator-aa6068a3.js';
8
+ import './_to-object-97770c52.js';
9
+ import './web.dom.iterable-035980f3.js';
10
+ import './_library-528f1934.js';
11
+ import './core.get-iterator-method-d1d5ed02.js';
12
+ import './_set-species-494ed292.js';
13
+ import './_iter-detect-48516cd3.js';
14
+ import './_object-pie-33c40e79.js';
15
+ import './toConsumableArray-fa2dcda7.js';
16
+ import 'react-bootstrap';
17
+ import './index-3f5c03b2.js';
18
+ import './index.es-c6222053.js';
19
+ import './moment-bc12cb97.js';
20
+ import './visibility-sensor-082c757b.js';
21
+ import 'react-dom';
22
+ import './index-888f9253.js';
23
+ import 'prop-types';
24
+ import 'next/router';
25
+ import './index-752d1dae.js';
26
+ import './main-1450d277.js';
27
+ import './entities-932b50cf.js';
28
+ import './ADInfeed-3a9eef39.js';
29
+ import 'react-bootstrap/Card';
30
+ import './AdSlot.js';
31
+ import './debounce-1a993acf.js';
32
+ import './isSymbol-807e927e.js';
33
+ import './Beam.js';
34
+ import './stringify-d4839bab.js';
35
+ import './Segment.js';
36
+ import './AuthorComponent-c7ff069f.js';
37
+ import './lodash-ad27652f.js';
38
+ import './ADlgInfeed-8d63ff91.js';
39
+ import './getContentCategory-15dcc413.js';
40
+ import './timeDifferenceCalc.js';
41
+
42
+ var _this = undefined;
43
+
44
+ var PubSection = function PubSection(props) {
45
+ var pubSection = props.pubSection;
46
+
47
+ return React.createElement(
48
+ 'div',
49
+ { id: 'pubSection' },
50
+ pubSection.publication && pubSection.publication.name && React.createElement(
51
+ 'h2',
52
+ null,
53
+ pubSection.publication.name
54
+ ),
55
+ React.createElement(QueueDeckExpanded, _extends({ dataRecord: pubSection.articles }, props))
56
+ );
57
+ };
58
+
59
+ PubSection.getInitialProps = function () {
60
+ var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(ctx, client) {
61
+ var _ctx$query, publication, issue, section, res, params, query, _ref2, _ref3, pubSection;
62
+
63
+ return regenerator.wrap(function _callee$(_context) {
64
+ while (1) {
65
+ switch (_context.prev = _context.next) {
66
+ case 0:
67
+ _ctx$query = ctx.query, publication = _ctx$query.publication, issue = _ctx$query.issue, section = _ctx$query.section, res = ctx.res;
68
+ params = {
69
+ publication: publication,
70
+ section: section
71
+ };
72
+ query = '*[_type == \'publicationSection\'\n && defined(parent)\n && parent->identifier == $publication\n && identifier == $section] {\n ...,\n parent->,\n \'articles\': *[_type == \'article\'\n \t&& !(_id in path("drafts.**")) \n\t\t && defined(title) \n\t\t && defined(url) \n\t\t && is_visible \n\t\t && defined(published) \n && dateTime(published) <= dateTime(now())\n && passwordLock != true\n && references(^._id)] {\n ...,\n contentCategory->,\n authorMapping[]->,\n },\n \'publication\': *[_type == \'publication\'\n && identifier.current == $publication] [0]\n }';
73
+ _context.next = 5;
74
+ return client.fetch(query, params);
75
+
76
+ case 5:
77
+ _ref2 = _context.sent;
78
+ _ref3 = _slicedToArray(_ref2, 1);
79
+ pubSection = _ref3[0];
80
+
81
+ if (pubSection) {
82
+ _context.next = 11;
83
+ break;
84
+ }
85
+
86
+ res.statusCode = 404;
87
+ return _context.abrupt('return', { show404: true });
88
+
89
+ case 11:
90
+ return _context.abrupt('return', { publication: publication, issue: issue, section: section, pubSection: pubSection });
91
+
92
+ case 12:
93
+ case 'end':
94
+ return _context.stop();
95
+ }
96
+ }
97
+ }, _callee, _this);
98
+ }));
99
+
100
+ return function (_x, _x2) {
101
+ return _ref.apply(this, arguments);
102
+ };
103
+ }();
104
+
105
+ export default PubSection;
@@ -0,0 +1,84 @@
1
+ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-2bd4099a.js';
2
+ import { _ as _slicedToArray } from './slicedToArray-cdeaee08.js';
3
+ import React from 'react';
4
+ import './_commonjsHelpers-0c4b6f40.js';
5
+ import './es6.string.iterator-aa6068a3.js';
6
+ import './_to-object-97770c52.js';
7
+ import './web.dom.iterable-035980f3.js';
8
+ import './_library-528f1934.js';
9
+ import './core.get-iterator-method-d1d5ed02.js';
10
+ import './_set-species-494ed292.js';
11
+ import './_iter-detect-48516cd3.js';
12
+
13
+ var _this = undefined;
14
+
15
+ var PubToc = function PubToc(props) {
16
+ var toc = props.toc;
17
+
18
+ return React.createElement(
19
+ 'div',
20
+ { id: 'pubToc' },
21
+ React.createElement(
22
+ 'ul',
23
+ null,
24
+ toc && toc.parentSection && Array.isArray(toc.parentSection.sections) && toc.parentSection.sections.map(function (s) {
25
+ return React.createElement(
26
+ 'li',
27
+ { key: s.identifier },
28
+ React.createElement(
29
+ 'a',
30
+ { href: s.identifier },
31
+ s.name
32
+ )
33
+ );
34
+ })
35
+ )
36
+ );
37
+ };
38
+
39
+ PubToc.getInitialProps = function () {
40
+ var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(ctx, client) {
41
+ var _ctx$query, publication, issue, res, params, query, _ref2, _ref3, toc;
42
+
43
+ return regenerator.wrap(function _callee$(_context) {
44
+ while (1) {
45
+ switch (_context.prev = _context.next) {
46
+ case 0:
47
+ _ctx$query = ctx.query, publication = _ctx$query.publication, issue = _ctx$query.issue, res = ctx.res;
48
+ params = {
49
+ publication: publication
50
+ };
51
+ query = '*[_type == \'publication\'\n && identifier.current == $publication] {\n ...,\n \'parentSection\': *[_type == \'publicationSection\'\n && name == ^.name\n && !defined(parent)] [0] {\n ...,\n \'sections\': *[_type == \'publicationSection\'\n && references(^._id)]\n }\n }';
52
+ _context.next = 5;
53
+ return client.fetch(query, params);
54
+
55
+ case 5:
56
+ _ref2 = _context.sent;
57
+ _ref3 = _slicedToArray(_ref2, 1);
58
+ toc = _ref3[0];
59
+
60
+ if (!(!toc || !toc.parentSection)) {
61
+ _context.next = 11;
62
+ break;
63
+ }
64
+
65
+ res.statusCode = 404;
66
+ return _context.abrupt('return', { show404: true });
67
+
68
+ case 11:
69
+ return _context.abrupt('return', { publication: publication, issue: issue, toc: toc });
70
+
71
+ case 12:
72
+ case 'end':
73
+ return _context.stop();
74
+ }
75
+ }
76
+ }, _callee, _this);
77
+ }));
78
+
79
+ return function (_x, _x2) {
80
+ return _ref.apply(this, arguments);
81
+ };
82
+ }();
83
+
84
+ export default PubToc;
package/dist/esm/index.js CHANGED
@@ -62,6 +62,8 @@ export { default as RelatedContent } from './RelatedContent.js';
62
62
  export { default as SocialIcons } from './SocialIcons.js';
63
63
  export { default as ArticleCarousel } from './ArticleCarousel.js';
64
64
  export { default as TaxonomyDescription } from './TaxonomyDescription.js';
65
+ export { default as PubToc } from './PubToc.js';
66
+ export { default as PubSection } from './PubSection.js';
65
67
  export { default as ForbesHero } from './ForbesHero.js';
66
68
  export { default as HorizontalHero } from './HorizontalHero.js';
67
69
  export { default as OncliveHero } from './OncliveHero.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.730",
3
+ "version": "1.0.731",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",