@mjhls/mjh-framework 1.0.692 → 1.0.694-beta.0
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/AD.js +1 -1
- package/dist/cjs/AD300x250.js +3 -3
- package/dist/cjs/AD300x250x600.js +3 -3
- package/dist/cjs/AD728x90.js +4 -4
- package/dist/cjs/ADFloatingFooter.js +2 -2
- package/dist/cjs/ADGutter.js +2 -2
- package/dist/cjs/ADSkyscraper.js +2 -2
- package/dist/cjs/ADSponsoredResources.js +2 -2
- package/dist/cjs/ADWebcast.js +2 -2
- package/dist/cjs/ADWelcome.js +2 -2
- package/dist/cjs/AdSlot.js +2 -2
- package/dist/cjs/AdSlotsProvider.js +1 -1
- package/dist/cjs/ArticleCarousel.js +1 -1
- package/dist/cjs/ArticleSeriesListing.js +4 -4
- package/dist/cjs/Auth.js +250 -301
- package/dist/cjs/{BlockContent-88f69acd.js → BlockContent-091a991f.js} +1 -1
- package/dist/cjs/BrowseVideosListing.js +1 -1
- package/dist/cjs/CMEDeck.js +5 -5
- package/dist/cjs/Column3.js +4 -4
- package/dist/cjs/ConferenceArticleCard.js +2 -2
- package/dist/cjs/DeckContent.js +7 -7
- package/dist/cjs/DeckQueue.js +6 -6
- package/dist/cjs/{Dfp-b2bc3b97.js → Dfp-f6a18ed2.js} +1 -1
- package/dist/cjs/EventsDeck.js +4 -4
- package/dist/cjs/ExternalResources.js +7 -7
- package/dist/cjs/Feature.js +3 -3
- package/dist/cjs/ForbesHero.js +2 -2
- package/dist/cjs/GridContent.js +10 -10
- package/dist/cjs/GridHero.js +2 -2
- package/dist/cjs/GroupDeck.js +1 -1
- package/dist/cjs/HamMagazine.js +4 -4
- package/dist/cjs/Hero.js +1 -1
- package/dist/cjs/HorizontalHero.js +2 -2
- package/dist/cjs/IssueContentDeck.js +2 -2
- package/dist/cjs/IssueDeck.js +2 -2
- package/dist/cjs/IssueLanding.js +7 -7
- package/dist/cjs/LeftNav.js +2 -2
- package/dist/cjs/MasterDeck.js +7 -7
- package/dist/cjs/NavMagazine.js +4 -4
- package/dist/cjs/NavNative.js +31 -24
- package/dist/cjs/OncliveHero.js +2 -2
- package/dist/cjs/OncliveLargeHero.js +2 -2
- package/dist/cjs/PartnerDetailListing.js +16 -16
- package/dist/cjs/PublicationDeck.js +1 -1
- package/dist/cjs/QueueDeckExpanded.js +9 -9
- package/dist/cjs/RecentNews.js +2 -2
- package/dist/cjs/RelatedContent.js +2 -2
- package/dist/cjs/{SocialSearchComponent-6b5e5b47.js → SocialSearchComponent-9cd24578.js} +5 -5
- package/dist/cjs/TaxonomyCard.js +2 -2
- package/dist/cjs/TemplateNormal.js +3 -3
- package/dist/cjs/ThumbnailCard.js +1 -1
- package/dist/cjs/Ustream.js +2 -2
- package/dist/cjs/VerticalHero.js +2 -2
- package/dist/cjs/VideoSeriesCard.js +2 -2
- package/dist/cjs/VideoSeriesListing.js +4 -4
- package/dist/cjs/View.js +174 -213
- package/dist/cjs/YahooHero.js +2 -2
- package/dist/cjs/YoutubeGroup.js +1 -1
- package/dist/cjs/getQuery.js +2 -2
- package/dist/cjs/getRelatedArticle.js +119 -153
- package/dist/cjs/getSerializers.js +6 -6
- package/dist/cjs/{getTargeting-fee8c429.js → getTargeting-9af0ef69.js} +2 -2
- package/dist/cjs/getTargeting.js +1 -1
- package/dist/cjs/{index-5be2866f.js → index-3294d3bc.js} +1 -1
- package/dist/cjs/{index-59436c13.js → index-a5919bab.js} +462 -474
- package/dist/cjs/{index-b5eb3ff8.js → index-be0c82be.js} +19 -20
- package/dist/cjs/{index-2d0a4911.js → index-fa8ed292.js} +27 -34
- package/dist/cjs/{index.es-ab3f2690.js → index.es-9110add6.js} +1 -3
- package/dist/cjs/index.js +12 -12
- package/dist/cjs/{main-b6c96c8d.js → main-a4cb15bb.js} +36 -67
- package/dist/cjs/{moment-66a6a284.js → moment-575fe24c.js} +1 -1
- package/dist/cjs/timeDifferenceCalc.js +1 -1
- package/dist/cjs/urlFor.js +1 -1
- package/dist/esm/AD.js +1 -1
- package/dist/esm/AD300x250.js +3 -3
- package/dist/esm/AD300x250x600.js +3 -3
- package/dist/esm/AD728x90.js +4 -4
- package/dist/esm/ADFloatingFooter.js +2 -2
- package/dist/esm/ADGutter.js +2 -2
- package/dist/esm/ADSkyscraper.js +2 -2
- package/dist/esm/ADSponsoredResources.js +2 -2
- package/dist/esm/ADWebcast.js +2 -2
- package/dist/esm/ADWelcome.js +2 -2
- package/dist/esm/AdSlot.js +2 -2
- package/dist/esm/AdSlotsProvider.js +1 -1
- package/dist/esm/ArticleCarousel.js +1 -1
- package/dist/esm/ArticleSeriesListing.js +4 -4
- package/dist/esm/Auth.js +247 -298
- package/dist/esm/{BlockContent-a614acdf.js → BlockContent-e9b4ddcf.js} +1 -1
- package/dist/esm/BrowseVideosListing.js +1 -1
- package/dist/esm/CMEDeck.js +5 -5
- package/dist/esm/Column3.js +4 -4
- package/dist/esm/ConferenceArticleCard.js +2 -2
- package/dist/esm/DeckContent.js +7 -7
- package/dist/esm/DeckQueue.js +6 -6
- package/dist/esm/{Dfp-8a8fca18.js → Dfp-96b49def.js} +1 -1
- package/dist/esm/EventsDeck.js +4 -4
- package/dist/esm/ExternalResources.js +7 -7
- package/dist/esm/Feature.js +3 -3
- package/dist/esm/ForbesHero.js +2 -2
- package/dist/esm/GridContent.js +10 -10
- package/dist/esm/GridHero.js +2 -2
- package/dist/esm/GroupDeck.js +1 -1
- package/dist/esm/HamMagazine.js +4 -4
- package/dist/esm/Hero.js +1 -1
- package/dist/esm/HorizontalHero.js +2 -2
- package/dist/esm/IssueContentDeck.js +2 -2
- package/dist/esm/IssueDeck.js +2 -2
- package/dist/esm/IssueLanding.js +7 -7
- package/dist/esm/LeftNav.js +2 -2
- package/dist/esm/MasterDeck.js +7 -7
- package/dist/esm/NavMagazine.js +4 -4
- package/dist/esm/NavNative.js +31 -24
- package/dist/esm/OncliveHero.js +2 -2
- package/dist/esm/OncliveLargeHero.js +2 -2
- package/dist/esm/PartnerDetailListing.js +14 -14
- package/dist/esm/PublicationDeck.js +1 -1
- package/dist/esm/QueueDeckExpanded.js +9 -9
- package/dist/esm/RecentNews.js +2 -2
- package/dist/esm/RelatedContent.js +2 -2
- package/dist/esm/{SocialSearchComponent-7f14e0f3.js → SocialSearchComponent-93233334.js} +5 -5
- package/dist/esm/TaxonomyCard.js +2 -2
- package/dist/esm/TemplateNormal.js +3 -3
- package/dist/esm/ThumbnailCard.js +1 -1
- package/dist/esm/Ustream.js +2 -2
- package/dist/esm/VerticalHero.js +2 -2
- package/dist/esm/VideoSeriesCard.js +2 -2
- package/dist/esm/VideoSeriesListing.js +4 -4
- package/dist/esm/View.js +149 -188
- package/dist/esm/YahooHero.js +2 -2
- package/dist/esm/YoutubeGroup.js +1 -1
- package/dist/esm/getQuery.js +2 -2
- package/dist/esm/getRelatedArticle.js +119 -153
- package/dist/esm/getSerializers.js +6 -6
- package/dist/esm/{index-93ec3c59.js → index-0e45a0b2.js} +27 -34
- package/dist/esm/{index-51a80699.js → index-73819142.js} +19 -20
- package/dist/esm/{index-a2e78632.js → index-c376cd8e.js} +462 -474
- package/dist/esm/{index-d2f90501.js → index-ef6d5dcf.js} +1 -1
- package/dist/esm/{index.es-938a3a58.js → index.es-29c1cef5.js} +1 -3
- package/dist/esm/index.js +11 -11
- package/dist/esm/{main-0465b2a0.js → main-5d1e4bd3.js} +34 -65
- package/dist/esm/{moment-12415288.js → moment-e2f9b20c.js} +1 -1
- package/dist/esm/timeDifferenceCalc.js +1 -1
- package/dist/esm/urlFor.js +1 -1
- package/package.json +1 -1
- /package/dist/cjs/{ADInfeed-3410ab3c.js → ADInfeed-2fe7211c.js} +0 -0
- /package/dist/cjs/{ADlgInfeed-845aac15.js → ADlgInfeed-14e17b43.js} +0 -0
- /package/dist/esm/{ADInfeed-205cb7a9.js → ADInfeed-eae71d07.js} +0 -0
- /package/dist/esm/{ADlgInfeed-e538f17a.js → ADlgInfeed-c619fe64.js} +0 -0
package/dist/cjs/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 && defined(published) \n && dateTime(published) <= dateTime(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)[' + (articleCount ? articleCount : '$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 documentGroupMapping[]-> {\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 && defined(published) \n && dateTime(published) <= dateTime(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)[' + (articleCount ? articleCount : '$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 _id,\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 documentGroupMapping[]-> {\n _id,\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, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n } \n },\n articles[]{\n ...,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\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 documentGroupMapping[]-> {\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 medias[]{\n ...,\n upload_doc {\n _type,\n asset-> \n } \n },\n articles[]{\n ...,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n text[]{\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n }\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 documentGroupMapping[]-> {\n _id,\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':
|
|
@@ -32,18 +32,9 @@ function parseString(setCookieValue, options) {
|
|
|
32
32
|
? Object.assign({}, defaultParseOptions, options)
|
|
33
33
|
: defaultParseOptions;
|
|
34
34
|
|
|
35
|
-
try {
|
|
36
|
-
value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value
|
|
37
|
-
} catch (e) {
|
|
38
|
-
console.error(
|
|
39
|
-
`set-cookie-parser encountered an error while decoding a cookie with value '${value}'. Set options.decodeValues to false to disable this feature.`,
|
|
40
|
-
e
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
35
|
var cookie = {
|
|
45
36
|
name: name, // grab everything before the first =
|
|
46
|
-
value: value,
|
|
37
|
+
value: options.decodeValues ? decodeURIComponent(value) : value, // decode cookie value
|
|
47
38
|
};
|
|
48
39
|
|
|
49
40
|
parts.forEach(function (part) {
|
|
@@ -214,7 +205,7 @@ setCookie.parse = parse_1;
|
|
|
214
205
|
setCookie.parseString = parseString_1;
|
|
215
206
|
setCookie.splitCookiesString = splitCookiesString_1;
|
|
216
207
|
|
|
217
|
-
var
|
|
208
|
+
var dist = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
218
209
|
var __assign = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__assign) || function () {
|
|
219
210
|
__assign = Object.assign || function(t) {
|
|
220
211
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -227,33 +218,10 @@ var __assign = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlob
|
|
|
227
218
|
return __assign.apply(this, arguments);
|
|
228
219
|
};
|
|
229
220
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
230
|
-
exports.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
function isBrowser() {
|
|
235
|
-
return typeof window !== 'undefined';
|
|
236
|
-
}
|
|
237
|
-
exports.isBrowser = isBrowser;
|
|
238
|
-
/**
|
|
239
|
-
* Create an instance of the Cookie interface
|
|
240
|
-
*/
|
|
241
|
-
function createCookie(name, value, options) {
|
|
242
|
-
var sameSite = options.sameSite;
|
|
243
|
-
if (sameSite === true) {
|
|
244
|
-
sameSite = 'strict';
|
|
245
|
-
}
|
|
246
|
-
if (sameSite === undefined || sameSite === false) {
|
|
247
|
-
sameSite = 'lax';
|
|
248
|
-
}
|
|
249
|
-
var cookieToSet = __assign(__assign({}, options), { sameSite: sameSite });
|
|
250
|
-
delete cookieToSet.encode;
|
|
251
|
-
return __assign({ name: name, value: value }, cookieToSet);
|
|
252
|
-
}
|
|
253
|
-
exports.createCookie = createCookie;
|
|
254
|
-
/**
|
|
255
|
-
* Tells whether given objects have the same properties.
|
|
256
|
-
*/
|
|
221
|
+
exports.destroyCookie = exports.setCookie = exports.parseCookies = void 0;
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
var isBrowser = function () { return typeof window !== 'undefined'; };
|
|
257
225
|
function hasSameProperties(a, b) {
|
|
258
226
|
var aProps = Object.getOwnPropertyNames(a);
|
|
259
227
|
var bProps = Object.getOwnPropertyNames(b);
|
|
@@ -268,9 +236,8 @@ function hasSameProperties(a, b) {
|
|
|
268
236
|
}
|
|
269
237
|
return true;
|
|
270
238
|
}
|
|
271
|
-
exports.hasSameProperties = hasSameProperties;
|
|
272
239
|
/**
|
|
273
|
-
* Compare the cookie and return true if the cookies
|
|
240
|
+
* Compare the cookie and return true if the cookies has equivalent
|
|
274
241
|
* options and the cookies would be overwritten in the browser storage.
|
|
275
242
|
*
|
|
276
243
|
* @param a first Cookie for comparison
|
|
@@ -283,109 +250,71 @@ function areCookiesEqual(a, b) {
|
|
|
283
250
|
}
|
|
284
251
|
return (hasSameProperties(__assign(__assign({}, a), { sameSite: undefined }), __assign(__assign({}, b), { sameSite: undefined })) && sameSiteSame);
|
|
285
252
|
}
|
|
286
|
-
exports.areCookiesEqual = areCookiesEqual;
|
|
287
|
-
/* Functions */
|
|
288
|
-
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
_commonjsHelpers.unwrapExports(utils);
|
|
292
|
-
var utils_1 = utils.areCookiesEqual;
|
|
293
|
-
var utils_2 = utils.hasSameProperties;
|
|
294
|
-
var utils_3 = utils.createCookie;
|
|
295
|
-
var utils_4 = utils.isBrowser;
|
|
296
|
-
|
|
297
|
-
var dist = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
298
|
-
var __assign = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__assign) || function () {
|
|
299
|
-
__assign = Object.assign || function(t) {
|
|
300
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
301
|
-
s = arguments[i];
|
|
302
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
303
|
-
t[p] = s[p];
|
|
304
|
-
}
|
|
305
|
-
return t;
|
|
306
|
-
};
|
|
307
|
-
return __assign.apply(this, arguments);
|
|
308
|
-
};
|
|
309
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
310
|
-
exports.destroyCookie = exports.setCookie = exports.parseCookies = void 0;
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
253
|
/**
|
|
254
|
+
* Create an instance of the Cookie interface
|
|
255
|
+
*
|
|
256
|
+
* @param name name of the Cookie
|
|
257
|
+
* @param value value of the Cookie
|
|
258
|
+
* @param options Cookie options
|
|
259
|
+
*/
|
|
260
|
+
function createCookie(name, value, options) {
|
|
261
|
+
var sameSite = options.sameSite;
|
|
262
|
+
if (sameSite === true) {
|
|
263
|
+
sameSite = 'strict';
|
|
264
|
+
}
|
|
265
|
+
if (sameSite === undefined || sameSite === false) {
|
|
266
|
+
sameSite = 'lax';
|
|
267
|
+
}
|
|
268
|
+
var cookieToSet = __assign(__assign({}, options), { sameSite: sameSite });
|
|
269
|
+
delete cookieToSet.encode;
|
|
270
|
+
return __assign({ name: name, value: value }, cookieToSet);
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
*
|
|
315
274
|
* Parses cookies.
|
|
316
275
|
*
|
|
317
|
-
* @param ctx
|
|
318
|
-
* @param options
|
|
276
|
+
* @param ctx
|
|
277
|
+
* @param options
|
|
319
278
|
*/
|
|
320
279
|
function parseCookies(ctx, options) {
|
|
321
|
-
|
|
322
|
-
if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.req) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b.cookie) {
|
|
280
|
+
if (ctx && ctx.req && ctx.req.headers && ctx.req.headers.cookie) {
|
|
323
281
|
return index$4.cookie.parse(ctx.req.headers.cookie, options);
|
|
324
282
|
}
|
|
325
|
-
if (
|
|
283
|
+
if (isBrowser()) {
|
|
326
284
|
return index$4.cookie.parse(document.cookie, options);
|
|
327
285
|
}
|
|
328
286
|
return {};
|
|
329
287
|
}
|
|
330
288
|
exports.parseCookies = parseCookies;
|
|
331
289
|
/**
|
|
290
|
+
*
|
|
332
291
|
* Sets a cookie.
|
|
333
292
|
*
|
|
334
|
-
* @param ctx
|
|
335
|
-
* @param name
|
|
336
|
-
* @param value
|
|
337
|
-
* @param options
|
|
293
|
+
* @param ctx
|
|
294
|
+
* @param name
|
|
295
|
+
* @param value
|
|
296
|
+
* @param options
|
|
338
297
|
*/
|
|
339
298
|
function setCookie$1(ctx, name, value, options) {
|
|
340
|
-
|
|
341
|
-
if (options === void 0) { options = {}; }
|
|
342
|
-
// SSR
|
|
343
|
-
if (((_a = ctx === null || ctx === void 0 ? void 0 : ctx.res) === null || _a === void 0 ? void 0 : _a.getHeader) && ctx.res.setHeader) {
|
|
344
|
-
// Check if response has finished and warn about it.
|
|
345
|
-
if ((_b = ctx === null || ctx === void 0 ? void 0 : ctx.res) === null || _b === void 0 ? void 0 : _b.finished) {
|
|
346
|
-
console.warn("Not setting \"" + name + "\" cookie. Response has finished.");
|
|
347
|
-
console.warn("You should set cookie before res.send()");
|
|
348
|
-
return {};
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Load existing cookies from the header and parse them.
|
|
352
|
-
*/
|
|
299
|
+
if (ctx && ctx.res && ctx.res.getHeader && ctx.res.setHeader) {
|
|
353
300
|
var cookies = ctx.res.getHeader('Set-Cookie') || [];
|
|
354
301
|
if (typeof cookies === 'string')
|
|
355
302
|
cookies = [cookies];
|
|
356
303
|
if (typeof cookies === 'number')
|
|
357
304
|
cookies = [];
|
|
358
|
-
|
|
359
|
-
* Parse cookies but ignore values - we've already encoded
|
|
360
|
-
* them in the previous call.
|
|
361
|
-
*/
|
|
362
|
-
var parsedCookies = setCookie.parse(cookies, {
|
|
363
|
-
decodeValues: false,
|
|
364
|
-
});
|
|
365
|
-
/**
|
|
366
|
-
* We create the new cookie and make sure that none of
|
|
367
|
-
* the existing cookies match it.
|
|
368
|
-
*/
|
|
369
|
-
var newCookie_1 = utils.createCookie(name, value, options);
|
|
305
|
+
var parsedCookies = setCookie.parse(cookies);
|
|
370
306
|
var cookiesToSet_1 = [];
|
|
371
307
|
parsedCookies.forEach(function (parsedCookie) {
|
|
372
|
-
if (!
|
|
373
|
-
|
|
374
|
-
* We serialize the cookie back to the original format
|
|
375
|
-
* if it isn't the same as the new one.
|
|
376
|
-
*/
|
|
377
|
-
var serializedCookie = index$4.cookie.serialize(parsedCookie.name, parsedCookie.value, __assign({
|
|
378
|
-
// we prevent reencoding by default, but you might override it
|
|
379
|
-
encode: function (val) { return val; } }, parsedCookie));
|
|
380
|
-
cookiesToSet_1.push(serializedCookie);
|
|
308
|
+
if (!areCookiesEqual(parsedCookie, createCookie(name, value, options))) {
|
|
309
|
+
cookiesToSet_1.push(index$4.cookie.serialize(parsedCookie.name, parsedCookie.value, __assign({}, parsedCookie)));
|
|
381
310
|
}
|
|
382
311
|
});
|
|
383
312
|
cookiesToSet_1.push(index$4.cookie.serialize(name, value, options));
|
|
384
|
-
|
|
385
|
-
|
|
313
|
+
if (!ctx.res.finished) {
|
|
314
|
+
ctx.res.setHeader('Set-Cookie', cookiesToSet_1);
|
|
315
|
+
}
|
|
386
316
|
}
|
|
387
|
-
|
|
388
|
-
if (utils.isBrowser()) {
|
|
317
|
+
if (isBrowser()) {
|
|
389
318
|
if (options && options.httpOnly) {
|
|
390
319
|
throw new Error('Can not set a httpOnly cookie in the browser.');
|
|
391
320
|
}
|
|
@@ -395,21 +324,30 @@ function setCookie$1(ctx, name, value, options) {
|
|
|
395
324
|
}
|
|
396
325
|
exports.setCookie = setCookie$1;
|
|
397
326
|
/**
|
|
327
|
+
*
|
|
398
328
|
* Destroys a cookie with a particular name.
|
|
399
329
|
*
|
|
400
|
-
* @param ctx
|
|
401
|
-
* @param name
|
|
402
|
-
* @param options
|
|
330
|
+
* @param ctx
|
|
331
|
+
* @param name
|
|
332
|
+
* @param options
|
|
403
333
|
*/
|
|
404
334
|
function destroyCookie(ctx, name, options) {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
335
|
+
var opts = __assign(__assign({}, (options || {})), { maxAge: -1 });
|
|
336
|
+
if (ctx && ctx.res && ctx.res.setHeader && ctx.res.getHeader) {
|
|
337
|
+
var cookies = ctx.res.getHeader('Set-Cookie') || [];
|
|
338
|
+
if (typeof cookies === 'string')
|
|
339
|
+
cookies = [cookies];
|
|
340
|
+
if (typeof cookies === 'number')
|
|
341
|
+
cookies = [];
|
|
342
|
+
cookies.push(index$4.cookie.serialize(name, '', opts));
|
|
343
|
+
ctx.res.setHeader('Set-Cookie', cookies);
|
|
344
|
+
}
|
|
345
|
+
if (isBrowser()) {
|
|
346
|
+
document.cookie = index$4.cookie.serialize(name, '', opts);
|
|
347
|
+
}
|
|
348
|
+
return {};
|
|
410
349
|
}
|
|
411
350
|
exports.destroyCookie = destroyCookie;
|
|
412
|
-
/* Utility Exports */
|
|
413
351
|
exports.default = {
|
|
414
352
|
set: setCookie$1,
|
|
415
353
|
get: parseCookies,
|
|
@@ -426,28 +364,33 @@ var dist_3 = dist.parseCookies;
|
|
|
426
364
|
var _this = undefined;
|
|
427
365
|
|
|
428
366
|
var getRelatedArticle = function () {
|
|
429
|
-
var
|
|
367
|
+
var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
|
|
430
368
|
var ctx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
431
369
|
var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
432
370
|
var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
433
371
|
var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
|
|
434
372
|
var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
435
373
|
|
|
436
|
-
var
|
|
374
|
+
var _article$url, url, documentGroupMapping, issueGroup, content_placement, references, params, conditions, cookies, prevSlugs, articles, query;
|
|
437
375
|
|
|
438
376
|
return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
|
|
439
377
|
while (1) {
|
|
440
378
|
switch (_context.prev = _context.next) {
|
|
441
379
|
case 0:
|
|
442
|
-
|
|
380
|
+
_article$url = article.url;
|
|
443
381
|
_article$url = _article$url === undefined ? {
|
|
444
382
|
current: null
|
|
445
383
|
} : _article$url;
|
|
446
|
-
url = _article$url.current,
|
|
447
|
-
|
|
448
|
-
|
|
384
|
+
url = _article$url.current, documentGroupMapping = article.documentGroupMapping, issueGroup = article.issueGroup;
|
|
385
|
+
content_placement = article.content_placement;
|
|
386
|
+
references = [];
|
|
387
|
+
|
|
449
388
|
|
|
450
|
-
|
|
389
|
+
content_placement = content_placement && content_placement.length > 0 && content_placement.filter(function (_ref2) {
|
|
390
|
+
var identifier = _ref2.identifier;
|
|
391
|
+
return identifier !== 'news';
|
|
392
|
+
});
|
|
393
|
+
if (content_placement && content_placement.length > 0) {
|
|
451
394
|
content_placement.forEach(function (_ref3) {
|
|
452
395
|
var path = _ref3.path,
|
|
453
396
|
_id = _ref3._id;
|
|
@@ -459,26 +402,30 @@ var getRelatedArticle = function () {
|
|
|
459
402
|
if (prev_url_to_check.includes('?')) {
|
|
460
403
|
prev_url_to_check = prev_url_to_check.split('?')[0];
|
|
461
404
|
}
|
|
462
|
-
if (prev_url_to_check.endsWith(path) && _id)
|
|
405
|
+
if (prev_url_to_check.endsWith(path) && _id) references.push(_id);
|
|
463
406
|
});
|
|
407
|
+
if (references.length === 0) {
|
|
408
|
+
content_placement.forEach(function (_ref4) {
|
|
409
|
+
var _id = _ref4._id;
|
|
410
|
+
|
|
411
|
+
if (_id) references.push(_id);
|
|
412
|
+
});
|
|
413
|
+
}
|
|
464
414
|
}
|
|
465
415
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
var _ref = _ref4._ref;
|
|
416
|
+
if (documentGroupMapping && documentGroupMapping.length > 0) {
|
|
417
|
+
documentGroupMapping.forEach(function (_ref5) {
|
|
418
|
+
var _id = _ref5._id;
|
|
470
419
|
|
|
471
|
-
if (
|
|
472
|
-
taxonomy.push(_ref);
|
|
473
|
-
}
|
|
420
|
+
if (_id) references.push(_id);
|
|
474
421
|
});
|
|
475
422
|
}
|
|
476
423
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
};
|
|
424
|
+
if (issueGroup && issueGroup._ref) {
|
|
425
|
+
references.push(issueGroup._ref);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
params = { url: url, references: references, index: articleCount };
|
|
482
429
|
conditions = '';
|
|
483
430
|
|
|
484
431
|
if (ctx && url) {
|
|
@@ -490,24 +437,43 @@ var getRelatedArticle = function () {
|
|
|
490
437
|
conditions = '&& !(url.current in [' + prevSlugs + '])';
|
|
491
438
|
} else dist_2(ctx, 'prevSlugs', '"' + url + '"', {});
|
|
492
439
|
}
|
|
493
|
-
relatedArticleQuery = getQuery('related', conditions, '', articleCount);
|
|
494
|
-
_context.next = 12;
|
|
495
|
-
return client.fetch(relatedArticleQuery, params);
|
|
496
440
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
441
|
+
articles = null;
|
|
442
|
+
|
|
443
|
+
if (!(params.references && params.references.length > 0)) {
|
|
444
|
+
_context.next = 24;
|
|
445
|
+
break;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
query = getQuery('related', conditions, '', articleCount).replace('&& taxonomyMapping[]._ref in $taxonomy', '&& references($references)');
|
|
449
|
+
_context.prev = 15;
|
|
450
|
+
_context.next = 18;
|
|
451
|
+
return client.fetch(query, params);
|
|
452
|
+
|
|
453
|
+
case 18:
|
|
454
|
+
articles = _context.sent;
|
|
455
|
+
_context.next = 24;
|
|
456
|
+
break;
|
|
457
|
+
|
|
458
|
+
case 21:
|
|
459
|
+
_context.prev = 21;
|
|
460
|
+
_context.t0 = _context['catch'](15);
|
|
461
|
+
|
|
462
|
+
console.error(_context.t0);
|
|
463
|
+
|
|
464
|
+
case 24:
|
|
465
|
+
return _context.abrupt('return', articles);
|
|
500
466
|
|
|
501
|
-
case
|
|
467
|
+
case 25:
|
|
502
468
|
case 'end':
|
|
503
469
|
return _context.stop();
|
|
504
470
|
}
|
|
505
471
|
}
|
|
506
|
-
}, _callee, _this);
|
|
472
|
+
}, _callee, _this, [[15, 21]]);
|
|
507
473
|
}));
|
|
508
474
|
|
|
509
475
|
return function getRelatedArticle() {
|
|
510
|
-
return
|
|
476
|
+
return _ref.apply(this, arguments);
|
|
511
477
|
};
|
|
512
478
|
}();
|
|
513
479
|
|
|
@@ -16,18 +16,18 @@ require('./web.dom.iterable-a0e279c1.js');
|
|
|
16
16
|
require('./typeof-725500bc.js');
|
|
17
17
|
require('./_is-array-754e012d.js');
|
|
18
18
|
require('react');
|
|
19
|
-
require('./index-
|
|
19
|
+
require('./index-fa8ed292.js');
|
|
20
20
|
require('prop-types');
|
|
21
21
|
require('react-bootstrap/Row');
|
|
22
22
|
require('react-bootstrap/Col');
|
|
23
|
-
require('./moment-
|
|
23
|
+
require('./moment-575fe24c.js');
|
|
24
24
|
require('next/router');
|
|
25
25
|
require('./isSymbol-04666465.js');
|
|
26
26
|
require('./debounce-eb287781.js');
|
|
27
27
|
require('react-dom');
|
|
28
|
-
require('./index-
|
|
28
|
+
require('./index-be0c82be.js');
|
|
29
29
|
require('./index-da796b8c.js');
|
|
30
|
-
require('./main-
|
|
30
|
+
require('./main-a4cb15bb.js');
|
|
31
31
|
require('./entities-310b46ee.js');
|
|
32
32
|
require('./stringify-7c5aff47.js');
|
|
33
33
|
require('./slicedToArray-8f385299.js');
|
|
@@ -36,14 +36,14 @@ require('./_set-species-f92c67c5.js');
|
|
|
36
36
|
require('./Segment.js');
|
|
37
37
|
require('./Beam.js');
|
|
38
38
|
require('./AdSlot.js');
|
|
39
|
-
require('./BlockContent-
|
|
39
|
+
require('./BlockContent-091a991f.js');
|
|
40
40
|
require('./smoothscroll-95231a70.js');
|
|
41
41
|
require('./GroupDeck.js');
|
|
42
42
|
require('react-bootstrap');
|
|
43
43
|
require('./iconBase-68959171.js');
|
|
44
44
|
require('./index.esm-90433435.js');
|
|
45
45
|
require('react-bootstrap/Button');
|
|
46
|
-
var getSerializers = require('./index-
|
|
46
|
+
var getSerializers = require('./index-a5919bab.js');
|
|
47
47
|
require('./util-f2c1b65b.js');
|
|
48
48
|
require('./brightcove-react-player-loader.es-156bd4d6.js');
|
|
49
49
|
require('react-bootstrap/Pagination');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var toConsumableArray = require('./toConsumableArray-9a3476fe.js');
|
|
4
|
-
var _extends = require('./extends-60837c34.js');
|
|
4
|
+
var _extends$1 = require('./extends-60837c34.js');
|
|
5
5
|
|
|
6
6
|
var getContentPlacementUrl = function getContentPlacementUrl(cp) {
|
|
7
7
|
var cp_url = '';
|
|
@@ -133,7 +133,7 @@ var getTargeting = function getTargeting(props) {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
if (props.cache && props.cache.hyperTargeting) {
|
|
136
|
-
targeting = _extends._extends({}, targeting, { campaign_id: props.cache.hyperTargeting });
|
|
136
|
+
targeting = _extends$1._extends({}, targeting, { campaign_id: props.cache.hyperTargeting });
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
if (position && position.length) {
|
package/dist/cjs/getTargeting.js
CHANGED
|
@@ -8,7 +8,7 @@ require('./toConsumableArray-9a3476fe.js');
|
|
|
8
8
|
require('./core.get-iterator-method-f62321d4.js');
|
|
9
9
|
require('./_object-pie-68c5bcbc.js');
|
|
10
10
|
require('./extends-60837c34.js');
|
|
11
|
-
var getTargeting = require('./getTargeting-
|
|
11
|
+
var getTargeting = require('./getTargeting-9af0ef69.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
|
|
4
|
-
var moment = require('./moment-
|
|
4
|
+
var moment = require('./moment-575fe24c.js');
|
|
5
5
|
|
|
6
6
|
var momentTimezone = _commonjsHelpers.createCommonjsModule(function (module) {
|
|
7
7
|
//! moment-timezone.js
|