@mjhls/mjh-framework 1.0.910 → 1.0.911

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 CHANGED
@@ -1,4 +1,4 @@
1
- # mjh-framework v. 1.0.910
1
+ # mjh-framework v. 1.0.911
2
2
 
3
3
  [![NPM](https://img.shields.io/npm/v/mjh-framework.svg)](https://www.npmjs.com/package/mjh-framework) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
4
4
 
package/dist/cjs/View.js CHANGED
@@ -29,6 +29,7 @@ var styleInject_es = require('./style-inject.es-dcee06b6.js');
29
29
  require('./index-eadd5035.js');
30
30
  var disqusReact = require('disqus-react');
31
31
  var Schema = require('./Schema.js');
32
+ var FileSaver = require('file-saver');
32
33
  var keys = require('./keys-e982b3fa.js');
33
34
  var index_es = require('./index.es-f3e47207.js');
34
35
  var index = require('./index-fc2f1ca2.js');
@@ -81,6 +82,7 @@ var Head__default = /*#__PURE__*/_interopDefaultLegacy(Head);
81
82
  var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
82
83
  var FormControl__default = /*#__PURE__*/_interopDefaultLegacy(FormControl);
83
84
  var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
85
+ var FileSaver__default = /*#__PURE__*/_interopDefaultLegacy(FileSaver);
84
86
 
85
87
  var getArticleSummary = function getArticleSummary(article) {
86
88
  if (article.summary && article.summary.length > 0) {
@@ -557,7 +559,9 @@ var Article = React.forwardRef(function (props, ref) {
557
559
  _props$refreshFlag = props.refreshFlag,
558
560
  refreshFlag = _props$refreshFlag === undefined ? false : _props$refreshFlag,
559
561
  disqusConfig = props.disqusConfig,
560
- showDisqus = props.showDisqus;
562
+ showDisqus = props.showDisqus,
563
+ _props$downloadCitati = props.downloadCitation,
564
+ downloadCitation = _props$downloadCitati === undefined ? false : _props$downloadCitati;
561
565
 
562
566
 
563
567
  var targeting = getTargeting.getTargeting(props);
@@ -666,6 +670,53 @@ var Article = React.forwardRef(function (props, ref) {
666
670
  }
667
671
  return null;
668
672
  };
673
+ var generateRIS = function generateRIS() {
674
+ var fileContent = 'TY - JOUR\n';
675
+ if (issue) {
676
+ if (article.title) {
677
+ fileContent += 'TI - ' + article.title + '\n'; //Title - TI
678
+ fileContent += 'T1 - ' + article.title + '\n'; //Title - T1
679
+ }
680
+ if (issue.publication && issue.publication.name) {
681
+ fileContent += 'T2 - ' + issue.publication.name + '\n'; //Secondary Title - T2
682
+ fileContent += 'JF - ' + issue.publication.name + '\n'; //Journal Name - JF
683
+ }
684
+ if (issue.abbreviatedJournal) {
685
+ fileContent += 'JO - ' + issue.abbreviatedJournal + '\n'; //Journal Name - JO
686
+ }
687
+ if (article.fieldAbstract) fileContent += 'N2 - ' + article.fieldAbstract + '\n'; //Abstract - N2
688
+ if (issue.issueNumber) fileContent += 'IS - ' + issue.issueNumber + '\n'; //Issue Number - IS
689
+ fileContent += 'PB - MJH Life Sciences\n'; //Publisher - PB
690
+ if (issue.year) fileContent += 'PY - ' + issue.year + '\n'; //Published Year - PY
691
+ if (issue.volume) fileContent += 'VL - ' + issue.volume + '\n'; //Volume - VL
692
+ if (issue.url) fileContent += 'L1 - ' + issue.url + '\n'; //Link to PDF - L1
693
+ if (shareOptions && shareOptions.shareBaseUrl) {
694
+ fileContent += 'L2 - ' + (shareOptions.shareBaseUrl + url) + '\n'; //Link to Full-text - L2
695
+ fileContent += 'UR - ' + (shareOptions.shareBaseUrl + url) + '\n'; //Doc URL - UR
696
+ }
697
+ if (props.Website) fileContent += 'LK - https://' + props.Website.liveDomain + '\n'; //Website Link - LK
698
+ if (issue.isbn_issn) {
699
+ fileContent += 'SN - ' + issue.isbn_issn + '\n'; //ISSN/ISBN - TI
700
+ }
701
+ if (pageNumber) {
702
+ if (pageNumber.includes('-')) {
703
+ fileContent += 'SP - ' + pageNumber.split('-')[0] + '\n'; //Start Page - SP
704
+ fileContent += 'EP - ' + pageNumber.split('-')[1] + '\n'; //End Page - EP
705
+ } else {
706
+ fileContent += 'SP - ' + pageNumber + '\n';
707
+ }
708
+ }
709
+ if (article.published) fileContent += 'Y1 - ' + moment.moment(published).format('DD-MMMM-YYYY') + '\n'; //Primary Date - Y1
710
+ fileContent += 'Y2 - ' + moment.moment().format('DD-MMMM-YYYY') + '\n'; //Access Date - Y2
711
+ }
712
+ fileContent += 'ER -\n'; //End of Record
713
+ return fileContent;
714
+ };
715
+ var downloadRIS = function downloadRIS() {
716
+ var fileContent = generateRIS();
717
+ var file = new File([fileContent], 'citation-' + url + '.ris', { type: 'application/x-research-info-systems;charset=utf-8' });
718
+ FileSaver__default['default'].saveAs(file, 'citation-' + url + '.ris');
719
+ };
669
720
 
670
721
  var RelevantTopics = function RelevantTopics() {
671
722
  if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
@@ -1009,7 +1060,7 @@ var Article = React.forwardRef(function (props, ref) {
1009
1060
  var shareTitle = article.title;
1010
1061
  var shareSummary = article.summary;
1011
1062
  var shareImage = thumbnail && thumbnail.asset ? urlFor({ client: props.client, source: thumbnail.asset }) : shareImageDefault;
1012
- var siteName = props.website && props.website.title ? props.website.title : '';
1063
+ var siteName = props.Website && props.Website.title ? props.Website.title : '';
1013
1064
  var shareKeywords = getKeywords(props.article).join(',');
1014
1065
 
1015
1066
  var meta = {
@@ -1256,12 +1307,23 @@ var Article = React.forwardRef(function (props, ref) {
1256
1307
  )
1257
1308
  )
1258
1309
  ),
1259
- issue && issue.url && React__default['default'].createElement(
1260
- 'a',
1261
- { rel: 'noopener', href: issue.url, target: '_blank', title: 'Download issue' },
1262
- React__default['default'].createElement('img', { style: { margin: '1rem', maxHeight: '40px', maxWidth: '40px' }, src: '/download.png', alt: 'download issue' }),
1263
- 'Download Issue : ',
1264
- issue.name
1310
+ React__default['default'].createElement(
1311
+ 'div',
1312
+ { className: 'downloads-container' },
1313
+ issue && downloadCitation && React__default['default'].createElement(
1314
+ Button__default['default'],
1315
+ { className: 'ris-download-button', onClick: function onClick() {
1316
+ return downloadRIS();
1317
+ } },
1318
+ 'Download RIS'
1319
+ ),
1320
+ issue && issue.url && React__default['default'].createElement(
1321
+ 'a',
1322
+ { rel: 'noopener', href: issue.url, target: '_blank', title: 'Download issue' },
1323
+ React__default['default'].createElement('img', { style: { margin: '1rem', maxHeight: '40px', maxWidth: '40px' }, src: '/download.png', alt: 'download issue' }),
1324
+ 'Download Issue : ',
1325
+ issue.name
1326
+ )
1265
1327
  )
1266
1328
  ),
1267
1329
  React__default['default'].createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
@@ -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, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'category\':contentCategory->{\n name,\n disableAds\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 showSocialShare\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\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 fieldAbstract,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'category\':contentCategory->{\n name,\n disableAds\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 showSocialShare\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\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 isbn_issn,\n abbreviatedJournal,\n }\n }';
14
14
  case 'article':
15
- return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible != false\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\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 poster {\n _type,\n asset-> \n }\n },\n articles[]{\n ...,\n thumbnail{\n ...,\n asset-> \n },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\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 showSocialShare\n },\n documentGroup-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n isSeries,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\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 && is_visible != false\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\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 poster {\n _type,\n asset-> \n }\n },\n articles[]{\n ...,\n thumbnail{\n ...,\n asset-> \n },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\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 showSocialShare\n },\n documentGroup-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n isSeries,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\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 year,\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 isbn_issn,\n abbreviatedJournal,\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 thumbnail{ ..., asset-> },\n taxonomyMapping[]->,\n pdf{asset->},\n } | order(year desc, month desc)\n }';
18
18
  case 'issue':
package/dist/cjs/index.js CHANGED
@@ -195,6 +195,7 @@ require('./md5-e1ca5797.js');
195
195
  require('./SeriesSlider-ba0c5d1a.js');
196
196
  require('./style-inject.es-dcee06b6.js');
197
197
  require('disqus-react');
198
+ require('file-saver');
198
199
  require('react-twitter-embed');
199
200
  require('./ImageSlider-6c00b878.js');
200
201
  require('./defineProperty-e0fb52c5.js');
package/dist/esm/View.js CHANGED
@@ -27,6 +27,7 @@ import { s as styleInject } from './style-inject.es-1f59c1d0.js';
27
27
  import './index-755f2cc2.js';
28
28
  import { DiscussionEmbed } from 'disqus-react';
29
29
  import Schema from './Schema.js';
30
+ import FileSaver from 'file-saver';
30
31
  import { _ as _Object$keys } from './keys-31dcdb31.js';
31
32
  import { I as InfiniteScroll } from './index.es-a6137319.js';
32
33
  import { l as lib_3 } from './index-f0fc23eb.js';
@@ -547,7 +548,9 @@ var Article = forwardRef(function (props, ref) {
547
548
  _props$refreshFlag = props.refreshFlag,
548
549
  refreshFlag = _props$refreshFlag === undefined ? false : _props$refreshFlag,
549
550
  disqusConfig = props.disqusConfig,
550
- showDisqus = props.showDisqus;
551
+ showDisqus = props.showDisqus,
552
+ _props$downloadCitati = props.downloadCitation,
553
+ downloadCitation = _props$downloadCitati === undefined ? false : _props$downloadCitati;
551
554
 
552
555
 
553
556
  var targeting = getTargeting(props);
@@ -656,6 +659,53 @@ var Article = forwardRef(function (props, ref) {
656
659
  }
657
660
  return null;
658
661
  };
662
+ var generateRIS = function generateRIS() {
663
+ var fileContent = 'TY - JOUR\n';
664
+ if (issue) {
665
+ if (article.title) {
666
+ fileContent += 'TI - ' + article.title + '\n'; //Title - TI
667
+ fileContent += 'T1 - ' + article.title + '\n'; //Title - T1
668
+ }
669
+ if (issue.publication && issue.publication.name) {
670
+ fileContent += 'T2 - ' + issue.publication.name + '\n'; //Secondary Title - T2
671
+ fileContent += 'JF - ' + issue.publication.name + '\n'; //Journal Name - JF
672
+ }
673
+ if (issue.abbreviatedJournal) {
674
+ fileContent += 'JO - ' + issue.abbreviatedJournal + '\n'; //Journal Name - JO
675
+ }
676
+ if (article.fieldAbstract) fileContent += 'N2 - ' + article.fieldAbstract + '\n'; //Abstract - N2
677
+ if (issue.issueNumber) fileContent += 'IS - ' + issue.issueNumber + '\n'; //Issue Number - IS
678
+ fileContent += 'PB - MJH Life Sciences\n'; //Publisher - PB
679
+ if (issue.year) fileContent += 'PY - ' + issue.year + '\n'; //Published Year - PY
680
+ if (issue.volume) fileContent += 'VL - ' + issue.volume + '\n'; //Volume - VL
681
+ if (issue.url) fileContent += 'L1 - ' + issue.url + '\n'; //Link to PDF - L1
682
+ if (shareOptions && shareOptions.shareBaseUrl) {
683
+ fileContent += 'L2 - ' + (shareOptions.shareBaseUrl + url) + '\n'; //Link to Full-text - L2
684
+ fileContent += 'UR - ' + (shareOptions.shareBaseUrl + url) + '\n'; //Doc URL - UR
685
+ }
686
+ if (props.Website) fileContent += 'LK - https://' + props.Website.liveDomain + '\n'; //Website Link - LK
687
+ if (issue.isbn_issn) {
688
+ fileContent += 'SN - ' + issue.isbn_issn + '\n'; //ISSN/ISBN - TI
689
+ }
690
+ if (pageNumber) {
691
+ if (pageNumber.includes('-')) {
692
+ fileContent += 'SP - ' + pageNumber.split('-')[0] + '\n'; //Start Page - SP
693
+ fileContent += 'EP - ' + pageNumber.split('-')[1] + '\n'; //End Page - EP
694
+ } else {
695
+ fileContent += 'SP - ' + pageNumber + '\n';
696
+ }
697
+ }
698
+ if (article.published) fileContent += 'Y1 - ' + moment(published).format('DD-MMMM-YYYY') + '\n'; //Primary Date - Y1
699
+ fileContent += 'Y2 - ' + moment().format('DD-MMMM-YYYY') + '\n'; //Access Date - Y2
700
+ }
701
+ fileContent += 'ER -\n'; //End of Record
702
+ return fileContent;
703
+ };
704
+ var downloadRIS = function downloadRIS() {
705
+ var fileContent = generateRIS();
706
+ var file = new File([fileContent], 'citation-' + url + '.ris', { type: 'application/x-research-info-systems;charset=utf-8' });
707
+ FileSaver.saveAs(file, 'citation-' + url + '.ris');
708
+ };
659
709
 
660
710
  var RelevantTopics = function RelevantTopics() {
661
711
  if (content_placement && content_placement.length > 0 || documentGroupMapping && documentGroupMapping.length > 0) {
@@ -999,7 +1049,7 @@ var Article = forwardRef(function (props, ref) {
999
1049
  var shareTitle = article.title;
1000
1050
  var shareSummary = article.summary;
1001
1051
  var shareImage = thumbnail && thumbnail.asset ? urlFor({ client: props.client, source: thumbnail.asset }) : shareImageDefault;
1002
- var siteName = props.website && props.website.title ? props.website.title : '';
1052
+ var siteName = props.Website && props.Website.title ? props.Website.title : '';
1003
1053
  var shareKeywords = getKeywords(props.article).join(',');
1004
1054
 
1005
1055
  var meta = {
@@ -1246,12 +1296,23 @@ var Article = forwardRef(function (props, ref) {
1246
1296
  )
1247
1297
  )
1248
1298
  ),
1249
- issue && issue.url && React__default.createElement(
1250
- 'a',
1251
- { rel: 'noopener', href: issue.url, target: '_blank', title: 'Download issue' },
1252
- React__default.createElement('img', { style: { margin: '1rem', maxHeight: '40px', maxWidth: '40px' }, src: '/download.png', alt: 'download issue' }),
1253
- 'Download Issue : ',
1254
- issue.name
1299
+ React__default.createElement(
1300
+ 'div',
1301
+ { className: 'downloads-container' },
1302
+ issue && downloadCitation && React__default.createElement(
1303
+ Button,
1304
+ { className: 'ris-download-button', onClick: function onClick() {
1305
+ return downloadRIS();
1306
+ } },
1307
+ 'Download RIS'
1308
+ ),
1309
+ issue && issue.url && React__default.createElement(
1310
+ 'a',
1311
+ { rel: 'noopener', href: issue.url, target: '_blank', title: 'Download issue' },
1312
+ React__default.createElement('img', { style: { margin: '1rem', maxHeight: '40px', maxWidth: '40px' }, src: '/download.png', alt: 'download issue' }),
1313
+ 'Download Issue : ',
1314
+ issue.name
1315
+ )
1255
1316
  )
1256
1317
  ),
1257
1318
  React__default.createElement('div', { className: 'clearfix', style: { minHeight: '1px' } }),
@@ -8,9 +8,9 @@ var getQuery = function getQuery(type) {
8
8
 
9
9
  switch (type) {
10
10
  case 'related':
11
- 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, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'category\':contentCategory->{\n name,\n disableAds\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 showSocialShare\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\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 }';
11
+ 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 fieldAbstract,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\n },\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'category\':contentCategory->{\n name,\n disableAds\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 showSocialShare\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\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 isbn_issn,\n abbreviatedJournal,\n }\n }';
12
12
  case 'article':
13
- return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible != false\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\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 poster {\n _type,\n asset-> \n }\n },\n articles[]{\n ...,\n thumbnail{\n ...,\n asset-> \n },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\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 showSocialShare\n },\n documentGroup-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n isSeries,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\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 }';
13
+ return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && is_visible != false\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n fieldAbstract,\n ...,\n passwordLock,\n password,\n issueGroup-> { _id, name, identifier, parent-> },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\n body[] {\n ...,\n asset->,\n images[]{\n ...,\n asset->\n },\n content[]{\n ...,\n asset->\n },\n videos[]{\n ...,\n thumbnail{\n _type,\n asset->\n }\n },\n response[]{\n ...,\n asset->\n },\n quizzes[]{\n ...,\n answer[]{\n ...,\n asset->\n },\n question[]{\n ...,\n asset->\n }\n },\n poster {\n _type,\n asset->\n },\n slides[]{\n ...,\n slideshowImage{\n ...,\n asset->\n }\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 poster {\n _type,\n asset-> \n }\n },\n articles[]{\n ...,\n thumbnail{\n ...,\n asset-> \n },\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography, showSocialShare },\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 showSocialShare\n },\n documentGroup-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n isSeries,\n showSocialShare,\n \'path\': identifier.current,\n adTargetingURL\n },\n documentGroupMapping[]-> {\n _id,\n name,\n thumbnail,\n parent->{...,parent->},\n isShow,\n showSocialShare,\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 year,\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 isbn_issn,\n abbreviatedJournal,\n }\n\n }';
14
14
  case 'publication':
15
15
  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 thumbnail{ ..., asset-> },\n taxonomyMapping[]->,\n pdf{asset->},\n } | order(year desc, month desc)\n }';
16
16
  case 'issue':
package/dist/esm/index.js CHANGED
@@ -192,6 +192,7 @@ import './md5-4e42248e.js';
192
192
  import './SeriesSlider-45adb8dc.js';
193
193
  import './style-inject.es-1f59c1d0.js';
194
194
  import 'disqus-react';
195
+ import 'file-saver';
195
196
  import 'react-twitter-embed';
196
197
  import './ImageSlider-f84174cb.js';
197
198
  import './defineProperty-23a8f8cd.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.910",
3
+ "version": "1.0.911",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",
@@ -56,6 +56,7 @@
56
56
  "eslint-plugin-react": "^7.10.0",
57
57
  "eslint-plugin-react-hooks": "^2.3.0",
58
58
  "eslint-plugin-standard": "^3.1.0",
59
+ "file-saver": "^2.0.5",
59
60
  "get-youtube-id": "^1.0.1",
60
61
  "gh-pages": "^1.2.0",
61
62
  "lodash": "^4.17.15",