@mjhls/mjh-framework 1.0.713 → 1.0.715
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/AdSlotsProvider.js +112 -7
- package/dist/cjs/ArticleCarousel.js +2 -1
- package/dist/cjs/ArticleSeriesListing.js +2 -1
- package/dist/cjs/BrowseVideosListing.js +2 -1
- package/dist/cjs/ExternalResources.js +3 -2
- package/dist/cjs/GroupDeck.js +13 -12
- package/dist/cjs/PartnerDetailListing.js +3 -2
- package/dist/cjs/TaxonomyDescription.js +3 -2
- package/dist/cjs/VideoProgramLandingPage.js +251 -0
- package/dist/cjs/VideoSeriesLandingPage.js +178 -0
- package/dist/cjs/VideoSeriesListing.js +2 -1
- package/dist/cjs/View.js +3 -2
- package/dist/cjs/YoutubeGroup.js +17 -16
- package/dist/cjs/getSerializers.js +3 -2
- package/dist/cjs/index-187c967e.js +54 -0
- package/dist/cjs/{index-bb09dc7c.js → index-27f9e7ef.js} +11 -11
- package/dist/cjs/index.js +8 -2
- package/dist/cjs/{smoothscroll-1abb448e.js → smoothscroll-99df7f93.js} +0 -50
- package/dist/esm/AdSlotsProvider.js +114 -9
- package/dist/esm/ArticleCarousel.js +2 -1
- package/dist/esm/ArticleSeriesListing.js +2 -1
- package/dist/esm/BrowseVideosListing.js +2 -1
- package/dist/esm/ExternalResources.js +3 -2
- package/dist/esm/GroupDeck.js +2 -1
- package/dist/esm/PartnerDetailListing.js +3 -2
- package/dist/esm/TaxonomyDescription.js +3 -2
- package/dist/esm/VideoProgramLandingPage.js +242 -0
- package/dist/esm/VideoSeriesLandingPage.js +172 -0
- package/dist/esm/VideoSeriesListing.js +2 -1
- package/dist/esm/View.js +3 -2
- package/dist/esm/YoutubeGroup.js +2 -1
- package/dist/esm/getSerializers.js +3 -2
- package/dist/esm/index-c7e2ac95.js +52 -0
- package/dist/esm/{index-48a08226.js → index-db270302.js} +1 -1
- package/dist/esm/index.js +6 -2
- package/dist/esm/{smoothscroll-ab6e0238.js → smoothscroll-fa4e3f8c.js} +2 -51
- package/package.json +1 -1
|
@@ -1,9 +1,20 @@
|
|
|
1
|
+
import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-acd1cc47.js';
|
|
2
|
+
import { _ as _toConsumableArray } from './toConsumableArray-5212fee7.js';
|
|
1
3
|
import React, { useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { e as main_22 } from './main-1450d277.js';
|
|
4
|
+
import { l as lib_3, b as lib_1 } from './index-669ff425.js';
|
|
5
|
+
import { e as main_22, m as main_40 } from './main-1450d277.js';
|
|
4
6
|
import './_commonjsHelpers-0c4b6f40.js';
|
|
7
|
+
import './es6.string.iterator-b24a54f2.js';
|
|
8
|
+
import './_to-object-9bef3b62.js';
|
|
9
|
+
import './web.dom.iterable-ca37144a.js';
|
|
10
|
+
import './_library-528f1934.js';
|
|
11
|
+
import './core.get-iterator-method-1b116089.js';
|
|
12
|
+
import './_set-species-0b056cff.js';
|
|
13
|
+
import './_iter-detect-d4d262ee.js';
|
|
5
14
|
import 'prop-types';
|
|
6
15
|
|
|
16
|
+
var _this = undefined;
|
|
17
|
+
|
|
7
18
|
var AdSlotsProvider = function AdSlotsProvider(_ref) {
|
|
8
19
|
var children = _ref.children,
|
|
9
20
|
networkID = _ref.networkID,
|
|
@@ -12,18 +23,112 @@ var AdSlotsProvider = function AdSlotsProvider(_ref) {
|
|
|
12
23
|
_ref$singleRequest = _ref.singleRequest,
|
|
13
24
|
singleRequest = _ref$singleRequest === undefined ? true : _ref$singleRequest,
|
|
14
25
|
_ref$autoRefresh = _ref.autoRefresh,
|
|
15
|
-
autoRefresh = _ref$autoRefresh === undefined ? false : _ref$autoRefresh
|
|
26
|
+
autoRefresh = _ref$autoRefresh === undefined ? false : _ref$autoRefresh,
|
|
27
|
+
_ref$refreshADs = _ref.refreshADs,
|
|
28
|
+
refreshADs = _ref$refreshADs === undefined ? {} : _ref$refreshADs,
|
|
29
|
+
_ref$refreshInterval = _ref.refreshInterval,
|
|
30
|
+
refreshInterval = _ref$refreshInterval === undefined ? 60 : _ref$refreshInterval;
|
|
16
31
|
|
|
17
32
|
useEffect(function () {
|
|
18
|
-
// Refresh ADs after every one minute
|
|
33
|
+
// Refresh ADs after every one minute if user didn't scroll.
|
|
34
|
+
// refreshInterval accepts time in seconds and default is 60 seconds
|
|
35
|
+
var generateAdsToRefresh = function () {
|
|
36
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(ads) {
|
|
37
|
+
var googletag, slots, domAds, adsToRefresh;
|
|
38
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
39
|
+
while (1) {
|
|
40
|
+
switch (_context.prev = _context.next) {
|
|
41
|
+
case 0:
|
|
42
|
+
_context.next = 2;
|
|
43
|
+
return lib_3.getGoogletag();
|
|
44
|
+
|
|
45
|
+
case 2:
|
|
46
|
+
googletag = _context.sent;
|
|
47
|
+
|
|
48
|
+
if (!(googletag && googletag.pubadsReady)) {
|
|
49
|
+
_context.next = 8;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
slots = googletag.pubads().getSlots();
|
|
54
|
+
domAds = slots.map(function (slot) {
|
|
55
|
+
return slot.getSlotId().getDomId();
|
|
56
|
+
});
|
|
57
|
+
adsToRefresh = domAds.reduce(function (acc, item) {
|
|
58
|
+
ads.forEach(function (ad) {
|
|
59
|
+
if (item.includes(ad)) {
|
|
60
|
+
acc = [].concat(_toConsumableArray(acc), [item]);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
return acc;
|
|
64
|
+
}, []);
|
|
65
|
+
return _context.abrupt('return', adsToRefresh);
|
|
66
|
+
|
|
67
|
+
case 8:
|
|
68
|
+
return _context.abrupt('return', ads);
|
|
69
|
+
|
|
70
|
+
case 9:
|
|
71
|
+
case 'end':
|
|
72
|
+
return _context.stop();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}, _callee, _this);
|
|
76
|
+
}));
|
|
77
|
+
|
|
78
|
+
return function generateAdsToRefresh(_x) {
|
|
79
|
+
return _ref2.apply(this, arguments);
|
|
80
|
+
};
|
|
81
|
+
}();
|
|
19
82
|
var isScrolling = void 0;
|
|
20
83
|
var refreshADsAfterInterval = function refreshADsAfterInterval() {
|
|
21
|
-
isScrolling = setInterval(function () {
|
|
22
|
-
|
|
23
|
-
|
|
84
|
+
isScrolling = setInterval(_asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
|
|
85
|
+
var _refreshADs$mobileAds, mobileAds, _refreshADs$desktopAd, desktopAds, ads;
|
|
86
|
+
|
|
87
|
+
return regenerator.wrap(function _callee2$(_context2) {
|
|
88
|
+
while (1) {
|
|
89
|
+
switch (_context2.prev = _context2.next) {
|
|
90
|
+
case 0:
|
|
91
|
+
_refreshADs$mobileAds = refreshADs.mobileAds, mobileAds = _refreshADs$mobileAds === undefined ? ['leaderboard-ad'] : _refreshADs$mobileAds, _refreshADs$desktopAd = refreshADs.desktopAds, desktopAds = _refreshADs$desktopAd === undefined ? [] : _refreshADs$desktopAd;
|
|
92
|
+
ads = [];
|
|
93
|
+
|
|
94
|
+
if (!main_40) {
|
|
95
|
+
_context2.next = 8;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
_context2.next = 5;
|
|
100
|
+
return generateAdsToRefresh(mobileAds);
|
|
101
|
+
|
|
102
|
+
case 5:
|
|
103
|
+
ads = _context2.sent;
|
|
104
|
+
_context2.next = 12;
|
|
105
|
+
break;
|
|
106
|
+
|
|
107
|
+
case 8:
|
|
108
|
+
if (!main_22) {
|
|
109
|
+
_context2.next = 12;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
_context2.next = 11;
|
|
114
|
+
return generateAdsToRefresh(desktopAds);
|
|
115
|
+
|
|
116
|
+
case 11:
|
|
117
|
+
ads = _context2.sent;
|
|
118
|
+
|
|
119
|
+
case 12:
|
|
120
|
+
lib_3.refresh.apply(lib_3, _toConsumableArray(ads));
|
|
121
|
+
|
|
122
|
+
case 13:
|
|
123
|
+
case 'end':
|
|
124
|
+
return _context2.stop();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, _callee2, _this);
|
|
128
|
+
})), parseInt(refreshInterval) * 1000);
|
|
24
129
|
};
|
|
25
|
-
autoRefresh &&
|
|
26
|
-
autoRefresh &&
|
|
130
|
+
autoRefresh && refreshADsAfterInterval();
|
|
131
|
+
autoRefresh && window.addEventListener('scroll', function () {
|
|
27
132
|
clearInterval(isScrolling);
|
|
28
133
|
refreshADsAfterInterval();
|
|
29
134
|
}, false);
|
|
@@ -11,10 +11,11 @@ import './_is-array-9383b394.js';
|
|
|
11
11
|
import './_library-528f1934.js';
|
|
12
12
|
import './slicedToArray-34468155.js';
|
|
13
13
|
import './core.get-iterator-method-1b116089.js';
|
|
14
|
-
import './
|
|
14
|
+
import './index-c7e2ac95.js';
|
|
15
15
|
import './index-752d1dae.js';
|
|
16
16
|
import 'react-dom';
|
|
17
17
|
import 'prop-types';
|
|
18
|
+
import './smoothscroll-fa4e3f8c.js';
|
|
18
19
|
import './index-3f5c03b2.js';
|
|
19
20
|
import './main-1450d277.js';
|
|
20
21
|
|
|
@@ -25,8 +25,9 @@ import 'react-dom';
|
|
|
25
25
|
import './iconBase-602d52fe.js';
|
|
26
26
|
import './slicedToArray-34468155.js';
|
|
27
27
|
import './core.get-iterator-method-1b116089.js';
|
|
28
|
-
import './
|
|
28
|
+
import './index-c7e2ac95.js';
|
|
29
29
|
import './index-752d1dae.js';
|
|
30
|
+
import './smoothscroll-fa4e3f8c.js';
|
|
30
31
|
import './index-3f5c03b2.js';
|
|
31
32
|
import './main-1450d277.js';
|
|
32
33
|
import './isSymbol-807e927e.js';
|
|
@@ -13,10 +13,11 @@ import './_is-array-9383b394.js';
|
|
|
13
13
|
import './_library-528f1934.js';
|
|
14
14
|
import './slicedToArray-34468155.js';
|
|
15
15
|
import './core.get-iterator-method-1b116089.js';
|
|
16
|
-
import './
|
|
16
|
+
import './index-c7e2ac95.js';
|
|
17
17
|
import './index-752d1dae.js';
|
|
18
18
|
import 'react-dom';
|
|
19
19
|
import 'prop-types';
|
|
20
|
+
import './smoothscroll-fa4e3f8c.js';
|
|
20
21
|
import './index-3f5c03b2.js';
|
|
21
22
|
import './main-1450d277.js';
|
|
22
23
|
import './iconBase-602d52fe.js';
|
|
@@ -2,7 +2,7 @@ import { _ as _extends } from './extends-c2b1c9d7.js';
|
|
|
2
2
|
import { _ as _slicedToArray } from './slicedToArray-34468155.js';
|
|
3
3
|
import React, { useState, useEffect } from 'react';
|
|
4
4
|
import { B as BlockContent } from './BlockContent-d8cd739c.js';
|
|
5
|
-
import { g as getSerializers } from './index-
|
|
5
|
+
import { g as getSerializers } from './index-db270302.js';
|
|
6
6
|
import { m as momentTimezone } from './index-ccb770c7.js';
|
|
7
7
|
import { useRouter } from 'next/router';
|
|
8
8
|
import Button from 'react-bootstrap/Button';
|
|
@@ -16,7 +16,7 @@ import 'prop-types';
|
|
|
16
16
|
import './index-3f5c03b2.js';
|
|
17
17
|
import 'react-bootstrap';
|
|
18
18
|
import './index-669ff425.js';
|
|
19
|
-
import './
|
|
19
|
+
import './index-c7e2ac95.js';
|
|
20
20
|
import './util-3ab476bf.js';
|
|
21
21
|
import './Beam.js';
|
|
22
22
|
import './stringify-8a4f19f7.js';
|
|
@@ -32,6 +32,7 @@ import './typeof-64422756.js';
|
|
|
32
32
|
import './_is-array-9383b394.js';
|
|
33
33
|
import './brightcove-react-player-loader.es-b43c695a.js';
|
|
34
34
|
import './GroupDeck.js';
|
|
35
|
+
import './smoothscroll-fa4e3f8c.js';
|
|
35
36
|
import './moment-bc12cb97.js';
|
|
36
37
|
import './toConsumableArray-5212fee7.js';
|
|
37
38
|
import 'react-bootstrap/Pagination';
|
package/dist/esm/GroupDeck.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { _ as _typeof } from './typeof-64422756.js';
|
|
2
2
|
import { _ as _slicedToArray } from './slicedToArray-34468155.js';
|
|
3
3
|
import React, { useRef, useState, useEffect } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { g as getYoutubeId } from './index-c7e2ac95.js';
|
|
5
|
+
import { s as smoothscroll } from './smoothscroll-fa4e3f8c.js';
|
|
5
6
|
import { i as imageUrlBuilder } from './index-3f5c03b2.js';
|
|
6
7
|
import './_commonjsHelpers-0c4b6f40.js';
|
|
7
8
|
import './es6.string.iterator-b24a54f2.js';
|
|
@@ -4,13 +4,13 @@ import { _ as _extends } from './extends-c2b1c9d7.js';
|
|
|
4
4
|
import React, { useRef, useState, useEffect } from 'react';
|
|
5
5
|
import { TwitterTimelineEmbed } from 'react-twitter-embed';
|
|
6
6
|
import { i as imageUrlBuilder } from './index-3f5c03b2.js';
|
|
7
|
-
import { s as smoothscroll } from './smoothscroll-
|
|
7
|
+
import { s as smoothscroll } from './smoothscroll-fa4e3f8c.js';
|
|
8
8
|
import { m as moment } from './moment-bc12cb97.js';
|
|
9
9
|
import QueueDeckExpanded from './QueueDeckExpanded.js';
|
|
10
10
|
import Breadcrumbs from './Breadcrumbs.js';
|
|
11
11
|
import Feature from './Feature.js';
|
|
12
12
|
import urlFor from './urlFor.js';
|
|
13
|
-
import { g as getSerializers } from './index-
|
|
13
|
+
import { g as getSerializers } from './index-db270302.js';
|
|
14
14
|
import { B as BlockContent } from './BlockContent-d8cd739c.js';
|
|
15
15
|
import './_commonjsHelpers-0c4b6f40.js';
|
|
16
16
|
import './es6.string.iterator-b24a54f2.js';
|
|
@@ -47,6 +47,7 @@ import './getContentCategory-15dcc413.js';
|
|
|
47
47
|
import './timeDifferenceCalc.js';
|
|
48
48
|
import 'react-bootstrap/Breadcrumb';
|
|
49
49
|
import 'react-bootstrap/Carousel';
|
|
50
|
+
import './index-c7e2ac95.js';
|
|
50
51
|
import './util-3ab476bf.js';
|
|
51
52
|
import './typeof-64422756.js';
|
|
52
53
|
import './_is-array-9383b394.js';
|
|
@@ -4,7 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import { useRouter } from 'next/router';
|
|
5
5
|
import Head from 'next/head';
|
|
6
6
|
import { B as BlockContent } from './BlockContent-d8cd739c.js';
|
|
7
|
-
import { g as getSerializers } from './index-
|
|
7
|
+
import { g as getSerializers } from './index-db270302.js';
|
|
8
8
|
import './_commonjsHelpers-0c4b6f40.js';
|
|
9
9
|
import './es6.string.iterator-b24a54f2.js';
|
|
10
10
|
import './_to-object-9bef3b62.js';
|
|
@@ -19,7 +19,7 @@ import './index-3f5c03b2.js';
|
|
|
19
19
|
import './slicedToArray-34468155.js';
|
|
20
20
|
import 'react-bootstrap';
|
|
21
21
|
import './index-669ff425.js';
|
|
22
|
-
import './
|
|
22
|
+
import './index-c7e2ac95.js';
|
|
23
23
|
import './util-3ab476bf.js';
|
|
24
24
|
import './Beam.js';
|
|
25
25
|
import './stringify-8a4f19f7.js';
|
|
@@ -31,6 +31,7 @@ import './typeof-64422756.js';
|
|
|
31
31
|
import './_is-array-9383b394.js';
|
|
32
32
|
import './brightcove-react-player-loader.es-b43c695a.js';
|
|
33
33
|
import './GroupDeck.js';
|
|
34
|
+
import './smoothscroll-fa4e3f8c.js';
|
|
34
35
|
import './moment-bc12cb97.js';
|
|
35
36
|
import './toConsumableArray-5212fee7.js';
|
|
36
37
|
import 'react-bootstrap/Pagination';
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-acd1cc47.js';
|
|
2
|
+
import { _ as _extends } from './extends-c2b1c9d7.js';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { B as BlockContent } from './BlockContent-d8cd739c.js';
|
|
5
|
+
import Col from 'react-bootstrap/Col';
|
|
6
|
+
import Form from 'react-bootstrap/Form';
|
|
7
|
+
import Button from 'react-bootstrap/Button';
|
|
8
|
+
import { g as getSerializers } from './index-db270302.js';
|
|
9
|
+
import VideoSeriesListing from './VideoSeriesListing.js';
|
|
10
|
+
import './_commonjsHelpers-0c4b6f40.js';
|
|
11
|
+
import './es6.string.iterator-b24a54f2.js';
|
|
12
|
+
import './_to-object-9bef3b62.js';
|
|
13
|
+
import './web.dom.iterable-ca37144a.js';
|
|
14
|
+
import './_library-528f1934.js';
|
|
15
|
+
import './core.get-iterator-method-1b116089.js';
|
|
16
|
+
import './_set-species-0b056cff.js';
|
|
17
|
+
import './_iter-detect-d4d262ee.js';
|
|
18
|
+
import './_object-pie-71ac75a4.js';
|
|
19
|
+
import 'prop-types';
|
|
20
|
+
import './index-3f5c03b2.js';
|
|
21
|
+
import './slicedToArray-34468155.js';
|
|
22
|
+
import 'react-bootstrap';
|
|
23
|
+
import './index-669ff425.js';
|
|
24
|
+
import 'next/router';
|
|
25
|
+
import './index-c7e2ac95.js';
|
|
26
|
+
import './util-3ab476bf.js';
|
|
27
|
+
import './Beam.js';
|
|
28
|
+
import './stringify-8a4f19f7.js';
|
|
29
|
+
import './Segment.js';
|
|
30
|
+
import './main-1450d277.js';
|
|
31
|
+
import './index-752d1dae.js';
|
|
32
|
+
import 'react-dom';
|
|
33
|
+
import './typeof-64422756.js';
|
|
34
|
+
import './_is-array-9383b394.js';
|
|
35
|
+
import './brightcove-react-player-loader.es-b43c695a.js';
|
|
36
|
+
import './GroupDeck.js';
|
|
37
|
+
import './smoothscroll-fa4e3f8c.js';
|
|
38
|
+
import './moment-bc12cb97.js';
|
|
39
|
+
import './toConsumableArray-5212fee7.js';
|
|
40
|
+
import 'react-bootstrap/Pagination';
|
|
41
|
+
import './entities-932b50cf.js';
|
|
42
|
+
import './AdSlot.js';
|
|
43
|
+
import './debounce-1a993acf.js';
|
|
44
|
+
import './isSymbol-807e927e.js';
|
|
45
|
+
import 'react-bootstrap/Row';
|
|
46
|
+
import 'next/head';
|
|
47
|
+
import './inherits-18d4a779.js';
|
|
48
|
+
import './_object-sap-6a003379.js';
|
|
49
|
+
import './define-property-9a008401.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 cache = { topic_ids: [] };
|
|
61
|
+
|
|
62
|
+
var VideoProgramLandingPage = function VideoProgramLandingPage(props) {
|
|
63
|
+
var client = props.client,
|
|
64
|
+
virtualBlock = props.virtualBlock,
|
|
65
|
+
topics = props.topics,
|
|
66
|
+
posts = props.posts,
|
|
67
|
+
query = props.query,
|
|
68
|
+
params = props.params,
|
|
69
|
+
_props$currentPage = props.currentPage,
|
|
70
|
+
currentPage = _props$currentPage === undefined ? 1 : _props$currentPage,
|
|
71
|
+
pageview = props.pageview,
|
|
72
|
+
_props$columns = props.columns,
|
|
73
|
+
columns = _props$columns === undefined ? 'rotate' : _props$columns,
|
|
74
|
+
_props$variant = props.variant,
|
|
75
|
+
variant = _props$variant === undefined ? 'top' : _props$variant,
|
|
76
|
+
_props$page = props.page,
|
|
77
|
+
page = _props$page === undefined ? '' : _props$page,
|
|
78
|
+
_props$autoScroll = props.autoScroll,
|
|
79
|
+
autoScroll = _props$autoScroll === undefined ? true : _props$autoScroll,
|
|
80
|
+
defaultImage = props.defaultImage,
|
|
81
|
+
mapping = props.mapping;
|
|
82
|
+
|
|
83
|
+
return React.createElement(
|
|
84
|
+
'div',
|
|
85
|
+
null,
|
|
86
|
+
virtualBlock && React.createElement(BlockContent, _extends({ serializers: getSerializers(client), blocks: virtualBlock.body, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config())),
|
|
87
|
+
React.createElement(
|
|
88
|
+
'div',
|
|
89
|
+
{ className: 'peer-exchange-filter-container' },
|
|
90
|
+
React.createElement(
|
|
91
|
+
Form,
|
|
92
|
+
{ className: 'ml-3', method: 'post' },
|
|
93
|
+
React.createElement(
|
|
94
|
+
Form.Row,
|
|
95
|
+
null,
|
|
96
|
+
React.createElement(
|
|
97
|
+
Col,
|
|
98
|
+
null,
|
|
99
|
+
React.createElement(
|
|
100
|
+
Form.Group,
|
|
101
|
+
{ controlId: 'topic' },
|
|
102
|
+
React.createElement(
|
|
103
|
+
Form.Control,
|
|
104
|
+
{ as: 'select', name: 'topic_id', placeholder: 'Filter by Topic' },
|
|
105
|
+
React.createElement(
|
|
106
|
+
'option',
|
|
107
|
+
{ value: '' },
|
|
108
|
+
'All Topics'
|
|
109
|
+
),
|
|
110
|
+
topics && topics.map(function (topic) {
|
|
111
|
+
if (props.topic_id === topic._id || topic.name == 'Peer Exchange') {
|
|
112
|
+
return null;
|
|
113
|
+
} else {
|
|
114
|
+
return React.createElement(
|
|
115
|
+
'option',
|
|
116
|
+
{ value: topic._id },
|
|
117
|
+
topic.name
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
})
|
|
121
|
+
)
|
|
122
|
+
)
|
|
123
|
+
),
|
|
124
|
+
React.createElement(
|
|
125
|
+
Col,
|
|
126
|
+
null,
|
|
127
|
+
React.createElement(
|
|
128
|
+
Button,
|
|
129
|
+
{ type: 'submit', variant: 'secondary' },
|
|
130
|
+
'Apply'
|
|
131
|
+
)
|
|
132
|
+
)
|
|
133
|
+
)
|
|
134
|
+
)
|
|
135
|
+
),
|
|
136
|
+
posts && React.createElement(VideoSeriesListing, {
|
|
137
|
+
client: client,
|
|
138
|
+
mapping: mapping,
|
|
139
|
+
dataRecord: posts,
|
|
140
|
+
query: query,
|
|
141
|
+
params: params,
|
|
142
|
+
currentPage: currentPage,
|
|
143
|
+
pageview: pageview,
|
|
144
|
+
columns: columns,
|
|
145
|
+
variant: variant,
|
|
146
|
+
page: page,
|
|
147
|
+
autoScroll: autoScroll,
|
|
148
|
+
defaultImage: defaultImage
|
|
149
|
+
})
|
|
150
|
+
);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
VideoProgramLandingPage.getInitialData = function () {
|
|
154
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(context, client) {
|
|
155
|
+
var itemsPerPage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 6;
|
|
156
|
+
var topicId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
157
|
+
var pathname, virtualBlock, query, taxonomy_ids_res, taxonomy_ids, i, res, j, topics, urlQuery, currentPage, start, params, posts;
|
|
158
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
159
|
+
while (1) {
|
|
160
|
+
switch (_context.prev = _context.next) {
|
|
161
|
+
case 0:
|
|
162
|
+
// Virtual Block
|
|
163
|
+
pathname = context.pathname;
|
|
164
|
+
_context.next = 3;
|
|
165
|
+
return client.fetch('*[_type == \'virtualBlock\' && identifier == \'' + pathname + '\'][0]');
|
|
166
|
+
|
|
167
|
+
case 3:
|
|
168
|
+
virtualBlock = _context.sent;
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
// Topics for filtering
|
|
172
|
+
query = '';
|
|
173
|
+
|
|
174
|
+
if (!(cache && cache.topic_ids && cache.topic_ids.length > 0)) {
|
|
175
|
+
_context.next = 8;
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
_context.next = 15;
|
|
180
|
+
break;
|
|
181
|
+
|
|
182
|
+
case 8:
|
|
183
|
+
query = '*[\n _type == \'article\' \n && !(_id in path("drafts.**")) \n && defined(title) \n && defined(url)\n && references(\'02c6c999-e6fe-4275-98ca-ceef28f91e14\') \n && is_visible == true \n && dateTime(published) <= dateTime(now())\n ]{\n \'taxonomy_id\': taxonomyMapping[]->_id\n }';
|
|
184
|
+
_context.next = 11;
|
|
185
|
+
return client.fetch(query);
|
|
186
|
+
|
|
187
|
+
case 11:
|
|
188
|
+
taxonomy_ids_res = _context.sent;
|
|
189
|
+
taxonomy_ids = [];
|
|
190
|
+
|
|
191
|
+
for (i = 0; i < taxonomy_ids_res.length; i++) {
|
|
192
|
+
res = taxonomy_ids_res[i];
|
|
193
|
+
|
|
194
|
+
for (j = 0; j < res.taxonomy_id.length; j++) {
|
|
195
|
+
if (!taxonomy_ids.includes(res.taxonomy_id[j])) {
|
|
196
|
+
taxonomy_ids.push(res.taxonomy_id[j]);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
cache.topic_ids = taxonomy_ids;
|
|
201
|
+
|
|
202
|
+
case 15:
|
|
203
|
+
query = '*[_type == \'taxonomy\' && _id in $taxonomy_ids] | order(name asc)';
|
|
204
|
+
_context.next = 18;
|
|
205
|
+
return client.fetch(query, { taxonomy_ids: cache.topic_ids });
|
|
206
|
+
|
|
207
|
+
case 18:
|
|
208
|
+
topics = _context.sent;
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
// Posts
|
|
212
|
+
urlQuery = context.query;
|
|
213
|
+
currentPage = urlQuery.page ? parseInt(urlQuery.page) : 1;
|
|
214
|
+
start = (currentPage - 1) * itemsPerPage;
|
|
215
|
+
params = {
|
|
216
|
+
from: start,
|
|
217
|
+
to: start + itemsPerPage,
|
|
218
|
+
url: pathname
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
query = '*[\n _type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible == true\n && dateTime(published) <= dateTime(now())\n && references(\'02c6c999-e6fe-4275-98ca-ceef28f91e14\')\n ' + (topicId ? '&& references(\'' + topicId + '\')' : '') + '\n ] | order(published desc) [$from...$to]{\n \t\t...,\n \t\ttitle,\n \t\tsummary,\n \t\tpublished,\n \t\tthumbnail,\n \t\turl,\n \t\ttaxonomy,\n \t\tcontentCategory->,\n \t\tbody[_type == "youtubeGallery"],\n \t\t\'pageNumber\': ' + currentPage + '\n \t}';
|
|
222
|
+
_context.next = 26;
|
|
223
|
+
return client.fetch(query, params);
|
|
224
|
+
|
|
225
|
+
case 26:
|
|
226
|
+
posts = _context.sent;
|
|
227
|
+
return _context.abrupt('return', { virtualBlock: virtualBlock, topics: topics, posts: posts, query: query, params: params, currentPage: currentPage });
|
|
228
|
+
|
|
229
|
+
case 28:
|
|
230
|
+
case 'end':
|
|
231
|
+
return _context.stop();
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}, _callee, _this);
|
|
235
|
+
}));
|
|
236
|
+
|
|
237
|
+
return function (_x, _x2) {
|
|
238
|
+
return _ref.apply(this, arguments);
|
|
239
|
+
};
|
|
240
|
+
}();
|
|
241
|
+
|
|
242
|
+
export default VideoProgramLandingPage;
|