@mjhls/mjh-framework 1.0.269 → 1.0.270

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 (40) hide show
  1. package/README.md +171 -171
  2. package/dist/cjs/DeckContent.js +9 -9
  3. package/dist/cjs/DeckQueue.js +1 -1
  4. package/dist/cjs/{GridContent-524f2ad8.js → GridContent-81563bbb.js} +2 -2
  5. package/dist/cjs/GridContent.js +2 -2
  6. package/dist/cjs/IssueContentDeck.js +1 -1
  7. package/dist/cjs/IssueDeck.js +1 -1
  8. package/dist/cjs/MasterDeck.js +9 -9
  9. package/dist/cjs/{Normal-6c0b2764.js → Normal-05dd6f72.js} +31 -31
  10. package/dist/cjs/PublicationDeck.js +1 -1
  11. package/dist/cjs/QueueDeckExpanded.js +1 -1
  12. package/dist/cjs/{TaxonomyCard-b5074d6e.js → TaxonomyCard-e3566492.js} +1 -1
  13. package/dist/cjs/TaxonomyCard.js +2 -2
  14. package/dist/cjs/TemplateNormal.js +1 -1
  15. package/dist/cjs/ThumbnailCard.js +1 -1
  16. package/dist/cjs/VideoSeriesListing.js +1 -2
  17. package/dist/cjs/{YoutubeGroup-78e6bcc3.js → YoutubeGroup-94e6efea.js} +437 -5
  18. package/dist/cjs/YoutubeGroup.js +1 -2
  19. package/dist/cjs/{index-39beccb3.js → index-be0c82be.js} +1 -2
  20. package/dist/cjs/index.js +529 -542
  21. package/dist/esm/DeckContent.js +9 -9
  22. package/dist/esm/DeckQueue.js +1 -1
  23. package/dist/esm/{GridContent-f4fd38a7.js → GridContent-b2edf91a.js} +1 -1
  24. package/dist/esm/GridContent.js +2 -2
  25. package/dist/esm/IssueContentDeck.js +1 -1
  26. package/dist/esm/IssueDeck.js +1 -1
  27. package/dist/esm/MasterDeck.js +9 -9
  28. package/dist/esm/{Normal-b7aa5dce.js → Normal-ccc2f7f8.js} +31 -31
  29. package/dist/esm/PublicationDeck.js +1 -1
  30. package/dist/esm/QueueDeckExpanded.js +1 -1
  31. package/dist/esm/{TaxonomyCard-ee1a22ae.js → TaxonomyCard-2d0ab635.js} +1 -1
  32. package/dist/esm/TaxonomyCard.js +2 -2
  33. package/dist/esm/TemplateNormal.js +1 -1
  34. package/dist/esm/ThumbnailCard.js +1 -1
  35. package/dist/esm/VideoSeriesListing.js +1 -2
  36. package/dist/esm/{YoutubeGroup-a87b8967.js → YoutubeGroup-f59297bb.js} +437 -5
  37. package/dist/esm/YoutubeGroup.js +1 -2
  38. package/dist/esm/{index-3849e3fe.js → index-73819142.js} +1 -2
  39. package/dist/esm/index.js +532 -545
  40. package/package.json +103 -103
@@ -19,8 +19,7 @@ var Router = require('next/router');
19
19
  var Router__default = _interopDefault(Router);
20
20
  require('react-dom');
21
21
  require('./index-fa0fb52c.js');
22
- var YoutubeGroup = require('./YoutubeGroup-78e6bcc3.js');
23
- require('smoothscroll-polyfill');
22
+ var YoutubeGroup = require('./YoutubeGroup-94e6efea.js');
24
23
  var index_esm = require('./index.esm-340d3792.js');
25
24
 
