@mjhls/mjh-framework 1.0.490 → 1.0.492

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,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.490
2
+ # mjh-framework v. 1.0.492
3
3
 
4
4
  > Foundation Framework
5
5
 
@@ -97,22 +97,7 @@ var getArticleSummary = function getArticleSummary(article) {
97
97
  if (article.summary && article.summary.length > 0) {
98
98
  return article.summary;
99
99
  } else {
100
- var _article$body = article.body,
101
- body = _article$body === undefined ? [] : _article$body;
102
-
103
- var desc = '';
104
- body.some(function (children) {
105
- children.children && children.children.some(function (item) {
106
- if (item.text && String(item.text).trim().length > 0 && desc === '') {
107
- desc = String(item.text);
108
- return true;
109
- }
110
- });
111
- if (desc !== '') {
112
- return true;
113
- }
114
- });
115
- return desc;
100
+ return false;
116
101
  }
117
102
  };
118
103
 
@@ -583,16 +568,14 @@ var Article = function Article(props) {
583
568
  })
584
569
  ),
585
570
  renderRelevantTopicsDropdown(),
586
- React__default.createElement(
571
+ summary && React__default.createElement(
587
572
  'p',
588
573
  null,
589
574
  React__default.createElement(
590
575
  'em',
591
576
  null,
592
577
  summary
593
- ),
594
- React__default.createElement('br', null),
595
- React__default.createElement('br', null)
578
+ )
596
579
  ),
