@mjhls/mjh-framework 1.0.694-beta.0 → 1.0.694-beta.1

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.
Files changed (46) hide show
  1. package/dist/cjs/View.js +175 -136
  2. package/dist/cjs/getQuery.js +2 -2
  3. package/dist/cjs/getRelatedArticle.js +29 -57
  4. package/dist/cjs/index.js +82 -5
  5. package/dist/esm/AD300x250.js +1 -1
  6. package/dist/esm/AD300x250x600.js +1 -1
  7. package/dist/esm/AD728x90.js +1 -1
  8. package/dist/esm/ADFloatingFooter.js +1 -1
  9. package/dist/esm/ADGutter.js +1 -1
  10. package/dist/esm/ADSkyscraper.js +1 -1
  11. package/dist/esm/ADSponsoredResources.js +1 -1
  12. package/dist/esm/ADWebcast.js +1 -1
  13. package/dist/esm/ADWelcome.js +1 -1
  14. package/dist/esm/AdSlot.js +1 -1
  15. package/dist/esm/Auth.js +1 -1
  16. package/dist/esm/Beam.js +1 -1
  17. package/dist/esm/CMEDeck.js +1 -1
  18. package/dist/esm/Column2.js +1 -1
  19. package/dist/esm/Column3.js +1 -1
  20. package/dist/esm/DeckContent.js +2 -2
  21. package/dist/esm/ExternalResources.js +2 -2
  22. package/dist/esm/GridContent.js +3 -3
  23. package/dist/esm/HamMagazine.js +1 -1
  24. package/dist/esm/IssueLanding.js +3 -3
  25. package/dist/esm/LeftNav.js +1 -1
  26. package/dist/esm/MasterDeck.js +3 -3
  27. package/dist/esm/NavDvm.js +1 -1
  28. package/dist/esm/NavMagazine.js +1 -1
  29. package/dist/esm/NavNative.js +1 -1
  30. package/dist/esm/NavNormal.js +1 -1
  31. package/dist/esm/PartnerDetailListing.js +4 -4
  32. package/dist/esm/QueueDeckExpanded.js +3 -3
  33. package/dist/esm/Segment.js +1 -1
  34. package/dist/esm/SideFooter.js +1 -1
  35. package/dist/esm/TemplateNormal.js +1 -1
  36. package/dist/esm/VideoSeriesFilter.js +1 -1
  37. package/dist/esm/View.js +177 -138
  38. package/dist/esm/{asyncToGenerator-7c654f36.js → asyncToGenerator-d0f08f8d.js} +1 -1
  39. package/dist/esm/getQuery.js +2 -2
  40. package/dist/esm/getRelatedArticle.js +30 -58
  41. package/dist/esm/getSerializers.js +2 -2
  42. package/dist/esm/index.js +86 -8
  43. package/package.json +1 -1
  44. /package/dist/esm/{ADInfeed-eae71d07.js → ADInfeed-d46be909.js} +0 -0
  45. /package/dist/esm/{ADlgInfeed-c619fe64.js → ADlgInfeed-5d1bce95.js} +0 -0
  46. /package/dist/esm/{index-c376cd8e.js → index-aad92b92.js} +0 -0
package/dist/esm/index.js CHANGED
@@ -6,14 +6,14 @@ import './_iter-detect-59409a32.js';
6
6
  import './toConsumableArray-725434a0.js';
7
7
  import './core.get-iterator-method-54d2e411.js';
8
8
  import './_object-pie-71ac75a4.js';
9
- import './extends-cc5da797.js';
9
+ import { _ as _extends, a as _Object$assign } from './extends-cc5da797.js';
10
10
  import './_object-sap-4d59d5bd.js';
11
11
  import './inherits-7ee3e0c1.js';
12
12
  import './define-property-de3fc946.js';
13
13
  import './web.dom.iterable-8956f9a5.js';
14
14
  import './typeof-08f2c380.js';
15
15
  import './_is-array-49698029.js';
16
- import 'react';
16
+ import React__default from 'react';
17
17
  import './index-0e45a0b2.js';
18
18
  import 'prop-types';
19
19
  import 'react-bootstrap/Container';
@@ -33,15 +33,15 @@ import './main-5d1e4bd3.js';
33
33
  import './entities-7cc3bf45.js';
34
34
  import './stringify-008c8802.js';
35
35
  import './slicedToArray-7021e5df.js';
36
- import './asyncToGenerator-7c654f36.js';
36
+ import { _ as _asyncToGenerator, r as regenerator } from './asyncToGenerator-d0f08f8d.js';
37
37
  import './_set-species-cede29f8.js';
38
38
  export { default as Segment } from './Segment.js';
39
39
  export { default as Beam } from './Beam.js';
40
40
  export { default as AdSlot } from './AdSlot.js';