26
25
  var VideoSeriesListing = function (_React$Component) {
@@ -7,7 +7,6 @@ var React = require('react');
7
7
  var React__default = _interopDefault(React);
8
8
  require('next/link');
9
9
  var index$2 = require('./index-fa0fb52c.js');
10
- var smoothscroll = _interopDefault(require('smoothscroll-polyfill'));
11
10
 
12
11
  var getYoutubeId = _commonjsHelpers.createCommonjsModule(function (module, exports) {
13
12
  (function (root, factory) {
@@ -58,12 +57,445 @@ var getYoutubeId = _commonjsHelpers.createCommonjsModule(function (module, expor
58
57
  }));
59
58
  });
60
59
 
60
+ var smoothscroll = _commonjsHelpers.createCommonjsModule(function (module, exports) {
61
+ /* smoothscroll v0.4.4 - 2019 - Dustan Kasten, Jeremias Menichelli - MIT License */
62
+ (function () {
63
+
64
+ // polyfill
65
+ function polyfill() {
66
+ // aliases
67
+ var w = window;
68
+ var d = document;
69
+
70
+ // return if scroll behavior is supported and polyfill is not forced
71
+ if (
72
+ 'scrollBehavior' in d.documentElement.style &&
73
+ w.__forceSmoothScrollPolyfill__ !== true
74
+ ) {
75
+ return;
76
+ }
77
+
78
+ // globals
79
+ var Element = w.HTMLElement || w.Element;
80
+ var SCROLL_TIME = 468;
81
+
82
+ // object gathering original scroll methods
83
+ var original = {
84
+ scroll: w.scroll || w.scrollTo,
85
+ scrollBy: w.scrollBy,
86
+ elementScroll: Element.prototype.scroll || scrollElement,
87
+ scrollIntoView: Element.prototype.scrollIntoView
88
+ };
89
+
90
+ // define timing method
91
+ var now =
92
+ w.performance && w.performance.now
93
+ ? w.performance.now.bind(w.performance)
94
+ : Date.now;
95
+
96
+ /**
97
+ * indicates if a the current browser is made by Microsoft
98
+ * @method isMicrosoftBrowser
99
+ * @param {String} userAgent
100
+ * @returns {Boolean}
101
+ */
102
+ function isMicrosoftBrowser(userAgent) {
103
+ var userAgentPatterns = ['MSIE ', 'Trident/', 'Edge/'];
104
+
105
+ return new RegExp(userAgentPatterns.join('|')).test(userAgent);
106
+ }
107
+
108
+ /*
109
+ * IE has rounding bug rounding down clientHeight and clientWidth and
110
+ * rounding up scrollHeight and scrollWidth causing false positives
111
+ * on hasScrollableSpace
112
+ */
113
+ var ROUNDING_TOLERANCE = isMicrosoftBrowser(w.navigator.userAgent) ? 1 : 0;
114
+
115
+ /**
116
+ * changes scroll position inside an element
117
+ * @method scrollElement
118
+ * @param {Number} x
119
+ * @param {Number} y
120
+ * @returns {undefined}
121
+ */
122
+ function scrollElement(x, y) {
123
+ this.scrollLeft = x;
124
+ this.scrollTop = y;
125
+ }
126
+
127
+ /**
128
+ * returns result of applying ease math function to a number
129
+ * @method ease
130
+ * @param {Number} k
131
+ * @returns {Number}
132
+ */
133
+ function ease(k) {
134
+ return 0.5 * (1 - Math.cos(Math.PI * k));
135
+ }
136
+
137
+ /**
138
+ * indicates if a smooth behavior should be applied
139
+ * @method shouldBailOut
140
+ * @param {Number|Object} firstArg
141
+ * @returns {Boolean}
142
+ */
143
+ function shouldBailOut(firstArg) {
144
+ if (
145
+ firstArg === null ||
146
+ typeof firstArg !== 'object' ||
147
+ firstArg.behavior === undefined ||
148
+ firstArg.behavior === 'auto' ||
149
+ firstArg.behavior === 'instant'
150
+ ) {
151
+ // first argument is not an object/null
152
+ // or behavior is auto, instant or undefined
153
+ return true;
154
+ }
155
+
156
+ if (typeof firstArg === 'object' && firstArg.behavior === 'smooth') {
157
+ // first argument is an object and behavior is smooth
158
+ return false;
159
+ }
160
+
161
+ // throw error when behavior is not supported
162
+ throw new TypeError(
163
+ 'behavior member of ScrollOptions ' +
164
+ firstArg.behavior +
165
+ ' is not a valid value for enumeration ScrollBehavior.'
166
+ );
167
+ }
168
+
169
+ /**
170
+ * indicates if an element has scrollable space in the provided axis
171
+ * @method hasScrollableSpace
172
+ * @param {Node} el
173
+ * @param {String} axis
174
+ * @returns {Boolean}
175
+ */
176
+ function hasScrollableSpace(el, axis) {
177
+ if (axis === 'Y') {
178
+ return el.clientHeight + ROUNDING_TOLERANCE < el.scrollHeight;
179
+ }
180
+
181
+ if (axis === 'X') {
182
+ return el.clientWidth + ROUNDING_TOLERANCE < el.scrollWidth;
183
+ }
184
+ }
185
+
186
+ /**
187
+ * indicates if an element has a scrollable overflow property in the axis
188
+ * @method canOverflow
189
+ * @param {Node} el
190
+ * @param {String} axis
191
+ * @returns {Boolean}
192
+ */
193
+ function canOverflow(el, axis) {
194
+ var overflowValue = w.getComputedStyle(el, null)['overflow' + axis];
195
+
196
+ return overflowValue === 'auto' || overflowValue === 'scroll';
197
+ }
198
+
199
+ /**
200
+ * indicates if an element can be scrolled in either axis
201
+ * @method isScrollable
202
+ * @param {Node} el
203
+ * @param {String} axis
204
+ * @returns {Boolean}
205
+ */
206
+ function isScrollable(el) {
207
+ var isScrollableY = hasScrollableSpace(el, 'Y') && canOverflow(el, 'Y');
208
+ var isScrollableX = hasScrollableSpace(el, 'X') && canOverflow(el, 'X');
209
+
210
+ return isScrollableY || isScrollableX;
211
+ }
212
+
213
+ /**
214
+ * finds scrollable parent of an element
215
+ * @method findScrollableParent
216
+ * @param {Node} el
217
+ * @returns {Node} el
218
+ */
219
+ function findScrollableParent(el) {
220
+ while (el !== d.body && isScrollable(el) === false) {
221
+ el = el.parentNode || el.host;
222
+ }
223
+
224
+ return el;
225
+ }
226
+
227
+ /**
228
+ * self invoked function that, given a context, steps through scrolling
229
+ * @method step
230
+ * @param {Object} context
231
+ * @returns {undefined}
232
+ */
233
+ function step(context) {
234
+ var time = now();
235
+ var value;
236
+ var currentX;
237
+ var currentY;
238
+ var elapsed = (time - context.startTime) / SCROLL_TIME;
239
+
240
+ // avoid elapsed times higher than one
241
+ elapsed = elapsed > 1 ? 1 : elapsed;
242
+
243
+ // apply easing to elapsed time
244
+ value = ease(elapsed);
245
+
246
+ currentX = context.startX + (context.x - context.startX) * value;
247
+ currentY = context.startY + (context.y - context.startY) * value;
248
+
249
+ context.method.call(context.scrollable, currentX, currentY);
250
+
251
+ // scroll more if we have not reached our destination
252
+ if (currentX !== context.x || currentY !== context.y) {
253
+ w.requestAnimationFrame(step.bind(w, context));
254
+ }
255
+ }
256
+
257
+ /**
258
+ * scrolls window or element with a smooth behavior
259
+ * @method smoothScroll
260
+ * @param {Object|Node} el
261
+ * @param {Number} x
262
+ * @param {Number} y
263
+ * @returns {undefined}
264
+ */
265
+ function smoothScroll(el, x, y) {
266
+ var scrollable;
267
+ var startX;
268
+ var startY;
269
+ var method;
270
+ var startTime = now();
271
+
272
+ // define scroll context
273
+ if (el === d.body) {
274
+ scrollable = w;
275
+ startX = w.scrollX || w.pageXOffset;
276
+ startY = w.scrollY || w.pageYOffset;
277
+ method = original.scroll;
278
+ } else {
279
+ scrollable = el;
280
+ startX = el.scrollLeft;
281
+ startY = el.scrollTop;
282
+ method = scrollElement;
283
+ }
284
+
285
+ // scroll looping over a frame
286
+ step({
287
+ scrollable: scrollable,
288
+ method: method,
289
+ startTime: startTime,
290
+ startX: startX,
291
+ startY: startY,
292
+ x: x,
293
+ y: y
294
+ });
295
+ }
296
+
297
+ // ORIGINAL METHODS OVERRIDES
298
+ // w.scroll and w.scrollTo
299
+ w.scroll = w.scrollTo = function() {
300
+ // avoid action when no arguments are passed
301
+ if (arguments[0] === undefined) {
302
+ return;
303
+ }
304
+
305
+ // avoid smooth behavior if not required
306
+ if (shouldBailOut(arguments[0]) === true) {
307
+ original.scroll.call(
308
+ w,
309
+ arguments[0].left !== undefined
310
+ ? arguments[0].left
311
+ : typeof arguments[0] !== 'object'
312
+ ? arguments[0]
313
+ : w.scrollX || w.pageXOffset,
314
+ // use top prop, second argument if present or fallback to scrollY
315
+ arguments[0].top !== undefined
316
+ ? arguments[0].top
317
+ : arguments[1] !== undefined
318
+ ? arguments[1]
319
+ : w.scrollY || w.pageYOffset
320
+ );
321
+
322
+ return;
323
+ }
324
+
325
+ // LET THE SMOOTHNESS BEGIN!
326
+ smoothScroll.call(
327
+ w,
328
+ d.body,
329
+ arguments[0].left !== undefined
330
+ ? ~~arguments[0].left
331
+ : w.scrollX || w.pageXOffset,
332
+ arguments[0].top !== undefined
333
+ ? ~~arguments[0].top
334
+ : w.scrollY || w.pageYOffset
335
+ );
336
+ };
337
+
338
+ // w.scrollBy
339
+ w.scrollBy = function() {
340
+ // avoid action when no arguments are passed
341
+ if (arguments[0] === undefined) {
342
+ return;
343
+ }
344
+
345
+ // avoid smooth behavior if not required
346
+ if (shouldBailOut(arguments[0])) {
347
+ original.scrollBy.call(
348
+ w,
349
+ arguments[0].left !== undefined
350
+ ? arguments[0].left
351
+ : typeof arguments[0] !== 'object' ? arguments[0] : 0,
352
+ arguments[0].top !== undefined
353
+ ? arguments[0].top
354
+ : arguments[1] !== undefined ? arguments[1] : 0
355
+ );
356
+
357
+ return;
358
+ }
359
+
360
+ // LET THE SMOOTHNESS BEGIN!
361
+ smoothScroll.call(
362
+ w,
363
+ d.body,
364
+ ~~arguments[0].left + (w.scrollX || w.pageXOffset),
365
+ ~~arguments[0].top + (w.scrollY || w.pageYOffset)
366
+ );
367
+ };
368
+
369
+ // Element.prototype.scroll and Element.prototype.scrollTo
370
+ Element.prototype.scroll = Element.prototype.scrollTo = function() {
371
+ // avoid action when no arguments are passed
372
+ if (arguments[0] === undefined) {
373
+ return;
374
+ }
375
+
376
+ // avoid smooth behavior if not required
377
+ if (shouldBailOut(arguments[0]) === true) {
378
+ // if one number is passed, throw error to match Firefox implementation
379
+ if (typeof arguments[0] === 'number' && arguments[1] === undefined) {
380
+ throw new SyntaxError('Value could not be converted');
381
+ }
382
+
383
+ original.elementScroll.call(
384
+ this,
385
+ // use left prop, first number argument or fallback to scrollLeft
386
+ arguments[0].left !== undefined
387
+ ? ~~arguments[0].left
388
+ : typeof arguments[0] !== 'object' ? ~~arguments[0] : this.scrollLeft,
389
+ // use top prop, second argument or fallback to scrollTop
390
+ arguments[0].top !== undefined
391
+ ? ~~arguments[0].top
392
+ : arguments[1] !== undefined ? ~~arguments[1] : this.scrollTop
393
+ );
394
+
395
+ return;
396
+ }
397
+
398
+ var left = arguments[0].left;
399
+ var top = arguments[0].top;
400
+
401
+ // LET THE SMOOTHNESS BEGIN!
402
+ smoothScroll.call(
403
+ this,
404
+ this,
405
+ typeof left === 'undefined' ? this.scrollLeft : ~~left,
406
+ typeof top === 'undefined' ? this.scrollTop : ~~top
407
+ );
408
+ };
409
+
410
+ // Element.prototype.scrollBy
411
+ Element.prototype.scrollBy = function() {
412
+ // avoid action when no arguments are passed
413
+ if (arguments[0] === undefined) {
414
+ return;
415
+ }
416
+
417
+ // avoid smooth behavior if not required
418
+ if (shouldBailOut(arguments[0]) === true) {
419
+ original.elementScroll.call(
420
+ this,
421
+ arguments[0].left !== undefined
422
+ ? ~~arguments[0].left + this.scrollLeft
423
+ : ~~arguments[0] + this.scrollLeft,
424
+ arguments[0].top !== undefined
425
+ ? ~~arguments[0].top + this.scrollTop
426
+ : ~~arguments[1] + this.scrollTop
427
+ );
428
+
429
+ return;
430
+ }
431
+
432
+ this.scroll({
433
+ left: ~~arguments[0].left + this.scrollLeft,
434
+ top: ~~arguments[0].top + this.scrollTop,
435
+ behavior: arguments[0].behavior
436
+ });
437
+ };
438
+
439
+ // Element.prototype.scrollIntoView
440
+ Element.prototype.scrollIntoView = function() {
441
+ // avoid smooth behavior if not required
442
+ if (shouldBailOut(arguments[0]) === true) {
443
+ original.scrollIntoView.call(
444
+ this,
445
+ arguments[0] === undefined ? true : arguments[0]
446
+ );
447
+
448
+ return;
449
+ }
450
+
451
+ // LET THE SMOOTHNESS BEGIN!
452
+ var scrollableParent = findScrollableParent(this);
453
+ var parentRects = scrollableParent.getBoundingClientRect();
454
+ var clientRects = this.getBoundingClientRect();
455
+
456
+ if (scrollableParent !== d.body) {
457
+ // reveal element inside parent
458
+ smoothScroll.call(
459
+ this,
460
+ scrollableParent,
461
+ scrollableParent.scrollLeft + clientRects.left - parentRects.left,
462
+ scrollableParent.scrollTop + clientRects.top - parentRects.top
463
+ );
464
+
465
+ // reveal parent in viewport unless is fixed
466
+ if (w.getComputedStyle(scrollableParent).position !== 'fixed') {
467
+ w.scrollBy({
468
+ left: parentRects.left,
469
+ top: parentRects.top,
470
+ behavior: 'smooth'
471
+ });
472
+ }
473
+ } else {
474
+ // reveal element in viewport
475
+ w.scrollBy({
476
+ left: clientRects.left,
477
+ top: clientRects.top,
478
+ behavior: 'smooth'
479
+ });
480
+ }
481
+ };
482
+ }
483
+
484
+ {
485
+ // commonjs
486
+ module.exports = { polyfill: polyfill };
487
+ }
488
+
489
+ }());
490
+ });
491
+ var smoothscroll_1 = smoothscroll.polyfill;
492
+
61
493
  // kick off the polyfill!
62
494
 
63
- /*
64
- GROQ query -
65
- accepts an array of title, URL
66
- `https://img.youtube.com/vi/${getYouTubeId(vid.url)}/hqdefault.jpg`
495
+ /*
496
+ GROQ query -
497
+ accepts an array of title, URL
498
+ `https://img.youtube.com/vi/${getYouTubeId(vid.url)}/hqdefault.jpg`
67
499
  */
68
500
  var YoutubeGroup = function YoutubeGroup(props) {
69
501
  // Props should be an array of objects containing Thumbnail, title, and URL
@@ -6,8 +6,7 @@ require('prop-types');
6
6
  require('next/link');
7
7
  require('react-dom');
8
8
  require('./index-fa0fb52c.js');
9
- var YoutubeGroup = require('./YoutubeGroup-78e6bcc3.js');
10
- require('smoothscroll-polyfill');
9
+ var YoutubeGroup = require('./YoutubeGroup-94e6efea.js');
11
10
 
12
11
 
13
12
 
@@ -377,8 +377,7 @@ function urlBuilder(options) {
377
377
  var client = options;
378
378
  if (isSanityClient(client)) {
379
379
  // Inherit config from client
380
- var _a = client.clientConfig, apiUrl = _a.apiHost, projectId = _a.projectId, dataset = _a.dataset;
381
- var apiHost = apiUrl || 'https://api.sanity.io';
380
+ var _a = client.clientConfig, apiHost = _a.apiHost, projectId = _a.projectId, dataset = _a.dataset;
382
381
  return new ImageUrlBuilder(null, {
383
382
  baseUrl: apiHost.replace(/^https:\/\/api\./, 'https://cdn.'),
384
383
  projectId: projectId,