@mjhls/mjh-framework 1.0.540 → 1.0.542
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/getQuery.js +3 -3
- package/dist/cjs/getSerializers.js +12 -1
- package/dist/esm/getQuery.js +3 -3
- package/dist/esm/getSerializers.js +12 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/getQuery.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('./_commonjsHelpers-06173234.js');
|
|
4
|
-
|
|
4
|
+
require('./moment-66a6a284.js');
|
|
5
5
|
|
|
6
6
|
var getQuery = function getQuery(type) {
|
|
7
7
|
var conditions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
@@ -9,10 +9,10 @@ var getQuery = function getQuery(type) {
|
|
|
9
9
|
|
|
10
10
|
//Added feature to include additional conditions and parameters for site level operations
|
|
11
11
|
//Site level conditions should start with && (logical AND), and site level params should end with , (comma) in order to execute query
|
|
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 <= \
|
|
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 \'showPublished\':select(contentCategory->name !=\'Webcasts\' => true,false),\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 }';
|
|
16
16
|
case 'article':
|
|
17
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 \'showPublished\':select(contentCategory->name !=\'Webcasts\' => true,false),\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 }';
|
|
18
18
|
case 'publication':
|
|
@@ -2193,7 +2193,18 @@ var Video = function Video(_ref) {
|
|
|
2193
2193
|
playlistID = node.playlistID,
|
|
2194
2194
|
experienceID = node.experienceID;
|
|
2195
2195
|
|
|
2196
|
+
var router = Router.useRouter();
|
|
2197
|
+
|
|
2198
|
+
var _useState = React.useState(null),
|
|
2199
|
+
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
|
2200
|
+
qsVideoID = _useState2[0],
|
|
2201
|
+
setQsVideoID = _useState2[1];
|
|
2196
2202
|
|
|
2203
|
+
React.useEffect(function () {
|
|
2204
|
+
if (router.query && router.query.videoID && !qsVideoID) {
|
|
2205
|
+
setQsVideoID(router.query.videoID);
|
|
2206
|
+
}
|
|
2207
|
+
}, [router && router.query]);
|
|
2197
2208
|
var onVideoSuccess = function onVideoSuccess(success) {
|
|
2198
2209
|
//console.log('success:', success.ref)
|
|
2199
2210
|
var player = success.ref;
|
|
@@ -2331,7 +2342,7 @@ var Video = function Video(_ref) {
|
|
|
2331
2342
|
'div',
|
|
2332
2343
|
{ style: { paddingTop: '56.25%' } },
|
|
2333
2344
|
React__default.createElement('iframe', {
|
|
2334
|
-
src: 'https://players.brightcove.net/' + accountIDs.brightcove.accountId + '/experience_' + experienceID + '/index.html',
|
|
2345
|
+
src: 'https://players.brightcove.net/' + accountIDs.brightcove.accountId + '/experience_' + experienceID + '/index.html' + (qsVideoID ? '?videoID=' + qsVideoID : ''),
|
|
2335
2346
|
allowFullScreen: 'true',
|
|
2336
2347
|
webkitallowfullscreen: 'true',
|
|
2337
2348
|
mozallowfullscreen: 'true',
|
package/dist/esm/getQuery.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './_commonjsHelpers-0c4b6f40.js';
|
|
2
|
-
import
|
|
2
|
+
import './moment-12415288.js';
|
|
3
3
|
|
|
4
4
|
var getQuery = function getQuery(type) {
|
|
5
5
|
var conditions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
@@ -7,10 +7,10 @@ var getQuery = function getQuery(type) {
|
|
|
7
7
|
|
|
8
8
|
//Added feature to include additional conditions and parameters for site level operations
|
|
9
9
|
//Site level conditions should start with && (logical AND), and site level params should end with , (comma) in order to execute query
|
|
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 <= \
|
|
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 \'showPublished\':select(contentCategory->name !=\'Webcasts\' => true,false),\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 }';
|
|
14
14
|
case 'article':
|
|
15
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 \'showPublished\':select(contentCategory->name !=\'Webcasts\' => true,false),\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 }';
|
|
16
16
|
case 'publication':
|
|
@@ -2187,7 +2187,18 @@ var Video = function Video(_ref) {
|
|
|
2187
2187
|
playlistID = node.playlistID,
|
|
2188
2188
|
experienceID = node.experienceID;
|
|
2189
2189
|
|
|
2190
|
+
var router = useRouter();
|
|
2191
|
+
|
|
2192
|
+
var _useState = useState(null),
|
|
2193
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2194
|
+
qsVideoID = _useState2[0],
|
|
2195
|
+
setQsVideoID = _useState2[1];
|
|
2190
2196
|
|
|
2197
|
+
useEffect(function () {
|
|
2198
|
+
if (router.query && router.query.videoID && !qsVideoID) {
|
|
2199
|
+
setQsVideoID(router.query.videoID);
|
|
2200
|
+
}
|
|
2201
|
+
}, [router && router.query]);
|
|
2191
2202
|
var onVideoSuccess = function onVideoSuccess(success) {
|
|
2192
2203
|
//console.log('success:', success.ref)
|
|
2193
2204
|
var player = success.ref;
|
|
@@ -2325,7 +2336,7 @@ var Video = function Video(_ref) {
|
|
|
2325
2336
|
'div',
|
|
2326
2337
|
{ style: { paddingTop: '56.25%' } },
|
|
2327
2338
|
React__default.createElement('iframe', {
|
|
2328
|
-
src: 'https://players.brightcove.net/' + accountIDs.brightcove.accountId + '/experience_' + experienceID + '/index.html',
|
|
2339
|
+
src: 'https://players.brightcove.net/' + accountIDs.brightcove.accountId + '/experience_' + experienceID + '/index.html' + (qsVideoID ? '?videoID=' + qsVideoID : ''),
|
|
2329
2340
|
allowFullScreen: 'true',
|
|
2330
2341
|
webkitallowfullscreen: 'true',
|
|
2331
2342
|
mozallowfullscreen: 'true',
|