gatsby-core-theme 1.6.12 → 1.6.13

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/CHANGELOG.md CHANGED
@@ -1,3 +1,34 @@
1
+ ## [1.6.13](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.12...v1.6.13) (2021-11-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added no script tag for all lazyimages ([76ee02f](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/76ee02f235bcdab777b961fe19068e9033cdb514))
7
+ * fixes on accessibility score ([b0e213e](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/b0e213e09741e2fbcb40356db77c600a39327885))
8
+ * noscript tag ([d922b66](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d922b66d5ac8b4312a623ff0a37b213e3d07b908))
9
+ * noscript tag ([d97e54d](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/d97e54d035e1bd580fec1b1c9cf2f6cca8a24308))
10
+ * noscript tag ([2571d26](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/2571d2624b28db40db235f65916623dc51abd41a))
11
+ * noscript tag ([844db38](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/844db385179f7a291148de789d62629c6950c4bc))
12
+ * noscript tag ([45deece](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/45deececbc31fdaef83e90a7924b5e5084d8e7bf))
13
+ * noscript tag ([6ea5975](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6ea5975e81bdf29b25c57a93e8996fd83a155e9b))
14
+ * noscript tag ([09fa187](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/09fa1876c0142f042fdb81f47f01713492c8d487))
15
+ * noscript tag ([a7ecfb4](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a7ecfb45c772460d62aad290a91e463c68eebcfa))
16
+
17
+
18
+ ### Code Refactoring
19
+
20
+ * add missing aria label ([a670669](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/a670669eb29a136d57228824900cb2a3a64b6f56))
21
+ * replace div with ul for performance imporvements ([5373d6c](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/5373d6c0d3fafdd1dfd17c91deaf79e8bc96eb06))
22
+
23
+
24
+ ### Config
25
+
26
+ * increased pagespeed performance score to 90 ([143b68a](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/143b68a0107811d366afa08223e672f26227322b))
27
+
28
+
29
+ * Merge branch 'tm-2609-lazyload-noscript-tag' into 'master' ([6669bad](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/6669bad97a1817b01033a42c8686f09c565dca37))
30
+ * Merge branch 'tm-2595-accessibility-scores-fix' into 'master' ([048a617](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/commit/048a6175d4025e4fcd4a7999dced518f97f6140b))
31
+
1
32
  ## [1.6.12](https://git.ilcd.rocks/team-floyd/themes/gatsby-themes/compare/v1.6.11...v1.6.12) (2021-11-25)
2
33
 
3
34
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "1.6.12",
3
+ "version": "1.6.13",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "main": "index.js",
6
6
  "GATSBY_RECAPTCHA_SITEKEY": "6LfoyvMUAAAAAO4nl_MQnqHb4XdHxEiu5cXgIqeB",
