@mjhls/mjh-framework 1.0.717 → 1.0.718
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/ArticleProgramLandingPage.js +175 -0
- package/dist/cjs/ArticleSeriesLandingPage.js +162 -0
- package/dist/cjs/index.js +4 -0
- package/dist/esm/ArticleProgramLandingPage.js +169 -0
- package/dist/esm/ArticleSeriesLandingPage.js +156 -0
- package/dist/esm/index.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# mjh-framework v. 1.0.
|
|
1
|
+
# mjh-framework v. 1.0.718
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/mjh-framework) [](https://standardjs.com)
|
|
4
4
|
|
|
@@ -0,0 +1,175 @@
|
|
|
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 BlockContent = require('./BlockContent-eca358e4.js');
|
|
8
|
+
var getSerializers = require('./index-7d880c49.js');
|
|
9
|
+
var ArticleSeriesListing = require('./ArticleSeriesListing.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('react-bootstrap');
|
|
22
|
+
require('./index-5ad2b070.js');
|
|
23
|
+
require('next/router');
|
|
24
|
+
require('./index-187c967e.js');
|
|
25
|
+
require('./util-6f784d85.js');
|
|
26
|
+
require('./Beam.js');
|
|
27
|
+
require('./stringify-01cf47f7.js');
|
|
28
|
+
require('./Segment.js');
|
|
29
|
+
require('./main-dc082238.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('./smoothscroll-99df7f93.js');
|
|
37
|
+
require('./moment-aca40de1.js');
|
|
38
|
+
require('./_object-to-array-bec5fcf2.js');
|
|
39
|
+
require('./toConsumableArray-cf0865fc.js');
|
|
40
|
+
require('react-bootstrap/Pagination');
|
|
41
|
+
require('react-bootstrap/Button');
|
|
42
|
+
require('./entities-3f9d0f2f.js');
|
|
43
|
+
require('./AdSlot.js');
|
|
44
|
+
require('./debounce-eb287781.js');
|
|
45
|
+
require('./isSymbol-04666465.js');
|
|
46
|
+
require('react-bootstrap/Row');
|
|
47
|
+
require('react-bootstrap/Col');
|
|
48
|
+
require('next/head');
|
|
49
|
+
require('./inherits-2eb23889.js');
|
|
50
|
+
require('./_object-sap-c5bd707d.js');
|
|
51
|
+
require('./define-property-aff11f8a.js');
|
|
52
|
+
require('./index.esm-974f47d9.js');
|
|
53
|
+
require('./iconBase-68959171.js');
|
|
54
|
+
require('react-bootstrap/Figure');
|
|
55
|
+
require('react-bootstrap/Container');
|
|
56
|
+
require('./visibility-sensor-8b54af99.js');
|
|
57
|
+
require('./YoutubeGroup.js');
|
|
58
|
+
require('./index.es-f3e47207.js');
|
|
59
|
+
|
|
60
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
61
|
+
|
|
62
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
63
|
+
|
|
64
|
+
var _this = undefined;
|
|
65
|
+
|
|
66
|
+
var ArticleProgramLandingPage = function ArticleProgramLandingPage(props) {
|
|
67
|
+
var client = props.client,
|
|
68
|
+
posts = props.posts,
|
|
69
|
+
mapping = props.mapping,
|
|
70
|
+
query = props.query,
|
|
71
|
+
params = props.params,
|
|
72
|
+
currentPage = props.currentPage,
|
|
73
|
+
pageview = props.pageview,
|
|
74
|
+
_props$columns = props.columns,
|
|
75
|
+
columns = _props$columns === undefined ? 'rotate' : _props$columns,
|
|
76
|
+
_props$variant = props.variant,
|
|
77
|
+
variant = _props$variant === undefined ? 'top' : _props$variant,
|
|
78
|
+
_props$page = props.page,
|
|
79
|
+
page = _props$page === undefined ? '' : _props$page,
|
|
80
|
+
_props$defaultImage = props.defaultImage,
|
|
81
|
+
defaultImage = _props$defaultImage === undefined ? '/placeholder.jpg' : _props$defaultImage,
|
|
82
|
+
virtualBlock = props.virtualBlock,
|
|
83
|
+
pageDescription = props.pageDescription,
|
|
84
|
+
_props$autoScroll = props.autoScroll,
|
|
85
|
+
autoScroll = _props$autoScroll === undefined ? true : _props$autoScroll;
|
|
86
|
+
|
|
87
|
+
return React__default['default'].createElement(
|
|
88
|
+
'div',
|
|
89
|
+
null,
|
|
90
|
+
virtualBlock && React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({ serializers: getSerializers.getSerializers(client), blocks: virtualBlock.body, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config())),
|
|
91
|
+
pageDescription && React__default['default'].createElement(
|
|
92
|
+
'div',
|
|
93
|
+
{ className: 'mb-3' },
|
|
94
|
+
pageDescription.image && React__default['default'].createElement('img', { className: 'mb-3 w-100', src: pageDescription.image, alt: pageDescription.imageAlt || '' }),
|
|
95
|
+
pageDescription.description && React__default['default'].createElement(
|
|
96
|
+
'p',
|
|
97
|
+
null,
|
|
98
|
+
pageDescription.description
|
|
99
|
+
)
|
|
100
|
+
),
|
|
101
|
+
posts && React__default['default'].createElement(ArticleSeriesListing, {
|
|
102
|
+
client: client,
|
|
103
|
+
mapping: mapping,
|
|
104
|
+
dataRecord: posts,
|
|
105
|
+
query: query,
|
|
106
|
+
params: params,
|
|
107
|
+
currentPage: currentPage,
|
|
108
|
+
pageview: pageview,
|
|
109
|
+
columns: columns,
|
|
110
|
+
variant: variant,
|
|
111
|
+
page: page,
|
|
112
|
+
autoScroll: autoScroll,
|
|
113
|
+
defaultImage: defaultImage
|
|
114
|
+
})
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
ArticleProgramLandingPage.getInitialData = function () {
|
|
119
|
+
var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(context, client) {
|
|
120
|
+
var itemsPerPage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
|
|
121
|
+
|
|
122
|
+
var pathname, urlQuery, url, page, currentPage, start, params, query, postsPromise, virtualBlockPromise, posts, virtualBlock, _ref2, _ref3;
|
|
123
|
+
|
|
124
|
+
return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
|
|
125
|
+
while (1) {
|
|
126
|
+
switch (_context.prev = _context.next) {
|
|
127
|
+
case 0:
|
|
128
|
+
pathname = context.pathname, urlQuery = context.query;
|
|
129
|
+
url = pathname ? pathname : '';
|
|
130
|
+
page = urlQuery.page ? parseInt(urlQuery.page) : 1;
|
|
131
|
+
currentPage = page ? parseInt(page) : 1;
|
|
132
|
+
start = (currentPage - 1) * itemsPerPage;
|
|
133
|
+
params = {
|
|
134
|
+
from: start,
|
|
135
|
+
to: start + itemsPerPage
|
|
136
|
+
};
|
|
137
|
+
query = '*[\n _type == \'article\' \n && !(_id in path("drafts.**")) \n && defined(title) \n && defined(url) \n && references(\'43b2f8fa-bf75-473b-8f9f-8019bb552468\')\n && is_visible == true\n && passwordLock != true \n && defined(published)\n && dateTime(published) <= dateTime(now())] | order(published desc)[$from...$to]{\n title,\n published,\n thumbnail,\n url,\n taxonomy,\n body[_type == "articleSeries"]{\n ...\n },\n \'pageNumber\': ' + currentPage + '\n }';
|
|
138
|
+
postsPromise = client.fetch(query, params);
|
|
139
|
+
virtualBlockPromise = client.fetch('*[_type == \'virtualBlock\' && identifier == \'' + pathname + '\'][0]');
|
|
140
|
+
posts = void 0, virtualBlock = void 0;
|
|
141
|
+
_context.prev = 10;
|
|
142
|
+
_context.next = 14;
|
|
143
|
+
return asyncToGenerator._Promise.all([postsPromise, virtualBlockPromise]);
|
|
144
|
+
|
|
145
|
+
case 14:
|
|
146
|
+
_ref2 = _context.sent;
|
|
147
|
+
_ref3 = slicedToArray._slicedToArray(_ref2, 2);
|
|
148
|
+
posts = _ref3[0];
|
|
149
|
+
virtualBlock = _ref3[1];
|
|
150
|
+
_context.next = 23;
|
|
151
|
+
break;
|
|
152
|
+
|
|
153
|
+
case 20:
|
|
154
|
+
_context.prev = 20;
|
|
155
|
+
_context.t0 = _context['catch'](10);
|
|
156
|
+
|
|
157
|
+
console.error(_context.t0);
|
|
158
|
+
|
|
159
|
+
case 23:
|
|
160
|
+
return _context.abrupt('return', { posts: posts, virtualBlock: virtualBlock, url: url, query: query });
|
|
161
|
+
|
|
162
|
+
case 24:
|
|
163
|
+
case 'end':
|
|
164
|
+
return _context.stop();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}, _callee, _this, [[10, 20]]);
|
|
168
|
+
}));
|
|
169
|
+
|
|
170
|
+
return function (_x, _x2) {
|
|
171
|
+
return _ref.apply(this, arguments);
|
|
172
|
+
};
|
|
173
|
+
}();
|
|
174
|
+
|
|
175
|
+
module.exports = ArticleProgramLandingPage;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var asyncToGenerator = require('./asyncToGenerator-2edcb6ad.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var MasterDeck = require('./MasterDeck.js');
|
|
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
|
+
require('./toConsumableArray-cf0865fc.js');
|
|
15
|
+
require('./extends-1e24fc8d.js');
|
|
16
|
+
require('./_object-pie-68c5bcbc.js');
|
|
17
|
+
require('./inherits-2eb23889.js');
|
|
18
|
+
require('./_object-sap-c5bd707d.js');
|
|
19
|
+
require('./define-property-aff11f8a.js');
|
|
20
|
+
require('./typeof-97065d40.js');
|
|
21
|
+
require('./_is-array-63ae4740.js');
|
|
22
|
+
require('./index-5ad2b070.js');
|
|
23
|
+
require('prop-types');
|
|
24
|
+
require('react-bootstrap/Container');
|
|
25
|
+
require('react-bootstrap/Row');
|
|
26
|
+
require('react-bootstrap/Col');
|
|
27
|
+
require('react-bootstrap/Card');
|
|
28
|
+
require('./moment-aca40de1.js');
|
|
29
|
+
require('next/router');
|
|
30
|
+
require('./lodash-4ef21f0f.js');
|
|
31
|
+
require('./debounce-eb287781.js');
|
|
32
|
+
require('./isSymbol-04666465.js');
|
|
33
|
+
require('./index.es-f3e47207.js');
|
|
34
|
+
require('./visibility-sensor-8b54af99.js');
|
|
35
|
+
require('react-dom');
|
|
36
|
+
require('./index-d48b231c.js');
|
|
37
|
+
require('./ADlgInfeed-fb101797.js');
|
|
38
|
+
require('./stringify-01cf47f7.js');
|
|
39
|
+
require('./slicedToArray-db24842a.js');
|
|
40
|
+
require('./AdSlot.js');
|
|
41
|
+
require('./Beam.js');
|
|
42
|
+
require('./Segment.js');
|
|
43
|
+
require('./main-dc082238.js');
|
|
44
|
+
require('./ADInfeed-2c7a6dd8.js');
|
|
45
|
+
|
|
46
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
47
|
+
|
|
48
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
49
|
+
|
|
50
|
+
var _this = undefined;
|
|
51
|
+
|
|
52
|
+
var ArticleSeriesLandingPage = function ArticleSeriesLandingPage(props) {
|
|
53
|
+
var client = props.client,
|
|
54
|
+
posts = props.posts,
|
|
55
|
+
summary = props.summary,
|
|
56
|
+
seriesTitle = props.seriesTitle,
|
|
57
|
+
seriesName = props.seriesName,
|
|
58
|
+
query = props.query,
|
|
59
|
+
params = props.params,
|
|
60
|
+
_props$currentPage = props.currentPage,
|
|
61
|
+
currentPage = _props$currentPage === undefined ? 1 : _props$currentPage,
|
|
62
|
+
pageview = props.pageview,
|
|
63
|
+
_props$autoScroll = props.autoScroll,
|
|
64
|
+
autoScroll = _props$autoScroll === undefined ? true : _props$autoScroll,
|
|
65
|
+
mapping = props.mapping,
|
|
66
|
+
deck = props.deck,
|
|
67
|
+
_props$variant = props.variant,
|
|
68
|
+
variant = _props$variant === undefined ? 'left' : _props$variant,
|
|
69
|
+
_props$defaultImage = props.defaultImage,
|
|
70
|
+
defaultImage = _props$defaultImage === undefined ? '/placeholder.jpg' : _props$defaultImage;
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
return React__default['default'].createElement(
|
|
74
|
+
'div',
|
|
75
|
+
null,
|
|
76
|
+
summary && React__default['default'].createElement(
|
|
77
|
+
'div',
|
|
78
|
+
{ style: { fontSize: '1rem' }, className: 'article-series-summary px-1 mt-2 mb-4' },
|
|
79
|
+
summary
|
|
80
|
+
),
|
|
81
|
+
seriesTitle && React__default['default'].createElement(
|
|
82
|
+
'h1',
|
|
83
|
+
{ className: 'article-series-title' },
|
|
84
|
+
React__default['default'].createElement(
|
|
85
|
+
'a',
|
|
86
|
+
seriesName && { href: '/view/' + seriesName },
|
|
87
|
+
seriesTitle
|
|
88
|
+
)
|
|
89
|
+
),
|
|
90
|
+
posts && deck && React__default['default'].createElement(MasterDeck, {
|
|
91
|
+
deck: deck,
|
|
92
|
+
variant: variant,
|
|
93
|
+
defaultImage: defaultImage,
|
|
94
|
+
client: client,
|
|
95
|
+
mapping: mapping,
|
|
96
|
+
dataRecord: posts,
|
|
97
|
+
query: query,
|
|
98
|
+
params: params,
|
|
99
|
+
currentPage: currentPage,
|
|
100
|
+
pageview: pageview,
|
|
101
|
+
autoScroll: autoScroll
|
|
102
|
+
})
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
ArticleSeriesLandingPage.getInitialData = function () {
|
|
107
|
+
var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(context, client) {
|
|
108
|
+
var itemsPerPage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
|
|
109
|
+
var urlQuery, seriesName, page, currentPage, start, params, query, posts, seriesTitle, summary, url;
|
|
110
|
+
return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
|
|
111
|
+
while (1) {
|
|
112
|
+
switch (_context.prev = _context.next) {
|
|
113
|
+
case 0:
|
|
114
|
+
urlQuery = context.query;
|
|
115
|
+
seriesName = urlQuery.series;
|
|
116
|
+
page = urlQuery.page ? parseInt(urlQuery.page) : 1;
|
|
117
|
+
currentPage = page ? parseInt(page) : 1;
|
|
118
|
+
start = (currentPage - 1) * itemsPerPage;
|
|
119
|
+
params = {
|
|
120
|
+
from: start,
|
|
121
|
+
to: start + itemsPerPage
|
|
122
|
+
};
|
|
123
|
+
query = '*[\n _type == \'article\' \n && !(_id in path("drafts.**")) \n && defined(title) \n && defined(url) \n && references(\'43b2f8fa-bf75-473b-8f9f-8019bb552468\')\n && url.current == \'' + seriesName + '\'\n && is_visible == true\n && passwordLock != true \n && defined(published)\n && dateTime(published) <= dateTime(now())] | order(published desc)[$from...$to]{\n title,\n summary,\n published,\n thumbnail,\n url,\n taxonomy,\n body[_type == "articleSeries"]{\n ...\n },\n }';
|
|
124
|
+
_context.next = 9;
|
|
125
|
+
return client.fetch(query, params);
|
|
126
|
+
|
|
127
|
+
case 9:
|
|
128
|
+
posts = _context.sent;
|
|
129
|
+
seriesTitle = '';
|
|
130
|
+
summary = false;
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
if (posts.length > 0 && posts[0].body[0].articles) {
|
|
134
|
+
url = posts[0].url.current + '?seriesArticle=';
|
|
135
|
+
|
|
136
|
+
seriesTitle = posts[0].title;
|
|
137
|
+
summary = posts[0].summary;
|
|
138
|
+
posts = posts[0].body[0].articles;
|
|
139
|
+
//start youtube thumbnail fix
|
|
140
|
+
posts.map(function (post, index) {
|
|
141
|
+
return post['url'] = {
|
|
142
|
+
current: url + post.param.current
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
//end
|
|
146
|
+
}
|
|
147
|
+
return _context.abrupt('return', { posts: posts, query: query, params: params, seriesTitle: seriesTitle, seriesName: seriesName, summary: summary });
|
|
148
|
+
|
|
149
|
+
case 14:
|
|
150
|
+
case 'end':
|
|
151
|
+
return _context.stop();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}, _callee, _this);
|
|
155
|
+
}));
|
|
156
|
+
|
|
157
|
+
return function (_x, _x2) {
|
|
158
|
+
return _ref.apply(this, arguments);
|
|
159
|
+
};
|
|
160
|
+
}();
|
|
161
|
+
|
|
162
|
+
module.exports = ArticleSeriesLandingPage;
|
package/dist/cjs/index.js
CHANGED
|
@@ -86,6 +86,8 @@ var View = require('./View.js');
|
|
|
86
86
|
var PartnerDetailListing = require('./PartnerDetailListing.js');
|
|
87
87
|
var VideoProgramLandingPage = require('./VideoProgramLandingPage.js');
|
|
88
88
|
var VideoSeriesLandingPage = require('./VideoSeriesLandingPage.js');
|
|
89
|
+
var ArticleProgramLandingPage = require('./ArticleProgramLandingPage.js');
|
|
90
|
+
var ArticleSeriesLandingPage = require('./ArticleSeriesLandingPage.js');
|
|
89
91
|
var urlFor = require('./urlFor.js');
|
|
90
92
|
var getTargeting = require('./getTargeting-497b581d.js');
|
|
91
93
|
var getKeywords = require('./getKeywords.js');
|
|
@@ -269,6 +271,8 @@ exports.View = View;
|
|
|
269
271
|
exports.PartnerDetailListing = PartnerDetailListing;
|
|
270
272
|
exports.VideoProgramLandingPage = VideoProgramLandingPage;
|
|
271
273
|
exports.VideoSeriesLandingPage = VideoSeriesLandingPage;
|
|
274
|
+
exports.ArticleProgramLandingPage = ArticleProgramLandingPage;
|
|
275
|
+
exports.ArticleSeriesLandingPage = ArticleSeriesLandingPage;
|
|
272
276
|
exports.urlFor = urlFor;
|
|
273
277
|
exports.getTargeting = getTargeting.getTargeting;
|
|
274
278
|
exports.getKeywords = getKeywords;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { a as _asyncToGenerator, r as regenerator, _ as _Promise } 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 { B as BlockContent } from './BlockContent-d8cd739c.js';
|
|
6
|
+
import { g as getSerializers } from './index-998e7b12.js';
|
|
7
|
+
import ArticleSeriesListing from './ArticleSeriesListing.js';
|
|
8
|
+
import './_commonjsHelpers-0c4b6f40.js';
|
|
9
|
+
import './es6.string.iterator-aa6068a3.js';
|
|
10
|
+
import './_to-object-97770c52.js';
|
|
11
|
+
import './web.dom.iterable-035980f3.js';
|
|
12
|
+
import './_library-528f1934.js';
|
|
13
|
+
import './core.get-iterator-method-d1d5ed02.js';
|
|
14
|
+
import './_set-species-494ed292.js';
|
|
15
|
+
import './_iter-detect-48516cd3.js';
|
|
16
|
+
import './_object-pie-33c40e79.js';
|
|
17
|
+
import 'prop-types';
|
|
18
|
+
import './index-3f5c03b2.js';
|
|
19
|
+
import 'react-bootstrap';
|
|
20
|
+
import './index-669ff425.js';
|
|
21
|
+
import 'next/router';
|
|
22
|
+
import './index-c7e2ac95.js';
|
|
23
|
+
import './util-3ab476bf.js';
|
|
24
|
+
import './Beam.js';
|
|
25
|
+
import './stringify-d4839bab.js';
|
|
26
|
+
import './Segment.js';
|
|
27
|
+
import './main-1450d277.js';
|
|
28
|
+
import './index-752d1dae.js';
|
|
29
|
+
import 'react-dom';
|
|
30
|
+
import './typeof-e9cea9e8.js';
|
|
31
|
+
import './_is-array-674f71ec.js';
|
|
32
|
+
import './brightcove-react-player-loader.es-b43c695a.js';
|
|
33
|
+
import './GroupDeck.js';
|
|
34
|
+
import './smoothscroll-fa4e3f8c.js';
|
|
35
|
+
import './moment-bc12cb97.js';
|
|
36
|
+
import './_object-to-array-8f409e54.js';
|
|
37
|
+
import './toConsumableArray-fa2dcda7.js';
|
|
38
|
+
import 'react-bootstrap/Pagination';
|
|
39
|
+
import 'react-bootstrap/Button';
|
|
40
|
+
import './entities-932b50cf.js';
|
|
41
|
+
import './AdSlot.js';
|
|
42
|
+
import './debounce-1a993acf.js';
|
|
43
|
+
import './isSymbol-807e927e.js';
|
|
44
|
+
import 'react-bootstrap/Row';
|
|
45
|
+
import 'react-bootstrap/Col';
|
|
46
|
+
import 'next/head';
|
|
47
|
+
import './inherits-5906fbea.js';
|
|
48
|
+
import './_object-sap-fd3054d0.js';
|
|
49
|
+
import './define-property-ec6d528d.js';
|
|
50
|
+
import './index.esm-3fdda599.js';
|
|
51
|
+
import './iconBase-602d52fe.js';
|
|
52
|
+
import 'react-bootstrap/Figure';
|
|
53
|
+
import 'react-bootstrap/Container';
|
|
54
|
+
import './visibility-sensor-082c757b.js';
|
|
55
|
+
import './YoutubeGroup.js';
|
|
56
|
+
import './index.es-c6222053.js';
|
|
57
|
+
|
|
58
|
+
var _this = undefined;
|
|
59
|
+
|
|
60
|
+
var ArticleProgramLandingPage = function ArticleProgramLandingPage(props) {
|
|
61
|
+
var client = props.client,
|
|
62
|
+
posts = props.posts,
|
|
63
|
+
mapping = props.mapping,
|
|
64
|
+
query = props.query,
|
|
65
|
+
params = props.params,
|
|
66
|
+
currentPage = props.currentPage,
|
|
67
|
+
pageview = props.pageview,
|
|
68
|
+
_props$columns = props.columns,
|
|
69
|
+
columns = _props$columns === undefined ? 'rotate' : _props$columns,
|
|
70
|
+
_props$variant = props.variant,
|
|
71
|
+
variant = _props$variant === undefined ? 'top' : _props$variant,
|
|
72
|
+
_props$page = props.page,
|
|
73
|
+
page = _props$page === undefined ? '' : _props$page,
|
|
74
|
+
_props$defaultImage = props.defaultImage,
|
|
75
|
+
defaultImage = _props$defaultImage === undefined ? '/placeholder.jpg' : _props$defaultImage,
|
|
76
|
+
virtualBlock = props.virtualBlock,
|
|
77
|
+
pageDescription = props.pageDescription,
|
|
78
|
+
_props$autoScroll = props.autoScroll,
|
|
79
|
+
autoScroll = _props$autoScroll === undefined ? true : _props$autoScroll;
|
|
80
|
+
|
|
81
|
+
return React.createElement(
|
|
82
|
+
'div',
|
|
83
|
+
null,
|
|
84
|
+
virtualBlock && React.createElement(BlockContent, _extends({ serializers: getSerializers(client), blocks: virtualBlock.body, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config())),
|
|
85
|
+
pageDescription && React.createElement(
|
|
86
|
+
'div',
|
|
87
|
+
{ className: 'mb-3' },
|
|
88
|
+
pageDescription.image && React.createElement('img', { className: 'mb-3 w-100', src: pageDescription.image, alt: pageDescription.imageAlt || '' }),
|
|
89
|
+
pageDescription.description && React.createElement(
|
|
90
|
+
'p',
|
|
91
|
+
null,
|
|
92
|
+
pageDescription.description
|
|
93
|
+
)
|
|
94
|
+
),
|
|
95
|
+
posts && React.createElement(ArticleSeriesListing, {
|
|
96
|
+
client: client,
|
|
97
|
+
mapping: mapping,
|
|
98
|
+
dataRecord: posts,
|
|
99
|
+
query: query,
|
|
100
|
+
params: params,
|
|
101
|
+
currentPage: currentPage,
|
|
102
|
+
pageview: pageview,
|
|
103
|
+
columns: columns,
|
|
104
|
+
variant: variant,
|
|
105
|
+
page: page,
|
|
106
|
+
autoScroll: autoScroll,
|
|
107
|
+
defaultImage: defaultImage
|
|
108
|
+
})
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
ArticleProgramLandingPage.getInitialData = function () {
|
|
113
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(context, client) {
|
|
114
|
+
var itemsPerPage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
|
|
115
|
+
|
|
116
|
+
var pathname, urlQuery, url, page, currentPage, start, params, query, postsPromise, virtualBlockPromise, posts, virtualBlock, _ref2, _ref3;
|
|
117
|
+
|
|
118
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
119
|
+
while (1) {
|
|
120
|
+
switch (_context.prev = _context.next) {
|
|
121
|
+
case 0:
|
|
122
|
+
pathname = context.pathname, urlQuery = context.query;
|
|
123
|
+
url = pathname ? pathname : '';
|
|
124
|
+
page = urlQuery.page ? parseInt(urlQuery.page) : 1;
|
|
125
|
+
currentPage = page ? parseInt(page) : 1;
|
|
126
|
+
start = (currentPage - 1) * itemsPerPage;
|
|
127
|
+
params = {
|
|
128
|
+
from: start,
|
|
129
|
+
to: start + itemsPerPage
|
|
130
|
+
};
|
|
131
|
+
query = '*[\n _type == \'article\' \n && !(_id in path("drafts.**")) \n && defined(title) \n && defined(url) \n && references(\'43b2f8fa-bf75-473b-8f9f-8019bb552468\')\n && is_visible == true\n && passwordLock != true \n && defined(published)\n && dateTime(published) <= dateTime(now())] | order(published desc)[$from...$to]{\n title,\n published,\n thumbnail,\n url,\n taxonomy,\n body[_type == "articleSeries"]{\n ...\n },\n \'pageNumber\': ' + currentPage + '\n }';
|
|
132
|
+
postsPromise = client.fetch(query, params);
|
|
133
|
+
virtualBlockPromise = client.fetch('*[_type == \'virtualBlock\' && identifier == \'' + pathname + '\'][0]');
|
|
134
|
+
posts = void 0, virtualBlock = void 0;
|
|
135
|
+
_context.prev = 10;
|
|
136
|
+
_context.next = 14;
|
|
137
|
+
return _Promise.all([postsPromise, virtualBlockPromise]);
|
|
138
|
+
|
|
139
|
+
case 14:
|
|
140
|
+
_ref2 = _context.sent;
|
|
141
|
+
_ref3 = _slicedToArray(_ref2, 2);
|
|
142
|
+
posts = _ref3[0];
|
|
143
|
+
virtualBlock = _ref3[1];
|
|
144
|
+
_context.next = 23;
|
|
145
|
+
break;
|
|
146
|
+
|
|
147
|
+
case 20:
|
|
148
|
+
_context.prev = 20;
|
|
149
|
+
_context.t0 = _context['catch'](10);
|
|
150
|
+
|
|
151
|
+
console.error(_context.t0);
|
|
152
|
+
|
|
153
|
+
case 23:
|
|
154
|
+
return _context.abrupt('return', { posts: posts, virtualBlock: virtualBlock, url: url, query: query });
|
|
155
|
+
|
|
156
|
+
case 24:
|
|
157
|
+
case 'end':
|
|
158
|
+
return _context.stop();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}, _callee, _this, [[10, 20]]);
|
|
162
|
+
}));
|
|
163
|
+
|
|
164
|
+
return function (_x, _x2) {
|
|
165
|
+
return _ref.apply(this, arguments);
|
|
166
|
+
};
|
|
167
|
+
}();
|
|
168
|
+
|
|
169
|
+
export default ArticleProgramLandingPage;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-2bd4099a.js';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import MasterDeck from './MasterDeck.js';
|
|
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
|
+
import './toConsumableArray-fa2dcda7.js';
|
|
13
|
+
import './extends-31d65aba.js';
|
|
14
|
+
import './_object-pie-33c40e79.js';
|
|
15
|
+
import './inherits-5906fbea.js';
|
|
16
|
+
import './_object-sap-fd3054d0.js';
|
|
17
|
+
import './define-property-ec6d528d.js';
|
|
18
|
+
import './typeof-e9cea9e8.js';
|
|
19
|
+
import './_is-array-674f71ec.js';
|
|
20
|
+
import './index-669ff425.js';
|
|
21
|
+
import 'prop-types';
|
|
22
|
+
import 'react-bootstrap/Container';
|
|
23
|
+
import 'react-bootstrap/Row';
|
|
24
|
+
import 'react-bootstrap/Col';
|
|
25
|
+
import 'react-bootstrap/Card';
|
|
26
|
+
import './moment-bc12cb97.js';
|
|
27
|
+
import 'next/router';
|
|
28
|
+
import './lodash-ad27652f.js';
|
|
29
|
+
import './debounce-1a993acf.js';
|
|
30
|
+
import './isSymbol-807e927e.js';
|
|
31
|
+
import './index.es-c6222053.js';
|
|
32
|
+
import './visibility-sensor-082c757b.js';
|
|
33
|
+
import 'react-dom';
|
|
34
|
+
import './index-3f5c03b2.js';
|
|
35
|
+
import './ADlgInfeed-0bf06b17.js';
|
|
36
|
+
import './stringify-d4839bab.js';
|
|
37
|
+
import './slicedToArray-cdeaee08.js';
|
|
38
|
+
import './AdSlot.js';
|
|
39
|
+
import './Beam.js';
|
|
40
|
+
import './Segment.js';
|
|
41
|
+
import './main-1450d277.js';
|
|
42
|
+
import './ADInfeed-3ee501b9.js';
|
|
43
|
+
|
|
44
|
+
var _this = undefined;
|
|
45
|
+
|
|
46
|
+
var ArticleSeriesLandingPage = function ArticleSeriesLandingPage(props) {
|
|
47
|
+
var client = props.client,
|
|
48
|
+
posts = props.posts,
|
|
49
|
+
summary = props.summary,
|
|
50
|
+
seriesTitle = props.seriesTitle,
|
|
51
|
+
seriesName = props.seriesName,
|
|
52
|
+
query = props.query,
|
|
53
|
+
params = props.params,
|
|
54
|
+
_props$currentPage = props.currentPage,
|
|
55
|
+
currentPage = _props$currentPage === undefined ? 1 : _props$currentPage,
|
|
56
|
+
pageview = props.pageview,
|
|
57
|
+
_props$autoScroll = props.autoScroll,
|
|
58
|
+
autoScroll = _props$autoScroll === undefined ? true : _props$autoScroll,
|
|
59
|
+
mapping = props.mapping,
|
|
60
|
+
deck = props.deck,
|
|
61
|
+
_props$variant = props.variant,
|
|
62
|
+
variant = _props$variant === undefined ? 'left' : _props$variant,
|
|
63
|
+
_props$defaultImage = props.defaultImage,
|
|
64
|
+
defaultImage = _props$defaultImage === undefined ? '/placeholder.jpg' : _props$defaultImage;
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
return React.createElement(
|
|
68
|
+
'div',
|
|
69
|
+
null,
|
|
70
|
+
summary && React.createElement(
|
|
71
|
+
'div',
|
|
72
|
+
{ style: { fontSize: '1rem' }, className: 'article-series-summary px-1 mt-2 mb-4' },
|
|
73
|
+
summary
|
|
74
|
+
),
|
|
75
|
+
seriesTitle && React.createElement(
|
|
76
|
+
'h1',
|
|
77
|
+
{ className: 'article-series-title' },
|
|
78
|
+
React.createElement(
|
|
79
|
+
'a',
|
|
80
|
+
seriesName && { href: '/view/' + seriesName },
|
|
81
|
+
seriesTitle
|
|
82
|
+
)
|
|
83
|
+
),
|
|
84
|
+
posts && deck && React.createElement(MasterDeck, {
|
|
85
|
+
deck: deck,
|
|
86
|
+
variant: variant,
|
|
87
|
+
defaultImage: defaultImage,
|
|
88
|
+
client: client,
|
|
89
|
+
mapping: mapping,
|
|
90
|
+
dataRecord: posts,
|
|
91
|
+
query: query,
|
|
92
|
+
params: params,
|
|
93
|
+
currentPage: currentPage,
|
|
94
|
+
pageview: pageview,
|
|
95
|
+
autoScroll: autoScroll
|
|
96
|
+
})
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
ArticleSeriesLandingPage.getInitialData = function () {
|
|
101
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(context, client) {
|
|
102
|
+
var itemsPerPage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
|
|
103
|
+
var urlQuery, seriesName, page, currentPage, start, params, query, posts, seriesTitle, summary, url;
|
|
104
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
105
|
+
while (1) {
|
|
106
|
+
switch (_context.prev = _context.next) {
|
|
107
|
+
case 0:
|
|
108
|
+
urlQuery = context.query;
|
|
109
|
+
seriesName = urlQuery.series;
|
|
110
|
+
page = urlQuery.page ? parseInt(urlQuery.page) : 1;
|
|
111
|
+
currentPage = page ? parseInt(page) : 1;
|
|
112
|
+
start = (currentPage - 1) * itemsPerPage;
|
|
113
|
+
params = {
|
|
114
|
+
from: start,
|
|
115
|
+
to: start + itemsPerPage
|
|
116
|
+
};
|
|
117
|
+
query = '*[\n _type == \'article\' \n && !(_id in path("drafts.**")) \n && defined(title) \n && defined(url) \n && references(\'43b2f8fa-bf75-473b-8f9f-8019bb552468\')\n && url.current == \'' + seriesName + '\'\n && is_visible == true\n && passwordLock != true \n && defined(published)\n && dateTime(published) <= dateTime(now())] | order(published desc)[$from...$to]{\n title,\n summary,\n published,\n thumbnail,\n url,\n taxonomy,\n body[_type == "articleSeries"]{\n ...\n },\n }';
|
|
118
|
+
_context.next = 9;
|
|
119
|
+
return client.fetch(query, params);
|
|
120
|
+
|
|
121
|
+
case 9:
|
|
122
|
+
posts = _context.sent;
|
|
123
|
+
seriesTitle = '';
|
|
124
|
+
summary = false;
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
if (posts.length > 0 && posts[0].body[0].articles) {
|
|
128
|
+
url = posts[0].url.current + '?seriesArticle=';
|
|
129
|
+
|
|
130
|
+
seriesTitle = posts[0].title;
|
|
131
|
+
summary = posts[0].summary;
|
|
132
|
+
posts = posts[0].body[0].articles;
|
|
133
|
+
//start youtube thumbnail fix
|
|
134
|
+
posts.map(function (post, index) {
|
|
135
|
+
return post['url'] = {
|
|
136
|
+
current: url + post.param.current
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
//end
|
|
140
|
+
}
|
|
141
|
+
return _context.abrupt('return', { posts: posts, query: query, params: params, seriesTitle: seriesTitle, seriesName: seriesName, summary: summary });
|
|
142
|
+
|
|
143
|
+
case 14:
|
|
144
|
+
case 'end':
|
|
145
|
+
return _context.stop();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}, _callee, _this);
|
|
149
|
+
}));
|
|
150
|
+
|
|
151
|
+
return function (_x, _x2) {
|
|
152
|
+
return _ref.apply(this, arguments);
|
|
153
|
+
};
|
|
154
|
+
}();
|
|
155
|
+
|
|
156
|
+
export default ArticleSeriesLandingPage;
|
package/dist/esm/index.js
CHANGED
|
@@ -82,6 +82,8 @@ export { default as View } from './View.js';
|
|
|
82
82
|
export { default as PartnerDetailListing } from './PartnerDetailListing.js';
|
|
83
83
|
export { default as VideoProgramLandingPage } from './VideoProgramLandingPage.js';
|
|
84
84
|
export { default as VideoSeriesLandingPage } from './VideoSeriesLandingPage.js';
|
|
85
|
+
export { default as ArticleProgramLandingPage } from './ArticleProgramLandingPage.js';
|
|
86
|
+
export { default as ArticleSeriesLandingPage } from './ArticleSeriesLandingPage.js';
|
|
85
87
|
export { default as urlFor } from './urlFor.js';
|
|
86
88
|
export { g as getTargeting } from './getTargeting-2d402d66.js';
|
|
87
89
|
export { default as getKeywords } from './getKeywords.js';
|