@mjhls/mjh-framework 1.0.309 → 1.0.311

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.309
2
+ # mjh-framework v. 1.0.311
3
3
 
4
4
  > Foundation Framework
5
5
 
@@ -18,7 +18,7 @@ var Router = require('next/router');
18
18
  var Router__default = _interopDefault(Router);
19
19
  require('react-dom');
20
20
  require('./index-fa0fb52c.js');
21
- var YoutubeGroup = require('./YoutubeGroup-98ffbc57.js');
21
+ var YoutubeGroup = require('./YoutubeGroup-93aa7a6c.js');
22
22
  var index_esm = require('./index.esm-340d3792.js');
23
23
 
24
24
  var VideoSeriesListing = function (_React$Component) {
@@ -499,6 +499,7 @@ GROQ query -
499
499
  */
500
500
  var YoutubeGroup = function YoutubeGroup(props) {
501
501
  // Props should be an array of objects containing Thumbnail, title, and URL
502
+ var innerSlider = React.useRef(null);
502
503
 
503
504
  React.useEffect(function () {
504
505
  //IE11 Polyfill
@@ -510,22 +511,33 @@ var YoutubeGroup = function YoutubeGroup(props) {
510
511
  function scrollSlider(e, direction) {
511
512
  var slide = e.target.parentElement;
512
513
  var scrollOffset = slide.scrollLeft;
513
- var viewableWidth = slide.clientWidth > 700 ? 3 * (document.querySelector('.tile').scrollWidth + 8) : document.querySelector('.tile').scrollWidth + 8;
514
+ var viewableWidth = slide.clientWidth;
514
515
  var scrollDirection = void 0;
516
+
515
517
  if (direction === 'next') {
516
518
  scrollDirection = scrollOffset + viewableWidth;
519
+
520
+ if (scrollDirection > innerSlider.current.offsetWidth) {
521
+ scrollDirection = 0;
522
+ }
517
523
  }
518
524
  if (direction === 'prev') {
519
525
  scrollDirection = scrollOffset - viewableWidth;
526
+
527
+ if (scrollOffset === 0) {
528
+ scrollDirection = innerSlider.current.offsetWidth;
529
+ }
520
530
  }
521
531
  slide.scrollTo({
522
532
  left: scrollDirection,
523
533
  behavior: 'smooth'
524
534
  });
525
535
  }
536
+
526
537
  function handleClick(url, vidIndex) {
527
538
  props.setState(url, vidIndex);
528
539
  }
540
+
529
541
  var _props$current = props.current,
530
542
  current = _props$current === undefined ? '' : _props$current;
531
543
 
@@ -552,7 +564,7 @@ var YoutubeGroup = function YoutubeGroup(props) {
552
564
  ),
553
565
  React__default.createElement(
554
566
  'div',
555
- { className: 'row__inner' },
567
+ { ref: innerSlider, className: 'row__inner' },
556
568
  props.dataset && props.dataset.map(function (video, index) {
557
569
  // If there is a current prop, means this will overlay a currently playing video
558
570
  if (current !== '') {
@@ -6,7 +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-98ffbc57.js');
9
+ var YoutubeGroup = require('./YoutubeGroup-93aa7a6c.js');
10
10
 
11
11
 
12
12
 
package/dist/cjs/index.js CHANGED
@@ -41,7 +41,7 @@ var ThumbnailCard = require('./ThumbnailCard.js');
41
41
  var TaxonomyCard = require('./TaxonomyCard-a8a64f98.js');
42
42
  require('./react-social-icons-cd0d9d3b.js');
43
43
  var GroupDeck = require('./GroupDeck.js');
44
- var YoutubeGroup = require('./YoutubeGroup-98ffbc57.js');
44
+ var YoutubeGroup = require('./YoutubeGroup-93aa7a6c.js');
45
45
  var reactBootstrap = require('react-bootstrap');
46
46
  var QueueDeckExpanded = require('./QueueDeckExpanded.js');
47
47
  var index_esm = require('./index.esm-340d3792.js');
@@ -12,7 +12,7 @@ import 'next/link';
12
12
  import { withRouter } from 'next/router';
13
13
  import 'react-dom';
14
14
  import './index-5f9f807a.js';
15
- import { Y as YoutubeGroup } from './YoutubeGroup-562ed456.js';
15
+ import { Y as YoutubeGroup } from './YoutubeGroup-e7e16d0e.js';
16
16
  import { a as IoIosArrowForward } from './index.esm-536609db.js';
17
17
 
18
18
  var VideoSeriesListing = function (_React$Component) {
@@ -1,5 +1,5 @@
1
1
  import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers-0c4b6f40.js';
2
- import React__default, { useEffect } from 'react';
2
+ import React__default, { useRef, useEffect } from 'react';
3
3
  import 'next/link';
4
4
  import { L as LazyLoad } from './index-5f9f807a.js';
5
5
 
@@ -494,6 +494,7 @@ GROQ query -
494
494
  */
495
495
  var YoutubeGroup = function YoutubeGroup(props) {
496
496
  // Props should be an array of objects containing Thumbnail, title, and URL
497
+ var innerSlider = useRef(null);
497
498
 
498
499
  useEffect(function () {
499
500
  //IE11 Polyfill
@@ -505,22 +506,33 @@ var YoutubeGroup = function YoutubeGroup(props) {
505
506
  function scrollSlider(e, direction) {
506
507
  var slide = e.target.parentElement;
507
508
  var scrollOffset = slide.scrollLeft;
508
- var viewableWidth = slide.clientWidth > 700 ? 3 * (document.querySelector('.tile').scrollWidth + 8) : document.querySelector('.tile').scrollWidth + 8;
509
+ var viewableWidth = slide.clientWidth;
509
510
  var scrollDirection = void 0;
511
+
510
512
  if (direction === 'next') {
511
513
  scrollDirection = scrollOffset + viewableWidth;
514
+
515
+ if (scrollDirection > innerSlider.current.offsetWidth) {
516
+ scrollDirection = 0;
517
+ }
512
518
  }
513
519
  if (direction === 'prev') {
514
520
  scrollDirection = scrollOffset - viewableWidth;
521
+
522
+ if (scrollOffset === 0) {
523
+ scrollDirection = innerSlider.current.offsetWidth;
524
+ }
515
525
  }
516
526
  slide.scrollTo({
517
527
  left: scrollDirection,
518
528
  behavior: 'smooth'
519
529
  });
520
530
  }
531
+
521
532
  function handleClick(url, vidIndex) {
522
533
  props.setState(url, vidIndex);
523
534
  }
535
+
524
536
  var _props$current = props.current,
525
537
  current = _props$current === undefined ? '' : _props$current;
526
538
 
@@ -547,7 +559,7 @@ var YoutubeGroup = function YoutubeGroup(props) {
547
559
  ),
548
560
  React__default.createElement(
549
561
  'div',
550
- { className: 'row__inner' },
562
+ { ref: innerSlider, className: 'row__inner' },
551
563
  props.dataset && props.dataset.map(function (video, index) {
552
564
  // If there is a current prop, means this will overlay a currently playing video
553
565
  if (current !== '') {
@@ -4,4 +4,4 @@ import 'prop-types';
4
4
  import 'next/link';
5
5
  import 'react-dom';
6
6
  import './index-5f9f807a.js';
7
- export { Y as default } from './YoutubeGroup-562ed456.js';
7
+ export { Y as default } from './YoutubeGroup-e7e16d0e.js';
package/dist/esm/index.js CHANGED
@@ -36,8 +36,8 @@ export { T as TaxonomyCard } from './TaxonomyCard-ea494c28.js';
36
36
  import './react-social-icons-a7d5c5c7.js';
37
37
  import GroupDeck from './GroupDeck.js';
38
38
  export { default as GroupDeck } from './GroupDeck.js';
39
- import { g as getYoutubeId } from './YoutubeGroup-562ed456.js';
40
- export { Y as YoutubeGroup } from './YoutubeGroup-562ed456.js';
39
+ import { g as getYoutubeId } from './YoutubeGroup-e7e16d0e.js';
40
+ export { Y as YoutubeGroup } from './YoutubeGroup-e7e16d0e.js';
41
41
  import { Spinner as Spinner$1, Container as Container$1, Row as Row$1, Col as Col$1, Carousel, Table, Figure as Figure$1, Button as Button$1, ProgressBar, Card, Form } from 'react-bootstrap';
42
42
  export { default as QueueDeckExpanded } from './QueueDeckExpanded.js';
43
43
  import { I as IoMdArrowDropdown } from './index.esm-536609db.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.309",
3
+ "version": "1.0.311",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",