@mjhls/mjh-framework 1.0.551 → 1.0.553
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/ADSkyscraper.js +114 -0
- package/dist/cjs/View.js +44 -5
- package/dist/cjs/getQuery.js +2 -2
- package/dist/cjs/index.js +2 -0
- package/dist/esm/ADSkyscraper.js +109 -0
- package/dist/esm/View.js +44 -5
- package/dist/esm/getQuery.js +2 -2
- package/dist/esm/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
4
|
+
|
|
5
|
+
require('./_commonjsHelpers-06173234.js');
|
|
6
|
+
require('./_to-object-329a650b.js');
|
|
7
|
+
require('./core.get-iterator-method-41e87ec1.js');
|
|
8
|
+
require('./_library-dd23b178.js');
|
|
9
|
+
require('./_iter-detect-4d0352f8.js');
|
|
10
|
+
require('./web.dom.iterable-43c3e277.js');
|
|
11
|
+
var React = require('react');
|
|
12
|
+
var React__default = _interopDefault(React);
|
|
13
|
+
require('./index-f7ee1612.js');
|
|
14
|
+
require('prop-types');
|
|
15
|
+
require('./isSymbol-488934a7.js');
|
|
16
|
+
require('./debounce-32e57002.js');
|
|
17
|
+
require('./main-bc4db521.js');
|
|
18
|
+
var slicedToArray = require('./slicedToArray-8063ee51.js');
|
|
19
|
+
require('./stringify-7c5aff47.js');
|
|
20
|
+
require('./asyncToGenerator-8e707718.js');
|
|
21
|
+
require('./_set-species-4458e975.js');
|
|
22
|
+
require('./beam-d22818d3.js');
|
|
23
|
+
var AdSlot = require('./AdSlot.js');
|
|
24
|
+
|
|
25
|
+
// Skyscraper is below sponsored resource ad in the left column.
|
|
26
|
+
var ADSkyscraper = function ADSkyscraper(_ref) {
|
|
27
|
+
var skyscraperAd = _ref.skyscraperAd,
|
|
28
|
+
_ref$minScreenWidth = _ref.minScreenWidth,
|
|
29
|
+
minScreenWidth = _ref$minScreenWidth === undefined ? 1200 : _ref$minScreenWidth;
|
|
30
|
+
|
|
31
|
+
// position is set to 'sky1' as default.
|
|
32
|
+
var className = skyscraperAd.className,
|
|
33
|
+
slotId = skyscraperAd.slotId,
|
|
34
|
+
adUnit = skyscraperAd.adUnit,
|
|
35
|
+
_skyscraperAd$targeti = skyscraperAd.targeting,
|
|
36
|
+
targeting = _skyscraperAd$targeti === undefined ? {} : _skyscraperAd$targeti,
|
|
37
|
+
_skyscraperAd$positio = skyscraperAd.position,
|
|
38
|
+
position = _skyscraperAd$positio === undefined ? 'sky1' : _skyscraperAd$positio,
|
|
39
|
+
networkID = skyscraperAd.networkID,
|
|
40
|
+
sizes = skyscraperAd.sizes;
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
var adTargeting = {
|
|
44
|
+
content_placement: targeting.content_placement,
|
|
45
|
+
tags: targeting.tags,
|
|
46
|
+
document_group: targeting.document_group,
|
|
47
|
+
document_url: targeting.document_url,
|
|
48
|
+
pos: position,
|
|
49
|
+
campaign_id: targeting.campaign_id,
|
|
50
|
+
issue_url: targeting.issue_url,
|
|
51
|
+
publication_url: targeting.publication_url
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var _useState = React.useState(false),
|
|
55
|
+
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
|
56
|
+
widthFlag = _useState2[0],
|
|
57
|
+
setWidthFlag = _useState2[1];
|
|
58
|
+
|
|
59
|
+
React.useEffect(function () {
|
|
60
|
+
// Setting flag to hide ad in screens < 1200px.
|
|
61
|
+
if (window && window.innerWidth >= minScreenWidth) {
|
|
62
|
+
setWidthFlag(true);
|
|
63
|
+
}
|
|
64
|
+
}, [minScreenWidth]);
|
|
65
|
+
|
|
66
|
+
// Function to collapse skyscrapper ad.
|
|
67
|
+
var collapseAd = function collapseAd() {
|
|
68
|
+
var parent = document.getElementById('skyscraper-ad-wrapper');
|
|
69
|
+
parent.style.height = '0%';
|
|
70
|
+
parent.style.width = '0%';
|
|
71
|
+
parent.style.display = 'none';
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// Function to check if the skyscrapper ad is available or not.
|
|
75
|
+
var checkIsAdFound = function checkIsAdFound(isFound) {
|
|
76
|
+
if (isFound) {
|
|
77
|
+
var parent = document.getElementById('skyscraper-ad-wrapper');
|
|
78
|
+
parent.style.display = 'block';
|
|
79
|
+
} else {
|
|
80
|
+
collapseAd();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
if (widthFlag) {
|
|
84
|
+
return React__default.createElement(
|
|
85
|
+
React__default.Fragment,
|
|
86
|
+
null,
|
|
87
|
+
React__default.createElement(
|
|
88
|
+
'div',
|
|
89
|
+
{ id: 'skyscraper-ad-wrapper', className: 'skyscraper-ad-wrapper' },
|
|
90
|
+
React__default.createElement(
|
|
91
|
+
'div',
|
|
92
|
+
{ className: 'skyscraper-ad' },
|
|
93
|
+
React__default.createElement(AdSlot, {
|
|
94
|
+
className: className,
|
|
95
|
+
slotId: slotId,
|
|
96
|
+
networkID: networkID,
|
|
97
|
+
sizes: sizes,
|
|
98
|
+
adUnit: adUnit,
|
|
99
|
+
targeting: adTargeting,
|
|
100
|
+
refreshFlag: false,
|
|
101
|
+
checkIsAdFound: checkIsAdFound
|
|
102
|
+
})
|
|
103
|
+
),
|
|
104
|
+
React__default.createElement(
|
|
105
|
+
'style',
|
|
106
|
+
{ jsx: 'true' },
|
|
107
|
+
'\n .skyscraper-ad-wrapper {\n margin-top: 20px;\n margin-bottom: 20px;\n }\n '
|
|
108
|
+
)
|
|
109
|
+
)
|
|
110
|
+
);
|
|
111
|
+
} else return null;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
module.exports = ADSkyscraper;
|
package/dist/cjs/View.js
CHANGED
|
@@ -40,7 +40,7 @@ var AdSlot = require('./AdSlot.js');
|
|
|
40
40
|
var BlockContent = require('./BlockContent-f942392e.js');
|
|
41
41
|
require('./smoothscroll-95231a70.js');
|
|
42
42
|
require('./GroupDeck.js');
|
|
43
|
-
require('react-bootstrap');
|
|
43
|
+
var reactBootstrap = require('react-bootstrap');
|
|
44
44
|
var Button = _interopDefault(require('react-bootstrap/Button'));
|
|
45
45
|
var getSerializers = require('./getSerializers.js');
|
|
46
46
|
require('./util-f2c1b65b.js');
|
|
@@ -62,6 +62,8 @@ var urlFor = require('./urlFor.js');
|
|
|
62
62
|
|
|
63
63
|
var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
64
64
|
var defaultUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'authors';
|
|
65
|
+
var biography = arguments[5];
|
|
66
|
+
var profileImage = arguments[6];
|
|
65
67
|
|
|
66
68
|
if (authorName && authorURL) {
|
|
67
69
|
return React__default.createElement(
|
|
@@ -69,9 +71,41 @@ var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
|
69
71
|
null,
|
|
70
72
|
React__default.createElement(
|
|
71
73
|
'a',
|
|
72
|
-
{ href: '/' + defaultUrl + '/' + authorURL.current, key: index },
|
|
74
|
+
{ className: 'author-details-link-' + index, href: '/' + defaultUrl + '/' + authorURL.current, key: index },
|
|
73
75
|
authorName
|
|
74
76
|
),
|
|
77
|
+
React__default.createElement(
|
|
78
|
+
reactBootstrap.Card,
|
|
79
|
+
{ className: 'author-details-card-' + index },
|
|
80
|
+
React__default.createElement(
|
|
81
|
+
reactBootstrap.Row,
|
|
82
|
+
null,
|
|
83
|
+
profileImage && React__default.createElement(
|
|
84
|
+
reactBootstrap.Col,
|
|
85
|
+
{ sm: 12, md: 4, className: 'author-details-img-container' },
|
|
86
|
+
React__default.createElement(reactBootstrap.Card.Img, { className: 'author-details-img', src: profileImage, alt: authorName })
|
|
87
|
+
),
|
|
88
|
+
React__default.createElement(
|
|
89
|
+
reactBootstrap.Col,
|
|
90
|
+
{ className: 'author-details-col', sm: 12, md: 8 },
|
|
91
|
+
React__default.createElement(
|
|
92
|
+
'h5',
|
|
93
|
+
null,
|
|
94
|
+
authorName
|
|
95
|
+
),
|
|
96
|
+
React__default.createElement(
|
|
97
|
+
'p',
|
|
98
|
+
null,
|
|
99
|
+
biography
|
|
100
|
+
)
|
|
101
|
+
)
|
|
102
|
+
)
|
|
103
|
+
),
|
|
104
|
+
React__default.createElement(
|
|
105
|
+
'style',
|
|
106
|
+
{ jsx: 'true' },
|
|
107
|
+
'\n .author-details-card-' + index + ' {\n display: none;\n position: absolute;\n width: 90%;\n max-width: 450px;\n max-height: 450px;\n z-index: 9999;\n }\n .author-details-card-' + index + ' h5 {\n font-weight: 500;\n }\n .author-details-link-' + index + ':hover + .author-details-card-' + index + ', .author-details-card-' + index + ':hover {\n display: block;\n box-shadow: 0px 0px 5px #aaa;\n padding: 15px;\n border-radius: 5px;\n }\n '
|
|
108
|
+
),
|
|
75
109
|
length !== index + 1 && ' , '
|
|
76
110
|
);
|
|
77
111
|
} else if (authorName) {
|
|
@@ -348,7 +382,12 @@ var Article = function Article(props) {
|
|
|
348
382
|
return false;
|
|
349
383
|
}
|
|
350
384
|
};
|
|
351
|
-
|
|
385
|
+
var renderAuthorBiography = function renderAuthorBiography(biography) {
|
|
386
|
+
return React__default.createElement(BlockContent.BlockContent, _extends._extends({
|
|
387
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag),
|
|
388
|
+
blocks: [biography]
|
|
389
|
+
}, client.config()));
|
|
390
|
+
};
|
|
352
391
|
var renderIsiContent = function renderIsiContent(article) {
|
|
353
392
|
var url = article.url.current;
|
|
354
393
|
|
|
@@ -683,7 +722,7 @@ var Article = function Article(props) {
|
|
|
683
722
|
React__default.createElement(
|
|
684
723
|
'style',
|
|
685
724
|
{ jsx: 'true' },
|
|
686
|
-
'\n @media screen and (max-width: 468px) {\n .video-detail .doc-group-container {\n flex-direction: column;\n align-items: flex-start !important;\n }\n .video-detail .doc-group {\n margin-top: 2rem;\n width: calc(100vw - 45px);\n align-items: center;\n }\n .video-detail .doc-group img,\n .doc-group p {\n max-width: calc(100vw - 45px) !important;\n }\n }\n '
|
|
725
|
+
'\n @media screen and (max-width: 468px) {\n .video-detail .doc-group-container {\n flex-direction: column;\n align-items: flex-start !important;\n }\n .video-detail .doc-group {\n margin-top: 2rem;\n width: calc(100vw - 45px);\n align-items: center;\n }\n .video-detail .doc-group img,\n .doc-group p {\n max-width: calc(100vw - 45px) !important;\n }\n }\n .author-details-img {\n margin-right: 10px;\n max-height: 250px;\n min-height: 150px;\n max-width: 250px;\n min-width: 150px;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n border: 1px solid #ccc;\n object-fit: contain;\n }\n .author-details-img-container {\n text-align: center;\n }\n .author-details-col {\n padding-left: 25px;\n }\n '
|
|
687
726
|
),
|
|
688
727
|
React__default.createElement(
|
|
689
728
|
'div',
|
|
@@ -702,7 +741,7 @@ var Article = function Article(props) {
|
|
|
702
741
|
return React__default.createElement(
|
|
703
742
|
'span',
|
|
704
743
|
{ key: index },
|
|
705
|
-
renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix)
|
|
744
|
+
renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix, authorDetail.biography && renderAuthorBiography(authorDetail.biography[0]), authorDetail.profileImage && urlFor(props.client, authorDetail.profileImage).url())
|
|
706
745
|
);
|
|
707
746
|
}),
|
|
708
747
|
React__default.createElement(
|
package/dist/cjs/getQuery.js
CHANGED
|
@@ -12,9 +12,9 @@ var getQuery = function getQuery(type) {
|
|
|
12
12
|
|
|
13
13
|
switch (type) {
|
|
14
14
|
case 'related':
|
|
15
|
-
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= now()\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[$index]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
|
|
15
|
+
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= now()\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[$index]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
|
|
16
16
|
case 'article':
|
|
17
|
-
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
|
|
17
|
+
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
|
|
18
18
|
case 'publication':
|
|
19
19
|
return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issues\': *[_type == \'publication\'\n && is_visible\n && references(^._id)\n && defined(identifier)] {\n ...,\n pdf{asset->}\n } | order(year desc, month desc)\n }';
|
|
20
20
|
case 'issue':
|
package/dist/cjs/index.js
CHANGED
|
@@ -121,6 +121,7 @@ var ADFooter = require('./ADFooter.js');
|
|
|
121
121
|
var AdSlotsProvider = require('./AdSlotsProvider.js');
|
|
122
122
|
var ADFloatingFooter = require('./ADFloatingFooter.js');
|
|
123
123
|
var ADWelcome = require('./ADWelcome.js');
|
|
124
|
+
var ADSkyscraper = require('./ADSkyscraper.js');
|
|
124
125
|
require('react-bootstrap/Carousel');
|
|
125
126
|
var Feature = require('./Feature.js');
|
|
126
127
|
require('react-bootstrap/Breadcrumb');
|
|
@@ -218,6 +219,7 @@ exports.ADFooter = ADFooter;
|
|
|
218
219
|
exports.AdSlotsProvider = AdSlotsProvider;
|
|
219
220
|
exports.ADFloatingFooter = ADFloatingFooter;
|
|
220
221
|
exports.ADWelcome = ADWelcome;
|
|
222
|
+
exports.ADSkyscraper = ADSkyscraper;
|
|
221
223
|
exports.Feature = Feature;
|
|
222
224
|
exports.Breadcrumbs = Breadcrumbs;
|
|
223
225
|
exports.Hero = Hero;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import './_commonjsHelpers-0c4b6f40.js';
|
|
2
|
+
import './_to-object-16fd8b46.js';
|
|
3
|
+
import './core.get-iterator-method-f5c0d66a.js';
|
|
4
|
+
import './_library-528f1934.js';
|
|
5
|
+
import './_iter-detect-6e099a34.js';
|
|
6
|
+
import './web.dom.iterable-46c95e52.js';
|
|
7
|
+
import React__default, { useState, useEffect } from 'react';
|
|
8
|
+
import './index-93ec3c59.js';
|
|
9
|
+
import 'prop-types';
|
|
10
|
+
import './isSymbol-b7b7434f.js';
|
|
11
|
+
import './debounce-048d9cb6.js';
|
|
12
|
+
import './main-7255814e.js';
|
|
13
|
+
import { _ as _slicedToArray } from './slicedToArray-f1e40361.js';
|
|
14
|
+
import './stringify-e30bc114.js';
|
|
15
|
+
import './asyncToGenerator-0379e924.js';
|
|
16
|
+
import './_set-species-6f64f1c1.js';
|
|
17
|
+
import './beam-a25bd8fd.js';
|
|
18
|
+
import DFPAdSlot from './AdSlot.js';
|
|
19
|
+
|
|
20
|
+
// Skyscraper is below sponsored resource ad in the left column.
|
|
21
|
+
var ADSkyscraper = function ADSkyscraper(_ref) {
|
|
22
|
+
var skyscraperAd = _ref.skyscraperAd,
|
|
23
|
+
_ref$minScreenWidth = _ref.minScreenWidth,
|
|
24
|
+
minScreenWidth = _ref$minScreenWidth === undefined ? 1200 : _ref$minScreenWidth;
|
|
25
|
+
|
|
26
|
+
// position is set to 'sky1' as default.
|
|
27
|
+
var className = skyscraperAd.className,
|
|
28
|
+
slotId = skyscraperAd.slotId,
|
|
29
|
+
adUnit = skyscraperAd.adUnit,
|
|
30
|
+
_skyscraperAd$targeti = skyscraperAd.targeting,
|
|
31
|
+
targeting = _skyscraperAd$targeti === undefined ? {} : _skyscraperAd$targeti,
|
|
32
|
+
_skyscraperAd$positio = skyscraperAd.position,
|
|
33
|
+
position = _skyscraperAd$positio === undefined ? 'sky1' : _skyscraperAd$positio,
|
|
34
|
+
networkID = skyscraperAd.networkID,
|
|
35
|
+
sizes = skyscraperAd.sizes;
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
var adTargeting = {
|
|
39
|
+
content_placement: targeting.content_placement,
|
|
40
|
+
tags: targeting.tags,
|
|
41
|
+
document_group: targeting.document_group,
|
|
42
|
+
document_url: targeting.document_url,
|
|
43
|
+
pos: position,
|
|
44
|
+
campaign_id: targeting.campaign_id,
|
|
45
|
+
issue_url: targeting.issue_url,
|
|
46
|
+
publication_url: targeting.publication_url
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var _useState = useState(false),
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
widthFlag = _useState2[0],
|
|
52
|
+
setWidthFlag = _useState2[1];
|
|
53
|
+
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
// Setting flag to hide ad in screens < 1200px.
|
|
56
|
+
if (window && window.innerWidth >= minScreenWidth) {
|
|
57
|
+
setWidthFlag(true);
|
|
58
|
+
}
|
|
59
|
+
}, [minScreenWidth]);
|
|
60
|
+
|
|
61
|
+
// Function to collapse skyscrapper ad.
|
|
62
|
+
var collapseAd = function collapseAd() {
|
|
63
|
+
var parent = document.getElementById('skyscraper-ad-wrapper');
|
|
64
|
+
parent.style.height = '0%';
|
|
65
|
+
parent.style.width = '0%';
|
|
66
|
+
parent.style.display = 'none';
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// Function to check if the skyscrapper ad is available or not.
|
|
70
|
+
var checkIsAdFound = function checkIsAdFound(isFound) {
|
|
71
|
+
if (isFound) {
|
|
72
|
+
var parent = document.getElementById('skyscraper-ad-wrapper');
|
|
73
|
+
parent.style.display = 'block';
|
|
74
|
+
} else {
|
|
75
|
+
collapseAd();
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
if (widthFlag) {
|
|
79
|
+
return React__default.createElement(
|
|
80
|
+
React__default.Fragment,
|
|
81
|
+
null,
|
|
82
|
+
React__default.createElement(
|
|
83
|
+
'div',
|
|
84
|
+
{ id: 'skyscraper-ad-wrapper', className: 'skyscraper-ad-wrapper' },
|
|
85
|
+
React__default.createElement(
|
|
86
|
+
'div',
|
|
87
|
+
{ className: 'skyscraper-ad' },
|
|
88
|
+
React__default.createElement(DFPAdSlot, {
|
|
89
|
+
className: className,
|
|
90
|
+
slotId: slotId,
|
|
91
|
+
networkID: networkID,
|
|
92
|
+
sizes: sizes,
|
|
93
|
+
adUnit: adUnit,
|
|
94
|
+
targeting: adTargeting,
|
|
95
|
+
refreshFlag: false,
|
|
96
|
+
checkIsAdFound: checkIsAdFound
|
|
97
|
+
})
|
|
98
|
+
),
|
|
99
|
+
React__default.createElement(
|
|
100
|
+
'style',
|
|
101
|
+
{ jsx: 'true' },
|
|
102
|
+
'\n .skyscraper-ad-wrapper {\n margin-top: 20px;\n margin-bottom: 20px;\n }\n '
|
|
103
|
+
)
|
|
104
|
+
)
|
|
105
|
+
);
|
|
106
|
+
} else return null;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export default ADSkyscraper;
|
package/dist/esm/View.js
CHANGED
|
@@ -34,7 +34,7 @@ import DFPAdSlot from './AdSlot.js';
|
|
|
34
34
|
import { B as BlockContent } from './BlockContent-a614acdf.js';
|
|
35
35
|
import './smoothscroll-4b699764.js';
|
|
36
36
|
import './GroupDeck.js';
|
|
37
|
-
import 'react-bootstrap';
|
|
37
|
+
import { Card, Row, Col } from 'react-bootstrap';
|
|
38
38
|
import Button from 'react-bootstrap/Button';
|
|
39
39
|
import getSerializers from './getSerializers.js';
|
|
40
40
|
import './util-7700fc59.js';
|
|
@@ -56,6 +56,8 @@ import urlFor from './urlFor.js';
|
|
|
56
56
|
|
|
57
57
|
var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
58
58
|
var defaultUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'authors';
|
|
59
|
+
var biography = arguments[5];
|
|
60
|
+
var profileImage = arguments[6];
|
|
59
61
|
|
|
60
62
|
if (authorName && authorURL) {
|
|
61
63
|
return React__default.createElement(
|
|
@@ -63,9 +65,41 @@ var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
|
63
65
|
null,
|
|
64
66
|
React__default.createElement(
|
|
65
67
|
'a',
|
|
66
|
-
{ href: '/' + defaultUrl + '/' + authorURL.current, key: index },
|
|
68
|
+
{ className: 'author-details-link-' + index, href: '/' + defaultUrl + '/' + authorURL.current, key: index },
|
|
67
69
|
authorName
|
|
68
70
|
),
|
|
71
|
+
React__default.createElement(
|
|
72
|
+
Card,
|
|
73
|
+
{ className: 'author-details-card-' + index },
|
|
74
|
+
React__default.createElement(
|
|
75
|
+
Row,
|
|
76
|
+
null,
|
|
77
|
+
profileImage && React__default.createElement(
|
|
78
|
+
Col,
|
|
79
|
+
{ sm: 12, md: 4, className: 'author-details-img-container' },
|
|
80
|
+
React__default.createElement(Card.Img, { className: 'author-details-img', src: profileImage, alt: authorName })
|
|
81
|
+
),
|
|
82
|
+
React__default.createElement(
|
|
83
|
+
Col,
|
|
84
|
+
{ className: 'author-details-col', sm: 12, md: 8 },
|
|
85
|
+
React__default.createElement(
|
|
86
|
+
'h5',
|
|
87
|
+
null,
|
|
88
|
+
authorName
|
|
89
|
+
),
|
|
90
|
+
React__default.createElement(
|
|
91
|
+
'p',
|
|
92
|
+
null,
|
|
93
|
+
biography
|
|
94
|
+
)
|
|
95
|
+
)
|
|
96
|
+
)
|
|
97
|
+
),
|
|
98
|
+
React__default.createElement(
|
|
99
|
+
'style',
|
|
100
|
+
{ jsx: 'true' },
|
|
101
|
+
'\n .author-details-card-' + index + ' {\n display: none;\n position: absolute;\n width: 90%;\n max-width: 450px;\n max-height: 450px;\n z-index: 9999;\n }\n .author-details-card-' + index + ' h5 {\n font-weight: 500;\n }\n .author-details-link-' + index + ':hover + .author-details-card-' + index + ', .author-details-card-' + index + ':hover {\n display: block;\n box-shadow: 0px 0px 5px #aaa;\n padding: 15px;\n border-radius: 5px;\n }\n '
|
|
102
|
+
),
|
|
69
103
|
length !== index + 1 && ' , '
|
|
70
104
|
);
|
|
71
105
|
} else if (authorName) {
|
|
@@ -342,7 +376,12 @@ var Article = function Article(props) {
|
|
|
342
376
|
return false;
|
|
343
377
|
}
|
|
344
378
|
};
|
|
345
|
-
|
|
379
|
+
var renderAuthorBiography = function renderAuthorBiography(biography) {
|
|
380
|
+
return React__default.createElement(BlockContent, _extends({
|
|
381
|
+
serializers: getSerializers(client, pageview, videoAccountIDs, onVote, true, drupalLeadSettings, currentPage, false, contextualADFlag),
|
|
382
|
+
blocks: [biography]
|
|
383
|
+
}, client.config()));
|
|
384
|
+
};
|
|
346
385
|
var renderIsiContent = function renderIsiContent(article) {
|
|
347
386
|
var url = article.url.current;
|
|
348
387
|
|
|
@@ -677,7 +716,7 @@ var Article = function Article(props) {
|
|
|
677
716
|
React__default.createElement(
|
|
678
717
|
'style',
|
|
679
718
|
{ jsx: 'true' },
|
|
680
|
-
'\n @media screen and (max-width: 468px) {\n .video-detail .doc-group-container {\n flex-direction: column;\n align-items: flex-start !important;\n }\n .video-detail .doc-group {\n margin-top: 2rem;\n width: calc(100vw - 45px);\n align-items: center;\n }\n .video-detail .doc-group img,\n .doc-group p {\n max-width: calc(100vw - 45px) !important;\n }\n }\n '
|
|
719
|
+
'\n @media screen and (max-width: 468px) {\n .video-detail .doc-group-container {\n flex-direction: column;\n align-items: flex-start !important;\n }\n .video-detail .doc-group {\n margin-top: 2rem;\n width: calc(100vw - 45px);\n align-items: center;\n }\n .video-detail .doc-group img,\n .doc-group p {\n max-width: calc(100vw - 45px) !important;\n }\n }\n .author-details-img {\n margin-right: 10px;\n max-height: 250px;\n min-height: 150px;\n max-width: 250px;\n min-width: 150px;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n border: 1px solid #ccc;\n object-fit: contain;\n }\n .author-details-img-container {\n text-align: center;\n }\n .author-details-col {\n padding-left: 25px;\n }\n '
|
|
681
720
|
),
|
|
682
721
|
React__default.createElement(
|
|
683
722
|
'div',
|
|
@@ -696,7 +735,7 @@ var Article = function Article(props) {
|
|
|
696
735
|
return React__default.createElement(
|
|
697
736
|
'span',
|
|
698
737
|
{ key: index },
|
|
699
|
-
renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix)
|
|
738
|
+
renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length, authorPrefix, authorDetail.biography && renderAuthorBiography(authorDetail.biography[0]), authorDetail.profileImage && urlFor(props.client, authorDetail.profileImage).url())
|
|
700
739
|
);
|
|
701
740
|
}),
|
|
702
741
|
React__default.createElement(
|
package/dist/esm/getQuery.js
CHANGED
|
@@ -10,9 +10,9 @@ var getQuery = function getQuery(type) {
|
|
|
10
10
|
|
|
11
11
|
switch (type) {
|
|
12
12
|
case 'related':
|
|
13
|
-
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= now()\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[$index]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
|
|
13
|
+
return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= now()\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[$index]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
|
|
14
14
|
case 'article':
|
|
15
|
-
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
|
|
15
|
+
return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
|
|
16
16
|
case 'publication':
|
|
17
17
|
return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issues\': *[_type == \'publication\'\n && is_visible\n && references(^._id)\n && defined(identifier)] {\n ...,\n pdf{asset->}\n } | order(year desc, month desc)\n }';
|
|
18
18
|
case 'issue':
|
package/dist/esm/index.js
CHANGED
|
@@ -117,6 +117,7 @@ export { default as ADFooter } from './ADFooter.js';
|
|
|
117
117
|
export { default as AdSlotsProvider } from './AdSlotsProvider.js';
|
|
118
118
|
export { default as ADFloatingFooter } from './ADFloatingFooter.js';
|
|
119
119
|
export { default as ADWelcome } from './ADWelcome.js';
|
|
120
|
+
export { default as ADSkyscraper } from './ADSkyscraper.js';
|
|
120
121
|
import 'react-bootstrap/Carousel';
|
|
121
122
|
export { default as Feature } from './Feature.js';
|
|
122
123
|
import 'react-bootstrap/Breadcrumb';
|