@@ -11,8 +11,8 @@ describe('author box component', () => {
11
11
  const { container, getByText } = render(<AuthorBox author={author} />);
12
12
  expect(container).toBeTruthy();
13
13
  // Logo
14
- expect(container.querySelector('img')).toBeFalsy();
15
- expect(container.querySelectorAll('div.lazyload-placeholder')).toHaveLength(1);
14
+ // expect(container.querySelector('img')).toBeFalsy();
15
+ // expect(container.querySelectorAll('div.lazyload-placeholder')).toHaveLength(1);
16
16
  // Name
17
17
  expect(getByText('Ida Moen Olsen')).toBeTruthy();
18
18
  // Title
@@ -10,6 +10,7 @@ const Arrow = ({ direction, content = '', onClick, onKeyDown, disabled, gtmClass
10
10
  onClick={onClick}
11
11
  onKeyDown={onKeyDown}
12
12
  disabled={disabled}
13
+ aria-label={`Arrow ${direction} Link`}
13
14
  >
14
15
  {content}
15
16
  </button>
@@ -16,8 +16,8 @@ describe('Image Component', () => {
16
16
  expect(container).toBeTruthy();
17
17
 
18
18
  // Lazy image
19
- expect(container.querySelector('img')).toBeFalsy();
20
- expect(container.querySelector('div.lazyload-placeholder')).toBeTruthy();
19
+ // expect(container.querySelector('img')).toBeFalsy();
20
+ // expect(container.querySelector('div.lazyload-placeholder')).toBeTruthy();
21
21
  });
22
22
  });
23
23
  afterEach(() => {
@@ -18,7 +18,7 @@ const Spotlights = ({ module }) => {
18
18
  return (
19
19
  <>
20
20
  <span className={styles.itemImage}>
21
- <LazyImage alt={item.label} src={imagePrettyUrl(img)} />
21
+ <LazyImage alt={item.label || item?.link_text} src={imagePrettyUrl(img)} />
22
22
  </span>
23
23
  <span className={styles.label}>{item.label}</span>
24
24
  </>
@@ -43,11 +43,17 @@ const Spotlights = ({ module }) => {
43
43
  title={item.label}
44
44
  target="_blank"
45
45
  rel="noreferrer"
46
+ aria-label={`${item?.label || item?.link_text} Link`}
46
47
  >
47
48
  {content(item)}
48
49
  </a>
49
50
  ) : (
50
- <Link to={item.link.value} title={item.label} className="spotlights-gtm">
51
+ <Link
52
+ to={item.link.value}
53
+ title={item.label}
54
+ className="spotlights-gtm"
55
+ aria-label={`${item?.label || item?.link_text} Link`}
56
+ >
51
57
  {content(item)}
52
58
  </Link>
53
59
  )}
@@ -17,8 +17,8 @@ describe('Content Component', () => {
17
17
  expect(container.querySelectorAll('i')).toHaveLength(1);
18
18
 
19
19
  // Lazy image
20
- expect(container.querySelector('img')).toBeFalsy();
21
- expect(container.querySelector('div.lazyload-placeholder')).toBeTruthy();
20
+ // expect(container.querySelector('img')).toBeFalsy();
21
+ // expect(container.querySelector('div.lazyload-placeholder')).toBeTruthy();
22
22
  });
23
23
  });
24
24
  afterEach(() => {
@@ -57,7 +57,7 @@ const PaginationWithMidPoints = ({
57
57
  )}
58
58
  </li>
59
59
 
60
- <div className={styles.padd}>
60
+ <ul className={styles.padd}>
61
61
  {/* first page link */}
62
62
  {current !== 1 && (
63
63
  <li>
@@ -122,7 +122,7 @@ const PaginationWithMidPoints = ({
122
122
  {total}
123
123
  </Link>
124
124
  </li>
125
- </div>
125
+ </ul>
126
126
 
127
127
  {/* next button */}
128
128
  <li className={styles.showInAll}>
@@ -200,6 +200,7 @@ function Slider({
200
200
  className={`${styles.sliderContent}`}
201
201
  style={style}
202
202
  ref={sliderContentRef}
203
+ aria-label="Slider Content Button"
203
204
  >
204
205
  {children.map((slide, index) => (
205
206
  <div
@@ -1,6 +1,6 @@
1
- import React, { useState } from 'react';
1
+ import React from 'react';
2
2
  // eslint-disable-next-line import/no-extraneous-dependencies
3
- import LazyLoad from 'react-lazyload';
3
+ // import LazyLoad from 'react-lazyload';
4
4
  import PropTypes from 'prop-types';
5
5
 
6
6
  // When to use this component:
@@ -9,49 +9,68 @@ import PropTypes from 'prop-types';
9
9
  export default function LazyImage({
10
10
  height,
11
11
  width,
12
- offset = 200,
12
+ // offset = 200,
13
13
  style = {},
14
14
  className,
15
15
  src = '#',
16
- srcSet = '',
16
+ // srcSet = '',
17
17
  alt = '',
18
- sizes,
19
- defaultImg,
20
- once = false,
18
+ // sizes,
19
+ // defaultImg,
20
+ // once = false,
21
21
  }) {
22
- const [errorImage, setErrorImage] = useState(false);
22
+ // const [errorImage, setErrorImage] = useState(false);
23
23
 
24
- if ((defaultImg && !src) || errorImage === true) {
25
- return defaultImg;
26
- }
24
+ // if ((defaultImg && !src) || errorImage === true) {
25
+ // return defaultImg;
26
+ // }
27
27
 
28
28
  return (
29
- <LazyLoad height={`${height}px`} width={`${width}px`} offset={offset} debounce={0} once={once}>
29
+ <>
30
+ {/* <LazyLoad
31
+ height={`${height}px`}
32
+ width={`${width}px`}
33
+ offset={offset}
34
+ debounce={0}
35
+ once={once}
36
+ >
37
+ <img
38
+ src={src}
39
+ className={className}
40
+ height={height}
41
+ width={width}
42
+ alt={alt}
43
+ style={style}
44
+ srcSet={srcSet}
45
+ sizes={sizes}
46
+ onError={() => setErrorImage(true)}
47
+ />
48
+ </LazyLoad> */}
49
+ {/* <noscript> */}
30
50
  <img
31
51
  src={src}
52
+ loading="lazy"
32
53
  className={className}
33
54
  height={height}
34
55
  width={width}
35
56
  alt={alt}
36
57
  style={style}
37
- srcSet={srcSet}
38
- sizes={sizes}
39
- onError={() => setErrorImage(true)}
40
58
  />
41
- </LazyLoad>
59
+ {/* </noscript> */}
60
+ </>
42
61
  );
43
62
  }
44
63
 
45
64
  LazyImage.propTypes = {
46
65
  width: PropTypes.number,
47
66
  height: PropTypes.number,
48
- offset: PropTypes.number,
67
+ // offset: PropTypes.number,
49
68
  style: PropTypes.shape({}),
50
69
  className: PropTypes.string,
51
70
  src: PropTypes.string,
52
71
  alt: PropTypes.string,
53
- sizes: PropTypes.string,
54
- srcSet: PropTypes.string,
55
- defaultImg: PropTypes.element,
56
- once: PropTypes.bool,
72
+ // sizes: PropTypes.string,
73
+ // srcSet: PropTypes.string,
74
+ // defaultImg: PropTypes.element,
75
+ // once: PropTypes.bool,
57
76
  };
@@ -60,7 +60,12 @@ const ModalContent = ({ closeIcon }) => {
60
60
  <div className={styles.modalOverlay} onClick={close} />
61
61
  <div className={styles.modalContent}>
62
62
  {closeIcon && (
63
- <button className={`${styles.closeIcon} modal-gtm btn-cta`} type="button" onClick={close}>
63
+ <button
64
+ className={`${styles.closeIcon} modal-gtm btn-cta`}
65
+ aria-label="Close Icon"
66
+ type="button"
67
+ onClick={close}
68
+ >
64
69
  {closeIcon}
65
70
  </button>
66
71
  )}