597
580
  main.main_39 && props.article.Ads.map(function (ad, index) {
598
581
  if (index === 0) {
@@ -605,7 +588,7 @@ var Article = function Article(props) {
605
588
  }),
606
589
  React__default.createElement(
607
590
  'div',
608
- { className: 'block-content' },
591
+ { className: 'block-content mt-3' },
609
592
  renderBlockContent(props.article),
610
593
  issue && issue.url && React__default.createElement(
611
594
  'a',
@@ -50,7 +50,9 @@ var ExternalResources = function ExternalResources(props) {
50
50
  display = props.display,
51
51
  client = props.client,
52
52
  _props$cta = props.cta,
53
- cta = _props$cta === undefined ? 'Learn More' : _props$cta;
53
+ cta = _props$cta === undefined ? 'Learn More' : _props$cta,
54
+ _props$url = props.url,
55
+ url = _props$url === undefined ? 'resources' : _props$url;
54
56
 
55
57
  var _useState = React.useState(display && (display === 'recent' || display === 'archived') ? display : 'recent'),
56
58
  _useState2 = slicedToArray._slicedToArray(_useState, 2),
@@ -59,7 +61,7 @@ var ExternalResources = function ExternalResources(props) {
59
61
 
60
62
  var router = Router.useRouter();
61
63
  React.useEffect(function () {
62
- router.push(router.pathname, '/resources?display=' + active, { shallow: true });
64
+ router.push(router.pathname, '/' + url + '?display=' + active, { shallow: true });
63
65
  }, [active]);
64
66
  return React__default.createElement(
65
67
  'div',
package/dist/cjs/View.js CHANGED
@@ -89,22 +89,7 @@ var getArticleSummary = function getArticleSummary(article) {
89
89
  if (article.summary && article.summary.length > 0) {
90
90
  return article.summary;
91
91
  } else {
92
- var _article$body = article.body,
93
- body = _article$body === undefined ? [] : _article$body;
94
-
95
- var desc = '';
96
- body.some(function (children) {
97
- children.children && children.children.some(function (item) {
98
- if (item.text && String(item.text).trim().length > 0 && desc === '') {
99
- desc = String(item.text);
100
- return true;
101
- }
102
- });
103
- if (desc !== '') {
104
- return true;
105
- }
106
- });
107
- return desc;
92
+ return false;
108
93
  }
109
94
  };
110
95
 
@@ -771,16 +756,14 @@ var Article = function Article(props) {
771
756
  React__default.createElement(DocumentGroup, { article: props.article, client: props.client })
772
757
  )
773
758
  ),
774
- React__default.createElement(
759
+ summary && React__default.createElement(
775
760
  'p',
776
761
  null,
777
762
  React__default.createElement(
778
763
  'em',
779
764
  null,
780
765
  summary
781
- ),
782
- React__default.createElement('br', null),
783
- React__default.createElement('br', null)
766
+ )
784
767
  ),
785
768
  React__default.createElement(
786
769
  'div',
@@ -806,7 +789,7 @@ var Article = function Article(props) {
806
789
  ),
807
790
  React__default.createElement(
808
791
  'div',
809
- { className: 'block-content' },
792
+ { className: 'block-content mt-3' },
810
793
  renderBlockContent(article),
811
794
  React__default.createElement(
812
795
  'noscript',
@@ -20,7 +20,7 @@ var getQuery = function getQuery(type) {
20
20
  case 'issue':
21
21
  return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issue\': *[_type == \'publication\'\n && references(^._id)\n && identifier.current == $issue][0] {\n ...,\n \'articles\': *[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && is_visible\n && defined(url)\n && dateTime(published) <= dateTime($currentDate)\n && references(^._id)] {\n ...,\n authorMapping[0]->,\n contentCategory->,\n issueSection-> {\n name\n }\n }\n }\n }';
22
22
  case 'externalResources':
23
- return '{\n \'archived\': *[_type == "external" && archived && isVisible],\n \'recent\': *[_type == "external" && !archived && isVisible]\n }';
23
+ return '{\n \'archived\': *[_type == "external" && archived && isVisible ' + conditions + '],\n \'recent\': *[_type == "external" && !archived && isVisible ' + conditions + ']\n }';
24
24
  }
25
25
  };
26
26
 
@@ -92,22 +92,7 @@ var getArticleSummary = function getArticleSummary(article) {
92
92
  if (article.summary && article.summary.length > 0) {
93
93
  return article.summary;
94
94
  } else {
95
- var _article$body = article.body,
96
- body = _article$body === undefined ? [] : _article$body;
97
-
98
- var desc = '';
99
- body.some(function (children) {
100
- children.children && children.children.some(function (item) {
101
- if (item.text && String(item.text).trim().length > 0 && desc === '') {
102
- desc = String(item.text);
103
- return true;
104
- }
105
- });
106
- if (desc !== '') {
107
- return true;
108
- }
109
- });
110
- return desc;
95
+ return false;
111
96
  }
112
97
  };
113
98
 
@@ -578,16 +563,14 @@ var Article = function Article(props) {
578
563
  })
579
564
  ),
580
565
  renderRelevantTopicsDropdown(),
581
- React__default.createElement(
566
+ summary && React__default.createElement(
582
567
  'p',
583
568
  null,
584
569
  React__default.createElement(
585
570
  'em',
586
571
  null,
587
572
  summary
588
- ),
589
- React__default.createElement('br', null),
590
- React__default.createElement('br', null)
573
+ )
591
574
  ),
592
575
  main_39 && props.article.Ads.map(function (ad, index) {
593
576
  if (index === 0) {
@@ -600,7 +583,7 @@ var Article = function Article(props) {
600
583
  }),
601
584
  React__default.createElement(
602
585
  'div',
603
- { className: 'block-content' },
586
+ { className: 'block-content mt-3' },
604
587
  renderBlockContent(props.article),
605
588
  issue && issue.url && React__default.createElement(
606
589
  'a',
@@ -44,7 +44,9 @@ var ExternalResources = function ExternalResources(props) {
44
44
  display = props.display,
45
45
  client = props.client,
46
46
  _props$cta = props.cta,
47
- cta = _props$cta === undefined ? 'Learn More' : _props$cta;
47
+ cta = _props$cta === undefined ? 'Learn More' : _props$cta,
48
+ _props$url = props.url,
49
+ url = _props$url === undefined ? 'resources' : _props$url;
48
50
 
49
51
  var _useState = useState(display && (display === 'recent' || display === 'archived') ? display : 'recent'),
50
52
  _useState2 = _slicedToArray(_useState, 2),
@@ -53,7 +55,7 @@ var ExternalResources = function ExternalResources(props) {
53
55
 
54
56
  var router = useRouter();
55
57
  useEffect(function () {
56
- router.push(router.pathname, '/resources?display=' + active, { shallow: true });
58
+ router.push(router.pathname, '/' + url + '?display=' + active, { shallow: true });
57
59
  }, [active]);
58
60
  return React__default.createElement(
59
61
  'div',
package/dist/esm/View.js CHANGED
@@ -84,22 +84,7 @@ var getArticleSummary = function getArticleSummary(article) {
84
84
  if (article.summary && article.summary.length > 0) {
85
85
  return article.summary;
86
86
  } else {
87
- var _article$body = article.body,
88
- body = _article$body === undefined ? [] : _article$body;
89
-
90
- var desc = '';
91
- body.some(function (children) {
92
- children.children && children.children.some(function (item) {
93
- if (item.text && String(item.text).trim().length > 0 && desc === '') {
94
- desc = String(item.text);
95
- return true;
96
- }
97
- });
98
- if (desc !== '') {
99
- return true;
100
- }
101
- });
102
- return desc;
87
+ return false;
103
88
  }
104
89
  };
105
90
 
@@ -766,16 +751,14 @@ var Article = function Article(props) {
766
751
  React__default.createElement(DocumentGroup, { article: props.article, client: props.client })
767
752
  )
768
753
  ),
769
- React__default.createElement(
754
+ summary && React__default.createElement(
770
755
  'p',
771
756
  null,
772
757
  React__default.createElement(
773
758
  'em',
774
759
  null,
775
760
  summary
776
- ),
777
- React__default.createElement('br', null),
778
- React__default.createElement('br', null)
761
+ )
779
762
  ),
780
763
  React__default.createElement(
781
764
  'div',
@@ -801,7 +784,7 @@ var Article = function Article(props) {
801
784
  ),
802
785
  React__default.createElement(
803
786
  'div',
804
- { className: 'block-content' },
787
+ { className: 'block-content mt-3' },
805
788
  renderBlockContent(article),
806
789
  React__default.createElement(
807
790
  'noscript',
@@ -18,7 +18,7 @@ var getQuery = function getQuery(type) {
18
18
  case 'issue':
19
19
  return '*[_type == \'publication\'\n && identifier.current == $publication\n ' + conditions + '][0] {\n ' + params + '\n ...,\n \'issue\': *[_type == \'publication\'\n && references(^._id)\n && identifier.current == $issue][0] {\n ...,\n \'articles\': *[_type == \'article\'\n && !(_id in path("drafts.**"))\n && defined(title)\n && is_visible\n && defined(url)\n && dateTime(published) <= dateTime($currentDate)\n && references(^._id)] {\n ...,\n authorMapping[0]->,\n contentCategory->,\n issueSection-> {\n name\n }\n }\n }\n }';
20
20
  case 'externalResources':
21
- return '{\n \'archived\': *[_type == "external" && archived && isVisible],\n \'recent\': *[_type == "external" && !archived && isVisible]\n }';
21
+ return '{\n \'archived\': *[_type == "external" && archived && isVisible ' + conditions + '],\n \'recent\': *[_type == "external" && !archived && isVisible ' + conditions + ']\n }';
22
22
  }
23
23
  };
24
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.490",
3
+ "version": "1.0.492",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",