@mjhls/mjh-framework 1.0.705 → 1.0.706
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/cjs/Header.js +1 -1
- package/dist/cjs/TaxonomyDescription.js +157 -0
- package/dist/cjs/index.js +2 -0
- package/dist/esm/Header.js +1 -1
- package/dist/esm/TaxonomyDescription.js +150 -0
- package/dist/esm/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/Header.js
CHANGED
|
@@ -26,7 +26,7 @@ var Header = function Header(props) {
|
|
|
26
26
|
title
|
|
27
27
|
),
|
|
28
28
|
keyword && React__default['default'].createElement('meta', { name: 'keywords', content: keyword }),
|
|
29
|
-
description && React__default['default'].createElement('meta', { name: 'description', content: description }),
|
|
29
|
+
description && React__default['default'].createElement('meta', { name: 'description', content: description, key: 'description' }),
|
|
30
30
|
!isLiveSite && React__default['default'].createElement('meta', { name: 'robots', content: 'noindex, nofollow' })
|
|
31
31
|
);
|
|
32
32
|
};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var asyncToGenerator = require('./asyncToGenerator-2edcb6ad.js');
|
|
4
|
+
var _extends = require('./extends-1e24fc8d.js');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var Router = require('next/router');
|
|
7
|
+
var Head = require('next/head');
|
|
8
|
+
var BlockContent = require('./BlockContent-eca358e4.js');
|
|
9
|
+
var getSerializers = require('./index-4d37a34d.js');
|
|
10
|
+
require('./_commonjsHelpers-06173234.js');
|
|
11
|
+
require('./es6.string.iterator-20d42c53.js');
|
|
12
|
+
require('./_to-object-821a2927.js');
|
|
13
|
+
require('./web.dom.iterable-4480325a.js');
|
|
14
|
+
require('./_library-dd23b178.js');
|
|
15
|
+
require('./core.get-iterator-method-b4615fd3.js');
|
|
16
|
+
require('./_set-species-a8cfdb84.js');
|
|
17
|
+
require('./_iter-detect-2613ffa1.js');
|
|
18
|
+
require('./_object-pie-68c5bcbc.js');
|
|
19
|
+
require('prop-types');
|
|
20
|
+
require('./index-d48b231c.js');
|
|
21
|
+
require('./slicedToArray-db24842a.js');
|
|
22
|
+
require('react-bootstrap');
|
|
23
|
+
require('./index-5ad2b070.js');
|
|
24
|
+
require('./smoothscroll-1abb448e.js');
|
|
25
|
+
require('./util-6f784d85.js');
|
|
26
|
+
require('./Beam.js');
|
|
27
|
+
require('./stringify-01cf47f7.js');
|
|
28
|
+
require('./Segment.js');
|
|
29
|
+
require('./main-eeffe77b.js');
|
|
30
|
+
require('./index-80f57cff.js');
|
|
31
|
+
require('react-dom');
|
|
32
|
+
require('./typeof-97065d40.js');
|
|
33
|
+
require('./_is-array-63ae4740.js');
|
|
34
|
+
require('./brightcove-react-player-loader.es-a195642e.js');
|
|
35
|
+
require('./GroupDeck.js');
|
|
36
|
+
require('./moment-aca40de1.js');
|
|
37
|
+
require('./toConsumableArray-cf0865fc.js');
|
|
38
|
+
require('react-bootstrap/Pagination');
|
|
39
|
+
require('react-bootstrap/Button');
|
|
40
|
+
require('./entities-3f9d0f2f.js');
|
|
41
|
+
require('./AdSlot.js');
|
|
42
|
+
require('./debounce-eb287781.js');
|
|
43
|
+
require('./isSymbol-04666465.js');
|
|
44
|
+
require('react-bootstrap/Row');
|
|
45
|
+
require('react-bootstrap/Col');
|
|
46
|
+
require('./inherits-2eb23889.js');
|
|
47
|
+
require('./_object-sap-c5bd707d.js');
|
|
48
|
+
require('./define-property-aff11f8a.js');
|
|
49
|
+
require('./index.esm-974f47d9.js');
|
|
50
|
+
require('./iconBase-68959171.js');
|
|
51
|
+
require('react-bootstrap/Figure');
|
|
52
|
+
|
|
53
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
54
|
+
|
|
55
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
56
|
+
var Head__default = /*#__PURE__*/_interopDefaultLegacy(Head);
|
|
57
|
+
|
|
58
|
+
var _this = undefined;
|
|
59
|
+
|
|
60
|
+
var blocksToText = function blocksToText(blocks) {
|
|
61
|
+
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
62
|
+
|
|
63
|
+
var defaults = { nonTextBehavior: 'remove' };
|
|
64
|
+
var options = _extends._Object$assign({}, defaults, opts);
|
|
65
|
+
return blocks.map(function (block) {
|
|
66
|
+
if (block._type !== 'block' || !block.children) {
|
|
67
|
+
return options.nonTextBehavior === 'remove' ? '' : '[' + block._type + ' block]';
|
|
68
|
+
}
|
|
69
|
+
return block.children.map(function (child) {
|
|
70
|
+
return child.text;
|
|
71
|
+
}).join('');
|
|
72
|
+
}).join('\n\n');
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
var setMetaDescription = function setMetaDescription(data, router) {
|
|
76
|
+
var metaDescription = blocksToText(data);
|
|
77
|
+
if (router && router.asPath) {
|
|
78
|
+
var queryParms = router.asPath.split('?')[1];
|
|
79
|
+
if (queryParms) {
|
|
80
|
+
var pageNumber = queryParms.split('&').reduce(function (acc, item) {
|
|
81
|
+
if (item.startsWith('page=')) {
|
|
82
|
+
if (item.split('=')[1]) {
|
|
83
|
+
acc = item.split('=')[1];
|
|
84
|
+
return acc;
|
|
85
|
+
}
|
|
86
|
+
return acc;
|
|
87
|
+
}
|
|
88
|
+
return acc;
|
|
89
|
+
}, '');
|
|
90
|
+
if (pageNumber && pageNumber !== '') {
|
|
91
|
+
metaDescription = blocksToText(data) + '| Page ' + pageNumber;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return React__default['default'].createElement(
|
|
96
|
+
Head__default['default'],
|
|
97
|
+
null,
|
|
98
|
+
React__default['default'].createElement('meta', { name: 'description', content: metaDescription, key: 'description' })
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
var TaxonomyDescription = function TaxonomyDescription(_ref) {
|
|
103
|
+
var data = _ref.data,
|
|
104
|
+
client = _ref.client;
|
|
105
|
+
|
|
106
|
+
var router = Router.useRouter();
|
|
107
|
+
return data && data.length > 0 && React__default['default'].createElement(
|
|
108
|
+
'section',
|
|
109
|
+
{ className: 'taxonomy-description' },
|
|
110
|
+
setMetaDescription(data, router),
|
|
111
|
+
React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({ serializers: getSerializers.getSerializers(client), blocks: data, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
TaxonomyDescription.getDescription = function () {
|
|
116
|
+
var _ref2 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
|
|
117
|
+
var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
118
|
+
var client = arguments[1];
|
|
119
|
+
var query, summary;
|
|
120
|
+
return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
|
|
121
|
+
while (1) {
|
|
122
|
+
switch (_context.prev = _context.next) {
|
|
123
|
+
case 0:
|
|
124
|
+
query = '*[_type == \'taxonomy\' && identifier == \'' + url + '\'][0].summary';
|
|
125
|
+
summary = [];
|
|
126
|
+
_context.prev = 2;
|
|
127
|
+
_context.next = 5;
|
|
128
|
+
return client.fetch(query);
|
|
129
|
+
|
|
130
|
+
case 5:
|
|
131
|
+
summary = _context.sent;
|
|
132
|
+
_context.next = 11;
|
|
133
|
+
break;
|
|
134
|
+
|
|
135
|
+
case 8:
|
|
136
|
+
_context.prev = 8;
|
|
137
|
+
_context.t0 = _context['catch'](2);
|
|
138
|
+
|
|
139
|
+
console.error(_context.t0);
|
|
140
|
+
|
|
141
|
+
case 11:
|
|
142
|
+
return _context.abrupt('return', summary);
|
|
143
|
+
|
|
144
|
+
case 12:
|
|
145
|
+
case 'end':
|
|
146
|
+
return _context.stop();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}, _callee, _this, [[2, 8]]);
|
|
150
|
+
}));
|
|
151
|
+
|
|
152
|
+
return function () {
|
|
153
|
+
return _ref2.apply(this, arguments);
|
|
154
|
+
};
|
|
155
|
+
}();
|
|
156
|
+
|
|
157
|
+
module.exports = TaxonomyDescription;
|
package/dist/cjs/index.js
CHANGED
|
@@ -65,6 +65,7 @@ var PopUpModal = require('./PopUpModal.js');
|
|
|
65
65
|
var RelatedContent = require('./RelatedContent.js');
|
|
66
66
|
var SocialIcons = require('./SocialIcons.js');
|
|
67
67
|
var ArticleCarousel = require('./ArticleCarousel.js');
|
|
68
|
+
var TaxonomyDescription = require('./TaxonomyDescription.js');
|
|
68
69
|
var ForbesHero = require('./ForbesHero.js');
|
|
69
70
|
var HorizontalHero = require('./HorizontalHero.js');
|
|
70
71
|
var OncliveHero = require('./OncliveHero.js');
|
|
@@ -242,6 +243,7 @@ exports.PopUpModal = PopUpModal;
|
|
|
242
243
|
exports.RelatedContent = RelatedContent;
|
|
243
244
|
exports.SocialIcons = SocialIcons;
|
|
244
245
|
exports.ArticleCarousel = ArticleCarousel;
|
|
246
|
+
exports.TaxonomyDescription = TaxonomyDescription;
|
|
245
247
|
exports.ForbesHero = ForbesHero;
|
|
246
248
|
exports.HorizontalHero = HorizontalHero;
|
|
247
249
|
exports.OncliveHero = OncliveHero;
|
package/dist/esm/Header.js
CHANGED
|
@@ -17,7 +17,7 @@ var Header = function Header(props) {
|
|
|
17
17
|
title
|
|
18
18
|
),
|
|
19
19
|
keyword && React.createElement('meta', { name: 'keywords', content: keyword }),
|
|
20
|
-
description && React.createElement('meta', { name: 'description', content: description }),
|
|
20
|
+
description && React.createElement('meta', { name: 'description', content: description, key: 'description' }),
|
|
21
21
|
!isLiveSite && React.createElement('meta', { name: 'robots', content: 'noindex, nofollow' })
|
|
22
22
|
);
|
|
23
23
|
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-acd1cc47.js';
|
|
2
|
+
import { _ as _extends, a as _Object$assign } from './extends-c2b1c9d7.js';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useRouter } from 'next/router';
|
|
5
|
+
import Head from 'next/head';
|
|
6
|
+
import { B as BlockContent } from './BlockContent-d8cd739c.js';
|
|
7
|
+
import { g as getSerializers } from './index-b2d06f45.js';
|
|
8
|
+
import './_commonjsHelpers-0c4b6f40.js';
|
|
9
|
+
import './es6.string.iterator-b24a54f2.js';
|
|
10
|
+
import './_to-object-9bef3b62.js';
|
|
11
|
+
import './web.dom.iterable-ca37144a.js';
|
|
12
|
+
import './_library-528f1934.js';
|
|
13
|
+
import './core.get-iterator-method-1b116089.js';
|
|
14
|
+
import './_set-species-0b056cff.js';
|
|
15
|
+
import './_iter-detect-d4d262ee.js';
|
|
16
|
+
import './_object-pie-71ac75a4.js';
|
|
17
|
+
import 'prop-types';
|
|
18
|
+
import './index-3f5c03b2.js';
|
|
19
|
+
import './slicedToArray-34468155.js';
|
|
20
|
+
import 'react-bootstrap';
|
|
21
|
+
import './index-669ff425.js';
|
|
22
|
+
import './smoothscroll-ab6e0238.js';
|
|
23
|
+
import './util-3ab476bf.js';
|
|
24
|
+
import './Beam.js';
|
|
25
|
+
import './stringify-8a4f19f7.js';
|
|
26
|
+
import './Segment.js';
|
|
27
|
+
import './main-ad1ecb54.js';
|
|
28
|
+
import './index-752d1dae.js';
|
|
29
|
+
import 'react-dom';
|
|
30
|
+
import './typeof-64422756.js';
|
|
31
|
+
import './_is-array-9383b394.js';
|
|
32
|
+
import './brightcove-react-player-loader.es-b43c695a.js';
|
|
33
|
+
import './GroupDeck.js';
|
|
34
|
+
import './moment-bc12cb97.js';
|
|
35
|
+
import './toConsumableArray-5212fee7.js';
|
|
36
|
+
import 'react-bootstrap/Pagination';
|
|
37
|
+
import 'react-bootstrap/Button';
|
|
38
|
+
import './entities-932b50cf.js';
|
|
39
|
+
import './AdSlot.js';
|
|
40
|
+
import './debounce-1a993acf.js';
|
|
41
|
+
import './isSymbol-807e927e.js';
|
|
42
|
+
import 'react-bootstrap/Row';
|
|
43
|
+
import 'react-bootstrap/Col';
|
|
44
|
+
import './inherits-18d4a779.js';
|
|
45
|
+
import './_object-sap-6a003379.js';
|
|
46
|
+
import './define-property-9a008401.js';
|
|
47
|
+
import './index.esm-3fdda599.js';
|
|
48
|
+
import './iconBase-602d52fe.js';
|
|
49
|
+
import 'react-bootstrap/Figure';
|
|
50
|
+
|
|
51
|
+
var _this = undefined;
|
|
52
|
+
|
|
53
|
+
var blocksToText = function blocksToText(blocks) {
|
|
54
|
+
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
55
|
+
|
|
56
|
+
var defaults = { nonTextBehavior: 'remove' };
|
|
57
|
+
var options = _Object$assign({}, defaults, opts);
|
|
58
|
+
return blocks.map(function (block) {
|
|
59
|
+
if (block._type !== 'block' || !block.children) {
|
|
60
|
+
return options.nonTextBehavior === 'remove' ? '' : '[' + block._type + ' block]';
|
|
61
|
+
}
|
|
62
|
+
return block.children.map(function (child) {
|
|
63
|
+
return child.text;
|
|
64
|
+
}).join('');
|
|
65
|
+
}).join('\n\n');
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
var setMetaDescription = function setMetaDescription(data, router) {
|
|
69
|
+
var metaDescription = blocksToText(data);
|
|
70
|
+
if (router && router.asPath) {
|
|
71
|
+
var queryParms = router.asPath.split('?')[1];
|
|
72
|
+
if (queryParms) {
|
|
73
|
+
var pageNumber = queryParms.split('&').reduce(function (acc, item) {
|
|
74
|
+
if (item.startsWith('page=')) {
|
|
75
|
+
if (item.split('=')[1]) {
|
|
76
|
+
acc = item.split('=')[1];
|
|
77
|
+
return acc;
|
|
78
|
+
}
|
|
79
|
+
return acc;
|
|
80
|
+
}
|
|
81
|
+
return acc;
|
|
82
|
+
}, '');
|
|
83
|
+
if (pageNumber && pageNumber !== '') {
|
|
84
|
+
metaDescription = blocksToText(data) + '| Page ' + pageNumber;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return React.createElement(
|
|
89
|
+
Head,
|
|
90
|
+
null,
|
|
91
|
+
React.createElement('meta', { name: 'description', content: metaDescription, key: 'description' })
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
var TaxonomyDescription = function TaxonomyDescription(_ref) {
|
|
96
|
+
var data = _ref.data,
|
|
97
|
+
client = _ref.client;
|
|
98
|
+
|
|
99
|
+
var router = useRouter();
|
|
100
|
+
return data && data.length > 0 && React.createElement(
|
|
101
|
+
'section',
|
|
102
|
+
{ className: 'taxonomy-description' },
|
|
103
|
+
setMetaDescription(data, router),
|
|
104
|
+
React.createElement(BlockContent, _extends({ serializers: getSerializers(client), blocks: data, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
TaxonomyDescription.getDescription = function () {
|
|
109
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
110
|
+
var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
111
|
+
var client = arguments[1];
|
|
112
|
+
var query, summary;
|
|
113
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
114
|
+
while (1) {
|
|
115
|
+
switch (_context.prev = _context.next) {
|
|
116
|
+
case 0:
|
|
117
|
+
query = '*[_type == \'taxonomy\' && identifier == \'' + url + '\'][0].summary';
|
|
118
|
+
summary = [];
|
|
119
|
+
_context.prev = 2;
|
|
120
|
+
_context.next = 5;
|
|
121
|
+
return client.fetch(query);
|
|
122
|
+
|
|
123
|
+
case 5:
|
|
124
|
+
summary = _context.sent;
|
|
125
|
+
_context.next = 11;
|
|
126
|
+
break;
|
|
127
|
+
|
|
128
|
+
case 8:
|
|
129
|
+
_context.prev = 8;
|
|
130
|
+
_context.t0 = _context['catch'](2);
|
|
131
|
+
|
|
132
|
+
console.error(_context.t0);
|
|
133
|
+
|
|
134
|
+
case 11:
|
|
135
|
+
return _context.abrupt('return', summary);
|
|
136
|
+
|
|
137
|
+
case 12:
|
|
138
|
+
case 'end':
|
|
139
|
+
return _context.stop();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}, _callee, _this, [[2, 8]]);
|
|
143
|
+
}));
|
|
144
|
+
|
|
145
|
+
return function () {
|
|
146
|
+
return _ref2.apply(this, arguments);
|
|
147
|
+
};
|
|
148
|
+
}();
|
|
149
|
+
|
|
150
|
+
export default TaxonomyDescription;
|
package/dist/esm/index.js
CHANGED
|
@@ -61,6 +61,7 @@ export { default as PopUpModal } from './PopUpModal.js';
|
|
|
61
61
|
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
|
+
export { default as TaxonomyDescription } from './TaxonomyDescription.js';
|
|
64
65
|
export { default as ForbesHero } from './ForbesHero.js';
|
|
65
66
|
export { default as HorizontalHero } from './HorizontalHero.js';
|
|
66
67
|
export { default as OncliveHero } from './OncliveHero.js';
|