41
- import './ADInfeed-eae71d07.js';
41
+ import './ADInfeed-d46be909.js';
42
42
  export { default as DeckContent } from './DeckContent.js';
43
43
  import './lodash-17fdfebb.js';
44
- import './ADlgInfeed-c619fe64.js';
44
+ import './ADlgInfeed-5d1bce95.js';
45
45
  import './getContentCategory-15dcc413.js';
46
46
  import './get-5ee14cda.js';
47
47
  export { default as AD } from './AD.js';
@@ -50,7 +50,7 @@ export { default as GridContent } from './GridContent.js';
50
50
  export { default as DeckQueue } from './DeckQueue.js';
51
51
  import 'react-bootstrap/Media';
52
52
  export { default as ThumbnailCard } from './ThumbnailCard.js';
53
- import './BlockContent-e9b4ddcf.js';
53
+ import { B as BlockContent } from './BlockContent-e9b4ddcf.js';
54
54
  import './react-social-icons-a7d5c5c7.js';
55
55
  export { default as TaxonomyCard } from './TaxonomyCard.js';
56
56
  export { default as RolesDeck } from './RolesDeck.js';
@@ -79,11 +79,12 @@ import 'react-bootstrap/Form';
79
79
  import './index-ef6d5dcf.js';
80
80
  import './js.cookie-6874175c.js';
81
81
  export { default as CMEDeck } from './CMEDeck.js';
82
- export { g as getSerializers } from './index-c376cd8e.js';
82
+ import { g as getSerializers } from './index-aad92b92.js';
83
+ export { g as getSerializers } from './index-aad92b92.js';
83
84
  import './util-7700fc59.js';
84
85
  import './brightcove-react-player-loader.es-83f53e4e.js';
85
86
  import 'react-bootstrap/Pagination';
86
- import 'next/head';
87
+ import Head from 'next/head';
87
88
  export { default as ExternalResources } from './ExternalResources.js';
88
89
  export { Column1 } from './Column1.js';
89
90
  export { default as SideFooter } from './SideFooter.js';
@@ -170,3 +171,80 @@ export { default as getKeywords } from './getKeywords.js';
170
171
  export { default as urlFor } from './urlFor.js';
171
172
  import './style-inject.es-1f59c1d0.js';
172
173
  export { default as PartnerDetailListing } from './PartnerDetailListing.js';
174
+
175
+ var _this = undefined;
176
+
177
+ var blocksToText = function blocksToText(blocks) {
178
+ var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
179
+
180
+ var defaults = { nonTextBehavior: 'remove' };
181
+ var options = _Object$assign({}, defaults, opts);
182
+ return blocks.map(function (block) {
183
+ if (block._type !== 'block' || !block.children) {
184
+ return options.nonTextBehavior === 'remove' ? '' : '[' + block._type + ' block]';
185
+ }
186
+ return block.children.map(function (child) {
187
+ return child.text;
188
+ }).join('');
189
+ }).join('\n\n');
190
+ };
191
+
192
+ var TaxonomyDescription = function TaxonomyDescription(_ref) {
193
+ var data = _ref.data,
194
+ client = _ref.client;
195
+
196
+ return data && data.length > 0 && React__default.createElement(
197
+ 'section',
198
+ { className: 'taxonomy-description' },
199
+ React__default.createElement(
200
+ Head,
201
+ null,
202
+ React__default.createElement('meta', { name: 'description', content: blocksToText(data), key: 'description' })
203
+ ),
204
+ React__default.createElement(BlockContent, _extends({ serializers: getSerializers(client), blocks: data, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
205
+ );
206
+ };
207
+
208
+ TaxonomyDescription.getDescription = function () {
209
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
210
+ var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
211
+ var client = arguments[1];
212
+ var query, summary;
213
+ return regenerator.wrap(function _callee$(_context) {
214
+ while (1) {
215
+ switch (_context.prev = _context.next) {
216
+ case 0:
217
+ query = '*[_type == \'taxonomy\' && identifier == \'' + url + '\'][0].summary';
218
+ summary = [];
219
+ _context.prev = 2;
220
+ _context.next = 5;
221
+ return client.fetch(query);
222
+
223
+ case 5:
224
+ summary = _context.sent;
225
+ _context.next = 11;
226
+ break;
227
+
228
+ case 8:
229
+ _context.prev = 8;
230
+ _context.t0 = _context['catch'](2);
231
+
232
+ console.error(_context.t0);
233
+
234
+ case 11:
235
+ return _context.abrupt('return', summary);
236
+
237
+ case 12:
238
+ case 'end':
239
+ return _context.stop();
240
+ }
241
+ }
242
+ }, _callee, _this, [[2, 8]]);
243
+ }));
244
+
245
+ return function () {
246
+ return _ref2.apply(this, arguments);
247
+ };
248
+ }();
249
+
250
+ export { TaxonomyDescription };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.694-beta.0",
3
+ "version": "1.0.694-beta.1",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",