gatsby-matrix-theme 4.0.3 → 5.0.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,58 @@
1
+ ## [5.0.1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v5.0.0...v5.0.1) (2022-03-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add alt tags for carousel and author card ([2f0f4be](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/2f0f4bebd55391205b8580ebe0c6eaef7b7574f8))
7
+ * export the function, to use them in sites if needed ([74672e6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/74672e6453b2be210525461ab7f4cbc398494763))
8
+ * temporarily fix for schema ([a255ed9](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a255ed92ffe4f60cc809201227594c33cf65b2d6))
9
+
10
+
11
+ ### Code Refactoring
12
+
13
+ * use isMobile instead of width ([8e9e4e3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8e9e4e31f01e7e59cebc769e6392011628be844e))
14
+
15
+
16
+ ### Config
17
+
18
+ * update theme version ([b1d896e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b1d896e7d1cd796ad23d848b33f0d50b107deb09))
19
+
20
+
21
+ * Merge branch 'tm-2747-remove-webschema' into 'master' ([e519030](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e5190308df96783c81c384b2afc46f8b3ff5ecb0))
22
+ * Merge branch 'tm-2729-alt-tags' into 'master' ([374c3aa](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/374c3aaba05826d915588359d7c03af61ebc9ba9))
23
+
24
+ # [5.0.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v4.0.4...v5.0.0) (2022-02-28)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * spotlight styling ([d329a15](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d329a15dc62e62aec155fd33e7d0d2a3a0d63fec))
30
+
31
+
32
+ ### Code Refactoring
33
+
34
+ * add active env for demo content deploy ([4f35c35](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4f35c3523b4318971422d942d24102bb8f722ca4))
35
+ * remove anchorTitle ([1bedbc5](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/1bedbc5925ef1a163a569901b55bc9aadf67dc3f))
36
+
37
+
38
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/matrix-theme ([124e121](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/124e12144dbc7feaa11b6499bdf553d3d45337aa))
39
+ * Merge branch 'remove-anchorTitle' into 'master' ([2570a32](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/2570a329997924cc37721bdce3bd8ad2aceeb78d))
40
+ * Merge branch 'tm-2706-custom-demo-deployment' into 'master' ([0f4d6ba](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/0f4d6ba19a809a75cdfabee864c197f791439493))
41
+ * Merge branch 'master' into tm-2706-custom-demo-deployment ([aaf6237](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/aaf6237e6e5b64e1c30224d9ac19be9236c650f3))
42
+
43
+ ## [4.0.4](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v4.0.3...v4.0.4) (2022-02-22)
44
+
45
+
46
+ ### Bug Fixes
47
+
48
+ * add label for anchor title ([43eb394](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/43eb3942cee3dfdaced842f5d765c7a3ba4a4b83))
49
+ * change html structure of anchor ([f56376d](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/f56376d9bf4a527b11f806ed66d3185d46c5f9c1))
50
+ * minor styling fixes ([fed0936](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/fed0936e0a4cc2d396838100bf69408ca82d9497))
51
+
52
+
53
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/matrix-theme ([4fb14fe](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/4fb14fe9b51426c3536119d665994ec289e82f19))
54
+ * Merge branch 'tm-2721-fixhtml-anchor' into 'master' ([032cdb3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/032cdb3a5ec2177cacde594734c41d326b3ec308))
55
+
1
56
  ## [4.0.3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v4.0.2...v4.0.3) (2022-02-22)
2
57
 
3
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "4.0.3",
3
+ "version": "5.0.1",
4
4
  "main": "index.js",
5
5
  "description": "Matrix Theme NPM Package",
6
6
  "author": "",
@@ -31,7 +31,7 @@
31
31
  "cross-env": "^7.0.2",
32
32
  "dotenv": "8.2.0",
33
33
  "gatsby": "^3.3.1",
34
- "gatsby-core-theme": "^4.0.0",
34
+ "gatsby-core-theme": "^5.0.0",
35
35
  "gatsby-image": "^3.3.0",
36
36
  "gatsby-plugin-image": "^1.3.1",
37
37
  "gatsby-plugin-postcss": "^4.3.0",
@@ -6,12 +6,17 @@ import { imagePrettyUrl } from 'gatsby-core-theme/src/helpers/getters';
6
6
  import styles from './author-card.module.scss';
