gatsby-matrix-theme 5.0.0 → 5.0.3

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 (26) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/package.json +2 -2
  3. package/src/components/atoms/author-card/index.js +7 -2
  4. package/src/components/molecules/carousel/screenshot-slide/index.js +3 -2
  5. package/src/gatsby-core-theme/components/molecules/content/content.module.scss +16 -16
  6. package/src/gatsby-core-theme/components/organisms/carousel/index.js +18 -8
  7. package/src/gatsby-core-theme/helpers/schema.js +148 -0
  8. package/storybook/public/{0.d24a0c90.iframe.bundle.js → 0.400d2cc7.iframe.bundle.js} +1 -1
  9. package/storybook/public/{5.d5718771.iframe.bundle.js → 5.69290c4d.iframe.bundle.js} +3 -3
  10. package/storybook/public/{5.d5718771.iframe.bundle.js.LICENSE.txt → 5.69290c4d.iframe.bundle.js.LICENSE.txt} +0 -0
  11. package/storybook/public/5.69290c4d.iframe.bundle.js.map +1 -0
  12. package/storybook/public/{6.064e5aae.iframe.bundle.js → 6.f9ecbc78.iframe.bundle.js} +1 -1
  13. package/storybook/public/{9.1c63a217.iframe.bundle.js → 9.16798c74.iframe.bundle.js} +3 -3
  14. package/storybook/public/{9.1c63a217.iframe.bundle.js.LICENSE.txt → 9.16798c74.iframe.bundle.js.LICENSE.txt} +0 -0
  15. package/storybook/public/9.16798c74.iframe.bundle.js.map +1 -0
  16. package/storybook/public/iframe.html +1 -1
  17. package/storybook/public/main.f82095a3.iframe.bundle.js +1 -0
  18. package/storybook/public/{runtime~main.c941bf72.iframe.bundle.js → runtime~main.49c0e350.iframe.bundle.js} +1 -1
  19. package/storybook/public/vendors~main.1d2b4145.iframe.bundle.js +7 -0
  20. package/storybook/public/{vendors~main.2ee68090.iframe.bundle.js.LICENSE.txt → vendors~main.1d2b4145.iframe.bundle.js.LICENSE.txt} +0 -0
  21. package/storybook/public/vendors~main.1d2b4145.iframe.bundle.js.map +1 -0
  22. package/storybook/public/5.d5718771.iframe.bundle.js.map +0 -1
  23. package/storybook/public/9.1c63a217.iframe.bundle.js.map +0 -1
  24. package/storybook/public/main.edf8e107.iframe.bundle.js +0 -1
  25. package/storybook/public/vendors~main.2ee68090.iframe.bundle.js +0 -7
  26. package/storybook/public/vendors~main.2ee68090.iframe.bundle.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,45 @@
1
+ ## [5.0.3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v5.0.2...v5.0.3) (2022-03-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * disabled lighthouse ci ([d7441fd](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/d7441fdf0436830cd7b9ccedd825ec05ac38b91a))
7
+ * updated core theme version ([bcd29f1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/bcd29f1fd79b72f16f80cda24cf66c8e4c052999))
8
+
9
+
10
+ * Merge branch 'master' of git.ilcd.rocks:team-floyd/themes/matrix-theme ([9588ad3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9588ad383c36d88df71811eccc348f1092b5e211))
11
+
12
+ ## [5.0.2](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v5.0.1...v5.0.2) (2022-03-02)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * content frame styling ([9bfb496](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/9bfb4969fc1408b29a71300935a381fe7818eaa7))
18
+ * updated core theme ([71588bf](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/71588bfa5c26fc76ac9dbbadd64fc8215608ddd3))
19
+
20
+ ## [5.0.1](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v5.0.0...v5.0.1) (2022-03-02)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * add alt tags for carousel and author card ([2f0f4be](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/2f0f4bebd55391205b8580ebe0c6eaef7b7574f8))
26
+ * export the function, to use them in sites if needed ([74672e6](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/74672e6453b2be210525461ab7f4cbc398494763))
27
+ * temporarily fix for schema ([a255ed9](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/a255ed92ffe4f60cc809201227594c33cf65b2d6))
28
+
29
+
30
+ ### Code Refactoring
31
+
32
+ * use isMobile instead of width ([8e9e4e3](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/8e9e4e31f01e7e59cebc769e6392011628be844e))
33
+
34
+
35
+ ### Config
36
+
37
+ * update theme version ([b1d896e](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/b1d896e7d1cd796ad23d848b33f0d50b107deb09))
38
+
39
+
40
+ * Merge branch 'tm-2747-remove-webschema' into 'master' ([e519030](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/e5190308df96783c81c384b2afc46f8b3ff5ecb0))
41
+ * Merge branch 'tm-2729-alt-tags' into 'master' ([374c3aa](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/commit/374c3aaba05826d915588359d7c03af61ebc9ba9))
42
+
1
43
  # [5.0.0](https://git.ilcd.rocks/team-floyd/themes/matrix-theme/compare/v4.0.4...v5.0.0) (2022-02-28)
2
44
 
3
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-matrix-theme",
3
- "version": "5.0.0",
3
+ "version": "5.0.3",
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.2",
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;
@@ -193,6 +193,22 @@
193
193
  }
194
194
  }
195
195
 
196
+ .contentFrame {
197
+ background-color: #E0EAEA;
198
+ padding: 1.6rem 2.4rem 2.4rem;
199
+ border-radius: .8rem;
200
+ box-sizing: border-box;
201
+ img {
202
+ border-radius: .8rem;
203
+ }
204
+ @include max(mobile) {
205
+ img {
206
+ margin-left: 0;
207
+ width: 100%;
208
+ }
209
+ }
210
+ }
211
+
196
212
  ul,
197
213
  ol {
198
214
  color: var(--color-6);
@@ -291,19 +307,3 @@
291
307
  .alignRight {
292
308
  @include content-img-align(right);
293
309
  }
294
-
295
- .contentFrame {
296
- background-color: #E0EAEA;
297
- padding: 1.6rem 2.4rem 2.4rem;
298
- border-radius: .8rem;
299
- box-sizing: border-box;
300
- img {
301
- border-radius: .8rem;
302
- }
303
- @include max(mobile) {
304
- img {
305
- margin-left: 0;
306
- width: 100%;
307
- }
308
- }
309
- }
@@ -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({
@@ -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
+ };