@mjhls/mjh-framework 1.0.1009 → 1.0.1011

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.1009
1
+ # mjh-framework v. 1.0.1011
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
@@ -189,21 +189,30 @@ var DocumentGroup = function DocumentGroup(_ref) {
189
189
  if (mediaSeriesGroup.thumbnail) {
190
190
  thumbnailUrl = urlFor({ client: client, source: mediaSeriesGroup.thumbnail });
191
191
  }
192
-
192
+ var margin = article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText || article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? 'none' : '1rem';
193
193
  return React__default["default"].createElement(
194
- 'a',
195
- {
196
- href: url,
197
- className: 'doc-group',
198
- style: { display: 'flex', flexDirection: 'column', padding: '0 1rem', justifyContent: thumbnailUrl ? 'center' : 'flex-start', alignItems: 'center' } },
199
- thumbnailUrl && !disableThumbnail && React__default["default"].createElement('img', { style: { maxWidth: '220px', maxHeight: '100px', marginTop: '1rem' }, src: thumbnailUrl, alt: name }),
200
- (disableThumbnail || !thumbnailUrl) && React__default["default"].createElement('p', {
201
- style: { maxWidth: '315px', margin: '0', color: 'var(--primary)', textAlign: thumbnailUrl ? 'center' : main.main_43 ? 'left' : 'right', marginTop: '.25rem' },
202
- dangerouslySetInnerHTML: { __html: name } }),
203
- main.main_43 && !thumbnailUrl && React__default["default"].createElement(
204
- 'style',
205
- { jsx: 'true' },
206
- '\n a.doc-group {\n display: block !important;\n padding: 0 !important;\n }\n '
194
+ 'div',
195
+ null,
196
+ React__default["default"].createElement(
197
+ 'p',
198
+ { style: { textAlign: 'center', fontWeight: 600 } },
199
+ article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText ? article.documentGroupMapping[0].parent.parent.contextText : article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? article.documentGroup.parent.parent.contextText : null
200
+ ),
201
+ React__default["default"].createElement(
202
+ 'a',
203
+ {
204
+ href: url,
205
+ className: 'doc-group',
206
+ style: { display: 'flex', flexDirection: 'column', padding: '0 1rem', justifyContent: thumbnailUrl ? 'center' : 'flex-start', alignItems: 'center' } },
207
+ thumbnailUrl && !disableThumbnail && React__default["default"].createElement('img', { style: { maxWidth: '210px', maxHeight: '100px', marginTop: margin }, src: thumbnailUrl, alt: name }),
208
+ (disableThumbnail || !thumbnailUrl) && React__default["default"].createElement('p', {
209
+ style: { maxWidth: '315px', margin: '0', color: 'var(--primary)', textAlign: thumbnailUrl ? 'center' : main.main_43 ? 'left' : 'right', marginTop: '.25rem' },
210
+ dangerouslySetInnerHTML: { __html: name } }),
211
+ main.main_43 && !thumbnailUrl && React__default["default"].createElement(
212
+ 'style',
213
+ { jsx: 'true' },
214
+ '\n a.doc-group {\n display: block !important;\n padding: 0 !important;\n }\n '
215
+ )
207
216
  )
208
217
  );
209
218
  };
@@ -1057,7 +1066,7 @@ var Article = React__default["default"].memo(React.forwardRef(function (props, r
1057
1066
  ind === 0 ? articleRecsQuery = articleRecsQuery.concat('[\'' + rec + '\', ') : ind === articleRecs.length - 1 ? articleRecsQuery = articleRecsQuery.concat('\'' + rec + '\']]') : articleRecsQuery = articleRecsQuery.concat('\'' + rec + '\', ');
1058
1067
  });
1059
1068
  }
1060
- //next video url
1069
+ // next video url
1061
1070
  if (sliderData) {
1062
1071
  var nextArticle = void 0;
1063
1072
  sliderData.forEach(function (data, index) {
@@ -1741,7 +1750,14 @@ var Article = React__default["default"].memo(React.forwardRef(function (props, r
1741
1750
  ),
1742
1751
  React__default["default"].createElement(
1743
1752
  'div',
1744
- { className: 'mb-3 doc-group-container', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end' } },
1753
+ { className: 'mb-3 doc-group-container',
1754
+ style: {
1755
+ display: 'flex',
1756
+ justifyContent: 'space-between',
1757
+ alignItems: article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText || article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? 'flex-start' : 'flex-end',
1758
+ margin: '0, 0, 1rem, 0'
1759
+ // margin: article.documentGroup && article.documentGroup.thumbnail && article.documentGroup.thumbnail.caption ? '1rem 0 1rem 0' : '0 0 1rem 0'
1760
+ } },
1745
1761
  React__default["default"].createElement(
1746
1762
  'style',
1747
1763
  { jsx: 'true' },
@@ -2227,17 +2243,17 @@ var ArticleQueue = function ArticleQueue(props) {
2227
2243
  document.title = metaTitle;
2228
2244
  //this was throwing an error if there was no description, doing a check for the description meta
2229
2245
  if (document.querySelector('meta[name="description"]')) document.querySelector('meta[name="description"]').setAttribute('content', metaDescription);
2230
- document.querySelector('meta[name="keywords"]').setAttribute('content', oldMeta.shareKeywords);
2231
- document.querySelector('meta[property="og:url"]').setAttribute('content', oldMeta.shareUrl);
2232
- document.querySelector('meta[property="og:title"]').setAttribute('content', metaTitle);
2233
- document.querySelector('meta[property="og:site_name"]').setAttribute('content', oldMeta.shareVia);
2234
- document.querySelector('meta[property="og:description"]').setAttribute('content', metaDescription);
2235
- document.querySelector('meta[name="twitter:title"]').setAttribute('content', metaTitle);
2236
- document.querySelector('meta[name="twitter:image"]').setAttribute('content', oldMeta.shareImage);
2237
- document.querySelector('meta[name="twitter:site"]').setAttribute('content', oldMeta.shareVia);
2246
+ if (document.querySelector('meta[name="keywords"]')) document.querySelector('meta[name="keywords"]').setAttribute('content', oldMeta.shareKeywords);
2247
+ if (document.querySelector('meta[property="og:url"]')) document.querySelector('meta[property="og:url"]').setAttribute('content', oldMeta.shareUrl);
2248
+ if (document.querySelector('meta[property="og:title"]')) document.querySelector('meta[property="og:title"]').setAttribute('content', metaTitle);
2249
+ if (document.querySelector('meta[property="og:site_name"]')) document.querySelector('meta[property="og:site_name"]').setAttribute('content', oldMeta.shareVia);
2250
+ if (document.querySelector('meta[property="og:description"]')) document.querySelector('meta[property="og:description"]').setAttribute('content', metaDescription);
2251
+ if (document.querySelector('meta[name="twitter:title"]')) document.querySelector('meta[name="twitter:title"]').setAttribute('content', metaTitle);
2252
+ if (document.querySelector('meta[name="twitter:image"]')) document.querySelector('meta[name="twitter:image"]').setAttribute('content', oldMeta.shareImage);
2253
+ if (document.querySelector('meta[name="twitter:site"]')) document.querySelector('meta[name="twitter:site"]').setAttribute('content', oldMeta.shareVia);
2238
2254
  //this was throwing an error if there was no description, doing a check for the description meta
2239
2255
  if (document.querySelector('meta[name="twitter:description"]')) document.querySelector('meta[name="twitter:description"]').setAttribute('content', metaDescription);
2240
- if (canonicalTag) {
2256
+ if (canonicalTag && document.querySelector('link[rel="canonical"]')) {
2241
2257
  document.querySelector('link[rel="canonical"]').setAttribute('href', oldMeta.shareUrl);
2242
2258
  }
2243
2259
  };
@@ -2246,17 +2262,17 @@ var ArticleQueue = function ArticleQueue(props) {
2246
2262
  document.title = meta.shareTitle;
2247
2263
  //this was throwing an error if there was no description, doing a check for the description meta
2248
2264
  if (document.querySelector('meta[name="description"]')) document.querySelector('meta[name="description"]').setAttribute('content', meta.shareSummary);
2249
- document.querySelector('meta[name="keywords"]').setAttribute('content', meta.shareKeywords);
2250
- document.querySelector('meta[property="og:url"]').setAttribute('content', meta.shareUrl);
2251
- document.querySelector('meta[property="og:title"]').setAttribute('content', meta.shareTitle);
2252
- document.querySelector('meta[property="og:site_name"]').setAttribute('content', meta.shareVia);
2253
- document.querySelector('meta[property="og:description"]').setAttribute('content', meta.shareSummary);
2254
- document.querySelector('meta[name="twitter:title"]').setAttribute('content', meta.shareTitle);
2255
- document.querySelector('meta[name="twitter:image"]').setAttribute('content', meta.shareImage);
2256
- document.querySelector('meta[name="twitter:site"]').setAttribute('content', meta.shareVia);
2265
+ if (document.querySelector('meta[name="keywords"]')) document.querySelector('meta[name="keywords"]').setAttribute('content', meta.shareKeywords);
2266
+ if (document.querySelector('meta[property="og:url"]')) document.querySelector('meta[property="og:url"]').setAttribute('content', meta.shareUrl);
2267
+ if (document.querySelector('meta[property="og:title"]')) document.querySelector('meta[property="og:title"]').setAttribute('content', meta.shareTitle);
2268
+ if (document.querySelector('meta[property="og:site_name"]')) document.querySelector('meta[property="og:site_name"]').setAttribute('content', meta.shareVia);
2269
+ if (document.querySelector('meta[property="og:description"]')) document.querySelector('meta[property="og:description"]').setAttribute('content', meta.shareSummary);
2270
+ if (document.querySelector('meta[name="twitter:title"]')) document.querySelector('meta[name="twitter:title"]').setAttribute('content', meta.shareTitle);
2271
+ if (document.querySelector('meta[name="twitter:image"]')) document.querySelector('meta[name="twitter:image"]').setAttribute('content', meta.shareImage);
2272
+ if (document.querySelector('meta[name="twitter:site"]')) document.querySelector('meta[name="twitter:site"]').setAttribute('content', meta.shareVia);
2257
2273
  //this was throwing an error if there was no description, doing a check for the description meta
2258
2274
  if (document.querySelector('meta[name="twitter:description"]')) document.querySelector('meta[name="twitter:description"]').setAttribute('content', meta.shareSummary);
2259
- if (canonicalTag) {
2275
+ if (canonicalTag && document.querySelector('link[rel="canonical"]')) {
2260
2276
  document.querySelector('link[rel="canonical"]').setAttribute('href', meta.shareUrl);
2261
2277
  }
2262
2278
  };
package/dist/esm/View.js CHANGED
@@ -179,21 +179,30 @@ var DocumentGroup = function DocumentGroup(_ref) {
179
179
  if (mediaSeriesGroup.thumbnail) {
180
180
  thumbnailUrl = urlFor({ client: client, source: mediaSeriesGroup.thumbnail });
181
181
  }
182
-
182
+ var margin = article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText || article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? 'none' : '1rem';
183
183
  return React__default.createElement(
184
- 'a',
185
- {
186
- href: url,
187
- className: 'doc-group',
188
- style: { display: 'flex', flexDirection: 'column', padding: '0 1rem', justifyContent: thumbnailUrl ? 'center' : 'flex-start', alignItems: 'center' } },
189
- thumbnailUrl && !disableThumbnail && React__default.createElement('img', { style: { maxWidth: '220px', maxHeight: '100px', marginTop: '1rem' }, src: thumbnailUrl, alt: name }),
190
- (disableThumbnail || !thumbnailUrl) && React__default.createElement('p', {
191
- style: { maxWidth: '315px', margin: '0', color: 'var(--primary)', textAlign: thumbnailUrl ? 'center' : main_43 ? 'left' : 'right', marginTop: '.25rem' },
192
- dangerouslySetInnerHTML: { __html: name } }),
193
- main_43 && !thumbnailUrl && React__default.createElement(
194
- 'style',
195
- { jsx: 'true' },
196
- '\n a.doc-group {\n display: block !important;\n padding: 0 !important;\n }\n '
184
+ 'div',
185
+ null,
186
+ React__default.createElement(
187
+ 'p',
188
+ { style: { textAlign: 'center', fontWeight: 600 } },
189
+ article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText ? article.documentGroupMapping[0].parent.parent.contextText : article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? article.documentGroup.parent.parent.contextText : null
190
+ ),
191
+ React__default.createElement(
192
+ 'a',
193
+ {
194
+ href: url,
195
+ className: 'doc-group',
196
+ style: { display: 'flex', flexDirection: 'column', padding: '0 1rem', justifyContent: thumbnailUrl ? 'center' : 'flex-start', alignItems: 'center' } },
197
+ thumbnailUrl && !disableThumbnail && React__default.createElement('img', { style: { maxWidth: '210px', maxHeight: '100px', marginTop: margin }, src: thumbnailUrl, alt: name }),
198
+ (disableThumbnail || !thumbnailUrl) && React__default.createElement('p', {
199
+ style: { maxWidth: '315px', margin: '0', color: 'var(--primary)', textAlign: thumbnailUrl ? 'center' : main_43 ? 'left' : 'right', marginTop: '.25rem' },
200
+ dangerouslySetInnerHTML: { __html: name } }),
201
+ main_43 && !thumbnailUrl && React__default.createElement(
202
+ 'style',
203
+ { jsx: 'true' },
204
+ '\n a.doc-group {\n display: block !important;\n padding: 0 !important;\n }\n '
205
+ )
197
206
  )
198
207
  );
199
208
  };
@@ -1047,7 +1056,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
1047
1056
  ind === 0 ? articleRecsQuery = articleRecsQuery.concat('[\'' + rec + '\', ') : ind === articleRecs.length - 1 ? articleRecsQuery = articleRecsQuery.concat('\'' + rec + '\']]') : articleRecsQuery = articleRecsQuery.concat('\'' + rec + '\', ');
1048
1057
  });
1049
1058
  }
1050
- //next video url
1059
+ // next video url
1051
1060
  if (sliderData) {
1052
1061
  var nextArticle = void 0;
1053
1062
  sliderData.forEach(function (data, index) {
@@ -1731,7 +1740,14 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
1731
1740
  ),
1732
1741
  React__default.createElement(
1733
1742
  'div',
1734
- { className: 'mb-3 doc-group-container', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end' } },
1743
+ { className: 'mb-3 doc-group-container',
1744
+ style: {
1745
+ display: 'flex',
1746
+ justifyContent: 'space-between',
1747
+ alignItems: article.documentGroupMapping && article.documentGroupMapping[0] && article.documentGroupMapping[0].parent && article.documentGroupMapping[0].parent.parent && article.documentGroupMapping[0].parent.parent.contextText || article.documentGroup && article.documentGroup.parent && article.documentGroup.parent.parent && article.documentGroup.parent.parent.contextText ? 'flex-start' : 'flex-end',
1748
+ margin: '0, 0, 1rem, 0'
1749
+ // margin: article.documentGroup && article.documentGroup.thumbnail && article.documentGroup.thumbnail.caption ? '1rem 0 1rem 0' : '0 0 1rem 0'
1750
+ } },
1735
1751
  React__default.createElement(
1736
1752
  'style',
1737
1753
  { jsx: 'true' },
@@ -2217,17 +2233,17 @@ var ArticleQueue = function ArticleQueue(props) {
2217
2233
  document.title = metaTitle;
2218
2234
  //this was throwing an error if there was no description, doing a check for the description meta
2219
2235
  if (document.querySelector('meta[name="description"]')) document.querySelector('meta[name="description"]').setAttribute('content', metaDescription);
2220
- document.querySelector('meta[name="keywords"]').setAttribute('content', oldMeta.shareKeywords);
2221
- document.querySelector('meta[property="og:url"]').setAttribute('content', oldMeta.shareUrl);
2222
- document.querySelector('meta[property="og:title"]').setAttribute('content', metaTitle);
2223
- document.querySelector('meta[property="og:site_name"]').setAttribute('content', oldMeta.shareVia);
2224
- document.querySelector('meta[property="og:description"]').setAttribute('content', metaDescription);
2225
- document.querySelector('meta[name="twitter:title"]').setAttribute('content', metaTitle);
2226
- document.querySelector('meta[name="twitter:image"]').setAttribute('content', oldMeta.shareImage);
2227
- document.querySelector('meta[name="twitter:site"]').setAttribute('content', oldMeta.shareVia);
2236
+ if (document.querySelector('meta[name="keywords"]')) document.querySelector('meta[name="keywords"]').setAttribute('content', oldMeta.shareKeywords);
2237
+ if (document.querySelector('meta[property="og:url"]')) document.querySelector('meta[property="og:url"]').setAttribute('content', oldMeta.shareUrl);
2238
+ if (document.querySelector('meta[property="og:title"]')) document.querySelector('meta[property="og:title"]').setAttribute('content', metaTitle);
2239
+ if (document.querySelector('meta[property="og:site_name"]')) document.querySelector('meta[property="og:site_name"]').setAttribute('content', oldMeta.shareVia);
2240
+ if (document.querySelector('meta[property="og:description"]')) document.querySelector('meta[property="og:description"]').setAttribute('content', metaDescription);
2241
+ if (document.querySelector('meta[name="twitter:title"]')) document.querySelector('meta[name="twitter:title"]').setAttribute('content', metaTitle);
2242
+ if (document.querySelector('meta[name="twitter:image"]')) document.querySelector('meta[name="twitter:image"]').setAttribute('content', oldMeta.shareImage);
2243
+ if (document.querySelector('meta[name="twitter:site"]')) document.querySelector('meta[name="twitter:site"]').setAttribute('content', oldMeta.shareVia);
2228
2244
  //this was throwing an error if there was no description, doing a check for the description meta
2229
2245
  if (document.querySelector('meta[name="twitter:description"]')) document.querySelector('meta[name="twitter:description"]').setAttribute('content', metaDescription);
2230
- if (canonicalTag) {
2246
+ if (canonicalTag && document.querySelector('link[rel="canonical"]')) {
2231
2247
  document.querySelector('link[rel="canonical"]').setAttribute('href', oldMeta.shareUrl);
2232
2248
  }
2233
2249
  };
@@ -2236,17 +2252,17 @@ var ArticleQueue = function ArticleQueue(props) {
2236
2252
  document.title = meta.shareTitle;
2237
2253
  //this was throwing an error if there was no description, doing a check for the description meta
2238
2254
  if (document.querySelector('meta[name="description"]')) document.querySelector('meta[name="description"]').setAttribute('content', meta.shareSummary);
2239
- document.querySelector('meta[name="keywords"]').setAttribute('content', meta.shareKeywords);
2240
- document.querySelector('meta[property="og:url"]').setAttribute('content', meta.shareUrl);
2241
- document.querySelector('meta[property="og:title"]').setAttribute('content', meta.shareTitle);
2242
- document.querySelector('meta[property="og:site_name"]').setAttribute('content', meta.shareVia);
2243
- document.querySelector('meta[property="og:description"]').setAttribute('content', meta.shareSummary);
2244
- document.querySelector('meta[name="twitter:title"]').setAttribute('content', meta.shareTitle);
2245
- document.querySelector('meta[name="twitter:image"]').setAttribute('content', meta.shareImage);
2246
- document.querySelector('meta[name="twitter:site"]').setAttribute('content', meta.shareVia);
2255
+ if (document.querySelector('meta[name="keywords"]')) document.querySelector('meta[name="keywords"]').setAttribute('content', meta.shareKeywords);
2256
+ if (document.querySelector('meta[property="og:url"]')) document.querySelector('meta[property="og:url"]').setAttribute('content', meta.shareUrl);
2257
+ if (document.querySelector('meta[property="og:title"]')) document.querySelector('meta[property="og:title"]').setAttribute('content', meta.shareTitle);
2258
+ if (document.querySelector('meta[property="og:site_name"]')) document.querySelector('meta[property="og:site_name"]').setAttribute('content', meta.shareVia);
2259
+ if (document.querySelector('meta[property="og:description"]')) document.querySelector('meta[property="og:description"]').setAttribute('content', meta.shareSummary);
2260
+ if (document.querySelector('meta[name="twitter:title"]')) document.querySelector('meta[name="twitter:title"]').setAttribute('content', meta.shareTitle);
2261
+ if (document.querySelector('meta[name="twitter:image"]')) document.querySelector('meta[name="twitter:image"]').setAttribute('content', meta.shareImage);
2262
+ if (document.querySelector('meta[name="twitter:site"]')) document.querySelector('meta[name="twitter:site"]').setAttribute('content', meta.shareVia);
2247
2263
  //this was throwing an error if there was no description, doing a check for the description meta
2248
2264
  if (document.querySelector('meta[name="twitter:description"]')) document.querySelector('meta[name="twitter:description"]').setAttribute('content', meta.shareSummary);
2249
- if (canonicalTag) {
2265
+ if (canonicalTag && document.querySelector('link[rel="canonical"]')) {
2250
2266
  document.querySelector('link[rel="canonical"]').setAttribute('href', meta.shareUrl);
2251
2267
  }
2252
2268
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.1009",
3
+ "version": "1.0.1011",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",