7
7
 
8
8
  const AuthorCard = ({ author, width = 60, height = 60 }) => {
9
- const { name, author_title, email_address, image } = author || {};
9
+ const { name, author_title, email_address, image, image_alt } = author || {};
10
10
 
11
11
  return (
12
12
  <div className={styles.authorCard}>
13
13
  <div className={styles.img}>
14
- <LazyImage src={imagePrettyUrl(image)} alt={name} width={width} height={height} />
14
+ <LazyImage
15
+ src={imagePrettyUrl(image)}
16
+ alt={image_alt || name}
17
+ width={width}
18
+ height={height}
19
+ />
15
20
  </div>
16
21
  <div className={styles.txt}>
17
22
  <div className={styles.name}>{name}</div>
@@ -7,7 +7,7 @@ import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
7
7
  import { imagePrettyUrl } from 'gatsby-core-theme/src/helpers/getters';
8
8
  import styles from './screenshot-slide.module.scss';
9
9
 
10
- const Slide = ({ item = {} }) => (
10
+ const Slide = ({ item = {}, slideTitle = '' }) => (
11
11
  <>
12
12
  {item.image && (
13
13
  <LazyImage
@@ -15,7 +15,7 @@ const Slide = ({ item = {} }) => (
15
15
  height={item?.image_object?.height}
16
16
  className={styles.image}
17
17
  src={imagePrettyUrl(item.image)}
18
- alt={item.title}
18
+ alt={item.title || slideTitle}
19
19
  />
20
20
  )}
21
21
  {item.content && <p className={styles.content}>{parse(item.content)}</p>}
@@ -28,6 +28,7 @@ Slide.propTypes = {
28
28
  content: PropTypes.string,
29
29
  title: PropTypes.string,
30
30
  }),
31
+ slideTitle: PropTypes.string,
31
32
  };
32
33
 
33
34
  export default Slide;
@@ -11,6 +11,7 @@
11
11
  height: 15rem !important;
12
12
  margin: 0 auto;
13
13
  object-fit: cover;
14
+ min-height: 15rem;
14
15
  }
15
16
 
16
17
  > span,
@@ -49,7 +50,7 @@
49
50
  border: 1px solid var(--spotlight-boxes-border-color);
50
51
  background-color: var(--spotlight-boxes-background-color);
51
52
  box-sizing: border-box;
52
- border-radius: .6rem;
53
+ border-radius: var(--spotlight-boxes-border-radius);
53
54
  position: relative;
54
55
  max-width: 568px;
55
56
  margin-left: 4.5rem;
@@ -83,6 +84,8 @@
83
84
  > label {
84
85
  font-size: var(--spotlight-boxes-label-size);
85
86
  color: var(--spotlight-boxes-label-color);
87
+ line-height: var(--spotlight-boxes-label-line-height);
88
+ padding: var(--spotlight-boxes-label-padding);
86
89
  }
87
90
 
88
91
  > div {
@@ -7,7 +7,6 @@ import loadable from '@loadable/component';
7
7
  /* eslint-disable react/prop-types */
8
8
  export const headerContent = (props) => {
9
9
  let ModuleComponent = null;
10
- // const t2st = 'just test'
11
10
 
12
11
  switch (props?.section?.page?.template) {
13
12
  case 'article_detail':
@@ -32,10 +32,11 @@
32
32
  }
33
33
  }
34
34
  }
35
- .storyDivs{
35
+
36
+ .storyDivs {
36
37
  width: 100%;
37
38
  display: block;
38
39
  margin: 3rem 0;
39
40
  background-color: #eee;
40
41
  padding: 2rem;
41
- }
42
+ }
@@ -6,6 +6,7 @@ import styles from './anchor.module.scss';
6
6
 
7
7
  function Anchor({ module: { items }, headerOffset = 80, isFixed = false, icon = null }) {
8
8
  const [isFixedMenu, setIsFixedMenu] = useState(false);
9
+
9
10
  if (isFixed && typeof window !== 'undefined') {
10
11
  window.addEventListener('scroll', () => {
11
12
  const element = document.getElementById('faq-container').offsetTop - 120;
@@ -40,19 +41,21 @@ function Anchor({ module: { items }, headerOffset = 80, isFixed = false, icon =
40
41
  };
41
42
 
42
43
  return (
43
- <div id="faq-container" className={`${styles.anchor} ${isFixedMenu && styles.isFixed}`}>
44
+ <ul id="faq-container" className={`${styles.anchor} ${isFixedMenu && styles.isFixed}`}>
44
45
  {items?.map((anchor) => (
45
- <a
46
- className={`${styles.link} anchor-carousel-gtm anchor-menu-gtm`}
47
- key={keygen()}
48
- onClick={handleClick}
49
- href={`#${anchor.label && anchorLink(anchor?.label?.toLowerCase().trim())}`}
50
- >
51
- {anchor.label}
52
- {icon}
53
- </a>
46
+ <li>
47
+ <a
48
+ className={`${styles.link} anchor-carousel-gtm anchor-menu-gtm`}
49
+ key={keygen()}
50
+ onClick={handleClick}
51
+ href={`#${anchor.label && anchorLink(anchor?.label?.toLowerCase().trim())}`}
52
+ >
53
+ {anchor.label}
54
+ {icon}
55
+ </a>
56
+ </li>
54
57
  ))}
55
- </div>
58
+ </ul>
56
59
  );
57
60
  }
58
61
 
@@ -3,21 +3,23 @@ import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import Slider from 'gatsby-core-theme/src/components/molecules/slider';
5
5
  import keygen from 'gatsby-core-theme/src/helpers/keygen';
6
- import useWindowSize from 'gatsby-core-theme/src/hooks/useWindowSize';
6
+ import { isMobileDevice } from 'gatsby-core-theme/src/helpers/device-detect';
7
7
 
8
8
  import Slide from '../../../../components/molecules/carousel/screenshot-slide';
9
9
 
10
10
  import styles from './carousel.module.scss';
11
11
 
12
- const Carousel = ({ module = {}, settings = {}, gtmClass = '' }) => {
13
- const [width] = useWindowSize();
12
+ const Carousel = ({ page = {}, module = {}, settings = {}, gtmClass = '' }) => {
13
+ const isMobile = isMobileDevice();
14
14
  // render one item per slide
15
15
  const renderOne = (items) => {
16
16
  const arr = [];
17
17
  for (let i = 0; i < items.length; i += 1) {
18
+ const slideTitle = `${page.title}-carousel-${i + 1}`;
19
+
18
20
  arr.push(
19
21
  <div key={keygen()} className={styles.carouselItem}>
20
- <Slide item={items[i]} gtmClass={gtmClass} />
22
+ <Slide item={items[i]} slideTitle={slideTitle} gtmClass={gtmClass} />
21
23
  </div>
22
24
  );
23
25
  }
@@ -30,11 +32,19 @@ const Carousel = ({ module = {}, settings = {}, gtmClass = '' }) => {
30
32
  arr.push(
31
33
  <div className={styles.slide} key={keygen()}>
32
34
  <div key={keygen()} className={styles.carouselItem}>
33
- <Slide item={items[i]} gtmClass={gtmClass} />
35
+ <Slide
36
+ item={items[i]}
37
+ slideTitle={`${page.title}-carousel-${i + 1}`}
38
+ gtmClass={gtmClass}
39
+ />
34
40
  </div>
35
41
  {items[i + 1] && (
36
42
  <div key={keygen()} className={styles.carouselItem}>
37
- <Slide item={items[i + 1]} gtmClass={gtmClass} />
43
+ <Slide
44
+ item={items[i + 1]}
45
+ slideTitle={`${page.title}-carousel-${i + 2}`}
46
+ gtmClass={gtmClass}
47
+ />
38
48
  </div>
39
49
  )}
40
50
  </div>
@@ -43,8 +53,7 @@ const Carousel = ({ module = {}, settings = {}, gtmClass = '' }) => {
43
53
  return arr;
44
54
  };
45
55
 
46
- const renderedItems =
47
- width < 991 && width > 0 ? renderOne(module.items) : renderTwo(module.items);
56
+ const renderedItems = isMobile ? renderOne(module.items) : renderTwo(module.items);
48
57
 
49
58
  return (
50
59
  <div className={styles.carouselContainer}>
@@ -61,6 +70,7 @@ const Carousel = ({ module = {}, settings = {}, gtmClass = '' }) => {
61
70
  };
62
71
 
63
72
  Carousel.propTypes = {
73
+ page: PropTypes.shape({}),
64
74
  module: PropTypes.shape({
65
75
  items: PropTypes.arrayOf(
66
76
  PropTypes.shape({
@@ -21,8 +21,8 @@ function Body({ pageContext, children }) {
21
21
  }
22
22
 
23
23
  if (
24
- document.domain !== `prelive.${process.env.GATSBY_SITE_NAME}` ||
25
- document.domain !== process.env.GATSBY_SITE_NAME ||
24
+ document.domain !== `prelive.${process.env.GATSBY_SITE_NAME}` &&
25
+ document.domain !== process.env.GATSBY_SITE_NAME &&
26
26
  document.domain !== `www.${process.env.GATSBY_SITE_NAME}`
27
27
  ) {
28
28
  // eslint-disable-next-line no-restricted-globals
@@ -0,0 +1,148 @@
1
+ /* eslint-disable import/prefer-default-export */
2
+ import {
3
+ generateSchemaObject,
4
+ breadcrumbsSchema,
5
+ organizationSchema,
6
+ moduleSchemas,
7
+ templateSchemas,
8
+ } from 'gatsby-core-theme/src/helpers/schema';
9
+ import { getUrl, getLanguage } from 'gatsby-core-theme/src/helpers/getters';
10
+
11
+ /* HardCoded Start */
12
+ const isIL = process.env.GATSBY_SITE_NAME === 'irishluck.ie';
13
+ const isNSA = process.env.GATSBY_SITE_NAME === 'norskespilleautomater.com';
14
+ const publishingPrinciples = isIL
15
+ ? 'https://www.irishluck.ie/editorial-principles'
16
+ : 'https://www.norskespilleautomater.com/om-oss/prinsipper';
17
+ const knowsAbout = [
18
+ {
19
+ '@type': 'Thing',
20
+ name: 'Norway',
21
+ sameAs: [
22
+ 'https://no.wikipedia.org/wiki/Norge',
23
+ 'https://www.google.no/search?q=Norge&pws=0&nord=1&hl=no&gl=NO',
24
+ ],
25
+ },
26
+ {
27
+ '@type': 'Thing',
28
+ name: 'LottStift',
29
+ sameAs: [
30
+ 'https://no.wikipedia.org/wiki/Lotteri-_og_stiftelsestilsynet',
31
+ 'https://www.google.no/search?q=lottstift&pws=0&nord=1&hl=no&gl=NO',
32
+ ],
33
+ },
34
+ {
35
+ '@type': 'Thing',
36
+ name: 'Kasino',
37
+ sameAs: [
38
+ 'https://no.wikipedia.org/wiki/Kasino',
39
+ 'https://www.google.no/search?q=Kasino&pws=0&nord=1&hl=no&gl=NO',
40
+ ],
41
+ },
42
+ {
43
+ '@type': 'Thing',
44
+ name: 'Norsk Tipping Kommisjonær',
45
+ sameAs: [
46
+ 'https://no.wikipedia.org/wiki/Norsk_Tipping',
47
+ 'https://www.google.no/search?q=norsk+tipping&pws=0&nord=1&hl=no&gl=NO',
48
+ ],
49
+ },
50
+ ];
51
+
52
+ const socialLinks = [
53
+ 'facebook',
54
+ 'instagram',
55
+ 'linkedin',
56
+ 'spotify',
57
+ 'twitter',
58
+ 'wikipedia',
59
+ 'youtube',
60
+ ];
61
+
62
+ function webPageSchema(page, pageImage) {
63
+ const schema = {
64
+ '@context': 'https://schema.org',
65
+ '@type': 'WebPage',
66
+ '@id': `${getUrl(page.path)}#webpage`,
67
+ url: getUrl(page.path),
68
+ name: page.meta_title || '',
69
+ description: page.meta_description || '',
70
+ inLanguage: getLanguage(page.language),
71
+ datePublished: page.created_at,
72
+ dateModified: page.updated_at,
73
+ isPartOf: {
74
+ '@type': 'WebSite',
75
+ '@id': `${process.env.GATSBY_SITE_URL}#website`,
76
+ url: `${process.env.GATSBY_SITE_URL}`,
77
+ inLanguage: getLanguage(page.language),
78
+ },
79
+ author: {
80
+ '@type': 'Organization',
81
+ name: page.siteSchema?.site_name || '',
82
+ alternateName: page.siteSchema?.alias_site_name || '',
83
+ foundingDate: page.siteSchema?.organization_founding_date || '',
84
+ publishingPrinciples:
85
+ page.siteSchema?.publishing_principles || (isIL || isNSA ? publishingPrinciples : null),
86
+ logo: {
87
+ '@type': 'ImageObject',
88
+ url: pageImage,
89
+ },
90
+ contactPoint: page.authors?.map((author) => ({
91
+ '@type': 'ContactPoint',
92
+ contactType: 'Author',
93
+ name: author.name || '',
94
+ email: author.email_address || '',
95
+ url: getUrl(author.profile_page_path || '/'),
96
+ })),
97
+ sameAs: socialLinks
98
+ .map((socialLink) => page.siteSchema?.[socialLink])
99
+ .filter((socialLink) => socialLink),
100
+ ...(isNSA ? { knowsAbout } : {}),
101
+ },
102
+ };
103
+
104
+ if (pageImage) {
105
+ schema.primaryImageOfPage = {
106
+ '@type': 'ImageObject',
107
+ '@id': `${getUrl(page.path)}#primaryimage`,
108
+ url: pageImage,
109
+ inLanguage: getLanguage(page.language),
110
+ };
111
+ }
112
+
113
+ if (page.seo_keywords) {
114
+ schema.keywords = page.seo_keywords;
115
+ }
116
+
117
+ return JSON.stringify(generateSchemaObject(schema));
118
+ }
119
+
120
+ function schemaGenerator(page = {}, pageImage) {
121
+ const isReviewPage = page.type === 'operator' || page.type === 'game';
122
+ const jsonSchema = [
123
+ // Page Schema
124
+ page.seo_json_schema,
125
+ // Breadcrumbs Schema
126
+ page.breadcrumbs?.length ? breadcrumbsSchema(page.breadcrumbs, page.path) : null,
127
+ // Modules Schemas
128
+ // Temporary Change for removing webpageschema
129
+ !isReviewPage ? webPageSchema(page, pageImage) : null,
130
+ organizationSchema(page, pageImage),
131
+ templateSchemas(page, pageImage),
132
+ ...(page.sections?.main?.modules
133
+ ? moduleSchemas(page.sections.main.modules, page.path)
134
+ : [null]),
135
+ ];
136
+
137
+ return jsonSchema;
138
+ }
139
+
140
+ export {
141
+ generateSchemaObject,
142
+ breadcrumbsSchema,
143
+ organizationSchema,
144
+ moduleSchemas,
145
+ templateSchemas,
146
+ webPageSchema,
147
+ schemaGenerator,
148
+ };
@@ -96,9 +96,12 @@
96
96
  --spotlight-testimonials-text-size: 1.6rem;
97
97
 
98
98
  --spotlight-boxes-border-color: #000;
99
+ --spotlight-boxes-border-radius: 1.6rem;
99
100
  --spotlight-boxes-background-color: #fff;
100
101
  --spotlight-boxes-label-color: #000;
102
+ --spotlight-boxes-label-line-height: 3rem;
101
103
  --spotlight-boxes-label-size: 1.8rem;
104
+ --spotlight-boxes-label-padding: 0;
102
105
  --spotlight-boxes-text-color: #000;
103
106
  --spotlight-boxes-text-size: 1.4rem;
104
107
  }
@@ -135,4 +135,4 @@
135
135
 
136
136
 
137
137
 
138
- window['FEATURES'] = {"postcss":true};</script><script src="runtime~main.c941bf72.iframe.bundle.js"></script><script src="vendors~main.2ee68090.iframe.bundle.js"></script><script src="main.edf8e107.iframe.bundle.js"></script></body></html>
138
+ window['FEATURES'] = {"postcss":true};</script><script src="runtime~main.c941bf72.iframe.bundle.js"></script><script src="vendors~main.ad7c967b.iframe.bundle.js"></script><script src="main.8c1998ba.iframe.bundle.js"></script></body></html>